Swiftness potion changes

This commit is contained in:
HEIEnthusiast 2023-11-28 10:03:07 -04:00
parent b6c67a7f41
commit 568d12cdd0
6 changed files with 32 additions and 19 deletions

View File

@ -1,19 +1,27 @@
ItemDef(
name: "Swiftness Potion",
description: "Makes you go faster.",
description: "Drinking gives a sudden, short burst of speed.",
kind: Consumable(
kind: Drink,
effects: All([
Buff((
kind: Swiftness,
data: (
strength: 0.25,
duration: Some(240),
strength: 1.2,
duration: Some(10),
),
cat_ids: [Natural],
)),
Buff((
kind: PotionSickness,
data: (
strength: 0.33,
duration: Some(45),
),
cat_ids: [Natural],
)),
])
),
quality: Common,
quality: Moderate,
tags: [Potion],
)

View File

@ -44,7 +44,8 @@
output: ("common.items.consumable.potion_swiftness", 1),
inputs: [
(Item("common.items.crafting_ing.empty_vial"), 1, false),
(Item("common.items.crafting_ing.honey"), 3, false),
(Item("common.items.crafting_ing.honey"), 2, false),
(Item("common.items.mineral.gem.topaz"), 2, false),
(Item("common.items.crafting_ing.animal_misc.viscous_ooze"), 1, false),
],
craft_sprite: Some(Cauldron),

View File

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

View File

@ -263,8 +263,7 @@ impl BuffKind {
}]
},
BuffKind::Swiftness => vec![
BuffEffect::MovementSpeed(1.0 + data.strength),
BuffEffect::DamageReduction(-data.strength),
BuffEffect::MovementSpeed(1.0 + data.strength * stats.map_or(1.0, |s| s.move_speed_multiplier)),
BuffEffect::PrecisionOverride(0.0),
],
BuffKind::CampfireHeal => vec![BuffEffect::HealthChangeOverTime {
@ -354,7 +353,10 @@ impl BuffKind {
},
],
BuffKind::Parried => vec![BuffEffect::AttackSpeed(0.5)],
BuffKind::PotionSickness => vec![BuffEffect::HealReduction(data.strength)],
BuffKind::PotionSickness => vec![
BuffEffect::HealReduction(data.strength),
BuffEffect::MoveSpeedReduction(data.strength),
],
BuffKind::Reckless => vec![
BuffEffect::DamageReduction(-data.strength),
BuffEffect::AttackDamage(1.0 + data.strength),
@ -556,6 +558,8 @@ pub enum BuffEffect {
PoiseReduction(f32),
/// Reduces amount healed by consumables
HealReduction(f32),
/// Reduces amount of speed increase by consumables
MoveSpeedReduction(f32),
/// Increases poise damage dealt when health is lost
PoiseDamageFromLostHealth {
initial_health: f32,

View File

@ -56,6 +56,7 @@ pub struct Stats {
pub damage_reduction: f32,
pub poise_reduction: f32,
pub heal_multiplier: f32,
pub move_speed_multiplier: f32,
pub max_health_modifiers: StatsModifier,
pub move_speed_modifier: f32,
pub jump_modifier: f32,
@ -84,6 +85,7 @@ impl Stats {
damage_reduction: 0.0,
poise_reduction: 0.0,
heal_multiplier: 1.0,
move_speed_multiplier: 1.0,
max_health_modifiers: StatsModifier::default(),
move_speed_modifier: 1.0,
jump_modifier: 1.0,

View File

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