diff --git a/go.mod b/go.mod index f28fb9bb51..35d147b4ae 100644 --- a/go.mod +++ b/go.mod @@ -28,6 +28,7 @@ require ( github.com/ory/dockertest/v3 v3.10.0 github.com/redis/go-redis/v9 v9.5.1 github.com/schollz/progressbar/v3 v3.18.0 + github.com/stretchr/testify v1.9.0 github.com/tinylib/msgp v1.1.9 go.mongodb.org/mongo-driver v1.12.1 go.uber.org/multierr v1.11.0 @@ -93,6 +94,7 @@ require ( github.com/opencontainers/runc v1.1.9 // indirect github.com/philhofer/fwd v1.1.2 // indirect github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rivo/uniseg v0.4.7 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/ulikunitz/xz v0.5.11 // indirect diff --git a/internal/artifacts/archaic/archaic.go b/internal/artifacts/archaic/archaic.go index 1041729ade..a1cc7b5514 100644 --- a/internal/artifacts/archaic/archaic.go +++ b/internal/artifacts/archaic/archaic.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/core/player/shield" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -35,7 +35,7 @@ func NewSet(core *core.Core, char *character.CharWrapper, count int, param map[s m := make([]float64, attributes.EndStatType) m[attributes.GeoP] = 0.15 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("archaic-2pc", -1), + Base: gmod.NewBase("archaic-2pc", -1), AffectedStat: attributes.GeoP, Amount: func() ([]float64, bool) { return m, true @@ -75,7 +75,7 @@ func NewSet(core *core.Core, char *character.CharWrapper, count int, param map[s // Apply mod to all characters for _, c := range core.Player.Chars() { c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("archaic-4pc", 10*60), + Base: gmod.NewBaseWithHitlag("archaic-4pc", 10*60), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/artifacts/berserker/berserker.go b/internal/artifacts/berserker/berserker.go index 8a2e4892f6..1d5c3f23f5 100644 --- a/internal/artifacts/berserker/berserker.go +++ b/internal/artifacts/berserker/berserker.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -30,7 +30,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.CR] = 0.12 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("berserker-2pc", -1), + Base: gmod.NewBase("berserker-2pc", -1), AffectedStat: attributes.CR, Amount: func() ([]float64, bool) { return m, true @@ -42,7 +42,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.CR] = 0.24 char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("berserker-4pc", -1), + Base: gmod.NewBase("berserker-4pc", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if char.CurrentHPRatio() > 0.7 { return nil, false diff --git a/internal/artifacts/blizzard/blizzard.go b/internal/artifacts/blizzard/blizzard.go index 30292c5966..0575cb78ee 100644 --- a/internal/artifacts/blizzard/blizzard.go +++ b/internal/artifacts/blizzard/blizzard.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -29,7 +29,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.CryoP] = 0.15 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("bs-2pc", -1), + Base: gmod.NewBase("bs-2pc", -1), AffectedStat: attributes.CryoP, Amount: func() ([]float64, bool) { return m, true @@ -39,7 +39,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri if count >= 4 { m := make([]float64, attributes.EndStatType) char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("bs-4pc", -1), + Base: gmod.NewBase("bs-4pc", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { r, ok := t.(core.Reactable) if !ok { diff --git a/internal/artifacts/bloodstained/bloodstained.go b/internal/artifacts/bloodstained/bloodstained.go index e9db8c5532..b6f0d30194 100644 --- a/internal/artifacts/bloodstained/bloodstained.go +++ b/internal/artifacts/bloodstained/bloodstained.go @@ -12,7 +12,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -36,7 +36,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.PhyP] = 0.25 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("bloodstained-2pc", -1), + Base: gmod.NewBase("bloodstained-2pc", -1), AffectedStat: attributes.PhyP, Amount: func() ([]float64, bool) { return m, true @@ -70,7 +70,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri // charged attack dmg% part char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag("bloodstained-4pc-dmg%", 600), + Base: gmod.NewBaseWithHitlag("bloodstained-4pc-dmg%", 600), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagExtra { return nil, false diff --git a/internal/artifacts/bolide/bolide.go b/internal/artifacts/bolide/bolide.go index 63c9911e65..c9469147e7 100644 --- a/internal/artifacts/bolide/bolide.go +++ b/internal/artifacts/bolide/bolide.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -36,7 +36,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = 0.4 char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("bolide-4pc", -1), + Base: gmod.NewBase("bolide-4pc", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagNormal && atk.Info.AttackTag != attacks.AttackTagExtra { return nil, false diff --git a/internal/artifacts/braveheart/braveheart.go b/internal/artifacts/braveheart/braveheart.go index 0e68c13373..4e6b334b79 100644 --- a/internal/artifacts/braveheart/braveheart.go +++ b/internal/artifacts/braveheart/braveheart.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -31,7 +31,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.ATKP] = 0.18 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("braveheart-2pc", -1), + Base: gmod.NewBase("braveheart-2pc", -1), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return m, true @@ -50,7 +50,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = 0.30 char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("braveheart-4pc", -1), + Base: gmod.NewBase("braveheart-4pc", -1), Amount: func(_ *info.AttackEvent, t info.Target) ([]float64, bool) { x, ok := t.(*enemy.Enemy) if !ok { diff --git a/internal/artifacts/crimson/crimson.go b/internal/artifacts/crimson/crimson.go index b7a247c8fa..e68e988844 100644 --- a/internal/artifacts/crimson/crimson.go +++ b/internal/artifacts/crimson/crimson.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -38,7 +38,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.PyroP] = 0.15 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("crimson-2pc", -1), + Base: gmod.NewBase("crimson-2pc", -1), AffectedStat: attributes.PyroP, Amount: func() ([]float64, bool) { return m, true @@ -67,7 +67,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri mStacks[attributes.PyroP] = 0.15 * 0.5 * float64(s.stacks) char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(cw4pc, 10*60), + Base: gmod.NewBaseWithHitlag(cw4pc, 10*60), AffectedStat: attributes.PyroP, Amount: func() ([]float64, bool) { return mStacks, true @@ -78,7 +78,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri }, fmt.Sprintf("%v-cw-4pc", char.Base.Key.String())) char.AddReactBonusMod(character.ReactBonusMod{ - Base: modifier.NewBase("crimson-4pc", -1), + Base: gmod.NewBase("crimson-4pc", -1), Amount: func(ai info.AttackInfo) (float64, bool) { switch ai.AttackTag { case attacks.AttackTagOverloadDamage, diff --git a/internal/artifacts/deepwood/deepwood.go b/internal/artifacts/deepwood/deepwood.go index 2a8227267b..53a35a72e2 100644 --- a/internal/artifacts/deepwood/deepwood.go +++ b/internal/artifacts/deepwood/deepwood.go @@ -12,7 +12,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -38,7 +38,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.DendroP] = 0.15 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("dm-2pc", -1), + Base: gmod.NewBase("dm-2pc", -1), AffectedStat: attributes.DendroP, Amount: func() ([]float64, bool) { return m, true @@ -61,7 +61,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri } t.AddResistMod(info.ResistMod{ - Base: modifier.NewBaseWithHitlag("dm-4pc", 8*60), + Base: gmod.NewBaseWithHitlag("dm-4pc", 8*60), Ele: attributes.Dendro, Value: -0.3, }) diff --git a/internal/artifacts/defenderswill/defenderswill.go b/internal/artifacts/defenderswill/defenderswill.go index 5f86912313..8923160ebf 100644 --- a/internal/artifacts/defenderswill/defenderswill.go +++ b/internal/artifacts/defenderswill/defenderswill.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -31,7 +31,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.DEFP] = 0.30 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("defenderswill-2pc", -1), + Base: gmod.NewBase("defenderswill-2pc", -1), AffectedStat: attributes.DEFP, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/artifacts/desertpavilionchronicle/desertpavilionchronicle.go b/internal/artifacts/desertpavilionchronicle/desertpavilionchronicle.go index 585a8c90e6..4316b8ead7 100644 --- a/internal/artifacts/desertpavilionchronicle/desertpavilionchronicle.go +++ b/internal/artifacts/desertpavilionchronicle/desertpavilionchronicle.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -38,7 +38,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.AnemoP] = 0.15 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("desert-2pc", -1), + Base: gmod.NewBase("desert-2pc", -1), AffectedStat: attributes.AnemoP, Amount: func() ([]float64, bool) { return m, true @@ -59,7 +59,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri mSpd := make([]float64, attributes.EndStatType) mSpd[attributes.AtkSpd] = 0.1 char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("desert-4pc-spd", 15*60), + Base: gmod.NewBaseWithHitlag("desert-4pc-spd", 15*60), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { if c.Player.CurrentState() != action.NormalAttackState { @@ -72,7 +72,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri mDmg := make([]float64, attributes.EndStatType) mDmg[attributes.DmgP] = 0.4 char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag("desert-4pc-dmg", 15*60), + Base: gmod.NewBaseWithHitlag("desert-4pc-dmg", 15*60), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { switch atk.Info.AttackTag { case attacks.AttackTagNormal: diff --git a/internal/artifacts/echoes/echoes.go b/internal/artifacts/echoes/echoes.go index b59dcc95aa..98eccac722 100644 --- a/internal/artifacts/echoes/echoes.go +++ b/internal/artifacts/echoes/echoes.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -48,7 +48,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.ATKP] = 0.18 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("echoes-2pc", -1), + Base: gmod.NewBase("echoes-2pc", -1), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/artifacts/emblem/emblem.go b/internal/artifacts/emblem/emblem.go index e44062874e..741608fffe 100644 --- a/internal/artifacts/emblem/emblem.go +++ b/internal/artifacts/emblem/emblem.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -30,7 +30,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.ER] = 0.20 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("emblem-2pc", -1), + Base: gmod.NewBase("emblem-2pc", -1), AffectedStat: attributes.ER, Amount: func() ([]float64, bool) { return m, true @@ -47,7 +47,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m[attributes.DmgP] = amt char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("emblem-4pc", -1), + Base: gmod.NewBase("emblem-4pc", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagElementalBurst { return nil, false diff --git a/internal/artifacts/exile/exile.go b/internal/artifacts/exile/exile.go index 19b49d68c6..1c760ec6bb 100644 --- a/internal/artifacts/exile/exile.go +++ b/internal/artifacts/exile/exile.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -34,7 +34,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.ER] = 0.20 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("exile-2pc", -1), + Base: gmod.NewBase("exile-2pc", -1), AffectedStat: attributes.ER, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/artifacts/finaleofthedeepgalleries/finaleofthedeepgalleries.go b/internal/artifacts/finaleofthedeepgalleries/finaleofthedeepgalleries.go index aaaa68ecc3..108c72bd1d 100644 --- a/internal/artifacts/finaleofthedeepgalleries/finaleofthedeepgalleries.go +++ b/internal/artifacts/finaleofthedeepgalleries/finaleofthedeepgalleries.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -56,7 +56,7 @@ func (s *Set) pc2() { m := make([]float64, attributes.EndStatType) m[attributes.CryoP] = 0.15 s.char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("deep-galleries-2pc", -1), + Base: gmod.NewBase("deep-galleries-2pc", -1), AffectedStat: attributes.CryoP, Amount: func() ([]float64, bool) { return m, true @@ -76,7 +76,7 @@ func (s *Set) pc4() { m[attributes.DmgP] = 0.6 s.char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("deep-galleries-4pc", -1), + Base: gmod.NewBase("deep-galleries-4pc", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if s.char.Energy != 0 { return nil, false diff --git a/internal/artifacts/flowerofparadiselost/flowerofparadiselost.go b/internal/artifacts/flowerofparadiselost/flowerofparadiselost.go index c9f5f8b43c..0589f19678 100644 --- a/internal/artifacts/flowerofparadiselost/flowerofparadiselost.go +++ b/internal/artifacts/flowerofparadiselost/flowerofparadiselost.go @@ -12,7 +12,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -49,7 +49,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.EM] = 80 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("flower-2pc", -1), + Base: gmod.NewBase("flower-2pc", -1), AffectedStat: attributes.EM, Amount: func() ([]float64, bool) { return m, true @@ -60,7 +60,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri //nolint:nestif // linter is stupid if count >= 4 { char.AddReactBonusMod(character.ReactBonusMod{ - Base: modifier.NewBase("flower-4pc", -1), + Base: gmod.NewBase("flower-4pc", -1), Amount: func(ai info.AttackInfo) (float64, bool) { switch ai.AttackTag { case attacks.AttackTagBloom: @@ -95,7 +95,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri Write("stacks", s.stacks) char.AddReactBonusMod(character.ReactBonusMod{ - Base: modifier.NewBaseWithHitlag(buffKey, 10*60), + Base: gmod.NewBaseWithHitlag(buffKey, 10*60), Amount: func(ai info.AttackInfo) (float64, bool) { switch ai.AttackTag { case attacks.AttackTagBloom: diff --git a/internal/artifacts/fragmentofharmonicwhimsy/fragmentofharmonicwhimsy.go b/internal/artifacts/fragmentofharmonicwhimsy/fragmentofharmonicwhimsy.go index 12c7887c87..8d3281afec 100644 --- a/internal/artifacts/fragmentofharmonicwhimsy/fragmentofharmonicwhimsy.go +++ b/internal/artifacts/fragmentofharmonicwhimsy/fragmentofharmonicwhimsy.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -38,7 +38,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.ATKP] = 0.18 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase(fohw2pc, -1), + Base: gmod.NewBase(fohw2pc, -1), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return m, true @@ -66,7 +66,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m[attributes.DmgP] = 0.18 * float64(s.stacks) char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(fohw4pc, 6*60), + Base: gmod.NewBaseWithHitlag(fohw4pc, 6*60), Amount: func() ([]float64, bool) { return m, true }, diff --git a/internal/artifacts/gambler/gambler.go b/internal/artifacts/gambler/gambler.go index ff74dec671..a7011f12fd 100644 --- a/internal/artifacts/gambler/gambler.go +++ b/internal/artifacts/gambler/gambler.go @@ -13,7 +13,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -38,7 +38,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = 0.20 char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("gambler-2pc", -1), + Base: gmod.NewBase("gambler-2pc", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagElementalArt { return nil, false diff --git a/internal/artifacts/gildeddreams/gildeddreams.go b/internal/artifacts/gildeddreams/gildeddreams.go index ae75540dab..7c544a9104 100644 --- a/internal/artifacts/gildeddreams/gildeddreams.go +++ b/internal/artifacts/gildeddreams/gildeddreams.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -73,7 +73,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.EM] = 80 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("gd-2pc", -1), + Base: gmod.NewBase("gd-2pc", -1), AffectedStat: attributes.EM, Amount: func() ([]float64, bool) { return m, true @@ -93,7 +93,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri char.AddStatus(icdKey, 8*60, true) char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("gd-4pc", 8*60), + Base: gmod.NewBaseWithHitlag("gd-4pc", 8*60), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return s.buff, true diff --git a/internal/artifacts/gladiator/gladiator.go b/internal/artifacts/gladiator/gladiator.go index 517b4205db..8ce13a2a3a 100644 --- a/internal/artifacts/gladiator/gladiator.go +++ b/internal/artifacts/gladiator/gladiator.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -39,7 +39,7 @@ func (s *Set) Init() error { m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = 0.35 s.char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("glad-4pc", -1), + Base: gmod.NewBase("glad-4pc", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagNormal { return nil, false @@ -61,7 +61,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.ATKP] = 0.18 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("glad-2pc", -1), + Base: gmod.NewBase("glad-2pc", -1), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/artifacts/goldentroupe/goldentroupe.go b/internal/artifacts/goldentroupe/goldentroupe.go index d1ca34c9f8..3a88cfd4cd 100644 --- a/internal/artifacts/goldentroupe/goldentroupe.go +++ b/internal/artifacts/goldentroupe/goldentroupe.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -52,7 +52,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = 0.2 char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("troupe-2pc", -1), + Base: gmod.NewBase("troupe-2pc", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagElementalArt && atk.Info.AttackTag != attacks.AttackTagElementalArtHold { return nil, false @@ -82,7 +82,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri }, fmt.Sprintf("troupe-4pc-%v", char.Base.Key.String())) char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("troupe-4pc", -1), + Base: gmod.NewBase("troupe-4pc", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagElementalArt && atk.Info.AttackTag != attacks.AttackTagElementalArtHold { return nil, false diff --git a/internal/artifacts/heartofdepth/heartofdepth.go b/internal/artifacts/heartofdepth/heartofdepth.go index 41d851200d..8844c2f9af 100644 --- a/internal/artifacts/heartofdepth/heartofdepth.go +++ b/internal/artifacts/heartofdepth/heartofdepth.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -36,7 +36,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.HydroP] = 0.15 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("hod-2pc", -1), + Base: gmod.NewBase("hod-2pc", -1), AffectedStat: attributes.HydroP, Amount: func() ([]float64, bool) { return m, true @@ -55,7 +55,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri } // add stat mod here char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag("hod-4pc", buffDuration), + Base: gmod.NewBaseWithHitlag("hod-4pc", buffDuration), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagNormal && atk.Info.AttackTag != attacks.AttackTagExtra { return nil, false diff --git a/internal/artifacts/huskofopulentdreams/huskofopulentdreams.go b/internal/artifacts/huskofopulentdreams/huskofopulentdreams.go index c240c8546b..a73a139f3e 100644 --- a/internal/artifacts/huskofopulentdreams/huskofopulentdreams.go +++ b/internal/artifacts/huskofopulentdreams/huskofopulentdreams.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -72,7 +72,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.DEFP] = 0.30 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("husk-2pc", -1), + Base: gmod.NewBase("husk-2pc", -1), AffectedStat: attributes.DEFP, Amount: func() ([]float64, bool) { return m, true @@ -130,7 +130,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri }, fmt.Sprintf("husk-4pc-%v", char.Base.Key.String())) char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("husk-4pc", -1), + Base: gmod.NewBase("husk-4pc", -1), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { m[attributes.DEFP] = 0.06 * float64(s.stacks) diff --git a/internal/artifacts/instructor/instructor.go b/internal/artifacts/instructor/instructor.go index 86f2cbac4b..fec4e80d87 100644 --- a/internal/artifacts/instructor/instructor.go +++ b/internal/artifacts/instructor/instructor.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -35,7 +35,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.EM] = 80 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("instructor-2pc", -1), + Base: gmod.NewBase("instructor-2pc", -1), AffectedStat: attributes.EM, Amount: func() ([]float64, bool) { return m, true @@ -61,7 +61,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri // Add 120 EM to all characters for _, this := range c.Player.Chars() { this.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("instructor-4pc", 480), + Base: gmod.NewBaseWithHitlag("instructor-4pc", 480), AffectedStat: attributes.EM, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/artifacts/lavawalker/lavawalker.go b/internal/artifacts/lavawalker/lavawalker.go index 75c444157e..1eeaac50d9 100644 --- a/internal/artifacts/lavawalker/lavawalker.go +++ b/internal/artifacts/lavawalker/lavawalker.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -33,7 +33,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = 0.35 char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("lavawalker-4pc", -1), + Base: gmod.NewBase("lavawalker-4pc", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { r, ok := t.(core.Reactable) if !ok { diff --git a/internal/artifacts/longnightsoath/longnightsoath.go b/internal/artifacts/longnightsoath/longnightsoath.go index 1c25d917c9..7c6cf263af 100644 --- a/internal/artifacts/longnightsoath/longnightsoath.go +++ b/internal/artifacts/longnightsoath/longnightsoath.go @@ -12,7 +12,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/core/stacks" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) type attackStackType struct { @@ -66,7 +66,7 @@ func (s *Set) pc2() { m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = 0.25 s.char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("longnightsoath-2pc", -1), + Base: gmod.NewBase("longnightsoath-2pc", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagPlunge { return nil, false @@ -113,7 +113,7 @@ func (s *Set) pc4() { m := make([]float64, attributes.EndStatType) s.char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("longnightsoath-4pc", -1), + Base: gmod.NewBase("longnightsoath-4pc", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagPlunge { return nil, false diff --git a/internal/artifacts/maiden/maiden.go b/internal/artifacts/maiden/maiden.go index 7047fb6b47..372fbaa65d 100644 --- a/internal/artifacts/maiden/maiden.go +++ b/internal/artifacts/maiden/maiden.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -35,7 +35,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.Heal] = 0.15 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("maiden-2pc", -1), + Base: gmod.NewBase("maiden-2pc", -1), AffectedStat: attributes.Heal, Amount: func() ([]float64, bool) { return m, true @@ -51,7 +51,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri for _, x := range c.Player.Chars() { this := x this.AddHealBonusMod(character.HealBonusMod{ - Base: modifier.NewBaseWithHitlag("maiden-4pc", 600), + Base: gmod.NewBaseWithHitlag("maiden-4pc", 600), Amount: func() (float64, bool) { return 0.2, false }, diff --git a/internal/artifacts/marechausseehunter/marechausseehunter.go b/internal/artifacts/marechausseehunter/marechausseehunter.go index 26398a7561..657877a3ed 100644 --- a/internal/artifacts/marechausseehunter/marechausseehunter.go +++ b/internal/artifacts/marechausseehunter/marechausseehunter.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -42,7 +42,7 @@ func (s *Set) onChangeHP() { } s.char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(buffKey, 5*60), + Base: gmod.NewBaseWithHitlag(buffKey, 5*60), AffectedStat: attributes.CR, Amount: func() ([]float64, bool) { s.buff[attributes.CR] = 0.12 * float64(s.stacks) @@ -63,7 +63,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = 0.15 char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("mh-2pc", -1), + Base: gmod.NewBase("mh-2pc", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagNormal && atk.Info.AttackTag != attacks.AttackTagExtra { return nil, false diff --git a/internal/artifacts/martialartist/martialartist.go b/internal/artifacts/martialartist/martialartist.go index 313ec228db..14a034bdb6 100644 --- a/internal/artifacts/martialartist/martialartist.go +++ b/internal/artifacts/martialartist/martialartist.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -34,7 +34,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = 0.15 char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("martialartist-2pc", -1), + Base: gmod.NewBase("martialartist-2pc", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagNormal && atk.Info.AttackTag != attacks.AttackTagExtra { return nil, false @@ -54,7 +54,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri } // add buff char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag("martialartist-4pc", 480), // 8s + Base: gmod.NewBaseWithHitlag("martialartist-4pc", 480), // 8s Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagNormal && atk.Info.AttackTag != attacks.AttackTagExtra { return nil, false diff --git a/internal/artifacts/nighttimewhispersintheechoingwoods/nighttimewhispersintheechoingwoods.go b/internal/artifacts/nighttimewhispersintheechoingwoods/nighttimewhispersintheechoingwoods.go index da74c09312..48cec06f85 100644 --- a/internal/artifacts/nighttimewhispersintheechoingwoods/nighttimewhispersintheechoingwoods.go +++ b/internal/artifacts/nighttimewhispersintheechoingwoods/nighttimewhispersintheechoingwoods.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/core/player/shield" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -41,7 +41,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.ATKP] = 0.18 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("nighttimewhispers-2pc", -1), + Base: gmod.NewBase("nighttimewhispers-2pc", -1), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return m, true @@ -114,7 +114,7 @@ func (s *Set) OnSkill() func(args ...any) bool { } m := make([]float64, attributes.EndStatType) s.char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("nighttimewhispers-4pc", 10*60), + Base: gmod.NewBaseWithHitlag("nighttimewhispers-4pc", 10*60), AffectedStat: attributes.GeoP, Amount: func() ([]float64, bool) { if s.core.F <= s.lastF { diff --git a/internal/artifacts/noblesse/noblesse.go b/internal/artifacts/noblesse/noblesse.go index aad29ee099..f911d215e0 100644 --- a/internal/artifacts/noblesse/noblesse.go +++ b/internal/artifacts/noblesse/noblesse.go @@ -12,7 +12,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -47,7 +47,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri s.nob2buff = make([]float64, attributes.EndStatType) s.nob2buff[attributes.DmgP] = 0.20 char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("nob-2pc", -1), + Base: gmod.NewBase("nob-2pc", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagElementalBurst { return nil, false @@ -81,7 +81,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri } this.QueueCharTask(func() { this.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(buffKey, buffDuration), + Base: gmod.NewBaseWithHitlag(buffKey, buffDuration), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return s.nob4buff, true diff --git a/internal/artifacts/nymphsdream/nymphsdream.go b/internal/artifacts/nymphsdream/nymphsdream.go index 04e182fd8a..89415942a6 100644 --- a/internal/artifacts/nymphsdream/nymphsdream.go +++ b/internal/artifacts/nymphsdream/nymphsdream.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -34,7 +34,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.HydroP] = 0.15 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("nd-2pc", -1), + Base: gmod.NewBase("nd-2pc", -1), AffectedStat: attributes.HydroP, Amount: func() ([]float64, bool) { return m, true @@ -56,7 +56,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("nd-4pc", -1), + Base: gmod.NewBase("nd-4pc", -1), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { stacks := 0 diff --git a/internal/artifacts/obsidiancodex/obsidiancodex.go b/internal/artifacts/obsidiancodex/obsidiancodex.go index 3e1f1b5e66..eb613e14b3 100644 --- a/internal/artifacts/obsidiancodex/obsidiancodex.go +++ b/internal/artifacts/obsidiancodex/obsidiancodex.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -34,7 +34,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = 0.15 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("obsidiancodex-2pc", -1), + Base: gmod.NewBase("obsidiancodex-2pc", -1), Amount: func() ([]float64, bool) { if !char.StatusIsActive(nightsoul.NightsoulBlessingStatus) { return nil, false @@ -68,7 +68,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri s.consumeCount = 0 char.AddStatus(icdKey, 60, true) char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("obsidiancodex-4pc", 6*60), + Base: gmod.NewBaseWithHitlag("obsidiancodex-4pc", 6*60), Amount: func() ([]float64, bool) { return m, true }, diff --git a/internal/artifacts/oceanhuedclam/oceanhuedclam.go b/internal/artifacts/oceanhuedclam/oceanhuedclam.go index 2ee9179071..6b715cf71e 100644 --- a/internal/artifacts/oceanhuedclam/oceanhuedclam.go +++ b/internal/artifacts/oceanhuedclam/oceanhuedclam.go @@ -12,7 +12,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -57,7 +57,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.Heal] = 0.15 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("ohc-2pc", -1), + Base: gmod.NewBase("ohc-2pc", -1), AffectedStat: attributes.Heal, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/artifacts/paleflame/paleflame.go b/internal/artifacts/paleflame/paleflame.go index 6882af5abe..0f80d6148b 100644 --- a/internal/artifacts/paleflame/paleflame.go +++ b/internal/artifacts/paleflame/paleflame.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -46,7 +46,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.PhyP] = 0.25 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("pf-2pc", -1), + Base: gmod.NewBase("pf-2pc", -1), AffectedStat: attributes.PhyP, Amount: func() ([]float64, bool) { return m, true @@ -91,7 +91,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri char.AddStatus(icdKey, icd, true) char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(pf4key, 420), + Base: gmod.NewBaseWithHitlag(pf4key, 420), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return s.buff, true diff --git a/internal/artifacts/reminiscence/reminiscence.go b/internal/artifacts/reminiscence/reminiscence.go index b4fa895532..0540c01e7a 100644 --- a/internal/artifacts/reminiscence/reminiscence.go +++ b/internal/artifacts/reminiscence/reminiscence.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -35,7 +35,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.ATKP] = 0.18 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("shim-2pc", -1), + Base: gmod.NewBase("shim-2pc", -1), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return m, true @@ -70,7 +70,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri }, 10) char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag("shim-4pc", 60*10), + Base: gmod.NewBaseWithHitlag("shim-4pc", 60*10), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { switch atk.Info.AttackTag { case attacks.AttackTagNormal: diff --git a/internal/artifacts/scholar/scholar.go b/internal/artifacts/scholar/scholar.go index 84973fae4e..e6d327c75a 100644 --- a/internal/artifacts/scholar/scholar.go +++ b/internal/artifacts/scholar/scholar.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -34,7 +34,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.ER] = 0.20 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("scholar-2pc", -1), + Base: gmod.NewBase("scholar-2pc", -1), AffectedStat: attributes.ER, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/artifacts/scrolloftheheroofcindercity/scrolloftheheroofcindercity.go b/internal/artifacts/scrolloftheheroofcindercity/scrolloftheheroofcindercity.go index c13b87aba5..8d45c72366 100644 --- a/internal/artifacts/scrolloftheheroofcindercity/scrolloftheheroofcindercity.go +++ b/internal/artifacts/scrolloftheheroofcindercity/scrolloftheheroofcindercity.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var reactToElements = map[info.ReactionType][]attributes.Element{ @@ -77,7 +77,7 @@ func (s *Set) buffCB(react info.ReactionType, gadgetEmit bool) func(args ...any) for _, ele := range elements { stat := attributes.EleToDmgP(ele) other.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(fmt.Sprintf("scroll-4pc-%v", ele), 15*60), + Base: gmod.NewBaseWithHitlag(fmt.Sprintf("scroll-4pc-%v", ele), 15*60), AffectedStat: stat, Amount: func() ([]float64, bool) { clear(s.buff) @@ -90,7 +90,7 @@ func (s *Set) buffCB(react info.ReactionType, gadgetEmit bool) func(args ...any) continue } other.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(fmt.Sprintf("scroll-4pc-nightsoul-%v", ele), 20*60), + Base: gmod.NewBaseWithHitlag(fmt.Sprintf("scroll-4pc-nightsoul-%v", ele), 20*60), AffectedStat: stat, Amount: func() ([]float64, bool) { clear(s.nightsoulBuff) diff --git a/internal/artifacts/sojourner/sojourner.go b/internal/artifacts/sojourner/sojourner.go index d59bcfeae6..b4cdd0df8b 100644 --- a/internal/artifacts/sojourner/sojourner.go +++ b/internal/artifacts/sojourner/sojourner.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -31,7 +31,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.ATKP] = 0.18 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("sojourner-2pc", -1), + Base: gmod.NewBase("sojourner-2pc", -1), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return m, true @@ -43,7 +43,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.CR] = 0.30 char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("sojourner-4pc", -1), + Base: gmod.NewBase("sojourner-4pc", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagExtra { return nil, false diff --git a/internal/artifacts/songofdayspast/songofdayspast.go b/internal/artifacts/songofdayspast/songofdayspast.go index 698e634bc8..831108bf6f 100644 --- a/internal/artifacts/songofdayspast/songofdayspast.go +++ b/internal/artifacts/songofdayspast/songofdayspast.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -47,7 +47,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.Heal] = 0.15 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("sodp-2pc", -1), + Base: gmod.NewBase("sodp-2pc", -1), AffectedStat: attributes.Heal, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/artifacts/tenacity/tenacity.go b/internal/artifacts/tenacity/tenacity.go index f69f3cddca..9129189c7b 100644 --- a/internal/artifacts/tenacity/tenacity.go +++ b/internal/artifacts/tenacity/tenacity.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -39,7 +39,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.HPP] = 0.20 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("tom-2pc", -1), + Base: gmod.NewBase("tom-2pc", -1), AffectedStat: attributes.HPP, Amount: func() ([]float64, bool) { return m, true @@ -68,7 +68,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri for _, this := range s.core.Player.Chars() { this.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("tom-4pc", 180), // 3s duration + Base: gmod.NewBaseWithHitlag("tom-4pc", 180), // 3s duration AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/artifacts/thunderingfury/thunderingfury.go b/internal/artifacts/thunderingfury/thunderingfury.go index 9111f76561..ac3188cc4a 100644 --- a/internal/artifacts/thunderingfury/thunderingfury.go +++ b/internal/artifacts/thunderingfury/thunderingfury.go @@ -13,7 +13,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -40,7 +40,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.ElectroP] = 0.15 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("tf-2pc", -1), + Base: gmod.NewBase("tf-2pc", -1), AffectedStat: attributes.ElectroP, Amount: func() ([]float64, bool) { return m, true @@ -56,7 +56,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri icd := 48 // 0.8s * 60 char.AddReactBonusMod(character.ReactBonusMod{ - Base: modifier.NewBase("tf-4pc", -1), + Base: gmod.NewBase("tf-4pc", -1), Amount: func(ai info.AttackInfo) (float64, bool) { if ai.Catalyzed && ai.CatalyzedType == info.ReactionTypeAggravate { return 0.2, false diff --git a/internal/artifacts/thundersoother/thundersoother.go b/internal/artifacts/thundersoother/thundersoother.go index cca65ed27b..a3e82ed0c5 100644 --- a/internal/artifacts/thundersoother/thundersoother.go +++ b/internal/artifacts/thundersoother/thundersoother.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -34,7 +34,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = 0.35 char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("ts-4pc", -1), + Base: gmod.NewBase("ts-4pc", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { r, ok := t.(core.Reactable) if !ok { diff --git a/internal/artifacts/unfinishedreverie/unfinishedreverie.go b/internal/artifacts/unfinishedreverie/unfinishedreverie.go index 99afe8da74..208a5632fa 100644 --- a/internal/artifacts/unfinishedreverie/unfinishedreverie.go +++ b/internal/artifacts/unfinishedreverie/unfinishedreverie.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -51,7 +51,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.ATKP] = 0.18 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase(unfinishedreverie2pc, -1), + Base: gmod.NewBase(unfinishedreverie2pc, -1), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return m, true @@ -63,7 +63,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri char.QueueCharTask(s.enemyCheck, checkInterval) m := make([]float64, attributes.EndStatType) char.AddStatMod(character.StatMod{ - Base: modifier.NewBase(unfinishedreverie4pc, -1), + Base: gmod.NewBase(unfinishedreverie4pc, -1), Amount: func() ([]float64, bool) { m[attributes.DmgP] = 0.1 * float64(s.stacks) return m, true diff --git a/internal/artifacts/vermillion/vermillion.go b/internal/artifacts/vermillion/vermillion.go index 3e0184b505..47feb18380 100644 --- a/internal/artifacts/vermillion/vermillion.go +++ b/internal/artifacts/vermillion/vermillion.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -47,7 +47,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.ATKP] = 0.18 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("verm-2pc", -1), + Base: gmod.NewBase("verm-2pc", -1), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return m, true @@ -81,7 +81,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri s.updateBuff() s.char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(verm4pckey, 16*60), + Base: gmod.NewBaseWithHitlag(verm4pckey, 16*60), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return s.buff, true diff --git a/internal/artifacts/viridescent/viridescent.go b/internal/artifacts/viridescent/viridescent.go index bb3ceac824..d7597849eb 100644 --- a/internal/artifacts/viridescent/viridescent.go +++ b/internal/artifacts/viridescent/viridescent.go @@ -12,7 +12,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -35,7 +35,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.AnemoP] = 0.15 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("vv-2pc", -1), + Base: gmod.NewBase("vv-2pc", -1), AffectedStat: attributes.AnemoP, Amount: func() ([]float64, bool) { return m, true @@ -49,7 +49,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri // add +0.6 reaction damage char.AddReactBonusMod(character.ReactBonusMod{ - Base: modifier.NewBase("vv-4pc", -1), + Base: gmod.NewBase("vv-4pc", -1), Amount: func(ai info.AttackInfo) (float64, bool) { // check to make sure this is not an amped swirl if ai.Amped || ai.Catalyzed { @@ -84,7 +84,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri } t.AddResistMod(info.ResistMod{ - Base: modifier.NewBaseWithHitlag(key, 10*60), + Base: gmod.NewBaseWithHitlag(key, 10*60), Ele: ele, Value: -0.4, }) @@ -128,7 +128,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri } t.AddResistMod(info.ResistMod{ - Base: modifier.NewBaseWithHitlag(key, 10*60), + Base: gmod.NewBaseWithHitlag(key, 10*60), Ele: ele, Value: -0.4, }) diff --git a/internal/artifacts/vourukashasglow/vourukashasglow.go b/internal/artifacts/vourukashasglow/vourukashasglow.go index 5e5827c348..ed1664157a 100644 --- a/internal/artifacts/vourukashasglow/vourukashasglow.go +++ b/internal/artifacts/vourukashasglow/vourukashasglow.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -37,7 +37,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.HPP] = 0.20 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("vg-2pc", -1), + Base: gmod.NewBase("vg-2pc", -1), AffectedStat: attributes.HPP, Amount: func() ([]float64, bool) { return m, true @@ -51,7 +51,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri mStack[attributes.DmgP] = 0.08 addStackMod := func(idx int, duration int) { char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag(fmt.Sprintf("vg-4pc-%v-stack", idx+1), duration), + Base: gmod.NewBaseWithHitlag(fmt.Sprintf("vg-4pc-%v-stack", idx+1), duration), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { switch atk.Info.AttackTag { case attacks.AttackTagElementalArt, @@ -83,7 +83,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri mBase := make([]float64, attributes.EndStatType) mBase[attributes.DmgP] = 0.1 char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("vg-4pc", -1), + Base: gmod.NewBase("vg-4pc", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { switch atk.Info.AttackTag { case attacks.AttackTagElementalArt, diff --git a/internal/artifacts/wanderer/wanderer.go b/internal/artifacts/wanderer/wanderer.go index 77d5b4097f..cb36dc22be 100644 --- a/internal/artifacts/wanderer/wanderer.go +++ b/internal/artifacts/wanderer/wanderer.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -39,7 +39,7 @@ func (s *Set) Init() error { m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = 0.35 s.char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("wt-4pc", -1), + Base: gmod.NewBase("wt-4pc", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagExtra { return nil, false @@ -62,7 +62,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri m := make([]float64, attributes.EndStatType) m[attributes.EM] = 80 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("wt-2pc", -1), + Base: gmod.NewBase("wt-2pc", -1), AffectedStat: attributes.EM, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/characters/albedo/asc.go b/internal/characters/albedo/asc.go index fad76deb39..75902d81b5 100644 --- a/internal/characters/albedo/asc.go +++ b/internal/characters/albedo/asc.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // Transient Blossoms generated by Abiogenesis: Solar @@ -21,7 +21,7 @@ func (c *char) a1() { m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = 0.25 c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("albedo-a1", -1), + Base: gmod.NewBase("albedo-a1", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagElementalArt { return nil, false @@ -47,7 +47,7 @@ func (c *char) a4() { m[attributes.EM] = 125 for _, char := range c.Core.Player.Chars() { char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("albedo-a4", 600), + Base: gmod.NewBaseWithHitlag("albedo-a4", 600), AffectedStat: attributes.EM, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/characters/albedo/cons.go b/internal/characters/albedo/cons.go index 29c1e69343..33c19e1674 100644 --- a/internal/characters/albedo/cons.go +++ b/internal/characters/albedo/cons.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/core/player/shield" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -36,7 +36,7 @@ func (c *char) c4(lastConstruct int) func() { m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = 0.3 active.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag("albedo-c4", 60), // 1s + Base: gmod.NewBaseWithHitlag("albedo-c4", 60), // 1s Amount: func(atk *info.AttackEvent, _ info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagPlunge { return nil, false @@ -72,7 +72,7 @@ func (c *char) c6(lastConstruct int) func() { m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = 0.17 active.AddStatMod(character.StatMod{ - Base: modifier.NewBase("albedo-c6", 60), // 1s + Base: gmod.NewBase("albedo-c6", 60), // 1s AffectedStat: attributes.DmgP, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/characters/alhaitham/asc.go b/internal/characters/alhaitham/asc.go index a2a87d4a0a..9441411c2b 100644 --- a/internal/characters/alhaitham/asc.go +++ b/internal/characters/alhaitham/asc.go @@ -5,7 +5,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/attributes" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const a1IcdKey = "alhaitham-a1-icd" @@ -39,7 +39,7 @@ func (c *char) a4() { } m := make([]float64, attributes.EndStatType) c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("alhaitham-a4", -1), + Base: gmod.NewBase("alhaitham-a4", -1), Amount: func(atk *info.AttackEvent, _ info.Target) ([]float64, bool) { // only trigger on projection attack and burst damage if atk.Info.AttackTag != attacks.AttackTagElementalBurst && diff --git a/internal/characters/alhaitham/cons.go b/internal/characters/alhaitham/cons.go index a0231d4920..9407af8ebb 100644 --- a/internal/characters/alhaitham/cons.go +++ b/internal/characters/alhaitham/cons.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -36,7 +36,7 @@ func (c *char) c2(generated int) { m[attributes.EM] = 50 for range generated { c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(c2ModName(c.c2Counter+1), 480), // 8s + Base: gmod.NewBaseWithHitlag(c2ModName(c.c2Counter+1), 480), // 8s AffectedStat: attributes.EM, Amount: func() ([]float64, bool) { return m, true @@ -67,7 +67,7 @@ func (c *char) c4Loss(consumed int) { continue } char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("alhaitham-c4-loss", 900), + Base: gmod.NewBaseWithHitlag("alhaitham-c4-loss", 900), AffectedStat: attributes.EM, Amount: func() ([]float64, bool) { return m, true @@ -83,7 +83,7 @@ func (c *char) c4Gain(generated int) { m := make([]float64, attributes.EndStatType) m[attributes.DendroP] = 0.1 * float64(generated) c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("alhaitham-c4-gain", 900), + Base: gmod.NewBaseWithHitlag("alhaitham-c4-gain", 900), AffectedStat: attributes.DendroP, Amount: func() ([]float64, bool) { return m, true @@ -110,7 +110,7 @@ func (c *char) c6(generated int) { c.Core.Log.NewEvent("c6 buff extended", glog.LogCharacterEvent, c.Index()).Write("c6 expiry on", c.StatusExpiry(c6key)) } else { c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag((c6key), 360), // 6s + Base: gmod.NewBaseWithHitlag((c6key), 360), // 6s AffectedStat: attributes.CR, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/characters/aloy/asc.go b/internal/characters/aloy/asc.go index 0f17458789..828738932e 100644 --- a/internal/characters/aloy/asc.go +++ b/internal/characters/aloy/asc.go @@ -3,7 +3,7 @@ package aloy import ( "github.com/genshinsim/gcsim/pkg/core/attributes" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // When Aloy receives the Coil effect from Frozen Wilds, her ATK is increased by 16%, while nearby party members' ATK is increased by 8%. @@ -19,7 +19,7 @@ func (c *char) a1() { m[attributes.ATKP] = .16 } char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("aloy-a1", rushingIceDuration), + Base: gmod.NewBaseWithHitlag("aloy-a1", rushingIceDuration), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return m, true @@ -37,7 +37,7 @@ func (c *char) a4() { m := make([]float64, attributes.EndStatType) stacks := 1 c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("aloy-strong-strike", rushingIceDuration), + Base: gmod.NewBaseWithHitlag("aloy-strong-strike", rushingIceDuration), AffectedStat: attributes.CryoP, Amount: func() ([]float64, bool) { if stacks > 10 { diff --git a/internal/characters/aloy/skill.go b/internal/characters/aloy/skill.go index b8a925ea78..52187ff10c 100644 --- a/internal/characters/aloy/skill.go +++ b/internal/characters/aloy/skill.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var skillFrames []int @@ -162,7 +162,7 @@ func (c *char) rushingIce() { val := make([]float64, attributes.EndStatType) val[attributes.DmgP] = skillRushingIceNABonus[c.TalentLvlSkill()] c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag("aloy-rushing-ice", rushingIceDuration), + Base: gmod.NewBaseWithHitlag("aloy-rushing-ice", rushingIceDuration), Amount: func(atk *info.AttackEvent, _ info.Target) ([]float64, bool) { if atk.Info.AttackTag == attacks.AttackTagNormal { return val, true @@ -179,7 +179,7 @@ func (c *char) rushingIce() { func (c *char) coilMod() { val := make([]float64, attributes.EndStatType) c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("aloy-coil-stacks", -1), + Base: gmod.NewBase("aloy-coil-stacks", -1), Amount: func(atk *info.AttackEvent, _ info.Target) ([]float64, bool) { if atk.Info.AttackTag == attacks.AttackTagNormal && c.coils > 0 { val[attributes.DmgP] = skillCoilNABonus[c.coils-1][c.TalentLvlSkill()] diff --git a/internal/characters/amber/asc.go b/internal/characters/amber/asc.go index a1ffc55edb..ee3b39bcd7 100644 --- a/internal/characters/amber/asc.go +++ b/internal/characters/amber/asc.go @@ -5,7 +5,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/attributes" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // Increases the CRIT Rate of Fiery Rain by 10% and widens its AoE by 30%. @@ -17,7 +17,7 @@ func (c *char) a1() { m := make([]float64, attributes.EndStatType) m[attributes.CR] = .1 c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("amber-a1", -1), + Base: gmod.NewBase("amber-a1", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { return m, atk.Info.AttackTag == attacks.AttackTagElementalBurst }, @@ -47,7 +47,7 @@ func (c *char) makeA4CB() info.AttackCBFunc { m := make([]float64, attributes.EndStatType) m[attributes.ATKP] = 0.15 c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("amber-a4", 600), + Base: gmod.NewBaseWithHitlag("amber-a4", 600), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/characters/amber/burst.go b/internal/characters/amber/burst.go index 0fdf878b5e..69915a53c8 100644 --- a/internal/characters/amber/burst.go +++ b/internal/characters/amber/burst.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/combat" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var burstFrames []int @@ -73,7 +73,7 @@ func (c *char) Burst(p map[string]int) (action.Info, error) { m[attributes.ATKP] = 0.15 for _, active := range c.Core.Player.Chars() { active.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("amber-c6", 900), + Base: gmod.NewBaseWithHitlag("amber-c6", 900), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/characters/amber/cons.go b/internal/characters/amber/cons.go index e118d6c288..e54e6c4432 100644 --- a/internal/characters/amber/cons.go +++ b/internal/characters/amber/cons.go @@ -5,7 +5,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/attributes" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // C2 @@ -14,7 +14,7 @@ func (c *char) c2() { m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = 2 c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("amber-c2", -1), + Base: gmod.NewBase("amber-c2", -1), Amount: func(atk *info.AttackEvent, _ info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagElementalArt { return nil, false diff --git a/internal/characters/arlecchino/asc.go b/internal/characters/arlecchino/asc.go index 3e6ad92a18..ea5740c19d 100644 --- a/internal/characters/arlecchino/asc.go +++ b/internal/characters/arlecchino/asc.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var directiveScaling = []float64{0.0, 0.65, 1.3} @@ -16,7 +16,7 @@ func (c *char) passive() { m := make([]float64, attributes.EndStatType) m[attributes.PyroP] = 0.4 c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("arlecchino-passive", -1), + Base: gmod.NewBase("arlecchino-passive", -1), AffectedStat: attributes.PyroP, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/characters/arlecchino/cons.go b/internal/characters/arlecchino/cons.go index 26699f0159..94af7155c5 100644 --- a/internal/characters/arlecchino/cons.go +++ b/internal/characters/arlecchino/cons.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -102,7 +102,7 @@ func (c *char) c6skill() { m[attributes.CR] = 0.1 m[attributes.CD] = 0.7 c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag(c6Key, 20*60), + Base: gmod.NewBaseWithHitlag(c6Key, 20*60), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { switch atk.Info.AttackTag { case attacks.AttackTagElementalBurst, attacks.AttackTagNormal: diff --git a/internal/characters/ayaka/asc.go b/internal/characters/ayaka/asc.go index fd72f7f3c6..f4261e113d 100644 --- a/internal/characters/ayaka/asc.go +++ b/internal/characters/ayaka/asc.go @@ -5,7 +5,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/attributes" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // After using Kamisato Art: Hyouka, Kamisato Ayaka's Normal and Charged Attacks deal 30% increased DMG for 6s. @@ -16,7 +16,7 @@ func (c *char) a1() { m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = 0.3 c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag("ayaka-a1", 360), + Base: gmod.NewBaseWithHitlag("ayaka-a1", 360), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { return m, atk.Info.AttackTag == attacks.AttackTagNormal || atk.Info.AttackTag == attacks.AttackTagExtra }, @@ -47,7 +47,7 @@ func (c *char) makeA4CB() info.AttackCBFunc { m := make([]float64, attributes.EndStatType) m[attributes.CryoP] = 0.18 c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("ayaka-a4", 600), + Base: gmod.NewBaseWithHitlag("ayaka-a4", 600), AffectedStat: attributes.CryoP, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/characters/ayaka/cons.go b/internal/characters/ayaka/cons.go index 70f03c27ef..01001687dd 100644 --- a/internal/characters/ayaka/cons.go +++ b/internal/characters/ayaka/cons.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -52,7 +52,7 @@ func (c *char) c4(a info.AttackCB) { return } e.AddDefMod(info.DefMod{ - Base: modifier.NewBaseWithHitlag("ayaka-c4", 60*6), + Base: gmod.NewBaseWithHitlag("ayaka-c4", 60*6), Value: -0.3, }) } @@ -85,7 +85,7 @@ func (c *char) c6AddBuff() { m[attributes.DmgP] = 2.98 c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("ayaka-c6", -1), + Base: gmod.NewBase("ayaka-c6", -1), Amount: func(atk *info.AttackEvent, _ info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagExtra { return nil, false diff --git a/internal/characters/ayato/burst.go b/internal/characters/ayato/burst.go index fc9a1baee4..e2cfa1802d 100644 --- a/internal/characters/ayato/burst.go +++ b/internal/characters/ayato/burst.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/combat" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var burstFrames []int @@ -72,7 +72,7 @@ func (c *char) Burst(p map[string]int) (action.Info, error) { } active := c.Core.Player.ActiveChar() active.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag("ayato-burst", 90), + Base: gmod.NewBaseWithHitlag("ayato-burst", 90), Amount: func(a *info.AttackEvent, t info.Target) ([]float64, bool) { return m, a.Info.AttackTag == attacks.AttackTagNormal }, @@ -85,7 +85,7 @@ func (c *char) Burst(p map[string]int) (action.Info, error) { m[attributes.AtkSpd] = 0.15 for _, char := range c.Core.Player.Chars() { char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("ayato-c4", 15*60), + Base: gmod.NewBaseWithHitlag("ayato-c4", 15*60), AffectedStat: attributes.AtkSpd, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/characters/ayato/cons.go b/internal/characters/ayato/cons.go index 95f43481a0..176f3a0c4a 100644 --- a/internal/characters/ayato/cons.go +++ b/internal/characters/ayato/cons.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -20,7 +20,7 @@ func (c *char) c1() { m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = 0.4 c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("ayato-c1", -1), + Base: gmod.NewBase("ayato-c1", -1), Amount: func(a *info.AttackEvent, t info.Target) ([]float64, bool) { x, ok := t.(*enemy.Enemy) if !ok { @@ -39,7 +39,7 @@ func (c *char) c2() { m := make([]float64, attributes.EndStatType) m[attributes.HPP] = 0.5 c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("ayato-c2", -1), + Base: gmod.NewBase("ayato-c2", -1), AffectedStat: attributes.HPP, Amount: func() ([]float64, bool) { if c.stacks >= 3 { diff --git a/internal/characters/baizhu/asc.go b/internal/characters/baizhu/asc.go index 742a5164fb..ff8753f11a 100644 --- a/internal/characters/baizhu/asc.go +++ b/internal/characters/baizhu/asc.go @@ -5,7 +5,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/attributes" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // Baizhu gains different effects according to the current HP of your current active character: @@ -20,7 +20,7 @@ func (c *char) a1() { mHeal := make([]float64, attributes.EndStatType) mHeal[attributes.Heal] = 0.2 c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("baizhu-a1-heal-bonus", -1), + Base: gmod.NewBase("baizhu-a1-heal-bonus", -1), AffectedStat: attributes.Heal, Amount: func() ([]float64, bool) { active := c.Core.Player.ActiveChar() @@ -35,7 +35,7 @@ func (c *char) a1() { mDendroP := make([]float64, attributes.EndStatType) mDendroP[attributes.DendroP] = 0.25 c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("baizhu-a1-dendro-dmg", -1), + Base: gmod.NewBase("baizhu-a1-dendro-dmg", -1), AffectedStat: attributes.DendroP, Amount: func() ([]float64, bool) { active := c.Core.Player.ActiveChar() @@ -57,7 +57,7 @@ func (c *char) a4() { return } c.Core.Player.ActiveChar().AddReactBonusMod(character.ReactBonusMod{ - Base: modifier.NewBaseWithHitlag("baizhu-a4", 6*60), + Base: gmod.NewBaseWithHitlag("baizhu-a4", 6*60), Amount: func(ai info.AttackInfo) (float64, bool) { limitHP := c.MaxHP() / 1000.0 if limitHP > 50 { diff --git a/internal/characters/baizhu/cons.go b/internal/characters/baizhu/cons.go index c8a420bb0d..e17e21e5de 100644 --- a/internal/characters/baizhu/cons.go +++ b/internal/characters/baizhu/cons.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/event" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const c2ICDKey = "baizhu-c2-icd" @@ -80,7 +80,7 @@ func (c *char) c4() { m[attributes.EM] = 80 for _, char := range c.Core.Player.Chars() { char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("baizhu-c4", 900), + Base: gmod.NewBaseWithHitlag("baizhu-c4", 900), AffectedStat: attributes.EM, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/characters/barbara/cons.go b/internal/characters/barbara/cons.go index ffb9851ccf..d1ab736913 100644 --- a/internal/characters/barbara/cons.go +++ b/internal/characters/barbara/cons.go @@ -5,7 +5,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/event" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func (c *char) c1(delay int) { @@ -21,7 +21,7 @@ func (c *char) c2() { continue } char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("barbara-c2", skillDuration), + Base: gmod.NewBase("barbara-c2", skillDuration), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return c.c2buff, true diff --git a/internal/characters/beidou/asc.go b/internal/characters/beidou/asc.go index 7e2f3aa1b2..bde203f3c3 100644 --- a/internal/characters/beidou/asc.go +++ b/internal/characters/beidou/asc.go @@ -5,7 +5,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/attributes" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // A1 is not implemented: @@ -22,7 +22,7 @@ func (c *char) a4() { mDmg := make([]float64, attributes.EndStatType) mDmg[attributes.DmgP] = .15 c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag("beidou-a4-dmg", 600), + Base: gmod.NewBaseWithHitlag("beidou-a4-dmg", 600), Amount: func(atk *info.AttackEvent, _ info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagNormal && atk.Info.AttackTag != attacks.AttackTagExtra { return nil, false @@ -34,7 +34,7 @@ func (c *char) a4() { mAtkSpd := make([]float64, attributes.EndStatType) mAtkSpd[attributes.AtkSpd] = .15 c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("beidou-a4-atkspd", 600), + Base: gmod.NewBaseWithHitlag("beidou-a4-atkspd", 600), AffectedStat: attributes.AtkSpd, Amount: func() ([]float64, bool) { return mAtkSpd, true diff --git a/internal/characters/beidou/burst.go b/internal/characters/beidou/burst.go index 9efba530a0..c66615965f 100644 --- a/internal/characters/beidou/burst.go +++ b/internal/characters/beidou/burst.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/shield" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var burstFrames []int @@ -93,7 +93,7 @@ func (c *char) Burst(p map[string]int) (action.Info, error) { enemies := c.Core.Combat.EnemiesWithinArea(combat.NewCircleHitOnTarget(c.Core.Combat.Player(), nil, 5), nil) for _, v := range enemies { v.AddResistMod(info.ResistMod{ - Base: modifier.NewBaseWithHitlag("beidouc6", 90), + Base: gmod.NewBaseWithHitlag("beidouc6", 90), Ele: attributes.Electro, Value: -0.15, }) diff --git a/internal/characters/bennett/burst.go b/internal/characters/bennett/burst.go index a2d0b287fe..6a0f982b6f 100644 --- a/internal/characters/bennett/burst.go +++ b/internal/characters/bennett/burst.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var burstFrames []int @@ -144,7 +144,7 @@ func (c *char) applyBennettField(stats [attributes.EndStatType]float64, firstTic } active.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(burstFieldKey, burstBuffDuration), + Base: gmod.NewBaseWithHitlag(burstFieldKey, burstBuffDuration), AffectedStat: attributes.NoStat, Extra: true, Amount: func() ([]float64, bool) { diff --git a/internal/characters/bennett/cons.go b/internal/characters/bennett/cons.go index 8aad393777..724b784c21 100644 --- a/internal/characters/bennett/cons.go +++ b/internal/characters/bennett/cons.go @@ -3,7 +3,7 @@ package bennett import ( "github.com/genshinsim/gcsim/pkg/core/attributes" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func (c *char) c2() { @@ -11,7 +11,7 @@ func (c *char) c2() { m[attributes.ER] = .3 c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("bennett-c2", -1), + Base: gmod.NewBase("bennett-c2", -1), AffectedStat: attributes.ER, Amount: func() ([]float64, bool) { return m, c.CurrentHPRatio() < 0.7 diff --git a/internal/characters/candace/asc.go b/internal/characters/candace/asc.go index 524f0e4feb..0c828093c2 100644 --- a/internal/characters/candace/asc.go +++ b/internal/characters/candace/asc.go @@ -5,7 +5,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/attributes" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // A1 is not implemented: @@ -21,7 +21,7 @@ func (c *char) a4(char *character.CharWrapper) { } m := make([]float64, attributes.EndStatType) char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase(a4Key, -1), + Base: gmod.NewBase(a4Key, -1), Amount: func(atk *info.AttackEvent, _ info.Target) ([]float64, bool) { if !c.StatusIsActive(burstKey) { return nil, false diff --git a/internal/characters/candace/burst.go b/internal/characters/candace/burst.go index 4bfcd90ff6..833655a501 100644 --- a/internal/characters/candace/burst.go +++ b/internal/characters/candace/burst.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/event" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var burstFrames []int @@ -139,7 +139,7 @@ func (c *char) burstInit(char *character.CharWrapper) { m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = 0.2 char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase(burstDmgKey, -1), + Base: gmod.NewBase(burstDmgKey, -1), Amount: func(atk *info.AttackEvent, _ info.Target) ([]float64, bool) { if !c.StatusIsActive(burstKey) { return nil, false diff --git a/internal/characters/candace/cons.go b/internal/characters/candace/cons.go index e7fffeee48..e92110b414 100644 --- a/internal/characters/candace/cons.go +++ b/internal/characters/candace/cons.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/event" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const c6ICDKey = "candace-c6-icd" @@ -18,7 +18,7 @@ func (c *char) c2() { m := make([]float64, attributes.EndStatType) m[attributes.HPP] = 0.2 c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("candace-c2", 15*60), + Base: gmod.NewBaseWithHitlag("candace-c2", 15*60), AffectedStat: attributes.HPP, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/characters/charlotte/asc.go b/internal/characters/charlotte/asc.go index 5112c48595..9466fa5f3b 100644 --- a/internal/characters/charlotte/asc.go +++ b/internal/characters/charlotte/asc.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func (c *char) a1() { @@ -58,7 +58,7 @@ func (c *char) a4() { m[attributes.Heal] = 0.05 * float64(heal) m[attributes.CryoP] = 0.05 * float64(cryop) c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("charlotte-a4", -1), + Base: gmod.NewBase("charlotte-a4", -1), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/characters/charlotte/cons.go b/internal/characters/charlotte/cons.go index c33637b67b..79d514393e 100644 --- a/internal/characters/charlotte/cons.go +++ b/internal/characters/charlotte/cons.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -73,7 +73,7 @@ func (c *char) makeC2CB() info.AttackCBFunc { m := make([]float64, attributes.EndStatType) m[attributes.ATKP] = 0.1 * float64(c.c2Hits) c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("charlotte-c2", 12*60), + Base: gmod.NewBaseWithHitlag("charlotte-c2", 12*60), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/characters/chasca/asc.go b/internal/characters/chasca/asc.go index 8b61a06b5c..8d066f2d8b 100644 --- a/internal/characters/chasca/asc.go +++ b/internal/characters/chasca/asc.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/event" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var ( @@ -25,7 +25,7 @@ func (c *char) a1DMGBuff() { // assuming we don't need to add and remove this buff constantly // since it would be active for all E-CAs anyways c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("chasca-a1", -1), + Base: gmod.NewBase("chasca-a1", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.ICDTag != attacks.ICDTagChascaShining { return nil, false diff --git a/internal/characters/chevreuse/asc.go b/internal/characters/chevreuse/asc.go index 5d23c63a8e..da39fdc750 100644 --- a/internal/characters/chevreuse/asc.go +++ b/internal/characters/chevreuse/asc.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // When all party members are Pyro and Electro characters and there is at least @@ -46,12 +46,12 @@ func (c *char) a1() { return false } t.AddResistMod(info.ResistMod{ - Base: modifier.NewBaseWithHitlag("chev-a1-pyro", 6*60), + Base: gmod.NewBaseWithHitlag("chev-a1-pyro", 6*60), Ele: attributes.Pyro, Value: -0.40, }) t.AddResistMod(info.ResistMod{ - Base: modifier.NewBaseWithHitlag("chev-a1-electro", 6*60), + Base: gmod.NewBaseWithHitlag("chev-a1-electro", 6*60), Ele: attributes.Electro, Value: -0.40, }) @@ -75,7 +75,7 @@ func (c *char) a4() { continue } char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("chev-a4", 30*60), + Base: gmod.NewBaseWithHitlag("chev-a4", 30*60), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/characters/chevreuse/cons.go b/internal/characters/chevreuse/cons.go index e9b37b3c5b..bffb8f9d89 100644 --- a/internal/characters/chevreuse/cons.go +++ b/internal/characters/chevreuse/cons.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/event" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -155,7 +155,7 @@ func (c *char) c6(char *character.CharWrapper) { m[attributes.ElectroP] = 0.20 char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(fmt.Sprintf("chev-c6-%v-stack", c.c6StackCounts[char.Index()]+1), 8*60), + Base: gmod.NewBaseWithHitlag(fmt.Sprintf("chev-c6-%v-stack", c.c6StackCounts[char.Index()]+1), 8*60), Amount: func() ([]float64, bool) { return m, true }, diff --git a/internal/characters/chiori/asc.go b/internal/characters/chiori/asc.go index 0a6afbcaae..1d8a57eff6 100644 --- a/internal/characters/chiori/asc.go +++ b/internal/characters/chiori/asc.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -195,7 +195,7 @@ func (c *char) a4() { // needs to be callable separately because of c1 rock doll activating a4 func (c *char) applyA4Buff() { c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(a4BuffKey, a4Duration), + Base: gmod.NewBaseWithHitlag(a4BuffKey, a4Duration), AffectedStat: attributes.GeoP, Amount: func() ([]float64, bool) { return c.a4Buff, true diff --git a/internal/characters/chongyun/asc.go b/internal/characters/chongyun/asc.go index edf2590970..e8ad43637d 100644 --- a/internal/characters/chongyun/asc.go +++ b/internal/characters/chongyun/asc.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/combat" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // When the field created by Spirit Blade: Chonghua's Layered Frost disappears, @@ -59,7 +59,7 @@ func (c *char) a4CB(a info.AttackCB) { return } e.AddResistMod(info.ResistMod{ - Base: modifier.NewBaseWithHitlag("chongyun-a4", 480), + Base: gmod.NewBaseWithHitlag("chongyun-a4", 480), Ele: attributes.Cryo, Value: -0.10, }) diff --git a/internal/characters/chongyun/cons.go b/internal/characters/chongyun/cons.go index 6188fd21a7..e0043bf2ea 100644 --- a/internal/characters/chongyun/cons.go +++ b/internal/characters/chongyun/cons.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const c4ICDKey = "chongyun-c4-icd" @@ -44,7 +44,7 @@ func (c *char) c6() { m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = 0.15 c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("chongyun-c6", -1), + Base: gmod.NewBase("chongyun-c6", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagElementalBurst { return nil, false diff --git a/internal/characters/chongyun/skill.go b/internal/characters/chongyun/skill.go index 25e4ed6550..c0fd55ece8 100644 --- a/internal/characters/chongyun/skill.go +++ b/internal/characters/chongyun/skill.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var skillFrames []int @@ -131,7 +131,7 @@ func (c *char) infuse(active *character.CharWrapper) { // c2 reduces CD by 15% if c.Base.Cons >= 2 { active.AddCooldownMod(character.CooldownMod{ - Base: modifier.NewBaseWithHitlag("chongyun-c2", dur), + Base: gmod.NewBaseWithHitlag("chongyun-c2", dur), Amount: func(a action.Action) float64 { if a == action.ActionSkill || a == action.ActionBurst { return -0.15 @@ -161,7 +161,7 @@ func (c *char) infuse(active *character.CharWrapper) { m := make([]float64, attributes.EndStatType) m[attributes.AtkSpd] = 0.08 active.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("chongyun-field", dur), + Base: gmod.NewBaseWithHitlag("chongyun-field", dur), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/characters/citlali/asc.go b/internal/characters/citlali/asc.go index 211014014e..9cf2e43498 100644 --- a/internal/characters/citlali/asc.go +++ b/internal/characters/citlali/asc.go @@ -5,7 +5,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/event" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -43,12 +43,12 @@ func (c *char) a1Hook(args ...any) bool { } t.AddResistMod(info.ResistMod{ - Base: modifier.NewBaseWithHitlag("citlali-a1-hydro", 12*60), + Base: gmod.NewBaseWithHitlag("citlali-a1-hydro", 12*60), Ele: attributes.Hydro, Value: amt, }) t.AddResistMod(info.ResistMod{ - Base: modifier.NewBaseWithHitlag("citlali-a1-pyro", 12*60), + Base: gmod.NewBaseWithHitlag("citlali-a1-pyro", 12*60), Ele: attributes.Pyro, Value: amt, }) diff --git a/internal/characters/citlali/cons.go b/internal/characters/citlali/cons.go index 618587fd08..7dddde3a56 100644 --- a/internal/characters/citlali/cons.go +++ b/internal/characters/citlali/cons.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/core/player/shield" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -68,7 +68,7 @@ func (c *char) c2() { buffOther[attributes.EM] = 250 c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("citlali-c2-em", -1), + Base: gmod.NewBase("citlali-c2-em", -1), AffectedStat: attributes.EM, Amount: func() ([]float64, bool) { if c.Core.Player.Shields.Get(shield.CitlaliSkill) == nil { @@ -85,7 +85,7 @@ func (c *char) c2() { } this := char this.AddStatMod(character.StatMod{ - Base: modifier.NewBase("citlali-c2-em", -1), + Base: gmod.NewBase("citlali-c2-em", -1), AffectedStat: attributes.EM, Amount: func() ([]float64, bool) { // character should be followed by Itzpapa, i.e. the character is active @@ -148,7 +148,7 @@ func (c *char) c6() { continue } char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("citlali-c6", -1), + Base: gmod.NewBaseWithHitlag("citlali-c6", -1), Amount: func() ([]float64, bool) { buffOther[attributes.PyroP] = 0.015 * c.numC6Stacks buffOther[attributes.HydroP] = 0.015 * c.numC6Stacks @@ -157,7 +157,7 @@ func (c *char) c6() { }) } c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag("citlali-c6", -1), + Base: gmod.NewBaseWithHitlag("citlali-c6", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { buffSelf[attributes.DmgP] = 0.025 * c.numC6Stacks return buffSelf, true diff --git a/internal/characters/clorinde/asc.go b/internal/characters/clorinde/asc.go index 5e48e65775..f98456cf11 100644 --- a/internal/characters/clorinde/asc.go +++ b/internal/characters/clorinde/asc.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/core/stacks" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -55,7 +55,7 @@ func (c *char) a1CBGadget(...any) bool { // add a stack and refresh the mod for 15s c.a1stacks.Add(clordineA1BuffDuration) c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag(clorindeA1BuffKey, clordineA1BuffDuration), + Base: gmod.NewBaseWithHitlag(clorindeA1BuffKey, clordineA1BuffDuration), Amount: c.a1Amount, }) return false @@ -116,7 +116,7 @@ func (c *char) a4(change float64) { } c.a4stacks.Add(clordineA4BuffDuration) c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(clorindeA4BuffKey, clordineA4BuffDuration), + Base: gmod.NewBaseWithHitlag(clorindeA4BuffKey, clordineA4BuffDuration), Amount: c.a4Amount, }) c.Core.Log.NewEvent("a4 triggered", glog.LogCharacterEvent, c.Index()). diff --git a/internal/characters/clorinde/cons.go b/internal/characters/clorinde/cons.go index 53e41ee2dc..563387844b 100644 --- a/internal/characters/clorinde/cons.go +++ b/internal/characters/clorinde/cons.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/event" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -93,7 +93,7 @@ func (c *char) c4() { m := make([]float64, attributes.EndStatType) c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("clorinde-c4-burst-bonus", -1), + Base: gmod.NewBase("clorinde-c4-burst-bonus", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagElementalBurst { return nil, false @@ -122,7 +122,7 @@ func (c *char) c6skill() { mCR := make([]float64, attributes.EndStatType) mCR[attributes.CR] = 0.1 c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("clorinde-c6-cr-bonus", c6Icd), + Base: gmod.NewBase("clorinde-c6-cr-bonus", c6Icd), AffectedStat: attributes.CR, Amount: func() ([]float64, bool) { return mCR, true @@ -132,7 +132,7 @@ func (c *char) c6skill() { mCD := make([]float64, attributes.EndStatType) mCD[attributes.CD] = 0.7 c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("clorinde-c6-cd-bonus", c6Icd), + Base: gmod.NewBase("clorinde-c6-cd-bonus", c6Icd), AffectedStat: attributes.CD, Amount: func() ([]float64, bool) { return mCD, true diff --git a/internal/characters/collei/cons.go b/internal/characters/collei/cons.go index 0d2d83bb7e..512b202e0b 100644 --- a/internal/characters/collei/cons.go +++ b/internal/characters/collei/cons.go @@ -9,14 +9,14 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func (c *char) c1() { m := make([]float64, attributes.EndStatType) m[attributes.ER] = 0.2 c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("collei-c1", -1), + Base: gmod.NewBase("collei-c1", -1), AffectedStat: attributes.ER, Amount: func() ([]float64, bool) { if c.Core.Player.Active() != c.Index() { @@ -68,7 +68,7 @@ func (c *char) c4() { amts := make([]float64, attributes.EndStatType) amts[attributes.EM] = 60 char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("collei-c4", 720), + Base: gmod.NewBaseWithHitlag("collei-c4", 720), AffectedStat: attributes.EM, Amount: func() ([]float64, bool) { return amts, true diff --git a/internal/characters/cyno/asc.go b/internal/characters/cyno/asc.go index 08d425c2c7..88257720b5 100644 --- a/internal/characters/cyno/asc.go +++ b/internal/characters/cyno/asc.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const a1Key = "cyno-a1" @@ -34,7 +34,7 @@ func (c *char) a1Buff() { m[attributes.DmgP] = 0.35 // game also implements dmg buff with 1s modifier c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag("cyno-a1-dmg", 60), + Base: gmod.NewBaseWithHitlag("cyno-a1-dmg", 60), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { // actual game uses AttackTagElementalArtExtra for a1, this is a decent // workaround diff --git a/internal/characters/cyno/burst.go b/internal/characters/cyno/burst.go index 55c4d5979e..2e2f62d76f 100644 --- a/internal/characters/cyno/burst.go +++ b/internal/characters/cyno/burst.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/event" "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var burstFrames []int @@ -32,7 +32,7 @@ func (c *char) Burst(p map[string]int) (action.Info, error) { m := make([]float64, attributes.EndStatType) m[attributes.EM] = 100 c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(burstKey, 712), // 112f extra duration + Base: gmod.NewBaseWithHitlag(burstKey, 712), // 112f extra duration AffectedStat: attributes.EM, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/characters/cyno/cons.go b/internal/characters/cyno/cons.go index d7f71f410c..66f1dbb9c7 100644 --- a/internal/characters/cyno/cons.go +++ b/internal/characters/cyno/cons.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -27,7 +27,7 @@ func (c *char) c1() { m := make([]float64, attributes.EndStatType) m[attributes.AtkSpd] = 0.2 c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(c1Key, 600), // 10s + Base: gmod.NewBaseWithHitlag(c1Key, 600), // 10s AffectedStat: attributes.AtkSpd, Amount: func() ([]float64, bool) { if c.Core.Player.CurrentState() != action.NormalAttackState { @@ -69,7 +69,7 @@ func (c *char) makeC2CB() info.AttackCBFunc { m := make([]float64, attributes.EndStatType) c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(c2Key, 4*60), + Base: gmod.NewBaseWithHitlag(c2Key, 4*60), AffectedStat: attributes.ElectroP, Amount: func() ([]float64, bool) { m[attributes.ElectroP] = 0.1 * float64(c.c2Stacks) diff --git a/internal/characters/dahlia/asc.go b/internal/characters/dahlia/asc.go index 2c1675cbf8..c96860abd2 100644 --- a/internal/characters/dahlia/asc.go +++ b/internal/characters/dahlia/asc.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -80,7 +80,7 @@ func (c *char) a4() { func (c *char) addAttackSpeedbuff(char *character.CharWrapper) { char.AddStatMod(character.StatMod{ - Base: modifier.NewBase(attackSpeedKey, -1), + Base: gmod.NewBase(attackSpeedKey, -1), AffectedStat: attributes.AtkSpd, Amount: func() ([]float64, bool) { // No Attack Speed buff if Favonian Favor from Dahlia's Burst is not active diff --git a/internal/characters/dehya/cons.go b/internal/characters/dehya/cons.go index f19813a7a1..03e0f5ca3f 100644 --- a/internal/characters/dehya/cons.go +++ b/internal/characters/dehya/cons.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // Dehya's Max HP is increased by 20%, and she deals bonus DMG based on her Max HP when using the following attacks: @@ -21,7 +21,7 @@ func (c *char) c1() { m := make([]float64, attributes.EndStatType) m[attributes.HPP] = 0.2 c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("dehya-c1", -1), + Base: gmod.NewBase("dehya-c1", -1), AffectedStat: attributes.HPP, Amount: func() ([]float64, bool) { return m, true @@ -49,7 +49,7 @@ func (c *char) c2() { val := make([]float64, attributes.EndStatType) val[attributes.DmgP] = 0.5 c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("dehya-sanctum-dot-c2", -1), + Base: gmod.NewBase("dehya-sanctum-dot-c2", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.Abil != skillDoTAbil || !c.hasC2DamageBuff { return nil, false @@ -120,7 +120,7 @@ func (c *char) c6() { val[attributes.CR] = 0.1 c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("dehya-c6", -1), + Base: gmod.NewBase("dehya-c6", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagElementalBurst { return nil, false diff --git a/internal/characters/diluc/burst.go b/internal/characters/diluc/burst.go index 780e7dc960..0636bee18c 100644 --- a/internal/characters/diluc/burst.go +++ b/internal/characters/diluc/burst.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/combat" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var burstFrames []int @@ -41,7 +41,7 @@ func (c *char) Burst(p map[string]int) (action.Info, error) { // Additionally, Diluc gains 20% Pyro DMG Bonus during the duration of this effect. if hasA4 { c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(burstBuffKey, duration), + Base: gmod.NewBaseWithHitlag(burstBuffKey, duration), AffectedStat: attributes.PyroP, Amount: func() ([]float64, bool) { return c.a4buff, true diff --git a/internal/characters/diluc/cons.go b/internal/characters/diluc/cons.go index ee8d9e5948..812153345c 100644 --- a/internal/characters/diluc/cons.go +++ b/internal/characters/diluc/cons.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func (c *char) c1() { @@ -15,7 +15,7 @@ func (c *char) c1() { m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = 0.15 c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("diluc-c1", -1), + Base: gmod.NewBase("diluc-c1", -1), Amount: func(_ *info.AttackEvent, t info.Target) ([]float64, bool) { x, ok := t.(*enemy.Enemy) if !ok { @@ -58,7 +58,7 @@ func (c *char) c2() { c.c2buff[attributes.ATKP] = 0.1 * float64(c.c2stack) c.c2buff[attributes.AtkSpd] = 0.05 * float64(c.c2stack) c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(c2BuffKey, 600), + Base: gmod.NewBaseWithHitlag(c2BuffKey, 600), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return c.c2buff, true @@ -72,7 +72,7 @@ const c4BuffKey = "diluc-c4" func (c *char) c4() { c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag(c4BuffKey, 120), + Base: gmod.NewBaseWithHitlag(c4BuffKey, 120), Amount: func(atk *info.AttackEvent, _ info.Target) ([]float64, bool) { // should only affect skill dmg if atk.Info.AttackTag != attacks.AttackTagElementalArt { diff --git a/internal/characters/diluc/skill.go b/internal/characters/diluc/skill.go index ee77d5d589..802d5b9fea 100644 --- a/internal/characters/diluc/skill.go +++ b/internal/characters/diluc/skill.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/combat" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var ( @@ -65,7 +65,7 @@ func (c *char) Skill(p map[string]int) (action.Info, error) { m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = 0.3 c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag("diluc-c6-dmg", 360), + Base: gmod.NewBaseWithHitlag("diluc-c6-dmg", 360), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagNormal { return nil, false @@ -81,7 +81,7 @@ func (c *char) Skill(p map[string]int) (action.Info, error) { mAtkSpd := make([]float64, attributes.EndStatType) mAtkSpd[attributes.AtkSpd] = 0.3 c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("diluc-c6-speed", 360), + Base: gmod.NewBaseWithHitlag("diluc-c6-speed", 360), AffectedStat: attributes.AtkSpd, Amount: func() ([]float64, bool) { if c.Core.Player.CurrentState() != action.NormalAttackState { diff --git a/internal/characters/diona/cons.go b/internal/characters/diona/cons.go index 660568bb10..8fdd1d2a69 100644 --- a/internal/characters/diona/cons.go +++ b/internal/characters/diona/cons.go @@ -6,14 +6,14 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func (c *char) c2() { m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = .15 c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("diona-c2", -1), + Base: gmod.NewBase("diona-c2", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { return m, atk.Info.AttackTag == attacks.AttackTagElementalArt }, @@ -32,7 +32,7 @@ func (c *char) c6() { active := c.Core.Player.ActiveChar() if active.CurrentHPRatio() > 0.5 { active.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("diona-c6", 120), + Base: gmod.NewBaseWithHitlag("diona-c6", 120), AffectedStat: attributes.EM, Amount: func() ([]float64, bool) { return c.c6buff, true @@ -42,7 +42,7 @@ func (c *char) c6() { // add healing bonus if hp <= 0.5 // bonus only lasts for 120 frames active.AddHealBonusMod(character.HealBonusMod{ - Base: modifier.NewBaseWithHitlag("diona-c6-healbonus", 120), + Base: gmod.NewBaseWithHitlag("diona-c6-healbonus", 120), Amount: func() (float64, bool) { // is this log even needed? c.Core.Log.NewEvent("diona c6 incomming heal bonus activated", glog.LogCharacterEvent, c.Index()) diff --git a/internal/characters/dori/cons.go b/internal/characters/dori/cons.go index 13196778be..f4927ba5ed 100644 --- a/internal/characters/dori/cons.go +++ b/internal/characters/dori/cons.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/combat" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // The number of After-Sales Service Rounds created by Troubleshooter Shots is increased by 1. @@ -48,7 +48,7 @@ func (c *char) c4() { active := c.Core.Player.ActiveChar() if active.CurrentHPRatio() < 0.5 { active.AddHealBonusMod(character.HealBonusMod{ - Base: modifier.NewBaseWithHitlag("dori-c4-healbonus", 48), + Base: gmod.NewBaseWithHitlag("dori-c4-healbonus", 48), Amount: func() (float64, bool) { return 0.5, false }, @@ -59,7 +59,7 @@ func (c *char) c4() { erMod := make([]float64, attributes.EndStatType) erMod[attributes.ER] = 0.3 active.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("dori-c4-er-bonus", 48), + Base: gmod.NewBaseWithHitlag("dori-c4-er-bonus", 48), AffectedStat: attributes.ER, Amount: func() ([]float64, bool) { return erMod, true diff --git a/internal/characters/emilie/asc.go b/internal/characters/emilie/asc.go index 469d9d833e..be2d414d17 100644 --- a/internal/characters/emilie/asc.go +++ b/internal/characters/emilie/asc.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -51,7 +51,7 @@ func (c *char) a4() { m := make([]float64, attributes.EndStatType) c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase(a4ModKey, -1), + Base: gmod.NewBase(a4ModKey, -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { x, ok := t.(*enemy.Enemy) if !ok { diff --git a/internal/characters/emilie/cons.go b/internal/characters/emilie/cons.go index 04507f92bf..3cc85c7d23 100644 --- a/internal/characters/emilie/cons.go +++ b/internal/characters/emilie/cons.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -65,7 +65,7 @@ func (c *char) c1A1() { m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = 0.2 c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase(c1ModKey, -1), + Base: gmod.NewBase(c1ModKey, -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagElementalArt && atk.Info.Abil != a1Abil { return nil, false @@ -98,7 +98,7 @@ func (c *char) c2(a info.AttackCB) { return } e.AddResistMod(info.ResistMod{ - Base: modifier.NewBaseWithHitlag(c2ModKey, c2Duration), + Base: gmod.NewBaseWithHitlag(c2ModKey, c2Duration), Ele: attributes.Dendro, Value: -0.3, }) diff --git a/internal/characters/escoffier/asc.go b/internal/characters/escoffier/asc.go index fed99d88bc..e3f7e0025f 100644 --- a/internal/characters/escoffier/asc.go +++ b/internal/characters/escoffier/asc.go @@ -4,7 +4,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/attributes" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -73,12 +73,12 @@ func (c *char) makeA4CB() info.AttackCBFunc { } shred := a4Shred[c.a4HydroCryoCount] e.AddResistMod(info.ResistMod{ - Base: modifier.NewBaseWithHitlag("escoffier-a4-shred-cryo", a4Dur), + Base: gmod.NewBaseWithHitlag("escoffier-a4-shred-cryo", a4Dur), Ele: attributes.Cryo, Value: -shred, }) e.AddResistMod(info.ResistMod{ - Base: modifier.NewBaseWithHitlag("escoffier-a4-shred-hydro", a4Dur), + Base: gmod.NewBaseWithHitlag("escoffier-a4-shred-hydro", a4Dur), Ele: attributes.Hydro, Value: -shred, }) diff --git a/internal/characters/escoffier/cons.go b/internal/characters/escoffier/cons.go index b955fd7fd5..eea12eaa00 100644 --- a/internal/characters/escoffier/cons.go +++ b/internal/characters/escoffier/cons.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -63,7 +63,7 @@ func (c *char) c1() { // TODO: check if this buff is affected by hitlag on characters or hitlag on escoffier // Currently assuming affected by hitlag on characters char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag(c1Key, c1Dur), + Base: gmod.NewBaseWithHitlag(c1Key, c1Dur), Amount: func(ae *info.AttackEvent, _ info.Target) ([]float64, bool) { if ae.Info.Element != attributes.Cryo { return nil, false diff --git a/internal/characters/eula/cons.go b/internal/characters/eula/cons.go index ede8443d72..bd717e85a0 100644 --- a/internal/characters/eula/cons.go +++ b/internal/characters/eula/cons.go @@ -5,7 +5,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func (c *char) c4() { @@ -13,7 +13,7 @@ func (c *char) c4() { m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = 0.25 c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("eula-c4", -1), + Base: gmod.NewBase("eula-c4", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.Abil != burstInitialAbil { return nil, false diff --git a/internal/characters/eula/skill.go b/internal/characters/eula/skill.go index 61ecad251c..897c5e5af2 100644 --- a/internal/characters/eula/skill.go +++ b/internal/characters/eula/skill.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var ( @@ -186,12 +186,12 @@ func (c *char) holdSkill() action.Info { return } e.AddResistMod(info.ResistMod{ - Base: modifier.NewBaseWithHitlag("eula-icewhirl-shred-cryo", 7*v*60), + Base: gmod.NewBaseWithHitlag("eula-icewhirl-shred-cryo", 7*v*60), Ele: attributes.Cryo, Value: -resRed[lvl], }) e.AddResistMod(info.ResistMod{ - Base: modifier.NewBaseWithHitlag("eula-icewhirl-shred-phys", 7*v*60), + Base: gmod.NewBaseWithHitlag("eula-icewhirl-shred-phys", 7*v*60), Ele: attributes.Physical, Value: -resRed[lvl], }) @@ -244,7 +244,7 @@ func (c *char) holdSkill() action.Info { if c.Base.Cons >= 1 && v > 0 { // TODO: check if the duration is right c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("eula-c1", (6*v+6)*60), + Base: gmod.NewBaseWithHitlag("eula-c1", (6*v+6)*60), AffectedStat: attributes.PhyP, Amount: func() ([]float64, bool) { return c.c1buff, true diff --git a/internal/characters/faruzan/burst.go b/internal/characters/faruzan/burst.go index 1feb9dd382..fc097b4bf6 100644 --- a/internal/characters/faruzan/burst.go +++ b/internal/characters/faruzan/burst.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var burstFrames []int @@ -130,7 +130,7 @@ func (c *char) applyBurstBuff(char *character.CharWrapper) { m := make([]float64, attributes.EndStatType) m[attributes.AnemoP] = burstBuff[c.TalentLvlBurst()] char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(burstBuffKey, 240), + Base: gmod.NewBaseWithHitlag(burstBuffKey, 240), AffectedStat: attributes.CR, Amount: func() ([]float64, bool) { return m, true @@ -151,7 +151,7 @@ func applyBurstShred(trg info.Target) { return } t.AddResistMod(info.ResistMod{ - Base: modifier.NewBaseWithHitlag(burstShredKey, 240), + Base: gmod.NewBaseWithHitlag(burstShredKey, 240), Ele: attributes.Anemo, Value: -0.3, }) diff --git a/internal/characters/faruzan/cons.go b/internal/characters/faruzan/cons.go index d01877eacd..9f72a1e961 100644 --- a/internal/characters/faruzan/cons.go +++ b/internal/characters/faruzan/cons.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // C4: The vortex created by Wind Realm of Nasamjnin will restore Energy to @@ -41,7 +41,7 @@ func (c *char) c6Buff(char *character.CharWrapper) { m := make([]float64, attributes.EndStatType) m[attributes.CD] = 0.4 char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag("faruzan-c6", 240), + Base: gmod.NewBaseWithHitlag("faruzan-c6", 240), Amount: func(atk *info.AttackEvent, _ info.Target) ([]float64, bool) { if atk.Info.Element != attributes.Anemo { return nil, false diff --git a/internal/characters/freminet/asc.go b/internal/characters/freminet/asc.go index 288ef6a56e..2107791487 100644 --- a/internal/characters/freminet/asc.go +++ b/internal/characters/freminet/asc.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -43,7 +43,7 @@ func (c *char) a4() { buff[attributes.DmgP] = 0.4 c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag(a4Key, 5*60), + Base: gmod.NewBaseWithHitlag(a4Key, 5*60), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if !strings.HasPrefix(atk.Info.Abil, pressureBaseName) { return nil, false diff --git a/internal/characters/freminet/cons.go b/internal/characters/freminet/cons.go index 2f0e249a1b..cfbc17a0d6 100644 --- a/internal/characters/freminet/cons.go +++ b/internal/characters/freminet/cons.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -29,7 +29,7 @@ func (c *char) c1() { buff[attributes.CR] = 0.15 c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase(c1Key, -1), + Base: gmod.NewBase(c1Key, -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if !strings.HasPrefix(atk.Info.Abil, pressureBaseName) { return nil, false @@ -87,7 +87,7 @@ func (c *char) c4c6() { } c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(c4Key, 6*60), + Base: gmod.NewBaseWithHitlag(c4Key, 6*60), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { c4M[attributes.ATKP] = float64(c.c4Stacks) * 0.09 @@ -114,7 +114,7 @@ func (c *char) c4c6() { } c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(c6Key, 6*60), + Base: gmod.NewBaseWithHitlag(c6Key, 6*60), AffectedStat: attributes.CD, Amount: func() ([]float64, bool) { c6M[attributes.CD] = float64(c.c6Stacks) * 0.12 diff --git a/internal/characters/furina/asc.go b/internal/characters/furina/asc.go index da0f91d372..bd7b713528 100644 --- a/internal/characters/furina/asc.go +++ b/internal/characters/furina/asc.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/event" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -75,7 +75,7 @@ func (c *char) a4() { } c.a4Buff = make([]float64, attributes.EndStatType) c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase(a4BuffKey, -1), + Base: gmod.NewBase(a4BuffKey, -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagElementalArt { return nil, false diff --git a/internal/characters/furina/burst.go b/internal/characters/furina/burst.go index de3f00a8e7..8f17092e5e 100644 --- a/internal/characters/furina/burst.go +++ b/internal/characters/furina/burst.go @@ -12,7 +12,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var burstFrames []int @@ -132,7 +132,7 @@ func (c *char) burstInit() { burstHealRatio := burstFanfareHBRatio[c.TalentLvlBurst()] for _, char := range c.Core.Player.Chars() { char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("furina-burst-damage-buff", -1), + Base: gmod.NewBase("furina-burst-damage-buff", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if !c.StatusIsActive(burstKey) { return nil, false @@ -143,7 +143,7 @@ func (c *char) burstInit() { }) char.AddHealBonusMod(character.HealBonusMod{ - Base: modifier.NewBase("furina-burst-heal-buff", -1), + Base: gmod.NewBase("furina-burst-heal-buff", -1), Amount: func() (float64, bool) { if c.StatusIsActive(burstKey) { return min(c.curFanfare, c.maxQFanfare) * burstHealRatio, false diff --git a/internal/characters/furina/cons.go b/internal/characters/furina/cons.go index 1f5d6f0390..2ebda30f45 100644 --- a/internal/characters/furina/cons.go +++ b/internal/characters/furina/cons.go @@ -4,7 +4,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/attributes" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const c2BuffKey = "furina-c2-hp" @@ -24,7 +24,7 @@ func (c *char) c2() { m := make([]float64, attributes.EndStatType) c.AddStatMod(character.StatMod{ - Base: modifier.NewBase(c2BuffKey, -1), + Base: gmod.NewBase(c2BuffKey, -1), AffectedStat: attributes.HPP, Amount: func() ([]float64, bool) { if !c.StatusIsActive(burstKey) { diff --git a/internal/characters/gaming/asc.go b/internal/characters/gaming/asc.go index 4577a0db01..8b06eb5598 100644 --- a/internal/characters/gaming/asc.go +++ b/internal/characters/gaming/asc.go @@ -4,7 +4,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/attributes" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const a1Key = "gaming-a1" @@ -53,7 +53,7 @@ func (c *char) a4() { mHeal := make([]float64, attributes.EndStatType) mHeal[attributes.Heal] = 0.2 c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("gaming-a4-heal-bonus", -1), + Base: gmod.NewBase("gaming-a4-heal-bonus", -1), AffectedStat: attributes.Heal, Amount: func() ([]float64, bool) { if c.CurrentHPRatio() >= 0.5 { @@ -66,7 +66,7 @@ func (c *char) a4() { mDmg := make([]float64, attributes.EndStatType) mDmg[attributes.DmgP] = 0.2 c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("gaming-a4-dmg-bonus", -1), + Base: gmod.NewBase("gaming-a4-dmg-bonus", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if c.CurrentHPRatio() < 0.5 { return nil, false diff --git a/internal/characters/gaming/cons.go b/internal/characters/gaming/cons.go index 4cb7dfca38..be987c3138 100644 --- a/internal/characters/gaming/cons.go +++ b/internal/characters/gaming/cons.go @@ -5,7 +5,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/event" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -53,7 +53,7 @@ func (c *char) c2() { } c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(c2Key, 5*60), + Base: gmod.NewBaseWithHitlag(c2Key, 5*60), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return m, true @@ -95,7 +95,7 @@ func (c *char) c6() { m[attributes.CR] = 0.2 m[attributes.CD] = 0.4 c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase(c6Key, -1), + Base: gmod.NewBase(c6Key, -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.Abil != specialPlungeKey { return nil, false diff --git a/internal/characters/ganyu/burst.go b/internal/characters/ganyu/burst.go index 4c431a5585..79c70d094d 100644 --- a/internal/characters/ganyu/burst.go +++ b/internal/characters/ganyu/burst.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var burstFrames []int @@ -73,7 +73,7 @@ func (c *char) Burst(p map[string]int) (action.Info, error) { if c.Base.Ascension >= 4 && c.Core.Combat.Player().IsWithinArea(burstArea) { active := c.Core.Player.ActiveChar() active.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("ganyu-field", 60), + Base: gmod.NewBaseWithHitlag("ganyu-field", 60), AffectedStat: attributes.CryoP, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/characters/ganyu/cons.go b/internal/characters/ganyu/cons.go index 810732a735..93d7bb0618 100644 --- a/internal/characters/ganyu/cons.go +++ b/internal/characters/ganyu/cons.go @@ -5,7 +5,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -29,7 +29,7 @@ func (c *char) c1() info.AttackCBFunc { return } e.AddResistMod(info.ResistMod{ - Base: modifier.NewBaseWithHitlag(c1Key, 300), + Base: gmod.NewBaseWithHitlag(c1Key, 300), Ele: attributes.Cryo, Value: -0.15, }) @@ -45,7 +45,7 @@ func (c *char) c4() { m := make([]float64, attributes.EndStatType) for _, char := range c.Core.Player.Chars() { char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase(c4Key, -1), + Base: gmod.NewBase(c4Key, -1), Amount: func(_ *info.AttackEvent, t info.Target) ([]float64, bool) { x, ok := t.(*enemy.Enemy) if !ok { diff --git a/internal/characters/gorou/asc.go b/internal/characters/gorou/asc.go index 26309e52c0..b355d59861 100644 --- a/internal/characters/gorou/asc.go +++ b/internal/characters/gorou/asc.go @@ -3,7 +3,7 @@ package gorou import ( "github.com/genshinsim/gcsim/pkg/core/attributes" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // After using Juuga: Forward Unto Victory, all nearby party members' DEF is increased by 25% for 12s. @@ -13,7 +13,7 @@ func (c *char) a1() { } for _, char := range c.Core.Player.Chars() { char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(a1Key, 720), + Base: gmod.NewBaseWithHitlag(a1Key, 720), AffectedStat: attributes.DEFP, Amount: func() ([]float64, bool) { return c.a1Buff, true diff --git a/internal/characters/gorou/cons.go b/internal/characters/gorou/cons.go index f15b5e0526..57a714ff31 100644 --- a/internal/characters/gorou/cons.go +++ b/internal/characters/gorou/cons.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/core/player/shield" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // C1: @@ -93,7 +93,7 @@ func (c *char) c2() { func (c *char) c6() { for _, char := range c.Core.Player.Chars() { char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag(c6key, 720), + Base: gmod.NewBaseWithHitlag(c6key, 720), Amount: func(ae *info.AttackEvent, _ info.Target) ([]float64, bool) { if ae.Info.Element != attributes.Geo { return nil, false diff --git a/internal/characters/gorou/skill.go b/internal/characters/gorou/skill.go index 8023f567b9..63b48442e4 100644 --- a/internal/characters/gorou/skill.go +++ b/internal/characters/gorou/skill.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/combat" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var skillFrames []int @@ -116,7 +116,7 @@ func (c *char) gorouSkillBuffField(src int) func() { // ok to overwrite existing mod active := c.Core.Player.ActiveChar() active.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(defenseBuffKey, 120), // looks like it lasts 2 seconds + Base: gmod.NewBaseWithHitlag(defenseBuffKey, 120), // looks like it lasts 2 seconds AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return c.gorouBuff, true diff --git a/internal/characters/heizou/asc.go b/internal/characters/heizou/asc.go index 9a447ceedd..7751ae0ea9 100644 --- a/internal/characters/heizou/asc.go +++ b/internal/characters/heizou/asc.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // When Shikanoin Heizou activates a Swirl reaction while on the field, @@ -61,7 +61,7 @@ func (c *char) a4() { continue // nothing for heizou } char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("heizou-a4", dur), + Base: gmod.NewBaseWithHitlag("heizou-a4", dur), AffectedStat: attributes.EM, Amount: func() ([]float64, bool) { return c.a4Buff, true diff --git a/internal/characters/heizou/cons.go b/internal/characters/heizou/cons.go index 6d7ddea718..b7b724172e 100644 --- a/internal/characters/heizou/cons.go +++ b/internal/characters/heizou/cons.go @@ -5,7 +5,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/event" "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // For 5s after Shikanoin Heizou takes the field, his Normal Attack SPD is increased by 15%. @@ -22,7 +22,7 @@ func (c *char) c1() { return false } c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("heizou-c1", 300), // 5s + Base: gmod.NewBaseWithHitlag("heizou-c1", 300), // 5s AffectedStat: attributes.AtkSpd, Amount: func() ([]float64, bool) { return c.c1buff, true diff --git a/internal/characters/hutao/asc.go b/internal/characters/hutao/asc.go index 188d49e0d8..6d7fc059c8 100644 --- a/internal/characters/hutao/asc.go +++ b/internal/characters/hutao/asc.go @@ -3,7 +3,7 @@ package hutao import ( "github.com/genshinsim/gcsim/pkg/core/attributes" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -24,7 +24,7 @@ func (c *char) a1() { continue } char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(a1BuffKey, 480), + Base: gmod.NewBaseWithHitlag(a1BuffKey, 480), AffectedStat: attributes.CR, Amount: func() ([]float64, bool) { return c.a1buff, true @@ -43,7 +43,7 @@ func (c *char) a4() { c.a4buff = make([]float64, attributes.EndStatType) c.a4buff[attributes.PyroP] = 0.33 c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("hutao-a4", -1), + Base: gmod.NewBase("hutao-a4", -1), AffectedStat: attributes.PyroP, Amount: func() ([]float64, bool) { if c.CurrentHPRatio() <= 0.5 { diff --git a/internal/characters/hutao/cons.go b/internal/characters/hutao/cons.go index 3dcfd785c8..8aec309428 100644 --- a/internal/characters/hutao/cons.go +++ b/internal/characters/hutao/cons.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -53,7 +53,7 @@ func (c *char) checkc6(check1HP bool) { // increase crit rate to 100% c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("hutao-c6", 600), + Base: gmod.NewBaseWithHitlag("hutao-c6", 600), AffectedStat: attributes.CR, Amount: func() ([]float64, bool) { return c.c6buff, true @@ -84,7 +84,7 @@ func (c *char) c4() { continue } char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("hutao-c4", 900), + Base: gmod.NewBaseWithHitlag("hutao-c4", 900), AffectedStat: attributes.CR, Amount: func() ([]float64, bool) { return c.c4buff, true diff --git a/internal/characters/hutao/skill.go b/internal/characters/hutao/skill.go index a938154215..822a5856ff 100644 --- a/internal/characters/hutao/skill.go +++ b/internal/characters/hutao/skill.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var skillFrames []int @@ -38,7 +38,7 @@ func (c *char) Skill(p map[string]int) (action.Info, error) { } c.ppbuff[attributes.ATK] = bonus c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(paramitaBuff, 540+skillStart), + Base: gmod.NewBaseWithHitlag(paramitaBuff, 540+skillStart), AffectedStat: attributes.ATK, Extra: true, Amount: func() ([]float64, bool) { diff --git a/internal/characters/itto/asc.go b/internal/characters/itto/asc.go index f4f42a7d2d..f30db2f04c 100644 --- a/internal/characters/itto/asc.go +++ b/internal/characters/itto/asc.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // When Arataki Itto uses consecutive Arataki Kesagiri, he obtains the following effects: @@ -22,7 +22,7 @@ func (c *char) a1() { } mAtkSpd := make([]float64, attributes.EndStatType) c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("itto-a1", -1), + Base: gmod.NewBase("itto-a1", -1), AffectedStat: attributes.AtkSpd, Amount: func() ([]float64, bool) { if c.a1Stacks == 0 || c.Core.Player.CurrentState() != action.ChargeAttackState { diff --git a/internal/characters/itto/burst.go b/internal/characters/itto/burst.go index 34ec52c8ba..4c367a4cb3 100644 --- a/internal/characters/itto/burst.go +++ b/internal/characters/itto/burst.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var burstFrames []int @@ -56,7 +56,7 @@ func (c *char) Burst(p map[string]int) (action.Info, error) { mATK := make([]float64, attributes.EndStatType) mATK[attributes.ATK] = mult * burstDefSnapshot c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(burstBuffKey, burstDuration), + Base: gmod.NewBaseWithHitlag(burstBuffKey, burstDuration), AffectedStat: attributes.ATK, Extra: true, Amount: func() ([]float64, bool) { @@ -68,7 +68,7 @@ func (c *char) Burst(p map[string]int) (action.Info, error) { mAtkSpd := make([]float64, attributes.EndStatType) mAtkSpd[attributes.AtkSpd] = 0.10 c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(burstAtkSpdKey, burstDuration), + Base: gmod.NewBaseWithHitlag(burstAtkSpdKey, burstDuration), AffectedStat: attributes.AtkSpd, Amount: func() ([]float64, bool) { if c.Core.Player.CurrentState() != action.NormalAttackState { diff --git a/internal/characters/itto/cons.go b/internal/characters/itto/cons.go index 773de3bbdd..9c0d0f1b62 100644 --- a/internal/characters/itto/cons.go +++ b/internal/characters/itto/cons.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/attributes" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // C1: @@ -47,7 +47,7 @@ func (c *char) c4() { m[attributes.DEFP] = 0.2 for _, x := range c.Core.Player.Chars() { x.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("itto-c4", 10*60), + Base: gmod.NewBaseWithHitlag("itto-c4", 10*60), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return m, true @@ -62,7 +62,7 @@ func (c *char) c6() { m := make([]float64, attributes.EndStatType) m[attributes.CD] = 0.7 c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("itto-c6", -1), + Base: gmod.NewBase("itto-c6", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagExtra { return nil, false diff --git a/internal/characters/jean/cons.go b/internal/characters/jean/cons.go index 8d58034c9b..94fd0df5e9 100644 --- a/internal/characters/jean/cons.go +++ b/internal/characters/jean/cons.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // C1: @@ -31,7 +31,7 @@ func (c *char) c2() { // apply C2 to all characters for _, this := range c.Core.Player.Chars() { this.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("jean-c2", 900), + Base: gmod.NewBaseWithHitlag("jean-c2", 900), AffectedStat: attributes.AtkSpd, Amount: func() ([]float64, bool) { return c.c2buff, true @@ -50,7 +50,7 @@ func (c *char) c4() { enemies := c.Core.Combat.EnemiesWithinArea(c.burstArea, nil) for _, e := range enemies { e.AddResistMod(info.ResistMod{ - Base: modifier.NewBaseWithHitlag("jean-c4", 72), // 1.2s + Base: gmod.NewBaseWithHitlag("jean-c4", 72), // 1.2s Ele: attributes.Anemo, Value: -0.4, }) diff --git a/internal/characters/kaeya/cons.go b/internal/characters/kaeya/cons.go index dcfeb42775..4e78067235 100644 --- a/internal/characters/kaeya/cons.go +++ b/internal/characters/kaeya/cons.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/core/player/shield" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // C1: @@ -17,7 +17,7 @@ import ( func (c *char) c1() { m := make([]float64, attributes.EndStatType) c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("kaeya-c1", -1), + Base: gmod.NewBase("kaeya-c1", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { e, ok := t.(*enemy.Enemy) if !ok { diff --git a/internal/characters/kaveh/asc.go b/internal/characters/kaveh/asc.go index 139c41f592..22aadd9d28 100644 --- a/internal/characters/kaveh/asc.go +++ b/internal/characters/kaveh/asc.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/event" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -49,7 +49,7 @@ func (c *char) a1() { func (c *char) a4() { m := make([]float64, attributes.EndStatType) c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(a4Key, burstDuration), + Base: gmod.NewBaseWithHitlag(a4Key, burstDuration), AffectedStat: attributes.EM, Amount: func() ([]float64, bool) { m[attributes.EM] = float64(25 * c.a4Stacks) diff --git a/internal/characters/kaveh/burst.go b/internal/characters/kaveh/burst.go index b8e76ee94d..5e3a06d458 100644 --- a/internal/characters/kaveh/burst.go +++ b/internal/characters/kaveh/burst.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/event" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var burstFrames []int @@ -58,7 +58,7 @@ func (c *char) Burst(p map[string]int) (action.Info, error) { } for _, char := range c.Core.Player.Chars() { char.AddReactBonusMod(character.ReactBonusMod{ - Base: modifier.NewBaseWithHitlag(burstDmgBonusKey, burstDuration), + Base: gmod.NewBaseWithHitlag(burstDmgBonusKey, burstDuration), Amount: func(ai info.AttackInfo) (float64, bool) { if ai.AttackTag == attacks.AttackTagBloom { return burstDmgBonus[c.TalentLvlBurst()], false diff --git a/internal/characters/kaveh/cons.go b/internal/characters/kaveh/cons.go index f40e996d70..c969f94cd0 100644 --- a/internal/characters/kaveh/cons.go +++ b/internal/characters/kaveh/cons.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -20,7 +20,7 @@ func (c *char) c1() { m := make([]float64, attributes.EndStatType) m[attributes.Heal] = 0.25 c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("kaveh-c1", 180), + Base: gmod.NewBaseWithHitlag("kaveh-c1", 180), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return m, true @@ -32,7 +32,7 @@ func (c *char) c2() { m := make([]float64, attributes.EndStatType) m[attributes.AtkSpd] = 0.15 c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(c2Key, burstDuration), + Base: gmod.NewBaseWithHitlag(c2Key, burstDuration), AffectedStat: attributes.AtkSpd, Amount: func() ([]float64, bool) { return m, true @@ -42,7 +42,7 @@ func (c *char) c2() { func (c *char) c4() { c.AddReactBonusMod(character.ReactBonusMod{ - Base: modifier.NewBase("kaveh-c4", -1), + Base: gmod.NewBase("kaveh-c4", -1), Amount: func(ai info.AttackInfo) (float64, bool) { if ai.AttackTag == attacks.AttackTagBloom { return 0.6, false diff --git a/internal/characters/kazuha/asc.go b/internal/characters/kazuha/asc.go index 7c0b39ffd8..fff2e50cc9 100644 --- a/internal/characters/kazuha/asc.go +++ b/internal/characters/kazuha/asc.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // If Chihayaburu comes into contact with Hydro/Pyro/Cryo/Electro when cast, this Chihayaburu will absorb that element and if Plunging Attack: Midare Ranzan is used before the effect expires, it will deal an additional 200% ATK of the absorbed elemental type as DMG. This will be considered Plunging Attack DMG. @@ -64,7 +64,7 @@ func (c *char) a4() { for _, char := range c.Core.Player.Chars() { char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("kazuha-a4-"+key, 60*8), + Base: gmod.NewBaseWithHitlag("kazuha-a4-"+key, 60*8), AffectedStat: ele, Extra: true, Amount: func() ([]float64, bool) { diff --git a/internal/characters/kazuha/cons.go b/internal/characters/kazuha/cons.go index 1a350230d2..0ffc512efd 100644 --- a/internal/characters/kazuha/cons.go +++ b/internal/characters/kazuha/cons.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // C2: @@ -43,7 +43,7 @@ func (c *char) c2(src int) func() { // apply C2 buff to active char for 1s active := c.Core.Player.ActiveChar() active.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("kazuha-c2", 60), // 1s + Base: gmod.NewBaseWithHitlag("kazuha-c2", 60), // 1s AffectedStat: attributes.EM, Amount: func() ([]float64, bool) { return c.c2buff, true @@ -53,7 +53,7 @@ func (c *char) c2(src int) func() { // apply C2 buff to Kazuha (even if off-field) for 1s if active.Base.Key != c.Base.Key { c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("kazuha-c2", 60), // 1s + Base: gmod.NewBaseWithHitlag("kazuha-c2", 60), // 1s AffectedStat: attributes.EM, Amount: func() ([]float64, bool) { return c.c2buff, true @@ -81,7 +81,7 @@ func (c *char) c6() { // add em based buff m := make([]float64, attributes.EndStatType) c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag("kazuha-c6-dmgup", 60*5), // 5s + Base: gmod.NewBaseWithHitlag("kazuha-c6-dmgup", 60*5), // 5s Amount: func(atk *info.AttackEvent, _ info.Target) ([]float64, bool) { // skip if not normal/charged/plunge if atk.Info.AttackTag != attacks.AttackTagNormal && diff --git a/internal/characters/keqing/asc.go b/internal/characters/keqing/asc.go index 34ceb789d2..5ef268fb09 100644 --- a/internal/characters/keqing/asc.go +++ b/internal/characters/keqing/asc.go @@ -4,7 +4,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/attacks" "github.com/genshinsim/gcsim/pkg/core/attributes" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // After recasting Stellar Restoration while a Lightning Stiletto is present, Keqing's weapon gains an Electro Infusion for 5s. @@ -34,7 +34,7 @@ func (c *char) a4() { return } c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("keqing-a4", 480), + Base: gmod.NewBaseWithHitlag("keqing-a4", 480), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return c.a4buff, true diff --git a/internal/characters/keqing/cons.go b/internal/characters/keqing/cons.go index 2e228d288b..52ac9ff0f0 100644 --- a/internal/characters/keqing/cons.go +++ b/internal/characters/keqing/cons.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const c2ICDKey = "keqing-c2-icd" @@ -49,7 +49,7 @@ func (c *char) c4() { return false } c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("keqing-c4", 600), + Base: gmod.NewBaseWithHitlag("keqing-c4", 600), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return c.c4buff, true @@ -77,7 +77,7 @@ func (c *char) c4() { func (c *char) c6(src string) { c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("keqing-c6-"+src, 480), + Base: gmod.NewBaseWithHitlag("keqing-c6-"+src, 480), AffectedStat: attributes.ElectroP, Amount: func() ([]float64, bool) { return c.c6buff, true diff --git a/internal/characters/kinich/cons.go b/internal/characters/kinich/cons.go index 1383121d0b..38995e48a8 100644 --- a/internal/characters/kinich/cons.go +++ b/internal/characters/kinich/cons.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -25,7 +25,7 @@ func (c *char) c1() { // his Movement SPD will increase by 30% for 6s." is not implemented m := make([]float64, attributes.EndStatType) c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("kinich-c1", -1), + Base: gmod.NewBase("kinich-c1", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { switch atk.Info.AttackTag { case attacks.AttackTagElementalArt, attacks.AttackTagElementalArtHold: @@ -55,7 +55,7 @@ func (c *char) c2ResShredCB(a info.AttackCB) { return } e.AddResistMod(info.ResistMod{ - Base: modifier.NewBaseWithHitlag("kinich-c2", 6*60), + Base: gmod.NewBaseWithHitlag("kinich-c2", 6*60), Ele: attributes.Dendro, Value: -0.3, }) @@ -73,7 +73,7 @@ func (c *char) c4() { m := make([]float64, attributes.EndStatType) c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("kinich-c4-dmgp", -1), + Base: gmod.NewBase("kinich-c4-dmgp", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagElementalBurst { return nil, false diff --git a/internal/characters/kirara/asc.go b/internal/characters/kirara/asc.go index ab0f541389..895b7398ad 100644 --- a/internal/characters/kirara/asc.go +++ b/internal/characters/kirara/asc.go @@ -5,7 +5,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/attributes" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -40,7 +40,7 @@ func (c *char) a1() { func (c *char) a4() { mSkill := make([]float64, attributes.EndStatType) c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("kirara-a4-skill", -1), + Base: gmod.NewBase("kirara-a4-skill", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagElementalArt && atk.Info.AttackTag != attacks.AttackTagElementalArtHold { return nil, false @@ -52,7 +52,7 @@ func (c *char) a4() { mBurst := make([]float64, attributes.EndStatType) c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("kirara-a4-burst", -1), + Base: gmod.NewBase("kirara-a4-burst", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagElementalBurst { return nil, false diff --git a/internal/characters/kirara/cons.go b/internal/characters/kirara/cons.go index c6e398f33f..38c1df8e09 100644 --- a/internal/characters/kirara/cons.go +++ b/internal/characters/kirara/cons.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/core/player/shield" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -68,7 +68,7 @@ func (c *char) c4() { func (c *char) c6() { for _, char := range c.Core.Player.Chars() { char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(c6Status, 15*60), + Base: gmod.NewBaseWithHitlag(c6Status, 15*60), Amount: func() ([]float64, bool) { return c.c6Buff, true }, diff --git a/internal/characters/klee/burst.go b/internal/characters/klee/burst.go index c81effeff7..630f72a4b5 100644 --- a/internal/characters/klee/burst.go +++ b/internal/characters/klee/burst.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/event" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var ( @@ -99,7 +99,7 @@ func (c *char) Burst(p map[string]int) (action.Info, error) { m[attributes.PyroP] = .1 for _, x := range c.Core.Player.Chars() { x.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("klee-c6", 1500), + Base: gmod.NewBaseWithHitlag("klee-c6", 1500), AffectedStat: attributes.PyroP, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/characters/klee/cons.go b/internal/characters/klee/cons.go index 6f92e7ba68..7cce63a79d 100644 --- a/internal/characters/klee/cons.go +++ b/internal/characters/klee/cons.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/combat" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func (c *char) c1(delay int) { @@ -47,7 +47,7 @@ func (c *char) c2(a info.AttackCB) { return } e.AddDefMod(info.DefMod{ - Base: modifier.NewBaseWithHitlag("kleec2", 10*60), + Base: gmod.NewBaseWithHitlag("kleec2", 10*60), Value: -0.233, }) } diff --git a/internal/characters/kokomi/asc.go b/internal/characters/kokomi/asc.go index ce4dd1e7b7..3dd7db397b 100644 --- a/internal/characters/kokomi/asc.go +++ b/internal/characters/kokomi/asc.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/event" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // Passive 2 - permanently modify stats for +25% healing bonus and -100% CR @@ -15,7 +15,7 @@ func (c *char) passive() { m[attributes.Heal] = .25 m[attributes.CR] = -1 c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("kokomi-passive", -1), + Base: gmod.NewBase("kokomi-passive", -1), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/characters/kokomi/burst.go b/internal/characters/kokomi/burst.go index 9528a94bb6..75015d0162 100644 --- a/internal/characters/kokomi/burst.go +++ b/internal/characters/kokomi/burst.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var burstFrames []int @@ -68,7 +68,7 @@ func (c *char) Burst(p map[string]int) (action.Info, error) { m := make([]float64, attributes.EndStatType) m[attributes.AtkSpd] = 0.1 c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("kokomi-c4", 10*60), + Base: gmod.NewBase("kokomi-c4", 10*60), AffectedStat: attributes.AtkSpd, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/characters/kokomi/cons.go b/internal/characters/kokomi/cons.go index 356df36e4a..7866c5abc3 100644 --- a/internal/characters/kokomi/cons.go +++ b/internal/characters/kokomi/cons.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/combat" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func (c *char) c1(f, travel int) { @@ -75,7 +75,7 @@ func (c *char) c6() { continue } c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("kokomi-c6", 480), + Base: gmod.NewBase("kokomi-c6", 480), AffectedStat: attributes.HydroP, Extra: true, Amount: func() ([]float64, bool) { diff --git a/internal/characters/kuki/asc.go b/internal/characters/kuki/asc.go index cfcd78a76c..2b3b7665b6 100644 --- a/internal/characters/kuki/asc.go +++ b/internal/characters/kuki/asc.go @@ -3,7 +3,7 @@ package kuki import ( "github.com/genshinsim/gcsim/pkg/core/attributes" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // When Shinobu's HP is not higher than 50%, her Healing Bonus is increased by 15%. @@ -14,7 +14,7 @@ func (c *char) a1() { m := make([]float64, attributes.EndStatType) m[attributes.Heal] = .15 c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("kuki-a1", -1), + Base: gmod.NewBase("kuki-a1", -1), AffectedStat: attributes.Heal, Amount: func() ([]float64, bool) { if c.CurrentHPRatio() <= 0.5 { diff --git a/internal/characters/kuki/cons.go b/internal/characters/kuki/cons.go index 4ad8ac04b9..5f5d3d12da 100644 --- a/internal/characters/kuki/cons.go +++ b/internal/characters/kuki/cons.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/event" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // C4: @@ -86,7 +86,7 @@ func (c *char) c6() { // increase EM by 150 for 15s c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("kuki-c6", 900), + Base: gmod.NewBaseWithHitlag("kuki-c6", 900), AffectedStat: attributes.EM, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/characters/lanyan/cons.go b/internal/characters/lanyan/cons.go index b65d86ab5b..0fb4089678 100644 --- a/internal/characters/lanyan/cons.go +++ b/internal/characters/lanyan/cons.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/event" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const c2Icd = "lanyan-c2-icd" @@ -50,7 +50,7 @@ func (c *char) c4() { m[attributes.EM] = 60 for _, char := range c.Core.Player.Chars() { char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("lanyan-c4", 12*60), + Base: gmod.NewBaseWithHitlag("lanyan-c4", 12*60), Amount: func() ([]float64, bool) { return m, true }, diff --git a/internal/characters/layla/cons.go b/internal/characters/layla/cons.go index 39ac119728..98bfa27158 100644 --- a/internal/characters/layla/cons.go +++ b/internal/characters/layla/cons.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const c4Key = "layla-c4" @@ -46,7 +46,7 @@ func (c *char) c6() { m[attributes.DmgP] = 0.4 c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("layla-c6", -1), + Base: gmod.NewBase("layla-c6", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagElementalBurst && atk.Info.Abil != shootingStarsAbil { return nil, false diff --git a/internal/characters/lisa/asc.go b/internal/characters/lisa/asc.go index bd88a88a58..9b40aa4180 100644 --- a/internal/characters/lisa/asc.go +++ b/internal/characters/lisa/asc.go @@ -3,7 +3,7 @@ package lisa import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // Hits by Charged Attacks apply Violet Arc's Conductive status to opponents. @@ -34,7 +34,7 @@ func (c *char) makeA4CB() info.AttackCBFunc { return } t.AddDefMod(info.DefMod{ - Base: modifier.NewBaseWithHitlag("lisa-a4", 600), + Base: gmod.NewBaseWithHitlag("lisa-a4", 600), Value: -0.15, }) } diff --git a/internal/characters/lisa/skill.go b/internal/characters/lisa/skill.go index 143b44985d..c76d238b75 100644 --- a/internal/characters/lisa/skill.go +++ b/internal/characters/lisa/skill.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var ( @@ -132,7 +132,7 @@ func (c *char) skillHold() action.Info { m := make([]float64, attributes.EndStatType) m[attributes.DEFP] = 0.25 c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("lisa-c2", 126), + Base: gmod.NewBase("lisa-c2", 126), AffectedStat: attributes.DEFP, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/characters/lynette/asc.go b/internal/characters/lynette/asc.go index b801fc4774..0575751990 100644 --- a/internal/characters/lynette/asc.go +++ b/internal/characters/lynette/asc.go @@ -5,7 +5,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/attributes" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func (c *char) a1Setup() { @@ -34,7 +34,7 @@ func (c *char) a1() { } for _, this := range c.Core.Player.Chars() { this.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("lynette-a1", 10*60), + Base: gmod.NewBaseWithHitlag("lynette-a1", 10*60), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return c.a1Buff, true @@ -53,7 +53,7 @@ func (c *char) a4(duration int) { m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = 0.15 c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("lynette-a4", duration), + Base: gmod.NewBase("lynette-a4", duration), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagElementalBurst { return nil, false diff --git a/internal/characters/lynette/cons.go b/internal/characters/lynette/cons.go index ca521350ca..b8e8023ab2 100644 --- a/internal/characters/lynette/cons.go +++ b/internal/characters/lynette/cons.go @@ -5,7 +5,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/attacks" "github.com/genshinsim/gcsim/pkg/core/attributes" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // TODO: C1 is not implemented, because vortex/pulling mechanics are not implemented @@ -47,7 +47,7 @@ func (c *char) c6() { m := make([]float64, attributes.EndStatType) m[attributes.AnemoP] = 0.2 c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("lynette-c6-buff", duration), + Base: gmod.NewBaseWithHitlag("lynette-c6-buff", duration), Amount: func() ([]float64, bool) { return m, true }, diff --git a/internal/characters/lyney/asc.go b/internal/characters/lyney/asc.go index 086ada9e70..94bc316516 100644 --- a/internal/characters/lyney/asc.go +++ b/internal/characters/lyney/asc.go @@ -5,7 +5,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/attributes" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // If Lyney consumes HP when firing off a Prop Arrow, @@ -61,7 +61,7 @@ func (c *char) a4() { m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = a4Dmg c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("lyney-a4", -1), + Base: gmod.NewBase("lyney-a4", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { r, ok := t.(core.Reactable) if !ok { diff --git a/internal/characters/lyney/cons.go b/internal/characters/lyney/cons.go index 51f63d1a5c..49a5f59633 100644 --- a/internal/characters/lyney/cons.go +++ b/internal/characters/lyney/cons.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -80,7 +80,7 @@ func (c *char) c2Setup() { // add buff m := make([]float64, attributes.EndStatType) c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("lyney-c2", -1), + Base: gmod.NewBase("lyney-c2", -1), AffectedStat: attributes.CD, Amount: func() ([]float64, bool) { m[attributes.CD] = float64(c.c2Stacks) * 0.2 @@ -124,7 +124,7 @@ func (c *char) makeC4CB() info.AttackCBFunc { return } e.AddResistMod(info.ResistMod{ - Base: modifier.NewBaseWithHitlag("lyney-c4", 6*60), + Base: gmod.NewBaseWithHitlag("lyney-c4", 6*60), Ele: attributes.Pyro, Value: -0.20, }) diff --git a/internal/characters/mavuika/asc.go b/internal/characters/mavuika/asc.go index ca3d5dc1f8..ef989e1ede 100644 --- a/internal/characters/mavuika/asc.go +++ b/internal/characters/mavuika/asc.go @@ -5,7 +5,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/event" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -23,7 +23,7 @@ func (c *char) a1() { m[attributes.ATKP] = 0.3 c.Core.Events.Subscribe(event.OnNightsoulBurst, func(args ...any) bool { c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(a1Key, 10*60), + Base: gmod.NewBaseWithHitlag(a1Key, 10*60), Amount: func() ([]float64, bool) { return m, true }, @@ -39,7 +39,7 @@ func (c *char) a4Init() { c.a4buff = make([]float64, attributes.EndStatType) for _, char := range c.Core.Player.Chars() { char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase(a4BufKey, -1), + Base: gmod.NewBase(a4BufKey, -1), Amount: func(_ *info.AttackEvent, _ info.Target) ([]float64, bool) { // char must be active if c.Core.Player.Active() != char.Index() { diff --git a/internal/characters/mavuika/cons.go b/internal/characters/mavuika/cons.go index b64709f960..62abaf3241 100644 --- a/internal/characters/mavuika/cons.go +++ b/internal/characters/mavuika/cons.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/combat" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -36,7 +36,7 @@ func (c *char) c1OnFightingSpirit() { return } c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(c1Key, 10*60), + Base: gmod.NewBaseWithHitlag(c1Key, 10*60), Amount: func() ([]float64, bool) { return c.c1buff, true }, @@ -50,7 +50,7 @@ func (c *char) c2Init() { m := make([]float64, attributes.EndStatType) m[attributes.BaseATK] = 200 c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("mavuika-c2-base-atk", -1), + Base: gmod.NewBase("mavuika-c2-base-atk", -1), Amount: func() ([]float64, bool) { if c.nightsoulState.HasBlessing() { return m, true @@ -74,7 +74,7 @@ func (c *char) c2Ring() { ) for _, e := range c.Core.Combat.EnemiesWithinArea(ap, nil) { e.AddDefMod(info.DefMod{ - Base: modifier.NewBaseWithHitlag("mavuika-c2", 30), + Base: gmod.NewBaseWithHitlag("mavuika-c2", 30), Value: -0.2, }) } diff --git a/internal/characters/mika/asc.go b/internal/characters/mika/asc.go index c03c9077e8..d0df907427 100644 --- a/internal/characters/mika/asc.go +++ b/internal/characters/mika/asc.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -36,7 +36,7 @@ func (c *char) addDetectorStack() { func (c *char) a1(char *character.CharWrapper) { m := make([]float64, attributes.EndStatType) char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(a1Buff, skillBuffDuration), + Base: gmod.NewBaseWithHitlag(a1Buff, skillBuffDuration), AffectedStat: attributes.PhyP, Amount: func() ([]float64, bool) { m[attributes.PhyP] = 0.1 * float64(c.Tag(a1Stacks)) diff --git a/internal/characters/mika/cons.go b/internal/characters/mika/cons.go index f2ec0357cb..2c1c3ed112 100644 --- a/internal/characters/mika/cons.go +++ b/internal/characters/mika/cons.go @@ -4,7 +4,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/attributes" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // When Starfrost Swirl's Flowfrost Arrow first hits an opponent, or its Rimestar Flare hits an opponent, @@ -31,7 +31,7 @@ func (c *char) c2() func(info.AttackCB) { // Additionally, active characters affected by Soulwind will deal 60% more Physical CRIT DMG. func (c *char) c6(char *character.CharWrapper) { char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag("mika-c6", skillBuffDuration), + Base: gmod.NewBaseWithHitlag("mika-c6", skillBuffDuration), Amount: func(atk *info.AttackEvent, _ info.Target) ([]float64, bool) { if c.Core.Player.Active() != char.Index() { return nil, false diff --git a/internal/characters/mika/skill.go b/internal/characters/mika/skill.go index 28f7b21cf5..df600fcb55 100644 --- a/internal/characters/mika/skill.go +++ b/internal/characters/mika/skill.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/combat" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var ( @@ -220,7 +220,7 @@ func (c *char) applyBuffs() { func (c *char) skillBuff() { for _, char := range c.Core.Player.Chars() { char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(skillBuffKey, skillBuffDuration), + Base: gmod.NewBaseWithHitlag(skillBuffKey, skillBuffDuration), AffectedStat: attributes.AtkSpd, Amount: func() ([]float64, bool) { return c.skillbuff, true diff --git a/internal/characters/mizuki/asc.go b/internal/characters/mizuki/asc.go index 0bfd62fa62..51bb106a97 100644 --- a/internal/characters/mizuki/asc.go +++ b/internal/characters/mizuki/asc.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -116,7 +116,7 @@ func (c *char) a4() { } c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(a4Key, a4Duration), // 4s + Base: gmod.NewBaseWithHitlag(a4Key, a4Duration), // 4s AffectedStat: attributes.EM, Amount: func() ([]float64, bool) { return c.a4Buff, true diff --git a/internal/characters/mizuki/cons.go b/internal/characters/mizuki/cons.go index 187dc18cc9..344f190b47 100644 --- a/internal/characters/mizuki/cons.go +++ b/internal/characters/mizuki/cons.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -119,7 +119,7 @@ func (c *char) c2() { } // TODO: Test whether this is indeed a static buff once we have C2 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase(c2Key, -1), + Base: gmod.NewBase(c2Key, -1), Amount: func() ([]float64, bool) { if !c.StatusIsActive(dreamDrifterStateKey) { return nil, false diff --git a/internal/characters/mizuki/skill.go b/internal/characters/mizuki/skill.go index f47417910d..702303fea7 100644 --- a/internal/characters/mizuki/skill.go +++ b/internal/characters/mizuki/skill.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var skillFrames []int @@ -135,7 +135,7 @@ func (c *char) applyDreamDrifterEffect(travel int) { func (c *char) skillInit() { for _, char := range c.Core.Player.Chars() { char.AddReactBonusMod(character.ReactBonusMod{ - Base: modifier.NewBase(dreamDrifterSwirlBuffKey, -1), + Base: gmod.NewBase(dreamDrifterSwirlBuffKey, -1), Amount: func(ai info.AttackInfo) (float64, bool) { if !c.StatusIsActive(dreamDrifterStateKey) { return 0, false diff --git a/internal/characters/mona/asc.go b/internal/characters/mona/asc.go index 865323a2b4..00c21df148 100644 --- a/internal/characters/mona/asc.go +++ b/internal/characters/mona/asc.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // After she has used Illusory Torrent for 2s, if there are any opponents nearby, @@ -60,7 +60,7 @@ func (c *char) a4() { if c.a4Stats == nil { c.a4Stats = make([]float64, attributes.EndStatType) c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("mona-a4", -1), + Base: gmod.NewBase("mona-a4", -1), AffectedStat: attributes.HydroP, Extra: true, Amount: func() ([]float64, bool) { diff --git a/internal/characters/mona/burst.go b/internal/characters/mona/burst.go index 08b5831f86..b7ccf53e17 100644 --- a/internal/characters/mona/burst.go +++ b/internal/characters/mona/burst.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var burstFrames []int @@ -87,7 +87,7 @@ func (c *char) burstDamageBonus() { m[attributes.DmgP] = dmgBonus[c.TalentLvlBurst()] for _, char := range c.Core.Player.Chars() { char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("mona-omen", -1), + Base: gmod.NewBase("mona-omen", -1), Amount: func(_ *info.AttackEvent, t info.Target) ([]float64, bool) { x, ok := t.(*enemy.Enemy) if !ok { diff --git a/internal/characters/mona/cons.go b/internal/characters/mona/cons.go index 5c17ae6b15..20fff88a66 100644 --- a/internal/characters/mona/cons.go +++ b/internal/characters/mona/cons.go @@ -12,7 +12,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const c6Key = "mona-c6" @@ -42,7 +42,7 @@ func (c *char) c1() { // TODO: "Vaporize DMG increases by 15%." should be getting snapshot, see https://library.keqingmains.com/evidence/characters/hydro/mona#mona-c1-snapshot-for-vape // requires ReactBonusMod refactor char.AddReactBonusMod(character.ReactBonusMod{ - Base: modifier.NewBase("mona-c1", 8*60), + Base: gmod.NewBase("mona-c1", 8*60), Amount: func(ai info.AttackInfo) (float64, bool) { // doesn't work off-field if c.Core.Player.Active() != char.Index() { @@ -111,7 +111,7 @@ func (c *char) c4() { for _, char := range c.Core.Player.Chars() { char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("mona-c4", -1), + Base: gmod.NewBase("mona-c4", -1), Amount: func(_ *info.AttackEvent, t info.Target) ([]float64, bool) { x, ok := t.(*enemy.Enemy) if !ok { @@ -157,7 +157,7 @@ func (c *char) c6(src int) func() { m := make([]float64, attributes.EndStatType) c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase(c6Key, 8*60), + Base: gmod.NewBase(c6Key, 8*60), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagExtra { return nil, false diff --git a/internal/characters/mualani/cons.go b/internal/characters/mualani/cons.go index 606c878ce1..eddf3f4b58 100644 --- a/internal/characters/mualani/cons.go +++ b/internal/characters/mualani/cons.go @@ -5,7 +5,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/attributes" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const c4key = "mualani-c4" @@ -54,7 +54,7 @@ func (c *char) c4() { m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = 0.75 c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag(c4key, -1), + Base: gmod.NewBaseWithHitlag(c4key, -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag == attacks.AttackTagElementalBurst { return m, true diff --git a/internal/characters/nahida/asc.go b/internal/characters/nahida/asc.go index a7436617e0..d3eb1443b1 100644 --- a/internal/characters/nahida/asc.go +++ b/internal/characters/nahida/asc.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/attributes" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -46,7 +46,7 @@ func (c *char) applyA1(dur int) { for i, char := range c.Core.Player.Chars() { idx := i char.AddStatMod(character.StatMod{ - Base: modifier.NewBase(a1BuffKey, dur), + Base: gmod.NewBase(a1BuffKey, dur), AffectedStat: attributes.EM, Extra: true, Amount: func() ([]float64, bool) { @@ -63,7 +63,7 @@ func (c *char) a4() { return } c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase(a4BuffKey, -1), + Base: gmod.NewBase(a4BuffKey, -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagElementalArt { return nil, false diff --git a/internal/characters/nahida/burst.go b/internal/characters/nahida/burst.go index da815fe04b..e9a690d5d4 100644 --- a/internal/characters/nahida/burst.go +++ b/internal/characters/nahida/burst.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/combat" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var burstFrames []int @@ -50,7 +50,7 @@ func (c *char) Burst(p map[string]int) (action.Info, error) { c.AddStatus(withinBurstKey, withinTimer, true) if c.pyroCount > 0 { c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag(burstKey, 60), + Base: gmod.NewBaseWithHitlag(burstKey, 60), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { return c.pyroBurstBuff, atk.Info.Abil == triKarmaAbil }, diff --git a/internal/characters/nahida/cons.go b/internal/characters/nahida/cons.go index 2c532cb290..990909922d 100644 --- a/internal/characters/nahida/cons.go +++ b/internal/characters/nahida/cons.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // When the Shrine of Maya is unleashed and the Elemental Types of the party @@ -66,7 +66,7 @@ func (c *char) c2() { return false } t.AddDefMod(info.DefMod{ - Base: modifier.NewBaseWithHitlag("nahida-c2", 480), + Base: gmod.NewBaseWithHitlag("nahida-c2", 480), Value: -0.3, }) return false @@ -83,7 +83,7 @@ func (c *char) c2() { // 100/120/140/160. func (c *char) c4() { c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("nahida-c4", -1), + Base: gmod.NewBase("nahida-c4", -1), AffectedStat: attributes.EM, Amount: func() ([]float64, bool) { enemies := c.Core.Combat.EnemiesWithinArea( diff --git a/internal/characters/navia/asc.go b/internal/characters/navia/asc.go index a83ac4285e..d648d8b376 100644 --- a/internal/characters/navia/asc.go +++ b/internal/characters/navia/asc.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -26,7 +26,7 @@ func (c *char) a1() { // add Damage Bonus m := make([]float64, attributes.EndStatType) c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag(a1Key, 60*4), // 4s + Base: gmod.NewBaseWithHitlag(a1Key, 60*4), // 4s Amount: func(atk *info.AttackEvent, _ info.Target) ([]float64, bool) { // skip if not normal/charged/plunge if atk.Info.AttackTag != attacks.AttackTagNormal && @@ -62,7 +62,7 @@ func (c *char) a4() { m := make([]float64, attributes.EndStatType) m[attributes.ATKP] = 0.2 * float64(ele) c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("navia-a4", -1), + Base: gmod.NewBase("navia-a4", -1), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/characters/navia/cons.go b/internal/characters/navia/cons.go index e0db44d9ad..c1da7f3cd8 100644 --- a/internal/characters/navia/cons.go +++ b/internal/characters/navia/cons.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/combat" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const c2IcdKey = "navia-c2-icd" @@ -79,7 +79,7 @@ func (c *char) c4() info.AttackCBFunc { return } e.AddResistMod(info.ResistMod{ - Base: modifier.NewBaseWithHitlag("navia-c4-shred", 8*60), + Base: gmod.NewBaseWithHitlag("navia-c4-shred", 8*60), Ele: attributes.Geo, Value: -0.2, }) diff --git a/internal/characters/neuvillette/asc.go b/internal/characters/neuvillette/asc.go index 3e0195ed66..1a31e9448a 100644 --- a/internal/characters/neuvillette/asc.go +++ b/internal/characters/neuvillette/asc.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) type NeuvA1Keys struct { @@ -61,7 +61,7 @@ func (c *char) countA1() int { func (c *char) a4() { c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("neuvillette-a4", -1), + Base: gmod.NewBase("neuvillette-a4", -1), AffectedStat: attributes.HydroP, Extra: true, Amount: func() ([]float64, bool) { diff --git a/internal/characters/neuvillette/cons.go b/internal/characters/neuvillette/cons.go index 7deb9d3501..f90144a6a1 100644 --- a/internal/characters/neuvillette/cons.go +++ b/internal/characters/neuvillette/cons.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -32,7 +32,7 @@ func (c *char) c2() { } c2Buff := make([]float64, attributes.EndStatType) c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("neuvillette-c2", -1), + Base: gmod.NewBase("neuvillette-c2", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if strings.Contains(atk.Info.Abil, chargeJudgementName) { c2Buff[attributes.CD] = 0.14 * float64(c.countA1()) diff --git a/internal/characters/nilou/asc.go b/internal/characters/nilou/asc.go index 0b06fbedb3..8f00c21bcd 100644 --- a/internal/characters/nilou/asc.go +++ b/internal/characters/nilou/asc.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -72,7 +72,7 @@ func (c *char) a1() { m[attributes.EM] = 100 for _, this := range c.Core.Player.Chars() { this.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("nilou-a1-em", 10*60), + Base: gmod.NewBaseWithHitlag("nilou-a1-em", 10*60), AffectedStat: attributes.EM, Amount: func() ([]float64, bool) { return m, true @@ -94,7 +94,7 @@ func (c *char) a4() { for _, this := range c.Core.Player.Chars() { // TODO: a4 should be an extra buff this.AddReactBonusMod(character.ReactBonusMod{ - Base: modifier.NewBaseWithHitlag(a4Mod, 30*60), + Base: gmod.NewBaseWithHitlag(a4Mod, 30*60), Amount: func(ai info.AttackInfo) (float64, bool) { if ai.AttackTag != attacks.AttackTagBloom { return 0, false diff --git a/internal/characters/nilou/cons.go b/internal/characters/nilou/cons.go index 998d897ac9..f523c3f080 100644 --- a/internal/characters/nilou/cons.go +++ b/internal/characters/nilou/cons.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // Dance of Haftkarsvar will be enhanced as follows: @@ -18,7 +18,7 @@ func (c *char) c1() { m[attributes.DmgP] = 0.65 c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("nilou-c1", -1), + Base: gmod.NewBase("nilou-c1", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.Abil != skillIllusionAbil { return nil, false @@ -50,13 +50,13 @@ func (c *char) c2() { if atk.Info.Element == attributes.Hydro { t.AddResistMod(info.ResistMod{ - Base: modifier.NewBaseWithHitlag("nilou-c2-hydro", 10*60), + Base: gmod.NewBaseWithHitlag("nilou-c2-hydro", 10*60), Ele: attributes.Hydro, Value: -0.35, }) } else if atk.Info.AttackTag == attacks.AttackTagBloom { t.AddResistMod(info.ResistMod{ - Base: modifier.NewBaseWithHitlag("nilou-c2-dendro", 10*60), + Base: gmod.NewBaseWithHitlag("nilou-c2-dendro", 10*60), Ele: attributes.Dendro, Value: -0.35, }) @@ -74,7 +74,7 @@ func (c *char) c4() { m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = 0.5 c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag("nilou-c4", 8*60), + Base: gmod.NewBaseWithHitlag("nilou-c4", 8*60), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagElementalBurst { return nil, false @@ -111,7 +111,7 @@ func (c *char) c6() { // cr and cd separately to avoid stack overflow due to NoStat attribute mCR := make([]float64, attributes.EndStatType) c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("nilou-c6-cr", -1), + Base: gmod.NewBase("nilou-c6-cr", -1), AffectedStat: attributes.CR, Extra: true, Amount: func() ([]float64, bool) { @@ -126,7 +126,7 @@ func (c *char) c6() { mCD := make([]float64, attributes.EndStatType) c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("nilou-c6-cd", -1), + Base: gmod.NewBase("nilou-c6-cd", -1), AffectedStat: attributes.CD, Extra: true, Amount: func() ([]float64, bool) { diff --git a/internal/characters/ningguang/asc.go b/internal/characters/ningguang/asc.go index a4a85bd9d1..d2545a6f06 100644 --- a/internal/characters/ningguang/asc.go +++ b/internal/characters/ningguang/asc.go @@ -5,7 +5,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/construct" "github.com/genshinsim/gcsim/pkg/core/event" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // A1 is implemented in ningguang.go: @@ -28,7 +28,7 @@ func (c *char) a4() { } active := c.Core.Player.ActiveChar() active.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("ning-screen", 600), + Base: gmod.NewBaseWithHitlag("ning-screen", 600), AffectedStat: attributes.GeoP, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/characters/noelle/burst.go b/internal/characters/noelle/burst.go index ae4ddfdbca..3de5aa88fe 100644 --- a/internal/characters/noelle/burst.go +++ b/internal/characters/noelle/burst.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var burstFrames []int @@ -72,7 +72,7 @@ func (c *char) Burst(p map[string]int) (action.Info, error) { } // TODO: Confirm exact timing of buff - for now matched to status duration previously set, which is 900 + animation frames c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("noelle-burst", dur), + Base: gmod.NewBaseWithHitlag("noelle-burst", dur), AffectedStat: attributes.ATK, Extra: true, Amount: func() ([]float64, bool) { diff --git a/internal/characters/noelle/cons.go b/internal/characters/noelle/cons.go index 5a74e99ccf..da3a007bfa 100644 --- a/internal/characters/noelle/cons.go +++ b/internal/characters/noelle/cons.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/attributes" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func (c *char) c2() { @@ -17,7 +17,7 @@ func (c *char) c2() { m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = .15 c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("noelle-c2-dmg", -1), + Base: gmod.NewBase("noelle-c2-dmg", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { return m, atk.Info.AttackTag == attacks.AttackTagExtra }, diff --git a/internal/characters/ororon/cons.go b/internal/characters/ororon/cons.go index 1874e8d7ab..ec37a6c7ca 100644 --- a/internal/characters/ororon/cons.go +++ b/internal/characters/ororon/cons.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/core/stacks" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -25,7 +25,7 @@ func (c *char) c1Init() { m[attributes.DmgP] = 0.5 c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase(c1Key, -1), + Base: gmod.NewBase(c1Key, -1), Amount: func(ae *info.AttackEvent, t info.Target) ([]float64, bool) { trg, ok := t.(*enemy.Enemy) if !ok { @@ -81,7 +81,7 @@ func (c *char) c2OnBurst() { } c.SetTag(c2Key, 1) c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(c2Key, 9*60), + Base: gmod.NewBaseWithHitlag(c2Key, 9*60), AffectedStat: attributes.ElectroP, Amount: func() ([]float64, bool) { c.c2Bonus[attributes.ElectroP] = min(0.08*float64(c.Tag(c2Key)), 0.32) @@ -147,7 +147,7 @@ func (c *char) c6onHypersense() { // TODO: Is this buff hitlag affected per character? Or is it hitlag affected on Ororon only? for _, char := range c.Core.Player.Chars() { char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(c6Key, 9*60), + Base: gmod.NewBaseWithHitlag(c6Key, 9*60), Amount: func() ([]float64, bool) { if c.Core.Player.Active() != char.Index() { return nil, false diff --git a/internal/characters/qiqi/asc.go b/internal/characters/qiqi/asc.go index 003a244416..61144fb603 100644 --- a/internal/characters/qiqi/asc.go +++ b/internal/characters/qiqi/asc.go @@ -4,7 +4,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/event" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // When a character under the effects of Adeptus Art: Herald of Frost triggers an Elemental Reaction, @@ -29,7 +29,7 @@ func (c *char) a1() { } active.AddHealBonusMod(character.HealBonusMod{ - Base: modifier.NewBaseWithHitlag("qiqi-a1", 8*60), + Base: gmod.NewBaseWithHitlag("qiqi-a1", 8*60), Amount: func() (float64, bool) { return .2, false }, diff --git a/internal/characters/qiqi/cons.go b/internal/characters/qiqi/cons.go index b1b4262d4f..29372beca0 100644 --- a/internal/characters/qiqi/cons.go +++ b/internal/characters/qiqi/cons.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func (c *char) c1(a info.AttackCB) { @@ -30,7 +30,7 @@ func (c *char) c2() { m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = .15 c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("qiqi-c2", -1), + Base: gmod.NewBase("qiqi-c2", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagNormal && atk.Info.AttackTag != attacks.AttackTagExtra { return nil, false diff --git a/internal/characters/raiden/asc.go b/internal/characters/raiden/asc.go index 06c7ea61bb..674ecd92ad 100644 --- a/internal/characters/raiden/asc.go +++ b/internal/characters/raiden/asc.go @@ -5,7 +5,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/event" "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // When nearby party members gain Elemental Orbs or Particles, Chakra Desiderata gains 2 Resolve stacks. @@ -59,7 +59,7 @@ func (c *char) a4() { if c.a4Stats == nil { c.a4Stats = make([]float64, attributes.EndStatType) c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("raiden-a4", -1), + Base: gmod.NewBase("raiden-a4", -1), AffectedStat: attributes.ElectroP, Extra: true, Amount: func() ([]float64, bool) { diff --git a/internal/characters/raiden/cons.go b/internal/characters/raiden/cons.go index e2d05a560c..75566719ff 100644 --- a/internal/characters/raiden/cons.go +++ b/internal/characters/raiden/cons.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // When the Musou Isshin state applied by Secret Art: Musou Shinsetsu expires @@ -20,7 +20,7 @@ func (c *char) c4() { continue } char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("raiden-c4", 600), + Base: gmod.NewBaseWithHitlag("raiden-c4", 600), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/characters/raiden/skill.go b/internal/characters/raiden/skill.go index 2413bbeb46..a3074e9582 100644 --- a/internal/characters/raiden/skill.go +++ b/internal/characters/raiden/skill.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/event" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) /** @@ -59,7 +59,7 @@ func (c *char) Skill(p map[string]int) (action.Info, error) { // starts 1s after cd delay c.Core.Tasks.Add(func() { this.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag(skillKey, 1500), + Base: gmod.NewBaseWithHitlag(skillKey, 1500), Amount: func(atk *info.AttackEvent, _ info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagElementalBurst { return nil, false diff --git a/internal/characters/razor/asc.go b/internal/characters/razor/asc.go index 3f2b7dd5ab..8d0a11f478 100644 --- a/internal/characters/razor/asc.go +++ b/internal/characters/razor/asc.go @@ -4,7 +4,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/action" "github.com/genshinsim/gcsim/pkg/core/attributes" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // Decreases Claw and Thunder's CD by 18%. @@ -31,7 +31,7 @@ func (c *char) a4() { c.a4Bonus = make([]float64, attributes.EndStatType) c.a4Bonus[attributes.ER] = 0.3 c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("razor-a4", -1), + Base: gmod.NewBase("razor-a4", -1), AffectedStat: attributes.ER, Amount: func() ([]float64, bool) { if c.Energy/c.EnergyMax >= 0.5 { diff --git a/internal/characters/razor/burst.go b/internal/characters/razor/burst.go index e6cb01dd95..5f4460d8d2 100644 --- a/internal/characters/razor/burst.go +++ b/internal/characters/razor/burst.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/event" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var ( @@ -40,7 +40,7 @@ func (c *char) Burst(p map[string]int) (action.Info, error) { val := make([]float64, attributes.EndStatType) val[attributes.AtkSpd] = burstATKSpeed[c.TalentLvlBurst()] c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(burstBuffKey, 15*60), + Base: gmod.NewBaseWithHitlag(burstBuffKey, 15*60), AffectedStat: attributes.AtkSpd, Amount: func() ([]float64, bool) { return val, true diff --git a/internal/characters/razor/cons.go b/internal/characters/razor/cons.go index 3bfadf0319..4cac94907e 100644 --- a/internal/characters/razor/cons.go +++ b/internal/characters/razor/cons.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // Picking up an Elemental Orb or Particle increases Razor's DMG by 10% for 8s. @@ -22,7 +22,7 @@ func (c *char) c1() { return false } c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("razor-c1", 8*60), + Base: gmod.NewBaseWithHitlag("razor-c1", 8*60), AffectedStat: attributes.DmgP, Amount: func() ([]float64, bool) { return c.c1bonus, true @@ -39,7 +39,7 @@ func (c *char) c2() { c.c2bonus[attributes.CR] = 0.1 c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("razor-c2", -1), + Base: gmod.NewBase("razor-c2", -1), Amount: func(_ *info.AttackEvent, t info.Target) ([]float64, bool) { x, ok := t.(*enemy.Enemy) if !ok { @@ -61,7 +61,7 @@ func (c *char) c4cb(a info.AttackCB) { return } e.AddDefMod(info.DefMod{ - Base: modifier.NewBaseWithHitlag("razor-c4", 7*60), + Base: gmod.NewBaseWithHitlag("razor-c4", 7*60), Value: -0.15, }) } diff --git a/internal/characters/razor/skill.go b/internal/characters/razor/skill.go index 403a525f2f..f9edbcd37a 100644 --- a/internal/characters/razor/skill.go +++ b/internal/characters/razor/skill.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/combat" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var ( @@ -213,7 +213,7 @@ func (c *char) addSigil(done bool) info.AttackCBFunc { m := make([]float64, attributes.EndStatType) m[attributes.ER] = float64(c.sigils) * 0.2 c.AddStatMod(character.StatMod{ - Base: modifier.NewBase(skillSigilKey, 18*60), + Base: gmod.NewBase(skillSigilKey, 18*60), AffectedStat: attributes.ER, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/characters/rosaria/asc.go b/internal/characters/rosaria/asc.go index d5d27508fa..22c83bee03 100644 --- a/internal/characters/rosaria/asc.go +++ b/internal/characters/rosaria/asc.go @@ -5,7 +5,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // When Rosaria strikes an opponent from behind using Ravaging Confession, Rosaria's CRIT Rate increases by 12% for 5s. @@ -27,7 +27,7 @@ func (c *char) makeA1CB() info.AttackCBFunc { m := make([]float64, attributes.EndStatType) m[attributes.CR] = 0.12 c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("rosaria-a1", 300), + Base: gmod.NewBaseWithHitlag("rosaria-a1", 300), AffectedStat: attributes.CR, Amount: func() ([]float64, bool) { return m, true @@ -59,7 +59,7 @@ func (c *char) a4() { continue } char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("rosaria-a4", 600), + Base: gmod.NewBaseWithHitlag("rosaria-a4", 600), AffectedStat: attributes.CR, Extra: true, Amount: func() ([]float64, bool) { diff --git a/internal/characters/rosaria/cons.go b/internal/characters/rosaria/cons.go index 31b8906a84..9de4e937ef 100644 --- a/internal/characters/rosaria/cons.go +++ b/internal/characters/rosaria/cons.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // When Rosaria deals a CRIT Hit, her ATK Speed increase by 10% and her Normal Attack DMG increases by 10% for 4s (can trigger vs shielded enemies) @@ -32,7 +32,7 @@ func (c *char) makeC1CB() info.AttackCBFunc { m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = 0.1 c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag("rosaria-c1-dmg", 240), // 4s + Base: gmod.NewBaseWithHitlag("rosaria-c1-dmg", 240), // 4s Amount: func(atk *info.AttackEvent, _ info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagNormal { return nil, false @@ -44,7 +44,7 @@ func (c *char) makeC1CB() info.AttackCBFunc { mAtkSpd := make([]float64, attributes.EndStatType) mAtkSpd[attributes.AtkSpd] = 0.1 c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("rosaria-c1-speed", 240), // 4s + Base: gmod.NewBaseWithHitlag("rosaria-c1-speed", 240), // 4s AffectedStat: attributes.AtkSpd, Amount: func() ([]float64, bool) { if c.Core.Player.CurrentState() != action.NormalAttackState { @@ -91,7 +91,7 @@ func (c *char) makeC6CB() info.AttackCBFunc { return } e.AddResistMod(info.ResistMod{ - Base: modifier.NewBaseWithHitlag("rosaria-c6", 600), + Base: gmod.NewBaseWithHitlag("rosaria-c6", 600), Ele: attributes.Physical, Value: -0.2, }) diff --git a/internal/characters/sara/cons.go b/internal/characters/sara/cons.go index 62de0c6751..ea640e3862 100644 --- a/internal/characters/sara/cons.go +++ b/internal/characters/sara/cons.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const c1ICDKey = "sara-c1-icd" @@ -26,7 +26,7 @@ func (c *char) c1() { // The Electro DMG of characters who have had their ATK increased by Tengu Juurai has its Crit DMG increased by 60%. func (c *char) c6(char *character.CharWrapper) { char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag("sara-c6", 360), + Base: gmod.NewBaseWithHitlag("sara-c6", 360), Amount: func(atk *info.AttackEvent, _ info.Target) ([]float64, bool) { if atk.Info.Element != attributes.Electro { return nil, false diff --git a/internal/characters/sara/skill.go b/internal/characters/sara/skill.go index 5da7635909..3207c9e59d 100644 --- a/internal/characters/sara/skill.go +++ b/internal/characters/sara/skill.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var skillFrames []int @@ -97,7 +97,7 @@ func (c *char) attackBuff(a info.AttackPattern, delay int) { m := make([]float64, attributes.EndStatType) m[attributes.ATK] = buff active.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("sara-attack-buff", 360), + Base: gmod.NewBaseWithHitlag("sara-attack-buff", 360), AffectedStat: attributes.ATK, Extra: true, Amount: func() ([]float64, bool) { diff --git a/internal/characters/sayu/cons.go b/internal/characters/sayu/cons.go index 308185306e..837d9218ca 100644 --- a/internal/characters/sayu/cons.go +++ b/internal/characters/sayu/cons.go @@ -5,7 +5,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/attributes" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // C2: @@ -17,7 +17,7 @@ import ( func (c *char) c2() { m := make([]float64, attributes.EndStatType) c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("sayu-c2", -1), + Base: gmod.NewBase("sayu-c2", -1), Amount: func(atk *info.AttackEvent, _ info.Target) ([]float64, bool) { if atk.Info.ActorIndex != c.Index() { return nil, false diff --git a/internal/characters/sethos/cons.go b/internal/characters/sethos/cons.go index d23055e697..91509b056b 100644 --- a/internal/characters/sethos/cons.go +++ b/internal/characters/sethos/cons.go @@ -5,7 +5,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/attributes" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -35,7 +35,7 @@ func (c *char) c1() { m := make([]float64, attributes.EndStatType) m[attributes.CR] = 0.15 c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("sethos-c1", -1), + Base: gmod.NewBase("sethos-c1", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagExtra { return nil, false @@ -54,7 +54,7 @@ func (c *char) c2() { } mElectro := make([]float64, attributes.EndStatType) c.AddStatMod(character.StatMod{ - Base: modifier.NewBase(c2Key, -1), + Base: gmod.NewBase(c2Key, -1), Amount: func() ([]float64, bool) { stackCount := c.c2Stacks() if stackCount == 0 { @@ -111,7 +111,7 @@ func (c *char) makeC4cb() info.AttackCBFunc { if count == 2 { for _, char := range c.Core.Player.Chars() { char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(c4Key, c4Dur), + Base: gmod.NewBaseWithHitlag(c4Key, c4Dur), AffectedStat: attributes.EM, Amount: func() ([]float64, bool) { return c.c4Buff, true diff --git a/internal/characters/shenhe/burst.go b/internal/characters/shenhe/burst.go index 625872fc16..ec0d550bd2 100644 --- a/internal/characters/shenhe/burst.go +++ b/internal/characters/shenhe/burst.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/combat" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var ( @@ -97,7 +97,7 @@ func (c *char) Burst(p map[string]int) (action.Info, error) { // An active character within the field created by Divine Maiden's Deliverance gains 15% Cryo DMG Bonus. if c.Base.Ascension >= 1 { active.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("shenhe-a1", buffDuration), + Base: gmod.NewBaseWithHitlag("shenhe-a1", buffDuration), AffectedStat: attributes.CryoP, Amount: func() ([]float64, bool) { return c.burstBuff, true @@ -111,12 +111,12 @@ func (c *char) Burst(p map[string]int) (action.Info, error) { // Q debuff tick for _, e := range c.Core.Combat.EnemiesWithinArea(burstArea, nil) { e.AddResistMod(info.ResistMod{ - Base: modifier.NewBaseWithHitlag("shenhe-burst-shred-cryo", buffDuration), + Base: gmod.NewBaseWithHitlag("shenhe-burst-shred-cryo", buffDuration), Ele: attributes.Cryo, Value: -burstrespp[c.TalentLvlBurst()], }) e.AddResistMod(info.ResistMod{ - Base: modifier.NewBaseWithHitlag("shenhe-burst-shred-phys", buffDuration), + Base: gmod.NewBaseWithHitlag("shenhe-burst-shred-phys", buffDuration), Ele: attributes.Physical, Value: -burstrespp[c.TalentLvlBurst()], }) diff --git a/internal/characters/shenhe/cons.go b/internal/characters/shenhe/cons.go index 57b925ff35..d85122a4a4 100644 --- a/internal/characters/shenhe/cons.go +++ b/internal/characters/shenhe/cons.go @@ -5,14 +5,14 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const c4BuffKey = "shenhe-c4" func (c *char) c2(active *character.CharWrapper, dur int) { active.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag("shenhe-c2", dur), + Base: gmod.NewBaseWithHitlag("shenhe-c2", dur), Amount: func(ae *info.AttackEvent, _ info.Target) ([]float64, bool) { if ae.Info.Element != attributes.Cryo { return nil, false diff --git a/internal/characters/shenhe/skill.go b/internal/characters/shenhe/skill.go index d867bf5074..f91c0fd5f1 100644 --- a/internal/characters/shenhe/skill.go +++ b/internal/characters/shenhe/skill.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var ( @@ -174,7 +174,7 @@ func (c *char) skillPressBuff() { char.AddStatus(quillKey, 10*60, true) // 10 sec duration char.SetTag(quillKey, 5) // 5 quill on press char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag("shenhe-a4-press", 10*60), + Base: gmod.NewBaseWithHitlag("shenhe-a4-press", 10*60), Amount: func(a *info.AttackEvent, _ info.Target) ([]float64, bool) { switch a.Info.AttackTag { case attacks.AttackTagElementalArt: @@ -198,7 +198,7 @@ func (c *char) skillHoldBuff() { char.AddStatus(quillKey, 15*60, true) // 15 sec duration char.SetTag(quillKey, 7) // 5 quill on hold char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag("shenhe-a4-hold", 15*60), + Base: gmod.NewBaseWithHitlag("shenhe-a4-hold", 15*60), Amount: func(a *info.AttackEvent, _ info.Target) ([]float64, bool) { switch a.Info.AttackTag { case attacks.AttackTagNormal: diff --git a/internal/characters/sigewinne/asc.go b/internal/characters/sigewinne/asc.go index a26aa71dae..7ed69ce2f6 100644 --- a/internal/characters/sigewinne/asc.go +++ b/internal/characters/sigewinne/asc.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -73,7 +73,7 @@ func (c *char) a1Self() { buff := make([]float64, attributes.EndStatType) buff[attributes.HydroP] = a1DmgBuff c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag("sigewinne-a1", skillCD*60), + Base: gmod.NewBaseWithHitlag("sigewinne-a1", skillCD*60), Amount: func(a *info.AttackEvent, _ info.Target) ([]float64, bool) { return buff, true }, @@ -83,7 +83,7 @@ func (c *char) a1Self() { func (c *char) a4() { m := make([]float64, attributes.EndStatType) c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("sigewinne-a4", -1), + Base: gmod.NewBase("sigewinne-a4", -1), AffectedStat: attributes.Heal, Amount: func() ([]float64, bool) { totalHpDebt := 0. diff --git a/internal/characters/sigewinne/cons.go b/internal/characters/sigewinne/cons.go index d662fce1c9..334be1c9a4 100644 --- a/internal/characters/sigewinne/cons.go +++ b/internal/characters/sigewinne/cons.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -32,7 +32,7 @@ func (c *char) c2CB(a info.AttackCB) { return } e.AddResistMod(info.ResistMod{ - Base: modifier.NewBaseWithHitlag("sigewinne-c2", 8*60), + Base: gmod.NewBaseWithHitlag("sigewinne-c2", 8*60), Ele: attributes.Hydro, Value: -0.35, }) @@ -45,7 +45,7 @@ func (c *char) c6CritMode() { m := make([]float64, attributes.EndStatType) c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag("sigewinne-c6", 15*60), + Base: gmod.NewBaseWithHitlag("sigewinne-c6", 15*60), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagElementalBurst { return nil, false diff --git a/internal/characters/sigewinne/skill.go b/internal/characters/sigewinne/skill.go index 5aee117eb3..0aa985caf2 100644 --- a/internal/characters/sigewinne/skill.go +++ b/internal/characters/sigewinne/skill.go @@ -13,7 +13,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var skillFrames [][]int @@ -236,7 +236,7 @@ func (c *char) bubbleFinalHealing() { func (c *char) bubbleTierDamageMod() { m := make([]float64, attributes.EndStatType) c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("sigewinne-bubble-tier", -1), + Base: gmod.NewBase("sigewinne-bubble-tier", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { switch atk.Info.AttackTag { case attacks.AttackTagElementalArt: diff --git a/internal/characters/skirk/burst.go b/internal/characters/skirk/burst.go index 5167bf581c..b0b45c9f40 100644 --- a/internal/characters/skirk/burst.go +++ b/internal/characters/skirk/burst.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/combat" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var ( @@ -96,7 +96,7 @@ func (c *char) BurstRuin(p map[string]int) (action.Info, error) { func (c *char) BurstInit() { mDmg := make([]float64, attributes.EndStatType) c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase(burstExtinctKey+"-dmg", -1), + Base: gmod.NewBase(burstExtinctKey+"-dmg", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if c.burstCount <= 0 { return nil, false diff --git a/internal/characters/skirk/cons.go b/internal/characters/skirk/cons.go index f451011f4f..74ba1d15c1 100644 --- a/internal/characters/skirk/cons.go +++ b/internal/characters/skirk/cons.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/combat" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var c4Atkp = []float64{0.0, 0.1, 0.2, 0.4} @@ -73,7 +73,7 @@ func (c *char) c2OnBurstExtinction() { // delay buff to the end of burst. c1 hits from burst don't benefit from c2 c.QueueCharTask(func() { c.AddStatMod(character.StatMod{ - Base: modifier.NewBase(c2Key, 12.5*60), + Base: gmod.NewBase(c2Key, 12.5*60), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { if !c.StatusIsActive(skillKey) { @@ -92,7 +92,7 @@ func (c *char) c4Init() { m := make([]float64, attributes.EndStatType) m[attributes.ATKP] = 0 c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("skirk-c4", -1), + Base: gmod.NewBase("skirk-c4", -1), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { m[attributes.ATKP] = c4Atkp[c.getA4Stacks()] diff --git a/internal/characters/sucrose/asc.go b/internal/characters/sucrose/asc.go index 4202907589..6c60f1ec37 100644 --- a/internal/characters/sucrose/asc.go +++ b/internal/characters/sucrose/asc.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // When Sucrose triggers a Swirl reaction, all characters in the party with the matching element (excluding Sucrose) @@ -42,7 +42,7 @@ func (c *char) a1() { continue } this.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("sucrose-a1", 480), // 8s + Base: gmod.NewBaseWithHitlag("sucrose-a1", 480), // 8s AffectedStat: attributes.EM, Amount: func() ([]float64, bool) { return c.a1Buff, true @@ -79,7 +79,7 @@ func (c *char) a4() { continue // nothing for sucrose } char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("sucrose-a4", 480), // 8 s + Base: gmod.NewBaseWithHitlag("sucrose-a4", 480), // 8 s AffectedStat: attributes.EM, Extra: true, Amount: func() ([]float64, bool) { diff --git a/internal/characters/sucrose/cons.go b/internal/characters/sucrose/cons.go index e75028d981..70ca8a9307 100644 --- a/internal/characters/sucrose/cons.go +++ b/internal/characters/sucrose/cons.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // Handles C4: Every 7 Normal and Charged Attacks, Sucrose will reduce the CD of Astable Anemohypostasis Creation-6308 by 1-7s @@ -48,7 +48,7 @@ func (c *char) c6() { for _, char := range c.Core.Player.Chars() { char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("sucrose-c6", 60*10), + Base: gmod.NewBaseWithHitlag("sucrose-c6", 60*10), AffectedStat: stat, Amount: func() ([]float64, bool) { return c.c6buff, true diff --git a/internal/characters/thoma/shield.go b/internal/characters/thoma/shield.go index 49a9078d7d..2e5784f6b4 100644 --- a/internal/characters/thoma/shield.go +++ b/internal/characters/thoma/shield.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/core/player/shield" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func (c *char) genShield(src string, shieldamt float64, shouldStack bool) { @@ -41,7 +41,7 @@ func (c *char) genShield(src string, shieldamt float64, shouldStack bool) { if c.Base.Cons >= 6 { for _, char := range c.Core.Player.Chars() { char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag("thoma-c6", 360), + Base: gmod.NewBaseWithHitlag("thoma-c6", 360), Amount: func(ae *info.AttackEvent, _ info.Target) ([]float64, bool) { switch ae.Info.AttackTag { case attacks.AttackTagNormal, attacks.AttackTagExtra, attacks.AttackTagPlunge: diff --git a/internal/characters/tighnari/asc.go b/internal/characters/tighnari/asc.go index 9c12960cfd..1b25a9f77b 100644 --- a/internal/characters/tighnari/asc.go +++ b/internal/characters/tighnari/asc.go @@ -5,7 +5,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/attributes" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // After Tighnari fires a Wreath Arrow, his Elemental Mastery is increased by 50 for 4s. @@ -15,7 +15,7 @@ func (c *char) a1() { m := make([]float64, attributes.EndStatType) m[attributes.EM] = 50 c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("tighnari-a1", 4*60), + Base: gmod.NewBase("tighnari-a1", 4*60), AffectedStat: attributes.EM, Amount: func() ([]float64, bool) { return m, true @@ -31,7 +31,7 @@ func (c *char) a4() { } m := make([]float64, attributes.EndStatType) c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("tighnari-a4", -1), + Base: gmod.NewBase("tighnari-a4", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagExtra && atk.Info.AttackTag != attacks.AttackTagElementalBurst { return nil, false diff --git a/internal/characters/tighnari/cons.go b/internal/characters/tighnari/cons.go index 44c075ce06..8c4b09433e 100644 --- a/internal/characters/tighnari/cons.go +++ b/internal/characters/tighnari/cons.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // Tighnari's Charged Attack CRIT Rate is increased by 15%. @@ -15,7 +15,7 @@ func (c *char) c1() { m := make([]float64, attributes.EndStatType) m[attributes.CR] = 0.15 c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("tighnari-c1", -1), + Base: gmod.NewBase("tighnari-c1", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagExtra { return nil, false @@ -36,7 +36,7 @@ func (c *char) c2() { return } c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("tighnari-c2", 6*60), + Base: gmod.NewBase("tighnari-c2", 6*60), AffectedStat: attributes.DendroP, Amount: func() ([]float64, bool) { return m, true @@ -59,7 +59,7 @@ func (c *char) c4() { m[attributes.EM] = 60 for _, char := range c.Core.Player.Chars() { char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("tighnari-c4", 8*60), + Base: gmod.NewBaseWithHitlag("tighnari-c4", 8*60), AffectedStat: attributes.EM, Amount: func() ([]float64, bool) { return m, true @@ -87,7 +87,7 @@ func (c *char) c4() { m[attributes.EM] = 120 for _, char := range c.Core.Player.Chars() { char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("tighnari-c4", 8*60), + Base: gmod.NewBaseWithHitlag("tighnari-c4", 8*60), AffectedStat: attributes.EM, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/characters/traveler/common/anemo/cons.go b/internal/characters/traveler/common/anemo/cons.go index 1c6250f1fd..b154344d3d 100644 --- a/internal/characters/traveler/common/anemo/cons.go +++ b/internal/characters/traveler/common/anemo/cons.go @@ -5,7 +5,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func (c *Traveler) c2() { @@ -13,7 +13,7 @@ func (c *Traveler) c2() { m[attributes.ER] = .16 c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("amc-c2", -1), + Base: gmod.NewBase("amc-c2", -1), AffectedStat: attributes.ER, Amount: func() ([]float64, bool) { return m, true @@ -28,7 +28,7 @@ func c6cb(ele attributes.Element) func(a info.AttackCB) { return } e.AddResistMod(info.ResistMod{ - Base: modifier.NewBaseWithHitlag("amc-c6-"+ele.String(), 600), + Base: gmod.NewBaseWithHitlag("amc-c6-"+ele.String(), 600), Ele: ele, Value: -0.20, }) diff --git a/internal/characters/traveler/common/dendro/asc.go b/internal/characters/traveler/common/dendro/asc.go index eef3979320..cbb16623ea 100644 --- a/internal/characters/traveler/common/dendro/asc.go +++ b/internal/characters/traveler/common/dendro/asc.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/event" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // A1 ascension level check happens once inside of burst.go @@ -42,7 +42,7 @@ func (c *Traveler) a1Buff(delay int) { m[attributes.EM] = float64(6 * c.burstOverflowingLotuslight) active := c.Core.Player.ActiveChar() active.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(a1Key, 60), + Base: gmod.NewBaseWithHitlag(a1Key, 60), AffectedStat: attributes.EM, Amount: func() ([]float64, bool) { return m, true @@ -68,7 +68,7 @@ func (c *Traveler) a4Init() { } m := make([]float64, attributes.EndStatType) c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("dmc-a4", -1), + Base: gmod.NewBase("dmc-a4", -1), Amount: func(atk *info.AttackEvent, _ info.Target) ([]float64, bool) { switch atk.Info.AttackTag { case attacks.AttackTagElementalArt: diff --git a/internal/characters/traveler/common/dendro/cons.go b/internal/characters/traveler/common/dendro/cons.go index 5105d19244..91d1eeedc5 100644 --- a/internal/characters/traveler/common/dendro/cons.go +++ b/internal/characters/traveler/common/dendro/cons.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func (c *Traveler) c1cb() func(a info.AttackCB) { @@ -63,7 +63,7 @@ func (c *Traveler) c6Buff(delay int) { } active := c.Core.Player.ActiveChar() active.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("dmc-c6", 60), + Base: gmod.NewBaseWithHitlag("dmc-c6", 60), Amount: func() ([]float64, bool) { return m, true }, diff --git a/internal/characters/traveler/common/electro/cons.go b/internal/characters/traveler/common/electro/cons.go index ab176c3299..25a0cbb221 100644 --- a/internal/characters/traveler/common/electro/cons.go +++ b/internal/characters/traveler/common/electro/cons.go @@ -4,7 +4,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/attributes" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // C2 - Violet Vehemence @@ -19,7 +19,7 @@ func (c *Traveler) c2() info.AttackCBFunc { return } e.AddResistMod(info.ResistMod{ - Base: modifier.NewBaseWithHitlag("travelerelectro-c2", 480), + Base: gmod.NewBaseWithHitlag("travelerelectro-c2", 480), Ele: attributes.Electro, Value: -0.15, }) diff --git a/internal/characters/traveler/common/electro/skill.go b/internal/characters/traveler/common/electro/skill.go index b5df160681..e47428a4db 100644 --- a/internal/characters/traveler/common/electro/skill.go +++ b/internal/characters/traveler/common/electro/skill.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var skillFrames [][]int @@ -181,7 +181,7 @@ func (c *Traveler) collectAmulets(collector *character.CharWrapper) bool { // apply ER mod collector.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("abundance-amulet", 360), + Base: gmod.NewBaseWithHitlag("abundance-amulet", 360), AffectedStat: attributes.ER, Extra: true, Amount: func() ([]float64, bool) { diff --git a/internal/characters/traveler/common/geo/cons.go b/internal/characters/traveler/common/geo/cons.go index 1cdf757954..2ec7295fc8 100644 --- a/internal/characters/traveler/common/geo/cons.go +++ b/internal/characters/traveler/common/geo/cons.go @@ -5,7 +5,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/construct" "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // C1: @@ -38,7 +38,7 @@ func (c *Traveler) c1(ticks int) func() { active := c.Core.Player.ActiveChar() active.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("geo-traveler-c1", 120), // 2s + Base: gmod.NewBaseWithHitlag("geo-traveler-c1", 120), // 2s AffectedStat: attributes.CR, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/characters/traveler/common/pyro/cons.go b/internal/characters/traveler/common/pyro/cons.go index a5bce5668b..3ba47be73d 100644 --- a/internal/characters/traveler/common/pyro/cons.go +++ b/internal/characters/traveler/common/pyro/cons.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/event" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -26,7 +26,7 @@ func (c *Traveler) c1Init() { for _, char := range c.Core.Player.Chars() { this := char this.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase(c1AttackModKey, -1), + Base: gmod.NewBase(c1AttackModKey, -1), Amount: func(ae *info.AttackEvent, _ info.Target) ([]float64, bool) { // char must be active if c.Core.Player.Active() != this.Index() { @@ -86,7 +86,7 @@ func (c *Traveler) c4AddMod() { mPyroDmg := make([]float64, attributes.EndStatType) mPyroDmg[attributes.PyroP] = 0.2 c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("travelerpyro-c4", 9*60), + Base: gmod.NewBaseWithHitlag("travelerpyro-c4", 9*60), Amount: func() ([]float64, bool) { return mPyroDmg, true }, @@ -100,7 +100,7 @@ func (c *Traveler) c6Init() { mCD := make([]float64, attributes.EndStatType) mCD[attributes.CD] = 0.4 c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase(c6AttackModKey, -1), + Base: gmod.NewBase(c6AttackModKey, -1), Amount: func(ae *info.AttackEvent, _ info.Target) ([]float64, bool) { switch ae.Info.AttackTag { case attacks.AttackTagNormal: diff --git a/internal/characters/traveler/common/storybuffs.go b/internal/characters/traveler/common/storybuffs.go index 3837bcf9a1..4433da49e9 100644 --- a/internal/characters/traveler/common/storybuffs.go +++ b/internal/characters/traveler/common/storybuffs.go @@ -4,7 +4,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/attributes" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func TravelerStoryBuffs(c *character.CharWrapper, p info.CharacterProfile) { @@ -37,7 +37,7 @@ func TravelerStoryBuffs(c *character.CharWrapper, p info.CharacterProfile) { m[attributes.BaseHP] += 50 } c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("traveler-story-quest-buffs", -1), + Base: gmod.NewBase("traveler-story-quest-buffs", -1), Amount: func() ([]float64, bool) { return m, true }, diff --git a/internal/characters/varesa/asc.go b/internal/characters/varesa/asc.go index 0d1444911c..b6269c8a6f 100644 --- a/internal/characters/varesa/asc.go +++ b/internal/characters/varesa/asc.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/core/stacks" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const a1Status = "rainbow-crash" @@ -62,7 +62,7 @@ func (c *char) a4() { m := make([]float64, attributes.EndStatType) c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("varesa-a4", -1), + Base: gmod.NewBase("varesa-a4", -1), Amount: func() ([]float64, bool) { m[attributes.ATKP] = 0.35 * float64(c.a4Stacks.Count()) return m, true diff --git a/internal/characters/varesa/cons.go b/internal/characters/varesa/cons.go index aa15e3469e..c50ddca37a 100644 --- a/internal/characters/varesa/cons.go +++ b/internal/characters/varesa/cons.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const c4Status = "diligent-refinement" @@ -37,7 +37,7 @@ func (c *char) c4() { m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = 1.0 c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("varesa-c4", -1), + Base: gmod.NewBase("varesa-c4", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagElementalBurst && atk.Info.Abil != kablamAbil { return nil, false @@ -92,7 +92,7 @@ func (c *char) c6() { m[attributes.CR] = 0.1 m[attributes.CD] = 1.0 c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("varesa-c6", -1), + Base: gmod.NewBase("varesa-c6", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { switch { case atk.Info.AttackTag == attacks.AttackTagElementalBurst: diff --git a/internal/characters/venti/cons.go b/internal/characters/venti/cons.go index 1fa1713875..d7cfd97020 100644 --- a/internal/characters/venti/cons.go +++ b/internal/characters/venti/cons.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // C1: @@ -45,12 +45,12 @@ func (c *char) c2(a info.AttackCB) { } e.AddResistMod(info.ResistMod{ - Base: modifier.NewBaseWithHitlag("venti-c2-anemo", 600), + Base: gmod.NewBaseWithHitlag("venti-c2-anemo", 600), Ele: attributes.Anemo, Value: -0.12, }) e.AddResistMod(info.ResistMod{ - Base: modifier.NewBaseWithHitlag("venti-c2-phys", 600), + Base: gmod.NewBaseWithHitlag("venti-c2-phys", 600), Ele: attributes.Physical, Value: -0.12, }) @@ -68,7 +68,7 @@ func (c *char) c4() { } // apply C4 to Venti c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("venti-c4", 600), + Base: gmod.NewBaseWithHitlag("venti-c4", 600), AffectedStat: attributes.AnemoP, Amount: func() ([]float64, bool) { return c.c4bonus, true @@ -88,7 +88,7 @@ func (c *char) c6(ele attributes.Element) func(a info.AttackCB) { return } e.AddResistMod(info.ResistMod{ - Base: modifier.NewBaseWithHitlag("venti-c6-"+ele.String(), 600), + Base: gmod.NewBaseWithHitlag("venti-c6-"+ele.String(), 600), Ele: ele, Value: -0.20, }) diff --git a/internal/characters/wanderer/asc.go b/internal/characters/wanderer/asc.go index 2803a62223..520655c6dc 100644 --- a/internal/characters/wanderer/asc.go +++ b/internal/characters/wanderer/asc.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -146,7 +146,7 @@ func (c *char) addA1Buff(absorbCheck attributes.Element) { m := make([]float64, attributes.EndStatType) m[attributes.ATKP] = 0.3 c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(a1PyroKey, 1200), + Base: gmod.NewBaseWithHitlag(a1PyroKey, 1200), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return m, true @@ -157,7 +157,7 @@ func (c *char) addA1Buff(absorbCheck attributes.Element) { m := make([]float64, attributes.EndStatType) m[attributes.CR] = 0.2 c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(a1CryoKey, 1200), + Base: gmod.NewBaseWithHitlag(a1CryoKey, 1200), AffectedStat: attributes.CR, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/characters/wanderer/cons.go b/internal/characters/wanderer/cons.go index 78e233097e..a985fd99b9 100644 --- a/internal/characters/wanderer/cons.go +++ b/internal/characters/wanderer/cons.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -24,7 +24,7 @@ func (c *char) c1() { m := make([]float64, attributes.EndStatType) m[attributes.AtkSpd] = 0.1 c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("wanderer-c1-atkspd", 1200), + Base: gmod.NewBaseWithHitlag("wanderer-c1-atkspd", 1200), Amount: func() ([]float64, bool) { return m, true }, @@ -40,7 +40,7 @@ func (c *char) c2() { m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = min(float64(c.maxSkydwellerPoints-c.skydwellerPoints)*0.04, 2) c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("wanderer-c2-burstbonus", burstFramesE[action.InvalidAction]), + Base: gmod.NewBaseWithHitlag("wanderer-c2-burstbonus", burstFramesE[action.InvalidAction]), Amount: func() ([]float64, bool) { return m, true }, diff --git a/internal/characters/wriothesley/asc.go b/internal/characters/wriothesley/asc.go index 9a9c96b544..7fac2f7749 100644 --- a/internal/characters/wriothesley/asc.go +++ b/internal/characters/wriothesley/asc.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -125,7 +125,7 @@ func (c *char) applyA4(dur int) { } m := make([]float64, attributes.EndStatType) c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("wriothesley-a4", dur), + Base: gmod.NewBaseWithHitlag("wriothesley-a4", dur), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { m[attributes.ATKP] = float64(c.a4Stack) * 0.06 diff --git a/internal/characters/wriothesley/cons.go b/internal/characters/wriothesley/cons.go index 39efe994ae..251924b3ad 100644 --- a/internal/characters/wriothesley/cons.go +++ b/internal/characters/wriothesley/cons.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -167,7 +167,7 @@ func (c *char) c4() { if c.Core.Player.Active() == c.Index() { m[attributes.AtkSpd] = 0.2 c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(c4Status, 4*60), + Base: gmod.NewBaseWithHitlag(c4Status, 4*60), AffectedStat: attributes.AtkSpd, Amount: func() ([]float64, bool) { return m, true @@ -177,7 +177,7 @@ func (c *char) c4() { m[attributes.AtkSpd] = 0.1 for _, char := range chars { char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(c4Status, 6*60), + Base: gmod.NewBaseWithHitlag(c4Status, 6*60), AffectedStat: attributes.AtkSpd, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/characters/xiangling/asc.go b/internal/characters/xiangling/asc.go index 59b5e48a81..796e033faf 100644 --- a/internal/characters/xiangling/asc.go +++ b/internal/characters/xiangling/asc.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/attributes" "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // Increases the flame range of Guoba by 20%. @@ -29,7 +29,7 @@ func (c *char) a4(a4Delay int) { c.Core.Tasks.Add(func() { active := c.Core.Player.ActiveChar() active.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("xiangling-a4", 10*60), + Base: gmod.NewBaseWithHitlag("xiangling-a4", 10*60), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/characters/xiangling/cons.go b/internal/characters/xiangling/cons.go index 3d5a3936d9..d65948fb85 100644 --- a/internal/characters/xiangling/cons.go +++ b/internal/characters/xiangling/cons.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func (c *char) c1(a info.AttackCB) { @@ -20,7 +20,7 @@ func (c *char) c1(a info.AttackCB) { return } e.AddResistMod(info.ResistMod{ - Base: modifier.NewBaseWithHitlag("xiangling-c1", 6*60), + Base: gmod.NewBaseWithHitlag("xiangling-c1", 6*60), Ele: attributes.Pyro, Value: -0.15, }) @@ -72,7 +72,7 @@ func (c *char) c6(dur int) { for _, char := range c.Core.Player.Chars() { char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("xiangling-c6", dur), + Base: gmod.NewBaseWithHitlag("xiangling-c6", dur), AffectedStat: attributes.PyroP, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/characters/xianyun/asc.go b/internal/characters/xianyun/asc.go index bf26637b3e..f692725f51 100644 --- a/internal/characters/xianyun/asc.go +++ b/internal/characters/xianyun/asc.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -28,7 +28,7 @@ func (c *char) a1() { for i, char := range c.Core.Player.Chars() { mCR := make([]float64, attributes.EndStatType) char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("xianyun-a1-buff", -1), + Base: gmod.NewBase("xianyun-a1-buff", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagPlunge { return nil, false diff --git a/internal/characters/xianyun/cons.go b/internal/characters/xianyun/cons.go index d2a2592042..a7992a0943 100644 --- a/internal/characters/xianyun/cons.go +++ b/internal/characters/xianyun/cons.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -52,7 +52,7 @@ func (c *char) c2buff() { } c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(c2Key, c2Dur), + Base: gmod.NewBaseWithHitlag(c2Key, c2Dur), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return c2BuffMod, true diff --git a/internal/characters/xiao/asc.go b/internal/characters/xiao/asc.go index 155c771eb9..945a568ef7 100644 --- a/internal/characters/xiao/asc.go +++ b/internal/characters/xiao/asc.go @@ -5,7 +5,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/attributes" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const a1Key = "xiao-a1" @@ -19,7 +19,7 @@ func (c *char) a1() { } m := make([]float64, attributes.EndStatType) c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(a1Key, 900+burstStart), + Base: gmod.NewBaseWithHitlag(a1Key, 900+burstStart), AffectedStat: attributes.DmgP, Amount: func() ([]float64, bool) { stacks := min(1+(c.Core.F-c.qStarted)/180, 5) @@ -45,7 +45,7 @@ func (c *char) a4() { } c.a4buff[attributes.DmgP] = float64(c.a4stacks) * 0.15 c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag(a4BuffKey, 420), + Base: gmod.NewBaseWithHitlag(a4BuffKey, 420), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { return c.a4buff, atk.Info.AttackTag == attacks.AttackTagElementalArt }, diff --git a/internal/characters/xiao/cons.go b/internal/characters/xiao/cons.go index a67f13c7cc..394e150265 100644 --- a/internal/characters/xiao/cons.go +++ b/internal/characters/xiao/cons.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // Implements Xiao C2: @@ -15,7 +15,7 @@ func (c *char) c2() { m := make([]float64, attributes.EndStatType) m[attributes.ER] = 0.25 c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("xiao-c2", -1), + Base: gmod.NewBase("xiao-c2", -1), AffectedStat: attributes.ER, Amount: func() ([]float64, bool) { if c.Core.Player.Active() != c.Index() { @@ -34,7 +34,7 @@ func (c *char) c4() { m := make([]float64, attributes.EndStatType) m[attributes.DEFP] = 1 c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("xiao-c4", -1), + Base: gmod.NewBase("xiao-c4", -1), AffectedStat: attributes.DEFP, Amount: func() ([]float64, bool) { if c.CurrentHPRatio() <= 0.5 { diff --git a/internal/characters/xilonen/asc.go b/internal/characters/xilonen/asc.go index da67fe6535..fc566e6b2f 100644 --- a/internal/characters/xilonen/asc.go +++ b/internal/characters/xilonen/asc.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/event" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -36,7 +36,7 @@ func (c *char) a1() { m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = 0.30 c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase(a1Key, -1), + Base: gmod.NewBase(a1Key, -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagPlunge && atk.Info.AttackTag != attacks.AttackTagNormal { return nil, false @@ -92,7 +92,7 @@ func (c *char) a4() { c.Core.Events.Subscribe(event.OnNightsoulBurst, func(args ...any) bool { c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(a4Key, 15*60), + Base: gmod.NewBaseWithHitlag(a4Key, 15*60), AffectedStat: attributes.DEFP, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/characters/xilonen/cons.go b/internal/characters/xilonen/cons.go index 4316788370..c42c092220 100644 --- a/internal/characters/xilonen/cons.go +++ b/internal/characters/xilonen/cons.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -68,7 +68,7 @@ func (c *char) c2() { continue } ch.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase(c2BuffKey, -1), + Base: gmod.NewBase(c2BuffKey, -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { return c2Buffs[attributes.Geo], true }, @@ -85,7 +85,7 @@ func (c *char) applyC2Buff(src int, other *character.CharWrapper) func() { return } other.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(c2BuffKey, 60), + Base: gmod.NewBaseWithHitlag(c2BuffKey, 60), Amount: func() ([]float64, bool) { return c2Buffs[other.Base.Element], true }, @@ -206,7 +206,7 @@ func (c *char) applyC6() { func (c *char) c6FlatDmg() { c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag(c6key, c6Duration), + Base: gmod.NewBaseWithHitlag(c6key, c6Duration), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { switch atk.Info.AttackTag { case attacks.AttackTagNormal, attacks.AttackTagPlunge: diff --git a/internal/characters/xilonen/skill.go b/internal/characters/xilonen/skill.go index 503080ea3d..4c03213831 100644 --- a/internal/characters/xilonen/skill.go +++ b/internal/characters/xilonen/skill.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/attributes" "github.com/genshinsim/gcsim/pkg/core/combat" "github.com/genshinsim/gcsim/pkg/core/info" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var skillFrames []int @@ -101,7 +101,7 @@ func (c *char) nightsoulPointReduceTask(src int) { func (c *char) applySamplerShred(ele attributes.Element, enemies []info.Enemy) { for _, e := range enemies { e.AddResistMod(info.ResistMod{ - Base: modifier.NewBaseWithHitlag(fmt.Sprintf("%v-%v", samplerShredKey, ele.String()), 60), + Base: gmod.NewBaseWithHitlag(fmt.Sprintf("%v-%v", samplerShredKey, ele.String()), 60), Ele: ele, Value: -skillShred[c.TalentLvlSkill()], }) diff --git a/internal/characters/xingqiu/asc.go b/internal/characters/xingqiu/asc.go index 4e421be7ba..0febb78fca 100644 --- a/internal/characters/xingqiu/asc.go +++ b/internal/characters/xingqiu/asc.go @@ -3,7 +3,7 @@ package xingqiu import ( "github.com/genshinsim/gcsim/pkg/core/attributes" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // A1 is not implemented: @@ -17,7 +17,7 @@ func (c *char) a4() { m := make([]float64, attributes.EndStatType) m[attributes.HydroP] = 0.2 c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("xingqiu-a4", -1), + Base: gmod.NewBase("xingqiu-a4", -1), AffectedStat: attributes.HydroP, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/characters/xingqiu/burst.go b/internal/characters/xingqiu/burst.go index 68b5b949a3..658f51238b 100644 --- a/internal/characters/xingqiu/burst.go +++ b/internal/characters/xingqiu/burst.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/combat" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var burstFrames []int @@ -113,7 +113,7 @@ func (c *char) summonSwordWave() { icd = c.Core.F + 1 c.Core.Tasks.Add(func() { e.AddResistMod(info.ResistMod{ - Base: modifier.NewBaseWithHitlag("xingqiu-c2", 4*60), + Base: gmod.NewBaseWithHitlag("xingqiu-c2", 4*60), Ele: attributes.Hydro, Value: -0.15, }) diff --git a/internal/characters/xinyan/asc.go b/internal/characters/xinyan/asc.go index cf162b26a0..cce594bd30 100644 --- a/internal/characters/xinyan/asc.go +++ b/internal/characters/xinyan/asc.go @@ -5,7 +5,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/core/player/shield" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // Decreases the number of opponents Sweeping Fervor must hit to trigger each level of shielding. @@ -31,7 +31,7 @@ func (c *char) a4() { for i, char := range c.Core.Player.Chars() { idx := i char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("xinyan-a4", -1), + Base: gmod.NewBase("xinyan-a4", -1), Amount: func(_ *info.AttackEvent, _ info.Target) ([]float64, bool) { shd := c.Core.Player.Shields.Get(shield.XinyanSkill) if shd == nil { diff --git a/internal/characters/xinyan/cons.go b/internal/characters/xinyan/cons.go index e8132252c4..2e5d22d9d1 100644 --- a/internal/characters/xinyan/cons.go +++ b/internal/characters/xinyan/cons.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const c1ICDKey = "xinyan-c1-icd" @@ -36,7 +36,7 @@ func (c *char) makeC1CB() info.AttackCBFunc { m := make([]float64, attributes.EndStatType) m[attributes.AtkSpd] = 0.12 c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("xinyan-c1", 5*60), + Base: gmod.NewBaseWithHitlag("xinyan-c1", 5*60), AffectedStat: attributes.AtkSpd, Amount: func() ([]float64, bool) { if c.Core.Player.CurrentState() != action.NormalAttackState && c.Core.Player.CurrentState() != action.ChargeAttackState { @@ -54,7 +54,7 @@ func (c *char) c2() { c.c2Buff[attributes.CR] = 1 c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("xinyan-c2", -1), + Base: gmod.NewBase("xinyan-c2", -1), Amount: func(atk *info.AttackEvent, _ info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagElementalBurst { return nil, false @@ -78,7 +78,7 @@ func (c *char) makeC4CB() info.AttackCBFunc { return } e.AddResistMod(info.ResistMod{ - Base: modifier.NewBaseWithHitlag("xinyan-c4", 12*60), + Base: gmod.NewBaseWithHitlag("xinyan-c4", 12*60), Ele: attributes.Physical, Value: -0.15, }) diff --git a/internal/characters/yaemiko/asc.go b/internal/characters/yaemiko/asc.go index 0ee144b91b..9e17ff861d 100644 --- a/internal/characters/yaemiko/asc.go +++ b/internal/characters/yaemiko/asc.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/attributes" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // When casting Great Secret Art: Tenko Kenshin, each Sesshou Sakura destroyed @@ -25,7 +25,7 @@ func (c *char) a4() { } m := make([]float64, attributes.EndStatType) c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("yaemiko-a4", -1), + Base: gmod.NewBase("yaemiko-a4", -1), Amount: func(atk *info.AttackEvent, _ info.Target) ([]float64, bool) { // only trigger on elemental art damage if atk.Info.AttackTag != attacks.AttackTagElementalArt { diff --git a/internal/characters/yaemiko/cons.go b/internal/characters/yaemiko/cons.go index 8512b5581e..702ac12b9c 100644 --- a/internal/characters/yaemiko/cons.go +++ b/internal/characters/yaemiko/cons.go @@ -3,7 +3,7 @@ package yaemiko import ( "github.com/genshinsim/gcsim/pkg/core/attributes" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // When Sesshou Sakura lightning hits opponents, the Electro DMG Bonus of all nearby party members is increased by 20% for 5s. @@ -11,7 +11,7 @@ func (c *char) c4() { // TODO: does this trigger for yaemiko too? assuming it does for _, char := range c.Core.Player.Chars() { char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("yaemiko-c4", 5*60), + Base: gmod.NewBaseWithHitlag("yaemiko-c4", 5*60), AffectedStat: attributes.ElectroP, Amount: func() ([]float64, bool) { return c.c4buff, true diff --git a/internal/characters/yanfei/asc.go b/internal/characters/yanfei/asc.go index c2c31f88d2..0f67878fad 100644 --- a/internal/characters/yanfei/asc.go +++ b/internal/characters/yanfei/asc.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/combat" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // When Yanfei consumes Scarlet Seals by using a Charged Attack, @@ -19,7 +19,7 @@ func (c *char) a1(stacks int) { } c.a1Buff[attributes.PyroP] = float64(stacks) * 0.05 c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("yanfei-a1", 360), + Base: gmod.NewBaseWithHitlag("yanfei-a1", 360), AffectedStat: attributes.PyroP, Amount: func() ([]float64, bool) { return c.a1Buff, true diff --git a/internal/characters/yanfei/burst.go b/internal/characters/yanfei/burst.go index d656c4ed21..cf988c688e 100644 --- a/internal/characters/yanfei/burst.go +++ b/internal/characters/yanfei/burst.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var burstFrames []int @@ -35,7 +35,7 @@ func (c *char) Burst(p map[string]int) (action.Info, error) { c.AddStatus(burstBuffKey, 15*60+1, true) c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag(burstBuffKey, 15*60), + Base: gmod.NewBaseWithHitlag(burstBuffKey, 15*60), Amount: func(atk *info.AttackEvent, _ info.Target) ([]float64, bool) { if atk.Info.AttackTag == attacks.AttackTagExtra { return c.burstBuff, true diff --git a/internal/characters/yanfei/cons.go b/internal/characters/yanfei/cons.go index 8f2d409fe8..6a95df2d44 100644 --- a/internal/characters/yanfei/cons.go +++ b/internal/characters/yanfei/cons.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/core/player/shield" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // Hook for C2: @@ -16,7 +16,7 @@ func (c *char) c2() { if c.Core.Combat.DamageMode { m := make([]float64, attributes.EndStatType) c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("yanfei-c2", -1), + Base: gmod.NewBase("yanfei-c2", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagExtra { return nil, false diff --git a/internal/characters/yaoyao/cons.go b/internal/characters/yaoyao/cons.go index 38a85249c6..de8879cacf 100644 --- a/internal/characters/yaoyao/cons.go +++ b/internal/characters/yaoyao/cons.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/combat" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -21,7 +21,7 @@ func (c *char) c1() { m[attributes.DendroP] = 0.15 active := c.Core.Player.ActiveChar() active.AddStatMod(character.StatMod{ - Base: modifier.NewBase("yaoyao-c1", 8*60), + Base: gmod.NewBase("yaoyao-c1", 8*60), AffectedStat: attributes.DendroP, Amount: func() ([]float64, bool) { return m, true @@ -61,7 +61,7 @@ func (c *char) c4() { m[attributes.EM] = 120 } c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("yaoyao-c4", 8.8*60), + Base: gmod.NewBaseWithHitlag("yaoyao-c4", 8.8*60), AffectedStat: attributes.EM, Extra: true, Amount: func() ([]float64, bool) { diff --git a/internal/characters/yelan/asc.go b/internal/characters/yelan/asc.go index 191f13ce28..71d8238a30 100644 --- a/internal/characters/yelan/asc.go +++ b/internal/characters/yelan/asc.go @@ -4,7 +4,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/attributes" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // When the party has 1/2/3/4 Elemental Types, Yelan's Max HP is increased by 6%/12%/18%/30%. @@ -25,7 +25,7 @@ func (c *char) a1() { } c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("yelan-a1", -1), + Base: gmod.NewBase("yelan-a1", -1), AffectedStat: attributes.HPP, Amount: func() ([]float64, bool) { return m, true @@ -44,7 +44,7 @@ func (c *char) a4() { for _, char := range c.Core.Player.Chars() { this := char this.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("yelan-a4", 15*60), + Base: gmod.NewBase("yelan-a4", 15*60), Amount: func(_ *info.AttackEvent, _ info.Target) ([]float64, bool) { // char must be active if c.Core.Player.Active() != this.Index() { diff --git a/internal/characters/yelan/skill.go b/internal/characters/yelan/skill.go index 51f35a253d..03b70d870f 100644 --- a/internal/characters/yelan/skill.go +++ b/internal/characters/yelan/skill.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) var skillFrames []int @@ -138,7 +138,7 @@ func (c *char) Skill(p map[string]int) (action.Info, error) { Write("enemies count", c.c4count) for _, char := range c.Core.Player.Chars() { char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("yelan-c4", 25*60), + Base: gmod.NewBaseWithHitlag("yelan-c4", 25*60), AffectedStat: attributes.HPP, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/characters/yoimiya/asc.go b/internal/characters/yoimiya/asc.go index 14e4f200bd..cfcd28c602 100644 --- a/internal/characters/yoimiya/asc.go +++ b/internal/characters/yoimiya/asc.go @@ -4,7 +4,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/attributes" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const a1Key = "yoimiya-a1" @@ -36,7 +36,7 @@ func (c *char) makeA1CB() info.AttackCBFunc { m := make([]float64, attributes.EndStatType) c.AddStatMod(character.StatMod{ - Base: modifier.NewBase(a1Key, 3*60), + Base: gmod.NewBase(a1Key, 3*60), AffectedStat: attributes.PyroP, Amount: func() ([]float64, bool) { m[attributes.PyroP] = float64(c.a1Stacks) * 0.02 @@ -58,7 +58,7 @@ func (c *char) a4() { continue } x.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("yoimiya-a4", 900), + Base: gmod.NewBaseWithHitlag("yoimiya-a4", 900), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return c.a4Bonus, true diff --git a/internal/characters/yoimiya/cons.go b/internal/characters/yoimiya/cons.go index bfed72fee5..16cb34fdb4 100644 --- a/internal/characters/yoimiya/cons.go +++ b/internal/characters/yoimiya/cons.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func (c *char) c1() { @@ -24,7 +24,7 @@ func (c *char) c1() { } c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("yoimiya-c1", 1200), + Base: gmod.NewBase("yoimiya-c1", 1200), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return m, true @@ -55,7 +55,7 @@ func (c *char) makeC2CB() info.AttackCBFunc { m := make([]float64, attributes.EndStatType) m[attributes.PyroP] = 0.25 c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("yoimiya-c2", 360), + Base: gmod.NewBase("yoimiya-c2", 360), AffectedStat: attributes.PyroP, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/characters/yunjin/cons.go b/internal/characters/yunjin/cons.go index 425c507f03..16988a49a3 100644 --- a/internal/characters/yunjin/cons.go +++ b/internal/characters/yunjin/cons.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -24,7 +24,7 @@ func (c *char) c2() { m[attributes.DmgP] = .15 for _, char := range c.Core.Player.Chars() { char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag(c2Key, 12*60), + Base: gmod.NewBaseWithHitlag(c2Key, 12*60), Amount: func(ae *info.AttackEvent, _ info.Target) ([]float64, bool) { if ae.Info.AttackTag == attacks.AttackTagNormal { return m, true @@ -62,7 +62,7 @@ func (c *char) c4() { } c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("yunjin-c4", 12*60), + Base: gmod.NewBaseWithHitlag("yunjin-c4", 12*60), AffectedStat: attributes.DEFP, Amount: func() ([]float64, bool) { return c.c4bonus, true @@ -85,7 +85,7 @@ func (c *char) c6() { for _, char := range c.Core.Player.Chars() { this := char this.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(c6Key, 12*60), + Base: gmod.NewBaseWithHitlag(c6Key, 12*60), AffectedStat: attributes.AtkSpd, Amount: func() ([]float64, bool) { // TODO: i assume this buff should go away if stacks are gone? diff --git a/internal/characters/zhongli/shield.go b/internal/characters/zhongli/shield.go index cdfaf9124b..c5750afc6d 100644 --- a/internal/characters/zhongli/shield.go +++ b/internal/characters/zhongli/shield.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/combat" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/shield" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func (c *char) addJadeShield() { @@ -31,7 +31,7 @@ func (c *char) addJadeShield() { key := fmt.Sprintf("zhongli-%v", v.String()) for _, e := range enemies { e.AddResistMod(info.ResistMod{ - Base: modifier.NewBaseWithHitlag(key, 60), + Base: gmod.NewBaseWithHitlag(key, 60), Ele: v, Value: -0.2, }) diff --git a/internal/weapons/bow/alley/alley.go b/internal/weapons/bow/alley/alley.go index 8ed091115d..1cdb4d476e 100644 --- a/internal/weapons/bow/alley/alley.go +++ b/internal/weapons/bow/alley/alley.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -54,7 +54,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m := make([]float64, attributes.EndStatType) char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("alley-hunter", -1), + Base: gmod.NewBase("alley-hunter", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { m[attributes.DmgP] = dmg * float64(w.stacks) return m, true diff --git a/internal/weapons/bow/amos/amos.go b/internal/weapons/bow/amos/amos.go index acdfc19b1a..3d6c1a31d6 100644 --- a/internal/weapons/bow/amos/amos.go +++ b/internal/weapons/bow/amos/amos.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -32,7 +32,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) flat := 0.09 + 0.03*float64(r) char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("amos", -1), + Base: gmod.NewBase("amos", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagNormal && atk.Info.AttackTag != attacks.AttackTagExtra { return nil, false diff --git a/internal/weapons/bow/aqua/aqua.go b/internal/weapons/bow/aqua/aqua.go index 5b977c5241..df40d5b738 100644 --- a/internal/weapons/bow/aqua/aqua.go +++ b/internal/weapons/bow/aqua/aqua.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -29,7 +29,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) v := make([]float64, attributes.EndStatType) v[attributes.HPP] = 0.12 + float64(r)*0.04 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("aquasimulacra-hp", -1), + Base: gmod.NewBase("aquasimulacra-hp", -1), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return v, true @@ -49,7 +49,7 @@ func (w *Weapon) enemyCheck(char *character.CharWrapper, c *core.Core) func() { enemies := c.Combat.EnemiesWithinArea(combat.NewCircleHitOnTarget(c.Combat.Player(), nil, 8), nil) if enemies != nil { char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag("aquasimulacra-dmg", 72), + Base: gmod.NewBaseWithHitlag("aquasimulacra-dmg", 72), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { return w.dmgBuff, true }, diff --git a/internal/weapons/bow/astralvulturescrimsonplumage/astralvulturescrimsonplumage.go b/internal/weapons/bow/astralvulturescrimsonplumage/astralvulturescrimsonplumage.go index a418bac0a4..d6692d8177 100644 --- a/internal/weapons/bow/astralvulturescrimsonplumage/astralvulturescrimsonplumage.go +++ b/internal/weapons/bow/astralvulturescrimsonplumage/astralvulturescrimsonplumage.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -41,7 +41,7 @@ func (w *Weapon) Init() error { } w.char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("astralvulturescrimsonplumage-dmg", -1), + Base: gmod.NewBase("astralvulturescrimsonplumage-dmg", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { switch atk.Info.AttackTag { case attacks.AttackTagExtra: @@ -78,7 +78,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) return false } char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("astralvulturescrimsonplumage-atkp", 12*60), + Base: gmod.NewBaseWithHitlag("astralvulturescrimsonplumage-atkp", 12*60), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return atkp, true diff --git a/internal/weapons/bow/chainbreaker/chainbreaker.go b/internal/weapons/bow/chainbreaker/chainbreaker.go index 1f9f1af6c9..f5231d34f6 100644 --- a/internal/weapons/bow/chainbreaker/chainbreaker.go +++ b/internal/weapons/bow/chainbreaker/chainbreaker.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -39,7 +39,7 @@ func (w *Weapon) Init() error { mAtk := make([]float64, attributes.EndStatType) mAtk[attributes.ATKP] = w.atkStack * float64(stacks) w.self.AddStatMod(character.StatMod{ - Base: modifier.NewBase("chain-breaker-atk", -1), + Base: gmod.NewBase("chain-breaker-atk", -1), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return mAtk, true @@ -50,7 +50,7 @@ func (w *Weapon) Init() error { mEm := make([]float64, attributes.EndStatType) mEm[attributes.EM] = float64(w.emBuff) w.self.AddStatMod(character.StatMod{ - Base: modifier.NewBase("chain-breaker-em", -1), + Base: gmod.NewBase("chain-breaker-em", -1), AffectedStat: attributes.EM, Amount: func() ([]float64, bool) { return mEm, true diff --git a/internal/weapons/bow/cloudforged/cloudforged.go b/internal/weapons/bow/cloudforged/cloudforged.go index fa4478a164..3118b3c097 100644 --- a/internal/weapons/bow/cloudforged/cloudforged.go +++ b/internal/weapons/bow/cloudforged/cloudforged.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -46,7 +46,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) } m[attributes.EM] = (30.0 + 10.0*float64(refine)) * float64(w.stacks) char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(buffKey, 18*60), + Base: gmod.NewBaseWithHitlag(buffKey, 18*60), AffectedStat: attributes.EM, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/weapons/bow/compound/compound.go b/internal/weapons/bow/compound/compound.go index 4ddb52067b..034460615d 100644 --- a/internal/weapons/bow/compound/compound.go +++ b/internal/weapons/bow/compound/compound.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -85,7 +85,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) // buff lasts 6 * 60 = 360 frames char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("compoundbow", stackDuration), + Base: gmod.NewBaseWithHitlag("compoundbow", stackDuration), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { m[attributes.ATKP] = incAtk * float64(stacks) diff --git a/internal/weapons/bow/elegy/elegy.go b/internal/weapons/bow/elegy/elegy.go index aedb0303b1..a679a3966b 100644 --- a/internal/weapons/bow/elegy/elegy.go +++ b/internal/weapons/bow/elegy/elegy.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -41,7 +41,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m := make([]float64, attributes.EndStatType) m[attributes.EM] = 45 + float64(r)*15 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("elegy-em", -1), + Base: gmod.NewBase("elegy-em", -1), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return m, true @@ -87,14 +87,14 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) char.AddStatus(cdKey, cd, true) for _, char := range c.Player.Chars() { char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("elegy-proc", buffDuration), + Base: gmod.NewBaseWithHitlag("elegy-proc", buffDuration), AffectedStat: attributes.EM, Amount: func() ([]float64, bool) { return uniqueVal, true }, }) char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(common.MillennialKey, buffDuration), + Base: gmod.NewBaseWithHitlag(common.MillennialKey, buffDuration), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return sharedVal, true diff --git a/internal/weapons/bow/firstgreatmagic/firstgreatmagic.go b/internal/weapons/bow/firstgreatmagic/firstgreatmagic.go index 7cbe91dc71..1c32e8b7cb 100644 --- a/internal/weapons/bow/firstgreatmagic/firstgreatmagic.go +++ b/internal/weapons/bow/firstgreatmagic/firstgreatmagic.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -45,7 +45,7 @@ func (w *Weapon) Init() error { mAtk := make([]float64, attributes.EndStatType) mAtk[attributes.ATKP] = w.atkStackVal * float64(w.sameElement) w.char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("thefirstgreatmagic-atk", -1), + Base: gmod.NewBase("thefirstgreatmagic-atk", -1), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return mAtk, true @@ -74,7 +74,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) mDmg := make([]float64, attributes.EndStatType) mDmg[attributes.DmgP] = (0.12 + float64(r)*0.04) char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("thefirstgreatmagic-dmg%", -1), + Base: gmod.NewBase("thefirstgreatmagic-dmg%", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagExtra { return nil, false diff --git a/internal/weapons/bow/flowerwreathedfeathers/flowerwreathedfeathers.go b/internal/weapons/bow/flowerwreathedfeathers/flowerwreathedfeathers.go index 7c7086f932..6ee5c7b6be 100644 --- a/internal/weapons/bow/flowerwreathedfeathers/flowerwreathedfeathers.go +++ b/internal/weapons/bow/flowerwreathedfeathers/flowerwreathedfeathers.go @@ -12,7 +12,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -51,7 +51,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m := make([]float64, attributes.EndStatType) buff := 0.045 + 0.015*float64(r) char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase(buffStatus, -1), + Base: gmod.NewBase(buffStatus, -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagExtra { return nil, false diff --git a/internal/weapons/bow/hamayumi/hamayumi.go b/internal/weapons/bow/hamayumi/hamayumi.go index 39d488b100..dc3bb8267f 100644 --- a/internal/weapons/bow/hamayumi/hamayumi.go +++ b/internal/weapons/bow/hamayumi/hamayumi.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -28,7 +28,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) nm := .12 + .04*float64(r) ca := .09 + .03*float64(r) char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("hamayumi", -1), + Base: gmod.NewBase("hamayumi", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { val := make([]float64, attributes.EndStatType) if atk.Info.AttackTag == attacks.AttackTagNormal { diff --git a/internal/weapons/bow/heartstrings/heartstrings.go b/internal/weapons/bow/heartstrings/heartstrings.go index ba900a5f4f..3abb9f1f05 100644 --- a/internal/weapons/bow/heartstrings/heartstrings.go +++ b/internal/weapons/bow/heartstrings/heartstrings.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -59,7 +59,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) // Max HP increase mHP := make([]float64, attributes.EndStatType) char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("heartstrings", -1), + Base: gmod.NewBase("heartstrings", -1), AffectedStat: attributes.HPP, Amount: func() ([]float64, bool) { stacks := w.Stacks() @@ -110,7 +110,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) mCR := make([]float64, attributes.EndStatType) mCR[attributes.CR] = 0.21 + float64(r)*0.07 char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase(burstCRKey, -1), + Base: gmod.NewBase(burstCRKey, -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagElementalBurst { return nil, false diff --git a/internal/weapons/bow/hunterspath/hunterspath.go b/internal/weapons/bow/hunterspath/hunterspath.go index c51ac22c43..3fc68222be 100644 --- a/internal/weapons/bow/hunterspath/hunterspath.go +++ b/internal/weapons/bow/hunterspath/hunterspath.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -45,7 +45,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) val[i] = dmgBonus } char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("hunterspath-dmg-bonus", -1), + Base: gmod.NewBase("hunterspath-dmg-bonus", -1), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return val, true diff --git a/internal/weapons/bow/ibispiercer/ibispiercer.go b/internal/weapons/bow/ibispiercer/ibispiercer.go index 730f723c99..f803fabe40 100644 --- a/internal/weapons/bow/ibispiercer/ibispiercer.go +++ b/internal/weapons/bow/ibispiercer/ibispiercer.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -80,7 +80,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) // add buff char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(stackKey, stackDuration), + Base: gmod.NewBaseWithHitlag(stackKey, stackDuration), AffectedStat: attributes.EM, Amount: func() ([]float64, bool) { m[attributes.EM] = em * float64(stacks) diff --git a/internal/weapons/bow/kingssquire/kingssquire.go b/internal/weapons/bow/kingssquire/kingssquire.go index 489924d576..f9c08e6455 100644 --- a/internal/weapons/bow/kingssquire/kingssquire.go +++ b/internal/weapons/bow/kingssquire/kingssquire.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -77,7 +77,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) } char.AddStatus(icdKey, 20*60, true) char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(buffKey, 12*60), + Base: gmod.NewBaseWithHitlag(buffKey, 12*60), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/weapons/bow/mitternachtswaltz/mitternachtswaltz.go b/internal/weapons/bow/mitternachtswaltz/mitternachtswaltz.go index 61f71e78b4..bbfb1dfe7f 100644 --- a/internal/weapons/bow/mitternachtswaltz/mitternachtswaltz.go +++ b/internal/weapons/bow/mitternachtswaltz/mitternachtswaltz.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -52,7 +52,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) if atk.Info.AttackTag == attacks.AttackTagNormal { char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag("mitternachtswaltz-ele", 300), + Base: gmod.NewBaseWithHitlag("mitternachtswaltz-ele", 300), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if (atk.Info.AttackTag == attacks.AttackTagElementalArt) || (atk.Info.AttackTag == attacks.AttackTagElementalArtHold) { m[attributes.DmgP] = buffAmount @@ -65,7 +65,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) if (atk.Info.AttackTag == attacks.AttackTagElementalArt) || (atk.Info.AttackTag == attacks.AttackTagElementalArtHold) { char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag("mitternachtswaltz-na", 300), + Base: gmod.NewBaseWithHitlag("mitternachtswaltz-na", 300), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag == attacks.AttackTagNormal { m[attributes.DmgP] = buffAmount diff --git a/internal/weapons/bow/polarstar/polarstar.go b/internal/weapons/bow/polarstar/polarstar.go index 70134de794..f44cc0a205 100644 --- a/internal/weapons/bow/polarstar/polarstar.go +++ b/internal/weapons/bow/polarstar/polarstar.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -45,7 +45,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) mATK := make([]float64, attributes.EndStatType) char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("polar-star-atk", -1), + Base: gmod.NewBase("polar-star-atk", -1), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { count := 0 @@ -98,7 +98,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) mDmg := make([]float64, attributes.EndStatType) mDmg[attributes.DmgP] = dmg char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("polar-star-dmg", -1), + Base: gmod.NewBase("polar-star-dmg", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { switch atk.Info.AttackTag { case attacks.AttackTagElementalArt, attacks.AttackTagElementalArtHold, attacks.AttackTagElementalBurst: diff --git a/internal/weapons/bow/predator/predator.go b/internal/weapons/bow/predator/predator.go index f04fad8c75..cfeeae7ed2 100644 --- a/internal/weapons/bow/predator/predator.go +++ b/internal/weapons/bow/predator/predator.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -41,7 +41,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) if char.Base.Key == keys.Aloy { mATK[attributes.ATK] = 66 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("predator-atk", -1), + Base: gmod.NewBase("predator-atk", -1), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return mATK, true @@ -83,7 +83,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) char.AddStatus(stackKey, stackDuration, true) char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag("predator-dmg", stackDuration), + Base: gmod.NewBaseWithHitlag("predator-dmg", stackDuration), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if (atk.Info.AttackTag == attacks.AttackTagNormal) || (atk.Info.AttackTag == attacks.AttackTagExtra) { mDMG[attributes.DmgP] = buffDmgP * float64(stacks) diff --git a/internal/weapons/bow/prototype/prototype.go b/internal/weapons/bow/prototype/prototype.go index bbf49e8d8a..60936b8b53 100644 --- a/internal/weapons/bow/prototype/prototype.go +++ b/internal/weapons/bow/prototype/prototype.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -42,7 +42,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) return false } char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("prototype-crescent", 60*10), + Base: gmod.NewBaseWithHitlag("prototype-crescent", 60*10), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/weapons/bow/rangegauge/rangegauge.go b/internal/weapons/bow/rangegauge/rangegauge.go index afe0ea852f..c84bb3ab36 100644 --- a/internal/weapons/bow/rangegauge/rangegauge.go +++ b/internal/weapons/bow/rangegauge/rangegauge.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -99,7 +99,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m[i] = ele } char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(buffKey, buffDuration), + Base: gmod.NewBaseWithHitlag(buffKey, buffDuration), Amount: func() ([]float64, bool) { return m, true }, diff --git a/internal/weapons/bow/raven/raven.go b/internal/weapons/bow/raven/raven.go index 7d571085fb..76aadd0772 100644 --- a/internal/weapons/bow/raven/raven.go +++ b/internal/weapons/bow/raven/raven.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -30,7 +30,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = dmg char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("ravenbow", -1), + Base: gmod.NewBase("ravenbow", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { x, ok := t.(*enemy.Enemy) if !ok { diff --git a/internal/weapons/bow/rust/rust.go b/internal/weapons/bow/rust/rust.go index d6816a84af..fddb22eddd 100644 --- a/internal/weapons/bow/rust/rust.go +++ b/internal/weapons/bow/rust/rust.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -29,7 +29,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m := make([]float64, attributes.EndStatType) inc := .3 + float64(r)*0.1 char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("rust", -1), + Base: gmod.NewBase("rust", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag == attacks.AttackTagNormal { m[attributes.DmgP] = inc diff --git a/internal/weapons/bow/scionoftheblazingsun/scionoftheblazingsun.go b/internal/weapons/bow/scionoftheblazingsun/scionoftheblazingsun.go index ecbf7f43be..b4e44eb15f 100644 --- a/internal/weapons/bow/scionoftheblazingsun/scionoftheblazingsun.go +++ b/internal/weapons/bow/scionoftheblazingsun/scionoftheblazingsun.go @@ -12,7 +12,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -43,7 +43,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = 0.21 + 0.07*float64(r) char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("scion", -1), + Base: gmod.NewBase("scion", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { e, ok := t.(*enemy.Enemy) if !ok { diff --git a/internal/weapons/bow/sharpshooter/sharpshooter.go b/internal/weapons/bow/sharpshooter/sharpshooter.go index df705e39e6..a941937221 100644 --- a/internal/weapons/bow/sharpshooter/sharpshooter.go +++ b/internal/weapons/bow/sharpshooter/sharpshooter.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -27,7 +27,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) dmg := 0.18 + float64(r)*0.06 char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("sharpshooter", -1), + Base: gmod.NewBase("sharpshooter", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { m := make([]float64, attributes.EndStatType) if atk.Info.HitWeakPoint { diff --git a/internal/weapons/bow/skyward/skyward.go b/internal/weapons/bow/skyward/skyward.go index e608b3b466..18aae59d94 100644 --- a/internal/weapons/bow/skyward/skyward.go +++ b/internal/weapons/bow/skyward/skyward.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -35,7 +35,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m := make([]float64, attributes.EndStatType) m[attributes.CD] = 0.15 + float64(r)*0.05 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("skyward harp", -1), + Base: gmod.NewBase("skyward harp", -1), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/weapons/bow/slingshot/slingshot.go b/internal/weapons/bow/slingshot/slingshot.go index 4d536ca565..6148b8eea3 100644 --- a/internal/weapons/bow/slingshot/slingshot.go +++ b/internal/weapons/bow/slingshot/slingshot.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -34,7 +34,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) passiveThresholdF := 18 travel := 0 char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("slingshot", -1), + Base: gmod.NewBase("slingshot", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if (atk.Info.AttackTag != attacks.AttackTagNormal) && (atk.Info.AttackTag != attacks.AttackTagExtra) { return nil, false diff --git a/internal/weapons/bow/songofstillness/songofstillness.go b/internal/weapons/bow/songofstillness/songofstillness.go index 464320391e..c59a68912c 100644 --- a/internal/weapons/bow/songofstillness/songofstillness.go +++ b/internal/weapons/bow/songofstillness/songofstillness.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -39,7 +39,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) return false } char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("songofstillness-dmg-boost", duration), + Base: gmod.NewBaseWithHitlag("songofstillness-dmg-boost", duration), AffectedStat: attributes.DmgP, Amount: func() ([]float64, bool) { return val, true diff --git a/internal/weapons/bow/stringless/stringless.go b/internal/weapons/bow/stringless/stringless.go index 84658d235e..11a6b27374 100644 --- a/internal/weapons/bow/stringless/stringless.go +++ b/internal/weapons/bow/stringless/stringless.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -28,7 +28,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = 0.18 + float64(r)*0.06 char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("stringless", -1), + Base: gmod.NewBase("stringless", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { switch atk.Info.AttackTag { case attacks.AttackTagElementalArt: diff --git a/internal/weapons/bow/thundering/thundering.go b/internal/weapons/bow/thundering/thundering.go index 3bac3a6151..79d0eef7f5 100644 --- a/internal/weapons/bow/thundering/thundering.go +++ b/internal/weapons/bow/thundering/thundering.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -65,7 +65,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) }, key) char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("thundering-pulse", -1), + Base: gmod.NewBase("thundering-pulse", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { m[attributes.DmgP] = 0 if atk.Info.AttackTag != attacks.AttackTagNormal { diff --git a/internal/weapons/bow/twilight/twilight.go b/internal/weapons/bow/twilight/twilight.go index 82508b8add..58d3a3c8f5 100644 --- a/internal/weapons/bow/twilight/twilight.go +++ b/internal/weapons/bow/twilight/twilight.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -34,7 +34,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m[attributes.DmgP] = base char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("twilight-bonus-dmg", -1), + Base: gmod.NewBase("twilight-bonus-dmg", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { switch cycle { case 2: diff --git a/internal/weapons/bow/windblume/windblume.go b/internal/weapons/bow/windblume/windblume.go index e14c99a8d7..3b55974dab 100644 --- a/internal/weapons/bow/windblume/windblume.go +++ b/internal/weapons/bow/windblume/windblume.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -35,7 +35,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) return false } char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("windblume", 360), + Base: gmod.NewBaseWithHitlag("windblume", 360), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/weapons/catalyst/athousandfloatingdreams/athousandfloatingdreams.go b/internal/weapons/catalyst/athousandfloatingdreams/athousandfloatingdreams.go index c60d53c80b..775bd720b8 100644 --- a/internal/weapons/catalyst/athousandfloatingdreams/athousandfloatingdreams.go +++ b/internal/weapons/catalyst/athousandfloatingdreams/athousandfloatingdreams.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -39,7 +39,7 @@ func (w *Weapon) Init() error { diffCount++ } char.AddStatMod(character.StatMod{ - Base: modifier.NewBase(fmt.Sprintf("a-thousand-floating-dreams-party-%v", w.self.Base.Key.String()), -1), + Base: gmod.NewBase(fmt.Sprintf("a-thousand-floating-dreams-party-%v", w.self.Base.Key.String()), -1), Amount: func() ([]float64, bool) { return w.teamBuff, true }, @@ -66,7 +66,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) w.teamBuff[attributes.EM] = 38 + float64(r)*2 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("a-thousand-floating-dreams", -1), + Base: gmod.NewBase("a-thousand-floating-dreams", -1), Amount: func() ([]float64, bool) { return w.buff, true }, diff --git a/internal/weapons/catalyst/balladoftheboundlessblue/balladoftheboundlessblue.go b/internal/weapons/catalyst/balladoftheboundlessblue/balladoftheboundlessblue.go index d8c4b3f69f..039437a6c8 100644 --- a/internal/weapons/catalyst/balladoftheboundlessblue/balladoftheboundlessblue.go +++ b/internal/weapons/catalyst/balladoftheboundlessblue/balladoftheboundlessblue.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -63,7 +63,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) switch atk.Info.AttackTag { case attacks.AttackTagNormal, attacks.AttackTagExtra: char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag(buffKey, 6*60), + Base: gmod.NewBaseWithHitlag(buffKey, 6*60), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { switch atk.Info.AttackTag { case attacks.AttackTagNormal: diff --git a/internal/weapons/catalyst/cashflow/cashflow.go b/internal/weapons/catalyst/cashflow/cashflow.go index 6b02b6e22e..654ec66780 100644 --- a/internal/weapons/catalyst/cashflow/cashflow.go +++ b/internal/weapons/catalyst/cashflow/cashflow.go @@ -12,7 +12,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -60,7 +60,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) val[attributes.ATKP] = atkp char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("cashflow-supervision-atkp", -1), + Base: gmod.NewBase("cashflow-supervision-atkp", -1), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return val, true @@ -125,7 +125,7 @@ func (w *Weapon) onChangeHP() { w.char.AddStatus(buffIcd, 0.3*60, true) w.char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag(buffKey, 4*60), + Base: gmod.NewBaseWithHitlag(buffKey, 4*60), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { w.buffNA[attributes.DmgP] = (0.12 + 0.04*float64(w.refine)) * float64(w.stacks) w.buffCA[attributes.DmgP] = (0.105 + 0.035*float64(w.refine)) * float64(w.stacks) @@ -141,7 +141,7 @@ func (w *Weapon) onChangeHP() { }) if w.stacks == 3 { w.char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(atkSpdKey, 4*60), + Base: gmod.NewBaseWithHitlag(atkSpdKey, 4*60), AffectedStat: attributes.AtkSpd, Amount: func() ([]float64, bool) { if w.core.Player.CurrentState() != action.NormalAttackState { diff --git a/internal/weapons/catalyst/cranesechoingcall/cranesechoingcall.go b/internal/weapons/catalyst/cranesechoingcall/cranesechoingcall.go index 58b71b0c04..d7a0734640 100644 --- a/internal/weapons/catalyst/cranesechoingcall/cranesechoingcall.go +++ b/internal/weapons/catalyst/cranesechoingcall/cranesechoingcall.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -59,7 +59,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) if atk.Info.ActorIndex == char.Index() { for _, char := range c.Player.Chars() { char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag(buffKey, buffDuration), + Base: gmod.NewBaseWithHitlag(buffKey, buffDuration), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagPlunge { return nil, false diff --git a/internal/weapons/catalyst/dodoco/dodoco.go b/internal/weapons/catalyst/dodoco/dodoco.go index 4dc8cf58ba..6063ea8918 100644 --- a/internal/weapons/catalyst/dodoco/dodoco.go +++ b/internal/weapons/catalyst/dodoco/dodoco.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -47,7 +47,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) switch atk.Info.AttackTag { case attacks.AttackTagNormal: char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag("dodoco-ca", 360), + Base: gmod.NewBaseWithHitlag("dodoco-ca", 360), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagExtra { return nil, false @@ -57,7 +57,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) }) case attacks.AttackTagExtra: char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("dodoco-atk", 360), + Base: gmod.NewBaseWithHitlag("dodoco-atk", 360), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return n, true diff --git a/internal/weapons/catalyst/emeraldorb/emeraldorb.go b/internal/weapons/catalyst/emeraldorb/emeraldorb.go index b0f0edeec4..fa2aa23457 100644 --- a/internal/weapons/catalyst/emeraldorb/emeraldorb.go +++ b/internal/weapons/catalyst/emeraldorb/emeraldorb.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -47,7 +47,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) // add buff char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("emeraldorb", 720), + Base: gmod.NewBaseWithHitlag("emeraldorb", 720), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/weapons/catalyst/eternalflow/eternalflow.go b/internal/weapons/catalyst/eternalflow/eternalflow.go index 9ef6b555f0..403e4edfdb 100644 --- a/internal/weapons/catalyst/eternalflow/eternalflow.go +++ b/internal/weapons/catalyst/eternalflow/eternalflow.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -53,7 +53,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) val := make([]float64, attributes.EndStatType) val[attributes.HPP] = hpp char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("eternalflow-hpp", -1), + Base: gmod.NewBase("eternalflow-hpp", -1), AffectedStat: attributes.HPP, Amount: func() ([]float64, bool) { return val, true @@ -113,7 +113,7 @@ func (w *Weapon) onChangeHP() { w.char.AddStatus(buffIcd, 0.3*60, true) w.char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag(buffKey, 4*60), + Base: gmod.NewBaseWithHitlag(buffKey, 4*60), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { w.buffCA[attributes.DmgP] = (0.10 + 0.04*float64(w.refine)) * float64(w.stacks) switch atk.Info.AttackTag { diff --git a/internal/weapons/catalyst/etherlightspindlelute/etherlightspindlelute.go b/internal/weapons/catalyst/etherlightspindlelute/etherlightspindlelute.go index 3561b33e0e..d3bced26bf 100644 --- a/internal/weapons/catalyst/etherlightspindlelute/etherlightspindlelute.go +++ b/internal/weapons/catalyst/etherlightspindlelute/etherlightspindlelute.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -34,7 +34,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) return false } char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("etherlight", 20*60), + Base: gmod.NewBaseWithHitlag("etherlight", 20*60), AffectedStat: attributes.EM, Amount: func() ([]float64, bool) { return val, true diff --git a/internal/weapons/catalyst/flowingpurity/flowingpurity.go b/internal/weapons/catalyst/flowingpurity/flowingpurity.go index 8e20b02f74..d7daac4fab 100644 --- a/internal/weapons/catalyst/flowingpurity/flowingpurity.go +++ b/internal/weapons/catalyst/flowingpurity/flowingpurity.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -58,7 +58,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) char.AddStatus(icdKey, icd, true) char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("flowingpurity-eledmg-boost", duration), + Base: gmod.NewBaseWithHitlag("flowingpurity-eledmg-boost", duration), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return m, true @@ -97,7 +97,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) char.DeleteStatus(bondKey) char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("flowingpurity-bond-eledmg-boost", duration), + Base: gmod.NewBaseWithHitlag("flowingpurity-bond-eledmg-boost", duration), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return bond, true diff --git a/internal/weapons/catalyst/fruitoffulfillment/fruitoffulfillment.go b/internal/weapons/catalyst/fruitoffulfillment/fruitoffulfillment.go index c5a28aaacc..c576d9783a 100644 --- a/internal/weapons/catalyst/fruitoffulfillment/fruitoffulfillment.go +++ b/internal/weapons/catalyst/fruitoffulfillment/fruitoffulfillment.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -51,7 +51,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m := make([]float64, attributes.EndStatType) w.char.AddStatMod(character.StatMod{ - Base: modifier.NewBase(buffKey, -1), + Base: gmod.NewBase(buffKey, -1), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { m[attributes.EM] = em * float64(w.stacks) diff --git a/internal/weapons/catalyst/hakushin/hakushin.go b/internal/weapons/catalyst/hakushin/hakushin.go index 353562b10c..1452dacc29 100644 --- a/internal/weapons/catalyst/hakushin/hakushin.go +++ b/internal/weapons/catalyst/hakushin/hakushin.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -72,7 +72,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) stat := attributes.EleToDmgP(charEle) other.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(fmt.Sprintf(buffKey, charEle), 6*60), + Base: gmod.NewBaseWithHitlag(fmt.Sprintf(buffKey, charEle), 6*60), AffectedStat: stat, Amount: func() ([]float64, bool) { clear(m) diff --git a/internal/weapons/catalyst/jadefallssplendor/jadefallssplendor.go b/internal/weapons/catalyst/jadefallssplendor/jadefallssplendor.go index b8b4bb0a53..6ac49a7520 100644 --- a/internal/weapons/catalyst/jadefallssplendor/jadefallssplendor.go +++ b/internal/weapons/catalyst/jadefallssplendor/jadefallssplendor.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/core/player/shield" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -57,7 +57,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m := make([]float64, attributes.EndStatType) m[stat] = finalDmg char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(buffKey, buffDuration), + Base: gmod.NewBaseWithHitlag(buffKey, buffDuration), AffectedStat: stat, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/weapons/catalyst/kagura/kagura.go b/internal/weapons/catalyst/kagura/kagura.go index 8499091093..2cd732ab63 100644 --- a/internal/weapons/catalyst/kagura/kagura.go +++ b/internal/weapons/catalyst/kagura/kagura.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -74,7 +74,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) } // add mod for duration, override last char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag("kaguras-verity", stackDuration), + Base: gmod.NewBaseWithHitlag("kaguras-verity", stackDuration), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.ActorIndex != char.Index() { return nil, false diff --git a/internal/weapons/catalyst/magicguide/magicguide.go b/internal/weapons/catalyst/magicguide/magicguide.go index 108f1d0434..465e490520 100644 --- a/internal/weapons/catalyst/magicguide/magicguide.go +++ b/internal/weapons/catalyst/magicguide/magicguide.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -26,7 +26,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) r := p.Refine m := make([]float64, attributes.EndStatType) char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("magic-guide", -1), + Base: gmod.NewBase("magic-guide", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { x, ok := t.(*enemy.Enemy) if !ok { diff --git a/internal/weapons/catalyst/mappa/mappa.go b/internal/weapons/catalyst/mappa/mappa.go index 69c27fdd60..288cc6dc2f 100644 --- a/internal/weapons/catalyst/mappa/mappa.go +++ b/internal/weapons/catalyst/mappa/mappa.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -58,7 +58,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m[attributes.DendroP] = dmg * float64(w.stacks) char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(buffKey, buffDuration), + Base: gmod.NewBaseWithHitlag(buffKey, buffDuration), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/weapons/catalyst/moonglow/moonglow.go b/internal/weapons/catalyst/moonglow/moonglow.go index 1a0849e875..8f555467d8 100644 --- a/internal/weapons/catalyst/moonglow/moonglow.go +++ b/internal/weapons/catalyst/moonglow/moonglow.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -32,7 +32,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) mheal := make([]float64, attributes.EndStatType) mheal[attributes.Heal] = 0.075 + float64(r)*0.025 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("moonglow-heal-bonus", -1), + Base: gmod.NewBase("moonglow-heal-bonus", -1), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return mheal, true diff --git a/internal/weapons/catalyst/oathsworneye/oathsworneye.go b/internal/weapons/catalyst/oathsworneye/oathsworneye.go index 1c18ad14c7..69b8f706e6 100644 --- a/internal/weapons/catalyst/oathsworneye/oathsworneye.go +++ b/internal/weapons/catalyst/oathsworneye/oathsworneye.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -34,7 +34,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) return false } char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("oathsworn", 10*60), + Base: gmod.NewBaseWithHitlag("oathsworn", 10*60), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return val, true diff --git a/internal/weapons/catalyst/prayer/prayer.go b/internal/weapons/catalyst/prayer/prayer.go index b446fbc0ff..6ce1298ae4 100644 --- a/internal/weapons/catalyst/prayer/prayer.go +++ b/internal/weapons/catalyst/prayer/prayer.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -79,7 +79,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) }, fmt.Sprintf("lostprayer-%v", char.Base.Key.String())) char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("lost-prayer", -1), + Base: gmod.NewBase("lost-prayer", -1), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { if w.stacks == 0 { diff --git a/internal/weapons/catalyst/ringofyaxche/ringofyaxche.go b/internal/weapons/catalyst/ringofyaxche/ringofyaxche.go index 12e1436277..3734e1d0df 100644 --- a/internal/weapons/catalyst/ringofyaxche/ringofyaxche.go +++ b/internal/weapons/catalyst/ringofyaxche/ringofyaxche.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -43,7 +43,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) buffAmt := min(maxBuff, char.MaxHP()*0.001*buffBy) m := make([]float64, attributes.EndStatType) char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("ring-of-yaxche", 10*60), + Base: gmod.NewBase("ring-of-yaxche", 10*60), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagNormal { return nil, false diff --git a/internal/weapons/catalyst/sacrificialjade/sacrificialjade.go b/internal/weapons/catalyst/sacrificialjade/sacrificialjade.go index 40d2402d1f..391f91b8c9 100644 --- a/internal/weapons/catalyst/sacrificialjade/sacrificialjade.go +++ b/internal/weapons/catalyst/sacrificialjade/sacrificialjade.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -51,7 +51,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) } w.char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("sacrificial-jade", -1), + Base: gmod.NewBase("sacrificial-jade", -1), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return w.buff, true diff --git a/internal/weapons/catalyst/skyward/skyward.go b/internal/weapons/catalyst/skyward/skyward.go index 8eef7821c2..217fb8810a 100644 --- a/internal/weapons/catalyst/skyward/skyward.go +++ b/internal/weapons/catalyst/skyward/skyward.go @@ -12,7 +12,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -95,7 +95,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m[attributes.GeoP] = dmg m[attributes.DendroP] = dmg char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("skyward-atlas", -1), + Base: gmod.NewBase("skyward-atlas", -1), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/weapons/catalyst/solar/solar.go b/internal/weapons/catalyst/solar/solar.go index 3700a5c8b6..e1c422239a 100644 --- a/internal/weapons/catalyst/solar/solar.go +++ b/internal/weapons/catalyst/solar/solar.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -42,7 +42,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) switch atk.Info.AttackTag { case attacks.AttackTagElementalArt, attacks.AttackTagElementalArtHold, attacks.AttackTagElementalBurst: char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag("solar-na-buff", 6*60), + Base: gmod.NewBaseWithHitlag("solar-na-buff", 6*60), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag == attacks.AttackTagNormal { return val, true @@ -53,7 +53,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) case attacks.AttackTagNormal: char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag("solar-skill-burst-buff", 6*60), + Base: gmod.NewBaseWithHitlag("solar-skill-burst-buff", 6*60), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { switch atk.Info.AttackTag { case attacks.AttackTagElementalArt, attacks.AttackTagElementalArtHold, attacks.AttackTagElementalBurst: diff --git a/internal/weapons/catalyst/starcallerswatch/starcallerswatch.go b/internal/weapons/catalyst/starcallerswatch/starcallerswatch.go index 3cd7becb42..4838ab74ab 100644 --- a/internal/weapons/catalyst/starcallerswatch/starcallerswatch.go +++ b/internal/weapons/catalyst/starcallerswatch/starcallerswatch.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/core/player/shield" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -40,7 +40,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m[attributes.EM] = 75.0 + 25.0*r char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("starcallerswatch-em", -1), + Base: gmod.NewBase("starcallerswatch-em", -1), Amount: func() ([]float64, bool) { return m, true }, @@ -79,7 +79,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) for _, x := range c.Player.Chars() { this := x this.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase(buffKey, -1), + Base: gmod.NewBase(buffKey, -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if c.Player.Active() != this.Index() { return nil, false diff --git a/internal/weapons/catalyst/sunnymorning/sunnymorning.go b/internal/weapons/catalyst/sunnymorning/sunnymorning.go index ae1e494076..565278ff4e 100644 --- a/internal/weapons/catalyst/sunnymorning/sunnymorning.go +++ b/internal/weapons/catalyst/sunnymorning/sunnymorning.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -75,7 +75,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) frameSwirlBuffApplied = c.F char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("sunny-morning-swirl", 6*60), + Base: gmod.NewBaseWithHitlag("sunny-morning-swirl", 6*60), Amount: func() ([]float64, bool) { return w.emBuffSwirl, true }, @@ -97,7 +97,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) } char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("sunny-morning-skill", 9*60), + Base: gmod.NewBaseWithHitlag("sunny-morning-skill", 9*60), Amount: func() ([]float64, bool) { return w.emBuffSkill, true }, @@ -118,7 +118,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) } char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("sunny-morning-burst", 30*60), + Base: gmod.NewBase("sunny-morning-burst", 30*60), Amount: func() ([]float64, bool) { return w.emBuffBurst, true }, diff --git a/internal/weapons/catalyst/surfsup/surfsup.go b/internal/weapons/catalyst/surfsup/surfsup.go index e42c9996d7..a03a491754 100644 --- a/internal/weapons/catalyst/surfsup/surfsup.go +++ b/internal/weapons/catalyst/surfsup/surfsup.go @@ -12,7 +12,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -51,7 +51,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) mHP := make([]float64, attributes.EndStatType) mHP[attributes.HPP] = 0.15 + float64(r)*0.05 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("surfs-up-hp%", -1), + Base: gmod.NewBase("surfs-up-hp%", -1), AffectedStat: attributes.HPP, Amount: func() ([]float64, bool) { return mHP, true @@ -71,7 +71,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) w.stacks = 4 char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag(buffKey, 14*60), + Base: gmod.NewBaseWithHitlag(buffKey, 14*60), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag == attacks.AttackTagNormal { mNA[attributes.DmgP] = dmgPerStack * float64(min(w.stacks, 4)) diff --git a/internal/weapons/catalyst/thrilling/thrilling.go b/internal/weapons/catalyst/thrilling/thrilling.go index 5dca15dabd..8fc9396415 100644 --- a/internal/weapons/catalyst/thrilling/thrilling.go +++ b/internal/weapons/catalyst/thrilling/thrilling.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -61,7 +61,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) return false } active.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("ttds", 600), + Base: gmod.NewBaseWithHitlag("ttds", 600), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/weapons/catalyst/tulaytullahsremembrance/tulaytullahsremembrance.go b/internal/weapons/catalyst/tulaytullahsremembrance/tulaytullahsremembrance.go index 50ab27002c..a4934c7471 100644 --- a/internal/weapons/catalyst/tulaytullahsremembrance/tulaytullahsremembrance.go +++ b/internal/weapons/catalyst/tulaytullahsremembrance/tulaytullahsremembrance.go @@ -12,7 +12,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -50,7 +50,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) mAtkSpd := make([]float64, attributes.EndStatType) mAtkSpd[attributes.AtkSpd] = 0.075 + float64(r)*0.025 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase(atkSpdKey, -1), + Base: gmod.NewBase(atkSpdKey, -1), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { if c.Player.CurrentState() != action.NormalAttackState { @@ -77,7 +77,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) char.QueueCharTask(w.incStack(char, c.F), 60) char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag(buffKey, 14*60), + Base: gmod.NewBaseWithHitlag(buffKey, 14*60), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagNormal { return nil, false diff --git a/internal/weapons/catalyst/twin/twin.go b/internal/weapons/catalyst/twin/twin.go index aeaac6a03e..c53fef10fc 100644 --- a/internal/weapons/catalyst/twin/twin.go +++ b/internal/weapons/catalyst/twin/twin.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -49,7 +49,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) } // add buff char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("twinnephrite", 900), // 15s + Base: gmod.NewBaseWithHitlag("twinnephrite", 900), // 15s AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/weapons/catalyst/vividnotions/vividnotions.go b/internal/weapons/catalyst/vividnotions/vividnotions.go index d87d3075bd..224e9b7437 100644 --- a/internal/weapons/catalyst/vividnotions/vividnotions.go +++ b/internal/weapons/catalyst/vividnotions/vividnotions.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -37,7 +37,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m := make([]float64, attributes.EndStatType) m[attributes.ATKP] = 0.21 + float64(r)*0.07 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("vividnotions-atk", -1), + Base: gmod.NewBase("vividnotions-atk", -1), Amount: func() ([]float64, bool) { return m, true }, @@ -48,7 +48,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) skillBurstCD := 0.3 + float64(r)*0.1 char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("vividnotions-cd", -1), + Base: gmod.NewBase("vividnotions-cd", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagPlunge { return nil, false diff --git a/internal/weapons/catalyst/wanderingevenstar/wanderingevenstar.go b/internal/weapons/catalyst/wanderingevenstar/wanderingevenstar.go index c26c353b98..1025ca6ead 100644 --- a/internal/weapons/catalyst/wanderingevenstar/wanderingevenstar.go +++ b/internal/weapons/catalyst/wanderingevenstar/wanderingevenstar.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -48,7 +48,7 @@ func (w *Weapon) updateStats() { val := make([]float64, attributes.EndStatType) val[attributes.ATK] = w.atkBuff * w.char.NonExtraStat(attributes.EM) w.char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("wanderingevenstar", 12*60), + Base: gmod.NewBaseWithHitlag("wanderingevenstar", 12*60), AffectedStat: attributes.ATK, Extra: true, Amount: func() ([]float64, bool) { @@ -64,7 +64,7 @@ func (w *Weapon) updateStats() { } this.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(fmt.Sprintf("wanderingevenstar-%v", w.char.Base.Key.String()), 12*60), + Base: gmod.NewBaseWithHitlag(fmt.Sprintf("wanderingevenstar-%v", w.char.Base.Key.String()), 12*60), AffectedStat: attributes.ATK, Extra: true, Amount: func() ([]float64, bool) { diff --git a/internal/weapons/catalyst/waveridingwhirl/waveridingwhirl.go b/internal/weapons/catalyst/waveridingwhirl/waveridingwhirl.go index 9c932b7a86..5851f57bd2 100644 --- a/internal/weapons/catalyst/waveridingwhirl/waveridingwhirl.go +++ b/internal/weapons/catalyst/waveridingwhirl/waveridingwhirl.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -60,7 +60,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) char.AddStatus(buffICD, ICDDur, true) char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(buffKey, buffDur), + Base: gmod.NewBaseWithHitlag(buffKey, buffDur), AffectedStat: attributes.HPP, Amount: func() ([]float64, bool) { return val, true diff --git a/internal/weapons/catalyst/widsith/widsith.go b/internal/weapons/catalyst/widsith/widsith.go index fe34bd4751..a4f5ed884f 100644 --- a/internal/weapons/catalyst/widsith/widsith.go +++ b/internal/weapons/catalyst/widsith/widsith.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -66,7 +66,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) expiry := c.F + 60*10 char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("widsith", 600), + Base: gmod.NewBaseWithHitlag("widsith", 600), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { // sanity check; should never happen diff --git a/internal/weapons/catalyst/wine/wine.go b/internal/weapons/catalyst/wine/wine.go index 2c6d511402..b185d36d4d 100644 --- a/internal/weapons/catalyst/wine/wine.go +++ b/internal/weapons/catalyst/wine/wine.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -42,7 +42,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) return false } char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("wineandsong", 60*5), + Base: gmod.NewBaseWithHitlag("wineandsong", 60*5), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/weapons/claymore/aquamarine/aquamarine.go b/internal/weapons/claymore/aquamarine/aquamarine.go index 937e82aed9..1b45d60bce 100644 --- a/internal/weapons/claymore/aquamarine/aquamarine.go +++ b/internal/weapons/claymore/aquamarine/aquamarine.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -48,7 +48,7 @@ func (w *Weapon) updateStats() { val := make([]float64, attributes.EndStatType) val[attributes.ATK] = w.atkBuff * w.char.NonExtraStat(attributes.EM) w.char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("aquamarine", 12*60), + Base: gmod.NewBaseWithHitlag("aquamarine", 12*60), AffectedStat: attributes.ATK, Extra: true, Amount: func() ([]float64, bool) { @@ -64,7 +64,7 @@ func (w *Weapon) updateStats() { } this.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(fmt.Sprintf("aquamarine-%v", w.char.Base.Key.String()), 12*60), + Base: gmod.NewBaseWithHitlag(fmt.Sprintf("aquamarine-%v", w.char.Base.Key.String()), 12*60), AffectedStat: attributes.ATK, Extra: true, Amount: func() ([]float64, bool) { diff --git a/internal/weapons/claymore/athousandblazingsuns/athousandblazingsuns.go b/internal/weapons/claymore/athousandblazingsuns/athousandblazingsuns.go index 1082aa7852..f6ae76c988 100644 --- a/internal/weapons/claymore/athousandblazingsuns/athousandblazingsuns.go +++ b/internal/weapons/claymore/athousandblazingsuns/athousandblazingsuns.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -75,7 +75,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) w.extended = 0 char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(BuffKey, BuffDur), + Base: gmod.NewBaseWithHitlag(BuffKey, BuffDur), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { m[attributes.ATKP] = 0.21 + 0.07*r diff --git a/internal/weapons/claymore/beacon/beacon.go b/internal/weapons/claymore/beacon/beacon.go index 352c8db582..0f93b4a144 100644 --- a/internal/weapons/claymore/beacon/beacon.go +++ b/internal/weapons/claymore/beacon/beacon.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -42,7 +42,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) mHP := make([]float64, attributes.EndStatType) mHP[attributes.HPP] = 0.24 + float64(r)*.08 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("beacon-of-the-reed-sea-hp", -1), + Base: gmod.NewBase("beacon-of-the-reed-sea-hp", -1), AffectedStat: attributes.HPP, Amount: func() ([]float64, bool) { if c.Player.Shields.CharacterIsShielded(char.Index(), c.Player.Active()) { @@ -64,7 +64,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) } char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(skillKey, stackDuration), + Base: gmod.NewBaseWithHitlag(skillKey, stackDuration), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return mATK, true @@ -87,7 +87,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) } char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(damagedKey, stackDuration), + Base: gmod.NewBaseWithHitlag(damagedKey, stackDuration), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return mATK, true diff --git a/internal/weapons/claymore/bell/bell.go b/internal/weapons/claymore/bell/bell.go index 424674fdb7..54cc3690f3 100644 --- a/internal/weapons/claymore/bell/bell.go +++ b/internal/weapons/claymore/bell/bell.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/core/player/shield" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -64,7 +64,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) // add damage if shielded char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("bell", -1), + Base: gmod.NewBase("bell", -1), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return val, c.Player.Shields.CharacterIsShielded(char.Index(), c.Player.Active()) diff --git a/internal/weapons/claymore/bloodtainted/bloodtainted.go b/internal/weapons/claymore/bloodtainted/bloodtainted.go index d1064cb10f..5730f090d0 100644 --- a/internal/weapons/claymore/bloodtainted/bloodtainted.go +++ b/internal/weapons/claymore/bloodtainted/bloodtainted.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -30,7 +30,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = dmg char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("bloodtaintedgreatsword", -1), + Base: gmod.NewBase("bloodtaintedgreatsword", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { x, ok := t.(*enemy.Enemy) if !ok { diff --git a/internal/weapons/claymore/earthshaker/earthshaker.go b/internal/weapons/claymore/earthshaker/earthshaker.go index fc00ba31ca..8b106fdc6f 100644 --- a/internal/weapons/claymore/earthshaker/earthshaker.go +++ b/internal/weapons/claymore/earthshaker/earthshaker.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -38,7 +38,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) buffSkill := func(...any) bool { char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag("earth-shaker", 8*60), + Base: gmod.NewBaseWithHitlag("earth-shaker", 8*60), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagElementalArt && atk.Info.AttackTag != attacks.AttackTagElementalArtHold { return nil, false diff --git a/internal/weapons/claymore/fangofthemountainking/fangofthemountainking.go b/internal/weapons/claymore/fangofthemountainking/fangofthemountainking.go index a0582f935a..05f5e49316 100644 --- a/internal/weapons/claymore/fangofthemountainking/fangofthemountainking.go +++ b/internal/weapons/claymore/fangofthemountainking/fangofthemountainking.go @@ -12,7 +12,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/core/stacks" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -102,7 +102,7 @@ func (w *Weapon) addStacks(num int) { } w.char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag(canopyFavorKey, stackDuration), + Base: gmod.NewBaseWithHitlag(canopyFavorKey, stackDuration), Amount: func(a *info.AttackEvent, t info.Target) ([]float64, bool) { switch a.Info.AttackTag { case attacks.AttackTagElementalArt: diff --git a/internal/weapons/claymore/ferrousshadow/ferrousshadow.go b/internal/weapons/claymore/ferrousshadow/ferrousshadow.go index aa4fec69d8..493944cdb5 100644 --- a/internal/weapons/claymore/ferrousshadow/ferrousshadow.go +++ b/internal/weapons/claymore/ferrousshadow/ferrousshadow.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -32,7 +32,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) hpCheck := 0.65 + float64(r)*0.05 char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("ferrousshadow", -1), + Base: gmod.NewBase("ferrousshadow", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { // don't apply buff if not Charged Attack if atk.Info.AttackTag != attacks.AttackTagExtra { diff --git a/internal/weapons/claymore/forestregalia/forestregalia.go b/internal/weapons/claymore/forestregalia/forestregalia.go index b7d5c48b32..a23dfe0e4f 100644 --- a/internal/weapons/claymore/forestregalia/forestregalia.go +++ b/internal/weapons/claymore/forestregalia/forestregalia.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -73,7 +73,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) c.Tasks.Add(func() { active := c.Player.ActiveChar() active.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(buffKey, 720), + Base: gmod.NewBaseWithHitlag(buffKey, 720), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/weapons/claymore/fruitfulhook/fruitfulhook.go b/internal/weapons/claymore/fruitfulhook/fruitfulhook.go index f6445eb63a..b1b8e59afd 100644 --- a/internal/weapons/claymore/fruitfulhook/fruitfulhook.go +++ b/internal/weapons/claymore/fruitfulhook/fruitfulhook.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -34,7 +34,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) mCR := make([]float64, attributes.EndStatType) mCR[attributes.CR] = 0.12 + 0.04*float64(r) char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("fruitful-hook-cr", -1), + Base: gmod.NewBase("fruitful-hook-cr", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag == attacks.AttackTagPlunge { return mCR, true @@ -55,7 +55,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) return false } char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag("fruitful-hook-dmg%", 10*60), + Base: gmod.NewBaseWithHitlag("fruitful-hook-dmg%", 10*60), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { switch atk.Info.AttackTag { case attacks.AttackTagNormal: diff --git a/internal/weapons/claymore/mailedflower/mailedflower.go b/internal/weapons/claymore/mailedflower/mailedflower.go index c270473954..fd6a44d0a3 100644 --- a/internal/weapons/claymore/mailedflower/mailedflower.go +++ b/internal/weapons/claymore/mailedflower/mailedflower.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -40,7 +40,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) } char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("mailedflower", 8*60), + Base: gmod.NewBaseWithHitlag("mailedflower", 8*60), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/weapons/claymore/nagamasa/nagamasa.go b/internal/weapons/claymore/nagamasa/nagamasa.go index be7df33a9d..57e9e7e697 100644 --- a/internal/weapons/claymore/nagamasa/nagamasa.go +++ b/internal/weapons/claymore/nagamasa/nagamasa.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -38,7 +38,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m[attributes.DmgP] = base char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("nagamasa-skill-dmg-buff", -1), + Base: gmod.NewBase("nagamasa-skill-dmg-buff", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag == attacks.AttackTagElementalArt || atk.Info.AttackTag == attacks.AttackTagElementalArtHold { return m, true diff --git a/internal/weapons/claymore/pines/pines.go b/internal/weapons/claymore/pines/pines.go index d7d890e064..767aa85c55 100644 --- a/internal/weapons/claymore/pines/pines.go +++ b/internal/weapons/claymore/pines/pines.go @@ -12,7 +12,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -43,7 +43,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m := make([]float64, attributes.EndStatType) m[attributes.ATKP] = 0.12 + float64(r)*0.04 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("pines-atk", -1), + Base: gmod.NewBase("pines-atk", -1), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return m, true @@ -88,7 +88,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) char.AddStatus(cdKey, cd, true) for _, char := range c.Player.Chars() { char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("pines-proc", buffDuration), + Base: gmod.NewBaseWithHitlag("pines-proc", buffDuration), AffectedStat: attributes.AtkSpd, Amount: func() ([]float64, bool) { if c.Player.CurrentState() != action.NormalAttackState { @@ -98,7 +98,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) }, }) char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(common.MillennialKey, buffDuration), + Base: gmod.NewBaseWithHitlag(common.MillennialKey, buffDuration), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return sharedVal, true diff --git a/internal/weapons/claymore/powersaw/powersaw.go b/internal/weapons/claymore/powersaw/powersaw.go index c2dcc1706f..c015774b06 100644 --- a/internal/weapons/claymore/powersaw/powersaw.go +++ b/internal/weapons/claymore/powersaw/powersaw.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -96,7 +96,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) // add em buff m[attributes.EM] = em * float64(count) char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(buffKey, buffDuration), + Base: gmod.NewBaseWithHitlag(buffKey, buffDuration), AffectedStat: attributes.EM, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/weapons/claymore/rainslasher/rainslasher.go b/internal/weapons/claymore/rainslasher/rainslasher.go index 1457505a9f..4994b399a9 100644 --- a/internal/weapons/claymore/rainslasher/rainslasher.go +++ b/internal/weapons/claymore/rainslasher/rainslasher.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -28,7 +28,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m[attributes.DmgP] = 0.16 + float64(r)*0.04 char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("rainslasher", -1), + Base: gmod.NewBase("rainslasher", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { x, ok := t.(*enemy.Enemy) if !ok { diff --git a/internal/weapons/claymore/redhorn/redhorn.go b/internal/weapons/claymore/redhorn/redhorn.go index 147a811744..cd3b1ec4b2 100644 --- a/internal/weapons/claymore/redhorn/redhorn.go +++ b/internal/weapons/claymore/redhorn/redhorn.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -34,7 +34,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) val := make([]float64, attributes.EndStatType) val[attributes.DEFP] = defBoost char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("redhorn-stonethrasher-def-boost", -1), + Base: gmod.NewBase("redhorn-stonethrasher-def-boost", -1), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return val, true diff --git a/internal/weapons/claymore/sealord/sealord.go b/internal/weapons/claymore/sealord/sealord.go index 4ca6e29edd..8c04f1fd74 100644 --- a/internal/weapons/claymore/sealord/sealord.go +++ b/internal/weapons/claymore/sealord/sealord.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -37,7 +37,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) val := make([]float64, attributes.EndStatType) val[attributes.DmgP] = burstDmgIncrease char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("luxurious-sea-lord", -1), + Base: gmod.NewBase("luxurious-sea-lord", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag == attacks.AttackTagElementalBurst { return val, true diff --git a/internal/weapons/claymore/skyrider/skyrider.go b/internal/weapons/claymore/skyrider/skyrider.go index a1524891e1..f08ed678cb 100644 --- a/internal/weapons/claymore/skyrider/skyrider.go +++ b/internal/weapons/claymore/skyrider/skyrider.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -66,7 +66,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) // every whack adds a stack while under 4 and refreshes buff // lasts 6 seconds char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("skyrider", 360), + Base: gmod.NewBaseWithHitlag("skyrider", 360), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return w.buff, true diff --git a/internal/weapons/claymore/skyward/skyward.go b/internal/weapons/claymore/skyward/skyward.go index fcd5ca6cab..f21f444763 100644 --- a/internal/weapons/claymore/skyward/skyward.go +++ b/internal/weapons/claymore/skyward/skyward.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -36,7 +36,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = 0.06 + float64(r)*0.02 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("skyward pride", -1), + Base: gmod.NewBase("skyward pride", -1), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/weapons/claymore/spine/spine.go b/internal/weapons/claymore/spine/spine.go index 2c33001d24..4345b45ca9 100644 --- a/internal/weapons/claymore/spine/spine.go +++ b/internal/weapons/claymore/spine/spine.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -105,7 +105,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) }, fmt.Sprintf("spine-%v", char.Base.Key.String())) char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("spine", -1), + Base: gmod.NewBase("spine", -1), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return w.buff, w.stacks > 0 diff --git a/internal/weapons/claymore/tidalshadow/tidalshadow.go b/internal/weapons/claymore/tidalshadow/tidalshadow.go index dc84f41df4..dc8efa3b2d 100644 --- a/internal/weapons/claymore/tidalshadow/tidalshadow.go +++ b/internal/weapons/claymore/tidalshadow/tidalshadow.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -39,7 +39,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) return false } char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("tidal-shadow-atk-boost", duration), + Base: gmod.NewBaseWithHitlag("tidal-shadow-atk-boost", duration), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return val, true diff --git a/internal/weapons/claymore/ultimateoverlordsmegamagicsword/ultimateoverlordsmegamagicsword.go b/internal/weapons/claymore/ultimateoverlordsmegamagicsword/ultimateoverlordsmegamagicsword.go index a86bd1c796..b54d8e87e9 100644 --- a/internal/weapons/claymore/ultimateoverlordsmegamagicsword/ultimateoverlordsmegamagicsword.go +++ b/internal/weapons/claymore/ultimateoverlordsmegamagicsword/ultimateoverlordsmegamagicsword.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -43,7 +43,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m := make([]float64, attributes.EndStatType) m[attributes.ATKP] = (0.09 + float64(r)*0.03) * (1 + additional) char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("ultimateoverlordsmegamagicsword", -1), + Base: gmod.NewBase("ultimateoverlordsmegamagicsword", -1), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/weapons/claymore/verdict/verdict.go b/internal/weapons/claymore/verdict/verdict.go index 662cdf859f..3b2434df08 100644 --- a/internal/weapons/claymore/verdict/verdict.go +++ b/internal/weapons/claymore/verdict/verdict.go @@ -12,7 +12,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/core/player/shield" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -46,7 +46,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m := make([]float64, attributes.EndStatType) m[attributes.ATKP] = 0.15 + float64(r)*0.05 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("verdict-atk", -1), + Base: gmod.NewBase("verdict-atk", -1), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/weapons/claymore/whiteblind/whiteblind.go b/internal/weapons/claymore/whiteblind/whiteblind.go index 078a24f2bc..254b30f318 100644 --- a/internal/weapons/claymore/whiteblind/whiteblind.go +++ b/internal/weapons/claymore/whiteblind/whiteblind.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -65,7 +65,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) // refresh mod char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("whiteblind", 360), + Base: gmod.NewBaseWithHitlag("whiteblind", 360), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return w.buff, true diff --git a/internal/weapons/claymore/wolf/wolf.go b/internal/weapons/claymore/wolf/wolf.go index 010fe4557e..fb47590d54 100644 --- a/internal/weapons/claymore/wolf/wolf.go +++ b/internal/weapons/claymore/wolf/wolf.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -35,7 +35,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) val := make([]float64, attributes.EndStatType) val[attributes.ATKP] = 0.15 + 0.05*float64(r) char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("wolf-flat", -1), + Base: gmod.NewBase("wolf-flat", -1), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return val, true @@ -74,7 +74,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) for _, char := range c.Player.Chars() { char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("wolf-proc", 720), + Base: gmod.NewBaseWithHitlag("wolf-proc", 720), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return bonus, true diff --git a/internal/weapons/common/blackcliff.go b/internal/weapons/common/blackcliff.go index 57b9926226..bd007d8f39 100644 --- a/internal/weapons/common/blackcliff.go +++ b/internal/weapons/common/blackcliff.go @@ -9,8 +9,8 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" + "github.com/genshinsim/gcsim/pkg/gmod" "github.com/genshinsim/gcsim/pkg/model" - "github.com/genshinsim/gcsim/pkg/modifier" ) type Blackcliff struct { @@ -68,7 +68,7 @@ func (b *Blackcliff) NewWeapon(c *core.Core, char *character.CharWrapper, p info char.AddStatus(stackKey[index], 1800, true) // update buff char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("blackcliff", 1800), + Base: gmod.NewBaseWithHitlag("blackcliff", 1800), AffectedStat: attributes.ATKP, Amount: amtfn, }) diff --git a/internal/weapons/common/goldenmajesty.go b/internal/weapons/common/goldenmajesty.go index 7bec8ae43f..b753672855 100644 --- a/internal/weapons/common/goldenmajesty.go +++ b/internal/weapons/common/goldenmajesty.go @@ -8,8 +8,8 @@ import ( "github.com/genshinsim/gcsim/pkg/core/event" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" + "github.com/genshinsim/gcsim/pkg/gmod" "github.com/genshinsim/gcsim/pkg/model" - "github.com/genshinsim/gcsim/pkg/modifier" ) type GoldenMajesty struct { @@ -63,7 +63,7 @@ func (g *GoldenMajesty) NewWeapon(c *core.Core, char *character.CharWrapper, p i } char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(buffKey, 60*8), + Base: gmod.NewBaseWithHitlag(buffKey, 60*8), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { m[attributes.ATKP] = atkbuff * float64(stacks) diff --git a/internal/weapons/common/lithic.go b/internal/weapons/common/lithic.go index c54f0637b7..2709019c7d 100644 --- a/internal/weapons/common/lithic.go +++ b/internal/weapons/common/lithic.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/model" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) type Lithic struct { @@ -43,7 +43,7 @@ func (l *Lithic) NewWeapon(c *core.Core, char *character.CharWrapper, p info.Wea return true }, fmt.Sprintf("lithic-%v", char.Base.Key.String())) char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("lithic", -1), + Base: gmod.NewBase("lithic", -1), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return val, true diff --git a/internal/weapons/common/royal.go b/internal/weapons/common/royal.go index 27c0b4d27e..691efc1e92 100644 --- a/internal/weapons/common/royal.go +++ b/internal/weapons/common/royal.go @@ -9,8 +9,8 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" + "github.com/genshinsim/gcsim/pkg/gmod" "github.com/genshinsim/gcsim/pkg/model" - "github.com/genshinsim/gcsim/pkg/modifier" ) const icdKey = "royal-icd" @@ -60,7 +60,7 @@ func (r *Royal) NewWeapon(c *core.Core, char *character.CharWrapper, p info.Weap rate := 0.06 + float64(refine)*0.02 m := make([]float64, attributes.EndStatType) char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("royal", -1), + Base: gmod.NewBase("royal", -1), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { m[attributes.CR] = float64(stacks) * rate diff --git a/internal/weapons/common/wavebreaker.go b/internal/weapons/common/wavebreaker.go index f7dce9a72a..8cdb0755f9 100644 --- a/internal/weapons/common/wavebreaker.go +++ b/internal/weapons/common/wavebreaker.go @@ -10,8 +10,8 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/player/character" + "github.com/genshinsim/gcsim/pkg/gmod" "github.com/genshinsim/gcsim/pkg/model" - "github.com/genshinsim/gcsim/pkg/modifier" ) type Wavebreaker struct { @@ -54,7 +54,7 @@ func (w *Wavebreaker) NewWeapon(c *core.Core, char *character.CharWrapper, p inf m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = amt char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("wavebreaker", -1), + Base: gmod.NewBase("wavebreaker", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag == attacks.AttackTagElementalBurst { return m, true diff --git a/internal/weapons/spear/balladofthefjords/balladofthefjords.go b/internal/weapons/spear/balladofthefjords/balladofthefjords.go index dbc8c09994..3aa9d0915f 100644 --- a/internal/weapons/spear/balladofthefjords/balladofthefjords.go +++ b/internal/weapons/spear/balladofthefjords/balladofthefjords.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -36,7 +36,7 @@ func (w *Weapon) Init() error { m := make([]float64, attributes.EndStatType) m[attributes.EM] = em w.char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("balladofthefjords", -1), + Base: gmod.NewBase("balladofthefjords", -1), AffectedStat: attributes.EM, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/weapons/spear/calamity/calamity.go b/internal/weapons/spear/calamity/calamity.go index cbba42fb94..ab0964e1c4 100644 --- a/internal/weapons/spear/calamity/calamity.go +++ b/internal/weapons/spear/calamity/calamity.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -78,7 +78,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m[attributes.GeoP] = dmg m[attributes.DendroP] = dmg char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("calamity-dmg", -1), + Base: gmod.NewBase("calamity-dmg", -1), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return m, true @@ -104,7 +104,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) char.QueueCharTask(w.incStacks(), w.icd) char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(buffKey, buffDuration), + Base: gmod.NewBaseWithHitlag(buffKey, buffDuration), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { atk := atkbonus * float64(w.stacks) diff --git a/internal/weapons/spear/catch/catch.go b/internal/weapons/spear/catch/catch.go index f4194d6f30..39245fa2da 100644 --- a/internal/weapons/spear/catch/catch.go +++ b/internal/weapons/spear/catch/catch.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -29,7 +29,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) val[attributes.DmgP] = 0.12 + 0.04*float64(r) val[attributes.CR] = 0.045 + 0.015*float64(r) char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("the-catch", -1), + Base: gmod.NewBase("the-catch", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag == attacks.AttackTagElementalBurst { return val, true diff --git a/internal/weapons/spear/crimsonmoonssemblance/crimsonmoonssemblance.go b/internal/weapons/spear/crimsonmoonssemblance/crimsonmoonssemblance.go index a3a8a59184..3dd8a84a61 100644 --- a/internal/weapons/spear/crimsonmoonssemblance/crimsonmoonssemblance.go +++ b/internal/weapons/spear/crimsonmoonssemblance/crimsonmoonssemblance.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -57,7 +57,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m := make([]float64, attributes.EndStatType) char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("crimsonmoonssemblance-bonus", -1), + Base: gmod.NewBaseWithHitlag("crimsonmoonssemblance-bonus", -1), AffectedStat: attributes.DmgP, Amount: func() ([]float64, bool) { maxhp := char.MaxHP() diff --git a/internal/weapons/spear/deathmatch/deathmatch.go b/internal/weapons/spear/deathmatch/deathmatch.go index 0c80e7fa46..61c9881092 100644 --- a/internal/weapons/spear/deathmatch/deathmatch.go +++ b/internal/weapons/spear/deathmatch/deathmatch.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -51,7 +51,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) }, fmt.Sprintf("deathmatch-%v", char.Base.Key.String())) char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("deathmatch", -1), + Base: gmod.NewBase("deathmatch", -1), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { if w.useMultiple { diff --git a/internal/weapons/spear/dragonbane/dragonbane.go b/internal/weapons/spear/dragonbane/dragonbane.go index 8a4a1ef1cd..7f9443f3ad 100644 --- a/internal/weapons/spear/dragonbane/dragonbane.go +++ b/internal/weapons/spear/dragonbane/dragonbane.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -29,7 +29,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = dmg char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("dragonbane", -1), + Base: gmod.NewBase("dragonbane", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { x, ok := t.(*enemy.Enemy) if !ok { diff --git a/internal/weapons/spear/engulfing/engulfing.go b/internal/weapons/spear/engulfing/engulfing.go index 1507bdeb87..50eb150a18 100644 --- a/internal/weapons/spear/engulfing/engulfing.go +++ b/internal/weapons/spear/engulfing/engulfing.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -36,7 +36,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) val := make([]float64, attributes.EndStatType) char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("engulfing-lightning", -1), + Base: gmod.NewBase("engulfing-lightning", -1), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { er := max(char.NonExtraStat(attributes.ER)-1, 0) @@ -59,7 +59,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) return false } char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("engulfing-er", 720), + Base: gmod.NewBaseWithHitlag("engulfing-er", 720), AffectedStat: attributes.ER, Amount: func() ([]float64, bool) { return erval, true diff --git a/internal/weapons/spear/footprint/footprint.go b/internal/weapons/spear/footprint/footprint.go index d254164c33..0cf5191689 100644 --- a/internal/weapons/spear/footprint/footprint.go +++ b/internal/weapons/spear/footprint/footprint.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -35,7 +35,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) return false } char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("footprint-def", 15*60), + Base: gmod.NewBaseWithHitlag("footprint-def", 15*60), AffectedStat: attributes.DEFP, Amount: func() ([]float64, bool) { return mDef, true diff --git a/internal/weapons/spear/homa/homa.go b/internal/weapons/spear/homa/homa.go index f4353cec6d..f041587d18 100644 --- a/internal/weapons/spear/homa/homa.go +++ b/internal/weapons/spear/homa/homa.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -27,7 +27,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) mHP := make([]float64, attributes.EndStatType) mHP[attributes.HPP] = 0.15 + float64(r)*0.05 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("homa-hp", -1), + Base: gmod.NewBase("homa-hp", -1), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return mHP, true @@ -38,7 +38,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) atkp := 0.006 + float64(r)*0.002 lowhp := 0.008 + float64(r)*0.002 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("homa-atk-buff", -1), + Base: gmod.NewBase("homa-atk-buff", -1), AffectedStat: attributes.ATK, Extra: true, Amount: func() ([]float64, bool) { diff --git a/internal/weapons/spear/kitain/kitain.go b/internal/weapons/spear/kitain/kitain.go index a0c5ca8ed9..dfe2ee6791 100644 --- a/internal/weapons/spear/kitain/kitain.go +++ b/internal/weapons/spear/kitain/kitain.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -38,7 +38,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) base := 0.045 + float64(r)*0.015 m[attributes.DmgP] = base char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("kitain-skill-dmg-buff", -1), + Base: gmod.NewBase("kitain-skill-dmg-buff", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag == attacks.AttackTagElementalArt || atk.Info.AttackTag == attacks.AttackTagElementalArtHold { return m, true diff --git a/internal/weapons/spear/lumidouceelegy/lumidouceelegy.go b/internal/weapons/spear/lumidouceelegy/lumidouceelegy.go index f06427281c..f589ebc072 100644 --- a/internal/weapons/spear/lumidouceelegy/lumidouceelegy.go +++ b/internal/weapons/spear/lumidouceelegy/lumidouceelegy.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -44,7 +44,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) perm := make([]float64, attributes.EndStatType) perm[attributes.ATKP] = 0.11 + 0.04*float64(w.refine) char.AddStatMod(character.StatMod{ - Base: modifier.NewBase(atkBuffKey, -1), + Base: gmod.NewBase(atkBuffKey, -1), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return perm, true @@ -102,7 +102,7 @@ func (w *Weapon) bonusCB() { } w.char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag(bonusBuffKey, 8*60), + Base: gmod.NewBaseWithHitlag(bonusBuffKey, 8*60), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { w.buff[attributes.DmgP] = (0.05*float64(w.refine) + 0.13) * float64(w.stacks) return w.buff, true diff --git a/internal/weapons/spear/missive/missive.go b/internal/weapons/spear/missive/missive.go index b7fb5ebc58..d619a582a0 100644 --- a/internal/weapons/spear/missive/missive.go +++ b/internal/weapons/spear/missive/missive.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -41,7 +41,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) } char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("missive", 10*60), + Base: gmod.NewBaseWithHitlag("missive", 10*60), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/weapons/spear/moonpiercer/moonpiercer.go b/internal/weapons/spear/moonpiercer/moonpiercer.go index 9c75bc484b..aa86443053 100644 --- a/internal/weapons/spear/moonpiercer/moonpiercer.go +++ b/internal/weapons/spear/moonpiercer/moonpiercer.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -73,7 +73,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) c.Tasks.Add(func() { active := c.Player.ActiveChar() active.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(buffKey, 720), + Base: gmod.NewBaseWithHitlag(buffKey, 720), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/weapons/spear/mountainbracingbolt/mountainbracingbolt.go b/internal/weapons/spear/mountainbracingbolt/mountainbracingbolt.go index c6c5c7b6b9..f1831130db 100644 --- a/internal/weapons/spear/mountainbracingbolt/mountainbracingbolt.go +++ b/internal/weapons/spear/mountainbracingbolt/mountainbracingbolt.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -40,7 +40,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m[attributes.DmgP] = 0.09 + float64(r)*0.03 char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase(baseBuffKey, -1), + Base: gmod.NewBase(baseBuffKey, -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagElementalArt && atk.Info.AttackTag != attacks.AttackTagElementalArtHold { return nil, false @@ -54,7 +54,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) return false } char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag(otherBuffKey, 8*60), + Base: gmod.NewBaseWithHitlag(otherBuffKey, 8*60), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagElementalArt && atk.Info.AttackTag != attacks.AttackTagElementalArtHold { return nil, false diff --git a/internal/weapons/spear/primordial/primordial.go b/internal/weapons/spear/primordial/primordial.go index b25503df9c..37f0c44be1 100644 --- a/internal/weapons/spear/primordial/primordial.go +++ b/internal/weapons/spear/primordial/primordial.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -69,7 +69,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) // refresh mod char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(buffKey, 6*60), + Base: gmod.NewBaseWithHitlag(buffKey, 6*60), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return w.buff, true diff --git a/internal/weapons/spear/prospectorsdrill/prospectorsdrill.go b/internal/weapons/spear/prospectorsdrill/prospectorsdrill.go index 5104cf9bdd..d5d2711701 100644 --- a/internal/weapons/spear/prospectorsdrill/prospectorsdrill.go +++ b/internal/weapons/spear/prospectorsdrill/prospectorsdrill.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -99,7 +99,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m[i] = ele } char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(buffKey, buffDuration), + Base: gmod.NewBaseWithHitlag(buffKey, buffDuration), Amount: func() ([]float64, bool) { return m, true }, diff --git a/internal/weapons/spear/prototype/prototype.go b/internal/weapons/spear/prototype/prototype.go index 9429cf940b..bc4dcea15d 100644 --- a/internal/weapons/spear/prototype/prototype.go +++ b/internal/weapons/spear/prototype/prototype.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -48,7 +48,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) w.buff[attributes.ATKP] = atkbonus * float64(w.stacks) } char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag(buffKey, 720), + Base: gmod.NewBaseWithHitlag(buffKey, 720), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagNormal && atk.Info.AttackTag != attacks.AttackTagExtra { return nil, false diff --git a/internal/weapons/spear/scarletsands/scarletsands.go b/internal/weapons/spear/scarletsands/scarletsands.go index dbbdcc98b7..5aeea3fdfc 100644 --- a/internal/weapons/spear/scarletsands/scarletsands.go +++ b/internal/weapons/spear/scarletsands/scarletsands.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -36,7 +36,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) atkBuff := 0.39 + 0.13*float64(r) atkSkillBuff := 0.21 + 0.07*float64(r) char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("scarletsands", -1), + Base: gmod.NewBase("scarletsands", -1), AffectedStat: attributes.ATK, Extra: true, Amount: func() ([]float64, bool) { @@ -87,7 +87,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) } char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(skillBuff, 10*60), + Base: gmod.NewBaseWithHitlag(skillBuff, 10*60), AffectedStat: attributes.ATK, Extra: true, Amount: func() ([]float64, bool) { diff --git a/internal/weapons/spear/skyward/skyward.go b/internal/weapons/spear/skyward/skyward.go index 4aea456ed8..a061ee3efe 100644 --- a/internal/weapons/spear/skyward/skyward.go +++ b/internal/weapons/spear/skyward/skyward.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -38,7 +38,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m[attributes.CR] = 0.06 + float64(r)*0.02 m[attributes.AtkSpd] = 0.12 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("skyward spine", -1), + Base: gmod.NewBase("skyward spine", -1), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/weapons/spear/symphonist/symphonist.go b/internal/weapons/spear/symphonist/symphonist.go index 8c8874b8ed..c5cc29c0fc 100644 --- a/internal/weapons/spear/symphonist/symphonist.go +++ b/internal/weapons/spear/symphonist/symphonist.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -44,7 +44,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) selfAtkP := 0.09 + float64(r)*0.03 m := make([]float64, attributes.EndStatType) char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("symphonist-atkp", -1), + Base: gmod.NewBase("symphonist-atkp", -1), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { m[attributes.ATKP] = selfAtkP @@ -67,7 +67,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) } char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(buffKey, bufDur), + Base: gmod.NewBaseWithHitlag(buffKey, bufDur), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return buffOnHeal, true @@ -77,7 +77,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) if index != char.Index() { otherChar := c.Player.ByIndex(index) otherChar.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(buffKey, bufDur), + Base: gmod.NewBaseWithHitlag(buffKey, bufDur), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return buffOnHeal, true diff --git a/internal/weapons/spear/tamayuratei/tamayuratei.go b/internal/weapons/spear/tamayuratei/tamayuratei.go index 69a5f6b332..901d3ce7f7 100644 --- a/internal/weapons/spear/tamayuratei/tamayuratei.go +++ b/internal/weapons/spear/tamayuratei/tamayuratei.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -36,7 +36,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) return false } char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("tamayuratei", 10*60), + Base: gmod.NewBaseWithHitlag("tamayuratei", 10*60), Amount: func() ([]float64, bool) { return m, true }, diff --git a/internal/weapons/spear/whitetassel/whitetassel.go b/internal/weapons/spear/whitetassel/whitetassel.go index 56fb55da91..684c65ef8a 100644 --- a/internal/weapons/spear/whitetassel/whitetassel.go +++ b/internal/weapons/spear/whitetassel/whitetassel.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -29,7 +29,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = 0.18 + 0.06*float64(r) char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("whitetassel", -1), + Base: gmod.NewBase("whitetassel", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { return m, atk.Info.AttackTag == attacks.AttackTagNormal }, diff --git a/internal/weapons/sword/absolution/absolution.go b/internal/weapons/sword/absolution/absolution.go index 7a3f4313f5..a58e473fca 100644 --- a/internal/weapons/sword/absolution/absolution.go +++ b/internal/weapons/sword/absolution/absolution.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -35,7 +35,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) perm := make([]float64, attributes.EndStatType) perm[attributes.CD] = 0.15 + 0.05*float64(refine) char.AddStatMod(character.StatMod{ - Base: modifier.NewBase(cdKey, -1), + Base: gmod.NewBase(cdKey, -1), AffectedStat: attributes.CD, Amount: func() ([]float64, bool) { return perm, true @@ -57,7 +57,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) } bonus[attributes.DmgP] = (0.12 + 0.04*float64(refine)) * float64(w.stacks) char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag(dmgBonusKey, 6*60), + Base: gmod.NewBaseWithHitlag(dmgBonusKey, 6*60), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { return bonus, true }, diff --git a/internal/weapons/sword/alley/alley.go b/internal/weapons/sword/alley/alley.go index 70aa9bbdaf..97438a2eac 100644 --- a/internal/weapons/sword/alley/alley.go +++ b/internal/weapons/sword/alley/alley.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -52,7 +52,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = 0.09 + 0.03*float64(r) char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("alleyflash", -1), + Base: gmod.NewBase("alleyflash", -1), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return m, !char.StatusIsActive(lockoutKey) diff --git a/internal/weapons/sword/aquila/aquila.go b/internal/weapons/sword/aquila/aquila.go index 9f15895c12..a50af1128a 100644 --- a/internal/weapons/sword/aquila/aquila.go +++ b/internal/weapons/sword/aquila/aquila.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -37,7 +37,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m := make([]float64, attributes.EndStatType) m[attributes.ATKP] = .15 + .05*float64(r) char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("aquila favonia", -1), + Base: gmod.NewBase("aquila favonia", -1), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/weapons/sword/azurelight/azurelight.go b/internal/weapons/sword/azurelight/azurelight.go index f6528e0f63..2021658954 100644 --- a/internal/weapons/sword/azurelight/azurelight.go +++ b/internal/weapons/sword/azurelight/azurelight.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -42,7 +42,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) // add buff char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(buffKey, 12*60), + Base: gmod.NewBaseWithHitlag(buffKey, 12*60), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { if char.Energy == 0 { diff --git a/internal/weapons/sword/blacksword/blacksword.go b/internal/weapons/sword/blacksword/blacksword.go index c19e2e8969..2575c326a0 100644 --- a/internal/weapons/sword/blacksword/blacksword.go +++ b/internal/weapons/sword/blacksword/blacksword.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -33,7 +33,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) val := make([]float64, attributes.EndStatType) val[attributes.DmgP] = 0.15 + 0.05*float64(r) char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("blacksword", -1), + Base: gmod.NewBase("blacksword", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagNormal && atk.Info.AttackTag != attacks.AttackTagExtra { return nil, false diff --git a/internal/weapons/sword/calamityofeshu/calamityofeshu.go b/internal/weapons/sword/calamityofeshu/calamityofeshu.go index 0dfc1aff72..a1fa796592 100644 --- a/internal/weapons/sword/calamityofeshu/calamityofeshu.go +++ b/internal/weapons/sword/calamityofeshu/calamityofeshu.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -29,7 +29,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m[attributes.DmgP] = 0.15 + 0.05*r m[attributes.CR] = 0.06 + 0.02*r char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("calamityofeshu", -1), + Base: gmod.NewBase("calamityofeshu", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if !c.Player.Shields.CharacterIsShielded(char.Index(), c.Player.Active()) { return nil, false diff --git a/internal/weapons/sword/coolsteel/coolsteel.go b/internal/weapons/sword/coolsteel/coolsteel.go index 9c3d41b51e..44ce4cadc0 100644 --- a/internal/weapons/sword/coolsteel/coolsteel.go +++ b/internal/weapons/sword/coolsteel/coolsteel.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -30,7 +30,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m[attributes.DmgP] = 0.09 + float64(r)*0.03 char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("coolsteel", -1), + Base: gmod.NewBase("coolsteel", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { x, ok := t.(*enemy.Enemy) if !ok { diff --git a/internal/weapons/sword/darkironsword/darkironsword.go b/internal/weapons/sword/darkironsword/darkironsword.go index 8acbb3af20..de2815d5b6 100644 --- a/internal/weapons/sword/darkironsword/darkironsword.go +++ b/internal/weapons/sword/darkironsword/darkironsword.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -42,7 +42,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) return false } char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("darkironsword", 720), + Base: gmod.NewBaseWithHitlag("darkironsword", 720), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/weapons/sword/dockhand/dockhand.go b/internal/weapons/sword/dockhand/dockhand.go index b640388429..99c58b10a8 100644 --- a/internal/weapons/sword/dockhand/dockhand.go +++ b/internal/weapons/sword/dockhand/dockhand.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -96,7 +96,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) // add em buff m[attributes.EM] = em * float64(count) char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(buffKey, 10*60), + Base: gmod.NewBaseWithHitlag(buffKey, 10*60), AffectedStat: attributes.EM, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/weapons/sword/festering/festering.go b/internal/weapons/sword/festering/festering.go index 6690a59332..564638a320 100644 --- a/internal/weapons/sword/festering/festering.go +++ b/internal/weapons/sword/festering/festering.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -29,7 +29,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m[attributes.CR] = .045 + .015*float64(r) m[attributes.DmgP] = .12 + 0.04*float64(r) char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("festering", -1), + Base: gmod.NewBase("festering", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { switch atk.Info.AttackTag { case attacks.AttackTagElementalArt, attacks.AttackTagElementalArtHold: diff --git a/internal/weapons/sword/finaleofthedeep/finaleofthedeep.go b/internal/weapons/sword/finaleofthedeep/finaleofthedeep.go index dd12134911..6e3cc541dc 100644 --- a/internal/weapons/sword/finaleofthedeep/finaleofthedeep.go +++ b/internal/weapons/sword/finaleofthedeep/finaleofthedeep.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -58,7 +58,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) char.AddStatus(icdKey, icd, true) char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("finaleofthedeep-atk-boost", duration), + Base: gmod.NewBaseWithHitlag("finaleofthedeep-atk-boost", duration), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return m, true @@ -92,7 +92,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) w.collectedDebt = 0 char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("finaleofthedeep-bond-flatatk-boost", duration), + Base: gmod.NewBaseWithHitlag("finaleofthedeep-bond-flatatk-boost", duration), AffectedStat: attributes.ATK, Amount: func() ([]float64, bool) { return bond, true diff --git a/internal/weapons/sword/fleuvecendreferryman/fleuvecendreferryman.go b/internal/weapons/sword/fleuvecendreferryman/fleuvecendreferryman.go index 5cbeb99531..3618edfd60 100644 --- a/internal/weapons/sword/fleuvecendreferryman/fleuvecendreferryman.go +++ b/internal/weapons/sword/fleuvecendreferryman/fleuvecendreferryman.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -33,7 +33,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) mCR := make([]float64, attributes.EndStatType) mCR[attributes.CR] = 0.06 + 0.02*float64(r) char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("fleuvecendreferryman-cr", -1), + Base: gmod.NewBase("fleuvecendreferryman-cr", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag == attacks.AttackTagElementalArt || atk.Info.AttackTag == attacks.AttackTagElementalArtHold { return mCR, true @@ -50,7 +50,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) return false } char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("fleuvecendreferryman-er", 5*60), + Base: gmod.NewBaseWithHitlag("fleuvecendreferryman-er", 5*60), AffectedStat: attributes.ER, Amount: func() ([]float64, bool) { return mER, true diff --git a/internal/weapons/sword/fluteofezpitzal/fluteofezpitzal.go b/internal/weapons/sword/fluteofezpitzal/fluteofezpitzal.go index 09d76dcb90..b5894e36d6 100644 --- a/internal/weapons/sword/fluteofezpitzal/fluteofezpitzal.go +++ b/internal/weapons/sword/fluteofezpitzal/fluteofezpitzal.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -41,7 +41,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) } char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("flute-of-ezpitzal-def-boost", duration), + Base: gmod.NewBaseWithHitlag("flute-of-ezpitzal-def-boost", duration), AffectedStat: attributes.DEFP, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/weapons/sword/foliar/foliar.go b/internal/weapons/sword/foliar/foliar.go index f714e06303..058fc6cee2 100644 --- a/internal/weapons/sword/foliar/foliar.go +++ b/internal/weapons/sword/foliar/foliar.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -41,7 +41,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m := make([]float64, attributes.EndStatType) m[attributes.CR] = 0.03 + float64(r)*0.01 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("foliar-crit-rate", -1), + Base: gmod.NewBase("foliar-crit-rate", -1), AffectedStat: attributes.CR, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/weapons/sword/freedom/freedom.go b/internal/weapons/sword/freedom/freedom.go index 8cc3223f14..ee8dda69cc 100644 --- a/internal/weapons/sword/freedom/freedom.go +++ b/internal/weapons/sword/freedom/freedom.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -42,7 +42,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = 0.075 + float64(r)*0.025 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("freedom-dmg", -1), + Base: gmod.NewBase("freedom-dmg", -1), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return m, true @@ -84,14 +84,14 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) for _, char := range c.Player.Chars() { // Attack buff snapshots so it needs to be in a separate mod char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(common.MillennialKey, buffDuration), + Base: gmod.NewBaseWithHitlag(common.MillennialKey, buffDuration), AffectedStat: attributes.ATKP, Amount: func() ([]float64, bool) { return sharedVal, true }, }) char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag("freedomsworn", buffDuration), + Base: gmod.NewBaseWithHitlag("freedomsworn", buffDuration), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { switch atk.Info.AttackTag { case attacks.AttackTagNormal, attacks.AttackTagExtra, attacks.AttackTagPlunge: diff --git a/internal/weapons/sword/haran/haran.go b/internal/weapons/sword/haran/haran.go index a07ed7bc40..be390db276 100644 --- a/internal/weapons/sword/haran/haran.go +++ b/internal/weapons/sword/haran/haran.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -51,7 +51,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m[attributes.GeoP] = base m[attributes.DendroP] = base char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("haran-ele-bonus", -1), + Base: gmod.NewBase("haran-ele-bonus", -1), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return m, true @@ -78,7 +78,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) activeFn := func() bool { val[attributes.DmgP] = (0.15 + float64(r)*0.05) * float64(wavespikeStacks) char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag("ripping-upheaval", 480), + Base: gmod.NewBaseWithHitlag("ripping-upheaval", 480), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagNormal { return nil, false diff --git a/internal/weapons/sword/harbinger/harbinger.go b/internal/weapons/sword/harbinger/harbinger.go index 46b5cbb3c4..5bd6e1a36b 100644 --- a/internal/weapons/sword/harbinger/harbinger.go +++ b/internal/weapons/sword/harbinger/harbinger.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -29,7 +29,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) // set stat to crit to avoid infinite loop when calling MaxHP char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("harbinger", -1), + Base: gmod.NewBase("harbinger", -1), AffectedStat: attributes.CR, Amount: func() ([]float64, bool) { return m, char.CurrentHPRatio() >= 0.9 diff --git a/internal/weapons/sword/ironsting/ironsting.go b/internal/weapons/sword/ironsting/ironsting.go index 0aae0dec86..e842341363 100644 --- a/internal/weapons/sword/ironsting/ironsting.go +++ b/internal/weapons/sword/ironsting/ironsting.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -62,7 +62,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) } // refresh mod char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("ironsting", 360), + Base: gmod.NewBaseWithHitlag("ironsting", 360), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return w.buff, true diff --git a/internal/weapons/sword/kagotsurubeisshin/kagotsurubeisshin.go b/internal/weapons/sword/kagotsurubeisshin/kagotsurubeisshin.go index 1c7df476b1..e13f133f7d 100644 --- a/internal/weapons/sword/kagotsurubeisshin/kagotsurubeisshin.go +++ b/internal/weapons/sword/kagotsurubeisshin/kagotsurubeisshin.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -53,7 +53,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) val := make([]float64, attributes.EndStatType) val[attributes.ATKP] = 0.15 char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("kagotsurube-isshin", duration), + Base: gmod.NewBaseWithHitlag("kagotsurube-isshin", duration), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return val, true diff --git a/internal/weapons/sword/keyofkhajnisut/keyofkhajnisut.go b/internal/weapons/sword/keyofkhajnisut/keyofkhajnisut.go index 0854d1482c..d5334365ef 100644 --- a/internal/weapons/sword/keyofkhajnisut/keyofkhajnisut.go +++ b/internal/weapons/sword/keyofkhajnisut/keyofkhajnisut.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -47,7 +47,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m := make([]float64, attributes.EndStatType) m[attributes.HPP] = hp char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("khaj-nisut", -1), + Base: gmod.NewBase("khaj-nisut", -1), AffectedStat: attributes.HPP, Amount: func() ([]float64, bool) { return m, true @@ -79,7 +79,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) val := make([]float64, attributes.EndStatType) val[attributes.EM] = char.MaxHP() * em * float64(w.stacks) char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(buffKey, duration), + Base: gmod.NewBaseWithHitlag(buffKey, duration), AffectedStat: attributes.EM, Extra: true, Amount: func() ([]float64, bool) { @@ -92,7 +92,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) val[attributes.EM] = char.MaxHP() * emTeam for _, this := range c.Player.Chars() { this.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(teamBuffKey, duration), + Base: gmod.NewBaseWithHitlag(teamBuffKey, duration), AffectedStat: attributes.EM, Extra: true, Amount: func() ([]float64, bool) { diff --git a/internal/weapons/sword/lion/lion.go b/internal/weapons/sword/lion/lion.go index c16ab99185..94d9f72c53 100644 --- a/internal/weapons/sword/lion/lion.go +++ b/internal/weapons/sword/lion/lion.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -31,7 +31,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m[attributes.DmgP] = 0.16 + float64(r)*0.04 char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("lionsroar", -1), + Base: gmod.NewBase("lionsroar", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag > attacks.ReactionAttackDelim { return nil, false diff --git a/internal/weapons/sword/mistsplitter/mistsplitter.go b/internal/weapons/sword/mistsplitter/mistsplitter.go index c4f99c86b1..cff3826e2f 100644 --- a/internal/weapons/sword/mistsplitter/mistsplitter.go +++ b/internal/weapons/sword/mistsplitter/mistsplitter.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -78,7 +78,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) return false }, fmt.Sprintf("mistsplitter-%v", char.Base.Key.String())) char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("mistsplitter", -1), + Base: gmod.NewBase("mistsplitter", -1), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { count := 0 diff --git a/internal/weapons/sword/moonweaversdawn/moonweaversdawn.go b/internal/weapons/sword/moonweaversdawn/moonweaversdawn.go index e4ca563380..c55ccc4e0a 100644 --- a/internal/weapons/sword/moonweaversdawn/moonweaversdawn.go +++ b/internal/weapons/sword/moonweaversdawn/moonweaversdawn.go @@ -7,7 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -35,7 +35,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) } char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("moonweavers-dawn", -1), + Base: gmod.NewBase("moonweavers-dawn", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag == attacks.AttackTagElementalBurst { return val, true diff --git a/internal/weapons/sword/peakpatrolsong/peakpatrolsong.go b/internal/weapons/sword/peakpatrolsong/peakpatrolsong.go index c34dbc9311..da970f65ba 100644 --- a/internal/weapons/sword/peakpatrolsong/peakpatrolsong.go +++ b/internal/weapons/sword/peakpatrolsong/peakpatrolsong.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -72,7 +72,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m[i] = bonus } char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(buffKey, buffDur), + Base: gmod.NewBaseWithHitlag(buffKey, buffDur), Amount: func() ([]float64, bool) { return m, true }, @@ -86,7 +86,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) } for _, this := range c.Player.Chars() { this.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(teamBuffKey, teamBuffDur), + Base: gmod.NewBaseWithHitlag(teamBuffKey, teamBuffDur), Amount: func() ([]float64, bool) { return t, true }, diff --git a/internal/weapons/sword/primordial/primordial.go b/internal/weapons/sword/primordial/primordial.go index 2cd42e1081..b4da20e0e8 100644 --- a/internal/weapons/sword/primordial/primordial.go +++ b/internal/weapons/sword/primordial/primordial.go @@ -6,7 +6,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -27,7 +27,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) mHP := make([]float64, attributes.EndStatType) mHP[attributes.HPP] = 0.15 + float64(r)*0.05 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("jadecutter-hp", -1), + Base: gmod.NewBase("jadecutter-hp", -1), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return mHP, true @@ -38,7 +38,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) atkp := 0.009 + float64(r)*0.003 // to avoid infinite loop when calling MaxHP char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("jadecutter-atk-buff", -1), + Base: gmod.NewBase("jadecutter-atk-buff", -1), AffectedStat: attributes.ATK, Amount: func() ([]float64, bool) { mATK[attributes.ATK] = atkp * char.MaxHP() diff --git a/internal/weapons/sword/prototype/prototype.go b/internal/weapons/sword/prototype/prototype.go index 5f2b16f0b5..0096ac64ff 100644 --- a/internal/weapons/sword/prototype/prototype.go +++ b/internal/weapons/sword/prototype/prototype.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -64,7 +64,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) w.buff[attributes.DEFP] = perStack * float64(w.stacks) } char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(buffKey, 360), + Base: gmod.NewBaseWithHitlag(buffKey, 360), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return w.buff, true diff --git a/internal/weapons/sword/sapwoodblade/sapwoodblade.go b/internal/weapons/sword/sapwoodblade/sapwoodblade.go index b64a76884c..39a35e9e6d 100644 --- a/internal/weapons/sword/sapwoodblade/sapwoodblade.go +++ b/internal/weapons/sword/sapwoodblade/sapwoodblade.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -73,7 +73,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) c.Tasks.Add(func() { active := c.Player.ActiveChar() active.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(buffKey, 720), + Base: gmod.NewBaseWithHitlag(buffKey, 720), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return m, true diff --git a/internal/weapons/sword/skyrider/skyrider.go b/internal/weapons/sword/skyrider/skyrider.go index 0eb508d399..da972e2ec0 100644 --- a/internal/weapons/sword/skyrider/skyrider.go +++ b/internal/weapons/sword/skyrider/skyrider.go @@ -9,7 +9,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -37,7 +37,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) return false } char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("skyrider", 900), + Base: gmod.NewBaseWithHitlag("skyrider", 900), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return val, true diff --git a/internal/weapons/sword/skyward/skyward.go b/internal/weapons/sword/skyward/skyward.go index 814d4fcda5..912c326c01 100644 --- a/internal/weapons/sword/skyward/skyward.go +++ b/internal/weapons/sword/skyward/skyward.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -41,7 +41,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m := make([]float64, attributes.EndStatType) m[attributes.CR] = 0.03 + float64(r)*0.01 char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("skyward-blade-crit", -1), + Base: gmod.NewBase("skyward-blade-crit", -1), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return m, true @@ -55,7 +55,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) return false } char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(buffKey, 720), + Base: gmod.NewBaseWithHitlag(buffKey, 720), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { return atkspdBuff, true diff --git a/internal/weapons/sword/splendoroftranquilwaters/splendoroftranquilwaters.go b/internal/weapons/sword/splendoroftranquilwaters/splendoroftranquilwaters.go index b34c3db7eb..8e72cfc2c7 100644 --- a/internal/weapons/sword/splendoroftranquilwaters/splendoroftranquilwaters.go +++ b/internal/weapons/sword/splendoroftranquilwaters/splendoroftranquilwaters.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const ( @@ -123,7 +123,7 @@ func (w *Weapon) onEquipChangeHP() { w.char.AddStatus(skillBuffIcd, 0.2*60, true) w.buffSkill[attributes.DmgP] = (0.06 + 0.02*float64(w.refine)) * float64(w.skillStacks) w.char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag(skillBuffKey, 6*60), + Base: gmod.NewBaseWithHitlag(skillBuffKey, 6*60), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { switch atk.Info.AttackTag { case attacks.AttackTagElementalArt: @@ -153,7 +153,7 @@ func (w *Weapon) onOtherChangeHP() { val[attributes.HPP] = hpp w.char.AddStatus(hpBuffIcd, 0.2*60, true) w.char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(hpBuffKey, 6*60), + Base: gmod.NewBaseWithHitlag(hpBuffKey, 6*60), AffectedStat: attributes.HPP, Amount: func() ([]float64, bool) { return val, true diff --git a/internal/weapons/sword/swordofdescension/swordofdescension.go b/internal/weapons/sword/swordofdescension/swordofdescension.go index 275fcc69fd..e978397672 100644 --- a/internal/weapons/sword/swordofdescension/swordofdescension.go +++ b/internal/weapons/sword/swordofdescension/swordofdescension.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -50,7 +50,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) if char.Base.Key < keys.TravelerDelim { char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("swordofdescension", -1), + Base: gmod.NewBase("swordofdescension", -1), AffectedStat: attributes.NoStat, Amount: func() ([]float64, bool) { m[attributes.ATK] = 66 diff --git a/internal/weapons/sword/toukaboushigure/toukaboushigure.go b/internal/weapons/sword/toukaboushigure/toukaboushigure.go index 3e5f22c0f6..023b0ca790 100644 --- a/internal/weapons/sword/toukaboushigure/toukaboushigure.go +++ b/internal/weapons/sword/toukaboushigure/toukaboushigure.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -39,7 +39,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) m := make([]float64, attributes.EndStatType) m[attributes.DmgP] = 0.12 + 0.04*float64(r) char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("toukaboushigure", -1), + Base: gmod.NewBase("toukaboushigure", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { e, ok := t.(*enemy.Enemy) if !ok { diff --git a/internal/weapons/sword/urakumisugiri/urakumisugiri.go b/internal/weapons/sword/urakumisugiri/urakumisugiri.go index 747e098971..f327d8a033 100644 --- a/internal/weapons/sword/urakumisugiri/urakumisugiri.go +++ b/internal/weapons/sword/urakumisugiri/urakumisugiri.go @@ -10,7 +10,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -41,7 +41,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) mNormal := make([]float64, attributes.EndStatType) char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("urakumisugiri-na", -1), + Base: gmod.NewBase("urakumisugiri-na", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagNormal { return nil, false @@ -57,7 +57,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) mSkill := make([]float64, attributes.EndStatType) char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("urakumisugiri-skill", -1), + Base: gmod.NewBase("urakumisugiri-skill", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if atk.Info.AttackTag != attacks.AttackTagElementalArt && atk.Info.AttackTag != attacks.AttackTagElementalArtHold { return nil, false @@ -74,7 +74,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) mDef := make([]float64, attributes.EndStatType) mDef[attributes.DEFP] = defIncrease char.AddStatMod(character.StatMod{ - Base: modifier.NewBase("urakumisugiri-def", -1), + Base: gmod.NewBase("urakumisugiri-def", -1), AffectedStat: attributes.DEFP, Amount: func() ([]float64, bool) { return mDef, true diff --git a/internal/weapons/sword/wolffang/wolffang.go b/internal/weapons/sword/wolffang/wolffang.go index 3310c13329..bd65521a51 100644 --- a/internal/weapons/sword/wolffang/wolffang.go +++ b/internal/weapons/sword/wolffang/wolffang.go @@ -11,7 +11,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -41,7 +41,7 @@ func NewWeapon(c *core.Core, char *character.CharWrapper, p info.WeaponProfile) mFirst := make([]float64, attributes.EndStatType) mFirst[attributes.DmgP] = 0.12 + 0.04*float64(p.Refine) char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("wolf-fang", -1), + Base: gmod.NewBase("wolf-fang", -1), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { switch atk.Info.AttackTag { case attacks.AttackTagElementalArt: @@ -90,7 +90,7 @@ func (w *Weapon) addEvent(name string, tags ...attacks.AttackTag) { } w.char.AddAttackMod(character.AttackMod{ - Base: modifier.NewBaseWithHitlag(name, 10*60), + Base: gmod.NewBaseWithHitlag(name, 10*60), Amount: func(atk *info.AttackEvent, t info.Target) ([]float64, bool) { if !requiredTag(atk.Info.AttackTag, tags...) { return nil, false diff --git a/internal/weapons/sword/xiphos/xiphos.go b/internal/weapons/sword/xiphos/xiphos.go index 4766ab6de7..19b8098d4e 100644 --- a/internal/weapons/sword/xiphos/xiphos.go +++ b/internal/weapons/sword/xiphos/xiphos.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) func init() { @@ -48,7 +48,7 @@ func (w *Weapon) updateStats() { val := make([]float64, attributes.EndStatType) val[attributes.ER] = w.erBuff * w.char.NonExtraStat(attributes.EM) w.char.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("xiphos", 12*60), + Base: gmod.NewBaseWithHitlag("xiphos", 12*60), AffectedStat: attributes.ER, Extra: true, Amount: func() ([]float64, bool) { @@ -64,7 +64,7 @@ func (w *Weapon) updateStats() { } this.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag(fmt.Sprintf("xiphos-%v", w.char.Base.Key.String()), 12*60), + Base: gmod.NewBaseWithHitlag(fmt.Sprintf("xiphos-%v", w.char.Base.Key.String()), 12*60), AffectedStat: attributes.ER, Extra: true, Amount: func() ([]float64, bool) { diff --git a/pkg/core/core.go b/pkg/core/core.go index 1493f85ad6..01b5bbb0be 100644 --- a/pkg/core/core.go +++ b/pkg/core/core.go @@ -21,6 +21,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/core/status" "github.com/genshinsim/gcsim/pkg/core/task" + "github.com/genshinsim/gcsim/pkg/engine" ) type Core struct { @@ -36,6 +37,10 @@ type Core struct { Combat *combat.Handler Constructs *construct.Handler Player *player.Handler + + // abstracted core functionalities + Modifiers engine.ModifierMgr + EntityIndexer info.EntityIndexRegistry } type Flags struct { @@ -133,6 +138,24 @@ func (c *Core) Init() error { if err != nil { return err } + + // TODO: someone please get rid of this block of hacky ass code for targetid.... + + // player is 0... and targetid will always be 1 + c.EntityIndexer.Register(0) + // register chars next, but negatives + for _, char := range c.Player.Chars() { + c.EntityIndexer.Register(-1 * char.Index()) + } + // then enemies + for _, e := range c.Combat.Enemies() { + c.EntityIndexer.Register(int(e.Key())) + } + // TODO: we should register gadgets at some point ?? + // for _, g := range c.Combat.Gadgets() { + // c.EntityIndexer.Register(int(g.Key())) + // } + c.Events.Emit(event.OnInitialize) return nil } diff --git a/pkg/core/info/entity.go b/pkg/core/info/entity.go new file mode 100644 index 0000000000..7be4548fb5 --- /dev/null +++ b/pkg/core/info/entity.go @@ -0,0 +1,40 @@ +package info + +import ( + "encoding/json" + "fmt" +) + +type EntityIndex int + +type EntityIndexRegistry struct { + lookup []int +} + +func (gen *EntityIndexRegistry) Find(id int) EntityIndex { + for i, v := range gen.lookup { + if v == id { + return EntityIndex(i + 1) + } + } + return 0 +} + +// Generate a new TargetID +func (gen *EntityIndexRegistry) Register(id int) (EntityIndex, error) { + if exist := gen.Find(id); exist != 0 { + return 0, fmt.Errorf("id %v already exist", id) + } + gen.lookup = append(gen.lookup, id) + return EntityIndex(len(gen.lookup)), nil // will always return index starting at 1 +} + +// Size returns the number of ids handed out, for purpose of +// sizing arrays etc... +func (gen *EntityIndexRegistry) Size() int { + return len(gen.lookup) // because we start at 0 +} + +func (t EntityIndex) MarshalJSON() ([]byte, error) { + return json.Marshal(fmt.Sprint(t)) +} diff --git a/pkg/core/info/entity_test.go b/pkg/core/info/entity_test.go new file mode 100644 index 0000000000..3701cb66ec --- /dev/null +++ b/pkg/core/info/entity_test.go @@ -0,0 +1,51 @@ +package info + +import ( + "testing" +) + +var ids = []int{ + 1, 2, 3, 4, -1, -2, -3, 0, 5, 6, 7, 8, +} + +var mm = map[int]EntityIndex{ + 1: 1, + 2: 2, + 3: 3, + 4: 4, + -1: 5, + -2: 6, + -3: 7, + 0: 8, + 5: 9, + 6: 10, + 7: 11, + 8: 12, +} + +func doMap(id int) EntityIndex { + t, ok := mm[id] + if !ok { + return 0 + } + return t +} + +func BenchmarkMap(b *testing.B) { + for n := 0; n < b.N; n++ { + for _, v := range ids { + doMap(v) + } + } +} + +func BenchmarkSlice(b *testing.B) { + g := &EntityIndexRegistry{ + lookup: ids, + } + for n := 0; n < b.N; n++ { + for _, v := range ids { + g.Find(v) + } + } +} diff --git a/pkg/core/info/modifier.go b/pkg/core/info/modifier.go index 00b6b746bf..a34f2a2cb8 100644 --- a/pkg/core/info/modifier.go +++ b/pkg/core/info/modifier.go @@ -2,22 +2,74 @@ package info import ( "github.com/genshinsim/gcsim/pkg/core/attributes" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/core/keys" + "github.com/genshinsim/gcsim/pkg/gmod" ) // THESE MODIFIERS SHOULD EVENTUALLY BE DEPRECATED type Status struct { - modifier.Base + gmod.Base } type ResistMod struct { Ele attributes.Element Value float64 - modifier.Base + gmod.Base } type DefMod struct { Value float64 Dur int - modifier.Base + gmod.Base } + +// THESE ARE IDEALLY THE NEW MODIFIERS TO BE USED +type Modifier struct { + ModifierListeners + ModiferMixins + + Name keys.Modifier + Duration int // duration in frames + Durability Durability + + DecayRate Durability // always calculated on Add, but exposed so it can be modified + + Source EntityIndex + Target EntityIndex + Stacking StackingType +} + +type ModifierListeners struct { + OnAdd func(*Modifier) + OnRemove func(*Modifier) + // OnBeingHit func(*Modifier, *AttackEvent) + // OnHeal func(*Modifier)) + // OnBeingHealed func(*Modifier) + OnThinkInterval func(*Modifier) + + PreTick func(*Modifier) + PostTick func(*Modifier) +} + +type ModiferMixins struct { + ModifyDamageMixin func(*Modifier, *AttackEvent) + ModifyStatsMixin func(*Modifier) *[]attributes.Stats +} + +type StackingType int + +const ( + InvalidStacking StackingType = iota + Refresh // single instance. re-apply resets durability and doesn't trigger onAdded/onRemoved or reset onThinkInterval + Unique // single instance. can't be re-applied unless expired + Prolong // same as Refresh. can only be re-applied within the initial duration + Multiple // same as Unique. can hold multiple instances + MultipleRefresh // same as Refresh. can hold multiple instances, a re-apply will trigger onAdded/onRemoved and reset onThinkInterval on the oldest instance + MultipleRefreshNoRemove // same as Refresh. can hold multiple instances + MultipleAllRefresh // same as Refresh. can hold multiple instances, a re-apply resets durability for all active instances + RefreshAndAddDurability // not used + GlobalUnique // not used + RefreshUniqueDurability // unknown behaviour + Overlap // used for "auras" + OverlapRefreshDuration // used for "auras" +) diff --git a/pkg/core/keys/mod.go b/pkg/core/keys/mod.go new file mode 100644 index 0000000000..216c9f1c14 --- /dev/null +++ b/pkg/core/keys/mod.go @@ -0,0 +1,82 @@ +package keys + +import ( + "encoding/json" + "errors" + "strings" +) + +type Modifier int + +func (m *Modifier) MarshalJSON() ([]byte, error) { + return json.Marshal(modNames[*m]) +} + +func (m *Modifier) UnmarshalJSON(b []byte) error { + var s string + if err := json.Unmarshal(b, &s); err != nil { + return err + } + s = strings.ToLower(s) + for i := range modNames { + if modNames[i] == s { + *m = Modifier(i) + return nil + } + } + return errors.New("unrecognized character key") +} + +func (m Modifier) String() string { + return modNames[m] +} + +func (m Modifier) IsSpecialDecay() bool { + switch m { + case Dendro: + case Quicken: + case Frozen: + case Anemo: + case Geo: + case Burning: + default: + return false + } + return true +} + +const ( + InvalidModifier Modifier = iota + TestingMod + Electro + Pyro + Cryo + Hydro + BurningFuel + Dendro + Quicken + Frozen + Anemo + Geo + Burning + BuiltinModifierDelim // delim + // TODO: everything below here to EndModifierKeys should be generated + EndModifierKeys +) + +var modNames = [EndModifierKeys]string{ + "invalid", + "testing", + "electro", + "pyro", + "cryo", + "hydro", + "burning_fuel", + "dendro", + "quicken", + "frozen", + "anemo", + "geo", + "burning", + "invalid", // delim +} diff --git a/pkg/core/player/character/character.go b/pkg/core/player/character/character.go index 721d1b70ad..aa8b40673c 100644 --- a/pkg/core/player/character/character.go +++ b/pkg/core/player/character/character.go @@ -10,8 +10,8 @@ import ( "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/task" + "github.com/genshinsim/gcsim/pkg/gmod" "github.com/genshinsim/gcsim/pkg/model" - "github.com/genshinsim/gcsim/pkg/modifier" ) type Character interface { @@ -122,7 +122,7 @@ type CharWrapper struct { BaseStats [attributes.EndStatType]float64 // mods - mods []modifier.Mod + mods []gmod.Mod // dash cd: keeps track of remaining cd frames for off-field chars RemainingDashCD int @@ -151,7 +151,7 @@ func New( events: events, tasks: tasker, Tags: make(map[string]int), - mods: make([]modifier.Mod, 0, 20), + mods: make([]gmod.Mod, 0, 20), f: f, debug: debug, } diff --git a/pkg/core/player/character/mods.go b/pkg/core/player/character/mods.go index 9c59ec9378..795fa6fe45 100644 --- a/pkg/core/player/character/mods.go +++ b/pkg/core/player/character/mods.go @@ -9,41 +9,41 @@ import ( "github.com/genshinsim/gcsim/pkg/core/attributes" "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) type ( // Status is basic mod for keeping track Status; usually affected by hitlag Status struct { - modifier.Base + gmod.Base } AttackMod struct { Amount AttackModFunc - modifier.Base + gmod.Base } AttackModFunc func(atk *info.AttackEvent, t info.Target) ([]float64, bool) CooldownMod struct { Amount CooldownModFunc - modifier.Base + gmod.Base } CooldownModFunc func(a action.Action) float64 DamageReductionMod struct { Amount DamageReductionModFunc - modifier.Base + gmod.Base } DamageReductionModFunc func() (float64, bool) HealBonusMod struct { Amount HealBonusModFunc - modifier.Base + gmod.Base } HealBonusModFunc func() (float64, bool) ReactBonusMod struct { Amount ReactBonusModFunc - modifier.Base + gmod.Base } ReactBonusModFunc func(info.AttackInfo) (float64, bool) @@ -51,7 +51,7 @@ type ( AffectedStat attributes.Stat Extra bool Amount StatModFunc - modifier.Base + gmod.Base } StatModFunc func() ([]float64, bool) ) @@ -60,7 +60,7 @@ type ( func (c *CharWrapper) AddStatus(key string, dur int, hitlag bool) { mod := Status{ - Base: modifier.Base{ + Base: gmod.Base{ ModKey: key, Dur: dur, Hitlag: hitlag, @@ -71,50 +71,50 @@ func (c *CharWrapper) AddStatus(key string, dur int, hitlag bool) { } else { mod.ModExpiry = *c.f + mod.Dur } - overwrote, oldEvt := modifier.Add[modifier.Mod](&c.mods, &mod, *c.f) - modifier.LogAdd("status", c.Index(), &mod, c.log, overwrote, oldEvt) + overwrote, oldEvt := gmod.Add[gmod.Mod](&c.mods, &mod, *c.f) + gmod.LogAdd("status", c.Index(), &mod, c.log, overwrote, oldEvt) } func (c *CharWrapper) AddAttackMod(mod AttackMod) { mod.SetExpiry(*c.f) - overwrote, oldEvt := modifier.Add[modifier.Mod](&c.mods, &mod, *c.f) - modifier.LogAdd("attack", c.Index(), &mod, c.log, overwrote, oldEvt) + overwrote, oldEvt := gmod.Add[gmod.Mod](&c.mods, &mod, *c.f) + gmod.LogAdd("attack", c.Index(), &mod, c.log, overwrote, oldEvt) } func (c *CharWrapper) AddCooldownMod(mod CooldownMod) { mod.SetExpiry(*c.f) - overwrote, oldEvt := modifier.Add[modifier.Mod](&c.mods, &mod, *c.f) - modifier.LogAdd("cd", c.Index(), &mod, c.log, overwrote, oldEvt) + overwrote, oldEvt := gmod.Add[gmod.Mod](&c.mods, &mod, *c.f) + gmod.LogAdd("cd", c.Index(), &mod, c.log, overwrote, oldEvt) } func (c *CharWrapper) AddDamageReductionMod(mod DamageReductionMod) { mod.SetExpiry(*c.f) - overwrote, oldEvt := modifier.Add[modifier.Mod](&c.mods, &mod, *c.f) - modifier.LogAdd("dr", c.Index(), &mod, c.log, overwrote, oldEvt) + overwrote, oldEvt := gmod.Add[gmod.Mod](&c.mods, &mod, *c.f) + gmod.LogAdd("dr", c.Index(), &mod, c.log, overwrote, oldEvt) } func (c *CharWrapper) AddHealBonusMod(mod HealBonusMod) { mod.SetExpiry(*c.f) - overwrote, oldEvt := modifier.Add[modifier.Mod](&c.mods, &mod, *c.f) - modifier.LogAdd("heal bonus", c.Index(), &mod, c.log, overwrote, oldEvt) + overwrote, oldEvt := gmod.Add[gmod.Mod](&c.mods, &mod, *c.f) + gmod.LogAdd("heal bonus", c.Index(), &mod, c.log, overwrote, oldEvt) } func (c *CharWrapper) AddReactBonusMod(mod ReactBonusMod) { mod.SetExpiry(*c.f) - overwrote, oldEvt := modifier.Add[modifier.Mod](&c.mods, &mod, *c.f) - modifier.LogAdd("react bonus", c.Index(), &mod, c.log, overwrote, oldEvt) + overwrote, oldEvt := gmod.Add[gmod.Mod](&c.mods, &mod, *c.f) + gmod.LogAdd("react bonus", c.Index(), &mod, c.log, overwrote, oldEvt) } func (c *CharWrapper) AddStatMod(mod StatMod) { mod.SetExpiry(*c.f) - overwrote, oldEvt := modifier.Add[modifier.Mod](&c.mods, &mod, *c.f) - modifier.LogAdd("stat", c.Index(), &mod, c.log, overwrote, oldEvt) + overwrote, oldEvt := gmod.Add[gmod.Mod](&c.mods, &mod, *c.f) + gmod.LogAdd("stat", c.Index(), &mod, c.log, overwrote, oldEvt) } // Delete. func (c *CharWrapper) deleteMod(key string) { - m := modifier.Delete(&c.mods, key) + m := gmod.Delete(&c.mods, key) if m != nil && (m.Expiry() > *c.f || m.Expiry() == -1) { m.Event().SetEnded(*c.f) } @@ -130,7 +130,7 @@ func (c *CharWrapper) DeleteStatMod(key string) { c.deleteMod(key) } // Active. func (c *CharWrapper) modIsActive(key string) bool { - _, ok := modifier.FindCheckExpiry(&c.mods, key, *c.f) + _, ok := gmod.FindCheckExpiry(&c.mods, key, *c.f) return ok } func (c *CharWrapper) StatusIsActive(key string) bool { return c.modIsActive(key) } @@ -143,7 +143,7 @@ func (c *CharWrapper) StatModIsActive(key string) bool { return c.mod // Expiry. func (c *CharWrapper) getModExpiry(key string) int { - m := modifier.Find(&c.mods, key) + m := gmod.Find(&c.mods, key) if m != -1 { return c.mods[m].Expiry() } @@ -155,7 +155,7 @@ func (c *CharWrapper) StatusExpiry(key string) int { return c.getModExpiry(key) // Duration. func (c *CharWrapper) getModDuration(key string) int { - m := modifier.Find(&c.mods, key) + m := gmod.Find(&c.mods, key) if m == -1 { return 0 } @@ -170,7 +170,7 @@ func (c *CharWrapper) StatusDuration(key string) int { return c.getModDuration(k // extendMod returns true if mod is active and is extended func (c *CharWrapper) extendMod(key string, ext int) bool { - m, active := modifier.FindCheckExpiry(&c.mods, key, *c.f) + m, active := gmod.FindCheckExpiry(&c.mods, key, *c.f) if m == -1 { return false } diff --git a/pkg/enemy/enemy.go b/pkg/enemy/enemy.go index b65ed03359..829b4bd9f9 100644 --- a/pkg/enemy/enemy.go +++ b/pkg/enemy/enemy.go @@ -8,7 +8,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/hacks" "github.com/genshinsim/gcsim/pkg/core/info" "github.com/genshinsim/gcsim/pkg/core/task" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" "github.com/genshinsim/gcsim/pkg/target" ) @@ -27,7 +27,7 @@ type Enemy struct { particleDropIndex int // for custom HP drops // mods - mods []modifier.Mod + mods []gmod.Mod // hitlag stuff timePassed int @@ -47,7 +47,7 @@ func New(core *core.Core, p info.EnemyProfile) *Enemy { // TODO: should pass in a info.Reactable instead e.Reactable = hacks.NewReactable(e, core) e.SetFreezeResist(e.prof.FreezeResist) - e.mods = make([]modifier.Mod, 0, 10) + e.mods = make([]gmod.Mod, 0, 10) if core.Combat.DamageMode { e.hp = p.HP e.maxhp = p.HP diff --git a/pkg/enemy/mods.go b/pkg/enemy/mods.go index 1829e2b770..464ceeebb2 100644 --- a/pkg/enemy/mods.go +++ b/pkg/enemy/mods.go @@ -6,13 +6,13 @@ import ( "github.com/genshinsim/gcsim/pkg/core/glog" "github.com/genshinsim/gcsim/pkg/core/info" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) // Add. func (e *Enemy) AddStatus(key string, dur int, hitlag bool) { mod := info.Status{ - Base: modifier.Base{ + Base: gmod.Base{ ModKey: key, Dur: dur, Hitlag: hitlag, @@ -23,26 +23,26 @@ func (e *Enemy) AddStatus(key string, dur int, hitlag bool) { } else { mod.ModExpiry = e.Core.F + mod.Dur } - overwrote, oldEvt := modifier.Add[modifier.Mod](&e.mods, &mod, e.Core.F) - modifier.LogAdd("status", -1, &mod, e.Core.Log, overwrote, oldEvt) + overwrote, oldEvt := gmod.Add[gmod.Mod](&e.mods, &mod, e.Core.F) + gmod.LogAdd("status", -1, &mod, e.Core.Log, overwrote, oldEvt) } func (e *Enemy) AddResistMod(mod info.ResistMod) { mod.SetExpiry(e.Core.F) - overwrote, oldEvt := modifier.Add[modifier.Mod](&e.mods, &mod, e.Core.F) - modifier.LogAdd("enemy", -1, &mod, e.Core.Log, overwrote, oldEvt) + overwrote, oldEvt := gmod.Add[gmod.Mod](&e.mods, &mod, e.Core.F) + gmod.LogAdd("enemy", -1, &mod, e.Core.Log, overwrote, oldEvt) } func (e *Enemy) AddDefMod(mod info.DefMod) { mod.SetExpiry(e.Core.F) - overwrote, oldEvt := modifier.Add[modifier.Mod](&e.mods, &mod, e.Core.F) - modifier.LogAdd("enemy", -1, &mod, e.Core.Log, overwrote, oldEvt) + overwrote, oldEvt := gmod.Add[gmod.Mod](&e.mods, &mod, e.Core.F) + gmod.LogAdd("enemy", -1, &mod, e.Core.Log, overwrote, oldEvt) } // Delete. func (e *Enemy) deleteMod(key string) { - m := modifier.Delete(&e.mods, key) + m := gmod.Delete(&e.mods, key) if m != nil && (m.Expiry() > e.Core.F || m.Expiry() == -1) { m.Event().SetEnded(e.Core.F) } @@ -54,7 +54,7 @@ func (e *Enemy) DeleteDefMod(key string) { e.deleteMod(key) } // Active. func (e *Enemy) modIsActive(key string) bool { - _, ok := modifier.FindCheckExpiry(&e.mods, key, e.Core.F) + _, ok := gmod.FindCheckExpiry(&e.mods, key, e.Core.F) return ok } func (e *Enemy) StatusIsActive(key string) bool { return e.modIsActive(key) } @@ -64,7 +64,7 @@ func (e *Enemy) DefModIsActive(key string) bool { return e.modIsActive(key) } // Expiry func (e *Enemy) getModExpiry(key string) int { - m := modifier.Find(&e.mods, key) + m := gmod.Find(&e.mods, key) if m != -1 { return e.mods[m].Expiry() } diff --git a/pkg/engine/engine.go b/pkg/engine/engine.go new file mode 100644 index 0000000000..bc71f1fc73 --- /dev/null +++ b/pkg/engine/engine.go @@ -0,0 +1,12 @@ +package engine + +import "github.com/genshinsim/gcsim/pkg/core/info" + +type ModifierMgr interface { + Handler(info.EntityIndex) ModifierHandler +} + +type ModifierHandler interface { + Tick() + Add(*info.Modifier) (bool, error) +} diff --git a/pkg/modifier/modifier.go b/pkg/gmod/gmod.go similarity index 92% rename from pkg/modifier/modifier.go rename to pkg/gmod/gmod.go index 57ffacf6a3..7814574610 100644 --- a/pkg/modifier/modifier.go +++ b/pkg/gmod/gmod.go @@ -1,6 +1,8 @@ -// package modifier provides a universal way of handling a slice -// of modifiers -package modifier +// package gmod provides a universal way of handling a slice +// of modifiers; note that this is gcsim's interpretation of +// a modifier and does not mirror proper in-game behaviour, +// thus is named gmod (originally named modifier) +package gmod import ( "github.com/genshinsim/gcsim/pkg/core/glog" diff --git a/pkg/modifier/add.go b/pkg/modifier/add.go new file mode 100644 index 0000000000..60dd105641 --- /dev/null +++ b/pkg/modifier/add.go @@ -0,0 +1,82 @@ +package modifier + +import ( + "fmt" + + "github.com/genshinsim/gcsim/pkg/core/info" +) + +// Add returns true if this is a new modifier or error on unsupported stacking type +func (h *Handler) Add(m *info.Modifier) (bool, error) { + if m.Durability <= 0 { + return false, fmt.Errorf("modifier %v has non-positive durability: %v", m.Name, m.Durability) + } + // force decay rate, but only if duration is positive + // negative duration means infinite duration + m.DecayRate = 0 + if m.Duration > 0 { + m.DecayRate = m.Durability / info.Durability(m.Duration) + } + var added bool + switch m.Stacking { + case info.Refresh: + added = h.refresh(m) + case info.Unique: + added = h.unique(m) + case info.Overlap: + added = h.overlap(m) + case info.OverlapRefreshDuration: + added = h.overlapRefreshDuration(m) + default: + return false, fmt.Errorf("unsupported stacking type: %v", m.Stacking) + } + if added && m.OnAdd != nil { + m.OnAdd(m) + } + return added, nil +} + +// single instance; can't be re-applied unless expired +func (h *Handler) unique(m *info.Modifier) bool { + for _, mod := range h.modifiers { + if mod.Name == m.Name { + return false + } + } + h.modifiers = append(h.modifiers, m) + return true +} + +// single instance. re-apply resets durability and doesn't trigger onAdded/onRemoved +// or reset onThinkInterval +func (h *Handler) refresh(m *info.Modifier) bool { + for _, mod := range h.modifiers { + if mod.Name == m.Name { + // TODO: this will overwrite everything in the dest mod, including the src + // consider if this actually matters or not? + *mod = *m + return false + } + } + h.modifiers = append(h.modifiers, m) + return true +} + +// multiple instances can co-exist at the same time +func (h *Handler) overlap(m *info.Modifier) bool { + h.modifiers = append(h.modifiers, m) + return true +} + +// refresh any existing with lower durability; update decay rate and duration +func (h *Handler) overlapRefreshDuration(m *info.Modifier) bool { + for _, mod := range h.modifiers { + if mod.Name == m.Name && mod.Durability < m.Durability { + mod.Durability = m.Durability + mod.Duration = m.Duration + mod.DecayRate = m.DecayRate + } + } + h.modifiers = append(h.modifiers, m) + return true +} diff --git a/pkg/modifier/handler.go b/pkg/modifier/handler.go new file mode 100644 index 0000000000..7e5f3d8e6b --- /dev/null +++ b/pkg/modifier/handler.go @@ -0,0 +1,74 @@ +// package modifer provides a Handler that is used to handle +// modifiers on a per target basis, with duration/durability/stacking +// handling mirror'd to game (as much as possible) +package modifier + +import ( + "slices" + + "github.com/genshinsim/gcsim/pkg/core/info" + "github.com/genshinsim/gcsim/pkg/core/keys" +) + +type Handler struct { + modifiers []*info.Modifier +} + +func (h *Handler) Tick() { + // reduce durability + n := 0 + for i, mod := range h.modifiers { + if mod.PreTick != nil { + mod.PreTick(mod) + } + mod.Durability -= mod.DecayRate + if mod.Durability < 0 { + mod.Durability = 0 + } + if mod.PostTick != nil { + mod.PostTick(mod) + } + // delete mods if durability is 0 + if mod.Durability <= info.ZeroDur { + if mod.OnRemove != nil { + mod.OnRemove(mod) + } + } else { + h.modifiers[n] = h.modifiers[i] + n++ + } + } + h.modifiers = h.modifiers[:n] +} + +func (h *Handler) Get(name keys.Modifier) []*info.Modifier { + var res []*info.Modifier + for _, m := range h.modifiers { + if m.Name == name { + res = append(res, m) + } + } + return res +} + +func (h *Handler) GetMaxDurability(name keys.Modifier) *info.Modifier { + var res *info.Modifier + for _, m := range h.modifiers { + if m.Name != name { + continue + } + if res == nil || res.Durability < m.Durability { + res = m + } + } + return res +} + +func (h *Handler) MatchAny(names ...keys.Modifier) bool { + for _, m := range h.modifiers { + if slices.Contains(names, m.Name) { + return true + } + } + return false +} diff --git a/pkg/modifier/handler_test.go b/pkg/modifier/handler_test.go new file mode 100644 index 0000000000..e1f27bcfd0 --- /dev/null +++ b/pkg/modifier/handler_test.go @@ -0,0 +1,202 @@ +package modifier + +import ( + "testing" + + "github.com/genshinsim/gcsim/pkg/core/info" + "github.com/genshinsim/gcsim/pkg/core/keys" + "github.com/stretchr/testify/assert" +) + +func TestUniqueModifier(t *testing.T) { + calledOnRemove := false + mod := info.Modifier{ + Name: keys.TestingMod, + Duration: 10, + Durability: 100, + Stacking: info.Unique, + ModifierListeners: info.ModifierListeners{ + OnRemove: func(_ *info.Modifier) { + calledOnRemove = true + }, + }, + } + h := &Handler{} + + // Add the modifier + ok, err := h.Add(&mod) + assert.NoError(t, err, "adding modifier should not error") + assert.True(t, ok, "modifier should be added as new") + + assert.Equal(t, mod.Durability/info.Durability(mod.Duration), mod.DecayRate, "decay rate should be correctly calculated") + + // make sure can't add same modifier again + mod2 := mod + ok, err = h.Add(&mod2) + assert.NoError(t, err, "adding duplicate unique modifier should not error") + assert.False(t, ok, "duplicate unique modifier should not be added") + + for range 11 { + h.Tick() + } + + // Assert that OnRemove was called + assert.True(t, calledOnRemove, "OnRemove should have been called after 11 ticks") + assert.Equal(t, 0, len(h.modifiers), "No modifiers should remain after expiration") +} + +func TestRefreshModifier(t *testing.T) { + h := &Handler{} + removeSrc := 0 + mod := info.Modifier{ + Name: keys.TestingMod, + Duration: 10, + Durability: 100, + Stacking: info.Refresh, + ModifierListeners: info.ModifierListeners{ + OnRemove: func(_ *info.Modifier) { + removeSrc = 1 + }, + }, + } + ok, err := h.Add(&mod) + assert.NoError(t, err, "adding modifier should not error") + assert.True(t, ok, "modifier should be added as new") + + assert.Equal(t, mod.Durability/info.Durability(mod.Duration), mod.DecayRate, "decay rate should be correctly calculated") + + // adding same modifier should replace all the properties + mod2 := mod + mod2.OnRemove = func(_ *info.Modifier) { + removeSrc = 2 + } + ok, err = h.Add(&mod2) + assert.NoError(t, err, "adding duplicate refresh modifier should not error") + assert.False(t, ok, "duplicate refresh modifier should not be new") + + for range 11 { + h.Tick() + } + + assert.Equal(t, 2, removeSrc, "OnRemove should be from the second modifier") + assert.Equal(t, 0, len(h.modifiers), "No modifiers should remain after expiration") +} + +func TestOverlapModifier(t *testing.T) { + h := &Handler{} + removeCallCount := 0 + + // Create base modifier + baseMod := info.Modifier{ + Name: keys.TestingMod, + Duration: 10, + Durability: 100, + Stacking: info.Overlap, + ModifierListeners: info.ModifierListeners{ + OnRemove: func(_ *info.Modifier) { + removeCallCount++ + }, + }, + } + + // Add first modifier + mod1 := baseMod + ok, err := h.Add(&mod1) + assert.NoError(t, err, "adding first modifier should not error") + assert.True(t, ok, "first modifier should be added as new") + assert.Equal(t, mod1.Durability/info.Durability(mod1.Duration), mod1.DecayRate, "decay rate should be correctly calculated") + + // Add second modifier (should stack) + mod2 := baseMod + ok, err = h.Add(&mod2) + assert.NoError(t, err, "adding second overlap modifier should not error") + assert.True(t, ok, "second overlap modifier should be added as new") + + // Add third modifier (should stack) + mod3 := baseMod + ok, err = h.Add(&mod3) + assert.NoError(t, err, "adding third overlap modifier should not error") + assert.True(t, ok, "third overlap modifier should be added as new") + + // Confirm all 3 modifiers exist + assert.Equal(t, 3, len(h.modifiers), "Should have 3 stacked modifiers") + + // Tick down to expire all modifiers + for range 11 { + h.Tick() + } + + // Assert that OnRemove was called for all 3 modifiers + assert.Equal(t, 3, removeCallCount, "OnRemove should have been called 3 times for all stacked modifiers") + assert.Equal(t, 0, len(h.modifiers), "No modifiers should remain after expiration") +} + +func TestOverlapRefreshDurationModifier(t *testing.T) { + h := &Handler{} + removeCallCount := 0 + + // Create base modifier + baseMod := info.Modifier{ + Name: keys.TestingMod, + Duration: 10, + Durability: 100, + Stacking: info.OverlapRefreshDuration, + ModifierListeners: info.ModifierListeners{ + OnRemove: func(_ *info.Modifier) { + removeCallCount++ + }, + }, + } + expectedDecay := baseMod.Durability / info.Durability(baseMod.Duration) + + // Add first modifier + mod1 := baseMod + ok, err := h.Add(&mod1) + assert.NoError(t, err, "adding first modifier should not error") + assert.True(t, ok, "first modifier should be added as new") + assert.Equal(t, expectedDecay, mod1.DecayRate, "decay rate should be correctly calculated") + + // Tick 3 times - durability should decrease by 30 (10 per tick) + for range 3 { + h.Tick() + } + assert.Equal(t, 1, len(h.modifiers), "Should have 1 modifier") + assert.Equal(t, baseMod.Durability-3*expectedDecay, h.modifiers[0].Durability, "Durability should be 70 after 3 ticks") + + // Add second modifier (should refresh durability of existing) + mod2 := baseMod + ok, err = h.Add(&mod2) + assert.NoError(t, err, "adding second overlap refresh modifier should not error") + assert.True(t, ok, "second overlap refresh modifier should be considered new") + assert.Equal(t, 2, len(h.modifiers), "Should have 2 modifier") + for i, m := range h.modifiers { + assert.Equal(t, baseMod.Durability, m.Durability, "Durability on mod %v should be refreshed to 100", i) + } + + // Tick 3 times again + for range 3 { + h.Tick() + } + for i, m := range h.modifiers { + assert.Equal(t, baseMod.Durability-3*expectedDecay, m.Durability, "Durability on mod %v should be 70 after 3 more ticks", i) + } + + // Add third modifier (should refresh durability again) + mod3 := baseMod + ok, err = h.Add(&mod3) + assert.NoError(t, err, "adding third overlap refresh modifier should not error") + assert.True(t, ok, "third overlap refresh modifier should be considered new") + assert.Equal(t, 3, len(h.modifiers), "Should have 3 modifier") + for i, m := range h.modifiers { + assert.Equal(t, baseMod.Durability, m.Durability, "Durability on mod %v should be refreshed to 100", i) + } + + // Tick down to expire the modifier + for range 11 { + h.Tick() + } + + // Assert that OnRemove was called only once (since there's only one modifier) + assert.Equal(t, 3, removeCallCount, "OnRemove should have been called 3 times") + assert.Equal(t, 0, len(h.modifiers), "No modifiers should remain after expiration") +} diff --git a/pkg/modifier/manager.go b/pkg/modifier/manager.go new file mode 100644 index 0000000000..bfa9cf30ec --- /dev/null +++ b/pkg/modifier/manager.go @@ -0,0 +1,28 @@ +package modifier + +import ( + "github.com/genshinsim/gcsim/pkg/core/info" + "github.com/genshinsim/gcsim/pkg/engine" +) + +type Manager struct { + handlers []*Handler +} + +func NewManager(size int) *Manager { + h := make([]*Handler, size) + for i := range h { + h[i] = &Handler{} + } + return &Manager{ + handlers: h, + } +} + +func (m *Manager) Handler(id info.EntityIndex) engine.ModifierHandler { + return m.handlers[id] +} + +func (m *Manager) Add(mod *info.Modifier) (bool, error) { + return m.handlers[mod.Target].Add(mod) +} diff --git a/pkg/simulation/setup.go b/pkg/simulation/setup.go index 67e66d4d03..50bfc3c90c 100644 --- a/pkg/simulation/setup.go +++ b/pkg/simulation/setup.go @@ -16,7 +16,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core/keys" "github.com/genshinsim/gcsim/pkg/core/player/character" "github.com/genshinsim/gcsim/pkg/enemy" - "github.com/genshinsim/gcsim/pkg/modifier" + "github.com/genshinsim/gcsim/pkg/gmod" ) const nightsoulBurstICDStatus = "nightsoul-burst-icd" @@ -43,6 +43,7 @@ func SetupTargetsInCore(core *core.Core, p info.Point, r float64, targets []info e := enemy.New(core, *v) core.Combat.AddEnemy(e) // s.stats.ElementUptime[i+1] = make(map[core.EleType]int) + core.EntityIndexer.Register(int(e.Key())) } // default target is closest to player? @@ -122,7 +123,7 @@ func SetupResonance(s *core.Core) { } for _, c := range chars { c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("pyro-res", -1), + Base: gmod.NewBase("pyro-res", -1), AffectedStat: attributes.NoStat, Amount: f, }) @@ -133,7 +134,7 @@ func SetupResonance(s *core.Core) { val[attributes.HPP] = 0.25 for _, c := range chars { c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("hydro-res-hpp", -1), + Base: gmod.NewBase("hydro-res-hpp", -1), AffectedStat: attributes.HPP, Amount: func() ([]float64, bool) { return val, true @@ -155,7 +156,7 @@ func SetupResonance(s *core.Core) { } for _, c := range chars { c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("cryo-res", -1), + Base: gmod.NewBase("cryo-res", -1), Amount: f, }) } @@ -204,7 +205,7 @@ func SetupResonance(s *core.Core) { atk := args[1].(*info.AttackEvent) if s.Player.Shields.CharacterIsShielded(atk.Info.ActorIndex, s.Player.Active()) { t.AddResistMod(info.ResistMod{ - Base: modifier.NewBaseWithHitlag("geo-res", 15*60), + Base: gmod.NewBaseWithHitlag("geo-res", 15*60), Ele: attributes.Geo, Value: -0.2, }) @@ -222,7 +223,7 @@ func SetupResonance(s *core.Core) { } for _, c := range chars { c.AddAttackMod(character.AttackMod{ - Base: modifier.NewBase("geo-res", -1), + Base: gmod.NewBase("geo-res", -1), Amount: atkf, }) } @@ -234,7 +235,7 @@ func SetupResonance(s *core.Core) { // TODO: movement spd increase? for _, c := range chars { c.AddCooldownMod(character.CooldownMod{ - Base: modifier.NewBase("anemo-res-cd", -1), + Base: gmod.NewBase("anemo-res-cd", -1), Amount: func(a action.Action) float64 { return -0.05 }, }) } @@ -243,7 +244,7 @@ func SetupResonance(s *core.Core) { val[attributes.EM] = 50 for _, c := range chars { c.AddStatMod(character.StatMod{ - Base: modifier.NewBase("dendro-res-50", -1), + Base: gmod.NewBase("dendro-res-50", -1), AffectedStat: attributes.EM, Amount: func() ([]float64, bool) { return val, true @@ -259,7 +260,7 @@ func SetupResonance(s *core.Core) { } for _, c := range chars { c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("dendro-res-30", 6*60), + Base: gmod.NewBaseWithHitlag("dendro-res-30", 6*60), AffectedStat: attributes.EM, Amount: func() ([]float64, bool) { return twoBuff, true @@ -277,7 +278,7 @@ func SetupResonance(s *core.Core) { threeEl := func(_ ...any) bool { for _, c := range chars { c.AddStatMod(character.StatMod{ - Base: modifier.NewBaseWithHitlag("dendro-res-20", 6*60), + Base: gmod.NewBaseWithHitlag("dendro-res-20", 6*60), AffectedStat: attributes.EM, Amount: func() ([]float64, bool) { return threeBuff, true @@ -313,7 +314,7 @@ func SetupMisc(c *core.Core) { } // add shred t.AddResistMod(info.ResistMod{ - Base: modifier.NewBaseWithHitlag("superconduct-phys-shred", 12*60), + Base: gmod.NewBaseWithHitlag("superconduct-phys-shred", 12*60), Ele: attributes.Physical, Value: -0.4, }) diff --git a/pkg/simulation/simulation.go b/pkg/simulation/simulation.go index 5ad8345a65..c1672dd7ea 100644 --- a/pkg/simulation/simulation.go +++ b/pkg/simulation/simulation.go @@ -7,6 +7,7 @@ import ( "github.com/genshinsim/gcsim/pkg/core" "github.com/genshinsim/gcsim/pkg/core/action" "github.com/genshinsim/gcsim/pkg/core/info" + "github.com/genshinsim/gcsim/pkg/modifier" "github.com/genshinsim/gcsim/pkg/stats" ) @@ -62,6 +63,8 @@ func New(cfg *info.ActionList, eval action.Evaluator, c *core.Core) (*Simulation return nil, err } + s.C.Modifiers = modifier.NewManager(c.EntityIndexer.Size()) + // nightsoul require char stats to be initialized setupNightsoulBurst(c)