Skip to main content

CombatSystemDraft

Struct CombatSystemDraft 

Source
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

Source

pub fn bind_aura(&mut self, binding: AuraBinding, aura_id: u32)

Bind a codegen-owned semantic aura coordinate during late composition.

Source

pub fn bind_spell(&mut self, binding: SpellBinding, spell_id: u32)

Bind a codegen-owned semantic spell coordinate during late composition.

Source

pub fn set_spec_config<T>(&mut self, config: T)
where T: SpecConfig,

Replace the immutable specialization configuration before finalization.

Source

pub fn set_spec_runtime<T>(&mut self, runtime: T)
where T: SpecRuntime,

Replace the resettable specialization runtime before finalization.

Source

pub fn set_bug_toggles(&mut self, bugs: BugToggles)

Source

pub fn set_cast_latency(&mut self, cast_latency: CastLatency)

Source

pub fn set_raid_events(&mut self, raid_events: &[RaidEventConfig])

Source

pub fn set_external_buffs(&mut self, external_buffs: &[ExternalBuffConfig])

Source

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.

Source

pub fn disable_spell(&mut self, spell_id: u32)

Source

pub fn register_damage_identity( &mut self, _name: impl Into<String>, identity: DamageActionId, )

Declares a non-castable damage identity referenced by late composition wiring.

Source

pub fn register_damage_effect_identity( &mut self, name: impl Into<String>, effect: DamageEffectId, )

Registers the branded action owning one generated effect coordinate.

Source

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.

Source

pub fn patch_spells(&mut self, patch: impl FnMut(&mut SpellData))

Apply a build-time patch to every finalized spell definition.

Source

pub fn patch_aura( &mut self, aura: LocalAuraIdx, patch: impl FnOnce(&mut AuraData), ) -> bool

Apply a build-time aura patch to the authoritative definition.

Source

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.

Source

pub fn register_impact_proc(&mut self, proc: ImpactProc)

Registers an impact proc during composition.

Source

pub fn register_landed_impact_proc(&mut self, proc: LandedImpactProc)

Registers a landed-impact proc during composition.

Source

pub fn register_accumulating_impact_proc( &mut self, proc: AccumulatingImpactProc, )

Registers an accumulating impact proc during composition.

Source

pub fn register_resource_gain_proc(&mut self, proc: ResourceGainProc)

Registers a resource-gain proc during composition.

Source

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.

Source

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.

Source

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.

Source

pub fn push_precombat_aura(&mut self, aura: LocalAuraIdx)

Appends an aura to the precombat application set.

Source

pub fn set_precombat_aura(&mut self, aura: LocalAuraIdx, enabled: bool)

Include or exclude an aura from the precombat application set.

Source

pub fn remove_precombat_aura(&mut self, aura: LocalAuraIdx)

Removes an aura from every precombat talent projection.

Source

pub fn register_player_cast_hook(&mut self, hook: CastHookFn)

Registers a hook fired after every player cast.

Source

pub fn aura(&self, aura: LocalAuraIdx) -> Option<&AuraData>

Returns a registered aura definition.

Source

pub fn auras(&self) -> &[AuraData]

Source

pub fn precombat_auras(&self) -> &[LocalAuraIdx]

Source

pub fn rppm_tracker(&self, tracker: LocalRppmIdx) -> Option<&RppmTracker>

Returns a registered RPPM tracker.

Source

pub fn impact_proc(&self, index: usize) -> Option<&ImpactProc>

Returns a registered impact proc.

Source

pub fn impact_proc_count(&self) -> usize

Returns the number of registered impact procs.

Source

pub fn impact_effect_proc(&self, index: usize) -> Option<&ImpactEffectProc>

Returns a registered lowered impact-effect proc.

Source

pub fn impact_effect_proc_count(&self) -> usize

Returns the number of registered lowered impact-effect procs.

Source

pub fn spell_effects(&self) -> &[SpellEffectData]

Returns the lowered spell-effect program arena for read-only inspection.

Source

pub fn talent_rank(&self, spell_id: u32) -> Option<u8>

Returns the selected rank of a talent spell.

Source

pub fn rppm_tracker_count(&self) -> usize

Returns the number of registered RPPM trackers.

Source

pub fn player_cast_hook_count(&self) -> usize

Returns the number of registered player-cast hooks.

Source

pub fn spell_count(&self) -> usize

Returns the number of registered spells.

Source

pub fn first_auto_attack(&self) -> Option<&AutoAttackData>

Returns the first auto-attack definition.

Source

pub fn patch_auto_attacks(&mut self, patch: impl FnOnce(&mut [AutoAttackData]))

Applies a build-time patch to the registered auto-attack definitions.

Source

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.

Source

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.

Source

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.

Source

pub fn base_combat_stats(&self) -> &CombatStats

Return the resolved baseline combat stats used by content composition.

Source

pub fn base_stats(&self) -> &BaseStats

Source

pub fn game_data(&self) -> &ResolvedGameData

Source

pub fn spell_local(&self, spell_id: u32) -> Option<LocalSpellIdx>

Source

pub fn aura_local(&self, aura_id: u32) -> Option<LocalAuraIdx>

Source

pub fn bug_enabled(&self, bug: &GameBug) -> bool

Source

pub fn spec_config<T>(&self) -> Option<&T>
where T: SpecConfig,

Source

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.

Source

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.

Source

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.

Source

pub fn register_driver_spell_modifier(&mut self, modifier: DriverSpellModifier)

Register an always-present spell modifier under its real spell/passive driver.

Source

pub fn register_passive_driver_effect(&mut self, effect: PassiveDriverEffect)

Register an always-present player effect under its real spell/passive driver.

Source

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.

Source

pub fn register_periodic_driver(&mut self, driver: PeriodicDriver)

Register encounter-lifetime periodic work under its real spell/passive driver.

Source

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.

Source

pub fn set_hook_flat_damage(&mut self, action: DamageActionId, amount: f64)

Freezes an authored flat-damage payload into the finalized action plan.

Source

pub fn set_hook_scalar(&mut self, action: DamageActionId, value: f64)

Freezes an authored scalar into the finalized action plan.

Source

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.

Source

pub(crate) fn size_scratch_buffers(&mut self)

Source

fn reachable_damage_spell_ids(&self) -> Vec<u32>

Source

fn buffer_requirements(&self) -> BufferRequirements

Source

fn validate_identities(&self) -> Result<(), EngineError>

Source

fn into_program_and_runtime( self, bindings: FrozenProgramBindings, effects: EffectPlan, damage_plans: (DamagePlan, Box<[GroundEffectPlan]>), aura_dependencies: AuraDependencyPlan, rotation: RotationPlan, ) -> (CombatProgram, CombatRuntime)

Trait Implementations§

Source§

impl Debug for CombatSystemDraft

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> SpecConfig for T
where T: Any + Debug + Send,

§

fn as_any(&self) -> &(dyn Any + 'static)

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more