Skip to content

Commit

Permalink
Merge pull request #438 from vigo2/vigo/step-by-step
Browse files Browse the repository at this point in the history
CritMultiplier replaced by DefenseType and CritDamageBonus
  • Loading branch information
vigo2 authored Mar 23, 2024
2 parents 22ba25b + 26604bd commit 38804e4
Show file tree
Hide file tree
Showing 181 changed files with 641 additions and 778 deletions.
14 changes: 7 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ module github.com/wowsims/sod
go 1.21

require (
github.com/google/go-cmp v0.5.8
github.com/google/uuid v1.3.1
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8
github.com/spf13/cobra v1.7.0
github.com/google/go-cmp v0.6.0
github.com/google/uuid v1.6.0
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c
github.com/spf13/cobra v1.8.0
github.com/tailscale/hujson v0.0.0-20221223112325-20486734a56a
golang.org/x/exp v0.0.0-20221028150844-83b7d23a625f
google.golang.org/protobuf v1.31.0
golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81
google.golang.org/protobuf v1.33.0
)

require (
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/sys v0.1.0 // indirect
golang.org/x/sys v0.18.0 // indirect
)
15 changes: 15 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,29 +1,44 @@
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4=
github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU=
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI=
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ=
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0=
github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/tailscale/hujson v0.0.0-20221223112325-20486734a56a h1:SJy1Pu0eH1C29XwJucQo73FrleVK6t4kYz4NVhp34Yw=
github.com/tailscale/hujson v0.0.0-20221223112325-20486734a56a/go.mod h1:DFSS3NAGHthKo1gTlmEcSBiZrRJXi28rLNd/1udP1c8=
golang.org/x/exp v0.0.0-20221028150844-83b7d23a625f h1:Al51T6tzvuh3oiwX11vex3QgJ2XTedFPGmbEVh8cdoc=
golang.org/x/exp v0.0.0-20221028150844-83b7d23a625f/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81 h1:6R2FC06FonbXQ8pK11/PDFY6N6LWlf9KlzibaCapmqc=
golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81/go.mod h1:CQ1k9gNrJ50XIzaKCRR2hssIjF07kZFEiieALBM/ARQ=
golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
2 changes: 1 addition & 1 deletion sim/_paladin/protection/protection.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func NewProtectionPaladin(character *core.Character, options *proto.Player) *Pro
prot.PaladinAura = protOptions.Options.Aura

prot.EnableAutoAttacks(prot, core.AutoAttackOptions{
MainHand: prot.WeaponFromMainHand(0), // Set crit multiplier later when we have targets.
MainHand: prot.WeaponFromMainHand(), // Set crit multiplier later when we have targets.
AutoSwingMelee: true,
})

Expand Down
2 changes: 1 addition & 1 deletion sim/_paladin/retribution/retribution.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func NewRetributionPaladin(character *core.Character, options *proto.Player) *Re
ret.PaladinAura = retOptions.Options.Aura

ret.EnableAutoAttacks(ret, core.AutoAttackOptions{
MainHand: ret.WeaponFromMainHand(0), // Set crit multiplier later when we have targets.
MainHand: ret.WeaponFromMainHand(), // Set crit multiplier later when we have targets.
AutoSwingMelee: true,
})

Expand Down
6 changes: 0 additions & 6 deletions sim/common/itemhelpers/weaponprocs.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,12 @@ func CreateWeaponProcDamage(itemId int32, itemName string, ppm float64, spellId
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: critMultiplier,
ThreatMultiplier: 1,
}

Expand Down
3 changes: 1 addition & 2 deletions sim/common/sod/enchant_effects.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ func init() {
procSpell := character.GetOrRegisterSpell(core.SpellConfig{
ActionID: core.ActionID{SpellID: 439164},
SpellSchool: core.SpellSchoolNature,
DefenseType: core.DefenseTypeMagic,
ProcMask: core.ProcMaskSpellDamage,

CritMultiplier: character.DefaultSpellCritMultiplier(),

DamageMultiplier: 1,
ThreatMultiplier: 1,

Expand Down
16 changes: 8 additions & 8 deletions sim/common/sod/item_effects/phase_2.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ func init() {
forkedLightning := character.RegisterSpell(core.SpellConfig{
ActionID: core.ActionID{SpellID: 11828},
SpellSchool: core.SpellSchoolNature,
DefenseType: core.DefenseTypeMagic,
ProcMask: core.ProcMaskEmpty,
Flags: core.SpellFlagNoOnCastComplete,

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

ApplyEffects: func(sim *core.Simulation, _ *core.Unit, spell *core.Spell) {
Expand Down Expand Up @@ -246,10 +246,10 @@ func init() {
return character.RegisterSpell(core.SpellConfig{
ActionID: core.ActionID{SpellID: 435169},
SpellSchool: core.SpellSchoolNature,
DefenseType: core.DefenseTypeMagic,
ProcMask: core.ProcMaskEmpty,

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

Dot: core.DotConfig{
Expand All @@ -262,7 +262,6 @@ func init() {
OnSnapshot: func(sim *core.Simulation, target *core.Unit, dot *core.Dot, isRollover bool) {
dot.SnapshotBaseDamage = 30
attackTable := dot.Spell.Unit.AttackTables[target.UnitIndex][dot.Spell.CastType]
dot.SnapshotCritChance = 0
dot.SnapshotAttackerMultiplier = dot.Spell.AttackerDamageMultiplier(attackTable)
},

Expand All @@ -288,11 +287,12 @@ func init() {
actionID := core.ActionID{SpellID: 434488}

fireStrike := character.GetOrRegisterSpell(core.SpellConfig{
ActionID: core.ActionID{SpellID: 434488},
SpellSchool: core.SpellSchoolFire,
ProcMask: core.ProcMaskSpellDamage,
ActionID: core.ActionID{SpellID: 434488},
SpellSchool: core.SpellSchoolFire,
DefenseType: core.DefenseTypeMagic,
ProcMask: core.ProcMaskSpellDamage,

DamageMultiplier: 1,
CritMultiplier: character.DefaultSpellCritMultiplier(),

ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
spell.CalcAndDealDamage(sim, target, 7.0, spell.OutcomeMagicHitAndCrit)
Expand Down Expand Up @@ -348,10 +348,10 @@ func init() {
return character.RegisterSpell(core.SpellConfig{
ActionID: core.ActionID{SpellID: 434841},
SpellSchool: core.SpellSchoolArcane,
DefenseType: core.DefenseTypeMagic,
ProcMask: core.ProcMaskEmpty,

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

ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
Expand Down
4 changes: 2 additions & 2 deletions sim/common/vanilla/enchant_effects.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ func init() {
procSpell := character.RegisterSpell(core.SpellConfig{
ActionID: core.ActionID{SpellID: 6296},
SpellSchool: core.SpellSchoolFire,
DefenseType: core.DefenseTypeMagic,
ProcMask: core.ProcMaskSpellDamage,

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

ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
Expand Down Expand Up @@ -98,10 +98,10 @@ func init() {
// procSpell := character.RegisterSpell(core.SpellConfig{
// ActionID: core.ActionID{SpellID: 13898},
// SpellSchool: core.SpellSchoolFire,
// DefenseType: core.DefenseTypeMagic,
// ProcMask: core.ProcMaskSpellDamage,

// DamageMultiplier: 1,
// CritMultiplier: character.DefaultSpellCritMultiplier(),
// ThreatMultiplier: 1,

// ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
Expand Down
2 changes: 1 addition & 1 deletion sim/common/vanilla/items_sets/melee_sets.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ var ItemSetStormshroud = core.NewItemSet(core.ItemSet{
proc := char.RegisterSpell(core.SpellConfig{
ActionID: core.ActionID{SpellID: 18980},
SpellSchool: core.SpellSchoolNature,
DefenseType: core.DefenseTypeMagic,
ProcMask: core.ProcMaskEmpty,

DamageMultiplier: 1,
CritMultiplier: char.DefaultSpellCritMultiplier(),
ThreatMultiplier: 1,

ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
Expand Down
15 changes: 8 additions & 7 deletions sim/common/vanilla/melee_items.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ func init() {
return character.RegisterSpell(core.SpellConfig{
ActionID: core.ActionID{SpellID: 18796},
SpellSchool: core.SpellSchoolFire,
DefenseType: core.DefenseTypeMagic,
ProcMask: core.ProcMaskEmpty,

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

Dot: core.DotConfig{
Expand Down Expand Up @@ -62,10 +62,10 @@ func init() {
return character.RegisterSpell(core.SpellConfig{
ActionID: core.ActionID{SpellID: 29638},
SpellSchool: core.SpellSchoolFire,
DefenseType: core.DefenseTypeRanged,
ProcMask: core.ProcMaskEmpty,

DamageMultiplier: 1,
CritMultiplier: character.DefaultMeleeCritMultiplier(),
ThreatMultiplier: 1,

ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
Expand All @@ -81,11 +81,12 @@ func init() {
auraActionID := core.ActionID{SpellID: 433801}

ravegerBladestormTickSpell := character.GetOrRegisterSpell(core.SpellConfig{
ActionID: tickActionID,
SpellSchool: core.SpellSchoolPhysical,
ProcMask: core.ProcMaskMeleeMHSpecial,
ActionID: tickActionID,
SpellSchool: core.SpellSchoolPhysical,
DefenseType: core.DefenseTypeMelee,
ProcMask: core.ProcMaskMeleeMHSpecial,

DamageMultiplier: 1,
CritMultiplier: character.DefaultMeleeCritMultiplier(),

ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
damage := 5.0 +
Expand Down Expand Up @@ -179,10 +180,10 @@ func init() {
singleTargetSpell := character.RegisterSpell(core.SpellConfig{
ActionID: procActionID.WithTag(1),
SpellSchool: core.SpellSchoolNature,
DefenseType: core.DefenseTypeMagic,
ProcMask: core.ProcMaskEmpty,

DamageMultiplier: 1,
CritMultiplier: character.DefaultSpellCritMultiplier(),
ThreatMultiplier: 0.5,

ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
Expand Down
Loading

0 comments on commit 38804e4

Please sign in to comment.