Combo counter now uses outcomes.

This commit is contained in:
Sam
2021-03-04 15:43:58 -05:00
parent c29cb037e7
commit 940b4b5de7
7 changed files with 112 additions and 85 deletions

View File

@ -1,5 +1,6 @@
use common::{
comp::{
self,
skills::{GeneralSkill, Skill},
Body, CharacterState, Combo, Energy, EnergyChange, EnergySource, Health, Poise,
PoiseChange, PoiseSource, Pos, Stats,
@ -18,7 +19,6 @@ use vek::Vec3;
const ENERGY_REGEN_ACCEL: f32 = 10.0;
const POISE_REGEN_ACCEL: f32 = 2.0;
const COMBO_DECAY_START: f64 = 5.0; // seconds
#[derive(SystemData)]
pub struct ReadData<'a> {
@ -264,7 +264,9 @@ impl<'a> System<'a> for Sys {
// Decay combo
for (_, mut combo) in (&read_data.entities, &mut combos).join() {
if combo.counter() > 0 && read_data.time.0 - combo.last_increase() > COMBO_DECAY_START {
if combo.counter() > 0
&& read_data.time.0 - combo.last_increase() > comp::combo::COMBO_DECAY_START
{
combo.reset();
}
}