Merge branch 'nixda/Energy_regeneration' into 'master'

#1694 Faster Energy Regeneration-acceleration while sitting

See merge request veloren/veloren!3768
This commit is contained in:
Marcel 2023-01-18 15:58:25 +00:00
commit 105dbc77ee
2 changed files with 9 additions and 1 deletions

View File

@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Command to toggle experimental shaders.
- Faster Energy Regeneration while sitting.
### Changed
- Bats move slower and use a simple proportional controller to maintain altitude

View File

@ -165,7 +165,14 @@ impl<'a> System<'a> for Sys {
if res {
let energy = &mut *energy;
energy.change_by(energy.regen_rate * dt);
energy.regen_rate = (energy.regen_rate + ENERGY_REGEN_ACCEL * dt).min(10.0);
if matches!(character_state, CharacterState::Sit) {
// Higher Energy-regeneration while sitting
energy.regen_rate =
(energy.regen_rate + ENERGY_REGEN_ACCEL * dt * 1.5).min(25.0);
} else {
energy.regen_rate =
(energy.regen_rate + ENERGY_REGEN_ACCEL * dt).min(10.0);
}
}
let res_poise = { poise.current() < poise.maximum() };