core

package
v1.0.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2026 License: MIT Imports: 31 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Proto-based function interface for the simulator

Functions for creating common types of auras.

Index

Constants

View Source
const (
	DenseSharpeningStoneID int32 = 12404
	DenseWeightstoneID     int32 = 12643
)
View Source
const (
	ResistanceCategoryArcane = "ResistanceArcane"
	ResistanceCategoryFire   = "ResistanceFire"
	ResistanceCategoryFrost  = "ResistanceFrost"
	ResistanceCategoryNature = "ResistanceNature"
	ResistanceCategoryShadow = "ResistanceShadow"
)

Exclusive categories for resistance buffs — ensures only the highest value applies per school.

View Source
const (
	ElixirStatCategory = "ElixirStat"
	ElixirCritCategory = "ElixirCrit"
)

The categories the elixirs, the scrolls and the consumables that count with them bid in: each stat counts only the strongest one's amount, and the crit only one elixir's. A raid buff whose manifest row names an ElixirCategory bids its stats there as well without counting (spelldata.Overwrites), so a consumable that grants no more adds nothing under it (R-0054).

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

	ProcMaskSpecial = ProcMaskMeleeOrRangedSpecial | ProcMaskSpellDamage
)
View Source
const (
	OutcomePartial = outcomePartialSteps | OutcomePartialBonus
	OutcomeLanded  = OutcomeHit | OutcomeCrit | OutcomeCrush | OutcomeGlance | OutcomeBlock
)
View Source
const (
	CooldownPriorityLow     = -1000
	CooldownPriorityDefault = 0
)
View Source
const (
	MovementStart = iota
	MovementUpdate
	MovementEnd
)
View Source
const (
	BaseRageHitFactor     = 3.46
	TwoHandRageHitFactor  = 4.5
	TwoHandRageMultiplier = TwoHandRageHitFactor / BaseRageHitFactor
	// A critical auto attack adds this share of its whole rage, the two-hand multiplier and the off-hand
	// halving included, for every rage user (the game files' Rule of Rage (DND) 1322574 states 100; the
	// spell store does not carry it). A two-hand crit gives twice the swing's rage, a bear's swing with any
	// weapon included, and an off-hand crit twice the off-hand's halved share (EV-0053, EV-0037).
	CritRageBonus = 1.0
)
View Source
const (
	StatWeightZ90                   = 1.645 // The two-sided 90% interval, the ± shown behind each EP.
	StatWeightMaxTopUpPasses        = 3     // The first top-up, which sizes from the probe alone, and two that resize from the runs so far.
	StatWeightTargetProbeIterations = 1000  // The probe's iterations with a target, both sides together; the request's own count plays no part.
)

gen_db -gen=go-to-ts writes these to the UI as STAT_WEIGHT_*, which the stat sweep's Target ± also runs by.

View Source
const (
	WeaponTestSwordID int32 = 990901 + iota
	WeaponTestDaggerID
	WeaponTestShieldID
	WeaponTestBowID
)
View Source
const ArmorPenPerPercentArmor = 5.92
View Source
const BleedAuraTag = "Bleed"

The tag every bleed Dot's aura carries (SpellFlagBleed), any caster's and an item proc's included, so HasActiveAuraWithTag says whether a unit is bleeding. A bleed's last tick, dealt at its expiry, does not find its own Dot up.

View Source
const BlockRatingPerBlockPercent = 5.000000
View Source
const BossGCD = time.Millisecond * 1620
View Source
const CharacterLevel = 60
View Source
const CombatTableCoverageCap = 1.024 // 102.4% chance to avoid an attack
View Source
const CreatureArmorMaxLevel = 3566.0
View Source
const CreatureHealthMaxLevel = 4365.0

ExpectedStat's creature values at the character level

View Source
const CritRatingPerCritPercent = 14.000000
View Source
const DTPSReferenceStat = stats.Armor
View Source
const DamageTakenRageFactor = 2.5

A physical melee auto attack taken grants DamageTakenRageFactor * (1 - A) * damage / c rage, where damage is the hit after the defender's damage taken multipliers (Defensive Stance's 10% less, a debuff's more) and before armor, resistances, flat damage taken bonuses, block and absorbs, c is the rage conversion value at the attacker's level (230.6 at 60) and A is the armor reduction the game assumes in place of the defender's own. The defender's level, health and armor play no part.

View Source
const DefaultAttackPowerPerDPS = 14.0
View Source
const DefenseRatingPerDefenseLevel = 1.000000
View Source
const DodgeRatingPerDodgePercent = 12.000000
View Source
const EnemyAutoAttackAPCoefficient = 0.00052
View Source
const ExpertiseRatingPerExpertisePercent = 10.000000
View Source
const FearAuraTag = "Fear"
View Source
const GCDDefault = time.Millisecond * 1500
View Source
const GCDMin = time.Second * 1
View Source
const HasteRatingPerHastePercent = 10.000000
View Source
const HitRatingPerHitPercent = 10.000000
View Source
const Inactive = -1
View Source
const LongDuration = 180
View Source
const MaxIlvl = 600
View Source
const MaxMeleeRange = 5.0 // in yards
View Source
const MaxSpellQueueWindow = time.Millisecond * 400
View Source
const MinEffectItemLevel = 40

The lowest item level whose effects the database generator writes, and where the AllItems tests start: an effect hotfix on lower gear moves the .results files with no level 60 gear at stake.

View Source
const MinIlvl = 60
View Source
const MinRangedRange = MaxMeleeRange + 8.0 - 4.0/3.0

The yards a bow, gun or crossbow cannot fire inside, in the sim's distance, where melee range is 5 yd. The game counts a shot's 8 yd minimum from both units' combat reach, and melee range is both reaches plus 4/3 yd, so the deadzone past melee range is 8 - 4/3 yd whatever the target's size, once the two reaches sum to 5 - 4/3 yd or more, as every boss's do with a player's 1.5.

View Source
const MissDodgeParryBlockCritChancePerDefense = 0.04
View Source
const NeverExpires = time.Duration(math.MaxInt64)
View Source
const NumItemSlots = proto.ItemSlot_ItemSlotRanged + 1
View Source
const ParryRatingPerParryPercent = 15.000000
View Source
const PetUpdateInterval = time.Millisecond * 5250
View Source
const ProcHintAttackAvoided = ProcHintAttackDodged | ProcHintAttackParried

The wearer's own attack landing on nothing, which the decoder turns into the outcome it names.

View Source
const RangedSwingWindup = time.Millisecond * 500

A ranged auto's windup before ranged haste is applied.

View Source
const ReducedAvoidanceAuraTag = "Reduced Avoidance"

Tag on the tank hardcast aura, which suppresses avoidance the same way a stun does and so shares the Stunned flag with the stun kind.

View Source
const ShortDuration = 60
View Source
const SpellBatchWindow = time.Millisecond * 10
View Source
const SpellDamageTakenRageMultiplier = 2.0

Damage of a school other than physical, and every periodic tick whatever its school, grants twice a physical melee auto attack's rage on the same damage (EV-0052). Every other physical direct hit (Shoot, Throw, Shield Slam, Mortal Strike, a ranged auto attack) grants twice that rule too, read on the damage left after armor, damage taken multipliers, flat damage taken bonuses and the block, before absorbs (EV-0118). TODO: Ingame test needed -- the logs behind EV-0118 hold no absorbed special and no attacker above level 40, so whether an absorb takes rage off and whether the landed reading keeps the (1 - A) of higher attackers is not measured.

View Source
const SpellPushbackDuration = time.Millisecond * 500
View Source
const StunAuraTag = "Stun"
View Source
const ThreatPerHealingDone = 0.5

Threat per point of health a heal restores, before the spell's and the unit's threat multipliers.

View Source
const ThreatPerManaGained = 0.5
View Source
const ThreatPerRageGained = 5

Booked in AddRage at gain time. Rage from white hits, hits taken and refunds carries ResourceMetrics.NoThreat and makes none; a new rage source that comes from damage sets NoThreat too. A source marked ResourceMetrics.UnscaledThreat (Shield Specialization, Master of Defense, Bloodrage's instant rage, Unbridled Wrath, Blood Frenzy) makes it without the unit's threat multiplier.

View Source
const TwoHandNormalizedSwingSpeed = 3.3

Variables

The weapon types a sharpening stone fits, and those a weightstone fits.

View Source
var AlchStoneItemIDs = []int32{13503}

Alchemists' Stone, whose equip spell raises what healing and mana potions give the wearer. The item requires Alchemy (ItemSparse.RequiredSkill 171).

View Source
var AverageDefaultSimTestOptions = &proto.SimOptions{
	Iterations: 2000,
	IsTest:     true,
	Debug:      false,
	RandomSeed: 101,
}
View Source
var BaseStats = map[BaseStatsKey]stats.Stats{}
View Source
var ChanceOfDeathAuraLabel = "Chance of Death"

ClassBaseDodge is each class's dodge chance before Agility; a class missing here has none.

View Source
var ClassBaseScaling = map[proto.Class]float64{
	proto.Class_ClassUnknown: 49.000000,
	proto.Class_ClassWarrior: 491.949980,
	proto.Class_ClassPaladin: 332.962490,
	proto.Class_ClassHunter:  355.055050,
	proto.Class_ClassRogue:   532.945800,
	proto.Class_ClassPriest:  336.625000,
	proto.Class_ClassShaman:  251.970830,
	proto.Class_ClassMage:    366.620820,
	proto.Class_ClassWarlock: 308.962490,
	proto.Class_ClassDruid:   282.633330,
}

The LEVEL 60 rows of GameTables/SpellScaling.txt. Only tools/tooltip reads this (dbc_data_provider.go:249), so the sim is unaffected either way, but tooltip spell values used to be computed off the level 90 row -- a MoP-port leftover that was never updated for TBC and was wrong by two expansions at level 60.

TODO: these numbers came from a MoP-era copy of that gametable. The checked-in assets/db_inputs/basestats/SpellScaling.txt is now the beta's own extraction, and every class column in it is 0 at every level, so there is no build-native confirmation of these numbers and none is currently obtainable.

View Source
var ClassBaseStats = map[proto.Class]stats.Stats{
	proto.Class_ClassUnknown: {},
	proto.Class_ClassWarrior: {
		stats.Health:      1689,
		stats.Agility:     80,
		stats.Strength:    120,
		stats.Intellect:   30,
		stats.Spirit:      45,
		stats.Stamina:     110,
		stats.AttackPower: 160,
	},
	proto.Class_ClassPaladin: {
		stats.Health:      1381,
		stats.Agility:     65,
		stats.Strength:    105,
		stats.Intellect:   70,
		stats.Spirit:      75,
		stats.Stamina:     100,
		stats.AttackPower: 160,
	},
	proto.Class_ClassHunter: {
		stats.Health:            1467,
		stats.Agility:           125,
		stats.Strength:          55,
		stats.Intellect:         65,
		stats.Spirit:            70,
		stats.Stamina:           90,
		stats.AttackPower:       100,
		stats.RangedAttackPower: 110,
	},
	proto.Class_ClassRogue: {
		stats.Health:      1523,
		stats.Agility:     130,
		stats.Strength:    80,
		stats.Intellect:   35,
		stats.Spirit:      50,
		stats.Stamina:     75,
		stats.AttackPower: 100,
	},
	proto.Class_ClassPriest: {
		stats.Health:      1397,
		stats.Agility:     40,
		stats.Strength:    35,
		stats.Intellect:   120,
		stats.Spirit:      125,
		stats.Stamina:     50,
		stats.AttackPower: -10,
	},

	proto.Class_ClassShaman: {
		stats.Health:      1280,
		stats.Agility:     52,
		stats.Strength:    88,
		stats.Intellect:   87,
		stats.Spirit:      100,
		stats.Stamina:     95,
		stats.AttackPower: 100,
	},
	proto.Class_ClassMage: {
		stats.Health:      1370,
		stats.Agility:     35,
		stats.Strength:    30,
		stats.Intellect:   125,
		stats.Spirit:      120,
		stats.Stamina:     45,
		stats.AttackPower: -10,
	},
	proto.Class_ClassWarlock: {
		stats.Health:      1414,
		stats.Agility:     50,
		stats.Strength:    45,
		stats.Intellect:   110,
		stats.Spirit:      115,
		stats.Stamina:     65,
		stats.AttackPower: -10,
	},
	proto.Class_ClassDruid: {
		stats.Health:      1483,
		stats.Agility:     60,
		stats.Strength:    65,
		stats.Intellect:   100,
		stats.Spirit:      110,
		stats.Stamina:     70,
		stats.AttackPower: -20,
	},
}
View Source
var ClassRaceCapabilities = map[proto.Class][]proto.Race{
	proto.Class_ClassWarrior: {
		proto.Race_RaceHuman,
		proto.Race_RaceDwarf,
		proto.Race_RaceNightElf,
		proto.Race_RaceGnome,
		proto.Race_RaceHighOrderSkyborne,
		proto.Race_RaceOrc,
		proto.Race_RaceUndead,
		proto.Race_RaceTauren,
		proto.Race_RaceTroll,
		proto.Race_RaceWindshaperSkyborne,
	},
	proto.Class_ClassPaladin: {
		proto.Race_RaceHuman,
		proto.Race_RaceDwarf,
		proto.Race_RaceUndead,
	},
	proto.Class_ClassHunter: {
		proto.Race_RaceHuman,
		proto.Race_RaceDwarf,
		proto.Race_RaceNightElf,
		proto.Race_RaceHighOrderSkyborne,
		proto.Race_RaceOrc,
		proto.Race_RaceTauren,
		proto.Race_RaceTroll,
		proto.Race_RaceWindshaperSkyborne,
	},
	proto.Class_ClassRogue: {
		proto.Race_RaceHuman,
		proto.Race_RaceDwarf,
		proto.Race_RaceNightElf,
		proto.Race_RaceGnome,
		proto.Race_RaceHighOrderSkyborne,
		proto.Race_RaceOrc,
		proto.Race_RaceUndead,
		proto.Race_RaceTroll,
		proto.Race_RaceWindshaperSkyborne,
	},
	proto.Class_ClassPriest: {
		proto.Race_RaceHuman,
		proto.Race_RaceDwarf,
		proto.Race_RaceNightElf,
		proto.Race_RaceGnome,
		proto.Race_RaceUndead,
		proto.Race_RaceTroll,
	},
	proto.Class_ClassShaman: {
		proto.Race_RaceDwarf,
		proto.Race_RaceOrc,
		proto.Race_RaceTauren,
		proto.Race_RaceTroll,
		proto.Race_RaceWindshaperSkyborne,
	},
	proto.Class_ClassMage: {
		proto.Race_RaceHuman,
		proto.Race_RaceGnome,
		proto.Race_RaceHighOrderSkyborne,
		proto.Race_RaceOrc,
		proto.Race_RaceUndead,
		proto.Race_RaceTroll,
	},
	proto.Class_ClassWarlock: {
		proto.Race_RaceHuman,
		proto.Race_RaceGnome,
		proto.Race_RaceOrc,
		proto.Race_RaceUndead,
		proto.Race_RaceTroll,
	},
	proto.Class_ClassDruid: {
		proto.Race_RaceNightElf,
		proto.Race_RaceHighOrderSkyborne,
		proto.Race_RaceTauren,
		proto.Race_RaceWindshaperSkyborne,
	},
}

The game files' SpellClassSet per class: the family every one of that class's spells files its class mask under. Verified row by row against the spell store in spelldata's TestClassSpellFamilies.

View Source
var ClassWeaponTypeCapabilities = map[proto.Class]map[proto.WeaponType]EligibleWeaponType{
	proto.Class_ClassWarrior: {
		proto.WeaponType_WeaponTypeAxe:     {CanUseTwoHand: true},
		proto.WeaponType_WeaponTypeDagger:  {},
		proto.WeaponType_WeaponTypeFist:    {},
		proto.WeaponType_WeaponTypeMace:    {CanUseTwoHand: true},
		proto.WeaponType_WeaponTypeOffHand: {},
		proto.WeaponType_WeaponTypePolearm: {CanUseTwoHand: true},
		proto.WeaponType_WeaponTypeShield:  {},
		proto.WeaponType_WeaponTypeStaff:   {CanUseTwoHand: true},
		proto.WeaponType_WeaponTypeSword:   {CanUseTwoHand: true},
	},
	proto.Class_ClassPaladin: {
		proto.WeaponType_WeaponTypeAxe:     {CanUseTwoHand: true},
		proto.WeaponType_WeaponTypeMace:    {CanUseTwoHand: true},
		proto.WeaponType_WeaponTypeOffHand: {},
		proto.WeaponType_WeaponTypePolearm: {CanUseTwoHand: true},
		proto.WeaponType_WeaponTypeShield:  {},
		proto.WeaponType_WeaponTypeSword:   {CanUseTwoHand: true},
	},
	proto.Class_ClassHunter: {
		proto.WeaponType_WeaponTypeAxe:     {CanUseTwoHand: true},
		proto.WeaponType_WeaponTypeDagger:  {},
		proto.WeaponType_WeaponTypeFist:    {},
		proto.WeaponType_WeaponTypePolearm: {CanUseTwoHand: true},
		proto.WeaponType_WeaponTypeStaff:   {CanUseTwoHand: true},
		proto.WeaponType_WeaponTypeSword:   {CanUseTwoHand: true},
	},
	proto.Class_ClassRogue: {
		proto.WeaponType_WeaponTypeAxe:     {},
		proto.WeaponType_WeaponTypeDagger:  {},
		proto.WeaponType_WeaponTypeFist:    {},
		proto.WeaponType_WeaponTypeMace:    {},
		proto.WeaponType_WeaponTypeOffHand: {},
		proto.WeaponType_WeaponTypeSword:   {},
	},
	proto.Class_ClassDruid: {
		proto.WeaponType_WeaponTypeDagger:  {},
		proto.WeaponType_WeaponTypeFist:    {},
		proto.WeaponType_WeaponTypeMace:    {CanUseTwoHand: true},
		proto.WeaponType_WeaponTypeOffHand: {},
		proto.WeaponType_WeaponTypePolearm: {CanUseTwoHand: true},
		proto.WeaponType_WeaponTypeStaff:   {CanUseTwoHand: true},
	},
	proto.Class_ClassShaman: {
		proto.WeaponType_WeaponTypeAxe:     {CanUseTwoHand: true},
		proto.WeaponType_WeaponTypeDagger:  {},
		proto.WeaponType_WeaponTypeFist:    {},
		proto.WeaponType_WeaponTypeMace:    {CanUseTwoHand: true},
		proto.WeaponType_WeaponTypeOffHand: {},
		proto.WeaponType_WeaponTypeShield:  {},
		proto.WeaponType_WeaponTypeStaff:   {CanUseTwoHand: true},
	},
	proto.Class_ClassMage: {
		proto.WeaponType_WeaponTypeDagger:  {},
		proto.WeaponType_WeaponTypeOffHand: {},
		proto.WeaponType_WeaponTypeStaff:   {CanUseTwoHand: true},
		proto.WeaponType_WeaponTypeSword:   {},
	},
	proto.Class_ClassPriest: {
		proto.WeaponType_WeaponTypeDagger:  {},
		proto.WeaponType_WeaponTypeMace:    {},
		proto.WeaponType_WeaponTypeOffHand: {},
		proto.WeaponType_WeaponTypeStaff:   {CanUseTwoHand: true},
	},
	proto.Class_ClassWarlock: {
		proto.WeaponType_WeaponTypeDagger:  {},
		proto.WeaponType_WeaponTypeOffHand: {},
		proto.WeaponType_WeaponTypeStaff:   {CanUseTwoHand: true},
		proto.WeaponType_WeaponTypeSword:   {},
	},
}

The classes whose Ranged Hit % never falls back to hit rating: a warrior's Thunder Clap rolls spell hit, a shaman has no ranged attack, and the paladin specs weigh the ranged hit Judgement of Righteousness, Judgement of Fury and Hammer of Wrath roll as Ranged Hit % of its own. CLASSES_WITHOUT_RANGED_HIT_FALLBACK in ui/sim/proto/stats.ts is the UI's copy; the two are kept in sync by hand.

View Source
var CreatureStatsByLevel = map[int32]CreatureStats{
	1:  {Health: 42.0, Armor: 20.0, AutoAttackDps: 0.7703719735145569},
	2:  {Health: 55.0, Armor: 21.0, AutoAttackDps: 1.157463550567627},
	3:  {Health: 71.0, Armor: 46.0, AutoAttackDps: 1.6290841102600098},
	4:  {Health: 86.0, Armor: 82.0, AutoAttackDps: 2.250774621963501},
	5:  {Health: 102.0, Armor: 126.0, AutoAttackDps: 3.006349563598633},
	6:  {Health: 120.0, Armor: 180.0, AutoAttackDps: 4.004024028778076},
	7:  {Health: 137.0, Armor: 245.0, AutoAttackDps: 5.183571815490723},
	8:  {Health: 156.0, Armor: 322.0, AutoAttackDps: 6.02406120300293},
	9:  {Health: 180.0, Armor: 412.0, AutoAttackDps: 6.905670642852783},
	10: {Health: 208.0, Armor: 518.0, AutoAttackDps: 7.619572162628174},
	11: {Health: 239.0, Armor: 545.0, AutoAttackDps: 8.599532127380371},
	12: {Health: 272.0, Armor: 580.0, AutoAttackDps: 9.835854530334473},
	13: {Health: 307.0, Armor: 615.0, AutoAttackDps: 10.712736129760742},
	14: {Health: 345.0, Armor: 650.0, AutoAttackDps: 11.8082914352417},
	15: {Health: 385.0, Armor: 685.0, AutoAttackDps: 12.854804992675781},
	16: {Health: 427.0, Armor: 721.0, AutoAttackDps: 13.587111473083496},
	17: {Health: 473.0, Armor: 756.0, AutoAttackDps: 14.563858985900879},
	18: {Health: 521.0, Armor: 791.0, AutoAttackDps: 15.252960205078125},
	19: {Health: 572.0, Armor: 826.0, AutoAttackDps: 16.182199478149414},
	20: {Health: 629.0, Armor: 861.0, AutoAttackDps: 17.102863311767578},
	21: {Health: 677.0, Armor: 897.0, AutoAttackDps: 17.745412826538086},
	22: {Health: 731.0, Armor: 932.0, AutoAttackDps: 18.598649978637695},
	23: {Health: 787.0, Armor: 967.0, AutoAttackDps: 19.226642608642578},
	24: {Health: 846.0, Armor: 1002.0, AutoAttackDps: 20.052448272705078},
	25: {Health: 909.0, Armor: 1037.0, AutoAttackDps: 20.828466415405273},
	26: {Health: 975.0, Armor: 1072.0, AutoAttackDps: 21.485151290893555},
	27: {Health: 1040.0, Armor: 1108.0, AutoAttackDps: 22.347990036010742},
	28: {Health: 1109.0, Armor: 1142.0, AutoAttackDps: 22.996150970458984},
	29: {Health: 1177.0, Armor: 1177.0, AutoAttackDps: 23.821842193603516},
	30: {Health: 1242.0, Armor: 1212.0, AutoAttackDps: 24.693754196166992},
	31: {Health: 1308.0, Armor: 1247.0, AutoAttackDps: 25.315637588500977},
	32: {Health: 1374.0, Armor: 1283.0, AutoAttackDps: 26.08427619934082},
	33: {Health: 1443.0, Armor: 1317.0, AutoAttackDps: 26.739229202270508},
	34: {Health: 1512.0, Armor: 1353.0, AutoAttackDps: 27.5108642578125},
	35: {Health: 1586.0, Armor: 1387.0, AutoAttackDps: 28.255643844604492},
	36: {Health: 1660.0, Armor: 1494.0, AutoAttackDps: 28.944372177124023},
	37: {Health: 1737.0, Armor: 1607.0, AutoAttackDps: 29.85236167907715},
	38: {Health: 1814.0, Armor: 1724.0, AutoAttackDps: 30.626020431518555},
	39: {Health: 1897.0, Armor: 1849.0, AutoAttackDps: 31.58934211730957},
	40: {Health: 1981.0, Armor: 1980.0, AutoAttackDps: 32.5855827331543},
	41: {Health: 2061.0, Armor: 2117.0, AutoAttackDps: 34.142547607421875},
	42: {Health: 2146.0, Armor: 2262.0, AutoAttackDps: 36.28594970703125},
	43: {Health: 2231.0, Armor: 2414.0, AutoAttackDps: 38.70747375488281},
	44: {Health: 2317.0, Armor: 2574.0, AutoAttackDps: 41.91373825073242},
	45: {Health: 2402.0, Armor: 2742.0, AutoAttackDps: 43.99250793457031},
	46: {Health: 2495.0, Armor: 2798.0, AutoAttackDps: 44.89542007446289},
	47: {Health: 2587.0, Armor: 2853.0, AutoAttackDps: 46.0213508605957},
	48: {Health: 2681.0, Armor: 2907.0, AutoAttackDps: 46.92918395996094},
	49: {Health: 2779.0, Armor: 2963.0, AutoAttackDps: 48.029685974121094},
	50: {Health: 2909.0, Armor: 3018.0, AutoAttackDps: 49.20170593261719},
	51: {Health: 3040.0, Armor: 3072.0, AutoAttackDps: 50.15997314453125},
	52: {Health: 3174.0, Armor: 3128.0, AutoAttackDps: 51.38513946533203},
	53: {Health: 3317.0, Armor: 3183.0, AutoAttackDps: 52.369083404541016},
	54: {Health: 3458.0, Armor: 3237.0, AutoAttackDps: 53.56260681152344},
	55: {Health: 3602.0, Armor: 3292.0, AutoAttackDps: 54.68286895751953},
	56: {Health: 3755.0, Armor: 3348.0, AutoAttackDps: 55.7628173828125},
	57: {Health: 3909.0, Armor: 3402.0, AutoAttackDps: 56.93973159790039},
	58: {Health: 4105.0, Armor: 3457.0, AutoAttackDps: 58.0316047668457},
	59: {Health: 4234.0, Armor: 3512.0, AutoAttackDps: 59.21518325805664},
	60: {Health: 4365.0, Armor: 3566.0, AutoAttackDps: 60.45291519165039},
	61: {Health: 4496.0, Armor: 3622.0, AutoAttackDps: 61.530330657958984},
	62: {Health: 4629.0, Armor: 3677.0, AutoAttackDps: 62.75210952758789},
	63: {Health: 4763.0, Armor: 3731.0, AutoAttackDps: 63.86144256591797},
}
View Source
var CritPerAgiMaxLevel = map[proto.Class]float64{
	proto.Class_ClassUnknown: 0.0,
	proto.Class_ClassWarrior: 0.05000000,
	proto.Class_ClassPaladin: 0.05060000,
	proto.Class_ClassHunter:  0.01890000,
	proto.Class_ClassRogue:   0.03450000,
	proto.Class_ClassPriest:  0.05000000,
	proto.Class_ClassShaman:  0.05080000,
	proto.Class_ClassMage:    0.05140000,
	proto.Class_ClassWarlock: 0.05000000,
	proto.Class_ClassDruid:   0.05000000,
}
View Source
var CritPerIntMaxLevel = map[proto.Class]float64{
	proto.Class_ClassUnknown: 0.0,
	proto.Class_ClassWarrior: 0.00000000,
	proto.Class_ClassPaladin: 0.01670000,
	proto.Class_ClassHunter:  0.01650000,
	proto.Class_ClassRogue:   0.00000000,
	proto.Class_ClassPriest:  0.01680000,
	proto.Class_ClassShaman:  0.01690000,
	proto.Class_ClassMage:    0.01680000,
	proto.Class_ClassWarlock: 0.01650000,
	proto.Class_ClassDruid:   0.01670000,
}
View Source
var DefaultSimTestOptions = &proto.SimOptions{
	Iterations: 20,
	IsTest:     true,
	Debug:      false,
	RandomSeed: 101,
}
View Source
var DefaultTargetProto = FreshDefaultTargetConfig()
View Source
var FullDebuffs = &proto.Debuffs{
	JudgementOfWisdom:      true,
	JudgementOfLight:       true,
	JudgementOfTheCrusader: proto.TristateEffect_TristateEffectRegular,
	CurseOfElements:        true,
	GiftOfArthas:           true,
	ExposeArmor:            true,
	FaerieFire:             true,
	SunderArmor:            true,
	CurseOfRecklessness:    true,
	HuntersMark:            true,
	DemoralizingRoar:       true,

	ThunderClap:  true,
	InsectSwarm:  true,
	ScorpidSting: true,
}
View Source
var FullIndividualBuffs = &proto.IndividualBuffs{
	GreaterBlessingOfKings:  true,
	GreaterBlessingOfWisdom: 1,
	GreaterBlessingOfMight:  1,
	Thorns:                  true,
}
View Source
var FullPartyBuffs = &proto.PartyBuffs{
	BloodPact:         true,
	DevotionAura:      true,
	RetributionAura:   true,
	ConcentrationAura: true,
	AtieshDruid:       1,
	AtieshMage:        1,
	AtieshPriest:      1,
	AtieshWarlock:     1,

	ManaSpringTotem: proto.TristateEffect_TristateEffectImproved,
	ManaTideTotems:  1,
}
View Source
var FullRaidBuffs = &proto.RaidBuffs{
	ArcaneIntellect:    true,
	PowerWordFortitude: true,
	PrayerOfSpirit:     true,
	MarkOfTheWild:      true,
	ShadowProtection:   true,

	GraceOfAirTotem:      1,
	StrengthOfEarthTotem: 1,
	WindfuryTotem:        true,
	BattleShout:          1,
	TrueshotAura:         true,
	LeaderOfThePack:      true,
	MoonkinAura:          true,
}
View Source
var FullTankIndividualBuffs = &proto.IndividualBuffs{
	GreaterBlessingOfKings:  true,
	GreaterBlessingOfWisdom: 1,
	GreaterBlessingOfMight:  1,
	Thorns:                  true,
}
View Source
var ItemTypeToSlotsMap = itemfit.TypeSlots

gen_db -gen=go-to-ts writes this to the UI as ITEM_TYPE_TO_SLOTS, read by getEligibleItemSlots in ui/sim/proto/items.ts.

View Source
var ManaStats = []stats.Stat{stats.MP5, stats.Spirit}

The stats a buff to only these makes a mana cooldown.

View Source
var PresetEncounters []*proto.PresetEncounter

Each race's offset on the class base attributes, Spirit included.

The channels of the hit, crit and haste ratings. RATING_CHANNELS in ui/sim/proto/stats.ts is the UI's copy of the same channels; the two are kept in sync by hand.

The rating conversions every unit has, in the order the reforge optimizer tries a rating's percents.

The pseudo stat each magic school's hit percent travels as. None and Physical have none and hold the zero value, PseudoStatMainHandDps, so read from SchoolIndexArcane on.

View Source
var StatWeightsDefaultSimTestOptions = &proto.SimOptions{
	Iterations: 300,
	IsTest:     true,
	Debug:      false,
	RandomSeed: 101,
}

The stats a buff to any of makes a survival cooldown.

View Source
var WITH_DB = false

Functions

func APLRotationFromJsonString

func APLRotationFromJsonString(jsonString string) *proto.APLRotation

func AddBaseStatsCombo

func AddBaseStatsCombo(r proto.Race, c proto.Class)

No game file ships class base crit: ExtraClassBaseStats carries it from the hand-kept tables in assets/db_inputs/basestats/, and crit per Agility comes from PlayerExpectedStat.

func AddPresetEncounter

func AddPresetEncounter(name string, targetPaths []string)

func AddPresetTarget

func AddPresetTarget(newPreset *PresetTarget)

func AddRatingConversions

func AddRatingConversions(sdm *stats.StatDependencyManager)

func AddToDatabase

func AddToDatabase(newDB *proto.SimDatabase)

func AllMeleeWeaponSlots

func AllMeleeWeaponSlots() []proto.ItemSlot

func AllWeaponSlots

func AllWeaponSlots() []proto.ItemSlot

func ApplyFear

func ApplyFear(sim *Simulation, fearAura *Aura) bool

func ApplyStun

func ApplyStun(sim *Simulation, stunAura *Aura) bool

func BothTimersReady

func BothTimersReady(t1 *Timer, t2 *Timer, sim *Simulation) bool

func BothTimersReadyAt

func BothTimersReadyAt(t1 *Timer, t2 *Timer) time.Duration

func CastTimePPMChance added in v1.0.4

func CastTimePPMChance(ppm float64, castTime time.Duration) float64

The chance a procs-per-minute rate gives a hit whose cast took castTime: the rate on that time, the 1.5 s global cooldown at least.

func ChannelHasEPFallback added in v1.0.6

func ChannelHasEPFallback(pseudoStat proto.PseudoStat, class proto.Class) bool

Whether EP falls back to a rating's weight for a channel percent the weights leave at 0. For a class in ClassesWithoutRangedHitFallback, hit that reaches ranged attacks alone is worth only the Ranged Hit % weight.

func CharacterBenchmark

func CharacterBenchmark(b *testing.B, config CharacterSuiteConfig)

CharacterBenchmark sims a suite config's default setup against one target. The seed is fixed, so the reported dps only moves when a change alters results.

func CheckSliceOverlap

func CheckSliceOverlap[T comparable](s1 []T, s2 []T) bool

Returns true if two slices share any common elements, and false otherwise.

func Clamp

func Clamp(val float64, min float64, max float64) float64

func ClassWeaponSkills

func ClassWeaponSkills(class proto.Class) []proto.WeaponSkill

The class's combat skills, sorted. Race plays no part: in the game files (SkillRaceClassInfo) race only decides which weapon skills a character starts with.

func CombineConcurrentSimResults

func CombineConcurrentSimResults(results []*proto.RaidSimResult, isDebug bool) *proto.RaidSimResult

func CombineDistributionMetrics

func CombineDistributionMetrics(base *proto.DistributionMetrics, add *proto.DistributionMetrics, isLast bool, weight float64)

CombineDistributionMetrics folds `add` into `base` with the given weight, recomputing the stdev from the accumulated aggregator data on the last call. Exported so the bulk sim can merge stage segments through the same maths the concurrent-sim combiner uses.

func CompareConcurrentSimResultsTest

func CompareConcurrentSimResultsTest(t *testing.T, testName string, singleThreadRes *proto.RaidSimResult, multiThreadRes *proto.RaidSimResult, absoluteFloatTolerance float64, relativeFloatTolerance float64)

func ComputeStatDependencies

func ComputeStatDependencies(request *proto.ComputeStatsRequest) *stats.StatDependencyManager

ComputeStatDependencies builds a character from the request and returns its finalized StatDependencyManager. Lightweight compared to ComputeStats — builds the character and resolves all stat dependencies but does not run the simulation.

func ComputeStats

*

  • Returns character stats taking into account gear / buffs / consumes / etc

func DebugCompareLogs

func DebugCompareLogs(rsr *proto.RaidSimRequest, showCount int) (bool, string)

func DefaultItemSetSlots

func DefaultItemSetSlots() []proto.ItemSlot

func DisableCritChanceByCaster

func DisableCritChanceByCaster(index int, attackTable *AttackTable)

func DisableDamageDoneByCaster

func DisableDamageDoneByCaster(index int, attackTable *AttackTable)

func DurationFromMillis

func DurationFromMillis[T int32 | float64](ms T) time.Duration

A float is truncated to whole milliseconds, which is how the game files' millisecond columns read.

func DurationFromSeconds

func DurationFromSeconds(numSeconds float64) time.Duration

func Each

func Each[T any](src []T, f func(T))

Iterate over a slice and calls f

func EligibleSlotsForItem

func EligibleSlotsForItem(item *Item) []proto.ItemSlot

The item slots an item can occupy.

func EnableCritChanceByCaster

func EnableCritChanceByCaster(index int, maxIndex int, attackTable *AttackTable, handler DynamicCritChanceByCaster)

func EnableDamageDoneByCaster

func EnableDamageDoneByCaster(index int, maxIndex int, attackTable *AttackTable, handler DynamicDamageDoneByCaster)

func EnchantAppliesToItem

func EnchantAppliesToItem(effectID int32, item Item) bool

func EquipmentSpecFromJsonString

func EquipmentSpecFromJsonString(jsonString string) *proto.EquipmentSpec

func ExclusiveStatCategory

func ExclusiveStatCategory(category string, key string, multiplicative bool) string

The category one stat or pseudo-stat of a buff bids in alone: the buff's category, then the stat's name or its PseudoStats field, then whether the buff adds to it or multiplies it.

func FilterMap

func FilterMap[K comparable, V any](src map[K]V, f func(K, V) bool) map[K]V

Returns a new map containing only the key/value pairs for which f returns true.

func FilterSlice

func FilterSlice[T any](src []T, f func(T) bool) []T

Returns a new slice containing only the elements for which f returns true.

func Flatten

func Flatten[T any](src [][]T) []T

Flattens a 2D slice into a 1D slice.

func FreshDefaultTargetConfig

func FreshDefaultTargetConfig() *proto.Target

func GetCurrentProtoVersion

func GetCurrentProtoVersion() int32

func GetSpellEffectByID

func GetSpellEffectByID(id int32) *proto.SpellEffect

func GetTristateValueInt32

func GetTristateValueInt32(effect proto.TristateEffect, regularValue int32, impValue int32) int32

func GetWeaponSkill

func GetWeaponSkill(unit *Unit, weapon *Item, slot proto.ItemSlot) float64

The unit's bonus weapon skill for the weapon held in the slot, on top of its level-based skill. A main-hand or off-hand weapon adds that hand's bonus; an empty hand and a feral form take none.

func GroupRowPath

func GroupRowPath(group, i int) string

func HasConsumableEffect

func HasConsumableEffect(id int32) bool

func HasEnchantEffect

func HasEnchantEffect(id int32) bool

func HasItemEffect

func HasItemEffect(id int32) bool

func IsRunningInWasm

func IsRunningInWasm() bool

func ItemEffectRandPropPointsToProto

func ItemEffectRandPropPointsToProto(ieRpp ItemEffectRandPropPoints) *proto.ItemEffectRandPropPoints

Converts a Go ItemEffectRandPropPoints to a protobuf ItemEffectRandPropPoints

func ItemEquipmentBaseStats

func ItemEquipmentBaseStats(item Item) stats.Stats

Returns the base stats on the equipment. That is all stats without Enchants

func ItemEquipmentEnchantStats

func ItemEquipmentEnchantStats(item Item) stats.Stats

func ItemSwapFromJsonString

func ItemSwapFromJsonString(jsonString string) *proto.ItemSwap

func ItemTypeToSlot

func ItemTypeToSlot(it proto.ItemType) proto.ItemSlot

func MakeSingleTargetEncounter

func MakeSingleTargetEncounter(variation float64) *proto.Encounter

func MakeTristateValue

func MakeTristateValue(hasRegular bool, hasImproved bool) proto.TristateEffect

func MapMap

func MapMap[KI comparable, VI any, KO comparable, VO any](src map[KI]VI, f func(KI, VI) (KO, VO)) map[KO]VO

Returns a new map by applying f to each key/value pair in src.

func MapSlice

func MapSlice[I any, O any](src []I, f func(I) O) []O

Returns a new slice by applying f to each element in src.

func MaxTimeToReady

func MaxTimeToReady(t1 *Timer, t2 *Timer, sim *Simulation) time.Duration

func MissingEnchantEffects

func MissingEnchantEffects() []int32

MissingEnchantEffects reports the enchant effect ids skipped for the same reason.

func MissingItemEffects

func MissingItemEffects() []int32

MissingItemEffects reports the item ids whose effects were skipped because the loaded database has no such item.

func MissingItemSets

func MissingItemSets() []string

MissingItemSets reports the set names skipped because the loaded database holds none of their items.

func MultiplierFromPercent

func MultiplierFromPercent(percent float64) float64

A percentage as a multiplier: 20 is 1.2 and -6 is 0.94.

func NewConsumableEffect

func NewConsumableEffect(id int32, consumableEffect ApplyEffect)

Registers a hand-written ApplyEffect function which will be called while the consumes are applied, for any Agent whose ConsumesSpec names the id. It takes the place of a data-driven registration for the id, whichever of the two registers first.

func NewDefaultTarget

func NewDefaultTarget() *proto.Target

func NewEnchantEffect

func NewEnchantEffect(id int32, enchantEffect ApplyEffect)

func NewItemEffect

func NewItemEffect(id int32, itemEffect ApplyEffect)

func NewItemPet

func NewItemPet(id int32, newPets ...func(owner *Character) PetAgent)

Registers the pets an item's effect summons, such as the creatures a proc calls forth, one builder for each pet that can be up at once. A pet must be added while its owner is constructed, before the item effects run, so the owner builds them then: once for an item it wears or carries in its item swap set, if its class can use the item. The item's effect finds the pets among the owner's PetAgents.

func NewSpellDataConsumableEffect

func NewSpellDataConsumableEffect(id int32, consumableEffect ApplyEffect)

Registers an ApplyEffect function built from the consumable's rows, which applies unless a hand-written one is registered for the id.

func NewWeaponTestSim

func NewWeaponTestSim(t testing.TB, race proto.Race, equipped, swapped []*proto.ItemSpec, talents func(*Character)) (*Simulation, *Character)

A reset sim of the weapon tester, with talents applied as its talents.

func OncePerCast

func OncePerCast() (first func(sim *Simulation, spell *Spell) bool, reset func())

One charge per cast, however many targets it hits: first is true for a cast's first hit only. A cast's hits share its spell id and time, so a tagged off-hand strike counts with its main-hand one. reset forgets the last cast.

func PlayerProtoToSpec

func PlayerProtoToSpec(player *proto.Player) proto.Spec

func PlayerProtoToSpecSafe

func PlayerProtoToSpecSafe(player *proto.Player) (proto.Spec, error)

PlayerProtoToSpecSafe is PlayerProtoToSpec with the failure modes made explicit: it returns an error instead of panicking on a missing spec oneof, and reports an unregistered agent type (agent factories must have been registered, e.g. via sim.RegisterAll) instead of returning the zero Spec.

func PrepullRowPath

func PrepullRowPath(i int) string

The JSON path of a row in the APL.

func PriorityRowPath

func PriorityRowPath(i int) string

func RaidBenchmark

func RaidBenchmark(b *testing.B, rsr *proto.RaidSimRequest)

func RaidPlayersWithClass

func RaidPlayersWithClass(raid *proto.Raid, class proto.Class) []*proto.Player

func RaidSimTest

func RaidSimTest(label string, t *testing.T, rsr *proto.RaidSimRequest, expectedDps float64)

func RangedWeaponMinRange

func RangedWeaponMinRange(weaponType proto.RangedWeaponType) float64

How close to its target a ranged weapon of the type fires from: a bow, crossbow or gun from MinRangedRange, a wand or thrown weapon from anywhere. A relic never fires.

func RegisterAgentFactory

func RegisterAgentFactory(emptyOptions any, spec proto.Spec, factory AgentFactory, specSetter SpecSetter)

func RegisterBuffHooks

func RegisterBuffHooks(hooks BuffHooks)

func RegisterEurekaMods

func RegisterEurekaMods(read func(spellID int32) EurekaMods)

The rows sit in the spell store, which imports core, so sim/core/buffs registers their reader from its init.

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, requestId string)

func RunRaidSimConcurrent

func RunRaidSimConcurrent(request *proto.RaidSimRequest) *proto.RaidSimResult

Threading does not work in WASM!

func RunRaidSimConcurrentAsync

func RunRaidSimConcurrentAsync(request *proto.RaidSimRequest, progress chan *proto.ProgressMetrics, requestId string)

Threading does not work in WASM!

func RunRaidSimConcurrentWithSignals

func RunRaidSimConcurrentWithSignals(request *proto.RaidSimRequest, progress chan *proto.ProgressMetrics, signals simsignals.Signals) *proto.RaidSimResult

Threading does not work in WASM!

func RunSim

func RunSim(rsr *proto.RaidSimRequest, progress chan *proto.ProgressMetrics, signals simsignals.Signals) *proto.RaidSimResult

func RunSimWithAPLHook

func RunSimWithAPLHook(rsr *proto.RaidSimRequest, signals simsignals.Signals, executed APLActionHook) *proto.RaidSimResult

RunSim, calling executed with each action the sim's APLs execute (APLActionHook). The presims do not call it.

func RunTestSuite

func RunTestSuite(t *testing.T, suiteName string, generators []TestGenerator)

func SetRunningInWasm

func SetRunningInWasm()

func SetToSortedSlice

func SetToSortedSlice[K cmp.Ordered](src map[K]bool) []K

Allows Go maps to be used like the "Set" type commonly found in other languages

func SinglePlayerRaidProto

func SinglePlayerRaidProto(player *proto.Player, partyBuffs *proto.PartyBuffs, raidBuffs *proto.RaidBuffs, debuffs *proto.Debuffs) *proto.Raid

func SplitSimRequestForConcurrency

func SplitSimRequestForConcurrency(request *proto.RaidSimRequest, splitCount int32) *proto.RaidSimRequestSplitResult

Will split into min(splitCount, iterations) requests.

func StatWeightCompute

func StatWeightCompute(request *proto.StatWeightsCalcRequest) *proto.StatWeightsResult

func StatWeightRequests

func StatWeightRequests(request *proto.StatWeightsRequest) *proto.StatWeightRequestsData

Get data for all requests needed for stat weights.

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, requestId string)

func StringFromActionIDs

func StringFromActionIDs(actionIDs []ActionID) string

func StringFromStatTypes

func StringFromStatTypes(statTypes []stats.Stat) string

func SymmetricMultiplierFromPercent

func SymmetricMultiplierFromPercent(percent float64) float64

A percentage as a multiplier whose negative divides by the factor its positive multiplies by: 20 is 1.2 and -20 is 1/1.2.

func Ternary

func Ternary[T any](condition bool, val1 T, val2 T) T

func TernaryDuration

func TernaryDuration(condition bool, val1 time.Duration, val2 time.Duration) time.Duration

func TernaryFloat64

func TernaryFloat64(condition bool, val1 float64, val2 float64) float64

func TernaryInt

func TernaryInt(condition bool, val1 int, val2 int) int

func TernaryInt32

func TernaryInt32(condition bool, val1 int32, val2 int32) int32

func TernaryInt64

func TernaryInt64(condition bool, val1 int64, val2 int64) int64

func TrinketSlots

func TrinketSlots() []proto.ItemSlot

func UnitLevelFloat64

func UnitLevelFloat64(levelDiff int32, plus0Val float64, plus1Val float64, plus2Val float64, plus3Val float64) float64

func WeaponSubclassMask

func WeaponSubclassMask(types ...proto.WeaponType) int32

The weapon subclass mask naming every weapon of these types, one- and two-handed alike.

func WeaponTestSlots

func WeaponTestSlots(mainHand, offHand, ranged int32) []*proto.ItemSpec

func WithSpec

func WithSpec(player *proto.Player, spec any) *proto.Player

Applies the spec options to the given player. This is only necessary because the generated proto code does not export oneof interface types. Player is returned so this function can be used in-line with player creation.

func WithinToleranceFloat64

func WithinToleranceFloat64(expectedValue float64, actualValue float64, tolerance float64) bool

Types

type AIFactory

type AIFactory func() TargetAI

type APLAction

type APLAction struct {
	// contains filtered or unexported fields
}

func (*APLAction) Execute

func (action *APLAction) Execute(sim *Simulation)

func (*APLAction) Finalize

func (action *APLAction) Finalize(rot *APLRotation)

func (*APLAction) GetAllAPLValues

func (action *APLAction) GetAllAPLValues() []APLValue

Returns all APLValues used by this action and all of its inner Actions.

func (*APLAction) GetAllActions

func (action *APLAction) GetAllActions() []*APLAction

Returns this Action, along with all inner Actions.

func (*APLAction) GetAllSpells

func (action *APLAction) GetAllSpells() []*Spell

func (*APLAction) IsReady

func (action *APLAction) IsReady(sim *Simulation) bool

func (*APLAction) String

func (action *APLAction) String() string

type APLActionActivateAllStatBuffProcAuras

type APLActionActivateAllStatBuffProcAuras struct {
	// contains filtered or unexported fields
}

func (*APLActionActivateAllStatBuffProcAuras) Execute

func (action *APLActionActivateAllStatBuffProcAuras) Execute(sim *Simulation)

func (APLActionActivateAllStatBuffProcAuras) Finalize

func (impl APLActionActivateAllStatBuffProcAuras) Finalize(*APLRotation)

func (APLActionActivateAllStatBuffProcAuras) GetAPLValues

func (impl APLActionActivateAllStatBuffProcAuras) GetAPLValues() []APLValue

func (APLActionActivateAllStatBuffProcAuras) GetInnerActions

func (impl APLActionActivateAllStatBuffProcAuras) GetInnerActions() []*APLAction

func (APLActionActivateAllStatBuffProcAuras) GetNextAction

func (impl APLActionActivateAllStatBuffProcAuras) GetNextAction(*Simulation) *APLAction

func (*APLActionActivateAllStatBuffProcAuras) IsReady

func (APLActionActivateAllStatBuffProcAuras) PostFinalize

func (impl APLActionActivateAllStatBuffProcAuras) PostFinalize(*APLRotation)

func (APLActionActivateAllStatBuffProcAuras) ReplaceAPLValues

func (impl APLActionActivateAllStatBuffProcAuras) ReplaceAPLValues(func(APLValue) APLValue)

func (APLActionActivateAllStatBuffProcAuras) Reset

func (impl APLActionActivateAllStatBuffProcAuras) Reset(*Simulation)

func (*APLActionActivateAllStatBuffProcAuras) String

type APLActionActivateAura

type APLActionActivateAura struct {
	// contains filtered or unexported fields
}

func (*APLActionActivateAura) Execute

func (action *APLActionActivateAura) Execute(sim *Simulation)

func (APLActionActivateAura) Finalize

func (impl APLActionActivateAura) Finalize(*APLRotation)

func (APLActionActivateAura) GetAPLValues

func (impl APLActionActivateAura) GetAPLValues() []APLValue

func (APLActionActivateAura) GetInnerActions

func (impl APLActionActivateAura) GetInnerActions() []*APLAction

func (APLActionActivateAura) GetNextAction

func (impl APLActionActivateAura) GetNextAction(*Simulation) *APLAction

func (*APLActionActivateAura) IsReady

func (action *APLActionActivateAura) IsReady(sim *Simulation) bool

func (APLActionActivateAura) PostFinalize

func (impl APLActionActivateAura) PostFinalize(*APLRotation)

func (APLActionActivateAura) ReplaceAPLValues

func (impl APLActionActivateAura) ReplaceAPLValues(func(APLValue) APLValue)

func (APLActionActivateAura) Reset

func (impl APLActionActivateAura) Reset(*Simulation)

func (*APLActionActivateAura) String

func (action *APLActionActivateAura) String() string

type APLActionActivateAuraWithStacks

type APLActionActivateAuraWithStacks struct {
	// contains filtered or unexported fields
}

func (*APLActionActivateAuraWithStacks) Execute

func (action *APLActionActivateAuraWithStacks) Execute(sim *Simulation)

func (APLActionActivateAuraWithStacks) Finalize

func (impl APLActionActivateAuraWithStacks) Finalize(*APLRotation)

func (APLActionActivateAuraWithStacks) GetAPLValues

func (impl APLActionActivateAuraWithStacks) GetAPLValues() []APLValue

func (APLActionActivateAuraWithStacks) GetInnerActions

func (impl APLActionActivateAuraWithStacks) GetInnerActions() []*APLAction

func (APLActionActivateAuraWithStacks) GetNextAction

func (impl APLActionActivateAuraWithStacks) GetNextAction(*Simulation) *APLAction

func (*APLActionActivateAuraWithStacks) IsReady

func (action *APLActionActivateAuraWithStacks) IsReady(sim *Simulation) bool

func (APLActionActivateAuraWithStacks) PostFinalize

func (impl APLActionActivateAuraWithStacks) PostFinalize(*APLRotation)

func (APLActionActivateAuraWithStacks) ReplaceAPLValues

func (impl APLActionActivateAuraWithStacks) ReplaceAPLValues(func(APLValue) APLValue)

func (APLActionActivateAuraWithStacks) Reset

func (impl APLActionActivateAuraWithStacks) Reset(*Simulation)

func (*APLActionActivateAuraWithStacks) String

func (action *APLActionActivateAuraWithStacks) String() string

type APLActionAutocastOtherCooldowns

type APLActionAutocastOtherCooldowns struct {
	// contains filtered or unexported fields
}

func (*APLActionAutocastOtherCooldowns) Execute

func (action *APLActionAutocastOtherCooldowns) Execute(sim *Simulation)

func (APLActionAutocastOtherCooldowns) Finalize

func (impl APLActionAutocastOtherCooldowns) Finalize(*APLRotation)

func (APLActionAutocastOtherCooldowns) GetAPLValues

func (impl APLActionAutocastOtherCooldowns) GetAPLValues() []APLValue

func (APLActionAutocastOtherCooldowns) GetInnerActions

func (impl APLActionAutocastOtherCooldowns) GetInnerActions() []*APLAction

func (APLActionAutocastOtherCooldowns) GetNextAction

func (impl APLActionAutocastOtherCooldowns) GetNextAction(*Simulation) *APLAction

func (*APLActionAutocastOtherCooldowns) IsReady

func (action *APLActionAutocastOtherCooldowns) IsReady(sim *Simulation) bool

func (*APLActionAutocastOtherCooldowns) PostFinalize

func (action *APLActionAutocastOtherCooldowns) PostFinalize(rot *APLRotation)

func (APLActionAutocastOtherCooldowns) ReplaceAPLValues

func (impl APLActionAutocastOtherCooldowns) ReplaceAPLValues(func(APLValue) APLValue)

func (*APLActionAutocastOtherCooldowns) Reset

func (*APLActionAutocastOtherCooldowns) String

func (action *APLActionAutocastOtherCooldowns) String() string

type APLActionCancelAura

type APLActionCancelAura struct {
	// contains filtered or unexported fields
}

func (*APLActionCancelAura) Execute

func (action *APLActionCancelAura) Execute(sim *Simulation)

func (APLActionCancelAura) Finalize

func (impl APLActionCancelAura) Finalize(*APLRotation)

func (APLActionCancelAura) GetAPLValues

func (impl APLActionCancelAura) GetAPLValues() []APLValue

func (APLActionCancelAura) GetInnerActions

func (impl APLActionCancelAura) GetInnerActions() []*APLAction

func (APLActionCancelAura) GetNextAction

func (impl APLActionCancelAura) GetNextAction(*Simulation) *APLAction

func (*APLActionCancelAura) IsReady

func (action *APLActionCancelAura) IsReady(sim *Simulation) bool

func (APLActionCancelAura) PostFinalize

func (impl APLActionCancelAura) PostFinalize(*APLRotation)

func (APLActionCancelAura) ReplaceAPLValues

func (impl APLActionCancelAura) ReplaceAPLValues(func(APLValue) APLValue)

func (APLActionCancelAura) Reset

func (impl APLActionCancelAura) Reset(*Simulation)

func (*APLActionCancelAura) String

func (action *APLActionCancelAura) String() string

type APLActionCastAllStatBuffCooldowns

type APLActionCastAllStatBuffCooldowns struct {
	// contains filtered or unexported fields
}

func (*APLActionCastAllStatBuffCooldowns) Execute

func (action *APLActionCastAllStatBuffCooldowns) Execute(sim *Simulation)

func (APLActionCastAllStatBuffCooldowns) Finalize

func (impl APLActionCastAllStatBuffCooldowns) Finalize(*APLRotation)

func (APLActionCastAllStatBuffCooldowns) GetAPLValues

func (impl APLActionCastAllStatBuffCooldowns) GetAPLValues() []APLValue

func (APLActionCastAllStatBuffCooldowns) GetInnerActions

func (impl APLActionCastAllStatBuffCooldowns) GetInnerActions() []*APLAction

func (APLActionCastAllStatBuffCooldowns) GetNextAction

func (impl APLActionCastAllStatBuffCooldowns) GetNextAction(*Simulation) *APLAction

func (*APLActionCastAllStatBuffCooldowns) IsReady

func (action *APLActionCastAllStatBuffCooldowns) IsReady(sim *Simulation) bool

func (*APLActionCastAllStatBuffCooldowns) PostFinalize

func (action *APLActionCastAllStatBuffCooldowns) PostFinalize(rot *APLRotation)

func (APLActionCastAllStatBuffCooldowns) ReplaceAPLValues

func (impl APLActionCastAllStatBuffCooldowns) ReplaceAPLValues(func(APLValue) APLValue)

func (APLActionCastAllStatBuffCooldowns) Reset

func (impl APLActionCastAllStatBuffCooldowns) Reset(*Simulation)

func (*APLActionCastAllStatBuffCooldowns) String

func (action *APLActionCastAllStatBuffCooldowns) String() string

type APLActionCastFriendlySpell

type APLActionCastFriendlySpell struct {
	// contains filtered or unexported fields
}

func (*APLActionCastFriendlySpell) Execute

func (action *APLActionCastFriendlySpell) Execute(sim *Simulation)

func (APLActionCastFriendlySpell) Finalize

func (impl APLActionCastFriendlySpell) Finalize(*APLRotation)

func (APLActionCastFriendlySpell) GetAPLValues

func (impl APLActionCastFriendlySpell) GetAPLValues() []APLValue

func (APLActionCastFriendlySpell) GetInnerActions

func (impl APLActionCastFriendlySpell) GetInnerActions() []*APLAction

func (APLActionCastFriendlySpell) GetNextAction

func (impl APLActionCastFriendlySpell) GetNextAction(*Simulation) *APLAction

func (*APLActionCastFriendlySpell) IsReady

func (action *APLActionCastFriendlySpell) IsReady(sim *Simulation) bool

func (APLActionCastFriendlySpell) PostFinalize

func (impl APLActionCastFriendlySpell) PostFinalize(*APLRotation)

func (APLActionCastFriendlySpell) ReplaceAPLValues

func (impl APLActionCastFriendlySpell) ReplaceAPLValues(func(APLValue) APLValue)

func (APLActionCastFriendlySpell) Reset

func (impl APLActionCastFriendlySpell) Reset(*Simulation)

func (*APLActionCastFriendlySpell) String

func (action *APLActionCastFriendlySpell) String() string

type APLActionCastSpell

type APLActionCastSpell struct {
	// contains filtered or unexported fields
}

func (*APLActionCastSpell) Execute

func (action *APLActionCastSpell) Execute(sim *Simulation)

func (APLActionCastSpell) Finalize

func (impl APLActionCastSpell) Finalize(*APLRotation)

func (APLActionCastSpell) GetAPLValues

func (impl APLActionCastSpell) GetAPLValues() []APLValue

func (APLActionCastSpell) GetInnerActions

func (impl APLActionCastSpell) GetInnerActions() []*APLAction

func (APLActionCastSpell) GetNextAction

func (impl APLActionCastSpell) GetNextAction(*Simulation) *APLAction

func (*APLActionCastSpell) IsReady

func (action *APLActionCastSpell) IsReady(sim *Simulation) bool

func (APLActionCastSpell) PostFinalize

func (impl APLActionCastSpell) PostFinalize(*APLRotation)

func (APLActionCastSpell) ReplaceAPLValues

func (impl APLActionCastSpell) ReplaceAPLValues(func(APLValue) APLValue)

func (APLActionCastSpell) Reset

func (impl APLActionCastSpell) Reset(*Simulation)

func (*APLActionCastSpell) String

func (action *APLActionCastSpell) String() string

type APLActionChangeTarget

type APLActionChangeTarget struct {
	// contains filtered or unexported fields
}

func (*APLActionChangeTarget) Execute

func (action *APLActionChangeTarget) Execute(sim *Simulation)

func (APLActionChangeTarget) Finalize

func (impl APLActionChangeTarget) Finalize(*APLRotation)

func (APLActionChangeTarget) GetAPLValues

func (impl APLActionChangeTarget) GetAPLValues() []APLValue

func (APLActionChangeTarget) GetInnerActions

func (impl APLActionChangeTarget) GetInnerActions() []*APLAction

func (APLActionChangeTarget) GetNextAction

func (impl APLActionChangeTarget) GetNextAction(*Simulation) *APLAction

func (*APLActionChangeTarget) IsReady

func (action *APLActionChangeTarget) IsReady(sim *Simulation) bool

func (APLActionChangeTarget) PostFinalize

func (impl APLActionChangeTarget) PostFinalize(*APLRotation)

func (APLActionChangeTarget) ReplaceAPLValues

func (impl APLActionChangeTarget) ReplaceAPLValues(func(APLValue) APLValue)

func (*APLActionChangeTarget) Reset

func (action *APLActionChangeTarget) Reset(sim *Simulation)

func (*APLActionChangeTarget) String

func (action *APLActionChangeTarget) String() string

type APLActionChannelSpell

type APLActionChannelSpell struct {
	// contains filtered or unexported fields
}

func (*APLActionChannelSpell) Execute

func (action *APLActionChannelSpell) Execute(sim *Simulation)

func (APLActionChannelSpell) Finalize

func (impl APLActionChannelSpell) Finalize(*APLRotation)

func (*APLActionChannelSpell) GetAPLValues

func (action *APLActionChannelSpell) GetAPLValues() []APLValue

func (APLActionChannelSpell) GetInnerActions

func (impl APLActionChannelSpell) GetInnerActions() []*APLAction

func (APLActionChannelSpell) GetNextAction

func (impl APLActionChannelSpell) GetNextAction(*Simulation) *APLAction

func (*APLActionChannelSpell) IsReady

func (action *APLActionChannelSpell) IsReady(sim *Simulation) bool

func (APLActionChannelSpell) PostFinalize

func (impl APLActionChannelSpell) PostFinalize(*APLRotation)

func (*APLActionChannelSpell) ReplaceAPLValues

func (action *APLActionChannelSpell) ReplaceAPLValues(replace func(APLValue) APLValue)

func (APLActionChannelSpell) Reset

func (impl APLActionChannelSpell) Reset(*Simulation)

func (*APLActionChannelSpell) String

func (action *APLActionChannelSpell) String() string

type APLActionCustomRotation

type APLActionCustomRotation struct {
	// contains filtered or unexported fields
}

func (*APLActionCustomRotation) Execute

func (action *APLActionCustomRotation) Execute(sim *Simulation)

func (APLActionCustomRotation) Finalize

func (impl APLActionCustomRotation) Finalize(*APLRotation)

func (APLActionCustomRotation) GetAPLValues

func (impl APLActionCustomRotation) GetAPLValues() []APLValue

func (APLActionCustomRotation) GetInnerActions

func (impl APLActionCustomRotation) GetInnerActions() []*APLAction

func (APLActionCustomRotation) GetNextAction

func (impl APLActionCustomRotation) GetNextAction(*Simulation) *APLAction

func (*APLActionCustomRotation) IsReady

func (action *APLActionCustomRotation) IsReady(sim *Simulation) bool

func (APLActionCustomRotation) PostFinalize

func (impl APLActionCustomRotation) PostFinalize(*APLRotation)

func (APLActionCustomRotation) ReplaceAPLValues

func (impl APLActionCustomRotation) ReplaceAPLValues(func(APLValue) APLValue)

func (*APLActionCustomRotation) Reset

func (action *APLActionCustomRotation) Reset(sim *Simulation)

func (*APLActionCustomRotation) String

func (action *APLActionCustomRotation) String() string

type APLActionGroupReference

type APLActionGroupReference struct {
	// contains filtered or unexported fields
}

func (*APLActionGroupReference) Execute

func (action *APLActionGroupReference) Execute(sim *Simulation)

func (*APLActionGroupReference) Finalize

func (action *APLActionGroupReference) Finalize(rot *APLRotation)

func (*APLActionGroupReference) GetAPLValues

func (action *APLActionGroupReference) GetAPLValues() []APLValue

func (*APLActionGroupReference) GetInnerActions

func (action *APLActionGroupReference) GetInnerActions() []*APLAction

func (APLActionGroupReference) GetNextAction

func (impl APLActionGroupReference) GetNextAction(*Simulation) *APLAction

func (*APLActionGroupReference) IsReady

func (action *APLActionGroupReference) IsReady(sim *Simulation) bool

func (APLActionGroupReference) PostFinalize

func (impl APLActionGroupReference) PostFinalize(*APLRotation)

func (APLActionGroupReference) ReplaceAPLValues

func (impl APLActionGroupReference) ReplaceAPLValues(func(APLValue) APLValue)

func (*APLActionGroupReference) Reset

func (action *APLActionGroupReference) Reset(sim *Simulation)

func (*APLActionGroupReference) String

func (action *APLActionGroupReference) String() string

type APLActionHook

type APLActionHook func(sim *Simulation, action *APLAction)

Called with every action a sim that RunSimWithAPLHook runs executes: a row, a group reference's row and then the row it ran from the group, and the actions inside a row. Tools that read a rotation's choices pass one, and find the rows among the actions with APLRotation.RowPaths.

type APLActionImpl

type APLActionImpl interface {
	// Returns all inner APL Actions.
	GetInnerActions() []*APLAction

	// Returns all APLValues used by this Action (but not by inner Actions).
	GetAPLValues() []APLValue

	// Performs optional post-processing.
	Finalize(*APLRotation)
	PostFinalize(*APLRotation)

	// Invoked before each sim iteration.
	Reset(*Simulation)

	// Whether this action is available to be used right now.
	IsReady(*Simulation) bool

	// Performs the action.
	Execute(*Simulation)

	// Called only while this action is controlling the rotation.
	GetNextAction(sim *Simulation) *APLAction

	// Swaps each value this action holds in its own fields for what replace gives for it.
	ReplaceAPLValues(replace func(APLValue) APLValue)

	// Pretty-print string for debugging.
	String() string
}

type APLActionItemSwap

type APLActionItemSwap struct {
	// contains filtered or unexported fields
}

func (*APLActionItemSwap) Execute

func (action *APLActionItemSwap) Execute(sim *Simulation)

func (APLActionItemSwap) Finalize

func (impl APLActionItemSwap) Finalize(*APLRotation)

func (APLActionItemSwap) GetAPLValues

func (impl APLActionItemSwap) GetAPLValues() []APLValue

func (APLActionItemSwap) GetInnerActions

func (impl APLActionItemSwap) GetInnerActions() []*APLAction

func (APLActionItemSwap) GetNextAction

func (impl APLActionItemSwap) GetNextAction(*Simulation) *APLAction

func (*APLActionItemSwap) IsReady

func (action *APLActionItemSwap) IsReady(sim *Simulation) bool

func (APLActionItemSwap) PostFinalize

func (impl APLActionItemSwap) PostFinalize(*APLRotation)

func (APLActionItemSwap) ReplaceAPLValues

func (impl APLActionItemSwap) ReplaceAPLValues(func(APLValue) APLValue)

func (APLActionItemSwap) Reset

func (impl APLActionItemSwap) Reset(*Simulation)

func (*APLActionItemSwap) String

func (action *APLActionItemSwap) String() string

type APLActionMove

type APLActionMove struct {
	// contains filtered or unexported fields
}

func (*APLActionMove) Execute

func (action *APLActionMove) Execute(sim *Simulation)

func (APLActionMove) Finalize

func (impl APLActionMove) Finalize(*APLRotation)

func (*APLActionMove) GetAPLValues

func (action *APLActionMove) GetAPLValues() []APLValue

func (APLActionMove) GetInnerActions

func (impl APLActionMove) GetInnerActions() []*APLAction

func (APLActionMove) GetNextAction

func (impl APLActionMove) GetNextAction(*Simulation) *APLAction

func (*APLActionMove) IsReady

func (action *APLActionMove) IsReady(sim *Simulation) bool

func (APLActionMove) PostFinalize

func (impl APLActionMove) PostFinalize(*APLRotation)

func (*APLActionMove) ReplaceAPLValues

func (action *APLActionMove) ReplaceAPLValues(replace func(APLValue) APLValue)

func (APLActionMove) Reset

func (impl APLActionMove) Reset(*Simulation)

func (*APLActionMove) String

func (action *APLActionMove) String() string

type APLActionMoveDuration

type APLActionMoveDuration struct {
	// contains filtered or unexported fields
}

func (*APLActionMoveDuration) Execute

func (action *APLActionMoveDuration) Execute(sim *Simulation)

func (APLActionMoveDuration) Finalize

func (impl APLActionMoveDuration) Finalize(*APLRotation)

func (*APLActionMoveDuration) GetAPLValues

func (action *APLActionMoveDuration) GetAPLValues() []APLValue

func (APLActionMoveDuration) GetInnerActions

func (impl APLActionMoveDuration) GetInnerActions() []*APLAction

func (APLActionMoveDuration) GetNextAction

func (impl APLActionMoveDuration) GetNextAction(*Simulation) *APLAction

func (*APLActionMoveDuration) IsReady

func (action *APLActionMoveDuration) IsReady(sim *Simulation) bool

func (APLActionMoveDuration) PostFinalize

func (impl APLActionMoveDuration) PostFinalize(*APLRotation)

func (*APLActionMoveDuration) ReplaceAPLValues

func (action *APLActionMoveDuration) ReplaceAPLValues(replace func(APLValue) APLValue)

func (APLActionMoveDuration) Reset

func (impl APLActionMoveDuration) Reset(*Simulation)

func (*APLActionMoveDuration) String

func (action *APLActionMoveDuration) String() string

type APLActionMultidot

type APLActionMultidot struct {
	// contains filtered or unexported fields
}

func (*APLActionMultidot) Execute

func (action *APLActionMultidot) Execute(sim *Simulation)

func (APLActionMultidot) Finalize

func (impl APLActionMultidot) Finalize(*APLRotation)

func (*APLActionMultidot) GetAPLValues

func (action *APLActionMultidot) GetAPLValues() []APLValue

func (APLActionMultidot) GetInnerActions

func (impl APLActionMultidot) GetInnerActions() []*APLAction

func (APLActionMultidot) GetNextAction

func (impl APLActionMultidot) GetNextAction(*Simulation) *APLAction

func (*APLActionMultidot) IsReady

func (action *APLActionMultidot) IsReady(sim *Simulation) bool

func (APLActionMultidot) PostFinalize

func (impl APLActionMultidot) PostFinalize(*APLRotation)

func (*APLActionMultidot) ReplaceAPLValues

func (action *APLActionMultidot) ReplaceAPLValues(replace func(APLValue) APLValue)

func (*APLActionMultidot) Reset

func (action *APLActionMultidot) Reset(*Simulation)

func (*APLActionMultidot) String

func (action *APLActionMultidot) String() string

type APLActionMultishield

type APLActionMultishield struct {
	// contains filtered or unexported fields
}

func (*APLActionMultishield) Execute

func (action *APLActionMultishield) Execute(sim *Simulation)

func (APLActionMultishield) Finalize

func (impl APLActionMultishield) Finalize(*APLRotation)

func (*APLActionMultishield) GetAPLValues

func (action *APLActionMultishield) GetAPLValues() []APLValue

func (APLActionMultishield) GetInnerActions

func (impl APLActionMultishield) GetInnerActions() []*APLAction

func (APLActionMultishield) GetNextAction

func (impl APLActionMultishield) GetNextAction(*Simulation) *APLAction

func (*APLActionMultishield) IsReady

func (action *APLActionMultishield) IsReady(sim *Simulation) bool

func (APLActionMultishield) PostFinalize

func (impl APLActionMultishield) PostFinalize(*APLRotation)

func (*APLActionMultishield) ReplaceAPLValues

func (action *APLActionMultishield) ReplaceAPLValues(replace func(APLValue) APLValue)

func (*APLActionMultishield) Reset

func (action *APLActionMultishield) Reset(*Simulation)

func (*APLActionMultishield) String

func (action *APLActionMultishield) String() string

type APLActionPetAttack

type APLActionPetAttack struct {
	// contains filtered or unexported fields
}

func (*APLActionPetAttack) Execute

func (action *APLActionPetAttack) Execute(sim *Simulation)

func (APLActionPetAttack) Finalize

func (impl APLActionPetAttack) Finalize(*APLRotation)

func (APLActionPetAttack) GetAPLValues

func (impl APLActionPetAttack) GetAPLValues() []APLValue

func (APLActionPetAttack) GetInnerActions

func (impl APLActionPetAttack) GetInnerActions() []*APLAction

func (APLActionPetAttack) GetNextAction

func (impl APLActionPetAttack) GetNextAction(*Simulation) *APLAction

func (*APLActionPetAttack) IsReady

func (action *APLActionPetAttack) IsReady(_ *Simulation) bool

func (APLActionPetAttack) PostFinalize

func (impl APLActionPetAttack) PostFinalize(*APLRotation)

func (APLActionPetAttack) ReplaceAPLValues

func (impl APLActionPetAttack) ReplaceAPLValues(func(APLValue) APLValue)

func (APLActionPetAttack) Reset

func (impl APLActionPetAttack) Reset(*Simulation)

func (*APLActionPetAttack) String

func (action *APLActionPetAttack) String() string

type APLActionResetSequence

type APLActionResetSequence struct {
	// contains filtered or unexported fields
}

func (*APLActionResetSequence) Execute

func (action *APLActionResetSequence) Execute(sim *Simulation)

func (*APLActionResetSequence) Finalize

func (action *APLActionResetSequence) Finalize(rot *APLRotation)

func (APLActionResetSequence) GetAPLValues

func (impl APLActionResetSequence) GetAPLValues() []APLValue

func (APLActionResetSequence) GetInnerActions

func (impl APLActionResetSequence) GetInnerActions() []*APLAction

func (APLActionResetSequence) GetNextAction

func (impl APLActionResetSequence) GetNextAction(*Simulation) *APLAction

func (*APLActionResetSequence) IsReady

func (action *APLActionResetSequence) IsReady(sim *Simulation) bool

func (APLActionResetSequence) PostFinalize

func (impl APLActionResetSequence) PostFinalize(*APLRotation)

func (APLActionResetSequence) ReplaceAPLValues

func (impl APLActionResetSequence) ReplaceAPLValues(func(APLValue) APLValue)

func (APLActionResetSequence) Reset

func (impl APLActionResetSequence) Reset(*Simulation)

func (*APLActionResetSequence) String

func (action *APLActionResetSequence) String() string

type APLActionSchedule

type APLActionSchedule struct {
	// contains filtered or unexported fields
}

func (*APLActionSchedule) Execute

func (action *APLActionSchedule) Execute(sim *Simulation)

func (APLActionSchedule) Finalize

func (impl APLActionSchedule) Finalize(*APLRotation)

func (APLActionSchedule) GetAPLValues

func (impl APLActionSchedule) GetAPLValues() []APLValue

func (*APLActionSchedule) GetInnerActions

func (action *APLActionSchedule) GetInnerActions() []*APLAction

func (APLActionSchedule) GetNextAction

func (impl APLActionSchedule) GetNextAction(*Simulation) *APLAction

func (*APLActionSchedule) IsReady

func (action *APLActionSchedule) IsReady(sim *Simulation) bool

func (APLActionSchedule) PostFinalize

func (impl APLActionSchedule) PostFinalize(*APLRotation)

func (APLActionSchedule) ReplaceAPLValues

func (impl APLActionSchedule) ReplaceAPLValues(func(APLValue) APLValue)

func (*APLActionSchedule) Reset

func (action *APLActionSchedule) Reset(*Simulation)

func (*APLActionSchedule) String

func (action *APLActionSchedule) String() string

type APLActionSequence

type APLActionSequence struct {
	// contains filtered or unexported fields
}

func (*APLActionSequence) Execute

func (action *APLActionSequence) Execute(sim *Simulation)

func (*APLActionSequence) Finalize

func (action *APLActionSequence) Finalize(rot *APLRotation)

func (APLActionSequence) GetAPLValues

func (impl APLActionSequence) GetAPLValues() []APLValue

func (*APLActionSequence) GetInnerActions

func (action *APLActionSequence) GetInnerActions() []*APLAction

func (APLActionSequence) GetNextAction

func (impl APLActionSequence) GetNextAction(*Simulation) *APLAction

func (*APLActionSequence) IsReady

func (action *APLActionSequence) IsReady(sim *Simulation) bool

func (*APLActionSequence) PostFinalize

func (action *APLActionSequence) PostFinalize(rot *APLRotation)

func (APLActionSequence) ReplaceAPLValues

func (impl APLActionSequence) ReplaceAPLValues(func(APLValue) APLValue)

func (*APLActionSequence) Reset

func (action *APLActionSequence) Reset(*Simulation)

func (*APLActionSequence) String

func (action *APLActionSequence) String() string

type APLActionStartAttack

type APLActionStartAttack struct {
	// contains filtered or unexported fields
}

func (*APLActionStartAttack) Execute

func (action *APLActionStartAttack) Execute(sim *Simulation)

func (APLActionStartAttack) Finalize

func (impl APLActionStartAttack) Finalize(*APLRotation)

func (APLActionStartAttack) GetAPLValues

func (impl APLActionStartAttack) GetAPLValues() []APLValue

func (APLActionStartAttack) GetInnerActions

func (impl APLActionStartAttack) GetInnerActions() []*APLAction

func (APLActionStartAttack) GetNextAction

func (impl APLActionStartAttack) GetNextAction(*Simulation) *APLAction

func (*APLActionStartAttack) IsReady

func (action *APLActionStartAttack) IsReady(_ *Simulation) bool

func (APLActionStartAttack) PostFinalize

func (impl APLActionStartAttack) PostFinalize(*APLRotation)

func (APLActionStartAttack) ReplaceAPLValues

func (impl APLActionStartAttack) ReplaceAPLValues(func(APLValue) APLValue)

func (APLActionStartAttack) Reset

func (impl APLActionStartAttack) Reset(*Simulation)

func (*APLActionStartAttack) String

func (action *APLActionStartAttack) String() string

type APLActionStrictMultidot

type APLActionStrictMultidot struct {
	// contains filtered or unexported fields
}

func (*APLActionStrictMultidot) Execute

func (action *APLActionStrictMultidot) Execute(sim *Simulation)

The gate re-checks the entry's If and the If of every Group Reference above it, at any depth; the Ifs of Sequence and Schedule wrappers only decide the start.

func (APLActionStrictMultidot) Finalize

func (impl APLActionStrictMultidot) Finalize(*APLRotation)

func (*APLActionStrictMultidot) GetAPLValues

func (action *APLActionStrictMultidot) GetAPLValues() []APLValue

func (APLActionStrictMultidot) GetInnerActions

func (impl APLActionStrictMultidot) GetInnerActions() []*APLAction

func (APLActionStrictMultidot) GetNextAction

func (impl APLActionStrictMultidot) GetNextAction(*Simulation) *APLAction

func (*APLActionStrictMultidot) IsReady

func (action *APLActionStrictMultidot) IsReady(sim *Simulation) bool

func (APLActionStrictMultidot) PostFinalize

func (impl APLActionStrictMultidot) PostFinalize(*APLRotation)

func (*APLActionStrictMultidot) ReplaceAPLValues

func (action *APLActionStrictMultidot) ReplaceAPLValues(replace func(APLValue) APLValue)

func (*APLActionStrictMultidot) Reset

func (action *APLActionStrictMultidot) Reset(*Simulation)

func (*APLActionStrictMultidot) String

func (action *APLActionStrictMultidot) String() string

type APLActionStrictSequence

type APLActionStrictSequence struct {
	// contains filtered or unexported fields
}

func (*APLActionStrictSequence) Execute

func (action *APLActionStrictSequence) Execute(sim *Simulation)

func (*APLActionStrictSequence) Finalize

func (action *APLActionStrictSequence) Finalize(rot *APLRotation)

func (APLActionStrictSequence) GetAPLValues

func (impl APLActionStrictSequence) GetAPLValues() []APLValue

func (*APLActionStrictSequence) GetInnerActions

func (action *APLActionStrictSequence) GetInnerActions() []*APLAction

func (*APLActionStrictSequence) GetNextAction

func (action *APLActionStrictSequence) GetNextAction(sim *Simulation) *APLAction

func (*APLActionStrictSequence) IsReady

func (action *APLActionStrictSequence) IsReady(sim *Simulation) bool

func (*APLActionStrictSequence) PostFinalize

func (action *APLActionStrictSequence) PostFinalize(rot *APLRotation)

func (APLActionStrictSequence) ReplaceAPLValues

func (impl APLActionStrictSequence) ReplaceAPLValues(func(APLValue) APLValue)

func (*APLActionStrictSequence) Reset

func (action *APLActionStrictSequence) Reset(*Simulation)

func (*APLActionStrictSequence) String

func (action *APLActionStrictSequence) String() string

type APLActionTriggerICD

type APLActionTriggerICD struct {
	// contains filtered or unexported fields
}

func (*APLActionTriggerICD) Execute

func (action *APLActionTriggerICD) Execute(sim *Simulation)

func (APLActionTriggerICD) Finalize

func (impl APLActionTriggerICD) Finalize(*APLRotation)

func (APLActionTriggerICD) GetAPLValues

func (impl APLActionTriggerICD) GetAPLValues() []APLValue

func (APLActionTriggerICD) GetInnerActions

func (impl APLActionTriggerICD) GetInnerActions() []*APLAction

func (APLActionTriggerICD) GetNextAction

func (impl APLActionTriggerICD) GetNextAction(*Simulation) *APLAction

func (*APLActionTriggerICD) IsReady

func (action *APLActionTriggerICD) IsReady(sim *Simulation) bool

func (APLActionTriggerICD) PostFinalize

func (impl APLActionTriggerICD) PostFinalize(*APLRotation)

func (APLActionTriggerICD) ReplaceAPLValues

func (impl APLActionTriggerICD) ReplaceAPLValues(func(APLValue) APLValue)

func (APLActionTriggerICD) Reset

func (impl APLActionTriggerICD) Reset(*Simulation)

func (*APLActionTriggerICD) String

func (action *APLActionTriggerICD) String() string

type APLActionWait

type APLActionWait struct {
	// contains filtered or unexported fields
}

func (*APLActionWait) Execute

func (action *APLActionWait) Execute(sim *Simulation)

func (APLActionWait) Finalize

func (impl APLActionWait) Finalize(*APLRotation)

func (*APLActionWait) GetAPLValues

func (action *APLActionWait) GetAPLValues() []APLValue

func (APLActionWait) GetInnerActions

func (impl APLActionWait) GetInnerActions() []*APLAction

func (*APLActionWait) GetNextAction

func (action *APLActionWait) GetNextAction(sim *Simulation) *APLAction

func (*APLActionWait) IsReady

func (action *APLActionWait) IsReady(sim *Simulation) bool

func (APLActionWait) PostFinalize

func (impl APLActionWait) PostFinalize(*APLRotation)

func (*APLActionWait) ReplaceAPLValues

func (action *APLActionWait) ReplaceAPLValues(replace func(APLValue) APLValue)

func (APLActionWait) Reset

func (impl APLActionWait) Reset(*Simulation)

func (*APLActionWait) String

func (action *APLActionWait) String() string

type APLActionWaitUntil

type APLActionWaitUntil struct {
	// contains filtered or unexported fields
}

func (*APLActionWaitUntil) Execute

func (action *APLActionWaitUntil) Execute(sim *Simulation)

func (APLActionWaitUntil) Finalize

func (impl APLActionWaitUntil) Finalize(*APLRotation)

func (*APLActionWaitUntil) GetAPLValues

func (action *APLActionWaitUntil) GetAPLValues() []APLValue

func (APLActionWaitUntil) GetInnerActions

func (impl APLActionWaitUntil) GetInnerActions() []*APLAction

func (*APLActionWaitUntil) GetNextAction

func (action *APLActionWaitUntil) GetNextAction(sim *Simulation) *APLAction

func (*APLActionWaitUntil) IsReady

func (action *APLActionWaitUntil) IsReady(sim *Simulation) bool

func (APLActionWaitUntil) PostFinalize

func (impl APLActionWaitUntil) PostFinalize(*APLRotation)

func (*APLActionWaitUntil) ReplaceAPLValues

func (action *APLActionWaitUntil) ReplaceAPLValues(replace func(APLValue) APLValue)

func (APLActionWaitUntil) Reset

func (impl APLActionWaitUntil) Reset(*Simulation)

func (*APLActionWaitUntil) String

func (action *APLActionWaitUntil) String() string

type APLGroup

type APLGroup struct {
	// contains filtered or unexported fields
}

type APLRotation

type APLRotation struct {
	// contains filtered or unexported fields
}

func (*APLRotation) DoNextAction

func (apl *APLRotation) DoNextAction(sim *Simulation)

We intentionally try to mimic the behavior of simc APL to avoid confusion and leverage the community's existing familiarity. https://github.com/simulationcraft/simc/wiki/ActionLists

func (*APLRotation) GetAPLAura

func (rot *APLRotation) GetAPLAura(sourceUnit UnitReference, auraId *proto.ActionID) AuraReference

func (*APLRotation) GetAPLDot

func (rot *APLRotation) GetAPLDot(targetUnit UnitReference, spellId *proto.ActionID) *Dot

func (*APLRotation) GetAPLICDAura

func (rot *APLRotation) GetAPLICDAura(sourceUnit UnitReference, auraId *proto.ActionID) AuraReference

func (*APLRotation) GetAPLItemProcAuras

func (rot *APLRotation) GetAPLItemProcAuras(statTypesToMatch []stats.Stat, minIcd time.Duration, warnIfNoneFound bool, uuid *proto.UUID) []*StatBuffAura

func (*APLRotation) GetAPLMultidotSpell

func (rot *APLRotation) GetAPLMultidotSpell(spellId *proto.ActionID) *Spell

func (*APLRotation) GetAPLMultishieldSpell

func (rot *APLRotation) GetAPLMultishieldSpell(spellId *proto.ActionID) *Spell

func (*APLRotation) GetAPLSpell

func (rot *APLRotation) GetAPLSpell(spellId *proto.ActionID) *Spell

func (*APLRotation) GetSourceUnit

func (rot *APLRotation) GetSourceUnit(ref *proto.UnitReference) UnitReference

func (*APLRotation) GetTargetAPLSpell

func (rot *APLRotation) GetTargetAPLSpell(spellId *proto.ActionID, targetUnit UnitReference) *Spell

func (*APLRotation) GetTargetUnit

func (rot *APLRotation) GetTargetUnit(ref *proto.UnitReference) UnitReference

func (*APLRotation) HasBlockingControllingAction

func (apl *APLRotation) HasBlockingControllingAction() bool

HasBlockingControllingAction reports whether the rotation is currently parked in a controlling action that has set the rotation timer to a specific wake time and must not be cut short by reaction-time-based shrinks (Wait, WaitUntil). Cooperative controllers like StrictSequence return false.

func (*APLRotation) NewDotReference

func (rot *APLRotation) NewDotReference(targetUnitRef UnitReference, auraId *proto.ActionID) *DotReference

func (*APLRotation) NewValueSpellInFlight

func (rot *APLRotation) NewValueSpellInFlight(config *proto.APLValueSpellInFlight, uuid *proto.UUID) APLValue

func (*APLRotation) RowPaths

func (rot *APLRotation) RowPaths() map[*APLAction]string

The rows of the rotation by their JSON paths in the APL. A group referenced twice is parsed twice, and both copies carry the path of the one in the APL.

func (*APLRotation) ValidationMessage

func (rot *APLRotation) ValidationMessage(log_level proto.LogLevel, message string, vals ...any)

func (*APLRotation) ValidationMessageByUUID

func (rot *APLRotation) ValidationMessageByUUID(uuid *proto.UUID, log_level proto.LogLevel, message string, vals ...any)

type APLValue

type APLValue interface {
	// Returns all inner APLValues.
	GetInnerValues() []APLValue

	// The type of value that will be returned.
	Type() proto.APLValueType

	// Gets the value, assuming it is a particular type. Usually only one of
	// these should be implemented in each class.
	GetBool(*Simulation) bool
	GetInt(*Simulation) int32
	GetFloat(*Simulation) float64
	GetDuration(*Simulation) time.Duration
	GetString(*Simulation) string

	// Performs optional post-processing.
	Finalize(*APLRotation)

	// Pretty-print string for debugging.
	String() string
}

type APLValueActionGroupUsed

type APLValueActionGroupUsed struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueActionGroupUsed) Finalize

func (value *APLValueActionGroupUsed) Finalize(rotation *APLRotation)

func (*APLValueActionGroupUsed) GetBool

func (value *APLValueActionGroupUsed) GetBool(sim *Simulation) bool

func (*APLValueActionGroupUsed) String

func (value *APLValueActionGroupUsed) String() string

func (*APLValueActionGroupUsed) Type

type APLValueActiveItemSwapSet

type APLValueActiveItemSwapSet struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueActiveItemSwapSet) GetBool

func (value *APLValueActiveItemSwapSet) GetBool(sim *Simulation) bool

func (*APLValueActiveItemSwapSet) String

func (value *APLValueActiveItemSwapSet) String() string

func (*APLValueActiveItemSwapSet) Type

type APLValueAllItemStatProcsActive

type APLValueAllItemStatProcsActive struct {
	*APLValueItemStatProcCheck
}

func (*APLValueAllItemStatProcsActive) GetBool

func (value *APLValueAllItemStatProcsActive) GetBool(sim *Simulation) bool

func (*APLValueAllItemStatProcsActive) Type

type APLValueAnd

type APLValueAnd struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueAnd) GetBool

func (value *APLValueAnd) GetBool(sim *Simulation) bool

func (*APLValueAnd) GetInnerValues

func (value *APLValueAnd) GetInnerValues() []APLValue

func (*APLValueAnd) String

func (value *APLValueAnd) String() string

func (*APLValueAnd) Type

func (value *APLValueAnd) Type() proto.APLValueType

type APLValueAnyItemStatProcsActive

type APLValueAnyItemStatProcsActive struct {
	*APLValueItemStatProcCheck
}

func (*APLValueAnyItemStatProcsActive) GetBool

func (value *APLValueAnyItemStatProcsActive) GetBool(sim *Simulation) bool

func (*APLValueAnyItemStatProcsActive) Type

type APLValueAnyItemStatProcsAvailable

type APLValueAnyItemStatProcsAvailable struct {
	*APLValueItemStatProcCheck
}

func (*APLValueAnyItemStatProcsAvailable) GetBool

func (value *APLValueAnyItemStatProcsAvailable) GetBool(sim *Simulation) bool

unsure if this works correctly based on a weird bug i observed... this was seemingly returning true if no matching auras were found need to debug further

func (*APLValueAnyItemStatProcsAvailable) Type

type APLValueAnyStatBuffCooldownsActive

type APLValueAnyStatBuffCooldownsActive struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueAnyStatBuffCooldownsActive) Finalize

func (value *APLValueAnyStatBuffCooldownsActive) Finalize(rot *APLRotation)

func (*APLValueAnyStatBuffCooldownsActive) GetBool

func (*APLValueAnyStatBuffCooldownsActive) String

func (*APLValueAnyStatBuffCooldownsActive) Type

type APLValueAnyStatBuffCooldownsMinDuration

type APLValueAnyStatBuffCooldownsMinDuration struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueAnyStatBuffCooldownsMinDuration) Finalize

func (*APLValueAnyStatBuffCooldownsMinDuration) GetDuration

func (*APLValueAnyStatBuffCooldownsMinDuration) String

func (*APLValueAnyStatBuffCooldownsMinDuration) Type

type APLValueAuraDuration

type APLValueAuraDuration struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueAuraDuration) GetDuration

func (value *APLValueAuraDuration) GetDuration(sim *Simulation) time.Duration

func (*APLValueAuraDuration) String

func (value *APLValueAuraDuration) String() string

func (*APLValueAuraDuration) Type

func (value *APLValueAuraDuration) Type() proto.APLValueType

type APLValueAuraICDIsReady

type APLValueAuraICDIsReady struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueAuraICDIsReady) GetBool

func (value *APLValueAuraICDIsReady) GetBool(sim *Simulation) bool

func (*APLValueAuraICDIsReady) String

func (value *APLValueAuraICDIsReady) String() string

func (*APLValueAuraICDIsReady) Type

type APLValueAuraInternalCooldown

type APLValueAuraInternalCooldown struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueAuraInternalCooldown) GetDuration

func (value *APLValueAuraInternalCooldown) GetDuration(sim *Simulation) time.Duration

func (*APLValueAuraInternalCooldown) String

func (value *APLValueAuraInternalCooldown) String() string

func (*APLValueAuraInternalCooldown) Type

type APLValueAuraIsActive

type APLValueAuraIsActive struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueAuraIsActive) GetBool

func (value *APLValueAuraIsActive) GetBool(sim *Simulation) bool

func (*APLValueAuraIsActive) String

func (value *APLValueAuraIsActive) String() string

func (*APLValueAuraIsActive) Type

func (value *APLValueAuraIsActive) Type() proto.APLValueType

type APLValueAuraIsActiveOnAllTargets

type APLValueAuraIsActiveOnAllTargets struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueAuraIsActiveOnAllTargets) GetBool

func (value *APLValueAuraIsActiveOnAllTargets) GetBool(sim *Simulation) bool

func (*APLValueAuraIsActiveOnAllTargets) String

func (value *APLValueAuraIsActiveOnAllTargets) String() string

func (*APLValueAuraIsActiveOnAllTargets) Type

type APLValueAuraIsActiveOnAnyTarget

type APLValueAuraIsActiveOnAnyTarget struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueAuraIsActiveOnAnyTarget) GetBool

func (value *APLValueAuraIsActiveOnAnyTarget) GetBool(sim *Simulation) bool

func (*APLValueAuraIsActiveOnAnyTarget) String

func (value *APLValueAuraIsActiveOnAnyTarget) String() string

func (*APLValueAuraIsActiveOnAnyTarget) Type

type APLValueAuraIsInactive

type APLValueAuraIsInactive struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueAuraIsInactive) GetBool

func (value *APLValueAuraIsInactive) GetBool(sim *Simulation) bool

func (*APLValueAuraIsInactive) String

func (value *APLValueAuraIsInactive) String() string

func (*APLValueAuraIsInactive) Type

type APLValueAuraNumStacks

type APLValueAuraNumStacks struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueAuraNumStacks) GetInt

func (value *APLValueAuraNumStacks) GetInt(sim *Simulation) int32

func (*APLValueAuraNumStacks) String

func (value *APLValueAuraNumStacks) String() string

func (*APLValueAuraNumStacks) Type

type APLValueAuraRemainingTime

type APLValueAuraRemainingTime struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueAuraRemainingTime) GetDuration

func (value *APLValueAuraRemainingTime) GetDuration(sim *Simulation) time.Duration

func (*APLValueAuraRemainingTime) String

func (value *APLValueAuraRemainingTime) String() string

func (*APLValueAuraRemainingTime) Type

type APLValueAuraShouldRefresh

type APLValueAuraShouldRefresh struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueAuraShouldRefresh) GetBool

func (value *APLValueAuraShouldRefresh) GetBool(sim *Simulation) bool

func (*APLValueAuraShouldRefresh) GetInnerValues

func (value *APLValueAuraShouldRefresh) GetInnerValues() []APLValue

func (*APLValueAuraShouldRefresh) String

func (value *APLValueAuraShouldRefresh) String() string

func (*APLValueAuraShouldRefresh) Type

type APLValueAutoSwingTime

type APLValueAutoSwingTime struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueAutoSwingTime) GetDuration

func (value *APLValueAutoSwingTime) GetDuration(sim *Simulation) time.Duration

func (*APLValueAutoSwingTime) String

func (value *APLValueAutoSwingTime) String() string

func (*APLValueAutoSwingTime) Type

type APLValueAutoTimeSinceLast

type APLValueAutoTimeSinceLast struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueAutoTimeSinceLast) GetDuration

func (value *APLValueAutoTimeSinceLast) GetDuration(sim *Simulation) time.Duration

func (*APLValueAutoTimeSinceLast) String

func (value *APLValueAutoTimeSinceLast) String() string

func (*APLValueAutoTimeSinceLast) Type

type APLValueAutoTimeToNext

type APLValueAutoTimeToNext struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueAutoTimeToNext) GetDuration

func (value *APLValueAutoTimeToNext) GetDuration(sim *Simulation) time.Duration

func (*APLValueAutoTimeToNext) String

func (value *APLValueAutoTimeToNext) String() string

func (*APLValueAutoTimeToNext) Type

type APLValueBossCurrentTarget

type APLValueBossCurrentTarget struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueBossCurrentTarget) GetBool

func (value *APLValueBossCurrentTarget) GetBool(sim *Simulation) bool

func (*APLValueBossCurrentTarget) String

func (value *APLValueBossCurrentTarget) String() string

func (*APLValueBossCurrentTarget) Type

type APLValueBossSpellIsCasting

type APLValueBossSpellIsCasting struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueBossSpellIsCasting) GetBool

func (value *APLValueBossSpellIsCasting) GetBool(sim *Simulation) bool

func (*APLValueBossSpellIsCasting) String

func (value *APLValueBossSpellIsCasting) String() string

func (*APLValueBossSpellIsCasting) Type

type APLValueBossSpellTimeToReady

type APLValueBossSpellTimeToReady struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueBossSpellTimeToReady) GetDuration

func (value *APLValueBossSpellTimeToReady) GetDuration(sim *Simulation) time.Duration

func (*APLValueBossSpellTimeToReady) String

func (value *APLValueBossSpellTimeToReady) String() string

func (*APLValueBossSpellTimeToReady) Type

type APLValueChannelClipDelay

type APLValueChannelClipDelay struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueChannelClipDelay) GetDuration

func (value *APLValueChannelClipDelay) GetDuration(sim *Simulation) time.Duration

func (*APLValueChannelClipDelay) String

func (value *APLValueChannelClipDelay) String() string

func (*APLValueChannelClipDelay) Type

type APLValueCoerced

type APLValueCoerced struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueCoerced) GetBool

func (value *APLValueCoerced) GetBool(sim *Simulation) bool

func (APLValueCoerced) GetDuration

func (value APLValueCoerced) GetDuration(sim *Simulation) time.Duration

func (APLValueCoerced) GetFloat

func (value APLValueCoerced) GetFloat(sim *Simulation) float64

func (*APLValueCoerced) GetInnerValues

func (value *APLValueCoerced) GetInnerValues() []APLValue

func (APLValueCoerced) GetInt

func (value APLValueCoerced) GetInt(sim *Simulation) int32

func (APLValueCoerced) GetString

func (value APLValueCoerced) GetString(sim *Simulation) string

func (*APLValueCoerced) String

func (value *APLValueCoerced) String() string

func (*APLValueCoerced) Type

func (value *APLValueCoerced) Type() proto.APLValueType

type APLValueCompare

type APLValueCompare struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueCompare) GetBool

func (value *APLValueCompare) GetBool(sim *Simulation) bool

func (*APLValueCompare) GetInnerValues

func (value *APLValueCompare) GetInnerValues() []APLValue

func (*APLValueCompare) String

func (value *APLValueCompare) String() string

func (*APLValueCompare) Type

func (value *APLValueCompare) Type() proto.APLValueType

type APLValueConst

type APLValueConst struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueConst) GetBool

func (value *APLValueConst) GetBool(_ *Simulation) bool

func (*APLValueConst) GetDuration

func (value *APLValueConst) GetDuration(_ *Simulation) time.Duration

func (*APLValueConst) GetFloat

func (value *APLValueConst) GetFloat(_ *Simulation) float64

func (*APLValueConst) GetInt

func (value *APLValueConst) GetInt(_ *Simulation) int32

func (*APLValueConst) GetString

func (value *APLValueConst) GetString(_ *Simulation) string

func (*APLValueConst) String

func (value *APLValueConst) String() string

func (*APLValueConst) Type

func (value *APLValueConst) Type() proto.APLValueType

type APLValueCurrentComboPoints

type APLValueCurrentComboPoints struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueCurrentComboPoints) GetInt

func (value *APLValueCurrentComboPoints) GetInt(sim *Simulation) int32

func (*APLValueCurrentComboPoints) String

func (value *APLValueCurrentComboPoints) String() string

func (*APLValueCurrentComboPoints) Type

type APLValueCurrentEnergy

type APLValueCurrentEnergy struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueCurrentEnergy) GetFloat

func (value *APLValueCurrentEnergy) GetFloat(sim *Simulation) float64

func (*APLValueCurrentEnergy) String

func (value *APLValueCurrentEnergy) String() string

func (*APLValueCurrentEnergy) Type

type APLValueCurrentGenericResource

type APLValueCurrentGenericResource struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

type APLValueCurrentHealth

type APLValueCurrentHealth struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueCurrentHealth) GetFloat

func (value *APLValueCurrentHealth) GetFloat(sim *Simulation) float64

func (*APLValueCurrentHealth) String

func (value *APLValueCurrentHealth) String() string

func (*APLValueCurrentHealth) Type

type APLValueCurrentHealthPercent

type APLValueCurrentHealthPercent struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueCurrentHealthPercent) GetFloat

func (value *APLValueCurrentHealthPercent) GetFloat(sim *Simulation) float64

func (*APLValueCurrentHealthPercent) String

func (value *APLValueCurrentHealthPercent) String() string

func (*APLValueCurrentHealthPercent) Type

type APLValueCurrentMana

type APLValueCurrentMana struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueCurrentMana) GetFloat

func (value *APLValueCurrentMana) GetFloat(sim *Simulation) float64

func (*APLValueCurrentMana) String

func (value *APLValueCurrentMana) String() string

func (*APLValueCurrentMana) Type

func (value *APLValueCurrentMana) Type() proto.APLValueType

type APLValueCurrentManaPercent

type APLValueCurrentManaPercent struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueCurrentManaPercent) GetFloat

func (value *APLValueCurrentManaPercent) GetFloat(sim *Simulation) float64

func (*APLValueCurrentManaPercent) String

func (value *APLValueCurrentManaPercent) String() string

func (*APLValueCurrentManaPercent) Type

type APLValueCurrentManaRegen

type APLValueCurrentManaRegen struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueCurrentManaRegen) GetFloat

func (value *APLValueCurrentManaRegen) GetFloat(sim *Simulation) float64

func (*APLValueCurrentManaRegen) String

func (value *APLValueCurrentManaRegen) String() string

func (*APLValueCurrentManaRegen) Type

type APLValueCurrentRage

type APLValueCurrentRage struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueCurrentRage) GetFloat

func (value *APLValueCurrentRage) GetFloat(sim *Simulation) float64

func (*APLValueCurrentRage) String

func (value *APLValueCurrentRage) String() string

func (*APLValueCurrentRage) Type

func (value *APLValueCurrentRage) Type() proto.APLValueType

type APLValueCurrentTime

type APLValueCurrentTime struct {
	DefaultAPLValueImpl
}

func (*APLValueCurrentTime) GetDuration

func (value *APLValueCurrentTime) GetDuration(sim *Simulation) time.Duration

func (*APLValueCurrentTime) String

func (value *APLValueCurrentTime) String() string

func (*APLValueCurrentTime) Type

func (value *APLValueCurrentTime) Type() proto.APLValueType

type APLValueCurrentTimePercent

type APLValueCurrentTimePercent struct {
	DefaultAPLValueImpl
}

func (*APLValueCurrentTimePercent) GetFloat

func (value *APLValueCurrentTimePercent) GetFloat(sim *Simulation) float64

func (*APLValueCurrentTimePercent) String

func (value *APLValueCurrentTimePercent) String() string

func (*APLValueCurrentTimePercent) Type

type APLValueDotBaseDuration

type APLValueDotBaseDuration struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueDotBaseDuration) GetDuration

func (value *APLValueDotBaseDuration) GetDuration(_ *Simulation) time.Duration

func (*APLValueDotBaseDuration) String

func (value *APLValueDotBaseDuration) String() string

func (*APLValueDotBaseDuration) Type

type APLValueDotIsActive

type APLValueDotIsActive struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueDotIsActive) GetBool

func (value *APLValueDotIsActive) GetBool(sim *Simulation) bool

func (*APLValueDotIsActive) String

func (value *APLValueDotIsActive) String() string

func (*APLValueDotIsActive) Type

func (value *APLValueDotIsActive) Type() proto.APLValueType

type APLValueDotIsActiveOnAllTargets

type APLValueDotIsActiveOnAllTargets struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueDotIsActiveOnAllTargets) GetBool

func (value *APLValueDotIsActiveOnAllTargets) GetBool(sim *Simulation) bool

func (*APLValueDotIsActiveOnAllTargets) String

func (value *APLValueDotIsActiveOnAllTargets) String() string

func (*APLValueDotIsActiveOnAllTargets) Type

type APLValueDotIsActiveOnAnyTarget

type APLValueDotIsActiveOnAnyTarget struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueDotIsActiveOnAnyTarget) GetBool

func (value *APLValueDotIsActiveOnAnyTarget) GetBool(sim *Simulation) bool

func (*APLValueDotIsActiveOnAnyTarget) String

func (value *APLValueDotIsActiveOnAnyTarget) String() string

func (*APLValueDotIsActiveOnAnyTarget) Type

type APLValueDotLowestRemainingTime

type APLValueDotLowestRemainingTime struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueDotLowestRemainingTime) GetDuration

func (value *APLValueDotLowestRemainingTime) GetDuration(sim *Simulation) time.Duration

func (*APLValueDotLowestRemainingTime) String

func (value *APLValueDotLowestRemainingTime) String() string

func (*APLValueDotLowestRemainingTime) Type

type APLValueDotRemainingTime

type APLValueDotRemainingTime struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueDotRemainingTime) GetDuration

func (value *APLValueDotRemainingTime) GetDuration(sim *Simulation) time.Duration

func (*APLValueDotRemainingTime) String

func (value *APLValueDotRemainingTime) String() string

func (*APLValueDotRemainingTime) Type

type APLValueDotTickFrequency

type APLValueDotTickFrequency struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueDotTickFrequency) GetDuration

func (value *APLValueDotTickFrequency) GetDuration(sim *Simulation) time.Duration

func (*APLValueDotTickFrequency) String

func (value *APLValueDotTickFrequency) String() string

func (*APLValueDotTickFrequency) Type

type APLValueDotTimeToNextTick

type APLValueDotTimeToNextTick struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueDotTimeToNextTick) GetDuration

func (value *APLValueDotTimeToNextTick) GetDuration(sim *Simulation) time.Duration

func (*APLValueDotTimeToNextTick) String

func (value *APLValueDotTimeToNextTick) String() string

func (*APLValueDotTimeToNextTick) Type

type APLValueEncounterInArea

type APLValueEncounterInArea struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueEncounterInArea) GetBool

func (value *APLValueEncounterInArea) GetBool(sim *Simulation) bool

func (*APLValueEncounterInArea) String

func (value *APLValueEncounterInArea) String() string

func (*APLValueEncounterInArea) Type

type APLValueEnergyTimeToTarget

type APLValueEnergyTimeToTarget struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueEnergyTimeToTarget) GetDuration

func (value *APLValueEnergyTimeToTarget) GetDuration(sim *Simulation) time.Duration

func (*APLValueEnergyTimeToTarget) String

func (value *APLValueEnergyTimeToTarget) String() string

func (*APLValueEnergyTimeToTarget) Type

type APLValueFrontOfTarget

type APLValueFrontOfTarget struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueFrontOfTarget) GetBool

func (value *APLValueFrontOfTarget) GetBool(sim *Simulation) bool

func (*APLValueFrontOfTarget) String

func (value *APLValueFrontOfTarget) String() string

func (*APLValueFrontOfTarget) Type

type APLValueGCDIsReady

type APLValueGCDIsReady struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueGCDIsReady) GetBool

func (value *APLValueGCDIsReady) GetBool(sim *Simulation) bool

func (*APLValueGCDIsReady) String

func (value *APLValueGCDIsReady) String() string

func (*APLValueGCDIsReady) Type

func (value *APLValueGCDIsReady) Type() proto.APLValueType

type APLValueGCDTimeToReady

type APLValueGCDTimeToReady struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueGCDTimeToReady) GetDuration

func (value *APLValueGCDTimeToReady) GetDuration(sim *Simulation) time.Duration

func (*APLValueGCDTimeToReady) String

func (value *APLValueGCDTimeToReady) String() string

func (*APLValueGCDTimeToReady) Type

type APLValueInputDelay

type APLValueInputDelay struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueInputDelay) GetDuration

func (value *APLValueInputDelay) GetDuration(sim *Simulation) time.Duration

func (*APLValueInputDelay) String

func (value *APLValueInputDelay) String() string

func (*APLValueInputDelay) Type

func (value *APLValueInputDelay) Type() proto.APLValueType

type APLValueIsExecutePhase

type APLValueIsExecutePhase struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueIsExecutePhase) GetBool

func (value *APLValueIsExecutePhase) GetBool(sim *Simulation) bool

func (*APLValueIsExecutePhase) String

func (value *APLValueIsExecutePhase) String() string

func (*APLValueIsExecutePhase) Type

type APLValueItemProcsMaxRemainingICD

type APLValueItemProcsMaxRemainingICD struct {
	*APLValueItemStatProcCheck
}

func (*APLValueItemProcsMaxRemainingICD) GetDuration

func (value *APLValueItemProcsMaxRemainingICD) GetDuration(sim *Simulation) time.Duration

func (*APLValueItemProcsMaxRemainingICD) Type

type APLValueItemProcsMinRemainingTime

type APLValueItemProcsMinRemainingTime struct {
	*APLValueItemStatProcCheck
}

func (*APLValueItemProcsMinRemainingTime) GetDuration

func (value *APLValueItemProcsMinRemainingTime) GetDuration(sim *Simulation) time.Duration

func (*APLValueItemProcsMinRemainingTime) Type

type APLValueItemStatProcCheck

type APLValueItemStatProcCheck struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

Parent struct for all APL values that perform checks on the set of buff auras associated with equipped proc items.

func (*APLValueItemStatProcCheck) Finalize

func (value *APLValueItemStatProcCheck) Finalize(rot *APLRotation)

func (*APLValueItemStatProcCheck) String

func (value *APLValueItemStatProcCheck) String() string

type APLValueMath

type APLValueMath struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueMath) GetDuration

func (value *APLValueMath) GetDuration(sim *Simulation) time.Duration

func (*APLValueMath) GetFloat

func (value *APLValueMath) GetFloat(sim *Simulation) float64

func (*APLValueMath) GetInnerValues

func (value *APLValueMath) GetInnerValues() []APLValue

func (*APLValueMath) GetInt

func (value *APLValueMath) GetInt(sim *Simulation) int32

func (*APLValueMath) String

func (value *APLValueMath) String() string

func (*APLValueMath) Type

func (value *APLValueMath) Type() proto.APLValueType

MUL: int * duration => duration, float * duration => duration, int * float => float DIV: duration / int => duration, duration / float => duration, duration / duration => float ADD & SUB: are always the same type as the LHS, so we can just return that type.

type APLValueMax

type APLValueMax struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueMax) GetDuration

func (value *APLValueMax) GetDuration(sim *Simulation) time.Duration

func (*APLValueMax) GetFloat

func (value *APLValueMax) GetFloat(sim *Simulation) float64

func (*APLValueMax) GetInnerValues

func (value *APLValueMax) GetInnerValues() []APLValue

func (*APLValueMax) GetInt

func (value *APLValueMax) GetInt(sim *Simulation) int32

func (*APLValueMax) String

func (value *APLValueMax) String() string

func (*APLValueMax) Type

func (value *APLValueMax) Type() proto.APLValueType

type APLValueMaxComboPoints

type APLValueMaxComboPoints struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueMaxComboPoints) GetInt

func (value *APLValueMaxComboPoints) GetInt(sim *Simulation) int32

func (*APLValueMaxComboPoints) String

func (value *APLValueMaxComboPoints) String() string

func (*APLValueMaxComboPoints) Type

type APLValueMaxEnergy

type APLValueMaxEnergy struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueMaxEnergy) GetFloat

func (value *APLValueMaxEnergy) GetFloat(sim *Simulation) float64

func (*APLValueMaxEnergy) String

func (value *APLValueMaxEnergy) String() string

func (*APLValueMaxEnergy) Type

func (value *APLValueMaxEnergy) Type() proto.APLValueType

type APLValueMaxHealth

type APLValueMaxHealth struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueMaxHealth) GetFloat

func (value *APLValueMaxHealth) GetFloat(sim *Simulation) float64

func (*APLValueMaxHealth) String

func (value *APLValueMaxHealth) String() string

func (*APLValueMaxHealth) Type

func (value *APLValueMaxHealth) Type() proto.APLValueType

type APLValueMaxMana

type APLValueMaxMana struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueMaxMana) GetFloat

func (value *APLValueMaxMana) GetFloat(sim *Simulation) float64

func (*APLValueMaxMana) String

func (value *APLValueMaxMana) String() string

func (*APLValueMaxMana) Type

func (value *APLValueMaxMana) Type() proto.APLValueType

type APLValueMaxRage

type APLValueMaxRage struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueMaxRage) GetFloat

func (value *APLValueMaxRage) GetFloat(sim *Simulation) float64

func (*APLValueMaxRage) String

func (value *APLValueMaxRage) String() string

func (*APLValueMaxRage) Type

func (value *APLValueMaxRage) Type() proto.APLValueType

type APLValueMin

type APLValueMin struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueMin) GetDuration

func (value *APLValueMin) GetDuration(sim *Simulation) time.Duration

func (*APLValueMin) GetFloat

func (value *APLValueMin) GetFloat(sim *Simulation) float64

func (*APLValueMin) GetInnerValues

func (value *APLValueMin) GetInnerValues() []APLValue

func (*APLValueMin) GetInt

func (value *APLValueMin) GetInt(sim *Simulation) int32

func (*APLValueMin) String

func (value *APLValueMin) String() string

func (*APLValueMin) Type

func (value *APLValueMin) Type() proto.APLValueType

type APLValueMultipleCdUsages

type APLValueMultipleCdUsages struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

An empty base spell means none. With no base spell, aligning to the encounter end casts early only when a later use still gets at least half its buff (remaining > CD + buff/2) or the buff runs to the end. The cooldown is FullCooldown, which for a potion includes its shared potion cooldown.

func (*APLValueMultipleCdUsages) GetBool

func (value *APLValueMultipleCdUsages) GetBool(sim *Simulation) bool

func (*APLValueMultipleCdUsages) String

func (value *APLValueMultipleCdUsages) String() string

func (*APLValueMultipleCdUsages) Type

type APLValueNot

type APLValueNot struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueNot) GetBool

func (value *APLValueNot) GetBool(sim *Simulation) bool

func (*APLValueNot) GetInnerValues

func (value *APLValueNot) GetInnerValues() []APLValue

func (*APLValueNot) String

func (value *APLValueNot) String() string

func (*APLValueNot) Type

func (value *APLValueNot) Type() proto.APLValueType

type APLValueNumActiveAdds

type APLValueNumActiveAdds struct {
	DefaultAPLValueImpl
}

func (*APLValueNumActiveAdds) GetInt

func (value *APLValueNumActiveAdds) GetInt(sim *Simulation) int32

func (*APLValueNumActiveAdds) String

func (value *APLValueNumActiveAdds) String() string

func (*APLValueNumActiveAdds) Type

type APLValueNumEquippedStatProcItems

type APLValueNumEquippedStatProcItems struct {
	*APLValueItemStatProcCheck
}

func (*APLValueNumEquippedStatProcItems) GetInt

func (*APLValueNumEquippedStatProcItems) Type

type APLValueNumStatBuffCooldowns

type APLValueNumStatBuffCooldowns struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueNumStatBuffCooldowns) Finalize

func (value *APLValueNumStatBuffCooldowns) Finalize(rot *APLRotation)

func (*APLValueNumStatBuffCooldowns) GetInt

func (value *APLValueNumStatBuffCooldowns) GetInt(_ *Simulation) int32

func (*APLValueNumStatBuffCooldowns) String

func (value *APLValueNumStatBuffCooldowns) String() string

func (*APLValueNumStatBuffCooldowns) Type

type APLValueNumberTargets

type APLValueNumberTargets struct {
	DefaultAPLValueImpl
}

func (*APLValueNumberTargets) GetFloat

func (value *APLValueNumberTargets) GetFloat(sim *Simulation) float64

func (*APLValueNumberTargets) GetInt

func (value *APLValueNumberTargets) GetInt(sim *Simulation) int32

func (*APLValueNumberTargets) String

func (value *APLValueNumberTargets) String() string

func (*APLValueNumberTargets) Type

type APLValueOr

type APLValueOr struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueOr) GetBool

func (value *APLValueOr) GetBool(sim *Simulation) bool

func (*APLValueOr) GetInnerValues

func (value *APLValueOr) GetInnerValues() []APLValue

func (*APLValueOr) String

func (value *APLValueOr) String() string

func (*APLValueOr) Type

func (value *APLValueOr) Type() proto.APLValueType

type APLValueRemainingCastTime

type APLValueRemainingCastTime struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueRemainingCastTime) GetDuration

func (value *APLValueRemainingCastTime) GetDuration(sim *Simulation) time.Duration

The time to the end of the unit's running hardcast, and 0 with nothing cast. A channel reads 0, as it reads false for Spell Is Casting; the pick at the cast end reads 0, where Spell Is Casting still reads true.

func (*APLValueRemainingCastTime) String

func (value *APLValueRemainingCastTime) String() string

func (*APLValueRemainingCastTime) Type

type APLValueRemainingTime

type APLValueRemainingTime struct {
	DefaultAPLValueImpl
}

func (*APLValueRemainingTime) GetDuration

func (value *APLValueRemainingTime) GetDuration(sim *Simulation) time.Duration

func (*APLValueRemainingTime) String

func (value *APLValueRemainingTime) String() string

func (*APLValueRemainingTime) Type

type APLValueRemainingTimePercent

type APLValueRemainingTimePercent struct {
	DefaultAPLValueImpl
}

func (*APLValueRemainingTimePercent) GetFloat

func (value *APLValueRemainingTimePercent) GetFloat(sim *Simulation) float64

func (*APLValueRemainingTimePercent) String

func (value *APLValueRemainingTimePercent) String() string

func (*APLValueRemainingTimePercent) Type

type APLValueSelectedConjured

type APLValueSelectedConjured struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueSelectedConjured) GetBool

func (value *APLValueSelectedConjured) GetBool(sim *Simulation) bool

func (*APLValueSelectedConjured) String

func (value *APLValueSelectedConjured) String() string

func (*APLValueSelectedConjured) Type

type APLValueSelectedPotion

type APLValueSelectedPotion struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueSelectedPotion) GetBool

func (value *APLValueSelectedPotion) GetBool(sim *Simulation) bool

func (*APLValueSelectedPotion) String

func (value *APLValueSelectedPotion) String() string

func (*APLValueSelectedPotion) Type

type APLValueSequenceIsComplete

type APLValueSequenceIsComplete struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueSequenceIsComplete) Finalize

func (value *APLValueSequenceIsComplete) Finalize(rot *APLRotation)

func (*APLValueSequenceIsComplete) GetBool

func (value *APLValueSequenceIsComplete) GetBool(sim *Simulation) bool

func (*APLValueSequenceIsComplete) String

func (value *APLValueSequenceIsComplete) String() string

func (*APLValueSequenceIsComplete) Type

type APLValueSequenceIsReady

type APLValueSequenceIsReady struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueSequenceIsReady) Finalize

func (value *APLValueSequenceIsReady) Finalize(rot *APLRotation)

func (*APLValueSequenceIsReady) GetBool

func (value *APLValueSequenceIsReady) GetBool(sim *Simulation) bool

func (*APLValueSequenceIsReady) String

func (value *APLValueSequenceIsReady) String() string

func (*APLValueSequenceIsReady) Type

type APLValueSequenceTimeToReady

type APLValueSequenceTimeToReady struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueSequenceTimeToReady) Finalize

func (value *APLValueSequenceTimeToReady) Finalize(rot *APLRotation)

func (*APLValueSequenceTimeToReady) GetDuration

func (value *APLValueSequenceTimeToReady) GetDuration(sim *Simulation) time.Duration

func (*APLValueSequenceTimeToReady) String

func (value *APLValueSequenceTimeToReady) String() string

func (*APLValueSequenceTimeToReady) Type

type APLValueSpellCPM

type APLValueSpellCPM struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueSpellCPM) GetFloat

func (value *APLValueSpellCPM) GetFloat(sim *Simulation) float64

func (*APLValueSpellCPM) String

func (value *APLValueSpellCPM) String() string

func (*APLValueSpellCPM) Type

func (value *APLValueSpellCPM) Type() proto.APLValueType

type APLValueSpellCanCast

type APLValueSpellCanCast struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueSpellCanCast) GetBool

func (value *APLValueSpellCanCast) GetBool(sim *Simulation) bool

func (*APLValueSpellCanCast) String

func (value *APLValueSpellCanCast) String() string

func (*APLValueSpellCanCast) Type

func (value *APLValueSpellCanCast) Type() proto.APLValueType

type APLValueSpellCastTime

type APLValueSpellCastTime struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueSpellCastTime) GetDuration

func (value *APLValueSpellCastTime) GetDuration(_ *Simulation) time.Duration

func (*APLValueSpellCastTime) String

func (value *APLValueSpellCastTime) String() string

func (*APLValueSpellCastTime) Type

type APLValueSpellChanneledTicks

type APLValueSpellChanneledTicks struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueSpellChanneledTicks) GetInt

func (value *APLValueSpellChanneledTicks) GetInt(_ *Simulation) int32

func (*APLValueSpellChanneledTicks) String

func (value *APLValueSpellChanneledTicks) String() string

func (*APLValueSpellChanneledTicks) Type

type APLValueSpellCurrentCost

type APLValueSpellCurrentCost struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueSpellCurrentCost) GetFloat

func (value *APLValueSpellCurrentCost) GetFloat(_ *Simulation) float64

func (*APLValueSpellCurrentCost) String

func (value *APLValueSpellCurrentCost) String() string

func (*APLValueSpellCurrentCost) Type

type APLValueSpellExpectedDpet

type APLValueSpellExpectedDpet struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

The expected damage of one full cast if cast now, its hit and its ticks, over the time the cast costs the caster: the cast time or channel, or the GCD when that is longer. Only what lands before the fight ends counts, and a channel costs only the ticks it gets in. Every cast is taken to land: the hit's expected damage uses OutcomeExpectedMagicCrit and the ticks their always-hit or crit outcome. DoT clipping and mana are left out, and travel time only moves the landing.

func (*APLValueSpellExpectedDpet) GetFloat

func (value *APLValueSpellExpectedDpet) GetFloat(sim *Simulation) float64

func (*APLValueSpellExpectedDpet) String

func (value *APLValueSpellExpectedDpet) String() string

func (*APLValueSpellExpectedDpet) Type

type APLValueSpellFullCooldown

type APLValueSpellFullCooldown struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

Full Cooldown duration

func (*APLValueSpellFullCooldown) GetDuration

func (value *APLValueSpellFullCooldown) GetDuration(sim *Simulation) time.Duration

func (*APLValueSpellFullCooldown) String

func (value *APLValueSpellFullCooldown) String() string

func (*APLValueSpellFullCooldown) Type

type APLValueSpellGCDHastedDuration

type APLValueSpellGCDHastedDuration struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

GCD duration

func (*APLValueSpellGCDHastedDuration) GetDuration

func (value *APLValueSpellGCDHastedDuration) GetDuration(_ *Simulation) time.Duration

func (*APLValueSpellGCDHastedDuration) GetFloat

func (value *APLValueSpellGCDHastedDuration) GetFloat(sim *Simulation) float64

func (*APLValueSpellGCDHastedDuration) String

func (value *APLValueSpellGCDHastedDuration) String() string

func (*APLValueSpellGCDHastedDuration) Type

type APLValueSpellInFlight

type APLValueSpellInFlight struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

Spell In Flight

func (*APLValueSpellInFlight) GetBool

func (value *APLValueSpellInFlight) GetBool(sim *Simulation) bool

func (*APLValueSpellInFlight) String

func (value *APLValueSpellInFlight) String() string

func (*APLValueSpellInFlight) Type

type APLValueSpellInRange

type APLValueSpellInRange struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueSpellInRange) GetBool

func (value *APLValueSpellInRange) GetBool(_ *Simulation) bool

func (*APLValueSpellInRange) String

func (value *APLValueSpellInRange) String() string

func (*APLValueSpellInRange) Type

func (value *APLValueSpellInRange) Type() proto.APLValueType

type APLValueSpellIsCasting

type APLValueSpellIsCasting struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueSpellIsCasting) GetBool

func (value *APLValueSpellIsCasting) GetBool(sim *Simulation) bool

True while the spell is hardcast, through the rotation's pick at its end. A channel reads false: it is Spell Is Channeling.

func (*APLValueSpellIsCasting) String

func (value *APLValueSpellIsCasting) String() string

func (*APLValueSpellIsCasting) Type

type APLValueSpellIsChanneling

type APLValueSpellIsChanneling struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueSpellIsChanneling) GetBool

func (value *APLValueSpellIsChanneling) GetBool(_ *Simulation) bool

func (*APLValueSpellIsChanneling) String

func (value *APLValueSpellIsChanneling) String() string

func (*APLValueSpellIsChanneling) Type

type APLValueSpellIsExpertiseCapped

type APLValueSpellIsExpertiseCapped struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

Whether the current target can neither dodge the spell nor, while the unit stands in front of it, parry it. Only the melee table has dodge and parry, so anything else is capped, as is a spell flagged No Active Defense, which the target's chances read as zero. The outcome function the spell passes is not read.

func (*APLValueSpellIsExpertiseCapped) GetBool

func (value *APLValueSpellIsExpertiseCapped) GetBool(_ *Simulation) bool

func (*APLValueSpellIsExpertiseCapped) String

func (value *APLValueSpellIsExpertiseCapped) String() string

func (*APLValueSpellIsExpertiseCapped) Type

type APLValueSpellIsHitCapped

type APLValueSpellIsHitCapped struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

Whether the spell cannot miss the current target: the spell table's miss for magic, the weapon miss of a special for melee and ranged, which leaves out the dual-wield penalty of auto attacks. It reads the table alone, so a spell that always hits or rolls its miss through another spell reads as its table does.

func (*APLValueSpellIsHitCapped) GetBool

func (value *APLValueSpellIsHitCapped) GetBool(_ *Simulation) bool

func (*APLValueSpellIsHitCapped) String

func (value *APLValueSpellIsHitCapped) String() string

func (*APLValueSpellIsHitCapped) Type

type APLValueSpellIsReady

type APLValueSpellIsReady struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueSpellIsReady) GetBool

func (value *APLValueSpellIsReady) GetBool(sim *Simulation) bool

func (*APLValueSpellIsReady) String

func (value *APLValueSpellIsReady) String() string

func (*APLValueSpellIsReady) Type

func (value *APLValueSpellIsReady) Type() proto.APLValueType

type APLValueSpellNumCharges

type APLValueSpellNumCharges struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

Spell Charges

func (*APLValueSpellNumCharges) GetInt

func (value *APLValueSpellNumCharges) GetInt(_ *Simulation) int32

func (*APLValueSpellNumCharges) String

func (value *APLValueSpellNumCharges) String() string

func (*APLValueSpellNumCharges) Type

type APLValueSpellTimeToCharge

type APLValueSpellTimeToCharge struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueSpellTimeToCharge) GetDuration

func (value *APLValueSpellTimeToCharge) GetDuration(sim *Simulation) time.Duration

func (*APLValueSpellTimeToCharge) GetFloat

func (value *APLValueSpellTimeToCharge) GetFloat(sim *Simulation) float64

func (*APLValueSpellTimeToCharge) String

func (value *APLValueSpellTimeToCharge) String() string

func (*APLValueSpellTimeToCharge) Type

type APLValueSpellTimeToReady

type APLValueSpellTimeToReady struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueSpellTimeToReady) GetDuration

func (value *APLValueSpellTimeToReady) GetDuration(sim *Simulation) time.Duration

func (*APLValueSpellTimeToReady) GetFloat

func (value *APLValueSpellTimeToReady) GetFloat(sim *Simulation) float64

func (*APLValueSpellTimeToReady) String

func (value *APLValueSpellTimeToReady) String() string

func (*APLValueSpellTimeToReady) Type

type APLValueSpellTravelTime

type APLValueSpellTravelTime struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueSpellTravelTime) GetDuration

func (value *APLValueSpellTravelTime) GetDuration(_ *Simulation) time.Duration

func (*APLValueSpellTravelTime) String

func (value *APLValueSpellTravelTime) String() string

func (*APLValueSpellTravelTime) Type

type APLValueTalentRank

type APLValueTalentRank struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueTalentRank) GetFloat

func (value *APLValueTalentRank) GetFloat(_ *Simulation) float64

func (*APLValueTalentRank) GetInt

func (value *APLValueTalentRank) GetInt(_ *Simulation) int32

func (*APLValueTalentRank) String

func (value *APLValueTalentRank) String() string

func (*APLValueTalentRank) Type

func (value *APLValueTalentRank) Type() proto.APLValueType

type APLValueTargetIsActive

type APLValueTargetIsActive struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueTargetIsActive) GetBool

func (value *APLValueTargetIsActive) GetBool(sim *Simulation) bool

func (*APLValueTargetIsActive) String

func (value *APLValueTargetIsActive) String() string

func (*APLValueTargetIsActive) Type

type APLValueTargetIsBleedImmune

type APLValueTargetIsBleedImmune struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueTargetIsBleedImmune) GetBool

func (value *APLValueTargetIsBleedImmune) GetBool(_ *Simulation) bool

func (*APLValueTargetIsBleedImmune) String

func (value *APLValueTargetIsBleedImmune) String() string

func (*APLValueTargetIsBleedImmune) Type

type APLValueTargetIsMobType

type APLValueTargetIsMobType struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueTargetIsMobType) GetBool

func (value *APLValueTargetIsMobType) GetBool(sim *Simulation) bool

func (*APLValueTargetIsMobType) String

func (value *APLValueTargetIsMobType) String() string

func (*APLValueTargetIsMobType) Type

type APLValueTimeToNextEnergyTick

type APLValueTimeToNextEnergyTick struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueTimeToNextEnergyTick) GetDuration

func (value *APLValueTimeToNextEnergyTick) GetDuration(sim *Simulation) time.Duration

func (*APLValueTimeToNextEnergyTick) String

func (value *APLValueTimeToNextEnergyTick) String() string

func (*APLValueTimeToNextEnergyTick) Type

type APLValueTimeUntilTargetActive

type APLValueTimeUntilTargetActive struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueTimeUntilTargetActive) GetDuration

func (value *APLValueTimeUntilTargetActive) GetDuration(sim *Simulation) time.Duration

func (*APLValueTimeUntilTargetActive) String

func (value *APLValueTimeUntilTargetActive) String() string

func (*APLValueTimeUntilTargetActive) Type

type APLValueTimeUntilTargetDies

type APLValueTimeUntilTargetDies struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueTimeUntilTargetDies) GetDuration

func (value *APLValueTimeUntilTargetDies) GetDuration(sim *Simulation) time.Duration

func (*APLValueTimeUntilTargetDies) String

func (value *APLValueTimeUntilTargetDies) String() string

func (*APLValueTimeUntilTargetDies) Type

type APLValueUnitDistance

type APLValueUnitDistance struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueUnitDistance) GetFloat

func (value *APLValueUnitDistance) GetFloat(sim *Simulation) float64

func (*APLValueUnitDistance) String

func (value *APLValueUnitDistance) String() string

func (*APLValueUnitDistance) Type

func (value *APLValueUnitDistance) Type() proto.APLValueType

type APLValueUnitIsMoving

type APLValueUnitIsMoving struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueUnitIsMoving) GetBool

func (value *APLValueUnitIsMoving) GetBool(sim *Simulation) bool

func (*APLValueUnitIsMoving) String

func (value *APLValueUnitIsMoving) String() string

func (*APLValueUnitIsMoving) Type

func (value *APLValueUnitIsMoving) Type() proto.APLValueType

type APLValueUnitMovementSpeed

type APLValueUnitMovementSpeed struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueUnitMovementSpeed) GetFloat

func (value *APLValueUnitMovementSpeed) GetFloat(sim *Simulation) float64

func (*APLValueUnitMovementSpeed) String

func (value *APLValueUnitMovementSpeed) String() string

func (*APLValueUnitMovementSpeed) Type

type APLValueVariable

type APLValueVariable struct {
	// contains filtered or unexported fields
}

type APLValueVariablePlaceholder

type APLValueVariablePlaceholder struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

Variable Placeholder value for group APLs

func (*APLValueVariablePlaceholder) GetBool

func (v *APLValueVariablePlaceholder) GetBool(sim *Simulation) bool

func (*APLValueVariablePlaceholder) GetDuration

func (v *APLValueVariablePlaceholder) GetDuration(sim *Simulation) time.Duration

func (*APLValueVariablePlaceholder) GetFloat

func (*APLValueVariablePlaceholder) GetInnerValues

func (v *APLValueVariablePlaceholder) GetInnerValues() []APLValue

func (*APLValueVariablePlaceholder) GetInt

func (*APLValueVariablePlaceholder) GetString

func (v *APLValueVariablePlaceholder) GetString(sim *Simulation) string

func (*APLValueVariablePlaceholder) String

func (v *APLValueVariablePlaceholder) String() string

func (*APLValueVariablePlaceholder) Type

type APLValueVariableRef

type APLValueVariableRef struct {
	DefaultAPLValueImpl
	// contains filtered or unexported fields
}

func (*APLValueVariableRef) GetBool

func (v *APLValueVariableRef) GetBool(sim *Simulation) bool

func (*APLValueVariableRef) GetDuration

func (v *APLValueVariableRef) GetDuration(sim *Simulation) time.Duration

func (*APLValueVariableRef) GetFloat

func (v *APLValueVariableRef) GetFloat(sim *Simulation) float64

func (*APLValueVariableRef) GetInnerValues

func (v *APLValueVariableRef) GetInnerValues() []APLValue

func (*APLValueVariableRef) GetInt

func (v *APLValueVariableRef) GetInt(sim *Simulation) int32

func (*APLValueVariableRef) GetString

func (v *APLValueVariableRef) GetString(sim *Simulation) string

func (*APLValueVariableRef) String

func (v *APLValueVariableRef) String() string

func (*APLValueVariableRef) Type

type AbsorptionAuraConfig

type AbsorptionAuraConfig struct {
	Aura                     Aura
	DamageMultiplier         float64
	MaxAbsorbPerHit          float64
	ShieldStrengthCalculator ShieldStrengthCalculator
	OnDamageAbsorbed         OnDamageAbsorbedCallback
	ShouldApplyToResult      ShieldShouldApplyCondition
}

type ActionID

type ActionID struct {
	// Only one of these should be set.
	SpellID int32
	ItemID  int32
	OtherID proto.OtherAction

	Tag int32
}

func ProtoToActionID

func ProtoToActionID(protoID *proto.ActionID) ActionID

func (ActionID) IsEmptyAction

func (actionID ActionID) IsEmptyAction() bool

func (ActionID) IsItemAction

func (actionID ActionID) IsItemAction(itemID int32) bool

func (ActionID) IsOtherAction

func (actionID ActionID) IsOtherAction(otherID proto.OtherAction) bool

func (ActionID) IsSpellAction

func (actionID ActionID) IsSpellAction(spellID int32) bool

func (ActionID) SameAction

func (actionID ActionID) SameAction(other ActionID) bool

func (ActionID) SameActionIgnoreTag

func (actionID ActionID) SameActionIgnoreTag(other ActionID) bool

func (ActionID) String

func (actionID ActionID) String() string

func (ActionID) ToProto

func (actionID ActionID) ToProto() *proto.ActionID

func (ActionID) WithHand

func (actionID ActionID) WithHand(slot proto.ItemSlot) ActionID

The copy of an action that one weapon hand carries, tagged with that hand's item slot, which the UI names as the hand.

func (ActionID) WithTag

func (actionID ActionID) WithTag(tag int32) ActionID

Returns a new ActionID with the corresponding Tag value.

type ActionMetrics

type ActionMetrics struct {
	IsMelee     bool // True if melee action, false if spell action.
	IsPassive   bool // True if action is applied/cast as a result of another action
	SpellSchool SpellSchool
	Rank        int32 // The spell's rank, which the UI names the action with; 0 for an unranked spell.

	// Metrics for this action, for each possible target.
	Targets []TargetedActionMetrics
	// contains filtered or unexported fields
}

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

	ActionPriorityPrePull ActionPriority = 10
)

type ActionSource

type ActionSource int32

Where an aura or spell was registered from, which files it under a submenu in the APL pickers.

const (
	SourceUnset ActionSource = iota // Registration fills in the phase it runs in.
	SourceNone                      // The class's own, whatever phase registers it.
	SourceItem
	SourceTalent
	SourceConsumable
	SourceRacial
	SourceProfession
	SourceExternalBuff
	SourceExternalDebuff
)

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)

	// 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 after each mana tick, if this Agent uses mana.
	OnManaTick(sim *Simulation)

	// Called at the start of each encounter, after the pre-pull.
	// Used for resetting resources, deactivating auras etc.
	OnEncounterStart(sim *Simulation)

	// Custom factories for APL values and actions, for cases where the value/action
	// involves class or spec-specific behavior.
	//
	// Should return nil when the config doesn't match any custom behaviors.
	NewAPLValue(rot *APLRotation, config *proto.APLValue) APLValue
	NewAPLAction(rot *APLRotation, config *proto.APLAction) APLActionImpl

	// Implements custom rotation behavior. Usually for pets and targets but can be used
	// for players too.
	ExecuteCustomRotation(sim *Simulation)
}

Agent can be thought of as the 'Player', i.e. the thing controlling the Character. This is the interface implemented by each class/spec.

func NewAgent

func NewAgent(party *Party, partyIndex int, player *proto.Player, raidConfig *proto.Raid) Agent

Constructs a new Agent.

type AgentFactory

type AgentFactory func(*Character, *proto.Player, *proto.Raid) Agent

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.

type ApplySetBonus

type ApplySetBonus func(agent Agent, setBonusAura *Aura)

type ApplySpellResults

type ApplySpellResults func(sim *Simulation, target *Unit, spell *Spell)

type AttackTable

type AttackTable struct {
	Attacker *Unit
	Defender *Unit

	BaseSpellMissChance float64
	BaseCrushChance     float64

	AuraCritSuppression float64 // The most of the attacker's crit beyond base and Agility crit that a defender 3 or more levels above takes off.

	MH     AttackTableHand
	OH     AttackTableHand
	Ranged AttackTableHand

	// Raised only by A_MOD_CRIT_PERCENT_VERSUS effects. The game files state one only on Humanoid Slaying
	// 19151, which no class learns. A_MOD_DAMAGE_DONE_VERSUS effects, Beast Slaying 20557 among them, raise
	// damage alone.
	CritMultiplier float64

	DamageDealtMultiplier       float64 // attacker buff, applied in applyAttackerModifiers()
	DamageTakenMultiplier       float64 // defender debuff, applied in applyTargetModifiers()
	HealingDealtMultiplier      float64
	IgnoreArmor                 bool    // Ignore defender's armor for specifically this attacker's attacks
	ArmorIgnoreFactor           float64 // Percentage of armor to ignore for this attacker's attacks
	BonusSpellCritPercent       float64 // Analagous to Defender.PseudoStats.BonusSpellCritPercentTaken, but only for this attacker specifically
	BonusCritPercent            float64 // The crit chance the defender's auras add to every attack of this attacker alone, as A_MOD_CRIT_CHANCE_FOR_CASTER does.
	RangedDamageTakenMultiplier float64
	// This is for "Apply Aura: Mod Damage Done By Caster" effects.
	// If set, the damage taken multiplier is multiplied by the callbacks result.
	DamageDoneByCasterMultiplier DynamicDamageDoneByCaster

	MobTypeBonusStats map[proto.MobType]stats.Stats // Bonus stats against mobs of the current type.

	// When you need more then 1 active, default to using the above one
	// Used with EnableDamageDoneByCaster/DisableDamageDoneByCaster
	DamageDoneByCasterExtraMultiplier []DynamicDamageDoneByCaster

	// The crit chance target-side auras add to this attacker's spells alone, indexed the way
	// DamageDoneByCasterExtraMultiplier is.
	// Used with EnableCritChanceByCaster/DisableCritChanceByCaster
	CritChanceByCasterBonus []DynamicCritChanceByCaster
}

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

func (*AttackTable) GetBinaryHitChance

func (at *AttackTable) GetBinaryHitChance(spell *Spell) float64

func (*AttackTable) Hand

func (at *AttackTable) Hand(spell *Spell) *AttackTableHand

Hand returns the entry of the hand the spell attacks with.

type AttackTableHand

type AttackTableHand struct {
	BaseMissChance       float64
	BaseDodgeChance      float64
	BaseParryChance      float64
	BaseBlockChance      float64
	BaseGlanceChance     float64
	GlanceMultiplierMin  float64
	GlanceMultiplierMax  float64
	MeleeCritSuppression float64
	BaseSpellMissChance  float64 // The spell table's miss with the level difference taken from the hand's skill.
}

The parts of an attack table that depend on the weapon skill of the attacking hand.

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.
	ActionIDForProc ActionID     // If set, indicates that this aura is a trigger aura for the specified proc.
	Source          ActionSource // Left unset, registration fills in the phase it runs in.

	MenuGroup   string // A manual APL menu group, rotation_tab.apl.submenus keys joined by dots (spell.cat.stealth).
	HideFromAPL bool   // Left out of the APL's aura pickers and the SIML names; the aura still runs.

	Icd *Cooldown           // The internal cooldown if any
	Dpm *DynamicProcManager // Dynamic Proc manager for proc trigger auras if any

	Duration time.Duration // Duration of aura, upon being applied.

	// The unit this aura is attached to.
	Unit *Unit

	MaxStacks int32

	ExclusiveEffects []*ExclusiveEffect

	// Lifecycle callbacks.
	OnInit          OnInit
	OnReset         OnReset
	OnDoneIteration OnDoneIteration
	OnGain          OnGain
	OnExpire        OnExpire
	OnStacksChange  OnStacksChange // Invoked when the number of stacks of this aura changes.

	OnApplyEffects        OnApplyEffects   // Invoked when a spell cast is completing, before apply effects are called
	OnCastComplete        OnCastComplete   // Invoked when a spell cast completes casting, after apply effects.
	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.
	OnEncounterStart      OnEncounterStart // Invoked at the start of each encounter, after the pre-pull.
	OnCastResult          OnSpellHit       // Invoked when a direct damage result is dealt at the cast and this unit is the caster.
	OnTargetDies          OnTargetDeath    // Invoked when an enemy target dies, whoever kills it.
	OnKill                OnTargetDeath    // Invoked when an enemy target dies and this unit's side gets the kill.

	// If non-default, stat bonuses from the OnGain callback of this aura will be
	// included in Character Stats in the UI.
	BuildPhase CharacterBuildPhase
	// 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 BlockPrepull

func BlockPrepull(aura *Aura) *Aura

func MakeDashAura

func MakeDashAura(unit *Unit, label string, actionID ActionID, duration time.Duration, onArrive func(sim *Simulation)) *Aura

TODO: Manual review needed -- the run speed and the callers' overshoot are the sim's movement model. The arrival callback runs only on reaching the target, never when the aura runs out or the iteration is torn down.

func MakePermanent

func MakePermanent(aura *Aura) *Aura

Returns the same Aura for chaining.

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) AddStacks

func (aura *Aura) AddStacks(sim *Simulation, stacks int32)

func (*Aura) ApplyOnEncounterStart

func (aura *Aura) ApplyOnEncounterStart(newOnEncounterStart OnEncounterStart) *Aura

func (*Aura) ApplyOnExpire

func (aura *Aura) ApplyOnExpire(newOnExpire OnExpire) *Aura

Adds a handler to be called OnExpire, in addition to any current handlers.

func (*Aura) ApplyOnGain

func (aura *Aura) ApplyOnGain(newOnGain OnGain) *Aura

Adds a handler to be called OnGain, in addition to any current handlers.

func (*Aura) ApplyOnInit

func (aura *Aura) ApplyOnInit(newOnInit OnInit) *Aura

Adds a handler to be called OnInit, in addition to any current handlers. We then return the Aura for chaining

func (*Aura) ApplyOnReset

func (aura *Aura) ApplyOnReset(newOnReset OnReset) *Aura

Adds a handler to be called OnReset, in addition to any current handlers.

func (*Aura) ApplyOnStacksChange

func (aura *Aura) ApplyOnStacksChange(newOnStacksChange OnStacksChange) *Aura

Adds a handler to be called OnStacksChange, in addition to any current handlers. We then return the Aura for chaining

func (*Aura) AttachAdditivePseudoStatBuff

func (parentAura *Aura) AttachAdditivePseudoStatBuff(fieldPointer *float64, bonus float64) *Aura

Attaches an additive PseudoStat buff to a parent Aura Returns parent aura for chaining

func (*Aura) AttachDDBC

func (parentAura *Aura) AttachDDBC(index int, maxIndex int, attackTables *[]*AttackTable, handler DynamicDamageDoneByCaster) *Aura

Attaches a Damage Done By Caster buff to a parent Aura Returns parent aura for chaining

func (*Aura) AttachDependentAura

func (aura *Aura) AttachDependentAura(sibling *Aura) *Aura

func (*Aura) AttachFearImmunity

func (aura *Aura) AttachFearImmunity() *Aura

func (*Aura) AttachHastePseudoStats

func (aura *Aura) AttachHastePseudoStats(pseudoStats []float64) *Aura

Multiplies the unit's melee, ranged and cast speed by the haste percents pseudoStats states, indexed by proto.PseudoStat, while the aura is up.

func (*Aura) AttachMobTypeBonusStats

func (parentAura *Aura) AttachMobTypeBonusStats(bonus stats.Stats, mobTypes ...proto.MobType) *Aura

The stats against the mob types while the aura is up. Returns parent aura for chaining

func (*Aura) AttachMultiplicativePseudoStatBuff

func (parentAura *Aura) AttachMultiplicativePseudoStatBuff(fieldPointer *float64, multiplier float64) *Aura

Attaches a multiplicative PseudoStat buff to a parent Aura Returns parent aura for chaining

func (*Aura) AttachMultiplyAttackSpeed

func (parentAura *Aura) AttachMultiplyAttackSpeed(multiplier float64) *Aura

func (*Aura) AttachMultiplyCastSpeed

func (parentAura *Aura) AttachMultiplyCastSpeed(multiplier float64) *Aura

func (*Aura) AttachMultiplyMeleeSpeed

func (parentAura *Aura) AttachMultiplyMeleeSpeed(multiplier float64) *Aura

func (*Aura) AttachMultiplyRangedHaste

func (parentAura *Aura) AttachMultiplyRangedHaste(multiplier float64) *Aura

func (*Aura) AttachMultiplyRangedSpeed

func (parentAura *Aura) AttachMultiplyRangedSpeed(multiplier float64) *Aura

func (*Aura) AttachMultiplyWeaponSpeed

func (parentAura *Aura) AttachMultiplyWeaponSpeed(multiplier float64) *Aura

func (*Aura) AttachPeriodicAction

func (parentAura *Aura) AttachPeriodicAction(config PeriodicActionOptions) *Aura

func (*Aura) AttachProcTrigger

func (parentAura *Aura) AttachProcTrigger(config ProcTrigger) *Aura

Attaches a ProcTrigger to a parent Aura Preffered use-case. For non standard use-cases see: MakeDependentProcTriggerAura Returns parent aura for chaining

func (*Aura) AttachProcTriggerCallback

func (procAura *Aura) AttachProcTriggerCallback(unit *Unit, config ProcTrigger)

func (*Aura) AttachReducedCritTakenPercentBuff

func (parentAura *Aura) AttachReducedCritTakenPercentBuff(bonus float64) *Aura

Attaches a ReducedCritTakenPercent buff that updates the base and recalculates totals. Returns parent aura for chaining.

func (*Aura) AttachSpellMod

func (parentAura *Aura) AttachSpellMod(spellModConfig SpellModConfig) *Aura

Attaches a SpellMod to a parent Aura Returns parent aura for chaining

func (*Aura) AttachStatBuff

func (parentAura *Aura) AttachStatBuff(stat stats.Stat, value float64) *Aura

Adds a Stat to a parent Aura Returns parent aura for chaining

func (*Aura) AttachStatDependency

func (parentAura *Aura) AttachStatDependency(statDep *stats.StatDependency) *Aura

Attaches a StatDependency to a parent Aura Returns parent aura for chaining

func (*Aura) AttachStatsBuff

func (parentAura *Aura) AttachStatsBuff(stats stats.Stats) *Aura

Adds Stats to a parent Aura Returns parent aura for chaining

func (*Aura) AttachStunImmunity

func (aura *Aura) AttachStunImmunity() *Aura

func (*Aura) Deactivate

func (aura *Aura) Deactivate(sim *Simulation)

Remove an aura by its ID

func (*Aura) ExpiresAt

func (aura *Aura) ExpiresAt() time.Duration

func (*Aura) ExposeToAPL

func (setBonusTracker *Aura) ExposeToAPL(spellID int32) *Aura

Adds a spellID to the set bonus so it can be exposed to the APL

func (*Aura) GetStacks

func (aura *Aura) GetStacks() int32

func (*Aura) IsActive

func (aura *Aura) IsActive() bool

func (*Aura) MakeDependentProcTriggerAura

func (parentAura *Aura) MakeDependentProcTriggerAura(unit *Unit, config ProcTrigger) *Aura

Creates a new ProcTriggerAura that is dependent on a parent Aura being active This should only be used if the dependent Aura is: 1. On the a different Unit than parent Aura is registered to (usually the Character) 2. You need to register multiple dependent Aura's for the same Unit

func (*Aura) NewActiveMovementSpeedEffect

func (aura *Aura) NewActiveMovementSpeedEffect(multiplier float64) *ExclusiveEffect

func (*Aura) NewExclusiveEffect

func (aura *Aura) NewExclusiveEffect(categoryName string, singleAura bool, config ExclusiveEffect) *ExclusiveEffect

func (*Aura) NewPassiveMovementSpeedEffect

func (aura *Aura) NewPassiveMovementSpeedEffect(multiplier float64) *ExclusiveEffect

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) RemoveStacks

func (aura *Aura) RemoveStacks(sim *Simulation, stacks int32)

func (*Aura) RestoreState

func (aura *Aura) RestoreState(state AuraState, sim *Simulation)

func (*Aura) SaveState

func (aura *Aura) SaveState(sim *Simulation) AuraState

func (*Aura) SetStacks

func (aura *Aura) SetStacks(sim *Simulation, newStacks int32)

func (*Aura) ShouldRefreshExclusiveEffects

func (aura *Aura) ShouldRefreshExclusiveEffects(sim *Simulation, refreshWindow time.Duration) bool

Returns if an aura should be refreshed, i.e. the aura is inactive/about to expire AND there are no other active effects of equal or greater strength.

func (*Aura) StartedAt

func (aura *Aura) StartedAt() time.Duration

func (*Aura) TimeActive

func (aura *Aura) TimeActive(sim *Simulation) time.Duration

The amount of time this aura has been active.

func (*Aura) TimeInactive

func (aura *Aura) TimeInactive(sim *Simulation) time.Duration

The amount of elapsed time since this aura was last active.

func (*Aura) UpdateExpires

func (aura *Aura) UpdateExpires(newExpires time.Duration)

type AuraArray

type AuraArray []*Aura

func (AuraArray) ActivateAll

func (auras AuraArray) ActivateAll(sim *Simulation)

Activates all auras in the array on all enabled targets in the environment.

func (AuraArray) ActivateAllPlayers

func (auras AuraArray) ActivateAllPlayers(sim *Simulation)

Activates all auras in the array on all enabled player units in the environment.

func (AuraArray) ApplyFearToAllUnits

func (auras AuraArray) ApplyFearToAllUnits(sim *Simulation)

func (AuraArray) ApplyOnExpire

func (auras AuraArray) ApplyOnExpire(onExpire OnExpire)

func (AuraArray) ApplyStunToAllUnits

func (auras AuraArray) ApplyStunToAllUnits(sim *Simulation)

func (AuraArray) DeactivateAll

func (auras AuraArray) DeactivateAll(sim *Simulation)

func (AuraArray) FindLabel

func (auras AuraArray) FindLabel() string

func (AuraArray) Get

func (auras AuraArray) Get(target *Unit) *Aura

func (AuraArray) IsEmpty

func (auras AuraArray) IsEmpty() bool

func (AuraArray) ToMap

func (auras AuraArray) ToMap() LabeledAuraArrays

type AuraCallback

type AuraCallback uint16
const (
	CallbackEmpty AuraCallback = 0

	CallbackOnSpellHitDealt AuraCallback = 1 << iota
	CallbackOnSpellHitTaken
	CallbackOnPeriodicDamageDealt
	CallbackOnHealDealt
	CallbackOnPeriodicHealDealt
	CallbackOnCastComplete
	CallbackOnApplyEffects
	CallbackOnPeriodicDamageTaken
	CallbackOnCastResult
	CallbackOnTargetDies // Any enemy's death. The handler and ExtraCondition get a nil spell and a result whose Target is the dying target; a deferred handler runs after the target is disabled.
	CallbackOnKill       // A death the raid gets the kill for. The handler and ExtraCondition get a nil spell and a result whose Target is the dying target; a deferred handler runs after the target is disabled.

	CallbackLast
)

func (AuraCallback) Matches

func (c AuraCallback) Matches(other AuraCallback) bool

func (AuraCallback) String

func (i AuraCallback) String() string

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() *proto.AuraMetrics

type AuraReference

type AuraReference struct {
	// contains filtered or unexported fields
}

func NewAuraReference

func NewAuraReference(sourceUnit UnitReference, auraId *proto.ActionID) AuraReference

func NewIcdAuraReference

func NewIcdAuraReference(sourceUnit UnitReference, auraId *proto.ActionID) AuraReference

func (*AuraReference) Get

func (ar *AuraReference) Get() *Aura

func (*AuraReference) String

func (ar *AuraReference) String() string

type AuraState

type AuraState struct {
	RemainingDuration time.Duration
	Stacks            int32
}

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 SwingRanged() for you.
	ReplaceMHSwing  ReplaceMHSwing
	ProcMask        ProcMask // If set will replace the ProcMask for any weapon spells configured.
}

Options for initializing auto attacks.

type AutoAttacks

type AutoAttacks struct {
	AutoSwingMelee    bool
	AutoSwingRanged   bool
	RandomMeleeOffset bool

	IsDualWielding bool
	// 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) CancelMeleeSwing

func (aa *AutoAttacks) CancelMeleeSwing(sim *Simulation)

func (*AutoAttacks) CancelQueuedSwing

func (aa *AutoAttacks) CancelQueuedSwing(sim *Simulation)

Drops the attack the unit queued for the next swing, if any.

func (*AutoAttacks) CancelRangedSwing

func (aa *AutoAttacks) CancelRangedSwing(sim *Simulation)

func (*AutoAttacks) DelayMeleeBy

func (aa *AutoAttacks) DelayMeleeBy(sim *Simulation, delay time.Duration)

Delays all swing timers for the specified amount.

func (*AutoAttacks) DelayRangedUntil

func (aa *AutoAttacks) DelayRangedUntil(sim *Simulation, readyAt time.Duration)

Prevents ranged windup until readyAt while the underlying swing timer keeps running.

func (*AutoAttacks) DesyncOffHand

func (aa *AutoAttacks) DesyncOffHand(sim *Simulation, readyAt time.Duration)

Desyncs the offhand swing

func (*AutoAttacks) EnableAutoSwing

func (aa *AutoAttacks) EnableAutoSwing(sim *Simulation)

Re-enables the auto swing action for the iteration

func (*AutoAttacks) EnableMeleeSwing

func (aa *AutoAttacks) EnableMeleeSwing(sim *Simulation)

func (*AutoAttacks) EnableRangedSwing

func (aa *AutoAttacks) EnableRangedSwing(sim *Simulation)

func (*AutoAttacks) MH

func (aa *AutoAttacks) MH() *Weapon

func (*AutoAttacks) MHAuto

func (aa *AutoAttacks) MHAuto() *Spell

func (*AutoAttacks) MHConfig

func (aa *AutoAttacks) MHConfig() *SpellConfig

func (*AutoAttacks) MainHandPendingSwingDelay

func (aa *AutoAttacks) MainHandPendingSwingDelay() time.Duration

func (*AutoAttacks) MainhandPreviousSwing

func (aa *AutoAttacks) MainhandPreviousSwing() time.Duration

func (*AutoAttacks) MainhandSwingAt

func (aa *AutoAttacks) MainhandSwingAt() time.Duration

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) NextAnyAttackAt

func (aa *AutoAttacks) NextAnyAttackAt() time.Duration

Returns the earliest melee event or ranged timing value, including a due blocked ranged shot.

func (*AutoAttacks) NextAttackAt

func (aa *AutoAttacks) NextAttackAt() time.Duration

Returns the time at which the next melee attack will occur.

func (*AutoAttacks) NextRangedAttackAt

func (aa *AutoAttacks) NextRangedAttackAt() time.Duration

Returns the next ranged event time, or the natural windup start while an enabled shot is blocked.

func (*AutoAttacks) OH

func (aa *AutoAttacks) OH() *Weapon

func (*AutoAttacks) OHAuto

func (aa *AutoAttacks) OHAuto() *Spell

func (*AutoAttacks) OHConfig

func (aa *AutoAttacks) OHConfig() *SpellConfig

func (*AutoAttacks) OffhandPreviousSwing

func (aa *AutoAttacks) OffhandPreviousSwing() time.Duration

func (*AutoAttacks) OffhandSwingAt

func (aa *AutoAttacks) OffhandSwingAt() time.Duration

func (*AutoAttacks) OffhandSwingSpeed

func (aa *AutoAttacks) OffhandSwingSpeed() time.Duration

The amount of time between two OH swings.

func (*AutoAttacks) PPMProc

func (aa *AutoAttacks) PPMProc(sim *Simulation, ppm float64, procMask ProcMask, label string, spell *Spell) bool

Returns whether a PPM-based effect procced. Using NewPPMManager() is preferred; this function should only be used when the attacker is not known at initialization time.

func (*AutoAttacks) PauseMeleeBy

func (aa *AutoAttacks) PauseMeleeBy(sim *Simulation, pauseTime time.Duration)

PauseMeleeBy will prevent any swing from completing for the specified time. This replicates a /stopattack and /startattack with a brief "pause" in the middle. It's possible that no swing time is lost if the pauseTime is less than the remaining swing time. Used by Rogue Gouge

func (*AutoAttacks) PreviousRangedAttack

func (aa *AutoAttacks) PreviousRangedAttack() time.Duration

func (*AutoAttacks) RandomizeMeleeTiming

func (aa *AutoAttacks) RandomizeMeleeTiming(sim *Simulation)

Used to prevent artificial Haste breakpoints arising from APL evaluations after autos occurring at locally optimal timings.

func (*AutoAttacks) Ranged

func (aa *AutoAttacks) Ranged() *Weapon

func (*AutoAttacks) RangedAuto

func (aa *AutoAttacks) RangedAuto() *Spell

func (*AutoAttacks) RangedConfig

func (aa *AutoAttacks) RangedConfig() *SpellConfig

func (*AutoAttacks) RangedPendingSwingDelay

func (aa *AutoAttacks) RangedPendingSwingDelay() time.Duration

func (*AutoAttacks) RangedSwingSpeed

func (aa *AutoAttacks) RangedSwingSpeed() time.Duration

The amount of time between two Ranged swings.

func (*AutoAttacks) ResumeMeleeAt

func (aa *AutoAttacks) ResumeMeleeAt(sim *Simulation, mhAt time.Duration, ohAt time.Duration)

ResumeMeleeAt undoes the unused part of a PauseMeleeBy, restoring the swing times it pushed out. The swing timer is treated as having kept running, so a swing that came due during the pause fires as soon as it ends. Swings are only ever moved earlier, never past their original time and never into the past.

func (*AutoAttacks) ResumeRangedAt

func (aa *AutoAttacks) ResumeRangedAt(sim *Simulation, readyAt time.Duration)

Restores an earlier pause boundary after early recovery, using the current haste for windup.

func (*AutoAttacks) SetMH

func (aa *AutoAttacks) SetMH(weapon Weapon)

func (*AutoAttacks) SetMHSpell

func (aa *AutoAttacks) SetMHSpell(spell *Spell)

func (*AutoAttacks) SetOH

func (aa *AutoAttacks) SetOH(weapon Weapon)

func (*AutoAttacks) SetOHSpell

func (aa *AutoAttacks) SetOHSpell(spell *Spell)

func (*AutoAttacks) SetOffhandSwingAt

func (aa *AutoAttacks) SetOffhandSwingAt(offhandSwingAt time.Duration)

func (*AutoAttacks) SetQueuedSwingCanceler

func (aa *AutoAttacks) SetQueuedSwingCanceler(cancel func(sim *Simulation))

Sets how the unit drops the attack it queued for the next swing (Heroic Strike, Cleave, Maul); nil for a unit that queues none.

func (*AutoAttacks) SetRanged

func (aa *AutoAttacks) SetRanged(weapon Weapon)

func (*AutoAttacks) SetReplaceMHSwing

func (aa *AutoAttacks) SetReplaceMHSwing(replaceSwing ReplaceMHSwing)

func (*AutoAttacks) SetReplaceOHSwing

func (aa *AutoAttacks) SetReplaceOHSwing(replaceSwing ReplaceMHSwing)

func (*AutoAttacks) StartMeleeAttack

func (aa *AutoAttacks) StartMeleeAttack(sim *Simulation)

Toggles the melee attack on. For a unit that also shoots, the off hand's next swing comes no sooner than half a swing from now, out of range or not, so starting the attack on the way in brings it closer to ready by the time the unit arrives.

func (*AutoAttacks) StopMeleeUntil

func (aa *AutoAttacks) StopMeleeUntil(sim *Simulation, readyAt time.Duration)

StopMeleeUntil should be used whenever a non-melee spell is cast. It stops melee, then restarts it at end of cast, but with a reset swing timer (as if swings had just landed).

func (*AutoAttacks) StopRangedUntil

func (aa *AutoAttacks) StopRangedUntil(sim *Simulation, readyAt time.Duration)

func (*AutoAttacks) SwingAt

func (aa *AutoAttacks) SwingAt() (mhAt time.Duration, ohAt time.Duration)

Reports when the melee swings are due, so a caller can restore them if a pause ends early.

func (*AutoAttacks) UpdateRangedRange

func (aa *AutoAttacks) UpdateRangedRange(sim *Simulation)

Starts or stops the ranged auto attack when the target has come into or gone out of its range.

func (*AutoAttacks) UpdateSwingTimers

func (aa *AutoAttacks) UpdateSwingTimers(sim *Simulation)

type BaseDamageCalculator

type BaseDamageCalculator func(*Simulation, *Spell) float64

type BaseStatsKey

type BaseStatsKey struct {
	Race  proto.Race
	Class proto.Class
}

type BuffHooks

type BuffHooks struct {
	ApplyBuffs func(char *Character, raid *proto.RaidBuffs, party *proto.PartyBuffs, individual *proto.IndividualBuffs)

	ApplyDebuffs func(target *Unit, debuffs *proto.Debuffs, raid *proto.Raid)
}

The raid buffs and debuffs live in sim/core/buffs, above this package, so that they can read the spell store, which imports this package. They register themselves here from that package's init, and sim/common imports it, which is what links it into every sim.

type BuffsCombo

type BuffsCombo struct {
	Label       string
	Raid        *proto.RaidBuffs
	Party       *proto.PartyBuffs
	Debuffs     *proto.Debuffs
	Player      *proto.IndividualBuffs
	Consumables *proto.ConsumesSpec
}

type CanCastCondition

type CanCastCondition func(sim *Simulation, target *Unit) bool

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 minimum length of time for the GCD. Can be left out to use the default of 1s
	GCDMin time.Duration

	// The amount of time between the call to spell.Cast() and when the spell
	// effects are invoked.
	CastTime time.Duration

	// A dummy value to give 0gcd casts a non empty struct
	NonEmpty bool
}

func (*Cast) EffectiveTime

func (cast *Cast) EffectiveTime() time.Duration

func (*Cast) GCDTime

func (cast *Cast) GCDTime() 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, *Unit)

	// Ignores haste when calculating the GCD and cast time for this cast.
	// Automatically set if GCD and cast times are all 0, e.g. for empty casts.
	IgnoreHaste bool

	CD       Cooldown
	SharedCD Cooldown

	CastTime func(spell *Spell) time.Duration
}

Input for constructing the CastSpell function for a spell.

type CastFunc

type CastFunc func(*Simulation, *Unit)

type CastRequirement

type CastRequirement struct {
	Forms, ExcludedForms          uint64           // SpellShapeshift masks, bit form-1
	CasterForm                    bool             // castable with no form even though Forms names some
	NotShapeshifted               bool             // not castable in a shapeshift (a form that is not a stance)
	CasterAura, ExcludeCasterAura int32            // aura spell id that must / must not be active on the caster
	Weapon                        EquipRequirement // SpellEquippedItems of a weapon: each hand named holds a matching weapon, else any weapon slot does
	Shield                        bool             // SpellEquippedItems of armor naming the shield subclass: the off hand holds a shield
	NotInCombat                   bool             // castable only before the encounter starts
	TargetMobTypes                uint32           // mob types the target must be one of, bit 1 << proto.MobType; zero allows any
	NotUnderHigherRank            bool             // a ranked row whose only effect besides a dummy or script effect is the periodic: refused while a higher rank of its dot (DotConfig.RankGroup) from the caster is up on the unit
}

What the game files require of the caster's form, auras and equipment, of the target's creature type, and of the ranks of the periodic the cast applies.

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
	Class proto.Class
	Spec  proto.Spec

	// Current gear.
	Equipment

	// Stat buff auras associated with any proc effects in the Character's equippable items
	ItemProcBuffs []*StatBuffAura

	//Item Swap Handler
	ItemSwap ItemSwap

	// Consumables this Character will be using.
	Consumables *proto.ConsumesSpec

	// Used for effects like "Increased Armor Value from Items"
	*EquipScalingManager

	// Up reference to this Character's Party.
	Party *Party

	// This character's index within its party [0-4].
	PartyIndex int

	Pets []*Pet // cached in AddPet, for advance()
	// 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 NewCharacter

func NewCharacter(party *Party, partyIndex int, player *proto.Player) Character

func (*Character) AddComboPoints

func (eb *Character) AddComboPoints(sim *Simulation, target *Unit, pointsToAdd int32, metrics *ResourceMetrics)

Combo points live on one unit. A gain on another unit drops the points held on the old one, and the gain lands on the new one; a target swap with no gain keeps them. The gain's metrics spend the dropped points, as a shapeshift's own metrics spend the rage it drops.

func (*Character) AddDynamicEquipStats

func (character *Character) AddDynamicEquipStats(sim *Simulation, equipStats stats.Stats)

func (*Character) AddEnergy

func (eb *Character) AddEnergy(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*Character) AddFocus

func (fb *Character) AddFocus(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) AddPet

func (character *Character) AddPet(pet PetAgent)

func (*Character) AddRage

func (rb *Character) AddRage(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*Character) AddRaidBuffs

func (character *Character) AddRaidBuffs(_ *proto.RaidBuffs)

func (*Character) AddStatProcBuff

func (character *Character) AddStatProcBuff(effectID int32, procAura *StatBuffAura, isEnchant bool, eligibleSlots []proto.ItemSlot)

func (*Character) ApplyDynamicEquipScaling

func (character *Character) ApplyDynamicEquipScaling(sim *Simulation, stat stats.Stat, multiplier float64)

func (*Character) ApplyEquipScaling

func (character *Character) ApplyEquipScaling(stat stats.Stat, multiplier float64)

func (*Character) BaseHealth

func (character *Character) BaseHealth() float64

The base health a "% of base health" cost reads: the class base plus the health of the base Stamina, whose first 20 points give 1 health each and every point after that 10. Gear, buffs and talents add nothing to it.

func (*Character) CalcAndRollDamageRange

func (char *Character) CalcAndRollDamageRange(sim *Simulation, min float64, max float64) float64

func (*Character) ComboPoints

func (eb *Character) ComboPoints(target *Unit) int32

The combo points on target: none unless target holds them.

func (*Character) CouldHaveSetBonus

func (character *Character) CouldHaveSetBonus(set *ItemSet, numItems int32) bool

func (*Character) CurrentEnergy

func (eb *Character) CurrentEnergy() float64

func (*Character) CurrentEnergyRegenMultiplier

func (eb *Character) CurrentEnergyRegenMultiplier() 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) Died

func (character *Character) Died(sim *Simulation)

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 *Character) EnableManaBarWithModifier()

func (*Character) EndOOMEvent

func (mb *Character) EndOOMEvent(sim *Simulation)

func (*Character) EquipStats

func (character *Character) EquipStats() stats.Stats

func (*Character) FillPlayerStats

func (character *Character) FillPlayerStats(playerStats *proto.PlayerStats)

func (*Character) FillTalentsProto

func (character *Character) FillTalentsProto(data protoreflect.Message, talentsStr string, treeSizes [3]int)

Uses proto reflection to set fields in a talents proto (e.g. MageTalents, WarriorTalents) based on a talentsStr. The character keeps every talent with points in it, which TalentRank and the unit metadata read.

A digit above the talent's talent_max_rank is capped there, and any digit above 0 takes a one-point talent: a string saved before a tree was reworked can put five points where the talent now takes three, and the class reads the field as a rank of the talent's ladder.

func (*Character) Finalize

func (character *Character) Finalize()

func (*Character) GainHealth

func (hb *Character) GainHealth(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*Character) GetActiveAuraWithTag

func (at *Character) GetActiveAuraWithTag(tag string) *Aura

func (*Character) GetActiveSetBonusNames

func (character *Character) GetActiveSetBonusNames() []string

Returns the names of all active set bonuses.

func (*Character) GetAura

func (at *Character) GetAura(label string) *Aura

func (*Character) GetAuraByID

func (at *Character) GetAuraByID(actionID ActionID) *Aura

func (*Character) GetAuras

func (at *Character) GetAuras() []*Aura

func (*Character) GetAurasWithTag

func (at *Character) GetAurasWithTag(tag string) []*Aura

func (*Character) GetBaseStats

func (character *Character) GetBaseStats() stats.Stats

func (*Character) GetCombatConsumableCD

func (character *Character) GetCombatConsumableCD() *Timer

func (*Character) GetConjuredCD

func (character *Character) GetConjuredCD() *Timer

func (*Character) GetDefensiveTrinketCD

func (character *Character) GetDefensiveTrinketCD() *Timer

func (*Character) GetDynamicProcMaskForTypes

func (character *Character) GetDynamicProcMaskForTypes(weaponTypes ...proto.WeaponType) *ProcMask

func (*Character) GetDynamicProcMaskForTypesAndHand

func (character *Character) GetDynamicProcMaskForTypesAndHand(twohand bool, weaponTypes ...proto.WeaponType) *ProcMask

func (*Character) GetDynamicProcMaskForWeaponEffect

func (character *Character) GetDynamicProcMaskForWeaponEffect(itemID int32) *ProcMask

func (*Character) GetDynamicProcMaskForWeaponEnchant

func (character *Character) GetDynamicProcMaskForWeaponEnchant(effectID int32) *ProcMask

func (*Character) GetDynamicProcMaskForWeaponTempEnchant

func (character *Character) GetDynamicProcMaskForWeaponTempEnchant(effectID int32) *ProcMask

func (*Character) GetIcdAuraByID

func (at *Character) GetIcdAuraByID(actionID ActionID) *Aura

func (*Character) GetInitialMajorCooldown

func (mcdm *Character) GetInitialMajorCooldown(actionID ActionID) MajorCooldown

func (*Character) GetMHWeapon

func (character *Character) GetMHWeapon() *Item

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 (mcdm *Character) GetMajorCooldownIDs() []*proto.ActionID

func (*Character) GetMajorCooldownIgnoreTag

func (mcdm *Character) GetMajorCooldownIgnoreTag(actionID ActionID) *MajorCooldown

func (*Character) GetMajorCooldowns

func (mcdm *Character) GetMajorCooldowns() []*MajorCooldown

Returns all MCDs.

func (*Character) GetMatchingItemProcAuras

func (character *Character) GetMatchingItemProcAuras(statTypesToMatch []stats.Stat, minIcd time.Duration) []*StatBuffAura

func (*Character) GetMatchingStatBuffCooldownAuras

func (mcdm *Character) GetMatchingStatBuffCooldownAuras(statTypesToMatch []stats.Stat) []*StatBuffAura

func (*Character) GetMatchingStatBuffSpells

func (mcdm *Character) GetMatchingStatBuffSpells(statTypesToMatch []stats.Stat) []*Spell

func (*Character) GetMetricsProto

func (character *Character) GetMetricsProto() *proto.UnitMetrics

func (*Character) GetOHWeapon

func (character *Character) GetOHWeapon() *Item

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 *Character) GetOffensiveTrinketCD() *Timer

func (*Character) GetOrInitSpellCategoryTimer

func (u *Character) GetOrInitSpellCategoryTimer(spellCategoryID int32) *Timer

Helper for timers keyed by spellCategoryID so that we can keep shared cooldowns for on use effects locked to these

func (*Character) GetPresimOptions

func (character *Character) GetPresimOptions(playerConfig *proto.Player) *PresimOptions

func (*Character) GetProcMaskForTypes

func (character *Character) GetProcMaskForTypes(weaponTypes ...proto.WeaponType) ProcMask

func (*Character) GetProcMaskForTypesAndHand

func (character *Character) GetProcMaskForTypesAndHand(twohand bool, weaponTypes ...proto.WeaponType) ProcMask

func (*Character) GetProcMaskForWeaponSlot

func (character *Character) GetProcMaskForWeaponSlot(slot proto.ItemSlot) ProcMask

func (*Character) GetPseudoStatsProto

func (character *Character) GetPseudoStatsProto() []float64

func (*Character) GetRangedWeapon

func (character *Character) GetRangedWeapon() *Item

Returns the ranged weapon if one is equipped, and null otherwise.

func (*Character) HasActiveAura

func (at *Character) HasActiveAura(label string) bool

func (*Character) HasActiveAuraWithTag

func (at *Character) HasActiveAuraWithTag(tag string) bool

func (*Character) HasActiveAuraWithTagExcludingAura

func (at *Character) HasActiveAuraWithTagExcludingAura(tag string, excludeAura *Aura) bool

func (*Character) HasAlchStone

func (character *Character) HasAlchStone() bool

func (*Character) HasAura

func (at *Character) HasAura(label string) bool

func (*Character) HasAuraWithTag

func (at *Character) HasAuraWithTag(tag string) bool

func (*Character) HasEnchantEquipped

func (character *Character) HasEnchantEquipped(effectID int32, possibleSlots []proto.ItemSlot) bool

func (*Character) HasItemEquipped

func (character *Character) HasItemEquipped(itemID int32, possibleSlots []proto.ItemSlot) bool

func (*Character) HasMHWeapon

func (character *Character) HasMHWeapon() bool

func (*Character) HasOH

func (character *Character) HasOH() bool

func (*Character) HasOHWeapon

func (character *Character) HasOHWeapon() bool

func (*Character) HasProfession

func (character *Character) HasProfession(prof proto.Profession) bool

func (*Character) HasRangedWeapon

func (character *Character) HasRangedWeapon() bool

func (*Character) HasRingEquipped

func (character *Character) HasRingEquipped(itemID int32) bool

func (*Character) HasTrinketEquipped

func (character *Character) HasTrinketEquipped(itemID int32) bool

func (*Character) IsOOM

func (mb *Character) IsOOM() bool

func (*Character) IsPickedPotion

func (character *Character) IsPickedPotion(itemID int32) bool

Whether the consumes pick the potion for any APL potion placeholder.

func (*Character) IsReset

func (eb *Character) IsReset(sim *Simulation) bool

func (*Character) MaxComboPoints

func (eb *Character) MaxComboPoints() int32

func (*Character) MaxHealth

func (hb *Character) MaxHealth() float64

func (*Character) MaximumEnergy

func (eb *Character) MaximumEnergy() float64

func (*Character) MaximumRage

func (rb *Character) MaximumRage() float64

func (*Character) MeetsProfession

func (character *Character) MeetsProfession(prof proto.Profession, rank int32) bool

Whether the character has prof at rank or higher. ProfessionUnknown is always met.

func (*Character) MultiplyDamageTakenRageGen

func (rb *Character) MultiplyDamageTakenRageGen(multiplier float64)

func (*Character) MultiplyEnergyRegenSpeed

func (eb *Character) MultiplyEnergyRegenSpeed(sim *Simulation, multiplier float64)

func (*Character) MultiplyFocusRegenSpeed added in v1.0.12

func (fb *Character) MultiplyFocusRegenSpeed(multiplier float64)

func (*Character) NewAttackerSwingPPMManager

func (character *Character) NewAttackerSwingPPMManager(ppm float64, procMask ProcMask, scale func(attacker *Unit) float64) *DynamicProcManager

A procs-per-minute rate on hits taken, priced on the attacker's time between its own swings at the hit, slows included: its main hand's interval, or both hands together when it dual-wields. An attacker with no melee auto attack has no interval and never procs it. scale multiplies the chance per attacker. Read without a hit, the chance is the one against the wearer's current target.

func (*Character) NewDynamicLegacyProcForEnchant

func (character *Character) NewDynamicLegacyProcForEnchant(effectID int32, ppm float64, fixedProcChance float64) *DynamicProcManager

Dynamic Proc Manager for dynamic ProcMasks on weapon enchants

func (*Character) NewDynamicLegacyProcForEnchantWithMask

func (character *Character) NewDynamicLegacyProcForEnchantWithMask(effectID int32, ppm float64, procMask ProcMask) *DynamicProcManager

Dynamic Proc Manager for a weapon enchant heard on its own ProcMask: the mask's weapon hits roll on the hands carrying the enchant at their own speeds, and nothing else rolls.

func (*Character) NewDynamicLegacyProcForTempEnchant

func (character *Character) NewDynamicLegacyProcForTempEnchant(effectID int32, ppm float64, fixedProcChanceFn func(ProcMask) float64) *DynamicProcManager

Dynamic Proc Manager for dynamic ProcMasks on weapon temp enchants

func (*Character) NewDynamicLegacyProcForWeapon

func (character *Character) NewDynamicLegacyProcForWeapon(itemID int32, ppm float64, fixedProcChance float64) *DynamicProcManager

Dynamic Proc Manager for dynamic ProcMasks on weapon effects

func (*Character) NewEquipGate

func (character *Character) NewEquipGate(req EquipRequirement, set func(sim *Simulation, level float64)) *EquipGate

func (*Character) NewEquipGatedStats

func (character *Character) NewEquipGatedStats(req EquipRequirement, bonus stats.Stats) *EquipGatedStats

func (*Character) NewEquipScalingManager

func (character *Character) NewEquipScalingManager() *EquipScalingManager

func (*Character) NewFixedProcChanceManager

func (character *Character) NewFixedProcChanceManager(fixedProcChance float64, procMask ProcMask) *DynamicProcManager

Dynamic Proc Manager for static ProcMasks and no item swap callback

func (*Character) NewItemVersusBonus

func (character *Character) NewItemVersusBonus(itemID int32, kind proto.VersusEffectKind, bonus VersusBonus) *VersusBonus

The factor an item's spell deals or restores against the mob types and families, kept for the stats sheet. A damage spell applies it as its SpellConfig.VersusBonus; any other amount is multiplied by Against at the call site.

func (*Character) NewLegacyPPMManager

func (character *Character) NewLegacyPPMManager(ppm float64, procMask ProcMask) *DynamicProcManager

PPMManager for static ProcMasks

func (*Character) NewLegacyPPMManagerWithCastTimeSpells added in v1.0.4

func (character *Character) NewLegacyPPMManagerWithCastTimeSpells(label string, ppm float64, procMask ProcMask) *DynamicProcManager

A procs-per-minute rate for weapon hits beside the same rate for spell hits, each spell hit priced on the cast time of the cast that dealt it and never under the 1.5 s global cooldown, so an instant or a channel prices at 1.5 s. The cast time is read at the cast's result, so a missile still in flight keeps it when the next cast of the spell starts. The weapon hits NewLegacyPPMManager measures keep its speeds: a swing's, and with no auto attack the wand's for a ranged hit. Every other hit of the mask except a ranged auto attack rolls the rate on the main-hand weapon's own speed, read at the roll, whether or not the character swings it: a spell on the ranged hit table with no ranged swing or wand behind it, such as Hammer of Wrath. With no main-hand weapon it is the sim's unarmed weapon's speed. label names the aura that records the cast times.

func (*Character) NewLegacyPPMManagerWithMainHandSpells

func (character *Character) NewLegacyPPMManagerWithMainHandSpells(ppm float64, procMask ProcMask) *DynamicProcManager

A procs-per-minute rate for weapon hits beside the same rate for every other hit of the mask, on the main-hand weapon's own speed read at the roll. The weapon hits NewLegacyPPMManager measures keep its speeds: a swing's, and with no auto attack the wand's for a ranged hit. A spell hit, and any hit no swing prices except a ranged auto attack, rolls the rate on the main-hand weapon's speed whether or not the character swings it. With no main-hand weapon it is the sim's unarmed weapon's speed.

func (*Character) NewPartyAuraArray

func (caster *Character) NewPartyAuraArray(makeAura func(*Character) *Aura) AuraArray

An aura on each player in the caster's party, the caster among them, and none on their pets.

func (*Character) NewStaticLegacyPPMManager

func (character *Character) NewStaticLegacyPPMManager(ppm float64, procMask ProcMask) *DynamicProcManager

PPMManager for static ProcMasks and no item swap callback

func (*Character) NewTargetScaledChanceManager

func (character *Character) NewTargetScaledChanceManager(chance float64, procMask ProcMask, scale func(target *Unit) float64) *DynamicProcManager

A fixed chance per hit, multiplied by scale for the hit's target. Read without a hit, the chance is the one against the wearer's current target.

func (*Character) NewTemporaryStatBuffWithStacks

func (character *Character) NewTemporaryStatBuffWithStacks(config TemporaryStatBuffWithStacksConfig) (*StatBuffAura, *Aura)

func (*Character) NewTemporaryStatMultiplierAura

func (character *Character) NewTemporaryStatMultiplierAura(config Aura, multipliers []StatMultiplier) *StatBuffAura

A buff that multiplies stats through dynamic stat dependencies, turned on and off with the aura. The temporary stats listeners hear the stats the dependencies add on gain and remove on expire, measured at that moment.

func (*Character) NewTemporaryStatsAura

func (character *Character) NewTemporaryStatsAura(auraLabel string, actionID ActionID, tempStats stats.Stats, duration time.Duration) *StatBuffAura

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)) *StatBuffAura

Alternative that allows modifying the Aura config.

func (*Character) NewWeaponSpeedPPMManager

func (character *Character) NewWeaponSpeedPPMManager(ppm float64, procMask ProcMask) *DynamicProcManager

A procs-per-minute rate on the main hand's speed as WeaponSpeedMultiplier leaves it: Seal of the Crusader's faster swings each carry 1/1.4 of the chance, so the swings' procs a minute hold, and haste leaves the chance alone. Both are read at each roll, so a weapon swap needs no callback.

func (*Character) NextEnergyTickAt

func (eb *Character) NextEnergyTickAt() time.Duration

func (*Character) NumActiveAurasWithTag

func (at *Character) NumActiveAurasWithTag(tag string) int32

func (*Character) OnApplyEffects

func (at *Character) OnApplyEffects(sim *Simulation, target *Unit, spell *Spell)

Invokes the OnApplyEffects event for all tracked Auras.

func (*Character) OnCastComplete

func (at *Character) OnCastComplete(sim *Simulation, spell *Spell)

Invokes the OnCastComplete event for all tracked Auras.

func (*Character) OnCastResult

func (at *Character) OnCastResult(sim *Simulation, spell *Spell, result *SpellResult)

func (*Character) OnEncounterStart

func (at *Character) OnEncounterStart(sim *Simulation)

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) OnKill

func (at *Character) OnKill(sim *Simulation, target *Unit)

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) OnTargetDies

func (at *Character) OnTargetDies(sim *Simulation, target *Unit)

func (*Character) RegisterItemSwapCallback

func (character *Character) RegisterItemSwapCallback(slots []proto.ItemSlot, callback OnItemSwap)

func (*Character) RegisterPvPGloveMod

func (character *Character) RegisterPvPGloveMod(itemIDs []int32, config SpellModConfig)

Adds a Spellmod to PVP GLoves

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) RegisterRotationTransformation

func (character *Character) RegisterRotationTransformation(transformation RotationTransformation)

func (*Character) RegisterWeaponChangeCallback

func (character *Character) RegisterWeaponChangeCallback(callback func(*Simulation))

Runs the callback once per swap that changes the item in a weapon slot, after every slot is swapped.

func (*Character) RemoveDynamicEquipScaling

func (character *Character) RemoveDynamicEquipScaling(sim *Simulation, stat stats.Stat, multiplier float64)

func (*Character) RemoveEquipScaling

func (character *Character) RemoveEquipScaling(stat stats.Stat, multiplier float64)

func (*Character) RemoveHealth

func (hb *Character) RemoveHealth(sim *Simulation, amount float64)

Health lost to damage taken, booked under Damage Taken and counted in TMI on a tanking unit.

func (*Character) ResetComboPoints

func (eb *Character) ResetComboPoints(sim *Simulation, target *Unit, comboPointsToKeep int32)

func (*Character) ResetEnergyTick

func (eb *Character) ResetEnergyTick(sim *Simulation)

Gives an immediate partial energy tick and restarts the tick timer.

func (*Character) ResetRageBar

func (rb *Character) ResetRageBar(sim *Simulation, rageToKeep float64)

func (*Character) SelectedConsumableIDs

func (character *Character) SelectedConsumableIDs() []int32

The character's own consumables the spec names, each once, in the order they apply.

func (*Character) SetCurrentHealthPercent

func (hb *Character) SetCurrentHealthPercent(percent float64)

Puts current health at a share of the maximum with no healing or damage, so no metrics or TMI entry move. A druid's change of form moves the maximum and keeps the share.

func (*Character) SetFeralCombat

func (character *Character) SetFeralCombat(enabled bool)

Feral forms replace equipped weapon skill and refresh existing attack tables.

func (*Character) SetMaxComboPoints

func (eb *Character) SetMaxComboPoints(maxComboPoints int32)

func (*Character) SetMaximumEnergy

func (eb *Character) SetMaximumEnergy(sim *Simulation, maxEnergy float64, metrics *ResourceMetrics)

Sets the most energy the bar holds. A raised maximum grants no energy; energy above a lowered one is lost and counted against the metrics. Without a Simulation there is no energy yet to lose.

func (*Character) SetMaximumRage

func (rb *Character) SetMaximumRage(sim *Simulation, maxRage float64, metrics *ResourceMetrics)

Sets the most rage the bar holds. A raised maximum grants no rage; rage above a lowered one is lost and counted against the metrics. Without a Simulation there is no rage yet to lose.

func (*Character) SetOffHandRageMultiplier

func (rb *Character) SetOffHandRageMultiplier(multiplier float64)

func (*Character) SetSpiritManaRegen

func (character *Character) SetSpiritManaRegen(base float64, perSpirit float64)

SetSpiritManaRegen sets the spirit regen to base + Spirit*perSpirit mana per second. It replaces the class default, so call it after EnableManaBar.

func (*Character) SkipForMana

func (mb *Character) SkipForMana()

For a rotation that checks a mana cost itself: the current pass skips a spell it wants for its cost.

func (*Character) SpendComboPoints

func (eb *Character) SpendComboPoints(sim *Simulation, target *Unit, metrics *ResourceMetrics)

func (*Character) SpendEnergy

func (eb *Character) SpendEnergy(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*Character) SpendFocus

func (fb *Character) SpendFocus(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*Character) SpendHealth

func (hb *Character) SpendHealth(sim *Simulation, amount float64, metrics *ResourceMetrics)

Health a spell takes from its own caster as a cost, booked under the spell's metrics. A self cost is not damage taken, so it adds no TMI entry.

func (*Character) SpendPartialComboPoints

func (eb *Character) SpendPartialComboPoints(sim *Simulation, target *Unit, pointsToSpend int32, metrics *ResourceMetrics)

A spend on a unit that holds no combo points spends none.

func (*Character) SpendRage

func (rb *Character) SpendRage(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*Character) StartOOMEvent

func (mb *Character) StartOOMEvent(sim *Simulation)

Pets keep no OOM metrics, so they never go OOM.

func (*Character) TalentRank

func (character *Character) TalentRank(spellID int32) int32

The points held in the talent whose field carries this talent_spell_id, or 0.

func (*Character) TimeToNextEnergyTick

func (eb *Character) TimeToNextEnergyTick(sim *Simulation) time.Duration

func (*Character) TimeToTargetEnergy

func (eb *Character) TimeToTargetEnergy(sim *Simulation, targetEnergy float64) time.Duration

func (*Character) UpdateAttackTableWeapons

func (character *Character) UpdateAttackTableWeapons()

Rebuilds the hand entries of the attack tables against every enemy, which read the weapons and their weapon skill.

func (*Character) UpdateMajorCooldowns

func (mcdm *Character) UpdateMajorCooldowns()

Re-sorts the cooldowns and caches the earliest time autocast can use one. Autocast calls it after each use, and anything else that changes a major cooldown's ready time must call it too.

func (*Character) UpdateMaxEnergy

func (eb *Character) UpdateMaxEnergy(sim *Simulation, bonusEnergy float64, metrics *ResourceMetrics)

Used for dynamic updates to maximum Energy, such as from the Druid Primal Madness talent

func (*Character) UpdateMaxHealth

func (hb *Character) UpdateMaxHealth(sim *Simulation, bonusHealth float64, metrics *ResourceMetrics)

Used for dynamic updates to maximum health from "Last Stand" effects

func (*Character) WeaponFromMainHand

func (character *Character) WeaponFromMainHand() Weapon

Returns weapon stats using the main hand equipped weapon.

func (*Character) WeaponFromOffHand

func (character *Character) WeaponFromOffHand() Weapon

Returns weapon stats using the off-hand equipped weapon.

func (*Character) WeaponFromRanged

func (character *Character) WeaponFromRanged() Weapon

Returns weapon stats using the ranged equipped weapon.

func (*Character) WithSource

func (character *Character) WithSource(source ActionSource, register func())

Registers the auras and spells in register with this source, unless they set their own.

type CharacterBuildPhase

type CharacterBuildPhase uint8
const (
	CharacterBuildPhaseNone CharacterBuildPhase = 0
	CharacterBuildPhaseBase CharacterBuildPhase = 1 << iota
	CharacterBuildPhaseGear
	CharacterBuildPhaseTalents
	CharacterBuildPhaseBuffs
	CharacterBuildPhaseConsumes
)

func (CharacterBuildPhase) Matches

func (cbp CharacterBuildPhase) Matches(other CharacterBuildPhase) bool

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

	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 it's easy to clear.

type CharacterSuiteConfig

type CharacterSuiteConfig struct {
	Class proto.Class

	Race               proto.Race
	Profession1        proto.Profession
	Profession2        proto.Profession
	GearSet            GearSetCombo
	SpecOptions        SpecOptionsCombo
	Talents            string
	Rotation           RotationCombo
	Encounter          EncounterCombo
	ItemSwapSet        ItemSwapSetCombo
	StartingDistance   float64
	ReactionTimeMs     int32
	ChannelClipDelayMs int32

	Consumables     *proto.ConsumesSpec
	IndividualBuffs *proto.IndividualBuffs
	PartyBuffs      *proto.PartyBuffs
	RaidBuffs       *proto.RaidBuffs
	Debuffs         *proto.Debuffs
	Cooldowns       *proto.Cooldowns

	TargetDummies int32
	Tanks         []*proto.UnitReference
	HealingModel  *proto.HealingModel

	IsHealer        bool
	IsTank          bool
	InFrontOfTarget bool

	OtherRaces             []proto.Race
	OtherGearSets          []GearSetCombo
	OtherTalentSets        []TalentsCombo
	OtherSpecOptions       []SpecOptionsCombo
	OtherRotations         []RotationCombo
	OtherItemSwapSets      []ItemSwapSetCombo
	OtherStartingDistances []float64

	ItemFilter ItemFilter

	StatsToWeigh       []proto.Stat
	PseudoStatsToWeigh []proto.PseudoStat
	EPReferenceStat    proto.Stat
}

func GetTestBuildFromJSON

func GetTestBuildFromJSON(class proto.Class, dir string, file string, itemFilter ItemFilter, epReferenceStat *proto.Stat, statsToWeigh *[]proto.Stat) CharacterSuiteConfig

type ClassFlags

type ClassFlags struct {
	Family int32
	Mask   [4]uint32
}

ClassFlags is the game files' SpellClassOptions: the family (SpellClassSet) and the four 32-bit words of SpellClassMask. A talent effect carries the same shape (EffectSpellClassMask) naming the spells it modifies.

func (ClassFlags) IsZero

func (f ClassFlags) IsZero() bool

Whether the spell carries no class options at all. The game files leave both the family and every mask word at zero on the spells no talent addresses by family.

func (ClassFlags) Matches

func (f ClassFlags) Matches(o ClassFlags) bool

Whether the two sets name at least one spell in common. Families are separate namespaces, so the same bit means a different spell in each and a cross-family overlap is never a match.

func (ClassFlags) Reaches

func (f ClassFlags) Reaches(spell *Spell) bool

Whether a modifier or trigger restricted to these class flags reaches the spell: zero flags mean every spell.

type CombinedTestGenerator

type CombinedTestGenerator struct {
	// contains filtered or unexported fields
}

func (*CombinedTestGenerator) GetTest

func (*CombinedTestGenerator) NumTests

func (generator *CombinedTestGenerator) NumTests() int

type Consumable

type Consumable struct {
	Id                 int32
	Type               proto.ConsumableType
	Stats              stats.Stats
	BuffsMainStat      bool
	Name               string
	ItemEffects        []*proto.ItemEffect
	RequiredProfession proto.Profession
	ReqProfRank        int32
	// The category the first on-use shares: the item row's, or where it states none, its spell's.
	CategoryId int32
	// The enchant a temporary enchant puts on a weapon, nil on consumables that enchant nothing, and
	// the weapon subclasses and inventory types it takes, where a zero mask takes any.
	TemporaryEnchant        *Enchant
	WeaponSubclassMask      int32
	WeaponInventoryTypeMask int32
	// The exclusive group, of which only the first consumable the spec names applies; empty on
	// consumables that stack with everything.
	GroupKey          string
	CountsWithElixirs bool // Stats that count with the elixirs', though the game files do not type it as one (R-0054).
}

func ConsumableFromProto

func ConsumableFromProto(consumable *proto.Consumable) Consumable

func GetConsumableByID

func GetConsumableByID(id int32) Consumable

func (Consumable) OnUse

func (consumable Consumable) OnUse() *proto.ItemEffect

The first on-use row, the one a consumable's builder runs.

func (Consumable) OnUseEffects

func (consumable Consumable) OnUseEffects() []*proto.ItemEffect

The item's on-use rows.

func (Consumable) TakesItem

func (consumable Consumable) TakesItem(slot proto.ItemSlot, item Item) bool

Whether the temporary enchant's SpellEquippedItems masks take the item in this slot.

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) Reduce

func (cd *Cooldown) Reduce(t time.Duration)

func (*Cooldown) Use

func (cd *Cooldown) Use(sim *Simulation)

Puts this CD on cooldown, using the default duration.

type CooldownActivation

type CooldownActivation func(*Simulation, *Character)

Function for activating a cooldown. Returns whether the activation was successful.

type CooldownActivationCondition

type CooldownActivationCondition func(*Simulation, *Character) bool

Condition for whether a cooldown can/should be activated. Returning false prevents the cooldown from being activated.

type CooldownType

type CooldownType byte
const (
	CooldownTypeUnknown CooldownType = 0
	CooldownTypeMana    CooldownType = 1 << iota
	CooldownTypeDPS
	CooldownTypeExplosive
	CooldownTypeSurvival
	CooldownTypeHealing
)

func CooldownTypeOf

func CooldownTypeOf(buffed []stats.Stat) CooldownType

A buff to any defensive stat or resistance, or to Stamina alone, is a survival cooldown, one to mana regen or spirit alone a mana cooldown, one to healing power alone a healing cooldown, and any other a DPS cooldown.

func (CooldownType) Matches

func (ct CooldownType) Matches(other CooldownType) bool

type CreatureStats added in v1.0.10

type CreatureStats struct {
	Health, Armor, AutoAttackDps float64
}

ExpectedStat's creature values by level

type CustomStatBuffProcCondition

type CustomStatBuffProcCondition func(sim *Simulation, aura *Aura) bool

type DamageAbsorptionAura

type DamageAbsorptionAura struct {
	*Aura

	ShieldStrength   float64
	OnDamageAbsorbed []OnDamageAbsorbedCallback
	// contains filtered or unexported fields
}

func (*DamageAbsorptionAura) Activate

func (aura *DamageAbsorptionAura) Activate(sim *Simulation)

func (*DamageAbsorptionAura) AttachOnDamageAbsorbed

func (aura *DamageAbsorptionAura) AttachOnDamageAbsorbed(callback OnDamageAbsorbedCallback) *DamageAbsorptionAura

type DamageAbsorptionAuraArray

type DamageAbsorptionAuraArray []*DamageAbsorptionAura

func (DamageAbsorptionAuraArray) FindLabel

func (auras DamageAbsorptionAuraArray) FindLabel() string

func (DamageAbsorptionAuraArray) Get

func (DamageAbsorptionAuraArray) IsEmpty

func (auras DamageAbsorptionAuraArray) IsEmpty() bool

type DefaultAPLValueImpl

type DefaultAPLValueImpl struct {
	Uuid *proto.UUID
}

Provides empty implementations for the GetX() value interface functions.

func (DefaultAPLValueImpl) Finalize

func (impl DefaultAPLValueImpl) Finalize(*APLRotation)

func (DefaultAPLValueImpl) GetBool

func (impl DefaultAPLValueImpl) GetBool(sim *Simulation) bool

func (DefaultAPLValueImpl) GetDuration

func (impl DefaultAPLValueImpl) GetDuration(sim *Simulation) time.Duration

func (DefaultAPLValueImpl) GetFloat

func (impl DefaultAPLValueImpl) GetFloat(sim *Simulation) float64

func (DefaultAPLValueImpl) GetInnerValues

func (impl DefaultAPLValueImpl) GetInnerValues() []APLValue

func (DefaultAPLValueImpl) GetInt

func (impl DefaultAPLValueImpl) GetInt(sim *Simulation) int32

func (DefaultAPLValueImpl) GetString

func (impl DefaultAPLValueImpl) GetString(sim *Simulation) string

type DefenseType

type DefenseType byte

Which hit table a spell rolls on and which crit multiplier it takes. Values match the DefenseType column of the game files' SpellCategories table, so a spell's value is looked up there rather than inferred from its school: Thunder Clap is Physical but rolls as Magic, Seal of Command procs are Holy but roll as Melee.

const (
	DefenseTypeNone DefenseType = iota
	DefenseTypeMagic
	DefenseTypeMelee
	DefenseTypeRanged

	DefenseTypeLen
)

func (DefenseType) String

func (i DefenseType) String() string

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() *proto.DistributionMetrics

type Dot

type Dot struct {
	Spell *Spell

	*Aura // Embed Aura, so we can use IsActive/Refresh/etc directly.

	BaseTickLength time.Duration // time between each tick

	SnapshotBaseDamage         float64
	SnapshotAttackerMultiplier float64

	BaseTickCount int32 // base tick count without haste applied

	BaseDurationMultiplier float64       // Some effects extend the BaseDuration - i.E. 50% - the DoTs will be subject to normal DoT fitting for base duration extend
	BaseDurationFlat       time.Duration // Added to the BaseDuration; the DoT fits it into whole extra ticks

	BonusCoefficient float64 // EffectBonusCoefficient in the game files' SpellEffect table, "SP mod" on Wowhead (not necessarily shown there even if > 0)

	PeriodicDamageMultiplier float64 // Multiplier for periodic damage on top of the spell's damage multiplier
	// contains filtered or unexported fields
}

func (*Dot) AddTick

func (dot *Dot) AddTick()

Adds a tick to the current active dot and extends it's duration

func (*Dot) Apply

func (dot *Dot) Apply(sim *Simulation)

Snapshots and activates the Dot

func (*Dot) BaseDuration

func (dot *Dot) BaseDuration() time.Duration

func (*Dot) CalcAndDealPeriodicSnapshotDamage

func (dot *Dot) CalcAndDealPeriodicSnapshotDamage(sim *Simulation, target *Unit, outcomeApplier OutcomeApplier) *SpellResult

func (*Dot) CalcAndDealPeriodicSnapshotHealing

func (dot *Dot) CalcAndDealPeriodicSnapshotHealing(sim *Simulation, target *Unit, outcomeApplier OutcomeApplier) *SpellResult

func (*Dot) CalcSnapshotDamage

func (dot *Dot) CalcSnapshotDamage(sim *Simulation, target *Unit, outcomeApplier OutcomeApplier) *SpellResult

func (*Dot) CalcSnapshotHealing

func (dot *Dot) CalcSnapshotHealing(sim *Simulation, target *Unit, outcomeApplier OutcomeApplier) *SpellResult

func (*Dot) CalcTickPeriod

func (dot *Dot) CalcTickPeriod() time.Duration

Calculates the current tick period the dot would have based on the affects currently present

func (*Dot) CasterPeriodicHealingMultiplier

func (dot *Dot) CasterPeriodicHealingMultiplier() float64

func (*Dot) ChannelCanBeInterrupted

func (dot *Dot) ChannelCanBeInterrupted(sim *Simulation) bool

func (*Dot) CopyDotAndApply

func (dot *Dot) CopyDotAndApply(sim *Simulation, originaldot *Dot)

Copy's the original DoT's period and duration to the current DoT. This is only currently used for Mage's Impact DoT spreading and Enhancement's ImprovedLava Lash.

func (*Dot) DurationExtend

func (dot *Dot) DurationExtend(sim *Simulation, extendBy time.Duration)

This is the incredibly cursed way of extending DoT durations (for Moonfire / Sunfire / SWP (T15 2P) / VT (T15 2P)) Don't use unless you know what you're doing It extends the duration, immediately recalculates the next tick and then fits as many ticks into the rest of the aura duration as it can. This will cause aura duration and dot ticks to desync ingame, so the aura will fall off prematurely to what is shown.

Sometimes the game also decides to tick one last time anyway, even though the time since the last tick is absurdly low, though this isn't implemented until someone figures out the conditions.

func (*Dot) DurationExtendSnapshot

func (dot *Dot) DurationExtendSnapshot(sim *Simulation, extendBy time.Duration)

func (*Dot) ExpectedTickCount

func (dot *Dot) ExpectedTickCount() int32

func (*Dot) HastedTickCount

func (dot *Dot) HastedTickCount() int32

Returns the total amount of ticks with the snapshotted haste

func (*Dot) NextTickAt

func (dot *Dot) NextTickAt() time.Duration

func (*Dot) OutcomeTick

func (dot *Dot) OutcomeTick(sim *Simulation, result *SpellResult, _ *AttackTable)

func (*Dot) OutcomeTickMagicHit

func (dot *Dot) OutcomeTickMagicHit(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Dot) OutstandingDmg

func (dot *Dot) OutstandingDmg() float64

func (*Dot) RemainingTicks

func (dot *Dot) RemainingTicks() int32

func (*Dot) RestoreState

func (dot *Dot) RestoreState(state DotState, sim *Simulation)

func (*Dot) SaveState

func (dot *Dot) SaveState(sim *Simulation) DotState

func (*Dot) Snapshot

func (dot *Dot) Snapshot(target *Unit, baseDamage float64)

func (*Dot) SnapshotHeal

func (dot *Dot) SnapshotHeal(target *Unit, baseHealing float64)

func (*Dot) SnapshotPhysical

func (dot *Dot) SnapshotPhysical(target *Unit, baseDamage float64)

func (*Dot) TakeSnapshot

func (dot *Dot) TakeSnapshot(sim *Simulation)

Takes a new snapshot of this Dot's effects.

In most cases this will be called automatically, and should only be called to force a new snapshot to be taken.

doRollover will apply previously snapshotted crit/%dmg instead of recalculating.

func (*Dot) TickCount

func (dot *Dot) TickCount() int32

The ticks done since the dot was applied. A tick length or duration mod that changes while the dot runs, an extension or an added tick does not move it.

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.

func (*Dot) TickPeriod

func (dot *Dot) TickPeriod() time.Duration

TickPeriod is how fast the snapshotted dot ticks.

func (*Dot) TimeUntilNextTick

func (dot *Dot) TimeUntilNextTick(sim *Simulation) time.Duration

type DotArray

type DotArray []*Dot

func (DotArray) Get

func (dots DotArray) Get(target *Unit) *Dot

type DotConfig

type DotConfig struct {
	// Optional, will default to the corresponding spell.
	Spell *Spell

	OnSnapshot OnSnapshot
	OnTick     OnTick

	Aura Aura

	TickLength    time.Duration // time between each tick
	NumberOfTicks int32         // number of ticks over the whole duration

	IsAOE                bool // Set to true for AOE dots (Blizzard, Hurricane, Consecrate, etc)
	SelfOnly             bool // Set to true to only create the self-hot.
	AffectedByCastSpeed  bool // tick length are shortened based on casting speed
	AffectedByRealHaste  bool // tick length are shortened based on real haste (melee/ranged but not spell)
	HasteReducesDuration bool // does not gain additional ticks after a certain haste threshold

	BonusCoefficient float64 // EffectBonusCoefficient in the game files' SpellEffect table, "SP mod" on Wowhead (not necessarily shown there even if > 0)

	PeriodicDamageMultiplier float64 // Multiplier for periodic damage on top of the spell's damage multiplier

	RankGroup string // Ranks of one periodic share it: a caster keeps one of them on a unit, channels excepted.
	Rank      int32  // With RankGroup: this rank's place in it, the higher number winning. A ground effect (IsAOE) of any rank replaces the one down.
}

func WandChannel

func WandChannel() DotConfig

Shoot's channel. The wand sets its length to the rest of the fight when Shoot starts; ChanneledTicks(Shoot) reads 0, since the shots are not its ticks. NumberOfTicks stays 1: the rotation and the dot end a channel with no ticks left.

type DotReference

type DotReference struct {
	// contains filtered or unexported fields
}

func (*DotReference) Get

func (ar *DotReference) Get() *Dot

func (*DotReference) String

func (ar *DotReference) String() string

type DotState

type DotState struct {
	AuraState

	SnapshotBaseDamage         float64
	SnapshotAttackerMultiplier float64
	TicksRemaining             int32
	TicksDone                  int32
	TickPeriod                 time.Duration
	NextTickIn                 time.Duration
}

type DynamicCritChanceByCaster

type DynamicCritChanceByCaster func(spell *Spell) float64

The crit chance, in percentage points, a target-side aura adds to one of its caster's spells.

type DynamicDamageDoneByCaster

type DynamicDamageDoneByCaster func(sim *Simulation, spell *Spell, attackTable *AttackTable) float64

type DynamicDamageTakenModifier

type DynamicDamageTakenModifier func(sim *Simulation, spell *Spell, result *SpellResult, isPeriodic bool)

type DynamicHealingTakenModifier

type DynamicHealingTakenModifier func(sim *Simulation, spell *Spell, result *SpellResult)

type DynamicProc

type DynamicProc interface {
	Reset()
	Chance(sim *Simulation) float64
	Proc(sim *Simulation, label string) bool
}

type DynamicProcManager

type DynamicProcManager struct {
	// contains filtered or unexported fields
}

func (*DynamicProcManager) Chance

func (dpm *DynamicProcManager) Chance(procMask ProcMask, sim *Simulation) float64

func (*DynamicProcManager) Proc

func (dpm *DynamicProcManager) Proc(sim *Simulation, procMask ProcMask, label string) bool

Returns whether the effect procced.

func (*DynamicProcManager) Reset

func (dpm *DynamicProcManager) Reset()

type DynamicThreatDoneByCaster

type DynamicThreatDoneByCaster DynamicDamageDoneByCaster

type EligibleWeaponType

type EligibleWeaponType struct {
	CanUseTwoHand bool
}

EligibleWeaponType describes whether a weapon type can be used as a two-hand weapon.

type Enchant

type Enchant struct {
	EffectID       int32 // Used by UI to apply effect to tooltip
	Stats          stats.Stats
	PseudoStats    []float64 // Indexed by proto.PseudoStat; percents through stats.FromPseudoStatsProto, haste through registerEquipSpeedAuras
	WeaponDamage   float64   // Applied by newWeaponFromItem
	EnchantEffects []*proto.ItemEffect
	Name           string         // Only needed for unit tests
	Type           proto.ItemType // Only needed for unit tests
	EnchantType    proto.EnchantType
	ExtraTypes     []proto.ItemType
	ProcKind       proto.EnchantProcKind
}

func EnchantFromProto

func EnchantFromProto(pData *proto.SimEnchant) Enchant

func FittingEnchantRow

func FittingEnchantRow(effectID int32, item Item) (Enchant, bool)

The first row under effectID that fits item, for the stats an enchant gives that item.

func GetEnchantByEffectID

func GetEnchantByEffectID(effectID int32) *Enchant

func GetEnchantRowsByEffectID

func GetEnchantRowsByEffectID(effectID int32) []Enchant

Every row under effectID, as AddToDatabase stores them.

func (Enchant) IsStatic

func (enchant Enchant) IsStatic() bool

A static enchant gives only stats, pseudo-stats or weapon damage and has no temporary effect.

type Encounter

type Encounter struct {
	Duration          time.Duration
	DurationVariation time.Duration
	AllTargets        []*Target
	ActiveTargets     []*Target
	AllTargetUnits    []*Unit
	ActiveTargetUnits []*Unit

	ExecuteProportion_20 float64
	ExecuteProportion_35 float64

	// Every kind of area the fight is in, deduplicated.
	AreaTypes []proto.AreaType
	// contains filtered or unexported fields
}

func NewEncounter

func NewEncounter(options *proto.Encounter) Encounter

func (*Encounter) AOECapMultiplier

func (encounter *Encounter) AOECapMultiplier() float64

func (*Encounter) GetMetricsProto

func (encounter *Encounter) GetMetricsProto() *proto.EncounterMetrics

func (*Encounter) InArea

func (encounter *Encounter) InArea(areaType proto.AreaType) bool

func (*Encounter) NumActiveAdds

func (encounter *Encounter) NumActiveAdds() int

The active targets other than the boss, target 0.

func (*Encounter) ScheduleAddRaidDebuffs

func (encounter *Encounter) ScheduleAddRaidDebuffs(sim *Simulation, target *Target, apply bool, delay, jitter time.Duration)

Schedules the raid's debuffs on an add entering the fight now, delay ± jitter later, or disables them when apply is off. An AI that spawns an add calls it at each spawn with its own settings.

type EncounterCombo

type EncounterCombo struct {
	Label     string
	Encounter *proto.Encounter
}

func MakeDefaultEncounterCombos

func MakeDefaultEncounterCombos() []EncounterCombo

type EnergyBarOptions

type EnergyBarOptions struct {
	MaxComboPoints int32
	MaxEnergy      float64
	UnitClass      proto.Class
	HasNoRegen     bool
}

type EnergyCost

type EnergyCost struct {
	Refund            float64
	RefundMetrics     *ResourceMetrics
	ResourceMetrics   *ResourceMetrics
	ComboPointMetrics *ResourceMetrics
}

func (*EnergyCost) CostFailureReason

func (ec *EnergyCost) CostFailureReason(_ *Simulation, spell *Spell) string

func (*EnergyCost) IssueRefund

func (ec *EnergyCost) IssueRefund(sim *Simulation, spell *Spell)

func (*EnergyCost) MeetsRequirement

func (ec *EnergyCost) MeetsRequirement(_ *Simulation, spell *Spell) bool

func (*EnergyCost) SpendCost

func (ec *EnergyCost) SpendCost(sim *Simulation, spell *Spell)

type EnergyCostOptions

type EnergyCostOptions struct {
	Cost int32

	Refund        float64
	RefundMetrics *ResourceMetrics // Optional, will default to unit.EnergyRefundMetrics if not supplied.
}

type Environment

type Environment struct {
	State EnvironmentState

	// Whether stats are currently being measured. Used to disable some validation
	// checks which are otherwise helpful.
	MeasuringStats bool

	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 NewEnvironment(raidProto *proto.Raid, encounterProto *proto.Encounter, runFakePrepull bool, skipRotation bool) (*Environment, *proto.RaidStats, *proto.EncounterStats)

func (*Environment) ActiveTargetCount

func (env *Environment) ActiveTargetCount() int32

func (*Environment) GetActiveTargetUnits

func (env *Environment) GetActiveTargetUnits() []*Unit

func (*Environment) GetAgentFromUnit

func (env *Environment) GetAgentFromUnit(unit *Unit) Agent

func (*Environment) GetMaxDuration

func (env *Environment) GetMaxDuration() time.Duration

The maximum possible duration for any iteration.

func (*Environment) GetTargetByIndex

func (env *Environment) GetTargetByIndex(index int32) *Target

func (*Environment) GetTargetUnitByIndex

func (env *Environment) GetTargetUnitByIndex(index int32) *Unit

func (*Environment) GetUnit

func (env *Environment) GetUnit(ref *proto.UnitReference, contextUnit *Unit) *Unit

func (*Environment) IsFinalized

func (env *Environment) IsFinalized() bool

func (*Environment) NextActiveTarget

func (env *Environment) NextActiveTarget(target *Unit) *Target

func (*Environment) NextActiveTargetUnit

func (env *Environment) NextActiveTargetUnit(target *Unit) *Unit

The next active target's unit, or target itself when no target is active, so a unit reference never comes back nil.

func (*Environment) PrepullStartTime

func (env *Environment) PrepullStartTime() time.Duration

func (*Environment) PreviousActiveTarget

func (env *Environment) PreviousActiveTarget(target *Unit) *Target

func (*Environment) PreviousActiveTargetUnit

func (env *Environment) PreviousActiveTargetUnit(target *Unit) *Unit

The previous active target's unit, or target itself when no target is active, so a unit reference never comes back nil.

func (*Environment) RegisterPostFinalizeEffect

func (env *Environment) RegisterPostFinalizeEffect(postFinalizeEffect PostFinalizeEffect)

Registers a callback to this Character which will be invoked AFTER all Units are finalized.

func (*Environment) RegisterPreFinalizeEffect

func (env *Environment) RegisterPreFinalizeEffect(preFinalizeEffect PostFinalizeEffect)

Registers a callback to this Character which will be invoked BEFORE all Units are finalized, but after they are all initialized and have other effects applied.

func (*Environment) TotalTargetCount

func (env *Environment) TotalTargetCount() int32

func (*Environment) TriggerDelayedPetInheritance

func (env *Environment) TriggerDelayedPetInheritance(sim *Simulation, dynamicPets []*Pet, inheritanceFunc func(*Simulation, *Pet))

type EnvironmentState

type EnvironmentState int
const (
	Created EnvironmentState = iota
	Constructed
	Initialized
	Finalized
)

type EquipGate

type EquipGate struct {
	// contains filtered or unexported fields
}

A level that holds only while a weapon meeting the requirement is equipped: set hears the level while one is and 0 while none is, again on every weapon change.

func (*EquipGate) Equipped

func (gate *EquipGate) Equipped() bool

func (*EquipGate) SetLevel

func (gate *EquipGate) SetLevel(sim *Simulation, level float64)

type EquipGatedStats

type EquipGatedStats struct {
	// contains filtered or unexported fields
}

Stats the character holds while a weapon meeting the requirement is equipped, each counted at its own level. They follow the weapon slots through item swaps.

func (*EquipGatedStats) SetLevel

func (gated *EquipGatedStats) SetLevel(sim *Simulation, level float64)

Counts every stat level times over: 0 is off and 1 the plain amount. A nil Simulation adds them to the character as it is built.

func (*EquipGatedStats) SetStatLevel

func (gated *EquipGatedStats) SetStatLevel(sim *Simulation, stat stats.Stat, level float64)

Counts one stat level times over, the way SetLevel counts them all.

type EquipRequirement

type EquipRequirement struct {
	SubclassMask int32
	InvTypeMask  int32
	Hand         ProcMask
}

The game files' SpellEquippedItems for a weapon: the weapon subclass and inventory-type masks, and the hand an ATTR_EX_3 hand bit names. A zero field is no restriction.

func (EquipRequirement) Equipped

func (req EquipRequirement) Equipped(character *Character) bool

Whether a weapon meeting the requirement sits in the main-hand, off-hand or ranged slot. A hand bit narrows the slots to that hand's. A unit that is not a player never meets it.

func (EquipRequirement) IsZero

func (req EquipRequirement) IsZero() bool

type EquipScalingManager

type EquipScalingManager struct {
	// contains filtered or unexported fields
}

type Equipment

type Equipment [NumItemSlots]Item

func NewEquipmentSet

func NewEquipmentSet(equipSpec EquipmentSpec) Equipment

func ProtoToEquipment

func ProtoToEquipment(es *proto.EquipmentSpec) Equipment

func (*Equipment) Back

func (equipment *Equipment) Back() *Item

func (*Equipment) Chest

func (equipment *Equipment) Chest() *Item

func (*Equipment) EquipEnchant

func (equipment *Equipment) EquipEnchant(enchant Enchant)

func (*Equipment) EquipItem

func (equipment *Equipment) EquipItem(item Item)

func (*Equipment) Feet

func (equipment *Equipment) Feet() *Item

func (*Equipment) Finger1

func (equipment *Equipment) Finger1() *Item

func (*Equipment) Finger2

func (equipment *Equipment) Finger2() *Item

func (*Equipment) GetItemBySlot

func (equipment *Equipment) GetItemBySlot(slot proto.ItemSlot) *Item

func (*Equipment) Hands

func (equipment *Equipment) Hands() *Item

func (*Equipment) Head

func (equipment *Equipment) Head() *Item

func (*Equipment) Legs

func (equipment *Equipment) Legs() *Item

func (*Equipment) MainHand

func (equipment *Equipment) MainHand() *Item

func (*Equipment) Neck

func (equipment *Equipment) Neck() *Item

func (*Equipment) OffHand

func (equipment *Equipment) OffHand() *Item

func (*Equipment) Ranged

func (equipment *Equipment) Ranged() *Item

func (*Equipment) Shoulder

func (equipment *Equipment) Shoulder() *Item

func (*Equipment) Stats

func (equipment *Equipment) Stats(spec proto.Spec) stats.Stats

func (*Equipment) ToEquipmentSpecProto

func (equipment *Equipment) ToEquipmentSpecProto() *proto.EquipmentSpec

func (*Equipment) Trinket1

func (equipment *Equipment) Trinket1() *Item

func (*Equipment) Trinket2

func (equipment *Equipment) Trinket2() *Item

func (*Equipment) Waist

func (equipment *Equipment) Waist() *Item

func (*Equipment) Wrist

func (equipment *Equipment) Wrist() *Item

type EquipmentSpec

type EquipmentSpec [NumItemSlots]ItemSpec

Structs used for looking up items/enchants

func ProtoToEquipmentSpec

func ProtoToEquipmentSpec(es *proto.EquipmentSpec) EquipmentSpec

type EurekaMods

type EurekaMods struct {
	CostFlags, DamageFlags, ChannelFlags ClassFlags
	Cost, Damage, Channel                float64
	Duration, Cooldown                   time.Duration
}

One class's Eureka! row: the class mask and the fraction of its idx0 SPELLMOD_COST, idx1 SPELLMOD_DAMAGE and idx2 SPELLMOD_DOT, zero where the row states no SPELLMOD_DOT, and the row's duration and cooldown.

type ExclusiveCategory

type ExclusiveCategory struct {
	Name       string
	SingleAura bool // If true, only 1 aura in this category may be active at a time.
	// contains filtered or unexported fields
}

func (*ExclusiveCategory) AnyActive

func (ec *ExclusiveCategory) AnyActive() bool

func (*ExclusiveCategory) GetActiveAura

func (ec *ExclusiveCategory) GetActiveAura() *Aura

func (*ExclusiveCategory) GetActiveEffect

func (ec *ExclusiveCategory) GetActiveEffect() *ExclusiveEffect

func (*ExclusiveCategory) GetHighestPrioActiveEffect

func (ec *ExclusiveCategory) GetHighestPrioActiveEffect() *ExclusiveEffect

func (*ExclusiveCategory) SetActive

func (ec *ExclusiveCategory) SetActive(sim *Simulation, newActiveEffect *ExclusiveEffect)

type ExclusiveCategoryArray

type ExclusiveCategoryArray []*ExclusiveCategory

func (ExclusiveCategoryArray) Get

func (categories ExclusiveCategoryArray) Get(target *Unit) *ExclusiveCategory

type ExclusiveEffect

type ExclusiveEffect struct {
	Aura       *Aura
	Priority   float64
	YieldsTies bool // The effect takes the category from an active effect only by outbidding it, never on an equal bid.

	OnGain   func(*ExclusiveEffect, *Simulation)
	OnExpire func(*ExclusiveEffect, *Simulation)

	Category *ExclusiveCategory
	// contains filtered or unexported fields
}

An Exclusive effect is one which may not be active at the same time as other effects in the same category. For example, the armor reduction effects from Sunder Armor and Expose Armor are exclusive with each other.

Within each ExclusiveCategory, the ExclusiveEffect with the highest Priority AND isEnabled == true is the one whose effect is applied.

func (*ExclusiveEffect) Activate

func (ee *ExclusiveEffect) Activate(sim *Simulation) bool

Returns whether the effect is active.

func (*ExclusiveEffect) Deactivate

func (ee *ExclusiveEffect) Deactivate(sim *Simulation)

func (*ExclusiveEffect) IsActive

func (ee *ExclusiveEffect) IsActive() bool

func (*ExclusiveEffect) SetPriority

func (ee *ExclusiveEffect) SetPriority(sim *Simulation, newPrio float64)

type ExclusiveEffectManager

type ExclusiveEffectManager struct {
	// contains filtered or unexported fields
}

func (*ExclusiveEffectManager) GetExclusiveEffectCategory

func (eem *ExclusiveEffectManager) GetExclusiveEffectCategory(categoryName string) *ExclusiveCategory

Returns a category with the given name. Creates a new category if one doesn't already exist.

type ExpectedDamageCalculator

type ExpectedDamageCalculator func(sim *Simulation, target *Unit, spell *Spell, useSnapshot bool) *SpellResult

type FocusCost

type FocusCost struct {
	Refund          float64
	RefundMetrics   *ResourceMetrics
	ResourceMetrics *ResourceMetrics
}

func (*FocusCost) CostFailureReason

func (ec *FocusCost) CostFailureReason(_ *Simulation, spell *Spell) string

func (*FocusCost) IssueRefund

func (ec *FocusCost) IssueRefund(sim *Simulation, spell *Spell)

func (*FocusCost) MeetsRequirement

func (ec *FocusCost) MeetsRequirement(_ *Simulation, spell *Spell) bool

func (*FocusCost) SpendCost

func (ec *FocusCost) SpendCost(sim *Simulation, spell *Spell)

type FocusCostOptions

type FocusCostOptions struct {
	Cost int32

	Refund        float64
	RefundMetrics *ResourceMetrics // Optional, will default to unit.FocusRefundMetrics if not supplied.
}

type GearSetCombo

type GearSetCombo struct {
	Label   string
	GearSet *proto.EquipmentSpec
}

func GetGearSet

func GetGearSet(dir string, file string) GearSetCombo

type GetAttackPowerValue

type GetAttackPowerValue func(spell *Spell, target *Unit) float64

type GetSpellDamageValue

type GetSpellDamageValue func(spell *Spell, target *Unit) float64

type Hand

type Hand bool
const MainHand Hand = true
const OffHand Hand = false

type Hardcast

type Hardcast struct {
	Expires     time.Duration
	ActionID    ActionID
	Cost        float64 // The mana the cast pays when it completes.
	OnComplete  func(*Simulation, *Unit)
	Target      *Unit
	CanMove     bool
	IsChanneled bool
	Pushback    bool
	ResetsSwing bool // The melee swing waits out the cast, then starts a full swing when it completes.
	CastTime    time.Duration
	// contains filtered or unexported fields
}

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

	// The damage a partial resist took in 5% units (2 to 15), as a 4-bit number.
	OutcomePartial1
	OutcomePartial2
	OutcomePartial4
	OutcomePartial8
	// Marks the partial bits as bonus damage, which Spell Piercing beyond the target's resistance adds.
	OutcomePartialBonus
)

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

" (20% Resist)" for a partial resist, " (10% Pierced)" for a Spell Piercing bonus.

func (HitOutcome) ResistedPercent

func (ho HitOutcome) ResistedPercent() int

The percent of the damage a partial resist took, negative for bonus damage and 0 for none.

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) *proto.RaidSimResult

func (*IndividualTestSuite) TestStatWeights

func (testSuite *IndividualTestSuite) TestStatWeights(testName string, swr *proto.StatWeightsRequest)

type Item

type Item struct {
	ID        int32
	Type      proto.ItemType
	ArmorType proto.ArmorType
	// Weapon Stats
	WeaponType       proto.WeaponType
	HandType         proto.HandType
	RangedWeaponType proto.RangedWeaponType
	WeaponDamageMin  float64
	WeaponDamageMax  float64
	UnroundedDPS     float32
	SwingSpeed       float64
	QualityModifier  float64           // Per-item offset to weapon "average damage"; negative for caster weapons.
	SpellSchool      proto.SpellSchool // The weapon's damage school; unset means physical.

	Name          string
	Stats         stats.Stats // Stats applied to wearer
	PseudoStats   []float64   // Indexed by proto.PseudoStat; percents through stats.FromPseudoStatsProto, haste through registerEquipSpeedAuras
	Quality       proto.ItemQuality
	Unique        bool
	LimitCategory int32
	SetName       string // Empty string if not part of a set.
	SetID         int32  // 0 if not part of a set.

	ClassAllowlist []proto.Class

	// Modified for each instance of the item.
	RandomSuffix RandomSuffix
	Enchant      Enchant

	//Internal use
	TempEnchant             int32
	TempEnchantWeaponDamage float64
	WeaponImbue             int32        // The Effect 360 imbue (poison, firestone, class imbue), beside the Effect 54 TempEnchant.
	TempEnchantStats        *stats.Stats // The stats the TempEnchant and the WeaponImbue put on the item, counted with its enchant's.
	TempEnchantPseudoStats  []float64    // The TempEnchant's pseudo stats, whose haste registerEquipSpeedAuras applies.
	WeaponImbuePseudoStats  []float64    // The WeaponImbue's pseudo stats, whose haste registerEquipSpeedAuras applies.
	ScalingOptions          map[int32]*proto.ScalingItemProperties
	RandPropPoints          int32
	ItemEffects             []*proto.ItemEffect
}

func GetItemByID

func GetItemByID(id int32) *Item

func ItemFromProto

func ItemFromProto(pData *proto.SimItem) Item

func NewItem

func NewItem(itemSpec ItemSpec) Item

func (*Item) HasTempEnchant

func (item *Item) HasTempEnchant(effectID int32) bool

Matches either slot: the Effect 54 TempEnchant or the Effect 360 WeaponImbue.

func (*Item) ToItemSpecProto

func (item *Item) ToItemSpecProto() *proto.ItemSpec

func (*Item) UsableBy

func (item *Item) UsableBy(class proto.Class) bool

func (*Item) WeaponSubclassBit

func (item *Item) WeaponSubclassBit() int32

The item's bit in a spell's weapon subclass mask, or 0 for an item that is not a weapon.

type ItemEffectRandPropPoints

type ItemEffectRandPropPoints struct {
	Ilvl           int32
	RandPropPoints int32
}

func GetItemEffectRandPropPointsByIlvl

func GetItemEffectRandPropPointsByIlvl(ilvl int32) *ItemEffectRandPropPoints

func ItemEffectRandPropPointsFromProto

func ItemEffectRandPropPointsFromProto(ieRpp *proto.ItemEffectRandPropPoints) ItemEffectRandPropPoints

Converts a protobuf ItemEffectRandPropPoints to a Go ItemEffectRandPropPoints

type ItemFilter

type ItemFilter struct {
	// If set to ClassUnknown, any class is fine.
	Class proto.Class

	ArmorType proto.ArmorType

	// Empty lists allows any value. Otherwise, item must match a value from the list.
	WeaponTypes       []proto.WeaponType
	HandTypes         []proto.HandType
	RangedWeaponTypes []proto.RangedWeaponType

	// Item IDs to ignore.
	IDBlacklist []int32

	// Effect IDs to ignore.
	EnchantBlacklist []int32
}

Returns all items that meet the given conditions.

func (*ItemFilter) FindAllEnchants

func (filter *ItemFilter) FindAllEnchants() []Enchant

func (*ItemFilter) FindAllItems

func (filter *ItemFilter) FindAllItems() []Item

func (*ItemFilter) FindAllSets

func (filter *ItemFilter) FindAllSets() []*ItemSet

func (*ItemFilter) Matches

func (filter *ItemFilter) Matches(item Item, equipChecksOnly bool) bool

Returns whether the given item matches the conditions of this filter.

If equipChecksOnly is true, will only check conditions related to whether the item is equippable.

type ItemSet

type ItemSet struct {
	ID              int32
	Name            string
	AlternativeName string
	// 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]ApplySetBonus

	// Optional field to override the DefaultItemSetSlots
	// For Example: The set contains of 2 weapons
	Slots []proto.ItemSlot

	// If set, the character must have this profession for the set bonuses to activate.
	RequiredProfession proto.Profession
}

func ItemSets

func ItemSets() []*ItemSet

The registered sets; a set skipped for holding no items in the database is in MissingItemSets instead.

func NewItemSet

func NewItemSet(set ItemSet) *ItemSet

Registers a new ItemSet with item IDs populated.

func (ItemSet) Items

func (set ItemSet) Items() []Item

type ItemSpec

type ItemSpec struct {
	ID           int32
	RandomSuffix int32
	Enchant      int32
}

type ItemStringSpec

type ItemStringSpec struct {
	Name    string
	Enchant string
}

Like ItemSpec, but uses names for reference instead of ID.

type ItemSwap

type ItemSwap struct {
	// contains filtered or unexported fields
}

func (*ItemSwap) AddWeaponImbue

func (swap *ItemSwap) AddWeaponImbue(enchantID int32, slot proto.ItemSlot, swapped bool)

Used by shaman imbues because itemswap is setup before Imbue spells registers

func (*ItemSwap) CouldHaveItemEquippedInSlot

func (swap *ItemSwap) CouldHaveItemEquippedInSlot(itemID int32, slot proto.ItemSlot) bool

func (*ItemSwap) EligibleSlotsForEffect

func (swap *ItemSwap) EligibleSlotsForEffect(effectID int32) []proto.ItemSlot

func (*ItemSwap) EligibleSlotsForItem

func (swap *ItemSwap) EligibleSlotsForItem(itemID int32) []proto.ItemSlot

func (*ItemSwap) GetEquippedItemBySlot

func (swap *ItemSwap) GetEquippedItemBySlot(slot proto.ItemSlot) *Item

func (*ItemSwap) GetUnequippedItemBySlot

func (swap *ItemSwap) GetUnequippedItemBySlot(slot proto.ItemSlot) *Item

func (*ItemSwap) IsEnabled

func (swap *ItemSwap) IsEnabled() bool

func (*ItemSwap) IsSwapped

func (swap *ItemSwap) IsSwapped() bool

func (*ItemSwap) IsValidSwap

func (swap *ItemSwap) IsValidSwap(swapSet proto.APLActionItemSwap_SwapSet) bool

func (*ItemSwap) ProcessTinker

func (swap *ItemSwap) ProcessTinker(spell *Spell, slots []proto.ItemSlot)

Helper for handling Enchant On Use effects to set a 30s cd on the related spell.

func (*ItemSwap) RegisterActive

func (swap *ItemSwap) RegisterActive(itemID int32)

Helper for handling Item On Use effects to set a 30s cd on the related spell.

func (*ItemSwap) RegisterEnchantBuffWithSlots

func (swap *ItemSwap) RegisterEnchantBuffWithSlots(buffAura *Aura, enchantID int32, slots []proto.ItemSlot)

Helper for handling enchant buffs that fall off when none of the slots carries the enchant.

func (*ItemSwap) RegisterEnchantProc

func (swap *ItemSwap) RegisterEnchantProc(effectID int32, aura *Aura)

Helper for handling Enchant Effects that use the effectID to toggle the aura on and off

func (*ItemSwap) RegisterEnchantProcWithSlots

func (swap *ItemSwap) RegisterEnchantProcWithSlots(effectID int32, aura *Aura, slots []proto.ItemSlot)

func (*ItemSwap) RegisterProc

func (swap *ItemSwap) RegisterProc(itemID int32, aura *Aura)

Helper for handling Item Effects that use the itemID to toggle the aura on and off This will also get the eligible slots for the item

func (*ItemSwap) RegisterProcWithSlots

func (swap *ItemSwap) RegisterProcWithSlots(itemID int32, aura *Aura, slots []proto.ItemSlot)

Helper for handling Item Effects that use the itemID to toggle the aura on and off

func (*ItemSwap) RegisterWeaponEnchantBuff

func (swap *ItemSwap) RegisterWeaponEnchantBuff(buffAura *Aura, enchantID int32)

Helper for handling weapon enchant buffs that fall off when the weapon is swapped out.

func (*ItemSwap) SwapItems

func (swap *ItemSwap) SwapItems(sim *Simulation, swapSet proto.APLActionItemSwap_SwapSet, isReset bool)

type ItemSwapProcConfig

type ItemSwapProcConfig struct {
	ItemID    int32
	EnchantId int32
	Aura      *Aura
	Slots     []proto.ItemSlot
}

type ItemSwapSetCombo

type ItemSwapSetCombo struct {
	Label    string
	ItemSwap *proto.ItemSwap
}

func GetItemSwapGearSet

func GetItemSwapGearSet(dir string, file string) ItemSwapSetCombo

type ItemSwapStats

type ItemSwapStats struct {
	// contains filtered or unexported fields
}

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
	IsTank     bool

	// Some fields are populated automatically.
	ItemFilter ItemFilter
	// contains filtered or unexported fields
}

func (*ItemsTestGenerator) GetTest

func (*ItemsTestGenerator) NumTests

func (generator *ItemsTestGenerator) NumTests() int

type LabeledAuraArrays

type LabeledAuraArrays map[string]AuraArray

func (LabeledAuraArrays) AnyActive

func (auraArrays LabeledAuraArrays) AnyActive(target *Unit) bool

func (LabeledAuraArrays) Append

func (auraArrays LabeledAuraArrays) Append(auras AuraArray) LabeledAuraArrays

type MajorCooldown

type MajorCooldown struct {
	// Spell that is cast when this MCD is activated.
	Spell *Spell

	// Associated buff aura that is activated when the above spell is cast.
	BuffAura *StatBuffAura

	// Cooldowns with higher priority get used first. This is important when some
	// cooldowns have a non-zero cast time, which should go before an instant one.
	Priority int32

	// Internal category, used for filtering. For example, mages want to disable
	// all DPS cooldowns during their regen rotation.
	Type CooldownType

	// If False, the MCD will not be queued up before the GCD has fully expired.
	// This is desirable for auto-chaining multiple MCDs just before a GCD ability.
	AllowSpellQueueing bool

	// 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

	// Autocast Other Cooldowns uses it only at a timing set in the cooldown settings; otherwise only the APL casts it.
	DisableAutocast bool
	// contains filtered or unexported fields
}

func (*MajorCooldown) GetTimings

func (mcd *MajorCooldown) GetTimings() []time.Duration

func (*MajorCooldown) IsReady

func (mcd *MajorCooldown) IsReady(sim *Simulation) bool

func (*MajorCooldown) ReadyAt

func (mcd *MajorCooldown) ReadyAt() time.Duration

func (*MajorCooldown) TimeToNextCast

func (mcd *MajorCooldown) TimeToNextCast(sim *Simulation) time.Duration

Roughly how long until the next cast will happen, accounting for both spell CD and user-specified timings.

func (*MajorCooldown) TimeToReady

func (mcd *MajorCooldown) TimeToReady(sim *Simulation) time.Duration

func (*MajorCooldown) TryActivate

func (mcd *MajorCooldown) TryActivate(sim *Simulation, character *Character) bool

Uses this cooldown if its conditions pass, and returns whether it did.

type ManaCost

type ManaCost struct {
	ResourceMetrics *ResourceMetrics
}

func (*ManaCost) CostFailureReason

func (mc *ManaCost) CostFailureReason(sim *Simulation, spell *Spell) string

func (*ManaCost) IssueRefund

func (mc *ManaCost) IssueRefund(_ *Simulation, _ *Spell)

func (*ManaCost) MeetsRequirement

func (mc *ManaCost) MeetsRequirement(sim *Simulation, spell *Spell) bool

func (*ManaCost) SpendCost

func (mc *ManaCost) SpendCost(sim *Simulation, spell *Spell)

type ManaCostOptions

type ManaCostOptions struct {
	BaseCostPercent float64 // The cost of the spell as a percentage (0-100) of the unit's base mana, rounded to the nearest whole mana.
	FlatCost        int32   // Alternative to BaseCostPercent for giving a flat value.
	PercentModifier float64 // Will default to 1. PercentModifier stored as a float i.e. 40% reduction is (0.6 multiplier) to the base cost
}

type ManaRegenBoost added in v1.0.12

type ManaRegenBoost struct {
	SpiritMult   float64 // Its factor on PseudoStats.SpiritRegenMultiplier.
	Innervate    float64 // Its factor on the Innervate multiplier.
	CastingShare float64 // What it adds to PseudoStats.SpiritRegenRateCasting.
	// contains filtered or unexported fields
}

A buff that raises the mana regen for a while, such as Innervate or Evocation. The regen it adds goes to the buff's own metrics, so the regen rows show the unit's own regen and the buff's row shows what it added. The mana the unit gains is the same either way.

type MeleeCritCapModifier

type MeleeCritCapModifier interface {
	ModifyMeleeCritCap(info *proto.MeleeCritCapInfo)
}

An agent that moves the melee crit cap the character sheet shows. Suppression and the cap are worked out after the hook, the cap from the info fields, so a change to any of them reaches it.

type MeleeDamageCalculator

type MeleeDamageCalculator func(attackPower float64, bonusWeaponDamage float64) float64

type MovementAction

type MovementAction struct {
	PendingAction
	// contains filtered or unexported fields
}

func (*MovementAction) GetCurrentPosition

func (action *MovementAction) GetCurrentPosition(sim *Simulation) float64

type MovementCallback

type MovementCallback func(sim *Simulation, position float64, kind MovementUpdateType)

type MovementUpdateType

type MovementUpdateType byte

type OnApplyEffects

type OnApplyEffects func(aura *Aura, sim *Simulation, target *Unit, spell *Spell)

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 OnDamageAbsorbedCallback

type OnDamageAbsorbedCallback func(sim *Simulation, aura *DamageAbsorptionAura, result *SpellResult, absorbedDamage float64)

type OnDoneIteration

type OnDoneIteration func(aura *Aura, sim *Simulation)

type OnEncounterStart

type OnEncounterStart func(aura *Aura, sim *Simulation)

type OnExpire

type OnExpire func(aura *Aura, sim *Simulation)

type OnFocusGain

type OnFocusGain func(*Simulation, float64)

type OnGain

type OnGain func(aura *Aura, sim *Simulation)

type OnInit

type OnInit func(aura *Aura, sim *Simulation)

type OnItemSwap

type OnItemSwap func(*Simulation, proto.ItemSlot)

type OnMasteryStatChanged

type OnMasteryStatChanged func(sim *Simulation, oldMasteryRating float64, newMasteryRating float64)

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 OnReset

type OnReset func(aura *Aura, sim *Simulation)

type OnSnapshot

type OnSnapshot func(sim *Simulation, target *Unit, dot *Dot)

type OnSpeedChanged

type OnSpeedChanged func(oldSpeed float64, newSpeed float64)

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 OnTargetDeath

type OnTargetDeath func(aura *Aura, sim *Simulation, target *Unit)

Callback for an enemy target's death, while its auras are still on it.

type OnTemporaryStatsChange

type OnTemporaryStatsChange func(sim *Simulation, buffAura *Aura, statsChangeWithoutDeps stats.Stats)

type OnTick

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:

  1. Set the Outcome of the hit effect.
  2. Update spell outcome metrics.
  3. Modify the damage if necessary.

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 NewParty

func NewParty(raid *Raid, index int, partyConfig *proto.Party, raidConfig *proto.Raid) *Party

func (*Party) AddStat

func (party *Party) AddStat(stat stats.Stat, amount float64)

func (*Party) AddStats

func (party *Party) AddStats(newStats stats.Stats)

func (*Party) GetMetrics

func (party *Party) GetMetrics() *proto.PartyMetrics

func (*Party) GetPartyBuffs

func (party *Party) GetPartyBuffs(basePartyBuffs *proto.PartyBuffs) *proto.PartyBuffs

func (*Party) IsFull

func (party *Party) IsFull() bool

func (*Party) Size

func (party *Party) Size() int

type PendingAction

type PendingAction struct {
	NextActionAt time.Duration
	Priority     ActionPriority

	// Action to perform (required).
	OnAction func(sim *Simulation)
	// Cleanup when the action is cancelled (optional).
	CleanUp func(sim *Simulation)
	// contains filtered or unexported fields
}

func NewDelayedAction

func NewDelayedAction(options DelayedActionOptions) *PendingAction

Use this only when your code requires persistent access to the returned *PendingAction pointer. For "fire and forget" delayed actions, use sim.GetConsumedPendingActionFromPool() instead, so that the PendingAction struct will be re-used rather than re-allocated on each call.

func NewPeriodicAction

func NewPeriodicAction(sim *Simulation, options PeriodicActionOptions) *PendingAction

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)

func (*PendingAction) IsConsumed

func (pa *PendingAction) IsConsumed() bool

type PeriodicActionOptions

type PeriodicActionOptions struct {
	// How often the action should be performed.
	Period time.Duration

	// The delay before the first action when it differs from Period; zero means Period.
	FirstTickAfter time.Duration

	// Number of times to perform the action before stopping.
	// 0 indicates a permanent periodic action.
	NumTicks int

	// Whether the first tick should happen immediately. If false, first tick will
	// wait for Period.
	TickImmediately bool

	Priority ActionPriority

	OnAction func(*Simulation)
	CleanUp  func(*Simulation)
}

type Pet

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 NewPet

func NewPet(config PetConfig) Pet

func (*Pet) AddComboPoints

func (eb *Pet) AddComboPoints(sim *Simulation, target *Unit, pointsToAdd int32, metrics *ResourceMetrics)

Combo points live on one unit. A gain on another unit drops the points held on the old one, and the gain lands on the new one; a target swap with no gain keeps them. The gain's metrics spend the dropped points, as a shapeshift's own metrics spend the rage it drops.

func (*Pet) AddEnergy

func (eb *Pet) AddEnergy(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*Pet) AddFocus

func (fb *Pet) AddFocus(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(_ *proto.PartyBuffs)

func (*Pet) AddRage

func (rb *Pet) AddRage(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*Pet) AddRaidBuffs

func (pet *Pet) AddRaidBuffs(_ *proto.RaidBuffs)

func (*Pet) ApplyTalents

func (pet *Pet) ApplyTalents()

func (*Pet) AttackBeforePull

func (pet *Pet) AttackBeforePull(sim *Simulation)

Sets the pet on the target before the pull: its rotation runs from now on, and it swings once in reach. Its damage before 0 is not counted.

func (*Pet) ChangeStatInheritance

func (pet *Pet) ChangeStatInheritance(statInheritance PetStatInheritance)

func (*Pet) ComboPoints

func (eb *Pet) ComboPoints(target *Unit) int32

The combo points on target: none unless target holds them.

func (*Pet) CurrentEnergy

func (eb *Pet) CurrentEnergy() float64

func (*Pet) CurrentEnergyRegenMultiplier

func (eb *Pet) CurrentEnergyRegenMultiplier() 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) Disable

func (pet *Pet) Disable(sim *Simulation)

func (*Pet) DisableOnStart

func (pet *Pet) DisableOnStart()

func (*Pet) Enable

func (pet *Pet) Enable(sim *Simulation, petAgent PetAgent)

petAgent should be the PetAgent which embeds this Pet.

func (*Pet) EnableWithStartAttackDelay

func (pet *Pet) EnableWithStartAttackDelay(sim *Simulation, petAgent PetAgent, startAttackDelay time.Duration)

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) EnabledOnStart

func (pet *Pet) EnabledOnStart() bool

func (*Pet) EndOOMEvent

func (mb *Pet) EndOOMEvent(sim *Simulation)

func (*Pet) GainHealth

func (hb *Pet) GainHealth(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*Pet) GetActiveAuraWithTag

func (at *Pet) GetActiveAuraWithTag(tag string) *Aura

func (*Pet) GetAura

func (at *Pet) GetAura(label string) *Aura

func (*Pet) GetAuraByID

func (at *Pet) GetAuraByID(actionID ActionID) *Aura

func (*Pet) GetAuras

func (at *Pet) GetAuras() []*Aura

func (*Pet) GetAurasWithTag

func (at *Pet) GetAurasWithTag(tag string) []*Aura

func (*Pet) GetCharacter

func (pet *Pet) GetCharacter() *Character

Default implementations for some Agent functions which most Pets don't need.

func (*Pet) GetIcdAuraByID

func (at *Pet) GetIcdAuraByID(actionID ActionID) *Aura

func (*Pet) GetInheritedStats

func (pet *Pet) GetInheritedStats() stats.Stats

func (*Pet) GetInitialMajorCooldown

func (mcdm *Pet) GetInitialMajorCooldown(actionID ActionID) MajorCooldown

func (*Pet) GetMajorCooldown

func (mcdm *Pet) GetMajorCooldown(actionID ActionID) *MajorCooldown

func (*Pet) GetMajorCooldownIDs

func (mcdm *Pet) GetMajorCooldownIDs() []*proto.ActionID

func (*Pet) GetMajorCooldownIgnoreTag

func (mcdm *Pet) GetMajorCooldownIgnoreTag(actionID ActionID) *MajorCooldown

func (*Pet) GetMajorCooldowns

func (mcdm *Pet) GetMajorCooldowns() []*MajorCooldown

Returns all MCDs.

func (*Pet) GetMatchingStatBuffCooldownAuras

func (mcdm *Pet) GetMatchingStatBuffCooldownAuras(statTypesToMatch []stats.Stat) []*StatBuffAura

func (*Pet) GetMatchingStatBuffSpells

func (mcdm *Pet) GetMatchingStatBuffSpells(statTypesToMatch []stats.Stat) []*Spell

func (*Pet) GetMetadata

func (pet *Pet) GetMetadata() *proto.UnitMetadata

func (*Pet) HasActiveAura

func (at *Pet) HasActiveAura(label string) bool

func (*Pet) HasActiveAuraWithTag

func (at *Pet) HasActiveAuraWithTag(tag string) bool

func (*Pet) HasActiveAuraWithTagExcludingAura

func (at *Pet) HasActiveAuraWithTagExcludingAura(tag string, excludeAura *Aura) bool

func (*Pet) HasAura

func (at *Pet) HasAura(label string) bool

func (*Pet) HasAuraWithTag

func (at *Pet) HasAuraWithTag(tag string) bool

func (*Pet) Initialize

func (pet *Pet) Initialize()

func (*Pet) IsGuardian

func (pet *Pet) IsGuardian() bool

func (*Pet) IsOOM

func (mb *Pet) IsOOM() bool

func (*Pet) IsReset

func (eb *Pet) IsReset(sim *Simulation) bool

func (*Pet) MaxComboPoints

func (eb *Pet) MaxComboPoints() int32

func (*Pet) MaxHealth

func (hb *Pet) MaxHealth() float64

func (*Pet) MaximumEnergy

func (eb *Pet) MaximumEnergy() float64

func (*Pet) MaximumRage

func (rb *Pet) MaximumRage() float64

func (*Pet) MultiplyDamageTakenRageGen

func (rb *Pet) MultiplyDamageTakenRageGen(multiplier float64)

func (*Pet) MultiplyEnergyRegenSpeed

func (eb *Pet) MultiplyEnergyRegenSpeed(sim *Simulation, multiplier float64)

func (*Pet) MultiplyFocusRegenSpeed added in v1.0.12

func (fb *Pet) MultiplyFocusRegenSpeed(multiplier float64)

func (*Pet) NextEnergyTickAt

func (eb *Pet) NextEnergyTickAt() time.Duration

func (*Pet) NumActiveAurasWithTag

func (at *Pet) NumActiveAurasWithTag(tag string) int32

func (*Pet) OnApplyEffects

func (at *Pet) OnApplyEffects(sim *Simulation, target *Unit, spell *Spell)

Invokes the OnApplyEffects event for all tracked Auras.

func (*Pet) OnCastComplete

func (at *Pet) OnCastComplete(sim *Simulation, spell *Spell)

Invokes the OnCastComplete event for all tracked Auras.

func (*Pet) OnCastResult

func (at *Pet) OnCastResult(sim *Simulation, spell *Spell, result *SpellResult)

func (*Pet) OnEncounterStart

func (at *Pet) OnEncounterStart(sim *Simulation)

func (*Pet) OnGCDReady

func (pet *Pet) OnGCDReady(_ *Simulation)

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) OnKill

func (at *Pet) OnKill(sim *Simulation, target *Unit)

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) OnTargetDies

func (at *Pet) OnTargetDies(sim *Simulation, target *Unit)

func (*Pet) RefreshInheritedStats

func (pet *Pet) RefreshInheritedStats(sim *Simulation)

Snapshots the owner's stats again: a dynamic pet at the pet heartbeat after its owner's stats change, any other pet on its own schedule.

func (*Pet) RegisterDisableEffect

func (pet *Pet) RegisterDisableEffect(disableEffect OnPetDisable)

Runs disableEffect on every dismiss, after OnPetDisable. The dismiss expires only the auras that expire on their own, so this is where a permanent aura that should not outlast the pet comes off.

func (*Pet) RegisterEnableEffect

func (pet *Pet) RegisterEnableEffect(enableEffect OnPetEnable)

Runs enableEffect on every summon, after OnPetEnable, for a caller that does not own the pet.

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)

Health lost to damage taken, booked under Damage Taken and counted in TMI on a tanking unit.

func (*Pet) ResetComboPoints

func (eb *Pet) ResetComboPoints(sim *Simulation, target *Unit, comboPointsToKeep int32)

func (*Pet) ResetEnergyTick

func (eb *Pet) ResetEnergyTick(sim *Simulation)

Gives an immediate partial energy tick and restarts the tick timer.

func (*Pet) ResetRageBar

func (rb *Pet) ResetRageBar(sim *Simulation, rageToKeep float64)

func (*Pet) SetCurrentHealthPercent

func (hb *Pet) SetCurrentHealthPercent(percent float64)

Puts current health at a share of the maximum with no healing or damage, so no metrics or TMI entry move. A druid's change of form moves the maximum and keeps the share.

func (*Pet) SetMaxComboPoints

func (eb *Pet) SetMaxComboPoints(maxComboPoints int32)

func (*Pet) SetMaximumEnergy

func (eb *Pet) SetMaximumEnergy(sim *Simulation, maxEnergy float64, metrics *ResourceMetrics)

Sets the most energy the bar holds. A raised maximum grants no energy; energy above a lowered one is lost and counted against the metrics. Without a Simulation there is no energy yet to lose.

func (*Pet) SetMaximumRage

func (rb *Pet) SetMaximumRage(sim *Simulation, maxRage float64, metrics *ResourceMetrics)

Sets the most rage the bar holds. A raised maximum grants no rage; rage above a lowered one is lost and counted against the metrics. Without a Simulation there is no rage yet to lose.

func (*Pet) SetOffHandRageMultiplier

func (rb *Pet) SetOffHandRageMultiplier(multiplier float64)

func (*Pet) SetStartAttackDelay

func (pet *Pet) SetStartAttackDelay(startAttackDelay time.Duration)

func (*Pet) SetTimeoutAction

func (pet *Pet) SetTimeoutAction(sim *Simulation, duration time.Duration)

func (*Pet) SkipForMana

func (mb *Pet) SkipForMana()

For a rotation that checks a mana cost itself: the current pass skips a spell it wants for its cost.

func (*Pet) SpendComboPoints

func (eb *Pet) SpendComboPoints(sim *Simulation, target *Unit, metrics *ResourceMetrics)

func (*Pet) SpendEnergy

func (eb *Pet) SpendEnergy(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*Pet) SpendFocus

func (fb *Pet) SpendFocus(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*Pet) SpendHealth

func (hb *Pet) SpendHealth(sim *Simulation, amount float64, metrics *ResourceMetrics)

Health a spell takes from its own caster as a cost, booked under the spell's metrics. A self cost is not damage taken, so it adds no TMI entry.

func (*Pet) SpendPartialComboPoints

func (eb *Pet) SpendPartialComboPoints(sim *Simulation, target *Unit, pointsToSpend int32, metrics *ResourceMetrics)

A spend on a unit that holds no combo points spends none.

func (*Pet) SpendRage

func (rb *Pet) SpendRage(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*Pet) StartOOMEvent

func (mb *Pet) StartOOMEvent(sim *Simulation)

Pets keep no OOM metrics, so they never go OOM.

func (*Pet) TimeToNextEnergyTick

func (eb *Pet) TimeToNextEnergyTick(sim *Simulation) time.Duration

func (*Pet) TimeToTargetEnergy

func (eb *Pet) TimeToTargetEnergy(sim *Simulation, targetEnergy float64) time.Duration

func (*Pet) UpdateMajorCooldowns

func (mcdm *Pet) UpdateMajorCooldowns()

Re-sorts the cooldowns and caches the earliest time autocast can use one. Autocast calls it after each use, and anything else that changes a major cooldown's ready time must call it too.

func (*Pet) UpdateMaxEnergy

func (eb *Pet) UpdateMaxEnergy(sim *Simulation, bonusEnergy float64, metrics *ResourceMetrics)

Used for dynamic updates to maximum Energy, such as from the Druid Primal Madness talent

func (*Pet) UpdateMaxHealth

func (hb *Pet) UpdateMaxHealth(sim *Simulation, bonusHealth float64, metrics *ResourceMetrics)

Used for dynamic updates to maximum health from "Last Stand" effects

type PetAgent

type PetAgent interface {
	Agent

	// The Pet controlled by this PetAgent.
	GetPet() *Pet
}

Extension of Agent interface, for Pets.

type PetConfig

type PetConfig struct {
	Name                             string
	Owner                            *Character
	BaseStats                        stats.Stats
	StatInheritance                  PetStatInheritance
	EnabledOnStart                   bool
	IsGuardian                       bool
	IsDynamic                        bool // The pet's stats follow its owner's; the speed inheritances hold whether or not they do.
	HasDynamicMeleeSpeedInheritance  bool // The owner's melee and attack speed, each change at the next pet heartbeat.
	HasDynamicRangedSpeedInheritance bool // The owner's ranged speed, as the pet's melee speed.
	HasDynamicCastSpeedInheritance   bool
	HasResourceRegenInheritance      bool
	StartsInMeleeRange               bool // For a pet summoned at the enemy, which never walks in.
}

type PetSpeedInheritance

type PetSpeedInheritance func(sim *Simulation, ownerSpeedMultiplier float64)

type PetStatInheritance

type PetStatInheritance func(ownerStats stats.Stats) stats.Stats

type PostFinalizeEffect

type PostFinalizeEffect func()

Callback for doing something after finalization.

type PowerBarType

type PowerBarType int
const (
	ManaBar PowerBarType = iota
	EnergyBar
	RageBar
	FocusBar
)

type PrepullAction

type PrepullAction struct {
	DoAt   time.Duration
	Action func(*Simulation)
}

Callback for doing something on prepull.

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 ProcExtraCondition

type ProcExtraCondition func(sim *Simulation, spell *Spell, result *SpellResult) bool

type ProcHandler

type ProcHandler func(sim *Simulation, spell *Spell, result *SpellResult)

type ProcHint

type ProcHint uint16

What the mask alone cannot say, read off the spell's tooltip by the caller. The mask states which hits reach the listener; the wording around it states the trigger condition and, for the helpful bits, whether they mean anything at all.

const (
	// The tooltip names the cast itself as the trigger: "each time you cast a spell", "chance on
	// spell cast".
	ProcHintCastTrigger ProcHint = 1 << iota
	// The tooltip names a critical strike as the trigger.
	ProcHintCrit
	// The tooltip's trigger clause names healing, or an unrestricted "a spell". Either is the
	// evidence that a helpful-spell bit without the harmful one carries a real trigger rather than
	// a leftover.
	ProcHintHeals
	// The tooltip restricts the trigger to healing spells.
	ProcHintPureHeal
	// The trigger clause names one ability: "Your Shock spells", "Your Moonfire ability".
	ProcHintNamedAbility
	// The trigger clause states an attack outcome the mask has no bit for: a resist, a dodge or a
	// parry.
	ProcHintOutcomeTaken
	// The trigger clause names the wearer's own attack being dodged: "when you are Parried or
	// Dodged".
	ProcHintAttackDodged
	// The same for the wearer's own attack being parried.
	ProcHintAttackParried
	// The trigger clause restricts the proc to spells with a damage component: "your damaging
	// spells", "your next 5 damage or healing spells".
	ProcHintDamage
	// The trigger clause names the wearer blocking: "every time you block", "after a block". A
	// blocked hit is an outcome the listener can be given, so the decoder names it.
	ProcHintBlocked
)

func (ProcHint) Matches

func (h ProcHint) Matches(other ProcHint) bool

Returns whether there is any overlap between the given hints.

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

	ProcMaskLast
)

Single-bit masks. These don't need to match Blizzard's values.

func (ProcMask) Matches

func (pm ProcMask) Matches(other ProcMask) bool

Returns whether there is any overlap between the given masks.

func (ProcMask) String

func (i ProcMask) String() string

type ProcTrigger

type ProcTrigger struct {
	Name               string
	ActionID           ActionID
	MetricsActionID    ActionID
	Duration           time.Duration
	Callback           AuraCallback
	ProcMask           ProcMask
	ProcMaskExclude    ProcMask
	HearsCountedSwings bool // A hit flagged SpellFlagCountsAsSwing that the mask would not hear reaches it, and the manager, as a main-hand auto attack.
	SpellFlags         SpellFlag
	SpellFlagsExclude  SpellFlag
	Outcome            HitOutcome
	RequireDamageDealt bool

	// The trigger must be a spell with a damage component: a hit that deals damage, or the landed
	// cast of a spell with a DoT, whose application deals none. A DoT counts whether or not its
	// ticks deal damage, and a hit absorbed to 0 from a spell without one does not count.
	RequireDamageComponent bool

	ProcChance          float64
	DPM                 *DynamicProcManager
	ICD                 time.Duration
	Handler             ProcHandler
	TriggerImmediately  bool       // If false (default), the handler will be called one spell batch window later for improved realism.
	ClassSpellMask      int64      // The sim's own custom spell masks, not from the game files.
	ClassFlags          ClassFlags // The spells this trigger fires on (EffectSpellClassMask in the game files); with ClassSpellMask, both must match.
	ProcSpellClassFlags ClassFlags // The proccing spell's class flags, which proc chance talents match (e.g. Improved Poisons on Instant Poison).
	Caster              *Unit      // Whose proc chance mods apply, when not the aura's unit (e.g. Judgement of Light on the target).
	ClassSpellsOnly     bool       // Corresponds to the Only Proc From Class Abilities flag, e.g. https://www.wowhead.com/forever/spell=32106/lesser-spell-blasting
	ExtraCondition      ProcExtraCondition

	// The Can Proc From Procs attribute (Attributes[3] 0x4000000): the listener also fires on hits
	// from spells flagged SpellFlagProc. Without it a proc's hits are invisible to this listener,
	// which is how the game treats every talent, set bonus and Equip effect by default.
	CanProcFromProcs bool
	// A weapon proc: a "Chance on hit" item effect (ItemEffect.TriggerType 2) or a combat enchant
	// (SpellItemEnchantment.Effect 1, e.g. Mongoose, Crusader, poisons, imbues).
	// The game casts these off every melee or ranged hit that lacks SpellFlagSuppressWeaponProcs,
	// whether or not that hit was itself a proc, so SpellFlagProc and CanProcFromProcs are ignored.
	// An ability that requires a shield or has magic or no DefenseType is no weapon hit and casts none.
	// A weapon proc's own strike is such a hit unless its cast carries the flag, which a melee strike
	// does where anything but a main-hand white swing of the weapon cast it (R-0040).
	// Which hand's hits qualify is still the DPM's or ProcMask's job.
	IsWeaponProc bool
}

type ProcTypeInfo

type ProcTypeInfo struct {
	Callback           AuraCallback
	ProcMask           ProcMask
	HearsCountedSwings bool
	Outcome            HitOutcome
	RequireDamageDealt bool
	// The hit must deal damage or come from a spell with a DoT; see ProcTrigger.
	RequireDamageComponent bool
	Unsupported            []string // named bits the decoder does not model, empty when supported
}

The listener shape a ProcTypeMask describes, in the sim's own terms.

func DecodeProcTypeMask

func DecodeProcTypeMask(mask [2]uint32, hint ProcHint) ProcTypeInfo

DecodeProcTypeMask reads SpellAuraOptions.ProcTypeMask (two 32-bit words).

ProcHintNamedAbility is decoded past: a trigger restricted to one named ability is a shape no ProcTypeMask can state, so the caller refuses those spells rather than the decoder. Which outcome ProcHintOutcomeTaken names is the caller's too, for the same reason; all the decode takes from that hint is that the trigger is an outcome carrying no damage.

type QueuedSpell

type QueuedSpell struct {

	// Stores the time at which QueueSpell() was called to ensure that only one spell can be queued up per timestep
	QueueInitiatedAt time.Duration
	// contains filtered or unexported fields
}

func (*QueuedSpell) Cancel

func (qs *QueuedSpell) Cancel(sim *Simulation)

Models the use of /cqs macros to change which spell should be cast at the last minute

func (*QueuedSpell) InitiateQueue

func (qs *QueuedSpell) InitiateQueue(sim *Simulation, spell *Spell, target *Unit, executeAt time.Duration)

type RageBarOptions

type RageBarOptions struct {
	MaxRage            float64
	StartingRage       float64
	BaseRageMultiplier float64
	TwoHandRage        bool // Auto attacks take the two-hand factor whatever the weapon's normalized speed.
}

type RageCost

type RageCost struct {
	Refund          float64
	RefundMetrics   *ResourceMetrics
	ResourceMetrics *ResourceMetrics
}

func (*RageCost) CostFailureReason

func (rc *RageCost) CostFailureReason(sim *Simulation, spell *Spell) string

func (*RageCost) IssueRefund

func (rc *RageCost) IssueRefund(sim *Simulation, spell *Spell)

func (*RageCost) MeetsRequirement

func (rc *RageCost) MeetsRequirement(_ *Simulation, spell *Spell) bool

func (*RageCost) SpendCost

func (rc *RageCost) SpendCost(sim *Simulation, spell *Spell)

type RageCostOptions

type RageCostOptions struct {
	Cost int32

	Refund        float64
	RefundMetrics *ResourceMetrics // Optional, will default to unit.RageRefundMetrics if not supplied.
}

type Raid

type Raid struct {
	Parties []*Party

	AllPlayerUnits   []*Unit // Cached list of all Players in the raid.
	AllUnits         []*Unit // Cached list of all Units (players and pets) in the raid.
	NumTargetDummies int     // Number of player units that are dummy targets for heals.
	// contains filtered or unexported fields
}

func NewRaid

func NewRaid(raidConfig *proto.Raid) *Raid

Makes a new raid.

func (*Raid) AddStats

func (raid *Raid) AddStats(s stats.Stats)

func (*Raid) GetActiveAllyUnits

func (raid *Raid) GetActiveAllyUnits() []*Unit

func (*Raid) GetActiveUnits

func (raid *Raid) GetActiveUnits() []*Unit

func (*Raid) GetFirstEmptyRaidIndex

func (raid *Raid) GetFirstEmptyRaidIndex() (*Party, int)

Returns (party, index within party)

func (*Raid) GetFirstNPlayersOrPets

func (raid *Raid) GetFirstNPlayersOrPets(n int32) []*Unit

func (*Raid) GetFirstTargetDummy

func (raid *Raid) GetFirstTargetDummy() *TargetDummy

func (*Raid) GetLowestHealthAllyUnit

func (raid *Raid) GetLowestHealthAllyUnit() *Unit

func (*Raid) GetMetrics

func (raid *Raid) GetMetrics() *proto.RaidMetrics

func (*Raid) GetPlayerFromUnit

func (raid *Raid) GetPlayerFromUnit(unit *Unit) Agent

func (*Raid) GetPlayerFromUnitIndex

func (raid *Raid) GetPlayerFromUnitIndex(unitIndex int32) Agent

func (*Raid) GetPlayersOfClass

func (raid *Raid) GetPlayersOfClass(class proto.Class) []Agent

func (*Raid) GetRaidBuffs

func (raid *Raid) GetRaidBuffs(baseRaidBuffs *proto.RaidBuffs) *proto.RaidBuffs

func (*Raid) GetTargetDummies

func (raid *Raid) GetTargetDummies() []*TargetDummy

func (*Raid) Size

func (raid *Raid) Size() int

type Rand

type Rand interface {
	Next() uint64
	NextFloat64() float64
	Seed(int64)

	GetSeed() int64

	rand.Source64
}

implementing Source or Source64 is possible, but adds too much overhead

type RandomSuffix

type RandomSuffix struct {
	ID               int32
	Name             string
	Stats            stats.Stats // Allocations per 10000 of the item's random property points.
	PseudoStats      []float64   // Indexed by proto.PseudoStat; flat, through stats.FromPseudoStatsProto.
	ReducedCasterDps bool        // A weapon with the suffix deals its scaling options' ReducedCasterWeaponDamage.
}

func RandomSuffixFromProto

func RandomSuffixFromProto(pData *proto.ItemRandomSuffix) RandomSuffix

type RatingChannels

type RatingChannels struct {
	Rating                        stats.Stat
	Melee, Ranged, Spell          proto.PseudoStat
	PhysicalPercent, SpellPercent stats.Stat
	HasPercentStats               bool
	RatingPerPercent              float64
}

The melee, ranged and spell percents one rating raises together, as the PseudoStats the character sheet shows, at RatingPerPercent rating per percent point. Where HasPercentStats is set the rating also converts into the back-end PhysicalPercent and SpellPercent; haste has no back-end percent Stat.

func RatingChannelsOf

func RatingChannelsOf(rating stats.Stat) (RatingChannels, bool)

The channels of a rating, and whether RatingChannelTable lists it.

func (RatingChannels) Channels

func (channels RatingChannels) Channels() []proto.PseudoStat

type RatingConversion

type RatingConversion struct {
	Rating           stats.Stat
	Percent          stats.Stat
	RatingPerPercent float64
	Step             float64
}

A rating that converts into a percent stat at RatingPerPercent rating per percent point. Where Step is non-zero the rating counts in whole steps of that size only.

type ReplaceMHSwing

type ReplaceMHSwing func(sim *Simulation, mhSwingSpell *Spell) *Spell

ReplaceMHSwing is called right before a main hand auto attack fires. It must never return nil, but either a replacement spell or the passed in regular mhSwingSpell. This allows for abilities that convert a white attack into a yellow attack.

type ResetEffect

type ResetEffect func(*Simulation)

Callback for doing something on reset.

type ResetTestResult

type ResetTestResult struct {
	BaseDps   float64
	BaseHps   float64
	BaseTps   float64
	BaseDtps  float64
	SplitDps  float64
	SplitHps  float64
	SplitTps  float64
	SplitDtps float64
}

type ResourceCostImpl

type ResourceCostImpl interface {
	// Whether the Unit associated with the spell meets the resource cost
	// requirements to cast the spell.
	MeetsRequirement(*Simulation, *Spell) bool

	// Returns a message for when the cast fails due to lack of resources.
	CostFailureReason(*Simulation, *Spell) string

	// Subtracts the resources used from a cast from the Unit.
	SpendCost(*Simulation, *Spell)

	// Space for handling refund mechanics. Not all spells provide refunds.
	IssueRefund(*Simulation, *Spell)
}

Handles computing the cost of spells and checking whether the Unit meets them.

type ResourceKey

type ResourceKey struct {
	ActionID ActionID
	Type     proto.ResourceType
}

type ResourceMetrics

type ResourceMetrics struct {
	ActionID       ActionID
	Type           proto.ResourceType
	NoThreat       bool // Gains from this source generate no threat.
	UnscaledThreat bool // Rage gained from this source makes its threat without the unit's threat multiplier.

	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 (*RotationCastsTestGenerator) NumTests

func (generator *RotationCastsTestGenerator) NumTests() int

type RotationCombo

type RotationCombo struct {
	Label    string
	Rotation *proto.APLRotation
}

func GetAplRotation

func GetAplRotation(dir string, file string) RotationCombo

The gear sets and encounter builds were removed with the rest of the TBC presets, so a missing file is now an expected state rather than a broken checkout. log.Fatalf killed the whole process and took the test output with it; returning an empty combo lets the suite run and report a normal failure instead.

func RotationWithSpellIds

func RotationWithSpellIds(label string, combo RotationCombo, ids map[int32]int32) RotationCombo

The rotation with a spell's rank moved to another rank by spell id, so the other rank reaches the results.

type RotationTransformation

type RotationTransformation func(raid *proto.Raid, rotation *proto.APLRotation)

type ScopedPercents

type ScopedPercents struct {
	Hit, Crit, HitFromRating, CritFromRating float64
}

The sums of the active hit and crit mods that reach every attack with this proc mask: those naming no ClassMask, ClassFlags, school or spell flag, whose proc mask and weapon match the attack's. HitFromRating and CritFromRating are the part the mods converted from a rating give.

type SetBonus

type SetBonus 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 ApplySetBonus

	// Optional field to override the DefaultItemSetSlots
	// For Example: The set contains of 2 weapons
	Slots []proto.ItemSlot

	// If set, the character must have this profession for the bonus to activate.
	RequiredProfession proto.Profession
}

type SetBonusCollection

type SetBonusCollection []SetBonus

func (SetBonusCollection) ContainsBonus

func (collection SetBonusCollection) ContainsBonus(setName string, count int32) bool

type SettingsCombos

type SettingsCombos struct {
	Class             proto.Class
	Races             []proto.Race
	GearSets          []GearSetCombo
	TalentSets        []TalentsCombo
	SpecOptions       []SpecOptionsCombo
	Rotations         []RotationCombo
	Buffs             []BuffsCombo
	Encounters        []EncounterCombo
	ItemSwapSets      []ItemSwapSetCombo
	SimOptions        *proto.SimOptions
	IsHealer          bool
	IsTank            bool
	StartingDistances []float64
	Cooldowns         *proto.Cooldowns
	Profession1       proto.Profession
	Profession2       proto.Profession
	ReactionTimeMs    int32 // 100 when unset.
}

func (*SettingsCombos) GetTest

func (*SettingsCombos) NumTests

func (combos *SettingsCombos) NumTests() int

type SheetAvoidance

type SheetAvoidance struct{ CanBlock, CanParry bool }

Which of block and parry the character sheet shows: a character that cannot block or parry shows no Block% or Parry%, and no change in its stats moves either.

func ComputeStatsAndDeps

ComputeStatsAndDeps combines a skip-rotation ComputeStats with ComputeStatDependencies in a single NewEnvironment call. Use this when both are needed for the same raid to avoid building the character environment twice. It also returns which of block and parry the character's sheet shows.

func (SheetAvoidance) Gate

func (sheet SheetAvoidance) Gate(pseudoStats []float64)

type Shield

type Shield struct {
	Spell *Spell

	// Embed Aura so we can use IsActive/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 ShieldArray

type ShieldArray []*Shield

func (ShieldArray) Get

func (shields ShieldArray) Get(target *Unit) *Shield

type ShieldConfig

type ShieldConfig struct {
	SelfOnly bool // Set to true to only create the self-shield.

	Spell *Spell

	Aura
}

type ShieldShouldApplyCondition

type ShieldShouldApplyCondition func(sim *Simulation, spell *Spell, result *SpellResult, isPeriodic bool) bool

type ShieldStrengthCalculator

type ShieldStrengthCalculator func(unit *Unit) 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
	NeedsInput  bool          // Sim is in interactive mode and needs input

	ProgressReport func(*proto.ProgressMetrics)
	Signals        simsignals.Signals

	Log func(string, ...any)
	// contains filtered or unexported fields
}

func NewSim

func NewSim(rsr *proto.RaidSimRequest, signals simsignals.Signals) *Simulation

func (*Simulation) AddPendingAction

func (sim *Simulation) AddPendingAction(pa *PendingAction)

func (*Simulation) AddTask

func (sim *Simulation) AddTask(task Task)

func (*Simulation) Cleanup

func (sim *Simulation) Cleanup()

func (*Simulation) DisableTargetUnit

func (sim *Simulation) DisableTargetUnit(targetUnit *Unit, expireAuras bool)

func (*Simulation) EnableTargetUnit

func (sim *Simulation) EnableTargetUnit(targetUnit *Unit)

func (*Simulation) GetConsumedPendingActionFromPool

func (sim *Simulation) GetConsumedPendingActionFromPool() *PendingAction

Use this for any "fire and forget" delayed actions where your code does not require persistent access to the returned *PendingAction pointer. This helper avoids unnecessary re-allocations of the PendingAction struct for improved code performance, but offers no guarantees on the long-term state of the underlying struct, which will be re-used once consumed.

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) PrePull

func (sim *Simulation) PrePull()

func (*Simulation) Proc

func (sim *Simulation) Proc(p float64, label string) bool

func (*Simulation) RandomExpFloat

func (sim *Simulation) RandomExpFloat(label string) float64

func (*Simulation) RandomFloat

func (sim *Simulation) RandomFloat(label string) float64

Returns a random float64 between 0.0 (inclusive) and 1.0 (exclusive).

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) RemoveTask

func (sim *Simulation) RemoveTask(task Task)

func (*Simulation) RescheduleTask

func (sim *Simulation) RescheduleTask(taskTime time.Duration)

func (*Simulation) Reseed

func (sim *Simulation) Reseed(seed int64)

func (*Simulation) Reset

func (sim *Simulation) Reset()

func (*Simulation) Roll

func (sim *Simulation) Roll(min float64, max float64) float64

Shorthand for commonly-used RNG behavior. Returns a random number between min and max.

func (*Simulation) RollWithLabel

func (sim *Simulation) RollWithLabel(min float64, max float64, label string) float64

func (*Simulation) RunAfterCurrentEvent

func (sim *Simulation) RunAfterCurrentEvent(action func(*Simulation))

Runs the action at the current time, once the event in progress and its callbacks are done. It goes ahead of the rotation and regen due at this time, and after any swing or task due then.

func (*Simulation) Step

func (sim *Simulation) Step() bool

type SingleCharacterStatsTestGenerator

type SingleCharacterStatsTestGenerator struct {
	Name    string
	Request *proto.ComputeStatsRequest
}

func (*SingleCharacterStatsTestGenerator) GetTest

func (*SingleCharacterStatsTestGenerator) NumTests

func (generator *SingleCharacterStatsTestGenerator) NumTests() int

type SingleDpsTestGenerator

type SingleDpsTestGenerator struct {
	Name    string
	Request *proto.RaidSimRequest
}

func (*SingleDpsTestGenerator) GetTest

func (*SingleDpsTestGenerator) NumTests

func (generator *SingleDpsTestGenerator) NumTests() int

type SingleStatWeightsTestGenerator

type SingleStatWeightsTestGenerator struct {
	Name    string
	Request *proto.StatWeightsRequest
}

func (*SingleStatWeightsTestGenerator) GetTest

func (*SingleStatWeightsTestGenerator) NumTests

func (generator *SingleStatWeightsTestGenerator) NumTests() int

type SpecOptionsCombo

type SpecOptionsCombo struct {
	Label       string
	SpecOptions any
}

type SpecSetter

type SpecSetter func(*proto.Player, any)

type Spell

type Spell struct {
	// ID for this spell.
	ActionID
	//Rank of the spell.
	Rank int32

	// The unit who will perform this spell.
	Unit *Unit

	// Fire, Frost, Shadow, etc.
	SpellSchool SpellSchool
	SchoolIndex stats.SchoolIndex

	// Decides the base crit multiplier (1.5 for Magic, 2.0 for Melee and Ranged) and which
	// SpellMods with a DefenseType filter apply. Taken from the game files' SpellCategories table.
	// A spell left at DefenseTypeNone panics if it ever tries to crit.
	DefenseType DefenseType

	// Controls which effects can proc from this spell.
	ProcMask ProcMask

	// Flags
	Flags SpellFlag

	// The specific class spell id
	// should be a unique bit
	ClassSpellMask int64

	// The game files' SpellClassOptions: the family and mask bit its talents name this spell by.
	ClassFlags ClassFlags

	// 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
	// The shortest the missile flies, however close the target: a spell with no speed flies this long.
	MissileMinDuration time.Duration

	ResourceMetrics *ResourceMetrics

	Cost               *SpellCost // Cost for the spell.
	DefaultCast        Cast       // Default cast parameters with all static effects applied.
	CD                 Cooldown
	SharedCD           Cooldown
	IgnoreHaste        bool
	ExtraCastCondition CanCastCondition

	CastRequirement CastRequirement
	MenuGroup       string // A manual APL menu group, rotation_tab.apl.submenus keys joined by dots (spell.cat.stealth).

	// Optional range constraints. If supplied, these are used to modify the ExtraCastCondition above to additionally check for DistanceFromTarget.
	MinRange   float64
	MaxRange   float64
	MaxCharges int // Maximum amount of charges the spell can have

	RechargeTime time.Duration

	SpellMetrics []SpellMetrics

	// Performs the actions of this spell.
	ApplyEffects ApplySpellResults

	// The current or most recent cast data.
	CurCast Cast

	BonusHitPercent       float64
	BonusCritPercent      float64
	BonusSpellDamage      float64
	BonusExpertisePercent float64
	CastTimeMultiplier    float64
	CdMultiplier          float64 // The product of the nonzero cooldown multiplier mods; CooldownMultiplier reads it.

	GCDMultiplier float64 // Scales DefaultCast.GCD, after the flat GCD mods and before haste and the GCD minimum; 1 = unmodified. Fed by SpellMod_GlobalCooldown_Pct.

	RangeMultiplier          float64 // Scales MaxRange, after the flat range mods; 1 = unmodified. Fed by SpellMod_Range_Pct.
	PushbackProtection       float64 // The chance a hit does not push back this spell's hardcast, taken off the unit's PushbackChance. Fed by SpellMod_PushbackProtection_Pct.
	DamageMultiplier         float64
	DamageMultiplierAdditive float64
	// Added to DamageMultiplierAdditive on direct hits and direct heals only. Unlike that bucket
	// this one is 0 when nothing feeds it.
	DirectDamageMultiplierAdditive float64
	DirectDamageMultiplier         float64 // Multiplies direct hits and direct heals only, 1 = unmodified. Fed by SpellMod_DirectDamageDone_Pct.
	CritMultiplierPct              float64 // Multiplies the base crit multiplier, 1 = unmodified. Fed by SpellMod_CritMultiplier_Pct.
	CritMultiplierAdditive         float64 // Additive critical damage bonus

	BonusBaseDamage       float64 // Certain items can increase the base damage of a spell e.g. https://www.wowhead.com/forever/item=28248/totem-of-the-void
	BonusCoefficient      float64 // EffectBonusCoefficient in the game files' SpellEffect table, "SP mod" on Wowhead (not necessarily shown there even if > 0)
	DirectVariance        float64 // EffectVariance of a spell-school hit or a heal: the direct amount, power included, lands within ±DirectVariance/2 of itself.
	TakenBonusCoefficient float64 // The coefficient the target's flat school bonus is taken at by a spell that sets no BonusCoefficient because it adds its spell power by hand.

	VersusBonus *VersusBonus // Multiplies the base damage, before power and flat bonuses are added, against the targets it names.

	// Multiplier for all threat generated by this effect.
	ThreatMultiplier float64

	FlatThreatBonus     float64 // Adds a fixed amount of threat to this spell, before multipliers.
	ThreatAPCoefficient float64 // Adds this share of the caster's attack power to the flat threat bonus, before multipliers.

	// Per-target auras that are related to this spell, usually buffs or debuffs applied by the spell.
	RelatedAuraArrays LabeledAuraArrays
	RelatedDotSpell   *Spell
	RelatedSelfBuff   *Aura

	Source ActionSource
	// contains filtered or unexported fields
}

func (*Spell) AOEDot

func (spell *Spell) AOEDot() *Dot

func (*Spell) AOEHot

func (spell *Spell) AOEHot() *Dot

func (*Spell) AnyDotsActive

func (spell *Spell) AnyDotsActive(sim *Simulation) bool

func (*Spell) ApplyAOEThreat

func (spell *Spell) ApplyAOEThreat(threatAmount float64)

func (*Spell) ApplyAOEThreatIgnoreMultipliers

func (spell *Spell) ApplyAOEThreatIgnoreMultipliers(threatAmount float64)

func (*Spell) ApplyAllDots

func (spell *Spell) ApplyAllDots(sim *Simulation)

func (*Spell) ApplyPostOutcomeDamageModifiers

func (spell *Spell) ApplyPostOutcomeDamageModifiers(sim *Simulation, result *SpellResult, isPeriodic bool)

func (*Spell) ApplyPostOutcomeHealingModifiers

func (spell *Spell) ApplyPostOutcomeHealingModifiers(sim *Simulation, result *SpellResult)

func (*Spell) ApplySplitThreat

func (spell *Spell) ApplySplitThreat(sim *Simulation, threat float64)

Threat no single enemy draws, such as a heal's or a resource gain's, split between the targets in combat at the time. Before the pull no target is in combat, so it makes none, as damage before the pull does: rage gained before the pull makes no threat in game (EV-0044).

func (*Spell) AttackerDamageMultiplier

func (spell *Spell) AttackerDamageMultiplier(attackTable *AttackTable, isDot bool) float64

Returns the combined attacker modifiers.

func (*Spell) BonusDamage

func (spell *Spell) BonusDamage(attackTable *AttackTable) float64

func (*Spell) CalcAndDealAoeDamage

func (spell *Spell) CalcAndDealAoeDamage(sim *Simulation, baseDamage float64, outcomeApplier OutcomeApplier) SpellResultSlice

func (*Spell) CalcAndDealAoeDamageWithVariance

func (spell *Spell) CalcAndDealAoeDamageWithVariance(sim *Simulation, outcomeApplier OutcomeApplier, baseDamageCalculator BaseDamageCalculator) SpellResultSlice

func (*Spell) CalcAndDealCleaveDamage

func (spell *Spell) CalcAndDealCleaveDamage(sim *Simulation, firstTarget *Unit, maxTargets int32, baseDamage float64, outcomeApplier OutcomeApplier) SpellResultSlice

func (*Spell) CalcAndDealCleaveDamageWithVariance

func (spell *Spell) CalcAndDealCleaveDamageWithVariance(sim *Simulation, firstTarget *Unit, maxTargets int32, outcomeApplier OutcomeApplier, baseDamageCalculator BaseDamageCalculator) SpellResultSlice

func (*Spell) CalcAndDealDamage

func (spell *Spell) CalcAndDealDamage(sim *Simulation, target *Unit, baseDamage float64, outcomeApplier OutcomeApplier) *SpellResult

func (*Spell) CalcAndDealHealing

func (spell *Spell) CalcAndDealHealing(sim *Simulation, target *Unit, baseHealing float64, outcomeApplier OutcomeApplier) *SpellResult

func (*Spell) CalcAndDealOutcome

func (spell *Spell) CalcAndDealOutcome(sim *Simulation, target *Unit, outcomeApplier OutcomeApplier) *SpellResult

func (*Spell) CalcAndDealPeriodicAoeDamage

func (spell *Spell) CalcAndDealPeriodicAoeDamage(sim *Simulation, baseDamage float64, outcomeApplier OutcomeApplier) SpellResultSlice

func (*Spell) CalcAndDealPeriodicDamage

func (spell *Spell) CalcAndDealPeriodicDamage(sim *Simulation, target *Unit, baseDamage float64, outcomeApplier OutcomeApplier) *SpellResult

func (*Spell) CalcAndDealPeriodicHealing

func (spell *Spell) CalcAndDealPeriodicHealing(sim *Simulation, target *Unit, baseHealing float64, outcomeApplier OutcomeApplier) *SpellResult

func (*Spell) CalcAoeDamage

func (spell *Spell) CalcAoeDamage(sim *Simulation, baseDamage float64, outcomeApplier OutcomeApplier) SpellResultSlice

Use CalcAoeDamage + DealBatchedAoeDamage instead of CalcAndDealAoeDamage in situations where you want to block procs on early targets from influencing the damage calculation on later targets.

func (*Spell) CalcAoeDamageWithVariance

func (spell *Spell) CalcAoeDamageWithVariance(sim *Simulation, outcomeApplier OutcomeApplier, baseDamageCalculator BaseDamageCalculator) SpellResultSlice

func (*Spell) CalcCleaveDamage

func (spell *Spell) CalcCleaveDamage(sim *Simulation, firstTarget *Unit, maxTargets int32, baseDamage float64, outcomeApplier OutcomeApplier) SpellResultSlice

func (*Spell) CalcCleaveDamageWithVariance

func (spell *Spell) CalcCleaveDamageWithVariance(sim *Simulation, firstTarget *Unit, maxTargets int32, outcomeApplier OutcomeApplier, baseDamageCalculator BaseDamageCalculator) SpellResultSlice

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) CalcPeriodicAoeDamage

func (spell *Spell) CalcPeriodicAoeDamage(sim *Simulation, baseDamage float64, outcomeApplier OutcomeApplier) SpellResultSlice

func (*Spell) CalcPeriodicDamage

func (spell *Spell) CalcPeriodicDamage(sim *Simulation, target *Unit, baseDamage float64, outcomeApplier OutcomeApplier) *SpellResult

func (*Spell) CalcPeriodicHealing

func (spell *Spell) CalcPeriodicHealing(sim *Simulation, target *Unit, baseHealing float64, outcomeApplier OutcomeApplier) *SpellResult

func (*Spell) CanCast

func (spell *Spell) CanCast(sim *Simulation, target *Unit) bool

Returns whether a call to Cast() would be successful, without actually doing a cast.

func (*Spell) CanCastOrQueue

func (spell *Spell) CanCastOrQueue(sim *Simulation, target *Unit) bool

Helper function for APL checks to prevent infinite loops

func (*Spell) CanCompleteCast

func (spell *Spell) CanCompleteCast(sim *Simulation, target *Unit, logCastFailure bool) bool

Returns whether the spell being cast can be completed, its cost aside: the unit and target may no longer qualify by the end of the cast.

func (*Spell) CanQueue

func (spell *Spell) CanQueue(sim *Simulation, target *Unit) bool

Returns whether the spell could be queued by the player at the current time using the game's spell queueing functionality. Assumes the maximum spell queue window of 400ms that the game allows.

func (*Spell) Cast

func (spell *Spell) Cast(sim *Simulation, target *Unit) bool

func (*Spell) CastOnAllOtherTargets

func (spell *Spell) CastOnAllOtherTargets(sim *Simulation, mainTarget *Unit)

func (*Spell) CastOrQueue

func (spell *Spell) CastOrQueue(sim *Simulation, target *Unit)

func (*Spell) CastTime

func (spell *Spell) CastTime() time.Duration

Time until the cast is finished (ignoring GCD)

func (*Spell) CasterHealingMultiplier

func (spell *Spell) CasterHealingMultiplier() float64

func (*Spell) CloneResult

func (spell *Spell) CloneResult(result *SpellResult) *SpellResult

func (*Spell) ComboPointMetrics

func (spell *Spell) ComboPointMetrics() *ResourceMetrics

func (*Spell) ConsumeCharge

func (spell *Spell) ConsumeCharge(sim *Simulation)

func (*Spell) CooldownMultiplier

func (spell *Spell) CooldownMultiplier() float64

The multiplier a cast applies to the spell's cooldown: 0 while a mod removes the cooldown.

func (*Spell) CountManualCast

func (spell *Spell) CountManualCast(target *Unit)

Counts one press the player makes by hand on this spell. A press that is not the cast of this spell itself, such as the one that queues it for the next swing, credits it here.

func (*Spell) CritDamageMultiplier

func (spell *Spell) CritDamageMultiplier(at *AttackTable) float64

The damage multiplier of a critical strike. The base comes from the DefenseType: spells crit for 150%, melee and ranged attacks for 200%. Multiplicative modifiers (the slaying talents on the attack table, SpellMod_CritMultiplier_Pct) scale that base; additive ones (Ruin, Impale, SpellMod_CritMultiplier_Flat) scale only the bonus part above 100%. Aura 163 (aura 50 for healing) multiplies PseudoStats.CritDamageMultiplier, so 2% gives 204% melee and 153% spell crits, and Vengeance 5/5 on top gives (1.53 - 1) × 2 + 1 = 206%. https://web.archive.org/web/20081014064638/http://elitistjerks.com/f31/t12595-relentless_earthstorm_diamond_-_melee_only/p4/

func (*Spell) CurCPM

func (spell *Spell) CurCPM(sim *Simulation) float64

Current casts per minute

func (*Spell) CurDamagePerCast

func (spell *Spell) CurDamagePerCast() float64

Metrics for the current iteration

func (*Spell) CurDot

func (spell *Spell) CurDot() *Dot

func (*Spell) CurHot

func (spell *Spell) CurHot() *Dot

func (*Spell) DealBatchedAoeDamage

func (spell *Spell) DealBatchedAoeDamage(sim *Simulation)

func (*Spell) DealBatchedPeriodicDamage

func (spell *Spell) DealBatchedPeriodicDamage(sim *Simulation)

func (*Spell) DealCastResult

func (spell *Spell) DealCastResult(sim *Simulation, result *SpellResult)

Fires the caster's OnCastResult for a direct result, once per result. A missile deals it at its cast; any other direct result as it is dealt. A tick or a heal never deals it, and a proc that comes off the cast's hit roll listens here (CallbackOnCastResult with TriggerImmediately).

func (*Spell) DealDamage

func (spell *Spell) DealDamage(sim *Simulation, result *SpellResult)

func (*Spell) DealDamageAfterTravel

func (spell *Spell) DealDamageAfterTravel(sim *Simulation, result *SpellResult)

Deals the cast result now and the result itself once the spell's travel time has passed.

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

func (spell *Spell) DealPeriodicDamage(sim *Simulation, result *SpellResult)

func (*Spell) DealPeriodicHealing

func (spell *Spell) DealPeriodicHealing(sim *Simulation, result *SpellResult)

func (*Spell) DisposeResult

func (spell *Spell) DisposeResult(result *SpellResult)

func (*Spell) DodgeParrySuppression

func (spell *Spell) DodgeParrySuppression() float64

ExpertisePercent is fed by ExpertiseRating through a stat dependency and directly by the flat-percent sources; Forever formats every source as a plain percent, so there is no quarter-point rounding.

func (*Spell) Dot

func (spell *Spell) Dot(target *Unit) *Dot

func (*Spell) EffectiveCastTime

func (spell *Spell) EffectiveCastTime() time.Duration

Time until either the cast is finished or GCD is ready again, whichever is longer

func (*Spell) EffectiveMaxRange

func (spell *Spell) EffectiveMaxRange() float64

The distance the range check allows: MaxRange after the range mods.

func (*Spell) EnergyMetrics

func (spell *Spell) EnergyMetrics() *ResourceMetrics

func (*Spell) ExpectedInitialDamage

func (spell *Spell) ExpectedInitialDamage(sim *Simulation, target *Unit) float64

func (*Spell) ExpectedTickDamage

func (spell *Spell) ExpectedTickDamage(sim *Simulation, target *Unit) float64

func (*Spell) ExpectedTickDamageFromCurrentSnapshot

func (spell *Spell) ExpectedTickDamageFromCurrentSnapshot(sim *Simulation, target *Unit) float64

Kept for the DoT increase values, which are disabled for now in apl_values_dot.go.

func (*Spell) FullCooldown

func (spell *Spell) FullCooldown() time.Duration

The longer of the spell's own cooldown and its shared category cooldown.

func (*Spell) GetMetricSplitCount

func (spell *Spell) GetMetricSplitCount() int

func (*Spell) GetNumCharges

func (spell *Spell) GetNumCharges() int

func (*Spell) GetPhysicalMissChance

func (spell *Spell) GetPhysicalMissChance(attackTable *AttackTable) float64

func (*Spell) HealingCritChance

func (spell *Spell) HealingCritChance() float64

func (*Spell) HealingCritCheck

func (spell *Spell) HealingCritCheck(sim *Simulation) bool

func (*Spell) HealingPower

func (spell *Spell) HealingPower(target *Unit) float64

func (*Spell) HealthMetrics

func (spell *Spell) HealthMetrics(target *Unit) *ResourceMetrics

func (*Spell) Hot

func (spell *Spell) Hot(target *Unit) *Dot

func (*Spell) InRange

func (spell *Spell) InRange() bool

Whether the unit stands within the spell's range: no closer than MinRange and no farther than MaxRange after the range mods. A range left at 0 does not limit.

func (*Spell) IsMH

func (spell *Spell) IsMH() bool

Returns whether this hit effect is associated with the main-hand weapon.

func (*Spell) IsMelee

func (spell *Spell) IsMelee() bool

Returns whether this hit effect is associated with either melee weapon.

func (*Spell) IsOH

func (spell *Spell) IsOH() bool

Returns whether this hit effect is associated with the off-hand weapon.

func (*Spell) IsRanged

func (spell *Spell) IsRanged() bool

Returns whether this hit effect is associated with a ranged weapon.

func (*Spell) IsReady

func (spell *Spell) IsReady(sim *Simulation) bool

func (*Spell) IssueRefund

func (spell *Spell) IssueRefund(sim *Simulation)

func (*Spell) MagicCritCheck

func (spell *Spell) MagicCritCheck(sim *Simulation, target *Unit) bool

func (*Spell) MagicHitCheck

func (spell *Spell) MagicHitCheck(sim *Simulation, attackTable *AttackTable) bool

func (*Spell) Matches

func (spell *Spell) Matches(mask int64) bool

Returns true if the given mask matches the spell mask

func (*Spell) MatchesFlags

func (spell *Spell) MatchesFlags(f ClassFlags) bool

Returns true if the given class flags name this spell

func (*Spell) MeleeAttackPower

func (spell *Spell) MeleeAttackPower(target *Unit) float64

func (*Spell) NewResult

func (spell *Spell) NewResult(target *Unit) *SpellResult

func (*Spell) NextChargeIn

func (spell *Spell) NextChargeIn(sim *Simulation) time.Duration

Calculates the time until the next charge is available. Will return 0 if no recharge is in progress

func (*Spell) OutcomeAlwaysHit

func (spell *Spell) OutcomeAlwaysHit(sim *Simulation, result *SpellResult, _ *AttackTable)

func (*Spell) OutcomeAlwaysHitNoHitCounter

func (spell *Spell) OutcomeAlwaysHitNoHitCounter(_ *Simulation, result *SpellResult, _ *AttackTable)

Hit without Hits++ counter

func (*Spell) OutcomeAlwaysMiss

func (spell *Spell) OutcomeAlwaysMiss(_ *Simulation, result *SpellResult, _ *AttackTable)

func (*Spell) OutcomeEnemyMeleeWhite

func (spell *Spell) OutcomeEnemyMeleeWhite(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeEnemyMeleeWhiteNoHitCounter

func (spell *Spell) OutcomeEnemyMeleeWhiteNoHitCounter(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeEnemySpellHit added in v1.0.13

func (spell *Spell) OutcomeEnemySpellHit(sim *Simulation, result *SpellResult, attackTable *AttackTable)

An enemy's spell that always lands. A target that can block spells blocks it at its melee block chance, and the block takes the block value off as a swing's does (EV-0228).

func (*Spell) OutcomeExpectedMagicAlwaysHit

func (spell *Spell) OutcomeExpectedMagicAlwaysHit(_ *Simulation, _ *SpellResult, _ *AttackTable)

func (*Spell) OutcomeExpectedMagicCrit

func (spell *Spell) OutcomeExpectedMagicCrit(_ *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeExpectedMagicHit

func (spell *Spell) OutcomeExpectedMagicHit(_ *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeExpectedMagicHitAndCrit

func (spell *Spell) OutcomeExpectedMagicHitAndCrit(_ *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeExpectedMeleeWeaponSpecialHitAndCrit

func (spell *Spell) OutcomeExpectedMeleeWeaponSpecialHitAndCrit(_ *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeExpectedMeleeWhite

func (spell *Spell) OutcomeExpectedMeleeWhite(_ *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeExpectedPhysicalCrit

func (spell *Spell) OutcomeExpectedPhysicalCrit(_ *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeExpectedTick

func (spell *Spell) OutcomeExpectedTick(_ *Simulation, _ *SpellResult, _ *AttackTable)

func (*Spell) OutcomeHealing

func (spell *Spell) OutcomeHealing(_ *Simulation, result *SpellResult, _ *AttackTable)

func (*Spell) OutcomeHealingCrit

func (spell *Spell) OutcomeHealingCrit(sim *Simulation, result *SpellResult, _ *AttackTable)

func (*Spell) OutcomeHealingCritNoHitCounter

func (spell *Spell) OutcomeHealingCritNoHitCounter(sim *Simulation, result *SpellResult, _ *AttackTable)

func (*Spell) OutcomeHealingNoHitCounter

func (spell *Spell) OutcomeHealingNoHitCounter(_ *Simulation, result *SpellResult, _ *AttackTable)

func (*Spell) OutcomeMagicCrit

func (spell *Spell) OutcomeMagicCrit(sim *Simulation, result *SpellResult, at *AttackTable)

func (*Spell) OutcomeMagicCritNoHitCounter

func (spell *Spell) OutcomeMagicCritNoHitCounter(sim *Simulation, result *SpellResult, at *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) OutcomeMagicHitAndCritNoHitCounter

func (spell *Spell) OutcomeMagicHitAndCritNoHitCounter(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeMagicHitNoHitCounter

func (spell *Spell) OutcomeMagicHitNoHitCounter(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeMeleeSpecialBlockAndCrit

func (spell *Spell) OutcomeMeleeSpecialBlockAndCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeMeleeSpecialBlockAndCritNoHitCounter

func (spell *Spell) OutcomeMeleeSpecialBlockAndCritNoHitCounter(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeMeleeSpecialCritOnly

func (spell *Spell) OutcomeMeleeSpecialCritOnly(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeMeleeSpecialCritOnlyNoHitCounter

func (spell *Spell) OutcomeMeleeSpecialCritOnlyNoHitCounter(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeMeleeSpecialHit

func (spell *Spell) OutcomeMeleeSpecialHit(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeMeleeSpecialHitAndCrit

func (spell *Spell) OutcomeMeleeSpecialHitAndCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)

The table of a school-damage special (effect 2): block and crit roll separately, so a blocked hit can crit. A weapon-damage special (effects 17, 31, 58, 121) takes the weapon variant, where a block stops the crit as on white hits; the damage effect type picks between them.

func (*Spell) OutcomeMeleeSpecialHitAndCritNoHitCounter

func (spell *Spell) OutcomeMeleeSpecialHitAndCritNoHitCounter(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeMeleeSpecialHitNoHitCounter

func (spell *Spell) OutcomeMeleeSpecialHitNoHitCounter(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeMeleeWeaponSpecialHitAndCrit

func (spell *Spell) OutcomeMeleeWeaponSpecialHitAndCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeMeleeWeaponSpecialHitAndCritNoHitCounter

func (spell *Spell) OutcomeMeleeWeaponSpecialHitAndCritNoHitCounter(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeMeleeWeaponSpecialNoCrit

func (spell *Spell) OutcomeMeleeWeaponSpecialNoCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeMeleeWeaponSpecialNoCritNoHitCounter

func (spell *Spell) OutcomeMeleeWeaponSpecialNoCritNoHitCounter(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeMeleeWeaponSpecialNoParry

func (spell *Spell) OutcomeMeleeWeaponSpecialNoParry(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeMeleeWeaponSpecialNoParryNoHitCounter

func (spell *Spell) OutcomeMeleeWeaponSpecialNoParryNoHitCounter(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeMeleeWhite

func (spell *Spell) OutcomeMeleeWhite(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeMeleeWhiteNoHitCounter

func (spell *Spell) OutcomeMeleeWhiteNoHitCounter(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeRangedCritOnly

func (spell *Spell) OutcomeRangedCritOnly(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeRangedCritOnlyNoHitCounter

func (spell *Spell) OutcomeRangedCritOnlyNoHitCounter(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) OutcomeRangedHitAndCritNoBlock

func (spell *Spell) OutcomeRangedHitAndCritNoBlock(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeRangedHitAndCritNoBlockNoHitCounter

func (spell *Spell) OutcomeRangedHitAndCritNoBlockNoHitCounter(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeRangedHitAndCritNoHitCounter

func (spell *Spell) OutcomeRangedHitAndCritNoHitCounter(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeRangedHitAndMagicCrit

func (spell *Spell) OutcomeRangedHitAndMagicCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)

Rolls the hand's weapon miss, which physical and ranged hit lower, then the caster's spell crit, for the spell's own crit multiplier: a wand shot.

func (*Spell) OutcomeRangedHitNoHitCounter

func (spell *Spell) OutcomeRangedHitNoHitCounter(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeTickHealingCrit

func (spell *Spell) OutcomeTickHealingCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)

A heal tick rolls no hit, only the healing crit.

func (*Spell) OutcomeTickMagicCrit

func (spell *Spell) OutcomeTickMagicCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)

A tick of a damage over time whose hit was rolled when it was applied: only the spell crit.

func (*Spell) OutcomeTickMagicHitAndCrit

func (spell *Spell) OutcomeTickMagicHitAndCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeTickMagicHitNoHitCounter

func (spell *Spell) OutcomeTickMagicHitNoHitCounter(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeTickPhysicalCrit

func (spell *Spell) OutcomeTickPhysicalCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) PhysicalCritChance

func (spell *Spell) PhysicalCritChance(attackTable *AttackTable) float64

func (*Spell) PhysicalCritCheck

func (spell *Spell) PhysicalCritCheck(sim *Simulation, attackTable *AttackTable) bool

func (*Spell) PhysicalHitChance

func (spell *Spell) PhysicalHitChance(attackTable *AttackTable) float64

func (*Spell) PhysicalHitCheck

func (spell *Spell) PhysicalHitCheck(sim *Simulation, attackTable *AttackTable) bool

func (*Spell) Proc

func (spell *Spell) Proc(sim *Simulation, target *Unit)

Procs a spell, circumventing all checks, cooldowns, gcd's and so on Simply logging the cast and applying the effect Can be used for spells that proc off other spells and are the same spell id

func (*Spell) RageMetrics

func (spell *Spell) RageMetrics() *ResourceMetrics

func (*Spell) RangedAttackPower

func (spell *Spell) RangedAttackPower(target *Unit) float64

func (*Spell) ReadyAt

func (spell *Spell) ReadyAt() time.Duration

func (*Spell) RecordCustomMetric

func (spell *Spell) RecordCustomMetric(target *Unit, key string, value float64)

Feeds the named range in this spell's details, for values the hit kinds do not cover.

func (*Spell) RecordShielding

func (spell *Spell) RecordShielding(target *Unit, amount float64)

Credits an absorbed or applied amount to the spell's shielding total and its shield range.

func (*Spell) RefreshCharge

func (spell *Spell) RefreshCharge(sim *Simulation)

Refreshes a charge of the spell Can be called if the spell has max charges

func (*Spell) RegisterTravelTimeCallback

func (spell *Spell) RegisterTravelTimeCallback(sim *Simulation, travelTime time.Duration, callback func(*Simulation))

RegisterTravelTimeCallback is used when there is a need for custom timing on NextActionAt otherwise use WaitTravelTime

func (*Spell) ResistanceMultiplier

func (spell *Spell) ResistanceMultiplier(sim *Simulation, isPeriodic bool, attackTable *AttackTable) (float64, HitOutcome)

Modifies damage based on Armor or Magic resistances, depending on the damage type.

func (*Spell) SelfHot

func (spell *Spell) SelfHot() *Dot

func (*Spell) SelfShield

func (spell *Spell) SelfShield() *Shield

func (*Spell) SetMetricsSplit

func (spell *Spell) SetMetricsSplit(splitIdx int32)

func (*Spell) SetSpellSchool

func (spell *Spell) SetSpellSchool(school SpellSchool)

Changes the spell's school, for a spell that takes its weapon's, and moves it into or out of the school-filtered mods it now passes or fails.

func (*Spell) Shield

func (spell *Spell) Shield(target *Unit) *Shield

func (*Spell) ShouldRefreshExclusiveEffects

func (spell *Spell) ShouldRefreshExclusiveEffects(sim *Simulation, target *Unit, refreshWindow time.Duration) bool

func (*Spell) SkipCastAndApplyEffects

func (spell *Spell) SkipCastAndApplyEffects(sim *Simulation, target *Unit)

Skips the actual cast and applies spell effects immediately.

func (*Spell) SpellChanceToMiss

func (spell *Spell) SpellChanceToMiss(attackTable *AttackTable) float64

func (*Spell) SpellCritChance

func (spell *Spell) SpellCritChance(target *Unit) float64

func (*Spell) SpellDamage

func (spell *Spell) SpellDamage(target *Unit) float64

func (*Spell) SpellHitChance

func (spell *Spell) SpellHitChance(target *Unit) float64

func (*Spell) SpellSchoolBonusDamage

func (spell *Spell) SpellSchoolBonusDamage() float64

func (*Spell) TargetDamageMultiplier

func (spell *Spell) TargetDamageMultiplier(sim *Simulation, attackTable *AttackTable, isPeriodic bool) float64

func (*Spell) ThreatFromDamage

func (spell *Spell) ThreatFromDamage(sim *Simulation, outcome HitOutcome, damage float64, attackTable *AttackTable) float64

A hit or tick takes the threat multiplier in force when it lands (EV-0037).

func (*Spell) TickAllDotsOnce

func (spell *Spell) TickAllDotsOnce(sim *Simulation)

func (*Spell) TimeToReady

func (spell *Spell) TimeToReady(sim *Simulation) time.Duration

func (*Spell) TravelTime

func (spell *Spell) TravelTime() time.Duration

func (*Spell) WaitTravelTime

func (spell *Spell) WaitTravelTime(sim *Simulation, callback func(*Simulation))

WaitTravelTime calls RegisterTravelTimeCallback

type SpellConfig

type SpellConfig struct {
	// See definition of Spell (below) for comments on these.
	ActionID
	SpellSchool    SpellSchool
	DefenseType    DefenseType
	ProcMask       ProcMask
	Flags          SpellFlag
	BaseCost       float64
	MetricSplits   int
	ClassSpellMask int64
	ClassFlags     ClassFlags
	Rank           int32

	MissileSpeed       float64
	MissileMinDuration time.Duration

	ManaCost   ManaCostOptions
	EnergyCost EnergyCostOptions
	RageCost   RageCostOptions
	FocusCost  FocusCostOptions

	Cast               CastConfig
	ExtraCastCondition CanCastCondition
	CastRequirement    CastRequirement
	MenuGroup          string // A manual APL menu group, rotation_tab.apl.submenus keys joined by dots (spell.cat.stealth).

	// Optional range constraints. If supplied, these are used to modify the ExtraCastCondition above to additionally check for DistanceFromTarget.
	MinRange     float64
	MaxRange     float64
	Charges      int // The maximum amount of charges this spell can have
	RechargeTime time.Duration

	BonusHitPercent       float64
	BonusCritPercent      float64
	BonusSpellDamage      float64
	BonusExpertisePercent float64

	DamageMultiplier         float64
	DamageMultiplierAdditive float64
	CritMultiplierAdditive   float64 // Additive extra crit damage %

	BonusBaseDamage       float64 // Certain items can increase the base damage of a spell e.g. https://www.wowhead.com/forever/item=28248/totem-of-the-void
	BonusCoefficient      float64 // EffectBonusCoefficient in the game files' SpellEffect table, "SP mod" on Wowhead (not necessarily shown there even if > 0)
	DirectVariance        float64 // EffectVariance of a spell-school hit or a heal: the direct amount, power included, lands within ±DirectVariance/2 of itself.
	TakenBonusCoefficient float64 // The coefficient the target's flat school bonus is taken at by a spell that sets no BonusCoefficient because it adds its spell power by hand.
	VersusBonus           *VersusBonus

	ThreatMultiplier float64

	FlatThreatBonus     float64
	ThreatAPCoefficient float64

	// Performs the actions of this spell.
	ApplyEffects ApplySpellResults

	// Optional field. Calculates expected average damage.
	ExpectedInitialDamage ExpectedDamageCalculator
	ExpectedTickDamage    ExpectedDamageCalculator

	Dot    DotConfig
	Hot    DotConfig
	Shield ShieldConfig

	RelatedAuraArrays LabeledAuraArrays
	RelatedDotSpell   *Spell
	RelatedSelfBuff   *Aura

	Source ActionSource // Left unset, registration fills in the phase it runs in.
}

type SpellCost

type SpellCost struct {
	BaseCost                int32   // The base power cost before all modifiers.
	FlatModifier            int32   // Flat value added to base cost before pct mods
	PercentModifier         float64 // Multiplier for cost, as of MoP a float
	AdditivePercentModifier float64 // Additive pct cost bucket: defaults to 1, additive pct mods sum into it

	ResourceCostImpl
	// contains filtered or unexported fields
}

func (*SpellCost) ApplyCostModifiers

func (sc *SpellCost) ApplyCostModifiers(cost int32) float64

func (*SpellCost) GetCurrentCost

func (sc *SpellCost) GetCurrentCost() float64

Get power cost after all modifiers.

type SpellFlag

type SpellFlag uint64

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                            // Its periodic physical damage meets the target's whole armor; spelldata.SpellConfig sets it from the row (EV-0194).
	SpellFlagNoActiveDefense                                // The physical hit roll skips dodge, parry and block.
	SpellFlagIncludeTargetBonusDamage                       // Spell benefits from Gift of Arthas and Hemorrhage.
	SpellFlagBinary                                         // The hit roll resists it in full at the target's average resist, and a landed one takes no partial resist; a physical one is blocked whole. spelldata.SpellConfig sets it from the row.
	SpellFlagChanneled                                      // Spell is channeled
	SpellFlagDisease                                        // Spell is categorized as disease
	SpellFlagPoison                                         // Spell is categorized as poison
	SpellFlagHauntSE                                        // Spell benefits from haunt/SE effects
	SpellFlagHelpful                                        // For healing spells / buffs.
	SpellFlagMeleeMetrics                                   // Marks a spell as a melee ability for metrics.
	SpellFlagNoOnCastComplete                               // Disables the OnCastComplete callback.
	SpellFlagNoMetrics                                      // Disables metrics for a spell.
	SpellFlagNoLogs                                         // Disables logs for a spell.
	SpellFlagAPL                                            // Indicates this spell can be used from an APL rotation.
	SpellFlagMCD                                            // Indicates this spell is a MajorCooldown.
	SpellFlagReactive                                       // Allows a spell flagged as an MCD to be cast off-GCD. Used for instant cast defensive CDs.
	SpellFlagNoOnDamageDealt                                // Disables the damage callbacks for this spell, dealt and taken alike: OnCastResult, OnSpellHitDealt, OnPeriodicDamageDealt, OnSpellHitTaken and OnPeriodicDamageTaken.
	SpellFlagPrepullOnly                                    // Indicates this spell should only be used during prepull. Not enforced, just a signal for the APL UI.
	SpellFlagEncounterOnly                                  // Indicates this spell should only be used during the encounter (not prepull). Not enforced, just a signal for the APL UI.
	SpellFlagPotion                                         // Indicates this spell is a potion spell.
	SpellFlagConjured                                       // Indicates this spell is a conjured item spell.
	SpellFlagExplosive                                      // Indicates this spell is an engineering explosive.
	SpellFlagNoSpellMods                                    // Indicates that no spell mods should be applied to this spell
	SpellFlagCanCastWhileMoving                             // Allows the cast to be casted while moving
	SpellFlagPassiveSpell                                   // Indicates this spell is applied/cast as a result of another spell
	SpellFlagSuppressWeaponProcs                            // The Suppress Weapon Procs attribute (Attributes[4] 0x800000): weapon procs, and auras marked "aura is weapon proc", ignore this spell's hits. In TBC that is Seal of Blood, Righteousness and Martyr damage plus a few CC spells.
	SpellFlagSuppressCasterProcs                            // The Suppress Caster Procs attribute (Attributes[3] 0x10000): no ProcTrigger on the caster hears the spell's cast completing, hits, ticks or heals, which still land in full, e.g. Warblade of Caer Darrow's on-hit (EV-0165). No listener the sim builds can proc from suppressed spells (Attributes[7], [12]), so those attributes are not read.
	SpellFlagSuppressTargetProcs                            // The Suppress Target Procs attribute (Attributes[3] 0x20000): no ProcTrigger on the target hears the spell's hits or ticks, which still land in full.
	SpellFlagProc                                           // Not a DBC attribute. The spell is cast by an aura or item effect and lacks Not a Proc (Attributes[3] 0x200), so aura procs only hear its hits when they can proc from procs. Weapon procs do not care.
	SpellFlagSupressDoTApply                                // If present this spell will not apply dots (Used for DTR dot supression)
	SpellFlagSwapped                                        // Indicates that this spell is not useable because it is from a currently swapped item
	SpellFlagCastWhileIncapacitated                         // Allows the cast while the unit is incapacitated, e.g. Berserker Rage breaking a Fear.
	SpellFlagFullResistanceTicks                            // Its ticks meet the target's full resistance, as direct hits do, where other ticks, a channel's included, meet a tenth; a binary spell's ticks then take the Spell Piercing bonus in full (EV-0142).
	SpellFlagTenthResistance                                // Its hits roll their partial resist against a tenth of the target's average resist, as most ticks do, and take no Spell Piercing bonus, e.g. Flamestrike's ground ticks. Its periodic physical damage meets a tenth of the target's armor, after armor penetration; spelldata.SpellConfig sets it from the row, and SpellFlagApplyArmorReduction wins (EV-0194).
	SpellFlagNoPartialResist                                // The spell's hits never lose damage to a partial resist and gain no Spell Piercing bonus, binary or not (EV-0142).
	SpellFlagNoSpellPiercing                                // The caster's Spell Piercing does not reach its hits, e.g. Magma Totem's and Searing Totem's attacks (EV-0142).
	SpellFlagPushback                                       // Damage taken while hardcasting pushes the cast back: SpellInterrupts.InterruptFlags 0x2.
	SpellFlagKeepsSwingTimer                                // Completing a cast of the spell leaves the melee swing timer running: Do Not Reset Combat Timers (Attributes[2] 0x20000), or an explosive.
	SpellFlagDropsQueuedSwing                               // Starting a cast of the spell drops the attack queued for the next swing, e.g. a thrown dynamite.
	SpellFlagBleed                                          // A bleed: the whole cast misses a bleed-immune target, and its Dot does not land there.
	SpellFlagStun                                           // The spell's mechanic is stun (SpellCategories.Mechanic 12): the whole cast misses a stun-immune target.
	SpellFlagMovesToTarget                                  // The cast moves the caster toward its target, e.g. Charge or Blink. Not enforced, just a signal for the APL validation.
	SpellFlagPhysicalSchoolDamage                           // A physical row that deals school damage: it takes the caster's flat physical damage bonus at its BonusCoefficient, where a weapon strike takes it whole.
	SpellFlagIgnoreTargetSchoolBonus                        // The target's flat school bonus (Judgement of the Crusader) and the caster's spell damage against the target's creature type (an item's mob type stats, e.g. Courier's Clasp; EV-0141) add nothing to the spell's hits, though its other spell power applies at its coefficient: a damage shield.
	SpellFlagNoDamageVersus                                 // The caster's damage against a creature type (aura 168, e.g. Beast Slaying) adds nothing to the spell's hits, though its other damage done multipliers apply: a totem's attack.
	SpellFlagCountsAsSwing                                  // Its hits count as main-hand melee swings: landed ones grant rage as an auto attack's do, and a listener with HearsCountedSwings hears them, e.g. a Windfury Totem hit.
	SpellFlagTicksAreCasts                                  // Its ticks are the hits of a spell its aura casts each period, so they reach a listener as casts do (canProcFrom). spelldata.SpellConfig sets it from the row (EV-0226).

	// Used to let agents categorize their spells.
	SpellFlagAgentReserved1
	SpellFlagAgentReserved2
	SpellFlagAgentReserved3
	SpellFlagAgentReserved4

	SpellFlagIgnoreModifiers = SpellFlagIgnoreAttackerModifiers | SpellFlagIgnoreTargetModifiers
)

func (SpellFlag) Matches

func (se SpellFlag) Matches(other SpellFlag) bool

Returns whether there is any overlap between the given masks.

func (SpellFlag) String

func (i SpellFlag) String() string

type SpellMetrics

type SpellMetrics struct {
	Casts             int32
	ManualCasts       int32 // Presses by the rotation or a major cooldown, one per press however many targets it hits.
	Misses            int32
	TickMisses        int32
	Hits              int32
	ResistedHits      int32
	PiercedHits       int32
	Crits             int32
	ResistedCrits     int32
	PiercedCrits      int32
	Ticks             int32
	ResistedTicks     int32
	PiercedTicks      int32
	CritTicks         int32
	ResistedCritTicks int32
	PiercedCritTicks  int32
	Crushes           int32
	Dodges            int32
	Parries           int32
	Glances           int32
	Blocks            int32
	BlockedCrits      int32

	TotalDamage                 float64 // Damage done by all casts of this spell.
	TotalResistedDamage         float64 // Damage done by all resisted casts of this spell.
	TotalPiercedDamage          float64 // Damage done by all pierced casts of this spell.
	TotalCritDamage             float64 // Damage done by all critical casts of this spell.
	TotalResistedCritDamage     float64 // Damage done by all resisted critical casts of this spell.
	TotalPiercedCritDamage      float64 // Damage done by all pierced critical casts of this spell.
	TotalTickDamage             float64 // Damage done by all dots of this spell.
	TotalResistedTickDamage     float64 // Damage done by all resisted dots of this spell.
	TotalPiercedTickDamage      float64 // Damage done by all pierced dots of this spell.
	TotalCritTickDamage         float64 // Damage done by all critical dots of this spell.
	TotalResistedCritTickDamage float64 // Damage done by all resisted critical dots of this spell.
	TotalPiercedCritTickDamage  float64 // Damage done by all pierced critical dots of this spell.
	TotalGlanceDamage           float64 // Damage done by all glance casts of this spell.
	TotalBlockDamage            float64 // Damage done by all block casts of this spell.
	TotalBlockedCritDamage      float64 // Damage done by all blocked critical casts casts of this spell.
	TotalCrushDamage            float64 // Damage done by all crushed casts of this spell.
	TotalThreat                 float64 // Threat generated by all casts of this spell.
	TotalHealing                float64 // Healing done by all casts of this spell.
	TotalCritHealing            float64 // Healing done by all critical 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 SpellMod

type SpellMod struct {
	ClassMask        int64
	ClassFlags       ClassFlags
	Kind             SpellModType
	School           SpellSchool
	DefenseType      DefenseType
	MultiplierSchool SpellSchool
	ShowAsSchoolHit  SpellSchool
	ProcMask         ProcMask
	SpellFlag        SpellFlag
	ResourceType     proto.ResourceType
	Equip            EquipRequirement
	FromRating       bool

	Apply          SpellModApply
	Remove         SpellModRemove
	IsActive       bool
	AffectedSpells []*Spell
	OnReset        SpellModOnReset
	// contains filtered or unexported fields
}

func (*SpellMod) Activate

func (mod *SpellMod) Activate()

func (*SpellMod) Deactivate

func (mod *SpellMod) Deactivate()

func (*SpellMod) GetFloatValue

func (mod *SpellMod) GetFloatValue() float64

func (*SpellMod) GetIntValue

func (mod *SpellMod) GetIntValue() int32

func (*SpellMod) GetTimeValue

func (mod *SpellMod) GetTimeValue() time.Duration

func (*SpellMod) UpdateFloatValue

func (mod *SpellMod) UpdateFloatValue(value float64)

func (*SpellMod) UpdateIntValue

func (mod *SpellMod) UpdateIntValue(value int32)

func (*SpellMod) UpdateTimeValue

func (mod *SpellMod) UpdateTimeValue(value time.Duration)

type SpellModApply

type SpellModApply func(mod *SpellMod, spell *Spell)

type SpellModConfig

type SpellModConfig struct {
	ClassMask int64
	// The game files' EffectSpellClassMask: the spells this mod names. A mod that sets both this and
	// ClassMask applies only to the spells both name.
	ClassFlags        ClassFlags
	Kind              SpellModType
	School            SpellSchool
	DefenseType       DefenseType // Only apply to spells with a matching DefenseType
	MultiplierSchool  SpellSchool // Only apply to spells whose SchoolIndex reads one of these schools
	ProcMask          ProcMask
	SpellFlag         SpellFlag
	ResourceType      proto.ResourceType
	IntValue          int32
	TimeValue         time.Duration
	FloatValue        float64
	KeyValue          string
	ApplyCustom       SpellModApply
	RemoveCustom      SpellModRemove
	ResetCustom       SpellModOnReset
	ShouldApplyToPets bool

	// The weapon the attack has to be made with, as SpellEquippedItems states it. 0 is no restriction.
	EquipSubclass int32
	EquipInvType  int32
	EquipHand     ProcMask

	// A hit or crit percent mod that is a rating's worth on the attacks it reaches.
	FromRating bool

	// The schools whose hit the character sheet shows a hit mod in. It changes no spell the mod reaches.
	ShowAsSchoolHit SpellSchool
}

func (SpellModConfig) Equip

func (config SpellModConfig) Equip() EquipRequirement

The requirement the config's Equip fields name.

type SpellModFunctions

type SpellModFunctions struct {
	Apply   SpellModApply
	Remove  SpellModRemove
	OnReset SpellModOnReset
}

type SpellModOnReset

type SpellModOnReset func(mod *SpellMod)

type SpellModRemove

type SpellModRemove func(mod *SpellMod, spell *Spell)

type SpellModType

type SpellModType uint64

Mod implmentations

const (
	// Will multiply the spell.DamageDoneMultiplier. +5% = 0.05
	// Uses FloatValue
	SpellMod_DamageDone_Pct SpellModType = 1 << iota

	// Will add the value spell.DamageDoneAddMultiplier
	// Uses FloatValue
	SpellMod_DamageDone_Flat

	// Will multiply spell.Cost.PercentModifier by 1 + the value. -5% = -0.05
	// Two mods multiply, as two SPELL_AURA_ADD_PCT_MODIFIER (aura 108) SPELLMOD_COST (misc 14) rows
	// do in game. SPELL_AURA_MOD_POWER_COST_SCHOOL_PCT (aura 72) school cost rows use it too.
	// A value of -1 or lower makes the cost 0 while the mod is active.
	// Uses FloatValue
	SpellMod_PowerCost_Pct

	// Adds to spell.Cost.AdditivePercentModifier. +75% = 0.75
	// Stacks additively with other mods of this kind: bucket = 1 + sum of mods.
	// Applied on top of (multiplied with) SpellMod_PowerCost_Pct mods.
	// For a cost change the sim states by hand that adds to others of its kind; a game files row
	// takes SpellMod_PowerCost_Pct.
	// Uses FloatValue
	SpellMod_PowerCost_Pct_Add

	// Increases or decreases spell.Cost.FlatModifier by flat amount. -5 Mana = -5
	// Uses IntValue
	SpellMod_PowerCost_Flat

	// Will add time.Duration to spell.CD.Duration
	// Uses TimeValue
	SpellMod_Cooldown_Flat

	// Will multiply the spell CD multiplier. -5% = 0.95
	// Uses FloatValue
	SpellMod_Cooldown_Multiplier

	// Will increase the CritMultiplierAdditive. +100% = 1.0
	// Uses FloatValue
	SpellMod_CritMultiplier_Flat

	// Will multiply the CritMultiplierPct. +3% = 0.03
	// Uses FloatValue
	SpellMod_CritMultiplier_Pct

	// Will add / substract % amount from the cast time multiplier.
	// Ueses: FloatValue
	SpellMod_CastTime_Pct

	// Will add / substract time from the cast time.
	// Ueses: TimeValue
	SpellMod_CastTime_Flat

	// Add/subtract bonus crit %
	// Uses: FloatValue
	SpellMod_BonusCrit_Percent

	// Add/subtract bonus hit %
	// Uses: FloatValue
	SpellMod_BonusHit_Percent

	// Add/subtract to the dots max ticks
	// Uses: IntValue
	SpellMod_DotNumberOfTicks_Flat

	// Add/subtract to the casts gcd
	// Uses: TimeValue
	SpellMod_GlobalCooldown_Flat

	// Add/substrct to the base tick frequency
	// Uses: TimeValue
	SpellMod_DotTickLength_Flat

	// Add/subtract bonus coefficient
	// Uses: FloatValue
	SpellMod_BonusCoeffecient_Flat

	// Enables casting while moving
	SpellMod_AllowCastWhileMoving

	// Enables casting while channeling
	SpellMod_AllowCastWhileChanneling

	// Add/subtract bonus spell damage
	// Uses: FloatValue
	SpellMod_BonusSpellDamage_Flat

	// Add/subtract bonus expertise, in percent
	// Uses: FloatValue
	SpellMod_BonusExpertise_Percent

	// Add/subtract duration for associated debuff
	// Uses: KeyValue, TimeValue
	SpellMod_DebuffDuration_Flat

	// Add/subtract duration for associated self-buff
	// Uses: TimeValue
	SpellMod_BuffDuration_Flat

	// User-defined implementation
	// Uses: ApplyCustom | RemoveCustom
	SpellMod_Custom

	// Used to modify the amount of charges a spell has
	// Uses: IntValue
	SpellMod_ModCharges_Flat

	// Will multiply the dot.PeriodicDamageMultiplier. +5% = 0.05
	// Uses FloatValue
	SpellMod_DotDamageDone_Pct

	// Will increase the dot.BaseDurationMultiplier. +5% = 0.05
	// Uses FloatValue
	SpellMod_DotBaseDuration_Pct

	// Add/subtract bonus coefficient
	// Uses: FloatValue
	SpellMod_DotBonusCoeffecient_Flat

	// Will increase the spell.ThreatMultiplier. +5% = 0.05
	// Uses FloatValue
	SpellMod_ThreatMultiplier_Pct

	// Add/subtract base damage
	// Uses: FloatValue
	SpellMod_BaseDamage_Flat

	// Will multiply the spell.FlatThreatBonus and its attack power share. +5% = 0.05
	// Uses FloatValue
	SpellMod_FlatThreatBonus_Pct

	// Add/subtract duration from every duration the spell has: its dots and hots, its self-buff
	// and every aura array it is related to. Targets the spell does not have are left alone.
	// Uses: TimeValue
	SpellMod_Duration_Flat

	// Add/subtract to the maximum stacks of the spell's self-buff and of the stacking auras in
	// its aura arrays. Auras that do not stack stay non-stacking.
	// Uses: IntValue
	SpellMod_BuffMaxStacks_Flat

	// Add/subtract to the spell's maximum range in yards. Only spells registered with a range
	// constraint check their range at all, so the mod is inert on the others.
	// Uses: FloatValue
	SpellMod_Range_Flat

	// Will add / subtract % amount from the range multiplier. +10% = 0.1
	// Only spells registered with a range constraint check their range at all, so the mod is inert
	// on the others.
	// Uses: FloatValue
	SpellMod_Range_Pct

	// Will add the value to spell.DirectDamageMultiplierAdditive, which only direct hits and direct heals read.
	// For a direct damage change the sim states by hand that adds to others of its kind; a game files
	// SPELLMOD_DAMAGE row takes SpellMod_DirectDamageDone_Pct.
	// Uses FloatValue
	SpellMod_DirectDamageDone_Flat

	// Adds to the chance of the proc triggers whose own class flags the mod names, in percentage
	// points: 10 raises a 20% chance to 30%. It changes no spell.
	// Uses FloatValue
	SpellMod_ProcChance_Flat

	// Multiplies the chance of the proc triggers whose own class flags the mod names, once the flat
	// points are in: +100% = 1.0 doubles it. It changes no spell.
	// Uses FloatValue
	SpellMod_ProcChance_Pct

	// Will add / subtract % amount from the GCD multiplier. -10% = -0.1
	// The GCD minimum still floors the result.
	// Uses: FloatValue
	SpellMod_GlobalCooldown_Pct

	// Scales the internal cooldown of the proc triggers whose own class flags the mod names: -50% = -0.5
	// halves it. A cooldown already running keeps its length. It changes no spell.
	// Uses FloatValue
	SpellMod_ProcCooldown_Pct

	// Will multiply spell.DirectDamageMultiplier, which only direct hits and direct heals read. +5% = 0.05
	// Each mod is its own factor, as the game files' SPELL_AURA_ADD_PCT_MODIFIER (aura 108) with
	// SPELLMOD_DAMAGE (misc 0) rows are in game.
	// Uses FloatValue
	SpellMod_DirectDamageDone_Pct

	// Adds to the chance a hit does not push back the spell's hardcast: 0.7 is 70%. Two mods add.
	// Uses FloatValue
	SpellMod_PushbackProtection_Pct
)

type SpellRegisteredHandler

type SpellRegisteredHandler func(spell *Spell)

type SpellResult

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.

	ArmorAndResistanceMultiplier float64 // Armor multiplier
	PostOutcomeDamage            float64 // Damage done by this cast after Outcome is applied
	BlockedDamage                float64 // Damage a block took off this cast
	PreArmorDamage               float64 // Damage done by this cast with the Outcome's multiplier and the target's damage taken multipliers but before the target's armor, resistances, flat damage taken bonuses, block and absorbs
	// contains filtered or unexported fields
}

func (*SpellResult) BlockedInFull

func (result *SpellResult) BlockedInFull() bool

A block that takes the whole hit. A block whose remainder an absorb takes is not one, so this reads the damage the block left, before absorbs.

func (*SpellResult) DamageString

func (result *SpellResult) DamageString() string

func (*SpellResult) DidBlock

func (result *SpellResult) DidBlock() bool

func (*SpellResult) DidBlockCrit

func (result *SpellResult) DidBlockCrit() bool

func (*SpellResult) DidCrit

func (result *SpellResult) DidCrit() bool

func (*SpellResult) DidCrush

func (result *SpellResult) DidCrush() bool

func (*SpellResult) DidDodge

func (result *SpellResult) DidDodge() bool

func (*SpellResult) DidGlance

func (result *SpellResult) DidGlance() bool

func (*SpellResult) DidParry

func (result *SpellResult) DidParry() bool

func (*SpellResult) DidPierce

func (result *SpellResult) DidPierce() bool

A hit that Spell Piercing beyond the target's resistance raised.

func (*SpellResult) DidResist

func (result *SpellResult) DidResist() bool

A partial resist that took damage.

func (*SpellResult) HealingString

func (result *SpellResult) HealingString() string

func (*SpellResult) Landed

func (result *SpellResult) Landed() bool

type SpellResultCache

type SpellResultCache map[*Unit]*SpellResult

func (SpellResultCache) Get

func (resultCache SpellResultCache) Get(target *Unit) *SpellResult

type SpellResultIteration

type SpellResultIteration func(*Simulation, *Unit, float64, OutcomeApplier) *SpellResult

type SpellResultSlice

type SpellResultSlice []*SpellResult

func (SpellResultSlice) AnyLanded

func (results SpellResultSlice) AnyLanded() bool

func (SpellResultSlice) NumLandedHits

func (results SpellResultSlice) NumLandedHits() int32

type SpellSchool

type SpellSchool byte
const (
	SpellSchoolNone     SpellSchool = 0
	SpellSchoolPhysical SpellSchool = 1
	SpellSchoolHoly     SpellSchool = 2
	SpellSchoolFire     SpellSchool = 4
	SpellSchoolNature   SpellSchool = 8
	SpellSchoolFrost    SpellSchool = 16
	SpellSchoolShadow   SpellSchool = 32
	SpellSchoolArcane   SpellSchool = 64

	SpellSchoolChaos       SpellSchool = SpellSchoolArcane | SpellSchoolFire | SpellSchoolFrost | SpellSchoolHoly | SpellSchoolNature | SpellSchoolShadow
	SpellSchoolShadowFlame SpellSchool = SpellSchoolFire | SpellSchoolShadow
	SpellSchoolShadowFrost SpellSchool = SpellSchoolFrost | SpellSchoolShadow
	SpellSchoolPlague      SpellSchool = SpellSchoolNature | SpellSchoolShadow
	SpellSchoolFirestorm   SpellSchool = SpellSchoolFire | SpellSchoolNature
	SpellSchoolFrostfire   SpellSchool = SpellSchoolFire | SpellSchoolFrost
	SpellSchoolElemental   SpellSchool = SpellSchoolFire | SpellSchoolNature | SpellSchoolFrost
)

The bit values are the game files'. SpellMisc.SchoolMask uses exactly this order, so a generated spell row carries the number the DBC states rather than a translation of it. Nothing outside this file depends on the numbers: the conversions to stats.SchoolIndex, the resistance stat and the school damage stat are all switches over these names, stats.SchoolIndex is its own enum for array positions, and proto.SpellSchool is separate again.

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) MultiplierSchool

func (ss SpellSchool) MultiplierSchool() SpellSchool

The school Spell.SchoolIndex reads: the first of physical, arcane, fire, frost, holy, nature, shadow.

func (SpellSchool) PiercingStat

func (ss SpellSchool) PiercingStat() (stats.Stat, bool)

The stat a target resistance mask pierces: ArmorPenetration for physical alone and SpellPiercing for a mask of every school with a resistance. Any other mask has no stat: a mask of physical and a spell school pierces nothing, and a mask of some spell schools pierces those schools alone.

func (SpellSchool) ResistanceStat

func (ss SpellSchool) ResistanceStat() (stats.Stat, bool)

Holy has no resistance stat, and neither does a mask of several schools.

func (SpellSchool) SchoolDamage

func (ss SpellSchool) SchoolDamage() stats.Stat

func (SpellSchool) SchoolIndex

func (ss SpellSchool) SchoolIndex() stats.SchoolIndex

func (SpellSchool) String

func (i SpellSchool) String() string

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) Int63

func (sm *SplitMix64) Int63() 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)

func (*SplitMix64) Uint64

func (sm *SplitMix64) Uint64() uint64

type StackingStatAura

type StackingStatAura struct {
	Aura          Aura
	BonusPerStack stats.Stats
}

type StatBuffAura

type StatBuffAura struct {
	*Aura

	// All Stat types that are buffed (before dependencies) when this Aura
	// is activated.
	BuffedStatTypes []stats.Stat

	// Any special conditions (beyond standard ICD checks etc.) that must be
	// satisfied before this Aura can be activated.
	CustomProcCondition CustomStatBuffProcCondition

	// Whether the aura is currently swapped (in another item set) out or not.
	IsSwapped bool
}

Analog to an Aura "sub-class" that additionally links the Aura to one or more Stats. Used within APL snapshotting wrappers.

func MakeStackingAura

func MakeStackingAura(character *Character, config StackingStatAura) *StatBuffAura

func RegisterTemporaryStatsOnUseCD

func RegisterTemporaryStatsOnUseCD(character *Character, auraLabel string, tempStats stats.Stats, duration time.Duration, config SpellConfig) *StatBuffAura

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 (*StatBuffAura) BuffsMatchingStat

func (aura *StatBuffAura) BuffsMatchingStat(statTypesToMatch []stats.Stat) bool

func (*StatBuffAura) CanProc

func (aura *StatBuffAura) CanProc(sim *Simulation) bool

func (*StatBuffAura) InferCDType

func (aura *StatBuffAura) InferCDType() CooldownType

type StatMultiplier

type StatMultiplier struct {
	Stat       stats.Stat
	Multiplier float64
}

A stat an aura multiplies and the factor it multiplies it by.

type StatWeightValues

type StatWeightValues struct {
	Weights       UnitStats
	WeightsStdev  UnitStats
	EpValues      UnitStats
	EpValuesStdev UnitStats
}

func NewStatWeightValues

func NewStatWeightValues() StatWeightValues

func (*StatWeightValues) ToProto

func (swv *StatWeightValues) ToProto() *proto.StatWeightValues

type StatWeightsResult

type StatWeightsResult struct {
	Dps    StatWeightValues
	Hps    StatWeightValues
	Tps    StatWeightValues
	Dtps   StatWeightValues
	Tmi    StatWeightValues
	PDeath StatWeightValues

	SampleCounts UnitStats
	StepBelow    UnitStats
	StepAbove    UnitStats
}

func NewStatWeightsResult

func NewStatWeightsResult() *StatWeightsResult

func (*StatWeightsResult) ToProto

func (swr *StatWeightsResult) ToProto() *proto.StatWeightsResult

type SubGenerator

type SubGenerator struct {
	// contains filtered or unexported fields
}

type TalentsCombo

type TalentsCombo struct {
	Label   string
	Talents string
}

func GenerateTalentVariations

func GenerateTalentVariations(baseTalents string) []TalentsCombo

func GenerateTalentVariationsForRows

func GenerateTalentVariationsForRows(baseTalents string, rowsToVary []int) []TalentsCombo

type Target

type Target struct {
	Unit

	AI       TargetAI
	Schedule TargetSchedule // Set by the AI that spawns and despawns the target, nil for none.
	// contains filtered or unexported fields
}

Target is an enemy/boss that can be the target of player attacks/spells.

func NewTarget

func NewTarget(options *proto.Target, targetIndex int32) *Target

func (*Target) AddComboPoints

func (eb *Target) AddComboPoints(sim *Simulation, target *Unit, pointsToAdd int32, metrics *ResourceMetrics)

Combo points live on one unit. A gain on another unit drops the points held on the old one, and the gain lands on the new one; a target swap with no gain keeps them. The gain's metrics spend the dropped points, as a shapeshift's own metrics spend the rage it drops.

func (*Target) AddEnergy

func (eb *Target) AddEnergy(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*Target) AddFocus

func (fb *Target) AddFocus(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*Target) AddPartyBuffs

func (target *Target) AddPartyBuffs(_ *proto.PartyBuffs)

func (*Target) AddRage

func (rb *Target) AddRage(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*Target) AddRaidBuffs

func (target *Target) AddRaidBuffs(_ *proto.RaidBuffs)

Empty Agent interface functions.

func (*Target) ApplyRaidDebuffsAt

func (target *Target) ApplyRaidDebuffsAt(sim *Simulation, at time.Duration)

Holds the raid's debuffs until at, then puts them on as the target's reset does, each through its OnReset: a permanent debuff comes back, and Sunder Armor ramps up again. A time at or before now lands them at once. During the sim's reset, before the target's own reset has run, it only releases the hold, and that reset puts them on, so a player's Reset handler and the prepull see them.

func (*Target) ApplyTalents

func (target *Target) ApplyTalents()

func (*Target) ComboPoints

func (eb *Target) ComboPoints(target *Unit) int32

The combo points on target: none unless target holds them.

func (*Target) CurrentEnergy

func (eb *Target) CurrentEnergy() float64

func (*Target) CurrentEnergyRegenMultiplier

func (eb *Target) CurrentEnergyRegenMultiplier() 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) Die

func (target *Target) Die(sim *Simulation, killShare float64)

Kills the target. One roll on the death rand against killShare decides whether the raid gets the kill; a share of 0 or 1 settles it without a draw. Every player's and pet's OnTargetDies runs first, then OnKill when the raid gets the kill, and the target is disabled last, so its debuffs and the channels on it are still there while the callbacks run. A disabled target does not die again.

func (*Target) DiesAt

func (target *Target) DiesAt(sim *Simulation) time.Duration

The schedule's despawn, at the latest the fight's end. Without one, the fight's end for a target that is or will be active, else NeverExpires.

func (*Target) Disable

func (target *Target) Disable(sim *Simulation, expireAuras bool)

func (*Target) DisableRaidDebuffs

func (target *Target) DisableRaidDebuffs(sim *Simulation)

Takes the raid's debuffs off the target and keeps them off until ApplyRaidDebuffsAt lands them, through the target's reset when the disable comes during the sim's reset. A landing still to come is cancelled. Disable leaves a permanent aura on, so a target AI disables the debuffs of a target it takes away.

func (*Target) Enable

func (target *Target) Enable(sim *Simulation)

func (*Target) EndOOMEvent

func (mb *Target) EndOOMEvent(sim *Simulation)

func (*Target) ExecuteCustomRotation

func (target *Target) ExecuteCustomRotation(sim *Simulation)

func (*Target) GainHealth

func (hb *Target) GainHealth(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*Target) GetActiveAuraWithTag

func (at *Target) GetActiveAuraWithTag(tag string) *Aura

func (*Target) GetAura

func (at *Target) GetAura(label string) *Aura

func (*Target) GetAuraByID

func (at *Target) GetAuraByID(actionID ActionID) *Aura

func (*Target) GetAuras

func (at *Target) GetAuras() []*Aura

func (*Target) GetAurasWithTag

func (at *Target) GetAurasWithTag(tag string) []*Aura

func (*Target) GetCharacter

func (target *Target) GetCharacter() *Character

func (*Target) GetIcdAuraByID

func (at *Target) GetIcdAuraByID(actionID ActionID) *Aura

func (*Target) GetMetricsProto

func (target *Target) GetMetricsProto() *proto.UnitMetrics

func (*Target) HasActiveAura

func (at *Target) HasActiveAura(label string) bool

func (*Target) HasActiveAuraWithTag

func (at *Target) HasActiveAuraWithTag(tag string) bool

func (*Target) HasActiveAuraWithTagExcludingAura

func (at *Target) HasActiveAuraWithTagExcludingAura(tag string, excludeAura *Aura) bool

func (*Target) HasAura

func (at *Target) HasAura(label string) bool

func (*Target) HasAuraWithTag

func (at *Target) HasAuraWithTag(tag string) bool

func (*Target) Initialize

func (target *Target) Initialize()

func (*Target) IsOOM

func (mb *Target) IsOOM() bool

func (*Target) IsReset

func (eb *Target) IsReset(sim *Simulation) bool

func (*Target) MaxComboPoints

func (eb *Target) MaxComboPoints() int32

func (*Target) MaxHealth

func (hb *Target) MaxHealth() float64

func (*Target) MaximumEnergy

func (eb *Target) MaximumEnergy() float64

func (*Target) MaximumRage

func (rb *Target) MaximumRage() float64

func (*Target) MultiplyDamageTakenRageGen

func (rb *Target) MultiplyDamageTakenRageGen(multiplier float64)

func (*Target) MultiplyEnergyRegenSpeed

func (eb *Target) MultiplyEnergyRegenSpeed(sim *Simulation, multiplier float64)

func (*Target) MultiplyFocusRegenSpeed added in v1.0.12

func (fb *Target) MultiplyFocusRegenSpeed(multiplier float64)

func (*Target) NextActiveAt

func (target *Target) NextActiveAt(sim *Simulation) time.Duration

The current time while the target is enabled; else its schedule's next spawn, or NeverExpires with none.

func (*Target) NextActiveTarget

func (target *Target) NextActiveTarget() *Target

The first enabled target after this one in index order, wrapping around and ending on this one; nil when no target is enabled.

func (*Target) NextEnergyTickAt

func (eb *Target) NextEnergyTickAt() time.Duration

func (*Target) NumActiveAurasWithTag

func (at *Target) NumActiveAurasWithTag(tag string) int32

func (*Target) OnApplyEffects

func (at *Target) OnApplyEffects(sim *Simulation, target *Unit, spell *Spell)

Invokes the OnApplyEffects event for all tracked Auras.

func (*Target) OnCastComplete

func (at *Target) OnCastComplete(sim *Simulation, spell *Spell)

Invokes the OnCastComplete event for all tracked Auras.

func (*Target) OnCastResult

func (at *Target) OnCastResult(sim *Simulation, spell *Spell, result *SpellResult)

func (*Target) OnEncounterStart

func (target *Target) OnEncounterStart(_ *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) OnKill

func (at *Target) OnKill(sim *Simulation, target *Unit)

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) OnTargetDies

func (at *Target) OnTargetDies(sim *Simulation, target *Unit)

func (*Target) PreviousActiveTarget

func (target *Target) PreviousActiveTarget() *Target

The first enabled target before this one in index order, wrapping around and ending on this one; nil when no target is enabled.

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)

Health lost to damage taken, booked under Damage Taken and counted in TMI on a tanking unit.

func (*Target) Reset

func (target *Target) Reset(sim *Simulation)

func (*Target) ResetComboPoints

func (eb *Target) ResetComboPoints(sim *Simulation, target *Unit, comboPointsToKeep int32)

func (*Target) ResetEnergyTick

func (eb *Target) ResetEnergyTick(sim *Simulation)

Gives an immediate partial energy tick and restarts the tick timer.

func (*Target) ResetRageBar

func (rb *Target) ResetRageBar(sim *Simulation, rageToKeep float64)

func (*Target) SetCurrentHealthPercent

func (hb *Target) SetCurrentHealthPercent(percent float64)

Puts current health at a share of the maximum with no healing or damage, so no metrics or TMI entry move. A druid's change of form moves the maximum and keeps the share.

func (*Target) SetMaxComboPoints

func (eb *Target) SetMaxComboPoints(maxComboPoints int32)

func (*Target) SetMaximumEnergy

func (eb *Target) SetMaximumEnergy(sim *Simulation, maxEnergy float64, metrics *ResourceMetrics)

Sets the most energy the bar holds. A raised maximum grants no energy; energy above a lowered one is lost and counted against the metrics. Without a Simulation there is no energy yet to lose.

func (*Target) SetMaximumRage

func (rb *Target) SetMaximumRage(sim *Simulation, maxRage float64, metrics *ResourceMetrics)

Sets the most rage the bar holds. A raised maximum grants no rage; rage above a lowered one is lost and counted against the metrics. Without a Simulation there is no rage yet to lose.

func (*Target) SetOffHandRageMultiplier

func (rb *Target) SetOffHandRageMultiplier(multiplier float64)

func (*Target) SkipForMana

func (mb *Target) SkipForMana()

For a rotation that checks a mana cost itself: the current pass skips a spell it wants for its cost.

func (*Target) SpendComboPoints

func (eb *Target) SpendComboPoints(sim *Simulation, target *Unit, metrics *ResourceMetrics)

func (*Target) SpendEnergy

func (eb *Target) SpendEnergy(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*Target) SpendFocus

func (fb *Target) SpendFocus(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*Target) SpendHealth

func (hb *Target) SpendHealth(sim *Simulation, amount float64, metrics *ResourceMetrics)

Health a spell takes from its own caster as a cost, booked under the spell's metrics. A self cost is not damage taken, so it adds no TMI entry.

func (*Target) SpendPartialComboPoints

func (eb *Target) SpendPartialComboPoints(sim *Simulation, target *Unit, pointsToSpend int32, metrics *ResourceMetrics)

A spend on a unit that holds no combo points spends none.

func (*Target) SpendRage

func (rb *Target) SpendRage(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*Target) StartOOMEvent

func (mb *Target) StartOOMEvent(sim *Simulation)

Pets keep no OOM metrics, so they never go OOM.

func (*Target) TimeToNextEnergyTick

func (eb *Target) TimeToNextEnergyTick(sim *Simulation) time.Duration

func (*Target) TimeToTargetEnergy

func (eb *Target) TimeToTargetEnergy(sim *Simulation, targetEnergy float64) time.Duration

func (*Target) UpdateMaxEnergy

func (eb *Target) UpdateMaxEnergy(sim *Simulation, bonusEnergy float64, metrics *ResourceMetrics)

Used for dynamic updates to maximum Energy, such as from the Druid Primal Madness talent

func (*Target) UpdateMaxHealth

func (hb *Target) UpdateMaxHealth(sim *Simulation, bonusHealth float64, metrics *ResourceMetrics)

Used for dynamic updates to maximum health from "Last Stand" effects

type TargetAI

type TargetAI interface {
	Initialize(*Target, *proto.Target)
	Reset(*Simulation)
	ExecuteCustomRotation(*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, target *Unit, pointsToAdd int32, metrics *ResourceMetrics)

Combo points live on one unit. A gain on another unit drops the points held on the old one, and the gain lands on the new one; a target swap with no gain keeps them. The gain's metrics spend the dropped points, as a shapeshift's own metrics spend the rage it drops.

func (*TargetDummy) AddEnergy

func (eb *TargetDummy) AddEnergy(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*TargetDummy) AddFocus

func (fb *TargetDummy) AddFocus(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) ApplyTalents

func (td *TargetDummy) ApplyTalents()

func (*TargetDummy) ComboPoints

func (eb *TargetDummy) ComboPoints(target *Unit) int32

The combo points on target: none unless target holds them.

func (*TargetDummy) CurrentEnergy

func (eb *TargetDummy) CurrentEnergy() float64

func (*TargetDummy) CurrentEnergyRegenMultiplier

func (eb *TargetDummy) CurrentEnergyRegenMultiplier() 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) EndOOMEvent

func (mb *TargetDummy) EndOOMEvent(sim *Simulation)

func (*TargetDummy) ExecuteCustomRotation

func (td *TargetDummy) ExecuteCustomRotation(sim *Simulation)

func (*TargetDummy) GainHealth

func (hb *TargetDummy) GainHealth(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*TargetDummy) GetActiveAuraWithTag

func (at *TargetDummy) GetActiveAuraWithTag(tag string) *Aura

func (*TargetDummy) GetAura

func (at *TargetDummy) GetAura(label string) *Aura

func (*TargetDummy) GetAuraByID

func (at *TargetDummy) GetAuraByID(actionID ActionID) *Aura

func (*TargetDummy) GetAuras

func (at *TargetDummy) GetAuras() []*Aura

func (*TargetDummy) GetAurasWithTag

func (at *TargetDummy) GetAurasWithTag(tag string) []*Aura

func (*TargetDummy) GetCharacter

func (td *TargetDummy) GetCharacter() *Character

func (*TargetDummy) GetIcdAuraByID

func (at *TargetDummy) GetIcdAuraByID(actionID ActionID) *Aura

func (*TargetDummy) GetInitialMajorCooldown

func (mcdm *TargetDummy) GetInitialMajorCooldown(actionID ActionID) MajorCooldown

func (*TargetDummy) GetMajorCooldown

func (mcdm *TargetDummy) GetMajorCooldown(actionID ActionID) *MajorCooldown

func (*TargetDummy) GetMajorCooldownIDs

func (mcdm *TargetDummy) GetMajorCooldownIDs() []*proto.ActionID

func (*TargetDummy) GetMajorCooldownIgnoreTag

func (mcdm *TargetDummy) GetMajorCooldownIgnoreTag(actionID ActionID) *MajorCooldown

func (*TargetDummy) GetMajorCooldowns

func (mcdm *TargetDummy) GetMajorCooldowns() []*MajorCooldown

Returns all MCDs.

func (*TargetDummy) GetMatchingStatBuffCooldownAuras

func (mcdm *TargetDummy) GetMatchingStatBuffCooldownAuras(statTypesToMatch []stats.Stat) []*StatBuffAura

func (*TargetDummy) GetMatchingStatBuffSpells

func (mcdm *TargetDummy) GetMatchingStatBuffSpells(statTypesToMatch []stats.Stat) []*Spell

func (*TargetDummy) HasActiveAura

func (at *TargetDummy) HasActiveAura(label string) bool

func (*TargetDummy) HasActiveAuraWithTag

func (at *TargetDummy) HasActiveAuraWithTag(tag string) bool

func (*TargetDummy) HasActiveAuraWithTagExcludingAura

func (at *TargetDummy) HasActiveAuraWithTagExcludingAura(tag string, excludeAura *Aura) bool

func (*TargetDummy) HasAura

func (at *TargetDummy) HasAura(label string) bool

func (*TargetDummy) HasAuraWithTag

func (at *TargetDummy) HasAuraWithTag(tag string) bool

func (*TargetDummy) Initialize

func (td *TargetDummy) Initialize()

func (*TargetDummy) IsOOM

func (mb *TargetDummy) IsOOM() bool

func (*TargetDummy) IsReset

func (eb *TargetDummy) IsReset(sim *Simulation) bool

func (*TargetDummy) MaxComboPoints

func (eb *TargetDummy) MaxComboPoints() int32

func (*TargetDummy) MaxHealth

func (hb *TargetDummy) MaxHealth() float64

func (*TargetDummy) MaximumEnergy

func (eb *TargetDummy) MaximumEnergy() float64

func (*TargetDummy) MaximumRage

func (rb *TargetDummy) MaximumRage() float64

func (*TargetDummy) MultiplyDamageTakenRageGen

func (rb *TargetDummy) MultiplyDamageTakenRageGen(multiplier float64)

func (*TargetDummy) MultiplyEnergyRegenSpeed

func (eb *TargetDummy) MultiplyEnergyRegenSpeed(sim *Simulation, multiplier float64)

func (*TargetDummy) MultiplyFocusRegenSpeed added in v1.0.12

func (fb *TargetDummy) MultiplyFocusRegenSpeed(multiplier float64)

func (*TargetDummy) NextEnergyTickAt

func (eb *TargetDummy) NextEnergyTickAt() time.Duration

func (*TargetDummy) NumActiveAurasWithTag

func (at *TargetDummy) NumActiveAurasWithTag(tag string) int32

func (*TargetDummy) OnApplyEffects

func (at *TargetDummy) OnApplyEffects(sim *Simulation, target *Unit, spell *Spell)

Invokes the OnApplyEffects event for all tracked Auras.

func (*TargetDummy) OnCastComplete

func (at *TargetDummy) OnCastComplete(sim *Simulation, spell *Spell)

Invokes the OnCastComplete event for all tracked Auras.

func (*TargetDummy) OnCastResult

func (at *TargetDummy) OnCastResult(sim *Simulation, spell *Spell, result *SpellResult)

func (*TargetDummy) OnEncounterStart

func (td *TargetDummy) OnEncounterStart(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) OnKill

func (at *TargetDummy) OnKill(sim *Simulation, target *Unit)

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) OnTargetDies

func (at *TargetDummy) OnTargetDies(sim *Simulation, target *Unit)

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)

Health lost to damage taken, booked under Damage Taken and counted in TMI on a tanking unit.

func (*TargetDummy) Reset

func (td *TargetDummy) Reset(sim *Simulation)

func (*TargetDummy) ResetComboPoints

func (eb *TargetDummy) ResetComboPoints(sim *Simulation, target *Unit, comboPointsToKeep int32)

func (*TargetDummy) ResetEnergyTick

func (eb *TargetDummy) ResetEnergyTick(sim *Simulation)

Gives an immediate partial energy tick and restarts the tick timer.

func (*TargetDummy) ResetRageBar

func (rb *TargetDummy) ResetRageBar(sim *Simulation, rageToKeep float64)

func (*TargetDummy) SetCurrentHealthPercent

func (hb *TargetDummy) SetCurrentHealthPercent(percent float64)

Puts current health at a share of the maximum with no healing or damage, so no metrics or TMI entry move. A druid's change of form moves the maximum and keeps the share.

func (*TargetDummy) SetMaxComboPoints

func (eb *TargetDummy) SetMaxComboPoints(maxComboPoints int32)

func (*TargetDummy) SetMaximumEnergy

func (eb *TargetDummy) SetMaximumEnergy(sim *Simulation, maxEnergy float64, metrics *ResourceMetrics)

Sets the most energy the bar holds. A raised maximum grants no energy; energy above a lowered one is lost and counted against the metrics. Without a Simulation there is no energy yet to lose.

func (*TargetDummy) SetMaximumRage

func (rb *TargetDummy) SetMaximumRage(sim *Simulation, maxRage float64, metrics *ResourceMetrics)

Sets the most rage the bar holds. A raised maximum grants no rage; rage above a lowered one is lost and counted against the metrics. Without a Simulation there is no rage yet to lose.

func (*TargetDummy) SetOffHandRageMultiplier

func (rb *TargetDummy) SetOffHandRageMultiplier(multiplier float64)

func (*TargetDummy) SkipForMana

func (mb *TargetDummy) SkipForMana()

For a rotation that checks a mana cost itself: the current pass skips a spell it wants for its cost.

func (*TargetDummy) SpendComboPoints

func (eb *TargetDummy) SpendComboPoints(sim *Simulation, target *Unit, metrics *ResourceMetrics)

func (*TargetDummy) SpendEnergy

func (eb *TargetDummy) SpendEnergy(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*TargetDummy) SpendFocus

func (fb *TargetDummy) SpendFocus(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*TargetDummy) SpendHealth

func (hb *TargetDummy) SpendHealth(sim *Simulation, amount float64, metrics *ResourceMetrics)

Health a spell takes from its own caster as a cost, booked under the spell's metrics. A self cost is not damage taken, so it adds no TMI entry.

func (*TargetDummy) SpendPartialComboPoints

func (eb *TargetDummy) SpendPartialComboPoints(sim *Simulation, target *Unit, pointsToSpend int32, metrics *ResourceMetrics)

A spend on a unit that holds no combo points spends none.

func (*TargetDummy) SpendRage

func (rb *TargetDummy) SpendRage(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*TargetDummy) StartOOMEvent

func (mb *TargetDummy) StartOOMEvent(sim *Simulation)

Pets keep no OOM metrics, so they never go OOM.

func (*TargetDummy) TimeToNextEnergyTick

func (eb *TargetDummy) TimeToNextEnergyTick(sim *Simulation) time.Duration

func (*TargetDummy) TimeToTargetEnergy

func (eb *TargetDummy) TimeToTargetEnergy(sim *Simulation, targetEnergy float64) time.Duration

func (*TargetDummy) UpdateMajorCooldowns

func (mcdm *TargetDummy) UpdateMajorCooldowns()

Re-sorts the cooldowns and caches the earliest time autocast can use one. Autocast calls it after each use, and anything else that changes a major cooldown's ready time must call it too.

func (*TargetDummy) UpdateMaxEnergy

func (eb *TargetDummy) UpdateMaxEnergy(sim *Simulation, bonusEnergy float64, metrics *ResourceMetrics)

Used for dynamic updates to maximum Energy, such as from the Druid Primal Madness talent

func (*TargetDummy) UpdateMaxHealth

func (hb *TargetDummy) UpdateMaxHealth(sim *Simulation, bonusHealth float64, metrics *ResourceMetrics)

Used for dynamic updates to maximum health from "Last Stand" effects

type TargetSchedule

type TargetSchedule interface {
	NextActiveAt(*Simulation) time.Duration // The next spawn while the target is down, NeverExpires for none.
	DiesAt(*Simulation) time.Duration       // The despawn that ends the target's current life, or the life its next spawn starts; NeverExpires for none.
}

The times an AI spawns and despawns a target, read by Target.NextActiveAt and Target.DiesAt.

type TargetedActionMetrics

type TargetedActionMetrics struct {
	UnitIndex int32

	Casts             int32
	ManualCasts       int32
	Misses            int32
	TickMisses        int32
	Hits              int32
	ResistedHits      int32
	PiercedHits       int32
	Crits             int32
	ResistedCrits     int32
	PiercedCrits      int32
	Ticks             int32
	ResistedTicks     int32
	PiercedTicks      int32
	CritTicks         int32
	ResistedCritTicks int32
	PiercedCritTicks  int32
	Crushes           int32
	Dodges            int32
	Parries           int32
	Glances           int32
	Blocks            int32
	BlockedCrits      int32

	Damage                 float64
	ResistedDamage         float64
	PiercedDamage          float64
	CritDamage             float64
	ResistedCritDamage     float64
	PiercedCritDamage      float64
	TickDamage             float64
	ResistedTickDamage     float64
	PiercedTickDamage      float64
	CritTickDamage         float64
	ResistedCritTickDamage float64
	PiercedCritTickDamage  float64
	GlanceDamage           float64
	BlockDamage            float64
	BlockedCritDamage      float64
	CrushDamage            float64
	Threat                 float64
	Healing                float64
	CritHealing            float64
	Shielding              float64
	CastTime               time.Duration
}

func (*TargetedActionMetrics) ToProto

type Task

type Task interface {
	RunTask(sim *Simulation) time.Duration
}

type TemporaryStatBuffWithStacksConfig

type TemporaryStatBuffWithStacksConfig struct {
	StackingAuraLabel    string
	StackingAuraActionID ActionID
	AuraLabel            string
	ActionID             ActionID
	BonusPerStack        stats.Stats
	MaxStacks            int32
	TimePerStack         time.Duration
	Duration             time.Duration
	TickImmediately      bool
	// Set when stacks come from an event rather than a timer. The window aura is still built and
	// still bounds the stacking aura, but nothing ticks - the caller adds stacks from its own
	// trigger. The stacking aura is then given no duration of its own and is dropped when the
	// window ends, which is what a child aura with no duration in the game files does.
	StacksFromEvent bool
}

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(configs []CharacterSuiteConfig) []TestGenerator

FullCharacterTestSuiteGenerator generates a full test suite for a character. Also accepts JSON build config, Example: core.GetTestBuildFromJSON(proto.Class_ClassWarrior, "../../../ui/specs/warrior/arms/builds", "default", ItemFilter, proto.Stat_StatStrength, nil)

type Timer

type Timer time.Duration

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) ReadyAt

func (timer *Timer) ReadyAt() time.Duration

func (*Timer) Reset

func (timer *Timer) Reset()

func (*Timer) Set

func (timer *Timer) Set(t time.Duration)

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.

	MenuGroupOrder []string // The order of the unit's APL menu groups, by full path; a group not listed follows them.

	MobType        proto.MobType
	BleedImmune    bool // A bleed misses this unit, and its Dot does not land (SpellFlagBleed).
	StunImmune     bool // A stun misses this unit whole (SpellFlagStun), and stun auras do not land: a raid boss.
	CreatureFamily proto.CreatureFamily

	// Amount of time it takes for the human agent to react to in-game events.
	// Used by certain APL values and actions.
	ReactionTime time.Duration

	// Amount of time following a post-GCD channel tick, to when the next action can be performed.
	ChannelClipDelay time.Duration

	// How far this unit is from its target(s). Measured in yards, this is used
	// for calculating spell travel time for certain spells.
	StartDistanceFromTarget float64
	DistanceFromTarget      float64
	Moving                  bool

	// 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

	// The form the unit is in, by the game files' numbering; the class writes it.
	ShapeshiftForm dbcenums.ShapeshiftForm
	// Leaves the current form, for a cast the form refuses but no form allows. Nil: none.
	AutoUnshift func(sim *Simulation)

	// All spells that can be cast by this unit.
	Spellbook []*Spell

	// Pets owned by this Unit.
	PetAgents []PetAgent

	DynamicStatsPets       []*Pet
	DynamicMeleeSpeedPets  []*Pet
	DynamicRangedSpeedPets []*Pet
	DynamicCastSpeedPets   []*Pet
	RegenInheritancePets   []*Pet

	// AutoAttacks is the manager for auto attack swings.
	// Must be enabled to use, with "EnableAutoAttacks()".
	AutoAttacks AutoAttacks
	Wand        *Wand // Set by EnableWand for a unit that can shoot a wand.

	Rotation *APLRotation

	// Statistics describing the results of the sim.
	Metrics UnitMetrics

	AttackTables []*AttackTable

	DynamicDamageTakenModifiers  []DynamicDamageTakenModifier
	DynamicHealingTakenModifiers []DynamicHealingTakenModifier
	Blockhandler                 func(sim *Simulation, spell *Spell, result *SpellResult)

	GCD *Timer

	// Separate from GCD timer to support spell queueing and off-GCD actions
	RotationTimer *Timer

	// Used for applying the effect of a hardcast spell when casting finishes.
	//  For channeled spells, only Expires is set.
	// No more than one cast may be active at any given time.
	Hardcast Hardcast

	// Aura that reduces dodge/parry/block to 0 while casting.
	HardcastAvoidanceAura *Aura

	CastSpeed float64

	CurrentTarget *Unit

	SecondaryTarget *Unit // An NPC's second tank assignment; counts that tank as tanking for chance of death.

	// The currently-channeled DOT spell, otherwise nil.
	ChanneledDot *Dot

	// Data about the most recently queued spell, otherwise nil.
	QueuedSpell *QueuedSpell

	// Used for reacting to mastery stat changes
	OnMasteryStatChanged []OnMasteryStatChanged

	// Used for reacting to cast speed changes
	OnCastSpeedChanged []OnSpeedChanged

	// Used for reacting to melee attack speed changes
	OnMeleeAttackSpeedChanged []OnSpeedChanged

	// Used for reacting to ranged attack speed changes
	OnRangedAttackSpeedChanged []OnSpeedChanged

	// Used for reacting to melee and ranged haste changes
	OnMeleeAndRangedHasteChanged []OnSpeedChanged

	// Used for reacting to transient stat changes (e.g. for caching snapshotting calculations)
	OnTemporaryStatsChanges []OnTemporaryStatsChange

	GetSpellDamageValue GetSpellDamageValue

	GetAttackPowerValue GetAttackPowerValue

	SpellsInFlight map[*Spell]int32
	// contains filtered or unexported fields
}

Unit is an abstraction of a Character/Boss/Pet/etc, containing functionality shared by all of them.

func (*Unit) AddArmorIgnoreFactor

func (unit *Unit) AddArmorIgnoreFactor(delta float64)

Adds to the share of every defender's armor the unit's attacks ignore; a negative delta takes it away.

func (*Unit) AddComboPoints

func (eb *Unit) AddComboPoints(sim *Simulation, target *Unit, pointsToAdd int32, metrics *ResourceMetrics)

Combo points live on one unit. A gain on another unit drops the points held on the old one, and the gain lands on the new one; a target swap with no gain keeps them. The gain's metrics spend the dropped points, as a shapeshift's own metrics spend the rage it drops.

func (*Unit) AddDynamicDamageTakenModifier

func (unit *Unit) AddDynamicDamageTakenModifier(ddtm DynamicDamageTakenModifier)

func (*Unit) AddDynamicHealingTakenModifier

func (unit *Unit) AddDynamicHealingTakenModifier(dhtm DynamicHealingTakenModifier)

func (*Unit) AddDynamicMod

func (unit *Unit) AddDynamicMod(config SpellModConfig) *SpellMod

func (*Unit) AddEnergy

func (eb *Unit) AddEnergy(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*Unit) AddFocus

func (fb *Unit) AddFocus(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*Unit) AddMana

func (unit *Unit) AddMana(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*Unit) AddMobTypeBonusStats

func (unit *Unit) AddMobTypeBonusStats(bonus stats.Stats, mobTypes ...proto.MobType)

Adds stats the unit has against every defender of the mob types; a negative bonus takes them away.

func (*Unit) AddOnCastSpeedChanged

func (unit *Unit) AddOnCastSpeedChanged(ocsc OnSpeedChanged)

func (*Unit) AddOnMasteryStatChanged

func (unit *Unit) AddOnMasteryStatChanged(omsc OnMasteryStatChanged)

func (*Unit) AddOnMeleeAndRangedHasteChanged

func (unit *Unit) AddOnMeleeAndRangedHasteChanged(ocsc OnSpeedChanged)

func (*Unit) AddOnMeleeAttackSpeedChanged

func (unit *Unit) AddOnMeleeAttackSpeedChanged(ocsc OnSpeedChanged)

func (*Unit) AddOnRangedAttackSpeedChanged

func (unit *Unit) AddOnRangedAttackSpeedChanged(ocsc OnSpeedChanged)

func (*Unit) AddOnTemporaryStatsChange

func (unit *Unit) AddOnTemporaryStatsChange(otsc OnTemporaryStatsChange)

func (*Unit) AddRage

func (rb *Unit) AddRage(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*Unit) AddReducedCritTakenPercent

func (unit *Unit) AddReducedCritTakenPercent(amount float64)

AddReducedCritTakenPercent adds to the base crit reduction and recalculates the total. Use this for dynamic changes during simulation (e.g., auras).

func (*Unit) AddStat

func (unit *Unit) AddStat(stat stats.Stat, amount float64)

func (*Unit) AddStatDynamic

func (unit *Unit) AddStatDynamic(sim *Simulation, stat stats.Stat, amount float64)

func (*Unit) AddStaticMod

func (unit *Unit) AddStaticMod(config SpellModConfig)

func (*Unit) AddStats

func (unit *Unit) AddStats(stat stats.Stats)

func (*Unit) AddStatsDynamic

func (unit *Unit) AddStatsDynamic(sim *Simulation, bonus stats.Stats)

func (*Unit) ApplyCastSpeed

func (unit *Unit) ApplyCastSpeed(dur time.Duration) time.Duration

func (*Unit) ApplyCastSpeedForSpell

func (unit *Unit) ApplyCastSpeedForSpell(dur time.Duration, spell *Spell) time.Duration

func (*Unit) ApplyRangedSpeed

func (unit *Unit) ApplyRangedSpeed(dur time.Duration) time.Duration

ApplyRangedSpeed applies ranged haste to a duration, for ranged abilities that should be affected by ranged haste

func (*Unit) ApplyRealHaste

func (unit *Unit) ApplyRealHaste(dur time.Duration) time.Duration

func (*Unit) ApplyRealRangedHaste

func (unit *Unit) ApplyRealRangedHaste(dur time.Duration) time.Duration

func (*Unit) Armor

func (unit *Unit) Armor() float64

func (*Unit) BlockDamageReduction

func (unit *Unit) BlockDamageReduction() float64

A block takes off a whole number: in game every partial block takes exactly the sheet's block value, floor(shield + max(0, Strength x 0.05 - 1)) (EV-0045). Flooring the Strength part alone gives the same number while the shield's part is whole; the two differ only under a BlockValueMultiplier, where which one the game floors is not measured, so the whole is floored.

func (*Unit) BreakFear

func (unit *Unit) BreakFear(sim *Simulation)

func (*Unit) BreakStun

func (unit *Unit) BreakStun(sim *Simulation)

func (*Unit) CanQueueSpell

func (unit *Unit) CanQueueSpell(sim *Simulation) bool

Enforce only one queued spell per timestep

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) CancelHardcast

func (unit *Unit) CancelHardcast(sim *Simulation)

func (*Unit) CancelQueuedSpell

func (unit *Unit) CancelQueuedSpell(sim *Simulation)

func (*Unit) CategoryTimer

func (unit *Unit) CategoryTimer(category int32) *Timer

The category is the game files' SpellCategory: casting any spell in it puts the whole category on cooldown. Created through NewTimer, so it is reset with the unit's other timers each iteration.

func (*Unit) ComboPoints

func (eb *Unit) ComboPoints(target *Unit) int32

The combo points on target: none unless target holds them.

func (*Unit) CurrentEnergy

func (eb *Unit) CurrentEnergy() float64

func (*Unit) CurrentEnergyRegenMultiplier

func (eb *Unit) CurrentEnergyRegenMultiplier() float64

func (*Unit) CurrentHealth

func (hb *Unit) CurrentHealth() float64

func (*Unit) CurrentHealthPercent

func (hb *Unit) CurrentHealthPercent() float64

func (*Unit) CurrentMana

func (unit *Unit) CurrentMana() float64

func (*Unit) CurrentManaPercent

func (unit *Unit) CurrentManaPercent() float64

func (*Unit) CurrentRage

func (rb *Unit) CurrentRage() float64

func (*Unit) DisableBuildPhaseStatDep

func (unit *Unit) DisableBuildPhaseStatDep(sim *Simulation, dep *stats.StatDependency)

func (*Unit) DisableDynamicStatDep

func (unit *Unit) DisableDynamicStatDep(sim *Simulation, dep *stats.StatDependency)

func (*Unit) EnableAutoAttacks

func (unit *Unit) EnableAutoAttacks(agent Agent, options AutoAttackOptions)

func (*Unit) EnableBuildPhaseStatDep

func (unit *Unit) EnableBuildPhaseStatDep(sim *Simulation, dep *stats.StatDependency)

func (*Unit) EnableDynamicStatDep

func (unit *Unit) EnableDynamicStatDep(sim *Simulation, dep *stats.StatDependency)

func (*Unit) EnableEnergyBar

func (unit *Unit) EnableEnergyBar(options EnergyBarOptions)

func (*Unit) EnableFocusBar

func (unit *Unit) EnableFocusBar(focusRegenMultiplier float64)

Focus comes back at 10 a second, 1 every 0.1 s, and never shows above 100 (EV-0072).

func (*Unit) EnableHealthBar

func (unit *Unit) EnableHealthBar()

func (*Unit) EnableRageBar

func (unit *Unit) EnableRageBar(options RageBarOptions)

func (*Unit) EnableWand

func (unit *Unit) EnableWand(shoot *Spell, swingSpeed func() time.Duration, shot func(sim *Simulation, target *Unit))

Makes shoot the unit's wand Shoot, which starts wanding once its own ApplyEffects has run and fires shot at each of its slots; Shoot cannot be cast while it runs.

func (*Unit) EndOOMEvent

func (mb *Unit) EndOOMEvent(sim *Simulation)

func (*Unit) ExecuteCustomRotation

func (unit *Unit) ExecuteCustomRotation(sim *Simulation)

func (*Unit) ExecuteResourceGain

func (unit *Unit) ExecuteResourceGain(sim *Simulation, resource proto.ResourceType, amount float64, metrics *ResourceMetrics)

func (*Unit) ExtendGCDUntil

func (unit *Unit) ExtendGCDUntil(sim *Simulation, readyTime time.Duration)

func (*Unit) ExtraAttackProc

func (unit *Unit) ExtraAttackProc(trigger *ProcTrigger, tagSpellID int32, count int) OnInit

Adds an extra attack to a proc's handler: a copy of the main-hand swing tagged with the granting spell, cast count times on the hit's target, or on the attacker when the hit was one the unit took. The proc rolls off the triggering hit, but the extra attack swings once that hit has been dealt, in the same instant, and is lost if its target died before it swings. The returned OnInit registers the copy, so it goes on the proc's aura: the main-hand swing is configured after procs register, and a unit that never swings has none to copy, in which case the proc casts nothing. The swing it grants is not a hit the proc hears, or one proc would swing forever. A main-hand proc hears Windfury Totem hits at a main-hand white swing's chance (EV-0002, EV-0128).

func (*Unit) FinalizeMovement

func (unit *Unit) FinalizeMovement(sim *Simulation)

func (*Unit) GainHealth

func (hb *Unit) GainHealth(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*Unit) GetActiveAuraWithTag

func (at *Unit) GetActiveAuraWithTag(tag string) *Aura

func (*Unit) GetAllOpponents

func (unit *Unit) GetAllOpponents() []*Unit

func (*Unit) GetAura

func (at *Unit) GetAura(label string) *Aura

func (*Unit) GetAuraByID

func (at *Unit) GetAuraByID(actionID ActionID) *Aura

func (*Unit) GetAuras

func (at *Unit) GetAuras() []*Aura

func (*Unit) GetAurasWithTag

func (at *Unit) GetAurasWithTag(tag string) []*Aura

func (*Unit) GetBlockFromRating

func (unit *Unit) GetBlockFromRating() float64

func (*Unit) GetCurrentPowerBar

func (unit *Unit) GetCurrentPowerBar() PowerBarType

func (*Unit) GetDodgeFromRating

func (unit *Unit) GetDodgeFromRating() float64

func (*Unit) GetEnemyExclusiveCategories

func (caster *Unit) GetEnemyExclusiveCategories(category string) ExclusiveCategoryArray

func (*Unit) GetHighestStatType

func (unit *Unit) GetHighestStatType(statTypeOptions []stats.Stat) stats.Stat

Given an array of Stat types, return the Stat whose value is largest for this Unit.

func (*Unit) GetIcdAuraByID

func (at *Unit) GetIcdAuraByID(actionID ActionID) *Aura

func (*Unit) GetInitialStat

func (unit *Unit) GetInitialStat(stat stats.Stat) float64

func (*Unit) GetMetadata

func (unit *Unit) GetMetadata() *proto.UnitMetadata

func (*Unit) GetMetricsProto

func (at *Unit) GetMetricsProto() []*proto.AuraMetrics

func (*Unit) GetMovementSpeed

func (unit *Unit) GetMovementSpeed() float64

Returns the units current movement speed in yards / second

func (*Unit) GetOrInitTimer

func (unit *Unit) GetOrInitTimer(timer **Timer) *Timer

Helper for shared timers that are not always needed, so it is only allocated if necessary.

func (*Unit) GetOrRegisterAura

func (unit *Unit) GetOrRegisterAura(aura Aura) *Aura

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) GetParryFromRating

func (unit *Unit) GetParryFromRating() float64

func (*Unit) GetSpell

func (unit *Unit) GetSpell(actionID ActionID) *Spell

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) GetStat

func (unit *Unit) GetStat(stat stats.Stat) float64

func (*Unit) GetStats

func (unit *Unit) GetStats() stats.Stats

func (*Unit) GetStatsWithoutDeps

func (unit *Unit) GetStatsWithoutDeps() stats.Stats

func (*Unit) GetTotalAvoidanceChance

func (unit *Unit) GetTotalAvoidanceChance(spell *Spell, atkTable *AttackTable) float64

func (*Unit) GetTotalBlockChanceAsDefender

func (unit *Unit) GetTotalBlockChanceAsDefender(spell *Spell, atkTable *AttackTable) float64

func (*Unit) GetTotalChanceToBeMissedAsDefender

func (unit *Unit) GetTotalChanceToBeMissedAsDefender(spell *Spell, atkTable *AttackTable) float64

func (*Unit) GetTotalDodgeChanceAsDefender

func (unit *Unit) GetTotalDodgeChanceAsDefender(spell *Spell, atkTable *AttackTable) float64

func (*Unit) GetTotalParryChanceAsDefender

func (unit *Unit) GetTotalParryChanceAsDefender(spell *Spell, atkTable *AttackTable) float64

func (*Unit) GetUnit

func (unit *Unit) GetUnit(ref *proto.UnitReference) *Unit

func (*Unit) HasActiveAura

func (at *Unit) HasActiveAura(label string) bool

func (*Unit) HasActiveAuraWithTag

func (at *Unit) HasActiveAuraWithTag(tag string) bool

func (*Unit) HasActiveAuraWithTagExcludingAura

func (at *Unit) HasActiveAuraWithTagExcludingAura(tag string, excludeAura *Aura) bool

func (*Unit) HasAura

func (at *Unit) HasAura(label string) bool

func (*Unit) HasAuraWithTag

func (at *Unit) HasAuraWithTag(tag string) bool

func (*Unit) HasEnergyBar

func (unit *Unit) HasEnergyBar() bool

func (*Unit) HasFocusBar

func (unit *Unit) HasFocusBar() bool

func (*Unit) HasHealthBar

func (unit *Unit) HasHealthBar() bool

func (*Unit) HasManaBar

func (unit *Unit) HasManaBar() bool

func (*Unit) HasRageBar

func (unit *Unit) HasRageBar() bool

func (*Unit) HasTemporaryBonusForStat

func (unit *Unit) HasTemporaryBonusForStat(stat stats.Stat) bool

Returns whether the indicates stat is currently modified by a temporary bonus.

func (*Unit) HasTemporaryMeleeSwingSpeedIncrease

func (unit *Unit) HasTemporaryMeleeSwingSpeedIncrease() bool

Returns if melee swings have any temporary increases active.

func (*Unit) HasTemporaryRangedSwingSpeedIncrease

func (unit *Unit) HasTemporaryRangedSwingSpeedIncrease() bool

Returns if ranged swings have any temporary increases active.

func (*Unit) HasTemporarySpellCastSpeedIncrease

func (unit *Unit) HasTemporarySpellCastSpeedIncrease() bool

Returns if spell casting has any temporary increases active.

func (*Unit) InitialCastSpeed

func (unit *Unit) InitialCastSpeed() float64

func (*Unit) Interrupt

func (unit *Unit) Interrupt(sim *Simulation)

Interrupt cancels any cast, channel or queued spell in progress, e.g. when the unit gets crowd controlled. Does not touch the GCD; callers that also want to lock the rotation should call ExtendGCDUntil afterwards.

func (*Unit) IsActive

func (unit *Unit) IsActive() bool

func (*Unit) IsBelowExecuteHealth

func (unit *Unit) IsBelowExecuteHealth(percent int32) bool

Whether the unit is at or below the health percent, one of the execute phases' 35, 25 and 20. Players and pets never are.

func (*Unit) IsChanneling

func (unit *Unit) IsChanneling() bool

func (*Unit) IsEnabled

func (unit *Unit) IsEnabled() bool

Units can be disabled for several reasons:

  1. Downtime for temporary pets (e.g. Water Elemental)
  2. Enemy units in various phases (not yet implemented)
  3. Dead units (not yet implemented)

func (*Unit) IsExecutePhase20

func (unit *Unit) IsExecutePhase20() bool

Whether the unit is at or below 20% health. Players and pets never are.

func (*Unit) IsExecutePhase35

func (unit *Unit) IsExecutePhase35() bool

Whether the unit is at or below 35% health. Players and pets never are.

func (*Unit) IsOOM

func (mb *Unit) IsOOM() bool

func (*Unit) IsOpponent

func (unit *Unit) IsOpponent(other *Unit) bool

func (*Unit) IsReset

func (eb *Unit) IsReset(sim *Simulation) bool

func (*Unit) Log

func (unit *Unit) Log(sim *Simulation, message string, vals ...any)

func (*Unit) LogLabel

func (unit *Unit) LogLabel() string

func (*Unit) MHNormalizedWeaponDamage

func (unit *Unit) MHNormalizedWeaponDamage(sim *Simulation, attackPower float64) float64

func (*Unit) MHWeaponDamage

func (unit *Unit) MHWeaponDamage(sim *Simulation, attackPower float64) float64

func (*Unit) MP5ManaRegenPerSecond

func (unit *Unit) MP5ManaRegenPerSecond() float64

Returns the rate of mana regen per second from mp5.

func (*Unit) MakeProcTriggerAura

func (unit *Unit) MakeProcTriggerAura(config ProcTrigger) *Aura

func (*Unit) ManaRegenBoost added in v1.0.12

func (unit *Unit) ManaRegenBoost(aura *Aura) *ManaRegenBoost

The boost the aura gives, made on the first call. Its metrics take the aura's spell, tagged manaRegenBoostTag, and auras of one spell (the player's copy, the external one) share them. A caller that changes a regen field while the aura is up tells the boost the same change.

func (*Unit) ManaRegenPerSecondWhileCasting

func (unit *Unit) ManaRegenPerSecondWhileCasting() float64

Returns the rate of mana regen per second, assuming this unit is considered to be casting.

func (*Unit) ManaRegenPerSecondWhileNotCasting

func (unit *Unit) ManaRegenPerSecondWhileNotCasting() float64

Returns the rate of mana regen per second, assuming this unit is considered to be not casting.

func (*Unit) MaxComboPoints

func (eb *Unit) MaxComboPoints() int32

func (*Unit) MaxHealth

func (hb *Unit) MaxHealth() float64

func (*Unit) MaxMana

func (unit *Unit) MaxMana() float64

Gets the Maxiumum mana including bonus and temporary affects that would increase your mana pool.

func (*Unit) MaximumEnergy

func (eb *Unit) MaximumEnergy() float64

func (*Unit) MaximumRage

func (rb *Unit) MaximumRage() float64

func (*Unit) ModifiedProcChance

func (unit *Unit) ModifiedProcChance(flags ClassFlags, chance float64) float64

The chance a proc trigger with these class flags of its own rolls, once the unit's active proc chance mods that name them are counted: the flat points are added first and the percentage multiplies the sum. A trigger that states no class flags of its own is named by no mod, and a chance no mod names comes back unchanged. A pet counts its owner's mods with its own.

func (*Unit) ModifiedProcCooldown

func (unit *Unit) ModifiedProcCooldown(flags ClassFlags, icd time.Duration) time.Duration

The internal cooldown a proc trigger with these class flags of its own starts, once the unit's active proc cooldown mods that name them are counted, the same way as ModifiedProcChance.

func (*Unit) MoveDuration

func (unit *Unit) MoveDuration(duration time.Duration, sim *Simulation)

A timed walk a spell or a pet's own logic causes.

func (*Unit) MoveDurationByHand

func (unit *Unit) MoveDurationByHand(duration time.Duration, sim *Simulation)

A timed walk the player starts: the rotation's Move Duration or the encounter's movement.

func (*Unit) MoveTo

func (unit *Unit) MoveTo(moveRange float64, sim *Simulation)

A walk a spell or a pet's own logic causes, e.g. Charge's.

func (*Unit) MoveToOver

func (unit *Unit) MoveToOver(moveRange float64, duration time.Duration, sim *Simulation)

Walks the unit to moveRange in duration, at the speed that takes instead of its run speed.

func (*Unit) MultiplyAttackSpeed

func (unit *Unit) MultiplyAttackSpeed(sim *Simulation, amount float64)

Helper for when true haste effects are multiplied. Seems to also always impact the regen rate

func (*Unit) MultiplyCastSpeed

func (unit *Unit) MultiplyCastSpeed(sim *Simulation, amount float64)

func (*Unit) MultiplyCritDamageVersus

func (unit *Unit) MultiplyCritDamageVersus(mult float64, mobTypes ...proto.MobType)

Multiplies the crit damage the unit deals to every defender of the mob types on top of the damage multiplier; 1/mult takes it back off.

func (*Unit) MultiplyDamageTakenRageGen

func (rb *Unit) MultiplyDamageTakenRageGen(multiplier float64)

func (*Unit) MultiplyDamageVersus

func (unit *Unit) MultiplyDamageVersus(mult float64, mobTypes ...proto.MobType)

Multiplies the damage the unit deals to every defender of the mob types; 1/mult takes the multiplier back off.

func (*Unit) MultiplyEnergyRegenSpeed

func (eb *Unit) MultiplyEnergyRegenSpeed(sim *Simulation, multiplier float64)

func (*Unit) MultiplyFocusRegenSpeed added in v1.0.12

func (fb *Unit) MultiplyFocusRegenSpeed(multiplier float64)

func (*Unit) MultiplyInnervateManaRegenSpeed

func (unit *Unit) MultiplyInnervateManaRegenSpeed(sim *Simulation, multiplier float64)

func (*Unit) MultiplyManaRegenSpeed

func (unit *Unit) MultiplyManaRegenSpeed(sim *Simulation, multiplier float64)

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) MultiplyMovementSpeed

func (unit *Unit) MultiplyMovementSpeed(sim *Simulation, amount float64)

func (*Unit) MultiplyRangedHaste

func (unit *Unit) MultiplyRangedHaste(sim *Simulation, amount float64)

Used for "Ranged haste" effects that modify both attack speed and focus regen, like Rapid Fire and Focus Fire

func (*Unit) MultiplyRangedSpeed

func (unit *Unit) MultiplyRangedSpeed(sim *Simulation, amount float64)

Used for "Ranged attack speed" effects like Steady Focus and Serpent's Swiftness

func (*Unit) MultiplyResourceRegenSpeed

func (unit *Unit) MultiplyResourceRegenSpeed(sim *Simulation, amount float64)

Helper for multiplying resource generation speed

func (*Unit) MultiplyWeaponSpeed

func (unit *Unit) MultiplyWeaponSpeed(sim *Simulation, amount float64)

For an attack speed aura that swings the weapon as a faster, lighter one: the swings speed up as melee speed does, and WeaponSpeedMultiplier carries the factor for the procs that read the weapon's speed.

func (*Unit) NewAPLAction

func (unit *Unit) NewAPLAction(rot *APLRotation, config *proto.APLAction) APLActionImpl

Default implementation of Agent.NewAPLAction so each spec doesn't need this boilerplate.

func (*Unit) NewAPLValue

func (unit *Unit) NewAPLValue(rot *APLRotation, config *proto.APLValue) APLValue

Default implementation of Agent.NewAPLValue so each spec doesn't need this boilerplate.

func (*Unit) NewAllyAuraArray

func (caster *Unit) NewAllyAuraArray(makeAura func(*Unit) *Aura) AuraArray

An aura on every unit allied to the caster, for raid-targeted buffs such as Battle Shout and the prayers. An in-sim cast of a party or raid area aura (paladin auras, shaman totems) reaches only the caster; the party and raid buff settings stand in for the others.

func (*Unit) NewAllyDamageAbsorptionAuraArray

func (caster *Unit) NewAllyDamageAbsorptionAuraArray(makeAura func(*Unit) *DamageAbsorptionAura) DamageAbsorptionAuraArray

func (*Unit) NewComboPointMetrics

func (unit *Unit) NewComboPointMetrics(actionID ActionID) *ResourceMetrics

func (*Unit) NewDamageAbsorptionAura

func (unit *Unit) NewDamageAbsorptionAura(config AbsorptionAuraConfig) *DamageAbsorptionAura

func (*Unit) NewEnemyAuraArray

func (caster *Unit) NewEnemyAuraArray(makeAura func(*Unit) *Aura) AuraArray

func (*Unit) NewEnemyExclusiveCategoryArray

func (caster *Unit) NewEnemyExclusiveCategoryArray(makeExclusiveCategory func(*Unit) *ExclusiveCategory) ExclusiveCategoryArray

func (*Unit) NewEnergyMetrics

func (unit *Unit) NewEnergyMetrics(actionID ActionID) *ResourceMetrics

func (*Unit) NewFocusMetrics

func (unit *Unit) NewFocusMetrics(actionID ActionID) *ResourceMetrics

func (*Unit) NewGenericMetric

func (unit *Unit) NewGenericMetric(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) NewPassiveMovementSpeedAura

func (unit *Unit) NewPassiveMovementSpeedAura(label string, actionID ActionID, multiplier float64) *Aura

func (*Unit) NewRageMetrics

func (unit *Unit) NewRageMetrics(actionID ActionID) *ResourceMetrics

func (*Unit) NewTimer

func (unit *Unit) NewTimer() *Timer

func (*Unit) NextEnergyTickAt

func (eb *Unit) NextEnergyTickAt() time.Duration

func (*Unit) NextGCDAt

func (unit *Unit) NextGCDAt() time.Duration

func (*Unit) NextRotationActionAt

func (unit *Unit) NextRotationActionAt() time.Duration

func (*Unit) NumActiveAurasWithTag

func (at *Unit) NumActiveAurasWithTag(tag string) int32

func (*Unit) OHNormalizedWeaponDamage

func (unit *Unit) OHNormalizedWeaponDamage(sim *Simulation, attackPower float64) float64

func (*Unit) OHWeaponDamage

func (unit *Unit) OHWeaponDamage(sim *Simulation, attackPower float64) float64

func (*Unit) OnApplyEffects

func (at *Unit) OnApplyEffects(sim *Simulation, target *Unit, spell *Spell)

Invokes the OnApplyEffects event for all tracked Auras.

func (*Unit) OnCastComplete

func (at *Unit) OnCastComplete(sim *Simulation, spell *Spell)

Invokes the OnCastComplete event for all tracked Auras.

func (*Unit) OnCastResult

func (at *Unit) OnCastResult(sim *Simulation, spell *Spell, result *SpellResult)

func (*Unit) OnChannelEnd

func (unit *Unit) OnChannelEnd(handler func(sim *Simulation, dot *Dot))

Runs the handler with the ended channel each time one of the unit's channels ends, run out or cut short, after its last tick and after the rotation's wake-up is set, which the handler may move.

func (*Unit) OnEncounterStart

func (at *Unit) OnEncounterStart(sim *Simulation)

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) OnKill

func (at *Unit) OnKill(sim *Simulation, target *Unit)

func (*Unit) OnManaTick

func (unit *Unit) OnManaTick(sim *Simulation)

Empty handler so Agents don't have to provide one if they have no logic to add.

func (*Unit) OnMovement

func (unit *Unit) OnMovement(sim *Simulation, position float64, kind MovementUpdateType)

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) OnTargetDies

func (at *Unit) OnTargetDies(sim *Simulation, target *Unit)

func (*Unit) QueueSpell

func (unit *Unit) QueueSpell(sim *Simulation, spell *Spell, target *Unit, queueAt time.Duration)

func (*Unit) RaidDebuffsDisabled

func (unit *Unit) RaidDebuffsDisabled() bool

Whether the raid's debuffs are disabled on the unit. A raid debuff on a timer of its own checks it at each tick.

func (*Unit) RangedNormalizedWeaponDamage

func (unit *Unit) RangedNormalizedWeaponDamage(sim *Simulation, attackPower float64) float64

func (*Unit) RangedWeaponDamage

func (unit *Unit) RangedWeaponDamage(sim *Simulation, attackPower float64) float64

func (*Unit) ReactToEvent

func (unit *Unit) ReactToEvent(sim *Simulation, randomizeReactionTime bool, addReactionTime bool)

Call this when reacting to events that occur before the next scheduled rotation action

func (*Unit) RegisterAura

func (unit *Unit) RegisterAura(aura Aura) *Aura

func (*Unit) RegisterFearAura

func (unit *Unit) RegisterFearAura(label string, actionID ActionID, duration time.Duration) *Aura

func (*Unit) RegisterMovementCallback

func (unit *Unit) RegisterMovementCallback(callback MovementCallback)

func (*Unit) RegisterPrepullAction

func (unit *Unit) RegisterPrepullAction(doAt time.Duration, action func(*Simulation))

Registers a callback to this Unit which will be invoked on the prepull at the specified negative time.

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) RegisterStunAura

func (unit *Unit) RegisterStunAura(label string, actionID ActionID, duration time.Duration) *Aura

func (*Unit) RemoveHealth

func (hb *Unit) RemoveHealth(sim *Simulation, amount float64)

Health lost to damage taken, booked under Damage Taken and counted in TMI on a tanking unit.

func (*Unit) ResetComboPoints

func (eb *Unit) ResetComboPoints(sim *Simulation, target *Unit, comboPointsToKeep int32)

func (*Unit) ResetEnergyTick

func (eb *Unit) ResetEnergyTick(sim *Simulation)

Gives an immediate partial energy tick and restarts the tick timer.

func (*Unit) ResetRageBar

func (rb *Unit) ResetRageBar(sim *Simulation, rageToKeep float64)

func (*Unit) ScopedPercents

func (unit *Unit) ScopedPercents(probe ProcMask) ScopedPercents

func (*Unit) SetCurrentHealthPercent

func (hb *Unit) SetCurrentHealthPercent(percent float64)

Puts current health at a share of the maximum with no healing or damage, so no metrics or TMI entry move. A druid's change of form moves the maximum and keeps the share.

func (*Unit) SetCurrentPowerBar

func (unit *Unit) SetCurrentPowerBar(bar PowerBarType)

func (*Unit) SetGCDTimer

func (unit *Unit) SetGCDTimer(sim *Simulation, gcdReadyAt time.Duration)

func (*Unit) SetMaxComboPoints

func (eb *Unit) SetMaxComboPoints(maxComboPoints int32)

func (*Unit) SetMaximumEnergy

func (eb *Unit) SetMaximumEnergy(sim *Simulation, maxEnergy float64, metrics *ResourceMetrics)

Sets the most energy the bar holds. A raised maximum grants no energy; energy above a lowered one is lost and counted against the metrics. Without a Simulation there is no energy yet to lose.

func (*Unit) SetMaximumRage

func (rb *Unit) SetMaximumRage(sim *Simulation, maxRage float64, metrics *ResourceMetrics)

Sets the most rage the bar holds. A raised maximum grants no rage; rage above a lowered one is lost and counted against the metrics. Without a Simulation there is no rage yet to lose.

func (*Unit) SetOffHandRageMultiplier

func (rb *Unit) SetOffHandRageMultiplier(multiplier float64)

func (*Unit) SetRotationTimer

func (unit *Unit) SetRotationTimer(sim *Simulation, rotationReadyAt time.Duration)

func (*Unit) SkipForMana

func (mb *Unit) SkipForMana()

For a rotation that checks a mana cost itself: the current pass skips a spell it wants for its cost.

func (*Unit) SpellGCD

func (unit *Unit) SpellGCD() time.Duration

func (*Unit) SpellInFlight

func (unit *Unit) SpellInFlight(spell *Spell) bool

func (*Unit) SpellInFlightByID

func (unit *Unit) SpellInFlightByID(spellID int32) bool

func (*Unit) SpendComboPoints

func (eb *Unit) SpendComboPoints(sim *Simulation, target *Unit, metrics *ResourceMetrics)

func (*Unit) SpendEnergy

func (eb *Unit) SpendEnergy(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*Unit) SpendFocus

func (fb *Unit) SpendFocus(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*Unit) SpendHealth

func (hb *Unit) SpendHealth(sim *Simulation, amount float64, metrics *ResourceMetrics)

Health a spell takes from its own caster as a cost, booked under the spell's metrics. A self cost is not damage taken, so it adds no TMI entry.

func (*Unit) SpendMana

func (unit *Unit) SpendMana(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*Unit) SpendPartialComboPoints

func (eb *Unit) SpendPartialComboPoints(sim *Simulation, target *Unit, pointsToSpend int32, metrics *ResourceMetrics)

A spend on a unit that holds no combo points spends none.

func (*Unit) SpendRage

func (rb *Unit) SpendRage(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*Unit) SpiritManaRegenPerSecond

func (unit *Unit) SpiritManaRegenPerSecond() float64

Returns the rate of mana regen per second from spirit.

func (*Unit) StartOOMEvent

func (mb *Unit) StartOOMEvent(sim *Simulation)

Pets keep no OOM metrics, so they never go OOM.

func (*Unit) StopMoving

func (unit *Unit) StopMoving(sim *Simulation)

Ends the walk under way where the unit is now.

func (*Unit) TimeToNextEnergyTick

func (eb *Unit) TimeToNextEnergyTick(sim *Simulation) time.Duration

func (*Unit) TimeToTargetEnergy

func (eb *Unit) TimeToTargetEnergy(sim *Simulation, targetEnergy float64) time.Duration

func (*Unit) TimeUntilManaRegen

func (unit *Unit) TimeUntilManaRegen(sim *Simulation, desiredMana float64) time.Duration

Returns how long the unit waits for its regen to reach desiredMana, up to the tick that credits it, assuming it spends no mana in the meantime. The regen runs at the casting rate for the rest of the five-second rule window or of a paid channel, whichever ends later, and at the full rate after it.

func (*Unit) TotalMeleeHasteMultiplier

func (unit *Unit) TotalMeleeHasteMultiplier() float64

func (*Unit) TotalRangedHasteMultiplier

func (unit *Unit) TotalRangedHasteMultiplier() float64

func (*Unit) TotalRealHasteMultiplier

func (unit *Unit) TotalRealHasteMultiplier() float64

Returns the melee haste multiplier only including equip haste and real haste modifiers like lust Same value for ranged and melee

func (*Unit) TotalRealRangedHasteMultiplier

func (unit *Unit) TotalRealRangedHasteMultiplier() float64

func (*Unit) TotalSpellHasteMultiplier

func (unit *Unit) TotalSpellHasteMultiplier() float64

func (*Unit) UpdateDynamicStatDep

func (unit *Unit) UpdateDynamicStatDep(sim *Simulation, dep *stats.StatDependency, newAmount float64)

func (*Unit) UpdateManaRegenRates

func (unit *Unit) UpdateManaRegenRates(sim *Simulation)

Recomputes the regen rates the mana bar ticks at, after crediting the regen so far at the old ones. Without a Simulation there is no regen to credit yet.

func (*Unit) UpdateMaxEnergy

func (eb *Unit) UpdateMaxEnergy(sim *Simulation, bonusEnergy float64, metrics *ResourceMetrics)

Used for dynamic updates to maximum Energy, such as from the Druid Primal Madness talent

func (*Unit) UpdateMaxHealth

func (hb *Unit) UpdateMaxHealth(sim *Simulation, bonusHealth float64, metrics *ResourceMetrics)

Used for dynamic updates to maximum health from "Last Stand" effects

func (*Unit) UpdatePosition

func (unit *Unit) UpdatePosition(sim *Simulation, isFinal bool)

func (*Unit) WaitUntil

func (unit *Unit) WaitUntil(sim *Simulation, readyTime time.Duration)

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) IsTanking

func (unitMetrics *UnitMetrics) IsTanking() bool

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() *proto.UnitMetrics

type UnitReference

type UnitReference struct {
	Type proto.UnitReference_Type
	// contains filtered or unexported fields
}

Struct for handling unit references, to account for values that can change dynamically (e.g. CurrentTarget).

func NewUnitReference

func NewUnitReference(ref *proto.UnitReference, contextUnit *Unit) UnitReference

func (UnitReference) Get

func (ur UnitReference) Get() *Unit

func (*UnitReference) String

func (ur *UnitReference) String() string

type UnitStats

type UnitStats struct {
	Stats       stats.Stats
	PseudoStats []float64
}

func NewUnitStats

func NewUnitStats() UnitStats

func (*UnitStats) AddStat

func (s *UnitStats) AddStat(stat stats.UnitStat, value float64)

func (*UnitStats) Get

func (s *UnitStats) Get(stat stats.UnitStat) float64

func (*UnitStats) ToProto

func (s *UnitStats) ToProto() *proto.UnitStats

type UnitType

type UnitType int
const (
	PlayerUnit UnitType = iota
	EnemyUnit
	PetUnit
)

type VersusBonus

type VersusBonus struct {
	Multiplier float64
	MobTypes   []proto.MobType
	Families   []proto.CreatureFamily
}

A factor a spell deals or restores against a target of any of the mob types or creature families, once however many of them the target is. The game files state the factor on a row and name the targets only in its tooltip.

func (*VersusBonus) Against

func (bonus *VersusBonus) Against(target *Unit) float64

The factor against the target, 1 where it is none of the mob types and families or there is no bonus.

type Wand

type Wand struct {
	// contains filtered or unexported fields
}

Shoot's scheduler. Shoot applies a channel that carries the channeling state (Is Channeling, the rotation's hold, the timeline bar) but never ticks; the wand fires the shots at its own slots.

func (*Wand) IsShoot

func (wand *Wand) IsShoot(spell *Spell) bool

Shoot's channel or one of its shots, which share its spell id.

type Weapon

type Weapon struct {
	BaseDamageMin        float64
	BaseDamageMax        float64
	AttackPowerPerDPS    float64
	SwingSpeed           float64
	NormalizedSwingSpeed float64
	SpellSchool          SpellSchool
	MinRange             float64
	MaxRange             float64
}

Represents a generic weapon. Pets / unarmed / various other cases don't use actual weapon items so this is an abstraction of a Weapon.

func (*Weapon) AverageDamage

func (weapon *Weapon) AverageDamage() float64

func (*Weapon) BaseDamage

func (weapon *Weapon) BaseDamage(sim *Simulation) float64

func (*Weapon) CalculateAverageWeaponDamage

func (weapon *Weapon) CalculateAverageWeaponDamage(attackPower float64) float64

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) DPS

func (weapon *Weapon) DPS() float64

func (*Weapon) EnemyWeaponDamage

func (weapon *Weapon) EnemyWeaponDamage(sim *Simulation, attackPower float64, damageSpread float64) float64

func (*Weapon) GetBonusCoefficient

func (weapon *Weapon) GetBonusCoefficient() float64

A weapon that deals magic damage adds no spell damage to its autos.

func (*Weapon) GetSpellSchool

func (weapon *Weapon) GetSpellSchool() SpellSchool

type WeaponAttack

type WeaponAttack struct {
	Weapon
	// contains filtered or unexported fields
}

func (*WeaponAttack) IsInRange

func (wa *WeaponAttack) IsInRange() bool

An attack whose spell states a range reaches as far as the spell does, so a range mod on the spell (Hawk Eye, Sniper Shot on Auto Shot) moves the auto attack too.

Source Files

Directories

Path Synopsis
Package buffs holds the raid buffs and debuffs: the constructors tools/database/gen_spelldata generates from tools/database/buffmanifest, the drivers that add what the game files do not state, and the hand-written auras that share categories with them.
Package buffs holds the raid buffs and debuffs: the constructors tools/database/gen_spelldata generates from tools/database/buffmanifest, the drivers that add what the game files do not state, and the hand-written auras that share categories with them.
Package dbcenums is the game files' own spell enums: what an effect does, which aura it applies, the attribute bits a spell carries and the proc bits its aura listens to.
Package dbcenums is the game files' own spell enums: what an effect does, which aura it applies, the attribute bits a spell carries and the proc bits its aura listens to.
Package itemfit holds the rules for which slots an item goes in and which enchant rows fit an item.
Package itemfit holds the rules for which slots an item goes in and which enchant rows fit an item.
Package spelldata is the game files' spell rows as the sim reads them: one Spell per spell ID, with its effects and power costs, and accessors that turn the game files' units into core's.
Package spelldata is the game files' spell rows as the sim reads them: one Spell per spell ID, with its effects and power costs, and accessors that turn the game files' units into core's.
Package testagent is a character with no class code behind it, for the tests of code every class shares.
Package testagent is a character with no class code behind it, for the tests of code every class shares.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL