From 0d956610ecc431f7690d80b9d40c578e30deac31 Mon Sep 17 00:00:00 2001 From: gGmMsS123 <82216659+gGmMsS123@users.noreply.github.com> Date: Thu, 15 Apr 2021 23:32:38 +0300 Subject: [PATCH 1/3] Added burning debuff for Staff M2 --- Cargo.toml | 1 - assets/common/abilities/staff/flamethrower.ron | 7 ++++++- assets/voxygen/element/de_buffs/debuff_burning_0.png | 3 +++ assets/voxygen/i18n/en/buff.ron | 2 ++ common/src/comp/buff.rs | 11 +++++++++++ voxygen/src/hud/img_ids.rs | 1 + voxygen/src/hud/mod.rs | 3 +++ voxygen/src/hud/util.rs | 2 ++ voxygen/src/scene/particle.rs | 8 ++++++-- 9 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 assets/voxygen/element/de_buffs/debuff_burning_0.png diff --git a/Cargo.toml b/Cargo.toml index 1b657f0627..ac2e2d2a80 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,7 +48,6 @@ opt-level = 2 [profile.dev.package."veloren-server-cli"] opt-level = 2 [profile.dev.package."veloren-voxygen"] -incremental = true opt-level = 2 [profile.dev.package."veloren-world"] opt-level = 2 diff --git a/assets/common/abilities/staff/flamethrower.ron b/assets/common/abilities/staff/flamethrower.ron index 9ea6a41c73..4e0194fbe3 100644 --- a/assets/common/abilities/staff/flamethrower.ron +++ b/assets/common/abilities/staff/flamethrower.ron @@ -6,7 +6,12 @@ BasicBeam( tick_rate: 3.0, range: 20.0, max_angle: 15.0, - damage_effect: None, + damage_effect: Some(Buff(( + kind: Burning, + dur_secs: 10.0, + strength: DamageFraction(0.5), + chance: 0.25, + ))), energy_regen: 0, energy_drain: 350, orientation_behavior: Normal, diff --git a/assets/voxygen/element/de_buffs/debuff_burning_0.png b/assets/voxygen/element/de_buffs/debuff_burning_0.png new file mode 100644 index 0000000000..3d154f7ddb --- /dev/null +++ b/assets/voxygen/element/de_buffs/debuff_burning_0.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:89f5c6858fb365952dfc66acc6c00a8958df4ac8c4d3c6f980f92b1a53a9f45f +size 246 diff --git a/assets/voxygen/i18n/en/buff.ron b/assets/voxygen/i18n/en/buff.ron index 9fa2439d4a..d8987d56a5 100644 --- a/assets/voxygen/i18n/en/buff.ron +++ b/assets/voxygen/i18n/en/buff.ron @@ -24,6 +24,8 @@ "buff.desc.bleed": "Inflicts regular damage.", "buff.title.cursed": "Cursed", "buff.desc.cursed": "You are cursed.", + "buff.title.burn": "On Fire", + "buff.desc.burn": "Burn, baby, burn", // Buffs stats "buff.stat.health": "Restores {str_total} Health", "buff.stat.increase_max_stamina": "Raises Maximum Stamina by {strength}", diff --git a/common/src/comp/buff.rs b/common/src/comp/buff.rs index 5d5f76a187..c4e6b938f4 100644 --- a/common/src/comp/buff.rs +++ b/common/src/comp/buff.rs @@ -14,6 +14,8 @@ use std::{cmp::Ordering, time::Duration}; /// This is used to determine what effects a buff will have #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, Serialize, Deserialize, PartialOrd, Ord)] pub enum BuffKind { + /// Lower a creature's max health over time + Burning, /// Restores health/time for some period Regeneration, /// Restores health/time for some period for consumables @@ -51,6 +53,7 @@ impl BuffKind { BuffKind::IncreaseMaxHealth => true, BuffKind::Invulnerability => true, BuffKind::ProtectingWard => true, + BuffKind::Burning => false, } } @@ -236,6 +239,14 @@ impl Buff { )], data.duration, ), + BuffKind::Burning => ( + vec![BuffEffect::HealthChangeOverTime { + rate: -data.strength, + accumulated: 0.0, + kind: ModifierKind::Additive, + }], + data.duration, + ), }; Buff { kind, diff --git a/voxygen/src/hud/img_ids.rs b/voxygen/src/hud/img_ids.rs index 33c6cabf6a..3a3af7b30e 100644 --- a/voxygen/src/hud/img_ids.rs +++ b/voxygen/src/hud/img_ids.rs @@ -566,6 +566,7 @@ image_ids! { // Debuffs debuff_skull_0: "voxygen.element.de_buffs.debuff_skull_0", debuff_bleed_0: "voxygen.element.de_buffs.debuff_bleed_0", + debuff_burning_0: "voxygen.element.de_buffs.debuff_burning_0", // Animation Frames // Buff Frame diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 56eb81ea86..22b707b82c 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -3447,6 +3447,7 @@ pub fn get_buff_image(buff: BuffKind, imgs: &Imgs) -> conrod_core::image::Id { // Debuffs BuffKind::Bleeding { .. } => imgs.debuff_bleed_0, BuffKind::Cursed { .. } => imgs.debuff_skull_0, + BuffKind::Burning { .. } => imgs.debuff_burning_0, } } @@ -3464,6 +3465,7 @@ pub fn get_buff_title(buff: BuffKind, localized_strings: &Localization) -> &str // Debuffs BuffKind::Bleeding { .. } => localized_strings.get("buff.title.bleed"), BuffKind::Cursed { .. } => localized_strings.get("buff.title.cursed"), + BuffKind::Burning { .. } => localized_strings.get("buff.title.burn"), } } @@ -3481,6 +3483,7 @@ pub fn get_buff_desc(buff: BuffKind, localized_strings: &Localization) -> &str { // Debuffs BuffKind::Bleeding { .. } => localized_strings.get("buff.desc.bleed"), BuffKind::Cursed { .. } => localized_strings.get("buff.desc.cursed"), + BuffKind::Burning { .. } => localized_strings.get("buff.desc.burn"), } } diff --git a/voxygen/src/hud/util.rs b/voxygen/src/hud/util.rs index aa5c18b5c6..8b6dcf69fc 100644 --- a/voxygen/src/hud/util.rs +++ b/voxygen/src/hud/util.rs @@ -115,6 +115,7 @@ pub fn consumable_desc(effects: &[Effect], i18n: &Localization) -> String { .replace("{strength}", &strength.to_string()), BuffKind::Invulnerability => i18n.get("buff.stat.invulnerability").to_string(), BuffKind::Bleeding + | BuffKind::Burning | BuffKind::CampfireHeal | BuffKind::Cursed | BuffKind::ProtectingWard => continue, @@ -133,6 +134,7 @@ pub fn consumable_desc(effects: &[Effect], i18n: &Localization) -> String { .get("buff.text.for_seconds") .replace("{dur_secs}", &dur_secs.to_string()), BuffKind::Bleeding + | BuffKind::Burning | BuffKind::Potion | BuffKind::CampfireHeal | BuffKind::Cursed diff --git a/voxygen/src/scene/particle.rs b/voxygen/src/scene/particle.rs index 9f2f6a4606..b58bbff27f 100644 --- a/voxygen/src/scene/particle.rs +++ b/voxygen/src/scene/particle.rs @@ -807,7 +807,7 @@ impl ParticleMgr { for (buff_kind, _) in buffs.kinds.iter() { #[allow(clippy::single_match)] match buff_kind { - buff::BuffKind::Cursed => { + buff::BuffKind::Cursed | buff::BuffKind::Burning => { self.particles.resize_with( self.particles.len() + usize::from(self.scheduler.heartbeats(Duration::from_millis(15))), @@ -826,7 +826,11 @@ impl ParticleMgr { Particle::new_directed( Duration::from_secs(1), time, - ParticleMode::CultistFlame, + if matches!(buff_kind, buff::BuffKind::Cursed) { + ParticleMode::CultistFlame + } else { + ParticleMode::FlameThrower + }, start_pos, end_pos, ) From e33961e1fa5d45ad0518cc4d8d17b0fecefdcd55 Mon Sep 17 00:00:00 2001 From: gGmMsS123 <82216659+gGmMsS123@users.noreply.github.com> Date: Fri, 16 Apr 2021 00:34:24 +0300 Subject: [PATCH 2/3] M2 Staff Final Touch --- Cargo.toml | 1 + assets/voxygen/i18n/en/buff.ron | 2 +- common/src/comp/buff.rs | 3 ++- voxygen/src/hud/mod.rs | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ac2e2d2a80..1b657f0627 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,6 +48,7 @@ opt-level = 2 [profile.dev.package."veloren-server-cli"] opt-level = 2 [profile.dev.package."veloren-voxygen"] +incremental = true opt-level = 2 [profile.dev.package."veloren-world"] opt-level = 2 diff --git a/assets/voxygen/i18n/en/buff.ron b/assets/voxygen/i18n/en/buff.ron index d8987d56a5..ea4187e202 100644 --- a/assets/voxygen/i18n/en/buff.ron +++ b/assets/voxygen/i18n/en/buff.ron @@ -25,7 +25,7 @@ "buff.title.cursed": "Cursed", "buff.desc.cursed": "You are cursed.", "buff.title.burn": "On Fire", - "buff.desc.burn": "Burn, baby, burn", + "buff.desc.burn": "You are burning alive", // Buffs stats "buff.stat.health": "Restores {str_total} Health", "buff.stat.increase_max_stamina": "Raises Maximum Stamina by {strength}", diff --git a/common/src/comp/buff.rs b/common/src/comp/buff.rs index c4e6b938f4..ae699a18ee 100644 --- a/common/src/comp/buff.rs +++ b/common/src/comp/buff.rs @@ -14,7 +14,7 @@ use std::{cmp::Ordering, time::Duration}; /// This is used to determine what effects a buff will have #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, Serialize, Deserialize, PartialOrd, Ord)] pub enum BuffKind { - /// Lower a creature's max health over time + /// Does damage to a creature over time Burning, /// Restores health/time for some period Regeneration, @@ -247,6 +247,7 @@ impl Buff { }], data.duration, ), + }; Buff { kind, diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 22b707b82c..af20191ced 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -3447,7 +3447,7 @@ pub fn get_buff_image(buff: BuffKind, imgs: &Imgs) -> conrod_core::image::Id { // Debuffs BuffKind::Bleeding { .. } => imgs.debuff_bleed_0, BuffKind::Cursed { .. } => imgs.debuff_skull_0, - BuffKind::Burning { .. } => imgs.debuff_burning_0, + BuffKind::Burning { .. } => imgs.debuff_burning_0, } } From d5a887f1958a9704adc4cbc895c33f2b96b1866b Mon Sep 17 00:00:00 2001 From: gGmMsS123 <82216659+gGmMsS123@users.noreply.github.com> Date: Fri, 16 Apr 2021 00:48:20 +0300 Subject: [PATCH 3/3] m2 staff --- common/src/comp/buff.rs | 1 - voxygen/src/hud/mod.rs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/common/src/comp/buff.rs b/common/src/comp/buff.rs index ae699a18ee..d0ab0b04ec 100644 --- a/common/src/comp/buff.rs +++ b/common/src/comp/buff.rs @@ -247,7 +247,6 @@ impl Buff { }], data.duration, ), - }; Buff { kind, diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index af20191ced..22b707b82c 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -3447,7 +3447,7 @@ pub fn get_buff_image(buff: BuffKind, imgs: &Imgs) -> conrod_core::image::Id { // Debuffs BuffKind::Bleeding { .. } => imgs.debuff_bleed_0, BuffKind::Cursed { .. } => imgs.debuff_skull_0, - BuffKind::Burning { .. } => imgs.debuff_burning_0, + BuffKind::Burning { .. } => imgs.debuff_burning_0, } }