relaod mechanic

This commit is contained in:
2025-04-02 02:15:43 +08:00
parent 9aaa015bd6
commit 01f8128e5f
7 changed files with 82 additions and 16 deletions

View File

@@ -82,6 +82,7 @@ fn on_trigger_state(
player_rot: Query<&Transform, With<PlayerRig>>,
player_transform: Query<&Transform, With<Player>>,
mut active_heads: ResMut<ActiveHeads>,
time: Res<Time>,
) {
if matches!(trigger.event(), TriggerState::Active) {
let Some(state) = active_heads.current() else {
@@ -107,7 +108,7 @@ fn on_trigger_state(
pos: transform.translation,
};
active_heads.use_ammo();
active_heads.use_ammo(time.elapsed_secs());
match state.ability {
HeadAbility::Thrown => commands.trigger(TriggerThrow(trigger_state)),