2021-07-23 18:33:17 -04:00
|
|
|
package game
|
|
|
|
|
2021-07-25 13:27:12 -04:00
|
|
|
import "log"
|
|
|
|
|
2021-07-23 18:33:17 -04:00
|
|
|
func OracleUpkeep(c *Card, g *Game) {
|
|
|
|
switch c.Type {
|
2021-07-23 18:57:39 -04:00
|
|
|
case Eight:
|
|
|
|
c.Sick = true
|
|
|
|
if c.Counters > 3 {
|
|
|
|
g.GameBoard.Remove(c)
|
|
|
|
}
|
2021-07-23 18:33:17 -04:00
|
|
|
default:
|
|
|
|
c.Sick = false
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2021-07-25 13:35:49 -04:00
|
|
|
func OracleSpell(c CardType, g *Game) bool {
|
|
|
|
switch c {
|
|
|
|
case Valk:
|
|
|
|
return true
|
|
|
|
default:
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-07-23 18:33:17 -04:00
|
|
|
func OracleCast(c *Card, g *Game) bool {
|
2021-07-23 18:57:39 -04:00
|
|
|
switch c.Type {
|
|
|
|
case Valk:
|
|
|
|
g.GameBoard = NewBoard()
|
|
|
|
return false
|
|
|
|
default:
|
|
|
|
return true
|
|
|
|
}
|
2021-07-23 18:33:17 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
func OracleEnters(c *Card, g *Game) {
|
|
|
|
c.Sick = true
|
2021-07-23 18:57:39 -04:00
|
|
|
switch c.Type {
|
2021-07-25 13:35:49 -04:00
|
|
|
case Ace:
|
|
|
|
c.Sick = false
|
2021-07-23 18:57:39 -04:00
|
|
|
case Two:
|
|
|
|
//+1 to all
|
2021-07-25 13:27:12 -04:00
|
|
|
if c.Owner == SentinalID {
|
2021-07-23 18:57:39 -04:00
|
|
|
for _, v := range g.GameBoard.Sentinal {
|
|
|
|
v.Power = v.Power + 1
|
|
|
|
}
|
2021-07-25 13:27:12 -04:00
|
|
|
} else if c.Owner == ScourgeID {
|
2021-07-23 18:57:39 -04:00
|
|
|
for _, v := range g.GameBoard.Scourge {
|
|
|
|
v.Power = v.Power + 1
|
|
|
|
}
|
2021-07-25 13:27:12 -04:00
|
|
|
} else {
|
|
|
|
log.Println("Trying to lookup an ETB when card not on field")
|
2021-07-23 18:57:39 -04:00
|
|
|
}
|
|
|
|
case Three:
|
|
|
|
//+1 around it
|
2021-07-25 13:27:12 -04:00
|
|
|
if c.Owner == SentinalID {
|
|
|
|
if c.Position-1 >= 0 {
|
|
|
|
g.GameBoard.Sentinal[c.Position-1].Power = g.GameBoard.Sentinal[c.Position-1].Power + 1
|
|
|
|
}
|
|
|
|
if c.Position+1 <= 3 {
|
|
|
|
g.GameBoard.Sentinal[c.Position+1].Power = g.GameBoard.Sentinal[c.Position+1].Power + 1
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
if c.Owner == ScourgeID {
|
|
|
|
if c.Position-1 >= 0 {
|
|
|
|
g.GameBoard.Scourge[c.Position-1].Power = g.GameBoard.Scourge[c.Position-1].Power + 1
|
|
|
|
}
|
|
|
|
if c.Position+1 <= 3 {
|
|
|
|
g.GameBoard.Scourge[c.Position+1].Power = g.GameBoard.Scourge[c.Position+1].Power + 1
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2021-07-23 18:57:39 -04:00
|
|
|
}
|
2021-07-23 18:33:17 -04:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func OracleLeaves(c *Card, g *Game) {
|
2021-07-25 13:27:12 -04:00
|
|
|
switch c.Type {
|
|
|
|
case Two:
|
|
|
|
//remove +1 to all
|
|
|
|
if c.Owner == SentinalID {
|
|
|
|
for _, v := range g.GameBoard.Sentinal {
|
|
|
|
v.Power = v.Power - 1
|
|
|
|
}
|
|
|
|
} else if c.Owner == ScourgeID {
|
|
|
|
for _, v := range g.GameBoard.Scourge {
|
|
|
|
v.Power = v.Power - 1
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
log.Println("Trying to lookup an LTB when card not on field")
|
|
|
|
}
|
|
|
|
case Three:
|
|
|
|
//+1 around it
|
|
|
|
if c.Owner == SentinalID {
|
|
|
|
if c.Position-1 >= 0 {
|
|
|
|
g.GameBoard.Sentinal[c.Position-1].Power = g.GameBoard.Sentinal[c.Position-1].Power - 1
|
|
|
|
}
|
|
|
|
if c.Position+1 <= 3 {
|
|
|
|
g.GameBoard.Sentinal[c.Position+1].Power = g.GameBoard.Sentinal[c.Position+1].Power - 1
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
if c.Owner == ScourgeID {
|
|
|
|
if c.Position-1 >= 0 {
|
|
|
|
g.GameBoard.Scourge[c.Position-1].Power = g.GameBoard.Scourge[c.Position-1].Power - 1
|
|
|
|
}
|
|
|
|
if c.Position+1 <= 3 {
|
|
|
|
g.GameBoard.Scourge[c.Position+1].Power = g.GameBoard.Scourge[c.Position+1].Power - 1
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
2021-07-23 18:33:17 -04:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func OracleEndstep(c *Card, g *Game) {
|
2021-07-23 18:57:39 -04:00
|
|
|
switch c.Type {
|
|
|
|
case Eight:
|
|
|
|
c.Counters = c.Counters + 1
|
|
|
|
}
|
2021-07-23 18:33:17 -04:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func OraclePower(c CardType, g *Game) int {
|
|
|
|
return int(c)
|
|
|
|
}
|
|
|
|
|
2021-07-25 13:27:12 -04:00
|
|
|
func OracleMove(c *Card, src, dest int, g *Game) {
|
2021-07-23 18:33:17 -04:00
|
|
|
c.Sick = true
|
2021-07-25 13:27:12 -04:00
|
|
|
switch c.Type {
|
|
|
|
case Three:
|
|
|
|
row := g.GameBoard.GetRow(c.Owner)
|
|
|
|
row[src-1].Power = row[src-1].Power - 1
|
|
|
|
row[src+1].Power = row[src+1].Power - 1
|
|
|
|
row[dest-1].Power = row[dest-1].Power + 1
|
|
|
|
row[dest+1].Power = row[dest+1].Power + 1
|
|
|
|
}
|
2021-07-23 18:33:17 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
func OracleAttack(c *Card, g *Game) {
|
|
|
|
c.Sick = true
|
|
|
|
}
|