try to balance a bit
This commit is contained in:
parent
6cea0e97e9
commit
d35344f910
10 changed files with 141 additions and 48 deletions
|
|
@ -83,24 +83,25 @@ fn get_upgrades(commands: &mut Commands) -> Vec<Entity> {
|
|||
fn create_worker_upgrade(
|
||||
commands: &mut Commands,
|
||||
name: String,
|
||||
desc: &'static str,
|
||||
description: String,
|
||||
cost: Quantity,
|
||||
additional_workers: u32,
|
||||
unlocks: Vec<Entity>,
|
||||
) -> Entity {
|
||||
commands
|
||||
.spawn((
|
||||
Name::new(name),
|
||||
Upgrade {
|
||||
description: desc.to_string(),
|
||||
description,
|
||||
cost,
|
||||
unlocks,
|
||||
},
|
||||
))
|
||||
.observe(
|
||||
|_trigger: Trigger<UpgradeApplied>,
|
||||
mut workers: ResMut<AvailableWorkers>,
|
||||
mut range: Single<&mut Range, With<Core>>| {
|
||||
workers.0 += 1;
|
||||
move |_trigger: Trigger<UpgradeApplied>,
|
||||
mut workers: ResMut<AvailableWorkers>,
|
||||
mut range: Single<&mut Range, With<Core>>| {
|
||||
workers.0 += additional_workers;
|
||||
range.0 += 5.0;
|
||||
},
|
||||
)
|
||||
|
|
@ -114,14 +115,27 @@ fn get_upgrades(commands: &mut Commands) -> Vec<Entity> {
|
|||
} else {
|
||||
Vec::new()
|
||||
};
|
||||
let additional_workers = ((i + 1) / 2).max(1);
|
||||
worker_upgrade = Some(create_worker_upgrade(
|
||||
commands,
|
||||
format!("Create Worker {}", i),
|
||||
"Forms a new worker, useful for harvesting resource deposits. Increases the Core's domain.",
|
||||
format!(
|
||||
"Create Worker{}",
|
||||
if additional_workers > 1 { "s" } else { "" }
|
||||
),
|
||||
format!(
|
||||
"Forms {} new worker{}, useful for harvesting resource deposits. Increases the Core's domain.",
|
||||
if additional_workers > 1 {
|
||||
additional_workers.to_string()
|
||||
} else {
|
||||
"a".to_string()
|
||||
},
|
||||
if additional_workers > 1 { "s" } else { "" }
|
||||
),
|
||||
Quantity {
|
||||
souls: 25 * 2_u32.pow(i - 1),
|
||||
bones: 15 * 2_u32.pow(i - 1),
|
||||
bones: 10 * 2_u32.pow(i - 1),
|
||||
},
|
||||
additional_workers,
|
||||
unlocks,
|
||||
));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue