Skip to content
Snippets Groups Projects
Commit 3afa96e9 authored by antoine.giles's avatar antoine.giles
Browse files

added capacity reward

parent 86b3bb12
Branches
Tags
No related merge requests found
...@@ -328,7 +328,7 @@ fn update_hp( ...@@ -328,7 +328,7 @@ fn update_hp(
fn combat_outcome( fn combat_outcome(
mut enemy_query: Query<(Entity, &Transform, &Enemy)>, mut enemy_query: Query<(Entity, &Transform, &Enemy)>,
mut player_query: Query<(Entity, &Transform, &Player)>, mut player_query: Query<(Entity, &Transform, &mut Player)>,
mut game_state: ResMut<NextState<GameState>>, mut game_state: ResMut<NextState<GameState>>,
mut commands: Commands, mut commands: Commands,
) { ) {
...@@ -337,6 +337,13 @@ fn combat_outcome( ...@@ -337,6 +337,13 @@ fn combat_outcome(
if _enemy.hp <= 0.0 { if _enemy.hp <= 0.0 {
commands.entity(enemy_id).despawn(); commands.entity(enemy_id).despawn();
println!("aenemy died"); println!("aenemy died");
for (_, _, mut player) in &mut player_query {
let capno: usize = player.moveset.len();
player.moveset.push(Capacites {
name: format!("Capacite {}", capno.to_string()),
degat: 20.0,
})
}
game_state.set(GameState::Overworld); game_state.set(GameState::Overworld);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment