diff --git a/internal/lightcone/hunt/worrisomeblissful/data.go b/internal/lightcone/hunt/worrisomeblissful/data.go new file mode 100644 index 00000000..d14d9476 --- /dev/null +++ b/internal/lightcone/hunt/worrisomeblissful/data.go @@ -0,0 +1,71 @@ +// Code generated by "weapstat"; DO NOT EDIT. + +package worrisomeblissful + +import "github.com/simimpact/srsim/pkg/engine/equip/lightcone" + +var promotions = []lightcone.PromotionData{ + { + MaxLevel: 20, + HPBase: 48, + HPAdd: 7.2, + ATKBase: 26.4, + ATKAdd: 3.96, + DEFBase: 21, + DEFAdd: 3.15, + }, + { + MaxLevel: 30, + HPBase: 105.6, + HPAdd: 7.2, + ATKBase: 58.08, + ATKAdd: 3.96, + DEFBase: 46.2, + DEFAdd: 3.15, + }, + { + MaxLevel: 40, + HPBase: 182.4, + HPAdd: 7.2, + ATKBase: 100.32, + ATKAdd: 3.96, + DEFBase: 79.8, + DEFAdd: 3.15, + }, + { + MaxLevel: 50, + HPBase: 259.2, + HPAdd: 7.2, + ATKBase: 142.56, + ATKAdd: 3.96, + DEFBase: 113.4, + DEFAdd: 3.15, + }, + { + MaxLevel: 60, + HPBase: 336, + HPAdd: 7.2, + ATKBase: 184.8, + ATKAdd: 3.96, + DEFBase: 147, + DEFAdd: 3.15, + }, + { + MaxLevel: 70, + HPBase: 412.8, + HPAdd: 7.2, + ATKBase: 227.04, + ATKAdd: 3.96, + DEFBase: 180.6, + DEFAdd: 3.15, + }, + { + MaxLevel: 80, + HPBase: 489.6, + HPAdd: 7.2, + ATKBase: 269.28, + ATKAdd: 3.96, + DEFBase: 214.2, + DEFAdd: 3.15, + }, +} \ No newline at end of file diff --git a/internal/lightcone/hunt/worrisomeblissful/worrisomeblissful.go b/internal/lightcone/hunt/worrisomeblissful/worrisomeblissful.go new file mode 100644 index 00000000..993fd746 --- /dev/null +++ b/internal/lightcone/hunt/worrisomeblissful/worrisomeblissful.go @@ -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) + } +} diff --git a/pkg/key/lightcone.go b/pkg/key/lightcone.go index bf2afa89..39403d48 100644 --- a/pkg/key/lightcone.go +++ b/pkg/key/lightcone.go @@ -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 diff --git a/pkg/simulation/imports.go b/pkg/simulation/imports.go index 78e8c59e..38dece0c 100644 --- a/pkg/simulation/imports.go +++ b/pkg/simulation/imports.go @@ -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"