Skip to main content

CombatSystemBuilder

Struct CombatSystemBuilder 

Source
pub struct CombatSystemBuilder {
Show 46 fields spec_id: Option<SpecId>, stats: CombatStats, spells: Vec<BuilderSpellDef>, cast_hooks: Vec<Option<CastHookFn>>, empower_release_hooks: Vec<Option<fn(_: &HookCtx<'_>, rank: u8) -> EmpowerReleaseAdjustment>>, tick_hooks: Vec<Option<CastHookFn>>, player_cast_hooks: Vec<CastHookFn>, aura_defs: Vec<BuilderAuraDef>, auto_attacks: Vec<AutoAttackDefinitionDraft>, resource_max: f64, resource_regen: f64, resource_start: f64, resource_name: String, resource_type_id: u8, secondary_resource_name: Option<String>, secondary_resource_max: f64, secondary_resource_type_id: u8, spell_ids: FastMap<String, u32>, aura_ids: FastMap<String, u32>, hints: CatalogHints, has_pet: bool, game_data: ResolvedGameData, precombat_auras: Vec<LocalAuraIdx>, talent_aura_stacks: Vec<(LocalAuraIdx, u8)>, talent_spell_ids: Vec<u32>, talent_names_by_id: IntMap<u32, String>, selected_talent_spell_ids: Vec<u32>, selected_replaced_spell_ids: Vec<u32>, selected_talent_ranks: IntMap<u32, u8>, selected_hero_trees: Vec<Box<str>>, hero_talent_trees: &'static [HeroTalentTreeDesc], stealth_aura_id: Option<u32>, encounter: Option<ResolvedEncounter>, item_use_spells: Vec<(GearSlot, u32)>, rppm_trackers: Vec<RppmTracker>, threshold_trackers: Vec<ThresholdTracker>, item_rppm_indices: IntMap<u32, LocalRppmIdx>, impact_procs: Vec<ImpactProc>, landed_impact_procs: Vec<LandedImpactProc>, accumulating_impact_procs: Vec<AccumulatingImpactProc>, resource_gain_procs: Vec<ResourceGainProc>, impact_effect_procs: Vec<ImpactEffectProcDefinition>, mastery_hook: MasteryFn, mastery_crit_damage: MasteryFn, mastery_spell: SpellIdx, pending_error: Option<BuilderError>,
}
Expand description

Fluent builder for constructing a combat system.

Fields§

§spec_id: Option<SpecId>§stats: CombatStats§spells: Vec<BuilderSpellDef>§cast_hooks: Vec<Option<CastHookFn>>§empower_release_hooks: Vec<Option<fn(_: &HookCtx<'_>, rank: u8) -> EmpowerReleaseAdjustment>>§tick_hooks: Vec<Option<CastHookFn>>§player_cast_hooks: Vec<CastHookFn>§aura_defs: Vec<BuilderAuraDef>§auto_attacks: Vec<AutoAttackDefinitionDraft>§resource_max: f64§resource_regen: f64§resource_start: f64§resource_name: String§resource_type_id: u8§secondary_resource_name: Option<String>§secondary_resource_max: f64§secondary_resource_type_id: u8§spell_ids: FastMap<String, u32>§aura_ids: FastMap<String, u32>§hints: CatalogHints§has_pet: bool§game_data: ResolvedGameData§precombat_auras: Vec<LocalAuraIdx>§talent_aura_stacks: Vec<(LocalAuraIdx, u8)>§talent_spell_ids: Vec<u32>§talent_names_by_id: IntMap<u32, String>§selected_talent_spell_ids: Vec<u32>§selected_replaced_spell_ids: Vec<u32>§selected_talent_ranks: IntMap<u32, u8>§selected_hero_trees: Vec<Box<str>>§hero_talent_trees: &'static [HeroTalentTreeDesc]§stealth_aura_id: Option<u32>§encounter: Option<ResolvedEncounter>§item_use_spells: Vec<(GearSlot, u32)>§rppm_trackers: Vec<RppmTracker>§threshold_trackers: Vec<ThresholdTracker>§item_rppm_indices: IntMap<u32, LocalRppmIdx>§impact_procs: Vec<ImpactProc>§landed_impact_procs: Vec<LandedImpactProc>§accumulating_impact_procs: Vec<AccumulatingImpactProc>§resource_gain_procs: Vec<ResourceGainProc>§impact_effect_procs: Vec<ImpactEffectProcDefinition>§mastery_hook: MasteryFn§mastery_crit_damage: MasteryFn§mastery_spell: SpellIdx§pending_error: Option<BuilderError>

Implementations§

Source§

impl CombatSystemBuilder

Source

pub(super) fn assemble_state( self, parts: RuntimeStateParts, selected_talent_spell_ids: &[u32], encounter: ResolvedEncounter, ) -> CombatStateAssemblyResult

Source§

impl CombatSystemBuilder

Source

pub(in builder::combat_builder) fn finish_build( self, rotation: &Rotation, ) -> CombatBuildResult

Source

fn register_class_target_debuffs(&mut self)

Registers the class’s self-provided damage-taken debuffs as permanent target auras.

A lone monk still applies Mystic Touch and a lone demon hunter still brands its target. optimal_raid governs only the external raid provider (sc_demon_hunter.cpp:2577). The debuff’s DBC duration is infinite, so a precombat application is its whole lifecycle.

Source

fn apply_selected_triggered_aura_values(&mut self)

Source§

impl CombatSystemBuilder

Source

pub fn spell( self, name: &str, id: u32, f: impl FnOnce(SpellDefinitionDraft) -> Result<SpellDefinitionDraft, BuilderError>, ) -> Self

Registers a spell definition.

§Panics

Panics if the validated aura registry exceeds the local-index capacity.

Source

pub fn aura( self, name: &str, id: u32, f: impl FnOnce(AuraDefinitionDraft) -> Result<AuraDefinitionDraft, BuilderError>, ) -> Self

Source

pub fn auto_attack( self, f: impl FnOnce(AutoAttackDefinitionDraft) -> AutoAttackDefinitionDraft, ) -> Self

Source§

impl CombatSystemBuilder

Source

pub fn talent_selections(self, talents: &[TalentSelection]) -> Self

Source

pub fn talent_spell_ids(self, talents: &[(&str, u32)]) -> Self

Source

pub fn talent_companion_aura( self, talent_spell_id: u32, aura: LocalAuraIdx, ) -> Self

Source

pub fn talent_gated_aura_effect( self, talent_spell_id: u32, aura: LocalAuraIdx, source_spell_id: u32, effect_index: u8, ) -> Self

Retains or copies one data-derived aura effect only when talent_spell_id is selected.

Call this after Self::talent_selections. The source identifies an effect already lowered from resolved game data. A different aura receives copies that preserve the DBC source coordinate. Content does not provide a replacement payload.

Source

pub fn set_bonus_auras(self, spell_ids: &[u32]) -> Self

Source

fn register_selected_replacement(&mut self, talent: &TalentSelection)

Source

fn register_selected_passive_aura( &mut self, spell_id: u32, ) -> Option<LocalAuraIdx>

Source

fn aura_id_to_local(&self) -> IntMap<u32, LocalAuraIdx>

Source§

impl CombatSystemBuilder

Source

pub(crate) fn new(stats: CombatStats) -> Self

Source

pub fn build( self, rotation: impl Borrow<Rotation>, ) -> Result<BuiltCombatSystem, CombatBuildError>

Validate and lower the definition into immutable combat state.

§Errors

Returns an engine construction error when the catalog is invalid or the rotation cannot be compiled.

Source

pub fn register_impact_proc(self, proc: ImpactProc) -> Self

Source

pub fn register_landed_impact_proc(self, proc: LandedImpactProc) -> Self

Source

pub fn register_impact_effect_proc( self, proc: ImpactEffectProcDefinition, ) -> Self

Source

pub fn register_impact_effect_proc_if_talent( self, talent_spell_id: u32, proc: ImpactEffectProcDefinition, ) -> Self

Source

pub fn mastery_hook(self, hook: MasteryFn) -> Self

Source

pub fn mastery_crit_damage_hook(self, hook: MasteryFn) -> Self

Source

pub fn mastery_spell(self, spell_id: u32) -> Self

Source

pub fn register_item_rppm( self, item_id: u32, rppm: f64, haste_scales: bool, ) -> Self

Source

pub fn register_item_rppm_from_data( self, item_id: u32, driver_spell_id: u32, ) -> Self

Register an item’s RPPM tracker from its resolved DBC driver.

Source

pub fn rppm(&mut self, rppm: f64, haste_scales: bool) -> LocalRppmIdx

Registers an RPPM tracker.

§Panics

Panics if the tracker registry exceeds the local-index capacity.

Source

pub fn scaled_rppm( &mut self, rppm: f64, scaling: RppmScalingOptions, ) -> LocalRppmIdx

Registers an RPPM tracker with all supported rate-scaling coordinates.

§Panics

Panics if the tracker registry exceeds the local-index capacity.

Source

pub fn threshold( &mut self, increment_max: f64, roll_over: bool, ) -> LocalThresholdIdx

Registers an accumulated-threshold proc source.

§Panics

Panics if the threshold registry exceeds the local-index capacity.

Source

pub fn spec_id(self, id: SpecId) -> Self

Source

pub fn hero_talent_trees(self, trees: &'static [HeroTalentTreeDesc]) -> Self

Source

pub fn resource(self, name: &str, max: f64, regen: f64) -> Self

Source

pub fn resource_start(self, start: f64) -> Self

Set the starting resource amount. Negative means start at max.

Source

pub fn resource_type_id(self, id: u8) -> Self

Source

pub fn secondary_resource(self, name: &str, max: f64) -> Self

Source

pub fn secondary_resource_type_id(self, id: u8) -> Self

Source

pub fn has_pet(self, val: bool) -> Self

Source

pub fn game_data(self, data: ResolvedGameData) -> Self

Source

pub fn precombat_aura(self, aura: LocalAuraIdx) -> Self

Source

pub fn precombat_aura_id(self, aura_id: u32) -> Self

Register a precombat aura by game id, resolved against the auras registered so far (item auras have no codegen-time-stable global local index).

§Panics

Panics if the validated aura registry exceeds the local-index capacity.

Source

pub fn stealth_aura(self, aura_id: u32) -> Self

Source

pub fn encounter(self, encounter: ResolvedEncounter) -> Self

Source

pub fn item_use_spell(self, gear_slot: GearSlot, spell_id: u32) -> Self

Source

pub fn on_player_cast(self, hook: CastHookFn) -> Self

Register a hook fired on every player cast, after the per-spell hook.

Trait Implementations§

Source§

impl Debug for CombatSystemBuilder

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

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

Source§

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

impl<T> ResolverSyncBound for T
where T: Sync + ?Sized,