an http based roguelike rpg about jelqing
Blame: src/game/floor.rs
782069860236 | atagen | 2026-10-10 12:44 UTC | 1 | #[derive(Clone, Copy, PartialEq, Eq, Debug)] |
782069860236 | atagen | 2026-10-10 12:44 UTC | 2 | #[repr(u8)] |
782069860236 | atagen | 2026-10-10 12:44 UTC | 3 | pub enum Floor { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 4 | Bedroom = 1, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 5 | Bathroom = 2, |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 6 | ChangingRoom = 3, |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 7 | Nans = 4, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 8 | Hotel = 5, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 9 | Forum = 6, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 10 | Clinic = 7, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 11 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 12 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 13 | impl Floor { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 14 | pub fn number(self) -> u8 { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 15 | self as u8 |
782069860236 | atagen | 2026-10-10 12:44 UTC | 16 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 17 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 18 | pub fn next(self) -> Option<Self> { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 19 | match self { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 20 | Self::Bedroom => Some(Self::Bathroom), |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 21 | Self::Bathroom => Some(Self::ChangingRoom), |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 22 | Self::ChangingRoom => Some(Self::Nans), |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 23 | Self::Nans => Some(Self::Hotel), |
782069860236 | atagen | 2026-10-10 12:44 UTC | 24 | Self::Hotel => Some(Self::Forum), |
782069860236 | atagen | 2026-10-10 12:44 UTC | 25 | Self::Forum => Some(Self::Clinic), |
782069860236 | atagen | 2026-10-10 12:44 UTC | 26 | Self::Clinic => None, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 27 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 28 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 29 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 30 | pub fn name(self) -> &'static str { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 31 | match self { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 32 | Self::Bedroom => "the bedroom", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 33 | Self::Bathroom => "the shared bathroom", |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 34 | Self::ChangingRoom => "the gym changing room", |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 35 | Self::Nans => "Nan's house at Christmas", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 36 | Self::Hotel => "a business trip hotel", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 37 | Self::Forum => "the forum", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 38 | Self::Clinic => "the urologist's office", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 39 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 40 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 41 | |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 42 | pub fn place(self) -> &'static str { |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 43 | match self { |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 44 | Self::Bedroom => "the bedroom", |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 45 | Self::Bathroom => "the bathroom", |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 46 | Self::ChangingRoom => "the changing room", |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 47 | Self::Nans => "Nan's house", |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 48 | Self::Hotel => "the hotel room", |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 49 | Self::Forum => "the forum floor", |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 50 | Self::Clinic => "the clinic", |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 51 | } |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 52 | } |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 53 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 54 | pub fn note(self) -> &'static str { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 55 | match self { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 56 | Self::Bedroom => "The door does not lock. The cat is present.", |
7d3fb63208bf | atagen | 2026-10-11 04:38 UTC | 57 | Self::Bathroom => "The water is hot. Your brother showers at eight.", |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 58 | Self::ChangingRoom => { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 59 | "It is cold. Discretion is advised. Everyone here is lying. Pump-Bro is by the lockers." |
782069860236 | atagen | 2026-10-10 12:44 UTC | 60 | } |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 61 | Self::Nans => { |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 62 | "The walls are thin. Mum is here, and she has been reading about Digest authentication." |
782069860236 | atagen | 2026-10-10 12:44 UTC | 63 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 64 | Self::Hotel => { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 65 | "The wifi requires agreement. Housekeeping does not knock. Pump-Bro is in the lobby." |
782069860236 | atagen | 2026-10-10 12:44 UTC | 66 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 67 | Self::Forum => "Nothing physical happens here. The Elder has a spreadsheet.", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 68 | Self::Clinic => "The urologist will see you now. He is bored.", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 69 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 70 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 71 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 72 | pub fn observer(self) -> Option<Observer> { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 73 | match self { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 74 | Self::Bedroom => Some(Observer::Cat), |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 75 | Self::ChangingRoom => Some(Observer::Greg), |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 76 | Self::Nans => Some(Observer::Nan), |
782069860236 | atagen | 2026-10-10 12:44 UTC | 77 | _ => None, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 78 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 79 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 80 | |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 81 | pub fn has_mum(self) -> bool { |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 82 | matches!(self, Self::Bedroom | Self::Nans) |
782069860236 | atagen | 2026-10-10 12:44 UTC | 83 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 84 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 85 | pub fn has_window(self) -> bool { |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 86 | matches!(self, Self::Bedroom | Self::Nans | Self::Hotel) |
782069860236 | atagen | 2026-10-10 12:44 UTC | 87 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 88 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 89 | pub fn shop_open(self) -> bool { |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 90 | matches!(self, Self::ChangingRoom | Self::Hotel) |
782069860236 | atagen | 2026-10-10 12:44 UTC | 91 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 92 | |
0a0bfee8329e | atagen | 2026-10-11 05:11 UTC | 93 | pub fn has_kitchen(self) -> bool { |
0a0bfee8329e | atagen | 2026-10-11 05:11 UTC | 94 | matches!(self, Self::Bedroom | Self::Nans) |
0a0bfee8329e | atagen | 2026-10-11 05:11 UTC | 95 | } |
0a0bfee8329e | atagen | 2026-10-11 05:11 UTC | 96 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 97 | pub fn timed(self) -> bool { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 98 | !matches!(self, Self::Forum | Self::Clinic) |
782069860236 | atagen | 2026-10-10 12:44 UTC | 99 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 100 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 101 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 102 | #[derive(Clone, Copy, PartialEq, Eq, Debug)] |
782069860236 | atagen | 2026-10-10 12:44 UTC | 103 | pub enum Observer { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 104 | Cat, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 105 | Greg, |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 106 | Nan, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 107 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 108 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 109 | impl Observer { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 110 | pub fn name(self) -> &'static str { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 111 | match self { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 112 | Self::Cat => "cat", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 113 | Self::Greg => "greg", |
9683736a2c5e | atagen | 2026-10-10 13:15 UTC | 114 | Self::Nan => "nan", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 115 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 116 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 117 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 118 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 119 | /// State that belongs to the current floor and resets when you leave it. |
782069860236 | atagen | 2026-10-10 12:44 UTC | 120 | #[derive(Default)] |
782069860236 | atagen | 2026-10-10 12:44 UTC | 121 | pub struct FloorState { |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 122 | pub(crate) turns: u32, |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 123 | pub(crate) warm_arrival: bool, |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 124 | pub(crate) drawer: Drawer, |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 125 | pub(crate) kitchen: KitchenVisit, |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 126 | pub(crate) thread_rolls: u8, |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 127 | pub(crate) edges: u8, |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 128 | pub(crate) temp_length: f64, |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 129 | pub(crate) teapot: bool, |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 130 | pub(crate) towel_stolen: bool, |
4b1f5f88827d | atagen | 2026-10-13 10:18 UTC | 131 | pub(crate) towel_warmed: bool, |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 132 | pub(crate) meditated: bool, |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 133 | pub(crate) brother_told: bool, |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 134 | pub(crate) shopping: bool, |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 135 | pub(crate) wifi_accepted: bool, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 136 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 137 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 138 | #[derive(Default)] |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 139 | pub struct Drawer { |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 140 | pub(crate) searched: bool, |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 141 | pub(crate) jammed: bool, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 142 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 143 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 144 | #[derive(Default)] |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 145 | pub struct KitchenVisit { |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 146 | pub(crate) kettle_boiled: bool, |
f16ab17c8ff6 | atagen | 2026-10-13 11:14 UTC | 147 | pub(crate) closed: bool, |
8b8e83329a1d | atagen | 2026-10-12 12:01 UTC | 148 | pub(crate) melon_offered: bool, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 149 | } |