mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
taoist/charms
This commit is contained in:
parent
8b835a91d0
commit
f18297ec75
20
assets/common/items/charms/burning_charm.ron
Normal file
20
assets/common/items/charms/burning_charm.ron
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
ItemDef(
|
||||||
|
name: "Blazing Charm",
|
||||||
|
description: "Flame is your ally, harness its power to burn your foes.",
|
||||||
|
kind: Consumable(
|
||||||
|
kind: Drink,
|
||||||
|
effects: All([
|
||||||
|
Buff((
|
||||||
|
kind: Flame,
|
||||||
|
data: (
|
||||||
|
strength: 0.4,
|
||||||
|
duration: Some(20),
|
||||||
|
),
|
||||||
|
cat_ids: [Natural],
|
||||||
|
)),
|
||||||
|
|
||||||
|
])
|
||||||
|
),
|
||||||
|
quality: Legendary,
|
||||||
|
tags: [],
|
||||||
|
)
|
20
assets/common/items/charms/frozen_charm.ron
Normal file
20
assets/common/items/charms/frozen_charm.ron
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
ItemDef(
|
||||||
|
name: "Freezing Charm",
|
||||||
|
description: "Let your enemies feel the sting of cold as you freeze them in their tracks.",
|
||||||
|
kind: Consumable(
|
||||||
|
kind: Drink,
|
||||||
|
effects: All([
|
||||||
|
Buff((
|
||||||
|
kind: Frigid,
|
||||||
|
data: (
|
||||||
|
strength: 0.4,
|
||||||
|
duration: Some(20),
|
||||||
|
),
|
||||||
|
cat_ids: [Natural],
|
||||||
|
)),
|
||||||
|
|
||||||
|
])
|
||||||
|
),
|
||||||
|
quality: Legendary,
|
||||||
|
tags: [],
|
||||||
|
)
|
20
assets/common/items/charms/lifesteal_charm.ron
Normal file
20
assets/common/items/charms/lifesteal_charm.ron
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
ItemDef(
|
||||||
|
name: "Siphon Charm",
|
||||||
|
description: "Siphon your target life and use it for your own.",
|
||||||
|
kind: Consumable(
|
||||||
|
kind: Drink,
|
||||||
|
effects: All([
|
||||||
|
Buff((
|
||||||
|
kind: Lifesteal,
|
||||||
|
data: (
|
||||||
|
strength: 0.4,
|
||||||
|
duration: Some(20),
|
||||||
|
),
|
||||||
|
cat_ids: [Natural],
|
||||||
|
)),
|
||||||
|
|
||||||
|
])
|
||||||
|
),
|
||||||
|
quality: Legendary,
|
||||||
|
tags: [],
|
||||||
|
)
|
@ -79,6 +79,15 @@ buff-desc-reckless = Your attacks are more powerful, however you are leaving you
|
|||||||
## Polymorped
|
## Polymorped
|
||||||
buff-title-polymorphed = Polymorphed
|
buff-title-polymorphed = Polymorphed
|
||||||
buff-desc-polymorphed = Your body changes form.
|
buff-desc-polymorphed = Your body changes form.
|
||||||
|
## Flame
|
||||||
|
buff-title-flame = Flame
|
||||||
|
buff-desc-flame = Flame is your ally.
|
||||||
|
## Frigid
|
||||||
|
buff-title-frigid = Frigid
|
||||||
|
buff-desc-frigid = Freeze your foes.
|
||||||
|
## Lifesteal
|
||||||
|
buff-title-lifesteal = Lifesteal
|
||||||
|
buff-desc-lifesteal = Siphon your enemies life away.
|
||||||
## Util
|
## Util
|
||||||
buff-text-over_seconds = over { $dur_secs } seconds
|
buff-text-over_seconds = over { $dur_secs } seconds
|
||||||
buff-text-for_seconds = for { $dur_secs } seconds
|
buff-text-for_seconds = for { $dur_secs } seconds
|
||||||
|
@ -3154,6 +3154,18 @@
|
|||||||
"voxel.object.curious_potion",
|
"voxel.object.curious_potion",
|
||||||
(0.0, 0.0, 0.0), (-50.0, 30.0, 20.0), 0.7,
|
(0.0, 0.0, 0.0), (-50.0, 30.0, 20.0), 0.7,
|
||||||
),
|
),
|
||||||
|
Simple("common.items.charms.burning_charm"): VoxTrans(
|
||||||
|
"voxel.object.burning_charm",
|
||||||
|
(0.0, 0.0, 0.0), (-80.0, 15.0, 15.0), 1.0,
|
||||||
|
),
|
||||||
|
Simple("common.items.charms.frozen_charm"): VoxTrans(
|
||||||
|
"voxel.object.frozen_charm",
|
||||||
|
(0.0, 0.0, 0.0), (-80.0, 15.0, 15.0), 1.0,
|
||||||
|
),
|
||||||
|
Simple("common.items.charms.lifesteal_charm"): VoxTrans(
|
||||||
|
"voxel.object.lifesteal_charm",
|
||||||
|
(0.0, 0.0, 0.0), (-80.0, 15.0, 15.0), 1.0,
|
||||||
|
),
|
||||||
Simple("common.items.food.cheese"): VoxTrans(
|
Simple("common.items.food.cheese"): VoxTrans(
|
||||||
"voxel.object.cheese",
|
"voxel.object.cheese",
|
||||||
(0.0, 0.0, 0.0), (-60.0, 27.0, 17.0), 0.7,
|
(0.0, 0.0, 0.0), (-60.0, 27.0, 17.0), 0.7,
|
||||||
|
@ -798,6 +798,9 @@
|
|||||||
Simple("common.items.consumable.potion_minor"): "voxel.object.potion_red",
|
Simple("common.items.consumable.potion_minor"): "voxel.object.potion_red",
|
||||||
Simple("common.items.consumable.potion_big"): "voxel.object.potion_red",
|
Simple("common.items.consumable.potion_big"): "voxel.object.potion_red",
|
||||||
Simple("common.items.consumable.curious_potion"): "voxel.object.curious_potion",
|
Simple("common.items.consumable.curious_potion"): "voxel.object.curious_potion",
|
||||||
|
Simple("common.items.charms.burning_charm"): "voxel.object.burning_charm",
|
||||||
|
Simple("common.items.charms.frozen_charm"): "voxel.object.frozen_charm",
|
||||||
|
Simple("common.items.charms.lifesteal_charm"): "voxel.object.lifesteal_charm",
|
||||||
Simple("common.items.boss_drops.potions"): "voxel.object.potion_red",
|
Simple("common.items.boss_drops.potions"): "voxel.object.potion_red",
|
||||||
Simple("common.items.food.cheese"): "voxel.object.cheese",
|
Simple("common.items.food.cheese"): "voxel.object.cheese",
|
||||||
Simple("common.items.food.blue_cheese"): "voxel.object.blue_cheese",
|
Simple("common.items.food.blue_cheese"): "voxel.object.blue_cheese",
|
||||||
|
BIN
assets/voxygen/voxel/object/burning_charm.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/object/burning_charm.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/object/frozen_charm.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/object/frozen_charm.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/object/lifesteal_charm.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/object/lifesteal_charm.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -158,6 +158,9 @@ lazy_static! {
|
|||||||
BuffKind::PotionSickness => "potion_sickness",
|
BuffKind::PotionSickness => "potion_sickness",
|
||||||
BuffKind::Reckless => "reckless",
|
BuffKind::Reckless => "reckless",
|
||||||
BuffKind::Polymorphed(_) => "polymorphed",
|
BuffKind::Polymorphed(_) => "polymorphed",
|
||||||
|
BuffKind::Flame => "flame",
|
||||||
|
BuffKind::Frigid => "frigid",
|
||||||
|
BuffKind::Lifesteal => "lifesteal",
|
||||||
};
|
};
|
||||||
let mut buff_parser = HashMap::new();
|
let mut buff_parser = HashMap::new();
|
||||||
for kind in BuffKind::iter() {
|
for kind in BuffKind::iter() {
|
||||||
|
@ -516,6 +516,12 @@ impl Attack {
|
|||||||
for effect in self
|
for effect in self
|
||||||
.effects
|
.effects
|
||||||
.iter()
|
.iter()
|
||||||
|
.chain(
|
||||||
|
attacker
|
||||||
|
.and_then(|attacker| attacker.stats)
|
||||||
|
.iter()
|
||||||
|
.flat_map(|stats| stats.buffs_on_hit.iter()),
|
||||||
|
)
|
||||||
.filter(|e| e.target.map_or(true, |t| t == target_group))
|
.filter(|e| e.target.map_or(true, |t| t == target_group))
|
||||||
.filter(|e| !avoid_effect(e))
|
.filter(|e| !avoid_effect(e))
|
||||||
{
|
{
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
#![allow(clippy::nonstandard_macro_braces)] //tmp as of false positive !?
|
#![allow(clippy::nonstandard_macro_braces)] //tmp as of false positive !?
|
||||||
use crate::{
|
use crate::{
|
||||||
|
combat::{AttackEffect, CombatBuff, CombatBuffStrength, CombatEffect},
|
||||||
comp::{aura::AuraKey, Health, Stats},
|
comp::{aura::AuraKey, Health, Stats},
|
||||||
resources::{Secs, Time},
|
resources::{Secs, Time},
|
||||||
uid::Uid,
|
uid::Uid,
|
||||||
};
|
};
|
||||||
|
|
||||||
use core::cmp::Ordering;
|
use core::cmp::Ordering;
|
||||||
#[cfg(not(target_arch = "wasm32"))]
|
#[cfg(not(target_arch = "wasm32"))]
|
||||||
use hashbrown::HashMap;
|
use hashbrown::HashMap;
|
||||||
@ -111,6 +113,12 @@ pub enum BuffKind {
|
|||||||
PotionSickness,
|
PotionSickness,
|
||||||
// Changed into another body.
|
// Changed into another body.
|
||||||
Polymorphed(Body),
|
Polymorphed(Body),
|
||||||
|
// Inflict burning on your attack
|
||||||
|
Flame,
|
||||||
|
// Inflict frost on your attack
|
||||||
|
Frigid,
|
||||||
|
// Gain Lifesteal on your attack
|
||||||
|
Lifesteal,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(target_arch = "wasm32"))]
|
#[cfg(not(target_arch = "wasm32"))]
|
||||||
@ -130,7 +138,10 @@ impl BuffKind {
|
|||||||
| BuffKind::ProtectingWard
|
| BuffKind::ProtectingWard
|
||||||
| BuffKind::Hastened
|
| BuffKind::Hastened
|
||||||
| BuffKind::Fortitude
|
| BuffKind::Fortitude
|
||||||
| BuffKind::Reckless => true,
|
| BuffKind::Reckless
|
||||||
|
| BuffKind::Flame
|
||||||
|
| BuffKind::Frigid
|
||||||
|
| BuffKind::Lifesteal => true,
|
||||||
BuffKind::Bleeding
|
BuffKind::Bleeding
|
||||||
| BuffKind::Cursed
|
| BuffKind::Cursed
|
||||||
| BuffKind::Burning
|
| BuffKind::Burning
|
||||||
@ -285,6 +296,28 @@ impl BuffKind {
|
|||||||
BuffEffect::AttackDamage(1.0 + data.strength),
|
BuffEffect::AttackDamage(1.0 + data.strength),
|
||||||
],
|
],
|
||||||
BuffKind::Polymorphed(body) => vec![BuffEffect::BodyChange(*body)],
|
BuffKind::Polymorphed(body) => vec![BuffEffect::BodyChange(*body)],
|
||||||
|
BuffKind::Flame => vec![BuffEffect::BuffOnHit(AttackEffect::new(
|
||||||
|
None,
|
||||||
|
CombatEffect::Buff(CombatBuff {
|
||||||
|
kind: BuffKind::Burning,
|
||||||
|
dur_secs: 5.0,
|
||||||
|
strength: CombatBuffStrength::DamageFraction(0.2),
|
||||||
|
chance: 1.0,
|
||||||
|
}),
|
||||||
|
))],
|
||||||
|
BuffKind::Frigid => vec![BuffEffect::BuffOnHit(AttackEffect::new(
|
||||||
|
None,
|
||||||
|
CombatEffect::Buff(CombatBuff {
|
||||||
|
kind: BuffKind::Frozen,
|
||||||
|
dur_secs: 5.0,
|
||||||
|
strength: CombatBuffStrength::DamageFraction(0.2),
|
||||||
|
chance: 1.0,
|
||||||
|
}),
|
||||||
|
))],
|
||||||
|
BuffKind::Lifesteal => vec![BuffEffect::BuffOnHit(AttackEffect::new(
|
||||||
|
None,
|
||||||
|
CombatEffect::Lifesteal(0.2),
|
||||||
|
))],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -373,6 +406,8 @@ pub enum BuffEffect {
|
|||||||
CriticalChance(f32),
|
CriticalChance(f32),
|
||||||
/// Changes body.
|
/// Changes body.
|
||||||
BodyChange(Body),
|
BodyChange(Body),
|
||||||
|
/// Inflict buff to target
|
||||||
|
BuffOnHit(AttackEffect),
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Actual de/buff.
|
/// Actual de/buff.
|
||||||
|
@ -2,6 +2,8 @@ use serde::{Deserialize, Serialize};
|
|||||||
use specs::{Component, DerefFlaggedStorage};
|
use specs::{Component, DerefFlaggedStorage};
|
||||||
use std::{error::Error, fmt};
|
use std::{error::Error, fmt};
|
||||||
|
|
||||||
|
use crate::combat::AttackEffect;
|
||||||
|
|
||||||
use super::Body;
|
use super::Body;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
@ -62,6 +64,7 @@ pub struct Stats {
|
|||||||
pub poise_damage_modifier: f32,
|
pub poise_damage_modifier: f32,
|
||||||
pub attack_damage_modifier: f32,
|
pub attack_damage_modifier: f32,
|
||||||
pub crit_chance_modifier: f32,
|
pub crit_chance_modifier: f32,
|
||||||
|
pub buffs_on_hit: Vec<AttackEffect>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Stats {
|
impl Stats {
|
||||||
@ -80,6 +83,7 @@ impl Stats {
|
|||||||
poise_damage_modifier: 1.0,
|
poise_damage_modifier: 1.0,
|
||||||
attack_damage_modifier: 1.0,
|
attack_damage_modifier: 1.0,
|
||||||
crit_chance_modifier: 1.0,
|
crit_chance_modifier: 1.0,
|
||||||
|
buffs_on_hit: Vec::new(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -647,5 +647,6 @@ fn execute_effect(
|
|||||||
*body_override = Some(*b)
|
*body_override = Some(*b)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
BuffEffect::BuffOnHit(effect) => stat.buffs_on_hit.push(effect.clone()),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -116,7 +116,10 @@ pub fn localize_chat_message(
|
|||||||
| BuffKind::Frenzied
|
| BuffKind::Frenzied
|
||||||
| BuffKind::Hastened
|
| BuffKind::Hastened
|
||||||
| BuffKind::Fortitude
|
| BuffKind::Fortitude
|
||||||
| BuffKind::Reckless => {
|
| BuffKind::Reckless
|
||||||
|
| BuffKind::Flame
|
||||||
|
| BuffKind::Frigid
|
||||||
|
| BuffKind::Lifesteal => {
|
||||||
tracing::error!("Player was killed by a positive buff!");
|
tracing::error!("Player was killed by a positive buff!");
|
||||||
"hud-outcome-mysterious"
|
"hud-outcome-mysterious"
|
||||||
},
|
},
|
||||||
|
@ -5062,6 +5062,9 @@ pub fn get_buff_image(buff: BuffKind, imgs: &Imgs) -> conrod_core::image::Id {
|
|||||||
BuffKind::Hastened => imgs.buff_haste_0,
|
BuffKind::Hastened => imgs.buff_haste_0,
|
||||||
BuffKind::Fortitude => imgs.buff_fortitude_0,
|
BuffKind::Fortitude => imgs.buff_fortitude_0,
|
||||||
BuffKind::Reckless => imgs.buff_reckless,
|
BuffKind::Reckless => imgs.buff_reckless,
|
||||||
|
BuffKind::Flame => imgs.debuff_burning_0,
|
||||||
|
BuffKind::Frigid => imgs.debuff_frozen_0,
|
||||||
|
BuffKind::Lifesteal => imgs.buff_plus_0,
|
||||||
// Debuffs
|
// Debuffs
|
||||||
BuffKind::Bleeding => imgs.debuff_bleed_0,
|
BuffKind::Bleeding => imgs.debuff_bleed_0,
|
||||||
BuffKind::Cursed => imgs.debuff_skull_0,
|
BuffKind::Cursed => imgs.debuff_skull_0,
|
||||||
@ -5109,6 +5112,9 @@ pub fn get_buff_title(buff: BuffKind, localized_strings: &Localization) -> Cow<s
|
|||||||
BuffKind::Parried { .. } => localized_strings.get_msg("buff-title-parried"),
|
BuffKind::Parried { .. } => localized_strings.get_msg("buff-title-parried"),
|
||||||
BuffKind::PotionSickness { .. } => localized_strings.get_msg("buff-title-potionsickness"),
|
BuffKind::PotionSickness { .. } => localized_strings.get_msg("buff-title-potionsickness"),
|
||||||
BuffKind::Polymorphed { .. } => localized_strings.get_msg("buff-title-polymorphed"),
|
BuffKind::Polymorphed { .. } => localized_strings.get_msg("buff-title-polymorphed"),
|
||||||
|
BuffKind::Flame => localized_strings.get_msg("buff-title-burn"),
|
||||||
|
BuffKind::Frigid => localized_strings.get_msg("buff-title-frigid"),
|
||||||
|
BuffKind::Lifesteal => localized_strings.get_msg("buff-title-lifesteal"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5148,6 +5154,9 @@ pub fn get_buff_desc(buff: BuffKind, data: BuffData, localized_strings: &Localiz
|
|||||||
BuffKind::Parried { .. } => localized_strings.get_msg("buff-desc-parried"),
|
BuffKind::Parried { .. } => localized_strings.get_msg("buff-desc-parried"),
|
||||||
BuffKind::PotionSickness { .. } => localized_strings.get_msg("buff-desc-potionsickness"),
|
BuffKind::PotionSickness { .. } => localized_strings.get_msg("buff-desc-potionsickness"),
|
||||||
BuffKind::Polymorphed { .. } => localized_strings.get_msg("buff-desc-polymorphed"),
|
BuffKind::Polymorphed { .. } => localized_strings.get_msg("buff-desc-polymorphed"),
|
||||||
|
BuffKind::Flame { .. } => localized_strings.get_msg("buff-desc-flame"),
|
||||||
|
BuffKind::Frigid { .. } => localized_strings.get_msg("buff-desc-frigid"),
|
||||||
|
BuffKind::Lifesteal { .. } => localized_strings.get_msg("buff-desc-lifesteal"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -204,7 +204,10 @@ pub fn consumable_desc(effects: &Effects, i18n: &Localization) -> Vec<String> {
|
|||||||
| BuffKind::Fortitude
|
| BuffKind::Fortitude
|
||||||
| BuffKind::Parried
|
| BuffKind::Parried
|
||||||
| BuffKind::Reckless
|
| BuffKind::Reckless
|
||||||
| BuffKind::Polymorphed(_) => Cow::Borrowed(""),
|
| BuffKind::Polymorphed(_)
|
||||||
|
| BuffKind::Flame
|
||||||
|
| BuffKind::Frigid
|
||||||
|
| BuffKind::Lifesteal => Cow::Borrowed(""),
|
||||||
};
|
};
|
||||||
|
|
||||||
write!(&mut description, "{}", buff_desc).unwrap();
|
write!(&mut description, "{}", buff_desc).unwrap();
|
||||||
@ -242,7 +245,10 @@ pub fn consumable_desc(effects: &Effects, i18n: &Localization) -> Vec<String> {
|
|||||||
| BuffKind::Hastened
|
| BuffKind::Hastened
|
||||||
| BuffKind::Fortitude
|
| BuffKind::Fortitude
|
||||||
| BuffKind::Parried
|
| BuffKind::Parried
|
||||||
| BuffKind::Reckless => Cow::Borrowed(""),
|
| BuffKind::Reckless
|
||||||
|
| BuffKind::Flame
|
||||||
|
| BuffKind::Frigid
|
||||||
|
| BuffKind::Lifesteal => Cow::Borrowed(""),
|
||||||
}
|
}
|
||||||
} else if let BuffKind::Saturation
|
} else if let BuffKind::Saturation
|
||||||
| BuffKind::Regeneration
|
| BuffKind::Regeneration
|
||||||
|
Loading…
Reference in New Issue
Block a user