Skip to content

Commit ab67431

Browse files
authored
Fix regression in Nilou A4 caused by bloom snapshot (#2345)
1 parent cea8dc9 commit ab67431

File tree

5 files changed

+15
-12
lines changed

5 files changed

+15
-12
lines changed

internal/characters/nilou/asc.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,7 @@ func (c *char) a4() {
9999
if ai.AttackTag != attacks.AttackTagBloom {
100100
return 0, false
101101
}
102-
103-
// check is bountiful core?
104-
var t combat.Gadget
105-
for _, v := range c.Core.Combat.Gadgets() {
106-
if v != nil && v.Key() == ai.DamageSrc {
107-
t = v
108-
}
109-
}
110-
if _, ok := t.(*BountifulCore); !ok {
102+
if ai.ICDTag != attacks.ICDTagBountifulCoreDamage {
111103
return 0, false
112104
}
113105

internal/characters/nilou/bountifulcore.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package nilou
22

33
import (
44
"github.com/genshinsim/gcsim/pkg/core"
5+
"github.com/genshinsim/gcsim/pkg/core/attacks"
56
"github.com/genshinsim/gcsim/pkg/core/combat"
67
"github.com/genshinsim/gcsim/pkg/core/event"
78
"github.com/genshinsim/gcsim/pkg/core/geometry"
@@ -28,7 +29,12 @@ func newBountifulCore(c *core.Core, p geometry.Point, a *combat.AttackEvent) *Bo
2829
char := b.Core.Player.ByIndex(a.Info.ActorIndex)
2930
explode := func() {
3031
c.Tasks.Add(func() {
31-
ai, snap := reactable.NewBloomAttack(char, b)
32+
ai, snap := reactable.NewBloomAttack(char, b, func(atk *combat.AttackInfo) {
33+
// atk.Abil += " (bountiful core)"
34+
// FIXME: some external code only match against AttackTagBloom. fix A4 if you uncomment this
35+
// atk.AttackTag = attacks.AttackTagBountifulCore
36+
atk.ICDTag = attacks.ICDTagBountifulCoreDamage
37+
})
3238
ap := combat.NewCircleHitOnTarget(b.Gadget, nil, 6.5)
3339
c.QueueAttackWithSnap(ai, snap, ap, 0)
3440

pkg/core/attacks/attack.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const (
2424
AttackTagSwirlElectro
2525
AttackTagBurningDamage
2626
AttackTagBloom
27+
AttackTagBountifulCore // special tag for nilou
2728
AttackTagBurgeon
2829
AttackTagHyperbloom
2930
AttackTagLength

pkg/core/attacks/icd.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ const (
3434
ICDTagSwirlElectro
3535
ICDTagBurningDamage
3636
ICDTagBloomDamage
37+
ICDTagBountifulCoreDamage // special tag for nilou
3738
ICDTagBurgeonDamage
3839
ICDTagHyperbloomDamage
3940

pkg/reactable/bloom.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func NewDendroCore(c *core.Core, shp geometry.Shape, a *combat.AttackEvent) *Den
117117
explode := func(reason string) func() {
118118
return func() {
119119
s.Core.Tasks.Add(func() {
120-
ai, snap := NewBloomAttack(char, s)
120+
ai, snap := NewBloomAttack(char, s, nil)
121121
ap := combat.NewCircleHitOnTarget(s, nil, 5)
122122
c.QueueAttackWithSnap(ai, snap, ap, 0)
123123

@@ -233,7 +233,7 @@ const (
233233
HyperbloomMultiplier = 3
234234
)
235235

236-
func NewBloomAttack(char *character.CharWrapper, src combat.Target) (combat.AttackInfo, combat.Snapshot) {
236+
func NewBloomAttack(char *character.CharWrapper, src combat.Target, modify func(*combat.AttackInfo)) (combat.AttackInfo, combat.Snapshot) {
237237
em := char.Stat(attributes.EM)
238238
ai := combat.AttackInfo{
239239
ActorIndex: char.Index,
@@ -246,6 +246,9 @@ func NewBloomAttack(char *character.CharWrapper, src combat.Target) (combat.Atta
246246
Abil: string(reactions.Bloom),
247247
IgnoreDefPercent: 1,
248248
}
249+
if modify != nil {
250+
modify(&ai)
251+
}
249252
flatdmg, snap := calcReactionDmg(char, ai, em)
250253
ai.FlatDmg = BloomMultiplier * flatdmg
251254
return ai, snap

0 commit comments

Comments
 (0)