atagen

jelq

public

an http based roguelike rpg about jelqing

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

Blame: src/game/floor.rs

782069860236atagen2026-10-10 12:44 UTC1
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
782069860236atagen2026-10-10 12:44 UTC2
#[repr(u8)]
782069860236atagen2026-10-10 12:44 UTC3
pub enum Floor {
782069860236atagen2026-10-10 12:44 UTC4
    Bedroom = 1,
782069860236atagen2026-10-10 12:44 UTC5
    Bathroom = 2,
9683736a2c5eatagen2026-10-10 13:15 UTC6
    ChangingRoom = 3,
9683736a2c5eatagen2026-10-10 13:15 UTC7
    Nans = 4,
782069860236atagen2026-10-10 12:44 UTC8
    Hotel = 5,
782069860236atagen2026-10-10 12:44 UTC9
    Forum = 6,
782069860236atagen2026-10-10 12:44 UTC10
    Clinic = 7,
782069860236atagen2026-10-10 12:44 UTC11
}
782069860236atagen2026-10-10 12:44 UTC12
782069860236atagen2026-10-10 12:44 UTC13
impl Floor {
782069860236atagen2026-10-10 12:44 UTC14
    pub fn number(self) -> u8 {
782069860236atagen2026-10-10 12:44 UTC15
        self as u8
782069860236atagen2026-10-10 12:44 UTC16
    }
782069860236atagen2026-10-10 12:44 UTC17
782069860236atagen2026-10-10 12:44 UTC18
    pub fn next(self) -> Option<Self> {
782069860236atagen2026-10-10 12:44 UTC19
        match self {
782069860236atagen2026-10-10 12:44 UTC20
            Self::Bedroom => Some(Self::Bathroom),
9683736a2c5eatagen2026-10-10 13:15 UTC21
            Self::Bathroom => Some(Self::ChangingRoom),
9683736a2c5eatagen2026-10-10 13:15 UTC22
            Self::ChangingRoom => Some(Self::Nans),
9683736a2c5eatagen2026-10-10 13:15 UTC23
            Self::Nans => Some(Self::Hotel),
782069860236atagen2026-10-10 12:44 UTC24
            Self::Hotel => Some(Self::Forum),
782069860236atagen2026-10-10 12:44 UTC25
            Self::Forum => Some(Self::Clinic),
782069860236atagen2026-10-10 12:44 UTC26
            Self::Clinic => None,
782069860236atagen2026-10-10 12:44 UTC27
        }
782069860236atagen2026-10-10 12:44 UTC28
    }
782069860236atagen2026-10-10 12:44 UTC29
782069860236atagen2026-10-10 12:44 UTC30
    pub fn name(self) -> &'static str {
782069860236atagen2026-10-10 12:44 UTC31
        match self {
782069860236atagen2026-10-10 12:44 UTC32
            Self::Bedroom => "the bedroom",
782069860236atagen2026-10-10 12:44 UTC33
            Self::Bathroom => "the shared bathroom",
9683736a2c5eatagen2026-10-10 13:15 UTC34
            Self::ChangingRoom => "the gym changing room",
9683736a2c5eatagen2026-10-10 13:15 UTC35
            Self::Nans => "Nan's house at Christmas",
782069860236atagen2026-10-10 12:44 UTC36
            Self::Hotel => "a business trip hotel",
782069860236atagen2026-10-10 12:44 UTC37
            Self::Forum => "the forum",
782069860236atagen2026-10-10 12:44 UTC38
            Self::Clinic => "the urologist's office",
782069860236atagen2026-10-10 12:44 UTC39
        }
782069860236atagen2026-10-10 12:44 UTC40
    }
782069860236atagen2026-10-10 12:44 UTC41
8b8e83329a1datagen2026-10-12 12:01 UTC42
    pub fn place(self) -> &'static str {
8b8e83329a1datagen2026-10-12 12:01 UTC43
        match self {
8b8e83329a1datagen2026-10-12 12:01 UTC44
            Self::Bedroom => "the bedroom",
8b8e83329a1datagen2026-10-12 12:01 UTC45
            Self::Bathroom => "the bathroom",
8b8e83329a1datagen2026-10-12 12:01 UTC46
            Self::ChangingRoom => "the changing room",
8b8e83329a1datagen2026-10-12 12:01 UTC47
            Self::Nans => "Nan's house",
8b8e83329a1datagen2026-10-12 12:01 UTC48
            Self::Hotel => "the hotel room",
8b8e83329a1datagen2026-10-12 12:01 UTC49
            Self::Forum => "the forum floor",
8b8e83329a1datagen2026-10-12 12:01 UTC50
            Self::Clinic => "the clinic",
8b8e83329a1datagen2026-10-12 12:01 UTC51
        }
8b8e83329a1datagen2026-10-12 12:01 UTC52
    }
8b8e83329a1datagen2026-10-12 12:01 UTC53
782069860236atagen2026-10-10 12:44 UTC54
    pub fn note(self) -> &'static str {
782069860236atagen2026-10-10 12:44 UTC55
        match self {
782069860236atagen2026-10-10 12:44 UTC56
            Self::Bedroom => "The door does not lock. The cat is present.",
7d3fb63208bfatagen2026-10-11 04:38 UTC57
            Self::Bathroom => "The water is hot. Your brother showers at eight.",
9683736a2c5eatagen2026-10-10 13:15 UTC58
            Self::ChangingRoom => {
782069860236atagen2026-10-10 12:44 UTC59
                "It is cold. Discretion is advised. Everyone here is lying. Pump-Bro is by the lockers."
782069860236atagen2026-10-10 12:44 UTC60
            }
9683736a2c5eatagen2026-10-10 13:15 UTC61
            Self::Nans => {
9683736a2c5eatagen2026-10-10 13:15 UTC62
                "The walls are thin. Mum is here, and she has been reading about Digest authentication."
782069860236atagen2026-10-10 12:44 UTC63
            }
782069860236atagen2026-10-10 12:44 UTC64
            Self::Hotel => {
782069860236atagen2026-10-10 12:44 UTC65
                "The wifi requires agreement. Housekeeping does not knock. Pump-Bro is in the lobby."
782069860236atagen2026-10-10 12:44 UTC66
            }
782069860236atagen2026-10-10 12:44 UTC67
            Self::Forum => "Nothing physical happens here. The Elder has a spreadsheet.",
782069860236atagen2026-10-10 12:44 UTC68
            Self::Clinic => "The urologist will see you now. He is bored.",
782069860236atagen2026-10-10 12:44 UTC69
        }
782069860236atagen2026-10-10 12:44 UTC70
    }
782069860236atagen2026-10-10 12:44 UTC71
782069860236atagen2026-10-10 12:44 UTC72
    pub fn observer(self) -> Option<Observer> {
782069860236atagen2026-10-10 12:44 UTC73
        match self {
782069860236atagen2026-10-10 12:44 UTC74
            Self::Bedroom => Some(Observer::Cat),
9683736a2c5eatagen2026-10-10 13:15 UTC75
            Self::ChangingRoom => Some(Observer::Greg),
9683736a2c5eatagen2026-10-10 13:15 UTC76
            Self::Nans => Some(Observer::Nan),
782069860236atagen2026-10-10 12:44 UTC77
            _ => None,
782069860236atagen2026-10-10 12:44 UTC78
        }
782069860236atagen2026-10-10 12:44 UTC79
    }
782069860236atagen2026-10-10 12:44 UTC80
9683736a2c5eatagen2026-10-10 13:15 UTC81
    pub fn has_mum(self) -> bool {
9683736a2c5eatagen2026-10-10 13:15 UTC82
        matches!(self, Self::Bedroom | Self::Nans)
782069860236atagen2026-10-10 12:44 UTC83
    }
782069860236atagen2026-10-10 12:44 UTC84
782069860236atagen2026-10-10 12:44 UTC85
    pub fn has_window(self) -> bool {
9683736a2c5eatagen2026-10-10 13:15 UTC86
        matches!(self, Self::Bedroom | Self::Nans | Self::Hotel)
782069860236atagen2026-10-10 12:44 UTC87
    }
782069860236atagen2026-10-10 12:44 UTC88
782069860236atagen2026-10-10 12:44 UTC89
    pub fn shop_open(self) -> bool {
9683736a2c5eatagen2026-10-10 13:15 UTC90
        matches!(self, Self::ChangingRoom | Self::Hotel)
782069860236atagen2026-10-10 12:44 UTC91
    }
782069860236atagen2026-10-10 12:44 UTC92
0a0bfee8329eatagen2026-10-11 05:11 UTC93
    pub fn has_kitchen(self) -> bool {
0a0bfee8329eatagen2026-10-11 05:11 UTC94
        matches!(self, Self::Bedroom | Self::Nans)
0a0bfee8329eatagen2026-10-11 05:11 UTC95
    }
0a0bfee8329eatagen2026-10-11 05:11 UTC96
782069860236atagen2026-10-10 12:44 UTC97
    pub fn timed(self) -> bool {
782069860236atagen2026-10-10 12:44 UTC98
        !matches!(self, Self::Forum | Self::Clinic)
782069860236atagen2026-10-10 12:44 UTC99
    }
782069860236atagen2026-10-10 12:44 UTC100
}
782069860236atagen2026-10-10 12:44 UTC101
782069860236atagen2026-10-10 12:44 UTC102
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
782069860236atagen2026-10-10 12:44 UTC103
pub enum Observer {
782069860236atagen2026-10-10 12:44 UTC104
    Cat,
782069860236atagen2026-10-10 12:44 UTC105
    Greg,
9683736a2c5eatagen2026-10-10 13:15 UTC106
    Nan,
782069860236atagen2026-10-10 12:44 UTC107
}
782069860236atagen2026-10-10 12:44 UTC108
782069860236atagen2026-10-10 12:44 UTC109
impl Observer {
782069860236atagen2026-10-10 12:44 UTC110
    pub fn name(self) -> &'static str {
782069860236atagen2026-10-10 12:44 UTC111
        match self {
782069860236atagen2026-10-10 12:44 UTC112
            Self::Cat => "cat",
782069860236atagen2026-10-10 12:44 UTC113
            Self::Greg => "greg",
9683736a2c5eatagen2026-10-10 13:15 UTC114
            Self::Nan => "nan",
782069860236atagen2026-10-10 12:44 UTC115
        }
782069860236atagen2026-10-10 12:44 UTC116
    }
782069860236atagen2026-10-10 12:44 UTC117
}
782069860236atagen2026-10-10 12:44 UTC118
782069860236atagen2026-10-10 12:44 UTC119
/// State that belongs to the current floor and resets when you leave it.
782069860236atagen2026-10-10 12:44 UTC120
#[derive(Default)]
782069860236atagen2026-10-10 12:44 UTC121
pub struct FloorState {
8b8e83329a1datagen2026-10-12 12:01 UTC122
    pub(crate) turns: u32,
8b8e83329a1datagen2026-10-12 12:01 UTC123
    pub(crate) warm_arrival: bool,
8b8e83329a1datagen2026-10-12 12:01 UTC124
    pub(crate) drawer: Drawer,
8b8e83329a1datagen2026-10-12 12:01 UTC125
    pub(crate) kitchen: KitchenVisit,
8b8e83329a1datagen2026-10-12 12:01 UTC126
    pub(crate) thread_rolls: u8,
8b8e83329a1datagen2026-10-12 12:01 UTC127
    pub(crate) edges: u8,
8b8e83329a1datagen2026-10-12 12:01 UTC128
    pub(crate) temp_length: f64,
8b8e83329a1datagen2026-10-12 12:01 UTC129
    pub(crate) teapot: bool,
8b8e83329a1datagen2026-10-12 12:01 UTC130
    pub(crate) towel_stolen: bool,
4b1f5f88827datagen2026-10-13 10:18 UTC131
    pub(crate) towel_warmed: bool,
8b8e83329a1datagen2026-10-12 12:01 UTC132
    pub(crate) meditated: bool,
8b8e83329a1datagen2026-10-12 12:01 UTC133
    pub(crate) brother_told: bool,
8b8e83329a1datagen2026-10-12 12:01 UTC134
    pub(crate) shopping: bool,
8b8e83329a1datagen2026-10-12 12:01 UTC135
    pub(crate) wifi_accepted: bool,
782069860236atagen2026-10-10 12:44 UTC136
}
782069860236atagen2026-10-10 12:44 UTC137
782069860236atagen2026-10-10 12:44 UTC138
#[derive(Default)]
8b8e83329a1datagen2026-10-12 12:01 UTC139
pub struct Drawer {
8b8e83329a1datagen2026-10-12 12:01 UTC140
    pub(crate) searched: bool,
8b8e83329a1datagen2026-10-12 12:01 UTC141
    pub(crate) jammed: bool,
782069860236atagen2026-10-10 12:44 UTC142
}
782069860236atagen2026-10-10 12:44 UTC143
782069860236atagen2026-10-10 12:44 UTC144
#[derive(Default)]
8b8e83329a1datagen2026-10-12 12:01 UTC145
pub struct KitchenVisit {
8b8e83329a1datagen2026-10-12 12:01 UTC146
    pub(crate) kettle_boiled: bool,
f16ab17c8ff6atagen2026-10-13 11:14 UTC147
    pub(crate) closed: bool,
8b8e83329a1datagen2026-10-12 12:01 UTC148
    pub(crate) melon_offered: bool,
782069860236atagen2026-10-10 12:44 UTC149
}