Skip to content
Closed
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
7 changes: 6 additions & 1 deletion internal/characters/albedo/albedo.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type char struct {
c2stacks int
}

func NewChar(s *core.Core, w *character.CharWrapper, _ info.CharacterProfile) error {
func NewChar(s *core.Core, w *character.CharWrapper, p info.CharacterProfile) error {
c := char{}
c.Character = tmpl.NewWithWrapper(s, w)

Expand All @@ -34,6 +34,11 @@ func NewChar(s *core.Core, w *character.CharWrapper, _ info.CharacterProfile) er
c.SkillCon = 3
c.BurstCon = 5

isHexerei, ok := p.Params["is_hexerei"]
if ok && isHexerei != 0 {
c.Hexerei = 1
}

w.Character = &c

return nil
Expand Down
5 changes: 5 additions & 0 deletions internal/characters/fischl/fischl.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ func NewChar(s *core.Core, w *character.CharWrapper, p info.CharacterProfile) er
c.ozTravel = travel
}

isHexerei, ok := p.Params["is_hexerei"]
if ok && isHexerei != 0 {
c.Hexerei = 1
}

w.Character = &c

return nil
Expand Down
7 changes: 6 additions & 1 deletion internal/characters/klee/klee.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type char struct {
c1Chance float64
}

func NewChar(s *core.Core, w *character.CharWrapper, _ info.CharacterProfile) error {
func NewChar(s *core.Core, w *character.CharWrapper, p info.CharacterProfile) error {
c := char{}
c.Character = tmpl.NewWithWrapper(s, w)

Expand All @@ -29,6 +29,11 @@ func NewChar(s *core.Core, w *character.CharWrapper, _ info.CharacterProfile) er

c.SetNumCharges(action.ActionSkill, 2)

isHexerei, ok := p.Params["is_hexerei"]
if ok && isHexerei != 0 {
c.Hexerei = 1
}

w.Character = &c

return nil
Expand Down
7 changes: 6 additions & 1 deletion internal/characters/mona/mona.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type char struct {
c6Stacks int
}

func NewChar(s *core.Core, w *character.CharWrapper, _ info.CharacterProfile) error {
func NewChar(s *core.Core, w *character.CharWrapper, p info.CharacterProfile) error {
c := char{}
c.Character = tmpl.NewWithWrapper(s, w)

Expand All @@ -33,6 +33,11 @@ func NewChar(s *core.Core, w *character.CharWrapper, _ info.CharacterProfile) er
c.BurstCon = 3
c.SkillCon = 5

isHexerei, ok := p.Params["is_hexerei"]
if ok && isHexerei != 0 {
c.Hexerei = 1
}

w.Character = &c

return nil
Expand Down
7 changes: 6 additions & 1 deletion internal/characters/razor/razor.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type char struct {
c2bonus []float64
}

func NewChar(s *core.Core, w *character.CharWrapper, _ info.CharacterProfile) error {
func NewChar(s *core.Core, w *character.CharWrapper, p info.CharacterProfile) error {
c := char{}
c.Character = tmpl.NewWithWrapper(s, w)

Expand All @@ -30,6 +30,11 @@ func NewChar(s *core.Core, w *character.CharWrapper, _ info.CharacterProfile) er
c.SkillCon = 5
c.NormalHitNum = normalHitNum

isHexerei, ok := p.Params["is_hexerei"]
if ok && isHexerei != 0 {
c.Hexerei = 1
}

w.Character = &c

return nil
Expand Down
38 changes: 38 additions & 0 deletions internal/characters/sucrose/burst.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@ import (
"github.com/genshinsim/gcsim/pkg/core/attributes"
"github.com/genshinsim/gcsim/pkg/core/combat"
"github.com/genshinsim/gcsim/pkg/core/info"
"github.com/genshinsim/gcsim/pkg/core/player/character"
"github.com/genshinsim/gcsim/pkg/modifier"
)

var burstFrames []int

const burstHexBuffKey = "sucrose-hex-burst"

func init() {
burstFrames = frames.InitAbilSlice(65) // walk
burstFrames[action.ActionAttack] = 49
Expand Down Expand Up @@ -90,6 +94,7 @@ func (c *char) Burst(p map[string]int) (action.Info, error) {

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

return action.Info{
Frames: frames.NewAbilFunc(burstFrames),
Expand All @@ -116,3 +121,36 @@ func (c *char) absorbCheck(src, count, maxcount int) func() {
c.Core.Tasks.Add(c.absorbCheck(src, count+1, maxcount), 18)
}
}

func (c *char) witchesEveRiteBurst() {
if c.Hexerei != 1 {
return
}

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

m := make([]float64, attributes.EndStatType)
m[attributes.DmgP] = 0.5 / 7

for _, char := range c.Core.Player.Chars() {
char.AddAttackMod(character.AttackMod{
Base: modifier.NewBaseWithHitlag(burstHexBuffKey, 60*10),
Amount: func(atk *info.AttackEvent, t info.Target) []float64 {
switch atk.Info.AttackTag {
case attacks.AttackTagNormal:
case attacks.AttackTagExtra:
case attacks.AttackTagPlunge:
case attacks.AttackTagElementalArt:
case attacks.AttackTagElementalArtHold:
case attacks.AttackTagElementalBurst:
default:
return nil
}

return m
},
})
}
}
11 changes: 8 additions & 3 deletions internal/characters/sucrose/cons.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,19 @@ 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() {
m := make([]float64, attributes.EndStatType)
if c.Hexerei == 1 && char.Hexerei == 1 {
m[stat] = .20 + .6/7
} else {
m[stat] = .20
}

char.AddStatMod(character.StatMod{
Base: modifier.NewBaseWithHitlag("sucrose-c6", 60*10),
AffectedStat: stat,
Amount: func() []float64 {
return c.c6buff
return m
},
})
}
Expand Down
38 changes: 38 additions & 0 deletions internal/characters/sucrose/skill.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@ import (
"github.com/genshinsim/gcsim/pkg/core/attributes"
"github.com/genshinsim/gcsim/pkg/core/combat"
"github.com/genshinsim/gcsim/pkg/core/info"
"github.com/genshinsim/gcsim/pkg/core/player/character"
"github.com/genshinsim/gcsim/pkg/modifier"
)

var skillFrames []int

const particleICDKey = "sucrose-particle-icd"

const skillHexBuffKey = "sucrose-hex-skill"

func init() {
skillFrames = frames.InitAbilSlice(68) // walk
skillFrames[action.ActionAttack] = 57
Expand Down Expand Up @@ -60,6 +64,7 @@ func (c *char) Skill(p map[string]int) (action.Info, error) {

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

return action.Info{
Frames: frames.NewAbilFunc(skillFrames),
Expand All @@ -79,3 +84,36 @@ func (c *char) particleCB(a info.AttackCB) {
c.AddStatus(particleICDKey, 0.4*60, false)
c.Core.QueueParticle(c.Base.Key.String(), 4, attributes.Anemo, c.ParticleDelay)
}

func (c *char) witchesEveRiteSkill() {
if c.Hexerei != 1 {
return
}

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

m := make([]float64, attributes.EndStatType)
m[attributes.DmgP] = 0.4 / 7

for _, char := range c.Core.Player.Chars() {
char.AddAttackMod(character.AttackMod{
Base: modifier.NewBaseWithHitlag(skillHexBuffKey, 60*10),
Amount: func(atk *info.AttackEvent, t info.Target) []float64 {
switch atk.Info.AttackTag {
case attacks.AttackTagNormal:
case attacks.AttackTagExtra:
case attacks.AttackTagPlunge:
case attacks.AttackTagElementalArt:
case attacks.AttackTagElementalArtHold:
case attacks.AttackTagElementalBurst:
default:
return nil
}

return m
},
})
}
}
11 changes: 6 additions & 5 deletions internal/characters/sucrose/sucrose.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ type char struct {
a1Buff []float64
a4Buff []float64
c4Count int
c6buff []float64
}

func NewChar(s *core.Core, w *character.CharWrapper, _ info.CharacterProfile) error {
func NewChar(s *core.Core, w *character.CharWrapper, p info.CharacterProfile) error {
c := char{}
c.Character = tmpl.NewWithWrapper(s, w)

Expand All @@ -37,15 +36,17 @@ func NewChar(s *core.Core, w *character.CharWrapper, _ info.CharacterProfile) er
c.SetNumCharges(action.ActionSkill, 2)
}

isHexerei, ok := p.Params["is_hexerei"]
if ok && isHexerei != 0 {
c.Hexerei = 1
}

w.Character = &c

return nil
}

func (c *char) Init() error {
c.a1()
if c.Base.Cons >= 6 {
c.c6buff = make([]float64, attributes.EndStatType)
}
return nil
}
7 changes: 6 additions & 1 deletion internal/characters/venti/venti.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type char struct {
c4bonus []float64
}

func NewChar(s *core.Core, w *character.CharWrapper, _ info.CharacterProfile) error {
func NewChar(s *core.Core, w *character.CharWrapper, p info.CharacterProfile) error {
c := char{}
c.Character = tmpl.NewWithWrapper(s, w)

Expand All @@ -32,6 +32,11 @@ func NewChar(s *core.Core, w *character.CharWrapper, _ info.CharacterProfile) er
c.BurstCon = 3
c.SkillCon = 5

isHexerei, ok := p.Params["is_hexerei"]
if ok && isHexerei != 0 {
c.Hexerei = 1
}

w.Character = &c

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

Equip struct {
Weapon info.Weapon
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.Hexerei > 0 {
count++
}
}

return count
}