From 888702895402f78b1d7aa0469a65fa88deb9ca2c Mon Sep 17 00:00:00 2001 From: alek13 Date: Tue, 26 Nov 2024 07:41:01 +0300 Subject: [PATCH] Effects Int: Potions: add potions for breath. Closes #1733 --- .../lord_tooltips/locale/lord_tooltips.en.tr | 3 +- .../lord_tooltips/locale/lord_tooltips.ru.tr | 3 +- .../lord_tooltips/src/snippet/potions.lua | 8 ++-- .../lord_potions/locale/lord_potions.en.tr | 10 +++++ .../lord_potions/locale/lord_potions.ru.tr | 10 +++++ .../src/lord_potions/config/potions.lua | 40 ++++++++++++++++--- 6 files changed, 63 insertions(+), 11 deletions(-) diff --git a/mods/lord/Player/Help/lord_tooltips/locale/lord_tooltips.en.tr b/mods/lord/Player/Help/lord_tooltips/locale/lord_tooltips.en.tr index 2fca546d9..6fa3191ff 100644 --- a/mods/lord/Player/Help/lord_tooltips/locale/lord_tooltips.en.tr +++ b/mods/lord/Player/Help/lord_tooltips/locale/lord_tooltips.en.tr @@ -56,7 +56,8 @@ defense_poison=from poison Health=Health Speed=Speed Jump=Jump - +Breath=Breathing underwater +Suffocation=Suffocation # Food @1@2 to satiety=@1@2 to satiety diff --git a/mods/lord/Player/Help/lord_tooltips/locale/lord_tooltips.ru.tr b/mods/lord/Player/Help/lord_tooltips/locale/lord_tooltips.ru.tr index e9e90db94..90c59617f 100644 --- a/mods/lord/Player/Help/lord_tooltips/locale/lord_tooltips.ru.tr +++ b/mods/lord/Player/Help/lord_tooltips/locale/lord_tooltips.ru.tr @@ -57,7 +57,8 @@ defense_poison=от отравления Health=Здоровье Speed=Скорость Jump=Прыжок - +Breath=Дыхание под водой +Suffocation=Удушье # Food @1@2 to satiety=@1@2 к сытости diff --git a/mods/lord/Player/Help/lord_tooltips/src/snippet/potions.lua b/mods/lord/Player/Help/lord_tooltips/src/snippet/potions.lua index 0678b25c6..a9aada329 100644 --- a/mods/lord/Player/Help/lord_tooltips/src/snippet/potions.lua +++ b/mods/lord/Player/Help/lord_tooltips/src/snippet/potions.lua @@ -17,7 +17,9 @@ end --- @param value number --- @return string local function value_color(value) - return tonumber(value) > 0 and '#aea' or '#f66' + return value + and (tonumber(value) > 0 and '#aea' or '#f66') + or tt.COLOR_DEFAULT end @@ -38,10 +40,10 @@ return function (item_string) local tpl = effect.is_periodical and template.periodical or template.general local effect_name = effect.name:first_to_upper() - local amount = sign(effect.power.amount) .. effect.power.amount + local amount = effect.power.amount and (sign(effect.power.amount) .. effect.power.amount) local amount_color = value_color(effect.power.amount) effects_strings[#effects_strings +1] = - ' • ' .. S(tpl, S(effect_name), colorize(amount_color, amount), effect.power.duration) + ' • ' .. S(tpl, S(effect_name), colorize(amount_color, amount or ''), effect.power.duration) return #effects_strings ~= 0 and ('\n' .. diff --git a/mods/lord/Tools/lord_potions/locale/lord_potions.en.tr b/mods/lord/Tools/lord_potions/locale/lord_potions.en.tr index f9786302c..4f75c2adb 100644 --- a/mods/lord/Tools/lord_potions/locale/lord_potions.en.tr +++ b/mods/lord/Tools/lord_potions/locale/lord_potions.en.tr @@ -33,3 +33,13 @@ Dol Guldur's Fetters=Dol Guldur's Fetters A dark potion that binds the body=A dark potion that binds the body like the heavy chains of the dungeons of Dol Guldur.= like the heavy chains of the dungeons of Dol Guldur. It weighs down your legs, making jumping impossible.=Утяжеляет ноги, делая прыжки невозможными. + + +Limpë=Limpë +Sacred drink, crafted from the dew of Telperion and Laurelin,=Sacred drink, crafted from the dew of Telperion and Laurelin, + grants ability to hold their breath.= grants ability to hold their breath. +Legends say it was first gifted to the Elves by Ulmo, the Lord of Waters.=Legends say it was first gifted to the Elves by Ulmo, the Lord of Waters. + +Breath of Morgoth=Breath of Morgoth +A dangerous potion that blocks breathing and causes suffocation,=A dangerous potion that blocks breathing and causes suffocation, + as if darkness is consuming you from within.= as if darkness is consuming you from within. diff --git a/mods/lord/Tools/lord_potions/locale/lord_potions.ru.tr b/mods/lord/Tools/lord_potions/locale/lord_potions.ru.tr index 58a904ac8..563eec1e0 100644 --- a/mods/lord/Tools/lord_potions/locale/lord_potions.ru.tr +++ b/mods/lord/Tools/lord_potions/locale/lord_potions.ru.tr @@ -33,3 +33,13 @@ Dol Guldur's Fetters=Оковы Дол Гулдура A dark potion that binds the body=Мрачное зелье, сковывающее тело, like the heavy chains of the dungeons of Dol Guldur.= словно тяжёлые цепи темниц Дол Гулдура. It weighs down your legs, making jumping impossible.=Утяжеляет ноги, делая прыжки невозможными. + + +Limpë=Limpë +Sacred drink, crafted from the dew of Telperion and Laurelin,=Cвященный напиток, созданный из капель росы Телпериона и Лаурелина, + grants ability to hold their breath.= наделяет способностью задерживать дыхание. +Legends say it was first gifted to the Elves by Ulmo, the Lord of Waters.=Легенды говорят, что его впервые даровал эльфам Улмо, Владыка Вод. + +Breath of Morgoth=Дыхание Моргота +A dangerous potion that blocks breathing and causes suffocation,=Опасное зелье, блокирующее дыхание и вызывающее удушье, + as if darkness is consuming you from within.= как если бы мрак поглощал тебя изнутри. diff --git a/mods/lord/Tools/lord_potions/src/lord_potions/config/potions.lua b/mods/lord/Tools/lord_potions/src/lord_potions/config/potions.lua index 0059604dc..51acb6850 100644 --- a/mods/lord/Tools/lord_potions/src/lord_potions/config/potions.lua +++ b/mods/lord/Tools/lord_potions/src/lord_potions/config/potions.lua @@ -27,7 +27,7 @@ local config = { ['+3'] = { amount = 4, duration = 100, }, }, description = - S('An ancient elixir from the West')..'\n'.. + S('An ancient elixir from the West')..'\n'.. S(' that restores health and heals wounds.') , }, @@ -41,7 +41,7 @@ local config = { ['-3'] = { amount = -3, duration = 100, }, }, description = - S('Thick toxic brew based on orc pus, corroding both body and spirit.')..'\n'.. + S('Thick toxic brew based on orc pus, corroding both body and spirit.')..'\n'.. S('Corrodes the body from the inside and covers it with wounds from the outside.') }, @@ -55,7 +55,7 @@ local config = { ['+3'] = { amount = 3, duration = 100, }, }, description = - S('An extremely refreshing and invigorating drink')..'\n'.. + S('An extremely refreshing and invigorating drink')..'\n'.. S(' made from the waters of the Metedras springs.')..'\n'.. S('A unique drink that grants the speed of the ancient trees.') }, @@ -68,7 +68,7 @@ local config = { ['-3'] = { amount = -3, duration = 100, }, }, description = - S('Created from the venom of Shelob\'s web,')..'\n'.. + S('Created from the venom of Shelob\'s web,')..'\n'.. S(' which she uses to paralyze enemies.')..'\n'.. S('A venomous potion that binds the body like Shelob’s web.') }, @@ -83,7 +83,7 @@ local config = { ['+3'] = { amount = 4, duration = 100, }, }, description = - S('А strong stimulating drink of the elves.')..'\n'.. + S('А strong stimulating drink of the elves.')..'\n'.. S('A potion that allows you to jump higher,')..'\n'.. S(' as if invisible wings were lifting you into the air.') }, @@ -96,10 +96,38 @@ local config = { ['-3'] = { amount = -3, duration = 100, }, }, description = - S('A dark potion that binds the body')..'\n'.. + S('A dark potion that binds the body')..'\n'.. S(' like the heavy chains of the dungeons of Dol Guldur.')..'\n'.. S('It weighs down your legs, making jumping impossible.') }, + + -- BREATH + { + item_name = 'lord_potions:limpe', title = S('Limpë'), color = '#0ff', + effect = lord_effects.BREATH, + powers = { + ['+1'] = { duration = 20, }, + ['+2'] = { duration = 50, }, + ['+3'] = { duration = 100, }, + }, + description = + S('Sacred drink, crafted from the dew of Telperion and Laurelin,')..'\n'.. + S(' grants ability to hold their breath.')..'\n'.. + S('Legends say it was first gifted to the Elves by Ulmo, the Lord of Waters.') + }, + { + item_name = 'lord_potions:morgoth_breath', title = S('Breath of Morgoth'), color = '#222', + effect = lord_effects.SUFFOCATION, + is_periodical = true, + powers = { + ['-1'] = { amount = -1, duration = 20, }, + ['-2'] = { amount = -2, duration = 50, }, + ['-3'] = { amount = -3, duration = 100, }, + }, + description = + S('A dangerous potion that blocks breathing and causes suffocation,')..'\n'.. + S(' as if darkness is consuming you from within.') + }, }