add ally effect

This commit is contained in:
stryan 2021-11-10 17:46:19 -05:00
parent 1d45984958
commit e1fd108c06
2 changed files with 8 additions and 6 deletions

View File

@ -342,7 +342,7 @@ func (g *Game) PlayerAct(id int, cmd string) *Deck {
fmt.Println("not enough arguments")
return nil
}
if !g.HasDrawn || !g.QueuedEffect != nil {
if !g.HasDrawn || g.QueuedEffect != nil {
return nil
}
x_i, err := strconv.Atoi(cmd_s[1])
@ -395,7 +395,7 @@ func (g *Game) PlayerAct(id int, cmd string) *Deck {
fmt.Println("board position out of bounds")
return nil
}
switch g.TargetStatus {
switch g.TargetReq {
case TargetSelf:
if board != g.CurrentTurn && g.GetBoard(board)[pos].Id != g.QueuedEffect.Owner {
fmt.Println("self target not on self")
@ -417,8 +417,8 @@ func (g *Game) PlayerAct(id int, cmd string) *Deck {
}
AddEffect(g.GetBoard(board)[pos], g.QueuedEffect)
g.QueuedEffect = nil
g.TargetStatus = TargetNone
return g.GetBoard(board)
g.TargetReq = TargetNone
return DeckFromCards(g.GetBoard(board))
default:
fmt.Println("Invalid act command")

View File

@ -69,7 +69,9 @@ func OracleEnters(c *Card, g *Game) {
}
}
}
case Ally:
g.QueuedEffect = &Effect{c.Id, uuid.Nil, 2, 1}
g.TargetReq = TargetOwn
}
}
@ -142,7 +144,7 @@ func OraclePower(c CardType, g *Game) int {
switch c {
case Speedster, HealthPotion, Tree, Goblin:
return 1
case Commander:
case Commander, Ally:
return 2
case Paladin:
return 3