Skip to content

Commit

Permalink
fix holy shield no charges bug
Browse files Browse the repository at this point in the history
  • Loading branch information
kayla-glick committed Dec 26, 2024
1 parent 26b8f3e commit cf338b0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion sim/paladin/holy_shield.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ func (paladin *Paladin) registerHolyShield() {
Duration: time.Second * 10,
MaxStacks: numCharges,
OnGain: func(aura *core.Aura, sim *core.Simulation) {
aura.SetStacks(sim, numCharges)
if aura.MaxStacks > 0 {
aura.SetStacks(sim, aura.MaxStacks)
}
paladin.AddStatDynamic(sim, stats.Block, blockBonus)
},
OnExpire: func(aura *core.Aura, sim *core.Simulation) {
Expand Down
9 changes: 6 additions & 3 deletions sim/paladin/item_sets_pve.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ var ItemSetLawbringerWill = core.NewItemSet(core.ItemSet{
blockBonus := 30.0 * core.BlockRatingPerBlockChance

for i, values := range HolyShieldValues {

if paladin.Level < values.level {
break
}
Expand Down Expand Up @@ -358,7 +357,6 @@ var ItemSetWilfullJudgement = core.NewItemSet(core.ItemSet{
}

blockBonus := 40.0 * core.BlockRatingPerBlockChance
numCharges := int32(4)

paladin.RegisterAura(core.Aura{
Label: "S03 - Item - T2 - Paladin - Protection 2P Bonus",
Expand All @@ -367,11 +365,16 @@ var ItemSetWilfullJudgement = core.NewItemSet(core.ItemSet{
if paladin.Level < HolyShieldValues[i].level {
break
}

oldOnGain := hsAura.OnGain
hsAura.OnGain = func(aura *core.Aura, sim *core.Simulation) {
aura.SetStacks(sim, numCharges)
oldOnGain(aura, sim)
paladin.AddStatDynamic(sim, stats.Block, blockBonus)
}

oldOnExpire := hsAura.OnExpire
hsAura.OnExpire = func(aura *core.Aura, sim *core.Simulation) {
oldOnExpire(aura, sim)
paladin.AddStatDynamic(sim, stats.Block, -blockBonus)
}
}
Expand Down

0 comments on commit cf338b0

Please sign in to comment.