add enemy, fix targeting

This commit is contained in:
stryan 2021-11-10 17:53:08 -05:00
parent e1fd108c06
commit 972270d667
2 changed files with 7 additions and 0 deletions

View File

@ -415,6 +415,8 @@ func (g *Game) PlayerAct(id int, cmd string) *Deck {
fmt.Println("NoneTarget'd ability?")
return nil
}
//we know the target is valid now, so modify the effect to have a valid target
g.QueuedEffect.Target = g.GetBoard(board)[pos].Id
AddEffect(g.GetBoard(board)[pos], g.QueuedEffect)
g.QueuedEffect = nil
g.TargetReq = TargetNone

View File

@ -72,6 +72,9 @@ func OracleEnters(c *Card, g *Game) {
case Ally:
g.QueuedEffect = &Effect{c.Id, uuid.Nil, 2, 1}
g.TargetReq = TargetOwn
case Enemy:
g.QueuedEffect = &Effect{c.Id, uuid.Nil, 4, 1}
g.TargetReq = TargetOpp
}
}
@ -200,6 +203,8 @@ func OracleEffect(c *Card, g *Game) {
RemoveEffect(e.Owner, c)
case 3:
c.BasePower = e.Modifier
case 4:
c.Power = c.Power - e.Modifier
default:
log.Println("wrong effect type")
}