add first targeted affect (ally)
This commit is contained in:
parent
3648b6ba16
commit
e9b81f7ea9
@ -29,8 +29,13 @@ func AddEffect(c *Card, e *Effect) {
|
|||||||
//can't apply effect to empty card
|
//can't apply effect to empty card
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if e.Target == uuid.Nil {
|
||||||
|
log.Println("trying to apply targeted effect before target set")
|
||||||
|
return
|
||||||
|
}
|
||||||
if c.Position < 0 || c.Position > 3 {
|
if c.Position < 0 || c.Position > 3 {
|
||||||
log.Println("trying to apply effect to card not on the board")
|
log.Println("trying to apply effect to card not on the board")
|
||||||
|
return
|
||||||
}
|
}
|
||||||
for _, v := range c.Effects {
|
for _, v := range c.Effects {
|
||||||
if v.Owner == e.Owner && v.ID == e.ID && v.Target == e.Target {
|
if v.Owner == e.Owner && v.ID == e.ID && v.Target == e.Target {
|
||||||
|
9
util.go
9
util.go
@ -1,6 +1,7 @@
|
|||||||
package tome_lib
|
package tome_lib
|
||||||
|
|
||||||
type GameStatus int
|
type GameStatus int
|
||||||
|
type TargetStatus int
|
||||||
|
|
||||||
const (
|
const (
|
||||||
StatusLobby = iota
|
StatusLobby = iota
|
||||||
@ -12,6 +13,14 @@ const (
|
|||||||
StatusDraw
|
StatusDraw
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
TargetSelf = iota
|
||||||
|
TargetOwn
|
||||||
|
TargetOpp
|
||||||
|
TargetAny
|
||||||
|
TargetNone
|
||||||
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
SentinalID = 1
|
SentinalID = 1
|
||||||
ScourgeID = 2
|
ScourgeID = 2
|
||||||
|
Loading…
Reference in New Issue
Block a user