Auras will now refresh buffs if a buff was already present that had a lesser duration.

Attack effects can now have multiple requirements.
Fix for sceptre heal not requiring energy.
Nerfed warding aura protection.
Added icon for warding aura.
Changelog.
This commit is contained in:
Sam 2021-03-08 19:23:00 -05:00
parent 16222948a3
commit de5ef03ac4
10 changed files with 35 additions and 28 deletions

View File

@ -71,6 +71,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Improved static light rendering and illumination - Improved static light rendering and illumination
- Improved the tree spawning model to allow for overlapping forests - Improved the tree spawning model to allow for overlapping forests
- Changed sunlight (and, in general, static light) propagation through blocks to allow for more material properties - Changed sunlight (and, in general, static light) propagation through blocks to allow for more material properties
- Overhauled the sceptre
### Removed ### Removed

View File

@ -5,7 +5,7 @@ BasicAura(
targets: InGroup, targets: InGroup,
aura: ( aura: (
kind: ProtectingWard, kind: ProtectingWard,
strength: 0.5, strength: 0.33,
duration: Some(10.0), duration: Some(10.0),
category: Magical, category: Magical,
), ),

View File

@ -3,13 +3,11 @@ BasicBeam(
recover_duration: 0.25, recover_duration: 0.25,
beam_duration: 1.0, beam_duration: 1.0,
damage: 30, damage: 30,
//base_hps: 60, Don't merge until this comment is removed
tick_rate: 2.0, tick_rate: 2.0,
range: 25.0, range: 25.0,
max_angle: 1.0, max_angle: 1.0,
lifesteal_eff: 0.15, lifesteal_eff: 0.15,
energy_regen: 25, energy_regen: 25,
//energy_cost: 50,
energy_drain: 0, energy_drain: 0,
orientation_behavior: Normal, orientation_behavior: Normal,
specifier: HealingBeam, specifier: HealingBeam,

BIN
assets/voxygen/element/icons/sceptre_protection.png (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -228,9 +228,9 @@ impl Attack {
.filter(|e| e.target.map_or(true, |t| t == target_group)) .filter(|e| e.target.map_or(true, |t| t == target_group))
.filter(|e| !(matches!(e.target, Some(GroupTarget::OutOfGroup)) && target_dodging)) .filter(|e| !(matches!(e.target, Some(GroupTarget::OutOfGroup)) && target_dodging))
{ {
if match &effect.requirement { if effect.requirements.iter().all(|req| match req {
Some(CombatRequirement::AnyDamage) => accumulated_damage > 0.0, CombatRequirement::AnyDamage => accumulated_damage > 0.0,
Some(CombatRequirement::Energy(r)) => { CombatRequirement::Energy(r) => {
if let Some(AttackerInfo { if let Some(AttackerInfo {
entity, entity,
energy: Some(e), energy: Some(e),
@ -253,7 +253,7 @@ impl Attack {
false false
} }
}, },
Some(CombatRequirement::Combo(r)) => { CombatRequirement::Combo(r) => {
if let Some(AttackerInfo { if let Some(AttackerInfo {
entity, entity,
combo: Some(c), combo: Some(c),
@ -273,8 +273,7 @@ impl Attack {
false false
} }
}, },
None => true, }) {
} {
match effect.effect { match effect.effect {
CombatEffect::Knockback(kb) => { CombatEffect::Knockback(kb) => {
let impulse = kb.calculate_impulse(dir); let impulse = kb.calculate_impulse(dir);
@ -389,7 +388,7 @@ impl AttackDamage {
pub struct AttackEffect { pub struct AttackEffect {
target: Option<GroupTarget>, target: Option<GroupTarget>,
effect: CombatEffect, effect: CombatEffect,
requirement: Option<CombatRequirement>, requirements: Vec<CombatRequirement>,
} }
#[cfg(not(target_arch = "wasm32"))] #[cfg(not(target_arch = "wasm32"))]
@ -398,12 +397,12 @@ impl AttackEffect {
Self { Self {
target, target,
effect, effect,
requirement: None, requirements: Vec::new(),
} }
} }
pub fn with_requirement(mut self, requirement: CombatRequirement) -> Self { pub fn with_requirement(mut self, requirement: CombatRequirement) -> Self {
self.requirement = Some(requirement); self.requirements.push(requirement);
self self
} }

View File

@ -83,7 +83,10 @@ pub enum CharacterState {
BasicBeam(basic_beam::Data), BasicBeam(basic_beam::Data),
/// Creates an aura that persists as long as you are actively casting /// Creates an aura that persists as long as you are actively casting
BasicAura(basic_aura::Data), BasicAura(basic_aura::Data),
/// A directed beam that heals targets in range /// A directed beam that heals targets in range. This is separate from basic
/// beam as a large amount of functionality needed to be special cased
/// specifically for the healing beam. There was also functionality present
/// on basic beam which was unnecessary for the healing beam.
HealingBeam(healing_beam::Data), HealingBeam(healing_beam::Data),
} }

View File

@ -128,13 +128,16 @@ impl<'a> System<'a> for Sys {
if apply_buff { if apply_buff {
// Checks that target is not already receiving a buff from an // Checks that target is not already receiving a buff from an
// aura, where the buff is of the same kind, and is of at least // aura, where the buff is of the same kind, and is of at least
// the same strength // the same strength and of at least the same duration
// If no such buff is present, adds the buff // If no such buff is present, adds the buff
let emit_buff = !target_buffs.buffs.iter().any(|(_, buff)| { let emit_buff = !target_buffs.buffs.iter().any(|(_, buff)| {
buff.cat_ids.iter().any(|cat_id| { buff.cat_ids.iter().any(|cat_id| {
matches!(cat_id, BuffCategory::FromAura(_)) matches!(cat_id, BuffCategory::FromAura(_))
}) && buff.kind == kind }) && buff.kind == kind
&& buff.data.strength >= data.strength && buff.data.strength >= data.strength
&& buff.time.map_or(true, |dur| {
data.duration.map_or(false, |dur_2| dur >= dur_2)
})
}); });
if emit_buff { if emit_buff {
use buff::*; use buff::*;

View File

@ -3264,7 +3264,7 @@ impl<'a> Widget for Diary<'a> {
.set(state.skill_sceptre_lifesteal_0, ui); .set(state.skill_sceptre_lifesteal_0, ui);
let skill = Skill::Sceptre(LDamage); let skill = Skill::Sceptre(LDamage);
if create_skill_button( if create_skill_button(
self.imgs.skill_sceptre_lifesteal, self.imgs.magic_damage_skill,
state.skills_top_l[1], state.skills_top_l[1],
&self.stats.skill_set, &self.stats.skill_set,
skill, skill,
@ -3292,7 +3292,7 @@ impl<'a> Widget for Diary<'a> {
}; };
let skill = Skill::Sceptre(LRange); let skill = Skill::Sceptre(LRange);
if create_skill_button( if create_skill_button(
self.imgs.skill_sceptre_lifesteal, self.imgs.magic_distance_skill,
state.skills_top_l[2], state.skills_top_l[2],
&self.stats.skill_set, &self.stats.skill_set,
skill, skill,
@ -3320,7 +3320,7 @@ impl<'a> Widget for Diary<'a> {
}; };
let skill = Skill::Sceptre(LLifesteal); let skill = Skill::Sceptre(LLifesteal);
if create_skill_button( if create_skill_button(
self.imgs.skill_sceptre_lifesteal, self.imgs.magic_lifesteal_skill,
state.skills_top_l[3], state.skills_top_l[3],
&self.stats.skill_set, &self.stats.skill_set,
skill, skill,
@ -3350,7 +3350,7 @@ impl<'a> Widget for Diary<'a> {
}; };
let skill = Skill::Sceptre(LRegen); let skill = Skill::Sceptre(LRegen);
if create_skill_button( if create_skill_button(
self.imgs.skill_sceptre_lifesteal, self.imgs.magic_energy_regen_skill,
state.skills_top_l[4], state.skills_top_l[4],
&self.stats.skill_set, &self.stats.skill_set,
skill, skill,
@ -3390,7 +3390,7 @@ impl<'a> Widget for Diary<'a> {
.set(state.skill_sceptre_heal_0, ui); .set(state.skill_sceptre_heal_0, ui);
let skill = Skill::Sceptre(HHeal); let skill = Skill::Sceptre(HHeal);
if create_skill_button( if create_skill_button(
self.imgs.skill_sceptre_heal, self.imgs.heal_heal_skill,
state.skills_top_r[1], state.skills_top_r[1],
&self.stats.skill_set, &self.stats.skill_set,
skill, skill,
@ -3416,7 +3416,7 @@ impl<'a> Widget for Diary<'a> {
}; };
let skill = Skill::Sceptre(HCost); let skill = Skill::Sceptre(HCost);
if create_skill_button( if create_skill_button(
self.imgs.skill_sceptre_heal, self.imgs.heal_cost_skill,
state.skills_top_r[2], state.skills_top_r[2],
&self.stats.skill_set, &self.stats.skill_set,
skill, skill,
@ -3442,7 +3442,7 @@ impl<'a> Widget for Diary<'a> {
}; };
let skill = Skill::Sceptre(HRange); let skill = Skill::Sceptre(HRange);
if create_skill_button( if create_skill_button(
self.imgs.skill_sceptre_heal, self.imgs.heal_distance_skill,
state.skills_top_r[3], state.skills_top_r[3],
&self.stats.skill_set, &self.stats.skill_set,
skill, skill,
@ -3497,7 +3497,7 @@ impl<'a> Widget for Diary<'a> {
}; };
let skill = Skill::Sceptre(AStrength); let skill = Skill::Sceptre(AStrength);
if create_skill_button( if create_skill_button(
self.imgs.skill_sceptre_aura, self.imgs.buff_damage_skill,
state.skills_bot_l[1], state.skills_bot_l[1],
&self.stats.skill_set, &self.stats.skill_set,
skill, skill,
@ -3525,7 +3525,7 @@ impl<'a> Widget for Diary<'a> {
}; };
let skill = Skill::Sceptre(ADuration); let skill = Skill::Sceptre(ADuration);
if create_skill_button( if create_skill_button(
self.imgs.skill_sceptre_aura, self.imgs.buff_speed_skill,
state.skills_bot_l[2], state.skills_bot_l[2],
&self.stats.skill_set, &self.stats.skill_set,
skill, skill,
@ -3553,7 +3553,7 @@ impl<'a> Widget for Diary<'a> {
}; };
let skill = Skill::Sceptre(ARange); let skill = Skill::Sceptre(ARange);
if create_skill_button( if create_skill_button(
self.imgs.skill_sceptre_aura, self.imgs.buff_radius_skill,
state.skills_bot_l[3], state.skills_bot_l[3],
&self.stats.skill_set, &self.stats.skill_set,
skill, skill,
@ -3581,7 +3581,7 @@ impl<'a> Widget for Diary<'a> {
}; };
let skill = Skill::Sceptre(ACost); let skill = Skill::Sceptre(ACost);
if create_skill_button( if create_skill_button(
self.imgs.skill_sceptre_aura, self.imgs.buff_cost_skill,
state.skills_bot_l[4], state.skills_bot_l[4],
&self.stats.skill_set, &self.stats.skill_set,
skill, skill,

View File

@ -452,8 +452,7 @@ image_ids! {
hammerleap: "voxygen.element.icons.skill_hammerleap", hammerleap: "voxygen.element.icons.skill_hammerleap",
skill_axe_leap_slash: "voxygen.element.icons.skill_axe_leap_slash", skill_axe_leap_slash: "voxygen.element.icons.skill_axe_leap_slash",
skill_bow_jump_burst: "voxygen.element.icons.skill_bow_jump_burst", skill_bow_jump_burst: "voxygen.element.icons.skill_bow_jump_burst",
// Do not merge until icon for this skill_sceptre_aura: "voxygen.element.icons.sceptre_protection",
skill_sceptre_aura: "voxygen.element.icons.heal_bomb",
missing_icon: "voxygen.element.icons.missing_icon_grey", missing_icon: "voxygen.element.icons.missing_icon_grey",
// Buttons // Buttons

View File

@ -498,8 +498,9 @@ impl ParticleMgr {
|| { || {
let rand_dist = aura.radius * (1.0 - rng.gen::<f32>().powi(100)); let rand_dist = aura.radius * (1.0 - rng.gen::<f32>().powi(100));
let init_pos = Vec3::new(rand_dist, 0_f32, 0_f32); let init_pos = Vec3::new(rand_dist, 0_f32, 0_f32);
let max_dur = Duration::from_secs(1);
Particle::new_directed( Particle::new_directed(
aura.duration.unwrap_or_else(|| Duration::from_secs(1)), aura.duration.map_or(max_dur, |dur| dur.min(max_dur)),
time, time,
ParticleMode::EnergyNature, ParticleMode::EnergyNature,
pos.0, pos.0,