implement ace, differ between spells (valk)
This commit is contained in:
parent
d1845760fe
commit
4c37ad270d
@ -99,7 +99,7 @@ func (b *Board) Move(id, src, dest int) bool {
|
||||
|
||||
func (b *Board) CanPlay(id int, c *Card, dest int) bool {
|
||||
brd := b.GetRow(id)
|
||||
if !brd[dest].Empty() {
|
||||
if !brd[dest].Empty() || !c.Spell {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
|
@ -15,6 +15,7 @@ type Card struct {
|
||||
Counters int `json:"counters"`
|
||||
Owner int `json:"owner"`
|
||||
Position int `json:"position"`
|
||||
Spell bool `json:"spell"`
|
||||
}
|
||||
|
||||
type CardType int
|
||||
@ -54,6 +55,7 @@ func NewCard(v, o, p int, id uuid.UUID) *Card {
|
||||
Counters: 0,
|
||||
Owner: o,
|
||||
Position: p,
|
||||
Spell: OracleSpell(CardType(v), nil),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -15,6 +15,15 @@ func OracleUpkeep(c *Card, g *Game) {
|
||||
return
|
||||
}
|
||||
|
||||
func OracleSpell(c CardType, g *Game) bool {
|
||||
switch c {
|
||||
case Valk:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
func OracleCast(c *Card, g *Game) bool {
|
||||
switch c.Type {
|
||||
case Valk:
|
||||
@ -28,6 +37,8 @@ func OracleCast(c *Card, g *Game) bool {
|
||||
func OracleEnters(c *Card, g *Game) {
|
||||
c.Sick = true
|
||||
switch c.Type {
|
||||
case Ace:
|
||||
c.Sick = false
|
||||
case Two:
|
||||
//+1 to all
|
||||
if c.Owner == SentinalID {
|
||||
|
Loading…
Reference in New Issue
Block a user