diff options
Diffstat (limited to 'go/game/unit.go')
| -rw-r--r-- | go/game/unit.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/go/game/unit.go b/go/game/unit.go index f1e38078..c875fa50 100644 --- a/go/game/unit.go +++ b/go/game/unit.go @@ -10,7 +10,7 @@ type Unit struct { Health int Movement Movement Attack Attack - upkeep int + upkeep *ResourceCosts FullActions []*FullAction FreeActions []*FreeAction // Effects []Effects @@ -29,9 +29,9 @@ func NewUnit(card *Card, tile *Tile, owner *Player) *Unit { movement = parseMovement(movementDesc) } - upkeep, ok := card.Values["upkeep"].(int) - if !ok { - upkeep = 0 + upkeep := card.PlayCosts + if upkeep == nil { + upkeep = &ResourceCosts{fixed: 0} } var attack Attack @@ -66,7 +66,7 @@ func NewUnitFromPath(cardPath string, tile *Tile, owner *Player) *Unit { } func (u *Unit) UpkeepCost() int { - return u.upkeep + return u.upkeep.Costs(u.controller.gameState) } func (u *Unit) resetBaseActions() { |
