an http based roguelike rpg about jelqing
Blame: src/game/items.rs
782069860236 | atagen | 2026-10-10 12:44 UTC | 1 | use super::balance::STARTING_ICE_PACKS; |
782069860236 | atagen | 2026-10-10 12:44 UTC | 2 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 3 | #[derive(Clone, Copy, PartialEq, Eq, Debug)] |
782069860236 | atagen | 2026-10-10 12:44 UTC | 4 | pub enum Item { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 5 | WarmTowel, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 6 | IcePack, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 7 | Ruler, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 8 | DoorLock, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 9 | DndSign, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 10 | Blinds, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 11 | Pump, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 12 | PumpPro, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 13 | Extender, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 14 | Ring, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 15 | Supplement, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 16 | Cage, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 17 | CageKey, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 18 | Spreadsheet, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 19 | TeapotSpout, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 20 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 21 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 22 | pub const SHOP: [Item; 11] = [ |
782069860236 | atagen | 2026-10-10 12:44 UTC | 23 | Item::Pump, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 24 | Item::PumpPro, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 25 | Item::Extender, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 26 | Item::Ring, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 27 | Item::Supplement, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 28 | Item::DoorLock, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 29 | Item::DndSign, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 30 | Item::Blinds, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 31 | Item::Ruler, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 32 | Item::IcePack, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 33 | Item::CageKey, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 34 | ]; |
782069860236 | atagen | 2026-10-10 12:44 UTC | 35 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 36 | impl Item { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 37 | const ALL: [Self; 15] = [ |
782069860236 | atagen | 2026-10-10 12:44 UTC | 38 | Self::WarmTowel, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 39 | Self::IcePack, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 40 | Self::Ruler, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 41 | Self::DoorLock, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 42 | Self::DndSign, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 43 | Self::Blinds, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 44 | Self::Pump, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 45 | Self::PumpPro, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 46 | Self::Extender, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 47 | Self::Ring, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 48 | Self::Supplement, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 49 | Self::Cage, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 50 | Self::CageKey, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 51 | Self::Spreadsheet, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 52 | Self::TeapotSpout, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 53 | ]; |
782069860236 | atagen | 2026-10-10 12:44 UTC | 54 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 55 | pub fn slug(self) -> &'static str { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 56 | match self { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 57 | Self::WarmTowel => "warm-towel", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 58 | Self::IcePack => "ice-pack", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 59 | Self::Ruler => "ruler", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 60 | Self::DoorLock => "door-lock", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 61 | Self::DndSign => "do-not-disturb-sign", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 62 | Self::Blinds => "window-blinds", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 63 | Self::Pump => "pump", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 64 | Self::PumpPro => "pump-pro", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 65 | Self::Extender => "extender", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 66 | Self::Ring => "cock-ring", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 67 | Self::Supplement => "supplement", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 68 | Self::Cage => "chastity-cage", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 69 | Self::CageKey => "cage-key", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 70 | Self::Spreadsheet => "spreadsheet", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 71 | Self::TeapotSpout => "teapot-spout", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 72 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 73 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 74 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 75 | pub fn parse(slug: &str) -> Option<Self> { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 76 | Self::ALL.into_iter().find(|item| item.slug() == slug) |
782069860236 | atagen | 2026-10-10 12:44 UTC | 77 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 78 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 79 | pub fn description(self) -> &'static str { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 80 | match self { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 81 | Self::WarmTowel => { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 82 | "Reusable. Satisfies the warm-up precondition. Use technique=warmup." |
782069860236 | atagen | 2026-10-10 12:44 UTC | 83 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 84 | Self::IcePack => "Lowers EQ by 40. Use technique=ice.", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 85 | Self::Ruler => "Measures honestly. The length resource now carries a Content-Length.", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 86 | Self::DoorLock => "Keeps the roommate out once.", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 87 | Self::DndSign => "Works on housekeeping. Mom does not read signs.", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 88 | Self::Blinds => "The neighbour has a good camera. The blinds are better.", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 89 | Self::Pump => "A pump.", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 90 | Self::PumpPro => "Use technique=pump. Gains are temporary.", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 91 | Self::Extender => "Passive gains each turn. Takes up room. Can be removed with DELETE.", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 92 | Self::Ring => { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 93 | "Girth gains doubled. Rupture risk raised. Responses are compressed if you accept gzip. Can be removed with DELETE." |
782069860236 | atagen | 2026-10-10 12:44 UTC | 94 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 95 | Self::Supplement => "Use technique=supplement.", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 96 | Self::Cage => "Locked.", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 97 | Self::CageKey => "Pump-Bro does not ask.", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 98 | Self::Spreadsheet => "Charts your progress. Every line is flat.", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 99 | Self::TeapotSpout => "Does nothing. Cannot be dropped.", |
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 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 103 | pub fn pitch(self) -> &'static str { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 104 | match self { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 105 | Self::PumpPro => "A pump, but professional.", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 106 | Self::Extender => "Passive gains every turn. Takes up room.", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 107 | Self::Ring => "Doubles girth gains. Pump-Bro does not discuss the risks.", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 108 | Self::Supplement => "Clinically formulated. Ships from overseas.", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 109 | Self::DndSign => "Housekeeping respects it.", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 110 | Self::Blinds => "The neighbour has a good camera.", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 111 | Self::Ruler => "Pump-Bro does not recommend it.", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 112 | Self::IcePack => "Cold.", |
782069860236 | atagen | 2026-10-10 12:44 UTC | 113 | _ => self.description(), |
782069860236 | atagen | 2026-10-10 12:44 UTC | 114 | } |
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 | pub fn price(self) -> Option<u32> { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 118 | match self { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 119 | Self::Pump => Some(10), |
782069860236 | atagen | 2026-10-10 12:44 UTC | 120 | Self::PumpPro | Self::Extender | Self::CageKey => Some(15), |
782069860236 | atagen | 2026-10-10 12:44 UTC | 121 | Self::Ring => Some(8), |
782069860236 | atagen | 2026-10-10 12:44 UTC | 122 | Self::Supplement | Self::DoorLock | Self::DndSign | Self::Blinds | Self::Ruler => { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 123 | Some(5) |
782069860236 | atagen | 2026-10-10 12:44 UTC | 124 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 125 | Self::IcePack => Some(3), |
782069860236 | atagen | 2026-10-10 12:44 UTC | 126 | Self::WarmTowel | Self::Cage | Self::Spreadsheet | Self::TeapotSpout => None, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 127 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 128 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 129 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 130 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 131 | pub struct Items { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 132 | pub ruler: bool, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 133 | pub ice_packs: u32, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 134 | pub door_locks: u32, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 135 | pub dnd_sign: bool, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 136 | pub blinds: bool, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 137 | pub pump_pro: bool, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 138 | pub extender: bool, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 139 | pub ring: bool, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 140 | pub supplements: u32, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 141 | pub cage: bool, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 142 | pub spreadsheet: bool, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 143 | pub teapot_spout: bool, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 144 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 145 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 146 | impl Default for Items { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 147 | fn default() -> Self { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 148 | Self { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 149 | ruler: false, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 150 | ice_packs: STARTING_ICE_PACKS, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 151 | door_locks: 0, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 152 | dnd_sign: false, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 153 | blinds: false, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 154 | pump_pro: false, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 155 | extender: false, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 156 | ring: false, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 157 | supplements: 0, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 158 | cage: false, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 159 | spreadsheet: false, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 160 | teapot_spout: false, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 161 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 162 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 163 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 164 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 165 | impl Items { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 166 | pub fn has(&self, item: Item) -> bool { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 167 | match item { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 168 | Item::WarmTowel => true, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 169 | Item::IcePack => self.ice_packs > 0, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 170 | Item::Ruler => self.ruler, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 171 | Item::DoorLock => self.door_locks > 0, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 172 | Item::DndSign => self.dnd_sign, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 173 | Item::Blinds => self.blinds, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 174 | Item::PumpPro => self.pump_pro, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 175 | Item::Extender => self.extender, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 176 | Item::Ring => self.ring, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 177 | Item::Supplement => self.supplements > 0, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 178 | Item::Cage => self.cage, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 179 | Item::Spreadsheet => self.spreadsheet, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 180 | Item::TeapotSpout => self.teapot_spout, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 181 | Item::Pump | Item::CageKey => false, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 182 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 183 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 184 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 185 | pub fn owned(&self) -> Vec<Item> { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 186 | Item::ALL |
782069860236 | atagen | 2026-10-10 12:44 UTC | 187 | .into_iter() |
782069860236 | atagen | 2026-10-10 12:44 UTC | 188 | .filter(|&item| self.has(item)) |
782069860236 | atagen | 2026-10-10 12:44 UTC | 189 | .collect() |
782069860236 | atagen | 2026-10-10 12:44 UTC | 190 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 191 | |
782069860236 | atagen | 2026-10-10 12:44 UTC | 192 | pub fn grant(&mut self, item: Item) { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 193 | match item { |
782069860236 | atagen | 2026-10-10 12:44 UTC | 194 | Item::IcePack => self.ice_packs += 1, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 195 | Item::Ruler => self.ruler = true, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 196 | Item::DoorLock => self.door_locks += 1, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 197 | Item::DndSign => self.dnd_sign = true, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 198 | Item::Blinds => self.blinds = true, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 199 | Item::PumpPro => self.pump_pro = true, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 200 | Item::Extender => self.extender = true, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 201 | Item::Ring => self.ring = true, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 202 | Item::Supplement => self.supplements += 1, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 203 | Item::Cage => self.cage = true, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 204 | Item::CageKey => self.cage = false, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 205 | Item::Spreadsheet => self.spreadsheet = true, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 206 | Item::TeapotSpout => self.teapot_spout = true, |
782069860236 | atagen | 2026-10-10 12:44 UTC | 207 | Item::WarmTowel | Item::Pump => {} |
782069860236 | atagen | 2026-10-10 12:44 UTC | 208 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 209 | } |
782069860236 | atagen | 2026-10-10 12:44 UTC | 210 | } |