aboutsummaryrefslogtreecommitdiff
path: root/go/game/unit.go
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2023-02-07 14:58:22 +0100
committerFlorian Fischer <florian.fischer@muhq.space>2025-01-27 16:43:47 +0100
commit495940be9dfe0aa09c7940c3ad78968e354eb8e6 (patch)
tree3fb9a64fea22dbe4a58e27989d434dc492e5b49e /go/game/unit.go
parent000b3230a77106ef49c5a581db7120e2ef6e56b1 (diff)
downloadmuhqs-game-495940be9dfe0aa09c7940c3ad78968e354eb8e6.tar.gz
muhqs-game-495940be9dfe0aa09c7940c3ad78968e354eb8e6.zip
intermediate commit
* implement most of the kraken cards * unify permanent marks * add state based actions hook for card implementations
Diffstat (limited to 'go/game/unit.go')
-rw-r--r--go/game/unit.go50
1 files changed, 1 insertions, 49 deletions
diff --git a/go/game/unit.go b/go/game/unit.go
index 82aa8528..a2934296 100644
--- a/go/game/unit.go
+++ b/go/game/unit.go
@@ -4,53 +4,6 @@ import (
"log"
)
-type UnitMark int
-
-const (
- paralysis UnitMark = iota + 1
- poison
- panic_
- rage
- ward
- faith
-)
-
-func (mark UnitMark) String() string {
- switch mark {
- case paralysis:
- return "paralysis"
- case poison:
- return "poison"
- case panic_:
- return "panic"
- case rage:
- return "rage"
- case ward:
- return "ward"
- case faith:
- return "faith"
- default:
- log.Fatalf("Unhandled unit mark %d", mark)
- return ""
- }
-}
-
-var UnitMarks = struct {
- Paralysis UnitMark
- Poison UnitMark
- Panic UnitMark
- Rage UnitMark
- Ward UnitMark
- Faith UnitMark
-}{
- Paralysis: paralysis,
- Poison: poison,
- Panic: panic_,
- Rage: rage,
- Ward: ward,
- Faith: faith,
-}
-
const (
DEFAULT_AVAIL_MOVE_ACTIONS = 1
DEFAULT_AVAIL_ATTACK_ACTIONS = 1
@@ -64,7 +17,6 @@ type Unit struct {
Upkeep int
FullActions []*FullAction
FreeActions []*FreeAction
- States map[UnitMark]int
// Effects []Effects
AvailMoveActions int
additionalMoveActions int
@@ -97,7 +49,6 @@ func NewUnit(card *Card, tile *Tile, owner *Player) *Unit {
Movement: movement,
Attack: attack,
Upkeep: upkeep,
- States: make(map[UnitMark]int),
AvailMoveActions: DEFAULT_AVAIL_MOVE_ACTIONS,
AvailAttackActions: DEFAULT_AVAIL_ATTACK_ACTIONS,
}
@@ -120,6 +71,7 @@ func (u *Unit) resetBaseActions() {
}
func (u *Unit) onUpkeep() {
+ // TODO: handle state marks
u.resetBaseActions()
}