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
105 changes: 105 additions & 0 deletions internal/characters/fischl/asc.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import (
"github.com/genshinsim/gcsim/pkg/core/combat"
"github.com/genshinsim/gcsim/pkg/core/event"
"github.com/genshinsim/gcsim/pkg/core/info"
"github.com/genshinsim/gcsim/pkg/core/player/character"
"github.com/genshinsim/gcsim/pkg/enemy"
"github.com/genshinsim/gcsim/pkg/modifier"
)

const a4IcdKey = "fischl-a4-icd"
Expand Down Expand Up @@ -74,3 +76,106 @@ func (c *char) a4() {
c.Core.Events.Subscribe(event.OnQuicken, a4cbNoGadget, "fischl-a4")
c.Core.Events.Subscribe(event.OnAggravate, a4cbNoGadget, "fischl-a4")
}

func (c *char) witchesEveRite() {
// if is hexerei
if c.Hexerei != 1 {
return
}

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

olF := func(args ...any) {
m := make([]float64, attributes.EndStatType)
m[attributes.ATKP] = 0.225

c.AddStatMod(character.StatMod{
Base: modifier.NewBaseWithHitlag("fischl-hex-overload", 10*60),
AffectedStat: attributes.ATKP,
Amount: func() []float64 {
return m
},
})

c.Core.Player.ActiveChar().AddStatMod(character.StatMod{
Base: modifier.NewBaseWithHitlag("fischl-hex-overload", 10*60),
AffectedStat: attributes.ATKP,
Amount: func() []float64 {
return m
},
})
}

ecF := func(args ...any) {
m := make([]float64, attributes.EndStatType)
m[attributes.EM] = 90

c.AddStatMod(character.StatMod{
Base: modifier.NewBaseWithHitlag("fischl-hex-electrocharged", 10*60),
AffectedStat: attributes.EM,
Amount: func() []float64 {
return m
},
})

c.Core.Player.ActiveChar().AddStatMod(character.StatMod{
Base: modifier.NewBaseWithHitlag("fischl-hex-electrocharged", 10*60),
AffectedStat: attributes.EM,
Amount: func() []float64 {
return m
},
})
}

updateBuffForActive := func(args ...any) {
// swap should update buff for new active char and remove from old active char
prev := args[0].(int)
next := args[1].(int)

statMods := []string{"fischl-hex-overload", "fischl-hex-electrocharged", "fischl-hex-overload-c6", "fischl-hex-electrocharged-c6"}

for _, mod := range statMods {
if c.StatModIsActive(mod) {
if prev != c.Index() {
c.Core.Player.Chars()[prev].DeleteStatMod(mod)
}
m := make([]float64, attributes.EndStatType)

if mod == "fischl-hex-overload" || mod == "fischl-hex-overload-c6" {
m[attributes.ATKP] = 0.225
} else {
m[attributes.EM] = 90
}

c.Core.Player.Chars()[next].AddStatMod(character.StatMod{
Base: modifier.NewBaseWithHitlag(mod, 10*60),
Amount: func() []float64 {
return m
},
})
}
}

if c.StatModIsActive("fischl-hex-electrocharged") {
if prev != c.Index() {
c.Core.Player.Chars()[prev].DeleteStatMod("fischl-hex-electrocharged")
}
m := make([]float64, attributes.EndStatType)
m[attributes.EM] = 90

c.Core.Player.Chars()[next].AddStatMod(character.StatMod{
Base: modifier.NewBaseWithHitlag("fischl-hex-electrocharged", 10*60),
AffectedStat: attributes.EM,
Amount: func() []float64 {
return m
},
})
}
}

c.Core.Events.Subscribe(event.OnOverload, olF, "fischl-hex-overload")
c.Core.Events.Subscribe(event.OnElectroCharged, ecF, "fischl-hex-electrocharged")
c.Core.Events.Subscribe(event.OnCharacterSwap, updateBuffForActive, "fischl-hex-update-buff")
}
57 changes: 57 additions & 0 deletions internal/characters/fischl/cons.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ 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"
)

func (c *char) c6Wave() {
Expand Down Expand Up @@ -33,4 +35,59 @@ func (c *char) c6Wave() {
),
c.ozTravel,
)

c.c6Hexerei()
}

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

if c.Core.Player.GetHexereiCount() < 2 {
return
}
if c.StatModIsActive("fischl-hex-overload") {
duration := c.StatusDuration("fischl-hex-overload")
m := make([]float64, attributes.EndStatType)
m[attributes.ATKP] = 0.225

c.AddStatMod(character.StatMod{
Base: modifier.NewBaseWithHitlag("fischl-hex-overload-c6", duration),
AffectedStat: attributes.ATKP,
Amount: func() []float64 {
return m
},
})

c.Core.Player.ActiveChar().AddStatMod(character.StatMod{
Base: modifier.NewBaseWithHitlag("fischl-hex-overload-c6", duration),
AffectedStat: attributes.EM,
Amount: func() []float64 {
return m
},
})
}

if c.StatModIsActive("fischl-hex-electrocharged") {
duration := c.StatusDuration("fischl-hex-electrocharged")
m := make([]float64, attributes.EndStatType)
m[attributes.EM] = 90

c.AddStatMod(character.StatMod{
Base: modifier.NewBaseWithHitlag("fischl-hex-electrocharged-c6", duration),
AffectedStat: attributes.EM,
Amount: func() []float64 {
return m
},
})

c.Core.Player.ActiveChar().AddStatMod(character.StatMod{
Base: modifier.NewBaseWithHitlag("fischl-hex-electrocharged-c6", duration),
AffectedStat: attributes.EM,
Amount: func() []float64 {
return m
},
})
}
}
6 changes: 6 additions & 0 deletions internal/characters/fischl/fischl.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,19 @@ 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
}

func (c *char) Init() error {
c.a4()
c.witchesEveRite()

if c.Base.Cons >= 6 {
w, err := minazuki.New(
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
7 changes: 6 additions & 1 deletion internal/characters/sucrose/sucrose.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type char struct {
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,6 +37,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/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
}