warrior

package
v0.1.67 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SpellFlagBloodsurge  = core.SpellFlagAgentReserved1
	SpellFlagWhirlwindOH = core.SpellFlagAgentReserved2
	ArmsTree             = 0
	FuryTree             = 1
	ProtTree             = 2
)
View Source
const ShoutExpirationThreshold = time.Second * 3

Variables

View Source
var ItemSetDreadnaughtBattlegear = core.NewItemSet(core.ItemSet{
	Name: "Dreadnaught 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: 61571})

			procAura := warrior.RegisterAura(core.Aura{
				Label:    "Dreadnaught Battlegear 4pc Proc",
				ActionID: core.ActionID{SpellID: 61571},
				Duration: time.Second * 30,
				OnGain: func(_ *core.Aura, sim *core.Simulation) {
					warrior.PseudoStats.CostReduction += 5
				},
				OnExpire: func(_ *core.Aura, sim *core.Simulation) {
					warrior.PseudoStats.CostReduction -= 5
				},
				OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, _ *core.SpellResult) {
					if !spell.ProcMask.Matches(core.ProcMaskMeleeSpecial) {
						return
					}

					if actualGain := spell.DefaultCast.Cost - spell.CurCast.Cost; actualGain > 0 {
						rageMetrics.AddEvent(5, actualGain)
						aura.Deactivate(sim)
					}
				},
			})

			warrior.RegisterAura(core.Aura{
				Label:    "Dreadnaught Battlegear 4pc",
				Duration: core.NeverExpires,
				OnReset: func(aura *core.Aura, sim *core.Simulation) {
					aura.Activate(sim)
				},
				OnPeriodicDamageDealt: func(_ *core.Aura, sim *core.Simulation, _ *core.Spell, result *core.SpellResult) {
					if result.Landed() && sim.RandomFloat("Dreadnaught Battlegear 4pc") < 0.1 {
						procAura.Activate(sim)
					}
				},
			})
		},
	},
})
View Source
var ItemSetDreadnaughtPlate = core.NewItemSet(core.ItemSet{
	Name: "Dreadnaught Plate",
	Bonuses: map[int32]core.ApplyEffect{
		2: func(agent core.Agent) {

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

		},
	},
})
View Source
var ItemSetGladiatorsBattlegear = core.NewItemSet(core.ItemSet{
	Name: "Gladiator's Battlegear",
	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 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 ItemSetSiegebreakerBattlegear = core.NewItemSet(core.ItemSet{
	Name: "Siegebreaker Battlegear",
	Bonuses: map[int32]core.ApplyEffect{
		2: func(agent core.Agent) {

			warrior := agent.(WarriorAgent).GetWarrior()
			procAura := warrior.RegisterAura(core.Aura{
				Label:    "Siegebreaker Battlegear 2pc Proc",
				ActionID: core.ActionID{SpellID: 64937},
				Duration: time.Second * 5,
				OnGain: func(aura *core.Aura, sim *core.Simulation) {
					warrior.AddStatDynamic(sim, stats.MeleeHaste, 150)
				},
				OnExpire: func(aura *core.Aura, sim *core.Simulation) {
					warrior.AddStatDynamic(sim, stats.MeleeHaste, -150)
				},
			})

			warrior.RegisterAura(core.Aura{
				Label:    "Siegebreaker Battlegear 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.ActionID.SpellID != 47450 && spell != warrior.Slam {
						return
					}
					if !result.Outcome.Matches(core.OutcomeCrit) {
						return
					}
					if result.Landed() && sim.RandomFloat("Siegebreaker Battlegear 2pc") < 0.4 {
						procAura.Activate(sim)
					}
				},
			})
		},
		4: func(agent core.Agent) {

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

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

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

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

		},
	},
})
View Source
var ItemSetWrynnsPlate = core.NewItemSet(core.ItemSet{
	Name:            "Wrynn's Plate",
	AlternativeName: "Hellscream's Plate",
	Bonuses: map[int32]core.ApplyEffect{
		2: func(agent core.Agent) {

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

		},
	},
})
View Source
var ItemSetYmirjarLordsBattlegear = core.NewItemSet(core.ItemSet{
	Name: "Ymirjar Lord's Battlegear",
	Bonuses: map[int32]core.ApplyEffect{
		2: func(agent core.Agent) {

			warrior := agent.(WarriorAgent).GetWarrior()
			var bonusAP float64
			procAura := warrior.RegisterAura(core.Aura{
				Label:    "Ymirjar Lord's Battlegear 2pc Proc",
				ActionID: core.ActionID{SpellID: 70855},
				Duration: time.Second * 10,
				OnGain: func(aura *core.Aura, sim *core.Simulation) {
					bonusAP = warrior.GetStat(stats.AttackPower) * 0.16
					aura.Unit.AddStatDynamic(sim, stats.AttackPower, bonusAP)
				},
				OnExpire: func(aura *core.Aura, sim *core.Simulation) {
					aura.Unit.AddStatDynamic(sim, stats.AttackPower, -bonusAP)
				},
			})

			warrior.RegisterAura(core.Aura{
				Label:    "Ymirjar Lord's Battlegear 2pc",
				Duration: core.NeverExpires,
				OnReset: func(aura *core.Aura, sim *core.Simulation) {
					aura.Activate(sim)
				},
				OnPeriodicDamageDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
					if spell != warrior.DeepWounds {
						return
					}
					if result.Landed() && sim.RandomFloat("Ymirjar 2pc") < 0.03 {
						procAura.Activate(sim)
					}
				},
			})
		},
		4: func(agent core.Agent) {

		},
	},
})
View Source
var ItemSetYmirjarLordsPlate = core.NewItemSet(core.ItemSet{
	Name: "Ymirjar Lord's Plate",
	Bonuses: map[int32]core.ApplyEffect{
		2: func(agent core.Agent) {

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

		},
	},
})
View Source
var TalentTreeSizes = [3]int{31, 27, 27}

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
	RendValidUntil       time.Duration
	BloodsurgeValidUntil time.Duration

	Ymirjar4pcProcAura *core.Aura

	LastAMTick time.Duration

	BattleShout     *core.Spell
	CommandingShout *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
	MortalStrike         *core.Spell
	Overpower            *core.Spell
	Rend                 *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
	WhirlwindOH          *core.Spell
	DeepWounds           *core.Spell
	Shockwave            *core.Spell
	ConcussionBlow       *core.Spell
	Bladestorm           *core.Spell
	BladestormOH         *core.Spell

	HeroicStrike *core.Spell
	Cleave       *core.Spell

	OverpowerAura *core.Aura

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

	BloodsurgeAura  *core.Aura
	SuddenDeathAura *core.Aura
	ShieldBlockAura *core.Aura

	DemoralizingShoutAuras core.AuraArray
	SunderArmorAuras       core.AuraArray
	ThunderClapAuras       core.AuraArray
	// contains filtered or unexported fields
}

func NewWarrior

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

func (*Warrior) AddPartyBuffs

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

func (*Warrior) AddRaidBuffs

func (warrior *Warrior) AddRaidBuffs(raidBuffs *proto.RaidBuffs)

func (*Warrior) ApplyTalents

func (warrior *Warrior) ApplyTalents()

func (*Warrior) CanApplySunderAura added in v0.1.8

func (warrior *Warrior) CanApplySunderAura(target *core.Unit) 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) GetCharacter

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

func (*Warrior) HasMajorGlyph

func (warrior *Warrior) HasMajorGlyph(glyph proto.WarriorMajorGlyph) bool

func (*Warrior) HasMinorGlyph

func (warrior *Warrior) HasMinorGlyph(glyph proto.WarriorMinorGlyph) bool

func (*Warrior) Initialize

func (warrior *Warrior) Initialize()

func (*Warrior) IsSuddenDeathActive added in v0.1.16

func (warrior *Warrior) IsSuddenDeathActive() bool

func (*Warrior) RegisterBladestormCD

func (warrior *Warrior) RegisterBladestormCD()

func (*Warrior) RegisterHeroicThrow added in v0.1.50

func (warrior *Warrior) RegisterHeroicThrow()

func (*Warrior) RegisterRecklessnessCD

func (warrior *Warrior) RegisterRecklessnessCD()

func (*Warrior) RegisterRendSpell added in v0.1.1

func (warrior *Warrior) RegisterRendSpell()

TODO (maybe) https://github.com/magey/wotlk-warrior/issues/23 - Rend is not benefitting from Two-Handed Weapon Specialization

func (*Warrior) RegisterShatteringThrowCD added in v0.1.1

func (warrior *Warrior) RegisterShatteringThrowCD()

func (*Warrior) RegisterShieldBlockCD

func (warrior *Warrior) RegisterShieldBlockCD()

func (*Warrior) RegisterShieldWallCD

func (warrior *Warrior) RegisterShieldWallCD()

func (*Warrior) Reset

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

func (*Warrior) ShouldInstantSlam

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

func (*Warrior) ShouldSlam

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

func (*Warrior) ShouldThunderClap

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

func (*Warrior) StanceMatches

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

func (*Warrior) ToughnessArmorMultiplier added in v0.1.35

func (warrior *Warrior) ToughnessArmorMultiplier() float64

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 {
	StanceSnapshot bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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