Add more help.

This commit is contained in:
Condorra 2023-01-28 20:58:04 +11:00
parent 737fe3a86f
commit 29b02407fa

View File

@ -9,36 +9,100 @@ use phf::phf_map;
static ALWAYS_HELP_PAGES: phf::Map<&'static str, &'static str> = phf_map! {
"<topicname>" =>
ansi!("You are supposed to replace <lt>topicname> with the topic you want \
to learn about. Example:\r\n\
to learn about. Example:\n\
\t<bold>help register<reset> will tell you about the register command.")
};
static UNREGISTERED_HELP_PAGES: phf::Map<&'static str, &'static str> = phf_map! {
"" =>
ansi!("Type <bold>help <lt>topicname><reset> to learn about a topic. Most \
commands can be used as a topicname.\r\n\
Topics of interest to unregistered users:\r\n\
\t<bold>register<reset>\tLearn about the <bold>register<reset> command.\r\n\
\t<bold>login<reset>\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\
\t<bold>register<reset>\tLearn about the <bold>register<reset> command.\n\
\t<bold>login<reset>\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\
\t<bold>register <lt>username> <lt>password> <lt>email><reset>\r\n\
ansi!("Registers a new user. You are allowed at most 5 at once.\n\
\t<bold>register <lt>username> <lt>password> <lt>email><reset>\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\
\t<bold>login <lt>username> <lt>password<reset>")
};
static REGISTERED_HELP_PAGES: phf::Map<&'static str, &'static str> = phf_map! {
"" =>
ansi!("Type <bold>help <lt>topicname><reset> to learn about a topic. Most \
commands can be used as a topicname.\r\n\
Topics of interest:\r\n\
\t<bold>newbie<reset>\tLearn the absolute basics."),
commands can be used as a topicname.\n\
Topics of interest:\n\
\t<bold>newbie<reset>\tLearn the absolute basics.\n\
\t<bold>movement<reset>\tCommands for moving around.\n\
\t<bold>talk<reset>\tFind out how to talk in the game.\n\
\t<bold>combat<reset>\tLearn how to fight.\n\
\t<bold>information<reset>\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 <bold>look<reset> (or <bold>l<reset>) 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. <bold>lmap<reset> shows you a more detailed map showing the\n\
directions you can move in. You can also look at objects or players with \n\
<bold>l<reset> 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. <bold>northeast<reset> or <bold>south<reset>,\n\
or a short form (<bold>n<reset>, <bold>e<reset>, <bold>s<reset>, <bold>w<reset>, <bold>ne<reset>, <bold>nw<reset>, <bold>se<reset>, <bold>sw<reset>, <bold>up<reset>, <bold>down<reset>)."),
"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. <bold>northeast<reset> or <bold>south<reset>,\n\
or a short form (<bold>n<reset>, <bold>e<reset>, <bold>s<reset>, <bold>w<reset>, <bold>ne<reset>, <bold>nw<reset>, <bold>se<reset>, <bold>sw<reset>, <bold>up<reset>, <bold>down<reset>)."),
"look" =>
ansi!("Try <bold>look<reset> or <bold>l<reset> 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 <bold>kill<reset> character or <bold>k<reset> 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 <bold>help death<reset>). \
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 <bold>help skills<reset>), \
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 <bold>help movement<reset> - 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\
\t<bold>look<reset> (or <bold>l<reset>) to look around - follow it with an exit or\n\
\t\ta character / item name for detail on that.\n\
\t<bold>lmap<reset> - get a map showing exits and places."),
"talk" =>
ansi!("Use:\n\
\t<bold>'<reset>message to send message to the room.\n\
\t<bold>-<reset>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(())
}