Skip to content

Commit

Permalink
Rockstar Dev decreases the impact of tech debt
Browse files Browse the repository at this point in the history
  • Loading branch information
necrashter committed Dec 11, 2023
1 parent 9c1674f commit 123aabd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/simulation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ pub struct Simulation {
pub lines: f64,
pub entities: f64,
pub tech_debt: f64,
pub tech_debt_multiplier: f64,
/// Fun score, affects the submission's results.
pub fun_score: f64,
/// Presentation factor, affects the submissions' results.
Expand Down Expand Up @@ -99,6 +100,7 @@ impl Default for Simulation {
lines: 0.0,
entities: 0.0,
tech_debt: 0.0,
tech_debt_multiplier: 1.0,
fun_score: 0.0,
presentation_score: 0.0,

Expand Down
13 changes: 11 additions & 2 deletions src/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,11 @@ impl Upgrade {
}

pub fn cost(&self, simulation: &Simulation) -> f64 {
(self.base_cost * self.cost_scale_factor.powf(simulation.tech_debt)).floor()
(self.base_cost
* self
.cost_scale_factor
.powf(simulation.tech_debt * simulation.tech_debt_multiplier))
.floor()
}

pub fn description(&self) -> String {
Expand Down Expand Up @@ -1363,7 +1367,10 @@ generate_upgrade_list!(

Upgrade {
name: NAMES[0].to_string(),
desc: "Spawns VALUE entities whenever a line of code is produced.".to_string(),
desc: "\
Spawns VALUE entities whenever a line of code is produced. \
Decreases the impact of technical debt.\
".to_string(),
sound: Some(SoundEffectKind::Guitar),
value: 4.0,
no_count: true,
Expand All @@ -1383,12 +1390,14 @@ generate_upgrade_list!(
if this.remaining == 5 {
// First time (remaining is decreased beforehand)
simulation.entity_spawn_per_line += 4.0;
simulation.tech_debt_multiplier = 0.5;
// Make subsequent copies of this upgrade available in the random pool.
this.base_cost = 100.0;
this.weight = 1.0;
} else {
// Level up
simulation.entity_spawn_per_line *= 2.0;
simulation.tech_debt_multiplier *= 0.875;
}
// Special scaling
this.base_cost *= 100.0;
Expand Down

0 comments on commit 123aabd

Please sign in to comment.