refactors beatitude, and prepping readme for week 7
This commit is contained in:
parent
469d83994e
commit
831720ce37
14 changed files with 172 additions and 63 deletions
|
|
@ -1,17 +1,17 @@
|
|||
use super::{
|
||||
triggers::{BLESSED, UNCURSED},
|
||||
EffectSpawner, EffectType,
|
||||
};
|
||||
use crate::HungerClock;
|
||||
use super::{EffectSpawner, EffectType};
|
||||
use crate::{HungerClock, BUC};
|
||||
use specs::prelude::*;
|
||||
|
||||
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.duration += 400;
|
||||
} else {
|
||||
hc.duration += 200;
|
||||
if let EffectType::RestoreNutrition { buc } = &effect.effect_type {
|
||||
if let Some(hc) = ecs.write_storage::<HungerClock>().get_mut(target) {
|
||||
if buc == &BUC::Blessed {
|
||||
hc.duration += 600;
|
||||
} else if buc == &BUC::Uncursed {
|
||||
hc.duration += 400;
|
||||
} else if buc == &BUC::Cursed {
|
||||
hc.duration += 200;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue