add first targeted affect (ally)

This commit is contained in:
stryan 2021-11-10 17:44:54 -05:00
parent 3648b6ba16
commit e9b81f7ea9
2 changed files with 14 additions and 0 deletions

View File

@ -29,8 +29,13 @@ func AddEffect(c *Card, e *Effect) {
//can't apply effect to empty card
return
}
if e.Target == uuid.Nil {
log.Println("trying to apply targeted effect before target set")
return
}
if c.Position < 0 || c.Position > 3 {
log.Println("trying to apply effect to card not on the board")
return
}
for _, v := range c.Effects {
if v.Owner == e.Owner && v.ID == e.ID && v.Target == e.Target {

View File

@ -1,6 +1,7 @@
package tome_lib
type GameStatus int
type TargetStatus int
const (
StatusLobby = iota
@ -12,6 +13,14 @@ const (
StatusDraw
)
const (
TargetSelf = iota
TargetOwn
TargetOpp
TargetAny
TargetNone
)
const (
SentinalID = 1
ScourgeID = 2