Skip to content

Commit

Permalink
fix cinderglacier logic
Browse files Browse the repository at this point in the history
  • Loading branch information
lime-green committed Apr 9, 2023
1 parent e9aaeee commit 513d2e1
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 7 deletions.
6 changes: 6 additions & 0 deletions sim/deathknight/blood_boil.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,18 @@ func (dk *Deathknight) registerBloodBoilSpell() {
ThreatMultiplier: 1.0,

ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
dk.AoESpellNumTargetsHit = 0

for _, aoeTarget := range sim.Encounter.TargetUnits {
baseDamage := (sim.Roll(180, 220) + 0.06*dk.getImpurityBonus(spell)) * dk.RoRTSBonus(aoeTarget) * core.TernaryFloat64(dk.DiseasesAreActive(aoeTarget), 1.5, 1.0)
baseDamage *= sim.Encounter.AOECapMultiplier()

result := spell.CalcAndDealDamage(sim, aoeTarget, baseDamage, spell.OutcomeMagicHitAndCrit)

if result.Landed() {
dk.AoESpellNumTargetsHit++
}

if aoeTarget == target {
spell.SpendRefundableCost(sim, result)
dk.LastOutcome = result.Outcome
Expand Down
11 changes: 9 additions & 2 deletions sim/deathknight/frost_strike.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@ import (
"github.com/wowsims/wotlk/sim/core/proto"
)

var FrostStrikeActionID = core.ActionID{SpellID: 55268}
var frostStrikeActionID = core.ActionID{SpellID: 55268}
var FrostStrikeMHActionID = frostStrikeActionID.WithTag(1)
var FrostStrikeOHActionID = frostStrikeActionID.WithTag(2)

func (dk *Deathknight) newFrostStrikeHitSpell(isMH bool) *core.Spell {
bonusBaseDamage := dk.sigilOfTheVengefulHeartFrostStrike()

actionID := FrostStrikeMHActionID
if !isMH {
actionID = FrostStrikeOHActionID
}

conf := core.SpellConfig{
ActionID: FrostStrikeActionID.WithTag(core.TernaryInt32(isMH, 1, 2)),
ActionID: actionID,
SpellSchool: core.SpellSchoolFrost,
ProcMask: dk.threatOfThassarianProcMask(isMH),
Flags: core.SpellFlagMeleeMetrics,
Expand Down
6 changes: 6 additions & 0 deletions sim/deathknight/howling_blast.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ func (dk *Deathknight) registerHowlingBlastSpell() {
ThreatMultiplier: 1,

ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
dk.AoESpellNumTargetsHit = 0

for _, aoeTarget := range sim.Encounter.TargetUnits {
baseDamage := (sim.Roll(518, 562) + 0.2*dk.getImpurityBonus(spell)) *
dk.glacielRotBonus(aoeTarget) *
Expand All @@ -52,6 +54,10 @@ func (dk *Deathknight) registerHowlingBlastSpell() {

result := spell.CalcDamage(sim, aoeTarget, baseDamage, spell.OutcomeMagicHitAndCrit)

if result.Landed() {
dk.AoESpellNumTargetsHit++
}

if aoeTarget == target {
spell.SpendRefundableCost(sim, result)
dk.LastOutcome = result.Outcome
Expand Down
16 changes: 14 additions & 2 deletions sim/deathknight/items.go
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ func init() {
consumeSpells := [5]core.ActionID{
BloodBoilActionID,
DeathCoilActionID,
FrostStrikeActionID,
FrostStrikeMHActionID,
HowlingBlastActionID,
IcyTouchActionID,
}
Expand All @@ -558,13 +558,25 @@ func init() {
dk.modifyShadowDamageModifier(-0.2)
},
OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
if spell.ActionID == HowlingBlastActionID || spell.ActionID == BloodBoilActionID {
if result.Target.Index == sim.GetNumTargets()-1 {
// Last target, consume a stack for every target hit
for i := int32(0); i < dk.AoESpellNumTargetsHit; i++ {
if aura.IsActive() {
aura.RemoveStack(sim)
}
}
}
return
}

if !result.Outcome.Matches(core.OutcomeLanded) {
return
}

shouldConsume := false
for _, consumeSpell := range consumeSpells {
if spell.ActionID.SameActionIgnoreTag(consumeSpell) {
if spell.ActionID == consumeSpell {
shouldConsume = true
break
}
Expand Down
7 changes: 4 additions & 3 deletions sim/deathknight/rotation_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ func (s *Sequence) Clear() *Sequence {
type RotationHelper struct {
RotationSequence *Sequence

LastOutcome core.HitOutcome
LastCast *core.Spell
NextCast *core.Spell
LastOutcome core.HitOutcome
LastCast *core.Spell
NextCast *core.Spell
AoESpellNumTargetsHit int32
}

0 comments on commit 513d2e1

Please sign in to comment.