Skip to content

Commit

Permalink
Merge pull request #96 from wowsims/shaman
Browse files Browse the repository at this point in the history
Add nature damage debuffs
  • Loading branch information
kayla-glick authored Feb 6, 2024
2 parents 0561ed4 + c20a05f commit fd74d44
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 4 deletions.
4 changes: 3 additions & 1 deletion proto/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
40 changes: 40 additions & 0 deletions sim/core/debuffs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down Expand Up @@ -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{
Expand Down
24 changes: 21 additions & 3 deletions ui/core/components/inputs/buffs_debuffs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ export const SpellScorchDebuff = withLabel(
]),
fieldName: 'improvedScorch',
}),
'Improved Scorch',
'Fire Damage',
);

export const SpellWintersChillDebuff = withLabel(
Expand All @@ -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([
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit fd74d44

Please sign in to comment.