atagen

jelq

public

an http based roguelike rpg about jelqing

Star0
Watch0
585e6b7ce08636105da83cdbed5ff24679d0db4d
1
ssh://brewery@pls.lobotomise.me:33/atagen/jelq.git

Blame: src/game/items.rs

782069860236atagen2026-10-10 12:44 UTC1
use super::balance::STARTING_ICE_PACKS;
782069860236atagen2026-10-10 12:44 UTC2
782069860236atagen2026-10-10 12:44 UTC3
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
782069860236atagen2026-10-10 12:44 UTC4
pub enum Item {
782069860236atagen2026-10-10 12:44 UTC5
    WarmTowel,
782069860236atagen2026-10-10 12:44 UTC6
    IcePack,
782069860236atagen2026-10-10 12:44 UTC7
    Ruler,
782069860236atagen2026-10-10 12:44 UTC8
    DoorLock,
782069860236atagen2026-10-10 12:44 UTC9
    DndSign,
782069860236atagen2026-10-10 12:44 UTC10
    Blinds,
782069860236atagen2026-10-10 12:44 UTC11
    Pump,
782069860236atagen2026-10-10 12:44 UTC12
    PumpPro,
782069860236atagen2026-10-10 12:44 UTC13
    Extender,
782069860236atagen2026-10-10 12:44 UTC14
    Ring,
782069860236atagen2026-10-10 12:44 UTC15
    Supplement,
782069860236atagen2026-10-10 12:44 UTC16
    Cage,
782069860236atagen2026-10-10 12:44 UTC17
    CageKey,
782069860236atagen2026-10-10 12:44 UTC18
    Spreadsheet,
782069860236atagen2026-10-10 12:44 UTC19
    TeapotSpout,
782069860236atagen2026-10-10 12:44 UTC20
}
782069860236atagen2026-10-10 12:44 UTC21
782069860236atagen2026-10-10 12:44 UTC22
pub const SHOP: [Item; 11] = [
782069860236atagen2026-10-10 12:44 UTC23
    Item::Pump,
782069860236atagen2026-10-10 12:44 UTC24
    Item::PumpPro,
782069860236atagen2026-10-10 12:44 UTC25
    Item::Extender,
782069860236atagen2026-10-10 12:44 UTC26
    Item::Ring,
782069860236atagen2026-10-10 12:44 UTC27
    Item::Supplement,
782069860236atagen2026-10-10 12:44 UTC28
    Item::DoorLock,
782069860236atagen2026-10-10 12:44 UTC29
    Item::DndSign,
782069860236atagen2026-10-10 12:44 UTC30
    Item::Blinds,
782069860236atagen2026-10-10 12:44 UTC31
    Item::Ruler,
782069860236atagen2026-10-10 12:44 UTC32
    Item::IcePack,
782069860236atagen2026-10-10 12:44 UTC33
    Item::CageKey,
782069860236atagen2026-10-10 12:44 UTC34
];
782069860236atagen2026-10-10 12:44 UTC35
782069860236atagen2026-10-10 12:44 UTC36
impl Item {
782069860236atagen2026-10-10 12:44 UTC37
    const ALL: [Self; 15] = [
782069860236atagen2026-10-10 12:44 UTC38
        Self::WarmTowel,
782069860236atagen2026-10-10 12:44 UTC39
        Self::IcePack,
782069860236atagen2026-10-10 12:44 UTC40
        Self::Ruler,
782069860236atagen2026-10-10 12:44 UTC41
        Self::DoorLock,
782069860236atagen2026-10-10 12:44 UTC42
        Self::DndSign,
782069860236atagen2026-10-10 12:44 UTC43
        Self::Blinds,
782069860236atagen2026-10-10 12:44 UTC44
        Self::Pump,
782069860236atagen2026-10-10 12:44 UTC45
        Self::PumpPro,
782069860236atagen2026-10-10 12:44 UTC46
        Self::Extender,
782069860236atagen2026-10-10 12:44 UTC47
        Self::Ring,
782069860236atagen2026-10-10 12:44 UTC48
        Self::Supplement,
782069860236atagen2026-10-10 12:44 UTC49
        Self::Cage,
782069860236atagen2026-10-10 12:44 UTC50
        Self::CageKey,
782069860236atagen2026-10-10 12:44 UTC51
        Self::Spreadsheet,
782069860236atagen2026-10-10 12:44 UTC52
        Self::TeapotSpout,
782069860236atagen2026-10-10 12:44 UTC53
    ];
782069860236atagen2026-10-10 12:44 UTC54
782069860236atagen2026-10-10 12:44 UTC55
    pub fn slug(self) -> &'static str {
782069860236atagen2026-10-10 12:44 UTC56
        match self {
782069860236atagen2026-10-10 12:44 UTC57
            Self::WarmTowel => "warm-towel",
782069860236atagen2026-10-10 12:44 UTC58
            Self::IcePack => "ice-pack",
782069860236atagen2026-10-10 12:44 UTC59
            Self::Ruler => "ruler",
782069860236atagen2026-10-10 12:44 UTC60
            Self::DoorLock => "door-lock",
782069860236atagen2026-10-10 12:44 UTC61
            Self::DndSign => "do-not-disturb-sign",
782069860236atagen2026-10-10 12:44 UTC62
            Self::Blinds => "window-blinds",
782069860236atagen2026-10-10 12:44 UTC63
            Self::Pump => "pump",
782069860236atagen2026-10-10 12:44 UTC64
            Self::PumpPro => "pump-pro",
782069860236atagen2026-10-10 12:44 UTC65
            Self::Extender => "extender",
782069860236atagen2026-10-10 12:44 UTC66
            Self::Ring => "cock-ring",
782069860236atagen2026-10-10 12:44 UTC67
            Self::Supplement => "supplement",
782069860236atagen2026-10-10 12:44 UTC68
            Self::Cage => "chastity-cage",
782069860236atagen2026-10-10 12:44 UTC69
            Self::CageKey => "cage-key",
782069860236atagen2026-10-10 12:44 UTC70
            Self::Spreadsheet => "spreadsheet",
782069860236atagen2026-10-10 12:44 UTC71
            Self::TeapotSpout => "teapot-spout",
782069860236atagen2026-10-10 12:44 UTC72
        }
782069860236atagen2026-10-10 12:44 UTC73
    }
782069860236atagen2026-10-10 12:44 UTC74
782069860236atagen2026-10-10 12:44 UTC75
    pub fn parse(slug: &str) -> Option<Self> {
782069860236atagen2026-10-10 12:44 UTC76
        Self::ALL.into_iter().find(|item| item.slug() == slug)
782069860236atagen2026-10-10 12:44 UTC77
    }
782069860236atagen2026-10-10 12:44 UTC78
782069860236atagen2026-10-10 12:44 UTC79
    pub fn description(self) -> &'static str {
782069860236atagen2026-10-10 12:44 UTC80
        match self {
782069860236atagen2026-10-10 12:44 UTC81
            Self::WarmTowel => {
782069860236atagen2026-10-10 12:44 UTC82
                "Reusable. Satisfies the warm-up precondition. Use technique=warmup."
782069860236atagen2026-10-10 12:44 UTC83
            }
782069860236atagen2026-10-10 12:44 UTC84
            Self::IcePack => "Lowers EQ by 40. Use technique=ice.",
782069860236atagen2026-10-10 12:44 UTC85
            Self::Ruler => "Measures honestly. The length resource now carries a Content-Length.",
9683736a2c5eatagen2026-10-10 13:15 UTC86
            Self::DoorLock => "Keeps the flatmate out once.",
9683736a2c5eatagen2026-10-10 13:15 UTC87
            Self::DndSign => "Works on housekeeping. Mum does not read signs.",
782069860236atagen2026-10-10 12:44 UTC88
            Self::Blinds => "The neighbour has a good camera. The blinds are better.",
782069860236atagen2026-10-10 12:44 UTC89
            Self::Pump => "A pump.",
782069860236atagen2026-10-10 12:44 UTC90
            Self::PumpPro => "Use technique=pump. Gains are temporary.",
782069860236atagen2026-10-10 12:44 UTC91
            Self::Extender => "Passive gains each turn. Takes up room. Can be removed with DELETE.",
782069860236atagen2026-10-10 12:44 UTC92
            Self::Ring => {
782069860236atagen2026-10-10 12:44 UTC93
                "Girth gains doubled. Rupture risk raised. Responses are compressed if you accept gzip. Can be removed with DELETE."
782069860236atagen2026-10-10 12:44 UTC94
            }
782069860236atagen2026-10-10 12:44 UTC95
            Self::Supplement => "Use technique=supplement.",
782069860236atagen2026-10-10 12:44 UTC96
            Self::Cage => "Locked.",
782069860236atagen2026-10-10 12:44 UTC97
            Self::CageKey => "Pump-Bro does not ask.",
782069860236atagen2026-10-10 12:44 UTC98
            Self::Spreadsheet => "Charts your progress. Every line is flat.",
782069860236atagen2026-10-10 12:44 UTC99
            Self::TeapotSpout => "Does nothing. Cannot be dropped.",
782069860236atagen2026-10-10 12:44 UTC100
        }
782069860236atagen2026-10-10 12:44 UTC101
    }
782069860236atagen2026-10-10 12:44 UTC102
782069860236atagen2026-10-10 12:44 UTC103
    pub fn pitch(self) -> &'static str {
782069860236atagen2026-10-10 12:44 UTC104
        match self {
782069860236atagen2026-10-10 12:44 UTC105
            Self::PumpPro => "A pump, but professional.",
782069860236atagen2026-10-10 12:44 UTC106
            Self::Extender => "Passive gains every turn. Takes up room.",
782069860236atagen2026-10-10 12:44 UTC107
            Self::Ring => "Doubles girth gains. Pump-Bro does not discuss the risks.",
782069860236atagen2026-10-10 12:44 UTC108
            Self::Supplement => "Clinically formulated. Ships from overseas.",
782069860236atagen2026-10-10 12:44 UTC109
            Self::DndSign => "Housekeeping respects it.",
782069860236atagen2026-10-10 12:44 UTC110
            Self::Blinds => "The neighbour has a good camera.",
782069860236atagen2026-10-10 12:44 UTC111
            Self::Ruler => "Pump-Bro does not recommend it.",
782069860236atagen2026-10-10 12:44 UTC112
            Self::IcePack => "Cold.",
782069860236atagen2026-10-10 12:44 UTC113
            _ => self.description(),
782069860236atagen2026-10-10 12:44 UTC114
        }
782069860236atagen2026-10-10 12:44 UTC115
    }
782069860236atagen2026-10-10 12:44 UTC116
782069860236atagen2026-10-10 12:44 UTC117
    pub fn price(self) -> Option<u32> {
782069860236atagen2026-10-10 12:44 UTC118
        match self {
782069860236atagen2026-10-10 12:44 UTC119
            Self::Pump => Some(10),
782069860236atagen2026-10-10 12:44 UTC120
            Self::PumpPro | Self::Extender | Self::CageKey => Some(15),
782069860236atagen2026-10-10 12:44 UTC121
            Self::Ring => Some(8),
782069860236atagen2026-10-10 12:44 UTC122
            Self::Supplement | Self::DoorLock | Self::DndSign | Self::Blinds | Self::Ruler => {
782069860236atagen2026-10-10 12:44 UTC123
                Some(5)
782069860236atagen2026-10-10 12:44 UTC124
            }
782069860236atagen2026-10-10 12:44 UTC125
            Self::IcePack => Some(3),
782069860236atagen2026-10-10 12:44 UTC126
            Self::WarmTowel | Self::Cage | Self::Spreadsheet | Self::TeapotSpout => None,
782069860236atagen2026-10-10 12:44 UTC127
        }
782069860236atagen2026-10-10 12:44 UTC128
    }
782069860236atagen2026-10-10 12:44 UTC129
}
782069860236atagen2026-10-10 12:44 UTC130
782069860236atagen2026-10-10 12:44 UTC131
pub struct Items {
782069860236atagen2026-10-10 12:44 UTC132
    pub ruler: bool,
782069860236atagen2026-10-10 12:44 UTC133
    pub ice_packs: u32,
782069860236atagen2026-10-10 12:44 UTC134
    pub door_locks: u32,
782069860236atagen2026-10-10 12:44 UTC135
    pub dnd_sign: bool,
782069860236atagen2026-10-10 12:44 UTC136
    pub blinds: bool,
782069860236atagen2026-10-10 12:44 UTC137
    pub pump_pro: bool,
782069860236atagen2026-10-10 12:44 UTC138
    pub extender: bool,
782069860236atagen2026-10-10 12:44 UTC139
    pub ring: bool,
782069860236atagen2026-10-10 12:44 UTC140
    pub supplements: u32,
782069860236atagen2026-10-10 12:44 UTC141
    pub cage: bool,
782069860236atagen2026-10-10 12:44 UTC142
    pub spreadsheet: bool,
782069860236atagen2026-10-10 12:44 UTC143
    pub teapot_spout: bool,
782069860236atagen2026-10-10 12:44 UTC144
}
782069860236atagen2026-10-10 12:44 UTC145
782069860236atagen2026-10-10 12:44 UTC146
impl Default for Items {
782069860236atagen2026-10-10 12:44 UTC147
    fn default() -> Self {
782069860236atagen2026-10-10 12:44 UTC148
        Self {
782069860236atagen2026-10-10 12:44 UTC149
            ruler: false,
782069860236atagen2026-10-10 12:44 UTC150
            ice_packs: STARTING_ICE_PACKS,
782069860236atagen2026-10-10 12:44 UTC151
            door_locks: 0,
782069860236atagen2026-10-10 12:44 UTC152
            dnd_sign: false,
782069860236atagen2026-10-10 12:44 UTC153
            blinds: false,
782069860236atagen2026-10-10 12:44 UTC154
            pump_pro: false,
782069860236atagen2026-10-10 12:44 UTC155
            extender: false,
782069860236atagen2026-10-10 12:44 UTC156
            ring: false,
782069860236atagen2026-10-10 12:44 UTC157
            supplements: 0,
782069860236atagen2026-10-10 12:44 UTC158
            cage: false,
782069860236atagen2026-10-10 12:44 UTC159
            spreadsheet: false,
782069860236atagen2026-10-10 12:44 UTC160
            teapot_spout: false,
782069860236atagen2026-10-10 12:44 UTC161
        }
782069860236atagen2026-10-10 12:44 UTC162
    }
782069860236atagen2026-10-10 12:44 UTC163
}
782069860236atagen2026-10-10 12:44 UTC164
782069860236atagen2026-10-10 12:44 UTC165
impl Items {
782069860236atagen2026-10-10 12:44 UTC166
    pub fn has(&self, item: Item) -> bool {
782069860236atagen2026-10-10 12:44 UTC167
        match item {
782069860236atagen2026-10-10 12:44 UTC168
            Item::WarmTowel => true,
782069860236atagen2026-10-10 12:44 UTC169
            Item::IcePack => self.ice_packs > 0,
782069860236atagen2026-10-10 12:44 UTC170
            Item::Ruler => self.ruler,
782069860236atagen2026-10-10 12:44 UTC171
            Item::DoorLock => self.door_locks > 0,
782069860236atagen2026-10-10 12:44 UTC172
            Item::DndSign => self.dnd_sign,
782069860236atagen2026-10-10 12:44 UTC173
            Item::Blinds => self.blinds,
782069860236atagen2026-10-10 12:44 UTC174
            Item::PumpPro => self.pump_pro,
782069860236atagen2026-10-10 12:44 UTC175
            Item::Extender => self.extender,
782069860236atagen2026-10-10 12:44 UTC176
            Item::Ring => self.ring,
782069860236atagen2026-10-10 12:44 UTC177
            Item::Supplement => self.supplements > 0,
782069860236atagen2026-10-10 12:44 UTC178
            Item::Cage => self.cage,
782069860236atagen2026-10-10 12:44 UTC179
            Item::Spreadsheet => self.spreadsheet,
782069860236atagen2026-10-10 12:44 UTC180
            Item::TeapotSpout => self.teapot_spout,
782069860236atagen2026-10-10 12:44 UTC181
            Item::Pump | Item::CageKey => false,
782069860236atagen2026-10-10 12:44 UTC182
        }
782069860236atagen2026-10-10 12:44 UTC183
    }
782069860236atagen2026-10-10 12:44 UTC184
782069860236atagen2026-10-10 12:44 UTC185
    pub fn owned(&self) -> Vec<Item> {
782069860236atagen2026-10-10 12:44 UTC186
        Item::ALL
782069860236atagen2026-10-10 12:44 UTC187
            .into_iter()
782069860236atagen2026-10-10 12:44 UTC188
            .filter(|&item| self.has(item))
782069860236atagen2026-10-10 12:44 UTC189
            .collect()
782069860236atagen2026-10-10 12:44 UTC190
    }
782069860236atagen2026-10-10 12:44 UTC191
782069860236atagen2026-10-10 12:44 UTC192
    pub fn grant(&mut self, item: Item) {
782069860236atagen2026-10-10 12:44 UTC193
        match item {
782069860236atagen2026-10-10 12:44 UTC194
            Item::IcePack => self.ice_packs += 1,
782069860236atagen2026-10-10 12:44 UTC195
            Item::Ruler => self.ruler = true,
782069860236atagen2026-10-10 12:44 UTC196
            Item::DoorLock => self.door_locks += 1,
782069860236atagen2026-10-10 12:44 UTC197
            Item::DndSign => self.dnd_sign = true,
782069860236atagen2026-10-10 12:44 UTC198
            Item::Blinds => self.blinds = true,
782069860236atagen2026-10-10 12:44 UTC199
            Item::PumpPro => self.pump_pro = true,
782069860236atagen2026-10-10 12:44 UTC200
            Item::Extender => self.extender = true,
782069860236atagen2026-10-10 12:44 UTC201
            Item::Ring => self.ring = true,
782069860236atagen2026-10-10 12:44 UTC202
            Item::Supplement => self.supplements += 1,
782069860236atagen2026-10-10 12:44 UTC203
            Item::Cage => self.cage = true,
782069860236atagen2026-10-10 12:44 UTC204
            Item::CageKey => self.cage = false,
782069860236atagen2026-10-10 12:44 UTC205
            Item::Spreadsheet => self.spreadsheet = true,
782069860236atagen2026-10-10 12:44 UTC206
            Item::TeapotSpout => self.teapot_spout = true,
782069860236atagen2026-10-10 12:44 UTC207
            Item::WarmTowel | Item::Pump => {}
782069860236atagen2026-10-10 12:44 UTC208
        }
782069860236atagen2026-10-10 12:44 UTC209
    }
782069860236atagen2026-10-10 12:44 UTC210
}