Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
package alongthepassingshore

import (
"github.com/simimpact/srsim/pkg/engine"
"github.com/simimpact/srsim/pkg/engine/equip/lightcone"
"github.com/simimpact/srsim/pkg/engine/event"
"github.com/simimpact/srsim/pkg/engine/info"
"github.com/simimpact/srsim/pkg/engine/modifier"
"github.com/simimpact/srsim/pkg/engine/prop"
"github.com/simimpact/srsim/pkg/key"
"github.com/simimpact/srsim/pkg/model"
)

const (
Check = "along-the-passing-shore"
MirageFizzle = "along-the-passing-shore-mirage-fizzle"
Cooldown = "along-the-passing-shore-mirage-fizzle-cooldown"
)

// Increases the wearer's CRIT DMG by 36/42/48/54/60%. When the wearer hits an enemy target,
// inflicts Mirage Fizzle on the enemy, lasting for 1 turn. Each time the wearer attacks,
// this effect can only trigger 1 time on each target. The wearer deals 24/28/32/36/40% increased DMG to targets
// afflicted with Mirage Fizzle, and the DMG dealt by Ultimate additionally increases by 24/28/32/36/40%.

func init() {
lightcone.Register(key.AlongthePassingShore, lightcone.Config{
CreatePassive: Create,
Rarity: 5,
Path: model.Path_NIHILITY,
Promotions: promotions,
})

modifier.Register(Check, modifier.Config{
Listeners: modifier.Listeners{
OnBeforeHit: applyMirageFizzle,
OnBeforeHitAll: applyDmgBonus,
OnAfterAttack: removeCooldown,
},
})

modifier.Register(MirageFizzle, modifier.Config{
Stacking: modifier.ReplaceBySource,
StatusType: model.StatusType_STATUS_DEBUFF,
})

modifier.Register(Cooldown, modifier.Config{})
}

func Create(engine engine.Engine, owner key.TargetID, lc info.LightCone) {
cdmgAmt := 0.3 + 0.06*float64(lc.Imposition)
dmgAmt := 0.2 + 0.04*float64(lc.Imposition)
engine.AddModifier(owner, info.Modifier{
Name: Check,
Source: owner,
Stats: info.PropMap{prop.CritDMG: cdmgAmt},
State: dmgAmt,
})
}

func applyMirageFizzle(mod *modifier.Instance, e event.HitStart) {
if mod.Engine().HasModifierFromSource(e.Defender, mod.Owner(), Cooldown) {
return
}
success, _ := mod.Engine().AddModifier(e.Defender, info.Modifier{
Name: MirageFizzle,
Source: mod.Owner(),
Duration: 1,
})
if success {
mod.Engine().AddModifier(e.Defender, info.Modifier{
Name: Cooldown,
Source: mod.Owner(),
})
}
}

func applyDmgBonus(mod *modifier.Instance, e event.HitStart) {
if mod.Engine().HasModifierFromSource(e.Defender, mod.Owner(), MirageFizzle) {
dmgBonus := mod.State().(float64)
if e.Hit.AttackType == model.AttackType_ULT {
dmgBonus *= 2
}
e.Hit.Attacker.AddProperty(MirageFizzle, prop.AllDamagePercent, dmgBonus)
}
}

func removeCooldown(mod *modifier.Instance, e event.AttackEnd) {
for _, trg := range mod.Engine().Enemies() {
mod.Engine().RemoveModifier(trg, Cooldown)
}
}
71 changes: 71 additions & 0 deletions internal/lightcone/nihility/alongthepassingshore/data.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkg/key/lightcone.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const (
WeWillMeetAgain LightCone = "we_will_meet_again"
Void LightCone = "void"
PatienceIsAllYouNeed LightCone = "patience_is_all_you_need"
AlongthePassingShore LightCone = "along_the_passing_shore"
)

// Erudition
Expand Down
1 change: 1 addition & 0 deletions pkg/simulation/imports.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ import (
_ "github.com/simimpact/srsim/internal/lightcone/hunt/sleeplikethedead"
_ "github.com/simimpact/srsim/internal/lightcone/hunt/subscribeformore"
_ "github.com/simimpact/srsim/internal/lightcone/hunt/swordplay"
_ "github.com/simimpact/srsim/internal/lightcone/nihility/alongthepassingshore"
_ "github.com/simimpact/srsim/internal/lightcone/nihility/beforethetutorialmissionstarts"
_ "github.com/simimpact/srsim/internal/lightcone/nihility/eyesoftheprey"
_ "github.com/simimpact/srsim/internal/lightcone/nihility/fermata"
Expand Down