pub enum PowerupKind {
Lucky,
Frenzy,
Buff,
GreenCoin,
}Expand description
Stable discriminator for every kind of powerup. Order also defines the
indexing into GameState::powerup_cooldowns: [u32; N_KINDS], so don’t
reorder once shipped — a save written under one ordering would index a
different kind’s cooldown after a swap. (Cooldowns are #[serde(skip)]
today, so the actual blast radius is “fresh-load reseeds them anyway,”
but treat the order as stable to keep test fixtures honest.)
Variants§
Lucky
Instant flat reward: max(10, fps * 60s) cuques. No buff, no
duration. Frequent, small.
Frenzy
13-second ClickFrenzy buff: each manual click during the buff
adds an FPS-scaled bonus on top of normal click power. Less
common, disruptive while it lasts; the FPS scaling means a
late-game Frenzy is much more rewarding than an early-game one
(and the early-game version stays bounded against the cost
ladder).
Buff
60-second per-fingerer modifier on a random owned fingerer:
that fingerer’s passive FPS is multiplied x7. Implemented as a
ModifierSource::PurpleCoin MulFactor(7.0) with Ticks(1200).
GreenCoin
Permanent +10% AddPercent modifier on a random visible fingerer
(sidebar-visible — including unowned tiers above the visibility
threshold; Index Finger is always eligible). Rare; sourced as
ModifierSource::GreenCoin.
Implementations§
Source§impl PowerupKind
impl PowerupKind
Sourcepub const ALL: [Self; 4]
pub const ALL: [Self; 4]
Stable iteration order. Mirrors discriminant order so
kind as usize indexes into anything sized to N_KINDS.
Sourcepub fn lifetime_ticks(self) -> u32
pub fn lifetime_ticks(self) -> u32
On-screen lifetime for this kind. ~11s at 20Hz across all kinds for
now — long enough to see and react, short enough to be a meaningful
catch. Keep on PowerupKind so tuning is one number per kind.
Sourcepub fn mean_cooldown_ticks(self) -> u32
pub fn mean_cooldown_ticks(self) -> u32
Mean inter-arrival time (in ticks) for this kind. Single tuning knob — raise to make the kind rarer, lower to see it more often.
Sourcepub fn min_cooldown_ticks(self) -> u32
pub fn min_cooldown_ticks(self) -> u32
Safety floor on the truncated exponential. Prevents pathologically rapid spawns from the left tail (two of the same kind appearing in the same second by chance and visually overlapping).
Sourcepub fn max_cooldown_ticks(self) -> u32
pub fn max_cooldown_ticks(self) -> u32
Safety ceiling on the truncated exponential. Catches the bottom ~2% of the right tail; everything below 4× the mean passes through unchanged. Prevents the player from feeling like a kind has been “removed” during a particularly long drought.
Trait Implementations§
Source§impl Clone for PowerupKind
impl Clone for PowerupKind
Source§fn clone(&self) -> PowerupKind
fn clone(&self) -> PowerupKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PowerupKind
impl Debug for PowerupKind
Source§impl PartialEq for PowerupKind
impl PartialEq for PowerupKind
Source§fn eq(&self, other: &PowerupKind) -> bool
fn eq(&self, other: &PowerupKind) -> bool
self and other values to be equal, and is used by ==.impl Copy for PowerupKind
impl Eq for PowerupKind
impl StructuralPartialEq for PowerupKind
Auto Trait Implementations§
impl Freeze for PowerupKind
impl RefUnwindSafe for PowerupKind
impl Send for PowerupKind
impl Sync for PowerupKind
impl Unpin for PowerupKind
impl UnsafeUnpin for PowerupKind
impl UnwindSafe for PowerupKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more