Skip to content

Commit

Permalink
Merge branch 'master' into shaman
Browse files Browse the repository at this point in the history
  • Loading branch information
kayla-glick committed Feb 11, 2024
2 parents 684042d + e3ca4b2 commit e7c9c2b
Show file tree
Hide file tree
Showing 30 changed files with 610 additions and 436 deletions.
4 changes: 2 additions & 2 deletions proto/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -508,9 +508,9 @@ message Consumes {
StrengthBuff strength_buff = 7;
AttackPowerBuff attack_power_buff = 8;
SpellPowerBuff spell_power_buff = 9;
bool shadow_power_buff = 10;
ShadowPowerBuff shadow_power_buff = 10;
FirePowerBuff fire_power_buff = 11;
bool frost_power_buff = 12;
FrostPowerBuff frost_power_buff = 12;
bool sapper = 13;
Explosive filler_explosive = 14;
WeaponImbue main_hand_imbue = 15;
Expand Down
14 changes: 14 additions & 0 deletions sim/common/sod/item_sets/gnomeregan.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,18 @@ var ItemSetInsulatedLeather = core.NewItemSet(core.ItemSet{
},
})

var ItemSetInsulatedSorcerorLeather = core.NewItemSet(core.ItemSet{
Name: "Insulated Sorceror's Leathers",
Bonuses: map[int32]core.ApplyEffect{
2: func(agent core.Agent) {
c := agent.GetCharacter()
c.AddStat(stats.SpellPower, 16)
},
// TODO: Implement Feral set bonus
3: func(agent core.Agent) {},
},
})

///////////////////////////////////////////////////////////////////////////
// Mail
///////////////////////////////////////////////////////////////////////////
Expand All @@ -102,6 +114,7 @@ var ItemSetElectromanticDevastator = core.NewItemSet(core.ItemSet{
2: func(agent core.Agent) {
c := agent.GetCharacter()
c.AddStat(stats.AttackPower, 24)
c.AddStat(stats.RangedAttackPower, 24)
},
3: func(agent core.Agent) {
c := agent.GetCharacter()
Expand Down Expand Up @@ -171,6 +184,7 @@ var ItemSetHazardSuit = core.NewItemSet(core.ItemSet{
c := agent.GetCharacter()
c.AddStat(stats.Defense, 7)
c.AddStat(stats.AttackPower, 16)
c.AddStat(stats.RangedAttackPower, 16)
},
3: func(agent core.Agent) {
c := agent.GetCharacter()
Expand Down
3 changes: 3 additions & 0 deletions sim/core/aura.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ func (aura *Aura) SetStacks(sim *Simulation, newStacks int32) {
func (aura *Aura) AddStack(sim *Simulation) {
aura.SetStacks(sim, aura.stacks+1)
}
func (aura *Aura) AddStacks(sim *Simulation, numStacks int32) {
aura.SetStacks(sim, aura.stacks+numStacks)
}
func (aura *Aura) RemoveStack(sim *Simulation) {
aura.SetStacks(sim, aura.stacks-1)
}
Expand Down
40 changes: 24 additions & 16 deletions sim/core/consumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ func applyConsumeEffects(agent Agent, partyBuffs *proto.PartyBuffs) {
}

if character.HasMHWeapon() {
addImbueStats(character, consumes.MainHandImbue)
addImbueStats(character, consumes.MainHandImbue, true)
}
if character.HasOHWeapon() {
addImbueStats(character, consumes.OffHandImbue)
addImbueStats(character, consumes.OffHandImbue, false)
}

if consumes.Food != proto.Food_FoodUnknown {
Expand Down Expand Up @@ -171,16 +171,22 @@ func applyConsumeEffects(agent Agent, partyBuffs *proto.PartyBuffs) {
}
}

if consumes.ShadowPowerBuff {
character.AddStats(stats.Stats{
stats.ShadowPower: 40,
})
if consumes.ShadowPowerBuff != proto.ShadowPowerBuff_ShadowPowerBuffUnknown {
switch consumes.ShadowPowerBuff {
case proto.ShadowPowerBuff_ElixirOfShadowPower:
character.AddStats(stats.Stats{
stats.ShadowPower: 40,
})
}
}

if consumes.FrostPowerBuff {
character.AddStats(stats.Stats{
stats.FrostPower: 15,
})
if consumes.FrostPowerBuff != proto.FrostPowerBuff_FrostPowerBuffUnknown {
switch consumes.FrostPowerBuff {
case proto.FrostPowerBuff_ElixirOfFrostPower:
character.AddStats(stats.Stats{
stats.FrostPower: 15,
})
}
}

if character.HasProfession(proto.Profession_Enchanting) && consumes.EnchantedSigil != proto.EnchantedSigil_UnknownSigil {
Expand All @@ -199,7 +205,7 @@ func applyConsumeEffects(agent Agent, partyBuffs *proto.PartyBuffs) {
registerExplosivesCD(agent, consumes)
}

func addImbueStats(character *Character, imbue proto.WeaponImbue) {
func addImbueStats(character *Character, imbue proto.WeaponImbue, isMh bool) {
if imbue != proto.WeaponImbue_WeaponImbueUnknown {
switch imbue {
case proto.WeaponImbue_BrillianWizardOil:
Expand All @@ -212,11 +218,13 @@ func addImbueStats(character *Character, imbue proto.WeaponImbue) {
stats.MP5: 5,
stats.Healing: 25,
})
// TODO: Classic
// case proto.WeaponImbue_DenseSharpeningStone:
// character.AddStats(stats.Stats{
// stats.WeaponDamage??: 5,
// })
case proto.WeaponImbue_DenseSharpeningStone:
weapon := character.AutoAttacks.MH()
if !isMh {
weapon = character.AutoAttacks.OH()
}
weapon.BaseDamageMin += 8
weapon.BaseDamageMax += 8
case proto.WeaponImbue_ElementalSharpeningStone:
character.AddStats(stats.Stats{
stats.MeleeCrit: 2 * CritRatingPerCritChance,
Expand Down
18 changes: 15 additions & 3 deletions sim/core/racials.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,21 @@ func applyRaceEffects(agent Agent) {

// Blood Fury
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)
var bloodFuryAP float64
bloodFuryAura := character.RegisterAura(Aura{
Label: "Blood Fury",
ActionID: actionID,
Duration: time.Second * 15,
// Tooltip is misleading; ap bonus is base AP plus AP from current strength, does not include +attackpower on items/buffs
OnGain: func(aura *Aura, sim *Simulation) {
bloodFuryAP = (character.GetBaseStats()[stats.AttackPower] + (character.GetStat(stats.Strength) * 2)) * 0.25
character.AddStatDynamic(sim, stats.AttackPower, bloodFuryAP)
},

OnExpire: func(aura *Aura, sim *Simulation) {
character.AddStatDynamic(sim, stats.AttackPower, -bloodFuryAP)
},
})

spell := character.RegisterSpell(SpellConfig{
ActionID: actionID,
Expand Down
94 changes: 75 additions & 19 deletions sim/druid/balance/TestBalance.results
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ character_stats_results: {
final_stats: 132.44
final_stats: 140.14
final_stats: 113.74
final_stats: 110
final_stats: 119
final_stats: 0
final_stats: 0
final_stats: 0
Expand Down Expand Up @@ -48,66 +48,122 @@ character_stats_results: {
final_stats: 0
}
}
dps_results: {
key: "TestBalance-AllItems-BlackfathomElementalist'sHide"
value: {
dps: 35.20865
tps: 36.13569
}
}
dps_results: {
key: "TestBalance-AllItems-BlackfathomSlayer'sLeather"
value: {
dps: 30.74433
tps: 31.49317
}
}
dps_results: {
key: "TestBalance-AllItems-HyperconductiveMender'sMeditation"
value: {
dps: 18.70173
tps: 19.58257
}
}
dps_results: {
key: "TestBalance-AllItems-HyperconductiveWizard'sAttire"
value: {
dps: 18.23835
tps: 19.20499
}
}
dps_results: {
key: "TestBalance-AllItems-InsulatedLeathers"
value: {
dps: 14.87791
tps: 15.63995
}
}
dps_results: {
key: "TestBalance-AllItems-InsulatedSorceror'sLeathers"
value: {
dps: 18.29556
tps: 19.2292
}
}
dps_results: {
key: "TestBalance-AllItems-IrradiatedGarments"
value: {
dps: 20.37491
tps: 21.34155
}
}
dps_results: {
key: "TestBalance-AllItems-StormshroudArmor"
value: {
dps: 11.36908
tps: 12.09812
dps: 12.43377
tps: 13.16281
}
}
dps_results: {
key: "TestBalance-AllItems-TwilightInvoker'sVestments"
value: {
dps: 34.95225
tps: 35.82649
}
}
dps_results: {
key: "TestBalance-Average-Default"
value: {
dps: 53.98941
tps: 54.91017
dps: 61.48214
tps: 62.4029
}
}
dps_results: {
key: "TestBalance-Settings-Tauren-25-phase_1-Default-phase_1-FullBuffs-Full Consumes-LongMultiTarget"
value: {
dps: 54.55232
tps: 72.96112
dps: 62.02244
tps: 80.43124
}
}
dps_results: {
key: "TestBalance-Settings-Tauren-25-phase_1-Default-phase_1-FullBuffs-Full Consumes-LongSingleTarget"
value: {
dps: 54.55232
tps: 55.47276
dps: 62.02244
tps: 62.94288
}
}
dps_results: {
key: "TestBalance-Settings-Tauren-25-phase_1-Default-phase_1-FullBuffs-Full Consumes-ShortSingleTarget"
value: {
dps: 58.66311
tps: 63.26531
dps: 62.34573
tps: 66.94793
}
}
dps_results: {
key: "TestBalance-Settings-Tauren-25-phase_1-Default-phase_1-NoBuffs-Full Consumes-LongMultiTarget"
value: {
dps: 51.14897
tps: 51.14897
dps: 59.33107
tps: 59.33107
}
}
dps_results: {
key: "TestBalance-Settings-Tauren-25-phase_1-Default-phase_1-NoBuffs-Full Consumes-LongSingleTarget"
value: {
dps: 51.14897
tps: 51.14897
dps: 59.33107
tps: 59.33107
}
}
dps_results: {
key: "TestBalance-Settings-Tauren-25-phase_1-Default-phase_1-NoBuffs-Full Consumes-ShortSingleTarget"
value: {
dps: 57.37988
tps: 57.37988
dps: 62.0261
tps: 62.0261
}
}
dps_results: {
key: "TestBalance-SwitchInFrontOfTarget-Default"
value: {
dps: 54.55232
tps: 55.47276
dps: 62.02244
tps: 62.94288
}
}
7 changes: 7 additions & 0 deletions sim/druid/balance/balance.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ func NewBalanceDruid(character *core.Character, options *proto.Player) *BalanceD
moonkin.SelfBuffs.InnervateTarget = balanceOptions.Options.InnervateTarget
}

// Enable Auto Attacks for this spec
moonkin.EnableAutoAttacks(moonkin, core.AutoAttackOptions{
MainHand: moonkin.WeaponFromMainHand(moonkin.DefaultMeleeCritMultiplier()),
AutoSwingMelee: true,
})

return moonkin
}

Expand All @@ -59,4 +65,5 @@ func (moonkin *BalanceDruid) GetDruid() *druid.Druid {
func (moonkin *BalanceDruid) Initialize() {
moonkin.Druid.Initialize()
moonkin.RegisterBalanceSpells()
// moonkin.RegisterFeralCatSpells()
}
2 changes: 1 addition & 1 deletion sim/druid/balance/balance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func TestBalance(t *testing.T) {
}))
}

var StandardTalents = "50005003021"
var StandardTalents = "5000500302541051"

var FullConsumes = core.ConsumesCombo{
Label: "Full Consumes",
Expand Down
7 changes: 2 additions & 5 deletions sim/druid/druid.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ const (
var TalentTreeSizes = [3]int{16, 16, 15}

const (
SpellCode_DruidWrath int32 = iota
SpellCode_DruidNone int32 = iota
SpellCode_DruidWrath
SpellCode_DruidStarfire
SpellCode_DruidStarsurge
)
Expand Down Expand Up @@ -130,10 +131,6 @@ func (druid *Druid) AddRaidBuffs(raidBuffs *proto.RaidBuffs) {
}
}

func (druid *Druid) BalanceCritMultiplier() float64 {
return druid.SpellCritMultiplier(1, 0.2*float64(druid.Talents.Vengeance))
}

func (druid *Druid) NaturesGraceCastTime() func(spell *core.Spell) time.Duration {
return func(spell *core.Spell) time.Duration {
baseTime := core.TernaryDuration(druid.NaturesGraceProcAura.IsActive(),
Expand Down
7 changes: 3 additions & 4 deletions sim/druid/faerie_fire.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (druid *Druid) registerFaerieFireSpell() {
flags := core.SpellFlagNone
formMask := Humanoid | Moonkin

if druid.InForm(Cat | Bear) && druid.Talents.FaerieFireFeral {
if druid.InForm(Cat|Bear) && druid.Talents.FaerieFireFeral {
actionID = core.ActionID{SpellID: map[int32]int32{
25: 16857,
40: 17390,
Expand All @@ -49,7 +49,7 @@ func (druid *Druid) registerFaerieFireSpell() {
Duration: time.Second * 6,
}
}
flags |= core.SpellFlagAPL
flags |= core.SpellFlagAPL | core.SpellFlagResetAttackSwing

druid.FaerieFireAuras = druid.NewEnemyAuraArray(func(target *core.Unit, level int32) *core.Aura {
return core.FaerieFireAura(target, level)
Expand All @@ -73,7 +73,6 @@ func (druid *Druid) registerFaerieFireSpell() {
ThreatMultiplier: 1,
FlatThreatBonus: flatThreatBonus,
DamageMultiplier: 1,
CritMultiplier: druid.BalanceCritMultiplier(),

ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
result := spell.CalcAndDealOutcome(sim, target, spell.OutcomeMagicHit)
Expand All @@ -100,5 +99,5 @@ func (druid *Druid) ShouldFaerieFire(sim *core.Simulation, target *core.Unit) bo
}

debuff := druid.FaerieFireAuras.Get(target)
return !debuff.IsActive() || debuff.RemainingDuration(sim) < time.Second * 4
return !debuff.IsActive() || debuff.RemainingDuration(sim) < time.Second*4
}
Loading

0 comments on commit e7c9c2b

Please sign in to comment.