Skip to content

Commit

Permalink
fix channeled mana regen (#3704)
Browse files Browse the repository at this point in the history
* fix channeled mana regen

* remove rogue files
  • Loading branch information
lime-green committed Sep 19, 2023
1 parent c7fce18 commit e127095
Show file tree
Hide file tree
Showing 8 changed files with 949 additions and 954 deletions.
7 changes: 1 addition & 6 deletions sim/core/mana.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,6 @@ func (unit *Unit) UpdateManaRegenRates() {

// Applies 1 'tick' of mana regen, which worth 2s of regeneration based on mp5/int/spirit/etc.
func (unit *Unit) ManaTick(sim *Simulation) {
if unit.ChanneledDot != nil {
// Mana is not regenerated during channels
return
}

if sim.CurrentTime < unit.PseudoStats.FiveSecondRuleRefreshTime {
regen := unit.manaTickWhileCasting
unit.AddMana(sim, MaxFloat(0, regen), unit.manaCastingMetrics)
Expand Down Expand Up @@ -334,7 +329,7 @@ func (mc *ManaCost) LogCostFailure(sim *Simulation, spell *Spell) {
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 = sim.CurrentTime + time.Second*5
spell.Unit.PseudoStats.FiveSecondRuleRefreshTime = MaxDuration(sim.CurrentTime+time.Second*5, spell.Unit.Hardcast.Expires)
}
}
func (mc *ManaCost) IssueRefund(_ *Simulation, _ *Spell) {}
Loading

0 comments on commit e127095

Please sign in to comment.