Remove explicit parameter from display_for_sentence

This commit is contained in:
Condorra 2023-12-30 16:13:07 +11:00
parent 3c302136d5
commit 58c815f8b4
42 changed files with 366 additions and 399 deletions

View File

@ -746,9 +746,9 @@ async fn handle_user_consent(
}; };
let update = compute_new_consent_state( let update = compute_new_consent_state(
&source_player.display_for_sentence(false, 1, false), &source_player.display_for_sentence(1, false),
&source_player.pronouns.possessive, &source_player.pronouns.possessive,
&to_user_item.display_for_sentence(false, 1, false), &to_user_item.display_for_sentence(1, false),
&to_user_item.pronouns.possessive, &to_user_item.pronouns.possessive,
&("from ".to_owned() + &source_player.item_code), &("from ".to_owned() + &source_player.item_code),
&cmd.consent_type, &cmd.consent_type,
@ -953,7 +953,7 @@ async fn handle_corp_consent(
"<red>{} {} to fight{} against {} on behalf \ "<red>{} {} to fight{} against {} on behalf \
of {}<reset>, with result: {}\n" of {}<reset>, with result: {}\n"
), ),
&source_player.display_for_sentence(false, 1, true), &source_player.display_for_sentence(1, true),
action_str, action_str,
&details_str, &details_str,
&to_corp.name, &to_corp.name,

View File

@ -58,7 +58,7 @@ impl UserVerb for Verb {
Some(&user.username), Some(&user.username),
&format!( &format!(
ansi!("<yellow>{} (to {}): <reset><bold>\"{}\"<reset>\n"), ansi!("<yellow>{} (to {}): <reset><bold>\"{}\"<reset>\n"),
&player.display_for_sentence(false, 1, true), &player.display_for_sentence(1, true),
&corp.name, &corp.name,
&msg &msg
), ),

View File

@ -115,7 +115,7 @@ impl QueueCommandHandler for QueueHandler {
None, None,
&format!( &format!(
"{} closes the door to the {}.\n", "{} closes the door to the {}.\n",
&ctx.item.display_for_sentence(true, 1, true), &ctx.item.display_for_sentence(1, true),
dir dir
), ),
) )

View File

@ -109,7 +109,7 @@ async fn corp_invite(ctx: &mut VerbContext<'_>, remaining: &str) -> UResult<()>
ctx.trans.queue_for_session(&their_sess, Some(&format!( ctx.trans.queue_for_session(&their_sess, Some(&format!(
ansi!("{} wants to hire you into {}! Type <bold>corp join {}<reset> to accept.{}\n"), ansi!("{} wants to hire you into {}! Type <bold>corp join {}<reset> to accept.{}\n"),
&player.display_for_sentence(true, 1, true), &player.display_for_sentence(1, true),
&corp.name, &corp.name,
&corp.name, &corp.name,
if new_mem.allow_combat { if new_mem.allow_combat {
@ -126,7 +126,7 @@ async fn corp_invite(ctx: &mut VerbContext<'_>, remaining: &str) -> UResult<()>
&format!( &format!(
"{} has invited {} to join {}!\n", "{} has invited {} to join {}!\n",
user.username, user.username,
&target_user.display_for_sentence(false, 1, false), &target_user.display_for_sentence(1, false),
corp.name corp.name
), ),
) )
@ -367,7 +367,7 @@ async fn corp_fire(ctx: &mut VerbContext<'_>, remaining: &str) -> UResult<()> {
the workers as {} fires {} from {}.\n" the workers as {} fires {} from {}.\n"
), ),
user.username, user.username,
target_user.display_for_sentence(false, 1, false), target_user.display_for_sentence(1, false),
corp.name corp.name
), ),
) )
@ -530,7 +530,7 @@ async fn corp_promote(ctx: &mut VerbContext<'_>, remaining: &str) -> UResult<()>
&CorpCommType::Notice, None, &CorpCommType::Notice, None,
&format!("Everyone looks up from their desk as {} changes {}'s job title in {} to {} ({}).\n", &format!("Everyone looks up from their desk as {} changes {}'s job title in {} to {} ({}).\n",
user.username, user.username,
target_user.display_for_sentence(false, 1, false), target_user.display_for_sentence(1, false),
corp.name, &title, &perm_str_raw.trim())).await?; corp.name, &title, &perm_str_raw.trim())).await?;
their_mem.job_title = title; their_mem.job_title = title;

View File

@ -63,7 +63,7 @@ impl QueueCommandHandler for QueueHandler {
if corpse.location != ctx.item.location { if corpse.location != ctx.item.location {
user_error(format!( user_error(format!(
"You try to cut {} but realise it is no longer there.", "You try to cut {} but realise it is no longer there.",
corpse.display_for_sentence(true, 1, false) corpse.display_for_sentence(1, false)
))? ))?
} }
ensure_has_butcher_tool(&ctx.trans, &ctx.item).await?; ensure_has_butcher_tool(&ctx.trans, &ctx.item).await?;
@ -98,9 +98,9 @@ impl QueueCommandHandler for QueueHandler {
let msg = format!( let msg = format!(
"{} prepares to cut {} from {}\n", "{} prepares to cut {} from {}\n",
&ctx.item.display_for_sentence(true, 1, true), &ctx.item.display_for_sentence(1, true),
&what_part, &what_part,
&corpse.display_for_sentence(true, 1, false) &corpse.display_for_sentence(1, false)
); );
broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?;
Ok(time::Duration::from_secs(1)) Ok(time::Duration::from_secs(1))
@ -133,7 +133,7 @@ impl QueueCommandHandler for QueueHandler {
if corpse.location != ctx.item.location { if corpse.location != ctx.item.location {
user_error(format!( user_error(format!(
"You try to cut {} but realise it is no longer there.", "You try to cut {} but realise it is no longer there.",
corpse.display_for_sentence(true, 1, false) corpse.display_for_sentence(1, false)
))? ))?
} }
@ -215,9 +215,9 @@ impl QueueCommandHandler for QueueHandler {
None, None,
&format!( &format!(
"{} tries to cut the {} from {}, but only leaves a mutilated mess.\n", "{} tries to cut the {} from {}, but only leaves a mutilated mess.\n",
&ctx.item.display_for_sentence(true, 1, true), &ctx.item.display_for_sentence(1, true),
possession_data.display, possession_data.display,
corpse.display_for_sentence(true, 1, false) corpse.display_for_sentence(1, false)
), ),
) )
.await?; .await?;
@ -233,9 +233,9 @@ impl QueueCommandHandler for QueueHandler {
None, None,
&format!( &format!(
"{} expertly cuts the {} from {}.\n", "{} expertly cuts the {} from {}.\n",
&ctx.item.display_for_sentence(true, 1, true), &ctx.item.display_for_sentence(1, true),
possession_data.display, possession_data.display,
corpse.display_for_sentence(true, 1, false) corpse.display_for_sentence(1, false)
), ),
) )
.await?; .await?;

View File

@ -43,13 +43,13 @@ impl QueueCommandHandler for QueueHandler {
if item.location != ctx.item.location && item.location != ctx.item.refstr() { if item.location != ctx.item.location && item.location != ctx.item.refstr() {
user_error(format!( user_error(format!(
"You try to drink {} but realise you no longer have it", "You try to drink {} but realise you no longer have it",
item.display_for_sentence(true, 1, false) item.display_for_sentence(1, false)
))? ))?
} }
let msg = format!( let msg = format!(
"{} prepares to drink from {}\n", "{} prepares to drink from {}\n",
&ctx.item.display_for_sentence(true, 1, true), &ctx.item.display_for_sentence(1, true),
&item.display_for_sentence(true, 1, false) &item.display_for_sentence(1, false)
); );
broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?;
Ok(time::Duration::from_secs(1)) Ok(time::Duration::from_secs(1))
@ -81,7 +81,7 @@ impl QueueCommandHandler for QueueHandler {
if item.location != ctx.item.location && item.location != ctx.item.refstr() { if item.location != ctx.item.location && item.location != ctx.item.refstr() {
user_error(format!( user_error(format!(
"You try to drink {} but realise you no longer have it!", "You try to drink {} but realise you no longer have it!",
&item.display_for_sentence(true, 1, false) &item.display_for_sentence(1, false)
))? ))?
} }
let liquid_details = item let liquid_details = item
@ -126,8 +126,8 @@ impl QueueCommandHandler for QueueHandler {
let msg = format!( let msg = format!(
"{} drinks from {}\n", "{} drinks from {}\n",
&ctx.item.display_for_sentence(true, 1, true), &ctx.item.display_for_sentence(1, true),
&item.display_for_sentence(true, 1, false) &item.display_for_sentence(1, false)
); );
broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?;

View File

@ -128,7 +128,7 @@ impl QueueCommandHandler for QueueHandler {
if item.location != format!("{}/{}", &ctx.item.item_type, &ctx.item.item_code) { if item.location != format!("{}/{}", &ctx.item.item_type, &ctx.item.item_code) {
user_error(format!( user_error(format!(
"You try to drop {} but realise you no longer have it", "You try to drop {} but realise you no longer have it",
item.display_for_sentence(true, 1, false) item.display_for_sentence(1, false)
))? ))?
} }
if item.action_type == LocationActionType::Worn { if item.action_type == LocationActionType::Worn {
@ -138,8 +138,8 @@ impl QueueCommandHandler for QueueHandler {
} }
let msg = format!( let msg = format!(
"{} prepares to drop {}\n", "{} prepares to drop {}\n",
&ctx.item.display_for_sentence(true, 1, true), &ctx.item.display_for_sentence(1, true),
&item.display_for_sentence(true, 1, false) &item.display_for_sentence(1, false)
); );
broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?;
Ok(time::Duration::from_secs(1)) Ok(time::Duration::from_secs(1))
@ -168,7 +168,7 @@ impl QueueCommandHandler for QueueHandler {
if item.location != format!("{}/{}", &ctx.item.item_type, &ctx.item.item_code) { if item.location != format!("{}/{}", &ctx.item.item_type, &ctx.item.item_code) {
user_error(format!( user_error(format!(
"You try to drop {} but realise you no longer have it!", "You try to drop {} but realise you no longer have it!",
&item.display_for_sentence(true, 1, false) &item.display_for_sentence(1, false)
))? ))?
} }
if item.action_type == LocationActionType::Worn { if item.action_type == LocationActionType::Worn {
@ -192,15 +192,15 @@ impl QueueCommandHandler for QueueHandler {
{ {
CapacityLevel::AboveItemLimit => user_error(format!( CapacityLevel::AboveItemLimit => user_error(format!(
"You can't drop {}, because it is so cluttered here there is no where to put it!", "You can't drop {}, because it is so cluttered here there is no where to put it!",
&item.display_for_sentence(true, 1, false) &item.display_for_sentence(1, false)
))?, ))?,
_ => (), _ => (),
} }
let msg = format!( let msg = format!(
"{} drops {}\n", "{} drops {}\n",
&ctx.item.display_for_sentence(true, 1, true), &ctx.item.display_for_sentence(1, true),
&item.display_for_sentence(true, 1, false) &item.display_for_sentence(1, false)
); );
broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?;
let mut item_mut = (*item).clone(); let mut item_mut = (*item).clone();

View File

@ -41,13 +41,13 @@ impl QueueCommandHandler for QueueHandler {
if item.location != format!("{}/{}", &ctx.item.item_type, &ctx.item.item_code) { if item.location != format!("{}/{}", &ctx.item.item_type, &ctx.item.item_code) {
user_error(format!( user_error(format!(
"You try to eat {} but realise you no longer have it", "You try to eat {} but realise you no longer have it",
item.display_for_sentence(true, 1, false) item.display_for_sentence(1, false)
))? ))?
} }
let msg = format!( let msg = format!(
"{} prepares to eat {}\n", "{} prepares to eat {}\n",
&ctx.item.display_for_sentence(true, 1, true), &ctx.item.display_for_sentence(1, true),
&item.display_for_sentence(true, 1, false) &item.display_for_sentence(1, false)
); );
broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?;
Ok(time::Duration::from_secs(1)) Ok(time::Duration::from_secs(1))
@ -76,7 +76,7 @@ impl QueueCommandHandler for QueueHandler {
if item.location != format!("{}/{}", &ctx.item.item_type, &ctx.item.item_code) { if item.location != format!("{}/{}", &ctx.item.item_type, &ctx.item.item_code) {
user_error(format!( user_error(format!(
"You try to eat {} but realise you no longer have it!", "You try to eat {} but realise you no longer have it!",
&item.display_for_sentence(true, 1, false) &item.display_for_sentence(1, false)
))? ))?
} }
if item.action_type == LocationActionType::Worn { if item.action_type == LocationActionType::Worn {
@ -119,7 +119,7 @@ impl QueueCommandHandler for QueueHandler {
let msg = format!( let msg = format!(
"{} {} {}\n", "{} {} {}\n",
&ctx.item.display_for_sentence(true, 1, true), &ctx.item.display_for_sentence(1, true),
&(if how_many_eaten == how_many_left { &(if how_many_eaten == how_many_left {
"polishes off".to_owned() "polishes off".to_owned()
} else { } else {
@ -129,7 +129,7 @@ impl QueueCommandHandler for QueueHandler {
if how_many_eaten == 1 { "" } else { "s" } if how_many_eaten == 1 { "" } else { "s" }
) )
}), }),
&item.display_for_sentence(true, 1, false) &item.display_for_sentence(1, false)
); );
broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?;

View File

@ -51,21 +51,21 @@ impl QueueCommandHandler for QueueHandler {
if to_item.location != ctx.item.location && to_item.location != ctx.item.refstr() { if to_item.location != ctx.item.location && to_item.location != ctx.item.refstr() {
user_error(format!( user_error(format!(
"You try to fill {} but realise you no longer have it", "You try to fill {} but realise you no longer have it",
to_item.display_for_sentence(true, 1, false) to_item.display_for_sentence(1, false)
))? ))?
} }
if from_item.location != ctx.item.location && from_item.location != ctx.item.refstr() { if from_item.location != ctx.item.location && from_item.location != ctx.item.refstr() {
user_error(format!( user_error(format!(
"You try to fill from {} but realise you no longer have it", "You try to fill from {} but realise you no longer have it",
to_item.display_for_sentence(true, 1, false) to_item.display_for_sentence(1, false)
))? ))?
} }
let msg = format!( let msg = format!(
"{} prepares to fill {} from {}\n", "{} prepares to fill {} from {}\n",
&ctx.item.display_for_sentence(true, 1, true), &ctx.item.display_for_sentence(1, true),
&to_item.display_for_sentence(true, 1, false), &to_item.display_for_sentence(1, false),
&from_item.display_for_sentence(true, 1, false), &from_item.display_for_sentence(1, false),
); );
broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?;
Ok(time::Duration::from_secs(1)) Ok(time::Duration::from_secs(1))
@ -106,20 +106,20 @@ impl QueueCommandHandler for QueueHandler {
if to_item.location != ctx.item.location && to_item.location != ctx.item.refstr() { if to_item.location != ctx.item.location && to_item.location != ctx.item.refstr() {
user_error(format!( user_error(format!(
"You try to fill {} but realise you no longer have it", "You try to fill {} but realise you no longer have it",
to_item.display_for_sentence(true, 1, false) to_item.display_for_sentence(1, false)
))? ))?
} }
if from_item.location != ctx.item.location && from_item.location != ctx.item.refstr() { if from_item.location != ctx.item.location && from_item.location != ctx.item.refstr() {
user_error(format!( user_error(format!(
"You try to fill from {} but realise you no longer have it", "You try to fill from {} but realise you no longer have it",
to_item.display_for_sentence(true, 1, false) to_item.display_for_sentence(1, false)
))? ))?
} }
let from_liquid_details = match from_item.liquid_details.as_ref() { let from_liquid_details = match from_item.liquid_details.as_ref() {
None => user_error(format!( None => user_error(format!(
"{} appears to be empty.", "{} appears to be empty.",
from_item.display_for_sentence(true, 1, true) from_item.display_for_sentence(1, true)
))?, ))?,
Some(v) => v, Some(v) => v,
}; };
@ -132,7 +132,7 @@ impl QueueCommandHandler for QueueHandler {
if available_vol == 0 { if available_vol == 0 {
user_error(format!( user_error(format!(
"{} appears to be empty.", "{} appears to be empty.",
from_item.display_for_sentence(true, 1, true) from_item.display_for_sentence(1, true)
))? ))?
} }
@ -142,7 +142,7 @@ impl QueueCommandHandler for QueueHandler {
{ {
None => user_error(format!( None => user_error(format!(
"You can't find a way to fill {}.", "You can't find a way to fill {}.",
to_item.display_for_sentence(true, 1, false) to_item.display_for_sentence(1, false)
))?, ))?,
Some(v) => v, Some(v) => v,
}; };
@ -153,7 +153,7 @@ impl QueueCommandHandler for QueueHandler {
user_error(format!( user_error(format!(
"You don't think putting {} into {} is a good idea.", "You don't think putting {} into {} is a good idea.",
liq_type.display(), liq_type.display(),
to_item.display_for_sentence(true, 1, false) to_item.display_for_sentence(1, false)
))?; ))?;
} }
} }
@ -170,7 +170,7 @@ impl QueueCommandHandler for QueueHandler {
if actually_transferred == 0 { if actually_transferred == 0 {
user_error(format!( user_error(format!(
"You don't think you can get any more into {}.", "You don't think you can get any more into {}.",
to_item.display_for_sentence(true, 1, false) to_item.display_for_sentence(1, false)
))?; ))?;
} }
@ -230,9 +230,9 @@ impl QueueCommandHandler for QueueHandler {
let msg = format!( let msg = format!(
"{} fills {} from {}\n", "{} fills {} from {}\n",
&ctx.item.display_for_sentence(true, 1, true), &ctx.item.display_for_sentence(1, true),
&to_item.display_for_sentence(true, 1, false), &to_item.display_for_sentence(1, false),
&from_item.display_for_sentence(true, 1, false), &from_item.display_for_sentence(1, false),
); );
broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?;

View File

@ -38,13 +38,13 @@ impl QueueCommandHandler for QueueHandler {
if item.location != ctx.item.location { if item.location != ctx.item.location {
user_error(format!( user_error(format!(
"You try to get {} but realise it is no longer there", "You try to get {} but realise it is no longer there",
item.display_for_sentence(true, 1, false) item.display_for_sentence(1, false)
))? ))?
} }
let msg = format!( let msg = format!(
"{} fumbles around trying to pick up {}\n", "{} fumbles around trying to pick up {}\n",
&ctx.item.display_for_sentence(true, 1, true), &ctx.item.display_for_sentence(1, true),
&item.display_for_sentence(true, 1, false) &item.display_for_sentence(1, false)
); );
broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?;
} }
@ -62,8 +62,8 @@ impl QueueCommandHandler for QueueHandler {
{ {
user_error(format!( user_error(format!(
"You try to get something from {} but realise {} is no longer there", "You try to get something from {} but realise {} is no longer there",
container.display_for_sentence(true, 1, false), container.display_for_sentence(1, false),
container.display_for_sentence(true, 1, false), container.display_for_sentence(1, false),
))? ))?
} }
let item = ctx let item = ctx
@ -74,15 +74,15 @@ impl QueueCommandHandler for QueueHandler {
if item.location != container.refstr() { if item.location != container.refstr() {
user_error(format!( user_error(format!(
"You try to get {} but realise it is no longer in {}", "You try to get {} but realise it is no longer in {}",
item.display_for_sentence(true, 1, false), item.display_for_sentence(1, false),
container.display_for_sentence(true, 1, false), container.display_for_sentence(1, false),
))? ))?
} }
let msg = format!( let msg = format!(
"{} fumbles around trying to get {} from {}.\n", "{} fumbles around trying to get {} from {}.\n",
&ctx.item.display_for_sentence(true, 1, true), &ctx.item.display_for_sentence(1, true),
&item.display_for_sentence(true, 1, false), &item.display_for_sentence(1, false),
&container.display_for_sentence(true, 1, false) &container.display_for_sentence(1, false)
); );
broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?;
} }
@ -111,14 +111,14 @@ impl QueueCommandHandler for QueueHandler {
if item.location != ctx.item.location { if item.location != ctx.item.location {
user_error(format!( user_error(format!(
"You try to get {} but realise it is no longer there", "You try to get {} but realise it is no longer there",
&item.display_for_sentence(true, 1, false) &item.display_for_sentence(1, false)
))? ))?
} }
let msg = format!( let msg = format!(
"{} picks up {}\n", "{} picks up {}\n",
&ctx.item.display_for_sentence(true, 1, true), &ctx.item.display_for_sentence(1, true),
&item.display_for_sentence(true, 1, false) &item.display_for_sentence(1, false)
); );
broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?;
(item, None) (item, None)
@ -137,8 +137,8 @@ impl QueueCommandHandler for QueueHandler {
{ {
user_error(format!( user_error(format!(
"You try to get something from {} but realise {} is no longer there", "You try to get something from {} but realise {} is no longer there",
container.display_for_sentence(true, 1, false), container.display_for_sentence(1, false),
container.display_for_sentence(true, 1, false), container.display_for_sentence(1, false),
))? ))?
} }
let item = ctx let item = ctx
@ -149,15 +149,15 @@ impl QueueCommandHandler for QueueHandler {
if item.location != container.refstr() { if item.location != container.refstr() {
user_error(format!( user_error(format!(
"You try to get {} but realise it is no longer in {}", "You try to get {} but realise it is no longer in {}",
item.display_for_sentence(true, 1, false), item.display_for_sentence(1, false),
container.display_for_sentence(true, 1, false), container.display_for_sentence(1, false),
))? ))?
} }
let msg = format!( let msg = format!(
"{} gets {} from {}.\n", "{} gets {} from {}.\n",
&ctx.item.display_for_sentence(true, 1, true), &ctx.item.display_for_sentence(1, true),
&item.display_for_sentence(true, 1, false), &item.display_for_sentence(1, false),
&container.display_for_sentence(true, 1, false) &container.display_for_sentence(1, false)
); );
broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?;
(item, Some(container)) (item, Some(container))
@ -182,7 +182,7 @@ impl QueueCommandHandler for QueueHandler {
} }
CapacityLevel::OverBurdened => user_error(format!( CapacityLevel::OverBurdened => user_error(format!(
"Fuck! You can't get {} because it is too heavy!", "Fuck! You can't get {} because it is too heavy!",
&item.display_for_sentence(true, 1, false) &item.display_for_sentence(1, false)
))?, ))?,
_ => (), _ => (),
} }

View File

@ -65,9 +65,9 @@ impl QueueCommandHandler for WithQueueHandler {
None, None,
&format!( &format!(
"{} tries to work out what {} can make from {}.\n", "{} tries to work out what {} can make from {}.\n",
&ctx.item.display_for_sentence(true, 1, true), &ctx.item.display_for_sentence(1, true),
&ctx.item.pronouns.subject, &ctx.item.pronouns.subject,
&item.display_for_sentence(true, 1, false), &item.display_for_sentence(1, false),
), ),
) )
.await?; .await?;
@ -110,7 +110,7 @@ impl QueueCommandHandler for WithQueueHandler {
.ok_or_else(|| { .ok_or_else(|| {
UserError(format!( UserError(format!(
"You can't think of anything you could make with {}", "You can't think of anything you could make with {}",
item.display_for_sentence(true, 1, false) item.display_for_sentence(1, false)
)) ))
})? })?
.iter() .iter()
@ -122,7 +122,7 @@ impl QueueCommandHandler for WithQueueHandler {
.ok_or_else(|| { .ok_or_else(|| {
UserError(format!( UserError(format!(
"You can't think of anything you could make with {}", "You can't think of anything you could make with {}",
item.display_for_sentence(true, 1, false) item.display_for_sentence(1, false)
)) ))
})?; })?;
if let Some((sess, _)) = session { if let Some((sess, _)) = session {
@ -133,7 +133,7 @@ impl QueueCommandHandler for WithQueueHandler {
"You think you could make {} {} from {}\n", "You think you could make {} {} from {}\n",
indefinite_article(result_data.display), indefinite_article(result_data.display),
result_data.display, result_data.display,
item.display_for_sentence(true, 1, false) item.display_for_sentence(1, false)
)), )),
) )
.await?; .await?;
@ -242,8 +242,8 @@ impl QueueCommandHandler for FromQueueHandler {
None, None,
&format!( &format!(
"{} proudly holds up the {} {} just made.\n", "{} proudly holds up the {} {} just made.\n",
&ctx.item.display_for_sentence(true, 1, true), &ctx.item.display_for_sentence(1, true),
&new_item.display_for_sentence(true, 1, false), &new_item.display_for_sentence(1, false),
&ctx.item.pronouns.subject &ctx.item.pronouns.subject
), ),
) )
@ -283,7 +283,7 @@ impl QueueCommandHandler for FromQueueHandler {
) { ) {
user_error(format!( user_error(format!(
"You try adding {}, but it doesn't really seem to fit right.", "You try adding {}, but it doesn't really seem to fit right.",
&item.display_for_sentence(true, 1, false) &item.display_for_sentence(1, false)
))?; ))?;
} }
let skill_result = skill_check_and_grind( let skill_result = skill_check_and_grind(
@ -305,7 +305,7 @@ impl QueueCommandHandler for FromQueueHandler {
&sess, &sess,
Some(&format!( Some(&format!(
"You try adding {}, but it goes badly and you waste it.\n", "You try adding {}, but it goes badly and you waste it.\n",
&item.display_for_sentence(true, 1, false) &item.display_for_sentence(1, false)
)), )),
) )
.await?; .await?;
@ -318,7 +318,7 @@ impl QueueCommandHandler for FromQueueHandler {
&sess, &sess,
Some(&format!( Some(&format!(
"You try and fail at adding {}.\n", "You try and fail at adding {}.\n",
&item.display_for_sentence(true, 1, false) &item.display_for_sentence(1, false)
)), )),
) )
.await?; .await?;
@ -330,7 +330,7 @@ impl QueueCommandHandler for FromQueueHandler {
&sess, &sess,
Some(&format!( Some(&format!(
"You try adding {}.\n", "You try adding {}.\n",
&item.display_for_sentence(true, 1, false), &item.display_for_sentence(1, false),
)), )),
) )
.await?; .await?;

View File

@ -34,7 +34,7 @@ impl UserVerb for Verb {
.await?; .await?;
let all_groups: Vec<Vec<&Arc<Item>>> = inv let all_groups: Vec<Vec<&Arc<Item>>> = inv
.iter() .iter()
.group_by(|i| (i.display_for_sentence(true, 1, false), &i.action_type)) .group_by(|i| (i.display_for_sentence(1, false), &i.action_type))
.into_iter() .into_iter()
.map(|(_, g)| g.collect::<Vec<&Arc<Item>>>()) .map(|(_, g)| g.collect::<Vec<&Arc<Item>>>())
.collect::<Vec<Vec<&Arc<Item>>>>(); .collect::<Vec<Vec<&Arc<Item>>>>();
@ -49,7 +49,7 @@ impl UserVerb for Verb {
total += it_total; total += it_total;
response.push_str(&format!( response.push_str(&format!(
"{} [{}]{}\n", "{} [{}]{}\n",
item.display_for_sentence(true, items.len(), true), item.display_for_sentence(items.len(), true),
weight(it_total), weight(it_total),
match item.action_type { match item.action_type {
LocationActionType::Worn => " (worn)", LocationActionType::Worn => " (worn)",

View File

@ -107,9 +107,9 @@ impl UserVerb for Verb {
None, None,
&format!( &format!(
"{} {}s {} {} {}\n", "{} {}s {} {} {}\n",
&npc.display_for_sentence(true, 1, true), &npc.display_for_sentence(1, true),
verb, verb,
&item.display_for_sentence(true, 1, false), &item.display_for_sentence(1, false),
sep, sep,
&npc.pronouns.intensive &npc.pronouns.intensive
), ),

View File

@ -51,7 +51,7 @@ pub async fn describe_normal_item(
let all_groups: Vec<Vec<&Arc<Item>>> = items let all_groups: Vec<Vec<&Arc<Item>>> = items
.iter() .iter()
.filter(|it| it.action_type != LocationActionType::Worn) .filter(|it| it.action_type != LocationActionType::Worn)
.group_by(|i| (i.display_for_sentence(true, 1, false), &i.action_type)) .group_by(|i| (i.display_for_sentence(1, false), &i.action_type))
.into_iter() .into_iter()
.map(|(_, g)| g.collect::<Vec<&Arc<Item>>>()) .map(|(_, g)| g.collect::<Vec<&Arc<Item>>>())
.collect::<Vec<Vec<&Arc<Item>>>>(); .collect::<Vec<Vec<&Arc<Item>>>>();
@ -66,7 +66,7 @@ pub async fn describe_normal_item(
let mut phrases = Vec::<String>::new(); let mut phrases = Vec::<String>::new();
for group_items in all_groups { for group_items in all_groups {
let head = &group_items[0]; let head = &group_items[0];
let mut details = head.display_for_sentence(true, group_items.len(), false); let mut details = head.display_for_sentence(group_items.len(), false);
match head.action_type { match head.action_type {
LocationActionType::Wielded => details.push_str(" (wielded)"), LocationActionType::Wielded => details.push_str(" (wielded)"),
LocationActionType::Worn => continue, LocationActionType::Worn => continue,
@ -487,7 +487,7 @@ async fn list_room_contents<'l>(ctx: &'l VerbContext<'_>, item: &'l Item) -> URe
.filter(|i| { .filter(|i| {
i.action_type.is_visible_in_look() && !i.flags.contains(&ItemFlag::DontListInLook) i.action_type.is_visible_in_look() && !i.flags.contains(&ItemFlag::DontListInLook)
}) })
.group_by(|i| i.display_for_sentence(true, 1, false)) .group_by(|i| i.display_for_sentence(1, false))
.into_iter() .into_iter()
.map(|(_, g)| g.collect::<Vec<&Arc<Item>>>()) .map(|(_, g)| g.collect::<Vec<&Arc<Item>>>())
.collect::<Vec<Vec<&Arc<Item>>>>(); .collect::<Vec<Vec<&Arc<Item>>>>();
@ -496,7 +496,7 @@ async fn list_room_contents<'l>(ctx: &'l VerbContext<'_>, item: &'l Item) -> URe
let head = &group_items[0]; let head = &group_items[0];
let is_creature = head.item_type == "player" || head.item_type.starts_with("npc"); let is_creature = head.item_type == "player" || head.item_type.starts_with("npc");
buf.push(' '); buf.push(' ');
buf.push_str(&head.display_for_sentence(true, group_items.len(), true)); buf.push_str(&head.display_for_sentence(group_items.len(), true));
buf.push_str(if group_items.len() > 1 { buf.push_str(if group_items.len() > 1 {
" are " " are "
} else { } else {

View File

@ -100,16 +100,13 @@ impl QueueCommandHandler for QueueHandler {
let mut msg = format!( let mut msg = format!(
"{} starts fiddling around trying to make something", "{} starts fiddling around trying to make something",
&ctx.item.display_for_sentence(true, 1, true) &ctx.item.display_for_sentence(1, true)
); );
match bench_opt { match bench_opt {
None => {} None => {}
Some(bench) => { Some(bench) => {
msg.push_str(&format!( msg.push_str(&format!(" on {}", bench.display_for_sentence(1, false)));
" on {}",
bench.display_for_sentence(true, 1, false)
));
} }
} }
msg.push_str(".\n"); msg.push_str(".\n");
@ -185,7 +182,7 @@ impl QueueCommandHandler for QueueHandler {
let on_what = match bench_opt { let on_what = match bench_opt {
None => "".to_owned(), None => "".to_owned(),
Some(bench) => format!(" on {}", bench.display_for_sentence(true, 1, false)), Some(bench) => format!(" on {}", bench.display_for_sentence(1, false)),
}; };
let craft_data = get_craft_data_for_instructions(&instructions) let craft_data = get_craft_data_for_instructions(&instructions)
@ -217,10 +214,6 @@ impl QueueCommandHandler for QueueHandler {
} else { } else {
None None
}; };
let explicit = session
.as_ref()
.map(|s| !s.1.less_explicit_mode)
.unwrap_or(false);
match ingredients_left.iter().next() { match ingredients_left.iter().next() {
None => { None => {
@ -237,8 +230,8 @@ impl QueueCommandHandler for QueueHandler {
None, None,
&format!( &format!(
"{} makes a {}{}.\n", "{} makes a {}{}.\n",
&ctx.item.display_for_sentence(true, 1, true), &ctx.item.display_for_sentence(1, true),
&new_item.display_for_sentence(true, 1, false), &new_item.display_for_sentence(1, false),
&on_what &on_what
), ),
) )
@ -261,14 +254,7 @@ impl QueueCommandHandler for QueueHandler {
})?; })?;
match addable.iter().next() { match addable.iter().next() {
None => user_error(format!( None => user_error(format!("You realise you'd need {}.", pd.display))?,
"You realise you'd need {}.",
if explicit {
pd.display
} else {
pd.display_less_explicit.unwrap_or(pd.display)
}
))?,
Some(item) => { Some(item) => {
let skill_result = skill_check_and_grind( let skill_result = skill_check_and_grind(
&ctx.trans, &ctx.trans,
@ -290,7 +276,7 @@ impl QueueCommandHandler for QueueHandler {
&sess, &sess,
Some(&format!( Some(&format!(
"You try adding {}, but it goes badly and you waste it.\n", "You try adding {}, but it goes badly and you waste it.\n",
&item.display_for_sentence(explicit, 1, false) &item.display_for_sentence(1, false)
)), )),
) )
.await?; .await?;
@ -303,7 +289,7 @@ impl QueueCommandHandler for QueueHandler {
&sess, &sess,
Some(&format!( Some(&format!(
"You try and fail at adding {}.\n", "You try and fail at adding {}.\n",
&item.display_for_sentence(explicit, 1, false) &item.display_for_sentence(1, false)
)), )),
) )
.await?; .await?;
@ -315,7 +301,7 @@ impl QueueCommandHandler for QueueHandler {
&sess, &sess,
Some(&format!( Some(&format!(
"You try adding {}.\n", "You try adding {}.\n",
&item.display_for_sentence(explicit, 1, false), &item.display_for_sentence(1, false),
)), )),
) )
.await?; .await?;

View File

@ -450,9 +450,7 @@ impl MapType for LmapType {
None => None, None => None,
Some((ex_t, ex_c)) => { Some((ex_t, ex_c)) => {
match ctx.trans.find_item_by_type_code(ex_t, ex_c).await?.as_ref() { match ctx.trans.find_item_by_type_code(ex_t, ex_c).await?.as_ref() {
Some(dest_item) => { Some(dest_item) => Some(dest_item.display_for_sentence(1, true)),
Some(dest_item.display_for_sentence(true, 1, true))
}
None => None, None => None,
} }
} }

View File

@ -51,7 +51,7 @@ pub async fn announce_move(
) -> DResult<()> { ) -> DResult<()> {
let msg_leaving = format!( let msg_leaving = format!(
"{} departs towards {}\n", "{} departs towards {}\n",
&character.display_for_sentence(true, 1, true), &character.display_for_sentence(1, true),
&arriving.display &arriving.display
); );
broadcast_to_room( broadcast_to_room(
@ -64,7 +64,7 @@ pub async fn announce_move(
let msg_arriving = format!( let msg_arriving = format!(
"{} arrives from {}\n", "{} arrives from {}\n",
&character.display_for_sentence(true, 1, true), &character.display_for_sentence(1, true),
&leaving.display &leaving.display
); );
broadcast_to_room( broadcast_to_room(
@ -461,7 +461,7 @@ async fn attempt_move_immediate(
let descriptor = handle_fall(&ctx.trans, ctx.item, fall_dist).await?; let descriptor = handle_fall(&ctx.trans, ctx.item, fall_dist).await?;
let msg = format!( let msg = format!(
"{} loses {} grip from {} metres up and {}!\n", "{} loses {} grip from {} metres up and {}!\n",
ctx.item.display_for_sentence(true, 1, true), ctx.item.display_for_sentence(1, true),
ctx.item.pronouns.possessive, ctx.item.pronouns.possessive,
fall_dist, fall_dist,
&descriptor &descriptor
@ -543,7 +543,7 @@ async fn attempt_move_immediate(
} else { } else {
let msg = format!( let msg = format!(
"{} starts climbing {}\n", "{} starts climbing {}\n",
&ctx.item.display_for_sentence(true, 1, true), &ctx.item.display_for_sentence(1, true),
&direction.describe_climb(if climb.height > 0 { "up" } else { "down" }) &direction.describe_climb(if climb.height > 0 { "up" } else { "down" })
); );
broadcast_to_room(&ctx.trans, &use_location, None, &msg).await?; broadcast_to_room(&ctx.trans, &use_location, None, &msg).await?;

View File

@ -179,7 +179,7 @@ pub async fn attempt_open_immediate(
None, None,
&format!( &format!(
"{} opens the door to the {}.\n", "{} opens the door to the {}.\n",
&ctx.item.display_for_sentence(true, 1, true), &ctx.item.display_for_sentence(1, true),
dir dir
), ),
) )

View File

@ -42,8 +42,8 @@ impl QueueCommandHandler for QueueHandler {
if container.location != ctx.item.location && container.location != ctx.item.refstr() { if container.location != ctx.item.location && container.location != ctx.item.refstr() {
user_error(format!( user_error(format!(
"You try to put something in {} but realise {} is no longer there", "You try to put something in {} but realise {} is no longer there",
container.display_for_sentence(true, 1, false), container.display_for_sentence(1, false),
container.display_for_sentence(true, 1, false), container.display_for_sentence(1, false),
))? ))?
} }
let item = ctx let item = ctx
@ -54,15 +54,15 @@ impl QueueCommandHandler for QueueHandler {
if item.location != ctx.item.refstr() { if item.location != ctx.item.refstr() {
user_error(format!( user_error(format!(
"You try to put {} in {}, but realise you no longer have it", "You try to put {} in {}, but realise you no longer have it",
item.display_for_sentence(true, 1, false), item.display_for_sentence(1, false),
container.display_for_sentence(true, 1, false), container.display_for_sentence(1, false),
))? ))?
} }
let msg = format!( let msg = format!(
"{} fumbles around trying to put {} in {}.\n", "{} fumbles around trying to put {} in {}.\n",
&ctx.item.display_for_sentence(true, 1, true), &ctx.item.display_for_sentence(1, true),
&item.display_for_sentence(true, 1, false), &item.display_for_sentence(1, false),
&container.display_for_sentence(true, 1, false) &container.display_for_sentence(1, false)
); );
broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?;
Ok(time::Duration::from_secs(1)) Ok(time::Duration::from_secs(1))
@ -91,8 +91,8 @@ impl QueueCommandHandler for QueueHandler {
if container.location != ctx.item.location && container.location != ctx.item.refstr() { if container.location != ctx.item.location && container.location != ctx.item.refstr() {
user_error(format!( user_error(format!(
"You try to put something in {} but realise {} is no longer there", "You try to put something in {} but realise {} is no longer there",
container.display_for_sentence(true, 1, false), container.display_for_sentence(1, false),
container.display_for_sentence(true, 1, false), container.display_for_sentence(1, false),
))? ))?
} }
let item = ctx let item = ctx
@ -103,8 +103,8 @@ impl QueueCommandHandler for QueueHandler {
if item.location != ctx.item.refstr() { if item.location != ctx.item.refstr() {
user_error(format!( user_error(format!(
"You try to put {} in {}, but realise you no longer have it", "You try to put {} in {}, but realise you no longer have it",
item.display_for_sentence(true, 1, false), item.display_for_sentence(1, false),
container.display_for_sentence(true, 1, false), container.display_for_sentence(1, false),
))? ))?
} }
@ -119,17 +119,17 @@ impl QueueCommandHandler for QueueHandler {
.ok_or_else(|| { .ok_or_else(|| {
UserError(format!( UserError(format!(
"You try to put {} in {}, but can't find out a way to get anything in it", "You try to put {} in {}, but can't find out a way to get anything in it",
item.display_for_sentence(true, 1, false), item.display_for_sentence(1, false),
container.display_for_sentence(true, 1, false), container.display_for_sentence(1, false),
)) ))
})?; })?;
container_data.checker.check_place(&container, &item)?; container_data.checker.check_place(&container, &item)?;
let msg = format!( let msg = format!(
"{} puts {} in {}.\n", "{} puts {} in {}.\n",
&ctx.item.display_for_sentence(true, 1, true), &ctx.item.display_for_sentence(1, true),
&item.display_for_sentence(true, 1, false), &item.display_for_sentence(1, false),
&container.display_for_sentence(true, 1, false) &container.display_for_sentence(1, false)
); );
broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?;
@ -147,12 +147,12 @@ impl QueueCommandHandler for QueueHandler {
match check_item_capacity(ctx.trans, &container, possession_data.weight).await? { match check_item_capacity(ctx.trans, &container, possession_data.weight).await? {
CapacityLevel::AboveItemLimit => user_error(format!( CapacityLevel::AboveItemLimit => user_error(format!(
"{} just can't hold that many things!", "{} just can't hold that many things!",
container.display_for_sentence(true, 1, true), container.display_for_sentence(1, true),
))?, ))?,
CapacityLevel::OverBurdened => user_error(format!( CapacityLevel::OverBurdened => user_error(format!(
"{} You can't place {} because it is too heavy!", "{} You can't place {} because it is too heavy!",
if true { "Fuck!" } else { "Rats!" }, if true { "Fuck!" } else { "Rats!" },
&ctx.item.display_for_sentence(true, 1, false) &ctx.item.display_for_sentence(1, false)
))?, ))?,
_ => (), _ => (),
} }

View File

@ -64,7 +64,7 @@ impl QueueCommandHandler for QueueHandler {
if item.location != ctx.item.location { if item.location != ctx.item.location {
user_error(format!( user_error(format!(
"You try to reclining on {} but realise it's no longer here", "You try to reclining on {} but realise it's no longer here",
item.display_for_sentence(true, 1, false) item.display_for_sentence(1, false)
))? ))?
} }
} }
@ -124,20 +124,17 @@ impl QueueCommandHandler for QueueHandler {
if item.location != ctx.item.location { if item.location != ctx.item.location {
user_error(format!( user_error(format!(
"You try to recline on {} but realise it's no longer here", "You try to recline on {} but realise it's no longer here",
item.display_for_sentence(true, 1, false) item.display_for_sentence(1, false)
))? ))?
} }
( (Some(item.clone()), item.display_for_sentence(1, false))
Some(item.clone()),
item.display_for_sentence(true, 1, false),
)
} }
} }
} }
}; };
let msg = format!( let msg = format!(
"{} reclines on {}.\n", "{} reclines on {}.\n",
&ctx.item.display_for_sentence(true, 1, true), &ctx.item.display_for_sentence(1, true),
&desc &desc
); );
broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?;

View File

@ -17,7 +17,7 @@ async fn check_removeable(ctx: &mut QueuedCommandContext<'_>, item: &Item) -> UR
if item.location != ctx.item.refstr() { if item.location != ctx.item.refstr() {
user_error(format!( user_error(format!(
"You try to remove {} but realise you no longer have it.", "You try to remove {} but realise you no longer have it.",
&item.display_for_sentence(true, 1, false) &item.display_for_sentence(1, false)
))? ))?
} }
@ -68,7 +68,7 @@ async fn check_removeable(ctx: &mut QueuedCommandContext<'_>, item: &Item) -> UR
}) { }) {
user_error(format!( user_error(format!(
"You can't do that without first removing your {} from your {}.", "You can't do that without first removing your {} from your {}.",
&other_item.display_for_sentence(true, 1, false), &other_item.display_for_sentence(1, false),
part.display(ctx.item.sex.clone()) part.display(ctx.item.sex.clone())
))?; ))?;
} }
@ -103,8 +103,8 @@ impl QueueCommandHandler for QueueHandler {
let msg = format!( let msg = format!(
"{} fumbles around trying to take off {}\n", "{} fumbles around trying to take off {}\n",
&ctx.item.display_for_sentence(true, 1, true), &ctx.item.display_for_sentence(1, true),
&item.display_for_sentence(true, 1, false) &item.display_for_sentence(1, false)
); );
broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?;
Ok(time::Duration::from_secs(1)) Ok(time::Duration::from_secs(1))
@ -134,8 +134,8 @@ impl QueueCommandHandler for QueueHandler {
let msg = format!( let msg = format!(
"{} removes {}\n", "{} removes {}\n",
&ctx.item.display_for_sentence(true, 1, true), &ctx.item.display_for_sentence(1, true),
&item.display_for_sentence(true, 1, false) &item.display_for_sentence(1, false)
); );
broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?;
let mut item_mut = (*item).clone(); let mut item_mut = (*item).clone();

View File

@ -39,7 +39,7 @@ pub async fn say_to_room<'l>(
let msg = format!( let msg = format!(
ansi!("<yellow>{} says: <reset><bold>\"{}\"<reset>\n"), ansi!("<yellow>{} says: <reset><bold>\"{}\"<reset>\n"),
from_item.display_for_sentence(true, 1, true), from_item.display_for_sentence(1, true),
say_what say_what
); );

View File

@ -32,7 +32,7 @@ impl QueueCommandHandler for QueueHandler {
None, None,
&format!( &format!(
ansi!("<blue>{} starts methodically searching the area.<reset>\n"), ansi!("<blue>{} starts methodically searching the area.<reset>\n"),
ctx.item.display_for_sentence(true, 1, true), ctx.item.display_for_sentence(1, true),
), ),
) )
.await?; .await?;
@ -90,8 +90,8 @@ impl QueueCommandHandler for QueueHandler {
&ctx.item.location, &ctx.item.location,
None, None,
&format!("{} seems to have found {} - but can't carry it so drops it on the ground.\n", &format!("{} seems to have found {} - but can't carry it so drops it on the ground.\n",
ctx.item.display_for_sentence(true, 1, true), ctx.item.display_for_sentence(1, true),
found.display_for_sentence(true, 1, false), found.display_for_sentence(1, false),
), ),
).await?; ).await?;
} }
@ -102,8 +102,8 @@ impl QueueCommandHandler for QueueHandler {
None, None,
&format!( &format!(
"{} seems to have found {}.\n", "{} seems to have found {}.\n",
ctx.item.display_for_sentence(true, 1, true), ctx.item.display_for_sentence(1, true),
found.display_for_sentence(true, 1, false), found.display_for_sentence(1, false),
), ),
) )
.await?; .await?;

View File

@ -60,7 +60,7 @@ impl QueueCommandHandler for QueueHandler {
if item.location != ctx.item.location { if item.location != ctx.item.location {
user_error(format!( user_error(format!(
"You try to sit on {} but realise it's no longer here", "You try to sit on {} but realise it's no longer here",
item.display_for_sentence(true, 1, false) item.display_for_sentence(1, false)
))? ))?
} }
} }
@ -116,20 +116,17 @@ impl QueueCommandHandler for QueueHandler {
if item.location != ctx.item.location { if item.location != ctx.item.location {
user_error(format!( user_error(format!(
"You try to sit on {} but realise it's no longer here", "You try to sit on {} but realise it's no longer here",
item.display_for_sentence(true, 1, false) item.display_for_sentence(1, false)
))? ))?
} }
( (Some(item.clone()), item.display_for_sentence(1, false))
Some(item.clone()),
item.display_for_sentence(true, 1, false),
)
} }
} }
} }
}; };
let msg = format!( let msg = format!(
"{} sits on {}.\n", "{} sits on {}.\n",
&ctx.item.display_for_sentence(true, 1, true), &ctx.item.display_for_sentence(1, true),
&desc &desc
); );
broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?;

View File

@ -17,7 +17,7 @@ pub async fn stand_if_needed(trans: &DBTrans, who: &mut Item) -> UResult<()> {
LocationActionType::Sitting { .. } | LocationActionType::Reclining { .. } => {} LocationActionType::Sitting { .. } | LocationActionType::Reclining { .. } => {}
_ => return Ok(()), _ => return Ok(()),
} }
let msg = format!("{} stands up.\n", &who.display_for_sentence(true, 1, true)); let msg = format!("{} stands up.\n", &who.display_for_sentence(1, true));
broadcast_to_room(trans, &who.location, None, &msg).await?; broadcast_to_room(trans, &who.location, None, &msg).await?;
who.action_type = LocationActionType::Normal; who.action_type = LocationActionType::Normal;

View File

@ -44,7 +44,7 @@ impl QueueCommandHandler for QueueHandler {
if item.location != format!("player/{}", ctx.item.item_code) { if item.location != format!("player/{}", ctx.item.item_code) {
user_error(format!( user_error(format!(
"You try to use {} but realise you no longer have it", "You try to use {} but realise you no longer have it",
item.display_for_sentence(true, 1, false) item.display_for_sentence(1, false)
))? ))?
} }
let (target_type, target_code) = match target_type_code.split_once("/") { let (target_type, target_code) = match target_type_code.split_once("/") {
@ -71,23 +71,23 @@ impl QueueCommandHandler for QueueHandler {
&& target.location != ctx.item.location && target.location != ctx.item.location
&& target.location != format!("player/{}", ctx.item.item_code) && target.location != format!("player/{}", ctx.item.item_code)
{ {
let target_name = target.display_for_sentence(true, 1, false); let target_name = target.display_for_sentence(1, false);
user_error(format!( user_error(format!(
"You try to use {} on {}, but realise {} is no longer here", "You try to use {} on {}, but realise {} is no longer here",
item.display_for_sentence(true, 1, false), item.display_for_sentence(1, false),
target_name, target_name,
target_name target_name
))? ))?
} }
let msg = format!( let msg = format!(
"{} prepares to use {} {} on {}\n", "{} prepares to use {} {} on {}\n",
&ctx.item.display_for_sentence(true, 1, true), &ctx.item.display_for_sentence(1, true),
&ctx.item.pronouns.possessive, &ctx.item.pronouns.possessive,
&item.display_for_sentence(true, 0, false), &item.display_for_sentence(0, false),
&if is_self_use { &if is_self_use {
ctx.item.pronouns.intensive.clone() ctx.item.pronouns.intensive.clone()
} else { } else {
target.display_for_sentence(true, 1, false) target.display_for_sentence(1, false)
} }
); );
broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?;
@ -142,7 +142,7 @@ impl QueueCommandHandler for QueueHandler {
if item.location != format!("player/{}", ctx.item.item_code) { if item.location != format!("player/{}", ctx.item.item_code) {
user_error(format!( user_error(format!(
"You try to use {} but realise you no longer have it", "You try to use {} but realise you no longer have it",
item.display_for_sentence(true, 1, false) item.display_for_sentence(1, false)
))? ))?
} }
let (ref target_type, ref target_code) = match target_type_code.split_once("/") { let (ref target_type, ref target_code) = match target_type_code.split_once("/") {
@ -160,10 +160,10 @@ impl QueueCommandHandler for QueueHandler {
if target.location != ctx.item.location if target.location != ctx.item.location
&& target.location != format!("player/{}", ctx.item.item_code) && target.location != format!("player/{}", ctx.item.item_code)
{ {
let target_name = target.display_for_sentence(true, 1, false); let target_name = target.display_for_sentence(1, false);
user_error(format!( user_error(format!(
"You try to use {} on {}, but realise {} is no longer here", "You try to use {} on {}, but realise {} is no longer here",
item.display_for_sentence(true, 1, false), item.display_for_sentence(1, false),
target_name, target_name,
target_name target_name
))? ))?
@ -181,7 +181,7 @@ impl QueueCommandHandler for QueueHandler {
if !check_consent(ctx.trans, "use", consent_type, &ctx.item, &target).await? { if !check_consent(ctx.trans, "use", consent_type, &ctx.item, &target).await? {
user_error(format!( user_error(format!(
"{} doesn't allow {} from you", "{} doesn't allow {} from you",
&target.display_for_sentence(true, 1, true), &target.display_for_sentence(1, true),
consent_type.to_str() consent_type.to_str()
))? ))?
} }
@ -195,7 +195,7 @@ impl QueueCommandHandler for QueueHandler {
if item.charges < 1 { if item.charges < 1 {
user_error(format!( user_error(format!(
"{} has no {} {} left", "{} has no {} {} left",
item.display_for_sentence(true, 1, true), item.display_for_sentence(1, true),
&language::pluralise(charge_data.charge_name_prefix), &language::pluralise(charge_data.charge_name_prefix),
charge_data.charge_name_suffix charge_data.charge_name_suffix
))?; ))?;

View File

@ -124,7 +124,7 @@ impl UserVerb for Verb {
&format!( &format!(
ansi!("<cyan>[{}] {} just gave notice to vacate {}! The landlord replied with: \"You have 24 hours to get all your stuff out, then the landlord will send someone up to boot out anyone still in there, and we will sell anything left behind to cover our costs. If you change your mind before then, just rent again and we'll cancel out your notice and let you keep the same apartment - then you'll have to pay the setup fee again though.\"<reset>\n"), ansi!("<cyan>[{}] {} just gave notice to vacate {}! The landlord replied with: \"You have 24 hours to get all your stuff out, then the landlord will send someone up to boot out anyone still in there, and we will sell anything left behind to cover our costs. If you change your mind before then, just rent again and we'll cancel out your notice and let you keep the same apartment - then you'll have to pay the setup fee again though.\"<reset>\n"),
&corptup.1.name, &corptup.1.name,
&player_item.display_for_sentence(true, 1, false), &player_item.display_for_sentence(1, false),
&ex_zone.display &ex_zone.display
) )
).await? ).await?

View File

@ -38,7 +38,7 @@ impl QueueCommandHandler for QueueHandler {
if item.location != ctx.item.refstr() { if item.location != ctx.item.refstr() {
user_error(format!( user_error(format!(
"You try to wear {} but realise you no longer have it", "You try to wear {} but realise you no longer have it",
item.display_for_sentence(true, 1, false) item.display_for_sentence(1, false)
))? ))?
} }
@ -61,8 +61,8 @@ impl QueueCommandHandler for QueueHandler {
let msg = format!( let msg = format!(
"{} fumbles around trying to put on {}\n", "{} fumbles around trying to put on {}\n",
&ctx.item.display_for_sentence(true, 1, true), &ctx.item.display_for_sentence(1, true),
&item.display_for_sentence(true, 1, false) &item.display_for_sentence(1, false)
); );
broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?;
Ok(time::Duration::from_secs(1)) Ok(time::Duration::from_secs(1))
@ -90,7 +90,7 @@ impl QueueCommandHandler for QueueHandler {
if item.location != ctx.item.refstr() { if item.location != ctx.item.refstr() {
user_error(format!( user_error(format!(
"You try to wear {} but realise it is no longer there.", "You try to wear {} but realise it is no longer there.",
&item.display_for_sentence(true, 1, false) &item.display_for_sentence(1, false)
))? ))?
} }
@ -140,8 +140,8 @@ impl QueueCommandHandler for QueueHandler {
let msg = format!( let msg = format!(
"{} wears {}\n", "{} wears {}\n",
&ctx.item.display_for_sentence(true, 1, true), &ctx.item.display_for_sentence(1, true),
&item.display_for_sentence(true, 1, false) &item.display_for_sentence(1, false)
); );
broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?;
let mut item_mut = (*item).clone(); let mut item_mut = (*item).clone();

View File

@ -39,9 +39,9 @@ impl QueueCommandHandler for QueueHandler {
} }
let msg = format!( let msg = format!(
"{} fumbles around with {} {}\n", "{} fumbles around with {} {}\n",
&ctx.item.display_for_sentence(true, 1, true), &ctx.item.display_for_sentence(1, true),
&ctx.item.pronouns.possessive, &ctx.item.pronouns.possessive,
&item.display_for_sentence(true, 1, false) &item.display_for_sentence(1, false)
); );
broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?;
let mut draw_level: f64 = ctx let mut draw_level: f64 = ctx
@ -94,8 +94,8 @@ impl QueueCommandHandler for QueueHandler {
} }
let msg = format!( let msg = format!(
"{} wields {}\n", "{} wields {}\n",
&ctx.item.display_for_sentence(true, 1, true), &ctx.item.display_for_sentence(1, true),
&item.display_for_sentence(true, 1, false) &item.display_for_sentence(1, false)
); );
broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?;
ctx.trans ctx.trans

View File

@ -703,7 +703,7 @@ pub struct Item {
} }
impl Item { impl Item {
pub fn display_for_sentence(&self, explicit_ok: bool, pluralise: usize, caps: bool) -> String { pub fn display_for_sentence(&self, pluralise: usize, caps: bool) -> String {
let mut buf = String::new(); let mut buf = String::new();
if self.death_data.is_some() { if self.death_data.is_some() {
if pluralise > 1 { if pluralise > 1 {
@ -712,11 +712,7 @@ impl Item {
buf.push_str("the body of "); buf.push_str("the body of ");
} }
} }
let singular = if explicit_ok { let singular = &self.display;
&self.display
} else {
self.display_less_explicit.as_ref().unwrap_or(&self.display)
};
if !self.pronouns.is_proper && pluralise == 1 { if !self.pronouns.is_proper && pluralise == 1 {
buf.push_str(language::indefinite_article(&singular)); buf.push_str(language::indefinite_article(&singular));
buf.push(' '); buf.push(' ');
@ -737,7 +733,7 @@ impl Item {
} }
} }
pub fn display_for_session<'l>(self: &'l Self, _session: &Session) -> String { pub fn display_for_session<'l>(self: &'l Self, _session: &Session) -> String {
self.display_for_sentence(true, 1, false) self.display_for_sentence(1, false)
} }
pub fn details_for_session<'l>(self: &'l Self, session: &Session) -> Option<&'l str> { pub fn details_for_session<'l>(self: &'l Self, session: &Session) -> Option<&'l str> {

View File

@ -140,7 +140,7 @@ async fn start_next_attack(
) -> DResult<()> { ) -> DResult<()> {
let msg = &(weapon let msg = &(weapon
.normal_attack .normal_attack
.start_message(&attacker_item, victim_item, true) .start_message(&attacker_item, victim_item)
+ ".\n"); + ".\n");
broadcast_to_room(ctx.trans, &attacker_item.location, None, msg).await?; broadcast_to_room(ctx.trans, &attacker_item.location, None, msg).await?;
Ok(()) Ok(())
@ -163,9 +163,9 @@ async fn process_attack(
{ {
let msg = format!( let msg = format!(
"{} looks like {} wanted to attack {}, but was too tired and stressed to do it.\n", "{} looks like {} wanted to attack {}, but was too tired and stressed to do it.\n",
attacker_item.display_for_sentence(true, 1, true), attacker_item.display_for_sentence(1, true),
attacker_item.pronouns.subject, attacker_item.pronouns.subject,
victim_item.display_for_sentence(true, 1, false), victim_item.display_for_sentence(1, false),
); );
broadcast_to_room(ctx.trans, &attacker_item.location, None, &msg).await?; broadcast_to_room(ctx.trans, &attacker_item.location, None, &msg).await?;
@ -218,8 +218,8 @@ async fn process_attack(
if dodge_result > attack_result { if dodge_result > attack_result {
let msg = format!( let msg = format!(
"{} dodges out of the way of {}'s attack.\n", "{} dodges out of the way of {}'s attack.\n",
victim_item.display_for_sentence(true, 1, true), victim_item.display_for_sentence(1, true),
attacker_item.display_for_sentence(true, 1, false) attacker_item.display_for_sentence(1, false)
); );
broadcast_to_room(ctx.trans, &attacker_item.location, None, &msg).await?; broadcast_to_room(ctx.trans, &attacker_item.location, None, &msg).await?;
match attacker_item.active_combat.as_mut() { match attacker_item.active_combat.as_mut() {
@ -262,12 +262,12 @@ async fn process_attack(
&part, &part,
) )
.await? as i64; .await? as i64;
let msg = attack.success_message(&attacker_item, victim_item, &part, true); let msg = attack.success_message(&attacker_item, victim_item, &part);
if actual_damage == 0 { if actual_damage == 0 {
let msg = format!( let msg = format!(
"{}'s attack bounces off {}'s {}.\n", "{}'s attack bounces off {}'s {}.\n",
&attacker_item.display_for_sentence(true, 1, true), &attacker_item.display_for_sentence(1, true),
&victim_item.display_for_sentence(true, 1, false), &victim_item.display_for_sentence(1, false),
&part.display(victim_item.sex.clone()) &part.display(victim_item.sex.clone())
); );
broadcast_to_room(&ctx.trans, &victim_item.location, None, &msg).await?; broadcast_to_room(&ctx.trans, &victim_item.location, None, &msg).await?;
@ -319,9 +319,9 @@ async fn process_feint(
{ {
let msg = format!( let msg = format!(
"{} looks like {} wanted to feint {}, but was too tired and stressed to do it.\n", "{} looks like {} wanted to feint {}, but was too tired and stressed to do it.\n",
attacker_item.display_for_sentence(true, 1, true), attacker_item.display_for_sentence(1, true),
attacker_item.pronouns.subject, attacker_item.pronouns.subject,
victim_item.display_for_sentence(true, 1, false), victim_item.display_for_sentence(1, false),
); );
broadcast_to_room(ctx.trans, &attacker_item.location, None, &msg).await?; broadcast_to_room(ctx.trans, &attacker_item.location, None, &msg).await?;
match attacker_item.active_combat.as_mut() { match attacker_item.active_combat.as_mut() {
@ -351,7 +351,7 @@ async fn process_feint(
None, None,
&format!( &format!(
"{} seems to have pulled off the feint so poorly {} confused {}!\n", "{} seems to have pulled off the feint so poorly {} confused {}!\n",
&attacker_item.display_for_sentence(true, 1, true), &attacker_item.display_for_sentence(1, true),
&attacker_item.pronouns.object, &attacker_item.pronouns.object,
&attacker_item.pronouns.intensive, &attacker_item.pronouns.intensive,
), ),
@ -380,8 +380,8 @@ async fn process_feint(
None, None,
&format!( &format!(
"{} is confused by {}'s antics!\n", "{} is confused by {}'s antics!\n",
&victim_item.display_for_sentence(true, 1, true), &victim_item.display_for_sentence(1, true),
&attacker_item.display_for_sentence(true, 1, false), &attacker_item.display_for_sentence(1, false),
), ),
) )
.await?; .await?;
@ -403,8 +403,8 @@ async fn process_feint(
None, None,
&format!( &format!(
"{} doesn't seem to have fallen for {}'s unenlightened attempt at a feint.\n", "{} doesn't seem to have fallen for {}'s unenlightened attempt at a feint.\n",
&victim_item.display_for_sentence(true, 1, true), &victim_item.display_for_sentence(1, true),
&attacker_item.display_for_sentence(true, 1, false) &attacker_item.display_for_sentence(1, false)
), ),
) )
.await?; .await?;
@ -606,7 +606,7 @@ pub async fn consider_reward_for(
bonus.payment, bonus.payment,
actual_tax, actual_tax,
corp.name, corp.name,
&for_item_sim_notdead.display_for_sentence(true, 1, false) &for_item_sim_notdead.display_for_sentence(1, false)
), ),
) )
.await?; .await?;
@ -649,7 +649,7 @@ pub async fn consider_reward_for(
pub async fn handle_death(trans: &DBTrans, whom: &mut Item) -> DResult<()> { pub async fn handle_death(trans: &DBTrans, whom: &mut Item) -> DResult<()> {
let msg = format!( let msg = format!(
ansi!("<red>{} stiffens and collapses dead.<reset>\n"), ansi!("<red>{} stiffens and collapses dead.<reset>\n"),
&whom.display_for_sentence(true, 1, true) &whom.display_for_sentence(1, true)
); );
broadcast_to_room(trans, &whom.location, None, &msg).await?; broadcast_to_room(trans, &whom.location, None, &msg).await?;
@ -942,13 +942,13 @@ pub async fn start_attack_mut(
msg.push_str(&format!( msg.push_str(&format!(
ansi!("<red>{} {} {}.<reset>\n"), ansi!("<red>{} {} {}.<reset>\n"),
&by_whom.display_for_sentence(true, 1, true), &by_whom.display_for_sentence(1, true),
verb, verb,
&to_whom.display_for_sentence(true, 1, false) &to_whom.display_for_sentence(1, false)
)); ));
let (_, wielded) = what_wielded(trans, &Arc::new(by_whom.clone())).await?; let (_, wielded) = what_wielded(trans, &Arc::new(by_whom.clone())).await?;
msg.push_str(&(wielded.normal_attack.start_message(by_whom, to_whom, true) + ".\n")); msg.push_str(&(wielded.normal_attack.start_message(by_whom, to_whom) + ".\n"));
broadcast_to_room(trans, &by_whom.location, None::<&Item>, &msg).await?; broadcast_to_room(trans, &by_whom.location, None::<&Item>, &msg).await?;
@ -1017,7 +1017,7 @@ pub async fn switch_to_power_attack(ctx: &VerbContext<'_>, who: &Arc<Item>) -> U
let pow_att = match wielded.power_attack.as_ref() { let pow_att = match wielded.power_attack.as_ref() {
None => user_error(format!( None => user_error(format!(
"{} is unsuitable for powerattacking", "{} is unsuitable for powerattacking",
wield_it.display_for_sentence(true, 1, true) wield_it.display_for_sentence(1, true)
))?, ))?,
Some(v) => v, Some(v) => v,
}; };
@ -1053,7 +1053,7 @@ pub async fn switch_to_power_attack(ctx: &VerbContext<'_>, who: &Arc<Item>) -> U
None => user_error("They seem to be gone!".to_owned())?, None => user_error("They seem to be gone!".to_owned())?,
Some(v) => v, Some(v) => v,
}; };
let msg = pow_att.start_message(who, &to_whom, true) + ".\n"; let msg = pow_att.start_message(who, &to_whom) + ".\n";
broadcast_to_room(ctx.trans, &who.location, None, &msg).await?; broadcast_to_room(ctx.trans, &who.location, None, &msg).await?;
let mut who_mut = (**who).clone(); let mut who_mut = (**who).clone();
@ -1148,8 +1148,8 @@ pub async fn switch_to_feint(ctx: &VerbContext<'_>, who: &Arc<Item>) -> UResult<
]; ];
let feint = feints.iter().choose(&mut thread_rng()).unwrap(); let feint = feints.iter().choose(&mut thread_rng()).unwrap();
let msg = feint( let msg = feint(
&who.display_for_sentence(true, 1, true), &who.display_for_sentence(1, true),
&to_whom.display_for_sentence(true, 1, false), &to_whom.display_for_sentence(1, false),
); );
broadcast_to_room(ctx.trans, &who.location, None, &msg).await?; broadcast_to_room(ctx.trans, &who.location, None, &msg).await?;
@ -1225,7 +1225,7 @@ impl TaskHandler for RotCorpseTaskHandler {
let msg = format!( let msg = format!(
"{} rots away to nothing.\n", "{} rots away to nothing.\n",
corpse.display_for_sentence(true, 1, true) corpse.display_for_sentence(1, true)
); );
broadcast_to_room(ctx.trans, &corpse.location, None, &msg).await?; broadcast_to_room(ctx.trans, &corpse.location, None, &msg).await?;
Ok(None) Ok(None)

View File

@ -351,7 +351,7 @@ pub fn default_effects_for_type() -> &'static BTreeMap<EffectType, EffectSet> {
delay_secs: 0, delay_secs: 0,
messagef: Box::new(|_player, _item, target| messagef: Box::new(|_player, _item, target|
format!(ansi!("<red>You notice that {} has a fresh gaping wound that looks like it's about to {}!<reset>\n"), format!(ansi!("<red>You notice that {} has a fresh gaping wound that looks like it's about to {}!<reset>\n"),
target.display_for_sentence(true, 1, false), target.display_for_sentence(1, false),
if target.species == SpeciesType::Robot { "leak coolant" } else { "bleed" } if target.species == SpeciesType::Robot { "leak coolant" } else { "bleed" }
) )
) )
@ -364,7 +364,7 @@ pub fn default_effects_for_type() -> &'static BTreeMap<EffectType, EffectSet> {
message: Box::new(|target| message: Box::new(|target|
format!("{} pulses from {}'s wound", format!("{} pulses from {}'s wound",
if target.species == SpeciesType::Robot { "Coolant" } else { "Blood" }, if target.species == SpeciesType::Robot { "Coolant" } else { "Blood" },
target.display_for_sentence(true, 1, false), target.display_for_sentence(1, false),
) )
) )
}, },
@ -376,7 +376,7 @@ pub fn default_effects_for_type() -> &'static BTreeMap<EffectType, EffectSet> {
message: Box::new(|target| message: Box::new(|target|
format!("{} pulses from {}'s wound", format!("{} pulses from {}'s wound",
if target.species == SpeciesType::Robot { "Coolant" } else { "Blood" }, if target.species == SpeciesType::Robot { "Coolant" } else { "Blood" },
target.display_for_sentence(true, 1, false), target.display_for_sentence(1, false),
) )
) )
}, },
@ -388,7 +388,7 @@ pub fn default_effects_for_type() -> &'static BTreeMap<EffectType, EffectSet> {
message: Box::new(|target| message: Box::new(|target|
format!("{} pulses from {}'s wound", format!("{} pulses from {}'s wound",
if target.species == SpeciesType::Robot { "Coolant" } else { "Blood" }, if target.species == SpeciesType::Robot { "Coolant" } else { "Blood" },
target.display_for_sentence(true, 1, false), target.display_for_sentence(1, false),
) )
) )
}, },
@ -400,7 +400,7 @@ pub fn default_effects_for_type() -> &'static BTreeMap<EffectType, EffectSet> {
message: Box::new(|target| message: Box::new(|target|
format!("{} pulses from {}'s wound", format!("{} pulses from {}'s wound",
if target.species == SpeciesType::Robot { "Coolant" } else { "Blood" }, if target.species == SpeciesType::Robot { "Coolant" } else { "Blood" },
target.display_for_sentence(true, 1, false), target.display_for_sentence(1, false),
) )
) )
}, },
@ -412,7 +412,7 @@ pub fn default_effects_for_type() -> &'static BTreeMap<EffectType, EffectSet> {
message: Box::new(|target| message: Box::new(|target|
format!("{} pulses from {}'s wound", format!("{} pulses from {}'s wound",
if target.species == SpeciesType::Robot { "Coolant" } else { "Blood" }, if target.species == SpeciesType::Robot { "Coolant" } else { "Blood" },
target.display_for_sentence(true, 1, false), target.display_for_sentence(1, false),
) )
) )
}, },
@ -424,7 +424,7 @@ pub fn default_effects_for_type() -> &'static BTreeMap<EffectType, EffectSet> {
message: Box::new(|target| message: Box::new(|target|
format!("A final tiny drop of {} oozes from {}'s wound as it heals", format!("A final tiny drop of {} oozes from {}'s wound as it heals",
if target.species == SpeciesType::Robot { "coolant" } else { "blood" }, if target.species == SpeciesType::Robot { "coolant" } else { "blood" },
target.display_for_sentence(true, 1, false), target.display_for_sentence(1, false),
) )
) )
}, },
@ -437,7 +437,7 @@ pub fn default_effects_for_type() -> &'static BTreeMap<EffectType, EffectSet> {
delay_secs: 0, delay_secs: 0,
messagef: Box::new(|_player, _item, target| messagef: Box::new(|_player, _item, target|
format!(ansi!("<blue>{} is stunned!<reset>\n"), format!(ansi!("<blue>{} is stunned!<reset>\n"),
target.display_for_sentence(true, 1, true), target.display_for_sentence(1, true),
) )
) )
}, },
@ -445,7 +445,7 @@ pub fn default_effects_for_type() -> &'static BTreeMap<EffectType, EffectSet> {
delay_secs: 30, delay_secs: 30,
messagef: Box::new(|_player, _item, target| messagef: Box::new(|_player, _item, target|
format!(ansi!("<blue>{} seems to have returned to {} senses!<reset>\n"), format!(ansi!("<blue>{} seems to have returned to {} senses!<reset>\n"),
target.display_for_sentence(true, 1, true), target.display_for_sentence(1, true),
&target.pronouns.object, &target.pronouns.object,
) )
) )

View File

@ -96,7 +96,7 @@ impl TaskHandler for ShareTaskHandler {
let act = (&vec![ let act = (&vec![
"mocks the existence of a self-styled king".to_owned(), "mocks the existence of a self-styled king".to_owned(),
format!("declares {} king in a mocking tone", &pa.pronouns.intensive), format!("declares {} king in a mocking tone", &pa.pronouns.intensive),
format!("puts on {} best Queens English and asks if {} would like some wasteland tea from {} finest rusty mug", &pa.pronouns.possessive, &pb.display_for_sentence(false, 1, false), &pa.pronouns.possessive), format!("puts on {} best Queens English and asks if {} would like some wasteland tea from {} finest rusty mug", &pa.pronouns.possessive, &pb.display_for_sentence(1, false), &pa.pronouns.possessive),
format!("utters, with no hint of fear, a phrase that would have {} up for les majeste if the king had any real power", &pa.pronouns.object) format!("utters, with no hint of fear, a phrase that would have {} up for les majeste if the king had any real power", &pa.pronouns.object)
]).choose(&mut rand::thread_rng()).unwrap().clone(); ]).choose(&mut rand::thread_rng()).unwrap().clone();
let reaction = (&vec![ let reaction = (&vec![
@ -111,10 +111,10 @@ impl TaskHandler for ShareTaskHandler {
.clone(); .clone();
format!( format!(
"{} {}{} and {} {}", "{} {}{} and {} {}",
pa.display_for_sentence(false, 1, true), pa.display_for_sentence(1, true),
intensity_word, intensity_word,
&act, &act,
&pb.display_for_sentence(false, 1, false), &pb.display_for_sentence(1, false),
&reaction, &reaction,
) )
} }
@ -137,10 +137,10 @@ impl TaskHandler for ShareTaskHandler {
.unwrap(); .unwrap();
format!( format!(
"{} {}{} and {} {}", "{} {}{} and {} {}",
pa.display_for_sentence(false, 1, true), pa.display_for_sentence(1, true),
intensity_word, intensity_word,
&act, &act,
&pb.display_for_sentence(false, 1, false), &pb.display_for_sentence(1, false),
&reaction, &reaction,
) )
} }
@ -155,10 +155,10 @@ impl TaskHandler for ShareTaskHandler {
.unwrap(); .unwrap();
format!( format!(
"{} {}{} and {} listens attentively", "{} {}{} and {} listens attentively",
pa.display_for_sentence(false, 1, true), pa.display_for_sentence(1, true),
intensity_word, intensity_word,
&thought, &thought,
&pb.display_for_sentence(false, 1, false), &pb.display_for_sentence(1, false),
) )
} }
ConversationTopic::ThoughtsOnMachiavelli => { ConversationTopic::ThoughtsOnMachiavelli => {
@ -172,10 +172,10 @@ impl TaskHandler for ShareTaskHandler {
.unwrap(); .unwrap();
format!( format!(
"{} {}{} and {} nods in agreement", "{} {}{} and {} nods in agreement",
pa.display_for_sentence(false, 1, true), pa.display_for_sentence(1, true),
intensity_word, intensity_word,
&thought, &thought,
&pb.display_for_sentence(false, 1, false), &pb.display_for_sentence(1, false),
) )
} }
ConversationTopic::ExploringRuins => { ConversationTopic::ExploringRuins => {
@ -189,10 +189,10 @@ impl TaskHandler for ShareTaskHandler {
.unwrap(); .unwrap();
format!( format!(
"{} {}{} and {} listens intently", "{} {}{} and {} listens intently",
pa.display_for_sentence(false, 1, true), pa.display_for_sentence(1, true),
intensity_word, intensity_word,
&exploration, &exploration,
&pb.display_for_sentence(false, 1, false), &pb.display_for_sentence(1, false),
) )
} }
ConversationTopic::RoamingEnemies => { ConversationTopic::RoamingEnemies => {
@ -206,10 +206,10 @@ impl TaskHandler for ShareTaskHandler {
.unwrap(); .unwrap();
format!( format!(
"{} {}{} and {} nods with newfound caution", "{} {}{} and {} nods with newfound caution",
pa.display_for_sentence(false, 1, true), pa.display_for_sentence(1, true),
intensity_word, intensity_word,
&enemy_tales, &enemy_tales,
&pb.display_for_sentence(false, 1, false), &pb.display_for_sentence(1, false),
) )
} }
ConversationTopic::FishingSpots => { ConversationTopic::FishingSpots => {
@ -223,10 +223,10 @@ impl TaskHandler for ShareTaskHandler {
.unwrap(); .unwrap();
format!( format!(
"{} {}{} and {} expresses interest", "{} {}{} and {} expresses interest",
pa.display_for_sentence(false, 1, true), pa.display_for_sentence(1, true),
intensity_word, intensity_word,
&fishing_info, &fishing_info,
&pb.display_for_sentence(false, 1, false), &pb.display_for_sentence(1, false),
) )
} }
ConversationTopic::GoodAmbushSpots => { ConversationTopic::GoodAmbushSpots => {
@ -240,10 +240,10 @@ impl TaskHandler for ShareTaskHandler {
.unwrap(); .unwrap();
format!( format!(
"{} {}{} and {} listens with a thoughtful expression", "{} {}{} and {} listens with a thoughtful expression",
pa.display_for_sentence(false, 1, true), pa.display_for_sentence(1, true),
intensity_word, intensity_word,
&ambush_strategy, &ambush_strategy,
&pb.display_for_sentence(false, 1, false), &pb.display_for_sentence(1, false),
) )
} }
ConversationTopic::SurvivingWeather => { ConversationTopic::SurvivingWeather => {
@ -257,10 +257,10 @@ impl TaskHandler for ShareTaskHandler {
.unwrap(); .unwrap();
format!( format!(
"{} {}{} and {} nods appreciatively", "{} {}{} and {} nods appreciatively",
pa.display_for_sentence(false, 1, true), pa.display_for_sentence(1, true),
intensity_word, intensity_word,
&weather_survival, &weather_survival,
&pb.display_for_sentence(false, 1, false), &pb.display_for_sentence(1, false),
) )
} }
}; };
@ -513,7 +513,7 @@ pub async fn display_conversation_status(
"Total direct interest: {}\n", "Total direct interest: {}\n",
(result.my_direct_interest as f64 / 100.0).round() (result.my_direct_interest as f64 / 100.0).round()
)); ));
let partner_txt = with_whom.display_for_sentence(true, 1, true); let partner_txt = with_whom.display_for_sentence(1, false);
if result.their_skill_level < result.my_skill_level { if result.their_skill_level < result.my_skill_level {
msg.push_str(&format!("Your interest level is increased as you observe how {} is learning despite being a less skilled conversationalist than you.\n", &partner_txt)); msg.push_str(&format!("Your interest level is increased as you observe how {} is learning despite being a less skilled conversationalist than you.\n", &partner_txt));
} }
@ -557,7 +557,7 @@ pub async fn start_conversation(
.await? .await?
.ok_or_else(|| { .ok_or_else(|| {
UserError(format!("You propose sharing knowledge with {}, but {} doesn't seem interested. [That player is currently not logged in]", UserError(format!("You propose sharing knowledge with {}, but {} doesn't seem interested. [That player is currently not logged in]",
acceptor.display_for_sentence(true, 1, false), acceptor.display_for_sentence(1, false),
&acceptor.pronouns.subject &acceptor.pronouns.subject
)) ))
})?; })?;
@ -577,7 +577,7 @@ pub async fn start_conversation(
<bold>allow share from {}<reset> before their \ <bold>allow share from {}<reset> before their \
character will consent to knowledge sharing]" character will consent to knowledge sharing]"
), ),
&acceptor.display_for_sentence(true, 1, false), &acceptor.display_for_sentence(1, false),
&acceptor.pronouns.subject, &acceptor.pronouns.subject,
initiator.display_for_session(&other_sessdat) initiator.display_for_session(&other_sessdat)
)) ))
@ -586,7 +586,7 @@ pub async fn start_conversation(
if !acceptor.flags.contains(&ItemFlag::AllowShare) { if !acceptor.flags.contains(&ItemFlag::AllowShare) {
user_error(format!( user_error(format!(
"You ask {} to share knowledge with you, but {} doesn't seem interested.", "You ask {} to share knowledge with you, but {} doesn't seem interested.",
&acceptor.display_for_sentence(true, 1, false), &acceptor.display_for_sentence(1, false),
&acceptor.pronouns.subject &acceptor.pronouns.subject
))?; ))?;
} }
@ -617,14 +617,14 @@ pub async fn start_conversation(
{ {
user_error(format!( user_error(format!(
"{} seems to be a bit busy right now!", "{} seems to be a bit busy right now!",
acceptor.display_for_sentence(true, 1, true) acceptor.display_for_sentence(1, true)
))?; ))?;
} }
if acceptor.active_conversation.is_some() { if acceptor.active_conversation.is_some() {
user_error(format!( user_error(format!(
"{} seems to be already deep in conversation!", "{} seems to be already deep in conversation!",
acceptor.display_for_sentence(true, 1, true) acceptor.display_for_sentence(1, true)
))?; ))?;
} }
@ -634,8 +634,8 @@ pub async fn start_conversation(
None, None,
&format!( &format!(
ansi!("<magenta>{} proposes to share knowledge with {}, and {} accepts!<reset>\n"), ansi!("<magenta>{} proposes to share knowledge with {}, and {} accepts!<reset>\n"),
&initiator.display_for_sentence(true, 1, true), &initiator.display_for_sentence(1, true),
&acceptor.display_for_sentence(false, 1, true), &acceptor.display_for_sentence(1, true),
&acceptor.pronouns.subject &acceptor.pronouns.subject
), ),
) )
@ -703,9 +703,9 @@ pub async fn stop_conversation_mut(
None, None,
&format!( &format!(
ansi!("<magenta>{} {} {}.<reset>\n"), ansi!("<magenta>{} {} {}.<reset>\n"),
&participant.display_for_sentence(true, 1, true), &participant.display_for_sentence(1, true),
leave_description, leave_description,
&partner_mut.display_for_sentence(true, 1, false) &partner_mut.display_for_sentence(1, false)
), ),
) )
.await?; .await?;
@ -1070,8 +1070,8 @@ pub async fn change_conversational_style(
let msg = format!(ansi!( let msg = format!(ansi!(
"{} changes the style of conversation with {} to be {}. The conversation drifts to <bold>{}<reset>, but you realise it could shift to {}\n"), "{} changes the style of conversation with {} to be {}. The conversation drifts to <bold>{}<reset>, but you realise it could shift to {}\n"),
player_item.display_for_sentence(true, 1, true), player_item.display_for_sentence(1, true),
other_player.display_for_sentence(true, 1, false), other_player.display_for_sentence(1, false),
style.display(), style.display(),
topic.display_readable(), topic.display_readable(),
&alt_topics_str &alt_topics_str
@ -1122,8 +1122,8 @@ pub async fn change_conversation_topic(
let msg = format!( let msg = format!(
"{} subtley changes the topic of conversation with {}, and it drifts to {}\n", "{} subtley changes the topic of conversation with {}, and it drifts to {}\n",
player_item.display_for_sentence(true, 1, true), player_item.display_for_sentence(1, true),
other_player.display_for_sentence(true, 1, false), other_player.display_for_sentence(1, false),
topic.display_readable(), topic.display_readable(),
); );
broadcast_to_room(&ctx.trans, &player_item.location, None, &msg).await?; broadcast_to_room(&ctx.trans, &player_item.location, None, &msg).await?;
@ -1164,8 +1164,8 @@ pub async fn change_conversation_intensity(
let msg = format!( let msg = format!(
"You notice a change in the pace of the conversation started by {}, and soon picked up by {}. The conversation is now proceeding {}.\n", "You notice a change in the pace of the conversation started by {}, and soon picked up by {}. The conversation is now proceeding {}.\n",
player_item.display_for_sentence(true, 1, true), player_item.display_for_sentence(1, true),
other_player.display_for_sentence(true, 1, false), other_player.display_for_sentence(1, false),
intensity.display_readable(), intensity.display_readable(),
); );
broadcast_to_room(&ctx.trans, &player_item.location, None, &msg).await?; broadcast_to_room(&ctx.trans, &player_item.location, None, &msg).await?;

View File

@ -51,13 +51,13 @@ impl HireHandler for RoboporterHandler {
50 - stats.total_count 50 - stats.total_count
}; };
let mut msg = String::new(); let mut msg = String::new();
let desc = target.display_for_sentence(true, 1, true); let desc = target.display_for_sentence(1, true);
for item in trans.find_items_by_location(&target.refstr()).await? { for item in trans.find_items_by_location(&target.refstr()).await? {
if remaining_space > 0 { if remaining_space > 0 {
msg.push_str(&format!( msg.push_str(&format!(
"{} unloads {} from {}\n", "{} unloads {} from {}\n",
&desc, &desc,
&item.display_for_sentence(true, 1, false), &item.display_for_sentence(1, false),
&target.pronouns.intensive &target.pronouns.intensive
)); ));
let mut item_mut = (*item).clone(); let mut item_mut = (*item).clone();
@ -66,7 +66,7 @@ impl HireHandler for RoboporterHandler {
remaining_space -= 1; remaining_space -= 1;
} else { } else {
msg.push_str(&format!("{} unloads {} - but since there isn't enough space to put it down, flicks it into the Roboporter's onboard furnace compartment!\n", msg.push_str(&format!("{} unloads {} - but since there isn't enough space to put it down, flicks it into the Roboporter's onboard furnace compartment!\n",
&desc, &item.display_for_sentence(true, 1, false), &desc, &item.display_for_sentence(1, false),
)); ));
recursively_destroy_or_move_item(trans, &item).await?; recursively_destroy_or_move_item(trans, &item).await?;
} }

View File

@ -35,10 +35,9 @@ pub mod torso_armour;
mod trauma_kit; mod trauma_kit;
mod whip; mod whip;
pub type AttackMessageChoice = pub type AttackMessageChoice = Vec<Box<dyn Fn(&Item, &Item) -> String + 'static + Sync + Send>>;
Vec<Box<dyn Fn(&Item, &Item, bool) -> String + 'static + Sync + Send>>;
pub type AttackMessageChoicePart = pub type AttackMessageChoicePart =
Vec<Box<dyn Fn(&Item, &Item, &BodyPart, bool) -> String + 'static + Sync + Send>>; Vec<Box<dyn Fn(&Item, &Item, &BodyPart) -> String + 'static + Sync + Send>>;
#[derive(Clone)] #[derive(Clone)]
pub struct SkillScaling { pub struct SkillScaling {
@ -89,18 +88,18 @@ pub struct WeaponAttackData {
impl Default for WeaponAttackData { impl Default for WeaponAttackData {
fn default() -> Self { fn default() -> Self {
Self { Self {
start_messages: vec![Box::new(|attacker, victim, exp| { start_messages: vec![Box::new(|attacker, victim| {
format!( format!(
"{} makes an attack on {}", "{} makes an attack on {}",
&attacker.display_for_sentence(exp, 1, true), &attacker.display_for_sentence(1, true),
&victim.display_for_sentence(exp, 1, false) &victim.display_for_sentence(1, false)
) )
})], })],
success_messages: vec![Box::new(|attacker, victim, part, exp| { success_messages: vec![Box::new(|attacker, victim, part| {
format!( format!(
"{}'s attack on {} hits {} {}", "{}'s attack on {} hits {} {}",
&attacker.display_for_sentence(exp, 1, true), &attacker.display_for_sentence(1, true),
&victim.display_for_sentence(exp, 1, false), &victim.display_for_sentence(1, false),
&victim.pronouns.possessive, &victim.pronouns.possessive,
part.display(victim.sex.clone()) part.display(victim.sex.clone())
) )
@ -365,25 +364,19 @@ impl Default for PossessionData {
} }
impl WeaponAttackData { impl WeaponAttackData {
pub fn start_message(&self, attacker: &Item, victim: &Item, explicit_ok: bool) -> String { pub fn start_message(&self, attacker: &Item, victim: &Item) -> String {
let mut rng = rand::thread_rng(); let mut rng = rand::thread_rng();
self.start_messages[..] self.start_messages[..]
.choose(&mut rng) .choose(&mut rng)
.map(|f| f(attacker, victim, explicit_ok)) .map(|f| f(attacker, victim))
.unwrap_or("No message defined yet".to_owned()) .unwrap_or("No message defined yet".to_owned())
} }
pub fn success_message( pub fn success_message(&self, attacker: &Item, victim: &Item, part: &BodyPart) -> String {
&self,
attacker: &Item,
victim: &Item,
part: &BodyPart,
explicit_ok: bool,
) -> String {
let mut rng = rand::thread_rng(); let mut rng = rand::thread_rng();
self.success_messages[..] self.success_messages[..]
.choose(&mut rng) .choose(&mut rng)
.map(|f| f(attacker, victim, part, explicit_ok)) .map(|f| f(attacker, victim, part))
.unwrap_or("No message defined yet".to_owned()) .unwrap_or("No message defined yet".to_owned())
} }
} }
@ -480,37 +473,37 @@ pub fn fist() -> &'static WeaponData {
raw_min_to_learn: 0.0, raw_min_to_learn: 0.0,
raw_max_to_learn: 2.0, raw_max_to_learn: 2.0,
normal_attack: WeaponAttackData { normal_attack: WeaponAttackData {
start_messages: vec![Box::new(|attacker, victim, exp| { start_messages: vec![Box::new(|attacker, victim| {
format!( format!(
"{} swings at {} with {} fists", "{} swings at {} with {} fists",
&attacker.display_for_sentence(exp, 1, true), &attacker.display_for_sentence(1, true),
&victim.display_for_sentence(exp, 1, false), &victim.display_for_sentence(1, false),
&attacker.pronouns.possessive &attacker.pronouns.possessive
) )
})], })],
success_messages: vec![Box::new(|attacker, victim, part, exp| { success_messages: vec![Box::new(|attacker, victim, part| {
format!( format!(
"{}'s fists smash into {}'s {}", "{}'s fists smash into {}'s {}",
&attacker.display_for_sentence(exp, 1, true), &attacker.display_for_sentence(1, true),
&victim.display_for_sentence(exp, 1, false), &victim.display_for_sentence(1, false),
&part.display(victim.sex.clone()) &part.display(victim.sex.clone())
) )
})], })],
..Default::default() ..Default::default()
}, },
power_attack: Some(WeaponAttackData { power_attack: Some(WeaponAttackData {
start_messages: vec![Box::new(|attacker, victim, exp| { start_messages: vec![Box::new(|attacker, victim| {
format!( format!(
"{} tenses for a power fist swings at {}", "{} tenses for a power fist swings at {}",
&attacker.display_for_sentence(exp, 1, true), &attacker.display_for_sentence(1, true),
&victim.display_for_sentence(exp, 1, false), &victim.display_for_sentence(1, false),
) )
})], })],
success_messages: vec![Box::new(|attacker, victim, part, exp| { success_messages: vec![Box::new(|attacker, victim, part| {
format!( format!(
"{}'s fists smash with great force into {}'s {}", "{}'s fists smash with great force into {}'s {}",
&attacker.display_for_sentence(exp, 1, true), &attacker.display_for_sentence(1, true),
&victim.display_for_sentence(exp, 1, false), &victim.display_for_sentence(1, false),
&part.display(victim.sex.clone()) &part.display(victim.sex.clone())
) )
})], })],

View File

@ -18,19 +18,19 @@ pub fn data() -> &'static Vec<(PossessionType, PossessionData)> {
raw_max_to_learn: 2.0, raw_max_to_learn: 2.0,
normal_attack: WeaponAttackData { normal_attack: WeaponAttackData {
start_messages: vec!( start_messages: vec!(
Box::new(|attacker, victim, exp| Box::new(|attacker, victim|
format!("{} raises {} butcher knife menancingly, preparing to attack {}", format!("{} raises {} butcher knife menancingly, preparing to attack {}",
&attacker.display_for_sentence(exp, 1, true), &attacker.display_for_sentence(1, true),
&attacker.pronouns.possessive, &attacker.pronouns.possessive,
&victim.display_for_sentence(exp, 1, false), &victim.display_for_sentence(1, false),
) )
) )
), ),
success_messages: vec!( success_messages: vec!(
Box::new(|attacker, victim, part, exp| Box::new(|attacker, victim, part|
format!("{}'s butcher knife cuts into {}'s {}", format!("{}'s butcher knife cuts into {}'s {}",
&attacker.display_for_sentence(exp, 1, true), &attacker.display_for_sentence(1, true),
&victim.display_for_sentence(exp, 1, false), &victim.display_for_sentence(1, false),
&part.display(victim.sex.clone()) &part.display(victim.sex.clone())
) )
) )
@ -57,19 +57,19 @@ pub fn data() -> &'static Vec<(PossessionType, PossessionData)> {
raw_max_to_learn: 3.0, raw_max_to_learn: 3.0,
normal_attack: WeaponAttackData { normal_attack: WeaponAttackData {
start_messages: vec!( start_messages: vec!(
Box::new(|attacker, victim, exp| Box::new(|attacker, victim|
format!("{} points {} dagger menancingly, preparing to attack {}", format!("{} points {} dagger menancingly, preparing to attack {}",
&attacker.display_for_sentence(exp, 1, true), &attacker.display_for_sentence(1, true),
&attacker.pronouns.possessive, &attacker.pronouns.possessive,
&victim.display_for_sentence(exp, 1, false), &victim.display_for_sentence(1, false),
) )
) )
), ),
success_messages: vec!( success_messages: vec!(
Box::new(|attacker, victim, part, exp| Box::new(|attacker, victim, part|
format!("{}'s dagger cuts into {}'s {}", format!("{}'s dagger cuts into {}'s {}",
&attacker.display_for_sentence(exp, 1, true), &attacker.display_for_sentence(1, true),
&victim.display_for_sentence(exp, 1, false), &victim.display_for_sentence(1, false),
&part.display(victim.sex.clone()) &part.display(victim.sex.clone())
) )
) )
@ -97,19 +97,19 @@ pub fn data() -> &'static Vec<(PossessionType, PossessionData)> {
raw_max_to_learn: 4.0, raw_max_to_learn: 4.0,
normal_attack: WeaponAttackData { normal_attack: WeaponAttackData {
start_messages: vec!( start_messages: vec!(
Box::new(|attacker, victim, exp| Box::new(|attacker, victim|
format!("{} grasps {} machete, preparing to strike {}", format!("{} grasps {} machete, preparing to strike {}",
&attacker.display_for_sentence(exp, 1, true), &attacker.display_for_sentence(1, true),
&attacker.pronouns.possessive, &attacker.pronouns.possessive,
&victim.display_for_sentence(exp, 1, false), &victim.display_for_sentence(1, false),
) )
) )
), ),
success_messages: vec!( success_messages: vec!(
Box::new(|attacker, victim, part, exp| Box::new(|attacker, victim, part|
format!("{}'s machete hits {}'s {} with a cutting blow", format!("{}'s machete hits {}'s {} with a cutting blow",
&attacker.display_for_sentence(exp, 1, true), &attacker.display_for_sentence(1, true),
&victim.display_for_sentence(exp, 1, false), &victim.display_for_sentence(1, false),
&part.display(victim.sex.clone()) &part.display(victim.sex.clone())
) )
) )
@ -137,19 +137,19 @@ pub fn data() -> &'static Vec<(PossessionType, PossessionData)> {
raw_max_to_learn: 8.0, raw_max_to_learn: 8.0,
normal_attack: WeaponAttackData { normal_attack: WeaponAttackData {
start_messages: vec!( start_messages: vec!(
Box::new(|attacker, victim, exp| Box::new(|attacker, victim|
format!("{} raises {} katana menancingly, preparing to attack {}", format!("{} raises {} katana menancingly, preparing to attack {}",
&attacker.display_for_sentence(exp, 1, true), &attacker.display_for_sentence(1, true),
&attacker.pronouns.possessive, &attacker.pronouns.possessive,
&victim.display_for_sentence(exp, 1, false), &victim.display_for_sentence(1, false),
) )
) )
), ),
success_messages: vec!( success_messages: vec!(
Box::new(|attacker, victim, part, exp| Box::new(|attacker, victim, part|
format!("{}'s katana slashes into {}'s {}", format!("{}'s katana slashes into {}'s {}",
&attacker.display_for_sentence(exp, 1, true), &attacker.display_for_sentence(1, true),
&victim.display_for_sentence(exp, 1, false), &victim.display_for_sentence(1, false),
&part.display(victim.sex.clone()) &part.display(victim.sex.clone())
) )
) )
@ -177,19 +177,19 @@ pub fn data() -> &'static Vec<(PossessionType, PossessionData)> {
raw_max_to_learn: 13.0, raw_max_to_learn: 13.0,
normal_attack: WeaponAttackData { normal_attack: WeaponAttackData {
start_messages: vec!( start_messages: vec!(
Box::new(|attacker, victim, exp| Box::new(|attacker, victim|
format!("{} flicks {} electroblade, causing it to spark in anticipation of attacking {}", format!("{} flicks {} electroblade, causing it to spark in anticipation of attacking {}",
&attacker.display_for_sentence(exp, 1, true), &attacker.display_for_sentence(1, true),
&attacker.pronouns.possessive, &attacker.pronouns.possessive,
&victim.display_for_sentence(exp, 1, false), &victim.display_for_sentence(1, false),
) )
) )
), ),
success_messages: vec!( success_messages: vec!(
Box::new(|attacker, victim, part, exp| Box::new(|attacker, victim, part|
format!("{}'s electroblade zaps {}'s {}", format!("{}'s electroblade zaps {}'s {}",
&attacker.display_for_sentence(exp, 1, true), &attacker.display_for_sentence(1, true),
&victim.display_for_sentence(exp, 1, false), &victim.display_for_sentence(1, false),
&part.display(victim.sex.clone()) &part.display(victim.sex.clone())
) )
) )
@ -217,19 +217,19 @@ pub fn data() -> &'static Vec<(PossessionType, PossessionData)> {
raw_max_to_learn: 14.0, raw_max_to_learn: 14.0,
normal_attack: WeaponAttackData { normal_attack: WeaponAttackData {
start_messages: vec!( start_messages: vec!(
Box::new(|attacker, victim, exp| Box::new(|attacker, victim|
format!("{} raises {} flame scimitar, swiping it through the air and making it glow red hot, in preparation to attack {}", format!("{} raises {} flame scimitar, swiping it through the air and making it glow red hot, in preparation to attack {}",
&attacker.display_for_sentence(exp, 1, true), &attacker.display_for_sentence(1, true),
&attacker.pronouns.possessive, &attacker.pronouns.possessive,
&victim.display_for_sentence(exp, 1, false), &victim.display_for_sentence(1, false),
) )
) )
), ),
success_messages: vec!( success_messages: vec!(
Box::new(|attacker, victim, part, exp| Box::new(|attacker, victim, part|
format!("{}'s flame scimitar slices into {}'s {}", format!("{}'s flame scimitar slices into {}'s {}",
&attacker.display_for_sentence(exp, 1, true), &attacker.display_for_sentence(1, true),
&victim.display_for_sentence(exp, 1, false), &victim.display_for_sentence(1, false),
&part.display(victim.sex.clone()) &part.display(victim.sex.clone())
) )
) )
@ -257,19 +257,19 @@ pub fn data() -> &'static Vec<(PossessionType, PossessionData)> {
raw_max_to_learn: 100.0, raw_max_to_learn: 100.0,
normal_attack: WeaponAttackData { normal_attack: WeaponAttackData {
start_messages: vec!( start_messages: vec!(
Box::new(|attacker, victim, exp| Box::new(|attacker, victim|
format!("{} raises {} nanoblade gladius menancingly, preparing to attack {}", format!("{} raises {} nanoblade gladius menancingly, preparing to attack {}",
&attacker.display_for_sentence(exp, 1, true), &attacker.display_for_sentence(1, true),
&attacker.pronouns.possessive, &attacker.pronouns.possessive,
&victim.display_for_sentence(exp, 1, false), &victim.display_for_sentence(1, false),
) )
) )
), ),
success_messages: vec!( success_messages: vec!(
Box::new(|attacker, victim, part, exp| Box::new(|attacker, victim, part|
format!("{}'s nanoblade cuts into {}'s {}, activating the horrendous power of the nanites", format!("{}'s nanoblade cuts into {}'s {}, activating the horrendous power of the nanites",
&attacker.display_for_sentence(exp, 1, true), &attacker.display_for_sentence(1, true),
&victim.display_for_sentence(exp, 1, false), &victim.display_for_sentence(1, false),
&part.display(victim.sex.clone()) &part.display(victim.sex.clone())
) )
) )

View File

@ -17,19 +17,19 @@ pub fn data() -> &'static Vec<(PossessionType, PossessionData)> {
raw_min_to_learn: 2.0, raw_min_to_learn: 2.0,
raw_max_to_learn: 4.0, raw_max_to_learn: 4.0,
normal_attack: WeaponAttackData { normal_attack: WeaponAttackData {
start_messages: vec![Box::new(|attacker, victim, exp| { start_messages: vec![Box::new(|attacker, victim| {
format!( format!(
"{} aims {} spiked mace at {}", "{} aims {} spiked mace at {}",
&attacker.display_for_sentence(exp, 1, true), &attacker.display_for_sentence(1, true),
&attacker.pronouns.possessive, &attacker.pronouns.possessive,
&victim.display_for_sentence(exp, 1, false), &victim.display_for_sentence(1, false),
) )
})], })],
success_messages: vec![Box::new(|attacker, victim, part, exp| { success_messages: vec![Box::new(|attacker, victim, part| {
format!( format!(
"{}'s spiked mace smashes with force into {}'s {}", "{}'s spiked mace smashes with force into {}'s {}",
&attacker.display_for_sentence(exp, 1, true), &attacker.display_for_sentence(1, true),
&victim.display_for_sentence(exp, 1, false), &victim.display_for_sentence(1, false),
&part.display(victim.sex.clone()) &part.display(victim.sex.clone())
) )
})], })],

View File

@ -98,7 +98,7 @@ impl ArglessHandler for CorpLicenceHandler {
None, None,
&format!( &format!(
"{} signs a contract establishing {} as a corp\n", "{} signs a contract establishing {} as a corp\n",
&player.display_for_sentence(true, 1, true), &player.display_for_sentence(1, true),
name name
), ),
) )

View File

@ -10,19 +10,19 @@ pub fn data() -> &'static PossessionData {
raw_min_to_learn: 0.0, raw_min_to_learn: 0.0,
raw_max_to_learn: 2.0, raw_max_to_learn: 2.0,
normal_attack: WeaponAttackData { normal_attack: WeaponAttackData {
start_messages: vec![Box::new(|attacker, victim, exp| { start_messages: vec![Box::new(|attacker, victim| {
format!( format!(
"{} bares {} teeth and lunges at {}", "{} bares {} teeth and lunges at {}",
&attacker.display_for_sentence(exp, 1, true), &attacker.display_for_sentence(1, true),
&attacker.pronouns.possessive, &attacker.pronouns.possessive,
&victim.display_for_sentence(exp, 1, false), &victim.display_for_sentence(1, false),
) )
})], })],
success_messages: vec![Box::new(|attacker, victim, part, exp| { success_messages: vec![Box::new(|attacker, victim, part| {
format!( format!(
"{}'s teeth connect and tear at the flesh of {}'s {}", "{}'s teeth connect and tear at the flesh of {}'s {}",
&attacker.display_for_sentence(exp, 1, true), &attacker.display_for_sentence(1, true),
&victim.display_for_sentence(exp, 1, false), &victim.display_for_sentence(1, false),
&part.display(victim.sex.clone()) &part.display(victim.sex.clone())
) )
})], })],

View File

@ -87,9 +87,9 @@ impl InstallHandler for ScanLockInstall {
None, None,
&format!( &format!(
"{} bangs the door to the {} as he installs {} on it.\n", "{} bangs the door to the {} as he installs {} on it.\n",
&player.display_for_sentence(true, 1, true), &player.display_for_sentence(1, true),
&direction.describe(), &direction.describe(),
&what.display_for_sentence(true, 1, false) &what.display_for_sentence(1, false)
), ),
) )
.await?; .await?;
@ -129,9 +129,9 @@ impl InstallHandler for ScanLockInstall {
None, None,
&format!( &format!(
"{} bangs the door to the {} as he uninstalls {} from it{}.\n", "{} bangs the door to the {} as he uninstalls {} from it{}.\n",
&player.display_for_sentence(true, 1, true), &player.display_for_sentence(1, true),
&direction.describe(), &direction.describe(),
&what.display_for_sentence(true, 1, false), &what.display_for_sentence(1, false),
extra_text extra_text
), ),
) )

View File

@ -33,11 +33,11 @@ pub fn data() -> &'static Vec<(PossessionType, PossessionData)> {
messagef: Box::new(|player, _item, target| messagef: Box::new(|player, _item, target|
format!( format!(
"{} attempts to heal {} with a trauma kit, but fucks it up badly\n", "{} attempts to heal {} with a trauma kit, but fucks it up badly\n",
&player.display_for_sentence(true, 1, true), &player.display_for_sentence(1, true),
&if target.item_type == player.item_type && target.item_code == player.item_code { &if target.item_type == player.item_type && target.item_code == player.item_code {
player.pronouns.intensive.clone() player.pronouns.intensive.clone()
} else { } else {
target.display_for_sentence(true, 1, false) target.display_for_sentence(1, false)
} }
), ),
) )
@ -49,7 +49,7 @@ pub fn data() -> &'static Vec<(PossessionType, PossessionData)> {
|target| |target|
format!( format!(
"Fuck! The trauma kit makes {}'s condition worse", "Fuck! The trauma kit makes {}'s condition worse",
target.display_for_sentence(true, 1, false)) target.display_for_sentence(1, false))
) )
} }
) )
@ -62,11 +62,11 @@ pub fn data() -> &'static Vec<(PossessionType, PossessionData)> {
messagef: Box::new(|player, _item, target| messagef: Box::new(|player, _item, target|
format!( format!(
"{} attempts unsuccessfully to heal {} with a trauma kit\n", "{} attempts unsuccessfully to heal {} with a trauma kit\n",
&player.display_for_sentence(true, 1, true), &player.display_for_sentence(1, true),
&if target.item_type == player.item_type && target.item_code == player.item_code { &if target.item_type == player.item_type && target.item_code == player.item_code {
player.pronouns.intensive.clone() player.pronouns.intensive.clone()
} else { } else {
target.display_for_sentence(true, 1, false) target.display_for_sentence(1, false)
} }
) )
) )
@ -81,11 +81,11 @@ pub fn data() -> &'static Vec<(PossessionType, PossessionData)> {
messagef: Box::new(|player, _item, target| messagef: Box::new(|player, _item, target|
format!( format!(
"{} expertly heals {} with a trauma kit\n", "{} expertly heals {} with a trauma kit\n",
&player.display_for_sentence(true, 1, true), &player.display_for_sentence(1, true),
&if target.item_type == player.item_type && target.item_code == player.item_code { &if target.item_type == player.item_type && target.item_code == player.item_code {
player.pronouns.intensive.clone() player.pronouns.intensive.clone()
} else { } else {
target.display_for_sentence(true, 1, false) target.display_for_sentence(1, false)
} }
) )
) )
@ -97,7 +97,7 @@ pub fn data() -> &'static Vec<(PossessionType, PossessionData)> {
|target| |target|
format!( format!(
"FUUUCK! It hurts {}, but also starts to soothe {}", "FUUUCK! It hurts {}, but also starts to soothe {}",
target.display_for_sentence(true, 1, false), target.display_for_sentence(1, false),
&target.pronouns.object &target.pronouns.object
) )
) )
@ -109,7 +109,7 @@ pub fn data() -> &'static Vec<(PossessionType, PossessionData)> {
|target| |target|
format!( format!(
"FUUUCK! It hurts {}, but also starts to soothe {}", "FUUUCK! It hurts {}, but also starts to soothe {}",
target.display_for_sentence(true, 1, false), target.display_for_sentence(1, false),
&target.pronouns.object &target.pronouns.object
) )
) )
@ -121,7 +121,7 @@ pub fn data() -> &'static Vec<(PossessionType, PossessionData)> {
|target| |target|
format!( format!(
"The bandages soothe {}'s wounds", "The bandages soothe {}'s wounds",
target.display_for_sentence(true, 1, false), target.display_for_sentence(1, false),
) )
) )
}, },
@ -132,7 +132,7 @@ pub fn data() -> &'static Vec<(PossessionType, PossessionData)> {
|target| |target|
format!( format!(
"The bandages soothe {}'s wounds", "The bandages soothe {}'s wounds",
target.display_for_sentence(true, 1, false), target.display_for_sentence(1, false),
) )
) )
}, },
@ -143,7 +143,7 @@ pub fn data() -> &'static Vec<(PossessionType, PossessionData)> {
|target| |target|
format!( format!(
"The bandages soothe {}'s wounds", "The bandages soothe {}'s wounds",
target.display_for_sentence(true, 1, false), target.display_for_sentence(1, false),
) )
) )
}, },
@ -154,7 +154,7 @@ pub fn data() -> &'static Vec<(PossessionType, PossessionData)> {
|target| |target|
format!( format!(
"The bandages soothe {}'s wounds", "The bandages soothe {}'s wounds",
target.display_for_sentence(true, 1, false), target.display_for_sentence(1, false),
) )
) )
}, },
@ -165,7 +165,7 @@ pub fn data() -> &'static Vec<(PossessionType, PossessionData)> {
|target| |target|
format!( format!(
"The bandages soothe {}'s wounds", "The bandages soothe {}'s wounds",
target.display_for_sentence(true, 1, false), target.display_for_sentence(1, false),
) )
) )
}, },
@ -174,7 +174,7 @@ pub fn data() -> &'static Vec<(PossessionType, PossessionData)> {
messagef: Box::new(|_player, _item, target| messagef: Box::new(|_player, _item, target|
format!( format!(
"The bandages wrapping {} crumble and fall away, their healing capabilities fully expended.\n", "The bandages wrapping {} crumble and fall away, their healing capabilities fully expended.\n",
target.display_for_sentence(true, 1, false) target.display_for_sentence(1, false)
) )
) )
} }
@ -189,8 +189,8 @@ pub fn data() -> &'static Vec<(PossessionType, PossessionData)> {
} else if target.active_effects.iter().any(|e| e.0 == EffectType::Bandages) { } else if target.active_effects.iter().any(|e| e.0 == EffectType::Bandages) {
Some(format!( Some(format!(
"You see no reason to use {} on {}", "You see no reason to use {} on {}",
item.display_for_sentence(false, 1, false), item.display_for_sentence(1, false),
target.display_for_sentence(false, 1, false) target.display_for_sentence(1, false)
)) ))
} else { } else {
None None

View File

@ -18,19 +18,19 @@ pub fn data() -> &'static Vec<(PossessionType, PossessionData)> {
raw_max_to_learn: 2.0, raw_max_to_learn: 2.0,
normal_attack: WeaponAttackData { normal_attack: WeaponAttackData {
start_messages: vec!( start_messages: vec!(
Box::new(|attacker, victim, exp| Box::new(|attacker, victim|
format!("{} lines up {} antenna whip for a strike on {}", format!("{} lines up {} antenna whip for a strike on {}",
&attacker.display_for_sentence(exp, 1, true), &attacker.display_for_sentence(1, true),
&attacker.pronouns.possessive, &attacker.pronouns.possessive,
&victim.display_for_sentence(exp, 1, false), &victim.display_for_sentence(1, false),
) )
) )
), ),
success_messages: vec!( success_messages: vec!(
Box::new(|attacker, victim, part, exp| Box::new(|attacker, victim, part|
format!("{}'s antenna whip scores a painful red line across {}'s {}", format!("{}'s antenna whip scores a painful red line across {}'s {}",
&attacker.display_for_sentence(exp, 1, true), &attacker.display_for_sentence(1, true),
&victim.display_for_sentence(exp, 1, false), &victim.display_for_sentence(1, false),
&part.display(victim.sex.clone()) &part.display(victim.sex.clone())
) )
) )
@ -41,19 +41,19 @@ pub fn data() -> &'static Vec<(PossessionType, PossessionData)> {
}, },
power_attack: Some(WeaponAttackData { power_attack: Some(WeaponAttackData {
start_messages: vec!( start_messages: vec!(
Box::new(|attacker, victim, exp| Box::new(|attacker, victim|
format!("{} rears back {} antenna whip for a power attack on {}", format!("{} rears back {} antenna whip for a power attack on {}",
&attacker.display_for_sentence(exp, 1, true), &attacker.display_for_sentence(1, true),
&attacker.pronouns.possessive, &attacker.pronouns.possessive,
&victim.display_for_sentence(exp, 1, false), &victim.display_for_sentence(1, false),
) )
) )
), ),
success_messages: vec!( success_messages: vec!(
Box::new(|attacker, victim, part, exp| Box::new(|attacker, victim, part|
format!("{}'s antenna whip hits {}'s {} with great force", format!("{}'s antenna whip hits {}'s {} with great force",
&attacker.display_for_sentence(exp, 1, true), &attacker.display_for_sentence(1, true),
&victim.display_for_sentence(exp, 1, false), &victim.display_for_sentence(1, false),
&part.display(victim.sex.clone()) &part.display(victim.sex.clone())
) )
) )
@ -80,19 +80,19 @@ pub fn data() -> &'static Vec<(PossessionType, PossessionData)> {
raw_max_to_learn: 2.0, raw_max_to_learn: 2.0,
normal_attack: WeaponAttackData { normal_attack: WeaponAttackData {
start_messages: vec!( start_messages: vec!(
Box::new(|attacker, victim, exp| Box::new(|attacker, victim|
format!("{} lines up {} leather whip for a strike on {}", format!("{} lines up {} leather whip for a strike on {}",
&attacker.display_for_sentence(exp, 1, true), &attacker.display_for_sentence(1, true),
&attacker.pronouns.possessive, &attacker.pronouns.possessive,
&victim.display_for_sentence(exp, 1, false), &victim.display_for_sentence(1, false),
) )
) )
), ),
success_messages: vec!( success_messages: vec!(
Box::new(|attacker, victim, part, exp| Box::new(|attacker, victim, part|
format!("{}'s leather whip scores a painful red line across {}'s {}", format!("{}'s leather whip scores a painful red line across {}'s {}",
&attacker.display_for_sentence(exp, 1, true), &attacker.display_for_sentence(1, true),
&victim.display_for_sentence(exp, 1, false), &victim.display_for_sentence(1, false),
&part.display(victim.sex.clone()) &part.display(victim.sex.clone())
) )
) )
@ -106,19 +106,19 @@ pub fn data() -> &'static Vec<(PossessionType, PossessionData)> {
}, },
power_attack: Some(WeaponAttackData { power_attack: Some(WeaponAttackData {
start_messages: vec!( start_messages: vec!(
Box::new(|attacker, victim, exp| Box::new(|attacker, victim|
format!("{} rears back {} leather whip for a power strike on {}", format!("{} rears back {} leather whip for a power strike on {}",
&attacker.display_for_sentence(exp, 1, true), &attacker.display_for_sentence(1, true),
&attacker.pronouns.possessive, &attacker.pronouns.possessive,
&victim.display_for_sentence(exp, 1, false), &victim.display_for_sentence(1, false),
) )
) )
), ),
success_messages: vec!( success_messages: vec!(
Box::new(|attacker, victim, part, exp| Box::new(|attacker, victim, part|
format!("{}'s leather whip hits {}'s {} with great force", format!("{}'s leather whip hits {}'s {} with great force",
&attacker.display_for_sentence(exp, 1, true), &attacker.display_for_sentence(1, true),
&victim.display_for_sentence(exp, 1, false), &victim.display_for_sentence(1, false),
&part.display(victim.sex.clone()) &part.display(victim.sex.clone())
) )
) )