add Bureaucrats and clog
This commit is contained in:
parent
0023bc9813
commit
a17f5bfa95
4
board.go
4
board.go
@ -110,12 +110,16 @@ func (b *Board) Play(id int, c *Card, dest int, should bool) bool {
|
||||
|
||||
func (b *Board) CanAttack(id, atk, def int) bool {
|
||||
aBrd := b.GetRow(id)
|
||||
dBrd := b.GetRow(flipID(id))
|
||||
if atk < 0 || atk > 3 || def < 0 || def > 3 {
|
||||
return false
|
||||
}
|
||||
if aBrd[atk].Empty() || aBrd[atk].Sick || atk != def {
|
||||
return false
|
||||
}
|
||||
if aBrd[atk].Phased || dBrd[def].Phased {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
|
2
card.go
2
card.go
@ -17,6 +17,7 @@ type Card struct {
|
||||
Position int `json:"position"`
|
||||
Spell bool `json:"spell"`
|
||||
Token bool `json:"token"`
|
||||
Phased bool `json:"phased"`
|
||||
Effects []*Effect `json:"effects"`
|
||||
}
|
||||
|
||||
@ -32,6 +33,7 @@ func NewEmpty(p int) *Card {
|
||||
Position: p,
|
||||
Spell: false,
|
||||
Token: false,
|
||||
Phased: false,
|
||||
Effects: []*Effect{},
|
||||
}
|
||||
}
|
||||
|
@ -26,7 +26,8 @@ const (
|
||||
Enemy //puts -1 token on enemy unit
|
||||
|
||||
//Rank 3
|
||||
Duelist //puts +0/+1 on allied unit
|
||||
Duelist //puts +0/+1 on allied unit
|
||||
Bureaucrat //creates a Clog token on any open space
|
||||
|
||||
//Rank 4
|
||||
Vanguard //puts +1/+0 on allied unit
|
||||
@ -46,6 +47,7 @@ const (
|
||||
//Tokens,etc
|
||||
GoblinSpawn //1 power goblin token
|
||||
Dud //0 power token
|
||||
Clog //0 power token that disapears after one turn
|
||||
|
||||
)
|
||||
const (
|
||||
|
@ -8,9 +8,9 @@ import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
const _CardTypeName = "EmptyValueValkSpeedsterCommanderPaladinScholarWarriorFighterSevenShieldWallHealthPotionTreeGoblinChupacabraAllyEnemyDuelistVanguardStudentLibrarianElephantMesmeristDivinerHologramGoblinSpawnDud"
|
||||
const _CardTypeName = "EmptyValueValkSpeedsterCommanderPaladinScholarWarriorFighterSevenShieldWallHealthPotionTreeGoblinChupacabraAllyEnemyDuelistBureaucratVanguardStudentLibrarianElephantMesmeristDivinerHologramGoblinSpawnDudClog"
|
||||
|
||||
var _CardTypeIndex = [...]uint8{0, 10, 14, 23, 32, 39, 46, 53, 60, 65, 75, 87, 91, 97, 107, 111, 116, 123, 131, 138, 147, 155, 164, 171, 179, 190, 193}
|
||||
var _CardTypeIndex = [...]uint8{0, 10, 14, 23, 32, 39, 46, 53, 60, 65, 75, 87, 91, 97, 107, 111, 116, 123, 133, 141, 148, 157, 165, 174, 181, 189, 200, 203, 207}
|
||||
|
||||
func (i CardType) String() string {
|
||||
i -= -1
|
||||
@ -20,7 +20,7 @@ func (i CardType) String() string {
|
||||
return _CardTypeName[_CardTypeIndex[i]:_CardTypeIndex[i+1]]
|
||||
}
|
||||
|
||||
var _CardTypeValues = []CardType{-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24}
|
||||
var _CardTypeValues = []CardType{-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26}
|
||||
|
||||
var _CardTypeNameToValueMap = map[string]CardType{
|
||||
_CardTypeName[0:10]: -1,
|
||||
@ -40,15 +40,17 @@ var _CardTypeNameToValueMap = map[string]CardType{
|
||||
_CardTypeName[107:111]: 13,
|
||||
_CardTypeName[111:116]: 14,
|
||||
_CardTypeName[116:123]: 15,
|
||||
_CardTypeName[123:131]: 16,
|
||||
_CardTypeName[131:138]: 17,
|
||||
_CardTypeName[138:147]: 18,
|
||||
_CardTypeName[147:155]: 19,
|
||||
_CardTypeName[155:164]: 20,
|
||||
_CardTypeName[164:171]: 21,
|
||||
_CardTypeName[171:179]: 22,
|
||||
_CardTypeName[179:190]: 23,
|
||||
_CardTypeName[190:193]: 24,
|
||||
_CardTypeName[123:133]: 16,
|
||||
_CardTypeName[133:141]: 17,
|
||||
_CardTypeName[141:148]: 18,
|
||||
_CardTypeName[148:157]: 19,
|
||||
_CardTypeName[157:165]: 20,
|
||||
_CardTypeName[165:174]: 21,
|
||||
_CardTypeName[174:181]: 22,
|
||||
_CardTypeName[181:189]: 23,
|
||||
_CardTypeName[189:200]: 24,
|
||||
_CardTypeName[200:203]: 25,
|
||||
_CardTypeName[203:207]: 26,
|
||||
}
|
||||
|
||||
// CardTypeString retrieves an enum value from the enum constants string name.
|
||||
|
Loading…
Reference in New Issue
Block a user