Skip to main content

PowerupKind

Enum PowerupKind 

Source
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

Source

pub const ALL: [Self; 4]

Stable iteration order. Mirrors discriminant order so kind as usize indexes into anything sized to N_KINDS.

Source

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.

Source

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.

Source

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).

Source

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

Source§

fn clone(&self) -> PowerupKind

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PowerupKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for PowerupKind

Source§

fn eq(&self, other: &PowerupKind) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for PowerupKind

Source§

impl Eq for PowerupKind

Source§

impl StructuralPartialEq for PowerupKind

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.