wowlab_engine_combat/systems/
buffs.rs1use wowlab_engine_domain::{
4 dbc::{ModifierOperation, ResolvedGameDataSemanticExt as _, SpellEffectAttributes},
5 rotation::DenseBuffer,
6};
7use wowlab_types::{
8 constants::{DEFAULT_GCD_MS, GCD_FLOOR_MS, HUNDRED},
9 sim::{ActorId, EnemyIdx, SimTime},
10};
11
12use crate::{
13 context::{ActorView, CombatView},
14 state::{BuffEffect, BuffTotals, CombatState, ResourcePool},
15};
16
17const DEFAULT_PERIODIC_INTERVAL_MS: u32 = 1_000;
18const MIN_TIME_RATE_DELTA: f64 = -0.99;
19
20#[derive(Clone, Copy, Debug, Eq, PartialEq)]
21pub(crate) enum IncomingSpellDefense {
22 None,
23 Reflected,
24 Deflected,
25}
26
27mod costs;
28mod haste;
29mod modifiers;
30mod timing;
31mod totals;
32mod traversal;
33
34pub(crate) use costs::{
35 base_optional_primary_spell_cost, base_primary_spell_cost, current_resource_gain_mult,
36 effective_optional_spell_cost, effective_spell_cost, sync_player_health_from_stamina,
37 sync_spell_costs,
38};
39pub(crate) use haste::{
40 aura_time_rate_multiplier, current_attack_haste_mult, current_auto_attack_mult_for,
41 current_haste_mult, current_haste_mult_for, current_mastery_points, current_rppm_scaling,
42 current_stat_haste_mult,
43};
44#[cfg(test)]
45pub(crate) use haste::{current_auto_attack_mult, time_rate_factor};
46pub(crate) use modifiers::{
47 active_auto_attack_replacement, active_effect_amplitude, active_effect_points,
48 active_form_combat_round_time_ms, active_spell_modifier_value, active_spell_school_override,
49 active_stance_mask_exception, active_targeting_value, resolve_incoming_spell_defense,
50 spell_modifier_owner, target_aura_mechanic_mask,
51};
52pub(crate) use timing::{
53 data_driven_actor_timing_modifiers, effective_aura_duration_ms, effective_cast_time_ms,
54 effective_gcd_ms, effective_periodic_interval_ms, effective_periodic_tick_ms,
55};
56pub use totals::accumulate_buffs;
57pub(crate) use totals::{accumulate_actor_buffs, accumulate_actor_only_buffs};
58pub(crate) use traversal::{
59 dbc_effect_points, for_each_active_actor_aura_effect, for_each_active_aura_effect,
60 for_each_active_target_aura_effect,
61};
62
63#[cfg(test)]
64#[path = "buffs/tests.rs"]
65mod tests;