From ff41ffb781c70233179cdd1755aeff1fd322ab87 Mon Sep 17 00:00:00 2001 From: Kayla Glick Date: Mon, 2 Sep 2024 21:27:16 -0400 Subject: [PATCH] update purifying power code, ZG 5-set code --- sim/paladin/exorcism.go | 17 ++++++----------- sim/paladin/holy_shock.go | 4 +--- sim/paladin/holy_wrath.go | 6 +----- sim/paladin/item_sets_pve.go | 30 ++++++++++-------------------- sim/paladin/paladin.go | 24 ++++++++++++++---------- sim/paladin/runes.go | 16 ++++++++++++++-- 6 files changed, 46 insertions(+), 51 deletions(-) diff --git a/sim/paladin/exorcism.go b/sim/paladin/exorcism.go index 4342809b90..70665019a6 100644 --- a/sim/paladin/exorcism.go +++ b/sim/paladin/exorcism.go @@ -37,10 +37,6 @@ func (paladin *Paladin) registerExorcism() { Duration: time.Second * 15, } - if paladin.hasRune(proto.PaladinRune_RuneWristPurifyingPower) { - paladin.exorcismCooldown.Duration /= 2 - } - for i, rank := range ranks { rank := rank if paladin.Level < rank.level { @@ -50,7 +46,7 @@ func (paladin *Paladin) registerExorcism() { minDamage := rank.minDamage + float64(min(paladin.Level, rank.scaleLevel)-rank.level)*rank.scale maxDamage := rank.maxDamage + float64(min(paladin.Level, rank.scaleLevel)-rank.level)*rank.scale - paladin.RegisterSpell(core.SpellConfig{ + spell := paladin.RegisterSpell(core.SpellConfig{ ActionID: core.ActionID{SpellID: rank.spellID}, SpellSchool: core.SpellSchoolHoly, DefenseType: core.DefenseTypeMagic, @@ -62,7 +58,7 @@ func (paladin *Paladin) registerExorcism() { SpellCode: SpellCode_PaladinExorcism, ManaCost: core.ManaCostOptions{ - FlatCost: rank.manaCost, + FlatCost: rank.manaCost, Multiplier: core.TernaryInt32(paladin.hasRune(proto.PaladinRune_RuneFeetTheArtOfWar), 20, 100), }, @@ -73,7 +69,6 @@ func (paladin *Paladin) registerExorcism() { CD: *paladin.exorcismCooldown, }, - DamageMultiplier: 1, ThreatMultiplier: 1, @@ -84,9 +79,7 @@ func (paladin *Paladin) registerExorcism() { }, ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) { - baseDamage := sim.Roll(minDamage, maxDamage) - - var bonusCrit float64 + bonusCrit := 0.0 if hasExorcist && (target.MobType == proto.MobType_MobTypeDemon || target.MobType == proto.MobType_MobTypeUndead) { bonusCrit += 100 * core.CritRatingPerCritChance } @@ -95,9 +88,11 @@ func (paladin *Paladin) registerExorcism() { } spell.BonusCritRating += bonusCrit - spell.CalcAndDealDamage(sim, target, baseDamage, spell.OutcomeMagicHitAndCrit) + spell.CalcAndDealDamage(sim, target, sim.Roll(minDamage, maxDamage), spell.OutcomeMagicHitAndCrit) spell.BonusCritRating -= bonusCrit }, }) + + paladin.exorcism = append(paladin.exorcism, spell) } } diff --git a/sim/paladin/holy_shock.go b/sim/paladin/holy_shock.go index fee6363b4a..a8fdf0e304 100644 --- a/sim/paladin/holy_shock.go +++ b/sim/paladin/holy_shock.go @@ -67,7 +67,7 @@ func (paladin *Paladin) registerHolyShock() { SpellCode: SpellCode_PaladinHolyShock, ManaCost: core.ManaCostOptions{ - FlatCost: rank.manaCost, + FlatCost: rank.manaCost, Multiplier: manaCostMultiplier, }, @@ -78,7 +78,6 @@ func (paladin *Paladin) registerHolyShock() { CD: *paladin.holyShockCooldown, }, - DamageMultiplier: damageMultiplier, ThreatMultiplier: 1, BonusCoefficient: 0.429, @@ -95,7 +94,6 @@ func (paladin *Paladin) registerHolyShock() { if hasInfusionOfLight && result.Outcome.Matches(core.OutcomeCrit) { paladin.AddMana(sim, rank.manaCost, manaMetrics) paladin.holyShockCooldown.Reset() - //paladin.exorcismCooldown.Reset() } }, }) diff --git a/sim/paladin/holy_wrath.go b/sim/paladin/holy_wrath.go index 14ba28ca0e..422e2bddf6 100644 --- a/sim/paladin/holy_wrath.go +++ b/sim/paladin/holy_wrath.go @@ -31,10 +31,6 @@ func (paladin *Paladin) registerHolyWrath() { hasPurifyingPower := paladin.hasRune(proto.PaladinRune_RuneWristPurifyingPower) hasWrath := paladin.hasRune(proto.PaladinRune_RuneHeadWrath) - if hasPurifyingPower { - cd.Duration /= 2 - } - var results []*core.SpellResult for i, rank := range ranks { @@ -47,6 +43,7 @@ func (paladin *Paladin) registerHolyWrath() { maxDamage := rank.maxDamage + float64(min(paladin.Level, rank.scaleLevel)-rank.level)*rank.scale paladin.GetOrRegisterSpell(core.SpellConfig{ + SpellCode: SpellCode_PaladinHolyWrath, ActionID: core.ActionID{SpellID: rank.spellID}, SpellSchool: core.SpellSchoolHoly, DefenseType: core.DefenseTypeMagic, @@ -68,7 +65,6 @@ func (paladin *Paladin) registerHolyWrath() { CD: cd, }, - DamageMultiplier: 1, ThreatMultiplier: 1, BonusCoefficient: 0.19, diff --git a/sim/paladin/item_sets_pve.go b/sim/paladin/item_sets_pve.go index aa4ae967ab..9124a1c168 100644 --- a/sim/paladin/item_sets_pve.go +++ b/sim/paladin/item_sets_pve.go @@ -4,7 +4,6 @@ import ( "time" "github.com/wowsims/sod/sim/core" - "github.com/wowsims/sod/sim/core/proto" "github.com/wowsims/sod/sim/core/stats" ) @@ -22,7 +21,7 @@ var ItemSetObsessedProphetsPlate = core.NewItemSet(core.ItemSet{ }, 3: func(agent core.Agent) { c := agent.GetCharacter() - c.PseudoStats.SchoolBonusCritChance[stats.SchoolIndexHoly] += 3 * core.SpellCritRatingPerCritChance + c.PseudoStats.SchoolBonusCritChance[stats.SchoolIndexHoly] += 3 * core.SpellCritRatingPerCritChance }, }, }) @@ -133,11 +132,11 @@ var ItemSetFreethinkersArmor = core.NewItemSet(core.ItemSet{ 2: func(agent core.Agent) { c := agent.GetCharacter() c.AddStats(stats.Stats{ - stats.HolyPower: 14, + stats.HolyPower: 14, }) }, 3: func(agent core.Agent) { - //Increases damage done by your holy shock spell by 50% + // Increases damage done by your holy shock spell by 50% paladin := agent.GetCharacter() paladin.OnSpellRegistered(func(spell *core.Spell) { if spell.SpellCode == SpellCode_PaladinHolyShock { @@ -148,26 +147,18 @@ var ItemSetFreethinkersArmor = core.NewItemSet(core.ItemSet{ 5: func(agent core.Agent) { // Reduce cooldown of Exorcism by 3 seconds paladin := agent.(PaladinAgent).GetPaladin() - paladin.OnSpellRegistered(func(spell *core.Spell) { - if spell.SpellCode == SpellCode_PaladinExorcism { - paladin.exorcismCooldown = &core.Cooldown{ - Timer: paladin.NewTimer(), - Duration: time.Second * 15, - } - - if paladin.hasRune(proto.PaladinRune_RuneWristPurifyingPower) { - paladin.exorcismCooldown.Duration /= 2 + paladin.RegisterAura(core.Aura{ + Label: "S03 - Item - ZG - Paladin - Caster 5P Bonus", + OnInit: func(aura *core.Aura, sim *core.Simulation) { + for _, spell := range paladin.exorcism { + spell.CD.Duration -= time.Second * 3 } - paladin.exorcismCooldown.Duration -= time.Second * 3 - - spell.CD = *paladin.exorcismCooldown - } + }, }) }, }, }) - var ItemSetMercifulJudgement = core.NewItemSet(core.ItemSet{ Name: "Merciful Judgement", Bonuses: map[int32]core.ApplyEffect{ @@ -193,7 +184,6 @@ var ItemSetMercifulJudgement = core.NewItemSet(core.ItemSet{ // While you are not your Beacon of Light target, your Beacon of Light target is also healed by 100% of the damage you deal // with Consecration, Exorcism, Holy Shock, Holy Wrath, and Hammer of Wrath // No need to Sim - }, }, -}) \ No newline at end of file +}) diff --git a/sim/paladin/paladin.go b/sim/paladin/paladin.go index 78b6dcb9c0..296ff2ee31 100644 --- a/sim/paladin/paladin.go +++ b/sim/paladin/paladin.go @@ -12,12 +12,17 @@ import ( var TalentTreeSizes = [3]int{14, 15, 15} const ( - SpellFlag_RV = core.SpellFlagAgentReserved1 + SpellFlag_RV = core.SpellFlagAgentReserved1 +) + +const ( SpellCode_PaladinNone = iota + + SpellCode_PaladinExorcism SpellCode_PaladinHolyShock + SpellCode_PaladinHolyWrath SpellCode_PaladinJudgementOfCommand SpellCode_PaladinConsecration - SpellCode_PaladinExorcism ) type Paladin struct { @@ -42,11 +47,12 @@ type Paladin struct { spellsJotC [6]*core.Spell // Active abilities and shared cooldowns that are externally manipulated. - exorcismCooldown *core.Cooldown holyShockCooldown *core.Cooldown - judgement *core.Spell - divineStorm *core.Spell + exorcismCooldown *core.Cooldown crusaderStrike *core.Spell + divineStorm *core.Spell + exorcism []*core.Spell + judgement *core.Spell rv *core.Spell // highest rank seal spell if available @@ -112,7 +118,7 @@ func NewPaladin(character *core.Character, options *proto.Player, paladinOptions paladin := &Paladin{ Character: *character, Talents: &proto.PaladinTalents{}, - Options: paladinOptions, + Options: paladinOptions, } core.FillTalentsProto(paladin.Talents.ProtoReflect(), options.TalentsString, TalentTreeSizes) @@ -156,7 +162,7 @@ func (paladin *Paladin) registerStopAttackMacros() { if paladin.divineStorm != nil && paladin.Options.IsUsingDivineStormStopAttack { paladin.divineStorm.Flags |= core.SpellFlagBatchStopAttackMacro } - + if paladin.crusaderStrike != nil && paladin.Options.IsUsingCrusaderStrikeStopAttack { paladin.crusaderStrike.Flags |= core.SpellFlagBatchStopAttackMacro } @@ -170,7 +176,7 @@ func (paladin *Paladin) registerStopAttackMacros() { paladin.spellsJoR[i].Flags |= core.SpellFlagBatchStopAttackMacro } } - + for i, v := range paladin.spellsJoC { if v != nil && paladin.Options.IsUsingJudgementStopAttack { paladin.spellsJoC[i].Flags |= core.SpellFlagBatchStopAttackMacro @@ -221,5 +227,3 @@ func (paladin *Paladin) getLibramSealCostReduction() float64 { } return 0 } - - diff --git a/sim/paladin/runes.go b/sim/paladin/runes.go index 38f61c88e3..c6c42cd77a 100644 --- a/sim/paladin/runes.go +++ b/sim/paladin/runes.go @@ -20,13 +20,13 @@ func (paladin *Paladin) ApplyRunes() { paladin.registerHammerOfTheRighteous() // "RuneWristImprovedHammerOfWrath" is handled Hammer of Wrath - // "RuneWristPurifyingPower" is handled in Exorcism + paladin.applyPurifyingPower() } func (paladin *Paladin) registerFanaticism() { if paladin.hasRune(proto.PaladinRune_RuneHeadFanaticism) { paladin.PseudoStats.SchoolBonusCritChance[stats.SchoolIndexHoly] += 18 - } + } } func (paladin *Paladin) registerTheArtOfWar() { @@ -163,3 +163,15 @@ func (paladin *Paladin) registerGuardedByTheLight() { }, }) } + +func (paladin *Paladin) applyPurifyingPower() { + if !paladin.hasRune(proto.PaladinRune_RuneWristPurifyingPower) { + return + } + + paladin.OnSpellRegistered(func(spell *core.Spell) { + if spell.SpellCode == SpellCode_PaladinExorcism || spell.SpellCode == SpellCode_PaladinHolyWrath { + spell.CD.Duration /= 2 + } + }) +}