Compare commits
No commits in common. "e2d0d553e9ea011e1a468d727ff712158f42d87e" and "283b86d04aed8c89d134eb46f4493dcbcdbb1062" have entirely different histories.
e2d0d553e9
...
283b86d04a
9 changed files with 7 additions and 87 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
|
@ -1655,10 +1655,8 @@ dependencies = [
|
||||||
"bevy",
|
"bevy",
|
||||||
"building",
|
"building",
|
||||||
"combat",
|
"combat",
|
||||||
"resources",
|
|
||||||
"state",
|
"state",
|
||||||
"ui_range_indicator",
|
"ui_range_indicator",
|
||||||
"upgrade",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
|
||||||
|
|
@ -61,8 +61,7 @@ fn register(
|
||||||
});
|
});
|
||||||
|
|
||||||
let info = commands.spawn_empty().id();
|
let info = commands.spawn_empty().id();
|
||||||
let test_unlocks =
|
let test_unlocks = vec![
|
||||||
vec![
|
|
||||||
commands
|
commands
|
||||||
.spawn((
|
.spawn((
|
||||||
Name::new("ROCKET BARRAGE"),
|
Name::new("ROCKET BARRAGE"),
|
||||||
|
|
@ -70,7 +69,7 @@ fn register(
|
||||||
description: "bangbangbangbangbangbangbangbang".to_string(),
|
description: "bangbangbangbangbangbangbangbang".to_string(),
|
||||||
cost: Quantity {
|
cost: Quantity {
|
||||||
souls: 10,
|
souls: 10,
|
||||||
bones: 20,
|
bones: 10,
|
||||||
},
|
},
|
||||||
unlocks: vec![],
|
unlocks: vec![],
|
||||||
},
|
},
|
||||||
|
|
@ -89,7 +88,7 @@ fn register(
|
||||||
Name::new("Party Mode"),
|
Name::new("Party Mode"),
|
||||||
Upgrade {
|
Upgrade {
|
||||||
description: "I'm in the house tonight.".to_string(),
|
description: "I'm in the house tonight.".to_string(),
|
||||||
cost: Quantity { souls: 20, bones: 10 },
|
cost: Quantity { souls: 0, bones: 0 },
|
||||||
unlocks: vec![],
|
unlocks: vec![],
|
||||||
},
|
},
|
||||||
))
|
))
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,7 @@ bevy = { workspace = true }
|
||||||
combat = { path = "../combat" }
|
combat = { path = "../combat" }
|
||||||
building = { path = "../building" }
|
building = { path = "../building" }
|
||||||
state = { path = "../state" }
|
state = { path = "../state" }
|
||||||
resources = { path = "../resources" }
|
|
||||||
ui_range_indicator = { path = "../ui_range_indicator" }
|
ui_range_indicator = { path = "../ui_range_indicator" }
|
||||||
upgrade = { path = "../upgrade" }
|
|
||||||
|
|
||||||
[lints]
|
[lints]
|
||||||
workspace = true
|
workspace = true
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,8 @@
|
||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
use building::{BuildingInfo, BuildingPreview, Core, PREVIEW_ALPHA, PopulatePlacedBuilding};
|
use building::{BuildingInfo, BuildingPreview, Core, PREVIEW_ALPHA, PopulatePlacedBuilding};
|
||||||
use combat::{Defense, Died, Health, Range};
|
use combat::{Defense, Died, Health, Range};
|
||||||
use resources::{AvailableWorkers, Quantity};
|
|
||||||
use state::{CoreState, GameState};
|
use state::{CoreState, GameState};
|
||||||
use ui_range_indicator::CustomRangeIndicator;
|
use ui_range_indicator::CustomRangeIndicator;
|
||||||
use upgrade::{Upgrade, UpgradeApplied, UpgradeTree};
|
|
||||||
|
|
||||||
pub struct BuildingCorePlugin;
|
pub struct BuildingCorePlugin;
|
||||||
|
|
||||||
|
|
@ -59,18 +57,16 @@ fn register(
|
||||||
CorePreview,
|
CorePreview,
|
||||||
))
|
))
|
||||||
.id();
|
.id();
|
||||||
let upgrades = get_upgrades(&mut commands);
|
|
||||||
commands.entity(info).insert((
|
commands.entity(info).insert((
|
||||||
BuildingInfo {
|
BuildingInfo {
|
||||||
preview,
|
preview,
|
||||||
size: SIZE,
|
size: SIZE,
|
||||||
unlocked: false,
|
unlocked: false,
|
||||||
},
|
},
|
||||||
UpgradeTree { upgrades },
|
|
||||||
Name::new("Core"),
|
Name::new("Core"),
|
||||||
Health::new(100.0),
|
Health::new(100.0),
|
||||||
Defense::new(5.0),
|
Defense::new(5.0),
|
||||||
Range(15.0),
|
Range(25.0),
|
||||||
));
|
));
|
||||||
commands.insert_resource(CoreResources {
|
commands.insert_resource(CoreResources {
|
||||||
mesh: mesh,
|
mesh: mesh,
|
||||||
|
|
@ -79,54 +75,6 @@ fn register(
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_upgrades(commands: &mut Commands) -> Vec<Entity> {
|
|
||||||
fn create_worker_upgrade(
|
|
||||||
commands: &mut Commands,
|
|
||||||
name: String,
|
|
||||||
desc: &'static str,
|
|
||||||
cost: Quantity,
|
|
||||||
unlocks: Vec<Entity>,
|
|
||||||
) -> Entity {
|
|
||||||
commands
|
|
||||||
.spawn((
|
|
||||||
Name::new(name),
|
|
||||||
Upgrade {
|
|
||||||
description: desc.to_string(),
|
|
||||||
cost,
|
|
||||||
unlocks,
|
|
||||||
},
|
|
||||||
))
|
|
||||||
.observe(
|
|
||||||
|_trigger: Trigger<UpgradeApplied>,
|
|
||||||
mut workers: ResMut<AvailableWorkers>,
|
|
||||||
mut range: Single<&mut Range, With<Core>>| {
|
|
||||||
workers.0 += 1;
|
|
||||||
range.0 += 5.0;
|
|
||||||
},
|
|
||||||
)
|
|
||||||
.id()
|
|
||||||
}
|
|
||||||
|
|
||||||
let mut worker_upgrade = None;
|
|
||||||
for i in (1..=5).rev() {
|
|
||||||
let unlocks = if let Some(up) = worker_upgrade {
|
|
||||||
vec![up]
|
|
||||||
} else {
|
|
||||||
Vec::new()
|
|
||||||
};
|
|
||||||
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.",
|
|
||||||
Quantity {
|
|
||||||
souls: 25 * 2_u32.pow(i - 1),
|
|
||||||
bones: 20 * 2_u32.pow(i - 1),
|
|
||||||
},
|
|
||||||
unlocks,
|
|
||||||
));
|
|
||||||
}
|
|
||||||
vec![worker_upgrade.unwrap()]
|
|
||||||
}
|
|
||||||
fn populate(
|
fn populate(
|
||||||
trigger: Trigger<PopulatePlacedBuilding>,
|
trigger: Trigger<PopulatePlacedBuilding>,
|
||||||
mut commands: Commands,
|
mut commands: Commands,
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ use avian3d::prelude::*;
|
||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
use physics::PhysicsLayers;
|
use physics::PhysicsLayers;
|
||||||
use resources::{Drops, Resources};
|
use resources::{Drops, Resources};
|
||||||
use state::GameSystemSet;
|
use state::{BasePhaseState, GameSystemSet};
|
||||||
|
|
||||||
pub struct CombatPlugin;
|
pub struct CombatPlugin;
|
||||||
|
|
||||||
|
|
@ -212,6 +212,7 @@ fn on_die(
|
||||||
trigger: Trigger<Died>,
|
trigger: Trigger<Died>,
|
||||||
names: Query<&Name>,
|
names: Query<&Name>,
|
||||||
drops: Query<&Drops>,
|
drops: Query<&Drops>,
|
||||||
|
phase: Res<State<BasePhaseState>>,
|
||||||
mut resources: ResMut<Resources>,
|
mut resources: ResMut<Resources>,
|
||||||
mut commands: Commands,
|
mut commands: Commands,
|
||||||
) {
|
) {
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,6 @@ fn spawn(
|
||||||
bounty: Quantity { souls: 0, bones: 5 },
|
bounty: Quantity { souls: 0, bones: 5 },
|
||||||
level: 0,
|
level: 0,
|
||||||
harvest_time: Duration::from_secs(5),
|
harvest_time: Duration::from_secs(5),
|
||||||
max_workers: 2,
|
|
||||||
},
|
},
|
||||||
Mesh3d(res.mesh.clone()),
|
Mesh3d(res.mesh.clone()),
|
||||||
MeshMaterial3d(res.material.clone()),
|
MeshMaterial3d(res.material.clone()),
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ impl Plugin for ResourcesPlugin {
|
||||||
fn build(&self, app: &mut App) {
|
fn build(&self, app: &mut App) {
|
||||||
app.add_systems(OnEnter(AppState::Game), setup)
|
app.add_systems(OnEnter(AppState::Game), setup)
|
||||||
.add_systems(FixedUpdate, tick_harvest.in_set(GameSystemSet::Execute))
|
.add_systems(FixedUpdate, tick_harvest.in_set(GameSystemSet::Execute))
|
||||||
.insert_resource(AvailableWorkers(1))
|
.insert_resource(AvailableWorkers(5))
|
||||||
.add_observer(on_harvest);
|
.add_observer(on_harvest);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -124,7 +124,6 @@ pub struct ResourceDeposit {
|
||||||
pub bounty: Quantity,
|
pub bounty: Quantity,
|
||||||
pub level: u32,
|
pub level: u32,
|
||||||
pub harvest_time: Duration,
|
pub harvest_time: Duration,
|
||||||
pub max_workers: u32,
|
|
||||||
// todo - add finite resources and refresh timer
|
// todo - add finite resources and refresh timer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -238,10 +238,6 @@ fn side_panel(
|
||||||
ui.add_enabled(false, egui::Button::new("Out of Core's range"));
|
ui.add_enabled(false, egui::Button::new("Out of Core's range"));
|
||||||
} else if available_workers.0 == 0 {
|
} else if available_workers.0 == 0 {
|
||||||
ui.add_enabled(false, egui::Button::new("No workers available"));
|
ui.add_enabled(false, egui::Button::new("No workers available"));
|
||||||
} else if let Some(ref worked) = opt_worked
|
|
||||||
&& worked.workers >= deposit.max_workers
|
|
||||||
{
|
|
||||||
ui.add_enabled(false, egui::Button::new("Maximum workers reached"));
|
|
||||||
} else {
|
} else {
|
||||||
if ui.button("Add worker").clicked() {
|
if ui.button("Add worker").clicked() {
|
||||||
available_workers.0 = available_workers.0.saturating_sub(1);
|
available_workers.0 = available_workers.0.saturating_sub(1);
|
||||||
|
|
|
||||||
18
todo.txt
18
todo.txt
|
|
@ -1,18 +0,0 @@
|
||||||
|
|
||||||
--- VERY IMPORTANT ---
|
|
||||||
- sound
|
|
||||||
- music
|
|
||||||
x limit workers per resource deposit
|
|
||||||
- main menu
|
|
||||||
- improve enemy AI
|
|
||||||
- balance
|
|
||||||
|
|
||||||
--- IMPORTANT ---
|
|
||||||
- More towers
|
|
||||||
- More upgrades
|
|
||||||
- More enemy types
|
|
||||||
- More resource deposit types
|
|
||||||
|
|
||||||
--- STILL PRETTY IMPORTANT ---
|
|
||||||
- Building repair
|
|
||||||
x core upgrade (yeah I'm just adding more workers and range)
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue