From db8d189ebde6978e0250bfdb92d587138f7ca5a7 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] Added burning debuff for Staff M2 --- Cargo.toml | 1 - assets/common/abilities/staff/flamethrower.ron | 7 ++++++- .../voxygen/element/de_buffs/debuff_burning_0.png | Bin 0 -> 246 bytes 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, 31 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 0000000000000000000000000000000000000000..7390789c909f7c0314f748bbaa31883cce30cb92 GIT binary patch literal 246 zcmVLp}a1IB) zQ~o@u&}!2J%)xlnRlwJwYX w{ZcfmPqt0K(zEQQuoR%JKM&Zie*p*N@(s+2 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, )