Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/wowsims/cata
Browse files Browse the repository at this point in the history
  • Loading branch information
kayla-glick committed Jun 2, 2024
2 parents 1d56649 + 99fc5de commit d173a44
Show file tree
Hide file tree
Showing 232 changed files with 12,727 additions and 10,520 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/scheduled_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Scheduled Release
on:
workflow_dispatch:
schedule:
- cron: '0 10 * * 1'
- cron: '0 10 * * *'

jobs:
schedule:
Expand Down
Binary file modified assets/database/db.bin
Binary file not shown.
3 changes: 2 additions & 1 deletion assets/database/db.json
Original file line number Diff line number Diff line change
Expand Up @@ -6616,7 +6616,7 @@
{"effectId":3601,"spellId":54793,"name":"Frag Belt","type":8,"stats":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"quality":1,"requiredProfession":4},
{"effectId":3603,"spellId":54998,"name":"Hand-Mounted Pyro Rocket","type":7,"stats":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"quality":1,"requiredProfession":4},
{"effectId":3604,"spellId":54999,"name":"Hyperspeed Accelerators","type":7,"stats":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"quality":1,"requiredProfession":4},
{"effectId":3605,"spellId":55002,"name":"Flexweave Underlay","type":4,"stats":[0,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"quality":1,"requiredProfession":4},
{"effectId":3605,"spellId":55002,"name":"Flexweave Underlay","type":4,"stats":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"quality":1,"requiredProfession":4},
{"effectId":3607,"itemId":41146,"spellId":55076,"name":"Sun Scope","type":14,"stats":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"quality":3},
{"effectId":3608,"itemId":41167,"spellId":55135,"name":"Heartseeker Scope","type":14,"stats":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"quality":3},
{"effectId":3718,"itemId":41601,"spellId":55630,"name":"Shining Spellthread","type":9,"stats":[0,0,0,0,12,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"quality":3},
Expand Down Expand Up @@ -9969,6 +9969,7 @@
{"id":87532,"name":"Shadowy Apparition","icon":"spell_shadow_unholyfrenzy"},
{"id":87934,"name":"Serpent Spread","icon":"ability_hunter_serpentswiftness"},
{"id":87935,"name":"Serpent Spread","icon":"ability_hunter_serpentswiftness"},
{"id":88148,"name":"Flamestrike","icon":"spell_fire_selfdestruct","hasBuff":true},
{"id":88423,"name":"Nature's Cure","icon":"ability_shaman_cleansespirit"},
{"id":88446,"name":"Demonic Rebirth","icon":"spell_shadow_demonictactics"},
{"id":88447,"name":"Demonic Rebirth","icon":"spell_shadow_demonictactics"},
Expand Down
Binary file modified assets/database/leftover_db.bin
Binary file not shown.
2 changes: 1 addition & 1 deletion assets/database/leftover_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -28576,7 +28576,7 @@
{"effectId":3601,"spellId":54793,"name":"Frag Belt","type":8,"stats":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"quality":1,"requiredProfession":4},
{"effectId":3603,"spellId":54998,"name":"Hand-Mounted Pyro Rocket","type":7,"stats":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"quality":1,"requiredProfession":4},
{"effectId":3604,"spellId":54999,"name":"Hyperspeed Accelerators","type":7,"stats":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"quality":1,"requiredProfession":4},
{"effectId":3605,"spellId":55002,"name":"Flexweave Underlay","type":4,"stats":[0,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"quality":1,"requiredProfession":4},
{"effectId":3605,"spellId":55002,"name":"Flexweave Underlay","type":4,"stats":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"quality":1,"requiredProfession":4},
{"effectId":3607,"itemId":41146,"spellId":55076,"name":"Sun Scope","type":14,"stats":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"quality":3},
{"effectId":3608,"itemId":41167,"spellId":55135,"name":"Heartseeker Scope","type":14,"stats":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"quality":3},
{"effectId":3718,"itemId":41601,"spellId":55630,"name":"Shining Spellthread","type":9,"stats":[0,0,0,0,12,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"quality":3},
Expand Down
367 changes: 209 additions & 158 deletions package-lock.json

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@
"@types/golang-wasm-exec": "^1.15.2",
"@types/pako": "^2.0.0",
"bootstrap": "^5.3.0",
"clsx": "^2.1.1",
"pako": "^2.0.4",
"tippy.js": "^6.3.7",
"tsx-vanilla": "^1.0.0",
"uuid": "^9.0.1"
"uuid": "^9.0.1"
},
"devDependencies": {
"@protobuf-ts/plugin": "2.9.1",
Expand All @@ -41,8 +42,8 @@
"@protobuf-ts/runtime": "2.9.1",
"@types/bootstrap": "^5.2.0",
"@types/eslint": "^8.56.10",
"@types/node": "^18.16.1",
"@types/glob": "^8.0.3",
"@types/node": "^18.16.1",
"@types/uuid": "^9.0.8",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
Expand All @@ -65,6 +66,6 @@
"typescript": "5.2.2",
"typescript-formatter": "^7.2.2",
"vite": "^5.0.0",
"vite-plugin-checker": "^0.6.4"
"vite-plugin-checker": "^0.6.4"
}
}
1 change: 1 addition & 0 deletions proto/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ enum ResourceType {
ResourceTypeDeathRune = 11;
ResourceTypeSolarEnergy = 12;
ResourceTypeLunarEnergy = 13;
ResourceTypeHolyPower = 14;
}

message ResourceMetrics {
Expand Down
2 changes: 2 additions & 0 deletions proto/apl.proto
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ message APLValue {
APLValueCurrentRunicPower current_runic_power = 25;
APLValueCurrentSolarEnergy current_solar_energy = 68;
APLValueCurrentLunarEnergy current_lunar_energy = 69;
APLValueCurrentHolyPower current_holy_power = 75;

// Unit values
APLValueUnitIsMoving unit_is_moving = 72;
Expand Down Expand Up @@ -413,6 +414,7 @@ message APLValueCurrentComboPoints {}
message APLValueCurrentRunicPower {}
message APLValueCurrentSolarEnergy {}
message APLValueCurrentLunarEnergy {}
message APLValueCurrentHolyPower {}

enum APLValueRuneType {
RuneUnknown = 0;
Expand Down
2 changes: 2 additions & 0 deletions proto/druid.proto
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ message BalanceDruid {
message Options {
DruidOptions class_options = 1;
float okf_uptime = 2;
bool start_in_solar = 3;
int32 mastery_snapshot = 4;
}
Options options = 3;
}
Expand Down
11 changes: 5 additions & 6 deletions proto/paladin.proto
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,14 @@ enum PaladinAura {
}

enum PaladinSeal {
Vengeance = 0;
Command = 1;
Righteousness = 2;
Truth = 0;
Justice = 1;
Insight = 2;
}

enum PaladinJudgement {
JudgementOfWisdom = 0;
JudgementOfLight = 1;
NoJudgement = 2;
Judgement = 0;
NoJudgement = 1;
}

message PaladinOptions {
Expand Down
4 changes: 2 additions & 2 deletions sim/common/cata/other_effects.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func init() {
Label: "Vengful Wisp - 2",
},
NumberOfTicks: 5,
TickLength: 3,
TickLength: 3 * time.Second,
AffectedByCastSpeed: false,
OnSnapshot: func(sim *core.Simulation, target *core.Unit, dot *core.Dot, isRollover bool) {
dot.Snapshot(target, 1176)
Expand Down Expand Up @@ -119,7 +119,7 @@ func init() {
Label: "Vengful Wisp - 1",
},
NumberOfTicks: 5,
TickLength: 3,
TickLength: 3 * time.Second,
AffectedByCastSpeed: false,
OnSnapshot: func(sim *core.Simulation, target *core.Unit, dot *core.Dot, isRollover bool) {
dot.Snapshot(target, 1176)
Expand Down
2 changes: 1 addition & 1 deletion sim/common/cata/stat_bonus_cds.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ func init() {
// AGILITY
shared.NewAgilityActive(63840, 1095, time.Second*15, time.Second*90) // Juju of Nimbleness
shared.NewAgilityActive(63843, 1095, time.Second*15, time.Second*90) // Blood-Soaked Ale Mug
shared.NewAgilityActive(52199, 1425, time.Second*20, time.Second*90) // Figurine - Demon Panther
shared.NewAgilityActive(64687, 1520, time.Second*20, time.Second*90) // Bloodthirsty Gladiator's Badge of Conquest
shared.NewAgilityActive(52199, 1425, time.Second*20, time.Minute*2) // Figurine - Demon Panther
shared.NewAgilityActive(62468, 1605, time.Second*20, time.Minute*2) // Unsolvable Riddle (Alliance)
shared.NewAgilityActive(62463, 1605, time.Second*20, time.Minute*2) // Unsolvable Riddle (Horde)
shared.NewAgilityActive(68709, 1605, time.Second*20, time.Minute*2) // Unsolvable Riddle (No Faction)
Expand Down
2 changes: 1 addition & 1 deletion sim/common/cata/stat_bonus_procs.go
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ func init() {
shared.NewProcStatBonusEffect(shared.ProcStatBonusEffect{
Name: "Stump of Time (Aliance)",
ID: 62470,
AuraID: 91048,
AuraID: 91047,
Bonus: stats.Stats{stats.SpellPower: 1926},
Duration: time.Second * 15,
Callback: core.CallbackOnSpellHitDealt | core.CallbackOnPeriodicDamageDealt,
Expand Down
7 changes: 3 additions & 4 deletions sim/core/buffs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1655,7 +1655,7 @@ func InnervateManaThreshold(character *Character) float64 {
// Mages burn mana really fast so they need a higher threshold.
return character.MaxMana() * 0.7
} else {
return 1000
return 5000
}
}

Expand All @@ -1670,7 +1670,7 @@ func registerInnervateCD(agent Agent, numInnervates int32) {
character := agent.GetCharacter()
character.Env.RegisterPostFinalizeEffect(func() {
innervateThreshold = InnervateManaThreshold(character)
innervateAura = InnervateAura(character, -1, false)
innervateAura = InnervateAura(character, -1, 0.05)
})

registerExternalConsecutiveCDApproximation(
Expand All @@ -1693,7 +1693,7 @@ func registerInnervateCD(agent Agent, numInnervates int32) {
numInnervates)
}

func InnervateAura(character *Character, actionTag int32, isSelfCast bool) *Aura {
func InnervateAura(character *Character, actionTag int32, reg float64) *Aura {
actionID := ActionID{SpellID: 29166, Tag: actionTag}
manaMetrics := character.NewManaMetrics(actionID)
return character.GetOrRegisterAura(Aura{
Expand All @@ -1702,7 +1702,6 @@ func InnervateAura(character *Character, actionTag int32, isSelfCast bool) *Aura
ActionID: actionID,
Duration: InnervateDuration,
OnGain: func(aura *Aura, sim *Simulation) {
reg := TernaryFloat64(isSelfCast, 0.2, 0.05)
manaPerTick := aura.Unit.MaxMana() * reg / 10.0
StartPeriodicAction(sim, PeriodicActionOptions{
Period: InnervateDuration / 10,
Expand Down
10 changes: 8 additions & 2 deletions sim/core/character.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ func (character *Character) MeleeCritMultiplier(primaryModifiers float64, second
return character.calculateCritMultiplier(2.0, primaryModifiers, secondaryModifiers)
}
func (character *Character) HealingCritMultiplier(primaryModifiers float64, secondaryModifiers float64) float64 {
return character.calculateHealingCritMultiplier(1.5, primaryModifiers, secondaryModifiers)
return character.calculateHealingCritMultiplier(2.0, primaryModifiers, secondaryModifiers)
}
func (character *Character) DefaultSpellCritMultiplier() float64 {
return character.SpellCritMultiplier(1, 0)
Expand Down Expand Up @@ -597,7 +597,13 @@ func (character *Character) GetProcMaskForItem(itemID int32) ProcMask {

func (character *Character) GetProcMaskForTypes(weaponTypes ...proto.WeaponType) ProcMask {
return character.getProcMaskFor(func(weapon *Item) bool {
return weapon == nil || slices.Contains(weaponTypes, weapon.WeaponType)
return weapon != nil && slices.Contains(weaponTypes, weapon.WeaponType)
})
}

func (character *Character) GetProcMaskForTypesAndHand(twohand bool, weaponTypes ...proto.WeaponType) ProcMask {
return character.getProcMaskFor(func(weapon *Item) bool {
return weapon != nil && (weapon.HandType == proto.HandType_HandTypeTwoHand) == twohand && slices.Contains(weaponTypes, weapon.WeaponType)
})
}

Expand Down
5 changes: 2 additions & 3 deletions sim/core/debuffs.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ func applyDebuffEffects(target *Unit, targetIdx int, debuffs *proto.Debuffs, rai
// +4% Phsyical Damage
if debuffs.BloodFrenzy && targetIdx < 4 {
MakePermanent(BloodFrenzyAura(target, 2))
MakePermanent(TraumaAura(target, 2))
}

if debuffs.SavageCombat {
Expand Down Expand Up @@ -323,9 +324,7 @@ func spellDamageEffect(aura *Aura, multiplier float64) *ExclusiveEffect {
}

func BloodFrenzyAura(target *Unit, points int32) *Aura {
baseAura := bloodFrenzySavageCombatAura(target, "Blood Frenzy", ActionID{SpellID: 29859}, points)
bleedDamageEffect(baseAura, 1.3)
return baseAura
return bloodFrenzySavageCombatAura(target, "Blood Frenzy", ActionID{SpellID: 29859}, points)
}
func SavageCombatAura(target *Unit, points int32) *Aura {
return bloodFrenzySavageCombatAura(target, "Savage Combat", ActionID{SpellID: 58413}, points)
Expand Down
6 changes: 5 additions & 1 deletion sim/core/pet.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,11 @@ func (pet *Pet) Enable(sim *Simulation, petAgent PetAgent) {
} else {
sim.AddPendingAction(&PendingAction{
NextActionAt: 0,
OnAction: pet.AutoAttacks.EnableAutoSwing,
OnAction: func(sim *Simulation) {
if pet.enabled {
pet.AutoAttacks.EnableAutoSwing(sim)
}
},
})
}

Expand Down
35 changes: 20 additions & 15 deletions sim/core/professions.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,39 +10,44 @@ import (
// This is just the static bonuses. Most professions are handled elsewhere.
func (character *Character) applyProfessionEffects() {
if character.HasProfession(proto.Profession_Mining) {
character.AddStat(stats.Stamina, 60)
character.AddStat(stats.Stamina, 120)
}

if character.HasProfession(proto.Profession_Skinning) {
character.AddStats(stats.Stats{stats.MeleeCrit: 40, stats.SpellCrit: 40})
character.AddStats(stats.Stats{stats.MeleeCrit: 80, stats.SpellCrit: 80})
}

if character.HasProfession(proto.Profession_Herbalism) {
actionID := ActionID{SpellID: 55503}
healthMetrics := character.NewHealthMetrics(actionID)
actionID := ActionID{SpellID: 74497}

aura := character.NewTemporaryStatsAura(
"Lifeblood",
actionID,
stats.Stats{stats.MeleeHaste: 480, stats.SpellHaste: 480},
time.Second*20,
)

spell := character.RegisterSpell(SpellConfig{
ActionID: actionID,
SpellSchool: SpellSchoolNature,
ProcMask: ProcMaskSpellHealing,
Cast: CastConfig{
CD: Cooldown{
Timer: character.NewTimer(),
Duration: time.Minute * 3,
Duration: time.Minute * 2,
},
},
ApplyEffects: func(sim *Simulation, _ *Unit, _ *Spell) {
amount := (3600 + character.MaxHealth()*0.016) / 5
StartPeriodicAction(sim, PeriodicActionOptions{
Period: time.Second,
NumTicks: 5,
OnAction: func(sim *Simulation) {
character.GainHealth(sim, amount*character.PseudoStats.HealingTakenMultiplier, healthMetrics)
},
})
DamageMultiplier: 1,
ThreatMultiplier: 1,
CritMultiplier: character.DefaultHealingCritMultiplier(),
ApplyEffects: func(sim *Simulation, _ *Unit, spell *Spell) {
amount := sim.RollWithLabel(720, 2160, "Healing Roll")
spell.CalcAndDealHealing(sim, spell.Unit, amount, spell.OutcomeHealingCrit)
aura.Activate(sim)
},
})
character.AddMajorCooldown(MajorCooldown{
Type: CooldownTypeSurvival,
Type: CooldownTypeDPS,
Spell: spell,
})
}
Expand Down
30 changes: 30 additions & 0 deletions sim/core/racials.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ func applyRaceEffects(agent Agent) {
} else if character.HasManaBar() {
actionID = ActionID{SpellID: 28730}
resourceMetrics = character.NewManaMetrics(actionID)
} else if character.HasRageBar() {
actionID = ActionID{SpellID: 69179}
resourceMetrics = character.NewRageMetrics(actionID)
} else if character.HasFocusBar() {
actionID = ActionID{SpellID: 80483}
resourceMetrics = character.NewFocusMetrics(actionID)
}
}

Expand All @@ -50,6 +56,10 @@ func applyRaceEffects(agent Agent) {
spell.Unit.AddEnergy(sim, 15.0, resourceMetrics)
} else if spell.Unit.HasManaBar() {
spell.Unit.AddMana(sim, spell.Unit.MaxMana()*0.06, resourceMetrics)
} else if spell.Unit.HasRageBar() {
spell.Unit.AddRage(sim, 15.0, resourceMetrics)
} else if spell.Unit.HasFocusBar() {
spell.Unit.AddFocus(sim, 15.0, resourceMetrics)
}
},
})
Expand All @@ -63,6 +73,10 @@ func applyRaceEffects(agent Agent) {
return character.CurrentRunicPower() <= character.maxRunicPower-15
} else if spell.Unit.HasEnergyBar() {
return character.CurrentEnergy() <= character.maxEnergy-15
} else if spell.Unit.HasRageBar() {
return character.CurrentRage() <= MaxRage-15
} else if spell.Unit.HasFocusBar() {
return character.CurrentFocus() <= character.maxFocus-15
}
return true
},
Expand Down Expand Up @@ -118,6 +132,8 @@ func applyRaceEffects(agent Agent) {
case proto.Race_RaceGnome:
character.PseudoStats.ReducedArcaneHitTakenChance += 0.02
character.MultiplyStat(stats.Mana, 1.05)
applyOneHandWeaponSpecialization(character, 3*ExpertisePerQuarterPercentReduction,
proto.WeaponType_WeaponTypeSword, proto.WeaponType_WeaponTypeDagger)
case proto.Race_RaceHuman:
character.MultiplyStat(stats.Spirit, 1.03)
applyWeaponSpecialization(character, 3*ExpertisePerQuarterPercentReduction,
Expand Down Expand Up @@ -249,3 +265,17 @@ func applyWeaponSpecialization(character *Character, expertiseBonus float64, wea
})
}
}

func applyOneHandWeaponSpecialization(character *Character, expertiseBonus float64, weaponTypes ...proto.WeaponType) {
mask := character.GetProcMaskForTypesAndHand(false, weaponTypes...)

if mask == ProcMaskMelee || (mask == ProcMaskMeleeMH && !character.HasOHWeapon()) {
character.AddStat(stats.Expertise, expertiseBonus)
} else {
character.OnSpellRegistered(func(spell *Spell) {
if spell.ProcMask.Matches(mask) {
spell.BonusExpertiseRating += expertiseBonus
}
})
}
}
2 changes: 0 additions & 2 deletions sim/core/spell_mod.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ func (unit *Unit) AddStaticMod(config SpellModConfig) {
mod.Activate()
}

// Never use dynamic mods for Auras that have ExpireNever and activate on reset
// Those mods will be overwritten potentilly during sim reset
func (unit *Unit) AddDynamicMod(config SpellModConfig) *SpellMod {
return buildMod(unit, config)
}
Expand Down
2 changes: 2 additions & 0 deletions sim/core/spell_outcome.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ func (dot *Dot) OutcomeTickPhysicalCrit(sim *Simulation, result *SpellResult, at
if dot.Spell.PhysicalCritCheck(sim, attackTable) {
result.Outcome = OutcomeCrit
result.Damage *= dot.Spell.CritMultiplier
dot.Spell.SpellMetrics[result.Target.UnitIndex].Crits++
} else {
result.Outcome = OutcomeHit
dot.Spell.SpellMetrics[result.Target.UnitIndex].Hits++
}
}

Expand Down
Loading

0 comments on commit d173a44

Please sign in to comment.