Skip to content

Commit

Permalink
Fix mualani Q snapshot timing (#2284)
Browse files Browse the repository at this point in the history
  • Loading branch information
Charlie-Zheng authored Dec 3, 2024
1 parent 458e269 commit a90278e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
10 changes: 1 addition & 9 deletions internal/characters/mualani/asc.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,5 @@ func (c *char) a4() {
c.Core.Events.Subscribe(event.OnNightsoulBurst, func(args ...interface{}) bool {
c.a4Stacks = min(c.a4Stacks+1, 3)
return false
}, "maulani-a4")
}
func (c *char) a4amount() float64 {
if c.Base.Ascension < 1 {
return 0.0
}
s := c.a4Stacks
c.a4Stacks = 0
return 0.15 * float64(s) * c.MaxHP()
}, "maulani-a4-nightsoul")
}
23 changes: 17 additions & 6 deletions internal/characters/mualani/burst.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/genshinsim/gcsim/pkg/core/combat"
)

const burstHitmarks = 185 - 70
const burstHitmarks = 108 // adjusted to swap frame

var (
burstFrames []int
Expand Down Expand Up @@ -40,15 +40,26 @@ func (c *char) Burst(p map[string]int) (action.Info, error) {
StrikeType: attacks.StrikeTypeDefault,
Element: attributes.Hydro,
Durability: 25,
FlatDmg: burst[c.TalentLvlBurst()] * c.MaxHP(),
}
burstArea := combat.NewCircleHitOnTarget(c.Core.Combat.PrimaryTarget(), nil, 5)

// snapshot at bullet creation
var snap combat.Snapshot
stacks := c.a4Stacks
c.a4Stacks = 0
c.QueueCharTask(func() {
// the A4 stacks can change during the burst
ai.FlatDmg += c.a4amount()
c.Core.QueueAttack(ai, burstArea, 0, 0)
}, burstHitmarks+travel)
snap = c.Snapshot(&ai)
c.Core.Tasks.Add(func() {
// TODO: verify if snapshot is used or if maxhp is recalced here
hp := c.MaxHP()
ai.FlatDmg = burst[c.TalentLvlBurst()] * hp
if c.Base.Ascension >= 4 {
ai.FlatDmg += 0.15 * float64(stacks) * hp
}

c.Core.QueueAttackWithSnap(ai, snap, burstArea, 0)
}, travel)
}, burstHitmarks)

c.SetCDWithDelay(action.ActionBurst, 15*60, 0)
c.ConsumeEnergy(11)
Expand Down

0 comments on commit a90278e

Please sign in to comment.