Skip to content

Commit

Permalink
Revert "Adjusted A4 to not snapshot on Q cast"
Browse files Browse the repository at this point in the history
  • Loading branch information
shizukayuki committed Dec 3, 2024
1 parent fdd9b58 commit d366097
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 26 deletions.
24 changes: 0 additions & 24 deletions internal/characters/mualani/asc.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package mualani

import (
"github.com/genshinsim/gcsim/pkg/core/attacks"
"github.com/genshinsim/gcsim/pkg/core/combat"
"github.com/genshinsim/gcsim/pkg/core/event"
"github.com/genshinsim/gcsim/pkg/core/glog"
"github.com/genshinsim/gcsim/pkg/core/targets"
)

Expand Down Expand Up @@ -45,26 +43,4 @@ func (c *char) a4() {
c.a4Stacks = min(c.a4Stacks+1, 3)
return false
}, "maulani-a4-nightsoul")

c.Core.Events.Subscribe(event.OnEnemyHit, func(args ...interface{}) bool {
atk := args[1].(*combat.AttackEvent)

switch atk.Info.AttackTag {
case attacks.AttackTagElementalBurst:
default:
return false
}
if atk.Info.ActorIndex != c.Index {
return false
}
amt := 0.15 * float64(c.a4Stacks) * c.MaxHP()
c.a4Stacks = 0

c.Core.Log.NewEvent("mualani a4 proc dmg add", glog.LogPreDamageMod, atk.Info.ActorIndex).
Write("before", atk.Info.FlatDmg).
Write("addition", amt)

atk.Info.FlatDmg += amt
return false
}, "maulani-a4-hook")
}
17 changes: 15 additions & 2 deletions internal/characters/mualani/burst.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,25 @@ 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() {
c.Core.QueueAttack(ai, burstArea, 0, 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)
Expand Down

0 comments on commit d366097

Please sign in to comment.