hunter

package
v0.0.40 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HunterSpellFlagsNone int64 = 0
	SpellMaskSpellRanged int64 = 1 << iota
	HunterSpellAutoShot
	HunterSpellSteadyShot
	HunterSpellCobraShot
	HunterSpellArcaneShot
	HunterSpellKillCommand
	HunterSpellChimeraShot
	HunterSpellExplosiveShot
	HunterSpellExplosiveTrap
	HunterSpellBlackArrow
	HunterSpellMultiShot
	HunterSpellAimedShot
	HunterSpellSerpentSting
	HunterSpellKillShot
	HunterSpellRapidFire
	HunterSpellBestialWrath
	HunterPetFocusDump
	HunterSpellsAll = HunterSpellSteadyShot | HunterSpellCobraShot |
		HunterSpellArcaneShot | HunterSpellKillCommand | HunterSpellChimeraShot | HunterSpellExplosiveShot |
		HunterSpellExplosiveTrap | HunterSpellBlackArrow | HunterSpellMultiShot | HunterSpellAimedShot |
		HunterSpellSerpentSting | HunterSpellKillShot | HunterSpellRapidFire | HunterSpellBestialWrath
)
View Source
const BiteSpellID = 17253

These IDs are needed for certain talents.

View Source
const ClawSpellID = 16827
View Source
const PetExpertiseScale = 3.25
View Source
const PetGCD = time.Millisecond * 1200

Pet AI doesn't use abilities immediately, so model this with a 1.2s GCD.

View Source
const SmackSpellID = 49966
View Source
const ThoridalTheStarsFuryItemID = 34334

Variables

View Source
var ItemSetAhnKaharBloodHuntersBattlegear = core.NewItemSet(core.ItemSet{
	Name: "Ahn'Kahar Blood Hunter's Battlegear",
	Bonuses: map[int32]core.ApplyEffect{
		2: func(agent core.Agent) {
			hunter := agent.(HunterAgent).GetHunter()
			const procChance = 0.05
			actionID := core.ActionID{SpellID: 70727}

			procAura := hunter.RegisterAura(core.Aura{
				Label:    "AhnKahar 2pc Proc",
				ActionID: actionID,
				Duration: time.Second * 10,
				OnGain: func(aura *core.Aura, sim *core.Simulation) {
					aura.Unit.PseudoStats.DamageDealtMultiplier *= 1.15
				},
				OnExpire: func(aura *core.Aura, sim *core.Simulation) {
					aura.Unit.PseudoStats.DamageDealtMultiplier /= 1.15
				},
			})

			hunter.RegisterAura(core.Aura{
				Label:    "AhnKahar 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 == hunter.AutoAttacks.RangedAuto() && sim.RandomFloat("AhnKahar 2pc") < procChance {
						procAura.Activate(sim)
					}
				},
			})
		},
		4: func(agent core.Agent) {
			hunter := agent.(HunterAgent).GetHunter()
			const procChance = 0.05
			actionID := core.ActionID{SpellID: 70730}

			var curBonus stats.Stats
			procAura := hunter.RegisterAura(core.Aura{
				Label:    "AhnKahar 4pc Proc",
				ActionID: actionID,
				Duration: time.Second * 10,
				OnGain: func(aura *core.Aura, sim *core.Simulation) {
					curBonus = stats.Stats{
						stats.AttackPower:       aura.Unit.GetStat(stats.AttackPower) * 0.1,
						stats.RangedAttackPower: aura.Unit.GetStat(stats.RangedAttackPower) * 0.1,
					}

					aura.Unit.AddStatsDynamic(sim, curBonus)
				},
				OnExpire: func(aura *core.Aura, sim *core.Simulation) {
					aura.Unit.AddStatsDynamic(sim, curBonus.Invert())
				},
			})

			hunter.RegisterAura(core.Aura{
				Label:    "AhnKahar 4pc",
				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 == hunter.SerpentSting && sim.RandomFloat("AhnKahar 4pc") < procChance {
						procAura.Activate(sim)
					}
				},
			})
		},
	},
})
View Source
var ItemSetFlameWakersBattleGear = core.NewItemSet(core.ItemSet{
	Name: "Flamewaker's Battlegear",
	Bonuses: map[int32]core.ApplyEffect{
		2: func(agent core.Agent) {
			hunter := agent.(HunterAgent).GetHunter()
			var flamingArrowSpell = hunter.RegisterSpell(core.SpellConfig{
				ActionID:    core.ActionID{SpellID: 99058},
				SpellSchool: core.SpellSchoolFire,
				ProcMask:    core.ProcMaskEmpty,
				Flags:       core.SpellFlagNoOnCastComplete,

				DamageMultiplier: 0.8,
				CritMultiplier:   hunter.CritMultiplier(false, false, false),
				ThreatMultiplier: 1,

				BonusCoefficient: 1,

				ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
					baseDamage := spell.Unit.RangedWeaponDamage(sim, spell.RangedAttackPower(target))
					spell.CalcAndDealDamage(sim, target, baseDamage, spell.OutcomeRangedHitAndCrit)
				},
			})
			hunter.RegisterAura(core.Aura{
				Label:    "T12 2-set",
				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 != hunter.SteadyShot && spell != hunter.CobraShot {
						return
					}
					procChance := 0.1
					if sim.RandomFloat("Flaming Arrow") < procChance {
						flamingArrowSpell.Cast(sim, result.Target)
					}
				},
			})
		},
		4: func(agent core.Agent) {
			hunter := agent.(HunterAgent).GetHunter()
			var baMod = hunter.AddDynamicMod(core.SpellModConfig{
				Kind:       core.SpellMod_PowerCost_Pct,
				ClassMask:  HunterSpellsAll,
				FloatValue: -1,
			})
			var burningAdrenaline = hunter.RegisterAura(core.Aura{
				Label:    "Burning Adrenaline",
				Duration: time.Second * 15,

				ActionID: core.ActionID{SpellID: 99060},
				OnGain: func(aura *core.Aura, sim *core.Simulation) {
					baMod.Activate()
				},
				OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
					if spell.ClassSpellMask != HunterSpellsAll {
						return
					}
					baMod.Deactivate()
					aura.Deactivate(sim)
				},
				OnExpire: func(aura *core.Aura, sim *core.Simulation) {
					baMod.Deactivate()
				},
			})
			hunter.RegisterAura(core.Aura{
				Label:    "T12 4-set",
				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 != hunter.AutoAttacks.RangedAuto() {
						return
					}
					procChance := 0.1
					if sim.RandomFloat("Burning Adrenaline") < procChance {
						burningAdrenaline.Activate(sim)
					}
				},
			})
		},
	},
})
View Source
var ItemSetGladiatorsPursuit = core.NewItemSet(core.ItemSet{
	ID:   920,
	Name: "Gladiator's Pursuit",
	Bonuses: map[int32]core.ApplyEffect{
		2: func(agent core.Agent) {
			hunter := agent.(HunterAgent).GetHunter()
			hunter.AddStats(stats.Stats{
				stats.Agility: 70,
			})
		},
		4: func(agent core.Agent) {
			hunter := agent.(HunterAgent).GetHunter()

			hunter.AddStats(stats.Stats{
				stats.Agility: 90,
			})
		},
	},
})
View Source
var ItemSetLightningChargedBattleGear = core.NewItemSet(core.ItemSet{
	Name: "Lightning-Charged Battlegear",
	Bonuses: map[int32]core.ApplyEffect{
		2: func(agent core.Agent) {

			agent.GetCharacter().AddStaticMod(core.SpellModConfig{
				Kind:       core.SpellMod_BonusCrit_Rating,
				ClassMask:  HunterSpellSerpentSting,
				FloatValue: 5 * core.CritRatingPerCritChance,
			})
		},
		4: func(agent core.Agent) {

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

		},
		4: func(agent core.Agent) {
			hunter := agent.(HunterAgent).GetHunter()
			var chronoHunter = hunter.RegisterAura(core.Aura{
				Label:    "Chronohunter",
				Duration: time.Second * 15,
				ActionID: core.ActionID{SpellID: 105919},
				Icd: &core.Cooldown{
					Duration: time.Second * 113,
					Timer:    hunter.NewTimer(),
				},
				OnReset: func(aura *core.Aura, sim *core.Simulation) {
					aura.Activate(sim)
				},
				OnGain: func(aura *core.Aura, sim *core.Simulation) {
					aura.Unit.MultiplyRangedSpeed(sim, 1.3)
				},
				OnExpire: func(aura *core.Aura, sim *core.Simulation) {
					aura.Unit.MultiplyRangedSpeed(sim, 1/1.3)
				},
			})
			hunter.RegisterAura(core.Aura{
				Label:    "T12 4-set",
				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 != hunter.ArcaneShot {
						return
					}
					procChance := 0.4
					if sim.RandomFloat("Chronohunter") < procChance {
						chronoHunter.Activate(sim)
					}
				},
			})
		},
	},
})
View Source
var PetConfigs = map[proto.HunterOptions_PetType]PetConfig{
	proto.HunterOptions_Bat: {
		Name:      "Bat",
		FocusDump: Claw,
	},
	proto.HunterOptions_Bear: {
		Name:           "Bear",
		FocusDump:      Claw,
		SpecialAbility: DemoralizingScreech,
	},
	proto.HunterOptions_BirdOfPrey: {
		Name:           "Bird of Prey",
		FocusDump:      Claw,
		SpecialAbility: DemoralizingScreech,
	},
	proto.HunterOptions_Boar: {
		Name:           "Boar",
		FocusDump:      Bite,
		SpecialAbility: Stampede,
	},
	proto.HunterOptions_CarrionBird: {
		Name:      "Carrion Bird",
		FocusDump: Bite,
	},
	proto.HunterOptions_Cat: {
		Name:      "Cat",
		FocusDump: Claw,
	},
	proto.HunterOptions_Chimaera: {
		Name:          "Chimaera",
		FocusDump:     Bite,
		ExoticAbility: FrostStormBreath,
	},
	proto.HunterOptions_CoreHound: {
		Name:      "Core Hound",
		FocusDump: Bite,
	},
	proto.HunterOptions_Crab: {
		Name:      "Crab",
		FocusDump: Claw,
	},
	proto.HunterOptions_Crocolisk: {
		Name: "Crocolisk",

		FocusDump: Bite,
	},
	proto.HunterOptions_Devilsaur: {
		Name:      "Devilsaur",
		FocusDump: Bite,
	},
	proto.HunterOptions_Fox: {
		Name:      "Fox",
		FocusDump: Claw,
	},
	proto.HunterOptions_ShaleSpider: {
		Name:      "Shale Spider",
		FocusDump: Bite,
	},
	proto.HunterOptions_Dragonhawk: {
		Name:           "Dragonhawk",
		FocusDump:      Bite,
		SpecialAbility: FireBreath,
	},
	proto.HunterOptions_Gorilla: {
		Name: "Gorilla",

		FocusDump: Smack,
	},
	proto.HunterOptions_Hyena: {
		Name:           "Hyena",
		SpecialAbility: Stampede,
		FocusDump:      Bite,
	},
	proto.HunterOptions_Moth: {
		Name:      "Moth",
		FocusDump: Smack,
	},
	proto.HunterOptions_NetherRay: {
		Name:      "Nether Ray",
		FocusDump: Bite,
	},
	proto.HunterOptions_Raptor: {
		Name:           "Raptor",
		FocusDump:      Claw,
		SpecialAbility: CorrosiveSpit,
	},
	proto.HunterOptions_Ravager: {
		Name:           "Ravager",
		FocusDump:      Bite,
		SpecialAbility: AcidSpit,
	},
	proto.HunterOptions_Rhino: {
		Name:           "Rhino",
		FocusDump:      Bite,
		SpecialAbility: Stampede,
	},
	proto.HunterOptions_Scorpid: {
		Name:      "Scorpid",
		FocusDump: Bite,
	},
	proto.HunterOptions_Serpent: {
		Name:           "Serpent",
		FocusDump:      Bite,
		SpecialAbility: CorrosiveSpit,
	},
	proto.HunterOptions_Silithid: {
		Name:      "Silithid",
		FocusDump: Claw,
	},
	proto.HunterOptions_Spider: {
		Name: "Spider",

		FocusDump: Bite,
	},
	proto.HunterOptions_SpiritBeast: {
		Name:      "Spirit Beast",
		FocusDump: Claw,
	},
	proto.HunterOptions_SporeBat: {
		Name:      "Spore Bat",
		FocusDump: Smack,
	},
	proto.HunterOptions_Tallstrider: {
		Name: "Tallstrider",

		FocusDump: Claw,
	},
	proto.HunterOptions_Turtle: {
		Name: "Turtle",

		FocusDump: Bite,
	},
	proto.HunterOptions_WarpStalker: {
		Name: "Warp Stalker",

		FocusDump: Bite,
	},
	proto.HunterOptions_Wasp: {
		Name:      "Wasp",
		FocusDump: Smack,
	},
	proto.HunterOptions_WindSerpent: {
		Name:           "Wind Serpent",
		FocusDump:      Bite,
		SpecialAbility: FireBreath,
	},
	proto.HunterOptions_Wolf: {
		Name:      "Wolf",
		FocusDump: Bite,
	},
	proto.HunterOptions_Worm: {
		Name:           "Worm",
		FocusDump:      Bite,
		SpecialAbility: AcidSpit,
	},
}
View Source
var TalentTreeSizes = [3]int{19, 19, 20}

Functions

This section is empty.

Types

type Hunter

type Hunter struct {
	core.Character

	ClassSpellScaling float64

	Talents             *proto.HunterTalents
	Options             *proto.HunterOptions
	BeastMasteryOptions *proto.BeastMasteryHunter_Options
	MarksmanshipOptions *proto.MarksmanshipHunter_Options
	SurvivalOptions     *proto.SurvivalHunter_Options

	Pet *HunterPet

	AspectOfTheHawk *core.Spell
	AspectOfTheFox  *core.Spell

	FireTrapTimer *core.Timer

	// Hunter spells
	KillCommand   *core.Spell
	ArcaneShot    *core.Spell
	ExplosiveTrap *core.Spell
	KillShot      *core.Spell
	RapidFire     *core.Spell
	MultiShot     *core.Spell
	RaptorStrike  *core.Spell
	SerpentSting  *core.Spell
	SteadyShot    *core.Spell
	ScorpidSting  *core.Spell
	SilencingShot *core.Spell
	TrapLauncher  *core.Spell

	// MM only spells
	AimedShot   *core.Spell
	ChimeraShot *core.Spell

	// Survival only spells
	ExplosiveShot *core.Spell
	BlackArrow    *core.Spell
	CobraShot     *core.Spell

	// Fake spells to encapsulate weaving logic.
	TrapWeaveSpell                *core.Spell
	ImprovedSerpentSting          *core.Spell
	AspectOfTheHawkAura           *core.Aura
	AspectOfTheFoxAura            *core.Aura
	ImprovedSteadyShotAura        *core.Aura
	ImprovedSteadyShotAuraCounter *core.Aura
	LockAndLoadAura               *core.Aura
	RapidFireAura                 *core.Aura
	ScorpidStingAuras             core.AuraArray
	KillingStreakCounterAura      *core.Aura
	KillingStreakAura             *core.Aura
	MasterMarksmanAura            *core.Aura
	MasterMarksmanCounterAura     *core.Aura
	TrapLauncherAura              *core.Aura
	// contains filtered or unexported fields
}

func NewHunter

func NewHunter(character *core.Character, options *proto.Player, hunterOptions *proto.HunterOptions) *Hunter

func (*Hunter) AddPartyBuffs

func (hunter *Hunter) AddPartyBuffs(_ *proto.PartyBuffs)

func (*Hunter) AddRaidBuffs

func (hunter *Hunter) AddRaidBuffs(raidBuffs *proto.RaidBuffs)

func (*Hunter) AddStatDependencies

func (hunter *Hunter) AddStatDependencies()

func (*Hunter) ApplyBMTalents

func (hunter *Hunter) ApplyBMTalents()

func (*Hunter) ApplyGlyphs

func (hunter *Hunter) ApplyGlyphs()

func (*Hunter) ApplyMMTalents

func (hunter *Hunter) ApplyMMTalents()

func (*Hunter) ApplySurvivalTalents

func (hunter *Hunter) ApplySurvivalTalents()

func (*Hunter) ApplyTalents

func (hunter *Hunter) ApplyTalents()

func (*Hunter) CalculateMasteryPoints

func (hunter *Hunter) CalculateMasteryPoints() float64

func (*Hunter) CritMultiplier

func (hunter *Hunter) CritMultiplier(isRanged bool, isMFDSpell bool, doubleDipMS bool) float64

func (*Hunter) GetCharacter

func (hunter *Hunter) GetCharacter() *core.Character

func (*Hunter) GetHunter

func (hunter *Hunter) GetHunter() *Hunter

func (*Hunter) HasMajorGlyph

func (hunter *Hunter) HasMajorGlyph(glyph proto.HunterMajorGlyph) bool

func (*Hunter) HasMinorGlyph

func (hunter *Hunter) HasMinorGlyph(glyph proto.HunterMinorGlyph) bool

func (*Hunter) HasPrimeGlyph

func (hunter *Hunter) HasPrimeGlyph(glyph proto.HunterPrimeGlyph) bool

func (*Hunter) Initialize

func (hunter *Hunter) Initialize()

func (*Hunter) NewHunterPet

func (hunter *Hunter) NewHunterPet() *HunterPet

func (*Hunter) RegisterSpells

func (hunter *Hunter) RegisterSpells()

func (*Hunter) Reset

func (hunter *Hunter) Reset(_ *core.Simulation)

func (*Hunter) TryRaptorStrike

func (hunter *Hunter) TryRaptorStrike(_ *core.Simulation, mhSwingSpell *core.Spell) *core.Spell

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

type HunterAgent

type HunterAgent interface {
	GetHunter() *Hunter
}

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

type HunterPet

type HunterPet struct {
	core.Pet

	CobraStrikesAura     *core.Aura
	KillCommandAura      *core.Aura
	FrenzyStacksSnapshot float64
	FrenzyAura           *core.Aura
	// contains filtered or unexported fields
}

func (*HunterPet) ApplyTalents

func (hp *HunterPet) ApplyTalents()

func (*HunterPet) ExecuteCustomRotation

func (hp *HunterPet) ExecuteCustomRotation(sim *core.Simulation)

func (*HunterPet) GetPet

func (hp *HunterPet) GetPet() *core.Pet

func (*HunterPet) Initialize

func (hp *HunterPet) Initialize()

func (*HunterPet) NewPetAbility

func (hp *HunterPet) NewPetAbility(abilityType PetAbilityType, isPrimary bool) *core.Spell

func (*HunterPet) Reset

func (hp *HunterPet) Reset(_ *core.Simulation)

func (*HunterPet) Talents

func (hp *HunterPet) Talents() *proto.HunterPetTalents

type PetAbilityType

type PetAbilityType int
const (
	Unknown PetAbilityType = iota
	AcidSpit
	Bite
	Claw
	DemoralizingScreech
	FireBreath
	Smack
	Stampede
	CorrosiveSpit
	TailSpin
	FrostStormBreath
)

type PetConfig

type PetConfig struct {
	Name string

	SpecialAbility PetAbilityType
	FocusDump      PetAbilityType
	ExoticAbility  PetAbilityType

	// Randomly select between abilities instead of using a prio.
	RandomSelection bool
}

type PetDebuffSpellConfig

type PetDebuffSpellConfig struct {
	DebuffAura func(*core.Unit) *core.Aura
	SpellID    int32
	School     core.SpellSchool
	GCD        time.Duration
	CD         time.Duration

	OnSpellHitDealt func(*core.Simulation, *core.Spell, *core.SpellResult)
}

type PetSpecialAbilityConfig

type PetSpecialAbilityConfig struct {
	Type    PetAbilityType
	SpellID int32
	School  core.SpellSchool
	GCD     time.Duration
	CD      time.Duration

	OnSpellHitDealt func(*core.Simulation, *core.Spell, *core.SpellResult)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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