pub struct CombatSystemDraft {Show 26 fields
pub(crate) spec_identity_brand: Option<u32>,
pub(crate) definitions: DraftDefinitions,
pub(crate) indexes: DraftIndexes,
pub(crate) runtime: CombatRuntime,
pub(crate) config: ProgramConfig,
pub(crate) names: Vec<Box<str>>,
pub(crate) spell_ids: FastMap<String, u32>,
pub(crate) damage_spell_ids: Vec<u32>,
pub(crate) effect_spell_ids: Vec<u32>,
pub(crate) generated_damage_identities: Vec<DamageActionId>,
pub(crate) aura_ids: FastMap<String, u32>,
pub(crate) hints: CatalogHints,
pub(crate) gating: Vec<SpellGate>,
pub(crate) cost_bypass: Vec<CostBypass>,
pub(crate) cooldown_bypass: Vec<CooldownBypass>,
pub(crate) overrides: Vec<SpellOverride>,
pub(crate) resource_max: f64,
pub(crate) talent_ranks: Vec<(String, u8)>,
pub(crate) talent_spell_ids: Vec<u32>,
pub(crate) selected_talent_spell_ids: Vec<u32>,
pub(crate) selected_replaced_spell_ids: Vec<u32>,
pub(crate) disabled_spell_ids: Vec<u32>,
pub(crate) initial_weapon_imbues: Vec<(&'static str, bool)>,
pub(crate) ground_effects: Vec<GroundEffectDefinition>,
pub(crate) hook_flat_damage: FastMap<u32, f64>,
pub(crate) hook_scalars: FastMap<u32, f64>,
}Expand description
Mutable composition stage before combat-system finalization.
Fields§
§spec_identity_brand: Option<u32>§definitions: DraftDefinitions§indexes: DraftIndexes§runtime: CombatRuntime§config: ProgramConfig§names: Vec<Box<str>>§spell_ids: FastMap<String, u32>§damage_spell_ids: Vec<u32>§effect_spell_ids: Vec<u32>§generated_damage_identities: Vec<DamageActionId>§aura_ids: FastMap<String, u32>§hints: CatalogHints§gating: Vec<SpellGate>§cost_bypass: Vec<CostBypass>§cooldown_bypass: Vec<CooldownBypass>§overrides: Vec<SpellOverride>§resource_max: f64§talent_ranks: Vec<(String, u8)>§talent_spell_ids: Vec<u32>§selected_talent_spell_ids: Vec<u32>§selected_replaced_spell_ids: Vec<u32>§disabled_spell_ids: Vec<u32>§initial_weapon_imbues: Vec<(&'static str, bool)>§ground_effects: Vec<GroundEffectDefinition>§hook_flat_damage: FastMap<u32, f64>§hook_scalars: FastMap<u32, f64>Implementations§
Source§impl CombatSystemDraft
impl CombatSystemDraft
Sourcepub fn bind_aura(&mut self, binding: AuraBinding, aura_id: u32)
pub fn bind_aura(&mut self, binding: AuraBinding, aura_id: u32)
Bind a codegen-owned semantic aura coordinate during late composition.
Sourcepub fn bind_spell(&mut self, binding: SpellBinding, spell_id: u32)
pub fn bind_spell(&mut self, binding: SpellBinding, spell_id: u32)
Bind a codegen-owned semantic spell coordinate during late composition.
Sourcepub fn set_spec_config<T>(&mut self, config: T)where
T: SpecConfig,
pub fn set_spec_config<T>(&mut self, config: T)where
T: SpecConfig,
Replace the immutable specialization configuration before finalization.
Sourcepub fn set_spec_runtime<T>(&mut self, runtime: T)where
T: SpecRuntime,
pub fn set_spec_runtime<T>(&mut self, runtime: T)where
T: SpecRuntime,
Replace the resettable specialization runtime before finalization.
pub fn set_bug_toggles(&mut self, bugs: BugToggles)
pub fn set_cast_latency(&mut self, cast_latency: CastLatency)
pub fn set_raid_events(&mut self, raid_events: &[RaidEventConfig])
pub fn set_external_buffs(&mut self, external_buffs: &[ExternalBuffConfig])
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 register_damage_identity(
&mut self,
_name: impl Into<String>,
identity: DamageActionId,
)
pub fn register_damage_identity( &mut self, _name: impl Into<String>, identity: DamageActionId, )
Declares a non-castable damage identity referenced by late composition wiring.
Sourcepub fn register_damage_effect_identity(
&mut self,
name: impl Into<String>,
effect: DamageEffectId,
)
pub fn register_damage_effect_identity( &mut self, name: impl Into<String>, effect: DamageEffectId, )
Registers the branded action owning one generated effect coordinate.
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_spells(&mut self, patch: impl FnMut(&mut SpellData))
pub fn patch_spells(&mut self, patch: impl FnMut(&mut SpellData))
Apply a build-time patch to every finalized spell definition.
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, aura-id index, and identity index. Persistent buffer slots are allocated by the consuming finalization transaction.
§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 an impact proc during composition.
Sourcepub fn register_landed_impact_proc(&mut self, proc: LandedImpactProc)
pub fn register_landed_impact_proc(&mut self, proc: LandedImpactProc)
Registers a landed-impact proc during composition.
Sourcepub fn register_accumulating_impact_proc(
&mut self,
proc: AccumulatingImpactProc,
)
pub fn register_accumulating_impact_proc( &mut self, proc: AccumulatingImpactProc, )
Registers an accumulating impact proc during composition.
Sourcepub fn register_resource_gain_proc(&mut self, proc: ResourceGainProc)
pub fn register_resource_gain_proc(&mut self, proc: ResourceGainProc)
Registers a resource-gain proc during composition.
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 an RPPM tracker during composition.
§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 an accumulated-threshold tracker during composition.
§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.
pub fn auras(&self) -> &[AuraData]
pub fn precombat_auras(&self) -> &[LocalAuraIdx]
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 bind_system_rppm(
&mut self,
binding: SystemRppmBinding,
driver_spell_id: u32,
) -> Result<(), EngineError>
pub fn bind_system_rppm( &mut self, binding: SystemRppmBinding, driver_spell_id: u32, ) -> Result<(), EngineError>
Freeze a system RPPM tracker and its category recovery behind a semantic token.
§Errors
Returns an error when the driver spell has no valid RPPM data or the tracker registry is full.
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 content composition.
pub fn base_stats(&self) -> &BaseStats
pub fn game_data(&self) -> &ResolvedGameData
pub fn spell_local(&self, spell_id: u32) -> Option<LocalSpellIdx>
pub fn aura_local(&self, aura_id: u32) -> Option<LocalAuraIdx>
pub fn bug_enabled(&self, bug: &GameBug) -> bool
pub fn spec_config<T>(&self) -> Option<&T>where
T: SpecConfig,
Sourcepub fn set_aura_effect(&mut self, aura: LocalAuraIdx, effect: BuffEffect)
pub fn set_aura_effect(&mut self, aura: LocalAuraIdx, effect: BuffEffect)
Appends an effect to a draft aura before finalization.
§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 talent-dependent DBC-derived rows to prevent duplicate modifiers and returns the number cleared.
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.
Sourcepub fn register_ground_effect(
&mut self,
definition: GroundEffectDefinition,
) -> Result<GroundEffectId, EngineError>
pub fn register_ground_effect( &mut self, definition: GroundEffectDefinition, ) -> Result<GroundEffectId, EngineError>
Registers an authored ground effect for binding during finalization.
§Errors
Returns an error when the ground-effect registry exceeds its u16 identity space.
Sourcepub fn set_hook_flat_damage(&mut self, action: DamageActionId, amount: f64)
pub fn set_hook_flat_damage(&mut self, action: DamageActionId, amount: f64)
Freezes an authored flat-damage payload into the finalized action plan.
Sourcepub fn set_hook_scalar(&mut self, action: DamageActionId, value: f64)
pub fn set_hook_scalar(&mut self, action: DamageActionId, value: f64)
Freezes an authored scalar into the finalized action plan.
Sourcepub fn finalize(
self,
rotation: &Rotation,
) -> Result<BuiltCombatSystem, EngineError>
pub fn finalize( self, rotation: &Rotation, ) -> Result<BuiltCombatSystem, EngineError>
Consume this composition draft and create the immutable program and mutable instance.
§Errors
Returns an error when validation, game-data resolution, rotation compilation, or final binding fails.
pub(crate) fn size_scratch_buffers(&mut self)
fn reachable_damage_spell_ids(&self) -> Vec<u32>
fn buffer_requirements(&self) -> BufferRequirements
fn validate_identities(&self) -> Result<(), EngineError>
fn into_program_and_runtime( self, bindings: FrozenProgramBindings, effects: EffectPlan, damage_plans: (DamagePlan, Box<[GroundEffectPlan]>), aura_dependencies: AuraDependencyPlan, rotation: RotationPlan, ) -> (CombatProgram, CombatRuntime)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CombatSystemDraft
impl !RefUnwindSafe for CombatSystemDraft
impl Send for CombatSystemDraft
impl !Sync for CombatSystemDraft
impl Unpin for CombatSystemDraft
impl UnsafeUnpin for CombatSystemDraft
impl !UnwindSafe for CombatSystemDraft
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