Merge branch 'gGmMsS/Burning' into 'master'

Added burning debuff for Staff M2

See merge request veloren/veloren!2134
This commit is contained in:
Samuel Keiffer 2021-04-15 23:51:33 +00:00
commit c962c5f12e
8 changed files with 34 additions and 3 deletions

View File

@ -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,

BIN
assets/voxygen/element/de_buffs/debuff_burning_0.png (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -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": "You are burning alive",
// Buffs stats
"buff.stat.health": "Restores {str_total} Health",
"buff.stat.increase_max_stamina": "Raises Maximum Stamina by {strength}",

View File

@ -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 {
/// Does damage to a creature 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,

View File

@ -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

View File

@ -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"),
}
}

View File

@ -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

View File

@ -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,
)