diff options
| author | historia <[not public]> | 2026-09-19 03:15:59 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-09-19 03:15:59 -0400 |
| commit | 0e60567a7a0addb9421769ee7be7853bfa8788cb (patch) | |
| tree | 7645112db0e4eae95b8a83c1e4f9aab38bede655 /internal/game/render_help.go | |
| parent | cc33072eced3d5460512c09c42ec4531c807d7af (diff) | |
| download | thehouseoficarus-0e60567a7a0addb9421769ee7be7853bfa8788cb.tar.gz | |
refactor: simplifcation, change how rooms are stored in player yaml, remove legacy code
Diffstat (limited to 'internal/game/render_help.go')
| -rw-r--r-- | internal/game/render_help.go | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/internal/game/render_help.go b/internal/game/render_help.go index 7886f48..a11ac74 100644 --- a/internal/game/render_help.go +++ b/internal/game/render_help.go @@ -28,10 +28,13 @@ type cmdEntry struct { var commandList = []cmdEntry{ {"alias", "Instant", "Create command shortcuts"}, + {"aps", "Active", "Auto-travel using Agility"}, {"attack / kill", "Active", "Attack a mob"}, {"autotrigger / auto", "Instant", "Set a module to auto-trigger"}, {"bank", "Active", "Open bank interface"}, + {"browse / list", "Instant", "Browse a shop's stock"}, {"burn", "Active", "Start a fire"}, + {"buy", "Instant", "Buy from a shop"}, {"chop / cut", "Active", "Chop trees (Woodcutting)"}, {"clean", "Free", "Clean grimy herbs (Pharmacy)"}, {"color / colors", "Instant", "Customize display colors"}, @@ -39,19 +42,23 @@ var commandList = []cmdEntry{ {"construct / make", "Active", "Build furniture (Construction)"}, {"cook", "Active", "Cook raw food on a fire or range"}, {"craft", "Active", "Craft jewelry (Crafting)"}, + {"cure", "Active", "Cure diseased crops (Farming)"}, {"description / desc", "Instant", "Set your character description"}, {"drink", "Free", "Drink a potion"}, {"drop", "Active", "Drop items to the ground"}, {"eat", "Free", "Eat food to restore hitpoints"}, {"equipment / eq", "Instant", "Show equipped items"}, {"exits", "Instant", "List available exits"}, - {"farm", "Active", "Farm crops (Farming)"}, {"fish", "Active", "Fish at fishing spots (Fishing)"}, {"fletch", "Free", "Fletch logs into bows (Fletching)"}, {"get / take / pick", "Active", "Pick up items from the ground"}, {"global", "Instant", "Chat with everyone on the server"}, + {"harvest", "Active", "Harvest a grown farming patch"}, {"help", "Instant", "Show help topics"}, + {"hide / safespot", "Active", "Hide in a safespot"}, + {"home / recall", "Instant", "Return to your home room"}, {"id / identify", "Active", "Identify herbs (Pharmacy)"}, + {"inspect", "Instant", "Inspect a mob, object, or item"}, {"inventory / i / inv", "Instant", "Show your inventory"}, {"jack / jackin", "Active", "Jack into a terminal (Hacking)"}, {"look / l", "Instant", "Look around or examine things"}, @@ -67,27 +74,37 @@ var commandList = []cmdEntry{ {"mods / modlist", "Instant", "List available science modules"}, {"north / south / east / west / up / down", "Active", "Move in a direction"}, {"option / options", "Instant", "View or change settings"}, + {"plant", "Active", "Plant seeds in a farming patch"}, {"prompt", "Instant", "Set custom command prompt"}, {"pull / push", "Active", "Interact with objects"}, {"queued", "Instant", "Show pending tick actions"}, {"quit", "Active", "Rest and disconnect (\"quit now\" forfeits a mid-game bet)"}, + {"rake", "Active", "Rake a farming patch"}, {"remove / unwear / unwield", "Free", "Unequip items"}, {"say", "Instant", "Chat with players in your room"}, {"score / sc", "Instant", "View your stats and skills"}, {"search", "Active", "Search items for loot"}, + {"sell", "Instant", "Sell to a shop"}, + {"skills / sk", "Instant", "Show your skill levels"}, {"smelt", "Active", "Smelt ore into bars (Smithing)"}, {"smith", "Active", "Smith bars into items (Smithing)"}, {"sneak", "Instant", "Toggle sneak mode"}, + {"stats", "Instant", "Show your combat stats"}, {"steal", "Active", "Steal from mobs (Thieving)"}, + {"stop", "Instant", "Stop the current action"}, {"stoke", "Active", "Add logs to a fire"}, {"style", "Instant", "Change combat style"}, {"symbol", "Instant", "Set custom map symbol for current room"}, {"talk / speak / ask", "Active", "Talk to mobs"}, + {"task", "Instant", "Show your current task"}, {"tech", "Instant", "Toggle technology abilities"}, {"trigger", "Active", "Trigger a science module"}, {"unalias", "Instant", "Remove command shortcuts"}, + {"unhide / unsafespot", "Active", "Leave a safespot"}, {"use", "Active", "Use an object (crafting)"}, + {"verbs / commands", "Instant", "List every command you can use"}, {"walk", "Active", "Pathfind to a room or multi-step walk"}, + {"water", "Active", "Water crops (Farming)"}, {"wear / wield", "Free", "Equip items"}, {"who", "Instant", "List everyone online and their combat level"}, } @@ -106,43 +123,32 @@ func LoadHelp(dataDir string) ([]HelpDef, error) { return helps, nil } -// helpRaw accepts both the canonical schema (name/description) and the -// legacy variant (title/body) used by a few help files. +// helpRaw mirrors the canonical help schema and is also used by data +// validation to flag unknown fields. type helpRaw struct { Name string `yaml:"name"` - Title string `yaml:"title"` Aliases []string `yaml:"aliases"` Related []string `yaml:"related"` Category string `yaml:"category"` Description string `yaml:"description"` - Body string `yaml:"body"` } -// parseHelpDef unmarshals a help definition, normalizing legacy title/body -// files onto the canonical HelpDef. Returns nil for files that are not help -// topics (no name at all). +// parseHelpDef unmarshals a help definition. Returns nil for files that are +// not help topics (no name at all). func parseHelpDef(data []byte) *HelpDef { var raw helpRaw if err := yaml.Unmarshal(data, &raw); err != nil { return nil } - name := raw.Name - if name == "" { - name = raw.Title - } - if name == "" { + if raw.Name == "" { return nil } - content := raw.Description - if content == "" { - content = raw.Body - } return &HelpDef{ - Name: name, + Name: raw.Name, Aliases: raw.Aliases, Related: raw.Related, Category: raw.Category, - Content: content, + Content: raw.Description, } } |
