Skip to content

Commit

Permalink
Merge branch 'master' into warrior-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
TheGroxEmpire authored Feb 5, 2024
2 parents 198e77d + 84fb1cc commit ed368ea
Show file tree
Hide file tree
Showing 62 changed files with 2,226 additions and 1,197 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 wowsims team
Copyright (c) 2024 wowsims team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
11 changes: 8 additions & 3 deletions proto/shaman.proto
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ enum FireTotem {
NoFireTotem = 0;
MagmaTotem = 1;
SearingTotem = 2;
TotemOfWrath = 3;
FlametongueTotem = 4;
FireNovaTotem = 3;
}

enum WaterTotem {
Expand Down Expand Up @@ -155,6 +154,7 @@ enum ShamanImbue {
WindfuryWeapon = 1;
FlametongueWeapon = 2;
FrostbrandWeapon = 3;
RockbiterWeapon = 4;
}

enum ShamanSyncType {
Expand All @@ -168,9 +168,12 @@ message ElementalShaman {
message Rotation {
}

// NextIndex: 6
message Options {
ShamanShield shield = 1;
ShamanTotems totems = 3;
ShamanImbue imbue_mh = 4;
ShamanImbue imbue_oh = 5;
}
Options options = 3;
}
Expand All @@ -179,9 +182,9 @@ message EnhancementShaman {
message Rotation {
}

// NextIndex: 7
message Options {
ShamanShield shield = 1;
bool bloodlust = 2 [deprecated = true];
ShamanSyncType sync_type = 3;
ShamanImbue imbue_mh = 4;
ShamanImbue imbue_oh = 5;
Expand All @@ -201,9 +204,11 @@ message RestorationShaman {
message Rotation {
}

// NextIndex: 8
message Options {
ShamanShield shield = 1;
ShamanImbue imbue_mh = 4;
ShamanImbue imbue_oh = 7;
int32 earth_shield_p_p_m = 5;
ShamanTotems totems = 6;
}
Expand Down
2 changes: 1 addition & 1 deletion sim/core/racials.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func applyRaceEffects(agent Agent) {
}

// Blood Fury
actionID := ActionID{SpellID: 33697}
actionID := ActionID{SpellID: 20572}
apBonus := float64(character.Level)*4 + 2
spBonus := float64(character.Level)*2 + 3
bloodFuryAura := character.NewTemporaryStatsAura("Blood Fury", actionID, stats.Stats{stats.AttackPower: apBonus, stats.RangedAttackPower: apBonus, stats.SpellPower: spBonus}, time.Second*15)
Expand Down
9 changes: 4 additions & 5 deletions sim/raid_bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ var castersWithElemental = &proto.Party{
Totems: &proto.ShamanTotems{
Earth: proto.EarthTotem_TremorTotem,
Air: proto.AirTotem_WindfuryTotem,
Fire: proto.FireTotem_TotemOfWrath,
Fire: proto.FireTotem_SearingTotem,
Water: proto.WaterTotem_ManaSpringTotem,
},
},
Expand Down Expand Up @@ -175,13 +175,12 @@ func BenchmarkSimulate(b *testing.B) {
Spec: &proto.Player_EnhancementShaman{
EnhancementShaman: &proto.EnhancementShaman{
Options: &proto.EnhancementShaman_Options{
Shield: proto.ShamanShield_LightningShield,
Bloodlust: true,
SyncType: proto.ShamanSyncType_SyncMainhandOffhandSwings,
Shield: proto.ShamanShield_LightningShield,
SyncType: proto.ShamanSyncType_SyncMainhandOffhandSwings,
Totems: &proto.ShamanTotems{
Earth: proto.EarthTotem_TremorTotem,
Air: proto.AirTotem_WindfuryTotem,
Fire: proto.FireTotem_TotemOfWrath,
Fire: proto.FireTotem_SearingTotem,
Water: proto.WaterTotem_ManaSpringTotem,
},
},
Expand Down
5 changes: 2 additions & 3 deletions sim/register_all.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
_ "github.com/wowsims/sod/sim/common"
"github.com/wowsims/sod/sim/druid/balance"
"github.com/wowsims/sod/sim/shaman/elemental"
"github.com/wowsims/sod/sim/shaman/enhancement"

"github.com/wowsims/sod/sim/druid/feral"
// restoDruid "github.com/wowsims/sod/sim/druid/restoration"
Expand All @@ -18,8 +19,6 @@ import (
// healingPriest "github.com/wowsims/sod/sim/priest/healing"
"github.com/wowsims/sod/sim/priest/shadow"
// "github.com/wowsims/sod/sim/rogue"
// "github.com/wowsims/sod/sim/shaman/elemental"
// "github.com/wowsims/sod/sim/shaman/enhancement"
// restoShaman "github.com/wowsims/sod/sim/shaman/restoration"
dpsWarlock "github.com/wowsims/sod/sim/warlock/dps"
tankWarlock "github.com/wowsims/sod/sim/warlock/tank"
Expand All @@ -40,7 +39,7 @@ func RegisterAll() {
// feralTank.RegisterFeralTankDruid()
// restoDruid.RegisterRestorationDruid()
elemental.RegisterElementalShaman()
// enhancement.RegisterEnhancementShaman()
enhancement.RegisterEnhancementShaman()
// restoShaman.RegisterRestorationShaman()
hunter.RegisterHunter()
mage.RegisterMage()
Expand Down
81 changes: 81 additions & 0 deletions sim/shaman/air_totems.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
package shaman

import (
"time"

"github.com/wowsims/sod/sim/core"
)

const WindfuryTotemRanks = 3

var WindfuryTotemSpellId = [WindfuryTotemRanks + 1]int32{0, 8512, 10613, 10614}
var WindfuryTotemBonusDamage = [WindfuryTotemRanks + 1]float64{0, 122, 229, 315}
var WindfuryTotemManaCost = [WindfuryTotemRanks + 1]float64{0, 115, 175, 250}
var WindfuryTotemLevel = [WindfuryTotemRanks + 1]int{0, 32, 42, 52}

func (shaman *Shaman) registerWindfuryTotemSpell() {
shaman.WindfuryTotem = make([]*core.Spell, WindfuryTotemRanks+1)

for rank := 1; rank <= WindfuryTotemRanks; rank++ {
config := shaman.newWindfuryTotemSpellConfig(rank)

if config.RequiredLevel <= int(shaman.Level) {
shaman.WindfuryTotem[rank] = shaman.RegisterSpell(config)
}
}
}

func (shaman *Shaman) newWindfuryTotemSpellConfig(rank int) core.SpellConfig {
spellId := WindfuryTotemSpellId[rank]
// TODO: The sim won't respect the value of a totem dropped via the APL. It uses hard-coded values from buffs.go
// bonusDamage := WindfuryTotemBonusDamage[rank]
manaCost := WindfuryTotemManaCost[rank]
level := WindfuryTotemLevel[rank]

duration := time.Second * 120

spell := shaman.newTotemSpellConfig(manaCost, spellId)
spell.RequiredLevel = level
spell.Rank = rank
spell.ApplyEffects = func(sim *core.Simulation, _ *core.Unit, _ *core.Spell) {
shaman.TotemExpirations[AirTotem] = sim.CurrentTime + duration
}
return spell
}

const GraceOfAirTotemRanks = 3

var GraceOfAirTotemSpellId = [GraceOfAirTotemRanks + 1]int32{0, 8835, 10627, 25359}
var GraceOfAirTotemBonusAgi = [GraceOfAirTotemRanks + 1]float64{0, 43, 67, 77}
var GraceOfAirTotemManaCost = [GraceOfAirTotemRanks + 1]float64{0, 155, 250, 310}
var GraceOfAirTotemLevel = [GraceOfAirTotemRanks + 1]int{0, 42, 56, 60}

func (shaman *Shaman) registerGraceOfAirTotemSpell() {
shaman.GraceOfAirTotem = make([]*core.Spell, GraceOfAirTotemRanks+1)

for rank := 1; rank <= GraceOfAirTotemRanks; rank++ {
config := shaman.newGraceOfAirTotemSpellConfig(rank)

if config.RequiredLevel <= int(shaman.Level) {
shaman.GraceOfAirTotem[rank] = shaman.RegisterSpell(config)
}
}
}

func (shaman *Shaman) newGraceOfAirTotemSpellConfig(rank int) core.SpellConfig {
spellId := GraceOfAirTotemSpellId[rank]
// TODO: The sim won't respect the value of a totem dropped via the APL. It uses hard-coded values from buffs.go
// bonusDamage := GraceOfAirTotemBonusAgi[rank]
manaCost := GraceOfAirTotemManaCost[rank]
level := GraceOfAirTotemLevel[rank]

duration := time.Second * 120

spell := shaman.newTotemSpellConfig(manaCost, spellId)
spell.RequiredLevel = level
spell.Rank = rank
spell.ApplyEffects = func(sim *core.Simulation, _ *core.Unit, _ *core.Spell) {
shaman.TotemExpirations[AirTotem] = sim.CurrentTime + duration
}
return spell
}
92 changes: 92 additions & 0 deletions sim/shaman/earth_totems.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
package shaman

import (
"time"

"github.com/wowsims/sod/sim/core"
)

const StrengthOfEarthTotemRanks = 5

var StrengthOfEarthTotemSpellId = [StrengthOfEarthTotemRanks + 1]int32{0, 8075, 8160, 8161, 10442, 25361}
var StrengthOfEarthTotemManaCost = [StrengthOfEarthTotemRanks + 1]float64{0, 25, 65, 125, 225, 275}
var StrengthOfEarthTotemLevel = [StrengthOfEarthTotemRanks + 1]int{0, 10, 24, 38, 52, 60}

func (shaman *Shaman) registerStrengthOfEarthTotemSpell() {
shaman.StrengthOfEarthTotem = make([]*core.Spell, StrengthOfEarthTotemRanks+1)

for rank := 1; rank <= StrengthOfEarthTotemRanks; rank++ {
config := shaman.newStrengthOfEarthTotemSpellConfig(rank)

if config.RequiredLevel <= int(shaman.Level) {
shaman.StrengthOfEarthTotem[rank] = shaman.RegisterSpell(config)
}
}
}

func (shaman *Shaman) newStrengthOfEarthTotemSpellConfig(rank int) core.SpellConfig {
spellId := StrengthOfEarthTotemSpellId[rank]
manaCost := StrengthOfEarthTotemManaCost[rank]
level := StrengthOfEarthTotemLevel[rank]

duration := time.Second * 120

spell := shaman.newTotemSpellConfig(manaCost, spellId)
spell.RequiredLevel = level
spell.Rank = rank
spell.ApplyEffects = func(sim *core.Simulation, _ *core.Unit, spell *core.Spell) {
shaman.TotemExpirations[EarthTotem] = sim.CurrentTime + duration
shaman.ActiveTotems[EarthTotem] = spell
}
return spell
}

const StoneskinTotemRanks = 6

var StoneskinTotemSpellId = [StoneskinTotemRanks + 1]int32{0, 8071, 8154, 8155, 10406, 10407, 10408}
var StoneskinTotemManaCost = [StoneskinTotemRanks + 1]float64{0, 30, 60, 90, 115, 160, 210}
var StoneskinTotemLevel = [StoneskinTotemRanks + 1]int{0, 4, 14, 24, 34, 44, 54}

func (shaman *Shaman) registerStoneskinTotemSpell() {
shaman.StoneskinTotem = make([]*core.Spell, StoneskinTotemRanks+1)

for rank := 1; rank <= StoneskinTotemRanks; rank++ {
config := shaman.newStoneskinTotemSpellConfig(rank)

if config.RequiredLevel <= int(shaman.Level) {
shaman.StoneskinTotem[rank] = shaman.RegisterSpell(config)
}
}
}

func (shaman *Shaman) newStoneskinTotemSpellConfig(rank int) core.SpellConfig {
spellId := StoneskinTotemSpellId[rank]
manaCost := StoneskinTotemManaCost[rank]
level := StoneskinTotemLevel[rank]

duration := time.Second * 120

spell := shaman.newTotemSpellConfig(manaCost, spellId)
spell.RequiredLevel = level
spell.Rank = rank
spell.ApplyEffects = func(sim *core.Simulation, _ *core.Unit, spell *core.Spell) {
shaman.TotemExpirations[EarthTotem] = sim.CurrentTime + duration
shaman.ActiveTotems[EarthTotem] = spell
}
return spell
}

func (shaman *Shaman) registerTremorTotemSpell() {
spellId := int32(8143)
manaCost := float64(60)
duration := time.Second * 120
level := 18

spell := shaman.newTotemSpellConfig(manaCost, spellId)
spell.RequiredLevel = level
spell.ApplyEffects = func(sim *core.Simulation, _ *core.Unit, spell *core.Spell) {
shaman.TotemExpirations[EarthTotem] = sim.CurrentTime + duration
shaman.ActiveTotems[EarthTotem] = spell
}
shaman.TremorTotem = shaman.RegisterSpell(spell)
}
10 changes: 6 additions & 4 deletions sim/shaman/elemental/elemental.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,17 @@ func RegisterElementalShaman() {
}

func NewElementalShaman(character *core.Character, options *proto.Player) *ElementalShaman {
eleShamOptions := options.GetElementalShaman()
eleOptions := options.GetElementalShaman()

selfBuffs := shaman.SelfBuffs{
Shield: eleShamOptions.Options.Shield,
Shield: eleOptions.Options.Shield,
ImbueMH: eleOptions.Options.ImbueMh,
ImbueOH: eleOptions.Options.ImbueOh,
}

totems := &proto.ShamanTotems{}
if eleShamOptions.Options.Totems != nil {
totems = eleShamOptions.Options.Totems
if eleOptions.Options.Totems != nil {
totems = eleOptions.Options.Totems
totems.UseFireMcd = true // Control fire totems as MCD.
}

Expand Down
2 changes: 1 addition & 1 deletion sim/shaman/elemental/elemental_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ var BasicTotems = &proto.ShamanTotems{
Earth: proto.EarthTotem_TremorTotem,
Air: proto.AirTotem_WindfuryTotem,
Water: proto.WaterTotem_ManaSpringTotem,
Fire: proto.FireTotem_TotemOfWrath,
Fire: proto.FireTotem_SearingTotem,
}

var PlayerOptionsAdaptive = &proto.Player_ElementalShaman{
Expand Down
Loading

0 comments on commit ed368ea

Please sign in to comment.