diff --git a/effect.go b/effect.go index 0ce51e3..19fdd3a 100644 --- a/effect.go +++ b/effect.go @@ -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 { diff --git a/util.go b/util.go index 2adec51..40df812 100644 --- a/util.go +++ b/util.go @@ -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