diff --git a/CHANGELOG.md b/CHANGELOG.md index c7f4912b7e..766a20ea6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - A tavern building where npcs go to relax. - Toggle for walking instead of running (Default: `I`). - Added day duration slider configuration on map creation UI. +- Potion of Agility ### Changed @@ -74,6 +75,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed offset of items carried on backs when wearing cloaks and backpacks - Linearize light colors on the CPU rather than in shaders on the GPU - You can no longer stack self buffs +- Renamed "Burning Potion" to "Potion of Combustion" ### Removed - Medium and large potions from all loot tables diff --git a/assets/common/items/consumable/potion_agility.ron b/assets/common/items/consumable/potion_agility.ron new file mode 100644 index 0000000000..e7ebefd0e8 --- /dev/null +++ b/assets/common/items/consumable/potion_agility.ron @@ -0,0 +1,27 @@ +ItemDef( + name: "Potion of Agility", + description: "Fly, you fools!", + kind: Consumable( + kind: Drink, + effects: All([ + Buff(( + kind: Agility, + data: ( + strength: 0.55, + duration: Some(25), + ), + cat_ids: [Natural], + )), + Buff(( + kind: PotionSickness, + data: ( + strength: 0.5, + duration: Some(60), + ), + cat_ids: [Natural], + )), + ]) + ), + quality: Moderate, + tags: [Potion], +) diff --git a/assets/common/items/consumable/potion_burning.ron b/assets/common/items/consumable/potion_combustion.ron similarity index 92% rename from assets/common/items/consumable/potion_burning.ron rename to assets/common/items/consumable/potion_combustion.ron index 2efca88089..6bf6f6736d 100644 --- a/assets/common/items/consumable/potion_burning.ron +++ b/assets/common/items/consumable/potion_combustion.ron @@ -1,5 +1,5 @@ ItemDef( - name: "Burning Potion", + name: "Potion of Combustion", description: "Sets the user ablaze", kind: Consumable( kind: Drink, diff --git a/assets/common/recipe_book.ron b/assets/common/recipe_book.ron index 701913e9aa..b5c7cf78d4 100644 --- a/assets/common/recipe_book.ron +++ b/assets/common/recipe_book.ron @@ -31,8 +31,8 @@ ], craft_sprite: Some(Anvil), ), - "potion_burning": ( - output: ("common.items.consumable.potion_burning", 1), + "potion_combustion": ( + output: ("common.items.consumable.potion_combustion", 1), inputs: [ (Item("common.items.crafting_ing.empty_vial"), 1, false), (Item("common.items.crafting_ing.living_embers"), 3, false), @@ -40,6 +40,16 @@ ], craft_sprite: Some(Cauldron), ), + "potion_agility": ( + output: ("common.items.consumable.potion_agility", 1), + inputs: [ + (Item("common.items.crafting_ing.empty_vial"), 1, false), + (Item("common.items.mineral.ore.veloritefrag"), 2, false), + (Item("common.items.crafting_ing.animal_misc.raptor_feather"), 2, false), + (Item("common.items.crafting_ing.animal_misc.viscous_ooze"), 3, false), + ], + craft_sprite: Some(Cauldron), + ), "potion_s": ( output: ("common.items.consumable.potion_minor", 1), inputs: [ diff --git a/assets/voxygen/i18n/en/buff.ftl b/assets/voxygen/i18n/en/buff.ftl index 6c05bafc53..3ba397931d 100644 --- a/assets/voxygen/i18n/en/buff.ftl +++ b/assets/voxygen/i18n/en/buff.ftl @@ -5,6 +5,14 @@ buff-stat-health = Restores { $str_total } Health ## Potion buff-title-potion = Potion buff-desc-potion = Drinking... +## Agility +buff-title-agility = Agility +buff-desc-agility = Your movement is faster, but you deal less damage, and take more damage. +buff-stat-agility = + Increases movement speed by { $strength }%. + but decreases your damage by 100%, + and increases your damage vulnerability + by 100%. ## Saturation buff-title-saturation = Saturation buff-desc-saturation = Gain health over time from consumables. @@ -69,9 +77,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 positive 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 diff --git a/assets/voxygen/item_image_manifest.ron b/assets/voxygen/item_image_manifest.ron index 2bb9671c4b..95acc5ac91 100644 --- a/assets/voxygen/item_image_manifest.ron +++ b/assets/voxygen/item_image_manifest.ron @@ -3199,8 +3199,12 @@ "voxel.object.curious_potion", (0.0, 0.0, 0.0), (-50.0, 30.0, 20.0), 0.7, ), - Simple("common.items.consumable.potion_burning"): VoxTrans( - "voxel.object.potion_burning", + Simple("common.items.consumable.potion_combustion"): VoxTrans( + "voxel.object.potion_combustion", + (0.0, 0.0, 0.0), (-50.0, 30.0, 20.0), 0.7, + ), + Simple("common.items.consumable.potion_agility"): VoxTrans( + "voxel.object.potion_agility", (0.0, 0.0, 0.0), (-50.0, 30.0, 20.0), 0.7, ), Simple("common.items.charms.burning_charm"): VoxTrans( diff --git a/assets/voxygen/voxel/item_drop_manifest.ron b/assets/voxygen/voxel/item_drop_manifest.ron index 9f05d84d7f..8cbf53f90d 100644 --- a/assets/voxygen/voxel/item_drop_manifest.ron +++ b/assets/voxygen/voxel/item_drop_manifest.ron @@ -809,7 +809,8 @@ Simple("common.items.consumable.potion_minor"): "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.potion_burning"): "voxel.object.potion_burning", + Simple("common.items.consumable.potion_combustion"): "voxel.object.potion_combustion", + Simple("common.items.consumable.potion_agility"): "voxel.object.potion_agility", 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", diff --git a/assets/voxygen/voxel/object/potion_agility.vox b/assets/voxygen/voxel/object/potion_agility.vox new file mode 100644 index 0000000000..08e69134f9 --- /dev/null +++ b/assets/voxygen/voxel/object/potion_agility.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:07286a926c75c0426c58c458fcaae01cfbc46886b3e0d028bd7dd38f3001fc8e +size 1704 diff --git a/assets/voxygen/voxel/object/potion_burning.vox b/assets/voxygen/voxel/object/potion_combustion.vox similarity index 100% rename from assets/voxygen/voxel/object/potion_burning.vox rename to assets/voxygen/voxel/object/potion_combustion.vox diff --git a/common/src/cmd.rs b/common/src/cmd.rs index b7bc6e0e1d..a41a9c93b7 100644 --- a/common/src/cmd.rs +++ b/common/src/cmd.rs @@ -155,6 +155,7 @@ lazy_static! { BuffKind::Bleeding => "bleeding", BuffKind::Cursed => "cursed", BuffKind::Potion => "potion", + BuffKind::Agility => "agility", BuffKind::CampfireHeal => "campfire_heal", BuffKind::EnergyRegen => "energy_regen", BuffKind::IncreaseMaxEnergy => "increase_max_energy", diff --git a/common/src/comp/buff.rs b/common/src/comp/buff.rs index 821a3768b1..cef10d70c3 100644 --- a/common/src/comp/buff.rs +++ b/common/src/comp/buff.rs @@ -37,6 +37,11 @@ pub enum BuffKind { /// Applied when drinking a potion. /// Strength should be the healing per second. Potion, + /// Increases movement speed and vulnerability to damage as well as + /// decreases the amount of damage dealt. + /// Movement speed increases linearly with strength 1.0 is an 100% increase + /// Damage vulnerability and damage reduction are both hard set to 100% + Agility, /// Applied when sitting at a campfire. /// Strength is fraction of health restored per second. CampfireHeal, @@ -177,6 +182,7 @@ impl BuffKind { BuffKind::Regeneration | BuffKind::Saturation | BuffKind::Potion + | BuffKind::Agility | BuffKind::CampfireHeal | BuffKind::Frenzied | BuffKind::EnergyRegen @@ -264,6 +270,13 @@ impl BuffKind { tick_dur: Secs(0.1), }] }, + BuffKind::Agility => vec![ + BuffEffect::MovementSpeed( + 1.0 + data.strength * stats.map_or(1.0, |s| s.move_speed_multiplier), + ), + BuffEffect::DamageReduction(-1.0), + BuffEffect::AttackDamage(0.0), + ], BuffKind::CampfireHeal => vec![BuffEffect::HealthChangeOverTime { rate: data.strength, kind: ModifierKind::Multiplicative, @@ -351,7 +364,11 @@ impl BuffKind { }, ], BuffKind::Parried => vec![BuffEffect::AttackSpeed(0.5)], - BuffKind::PotionSickness => vec![BuffEffect::HealReduction(data.strength)], + //TODO: Handle potion sickness in a more general way. + BuffKind::PotionSickness => vec![ + BuffEffect::HealReduction(data.strength), + BuffEffect::MoveSpeedReduction(data.strength), + ], BuffKind::Reckless => vec![ BuffEffect::DamageReduction(-data.strength), BuffEffect::AttackDamage(1.0 + data.strength), @@ -557,6 +574,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, diff --git a/common/src/comp/stats.rs b/common/src/comp/stats.rs index c30f06a981..7a61319d32 100644 --- a/common/src/comp/stats.rs +++ b/common/src/comp/stats.rs @@ -56,8 +56,10 @@ 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, pub attack_speed_modifier: f32, pub friction_modifier: f32, pub max_energy_modifiers: StatsModifier, @@ -83,8 +85,10 @@ 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, attack_speed_modifier: 1.0, friction_modifier: 1.0, max_energy_modifiers: StatsModifier::default(), diff --git a/common/src/states/utils.rs b/common/src/states/utils.rs index 0f6f6ea836..9140a33cf9 100644 --- a/common/src/states/utils.rs +++ b/common/src/states/utils.rs @@ -1193,7 +1193,7 @@ pub fn handle_jump( data.entity, strength * impulse / data.mass.0 * data.scale.map_or(1.0, |s| s.0.powf(13.0).powf(0.25)) - * data.stats.move_speed_modifier, + * data.stats.jump_modifier, )); }) .is_some() diff --git a/common/systems/src/buff.rs b/common/systems/src/buff.rs index 8f890ee0c2..53cc332083 100644 --- a/common/systems/src/buff.rs +++ b/common/systems/src/buff.rs @@ -664,6 +664,9 @@ fn execute_effect( BuffEffect::HealReduction(red) => { stat.heal_multiplier *= 1.0 - *red; }, + BuffEffect::MoveSpeedReduction(red) => { + stat.move_speed_multiplier *= 1.0 - *red; + }, BuffEffect::PoiseDamageFromLostHealth { initial_health, strength, diff --git a/server/src/migrations/V53__potion_combustion.sql b/server/src/migrations/V53__potion_combustion.sql new file mode 100644 index 0000000000..f41559e61d --- /dev/null +++ b/server/src/migrations/V53__potion_combustion.sql @@ -0,0 +1,2 @@ +UPDATE item +SET item_definition_id = 'common.items.consumable.potion_combustion' WHERE item_definition_id = 'common.items.consumable.potion_burning'; \ No newline at end of file diff --git a/voxygen/i18n-helpers/src/lib.rs b/voxygen/i18n-helpers/src/lib.rs index 41c8f787e2..5751cfab38 100644 --- a/voxygen/i18n-helpers/src/lib.rs +++ b/voxygen/i18n-helpers/src/lib.rs @@ -109,6 +109,7 @@ pub fn localize_chat_message( BuffKind::Regeneration | BuffKind::Saturation | BuffKind::Potion + | BuffKind::Agility | BuffKind::CampfireHeal | BuffKind::EnergyRegen | BuffKind::IncreaseMaxEnergy diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 8d43e185e3..f25efa52ef 100755 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -5165,6 +5165,8 @@ pub fn get_buff_image(buff: BuffKind, imgs: &Imgs) -> conrod_core::image::Id { BuffKind::Regeneration => imgs.buff_plus_0, BuffKind::Saturation => imgs.buff_saturation_0, BuffKind::Potion => imgs.buff_potion_0, + // TODO: Need unique image for Agility (uses same as Hastened atm) + BuffKind::Agility => imgs.buff_haste_0, BuffKind::CampfireHeal => imgs.buff_campfire_heal_0, BuffKind::EnergyRegen => imgs.buff_energyplus_0, BuffKind::IncreaseMaxEnergy => imgs.buff_energyplus_0, @@ -5208,6 +5210,7 @@ pub fn get_buff_title(buff: BuffKind, localized_strings: &Localization) -> Cow localized_strings.get_msg("buff-title-heal"), BuffKind::Saturation => localized_strings.get_msg("buff-title-saturation"), BuffKind::Potion => localized_strings.get_msg("buff-title-potion"), + BuffKind::Agility => localized_strings.get_msg("buff-title-agility"), BuffKind::CampfireHeal => localized_strings.get_msg("buff-title-campfire_heal"), BuffKind::EnergyRegen => localized_strings.get_msg("buff-title-energy_regen"), BuffKind::IncreaseMaxHealth => localized_strings.get_msg("buff-title-increase_max_health"), @@ -5250,6 +5253,7 @@ pub fn get_buff_desc(buff: BuffKind, data: BuffData, localized_strings: &Localiz BuffKind::Regeneration => localized_strings.get_msg("buff-desc-heal"), BuffKind::Saturation => localized_strings.get_msg("buff-desc-saturation"), BuffKind::Potion => localized_strings.get_msg("buff-desc-potion"), + BuffKind::Agility => localized_strings.get_msg("buff-desc-agility"), BuffKind::CampfireHeal => { localized_strings.get_msg_ctx("buff-desc-campfire_heal", &i18n::fluent_args! { "rate" => data.strength * 100.0 diff --git a/voxygen/src/hud/util.rs b/voxygen/src/hud/util.rs index fc3a3eb733..63c655805e 100644 --- a/voxygen/src/hud/util.rs +++ b/voxygen/src/hud/util.rs @@ -189,6 +189,11 @@ pub fn consumable_desc(effects: &Effects, i18n: &Localization) -> Vec { "strength" => format_float(strength * 100.0), }) }, + BuffKind::Agility => { + i18n.get_msg_ctx("buff-stat-agility", &i18n::fluent_args! { + "strength" => format_float(strength * 100.0), + }) + }, BuffKind::Invulnerability => i18n.get_msg("buff-stat-invulnerability"), BuffKind::Bleeding | BuffKind::Burning @@ -231,6 +236,7 @@ pub fn consumable_desc(effects: &Effects, i18n: &Localization) -> Vec { }) }, BuffKind::IncreaseMaxEnergy + | BuffKind::Agility | BuffKind::IncreaseMaxHealth | BuffKind::Invulnerability | BuffKind::PotionSickness