Skip to content

Commit

Permalink
Merge pull request #3817 from jarveson/jake/misc
Browse files Browse the repository at this point in the history
misc fixes
  • Loading branch information
jarveson committed Oct 5, 2023
2 parents 37f1301 + 450f0ac commit ffe9c84
Show file tree
Hide file tree
Showing 34 changed files with 90 additions and 91 deletions.
4 changes: 2 additions & 2 deletions sim/core/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func ProtoToActionID(protoID *proto.ActionID) ActionID {
}
}

type AgentFactory func(Character, *proto.Player) Agent
type AgentFactory func(*Character, *proto.Player) Agent
type SpecSetter func(*proto.Player, interface{})

var agentFactories = make(map[string]AgentFactory)
Expand Down Expand Up @@ -175,7 +175,7 @@ func NewAgent(party *Party, partyIndex int, player *proto.Player) Agent {
}

character := NewCharacter(party, partyIndex, player)
return factory(character, player)
return factory(&character, player)
}

// Applies the spec options to the given player. This is only necessary because
Expand Down
4 changes: 2 additions & 2 deletions sim/core/dot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ func init() {
)
}

func NewFakeElementalShaman(char Character, options *proto.Player) Agent {
func NewFakeElementalShaman(char *Character, options *proto.Player) Agent {
fa := &FakeAgent{
Character: char,
Character: *char,
}

fa.Init = func() {
Expand Down
4 changes: 2 additions & 2 deletions sim/deathknight/deathknight.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,9 @@ func (dk *Deathknight) HasMinorGlyph(glyph proto.DeathknightMinorGlyph) bool {
return dk.HasGlyph(int32(glyph))
}

func NewDeathknight(character core.Character, inputs DeathknightInputs, talents string, preNerfedGargoyle bool) *Deathknight {
func NewDeathknight(character *core.Character, inputs DeathknightInputs, talents string, preNerfedGargoyle bool) *Deathknight {
dk := &Deathknight{
Character: character,
Character: *character,
Talents: &proto.DeathknightTalents{},
Inputs: inputs,
RoRTSBonus: func(u *core.Unit) float64 { return 1.0 }, // default to no bonus for RoR/TS
Expand Down
4 changes: 2 additions & 2 deletions sim/deathknight/dps/dps_deathknight.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func RegisterDpsDeathknight() {
core.RegisterAgentFactory(
proto.Player_Deathknight{},
proto.Spec_SpecDeathknight,
func(character core.Character, options *proto.Player) core.Agent {
func(character *core.Character, options *proto.Player) core.Agent {
return NewDpsDeathknight(character, options)
},
func(player *proto.Player, spec interface{}) {
Expand Down Expand Up @@ -41,7 +41,7 @@ type DpsDeathknight struct {
rotationSetup func()
}

func NewDpsDeathknight(character core.Character, player *proto.Player) *DpsDeathknight {
func NewDpsDeathknight(character *core.Character, player *proto.Player) *DpsDeathknight {
dk := player.GetDeathknight()

dpsDk := &DpsDeathknight{
Expand Down
4 changes: 2 additions & 2 deletions sim/deathknight/tank/tank_deathknight.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ func RegisterTankDeathknight() {
core.RegisterAgentFactory(
proto.Player_TankDeathknight{},
proto.Spec_SpecTankDeathknight,
func(character core.Character, options *proto.Player) core.Agent {
func(character *core.Character, options *proto.Player) core.Agent {
return NewTankDeathknight(character, options)
},
func(player *proto.Player, spec interface{}) {
Expand All @@ -33,7 +33,7 @@ type TankDeathknight struct {
Rotation *proto.TankDeathknight_Rotation
}

func NewTankDeathknight(character core.Character, options *proto.Player) *TankDeathknight {
func NewTankDeathknight(character *core.Character, options *proto.Player) *TankDeathknight {
dkOptions := options.GetTankDeathknight()

tankDk := &TankDeathknight{
Expand Down
4 changes: 2 additions & 2 deletions sim/druid/balance/balance.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func RegisterBalanceDruid() {
core.RegisterAgentFactory(
proto.Player_BalanceDruid{},
proto.Spec_SpecBalanceDruid,
func(character core.Character, options *proto.Player) core.Agent {
func(character *core.Character, options *proto.Player) core.Agent {
return NewBalanceDruid(character, options)
},
func(player *proto.Player, spec interface{}) {
Expand All @@ -25,7 +25,7 @@ func RegisterBalanceDruid() {
)
}

func NewBalanceDruid(character core.Character, options *proto.Player) *BalanceDruid {
func NewBalanceDruid(character *core.Character, options *proto.Player) *BalanceDruid {
balanceOptions := options.GetBalanceDruid()
selfBuffs := druid.SelfBuffs{}

Expand Down
4 changes: 2 additions & 2 deletions sim/druid/druid.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,9 @@ func (druid *Druid) Reset(_ *core.Simulation) {
druid.SolarICD.Timer.Reset()
}

func New(char core.Character, form DruidForm, selfBuffs SelfBuffs, talents string) *Druid {
func New(char *core.Character, form DruidForm, selfBuffs SelfBuffs, talents string) *Druid {
druid := &Druid{
Character: char,
Character: *char,
SelfBuffs: selfBuffs,
Talents: &proto.DruidTalents{},
StartingForm: form,
Expand Down
4 changes: 2 additions & 2 deletions sim/druid/feral/feral.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func RegisterFeralDruid() {
core.RegisterAgentFactory(
proto.Player_FeralDruid{},
proto.Spec_SpecFeralDruid,
func(character core.Character, options *proto.Player) core.Agent {
func(character *core.Character, options *proto.Player) core.Agent {
return NewFeralDruid(character, options)
},
func(player *proto.Player, spec interface{}) {
Expand All @@ -25,7 +25,7 @@ func RegisterFeralDruid() {
)
}

func NewFeralDruid(character core.Character, options *proto.Player) *FeralDruid {
func NewFeralDruid(character *core.Character, options *proto.Player) *FeralDruid {
feralOptions := options.GetFeralDruid()
selfBuffs := druid.SelfBuffs{}

Expand Down
4 changes: 2 additions & 2 deletions sim/druid/restoration/restoration.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ func RegisterRestorationDruid() {
core.RegisterAgentFactory(
proto.Player_RestorationDruid{},
proto.Spec_SpecRestorationDruid,
func(character core.Character, options *proto.Player) core.Agent {
func(character *core.Character, options *proto.Player) core.Agent {
return NewRestorationDruid(character, options)
},
func(player *proto.Player, spec interface{}) {
Expand All @@ -23,7 +23,7 @@ func RegisterRestorationDruid() {
)
}

func NewRestorationDruid(character core.Character, options *proto.Player) *RestorationDruid {
func NewRestorationDruid(character *core.Character, options *proto.Player) *RestorationDruid {
restoOptions := options.GetRestorationDruid()
selfBuffs := druid.SelfBuffs{}

Expand Down
4 changes: 2 additions & 2 deletions sim/druid/tank/tank.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ func RegisterFeralTankDruid() {
core.RegisterAgentFactory(
proto.Player_FeralTankDruid{},
proto.Spec_SpecFeralTankDruid,
func(character core.Character, options *proto.Player) core.Agent {
func(character *core.Character, options *proto.Player) core.Agent {
return NewFeralTankDruid(character, options)
},
func(player *proto.Player, spec interface{}) {
Expand All @@ -23,7 +23,7 @@ func RegisterFeralTankDruid() {
)
}

func NewFeralTankDruid(character core.Character, options *proto.Player) *FeralTankDruid {
func NewFeralTankDruid(character *core.Character, options *proto.Player) *FeralTankDruid {
tankOptions := options.GetFeralTankDruid()
selfBuffs := druid.SelfBuffs{}

Expand Down
3 changes: 3 additions & 0 deletions sim/druid/tigers_fury.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ func (druid *Druid) registerTigersFurySpell() {
Duration: time.Second*30 - cdReduction,
},
},
ExtraCastCondition: func(sim *core.Simulation, target *core.Unit) bool {
return !druid.BerserkAura.IsActive()
},

ApplyEffects: func(sim *core.Simulation, _ *core.Unit, _ *core.Spell) {
druid.AddEnergy(sim, instantEnergy, energyMetrics)
Expand Down
6 changes: 3 additions & 3 deletions sim/hunter/hunter.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func RegisterHunter() {
core.RegisterAgentFactory(
proto.Player_Hunter{},
proto.Spec_SpecHunter,
func(character core.Character, options *proto.Player) core.Agent {
func(character *core.Character, options *proto.Player) core.Agent {
return NewHunter(character, options)
},
func(player *proto.Player, spec interface{}) {
Expand Down Expand Up @@ -170,11 +170,11 @@ func (hunter *Hunter) Reset(_ *core.Simulation) {
hunter.permaHawk = false
}

func NewHunter(character core.Character, options *proto.Player) *Hunter {
func NewHunter(character *core.Character, options *proto.Player) *Hunter {
hunterOptions := options.GetHunter()

hunter := &Hunter{
Character: character,
Character: *character,
Talents: &proto.HunterTalents{},
Options: hunterOptions.Options,
Rotation: hunterOptions.Rotation,
Expand Down
6 changes: 3 additions & 3 deletions sim/mage/mage.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func RegisterMage() {
core.RegisterAgentFactory(
proto.Player_Mage{},
proto.Spec_SpecMage,
func(character core.Character, options *proto.Player) core.Agent {
func(character *core.Character, options *proto.Player) core.Agent {
return NewMage(character, options)
},
func(player *proto.Player, spec interface{}) {
Expand Down Expand Up @@ -157,11 +157,11 @@ func (mage *Mage) Reset(sim *core.Simulation) {
mage.delayedPyroAt = 0
}

func NewMage(character core.Character, options *proto.Player) *Mage {
func NewMage(character *core.Character, options *proto.Player) *Mage {
mageOptions := options.GetMage()

mage := &Mage{
Character: character,
Character: *character,
Talents: &proto.MageTalents{},
Options: mageOptions.Options,
Rotation: mageOptions.Rotation,
Expand Down
4 changes: 2 additions & 2 deletions sim/paladin/holy/holy.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ func RegisterHolyPaladin() {
core.RegisterAgentFactory(
proto.Player_HolyPaladin{},
proto.Spec_SpecHolyPaladin,
func(character core.Character, options *proto.Player) core.Agent {
func(character *core.Character, options *proto.Player) core.Agent {
return NewHolyPaladin(character, options)
},
func(player *proto.Player, spec interface{}) {
Expand All @@ -23,7 +23,7 @@ func RegisterHolyPaladin() {
)
}

func NewHolyPaladin(character core.Character, options *proto.Player) *HolyPaladin {
func NewHolyPaladin(character *core.Character, options *proto.Player) *HolyPaladin {
holyOptions := options.GetHolyPaladin()

holy := &HolyPaladin{
Expand Down
4 changes: 2 additions & 2 deletions sim/paladin/paladin.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ func (paladin *Paladin) Reset(_ *core.Simulation) {
}

// maybe need to add stat dependencies
func NewPaladin(character core.Character, talentsStr string) *Paladin {
func NewPaladin(character *core.Character, talentsStr string) *Paladin {
paladin := &Paladin{
Character: character,
Character: *character,
Talents: &proto.PaladinTalents{},
}
core.FillTalentsProto(paladin.Talents.ProtoReflect(), talentsStr, TalentTreeSizes)
Expand Down
4 changes: 2 additions & 2 deletions sim/paladin/protection/protection.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func RegisterProtectionPaladin() {
core.RegisterAgentFactory(
proto.Player_ProtectionPaladin{},
proto.Spec_SpecProtectionPaladin,
func(character core.Character, options *proto.Player) core.Agent {
func(character *core.Character, options *proto.Player) core.Agent {
return NewProtectionPaladin(character, options)
},
func(player *proto.Player, spec interface{}) {
Expand All @@ -25,7 +25,7 @@ func RegisterProtectionPaladin() {
)
}

func NewProtectionPaladin(character core.Character, options *proto.Player) *ProtectionPaladin {
func NewProtectionPaladin(character *core.Character, options *proto.Player) *ProtectionPaladin {
protOptions := options.GetProtectionPaladin()

prot := &ProtectionPaladin{
Expand Down
4 changes: 2 additions & 2 deletions sim/paladin/retribution/retribution.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func RegisterRetributionPaladin() {
core.RegisterAgentFactory(
proto.Player_RetributionPaladin{},
proto.Spec_SpecRetributionPaladin,
func(character core.Character, options *proto.Player) core.Agent {
func(character *core.Character, options *proto.Player) core.Agent {
return NewRetributionPaladin(character, options)
},
func(player *proto.Player, spec interface{}) {
Expand All @@ -25,7 +25,7 @@ func RegisterRetributionPaladin() {
)
}

func NewRetributionPaladin(character core.Character, options *proto.Player) *RetributionPaladin {
func NewRetributionPaladin(character *core.Character, options *proto.Player) *RetributionPaladin {
retOptions := options.GetRetributionPaladin()

pal := paladin.NewPaladin(character, options.TalentsString)
Expand Down
4 changes: 2 additions & 2 deletions sim/priest/healing/healing_priest.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ func RegisterHealingPriest() {
core.RegisterAgentFactory(
proto.Player_HealingPriest{},
proto.Spec_SpecHealingPriest,
func(character core.Character, options *proto.Player) core.Agent {
func(character *core.Character, options *proto.Player) core.Agent {
return NewHealingPriest(character, options)
},
func(player *proto.Player, spec interface{}) {
Expand All @@ -36,7 +36,7 @@ type HealingPriest struct {
nextCycleIndex int
}

func NewHealingPriest(character core.Character, options *proto.Player) *HealingPriest {
func NewHealingPriest(character *core.Character, options *proto.Player) *HealingPriest {
healingOptions := options.GetHealingPriest()

selfBuffs := priest.SelfBuffs{
Expand Down
4 changes: 2 additions & 2 deletions sim/priest/priest.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ func (priest *Priest) Reset(_ *core.Simulation) {
priest.MindBlastModifier = 1
}

func New(char core.Character, selfBuffs SelfBuffs, talents string) *Priest {
func New(char *core.Character, selfBuffs SelfBuffs, talents string) *Priest {
priest := &Priest{
Character: char,
Character: *char,
SelfBuffs: selfBuffs,
Talents: &proto.PriestTalents{},
}
Expand Down
4 changes: 2 additions & 2 deletions sim/priest/shadow/shadow_priest.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func RegisterShadowPriest() {
core.RegisterAgentFactory(
proto.Player_ShadowPriest{},
proto.Spec_SpecShadowPriest,
func(character core.Character, options *proto.Player) core.Agent {
func(character *core.Character, options *proto.Player) core.Agent {
return NewShadowPriest(character, options)
},
func(player *proto.Player, spec interface{}) {
Expand All @@ -26,7 +26,7 @@ func RegisterShadowPriest() {
)
}

func NewShadowPriest(character core.Character, options *proto.Player) *ShadowPriest {
func NewShadowPriest(character *core.Character, options *proto.Player) *ShadowPriest {
shadowOptions := options.GetShadowPriest()

selfBuffs := priest.SelfBuffs{
Expand Down
4 changes: 2 additions & 2 deletions sim/priest/smite/smite_priest.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func RegisterSmitePriest() {
core.RegisterAgentFactory(
proto.Player_SmitePriest{},
proto.Spec_SpecSmitePriest,
func(character core.Character, options *proto.Player) core.Agent {
func(character *core.Character, options *proto.Player) core.Agent {
return NewSmitePriest(character, options)
},
func(player *proto.Player, spec interface{}) {
Expand All @@ -25,7 +25,7 @@ func RegisterSmitePriest() {
)
}

func NewSmitePriest(character core.Character, options *proto.Player) *SmitePriest {
func NewSmitePriest(character *core.Character, options *proto.Player) *SmitePriest {
smiteOptions := options.GetSmitePriest()

selfBuffs := priest.SelfBuffs{
Expand Down
6 changes: 3 additions & 3 deletions sim/rogue/rogue.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func RegisterRogue() {
core.RegisterAgentFactory(
proto.Player_Rogue{},
proto.Spec_SpecRogue,
func(character core.Character, options *proto.Player) core.Agent {
func(character *core.Character, options *proto.Player) core.Agent {
return NewRogue(character, options)
},
func(player *proto.Player, spec interface{}) {
Expand Down Expand Up @@ -240,11 +240,11 @@ func (rogue *Rogue) SpellCritMultiplier() float64 {
return rogue.Character.SpellCritMultiplier(primaryModifier, 0)
}

func NewRogue(character core.Character, options *proto.Player) *Rogue {
func NewRogue(character *core.Character, options *proto.Player) *Rogue {
rogueOptions := options.GetRogue()

rogue := &Rogue{
Character: character,
Character: *character,
Talents: &proto.RogueTalents{},
Options: rogueOptions.Options,
Rotation: rogueOptions.Rotation,
Expand Down
4 changes: 2 additions & 2 deletions sim/shaman/elemental/elemental.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ func RegisterElementalShaman() {
core.RegisterAgentFactory(
proto.Player_ElementalShaman{},
proto.Spec_SpecElementalShaman,
func(character core.Character, options *proto.Player) core.Agent {
func(character *core.Character, options *proto.Player) core.Agent {
return NewElementalShaman(character, options)
},
func(player *proto.Player, spec interface{}) {
Expand All @@ -24,7 +24,7 @@ func RegisterElementalShaman() {
)
}

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

selfBuffs := shaman.SelfBuffs{
Expand Down
Loading

0 comments on commit ffe9c84

Please sign in to comment.