From 2ea1e7919a285d43528b58230f49da9960c89220 Mon Sep 17 00:00:00 2001 From: Robin Candau Date: Tue, 10 Nov 2026 00:37:34 +0100 Subject: [PATCH] feat: Add prestige leveling support - Prestige levels require a specific amount of resources to be unlocked that gradually increases (e.g. prestige 1 requires all resources to be >= 100, prestige 2 requires all resources to be >= 120, etc...) - Prestige levels cost a (more or less) significant amount of credits that gradually increases (e.g. prestige 1 costs 1000 credits, prestige 2 costs 1500 credits, etc...) - Buying a prestige level resets progression (as it should) - Aside from the glory provided by the prestige level itself (:D), a permanent bonus is earned to accelerate future progression (despite the reset) --- src/economy.rs | 4 ++++ src/parameters.rs | 4 ++++ src/statefile.rs | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/src/economy.rs b/src/economy.rs index 04e1514..ee45a19 100644 --- a/src/economy.rs +++ b/src/economy.rs @@ -12,6 +12,10 @@ const RAM_PRICE_MULTIPLIER: f64 = 1.040; const DISK_BASE_PRICE: f64 = 1.0; const DISK_PRICE_MULTIPLIER: f64 = 1.035; +// Base price and price increment for prestige levels +const PRESTIGE_BASE_CREDIT_REQUIREMENT: f64 = 1000.0; +const PRESTIGE_CREDIT_INCREMENT: f64 = 500.0; + // Perks price pub const CI_CD_PRICE: f64 = 5.0; pub const AUTO_SCALING_PRICE: f64 = 25.0; diff --git a/src/parameters.rs b/src/parameters.rs index 3aa2cde..2f45441 100644 --- a/src/parameters.rs +++ b/src/parameters.rs @@ -15,6 +15,10 @@ const BASE_COMPILATION_FAILURE_PROB: f64 = 0.25; const MIN_COMPILATION_FAILURE_PROB: f64 = 0.05; const MAX_COMPILATION_FAILURE_PROB: f64 = 0.90; +// Base resource requirement and increment for prestige levels +const BASE_PRESTIGE_RESOURCE_REQUIREMENT: u64 = 100; +const PRESTIGE_RESOURCE_INCREMENT: u64 = 20; + // Calculate compile time based on CPU and RAM // - Each additional CPU core reduces the compile time by 5 seconds // - Each additional GB of RAM increases the compile time by 1 second diff --git a/src/statefile.rs b/src/statefile.rs index d3dae0c..06b4e1e 100644 --- a/src/statefile.rs +++ b/src/statefile.rs @@ -21,6 +21,8 @@ pub struct GameState { pub ci_cd_enabled: bool, pub auto_scaling_unlocked: bool, pub auto_scaling_enabled: bool, + // Prestige level + pub prestige_level: u64, } // Default values @@ -37,6 +39,8 @@ impl Default for GameState { ci_cd_enabled: false, auto_scaling_unlocked: false, auto_scaling_enabled: false, + // Prestige level + prestige_level: 0, } } }