From 29b02407fa4acf6a1727e01f3f9e8c7f1f593991 Mon Sep 17 00:00:00 2001 From: Shagnor Date: Sat, 28 Jan 2023 20:58:04 +1100 Subject: [PATCH] Add more help. --- .../src/message_handler/user_commands/help.rs | 92 ++++++++++++++++--- 1 file changed, 78 insertions(+), 14 deletions(-) diff --git a/blastmud_game/src/message_handler/user_commands/help.rs b/blastmud_game/src/message_handler/user_commands/help.rs index 916f557..576d421 100644 --- a/blastmud_game/src/message_handler/user_commands/help.rs +++ b/blastmud_game/src/message_handler/user_commands/help.rs @@ -9,36 +9,100 @@ use phf::phf_map; static ALWAYS_HELP_PAGES: phf::Map<&'static str, &'static str> = phf_map! { "" => ansi!("You are supposed to replace topicname> with the topic you want \ - to learn about. Example:\r\n\ + to learn about. Example:\n\ \thelp register will tell you about the register command.") }; static UNREGISTERED_HELP_PAGES: phf::Map<&'static str, &'static str> = phf_map! { "" => ansi!("Type help topicname> to learn about a topic. Most \ - commands can be used as a topicname.\r\n\ - Topics of interest to unregistered users:\r\n\ - \tregister\tLearn about the register command.\r\n\ - \tlogin\tLearn how to log in as an existing user.\r\n"), + commands can be used as a topicname.\n\ + Topics of interest to unregistered users:\n\ + \tregister\tLearn about the register command.\n\ + \tlogin\tLearn how to log in as an existing user.\n"), "register" => - ansi!("Registers a new user. You are allowed at most 5 at once.\r\n\ - \tregister username> password> email>\r\n\ + ansi!("Registers a new user. You are allowed at most 5 at once.\n\ + \tregister username> password> email>\n\ Email will be used to check you don't have too many accounts and \ in case you need to reset your password."), "login" => - ansi!("Logs in as an existing user.\r\n\ + ansi!("Logs in as an existing user.\n\ \tlogin username> password") }; static REGISTERED_HELP_PAGES: phf::Map<&'static str, &'static str> = phf_map! { "" => ansi!("Type help topicname> to learn about a topic. Most \ - commands can be used as a topicname.\r\n\ - Topics of interest:\r\n\ - \tnewbie\tLearn the absolute basics."), + commands can be used as a topicname.\n\ + Topics of interest:\n\ + \tnewbie\tLearn the absolute basics.\n\ + \tmovement\tCommands for moving around.\n\ + \ttalk\tFind out how to talk in the game.\n\ + \tcombat\tLearn how to fight.\n\ + \tinformation\tLearn how to find out about the world and your character."), "newbie" => - ansi!("So you've just landed in BlastMud, and want to know how to get started?\r\n\ - As we develop the game, this will eventually have some useful information for you!"), + ansi!("So you've just landed in BlastMud, and want to know how to get started?\n\ + You control your character, and can tell your character to move around the\n\ + world, and see things through their eyes.\n\ + The world (yes, even outside!) is divided up into rooms, and each room has\n + exits that you are allowed to take, normally called north, south, east, west,\n + northeast, northwest, southeast, southwest, up and down (sometimes you can also go in).\n\ + \n\ + Try look (or l) to look at the current room. It will\n\ + also show you all the exits you can take, and a little ASCII-art map showing \n\ + the local layout. lmap shows you a more detailed map showing the\n\ + directions you can move in. You can also look at objects or players with \n\ + l followed by the name of the object (shortening is okay).\n\ + Once you know what direction to move, you can type the direction, using either\n\ + the full name of the direction (e.g. northeast or south,\n\ + or a short form (n, e, s, w, ne, nw, se, sw, up, down)."), + "movement" => + ansi!("Once you know what direction to move, you can type the direction, using either\n\ + the full name of the direction (e.g. northeast or south,\n\ + or a short form (n, e, s, w, ne, nw, se, sw, up, down)."), + "look" => + ansi!("Try look or l to look at the current room. Follow it with the \ + name of an exit to look at an adjacent room. Or name an object or player in the room to look \ + at that."), + "combat" => + ansi!("Type kill character or k character to attack a character. \ + If their health points hits zero, they die. If your health points hit zero, you die. \ + Note that characters can reclone so death isn't fully permanent (see help death). \ + Combat depends on your ability to dodge the enemy's attacks (based on your dodge skill), \ + your armour's ability to soak their attacks, and the skill in the weapon you are wielding \ + - and of course the same factors for your opponents. \ + You can only attack one character at a time, but more than one can gang up on you! \ + When you fight, you might notice you improve at your skills (see help skills), \ + and also gain more experience. You gain more skills using a weapon matched to your current \ + experience level, and more experience fighting harder opponents - but if you take on someone \ + too tough, you might die and lose experience recloning! \ + Remember, you can always (at least while you are not dead) try to run away from combat by just \ + by using movement commands (see help movement - but if your dodge skill isn't high \ + enough, it might fail."), + "death" => + ansi!("In Blastmud, you can die if your health points reach zero. While you are dead, you can't \ + move or talk! Unless someone quickly comes and uses a defibrilator on you, your current \ + body is gone. Luckily, thanks to residual Gazos-Murlison technology that survived the \ + fall of the empire, you can still re-clone into a new body. However, this has some \ + downsides: you lose a bit of your experience in the process, and anything you had on your \ + person stays with the corpse of your old body! So it is certainly worth trying not to die!"), + "skills" => + ansi!( + "Blastmud has lots of different skills that you can learn. There are two different \ + measures of a skill. Total skill is how good you are in absolute terms - you get some skill from your stats, \ + and some from your raws. Raw skill is how much you have improved by learning the skill as you \ + play the game. Your raw skill caps out at 15 per skill, and adds on to the contribution from \ + your stats, and any temporary buffs or debuffs caused by your character's state."), + "information" => + ansi!( + "Commands to examine the world:\n\ + \tlook (or l) to look around - follow it with an exit or\n\ + \t\ta character / item name for detail on that.\n\ + \tlmap - get a map showing exits and places."), + "talk" => + ansi!("Use:\n\ + \t'message to send message to the room.\n\ + \t-user message to whisper to someone.") }; static EXPLICIT_HELP_PAGES: phf::Map<&'static str, &'static str> = phf_map! { @@ -68,7 +132,7 @@ impl UserVerb for Verb { let help_final = help.ok_or( UserError("No help available on that".to_string()))?; ctx.trans.queue_for_session(ctx.session, - Some(&(help_final.to_string() + "\r\n")) + Some(&(help_final.to_string() + "\n")) ).await?; Ok(()) }