Skip to main content

cuqueclicker_lib/game/
fingerer.rs

1pub struct FingererStats {
2    /// Stable identifier used as the save-file key. Survives catalog reorders,
3    /// insertions, and cosmetic renames — so reshuffling tiers does NOT corrupt
4    /// a user's owned counts.
5    pub id: &'static str,
6    pub icon: &'static str,
7    pub base_cost: f64,
8    pub cost_scale: f64,
9    pub fps_per_unit: f64,
10    /// Multiplier on the orbital "poke" pulse rate in `ui::hands`. Higher =
11    /// fast, fidgety pokes (Index Finger); lower = slow, majestic, statelier
12    /// motion (Hand of God). Pure animation timing, no game effect — see
13    /// `hands::draw` for how it folds into the period divisor.
14    pub poke_speed: f32,
15}
16
17// Poke-speed scale: 1.0 = baseline pulse rate. Lower tiers are jittery
18// (>1.0); higher tiers are slow & majestic (<1.0). The numbers are author
19// taste — change freely, no game logic depends on them.
20pub const FINGERERS: &[FingererStats] = &[
21    FingererStats {
22        id: "index_finger",
23        icon: ">>",
24        base_cost: 15.0,
25        cost_scale: 1.15,
26        fps_per_unit: 0.1,
27        poke_speed: 2.4, // fidgety, twitchy
28    },
29    FingererStats {
30        id: "whole_hand",
31        icon: "[]",
32        base_cost: 100.0,
33        cost_scale: 1.15,
34        fps_per_unit: 1.0,
35        poke_speed: 1.8,
36    },
37    FingererStats {
38        id: "latex_glove",
39        icon: "<>",
40        base_cost: 1_100.0,
41        cost_scale: 1.15,
42        fps_per_unit: 8.0,
43        poke_speed: 1.5,
44    },
45    FingererStats {
46        id: "greek_kiss",
47        icon: ":*",
48        base_cost: 3_500.0,
49        cost_scale: 1.15,
50        fps_per_unit: 22.0,
51        poke_speed: 1.25,
52    },
53    FingererStats {
54        id: "robotic_finger",
55        icon: "##",
56        base_cost: 12_000.0,
57        cost_scale: 1.15,
58        fps_per_unit: 47.0,
59        poke_speed: 1.0, // baseline (mechanical, even cadence)
60    },
61    FingererStats {
62        id: "tentacle",
63        icon: "~~",
64        base_cost: 130_000.0,
65        cost_scale: 1.15,
66        fps_per_unit: 260.0,
67        poke_speed: 0.85,
68    },
69    FingererStats {
70        id: "finger_vortex",
71        icon: "@@",
72        base_cost: 1_400_000.0,
73        cost_scale: 1.15,
74        fps_per_unit: 1_400.0,
75        poke_speed: 0.7,
76    },
77    FingererStats {
78        id: "dimensional_hole",
79        icon: "()",
80        base_cost: 20_000_000.0,
81        cost_scale: 1.15,
82        fps_per_unit: 7_800.0,
83        poke_speed: 0.55,
84    },
85    FingererStats {
86        id: "cosmic_finger",
87        icon: "**",
88        base_cost: 330_000_000.0,
89        cost_scale: 1.15,
90        fps_per_unit: 44_000.0,
91        poke_speed: 0.4,
92    },
93    FingererStats {
94        id: "hand_of_god",
95        icon: "^^",
96        base_cost: 5_100_000_000.0,
97        cost_scale: 1.15,
98        fps_per_unit: 260_000.0,
99        poke_speed: 0.25, // slow, statelier — divine majesty
100    },
101];
102
103pub fn count() -> usize {
104    FINGERERS.len()
105}
106
107/// Whether a fingerer should be visible in the sidebar.
108/// Show when the player either already owns one, or their lifetime_cuques
109/// has reached half the base cost (so they can see what's coming).
110pub fn visible(idx: usize, owned: u32, lifetime_cuques: f64) -> bool {
111    if idx == 0 || owned > 0 {
112        return true;
113    }
114    let k = &FINGERERS[idx];
115    lifetime_cuques >= k.base_cost * 0.5
116}