diff options
| author | historia <[not public]> | 2026-06-14 22:38:23 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-14 22:38:23 -0400 |
| commit | a6f0ad79e2e3a5b7c11eef1ffc3233f3a2766f77 (patch) | |
| tree | 89601a502bbfcb50302cf03f09b6febc6040eeb0 /internal/game/action_state.go | |
| parent | 1aba2bdd23aebed4032333e74aa553c40a31fcbd (diff) | |
| download | thehouseoficarus-a6f0ad79e2e3a5b7c11eef1ffc3233f3a2766f77.tar.gz | |
feat: fractional ticks and server game_speed implemented. potentially insanely janky.
Diffstat (limited to 'internal/game/action_state.go')
| -rw-r--r-- | internal/game/action_state.go | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/internal/game/action_state.go b/internal/game/action_state.go new file mode 100644 index 0000000..fba5319 --- /dev/null +++ b/internal/game/action_state.go @@ -0,0 +1,61 @@ +package game + +import "fmt" + +type ActionType string + +const ( + ActionIdle ActionType = "" + ActionGathering ActionType = "gathering" + ActionCombating ActionType = "combating" + ActionMoving ActionType = "moving" + ActionUsing ActionType = "using" + ActionTalking ActionType = "talking" + ActionToggling ActionType = "toggling" + ActionBurning ActionType = "burning" + ActionStoking ActionType = "stoking" + ActionPickingUp ActionType = "picking_up" + ActionDropping ActionType = "dropping" + ActionSearching ActionType = "searching" + ActionResting ActionType = "resting" +) + +type ActionState struct { + Type ActionType + TargetName string + ToolName string + Direction string +} + +func (a *ActionState) Description() string { + if a == nil || a.Type == ActionIdle { + return "" + } + switch a.Type { + case ActionGathering: + return "mining a " + a.TargetName + case ActionCombating: + return "fighting a " + a.TargetName + case ActionMoving: + return "walking in from the " + a.Direction + case ActionUsing: + return "using a " + a.TargetName + case ActionTalking: + return "talking to " + a.TargetName + case ActionToggling: + return fmt.Sprintf("pulling a %s", a.TargetName) + case ActionBurning: + return "trying to start a fire" + case ActionStoking: + return "tending to a fire" + case ActionPickingUp: + return "picking up " + a.TargetName + case ActionDropping: + return "dropping " + a.TargetName + case ActionSearching: + return "digging through a " + a.TargetName + case ActionResting: + return "resting" + } + return "" +} |
