-
Notifications
You must be signed in to change notification settings - Fork 34
lc: Past Self in Mirror #301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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, | ||
| }) | ||
| } | ||
|
Comment on lines
+67
to
+74
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: restore SP last |
||
|
|
||
| // 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, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. need to separate main modifier (which contains main logic, is not considered a buff and doesn't have a duration) and this modifier (which is considered a dispellable buff and has a duration) |
||
| Source: mod.Owner(), | ||
| Stats: info.PropMap{prop.AllDamagePercent: amt}, | ||
| Duration: 3, | ||
| }) | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs to be
ModifyEnergyFixedas it ignores ER