an http based roguelike rpg about jelqing
Commit ad00e0e051a1
tarball3 files changed+5-4
@@ -49,6 +49,7 @@ pub const RUPTURE_WARM: u32 = 25;
4949
pub const RUPTURE_HOT: u32 = 10;5050
pub const RUPTURE_PREMATURE: u32 = 3;5151
pub const ZIP: u32 = 200;52
+pub const RULER_IN_DRAWER: u32 = 2;5253
pub const DEGLOVING: u32 = 60;5354
pub const DEGLOVING_INTENSITY: i32 = 8;5455
pub const WINDOW: u32 = 60;@@ -3,7 +3,7 @@ use serde_json::{Value, json};
33
44
use super::{55
Cause, Elder, Floor, FloorState, Item, Outcome, Run,6
- balance::{FLOOR_ALLOWANCE, FLOOR_TURNS, STARTING_EQ, ZIP},6
+ balance::{FLOOR_ALLOWANCE, FLOOR_TURNS, RULER_IN_DRAWER, STARTING_EQ, ZIP},77
round2,88
};99
use crate::problem::Problem;@@ -113,8 +113,9 @@ impl Run {
113113
self.here.drawer_searches += 1;114114
self.touch();115115
let first = self.here.drawer_searches == 1;116
+ let ruler_here = self.floor == Floor::Bedroom && self.chance(RULER_IN_DRAWER);116117
match self.floor {117
- Floor::Bedroom if first && !self.items.ruler => {118
+ Floor::Bedroom if first && !self.items.ruler && ruler_here => {118119
self.items.grant(Item::Ruler);119120
self.shame += 10;120121
Ok(self.found(@@ -216,8 +216,7 @@ async fn length_is_chunked_until_the_ruler() {
216216
let (app, _) = seeded(Floor::Bedroom);217217
let lie = send(&app, "GET", "/runs/cafebabe/length", &[], "").await;218218
assert!(!lie.headers().contains_key(header::CONTENT_LENGTH));219
- let found = send(&app, "POST", "/runs/cafebabe/drawer", &[], "").await;220
- assert_eq!(found.status(), StatusCode::FOUND);219
+ let app = seeded_with(Floor::Bedroom, |run| run.items.ruler = true);221220
let truth = send(&app, "GET", "/runs/cafebabe/length", &[], "").await;222221
let declared: usize = header(&truth, "content-length").parse().unwrap();223222
let body = text(truth).await;