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 "ability_test_swing",
24 "ability_test_swing_aoe",
25 // cast_projectile
26 "projectile_damage_target_5",
27 // conditional_progress
28 "quest_current_0_then_1_else_2",
29 "quest_event_level_1_then_2",
30 // currencies
31 "test_afk_currency_step0",
32 // vassal_reward
33 "test_vassal_link_reward_42",
34 "test_vassal_task_reward_0_42",
35 "test_vassal_task_reward_42_32",
36 // vassal_loyalty
37 "test_vassal_task_loyalty_0_42",
38 "test_vassal_task_loyalty_42_32",
39 // default_loop_task
40 "test_default_loop_task",
41 // event (effect ticks)
42 "bloodleak_tick",
43 "low_hp_heal_on_damage",
44 "spawn_two_on_death",
45 // fight_start
46 "apply_spawn_on_death_to_player",
47 "damage_first_entity_5",
48 "noop",
49 // start_cast_ability
50 "attack_first_enemy",
51 "self_attack_500",
52 // start_cast_projectile
53 "projectile_fixed_500_damage_300",
54];
55
56/// Remove every fixture behavior from `registry` (production builds).
57pub fn strip(registry: &mut BehaviorRegistry) {
58 for name in FIXTURE_BEHAVIOR_NAMES {
59 registry.remove(name);
60 }
61}