Skip to content

Commit

Permalink
add faerie fire feral split, rework improved FF effect into its own aura
Browse files Browse the repository at this point in the history
  • Loading branch information
kayla-glick committed Aug 3, 2024
1 parent 52f2fc9 commit ba8b255
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 24 deletions.
63 changes: 47 additions & 16 deletions sim/core/debuffs.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,12 @@ func applyDebuffEffects(target *Unit, targetIdx int, debuffs *proto.Debuffs, rai
MakePermanent(CurseOfRecklessnessAura(target, level))
}

if debuffs.FaerieFire {
MakePermanent(FaerieFireAura(target, level, debuffs.ImprovedFaerieFire))
if debuffs.FaerieFire || debuffs.ImprovedFaerieFire {
MakePermanent(FaerieFireAura(target, level))
}

if debuffs.ImprovedFaerieFire {
MakePermanent(ImprovedFaerieFireAura(target))
}

if debuffs.CurseOfWeakness != proto.TristateEffect_TristateEffectMissing {
Expand Down Expand Up @@ -1072,41 +1076,68 @@ func CurseOfRecklessnessAura(target *Unit, playerLevel int32) *Aura {

// Decreases the armor of the target by X for 40 sec.
// Improved: Your Faerie Fire and Faerie Fire (Feral) also increase the chance for all attacks to hit that target by 1% for 40 sec.
func FaerieFireAura(target *Unit, playerLevel int32, improved bool) *Aura {
func FaerieFireAura(target *Unit, playerLevel int32) *Aura {
spellID := map[int32]int32{
25: 770,
40: 778,
50: 9749,
60: 9907,
}[playerLevel]

arpen := map[int32]float64{
return faerieFireAuraInternal(target, "Faerie Fire", spellID, playerLevel)
}

func FaerieFireFeralAura(target *Unit, playerLevel int32) *Aura {
spellID := map[int32]int32{
40: 17390,
50: 17391,
60: 17392,
}[playerLevel]

return faerieFireAuraInternal(target, "Faerie Fire (Feral)", spellID, playerLevel)
}

func faerieFireAuraInternal(target *Unit, label string, spellID int32, playerLevel int32) *Aura {
arPen := map[int32]float64{
25: 175,
40: 285,
50: 395,
60: 505,
}[playerLevel]

aura := target.GetOrRegisterAura(Aura{
Label: "Faerie Fire",
Label: label,
ActionID: ActionID{SpellID: spellID},
Duration: time.Second * 40,
})

aura.NewExclusiveEffect("Faerie Fire", true, ExclusiveEffect{
Priority: arPen,
OnGain: func(ee *ExclusiveEffect, sim *Simulation) {
ee.Aura.Unit.AddStatDynamic(sim, stats.Armor, -arPen)
},
OnExpire: func(ee *ExclusiveEffect, sim *Simulation) {
ee.Aura.Unit.AddStatDynamic(sim, stats.Armor, arPen)
},
})

return aura
}

func ImprovedFaerieFireAura(target *Unit) *Aura {
return target.GetOrRegisterAura(Aura{
Label: "S03 - Item - T1 - Druid - Feral 2P Bonus",
ActionID: ActionID{SpellID: 455864},
Duration: time.Second * 40,
OnGain: func(aura *Aura, sim *Simulation) {
aura.Unit.AddStatDynamic(sim, stats.Armor, -arpen)
if improved {
aura.Unit.PseudoStats.BonusMeleeHitRatingTaken += 1 * MeleeHitRatingPerHitChance
aura.Unit.PseudoStats.BonusSpellHitRatingTaken += 1 * SpellHitRatingPerHitChance
}
aura.Unit.PseudoStats.BonusMeleeHitRatingTaken += 1 * MeleeHitRatingPerHitChance
aura.Unit.PseudoStats.BonusSpellHitRatingTaken += 1 * SpellHitRatingPerHitChance
},
OnExpire: func(aura *Aura, sim *Simulation) {
aura.Unit.AddStatDynamic(sim, stats.Armor, arpen)
if improved {
aura.Unit.PseudoStats.BonusMeleeHitRatingTaken -= 1 * MeleeHitRatingPerHitChance
aura.Unit.PseudoStats.BonusSpellHitRatingTaken -= 1 * SpellHitRatingPerHitChance
}
aura.Unit.PseudoStats.BonusMeleeHitRatingTaken -= 1 * MeleeHitRatingPerHitChance
aura.Unit.PseudoStats.BonusSpellHitRatingTaken -= 1 * SpellHitRatingPerHitChance
},
})
return aura
}

func CurseOfWeaknessAura(target *Unit, points int32, playerLevel int32) *Aura {
Expand Down
3 changes: 3 additions & 0 deletions sim/druid/druid.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ var TalentTreeSizes = [3]int{16, 16, 15}
const (
SpellCode_DruidNone int32 = iota

SpellCode_DruidFaerieFire
SpellCode_DruidFaerieFireFeral
SpellCode_DruidFerociousBite
SpellCode_DruidInsectSwarm
SpellCode_DruidMangleCat
Expand Down Expand Up @@ -98,6 +100,7 @@ type Druid struct {
EnrageAura *core.Aura
EclipseAura *core.Aura
FaerieFireAuras core.AuraArray
ImprovedFaerieFireAuras core.AuraArray
FrenziedRegenerationAura *core.Aura
FurorAura *core.Aura
FuryOfStormrageAura *core.Aura
Expand Down
17 changes: 10 additions & 7 deletions sim/druid/faerie_fire.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import (
)

func (druid *Druid) registerFaerieFireSpell() {
has2PCenarionCunning := druid.HasSetBonus(ItemSetCenarionCunning, 2)

spellCode := SpellCode_DruidFaerieFire
actionID := core.ActionID{SpellID: map[int32]int32{
25: 770,
40: 778,
Expand All @@ -35,9 +34,13 @@ func (druid *Druid) registerFaerieFireSpell() {
flags := core.SpellFlagNone
formMask := Humanoid | Moonkin

druid.FaerieFireAuras = druid.NewEnemyAuraArray(func(target *core.Unit, level int32) *core.Aura {
return core.FaerieFireAura(target, level)
})

if druid.InForm(Cat|Bear) && druid.Talents.FaerieFireFeral {
spellCode = SpellCode_DruidFaerieFireFeral
actionID = core.ActionID{SpellID: map[int32]int32{
25: 16857,
40: 17390,
50: 17391,
60: 17392,
Expand All @@ -50,14 +53,14 @@ func (druid *Druid) registerFaerieFireSpell() {
Timer: druid.NewTimer(),
Duration: time.Second * 6,
}
druid.FaerieFireAuras = druid.NewEnemyAuraArray(func(target *core.Unit, level int32) *core.Aura {
return core.FaerieFireFeralAura(target, level)
})
}
flags |= core.SpellFlagAPL | core.SpellFlagResetAttackSwing

druid.FaerieFireAuras = druid.NewEnemyAuraArray(func(target *core.Unit, level int32) *core.Aura {
return core.FaerieFireAura(target, level, has2PCenarionCunning)
})

druid.FaerieFire = druid.RegisterSpell(formMask, core.SpellConfig{
SpellCode: spellCode,
ActionID: actionID,
SpellSchool: core.SpellSchoolNature,
ProcMask: core.ProcMaskSpellDamage,
Expand Down
14 changes: 13 additions & 1 deletion sim/druid/item_sets_pve.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,19 @@ var ItemSetCenarionCunning = core.NewItemSet(core.ItemSet{
Bonuses: map[int32]core.ApplyEffect{
// Your Faerie Fire and Faerie Fire (Feral) also increase the chance for all attacks to hit that target by 1% for 40 sec.
2: func(agent core.Agent) {
// Implemented in faerie_fire.go
druid := agent.(DruidAgent).GetDruid()
druid.ImprovedFaerieFireAuras = druid.NewEnemyAuraArray(func(target *core.Unit, level int32) *core.Aura {
return core.ImprovedFaerieFireAura(target)
})

core.MakePermanent(druid.RegisterAura(core.Aura{
Label: "S03 - Item - T1 - Druid - Feral 2P Bonus Trigger",
OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
if (spell.SpellCode == SpellCode_DruidFaerieFire || spell.SpellCode == SpellCode_DruidFaerieFireFeral) && result.Landed() {
druid.ImprovedFaerieFireAuras.Get(result.Target).Activate(sim)
}
},
}))
},
// Periodic damage from your Rake and Rip can now be critical strikes.
4: func(agent core.Agent) {
Expand Down

0 comments on commit ba8b255

Please sign in to comment.