Skip to content

Commit

Permalink
Merge pull request #62 from ghronkrepps/armor-spec
Browse files Browse the repository at this point in the history
implement armor specialization bonuses
  • Loading branch information
rosenrusinov authored Apr 14, 2024
2 parents 429c6cf + 8d5de5b commit 819f817
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 2 deletions.
21 changes: 21 additions & 0 deletions sim/core/character.go
Original file line number Diff line number Diff line change
Expand Up @@ -727,3 +727,24 @@ func FillTalentsProto(data protoreflect.Message, talentsStr string, treeSizes [3
offset += treeSizes[treeIdx]
}
}

func (character *Character) EnableArmorSpecialization(primaryStat stats.Stat, armorType proto.ArmorType) bool {
hasBonus := true

if character.Head().ArmorType != armorType ||
character.Shoulder().ArmorType != armorType ||
character.Chest().ArmorType != armorType ||
character.Wrist().ArmorType != armorType ||
character.Hands().ArmorType != armorType ||
character.Waist().ArmorType != armorType ||
character.Legs().ArmorType != armorType ||
character.Feet().ArmorType != armorType {
hasBonus = false
}

if hasBonus {
character.MultiplyStat(primaryStat, 1.05)
}

return hasBonus
}
28 changes: 26 additions & 2 deletions sim/core/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,36 @@ func (equipment *Equipment) Head() *Item {
return &equipment[proto.ItemSlot_ItemSlotHead]
}

func (equipment *Equipment) Neck() *Item {
return &equipment[proto.ItemSlot_ItemSlotNeck]
}

func (equipment *Equipment) Shoulder() *Item {
return &equipment[proto.ItemSlot_ItemSlotShoulder]
}

func (equipment *Equipment) Chest() *Item {
return &equipment[proto.ItemSlot_ItemSlotChest]
}

func (equipment *Equipment) Wrist() *Item {
return &equipment[proto.ItemSlot_ItemSlotWrist]
}

func (equipment *Equipment) Hands() *Item {
return &equipment[proto.ItemSlot_ItemSlotHands]
}

func (equipment *Equipment) Neck() *Item {
return &equipment[proto.ItemSlot_ItemSlotNeck]
func (equipment *Equipment) Waist() *Item {
return &equipment[proto.ItemSlot_ItemSlotWaist]
}

func (equipment *Equipment) Legs() *Item {
return &equipment[proto.ItemSlot_ItemSlotLegs]
}

func (equipment *Equipment) Feet() *Item {
return &equipment[proto.ItemSlot_ItemSlotFeet]
}

func (equipment *Equipment) Trinket1() *Item {
Expand Down
7 changes: 7 additions & 0 deletions sim/shaman/shaman.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

"github.com/wowsims/cata/sim/core"
"github.com/wowsims/cata/sim/core/proto"
"github.com/wowsims/cata/sim/core/stats"
)

var TalentTreeSizes = [3]int{19, 19, 20}
Expand Down Expand Up @@ -248,6 +249,12 @@ func (shaman *Shaman) Initialize() {
// shaman.registerBloodlustCD()

// shaman.NewTemporaryStatsAura("DC Pre-Pull SP Proc", core.ActionID{SpellID: 60494}, stats.Stats{stats.SpellPower: 765}, time.Second*10)

if shaman.Spec == proto.Spec_SpecElementalShaman || shaman.Spec == proto.Spec_SpecRestorationShaman {
shaman.EnableArmorSpecialization(stats.Intellect, proto.ArmorType_ArmorTypeMail)
} else if shaman.Spec == proto.Spec_SpecElementalShaman {
shaman.EnableArmorSpecialization(stats.Agility, proto.ArmorType_ArmorTypeMail)
}
}

func (shaman *Shaman) RegisterHealingSpells() {
Expand Down

0 comments on commit 819f817

Please sign in to comment.