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 warrior #39

Merged
merged 12 commits into from
Dec 23, 2024
2 changes: 1 addition & 1 deletion sim/common/vanilla/item_sets/dungeon_set_1.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ var ItemSetBattlegearOfValor = core.NewItemSet(core.ItemSet{
ProcMask: core.ProcMaskMelee,
PPM: 1,
Handler: func(sim *core.Simulation, spell *core.Spell, _ *core.SpellResult) {
c.GainHealth(sim, sim.Roll(88, 132), healthMetrics)
c.GainHealth(sim, sim.Roll(88, 133), healthMetrics)
},
})
},
Expand Down
10 changes: 5 additions & 5 deletions sim/core/buffs.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ func applyBuffEffects(agent Agent, playerFaction proto.Faction, raidBuffs *proto
}

if raidBuffs.BattleShout != proto.TristateEffect_TristateEffectMissing {
MakePermanent(BattleShoutAura(&character.Unit, GetTristateValueInt32(raidBuffs.BattleShout, 0, 5), 0))
MakePermanent(BattleShoutAura(&character.Unit, GetTristateValueInt32(raidBuffs.BattleShout, 0, 5), 0, false)) // Do we implement 3pc wrath for the other sims?
}

if individualBuffs.BlessingOfMight != proto.TristateEffect_TristateEffectMissing && isAlliance {
Expand Down Expand Up @@ -1398,24 +1398,24 @@ var BattleShoutSpellId = [BattleShoutRanks + 1]int32{0, 6673, 5242, 6192, 11549,
var BattleShoutBaseAP = [BattleShoutRanks + 1]float64{0, 20, 40, 57, 93, 138, 193, 232}
var BattleShoutLevel = [BattleShoutRanks + 1]int{0, 1, 12, 22, 32, 42, 52, 60}

func BattleShoutAura(unit *Unit, impBattleShout int32, boomingVoicePts int32) *Aura {
func BattleShoutAura(unit *Unit, impBattleShout int32, boomingVoicePts int32, has3pcWrath bool) *Aura {
rank := TernaryInt32(IncludeAQ, 7, 6)
spellId := BattleShoutSpellId[rank]
baseAP := BattleShoutBaseAP[rank]

return unit.GetOrRegisterAura(Aura{
Label: "Battle Shout",
ActionID: ActionID{SpellID: spellId},
Duration: time.Duration(float64(time.Minute*2) * (1 + 0.1*float64(boomingVoicePts))),
BuildPhase: CharacterBuildPhaseBuffs,
OnGain: func(aura *Aura, sim *Simulation) {
aura.Unit.AddStatsDynamic(sim, stats.Stats{
stats.AttackPower: math.Floor(baseAP * (1 + 0.05*float64(impBattleShout))),
stats.AttackPower: math.Floor(baseAP * (1 + 0.05*float64(impBattleShout)) + TernaryFloat64(has3pcWrath, 30, 0)),
})
},
OnExpire: func(aura *Aura, sim *Simulation) {
aura.Unit.AddStatsDynamic(sim, stats.Stats{
stats.AttackPower: -1 * math.Floor(baseAP*(1+0.05*float64(impBattleShout))),
stats.AttackPower: -1 * math.Floor(baseAP*(1+0.05*float64(impBattleShout)) + TernaryFloat64(has3pcWrath, 30, 0)),
})
},
})
Expand Down
10 changes: 5 additions & 5 deletions sim/warrior/deep_wounds.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,14 @@ func (warrior *Warrior) applyDeepWounds() {
TickLength: time.Second * 3,

OnTick: func(sim *core.Simulation, target *core.Unit, dot *core.Dot) {
attackTable := warrior.AttackTables[target.UnitIndex][proto.CastType_CastTypeMainHand]
dot.SnapshotAttackerMultiplier = dot.Spell.AttackerDamageMultiplier(attackTable) // Double dips on attackers mods
dot.CalcAndDealPeriodicSnapshotDamage(sim, target, dot.OutcomeTick)
},
},

ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
spell.Dot(target).ApplyOrRefresh(sim)
spell.Dot(target).Apply(sim) //Resets the tick counter with Apply vs ApplyorRefresh
spell.CalcAndDealOutcome(sim, target, spell.OutcomeAlwaysHitNoHitCounter)
},
})
Expand All @@ -69,8 +71,6 @@ func (warrior *Warrior) applyDeepWounds() {
func (warrior *Warrior) procDeepWounds(sim *core.Simulation, target *core.Unit, isOh bool) {
dot := warrior.DeepWounds.Dot(target)

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

var awd float64
if isOh {
attackTableOh := warrior.AttackTables[target.UnitIndex][proto.CastType_CastTypeOffHand]
Expand All @@ -82,9 +82,9 @@ func (warrior *Warrior) procDeepWounds(sim *core.Simulation, target *core.Unit,
awd = warrior.AutoAttacks.MH().CalculateAverageWeaponDamage(dot.Spell.MeleeAttackPower()) * adm
}

newDamage := awd * 0.2 * float64(warrior.Talents.DeepWounds)
newDamage := awd * 0.2 * float64(warrior.Talents.DeepWounds) // 60% of average attackers damage

dot.SnapshotBaseDamage = (outstandingDamage + newDamage) / float64(dot.NumberOfTicks)
dot.SnapshotBaseDamage = newDamage / 4.0 // spread over 4 ticks of the dot
dot.SnapshotAttackerMultiplier = 1

warrior.DeepWounds.Cast(sim, target)
Expand Down
106 changes: 74 additions & 32 deletions sim/warrior/dps_warrior/TestP1DPSWarrior.results
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ character_stats_results: {
stat_weights_results: {
key: "TestP1DPSWarrior-Phase1-StatWeights-Default"
value: {
weights: 0.44532
weights: 0.13025
weights: 0.38423
weights: 0.08848
weights: 0
weights: 0
weights: 0
Expand All @@ -67,9 +67,9 @@ stat_weights_results: {
weights: 0
weights: 0
weights: 0
weights: 0.39162
weights: 0.31173
weights: 0
weights: 2.74696
weights: 1.91476
weights: 0
weights: 0
weights: 0
Expand All @@ -96,101 +96,143 @@ stat_weights_results: {
weights: 0
}
}
dps_results: {
key: "TestP1DPSWarrior-Phase1-AllItems-BattlegearofHeroism"
value: {
dps: 237.73911
tps: 231.66781
}
}
dps_results: {
key: "TestP1DPSWarrior-Phase1-AllItems-BattlegearofMight"
value: {
dps: 222.95766
tps: 218.52321
}
}
dps_results: {
key: "TestP1DPSWarrior-Phase1-AllItems-BattlegearofWrath"
value: {
dps: 219.245
tps: 216.30574
}
}
dps_results: {
key: "TestP1DPSWarrior-Phase1-AllItems-Conqueror'sBattlegear"
value: {
dps: 244.90003
tps: 237.86693
}
}
dps_results: {
key: "TestP1DPSWarrior-Phase1-AllItems-Dreadnaught'sBattlegear"
value: {
dps: 228.08017
tps: 223.44701
}
}
dps_results: {
key: "TestP1DPSWarrior-Phase1-AllItems-Vindicator'sBattlegear"
value: {
dps: 236.32283
tps: 231.13999
}
}
dps_results: {
key: "TestP1DPSWarrior-Phase1-Average-Default"
value: {
dps: 251.86628
tps: 220.05239
dps: 225.0288
tps: 220.3409
}
}
dps_results: {
key: "TestP1DPSWarrior-Phase1-Settings-Human-p0.bis-DPS-p1-FullBuffs-P1-Consumes-LongMultiTarget"
value: {
dps: 35.95075
tps: 121.17562
dps: 33.71639
tps: 123.6996
}
}
dps_results: {
key: "TestP1DPSWarrior-Phase1-Settings-Human-p0.bis-DPS-p1-FullBuffs-P1-Consumes-LongSingleTarget"
value: {
dps: 32.91426
tps: 33.524
dps: 30.6799
tps: 36.04798
}
}
dps_results: {
key: "TestP1DPSWarrior-Phase1-Settings-Human-p0.bis-DPS-p1-FullBuffs-P1-Consumes-ShortSingleTarget"
value: {
dps: 88.77662
tps: 81.49139
dps: 78.71826
tps: 81.12737
}
}
dps_results: {
key: "TestP1DPSWarrior-Phase1-Settings-Human-p0.bis-DPS-p1-NoBuffs-P1-Consumes-LongMultiTarget"
value: {
dps: 17.18813
tps: 106.16552
dps: 16.31096
tps: 109.77525
}
}
dps_results: {
key: "TestP1DPSWarrior-Phase1-Settings-Human-p0.bis-DPS-p1-NoBuffs-P1-Consumes-LongSingleTarget"
value: {
dps: 14.89313
tps: 19.1071
dps: 14.01596
tps: 22.71683
}
}
dps_results: {
key: "TestP1DPSWarrior-Phase1-Settings-Human-p0.bis-DPS-p1-NoBuffs-P1-Consumes-ShortSingleTarget"
value: {
dps: 42.96501
tps: 44.8421
dps: 38.74616
tps: 49.14968
}
}
dps_results: {
key: "TestP1DPSWarrior-Phase1-Settings-Orc-p0.bis-DPS-p1-FullBuffs-P1-Consumes-LongMultiTarget"
value: {
dps: 37.75094
tps: 122.61577
dps: 35.24971
tps: 124.92625
}
}
dps_results: {
key: "TestP1DPSWarrior-Phase1-Settings-Orc-p0.bis-DPS-p1-FullBuffs-P1-Consumes-LongSingleTarget"
value: {
dps: 34.71445
tps: 34.96415
dps: 32.21322
tps: 37.27463
}
}
dps_results: {
key: "TestP1DPSWarrior-Phase1-Settings-Orc-p0.bis-DPS-p1-FullBuffs-P1-Consumes-ShortSingleTarget"
value: {
dps: 91.92593
tps: 84.01084
dps: 81.08886
tps: 83.02385
}
}
dps_results: {
key: "TestP1DPSWarrior-Phase1-Settings-Orc-p0.bis-DPS-p1-NoBuffs-P1-Consumes-LongMultiTarget"
value: {
dps: 18.37064
tps: 107.11153
dps: 17.31727
tps: 110.5803
}
}
dps_results: {
key: "TestP1DPSWarrior-Phase1-Settings-Orc-p0.bis-DPS-p1-NoBuffs-P1-Consumes-LongSingleTarget"
value: {
dps: 16.07564
tps: 20.0531
dps: 15.02227
tps: 23.52187
}
}
dps_results: {
key: "TestP1DPSWarrior-Phase1-Settings-Orc-p0.bis-DPS-p1-NoBuffs-P1-Consumes-ShortSingleTarget"
value: {
dps: 46.51015
tps: 47.67821
dps: 41.44703
tps: 51.31038
}
}
dps_results: {
key: "TestP1DPSWarrior-Phase1-SwitchInFrontOfTarget-Default"
value: {
dps: 198.04954
tps: 174.84326
dps: 180.2038
tps: 179.18853
}
}
27 changes: 4 additions & 23 deletions sim/warrior/execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,13 @@ package warrior

import (
"github.com/wowsims/classic/sim/core"
"github.com/wowsims/classic/sim/core/proto"
)

func (warrior *Warrior) registerExecuteSpell() {
hasSuddenDeathRune := warrior.HasRune(proto.WarriorRune_RuneSuddenDeath)

flatDamage := map[int32]float64{
25: 125,
40: 325,
50: 450,
60: 600,
}[warrior.Level]

convertedRageDamage := map[int32]float64{
25: 3,
40: 9,
50: 12,
60: 15,
}[warrior.Level]

spellID := map[int32]int32{
25: 5308,
40: 20660,
50: 20661,
60: 20662,
}[warrior.Level]
flatDamage := 600.0
convertedRageDamage := 15.0
spellID := int32(20662)

var rageMetrics *core.ResourceMetrics
warrior.Execute = warrior.RegisterSpell(BattleStance|BerserkerStance, core.SpellConfig{
Expand All @@ -48,7 +29,7 @@ func (warrior *Warrior) registerExecuteSpell() {
},
},
ExtraCastCondition: func(sim *core.Simulation, target *core.Unit) bool {
return sim.IsExecutePhase20() || (hasSuddenDeathRune && warrior.SuddenDeathAura.IsActive())
return sim.IsExecutePhase20()
},

CritDamageBonus: warrior.impale(),
Expand Down
23 changes: 3 additions & 20 deletions sim/warrior/hamstring.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,9 @@ import (
)

func (warrior *Warrior) registerHamstringSpell() {
damage := map[int32]float64{
25: 5,
40: 18,
50: 18,
60: 45,
}[warrior.Level]

spellID := map[int32]int32{
25: 1715,
40: 7372,
50: 7372,
60: 27584,
}[warrior.Level]

spell_level := map[int32]int32{
25: 8,
40: 32,
50: 32,
60: 54,
}[warrior.Level]
damage := 45.0
spellID := int32(27584)
spell_level := 54.0

warrior.Hamstring = warrior.RegisterSpell(BattleStance|BerserkerStance, core.SpellConfig{
ActionID: core.ActionID{SpellID: spellID},
Expand Down
Loading
Loading