core

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 27 Imported by: 0

Documentation

Overview

Proto-based function interface for the simulator

Functions for creating common types of auras.

Index

Constants

View Source
const (
	ItemIDAtieshMage            = 22589
	ItemIDAtieshWarlock         = 22630
	ItemIDBraidedEterniumChain  = 24114
	ItemIDChainOfTheTwilightOwl = 24121
	ItemIDEyeOfTheNight         = 24116
	ItemIDJadePendantOfBlasting = 20966
	ItemIDTheLightningCapacitor = 28785
)

IDs for items used in core

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

	ProcMaskMeleeOrProc = ProcMaskMelee | ProcMaskProc
	ProcMaskSpellOrProc = ProcMaskSpellDamage | ProcMaskProc
)
View Source
const (
	CooldownPriorityLow       = -1000
	CooldownPriorityDefault   = 0
	CooldownPriorityDrums     = 2000
	CooldownPriorityBloodlust = 1000
)
View Source
const ArmorPenPerPercentArmor = 13.99
View Source
const AverageMagicPartialResistPerLevelMultiplier = 0.02
View Source
const BaseFocusPerTick = 5.0
View Source
const BattleShoutRanks = 7
View Source
const BleedEffectCategory = "BleedDamage"

Bleed Damage Multiplier category

View Source
const BlockRatingPerBlockChance = 1
View Source
const BloodlustAuraTag = "Bloodlust"
View Source
const BloodlustCD = time.Minute * 10
View Source
const BloodlustDuration = time.Second * 40
View Source
const CharacterMaxLevel = 60
View Source
const CritRatingPerCritChance = 1
View Source
const DTPSReferenceStat = stats.Armor
View Source
const DefaultAttackPowerPerDPS = 14.0
View Source
const DefenseRatingPerDefense = 1
View Source
const DefenseRatingToChanceReduction = (1.0 / DefenseRatingPerDefense) * MissDodgeParryBlockCritChancePerDefense / 100
View Source
const DemoralizingShoutRanks = 5
View Source
const DivineGuardianCD = time.Minute * 2
View Source
const DivineGuardianDuration = time.Second * 6
View Source
const DodgeRatingPerDodgeChance = 1
View Source
const EnemyAutoAttackAPCoefficient = 1.0 / (14.0 * 177.0)

Updated based on formulas supplied by InDebt on WoWSims Discord

View Source
const EnergyPerTick = 20.2
View Source
const EnergyTickDuration = time.Millisecond * 2020

Time between energy ticks.

View Source
const ExpertisePerQuarterPercentReduction = 2.500000
View Source
const GCDDefault = time.Millisecond * 1500
View Source
const GCDMin = time.Second * 1
View Source
const GuardianSpiritCD = time.Minute * 3
View Source
const GuardianSpiritDuration = time.Second * 10
View Source
const HandOfSacrificeCD = time.Minute * 5 // use Divine Shield CD here
View Source
const HandOfSacrificeDuration = time.Millisecond * 10500 // subtract Divine Shield GCD
View Source
const HasteRatingPerHastePercent = 1

Crit/Hit/Haste ratings are straight percentage values in classic TODO: Update Defense/Dodge/Parry rates

View Source
const HuntersMarkAuraTag = "HuntersMark"
View Source
const Inactive = -1
View Source
const InnervateCD = time.Minute * 6
View Source
const InnervateDuration = time.Second * 20
View Source
const JudgementAuraTag = "Judgement"
View Source
const LongDuration = 300
View Source
const ManaTideTotemCD = time.Minute * 5
View Source
const ManaTideTotemDuration = time.Second * 12
View Source
const MaxFocus = 100.0

Time between focus ticks.

View Source
const MaxRage = 100.0
View Source
const MeleeHitRatingPerHitChance = 1
View Source
const MissDodgeParryBlockCritChancePerDefense = 0.04
View Source
const NeverExpires = time.Duration(math.MaxInt64)
View Source
const PainSuppressionCD = time.Minute * 3
View Source
const PainSuppressionDuration = time.Second * 8
View Source
const ParryRatingPerParryChance = 1
View Source
const PowerInfusionCD = time.Minute * 3
View Source
const PowerInfusionDuration = time.Second * 15
View Source
const ReplenishmentAuraDuration = time.Second * 15
View Source
const ResilienceRatingPerCritDamageReductionPercent = ResilienceRatingPerCritReductionChance / 2.2
View Source
const ResilienceRatingPerCritReductionChance = 28.750002
View Source
const SatedAuraLabel = "Sated"
View Source
const ShatteringThrowCD = time.Minute * 5
View Source
const ShortDuration = 60
View Source
const SpellBatchWindow = time.Millisecond * 10
View Source
const SpellCritEffectCategory = "spellcritdebuff"
View Source
const SpellCritRatingPerCritChance = 1
View Source
const SpellFirePowerEffectCategory = "spellFirePowerdebuff"
View Source
const SpellHitRatingPerHitChance = 1
View Source
const ThreatPerManaGained = 0.5
View Source
const ThreatPerRageGained = 5
View Source
const TricksOfTheTradeCD = time.Second * 3600 // CD is 30s from the time buff ends (so 40s with glyph) but that's in order to be able to set the number of TotT you'll have during the fight
View Source
const UnholyFrenzyCD = time.Minute * 3
View Source
const UnholyFrenzyDuration = time.Second * 30
View Source
const WindfuryRanks = 3

Variables

View Source
var (
	WindfuryBuffLevelToRank = []int32{
		25: 0,
		40: 1,
		50: 2,
		60: 3,
	}
	WindfuryBuffSpellId = [WindfuryRanks + 1]int32{0, 8516, 10608, 10610}
	WindfuryBuffBonusAP = [WindfuryRanks + 1]float64{0, 122, 229, 315}
)
View Source
var AddEffectsToTest = true

This value can be set before adding item effects, to control whether they are included in tests.

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 BattleShoutBaseAP = [BattleShoutRanks + 1]float64{0, 20, 40, 57, 93, 138, 193, 232}
View Source
var BattleShoutLevel = [BattleShoutRanks + 1]int{0, 1, 12, 22, 32, 42, 52, 60}
View Source
var BattleShoutSpellId = [BattleShoutRanks + 1]int32{0, 6673, 5242, 6192, 11549, 11550, 11551, 25289}
View Source
var BloodlustActionID = ActionID{SpellID: 2825}
View Source
var BuffSpellByLevel = map[BuffName]map[int32]stats.Stats{
	ArcaneIntellect: {
		25: stats.Stats{
			stats.Intellect: 7,
		},
		40: stats.Stats{
			stats.Intellect: 15,
		},
		50: stats.Stats{
			stats.Intellect: 22,
		},
		60: stats.Stats{
			stats.Intellect: 31,
		},
	},
	DivineSpirit: {
		25: stats.Stats{
			stats.Spirit: 0,
		},
		40: stats.Stats{
			stats.Spirit: 23,
		},
		50: stats.Stats{
			stats.Spirit: 33,
		},
		60: stats.Stats{
			stats.Spirit: 40,
		},
	},
	AspectOfTheWild: {
		25: stats.Stats{
			stats.NatureResistance: 0,
		},
		40: stats.Stats{
			stats.Stamina: 0,
		},
		50: stats.Stats{
			stats.Stamina: 45,
		},
		60: stats.Stats{
			stats.Stamina: 60,
		},
	},

	BattleShout: {
		25: stats.Stats{
			stats.AttackPower: 60,
		},
		40: stats.Stats{
			stats.AttackPower: 94,
		},
		50: stats.Stats{
			stats.AttackPower: 139,
		},
		60: stats.Stats{
			stats.AttackPower: 193,
		},
	},

	BlessingOfMight: {
		25: stats.Stats{
			stats.AttackPower: 55,
		},
		40: stats.Stats{
			stats.AttackPower: 85,
		},
		50: stats.Stats{
			stats.AttackPower: 115,
		},
		60: stats.Stats{
			stats.AttackPower: 185,
		},
	},
	BlessingOfWisdom: {
		25: stats.Stats{
			stats.MP5: 15,
		},
		40: stats.Stats{
			stats.MP5: 20,
		},
		50: stats.Stats{
			stats.MP5: 25,
		},
		60: stats.Stats{
			stats.MP5: 33,
		},
	},
	BloodPact: {
		25: stats.Stats{
			stats.Stamina: 9,
		},
		40: stats.Stats{
			stats.Stamina: 30,
		},
		50: stats.Stats{
			stats.Stamina: 38,
		},
		60: stats.Stats{
			stats.Stamina: 42,
		},
	},
	GraceOfAir: {
		25: stats.Stats{
			stats.Agility: 0,
		},
		40: stats.Stats{
			stats.Agility: 0,
		},
		50: stats.Stats{
			stats.Agility: 43,
		},
		60: stats.Stats{
			stats.Agility: 77,
		},
	},
	FrostResistanceAura: {
		25: stats.Stats{
			stats.NatureResistance: 0,
		},
		40: stats.Stats{
			stats.Stamina: 30,
		},
		50: stats.Stats{
			stats.Stamina: 45,
		},
		60: stats.Stats{
			stats.Stamina: 60,
		},
	},
	FrostResistanceTotem: {
		25: stats.Stats{
			stats.NatureResistance: 30,
		},
		40: stats.Stats{
			stats.Stamina: 45,
		},
		50: stats.Stats{
			stats.Stamina: 60,
		},
		60: stats.Stats{
			stats.Stamina: 60,
		},
	},
	HornOfLordaeron: {
		25: stats.Stats{
			stats.Strength: 17,
			stats.Agility:  17,
		},
		40: stats.Stats{
			stats.Strength: 26,
			stats.Agility:  26,
		},
		50: stats.Stats{
			stats.Strength: 45,
			stats.Agility:  45,
		},
		60: stats.Stats{
			stats.Strength: 89,
			stats.Agility:  89,
		},
	},
	ManaSpring: {
		25: stats.Stats{
			stats.MP5: 0,
		},
		40: stats.Stats{
			stats.MP5: 15,
		},
		50: stats.Stats{
			stats.MP5: 20,
		},
		60: stats.Stats{
			stats.MP5: 25,
		},
	},
	MarkOfTheWild: {
		25: stats.Stats{
			stats.Armor:            105,
			stats.Stamina:          4,
			stats.Agility:          4,
			stats.Strength:         4,
			stats.Intellect:        4,
			stats.Spirit:           4,
			stats.ArcaneResistance: 0,
			stats.ShadowResistance: 0,
			stats.NatureResistance: 0,
			stats.FireResistance:   0,
			stats.FrostResistance:  0,
		},
		40: stats.Stats{
			stats.Armor:            195,
			stats.Stamina:          8,
			stats.Agility:          8,
			stats.Strength:         8,
			stats.Intellect:        8,
			stats.Spirit:           8,
			stats.ArcaneResistance: 10,
			stats.ShadowResistance: 10,
			stats.NatureResistance: 10,
			stats.FireResistance:   10,
			stats.FrostResistance:  10,
		},
		50: stats.Stats{
			stats.Armor:            240,
			stats.Stamina:          10,
			stats.Agility:          10,
			stats.Strength:         10,
			stats.Intellect:        10,
			stats.Spirit:           10,
			stats.ArcaneResistance: 15,
			stats.ShadowResistance: 15,
			stats.NatureResistance: 15,
			stats.FireResistance:   15,
			stats.FrostResistance:  15,
		},
		60: stats.Stats{
			stats.Armor:            285,
			stats.Stamina:          12,
			stats.Agility:          12,
			stats.Strength:         12,
			stats.Intellect:        12,
			stats.Spirit:           12,
			stats.ArcaneResistance: 20,
			stats.ShadowResistance: 20,
			stats.NatureResistance: 20,
			stats.FireResistance:   20,
			stats.FrostResistance:  20,
		},
	},
	NatureResistanceTotem: {
		25: stats.Stats{
			stats.NatureResistance: 0,
		},
		40: stats.Stats{
			stats.Stamina: 30,
		},
		50: stats.Stats{
			stats.Stamina: 45,
		},
		60: stats.Stats{
			stats.Stamina: 60,
		},
	},
	PowerWordFortitude: {
		25: stats.Stats{
			stats.Stamina: 20,
		},
		40: stats.Stats{
			stats.Stamina: 32,
		},
		50: stats.Stats{
			stats.Stamina: 43,
		},
		60: stats.Stats{
			stats.Stamina: 54,
		},
	},
	ShadowProtection: {
		25: stats.Stats{
			stats.ShadowResistance: 0,
		},
		40: stats.Stats{
			stats.Stamina: 30,
		},
		50: stats.Stats{
			stats.Stamina: 45,
		},
		60: stats.Stats{
			stats.Stamina: 60,
		},
	},
	TrueshotAura: {
		25: stats.Stats{
			stats.AttackPower:       0,
			stats.RangedAttackPower: 0,
		},
		40: stats.Stats{
			stats.AttackPower:       100,
			stats.RangedAttackPower: 200,
		},
		50: stats.Stats{
			stats.AttackPower:       150,
			stats.RangedAttackPower: 300,
		},
		60: stats.Stats{
			stats.AttackPower:       200,
			stats.RangedAttackPower: 400,
		},
	},
	StrengthOfEarth: {
		25: stats.Stats{
			stats.Strength: 20,
		},
		40: stats.Stats{
			stats.Strength: 36,
		},
		50: stats.Stats{
			stats.Strength: 36,
		},
		60: stats.Stats{
			stats.Strength: 77,
		},
	},
	ScrollOfAgility: {
		25: stats.Stats{
			stats.Agility: 9,
		},
		40: stats.Stats{
			stats.Agility: 13,
		},
		50: stats.Stats{
			stats.Agility: 17,
		},
		60: stats.Stats{
			stats.Agility: 17,
		},
	},
	ScrollOfIntellect: {
		25: stats.Stats{
			stats.Intellect: 8,
		},
		40: stats.Stats{
			stats.Intellect: 12,
		},
		50: stats.Stats{
			stats.Intellect: 16,
		},
		60: stats.Stats{
			stats.Intellect: 16,
		},
	},
	ScrollOfSpirit: {
		25: stats.Stats{
			stats.Spirit: 7,
		},
		40: stats.Stats{
			stats.Spirit: 11,
		},
		50: stats.Stats{
			stats.Spirit: 15,
		},
		60: stats.Stats{
			stats.Spirit: 15,
		},
	},
	ScrollOfStamina: {
		25: stats.Stats{
			stats.Stamina: 8,
		},
		40: stats.Stats{
			stats.Stamina: 12,
		},
		50: stats.Stats{
			stats.Stamina: 16,
		},
		60: stats.Stats{
			stats.Stamina: 16,
		},
	},
	ScrollOfStrength: {
		25: stats.Stats{
			stats.Strength: 9,
		},
		40: stats.Stats{
			stats.Strength: 13,
		},
		50: stats.Stats{
			stats.Strength: 13,
		},
		60: stats.Stats{
			stats.Strength: 17,
		},
	},
}

Stats from buffs pre-tristate buffs

View Source
var ChanceOfDeathAuraLabel = "Chance of Death"
View Source
var ClassBaseCrit = map[proto.Class]stats.Stats{
	proto.Class_ClassUnknown: {},
	proto.Class_ClassWarrior: {
		stats.SpellCrit: 0.0000 * CritRatingPerCritChance,
		stats.MeleeCrit: 0.0000 * CritRatingPerCritChance,
		stats.Dodge:     0.0000 * DodgeRatingPerDodgeChance,
	},
	proto.Class_ClassPaladin: {
		stats.SpellCrit: 3.5000 * CritRatingPerCritChance,
		stats.MeleeCrit: 0.7000 * CritRatingPerCritChance,
		stats.Dodge:     0.7000 * DodgeRatingPerDodgeChance,
	},
	proto.Class_ClassHunter: {
		stats.SpellCrit: 3.6000 * CritRatingPerCritChance,
		stats.MeleeCrit: 0.0000 * CritRatingPerCritChance,
		stats.Dodge:     0.0000 * DodgeRatingPerDodgeChance,
	},
	proto.Class_ClassRogue: {
		stats.SpellCrit: 0.0000 * CritRatingPerCritChance,
		stats.MeleeCrit: 0.0000 * CritRatingPerCritChance,
		stats.Dodge:     0.0000 * DodgeRatingPerDodgeChance,
	},
	proto.Class_ClassPriest: {
		stats.SpellCrit: 0.8000 * CritRatingPerCritChance,
		stats.MeleeCrit: 3.0000 * CritRatingPerCritChance,
		stats.Dodge:     3.0000 * DodgeRatingPerDodgeChance,
	},
	proto.Class_ClassShaman: {
		stats.SpellCrit: 2.3000 * CritRatingPerCritChance,
		stats.MeleeCrit: 1.7000 * CritRatingPerCritChance,
		stats.Dodge:     1.7000 * DodgeRatingPerDodgeChance,
	},
	proto.Class_ClassMage: {
		stats.SpellCrit: 0.2000 * CritRatingPerCritChance,
		stats.MeleeCrit: 3.2000 * CritRatingPerCritChance,
		stats.Dodge:     3.2000 * DodgeRatingPerDodgeChance,
	},
	proto.Class_ClassWarlock: {
		stats.SpellCrit: 1.7000 * CritRatingPerCritChance,
		stats.MeleeCrit: 2.0000 * CritRatingPerCritChance,
		stats.Dodge:     2.0000 * DodgeRatingPerDodgeChance,
	},
	proto.Class_ClassDruid: {
		stats.SpellCrit: 1.8000 * CritRatingPerCritChance,
		stats.MeleeCrit: 0.9000 * CritRatingPerCritChance,
		stats.Dodge:     0.9000 * DodgeRatingPerDodgeChance,
	},
}
View Source
var ClassBaseStats = map[proto.Class]map[int]stats.Stats{
	proto.Class_ClassUnknown: {},
	proto.Class_ClassWarrior: {
		25: {
			stats.Health:      274,
			stats.Mana:        0,
			stats.Agility:     39,
			stats.Strength:    54,
			stats.Intellect:   23,
			stats.Spirit:      28,
			stats.Stamina:     50,
			stats.AttackPower: 25*3 - 20,
		},
		40: {
			stats.Health:      649,
			stats.Mana:        0,
			stats.Agility:     54,
			stats.Strength:    79,
			stats.Intellect:   26,
			stats.Spirit:      34,
			stats.Stamina:     72,
			stats.AttackPower: 40*3 - 20,
		},
		50: {
			stats.Health:      1079,
			stats.Mana:        0,
			stats.Agility:     66,
			stats.Strength:    98,
			stats.Intellect:   28,
			stats.Spirit:      39,
			stats.Stamina:     90,
			stats.AttackPower: 50*3 - 20,
		},
		60: {
			stats.Health:      1689,
			stats.Mana:        0,
			stats.Agility:     80,
			stats.Strength:    120,
			stats.Intellect:   30,
			stats.Spirit:      45,
			stats.Stamina:     110,
			stats.AttackPower: 60*3 - 20,
		},
	},
	proto.Class_ClassPaladin: {
		25: {
			stats.Health:      266,
			stats.Mana:        552,
			stats.Agility:     34,
			stats.Strength:    48,
			stats.Intellect:   36,
			stats.Spirit:      38,
			stats.Stamina:     47,
			stats.AttackPower: 25*3 - 20,
		},
		40: {
			stats.Health:      621,
			stats.Mana:        987,
			stats.Agility:     46,
			stats.Strength:    70,
			stats.Intellect:   49,
			stats.Spirit:      52,
			stats.Stamina:     67,
			stats.AttackPower: 40*3 - 20,
		},
		50: {
			stats.Health:      966,
			stats.Mana:        1257,
			stats.Agility:     55,
			stats.Strength:    86,
			stats.Intellect:   59,
			stats.Spirit:      63,
			stats.Stamina:     82,
			stats.AttackPower: 50*3 - 20,
		},
		60: {
			stats.Health:      1381,
			stats.Mana:        1512,
			stats.Agility:     65,
			stats.Strength:    105,
			stats.Intellect:   70,
			stats.Spirit:      75,
			stats.Stamina:     100,
			stats.AttackPower: 60*3 - 20,
		},
	},
	proto.Class_ClassHunter: {
		25: {
			stats.Health:            292,
			stats.Mana:              611,
			stats.Agility:           55,
			stats.Strength:          31,
			stats.Intellect:         34,
			stats.Spirit:            37,
			stats.Stamina:           43,
			stats.AttackPower:       25*2 - 20,
			stats.RangedAttackPower: 25*2 - 20,
		},
		40: {
			stats.Health:            667,
			stats.Mana:              1105,
			stats.Agility:           81,
			stats.Strength:          40,
			stats.Intellect:         46,
			stats.Spirit:            49,
			stats.Stamina:           61,
			stats.AttackPower:       40*2 - 20,
			stats.RangedAttackPower: 40*2 - 20,
		},
		50: {
			stats.Health:            1047,
			stats.Mana:              1420,
			stats.Agility:           102,
			stats.Strength:          47,
			stats.Intellect:         55,
			stats.Spirit:            59,
			stats.Stamina:           74,
			stats.AttackPower:       50*2 - 20,
			stats.RangedAttackPower: 50*2 - 20,
		},
		60: {
			stats.Health:            1467,
			stats.Mana:              1720,
			stats.Agility:           125,
			stats.Strength:          55,
			stats.Intellect:         65,
			stats.Spirit:            70,
			stats.Stamina:           90,
			stats.AttackPower:       60*2 - 20,
			stats.RangedAttackPower: 60*2 - 20,
		},
	},
	proto.Class_ClassRogue: {
		25: {
			stats.Health:      318,
			stats.Mana:        0,
			stats.Agility:     57,
			stats.Strength:    40,
			stats.Intellect:   25,
			stats.Spirit:      30,
			stats.Stamina:     38,
			stats.AttackPower: 25*2 - 20,
		},
		40: {
			stats.Health:      703,
			stats.Mana:        0,
			stats.Agility:     84,
			stats.Strength:    55,
			stats.Intellect:   29,
			stats.Spirit:      37,
			stats.Stamina:     52,
			stats.AttackPower: 40*2 - 20,
		},
		50: {
			stats.Health:      1068,
			stats.Mana:        0,
			stats.Agility:     106,
			stats.Strength:    67,
			stats.Intellect:   32,
			stats.Spirit:      43,
			stats.Stamina:     63,
			stats.AttackPower: 50*2 - 20,
		},
		60: {
			stats.Health:      1523,
			stats.Mana:        0,
			stats.Agility:     130,
			stats.Strength:    80,
			stats.Intellect:   35,
			stats.Spirit:      50,
			stats.Stamina:     75,
			stats.AttackPower: 60*2 - 20,
		},
	},
	proto.Class_ClassPriest: {
		25: {
			stats.Health:      302,
			stats.Mana:        497,
			stats.Agility:     26,
			stats.Strength:    25,
			stats.Intellect:   53,
			stats.Spirit:      55,
			stats.Stamina:     30,
			stats.AttackPower: -10,
		},
		40: {
			stats.Health:      637,
			stats.Mana:        911,
			stats.Agility:     31,
			stats.Strength:    29,
			stats.Intellect:   78,
			stats.Spirit:      81,
			stats.Stamina:     37,
			stats.AttackPower: -10,
		},
		50: {
			stats.Health:      972,
			stats.Mana:        1166,
			stats.Agility:     35,
			stats.Strength:    32,
			stats.Intellect:   98,
			stats.Spirit:      102,
			stats.Stamina:     43,
			stats.AttackPower: -10,
		},
		60: {
			stats.Health:      1397,
			stats.Mana:        1376,
			stats.Agility:     40,
			stats.Strength:    35,
			stats.Intellect:   120,
			stats.Spirit:      125,
			stats.Stamina:     50,
			stats.AttackPower: -10,
		},
	},
	proto.Class_ClassShaman: {
		25: {
			stats.Health:      257,
			stats.Mana:        505,
			stats.Agility:     31,
			stats.Strength:    41,
			stats.Intellect:   43,
			stats.Spirit:      47,
			stats.Stamina:     45,
			stats.AttackPower: 25*2 - 20,
		},
		40: {
			stats.Health:      610,
			stats.Mana:        975,
			stats.Agility:     40,
			stats.Strength:    58,
			stats.Intellect:   61,
			stats.Spirit:      67,
			stats.Stamina:     63,
			stats.AttackPower: 40*2 - 20,
		},
		50: {
			stats.Health:      947,
			stats.Mana:        1255,
			stats.Agility:     47,
			stats.Strength:    70,
			stats.Intellect:   74,
			stats.Spirit:      82,
			stats.Stamina:     78,
			stats.AttackPower: 50*2 - 20,
		},
		60: {
			stats.Health:      1423,
			stats.Mana:        1520,
			stats.Agility:     55,
			stats.Strength:    85,
			stats.Intellect:   90,
			stats.Spirit:      100,
			stats.Stamina:     95,
			stats.AttackPower: 60*2 - 20,
		},
	},
	proto.Class_ClassMage: {
		25: {
			stats.Health:      315,
			stats.Mana:        481,
			stats.Agility:     25,
			stats.Strength:    23,
			stats.Intellect:   55,
			stats.Spirit:      53,
			stats.Stamina:     28,
			stats.AttackPower: -10,
		},
		40: {
			stats.Health:      630,
			stats.Mana:        853,
			stats.Agility:     29,
			stats.Strength:    26,
			stats.Intellect:   81,
			stats.Spirit:      78,
			stats.Stamina:     34,
			stats.AttackPower: -10,
		},
		50: {
			stats.Health:      955,
			stats.Mana:        1048,
			stats.Agility:     32,
			stats.Strength:    28,
			stats.Intellect:   102,
			stats.Spirit:      98,
			stats.Stamina:     39,
			stats.AttackPower: -10,
		},
		60: {
			stats.Health:      1370,
			stats.Mana:        1213,
			stats.Agility:     35,
			stats.Strength:    30,
			stats.Intellect:   125,
			stats.Spirit:      120,
			stats.Stamina:     45,
			stats.AttackPower: -10,
		},
	},
	proto.Class_ClassWarlock: {
		25: {
			stats.Health:      279,
			stats.Mana:        498,
			stats.Agility:     30,
			stats.Strength:    28,
			stats.Intellect:   50,
			stats.Spirit:      52,
			stats.Stamina:     35,
			stats.AttackPower: -10,
		},
		40: {
			stats.Health:      634,
			stats.Mana:        923,
			stats.Agility:     37,
			stats.Strength:    34,
			stats.Intellect:   72,
			stats.Spirit:      75,
			stats.Stamina:     46,
			stats.AttackPower: -10,
		},
		50: {
			stats.Health:      979,
			stats.Mana:        1163,
			stats.Agility:     43,
			stats.Strength:    39,
			stats.Intellect:   90,
			stats.Spirit:      94,
			stats.Stamina:     55,
			stats.AttackPower: -10,
		},
		60: {
			stats.Health:      1414,
			stats.Mana:        1373,
			stats.Agility:     50,
			stats.Strength:    45,
			stats.Intellect:   110,
			stats.Spirit:      115,
			stats.Stamina:     65,
			stats.AttackPower: -10,
		},
	},
	proto.Class_ClassDruid: {
		25: {
			stats.Health:      318,
			stats.Mana:        479,
			stats.Agility:     33,
			stats.Strength:    35,
			stats.Intellect:   47,
			stats.Spirit:      50,
			stats.Stamina:     36,
			stats.AttackPower: -20,
		},
		40: {
			stats.Health:      683,
			stats.Mana:        854,
			stats.Agility:     43,
			stats.Strength:    46,
			stats.Intellect:   67,
			stats.Spirit:      72,
			stats.Stamina:     49,
			stats.AttackPower: -20,
		},
		50: {
			stats.Health:      1038,
			stats.Mana:        1064,
			stats.Agility:     51,
			stats.Strength:    55,
			stats.Intellect:   82,
			stats.Spirit:      90,
			stats.Stamina:     59,
			stats.AttackPower: -20,
		},
		60: {
			stats.Health:      1483,
			stats.Mana:        1244,
			stats.Agility:     60,
			stats.Strength:    65,
			stats.Intellect:   100,
			stats.Spirit:      110,
			stats.Stamina:     70,
			stats.AttackPower: -20,
		},
	},
}
View Source
var CritPerAgiAtLevel = map[proto.Class]map[int]float64{
	proto.Class_ClassUnknown: {25: 0.0, 40: 0.0, 50: 0.0, 60: 0.0},
	proto.Class_ClassWarrior: {25: 0.1111, 40: 0.0758, 50: 0.0610, 60: 0.0500},
	proto.Class_ClassPaladin: {25: 0.1075, 40: 0.0741, 50: 0.0606, 60: 0.0506},
	proto.Class_ClassHunter:  {25: 0.0515, 40: 0.0303, 50: 0.0234, 60: 0.0189},
	proto.Class_ClassRogue:   {25: 0.0952, 40: 0.0556, 50: 0.0427, 60: 0.0345},
	proto.Class_ClassPriest:  {25: 0.0769, 40: 0.0645, 50: 0.0571, 60: 0.0500},
	proto.Class_ClassShaman:  {25: 0.0971, 40: 0.0717, 50: 0.0600, 60: 0.0508},
	proto.Class_ClassMage:    {25: 0.0720, 40: 0.0621, 50: 0.0563, 60: 0.0514},
	proto.Class_ClassWarlock: {25: 0.0909, 40: 0.0698, 50: 0.0588, 60: 0.0500},
	proto.Class_ClassDruid:   {25: 0.1025, 40: 0.0719, 50: 0.0594, 60: 0.0500},
}

Melee/Ranged crit agi scaling

View Source
var CritPerIntAtLevel = map[proto.Class]map[int]float64{
	proto.Class_ClassUnknown: {25: 0.0, 40: 0.0, 50: 0.0, 60: 0.0},
	proto.Class_ClassWarrior: {25: 0.0, 40: 0.0, 50: 0.0, 60: 0.0},
	proto.Class_ClassPaladin: {25: 0.0357, 40: 0.0246, 50: 0.0200, 60: 0.0167},
	proto.Class_ClassHunter:  {25: 0.0350, 40: 0.0241, 50: 0.0197, 60: 0.0165},
	proto.Class_ClassRogue:   {25: 0.0, 40: 0.0, 50: 0.0, 60: 0.0},
	proto.Class_ClassPriest:  {25: 0.0457, 40: 0.0269, 50: 0.0208, 60: 0.0168},
	proto.Class_ClassShaman:  {25: 0.0422, 40: 0.0262, 50: 0.0208, 60: 0.0169},
	proto.Class_ClassMage:    {25: 0.0475, 40: 0.0276, 50: 0.0211, 60: 0.0168},
	proto.Class_ClassWarlock: {25: 0.0429, 40: 0.0262, 50: 0.0204, 60: 0.0165},
	proto.Class_ClassDruid:   {25: 0.0427, 40: 0.0260, 50: 0.0205, 60: 0.0167},
}

Spell crit int scaling

View Source
var DefaultSimTestOptions = &proto.SimOptions{
	Iterations: 20,
	IsTest:     true,
	Debug:      false,
	RandomSeed: 101,
}
View Source
var DefaultTargetProtoLvl25 = &proto.Target{
	Level: 27,
	Stats: stats.Stats{
		stats.Armor:       1104,
		stats.AttackPower: 320,
	}.ToFloatArray(),
	MobType: proto.MobType_MobTypeDemon,

	SwingSpeed:    2,
	MinBaseDamage: 4192.05,
	ParryHaste:    true,
	DamageSpread:  0.3333,
}
View Source
var DefaultTargetProtoLvl40 = &proto.Target{
	Level: 42,
	Stats: stats.Stats{
		stats.Armor:       1104,
		stats.AttackPower: 320,
	}.ToFloatArray(),
	MobType: proto.MobType_MobTypeDemon,

	SwingSpeed:    2,
	MinBaseDamage: 4192.05,
	ParryHaste:    true,
	DamageSpread:  0.3333,
}
View Source
var DefaultTargetProtoLvl50 = &proto.Target{
	Level: 52,
	Stats: stats.Stats{
		stats.Armor:       1104,
		stats.AttackPower: 320,
	}.ToFloatArray(),
	MobType: proto.MobType_MobTypeDemon,

	SwingSpeed:    2,
	MinBaseDamage: 4192.05,
	ParryHaste:    true,
	DamageSpread:  0.3333,
}

TODO: Update

View Source
var DemoralizingShoutBaseAP = [DemoralizingShoutRanks + 1]float64{0, 45, 56, 76, 111, 146}
View Source
var DemoralizingShoutLevel = [DemoralizingShoutRanks + 1]int{0, 14, 24, 34, 44, 54}
View Source
var DemoralizingShoutSpellId = [DemoralizingShoutRanks + 1]int32{0, 1160, 6190, 11554, 11555, 11556}
View Source
var DenseDynamiteActionID = ActionID{ItemID: 18641}
View Source
var DivineGuardianAuraTag = "DivineGuardian"
View Source
var DodgePerAgiAtLevel = map[proto.Class]map[int]float64{
	proto.Class_ClassUnknown: {25: 0.0, 40: 0.0, 50: 0.0, 60: 0.0},
	proto.Class_ClassWarrior: {25: 0.1111, 40: 0.0758, 50: 0.0610, 60: 0.0500},
	proto.Class_ClassPaladin: {25: 0.1075, 40: 0.0741, 50: 0.0606, 60: 0.0506},
	proto.Class_ClassHunter:  {25: 0.1030, 40: 0.0606, 50: 0.0468, 60: 0.0378},
	proto.Class_ClassRogue:   {25: 0.1904, 40: 0.1112, 50: 0.0854, 60: 0.0690},
	proto.Class_ClassPriest:  {25: 0.0769, 40: 0.0645, 50: 0.0571, 60: 0.0500},
	proto.Class_ClassShaman:  {25: 0.0971, 40: 0.0717, 50: 0.0600, 60: 0.0508},
	proto.Class_ClassMage:    {25: 0.0720, 40: 0.0621, 50: 0.0563, 60: 0.0514},
	proto.Class_ClassWarlock: {25: 0.0909, 40: 0.0698, 50: 0.0588, 60: 0.0500},
	proto.Class_ClassDruid:   {25: 0.1025, 40: 0.0719, 50: 0.0594, 60: 0.0500},
}

Dodge agility scaling

View Source
var EnchantsByEffectID = map[int32]Enchant{}
View Source
var EzThroRadiationBombActionID = ActionID{ItemID: 215168}
View Source
var FullBuffsPhase1 = BuffsCombo{
	Label: "Phase 1 Buffs",

	Debuffs: FullDebuffsPhase1,
	Party:   FullPartyBuffs,
	Player:  FullIndividualBuffsPhase1,
	Raid:    FullRaidBuffsPhase1,
}
View Source
var FullBuffsPhase2 = BuffsCombo{
	Label: "Phase 2 Buffs",

	Debuffs: FullDebuffsPhase2,
	Party:   FullPartyBuffs,
	Player:  FullIndividualBuffsPhase2,
	Raid:    FullRaidBuffsPhase2,
}
View Source
var FullBuffsPhase3 = BuffsCombo{
	Label: "Phase 3 Buffs",

	Debuffs: FullDebuffsPhase3,
	Party:   FullPartyBuffs,
	Player:  FullIndividualBuffsPhase3,
	Raid:    FullRaidBuffsPhase3,
}
View Source
var FullDebuffsPhase1 = &proto.Debuffs{
	CurseOfElementsNew:   proto.TristateEffect_TristateEffectRegular,
	CurseOfRecklessness:  true,
	CurseOfVulnerability: true,
	CurseOfWeakness:      proto.TristateEffect_TristateEffectImproved,
	DemoralizingRoar:     proto.TristateEffect_TristateEffectImproved,
	DemoralizingShout:    proto.TristateEffect_TristateEffectImproved,
	Dreamstate:           true,
	ExposeArmor:          proto.TristateEffect_TristateEffectImproved,
	FaerieFire:           true,
	InsectSwarm:          true,
	ImprovedShadowBolt:   true,
	ScorpidSting:         true,
	SunderArmor:          true,
	ThunderClap:          proto.TristateEffect_TristateEffectImproved,
}
View Source
var FullDebuffsPhase2 = &proto.Debuffs{
	CurseOfElementsNew:     proto.TristateEffect_TristateEffectRegular,
	CurseOfRecklessness:    true,
	CurseOfVulnerability:   true,
	CurseOfWeakness:        proto.TristateEffect_TristateEffectImproved,
	DemoralizingRoar:       proto.TristateEffect_TristateEffectImproved,
	DemoralizingShout:      proto.TristateEffect_TristateEffectImproved,
	Dreamstate:             true,
	ExposeArmor:            proto.TristateEffect_TristateEffectImproved,
	FaerieFire:             true,
	InsectSwarm:            true,
	ImprovedScorch:         true,
	ImprovedShadowBolt:     true,
	JudgementOfLight:       true,
	JudgementOfWisdom:      true,
	JudgementOfTheCrusader: proto.TristateEffect_TristateEffectImproved,
	ScorpidSting:           true,
	ShadowWeaving:          true,
	Stormstrike:            true,
	SunderArmor:            true,
	ThunderClap:            proto.TristateEffect_TristateEffectImproved,
	WintersChill:           true,
}
View Source
var FullDebuffsPhase3 = &proto.Debuffs{
	CurseOfElementsNew:     proto.TristateEffect_TristateEffectRegular,
	CurseOfShadowNew:       proto.TristateEffect_TristateEffectRegular,
	CurseOfRecklessness:    true,
	CurseOfVulnerability:   true,
	CurseOfWeakness:        proto.TristateEffect_TristateEffectImproved,
	DemoralizingRoar:       proto.TristateEffect_TristateEffectImproved,
	DemoralizingShout:      proto.TristateEffect_TristateEffectImproved,
	Dreamstate:             true,
	ExposeArmor:            proto.TristateEffect_TristateEffectImproved,
	FaerieFire:             true,
	InsectSwarm:            true,
	ImprovedScorch:         true,
	ImprovedShadowBolt:     true,
	JudgementOfLight:       true,
	JudgementOfWisdom:      true,
	JudgementOfTheCrusader: proto.TristateEffect_TristateEffectImproved,
	ScorpidSting:           true,
	ShadowWeaving:          true,
	Stormstrike:            true,
	SunderArmor:            true,
	ThunderClap:            proto.TristateEffect_TristateEffectImproved,
	WintersChill:           true,
}
View Source
var FullIndividualBuffsPhase1 = &proto.IndividualBuffs{
	AshenvalePvpBuff:  true,
	BlessingOfKings:   true,
	BlessingOfMight:   proto.TristateEffect_TristateEffectImproved,
	BlessingOfWisdom:  proto.TristateEffect_TristateEffectImproved,
	BoonOfBlackfathom: true,
	SaygesFortune:     proto.SaygesFortune_SaygesDamage,
}
View Source
var FullIndividualBuffsPhase2 = &proto.IndividualBuffs{
	BlessingOfKings:     true,
	BlessingOfMight:     proto.TristateEffect_TristateEffectImproved,
	BlessingOfSanctuary: true,
	BlessingOfWisdom:    proto.TristateEffect_TristateEffectImproved,
	SaygesFortune:       proto.SaygesFortune_SaygesDamage,
	SparkOfInspiration:  true,
}
View Source
var FullIndividualBuffsPhase3 = &proto.IndividualBuffs{
	BlessingOfKings:           true,
	BlessingOfMight:           proto.TristateEffect_TristateEffectImproved,
	BlessingOfSanctuary:       true,
	BlessingOfWisdom:          proto.TristateEffect_TristateEffectImproved,
	FervorOfTheTempleExplorer: true,
	SaygesFortune:             proto.SaygesFortune_SaygesDamage,
	SongflowerSerenade:        true,
}
View Source
var FullPartyBuffs = &proto.PartyBuffs{}
View Source
var FullRaidBuffsPhase2 = &proto.RaidBuffs{
	ArcaneBrilliance:      true,
	AspectOfTheLion:       true,
	BattleShout:           proto.TristateEffect_TristateEffectImproved,
	BloodPact:             proto.TristateEffect_TristateEffectImproved,
	DevotionAura:          proto.TristateEffect_TristateEffectImproved,
	DivineSpirit:          true,
	FireResistanceAura:    true,
	FireResistanceTotem:   true,
	FrostResistanceAura:   true,
	FrostResistanceTotem:  true,
	GiftOfTheWild:         proto.TristateEffect_TristateEffectImproved,
	LeaderOfThePack:       true,
	ManaSpringTotem:       proto.TristateEffect_TristateEffectImproved,
	MoonkinAura:           true,
	NatureResistanceTotem: true,
	PowerWordFortitude:    proto.TristateEffect_TristateEffectImproved,
	RetributionAura:       proto.TristateEffect_TristateEffectImproved,
	ShadowProtection:      true,
	StrengthOfEarthTotem:  proto.TristateEffect_TristateEffectImproved,
	Thorns:                proto.TristateEffect_TristateEffectImproved,
	TrueshotAura:          true,
	SanctityAura:          true,
}
View Source
var FullRaidBuffsPhase3 = &proto.RaidBuffs{
	ArcaneBrilliance:      true,
	AspectOfTheLion:       true,
	BattleShout:           proto.TristateEffect_TristateEffectImproved,
	BloodPact:             proto.TristateEffect_TristateEffectImproved,
	DevotionAura:          proto.TristateEffect_TristateEffectImproved,
	DivineSpirit:          true,
	FireResistanceAura:    true,
	FireResistanceTotem:   true,
	FrostResistanceAura:   true,
	FrostResistanceTotem:  true,
	GiftOfTheWild:         proto.TristateEffect_TristateEffectImproved,
	GraceOfAirTotem:       proto.TristateEffect_TristateEffectImproved,
	LeaderOfThePack:       true,
	ManaSpringTotem:       proto.TristateEffect_TristateEffectImproved,
	MoonkinAura:           true,
	NatureResistanceTotem: true,
	PowerWordFortitude:    proto.TristateEffect_TristateEffectImproved,
	RetributionAura:       proto.TristateEffect_TristateEffectImproved,
	ShadowProtection:      true,
	StrengthOfEarthTotem:  proto.TristateEffect_TristateEffectImproved,
	Thorns:                proto.TristateEffect_TristateEffectImproved,
	TrueshotAura:          true,
	SanctityAura:          true,
}
View Source
var GoblinLandMineActionID = ActionID{ItemID: 4395}
View Source
var GuardianSpiritAuraTag = "GuardianSpirit"
View Source
var HandOfSacrificeAuraTag = "HandOfSacrifice"
View Source
var HighYieldRadiationBombActionID = ActionID{ItemID: 215127}
View Source
var InnervateAuraTag = "Innervate"
View Source
var ItemsByID = map[int32]Item{}
View Source
var LevelToBuffRank = map[BuffName]map[int32]int32{
	BattleShout: {
		25: 3,
		40: 4,
		50: 5,
		60: 7,
	},
	GraceOfAir: {
		50: 1,
		60: 3,
	},
	StrengthOfEarth: {
		25: 2,
		40: 3,
		50: 3,
		60: 5,
	},
	Windfury: {
		40: 1,
		50: 2,
		60: 3,
	},
}
View Source
var LevelToDebuffRank = map[DebuffName]map[int32]int32{
	DemoralizingShout: {
		25: 2,
		40: 3,
		50: 4,
		60: 5,
	},
}
View Source
var ManaTideTotemActionID = ActionID{SpellID: 16190}
View Source
var ManaTideTotemAuraTag = "ManaTideTotem"
View Source
var PainSuppressionAuraTag = "PainSuppression"
View Source
var PowerInfusionActionID = ActionID{SpellID: 10060}
View Source
var PowerInfusionAuraTag = "PowerInfusion"
View Source
var PresetEncounters []*proto.PresetEncounter
View Source
var RandomSuffixesByID = map[int32]RandomSuffix{}
View Source
var SapperActionID = ActionID{ItemID: 10646}
View Source
var SolidDynamiteActionID = ActionID{ItemID: 10507}
View Source
var StatWeightsDefaultSimTestOptions = &proto.SimOptions{
	Iterations: 300,
	IsTest:     true,
	Debug:      false,
	RandomSeed: 101,
}
View Source
var ThoriumGrenadeActionID = ActionID{ItemID: 15993}
View Source
var TricksOfTheTradeAuraTag = "TricksOfTheTrade"
View Source
var UnholyFrenzyAuraTag = "UnholyFrenzy"
View Source
var WITH_DB = false

Functions

func APLRotationFromJsonString

func APLRotationFromJsonString(jsonString string) *proto.APLRotation

func AddPresetEncounter

func AddPresetEncounter(name string, targetPaths []string)

func AddPresetTarget

func AddPresetTarget(newPreset *PresetTarget)

func AddWeaponEffect

func AddWeaponEffect(id int32, weaponEffect ApplyWeaponEffect)

func ApplyAtalAiProc added in v0.0.3

func ApplyAtalAiProc(character *Character, atalaiBuff proto.ZanzaBuff)

func ApplyFixedUptimeAura

func ApplyFixedUptimeAura(aura *Aura, uptime float64, tickLength time.Duration, startTime time.Duration)

func ApplyInspiration

func ApplyInspiration(character *Character, uptime float64)

func ApplyPetConsumeEffects

func ApplyPetConsumeEffects(pet *Character, ownerConsumes *proto.Consumes)

func ApplyProcTriggerCallback

func ApplyProcTriggerCallback(unit *Unit, aura *Aura, config ProcTrigger)

func BlessingOfSanctuaryAura

func BlessingOfSanctuaryAura(character *Character)

func BothTimersReady

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

func BothTimersReadyAt

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

func BulkSim

func BulkSim(ctx context.Context, request *proto.BulkSimRequest, progress chan *proto.ProgressMetrics) *proto.BulkSimResult

func CharacterStatsTest

func CharacterStatsTest(label string, t *testing.T, raid *proto.Raid, expectedStats stats.Stats)

func ComputeStats

*

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

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 EquipmentSpecFromJsonString

func EquipmentSpecFromJsonString(jsonString string) *proto.EquipmentSpec

func ExternalIsbCaster added in v0.0.4

func ExternalIsbCaster(_ *proto.Debuffs, target *Unit)

func FillTalentsProto

func 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. treeSizes should contain the number of talents in each tree, usually around 30. This is needed because talent strings truncate 0's at the end of each tree, so we can't infer the start index of the tree from the string.

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 GetPrimaryTalentTreeIndex

func GetPrimaryTalentTreeIndex(talentStr string) uint8

Returns the talent tree (0, 1, or 2) of the tree with the most points.

talentStr is expected to be a wowhead-formatted talent string, e.g. "12123131-123123123-123123213"

func GetTristateValueFloat

func GetTristateValueFloat(effect proto.TristateEffect, regularValue float64, impValue float64) float64

func GetTristateValueInt32

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

func GetWeaponSkill

func GetWeaponSkill(unit *Unit, weapon *Item) float64

func HasEnchantEffect

func HasEnchantEffect(id int32) bool

func HasItemEffect

func HasItemEffect(id int32) bool

func HasItemEffectForTest

func HasItemEffectForTest(id int32) bool

func HasWeaponEffect

func HasWeaponEffect(id int32) bool

func InnervateManaThreshold

func InnervateManaThreshold(character *Character) float64

func ItemTypeToSlot

func ItemTypeToSlot(it proto.ItemType) proto.ItemSlot

func MakeSingleTargetEncounter

func MakeSingleTargetEncounter(playerLevel int32, 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 ModNonMeleeAttackTable

func ModNonMeleeAttackTable(table *AttackTable, attacker *Unit, defender *Unit, weapon *Item)

func MultiSchoolShouldUseArmor

func MultiSchoolShouldUseArmor(spell *Spell, target *Unit) bool

Decide whether to use armor for physical multi school spells.

TODO: This is most likely not accurate for the case: armor near resistance but not 0

A short test showed that the game uses armor if it's far enough below resistance, but not simply if it's lower. 49 (and above) armor vs 57 res => used resistance 7 (and below) armor vs 57 res => used armor/no partials anymore If level based resist is used in this decission process is also not known as it was tested PvP.

For most purposes this should work fine for now, but should be properly tested and fixed if spells using it become important and boss armor can actually go below (level based) resistance values.

func NewDefaultTarget

func NewDefaultTarget(playerLevel int32) *proto.Target

func NewEnchantEffect

func NewEnchantEffect(id int32, enchantEffect ApplyEffect)

func NewItemEffect

func NewItemEffect(id int32, itemEffect ApplyEffect)

Registers an ApplyEffect function which will be called before the Sim starts, for any Agent that is wearing the item.

func NewSimpleStatDefensiveTrinketEffect

func NewSimpleStatDefensiveTrinketEffect(itemID int32, bonus stats.Stats, duration time.Duration, cooldown time.Duration)

func NewSimpleStatItemActiveEffect

func NewSimpleStatItemActiveEffect(itemID int32, bonus stats.Stats, duration time.Duration, cooldown time.Duration, sharedCDFunc func(*Character) Cooldown, otherEffects ApplyEffect)

func NewSimpleStatItemEffect

func NewSimpleStatItemEffect(itemID int32, bonus stats.Stats, duration time.Duration, cooldown time.Duration)

No shared CD

func NewSimpleStatOffensiveTrinketEffect

func NewSimpleStatOffensiveTrinketEffect(itemID int32, bonus stats.Stats, duration time.Duration, cooldown time.Duration)

func NewSimpleStatOffensiveTrinketEffectWithOtherEffects

func NewSimpleStatOffensiveTrinketEffectWithOtherEffects(itemID int32, bonus stats.Stats, duration time.Duration, cooldown time.Duration, otherEffects ApplyEffect)

func PlayerProtoToSpec

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

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 RegisterAgentFactory

func RegisterAgentFactory(emptyOptions interface{}, spec proto.Spec, factory AgentFactory, specSetter SpecSetter)

func RegisterTemporaryStatsOnUseCD

func RegisterTemporaryStatsOnUseCD(character *Character, auraLabel string, tempStats stats.Stats, duration time.Duration, config SpellConfig)

Add a major cooldown to the given agent, which provides a temporary boost to a single stat. This is use for effects like Icon of the Silver Crescent and Bloodlust Brooch.

func RunBulkSim

func RunBulkSim(request *proto.BulkSimRequest) *proto.BulkSimResult

func RunBulkSimAsync

func RunBulkSimAsync(ctx context.Context, request *proto.BulkSimRequest, progress chan *proto.ProgressMetrics)

func RunRaidSim

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

*

  • Runs multiple iterations of the sim with a full raid.

func RunRaidSimAsync

func RunRaidSimAsync(request *proto.RaidSimRequest, progress chan *proto.ProgressMetrics)

func RunSim

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

func RunTestSuite

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

func ScheduledMajorArmorAura

func ScheduledMajorArmorAura(aura *Aura, options PeriodicActionOptions, _ *proto.Raid)

func SinglePlayerRaidProto

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

func StatWeights

func StatWeights(request *proto.StatWeightsRequest) *proto.StatWeightsResult

*

  • Returns stat weights and EP values, with standard deviations, for all stats.

func StatWeightsAsync

func StatWeightsAsync(request *proto.StatWeightsRequest, progress chan *proto.ProgressMetrics)

func StatWeightsTest

func StatWeightsTest(label string, t *testing.T, _swr *proto.StatWeightsRequest, expectedStatWeights stats.Stats)

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 UnitLevelFloat64

func UnitLevelFloat64(unitLevel int32, maxLevelPlus0Val float64, maxLevelPlus1Val float64, maxLevelPlus2Val float64, maxLevelPlus3Val float64) float64

TODO: Classic lower levels comparison

func WithSpec

func WithSpec(player *proto.Player, spec interface{}) *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 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) Reset

func (impl APLActionActivateAura) Reset(*Simulation)

func (*APLActionActivateAura) String

func (action *APLActionActivateAura) String() string

type APLActionActivateAuraWithStacks added in v0.0.3

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

func (*APLActionActivateAuraWithStacks) Execute added in v0.0.3

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

func (APLActionActivateAuraWithStacks) Finalize added in v0.0.3

func (impl APLActionActivateAuraWithStacks) Finalize(*APLRotation)

func (APLActionActivateAuraWithStacks) GetAPLValues added in v0.0.3

func (impl APLActionActivateAuraWithStacks) GetAPLValues() []APLValue

func (APLActionActivateAuraWithStacks) GetInnerActions added in v0.0.3

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

func (APLActionActivateAuraWithStacks) GetNextAction added in v0.0.3

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

func (*APLActionActivateAuraWithStacks) IsReady added in v0.0.3

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

func (APLActionActivateAuraWithStacks) Reset added in v0.0.3

func (impl APLActionActivateAuraWithStacks) Reset(*Simulation)

func (*APLActionActivateAuraWithStacks) String added in v0.0.3

func (action *APLActionActivateAuraWithStacks) String() string

type APLActionAddComboPoints added in v0.0.5

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

func (*APLActionAddComboPoints) Execute added in v0.0.5

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

func (APLActionAddComboPoints) Finalize added in v0.0.5

func (impl APLActionAddComboPoints) Finalize(*APLRotation)

func (APLActionAddComboPoints) GetAPLValues added in v0.0.5

func (impl APLActionAddComboPoints) GetAPLValues() []APLValue

func (APLActionAddComboPoints) GetInnerActions added in v0.0.5

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

func (APLActionAddComboPoints) GetNextAction added in v0.0.5

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

func (*APLActionAddComboPoints) IsReady added in v0.0.5

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

func (APLActionAddComboPoints) Reset added in v0.0.5

func (impl APLActionAddComboPoints) Reset(*Simulation)

func (*APLActionAddComboPoints) String added in v0.0.5

func (action *APLActionAddComboPoints) 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) 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) Reset

func (impl APLActionCancelAura) Reset(*Simulation)

func (*APLActionCancelAura) String

func (action *APLActionCancelAura) 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) 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) Reset

func (impl APLActionChangeTarget) Reset(*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) 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) Reset

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

func (*APLActionCustomRotation) String

func (action *APLActionCustomRotation) String() string

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)

	// 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

	// 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) 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 (impl 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) Reset

func (impl APLActionMove) Reset(*Simulation)

func (*APLActionMove) String

func (action *APLActionMove) 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) 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) Reset

func (action *APLActionMultishield) Reset(*Simulation)

func (*APLActionMultishield) String

func (action *APLActionMultishield) 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) 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) 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) Reset

func (action *APLActionSequence) Reset(*Simulation)

func (*APLActionSequence) String

func (action *APLActionSequence) 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) 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) 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) 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) Reset

func (impl APLActionWaitUntil) Reset(*Simulation)

func (*APLActionWaitUntil) String

func (action *APLActionWaitUntil) String() string

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

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

func (*APLRotation) ValidationWarning

func (rot *APLRotation) ValidationWarning(message string, vals ...interface{})

type APLRune added in v0.0.4

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

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 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 APLValueAuraICDIsReadyWithReactionTime

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

func (*APLValueAuraICDIsReadyWithReactionTime) GetBool

func (*APLValueAuraICDIsReadyWithReactionTime) String

func (*APLValueAuraICDIsReadyWithReactionTime) 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 APLValueAuraIsActiveWithReactionTime

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

func (*APLValueAuraIsActiveWithReactionTime) GetBool

func (*APLValueAuraIsActiveWithReactionTime) String

func (*APLValueAuraIsActiveWithReactionTime) Type

type APLValueAuraIsKnown added in v0.0.3

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

func (*APLValueAuraIsKnown) GetBool added in v0.0.3

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

func (*APLValueAuraIsKnown) String added in v0.0.3

func (value *APLValueAuraIsKnown) String() string

func (*APLValueAuraIsKnown) Type added in v0.0.3

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

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 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 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(_ *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(_ *Simulation) float64

func (*APLValueCurrentEnergy) String

func (value *APLValueCurrentEnergy) String() string

func (*APLValueCurrentEnergy) Type

type APLValueCurrentHealth

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

func (*APLValueCurrentHealth) GetFloat

func (value *APLValueCurrentHealth) GetFloat(_ *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(_ *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(_ *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(_ *Simulation) float64

func (*APLValueCurrentManaPercent) String

func (value *APLValueCurrentManaPercent) String() string

func (*APLValueCurrentManaPercent) Type

type APLValueCurrentRage

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

func (*APLValueCurrentRage) GetFloat

func (value *APLValueCurrentRage) GetFloat(_ *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 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 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 APLValueEnergyThreshold added in v0.0.7

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

func (*APLValueEnergyThreshold) GetBool added in v0.0.7

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

func (*APLValueEnergyThreshold) String added in v0.0.7

func (value *APLValueEnergyThreshold) String() string

func (*APLValueEnergyThreshold) Type added in v0.0.7

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

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 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 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 APLValueNumberTargets

type APLValueNumberTargets struct {
	DefaultAPLValueImpl
}

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 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 APLValueRuneIsEquipped added in v0.0.4

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

func (*APLValueRuneIsEquipped) GetBool added in v0.0.4

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

func (*APLValueRuneIsEquipped) String added in v0.0.4

func (value *APLValueRuneIsEquipped) String() string

func (*APLValueRuneIsEquipped) Type added in v0.0.4

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 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 APLValueSpellIsKnown added in v0.0.3

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

func (*APLValueSpellIsKnown) GetBool added in v0.0.3

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

func (*APLValueSpellIsKnown) String added in v0.0.3

func (value *APLValueSpellIsKnown) String() string

func (*APLValueSpellIsKnown) Type added in v0.0.3

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

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 APLValueSpellTimeToReady

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

func (*APLValueSpellTimeToReady) GetDuration

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

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 APLValueTimeToEnergyTick

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

func (*APLValueTimeToEnergyTick) GetDuration

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

func (*APLValueTimeToEnergyTick) String

func (value *APLValueTimeToEnergyTick) String() string

func (*APLValueTimeToEnergyTick) Type

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

	// Metrics for this action, for each possible target.
	Targets []TargetedActionMetrics
}

func (*ActionMetrics) ToProto

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

type ActionPriority

type ActionPriority int32
const (
	ActionPriorityLow ActionPriority = -1
	ActionPriorityGCD ActionPriority = 0

	// Higher than GCD because regen can cause GCD actions (if we were waiting
	// for mana).
	ActionPriorityRegen ActionPriority = 1

	// Autos can cause regen (JoW, rage, energy procs, etc) so they should be
	// higher prio so that we never go backwards in the priority order.
	ActionPriorityAuto ActionPriority = 2

	// DOTs need to be higher than anything else so that dots can properly expire before we take other actions.
	ActionPriorityDOT ActionPriority = 3

	ActionPriorityPrePull ActionPriority = 10
)

type ActiveSetBonus

type ActiveSetBonus struct {
	// Name of the set.
	Name string

	// Number of pieces required for this bonus.
	NumPieces int32

	// Function for applying the effects of this set bonus.
	BonusEffect ApplyEffect
}

type Agent

type Agent interface {
	// The Character controlled by this Agent.
	GetCharacter() *Character

	// Called once after all Players/Pets/Targets have finished the construction phase.
	// Use this to register spells and any initialization steps that require
	// other raid members or auras.
	Initialize()

	// Updates the input Buffs to include raid-wide buffs provided by this Agent.
	AddRaidBuffs(raidBuffs *proto.RaidBuffs)
	// Updates the input Buffs to include party-wide buffs provided by this Agent.
	AddPartyBuffs(partyBuffs *proto.PartyBuffs)

	// All talent and runes 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()
	ApplyRunes()

	// Returns this Agent to its initial state. Called before each Sim iteration
	// and once after the final iteration.
	Reset(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) Agent

Constructs a new Agent.

type AgentFactory

type AgentFactory func(*Character, *proto.Player) 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.

func MakeTemporaryStatsOnUseCDRegistration

func MakeTemporaryStatsOnUseCDRegistration(auraLabel string, tempStats stats.Stats, duration time.Duration, config SpellConfig, cdFunc func(*Character) Cooldown, sharedCDFunc func(*Character) Cooldown) ApplyEffect

Helper function to make an ApplyEffect for a temporary stats on-use cooldown.

type ApplySpellResults

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

type ApplyWeaponEffect

type ApplyWeaponEffect func(Agent, proto.ItemSlot)

Function for applying permanent effects to an agent's weapon

type AttackTable

type AttackTable struct {
	Attacker *Unit
	Defender *Unit

	Weapon *Item

	BaseMissChance      float64
	HitSuppression      float64
	BaseSpellMissChance float64
	BaseBlockChance     float64
	BaseDodgeChance     float64
	BaseParryChance     float64
	BaseGlanceChance    float64
	BaseCritChance      float64

	GlanceMultiplierMin  float64
	GlanceMultiplierMax  float64
	MeleeCritSuppression float64
	SpellCritSuppression float64

	// All "Apply Aura: Mod All Damage Done Against Creature" effects in Vanilla and TBC also increase the CritMultiplier.
	//  Explicitly for hunters' "Monster Slaying" and "Humanoid Slaying", but likewise for rogues' "Murder", or trolls' "Beastslaying".
	CritMultiplier float64

	DamageDealtMultiplier float64 // attacker buff, applied in applyAttackerModifiers()
	DamageTakenMultiplier float64 // defender debuff, applied in applyTargetModifiers()

	// This is for "Apply Aura: Mod Damage Done By Caster" effects.
	// If set, the damage taken multiplier is multiplied by the callbacks result.
	DamageDoneByCasterMultiplier func(spell *Spell, attackTable *AttackTable) float64
}

Holds cached values for outcome/damage calculations, for a specific attacker+defender pair. These are updated dynamically when attacker or defender stats change.

func NewAttackTable

func NewAttackTable(attacker *Unit, defender *Unit, weapon *Item) *AttackTable

func (*AttackTable) GetArmorDamageModifier

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

func (*AttackTable) GetBinaryHitChance

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

func (*AttackTable) GetPartialResistThresholds

func (at *AttackTable) GetPartialResistThresholds(spell *Spell, pureDot bool) (float64, float64, float64)

type Aura

type Aura struct {
	// String label for this Aura. Guaranteed to be unique among the Auras for a single Unit.
	Label string

	// For easily grouping auras.
	Tag string

	ActionID        ActionID // If set, metrics will be tracked for this aura.
	ActionIDForProc ActionID // If set, indicates that this aura is a trigger aura for the specified proc.

	Icd *Cooldown // The internal cooldown 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.
	OnStatsChange   OnStatsChange  // Invoked when the stats of this aura owner changes.

	OnCastComplete        OnCastComplete   // Invoked when a spell cast completes casting, before results are calculated.
	OnSpellHitDealt       OnSpellHit       // Invoked when a spell hits and this unit is the caster.
	OnSpellHitTaken       OnSpellHit       // Invoked when a spell hits and this unit is the target.
	OnPeriodicDamageDealt OnPeriodicDamage // Invoked when a dot tick occurs and this unit is the caster.
	OnPeriodicDamageTaken OnPeriodicDamage // Invoked when a dot tick occurs and this unit is the target.
	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.
	OnRageChange          OnRageChange     // Invoked when unit's rage value changes.

	// 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 AncientCorrosivePoisonAura

func AncientCorrosivePoisonAura(target *Unit) *Aura

func ApplyWildStrikes

func ApplyWildStrikes(character *Character) *Aura

func ApplyWindfury

func ApplyWindfury(character *Character) *Aura

func BattleShoutAura

func BattleShoutAura(unit *Unit, impBattleShout int32, boomingVoicePts int32) *Aura

func BattleSquawkAura added in v0.0.3

func BattleSquawkAura(character *Unit, stackcount int32) *Aura

func BlessingOfMightAura

func BlessingOfMightAura(unit *Unit, impBomPts int32, level int32) *Aura

func BloodlustAura

func BloodlustAura(character *Character, actionTag int32) *Aura

func CommandingShoutAura

func CommandingShoutAura(unit *Unit, commandingPresencePts int32, boomingVoicePts int32) *Aura

func CrystalYieldAura

func CrystalYieldAura(target *Unit) *Aura

func CurseOfElementsAura

func CurseOfElementsAura(target *Unit, playerLevel int32) *Aura

func CurseOfRecklessnessAura

func CurseOfRecklessnessAura(target *Unit, playerLevel int32) *Aura

func CurseOfShadowAura

func CurseOfShadowAura(target *Unit, playerLevel int32) *Aura

func CurseOfVulnerabilityAura

func CurseOfVulnerabilityAura(target *Unit) *Aura

func CurseOfWeaknessAura

func CurseOfWeaknessAura(target *Unit, points int32, _ int32) *Aura

TODO: Classic

func DemonicPactAura

func DemonicPactAura(unit *Unit, spellpower float64, buildPhase CharacterBuildPhase) *Aura

func DemoralizingRoarAura

func DemoralizingRoarAura(target *Unit, points int32, _ int32) *Aura

TODO: Classic

func DemoralizingShoutAura

func DemoralizingShoutAura(target *Unit, boomingVoicePts int32, impDemoShoutPts int32, _ int32) *Aura

func DragonBreathChiliAura

func DragonBreathChiliAura(character *Character) *Aura

func DreamstateAura

func DreamstateAura(unit *Unit) *Aura

func ExposeArmorAura

func ExposeArmorAura(target *Unit, improvedEA int32, playerLevel int32) *Aura

func FaerieFireAura

func FaerieFireAura(target *Unit, playerLevel int32) *Aura

func GiftOfArthasAura

func GiftOfArthasAura(target *Unit) *Aura

func GraceOfAirTotemAura

func GraceOfAirTotemAura(unit *Unit, level int32, multiplier float64) *Aura

func GuardianSpiritAura

func GuardianSpiritAura(character *Character, actionTag int32) *Aura

func HandOfSacrificeAura

func HandOfSacrificeAura(character *Character, actionTag int32) *Aura

func HemorrhageAura

func HemorrhageAura(target *Unit, casterLevel int32) *Aura

func HomunculiArmorAura

func HomunculiArmorAura(target *Unit, playerLevel int32) *Aura

func HomunculiAttackPowerAura

func HomunculiAttackPowerAura(target *Unit, playerLevel int32) *Aura

func HomunculiAttackSpeedAura

func HomunculiAttackSpeedAura(target *Unit, _ int32) *Aura

func HuntersMarkAura

func HuntersMarkAura(target *Unit, points int32, playerLevel int32) *Aura

func ImprovedScorchAura

func ImprovedScorchAura(target *Unit) *Aura

func ImprovedShadowBoltAura

func ImprovedShadowBoltAura(unit *Unit, rank int32) *Aura

func InnervateAura

func InnervateAura(character *Character, actionTag int32) *Aura

func InsectSwarmAura

func InsectSwarmAura(target *Unit) *Aura

func InspirationAura

func InspirationAura(unit *Unit, points int32) *Aura

TODO: Classic

func JudgementOfLightAura

func JudgementOfLightAura(target *Unit) *Aura

func JudgementOfTheCrusaderAura added in v0.0.5

func JudgementOfTheCrusaderAura(caster *Unit, target *Unit, level int32, mult float64, extraBonus float64) *Aura

func JudgementOfWisdomAura

func JudgementOfWisdomAura(target *Unit, level int32) *Aura

TODO: Classic verify logic

func MakePermanent

func MakePermanent(aura *Aura) *Aura

Returns the same Aura for chaining.

func MakeProcTriggerAura

func MakeProcTriggerAura(unit *Unit, config ProcTrigger) *Aura

func MakeStackingAura

func MakeStackingAura(character *Character, config StackingStatAura) *Aura

func ManaTideTotemAura

func ManaTideTotemAura(character *Character, actionTag int32) *Aura

func MangleAura

func MangleAura(target *Unit, _ int32) *Aura

func MekkatorqueFistDebuffAura

func MekkatorqueFistDebuffAura(target *Unit, playerLevel int32) *Aura

func PainSuppressionAura

func PainSuppressionAura(character *Character, actionTag int32) *Aura

func PowerInfusionAura

func PowerInfusionAura(character *Unit, actionTag int32) *Aura

func RetributionAura

func RetributionAura(character *Character, sanctifiedRetribution bool) *Aura

func ScorpidStingAura

func ScorpidStingAura(target *Unit) *Aura

func SerpentsStrikerFistDebuffAura added in v0.0.3

func SerpentsStrikerFistDebuffAura(target *Unit, playerLevel int32) *Aura

func ShadowWeavingAura

func ShadowWeavingAura(unit *Unit, rank int) *Aura

func StormstrikeAura

func StormstrikeAura(unit *Unit) *Aura

func StrengthOfEarthTotemAura

func StrengthOfEarthTotemAura(unit *Unit, level int32, multiplier float64) *Aura

func SunderArmorAura

func SunderArmorAura(target *Unit, playerLevel int32) *Aura

func ThornsAura

func ThornsAura(character *Character, points int32) *Aura

func ThunderClapAura

func ThunderClapAura(target *Unit, spellID int32, duration time.Duration, atkSpeedReductionPercent int32) *Aura

func TricksOfTheTradeAura

func TricksOfTheTradeAura(character *Unit, actionTag int32) *Aura

func VindicationAura

func VindicationAura(target *Unit, points int32, _ int32) *Aura

TODO: Classic

func WaylayAura

func WaylayAura(target *Unit) *Aura

func WintersChillAura

func WintersChillAura(target *Unit, startingStacks int32) *Aura

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, numStacks int32)

func (*Aura) ApplyOnExpire

func (aura *Aura) ApplyOnExpire(newOnExpire OnExpire)

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

func (*Aura) ApplyOnGain

func (aura *Aura) ApplyOnGain(newOnGain OnGain)

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

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

func (aura *Aura) GetStacks() int32

func (*Aura) IsActive

func (aura *Aura) IsActive() bool

func (*Aura) NewExclusiveEffect

func (aura *Aura) NewExclusiveEffect(categoryName string, singleAura bool, config ExclusiveEffect) *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) 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) UpdateExpires

func (aura *Aura) UpdateExpires(sim *Simulation, newExpires time.Duration)

type AuraArray

type AuraArray []*Aura

func (AuraArray) Get

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

type AuraCallback

type AuraCallback uint16
const (
	CallbackEmpty AuraCallback = 0

	CallbackOnSpellHitDealt AuraCallback = 1 << iota
	CallbackOnSpellHitTaken
	CallbackOnPeriodicDamageDealt
	CallbackOnHealDealt
	CallbackOnPeriodicHealDealt
	CallbackOnCastComplete
)

func (AuraCallback) Matches

func (c AuraCallback) Matches(other AuraCallback) bool

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 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
}

Options for initializing auto attacks.

type AutoAttacks

type AutoAttacks struct {
	AutoSwingMelee  bool
	AutoSwingRanged 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) DelayMeleeBy

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

Delays all swing timers for the specified amount. Only used by Slam.

func (*AutoAttacks) DelayRangedUntil

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

func (*AutoAttacks) EnableAutoSwing

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

Re-enables the auto swing action for the iteration

func (*AutoAttacks) ExtraMHAttack

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

ExtraMHAttack should be used for all "extra attack" procs in Classic Era versions, including Wild Strikes and Hand of Justice. In vanilla, these procs don't actually grant a full extra attack, but instead just advance the MH swing timer.

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

func (aa *AutoAttacks) NewPPMManager(ppm float64, procMask ProcMask) PPMManager

func (*AutoAttacks) NextAnyAttackAt

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

Returns the time at which the next attack will occur.

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 time at which the next ranged attack will occur.

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

func (aa *AutoAttacks) Ranged() *Weapon

func (*AutoAttacks) RangedAuto

func (aa *AutoAttacks) RangedAuto() *Spell

func (*AutoAttacks) RangedConfig

func (aa *AutoAttacks) RangedConfig() *SpellConfig

func (*AutoAttacks) RangedSwingSpeed

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

The amount of time between two Ranged swings.

func (*AutoAttacks) SetMH

func (aa *AutoAttacks) SetMH(weapon Weapon)

func (*AutoAttacks) SetOH

func (aa *AutoAttacks) SetOH(weapon Weapon)

func (*AutoAttacks) SetOffhandSwingAt

func (aa *AutoAttacks) SetOffhandSwingAt(offhandSwingAt time.Duration)

func (*AutoAttacks) SetRanged

func (aa *AutoAttacks) SetRanged(weapon Weapon)

func (*AutoAttacks) SetReplaceMHSwing

func (aa *AutoAttacks) SetReplaceMHSwing(replaceSwing ReplaceMHSwing)

func (*AutoAttacks) StopMeleeUntil

func (aa *AutoAttacks) StopMeleeUntil(sim *Simulation, readyAt time.Duration, desyncOH bool)

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

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

type BaseStatsKey

type BaseStatsKey struct {
	Race  proto.Race
	Class proto.Class
	Level int
}

type BuffName

type BuffName int32
const (
	// General Buffs
	ArcaneIntellect BuffName = iota
	BattleShout
	BlessingOfMight
	BlessingOfWisdom
	BloodPact
	DivineSpirit
	GraceOfAir
	ManaSpring
	MarkOfTheWild
	PowerWordFortitude
	StrengthOfEarth
	TrueshotAura
	HornOfLordaeron
	Windfury
	SanctityAura
	BattleSquawk

	// Resistance
	AspectOfTheWild
	FrostResistanceTotem
	FrostResistanceAura
	NatureResistanceTotem
	ShadowProtection

	// Scrolls
	ScrollOfAgility
	ScrollOfIntellect
	ScrollOfSpirit
	ScrollOfStrength
	ScrollOfStamina
)

type BuffsCombo

type BuffsCombo struct {
	Label    string
	Raid     *proto.RaidBuffs
	Party    *proto.PartyBuffs
	Debuffs  *proto.Debuffs
	Player   *proto.IndividualBuffs
	Consumes []ConsumesCombo
}

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 amount of time between the call to spell.Cast() and when the spell
	// effects are invoked.
	CastTime time.Duration
}

func (*Cast) EffectiveTime

func (cast *Cast) EffectiveTime() time.Duration

type CastConfig

type CastConfig struct {
	// Default cast values with all static effects applied.
	DefaultCast Cast

	// Dynamic modifications for each cast.
	ModifyCast func(*Simulation, *Spell, *Cast)

	// Ignores haste when calculating the GCD and cast time for this cast.
	// 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 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
	//Item Swap Handler
	ItemSwap ItemSwap

	// Consumables this Character will be using.
	Consumes *proto.Consumes

	// ISB External configuration
	IsbConfig IsbConfig

	PrimaryTalentTree uint8

	// 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()

	ActiveShapeShift *Aura // Some things can't be used in shapeshift forms
	// 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, pointsToAdd int32, metrics *ResourceMetrics)

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

func (character *Character) BaseEquipStats() stats.Stats

func (*Character) CancelShapeshift added in v0.0.4

func (character *Character) CancelShapeshift(sim *Simulation)

func (*Character) ComboPoints

func (eb *Character) ComboPoints() int32

func (*Character) CurrentEnergy

func (eb *Character) CurrentEnergy() float64

func (*Character) CurrentFocus

func (fb *Character) CurrentFocus() float64

func (*Character) CurrentFocusPerTick

func (fb *Character) CurrentFocusPerTick() 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) 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(modifier float64)

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

func (character *Character) GetActiveSetBonuses() []ActiveSetBonus

Returns a list describing 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) GetConjuredCD

func (character *Character) GetConjuredCD() *Timer

func (*Character) GetDefensiveTrinketCD

func (character *Character) GetDefensiveTrinketCD() *Timer

func (*Character) GetFiftyPercentHasteBuffCD added in v0.0.3

func (character *Character) GetFiftyPercentHasteBuffCD() *Timer

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

func (character *Character) GetPresimOptions(playerConfig *proto.Player) *PresimOptions

func (*Character) GetProcMaskForEnchant

func (character *Character) GetProcMaskForEnchant(effectID int32) ProcMask

func (*Character) GetProcMaskForItem

func (character *Character) GetProcMaskForItem(itemID int32) ProcMask

func (*Character) GetProcMaskForTypes

func (character *Character) GetProcMaskForTypes(weaponTypes ...proto.WeaponType) 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) HasAura

func (at *Character) HasAura(label string) bool

func (*Character) HasAuraWithTag

func (at *Character) HasAuraWithTag(tag string) bool

func (*Character) HasMHWeapon

func (character *Character) HasMHWeapon() 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) HasRuneById

func (character *Character) HasRuneById(id int32) bool

func (*Character) HasSetBonus

func (character *Character) HasSetBonus(set *ItemSet, numItems int32) bool

func (*Character) HasTrinketEquipped

func (character *Character) HasTrinketEquipped(itemID int32) bool

func (*Character) IsOOM

func (mb *Character) IsOOM() bool

func (*Character) IsShapeshifted added in v0.0.4

func (character *Character) IsShapeshifted() bool

func (*Character) IsTanking

func (character *Character) IsTanking() bool

func (*Character) MaxHealth

func (hb *Character) MaxHealth() float64

func (*Character) NewTemporaryStatsAura

func (character *Character) NewTemporaryStatsAura(auraLabel string, actionID ActionID, tempStats stats.Stats, duration time.Duration) *Aura

Helper for the common case of making an aura that adds stats.

func (*Character) NewTemporaryStatsAuraWrapped

func (character *Character) NewTemporaryStatsAuraWrapped(auraLabel string, actionID ActionID, buffs stats.Stats, duration time.Duration, modConfig func(*Aura)) *Aura

Alternative that allows modifying the Aura config.

func (*Character) NextEnergyTickAt

func (eb *Character) NextEnergyTickAt() time.Duration

func (*Character) NumActiveAurasWithTag

func (at *Character) NumActiveAurasWithTag(tag string) int32

func (*Character) OnCastComplete

func (at *Character) OnCastComplete(sim *Simulation, spell *Spell)

Invokes the OnCastComplete event for all tracked Auras.

func (*Character) OnHealDealt

func (at *Character) OnHealDealt(sim *Simulation, spell *Spell, result *SpellResult)

Invokes the OnHeal event for all tracked Auras.

func (*Character) OnHealTaken

func (at *Character) OnHealTaken(sim *Simulation, spell *Spell, result *SpellResult)

func (*Character) OnPeriodicDamageDealt

func (at *Character) OnPeriodicDamageDealt(sim *Simulation, spell *Spell, result *SpellResult)

Invokes the OnPeriodicDamage

As a debuff when target is being hit by dot.
As a buff when caster's dots are ticking.

func (*Character) OnPeriodicDamageTaken

func (at *Character) OnPeriodicDamageTaken(sim *Simulation, spell *Spell, result *SpellResult)

func (*Character) OnPeriodicHealDealt

func (at *Character) OnPeriodicHealDealt(sim *Simulation, spell *Spell, result *SpellResult)

Invokes the OnPeriodicHeal

As a debuff when target is being hit by dot.
As a buff when caster's dots are ticking.

func (*Character) OnPeriodicHealTaken

func (at *Character) OnPeriodicHealTaken(sim *Simulation, spell *Spell, result *SpellResult)

func (*Character) OnRageChange

func (at *Character) OnRageChange(sim *Simulation, metrics *ResourceMetrics)

Invokes the OnRageChange for all tracked auras

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

func (character *Character) RegisterOnItemSwap(callback OnSwapItem)

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

func (*Character) ResetEnergyTick

func (eb *Character) ResetEnergyTick(sim *Simulation)

Gives an immediate partial energy tick and restarts the tick timer.

func (*Character) SetShapeshift added in v0.0.4

func (character *Character) SetShapeshift(aura *Aura)

func (*Character) SpendComboPoints

func (eb *Character) SpendComboPoints(sim *Simulation, metrics *ResourceMetrics)

func (*Character) SpendEnergy

func (eb *Character) SpendEnergy(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*Character) SpendFocus

func (fb *Character) SpendFocus(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*Character) SpendRage

func (rb *Character) SpendRage(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*Character) StartOOMEvent

func (mb *Character) StartOOMEvent(sim *Simulation, requiredMana float64)

func (*Character) TryUseCooldowns

func (mcdm *Character) TryUseCooldowns(sim *Simulation)

func (*Character) UpdateMajorCooldowns

func (mcdm *Character) UpdateMajorCooldowns()

This function should be called if the CD for a major cooldown changes outside of the TryActivate() call.

func (*Character) WeaponFromMainHand

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.

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
	Level       int32
	GearSet     GearSetCombo
	SpecOptions SpecOptionsCombo
	Talents     string
	Rotation    RotationCombo

	Buffs    BuffsCombo
	Consumes ConsumesCombo

	IsHealer        bool
	IsTank          bool
	InFrontOfTarget bool

	OtherRaces       []proto.Race
	OtherGearSets    []GearSetCombo
	OtherSpecOptions []SpecOptionsCombo
	OtherRotations   []RotationCombo
	OtherConsumes    []ConsumesCombo

	ItemFilter ItemFilter

	StatsToWeigh    []proto.Stat
	EPReferenceStat proto.Stat

	Cooldowns *proto.Cooldowns
}

type CombinedTestGenerator

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

func (*CombinedTestGenerator) GetTest

func (*CombinedTestGenerator) NumTests

func (generator *CombinedTestGenerator) NumTests() int

type ConsumesCombo

type ConsumesCombo struct {
	Label    string
	Consumes *proto.Consumes
}

type Cooldown

type Cooldown struct {
	*Timer

	// Default amount of time after activation before this CD can be used again.
	// Note that some CDs won't use this, e.g. the GCD.
	Duration time.Duration
}

func (*Cooldown) Use

func (cd *Cooldown) Use(sim *Simulation)

Puts this CD on cooldown, using the default duration.

type CooldownActivation

type CooldownActivation func(*Simulation, *Character)

Function for activating a cooldown. Returns whether the activation was successful.

type CooldownActivationCondition

type CooldownActivationCondition func(*Simulation, *Character) bool

Condition for whether a cooldown can/should be activated. Returning false prevents the cooldown from being activated.

type CooldownType

type CooldownType byte
const (
	CooldownTypeUnknown CooldownType = 0
	CooldownTypeMana    CooldownType = 1 << iota
	CooldownTypeDPS
	CooldownTypeExplosive
	CooldownTypeSurvival
)

func (CooldownType) Matches

func (ct CooldownType) Matches(other CooldownType) bool

type DebuffName

type DebuffName int32
const (
	// General Buffs
	DemoralizingShout DebuffName = iota
)

type DefaultAPLValueImpl

type DefaultAPLValueImpl struct {
}

Provides empty implementations for the GetX() value interface functions.

func (DefaultAPLValueImpl) Finalize

func (impl DefaultAPLValueImpl) Finalize(*APLRotation)

func (DefaultAPLValueImpl) GetBool

func (impl DefaultAPLValueImpl) GetBool(_ *Simulation) bool

func (DefaultAPLValueImpl) GetDuration

func (impl DefaultAPLValueImpl) GetDuration(_ *Simulation) time.Duration

func (DefaultAPLValueImpl) GetFloat

func (impl DefaultAPLValueImpl) GetFloat(_ *Simulation) float64

func (DefaultAPLValueImpl) GetInnerValues

func (impl DefaultAPLValueImpl) GetInnerValues() []APLValue

func (DefaultAPLValueImpl) GetInt

func (impl DefaultAPLValueImpl) GetInt(_ *Simulation) int32

func (DefaultAPLValueImpl) GetString

func (impl DefaultAPLValueImpl) GetString(_ *Simulation) string

type DefenseType

type DefenseType byte
const (
	DefenseTypeNone DefenseType = iota
	DefenseTypeMagic
	DefenseTypeMelee
	DefenseTypeRanged
)

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

	// Embed Aura, so we can use IsActive/Refresh/etc directly.
	*Aura

	NumberOfTicks int32         // number of ticks over the whole duration
	TickLength    time.Duration // time between each tick

	// If true, tick length will be shortened based on casting speed.
	AffectedByCastSpeed bool

	OnSnapshot OnSnapshot
	OnTick     OnTick

	SnapshotBaseDamage         float64
	SnapshotCritChance         float64
	SnapshotAttackerMultiplier float64

	// Number of ticks since last call to Apply().
	TickCount int32

	BonusCoefficient float64 // EffectBonusCoefficient in SpellEffect client DB table, "SP mod" on Wowhead (not necessarily shown there even if > 0)
	// contains filtered or unexported fields
}

func (*Dot) Apply

func (dot *Dot) Apply(sim *Simulation)

func (*Dot) ApplyOrRefresh

func (dot *Dot) ApplyOrRefresh(sim *Simulation)

Like Apply(), but does not reset the tick timer.

func (*Dot) ApplyOrReset

func (dot *Dot) ApplyOrReset(sim *Simulation)

ApplyOrReset is used for rolling dots that reset the tick timer on reapplication. This is more efficient than Apply(), and works around tickAction.CleanUp() wrongly generating an extra ticks if (re-)application and tick happen at the same time.

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

func (dot *Dot) Cancel(sim *Simulation)

func (*Dot) ManualTick

func (dot *Dot) ManualTick(sim *Simulation)

ManualTick forces the dot forward one tick Will cancel the dot if it is out of ticks.

func (*Dot) MaxTicksRemaining

func (dot *Dot) MaxTicksRemaining() int32

func (*Dot) NextTickAt

func (dot *Dot) NextTickAt() time.Duration

func (*Dot) NumTicksRemaining

func (dot *Dot) NumTicksRemaining(sim *Simulation) int

func (*Dot) OutcomeExpectedMagicSnapshotCrit

func (dot *Dot) OutcomeExpectedMagicSnapshotCrit(_ *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Dot) OutcomeMagicHitAndSnapshotCrit

func (dot *Dot) OutcomeMagicHitAndSnapshotCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Dot) OutcomeRangedHitAndCritSnapshot

func (dot *Dot) OutcomeRangedHitAndCritSnapshot(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Dot) OutcomeSnapshotCrit

func (dot *Dot) OutcomeSnapshotCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Dot) OutcomeTick

func (dot *Dot) OutcomeTick(_ *Simulation, result *SpellResult, _ *AttackTable)

A tick always hits, but we don't count them as hits in the metrics.

func (*Dot) OutcomeTickCounted

func (dot *Dot) OutcomeTickCounted(_ *Simulation, result *SpellResult, _ *AttackTable)

func (*Dot) OutcomeTickPhysicalCrit

func (dot *Dot) OutcomeTickPhysicalCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Dot) OutcomeTickSnapshotCrit

func (dot *Dot) OutcomeTickSnapshotCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Dot) OutcomeTickSnapshotCritCounted added in v0.0.3

func (dot *Dot) OutcomeTickSnapshotCritCounted(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Dot) RecomputeAuraDuration

func (dot *Dot) RecomputeAuraDuration()

Call this after manually changing NumberOfTicks or TickLength.

func (*Dot) RescheduleNextTick

func (dot *Dot) RescheduleNextTick(sim *Simulation)

func (*Dot) Rollover

func (dot *Dot) Rollover(sim *Simulation)

Rollover is used to reset the duration of a dot from an external spell (not casting the dot itself) This keeps the snapshot crit and %dmg modifiers. However, sp and haste are recalculated.

func (*Dot) Snapshot added in v0.0.4

func (dot *Dot) Snapshot(target *Unit, baseDamage float64, isRollover bool)

func (*Dot) SnapshotHeal added in v0.0.4

func (dot *Dot) SnapshotHeal(target *Unit, baseHealing float64, isRollover bool)

func (*Dot) TakeSnapshot

func (dot *Dot) TakeSnapshot(sim *Simulation, doRollover bool)

Takes a new snapshot of this Dot's effects.

In most cases this will be called automatically, and should only be called to force a new snapshot to be taken.

doRollover will apply previously snapshotted crit/%dmg instead of recalculating.

func (*Dot) TickOnce

func (dot *Dot) TickOnce(sim *Simulation)

Forces an instant tick. Does not reset the tick timer or aura duration, the tick is simply an extra tick.

func (*Dot) TickPeriod

func (dot *Dot) TickPeriod() time.Duration

TickPeriod is how fast the snapshot 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 {
	IsAOE    bool // Set to true for AOE dots (Blizzard, Hurricane, Consecrate, etc)
	SelfOnly bool // Set to true to only create the self-hot.

	// Optional, will default to the corresponding spell.
	Spell *Spell

	Aura Aura

	NumberOfTicks int32         // number of ticks over the whole duration
	TickLength    time.Duration // time between each tick

	// If true, tick length will be shortened based on casting speed.
	AffectedByCastSpeed bool

	OnSnapshot OnSnapshot
	OnTick     OnTick

	BonusCoefficient float64 // EffectBonusCoefficient in SpellEffect client DB table, "SP mod" on Wowhead (not necessarily shown there even if > 0)
}

type DynamicDamageTakenModifier

type DynamicDamageTakenModifier func(sim *Simulation, spell *Spell, result *SpellResult)

type Enchant

type Enchant struct {
	EffectID int32 // Used by UI to apply effect to tooltip
	Stats    stats.Stats
}

func EnchantFromProto

func EnchantFromProto(pData *proto.SimEnchant) Enchant

type Encounter

type Encounter struct {
	Duration          time.Duration
	DurationVariation time.Duration
	Targets           []*Target
	TargetUnits       []*Unit

	ExecuteProportion_20 float64
	ExecuteProportion_25 float64
	ExecuteProportion_35 float64

	EndFightAtHealth float64
	// DamageTaken is used to track health fights instead of duration fights.
	//  Once primary target has taken its health worth of damage, fight ends.
	DamageTaken float64
	// In health fight: set to true until we get something to base on
	DurationIsEstimate bool
	// contains filtered or unexported fields
}

func NewEncounter

func NewEncounter(options *proto.Encounter) Encounter

func (*Encounter) AOECapMultiplier

func (encounter *Encounter) AOECapMultiplier() float64

func (*Encounter) GetMetricsProto

func (encounter *Encounter) GetMetricsProto() *proto.EncounterMetrics

type EncounterCombo

type EncounterCombo struct {
	Label     string
	Encounter *proto.Encounter
}

func MakeDefaultEncounterCombos

func MakeDefaultEncounterCombos(playerLevel int32) []EncounterCombo

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 float64

	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) (*Environment, *proto.RaidStats, *proto.EncounterStats)

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

func (env *Environment) GetNumTargets() int32

func (*Environment) GetTarget

func (env *Environment) GetTarget(index int32) *Target

func (*Environment) GetTargetUnit

func (env *Environment) GetTargetUnit(index int32) *Unit

func (*Environment) GetUnit

func (env *Environment) GetUnit(ref *proto.UnitReference, contextUnit *Unit) *Unit

func (*Environment) IsFinalized

func (env *Environment) IsFinalized() bool

func (*Environment) NextTarget

func (env *Environment) NextTarget(target *Unit) *Target

func (*Environment) NextTargetUnit

func (env *Environment) NextTargetUnit(target *Unit) *Unit

func (*Environment) PrepullStartTime

func (env *Environment) PrepullStartTime() time.Duration

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.

type EnvironmentState

type EnvironmentState int
const (
	Created EnvironmentState = iota
	Constructed
	Initialized
	Finalized
)

type Equipment

type Equipment [proto.ItemSlot_ItemSlotRanged + 1]Item

func NewEquipmentSet

func NewEquipmentSet(equipSpec EquipmentSpec) Equipment

func ProtoToEquipment

func ProtoToEquipment(es *proto.EquipmentSpec) Equipment

func (*Equipment) BaseStats

func (equipment *Equipment) BaseStats() stats.Stats

func (*Equipment) EquipItem

func (equipment *Equipment) EquipItem(item Item)

func (*Equipment) Finger1

func (equipment *Equipment) Finger1() *Item

func (*Equipment) Finger2

func (equipment *Equipment) Finger2() *Item

func (*Equipment) GetRuneIds

func (equipment *Equipment) GetRuneIds() []int32

func (*Equipment) Hands

func (equipment *Equipment) Hands() *Item

func (*Equipment) Head

func (equipment *Equipment) Head() *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) Stats

func (equipment *Equipment) Stats() 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

type EquipmentSpec

type EquipmentSpec [proto.ItemSlot_ItemSlotRanged + 1]ItemSpec

Structs used for looking up items/enchants

func ProtoToEquipmentSpec

func ProtoToEquipmentSpec(es *proto.EquipmentSpec) EquipmentSpec

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

	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 AtkSpeedReductionEffect

func AtkSpeedReductionEffect(aura *Aura, speedMultiplier float64) *ExclusiveEffect

func RegisterPercentDamageModifierEffect

func RegisterPercentDamageModifierEffect(aura *Aura, percentDamageModifier float64) *ExclusiveEffect

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 (fc *FocusCost) CostFailureReason(_ *Simulation, spell *Spell) string

func (*FocusCost) IssueRefund

func (fc *FocusCost) IssueRefund(sim *Simulation, spell *Spell)

func (*FocusCost) MeetsRequirement

func (fc *FocusCost) MeetsRequirement(_ *Simulation, spell *Spell) bool

func (*FocusCost) SpendCost

func (fc *FocusCost) SpendCost(sim *Simulation, spell *Spell)

type FocusCostOptions

type FocusCostOptions struct {
	Cost float64

	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 GoRand

type GoRand struct {
	rand.Source64
}

func NewGoRand

func NewGoRand(seed uint64) *GoRand

wraps go's default source; will panic if it's not a Source64

func (GoRand) Next

func (g GoRand) Next() uint64

func (GoRand) NextFloat64

func (g GoRand) NextFloat64() float64

type Hand

type Hand bool
const MainHand Hand = true
const OffHand Hand = false

type Hardcast

type Hardcast struct {
	Expires    time.Duration
	ActionID   ActionID
	OnComplete func(*Simulation, *Unit)
	Target     *Unit
	Pushback   float64
}

type HitOutcome

type HitOutcome uint16

Possible outcomes of any hit/damage roll.

const (
	OutcomeEmpty HitOutcome = 0

	// These bits are set by the hit roll
	OutcomeMiss HitOutcome = 1 << iota
	OutcomeHit
	OutcomeDodge
	OutcomeGlance
	OutcomeParry
	OutcomeBlock

	// These bits are set by the crit and damage rolls.
	OutcomeCrit
	OutcomeCrush

	OutcomePartial1_4 // 1/4 of the spell was resisted.
	OutcomePartial2_4 // 2/4 of the spell was resisted.
	OutcomePartial3_4 // 3/4 of the spell was resisted.
)

Single-bit outcomes.

func (HitOutcome) Matches

func (ho HitOutcome) Matches(other HitOutcome) bool

Returns whether there is any overlap between the given masks.

func (HitOutcome) PartialResistString

func (ho HitOutcome) PartialResistString() string

func (HitOutcome) String

func (ho HitOutcome) String() string

type IndividualTestSuite

type IndividualTestSuite struct {
	Name string
	// contains filtered or unexported fields
}

func NewIndividualTestSuite

func NewIndividualTestSuite(suiteName string) *IndividualTestSuite

func (*IndividualTestSuite) Done

func (testSuite *IndividualTestSuite) Done(t *testing.T)

func (*IndividualTestSuite) TestCasts

func (testSuite *IndividualTestSuite) TestCasts(testName string, rsr *proto.RaidSimRequest)

func (*IndividualTestSuite) TestCharacterStats

func (testSuite *IndividualTestSuite) TestCharacterStats(testName string, csr *proto.ComputeStatsRequest)

func (*IndividualTestSuite) TestDPS

func (testSuite *IndividualTestSuite) TestDPS(testName string, rsr *proto.RaidSimRequest)

func (*IndividualTestSuite) TestStatWeights

func (testSuite *IndividualTestSuite) TestStatWeights(testName string, swr *proto.StatWeightsRequest)

type IsbConfig added in v0.0.4

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

type Item

type Item struct {
	ID             int32
	RequiresLevel  int32
	ClassAllowlist []proto.Class
	Type           proto.ItemType
	ArmorType      proto.ArmorType

	// Weapon Stats
	WeaponType       proto.WeaponType
	HandType         proto.HandType
	RangedWeaponType proto.RangedWeaponType
	WeaponDamageMin  float64
	WeaponDamageMax  float64
	SwingSpeed       float64

	Name         string
	Stats        stats.Stats // Stats applied to wearer
	Quality      proto.ItemQuality
	SetName      string // Empty string if not part of a set.
	WeaponSkills stats.WeaponSkills

	// Modified for each instance of the item.
	RandomSuffix RandomSuffix
	Enchant      Enchant
	Rune         int32

	//Internal use
	TempEnchant int32
}

func ItemFromProto

func ItemFromProto(pData *proto.SimItem) Item

func NewItem

func NewItem(itemSpec ItemSpec) Item

func (*Item) ToItemSpecProto

func (item *Item) ToItemSpecProto() *proto.ItemSpec

type ItemComboChecker

type ItemComboChecker map[int64]struct{}

func (*ItemComboChecker) HasCombo

func (ic *ItemComboChecker) HasCombo(itema int32, itemb int32) bool

type ItemFilter

type ItemFilter struct {
	// If set to ClassUnknown, any class is fine.
	Class proto.Class

	Level int32

	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
}

Returns all items that meet the given conditions.

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 {
	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]ApplyEffect
}

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
	Rune         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) CalcStatChanges

func (swap *ItemSwap) CalcStatChanges(slots []proto.ItemSlot) stats.Stats

func (*ItemSwap) GetItem

func (swap *ItemSwap) GetItem(slot proto.ItemSlot) *Item

func (*ItemSwap) IsEnabled

func (swap *ItemSwap) IsEnabled() bool

func (*ItemSwap) IsSwapped

func (swap *ItemSwap) IsSwapped() bool

func (*ItemSwap) RegisterOnSwapItemForEffect

func (swap *ItemSwap) RegisterOnSwapItemForEffect(effectID int32, aura *Aura)

Helper for handling Effects that use the effectID to toggle the aura on and off

func (*ItemSwap) RegisterOnSwapItemForEffectWithPPMManager

func (swap *ItemSwap) RegisterOnSwapItemForEffectWithPPMManager(effectID int32, ppm float64, ppmm *PPMManager, aura *Aura)

Helper for handling Effects that use PPMManager to toggle the aura on/off

func (*ItemSwap) SwapItems

func (swap *ItemSwap) SwapItems(sim *Simulation, slots []proto.ItemSlot)

type ItemsTestGenerator

type ItemsTestGenerator struct {
	// Fields describing the base API request.
	Player     *proto.Player
	PartyBuffs *proto.PartyBuffs
	RaidBuffs  *proto.RaidBuffs
	Debuffs    *proto.Debuffs
	Encounter  *proto.Encounter
	SimOptions *proto.SimOptions
	IsHealer   bool

	// Some fields are populated automatically.
	ItemFilter ItemFilter
	// contains filtered or unexported fields
}

func (*ItemsTestGenerator) GetTest

func (*ItemsTestGenerator) NumTests

func (generator *ItemsTestGenerator) NumTests() int

type MajorCooldown

type MajorCooldown struct {
	// Spell that is cast when this MCD is activated.
	Spell *Spell

	// Cooldowns with higher priority get used first. This is important when some
	// cooldowns have a non-zero cast time. For example, Drums should be used
	// before Bloodlust.
	Priority int32

	// Internal category, used for filtering. For example, mages want to disable
	// all DPS cooldowns during their regen rotation.
	Type CooldownType

	// Whether the cooldown meets all 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
	// contains filtered or unexported fields
}

func (*MajorCooldown) Disable

func (mcd *MajorCooldown) Disable()

func (*MajorCooldown) Enable

func (mcd *MajorCooldown) Enable()

func (*MajorCooldown) GetTimings

func (mcd *MajorCooldown) GetTimings() []time.Duration

func (*MajorCooldown) IsEnabled

func (mcd *MajorCooldown) IsEnabled() bool

func (*MajorCooldown) IsReady

func (mcd *MajorCooldown) IsReady(sim *Simulation) bool

func (*MajorCooldown) ReadyAt

func (mcd *MajorCooldown) ReadyAt() time.Duration

func (*MajorCooldown) 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

Public version of TryActivate for manual activation by Agent code. Note that this version will work even if the MCD is disabled.

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 {
	BaseCost   float64
	FlatCost   float64 // Alternative to BaseCost for giving a flat value.
	Multiplier float64 // It's OK to leave this at 0, will default to 1.
}

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 OnDamage

type OnDamage func(aura *Aura, sim *Simulation, spell *Spell, result *SpellResult)

OnDamage is called after damage is calculated. Use it for proc effects or anything that comes from the final result of dealing damage.

type OnDoneIteration

type OnDoneIteration func(aura *Aura, sim *Simulation)

type OnExpire

type OnExpire func(aura *Aura, sim *Simulation)

type OnFocusGain

type OnFocusGain func(sim *Simulation)

OnFocusGain is called any time focus is increased.

type OnGain

type OnGain func(aura *Aura, sim *Simulation)

type OnInit

type OnInit func(aura *Aura, sim *Simulation)

type OnPeriodicDamage

type OnPeriodicDamage func(aura *Aura, sim *Simulation, spell *Spell, 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 OnRageChange

type OnRageChange func(aura *Aura, sim *Simulation, metrics *ResourceMetrics)

OnRageChange is called any time rage is increased.

type OnReset

type OnReset func(aura *Aura, sim *Simulation)

type OnSnapshot

type OnSnapshot func(sim *Simulation, target *Unit, dot *Dot, isRollover bool)

type OnSpellHit

type OnSpellHit func(aura *Aura, sim *Simulation, spell *Spell, result *SpellResult)

Callback for after a spell hits the target and after damage is calculated. Use it for proc effects or anything that comes from the final result of the spell.

type OnStacksChange

type OnStacksChange func(aura *Aura, sim *Simulation, oldStacks int32, newStacks int32)

type OnStatsChange

type OnStatsChange func(aura *Aura, sim *Simulation, oldStats stats.Stats, newStats stats.Stats)

type OnSwapItem

type OnSwapItem func(*Simulation)

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 PPMManager

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

func (*PPMManager) Chance

func (ppmm *PPMManager) Chance(procMask ProcMask) float64

func (*PPMManager) Proc

func (ppmm *PPMManager) Proc(sim *Simulation, procMask ProcMask, label string) bool

Returns whether the effect procced.

func (*PPMManager) ProcWithWeaponSpecials

func (ppmm *PPMManager) ProcWithWeaponSpecials(sim *Simulation, procMask ProcMask, label string) bool

Returns whether the effect procced. This is different from Proc() in that yellow melee hits use a proc chance based on the equipped weapon speed rather than the base attack speed. This distinction matters for feral druids.

type Party

type Party struct {
	Raid  *Raid
	Index int

	Players []Agent
	Pets    []PetAgent // Cached list of all the pets in the party.

	PlayersAndPets []Agent // Cached list of players + pets, concatenated.
	// contains filtered or unexported fields
}

func NewParty

func NewParty(raid *Raid, index int, partyConfig *proto.Party) *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(sim *Simulation, options DelayedActionOptions) *PendingAction

func NewPeriodicAction

func NewPeriodicAction(sim *Simulation, options PeriodicActionOptions) *PendingAction

func StartDelayedAction

func StartDelayedAction(sim *Simulation, options DelayedActionOptions) *PendingAction

Convenience for immediately creating and starting a delayed action.

func StartPeriodicAction

func StartPeriodicAction(sim *Simulation, options PeriodicActionOptions) *PendingAction

Convenience for immediately creating and starting a periodic action.

func (*PendingAction) Cancel

func (pa *PendingAction) Cancel(sim *Simulation)

type PeriodicActionOptions

type PeriodicActionOptions struct {
	// How often the action should be performed.
	Period time.Duration

	// Number of times to perform the action before stopping.
	// 0 indicates a permanent periodic action.
	NumTicks int

	// Whether the first tick should happen immediately. If false, first tick will
	// wait for Period.
	TickImmediately bool

	Priority ActionPriority

	OnAction func(*Simulation)
	CleanUp  func(*Simulation)
}

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(name string, owner *Character, baseStats stats.Stats, statInheritance PetStatInheritance, enabledOnStart bool, isGuardian bool) Pet

func (*Pet) AddComboPoints

func (eb *Pet) AddComboPoints(sim *Simulation, pointsToAdd int32, metrics *ResourceMetrics)

func (*Pet) AddEnergy

func (eb *Pet) AddEnergy(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*Pet) 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) ApplyRunes

func (pet *Pet) ApplyRunes()

func (*Pet) ApplyTalents

func (pet *Pet) ApplyTalents()

func (*Pet) ComboPoints

func (eb *Pet) ComboPoints() int32

func (*Pet) CurrentEnergy

func (eb *Pet) CurrentEnergy() float64

func (*Pet) CurrentFocus

func (fb *Pet) CurrentFocus() float64

func (*Pet) CurrentFocusPerTick

func (fb *Pet) CurrentFocusPerTick() 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) Enable

func (pet *Pet) Enable(sim *Simulation, petAgent PetAgent)

petAgent should be the PetAgent which embeds this Pet.

func (*Pet) EnableDynamicMeleeSpeed

func (pet *Pet) EnableDynamicMeleeSpeed(inheritance PetMeleeSpeedInheritance)

Enables and possibly updates how the pet inherits its owner's melee speed. DK use only.

func (*Pet) EnableDynamicStats

func (pet *Pet) EnableDynamicStats(inheritance PetStatInheritance)

Enables and possibly updates how the pet inherits its owner's stats. DK use only.

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

func (pet *Pet) IsGuardian() bool

func (*Pet) IsOOM

func (mb *Pet) IsOOM() bool

func (*Pet) MaxHealth

func (hb *Pet) MaxHealth() float64

func (*Pet) NextEnergyTickAt

func (eb *Pet) NextEnergyTickAt() time.Duration

func (*Pet) NumActiveAurasWithTag

func (at *Pet) NumActiveAurasWithTag(tag string) int32

func (*Pet) OnCastComplete

func (at *Pet) OnCastComplete(sim *Simulation, spell *Spell)

Invokes the OnCastComplete event for all tracked Auras.

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

func (at *Pet) OnRageChange(sim *Simulation, metrics *ResourceMetrics)

Invokes the OnRageChange for all tracked auras

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

func (at *Pet) RegisterResetEffect(resetEffect ResetEffect)

Registers a callback to this Character which will be invoked on every Sim reset.

func (*Pet) RemoveHealth

func (hb *Pet) RemoveHealth(sim *Simulation, amount float64)

func (*Pet) ResetEnergyTick

func (eb *Pet) ResetEnergyTick(sim *Simulation)

Gives an immediate partial energy tick and restarts the tick timer.

func (*Pet) SpendComboPoints

func (eb *Pet) SpendComboPoints(sim *Simulation, 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) SpendRage

func (rb *Pet) SpendRage(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*Pet) StartOOMEvent

func (mb *Pet) StartOOMEvent(sim *Simulation, requiredMana float64)

func (*Pet) TryUseCooldowns

func (mcdm *Pet) TryUseCooldowns(sim *Simulation)

func (*Pet) UpdateMajorCooldowns

func (mcdm *Pet) UpdateMajorCooldowns()

This function should be called if the CD for a major cooldown changes outside of the TryActivate() call.

type PetAgent

type PetAgent interface {
	Agent

	// The Pet controlled by this PetAgent.
	GetPet() *Pet
}

Extension of Agent interface, for Pets.

type PetMeleeSpeedInheritance

type PetMeleeSpeedInheritance func(amount 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
)

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 ProcHandler

type ProcHandler func(sim *Simulation, spell *Spell, result *SpellResult)

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
	// Special mask for procs that can trigger things
	ProcMaskProc
	// Mask for FT weapon and rogue poisons, seems to be spell procs from a weapon imbue
	ProcMaskWeaponProc
)

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.

type ProcTrigger

type ProcTrigger struct {
	Name            string
	ActionID        ActionID
	Duration        time.Duration
	Callback        AuraCallback
	ProcMask        ProcMask
	ProcMaskExclude ProcMask
	SpellFlags      SpellFlag
	Outcome         HitOutcome
	Harmful         bool
	ProcChance      float64
	PPM             float64
	ICD             time.Duration
	Handler         ProcHandler
}

type RageBarOptions

type RageBarOptions struct {
	StartingRage   float64
	RageMultiplier float64
}

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 float64

	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.
	// 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) 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) 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) GetPlayerParty

func (raid *Raid) GetPlayerParty(unit *Unit) *Party

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

func RandomSuffixFromProto

func RandomSuffixFromProto(pData *proto.ItemRandomSuffix) RandomSuffix

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 ResourceKey

type ResourceKey struct {
	ActionID ActionID
	Type     proto.ResourceType
}

type ResourceMetrics

type ResourceMetrics struct {
	ActionID ActionID
	Type     proto.ResourceType

	Events     int32
	Gain       float64
	ActualGain float64

	EventsFromPreviousIterations     int32
	ActualGainFromPreviousIterations float64
}

func (*ResourceMetrics) ActualGainForCurrentIteration

func (resourceMetrics *ResourceMetrics) ActualGainForCurrentIteration() float64

func (*ResourceMetrics) AddEvent

func (resourceMetrics *ResourceMetrics) AddEvent(gain float64, actualGain float64)

func (*ResourceMetrics) EventsForCurrentIteration

func (resourceMetrics *ResourceMetrics) EventsForCurrentIteration() int32

func (*ResourceMetrics) ToProto

func (resourceMetrics *ResourceMetrics) ToProto() *proto.ResourceMetrics

type RotationCastsTestGenerator

type RotationCastsTestGenerator struct {
	SpecOptions []SpecOptionsCombo
	PartyBuffs  *proto.PartyBuffs
	RaidBuffs   *proto.RaidBuffs
	Debuffs     *proto.Debuffs
	Player      *proto.Player
	Encounter   *proto.Encounter
	SimOptions  *proto.SimOptions
}

func (*RotationCastsTestGenerator) GetTest

func (*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

type Rune

type Rune struct {
	ID int32
}

func RuneFromProto

func RuneFromProto(pData *proto.SimRune) Rune

type SettingsCombos

type SettingsCombos struct {
	Class       proto.Class
	Races       []proto.Race
	Level       int32
	GearSets    []GearSetCombo
	TalentSets  []TalentsCombo
	SpecOptions []SpecOptionsCombo
	Rotations   []RotationCombo
	Buffs       []BuffsCombo
	Encounters  []EncounterCombo
	SimOptions  *proto.SimOptions
	IsHealer    bool
	Cooldowns   *proto.Cooldowns
}

func (*SettingsCombos) GetTest

func (*SettingsCombos) NumTests

func (combos *SettingsCombos) NumTests() int

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

	Log func(string, ...interface{})
	// contains filtered or unexported fields
}

func NewSim

func NewSim(rsr *proto.RaidSimRequest) *Simulation

func (*Simulation) AddPendingAction

func (sim *Simulation) AddPendingAction(pa *PendingAction)

func (*Simulation) AddTask

func (sim *Simulation) AddTask(task Task)

func (*Simulation) Cleanup

func (sim *Simulation) Cleanup()

func (*Simulation) GetRemainingDuration

func (sim *Simulation) GetRemainingDuration() time.Duration

func (*Simulation) GetRemainingDurationPercent

func (sim *Simulation) GetRemainingDurationPercent() float64

Returns the percentage of time remaining in the current iteration, as a value from 0-1.

func (*Simulation) IsExecutePhase20

func (sim *Simulation) IsExecutePhase20() bool

func (*Simulation) IsExecutePhase25

func (sim *Simulation) IsExecutePhase25() bool

func (*Simulation) IsExecutePhase35

func (sim *Simulation) IsExecutePhase35() bool

func (*Simulation) 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) RegisterExecutePhaseCallback

func (sim *Simulation) RegisterExecutePhaseCallback(callback func(sim *Simulation, isExecute int32))

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) 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 interface{}
}

type SpecSetter

type SpecSetter func(*proto.Player, interface{})

type Spell

type Spell struct {
	// ID for this spell.
	ActionID

	// Used to identify spells with multiple ranks that need to be referenced
	SpellCode int32

	// The unit who will perform this spell.
	Unit *Unit

	SpellSchool       SpellSchool         // Schoolmask of all schools this spell uses. Do not change this! Whatever you try to do is a hack and probably wrong.
	SchoolIndex       stats.SchoolIndex   // Do not change this! Whatever you try to do is a hack and probably wrong.
	SchoolBaseIndices []stats.SchoolIndex // Base school indices for multi schools. Do not change this! Whatever you try to do is a hack and probably wrong.
	DefenseType       DefenseType

	// Controls which effects can proc from this spell.
	ProcMask ProcMask

	// Flags
	Flags SpellFlag

	// From which slot this spell cast. Usually from Mainhand
	CastType proto.CastType

	// 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

	Rank          int
	RequiredLevel int

	ResourceMetrics *ResourceMetrics

	Cost               SpellCost // Cost for the spell.
	DefaultCast        Cast      // Default cast parameters with all static effects applied.
	CD                 Cooldown
	SharedCD           Cooldown
	ExtraCastCondition CanCastCondition

	SpellMetrics []SpellMetrics

	// Performs the actions of this spell.
	ApplyEffects ApplySpellResults

	// The current or most recent cast data.
	CurCast Cast

	BonusHitRating           float64
	BonusCritRating          float64
	CastTimeMultiplier       float64
	CostMultiplier           float64
	DamageMultiplier         float64
	DamageMultiplierAdditive float64

	BonusCoefficient float64 // EffectBonusCoefficient in SpellEffect client DB table, "SP mod" on Wowhead (not necessarily shown there even if > 0)

	CritDamageBonus float64

	// Multiplier for all threat generated by this effect.
	ThreatMultiplier float64

	// Adds a fixed amount of threat to this spell, before multipliers.
	FlatThreatBonus float64

	// Per-target auras that are related to this spell, usually buffs or debuffs applied by the spell.
	RelatedAuras []AuraArray

	// Reference to a spell to be considered as the CD
	// Defaults to this spell (Used for Next Melee spells)
	CdSpell *Spell
	// contains filtered or unexported fields
}

func (*Spell) AOEDot

func (spell *Spell) AOEDot() *Dot

func (*Spell) AOEHot

func (spell *Spell) AOEHot() *Dot

func (*Spell) ApplyAOEThreat

func (spell *Spell) ApplyAOEThreat(threatAmount float64)

func (*Spell) ApplyAOEThreatIgnoreMultipliers

func (spell *Spell) ApplyAOEThreatIgnoreMultipliers(threatAmount float64)

func (*Spell) ApplyCostModifiers

func (spell *Spell) ApplyCostModifiers(cost float64) float64

func (*Spell) ApplyPostOutcomeDamageModifiers

func (spell *Spell) ApplyPostOutcomeDamageModifiers(sim *Simulation, result *SpellResult)

func (*Spell) AttackerDamageMultiplier

func (spell *Spell) AttackerDamageMultiplier(attackTable *AttackTable) float64

Returns the combined attacker modifiers.

func (*Spell) BonusDamage added in v0.0.4

func (spell *Spell) BonusDamage() float64

The combined bonus damage (aka spell power) for this spell's school(s).

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

func (spell *Spell) CalcDamage(sim *Simulation, target *Unit, baseDamage float64, outcomeApplier OutcomeApplier) *SpellResult

func (*Spell) CalcHealing

func (spell *Spell) CalcHealing(sim *Simulation, target *Unit, baseHealing float64, outcomeApplier OutcomeApplier) *SpellResult

func (*Spell) CalcOutcome

func (spell *Spell) CalcOutcome(sim *Simulation, target *Unit, outcomeApplier OutcomeApplier) *SpellResult

For spells that do no damage but still have a hit/miss check.

func (*Spell) CalcPeriodicDamage

func (spell *Spell) CalcPeriodicDamage(sim *Simulation, target *Unit, baseDamage 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) Cast

func (spell *Spell) Cast(sim *Simulation, target *Unit) bool

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

func (spell *Spell) ComboPointMetrics() *ResourceMetrics

func (*Spell) CritMultiplier

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

CritMultiplier() returns the damage multiplier for critical strikes, based on CritDamageBonus and DefenseType. https://web.archive.org/web/20081014064638/http://elitistjerks.com/f31/t12595-relentless_earthstorm_diamond_-_melee_only/p4/ https://github.com/TheGroxEmpire/TBC_DPS_Warrior_Sim/issues/30

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

func (spell *Spell) DealDamage(sim *Simulation, result *SpellResult)

func (*Spell) DealHealing

func (spell *Spell) DealHealing(sim *Simulation, result *SpellResult)

func (*Spell) DealOutcome

func (spell *Spell) DealOutcome(sim *Simulation, result *SpellResult)

func (*Spell) DealPeriodicDamage

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

func (spell *Spell) Dot(target *Unit) *Dot

func (*Spell) DotOrAOEDot added in v0.0.6

func (spell *Spell) DotOrAOEDot(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) 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

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

func (spell *Spell) MeleeAttackPower() float64

func (*Spell) NewResult

func (spell *Spell) NewResult(target *Unit) *SpellResult

func (*Spell) OutcomeAlwaysHit

func (spell *Spell) OutcomeAlwaysHit(_ *Simulation, result *SpellResult, _ *AttackTable)

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) 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) 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 *AttackTable)

func (*Spell) OutcomeMagicCrit

func (spell *Spell) OutcomeMagicCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeMagicHit

func (spell *Spell) OutcomeMagicHit(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeMagicHitAndCrit

func (spell *Spell) OutcomeMagicHitAndCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeMeleeSpecialCritOnly

func (spell *Spell) OutcomeMeleeSpecialCritOnly(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeMeleeSpecialHit

func (spell *Spell) OutcomeMeleeSpecialHit(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeMeleeSpecialHitAndCrit

func (spell *Spell) OutcomeMeleeSpecialHitAndCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeMeleeSpecialNoBlockDodgeParry

func (spell *Spell) OutcomeMeleeSpecialNoBlockDodgeParry(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeMeleeSpecialNoBlockDodgeParryNoCrit

func (spell *Spell) OutcomeMeleeSpecialNoBlockDodgeParryNoCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeMeleeWeaponSpecialHitAndCrit

func (spell *Spell) OutcomeMeleeWeaponSpecialHitAndCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)

Like OutcomeMeleeSpecialHitAndCrit, but blocks prevent crits (all weapon damage based attacks).

func (*Spell) OutcomeMeleeWeaponSpecialNoCrit

func (spell *Spell) OutcomeMeleeWeaponSpecialNoCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeMeleeWhite

func (spell *Spell) OutcomeMeleeWhite(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeRangedCritOnly

func (spell *Spell) OutcomeRangedCritOnly(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeRangedHit

func (spell *Spell) OutcomeRangedHit(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeRangedHitAndCrit

func (spell *Spell) OutcomeRangedHitAndCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeRangedHitAndCritNoBlock

func (spell *Spell) OutcomeRangedHitAndCritNoBlock(sim *Simulation, result *SpellResult, attackTable *AttackTable)

func (*Spell) OutcomeTickMagicHit

func (spell *Spell) OutcomeTickMagicHit(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) RangedAttackPower

func (spell *Spell) RangedAttackPower(target *Unit) float64

func (*Spell) ReadyAt

func (spell *Spell) ReadyAt() time.Duration

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

func (spell *Spell) SpellHitChance(target *Unit) float64

func (*Spell) TagSplitMetric added in v0.0.6

func (spell *Spell) TagSplitMetric(splitIdx int32, tag int32)

TagSplitMetric allows to override the default tag for a given splitIdx. Use after spell registration.

func (*Spell) TargetDamageMultiplier

func (spell *Spell) TargetDamageMultiplier(attackTable *AttackTable, isPeriodic bool) float64

func (*Spell) ThreatFromDamage

func (spell *Spell) ThreatFromDamage(outcome HitOutcome, damage float64) float64

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

type SpellConfig

type SpellConfig struct {
	// See definition of Spell (below) for comments on these.
	ActionID
	// Used to identify spells with multiple ranks that need to be referenced
	SpellCode     int32
	SpellSchool   SpellSchool
	DefenseType   DefenseType
	ProcMask      ProcMask
	Flags         SpellFlag
	CastType      proto.CastType
	MissileSpeed  float64
	BaseCost      float64
	MetricSplits  int
	Rank          int
	RequiredLevel int

	ManaCost   ManaCostOptions
	EnergyCost EnergyCostOptions
	RageCost   RageCostOptions
	FocusCost  FocusCostOptions

	Cast               CastConfig
	ExtraCastCondition CanCastCondition

	BonusHitRating  float64
	BonusCritRating float64

	CritDamageBonus float64

	DamageMultiplier         float64
	DamageMultiplierAdditive float64

	BonusCoefficient float64 // EffectBonusCoefficient in SpellEffect client DB table, "SP mod" on Wowhead (not necessarily shown there even if > 0)

	ThreatMultiplier float64

	FlatThreatBonus 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

	RelatedAuras []AuraArray
}

type SpellCost

type SpellCost 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 SpellFlag

type SpellFlag uint32

Other flags

const (
	SpellFlagNone                    SpellFlag = 0
	SpellFlagIgnoreResists           SpellFlag = 1 << iota // skip spell resist/armor
	SpellFlagIgnoreTargetModifiers                         // skip target damage modifiers
	SpellFlagIgnoreAttackerModifiers                       // skip attacker damage modifiers
	SpellFlagBinary                                        // Does not do partial resists and could need a different hit roll.
	SpellFlagChanneled                                     // Spell is channeled
	SpellFlagDisease                                       // Spell is categorized as disease
	SpellFlagPoison                                        // Spell is categorized as poison
	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.
	SpellFlagNoOnDamageDealt                               // Disables OnSpellHitDealt and OnPeriodicDamageDealt aura callbacks for this spell.
	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.
	SpellFlagPrepullPotion                                 // Indicates this spell is the prepull potion.
	SpellFlagCombatPotion                                  // Indicates this spell is the combat potion.
	SpellFlagResetAttackSwing                              // Indicates this spell resets the melee swing timer.
	SpellFlagCastTimeNoGCD                                 // Indicates this spell is hunters Auto shot spell
	SpellFlagPureDot                                       // Indicates this spell is a dot with no initial damage component

	// 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.

type SpellMetrics

type SpellMetrics struct {
	Casts   int32
	Misses  int32
	Hits    int32
	Crits   int32
	Crushes int32
	Dodges  int32
	Glances int32
	Parries int32
	Blocks  int32

	TotalDamage    float64 // Damage done by all casts of this spell.
	TotalThreat    float64 // Threat generated by all casts of this spell.
	TotalHealing   float64 // Healing done by all casts of this spell.
	TotalShielding float64 // Shielding done by all casts of this spell.
	TotalCastTime  time.Duration
}

Metric totals for a spell against a specific target, for the current iteration.

type SpellRegisteredHandler

type SpellRegisteredHandler func(spell *Spell)

type SpellResult

type SpellResult struct {
	// Target of the spell.
	Target *Unit

	// Results
	Outcome HitOutcome
	Damage  float64 // Damage done by this cast.
	Threat  float64 // The amount of threat generated by this cast.

	ResistanceMultiplier float64 // Partial Resists / Armor multiplier
	PreOutcomeDamage     float64 // Damage done by this cast before Outcome is applied
	// contains filtered or unexported fields
}

func (*SpellResult) DamageString

func (result *SpellResult) DamageString() string

func (*SpellResult) DidCrit

func (result *SpellResult) DidCrit() bool

func (*SpellResult) HealingString

func (result *SpellResult) HealingString() string

func (*SpellResult) Landed

func (result *SpellResult) Landed() bool

func (*SpellResult) RawDamage added in v0.0.7

func (result *SpellResult) RawDamage() float64

type SpellSchool

type SpellSchool byte
const (
	SpellSchoolNone     SpellSchool = 0
	SpellSchoolPhysical SpellSchool = 1 << iota
	SpellSchoolArcane
	SpellSchoolFire
	SpellSchoolFrost
	SpellSchoolHoly
	SpellSchoolNature
	SpellSchoolShadow
)

func SpellSchoolFromIndex

func SpellSchoolFromIndex(schoolIndex stats.SchoolIndex) SpellSchool

Get spell school mask from school index.

func SpellSchoolFromProto

func SpellSchoolFromProto(p proto.SpellSchool) SpellSchool

func (SpellSchool) GetBaseIndices added in v0.0.3

func (schoolMask SpellSchool) GetBaseIndices() []stats.SchoolIndex

func (SpellSchool) GetSchoolIndex

func (ss SpellSchool) GetSchoolIndex() stats.SchoolIndex

Get school index from school mask.

func (SpellSchool) Matches

func (ss SpellSchool) Matches(other SpellSchool) bool

Returns whether there is any overlap between the given masks.

type SpiritManaRegenPerSecond

type SpiritManaRegenPerSecond func() float64

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 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
}

func CalcStatWeight

func CalcStatWeight(swr *proto.StatWeightsRequest, referenceStat stats.Stat, progress chan *proto.ProgressMetrics) *StatWeightsResult

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 SubstitutionComboChecker

type SubstitutionComboChecker map[string]struct{}

func (*SubstitutionComboChecker) HasCombo

func (ic *SubstitutionComboChecker) HasCombo(replacements equipmentSubstitution) bool

type TalentsCombo

type TalentsCombo struct {
	Label   string
	Talents string
}

type Target

type Target struct {
	Unit

	AI TargetAI
}

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, pointsToAdd int32, metrics *ResourceMetrics)

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

func (target *Target) ApplyRunes()

func (*Target) ApplyTalents

func (target *Target) ApplyTalents()

func (*Target) ComboPoints

func (eb *Target) ComboPoints() int32

func (*Target) CurrentEnergy

func (eb *Target) CurrentEnergy() float64

func (*Target) CurrentFocus

func (fb *Target) CurrentFocus() float64

func (*Target) CurrentFocusPerTick

func (fb *Target) CurrentFocusPerTick() 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) 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) MaxHealth

func (hb *Target) MaxHealth() float64

func (*Target) NextEnergyTickAt

func (eb *Target) NextEnergyTickAt() time.Duration

func (*Target) NextTarget

func (target *Target) NextTarget() *Target

func (*Target) NumActiveAurasWithTag

func (at *Target) NumActiveAurasWithTag(tag string) int32

func (*Target) OnCastComplete

func (at *Target) OnCastComplete(sim *Simulation, spell *Spell)

Invokes the OnCastComplete event for all tracked Auras.

func (*Target) OnHealDealt

func (at *Target) OnHealDealt(sim *Simulation, spell *Spell, result *SpellResult)

Invokes the OnHeal event for all tracked Auras.

func (*Target) OnHealTaken

func (at *Target) OnHealTaken(sim *Simulation, spell *Spell, result *SpellResult)

func (*Target) OnPeriodicDamageDealt

func (at *Target) OnPeriodicDamageDealt(sim *Simulation, spell *Spell, result *SpellResult)

Invokes the OnPeriodicDamage

As a debuff when target is being hit by dot.
As a buff when caster's dots are ticking.

func (*Target) OnPeriodicDamageTaken

func (at *Target) OnPeriodicDamageTaken(sim *Simulation, spell *Spell, result *SpellResult)

func (*Target) OnPeriodicHealDealt

func (at *Target) OnPeriodicHealDealt(sim *Simulation, spell *Spell, result *SpellResult)

Invokes the OnPeriodicHeal

As a debuff when target is being hit by dot.
As a buff when caster's dots are ticking.

func (*Target) OnPeriodicHealTaken

func (at *Target) OnPeriodicHealTaken(sim *Simulation, spell *Spell, result *SpellResult)

func (*Target) OnRageChange

func (at *Target) OnRageChange(sim *Simulation, metrics *ResourceMetrics)

Invokes the OnRageChange for all tracked auras

func (*Target) OnSpellHitDealt

func (at *Target) OnSpellHitDealt(sim *Simulation, spell *Spell, result *SpellResult)

Invokes the OnSpellHit event for all tracked Auras.

func (*Target) OnSpellHitTaken

func (at *Target) OnSpellHitTaken(sim *Simulation, spell *Spell, result *SpellResult)

func (*Target) RegisterResetEffect

func (at *Target) RegisterResetEffect(resetEffect ResetEffect)

Registers a callback to this Character which will be invoked on every Sim reset.

func (*Target) RemoveHealth

func (hb *Target) RemoveHealth(sim *Simulation, amount float64)

func (*Target) Reset

func (target *Target) Reset(sim *Simulation)

func (*Target) ResetEnergyTick

func (eb *Target) ResetEnergyTick(sim *Simulation)

Gives an immediate partial energy tick and restarts the tick timer.

func (*Target) SpendComboPoints

func (eb *Target) SpendComboPoints(sim *Simulation, 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) SpendRage

func (rb *Target) SpendRage(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*Target) StartOOMEvent

func (mb *Target) StartOOMEvent(sim *Simulation, requiredMana float64)

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, pointsToAdd int32, metrics *ResourceMetrics)

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

func (td *TargetDummy) ApplyRunes()

func (*TargetDummy) ApplyTalents

func (td *TargetDummy) ApplyTalents()

func (*TargetDummy) ComboPoints

func (eb *TargetDummy) ComboPoints() int32

func (*TargetDummy) CurrentEnergy

func (eb *TargetDummy) CurrentEnergy() float64

func (*TargetDummy) CurrentFocus

func (fb *TargetDummy) CurrentFocus() float64

func (*TargetDummy) CurrentFocusPerTick

func (fb *TargetDummy) CurrentFocusPerTick() 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) 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) MaxHealth

func (hb *TargetDummy) MaxHealth() float64

func (*TargetDummy) NextEnergyTickAt

func (eb *TargetDummy) NextEnergyTickAt() time.Duration

func (*TargetDummy) NumActiveAurasWithTag

func (at *TargetDummy) NumActiveAurasWithTag(tag string) int32

func (*TargetDummy) OnCastComplete

func (at *TargetDummy) OnCastComplete(sim *Simulation, spell *Spell)

Invokes the OnCastComplete event for all tracked Auras.

func (*TargetDummy) OnHealDealt

func (at *TargetDummy) OnHealDealt(sim *Simulation, spell *Spell, result *SpellResult)

Invokes the OnHeal event for all tracked Auras.

func (*TargetDummy) OnHealTaken

func (at *TargetDummy) OnHealTaken(sim *Simulation, spell *Spell, result *SpellResult)

func (*TargetDummy) OnPeriodicDamageDealt

func (at *TargetDummy) OnPeriodicDamageDealt(sim *Simulation, spell *Spell, result *SpellResult)

Invokes the OnPeriodicDamage

As a debuff when target is being hit by dot.
As a buff when caster's dots are ticking.

func (*TargetDummy) OnPeriodicDamageTaken

func (at *TargetDummy) OnPeriodicDamageTaken(sim *Simulation, spell *Spell, result *SpellResult)

func (*TargetDummy) OnPeriodicHealDealt

func (at *TargetDummy) OnPeriodicHealDealt(sim *Simulation, spell *Spell, result *SpellResult)

Invokes the OnPeriodicHeal

As a debuff when target is being hit by dot.
As a buff when caster's dots are ticking.

func (*TargetDummy) OnPeriodicHealTaken

func (at *TargetDummy) OnPeriodicHealTaken(sim *Simulation, spell *Spell, result *SpellResult)

func (*TargetDummy) OnRageChange

func (at *TargetDummy) OnRageChange(sim *Simulation, metrics *ResourceMetrics)

Invokes the OnRageChange for all tracked auras

func (*TargetDummy) OnSpellHitDealt

func (at *TargetDummy) OnSpellHitDealt(sim *Simulation, spell *Spell, result *SpellResult)

Invokes the OnSpellHit event for all tracked Auras.

func (*TargetDummy) OnSpellHitTaken

func (at *TargetDummy) OnSpellHitTaken(sim *Simulation, spell *Spell, result *SpellResult)

func (*TargetDummy) RegisterResetEffect

func (at *TargetDummy) RegisterResetEffect(resetEffect ResetEffect)

Registers a callback to this Character which will be invoked on every Sim reset.

func (*TargetDummy) RemoveHealth

func (hb *TargetDummy) RemoveHealth(sim *Simulation, amount float64)

func (*TargetDummy) Reset

func (td *TargetDummy) Reset(sim *Simulation)

func (*TargetDummy) ResetEnergyTick

func (eb *TargetDummy) ResetEnergyTick(sim *Simulation)

Gives an immediate partial energy tick and restarts the tick timer.

func (*TargetDummy) SpendComboPoints

func (eb *TargetDummy) SpendComboPoints(sim *Simulation, 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) SpendRage

func (rb *TargetDummy) SpendRage(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*TargetDummy) StartOOMEvent

func (mb *TargetDummy) StartOOMEvent(sim *Simulation, requiredMana float64)

func (*TargetDummy) TryUseCooldowns

func (mcdm *TargetDummy) TryUseCooldowns(sim *Simulation)

func (*TargetDummy) UpdateMajorCooldowns

func (mcdm *TargetDummy) UpdateMajorCooldowns()

This function should be called if the CD for a major cooldown changes outside of the TryActivate() call.

type TargetedActionMetrics

type TargetedActionMetrics struct {
	Casts   int32
	Hits    int32
	Crits   int32
	Misses  int32
	Dodges  int32
	Parries int32
	Blocks  int32
	Glances int32

	Damage    float64
	Threat    float64
	Healing   float64
	Shielding float64
	CastTime  time.Duration
}

func (*TargetedActionMetrics) ToProto

func (tam *TargetedActionMetrics) ToProto(unitIndex int32) *proto.TargetedActionMetrics

type Task

type Task interface {
	RunTask(sim *Simulation) time.Duration
}

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

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 63.

	MobType proto.MobType

	// 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

	// All spells that can be cast by this unit.
	Spellbook []*Spell

	// Pets owned by this Unit.
	PetAgents []PetAgent

	DynamicStatsPets      []*Pet
	DynamicMeleeSpeedPets []*Pet

	// AutoAttacks is the manager for auto attack swings.
	// Must be enabled to use, with "EnableAutoAttacks()".
	AutoAttacks AutoAttacks

	Rotation *APLRotation

	// Statistics describing the results of the sim.
	Metrics UnitMetrics

	AttackTables                []map[proto.CastType]*AttackTable
	DynamicDamageTakenModifiers []DynamicDamageTakenModifier

	GCD *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

	CastSpeed float64

	CurrentTarget *Unit

	// The currently-channeled DOT spell, otherwise nil.
	ChanneledDot *Dot
	// contains filtered or unexported fields
}

Unit is an abstraction of a Character/Boss/Pet/etc, containing functionality shared by all of them.

func (*Unit) AddBonusRangedCritRating

func (unit *Unit) AddBonusRangedCritRating(amount float64)

func (*Unit) AddBonusRangedHitRating

func (unit *Unit) AddBonusRangedHitRating(amount float64)

func (*Unit) AddComboPoints

func (eb *Unit) AddComboPoints(sim *Simulation, pointsToAdd int32, metrics *ResourceMetrics)

func (*Unit) AddDynamicDamageTakenModifier

func (unit *Unit) AddDynamicDamageTakenModifier(ddtm DynamicDamageTakenModifier)

func (*Unit) AddEnergy

func (eb *Unit) AddEnergy(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*Unit) 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) AddRage

func (rb *Unit) AddRage(sim *Simulation, amount float64, metrics *ResourceMetrics)

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

func (unit *Unit) Armor() float64

func (*Unit) ArmorPenetrationPercentage

func (unit *Unit) ArmorPenetrationPercentage(armorPenRating float64) float64

func (*Unit) BlockValue

func (unit *Unit) BlockValue() float64

func (*Unit) CancelGCDTimer

func (unit *Unit) CancelGCDTimer(sim *Simulation)

Call this to stop the GCD loop for a unit. This is mostly used for pets that get summoned / expire.

func (*Unit) ComboPoints

func (eb *Unit) ComboPoints() int32

func (*Unit) CurrentEnergy

func (eb *Unit) CurrentEnergy() float64

func (*Unit) CurrentFocus

func (fb *Unit) CurrentFocus() float64

func (*Unit) CurrentFocusPerTick

func (fb *Unit) CurrentFocusPerTick() 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) DisableDynamicStatDep

func (unit *Unit) DisableDynamicStatDep(sim *Simulation, dep *stats.StatDependency)

func (*Unit) EnableAutoAttacks

func (unit *Unit) EnableAutoAttacks(agent Agent, options AutoAttackOptions)

func (*Unit) EnableDynamicStatDep

func (unit *Unit) EnableDynamicStatDep(sim *Simulation, dep *stats.StatDependency)

func (*Unit) EnableEnergyBar

func (unit *Unit) EnableEnergyBar(maxEnergy float64)

func (*Unit) EnableFocusBar

func (unit *Unit) EnableFocusBar(regenMultiplier float64, onFocusGain OnFocusGain)

func (*Unit) EnableHealthBar

func (unit *Unit) EnableHealthBar()

func (*Unit) EnableRageBar

func (unit *Unit) EnableRageBar(options RageBarOptions)

func (*Unit) EndOOMEvent

func (mb *Unit) EndOOMEvent(sim *Simulation)

func (*Unit) ExecuteCustomRotation

func (unit *Unit) ExecuteCustomRotation(_ *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) 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) GetCurrentPowerBar

func (unit *Unit) GetCurrentPowerBar() PowerBarType

func (*Unit) GetEnemyExclusiveCategories

func (caster *Unit) GetEnemyExclusiveCategories(category string) ExclusiveCategoryArray

func (*Unit) GetIcdAuraByID

func (at *Unit) GetIcdAuraByID(actionID ActionID) *Aura

func (*Unit) GetInitialStat

func (unit *Unit) GetInitialStat(stat stats.Stat) float64

func (*Unit) GetManaNotCastingMetrics

func (unit *Unit) GetManaNotCastingMetrics() *ResourceMetrics

func (*Unit) GetMetadata

func (unit *Unit) GetMetadata() *proto.UnitMetadata

func (*Unit) GetMetricsProto

func (at *Unit) GetMetricsProto() []*proto.AuraMetrics

func (*Unit) GetOpponents

func (unit *Unit) GetOpponents() []*Unit

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) GetResistanceForSchool added in v0.0.3

func (unit *Unit) GetResistanceForSchool(schoolIndex stats.SchoolIndex) float64

Only for base schools!

func (*Unit) GetSchoolBonusDamageTaken added in v0.0.4

func (unit *Unit) GetSchoolBonusDamageTaken(spell *Spell) float64

Returns highest if spell is multi school.

func (*Unit) GetSchoolCritTakenChance added in v0.0.3

func (unit *Unit) GetSchoolCritTakenChance(spell *Spell) float64

Returns highest if spell is multi school.

func (*Unit) GetSchoolDamageDoneMultiplier

func (unit *Unit) GetSchoolDamageDoneMultiplier(spell *Spell) float64

Get school damage done multiplier. Returns highest multiplier if spell is multi school.

func (*Unit) GetSchoolDamageTakenMultiplier

func (unit *Unit) GetSchoolDamageTakenMultiplier(spell *Spell) float64

Get school damage taken multiplier. Returns highest multiplier if spell is multi school.

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

func (unit *Unit) IsActive() 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) IsOOM

func (mb *Unit) IsOOM() bool

func (*Unit) IsOpponent

func (unit *Unit) IsOpponent(other *Unit) bool

func (*Unit) Log

func (unit *Unit) Log(sim *Simulation, message string, vals ...interface{})

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

func (unit *Unit) ManaTick(sim *Simulation)

Applies 1 'tick' of mana regen, which worth 2s of regeneration based on mp5/int/spirit/etc.

func (*Unit) 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) MoveTo

func (unit *Unit) MoveTo(moveRange float64, sim *Simulation)

func (*Unit) MultiplyAttackSpeed

func (unit *Unit) MultiplyAttackSpeed(sim *Simulation, amount float64)

Helper for when both MultiplyMeleeSpeed and MultiplyRangedSpeed are needed.

func (*Unit) MultiplyCastSpeed

func (unit *Unit) MultiplyCastSpeed(amount 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) MultiplyRangedSpeed

func (unit *Unit) MultiplyRangedSpeed(sim *Simulation, amount float64)

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(_ *APLRotation, _ *proto.APLValue) APLValue

Default implementation of Agent.NewAPLValue so each spec doesn't need this boilerplate.

func (*Unit) NewComboPointMetrics

func (unit *Unit) NewComboPointMetrics(actionID ActionID) *ResourceMetrics

func (*Unit) NewEnemyAuraArray

func (caster *Unit) NewEnemyAuraArray(makeAura func(*Unit, int32) *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) NewHealthMetrics

func (unit *Unit) NewHealthMetrics(actionID ActionID) *ResourceMetrics

Convenience helpers for NewResourceMetrics.

func (*Unit) NewManaMetrics

func (unit *Unit) NewManaMetrics(actionID ActionID) *ResourceMetrics

func (*Unit) NewPartyAuraArray

func (caster *Unit) NewPartyAuraArray(makeAura func(*Unit) *Aura) AuraArray

func (*Unit) NewRageMetrics

func (unit *Unit) NewRageMetrics(actionID ActionID) *ResourceMetrics

func (*Unit) NewRaidAuraArray

func (caster *Unit) NewRaidAuraArray(makeAura func(*Unit) *Aura) AuraArray

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

func (at *Unit) OnCastComplete(sim *Simulation, spell *Spell)

Invokes the OnCastComplete event for all tracked Auras.

func (*Unit) OnHealDealt

func (at *Unit) OnHealDealt(sim *Simulation, spell *Spell, result *SpellResult)

Invokes the OnHeal event for all tracked Auras.

func (*Unit) OnHealTaken

func (at *Unit) OnHealTaken(sim *Simulation, spell *Spell, result *SpellResult)

func (*Unit) OnPeriodicDamageDealt

func (at *Unit) OnPeriodicDamageDealt(sim *Simulation, spell *Spell, result *SpellResult)

Invokes the OnPeriodicDamage

As a debuff when target is being hit by dot.
As a buff when caster's dots are ticking.

func (*Unit) OnPeriodicDamageTaken

func (at *Unit) OnPeriodicDamageTaken(sim *Simulation, spell *Spell, result *SpellResult)

func (*Unit) OnPeriodicHealDealt

func (at *Unit) OnPeriodicHealDealt(sim *Simulation, spell *Spell, result *SpellResult)

Invokes the OnPeriodicHeal

As a debuff when target is being hit by dot.
As a buff when caster's dots are ticking.

func (*Unit) OnPeriodicHealTaken

func (at *Unit) OnPeriodicHealTaken(sim *Simulation, spell *Spell, result *SpellResult)

func (*Unit) OnRageChange

func (at *Unit) OnRageChange(sim *Simulation, metrics *ResourceMetrics)

Invokes the OnRageChange for all tracked auras

func (*Unit) OnSpellHitDealt

func (at *Unit) OnSpellHitDealt(sim *Simulation, spell *Spell, result *SpellResult)

Invokes the OnSpellHit event for all tracked Auras.

func (*Unit) OnSpellHitTaken

func (at *Unit) OnSpellHitTaken(sim *Simulation, spell *Spell, result *SpellResult)

func (*Unit) OnSpellRegistered

func (unit *Unit) OnSpellRegistered(handler SpellRegisteredHandler)

func (*Unit) RangedSwingSpeed

func (unit *Unit) RangedSwingSpeed() float64

func (*Unit) RangedWeaponDamage

func (unit *Unit) RangedWeaponDamage(sim *Simulation, attackPower float64) float64

func (*Unit) RegisterAura

func (unit *Unit) RegisterAura(aura Aura) *Aura

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

func (hb *Unit) RemoveHealth(sim *Simulation, amount float64)

func (*Unit) ResetEnergyTick

func (eb *Unit) ResetEnergyTick(sim *Simulation)

Gives an immediate partial energy tick and restarts the tick timer.

func (*Unit) SetCurrentPowerBar

func (unit *Unit) SetCurrentPowerBar(bar PowerBarType)

func (*Unit) SetGCDTimer

func (unit *Unit) SetGCDTimer(sim *Simulation, gcdReadyAt time.Duration)

func (*Unit) SpellGCD

func (unit *Unit) SpellGCD() time.Duration

func (*Unit) SpendComboPoints

func (eb *Unit) SpendComboPoints(sim *Simulation, metrics *ResourceMetrics)

func (*Unit) SpendEnergy

func (eb *Unit) SpendEnergy(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*Unit) SpendFocus

func (fb *Unit) SpendFocus(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*Unit) SpendMana

func (unit *Unit) SpendMana(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*Unit) SpendRage

func (rb *Unit) SpendRage(sim *Simulation, amount float64, metrics *ResourceMetrics)

func (*Unit) SpiritManaRegenPerSecondDefault

func (unit *Unit) SpiritManaRegenPerSecondDefault() float64

Returns the rate of mana regen per second from spirit. All classes except Priest and Mage use this.

func (*Unit) StartOOMEvent

func (mb *Unit) StartOOMEvent(sim *Simulation, requiredMana float64)

func (*Unit) SwingSpeed

func (unit *Unit) SwingSpeed() float64

func (*Unit) TimeUntilManaRegen

func (unit *Unit) TimeUntilManaRegen(desiredMana float64) time.Duration

Returns the amount of time this Unit would need to wait in order to reach the desired amount of mana, via mana regen.

Assumes that desiredMana > currentMana. Calculation assumes the Unit will not take any actions during this period that would reset the 5-second rule.

func (*Unit) UpdateManaRegenRates

func (unit *Unit) UpdateManaRegenRates()

func (*Unit) 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) 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

func (*UnitMetrics) UpdateDpasp

func (unitMetrics *UnitMetrics) UpdateDpasp(dpspSeconds float64)

type UnitReference

type UnitReference struct {
	// 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 Weapon

type Weapon struct {
	BaseDamageMin        float64
	BaseDamageMax        float64
	AttackPowerPerDPS    float64
	SwingSpeed           float64
	NormalizedSwingSpeed float64
	SpellSchool          SpellSchool
}

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

func (weapon *Weapon) GetSpellSchool() SpellSchool

type WeaponAttack

type WeaponAttack struct {
	Weapon
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL