diff --git a/internal/lightcone/harmony/pastselfinmirror/data.go b/internal/lightcone/harmony/pastselfinmirror/data.go new file mode 100644 index 00000000..ac85ddeb --- /dev/null +++ b/internal/lightcone/harmony/pastselfinmirror/data.go @@ -0,0 +1,71 @@ +// Code generated by "weapstat"; DO NOT EDIT. + +package pastselfinmirror + +import "github.com/simimpact/srsim/pkg/engine/equip/lightcone" + +var promotions = []lightcone.PromotionData{ + { + MaxLevel: 20, + HPBase: 48, + HPAdd: 7.2, + ATKBase: 24, + ATKAdd: 3.6, + DEFBase: 24, + DEFAdd: 3.6, + }, + { + MaxLevel: 30, + HPBase: 105.6, + HPAdd: 7.2, + ATKBase: 52.8, + ATKAdd: 3.6, + DEFBase: 52.8, + DEFAdd: 3.6, + }, + { + MaxLevel: 40, + HPBase: 182.4, + HPAdd: 7.2, + ATKBase: 91.2, + ATKAdd: 3.6, + DEFBase: 91.2, + DEFAdd: 3.6, + }, + { + MaxLevel: 50, + HPBase: 259.2, + HPAdd: 7.2, + ATKBase: 129.6, + ATKAdd: 3.6, + DEFBase: 129.6, + DEFAdd: 3.6, + }, + { + MaxLevel: 60, + HPBase: 336, + HPAdd: 7.2, + ATKBase: 168, + ATKAdd: 3.6, + DEFBase: 168, + DEFAdd: 3.6, + }, + { + MaxLevel: 70, + HPBase: 412.8, + HPAdd: 7.2, + ATKBase: 206.4, + ATKAdd: 3.6, + DEFBase: 206.4, + DEFAdd: 3.6, + }, + { + MaxLevel: 80, + HPBase: 489.6, + HPAdd: 7.2, + ATKBase: 244.8, + ATKAdd: 3.6, + DEFBase: 244.8, + DEFAdd: 3.6, + }, +} \ No newline at end of file diff --git a/internal/lightcone/harmony/pastselfinmirror/pastselfinmirror.go b/internal/lightcone/harmony/pastselfinmirror/pastselfinmirror.go new file mode 100644 index 00000000..bfd335b1 --- /dev/null +++ b/internal/lightcone/harmony/pastselfinmirror/pastselfinmirror.go @@ -0,0 +1,86 @@ +package pastselfinmirror + +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 ( + psim = "past-self-in-mirror" + psimEnergy = "past-self-in-mirror-energy" +) + +// Increases the wearer's Break Effect by 60%. +// When the wearer uses their Ultimate, increases all allies' DMG by 24%, lasting for 3 turn(s). +// Should the wearer's Break Effect exceed or equal 150%, 1 Skill Point will be recovered. +// At the start of each wave, all allies regenerate 10 Energy immediately. Abilities of the same type cannot stack. +func init() { + lightcone.Register(key.PastSelfinMirror, lightcone.Config{ + CreatePassive: Create, + Rarity: 5, + Path: model.Path_HARMONY, + Promotions: promotions, + }) + modifier.Register(psim, modifier.Config{ + Stacking: modifier.ReplaceBySource, + StatusType: model.StatusType_STATUS_BUFF, + Listeners: modifier.Listeners{ + OnAfterAction: afterUlt, + }, + }) +} + +// Break Effect Buff +func Create(engine engine.Engine, owner key.TargetID, lc info.LightCone) { + amt := 0.5 + 0.1*float64(lc.Imposition) + engine.AddModifier(owner, info.Modifier{ + Name: psim, + Source: owner, + Stats: info.PropMap{prop.BreakEffect: amt}, + State: float64(lc.Imposition), + }) + + energyAmt := 7.5 + 2.5*float64(lc.Imposition) + engine.Events().BattleStart.Subscribe(func(event event.BattleStart) { + for _, char := range engine.Characters() { + engine.ModifyEnergy(info.ModifyAttribute{ + Key: psimEnergy, + Target: char, + Source: owner, + Amount: energyAmt, + }) + } + }) +} + +func afterUlt(mod *modifier.Instance, e event.ActionEnd) { + if e.AttackType != model.AttackType_ULT { + return + } + + // Restore 1 SP if BE >= 150% + if mod.OwnerStats().BreakEffect() >= 1.5 { + mod.Engine().ModifySP(info.ModifySP{ + Key: psim, + Source: mod.Owner(), + Amount: 1, + }) + } + + // DMG% buff for 3 turns + amt := 0.2 + 0.04*mod.State().(float64) + for _, char := range mod.Engine().Characters() { + mod.Engine().AddModifier(char, info.Modifier{ + Name: psim, + Source: mod.Owner(), + Stats: info.PropMap{prop.AllDamagePercent: amt}, + Duration: 3, + }) + } +} diff --git a/pkg/key/lightcone.go b/pkg/key/lightcone.go index a2a912c6..96a8381a 100644 --- a/pkg/key/lightcone.go +++ b/pkg/key/lightcone.go @@ -71,6 +71,7 @@ const ( MemoriesofthePast LightCone = "memories_of_the_past" DanceDanceDance LightCone = "dance_dance_dance" PlanetaryRendezvous LightCone = "planetary_rendezvous" + PastSelfinMirror LightCone = "past_self_in_mirror" ) // Preservation diff --git a/pkg/simulation/imports.go b/pkg/simulation/imports.go index 4a851c79..29c24577 100644 --- a/pkg/simulation/imports.go +++ b/pkg/simulation/imports.go @@ -66,6 +66,7 @@ import ( _ "github.com/simimpact/srsim/internal/lightcone/harmony/dancedancedance" _ "github.com/simimpact/srsim/internal/lightcone/harmony/memoriesofthepast" _ "github.com/simimpact/srsim/internal/lightcone/harmony/meshingcogs" + _ "github.com/simimpact/srsim/internal/lightcone/harmony/pastselfinmirror" _ "github.com/simimpact/srsim/internal/lightcone/harmony/planetaryrendezvous" _ "github.com/simimpact/srsim/internal/lightcone/hunt/adversarial" _ "github.com/simimpact/srsim/internal/lightcone/hunt/arrows"