From e9b81f7ea9fcb8183b4b166c9dbc0a0e50d12202 Mon Sep 17 00:00:00 2001 From: Steve Date: Wed, 10 Nov 2021 17:44:54 -0500 Subject: [PATCH] add first targeted affect (ally) --- effect.go | 5 +++++ util.go | 9 +++++++++ 2 files changed, 14 insertions(+) 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