Skip to content

Commit

Permalink
Updates/adds AP, AtkSpeed and AtkDmg debuffs
Browse files Browse the repository at this point in the history
  • Loading branch information
emrus-main committed May 5, 2024
1 parent e93a5c7 commit e190351
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 27 deletions.
3 changes: 2 additions & 1 deletion proto/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ message Consumes {
bool bogling_root = 19 [deprecated=true];
}

// NextIndex: 33
// NextIndex: 35
message Debuffs {
bool judgement_of_wisdom = 1;
bool judgement_of_light = 2;
Expand Down Expand Up @@ -695,6 +695,7 @@ message Debuffs {
TristateEffect demoralizing_shout = 15;

TristateEffect thunder_clap = 16;
bool waylay = 34;

bool insect_swarm = 17;
bool scorpid_sting = 18;
Expand Down
76 changes: 60 additions & 16 deletions sim/core/debuffs.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package core

import (
"strconv"
"time"

"github.com/wowsims/sod/sim/core/proto"
"github.com/wowsims/sod/sim/core/stats"
"math"
"strconv"
"time"
)

type DebuffName int32
Expand Down Expand Up @@ -173,7 +173,7 @@ func applyDebuffEffects(target *Unit, targetIdx int, debuffs *proto.Debuffs, rai
}

if debuffs.CurseOfWeakness != proto.TristateEffect_TristateEffectMissing {
MakePermanent(CurseOfWeaknessAura(target, GetTristateValueInt32(debuffs.CurseOfWeakness, 1, 2), level))
MakePermanent(CurseOfWeaknessAura(target, GetTristateValueInt32(debuffs.CurseOfWeakness, 0, 3), level))
}

if debuffs.DemoralizingRoar != proto.TristateEffect_TristateEffectMissing {
Expand All @@ -190,6 +190,9 @@ func applyDebuffEffects(target *Unit, targetIdx int, debuffs *proto.Debuffs, rai
if debuffs.ThunderClap != proto.TristateEffect_TristateEffectMissing {
MakePermanent(ThunderClapAura(target, 8205, time.Second*22, GetTristateValueInt32(debuffs.ThunderClap, 10, 16)))
}
if debuffs.Waylay {
MakePermanent(WaylayAura(target))
}

// Miss
if debuffs.InsectSwarm && targetIdx == 0 {
Expand Down Expand Up @@ -894,15 +897,24 @@ func CurseOfRecklessnessAura(target *Unit, playerLevel int32) *Aura {
60: 640,
}[playerLevel]

ap := map[int32]float64{
25: 20,
40: 45,
50: 65,
60: 90,
}[playerLevel]

aura := target.GetOrRegisterAura(Aura{
Label: "Curse of Recklessness",
ActionID: ActionID{SpellID: spellID},
Duration: time.Minute * 2,
OnGain: func(aura *Aura, sim *Simulation) {
aura.Unit.AddStatDynamic(sim, stats.Armor, -arpen)
aura.Unit.AddStatDynamic(sim, stats.AttackPower, ap)
},
OnExpire: func(aura *Aura, sim *Simulation) {
aura.Unit.AddStatDynamic(sim, stats.Armor, arpen)
aura.Unit.AddStatDynamic(sim, stats.AttackPower, -ap)
},
})
return aura
Expand Down Expand Up @@ -937,12 +949,34 @@ func FaerieFireAura(target *Unit, playerLevel int32) *Aura {
return aura
}

// TODO: Classic
func CurseOfWeaknessAura(target *Unit, points int32, _ int32) *Aura {
func CurseOfWeaknessAura(target *Unit, points int32, playerLevel int32) *Aura {
spellID := map[int32]int32{
25: 6205,
40: 7646,
50: 11707,
60: 11708,
}[playerLevel]

modDmgReduction := map[int32]float64{
25: 10,
40: 15,
50: 22,
60: 31,
}[playerLevel]

modDmgReduction *= []float64{1, 1.06, 1.13, 1.20}[points]
modDmgReduction = math.Floor(modDmgReduction)

aura := target.GetOrRegisterAura(Aura{
Label: "Curse of Weakness" + strconv.Itoa(int(points)),
ActionID: ActionID{SpellID: 50511},
ActionID: ActionID{SpellID: spellID},
Duration: time.Minute * 2,
OnGain: func(aura *Aura, sim *Simulation) {
aura.Unit.PseudoStats.BonusDamage += modDmgReduction
},
OnExpire: func(aura *Aura, sim *Simulation) {
aura.Unit.PseudoStats.BonusDamage -= modDmgReduction
},
})
return aura
}
Expand Down Expand Up @@ -986,14 +1020,26 @@ func HuntersMarkAura(target *Unit, points int32, playerLevel int32) *Aura {
return aura
}

// TODO: Classic
func DemoralizingRoarAura(target *Unit, points int32, _ int32) *Aura {
func DemoralizingRoarAura(target *Unit, points int32, playerLevel int32) *Aura {
spellID := map[int32]int32{
25: 1735,
40: 9490,
50: 9747,
60: 9898,
}[playerLevel]
baseAPReduction := map[int32]float64{
25: 55,
40: 73,
50: 108,
60: 138,
}[playerLevel]

aura := target.GetOrRegisterAura(Aura{
Label: "DemoralizingRoar-" + strconv.Itoa(int(points)),
ActionID: ActionID{SpellID: 9898},
ActionID: ActionID{SpellID: spellID},
Duration: time.Second * 30,
})
apReductionEffect(aura, 411*(1+0.08*float64(points)))
apReductionEffect(aura, math.Floor(baseAPReduction*(1+0.08*float64(points))))
return aura
}

Expand All @@ -1003,8 +1049,8 @@ var DemoralizingShoutSpellId = [DemoralizingShoutRanks + 1]int32{0, 1160, 6190,
var DemoralizingShoutBaseAP = [DemoralizingShoutRanks + 1]float64{0, 45, 56, 76, 111, 146}
var DemoralizingShoutLevel = [DemoralizingShoutRanks + 1]int{0, 14, 24, 34, 44, 54}

func DemoralizingShoutAura(target *Unit, boomingVoicePts int32, impDemoShoutPts int32, _ int32) *Aura {
rank := LevelToDebuffRank[DemoralizingShout][target.Level]
func DemoralizingShoutAura(target *Unit, boomingVoicePts int32, impDemoShoutPts int32, playerLevel int32) *Aura {
rank := LevelToDebuffRank[DemoralizingShout][playerLevel]
spellId := DemoralizingShoutSpellId[rank]
baseAPReduction := DemoralizingShoutBaseAP[rank]

Expand All @@ -1013,18 +1059,16 @@ func DemoralizingShoutAura(target *Unit, boomingVoicePts int32, impDemoShoutPts
ActionID: ActionID{SpellID: spellId},
Duration: time.Duration(float64(time.Second*30) * (1 + 0.1*float64(boomingVoicePts))),
})
apReductionEffect(aura, baseAPReduction*(1+0.08*float64(impDemoShoutPts)))
apReductionEffect(aura, math.Floor(baseAPReduction*(1+0.08*float64(impDemoShoutPts))))
return aura
}

// TODO: Classic
func VindicationAura(target *Unit, points int32, _ int32) *Aura {
aura := target.GetOrRegisterAura(Aura{
Label: "Vindication",
ActionID: ActionID{SpellID: 26016},
Duration: time.Second * 10,
})
apReductionEffect(aura, 287*float64(points))
return aura
}

Expand Down
40 changes: 30 additions & 10 deletions ui/core/components/inputs/buffs_debuffs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -662,11 +662,23 @@ export const FaerieFire = withLabel(
'Faerie Fire',
);

// TODO: Classic
// export const MinorArmorDebuff = InputHelpers.makeMultiIconInput([
// makeTristateDebuffInput(ActionId.fromSpellId(770), ActionId.fromSpellId(33602), 'faerieFire'),
// makeBooleanDebuffInput({actionId: () => ActionId.fromSpellId(50511), fieldName: 'curseOfWeakness'}),
// ], 'Minor ArP');
export const curseOfWeaknessDebuff = withLabel(
makeTristateDebuffInput({
actionId: player =>
player.getMatchingSpellActionId([
{ id: 702, minLevel: 4, maxLevel: 11 },
{ id: 1108, minLevel: 12, maxLevel: 21 },
{ id: 6205, minLevel: 22, maxLevel: 31 },
{ id: 6205, minLevel: 22, maxLevel: 31 },
{ id: 7646, minLevel: 32, maxLevel: 41 },
{ id: 11707, minLevel: 42, maxLevel: 51 },
{ id: 11708, minLevel: 52 },
]),
impId: ActionId.fromSpellId(18181),
fieldName: 'curseOfWeakness',
}),
'Curse of Weakness',
);

export const AttackPowerDebuff = InputHelpers.makeMultiIconInput(
[
Expand Down Expand Up @@ -722,6 +734,10 @@ export const MeleeAttackSpeedDebuff = InputHelpers.makeMultiIconInput(
reverse: true,
fieldName: 'homunculi',
}),
makeBooleanDebuffInput({
actionId: () => ActionId.fromSpellId(408699),
fieldName: 'waylay',
}),
],
'Thunder Clap',
);
Expand Down Expand Up @@ -1151,16 +1167,13 @@ export const DEBUFFS_CONFIG = [
picker: IconPicker,
stats: [Stat.StatAttackPower],
},
// // {
// // config: MinorArmorDebuff,
// // picker: MultiIconPicker,
// // stats: [Stat.StatAttackPower]
// // },
{
config: BleedDebuff,
picker: IconPicker,
stats: [Stat.StatAttackPower, Stat.StatRangedAttackPower],
},

// Magic
{
config: JudgementOfTheCrusader,
picker: IconPicker,
Expand Down Expand Up @@ -1201,6 +1214,8 @@ export const DEBUFFS_CONFIG = [
picker: IconPicker,
stats: [Stat.StatShadowPower, Stat.StatArcanePower],
},

// Defensive
{
config: AttackPowerDebuff,
picker: MultiIconPicker,
Expand All @@ -1211,6 +1226,11 @@ export const DEBUFFS_CONFIG = [
picker: MultiIconPicker,
stats: [Stat.StatArmor],
},
{
config: curseOfWeaknessDebuff,
picker: IconPicker,
stats: [Stat.StatArmor],
},
{
config: MeleeHitDebuff,
picker: IconPicker,
Expand Down

0 comments on commit e190351

Please sign in to comment.