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
impl CombatSystemBuilder
pub(super) fn assemble_state( self, parts: RuntimeStateParts, selected_talent_spell_ids: &[u32], encounter: ResolvedEncounter, ) -> CombatStateAssemblyResult
Source§impl CombatSystemBuilder
impl CombatSystemBuilder
pub(in builder::combat_builder) fn finish_build( self, rotation: &Rotation, ) -> CombatBuildResult
Sourcefn register_class_target_debuffs(&mut self)
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.
fn apply_selected_triggered_aura_values(&mut self)
Source§impl CombatSystemBuilder
impl CombatSystemBuilder
Sourcepub fn spell(
self,
name: &str,
id: u32,
f: impl FnOnce(SpellDefinitionDraft) -> Result<SpellDefinitionDraft, BuilderError>,
) -> Self
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.
pub fn aura( self, name: &str, id: u32, f: impl FnOnce(AuraDefinitionDraft) -> Result<AuraDefinitionDraft, BuilderError>, ) -> Self
pub fn auto_attack( self, f: impl FnOnce(AutoAttackDefinitionDraft) -> AutoAttackDefinitionDraft, ) -> Self
Source§impl CombatSystemBuilder
impl CombatSystemBuilder
pub fn talent_selections(self, talents: &[TalentSelection]) -> Self
pub fn talent_spell_ids(self, talents: &[(&str, u32)]) -> Self
pub fn talent_companion_aura( self, talent_spell_id: u32, aura: LocalAuraIdx, ) -> Self
Sourcepub fn talent_gated_aura_effect(
self,
talent_spell_id: u32,
aura: LocalAuraIdx,
source_spell_id: u32,
effect_index: u8,
) -> Self
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.
pub fn set_bonus_auras(self, spell_ids: &[u32]) -> Self
fn register_selected_replacement(&mut self, talent: &TalentSelection)
fn register_selected_passive_aura( &mut self, spell_id: u32, ) -> Option<LocalAuraIdx>
fn aura_id_to_local(&self) -> IntMap<u32, LocalAuraIdx>
Source§impl CombatSystemBuilder
impl CombatSystemBuilder
pub(crate) fn new(stats: CombatStats) -> Self
Sourcepub fn build(
self,
rotation: impl Borrow<Rotation>,
) -> Result<BuiltCombatSystem, CombatBuildError>
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.
pub fn register_impact_proc(self, proc: ImpactProc) -> Self
pub fn register_landed_impact_proc(self, proc: LandedImpactProc) -> Self
pub fn register_impact_effect_proc( self, proc: ImpactEffectProcDefinition, ) -> Self
pub fn register_impact_effect_proc_if_talent( self, talent_spell_id: u32, proc: ImpactEffectProcDefinition, ) -> Self
pub fn mastery_hook(self, hook: MasteryFn) -> Self
pub fn mastery_crit_damage_hook(self, hook: MasteryFn) -> Self
pub fn mastery_spell(self, spell_id: u32) -> Self
pub fn register_item_rppm( self, item_id: u32, rppm: f64, haste_scales: bool, ) -> Self
Sourcepub fn register_item_rppm_from_data(
self,
item_id: u32,
driver_spell_id: u32,
) -> Self
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.
Sourcepub fn rppm(&mut self, rppm: f64, haste_scales: bool) -> LocalRppmIdx
pub fn rppm(&mut self, rppm: f64, haste_scales: bool) -> LocalRppmIdx
Sourcepub fn scaled_rppm(
&mut self,
rppm: f64,
scaling: RppmScalingOptions,
) -> LocalRppmIdx
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.
Sourcepub fn threshold(
&mut self,
increment_max: f64,
roll_over: bool,
) -> LocalThresholdIdx
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.
pub fn spec_id(self, id: SpecId) -> Self
pub fn hero_talent_trees(self, trees: &'static [HeroTalentTreeDesc]) -> Self
pub fn resource(self, name: &str, max: f64, regen: f64) -> Self
Sourcepub fn resource_start(self, start: f64) -> Self
pub fn resource_start(self, start: f64) -> Self
Set the starting resource amount. Negative means start at max.
pub fn resource_type_id(self, id: u8) -> Self
pub fn secondary_resource(self, name: &str, max: f64) -> Self
pub fn secondary_resource_type_id(self, id: u8) -> Self
pub fn has_pet(self, val: bool) -> Self
pub fn game_data(self, data: ResolvedGameData) -> Self
pub fn precombat_aura(self, aura: LocalAuraIdx) -> Self
Sourcepub fn precombat_aura_id(self, aura_id: u32) -> Self
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.
pub fn stealth_aura(self, aura_id: u32) -> Self
pub fn encounter(self, encounter: ResolvedEncounter) -> Self
pub fn item_use_spell(self, gear_slot: GearSlot, spell_id: u32) -> Self
Sourcepub fn on_player_cast(self, hook: CastHookFn) -> Self
pub fn on_player_cast(self, hook: CastHookFn) -> Self
Register a hook fired on every player cast, after the per-spell hook.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CombatSystemBuilder
impl !RefUnwindSafe for CombatSystemBuilder
impl Send for CombatSystemBuilder
impl Sync for CombatSystemBuilder
impl Unpin for CombatSystemBuilder
impl UnsafeUnpin for CombatSystemBuilder
impl !UnwindSafe for CombatSystemBuilder
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