add impaler upgrades
This commit is contained in:
parent
4c5a650a1a
commit
6cea0e97e9
5 changed files with 92 additions and 7 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
|
@ -1671,6 +1671,7 @@ dependencies = [
|
||||||
"combat_damagers",
|
"combat_damagers",
|
||||||
"resources",
|
"resources",
|
||||||
"state",
|
"state",
|
||||||
|
"upgrade",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
(
|
(
|
||||||
map: {
|
map: {
|
||||||
MouseButton(Middle): [
|
KeyCode(ShiftLeft): [
|
||||||
CameraOrbitEnable,
|
MultiPlaceTower,
|
||||||
],
|
],
|
||||||
MouseButton(Right): [
|
MouseButton(Right): [
|
||||||
PlaceTower,
|
PlaceTower,
|
||||||
|
|
@ -9,8 +9,8 @@
|
||||||
MouseButton(Left): [
|
MouseButton(Left): [
|
||||||
CameraPanEnable,
|
CameraPanEnable,
|
||||||
],
|
],
|
||||||
KeyCode(ShiftLeft): [
|
MouseButton(Middle): [
|
||||||
MultiPlaceTower,
|
CameraOrbitEnable,
|
||||||
],
|
],
|
||||||
MouseScroll: [
|
MouseScroll: [
|
||||||
CameraZoom,
|
CameraZoom,
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ combat = { path = "../combat" }
|
||||||
building = { path = "../building" }
|
building = { path = "../building" }
|
||||||
resources = { path = "../resources" }
|
resources = { path = "../resources" }
|
||||||
combat_damagers = { path = "../combat_damagers" }
|
combat_damagers = { path = "../combat_damagers" }
|
||||||
|
upgrade = { path = "../upgrade" }
|
||||||
|
|
||||||
[lints]
|
[lints]
|
||||||
workspace = true
|
workspace = true
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,10 @@
|
||||||
|
|
||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
use building::{BuildingInfo, BuildingPreview, PREVIEW_ALPHA, PopulatePlacedBuilding};
|
use building::{BuildingInfo, BuildingPreview, PREVIEW_ALPHA, PopulatePlacedBuilding};
|
||||||
use combat::Health;
|
use combat::{Defense, Health};
|
||||||
use combat_damagers::ContactDamage;
|
use combat_damagers::ContactDamage;
|
||||||
use resources::{Cost, Quantity};
|
use resources::{Cost, Quantity};
|
||||||
|
use upgrade::{Upgrade, UpgradeApplied, UpgradeTree};
|
||||||
|
|
||||||
pub struct BuildingImpalerPlugin;
|
pub struct BuildingImpalerPlugin;
|
||||||
|
|
||||||
|
|
@ -48,6 +49,87 @@ fn register(
|
||||||
});
|
});
|
||||||
|
|
||||||
let info = commands.spawn_empty().id();
|
let info = commands.spawn_empty().id();
|
||||||
|
let tier3 = vec![
|
||||||
|
commands
|
||||||
|
.spawn((
|
||||||
|
Name::new("become mega"),
|
||||||
|
Upgrade {
|
||||||
|
description: "i will be mega :o".to_string(),
|
||||||
|
cost: Quantity {
|
||||||
|
souls: 250,
|
||||||
|
bones: 50,
|
||||||
|
},
|
||||||
|
unlocks: vec![],
|
||||||
|
},
|
||||||
|
))
|
||||||
|
.observe(
|
||||||
|
|trigger: Trigger<UpgradeApplied>,
|
||||||
|
mut query: Query<(&mut Transform, &mut Health)>| {
|
||||||
|
if let Ok((mut tf, mut health)) = query.get_mut(trigger.event().building) {
|
||||||
|
tf.scale *= 2.;
|
||||||
|
tf.translation.y += 1.5;
|
||||||
|
*health = Health::new(health.max * 3.);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)
|
||||||
|
.id(),
|
||||||
|
];
|
||||||
|
let tier2 = vec![
|
||||||
|
commands
|
||||||
|
.spawn((
|
||||||
|
Name::new("grow some more"),
|
||||||
|
Upgrade {
|
||||||
|
description: "i grow some more :)".to_string(),
|
||||||
|
cost: Quantity {
|
||||||
|
souls: 50,
|
||||||
|
bones: 10,
|
||||||
|
},
|
||||||
|
unlocks: tier3,
|
||||||
|
},
|
||||||
|
))
|
||||||
|
.observe(
|
||||||
|
|trigger: Trigger<UpgradeApplied>,
|
||||||
|
mut query: Query<(&mut Transform, &mut Health, &mut Defense)>| {
|
||||||
|
if let Ok((mut tf, mut health, mut defense)) =
|
||||||
|
query.get_mut(trigger.event().building)
|
||||||
|
{
|
||||||
|
tf.scale *= 2.;
|
||||||
|
tf.translation.y += 0.75;
|
||||||
|
defense.amount += 3.;
|
||||||
|
*health = Health::new(health.max * 2.);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)
|
||||||
|
.id(),
|
||||||
|
];
|
||||||
|
let upgrades = vec![
|
||||||
|
commands
|
||||||
|
.spawn((
|
||||||
|
Name::new("grow"),
|
||||||
|
Upgrade {
|
||||||
|
description: "i grow".to_string(),
|
||||||
|
cost: Quantity {
|
||||||
|
souls: 10,
|
||||||
|
bones: 5,
|
||||||
|
},
|
||||||
|
unlocks: tier2,
|
||||||
|
},
|
||||||
|
))
|
||||||
|
.observe(
|
||||||
|
|trigger: Trigger<UpgradeApplied>,
|
||||||
|
mut query: Query<(&mut Transform, &mut Health, &mut Defense)>| {
|
||||||
|
if let Ok((mut tf, mut health, mut defense)) =
|
||||||
|
query.get_mut(trigger.event().building)
|
||||||
|
{
|
||||||
|
tf.scale *= 1.5;
|
||||||
|
tf.translation.y += 0.25;
|
||||||
|
defense.amount += 2.;
|
||||||
|
*health = Health::new(health.max * 2.);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)
|
||||||
|
.id(),
|
||||||
|
];
|
||||||
let preview = commands
|
let preview = commands
|
||||||
.spawn((
|
.spawn((
|
||||||
BuildingPreview { info },
|
BuildingPreview { info },
|
||||||
|
|
@ -62,6 +144,7 @@ fn register(
|
||||||
size: SIZE,
|
size: SIZE,
|
||||||
unlocked: true,
|
unlocked: true,
|
||||||
},
|
},
|
||||||
|
UpgradeTree { upgrades },
|
||||||
Cost(Quantity { souls: 5, bones: 0 }),
|
Cost(Quantity { souls: 5, bones: 0 }),
|
||||||
Health::new(20.0),
|
Health::new(20.0),
|
||||||
Name::new("Impaler"),
|
Name::new("Impaler"),
|
||||||
|
|
|
||||||
4
todo.txt
4
todo.txt
|
|
@ -8,8 +8,8 @@ x improve enemy AI
|
||||||
- balance
|
- balance
|
||||||
|
|
||||||
--- IMPORTANT ---
|
--- IMPORTANT ---
|
||||||
- More towers
|
x More towers
|
||||||
- More upgrades
|
x More upgrades
|
||||||
x More enemy types
|
x More enemy types
|
||||||
x More resource deposit types
|
x More resource deposit types
|
||||||
- Improve wave generation
|
- Improve wave generation
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue