Documentation
¶
Overview ¶
Proto-based function interface for the simulator
Index ¶
- Constants
- Variables
- func AddPresetEncounter(name string, targetPaths []string)
- func AddPresetTarget(newPreset PresetTarget)
- func AddWeaponEffect(id int32, weaponEffect ApplyWeaponEffect)
- func ApplyPetConsumeEffects(pet *Character, ownerConsumes proto.Consumes)
- func BothTimersReady(t1 *Timer, t2 *Timer, sim *Simulation) bool
- func BothTimersReadyAt(t1 *Timer, t2 *Timer) time.Duration
- func CharacterStatsTest(label string, t *testing.T, raid *proto.Raid, expectedStats stats.Stats)
- func ComputeStats(csr *proto.ComputeStatsRequest) *proto.ComputeStatsResult
- func DamageRoll(sim *Simulation, minDamage float64, maxDamage float64) float64
- func DamageRollFunc(minDamage float64, maxDamage float64) func(*Simulation) float64
- func DurationFromSeconds(numSeconds float64) time.Duration
- func GetActionAvgCast(playerMetrics proto.UnitMetrics, actionID ActionID) float64
- func GetActionDPS(playerMetrics proto.UnitMetrics, iterations int32, duration time.Duration, ...) float64
- func GetGearList(request *proto.GearListRequest) *proto.GearListResult
- func GetTristateValueFloat(effect proto.TristateEffect, regularValue float64, impValue float64) float64
- func GetTristateValueInt32(effect proto.TristateEffect, regularValue int32, impValue int32) int32
- func HasItemEffect(id int32) bool
- func HasWeaponEffect(id int32) bool
- func InnervateManaThreshold(character *Character) float64
- func IsEligibleForWindfuryTotem(character *Character) bool
- func MakeSingleTargetEncounter(variation float64) *proto.Encounter
- func MakeTristateValue(hasRegular bool, hasImproved bool) proto.TristateEffect
- func ManaTideTotemAmount(character *Character) float64
- func MaxDuration(a time.Duration, b time.Duration) time.Duration
- func MaxFloat(a float64, b float64) float64
- func MaxInt(a int, b int) int
- func MaxInt32(a int32, b int32) int32
- func MaxTimeToReady(t1 *Timer, t2 *Timer, sim *Simulation) time.Duration
- func MaxTristate(a proto.TristateEffect, b proto.TristateEffect) proto.TristateEffect
- func MinDuration(a time.Duration, b time.Duration) time.Duration
- func MinFloat(a float64, b float64) float64
- func MinInt(a int, b int) int
- func MinInt32(a int32, b int32) int32
- func MinTristate(a proto.TristateEffect, b proto.TristateEffect) proto.TristateEffect
- func NewDefaultTarget() *proto.Target
- func NewItemEffect(id int32, itemEffect ApplyEffect)
- func PlayerProtoToSpec(player proto.Player) proto.Spec
- func RaidBenchmark(b *testing.B, rsr *proto.RaidSimRequest)
- func RaidPlayersWithSpec(raid proto.Raid, spec proto.Spec) []*proto.Player
- func RaidSimTest(label string, t *testing.T, rsr *proto.RaidSimRequest, expectedDps float64)
- func RegisterAgentFactory(emptyOptions interface{}, spec proto.Spec, factory AgentFactory, ...)
- func RegisterTemporaryStatsOnUseCD(character *Character, auraLabel string, tempStats stats.Stats, ...)
- func RunRaidSim(request *proto.RaidSimRequest) *proto.RaidSimResult
- func RunRaidSimAsync(request *proto.RaidSimRequest, progress chan *proto.ProgressMetrics)
- func RunSim(rsr proto.RaidSimRequest, progress chan *proto.ProgressMetrics) (result *proto.RaidSimResult)
- func RunTestSuite(t *testing.T, suiteName string, generator TestGenerator)
- func SinglePlayerRaidProto(player *proto.Player, partyBuffs *proto.PartyBuffs, raidBuffs *proto.RaidBuffs, ...) *proto.Raid
- func StartPeriodicAction(sim *Simulation, options PeriodicActionOptions)
- func StatWeights(request *proto.StatWeightsRequest) *proto.StatWeightsResult
- func StatWeightsAsync(request *proto.StatWeightsRequest, progress chan *proto.ProgressMetrics)
- func StatWeightsTest(label string, t *testing.T, _swr *proto.StatWeightsRequest, ...)
- func TernaryDuration(condition bool, val1 time.Duration, val2 time.Duration) time.Duration
- func TernaryFloat64(condition bool, val1 float64, val2 float64) float64
- func TernaryInt(condition bool, val1 int, val2 int) int
- func TernaryInt32(condition bool, val1 int32, val2 int32) int32
- func UnitLevelFloat64(unitLevel int32, maxLevelPlus0Val float64, maxLevelPlus1Val float64, ...) float64
- func WithSpec(player *proto.Player, spec interface{}) *proto.Player
- type AIFactory
- type ActionID
- func (actionID ActionID) IsEmptyAction() bool
- func (actionID ActionID) IsItemAction(itemID int32) bool
- func (actionID ActionID) IsOtherAction(otherID proto.OtherAction) bool
- func (actionID ActionID) IsSpellAction(spellID int32) bool
- func (actionID ActionID) SameAction(other ActionID) bool
- func (actionID ActionID) SameActionIgnoreTag(other ActionID) bool
- func (actionID ActionID) String() string
- func (actionID ActionID) ToProto() *proto.ActionID
- func (actionID ActionID) WithTag(tag int32) ActionID
- type ActionMetrics
- type ActionPriority
- type ActiveSetBonus
- type Agent
- type AgentFactory
- type ApplyEffect
- type ApplySpellEffects
- func ApplyEffectFuncAOEDamage(env *Environment, baseEffect SpellEffect) ApplySpellEffects
- func ApplyEffectFuncAOEDamageCapped(env *Environment, aoeCap float64, baseEffect SpellEffect) ApplySpellEffects
- func ApplyEffectFuncDamageMultiple(baseEffects []SpellEffect) ApplySpellEffects
- func ApplyEffectFuncDamageMultipleTargeted(baseEffects []SpellEffect) ApplySpellEffects
- func ApplyEffectFuncDirectDamage(baseEffect SpellEffect) ApplySpellEffects
- func ApplyEffectFuncDirectDamageTargetModifiersOnly(baseEffect SpellEffect) ApplySpellEffects
- func ApplyEffectFuncDot(dot *Dot) ApplySpellEffects
- func ApplyEffectFuncMultipleDamageCapped(baseEffects []SpellEffect, aoeCap float64) ApplySpellEffects
- type ApplyWeaponEffect
- type AttackTable
- type Aura
- func BlessingOfSanctuaryAura(character *Character) *Aura
- func BloodFrenzyAura(target *Unit, points int32) *Aura
- func BloodlustAura(character *Character, actionTag int32) *Aura
- func CurseOfElementsAura(target *Unit, points int32) *Aura
- func CurseOfRecklessnessAura(target *Unit) *Aura
- func DemoralizingRoarAura(target *Unit, points int32) *Aura
- func DemoralizingShoutAura(target *Unit, boomingVoicePts int32, impDemoShoutPts int32) *Aura
- func ExposeArmorAura(target *Unit, talentPoints int32) *Aura
- func ExposeWeaknessAura(target *Unit, hunterAgility float64, multiplier float64) *Aura
- func FaerieFireAura(target *Unit, level int32) *Aura
- func GiftOfArthasAura(target *Unit) *Aura
- func HuntersMarkAura(target *Unit, points int32, fullyStacked bool) *Aura
- func ImprovedScorchAura(target *Unit, startingStacks int32) *Aura
- func ImprovedShadowBoltAura(target *Unit, points int32, uptime float64) *Aura
- func InnervateAura(character *Character, expectedBonusManaReduction float64, actionTag int32) *Aura
- func InsectSwarmAura(target *Unit) *Aura
- func JudgementOfLightAura(target *Unit) *Aura
- func JudgementOfTheCrusaderAura(target *Unit, level int32, flatBonus float64, percentBonus float64) *Aura
- func JudgementOfWisdomAura(target *Unit) *Aura
- func MakePermanent(aura *Aura) *Aura
- func ManaTideTotemAura(character *Character, actionTag int32) *Aura
- func MangleAura(target *Unit) *Aura
- func MiseryAura(target *Unit, numPoints int32) *Aura
- func PowerInfusionAura(character *Character, actionTag int32) *Aura
- func RetributionAura(character *Character, points int32) *Aura
- func SanctityAura(character *Character, level float64) *Aura
- func ScheduledExposeArmorAura(target *Unit, talentPoints int32) *Aura
- func ScheduledSunderArmorAura(target *Unit) *Aura
- func ScorpidStingAura(target *Unit) *Aura
- func ScreechAura(target *Unit) *Aura
- func ShadowEmbraceAura(target *Unit, points int32) *Aura
- func ShadowWeavingAura(target *Unit, startingStacks int32) *Aura
- func SnapshotBattleShoutAura(character *Character, snapshotAp float64, boomingVoiceRank int32) *Aura
- func SnapshotImprovedStrengthOfEarthTotemAura(character *Character) *Aura
- func SnapshotImprovedWrathOfAirTotemAura(character *Character) *Aura
- func SunderArmorAura(target *Unit, startingStacks int32) *Aura
- func ThornsAura(character *Character, points int32) *Aura
- func ThunderClapAura(target *Unit, points int32) *Aura
- func WindfuryTotemAura(character *Character, rank int32, iwtTalentPoints int32) *Aura
- func WintersChillAura(target *Unit, startingStacks int32) *Aura
- func (aura *Aura) Activate(sim *Simulation)
- func (aura *Aura) AddStack(sim *Simulation)
- func (aura *Aura) Deactivate(sim *Simulation)
- func (aura *Aura) ExpiresAt() time.Duration
- func (aura *Aura) GetStacks() int32
- func (aura *Aura) IsActive() bool
- func (aura *Aura) Prioritize()
- func (aura *Aura) Refresh(sim *Simulation)
- func (aura *Aura) RemainingDuration(sim *Simulation) time.Duration
- func (aura *Aura) RemoveStack(sim *Simulation)
- func (aura *Aura) SetStacks(sim *Simulation, newStacks int32)
- func (aura *Aura) UpdateExpires(newExpires time.Duration)
- type AuraFactory
- type AuraMetrics
- type AutoAttackOptions
- type AutoAttacks
- func (aa *AutoAttacks) CancelAutoSwing(sim *Simulation)
- func (aa *AutoAttacks) DelayAllUntil(sim *Simulation, readyAt time.Duration)
- func (aa *AutoAttacks) DelayRangedUntil(sim *Simulation, readyAt time.Duration)
- func (aa *AutoAttacks) EnableAutoSwing(sim *Simulation)
- func (aa *AutoAttacks) IsEnabled() bool
- func (aa *AutoAttacks) MainhandSwingSpeed() time.Duration
- func (aa *AutoAttacks) MaybeReplaceMHSwing(sim *Simulation, mhSwingSpell *Spell) *Spell
- func (aa *AutoAttacks) MeleeSwingsReady(sim *Simulation) bool
- func (aa *AutoAttacks) MeleeSwingsReadyAt() time.Duration
- func (aa *AutoAttacks) ModifySwingTime(sim *Simulation, amount float64)
- func (aa *AutoAttacks) NewPPMManager(ppm float64, procMask ProcMask) PPMManager
- func (aa *AutoAttacks) NextAttackAt() time.Duration
- func (aa *AutoAttacks) NextEventAt(sim *Simulation) time.Duration
- func (aa *AutoAttacks) OffhandSwingSpeed() time.Duration
- func (aa *AutoAttacks) RangedSwingGap() time.Duration
- func (aa *AutoAttacks) RangedSwingSpeed() time.Duration
- func (aa *AutoAttacks) RangedSwingWindup() time.Duration
- func (aa *AutoAttacks) SwingMelee(sim *Simulation, target *Unit)
- func (aa *AutoAttacks) SwingRanged(sim *Simulation, target *Unit)
- func (aa *AutoAttacks) TimeBeforeClippingRanged(sim *Simulation) time.Duration
- func (aa *AutoAttacks) TrySwingMH(sim *Simulation, target *Unit)
- func (aa *AutoAttacks) TrySwingOH(sim *Simulation, target *Unit)
- func (aa *AutoAttacks) TrySwingRanged(sim *Simulation, target *Unit)
- type BaseDamageCalculator
- func BaseDamageFuncEnemyWeapon(hand Hand) BaseDamageCalculator
- func BaseDamageFuncFlat(damage float64) BaseDamageCalculator
- func BaseDamageFuncMagic(minFlatDamage float64, maxFlatDamage float64, spellCoefficient float64) BaseDamageCalculator
- func BaseDamageFuncMeleeWeapon(hand Hand, normalized bool, flatBonus float64, weaponMultiplier float64, ...) BaseDamageCalculator
- func BaseDamageFuncRangedWeapon(flatBonus float64) BaseDamageCalculator
- func BaseDamageFuncRoll(minFlatDamage float64, maxFlatDamage float64) BaseDamageCalculator
- type BaseDamageConfig
- func BaseDamageConfigEnemyWeapon(hand Hand) BaseDamageConfig
- func BaseDamageConfigFlat(damage float64) BaseDamageConfig
- func BaseDamageConfigMagic(minFlatDamage float64, maxFlatDamage float64, spellCoefficient float64) BaseDamageConfig
- func BaseDamageConfigMagicNoRoll(flatDamage float64, spellCoefficient float64) BaseDamageConfig
- func BaseDamageConfigMeleeWeapon(hand Hand, normalized bool, flatBonus float64, weaponMultiplier float64, ...) BaseDamageConfig
- func BaseDamageConfigRangedWeapon(flatBonus float64) BaseDamageConfig
- func BaseDamageConfigRoll(minFlatDamage float64, maxFlatDamage float64) BaseDamageConfig
- func BuildBaseDamageConfig(calculator BaseDamageCalculator, coeff float64) BaseDamageConfig
- func MultiplyByStacks(config BaseDamageConfig, aura *Aura) BaseDamageConfig
- func WrapBaseDamageConfig(config BaseDamageConfig, ...) BaseDamageConfig
- type BaseStatsKey
- type BuffsCombo
- type Cast
- type CastConfig
- type CastFunc
- type CastSuccessFunc
- type Character
- func (eb *Character) AddComboPoints(sim *Simulation, pointsToAdd int32, metrics *ResourceMetrics)
- func (eb *Character) AddEnergy(sim *Simulation, amount float64, metrics *ResourceMetrics)
- func (mcdm *Character) AddMajorCooldown(mcd MajorCooldown)
- func (character *Character) AddPartyBuffs(partyBuffs *proto.PartyBuffs)
- func (character *Character) AddPet(pet PetAgent)
- func (rb *Character) AddRage(sim *Simulation, amount float64, metrics *ResourceMetrics)
- func (character *Character) AddRaidBuffs(raidBuffs *proto.RaidBuffs)
- func (character *Character) AddStatDynamic(sim *Simulation, stat stats.Stat, amount float64)
- func (character *Character) AddStatsDynamic(sim *Simulation, stat stats.Stats)
- func (character *Character) ApplyGearBonuses()
- func (character *Character) BaseMana() float64
- func (eb *Character) ComboPoints() int32
- func (eb *Character) CurrentEnergy() float64
- func (hb *Character) CurrentHealth() float64
- func (hb *Character) CurrentHealthPercent() float64
- func (rb *Character) CurrentRage() float64
- func (character *Character) DefaultMeleeCritMultiplier() float64
- func (character *Character) DefaultSpellCritMultiplier() float64
- func (mcdm *Character) DelayDPSCooldownsForArmorDebuffs()
- func (mcdm *Character) DisableAllEnabledCooldowns(cooldownType CooldownType) []*MajorCooldown
- func (mcdm *Character) DisableMajorCooldown(actionID ActionID)
- func (mcdm *Character) EnableAllCooldowns(mcdsToEnable []*MajorCooldown)
- func (mcdm *Character) EnableMajorCooldown(actionID ActionID)
- func (character *Character) EnableManaBar()
- func (character *Character) Finalize(playerStats *proto.PlayerStats)
- func (hb *Character) GainHealth(sim *Simulation, amount float64, metrics *ResourceMetrics)
- func (at *Character) GetActiveAuraWithTag(tag string) *Aura
- func (character *Character) GetActiveSetBonusNames() []string
- func (character *Character) GetActiveSetBonuses() []ActiveSetBonus
- func (at *Character) GetAura(label string) *Aura
- func (at *Character) GetAurasWithTag(tag string) []*Aura
- func (character *Character) GetBaseStats() stats.Stats
- func (character *Character) GetConjuredCD() *Timer
- func (character *Character) GetDefensiveTrinketCD() *Timer
- func (mcdm *Character) GetInitialMajorCooldown(actionID ActionID) MajorCooldown
- func (character *Character) GetMHWeapon() *items.Item
- func (mcdm *Character) GetMajorCooldown(actionID ActionID) *MajorCooldown
- func (mcdm *Character) GetMajorCooldownIDs() []*proto.ActionID
- func (mcdm *Character) GetMajorCooldowns() []*MajorCooldown
- func (character *Character) GetMetricsProto(numIterations int32) *proto.UnitMetrics
- func (character *Character) GetOHWeapon() *items.Item
- func (character *Character) GetOffensiveTrinketCD() *Timer
- func (character *Character) GetPet(name string) PetAgent
- func (character *Character) GetPresimOptions(playerConfig proto.Player) *PresimOptions
- func (character *Character) GetRangedWeapon() *items.Item
- func (character *Character) GetWeaponHands(itemID int32) (bool, bool)
- func (at *Character) HasActiveAura(label string) bool
- func (at *Character) HasActiveAuraWithTag(tag string) bool
- func (at *Character) HasAura(label string) bool
- func (at *Character) HasAuraWithTag(tag string) bool
- func (character *Character) HasMHWeapon() bool
- func (mcdm *Character) HasMajorCooldown(actionID ActionID) bool
- func (character *Character) HasMetaGemEquipped(gemID int32) bool
- func (character *Character) HasOHWeapon() bool
- func (character *Character) HasRangedWeapon() bool
- func (character *Character) HasRingEquipped(itemID int32) bool
- func (character *Character) HasTrinketEquipped(itemID int32) bool
- func (hb *Character) MaxHealth() float64
- func (character *Character) MeleeCritMultiplier(primaryModifiers float64, secondaryModifiers float64) float64
- func (character *Character) NewGnomishFlameTurret() *GnomishFlameTurret
- func (character *Character) NewTemporaryStatsAura(auraLabel string, actionID ActionID, tempStats stats.Stats, ...) *Aura
- func (character *Character) NewTemporaryStatsAuraWrapped(auraLabel string, actionID ActionID, tempStats stats.Stats, ...) *Aura
- func (eb *Character) NextEnergyTickAt() time.Duration
- func (at *Character) OnCastComplete(sim *Simulation, spell *Spell)
- func (at *Character) OnPeriodicDamageDealt(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
- func (at *Character) OnPeriodicDamageTaken(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
- func (at *Character) OnSpellHitDealt(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
- func (at *Character) OnSpellHitTaken(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
- func (at *Character) RegisterResetEffect(resetEffect ResetEffect)
- func (hb *Character) RemoveHealth(sim *Simulation, amount float64)
- func (eb *Character) ResetEnergyTick(sim *Simulation)
- func (at *Character) ShouldRefreshAuraWithTagAtPriority(sim *Simulation, tag string, priority float64, refreshWindow time.Duration) bool
- func (character *Character) SpellCritMultiplier(primaryModifiers float64, secondaryModifiers float64) float64
- func (eb *Character) SpendComboPoints(sim *Simulation, metrics *ResourceMetrics)
- func (eb *Character) SpendEnergy(sim *Simulation, amount float64, metrics *ResourceMetrics)
- func (rb *Character) SpendRage(sim *Simulation, amount float64, metrics *ResourceMetrics)
- func (mcdm *Character) TryUseCooldowns(sim *Simulation)
- func (mcdm *Character) UpdateMajorCooldowns()
- func (character *Character) WeaponFromMainHand(critMultiplier float64) Weapon
- func (character *Character) WeaponFromOffHand(critMultiplier float64) Weapon
- func (character *Character) WeaponFromRanged(critMultiplier float64) Weapon
- type CharacterIterationMetrics
- type CharacterSuiteConfig
- type CombinedTestGenerator
- type Cooldown
- type CooldownActivation
- type CooldownActivationCondition
- type CooldownActivationFactory
- type CooldownType
- type DistributionMetrics
- type Dot
- type Encounter
- type EncounterCombo
- type Environment
- func (env *Environment) GetMaxDuration() time.Duration
- func (env *Environment) GetNumTargets() int32
- func (env *Environment) GetTarget(index int32) *Target
- func (env *Environment) GetTargetUnit(index int32) *Unit
- func (env *Environment) IsFinalized() bool
- func (env *Environment) NextTarget(target *Unit) *Target
- func (env *Environment) NextTargetUnit(target *Unit) *Unit
- func (env *Environment) RegisterPostFinalizeEffect(postFinalizeEffect PostFinalizeEffect)
- type EnvironmentState
- type GearSetCombo
- type GnomishFlameTurret
- func (eb *GnomishFlameTurret) AddComboPoints(sim *Simulation, pointsToAdd int32, metrics *ResourceMetrics)
- func (eb *GnomishFlameTurret) AddEnergy(sim *Simulation, amount float64, metrics *ResourceMetrics)
- func (mcdm *GnomishFlameTurret) AddMajorCooldown(mcd MajorCooldown)
- func (rb *GnomishFlameTurret) AddRage(sim *Simulation, amount float64, metrics *ResourceMetrics)
- func (eb *GnomishFlameTurret) ComboPoints() int32
- func (eb *GnomishFlameTurret) CurrentEnergy() float64
- func (hb *GnomishFlameTurret) CurrentHealth() float64
- func (hb *GnomishFlameTurret) CurrentHealthPercent() float64
- func (rb *GnomishFlameTurret) CurrentRage() float64
- func (mcdm *GnomishFlameTurret) DelayDPSCooldownsForArmorDebuffs()
- func (mcdm *GnomishFlameTurret) DisableAllEnabledCooldowns(cooldownType CooldownType) []*MajorCooldown
- func (mcdm *GnomishFlameTurret) DisableMajorCooldown(actionID ActionID)
- func (mcdm *GnomishFlameTurret) EnableAllCooldowns(mcdsToEnable []*MajorCooldown)
- func (mcdm *GnomishFlameTurret) EnableMajorCooldown(actionID ActionID)
- func (hb *GnomishFlameTurret) GainHealth(sim *Simulation, amount float64, metrics *ResourceMetrics)
- func (at *GnomishFlameTurret) GetActiveAuraWithTag(tag string) *Aura
- func (at *GnomishFlameTurret) GetAura(label string) *Aura
- func (at *GnomishFlameTurret) GetAurasWithTag(tag string) []*Aura
- func (mcdm *GnomishFlameTurret) GetInitialMajorCooldown(actionID ActionID) MajorCooldown
- func (mcdm *GnomishFlameTurret) GetMajorCooldown(actionID ActionID) *MajorCooldown
- func (mcdm *GnomishFlameTurret) GetMajorCooldownIDs() []*proto.ActionID
- func (mcdm *GnomishFlameTurret) GetMajorCooldowns() []*MajorCooldown
- func (gft *GnomishFlameTurret) GetPet() *Pet
- func (at *GnomishFlameTurret) HasActiveAura(label string) bool
- func (at *GnomishFlameTurret) HasActiveAuraWithTag(tag string) bool
- func (at *GnomishFlameTurret) HasAura(label string) bool
- func (at *GnomishFlameTurret) HasAuraWithTag(tag string) bool
- func (mcdm *GnomishFlameTurret) HasMajorCooldown(actionID ActionID) bool
- func (gft *GnomishFlameTurret) Initialize()
- func (hb *GnomishFlameTurret) MaxHealth() float64
- func (eb *GnomishFlameTurret) NextEnergyTickAt() time.Duration
- func (at *GnomishFlameTurret) OnCastComplete(sim *Simulation, spell *Spell)
- func (gft *GnomishFlameTurret) OnGCDReady(sim *Simulation)
- func (at *GnomishFlameTurret) OnPeriodicDamageDealt(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
- func (at *GnomishFlameTurret) OnPeriodicDamageTaken(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
- func (at *GnomishFlameTurret) OnSpellHitDealt(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
- func (at *GnomishFlameTurret) OnSpellHitTaken(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
- func (at *GnomishFlameTurret) RegisterResetEffect(resetEffect ResetEffect)
- func (hb *GnomishFlameTurret) RemoveHealth(sim *Simulation, amount float64)
- func (gft *GnomishFlameTurret) Reset(sim *Simulation)
- func (eb *GnomishFlameTurret) ResetEnergyTick(sim *Simulation)
- func (at *GnomishFlameTurret) ShouldRefreshAuraWithTagAtPriority(sim *Simulation, tag string, priority float64, refreshWindow time.Duration) bool
- func (eb *GnomishFlameTurret) SpendComboPoints(sim *Simulation, metrics *ResourceMetrics)
- func (eb *GnomishFlameTurret) SpendEnergy(sim *Simulation, amount float64, metrics *ResourceMetrics)
- func (rb *GnomishFlameTurret) SpendRage(sim *Simulation, amount float64, metrics *ResourceMetrics)
- func (mcdm *GnomishFlameTurret) TryUseCooldowns(sim *Simulation)
- func (mcdm *GnomishFlameTurret) UpdateMajorCooldowns()
- type GoRand
- type Hand
- type Hardcast
- type HitOutcome
- type IndividualTestSuite
- func (testSuite *IndividualTestSuite) Done(t *testing.T)
- func (testSuite *IndividualTestSuite) TestCharacterStats(testName string, csr *proto.ComputeStatsRequest)
- func (testSuite *IndividualTestSuite) TestDPS(testName string, rsr *proto.RaidSimRequest)
- func (testSuite *IndividualTestSuite) TestStatWeights(testName string, swr *proto.StatWeightsRequest)
- type ItemFilter
- type ItemSet
- type ItemsTestGenerator
- type MajorCooldown
- func (mcd *MajorCooldown) GetTimings() []time.Duration
- func (mcd *MajorCooldown) IsEnabled() bool
- func (mcd *MajorCooldown) IsReady(sim *Simulation) bool
- func (mcd *MajorCooldown) ReadyAt() time.Duration
- func (mcd *MajorCooldown) TimeToReady(sim *Simulation) time.Duration
- func (mcd *MajorCooldown) TryActivate(sim *Simulation, character *Character) bool
- type MeleeDamageCalculator
- type OnCastComplete
- type OnDoneIteration
- type OnEnergyGain
- type OnExpire
- type OnGain
- type OnInit
- type OnPeriodicDamage
- type OnRageGain
- type OnReset
- type OnSpellHit
- type OnStacksChange
- type OutcomeApplier
- type PPMManager
- type Party
- func (party *Party) AddStat(stat stats.Stat, amount float64)
- func (party *Party) AddStats(newStats stats.Stats)
- func (party *Party) GetMetrics(numIterations int32) *proto.PartyMetrics
- func (party *Party) GetPartyBuffs(basePartyBuffs *proto.PartyBuffs) proto.PartyBuffs
- func (party *Party) IsFull() bool
- func (party *Party) Size() int
- type PendingAction
- type PeriodicActionOptions
- type Pet
- func (eb *Pet) AddComboPoints(sim *Simulation, pointsToAdd int32, metrics *ResourceMetrics)
- func (eb *Pet) AddEnergy(sim *Simulation, amount float64, metrics *ResourceMetrics)
- func (mcdm *Pet) AddMajorCooldown(mcd MajorCooldown)
- func (pet *Pet) AddPartyBuffs(partyBuffs *proto.PartyBuffs)
- func (rb *Pet) AddRage(sim *Simulation, amount float64, metrics *ResourceMetrics)
- func (pet *Pet) AddRaidBuffs(raidBuffs *proto.RaidBuffs)
- func (pet *Pet) ApplyTalents()
- func (eb *Pet) ComboPoints() int32
- func (eb *Pet) CurrentEnergy() float64
- func (hb *Pet) CurrentHealth() float64
- func (hb *Pet) CurrentHealthPercent() float64
- func (rb *Pet) CurrentRage() float64
- func (mcdm *Pet) DelayDPSCooldownsForArmorDebuffs()
- func (pet *Pet) Disable(sim *Simulation)
- func (mcdm *Pet) DisableAllEnabledCooldowns(cooldownType CooldownType) []*MajorCooldown
- func (mcdm *Pet) DisableMajorCooldown(actionID ActionID)
- func (pet *Pet) Enable(sim *Simulation, petAgent PetAgent)
- func (mcdm *Pet) EnableAllCooldowns(mcdsToEnable []*MajorCooldown)
- func (mcdm *Pet) EnableMajorCooldown(actionID ActionID)
- func (pet *Pet) EnableWithTimeout(sim *Simulation, petAgent PetAgent, petDuration time.Duration)
- func (pet *Pet) Finalize()
- func (hb *Pet) GainHealth(sim *Simulation, amount float64, metrics *ResourceMetrics)
- func (at *Pet) GetActiveAuraWithTag(tag string) *Aura
- func (at *Pet) GetAura(label string) *Aura
- func (at *Pet) GetAurasWithTag(tag string) []*Aura
- func (pet *Pet) GetCharacter() *Character
- func (mcdm *Pet) GetInitialMajorCooldown(actionID ActionID) MajorCooldown
- func (mcdm *Pet) GetMajorCooldown(actionID ActionID) *MajorCooldown
- func (mcdm *Pet) GetMajorCooldownIDs() []*proto.ActionID
- func (mcdm *Pet) GetMajorCooldowns() []*MajorCooldown
- func (at *Pet) HasActiveAura(label string) bool
- func (at *Pet) HasActiveAuraWithTag(tag string) bool
- func (at *Pet) HasAura(label string) bool
- func (at *Pet) HasAuraWithTag(tag string) bool
- func (mcdm *Pet) HasMajorCooldown(actionID ActionID) bool
- func (pet *Pet) IsEnabled() bool
- func (hb *Pet) MaxHealth() float64
- func (eb *Pet) NextEnergyTickAt() time.Duration
- func (at *Pet) OnCastComplete(sim *Simulation, spell *Spell)
- func (at *Pet) OnPeriodicDamageDealt(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
- func (at *Pet) OnPeriodicDamageTaken(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
- func (at *Pet) OnSpellHitDealt(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
- func (at *Pet) OnSpellHitTaken(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
- func (at *Pet) RegisterResetEffect(resetEffect ResetEffect)
- func (hb *Pet) RemoveHealth(sim *Simulation, amount float64)
- func (eb *Pet) ResetEnergyTick(sim *Simulation)
- func (at *Pet) ShouldRefreshAuraWithTagAtPriority(sim *Simulation, tag string, priority float64, refreshWindow time.Duration) bool
- func (eb *Pet) SpendComboPoints(sim *Simulation, metrics *ResourceMetrics)
- func (eb *Pet) SpendEnergy(sim *Simulation, amount float64, metrics *ResourceMetrics)
- func (rb *Pet) SpendRage(sim *Simulation, amount float64, metrics *ResourceMetrics)
- func (mcdm *Pet) TryUseCooldowns(sim *Simulation)
- func (mcdm *Pet) UpdateMajorCooldowns()
- type PetAgent
- type PetStatInheritance
- type PostFinalizeEffect
- type PresetTarget
- type PresimOptions
- type Presimmer
- type ProcMask
- type Raid
- func (raid Raid) AddStats(s stats.Stats)
- func (raid *Raid) GetMetrics(numIterations int32) *proto.RaidMetrics
- func (raid Raid) GetPlayerFromRaidTarget(raidTarget proto.RaidTarget) Agent
- func (raid Raid) GetPlayerFromUnit(unit *Unit) Agent
- func (raid *Raid) GetRaidBuffs(baseRaidBuffs *proto.RaidBuffs) proto.RaidBuffs
- func (raid *Raid) IsFull() bool
- func (raid *Raid) Size() int
- type Rand
- type ReplaceMHSwing
- type ResetEffect
- type ResourceKey
- type ResourceMetrics
- func (resourceMetrics *ResourceMetrics) ActualGainForCurrentIteration() float64
- func (resourceMetrics *ResourceMetrics) AddEvent(gain float64, actualGain float64)
- func (resourceMetrics *ResourceMetrics) EventsForCurrentIteration() int32
- func (resourceMetrics *ResourceMetrics) ToProto() *proto.ResourceMetrics
- type SettingsCombos
- type Simulation
- func (sim *Simulation) AddPendingAction(pa *PendingAction)
- func (sim *Simulation) GetRemainingDuration() time.Duration
- func (sim *Simulation) GetRemainingDurationPercent() float64
- func (sim *Simulation) IsExecutePhase() bool
- func (sim *Simulation) RandomFloat(label string) float64
- func (sim *Simulation) RegisterExecutePhaseCallback(callback func(*Simulation))
- func (sim *Simulation) Reset()
- type SingleCharacterStatsTestGenerator
- type SingleDpsTestGenerator
- type SingleStatWeightsTestGenerator
- type SpecOptionsCombo
- type SpecSetter
- type Spell
- func (spell *Spell) ApplyAOEThreat(threatAmount float64)
- func (spell *Spell) ApplyAOEThreatIgnoreMultipliers(threatAmount float64)
- func (spell *Spell) ApplyCostModifiers(cost float64) float64
- func (spell *Spell) Cast(sim *Simulation, target *Unit) bool
- func (spell *Spell) ComboPointMetrics() *ResourceMetrics
- func (spell *Spell) CurDamagePerCast() float64
- func (spell *Spell) IsReady(sim *Simulation) bool
- func (spell *Spell) ReadyAt() time.Duration
- func (spell *Spell) SkipCastAndApplyEffects(sim *Simulation, target *Unit)
- func (spell *Spell) TimeToReady(sim *Simulation) time.Duration
- func (spell *Spell) TotalThreatMultiplier() float64
- type SpellConfig
- type SpellEffect
- func (spellEffect *SpellEffect) BonusWeaponDamage(unit *Unit) float64
- func (spellEffect *SpellEffect) ExpertisePercentage(unit *Unit) float64
- func (ahe *SpellEffect) IsMH() bool
- func (ahe *SpellEffect) IsMelee() bool
- func (ahe *SpellEffect) IsOH() bool
- func (spellEffect *SpellEffect) Landed() bool
- func (spellEffect *SpellEffect) MeleeAttackPower(unit *Unit) float64
- func (spellEffect *SpellEffect) MeleeAttackPowerOnTarget() float64
- func (spellEffect *SpellEffect) PhysicalCritChance(unit *Unit, spell *Spell, attackTable *AttackTable) float64
- func (spellEffect *SpellEffect) PhysicalHitChance(unit *Unit, attackTable *AttackTable) float64
- func (spellEffect *SpellEffect) RangedAttackPower(unit *Unit) float64
- func (spellEffect *SpellEffect) RangedAttackPowerOnTarget() float64
- func (spellEffect *SpellEffect) SpellCritChance(unit *Unit, spell *Spell) float64
- func (spellEffect *SpellEffect) SpellPower(unit *Unit, spell *Spell) float64
- func (spellEffect *SpellEffect) String() string
- func (spellEffect *SpellEffect) Validate()
- type SpellFlag
- type SpellMetrics
- type SpellSchool
- type SplitMix64
- type StatWeightValues
- type StatWeightsResult
- type SubGenerator
- type Target
- func (eb *Target) AddComboPoints(sim *Simulation, pointsToAdd int32, metrics *ResourceMetrics)
- func (eb *Target) AddEnergy(sim *Simulation, amount float64, metrics *ResourceMetrics)
- func (target *Target) AddPartyBuffs(partyBuffs *proto.PartyBuffs)
- func (rb *Target) AddRage(sim *Simulation, amount float64, metrics *ResourceMetrics)
- func (target *Target) AddRaidBuffs(raidBuffs *proto.RaidBuffs)
- func (target *Target) Advance(sim *Simulation, elapsedTime time.Duration)
- func (target *Target) ApplyGearBonuses()
- func (target *Target) ApplyTalents()
- func (eb *Target) ComboPoints() int32
- func (eb *Target) CurrentEnergy() float64
- func (hb *Target) CurrentHealth() float64
- func (hb *Target) CurrentHealthPercent() float64
- func (rb *Target) CurrentRage() float64
- func (hb *Target) GainHealth(sim *Simulation, amount float64, metrics *ResourceMetrics)
- func (at *Target) GetActiveAuraWithTag(tag string) *Aura
- func (at *Target) GetAura(label string) *Aura
- func (at *Target) GetAurasWithTag(tag string) []*Aura
- func (target *Target) GetCharacter() *Character
- func (target *Target) GetMetricsProto(numIterations int32) *proto.UnitMetrics
- func (at *Target) HasActiveAura(label string) bool
- func (at *Target) HasActiveAuraWithTag(tag string) bool
- func (at *Target) HasAura(label string) bool
- func (at *Target) HasAuraWithTag(tag string) bool
- func (target *Target) Initialize()
- func (hb *Target) MaxHealth() float64
- func (eb *Target) NextEnergyTickAt() time.Duration
- func (target *Target) NextTarget() *Target
- func (at *Target) OnCastComplete(sim *Simulation, spell *Spell)
- func (target *Target) OnGCDReady(sim *Simulation)
- func (at *Target) OnPeriodicDamageDealt(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
- func (at *Target) OnPeriodicDamageTaken(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
- func (at *Target) OnSpellHitDealt(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
- func (at *Target) OnSpellHitTaken(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
- func (at *Target) RegisterResetEffect(resetEffect ResetEffect)
- func (hb *Target) RemoveHealth(sim *Simulation, amount float64)
- func (target *Target) Reset(sim *Simulation)
- func (eb *Target) ResetEnergyTick(sim *Simulation)
- func (at *Target) ShouldRefreshAuraWithTagAtPriority(sim *Simulation, tag string, priority float64, refreshWindow time.Duration) bool
- func (eb *Target) SpendComboPoints(sim *Simulation, metrics *ResourceMetrics)
- func (eb *Target) SpendEnergy(sim *Simulation, amount float64, metrics *ResourceMetrics)
- func (rb *Target) SpendRage(sim *Simulation, amount float64, metrics *ResourceMetrics)
- type TargetAI
- type TargetedActionMetrics
- type TestGenerator
- type TickEffects
- func TickFuncAOESnapshot(env *Environment, baseEffect SpellEffect) TickEffects
- func TickFuncAOESnapshotCapped(env *Environment, aoeCap float64, baseEffect SpellEffect) TickEffects
- func TickFuncApplyEffects(effectsFunc ApplySpellEffects) TickEffects
- func TickFuncSnapshot(target *Unit, baseEffect SpellEffect) TickEffects
- type Timer
- type Unit
- func (eb *Unit) AddComboPoints(sim *Simulation, pointsToAdd int32, metrics *ResourceMetrics)
- func (eb *Unit) AddEnergy(sim *Simulation, amount float64, metrics *ResourceMetrics)
- func (unit *Unit) AddMana(sim *Simulation, amount float64, metrics *ResourceMetrics, isBonusMana bool)
- func (unit *Unit) AddMeleeHaste(sim *Simulation, amount float64)
- func (rb *Unit) AddRage(sim *Simulation, amount float64, metrics *ResourceMetrics)
- func (unit *Unit) AddStat(stat stats.Stat, amount float64)
- func (unit *Unit) AddStatDynamic(sim *Simulation, stat stats.Stat, amount float64)
- func (unit *Unit) AddStats(stat stats.Stats)
- func (unit *Unit) AddStatsDynamic(sim *Simulation, stat stats.Stats)
- func (unit *Unit) ApplyCastSpeed(dur time.Duration) time.Duration
- func (unit *Unit) CancelGCDTimer(sim *Simulation)
- func (eb *Unit) ComboPoints() int32
- func (eb *Unit) CurrentEnergy() float64
- func (hb *Unit) CurrentHealth() float64
- func (hb *Unit) CurrentHealthPercent() float64
- func (unit *Unit) CurrentMana() float64
- func (unit *Unit) CurrentManaPercent() float64
- func (rb *Unit) CurrentRage() float64
- func (unit *Unit) DoneWaitingForMana(sim *Simulation) bool
- func (unit *Unit) EnableAutoAttacks(agent Agent, options AutoAttackOptions)
- func (unit *Unit) EnableEnergyBar(maxEnergy float64, onEnergyGain OnEnergyGain)
- func (unit *Unit) EnableHealthBar()
- func (unit *Unit) EnableRageBar(startingRage float64, rageMultiplier float64, onRageGain OnRageGain)
- func (unit *Unit) FinishedWaitingForManaAndGCDReady(sim *Simulation) bool
- func (hb *Unit) GainHealth(sim *Simulation, amount float64, metrics *ResourceMetrics)
- func (at *Unit) GetActiveAuraWithTag(tag string) *Aura
- func (at *Unit) GetAura(label string) *Aura
- func (at *Unit) GetAurasWithTag(tag string) []*Aura
- func (unit *Unit) GetInitialStat(stat stats.Stat) float64
- func (at *Unit) GetMetricsProto(numIterations int32) []*proto.AuraMetrics
- func (unit *Unit) GetOrInitTimer(timer **Timer) *Timer
- func (unit *Unit) GetOrRegisterAura(aura Aura) *Aura
- func (unit *Unit) GetOrRegisterSpell(config SpellConfig) *Spell
- func (unit *Unit) GetSpell(actionID ActionID) *Spell
- func (unit *Unit) GetStat(stat stats.Stat) float64
- func (unit *Unit) GetStats() stats.Stats
- func (unit *Unit) HardcastWaitUntil(sim *Simulation, readyTime time.Duration, onComplete CastFunc)
- func (at *Unit) HasActiveAura(label string) bool
- func (at *Unit) HasActiveAuraWithTag(tag string) bool
- func (at *Unit) HasAura(label string) bool
- func (at *Unit) HasAuraWithTag(tag string) bool
- func (unit *Unit) HasEnergyBar() bool
- func (unit *Unit) HasHealthBar() bool
- func (unit *Unit) HasManaBar() bool
- func (unit *Unit) HasRageBar() bool
- func (unit *Unit) HasTemporaryBonusForStat(stat stats.Stat) bool
- func (unit *Unit) HasTemporaryMeleeSwingSpeedIncrease() bool
- func (unit *Unit) HasTemporaryRangedSwingSpeedIncrease() bool
- func (unit *Unit) HasTemporarySpellCastSpeedIncrease() bool
- func (unit *Unit) InitialCastSpeed() float64
- func (unit *Unit) IsWaiting() bool
- func (unit *Unit) IsWaitingForMana() bool
- func (unit *Unit) Log(sim *Simulation, message string, vals ...interface{})
- func (unit *Unit) LogLabel() string
- func (unit *Unit) MP5ManaRegenPerSecond() float64
- func (unit *Unit) ManaRegenPerSecondWhileCasting() float64
- func (unit *Unit) ManaRegenPerSecondWhileNotCasting() float64
- func (unit *Unit) ManaTick(sim *Simulation)
- func (hb *Unit) MaxHealth() float64
- func (unit *Unit) MaxMana() float64
- func (unit *Unit) MultiplyAttackSpeed(sim *Simulation, amount float64)
- func (unit *Unit) MultiplyCastSpeed(amount float64)
- func (unit *Unit) MultiplyMeleeSpeed(sim *Simulation, amount float64)
- func (unit *Unit) MultiplyRangedSpeed(sim *Simulation, amount float64)
- func (unit *Unit) NewComboPointMetrics(actionID ActionID) *ResourceMetrics
- func (unit *Unit) NewEnergyMetrics(actionID ActionID) *ResourceMetrics
- func (unit *Unit) NewFocusMetrics(actionID ActionID) *ResourceMetrics
- func (unit *Unit) NewHealthMetrics(actionID ActionID) *ResourceMetrics
- func (unit *Unit) NewManaMetrics(actionID ActionID) *ResourceMetrics
- func (unit *Unit) NewRageMetrics(actionID ActionID) *ResourceMetrics
- func (unit *Unit) NewTimer() *Timer
- func (eb *Unit) NextEnergyTickAt() time.Duration
- func (unit *Unit) NextGCDAt() time.Duration
- func (unit *Unit) OnAutoAttack(sim *Simulation, spell *Spell)
- func (at *Unit) OnCastComplete(sim *Simulation, spell *Spell)
- func (unit *Unit) OnManaTick(sim *Simulation)
- func (at *Unit) OnPeriodicDamageDealt(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
- func (at *Unit) OnPeriodicDamageTaken(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
- func (at *Unit) OnSpellHitDealt(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
- func (at *Unit) OnSpellHitTaken(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
- func (unit *Unit) OutcomeFuncAlwaysHit() OutcomeApplier
- func (unit *Unit) OutcomeFuncCritFixedChance(critChance float64, critMultiplier float64) OutcomeApplier
- func (unit *Unit) OutcomeFuncEnemyMeleeWhite() OutcomeApplier
- func (unit *Unit) OutcomeFuncMagicCrit(critMultiplier float64) OutcomeApplier
- func (unit *Unit) OutcomeFuncMagicHit() OutcomeApplier
- func (unit *Unit) OutcomeFuncMagicHitAndCrit(critMultiplier float64) OutcomeApplier
- func (unit *Unit) OutcomeFuncMagicHitAndCritBinary(critMultiplier float64) OutcomeApplier
- func (unit *Unit) OutcomeFuncMagicHitBinary() OutcomeApplier
- func (unit *Unit) OutcomeFuncMeleeSpecialCritOnly(critMultiplier float64) OutcomeApplier
- func (unit *Unit) OutcomeFuncMeleeSpecialHit() OutcomeApplier
- func (unit *Unit) OutcomeFuncMeleeSpecialHitAndCrit(critMultiplier float64) OutcomeApplier
- func (unit *Unit) OutcomeFuncMeleeSpecialNoBlockDodgeParry(critMultiplier float64) OutcomeApplier
- func (unit *Unit) OutcomeFuncMeleeWeaponSpecialHitAndCrit(critMultiplier float64) OutcomeApplier
- func (unit *Unit) OutcomeFuncMeleeWhite(critMultiplier float64) OutcomeApplier
- func (unit *Unit) OutcomeFuncRangedHit() OutcomeApplier
- func (unit *Unit) OutcomeFuncRangedHitAndCrit(critMultiplier float64) OutcomeApplier
- func (unit *Unit) OutcomeFuncTick() OutcomeApplier
- func (unit *Unit) RangedSwingSpeed() float64
- func (unit *Unit) RegisterAura(aura Aura) *Aura
- func (at *Unit) RegisterResetEffect(resetEffect ResetEffect)
- func (unit *Unit) RegisterSpell(config SpellConfig) *Spell
- func (hb *Unit) RemoveHealth(sim *Simulation, amount float64)
- func (eb *Unit) ResetEnergyTick(sim *Simulation)
- func (unit *Unit) SetGCDTimer(sim *Simulation, gcdReadyAt time.Duration)
- func (at *Unit) ShouldRefreshAuraWithTagAtPriority(sim *Simulation, tag string, priority float64, refreshWindow time.Duration) bool
- func (unit *Unit) SpellGCD() time.Duration
- func (eb *Unit) SpendComboPoints(sim *Simulation, metrics *ResourceMetrics)
- func (eb *Unit) SpendEnergy(sim *Simulation, amount float64, metrics *ResourceMetrics)
- func (unit *Unit) SpendMana(sim *Simulation, amount float64, metrics *ResourceMetrics)
- func (rb *Unit) SpendRage(sim *Simulation, amount float64, metrics *ResourceMetrics)
- func (unit *Unit) SpiritManaRegenPerSecond() float64
- func (unit *Unit) SwingSpeed() float64
- func (unit *Unit) TimeUntilManaRegen(desiredMana float64) time.Duration
- func (unit *Unit) UpdateManaRegenRates()
- func (unit *Unit) WaitForMana(sim *Simulation, desiredMana float64)
- func (unit *Unit) WaitUntil(sim *Simulation, readyTime time.Duration)
- type UnitMetrics
- func (unitMetrics *UnitMetrics) AddFinalPetMetrics(petMetrics *UnitMetrics)
- func (unitMetrics *UnitMetrics) MarkOOM(unit *Unit, dur time.Duration)
- func (unitMetrics *UnitMetrics) NewResourceMetrics(actionID ActionID, resourceType proto.ResourceType) *ResourceMetrics
- func (unitMetrics *UnitMetrics) ToProto(numIterations int32) *proto.UnitMetrics
- type UnitType
- type Weapon
- func (weapon Weapon) AverageDamage() float64
- func (weapon Weapon) BaseDamage(sim *Simulation) float64
- func (weapon Weapon) CalculateAverageWeaponDamage(attackPower float64) float64
- func (weapon Weapon) CalculateNormalizedWeaponDamage(sim *Simulation, attackPower float64) float64
- func (weapon Weapon) CalculateWeaponDamage(sim *Simulation, attackPower float64) float64
- func (weapon Weapon) EnemyWeaponDamage(sim *Simulation, attackPower float64) float64
- func (weapon Weapon) GetSpellSchool() SpellSchool
Constants ¶
const ( ItemIDAtieshMage = 22589 ItemIDAtieshWarlock = 22630 ItemIDBraidedEterniumChain = 24114 ItemIDChainOfTheTwilightOwl = 24121 ItemIDEyeOfTheNight = 24116 ItemIDJadePendantOfBlasting = 20966 ItemIDTheLightningCapacitor = 28785 )
IDs for items used in core
const ( ProcMaskMeleeMH = ProcMaskMeleeMHAuto | ProcMaskMeleeMHSpecial ProcMaskMeleeOH = ProcMaskMeleeOHAuto | ProcMaskMeleeOHSpecial // Equivalent to in-game mask of 4. ProcMaskMeleeWhiteHit = ProcMaskMeleeMHAuto | ProcMaskMeleeOHAuto // Equivalent to in-game mask of 68. ProcMaskWhiteHit = ProcMaskMeleeMHAuto | ProcMaskMeleeOHAuto | ProcMaskRangedAuto // Equivalent to in-game mask of 16. ProcMaskMeleeSpecial = ProcMaskMeleeMHSpecial | ProcMaskMeleeOHSpecial // Equivalent to in-game mask of 272. ProcMaskMeleeOrRangedSpecial = ProcMaskMeleeSpecial | ProcMaskRangedSpecial // Equivalent to in-game mask of 20. ProcMaskMelee = ProcMaskMeleeWhiteHit | ProcMaskMeleeSpecial // Equivalent to in-game mask of 320. ProcMaskRanged = ProcMaskRangedAuto | ProcMaskRangedSpecial // Equivalent to in-game mask of 340. ProcMaskMeleeOrRanged = ProcMaskMelee | ProcMaskRanged ProcMaskDirect = ProcMaskMelee | ProcMaskRanged | ProcMaskSpellDamage ProcMaskTwoRoll = ProcMaskRanged | ProcMaskMeleeSpecial )
const ( OutcomePartial = OutcomePartial1_4 | OutcomePartial2_4 | OutcomePartial3_4 OutcomeLanded = OutcomeHit | OutcomeCrit | OutcomeCrush | OutcomeGlance | OutcomeBlock )
const ( CooldownPriorityLow = -1.0 CooldownPriorityDefault = 0.0 CooldownPriorityDrums = 2.0 CooldownPriorityBloodlust = 1.0 )
const APReductionAuraTag = "APReduction"
const ArmorPenPerPercentArmor = 5.92
const BlockRatingPerBlockChance = 7.8846
const BloodlustAuraTag = "Bloodlust"
const BloodlustCD = time.Minute * 10
const BloodlustDuration = time.Second * 40
const CharacterLevel = 70
const CrushChance = 0.15
const DTPSReferenceStat = stats.Armor
const DefenseRatingPerDefense = 2.3654
const DefenseRatingToChanceReduction = (1.0 / DefenseRatingPerDefense) * MissDodgeParryBlockCritChancePerDefense / 100
const DodgeRatingPerDodgeChance = 18.9231
const DrumsCD = time.Minute * 2 // Tinnitus
const EnemyAutoAttackAPCoefficient = 0.000649375
const EnergyPerTick = 20.2
Extra 0.2 because Blizzard
const EnergyTickDuration = time.Millisecond * 2020
Time between energy ticks.
const ExpertisePerQuarterPercentReduction = 3.94
const GCDDefault = time.Millisecond * 1500
const GCDMin = time.Second * 1
const GnomishFlameTurretName = "Gnomish Flame Turret"
const HasteRatingPerHastePercent = 15.77
const Inactive = -1
const InnervateCD = time.Minute * 6
const InnervateDuration = time.Second * 20
const LevelBasedNPCSpellResistancePerLevel = 28.0 / 3
const LongDuration = 300
const ManaTideTotemCD = time.Minute * 5
const ManaTideTotemDuration = time.Second * 12
const MaxRage = 100.0
const MeleeAttackRatingPerDamage = 14.0
const MeleeCritRatingPerCritChance = 22.08
const MeleeHitRatingPerHitChance = 15.77
const MissDodgeParryBlockCritChancePerDefense = 0.04
const NeverExpires = time.Duration(math.MaxInt64)
const ParryRatingPerParryChance = 23.6538
const PowerInfusionCD = time.Minute * 3
const PowerInfusionDuration = time.Second * 15
const RageFactor = 274.7
const ResilienceRatingPerCritDamageReductionPercent = 39.4231 / 2
const ResilienceRatingPerCritReductionChance = 39.4231
const ShortDuration = 60
const SpellCritRatingPerCritChance = 22.08
const SpellHitRatingPerHitChance = 12.62
const ThreatPerManaGained = 0.5
const ThreatPerRageGained = 5
const ThunderClapAuraTag = "ThunderClap"
Variables ¶
var AdamantiteGrenadeActionID = ActionID{ItemID: 23737}
var AlchStoneItemIDs = []int32{13503, 35748, 35749, 35750, 35751}
var AverageDefaultSimTestOptions = &proto.SimOptions{ Iterations: 5000, IsTest: true, Debug: false, RandomSeed: 101, }
var BaseStats = map[BaseStatsKey]stats.Stats{}
var BloodFrenzyActionID = ActionID{SpellID: 29859}
var ChanceOfDeathAuraLabel = "Chance of Death"
var ConjuredAuraTag = "Conjured"
var DefaultSimTestOptions = &proto.SimOptions{ Iterations: 50, IsTest: true, Debug: false, RandomSeed: 101, }
var DefaultTargetProto = proto.Target{ Level: 73, Stats: stats.Stats{ stats.Armor: 7684, stats.AttackPower: 320, stats.BlockValue: 54, }.ToFloatArray(), MobType: proto.MobType_MobTypeDemon, SwingSpeed: 2, MinBaseDamage: 4192.05, CanCrush: true, ParryHaste: true, }
var DrumsAuraTag = "Drums"
var DrumsOfBattleActionID = ActionID{SpellID: 351355}
var DrumsOfRestorationActionID = ActionID{SpellID: 351358}
var DrumsOfWarActionID = ActionID{SpellID: 351360}
var FaerieFireAuraTag = "Faerie Fire"
var FelIronBombActionID = ActionID{ItemID: 23736}
var GoblinSapperActionID = ActionID{ItemID: 10646}
var HolyWaterActionID = ActionID{ItemID: 13180}
var ImprovedScorchAuraLabel = "Improved Scorch"
var InnervateAuraTag = "Innervate"
var JudgementOfLightAuraLabel = "Judgement of Light"
var JudgementOfWisdomAuraLabel = "Judgement of Wisdom"
var MageManaGemMCDActionID = ActionID{ItemID: 22044}
Mana-related consumes need to know this so they can wait for the Mage to use gems first.
var ManaTideTotemAuraTag = "ManaTideTotem"
var PotionAuraTag = "Potion"
var PowerInfusionAuraTag = "PowerInfusion"
var SnapshotBattleShoutAuraLabel = "Battle Shout Snapshot"
var StatWeightsDefaultSimTestOptions = &proto.SimOptions{ Iterations: 1000, IsTest: true, Debug: false, RandomSeed: 101, }
var SunderArmorAuraLabel = "Sunder Armor"
var SunderExposeAuraTag = "SunderExpose"
var SuperSapperActionID = ActionID{ItemID: 23827}
var WindfuryTotemAuraLabel = "Windfury Totem"
var (
WindfuryTotemSpellRanks = []int32{
8512,
10613,
10614,
25585,
25587,
}
)
var WintersChillAuraLabel = "Winter's Chill"
Functions ¶
func AddPresetEncounter ¶
func AddPresetTarget ¶
func AddPresetTarget(newPreset PresetTarget)
func AddWeaponEffect ¶
func AddWeaponEffect(id int32, weaponEffect ApplyWeaponEffect)
func ApplyPetConsumeEffects ¶
func BothTimersReady ¶
func BothTimersReady(t1 *Timer, t2 *Timer, sim *Simulation) bool
func CharacterStatsTest ¶
func ComputeStats ¶
func ComputeStats(csr *proto.ComputeStatsRequest) *proto.ComputeStatsResult
*
- Returns character stats taking into account gear / buffs / consumes / etc
func DamageRoll ¶
func DamageRoll(sim *Simulation, minDamage float64, maxDamage float64) float64
For convenience, but try to use damageRollOptimized in most cases.
func DamageRollFunc ¶
func DamageRollFunc(minDamage float64, maxDamage float64) func(*Simulation) float64
func DurationFromSeconds ¶
func GetActionAvgCast ¶
func GetActionAvgCast(playerMetrics proto.UnitMetrics, actionID ActionID) float64
Calculates average cast damage for an action.
func GetActionDPS ¶
func GetActionDPS(playerMetrics proto.UnitMetrics, iterations int32, duration time.Duration, actionID ActionID, ignoreTag bool) float64
Calculates DPS for an action.
func GetGearList ¶
func GetGearList(request *proto.GearListRequest) *proto.GearListResult
*
- Returns all items, enchants, and gems recognized by the sim.
func GetTristateValueFloat ¶
func GetTristateValueFloat(effect proto.TristateEffect, regularValue float64, impValue float64) float64
func GetTristateValueInt32 ¶
func GetTristateValueInt32(effect proto.TristateEffect, regularValue int32, impValue int32) int32
func HasItemEffect ¶
func HasWeaponEffect ¶
func InnervateManaThreshold ¶
func MakeTristateValue ¶
func MakeTristateValue(hasRegular bool, hasImproved bool) proto.TristateEffect
func ManaTideTotemAmount ¶
func MaxTimeToReady ¶
func MaxTimeToReady(t1 *Timer, t2 *Timer, sim *Simulation) time.Duration
func MaxTristate ¶
func MaxTristate(a proto.TristateEffect, b proto.TristateEffect) proto.TristateEffect
func MinTristate ¶
func MinTristate(a proto.TristateEffect, b proto.TristateEffect) proto.TristateEffect
func NewDefaultTarget ¶
func NewItemEffect ¶
func NewItemEffect(id int32, itemEffect ApplyEffect)
Registers an ApplyEffect function which will be called before the Sim starts, for any Agent that is wearing the item.
func RaidBenchmark ¶
func RaidBenchmark(b *testing.B, rsr *proto.RaidSimRequest)
func RaidPlayersWithSpec ¶
func RaidSimTest ¶
func RegisterAgentFactory ¶
func RegisterAgentFactory(emptyOptions interface{}, spec proto.Spec, factory AgentFactory, specSetter SpecSetter)
func RegisterTemporaryStatsOnUseCD ¶
func RegisterTemporaryStatsOnUseCD(character *Character, auraLabel string, tempStats stats.Stats, duration time.Duration, config SpellConfig)
Add a major cooldown to the given agent, which provides a temporary boost to a single stat. This is use for effects like Icon of the Silver Crescent and Bloodlust Brooch.
func RunRaidSim ¶
func RunRaidSim(request *proto.RaidSimRequest) *proto.RaidSimResult
*
- Runs multiple iterations of the sim with a full raid.
func RunRaidSimAsync ¶
func RunRaidSimAsync(request *proto.RaidSimRequest, progress chan *proto.ProgressMetrics)
func RunSim ¶
func RunSim(rsr proto.RaidSimRequest, progress chan *proto.ProgressMetrics) (result *proto.RaidSimResult)
func RunTestSuite ¶
func RunTestSuite(t *testing.T, suiteName string, generator TestGenerator)
func SinglePlayerRaidProto ¶
func StartPeriodicAction ¶
func StartPeriodicAction(sim *Simulation, options PeriodicActionOptions)
Convenience for immediately creating and starting a periodic action.
func StatWeights ¶
func StatWeights(request *proto.StatWeightsRequest) *proto.StatWeightsResult
*
- Returns stat weights and EP values, with standard deviations, for all stats.
func StatWeightsAsync ¶
func StatWeightsAsync(request *proto.StatWeightsRequest, progress chan *proto.ProgressMetrics)
func StatWeightsTest ¶
func TernaryDuration ¶
func UnitLevelFloat64 ¶
Types ¶
type ActionID ¶
type ActionID struct {
// Only one of these should be set.
SpellID int32
ItemID int32
OtherID proto.OtherAction
Tag int32
}
func ProtoToActionID ¶
func (ActionID) IsEmptyAction ¶
func (ActionID) IsItemAction ¶
func (ActionID) IsOtherAction ¶
func (actionID ActionID) IsOtherAction(otherID proto.OtherAction) bool
func (ActionID) IsSpellAction ¶
func (ActionID) SameAction ¶
func (ActionID) SameActionIgnoreTag ¶
type ActionMetrics ¶
type ActionMetrics struct {
IsMelee bool // True if melee action, false if spell action.
// Metrics for this action, for each possible target.
Targets []TargetedActionMetrics
}
func (*ActionMetrics) ToProto ¶
func (actionMetrics *ActionMetrics) ToProto(actionID ActionID) *proto.ActionMetrics
type ActionPriority ¶
type ActionPriority int32
const ( ActionPriorityLow ActionPriority = -1 ActionPriorityGCD ActionPriority = 0 // Higher than GCD because regen can cause GCD actions (if we were waiting // for mana). ActionPriorityRegen ActionPriority = 1 // Autos can cause regen (JoW, rage, energy procs, etc) so they should be // higher prio so that we never go backwards in the priority order. ActionPriorityAuto ActionPriority = 2 // DOTs need to be higher than anything else so that dots can properly expire before we take other actions. ActionPriorityDOT ActionPriority = 3 )
type ActiveSetBonus ¶
type ActiveSetBonus struct {
// Name of the set.
Name string
// Number of pieces required for this bonus.
NumPieces int32
// Function for applying the effects of this set bonus.
BonusEffect ApplyEffect
}
type Agent ¶
type Agent interface {
// The Character controlled by this Agent.
GetCharacter() *Character
// Called once after all Players/Pets/Targets have finished the construction phase.
// Use this to register spells and any initialization steps that require
// other raid members or auras.
Initialize()
// Updates the input Buffs to include raid-wide buffs provided by this Agent.
AddRaidBuffs(raidBuffs *proto.RaidBuffs)
// Updates the input Buffs to include party-wide buffs provided by this Agent.
AddPartyBuffs(partyBuffs *proto.PartyBuffs)
// Applies any bonuses that should be considered part of gear. This makes sure
// the bonus is applied at the appropriate time to be accounted in player stats.
ApplyGearBonuses()
// All talent stats / auras should be added within this callback. This makes sure
// talents are applied at the right time so we can calculate groups of stats.
ApplyTalents()
// Returns this Agent to its initial state. Called before each Sim iteration
// and once after the final iteration.
Reset(sim *Simulation)
// Called whenever the GCD becomes ready for this Agent.
OnGCDReady(sim *Simulation)
// Called after each mana tick, if this Agent uses mana.
OnManaTick(sim *Simulation)
// Called after each auto attack performed by this Agent.
// This is different from Aura.OnSpellHit in that it is invoked fully after
// everything related to the attack is complete, and it is only invoked for
// auto attacks (white hits or white-hit-replacers).
OnAutoAttack(sim *Simulation, spell *Spell)
}
Agent can be thought of as the 'Player', i.e. the thing controlling the Character. This is the interface implemented by each class/spec.
type ApplyEffect ¶
type ApplyEffect func(Agent)
Function for applying permanent effects to an Agent.
Passing Character instead of Agent would work for almost all cases, but there are occasionally class-specific item effects.
func MakeTemporaryStatsOnUseCDRegistration ¶
func MakeTemporaryStatsOnUseCDRegistration(auraLabel string, tempStats stats.Stats, duration time.Duration, config SpellConfig, cdFunc func(*Character) Cooldown, sharedCDFunc func(*Character) Cooldown) ApplyEffect
Helper function to make an ApplyEffect for a temporary stats on-use cooldown.
type ApplySpellEffects ¶
type ApplySpellEffects func(*Simulation, *Unit, *Spell)
func ApplyEffectFuncAOEDamage ¶
func ApplyEffectFuncAOEDamage(env *Environment, baseEffect SpellEffect) ApplySpellEffects
func ApplyEffectFuncAOEDamageCapped ¶
func ApplyEffectFuncAOEDamageCapped(env *Environment, aoeCap float64, baseEffect SpellEffect) ApplySpellEffects
func ApplyEffectFuncDamageMultiple ¶
func ApplyEffectFuncDamageMultiple(baseEffects []SpellEffect) ApplySpellEffects
func ApplyEffectFuncDamageMultipleTargeted ¶
func ApplyEffectFuncDamageMultipleTargeted(baseEffects []SpellEffect) ApplySpellEffects
func ApplyEffectFuncDirectDamage ¶
func ApplyEffectFuncDirectDamage(baseEffect SpellEffect) ApplySpellEffects
func ApplyEffectFuncDirectDamageTargetModifiersOnly ¶
func ApplyEffectFuncDirectDamageTargetModifiersOnly(baseEffect SpellEffect) ApplySpellEffects
func ApplyEffectFuncDot ¶
func ApplyEffectFuncDot(dot *Dot) ApplySpellEffects
func ApplyEffectFuncMultipleDamageCapped ¶
func ApplyEffectFuncMultipleDamageCapped(baseEffects []SpellEffect, aoeCap float64) ApplySpellEffects
type ApplyWeaponEffect ¶
Function for applying permenent effects to an agent's weapon
type AttackTable ¶
type AttackTable struct {
Attacker *Unit
Defender *Unit
BaseMissChance float64
BaseSpellMissChance float64
BaseBlockChance float64
BaseDodgeChance float64
BaseParryChance float64
BaseGlanceChance float64
GlanceMultiplier float64
HitSuppression float64
CritSuppression float64
PartialResistArcaneRollThreshold00 float64
PartialResistArcaneRollThreshold25 float64
PartialResistArcaneRollThreshold50 float64
PartialResistHolyRollThreshold00 float64
PartialResistHolyRollThreshold25 float64
PartialResistHolyRollThreshold50 float64
PartialResistFireRollThreshold00 float64
PartialResistFireRollThreshold25 float64
PartialResistFireRollThreshold50 float64
PartialResistFrostRollThreshold00 float64
PartialResistFrostRollThreshold25 float64
PartialResistFrostRollThreshold50 float64
PartialResistNatureRollThreshold00 float64
PartialResistNatureRollThreshold25 float64
PartialResistNatureRollThreshold50 float64
PartialResistShadowRollThreshold00 float64
PartialResistShadowRollThreshold25 float64
PartialResistShadowRollThreshold50 float64
BinaryArcaneHitChance float64
BinaryHolyHitChance float64
BinaryFireHitChance float64
BinaryFrostHitChance float64
BinaryNatureHitChance float64
BinaryShadowHitChance float64
ArmorDamageReduction float64
}
Holds cached values for outcome/damage calculations, for a specific attacker+defender pair.
These are updated dynamically when attacker or defender stats change.
func NewAttackTable ¶
func NewAttackTable(attacker *Unit, defender *Unit) *AttackTable
func (*AttackTable) GetBinaryHitChance ¶
func (at *AttackTable) GetBinaryHitChance(ss SpellSchool) float64
func (*AttackTable) GetPartialResistThresholds ¶
func (at *AttackTable) GetPartialResistThresholds(ss SpellSchool) (float64, float64, float64)
func (*AttackTable) UpdateArmorDamageReduction ¶
func (at *AttackTable) UpdateArmorDamageReduction()
ArmorDamageReduction currently assumes a level 70 attacker
func (*AttackTable) UpdatePartialResists ¶
func (at *AttackTable) UpdatePartialResists()
type Aura ¶
type Aura struct {
// String label for this Aura. Gauranteed to be unique among the Auras for a single Unit.
Label string
// For easily grouping auras.
Tag string
ActionID ActionID // If set, metrics will be tracked for this aura.
Duration time.Duration // Duration of aura, upon being applied.
// The unit this aura is attached to.
Unit *Unit
MaxStacks int32
// If nonzero, activation of this aura will deactivate other auras with the
// same Tag and equal or lower Priority.
Priority float64
// Lifecycle callbacks.
OnInit OnInit
OnReset OnReset
OnDoneIteration OnDoneIteration
OnGain OnGain
OnExpire OnExpire
OnStacksChange OnStacksChange // Invoked when the number of stacks of this aura changes.
OnCastComplete OnCastComplete // Invoked when a spell cast completes casting, before results are calculated.
OnSpellHitDealt OnSpellHit // Invoked when a spell hits and this unit is the caster.
OnSpellHitTaken OnSpellHit // Invoked when a spell hits and this unit is the target.
OnPeriodicDamageDealt OnPeriodicDamage // Invoked when a dot tick occurs and this unit is the caster.
OnPeriodicDamageTaken OnPeriodicDamage // Invoked when a dot tick occurs and this unit is the target.
// contains filtered or unexported fields
}
Aura lifecycle:
myAura := unit.RegisterAura(myAuraConfig) myAura.Activate(sim) myAura.SetStacks(sim, 3) myAura.Refresh(sim) myAura.Deactivate(sim)
func BlessingOfSanctuaryAura ¶
func BloodFrenzyAura ¶
func BloodlustAura ¶
func CurseOfElementsAura ¶
func CurseOfRecklessnessAura ¶
func DemoralizingRoarAura ¶
func DemoralizingShoutAura ¶
func ExposeArmorAura ¶
func ExposeWeaknessAura ¶
Multiplier is for accomodating uptime %. For a real hunter, always pass 1.0
func FaerieFireAura ¶
func GiftOfArthasAura ¶
func ImprovedScorchAura ¶
func ImprovedShadowBoltAura ¶
If uptime is 0, makes an aura for a real warlock. Otherwise makes a group approximation.
func InnervateAura ¶
func InsectSwarmAura ¶
func JudgementOfLightAura ¶
func JudgementOfWisdomAura ¶
func ManaTideTotemAura ¶
func MangleAura ¶
func MiseryAura ¶
func PowerInfusionAura ¶
func RetributionAura ¶
func SanctityAura ¶
func ScorpidStingAura ¶
func ScreechAura ¶
func ShadowEmbraceAura ¶
func ShadowWeavingAura ¶
func SnapshotBattleShoutAura ¶
func SunderArmorAura ¶
func ThornsAura ¶
func ThunderClapAura ¶
func WindfuryTotemAura ¶
func WintersChillAura ¶
func (*Aura) Activate ¶
func (aura *Aura) Activate(sim *Simulation)
Adds a new aura to the simulation. If an aura with the same ID already exists it will be replaced with the new one.
func (*Aura) AddStack ¶
func (aura *Aura) AddStack(sim *Simulation)
func (*Aura) Prioritize ¶
func (aura *Aura) Prioritize()
Moves an Aura to the front of the list of active Auras, so its callbacks are invoked first.
func (*Aura) Refresh ¶
func (aura *Aura) Refresh(sim *Simulation)
func (*Aura) RemainingDuration ¶
func (aura *Aura) RemainingDuration(sim *Simulation) time.Duration
func (*Aura) RemoveStack ¶
func (aura *Aura) RemoveStack(sim *Simulation)
func (*Aura) SetStacks ¶
func (aura *Aura) SetStacks(sim *Simulation, newStacks int32)
func (*Aura) UpdateExpires ¶
type AuraFactory ¶
type AuraFactory func(*Simulation) *Aura
type AuraMetrics ¶
type AuraMetrics struct {
ID ActionID
// Metrics for the current iteration.
Uptime time.Duration
// contains filtered or unexported fields
}
func (*AuraMetrics) ToProto ¶
func (auraMetrics *AuraMetrics) ToProto(numIterations int32) *proto.AuraMetrics
type AutoAttackOptions ¶
type AutoAttackOptions struct {
MainHand Weapon
OffHand Weapon
Ranged Weapon
AutoSwingMelee bool // If true, core engine will handle calling SwingMelee() for you.
DelayOHSwings bool
ReplaceMHSwing ReplaceMHSwing
}
Options for initializing auto attacks.
type AutoAttacks ¶
type AutoAttacks struct {
MH Weapon
OH Weapon
Ranged Weapon
IsDualWielding bool
// If true, core engine will handle calling SwingMelee(). Set to false to manually manage
// swings, for example for hunter melee weaving.
AutoSwingMelee bool
// If true, core engine will handle calling SwingRanged(). Unless you're a hunter, don't
// use this.
AutoSwingRanged bool
// Set this to true to use the OH delay macro, mostly used by enhance shamans.
// This will intentionally delay OH swings to that they always fall within the
// 0.5s window following a MH swing.
DelayOHSwings bool
MainhandSwingAt time.Duration
OffhandSwingAt time.Duration
RangedSwingAt time.Duration
MHEffect SpellEffect
OHEffect SpellEffect
RangedEffect SpellEffect
MHAuto *Spell
OHAuto *Spell
RangedAuto *Spell
RangedSwingInProgress bool
ReplaceMHSwing ReplaceMHSwing
// contains filtered or unexported fields
}
func (*AutoAttacks) CancelAutoSwing ¶
func (aa *AutoAttacks) CancelAutoSwing(sim *Simulation)
Stops the auto swing action for the rest of the iteration. Used for pets after being disabled.
func (*AutoAttacks) DelayAllUntil ¶
func (aa *AutoAttacks) DelayAllUntil(sim *Simulation, readyAt time.Duration)
Delays all swing timers until the specified time.
func (*AutoAttacks) DelayRangedUntil ¶
func (aa *AutoAttacks) DelayRangedUntil(sim *Simulation, readyAt time.Duration)
func (*AutoAttacks) EnableAutoSwing ¶
func (aa *AutoAttacks) EnableAutoSwing(sim *Simulation)
Renables the auto swing action for the iteration
func (*AutoAttacks) IsEnabled ¶
func (aa *AutoAttacks) IsEnabled() bool
func (*AutoAttacks) MainhandSwingSpeed ¶
func (aa *AutoAttacks) MainhandSwingSpeed() time.Duration
The amount of time between two MH swings.
func (*AutoAttacks) MaybeReplaceMHSwing ¶
func (aa *AutoAttacks) MaybeReplaceMHSwing(sim *Simulation, mhSwingSpell *Spell) *Spell
Optionally replaces the given swing spell with an Agent-specified MH Swing replacer. This is for effects like Heroic Strike or Raptor Strike.
func (*AutoAttacks) MeleeSwingsReady ¶
func (aa *AutoAttacks) MeleeSwingsReady(sim *Simulation) bool
Returns true if all melee weapons are ready for a swing.
func (*AutoAttacks) MeleeSwingsReadyAt ¶
func (aa *AutoAttacks) MeleeSwingsReadyAt() time.Duration
Returns the time at which all melee swings will be ready.
func (*AutoAttacks) ModifySwingTime ¶
func (aa *AutoAttacks) ModifySwingTime(sim *Simulation, amount float64)
func (*AutoAttacks) NewPPMManager ¶
func (aa *AutoAttacks) NewPPMManager(ppm float64, procMask ProcMask) PPMManager
func (*AutoAttacks) NextAttackAt ¶
func (aa *AutoAttacks) NextAttackAt() time.Duration
Returns the time at which the next attack will occur.
func (*AutoAttacks) NextEventAt ¶
func (aa *AutoAttacks) NextEventAt(sim *Simulation) time.Duration
Returns the time at which the next event will occur, considering both autos and the gcd.
func (*AutoAttacks) OffhandSwingSpeed ¶
func (aa *AutoAttacks) OffhandSwingSpeed() time.Duration
The amount of time between two OH swings.
func (*AutoAttacks) RangedSwingGap ¶
func (aa *AutoAttacks) RangedSwingGap() time.Duration
Time between a ranged auto finishes casting and the next one becomes available.
func (*AutoAttacks) RangedSwingSpeed ¶
func (aa *AutoAttacks) RangedSwingSpeed() time.Duration
The amount of time between two ranged swings.
func (*AutoAttacks) RangedSwingWindup ¶
func (aa *AutoAttacks) RangedSwingWindup() time.Duration
Ranged swings have a 0.5s 'windup' time before they can fire, affected by haste. This function computes the amount of windup time based on the current haste.
func (*AutoAttacks) SwingMelee ¶
func (aa *AutoAttacks) SwingMelee(sim *Simulation, target *Unit)
SwingMelee will check any swing timers if they are up, and if so, swing!
func (*AutoAttacks) SwingRanged ¶
func (aa *AutoAttacks) SwingRanged(sim *Simulation, target *Unit)
func (*AutoAttacks) TimeBeforeClippingRanged ¶
func (aa *AutoAttacks) TimeBeforeClippingRanged(sim *Simulation) time.Duration
Returns the amount of time available before ranged auto will be clipped.
func (*AutoAttacks) TrySwingMH ¶
func (aa *AutoAttacks) TrySwingMH(sim *Simulation, target *Unit)
Performs an autoattack using the main hand weapon, if the MH CD is ready.
func (*AutoAttacks) TrySwingOH ¶
func (aa *AutoAttacks) TrySwingOH(sim *Simulation, target *Unit)
Performs an autoattack using the main hand weapon, if the OH CD is ready.
func (*AutoAttacks) TrySwingRanged ¶
func (aa *AutoAttacks) TrySwingRanged(sim *Simulation, target *Unit)
Performs an autoattack using the ranged weapon, if the ranged CD is ready.
type BaseDamageCalculator ¶
type BaseDamageCalculator func(*Simulation, *SpellEffect, *Spell) float64
Function for calculating the base damage of a spell.
func BaseDamageFuncEnemyWeapon ¶
func BaseDamageFuncEnemyWeapon(hand Hand) BaseDamageCalculator
func BaseDamageFuncFlat ¶
func BaseDamageFuncFlat(damage float64) BaseDamageCalculator
Creates a BaseDamageCalculator function which returns a flat value.
func BaseDamageFuncMagic ¶
func BaseDamageFuncMagic(minFlatDamage float64, maxFlatDamage float64, spellCoefficient float64) BaseDamageCalculator
func BaseDamageFuncRangedWeapon ¶
func BaseDamageFuncRangedWeapon(flatBonus float64) BaseDamageCalculator
func BaseDamageFuncRoll ¶
func BaseDamageFuncRoll(minFlatDamage float64, maxFlatDamage float64) BaseDamageCalculator
Creates a BaseDamageCalculator function with a single damage roll.
type BaseDamageConfig ¶
type BaseDamageConfig struct {
// Lambda for calculating the base damage.
Calculator BaseDamageCalculator
// Spell coefficient for +damage effects on the target.
TargetSpellCoefficient float64
}
func BaseDamageConfigEnemyWeapon ¶
func BaseDamageConfigEnemyWeapon(hand Hand) BaseDamageConfig
func BaseDamageConfigFlat ¶
func BaseDamageConfigFlat(damage float64) BaseDamageConfig
func BaseDamageConfigMagic ¶
func BaseDamageConfigMagic(minFlatDamage float64, maxFlatDamage float64, spellCoefficient float64) BaseDamageConfig
func BaseDamageConfigMagicNoRoll ¶
func BaseDamageConfigMagicNoRoll(flatDamage float64, spellCoefficient float64) BaseDamageConfig
func BaseDamageConfigRangedWeapon ¶
func BaseDamageConfigRangedWeapon(flatBonus float64) BaseDamageConfig
func BaseDamageConfigRoll ¶
func BaseDamageConfigRoll(minFlatDamage float64, maxFlatDamage float64) BaseDamageConfig
func BuildBaseDamageConfig ¶
func BuildBaseDamageConfig(calculator BaseDamageCalculator, coeff float64) BaseDamageConfig
func MultiplyByStacks ¶
func MultiplyByStacks(config BaseDamageConfig, aura *Aura) BaseDamageConfig
func WrapBaseDamageConfig ¶
func WrapBaseDamageConfig(config BaseDamageConfig, wrapper func(oldCalculator BaseDamageCalculator) BaseDamageCalculator) BaseDamageConfig
type BuffsCombo ¶
type Cast ¶
type Cast struct {
// Amount of resource that will be consumed by this cast.
Cost float64
// The length of time the GCD will be on CD as a result of this cast.
GCD time.Duration
// The amount of time between the call to spell.Cast() and when the spell
// effects are invoked.
CastTime time.Duration
// Additional GCD delay after the cast completes.
ChannelTime time.Duration
// Additional GCD delay after the cast ends. Never affected by cast speed.
// This is typically used for latency.
AfterCastDelay time.Duration
}
type CastConfig ¶
type CastConfig struct {
// Default cast values with all static effects applied.
DefaultCast Cast
// Dynamic modifications for each cast.
ModifyCast func(*Simulation, *Spell, *Cast)
// Ignores haste when calculating the GCD and cast time for this cast.
IgnoreHaste bool
CD Cooldown
// Callbacks for providing additional custom behavior.
OnCastComplete func(*Simulation, *Spell)
AfterCast func(*Simulation, *Spell)
}
Input for constructing the CastSpell function for a spell.
type CastFunc ¶
type CastFunc func(*Simulation, *Unit)
type CastSuccessFunc ¶
type CastSuccessFunc func(*Simulation, *Unit) bool
type Character ¶
type Character struct {
Unit
Name string // Different from Label, needed for returned results.
Race proto.Race
ShattFaction proto.ShattrathFaction
Class proto.Class
// Current gear.
Equip items.Equipment
// Pets owned by this Character.
Pets []PetAgent
// Consumables this Character will be using.
Consumes proto.Consumes
// Provides stat dependency management behavior.
stats.StatDependencyManager
// Up reference to this Character's Party.
Party *Party
// This character's index within its party [0-4].
PartyIndex int
// Total amount of remaining additional mana expected for the current sim iteration,
// beyond this Character's mana pool. This should include mana potions / runes /
// innervates / etc.
ExpectedBonusMana float64
// Hack for ensuring we don't apply windfury totem aura if there's already
// a MH imbue.
// TODO: Figure out a cleaner way to do this.
HasMHWeaponImbue bool
// contains filtered or unexported fields
}
Character is a data structure to hold all the shared values that all class logic shares. All players have stats, equipment, auras, etc
func (*Character) AddComboPoints ¶
func (eb *Character) AddComboPoints(sim *Simulation, pointsToAdd int32, metrics *ResourceMetrics)
func (*Character) AddEnergy ¶
func (eb *Character) AddEnergy(sim *Simulation, amount float64, metrics *ResourceMetrics)
func (*Character) AddMajorCooldown ¶
func (mcdm *Character) AddMajorCooldown(mcd MajorCooldown)
Registers a major cooldown to the Character, which will be automatically used when available.
func (*Character) AddPartyBuffs ¶
func (character *Character) AddPartyBuffs(partyBuffs *proto.PartyBuffs)
func (*Character) AddRage ¶
func (rb *Character) AddRage(sim *Simulation, amount float64, metrics *ResourceMetrics)
func (*Character) AddRaidBuffs ¶
func (*Character) AddStatDynamic ¶
func (character *Character) AddStatDynamic(sim *Simulation, stat stats.Stat, amount float64)
func (*Character) AddStatsDynamic ¶
func (character *Character) AddStatsDynamic(sim *Simulation, stat stats.Stats)
func (*Character) ApplyGearBonuses ¶
func (character *Character) ApplyGearBonuses()
Empty implementation so its optional for Agents.
func (*Character) ComboPoints ¶
func (eb *Character) ComboPoints() int32
func (*Character) CurrentEnergy ¶
func (eb *Character) CurrentEnergy() float64
func (*Character) CurrentHealth ¶
func (hb *Character) CurrentHealth() float64
func (*Character) CurrentHealthPercent ¶
func (hb *Character) CurrentHealthPercent() float64
func (*Character) CurrentRage ¶
func (rb *Character) CurrentRage() float64
func (*Character) DefaultMeleeCritMultiplier ¶
func (*Character) DefaultSpellCritMultiplier ¶
func (*Character) DelayDPSCooldownsForArmorDebuffs ¶
func (mcdm *Character) DelayDPSCooldownsForArmorDebuffs()
Adds a delay to the first usage of all CDs so that armor debuffs have time to be applied. MCDs that have a user-specified timing are not delayed.
This function should be called from Agent.Init().
func (*Character) DisableAllEnabledCooldowns ¶
func (mcdm *Character) DisableAllEnabledCooldowns(cooldownType CooldownType) []*MajorCooldown
Disabled all MCDs that are currently enabled, and returns a list of the MCDs which were disabled by this call. If cooldownType is not CooldownTypeUnknown, then will be restricted to cooldowns of that type.
func (*Character) DisableMajorCooldown ¶
func (mcdm *Character) DisableMajorCooldown(actionID ActionID)
func (*Character) EnableAllCooldowns ¶
func (mcdm *Character) EnableAllCooldowns(mcdsToEnable []*MajorCooldown)
func (*Character) EnableMajorCooldown ¶
func (mcdm *Character) EnableMajorCooldown(actionID ActionID)
func (*Character) EnableManaBar ¶
func (character *Character) EnableManaBar()
TODO: Make this into an object like rageBar or energyBar.
func (*Character) Finalize ¶
func (character *Character) Finalize(playerStats *proto.PlayerStats)
func (*Character) GainHealth ¶
func (hb *Character) GainHealth(sim *Simulation, amount float64, metrics *ResourceMetrics)
func (*Character) GetActiveAuraWithTag ¶
func (*Character) GetActiveSetBonusNames ¶
Returns the names of all active set bonuses.
func (*Character) GetActiveSetBonuses ¶
func (character *Character) GetActiveSetBonuses() []ActiveSetBonus
Returns a list describing all active set bonuses.
func (*Character) GetAurasWithTag ¶
func (*Character) GetBaseStats ¶
func (*Character) GetConjuredCD ¶
func (*Character) GetDefensiveTrinketCD ¶
func (*Character) GetInitialMajorCooldown ¶
func (mcdm *Character) GetInitialMajorCooldown(actionID ActionID) MajorCooldown
func (*Character) GetMHWeapon ¶
Returns the MH weapon if one is equipped, and null otherwise.
func (*Character) GetMajorCooldown ¶
func (mcdm *Character) GetMajorCooldown(actionID ActionID) *MajorCooldown
func (*Character) GetMajorCooldownIDs ¶
func (*Character) GetMajorCooldowns ¶
func (mcdm *Character) GetMajorCooldowns() []*MajorCooldown
Returns all MCDs.
func (*Character) GetMetricsProto ¶
func (character *Character) GetMetricsProto(numIterations int32) *proto.UnitMetrics
func (*Character) GetOHWeapon ¶
Returns the OH weapon if one is equipped, and null otherwise. Note that shields / Held-in-off-hand items are NOT counted as weapons in this function.
func (*Character) GetOffensiveTrinketCD ¶
func (*Character) GetPresimOptions ¶
func (character *Character) GetPresimOptions(playerConfig proto.Player) *PresimOptions
func (*Character) GetRangedWeapon ¶
Returns the ranged weapon if one is equipped, and null otherwise.
func (*Character) GetWeaponHands ¶
Returns the hands that the item is equipped in, as (MH, OH).
func (*Character) HasActiveAura ¶
func (*Character) HasActiveAuraWithTag ¶
func (*Character) HasAuraWithTag ¶
func (*Character) HasMHWeapon ¶
func (*Character) HasMajorCooldown ¶
func (*Character) HasMetaGemEquipped ¶
func (*Character) HasOHWeapon ¶
func (*Character) HasRangedWeapon ¶
func (*Character) HasRingEquipped ¶
func (*Character) HasTrinketEquipped ¶
func (*Character) MeleeCritMultiplier ¶
func (*Character) NewGnomishFlameTurret ¶
func (character *Character) NewGnomishFlameTurret() *GnomishFlameTurret
func (*Character) NewTemporaryStatsAura ¶
func (character *Character) NewTemporaryStatsAura(auraLabel string, actionID ActionID, tempStats stats.Stats, duration time.Duration) *Aura
Helper for the common case of making an aura that adds stats.
func (*Character) NewTemporaryStatsAuraWrapped ¶
func (character *Character) NewTemporaryStatsAuraWrapped(auraLabel string, actionID ActionID, tempStats stats.Stats, duration time.Duration, modConfig func(*Aura)) *Aura
Alternative that allows modifying the Aura config.
func (*Character) NextEnergyTickAt ¶
func (*Character) OnCastComplete ¶
func (at *Character) OnCastComplete(sim *Simulation, spell *Spell)
Invokes the OnCastComplete event for all tracked Auras.
func (*Character) OnPeriodicDamageDealt ¶
func (at *Character) OnPeriodicDamageDealt(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
Invokes the OnPeriodicDamage
As a debuff when target is being hit by dot. As a buff when caster's dots are ticking.
func (*Character) OnPeriodicDamageTaken ¶
func (at *Character) OnPeriodicDamageTaken(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
func (*Character) OnSpellHitDealt ¶
func (at *Character) OnSpellHitDealt(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
Invokes the OnSpellHit event for all tracked Auras.
func (*Character) OnSpellHitTaken ¶
func (at *Character) OnSpellHitTaken(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
func (*Character) RegisterResetEffect ¶
func (at *Character) RegisterResetEffect(resetEffect ResetEffect)
Registers a callback to this Character which will be invoked on every Sim reset.
func (*Character) RemoveHealth ¶
func (hb *Character) RemoveHealth(sim *Simulation, amount float64)
func (*Character) ResetEnergyTick ¶
func (eb *Character) ResetEnergyTick(sim *Simulation)
Gives an immediate partial energy tick and restarts the tick timer.
func (*Character) ShouldRefreshAuraWithTagAtPriority ¶
func (at *Character) ShouldRefreshAuraWithTagAtPriority(sim *Simulation, tag string, priority float64, refreshWindow time.Duration) bool
Returns if an aura should be refreshed at a specific priority, i.e. the aura is about to expire AND the replacement aura has at least as high priority.
This is used to decide whether to refresh effects with multiple strengths, like Thunder Clap/Deathfrost or Faerie Fire ranks.
func (*Character) SpellCritMultiplier ¶
func (*Character) SpendComboPoints ¶
func (eb *Character) SpendComboPoints(sim *Simulation, metrics *ResourceMetrics)
func (*Character) SpendEnergy ¶
func (eb *Character) SpendEnergy(sim *Simulation, amount float64, metrics *ResourceMetrics)
func (*Character) SpendRage ¶
func (rb *Character) SpendRage(sim *Simulation, amount float64, metrics *ResourceMetrics)
func (*Character) TryUseCooldowns ¶
func (mcdm *Character) TryUseCooldowns(sim *Simulation)
func (*Character) UpdateMajorCooldowns ¶
func (mcdm *Character) UpdateMajorCooldowns()
This function should be called if the CD for a major cooldown changes outside of the TryActivate() call.
func (*Character) WeaponFromMainHand ¶
Returns weapon stats using the main hand equipped weapon.
func (*Character) WeaponFromOffHand ¶
Returns weapon stats using the off hand equipped weapon.
func (*Character) WeaponFromRanged ¶
Returns weapon stats using the off hand equipped weapon.
type CharacterIterationMetrics ¶
type CharacterIterationMetrics struct {
Died bool // Whether this unit died in the current iteration.
WentOOM bool // Whether the agent has hit OOM at least once in this iteration.
ManaSpent float64
ManaGained float64
BonusManaGained float64 // Only includes amount from mana pots / runes / innervates.
OOMTime time.Duration // time spent not casting and waiting for regen.
}
Metrics for the current iteration, for 1 agent. Keep this as a separate struct so its easy to clear.
type CharacterSuiteConfig ¶
type CharacterSuiteConfig struct {
Class proto.Class
Race proto.Race
GearSet GearSetCombo
SpecOptions SpecOptionsCombo
RaidBuffs *proto.RaidBuffs
PartyBuffs *proto.PartyBuffs
PlayerBuffs *proto.IndividualBuffs
Consumes *proto.Consumes
Debuffs *proto.Debuffs
IsTank bool
InFrontOfTarget bool
OtherRaces []proto.Race
OtherGearSets []GearSetCombo
OtherSpecOptions []SpecOptionsCombo
ItemFilter ItemFilter
StatsToWeigh []proto.Stat
EPReferenceStat proto.Stat
}
type CombinedTestGenerator ¶
type CombinedTestGenerator struct {
// contains filtered or unexported fields
}
func (*CombinedTestGenerator) GetTest ¶
func (generator *CombinedTestGenerator) GetTest(testIdx int) (string, *proto.ComputeStatsRequest, *proto.StatWeightsRequest, *proto.RaidSimRequest)
func (*CombinedTestGenerator) NumTests ¶
func (generator *CombinedTestGenerator) NumTests() int
type Cooldown ¶
type Cooldown struct {
*Timer
// Default amount of time after activation before this CD can be used again.
// Note that some CDs won't use this, e.g. the GCD.
Duration time.Duration
}
func (*Cooldown) Use ¶
func (cd *Cooldown) Use(sim *Simulation)
Puts this CD on cooldown, using the default duration.
type CooldownActivation ¶
type CooldownActivation func(*Simulation, *Character)
Function for activating a cooldown. Returns whether the activation was successful.
type CooldownActivationCondition ¶
type CooldownActivationCondition func(*Simulation, *Character) bool
Condition for whether a cooldown can/should be activated. Returning false prevents the cooldown from being activated.
type CooldownActivationFactory ¶
type CooldownActivationFactory func(*Simulation) CooldownActivation
Function for making a CooldownActivation.
We need a function that returns a CooldownActivation rather than a CooldownActivation, so captured local variables can be reset on Sim reset.
type CooldownType ¶
type CooldownType byte
const ( CooldownTypeUnknown CooldownType = 0 CooldownTypeMana CooldownType = 1 << iota CooldownTypeDPS CooldownTypeSurvival CooldownTypeUsableShapeShifted )
func (CooldownType) Matches ¶
func (ct CooldownType) Matches(other CooldownType) bool
type DistributionMetrics ¶
type DistributionMetrics struct {
// Values for the current iteration. These are cleared after each iteration.
Total float64
// contains filtered or unexported fields
}
func NewDistributionMetrics ¶
func NewDistributionMetrics() DistributionMetrics
func (*DistributionMetrics) ToProto ¶
func (distMetrics *DistributionMetrics) ToProto(numIterations int32) *proto.DistributionMetrics
type Dot ¶
type Dot struct {
Spell *Spell
// Embed Aura so we can use IsActive/Refresh/etc directly.
*Aura
NumberOfTicks int // number of ticks over the whole duration
TickLength time.Duration // time between each tick
// If true, tick length will be shortened based on casting speed.
AffectedByCastSpeed bool
TickEffects TickEffects
// Number of ticks since last call to Apply().
TickCount int
// contains filtered or unexported fields
}
func (*Dot) Apply ¶
func (dot *Dot) Apply(sim *Simulation)
func (*Dot) Cancel ¶
func (dot *Dot) Cancel(sim *Simulation)
func (*Dot) RecomputeAuraDuration ¶
func (dot *Dot) RecomputeAuraDuration()
Call this after manually changing NumberOfTicks or TickLength.
func (*Dot) TakeSnapshot ¶
func (dot *Dot) TakeSnapshot(sim *Simulation)
Takes a new snapshot of this Dot's effects.
In most cases this will be called automatically, and should only be called to force a new snapshot to be taken.
type Encounter ¶
type Encounter struct {
Duration time.Duration
DurationVariation time.Duration
Targets []*Target
EndFightAtHealth float64
// DamgeTaken is used to track health fights instead of duration fights.
// Once primary target has taken its health worth of damage, fight ends.
DamageTaken float64
// In health fight: set to true until we get something to base on
DurationIsEstimate bool
// contains filtered or unexported fields
}
func NewEncounter ¶
func (*Encounter) GetMetricsProto ¶
func (encounter *Encounter) GetMetricsProto(numIterations int32) *proto.EncounterMetrics
type EncounterCombo ¶
func MakeDefaultEncounterCombos ¶
func MakeDefaultEncounterCombos(debuffs *proto.Debuffs) []EncounterCombo
type Environment ¶
type Environment struct {
State EnvironmentState
Raid *Raid
Encounter Encounter
BaseDuration time.Duration // base duration
DurationVariation time.Duration // variation per duration
// contains filtered or unexported fields
}
func NewEnvironment ¶
func (*Environment) GetMaxDuration ¶
func (env *Environment) GetMaxDuration() time.Duration
The maximum possible duration for any iteration.
func (*Environment) GetNumTargets ¶
func (env *Environment) GetNumTargets() int32
func (*Environment) GetTarget ¶
func (env *Environment) GetTarget(index int32) *Target
func (*Environment) GetTargetUnit ¶
func (env *Environment) GetTargetUnit(index int32) *Unit
func (*Environment) IsFinalized ¶
func (env *Environment) IsFinalized() bool
func (*Environment) NextTarget ¶
func (env *Environment) NextTarget(target *Unit) *Target
func (*Environment) NextTargetUnit ¶
func (env *Environment) NextTargetUnit(target *Unit) *Unit
func (*Environment) RegisterPostFinalizeEffect ¶
func (env *Environment) RegisterPostFinalizeEffect(postFinalizeEffect PostFinalizeEffect)
Registers a callback to this Character which will be invoked after all Units are finalized.
type EnvironmentState ¶
type EnvironmentState int
const ( Created EnvironmentState = iota Constructed Initialized Finalized )
type GearSetCombo ¶
type GearSetCombo struct {
Label string
GearSet *proto.EquipmentSpec
}
type GnomishFlameTurret ¶
func (*GnomishFlameTurret) AddComboPoints ¶
func (eb *GnomishFlameTurret) AddComboPoints(sim *Simulation, pointsToAdd int32, metrics *ResourceMetrics)
func (*GnomishFlameTurret) AddEnergy ¶
func (eb *GnomishFlameTurret) AddEnergy(sim *Simulation, amount float64, metrics *ResourceMetrics)
func (*GnomishFlameTurret) AddMajorCooldown ¶
func (mcdm *GnomishFlameTurret) AddMajorCooldown(mcd MajorCooldown)
Registers a major cooldown to the Character, which will be automatically used when available.
func (*GnomishFlameTurret) AddRage ¶
func (rb *GnomishFlameTurret) AddRage(sim *Simulation, amount float64, metrics *ResourceMetrics)
func (*GnomishFlameTurret) ComboPoints ¶
func (eb *GnomishFlameTurret) ComboPoints() int32
func (*GnomishFlameTurret) CurrentEnergy ¶
func (eb *GnomishFlameTurret) CurrentEnergy() float64
func (*GnomishFlameTurret) CurrentHealth ¶
func (hb *GnomishFlameTurret) CurrentHealth() float64
func (*GnomishFlameTurret) CurrentHealthPercent ¶
func (hb *GnomishFlameTurret) CurrentHealthPercent() float64
func (*GnomishFlameTurret) CurrentRage ¶
func (rb *GnomishFlameTurret) CurrentRage() float64
func (*GnomishFlameTurret) DelayDPSCooldownsForArmorDebuffs ¶
func (mcdm *GnomishFlameTurret) DelayDPSCooldownsForArmorDebuffs()
Adds a delay to the first usage of all CDs so that armor debuffs have time to be applied. MCDs that have a user-specified timing are not delayed.
This function should be called from Agent.Init().
func (*GnomishFlameTurret) DisableAllEnabledCooldowns ¶
func (mcdm *GnomishFlameTurret) DisableAllEnabledCooldowns(cooldownType CooldownType) []*MajorCooldown
Disabled all MCDs that are currently enabled, and returns a list of the MCDs which were disabled by this call. If cooldownType is not CooldownTypeUnknown, then will be restricted to cooldowns of that type.
func (*GnomishFlameTurret) DisableMajorCooldown ¶
func (mcdm *GnomishFlameTurret) DisableMajorCooldown(actionID ActionID)
func (*GnomishFlameTurret) EnableAllCooldowns ¶
func (mcdm *GnomishFlameTurret) EnableAllCooldowns(mcdsToEnable []*MajorCooldown)
func (*GnomishFlameTurret) EnableMajorCooldown ¶
func (mcdm *GnomishFlameTurret) EnableMajorCooldown(actionID ActionID)
func (*GnomishFlameTurret) GainHealth ¶
func (hb *GnomishFlameTurret) GainHealth(sim *Simulation, amount float64, metrics *ResourceMetrics)
func (*GnomishFlameTurret) GetActiveAuraWithTag ¶
func (*GnomishFlameTurret) GetAurasWithTag ¶
func (*GnomishFlameTurret) GetInitialMajorCooldown ¶
func (mcdm *GnomishFlameTurret) GetInitialMajorCooldown(actionID ActionID) MajorCooldown
func (*GnomishFlameTurret) GetMajorCooldown ¶
func (mcdm *GnomishFlameTurret) GetMajorCooldown(actionID ActionID) *MajorCooldown
func (*GnomishFlameTurret) GetMajorCooldownIDs ¶
func (*GnomishFlameTurret) GetMajorCooldowns ¶
func (mcdm *GnomishFlameTurret) GetMajorCooldowns() []*MajorCooldown
Returns all MCDs.
func (*GnomishFlameTurret) GetPet ¶
func (gft *GnomishFlameTurret) GetPet() *Pet
func (*GnomishFlameTurret) HasActiveAura ¶
func (*GnomishFlameTurret) HasActiveAuraWithTag ¶
func (*GnomishFlameTurret) HasAuraWithTag ¶
func (*GnomishFlameTurret) HasMajorCooldown ¶
func (*GnomishFlameTurret) Initialize ¶
func (gft *GnomishFlameTurret) Initialize()
func (*GnomishFlameTurret) NextEnergyTickAt ¶
func (*GnomishFlameTurret) OnCastComplete ¶
func (at *GnomishFlameTurret) OnCastComplete(sim *Simulation, spell *Spell)
Invokes the OnCastComplete event for all tracked Auras.
func (*GnomishFlameTurret) OnGCDReady ¶
func (gft *GnomishFlameTurret) OnGCDReady(sim *Simulation)
func (*GnomishFlameTurret) OnPeriodicDamageDealt ¶
func (at *GnomishFlameTurret) OnPeriodicDamageDealt(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
Invokes the OnPeriodicDamage
As a debuff when target is being hit by dot. As a buff when caster's dots are ticking.
func (*GnomishFlameTurret) OnPeriodicDamageTaken ¶
func (at *GnomishFlameTurret) OnPeriodicDamageTaken(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
func (*GnomishFlameTurret) OnSpellHitDealt ¶
func (at *GnomishFlameTurret) OnSpellHitDealt(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
Invokes the OnSpellHit event for all tracked Auras.
func (*GnomishFlameTurret) OnSpellHitTaken ¶
func (at *GnomishFlameTurret) OnSpellHitTaken(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
func (*GnomishFlameTurret) RegisterResetEffect ¶
func (at *GnomishFlameTurret) RegisterResetEffect(resetEffect ResetEffect)
Registers a callback to this Character which will be invoked on every Sim reset.
func (*GnomishFlameTurret) RemoveHealth ¶
func (hb *GnomishFlameTurret) RemoveHealth(sim *Simulation, amount float64)
func (*GnomishFlameTurret) Reset ¶
func (gft *GnomishFlameTurret) Reset(sim *Simulation)
func (*GnomishFlameTurret) ResetEnergyTick ¶
func (eb *GnomishFlameTurret) ResetEnergyTick(sim *Simulation)
Gives an immediate partial energy tick and restarts the tick timer.
func (*GnomishFlameTurret) ShouldRefreshAuraWithTagAtPriority ¶
func (at *GnomishFlameTurret) ShouldRefreshAuraWithTagAtPriority(sim *Simulation, tag string, priority float64, refreshWindow time.Duration) bool
Returns if an aura should be refreshed at a specific priority, i.e. the aura is about to expire AND the replacement aura has at least as high priority.
This is used to decide whether to refresh effects with multiple strengths, like Thunder Clap/Deathfrost or Faerie Fire ranks.
func (*GnomishFlameTurret) SpendComboPoints ¶
func (eb *GnomishFlameTurret) SpendComboPoints(sim *Simulation, metrics *ResourceMetrics)
func (*GnomishFlameTurret) SpendEnergy ¶
func (eb *GnomishFlameTurret) SpendEnergy(sim *Simulation, amount float64, metrics *ResourceMetrics)
func (*GnomishFlameTurret) SpendRage ¶
func (rb *GnomishFlameTurret) SpendRage(sim *Simulation, amount float64, metrics *ResourceMetrics)
func (*GnomishFlameTurret) TryUseCooldowns ¶
func (mcdm *GnomishFlameTurret) TryUseCooldowns(sim *Simulation)
func (*GnomishFlameTurret) UpdateMajorCooldowns ¶
func (mcdm *GnomishFlameTurret) UpdateMajorCooldowns()
This function should be called if the CD for a major cooldown changes outside of the TryActivate() call.
type GoRand ¶
func (GoRand) NextFloat64 ¶
type Hardcast ¶
type Hardcast struct {
Expires time.Duration
OnComplete func(*Simulation, *Unit)
Target *Unit
}
func (*Hardcast) OnExpire ¶
func (hc *Hardcast) OnExpire(sim *Simulation)
type HitOutcome ¶
type HitOutcome uint16
Possible outcomes of any hit/damage roll.
const ( OutcomeEmpty HitOutcome = 0 // These bits are set by the hit roll OutcomeMiss HitOutcome = 1 << iota OutcomeHit OutcomeDodge OutcomeGlance OutcomeParry OutcomeBlock // These bits are set by the crit and damage rolls. OutcomeCrit OutcomeCrush OutcomePartial1_4 // 1/4 of the spell was resisted. OutcomePartial2_4 // 2/4 of the spell was resisted. OutcomePartial3_4 // 3/4 of the spell was resisted. )
Single-bit outcomes.
func (HitOutcome) Matches ¶
func (ho HitOutcome) Matches(other HitOutcome) bool
Returns whether there is any overlap between the given masks.
func (HitOutcome) PartialResistString ¶
func (ho HitOutcome) PartialResistString() string
func (HitOutcome) String ¶
func (ho HitOutcome) String() string
type IndividualTestSuite ¶
type IndividualTestSuite struct {
Name string
// contains filtered or unexported fields
}
func NewIndividualTestSuite ¶
func NewIndividualTestSuite(suiteName string) *IndividualTestSuite
func (*IndividualTestSuite) Done ¶
func (testSuite *IndividualTestSuite) Done(t *testing.T)
func (*IndividualTestSuite) TestCharacterStats ¶
func (testSuite *IndividualTestSuite) TestCharacterStats(testName string, csr *proto.ComputeStatsRequest)
func (*IndividualTestSuite) TestDPS ¶
func (testSuite *IndividualTestSuite) TestDPS(testName string, rsr *proto.RaidSimRequest)
func (*IndividualTestSuite) TestStatWeights ¶
func (testSuite *IndividualTestSuite) TestStatWeights(testName string, swr *proto.StatWeightsRequest)
type ItemFilter ¶
type ItemFilter struct {
// If set to ClassUnknown, any class is fine.
Class proto.Class
ArmorType proto.ArmorType
// Blank list allows any value. Otherwise item must match 1 value from the list.
WeaponTypes []proto.WeaponType
HandTypes []proto.HandType
RangedWeaponTypes []proto.RangedWeaponType
// Item IDs to ignore.
IDBlacklist []int32
}
Returns all items that meet the given conditions.
func (*ItemFilter) FindAllItems ¶
func (filter *ItemFilter) FindAllItems() []items.Item
func (*ItemFilter) FindAllMetaGems ¶
func (filter *ItemFilter) FindAllMetaGems() []items.Gem
func (*ItemFilter) FindAllSets ¶
func (filter *ItemFilter) FindAllSets() []*ItemSet
type ItemSet ¶
type ItemSet struct {
Name string
// IDs of items that are part of this set. map[key]struct{} is roughly a set in go.
Items map[int32]struct{}
// Maps set piece requirement to an ApplyEffect function that will be called
// before the Sim starts.
//
// The function should apply any benefits provided by the set bonus.
Bonuses map[int32]ApplyEffect
}
func GetAllItemSets ¶
func GetAllItemSets() []*ItemSet
func NewItemSet ¶
Registers a new ItemSet with item IDs populated.
func (ItemSet) CharacterHasSetBonus ¶
func (ItemSet) ItemIsInSet ¶
type ItemsTestGenerator ¶
type ItemsTestGenerator struct {
// Fields describing the base API request.
Player *proto.Player
PartyBuffs *proto.PartyBuffs
RaidBuffs *proto.RaidBuffs
Debuffs *proto.Debuffs
Encounter *proto.Encounter
SimOptions *proto.SimOptions
// Some fields are populated automatically.
ItemFilter ItemFilter
// contains filtered or unexported fields
}
func (*ItemsTestGenerator) GetTest ¶
func (generator *ItemsTestGenerator) GetTest(testIdx int) (string, *proto.ComputeStatsRequest, *proto.StatWeightsRequest, *proto.RaidSimRequest)
func (*ItemsTestGenerator) NumTests ¶
func (generator *ItemsTestGenerator) NumTests() int
type MajorCooldown ¶
type MajorCooldown struct {
// Spell that is cast when this MCD is activated.
Spell *Spell
// Cooldowns with higher priority get used first. This is important when some
// cooldowns have a non-zero cast time. For example, Drums should be used
// before Bloodlust.
Priority float64
// Internal category, used for filtering. For example, mages want to disable
// all DPS cooldowns during their regen rotation.
Type CooldownType
// Whether the cooldown meets all hard requirements for activation (e.g. resource cost).
// Note chat whether the cooldown is off CD is automatically checked, so it does not
// need to be checked again by this function.
CanActivate CooldownActivationCondition
// Whether the cooldown meets all optional conditions for activation. These
// conditions will be ignored when the user specifies their own activation time.
// This is for things like mana thresholds, which are optimizations for better
// automatic timing.
ShouldActivate CooldownActivationCondition
// Factory for creating the activate function on every Sim reset.
ActivationFactory CooldownActivationFactory
// contains filtered or unexported fields
}
func (*MajorCooldown) GetTimings ¶
func (mcd *MajorCooldown) GetTimings() []time.Duration
func (*MajorCooldown) IsEnabled ¶
func (mcd *MajorCooldown) IsEnabled() bool
func (*MajorCooldown) IsReady ¶
func (mcd *MajorCooldown) IsReady(sim *Simulation) bool
func (*MajorCooldown) ReadyAt ¶
func (mcd *MajorCooldown) ReadyAt() time.Duration
func (*MajorCooldown) TimeToReady ¶
func (mcd *MajorCooldown) TimeToReady(sim *Simulation) time.Duration
func (*MajorCooldown) TryActivate ¶
func (mcd *MajorCooldown) TryActivate(sim *Simulation, character *Character) bool
Public version of TryActivate for manual activation by Agent code. Note that this version will work even if the MCD is disabled.
type MeleeDamageCalculator ¶
type OnCastComplete ¶
type OnCastComplete func(aura *Aura, sim *Simulation, spell *Spell)
Callback for when a cast is finished, i.e. when the in-game castbar reaches full.
type OnDoneIteration ¶
type OnDoneIteration func(aura *Aura, sim *Simulation)
type OnEnergyGain ¶
type OnEnergyGain func(sim *Simulation)
OnEnergyGain is called any time energy is increased.
type OnExpire ¶
type OnExpire func(aura *Aura, sim *Simulation)
type OnGain ¶
type OnGain func(aura *Aura, sim *Simulation)
type OnInit ¶
type OnInit func(aura *Aura, sim *Simulation)
type OnPeriodicDamage ¶
type OnPeriodicDamage func(aura *Aura, sim *Simulation, spell *Spell, spellEffect *SpellEffect)
OnPeriodicDamage is called when dots tick, after damage is calculated. Use it for proc effects or anything that comes from the final result of a tick.
type OnRageGain ¶
type OnRageGain func(sim *Simulation)
OnRageGain is called any time rage is increased.
type OnReset ¶
type OnReset func(aura *Aura, sim *Simulation)
type OnSpellHit ¶
type OnSpellHit func(aura *Aura, sim *Simulation, spell *Spell, spellEffect *SpellEffect)
Callback for after a spell hits the target and after damage is calculated. Use it for proc effects or anything that comes from the final result of the spell.
type OnStacksChange ¶
type OnStacksChange func(aura *Aura, sim *Simulation, oldStacks int32, newStacks int32)
type OutcomeApplier ¶
type OutcomeApplier func(sim *Simulation, spell *Spell, spellEffect *SpellEffect, attackTable *AttackTable)
This function should do 3 things:
- Set the Outcome of the hit effect.
- Update spell outcome metrics.
- Modify the damage if necessary.
type PPMManager ¶
type PPMManager struct {
// contains filtered or unexported fields
}
func (*PPMManager) Proc ¶
func (ppmm *PPMManager) Proc(sim *Simulation, procMask ProcMask, label string) bool
Returns whether the effect procced.
func (*PPMManager) ProcWithWeaponSpecials ¶
func (ppmm *PPMManager) ProcWithWeaponSpecials(sim *Simulation, procMask ProcMask, label string) bool
Returns whether the effect procced. This is different from Proc() in that yellow melee hits use a proc chance based on the equipped weapon speed rather than the base attack speed. This distinction matters for feral druids.
type Party ¶
type Party struct {
Raid *Raid
Index int
Players []Agent
Pets []PetAgent // Cached list of all the pets in the party.
PlayersAndPets []Agent // Cached list of players + pets, concatenated.
// contains filtered or unexported fields
}
func (*Party) GetMetrics ¶
func (party *Party) GetMetrics(numIterations int32) *proto.PartyMetrics
func (*Party) GetPartyBuffs ¶
func (party *Party) GetPartyBuffs(basePartyBuffs *proto.PartyBuffs) proto.PartyBuffs
type PendingAction ¶
type PendingAction struct {
NextActionAt time.Duration
Priority ActionPriority
OnAction func(*Simulation)
CleanUp func(*Simulation)
// contains filtered or unexported fields
}
func NewPeriodicAction ¶
func NewPeriodicAction(sim *Simulation, options PeriodicActionOptions) *PendingAction
func (*PendingAction) Cancel ¶
func (pa *PendingAction) Cancel(sim *Simulation)
type PeriodicActionOptions ¶
type PeriodicActionOptions struct {
// How often the action should be performed.
Period time.Duration
// Number of times to perform the action before stopping.
// 0 indicates a permanent periodic action.
NumTicks int
// Whether the first tick should happen immediately. If false, first tick will
// wait for Period.
TickImmediately bool
Priority ActionPriority
OnAction func(*Simulation)
CleanUp func(*Simulation)
}
type Pet ¶
Pet is an extension of Character, for any entity created by a player that can take actions on its own.
func (*Pet) AddComboPoints ¶
func (eb *Pet) AddComboPoints(sim *Simulation, pointsToAdd int32, metrics *ResourceMetrics)
func (*Pet) AddEnergy ¶
func (eb *Pet) AddEnergy(sim *Simulation, amount float64, metrics *ResourceMetrics)
func (*Pet) AddMajorCooldown ¶
func (mcdm *Pet) AddMajorCooldown(mcd MajorCooldown)
Registers a major cooldown to the Character, which will be automatically used when available.
func (*Pet) AddPartyBuffs ¶
func (pet *Pet) AddPartyBuffs(partyBuffs *proto.PartyBuffs)
func (*Pet) AddRage ¶
func (rb *Pet) AddRage(sim *Simulation, amount float64, metrics *ResourceMetrics)
func (*Pet) AddRaidBuffs ¶
func (*Pet) ApplyTalents ¶
func (pet *Pet) ApplyTalents()
func (*Pet) ComboPoints ¶
func (eb *Pet) ComboPoints() int32
func (*Pet) CurrentEnergy ¶
func (eb *Pet) CurrentEnergy() float64
func (*Pet) CurrentHealth ¶
func (hb *Pet) CurrentHealth() float64
func (*Pet) CurrentHealthPercent ¶
func (hb *Pet) CurrentHealthPercent() float64
func (*Pet) CurrentRage ¶
func (rb *Pet) CurrentRage() float64
func (*Pet) DelayDPSCooldownsForArmorDebuffs ¶
func (mcdm *Pet) DelayDPSCooldownsForArmorDebuffs()
Adds a delay to the first usage of all CDs so that armor debuffs have time to be applied. MCDs that have a user-specified timing are not delayed.
This function should be called from Agent.Init().
func (*Pet) Disable ¶
func (pet *Pet) Disable(sim *Simulation)
func (*Pet) DisableAllEnabledCooldowns ¶
func (mcdm *Pet) DisableAllEnabledCooldowns(cooldownType CooldownType) []*MajorCooldown
Disabled all MCDs that are currently enabled, and returns a list of the MCDs which were disabled by this call. If cooldownType is not CooldownTypeUnknown, then will be restricted to cooldowns of that type.
func (*Pet) DisableMajorCooldown ¶
func (mcdm *Pet) DisableMajorCooldown(actionID ActionID)
func (*Pet) Enable ¶
func (pet *Pet) Enable(sim *Simulation, petAgent PetAgent)
petAgent should be the PetAgent which embeds this Pet.
func (*Pet) EnableAllCooldowns ¶
func (mcdm *Pet) EnableAllCooldowns(mcdsToEnable []*MajorCooldown)
func (*Pet) EnableMajorCooldown ¶
func (mcdm *Pet) EnableMajorCooldown(actionID ActionID)
func (*Pet) EnableWithTimeout ¶
func (pet *Pet) EnableWithTimeout(sim *Simulation, petAgent PetAgent, petDuration time.Duration)
Helper for enabling a pet that will expire after a certain duration.
func (*Pet) Finalize ¶
func (pet *Pet) Finalize()
This needs to be called after owner stats are finalized so we can inherit the final values.
func (*Pet) GainHealth ¶
func (hb *Pet) GainHealth(sim *Simulation, amount float64, metrics *ResourceMetrics)
func (*Pet) GetActiveAuraWithTag ¶
func (*Pet) GetAurasWithTag ¶
func (*Pet) GetCharacter ¶
Default implementations for some Agent functions which most Pets don't need.
func (*Pet) GetInitialMajorCooldown ¶
func (mcdm *Pet) GetInitialMajorCooldown(actionID ActionID) MajorCooldown
func (*Pet) GetMajorCooldown ¶
func (mcdm *Pet) GetMajorCooldown(actionID ActionID) *MajorCooldown
func (*Pet) GetMajorCooldownIDs ¶
func (*Pet) GetMajorCooldowns ¶
func (mcdm *Pet) GetMajorCooldowns() []*MajorCooldown
Returns all MCDs.
func (*Pet) HasActiveAura ¶
func (*Pet) HasActiveAuraWithTag ¶
func (*Pet) HasAuraWithTag ¶
func (*Pet) HasMajorCooldown ¶
func (*Pet) NextEnergyTickAt ¶
func (*Pet) OnCastComplete ¶
func (at *Pet) OnCastComplete(sim *Simulation, spell *Spell)
Invokes the OnCastComplete event for all tracked Auras.
func (*Pet) OnPeriodicDamageDealt ¶
func (at *Pet) OnPeriodicDamageDealt(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
Invokes the OnPeriodicDamage
As a debuff when target is being hit by dot. As a buff when caster's dots are ticking.
func (*Pet) OnPeriodicDamageTaken ¶
func (at *Pet) OnPeriodicDamageTaken(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
func (*Pet) OnSpellHitDealt ¶
func (at *Pet) OnSpellHitDealt(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
Invokes the OnSpellHit event for all tracked Auras.
func (*Pet) OnSpellHitTaken ¶
func (at *Pet) OnSpellHitTaken(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
func (*Pet) RegisterResetEffect ¶
func (at *Pet) RegisterResetEffect(resetEffect ResetEffect)
Registers a callback to this Character which will be invoked on every Sim reset.
func (*Pet) RemoveHealth ¶
func (hb *Pet) RemoveHealth(sim *Simulation, amount float64)
func (*Pet) ResetEnergyTick ¶
func (eb *Pet) ResetEnergyTick(sim *Simulation)
Gives an immediate partial energy tick and restarts the tick timer.
func (*Pet) ShouldRefreshAuraWithTagAtPriority ¶
func (at *Pet) ShouldRefreshAuraWithTagAtPriority(sim *Simulation, tag string, priority float64, refreshWindow time.Duration) bool
Returns if an aura should be refreshed at a specific priority, i.e. the aura is about to expire AND the replacement aura has at least as high priority.
This is used to decide whether to refresh effects with multiple strengths, like Thunder Clap/Deathfrost or Faerie Fire ranks.
func (*Pet) SpendComboPoints ¶
func (eb *Pet) SpendComboPoints(sim *Simulation, metrics *ResourceMetrics)
func (*Pet) SpendEnergy ¶
func (eb *Pet) SpendEnergy(sim *Simulation, amount float64, metrics *ResourceMetrics)
func (*Pet) SpendRage ¶
func (rb *Pet) SpendRage(sim *Simulation, amount float64, metrics *ResourceMetrics)
func (*Pet) TryUseCooldowns ¶
func (mcdm *Pet) TryUseCooldowns(sim *Simulation)
func (*Pet) UpdateMajorCooldowns ¶
func (mcdm *Pet) UpdateMajorCooldowns()
This function should be called if the CD for a major cooldown changes outside of the TryActivate() call.
type PostFinalizeEffect ¶
type PostFinalizeEffect func()
Callback for doing something after finalization.
type PresetTarget ¶
type PresetTarget struct {
// String in folder-structure format identifying a category for this unit, e.g. "Black Temple/Bosses".
PathPrefix string
Config proto.Target
AI AIFactory
}
func GetPresetTargetWithID ¶
func GetPresetTargetWithID(id int32) *PresetTarget
func GetPresetTargetWithPath ¶
func GetPresetTargetWithPath(path string) *PresetTarget
func (PresetTarget) Path ¶
func (pt PresetTarget) Path() string
func (PresetTarget) ToProto ¶
func (pt PresetTarget) ToProto() *proto.PresetTarget
type PresimOptions ¶
type PresimOptions struct {
// Called once before each presim round.
//
// Modify the player parameter to use whatever player options are desired
// for the presim.
SetPresimPlayerOptions func(player *proto.Player)
// Called once after each presim round to provide the results.
//
// Should return true if this Agent is done running presims, and false otherwise.
OnPresimResult func(presimResult proto.UnitMetrics, iterations int32, duration time.Duration) bool
}
Controls the presim behavior for 1 Agent.
type Presimmer ¶
type Presimmer interface {
GetPresimOptions(proto.Player) *PresimOptions
}
A presim is a full simulation run with multiple iterations, as a preparation step for testing out settings before starting the recorded iterations.
To use this, just implement this interface on your Agent.
If you don't know what this is, you probably don't need it.
type ProcMask ¶
type ProcMask uint32
const ( // Default value is invalid, to force authors to think about proc masks. ProcMaskUnknown ProcMask = 0 ProcMaskEmpty ProcMask = 1 << iota ProcMaskMeleeMHAuto ProcMaskMeleeOHAuto ProcMaskMeleeMHSpecial ProcMaskMeleeOHSpecial ProcMaskRangedAuto ProcMaskRangedSpecial ProcMaskSpellDamage ProcMaskPeriodicDamage )
Single-bit masks. These don't need to match Blizzard's values.
type Raid ¶
type Raid struct {
Parties []*Party
AllUnits []*Unit // Cached list of all Units (players and pets) in the raid.
// contains filtered or unexported fields
}
func (*Raid) GetMetrics ¶
func (raid *Raid) GetMetrics(numIterations int32) *proto.RaidMetrics
func (Raid) GetPlayerFromRaidTarget ¶
func (raid Raid) GetPlayerFromRaidTarget(raidTarget proto.RaidTarget) Agent
func (Raid) GetPlayerFromUnit ¶
func (*Raid) GetRaidBuffs ¶
type ReplaceMHSwing ¶
type ReplaceMHSwing func(sim *Simulation, mhSwingSpell *Spell) *Spell
ReplaceMHSwing is called right before an auto attack fires
If it returns nil, the attack takes place as normal. If it returns a Spell, that Spell is used in place of the attack. This allows for abilities that convert a white attack into yellow attack.
type ResourceKey ¶
type ResourceKey struct {
ActionID ActionID
Type proto.ResourceType
}
type ResourceMetrics ¶
type ResourceMetrics struct {
ActionID ActionID
Type proto.ResourceType
Events int32
Gain float64
ActualGain float64
EventsFromPreviousIterations int32
ActualGainFromPreviousIterations float64
}
func (*ResourceMetrics) ActualGainForCurrentIteration ¶
func (resourceMetrics *ResourceMetrics) ActualGainForCurrentIteration() float64
func (*ResourceMetrics) AddEvent ¶
func (resourceMetrics *ResourceMetrics) AddEvent(gain float64, actualGain float64)
func (*ResourceMetrics) EventsForCurrentIteration ¶
func (resourceMetrics *ResourceMetrics) EventsForCurrentIteration() int32
func (*ResourceMetrics) ToProto ¶
func (resourceMetrics *ResourceMetrics) ToProto() *proto.ResourceMetrics
type SettingsCombos ¶
type SettingsCombos struct {
Class proto.Class
Races []proto.Race
GearSets []GearSetCombo
SpecOptions []SpecOptionsCombo
Buffs []BuffsCombo
Encounters []EncounterCombo
SimOptions *proto.SimOptions
}
func (*SettingsCombos) GetTest ¶
func (combos *SettingsCombos) GetTest(testIdx int) (string, *proto.ComputeStatsRequest, *proto.StatWeightsRequest, *proto.RaidSimRequest)
func (*SettingsCombos) NumTests ¶
func (combos *SettingsCombos) NumTests() int
type Simulation ¶
type Simulation struct {
*Environment
Options proto.SimOptions
CurrentTime time.Duration // duration that has elapsed in the sim since starting
Duration time.Duration // Duration of current iteration
ProgressReport func(*proto.ProgressMetrics)
Log func(string, ...interface{})
// contains filtered or unexported fields
}
func NewSim ¶
func NewSim(rsr proto.RaidSimRequest) *Simulation
func (*Simulation) AddPendingAction ¶
func (sim *Simulation) AddPendingAction(pa *PendingAction)
func (*Simulation) GetRemainingDuration ¶
func (sim *Simulation) GetRemainingDuration() time.Duration
func (*Simulation) GetRemainingDurationPercent ¶
func (sim *Simulation) GetRemainingDurationPercent() float64
Returns the percentage of time remaining in the current iteration, as a value from 0-1.
func (*Simulation) IsExecutePhase ¶
func (sim *Simulation) IsExecutePhase() bool
func (*Simulation) RandomFloat ¶
func (sim *Simulation) RandomFloat(label string) float64
Returns a random float.
In tests, although we can set the initial seed, test results are still very sensitive to the exact order of RandomFloat() calls. To mitigate this, when testing we use a separate rand object for each RandomFloat callsite, distinguished by the label string.
func (*Simulation) RegisterExecutePhaseCallback ¶
func (sim *Simulation) RegisterExecutePhaseCallback(callback func(*Simulation))
func (*Simulation) Reset ¶
func (sim *Simulation) Reset()
type SingleCharacterStatsTestGenerator ¶
type SingleCharacterStatsTestGenerator struct {
Name string
Request *proto.ComputeStatsRequest
}
func (*SingleCharacterStatsTestGenerator) GetTest ¶
func (generator *SingleCharacterStatsTestGenerator) GetTest(testIdx int) (string, *proto.ComputeStatsRequest, *proto.StatWeightsRequest, *proto.RaidSimRequest)
func (*SingleCharacterStatsTestGenerator) NumTests ¶
func (generator *SingleCharacterStatsTestGenerator) NumTests() int
type SingleDpsTestGenerator ¶
type SingleDpsTestGenerator struct {
Name string
Request *proto.RaidSimRequest
}
func (*SingleDpsTestGenerator) GetTest ¶
func (generator *SingleDpsTestGenerator) GetTest(testIdx int) (string, *proto.ComputeStatsRequest, *proto.StatWeightsRequest, *proto.RaidSimRequest)
func (*SingleDpsTestGenerator) NumTests ¶
func (generator *SingleDpsTestGenerator) NumTests() int
type SingleStatWeightsTestGenerator ¶
type SingleStatWeightsTestGenerator struct {
Name string
Request *proto.StatWeightsRequest
}
func (*SingleStatWeightsTestGenerator) GetTest ¶
func (generator *SingleStatWeightsTestGenerator) GetTest(testIdx int) (string, *proto.ComputeStatsRequest, *proto.StatWeightsRequest, *proto.RaidSimRequest)
func (*SingleStatWeightsTestGenerator) NumTests ¶
func (generator *SingleStatWeightsTestGenerator) NumTests() int
type SpecOptionsCombo ¶
type SpecOptionsCombo struct {
Label string
SpecOptions interface{}
}
type SpecSetter ¶
type Spell ¶
type Spell struct {
// ID for this spell.
ActionID
// The unit who will perform this spell.
Unit *Unit
// Fire, Frost, Shadow, etc.
SpellSchool SpellSchool
// Flags
Flags SpellFlag
// Should be stats.Mana, stats.Energy, stats.Rage, or unset.
ResourceType stats.Stat
ResourceMetrics *ResourceMetrics
// Base cost. Many effects in the game which 'reduce mana cost by X%'
// are calculated using the base cost.
BaseCost float64
// Default cast parameters with all static effects applied.
DefaultCast Cast
CD Cooldown
SpellMetrics []SpellMetrics
ApplyEffects ApplySpellEffects
// The current or most recent cast data.
CurCast Cast
// contains filtered or unexported fields
}
func (*Spell) ApplyAOEThreat ¶
func (*Spell) ApplyAOEThreatIgnoreMultipliers ¶
func (*Spell) ApplyCostModifiers ¶
func (*Spell) ComboPointMetrics ¶
func (spell *Spell) ComboPointMetrics() *ResourceMetrics
func (*Spell) CurDamagePerCast ¶
Metrics for the current iteration
func (*Spell) IsReady ¶
func (spell *Spell) IsReady(sim *Simulation) bool
func (*Spell) SkipCastAndApplyEffects ¶
func (spell *Spell) SkipCastAndApplyEffects(sim *Simulation, target *Unit)
Skips the actual cast and applies spell effects immediately.
func (*Spell) TimeToReady ¶
func (spell *Spell) TimeToReady(sim *Simulation) time.Duration
func (*Spell) TotalThreatMultiplier ¶
type SpellConfig ¶
type SpellConfig struct {
// See definition of Spell (below) for comments on these.
ActionID
SpellSchool SpellSchool
Flags SpellFlag
ResourceType stats.Stat
BaseCost float64
Cast CastConfig
ApplyEffects ApplySpellEffects
}
type SpellEffect ¶
type SpellEffect struct {
// Target of the spell.
Target *Unit
BaseDamage BaseDamageConfig
OutcomeApplier OutcomeApplier
// Bonus stats to be added to the spell.
BonusSpellHitRating float64
BonusSpellPower float64
BonusSpellCritRating float64
BonusAttackPower float64
BonusCritRating float64
// Additional multiplier that is always applied.
DamageMultiplier float64
// Multiplier for all threat generated by this effect.
ThreatMultiplier float64
// Adds a fixed amount of threat to this spell, before multipliers.
FlatThreatBonus float64
// TODO: Should be able to remove this after refactoring is done.
IsPeriodic bool
// Controls which effects can proc from this effect.
ProcMask ProcMask
// Callbacks for providing additional custom behavior.
OnInit func(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
OnSpellHitDealt func(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
OnPeriodicDamageDealt func(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
// Results
Outcome HitOutcome
Damage float64 // Damage done by this cast.
Threat float64
PreoutcomeDamage float64 // Damage done by this cast.
}
func (*SpellEffect) BonusWeaponDamage ¶
func (spellEffect *SpellEffect) BonusWeaponDamage(unit *Unit) float64
func (*SpellEffect) ExpertisePercentage ¶
func (spellEffect *SpellEffect) ExpertisePercentage(unit *Unit) float64
func (*SpellEffect) IsMH ¶
func (ahe *SpellEffect) IsMH() bool
Returns whether this hit effect is associated with the main-hand weapon.
func (*SpellEffect) IsMelee ¶
func (ahe *SpellEffect) IsMelee() bool
Returns whether this hit effect is associated with either melee weapon.
func (*SpellEffect) IsOH ¶
func (ahe *SpellEffect) IsOH() bool
Returns whether this hit effect is associated with the off-hand weapon.
func (*SpellEffect) Landed ¶
func (spellEffect *SpellEffect) Landed() bool
func (*SpellEffect) MeleeAttackPower ¶
func (spellEffect *SpellEffect) MeleeAttackPower(unit *Unit) float64
func (*SpellEffect) MeleeAttackPowerOnTarget ¶
func (spellEffect *SpellEffect) MeleeAttackPowerOnTarget() float64
func (*SpellEffect) PhysicalCritChance ¶
func (spellEffect *SpellEffect) PhysicalCritChance(unit *Unit, spell *Spell, attackTable *AttackTable) float64
func (*SpellEffect) PhysicalHitChance ¶
func (spellEffect *SpellEffect) PhysicalHitChance(unit *Unit, attackTable *AttackTable) float64
func (*SpellEffect) RangedAttackPower ¶
func (spellEffect *SpellEffect) RangedAttackPower(unit *Unit) float64
func (*SpellEffect) RangedAttackPowerOnTarget ¶
func (spellEffect *SpellEffect) RangedAttackPowerOnTarget() float64
func (*SpellEffect) SpellCritChance ¶
func (spellEffect *SpellEffect) SpellCritChance(unit *Unit, spell *Spell) float64
func (*SpellEffect) SpellPower ¶
func (spellEffect *SpellEffect) SpellPower(unit *Unit, spell *Spell) float64
func (*SpellEffect) String ¶
func (spellEffect *SpellEffect) String() string
func (*SpellEffect) Validate ¶
func (spellEffect *SpellEffect) Validate()
type SpellFlag ¶
type SpellFlag uint16
Other flags
const ( SpellFlagNone SpellFlag = 0 SpellFlagIgnoreResists SpellFlag = 1 << iota // skip spell resist/armor SpellFlagCannotBeDodged // Ignores dodge in physical hit rolls SpellFlagBinary // Does not do partial resists and could need a different hit roll. SpellFlagChanneled // Spell is channeled SpellFlagIgnoreModifiers // Only used by Ignite SpellFlagMeleeMetrics // Marks a spell as a melee ability for metrics. SpellFlagNoOnCastComplete // Disables OnCastComplete callbacks. SpellFlagNoMetrics // Disables metrics for a spell. SpellFlagNoLogs // Disables logs for a spell. // Used to let agents categorize their spells. SpellFlagAgentReserved1 SpellFlagAgentReserved2 SpellFlagAgentReserved3 SpellFlagAgentReserved4 )
type SpellMetrics ¶
type SpellMetrics struct {
// Metric totals for this spell, for the current iteration.
Casts int32
Misses int32
Hits int32
Crits int32
Crushes int32
Dodges int32
Glances int32
Parries int32
Blocks int32
PartialResists_1_4 int32 // 1/4 of the spell was resisted
PartialResists_2_4 int32 // 2/4 of the spell was resisted
PartialResists_3_4 int32 // 3/4 of the spell was resisted
TotalDamage float64 // Damage done by all casts of this spell.
TotalThreat float64 // Threat generated by all casts of this spell.
}
type SpellSchool ¶
type SpellSchool byte
const ( SpellSchoolNone SpellSchool = 0 SpellSchoolPhysical SpellSchool = 1 << iota SpellSchoolArcane SpellSchoolFire SpellSchoolFrost SpellSchoolHoly SpellSchoolNature SpellSchoolShadow SpellSchoolMagic = SpellSchoolArcane | SpellSchoolFire | SpellSchoolFrost | SpellSchoolHoly | SpellSchoolNature | SpellSchoolShadow )
func SpellSchoolFromProto ¶
func SpellSchoolFromProto(p proto.SpellSchool) SpellSchool
func (SpellSchool) Matches ¶
func (ss SpellSchool) Matches(other SpellSchool) bool
Returns whether there is any overlap between the given masks.
func (SpellSchool) ResistanceStat ¶
func (ss SpellSchool) ResistanceStat() stats.Stat
func (SpellSchool) Stat ¶
func (ss SpellSchool) Stat() stats.Stat
type SplitMix64 ¶
type SplitMix64 struct {
// contains filtered or unexported fields
}
adapted from https://prng.di.unimi.it/splitmix64.c
func NewSplitMix ¶
func NewSplitMix(seed uint64) *SplitMix64
func (*SplitMix64) Next ¶
func (sm *SplitMix64) Next() uint64
func (*SplitMix64) NextFloat64 ¶
func (sm *SplitMix64) NextFloat64() float64
type StatWeightValues ¶
type StatWeightValues struct {
Weights stats.Stats
WeightsStdev stats.Stats
EpValues stats.Stats
EpValuesStdev stats.Stats
}
func (StatWeightValues) ToProto ¶
func (swv StatWeightValues) ToProto() *proto.StatWeightValues
type StatWeightsResult ¶
type StatWeightsResult struct {
Dps StatWeightValues
Tps StatWeightValues
Dtps StatWeightValues
}
func CalcStatWeight ¶
func CalcStatWeight(swr proto.StatWeightsRequest, statsToWeigh []stats.Stat, referenceStat stats.Stat, progress chan *proto.ProgressMetrics) StatWeightsResult
func (StatWeightsResult) ToProto ¶
func (swr StatWeightsResult) ToProto() *proto.StatWeightsResult
type SubGenerator ¶
type SubGenerator struct {
// contains filtered or unexported fields
}
type Target ¶
Target is an enemy/boss that can be the target of player attacks/spells.
func (*Target) AddComboPoints ¶
func (eb *Target) AddComboPoints(sim *Simulation, pointsToAdd int32, metrics *ResourceMetrics)
func (*Target) AddEnergy ¶
func (eb *Target) AddEnergy(sim *Simulation, amount float64, metrics *ResourceMetrics)
func (*Target) AddPartyBuffs ¶
func (target *Target) AddPartyBuffs(partyBuffs *proto.PartyBuffs)
func (*Target) AddRage ¶
func (rb *Target) AddRage(sim *Simulation, amount float64, metrics *ResourceMetrics)
func (*Target) AddRaidBuffs ¶
Empty Agent interface functions.
func (*Target) ApplyGearBonuses ¶
func (target *Target) ApplyGearBonuses()
func (*Target) ApplyTalents ¶
func (target *Target) ApplyTalents()
func (*Target) ComboPoints ¶
func (eb *Target) ComboPoints() int32
func (*Target) CurrentEnergy ¶
func (eb *Target) CurrentEnergy() float64
func (*Target) CurrentHealth ¶
func (hb *Target) CurrentHealth() float64
func (*Target) CurrentHealthPercent ¶
func (hb *Target) CurrentHealthPercent() float64
func (*Target) CurrentRage ¶
func (rb *Target) CurrentRage() float64
func (*Target) GainHealth ¶
func (hb *Target) GainHealth(sim *Simulation, amount float64, metrics *ResourceMetrics)
func (*Target) GetActiveAuraWithTag ¶
func (*Target) GetAurasWithTag ¶
func (*Target) GetCharacter ¶
func (*Target) GetMetricsProto ¶
func (target *Target) GetMetricsProto(numIterations int32) *proto.UnitMetrics
func (*Target) HasActiveAura ¶
func (*Target) HasActiveAuraWithTag ¶
func (*Target) HasAuraWithTag ¶
func (*Target) Initialize ¶
func (target *Target) Initialize()
func (*Target) NextEnergyTickAt ¶
func (*Target) NextTarget ¶
func (*Target) OnCastComplete ¶
func (at *Target) OnCastComplete(sim *Simulation, spell *Spell)
Invokes the OnCastComplete event for all tracked Auras.
func (*Target) OnGCDReady ¶
func (target *Target) OnGCDReady(sim *Simulation)
func (*Target) OnPeriodicDamageDealt ¶
func (at *Target) OnPeriodicDamageDealt(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
Invokes the OnPeriodicDamage
As a debuff when target is being hit by dot. As a buff when caster's dots are ticking.
func (*Target) OnPeriodicDamageTaken ¶
func (at *Target) OnPeriodicDamageTaken(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
func (*Target) OnSpellHitDealt ¶
func (at *Target) OnSpellHitDealt(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
Invokes the OnSpellHit event for all tracked Auras.
func (*Target) OnSpellHitTaken ¶
func (at *Target) OnSpellHitTaken(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
func (*Target) RegisterResetEffect ¶
func (at *Target) RegisterResetEffect(resetEffect ResetEffect)
Registers a callback to this Character which will be invoked on every Sim reset.
func (*Target) RemoveHealth ¶
func (hb *Target) RemoveHealth(sim *Simulation, amount float64)
func (*Target) Reset ¶
func (target *Target) Reset(sim *Simulation)
func (*Target) ResetEnergyTick ¶
func (eb *Target) ResetEnergyTick(sim *Simulation)
Gives an immediate partial energy tick and restarts the tick timer.
func (*Target) ShouldRefreshAuraWithTagAtPriority ¶
func (at *Target) ShouldRefreshAuraWithTagAtPriority(sim *Simulation, tag string, priority float64, refreshWindow time.Duration) bool
Returns if an aura should be refreshed at a specific priority, i.e. the aura is about to expire AND the replacement aura has at least as high priority.
This is used to decide whether to refresh effects with multiple strengths, like Thunder Clap/Deathfrost or Faerie Fire ranks.
func (*Target) SpendComboPoints ¶
func (eb *Target) SpendComboPoints(sim *Simulation, metrics *ResourceMetrics)
func (*Target) SpendEnergy ¶
func (eb *Target) SpendEnergy(sim *Simulation, amount float64, metrics *ResourceMetrics)
func (*Target) SpendRage ¶
func (rb *Target) SpendRage(sim *Simulation, amount float64, metrics *ResourceMetrics)
type TargetAI ¶
type TargetAI interface {
Initialize(*Target)
DoAction(*Simulation)
}
type TargetedActionMetrics ¶
type TargetedActionMetrics struct {
UnitIndex int32
Casts int32
Hits int32
Crits int32
Crushes int32
Misses int32
Dodges int32
Parries int32
Blocks int32
Glances int32
Damage float64
Threat float64
}
func (*TargetedActionMetrics) ToProto ¶
func (tam *TargetedActionMetrics) ToProto() *proto.TargetedActionMetrics
type TestGenerator ¶
type TestGenerator interface {
// The total number of tests that this generator can generate.
NumTests() int
// The name and API request for the test with the given index.
GetTest(testIdx int) (string, *proto.ComputeStatsRequest, *proto.StatWeightsRequest, *proto.RaidSimRequest)
}
func FullCharacterTestSuiteGenerator ¶
func FullCharacterTestSuiteGenerator(config CharacterSuiteConfig) TestGenerator
type TickEffects ¶
type TickEffects func(*Simulation, *Spell) func()
func TickFuncAOESnapshot ¶
func TickFuncAOESnapshot(env *Environment, baseEffect SpellEffect) TickEffects
func TickFuncAOESnapshotCapped ¶
func TickFuncAOESnapshotCapped(env *Environment, aoeCap float64, baseEffect SpellEffect) TickEffects
func TickFuncApplyEffects ¶
func TickFuncApplyEffects(effectsFunc ApplySpellEffects) TickEffects
func TickFuncSnapshot ¶
func TickFuncSnapshot(target *Unit, baseEffect SpellEffect) TickEffects
type Timer ¶
Stored value is the time at which the cooldown will be available again.
func (*Timer) IsReady ¶
func (timer *Timer) IsReady(sim *Simulation) bool
func (*Timer) TimeToReady ¶
func (timer *Timer) TimeToReady(sim *Simulation) time.Duration
type Unit ¶
type Unit struct {
Type UnitType
// Index of this unit with its group.
// For Players, this is the 0-indexed raid index (0-24).
// For Enemies, this is its enemy index.
// For Pets, this is the same as the owner's index.
Index int32
// Index of this unit as it appears in attack/defense tables.
// This is different from Index because there can be gaps in the raid.
TableIndex int32
// Unique label for logging.
Label string
Level int32 // Level of Unit, e.g. Bosses are lvl 73.
MobType proto.MobType
// Environment in which this Unit exists. This will be nil until after the
// construction phase.
Env *Environment
PseudoStats stats.PseudoStats
JowManaMetrics *ResourceMetrics
VtManaMetrics *ResourceMetrics
// All spells that can be cast by this unit.
Spellbook []*Spell
// AutoAttacks is the manager for auto attack swings.
// Must be enabled to use, with "EnableAutoAttacks()".
AutoAttacks AutoAttacks
// Statistics describing the results of the sim.
Metrics UnitMetrics
AttackTables []*AttackTable
DefenseTables []*AttackTable
GCD *Timer
// Used for applying the effects of hardcast / channeled spells at a later time.
// By definition there can be only 1 hardcast spell being cast at any moment.
Hardcast Hardcast
CastSpeed float64
CurrentTarget *Unit
// contains filtered or unexported fields
}
Unit is an abstraction of a Character/Boss/Pet/etc, containing functionality shared by all of them.
func (*Unit) AddComboPoints ¶
func (eb *Unit) AddComboPoints(sim *Simulation, pointsToAdd int32, metrics *ResourceMetrics)
func (*Unit) AddEnergy ¶
func (eb *Unit) AddEnergy(sim *Simulation, amount float64, metrics *ResourceMetrics)
func (*Unit) AddMana ¶
func (unit *Unit) AddMana(sim *Simulation, amount float64, metrics *ResourceMetrics, isBonusMana bool)
func (*Unit) AddMeleeHaste ¶
func (unit *Unit) AddMeleeHaste(sim *Simulation, amount float64)
func (*Unit) AddRage ¶
func (rb *Unit) AddRage(sim *Simulation, amount float64, metrics *ResourceMetrics)
func (*Unit) AddStatDynamic ¶
func (unit *Unit) AddStatDynamic(sim *Simulation, stat stats.Stat, amount float64)
func (*Unit) AddStatsDynamic ¶
func (unit *Unit) AddStatsDynamic(sim *Simulation, stat stats.Stats)
func (*Unit) CancelGCDTimer ¶
func (unit *Unit) CancelGCDTimer(sim *Simulation)
Call this to stop the GCD loop for a unit. This is mostly used for pets that get summoned / expire.
func (*Unit) ComboPoints ¶
func (eb *Unit) ComboPoints() int32
func (*Unit) CurrentEnergy ¶
func (eb *Unit) CurrentEnergy() float64
func (*Unit) CurrentHealth ¶
func (hb *Unit) CurrentHealth() float64
func (*Unit) CurrentHealthPercent ¶
func (hb *Unit) CurrentHealthPercent() float64
func (*Unit) CurrentMana ¶
func (*Unit) CurrentManaPercent ¶
func (*Unit) CurrentRage ¶
func (rb *Unit) CurrentRage() float64
func (*Unit) DoneWaitingForMana ¶
func (unit *Unit) DoneWaitingForMana(sim *Simulation) bool
Assumes that IsWaitingForMana() == true
func (*Unit) EnableAutoAttacks ¶
func (unit *Unit) EnableAutoAttacks(agent Agent, options AutoAttackOptions)
func (*Unit) EnableEnergyBar ¶
func (unit *Unit) EnableEnergyBar(maxEnergy float64, onEnergyGain OnEnergyGain)
func (*Unit) EnableHealthBar ¶
func (unit *Unit) EnableHealthBar()
func (*Unit) EnableRageBar ¶
func (unit *Unit) EnableRageBar(startingRage float64, rageMultiplier float64, onRageGain OnRageGain)
func (*Unit) FinishedWaitingForManaAndGCDReady ¶
func (unit *Unit) FinishedWaitingForManaAndGCDReady(sim *Simulation) bool
Returns true if the unit was waiting for mana but is now finished AND the GCD is also ready.
func (*Unit) GainHealth ¶
func (hb *Unit) GainHealth(sim *Simulation, amount float64, metrics *ResourceMetrics)
func (*Unit) GetActiveAuraWithTag ¶
func (*Unit) GetAurasWithTag ¶
func (*Unit) GetMetricsProto ¶
func (at *Unit) GetMetricsProto(numIterations int32) []*proto.AuraMetrics
func (*Unit) GetOrInitTimer ¶
Helper for shared timers that are not always needed, so it is only allocated if necessary.
func (*Unit) GetOrRegisterAura ¶
func (*Unit) GetOrRegisterSpell ¶
func (unit *Unit) GetOrRegisterSpell(config SpellConfig) *Spell
Retrieves an existing spell with the same ID as the config uses, or registers it if there is none.
func (*Unit) GetSpell ¶
Returns the first registered spell with the given ID, or nil if there are none.
func (*Unit) HardcastWaitUntil ¶
func (unit *Unit) HardcastWaitUntil(sim *Simulation, readyTime time.Duration, onComplete CastFunc)
func (*Unit) HasActiveAura ¶
func (*Unit) HasActiveAuraWithTag ¶
func (*Unit) HasAuraWithTag ¶
func (*Unit) HasEnergyBar ¶
func (*Unit) HasHealthBar ¶
func (*Unit) HasManaBar ¶
func (*Unit) HasRageBar ¶
func (*Unit) HasTemporaryBonusForStat ¶
Returns whether the indicates stat is currently modified by a temporary bonus.
func (*Unit) HasTemporaryMeleeSwingSpeedIncrease ¶
Returns if melee swings have any temporary increases active.
func (*Unit) HasTemporaryRangedSwingSpeedIncrease ¶
Returns if ranged swings have any temporary increases active.
func (*Unit) HasTemporarySpellCastSpeedIncrease ¶
Returns if spell casting has any temporary increases active.
func (*Unit) InitialCastSpeed ¶
func (*Unit) IsWaitingForMana ¶
func (*Unit) Log ¶
func (unit *Unit) Log(sim *Simulation, message string, vals ...interface{})
func (*Unit) MP5ManaRegenPerSecond ¶
Returns the rate of mana regen per second from mp5.
func (*Unit) ManaRegenPerSecondWhileCasting ¶
Returns the rate of mana regen per second, assuming this unit is considered to be casting.
func (*Unit) ManaRegenPerSecondWhileNotCasting ¶
Returns the rate of mana regen per second, assuming this unit is considered to be not casting.
func (*Unit) ManaTick ¶
func (unit *Unit) ManaTick(sim *Simulation)
Applies 1 'tick' of mana regen, which worth 2s of regeneration based on mp5/int/spirit/etc.
func (*Unit) MultiplyAttackSpeed ¶
func (unit *Unit) MultiplyAttackSpeed(sim *Simulation, amount float64)
Helper for when both MultiplyMeleeSpeed and MultiplyRangedSpeed are needed.
func (*Unit) MultiplyCastSpeed ¶
func (*Unit) MultiplyMeleeSpeed ¶
func (unit *Unit) MultiplyMeleeSpeed(sim *Simulation, amount float64)
MultiplyMeleeSpeed will alter the attack speed multiplier and change swing speed of all autoattack swings in progress.
func (*Unit) MultiplyRangedSpeed ¶
func (unit *Unit) MultiplyRangedSpeed(sim *Simulation, amount float64)
func (*Unit) NewComboPointMetrics ¶
func (unit *Unit) NewComboPointMetrics(actionID ActionID) *ResourceMetrics
func (*Unit) NewEnergyMetrics ¶
func (unit *Unit) NewEnergyMetrics(actionID ActionID) *ResourceMetrics
func (*Unit) NewFocusMetrics ¶
func (unit *Unit) NewFocusMetrics(actionID ActionID) *ResourceMetrics
func (*Unit) NewHealthMetrics ¶
func (unit *Unit) NewHealthMetrics(actionID ActionID) *ResourceMetrics
Convenience helpers for NewResourceMetrics.
func (*Unit) NewManaMetrics ¶
func (unit *Unit) NewManaMetrics(actionID ActionID) *ResourceMetrics
func (*Unit) NewRageMetrics ¶
func (unit *Unit) NewRageMetrics(actionID ActionID) *ResourceMetrics
func (*Unit) NextEnergyTickAt ¶
func (*Unit) OnAutoAttack ¶
func (unit *Unit) OnAutoAttack(sim *Simulation, spell *Spell)
Empty handler so Agents don't have to provide one if they have no logic to add.
func (*Unit) OnCastComplete ¶
func (at *Unit) OnCastComplete(sim *Simulation, spell *Spell)
Invokes the OnCastComplete event for all tracked Auras.
func (*Unit) OnManaTick ¶
func (unit *Unit) OnManaTick(sim *Simulation)
Empty handler so Agents don't have to provide one if they have no logic to add.
func (*Unit) OnPeriodicDamageDealt ¶
func (at *Unit) OnPeriodicDamageDealt(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
Invokes the OnPeriodicDamage
As a debuff when target is being hit by dot. As a buff when caster's dots are ticking.
func (*Unit) OnPeriodicDamageTaken ¶
func (at *Unit) OnPeriodicDamageTaken(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
func (*Unit) OnSpellHitDealt ¶
func (at *Unit) OnSpellHitDealt(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
Invokes the OnSpellHit event for all tracked Auras.
func (*Unit) OnSpellHitTaken ¶
func (at *Unit) OnSpellHitTaken(sim *Simulation, spell *Spell, spellEffect *SpellEffect)
func (*Unit) OutcomeFuncAlwaysHit ¶
func (unit *Unit) OutcomeFuncAlwaysHit() OutcomeApplier
func (*Unit) OutcomeFuncCritFixedChance ¶
func (unit *Unit) OutcomeFuncCritFixedChance(critChance float64, critMultiplier float64) OutcomeApplier
func (*Unit) OutcomeFuncEnemyMeleeWhite ¶
func (unit *Unit) OutcomeFuncEnemyMeleeWhite() OutcomeApplier
func (*Unit) OutcomeFuncMagicCrit ¶
func (unit *Unit) OutcomeFuncMagicCrit(critMultiplier float64) OutcomeApplier
func (*Unit) OutcomeFuncMagicHit ¶
func (unit *Unit) OutcomeFuncMagicHit() OutcomeApplier
func (*Unit) OutcomeFuncMagicHitAndCrit ¶
func (unit *Unit) OutcomeFuncMagicHitAndCrit(critMultiplier float64) OutcomeApplier
func (*Unit) OutcomeFuncMagicHitAndCritBinary ¶
func (unit *Unit) OutcomeFuncMagicHitAndCritBinary(critMultiplier float64) OutcomeApplier
func (*Unit) OutcomeFuncMagicHitBinary ¶
func (unit *Unit) OutcomeFuncMagicHitBinary() OutcomeApplier
func (*Unit) OutcomeFuncMeleeSpecialCritOnly ¶
func (unit *Unit) OutcomeFuncMeleeSpecialCritOnly(critMultiplier float64) OutcomeApplier
func (*Unit) OutcomeFuncMeleeSpecialHit ¶
func (unit *Unit) OutcomeFuncMeleeSpecialHit() OutcomeApplier
func (*Unit) OutcomeFuncMeleeSpecialHitAndCrit ¶
func (unit *Unit) OutcomeFuncMeleeSpecialHitAndCrit(critMultiplier float64) OutcomeApplier
func (*Unit) OutcomeFuncMeleeSpecialNoBlockDodgeParry ¶
func (unit *Unit) OutcomeFuncMeleeSpecialNoBlockDodgeParry(critMultiplier float64) OutcomeApplier
func (*Unit) OutcomeFuncMeleeWeaponSpecialHitAndCrit ¶
func (unit *Unit) OutcomeFuncMeleeWeaponSpecialHitAndCrit(critMultiplier float64) OutcomeApplier
Like OutcomeFuncMeleeSpecialHitAndCrit, but blocks prevent crits.
func (*Unit) OutcomeFuncMeleeWhite ¶
func (unit *Unit) OutcomeFuncMeleeWhite(critMultiplier float64) OutcomeApplier
func (*Unit) OutcomeFuncRangedHit ¶
func (unit *Unit) OutcomeFuncRangedHit() OutcomeApplier
func (*Unit) OutcomeFuncRangedHitAndCrit ¶
func (unit *Unit) OutcomeFuncRangedHitAndCrit(critMultiplier float64) OutcomeApplier
func (*Unit) OutcomeFuncTick ¶
func (unit *Unit) OutcomeFuncTick() OutcomeApplier
A tick always hits, but we don't count them as hits in the metrics.
func (*Unit) RangedSwingSpeed ¶
func (*Unit) RegisterAura ¶
func (*Unit) RegisterResetEffect ¶
func (at *Unit) RegisterResetEffect(resetEffect ResetEffect)
Registers a callback to this Character which will be invoked on every Sim reset.
func (*Unit) RegisterSpell ¶
func (unit *Unit) RegisterSpell(config SpellConfig) *Spell
Registers a new spell to the unit. Returns the newly created spell.
func (*Unit) RemoveHealth ¶
func (hb *Unit) RemoveHealth(sim *Simulation, amount float64)
func (*Unit) ResetEnergyTick ¶
func (eb *Unit) ResetEnergyTick(sim *Simulation)
Gives an immediate partial energy tick and restarts the tick timer.
func (*Unit) SetGCDTimer ¶
func (unit *Unit) SetGCDTimer(sim *Simulation, gcdReadyAt time.Duration)
func (*Unit) ShouldRefreshAuraWithTagAtPriority ¶
func (at *Unit) ShouldRefreshAuraWithTagAtPriority(sim *Simulation, tag string, priority float64, refreshWindow time.Duration) bool
Returns if an aura should be refreshed at a specific priority, i.e. the aura is about to expire AND the replacement aura has at least as high priority.
This is used to decide whether to refresh effects with multiple strengths, like Thunder Clap/Deathfrost or Faerie Fire ranks.
func (*Unit) SpendComboPoints ¶
func (eb *Unit) SpendComboPoints(sim *Simulation, metrics *ResourceMetrics)
func (*Unit) SpendEnergy ¶
func (eb *Unit) SpendEnergy(sim *Simulation, amount float64, metrics *ResourceMetrics)
func (*Unit) SpendMana ¶
func (unit *Unit) SpendMana(sim *Simulation, amount float64, metrics *ResourceMetrics)
func (*Unit) SpendRage ¶
func (rb *Unit) SpendRage(sim *Simulation, amount float64, metrics *ResourceMetrics)
func (*Unit) SpiritManaRegenPerSecond ¶
Returns the rate of mana regen per second from spirit.
func (*Unit) SwingSpeed ¶
func (*Unit) TimeUntilManaRegen ¶
Returns the amount of time this Unit would need to wait in order to reach the desired amount of mana, via mana regen.
Assumes that desiredMana > currentMana. Calculation assumes the Unit will not take any actions during this period that would reset the 5-second rule.
func (*Unit) UpdateManaRegenRates ¶
func (unit *Unit) UpdateManaRegenRates()
func (*Unit) WaitForMana ¶
func (unit *Unit) WaitForMana(sim *Simulation, desiredMana float64)
type UnitMetrics ¶
type UnitMetrics struct {
CharacterIterationMetrics
// contains filtered or unexported fields
}
func NewUnitMetrics ¶
func NewUnitMetrics() UnitMetrics
func (*UnitMetrics) AddFinalPetMetrics ¶
func (unitMetrics *UnitMetrics) AddFinalPetMetrics(petMetrics *UnitMetrics)
This should be called at the end of each iteration, to include metrics from Pets in those of their owner. Assumes that doneIteration() has already been called on the pet metrics.
func (*UnitMetrics) MarkOOM ¶
func (unitMetrics *UnitMetrics) MarkOOM(unit *Unit, dur time.Duration)
func (*UnitMetrics) NewResourceMetrics ¶
func (unitMetrics *UnitMetrics) NewResourceMetrics(actionID ActionID, resourceType proto.ResourceType) *ResourceMetrics
func (*UnitMetrics) ToProto ¶
func (unitMetrics *UnitMetrics) ToProto(numIterations int32) *proto.UnitMetrics
type Weapon ¶
type Weapon struct {
BaseDamageMin float64
BaseDamageMax float64
SwingSpeed float64
NormalizedSwingSpeed float64
SwingDuration time.Duration // Duration between 2 swings.
CritMultiplier float64
SpellSchool SpellSchool
}
Represents a generic weapon. Pets / unarmed / various other cases dont use actual weapon items so this is an abstraction of a Weapon.
func (Weapon) AverageDamage ¶
func (Weapon) BaseDamage ¶
func (weapon Weapon) BaseDamage(sim *Simulation) float64
func (Weapon) CalculateAverageWeaponDamage ¶
func (Weapon) CalculateNormalizedWeaponDamage ¶
func (weapon Weapon) CalculateNormalizedWeaponDamage(sim *Simulation, attackPower float64) float64
func (Weapon) CalculateWeaponDamage ¶
func (weapon Weapon) CalculateWeaponDamage(sim *Simulation, attackPower float64) float64
func (Weapon) EnemyWeaponDamage ¶
func (weapon Weapon) EnemyWeaponDamage(sim *Simulation, attackPower float64) float64
func (Weapon) GetSpellSchool ¶
func (weapon Weapon) GetSpellSchool() SpellSchool
Source Files
¶
- agent.go
- api.go
- attack.go
- aura.go
- buffs.go
- cast.go
- character.go
- constants.go
- consumes.go
- cooldown.go
- debuffs.go
- dot.go
- energy.go
- environment.go
- flags.go
- gcd.go
- health.go
- item_effects.go
- item_sets.go
- major_cooldown.go
- mana.go
- metrics_aggregator.go
- pending_action.go
- periodic_action.go
- pet.go
- pets.go
- presim.go
- racials.go
- rage.go
- raid.go
- rand.go
- sim.go
- spell.go
- spell_damage.go
- spell_effect.go
- spell_outcome.go
- spell_resistances.go
- statweight.go
- target.go
- target_ai.go
- test_generators.go
- test_suite.go
- test_utils.go
- unit.go
- utils.go