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
71 changes: 71 additions & 0 deletions internal/lightcone/hunt/worrisomeblissful/data.go

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

102 changes: 102 additions & 0 deletions internal/lightcone/hunt/worrisomeblissful/worrisomeblissful.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
package worrisomeblissful

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 = "worrisome-blissful"
Tame = "worrisome-blissful-cdmg-debuff"
)

type state struct {
fuaflag bool
dmgBonus float64
cdmgBonus float64
}

// Increase the wearer's CRIT Rate by 18/21/24/27/30% and increases DMG dealt by follow-up attack by 30/35/40/45/50%.
// After the wearer uses a follow-up attack, inflicts the target with the Tame state, stacking up to 2 time(s).
// When allies hit enemy targets under the Tame state, each Tame stack increases the CRIT DMG dealt by 12/14/16/18/20%.

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

modifier.Register(Check, modifier.Config{
Listeners: modifier.Listeners{
OnBeforeHitAll: buffFuaDmg,
OnAfterAttack: applyTame,
},
})

modifier.Register(Tame, modifier.Config{
StatusType: model.StatusType_STATUS_DEBUFF,
Stacking: modifier.ReplaceBySource,
CanDispel: true,
MaxCount: 2,
CountAddWhenStack: 1,
Listeners: modifier.Listeners{
OnBeforeBeingHitAll: buffCdmg,
},
})
}

func Create(engine engine.Engine, owner key.TargetID, lc info.LightCone) {
crAmt := 0.15 + 0.03*float64(lc.Imposition)
dmgAmt := 0.25 + 0.05*float64(lc.Imposition)
cdmgAmt := 0.1 + 0.02*float64(lc.Imposition)
engine.AddModifier(owner, info.Modifier{
Name: Check,
Source: owner,
Stats: info.PropMap{
prop.CritChance: crAmt,
},
State: &state{
fuaflag: false,
dmgBonus: dmgAmt,
cdmgBonus: cdmgAmt,
},
})
}

func buffFuaDmg(mod *modifier.Instance, e event.HitStart) {
if e.Hit.AttackType == model.AttackType_INSERT {
st := mod.State().(*state)
e.Hit.Attacker.AddProperty(Check, prop.AllDamagePercent, st.dmgBonus)
// flag for checking whether to apply Tame debuff
st.fuaflag = true
}
}

func applyTame(mod *modifier.Instance, e event.AttackEnd) {
st := mod.State().(*state)
if st.fuaflag {
for _, trg := range e.Targets {
mod.Engine().AddModifier(trg, info.Modifier{
Name: Tame,
Source: mod.Owner(),
State: st.cdmgBonus,
})
}
st.fuaflag = false
}
}

func buffCdmg(mod *modifier.Instance, e event.HitStart) {
if mod.Engine().IsCharacter(e.Attacker) {
cdmgBonus := mod.State().(float64)
e.Hit.Attacker.AddProperty(Tame, prop.CritDMG, mod.Count()*cdmgBonus)
}
}
1 change: 1 addition & 0 deletions pkg/key/lightcone.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const (
ReturntoDarkness LightCone = "return_to_darkness"
SleepLiketheDead LightCone = "sleep_like_the_dead"
IntheNight LightCone = "in_the_night"
WorrisomeBlissful LightCone = "worrisome_blissful"
)

// Nihility
Expand Down
1 change: 1 addition & 0 deletions pkg/simulation/imports.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,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/hunt/worrisomeblissful"
_ "github.com/simimpact/srsim/internal/lightcone/nihility/alongthepassingshore"
_ "github.com/simimpact/srsim/internal/lightcone/nihility/beforethetutorialmissionstarts"
_ "github.com/simimpact/srsim/internal/lightcone/nihility/eyesoftheprey"
Expand Down
Loading