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/harmony/pastselfinmirror/data.go

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

86 changes: 86 additions & 0 deletions internal/lightcone/harmony/pastselfinmirror/pastselfinmirror.go
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{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs to be ModifyEnergyFixed as it ignores ER

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
Copy link
Collaborator

Choose a reason for hiding this comment

The 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,
Copy link
Collaborator

Choose a reason for hiding this comment

The 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,
})
}
}
1 change: 1 addition & 0 deletions pkg/key/lightcone.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions pkg/simulation/imports.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down