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
100 changes: 99 additions & 1 deletion internal/characters/fischl/asc.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@ 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"
const (
a4IcdKey = "fischl-a4-icd"
hexAtkpKey = "fischl-hexerei-atkp"
hexEMKey = "fischl-hexerei-em"
)

// A1 is not implemented:
// TODO: When Fischl hits Oz with a fully-charged Aimed Shot, Oz brings down Thundering Retribution, dealing AoE Electro DMG equal to 152.7% of the arrow's DMG.
Expand Down Expand Up @@ -74,3 +80,95 @@ 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) hexInit() {
if !c.IsHexerei {
return
}

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

mAtkp := make([]float64, attributes.EndStatType)
mAtkp[attributes.ATKP] = 0.225
mEM := make([]float64, attributes.EndStatType)
mEM[attributes.EM] = 90

for _, other := range c.Core.Player.Chars() {
if other.Index() == c.Index() {
continue
}

other.AddStatMod(character.StatMod{
Base: modifier.NewBase(hexAtkpKey, -1),
AffectedStat: attributes.ATKP,
Amount: func() []float64 {
if c.Core.Player.Active() != other.Index() {
return nil
}
if !c.StatModIsActive(hexAtkpKey) {
return nil
}
mAtkp[attributes.ATKP] = 0.225 * (1 + c.c6HexBonus())
return mAtkp
},
})

other.AddStatMod(character.StatMod{
Base: modifier.NewBase(hexEMKey, -1),
AffectedStat: attributes.EM,
Amount: func() []float64 {
if c.Core.Player.Active() != other.Index() {
return nil
}
if !c.StatModIsActive(hexEMKey) {
return nil
}
mEM[attributes.EM] = 90 * (1 + c.c6HexBonus())
return mEM
},
})
}

atkpHook := func(args ...any) {
if _, ok := args[0].(*enemy.Enemy); !ok {
return
}
// do nothing if oz not on field
if !c.StatusIsActive(ozActiveKey) {
return
}

c.AddStatMod(character.StatMod{
Base: modifier.NewBaseWithHitlag(hexAtkpKey, 10*60),
AffectedStat: attributes.ATKP,
Amount: func() []float64 {
mAtkp[attributes.ATKP] = 0.225 * (1 + c.c6HexBonus())
return mAtkp
},
})
}
emHook := func(args ...any) {
if _, ok := args[0].(*enemy.Enemy); !ok {
return
}
// do nothing if oz not on field
if !c.StatusIsActive(ozActiveKey) {
return
}

c.AddStatMod(character.StatMod{
Base: modifier.NewBaseWithHitlag(hexEMKey, 10*60),
AffectedStat: attributes.EM,
Amount: func() []float64 {
mEM[attributes.EM] = 90 * (1 + c.c6HexBonus())
return mEM
},
})
}

c.Core.Events.Subscribe(event.OnOverload, atkpHook, "fischl-hex-ol")
c.Core.Events.Subscribe(event.OnElectroCharged, emHook, "fischl-hex-ec")
c.Core.Events.Subscribe(event.OnLunarCharged, emHook, "fischl-hex-lc")
}
16 changes: 16 additions & 0 deletions internal/characters/fischl/cons.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (
"github.com/genshinsim/gcsim/pkg/core/info"
)

const c6HexereiKey = "fischl-c6-hexerei"

func (c *char) c6Wave() {
ai := info.AttackInfo{
ActorIndex: c.Index(),
Expand All @@ -33,4 +35,18 @@ func (c *char) c6Wave() {
),
c.ozTravel,
)

c.AddStatus(c6HexereiKey, 10*60, true)
}

func (c *char) c6HexBonus() float64 {
if c.Base.Cons < 6 {
return 0
}

if !c.StatusIsActive(c6HexereiKey) {
return 0
}

return 1
}
9 changes: 8 additions & 1 deletion internal/characters/fischl/fischl.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,21 @@ func NewChar(s *core.Core, w *character.CharWrapper, p info.CharacterProfile) er
c.ozTravel = travel
}

hex, ok := p.Params["hexerei"]
if !ok {
// default hexerei is enabled
hex = 1
}
c.IsHexerei = (hex != 0)

w.Character = &c

return nil
}

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

c.hexInit()
if c.Base.Cons >= 6 {
w, err := minazuki.New(
minazuki.WithMandatory(keys.Fischl, "fischl c6", ozActiveKey, "", 60, c.c6Wave, c.Core),
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 @@ -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
}