warrior

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ShoutExpirationThreshold = time.Second * 3

Variables

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

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

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

			warrior := agent.(WarriorAgent).GetWarrior()
			procAura := warrior.RegisterAura(core.Aura{
				Label:     "Destroyer 2pc Proc",
				ActionID:  core.ActionID{SpellID: 37522},
				Duration:  time.Second * 6,
				MaxStacks: 1,
				OnGain: func(aura *core.Aura, sim *core.Simulation) {
					warrior.AddStatDynamic(sim, stats.BlockValue, 100)
				},
				OnExpire: func(aura *core.Aura, sim *core.Simulation) {
					warrior.AddStatDynamic(sim, stats.BlockValue, -100)
				},
				OnSpellHitTaken: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, spellEffect *core.SpellEffect) {
					if spellEffect.Outcome.Matches(core.OutcomeBlock) {
						aura.RemoveStack(sim)
					}
				},
			})

			warrior.RegisterAura(core.Aura{
				Label:    "Destroyer 2pc",
				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 spell == warrior.ShieldBlock {
						procAura.Activate(sim)
						procAura.SetStacks(sim, 1)
					}
				},
			})
		},
		4: func(agent core.Agent) {

			warrior := agent.(WarriorAgent).GetWarrior()
			procAura := warrior.NewTemporaryStatsAura("Destroyer 4pc Proc", core.ActionID{SpellID: 37525}, stats.Stats{stats.MeleeHaste: 200}, time.Second*10)

			warrior.RegisterAura(core.Aura{
				Label:    "Destroyer 4pc",
				Duration: core.NeverExpires,
				OnReset: func(aura *core.Aura, sim *core.Simulation) {
					aura.Activate(sim)
				},
				OnSpellHitTaken: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, spellEffect *core.SpellEffect) {
					if spellEffect.Landed() && sim.RandomFloat("Destroyer 4pc") < 0.07 {
						procAura.Activate(sim)
					}
				},
			})
		},
	},
})
View Source
var ItemSetDestroyerBattlegear = core.NewItemSet(core.ItemSet{
	Name: "Destroyer Battlegear",
	Bonuses: map[int32]core.ApplyEffect{
		2: func(agent core.Agent) {

			warrior := agent.(WarriorAgent).GetWarrior()
			procAura := warrior.NewTemporaryStatsAura("Destroyer 2pc Proc", core.ActionID{SpellID: 37528}, stats.Stats{stats.AttackPower: 100}, time.Second*5)

			warrior.RegisterAura(core.Aura{
				Label:    "Destroyer 2pc",
				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 spell == warrior.Overpower {
						procAura.Activate(sim)
					}
				},
			})
		},
		4: func(agent core.Agent) {

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

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

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

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

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

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

			warrior := agent.(WarriorAgent).GetWarrior()

			procAura := warrior.RegisterAura(core.Aura{
				Label:    "Warbringer 4pc Proc",
				ActionID: core.ActionID{SpellID: 37516},
				Duration: core.NeverExpires,
				OnGain: func(aura *core.Aura, sim *core.Simulation) {
					aura.Unit.PseudoStats.DamageDealtMultiplier *= 1.1
				},
				OnExpire: func(aura *core.Aura, sim *core.Simulation) {
					aura.Unit.PseudoStats.DamageDealtMultiplier /= 1.1
				},
				OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, spellEffect *core.SpellEffect) {
					if spellEffect.Damage > 0 {
						aura.Deactivate(sim)
					}
				},
			})

			warrior.RegisterAura(core.Aura{
				Label:    "Warbringer 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, spellEffect *core.SpellEffect) {
					if spell == warrior.Revenge {
						procAura.Activate(sim)
					}
				},
			})
		},
	},
})
View Source
var ItemSetWarbringerBattlegear = core.NewItemSet(core.ItemSet{
	Name: "Warbringer Battlegear",
	Bonuses: map[int32]core.ApplyEffect{
		2: func(agent core.Agent) {

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

			warrior := agent.(WarriorAgent).GetWarrior()
			rageMetrics := warrior.NewRageMetrics(core.ActionID{SpellID: 37519})

			warrior.RegisterAura(core.Aura{
				Label:    "Warbringer 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, spellEffect *core.SpellEffect) {
					if spellEffect.Outcome.Matches(core.OutcomeDodge | core.OutcomeParry) {
						warrior.AddRage(sim, 2, rageMetrics)
					}
				},
			})
		},
	},
})
View Source
var SunderArmorActionID = core.ActionID{SpellID: 25225}

Functions

This section is empty.

Types

type Stance

type Stance uint8
const (
	BattleStance Stance = 1 << iota
	DefensiveStance
	BerserkerStance
)

type Warrior

type Warrior struct {
	core.Character

	Talents proto.WarriorTalents

	WarriorInputs

	// Current state
	Stance Stance

	RevengeValidUntil time.Duration

	Shout           *core.Spell
	BattleStance    *core.Spell
	DefensiveStance *core.Spell
	BerserkerStance *core.Spell

	BerserkerRage        *core.Spell
	Bloodthirst          *core.Spell
	DemoralizingShout    *core.Spell
	Devastate            *core.Spell
	Execute              *core.Spell
	Hamstring            *core.Spell
	MortalStrike         *core.Spell
	Overpower            *core.Spell
	Rampage              *core.Spell
	Revenge              *core.Spell
	ShieldBlock          *core.Spell
	ShieldSlam           *core.Spell
	Slam                 *core.Spell
	SunderArmor          *core.Spell
	SunderArmorDevastate *core.Spell
	ThunderClap          *core.Spell
	Whirlwind            *core.Spell

	HeroicStrikeOrCleave *core.Spell
	HSOrCleaveQueueAura  *core.Aura
	HSRageThreshold      float64

	BattleStanceAura    *core.Aura
	DefensiveStanceAura *core.Aura
	BerserkerStanceAura *core.Aura

	DemoralizingShoutAura *core.Aura
	BloodFrenzyAuras      []*core.Aura
	ExposeArmorAura       *core.Aura // Warriors don't cast this but they need to check it.
	RampageAura           *core.Aura
	SunderArmorAura       *core.Aura
	ThunderClapAura       *core.Aura
	// contains filtered or unexported fields
}

func NewWarrior

func NewWarrior(character core.Character, talents proto.WarriorTalents, inputs WarriorInputs) *Warrior

func (*Warrior) AddPartyBuffs

func (warrior *Warrior) AddPartyBuffs(partyBuffs *proto.PartyBuffs)

func (*Warrior) ApplyTalents

func (warrior *Warrior) ApplyTalents()

func (*Warrior) CanBloodthirst

func (warrior *Warrior) CanBloodthirst(sim *core.Simulation) bool

func (*Warrior) CanDemoralizingShout

func (warrior *Warrior) CanDemoralizingShout(sim *core.Simulation) bool

func (*Warrior) CanDevastate

func (warrior *Warrior) CanDevastate(sim *core.Simulation) bool

func (*Warrior) CanExecute

func (warrior *Warrior) CanExecute() bool

func (*Warrior) CanMortalStrike

func (warrior *Warrior) CanMortalStrike(sim *core.Simulation) bool

func (*Warrior) CanRevenge

func (warrior *Warrior) CanRevenge(sim *core.Simulation) bool

func (*Warrior) CanShieldBlock

func (warrior *Warrior) CanShieldBlock(sim *core.Simulation) bool

func (*Warrior) CanShieldSlam

func (warrior *Warrior) CanShieldSlam(sim *core.Simulation) bool

func (*Warrior) CanSlam

func (warrior *Warrior) CanSlam() bool

func (*Warrior) CanSunderArmor

func (warrior *Warrior) CanSunderArmor(sim *core.Simulation) bool

func (*Warrior) CanThunderClap

func (warrior *Warrior) CanThunderClap(sim *core.Simulation) bool

func (*Warrior) CanThunderClapIgnoreStance

func (warrior *Warrior) CanThunderClapIgnoreStance(sim *core.Simulation) bool

func (*Warrior) CanWhirlwind

func (warrior *Warrior) CanWhirlwind(sim *core.Simulation) bool

func (*Warrior) CastSlam

func (warrior *Warrior) CastSlam(sim *core.Simulation, target *core.Unit) bool

func (*Warrior) DequeueHSOrCleave

func (warrior *Warrior) DequeueHSOrCleave(sim *core.Simulation)

func (*Warrior) GetCharacter

func (warrior *Warrior) GetCharacter() *core.Character

func (*Warrior) Initialize

func (warrior *Warrior) Initialize()

func (*Warrior) QueueHSOrCleave

func (warrior *Warrior) QueueHSOrCleave(sim *core.Simulation)

func (*Warrior) RegisterHSOrCleave

func (warrior *Warrior) RegisterHSOrCleave(useCleave bool, rageThreshold float64)

func (*Warrior) RegisterRecklessnessCD

func (warrior *Warrior) RegisterRecklessnessCD()

func (*Warrior) RegisterShieldWallCD

func (warrior *Warrior) RegisterShieldWallCD()

func (*Warrior) Reset

func (warrior *Warrior) Reset(sim *core.Simulation)

func (*Warrior) ShouldBerserkerRage

func (warrior *Warrior) ShouldBerserkerRage(sim *core.Simulation) bool

func (*Warrior) ShouldDemoralizingShout

func (warrior *Warrior) ShouldDemoralizingShout(sim *core.Simulation, filler bool, maintainOnly bool) bool

func (*Warrior) ShouldHamstring

func (warrior *Warrior) ShouldHamstring(sim *core.Simulation) bool

func (*Warrior) ShouldOverpower

func (warrior *Warrior) ShouldOverpower(sim *core.Simulation) bool

func (*Warrior) ShouldQueueHSOrCleave

func (warrior *Warrior) ShouldQueueHSOrCleave(sim *core.Simulation) bool

func (*Warrior) ShouldRampage

func (warrior *Warrior) ShouldRampage(sim *core.Simulation) bool

func (*Warrior) ShouldShout

func (warrior *Warrior) ShouldShout(sim *core.Simulation) bool

func (*Warrior) ShouldThunderClap

func (warrior *Warrior) ShouldThunderClap(sim *core.Simulation, filler bool, maintainOnly bool, ignoreStance bool) bool

func (*Warrior) StanceMatches

func (warrior *Warrior) StanceMatches(other Stance) bool

func (*Warrior) TryHSOrCleave

func (warrior *Warrior) TryHSOrCleave(sim *core.Simulation, mhSwingSpell *core.Spell) *core.Spell

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

type WarriorAgent

type WarriorAgent interface {
	GetWarrior() *Warrior
}

Agent is a generic way to access underlying warrior on any of the agents.

type WarriorInputs

type WarriorInputs struct {
	ShoutType            proto.WarriorShout
	PrecastShout         bool
	PrecastShoutSapphire bool
	PrecastShoutT2       bool
	RampageCDThreshold   time.Duration
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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