pub struct BuiltCombatSystem {
pub state: CombatState,
pub rotation: RotationEngine,
pub buffer: DenseBuffer,
pub names: Vec<Box<str>>,
}Expand description
Output of a successful crate::CombatSystemBuilder::build call.
Fields§
§state: CombatState§rotation: RotationEngine§buffer: DenseBuffer§names: Vec<Box<str>>Implementations§
Source§impl BuiltCombatSystem
impl BuiltCombatSystem
Sourcepub fn builder(stats: CombatStats) -> CombatSystemBuilder
pub fn builder(stats: CombatStats) -> CombatSystemBuilder
Start a combat-system definition for the supplied base stats.
Sourcepub fn set_pet_action_bar(
&mut self,
npc_id: u32,
action_bar: PetActionBar,
) -> bool
pub fn set_pet_action_bar( &mut self, npc_id: u32, action_bar: PetActionBar, ) -> bool
Attach an action bar to the persistent pet identified by its creature id.
pub fn disable_spell(&mut self, spell_id: u32)
Sourcepub fn patch_spell(
&mut self,
spell: LocalSpellIdx,
patch: impl FnOnce(&mut SpellData),
) -> bool
pub fn patch_spell( &mut self, spell: LocalSpellIdx, patch: impl FnOnce(&mut SpellData), ) -> bool
Apply a build-time spell patch and atomically refresh its buffer projections.
Sourcepub fn patch_aura(
&mut self,
aura: LocalAuraIdx,
patch: impl FnOnce(&mut AuraData),
) -> bool
pub fn patch_aura( &mut self, aura: LocalAuraIdx, patch: impl FnOnce(&mut AuraData), ) -> bool
Apply a build-time aura patch to the authoritative definition.
Sourcepub fn register_aura(
&mut self,
name: impl Into<Box<str>>,
aura: AuraData,
) -> Result<LocalAuraIdx, EngineError>
pub fn register_aura( &mut self, name: impl Into<Box<str>>, aura: AuraData, ) -> Result<LocalAuraIdx, EngineError>
Register an aura added after the declarative combat system has been built.
This synchronizes the name table, definition, spell-id index, and identity index. Player auras also receive their persistent buffer slot immediately.
§Errors
Returns an error when the runtime aura registry exceeds its local-index capacity.
Sourcepub fn register_impact_proc(&mut self, proc: ImpactProc)
pub fn register_impact_proc(&mut self, proc: ImpactProc)
Registers a post-build impact proc.
Sourcepub fn register_landed_impact_proc(&mut self, proc: LandedImpactProc)
pub fn register_landed_impact_proc(&mut self, proc: LandedImpactProc)
Registers a post-build landed-impact proc.
Sourcepub fn register_accumulating_impact_proc(
&mut self,
proc: AccumulatingImpactProc,
)
pub fn register_accumulating_impact_proc( &mut self, proc: AccumulatingImpactProc, )
Registers a post-build accumulating impact proc.
Sourcepub fn register_resource_gain_proc(&mut self, proc: ResourceGainProc)
pub fn register_resource_gain_proc(&mut self, proc: ResourceGainProc)
Registers a post-build resource-gain proc.
Sourcepub fn register_rppm_tracker(
&mut self,
tracker: RppmTracker,
) -> Result<LocalRppmIdx, EngineError>
pub fn register_rppm_tracker( &mut self, tracker: RppmTracker, ) -> Result<LocalRppmIdx, EngineError>
Registers a post-build RPPM tracker.
§Errors
Returns an error when the local tracker-index capacity is exhausted.
Sourcepub fn register_weapon_enchant_binding(
&mut self,
binding: WeaponEnchantBinding,
tracker: RppmTracker,
) -> Result<bool, EngineError>
pub fn register_weapon_enchant_binding( &mut self, binding: WeaponEnchantBinding, tracker: RppmTracker, ) -> Result<bool, EngineError>
Register one equipped weapon-enchant source and its shared RPPM tracker.
Duplicate enchantment IDs return false; the first binding installs the impact dispatcher.
§Errors
Returns an error when the local tracker-index capacity is exhausted.
Sourcepub fn register_threshold_tracker(
&mut self,
tracker: ThresholdTracker,
) -> Result<LocalThresholdIdx, EngineError>
pub fn register_threshold_tracker( &mut self, tracker: ThresholdTracker, ) -> Result<LocalThresholdIdx, EngineError>
Registers a post-build accumulated-threshold tracker.
§Errors
Returns an error when the local tracker-index capacity is exhausted.
Sourcepub fn push_precombat_aura(&mut self, aura: LocalAuraIdx)
pub fn push_precombat_aura(&mut self, aura: LocalAuraIdx)
Appends an aura to the precombat application set.
Sourcepub fn set_precombat_aura(&mut self, aura: LocalAuraIdx, enabled: bool)
pub fn set_precombat_aura(&mut self, aura: LocalAuraIdx, enabled: bool)
Include or exclude an aura from the precombat application set.
Sourcepub fn remove_precombat_aura(&mut self, aura: LocalAuraIdx)
pub fn remove_precombat_aura(&mut self, aura: LocalAuraIdx)
Removes an aura from every precombat talent projection.
Sourcepub fn register_player_cast_hook(&mut self, hook: CastHookFn)
pub fn register_player_cast_hook(&mut self, hook: CastHookFn)
Registers a hook fired after every player cast.
Sourcepub fn aura(&self, aura: LocalAuraIdx) -> Option<&AuraData>
pub fn aura(&self, aura: LocalAuraIdx) -> Option<&AuraData>
Returns a registered aura definition.
Sourcepub fn rppm_tracker(&self, tracker: LocalRppmIdx) -> Option<&RppmTracker>
pub fn rppm_tracker(&self, tracker: LocalRppmIdx) -> Option<&RppmTracker>
Returns a registered RPPM tracker.
Sourcepub fn impact_proc(&self, index: usize) -> Option<&ImpactProc>
pub fn impact_proc(&self, index: usize) -> Option<&ImpactProc>
Returns a registered impact proc.
Sourcepub fn impact_proc_count(&self) -> usize
pub fn impact_proc_count(&self) -> usize
Returns the number of registered impact procs.
Sourcepub fn impact_effect_proc(&self, index: usize) -> Option<&ImpactEffectProc>
pub fn impact_effect_proc(&self, index: usize) -> Option<&ImpactEffectProc>
Returns a registered lowered impact-effect proc.
Sourcepub fn impact_effect_proc_count(&self) -> usize
pub fn impact_effect_proc_count(&self) -> usize
Returns the number of registered lowered impact-effect procs.
Sourcepub fn spell_effects(&self) -> &[SpellEffectData]
pub fn spell_effects(&self) -> &[SpellEffectData]
Returns the lowered spell-effect program arena for read-only inspection.
Sourcepub fn talent_rank(&self, spell_id: u32) -> Option<u8>
pub fn talent_rank(&self, spell_id: u32) -> Option<u8>
Returns the selected rank of a talent spell.
Sourcepub fn rppm_tracker_count(&self) -> usize
pub fn rppm_tracker_count(&self) -> usize
Returns the number of registered RPPM trackers.
Sourcepub fn player_cast_hook_count(&self) -> usize
pub fn player_cast_hook_count(&self) -> usize
Returns the number of registered player-cast hooks.
Sourcepub fn spell_count(&self) -> usize
pub fn spell_count(&self) -> usize
Returns the number of registered spells.
Sourcepub fn first_auto_attack(&self) -> Option<&AutoAttackData>
pub fn first_auto_attack(&self) -> Option<&AutoAttackData>
Returns the first auto-attack definition.
Sourcepub fn patch_auto_attacks(&mut self, patch: impl FnOnce(&mut [AutoAttackData]))
pub fn patch_auto_attacks(&mut self, patch: impl FnOnce(&mut [AutoAttackData]))
Applies a build-time patch to the registered auto-attack definitions.
Sourcepub fn register_system_rppm_from_data(
&mut self,
driver_spell_id: u32,
) -> Result<LocalRppmIdx, EngineError>
pub fn register_system_rppm_from_data( &mut self, driver_spell_id: u32, ) -> Result<LocalRppmIdx, EngineError>
Register a system-level RPPM source from its DBC driver spell.
The definition and driver lookup are committed together. Re-registering the same driver is idempotent and returns its existing local index.
§Errors
Returns a typed spec-construction error when the driver has no finite positive RPPM rate. It also errors when the local tracker-index capacity is exhausted.
Sourcepub fn patch_base_stats(&mut self, patch: impl FnOnce(&mut BaseStats))
pub fn patch_base_stats(&mut self, patch: impl FnOnce(&mut BaseStats))
Apply a build-time base-stat patch and refresh the primary resource projection.
Sourcepub fn base_combat_stats(&self) -> &CombatStats
pub fn base_combat_stats(&self) -> &CombatStats
Return the resolved baseline combat stats used by post-build content registration.
Sourcepub fn set_aura_effect(&mut self, aura: LocalAuraIdx, effect: BuffEffect)
pub fn set_aura_effect(&mut self, aura: LocalAuraIdx, effect: BuffEffect)
Appends a runtime effect to an already-built aura.
§Panics
Panics in debug builds if aura is not registered, or in all builds if its fixed-capacity effect list is full.
Sourcepub fn mask_aura_dbc_effect(
&mut self,
aura: LocalAuraIdx,
source_spell_id: u32,
effect_index: u8,
) -> usize
pub fn mask_aura_dbc_effect( &mut self, aura: LocalAuraIdx, source_spell_id: u32, effect_index: u8, ) -> usize
Removes the rows an aura derived from one DBC spell effect, returning how many were cleared.
The shared resolution consumes every modifier effect a live aura’s spell declares.
Some are scripted in game to apply only under a talent, or to be replaced by a different
effect when one is picked, which is what SimC spells out per spec with
register_passive_effect_mask.
Content masks the effect here and then wires whatever its talent state calls for; leaving
both in place makes every hit take the modifier twice.
Sourcepub fn duplicate_aura_dbc_effect(
&mut self,
aura: LocalAuraIdx,
source_spell_id: u32,
effect_index: u8,
) -> usize
pub fn duplicate_aura_dbc_effect( &mut self, aura: LocalAuraIdx, source_spell_id: u32, effect_index: u8, ) -> usize
Duplicates rows lowered from one DBC effect while preserving their resolved payload.
Intended for modeled live-game bugs where the server applies the same modifier twice. Content identifies only the source coordinate.
Sourcepub fn register_driver_spell_modifier(&mut self, modifier: DriverSpellModifier)
pub fn register_driver_spell_modifier(&mut self, modifier: DriverSpellModifier)
Register an always-present spell modifier under its real spell/passive driver.
Sourcepub fn register_passive_driver_effect(&mut self, effect: PassiveDriverEffect)
pub fn register_passive_driver_effect(&mut self, effect: PassiveDriverEffect)
Register an always-present player effect under its real spell/passive driver.
Sourcepub fn register_weapon_imbue(
&mut self,
spell_id: u32,
key: &'static str,
initially_active: bool,
)
pub fn register_weapon_imbue( &mut self, spell_id: u32, key: &'static str, initially_active: bool, )
Register a real weapon-imbue action and initialize its persistent equipment state.
Sourcepub fn register_periodic_driver(&mut self, driver: PeriodicDriver)
pub fn register_periodic_driver(&mut self, driver: PeriodicDriver)
Register encounter-lifetime periodic work under its real spell/passive driver.
pub(crate) fn size_scratch_buffers(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BuiltCombatSystem
impl !RefUnwindSafe for BuiltCombatSystem
impl Send for BuiltCombatSystem
impl !Sync for BuiltCombatSystem
impl Unpin for BuiltCombatSystem
impl UnsafeUnpin for BuiltCombatSystem
impl !UnwindSafe for BuiltCombatSystem
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more