being actually adding card effects

This commit is contained in:
stryan 2021-07-23 18:57:39 -04:00
parent 0723811faf
commit 22a3e0c8e8
2 changed files with 44 additions and 1 deletions

View File

@ -38,6 +38,19 @@ func (b *Board) GetCard(id int, pos int) *Card {
} }
} }
func (b *Board) Remove(c *Card) {
for k, v := range b.Sentinal {
if v.Id == c.Id {
b.Sentinal[k] = NewCard(-1, uuid.Nil)
}
}
for k, v := range b.Scourge {
if v.Id == c.Id {
b.Scourge[k] = NewCard(-1, uuid.Nil)
}
}
}
func (b *Board) Empty(id int) bool { func (b *Board) Empty(id int) bool {
res := true res := true
if id == SentinalID { if id == SentinalID {

View File

@ -2,6 +2,11 @@ package game
func OracleUpkeep(c *Card, g *Game) { func OracleUpkeep(c *Card, g *Game) {
switch c.Type { switch c.Type {
case Eight:
c.Sick = true
if c.Counters > 3 {
g.GameBoard.Remove(c)
}
default: default:
c.Sick = false c.Sick = false
} }
@ -9,11 +14,32 @@ func OracleUpkeep(c *Card, g *Game) {
} }
func OracleCast(c *Card, g *Game) bool { func OracleCast(c *Card, g *Game) bool {
return true switch c.Type {
case Valk:
g.GameBoard = NewBoard()
return false
default:
return true
}
} }
func OracleEnters(c *Card, g *Game) { func OracleEnters(c *Card, g *Game) {
c.Sick = true c.Sick = true
switch c.Type {
case Two:
//+1 to all
if g.CurrentTurn == SentinalID {
for _, v := range g.GameBoard.Sentinal {
v.Power = v.Power + 1
}
} else {
for _, v := range g.GameBoard.Scourge {
v.Power = v.Power + 1
}
}
case Three:
//+1 around it
}
return return
} }
@ -22,6 +48,10 @@ func OracleLeaves(c *Card, g *Game) {
} }
func OracleEndstep(c *Card, g *Game) { func OracleEndstep(c *Card, g *Game) {
switch c.Type {
case Eight:
c.Counters = c.Counters + 1
}
return return
} }