Skip to content

Commit

Permalink
merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
kayla-glick committed Apr 29, 2024
2 parents 6366609 + dae423b commit 82c83a2
Show file tree
Hide file tree
Showing 81 changed files with 6,057 additions and 2,166 deletions.
Binary file modified assets/database/db.bin
Binary file not shown.
63 changes: 61 additions & 2 deletions assets/database/db.json

Large diffs are not rendered by default.

Binary file modified assets/database/leftover_db.bin
Binary file not shown.
1 change: 1 addition & 0 deletions assets/database/leftover_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -21642,6 +21642,7 @@
{"effectId":4257,"spellId":96262,"name":"Enchant Bracer - Mighty Intellect","type":6,"stats":[0,0,0,50,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":4258,"spellId":96264,"name":"Enchant Bracer - Agility","type":6,"stats":[0,50,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,0],"quality":3},
{"effectId":4267,"itemId":70139,"spellId":99623,"name":"Flintlocke's Woodchucker","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,0,0,0],"quality":3,"classAllowlist":[2]},
{"effectId":4270,"itemId":71720,"spellId":101598,"name":"Drakehide Leg Armor","type":9,"stats":[0,0,145,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,0,0,0,0,0,0,0,0,0,0],"quality":4},
{"effectId":4439,"spellId":85068,"name":"Charscale Leg Reinforcements","type":9,"stats":[0,55,145,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":8},
{"effectId":4440,"spellId":85067,"name":"Dragonbone Leg Reinforcements","type":9,"stats":[0,0,0,0,0,0,0,0,55,0,0,190,0,55,0,0,0,0,0,190,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"quality":1,"requiredProfession":8}
],
Expand Down
3,546 changes: 3,546 additions & 0 deletions assets/db_inputs/wowhead_spell_tooltips.csv

Large diffs are not rendered by default.

27 changes: 0 additions & 27 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"dependencies": {
"@popperjs/core": "^2.11.6",
"bootstrap": "^5.3.0",
"tippy.js": "^6.3.7",
"pako": "^1.0.11",
"tippy.js": "^6.3.7",
"tsx-vanilla": "^1.0.0"
},
"devDependencies": {
Expand Down
1 change: 1 addition & 0 deletions proto/ui.proto
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ message SimSettings {
bool show_threat_metrics = 4;
bool show_healing_metrics = 7;
bool show_experimental = 5;
bool show_quick_swap = 12;
bool show_ep_values = 11;
string language = 9;
Faction faction = 6;
Expand Down
6 changes: 3 additions & 3 deletions sim/core/consumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ func makePotionActivationInternal(potionType proto.Potions, character *Character
Type: CooldownTypeMana,
ShouldActivate: func(sim *Simulation, character *Character) bool {
// Only pop if we have less than the max mana provided by the potion minus 1mp5 tick.
totalRegen := character.ManaRegenPerSecondWhileCasting() * 5
totalRegen := character.ManaRegenPerSecondWhileCombat() * 5
manaGain := 10750.0
if alchStoneEquipped && potionType == proto.Potions_MythicalManaPotion {
manaGain *= 1.4
Expand Down Expand Up @@ -637,7 +637,7 @@ func makePotionActivationInternal(potionType proto.Potions, character *Character
Type: CooldownTypeSurvival,
ShouldActivate: func(sim *Simulation, character *Character) bool {
// Only pop if we have less than the max mana provided by the potion minus 1mp5 tick.
totalRegen := character.ManaRegenPerSecondWhileCasting() * 5
totalRegen := character.ManaRegenPerSecondWhileCombat() * 5
manaGain := 11000.0
if alchStoneEquipped && potionType == proto.Potions_MythicalManaPotion {
manaGain *= 1.4
Expand Down Expand Up @@ -757,7 +757,7 @@ func registerConjuredCD(agent Agent, consumes *proto.Consumes) {
Type: CooldownTypeMana,
ShouldActivate: func(sim *Simulation, character *Character) bool {
// Only pop if we have less than the max mana provided by the potion minus 1mp5 tick.
totalRegen := character.ManaRegenPerSecondWhileCasting() * 5
totalRegen := character.ManaRegenPerSecondWhileCombat() * 5
return character.MaxMana()-(character.CurrentMana()+totalRegen) >= 1500
},
})
Expand Down
46 changes: 24 additions & 22 deletions sim/core/mana.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ type manaBar struct {
unit *Unit
BaseMana float64

currentMana float64
manaCastingMetrics *ResourceMetrics
manaNotCastingMetrics *ResourceMetrics
JowManaMetrics *ResourceMetrics
VtManaMetrics *ResourceMetrics
JowiseManaMetrics *ResourceMetrics
currentMana float64
manaCombatMetrics *ResourceMetrics
manaNotCombatMetrics *ResourceMetrics
JowManaMetrics *ResourceMetrics
VtManaMetrics *ResourceMetrics
JowiseManaMetrics *ResourceMetrics

ReplenishmentAura *Aura

Expand Down Expand Up @@ -48,6 +48,9 @@ func (character *Character) EnableManaBarWithModifier(modifier float64) {
// Starting with cataclysm 1 intellect now provides 1 spell power
character.AddStatDependency(stats.Intellect, stats.SpellPower, 1.0)

// Starting with cataclysm you get mp5 equal 5% of your base mana
character.AddStat(stats.MP5, character.baseStats[stats.Mana]*0.05)

// first 10 int should not count so remove them
character.AddStat(stats.SpellPower, -10)

Expand All @@ -62,8 +65,8 @@ func (character *Character) EnableManaBarWithModifier(modifier float64) {
ActionID: ActionID{OtherID: proto.OtherAction_OtherActionManaGain},
})

character.manaCastingMetrics = character.NewManaMetrics(ActionID{OtherID: proto.OtherAction_OtherActionManaRegen, Tag: 1})
character.manaNotCastingMetrics = character.NewManaMetrics(ActionID{OtherID: proto.OtherAction_OtherActionManaRegen, Tag: 2})
character.manaCombatMetrics = character.NewManaMetrics(ActionID{OtherID: proto.OtherAction_OtherActionManaRegen, Tag: 1})
character.manaNotCombatMetrics = character.NewManaMetrics(ActionID{OtherID: proto.OtherAction_OtherActionManaRegen, Tag: 2})

character.BaseMana = character.GetBaseStats()[stats.Mana]
character.Unit.manaBar.unit = &character.Unit
Expand Down Expand Up @@ -160,14 +163,14 @@ func (unit *Unit) SpiritManaRegenPerSecond() float64 {

// Returns the rate of mana regen per second, assuming this unit is
// considered to be casting.
func (unit *Unit) ManaRegenPerSecondWhileCasting() float64 {
func (unit *Unit) ManaRegenPerSecondWhileCombat() float64 {
regenRate := unit.MP5ManaRegenPerSecond()

spiritRegenRate := 0.0
if unit.PseudoStats.SpiritRegenRateCasting != 0 || unit.PseudoStats.ForceFullSpiritRegen {
if unit.PseudoStats.SpiritRegenRateCombat != 0 || unit.PseudoStats.ForceFullSpiritRegen {
spiritRegenRate = unit.SpiritManaRegenPerSecond() * unit.PseudoStats.SpiritRegenMultiplier
if !unit.PseudoStats.ForceFullSpiritRegen {
spiritRegenRate *= unit.PseudoStats.SpiritRegenRateCasting
spiritRegenRate *= unit.PseudoStats.SpiritRegenRateCombat
}
}
regenRate += spiritRegenRate
Expand All @@ -177,7 +180,7 @@ func (unit *Unit) ManaRegenPerSecondWhileCasting() float64 {

// Returns the rate of mana regen per second, assuming this unit is
// considered to be not casting.
func (unit *Unit) ManaRegenPerSecondWhileNotCasting() float64 {
func (unit *Unit) ManaRegenPerSecondWhileNotCombat() float64 {
regenRate := unit.MP5ManaRegenPerSecond()

regenRate += unit.SpiritManaRegenPerSecond() * unit.PseudoStats.SpiritRegenMultiplier
Expand All @@ -186,18 +189,18 @@ func (unit *Unit) ManaRegenPerSecondWhileNotCasting() float64 {
}

func (unit *Unit) UpdateManaRegenRates() {
unit.manaTickWhileCasting = unit.ManaRegenPerSecondWhileCasting() * 2
unit.manaTickWhileNotCasting = unit.ManaRegenPerSecondWhileNotCasting() * 2
unit.manaTickWhileCombat = unit.ManaRegenPerSecondWhileCombat() * 2
unit.manaTickWhileNotCombat = unit.ManaRegenPerSecondWhileNotCombat() * 2
}

// Applies 1 'tick' of mana regen, which worth 2s of regeneration based on mp5/int/spirit/etc.
func (unit *Unit) ManaTick(sim *Simulation) {
if sim.CurrentTime < unit.PseudoStats.FiveSecondRuleRefreshTime {
regen := unit.manaTickWhileCasting
unit.AddMana(sim, max(0, regen), unit.manaCastingMetrics)
if sim.CurrentTime > 0 {
regen := unit.manaTickWhileCombat
unit.AddMana(sim, max(0, regen), unit.manaCombatMetrics)
} else {
regen := unit.manaTickWhileNotCasting
unit.AddMana(sim, max(0, regen), unit.manaNotCastingMetrics)
regen := unit.manaTickWhileNotCombat
unit.AddMana(sim, max(0, regen), unit.manaNotCombatMetrics)
}
}

Expand All @@ -211,7 +214,7 @@ func (unit *Unit) TimeUntilManaRegen(desiredMana float64) time.Duration {
manaNeeded := desiredMana - unit.CurrentMana()
regenTime := NeverExpires

regenWhileCasting := unit.ManaRegenPerSecondWhileCasting()
regenWhileCasting := unit.ManaRegenPerSecondWhileCombat()
if regenWhileCasting != 0 {
regenTime = DurationFromSeconds(manaNeeded/regenWhileCasting) + 1
}
Expand All @@ -223,7 +226,7 @@ func (unit *Unit) TimeUntilManaRegen(desiredMana float64) time.Duration {
regenTime = time.Second * 5
manaNeeded -= regenWhileCasting * 5
// now we move into spirit based regen.
regenTime += DurationFromSeconds(manaNeeded / unit.ManaRegenPerSecondWhileNotCasting())
regenTime += DurationFromSeconds(manaNeeded / unit.ManaRegenPerSecondWhileNotCombat())
}

return regenTime
Expand Down Expand Up @@ -345,7 +348,6 @@ func (mc *ManaCost) CostFailureReason(sim *Simulation, spell *Spell) string {
func (mc *ManaCost) SpendCost(sim *Simulation, spell *Spell) {
if spell.CurCast.Cost > 0 {
spell.Unit.SpendMana(sim, spell.CurCast.Cost, mc.ResourceMetrics)
spell.Unit.PseudoStats.FiveSecondRuleRefreshTime = max(sim.CurrentTime+time.Second*5, spell.Unit.Hardcast.Expires)
}
}
func (mc *ManaCost) IssueRefund(_ *Simulation, _ *Spell) {}
Loading

0 comments on commit 82c83a2

Please sign in to comment.