diff --git a/internal/game/board.go b/internal/game/board.go index db4935c..83ffbdb 100644 --- a/internal/game/board.go +++ b/internal/game/board.go @@ -101,6 +101,7 @@ func (b *Board) Play(id int, c *Card, dest int, should bool) bool { brd := b.GetRow(id) if should { c.Position = dest + c.Owner = id brd[dest] = c } else { return false @@ -154,10 +155,8 @@ func (b *Board) Attack(id, atk, def int) int { func (b *Board) ResetCards() { for _, v := range b.Sentinal { v.Power = v.BasePower - v.Effects = []*Effect{} } for _, v := range b.Scourge { v.Power = v.BasePower - v.Effects = []*Effect{} } } diff --git a/internal/game/effect.go b/internal/game/effect.go index 7806b30..a236bf4 100644 --- a/internal/game/effect.go +++ b/internal/game/effect.go @@ -29,7 +29,7 @@ func AddEffect(c *Card, e *Effect) { return } for _, v := range c.Effects { - if v.Owner == e.Owner && v.ID == e.ID { + if v.Owner == e.Owner && v.ID == e.ID && v.Target == e.Target { log.Println("can't stack effects") return } diff --git a/internal/game/oracle.go b/internal/game/oracle.go index 2f00508..f16d549 100644 --- a/internal/game/oracle.go +++ b/internal/game/oracle.go @@ -65,7 +65,6 @@ func OracleTick(c *Card, g *Game) { //+1 around it if c.Position-1 >= 0 { AddEffect(row[c.Position-1], &Effect{c.Id, row[c.Position-1].Id, 1}) - } if c.Position+1 <= 3 { AddEffect(row[c.Position+1], &Effect{c.Id, row[c.Position+1].Id, 1}) @@ -140,8 +139,10 @@ func OracleEffect(c *Card, g *Game) { case 2: if c.Owner == SentinalID { g.CardBuffer = DeckFromCards(g.SentinalDeck.Scry(1)) - } else { + } else if c.Owner == ScourgeID { g.CardBuffer = DeckFromCards(g.SentinalDeck.Scry(1)) + } else { + log.Println("card draw effect was played but with no owner?") } g.CanDraw = true g.HasDrawn = false