use super::{Room, SimpleRoom}; use crate::{ models::item::{ItemStaticSpecialData, LiquidType, LocationActionType, Scavtype}, static_content::{ fixed_item::FixedItem, possession_type::{possession_data, LiquidContainerData, PossessionData, PossessionType}, room::Direction, scavtable::Scavinfo, }, }; use ansi::ansi; use serde_yaml::from_str as from_yaml_str; pub fn street_scavtable() -> Vec { vec![Scavinfo { possession_type: PossessionType::RustySpike, p_present: 1.0, difficulty_mean: 7.0, difficulty_stdev: 1.0, scavtype: Scavtype::Scavenge, }] } pub fn fixed_items() -> Vec { vec![ FixedItem { code: "melbs_king_st_spring_fed_fountain".to_owned(), name: "spring fed fountain".to_owned(), description: ansi!("A stainless steel fountain, clearly old, but in surprisingly good \ condition. A discoloured bronze plaque attached to it proudly declares \ that it is fed by a natural spring underneath it. It was designed so that \ unused water runs off it into a dog bowl - presumably in a time long past when \ dogs were friendly companions and not the menace they are today. It smells \ faintly of iron. [Try drink from fountain or, if you have a suitable \ container, fill container from fountain].").to_owned(), location: "room/melbs_kingst_40".to_owned(), proper_noun: false, aliases: vec!["fountain".to_owned()], ..Default::default() }, FixedItem { code: "kings_office_basin".to_owned(), name: "basin".to_owned(), description: ansi!("A white porcelain basin, with chrome mixer taps in the centre, that you \ can imagine was once pristine and very fancy, but is now stained from \ years of grime. [Try drink from basin or, if you have a suitable \ container, fill container from basin].").to_owned(), location: "room/kings_office_bathroom".to_owned(), proper_noun: false, aliases: vec!["sink".to_owned()], ..Default::default() }, FixedItem { code: "kings_office_hallway_door_lock".to_owned(), name: "basic keyed lock".to_owned(), description: "A basic lock that looks like it needs a key to open".to_owned(), location: "room/kings_office_hallway".to_owned(), proper_noun: false, aliases: vec!["lock".to_owned()], action_type: LocationActionType::InstalledOnDoorAsLock(Direction::SOUTH), static_special_data: Some(ItemStaticSpecialData::LockData { pin_sequence: "KINGSOFF".to_owned() }), ..Default::default() } ] } pub fn fixed_item_properties() -> Vec<(&'static str, PossessionData)> { let lock_tmpl = possession_data().get(&PossessionType::Basiclock).unwrap(); vec![ ( "melbs_king_st_spring_fed_fountain", PossessionData { liquid_container_data: Some(LiquidContainerData { capacity: 5000000, // mL allowed_contents: Some(vec![LiquidType::Water]), ..Default::default() }), ..Default::default() }, ), ( "kings_office_basin", PossessionData { liquid_container_data: Some(LiquidContainerData { capacity: 1100000, // mL allowed_contents: Some(vec![LiquidType::Water]), ..Default::default() }), ..Default::default() }, ), ( "kings_office_hallway_door_lock", PossessionData { lockcheck_handler: lock_tmpl.lockcheck_handler, ..Default::default() }, ), ] } pub fn room_list() -> Vec { from_yaml_str::>>(include_str!("melbs.yaml")) .unwrap() .into_iter() .map(|r| r.into()) .collect() }