Skip to content

Commit

Permalink
split ice lance into stacks, update glaciate spell ID
Browse files Browse the repository at this point in the history
  • Loading branch information
kayla-glick committed Dec 7, 2024
1 parent 942657b commit f74cb2e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 31 deletions.
53 changes: 26 additions & 27 deletions sim/mage/ice_lance.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ func (mage *Mage) registerIceLanceSpell() {
manaCost := 0.08

mage.IceLance = mage.RegisterSpell(core.SpellConfig{
SpellCode: SpellCode_MageIceLance,
ActionID: core.ActionID{SpellID: int32(proto.MageRune_RuneHandsIceLance)},
SpellSchool: core.SpellSchoolFrost,
DefenseType: core.DefenseTypeMagic,
ProcMask: core.ProcMaskSpellDamage,
Flags: SpellFlagMage | core.SpellFlagAPL,
SpellCode: SpellCode_MageIceLance,
ActionID: core.ActionID{SpellID: int32(proto.MageRune_RuneHandsIceLance)},
SpellSchool: core.SpellSchoolFrost,
DefenseType: core.DefenseTypeMagic,
ProcMask: core.ProcMaskSpellDamage,
Flags: SpellFlagMage | core.SpellFlagAPL,

MissileSpeed: 38,
MetricSplits: 6,

ManaCost: core.ManaCostOptions{
BaseCost: manaCost,
Expand All @@ -36,6 +38,11 @@ func (mage *Mage) registerIceLanceSpell() {
DefaultCast: core.Cast{
GCD: core.GCDDefault,
},
ModifyCast: func(sim *core.Simulation, spell *core.Spell, cast *core.Cast) {
if glaciateAura := mage.GlaciateAuras.Get(mage.CurrentTarget); glaciateAura != nil {
spell.SetMetricsSplit(glaciateAura.GetStacks())
}
},
},

DamageMultiplier: 1,
Expand All @@ -44,10 +51,22 @@ func (mage *Mage) registerIceLanceSpell() {

ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
baseDamage := sim.Roll(baseDamageLow, baseDamageHigh)

var glaciateAura *core.Aura
modifier := 0.0
if glaciateAura = mage.GlaciateAuras.Get(target); glaciateAura.IsActive() {
modifier += 0.20 * float64(glaciateAura.GetStacks())
}

spell.DamageMultiplierAdditive += modifier
result := spell.CalcDamage(sim, target, baseDamage, spell.OutcomeMagicHitAndCrit)
spell.DamageMultiplierAdditive -= modifier

spell.WaitTravelTime(sim, func(sim *core.Simulation) {
spell.DealDamage(sim, result)
if result.Landed() && glaciateAura != nil {
glaciateAura.Deactivate(sim)
}
})
},
})
Expand All @@ -58,33 +77,13 @@ func (mage *Mage) registerIceLanceSpell() {

mage.GlaciateAuras = mage.NewEnemyAuraArray(func(unit *core.Unit, _ int32) *core.Aura {
return unit.RegisterAura(core.Aura{
ActionID: core.ActionID{SpellID: int32(proto.MageRune_RuneHandsIceLance), Tag: 1}, // Temp ID
ActionID: core.ActionID{SpellID: 1218345},
Label: "Glaciate",
Duration: time.Second * 15,
MaxStacks: 5,
})
})

oldApplyEffects := mage.IceLance.ApplyEffects
mage.IceLance.ApplyEffects = func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
var glaciateAura *core.Aura
modifier := 0.0

if glaciateAura = mage.GlaciateAuras.Get(target); glaciateAura.IsActive() {
modifier += 0.20 * float64(glaciateAura.GetStacks())
}

spell.DamageMultiplierAdditive += modifier
oldApplyEffects(sim, target, spell)
spell.DamageMultiplierAdditive -= modifier

spell.WaitTravelTime(sim, func(sim *core.Simulation) {
if glaciateAura != nil {
glaciateAura.Deactivate(sim)
}
})
}

core.MakePermanent(mage.RegisterAura(core.Aura{
Label: "Glaciate Trigger",
OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
Expand Down
2 changes: 1 addition & 1 deletion ui/core/components/detailed_results/timeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1336,7 +1336,7 @@ const idToCategoryMap: Record<number, number> = {
[10212]: SPELL_ACTION_CATEGORY + 0.1, // Arcane Missiles
[44572]: SPELL_ACTION_CATEGORY + 0.1, // Deep Freeze
[44781]: SPELL_ACTION_CATEGORY + 0.2, // Arcane Barrage
[42914]: SPELL_ACTION_CATEGORY + 0.2, // Ice Lance
[400640]: SPELL_ACTION_CATEGORY + 0.2, // Ice Lance
[55360]: SPELL_ACTION_CATEGORY + 0.2, // Living Bomb
[55362]: SPELL_ACTION_CATEGORY + 0.21, // Living Bomb (Explosion)
[12654]: SPELL_ACTION_CATEGORY + 0.3, // Ignite
Expand Down
6 changes: 3 additions & 3 deletions ui/core/proto_utils/action_id.ts
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ export class ActionId {
break;
// Temporary until real debuff is implemented
case 'Ice Lance':
if (this.tag === 1) name = 'Glaciate'
if (this.tag > 0) name = `${name} (${this.tag} Stacks)`
break;
default:
if (this.tag) {
Expand Down Expand Up @@ -743,10 +743,10 @@ const spellIDsToShowBuffs = new Set([
461252, // https://www.wowhead.com/classic/spell=461252/shadowflame-fury
461270, // https://www.wowhead.com/classic/spell=461270/magmadars-return
461615, // https://www.wowhead.com/classic/spell=461615/mark-of-chaos
456393, // https://www.wowhead.com/classic/spell=456393/stalked
1214279, // https://www.wowhead.com/classic/spell=1214279/spell-blasting
439473, // https://www.wowhead.com/classic/spell=439473/atrophic-poison
439472, // https://www.wowhead.com/classic/spell=439472/numbing-poison
1214279, // https://www.wowhead.com/classic/spell=1214279/spell-blasting
1218345, // https://www.wowhead.com/classic/spell=1218345/glaciate
]);

export const defaultTargetIcon = 'https://wow.zamimg.com/images/wow/icons/large/spell_shadow_metamorphosis.jpg';
Expand Down

0 comments on commit f74cb2e

Please sign in to comment.