initial: character creation

This commit is contained in:
Llywelwyn 2023-08-21 00:16:30 +01:00
parent 454a8c7028
commit 40f9d117f3
8 changed files with 359 additions and 73 deletions

View file

@ -2,19 +2,16 @@ use super::{
triggers::{BLESSED, UNCURSED},
EffectSpawner, EffectType,
};
use crate::{HungerClock, HungerState};
use crate::HungerClock;
use specs::prelude::*;
const SATIATED_DURATION: i32 = 200;
pub fn restore_food(ecs: &mut World, effect: &EffectSpawner, target: Entity) {
let buc = if let EffectType::RestoreNutrition { buc } = effect.effect_type { buc } else { UNCURSED };
if let Some(hc) = ecs.write_storage::<HungerClock>().get_mut(target) {
if buc == BLESSED || buc == UNCURSED {
hc.state = HungerState::Satiated;
hc.duration = SATIATED_DURATION;
hc.duration += 400;
} else {
hc.duration = 0;
hc.duration += 200;
}
}
}