diff options
| author | historia <[not public]> | 2026-06-15 02:57:35 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-15 02:58:50 -0400 |
| commit | 4cc1ddcd185509080b4b3e15d1646567edd51c9d (patch) | |
| tree | 2a564846ad4fd159a2d7e55451bfa9569fe8c0b8 /internal/game/action.go | |
| parent | 445c4612cc5cf2c226f85894b6ad1e2419a374e2 (diff) | |
| download | thehouseoficarus-4cc1ddcd185509080b4b3e15d1646567edd51c9d.tar.gz | |
removed game speed for being broken and an antifeature anyway. added color support.
Diffstat (limited to 'internal/game/action.go')
| -rw-r--r-- | internal/game/action.go | 41 |
1 files changed, 29 insertions, 12 deletions
diff --git a/internal/game/action.go b/internal/game/action.go index bb4bdac..26484e0 100644 --- a/internal/game/action.go +++ b/internal/game/action.go @@ -14,6 +14,32 @@ import ( "thirdcollapse/internal/world" ) +var verbAliases = map[string]string{ + "mine": "gather", + "chop": "gather", + "fish": "gather", + "cut": "gather", + "talk": "talk", + "speak": "talk", + "ask": "talk", + "pull": "toggle", + "push": "toggle", +} + +var verbSkill = map[string]string{ + "mine": "mining", + "chop": "woodcutting", + "cut": "woodcutting", + "fish": "fishing", +} + +func normalizeVerb(v string) string { + if a, ok := verbAliases[v]; ok { + return a + } + return v +} + func (g *Game) StartAction(sess *net.Session, verb, target string) { p := sess.Player.(*player.Player) @@ -199,21 +225,12 @@ func (g *Game) AdvanceActions() { case "search": g.advanceSearch(sess, p) } + if p.Action == nil { + g.writePrompt(sess) + } } } -func normalizeVerb(v string) string { - switch v { - case "mine", "chop", "fish", "cut": - return "gather" - case "talk", "speak", "ask": - return "talk" - case "pull", "push": - return "toggle" - } - return v -} - func (g *Game) checkCondition(sess *net.Session, c *action.Condition) bool { p, _ := sess.Player.(*player.Player) |
