druid

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SpellFlagNaturesGrace = core.SpellFlagAgentReserved1
	SpellFlagOmenTrigger  = core.SpellFlagAgentReserved2
)
View Source
const AnimalSpiritRegenSuppression = 0.911337

Converts from 0.009327 to 0.0085

View Source
const CryingWind int32 = 45270
View Source
const IdolAvenger int32 = 31025
View Source
const IdolSteadfastRenewal int32 = 40712

Variables

View Source
var ItemSetDreamwalkerBattlegear = core.NewItemSet(core.ItemSet{
	Name: "Dreamwalker Battlegear",
	Bonuses: map[int32]core.ApplyEffect{
		2: func(agent core.Agent) {

		},
		4: func(agent core.Agent) {

		},
	},
})
View Source
var ItemSetDreamwalkerGarb = core.NewItemSet(core.ItemSet{
	Name: "Dreamwalker Garb",
	Bonuses: map[int32]core.ApplyEffect{
		2: func(agent core.Agent) {

		},
		4: func(agent core.Agent) {

		},
	},
})

T7 Balance

View Source
var ItemSetGladiatorsSanctuary = core.NewItemSet(core.ItemSet{
	Name: "Gladiator's Sanctuary",
	Bonuses: map[int32]core.ApplyEffect{
		2: func(agent core.Agent) {
			agent.GetCharacter().AddStat(stats.Resilience, 100)
			agent.GetCharacter().AddStat(stats.AttackPower, 50)
		},
		4: func(agent core.Agent) {
			agent.GetCharacter().AddStat(stats.AttackPower, 150)
		},
	},
})
View Source
var ItemSetGladiatorsWildhide = core.NewItemSet(core.ItemSet{
	Name: "Gladiator's Wildhide",
	Bonuses: map[int32]core.ApplyEffect{
		2: func(agent core.Agent) {
			druid := agent.(DruidAgent).GetDruid()
			druid.AddStat(stats.SpellPower, 29)
			druid.AddStat(stats.Resilience, 100)
		},
		4: func(agent core.Agent) {
			druid := agent.(DruidAgent).GetDruid()
			druid.AddStat(stats.SpellPower, 88)

			percentReduction := float64(time.Millisecond*1500) / float64(druid.starfireCastTime())
			swiftStarfireAura := druid.RegisterAura(core.Aura{
				Label:    "Swift Starfire",
				ActionID: core.ActionID{SpellID: 46832},
				Duration: time.Second * 15,
				OnGain: func(aura *core.Aura, sim *core.Simulation) {
					druid.Starfire.CastTimeMultiplier -= percentReduction
				},
				OnExpire: func(aura *core.Aura, sim *core.Simulation) {
					druid.Starfire.CastTimeMultiplier += percentReduction
				},
				OnCastComplete: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell) {
					if druid.Starfire.IsEqual(spell) {
						aura.Deactivate(sim)
					}
				},
			})

			druid.RegisterAura(core.Aura{
				Label:    "Swift Starfire trigger",
				Duration: core.NeverExpires,
				OnReset: func(aura *core.Aura, sim *core.Simulation) {
					aura.Activate(sim)
				},
				OnCastComplete: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell) {
					if druid.Wrath.IsEqual(spell) && sim.RandomFloat("Swift Starfire proc") > 0.85 {
						swiftStarfireAura.Activate(sim)
					}
				},
			})
		},
	},
})
View Source
var ItemSetLasherweaveBattlegear = core.NewItemSet(core.ItemSet{
	Name: "Lasherweave Battlegear",
	Bonuses: map[int32]core.ApplyEffect{
		2: func(agent core.Agent) {

		},
		4: func(agent core.Agent) {

		},
	},
})
View Source
var ItemSetLasherweaveRegalia = core.NewItemSet(core.ItemSet{
	Name: "Lasherweave Regalia",
	Bonuses: map[int32]core.ApplyEffect{
		2: func(agent core.Agent) {

		},
		4: func(agent core.Agent) {

			druid := agent.(DruidAgent).GetDruid()

			druid.Languish = druid.RegisterSpell(Any, core.SpellConfig{
				ActionID:    core.ActionID{SpellID: 71023},
				SpellSchool: core.SpellSchoolNature,

				ProcMask:         core.ProcMaskProc,
				DamageMultiplier: 1,
				ThreatMultiplier: 1,

				Dot: core.DotConfig{
					Aura: core.Aura{
						Label: "Languish",
					},
					NumberOfTicks: 2,
					TickLength:    time.Second * 2,

					OnTick: func(sim *core.Simulation, target *core.Unit, dot *core.Dot) {
						dot.CalcAndDealPeriodicSnapshotDamage(sim, target, dot.OutcomeTick)
					},
				},
				ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
					spell.SpellMetrics[target.UnitIndex].Hits++
					spell.Dot(target).ApplyOrReset(sim)
				},
			})

			druid.RegisterAura(core.Aura{
				Label:    "Languish proc",
				Duration: core.NeverExpires,
				OnReset: func(aura *core.Aura, sim *core.Simulation) {
					aura.Activate(sim)
				},
				OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
					if !druid.Starfire.IsEqual(spell) && !druid.Wrath.IsEqual(spell) {
						return
					}
					if result.DidCrit() {
						dot := druid.Languish.Dot(result.Target)

						newDamage := result.Damage * 0.07
						outstandingDamage := core.TernaryFloat64(dot.IsActive(), dot.SnapshotBaseDamage*float64(dot.NumberOfTicks-dot.TickCount), 0)

						dot.SnapshotAttackerMultiplier = 1
						dot.SnapshotBaseDamage = (outstandingDamage + newDamage) / 2.0
						druid.Languish.Cast(sim, result.Target)
					}
				},
			})
		},
	},
})

T10 Balance

View Source
var ItemSetMalfurionsBattlegear = core.NewItemSet(core.ItemSet{
	Name:            "Malfurion's Battlegear",
	AlternativeName: "Runetotem's Battlegear",
	Bonuses: map[int32]core.ApplyEffect{
		2: func(agent core.Agent) {

		},
		4: func(agent core.Agent) {

		},
	},
})
View Source
var ItemSetMalfurionsRegalia = core.NewItemSet(core.ItemSet{
	Name:            "Malfurion's Regalia",
	AlternativeName: "Runetotem's Regalia",
	Bonuses: map[int32]core.ApplyEffect{
		2: func(agent core.Agent) {

		},
		4: func(agent core.Agent) {

		},
	},
})

T9 Balance

View Source
var ItemSetMalorneHarness = core.NewItemSet(core.ItemSet{
	Name: "Malorne Harness",
	Bonuses: map[int32]core.ApplyEffect{
		2: func(agent core.Agent) {
			druid := agent.(DruidAgent).GetDruid()

			procChance := 0.04
			rageMetrics := druid.NewRageMetrics(core.ActionID{SpellID: 37306})
			energyMetrics := druid.NewEnergyMetrics(core.ActionID{SpellID: 37311})

			druid.RegisterAura(core.Aura{
				Label:    "Malorne 4pc",
				Duration: core.NeverExpires,
				OnReset: func(aura *core.Aura, sim *core.Simulation) {
					aura.Activate(sim)
				},
				OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
					if result.Landed() && spell.ProcMask.Matches(core.ProcMaskMelee) {
						if sim.RandomFloat("Malorne 2pc") < procChance {
							if druid.InForm(Bear) {
								druid.AddRage(sim, 10, rageMetrics)
							} else if druid.InForm(Cat) {
								druid.AddEnergy(sim, 20, energyMetrics)
							}
						}
					}
				},
			})
		},
		4: func(agent core.Agent) {
			druid := agent.(DruidAgent).GetDruid()
			if druid.InForm(Bear) {
				druid.AddStat(stats.Armor, 1400)
			} else if druid.InForm(Cat) {
				druid.AddStat(stats.Strength, 30)
			}
		},
	},
})

T4 feral

View Source
var ItemSetMalorneRegalia = core.NewItemSet(core.ItemSet{
	Name: "Malorne Regalia",
	Bonuses: map[int32]core.ApplyEffect{
		2: func(agent core.Agent) {
			druid := agent.(DruidAgent).GetDruid()
			manaMetrics := druid.NewManaMetrics(core.ActionID{SpellID: 37295})

			druid.RegisterAura(core.Aura{
				Label:    "Malorne Regalia 2pc",
				Duration: core.NeverExpires,
				OnReset: func(aura *core.Aura, sim *core.Simulation) {
					aura.Activate(sim)
				},
				OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
					if spell.ProcMask.Matches(core.ProcMaskMeleeOrRanged) {
						return
					}
					if !result.Landed() {
						return
					}
					if sim.RandomFloat("malorne 2p") > 0.05 {
						return
					}
					spell.Unit.AddMana(sim, 120, manaMetrics)
				},
			})
		},
		4: func(agent core.Agent) {

		},
	},
})

T4 Balance

View Source
var ItemSetNightsongBattlegear = core.NewItemSet(core.ItemSet{
	Name: "Nightsong Battlegear",
	Bonuses: map[int32]core.ApplyEffect{
		2: func(agent core.Agent) {
			druid := agent.(DruidAgent).GetDruid()

			procChance := 0.02

			cca := druid.GetAura("Clearcasting")

			icd := core.Cooldown{
				Timer:    druid.NewTimer(),
				Duration: time.Second * 15,
			}

			druid.RegisterAura(core.Aura{
				Label:    "Nightsong 2pc",
				Duration: core.NeverExpires,
				OnReset: func(aura *core.Aura, sim *core.Simulation) {
					aura.Activate(sim)
					cca = druid.GetAura("Clearcasting")
					cca.Icd = &icd
					if cca == nil {
						panic("no valid clearcasting aura")
					}
				},
				OnPeriodicDamageDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
					if !druid.Rake.IsEqual(spell) && !druid.Rip.IsEqual(spell) && !druid.Lacerate.IsEqual(spell) {
						return
					}
					if !icd.IsReady(sim) {
						return
					}
					if sim.RandomFloat("Nightsong 2pc") < procChance {
						icd.Use(sim)
						cca.Activate(sim)
					}
				},
			})
		},
		4: func(agent core.Agent) {

		},
	},
})
View Source
var ItemSetNightsongGarb = core.NewItemSet(core.ItemSet{
	Name: "Nightsong Garb",
	Bonuses: map[int32]core.ApplyEffect{
		2: func(agent core.Agent) {

		},
		4: func(agent core.Agent) {

		},
	},
})

T8 Balance

View Source
var ItemSetNordrassilHarness = core.NewItemSet(core.ItemSet{
	Name: "Nordrassil Harness",
	Bonuses: map[int32]core.ApplyEffect{
		4: func(agent core.Agent) {

		},
	},
})

T5 Feral

View Source
var ItemSetNordrassilRegalia = core.NewItemSet(core.ItemSet{
	Name: "Nordrassil Regalia",
	Bonuses: map[int32]core.ApplyEffect{
		4: func(agent core.Agent) {

		},
	},
})

T5 Balance

View Source
var ItemSetThunderheartHarness = core.NewItemSet(core.ItemSet{
	Name: "Thunderheart Harness",
	Bonuses: map[int32]core.ApplyEffect{
		2: func(agent core.Agent) {

		},
		4: func(agent core.Agent) {

		},
	},
})

T6 Feral

View Source
var ItemSetThunderheartRegalia = core.NewItemSet(core.ItemSet{
	Name: "Thunderheart Regalia",
	Bonuses: map[int32]core.ApplyEffect{
		2: func(agent core.Agent) {

		},
		4: func(agent core.Agent) {

		},
	},
})

T6 Balance

View Source
var TalentTreeSizes = [3]int{28, 30, 27}

Functions

This section is empty.

Types

type Druid

type Druid struct {
	core.Character
	SelfBuffs
	Talents *proto.DruidTalents

	StartingForm DruidForm

	RebirthUsed       bool
	MaulRageThreshold float64
	RebirthTiming     float64
	BleedsActive      int
	AssumeBleedActive bool
	RaidBuffTargets   int
	PrePopBerserk     bool

	ReplaceBearMHFunc core.ReplaceMHSwing

	Barkskin             *DruidSpell
	Berserk              *DruidSpell
	DemoralizingRoar     *DruidSpell
	Enrage               *DruidSpell
	FaerieFire           *DruidSpell
	FerociousBite        *DruidSpell
	ForceOfNature        *DruidSpell
	FrenziedRegeneration *DruidSpell
	Hurricane            *DruidSpell
	InsectSwarm          *DruidSpell
	GiftOfTheWild        *DruidSpell
	Lacerate             *DruidSpell
	Languish             *DruidSpell
	MangleBear           *DruidSpell
	MangleCat            *DruidSpell
	Maul                 *DruidSpell
	MaulQueueSpell       *DruidSpell
	Moonfire             *DruidSpell
	Rebirth              *DruidSpell
	Rake                 *DruidSpell
	Rip                  *DruidSpell
	SavageRoar           *DruidSpell
	Shred                *DruidSpell
	Starfire             *DruidSpell
	Starfall             *DruidSpell
	StarfallSplash       *DruidSpell
	SurvivalInstincts    *DruidSpell
	SwipeBear            *DruidSpell
	// SwipeCat             *DruidSpell
	TigersFury *DruidSpell
	Typhoon    *DruidSpell
	Wrath      *DruidSpell

	CatForm  *DruidSpell
	BearForm *DruidSpell

	BarkskinAura             *core.Aura
	BearFormAura             *core.Aura
	BerserkAura              *core.Aura
	CatFormAura              *core.Aura
	ClearcastingAura         *core.Aura
	DemoralizingRoarAuras    core.AuraArray
	EnrageAura               *core.Aura
	FaerieFireAuras          core.AuraArray
	FrenziedRegenerationAura *core.Aura
	MaulQueueAura            *core.Aura
	MoonkinT84PCAura         *core.Aura
	NaturesGraceProcAura     *core.Aura
	PredatoryInstinctsAura   *core.Aura
	SavageDefenseAura        *core.Aura
	SurvivalInstinctsAura    *core.Aura
	TigersFuryAura           *core.Aura
	SavageRoarAura           *core.Aura
	SolarEclipseProcAura     *core.Aura
	LunarEclipseProcAura     *core.Aura
	OwlkinFrenzyAura         *core.Aura

	BleedCategories core.ExclusiveCategoryArray

	PrimalPrecisionRecoveryMetrics *core.ResourceMetrics
	SavageRoarDurationTable        [6]time.Duration

	ProcOoc func(sim *core.Simulation)

	ExtendingMoonfireStacks int
	LunarICD                core.Cooldown
	SolarICD                core.Cooldown
	Treant1                 *TreantPet
	Treant2                 *TreantPet
	Treant3                 *TreantPet
	OwlkinFrenzyTimings     []float64
	// contains filtered or unexported fields
}

func New

func New(char core.Character, form DruidForm, selfBuffs SelfBuffs, talents string) *Druid

func (*Druid) AddRaidBuffs

func (druid *Druid) AddRaidBuffs(raidBuffs *proto.RaidBuffs)

func (*Druid) ApplyTalents

func (druid *Druid) ApplyTalents()

func (*Druid) BalanceCritMultiplier

func (druid *Druid) BalanceCritMultiplier() float64

func (*Druid) BearArmorMultiplier added in v1.0.1

func (druid *Druid) BearArmorMultiplier() float64

func (*Druid) CanShred

func (druid *Druid) CanShred() bool

func (*Druid) ClearForm

func (druid *Druid) ClearForm(sim *core.Simulation)

func (*Druid) CurrentFerociousBiteCost

func (druid *Druid) CurrentFerociousBiteCost() float64

func (*Druid) CurrentMangleCatCost

func (druid *Druid) CurrentMangleCatCost() float64

func (*Druid) CurrentRakeCost

func (druid *Druid) CurrentRakeCost() float64

func (*Druid) CurrentRipCost

func (druid *Druid) CurrentRipCost() float64

func (*Druid) CurrentShredCost

func (druid *Druid) CurrentShredCost() float64

func (*Druid) GetBearWeapon

func (druid *Druid) GetBearWeapon() core.Weapon

func (*Druid) GetCatWeapon

func (druid *Druid) GetCatWeapon() core.Weapon

func (*Druid) GetCharacter

func (druid *Druid) GetCharacter() *core.Character

func (*Druid) GetDynamicPredStrikeStats added in v1.0.1

func (druid *Druid) GetDynamicPredStrikeStats() stats.Stats

func (*Druid) GetForm

func (druid *Druid) GetForm() DruidForm

func (*Druid) GetFormShiftStats

func (druid *Druid) GetFormShiftStats() stats.Stats

Bonus stats for both cat and bear.

func (*Druid) HasMajorGlyph

func (druid *Druid) HasMajorGlyph(glyph proto.DruidMajorGlyph) bool

func (*Druid) HasMinorGlyph

func (druid *Druid) HasMinorGlyph(glyph proto.DruidMinorGlyph) bool

func (*Druid) InForm

func (druid *Druid) InForm(form DruidForm) bool

func (*Druid) Initialize

func (druid *Druid) Initialize()

func (*Druid) IsMangle

func (druid *Druid) IsMangle(spell *core.Spell) bool

func (*Druid) IsSwipeSpell

func (druid *Druid) IsSwipeSpell(spell *core.Spell) bool

func (*Druid) MaulReplaceMH

func (druid *Druid) MaulReplaceMH(sim *core.Simulation, mhSwingSpell *core.Spell) *core.Spell

Returns true if the regular melee swing should be used, false otherwise.

func (*Druid) MaxRipTicks

func (druid *Druid) MaxRipTicks() int32

func (*Druid) MeleeCritMultiplier

func (druid *Druid) MeleeCritMultiplier(castedForm DruidForm) float64

func (*Druid) NewTreant

func (druid *Druid) NewTreant() *TreantPet

func (*Druid) QueueMaul

func (druid *Druid) QueueMaul(sim *core.Simulation)

func (*Druid) RegisterBalanceSpells

func (druid *Druid) RegisterBalanceSpells()

func (*Druid) RegisterFeralCatSpells

func (druid *Druid) RegisterFeralCatSpells()

func (*Druid) RegisterFeralTankSpells

func (druid *Druid) RegisterFeralTankSpells(maulRageThreshold float64)

func (*Druid) RegisterSpell added in v1.0.1

func (druid *Druid) RegisterSpell(formMask DruidForm, config core.SpellConfig) *DruidSpell

func (*Druid) Reset

func (druid *Druid) Reset(_ *core.Simulation)

func (*Druid) ShouldDemoralizingRoar

func (druid *Druid) ShouldDemoralizingRoar(sim *core.Simulation, filler bool, maintainOnly bool) bool

func (*Druid) ShouldFaerieFire

func (druid *Druid) ShouldFaerieFire(sim *core.Simulation, target *core.Unit) bool

func (*Druid) ShouldQueueMaul

func (druid *Druid) ShouldQueueMaul(_ *core.Simulation) bool

func (*Druid) ThickHideMultiplier

func (druid *Druid) ThickHideMultiplier() float64

func (*Druid) TryMaul

func (druid *Druid) TryMaul(sim *core.Simulation, mhSwingSpell *core.Spell) *core.Spell

type DruidAgent

type DruidAgent interface {
	GetDruid() *Druid
}

Agent is a generic way to access underlying druid on any of the agents (for example balance druid.)

type DruidForm

type DruidForm uint8
const (
	Humanoid DruidForm = 1 << iota
	Bear
	Cat
	Moonkin
	Tree
	Any = Humanoid | Bear | Cat | Moonkin | Tree
)

func (DruidForm) Matches

func (form DruidForm) Matches(other DruidForm) bool

type DruidSpell added in v1.0.1

type DruidSpell struct {
	*core.Spell
	FormMask DruidForm
}

func (*DruidSpell) CanCast added in v1.0.1

func (ds *DruidSpell) CanCast(sim *core.Simulation, target *core.Unit) bool

func (*DruidSpell) IsEqual added in v1.0.1

func (ds *DruidSpell) IsEqual(s *core.Spell) bool

func (*DruidSpell) IsReady added in v1.0.1

func (ds *DruidSpell) IsReady(sim *core.Simulation) bool

type SelfBuffs

type SelfBuffs struct {
	InnervateTarget *proto.UnitReference
}

type TreantPet

type TreantPet struct {
	core.Pet
	// contains filtered or unexported fields
}

func (*TreantPet) GetPet

func (treant *TreantPet) GetPet() *core.Pet

func (*TreantPet) Initialize

func (treant *TreantPet) Initialize()

func (*TreantPet) OnGCDReady

func (treant *TreantPet) OnGCDReady(_ *core.Simulation)

func (*TreantPet) Reset

func (treant *TreantPet) Reset(_ *core.Simulation)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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