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
56 changes: 56 additions & 0 deletions internal/lightcone/nihility/boundlesschoreo/boundlesschoreo.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package boundlesschoreo

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 (
Choreo = "boundless-choreo"
Check = "boundless-choreo-cdmg"
)

// Increase the wearer's CRIT Rate by 8/10/12/14/16%.
// The wearer deals 24/30/36/42/48% more CRIT DMG to enemies that are currently Slowed or have reduced DEF.

func init() {
lightcone.Register(key.BoundlessChoreo, lightcone.Config{
CreatePassive: Create,
Rarity: 4,
Path: model.Path_NIHILITY,
Promotions: promotions,
})
modifier.Register(Check, modifier.Config{
Listeners: modifier.Listeners{
OnBeforeHitAll: applyCdmg,
},
})
}

func Create(engine engine.Engine, owner key.TargetID, lc info.LightCone) {
crAmt := 0.06 + 0.02*float64(lc.Imposition)
cdmgAmt := 0.18 + 0.06*float64(lc.Imposition)
engine.AddModifier(owner, info.Modifier{
Name: Check,
Source: owner,
Stats: info.PropMap{prop.CritChance: crAmt},
State: cdmgAmt,
})
}

func applyCdmg(mod *modifier.Instance, e event.HitStart) {
// bypass if both checks fail
if !mod.Engine().HasBehaviorFlag(e.Defender, model.BehaviorFlag_STAT_SPEED_DOWN) {
if !mod.Engine().HasBehaviorFlag(e.Defender, model.BehaviorFlag_STAT_DEF_DOWN) {
return
}
}

e.Hit.Attacker.AddProperty(Check, prop.CritDMG, mod.State().(float64))
}
71 changes: 71 additions & 0 deletions internal/lightcone/nihility/boundlesschoreo/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"
BoundlessChoreo LightCone = "boundless_choreo"
)

// 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 @@ -77,6 +77,7 @@ import (
_ "github.com/simimpact/srsim/internal/lightcone/hunt/subscribeformore"
_ "github.com/simimpact/srsim/internal/lightcone/hunt/swordplay"
_ "github.com/simimpact/srsim/internal/lightcone/nihility/beforethetutorialmissionstarts"
_ "github.com/simimpact/srsim/internal/lightcone/nihility/boundlesschoreo"
_ "github.com/simimpact/srsim/internal/lightcone/nihility/eyesoftheprey"
_ "github.com/simimpact/srsim/internal/lightcone/nihility/fermata"
_ "github.com/simimpact/srsim/internal/lightcone/nihility/goodnightandsleepwell"
Expand Down