removes need to pass BUC to effects

This commit is contained in:
Llywelwyn 2023-08-21 16:39:37 +01:00
parent 1d9cb04d1f
commit db9e04069a
4 changed files with 18 additions and 15 deletions

View file

@ -40,10 +40,10 @@ pub fn inflict_damage(ecs: &mut World, damage: &EffectSpawner, target: Entity) {
pub fn heal_damage(ecs: &mut World, heal: &EffectSpawner, target: Entity) {
let mut pools = ecs.write_storage::<Pools>();
if let Some(pool) = pools.get_mut(target) {
if let EffectType::Healing { amount, buc } = &heal.effect_type {
if let EffectType::Healing { amount, increment_max } = &heal.effect_type {
let before = pool.hit_points.current;
pool.hit_points.current = i32::min(pool.hit_points.max, pool.hit_points.current + amount);
if pool.hit_points.current - before < *amount && get_noncursed(buc) {
if pool.hit_points.current - before < *amount && *increment_max {
// If the heal was not fully effective, and healing source was noncursed, increase max HP by 1.
pool.hit_points.max += 1;
pool.hit_points.current += 1;