Skip to content

Commit

Permalink
Merge branch 'feature/move-disable-expertise-gemming-to-warrior-ui' of
Browse files Browse the repository at this point in the history
…https://github.com/1337LutZ/wowsims-wotlk into feature/move-disable-expertise-gemming-to-warrior-ui
  • Loading branch information
1337LutZ committed Sep 30, 2023
2 parents 6cdb3e0 + a6ec116 commit b91c60c
Show file tree
Hide file tree
Showing 39 changed files with 2,452 additions and 2,397 deletions.
Binary file modified assets/database/db.bin
Binary file not shown.
7 changes: 5 additions & 2 deletions assets/database/db.json
Original file line number Diff line number Diff line change
Expand Up @@ -10677,6 +10677,7 @@
{"id":26022,"name":"Pursuit of Justice","icon":"spell_holy_persuitofjustice"},
{"id":26023,"name":"Pursuit of Justice","icon":"spell_holy_persuitofjustice"},
{"id":26279,"name":"Stormshroud Gloves","icon":"inv_gauntlets_05"},
{"id":26297,"name":"Berserking","icon":"racial_troll_berserk"},
{"id":26889,"name":"Vanish","icon":"ability_vanish"},
{"id":26982,"name":"Rejuvenation","icon":"spell_nature_rejuvenation"},
{"id":27013,"name":"Insect Swarm","icon":"spell_nature_insectswarm"},
Expand Down Expand Up @@ -10719,6 +10720,7 @@
{"id":28574,"name":"Arcane Fortitude","icon":"spell_arcane_arcaneresilience"},
{"id":28592,"name":"Winter's Chill","icon":"spell_frost_chillingblast"},
{"id":28593,"name":"Winter's Chill","icon":"spell_frost_chillingblast"},
{"id":28730,"name":"Arcane Torrent","icon":"spell_shadow_teleport"},
{"id":28996,"name":"Elemental Warding","icon":"spell_nature_spiritarmor"},
{"id":28997,"name":"Elemental Warding","icon":"spell_nature_spiritarmor"},
{"id":28998,"name":"Elemental Warding","icon":"spell_nature_spiritarmor"},
Expand Down Expand Up @@ -11227,8 +11229,10 @@
{"id":42897,"name":"Arcane Blast","icon":"spell_arcane_blast"},
{"id":42914,"name":"Ice Lance","icon":"spell_frost_frostblast"},
{"id":42921,"name":"Arcane Explosion","icon":"spell_nature_wispsplode"},
{"id":42925,"name":"Flamestrike","icon":"spell_fire_selfdestruct"},
{"id":42926,"name":"Flamestrike","icon":"spell_fire_selfdestruct"},
{"id":42939,"name":"Blizzard","icon":"spell_frost_icestorm"},
{"id":42938,"name":"Blizzard","icon":"spell_frost_icestorm"},
{"id":42940,"name":"Blizzard","icon":"spell_frost_icestorm"},
{"id":42974,"name":"Enchant Weapon - Executioner","icon":"inv_enchant_formulasuperior_01"},
{"id":43002,"name":"Arcane Brilliance","icon":"spell_holy_arcaneintellect"},
{"id":43338,"name":"Shamanistic Focus","icon":"spell_nature_elementalabsorption"},
Expand Down Expand Up @@ -12177,7 +12181,6 @@
{"id":55236,"name":"Outbreak","icon":"spell_shadow_plaguecloud"},
{"id":55237,"name":"Outbreak","icon":"spell_shadow_plaguecloud"},
{"id":55243,"name":"Bracers of Deflection","icon":"inv_bracer_10"},
{"id":55268,"name":"Frost Strike","icon":"spell_deathknight_empowerruneblade2"},
{"id":55298,"name":"Vengeance Bindings","icon":"inv_bracer_09"},
{"id":55300,"name":"Righteous Gauntlets","icon":"inv_gauntlets_26"},
{"id":55301,"name":"Daunting Handguards","icon":"inv_gauntlets_26"},
Expand Down
8 changes: 4 additions & 4 deletions sim/common/wotlk/capacitors.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func init() {
MaxStacks: 3,
Trigger: core.ProcTrigger{
Callback: core.CallbackOnSpellHitDealt,
ProcMask: core.ProcMaskSpellOrProc | core.ProcMaskWeaponProc,
ProcMask: core.ProcMaskSpellOrProc | core.ProcMaskWeaponProc | core.ProcMaskSuppressedProc,
Outcome: core.OutcomeCrit,
ICD: time.Millisecond * 2000,
ActionID: core.ActionID{ItemID: 47182},
Expand All @@ -116,7 +116,7 @@ func init() {
MaxStacks: 3,
Trigger: core.ProcTrigger{
Callback: core.CallbackOnSpellHitDealt,
ProcMask: core.ProcMaskSpellOrProc | core.ProcMaskWeaponProc,
ProcMask: core.ProcMaskSpellOrProc | core.ProcMaskWeaponProc | core.ProcMaskSuppressedProc,
Outcome: core.OutcomeCrit,
ICD: time.Millisecond * 2000,
ActionID: core.ActionID{ItemID: 47188},
Expand All @@ -134,7 +134,7 @@ func init() {
MaxStacks: 3,
Trigger: core.ProcTrigger{
Callback: core.CallbackOnSpellHitDealt,
ProcMask: core.ProcMaskSpellOrProc | core.ProcMaskWeaponProc,
ProcMask: core.ProcMaskSpellOrProc | core.ProcMaskWeaponProc | core.ProcMaskSuppressedProc,
Outcome: core.OutcomeCrit,
ICD: time.Millisecond * 2000,
ActionID: core.ActionID{ItemID: 47316},
Expand All @@ -149,7 +149,7 @@ func init() {
MaxStacks: 3,
Trigger: core.ProcTrigger{
Callback: core.CallbackOnSpellHitDealt,
ProcMask: core.ProcMaskSpellOrProc | core.ProcMaskWeaponProc,
ProcMask: core.ProcMaskSpellOrProc | core.ProcMaskWeaponProc | core.ProcMaskSuppressedProc,
Outcome: core.OutcomeCrit,
ICD: time.Millisecond * 2000,
ActionID: core.ActionID{ItemID: 47477},
Expand Down
20 changes: 8 additions & 12 deletions sim/common/wotlk/nibelung.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,19 +102,15 @@ func MakeNibelungTriggerAura(agent core.Agent, isHeroic bool) {
})

core.MakeProcTriggerAura(&character.Unit, core.ProcTrigger{
Name: "Nibelung Proc",
Callback: core.CallbackOnCastComplete,
ProcMask: core.ProcMaskSpellOrProc,
Harmful: true,
ProcChance: 0.02,
ICD: time.Millisecond * 250,
ActionID: core.ActionID{SpellID: procSpellId},
Name: "Nibelung Proc",
Callback: core.CallbackOnCastComplete,
ProcMask: core.ProcMaskSpellOrProc,
ProcMaskExclude: core.ProcMaskNotInSpellbook,
Harmful: true,
ProcChance: 0.02,
ICD: time.Millisecond * 250,
ActionID: core.ActionID{SpellID: procSpellId},
Handler: func(sim *core.Simulation, spell *core.Spell, _ *core.SpellResult) {
// dummy proc spell can't proc nibelung
if spell == spell.Unit.GetDummyProcSpell() {
return
}

for _, petAgent := range character.PetAgents {
if valkyr, ok := petAgent.(*ValkyrPet); ok && !valkyr.IsEnabled() {
valkyr.registerSmite(isHeroic)
Expand Down
8 changes: 4 additions & 4 deletions sim/common/wotlk/stat_bonus_stacking.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ func init() {
Bonus: stats.Stats{stats.MeleeHaste: 57, stats.SpellHaste: 57},
CD: time.Minute * 2,
Callback: core.CallbackOnCastComplete,
ProcMask: core.ProcMaskSpellOrProc | core.ProcMaskWeaponProc,
ProcMask: core.ProcMaskSpellOrProc | core.ProcMaskWeaponProc | core.ProcMaskSuppressedProc,
})
newStackingStatBonusCD(StackingStatBonusCD{
Name: "Talisman of Volatile Power H",
Expand All @@ -377,7 +377,7 @@ func init() {
Bonus: stats.Stats{stats.MeleeHaste: 64, stats.SpellHaste: 64},
CD: time.Minute * 2,
Callback: core.CallbackOnCastComplete,
ProcMask: core.ProcMaskSpellOrProc | core.ProcMaskWeaponProc,
ProcMask: core.ProcMaskSpellOrProc | core.ProcMaskWeaponProc | core.ProcMaskSuppressedProc,
})
newStackingStatBonusCD(StackingStatBonusCD{
Name: "Fervor of the Frostborn",
Expand Down Expand Up @@ -434,7 +434,7 @@ func init() {
Bonus: stats.Stats{stats.MeleeHaste: 57, stats.SpellHaste: 57},
CD: time.Minute * 2,
Callback: core.CallbackOnCastComplete,
ProcMask: core.ProcMaskSpellOrProc | core.ProcMaskWeaponProc,
ProcMask: core.ProcMaskSpellOrProc | core.ProcMaskWeaponProc | core.ProcMaskSuppressedProc,
})
newStackingStatBonusCD(StackingStatBonusCD{
Name: "Fetish of Volatile Power H",
Expand All @@ -445,7 +445,7 @@ func init() {
Bonus: stats.Stats{stats.MeleeHaste: 64, stats.SpellHaste: 64},
CD: time.Minute * 2,
Callback: core.CallbackOnCastComplete,
ProcMask: core.ProcMaskSpellOrProc | core.ProcMaskWeaponProc,
ProcMask: core.ProcMaskSpellOrProc | core.ProcMaskWeaponProc | core.ProcMaskSuppressedProc,
})
newStackingStatBonusCD(StackingStatBonusCD{
Name: "Binding Stone",
Expand Down
1 change: 0 additions & 1 deletion sim/core/apl_actions_casting.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package core

import (
"fmt"

"github.com/wowsims/wotlk/sim/core/proto"
)

Expand Down
31 changes: 19 additions & 12 deletions sim/core/aura_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,19 @@ const (
type ProcHandler func(sim *Simulation, spell *Spell, result *SpellResult)

type ProcTrigger struct {
Name string
ActionID ActionID
Duration time.Duration
Callback AuraCallback
ProcMask ProcMask
SpellFlags SpellFlag
Outcome HitOutcome
Harmful bool
ProcChance float64
PPM float64
ICD time.Duration
Handler ProcHandler
Name string
ActionID ActionID
Duration time.Duration
Callback AuraCallback
ProcMask ProcMask
ProcMaskExclude ProcMask
SpellFlags SpellFlag
Outcome HitOutcome
Harmful bool
ProcChance float64
PPM float64
ICD time.Duration
Handler ProcHandler
}

func ApplyProcTriggerCallback(unit *Unit, aura *Aura, config ProcTrigger) {
Expand All @@ -62,6 +63,9 @@ func ApplyProcTriggerCallback(unit *Unit, aura *Aura, config ProcTrigger) {
if config.SpellFlags != SpellFlagNone && !spell.Flags.Matches(config.SpellFlags) {
return
}
if config.ProcMaskExclude != ProcMaskUnknown && spell.ProcMask.Matches(config.ProcMaskExclude) {
return
}
if config.ProcMask != ProcMaskUnknown && !spell.ProcMask.Matches(config.ProcMask) {
return
}
Expand Down Expand Up @@ -113,6 +117,9 @@ func ApplyProcTriggerCallback(unit *Unit, aura *Aura, config ProcTrigger) {
if config.ProcMask != ProcMaskUnknown && !spell.ProcMask.Matches(config.ProcMask) {
return
}
if config.ProcMaskExclude != ProcMaskUnknown && spell.ProcMask.Matches(config.ProcMaskExclude) {
return
}
if icd.Duration != 0 && !icd.IsReady(sim) {
return
}
Expand Down
4 changes: 2 additions & 2 deletions sim/core/cast.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ func (spell *Spell) makeCastFuncSimple() CastSuccessFunc {

if sim.Log != nil && !spell.Flags.Matches(SpellFlagNoLogs) {
spell.Unit.Log(sim, "Casting %s (Cost = %0.03f, Cast Time = %s, Effective Time = %s)",
spell.ActionID, 0, 0, 0)
spell.ActionID, 0.0, "0s", "0s")
spell.Unit.Log(sim, "Completed cast %s", spell.ActionID)
}

Expand All @@ -244,7 +244,7 @@ func (spell *Spell) makeCastFuncAutosOrProcs() CastSuccessFunc {
return func(sim *Simulation, target *Unit) bool {
if sim.Log != nil && !spell.Flags.Matches(SpellFlagNoLogs) {
spell.Unit.Log(sim, "Casting %s (Cost = %0.03f, Cast Time = %s, Effective Time = %s)",
spell.ActionID, 0, 0, 0)
spell.ActionID, 0.0, "0s", "0s")
spell.Unit.Log(sim, "Completed cast %s", spell.ActionID)
}

Expand Down
4 changes: 4 additions & 0 deletions sim/core/energy.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ func (unit *Unit) EnableEnergyBar(maxEnergy float64, onEnergyGain OnEnergyGain)
unit: unit,
maxEnergy: MaxFloat(100, maxEnergy),
onEnergyGain: func(sim *Simulation) {
if sim.CurrentTime < 0 {
return
}

if !sim.Options.Interactive && (!unit.IsWaitingForEnergy() || unit.DoneWaitingForEnergy(sim)) {
if unit.IsUsingAPL {
unit.Rotation.DoNextAction(sim)
Expand Down
4 changes: 4 additions & 0 deletions sim/core/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ const (
ProcMaskProc
// Mask for FT weapon and rogue poisons, seems to be spell procs from a weapon imbue
ProcMaskWeaponProc
// Mind Flay
ProcMaskNotInSpellbook
// Can proc Talisman of Volatile power, but nothing else?
ProcMaskSuppressedProc
)

const (
Expand Down
6 changes: 3 additions & 3 deletions sim/core/major_cooldown.go
Original file line number Diff line number Diff line change
Expand Up @@ -421,9 +421,9 @@ func (mcdm *majorCooldownManager) GetMajorCooldown(actionID ActionID) *MajorCool
return nil
}
func (mcdm *majorCooldownManager) GetMajorCooldownIgnoreTag(actionID ActionID) *MajorCooldown {
for _, mcd := range mcdm.majorCooldowns {
for _, mcd := range mcdm.initialMajorCooldowns {
if mcd.Spell.SameActionIgnoreTag(actionID) {
return mcd
return &mcd
}
}
return nil
Expand All @@ -449,7 +449,7 @@ func (mcdm *majorCooldownManager) getFirstReadyMCD(sim *Simulation) *MajorCooldo

for _, mcd := range mcdm.majorCooldowns {
if !mcd.IsReady(sim) {
return nil
continue
}
if mcd.shouldActivateHelper(sim, mcdm.character) {
return mcd
Expand Down
11 changes: 0 additions & 11 deletions sim/core/spell.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,17 +148,6 @@ func (unit *Unit) OnSpellRegistered(handler SpellRegisteredHandler) {
unit.spellRegistrationHandlers = append(unit.spellRegistrationHandlers, handler)
}

func (unit *Unit) GetDummyProcSpell() *Spell {
if unit.DummyProcSpell == nil {
unit.DummyProcSpell = unit.RegisterSpell(SpellConfig{
ActionID: ActionID{SpellID: -1},
Flags: SpellFlagNoLogs | SpellFlagNoMetrics,
ProcMask: ProcMaskProc,
})
}
return unit.DummyProcSpell
}

// Registers a new spell to the unit. Returns the newly created spell.
func (unit *Unit) RegisterSpell(config SpellConfig) *Spell {
if len(unit.Spellbook) > 100 {
Expand Down
2 changes: 0 additions & 2 deletions sim/core/unit.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,6 @@ type Unit struct {

// The currently-channeled DOT spell, otherwise nil.
ChanneledDot *Dot

DummyProcSpell *Spell
}

// Units can be disabled for several reasons:
Expand Down
Loading

0 comments on commit b91c60c

Please sign in to comment.