aboutsummaryrefslogtreecommitdiff
path: root/internal/game/action.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-06-18 20:26:03 -0400
committerhistoria <[not public]>2026-06-18 20:26:03 -0400
commit97a1a908b9e6e6d3516628c139c9b64262b4fe08 (patch)
treed82953974edbfb4051dff1a48f1b264b9c264d28 /internal/game/action.go
parent17e7725f252c7f5d3be2e9c37d62751c631f196f (diff)
downloadthehouseoficarus-97a1a908b9e6e6d3516628c139c9b64262b4fe08.tar.gz
feat: crafting roughly implemented (leather, gems, gold, clay, spinning).
Diffstat (limited to 'internal/game/action.go')
-rw-r--r--internal/game/action.go29
1 files changed, 17 insertions, 12 deletions
diff --git a/internal/game/action.go b/internal/game/action.go
index 3d0223a..ca8506a 100644
--- a/internal/game/action.go
+++ b/internal/game/action.go
@@ -19,6 +19,7 @@ var verbAliases = map[string]string{
"chop": "gather",
"fish": "gather",
"cut": "gather",
+ "shear": "gather",
"talk": "talk",
"speak": "talk",
"ask": "talk",
@@ -27,10 +28,11 @@ var verbAliases = map[string]string{
}
var verbSkill = map[string]string{
- "mine": "mining",
- "chop": "woodcutting",
- "cut": "woodcutting",
- "fish": "fishing",
+ "mine": "mining",
+ "chop": "woodcutting",
+ "cut": "woodcutting",
+ "fish": "fishing",
+ "shear": "crafting",
}
func normalizeVerb(v string) string {
@@ -231,14 +233,10 @@ func (g *Game) AdvanceActions() {
g.advanceStoke(sess, p)
case "search":
g.advanceSearch(sess, p)
- case "cook":
- g.advanceProduction(sess, p)
- case "smelt":
- g.advanceProduction(sess, p)
- case "smith":
- g.advanceProduction(sess, p)
- case "combine":
- g.advanceProduction(sess, p)
+ default:
+ if productionActionTypes[p.Action.Type] {
+ g.advanceProduction(sess, p)
+ }
}
if p.Action == nil {
g.writePrompt(sess)
@@ -308,5 +306,12 @@ func (g *Game) checkCondition(sess *net.Session, c *action.Condition) bool {
}
return has
}
+ if c.MinCredits > 0 {
+ has := p != nil && p.Credits >= c.MinCredits
+ if c.Not {
+ return !has
+ }
+ return has
+ }
return true
}