aboutsummaryrefslogtreecommitdiff
path: root/go/game/unit.go
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2025-07-21 08:33:01 -0400
committerFlorian Fischer <florian.fischer@muhq.space>2025-07-22 12:54:28 -0400
commit6cac8e514d90e3bd8f547952e841f05cb6d09a2e (patch)
tree3010e9df91f3d09d197fac77b37f140f2e984e48 /go/game/unit.go
parent23f7a82322eb36433fee1fabeef538aa2d9428ac (diff)
downloadmuhqs-game-6cac8e514d90e3bd8f547952e841f05cb6d09a2e.tar.gz
muhqs-game-6cac8e514d90e3bd8f547952e841f05cb6d09a2e.zip
detect end of unit AI actions and tap the unit
Diffstat (limited to 'go/game/unit.go')
-rw-r--r--go/game/unit.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/go/game/unit.go b/go/game/unit.go
index fd08b481..a096c0f2 100644
--- a/go/game/unit.go
+++ b/go/game/unit.go
@@ -154,6 +154,11 @@ func (u *Unit) HasFullAction() bool {
return len(u.FullActions) > 0
}
+func (u *Unit) tap() {
+ u.AvailMoveActions = 0
+ u.AvailAttackActions = 0
+}
+
func (u *Unit) AvailSlowActions() (actions []Action) {
if u.AvailMoveActions > 0 && u.Movement != INVALID_MOVEMENT() {
actions = append(actions, NewMoveAction(u))