Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions internal/artifacts/archaic/archaic.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions internal/artifacts/berserker/berserker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions internal/artifacts/blizzard/blizzard.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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
Expand All @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions internal/artifacts/bloodstained/bloodstained.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions internal/artifacts/bolide/bolide.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions internal/artifacts/braveheart/braveheart.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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
Expand All @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions internal/artifacts/crimson/crimson.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions internal/artifacts/deepwood/deepwood.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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
Expand All @@ -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,
})
Expand Down
4 changes: 2 additions & 2 deletions internal/artifacts/defenderswill/defenderswill.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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
Expand All @@ -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 {
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions internal/artifacts/echoes/echoes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions internal/artifacts/emblem/emblem.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions internal/artifacts/exile/exile.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
Loading