diff --git a/blastmud_game/src/message_handler/user_commands/allow.rs b/blastmud_game/src/message_handler/user_commands/allow.rs index 77e6806f..473bbe93 100644 --- a/blastmud_game/src/message_handler/user_commands/allow.rs +++ b/blastmud_game/src/message_handler/user_commands/allow.rs @@ -746,9 +746,9 @@ async fn handle_user_consent( }; 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, - &to_user_item.display_for_sentence(false, 1, false), + &to_user_item.display_for_sentence(1, false), &to_user_item.pronouns.possessive, &("from ".to_owned() + &source_player.item_code), &cmd.consent_type, @@ -953,7 +953,7 @@ async fn handle_corp_consent( "{} {} to fight{} against {} on behalf \ of {}, with result: {}\n" ), - &source_player.display_for_sentence(false, 1, true), + &source_player.display_for_sentence(1, true), action_str, &details_str, &to_corp.name, diff --git a/blastmud_game/src/message_handler/user_commands/c.rs b/blastmud_game/src/message_handler/user_commands/c.rs index 047e2f67..18345599 100644 --- a/blastmud_game/src/message_handler/user_commands/c.rs +++ b/blastmud_game/src/message_handler/user_commands/c.rs @@ -58,7 +58,7 @@ impl UserVerb for Verb { Some(&user.username), &format!( ansi!("{} (to {}): \"{}\"\n"), - &player.display_for_sentence(false, 1, true), + &player.display_for_sentence(1, true), &corp.name, &msg ), diff --git a/blastmud_game/src/message_handler/user_commands/close.rs b/blastmud_game/src/message_handler/user_commands/close.rs index 940431e7..1c3224e1 100644 --- a/blastmud_game/src/message_handler/user_commands/close.rs +++ b/blastmud_game/src/message_handler/user_commands/close.rs @@ -115,7 +115,7 @@ impl QueueCommandHandler for QueueHandler { None, &format!( "{} closes the door to the {}.\n", - &ctx.item.display_for_sentence(true, 1, true), + &ctx.item.display_for_sentence(1, true), dir ), ) diff --git a/blastmud_game/src/message_handler/user_commands/corp.rs b/blastmud_game/src/message_handler/user_commands/corp.rs index 83a34182..db02074c 100644 --- a/blastmud_game/src/message_handler/user_commands/corp.rs +++ b/blastmud_game/src/message_handler/user_commands/corp.rs @@ -109,7 +109,7 @@ async fn corp_invite(ctx: &mut VerbContext<'_>, remaining: &str) -> UResult<()> ctx.trans.queue_for_session(&their_sess, Some(&format!( ansi!("{} wants to hire you into {}! Type corp join {} to accept.{}\n"), - &player.display_for_sentence(true, 1, true), + &player.display_for_sentence(1, true), &corp.name, &corp.name, if new_mem.allow_combat { @@ -126,7 +126,7 @@ async fn corp_invite(ctx: &mut VerbContext<'_>, remaining: &str) -> UResult<()> &format!( "{} has invited {} to join {}!\n", user.username, - &target_user.display_for_sentence(false, 1, false), + &target_user.display_for_sentence(1, false), corp.name ), ) @@ -367,7 +367,7 @@ async fn corp_fire(ctx: &mut VerbContext<'_>, remaining: &str) -> UResult<()> { the workers as {} fires {} from {}.\n" ), user.username, - target_user.display_for_sentence(false, 1, false), + target_user.display_for_sentence(1, false), corp.name ), ) @@ -530,7 +530,7 @@ async fn corp_promote(ctx: &mut VerbContext<'_>, remaining: &str) -> UResult<()> &CorpCommType::Notice, None, &format!("Everyone looks up from their desk as {} changes {}'s job title in {} to {} ({}).\n", 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?; their_mem.job_title = title; diff --git a/blastmud_game/src/message_handler/user_commands/cut.rs b/blastmud_game/src/message_handler/user_commands/cut.rs index d810d1b1..0b00f06f 100644 --- a/blastmud_game/src/message_handler/user_commands/cut.rs +++ b/blastmud_game/src/message_handler/user_commands/cut.rs @@ -63,7 +63,7 @@ impl QueueCommandHandler for QueueHandler { if corpse.location != ctx.item.location { user_error(format!( "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?; @@ -98,9 +98,9 @@ impl QueueCommandHandler for QueueHandler { let msg = format!( "{} prepares to cut {} from {}\n", - &ctx.item.display_for_sentence(true, 1, true), + &ctx.item.display_for_sentence(1, true), &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?; Ok(time::Duration::from_secs(1)) @@ -133,7 +133,7 @@ impl QueueCommandHandler for QueueHandler { if corpse.location != ctx.item.location { user_error(format!( "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, &format!( "{} 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, - corpse.display_for_sentence(true, 1, false) + corpse.display_for_sentence(1, false) ), ) .await?; @@ -233,9 +233,9 @@ impl QueueCommandHandler for QueueHandler { None, &format!( "{} expertly cuts the {} from {}.\n", - &ctx.item.display_for_sentence(true, 1, true), + &ctx.item.display_for_sentence(1, true), possession_data.display, - corpse.display_for_sentence(true, 1, false) + corpse.display_for_sentence(1, false) ), ) .await?; diff --git a/blastmud_game/src/message_handler/user_commands/drink.rs b/blastmud_game/src/message_handler/user_commands/drink.rs index 29fa2d21..87444663 100644 --- a/blastmud_game/src/message_handler/user_commands/drink.rs +++ b/blastmud_game/src/message_handler/user_commands/drink.rs @@ -43,13 +43,13 @@ impl QueueCommandHandler for QueueHandler { if item.location != ctx.item.location && item.location != ctx.item.refstr() { user_error(format!( "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!( "{} prepares to drink from {}\n", - &ctx.item.display_for_sentence(true, 1, true), - &item.display_for_sentence(true, 1, false) + &ctx.item.display_for_sentence(1, true), + &item.display_for_sentence(1, false) ); broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; 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() { user_error(format!( "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 @@ -126,8 +126,8 @@ impl QueueCommandHandler for QueueHandler { let msg = format!( "{} drinks from {}\n", - &ctx.item.display_for_sentence(true, 1, true), - &item.display_for_sentence(true, 1, false) + &ctx.item.display_for_sentence(1, true), + &item.display_for_sentence(1, false) ); broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; diff --git a/blastmud_game/src/message_handler/user_commands/drop.rs b/blastmud_game/src/message_handler/user_commands/drop.rs index 387fd055..10b9a1cc 100644 --- a/blastmud_game/src/message_handler/user_commands/drop.rs +++ b/blastmud_game/src/message_handler/user_commands/drop.rs @@ -128,7 +128,7 @@ impl QueueCommandHandler for QueueHandler { if item.location != format!("{}/{}", &ctx.item.item_type, &ctx.item.item_code) { user_error(format!( "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 { @@ -138,8 +138,8 @@ impl QueueCommandHandler for QueueHandler { } let msg = format!( "{} prepares to drop {}\n", - &ctx.item.display_for_sentence(true, 1, true), - &item.display_for_sentence(true, 1, false) + &ctx.item.display_for_sentence(1, true), + &item.display_for_sentence(1, false) ); broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; 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) { user_error(format!( "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 { @@ -192,15 +192,15 @@ impl QueueCommandHandler for QueueHandler { { CapacityLevel::AboveItemLimit => user_error(format!( "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!( "{} drops {}\n", - &ctx.item.display_for_sentence(true, 1, true), - &item.display_for_sentence(true, 1, false) + &ctx.item.display_for_sentence(1, true), + &item.display_for_sentence(1, false) ); broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; let mut item_mut = (*item).clone(); diff --git a/blastmud_game/src/message_handler/user_commands/eat.rs b/blastmud_game/src/message_handler/user_commands/eat.rs index 5e8f3b8f..067e3e0b 100644 --- a/blastmud_game/src/message_handler/user_commands/eat.rs +++ b/blastmud_game/src/message_handler/user_commands/eat.rs @@ -41,13 +41,13 @@ impl QueueCommandHandler for QueueHandler { if item.location != format!("{}/{}", &ctx.item.item_type, &ctx.item.item_code) { user_error(format!( "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!( "{} prepares to eat {}\n", - &ctx.item.display_for_sentence(true, 1, true), - &item.display_for_sentence(true, 1, false) + &ctx.item.display_for_sentence(1, true), + &item.display_for_sentence(1, false) ); broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; 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) { user_error(format!( "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 { @@ -119,7 +119,7 @@ impl QueueCommandHandler for QueueHandler { let msg = format!( "{} {} {}\n", - &ctx.item.display_for_sentence(true, 1, true), + &ctx.item.display_for_sentence(1, true), &(if how_many_eaten == how_many_left { "polishes off".to_owned() } else { @@ -129,7 +129,7 @@ impl QueueCommandHandler for QueueHandler { 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?; diff --git a/blastmud_game/src/message_handler/user_commands/fill.rs b/blastmud_game/src/message_handler/user_commands/fill.rs index d22937ec..66b04e3d 100644 --- a/blastmud_game/src/message_handler/user_commands/fill.rs +++ b/blastmud_game/src/message_handler/user_commands/fill.rs @@ -51,21 +51,21 @@ impl QueueCommandHandler for QueueHandler { if to_item.location != ctx.item.location && to_item.location != ctx.item.refstr() { user_error(format!( "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() { user_error(format!( "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!( "{} prepares to fill {} from {}\n", - &ctx.item.display_for_sentence(true, 1, true), - &to_item.display_for_sentence(true, 1, false), - &from_item.display_for_sentence(true, 1, false), + &ctx.item.display_for_sentence(1, true), + &to_item.display_for_sentence(1, false), + &from_item.display_for_sentence(1, false), ); broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; 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() { user_error(format!( "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() { user_error(format!( "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() { None => user_error(format!( "{} appears to be empty.", - from_item.display_for_sentence(true, 1, true) + from_item.display_for_sentence(1, true) ))?, Some(v) => v, }; @@ -132,7 +132,7 @@ impl QueueCommandHandler for QueueHandler { if available_vol == 0 { user_error(format!( "{} 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!( "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, }; @@ -153,7 +153,7 @@ impl QueueCommandHandler for QueueHandler { user_error(format!( "You don't think putting {} into {} is a good idea.", 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 { user_error(format!( "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!( "{} fills {} from {}\n", - &ctx.item.display_for_sentence(true, 1, true), - &to_item.display_for_sentence(true, 1, false), - &from_item.display_for_sentence(true, 1, false), + &ctx.item.display_for_sentence(1, true), + &to_item.display_for_sentence(1, false), + &from_item.display_for_sentence(1, false), ); broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; diff --git a/blastmud_game/src/message_handler/user_commands/get.rs b/blastmud_game/src/message_handler/user_commands/get.rs index 073bf6d1..982e6f5f 100644 --- a/blastmud_game/src/message_handler/user_commands/get.rs +++ b/blastmud_game/src/message_handler/user_commands/get.rs @@ -38,13 +38,13 @@ impl QueueCommandHandler for QueueHandler { if item.location != ctx.item.location { user_error(format!( "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!( "{} fumbles around trying to pick up {}\n", - &ctx.item.display_for_sentence(true, 1, true), - &item.display_for_sentence(true, 1, false) + &ctx.item.display_for_sentence(1, true), + &item.display_for_sentence(1, false) ); broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; } @@ -62,8 +62,8 @@ impl QueueCommandHandler for QueueHandler { { user_error(format!( "You try to get something from {} but realise {} is no longer there", - container.display_for_sentence(true, 1, false), - container.display_for_sentence(true, 1, false), + container.display_for_sentence(1, false), + container.display_for_sentence(1, false), ))? } let item = ctx @@ -74,15 +74,15 @@ impl QueueCommandHandler for QueueHandler { if item.location != container.refstr() { user_error(format!( "You try to get {} but realise it is no longer in {}", - item.display_for_sentence(true, 1, false), - container.display_for_sentence(true, 1, false), + item.display_for_sentence(1, false), + container.display_for_sentence(1, false), ))? } let msg = format!( "{} fumbles around trying to get {} from {}.\n", - &ctx.item.display_for_sentence(true, 1, true), - &item.display_for_sentence(true, 1, false), - &container.display_for_sentence(true, 1, false) + &ctx.item.display_for_sentence(1, true), + &item.display_for_sentence(1, false), + &container.display_for_sentence(1, false) ); 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 { user_error(format!( "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!( "{} picks up {}\n", - &ctx.item.display_for_sentence(true, 1, true), - &item.display_for_sentence(true, 1, false) + &ctx.item.display_for_sentence(1, true), + &item.display_for_sentence(1, false) ); broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; (item, None) @@ -137,8 +137,8 @@ impl QueueCommandHandler for QueueHandler { { user_error(format!( "You try to get something from {} but realise {} is no longer there", - container.display_for_sentence(true, 1, false), - container.display_for_sentence(true, 1, false), + container.display_for_sentence(1, false), + container.display_for_sentence(1, false), ))? } let item = ctx @@ -149,15 +149,15 @@ impl QueueCommandHandler for QueueHandler { if item.location != container.refstr() { user_error(format!( "You try to get {} but realise it is no longer in {}", - item.display_for_sentence(true, 1, false), - container.display_for_sentence(true, 1, false), + item.display_for_sentence(1, false), + container.display_for_sentence(1, false), ))? } let msg = format!( "{} gets {} from {}.\n", - &ctx.item.display_for_sentence(true, 1, true), - &item.display_for_sentence(true, 1, false), - &container.display_for_sentence(true, 1, false) + &ctx.item.display_for_sentence(1, true), + &item.display_for_sentence(1, false), + &container.display_for_sentence(1, false) ); broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; (item, Some(container)) @@ -182,7 +182,7 @@ impl QueueCommandHandler for QueueHandler { } CapacityLevel::OverBurdened => user_error(format!( "Fuck! You can't get {} because it is too heavy!", - &item.display_for_sentence(true, 1, false) + &item.display_for_sentence(1, false) ))?, _ => (), } diff --git a/blastmud_game/src/message_handler/user_commands/improvise.rs b/blastmud_game/src/message_handler/user_commands/improvise.rs index f128e2c2..bc035734 100644 --- a/blastmud_game/src/message_handler/user_commands/improvise.rs +++ b/blastmud_game/src/message_handler/user_commands/improvise.rs @@ -65,9 +65,9 @@ impl QueueCommandHandler for WithQueueHandler { None, &format!( "{} 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, - &item.display_for_sentence(true, 1, false), + &item.display_for_sentence(1, false), ), ) .await?; @@ -110,7 +110,7 @@ impl QueueCommandHandler for WithQueueHandler { .ok_or_else(|| { UserError(format!( "You can't think of anything you could make with {}", - item.display_for_sentence(true, 1, false) + item.display_for_sentence(1, false) )) })? .iter() @@ -122,7 +122,7 @@ impl QueueCommandHandler for WithQueueHandler { .ok_or_else(|| { UserError(format!( "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 { @@ -133,7 +133,7 @@ impl QueueCommandHandler for WithQueueHandler { "You think you could make {} {} from {}\n", indefinite_article(result_data.display), result_data.display, - item.display_for_sentence(true, 1, false) + item.display_for_sentence(1, false) )), ) .await?; @@ -242,8 +242,8 @@ impl QueueCommandHandler for FromQueueHandler { None, &format!( "{} proudly holds up the {} {} just made.\n", - &ctx.item.display_for_sentence(true, 1, true), - &new_item.display_for_sentence(true, 1, false), + &ctx.item.display_for_sentence(1, true), + &new_item.display_for_sentence(1, false), &ctx.item.pronouns.subject ), ) @@ -283,7 +283,7 @@ impl QueueCommandHandler for FromQueueHandler { ) { user_error(format!( "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( @@ -305,7 +305,7 @@ impl QueueCommandHandler for FromQueueHandler { &sess, Some(&format!( "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?; @@ -318,7 +318,7 @@ impl QueueCommandHandler for FromQueueHandler { &sess, Some(&format!( "You try and fail at adding {}.\n", - &item.display_for_sentence(true, 1, false) + &item.display_for_sentence(1, false) )), ) .await?; @@ -330,7 +330,7 @@ impl QueueCommandHandler for FromQueueHandler { &sess, Some(&format!( "You try adding {}.\n", - &item.display_for_sentence(true, 1, false), + &item.display_for_sentence(1, false), )), ) .await?; diff --git a/blastmud_game/src/message_handler/user_commands/inventory.rs b/blastmud_game/src/message_handler/user_commands/inventory.rs index 072658ba..d9c57285 100644 --- a/blastmud_game/src/message_handler/user_commands/inventory.rs +++ b/blastmud_game/src/message_handler/user_commands/inventory.rs @@ -34,7 +34,7 @@ impl UserVerb for Verb { .await?; let all_groups: Vec>> = inv .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() .map(|(_, g)| g.collect::>>()) .collect::>>>(); @@ -49,7 +49,7 @@ impl UserVerb for Verb { total += it_total; response.push_str(&format!( "{} [{}]{}\n", - item.display_for_sentence(true, items.len(), true), + item.display_for_sentence(items.len(), true), weight(it_total), match item.action_type { LocationActionType::Worn => " (worn)", diff --git a/blastmud_game/src/message_handler/user_commands/load.rs b/blastmud_game/src/message_handler/user_commands/load.rs index 7de1e332..ab4e9751 100644 --- a/blastmud_game/src/message_handler/user_commands/load.rs +++ b/blastmud_game/src/message_handler/user_commands/load.rs @@ -107,9 +107,9 @@ impl UserVerb for Verb { None, &format!( "{} {}s {} {} {}\n", - &npc.display_for_sentence(true, 1, true), + &npc.display_for_sentence(1, true), verb, - &item.display_for_sentence(true, 1, false), + &item.display_for_sentence(1, false), sep, &npc.pronouns.intensive ), diff --git a/blastmud_game/src/message_handler/user_commands/look.rs b/blastmud_game/src/message_handler/user_commands/look.rs index 72450f10..aa4de682 100644 --- a/blastmud_game/src/message_handler/user_commands/look.rs +++ b/blastmud_game/src/message_handler/user_commands/look.rs @@ -51,7 +51,7 @@ pub async fn describe_normal_item( let all_groups: Vec>> = items .iter() .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() .map(|(_, g)| g.collect::>>()) .collect::>>>(); @@ -66,7 +66,7 @@ pub async fn describe_normal_item( let mut phrases = Vec::::new(); for group_items in all_groups { 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 { LocationActionType::Wielded => details.push_str(" (wielded)"), LocationActionType::Worn => continue, @@ -487,7 +487,7 @@ async fn list_room_contents<'l>(ctx: &'l VerbContext<'_>, item: &'l Item) -> URe .filter(|i| { 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() .map(|(_, g)| g.collect::>>()) .collect::>>>(); @@ -496,7 +496,7 @@ async fn list_room_contents<'l>(ctx: &'l VerbContext<'_>, item: &'l Item) -> URe let head = &group_items[0]; let is_creature = head.item_type == "player" || head.item_type.starts_with("npc"); 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 { " are " } else { diff --git a/blastmud_game/src/message_handler/user_commands/make.rs b/blastmud_game/src/message_handler/user_commands/make.rs index 5b9cedfe..7a7af84b 100644 --- a/blastmud_game/src/message_handler/user_commands/make.rs +++ b/blastmud_game/src/message_handler/user_commands/make.rs @@ -100,16 +100,13 @@ impl QueueCommandHandler for QueueHandler { let mut msg = format!( "{} 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 { None => {} Some(bench) => { - msg.push_str(&format!( - " on {}", - bench.display_for_sentence(true, 1, false) - )); + msg.push_str(&format!(" on {}", bench.display_for_sentence(1, false))); } } msg.push_str(".\n"); @@ -185,7 +182,7 @@ impl QueueCommandHandler for QueueHandler { let on_what = match bench_opt { 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) @@ -217,10 +214,6 @@ impl QueueCommandHandler for QueueHandler { } else { None }; - let explicit = session - .as_ref() - .map(|s| !s.1.less_explicit_mode) - .unwrap_or(false); match ingredients_left.iter().next() { None => { @@ -237,8 +230,8 @@ impl QueueCommandHandler for QueueHandler { None, &format!( "{} makes a {}{}.\n", - &ctx.item.display_for_sentence(true, 1, true), - &new_item.display_for_sentence(true, 1, false), + &ctx.item.display_for_sentence(1, true), + &new_item.display_for_sentence(1, false), &on_what ), ) @@ -261,14 +254,7 @@ impl QueueCommandHandler for QueueHandler { })?; match addable.iter().next() { - None => user_error(format!( - "You realise you'd need {}.", - if explicit { - pd.display - } else { - pd.display_less_explicit.unwrap_or(pd.display) - } - ))?, + None => user_error(format!("You realise you'd need {}.", pd.display))?, Some(item) => { let skill_result = skill_check_and_grind( &ctx.trans, @@ -290,7 +276,7 @@ impl QueueCommandHandler for QueueHandler { &sess, Some(&format!( "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?; @@ -303,7 +289,7 @@ impl QueueCommandHandler for QueueHandler { &sess, Some(&format!( "You try and fail at adding {}.\n", - &item.display_for_sentence(explicit, 1, false) + &item.display_for_sentence(1, false) )), ) .await?; @@ -315,7 +301,7 @@ impl QueueCommandHandler for QueueHandler { &sess, Some(&format!( "You try adding {}.\n", - &item.display_for_sentence(explicit, 1, false), + &item.display_for_sentence(1, false), )), ) .await?; diff --git a/blastmud_game/src/message_handler/user_commands/map.rs b/blastmud_game/src/message_handler/user_commands/map.rs index d07c2371..ad0406ff 100644 --- a/blastmud_game/src/message_handler/user_commands/map.rs +++ b/blastmud_game/src/message_handler/user_commands/map.rs @@ -450,9 +450,7 @@ impl MapType for LmapType { None => None, Some((ex_t, ex_c)) => { match ctx.trans.find_item_by_type_code(ex_t, ex_c).await?.as_ref() { - Some(dest_item) => { - Some(dest_item.display_for_sentence(true, 1, true)) - } + Some(dest_item) => Some(dest_item.display_for_sentence(1, true)), None => None, } } diff --git a/blastmud_game/src/message_handler/user_commands/movement.rs b/blastmud_game/src/message_handler/user_commands/movement.rs index 53e1d5dc..cc969915 100644 --- a/blastmud_game/src/message_handler/user_commands/movement.rs +++ b/blastmud_game/src/message_handler/user_commands/movement.rs @@ -51,7 +51,7 @@ pub async fn announce_move( ) -> DResult<()> { let msg_leaving = format!( "{} departs towards {}\n", - &character.display_for_sentence(true, 1, true), + &character.display_for_sentence(1, true), &arriving.display ); broadcast_to_room( @@ -64,7 +64,7 @@ pub async fn announce_move( let msg_arriving = format!( "{} arrives from {}\n", - &character.display_for_sentence(true, 1, true), + &character.display_for_sentence(1, true), &leaving.display ); broadcast_to_room( @@ -461,7 +461,7 @@ async fn attempt_move_immediate( let descriptor = handle_fall(&ctx.trans, ctx.item, fall_dist).await?; let msg = format!( "{} 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, fall_dist, &descriptor @@ -543,7 +543,7 @@ async fn attempt_move_immediate( } else { let msg = format!( "{} 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" }) ); broadcast_to_room(&ctx.trans, &use_location, None, &msg).await?; diff --git a/blastmud_game/src/message_handler/user_commands/open.rs b/blastmud_game/src/message_handler/user_commands/open.rs index 7bd4dcca..29aaded6 100644 --- a/blastmud_game/src/message_handler/user_commands/open.rs +++ b/blastmud_game/src/message_handler/user_commands/open.rs @@ -179,7 +179,7 @@ pub async fn attempt_open_immediate( None, &format!( "{} opens the door to the {}.\n", - &ctx.item.display_for_sentence(true, 1, true), + &ctx.item.display_for_sentence(1, true), dir ), ) diff --git a/blastmud_game/src/message_handler/user_commands/put.rs b/blastmud_game/src/message_handler/user_commands/put.rs index 956b8aa7..b6c579ab 100644 --- a/blastmud_game/src/message_handler/user_commands/put.rs +++ b/blastmud_game/src/message_handler/user_commands/put.rs @@ -42,8 +42,8 @@ impl QueueCommandHandler for QueueHandler { if container.location != ctx.item.location && container.location != ctx.item.refstr() { user_error(format!( "You try to put something in {} but realise {} is no longer there", - container.display_for_sentence(true, 1, false), - container.display_for_sentence(true, 1, false), + container.display_for_sentence(1, false), + container.display_for_sentence(1, false), ))? } let item = ctx @@ -54,15 +54,15 @@ impl QueueCommandHandler for QueueHandler { if item.location != ctx.item.refstr() { user_error(format!( "You try to put {} in {}, but realise you no longer have it", - item.display_for_sentence(true, 1, false), - container.display_for_sentence(true, 1, false), + item.display_for_sentence(1, false), + container.display_for_sentence(1, false), ))? } let msg = format!( "{} fumbles around trying to put {} in {}.\n", - &ctx.item.display_for_sentence(true, 1, true), - &item.display_for_sentence(true, 1, false), - &container.display_for_sentence(true, 1, false) + &ctx.item.display_for_sentence(1, true), + &item.display_for_sentence(1, false), + &container.display_for_sentence(1, false) ); broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; 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() { user_error(format!( "You try to put something in {} but realise {} is no longer there", - container.display_for_sentence(true, 1, false), - container.display_for_sentence(true, 1, false), + container.display_for_sentence(1, false), + container.display_for_sentence(1, false), ))? } let item = ctx @@ -103,8 +103,8 @@ impl QueueCommandHandler for QueueHandler { if item.location != ctx.item.refstr() { user_error(format!( "You try to put {} in {}, but realise you no longer have it", - item.display_for_sentence(true, 1, false), - container.display_for_sentence(true, 1, false), + item.display_for_sentence(1, false), + container.display_for_sentence(1, false), ))? } @@ -119,17 +119,17 @@ impl QueueCommandHandler for QueueHandler { .ok_or_else(|| { UserError(format!( "You try to put {} in {}, but can't find out a way to get anything in it", - item.display_for_sentence(true, 1, false), - container.display_for_sentence(true, 1, false), + item.display_for_sentence(1, false), + container.display_for_sentence(1, false), )) })?; container_data.checker.check_place(&container, &item)?; let msg = format!( "{} puts {} in {}.\n", - &ctx.item.display_for_sentence(true, 1, true), - &item.display_for_sentence(true, 1, false), - &container.display_for_sentence(true, 1, false) + &ctx.item.display_for_sentence(1, true), + &item.display_for_sentence(1, false), + &container.display_for_sentence(1, false) ); 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? { CapacityLevel::AboveItemLimit => user_error(format!( "{} 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!( "{} You can't place {} because it is too heavy!", if true { "Fuck!" } else { "Rats!" }, - &ctx.item.display_for_sentence(true, 1, false) + &ctx.item.display_for_sentence(1, false) ))?, _ => (), } diff --git a/blastmud_game/src/message_handler/user_commands/recline.rs b/blastmud_game/src/message_handler/user_commands/recline.rs index 51e003d1..a422745d 100644 --- a/blastmud_game/src/message_handler/user_commands/recline.rs +++ b/blastmud_game/src/message_handler/user_commands/recline.rs @@ -64,7 +64,7 @@ impl QueueCommandHandler for QueueHandler { if item.location != ctx.item.location { user_error(format!( "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 { user_error(format!( "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(true, 1, false), - ) + (Some(item.clone()), item.display_for_sentence(1, false)) } } } }; let msg = format!( "{} reclines on {}.\n", - &ctx.item.display_for_sentence(true, 1, true), + &ctx.item.display_for_sentence(1, true), &desc ); broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; diff --git a/blastmud_game/src/message_handler/user_commands/remove.rs b/blastmud_game/src/message_handler/user_commands/remove.rs index c9d1dbed..27192652 100644 --- a/blastmud_game/src/message_handler/user_commands/remove.rs +++ b/blastmud_game/src/message_handler/user_commands/remove.rs @@ -17,7 +17,7 @@ async fn check_removeable(ctx: &mut QueuedCommandContext<'_>, item: &Item) -> UR if item.location != ctx.item.refstr() { user_error(format!( "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!( "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()) ))?; } @@ -103,8 +103,8 @@ impl QueueCommandHandler for QueueHandler { let msg = format!( "{} fumbles around trying to take off {}\n", - &ctx.item.display_for_sentence(true, 1, true), - &item.display_for_sentence(true, 1, false) + &ctx.item.display_for_sentence(1, true), + &item.display_for_sentence(1, false) ); broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; Ok(time::Duration::from_secs(1)) @@ -134,8 +134,8 @@ impl QueueCommandHandler for QueueHandler { let msg = format!( "{} removes {}\n", - &ctx.item.display_for_sentence(true, 1, true), - &item.display_for_sentence(true, 1, false) + &ctx.item.display_for_sentence(1, true), + &item.display_for_sentence(1, false) ); broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; let mut item_mut = (*item).clone(); diff --git a/blastmud_game/src/message_handler/user_commands/say.rs b/blastmud_game/src/message_handler/user_commands/say.rs index c990c75f..8d9c504e 100644 --- a/blastmud_game/src/message_handler/user_commands/say.rs +++ b/blastmud_game/src/message_handler/user_commands/say.rs @@ -39,7 +39,7 @@ pub async fn say_to_room<'l>( let msg = format!( ansi!("{} says: \"{}\"\n"), - from_item.display_for_sentence(true, 1, true), + from_item.display_for_sentence(1, true), say_what ); diff --git a/blastmud_game/src/message_handler/user_commands/scavenge.rs b/blastmud_game/src/message_handler/user_commands/scavenge.rs index 8405bb88..bb1ab1c8 100644 --- a/blastmud_game/src/message_handler/user_commands/scavenge.rs +++ b/blastmud_game/src/message_handler/user_commands/scavenge.rs @@ -32,7 +32,7 @@ impl QueueCommandHandler for QueueHandler { None, &format!( ansi!("{} starts methodically searching the area.\n"), - ctx.item.display_for_sentence(true, 1, true), + ctx.item.display_for_sentence(1, true), ), ) .await?; @@ -90,8 +90,8 @@ impl QueueCommandHandler for QueueHandler { &ctx.item.location, None, &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), - found.display_for_sentence(true, 1, false), + ctx.item.display_for_sentence(1, true), + found.display_for_sentence(1, false), ), ).await?; } @@ -102,8 +102,8 @@ impl QueueCommandHandler for QueueHandler { None, &format!( "{} seems to have found {}.\n", - ctx.item.display_for_sentence(true, 1, true), - found.display_for_sentence(true, 1, false), + ctx.item.display_for_sentence(1, true), + found.display_for_sentence(1, false), ), ) .await?; diff --git a/blastmud_game/src/message_handler/user_commands/sit.rs b/blastmud_game/src/message_handler/user_commands/sit.rs index 844ac332..5075e89c 100644 --- a/blastmud_game/src/message_handler/user_commands/sit.rs +++ b/blastmud_game/src/message_handler/user_commands/sit.rs @@ -60,7 +60,7 @@ impl QueueCommandHandler for QueueHandler { if item.location != ctx.item.location { user_error(format!( "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 { user_error(format!( "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(true, 1, false), - ) + (Some(item.clone()), item.display_for_sentence(1, false)) } } } }; let msg = format!( "{} sits on {}.\n", - &ctx.item.display_for_sentence(true, 1, true), + &ctx.item.display_for_sentence(1, true), &desc ); broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; diff --git a/blastmud_game/src/message_handler/user_commands/stand.rs b/blastmud_game/src/message_handler/user_commands/stand.rs index 49a648ee..a1b9cdbb 100644 --- a/blastmud_game/src/message_handler/user_commands/stand.rs +++ b/blastmud_game/src/message_handler/user_commands/stand.rs @@ -17,7 +17,7 @@ pub async fn stand_if_needed(trans: &DBTrans, who: &mut Item) -> UResult<()> { LocationActionType::Sitting { .. } | LocationActionType::Reclining { .. } => {} _ => 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?; who.action_type = LocationActionType::Normal; diff --git a/blastmud_game/src/message_handler/user_commands/use_cmd.rs b/blastmud_game/src/message_handler/user_commands/use_cmd.rs index 3f668d08..78e978a3 100644 --- a/blastmud_game/src/message_handler/user_commands/use_cmd.rs +++ b/blastmud_game/src/message_handler/user_commands/use_cmd.rs @@ -44,7 +44,7 @@ impl QueueCommandHandler for QueueHandler { if item.location != format!("player/{}", ctx.item.item_code) { user_error(format!( "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("/") { @@ -71,23 +71,23 @@ impl QueueCommandHandler for QueueHandler { && target.location != ctx.item.location && 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!( "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 ))? } let msg = format!( "{} prepares to use {} {} on {}\n", - &ctx.item.display_for_sentence(true, 1, true), + &ctx.item.display_for_sentence(1, true), &ctx.item.pronouns.possessive, - &item.display_for_sentence(true, 0, false), + &item.display_for_sentence(0, false), &if is_self_use { ctx.item.pronouns.intensive.clone() } 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?; @@ -142,7 +142,7 @@ impl QueueCommandHandler for QueueHandler { if item.location != format!("player/{}", ctx.item.item_code) { user_error(format!( "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("/") { @@ -160,10 +160,10 @@ impl QueueCommandHandler for QueueHandler { if target.location != ctx.item.location && 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!( "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 ))? @@ -181,7 +181,7 @@ impl QueueCommandHandler for QueueHandler { if !check_consent(ctx.trans, "use", consent_type, &ctx.item, &target).await? { user_error(format!( "{} doesn't allow {} from you", - &target.display_for_sentence(true, 1, true), + &target.display_for_sentence(1, true), consent_type.to_str() ))? } @@ -195,7 +195,7 @@ impl QueueCommandHandler for QueueHandler { if item.charges < 1 { user_error(format!( "{} has no {} {} left", - item.display_for_sentence(true, 1, true), + item.display_for_sentence(1, true), &language::pluralise(charge_data.charge_name_prefix), charge_data.charge_name_suffix ))?; diff --git a/blastmud_game/src/message_handler/user_commands/vacate.rs b/blastmud_game/src/message_handler/user_commands/vacate.rs index 96b3caab..2b366039 100644 --- a/blastmud_game/src/message_handler/user_commands/vacate.rs +++ b/blastmud_game/src/message_handler/user_commands/vacate.rs @@ -124,7 +124,7 @@ impl UserVerb for Verb { &format!( ansi!("[{}] {} 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.\"\n"), &corptup.1.name, - &player_item.display_for_sentence(true, 1, false), + &player_item.display_for_sentence(1, false), &ex_zone.display ) ).await? diff --git a/blastmud_game/src/message_handler/user_commands/wear.rs b/blastmud_game/src/message_handler/user_commands/wear.rs index 7031ee67..f5192062 100644 --- a/blastmud_game/src/message_handler/user_commands/wear.rs +++ b/blastmud_game/src/message_handler/user_commands/wear.rs @@ -38,7 +38,7 @@ impl QueueCommandHandler for QueueHandler { if item.location != ctx.item.refstr() { user_error(format!( "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!( "{} fumbles around trying to put on {}\n", - &ctx.item.display_for_sentence(true, 1, true), - &item.display_for_sentence(true, 1, false) + &ctx.item.display_for_sentence(1, true), + &item.display_for_sentence(1, false) ); broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; Ok(time::Duration::from_secs(1)) @@ -90,7 +90,7 @@ impl QueueCommandHandler for QueueHandler { if item.location != ctx.item.refstr() { user_error(format!( "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!( "{} wears {}\n", - &ctx.item.display_for_sentence(true, 1, true), - &item.display_for_sentence(true, 1, false) + &ctx.item.display_for_sentence(1, true), + &item.display_for_sentence(1, false) ); broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; let mut item_mut = (*item).clone(); diff --git a/blastmud_game/src/message_handler/user_commands/wield.rs b/blastmud_game/src/message_handler/user_commands/wield.rs index 08cb938b..e6a8e160 100644 --- a/blastmud_game/src/message_handler/user_commands/wield.rs +++ b/blastmud_game/src/message_handler/user_commands/wield.rs @@ -39,9 +39,9 @@ impl QueueCommandHandler for QueueHandler { } let msg = format!( "{} fumbles around with {} {}\n", - &ctx.item.display_for_sentence(true, 1, true), + &ctx.item.display_for_sentence(1, true), &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?; let mut draw_level: f64 = ctx @@ -94,8 +94,8 @@ impl QueueCommandHandler for QueueHandler { } let msg = format!( "{} wields {}\n", - &ctx.item.display_for_sentence(true, 1, true), - &item.display_for_sentence(true, 1, false) + &ctx.item.display_for_sentence(1, true), + &item.display_for_sentence(1, false) ); broadcast_to_room(ctx.trans, &ctx.item.location, None, &msg).await?; ctx.trans diff --git a/blastmud_game/src/models/item.rs b/blastmud_game/src/models/item.rs index 4d55241d..3710b2e6 100644 --- a/blastmud_game/src/models/item.rs +++ b/blastmud_game/src/models/item.rs @@ -703,7 +703,7 @@ pub struct 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(); if self.death_data.is_some() { if pluralise > 1 { @@ -712,11 +712,7 @@ impl Item { buf.push_str("the body of "); } } - let singular = if explicit_ok { - &self.display - } else { - self.display_less_explicit.as_ref().unwrap_or(&self.display) - }; + let singular = &self.display; if !self.pronouns.is_proper && pluralise == 1 { buf.push_str(language::indefinite_article(&singular)); buf.push(' '); @@ -737,7 +733,7 @@ impl Item { } } 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> { diff --git a/blastmud_game/src/services/combat.rs b/blastmud_game/src/services/combat.rs index 50c6286b..10f388ac 100644 --- a/blastmud_game/src/services/combat.rs +++ b/blastmud_game/src/services/combat.rs @@ -140,7 +140,7 @@ async fn start_next_attack( ) -> DResult<()> { let msg = &(weapon .normal_attack - .start_message(&attacker_item, victim_item, true) + .start_message(&attacker_item, victim_item) + ".\n"); broadcast_to_room(ctx.trans, &attacker_item.location, None, msg).await?; Ok(()) @@ -163,9 +163,9 @@ async fn process_attack( { let msg = format!( "{} 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, - 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?; @@ -218,8 +218,8 @@ async fn process_attack( if dodge_result > attack_result { let msg = format!( "{} dodges out of the way of {}'s attack.\n", - victim_item.display_for_sentence(true, 1, true), - attacker_item.display_for_sentence(true, 1, false) + victim_item.display_for_sentence(1, true), + attacker_item.display_for_sentence(1, false) ); broadcast_to_room(ctx.trans, &attacker_item.location, None, &msg).await?; match attacker_item.active_combat.as_mut() { @@ -262,12 +262,12 @@ async fn process_attack( &part, ) .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 { let msg = format!( "{}'s attack bounces off {}'s {}.\n", - &attacker_item.display_for_sentence(true, 1, true), - &victim_item.display_for_sentence(true, 1, false), + &attacker_item.display_for_sentence(1, true), + &victim_item.display_for_sentence(1, false), &part.display(victim_item.sex.clone()) ); broadcast_to_room(&ctx.trans, &victim_item.location, None, &msg).await?; @@ -319,9 +319,9 @@ async fn process_feint( { let msg = format!( "{} 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, - 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?; match attacker_item.active_combat.as_mut() { @@ -351,7 +351,7 @@ async fn process_feint( None, &format!( "{} 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.intensive, ), @@ -380,8 +380,8 @@ async fn process_feint( None, &format!( "{} is confused by {}'s antics!\n", - &victim_item.display_for_sentence(true, 1, true), - &attacker_item.display_for_sentence(true, 1, false), + &victim_item.display_for_sentence(1, true), + &attacker_item.display_for_sentence(1, false), ), ) .await?; @@ -403,8 +403,8 @@ async fn process_feint( None, &format!( "{} doesn't seem to have fallen for {}'s unenlightened attempt at a feint.\n", - &victim_item.display_for_sentence(true, 1, true), - &attacker_item.display_for_sentence(true, 1, false) + &victim_item.display_for_sentence(1, true), + &attacker_item.display_for_sentence(1, false) ), ) .await?; @@ -606,7 +606,7 @@ pub async fn consider_reward_for( bonus.payment, actual_tax, corp.name, - &for_item_sim_notdead.display_for_sentence(true, 1, false) + &for_item_sim_notdead.display_for_sentence(1, false) ), ) .await?; @@ -649,7 +649,7 @@ pub async fn consider_reward_for( pub async fn handle_death(trans: &DBTrans, whom: &mut Item) -> DResult<()> { let msg = format!( ansi!("{} stiffens and collapses dead.\n"), - &whom.display_for_sentence(true, 1, true) + &whom.display_for_sentence(1, true) ); broadcast_to_room(trans, &whom.location, None, &msg).await?; @@ -942,13 +942,13 @@ pub async fn start_attack_mut( msg.push_str(&format!( ansi!("{} {} {}.\n"), - &by_whom.display_for_sentence(true, 1, true), + &by_whom.display_for_sentence(1, true), 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?; - 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?; @@ -1017,7 +1017,7 @@ pub async fn switch_to_power_attack(ctx: &VerbContext<'_>, who: &Arc) -> U let pow_att = match wielded.power_attack.as_ref() { None => user_error(format!( "{} is unsuitable for powerattacking", - wield_it.display_for_sentence(true, 1, true) + wield_it.display_for_sentence(1, true) ))?, Some(v) => v, }; @@ -1053,7 +1053,7 @@ pub async fn switch_to_power_attack(ctx: &VerbContext<'_>, who: &Arc) -> U None => user_error("They seem to be gone!".to_owned())?, 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?; let mut who_mut = (**who).clone(); @@ -1148,8 +1148,8 @@ pub async fn switch_to_feint(ctx: &VerbContext<'_>, who: &Arc) -> UResult< ]; let feint = feints.iter().choose(&mut thread_rng()).unwrap(); let msg = feint( - &who.display_for_sentence(true, 1, true), - &to_whom.display_for_sentence(true, 1, false), + &who.display_for_sentence(1, true), + &to_whom.display_for_sentence(1, false), ); broadcast_to_room(ctx.trans, &who.location, None, &msg).await?; @@ -1225,7 +1225,7 @@ impl TaskHandler for RotCorpseTaskHandler { let msg = format!( "{} 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?; Ok(None) diff --git a/blastmud_game/src/services/effect.rs b/blastmud_game/src/services/effect.rs index 152b5825..5acefb47 100644 --- a/blastmud_game/src/services/effect.rs +++ b/blastmud_game/src/services/effect.rs @@ -351,7 +351,7 @@ pub fn default_effects_for_type() -> &'static BTreeMap { delay_secs: 0, messagef: Box::new(|_player, _item, target| format!(ansi!("You notice that {} has a fresh gaping wound that looks like it's about to {}!\n"), - target.display_for_sentence(true, 1, false), + target.display_for_sentence(1, false), if target.species == SpeciesType::Robot { "leak coolant" } else { "bleed" } ) ) @@ -364,7 +364,7 @@ pub fn default_effects_for_type() -> &'static BTreeMap { message: Box::new(|target| format!("{} pulses from {}'s wound", 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 { message: Box::new(|target| format!("{} pulses from {}'s wound", 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 { message: Box::new(|target| format!("{} pulses from {}'s wound", 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 { message: Box::new(|target| format!("{} pulses from {}'s wound", 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 { message: Box::new(|target| format!("{} pulses from {}'s wound", 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 { message: Box::new(|target| format!("A final tiny drop of {} oozes from {}'s wound as it heals", 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 { delay_secs: 0, messagef: Box::new(|_player, _item, target| format!(ansi!("{} is stunned!\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 { delay_secs: 30, messagef: Box::new(|_player, _item, target| format!(ansi!("{} seems to have returned to {} senses!\n"), - target.display_for_sentence(true, 1, true), + target.display_for_sentence(1, true), &target.pronouns.object, ) ) diff --git a/blastmud_game/src/services/sharing.rs b/blastmud_game/src/services/sharing.rs index fc87666a..eda9128a 100644 --- a/blastmud_game/src/services/sharing.rs +++ b/blastmud_game/src/services/sharing.rs @@ -96,7 +96,7 @@ impl TaskHandler for ShareTaskHandler { let act = (&vec![ "mocks the existence of a self-styled king".to_owned(), 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) ]).choose(&mut rand::thread_rng()).unwrap().clone(); let reaction = (&vec![ @@ -111,10 +111,10 @@ impl TaskHandler for ShareTaskHandler { .clone(); format!( "{} {}{} and {} {}", - pa.display_for_sentence(false, 1, true), + pa.display_for_sentence(1, true), intensity_word, &act, - &pb.display_for_sentence(false, 1, false), + &pb.display_for_sentence(1, false), &reaction, ) } @@ -137,10 +137,10 @@ impl TaskHandler for ShareTaskHandler { .unwrap(); format!( "{} {}{} and {} {}", - pa.display_for_sentence(false, 1, true), + pa.display_for_sentence(1, true), intensity_word, &act, - &pb.display_for_sentence(false, 1, false), + &pb.display_for_sentence(1, false), &reaction, ) } @@ -155,10 +155,10 @@ impl TaskHandler for ShareTaskHandler { .unwrap(); format!( "{} {}{} and {} listens attentively", - pa.display_for_sentence(false, 1, true), + pa.display_for_sentence(1, true), intensity_word, &thought, - &pb.display_for_sentence(false, 1, false), + &pb.display_for_sentence(1, false), ) } ConversationTopic::ThoughtsOnMachiavelli => { @@ -172,10 +172,10 @@ impl TaskHandler for ShareTaskHandler { .unwrap(); format!( "{} {}{} and {} nods in agreement", - pa.display_for_sentence(false, 1, true), + pa.display_for_sentence(1, true), intensity_word, &thought, - &pb.display_for_sentence(false, 1, false), + &pb.display_for_sentence(1, false), ) } ConversationTopic::ExploringRuins => { @@ -189,10 +189,10 @@ impl TaskHandler for ShareTaskHandler { .unwrap(); format!( "{} {}{} and {} listens intently", - pa.display_for_sentence(false, 1, true), + pa.display_for_sentence(1, true), intensity_word, &exploration, - &pb.display_for_sentence(false, 1, false), + &pb.display_for_sentence(1, false), ) } ConversationTopic::RoamingEnemies => { @@ -206,10 +206,10 @@ impl TaskHandler for ShareTaskHandler { .unwrap(); format!( "{} {}{} and {} nods with newfound caution", - pa.display_for_sentence(false, 1, true), + pa.display_for_sentence(1, true), intensity_word, &enemy_tales, - &pb.display_for_sentence(false, 1, false), + &pb.display_for_sentence(1, false), ) } ConversationTopic::FishingSpots => { @@ -223,10 +223,10 @@ impl TaskHandler for ShareTaskHandler { .unwrap(); format!( "{} {}{} and {} expresses interest", - pa.display_for_sentence(false, 1, true), + pa.display_for_sentence(1, true), intensity_word, &fishing_info, - &pb.display_for_sentence(false, 1, false), + &pb.display_for_sentence(1, false), ) } ConversationTopic::GoodAmbushSpots => { @@ -240,10 +240,10 @@ impl TaskHandler for ShareTaskHandler { .unwrap(); format!( "{} {}{} and {} listens with a thoughtful expression", - pa.display_for_sentence(false, 1, true), + pa.display_for_sentence(1, true), intensity_word, &ambush_strategy, - &pb.display_for_sentence(false, 1, false), + &pb.display_for_sentence(1, false), ) } ConversationTopic::SurvivingWeather => { @@ -257,10 +257,10 @@ impl TaskHandler for ShareTaskHandler { .unwrap(); format!( "{} {}{} and {} nods appreciatively", - pa.display_for_sentence(false, 1, true), + pa.display_for_sentence(1, true), intensity_word, &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", (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 { 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? .ok_or_else(|| { 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 )) })?; @@ -577,7 +577,7 @@ pub async fn start_conversation( allow share from {} before their \ character will consent to knowledge sharing]" ), - &acceptor.display_for_sentence(true, 1, false), + &acceptor.display_for_sentence(1, false), &acceptor.pronouns.subject, initiator.display_for_session(&other_sessdat) )) @@ -586,7 +586,7 @@ pub async fn start_conversation( if !acceptor.flags.contains(&ItemFlag::AllowShare) { user_error(format!( "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 ))?; } @@ -617,14 +617,14 @@ pub async fn start_conversation( { user_error(format!( "{} 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() { user_error(format!( "{} 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, &format!( ansi!("{} proposes to share knowledge with {}, and {} accepts!\n"), - &initiator.display_for_sentence(true, 1, true), - &acceptor.display_for_sentence(false, 1, true), + &initiator.display_for_sentence(1, true), + &acceptor.display_for_sentence(1, true), &acceptor.pronouns.subject ), ) @@ -703,9 +703,9 @@ pub async fn stop_conversation_mut( None, &format!( ansi!("{} {} {}.\n"), - &participant.display_for_sentence(true, 1, true), + &participant.display_for_sentence(1, true), leave_description, - &partner_mut.display_for_sentence(true, 1, false) + &partner_mut.display_for_sentence(1, false) ), ) .await?; @@ -1070,8 +1070,8 @@ pub async fn change_conversational_style( let msg = format!(ansi!( "{} changes the style of conversation with {} to be {}. The conversation drifts to {}, but you realise it could shift to {}\n"), - player_item.display_for_sentence(true, 1, true), - other_player.display_for_sentence(true, 1, false), + player_item.display_for_sentence(1, true), + other_player.display_for_sentence(1, false), style.display(), topic.display_readable(), &alt_topics_str @@ -1122,8 +1122,8 @@ pub async fn change_conversation_topic( let msg = format!( "{} subtley changes the topic of conversation with {}, and it drifts to {}\n", - player_item.display_for_sentence(true, 1, true), - other_player.display_for_sentence(true, 1, false), + player_item.display_for_sentence(1, true), + other_player.display_for_sentence(1, false), topic.display_readable(), ); broadcast_to_room(&ctx.trans, &player_item.location, None, &msg).await?; @@ -1164,8 +1164,8 @@ pub async fn change_conversation_intensity( 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", - player_item.display_for_sentence(true, 1, true), - other_player.display_for_sentence(true, 1, false), + player_item.display_for_sentence(1, true), + other_player.display_for_sentence(1, false), intensity.display_readable(), ); broadcast_to_room(&ctx.trans, &player_item.location, None, &msg).await?; diff --git a/blastmud_game/src/static_content/npc/roboporter.rs b/blastmud_game/src/static_content/npc/roboporter.rs index 84e7e76e..e648179a 100644 --- a/blastmud_game/src/static_content/npc/roboporter.rs +++ b/blastmud_game/src/static_content/npc/roboporter.rs @@ -51,13 +51,13 @@ impl HireHandler for RoboporterHandler { 50 - stats.total_count }; 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? { if remaining_space > 0 { msg.push_str(&format!( "{} unloads {} from {}\n", &desc, - &item.display_for_sentence(true, 1, false), + &item.display_for_sentence(1, false), &target.pronouns.intensive )); let mut item_mut = (*item).clone(); @@ -66,7 +66,7 @@ impl HireHandler for RoboporterHandler { remaining_space -= 1; } 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", - &desc, &item.display_for_sentence(true, 1, false), + &desc, &item.display_for_sentence(1, false), )); recursively_destroy_or_move_item(trans, &item).await?; } diff --git a/blastmud_game/src/static_content/possession_type.rs b/blastmud_game/src/static_content/possession_type.rs index 9a123c1d..d8a240a1 100644 --- a/blastmud_game/src/static_content/possession_type.rs +++ b/blastmud_game/src/static_content/possession_type.rs @@ -35,10 +35,9 @@ pub mod torso_armour; mod trauma_kit; mod whip; -pub type AttackMessageChoice = - Vec String + 'static + Sync + Send>>; +pub type AttackMessageChoice = Vec String + 'static + Sync + Send>>; pub type AttackMessageChoicePart = - Vec String + 'static + Sync + Send>>; + Vec String + 'static + Sync + Send>>; #[derive(Clone)] pub struct SkillScaling { @@ -89,18 +88,18 @@ pub struct WeaponAttackData { impl Default for WeaponAttackData { fn default() -> Self { Self { - start_messages: vec![Box::new(|attacker, victim, exp| { + start_messages: vec![Box::new(|attacker, victim| { format!( "{} makes an attack on {}", - &attacker.display_for_sentence(exp, 1, true), - &victim.display_for_sentence(exp, 1, false) + &attacker.display_for_sentence(1, true), + &victim.display_for_sentence(1, false) ) })], - success_messages: vec![Box::new(|attacker, victim, part, exp| { + success_messages: vec![Box::new(|attacker, victim, part| { format!( "{}'s attack on {} hits {} {}", - &attacker.display_for_sentence(exp, 1, true), - &victim.display_for_sentence(exp, 1, false), + &attacker.display_for_sentence(1, true), + &victim.display_for_sentence(1, false), &victim.pronouns.possessive, part.display(victim.sex.clone()) ) @@ -365,25 +364,19 @@ impl Default for PossessionData { } 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(); self.start_messages[..] .choose(&mut rng) - .map(|f| f(attacker, victim, explicit_ok)) + .map(|f| f(attacker, victim)) .unwrap_or("No message defined yet".to_owned()) } - pub fn success_message( - &self, - attacker: &Item, - victim: &Item, - part: &BodyPart, - explicit_ok: bool, - ) -> String { + pub fn success_message(&self, attacker: &Item, victim: &Item, part: &BodyPart) -> String { let mut rng = rand::thread_rng(); self.success_messages[..] .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()) } } @@ -480,37 +473,37 @@ pub fn fist() -> &'static WeaponData { raw_min_to_learn: 0.0, raw_max_to_learn: 2.0, normal_attack: WeaponAttackData { - start_messages: vec![Box::new(|attacker, victim, exp| { + start_messages: vec![Box::new(|attacker, victim| { format!( "{} swings at {} with {} fists", - &attacker.display_for_sentence(exp, 1, true), - &victim.display_for_sentence(exp, 1, false), + &attacker.display_for_sentence(1, true), + &victim.display_for_sentence(1, false), &attacker.pronouns.possessive ) })], - success_messages: vec![Box::new(|attacker, victim, part, exp| { + success_messages: vec![Box::new(|attacker, victim, part| { format!( "{}'s fists smash into {}'s {}", - &attacker.display_for_sentence(exp, 1, true), - &victim.display_for_sentence(exp, 1, false), + &attacker.display_for_sentence(1, true), + &victim.display_for_sentence(1, false), &part.display(victim.sex.clone()) ) })], ..Default::default() }, power_attack: Some(WeaponAttackData { - start_messages: vec![Box::new(|attacker, victim, exp| { + start_messages: vec![Box::new(|attacker, victim| { format!( "{} tenses for a power fist swings at {}", - &attacker.display_for_sentence(exp, 1, true), - &victim.display_for_sentence(exp, 1, false), + &attacker.display_for_sentence(1, true), + &victim.display_for_sentence(1, false), ) })], - success_messages: vec![Box::new(|attacker, victim, part, exp| { + success_messages: vec![Box::new(|attacker, victim, part| { format!( "{}'s fists smash with great force into {}'s {}", - &attacker.display_for_sentence(exp, 1, true), - &victim.display_for_sentence(exp, 1, false), + &attacker.display_for_sentence(1, true), + &victim.display_for_sentence(1, false), &part.display(victim.sex.clone()) ) })], diff --git a/blastmud_game/src/static_content/possession_type/blade.rs b/blastmud_game/src/static_content/possession_type/blade.rs index f973692c..1ffff4aa 100644 --- a/blastmud_game/src/static_content/possession_type/blade.rs +++ b/blastmud_game/src/static_content/possession_type/blade.rs @@ -18,19 +18,19 @@ pub fn data() -> &'static Vec<(PossessionType, PossessionData)> { raw_max_to_learn: 2.0, normal_attack: WeaponAttackData { start_messages: vec!( - Box::new(|attacker, victim, exp| + Box::new(|attacker, victim| format!("{} raises {} butcher knife menancingly, preparing to attack {}", - &attacker.display_for_sentence(exp, 1, true), + &attacker.display_for_sentence(1, true), &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| + Box::new(|attacker, victim, part| format!("{}'s butcher knife cuts into {}'s {}", - &attacker.display_for_sentence(exp, 1, true), - &victim.display_for_sentence(exp, 1, false), + &attacker.display_for_sentence(1, true), + &victim.display_for_sentence(1, false), &part.display(victim.sex.clone()) ) ) @@ -57,19 +57,19 @@ pub fn data() -> &'static Vec<(PossessionType, PossessionData)> { raw_max_to_learn: 3.0, normal_attack: WeaponAttackData { start_messages: vec!( - Box::new(|attacker, victim, exp| + Box::new(|attacker, victim| format!("{} points {} dagger menancingly, preparing to attack {}", - &attacker.display_for_sentence(exp, 1, true), + &attacker.display_for_sentence(1, true), &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| + Box::new(|attacker, victim, part| format!("{}'s dagger cuts into {}'s {}", - &attacker.display_for_sentence(exp, 1, true), - &victim.display_for_sentence(exp, 1, false), + &attacker.display_for_sentence(1, true), + &victim.display_for_sentence(1, false), &part.display(victim.sex.clone()) ) ) @@ -97,19 +97,19 @@ pub fn data() -> &'static Vec<(PossessionType, PossessionData)> { raw_max_to_learn: 4.0, normal_attack: WeaponAttackData { start_messages: vec!( - Box::new(|attacker, victim, exp| + Box::new(|attacker, victim| format!("{} grasps {} machete, preparing to strike {}", - &attacker.display_for_sentence(exp, 1, true), + &attacker.display_for_sentence(1, true), &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| + Box::new(|attacker, victim, part| format!("{}'s machete hits {}'s {} with a cutting blow", - &attacker.display_for_sentence(exp, 1, true), - &victim.display_for_sentence(exp, 1, false), + &attacker.display_for_sentence(1, true), + &victim.display_for_sentence(1, false), &part.display(victim.sex.clone()) ) ) @@ -137,19 +137,19 @@ pub fn data() -> &'static Vec<(PossessionType, PossessionData)> { raw_max_to_learn: 8.0, normal_attack: WeaponAttackData { start_messages: vec!( - Box::new(|attacker, victim, exp| + Box::new(|attacker, victim| format!("{} raises {} katana menancingly, preparing to attack {}", - &attacker.display_for_sentence(exp, 1, true), + &attacker.display_for_sentence(1, true), &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| + Box::new(|attacker, victim, part| format!("{}'s katana slashes into {}'s {}", - &attacker.display_for_sentence(exp, 1, true), - &victim.display_for_sentence(exp, 1, false), + &attacker.display_for_sentence(1, true), + &victim.display_for_sentence(1, false), &part.display(victim.sex.clone()) ) ) @@ -177,19 +177,19 @@ pub fn data() -> &'static Vec<(PossessionType, PossessionData)> { raw_max_to_learn: 13.0, normal_attack: WeaponAttackData { start_messages: vec!( - Box::new(|attacker, victim, exp| + Box::new(|attacker, victim| 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, - &victim.display_for_sentence(exp, 1, false), + &victim.display_for_sentence(1, false), ) ) ), success_messages: vec!( - Box::new(|attacker, victim, part, exp| + Box::new(|attacker, victim, part| format!("{}'s electroblade zaps {}'s {}", - &attacker.display_for_sentence(exp, 1, true), - &victim.display_for_sentence(exp, 1, false), + &attacker.display_for_sentence(1, true), + &victim.display_for_sentence(1, false), &part.display(victim.sex.clone()) ) ) @@ -217,19 +217,19 @@ pub fn data() -> &'static Vec<(PossessionType, PossessionData)> { raw_max_to_learn: 14.0, normal_attack: WeaponAttackData { 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 {}", - &attacker.display_for_sentence(exp, 1, true), + &attacker.display_for_sentence(1, true), &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| + Box::new(|attacker, victim, part| format!("{}'s flame scimitar slices into {}'s {}", - &attacker.display_for_sentence(exp, 1, true), - &victim.display_for_sentence(exp, 1, false), + &attacker.display_for_sentence(1, true), + &victim.display_for_sentence(1, false), &part.display(victim.sex.clone()) ) ) @@ -257,19 +257,19 @@ pub fn data() -> &'static Vec<(PossessionType, PossessionData)> { raw_max_to_learn: 100.0, normal_attack: WeaponAttackData { start_messages: vec!( - Box::new(|attacker, victim, exp| + Box::new(|attacker, victim| format!("{} raises {} nanoblade gladius menancingly, preparing to attack {}", - &attacker.display_for_sentence(exp, 1, true), + &attacker.display_for_sentence(1, true), &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| + Box::new(|attacker, victim, part| format!("{}'s nanoblade cuts into {}'s {}, activating the horrendous power of the nanites", - &attacker.display_for_sentence(exp, 1, true), - &victim.display_for_sentence(exp, 1, false), + &attacker.display_for_sentence(1, true), + &victim.display_for_sentence(1, false), &part.display(victim.sex.clone()) ) ) diff --git a/blastmud_game/src/static_content/possession_type/club.rs b/blastmud_game/src/static_content/possession_type/club.rs index 213f7ce4..68fbb074 100644 --- a/blastmud_game/src/static_content/possession_type/club.rs +++ b/blastmud_game/src/static_content/possession_type/club.rs @@ -17,19 +17,19 @@ pub fn data() -> &'static Vec<(PossessionType, PossessionData)> { raw_min_to_learn: 2.0, raw_max_to_learn: 4.0, normal_attack: WeaponAttackData { - start_messages: vec![Box::new(|attacker, victim, exp| { + start_messages: vec![Box::new(|attacker, victim| { format!( "{} aims {} spiked mace at {}", - &attacker.display_for_sentence(exp, 1, true), + &attacker.display_for_sentence(1, true), &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!( "{}'s spiked mace smashes with force into {}'s {}", - &attacker.display_for_sentence(exp, 1, true), - &victim.display_for_sentence(exp, 1, false), + &attacker.display_for_sentence(1, true), + &victim.display_for_sentence(1, false), &part.display(victim.sex.clone()) ) })], diff --git a/blastmud_game/src/static_content/possession_type/corp_licence.rs b/blastmud_game/src/static_content/possession_type/corp_licence.rs index af02ccf1..b5d2ad03 100644 --- a/blastmud_game/src/static_content/possession_type/corp_licence.rs +++ b/blastmud_game/src/static_content/possession_type/corp_licence.rs @@ -98,7 +98,7 @@ impl ArglessHandler for CorpLicenceHandler { None, &format!( "{} signs a contract establishing {} as a corp\n", - &player.display_for_sentence(true, 1, true), + &player.display_for_sentence(1, true), name ), ) diff --git a/blastmud_game/src/static_content/possession_type/fangs.rs b/blastmud_game/src/static_content/possession_type/fangs.rs index d3a82be1..48f71d36 100644 --- a/blastmud_game/src/static_content/possession_type/fangs.rs +++ b/blastmud_game/src/static_content/possession_type/fangs.rs @@ -10,19 +10,19 @@ pub fn data() -> &'static PossessionData { raw_min_to_learn: 0.0, raw_max_to_learn: 2.0, normal_attack: WeaponAttackData { - start_messages: vec![Box::new(|attacker, victim, exp| { + start_messages: vec![Box::new(|attacker, victim| { format!( "{} bares {} teeth and lunges at {}", - &attacker.display_for_sentence(exp, 1, true), + &attacker.display_for_sentence(1, true), &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!( "{}'s teeth connect and tear at the flesh of {}'s {}", - &attacker.display_for_sentence(exp, 1, true), - &victim.display_for_sentence(exp, 1, false), + &attacker.display_for_sentence(1, true), + &victim.display_for_sentence(1, false), &part.display(victim.sex.clone()) ) })], diff --git a/blastmud_game/src/static_content/possession_type/lock.rs b/blastmud_game/src/static_content/possession_type/lock.rs index 16555ec0..efebd5ce 100644 --- a/blastmud_game/src/static_content/possession_type/lock.rs +++ b/blastmud_game/src/static_content/possession_type/lock.rs @@ -87,9 +87,9 @@ impl InstallHandler for ScanLockInstall { None, &format!( "{} 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(), - &what.display_for_sentence(true, 1, false) + &what.display_for_sentence(1, false) ), ) .await?; @@ -129,9 +129,9 @@ impl InstallHandler for ScanLockInstall { None, &format!( "{} 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(), - &what.display_for_sentence(true, 1, false), + &what.display_for_sentence(1, false), extra_text ), ) diff --git a/blastmud_game/src/static_content/possession_type/trauma_kit.rs b/blastmud_game/src/static_content/possession_type/trauma_kit.rs index 90e0b20f..e51b58f5 100644 --- a/blastmud_game/src/static_content/possession_type/trauma_kit.rs +++ b/blastmud_game/src/static_content/possession_type/trauma_kit.rs @@ -33,11 +33,11 @@ pub fn data() -> &'static Vec<(PossessionType, PossessionData)> { messagef: Box::new(|player, _item, target| format!( "{} 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 { player.pronouns.intensive.clone() } 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| format!( "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| format!( "{} 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 { player.pronouns.intensive.clone() } 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| format!( "{} 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 { player.pronouns.intensive.clone() } 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| format!( "FUUUCK! It hurts {}, but also starts to soothe {}", - target.display_for_sentence(true, 1, false), + target.display_for_sentence(1, false), &target.pronouns.object ) ) @@ -109,7 +109,7 @@ pub fn data() -> &'static Vec<(PossessionType, PossessionData)> { |target| format!( "FUUUCK! It hurts {}, but also starts to soothe {}", - target.display_for_sentence(true, 1, false), + target.display_for_sentence(1, false), &target.pronouns.object ) ) @@ -121,7 +121,7 @@ pub fn data() -> &'static Vec<(PossessionType, PossessionData)> { |target| format!( "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| format!( "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| format!( "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| format!( "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| format!( "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| format!( "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) { Some(format!( "You see no reason to use {} on {}", - item.display_for_sentence(false, 1, false), - target.display_for_sentence(false, 1, false) + item.display_for_sentence(1, false), + target.display_for_sentence(1, false) )) } else { None diff --git a/blastmud_game/src/static_content/possession_type/whip.rs b/blastmud_game/src/static_content/possession_type/whip.rs index 8d3963ff..7d69f4ca 100644 --- a/blastmud_game/src/static_content/possession_type/whip.rs +++ b/blastmud_game/src/static_content/possession_type/whip.rs @@ -18,19 +18,19 @@ pub fn data() -> &'static Vec<(PossessionType, PossessionData)> { raw_max_to_learn: 2.0, normal_attack: WeaponAttackData { start_messages: vec!( - Box::new(|attacker, victim, exp| + Box::new(|attacker, victim| 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, - &victim.display_for_sentence(exp, 1, false), + &victim.display_for_sentence(1, false), ) ) ), 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 {}", - &attacker.display_for_sentence(exp, 1, true), - &victim.display_for_sentence(exp, 1, false), + &attacker.display_for_sentence(1, true), + &victim.display_for_sentence(1, false), &part.display(victim.sex.clone()) ) ) @@ -41,19 +41,19 @@ pub fn data() -> &'static Vec<(PossessionType, PossessionData)> { }, power_attack: Some(WeaponAttackData { start_messages: vec!( - Box::new(|attacker, victim, exp| + Box::new(|attacker, victim| 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, - &victim.display_for_sentence(exp, 1, false), + &victim.display_for_sentence(1, false), ) ) ), success_messages: vec!( - Box::new(|attacker, victim, part, exp| + Box::new(|attacker, victim, part| format!("{}'s antenna whip hits {}'s {} with great force", - &attacker.display_for_sentence(exp, 1, true), - &victim.display_for_sentence(exp, 1, false), + &attacker.display_for_sentence(1, true), + &victim.display_for_sentence(1, false), &part.display(victim.sex.clone()) ) ) @@ -80,19 +80,19 @@ pub fn data() -> &'static Vec<(PossessionType, PossessionData)> { raw_max_to_learn: 2.0, normal_attack: WeaponAttackData { start_messages: vec!( - Box::new(|attacker, victim, exp| + Box::new(|attacker, victim| 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, - &victim.display_for_sentence(exp, 1, false), + &victim.display_for_sentence(1, false), ) ) ), 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 {}", - &attacker.display_for_sentence(exp, 1, true), - &victim.display_for_sentence(exp, 1, false), + &attacker.display_for_sentence(1, true), + &victim.display_for_sentence(1, false), &part.display(victim.sex.clone()) ) ) @@ -106,19 +106,19 @@ pub fn data() -> &'static Vec<(PossessionType, PossessionData)> { }, power_attack: Some(WeaponAttackData { start_messages: vec!( - Box::new(|attacker, victim, exp| + Box::new(|attacker, victim| 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, - &victim.display_for_sentence(exp, 1, false), + &victim.display_for_sentence(1, false), ) ) ), success_messages: vec!( - Box::new(|attacker, victim, part, exp| + Box::new(|attacker, victim, part| format!("{}'s leather whip hits {}'s {} with great force", - &attacker.display_for_sentence(exp, 1, true), - &victim.display_for_sentence(exp, 1, false), + &attacker.display_for_sentence(1, true), + &victim.display_for_sentence(1, false), &part.display(victim.sex.clone()) ) )