Skip to content

Commit

Permalink
[common] CreateWeaponProcDamage() is now using the proper critMultipl…
Browse files Browse the repository at this point in the history
…ier for non-magic procs

[common] "Shocking" equipment now always deals non-crit self-damage
[common, core] Dismantle and Dragonbreath Chili procs can now properly crit, and Explosive use spell crit multiplier

[hunter, warrior] next attack queue spells no longer have a ProcMask set

[priest] Mind Sear and Shadow Word: Death can now crit

[rogue] Envenom and Shuriken Toss were wrongly benefiting from Lethality
  • Loading branch information
vigo2 committed Mar 20, 2024
1 parent 53d20c2 commit 3ce9c37
Show file tree
Hide file tree
Showing 23 changed files with 85 additions and 78 deletions.
11 changes: 7 additions & 4 deletions sim/_paladin/talents.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,15 @@ func (paladin *Paladin) applyArdentDefender() {

// Spell to heal you when AD has procced; fire this before fatal damage so that a Death is not detected
procHeal := paladin.RegisterSpell(core.SpellConfig{
ActionID: core.ActionID{SpellID: 66233},
SpellSchool: core.SpellSchoolHoly,
ProcMask: core.ProcMaskSpellHealing,
CritMultiplier: 1, // Assuming this can't really crit?
ActionID: core.ActionID{SpellID: 66233},
SpellSchool: core.SpellSchoolHoly,
ProcMask: core.ProcMaskSpellHealing,

CritMultiplier: 1, // Assuming this can't really crit?

ThreatMultiplier: 0.25,
DamageMultiplier: 1,

ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
spell.CalcAndDealHealing(sim, &paladin.Unit, ardentHealAmount*paladin.MaxHealth(), spell.OutcomeHealingCrit)
},
Expand Down
8 changes: 7 additions & 1 deletion sim/common/itemhelpers/weaponprocs.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,22 @@ import (
// Create a simple weapon proc that deals damage.
func CreateWeaponProcDamage(itemId int32, itemName string, ppm float64, spellId int32, school core.SpellSchool,
dmgMin float64, dmgRange float64, bonusCoef float64, defType core.DefenseType) {

core.NewItemEffect(itemId, func(agent core.Agent) {
character := agent.GetCharacter()

critMultiplier := character.DefaultSpellCritMultiplier()
if defType == core.DefenseTypeMelee || defType == core.DefenseTypeRanged {
critMultiplier = character.DefaultMeleeCritMultiplier()
}

sc := core.SpellConfig{
ActionID: core.ActionID{SpellID: spellId},
SpellSchool: school,
ProcMask: core.ProcMaskEmpty,

DamageMultiplier: 1,
CritMultiplier: character.DefaultSpellCritMultiplier(),
CritMultiplier: critMultiplier,
ThreatMultiplier: 1,
}

Expand Down
8 changes: 2 additions & 6 deletions sim/common/sod/crafted/phase_2.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,9 @@ func init() {
},

DamageMultiplier: 1,
CritMultiplier: 1,

ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
// TODO: Verify if this can crit
result := spell.CalcDamage(sim, &character.Unit, sim.Roll(343, 757), spell.OutcomeMagicCrit)
result := spell.CalcDamage(sim, &character.Unit, sim.Roll(343, 757), spell.OutcomeAlwaysHit)
if sim.Log != nil {
character.Log(sim, "Took %.1f damage from Gneuro-Logical Shock.", result.Damage)
}
Expand Down Expand Up @@ -264,11 +262,9 @@ func init() {
},

DamageMultiplier: 1,
CritMultiplier: 1,

ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
// TODO: Verify if this can crit
result := spell.CalcDamage(sim, &character.Unit, sim.Roll(312, 668), spell.OutcomeMagicCrit)
result := spell.CalcDamage(sim, &character.Unit, sim.Roll(312, 668), spell.OutcomeAlwaysHit)
character.RemoveHealth(sim, result.Damage)
buffAura.Activate(sim)
},
Expand Down
13 changes: 5 additions & 8 deletions sim/common/sod/enchant_effects.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,18 @@ func init() {
core.NewEnchantEffect(7210, func(agent core.Agent) {
character := agent.GetCharacter()

procChance := 0.10
baseDamageLow := 60.0
baseDamageHigh := 90.0

procSpell := character.GetOrRegisterSpell(core.SpellConfig{
ActionID: core.ActionID{SpellID: 439164},
SpellSchool: core.SpellSchoolNature,
ProcMask: core.ProcMaskSpellDamage,

CritMultiplier: character.DefaultSpellCritMultiplier(),

DamageMultiplier: 1,
CritMultiplier: 1,
ThreatMultiplier: 1,

ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
spell.CalcAndDealDamage(sim, target, sim.Roll(baseDamageLow, baseDamageHigh), spell.OutcomeMagicHitAndCrit)
spell.CalcAndDealDamage(sim, target, sim.Roll(60, 90), spell.OutcomeMagicHitAndCrit)
},
})

Expand Down Expand Up @@ -74,7 +71,7 @@ func init() {
}

if spell.ProcMask.Matches(core.ProcMaskSpellDamage) {
if sim.RandomFloat("Dismantle") < procChance {
if sim.RandomFloat("Dismantle") < 0.10 {
// Spells proc both Main-Hand and Off-Hand if both are enchanted
if character.GetMHWeapon() != nil && character.GetMHWeapon().Enchant.EffectID == 7210 {
procSpell.Cast(sim, result.Target)
Expand All @@ -83,7 +80,7 @@ func init() {
procSpell.Cast(sim, result.Target)
}
}
} else if sim.RandomFloat("Dismantle") < procChance {
} else if sim.RandomFloat("Dismantle") < 0.10 {
// Physical hits only proc on the hand that was hit with
procSpell.Cast(sim, result.Target)
}
Expand Down
23 changes: 14 additions & 9 deletions sim/core/consumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func applyConsumeEffects(agent Agent, partyBuffs *proto.PartyBuffs) {
}

if consumes.DragonBreathChili {
MakePermanent(DragonBreathChiliAura(&character.Unit))
MakePermanent(DragonBreathChiliAura(character))
}

if consumes.AgilityElixir != proto.AgilityElixir_AgilityElixirUnknown {
Expand Down Expand Up @@ -464,26 +464,27 @@ func registerExplosivesCD(agent Agent, consumes *proto.Consumes) {
}
}

func DragonBreathChiliAura(unit *Unit) *Aura {
func DragonBreathChiliAura(character *Character) *Aura {
baseDamage := 60.0
procChance := .05

procSpell := unit.RegisterSpell(SpellConfig{
procSpell := character.RegisterSpell(SpellConfig{
ActionID: ActionID{SpellID: 15851},
SpellSchool: SpellSchoolFire,
ProcMask: ProcMaskEmpty,
Flags: SpellFlagNone,

CritMultiplier: character.DefaultSpellCritMultiplier(),

DamageMultiplier: 1,
CritMultiplier: 1,
ThreatMultiplier: 1,

ApplyEffects: func(sim *Simulation, target *Unit, spell *Spell) {
spell.CalcAndDealDamage(sim, target, baseDamage+spell.SpellDamage(), spell.OutcomeMagicHitAndCrit)
},
})

aura := unit.GetOrRegisterAura(Aura{
aura := character.GetOrRegisterAura(Aura{
Label: "Dragonbreath Chili",
ActionID: ActionID{SpellID: 15852},
Duration: NeverExpires,
Expand Down Expand Up @@ -529,9 +530,11 @@ func (character *Character) newBasicExplosiveSpellConfig(sharedTimer *Timer, act
},

// Explosives always have 1% resist chance, so just give them hit cap.
BonusHitRating: 100 * SpellHitRatingPerHitChance,
BonusHitRating: 100 * SpellHitRatingPerHitChance,

CritMultiplier: character.DefaultSpellCritMultiplier(),

DamageMultiplier: 1,
CritMultiplier: 2,
ThreatMultiplier: 1,

ApplyEffects: func(sim *Simulation, target *Unit, spell *Spell) {
Expand Down Expand Up @@ -584,9 +587,11 @@ func (character *Character) newRadiationBombSpellConfig(sharedTimer *Timer, acti
},

// Explosives always have 1% resist chance, so just give them hit cap.
BonusHitRating: 100 * SpellHitRatingPerHitChance,
BonusHitRating: 100 * SpellHitRatingPerHitChance,

CritMultiplier: character.DefaultSpellCritMultiplier(),

DamageMultiplier: 1,
CritMultiplier: 2,
ThreatMultiplier: 1,

// TODO: This should use another spell (443813) as the DoT
Expand Down
3 changes: 2 additions & 1 deletion sim/encounters/naxxramas/patchwerk10_ai.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ func (ai *Patchwerk10AI) registerHatefulStrikeSpell(target *core.Target) {
},
},

CritMultiplier: 1,

DamageMultiplier: 1,
CritMultiplier: 1,

ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
baseDamage := sim.Roll(27750, 32250)
Expand Down
3 changes: 2 additions & 1 deletion sim/encounters/naxxramas/patchwerk25_ai.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ func (ai *Patchwerk25AI) registerHatefulStrikeSpell(target *core.Target) {
},
},

CritMultiplier: 1,

DamageMultiplier: 1,
CritMultiplier: 1,

ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
baseDamage := sim.Roll(79000, 81000)
Expand Down
6 changes: 2 additions & 4 deletions sim/hunter/raptor_strike.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,8 @@ func (hunter *Hunter) makeQueueSpellsAndAura(srcSpell *core.Spell) *core.Spell {
})

queueSpell := hunter.RegisterSpell(core.SpellConfig{
ActionID: srcSpell.WithTag(1),
SpellSchool: core.SpellSchoolPhysical,
ProcMask: core.ProcMaskMeleeMHSpecial,
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagAPL,
ActionID: srcSpell.WithTag(1),
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagAPL,

ExtraCastCondition: func(sim *core.Simulation, target *core.Unit) bool {
return hunter.curQueueAura != queueAura &&
Expand Down
2 changes: 1 addition & 1 deletion sim/hunter/serpent_sting.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (hunter *Hunter) getSerpentStingConfig(rank int) core.SpellConfig {

ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
// Reports of Bow of Searing Arrows proccing from SS applications means it has a hit event
result := spell.CalcDamage(sim, target, 0, spell.OutcomeRangedHit)
result := spell.CalcOutcome(sim, target, spell.OutcomeRangedHit)

spell.WaitTravelTime(sim, func(s *core.Simulation) {
spell.DealOutcome(sim, result)
Expand Down
5 changes: 2 additions & 3 deletions sim/priest/devouring_plague.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,9 @@ func (priest *Priest) getDevouringPlagueConfig(rank int, cdTimer *core.Timer) co
},
},

BonusHitRating: priest.shadowHitModifier(),
BonusCritRating: 0,
BonusHitRating: priest.shadowHitModifier(),

DamageMultiplier: 1,
CritMultiplier: 1,
ThreatMultiplier: priest.shadowThreatModifier(),

Dot: core.DotConfig{
Expand Down
10 changes: 4 additions & 6 deletions sim/priest/mind_flay.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,9 @@ func (priest *Priest) newMindFlaySpellConfig(rank int, tickIdx int32) core.Spell
},
},

BonusHitRating: priest.shadowHitModifier(),
BonusCritRating: 0,
BonusHitRating: priest.shadowHitModifier(),

DamageMultiplier: 1,
CritMultiplier: 1,

Dot: core.DotConfig{
Aura: core.Aura{
Expand Down Expand Up @@ -119,10 +118,9 @@ func (priest *Priest) newMindFlayTickSpell(rank int, numTicks int32) *core.Spell

Rank: rank,

BonusHitRating: 1, // Not an independent hit once initial lands
BonusCritRating: 0,
BonusHitRating: 1, // Not an independent hit once initial lands

DamageMultiplier: priest.forceOfWillDamageModifier() * priest.darknessDamageModifier(),
CritMultiplier: 1.0,
ThreatMultiplier: priest.shadowThreatModifier(),

ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
Expand Down
17 changes: 9 additions & 8 deletions sim/priest/mind_sear.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,9 @@ func (priest *Priest) newMindSearSpellConfig(tickIdx int32) core.SpellConfig {
},
},

BonusHitRating: priest.shadowHitModifier(),
BonusCritRating: 0,
BonusHitRating: priest.shadowHitModifier(),

DamageMultiplier: 1,
CritMultiplier: 1,

Dot: core.DotConfig{
IsAOE: true,
Expand Down Expand Up @@ -89,7 +88,7 @@ func (priest *Priest) newMindSearSpellConfig(tickIdx int32) core.SpellConfig {

func (priest *Priest) newMindSearTickSpell(numTicks int32) *core.Spell {
level := float64(priest.Level)
baseDamage := (9.456667 + 0.635108*level + 0.039063*level*level)
baseDamage := 9.456667 + 0.635108*level + 0.039063*level*level
baseDamageLow := baseDamage * .7 * priest.darknessDamageModifier()
baseDamageHigh := baseDamage * .78 * priest.darknessDamageModifier()
spellCoeff := 0.15 // classic penalty for mf having a slow effect
Expand All @@ -99,15 +98,17 @@ func (priest *Priest) newMindSearTickSpell(numTicks int32) *core.Spell {
SpellSchool: core.SpellSchoolShadow,
ProcMask: core.ProcMaskProc | core.ProcMaskNotInSpellbook,

BonusHitRating: 1, // Not an independent hit once initial lands
BonusCritRating: priest.forceOfWillCritRating(),
BonusHitRating: 1, // Not an independent hit once initial lands
BonusCritRating: priest.forceOfWillCritRating(),

CritMultiplier: priest.DefaultSpellCritMultiplier(),

DamageMultiplier: priest.forceOfWillDamageModifier(),
CritMultiplier: 1,
ThreatMultiplier: priest.shadowThreatModifier(),

ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
damage := sim.Roll(baseDamageLow, baseDamageHigh) + (spellCoeff * spell.SpellDamage())
result := spell.CalcAndDealDamage(sim, target, damage, spell.OutcomeMagicHit)
result := spell.CalcAndDealDamage(sim, target, damage, spell.OutcomeMagicHitAndCrit)

if result.Landed() {
priest.AddShadowWeavingStack(sim, target)
Expand Down
8 changes: 5 additions & 3 deletions sim/priest/shadow_word_death.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ func (priest *Priest) registerShadowWordDeathSpell() {
},
},

BonusHitRating: priest.shadowHitModifier(),
BonusCritRating: priest.forceOfWillCritRating(),
BonusHitRating: priest.shadowHitModifier(),
BonusCritRating: priest.forceOfWillCritRating(),

CritMultiplier: priest.DefaultSpellCritMultiplier(),

DamageMultiplier: priest.forceOfWillDamageModifier(),
CritMultiplier: 1,
ThreatMultiplier: priest.shadowThreatModifier(),

ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
Expand Down
3 changes: 1 addition & 2 deletions sim/priest/shadow_word_pain.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,8 @@ func (priest *Priest) getShadowWordPainConfig(rank int) core.SpellConfig {
},

BonusHitRating: priest.shadowHitModifier(),
BonusCritRating: 0,
DamageMultiplier: priest.forceOfWillDamageModifier() * priest.darknessDamageModifier(),
CritMultiplier: 1,

ThreatMultiplier: priest.shadowThreatModifier(),

Dot: core.DotConfig{
Expand Down
5 changes: 2 additions & 3 deletions sim/priest/void_plague.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@ func (priest *Priest) getVoidPlagueConfig() core.SpellConfig {
},
},

BonusHitRating: priest.shadowHitModifier(),
BonusCritRating: priest.forceOfWillCritRating(),
BonusHitRating: priest.shadowHitModifier(),

DamageMultiplier: priest.forceOfWillDamageModifier() * priest.darknessDamageModifier(),
CritMultiplier: 1,
ThreatMultiplier: priest.shadowThreatModifier(),

Dot: core.DotConfig{
Expand Down
3 changes: 2 additions & 1 deletion sim/rogue/envenom.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ func (rogue *Rogue) registerEnvenom() {
return rogue.ComboPoints() > 0 && target.GetAuraByID(rogue.DeadlyPoison[0].ActionID).IsActive()
},

CritMultiplier: rogue.MeleeCritMultiplier(false),

DamageMultiplier: rogue.getPoisonDamageMultiplier(),
CritMultiplier: rogue.MeleeCritMultiplier(true),
ThreatMultiplier: 1,

ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
Expand Down
3 changes: 2 additions & 1 deletion sim/rogue/shuriken_toss.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ func (rogue *Rogue) registerShurikenTossSpell() {
IgnoreHaste: true,
},

CritMultiplier: rogue.RangedCritMultiplier(false),

DamageMultiplier: 1,
CritMultiplier: rogue.RangedCritMultiplier(true),
ThreatMultiplier: 1,

ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
Expand Down
13 changes: 8 additions & 5 deletions sim/shaman/ancestral_awakening.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@ func (shaman *Shaman) applyAncestralAwakening() {
}

shaman.AncestralAwakening = shaman.RegisterSpell(core.SpellConfig{
ActionID: core.ActionID{SpellID: int32(proto.ShamanRune_RuneFeetAncestralAwakening)},
SpellSchool: core.SpellSchoolNature,
ProcMask: core.ProcMaskSpellHealing,
Flags: core.SpellFlagHelpful | core.SpellFlagAPL,
ActionID: core.ActionID{SpellID: int32(proto.ShamanRune_RuneFeetAncestralAwakening)},
SpellSchool: core.SpellSchoolNature,
ProcMask: core.ProcMaskSpellHealing,
Flags: core.SpellFlagHelpful | core.SpellFlagAPL,

CritMultiplier: 1,

DamageMultiplier: 1 * (1 + .02*float64(shaman.Talents.Purification)),
CritMultiplier: 1,
ThreatMultiplier: 1,

ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
spell.CalcAndDealHealing(sim, target, shaman.ancestralHealingAmount, spell.OutcomeHealing)
},
Expand Down
Loading

0 comments on commit 3ce9c37

Please sign in to comment.