From 8da2871897a905f5edc6552b4edaf2b427af9dc6 Mon Sep 17 00:00:00 2001 From: Monty Marz Date: Thu, 5 Nov 2020 21:02:54 +0100 Subject: [PATCH] potion buff --- assets/common/items/consumable/potion_big.ron | 2 +- assets/common/items/consumable/potion_med.ron | 2 +- assets/common/items/consumable/potion_minor.ron | 2 +- .../element/icons/de_buffs/buff_potion_0.png | Bin 0 -> 2139 bytes assets/voxygen/i18n/en.ron | 2 ++ common/src/comp/buff.rs | 7 +++++-- voxygen/src/hud/buffs.rs | 14 ++++++++++++++ voxygen/src/hud/group.rs | 1 + voxygen/src/hud/img_ids.rs | 1 + voxygen/src/hud/overhead.rs | 1 + 10 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 assets/voxygen/element/icons/de_buffs/buff_potion_0.png diff --git a/assets/common/items/consumable/potion_big.ron b/assets/common/items/consumable/potion_big.ron index d5849b7926..f16bab60e6 100644 --- a/assets/common/items/consumable/potion_big.ron +++ b/assets/common/items/consumable/potion_big.ron @@ -5,7 +5,7 @@ ItemDef( kind: "PotionLarge", effect: [ Buff(( - kind: Saturation, + kind: Potion, data: ( strength: 1000.0, duration: Some(( diff --git a/assets/common/items/consumable/potion_med.ron b/assets/common/items/consumable/potion_med.ron index 081b87cdff..2c3167d58b 100644 --- a/assets/common/items/consumable/potion_med.ron +++ b/assets/common/items/consumable/potion_med.ron @@ -5,7 +5,7 @@ ItemDef( kind: "PotionMed", effect: [ Buff(( - kind: Saturation, + kind: Potion, data: ( strength: 700.0, duration: Some(( diff --git a/assets/common/items/consumable/potion_minor.ron b/assets/common/items/consumable/potion_minor.ron index 7794c253e1..f829d67b1e 100644 --- a/assets/common/items/consumable/potion_minor.ron +++ b/assets/common/items/consumable/potion_minor.ron @@ -5,7 +5,7 @@ ItemDef( kind: "PotionMinor", effect: [ Buff(( - kind: Saturation, + kind: Potion, data: ( strength: 500.0, duration: Some(( diff --git a/assets/voxygen/element/icons/de_buffs/buff_potion_0.png b/assets/voxygen/element/icons/de_buffs/buff_potion_0.png new file mode 100644 index 0000000000000000000000000000000000000000..26d31655c3020d254f3bc8c6264072122fecd42b GIT binary patch literal 2139 zcmcIlOKjX!6g31vXgd;BgIa+=t}7u>>+$om$3HSD^J``#CJE_4!>-TI&ofqLY-2l_ zNrV7(kv0pYstb^S1+YMBRUx%2BoK)55gXR5p?f|{7N}g$FGHJ#2#JwAwx91i_uPB# zeRq3lVLo%4BQ?KtFOi!ckoDhJ;1&9!7+||$LsY>g9z#t_9EOvLx_*lVmk76jF!$N_~kh1rg)5 zED|X~nAgp$tf{JDoZ>OUNJ6?KBN1Z@X;x0*hd%+lMUHDNm(L7+!CPKvB}r&WQn%a9 zc9m=pH6__JO$lKMV-YOGc*9RfPxRvxBZM-GY2<~87x;XNNbF!O$qT@A5JD#$!}{?s zO^`6DM?y)?qBNwDVZFY$X{R%`j+4qdcp38D6*z8egiKmyaj+IqR#|6$a$@8xYz0XW zw}Sg{8-M->Lx+wXhHFu~pB{%wtj#)r9fPgh=NDR~h>;|S8bQz=3AHrx$YVK+`Df30 zz7urg=Tb()4XjKOmKRdhM379z4Ny%rECroJARii-)}am@l8{MbSwy)8Mi$a7SviU1 z9pk|9+>QO1*6UWyj}zikRx9TPAeHqz2jCP;H5G|UPA4KYRZTQC#S|5cREAaRx=8Nx zg8k)yuBDks_Yca}2`FHUvuP>RCNe_0m{S15c2z^P4O0_k(?Evf8Vb_r2yHR)pmRuj z5;bMz0HWz)9lKN)iLEnHH-VpFVpAkKa%HLzBD+}Ncl?%ub`aGA2ePY7uGdPXr6_Q{ zHhhSe=Zk!;Qqp8o(?pzwupDZ+LDV5oXkLdjnH2iXwCsTfgj@Au(0F6mNN3q=!>6{# z_p8$)G;NB!K+|eqjxb#Ic1iR80vf<}TMR(=sFHzM9JooBM6A#RN&dA8rTdYO$@<>Z z36fpIQB_g5bwzZkYKyjlOekMPGpUIkP-7JO|3ZD3R@x$dlfelq3I9Eq{gwN@I_%nj z`_lnu(d20`*mPGgQhKlsDonb&_;#v%)F}n%;j}d4p{7OB9IHDwY9WId7!<-F7Brw{ zLkkhtRYj_(dJZ{`qngTW-*4NycXzQ;&@n0(ONv>j6lB>b6;P?7l?{BRSdc4dVrL&? zKtbA@Yu|EWoPgW@63nRdaXcL1WjtP)4~j=HJiB*pz5#=GqgF07jKj3LxY*==xzo6H z==?Xyrh4^4!TmZjqaOKi`nLMmLzf@_cY$a|bW~IrHSD zr)Q^b7q4v{|MJ*(&s_ZJh1a)!UM?lKzHd&yM5;fmeI{(Tr>_25ym=*a true, BuffKind::Bleeding { .. } => false, BuffKind::Cursed { .. } => false, + BuffKind::Potion {..} => true, } } } @@ -124,13 +127,13 @@ impl Buff { }], data.duration, ), - BuffKind::Regeneration | BuffKind::Saturation => ( + BuffKind::Regeneration | BuffKind::Saturation | BuffKind::Potion => ( vec![BuffEffect::HealthChangeOverTime { rate: data.strength, accumulated: 0.0, }], data.duration, - ), + ), BuffKind::Cursed => ( vec![BuffEffect::MaxHealthModifier { value: -100. * data.strength, diff --git a/voxygen/src/hud/buffs.rs b/voxygen/src/hud/buffs.rs index 6e1e86f34f..da15858f8e 100644 --- a/voxygen/src/hud/buffs.rs +++ b/voxygen/src/hud/buffs.rs @@ -183,6 +183,7 @@ impl<'a> Widget for BuffsBar<'a> { let buff_img = match buff.kind { BuffKind::Regeneration { .. } => self.imgs.buff_plus_0, BuffKind::Saturation { .. } => self.imgs.buff_saturation_0, + BuffKind::Potion { .. } => self.imgs.buff_potion_0, _ => self.imgs.missing_icon, }; let buff_widget = Image::new(buff_img).w_h(20.0, 20.0); @@ -209,6 +210,9 @@ impl<'a> Widget for BuffsBar<'a> { BuffKind::Saturation { .. } => { localized_strings.get("buff.title.saturation") }, + BuffKind::Potion { .. } => { + localized_strings.get("buff.title.potion") + }, _ => localized_strings.get("buff.title.missing"), }; let remaining_time = if current_duration.is_none() { @@ -222,6 +226,9 @@ impl<'a> Widget for BuffsBar<'a> { BuffKind::Saturation { .. } => { localized_strings.get("buff.desc.saturation") }, + BuffKind::Potion { .. } => { + localized_strings.get("buff.desc.potion") + }, _ => localized_strings.get("buff.desc.missing"), }; let desc = format!("{}\n\n{}\n\n{}", desc_txt, remaining_time, click_to_remove); @@ -381,6 +388,7 @@ impl<'a> Widget for BuffsBar<'a> { BuffKind::Saturation { .. } => self.imgs.buff_saturation_0, BuffKind::Bleeding { .. } => self.imgs.debuff_bleed_0, BuffKind::Cursed { .. } => self.imgs.debuff_skull_0, + BuffKind::Potion { .. } => self.imgs.buff_potion_0, }; let buff_widget = Image::new(buff_img).w_h(40.0, 40.0); // Sort buffs into rows of 6 slots @@ -406,6 +414,9 @@ impl<'a> Widget for BuffsBar<'a> { BuffKind::Saturation { .. } => { localized_strings.get("buff.title.saturation") }, + BuffKind::Potion { .. } => { + localized_strings.get("buff.title.potion") + }, BuffKind::Bleeding { .. } => localized_strings.get("debuff.title.bleed"), _ => localized_strings.get("buff.title.missing"), }; @@ -420,6 +431,9 @@ impl<'a> Widget for BuffsBar<'a> { BuffKind::Saturation { .. } => { localized_strings.get("buff.desc.saturation") }, + BuffKind::Potion { .. } => { + localized_strings.get("buff.desc.potion") + }, BuffKind::Bleeding { .. } => localized_strings.get("debuff.desc.bleed"), _ => localized_strings.get("buff.desc.missing"), }; diff --git a/voxygen/src/hud/group.rs b/voxygen/src/hud/group.rs index 516e36046e..6e12c18fed 100644 --- a/voxygen/src/hud/group.rs +++ b/voxygen/src/hud/group.rs @@ -485,6 +485,7 @@ impl<'a> Widget for Group<'a> { BuffKind::Saturation { .. } => self.imgs.buff_saturation_0, BuffKind::Bleeding { .. } => self.imgs.debuff_bleed_0, BuffKind::Cursed { .. } => self.imgs.debuff_skull_0, + BuffKind::Potion { .. } => self.imgs.buff_potion_0, }; let buff_widget = Image::new(buff_img).w_h(15.0, 15.0); let buff_widget = if let Some(id) = prev_id { diff --git a/voxygen/src/hud/img_ids.rs b/voxygen/src/hud/img_ids.rs index fe7c495b64..48a42cd860 100644 --- a/voxygen/src/hud/img_ids.rs +++ b/voxygen/src/hud/img_ids.rs @@ -353,6 +353,7 @@ image_ids! { // Buffs buff_plus_0: "voxygen.element.icons.de_buffs.buff_plus_0", buff_saturation_0: "voxygen.element.icons.de_buffs.buff_saturation_0", + buff_potion_0: "voxygen.element.icons.de_buffs.buff_potion_0", // Debuffs debuff_skull_0: "voxygen.element.icons.de_buffs.debuff_skull_0", diff --git a/voxygen/src/hud/overhead.rs b/voxygen/src/hud/overhead.rs index 202082bf29..8d592a3501 100644 --- a/voxygen/src/hud/overhead.rs +++ b/voxygen/src/hud/overhead.rs @@ -246,6 +246,7 @@ impl<'a> Widget for Overhead<'a> { BuffKind::Saturation { .. } => self.imgs.buff_saturation_0, BuffKind::Bleeding { .. } => self.imgs.debuff_bleed_0, BuffKind::Cursed { .. } => self.imgs.debuff_skull_0, + BuffKind::Potion { .. } => self.imgs.buff_potion_0, }; let buff_widget = Image::new(buff_img).w_h(20.0, 20.0); // Sort buffs into rows of 5 slots