Skip to content

Commit

Permalink
Fix regression in Nilou A4 caused by bloom snapshot (#2345)
Browse files Browse the repository at this point in the history
  • Loading branch information
shizukayuki authored Feb 19, 2025
1 parent cea8dc9 commit ab67431
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
10 changes: 1 addition & 9 deletions internal/characters/nilou/asc.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,7 @@ func (c *char) a4() {
if ai.AttackTag != attacks.AttackTagBloom {
return 0, false
}

// check is bountiful core?
var t combat.Gadget
for _, v := range c.Core.Combat.Gadgets() {
if v != nil && v.Key() == ai.DamageSrc {
t = v
}
}
if _, ok := t.(*BountifulCore); !ok {
if ai.ICDTag != attacks.ICDTagBountifulCoreDamage {
return 0, false
}

Expand Down
8 changes: 7 additions & 1 deletion internal/characters/nilou/bountifulcore.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package nilou

import (
"github.com/genshinsim/gcsim/pkg/core"
"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/geometry"
Expand All @@ -28,7 +29,12 @@ func newBountifulCore(c *core.Core, p geometry.Point, a *combat.AttackEvent) *Bo
char := b.Core.Player.ByIndex(a.Info.ActorIndex)
explode := func() {
c.Tasks.Add(func() {
ai, snap := reactable.NewBloomAttack(char, b)
ai, snap := reactable.NewBloomAttack(char, b, func(atk *combat.AttackInfo) {
// atk.Abil += " (bountiful core)"
// FIXME: some external code only match against AttackTagBloom. fix A4 if you uncomment this
// atk.AttackTag = attacks.AttackTagBountifulCore
atk.ICDTag = attacks.ICDTagBountifulCoreDamage
})
ap := combat.NewCircleHitOnTarget(b.Gadget, nil, 6.5)
c.QueueAttackWithSnap(ai, snap, ap, 0)

Expand Down
1 change: 1 addition & 0 deletions pkg/core/attacks/attack.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const (
AttackTagSwirlElectro
AttackTagBurningDamage
AttackTagBloom
AttackTagBountifulCore // special tag for nilou
AttackTagBurgeon
AttackTagHyperbloom
AttackTagLength
Expand Down
1 change: 1 addition & 0 deletions pkg/core/attacks/icd.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const (
ICDTagSwirlElectro
ICDTagBurningDamage
ICDTagBloomDamage
ICDTagBountifulCoreDamage // special tag for nilou
ICDTagBurgeonDamage
ICDTagHyperbloomDamage

Expand Down
7 changes: 5 additions & 2 deletions pkg/reactable/bloom.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func NewDendroCore(c *core.Core, shp geometry.Shape, a *combat.AttackEvent) *Den
explode := func(reason string) func() {
return func() {
s.Core.Tasks.Add(func() {
ai, snap := NewBloomAttack(char, s)
ai, snap := NewBloomAttack(char, s, nil)
ap := combat.NewCircleHitOnTarget(s, nil, 5)
c.QueueAttackWithSnap(ai, snap, ap, 0)

Expand Down Expand Up @@ -233,7 +233,7 @@ const (
HyperbloomMultiplier = 3
)

func NewBloomAttack(char *character.CharWrapper, src combat.Target) (combat.AttackInfo, combat.Snapshot) {
func NewBloomAttack(char *character.CharWrapper, src combat.Target, modify func(*combat.AttackInfo)) (combat.AttackInfo, combat.Snapshot) {
em := char.Stat(attributes.EM)
ai := combat.AttackInfo{
ActorIndex: char.Index,
Expand All @@ -246,6 +246,9 @@ func NewBloomAttack(char *character.CharWrapper, src combat.Target) (combat.Atta
Abil: string(reactions.Bloom),
IgnoreDefPercent: 1,
}
if modify != nil {
modify(&ai)
}
flatdmg, snap := calcReactionDmg(char, ai, em)
ai.FlatDmg = BloomMultiplier * flatdmg
return ai, snap
Expand Down

0 comments on commit ab67431

Please sign in to comment.