Add documentation on allow.

This commit is contained in:
Condorra 2023-03-13 17:21:53 +11:00
parent b96fc2e772
commit e0187bd2c8
2 changed files with 62 additions and 5 deletions

View File

@ -658,8 +658,10 @@ async fn handle_user_consent(ctx: &mut VerbContext<'_>, source_player: &Item,
Some(msg) => {
match ctx.trans.find_session_for_player(&to_user_item.item_code).await? {
None => {},
Some((session, _)) =>
ctx.trans.queue_for_session(&session, Some(&(msg + "\n"))).await?
Some((session, session_dat)) =>
if cmd.consent_type != ConsentType::Sex || !session_dat.less_explicit_mode {
ctx.trans.queue_for_session(&session, Some(&(msg + "\n"))).await?;
}
}
}
}

View File

@ -115,13 +115,68 @@ static REGISTERED_HELP_PAGES: phf::Map<&'static str, &'static str> = phf_map! {
Hint: get and drop support an item name, but you can also prefix it \
with a number - e.g. <bold>get 2 whip<reset>. Instead of a number, you can \
use <bold>all<reset>. You can also omit the item name to match any \
possession, e.g. <bold>drop all<reset> will drop everything you have.")
possession, e.g. <bold>drop all<reset> will drop everything you have."),
"allow" =>
ansi!("<bold>allow<reset> is the corner-stone of Blastmud's consent system. Consents in \
Blastmud let you choose how you want to play with other players (it only affects players, \
not NPCs). There are 4 types of consent: <bold>fight<reset> (for hostile actions like \
attack or pick), <bold>medicine<reset> (for medical actions, including those that might \
crit fail and do harm), <bold>gifts<reset> (lets them give you things), and \
<bold>visit<reset> (lets them on to a tile owned by you legally).\n\
\n\
To allow, an individual, use the syntax <bold>allow <reset>type <bold>from <reset>player options\n\
Options can be blank to use defaults, or can be one or more of the following, separated by spaces:\n\
\t<bold>until<reset> n <bold>minutes<reset> - replace n with a number. You can use hours, days, or weeks instead of minutes. This makes the consent expire. Fight expires after a week if you don't give a shorter period, and all other consent types have no expiry unless you specify one.\n\
\t<bold>until death<reset> - makes the consent valid only until you next die.\n\
\t<bold>allow private<reset> - makes the consent valid even in privately owned places. This is the default for anything except fight.\n\
\t<bold>disallow private<reset> - the opposite of allow private.\n\
\t<bold>in<reset> place - limits where fighting can happen to selected public places. You can use \
<bold>here<reset>, or if you know the code, a place name. You can use this option more than once to allow \
any place, and if you don't use the option, it means anywhere (subject to allow private).\n\
\t<bold>allow pick<reset> - fight only - include picking in your consent.\n\
\t<bold>allow revoke<reset> - fight only - allows the player to revoke any time with disallow.\n\
\n\
Consents for anything except fight take effect immediately to let the other player do the action.\n\
Consents for fight take effect when the other player executes a reciprocal allow command.\n\
Consents for anything except than fight can be revoked instantly with:\n\
\t<bold>disallow<reset> action <bold>from<reset> player\n\
Consent for fight can be revoked similarly if the consent used the <bold>allow revoke<reset> option. \
Otherwise, attempting to revoke informs the other player, and it is revoked when they also issue a \
disallow command.")
};
static EXPLICIT_HELP_PAGES: phf::Map<&'static str, &'static str> = phf_map! {
"fuck" =>
ansi!("Type <bold>fuck <lt>name><reset> to fuck someone. It only works if \
they have consented.")
they have consented."),
"allow" =>
ansi!("<bold>allow<reset> is the corner-stone of Blastmud's consent system. Consents in \
Blastmud let you choose how you want to play with other players (it only affects players, \
not NPCs). There are 5 types of consent: <bold>fight<reset> (for hostile actions like \
attack or pick), <bold>medicine<reset> (for medical actions, including those that might \
crit fail and do harm), <bold>gifts<reset> (lets them give you things), \
<bold>visit<reset> (lets them on to a tile owned by you legally), and <bold>fuck<reset> \
(lets them do fun but dirty things to you).\n\
\n\
To allow, an individual, use the syntax <bold>allow <reset>type <bold>from <reset>player options\n\
Options can be blank to use defaults, or can be one or more of the following, separated by spaces:\n\
\t<bold>until <reset> n <bold>minutes<reset> - replace n with a number. You can use hours, days, or weeks instead of minutes. This makes the consent expire. Fight expires after a week if you don't give a shorter period, and all other consent types have no expiry unless you specify one.\n\
\t<bold>until death<reset> - makes the consent valid only until you next die.\n\
\t<bold>allow private<reset> - makes the consent valid even in privately owned places. This is the default for anything except fight.\n\
\t<bold>disallow private<reset> - the opposite of allow private.\n\
\t<bold>in<reset> place - limits where fighting can happen to selected public places. You can use \
<bold>here<reset>, or if you know the code, a place name. You can use this option more than once to allow \
any place, and if you don't use the option, it means anywhere (subject to allow private).\n\
\t<bold>allow pick<reset> - fight only - include picking in your consent.\n\
\t<bold>allow revoke<reset> - fight only - allows the player to revoke any time with disallow.\n\
\n\
Consents for anything except fight take effect immediately to let the other player do the action.\n\
Consents for fight take effect when the other player executes a reciprocal allow command.\n\
Consents for anything except than fight can be revoked instantly with:\n\
\t<bold>disallow<reset> action <bold>from<reset> player\n\
Consent for fight can be revoked similarly if the consent used the <bold>allow revoke<reset> option. \
Otherwise, attempting to revoke informs the other player, and it is revoked when they also issue a \
disallow command.")
};
pub struct Verb;
@ -138,7 +193,7 @@ impl UserVerb for Verb {
} else {
help = help.or_else(|| REGISTERED_HELP_PAGES.get(remaining));
if !ctx.session_dat.less_explicit_mode {
help = help.or_else(|| EXPLICIT_HELP_PAGES.get(remaining))
help = EXPLICIT_HELP_PAGES.get(remaining).or(help);
}
}
help = help.or_else(|| ALWAYS_HELP_PAGES.get(remaining));