Added swiftness debuffs

This commit is contained in:
HEIEnthusiast 2023-11-28 11:41:29 -04:00
parent db71625226
commit 5001c4a262
4 changed files with 14 additions and 12 deletions

View File

@ -1,6 +1,6 @@
ItemDef( ItemDef(
name: "Swiftness Potion", name: "Swiftness Potion",
description: "Drinking gives a sudden, short burst of speed.", description: "Watch the walls!",
kind: Consumable( kind: Consumable(
kind: Drink, kind: Drink,
effects: All([ effects: All([
@ -8,7 +8,7 @@ ItemDef(
kind: Swiftness, kind: Swiftness,
data: ( data: (
strength: 1.2, strength: 1.2,
duration: Some(10), duration: Some(15),
), ),
cat_ids: [Natural], cat_ids: [Natural],
)), )),

View File

@ -7,10 +7,12 @@ buff-title-potion = Potion
buff-desc-potion = Drinking... buff-desc-potion = Drinking...
## Swiftness ## Swiftness
buff-title-swift = Swiftness buff-title-swift = Swiftness
buff-desc-swift = Your movement is faster, but you can't get critical hits. buff-desc-swift = Your movement is faster, but you deal less damage, and take more damage.
buff-stat-swift = buff-stat-swift =
Removes chance of getting critical hits. Increases movement speed by { $strength }%.
Increases movement speed by { $strength }% but decreases your damage by 100%,
and increases your damage vulnerability
by 100%.
## Saturation ## Saturation
buff-title-saturation = Saturation buff-title-saturation = Saturation
buff-desc-saturation = Gain health over time from consumables. buff-desc-saturation = Gain health over time from consumables.
@ -75,7 +77,7 @@ buff-title-parried = Parried
buff-desc-parried = You were parried and now are slow to recover. buff-desc-parried = You were parried and now are slow to recover.
## Potion sickness ## Potion sickness
buff-title-potionsickness = Potion sickness buff-title-potionsickness = Potion sickness
buff-desc-potionsickness = Potions have less effect on you after recently consuming a potion. buff-desc-potionsickness = Potions have less positive effect on you after recently consuming a potion.
buff-stat-potionsickness = buff-stat-potionsickness =
Decreases the positive effects of Decreases the positive effects of
subsequent potions by { $strength }%. subsequent potions by { $strength }%.

View File

@ -37,9 +37,10 @@ pub enum BuffKind {
/// Applied when drinking a potion. /// Applied when drinking a potion.
/// Strength should be the healing per second. /// Strength should be the healing per second.
Potion, Potion,
/// Increases movement speed and vulnerability to damage and removes chance /// Increases movement speed and vulnerability to damage as well as
/// to get critical hits. Movement speed and vulnerability to damage /// decreases the amount of damage dealt.
/// increase linearly with strength, 1.0 is an 100% increase for both. /// Movement speed increases linearly with strength 1.0 is an 100% increase
/// Damage vulnerability and damage reduction are both hard set to 100%
Swiftness, Swiftness,
/// Applied when sitting at a campfire. /// Applied when sitting at a campfire.
/// Strength is fraction of health restored per second. /// Strength is fraction of health restored per second.
@ -271,7 +272,8 @@ impl BuffKind {
}, },
BuffKind::Swiftness => vec![ BuffKind::Swiftness => vec![
BuffEffect::MovementSpeed(1.0 + data.strength * stats.map_or(1.0, |s| s.move_speed_multiplier)), BuffEffect::MovementSpeed(1.0 + data.strength * stats.map_or(1.0, |s| s.move_speed_multiplier)),
BuffEffect::PrecisionOverride(0.0), BuffEffect::DamageReduction(-1.0),
BuffEffect::AttackDamage(0.0),
], ],
BuffKind::CampfireHeal => vec![BuffEffect::HealthChangeOverTime { BuffKind::CampfireHeal => vec![BuffEffect::HealthChangeOverTime {
rate: data.strength, rate: data.strength,

View File

@ -663,11 +663,9 @@ fn execute_effect(
}, },
BuffEffect::HealReduction(red) => { BuffEffect::HealReduction(red) => {
stat.heal_multiplier *= 1.0 - *red; stat.heal_multiplier *= 1.0 - *red;
print!("heal_multiplier: {}\n", stat.heal_multiplier);
}, },
BuffEffect::MoveSpeedReduction(red) => { BuffEffect::MoveSpeedReduction(red) => {
stat.move_speed_multiplier *= 1.0 - *red; stat.move_speed_multiplier *= 1.0 - *red;
print!("move_speed_multiplier: {}\n", stat.move_speed_multiplier);
}, },
BuffEffect::PoiseDamageFromLostHealth { BuffEffect::PoiseDamageFromLostHealth {
initial_health, initial_health,