use crate::game::state::GameState;
pub type Predicate = fn(&GameState) -> bool;
pub struct AchievementKind {
pub id: &'static str,
pub unlocked: Predicate,
}
pub const ACHIEVEMENTS: &[AchievementKind] = &[
AchievementKind {
id: "first_finger",
unlocked: |s| s.total_clicks >= 1,
},
AchievementKind {
id: "warming_up",
unlocked: |s| s.lifetime_cuques >= crate::bignum::Mag::from_f64(100.0),
},
AchievementKind {
id: "seasoned_fingerer",
unlocked: |s| s.lifetime_cuques >= crate::bignum::Mag::from_f64(10_000.0),
},
AchievementKind {
id: "cuque_mogul",
unlocked: |s| s.lifetime_cuques >= crate::bignum::Mag::from_f64(1_000_000.0),
},
AchievementKind {
id: "automation",
unlocked: |s| s.fingerers_owned_total() >= 1,
},
AchievementKind {
id: "factory_of_fingers",
unlocked: |s| s.fingerer_count("whole_hand") >= 10,
},
AchievementKind {
id: "latex_enjoyer",
unlocked: |s| s.fingerer_count("latex_glove") >= 10,
},
AchievementKind {
id: "golden_touch",
unlocked: |s| s.golden_caught >= 1,
},
AchievementKind {
id: "golden_hoarder",
unlocked: |s| s.golden_caught >= 10,
},
AchievementKind {
id: "rise_of_the_machines",
unlocked: |s| s.fingerer_count("robotic_finger") >= 1,
},
];
pub fn count() -> usize {
ACHIEVEMENTS.len()
}