Changed lifesteal beam particles to look better.

Warding aura now just provides damage reduction instead of invulnerability. Also with a longer duration and less movespeed penalty.
This commit is contained in:
Sam 2021-03-03 22:43:11 -05:00
parent 53100b6f37
commit 398370ca51
7 changed files with 30 additions and 17 deletions

View File

@ -4,9 +4,9 @@ CastAura(
recover_duration: 0.25,
targets: InGroup,
aura: (
kind: Invulnerability,
strength: 1.0,
duration: Some(0.5),
kind: ProtectingWard,
strength: 0.5,
duration: Some(10.0),
category: Magical,
),
range: 25.0,

View File

@ -17,6 +17,8 @@
"buff.desc.campfire_heal": "Resting at a campfire heals 1% per second.",
"buff.title.invulnerability": "Invulnerability",
"buff.desc.invulnerability": "You cannot be damaged by any attack.",
"buff.title.protectingward": "Protecting Ward",
"buff.desc.protectingward": "You are protected, somewhat, from attacks."
// Debuffs
"buff.title.bleed": "Bleeding",
"buff.desc.bleed": "Inflicts regular damage.",

View File

@ -346,7 +346,7 @@ void main() {
attr = Attr(
spiral_motion(inst_dir, 0.3 * (floor(2 * rand0 + 0.5) - 0.5) * min(linear_scale(10), 1), lifetime / inst_lifespan, 10.0, inst_time),
vec3((1.7 - 0.7 * abs(floor(2 * rand0 - 0.5) + 0.5)) * (1.5 + 0.5 * sin(tick.x * 10 - lifetime * 4))),
vec4(vec3(1.0 + 0.3 * sin(tick.x + lifetime * 5), 1.25 + 0.2 * sin(tick.x * 10 - lifetime * 3 + 4), 0.7), 1 /*0.3*/),
vec4(vec3(1.35 + 0.25 * sin(tick.x * 3 - lifetime * 3 + 4), 0.7 + 1.0 * sin(tick.x * 5 + lifetime * 5), 0.8 + 0.25 * sin(lifetime - tick.x * 5)), 1 /*0.3*/),
spin_in_axis(inst_dir, tick.z)
);
} else if (inst_mode == ENERGY_NATURE) {

View File

@ -33,6 +33,8 @@ pub enum BuffKind {
IncreaseMaxHealth,
/// Makes you immune to attacks
Invulnerability,
/// Reduces incoming damage
ProtectingWard,
}
#[cfg(not(target_arch = "wasm32"))]
@ -49,6 +51,7 @@ impl BuffKind {
BuffKind::IncreaseMaxEnergy => true,
BuffKind::IncreaseMaxHealth => true,
BuffKind::Invulnerability => true,
BuffKind::ProtectingWard => true,
}
}
@ -101,16 +104,11 @@ pub enum BuffEffect {
kind: ModifierKind,
},
/// Changes maximum health by a certain amount
MaxHealthModifier {
value: f32,
kind: ModifierKind,
},
MaxHealthModifier { value: f32, kind: ModifierKind },
/// Changes maximum stamina by a certain amount
MaxEnergyModifier {
value: f32,
kind: ModifierKind,
},
ImmuneToAttacks,
MaxEnergyModifier { value: f32, kind: ModifierKind },
/// Reduces damage after armor is accounted for by this fraction
DamageReduction(f32),
}
/// Actual de/buff.
@ -213,7 +211,16 @@ impl Buff {
}],
data.duration,
),
BuffKind::Invulnerability => (vec![BuffEffect::ImmuneToAttacks], data.duration),
BuffKind::Invulnerability => (vec![BuffEffect::DamageReduction(1.0)], data.duration),
BuffKind::ProtectingWard => (
vec![BuffEffect::DamageReduction(
// Causes non-linearity in effect strength, but necessary to allow for tool
// power and other things to affect the strength. 0.5 also still provides 50%
// damage reduction.
data.strength / (0.5 + data.strength),
)],
data.duration,
),
};
Buff {
kind,

View File

@ -47,7 +47,7 @@ impl CharacterBehavior for Data {
fn behavior(&self, data: &JoinData) -> StateUpdate {
let mut update = StateUpdate::from(data);
handle_move(data, &mut update, 0.6);
handle_move(data, &mut update, 0.8);
handle_jump(data, &mut update);
if !ability_key_is_pressed(data, self.static_data.ability_info.key) {
handle_interrupt(data, &mut update, false);

View File

@ -165,8 +165,8 @@ impl<'a> System<'a> for Sys {
energy.set_maximum(new_max);
},
},
BuffEffect::ImmuneToAttacks => {
stat.damage_reduction = 1.0;
BuffEffect::DamageReduction(dr) => {
stat.damage_reduction = dr.min(1.0);
},
};
}

View File

@ -3282,6 +3282,8 @@ pub fn get_buff_image(buff: BuffKind, imgs: &Imgs) -> conrod_core::image::Id {
BuffKind::IncreaseMaxEnergy { .. } => imgs.buff_energyplus_0,
BuffKind::IncreaseMaxHealth { .. } => imgs.buff_healthplus_0,
BuffKind::Invulnerability => imgs.buff_invincibility_0,
// Do not merge until icon for this buff
BuffKind::ProtectingWard => imgs.buff_invincibility_0,
// Debuffs
BuffKind::Bleeding { .. } => imgs.debuff_bleed_0,
BuffKind::Cursed { .. } => imgs.debuff_skull_0,
@ -3298,6 +3300,7 @@ pub fn get_buff_title(buff: BuffKind, localized_strings: &Localization) -> &str
BuffKind::IncreaseMaxHealth { .. } => localized_strings.get("buff.title.IncreaseMaxHealth"),
BuffKind::IncreaseMaxEnergy { .. } => localized_strings.get("buff.title.staminaup"),
BuffKind::Invulnerability => localized_strings.get("buff.title.invulnerability"),
BuffKind::ProtectingWard => localized_strings.get("buff.title.protectingward"),
// Debuffs
BuffKind::Bleeding { .. } => localized_strings.get("buff.title.bleed"),
BuffKind::Cursed { .. } => localized_strings.get("buff.title.cursed"),
@ -3314,6 +3317,7 @@ pub fn get_buff_desc(buff: BuffKind, localized_strings: &Localization) -> &str {
BuffKind::IncreaseMaxHealth { .. } => localized_strings.get("buff.desc.IncreaseMaxHealth"),
BuffKind::IncreaseMaxEnergy { .. } => localized_strings.get("buff.desc.IncreaseMaxEnergy"),
BuffKind::Invulnerability => localized_strings.get("buff.desc.invulnerability"),
BuffKind::ProtectingWard => localized_strings.get("buff.desc.protectingward"),
// Debuffs
BuffKind::Bleeding { .. } => localized_strings.get("buff.desc.bleed"),
BuffKind::Cursed { .. } => localized_strings.get("buff.desc.cursed"),