new cards
This commit is contained in:
parent
a10110d4a5
commit
02f5028301
73
oracle.go
73
oracle.go
@ -4,11 +4,12 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
|
|
||||||
. "git.saintnet.tech/tomecraft/tome_lib"
|
. "git.saintnet.tech/tomecraft/tome_lib"
|
||||||
|
"github.com/google/uuid"
|
||||||
)
|
)
|
||||||
|
|
||||||
func OracleUpkeep(c *Card, g *Game) {
|
func OracleUpkeep(c *Card, g *Game) {
|
||||||
switch c.Type {
|
switch c.Type {
|
||||||
case Eight:
|
case ShieldWall:
|
||||||
c.Sick = true
|
c.Sick = true
|
||||||
if c.Counters >= 3 {
|
if c.Counters >= 3 {
|
||||||
g.GameBoard.Remove(c)
|
g.GameBoard.Remove(c)
|
||||||
@ -42,13 +43,26 @@ func OracleCast(c *Card, g *Game) bool {
|
|||||||
func OracleEnters(c *Card, g *Game) {
|
func OracleEnters(c *Card, g *Game) {
|
||||||
c.Sick = true
|
c.Sick = true
|
||||||
switch c.Type {
|
switch c.Type {
|
||||||
case Ace:
|
case Speedster:
|
||||||
c.Sick = false
|
c.Sick = false
|
||||||
return
|
return
|
||||||
case Four:
|
case Scholar:
|
||||||
AddEffect(c, &Effect{c.Id, c.Id, 2})
|
AddEffect(c, &Effect{c.Id, c.Id, 2, 1})
|
||||||
case Eight:
|
case ShieldWall, Tree:
|
||||||
c.Counters = 0
|
c.Counters = 0
|
||||||
|
case HealthPotion:
|
||||||
|
g.SentinalPlayer.Life = g.SentinalPlayer.Life + 1
|
||||||
|
g.ScourgePlayer.Life = g.ScourgePlayer.Life + 1
|
||||||
|
case Goblin:
|
||||||
|
for i := 0; i < 2; i++ {
|
||||||
|
for k, v := range g.GetBoard(c.Owner) {
|
||||||
|
if v.Empty() {
|
||||||
|
g.GetBoard(c.Owner)[k] = NewCard(int(GoblinSpawn), c.Owner, k, uuid.Nil)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,22 +73,27 @@ func OracleTick(c *Card, g *Game) {
|
|||||||
row := g.GetBoard(c.Owner)
|
row := g.GetBoard(c.Owner)
|
||||||
|
|
||||||
switch c.Type {
|
switch c.Type {
|
||||||
case Two:
|
case Commander:
|
||||||
//+1 to all
|
//+1 to all
|
||||||
for _, v := range row {
|
for _, v := range row {
|
||||||
if v.Id != c.Id {
|
if v.Id != c.Id {
|
||||||
AddEffect(v, &Effect{c.Id, v.Id, 1})
|
AddEffect(v, &Effect{c.Id, v.Id, 1, 1})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case Three:
|
case Paladin:
|
||||||
//+1 around it
|
//+1 around it
|
||||||
if c.Position-1 >= 0 {
|
if c.Position-1 >= 0 {
|
||||||
AddEffect(row[c.Position-1], &Effect{c.Id, row[c.Position-1].Id, 1})
|
AddEffect(row[c.Position-1], &Effect{c.Id, row[c.Position-1].Id, 1, 1})
|
||||||
}
|
}
|
||||||
if c.Position+1 <= 3 {
|
if c.Position+1 <= 3 {
|
||||||
AddEffect(row[c.Position+1], &Effect{c.Id, row[c.Position+1].Id, 1})
|
AddEffect(row[c.Position+1], &Effect{c.Id, row[c.Position+1].Id, 1, 1})
|
||||||
|
}
|
||||||
|
case Tree:
|
||||||
|
if c.Counters >= 5 {
|
||||||
|
AddEffect(row[c.Position], &Effect{c.Id, row[c.Position].Id, 1, 8})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func OracleLeaves(c *Card, g *Game) {
|
func OracleLeaves(c *Card, g *Game) {
|
||||||
@ -83,12 +102,12 @@ func OracleLeaves(c *Card, g *Game) {
|
|||||||
}
|
}
|
||||||
row := g.GetBoard(c.Owner)
|
row := g.GetBoard(c.Owner)
|
||||||
switch c.Type {
|
switch c.Type {
|
||||||
case Two:
|
case Commander:
|
||||||
//remove +1 to all
|
//remove +1 to all
|
||||||
for _, v := range row {
|
for _, v := range row {
|
||||||
RemoveEffect(c.Id, v)
|
RemoveEffect(c.Id, v)
|
||||||
}
|
}
|
||||||
case Three:
|
case Paladin:
|
||||||
//+1 around it
|
//+1 around it
|
||||||
if c.Position-1 >= 0 {
|
if c.Position-1 >= 0 {
|
||||||
RemoveEffect(c.Id, row[c.Position-1])
|
RemoveEffect(c.Id, row[c.Position-1])
|
||||||
@ -96,27 +115,47 @@ func OracleLeaves(c *Card, g *Game) {
|
|||||||
if c.Position+1 <= 3 {
|
if c.Position+1 <= 3 {
|
||||||
RemoveEffect(c.Id, row[c.Position+1])
|
RemoveEffect(c.Id, row[c.Position+1])
|
||||||
}
|
}
|
||||||
|
case HealthPotion:
|
||||||
|
g.SentinalPlayer.Life = g.SentinalPlayer.Life - 1
|
||||||
|
g.ScourgePlayer.Life = g.ScourgePlayer.Life - 1
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func OracleEndstep(c *Card, g *Game) {
|
func OracleEndstep(c *Card, g *Game) {
|
||||||
switch c.Type {
|
switch c.Type {
|
||||||
case Eight:
|
case ShieldWall, Tree:
|
||||||
c.Counters = c.Counters + 1
|
c.Counters = c.Counters + 1
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func OraclePower(c CardType, g *Game) int {
|
func OraclePower(c CardType, g *Game) int {
|
||||||
|
//this is horrible
|
||||||
|
switch c {
|
||||||
|
case Speedster, HealthPotion, Tree, Goblin:
|
||||||
|
return 1
|
||||||
|
case Commander:
|
||||||
|
return 2
|
||||||
|
case Paladin:
|
||||||
|
return 3
|
||||||
|
case Scholar:
|
||||||
|
return 4
|
||||||
|
case Warrior:
|
||||||
|
return 5
|
||||||
|
case Fighter:
|
||||||
|
return 6
|
||||||
|
case Seven:
|
||||||
|
return 7
|
||||||
|
default:
|
||||||
return int(c)
|
return int(c)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func OracleMove(c *Card, src, dest int, g *Game) {
|
func OracleMove(c *Card, src, dest int, g *Game) {
|
||||||
c.Sick = true
|
c.Sick = true
|
||||||
switch c.Type {
|
switch c.Type {
|
||||||
case Three:
|
case Paladin:
|
||||||
row := g.GetBoard(c.Owner)
|
row := g.GetBoard(c.Owner)
|
||||||
if src-1 >= 0 {
|
if src-1 >= 0 {
|
||||||
RemoveEffect(c.Id, row[src-1])
|
RemoveEffect(c.Id, row[src-1])
|
||||||
@ -140,7 +179,7 @@ func OracleEffect(c *Card, g *Game) {
|
|||||||
case 0:
|
case 0:
|
||||||
log.Println("dummy effect applied. probably a bug")
|
log.Println("dummy effect applied. probably a bug")
|
||||||
case 1:
|
case 1:
|
||||||
c.Power = c.Power + 1
|
c.Power = c.Power + e.Modifier
|
||||||
case 2:
|
case 2:
|
||||||
if c.Owner != SentinalID && c.Owner != ScourgeID {
|
if c.Owner != SentinalID && c.Owner != ScourgeID {
|
||||||
log.Println("card draw effect was played but with no owner?")
|
log.Println("card draw effect was played but with no owner?")
|
||||||
@ -150,6 +189,8 @@ func OracleEffect(c *Card, g *Game) {
|
|||||||
g.CanDraw = true
|
g.CanDraw = true
|
||||||
g.HasDrawn = false
|
g.HasDrawn = false
|
||||||
RemoveEffect(e.Owner, c)
|
RemoveEffect(e.Owner, c)
|
||||||
|
case 3:
|
||||||
|
c.BasePower = e.Modifier
|
||||||
default:
|
default:
|
||||||
log.Println("wrong effect type")
|
log.Println("wrong effect type")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user