Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First pass at hunter #60

Merged
merged 6 commits into from
Jan 1, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 13 additions & 62 deletions proto/hunter.proto
Original file line number Diff line number Diff line change
Expand Up @@ -57,51 +57,6 @@ message HunterTalents {
bool wyvern_sting = 46;
}

message HunterPetTalents {
// Cunning
int32 cobra_reflexes = 1;
bool dive = 2;
int32 great_stamina = 3;
int32 natural_armor = 4;
bool boars_speed = 5;
int32 mobility = 6;
int32 owls_focus = 7;
int32 spiked_collar = 8;
int32 culling_the_herd = 9;
int32 lionhearted = 10;
bool carrion_feeder = 11;
int32 great_resistance = 12;
int32 cornered = 13;
int32 feeding_frenzy = 14;
bool wolverine_bite = 15;
bool roar_of_recovery = 16;
bool bullheaded = 17;
int32 grace_of_the_mantis = 18;
int32 wild_hunt = 19;
bool roar_of_sacrifice = 20;

// Ferocity
int32 improved_cower = 21;
int32 bloodthirsty = 22;
bool heart_of_the_pheonix = 23;
int32 spiders_bite = 24;
bool rabid = 25;
bool lick_your_wounds = 26;
bool call_of_the_wild = 27;
int32 shark_attack = 28;

// Tenacity
bool charge = 29;
int32 blood_of_the_rhino = 30;
int32 pet_barding = 31;
int32 guard_dog = 32;
bool thunderstomp = 33;
bool last_stand = 34;
bool taunt = 35;
bool intervene = 36;
int32 silverback = 37;
}

message Hunter {
message Rotation {
enum RotationType {
Expand Down Expand Up @@ -165,16 +120,15 @@ message Hunter {
Owl = 6;
Boar = 7;
CarrionBird = 8;
CoreHound = 10;
Crab = 11;
Crocolisk = 12;
Gorilla = 15;
Hyena = 16;
Raptor = 17;
Scorpid = 18;
Spider = 21;
Tallstrider = 24;
Turtle = 25;
Crab = 9;
Crocolisk = 10;
Gorilla = 11;
Hyena = 12;
Raptor = 13;
Scorpid = 14;
Spider = 15;
Tallstrider = 16;
Turtle = 17;
}

enum PetAttackSpeed {
Expand All @@ -191,16 +145,13 @@ message Hunter {
}

PetType pet_type = 3;
HunterPetTalents pet_talents = 4;
double pet_uptime = 5;

double sniper_training_uptime = 6;
double pet_uptime = 4;

double pet_attack_speed_old = 7;
double pet_attack_speed_old = 5;

bool new_raptor_strike = 8;
bool new_raptor_strike = 6;

PetAttackSpeed pet_attack_speed = 9;
PetAttackSpeed pet_attack_speed = 7;
}
Options options = 2;
}
8 changes: 8 additions & 0 deletions sim/core/attack.go
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,14 @@ func (aa *AutoAttacks) StopMeleeUntil(sim *Simulation, readyAt time.Duration, de
}
}

func (aa *AutoAttacks) StopRangedUntil(sim *Simulation, readyAt time.Duration) {
if !aa.AutoSwingRanged { // if not auto swinging, don't auto restart.
return
}
aa.ranged.swingAt = readyAt + aa.ranged.curSwingDuration
sim.rescheduleWeaponAttack(aa.ranged.swingAt)
}
kayla-glick marked this conversation as resolved.
Show resolved Hide resolved

// Delays all swing timers for the specified amount. Only used by Slam.
func (aa *AutoAttacks) DelayMeleeBy(sim *Simulation, delay time.Duration) {
if delay <= 0 {
Expand Down
4 changes: 2 additions & 2 deletions sim/hunter/_item_sets_pvp.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

///////////////////////////////////////////////////////////////////////////
sanguinerarogue marked this conversation as resolved.
Show resolved Hide resolved
// SoD Phase 3 Item Sets
// Classic Phase 2
///////////////////////////////////////////////////////////////////////////

var ItemSetBloodGuardsChain = core.NewItemSet(core.ItemSet{
Expand Down Expand Up @@ -40,7 +40,7 @@ var ItemSetKnightLieutenantsChain = core.NewItemSet(core.ItemSet{
})

///////////////////////////////////////////////////////////////////////////
// SoD Phase 4 Item Sets
// Classic Phase 3
///////////////////////////////////////////////////////////////////////////

var ItemSetChampionsPursuit = core.NewItemSet(core.ItemSet{
Expand Down
4 changes: 3 additions & 1 deletion sim/hunter/aimed_shot.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ func (hunter *Hunter) getAimedShotConfig(rank int, timer *core.Timer) core.Spell
Timer: timer,
Duration: time.Second * 6,
},
ModifyCast: func(_ *core.Simulation, spell *core.Spell, cast *core.Cast) {
ModifyCast: func(sim *core.Simulation, spell *core.Spell, cast *core.Cast) {
cast.CastTime = spell.CastTime()
hunter.Unit.AutoAttacks.CancelAutoSwing(sim)
},
IgnoreHaste: true, // Hunter GCD is locked at 1.5s
CastTime: func(spell *core.Spell) time.Duration {
Expand All @@ -61,6 +62,7 @@ func (hunter *Hunter) getAimedShotConfig(rank int, timer *core.Timer) core.Spell
baseDamage

result := spell.CalcDamage(sim, target, baseDamage, spell.OutcomeRangedHitAndCrit)
hunter.Unit.AutoAttacks.EnableAutoSwing(sim)
spell.WaitTravelTime(sim, func(s *core.Simulation) {
spell.DealDamage(sim, result)
})
Expand Down
65 changes: 1 addition & 64 deletions sim/hunter/aspects.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,67 +120,4 @@ func (hunter *Hunter) registerAspectOfTheHawkSpell() {
maxRank := hunter.getMaxHawkRank()
config := hunter.getAspectOfTheHawkSpellConfig(maxRank)
hunter.GetOrRegisterSpell(config)
}

func (hunter *Hunter) registerAspectOfTheViperSpell() {
sanguinerarogue marked this conversation as resolved.
Show resolved Hide resolved
actionID := core.ActionID{SpellID: 415423}
manaMetrics := hunter.NewManaMetrics(actionID)

var manaPA *core.PendingAction

baseManaRegenMultiplier := 0.02

aspectOfTheViperAura := hunter.GetOrRegisterAura(core.Aura{
Label: "Aspect of the Viper",
ActionID: actionID,
Duration: core.NeverExpires,

OnGain: func(aura *core.Aura, sim *core.Simulation) {
hunter.PseudoStats.DamageDealtMultiplier *= 0.9

manaPA = core.StartPeriodicAction(sim, core.PeriodicActionOptions{
Period: time.Second * 3,
OnAction: func(s *core.Simulation) {
hunter.AddMana(sim, hunter.MaxMana()*0.1, manaMetrics)
},
})
},
OnExpire: func(aura *core.Aura, sim *core.Simulation) {
hunter.PseudoStats.DamageDealtMultiplier /= 0.9
manaPA.Cancel(sim)
},

OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
if spell == hunter.AutoAttacks.RangedAuto() {
manaPerRangedHitMultiplier := baseManaRegenMultiplier * hunter.AutoAttacks.Ranged().SwingSpeed
hunter.AddMana(sim, hunter.MaxMana()*manaPerRangedHitMultiplier, manaMetrics)
} else if spell == hunter.AutoAttacks.MHAuto() {
manaPerMHHitMultiplier := baseManaRegenMultiplier * hunter.AutoAttacks.MH().SwingSpeed
hunter.AddMana(sim, hunter.MaxMana()*manaPerMHHitMultiplier, manaMetrics)
} else if spell == hunter.AutoAttacks.OHAuto() {
manaPerOHHitMultiplier := baseManaRegenMultiplier * hunter.AutoAttacks.OH().SwingSpeed
hunter.AddMana(sim, hunter.MaxMana()*manaPerOHHitMultiplier, manaMetrics)
}
},
})

aspectOfTheViperAura.NewExclusiveEffect("Aspect", true, core.ExclusiveEffect{})

hunter.GetOrRegisterSpell(core.SpellConfig{
ActionID: actionID,
Flags: core.SpellFlagAPL,

Cast: core.CastConfig{
DefaultCast: core.Cast{
GCD: core.GCDDefault,
},
},
ExtraCastCondition: func(sim *core.Simulation, target *core.Unit) bool {
return !aspectOfTheViperAura.IsActive()
},

ApplyEffects: func(sim *core.Simulation, _ *core.Unit, _ *core.Spell) {
aspectOfTheViperAura.Activate(sim)
},
})
}
}
10 changes: 0 additions & 10 deletions sim/hunter/hunter.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ const (
SpellCode_HunterPetClaw
SpellCode_HunterPetBite
SpellCode_HunterPetLightningBreath
SpellCode_HunterPetLavaBreath
SpellCode_HunterPetScreech
SpellCode_HunterPetScorpidPoison
)
Expand Down Expand Up @@ -134,13 +133,6 @@ func (hunter *Hunter) AddRaidBuffs(raidBuffs *proto.RaidBuffs) {
}[hunter.Level])
}

// Hunter gains an additional 10% stats from Aspect of the Lion
statMultiply := 1.1
hunter.MultiplyStat(stats.Strength, statMultiply)
hunter.MultiplyStat(stats.Stamina, statMultiply)
hunter.MultiplyStat(stats.Agility, statMultiply)
hunter.MultiplyStat(stats.Intellect, statMultiply)
hunter.MultiplyStat(stats.Spirit, statMultiply)
}
func (hunter *Hunter) AddPartyBuffs(_ *proto.PartyBuffs) {
}
Expand All @@ -163,7 +155,6 @@ func (hunter *Hunter) Initialize() {
})

hunter.registerAspectOfTheHawkSpell()
hunter.registerAspectOfTheViperSpell()

multiShotTimer := hunter.NewTimer()
arcaneShotTimer := hunter.NewTimer()
Expand All @@ -185,7 +176,6 @@ func (hunter *Hunter) Initialize() {
hunter.registerImmolationTrapSpell(traps)
hunter.registerFreezingTrapSpell(traps)

// hunter.registerKillCommand()
hunter.registerRapidFire()
}

Expand Down
Loading