diff --git a/Cargo.lock b/Cargo.lock index 30ed76f..d86e7bc 100755 --- a/Cargo.lock +++ b/Cargo.lock @@ -1655,10 +1655,8 @@ dependencies = [ "bevy", "building", "combat", - "resources", "state", "ui_range_indicator", - "upgrade", ] [[package]] diff --git a/crates/building_barrager/src/lib.rs b/crates/building_barrager/src/lib.rs index 0f75dc9..fc81dcb 100644 --- a/crates/building_barrager/src/lib.rs +++ b/crates/building_barrager/src/lib.rs @@ -61,8 +61,7 @@ fn register( }); let info = commands.spawn_empty().id(); - let test_unlocks = - vec![ + let test_unlocks = vec![ commands .spawn(( Name::new("ROCKET BARRAGE"), @@ -70,7 +69,7 @@ fn register( description: "bangbangbangbangbangbangbangbang".to_string(), cost: Quantity { souls: 10, - bones: 20, + bones: 10, }, unlocks: vec![], }, @@ -89,7 +88,7 @@ fn register( Name::new("Party Mode"), Upgrade { description: "I'm in the house tonight.".to_string(), - cost: Quantity { souls: 20, bones: 10 }, + cost: Quantity { souls: 0, bones: 0 }, unlocks: vec![], }, )) diff --git a/crates/building_core/Cargo.toml b/crates/building_core/Cargo.toml index 28d1eaa..33bfc44 100755 --- a/crates/building_core/Cargo.toml +++ b/crates/building_core/Cargo.toml @@ -9,9 +9,7 @@ bevy = { workspace = true } combat = { path = "../combat" } building = { path = "../building" } state = { path = "../state" } -resources = { path = "../resources" } ui_range_indicator = { path = "../ui_range_indicator" } -upgrade = { path = "../upgrade" } [lints] workspace = true diff --git a/crates/building_core/src/lib.rs b/crates/building_core/src/lib.rs index 75876e4..4f53f26 100755 --- a/crates/building_core/src/lib.rs +++ b/crates/building_core/src/lib.rs @@ -5,10 +5,8 @@ use bevy::prelude::*; use building::{BuildingInfo, BuildingPreview, Core, PREVIEW_ALPHA, PopulatePlacedBuilding}; use combat::{Defense, Died, Health, Range}; -use resources::{AvailableWorkers, Quantity}; use state::{CoreState, GameState}; use ui_range_indicator::CustomRangeIndicator; -use upgrade::{Upgrade, UpgradeApplied, UpgradeTree}; pub struct BuildingCorePlugin; @@ -59,18 +57,16 @@ fn register( CorePreview, )) .id(); - let upgrades = get_upgrades(&mut commands); commands.entity(info).insert(( BuildingInfo { preview, size: SIZE, unlocked: false, }, - UpgradeTree { upgrades }, Name::new("Core"), Health::new(100.0), Defense::new(5.0), - Range(15.0), + Range(25.0), )); commands.insert_resource(CoreResources { mesh: mesh, @@ -79,54 +75,6 @@ fn register( }); } -fn get_upgrades(commands: &mut Commands) -> Vec { - fn create_worker_upgrade( - commands: &mut Commands, - name: String, - desc: &'static str, - cost: Quantity, - unlocks: Vec, - ) -> Entity { - commands - .spawn(( - Name::new(name), - Upgrade { - description: desc.to_string(), - cost, - unlocks, - }, - )) - .observe( - |_trigger: Trigger, - mut workers: ResMut, - mut range: Single<&mut Range, With>| { - 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( trigger: Trigger, mut commands: Commands, diff --git a/crates/combat/src/lib.rs b/crates/combat/src/lib.rs index 5b585a3..d6edd89 100755 --- a/crates/combat/src/lib.rs +++ b/crates/combat/src/lib.rs @@ -10,7 +10,7 @@ use avian3d::prelude::*; use bevy::prelude::*; use physics::PhysicsLayers; use resources::{Drops, Resources}; -use state::GameSystemSet; +use state::{BasePhaseState, GameSystemSet}; pub struct CombatPlugin; @@ -212,6 +212,7 @@ fn on_die( trigger: Trigger, names: Query<&Name>, drops: Query<&Drops>, + phase: Res>, mut resources: ResMut, mut commands: Commands, ) { diff --git a/crates/resource_graveyard/src/lib.rs b/crates/resource_graveyard/src/lib.rs index ecb989a..dbf3535 100644 --- a/crates/resource_graveyard/src/lib.rs +++ b/crates/resource_graveyard/src/lib.rs @@ -67,7 +67,6 @@ fn spawn( bounty: Quantity { souls: 0, bones: 5 }, level: 0, harvest_time: Duration::from_secs(5), - max_workers: 2, }, Mesh3d(res.mesh.clone()), MeshMaterial3d(res.material.clone()), diff --git a/crates/resources/src/lib.rs b/crates/resources/src/lib.rs index ecee08f..8f058a7 100644 --- a/crates/resources/src/lib.rs +++ b/crates/resources/src/lib.rs @@ -13,7 +13,7 @@ impl Plugin for ResourcesPlugin { fn build(&self, app: &mut App) { app.add_systems(OnEnter(AppState::Game), setup) .add_systems(FixedUpdate, tick_harvest.in_set(GameSystemSet::Execute)) - .insert_resource(AvailableWorkers(1)) + .insert_resource(AvailableWorkers(5)) .add_observer(on_harvest); } } @@ -124,7 +124,6 @@ pub struct ResourceDeposit { pub bounty: Quantity, pub level: u32, pub harvest_time: Duration, - pub max_workers: u32, // todo - add finite resources and refresh timer } diff --git a/crates/ui_ingame/src/lib.rs b/crates/ui_ingame/src/lib.rs index 442f981..71dbf0e 100644 --- a/crates/ui_ingame/src/lib.rs +++ b/crates/ui_ingame/src/lib.rs @@ -238,10 +238,6 @@ fn side_panel( ui.add_enabled(false, egui::Button::new("Out of Core's range")); } else if available_workers.0 == 0 { 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 { if ui.button("Add worker").clicked() { available_workers.0 = available_workers.0.saturating_sub(1); diff --git a/todo.txt b/todo.txt deleted file mode 100644 index 8162448..0000000 --- a/todo.txt +++ /dev/null @@ -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)