From fcde358b86f69b5dc7fa4a4b22d8f7730ee85fa6 Mon Sep 17 00:00:00 2001 From: Adam Whitehurst Date: Sun, 30 May 2021 08:51:47 -0700 Subject: [PATCH] feat: BuffKind::Frozen --- common/src/cmd.rs | 1 + common/src/comp/buff.rs | 4 ++++ voxygen/src/hud/chat.rs | 1 + voxygen/src/hud/mod.rs | 3 +++ voxygen/src/hud/util.rs | 6 ++++-- 5 files changed, 13 insertions(+), 2 deletions(-) diff --git a/common/src/cmd.rs b/common/src/cmd.rs index ae753992c6..eed06fca75 100644 --- a/common/src/cmd.rs +++ b/common/src/cmd.rs @@ -270,6 +270,7 @@ lazy_static! { BuffKind::ProtectingWard => "protecting_ward", BuffKind::Frenzied => "frenzied", BuffKind::Crippled => "crippled", + BuffKind::Frozen => "frozen", }; let mut buff_parser = HashMap::new(); BuffKind::iter().for_each(|kind| {buff_parser.insert(string_from_buff(kind).to_string(), kind);}); diff --git a/common/src/comp/buff.rs b/common/src/comp/buff.rs index b7bbe5bacb..cb63ff55f9 100644 --- a/common/src/comp/buff.rs +++ b/common/src/comp/buff.rs @@ -62,6 +62,8 @@ pub enum BuffKind { /// Strength scales the movement speed debuff non-linearly. 0.5 is 50% /// speed, 1.0 is 33% speed. Bleeding is at 10x the value of the strength. Crippled, + /// Prevents actions + Frozen, } #[cfg(not(target_arch = "wasm32"))] @@ -82,6 +84,7 @@ impl BuffKind { BuffKind::Burning => false, BuffKind::Crippled => false, BuffKind::Frenzied => true, + BuffKind::Frozen => false, } } @@ -301,6 +304,7 @@ impl Buff { ], data.duration, ), + BuffKind::Frozen => (vec![BuffEffect::MovementSpeed(0.1)], data.duration), }; Buff { kind, diff --git a/voxygen/src/hud/chat.rs b/voxygen/src/hud/chat.rs index 3943a0891d..e4f6c8c072 100644 --- a/voxygen/src/hud/chat.rs +++ b/voxygen/src/hud/chat.rs @@ -743,6 +743,7 @@ fn insert_killing_buff(buff: BuffKind, localized_strings: &Localization, templat BuffKind::Bleeding => localized_strings.get("hud.outcome.bleeding"), BuffKind::Cursed => localized_strings.get("hud.outcome.curse"), BuffKind::Crippled => localized_strings.get("hud.outcome.crippled"), + BuffKind::Frozen => localized_strings.get("hud.outcome.frozen"), BuffKind::Regeneration | BuffKind::Saturation | BuffKind::Potion diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 22ee597401..bc8b194fc0 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -3736,6 +3736,7 @@ pub fn get_buff_image(buff: BuffKind, imgs: &Imgs) -> conrod_core::image::Id { BuffKind::Cursed { .. } => imgs.debuff_skull_0, BuffKind::Burning { .. } => imgs.debuff_burning_0, BuffKind::Crippled { .. } => imgs.debuff_crippled_0, + BuffKind::Frozen { .. } => imgs.debuff_frozen_0, } } @@ -3756,6 +3757,7 @@ pub fn get_buff_title(buff: BuffKind, localized_strings: &Localization) -> &str BuffKind::Cursed { .. } => localized_strings.get("buff.title.cursed"), BuffKind::Burning { .. } => localized_strings.get("buff.title.burn"), BuffKind::Crippled { .. } => localized_strings.get("buff.title.crippled"), + BuffKind::Frozen { .. } => localized_strings.get("buff.title.frozen"), } } @@ -3788,6 +3790,7 @@ pub fn get_buff_desc(buff: BuffKind, data: BuffData, localized_strings: &Localiz BuffKind::Cursed { .. } => Cow::Borrowed(localized_strings.get("buff.desc.cursed")), BuffKind::Burning { .. } => Cow::Borrowed(localized_strings.get("buff.desc.burn")), BuffKind::Crippled { .. } => Cow::Borrowed(localized_strings.get("buff.desc.crippled")), + BuffKind::Frozen { .. } => Cow::Borrowed(localized_strings.get("buff.desc.frozen")), } } diff --git a/voxygen/src/hud/util.rs b/voxygen/src/hud/util.rs index 68271e7ebb..c2eddec4f3 100644 --- a/voxygen/src/hud/util.rs +++ b/voxygen/src/hud/util.rs @@ -120,7 +120,8 @@ pub fn consumable_desc(effects: &[Effect], i18n: &Localization) -> String { | BuffKind::Cursed | BuffKind::ProtectingWard | BuffKind::Crippled - | BuffKind::Frenzied => continue, + | BuffKind::Frenzied + | BuffKind::Frozen => continue, }; write!(&mut description, "{}", buff_desc).unwrap(); @@ -142,7 +143,8 @@ pub fn consumable_desc(effects: &[Effect], i18n: &Localization) -> String { | BuffKind::Cursed | BuffKind::ProtectingWard | BuffKind::Crippled - | BuffKind::Frenzied => continue, + | BuffKind::Frenzied + | BuffKind::Frozen => continue, } } else if let BuffKind::Saturation | BuffKind::Regeneration = buff.kind { i18n.get("buff.text.every_second").to_string()