From ec2e94e3463654a6288464a4c070b48ef9bf7368 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Wed, 17 Jun 2026 21:13:07 -0400 Subject: feat: smithing added, item/object interaction reworked. recipes and menus refactored. --- internal/game/game.go | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'internal/game/game.go') diff --git a/internal/game/game.go b/internal/game/game.go index 49d34b6..87539b1 100644 --- a/internal/game/game.go +++ b/internal/game/game.go @@ -122,10 +122,12 @@ func (g *Game) HandleSession(sess *net.Session, input string) { g.handleTalkInput(sess, input) case net.StateDropAllConfirm: g.handleDropAllConfirm(sess, input) - case net.StateCookRecipe: - g.handleCookRecipe(sess, input) - case net.StateSmeltRecipe: - g.handleSmeltRecipe(sess, input) + case net.StateRecipeChoice: + g.handleRecipeChoice(sess, input) + case net.StateHowMany: + g.handleHowMany(sess, input) + case net.StateSmithProduct: + g.handleSmithProduct(sess, input) case net.StateColorChoice: g.handleColorChoice(sess, input) } @@ -145,7 +147,7 @@ func classifyCommand(cmd string) CommandClass { "attack", "kill", "north", "n", "south", "s", "east", "e", "west", "w", "up", "u", "down", "d", - "quit", "use", "burn", "stoke", "search", "walk", "cook", "smelt": + "quit", "use", "burn", "stoke", "search", "walk", "cook", "smelt", "smith": return ClassActive case "eat": return ClassFree @@ -371,6 +373,9 @@ func (g *Game) executeCommand(sess *net.Session, cmd string, args []string, rawI case "smelt": g.doSmelt(sess, strings.Join(args, " ")) return + case "smith": + g.doSmith(sess, strings.Join(args, " ")) + return case "eat": g.doEat(sess, strings.Join(args, " ")) return @@ -459,7 +464,7 @@ func (g *Game) ProcessQueuedCommands() { } switch as.Type { case ActionGathering, ActionCombating, ActionUsing, ActionTalking, - ActionToggling, ActionBurning, ActionStoking, ActionResting, ActionWalking, ActionCooking, ActionSmelting: + ActionToggling, ActionBurning, ActionStoking, ActionResting, ActionWalking, ActionProducing: default: if as.Type != ActionMoving || p.MoveTicks <= 0 { p.ActionState = nil -- cgit v1.2.3