Skip to content

Commit

Permalink
Merge pull request #1 from wowsims/kg/exorcism-cooldown
Browse files Browse the repository at this point in the history
update purifying power code, ZG 5-set code
  • Loading branch information
mlizard32 authored Sep 3, 2024
2 parents edb36e9 + ff41ffb commit c3d70d3
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 51 deletions.
17 changes: 6 additions & 11 deletions sim/paladin/exorcism.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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,
Expand All @@ -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),
},

Expand All @@ -73,7 +69,6 @@ func (paladin *Paladin) registerExorcism() {
CD: *paladin.exorcismCooldown,
},


DamageMultiplier: 1,
ThreatMultiplier: 1,

Expand All @@ -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
}
Expand All @@ -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)
}
}
4 changes: 1 addition & 3 deletions sim/paladin/holy_shock.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (paladin *Paladin) registerHolyShock() {
SpellCode: SpellCode_PaladinHolyShock,

ManaCost: core.ManaCostOptions{
FlatCost: rank.manaCost,
FlatCost: rank.manaCost,
Multiplier: manaCostMultiplier,
},

Expand All @@ -78,7 +78,6 @@ func (paladin *Paladin) registerHolyShock() {
CD: *paladin.holyShockCooldown,
},


DamageMultiplier: damageMultiplier,
ThreatMultiplier: 1,
BonusCoefficient: 0.429,
Expand All @@ -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()
}
},
})
Expand Down
6 changes: 1 addition & 5 deletions sim/paladin/holy_wrath.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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,
Expand All @@ -68,7 +65,6 @@ func (paladin *Paladin) registerHolyWrath() {
CD: cd,
},


DamageMultiplier: 1,
ThreatMultiplier: 1,
BonusCoefficient: 0.19,
Expand Down
30 changes: 10 additions & 20 deletions sim/paladin/item_sets_pve.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand All @@ -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
},
},
})
Expand Down Expand Up @@ -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 {
Expand All @@ -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{
Expand All @@ -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

},
},
})
})
24 changes: 14 additions & 10 deletions sim/paladin/paladin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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
}
Expand All @@ -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
Expand Down Expand Up @@ -221,5 +227,3 @@ func (paladin *Paladin) getLibramSealCostReduction() float64 {
}
return 0
}


16 changes: 14 additions & 2 deletions sim/paladin/runes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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
}
})
}

0 comments on commit c3d70d3

Please sign in to comment.