From aac24ad60108ffe78655fa0ab6638e1454527912 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 21 Jun 2021 20:50:31 -0500 Subject: [PATCH] Added ensnared debuff icon. --- .../element/de_buffs/debuff_ensnared_0.png | 3 +++ common/systems/src/buff.rs | 23 ++++++++----------- voxygen/src/hud/img_ids.rs | 1 + voxygen/src/hud/mod.rs | 2 +- 4 files changed, 15 insertions(+), 14 deletions(-) create mode 100644 assets/voxygen/element/de_buffs/debuff_ensnared_0.png diff --git a/assets/voxygen/element/de_buffs/debuff_ensnared_0.png b/assets/voxygen/element/de_buffs/debuff_ensnared_0.png new file mode 100644 index 0000000000..64eba638bc --- /dev/null +++ b/assets/voxygen/element/de_buffs/debuff_ensnared_0.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3d8e1eaeb32e0c43054a92d6e045e0a2db93a15fc030238572efe8d119cd9466 +size 198 diff --git a/common/systems/src/buff.rs b/common/systems/src/buff.rs index f25dda0a68..364ee9832f 100644 --- a/common/systems/src/buff.rs +++ b/common/systems/src/buff.rs @@ -65,6 +65,7 @@ impl<'a> System<'a> for Sys { physics_state.on_ground.and_then(|b| b.get_sprite()), Some(SpriteKind::EnsnaringVines) ) { + // If on ensnaring vines, apply ensnared debuff server_emitter.emit(ServerEvent::Buff { entity, buff_change: BuffChange::Add(Buff::new( @@ -82,6 +83,7 @@ impl<'a> System<'a> for Sys { .. }) ) { + // If in lava fluid, apply burning debuff server_emitter.emit(ServerEvent::Buff { entity, buff_change: BuffChange::Add(Buff::new( @@ -97,13 +99,13 @@ impl<'a> System<'a> for Sys { kind: LiquidKind::Water, .. }) - ) { - if buff_comp.kinds.contains_key(&BuffKind::Burning) { - server_emitter.emit(ServerEvent::Buff { - entity, - buff_change: BuffChange::RemoveByKind(BuffKind::Burning), - }); - } + ) && buff_comp.kinds.contains_key(&BuffKind::Burning) + { + // If in water fluid and currently burning, remove burning debuffs + server_emitter.emit(ServerEvent::Buff { + entity, + buff_change: BuffChange::RemoveByKind(BuffKind::Burning), + }); } } @@ -284,12 +286,7 @@ impl<'a> System<'a> for Sys { } } -fn tick_buff( - id: u64, - buff: &mut Buff, - dt: f32, - mut expire_buff: impl FnMut(u64), -) { +fn tick_buff(id: u64, buff: &mut Buff, dt: f32, mut expire_buff: impl FnMut(u64)) { // If a buff is recently applied from an aura, do not tick duration if buff .cat_ids diff --git a/voxygen/src/hud/img_ids.rs b/voxygen/src/hud/img_ids.rs index 6b5b5cfec0..4c0ee48503 100644 --- a/voxygen/src/hud/img_ids.rs +++ b/voxygen/src/hud/img_ids.rs @@ -596,6 +596,7 @@ image_ids! { debuff_crippled_0: "voxygen.element.de_buffs.debuff_cripple_0", debuff_frozen_0: "voxygen.element.de_buffs.debuff_frozen_0", debuff_wet_0: "voxygen.element.de_buffs.debuff_wet_0", + debuff_ensnared_0: "voxygen.element.de_buffs.debuff_ensnared_0", // Animation Frames // Buff Frame diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 5d1b45e4e0..b212622cbc 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -3822,7 +3822,7 @@ pub fn get_buff_image(buff: BuffKind, imgs: &Imgs) -> conrod_core::image::Id { BuffKind::Crippled { .. } => imgs.debuff_crippled_0, BuffKind::Frozen { .. } => imgs.debuff_frozen_0, BuffKind::Wet { .. } => imgs.debuff_wet_0, - BuffKind::Ensnared { .. } => imgs.debuff_crippled_0, + BuffKind::Ensnared { .. } => imgs.debuff_ensnared_0, } }