Skip to content

Commit 07603a6

Browse files
committed
move attackevent and target into model
1 parent 5736e7d commit 07603a6

878 files changed

Lines changed: 3180 additions & 2674 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

internal/artifacts/berserker/berserker.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ package berserker
33
import (
44
"github.com/genshinsim/gcsim/pkg/core"
55
"github.com/genshinsim/gcsim/pkg/core/attributes"
6-
"github.com/genshinsim/gcsim/pkg/core/combat"
76
"github.com/genshinsim/gcsim/pkg/core/info"
87
"github.com/genshinsim/gcsim/pkg/core/keys"
98
"github.com/genshinsim/gcsim/pkg/core/player/character"
9+
"github.com/genshinsim/gcsim/pkg/model"
1010
"github.com/genshinsim/gcsim/pkg/modifier"
1111
)
1212

@@ -44,7 +44,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri
4444
m[attributes.CR] = 0.24
4545
char.AddAttackMod(character.AttackMod{
4646
Base: modifier.NewBase("berserker-4pc", -1),
47-
Amount: func(atk *combat.AttackEvent, t combat.Target) ([]float64, bool) {
47+
Amount: func(atk *model.AttackEvent, t model.Target) ([]float64, bool) {
4848
if char.CurrentHPRatio() > 0.7 {
4949
return nil, false
5050
}

internal/artifacts/blizzard/blizzard.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ package blizzard
33
import (
44
"github.com/genshinsim/gcsim/pkg/core"
55
"github.com/genshinsim/gcsim/pkg/core/attributes"
6-
"github.com/genshinsim/gcsim/pkg/core/combat"
76
"github.com/genshinsim/gcsim/pkg/core/info"
87
"github.com/genshinsim/gcsim/pkg/core/keys"
98
"github.com/genshinsim/gcsim/pkg/core/player/character"
9+
"github.com/genshinsim/gcsim/pkg/model"
1010
"github.com/genshinsim/gcsim/pkg/modifier"
1111
)
1212

@@ -41,7 +41,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri
4141
m := make([]float64, attributes.EndStatType)
4242
char.AddAttackMod(character.AttackMod{
4343
Base: modifier.NewBase("bs-4pc", -1),
44-
Amount: func(atk *combat.AttackEvent, t combat.Target) ([]float64, bool) {
44+
Amount: func(atk *model.AttackEvent, t model.Target) ([]float64, bool) {
4545
r, ok := t.(core.Reactable)
4646
if !ok {
4747
return nil, false

internal/artifacts/bloodstained/bloodstained.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ import (
77
"github.com/genshinsim/gcsim/pkg/core/action"
88
"github.com/genshinsim/gcsim/pkg/core/attacks"
99
"github.com/genshinsim/gcsim/pkg/core/attributes"
10-
"github.com/genshinsim/gcsim/pkg/core/combat"
1110
"github.com/genshinsim/gcsim/pkg/core/event"
1211
"github.com/genshinsim/gcsim/pkg/core/info"
1312
"github.com/genshinsim/gcsim/pkg/core/keys"
1413
"github.com/genshinsim/gcsim/pkg/core/player/character"
1514
"github.com/genshinsim/gcsim/pkg/enemy"
15+
"github.com/genshinsim/gcsim/pkg/model"
1616
"github.com/genshinsim/gcsim/pkg/modifier"
1717
)
1818

@@ -59,7 +59,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri
5959
if !ok {
6060
return false
6161
}
62-
atk := args[1].(*combat.AttackEvent)
62+
atk := args[1].(*model.AttackEvent)
6363
// don't proc if someone else defeated the enemy
6464
if atk.Info.ActorIndex != char.Index {
6565
return false
@@ -72,7 +72,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri
7272
// charged attack dmg% part
7373
char.AddAttackMod(character.AttackMod{
7474
Base: modifier.NewBaseWithHitlag("bloodstained-4pc-dmg%", 600),
75-
Amount: func(atk *combat.AttackEvent, t combat.Target) ([]float64, bool) {
75+
Amount: func(atk *model.AttackEvent, t model.Target) ([]float64, bool) {
7676
if atk.Info.AttackTag != attacks.AttackTagExtra {
7777
return nil, false
7878
}

internal/artifacts/bolide/bolide.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import (
44
"github.com/genshinsim/gcsim/pkg/core"
55
"github.com/genshinsim/gcsim/pkg/core/attacks"
66
"github.com/genshinsim/gcsim/pkg/core/attributes"
7-
"github.com/genshinsim/gcsim/pkg/core/combat"
87
"github.com/genshinsim/gcsim/pkg/core/info"
98
"github.com/genshinsim/gcsim/pkg/core/keys"
109
"github.com/genshinsim/gcsim/pkg/core/player/character"
10+
"github.com/genshinsim/gcsim/pkg/model"
1111
"github.com/genshinsim/gcsim/pkg/modifier"
1212
)
1313

@@ -38,7 +38,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri
3838
m[attributes.DmgP] = 0.4
3939
char.AddAttackMod(character.AttackMod{
4040
Base: modifier.NewBase("bolide-4pc", -1),
41-
Amount: func(atk *combat.AttackEvent, t combat.Target) ([]float64, bool) {
41+
Amount: func(atk *model.AttackEvent, t model.Target) ([]float64, bool) {
4242
if atk.Info.AttackTag != attacks.AttackTagNormal && atk.Info.AttackTag != attacks.AttackTagExtra {
4343
return nil, false
4444
}

internal/artifacts/braveheart/braveheart.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ package braveheart
33
import (
44
"github.com/genshinsim/gcsim/pkg/core"
55
"github.com/genshinsim/gcsim/pkg/core/attributes"
6-
"github.com/genshinsim/gcsim/pkg/core/combat"
76
"github.com/genshinsim/gcsim/pkg/core/info"
87
"github.com/genshinsim/gcsim/pkg/core/keys"
98
"github.com/genshinsim/gcsim/pkg/core/player/character"
109
"github.com/genshinsim/gcsim/pkg/enemy"
10+
"github.com/genshinsim/gcsim/pkg/model"
1111
"github.com/genshinsim/gcsim/pkg/modifier"
1212
)
1313

@@ -52,7 +52,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri
5252
m[attributes.DmgP] = 0.30
5353
char.AddAttackMod(character.AttackMod{
5454
Base: modifier.NewBase("braveheart-4pc", -1),
55-
Amount: func(_ *combat.AttackEvent, t combat.Target) ([]float64, bool) {
55+
Amount: func(_ *model.AttackEvent, t model.Target) ([]float64, bool) {
5656
x, ok := t.(*enemy.Enemy)
5757
if !ok {
5858
return nil, false

internal/artifacts/crimson/crimson.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import (
66
"github.com/genshinsim/gcsim/pkg/core"
77
"github.com/genshinsim/gcsim/pkg/core/attacks"
88
"github.com/genshinsim/gcsim/pkg/core/attributes"
9-
"github.com/genshinsim/gcsim/pkg/core/combat"
109
"github.com/genshinsim/gcsim/pkg/core/event"
1110
"github.com/genshinsim/gcsim/pkg/core/glog"
1211
"github.com/genshinsim/gcsim/pkg/core/info"
1312
"github.com/genshinsim/gcsim/pkg/core/keys"
1413
"github.com/genshinsim/gcsim/pkg/core/player/character"
14+
"github.com/genshinsim/gcsim/pkg/model"
1515
"github.com/genshinsim/gcsim/pkg/modifier"
1616
)
1717

@@ -80,7 +80,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri
8080

8181
char.AddReactBonusMod(character.ReactBonusMod{
8282
Base: modifier.NewBase("crimson-4pc", -1),
83-
Amount: func(ai combat.AttackInfo) (float64, bool) {
83+
Amount: func(ai model.AttackInfo) (float64, bool) {
8484
switch ai.AttackTag {
8585
case attacks.AttackTagOverloadDamage,
8686
attacks.AttackTagBurningDamage,

internal/artifacts/deepwood/deepwood.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"github.com/genshinsim/gcsim/pkg/core/keys"
1414
"github.com/genshinsim/gcsim/pkg/core/player/character"
1515
"github.com/genshinsim/gcsim/pkg/enemy"
16+
"github.com/genshinsim/gcsim/pkg/model"
1617
"github.com/genshinsim/gcsim/pkg/modifier"
1718
)
1819

@@ -48,7 +49,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri
4849
}
4950
if count >= 4 {
5051
c.Events.Subscribe(event.OnEnemyDamage, func(args ...interface{}) bool {
51-
atk := args[1].(*combat.AttackEvent)
52+
atk := args[1].(*model.AttackEvent)
5253
t, ok := args[0].(*enemy.Enemy)
5354
if !ok {
5455
return false

internal/artifacts/desertpavilionchronicle/desertpavilionchronicle.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ import (
77
"github.com/genshinsim/gcsim/pkg/core/action"
88
"github.com/genshinsim/gcsim/pkg/core/attacks"
99
"github.com/genshinsim/gcsim/pkg/core/attributes"
10-
"github.com/genshinsim/gcsim/pkg/core/combat"
1110
"github.com/genshinsim/gcsim/pkg/core/event"
1211
"github.com/genshinsim/gcsim/pkg/core/info"
1312
"github.com/genshinsim/gcsim/pkg/core/keys"
1413
"github.com/genshinsim/gcsim/pkg/core/player/character"
14+
"github.com/genshinsim/gcsim/pkg/model"
1515
"github.com/genshinsim/gcsim/pkg/modifier"
1616
)
1717

@@ -49,7 +49,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri
4949

5050
if count >= 4 {
5151
c.Events.Subscribe(event.OnEnemyDamage, func(args ...interface{}) bool {
52-
atk := args[1].(*combat.AttackEvent)
52+
atk := args[1].(*model.AttackEvent)
5353
if atk.Info.ActorIndex != char.Index {
5454
return false
5555
}
@@ -74,7 +74,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri
7474
mDmg[attributes.DmgP] = 0.4
7575
char.AddAttackMod(character.AttackMod{
7676
Base: modifier.NewBaseWithHitlag("desert-4pc-dmg", 15*60),
77-
Amount: func(atk *combat.AttackEvent, t combat.Target) ([]float64, bool) {
77+
Amount: func(atk *model.AttackEvent, t model.Target) ([]float64, bool) {
7878
switch atk.Info.AttackTag {
7979
case attacks.AttackTagNormal:
8080
case attacks.AttackTagExtra:

internal/artifacts/echoes/echoes.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import (
66
"github.com/genshinsim/gcsim/pkg/core"
77
"github.com/genshinsim/gcsim/pkg/core/attacks"
88
"github.com/genshinsim/gcsim/pkg/core/attributes"
9-
"github.com/genshinsim/gcsim/pkg/core/combat"
109
"github.com/genshinsim/gcsim/pkg/core/event"
1110
"github.com/genshinsim/gcsim/pkg/core/glog"
1211
"github.com/genshinsim/gcsim/pkg/core/info"
1312
"github.com/genshinsim/gcsim/pkg/core/keys"
1413
"github.com/genshinsim/gcsim/pkg/core/player/character"
14+
"github.com/genshinsim/gcsim/pkg/model"
1515
"github.com/genshinsim/gcsim/pkg/modifier"
1616
)
1717

@@ -70,7 +70,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri
7070
}
7171

7272
// If attack does not belong to the equipped character then ignore
73-
atk := args[1].(*combat.AttackEvent)
73+
atk := args[1].(*model.AttackEvent)
7474
if atk.Info.ActorIndex != char.Index {
7575
return false
7676
}

internal/artifacts/emblem/emblem.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import (
44
"github.com/genshinsim/gcsim/pkg/core"
55
"github.com/genshinsim/gcsim/pkg/core/attacks"
66
"github.com/genshinsim/gcsim/pkg/core/attributes"
7-
"github.com/genshinsim/gcsim/pkg/core/combat"
87
"github.com/genshinsim/gcsim/pkg/core/info"
98
"github.com/genshinsim/gcsim/pkg/core/keys"
109
"github.com/genshinsim/gcsim/pkg/core/player/character"
10+
"github.com/genshinsim/gcsim/pkg/model"
1111
"github.com/genshinsim/gcsim/pkg/modifier"
1212
)
1313

@@ -49,7 +49,7 @@ func NewSet(c *core.Core, char *character.CharWrapper, count int, param map[stri
4949

5050
char.AddAttackMod(character.AttackMod{
5151
Base: modifier.NewBase("emblem-4pc", -1),
52-
Amount: func(atk *combat.AttackEvent, t combat.Target) ([]float64, bool) {
52+
Amount: func(atk *model.AttackEvent, t model.Target) ([]float64, bool) {
5353
if atk.Info.AttackTag != attacks.AttackTagElementalBurst {
5454
return nil, false
5555
}

0 commit comments

Comments
 (0)