an http based roguelike rpg about jelqing
Blame: src/game/arousal.rs
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 1 | use super::{ |
ea51d9fda49d | atagen | 2026-10-14 12:20 UTC | 2 | Cause, Ending, Run, |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 3 | balance::{DANGER_EQ, EQ_BAND, HOT_EQ, PREMATURE_EQ, RING_RUPTURE_LINE, RUPTURE_LINE}, |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 4 | }; |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 5 | |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 6 | /// What `X-EQ` shows in place of the number, cut on the lines the rolls already use. |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 7 | #[derive(Clone, Copy, Debug, PartialEq, Eq)] |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 8 | pub enum Arousal { |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 9 | Flaccid, |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 10 | Cold, |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 11 | Warm, |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 12 | Ideal, |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 13 | Swollen, |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 14 | Throbbing, |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 15 | Straining, |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 16 | Imminent, |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 17 | Priapic, |
ea51d9fda49d | atagen | 2026-10-14 12:20 UTC | 18 | Ruptured, |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 19 | } |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 20 | |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 21 | impl Arousal { |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 22 | pub fn name(self) -> &'static str { |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 23 | match self { |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 24 | Self::Flaccid => "Flaccid", |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 25 | Self::Cold => "Cold", |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 26 | Self::Warm => "Warm", |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 27 | Self::Ideal => "Ideal", |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 28 | Self::Swollen => "Swollen", |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 29 | Self::Throbbing => "Throbbing", |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 30 | Self::Straining => "Straining", |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 31 | Self::Imminent => "Imminent", |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 32 | Self::Priapic => "Priapic", |
ea51d9fda49d | atagen | 2026-10-14 12:20 UTC | 33 | Self::Ruptured => "Ruptured", |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 34 | } |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 35 | } |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 36 | } |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 37 | |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 38 | impl Run { |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 39 | pub(super) fn rupture_line(&self) -> i32 { |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 40 | if self.items.kit.ring { |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 41 | RING_RUPTURE_LINE |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 42 | } else { |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 43 | RUPTURE_LINE |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 44 | } |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 45 | } |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 46 | |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 47 | pub fn arousal(&self) -> Arousal { |
ea51d9fda49d | atagen | 2026-10-14 12:20 UTC | 48 | if matches!( |
ea51d9fda49d | atagen | 2026-10-14 12:20 UTC | 49 | self.ended, |
ea51d9fda49d | atagen | 2026-10-14 12:20 UTC | 50 | Some(Ending { |
ea51d9fda49d | atagen | 2026-10-14 12:20 UTC | 51 | cause: Cause::Ruptured { .. }, |
ea51d9fda49d | atagen | 2026-10-14 12:20 UTC | 52 | .. |
ea51d9fda49d | atagen | 2026-10-14 12:20 UTC | 53 | }) |
ea51d9fda49d | atagen | 2026-10-14 12:20 UTC | 54 | ) { |
ea51d9fda49d | atagen | 2026-10-14 12:20 UTC | 55 | Arousal::Ruptured |
ea51d9fda49d | atagen | 2026-10-14 12:20 UTC | 56 | } else if self.body.conditions.priapism_turns > 0 { |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 57 | Arousal::Priapic |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 58 | } else if self.hotter_than(PREMATURE_EQ) { |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 59 | Arousal::Imminent |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 60 | } else if self.hotter_than(self.rupture_line()) { |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 61 | Arousal::Straining |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 62 | } else if self.hotter_than(HOT_EQ) { |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 63 | Arousal::Throbbing |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 64 | } else if self.hotter_than(DANGER_EQ) { |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 65 | Arousal::Swollen |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 66 | } else if EQ_BAND.contains(&self.body.eq) { |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 67 | Arousal::Ideal |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 68 | } else if self.body.eq == 0 { |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 69 | Arousal::Flaccid |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 70 | } else if self.cold() { |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 71 | Arousal::Cold |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 72 | } else { |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 73 | Arousal::Warm |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 74 | } |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 75 | } |
e028a4184d00 | atagen | 2026-10-14 10:49 UTC | 76 | } |