Skip to content

Commit

Permalink
WIP - set bonus aura update
Browse files Browse the repository at this point in the history
  • Loading branch information
1337LutZ committed Dec 20, 2024
1 parent 8833606 commit 1b36516
Show file tree
Hide file tree
Showing 18 changed files with 3,412 additions and 3,339 deletions.
15 changes: 0 additions & 15 deletions sim/core/item_sets.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,18 +294,3 @@ func (setBonusTracker *Aura) AttachStatBuff(stat stats.Stat, value float64) {
statsToAdd[stat] = value
setBonusTracker.AttachStatsBuff(statsToAdd)
}

// Attaches a Boolean to the set bonus
func (setBonusTracker *Aura) AttachBooleanToggle(toggleArg bool) {
setBonusTracker.ApplyOnGain(func(aura *Aura, sim *Simulation) {
toggleArg = true
})

setBonusTracker.ApplyOnExpire(func(aura *Aura, sim *Simulation) {
toggleArg = false
})

if setBonusTracker.IsActive() {
toggleArg = true
}
}
21 changes: 18 additions & 3 deletions sim/death_knight/items.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,12 @@ var ItemSetElementiumDeathplateBattlearmor = core.NewItemSet(core.ItemSet{
// When your Dancing Rune Weapon expires, you gain 15% additional parry chance for 12 sec.
// Implemented in dancing_rune_weapon.go
dk := agent.(DeathKnightAgent).GetDeathKnight()
setBonusAura.AttachBooleanToggle(dk.HasT12Tank4pc)
setBonusAura.ApplyOnGain(func(aura *core.Aura, sim *core.Simulation) {
dk.HasT12Tank4pc = true
})
setBonusAura.ApplyOnExpire(func(aura *core.Aura, sim *core.Simulation) {
dk.HasT12Tank4pc = false
})
},
},
})
Expand All @@ -250,14 +255,24 @@ var ItemSetNecroticBoneplateBattlegear = core.NewItemSet(core.ItemSet{
// Sudden Doom has a 30% chance and Rime has a 60% chance to grant 2 charges when triggered instead of 1.
// Handled in talents_frost.go:applyRime() and talents_unholy.go:applySuddenDoom()
dk := agent.(DeathKnightAgent).GetDeathKnight()
setBonusAura.AttachBooleanToggle(dk.HasT13Dps2pc)
setBonusAura.ApplyOnGain(func(aura *core.Aura, sim *core.Simulation) {
dk.HasT13Dps2pc = true
})
setBonusAura.ApplyOnExpire(func(aura *core.Aura, sim *core.Simulation) {
dk.HasT13Dps2pc = false
})
},
4: func(agent core.Agent, setBonusAura *core.Aura) {
// Runic Empowerment has a 25% chance and Runic Corruption has a 40% chance to also grant 710 mastery rating for 12 sec when activated.
// Spell: Runic Mastery (id: 105647)
// Handled in talents_unholy.go:applyRunicEmpowerementCorruption()
dk := agent.(DeathKnightAgent).GetDeathKnight()
setBonusAura.AttachBooleanToggle(dk.HasT13Dps4pc)
setBonusAura.ApplyOnGain(func(aura *core.Aura, sim *core.Simulation) {
dk.HasT13Dps4pc = true
})
setBonusAura.ApplyOnExpire(func(aura *core.Aura, sim *core.Simulation) {
dk.HasT13Dps4pc = false
})
},
},
})
Expand Down
22 changes: 19 additions & 3 deletions sim/druid/items.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ var ItemSetStormridersBattlegarb = core.NewItemSet(core.ItemSet{
2: func(agent core.Agent, setBonusAura *core.Aura) {
// Implemented in rake.go and lacerate.go
druid := agent.(DruidAgent).GetDruid()
setBonusAura.AttachBooleanToggle(druid.HasT11Feral2pBonus)
setBonusAura.ApplyOnGain(func(aura *core.Aura, sim *core.Simulation) {
druid.HasT11Feral2pBonus = true
})
setBonusAura.ApplyOnExpire(func(aura *core.Aura, sim *core.Simulation) {
druid.HasT11Feral2pBonus = false
})
},
4: func(agent core.Agent, setBonusAura *core.Aura) {
druid := agent.(DruidAgent).GetDruid()
Expand All @@ -42,7 +47,12 @@ var ItemSetStormridersBattlegarb = core.NewItemSet(core.ItemSet{
},
})

setBonusAura.AttachBooleanToggle(druid.HasT11Feral4pBonus)
setBonusAura.ApplyOnGain(func(aura *core.Aura, sim *core.Simulation) {
druid.HasT11Feral4pBonus = true
})
setBonusAura.ApplyOnExpire(func(aura *core.Aura, sim *core.Simulation) {
druid.HasT11Feral4pBonus = false
})
},
},
})
Expand Down Expand Up @@ -135,6 +145,13 @@ var ItemSetObsidianArborweaveBattlegarb = core.NewItemSet(core.ItemSet{
// Full implementation in berserk.go and barkskin.go
druid := agent.(DruidAgent).GetDruid()

setBonusAura.ApplyOnGain(func(aura *core.Aura, sim *core.Simulation) {
druid.HasT12Feral4pBonus = true
})
setBonusAura.ApplyOnExpire(func(aura *core.Aura, sim *core.Simulation) {
druid.HasT12Feral4pBonus = false
})

if !druid.InForm(Bear) {
return
}
Expand All @@ -152,7 +169,6 @@ var ItemSetObsidianArborweaveBattlegarb = core.NewItemSet(core.ItemSet{
druid.PseudoStats.BaseDodgeChance -= 0.1
},
})
setBonusAura.AttachBooleanToggle(druid.HasT12Feral4pBonus)
},
},
})
Expand Down
12 changes: 6 additions & 6 deletions sim/hunter/beast_mastery/TestBM.results
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ dps_results: {
dps_results: {
key: "TestBM-AllItems-Ahn'KaharBloodHunter'sBattlegear"
value: {
dps: 21867.14021
tps: 14079.13569
dps: 21498.78092
tps: 13858.47028
}
}
dps_results: {
Expand Down Expand Up @@ -641,8 +641,8 @@ dps_results: {
dps_results: {
key: "TestBM-AllItems-Flamewaker'sBattlegear"
value: {
dps: 26321.21677
tps: 16578.24976
dps: 26276.80777
tps: 16480.95918
}
}
dps_results: {
Expand Down Expand Up @@ -1061,8 +1061,8 @@ dps_results: {
dps_results: {
key: "TestBM-AllItems-Lightning-ChargedBattlegear"
value: {
dps: 24565.79227
tps: 15458.02105
dps: 25159.77352
tps: 16110.14663
}
}
dps_results: {
Expand Down
8 changes: 7 additions & 1 deletion sim/hunter/cata_items.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,13 @@ var ItemSetWyrmstalkerBattleGear = core.NewItemSet(core.ItemSet{
FloatValue: 0.1,
ClassMask: HunterSpellSteadyShot,
})
setBonusAura.AttachBooleanToggle(hunter.Has2pcT13)

setBonusAura.ApplyOnGain(func(aura *core.Aura, sim *core.Simulation) {
hunter.Has2pcT13 = true
})
setBonusAura.ApplyOnExpire(func(aura *core.Aura, sim *core.Simulation) {
hunter.Has2pcT13 = false
})
},
4: func(agent core.Agent, setBonusAura *core.Aura) {
hunter := agent.(HunterAgent).GetHunter()
Expand Down
16 changes: 8 additions & 8 deletions sim/hunter/marksmanship/TestMM.results
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ dps_results: {
dps_results: {
key: "TestMM-AllItems-Ahn'KaharBloodHunter'sBattlegear"
value: {
dps: 20508.13111
tps: 18476.67766
dps: 20290.45794
tps: 18285.35959
}
}
dps_results: {
Expand Down Expand Up @@ -641,8 +641,8 @@ dps_results: {
dps_results: {
key: "TestMM-AllItems-Flamewaker'sBattlegear"
value: {
dps: 24941.63332
tps: 22473.27177
dps: 24985.6938
tps: 22493.28679
}
}
dps_results: {
Expand Down Expand Up @@ -1061,8 +1061,8 @@ dps_results: {
dps_results: {
key: "TestMM-AllItems-Lightning-ChargedBattlegear"
value: {
dps: 23388.24481
tps: 21100.25418
dps: 22739.57703
tps: 20442.36869
}
}
dps_results: {
Expand Down Expand Up @@ -2158,8 +2158,8 @@ dps_results: {
dps_results: {
key: "TestMM-AllItems-WyrmstalkerBattlegear"
value: {
dps: 24191.33598
tps: 21766.91344
dps: 24506.21055
tps: 22081.788
}
}
dps_results: {
Expand Down
Loading

0 comments on commit 1b36516

Please sign in to comment.