Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
54 changes: 54 additions & 0 deletions internal/relic/planar/lushaka/lushaka.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package lushaka

import (
"github.com/simimpact/srsim/pkg/engine"
"github.com/simimpact/srsim/pkg/engine/equip/relic"
"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"
)

const (
name = "lushaka-the-sunken-seas"
)

// Increases the wearer's Energy Regeneration Rate by 5%.
// If the wearer is not the first character in the team lineup,
// then increases the ATK of the first character in the team lineup by 12%.
func init() {
relic.Register(key.Lushaka, relic.Config{
Effects: []relic.SetEffect{
{
MinCount: 2,
Stats: info.PropMap{prop.EnergyRegen: 0.05},
CreateEffect: Create,
},
},
})

modifier.Register(name, modifier.Config{
Stacking: modifier.ReplaceBySource,
})
}

func Create(engine engine.Engine, owner key.TargetID) {
firstCharacter := engine.Characters()[0]

engine.Events().BattleStart.Subscribe(func(e event.BattleStart) {
if firstCharacter != owner {
engine.AddModifier(firstCharacter, info.Modifier{
Name: name,
Source: owner,
Stats: info.PropMap{prop.ATKPercent: 0.12},
})
}
})

engine.Events().TargetDeath.Subscribe(func(e event.TargetDeath) {
if e.Target == owner {
engine.RemoveModifierFromSource(firstCharacter, owner, name)
}
})
}
1 change: 1 addition & 0 deletions pkg/key/relic.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const (
RutilantArena Relic = "rutilant_arena"
PenaconyLandOfDreams Relic = "penacony_land_of_dreams"
IzumoGensei Relic = "izumo_gensei_and_takama_divine_realm"
Lushaka Relic = "lushaka_the_sunken_seas"
)

func (r Relic) String() string {
Expand Down
1 change: 1 addition & 0 deletions pkg/simulation/imports.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ import (
_ "github.com/simimpact/srsim/internal/relic/cavern/wanderingcloud"
_ "github.com/simimpact/srsim/internal/relic/planar/belobog"
_ "github.com/simimpact/srsim/internal/relic/planar/izumo"
_ "github.com/simimpact/srsim/internal/relic/planar/lushaka"
_ "github.com/simimpact/srsim/internal/relic/planar/pangalactic"
_ "github.com/simimpact/srsim/internal/relic/planar/penacony"
_ "github.com/simimpact/srsim/internal/relic/planar/rutilant"
Expand Down