diff --git a/internal/lightcone/preservation/destinysthreadsforewoven/data.go b/internal/lightcone/preservation/destinysthreadsforewoven/data.go new file mode 100644 index 00000000..825637c5 --- /dev/null +++ b/internal/lightcone/preservation/destinysthreadsforewoven/data.go @@ -0,0 +1,71 @@ +// Code generated by "weapstat"; DO NOT EDIT. + +package destinysthreadsforewoven + +import "github.com/simimpact/srsim/pkg/engine/equip/lightcone" + +var promotions = []lightcone.PromotionData{ + { + MaxLevel: 20, + HPBase: 43.2, + HPAdd: 6.48, + ATKBase: 16.8, + ATKAdd: 2.52, + DEFBase: 21, + DEFAdd: 3.15, + }, + { + MaxLevel: 30, + HPBase: 95.04, + HPAdd: 6.48, + ATKBase: 36.96, + ATKAdd: 2.52, + DEFBase: 46.2, + DEFAdd: 3.15, + }, + { + MaxLevel: 40, + HPBase: 164.16, + HPAdd: 6.48, + ATKBase: 63.84, + ATKAdd: 2.52, + DEFBase: 79.8, + DEFAdd: 3.15, + }, + { + MaxLevel: 50, + HPBase: 233.28, + HPAdd: 6.48, + ATKBase: 90.72, + ATKAdd: 2.52, + DEFBase: 113.4, + DEFAdd: 3.15, + }, + { + MaxLevel: 60, + HPBase: 302.4, + HPAdd: 6.48, + ATKBase: 117.6, + ATKAdd: 2.52, + DEFBase: 147, + DEFAdd: 3.15, + }, + { + MaxLevel: 70, + HPBase: 371.52, + HPAdd: 6.48, + ATKBase: 144.48, + ATKAdd: 2.52, + DEFBase: 180.6, + DEFAdd: 3.15, + }, + { + MaxLevel: 80, + HPBase: 440.64, + HPAdd: 6.48, + ATKBase: 171.36, + ATKAdd: 2.52, + DEFBase: 214.2, + DEFAdd: 3.15, + }, +} \ No newline at end of file diff --git a/internal/lightcone/preservation/destinysthreadsforewoven/destinysthreadsforewoven.go b/internal/lightcone/preservation/destinysthreadsforewoven/destinysthreadsforewoven.go new file mode 100644 index 00000000..535139ae --- /dev/null +++ b/internal/lightcone/preservation/destinysthreadsforewoven/destinysthreadsforewoven.go @@ -0,0 +1,80 @@ +package destinysthreadsforewoven + +import ( + "math" + + "github.com/simimpact/srsim/pkg/engine" + "github.com/simimpact/srsim/pkg/engine/equip/lightcone" + "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 = "destinys-threads-forewoven" + buff = "destinys-threads-forewoven-dmg-buff" +) + +type state struct { + dmgPer float64 + dmgMax float64 +} + +// Increases the wearer's Effect RES by 12%. +// For every 100 of DEF the wearer has, increases the wearer's DMG dealt by 0.8%, +// up to a maximum DMG increase of 32%. + +func init() { + lightcone.Register(key.DestinysThreadsForewoven, lightcone.Config{ + CreatePassive: Create, + Rarity: 4, + Path: model.Path_PRESERVATION, + Promotions: promotions, + }) + + modifier.Register(check, modifier.Config{ + Listeners: modifier.Listeners{ + OnAdd: onCheck, + OnPropertyChange: onCheck, + }, + }) + + modifier.Register(buff, modifier.Config{ + StatusType: model.StatusType_STATUS_BUFF, + Stacking: modifier.ReplaceBySource, + CanDispel: true, + }) +} + +func Create(engine engine.Engine, owner key.TargetID, lc info.LightCone) { + effres := 0.1 + 0.02*float64(lc.Imposition) + dmgPer := 0.007 + 0.001*float64(lc.Imposition) + dmgMax := 0.28 + 0.04*float64(lc.Imposition) + + engine.AddModifier(owner, info.Modifier{ + Name: check, + Source: owner, + Stats: info.PropMap{prop.EffectRES: effres}, + State: state{ + dmgPer: dmgPer, + dmgMax: dmgMax, + }, + }) +} + +func onCheck(mod *modifier.Instance) { + state := mod.State().(state) + def := mod.OwnerStats().DEF() + dmg := math.Floor(def/100) * state.dmgPer + if dmg > state.dmgMax { + dmg = state.dmgMax + } + + mod.Engine().AddModifier(mod.Owner(), info.Modifier{ + Name: buff, + Source: mod.Owner(), + Stats: info.PropMap{prop.AllDamagePercent: dmg}, + }) +} diff --git a/pkg/key/lightcone.go b/pkg/key/lightcone.go index bf2afa89..4b234663 100644 --- a/pkg/key/lightcone.go +++ b/pkg/key/lightcone.go @@ -89,6 +89,7 @@ const ( Pioneering LightCone = "pioneering" WeAreWildfire LightCone = "we_are_wildfire" LandausChoice LightCone = "landaus_choice" + DestinysThreadsForewoven LightCone = "destinys_threads_forewoven" ) // Abundance diff --git a/pkg/simulation/imports.go b/pkg/simulation/imports.go index 78e8c59e..695fd586 100644 --- a/pkg/simulation/imports.go +++ b/pkg/simulation/imports.go @@ -101,6 +101,7 @@ import ( _ "github.com/simimpact/srsim/internal/lightcone/preservation/amber" _ "github.com/simimpact/srsim/internal/lightcone/preservation/dayoneofmynewlife" _ "github.com/simimpact/srsim/internal/lightcone/preservation/defense" + _ "github.com/simimpact/srsim/internal/lightcone/preservation/destinysthreadsforewoven" _ "github.com/simimpact/srsim/internal/lightcone/preservation/landauschoice" _ "github.com/simimpact/srsim/internal/lightcone/preservation/momentofvictory" _ "github.com/simimpact/srsim/internal/lightcone/preservation/pioneering"