an http based roguelike rpg about jelqing
Commit bad9f5b8202f
tarball3 files changed+20-5
@@ -64,12 +64,14 @@ impl Run {
6464
Utility::Energy => return self.energy(),6565
Utility::Edge | Utility::Pump => {}6666
}67
+ let lube = lube.filter(|_| utility == Utility::Edge);6768
self.ready(Technique::Utility(utility), lube)?;6869
self.check_storage()?;70
+ self.lube_available(lube)?;6971
self.check_clock()?;7072
self.floor_enemy()?;7173
match utility {72
- Utility::Edge => self.edge(),74
+ Utility::Edge => self.edge(lube),7375
_ => self.pump(),7476
}7577
}@@ -7,7 +7,7 @@ use axum::http::{StatusCode, header};
77
use serde_json::json;88
99
use super::{10
- Floor, Outcome, Run,10
+ Floor, Lube, Outcome, Run,1111
balance::{1212
EDGE_EQ, EDGE_GIRTH, EDGE_LOOP, ENERGY_STAMINA, FRICTION_ICE, HOTEL_STRESS, ICE_EQ,1313
PRIAPISM_EQ, PRIAPISM_TURNS, PUMP_GAIN, SHOWER_EQ, SUPPLEMENT_WORKS, TOWELLESS_EQ,@@ -159,9 +159,10 @@ impl Run {
159159
.with("upstream", "Pump-Bro"))160160
}161161
162
- pub(super) fn edge(&mut self) -> Result<Outcome, Problem> {163
- self.chafe(None, 5, false);164
- self.commit(5, None, 1)?;162
+ pub(super) fn edge(&mut self, lube: Option<Lube>) -> Result<Outcome, Problem> {163
+ self.take_lube(lube)?;164
+ self.chafe(lube, 5, false);165
+ self.commit(5, lube, 1)?;165166
if let ControlFlow::Break(interrupted) = self.hazards(5)? {166167
return Ok(interrupted);167168
}@@ -268,6 +268,18 @@ async fn friction_rises_with_vigour_and_edging_chafes() {
268268
});269269
let edge = send(&app, "JELQ", "/runs/cafebabe?technique=edge", &[], "").await;270270
assert_eq!(header(&edge, "x-friction"), "2/10");271
+272
+ let oiled = seeded_with(Floor::Hotel, |run| {273
+ run.here.wifi_accepted = true;274
+ run.body.eq = 55;275
+ run.body.foreskin = Some(0.5);276
+ run.items.lubes.baby_oil = 1;277
+ });278
+ let oil = [("content-type", "application/baby-oil")];279
+ let edge = send(&oiled, "JELQ", "/runs/cafebabe?technique=edge", &oil, "").await;280
+ assert_eq!(header(&edge, "x-friction"), "0/10");281
+ let empty = send(&oiled, "JELQ", "/runs/cafebabe?technique=edge", &oil, "").await;282
+ assert_eq!(empty.status(), StatusCode::UNSUPPORTED_MEDIA_TYPE);271283
}272284
273285
#[tokio::test]