Skip to content

Commit 69bac3c

Browse files
authored
varesa fixes (#2457)
* add action data for varesa * fix vivid buff for varesa mini burst * fix varesa a1 buff for mini burst
1 parent cfe747d commit 69bac3c

6 files changed

Lines changed: 84 additions & 19 deletions

File tree

internal/characters/varesa/asc.go

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,38 @@ import (
1212

1313
const a1Status = "rainbow-crash"
1414

15+
func (c *char) updateA1Bonus(src int) {
16+
if c.Base.Ascension < 1 {
17+
return
18+
}
19+
c.QueueCharTask(func() {
20+
if c.a1Src != src {
21+
return
22+
}
23+
c.a1Atk = c.TotalAtk()
24+
c.updateA1Bonus(src)
25+
}, 0.1*60)
26+
}
27+
1528
func (c *char) a1() {
1629
if c.Base.Ascension < 1 {
1730
return
1831
}
1932
c.AddStatus(a1Status, 5*60, true)
2033
}
2134

22-
func (c *char) a1PlungeBuff() float64 {
35+
func (c *char) a1PlungeBonus() float64 {
2336
if c.Base.Ascension < 1 {
2437
return 0.0
2538
}
2639
if !c.StatusIsActive(a1Status) {
2740
return 0.0
2841
}
42+
mult := 0.5
2943
if c.Base.Cons >= 1 || c.nightsoulState.HasBlessing() {
30-
return 1.8
44+
mult = 1.8
3145
}
32-
return 0.5
46+
return mult * c.a1Atk
3347
}
3448

3549
func (c *char) a1Cancel(a combat.AttackCB) {

internal/characters/varesa/burst.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ func (c *char) Burst(p map[string]int) (action.Info, error) {
9090
}
9191

9292
func (c *char) volcanicKablam() action.Info {
93+
if c.Base.Cons >= 1 {
94+
c.a1()
95+
}
96+
9397
ai := combat.AttackInfo{
9498
ActorIndex: c.Index,
9599
Abil: kablamAbil,
@@ -103,10 +107,7 @@ func (c *char) volcanicKablam() action.Info {
103107
Durability: 25,
104108
Mult: kablam[c.TalentLvlBurst()],
105109
HitlagFactor: 0.1,
106-
}
107-
108-
if c.Base.Cons >= 1 {
109-
c.a1()
110+
FlatDmg: c.a1PlungeBonus(),
110111
}
111112

112113
c.Core.Tasks.Add(func() {
@@ -115,6 +116,7 @@ func (c *char) volcanicKablam() action.Info {
115116
combat.NewCircleHit(c.Core.Combat.Player(), c.Core.Combat.PrimaryTarget(), geometry.Point{Y: 1}, 7.5),
116117
0,
117118
0,
119+
c.a1Cancel,
118120
)
119121
c.DeleteStatus(apexState)
120122
}, kablamHitmark)
@@ -127,7 +129,7 @@ func (c *char) volcanicKablam() action.Info {
127129
Frames: frames.NewAbilFunc(volcanicFrames),
128130
AnimationLength: volcanicFrames[action.InvalidAction],
129131
CanQueueAfter: volcanicFrames[action.ActionSwap],
130-
State: action.BurstState, // TODO: or plunge state?
132+
State: action.PlungeAttackState,
131133
OnRemoved: func(next action.AnimationState) {
132134
c.clearNightsoulCB(next)
133135
c.usedShortBurst = false

internal/characters/varesa/plunge.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ func (c *char) highPlungeCA(p map[string]int) action.Info {
158158
Element: attributes.Electro,
159159
Durability: 25,
160160
Mult: highPlunge[c.TalentLvlAttack()],
161-
FlatDmg: c.c4FlatBonus(),
161+
FlatDmg: c.a1PlungeBonus() + c.c4FlatBonus(),
162162
HitlagFactor: 0.1,
163163
}
164164

@@ -176,7 +176,6 @@ func (c *char) highPlungeCA(p map[string]int) action.Info {
176176
} else {
177177
c.QueueCharTask(c.generatePlungeNightsoul, hitmark)
178178
}
179-
ai.Mult += c.a1PlungeBuff()
180179
c.getApexDrive()
181180

182181
c.Core.QueueAttack(
@@ -219,7 +218,7 @@ func (c *char) highPlungeXY(p map[string]int) action.Info {
219218
Element: attributes.Electro,
220219
Durability: 25,
221220
Mult: highPlunge[c.TalentLvlAttack()],
222-
FlatDmg: c.c4FlatBonus(),
221+
FlatDmg: c.a1PlungeBonus() + c.c4FlatBonus(),
223222
HitlagFactor: 0.1,
224223
}
225224

@@ -237,7 +236,6 @@ func (c *char) highPlungeXY(p map[string]int) action.Info {
237236
} else {
238237
c.QueueCharTask(c.generatePlungeNightsoul, hitmark)
239238
}
240-
ai.Mult += c.a1PlungeBuff()
241239
c.getApexDrive()
242240

243241
c.Core.QueueAttack(
@@ -280,7 +278,7 @@ func (c *char) lowPlungeXY(p map[string]int) action.Info {
280278
Element: attributes.Electro,
281279
Durability: 25,
282280
Mult: lowPlunge[c.TalentLvlAttack()],
283-
FlatDmg: c.c4FlatBonus(),
281+
FlatDmg: c.a1PlungeBonus() + c.c4FlatBonus(),
284282
HitlagFactor: 0.1,
285283
}
286284

@@ -298,7 +296,6 @@ func (c *char) lowPlungeXY(p map[string]int) action.Info {
298296
} else {
299297
c.QueueCharTask(c.generatePlungeNightsoul, hitmark)
300298
}
301-
ai.Mult += c.a1PlungeBuff()
302299
c.getApexDrive()
303300

304301
c.Core.QueueAttack(

internal/characters/varesa/varesa.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ type char struct {
2323
particleGenerated bool
2424
freeSkill bool
2525
exitNS bool
26+
a1Src int
27+
a1Atk float64
2628
a4Stacks *stacks.MultipleRefreshNoRemove
2729
usedShortBurst bool
2830
}
@@ -47,6 +49,8 @@ func NewChar(s *core.Core, w *character.CharWrapper, _ info.CharacterProfile) er
4749
}
4850

4951
func (c *char) Init() error {
52+
c.a1Src = c.Core.F
53+
c.updateA1Bonus(c.a1Src)
5054
c.a4()
5155
c.c4()
5256
c.c6()

internal/weapons/catalyst/vividnotions/vividnotions.go

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"fmt"
55

66
"github.com/genshinsim/gcsim/pkg/core"
7+
"github.com/genshinsim/gcsim/pkg/core/action"
78
"github.com/genshinsim/gcsim/pkg/core/attacks"
89
"github.com/genshinsim/gcsim/pkg/core/attributes"
910
"github.com/genshinsim/gcsim/pkg/core/combat"
@@ -65,8 +66,11 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile)
6566
},
6667
})
6768

68-
c.Events.Subscribe(event.OnPlunge, func(args ...interface{}) bool {
69-
char.AddStatus(plungeBuff, 15*60, true)
69+
c.Events.Subscribe(event.OnStateChange, func(args ...interface{}) bool {
70+
next := args[1].(action.AnimationState)
71+
if next == action.PlungeAttackState {
72+
char.AddStatus(plungeBuff, 15*60, true)
73+
}
7074
return false
7175
}, fmt.Sprintf("vividnotions-plunge-%s", char.Base.Key.String()))
7276

@@ -93,10 +97,16 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile)
9397
}
9498

9599
// TODO: hitlag affected?
100+
plungeF := char.StatusExpiry(plungeBuff)
101+
skillBurstF := char.StatusExpiry(skillBurstBuff)
96102
char.QueueCharTask(func() {
97-
char.DeleteStatus(plungeBuff)
98-
char.DeleteStatus(skillBurstBuff)
99-
}, 0.05*60)
103+
if plungeF == char.StatusExpiry(plungeBuff) {
104+
char.DeleteStatus(plungeBuff)
105+
}
106+
if skillBurstF == char.StatusExpiry(skillBurstBuff) {
107+
char.DeleteStatus(skillBurstBuff)
108+
}
109+
}, 0.1*60)
100110

101111
return false
102112
}, fmt.Sprintf("vividnotions-%s", char.Base.Key.String()))

ui/packages/docs/src/components/Actions/character_data.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3149,6 +3149,44 @@
31493149
"legal": true
31503150
}
31513151
],
3152+
"varesa": [
3153+
{
3154+
"ability": "attack",
3155+
"legal": true
3156+
},
3157+
{
3158+
"ability": "skill",
3159+
"notes": "Hold skill is not implemented."
3160+
},
3161+
{
3162+
"ability": "burst",
3163+
"legal": true
3164+
},
3165+
{
3166+
"ability": "high_plunge",
3167+
"notes": "Previous action must be charge or jump buffed via Xianyun's burst for example."
3168+
},
3169+
{
3170+
"ability": "low_plunge",
3171+
"notes": "Previous action must be jump buffed via Xianyun's burst for example."
3172+
},
3173+
{
3174+
"ability": "dash",
3175+
"legal": true
3176+
},
3177+
{
3178+
"ability": "jump",
3179+
"legal": true
3180+
},
3181+
{
3182+
"ability": "walk",
3183+
"legal": true
3184+
},
3185+
{
3186+
"ability": "swap",
3187+
"legal": true
3188+
}
3189+
],
31523190
"venti": [
31533191
{
31543192
"ability": "attack",

0 commit comments

Comments
 (0)