Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions internal/characters/sucrose/asc.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package sucrose

import (
"github.com/genshinsim/gcsim/pkg/core/attacks"
"github.com/genshinsim/gcsim/pkg/core/attributes"
"github.com/genshinsim/gcsim/pkg/core/event"
"github.com/genshinsim/gcsim/pkg/core/glog"
Expand Down Expand Up @@ -91,3 +92,84 @@ func (c *char) a4() {
Write("em snapshot", c.a4Buff[attributes.EM]).
Write("expiry", c.Core.F+480)
}

func (c *char) hexInit() {
if !c.IsHexerei {
return
}

if c.Core.Player.GetHexereiCount() < 2 {
return
}

c.hexereiBuffSkill = make([]float64, attributes.EndStatType)
c.hexereiBuffSkill[attributes.DmgP] = 0.0571428

c.hexereiBuffBurst = make([]float64, attributes.EndStatType)
c.hexereiBuffBurst[attributes.DmgP] = 0.0714285
}

func (c *char) hexOnSkill() {
if !c.IsHexerei {
return
}

if c.Core.Player.GetHexereiCount() < 2 {
return
}

for _, char := range c.Core.Player.Chars() {
// TODO: Whose hitlag does this use?
char.AddAttackMod(character.AttackMod{
Base: modifier.NewBaseWithHitlag("sucrose-hexerei-skill", 15*60),
Amount: func(atk *info.AttackEvent, t info.Target) []float64 {
switch atk.Info.AttackTag {
case attacks.AttackTagNormal,
attacks.AttackTagExtra,
attacks.AttackTagPlunge,
attacks.AttackTagElementalArt,
attacks.AttackTagElementalArtHold,
attacks.AttackTagElementalBurst:
default:
return nil
}

return c.hexereiBuffSkill
},
})
}
}

func (c *char) hexOnBurst() {
if !c.IsHexerei {
return
}

if c.Core.Player.GetHexereiCount() < 2 {
return
}

for _, char := range c.Core.Player.Chars() {
if !char.IsHexerei {
continue
}
// TODO: Whose hitlag does this use?
char.AddAttackMod(character.AttackMod{
Base: modifier.NewBaseWithHitlag("sucrose-hexerei-burst", 20*60),
Amount: func(atk *info.AttackEvent, t info.Target) []float64 {
switch atk.Info.AttackTag {
case attacks.AttackTagNormal,
attacks.AttackTagExtra,
attacks.AttackTagPlunge,
attacks.AttackTagElementalArt,
attacks.AttackTagElementalArtHold,
attacks.AttackTagElementalBurst:
default:
return nil
}

return c.hexereiBuffBurst
},
})
}
}
1 change: 1 addition & 0 deletions internal/characters/sucrose/burst.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ func (c *char) Burst(p map[string]int) (action.Info, error) {

c.SetCDWithDelay(action.ActionBurst, 1200, 18)
c.ConsumeEnergy(21)
c.hexOnBurst()

return action.Info{
Frames: frames.NewAbilFunc(burstFrames),
Expand Down
5 changes: 4 additions & 1 deletion internal/characters/sucrose/cons.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,16 @@ func (c *char) makeC4Callback() func(info.AttackCB) {

func (c *char) c6() {
stat := attributes.EleToDmgP(c.qAbsorb)
c.c6buff[stat] = .20

for _, char := range c.Core.Player.Chars() {
char.AddStatMod(character.StatMod{
Base: modifier.NewBaseWithHitlag("sucrose-c6", 60*10),
AffectedStat: stat,
Amount: func() []float64 {
c.c6buff[stat] = .20
if char.IsHexerei {
c.c6buff[stat] += 0.0857142
}
return c.c6buff
},
})
Expand Down
1 change: 1 addition & 0 deletions internal/characters/sucrose/skill.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func (c *char) Skill(p map[string]int) (action.Info, error) {

// reduce charge by 1
c.SetCDWithDelay(action.ActionSkill, 900, 9)
c.hexOnSkill()

return action.Info{
Frames: frames.NewAbilFunc(skillFrames),
Expand Down
5 changes: 5 additions & 0 deletions internal/characters/sucrose/sucrose.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ type char struct {
a4Buff []float64
c4Count int
c6buff []float64
hexereiBuffSkill []float64
hexereiBuffBurst []float64
}

func NewChar(s *core.Core, w *character.CharWrapper, _ info.CharacterProfile) error {
Expand All @@ -47,5 +49,8 @@ func (c *char) Init() error {
if c.Base.Cons >= 6 {
c.c6buff = make([]float64, attributes.EndStatType)
}

c.hexInit()

return nil
}
1 change: 1 addition & 0 deletions pkg/core/player/character/character.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ type CharWrapper struct {
SkillCon int
BurstCon int
HasArkhe bool
IsHexerei bool
Moonsign int

Equip struct {
Expand Down
11 changes: 11 additions & 0 deletions pkg/core/player/player.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,3 +406,14 @@ func (h *Handler) GetMoonsignLevel() int {
}
return count
}

func (h *Handler) GetHexereiCount() int {
count := 0
for _, char := range h.chars {
if char.IsHexerei {
count++
}
}

return count
}