overlord_event_system/behaviors/
fixtures.rs

1//! Test-fixture behaviors quarantine.
2//!
3//! Fixture behaviors live next to their production siblings (same modules,
4//! same registration) so their determinism notes stay in context, but they are
5//! **stripped from the registry in production builds**: [`strip`] removes
6//! every name below unless the `fixtures` cargo feature (enabled by test
7//! builds) is on. The committed `behavior_catalog.json` is generated from the
8//! stripped registry, so admin dropdowns only offer production behaviors.
9
10use crate::behaviors::BehaviorRegistry;
11
12/// Every behavior name that exists only for `tests_game_config.rs` fixtures.
13pub const FIXTURE_BEHAVIOR_NAMES: &[&str] = &[
14    // additional_quests
15    "test_loop_task_0",
16    "test_loop_task_1",
17    "test_loop_task_2",
18    "test_loop_task_seed",
19    // cast_ability
20    "ability_apply_bloodleak_effect",
21    "ability_apply_low_hp_heal_effect",
22    "ability_damage_target_5",
23    // cast_projectile
24    "projectile_damage_target_5",
25    // conditional_progress
26    "quest_current_0_then_1_else_2",
27    "quest_event_level_1_then_2",
28    // currencies
29    "test_afk_currency_step0",
30    // vassal_reward
31    "test_vassal_link_reward_42",
32    "test_vassal_task_reward_0_42",
33    "test_vassal_task_reward_42_32",
34    // vassal_loyalty
35    "test_vassal_task_loyalty_0_42",
36    "test_vassal_task_loyalty_42_32",
37    // default_loop_task
38    "test_default_loop_task",
39    // event (effect ticks)
40    "bloodleak_tick",
41    "low_hp_heal_on_damage",
42    "spawn_two_on_death",
43    // fight_start
44    "apply_spawn_on_death_to_player",
45    "damage_first_entity_5",
46    "noop",
47    // start_cast_ability
48    "attack_first_enemy",
49    "self_attack_500",
50    // start_cast_projectile
51    "projectile_fixed_500_damage_300",
52];
53
54/// Remove every fixture behavior from `registry` (production builds).
55pub fn strip(registry: &mut BehaviorRegistry) {
56    for name in FIXTURE_BEHAVIOR_NAMES {
57        registry.remove(name);
58    }
59}