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 ApplyFixedUptimeAura(aura *Aura, uptime float64, tickLength time.Duration)
- func ApplyInspiration(character *Character, uptime float64)
- func ApplyPetConsumeEffects(pet *Character, ownerConsumes *proto.Consumes)
- func BlessingOfSanctuaryAura(character *Character)
- 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 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 GetPrimaryTalentTreeIndex(talentStr string) uint8
- 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 HasItemEffectForTest(id int32) bool
- func HasWeaponEffect(id int32) bool
- func InitReplenishmentAuras(character *Character, actionID ActionID)
- func InnervateManaThreshold(character *Character) float64
- 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 NewSimpleStatDefensiveTrinketEffect(itemID int32, bonus stats.Stats, duration time.Duration, ...)
- func NewSimpleStatItemActiveEffect(itemID int32, bonus stats.Stats, duration time.Duration, ...)
- func NewSimpleStatItemEffect(itemID int32, bonus stats.Stats, duration time.Duration, ...)
- func NewSimpleStatOffensiveTrinketEffect(itemID int32, bonus stats.Stats, duration time.Duration, ...)
- func PlayerProtoToSpec(player *proto.Player) proto.Spec
- func RaidBenchmark(b *testing.B, rsr *proto.RaidSimRequest)
- func RaidPlayersWithClass(raid *proto.Raid, class proto.Class) []*proto.Player
- 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 ResetRunes(runeMeta *RuneMeta)
- 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 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 Ternary[T any](condition bool, val1 T, val2 T) T
- 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
- func WithinToleranceFloat64(expectedValue float64, actualValue float64, tolerance float64) bool
- 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 AfterCast
- type Agent
- type AgentFactory
- type ApplyEffect
- type ApplySpellResults
- type ApplyWeaponEffect
- type AttackTable
- type Aura
- func AcidSpitAura(target *Unit, startingStacks int32) *Aura
- func BloodFrenzyAura(target *Unit, points int32) *Aura
- func BloodlustAura(character *Character, actionTag int32) *Aura
- func CryptFeverAura(target *Unit, dkIndex int) *Aura
- func CurseOfElementsAura(target *Unit) *Aura
- func CurseOfWeaknessAura(target *Unit, points int32) *Aura
- func DemonicPactAura(character *Character, spellPowerBonus float64) *Aura
- func DemoralizingRoarAura(target *Unit, points int32) *Aura
- func DemoralizingShoutAura(target *Unit, boomingVoicePts int32, impDemoShoutPts int32) *Aura
- func EarthAndMoonAura(target *Unit) *Aura
- func EbonPlaguebringerAura(target *Unit, dkIndex int) *Aura
- func ExposeArmorAura(target *Unit, hasGlyph bool) *Aura
- func FaerieFireAura(target *Unit, imp bool) *Aura
- func FlametongueTotemAura(character *Character) *Aura
- func FrostFeverAura(target *Unit, impIcyTouch int32) *Aura
- func GiftOfArthasAura(target *Unit) *Aura
- func HeartoftheCrusaderDebuff(target *Unit, points float64) *Aura
- func HuntersMarkAura(target *Unit, points int32, glyphed bool) *Aura
- func ImprovedScorchAura(target *Unit) *Aura
- func InfectedWoundsAura(target *Unit, points int32) *Aura
- func InnervateAura(character *Character, expectedBonusManaReduction float64, actionTag int32) *Aura
- func InsectSwarmAura(target *Unit) *Aura
- func InspirationAura(unit *Unit, points int32) *Aura
- func JudgementOfLightAura(target *Unit) *Aura
- func JudgementOfWisdomAura(target *Unit) *Aura
- func JudgementsOfTheJustAura(target *Unit, points int32) *Aura
- func MakePermanent(aura *Aura) *Aura
- func ManaTideTotemAura(character *Character, actionTag int32) *Aura
- func MangleAura(target *Unit) *Aura
- func MarkOfBloodAura(target *Unit) *Aura
- func MasterPoisonerDebuff(target *Unit, points float64) *Aura
- func MiseryAura(target *Unit) *Aura
- func PowerInfusionAura(character *Character, actionTag int32) *Aura
- func ReplenishmentAura(unit *Unit, actionID ActionID) *Aura
- func RetributionAura(character *Character, sanctifiedRetribution bool) *Aura
- func RuneOfRazoriceVulnerabilityAura(target *Unit) *Aura
- func SavageCombatAura(target *Unit, points int32) *Aura
- func ScheduledAura(aura *Aura, preActivate bool, options PeriodicActionOptions) *Aura
- func ScorpidStingAura(target *Unit) *Aura
- func ScreechAura(target *Unit) *Aura
- func ShadowMasteryAura(target *Unit) *Aura
- func ShatteringThrowAura(target *Unit) *Aura
- func SporeCloudAura(target *Unit) *Aura
- func StampedeAura(target *Unit) *Aura
- func StingAura(target *Unit) *Aura
- func SunderArmorAura(target *Unit, startingStacks int32) *Aura
- func ThornsAura(character *Character, points int32) *Aura
- func ThunderClapAura(target *Unit, points int32) *Aura
- func TotemOfWrathAura(character *Character) *Aura
- func TotemOfWrathDebuff(target *Unit) *Aura
- func TraumaAura(target *Unit, points int) *Aura
- func TricksOfTheTradeAura(character *Character, actionTag int32) *Aura
- func UnholyFrenzyAura(character *Character, actionTag int32) *Aura
- func VindicationAura(target *Unit) *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) StartedAt() time.Duration
- func (aura *Aura) UpdateExpires(newExpires time.Duration)
- type AuraFactory
- type AuraMetrics
- type AutoAttackOptions
- type AutoAttacks
- func (aa *AutoAttacks) CancelAutoSwing(sim *Simulation)
- func (aa *AutoAttacks) DelayMainhandMeleeUntil(sim *Simulation, readyAt time.Duration)
- func (aa *AutoAttacks) DelayMeleeUntil(sim *Simulation, readyAt time.Duration)
- func (aa *AutoAttacks) DelayOffhandMeleeUntil(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) 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) RangedSwingSpeed() time.Duration
- func (aa *AutoAttacks) SwingMelee(sim *Simulation, target *Unit)
- func (aa *AutoAttacks) SwingRanged(sim *Simulation, target *Unit)
- func (aa *AutoAttacks) TrySwingMH(sim *Simulation, target *Unit)
- func (aa *AutoAttacks) TrySwingOH(sim *Simulation, target *Unit)
- func (aa *AutoAttacks) TrySwingRanged(sim *Simulation, target *Unit)
- func (aa *AutoAttacks) UpdateSwingTime(sim *Simulation)
- 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 (at *Character) AfterCast(sim *Simulation, spell *Spell)
- func (character *Character) ApplyGearBonuses()
- 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) DefaultHealingCritMultiplier() float64
- func (character *Character) DefaultMeleeCritMultiplier() float64
- func (character *Character) DefaultSpellCritMultiplier() float64
- func (mcdm *Character) DelayDPSCooldownsForArmorDebuffs(delay time.Duration)
- func (mcdm *Character) DisableAllEnabledCooldowns(cooldownType CooldownType) []*MajorCooldown
- func (mcdm *Character) DisableMajorCooldown(actionID ActionID)
- func (character *Character) DoNothing()
- func (mcdm *Character) EnableAllCooldowns(mcdsToEnable []*MajorCooldown)
- func (mcdm *Character) EnableMajorCooldown(actionID ActionID)
- func (character *Character) EnableManaBar()
- func (character *Character) EnableManaBarWithModifier(modifier float64)
- func (character *Character) EnableResumeAfterManaWait(callback func(sim *Simulation))
- 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) HasActiveAuraWithTagExcludingAura(tag string, excludeAura *Aura) bool
- func (character *Character) HasAlchStone() bool
- func (at *Character) HasAura(label string) bool
- func (at *Character) HasAuraWithTag(tag string) bool
- func (character *Character) HasGlyph(glyphID int32) 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) HasProfession(prof proto.Profession) bool
- func (character *Character) HasRangedWeapon() bool
- func (character *Character) HasRingEquipped(itemID int32) bool
- func (character *Character) HasSetBonus(itemSet *ItemSet, numItems int32) bool
- func (character *Character) HasTrinketEquipped(itemID int32) bool
- func (character *Character) HealingCritMultiplier(primaryModifiers float64, secondaryModifiers float64) float64
- func (hb *Character) MaxHealth() float64
- func (character *Character) MeleeCritMultiplier(primaryModifiers float64, secondaryModifiers float64) float64
- func (character *Character) MultiplyAttackSpeed(sim *Simulation, amount float64)
- func (character *Character) MultiplyMeleeSpeed(sim *Simulation, amount float64)
- func (character *Character) MultiplyRangedSpeed(sim *Simulation, amount float64)
- func (character *Character) NewTemporaryStatsAura(auraLabel string, actionID ActionID, tempStats stats.Stats, ...) *Aura
- func (character *Character) NewTemporaryStatsAuraWrapped(auraLabel string, actionID ActionID, buffs stats.Stats, duration time.Duration, ...) *Aura
- func (eb *Character) NextEnergyTickAt() time.Duration
- func (at *Character) NumActiveAurasWithTag(tag string) int32
- func (at *Character) OnCastComplete(sim *Simulation, spell *Spell)
- func (at *Character) OnHealDealt(sim *Simulation, spell *Spell, result *SpellResult)
- func (at *Character) OnHealTaken(sim *Simulation, spell *Spell, result *SpellResult)
- func (at *Character) OnPeriodicDamageDealt(sim *Simulation, spell *Spell, result *SpellResult)
- func (at *Character) OnPeriodicDamageTaken(sim *Simulation, spell *Spell, result *SpellResult)
- func (at *Character) OnPeriodicHealDealt(sim *Simulation, spell *Spell, result *SpellResult)
- func (at *Character) OnPeriodicHealTaken(sim *Simulation, spell *Spell, result *SpellResult)
- func (at *Character) OnSpellHitDealt(sim *Simulation, spell *Spell, result *SpellResult)
- func (at *Character) OnSpellHitTaken(sim *Simulation, spell *Spell, result *SpellResult)
- 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 (character *Character) StatProcWithICD(auraLabel string, actionID ActionID, tempStats stats.Stats, ...)
- 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 DelayedActionOptions
- type DistributionMetrics
- type Dot
- func (dot *Dot) Apply(sim *Simulation)
- func (dot *Dot) CalcAndDealPeriodicSnapshotDamage(sim *Simulation, target *Unit, outcomeApplier OutcomeApplier) *SpellResult
- func (dot *Dot) CalcAndDealPeriodicSnapshotHealing(sim *Simulation, target *Unit, outcomeApplier OutcomeApplier) *SpellResult
- func (dot *Dot) CalcSnapshotDamage(sim *Simulation, target *Unit, outcomeApplier OutcomeApplier) *SpellResult
- func (dot *Dot) CalcSnapshotHealing(sim *Simulation, target *Unit, outcomeApplier OutcomeApplier) *SpellResult
- func (dot *Dot) Cancel(sim *Simulation)
- func (dot *Dot) OutcomeMagicHitAndSnapshotCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)
- func (dot *Dot) OutcomeRangedHitAndCritSnapshot(sim *Simulation, result *SpellResult, attackTable *AttackTable)
- func (dot *Dot) OutcomeSnapshotCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)
- func (dot *Dot) OutcomeTick(sim *Simulation, result *SpellResult, attackTable *AttackTable)
- func (dot *Dot) OutcomeTickPhysicalCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)
- func (dot *Dot) RecomputeAuraDuration()
- func (dot *Dot) Rollover(sim *Simulation)
- func (dot *Dot) TakeSnapshot(sim *Simulation, doRollover bool)
- func (dot *Dot) TickOnce(sim *Simulation)
- type DynamicDamageTakenModifier
- 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 ExpectedDamageCalculator
- type GearSetCombo
- type GoRand
- type Hand
- type Hardcast
- type HitOutcome
- type IndividualTestSuite
- func (testSuite *IndividualTestSuite) Done(t *testing.T)
- func (testSuite *IndividualTestSuite) TestCasts(testName string, rsr *proto.RaidSimRequest)
- 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 OnManaTick
- type OnPeriodicDamage
- type OnPetDisable
- type OnPetEnable
- type OnRageGain
- type OnReset
- type OnRune
- type OnRunicPowerGain
- type OnSnapshot
- type OnSpellHit
- type OnStacksChange
- type OnStatsChange
- type OnTick
- 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
- func NewDelayedAction(sim *Simulation, options DelayedActionOptions) *PendingAction
- func NewPeriodicAction(sim *Simulation, options PeriodicActionOptions) *PendingAction
- func StartDelayedAction(sim *Simulation, options DelayedActionOptions) *PendingAction
- func StartPeriodicAction(sim *Simulation, options PeriodicActionOptions) *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 (at *Pet) AfterCast(sim *Simulation, spell *Spell)
- 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(delay time.Duration)
- 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) HasActiveAuraWithTagExcludingAura(tag string, excludeAura *Aura) 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 (pet *Pet) IsGuardian() bool
- func (hb *Pet) MaxHealth() float64
- func (eb *Pet) NextEnergyTickAt() time.Duration
- func (at *Pet) NumActiveAurasWithTag(tag string) int32
- func (at *Pet) OnCastComplete(sim *Simulation, spell *Spell)
- func (at *Pet) OnHealDealt(sim *Simulation, spell *Spell, result *SpellResult)
- func (at *Pet) OnHealTaken(sim *Simulation, spell *Spell, result *SpellResult)
- func (at *Pet) OnPeriodicDamageDealt(sim *Simulation, spell *Spell, result *SpellResult)
- func (at *Pet) OnPeriodicDamageTaken(sim *Simulation, spell *Spell, result *SpellResult)
- func (at *Pet) OnPeriodicHealDealt(sim *Simulation, spell *Spell, result *SpellResult)
- func (at *Pet) OnPeriodicHealTaken(sim *Simulation, spell *Spell, result *SpellResult)
- func (at *Pet) OnSpellHitDealt(sim *Simulation, spell *Spell, result *SpellResult)
- func (at *Pet) OnSpellHitTaken(sim *Simulation, spell *Spell, result *SpellResult)
- func (pet *Pet) OwnerAttackSpeedChanged(sim *Simulation)
- 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 PowerBarType
- type PresetTarget
- type PresimOptions
- type Presimmer
- type ProcMask
- type RageBarOptions
- type Raid
- func (raid Raid) AddStats(s stats.Stats)
- func (raid *Raid) GetFirstEmptyRaidIndex() (*Party, int)
- func (raid Raid) GetFirstNPlayersOrPets(n int32) []*Unit
- func (raid *Raid) GetFirstTargetDummy() *TargetDummy
- 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) GetPlayerFromUnitIndex(unitIndex int32) Agent
- func (raid Raid) GetPlayersOfClass(class proto.Class) []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 RotationCastsTestGenerator
- type RuneCost
- type RuneKind
- type RuneMeta
- type RunicPowerBar
- func (rp *RunicPowerBar) AddRunicPower(sim *Simulation, amount float64, metrics *ResourceMetrics)
- func (rp *RunicPowerBar) Advance(sim *Simulation, newTime time.Duration)
- func (rp *RunicPowerBar) AllBloodRunesSpent() bool
- func (rp *RunicPowerBar) AllFrostSpent() bool
- func (rp *RunicPowerBar) AllRunesSpent() bool
- func (rp *RunicPowerBar) AllUnholySpent() bool
- func (rp *RunicPowerBar) AnyRuneReadyAt(sim *Simulation) time.Duration
- func (rp *RunicPowerBar) AnySpentRuneReadyAt() time.Duration
- func (rp *RunicPowerBar) BloodRuneGainMetrics() *ResourceMetrics
- func (rp *RunicPowerBar) BloodRuneReadyAt(sim *Simulation) time.Duration
- func (rp *RunicPowerBar) BloodRuneSpentAt(dur time.Duration) int32
- func (rp *RunicPowerBar) CancelBloodTap(sim *Simulation)
- func (rp *RunicPowerBar) CastCostPossible(sim *Simulation, runicPowerAmount float64, bloodAmount int8, frostAmount int8, ...) bool
- func (rp *RunicPowerBar) ConvertFromDeath(sim *Simulation, slot int8)
- func (rp *RunicPowerBar) ConvertToDeath(sim *Simulation, slot int8, revertOnSpend bool, revertAt time.Duration)
- func (rp *RunicPowerBar) CopyRunicPowerBar() *RunicPowerBar
- func (rp *RunicPowerBar) CorrectBloodTapConversion(sim *Simulation, bloodGainMetrics *ResourceMetrics, ...)
- func (rp *RunicPowerBar) CurrentBloodRuneGrace(sim *Simulation) time.Duration
- func (rp *RunicPowerBar) CurrentBloodRunes() int8
- func (rp *RunicPowerBar) CurrentDeathRunes() int8
- func (rp *RunicPowerBar) CurrentFrostRuneGrace(sim *Simulation) time.Duration
- func (rp *RunicPowerBar) CurrentFrostRunes() int8
- func (rp *RunicPowerBar) CurrentRuneGrace(sim *Simulation, slot int32) time.Duration
- func (rp *RunicPowerBar) CurrentRuneGraces(sim *Simulation) (time.Duration, time.Duration, time.Duration)
- func (rp *RunicPowerBar) CurrentRunicPower() float64
- func (rp *RunicPowerBar) CurrentUnholyRuneGrace(sim *Simulation) time.Duration
- func (rp *RunicPowerBar) CurrentUnholyRunes() int8
- func (rp *RunicPowerBar) DeathRuneGainMetrics() *ResourceMetrics
- func (rp *RunicPowerBar) DeathRuneRegenAt(slot int32) time.Duration
- func (rp *RunicPowerBar) DeathRuneRevertAt() time.Duration
- func (rp *RunicPowerBar) DeathRunesInFU() int8
- func (rp *RunicPowerBar) DebugString() string
- func (rp *RunicPowerBar) FrostRuneGainMetrics() *ResourceMetrics
- func (rp *RunicPowerBar) FrostRuneReadyAt(sim *Simulation) time.Duration
- func (rp *RunicPowerBar) FrostRuneSpentAt(dur time.Duration) int32
- func (rp *RunicPowerBar) GainDeathRuneMetrics(sim *Simulation, spell *Spell, currRunes int32, newRunes int32)
- func (rp *RunicPowerBar) GainRuneMetrics(sim *Simulation, metrics *ResourceMetrics, gainAmount int8)
- func (rp *RunicPowerBar) LaunchRuneRegen(sim *Simulation, slot int8)
- func (rp *RunicPowerBar) LeftBloodRuneReady() bool
- func (rp *RunicPowerBar) MaxRunicPower() float64
- func (rp *RunicPowerBar) NormalCurrentBloodRunes() int32
- func (rp *RunicPowerBar) NormalCurrentFrostRunes() int32
- func (rp *RunicPowerBar) NormalCurrentRunes() (int32, int32, int32)
- func (rp *RunicPowerBar) NormalCurrentUnholyRunes() int32
- func (rp *RunicPowerBar) NormalFrostRuneReadyAt(sim *Simulation) time.Duration
- func (rp *RunicPowerBar) NormalSpentBloodRuneReadyAt(sim *Simulation) time.Duration
- func (rp *RunicPowerBar) NormalSpentFrostRuneReadyAt(sim *Simulation) time.Duration
- func (rp *RunicPowerBar) NormalSpentUnholyRuneReadyAt(sim *Simulation) time.Duration
- func (rp *RunicPowerBar) NormalUnholyRuneReadyAt(sim *Simulation) time.Duration
- func (rp *RunicPowerBar) OptimalRuneCost(cost RuneCost) RuneCost
- func (rp *RunicPowerBar) PercentRunicPower() float64
- func (rp *RunicPowerBar) Print()
- func (rp *RunicPowerBar) ReadyDeathRune() int8
- func (rp *RunicPowerBar) RegenAllRunes(sim *Simulation)
- func (rp *RunicPowerBar) RegenRune(regenAt time.Duration, slot int32)
- func (rp *RunicPowerBar) RightBloodRuneReady() bool
- func (rp *RunicPowerBar) RuneIsDeath(slot int8) bool
- func (rp *RunicPowerBar) SetRuneCd(runeCd time.Duration)
- func (rp *RunicPowerBar) SpendBloodRune(sim *Simulation, metrics *ResourceMetrics) int8
- func (rp *RunicPowerBar) SpendDeathRune(sim *Simulation, metrics *ResourceMetrics) int8
- func (rp *RunicPowerBar) SpendFrostRune(sim *Simulation, metrics *ResourceMetrics) int8
- func (rp *RunicPowerBar) SpendRuneCost(sim *Simulation, spell *Spell, cost RuneCost) (int8, int8, int8)
- func (rp *RunicPowerBar) SpendRuneFromKind(sim *Simulation, rkind RuneKind) int8
- func (rp *RunicPowerBar) SpendRuneMetrics(sim *Simulation, metrics *ResourceMetrics, spendAmount int8)
- func (rp *RunicPowerBar) SpendUnholyRune(sim *Simulation, metrics *ResourceMetrics) int8
- func (rp *RunicPowerBar) SpentBloodRuneReadyAt() time.Duration
- func (rp *RunicPowerBar) SpentDeathRuneReadyAt() time.Duration
- func (rp *RunicPowerBar) SpentFrostRuneReadyAt() time.Duration
- func (rp *RunicPowerBar) SpentUnholyRuneReadyAt() time.Duration
- func (rp *RunicPowerBar) TryRegenRune(sim *Simulation, newTime time.Duration, slot int32)
- func (rp *RunicPowerBar) UnholyRuneGainMetrics() *ResourceMetrics
- func (rp *RunicPowerBar) UnholyRuneReadyAt(sim *Simulation) time.Duration
- func (rp *RunicPowerBar) UnholyRuneSpentAt(dur time.Duration) int32
- type SettingsCombos
- type Shield
- type Simulation
- func (sim *Simulation) AddPendingAction(pa *PendingAction)
- func (sim *Simulation) GetRemainingDuration() time.Duration
- func (sim *Simulation) GetRemainingDurationPercent() float64
- func (sim *Simulation) IsExecutePhase20() bool
- func (sim *Simulation) IsExecutePhase25() bool
- func (sim *Simulation) IsExecutePhase35() bool
- func (sim *Simulation) Proc(p float64, label string) bool
- func (sim *Simulation) RandomFloat(label string) float64
- func (sim *Simulation) RegisterExecutePhaseCallback(callback func(*Simulation, int))
- func (sim *Simulation) Reset()
- func (sim *Simulation) Roll(min float64, max float64) float64
- 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) ApplyPostOutcomeDamageModifiers(sim *Simulation, result *SpellResult)
- func (spell *Spell) AttackerDamageMultiplier(attackTable *AttackTable) float64
- func (spell *Spell) BloodRuneMetrics() *ResourceMetrics
- func (spell *Spell) BonusWeaponDamage() float64
- func (spell *Spell) CalcAndDealDamage(sim *Simulation, target *Unit, baseDamage float64, ...) *SpellResult
- func (spell *Spell) CalcAndDealHealing(sim *Simulation, target *Unit, baseHealing float64, ...) *SpellResult
- func (spell *Spell) CalcAndDealOutcome(sim *Simulation, target *Unit, outcomeApplier OutcomeApplier) *SpellResult
- func (spell *Spell) CalcAndDealPeriodicDamage(sim *Simulation, target *Unit, baseDamage float64, ...) *SpellResult
- func (spell *Spell) CalcAndDealPeriodicHealing(sim *Simulation, target *Unit, baseHealing float64, ...) *SpellResult
- func (spell *Spell) CalcDamage(sim *Simulation, target *Unit, baseDamage float64, ...) *SpellResult
- func (spell *Spell) CalcHealing(sim *Simulation, target *Unit, baseHealing float64, ...) *SpellResult
- func (spell *Spell) CalcOutcome(sim *Simulation, target *Unit, outcomeApplier OutcomeApplier) *SpellResult
- func (spell *Spell) CalcPeriodicDamage(sim *Simulation, target *Unit, baseDamage float64, ...) *SpellResult
- func (spell *Spell) Cast(sim *Simulation, target *Unit) bool
- func (spell *Spell) CasterHealingMultiplier() float64
- func (spell *Spell) ComboPointMetrics() *ResourceMetrics
- func (spell *Spell) CurDamagePerCast() float64
- func (spell *Spell) DealDamage(sim *Simulation, result *SpellResult)
- func (spell *Spell) DealHealing(sim *Simulation, result *SpellResult)
- func (spell *Spell) DealOutcome(sim *Simulation, result *SpellResult)
- func (spell *Spell) DealPeriodicDamage(sim *Simulation, result *SpellResult)
- func (spell *Spell) DealPeriodicHealing(sim *Simulation, result *SpellResult)
- func (spell *Spell) DeathRuneMetrics() *ResourceMetrics
- func (spell *Spell) DisposeResult(result *SpellResult)
- func (spell *Spell) ExpectedDamage(sim *Simulation, target *Unit) float64
- func (spell *Spell) ExpertisePercentage() float64
- func (spell *Spell) FrostRuneMetrics() *ResourceMetrics
- func (spell *Spell) HealingCritChance() float64
- func (spell *Spell) HealingCritCheck(sim *Simulation) bool
- func (spell *Spell) HealingPower() float64
- func (spell *Spell) HealthMetrics(target *Unit) *ResourceMetrics
- func (spell *Spell) IsMH() bool
- func (spell *Spell) IsMelee() bool
- func (spell *Spell) IsOH() bool
- func (spell *Spell) IsReady(sim *Simulation) bool
- func (spell *Spell) MagicCritCheck(sim *Simulation, target *Unit) bool
- func (spell *Spell) MagicHitCheck(sim *Simulation, attackTable *AttackTable) bool
- func (spell *Spell) MeleeAttackPower() float64
- func (spell *Spell) NewResult(target *Unit) *SpellResult
- func (spell *Spell) OutcomeAlwaysHit(_ *Simulation, result *SpellResult, _ *AttackTable)
- func (spell *Spell) OutcomeAlwaysMiss(_ *Simulation, result *SpellResult, _ *AttackTable)
- func (spell *Spell) OutcomeCritFixedChance(critChance float64) OutcomeApplier
- func (spell *Spell) OutcomeEnemyMeleeWhite(sim *Simulation, result *SpellResult, attackTable *AttackTable)
- func (spell *Spell) OutcomeExpectedMagicAlwaysHit(sim *Simulation, result *SpellResult, attackTable *AttackTable)
- func (spell *Spell) OutcomeExpectedMagicCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)
- func (spell *Spell) OutcomeExpectedMagicHit(sim *Simulation, result *SpellResult, attackTable *AttackTable)
- func (spell *Spell) OutcomeExpectedMagicHitAndCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)
- func (spell *Spell) OutcomeExpectedTick(sim *Simulation, result *SpellResult, attackTable *AttackTable)
- func (spell *Spell) OutcomeHealingCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)
- func (spell *Spell) OutcomeMagicCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)
- func (spell *Spell) OutcomeMagicHit(sim *Simulation, result *SpellResult, attackTable *AttackTable)
- func (spell *Spell) OutcomeMagicHitAndCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)
- func (spell *Spell) OutcomeMeleeSpecialCritOnly(sim *Simulation, result *SpellResult, attackTable *AttackTable)
- func (spell *Spell) OutcomeMeleeSpecialHit(sim *Simulation, result *SpellResult, attackTable *AttackTable)
- func (spell *Spell) OutcomeMeleeSpecialHitAndCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)
- func (spell *Spell) OutcomeMeleeSpecialNoBlockDodgeParry(sim *Simulation, result *SpellResult, attackTable *AttackTable)
- func (spell *Spell) OutcomeMeleeSpecialNoBlockDodgeParryNoCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)
- func (spell *Spell) OutcomeMeleeWeaponSpecialHitAndCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)
- func (spell *Spell) OutcomeMeleeWeaponSpecialNoCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)
- func (spell *Spell) OutcomeMeleeWhite(sim *Simulation, result *SpellResult, attackTable *AttackTable)
- func (spell *Spell) OutcomeRangedCritOnly(sim *Simulation, result *SpellResult, attackTable *AttackTable)
- func (spell *Spell) OutcomeRangedHit(sim *Simulation, result *SpellResult, attackTable *AttackTable)
- func (spell *Spell) OutcomeRangedHitAndCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)
- func (spell *Spell) OutcomeTickMagicHit(sim *Simulation, result *SpellResult, attackTable *AttackTable)
- func (spell *Spell) PhysicalCritChance(target *Unit, attackTable *AttackTable) float64
- func (spell *Spell) PhysicalCritCheck(sim *Simulation, target *Unit, attackTable *AttackTable) bool
- func (spell *Spell) PhysicalHitChance(target *Unit) float64
- func (spell *Spell) RangedAttackPower(target *Unit) float64
- func (spell *Spell) ReadyAt() time.Duration
- func (spell *Spell) ResistanceMultiplier(sim *Simulation, isPeriodic bool, attackTable *AttackTable) float64
- func (spell *Spell) RunicPowerMetrics() *ResourceMetrics
- func (spell *Spell) SkipCastAndApplyEffects(sim *Simulation, target *Unit)
- func (spell *Spell) SpellChanceToMiss(attackTable *AttackTable) float64
- func (spell *Spell) SpellCritChance(target *Unit) float64
- func (spell *Spell) SpellHitChance(target *Unit) float64
- func (spell *Spell) SpellPower() float64
- func (spell *Spell) TargetDamageMultiplier(attackTable *AttackTable, isPeriodic bool) float64
- func (spell *Spell) ThreatFromDamage(outcome HitOutcome, damage float64) float64
- func (spell *Spell) TimeToReady(sim *Simulation) time.Duration
- func (spell *Spell) UnholyRuneMetrics() *ResourceMetrics
- func (spell *Spell) WaitTravelTime(sim *Simulation, callback func(*Simulation))
- type SpellConfig
- type SpellFlag
- type SpellMetrics
- type SpellRegisteredHandler
- type SpellResult
- 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 (at *Target) AfterCast(sim *Simulation, spell *Spell)
- 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 (target *Target) DoNothing()
- 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) HasActiveAuraWithTagExcludingAura(tag string, excludeAura *Aura) 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) NumActiveAurasWithTag(tag string) int32
- func (target *Target) OnAutoAttack(sim *Simulation, spell *Spell)
- func (at *Target) OnCastComplete(sim *Simulation, spell *Spell)
- func (target *Target) OnGCDReady(sim *Simulation)
- func (at *Target) OnHealDealt(sim *Simulation, spell *Spell, result *SpellResult)
- func (at *Target) OnHealTaken(sim *Simulation, spell *Spell, result *SpellResult)
- func (at *Target) OnPeriodicDamageDealt(sim *Simulation, spell *Spell, result *SpellResult)
- func (at *Target) OnPeriodicDamageTaken(sim *Simulation, spell *Spell, result *SpellResult)
- func (at *Target) OnPeriodicHealDealt(sim *Simulation, spell *Spell, result *SpellResult)
- func (at *Target) OnPeriodicHealTaken(sim *Simulation, spell *Spell, result *SpellResult)
- func (at *Target) OnSpellHitDealt(sim *Simulation, spell *Spell, result *SpellResult)
- func (at *Target) OnSpellHitTaken(sim *Simulation, spell *Spell, result *SpellResult)
- 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 TargetDummy
- func (eb *TargetDummy) AddComboPoints(sim *Simulation, pointsToAdd int32, metrics *ResourceMetrics)
- func (eb *TargetDummy) AddEnergy(sim *Simulation, amount float64, metrics *ResourceMetrics)
- func (mcdm *TargetDummy) AddMajorCooldown(mcd MajorCooldown)
- func (td *TargetDummy) AddPartyBuffs(partyBuffs *proto.PartyBuffs)
- func (rb *TargetDummy) AddRage(sim *Simulation, amount float64, metrics *ResourceMetrics)
- func (td *TargetDummy) AddRaidBuffs(raidBuffs *proto.RaidBuffs)
- func (at *TargetDummy) AfterCast(sim *Simulation, spell *Spell)
- func (td *TargetDummy) ApplyGearBonuses()
- func (td *TargetDummy) ApplyTalents()
- func (eb *TargetDummy) ComboPoints() int32
- func (eb *TargetDummy) CurrentEnergy() float64
- func (hb *TargetDummy) CurrentHealth() float64
- func (hb *TargetDummy) CurrentHealthPercent() float64
- func (rb *TargetDummy) CurrentRage() float64
- func (mcdm *TargetDummy) DelayDPSCooldownsForArmorDebuffs(delay time.Duration)
- func (mcdm *TargetDummy) DisableAllEnabledCooldowns(cooldownType CooldownType) []*MajorCooldown
- func (mcdm *TargetDummy) DisableMajorCooldown(actionID ActionID)
- func (mcdm *TargetDummy) EnableAllCooldowns(mcdsToEnable []*MajorCooldown)
- func (mcdm *TargetDummy) EnableMajorCooldown(actionID ActionID)
- func (hb *TargetDummy) GainHealth(sim *Simulation, amount float64, metrics *ResourceMetrics)
- func (at *TargetDummy) GetActiveAuraWithTag(tag string) *Aura
- func (at *TargetDummy) GetAura(label string) *Aura
- func (at *TargetDummy) GetAurasWithTag(tag string) []*Aura
- func (td *TargetDummy) GetCharacter() *Character
- func (mcdm *TargetDummy) GetInitialMajorCooldown(actionID ActionID) MajorCooldown
- func (mcdm *TargetDummy) GetMajorCooldown(actionID ActionID) *MajorCooldown
- func (mcdm *TargetDummy) GetMajorCooldownIDs() []*proto.ActionID
- func (mcdm *TargetDummy) GetMajorCooldowns() []*MajorCooldown
- func (at *TargetDummy) HasActiveAura(label string) bool
- func (at *TargetDummy) HasActiveAuraWithTag(tag string) bool
- func (at *TargetDummy) HasActiveAuraWithTagExcludingAura(tag string, excludeAura *Aura) bool
- func (at *TargetDummy) HasAura(label string) bool
- func (at *TargetDummy) HasAuraWithTag(tag string) bool
- func (mcdm *TargetDummy) HasMajorCooldown(actionID ActionID) bool
- func (td *TargetDummy) Initialize()
- func (hb *TargetDummy) MaxHealth() float64
- func (eb *TargetDummy) NextEnergyTickAt() time.Duration
- func (at *TargetDummy) NumActiveAurasWithTag(tag string) int32
- func (td *TargetDummy) OnAutoAttack(sim *Simulation, spell *Spell)
- func (at *TargetDummy) OnCastComplete(sim *Simulation, spell *Spell)
- func (td *TargetDummy) OnGCDReady(sim *Simulation)
- func (at *TargetDummy) OnHealDealt(sim *Simulation, spell *Spell, result *SpellResult)
- func (at *TargetDummy) OnHealTaken(sim *Simulation, spell *Spell, result *SpellResult)
- func (at *TargetDummy) OnPeriodicDamageDealt(sim *Simulation, spell *Spell, result *SpellResult)
- func (at *TargetDummy) OnPeriodicDamageTaken(sim *Simulation, spell *Spell, result *SpellResult)
- func (at *TargetDummy) OnPeriodicHealDealt(sim *Simulation, spell *Spell, result *SpellResult)
- func (at *TargetDummy) OnPeriodicHealTaken(sim *Simulation, spell *Spell, result *SpellResult)
- func (at *TargetDummy) OnSpellHitDealt(sim *Simulation, spell *Spell, result *SpellResult)
- func (at *TargetDummy) OnSpellHitTaken(sim *Simulation, spell *Spell, result *SpellResult)
- func (at *TargetDummy) RegisterResetEffect(resetEffect ResetEffect)
- func (hb *TargetDummy) RemoveHealth(sim *Simulation, amount float64)
- func (td *TargetDummy) Reset(sim *Simulation)
- func (eb *TargetDummy) ResetEnergyTick(sim *Simulation)
- func (at *TargetDummy) ShouldRefreshAuraWithTagAtPriority(sim *Simulation, tag string, priority float64, refreshWindow time.Duration) bool
- func (eb *TargetDummy) SpendComboPoints(sim *Simulation, metrics *ResourceMetrics)
- func (eb *TargetDummy) SpendEnergy(sim *Simulation, amount float64, metrics *ResourceMetrics)
- func (rb *TargetDummy) SpendRage(sim *Simulation, amount float64, metrics *ResourceMetrics)
- func (mcdm *TargetDummy) TryUseCooldowns(sim *Simulation)
- func (mcdm *TargetDummy) UpdateMajorCooldowns()
- type TargetedActionMetrics
- type TestGenerator
- type Threshold
- type Thresholds
- type Timer
- type Unit
- func (unit *Unit) AddBonusRangedCritRating(amount float64)
- func (unit *Unit) AddBonusRangedHitRating(amount float64)
- func (eb *Unit) AddComboPoints(sim *Simulation, pointsToAdd int32, metrics *ResourceMetrics)
- func (unit *Unit) AddDynamicDamageTakenModifier(ddtm DynamicDamageTakenModifier)
- func (eb *Unit) AddEnergy(sim *Simulation, amount float64, metrics *ResourceMetrics)
- func (unit *Unit) AddMana(sim *Simulation, amount float64, metrics *ResourceMetrics, isBonusMana bool)
- 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, bonus stats.Stats)
- func (at *Unit) AfterCast(sim *Simulation, spell *Spell)
- func (unit *Unit) ApplyCastSpeed(dur time.Duration) time.Duration
- func (unit *Unit) ApplyCastSpeedForSpell(dur time.Duration, spell *Spell) time.Duration
- func (unit *Unit) Armor() float64
- func (unit *Unit) ArmorPenetrationPercentage(armorPenRating float64) float64
- 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) DisableDynamicStatDep(sim *Simulation, dep *stats.StatDependency)
- func (unit *Unit) DoneWaitingForEnergy(sim *Simulation) bool
- func (unit *Unit) DoneWaitingForMana(sim *Simulation) bool
- func (unit *Unit) EnableAutoAttacks(agent Agent, options AutoAttackOptions)
- func (unit *Unit) EnableDynamicStatDep(sim *Simulation, dep *stats.StatDependency)
- func (unit *Unit) EnableEnergyBar(maxEnergy float64, onEnergyGain OnEnergyGain)
- func (unit *Unit) EnableHealthBar()
- func (unit *Unit) EnableRageBar(options RageBarOptions, onRageGain OnRageGain)
- func (unit *Unit) EnableRunicPowerBar(currentRunicPower float64, maxRunicPower float64, runeCD time.Duration, ...)
- 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) GetCurrentPowerBar() PowerBarType
- func (unit *Unit) GetDiminishedDodgeChance() float64
- func (unit *Unit) GetDiminishedMissChance() float64
- func (unit *Unit) GetDiminishedParryChance() float64
- func (unit *Unit) GetInitialStat(stat stats.Stat) float64
- func (at *Unit) GetMetricsProto(numIterations int32) []*proto.AuraMetrics
- func (unit *Unit) GetOpponents() []*Unit
- 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) GetSpellsMatchingSchool(school SpellSchool) []*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) HasActiveAuraWithTagExcludingAura(tag string, excludeAura *Aura) 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) HasRunicPowerBar() 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) IsOpponent(other *Unit) bool
- func (unit *Unit) IsWaiting() bool
- func (unit *Unit) IsWaitingForEnergy() bool
- func (unit *Unit) IsWaitingForMana() bool
- func (unit *Unit) Log(sim *Simulation, message string, vals ...interface{})
- func (unit *Unit) LogLabel() string
- func (unit *Unit) MHNormalizedWeaponDamage(sim *Simulation, attackPower float64) float64
- func (unit *Unit) MHWeaponDamage(sim *Simulation, attackPower float64) float64
- 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) NewBloodRuneMetrics(actionID ActionID) *ResourceMetrics
- func (unit *Unit) NewComboPointMetrics(actionID ActionID) *ResourceMetrics
- func (unit *Unit) NewDeathRuneMetrics(actionID ActionID) *ResourceMetrics
- func (unit *Unit) NewEnergyMetrics(actionID ActionID) *ResourceMetrics
- func (unit *Unit) NewFocusMetrics(actionID ActionID) *ResourceMetrics
- func (unit *Unit) NewFrostRuneMetrics(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) NewRunicPowerMetrics(actionID ActionID) *ResourceMetrics
- func (unit *Unit) NewTimer() *Timer
- func (unit *Unit) NewUnholyRuneMetrics(actionID ActionID) *ResourceMetrics
- func (eb *Unit) NextEnergyTickAt() time.Duration
- func (unit *Unit) NextGCDAt() time.Duration
- func (at *Unit) NumActiveAurasWithTag(tag string) int32
- func (unit *Unit) OHNormalizedWeaponDamage(sim *Simulation, attackPower float64) float64
- func (unit *Unit) OHWeaponDamage(sim *Simulation, attackPower float64) float64
- func (unit *Unit) OnAutoAttack(sim *Simulation, spell *Spell)
- func (at *Unit) OnCastComplete(sim *Simulation, spell *Spell)
- func (at *Unit) OnHealDealt(sim *Simulation, spell *Spell, result *SpellResult)
- func (at *Unit) OnHealTaken(sim *Simulation, spell *Spell, result *SpellResult)
- func (at *Unit) OnPeriodicDamageDealt(sim *Simulation, spell *Spell, result *SpellResult)
- func (at *Unit) OnPeriodicDamageTaken(sim *Simulation, spell *Spell, result *SpellResult)
- func (at *Unit) OnPeriodicHealDealt(sim *Simulation, spell *Spell, result *SpellResult)
- func (at *Unit) OnPeriodicHealTaken(sim *Simulation, spell *Spell, result *SpellResult)
- func (at *Unit) OnSpellHitDealt(sim *Simulation, spell *Spell, result *SpellResult)
- func (at *Unit) OnSpellHitTaken(sim *Simulation, spell *Spell, result *SpellResult)
- func (unit *Unit) OnSpellRegistered(handler SpellRegisteredHandler)
- func (unit *Unit) RangedSwingSpeed() float64
- func (unit *Unit) RangedWeaponDamage(sim *Simulation, attackPower float64) 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) SetCurrentPowerBar(bar PowerBarType)
- 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) WaitForEnergy(sim *Simulation, desiredEnergy float64)
- 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) AddOOMTime(sim *Simulation, dur time.Duration)
- func (unitMetrics *UnitMetrics) MarkOOM(sim *Simulation)
- 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 ProcMaskSpecial = ProcMaskMeleeOrRangedSpecial | ProcMaskSpellDamage )
const ( OutcomePartial = OutcomePartial1 | OutcomePartial2 | OutcomePartial4 | OutcomePartial8 OutcomeLanded = OutcomeHit | OutcomeCrit | OutcomeCrush | OutcomeGlance | OutcomeBlock )
const ( CooldownPriorityLow = -1.0 CooldownPriorityDefault = 0.0 CooldownPriorityDrums = 2.0 CooldownPriorityBloodlust = 1.0 )
const APReductionAuraTag = "APReduction"
const ArmorPenPerPercentArmor = 13.99
const AtkSpeedReductionAuraTag = "AtkSpdReduction"
const BleedDamageAuraTag = "BleedDamage"
const BlockRatingPerBlockChance = 16.39
const BloodlustAuraTag = "Bloodlust"
const BloodlustCD = time.Minute * 10
const BloodlustDuration = time.Second * 40
const CharacterLevel = 80
const CritRatingPerCritChance = 45.91
const CryptFeverAuraLabel = "Crypt Fever-"
const DTPSReferenceStat = stats.Armor
const DefenseRatingPerDefense = 4.92
const DefenseRatingToChanceReduction = (1.0 / DefenseRatingPerDefense) * MissDodgeParryBlockCritChancePerDefense / 100
const Diminish_Cd_Druid = 116.890707 / 100
const Diminish_Cd_Nondruid = 88.129021 / 100
const Diminish_Cm = 16.000 / 100
const Diminish_Cp = 47.003525 / 100
const Diminish_kCd_Druid = (Diminish_k_Druid * Diminish_Cd_Druid)
const Diminish_kCd_Nondruid = (Diminish_k_Nondruid * Diminish_Cd_Nondruid)
const Diminish_kCm_Druid = (Diminish_k_Druid * Diminish_Cm)
const Diminish_kCm_Nondruid = (Diminish_k_Nondruid * Diminish_Cm)
const Diminish_kCp = (Diminish_k_Nondruid * Diminish_Cp)
const Diminish_k_Druid = 0.972
Could be in constants.go, but they won't be used anywhere else C values are divided by 100 so that we are working with 1% = 0.01
const Diminish_k_Nondruid = 0.956
const DodgeRatingPerDodgeChance = 45.25
const EbonPlaguebringerAuraLabel = "Ebon Plaguebringer-"
const EnemyAutoAttackAPCoefficient = 0.000649375
TODO: Find these numbers for WOTLK
const EnergyPerTick = 1.0
Extra 0.2 because Blizzard
const EnergyTickDuration = time.Millisecond * 100
Time between energy ticks.
const ExpertisePerQuarterPercentReduction = 32.79 / 4 // TODO: Does it still cutoff at 1/4 percents?
const GCDDefault = time.Millisecond * 1500
const GCDMin = time.Second * 1
const HasteRatingPerHastePercent = 32.79
const Inactive = -1
const InnervateCD = time.Minute * 6
const InnervateDuration = time.Second * 20
const LongDuration = 300
const MajorSpellCritDebuffAuraTag = "majorspellcritdebuff"
const ManaTideTotemCD = time.Minute * 5
const ManaTideTotemDuration = time.Second * 12
const MarkOfBloodTag = "MarkOfBlood"
const MaxRage = 100.0
const MeleeAttackRatingPerDamage = 14.0
const MeleeHitRatingPerHitChance = 32.79
const MinorCritDebuffAuraTag = "minorcritdebuff"
const MissDodgeParryBlockCritChancePerDefense = 0.04
const NeverExpires = time.Duration(math.MaxInt64)
const ParryRatingPerParryChance = 45.25
const PowerInfusionCD = time.Minute * 2
const PowerInfusionDuration = time.Second * 15
const RageFactor = 453.3
const ReplenishmentAuraDuration = time.Second * 15
const ResilienceRatingPerCritDamageReductionPercent = 39.4231 / 2.2
const ResilienceRatingPerCritReductionChance = 82.0
const RuneOfRazoriceVulnerabilityTag = "RuneOfRazoriceVulnerability"
const ShatteringThrowCD = time.Minute * 5
const ShortDuration = 60
const SpellHitRatingPerHitChance = 26.232
const ThreatPerManaGained = 0.5
const ThreatPerRageGained = 5
const TricksOfTheTradeCD = time.Second * 3600 // CD is 30s from the time buff ends (so 40s with glyph) but that's in order to be able to set the number of TotT you'll have during the fight
const TricksOfTheTradeDuration = time.Second * 10 // Assuming rogues have Glyph of TotT by default (which might not be the case).
const UnholyFrenzyCD = time.Minute * 3
const UnholyFrenzyDuration = time.Second * 30
Variables ¶
var AcidSpitActionID = ActionID{SpellID: 55754}
var AcidSpitAuraLabel = "Acid Spit"
var AddEffectsToTest = true
This value can be set before adding item effects, to control whether they are included in tests.
var AlchStoneItemIDs = []int32{13503, 35748, 35749, 35750, 35751, 44322, 44323, 44324}
var AverageDefaultSimTestOptions = &proto.SimOptions{ Iterations: 2000, IsTest: true, Debug: false, RandomSeed: 101, }
var BaseStats = map[BaseStatsKey]stats.Stats{}
var ChanceOfDeathAuraLabel = "Chance of Death"
var CobaltFragBombActionID = ActionID{ItemID: 40771}
var ConjuredAuraTag = "Conjured"
var DefaultSimTestOptions = &proto.SimOptions{ Iterations: 20, IsTest: true, Debug: false, RandomSeed: 101, }
var DefaultTargetProto = &proto.Target{ Level: CharacterLevel + 3, Stats: stats.Stats{ stats.Armor: 10643, stats.AttackPower: 320, stats.BlockValue: 54, }.ToFloatArray(), MobType: proto.MobType_MobTypeDemon, SwingSpeed: 2, MinBaseDamage: 4192.05, ParryHaste: true, }
var ExplosiveDecoyActionID = ActionID{ItemID: 40536}
var FullDebuffs = &proto.Debuffs{ BloodFrenzy: true, CurseOfElements: true, CurseOfWeakness: proto.TristateEffect_TristateEffectImproved, EarthAndMoon: true, EbonPlaguebringer: true, ExposeArmor: true, FaerieFire: proto.TristateEffect_TristateEffectImproved, GiftOfArthas: true, HeartOfTheCrusader: true, ImprovedScorch: true, InsectSwarm: true, JudgementOfLight: true, JudgementOfWisdom: true, Mangle: true, Misery: true, ScorpidSting: true, ShadowEmbrace: true, ShadowMastery: true, SunderArmor: true, ThunderClap: proto.TristateEffect_TristateEffectImproved, TotemOfWrath: true, Vindication: true, }
var FullIndividualBuffs = &proto.IndividualBuffs{ BlessingOfKings: true, BlessingOfMight: proto.TristateEffect_TristateEffectImproved, BlessingOfSanctuary: true, BlessingOfWisdom: proto.TristateEffect_TristateEffectImproved, JudgementsOfTheWise: true, VampiricTouch: true, }
var FullPartyBuffs = &proto.PartyBuffs{
ManaTideTotems: 1,
}
var FullRaidBuffs = &proto.RaidBuffs{ AbominationsMight: true, ArcaneBrilliance: true, ArcaneEmpowerment: true, BattleShout: proto.TristateEffect_TristateEffectImproved, Bloodlust: true, DemonicPact: 500, DevotionAura: proto.TristateEffect_TristateEffectImproved, DivineSpirit: true, ElementalOath: true, FerociousInspiration: true, GiftOfTheWild: proto.TristateEffect_TristateEffectImproved, IcyTalons: true, LeaderOfThePack: proto.TristateEffect_TristateEffectImproved, ManaSpringTotem: proto.TristateEffect_TristateEffectRegular, MoonkinAura: proto.TristateEffect_TristateEffectImproved, PowerWordFortitude: proto.TristateEffect_TristateEffectImproved, SanctifiedRetribution: true, ShadowProtection: true, StrengthOfEarthTotem: proto.TristateEffect_TristateEffectImproved, SwiftRetribution: true, Thorns: proto.TristateEffect_TristateEffectImproved, TotemOfWrath: true, TrueshotAura: true, UnleashedRage: true, WindfuryTotem: proto.TristateEffect_TristateEffectImproved, WrathOfAirTotem: true, }
var HuntersMarkAuraTag = "HuntersMark"
var ImprovedScorchAuraLabel = "Improved Scorch"
var InnervateAuraTag = "Innervate"
var JudgementOfLightAuraLabel = "Judgement of Light"
var JudgementOfWisdomAuraLabel = "Judgement of Wisdom"
var MajorArmorReductionTag = "MajorArmorReductionAura"
var ManaTideTotemAuraTag = "ManaTideTotem"
var MinorArmorReductionAuraTag = "MinorArmorReductionAura"
var MinorSpellHitDebuffAuraTag = "sphit3%"
var (
OutcomePartialOffset = bits.TrailingZeros(uint(OutcomePartial1))
)
var PotionAuraTag = "Potion"
var PowerInfusionAuraTag = "PowerInfusion"
var ReplenishmentAuraTag = "Replenishment"
var SaroniteBombActionID = ActionID{ItemID: 41119}
var ShatteringThrowAuraTag = "ShatteringThrow"
var ShatteringThrowDuration = time.Second * 10
var StatWeightsDefaultSimTestOptions = &proto.SimOptions{ Iterations: 300, IsTest: true, Debug: false, RandomSeed: 101, }
var SunderArmorActionID = ActionID{SpellID: 47467}
var SunderArmorAuraLabel = "Sunder Armor"
var ThermalSapperActionID = ActionID{ItemID: 42641}
var TricksOfTheTradeAuraTag = "TricksOfTheTrade"
var UnholyFrenzyAuraTag = "UnholyFrenzy"
var WintersChillAuraLabel = "Winter's Chill"
Functions ¶
func AddPresetEncounter ¶
func AddPresetTarget ¶
func AddPresetTarget(newPreset *PresetTarget)
func AddWeaponEffect ¶
func AddWeaponEffect(id int32, weaponEffect ApplyWeaponEffect)
func ApplyFixedUptimeAura ¶
func ApplyInspiration ¶
func ApplyPetConsumeEffects ¶
func BlessingOfSanctuaryAura ¶
func BlessingOfSanctuaryAura(character *Character)
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 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 GetPrimaryTalentTreeIndex ¶ added in v0.1.1
Returns the talent tree (0, 1, or 2) of the tree with the most points.
talentStr is expected to be a wowhead-formatted talent string, e.g. "12123131-123123123-123123213"
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 HasItemEffectForTest ¶
func HasWeaponEffect ¶
func InitReplenishmentAuras ¶
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 NewSimpleStatItemEffect ¶
func NewSimpleStatItemEffect(itemID int32, bonus stats.Stats, duration time.Duration, cooldown time.Duration)
No shared CD
func RaidBenchmark ¶
func RaidBenchmark(b *testing.B, rsr *proto.RaidSimRequest)
func RaidPlayersWithClass ¶
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 ResetRunes ¶
func ResetRunes(runeMeta *RuneMeta)
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 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 AfterCast ¶
type AfterCast func(aura *Aura, sim *Simulation, spell *Spell)
Callback for when a cast is finished, but after calculations are done
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 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 ApplySpellResults ¶ added in v0.1.1
type ApplySpellResults func(sim *Simulation, target *Unit, spell *Spell)
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 CritSuppression float64 DamageDealtMultiplier float64 // attacker buff, applied in applyAttackerModifiers() DamageTakenMultiplier float64 // defender debuff, applied in applyTargetModifiers() NatureDamageTakenMultiplier float64 PeriodicShadowDamageTakenMultiplier float64 HealingDealtMultiplier 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) GetArmorDamageModifier ¶
func (at *AttackTable) GetArmorDamageModifier(spell *Spell) float64
type Aura ¶
type Aura struct { // String label for this Aura. Guaranteed 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. OnStatsChange OnStatsChange // Invoked when the stats of this aura owner changes. OnCastComplete OnCastComplete // Invoked when a spell cast completes casting, before results are calculated. AfterCast AfterCast // Invoked when a spell cast completes casting, after 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. OnHealDealt OnSpellHit // Invoked when a heal hits and this unit is the caster. OnHealTaken OnSpellHit // Invoked when a heal hits and this unit is the target. OnPeriodicHealDealt OnPeriodicDamage // Invoked when a hot tick occurs and this unit is the caster. OnPeriodicHealTaken OnPeriodicDamage // Invoked when a hot 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 AcidSpitAura ¶
func BloodFrenzyAura ¶
func BloodlustAura ¶
func CryptFeverAura ¶
func CurseOfElementsAura ¶
func CurseOfWeaknessAura ¶
func DemonicPactAura ¶
func DemoralizingRoarAura ¶
func DemoralizingShoutAura ¶
func EarthAndMoonAura ¶
func EbonPlaguebringerAura ¶
func ExposeArmorAura ¶
func FaerieFireAura ¶
func FlametongueTotemAura ¶
func FrostFeverAura ¶
func GiftOfArthasAura ¶
func ImprovedScorchAura ¶
func InfectedWoundsAura ¶
func InnervateAura ¶
func InsectSwarmAura ¶
func InspirationAura ¶
func JudgementOfLightAura ¶
func JudgementOfWisdomAura ¶
func JudgementsOfTheJustAura ¶
Note: Paladin code might apply this as part of their judgement auras instead of using another separate aura.
func ManaTideTotemAura ¶
func MangleAura ¶
func MarkOfBloodAura ¶
func MasterPoisonerDebuff ¶
func MiseryAura ¶
func PowerInfusionAura ¶
func ReplenishmentAura ¶
func RetributionAura ¶
func SavageCombatAura ¶
func ScheduledAura ¶
func ScheduledAura(aura *Aura, preActivate bool, options PeriodicActionOptions) *Aura
func ScorpidStingAura ¶
func ScreechAura ¶
func ShadowMasteryAura ¶
func ShatteringThrowAura ¶
func SporeCloudAura ¶
func StampedeAura ¶
func SunderArmorAura ¶
func ThornsAura ¶
func ThunderClapAura ¶
func TotemOfWrathAura ¶
func TotemOfWrathDebuff ¶
func TraumaAura ¶
func TricksOfTheTradeAura ¶
func UnholyFrenzyAura ¶
func VindicationAura ¶
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 Procs int32 // 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. AutoSwingRanged bool // If true, core engine will handle calling SwingMelee() for you. SyncType int32 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 1 to sync your auto attacks together, or 2 to use the OH delay macro, mostly used by enhance shamans. // This will intentionally perfectly sync or delay OH swings to that they always fall within the // 0.5s window following a MH swing. SyncType int32 MainhandSwingAt time.Duration OffhandSwingAt time.Duration RangedSwingAt time.Duration MHConfig SpellConfig OHConfig SpellConfig RangedConfig SpellConfig MHAuto *Spell OHAuto *Spell RangedAuto *Spell ReplaceMHSwing ReplaceMHSwing PreviousSwingAt time.Duration // 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) DelayMainhandMeleeUntil ¶
func (aa *AutoAttacks) DelayMainhandMeleeUntil(sim *Simulation, readyAt time.Duration)
Delays only mainhand swing timers until the specified time.
func (*AutoAttacks) DelayMeleeUntil ¶
func (aa *AutoAttacks) DelayMeleeUntil(sim *Simulation, readyAt time.Duration)
Delays all swing timers until the specified time.
func (*AutoAttacks) DelayOffhandMeleeUntil ¶
func (aa *AutoAttacks) DelayOffhandMeleeUntil(sim *Simulation, readyAt time.Duration)
Delays only offhand 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) 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) RangedSwingSpeed ¶
func (aa *AutoAttacks) RangedSwingSpeed() time.Duration
The amount of time between two ranged swings.
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) 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.
func (*AutoAttacks) UpdateSwingTime ¶
func (aa *AutoAttacks) UpdateSwingTime(sim *Simulation)
type BuffsCombo ¶
type BuffsCombo struct { Label string Raid *proto.RaidBuffs Party *proto.PartyBuffs Debuffs *proto.Debuffs Player *proto.IndividualBuffs Consumes *proto.Consumes }
func MakeDefaultBuffCombos ¶
func MakeDefaultBuffCombos(config CharacterSuiteConfig) []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 // Consumables this Character will be using. Consumes *proto.Consumes PrimaryTalentTree uint8 // 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 // 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) AfterCast ¶
func (at *Character) AfterCast(sim *Simulation, spell *Spell)
Invokes the AfterCast event for all tracked Auras.
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) DefaultHealingCritMultiplier ¶
func (*Character) DefaultMeleeCritMultiplier ¶
func (*Character) DefaultSpellCritMultiplier ¶
func (*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) DoNothing ¶
func (character *Character) DoNothing()
DoNothing will explicitly declare that the character is intentionally doing nothing.
If the GCD is not used during OnGCDReady and this flag is set, OnGCDReady will not be called again until it is used in some other way (like from an auto attack or resource regeneration).
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()
EnableManaBar will setup caster stat dependencies (int->mana and int->spellcrit) as well as enable the mana gain action to regenerate mana. It will then enable mana gain metrics for reporting.
func (*Character) EnableManaBarWithModifier ¶
func (*Character) EnableResumeAfterManaWait ¶
func (character *Character) EnableResumeAfterManaWait(callback func(sim *Simulation))
EnableResumeAfterManaWait will setup the OnManaTick callback to resume the given callback
once enough mana has been gained after calling unit.WaitForMana()
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) HasActiveAuraWithTagExcludingAura ¶
func (*Character) HasAlchStone ¶
func (*Character) HasAuraWithTag ¶
func (*Character) HasMHWeapon ¶
func (*Character) HasMajorCooldown ¶
func (*Character) HasMetaGemEquipped ¶
func (*Character) HasOHWeapon ¶
func (*Character) HasProfession ¶
func (character *Character) HasProfession(prof proto.Profession) bool
func (*Character) HasRangedWeapon ¶
func (*Character) HasRingEquipped ¶
func (*Character) HasSetBonus ¶
func (*Character) HasTrinketEquipped ¶
func (*Character) HealingCritMultiplier ¶
func (*Character) MeleeCritMultiplier ¶
func (*Character) MultiplyAttackSpeed ¶
func (character *Character) MultiplyAttackSpeed(sim *Simulation, amount float64)
func (*Character) MultiplyMeleeSpeed ¶
func (character *Character) MultiplyMeleeSpeed(sim *Simulation, amount float64)
func (*Character) MultiplyRangedSpeed ¶
func (character *Character) MultiplyRangedSpeed(sim *Simulation, amount float64)
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, buffs stats.Stats, duration time.Duration, modConfig func(*Aura)) *Aura
Alternative that allows modifying the Aura config.
func (*Character) NextEnergyTickAt ¶
func (*Character) NumActiveAurasWithTag ¶
func (*Character) OnCastComplete ¶
func (at *Character) OnCastComplete(sim *Simulation, spell *Spell)
Invokes the OnCastComplete event for all tracked Auras.
func (*Character) OnHealDealt ¶
func (at *Character) OnHealDealt(sim *Simulation, spell *Spell, result *SpellResult)
Invokes the OnHeal event for all tracked Auras.
func (*Character) OnHealTaken ¶
func (at *Character) OnHealTaken(sim *Simulation, spell *Spell, result *SpellResult)
func (*Character) OnPeriodicDamageDealt ¶
func (at *Character) OnPeriodicDamageDealt(sim *Simulation, spell *Spell, result *SpellResult)
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, result *SpellResult)
func (*Character) OnPeriodicHealDealt ¶
func (at *Character) OnPeriodicHealDealt(sim *Simulation, spell *Spell, result *SpellResult)
Invokes the OnPeriodicHeal
As a debuff when target is being hit by dot. As a buff when caster's dots are ticking.
func (*Character) OnPeriodicHealTaken ¶
func (at *Character) OnPeriodicHealTaken(sim *Simulation, spell *Spell, result *SpellResult)
func (*Character) OnSpellHitDealt ¶
func (at *Character) OnSpellHitDealt(sim *Simulation, spell *Spell, result *SpellResult)
Invokes the OnSpellHit event for all tracked Auras.
func (*Character) OnSpellHitTaken ¶
func (at *Character) OnSpellHitTaken(sim *Simulation, spell *Spell, result *SpellResult)
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) StatProcWithICD ¶
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 ranged 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. FirstOOMTimestamp time.Duration // Timestamp at which unit first went OOM. }
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 Glyphs *proto.Glyphs TalentsString string Consumes *proto.Consumes IsHealer bool 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.
func (*Cooldown) UsePrePull ¶
func (cd *Cooldown) UsePrePull(sim *Simulation, timeBeforePull time.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 )
func (CooldownType) Matches ¶
func (ct CooldownType) Matches(other CooldownType) bool
type DelayedActionOptions ¶
type DelayedActionOptions struct { // When the action should be performed. DoAt time.Duration Priority ActionPriority OnAction func(*Simulation) CleanUp func(*Simulation) }
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 OnSnapshot OnSnapshot OnTick OnTick SnapshotBaseDamage float64 SnapshotCritChance float64 SnapshotAttackerMultiplier float64 // 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) CalcAndDealPeriodicSnapshotDamage ¶ added in v0.1.1
func (dot *Dot) CalcAndDealPeriodicSnapshotDamage(sim *Simulation, target *Unit, outcomeApplier OutcomeApplier) *SpellResult
func (*Dot) CalcAndDealPeriodicSnapshotHealing ¶ added in v0.1.1
func (dot *Dot) CalcAndDealPeriodicSnapshotHealing(sim *Simulation, target *Unit, outcomeApplier OutcomeApplier) *SpellResult
func (*Dot) CalcSnapshotDamage ¶ added in v0.1.1
func (dot *Dot) CalcSnapshotDamage(sim *Simulation, target *Unit, outcomeApplier OutcomeApplier) *SpellResult
func (*Dot) CalcSnapshotHealing ¶ added in v0.1.1
func (dot *Dot) CalcSnapshotHealing(sim *Simulation, target *Unit, outcomeApplier OutcomeApplier) *SpellResult
func (*Dot) Cancel ¶
func (dot *Dot) Cancel(sim *Simulation)
func (*Dot) OutcomeMagicHitAndSnapshotCrit ¶ added in v0.1.1
func (dot *Dot) OutcomeMagicHitAndSnapshotCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)
func (*Dot) OutcomeRangedHitAndCritSnapshot ¶ added in v0.1.1
func (dot *Dot) OutcomeRangedHitAndCritSnapshot(sim *Simulation, result *SpellResult, attackTable *AttackTable)
func (*Dot) OutcomeSnapshotCrit ¶ added in v0.1.1
func (dot *Dot) OutcomeSnapshotCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)
func (*Dot) OutcomeTick ¶ added in v0.1.1
func (dot *Dot) OutcomeTick(sim *Simulation, result *SpellResult, attackTable *AttackTable)
A tick always hits, but we don't count them as hits in the metrics.
func (*Dot) OutcomeTickPhysicalCrit ¶ added in v0.1.1
func (dot *Dot) OutcomeTickPhysicalCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)
func (*Dot) RecomputeAuraDuration ¶
func (dot *Dot) RecomputeAuraDuration()
Call this after manually changing NumberOfTicks or TickLength.
func (*Dot) Rollover ¶
func (dot *Dot) Rollover(sim *Simulation)
Rollover is used to reset the duration of a dot from an external spell (not casting the dot itself) This keeps the snapshotted crit and %dmg modifiers. However sp and haste are recalculated.
func (*Dot) TakeSnapshot ¶
func (dot *Dot) TakeSnapshot(sim *Simulation, doRollover bool)
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.
doRollover will apply previously snapshotted crit/%dmg instead of recalculating.
func (*Dot) TickOnce ¶
func (dot *Dot) TickOnce(sim *Simulation)
Forces an instant tick. Does not reset the tick timer or aura duration, the tick is simply an extra tick.
type DynamicDamageTakenModifier ¶
type DynamicDamageTakenModifier func(sim *Simulation, spell *Spell, result *SpellResult)
type Encounter ¶
type Encounter struct { Duration time.Duration DurationVariation time.Duration Targets []*Target TargetUnits []*Unit 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) AOECapMultiplier ¶
func (*Encounter) GetMetricsProto ¶
func (encounter *Encounter) GetMetricsProto(numIterations int32) *proto.EncounterMetrics
type EncounterCombo ¶
func MakeDefaultEncounterCombos ¶
func MakeDefaultEncounterCombos() []EncounterCombo
type Environment ¶
type Environment struct { State EnvironmentState Raid *Raid Encounter Encounter AllUnits []*Unit 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 ExpectedDamageCalculator ¶ added in v0.1.1
type ExpectedDamageCalculator func(sim *Simulation, target *Unit, spell *Spell) *SpellResult
type GearSetCombo ¶
type GearSetCombo struct { Label string GearSet *proto.EquipmentSpec }
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 OutcomePartial2 OutcomePartial4 OutcomePartial8 )
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) TestCasts ¶
func (testSuite *IndividualTestSuite) TestCasts(testName string, rsr *proto.RaidSimRequest)
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 AlternativeName 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) 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 IsHealer bool // 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 OnManaTick ¶
type OnManaTick func(sim *Simulation)
type OnPeriodicDamage ¶
type OnPeriodicDamage func(aura *Aura, sim *Simulation, spell *Spell, result *SpellResult)
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 OnPetDisable ¶
type OnPetDisable func(sim *Simulation)
type OnPetEnable ¶
type OnPetEnable func(sim *Simulation)
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 OnRune ¶
type OnRune func(sim *Simulation)
type OnRunicPowerGain ¶
type OnRunicPowerGain func(sim *Simulation)
type OnSnapshot ¶ added in v0.1.1
type OnSnapshot func(sim *Simulation, target *Unit, dot *Dot, isRollover bool)
type OnSpellHit ¶
type OnSpellHit func(aura *Aura, sim *Simulation, spell *Spell, result *SpellResult)
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 OnStatsChange ¶
type OnTick ¶ added in v0.1.1
type OnTick func(sim *Simulation, target *Unit, dot *Dot)
type OutcomeApplier ¶
type OutcomeApplier func(sim *Simulation, result *SpellResult, 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.
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 NewDelayedAction ¶
func NewDelayedAction(sim *Simulation, options DelayedActionOptions) *PendingAction
func NewPeriodicAction ¶
func NewPeriodicAction(sim *Simulation, options PeriodicActionOptions) *PendingAction
func StartDelayedAction ¶
func StartDelayedAction(sim *Simulation, options DelayedActionOptions) *PendingAction
Convenience for immediately creating and starting a delayed action.
func StartPeriodicAction ¶
func StartPeriodicAction(sim *Simulation, options PeriodicActionOptions) *PendingAction
Convenience for immediately creating and starting a periodic action.
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) }
func AcidSpitPeriodicActionOptions ¶
func AcidSpitPeriodicActionOptions(aura *Aura) PeriodicActionOptions
func ExposeArmorPeriodicActonOptions ¶
func ExposeArmorPeriodicActonOptions(aura *Aura) PeriodicActionOptions
func SunderArmorPeriodicActionOptions ¶
func SunderArmorPeriodicActionOptions(aura *Aura) PeriodicActionOptions
type Pet ¶
type Pet struct { Character Owner *Character OnPetEnable OnPetEnable OnPetDisable OnPetDisable // contains filtered or unexported fields }
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) AfterCast ¶
func (at *Pet) AfterCast(sim *Simulation, spell *Spell)
Invokes the AfterCast event for all tracked Auras.
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 ¶
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) 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) HasActiveAuraWithTagExcludingAura ¶
func (*Pet) HasAuraWithTag ¶
func (*Pet) HasMajorCooldown ¶
func (*Pet) IsGuardian ¶
func (*Pet) NextEnergyTickAt ¶
func (*Pet) NumActiveAurasWithTag ¶
func (*Pet) OnCastComplete ¶
func (at *Pet) OnCastComplete(sim *Simulation, spell *Spell)
Invokes the OnCastComplete event for all tracked Auras.
func (*Pet) OnHealDealt ¶
func (at *Pet) OnHealDealt(sim *Simulation, spell *Spell, result *SpellResult)
Invokes the OnHeal event for all tracked Auras.
func (*Pet) OnHealTaken ¶
func (at *Pet) OnHealTaken(sim *Simulation, spell *Spell, result *SpellResult)
func (*Pet) OnPeriodicDamageDealt ¶
func (at *Pet) OnPeriodicDamageDealt(sim *Simulation, spell *Spell, result *SpellResult)
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, result *SpellResult)
func (*Pet) OnPeriodicHealDealt ¶
func (at *Pet) OnPeriodicHealDealt(sim *Simulation, spell *Spell, result *SpellResult)
Invokes the OnPeriodicHeal
As a debuff when target is being hit by dot. As a buff when caster's dots are ticking.
func (*Pet) OnPeriodicHealTaken ¶
func (at *Pet) OnPeriodicHealTaken(sim *Simulation, spell *Spell, result *SpellResult)
func (*Pet) OnSpellHitDealt ¶
func (at *Pet) OnSpellHitDealt(sim *Simulation, spell *Spell, result *SpellResult)
Invokes the OnSpellHit event for all tracked Auras.
func (*Pet) OnSpellHitTaken ¶
func (at *Pet) OnSpellHitTaken(sim *Simulation, spell *Spell, result *SpellResult)
func (*Pet) OwnerAttackSpeedChanged ¶
func (pet *Pet) OwnerAttackSpeedChanged(sim *Simulation)
Add a default base if pets dont need this
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 PetAgent ¶
type PetAgent interface { Agent // The Pet controlled by this PetAgent. GetPet() *Pet OwnerAttackSpeedChanged(sim *Simulation) }
Extension of Agent interface, for Pets.
type PostFinalizeEffect ¶
type PostFinalizeEffect func()
Callback for doing something after finalization.
type PowerBarType ¶
type PowerBarType int
const ( ManaBar PowerBarType = iota EnergyBar RageBar RunicPower )
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 ProcMaskSpellHealing )
Single-bit masks. These don't need to match Blizzard's values.
type RageBarOptions ¶
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) GetFirstEmptyRaidIndex ¶
Returns (party, index within party)
func (Raid) GetFirstNPlayersOrPets ¶
func (*Raid) GetFirstTargetDummy ¶
func (raid *Raid) GetFirstTargetDummy() *TargetDummy
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) GetPlayerFromUnitIndex ¶
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 RotationCastsTestGenerator ¶
type RotationCastsTestGenerator struct { SpecOptions []SpecOptionsCombo PartyBuffs *proto.PartyBuffs RaidBuffs *proto.RaidBuffs Debuffs *proto.Debuffs Player *proto.Player Encounter *proto.Encounter SimOptions *proto.SimOptions }
func (*RotationCastsTestGenerator) GetTest ¶
func (generator *RotationCastsTestGenerator) GetTest(testIdx int) (string, *proto.ComputeStatsRequest, *proto.StatWeightsRequest, *proto.RaidSimRequest)
func (*RotationCastsTestGenerator) NumTests ¶
func (generator *RotationCastsTestGenerator) NumTests() int
type RuneCost ¶
type RuneCost uint16
func NewRuneCost ¶
func (RuneCost) HasRune ¶
HasRune returns if this cost includes a rune portion.
If any bit is set in the rune bits it means that there is a rune cost.
func (RuneCost) RunicPower ¶
type RunicPowerBar ¶
type RunicPowerBar struct {
// contains filtered or unexported fields
}
func (*RunicPowerBar) AddRunicPower ¶
func (rp *RunicPowerBar) AddRunicPower(sim *Simulation, amount float64, metrics *ResourceMetrics)
func (*RunicPowerBar) Advance ¶
func (rp *RunicPowerBar) Advance(sim *Simulation, newTime time.Duration)
func (*RunicPowerBar) AllBloodRunesSpent ¶
func (rp *RunicPowerBar) AllBloodRunesSpent() bool
func (*RunicPowerBar) AllFrostSpent ¶
func (rp *RunicPowerBar) AllFrostSpent() bool
func (*RunicPowerBar) AllRunesSpent ¶
func (rp *RunicPowerBar) AllRunesSpent() bool
func (*RunicPowerBar) AllUnholySpent ¶
func (rp *RunicPowerBar) AllUnholySpent() bool
func (*RunicPowerBar) AnyRuneReadyAt ¶
func (rp *RunicPowerBar) AnyRuneReadyAt(sim *Simulation) time.Duration
func (*RunicPowerBar) AnySpentRuneReadyAt ¶
func (rp *RunicPowerBar) AnySpentRuneReadyAt() time.Duration
AnySpentRuneReadyAt returns the next time that a rune will regenerate.
It will be NeverExpires if there is no rune pending regeneration.
func (*RunicPowerBar) BloodRuneGainMetrics ¶
func (rp *RunicPowerBar) BloodRuneGainMetrics() *ResourceMetrics
func (*RunicPowerBar) BloodRuneReadyAt ¶
func (rp *RunicPowerBar) BloodRuneReadyAt(sim *Simulation) time.Duration
func (*RunicPowerBar) BloodRuneSpentAt ¶
func (rp *RunicPowerBar) BloodRuneSpentAt(dur time.Duration) int32
func (*RunicPowerBar) CancelBloodTap ¶
func (rp *RunicPowerBar) CancelBloodTap(sim *Simulation)
func (*RunicPowerBar) CastCostPossible ¶
func (rp *RunicPowerBar) CastCostPossible(sim *Simulation, runicPowerAmount float64, bloodAmount int8, frostAmount int8, unholyAmount int8) bool
func (*RunicPowerBar) ConvertFromDeath ¶
func (rp *RunicPowerBar) ConvertFromDeath(sim *Simulation, slot int8)
ConvertFromDeath reverts the rune to its original type.
func (*RunicPowerBar) ConvertToDeath ¶
func (rp *RunicPowerBar) ConvertToDeath(sim *Simulation, slot int8, revertOnSpend bool, revertAt time.Duration)
ConvertToDeath converts the given slot to death and sets up the revertion conditions ConvertToDeath converts the given slot to death and sets up the revertion conditions
func (*RunicPowerBar) CopyRunicPowerBar ¶
func (rp *RunicPowerBar) CopyRunicPowerBar() *RunicPowerBar
CopyRunicPowerBar will create a clone of the bar with the same
func (*RunicPowerBar) CorrectBloodTapConversion ¶
func (rp *RunicPowerBar) CorrectBloodTapConversion(sim *Simulation, bloodGainMetrics *ResourceMetrics, deathGainMetrics *ResourceMetrics, spell *Spell)
func (*RunicPowerBar) CurrentBloodRuneGrace ¶
func (rp *RunicPowerBar) CurrentBloodRuneGrace(sim *Simulation) time.Duration
func (*RunicPowerBar) CurrentBloodRunes ¶
func (rp *RunicPowerBar) CurrentBloodRunes() int8
func (*RunicPowerBar) CurrentDeathRunes ¶
func (rp *RunicPowerBar) CurrentDeathRunes() int8
func (*RunicPowerBar) CurrentFrostRuneGrace ¶
func (rp *RunicPowerBar) CurrentFrostRuneGrace(sim *Simulation) time.Duration
func (*RunicPowerBar) CurrentFrostRunes ¶
func (rp *RunicPowerBar) CurrentFrostRunes() int8
func (*RunicPowerBar) CurrentRuneGrace ¶
func (rp *RunicPowerBar) CurrentRuneGrace(sim *Simulation, slot int32) time.Duration
func (*RunicPowerBar) CurrentRuneGraces ¶
func (rp *RunicPowerBar) CurrentRuneGraces(sim *Simulation) (time.Duration, time.Duration, time.Duration)
func (*RunicPowerBar) CurrentRunicPower ¶
func (rp *RunicPowerBar) CurrentRunicPower() float64
func (*RunicPowerBar) CurrentUnholyRuneGrace ¶
func (rp *RunicPowerBar) CurrentUnholyRuneGrace(sim *Simulation) time.Duration
func (*RunicPowerBar) CurrentUnholyRunes ¶
func (rp *RunicPowerBar) CurrentUnholyRunes() int8
func (*RunicPowerBar) DeathRuneGainMetrics ¶
func (rp *RunicPowerBar) DeathRuneGainMetrics() *ResourceMetrics
func (*RunicPowerBar) DeathRuneRegenAt ¶
func (rp *RunicPowerBar) DeathRuneRegenAt(slot int32) time.Duration
DeathRuneRegenAt returns the time the given death rune will regen at.
If the rune is not death or not spent it returns NeverExpires
func (*RunicPowerBar) DeathRuneRevertAt ¶
func (rp *RunicPowerBar) DeathRuneRevertAt() time.Duration
DeathRuneRevertAt returns the next time that a death rune will revert.
If there is no deathrune that needs to revert it returns `NeverExpires`.
func (*RunicPowerBar) DeathRunesInFU ¶
func (rp *RunicPowerBar) DeathRunesInFU() int8
func (*RunicPowerBar) DebugString ¶
func (rp *RunicPowerBar) DebugString() string
func (*RunicPowerBar) FrostRuneGainMetrics ¶
func (rp *RunicPowerBar) FrostRuneGainMetrics() *ResourceMetrics
func (*RunicPowerBar) FrostRuneReadyAt ¶
func (rp *RunicPowerBar) FrostRuneReadyAt(sim *Simulation) time.Duration
func (*RunicPowerBar) FrostRuneSpentAt ¶
func (rp *RunicPowerBar) FrostRuneSpentAt(dur time.Duration) int32
func (*RunicPowerBar) GainDeathRuneMetrics ¶
func (rp *RunicPowerBar) GainDeathRuneMetrics(sim *Simulation, spell *Spell, currRunes int32, newRunes int32)
func (*RunicPowerBar) GainRuneMetrics ¶
func (rp *RunicPowerBar) GainRuneMetrics(sim *Simulation, metrics *ResourceMetrics, gainAmount int8)
GainRuneMetrics should be called after gaining the rune
func (*RunicPowerBar) LaunchRuneRegen ¶
func (rp *RunicPowerBar) LaunchRuneRegen(sim *Simulation, slot int8)
func (*RunicPowerBar) LeftBloodRuneReady ¶
func (rp *RunicPowerBar) LeftBloodRuneReady() bool
func (*RunicPowerBar) MaxRunicPower ¶
func (rp *RunicPowerBar) MaxRunicPower() float64
func (*RunicPowerBar) NormalCurrentBloodRunes ¶
func (rp *RunicPowerBar) NormalCurrentBloodRunes() int32
func (*RunicPowerBar) NormalCurrentFrostRunes ¶
func (rp *RunicPowerBar) NormalCurrentFrostRunes() int32
func (*RunicPowerBar) NormalCurrentRunes ¶
func (rp *RunicPowerBar) NormalCurrentRunes() (int32, int32, int32)
func (*RunicPowerBar) NormalCurrentUnholyRunes ¶
func (rp *RunicPowerBar) NormalCurrentUnholyRunes() int32
func (*RunicPowerBar) NormalFrostRuneReadyAt ¶
func (rp *RunicPowerBar) NormalFrostRuneReadyAt(sim *Simulation) time.Duration
func (*RunicPowerBar) NormalSpentBloodRuneReadyAt ¶
func (rp *RunicPowerBar) NormalSpentBloodRuneReadyAt(sim *Simulation) time.Duration
func (*RunicPowerBar) NormalSpentFrostRuneReadyAt ¶
func (rp *RunicPowerBar) NormalSpentFrostRuneReadyAt(sim *Simulation) time.Duration
func (*RunicPowerBar) NormalSpentUnholyRuneReadyAt ¶
func (rp *RunicPowerBar) NormalSpentUnholyRuneReadyAt(sim *Simulation) time.Duration
func (*RunicPowerBar) NormalUnholyRuneReadyAt ¶
func (rp *RunicPowerBar) NormalUnholyRuneReadyAt(sim *Simulation) time.Duration
func (*RunicPowerBar) OptimalRuneCost ¶
func (rp *RunicPowerBar) OptimalRuneCost(cost RuneCost) RuneCost
func (*RunicPowerBar) PercentRunicPower ¶
func (rp *RunicPowerBar) PercentRunicPower() float64
func (*RunicPowerBar) Print ¶
func (rp *RunicPowerBar) Print()
func (*RunicPowerBar) ReadyDeathRune ¶
func (rp *RunicPowerBar) ReadyDeathRune() int8
ReadyDeathRune returns the slot of first available death rune.
Returns -1 if there are no ready death runes
func (*RunicPowerBar) RegenAllRunes ¶
func (rp *RunicPowerBar) RegenAllRunes(sim *Simulation)
func (*RunicPowerBar) RegenRune ¶
func (rp *RunicPowerBar) RegenRune(regenAt time.Duration, slot int32)
func (*RunicPowerBar) RightBloodRuneReady ¶
func (rp *RunicPowerBar) RightBloodRuneReady() bool
func (*RunicPowerBar) RuneIsDeath ¶
func (rp *RunicPowerBar) RuneIsDeath(slot int8) bool
func (*RunicPowerBar) SetRuneCd ¶ added in v0.1.1
func (rp *RunicPowerBar) SetRuneCd(runeCd time.Duration)
func (*RunicPowerBar) SpendBloodRune ¶
func (rp *RunicPowerBar) SpendBloodRune(sim *Simulation, metrics *ResourceMetrics) int8
func (*RunicPowerBar) SpendDeathRune ¶
func (rp *RunicPowerBar) SpendDeathRune(sim *Simulation, metrics *ResourceMetrics) int8
func (*RunicPowerBar) SpendFrostRune ¶
func (rp *RunicPowerBar) SpendFrostRune(sim *Simulation, metrics *ResourceMetrics) int8
func (*RunicPowerBar) SpendRuneCost ¶
func (rp *RunicPowerBar) SpendRuneCost(sim *Simulation, spell *Spell, cost RuneCost) (int8, int8, int8)
func (*RunicPowerBar) SpendRuneFromKind ¶
func (rp *RunicPowerBar) SpendRuneFromKind(sim *Simulation, rkind RuneKind) int8
func (*RunicPowerBar) SpendRuneMetrics ¶
func (rp *RunicPowerBar) SpendRuneMetrics(sim *Simulation, metrics *ResourceMetrics, spendAmount int8)
SpendRuneMetrics should be called after spending the rune
func (*RunicPowerBar) SpendUnholyRune ¶
func (rp *RunicPowerBar) SpendUnholyRune(sim *Simulation, metrics *ResourceMetrics) int8
func (*RunicPowerBar) SpentBloodRuneReadyAt ¶
func (rp *RunicPowerBar) SpentBloodRuneReadyAt() time.Duration
func (*RunicPowerBar) SpentDeathRuneReadyAt ¶
func (rp *RunicPowerBar) SpentDeathRuneReadyAt() time.Duration
func (*RunicPowerBar) SpentFrostRuneReadyAt ¶
func (rp *RunicPowerBar) SpentFrostRuneReadyAt() time.Duration
func (*RunicPowerBar) SpentUnholyRuneReadyAt ¶
func (rp *RunicPowerBar) SpentUnholyRuneReadyAt() time.Duration
func (*RunicPowerBar) TryRegenRune ¶
func (rp *RunicPowerBar) TryRegenRune(sim *Simulation, newTime time.Duration, slot int32)
func (*RunicPowerBar) UnholyRuneGainMetrics ¶
func (rp *RunicPowerBar) UnholyRuneGainMetrics() *ResourceMetrics
func (*RunicPowerBar) UnholyRuneReadyAt ¶
func (rp *RunicPowerBar) UnholyRuneReadyAt(sim *Simulation) time.Duration
func (*RunicPowerBar) UnholyRuneSpentAt ¶
func (rp *RunicPowerBar) UnholyRuneSpentAt(dur time.Duration) int32
type SettingsCombos ¶
type SettingsCombos struct { Class proto.Class Races []proto.Race GearSets []GearSetCombo SpecOptions []SpecOptionsCombo Buffs []BuffsCombo Encounters []EncounterCombo SimOptions *proto.SimOptions IsHealer bool }
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 Shield ¶
type Shield struct { Spell *Spell // Embed Aura so we can use Ishieldctive/Refresh/etc directly. *Aura }
Rerpresents an absorption effect, e.g. Power Word: Shield.
func (*Shield) Apply ¶
func (shield *Shield) Apply(sim *Simulation, shieldAmount float64)
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) IsExecutePhase20 ¶
func (sim *Simulation) IsExecutePhase20() bool
func (*Simulation) IsExecutePhase25 ¶
func (sim *Simulation) IsExecutePhase25() bool
func (*Simulation) IsExecutePhase35 ¶
func (sim *Simulation) IsExecutePhase35() 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, int))
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 SchoolIndex stats.SchoolIndex // Controls which effects can proc from this spell. ProcMask ProcMask // Flags Flags SpellFlag // Speed in yards/second. Spell missile speeds can be found in the game data. // Example: https://wow.tools/dbc/?dbc=spellmisc&build=3.4.0.44996 MissileSpeed float64 // 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 // Performs the actions of this spell. ApplyEffects ApplySpellResults // The current or most recent cast data. CurCast Cast BonusHitRating float64 BonusCritRating float64 BonusSpellPower float64 BonusExpertiseRating float64 BonusArmorPenRating float64 CastTimeMultiplier float64 CostMultiplier float64 DamageMultiplier float64 DamageMultiplierAdditive float64 CritMultiplier float64 // Multiplier for all threat generated by this effect. ThreatMultiplier float64 // Adds a fixed amount of threat to this spell, before multipliers. FlatThreatBonus float64 // contains filtered or unexported fields }
func (*Spell) ApplyAOEThreat ¶
func (*Spell) ApplyAOEThreatIgnoreMultipliers ¶
func (*Spell) ApplyCostModifiers ¶
func (*Spell) ApplyPostOutcomeDamageModifiers ¶
func (spell *Spell) ApplyPostOutcomeDamageModifiers(sim *Simulation, result *SpellResult)
func (*Spell) AttackerDamageMultiplier ¶ added in v0.1.1
func (spell *Spell) AttackerDamageMultiplier(attackTable *AttackTable) float64
Returns the combined attacker modifiers.
func (*Spell) BloodRuneMetrics ¶
func (spell *Spell) BloodRuneMetrics() *ResourceMetrics
func (*Spell) BonusWeaponDamage ¶
func (*Spell) CalcAndDealDamage ¶ added in v0.1.1
func (spell *Spell) CalcAndDealDamage(sim *Simulation, target *Unit, baseDamage float64, outcomeApplier OutcomeApplier) *SpellResult
func (*Spell) CalcAndDealHealing ¶ added in v0.1.1
func (spell *Spell) CalcAndDealHealing(sim *Simulation, target *Unit, baseHealing float64, outcomeApplier OutcomeApplier) *SpellResult
func (*Spell) CalcAndDealOutcome ¶ added in v0.1.1
func (spell *Spell) CalcAndDealOutcome(sim *Simulation, target *Unit, outcomeApplier OutcomeApplier) *SpellResult
func (*Spell) CalcAndDealPeriodicDamage ¶ added in v0.1.1
func (spell *Spell) CalcAndDealPeriodicDamage(sim *Simulation, target *Unit, baseDamage float64, outcomeApplier OutcomeApplier) *SpellResult
func (*Spell) CalcAndDealPeriodicHealing ¶ added in v0.1.1
func (spell *Spell) CalcAndDealPeriodicHealing(sim *Simulation, target *Unit, baseHealing float64, outcomeApplier OutcomeApplier) *SpellResult
func (*Spell) CalcDamage ¶
func (spell *Spell) CalcDamage(sim *Simulation, target *Unit, baseDamage float64, outcomeApplier OutcomeApplier) *SpellResult
func (*Spell) CalcHealing ¶
func (spell *Spell) CalcHealing(sim *Simulation, target *Unit, baseHealing float64, outcomeApplier OutcomeApplier) *SpellResult
func (*Spell) CalcOutcome ¶
func (spell *Spell) CalcOutcome(sim *Simulation, target *Unit, outcomeApplier OutcomeApplier) *SpellResult
For spells that do no damage but still have a hit/miss check.
func (*Spell) CalcPeriodicDamage ¶ added in v0.1.1
func (spell *Spell) CalcPeriodicDamage(sim *Simulation, target *Unit, baseDamage float64, outcomeApplier OutcomeApplier) *SpellResult
func (*Spell) CasterHealingMultiplier ¶
func (*Spell) ComboPointMetrics ¶
func (spell *Spell) ComboPointMetrics() *ResourceMetrics
func (*Spell) CurDamagePerCast ¶
Metrics for the current iteration
func (*Spell) DealDamage ¶
func (spell *Spell) DealDamage(sim *Simulation, result *SpellResult)
func (*Spell) DealHealing ¶
func (spell *Spell) DealHealing(sim *Simulation, result *SpellResult)
func (*Spell) DealOutcome ¶
func (spell *Spell) DealOutcome(sim *Simulation, result *SpellResult)
func (*Spell) DealPeriodicDamage ¶ added in v0.1.1
func (spell *Spell) DealPeriodicDamage(sim *Simulation, result *SpellResult)
func (*Spell) DealPeriodicHealing ¶ added in v0.1.1
func (spell *Spell) DealPeriodicHealing(sim *Simulation, result *SpellResult)
func (*Spell) DeathRuneMetrics ¶
func (spell *Spell) DeathRuneMetrics() *ResourceMetrics
func (*Spell) DisposeResult ¶ added in v0.1.1
func (spell *Spell) DisposeResult(result *SpellResult)
func (*Spell) ExpectedDamage ¶ added in v0.1.1
func (spell *Spell) ExpectedDamage(sim *Simulation, target *Unit) float64
func (*Spell) ExpertisePercentage ¶
func (*Spell) FrostRuneMetrics ¶
func (spell *Spell) FrostRuneMetrics() *ResourceMetrics
func (*Spell) HealingCritChance ¶ added in v0.1.1
func (*Spell) HealingCritCheck ¶ added in v0.1.1
func (spell *Spell) HealingCritCheck(sim *Simulation) bool
func (*Spell) HealingPower ¶
func (*Spell) HealthMetrics ¶
func (spell *Spell) HealthMetrics(target *Unit) *ResourceMetrics
func (*Spell) IsReady ¶
func (spell *Spell) IsReady(sim *Simulation) bool
func (*Spell) MagicCritCheck ¶ added in v0.1.1
func (spell *Spell) MagicCritCheck(sim *Simulation, target *Unit) bool
func (*Spell) MagicHitCheck ¶
func (spell *Spell) MagicHitCheck(sim *Simulation, attackTable *AttackTable) bool
func (*Spell) MeleeAttackPower ¶
func (*Spell) NewResult ¶ added in v0.1.1
func (spell *Spell) NewResult(target *Unit) *SpellResult
func (*Spell) OutcomeAlwaysHit ¶
func (spell *Spell) OutcomeAlwaysHit(_ *Simulation, result *SpellResult, _ *AttackTable)
func (*Spell) OutcomeAlwaysMiss ¶ added in v0.1.1
func (spell *Spell) OutcomeAlwaysMiss(_ *Simulation, result *SpellResult, _ *AttackTable)
func (*Spell) OutcomeCritFixedChance ¶
func (spell *Spell) OutcomeCritFixedChance(critChance float64) OutcomeApplier
func (*Spell) OutcomeEnemyMeleeWhite ¶ added in v0.1.1
func (spell *Spell) OutcomeEnemyMeleeWhite(sim *Simulation, result *SpellResult, attackTable *AttackTable)
func (*Spell) OutcomeExpectedMagicAlwaysHit ¶ added in v0.1.1
func (spell *Spell) OutcomeExpectedMagicAlwaysHit(sim *Simulation, result *SpellResult, attackTable *AttackTable)
func (*Spell) OutcomeExpectedMagicCrit ¶ added in v0.1.1
func (spell *Spell) OutcomeExpectedMagicCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)
func (*Spell) OutcomeExpectedMagicHit ¶ added in v0.1.1
func (spell *Spell) OutcomeExpectedMagicHit(sim *Simulation, result *SpellResult, attackTable *AttackTable)
func (*Spell) OutcomeExpectedMagicHitAndCrit ¶ added in v0.1.1
func (spell *Spell) OutcomeExpectedMagicHitAndCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)
func (*Spell) OutcomeExpectedTick ¶ added in v0.1.1
func (spell *Spell) OutcomeExpectedTick(sim *Simulation, result *SpellResult, attackTable *AttackTable)
func (*Spell) OutcomeHealingCrit ¶
func (spell *Spell) OutcomeHealingCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)
func (*Spell) OutcomeMagicCrit ¶
func (spell *Spell) OutcomeMagicCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)
func (*Spell) OutcomeMagicHit ¶
func (spell *Spell) OutcomeMagicHit(sim *Simulation, result *SpellResult, attackTable *AttackTable)
func (*Spell) OutcomeMagicHitAndCrit ¶
func (spell *Spell) OutcomeMagicHitAndCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)
func (*Spell) OutcomeMeleeSpecialCritOnly ¶
func (spell *Spell) OutcomeMeleeSpecialCritOnly(sim *Simulation, result *SpellResult, attackTable *AttackTable)
func (*Spell) OutcomeMeleeSpecialHit ¶ added in v0.1.1
func (spell *Spell) OutcomeMeleeSpecialHit(sim *Simulation, result *SpellResult, attackTable *AttackTable)
func (*Spell) OutcomeMeleeSpecialHitAndCrit ¶ added in v0.1.1
func (spell *Spell) OutcomeMeleeSpecialHitAndCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)
func (*Spell) OutcomeMeleeSpecialNoBlockDodgeParry ¶ added in v0.1.1
func (spell *Spell) OutcomeMeleeSpecialNoBlockDodgeParry(sim *Simulation, result *SpellResult, attackTable *AttackTable)
func (*Spell) OutcomeMeleeSpecialNoBlockDodgeParryNoCrit ¶ added in v0.1.1
func (spell *Spell) OutcomeMeleeSpecialNoBlockDodgeParryNoCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)
func (*Spell) OutcomeMeleeWeaponSpecialHitAndCrit ¶ added in v0.1.1
func (spell *Spell) OutcomeMeleeWeaponSpecialHitAndCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)
Like OutcomeMeleeSpecialHitAndCrit, but blocks prevent crits (all weapon damage based attacks).
func (*Spell) OutcomeMeleeWeaponSpecialNoCrit ¶ added in v0.1.1
func (spell *Spell) OutcomeMeleeWeaponSpecialNoCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)
func (*Spell) OutcomeMeleeWhite ¶
func (spell *Spell) OutcomeMeleeWhite(sim *Simulation, result *SpellResult, attackTable *AttackTable)
func (*Spell) OutcomeRangedCritOnly ¶
func (spell *Spell) OutcomeRangedCritOnly(sim *Simulation, result *SpellResult, attackTable *AttackTable)
func (*Spell) OutcomeRangedHit ¶
func (spell *Spell) OutcomeRangedHit(sim *Simulation, result *SpellResult, attackTable *AttackTable)
func (*Spell) OutcomeRangedHitAndCrit ¶
func (spell *Spell) OutcomeRangedHitAndCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)
func (*Spell) OutcomeTickMagicHit ¶ added in v0.1.1
func (spell *Spell) OutcomeTickMagicHit(sim *Simulation, result *SpellResult, attackTable *AttackTable)
func (*Spell) PhysicalCritChance ¶ added in v0.1.1
func (spell *Spell) PhysicalCritChance(target *Unit, attackTable *AttackTable) float64
func (*Spell) PhysicalCritCheck ¶ added in v0.1.1
func (spell *Spell) PhysicalCritCheck(sim *Simulation, target *Unit, attackTable *AttackTable) bool
func (*Spell) PhysicalHitChance ¶
func (*Spell) RangedAttackPower ¶
func (*Spell) ResistanceMultiplier ¶
func (spell *Spell) ResistanceMultiplier(sim *Simulation, isPeriodic bool, attackTable *AttackTable) float64
Modifies damage based on Armor or Magic resistances, depending on the damage type.
func (*Spell) RunicPowerMetrics ¶
func (spell *Spell) RunicPowerMetrics() *ResourceMetrics
func (*Spell) SkipCastAndApplyEffects ¶
func (spell *Spell) SkipCastAndApplyEffects(sim *Simulation, target *Unit)
Skips the actual cast and applies spell effects immediately.
func (*Spell) SpellChanceToMiss ¶ added in v0.1.1
func (spell *Spell) SpellChanceToMiss(attackTable *AttackTable) float64
func (*Spell) SpellCritChance ¶ added in v0.1.1
func (*Spell) SpellHitChance ¶
func (*Spell) SpellPower ¶
func (*Spell) TargetDamageMultiplier ¶ added in v0.1.1
func (spell *Spell) TargetDamageMultiplier(attackTable *AttackTable, isPeriodic bool) float64
func (*Spell) ThreatFromDamage ¶ added in v0.1.1
func (spell *Spell) ThreatFromDamage(outcome HitOutcome, damage float64) float64
func (*Spell) TimeToReady ¶
func (spell *Spell) TimeToReady(sim *Simulation) time.Duration
func (*Spell) UnholyRuneMetrics ¶
func (spell *Spell) UnholyRuneMetrics() *ResourceMetrics
func (*Spell) WaitTravelTime ¶
func (spell *Spell) WaitTravelTime(sim *Simulation, callback func(*Simulation))
type SpellConfig ¶
type SpellConfig struct { // See definition of Spell (below) for comments on these. ActionID SpellSchool SpellSchool ProcMask ProcMask Flags SpellFlag MissileSpeed float64 ResourceType stats.Stat BaseCost float64 Cast CastConfig BonusHitRating float64 BonusCritRating float64 BonusSpellPower float64 BonusExpertiseRating float64 BonusArmorPenRating float64 DamageMultiplier float64 DamageMultiplierAdditive float64 CritMultiplier float64 ThreatMultiplier float64 FlatThreatBonus float64 // Performs the actions of this spell. ApplyEffects ApplySpellResults // Optional field. Calculates expected average damage. ExpectedDamage ExpectedDamageCalculator }
type SpellFlag ¶
type SpellFlag uint32
Other flags
const ( SpellFlagNone SpellFlag = 0 SpellFlagIgnoreResists SpellFlag = 1 << iota // skip spell resist/armor SpellFlagIgnoreTargetModifiers // skip target damage modifiers SpellFlagIgnoreAttackerModifiers // skip attacker damage modifiers SpellFlagApplyArmorReduction // Forces damage reduction from armor to apply, even if it otherwise wouldn't. SpellFlagCannotBeDodged // Ignores dodge in physical hit rolls SpellFlagIncludeTargetBonusDamage // Spell benefits from Gift of Arthas and Hemorrhage. SpellFlagBinary // Does not do partial resists and could need a different hit roll. SpellFlagChanneled // Spell is channeled SpellFlagDisease // Spell is categorized as disease SpellFlagMeleeMetrics // Marks a spell as a melee ability for metrics. SpellFlagNoOnCastComplete // Disables OnCastComplete and AfterCast callbacks. SpellFlagNoMetrics // Disables metrics for a spell. SpellFlagNoLogs // Disables logs for a spell. // Used to let agents categorize their spells. SpellFlagAgentReserved1 SpellFlagAgentReserved2 SpellFlagAgentReserved3 SpellFlagAgentReserved4 SpellFlagIgnoreModifiers = SpellFlagIgnoreAttackerModifiers | SpellFlagIgnoreTargetModifiers )
type SpellMetrics ¶
type SpellMetrics struct { Casts int32 Misses int32 Hits int32 Crits int32 Crushes int32 Dodges int32 Glances int32 Parries int32 Blocks int32 TotalDamage float64 // Damage done by all casts of this spell. TotalThreat float64 // Threat generated by all casts of this spell. TotalHealing float64 // Healing done by all casts of this spell. TotalShielding float64 // Shielding done by all casts of this spell. TotalCastTime time.Duration }
Metric totals for a spell against a specific target, for the current iteration.
type SpellRegisteredHandler ¶
type SpellRegisteredHandler func(spell *Spell)
type SpellResult ¶ added in v0.1.1
type SpellResult struct { // Target of the spell. Target *Unit // Results Outcome HitOutcome Damage float64 // Damage done by this cast. Threat float64 // The amount of threat generated by this cast. ResistanceMultiplier float64 // Partial Resists / Armor multiplier PreOutcomeDamage float64 // Damage done by this cast before Outcome is applied // contains filtered or unexported fields }
func (*SpellResult) DamageString ¶ added in v0.1.1
func (result *SpellResult) DamageString() string
func (*SpellResult) DidCrit ¶ added in v0.1.1
func (result *SpellResult) DidCrit() bool
func (*SpellResult) HealingString ¶ added in v0.1.1
func (result *SpellResult) HealingString() string
func (*SpellResult) Landed ¶ added in v0.1.1
func (result *SpellResult) Landed() bool
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
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) GetSeed ¶
func (sm *SplitMix64) GetSeed() int64
func (*SplitMix64) Next ¶
func (sm *SplitMix64) Next() uint64
func (*SplitMix64) NextFloat64 ¶
func (sm *SplitMix64) NextFloat64() float64
func (*SplitMix64) Seed ¶
func (sm *SplitMix64) Seed(s int64)
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 Hps 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) AfterCast ¶
func (at *Target) AfterCast(sim *Simulation, spell *Spell)
Invokes the AfterCast event for all tracked Auras.
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) HasActiveAuraWithTagExcludingAura ¶
func (*Target) HasAuraWithTag ¶
func (*Target) Initialize ¶
func (target *Target) Initialize()
func (*Target) NextEnergyTickAt ¶
func (*Target) NextTarget ¶
func (*Target) NumActiveAurasWithTag ¶
func (*Target) OnAutoAttack ¶
func (target *Target) OnAutoAttack(sim *Simulation, spell *Spell)
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) OnHealDealt ¶
func (at *Target) OnHealDealt(sim *Simulation, spell *Spell, result *SpellResult)
Invokes the OnHeal event for all tracked Auras.
func (*Target) OnHealTaken ¶
func (at *Target) OnHealTaken(sim *Simulation, spell *Spell, result *SpellResult)
func (*Target) OnPeriodicDamageDealt ¶
func (at *Target) OnPeriodicDamageDealt(sim *Simulation, spell *Spell, result *SpellResult)
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, result *SpellResult)
func (*Target) OnPeriodicHealDealt ¶
func (at *Target) OnPeriodicHealDealt(sim *Simulation, spell *Spell, result *SpellResult)
Invokes the OnPeriodicHeal
As a debuff when target is being hit by dot. As a buff when caster's dots are ticking.
func (*Target) OnPeriodicHealTaken ¶
func (at *Target) OnPeriodicHealTaken(sim *Simulation, spell *Spell, result *SpellResult)
func (*Target) OnSpellHitDealt ¶
func (at *Target) OnSpellHitDealt(sim *Simulation, spell *Spell, result *SpellResult)
Invokes the OnSpellHit event for all tracked Auras.
func (*Target) OnSpellHitTaken ¶
func (at *Target) OnSpellHitTaken(sim *Simulation, spell *Spell, result *SpellResult)
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 TargetDummy ¶
type TargetDummy struct {
Character
}
func NewTargetDummy ¶
func NewTargetDummy(dummyIndex int, party *Party, partyIndex int) *TargetDummy
func (*TargetDummy) AddComboPoints ¶
func (eb *TargetDummy) AddComboPoints(sim *Simulation, pointsToAdd int32, metrics *ResourceMetrics)
func (*TargetDummy) AddEnergy ¶
func (eb *TargetDummy) AddEnergy(sim *Simulation, amount float64, metrics *ResourceMetrics)
func (*TargetDummy) AddMajorCooldown ¶
func (mcdm *TargetDummy) AddMajorCooldown(mcd MajorCooldown)
Registers a major cooldown to the Character, which will be automatically used when available.
func (*TargetDummy) AddPartyBuffs ¶
func (td *TargetDummy) AddPartyBuffs(partyBuffs *proto.PartyBuffs)
func (*TargetDummy) AddRage ¶
func (rb *TargetDummy) AddRage(sim *Simulation, amount float64, metrics *ResourceMetrics)
func (*TargetDummy) AddRaidBuffs ¶
func (td *TargetDummy) AddRaidBuffs(raidBuffs *proto.RaidBuffs)
func (*TargetDummy) AfterCast ¶
func (at *TargetDummy) AfterCast(sim *Simulation, spell *Spell)
Invokes the AfterCast event for all tracked Auras.
func (*TargetDummy) ApplyGearBonuses ¶
func (td *TargetDummy) ApplyGearBonuses()
func (*TargetDummy) ApplyTalents ¶
func (td *TargetDummy) ApplyTalents()
func (*TargetDummy) ComboPoints ¶
func (eb *TargetDummy) ComboPoints() int32
func (*TargetDummy) CurrentEnergy ¶
func (eb *TargetDummy) CurrentEnergy() float64
func (*TargetDummy) CurrentHealth ¶
func (hb *TargetDummy) CurrentHealth() float64
func (*TargetDummy) CurrentHealthPercent ¶
func (hb *TargetDummy) CurrentHealthPercent() float64
func (*TargetDummy) CurrentRage ¶
func (rb *TargetDummy) CurrentRage() float64
func (*TargetDummy) 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 (*TargetDummy) DisableAllEnabledCooldowns ¶
func (mcdm *TargetDummy) 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 (*TargetDummy) DisableMajorCooldown ¶
func (mcdm *TargetDummy) DisableMajorCooldown(actionID ActionID)
func (*TargetDummy) EnableAllCooldowns ¶
func (mcdm *TargetDummy) EnableAllCooldowns(mcdsToEnable []*MajorCooldown)
func (*TargetDummy) EnableMajorCooldown ¶
func (mcdm *TargetDummy) EnableMajorCooldown(actionID ActionID)
func (*TargetDummy) GainHealth ¶
func (hb *TargetDummy) GainHealth(sim *Simulation, amount float64, metrics *ResourceMetrics)
func (*TargetDummy) GetActiveAuraWithTag ¶
func (*TargetDummy) GetAurasWithTag ¶
func (*TargetDummy) GetCharacter ¶
func (td *TargetDummy) GetCharacter() *Character
func (*TargetDummy) GetInitialMajorCooldown ¶
func (mcdm *TargetDummy) GetInitialMajorCooldown(actionID ActionID) MajorCooldown
func (*TargetDummy) GetMajorCooldown ¶
func (mcdm *TargetDummy) GetMajorCooldown(actionID ActionID) *MajorCooldown
func (*TargetDummy) GetMajorCooldownIDs ¶
func (*TargetDummy) GetMajorCooldowns ¶
func (mcdm *TargetDummy) GetMajorCooldowns() []*MajorCooldown
Returns all MCDs.
func (*TargetDummy) HasActiveAura ¶
func (*TargetDummy) HasActiveAuraWithTag ¶
func (*TargetDummy) HasActiveAuraWithTagExcludingAura ¶
func (*TargetDummy) HasAuraWithTag ¶
func (*TargetDummy) HasMajorCooldown ¶
func (*TargetDummy) Initialize ¶
func (td *TargetDummy) Initialize()
func (*TargetDummy) NextEnergyTickAt ¶
func (*TargetDummy) NumActiveAurasWithTag ¶
func (*TargetDummy) OnAutoAttack ¶
func (td *TargetDummy) OnAutoAttack(sim *Simulation, spell *Spell)
func (*TargetDummy) OnCastComplete ¶
func (at *TargetDummy) OnCastComplete(sim *Simulation, spell *Spell)
Invokes the OnCastComplete event for all tracked Auras.
func (*TargetDummy) OnGCDReady ¶
func (td *TargetDummy) OnGCDReady(sim *Simulation)
func (*TargetDummy) OnHealDealt ¶
func (at *TargetDummy) OnHealDealt(sim *Simulation, spell *Spell, result *SpellResult)
Invokes the OnHeal event for all tracked Auras.
func (*TargetDummy) OnHealTaken ¶
func (at *TargetDummy) OnHealTaken(sim *Simulation, spell *Spell, result *SpellResult)
func (*TargetDummy) OnPeriodicDamageDealt ¶
func (at *TargetDummy) OnPeriodicDamageDealt(sim *Simulation, spell *Spell, result *SpellResult)
Invokes the OnPeriodicDamage
As a debuff when target is being hit by dot. As a buff when caster's dots are ticking.
func (*TargetDummy) OnPeriodicDamageTaken ¶
func (at *TargetDummy) OnPeriodicDamageTaken(sim *Simulation, spell *Spell, result *SpellResult)
func (*TargetDummy) OnPeriodicHealDealt ¶
func (at *TargetDummy) OnPeriodicHealDealt(sim *Simulation, spell *Spell, result *SpellResult)
Invokes the OnPeriodicHeal
As a debuff when target is being hit by dot. As a buff when caster's dots are ticking.
func (*TargetDummy) OnPeriodicHealTaken ¶
func (at *TargetDummy) OnPeriodicHealTaken(sim *Simulation, spell *Spell, result *SpellResult)
func (*TargetDummy) OnSpellHitDealt ¶
func (at *TargetDummy) OnSpellHitDealt(sim *Simulation, spell *Spell, result *SpellResult)
Invokes the OnSpellHit event for all tracked Auras.
func (*TargetDummy) OnSpellHitTaken ¶
func (at *TargetDummy) OnSpellHitTaken(sim *Simulation, spell *Spell, result *SpellResult)
func (*TargetDummy) RegisterResetEffect ¶
func (at *TargetDummy) RegisterResetEffect(resetEffect ResetEffect)
Registers a callback to this Character which will be invoked on every Sim reset.
func (*TargetDummy) RemoveHealth ¶
func (hb *TargetDummy) RemoveHealth(sim *Simulation, amount float64)
func (*TargetDummy) Reset ¶
func (td *TargetDummy) Reset(sim *Simulation)
func (*TargetDummy) ResetEnergyTick ¶
func (eb *TargetDummy) ResetEnergyTick(sim *Simulation)
Gives an immediate partial energy tick and restarts the tick timer.
func (*TargetDummy) ShouldRefreshAuraWithTagAtPriority ¶
func (at *TargetDummy) 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 (*TargetDummy) SpendComboPoints ¶
func (eb *TargetDummy) SpendComboPoints(sim *Simulation, metrics *ResourceMetrics)
func (*TargetDummy) SpendEnergy ¶
func (eb *TargetDummy) SpendEnergy(sim *Simulation, amount float64, metrics *ResourceMetrics)
func (*TargetDummy) SpendRage ¶
func (rb *TargetDummy) SpendRage(sim *Simulation, amount float64, metrics *ResourceMetrics)
func (*TargetDummy) TryUseCooldowns ¶
func (mcdm *TargetDummy) TryUseCooldowns(sim *Simulation)
func (*TargetDummy) UpdateMajorCooldowns ¶
func (mcdm *TargetDummy) UpdateMajorCooldowns()
This function should be called if the CD for a major cooldown changes outside of the TryActivate() call.
type TargetedActionMetrics ¶
type TargetedActionMetrics struct { UnitIndex int32 Casts int32 Hits int32 Crits int32 Misses int32 Dodges int32 Parries int32 Blocks int32 Glances int32 Damage float64 Threat float64 Healing float64 Shielding float64 CastTime time.Duration }
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
func RotationTestSuiteGenerator ¶
func RotationTestSuiteGenerator(config CharacterSuiteConfig) TestGenerator
type Thresholds ¶
type Thresholds [4]Threshold
func (Thresholds) String ¶
func (x Thresholds) String() string
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 // Unique index of this unit among all units in the environment. // This is used as the index for attack tables. UnitIndex int32 // Unique label for logging. Label string Level int32 // Level of Unit, e.g. Bosses are 83. MobType proto.MobType // How far this unit is from its target(s). Measured in yards, this is used // for calculating spell travel time for certain spells. DistanceFromTarget float64 // Environment in which this Unit exists. This will be nil until after the // construction phase. Env *Environment // Provides stat dependency management behavior. stats.StatDependencyManager PseudoStats stats.PseudoStats RunicPowerBar // All spells that can be cast by this unit. Spellbook []*Spell // Pets owned by this Unit. Pets []PetAgent // 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 DynamicDamageTakenModifiers []DynamicDamageTakenModifier 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) AddBonusRangedCritRating ¶
func (*Unit) AddBonusRangedHitRating ¶
func (*Unit) AddComboPoints ¶
func (eb *Unit) AddComboPoints(sim *Simulation, pointsToAdd int32, metrics *ResourceMetrics)
func (*Unit) AddDynamicDamageTakenModifier ¶
func (unit *Unit) AddDynamicDamageTakenModifier(ddtm DynamicDamageTakenModifier)
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) 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, bonus stats.Stats)
func (*Unit) AfterCast ¶
func (at *Unit) AfterCast(sim *Simulation, spell *Spell)
Invokes the AfterCast event for all tracked Auras.
func (*Unit) ApplyCastSpeedForSpell ¶
func (*Unit) ArmorPenetrationPercentage ¶
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) DisableDynamicStatDep ¶
func (unit *Unit) DisableDynamicStatDep(sim *Simulation, dep *stats.StatDependency)
func (*Unit) DoneWaitingForEnergy ¶
func (unit *Unit) DoneWaitingForEnergy(sim *Simulation) bool
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) EnableDynamicStatDep ¶
func (unit *Unit) EnableDynamicStatDep(sim *Simulation, dep *stats.StatDependency)
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(options RageBarOptions, onRageGain OnRageGain)
func (*Unit) EnableRunicPowerBar ¶
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) GetCurrentPowerBar ¶
func (unit *Unit) GetCurrentPowerBar() PowerBarType
func (*Unit) GetDiminishedDodgeChance ¶
func (*Unit) GetDiminishedMissChance ¶
func (*Unit) GetDiminishedParryChance ¶
func (*Unit) GetMetricsProto ¶
func (at *Unit) GetMetricsProto(numIterations int32) []*proto.AuraMetrics
func (*Unit) GetOpponents ¶
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) GetSpellsMatchingSchool ¶
func (unit *Unit) GetSpellsMatchingSchool(school SpellSchool) []*Spell
func (*Unit) HardcastWaitUntil ¶
func (unit *Unit) HardcastWaitUntil(sim *Simulation, readyTime time.Duration, onComplete CastFunc)
func (*Unit) HasActiveAura ¶
func (*Unit) HasActiveAuraWithTag ¶
func (*Unit) HasActiveAuraWithTagExcludingAura ¶
func (*Unit) HasAuraWithTag ¶
func (*Unit) HasEnergyBar ¶
func (*Unit) HasHealthBar ¶
func (*Unit) HasManaBar ¶
func (*Unit) HasRageBar ¶
func (*Unit) HasRunicPowerBar ¶
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) IsOpponent ¶
func (*Unit) IsWaitingForEnergy ¶
func (*Unit) IsWaitingForMana ¶
func (*Unit) Log ¶
func (unit *Unit) Log(sim *Simulation, message string, vals ...interface{})
func (*Unit) MHNormalizedWeaponDamage ¶ added in v0.1.1
func (unit *Unit) MHNormalizedWeaponDamage(sim *Simulation, attackPower float64) float64
func (*Unit) MHWeaponDamage ¶
func (unit *Unit) MHWeaponDamage(sim *Simulation, attackPower float64) float64
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) MaxMana ¶
Gets the Maxiumum mana including bonus and temporary affects that would increase your mana pool.
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) NewBloodRuneMetrics ¶
func (unit *Unit) NewBloodRuneMetrics(actionID ActionID) *ResourceMetrics
func (*Unit) NewComboPointMetrics ¶
func (unit *Unit) NewComboPointMetrics(actionID ActionID) *ResourceMetrics
func (*Unit) NewDeathRuneMetrics ¶
func (unit *Unit) NewDeathRuneMetrics(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) NewFrostRuneMetrics ¶
func (unit *Unit) NewFrostRuneMetrics(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) NewRunicPowerMetrics ¶
func (unit *Unit) NewRunicPowerMetrics(actionID ActionID) *ResourceMetrics
func (*Unit) NewUnholyRuneMetrics ¶
func (unit *Unit) NewUnholyRuneMetrics(actionID ActionID) *ResourceMetrics
func (*Unit) NextEnergyTickAt ¶
func (*Unit) NumActiveAurasWithTag ¶
func (*Unit) OHNormalizedWeaponDamage ¶ added in v0.1.1
func (unit *Unit) OHNormalizedWeaponDamage(sim *Simulation, attackPower float64) float64
func (*Unit) OHWeaponDamage ¶
func (unit *Unit) OHWeaponDamage(sim *Simulation, attackPower float64) float64
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) OnHealDealt ¶
func (at *Unit) OnHealDealt(sim *Simulation, spell *Spell, result *SpellResult)
Invokes the OnHeal event for all tracked Auras.
func (*Unit) OnHealTaken ¶
func (at *Unit) OnHealTaken(sim *Simulation, spell *Spell, result *SpellResult)
func (*Unit) OnPeriodicDamageDealt ¶
func (at *Unit) OnPeriodicDamageDealt(sim *Simulation, spell *Spell, result *SpellResult)
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, result *SpellResult)
func (*Unit) OnPeriodicHealDealt ¶
func (at *Unit) OnPeriodicHealDealt(sim *Simulation, spell *Spell, result *SpellResult)
Invokes the OnPeriodicHeal
As a debuff when target is being hit by dot. As a buff when caster's dots are ticking.
func (*Unit) OnPeriodicHealTaken ¶
func (at *Unit) OnPeriodicHealTaken(sim *Simulation, spell *Spell, result *SpellResult)
func (*Unit) OnSpellHitDealt ¶
func (at *Unit) OnSpellHitDealt(sim *Simulation, spell *Spell, result *SpellResult)
Invokes the OnSpellHit event for all tracked Auras.
func (*Unit) OnSpellHitTaken ¶
func (at *Unit) OnSpellHitTaken(sim *Simulation, spell *Spell, result *SpellResult)
func (*Unit) OnSpellRegistered ¶
func (unit *Unit) OnSpellRegistered(handler SpellRegisteredHandler)
func (*Unit) RangedSwingSpeed ¶
func (*Unit) RangedWeaponDamage ¶
func (unit *Unit) RangedWeaponDamage(sim *Simulation, attackPower float64) float64
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) SetCurrentPowerBar ¶
func (unit *Unit) SetCurrentPowerBar(bar PowerBarType)
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) WaitForEnergy ¶
func (unit *Unit) WaitForEnergy(sim *Simulation, desiredEnergy float64)
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) AddOOMTime ¶
func (unitMetrics *UnitMetrics) AddOOMTime(sim *Simulation, dur time.Duration)
func (*UnitMetrics) MarkOOM ¶
func (unitMetrics *UnitMetrics) MarkOOM(sim *Simulation)
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 MeleeAttackRatingPerDamage 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
- avoid_dr.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
- presim.go
- professions.go
- racials.go
- rage.go
- raid.go
- rand.go
- runic_power.go
- runic_power_helper.go
- shield.go
- sim.go
- spell.go
- spell_outcome.go
- spell_resistances.go
- spell_result.go
- statweight.go
- target.go
- target_ai.go
- target_dummy.go
- test_generators.go
- test_suite.go
- test_utils.go
- unit.go
- utils.go