Skip to content

Commit

Permalink
Commit before fixing warlock tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmyt857 committed Jan 6, 2024
1 parent c3de2a7 commit c5c0155
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 828 deletions.
14 changes: 0 additions & 14 deletions proto/shaman.proto
Original file line number Diff line number Diff line change
Expand Up @@ -176,24 +176,10 @@ message ShamanTotems {
FireTotem fire = 3;
WaterTotem water = 4;

// If set, will use mana tide when appropriate.
bool use_mana_tide = 5;

// If set, will use fire elemental totem at the start and revert to regular
// fire totems when it expires.
bool use_fire_elemental = 6;

// If set, will revert to regular fire totems when fire elemental goes OOM,
// instead of waiting the full 2 minutes.
bool recall_fire_elemental_on_oom = 7;

// If set, any time a 2-minute totem is about to expire, will recall and
// replace all totems.
bool recall_totems = 8;

// If set will use fire totems as an MCD instead of manually controlling when to place them.
bool use_fire_mcd = 9;

// Bonus spell power for fire elemental snapshotting.
int32 bonus_spellpower = 10;

Expand Down
8 changes: 4 additions & 4 deletions sim/shaman/apl_values.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ func (value *APLValueTotemRemainingTime) Type() proto.APLValueType {
}
func (value *APLValueTotemRemainingTime) GetDuration(sim *core.Simulation) time.Duration {
if value.totemType == proto.ShamanTotems_Earth {
return max(0, value.shaman.NextTotemDrops[EarthTotem]-sim.CurrentTime)
return max(0, value.shaman.TotemExpirations[EarthTotem]-sim.CurrentTime)
} else if value.totemType == proto.ShamanTotems_Air {
return max(0, value.shaman.NextTotemDrops[AirTotem]-sim.CurrentTime)
return max(0, value.shaman.TotemExpirations[AirTotem]-sim.CurrentTime)
} else if value.totemType == proto.ShamanTotems_Fire {
return max(0, value.shaman.NextTotemDrops[FireTotem]-sim.CurrentTime)
return max(0, value.shaman.TotemExpirations[FireTotem]-sim.CurrentTime)
} else if value.totemType == proto.ShamanTotems_Water {
return max(0, value.shaman.NextTotemDrops[WaterTotem]-sim.CurrentTime)
return max(0, value.shaman.TotemExpirations[WaterTotem]-sim.CurrentTime)
} else {
return 0
}
Expand Down
1 change: 0 additions & 1 deletion sim/shaman/elemental/elemental.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ func NewElementalShaman(character *core.Character, options *proto.Player) *Eleme
totems := &proto.ShamanTotems{}
if eleShamOptions.Options.Totems != nil {
totems = eleShamOptions.Options.Totems
totems.UseFireMcd = true // Control fire totems as MCD.
}

inRange := eleShamOptions.Options.ThunderstormRange == proto.ElementalShaman_Options_TSInRange
Expand Down
4 changes: 2 additions & 2 deletions sim/shaman/fire_elemental_totem.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ func (shaman *Shaman) registerFireElementalTotem() {
// TODO: ToW needs a unique buff/debuff aura for each raidmember/target.
// Otherwise we will be possibly disabling another ele shaman's ToW debuff/buff.
if shaman.Totems.Fire == proto.FireTotem_TotemOfWrath {
shaman.NextTotemDrops[FireTotem] = sim.CurrentTime + fireTotemDuration
shaman.TotemExpirations[FireTotem] = sim.CurrentTime + fireTotemDuration
} else if shaman.Totems.Fire != proto.FireTotem_NoFireTotem && !shaman.Totems.UseFireMcd {

Check failure on line 46 in sim/shaman/fire_elemental_totem.go

View workflow job for this annotation

GitHub Actions / build-and-test

shaman.Totems.UseFireMcd undefined (type *"github.com/wowsims/wotlk/sim/core/proto".ShamanTotems has no field or method UseFireMcd)
shaman.NextTotemDrops[FireTotem] = sim.CurrentTime + fireTotemDuration
shaman.TotemExpirations[FireTotem] = sim.CurrentTime + fireTotemDuration
}

shaman.MagmaTotem.AOEDot().Cancel(sim)
Expand Down
4 changes: 2 additions & 2 deletions sim/shaman/fire_totems.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (shaman *Shaman) registerSearingTotemSpell() {
shaman.FireElemental.Disable(sim)
spell.Dot(sim.GetTargetUnit(0)).Apply(sim)
// +1 needed because of rounding issues with totem tick time.
shaman.NextTotemDrops[FireTotem] = sim.CurrentTime + time.Second*60 + 1
shaman.TotemExpirations[FireTotem] = sim.CurrentTime + time.Second*60 + 1
},
})
}
Expand Down Expand Up @@ -102,7 +102,7 @@ func (shaman *Shaman) registerMagmaTotemSpell() {
shaman.FireElemental.Disable(sim)
spell.AOEDot().Apply(sim)
// +1 needed because of rounding issues with totem tick time.
shaman.NextTotemDrops[FireTotem] = sim.CurrentTime + time.Second*20 + 1
shaman.TotemExpirations[FireTotem] = sim.CurrentTime + time.Second*20 + 1
},
})
}
3 changes: 1 addition & 2 deletions sim/shaman/restoration/restoration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ var restoShamOptions = &proto.RestorationShaman_Options{
}
var PlayerOptionsStandard = &proto.Player_RestorationShaman{
RestorationShaman: &proto.RestorationShaman{
Options: restoShamOptions,
Rotation: &proto.RestorationShaman_Rotation{},
Options: restoShamOptions,
},
}

Expand Down
43 changes: 4 additions & 39 deletions sim/shaman/shaman.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,8 @@ type Shaman struct {

Totems *proto.ShamanTotems

// The type of totem which should be dropped next and time to drop it, for
// each totem type (earth, air, fire, water).
NextTotemDropType [4]int32
NextTotemDrops [4]time.Duration
// The expiration time of each totem (earth, air, fire, water).
TotemExpirations [4]time.Duration

LightningBolt *core.Spell
LightningBoltLO *core.Spell
Expand Down Expand Up @@ -282,42 +280,9 @@ func (shaman *Shaman) RegisterHealingSpells() {
}

func (shaman *Shaman) Reset(sim *core.Simulation) {
// Check to see if we are casting a totem to set its expire time.
for i := range shaman.NextTotemDrops {
shaman.NextTotemDrops[i] = core.NeverExpires
switch i {
case AirTotem:
if shaman.Totems.Air != proto.AirTotem_NoAirTotem {
shaman.NextTotemDrops[i] = TotemRefreshTime5M
shaman.NextTotemDropType[i] = int32(shaman.Totems.Air)
}
case EarthTotem:
if shaman.Totems.Earth != proto.EarthTotem_NoEarthTotem {
shaman.NextTotemDrops[i] = TotemRefreshTime5M
shaman.NextTotemDropType[i] = int32(shaman.Totems.Earth)
}
case FireTotem:
shaman.NextTotemDropType[FireTotem] = int32(shaman.Totems.Fire)
if shaman.NextTotemDropType[FireTotem] != int32(proto.FireTotem_NoFireTotem) {
if shaman.NextTotemDropType[FireTotem] != int32(proto.FireTotem_TotemOfWrath) &&
shaman.NextTotemDropType[FireTotem] != int32(proto.FireTotem_FlametongueTotem) {
if !shaman.Totems.UseFireMcd {
shaman.NextTotemDrops[FireTotem] = 0
}
} else {
shaman.NextTotemDrops[FireTotem] = TotemRefreshTime5M
if shaman.NextTotemDropType[FireTotem] == int32(proto.FireTotem_TotemOfWrath) {
shaman.applyToWDebuff(sim)
}
}
}
case WaterTotem:
shaman.NextTotemDropType[i] = int32(shaman.Totems.Water)
shaman.NextTotemDrops[i] = TotemRefreshTime5M
}
if shaman.Totems.Fire == proto.FireTotem_TotemOfWrath {
shaman.applyToWDebuff(sim)
}

shaman.FlameShock.CD.Reset()
}

func (shaman *Shaman) ElementalCritMultiplier(secondary float64) float64 {
Expand Down
2 changes: 1 addition & 1 deletion sim/shaman/talents.go
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ func (shaman *Shaman) registerManaTideTotemCD() {

// TODO: Current water totem buff needs to be removed from party/raid.
if shaman.Totems.Water != proto.WaterTotem_NoWaterTotem {
shaman.NextTotemDrops[WaterTotem] = sim.CurrentTime + time.Second*12
shaman.TotemExpirations[WaterTotem] = sim.CurrentTime + time.Second*12
}
},
})
Expand Down
18 changes: 9 additions & 9 deletions sim/shaman/totems.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,23 @@ func (shaman *Shaman) newTotemSpellConfig(baseCost float64, spellID int32) core.
func (shaman *Shaman) registerWrathOfAirTotemSpell() {
config := shaman.newTotemSpellConfig(0.11, 3738)
config.ApplyEffects = func(sim *core.Simulation, _ *core.Unit, _ *core.Spell) {
shaman.NextTotemDrops[AirTotem] = sim.CurrentTime + time.Second*300
shaman.TotemExpirations[AirTotem] = sim.CurrentTime + time.Second*300
}
shaman.WrathOfAirTotem = shaman.RegisterSpell(config)
}

func (shaman *Shaman) registerWindfuryTotemSpell() {
config := shaman.newTotemSpellConfig(0.11, 8512)
config.ApplyEffects = func(sim *core.Simulation, _ *core.Unit, _ *core.Spell) {
shaman.NextTotemDrops[AirTotem] = sim.CurrentTime + time.Second*300
shaman.TotemExpirations[AirTotem] = sim.CurrentTime + time.Second*300
}
shaman.WindfuryTotem = shaman.RegisterSpell(config)
}

func (shaman *Shaman) registerManaSpringTotemSpell() {
config := shaman.newTotemSpellConfig(0.04, 58774)
config.ApplyEffects = func(sim *core.Simulation, _ *core.Unit, _ *core.Spell) {
shaman.NextTotemDrops[WaterTotem] = sim.CurrentTime + time.Second*300
shaman.TotemExpirations[WaterTotem] = sim.CurrentTime + time.Second*300
}
shaman.ManaSpringTotem = shaman.RegisterSpell(config)
}
Expand Down Expand Up @@ -72,7 +72,7 @@ func (shaman *Shaman) registerHealingStreamTotemSpell() {
},
}
config.ApplyEffects = func(sim *core.Simulation, _ *core.Unit, spell *core.Spell) {
shaman.NextTotemDrops[WaterTotem] = sim.CurrentTime + time.Second*300
shaman.TotemExpirations[WaterTotem] = sim.CurrentTime + time.Second*300
for _, agent := range shaman.Party.Players {
spell.Hot(&agent.GetCharacter().Unit).Activate(sim)
}
Expand All @@ -83,7 +83,7 @@ func (shaman *Shaman) registerHealingStreamTotemSpell() {
func (shaman *Shaman) registerTotemOfWrathSpell() {
config := shaman.newTotemSpellConfig(0.05, 57722)
config.ApplyEffects = func(sim *core.Simulation, _ *core.Unit, _ *core.Spell) {
shaman.NextTotemDrops[FireTotem] = sim.CurrentTime + time.Second*300
shaman.TotemExpirations[FireTotem] = sim.CurrentTime + time.Second*300
shaman.applyToWDebuff(sim)
}
shaman.TotemOfWrath = shaman.RegisterSpell(config)
Expand All @@ -99,31 +99,31 @@ func (shaman *Shaman) applyToWDebuff(sim *core.Simulation) {
func (shaman *Shaman) registerFlametongueTotemSpell() {
config := shaman.newTotemSpellConfig(0.11, 58656)
config.ApplyEffects = func(sim *core.Simulation, _ *core.Unit, _ *core.Spell) {
shaman.NextTotemDrops[FireTotem] = sim.CurrentTime + time.Second*300
shaman.TotemExpirations[FireTotem] = sim.CurrentTime + time.Second*300
}
shaman.FlametongueTotem = shaman.RegisterSpell(config)
}

func (shaman *Shaman) registerStrengthOfEarthTotemSpell() {
config := shaman.newTotemSpellConfig(0.1, 58643)
config.ApplyEffects = func(sim *core.Simulation, _ *core.Unit, _ *core.Spell) {
shaman.NextTotemDrops[EarthTotem] = sim.CurrentTime + time.Second*300
shaman.TotemExpirations[EarthTotem] = sim.CurrentTime + time.Second*300
}
shaman.StrengthOfEarthTotem = shaman.RegisterSpell(config)
}

func (shaman *Shaman) registerTremorTotemSpell() {
config := shaman.newTotemSpellConfig(0.02, 8143)
config.ApplyEffects = func(sim *core.Simulation, _ *core.Unit, _ *core.Spell) {
shaman.NextTotemDrops[EarthTotem] = sim.CurrentTime + time.Second*300
shaman.TotemExpirations[EarthTotem] = sim.CurrentTime + time.Second*300
}
shaman.TremorTotem = shaman.RegisterSpell(config)
}

func (shaman *Shaman) registerStoneskinTotemSpell() {
config := shaman.newTotemSpellConfig(0.1, 58753)
config.ApplyEffects = func(sim *core.Simulation, _ *core.Unit, _ *core.Spell) {
shaman.NextTotemDrops[EarthTotem] = sim.CurrentTime + time.Second*300
shaman.TotemExpirations[EarthTotem] = sim.CurrentTime + time.Second*300
}
shaman.StoneskinTotem = shaman.RegisterSpell(config)
}
Expand Down
6 changes: 1 addition & 5 deletions sim/warlock/inferno.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,8 @@ func (warlock *Warlock) registerInfernoSpell() {

warlock.AddMajorCooldown(core.MajorCooldown{
Spell: warlock.Inferno,
Type: core.CooldownTypeDPS,
Type: core.CooldownTypeUnknown,
ShouldActivate: func(sim *core.Simulation, character *core.Character) bool {
if !warlock.Rotation.UseInfernal {
return false
}

return sim.GetRemainingDuration() <= 61*time.Second
},
})
Expand Down
1 change: 0 additions & 1 deletion sim/warlock/pet.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ func (warlock *Warlock) NewWarlockPet() *WarlockPet {
}

wp.EnableManaBarWithModifier(cfg.PowerModifier)
wp.EnableResumeAfterManaWait(wp.OnGCDReady)

wp.AddStatDependency(stats.Strength, stats.AttackPower, 2)
wp.AddStat(stats.AttackPower, -20)
Expand Down
Loading

0 comments on commit c5c0155

Please sign in to comment.