From 18f1bcf24148607bad38c67ef0703587642b4eb1 Mon Sep 17 00:00:00 2001 From: Condorra Date: Thu, 8 Feb 2024 22:35:06 +1100 Subject: [PATCH] Add stinkfiends. Fix bug with get. --- .../src/message_handler/user_commands/get.rs | 4 +- .../src/static_content/npc/sewer_npcs.rs | 106 ++++++++++++- .../src/static_content/npc/sewer_npcs.yaml | 30 ++++ .../src/static_content/room/melbs_sewers.yaml | 5 + blastmud_game/src/static_content/species.rs | 1 + docs/ImperialLootQuestDesign.mm | 145 ++++++++++++++++++ 6 files changed, 288 insertions(+), 3 deletions(-) create mode 100644 docs/ImperialLootQuestDesign.mm diff --git a/blastmud_game/src/message_handler/user_commands/get.rs b/blastmud_game/src/message_handler/user_commands/get.rs index cd70ec97..b67a9922 100644 --- a/blastmud_game/src/message_handler/user_commands/get.rs +++ b/blastmud_game/src/message_handler/user_commands/get.rs @@ -210,7 +210,7 @@ fn check_get_from_allowed(from_what: &Item) -> UResult<()> { if from_what.item_type == "player" || from_what.item_type == "npc" { if from_what.death_data.is_none() { user_error(format!( - "You don't think {} would let you just take like that!", + "You don't think {} would let you just take it like that!", &from_what.pronouns.subject ))?; } @@ -276,7 +276,7 @@ impl UserVerb for Verb { )?; } - if include_loc_contents { + if include_contents { check_get_from_allowed(&search_what)?; } diff --git a/blastmud_game/src/static_content/npc/sewer_npcs.rs b/blastmud_game/src/static_content/npc/sewer_npcs.rs index 036d91b7..9957bf98 100644 --- a/blastmud_game/src/static_content/npc/sewer_npcs.rs +++ b/blastmud_game/src/static_content/npc/sewer_npcs.rs @@ -7,6 +7,7 @@ use crate::{ static_content::{ npc::{npc_pronoun_type_to_pronouns, KillBonus}, possession_type::PossessionType, + species::SpeciesType, }, }; use serde::Deserialize; @@ -20,6 +21,16 @@ enum SewerNPC { spawn_loc: String, gender: NPCPronounType, }, + KillerCroc { + code: String, + name: String, + spawn_loc: String, + }, + Stinkfiend { + code: String, + name: String, + spawn_loc: String, + }, } pub fn npc_list() -> Vec { @@ -51,6 +62,24 @@ pub fn npc_list() -> Vec { "I know you are there, prey! Give up, we might as well get this over with!", ]), }; + let stinkfiend_stdsay = NPCSayInfo { + say_code: "babble", + frequency_secs: 120, + talk_type: FromFixedList(vec![ + "This part of the sewers is mine, and all who enter die by my hand!", + "I hate surface dwellers so much. At least they're easy to kill!", + "Crocodiles don't bother me - I just whip their faces off.", + "A surface dweller once said I stink. I think I still have his skull.", + "Surface dwellers are good for stress relief - whipping them is fun!", + "They come from the surface and think they can just waltz in. Idiots.", + "I think the surface makes people weak.", + "Once I killed a surface dweller with the body of his friend.", + "Us stinkfiends are genetically superior, and one day we will wipe out all others.", + "I dream of a day when stinkfiends rule, and the inferior surface dwellers are wiped out.", + "Death to surface dwellers!", + "There is one surface dweller who hides in a sub-cellar around here who I have never been able to catch. It makes my blood boil. One day I will get her!", + ]), + }; from_yaml_str::>(include_str!("sewer_npcs.yaml")) .unwrap() @@ -99,6 +128,81 @@ pub fn npc_list() -> Vec { wander_zones: vec!["melbs_sewers".to_owned()], says: vec!(radiant_predator_stdsay.clone()), ..Default::default() - } + }, + SewerNPC::KillerCroc { code, name, spawn_loc } => + NPC { + code: format!("sewer_croc_{}", &code), + name, + pronouns: Pronouns { + is_proper: false, + ..Pronouns::default_inanimate() + }, + aliases: vec!["crocodile".to_owned()], + aggression: 12, + description: "A saltwater crocodile, featuring rows of extremely sharp white teeth gleaming in the light, and tough olive-green scales that will clearly protect it from a lot of abuse. It is longer than a person, and looks extremely menacing".to_owned(), + spawn_location: format!("room/melbs_sewers_{}", &spawn_loc), + species: SpeciesType::Crocodile, + kill_bonus: Some(KillBonus { + msg: "On your wristpad: I can't believe you took down a salty! Here's something for your trouble.", + payment: 300, + }), + max_health: 100, + aggro_pc_only: true, + total_xp: 20000, + total_skills: SkillType::values() + .into_iter() + .map(|sk| { + ( + sk.clone(), + match sk { + SkillType::Dodge => 14.0, + SkillType::Fists => 20.0, + _ => 8.0 + } + ) + }).collect(), + player_consents: vec!(ConsentType::Fight), + message_handler: None, + wander_zones: vec!["melbs_sewers".to_owned()], + ..Default::default() + }, + SewerNPC::Stinkfiend { code, name, spawn_loc } => + NPC { + code: format!("stinkfiend_{}", &code), + name, + pronouns: Pronouns { + is_proper: false, + ..Pronouns::default_inanimate() + }, + aliases: vec!["fiend".to_owned()], + aggression: 18, + description: "A grotesquely mutant humanoid creature, with orange-tinged discoloured skin hanging loose on flesh, and distorted yet horrific features. It looks dangerous. The odour of this creature is so pungent you have to choke back the urge to vomit as it wafts your way".to_owned(), + spawn_location: format!("room/melbs_sewers_{}", &spawn_loc), + species: SpeciesType::Human, + kill_bonus: Some(KillBonus { + msg: "On your wristpad: You legend - you killed a bloody stinkfiend! You're braver than I am mate - that deserves a reward!", + payment: 500, + }), + max_health: 120, + aggro_pc_only: true, + total_xp: 30000, + total_skills: SkillType::values() + .into_iter() + .map(|sk| { + ( + sk.clone(), + match sk { + SkillType::Dodge => 18.0, + SkillType::Whips => 20.0, + _ => 8.0 + } + ) + }).collect(), + player_consents: vec!(ConsentType::Fight), + says: vec!(stinkfiend_stdsay.clone()), + message_handler: None, + wander_zones: vec![], // They defend their room. + ..Default::default() + } }).collect() } diff --git a/blastmud_game/src/static_content/npc/sewer_npcs.yaml b/blastmud_game/src/static_content/npc/sewer_npcs.yaml index d0225e25..a2a8dbd8 100644 --- a/blastmud_game/src/static_content/npc/sewer_npcs.yaml +++ b/blastmud_game/src/static_content/npc/sewer_npcs.yaml @@ -228,3 +228,33 @@ name: repulsive foul radiant predator gender: Male spawn_loc: 14q +- !Stinkfiend + code: stink_1 + name: repulsive stinkfiend + gender: Male + spawn_loc: 8h +- !Stinkfiend + code: stink_2 + name: despicable stinkfiend + gender: Female + spawn_loc: 9h +- !Stinkfiend + code: stink_3 + name: despicable stinkfiend + gender: Male + spawn_loc: 10h +- !Stinkfiend + code: stink_4 + name: disgusting stinkfiend + gender: Female + spawn_loc: 8i +- !Stinkfiend + code: stink_5 + name: paranoid stinkfiend + gender: Female + spawn_loc: 9i +- !Stinkfiend + code: stink_6 + name: revolting stinkfiend + gender: Male + spawn_loc: 10i diff --git a/blastmud_game/src/static_content/room/melbs_sewers.yaml b/blastmud_game/src/static_content/room/melbs_sewers.yaml index b3998b08..a19988a6 100644 --- a/blastmud_game/src/static_content/room/melbs_sewers.yaml +++ b/blastmud_game/src/static_content/room/melbs_sewers.yaml @@ -969,6 +969,7 @@ scavtable: CitySewer item_flags: - !DarkPlace + repel_npc: true - zone: melbs_sewers code: melbs_sewers_10h name: Vast sewer cavern @@ -986,6 +987,7 @@ scavtable: CitySewer item_flags: - !DarkPlace + repel_npc: true - zone: melbs_sewers code: melbs_sewers_13h name: Dank narrow sewerpipe @@ -1134,6 +1136,7 @@ scavtable: CitySewer item_flags: - !DarkPlace + repel_npc: true - zone: melbs_sewers code: melbs_sewers_9i name: Vast sewer cavern @@ -1154,6 +1157,7 @@ scavtable: CitySewer item_flags: - !DarkPlace + repel_npc: true - zone: melbs_sewers code: melbs_sewers_10i name: Vast sewer cavern @@ -1172,6 +1176,7 @@ scavtable: CitySewer item_flags: - !DarkPlace + repel_npc: true - zone: melbs_sewers code: melbs_sewers_11i name: Wide fetid sewerpipe diff --git a/blastmud_game/src/static_content/species.rs b/blastmud_game/src/static_content/species.rs index de456487..ad3fa191 100644 --- a/blastmud_game/src/static_content/species.rs +++ b/blastmud_game/src/static_content/species.rs @@ -10,6 +10,7 @@ pub enum SpeciesType { Dog, Robot, Rat, + Crocodile, } impl SpeciesType { diff --git a/docs/ImperialLootQuestDesign.mm b/docs/ImperialLootQuestDesign.mm new file mode 100644 index 00000000..9f3db32c --- /dev/null +++ b/docs/ImperialLootQuestDesign.mm @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +