From 0bb74f9efe7e52c01b39723fd3a64bb4797ccd09 Mon Sep 17 00:00:00 2001 From: HEIEnthusiast Date: Sun, 26 Nov 2023 10:54:02 -0400 Subject: [PATCH] Added swiftness and regeneration potions --- .../items/consumable/potion_regeneration.ron | 19 +++++++++++++++++++ .../items/consumable/potion_swiftness.ron | 19 +++++++++++++++++++ assets/common/recipe_book.ron | 19 +++++++++++++++++++ assets/voxygen/i18n/en/buff.ftl | 8 ++++++++ assets/voxygen/item_image_manifest.ron | 8 ++++++++ assets/voxygen/voxel/item_drop_manifest.ron | 2 ++ .../voxel/object/potion_regeneration.vox | 3 +++ .../voxygen/voxel/object/potion_swiftness.vox | 3 +++ common/src/cmd.rs | 1 + common/src/comp/buff.rs | 10 ++++++++++ voxygen/i18n-helpers/src/lib.rs | 1 + voxygen/src/hud/mod.rs | 3 +++ voxygen/src/hud/util.rs | 6 ++++++ 13 files changed, 102 insertions(+) create mode 100644 assets/common/items/consumable/potion_regeneration.ron create mode 100644 assets/common/items/consumable/potion_swiftness.ron create mode 100644 assets/voxygen/voxel/object/potion_regeneration.vox create mode 100644 assets/voxygen/voxel/object/potion_swiftness.vox diff --git a/assets/common/items/consumable/potion_regeneration.ron b/assets/common/items/consumable/potion_regeneration.ron new file mode 100644 index 0000000000..4874c4320e --- /dev/null +++ b/assets/common/items/consumable/potion_regeneration.ron @@ -0,0 +1,19 @@ +ItemDef( + name: "Regeneration Potion", + description: "You must have lost an arm and a leg to need this.", + kind: Consumable( + kind: Drink, + effects: All([ + Buff(( + kind: Regeneration, + data: ( + strength: 2.0, + duration: Some(60), + ), + cat_ids: [Natural], + )), + ]) + ), + quality: Moderate, + tags: [Potion], +) \ No newline at end of file diff --git a/assets/common/items/consumable/potion_swiftness.ron b/assets/common/items/consumable/potion_swiftness.ron new file mode 100644 index 0000000000..c111d2021e --- /dev/null +++ b/assets/common/items/consumable/potion_swiftness.ron @@ -0,0 +1,19 @@ +ItemDef( + name: "Swiftness Potion", + description: "Makes you go faster.", + kind: Consumable( + kind: Drink, + effects: All([ + Buff(( + kind: Swiftness, + data: ( + strength: 0.25, + duration: Some(300), + ), + cat_ids: [Natural], + )), + ]) + ), + quality: Moderate, + tags: [Potion], +) diff --git a/assets/common/recipe_book.ron b/assets/common/recipe_book.ron index 701913e9aa..7795efde78 100644 --- a/assets/common/recipe_book.ron +++ b/assets/common/recipe_book.ron @@ -40,6 +40,25 @@ ], craft_sprite: Some(Cauldron), ), + "potion_swiftness": ( + 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.animal_misc.viscous_ooze"), 1, false), + ], + craft_sprite: Some(Cauldron), + ), + "potion_regeneration": ( + output: ("common.items.consumable.potion_regeneration", 1), + inputs: [ + (Item("common.items.crafting_ing.empty_vial"), 1, false), + (Item("common.items.consumable.potion_minor"), 1, false), + (Item("common.items.crafting_ing.sentient_seed"), 1, false), + (Item("common.items.crafting_ing.animal_misc.viscous_ooze"), 1, 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 49f74d0989..8b27b04e94 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... +## 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-stat-swift = + Removes chance of getting critical hits. + Increases movement speed, + and increases damage taken, + by { $strength }% ## Saturation buff-title-saturation = Saturation buff-desc-saturation = Gain health over time from consumables. diff --git a/assets/voxygen/item_image_manifest.ron b/assets/voxygen/item_image_manifest.ron index 2bb9671c4b..2406a06880 100644 --- a/assets/voxygen/item_image_manifest.ron +++ b/assets/voxygen/item_image_manifest.ron @@ -3203,6 +3203,14 @@ "voxel.object.potion_burning", (0.0, 0.0, 0.0), (-50.0, 30.0, 20.0), 0.7, ), + Simple("common.items.consumable.potion_swiftness"): VoxTrans( + "voxel.object.potion_swiftness", + (0.0, 0.0, 0.0), (-50.0, 30.0, 20.0), 0.7, + ), + Simple("common.items.consumable.potion_regeneration"): VoxTrans( + "voxel.object.potion_regeneration", + (0.0, 0.0, 0.0), (-50.0, 30.0, 20.0), 0.7, + ), Simple("common.items.charms.burning_charm"): VoxTrans( "voxel.object.burning_charm", (0.0, 0.0, 0.0), (-80.0, 15.0, 15.0), 1.0, diff --git a/assets/voxygen/voxel/item_drop_manifest.ron b/assets/voxygen/voxel/item_drop_manifest.ron index 9f05d84d7f..df329b13b1 100644 --- a/assets/voxygen/voxel/item_drop_manifest.ron +++ b/assets/voxygen/voxel/item_drop_manifest.ron @@ -810,6 +810,8 @@ 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_swiftness"): "voxel.object.potion_swiftness", + Simple("common.items.consumable.potion_regeneration"): "voxel.object.potion_regeneration", 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_regeneration.vox b/assets/voxygen/voxel/object/potion_regeneration.vox new file mode 100644 index 0000000000..32bc7a9049 --- /dev/null +++ b/assets/voxygen/voxel/object/potion_regeneration.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6c42d6187fdad39cae6fc80e32b972cd510a7d4b1251c833ec35e4c055333d02 +size 26190 diff --git a/assets/voxygen/voxel/object/potion_swiftness.vox b/assets/voxygen/voxel/object/potion_swiftness.vox new file mode 100644 index 0000000000..0dd3935eee --- /dev/null +++ b/assets/voxygen/voxel/object/potion_swiftness.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9538a8d053f8ce43c7c531d1f721b1096a3ee11a500c6e165feac723fad43605 +size 26190 diff --git a/common/src/cmd.rs b/common/src/cmd.rs index 8a4093c0c5..6b9ad12deb 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::Swiftness => "swiftness", 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 aac831abfb..2f2e711ac2 100644 --- a/common/src/comp/buff.rs +++ b/common/src/comp/buff.rs @@ -37,6 +37,10 @@ pub enum BuffKind { /// Applied when drinking a potion. /// Strength should be the healing per second. Potion, + /// Increases movement speed and vulnerability to damage and removes chance to get critical hits. + /// Movement speed and vulnerability to damage increase linearly with strength, + /// 1.0 is an 100% increase for both. + Swiftness, /// Applied when sitting at a campfire. /// Strength is fraction of health restored per second. CampfireHeal, @@ -171,6 +175,7 @@ impl BuffKind { BuffKind::Regeneration | BuffKind::Saturation | BuffKind::Potion + | BuffKind::Swiftness | BuffKind::CampfireHeal | BuffKind::Frenzied | BuffKind::EnergyRegen @@ -257,6 +262,11 @@ impl BuffKind { tick_dur: Secs(0.1), }] }, + BuffKind::Swiftness => vec![ + BuffEffect::MovementSpeed(1.0 + data.strength), + BuffEffect::DamageReduction(-data.strength), + BuffEffect::PrecisionOverride(0.0), + ], BuffKind::CampfireHeal => vec![BuffEffect::HealthChangeOverTime { rate: data.strength, kind: ModifierKind::Multiplicative, diff --git a/voxygen/i18n-helpers/src/lib.rs b/voxygen/i18n-helpers/src/lib.rs index b4196b644f..b2689d18dc 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::Swiftness | BuffKind::CampfireHeal | BuffKind::EnergyRegen | BuffKind::IncreaseMaxEnergy diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 559f84fc06..9d4c7249e1 100755 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -5160,6 +5160,7 @@ 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, + BuffKind::Swiftness => imgs.buff_plus_0, BuffKind::CampfireHeal => imgs.buff_campfire_heal_0, BuffKind::EnergyRegen => imgs.buff_energyplus_0, BuffKind::IncreaseMaxEnergy => imgs.buff_energyplus_0, @@ -5202,6 +5203,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::Swiftness => localized_strings.get_msg("buff-title-swift"), 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"), @@ -5243,6 +5245,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::Swiftness => localized_strings.get_msg("buff-desc-swift"), 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 133a20b632..76478e9792 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::Swiftness => { + i18n.get_msg_ctx("buff-stat-swift", &i18n::fluent_args! { + "strength" => format_float(strength * 100.0), + }) + }, BuffKind::Invulnerability => i18n.get_msg("buff-stat-invulnerability"), BuffKind::Bleeding | BuffKind::Burning @@ -230,6 +235,7 @@ pub fn consumable_desc(effects: &Effects, i18n: &Localization) -> Vec { }) }, BuffKind::IncreaseMaxEnergy + | BuffKind::Swiftness | BuffKind::IncreaseMaxHealth | BuffKind::Invulnerability | BuffKind::PotionSickness