From cd04d1367c82974b1dc05274ab924160b81c2d7c Mon Sep 17 00:00:00 2001 From: Kayla Glick Date: Tue, 6 Feb 2024 17:48:20 -0500 Subject: [PATCH] add nature debuffs --- proto/common.proto | 4 ++- sim/core/debuffs.go | 40 ++++++++++++++++++++++ ui/core/components/inputs/buffs_debuffs.ts | 24 +++++++++++-- 3 files changed, 64 insertions(+), 4 deletions(-) diff --git a/proto/common.proto b/proto/common.proto index 26813de741..bfe851a5c1 100644 --- a/proto/common.proto +++ b/proto/common.proto @@ -518,7 +518,7 @@ message Consumes { EnchantedSigil enchanted_sigil = 20; } -// NextIndex: 27 +// NextIndex: 29 message Debuffs { bool judgement_of_wisdom = 1; bool judgement_of_light = 2; @@ -531,6 +531,8 @@ message Debuffs { bool improved_shadow_bolt = 7; bool improved_scorch = 8; bool shadow_weaving = 26; + bool stormstrike = 27; + bool dreamstate = 28; // Bonus physical damage bool gift_of_arthas = 9; diff --git a/sim/core/debuffs.go b/sim/core/debuffs.go index a0df1b4ac0..58dcef8cd9 100644 --- a/sim/core/debuffs.go +++ b/sim/core/debuffs.go @@ -54,6 +54,12 @@ func applyDebuffEffects(target *Unit, targetIdx int, debuffs *proto.Debuffs, rai MakePermanent(WintersChillAura(target, 5)) } + if debuffs.Stormstrike { + MakePermanent(StormstrikeAura(target, level)) + } else if debuffs.Dreamstate { + MakePermanent(DreamstateAura(target, level)) + } + if debuffs.GiftOfArthas { MakePermanent(GiftOfArthasAura(target)) } @@ -149,6 +155,40 @@ func applyDebuffEffects(target *Unit, targetIdx int, debuffs *proto.Debuffs, rai } } +func StormstrikeAura(unit *Unit, rank int32) *Aura { + damageMulti := 1.2 + duration := time.Second * 12 + + return unit.RegisterAura(Aura{ + Label: "Stormstrike", + ActionID: ActionID{SpellID: 17364}, + Duration: duration, + OnGain: func(aura *Aura, sim *Simulation) { + aura.Unit.PseudoStats.SchoolDamageTakenMultiplier[stats.SchoolIndexNature] *= damageMulti + }, + OnExpire: func(aura *Aura, sim *Simulation) { + aura.Unit.PseudoStats.SchoolDamageTakenMultiplier[stats.SchoolIndexNature] /= damageMulti + }, + }) +} + +func DreamstateAura(unit *Unit, rank int32) *Aura { + damageMulti := 1.2 + duration := time.Second * 12 + + return unit.RegisterAura(Aura{ + Label: "Dreamstate", + ActionID: ActionID{SpellID: 408258}, + Duration: duration, + OnGain: func(aura *Aura, sim *Simulation) { + aura.Unit.PseudoStats.SchoolDamageTakenMultiplier[stats.SchoolIndexNature] *= damageMulti + }, + OnExpire: func(aura *Aura, sim *Simulation) { + aura.Unit.PseudoStats.SchoolDamageTakenMultiplier[stats.SchoolIndexNature] /= damageMulti + }, + }) +} + func ImprovedShadowBoltAura(unit *Unit, rank int32) *Aura { damageMulti := 1. + 0.04*float64(rank) return unit.RegisterAura(Aura{ diff --git a/ui/core/components/inputs/buffs_debuffs.ts b/ui/core/components/inputs/buffs_debuffs.ts index 2549adaf99..03739f0f20 100644 --- a/ui/core/components/inputs/buffs_debuffs.ts +++ b/ui/core/components/inputs/buffs_debuffs.ts @@ -652,7 +652,7 @@ export const SpellScorchDebuff = withLabel( ]), fieldName: 'improvedScorch', }), - 'Improved Scorch', + 'Fire Damage', ); export const SpellWintersChillDebuff = withLabel( @@ -662,9 +662,22 @@ export const SpellWintersChillDebuff = withLabel( ]), fieldName: 'wintersChill', }), - 'Winters Chill', + 'Frost Damage', ); +export const NatureSpellDamageDebuff = InputHelpers.makeMultiIconInput([ + makeBooleanDebuffInput({ + actionId: (player) => player.getMatchingSpellActionId([ + { id: 17364, minLevel: 40 }, + ]), + fieldName: 'stormstrike', + }), + makeBooleanDebuffInput({ + actionId: () => ActionId.fromSpellId(408258), + fieldName: 'dreamstate', + }) +], 'Nature Damage') + export const SpellShadowWeavingDebuff = withLabel( makeBooleanDebuffInput({ actionId: (player) => player.getMatchingSpellActionId([ @@ -1018,7 +1031,12 @@ export const DEBUFFS_CONFIG = [ picker: IconPicker, stats: [Stat.StatFrostPower] }, - { + { + config: NatureSpellDamageDebuff, + picker: MultiIconPicker, + stats: [Stat.StatNaturePower], + }, + { config: SpellShadowWeavingDebuff, picker: IconPicker, stats: [Stat.StatShadowPower]