From 61571a8e745a3b5e07503a906b107b170dbdd055 Mon Sep 17 00:00:00 2001 From: scott-c Date: Sat, 13 Jun 2020 19:35:31 +0800 Subject: [PATCH] Adjust character state's energy regen --- common/src/sys/stats.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/common/src/sys/stats.rs b/common/src/sys/stats.rs index 58fbfa4696..e594ef2667 100644 --- a/common/src/sys/stats.rs +++ b/common/src/sys/stats.rs @@ -75,8 +75,8 @@ impl<'a> System<'a> for Sys { .set_to(stat.health.maximum(), HealthSource::LevelUp); } - // Accelerate recharging energy if not wielding. match character_state { + // Accelerate recharging energy. CharacterState::Idle { .. } | CharacterState::Sit { .. } | CharacterState::Dance { .. } @@ -102,17 +102,18 @@ impl<'a> System<'a> for Sys { } }, // Ability use does not regen and sets the rate back to zero. - CharacterState::Roll { .. } - | CharacterState::BasicBlock { .. } - | CharacterState::Climb { .. } - | CharacterState::BasicMelee { .. } + CharacterState::BasicMelee { .. } | CharacterState::DashMelee { .. } | CharacterState::TripleStrike { .. } - | CharacterState::BasicRanged { .. } => { + | CharacterState::BasicRanged { .. } + | CharacterState::BasicBlock { .. } => { if energy.get_unchecked().regen_rate != 0.0 { energy.get_mut_unchecked().regen_rate = 0.0 } }, + // Non-combat abilities that consume energy; + // temporarily stall energy gain, but preserve regen_rate. + CharacterState::Roll { .. } | CharacterState::Climb { .. } => {}, } } }