atagen

jelq

public

an http based roguelike rpg about jelqing

Star0
Watch0
beabb5985f4a6e2cdc6fa8ab67e7e6c7c31333e8
1
ssh://brewery@pls.lobotomise.me:33/atagen/jelq.git
src/game/arousal.rsRust66 lines1.7 KB
1
use super::{
2
    Run,
3
    balance::{DANGER_EQ, EQ_BAND, HOT_EQ, PREMATURE_EQ, RING_RUPTURE_LINE, RUPTURE_LINE},
4
};
5
6
/// What `X-EQ` shows in place of the number, cut on the lines the rolls already use.
7
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8
pub enum Arousal {
9
    Flaccid,
10
    Cold,
11
    Warm,
12
    Ideal,
13
    Swollen,
14
    Throbbing,
15
    Straining,
16
    Imminent,
17
    Priapic,
18
}
19
20
impl Arousal {
21
    pub fn name(self) -> &'static str {
22
        match self {
23
            Self::Flaccid => "Flaccid",
24
            Self::Cold => "Cold",
25
            Self::Warm => "Warm",
26
            Self::Ideal => "Ideal",
27
            Self::Swollen => "Swollen",
28
            Self::Throbbing => "Throbbing",
29
            Self::Straining => "Straining",
30
            Self::Imminent => "Imminent",
31
            Self::Priapic => "Priapic",
32
        }
33
    }
34
}
35
36
impl Run {
37
    pub(super) fn rupture_line(&self) -> i32 {
38
        if self.items.kit.ring {
39
            RING_RUPTURE_LINE
40
        } else {
41
            RUPTURE_LINE
42
        }
43
    }
44
45
    pub fn arousal(&self) -> Arousal {
46
        if self.body.conditions.priapism_turns > 0 {
47
            Arousal::Priapic
48
        } else if self.hotter_than(PREMATURE_EQ) {
49
            Arousal::Imminent
50
        } else if self.hotter_than(self.rupture_line()) {
51
            Arousal::Straining
52
        } else if self.hotter_than(HOT_EQ) {
53
            Arousal::Throbbing
54
        } else if self.hotter_than(DANGER_EQ) {
55
            Arousal::Swollen
56
        } else if EQ_BAND.contains(&self.body.eq) {
57
            Arousal::Ideal
58
        } else if self.body.eq == 0 {
59
            Arousal::Flaccid
60
        } else if self.cold() {
61
            Arousal::Cold
62
        } else {
63
            Arousal::Warm
64
        }
65
    }
66
}