diff --git a/assets/voxygen/i18n/PL/buff.ron b/assets/voxygen/i18n/PL/buff.ron index 4e6ef288fd..e2eeffc0b7 100644 --- a/assets/voxygen/i18n/PL/buff.ron +++ b/assets/voxygen/i18n/PL/buff.ron @@ -12,7 +12,7 @@ "buff.title.saturation": "Najedzenie", "buff.desc.saturation": "Odzyskaj zdrowie jedząc żywność.", "buff.title.campfire_heal": "Odpoczynek przy ognisku", - "buff.desc.campfire_heal": "Odpoczywanie przy ognisku odzyskuje 1% zdrowia na sekundę.", + "buff.desc.campfire_heal": "Odpoczywanie przy ognisku odzyskuje {rate}% zdrowia na sekundę.", "buff.title.invulnerability": "Nietykalność", "buff.desc.invulnerability": "Nie można Cię zranić.", "buff.title.protectingward": "Totem ochronny", diff --git a/assets/voxygen/i18n/en/buff.ron b/assets/voxygen/i18n/en/buff.ron index ea4187e202..cbd6d30f19 100644 --- a/assets/voxygen/i18n/en/buff.ron +++ b/assets/voxygen/i18n/en/buff.ron @@ -14,7 +14,7 @@ "buff.title.saturation": "Saturation", "buff.desc.saturation": "Gain health over time from consumables.", "buff.title.campfire_heal": "Campfire Heal", - "buff.desc.campfire_heal": "Resting at a campfire heals 1% per second.", + "buff.desc.campfire_heal": "Resting at a campfire heals {rate}% per second.", "buff.title.invulnerability": "Invulnerability", "buff.desc.invulnerability": "You cannot be damaged by any attack.", "buff.title.protectingward": "Protecting Ward", diff --git a/assets/voxygen/i18n/es_ES/buff.ron b/assets/voxygen/i18n/es_ES/buff.ron index 557f3cb52f..6cf979b30c 100644 --- a/assets/voxygen/i18n/es_ES/buff.ron +++ b/assets/voxygen/i18n/es_ES/buff.ron @@ -14,7 +14,7 @@ "buff.title.saturation": "Saturación", "buff.desc.saturation": "Restaura salud durante un tiempo por consumibles.", "buff.title.campfire_heal": "Fogata curativa", - "buff.desc.campfire_heal": "Descansar en una fogata te sana 1% por segundo.", + "buff.desc.campfire_heal": "Descansar en una fogata te sana {rate}% por segundo.", "buff.title.invulnerability": "Invulnerabilidad", "buff.desc.invulnerability": "No puedes ser dañado por ningún ataque.", "buff.title.protectingward": "Guardián protector", diff --git a/assets/voxygen/i18n/es_la/_manifest.ron b/assets/voxygen/i18n/es_la/_manifest.ron index 6df5839ae8..fb8c8b4659 100644 --- a/assets/voxygen/i18n/es_la/_manifest.ron +++ b/assets/voxygen/i18n/es_la/_manifest.ron @@ -551,7 +551,7 @@ Protección "buff.title.saturation": "Saturación", "buff.desc.saturation": "Recupera vida durante un tiempo por objetos.", "buff.title.campfire_heal": "Curación de fogata", - "buff.desc.campfire_heal": "Descansar en una fogata recupera 1% por segundo.", + "buff.desc.campfire_heal": "Descansar en una fogata recupera {rate}% por segundo.", // Debuffs "buff.title.bleed": "Sangrando", "buff.desc.bleed": "Inflinge daño regularmente.", diff --git a/assets/voxygen/i18n/fr_FR/buff.ron b/assets/voxygen/i18n/fr_FR/buff.ron index 3b3d22a034..d764b7968a 100644 --- a/assets/voxygen/i18n/fr_FR/buff.ron +++ b/assets/voxygen/i18n/fr_FR/buff.ron @@ -14,7 +14,7 @@ "buff.title.saturation": "Saturation", "buff.desc.saturation": "Régénère progressivement des points de vie grâce à la nourriture.", "buff.title.campfire_heal": "Soin autour d'un feu de camp", - "buff.desc.campfire_heal": "Se reposer à côté d'un feu de camp restaure 1% de santé chaque seconde.", + "buff.desc.campfire_heal": "Se reposer à côté d'un feu de camp restaure {rate}% de santé chaque seconde.", "buff.title.invulnerability": "Invulnérabilité", "buff.desc.invulnerability": "Vous ne pouvez pas être blessé par une attaque.", "buff.title.protectingward": "Aura de Protection", diff --git a/assets/voxygen/i18n/ja_JP/buff.ron b/assets/voxygen/i18n/ja_JP/buff.ron index 5624c56ce2..da5885664c 100644 --- a/assets/voxygen/i18n/ja_JP/buff.ron +++ b/assets/voxygen/i18n/ja_JP/buff.ron @@ -14,7 +14,7 @@ "buff.title.saturation": "サチュレーション", "buff.desc.saturation": "アイテムを使って一定時間体力を増やす", "buff.title.campfire_heal": "キャンプファイヤー ヒール", - "buff.desc.campfire_heal": "焚き火のそばに座ると1秒毎に1%体力回復", + "buff.desc.campfire_heal": "焚き火のそばに座ると1秒毎に{rate}%体力回復", "buff.title.invulnerability": "インバルネラビリティ", "buff.desc.invulnerability": "どんな攻撃のダメージも受けない", "buff.title.protectingward": "プロテクティング ワード", diff --git a/assets/voxygen/i18n/pt_BR/buff.ron b/assets/voxygen/i18n/pt_BR/buff.ron index cf7a0afb44..e9d2ec8112 100644 --- a/assets/voxygen/i18n/pt_BR/buff.ron +++ b/assets/voxygen/i18n/pt_BR/buff.ron @@ -14,7 +14,7 @@ "buff.title.saturation": "Saturação", "buff.desc.saturation": "Ganha vida no decorrer do tempo através de consumíveis.", "buff.title.campfire_heal": "Cura de Acampamento", - "buff.desc.campfire_heal": "Descansar próximo a uma fogueira de acampamento cura 1% de vida por segundo.", + "buff.desc.campfire_heal": "Descansar próximo a uma fogueira de acampamento cura {rate}% de vida por segundo.", "buff.title.invulnerability": "Invulnerabilidade", "buff.desc.invulnerability": "Você não receberá dano de nenhum ataque.", "buff.title.protectingward": "Guardião Protetor", diff --git a/assets/voxygen/i18n/tr_TR/buff.ron b/assets/voxygen/i18n/tr_TR/buff.ron index 398ed2acd9..094c7f24ab 100644 --- a/assets/voxygen/i18n/tr_TR/buff.ron +++ b/assets/voxygen/i18n/tr_TR/buff.ron @@ -13,11 +13,11 @@ "buff.title.saturation": "Tokluk", "buff.desc.saturation": "Tüketilebilen maddelerden zamanla can kazan.", "buff.title.campfire_heal": "Kamp Ateşi", - "buff.desc.campfire_heal": "Kamp ateşinin yakınında oturmak canını saniyede %1 iyileştirir.", + "buff.desc.campfire_heal": "Kamp ateşinin yakınında oturmak canını saniyede %{rate} iyileştirir.", "buff.title.bleed": "Kanama", "buff.desc.bleed": "Devamlı hasar verir.", }, vector_map: { } -) \ No newline at end of file +) diff --git a/assets/voxygen/i18n/uk_UA/buff.ron b/assets/voxygen/i18n/uk_UA/buff.ron index b424349881..9964628773 100644 --- a/assets/voxygen/i18n/uk_UA/buff.ron +++ b/assets/voxygen/i18n/uk_UA/buff.ron @@ -14,7 +14,7 @@ "buff.title.saturation": "Насичення", "buff.desc.saturation": "Поступово відновлює Здоров'я з їжі.", "buff.title.campfire_heal": "Відновлення біля ватри", - "buff.desc.campfire_heal": "Відпочинок біля ватри лікує на 1% за секунду.", + "buff.desc.campfire_heal": "Відпочинок біля ватри лікує на {rate}% за секунду.", "buff.title.invulnerability": "Невразливість", "buff.desc.invulnerability": "Ви невразливий, тільки тримайтесь подалі від омели.", "buff.title.protectingward": "Захисна Аура", diff --git a/assets/voxygen/i18n/zh_CN/buff.ron b/assets/voxygen/i18n/zh_CN/buff.ron index ae28ea27db..64b0b7df0f 100644 --- a/assets/voxygen/i18n/zh_CN/buff.ron +++ b/assets/voxygen/i18n/zh_CN/buff.ron @@ -14,7 +14,7 @@ "buff.title.saturation": "饱腹", "buff.desc.saturation": "吃饱喝足后,一定时间内生命值随缓慢恢复.", "buff.title.campfire_heal": "篝火疗愈", - "buff.desc.campfire_heal": "在篝火旁休息每秒可治愈1%生命.", + "buff.desc.campfire_heal": "在篝火旁休息每秒可治愈{rate}%生命.", "buff.title.invulnerability": "无敌", "buff.desc.invulnerability": "你不会受到任何攻击的伤害.", "buff.title.protectingward": "守护领域", diff --git a/voxygen/src/hud/buffs.rs b/voxygen/src/hud/buffs.rs index ab34f84756..858877b204 100644 --- a/voxygen/src/hud/buffs.rs +++ b/voxygen/src/hud/buffs.rs @@ -225,7 +225,7 @@ impl<'a> Widget for BuffsBar<'a> { .set(*id, ui); // Create Buff tooltip let title = hud::get_buff_title(buff.kind, localized_strings); - let desc_txt = hud::get_buff_desc(buff.kind, localized_strings); + let desc_txt = hud::get_buff_desc(buff.kind, buff.data, localized_strings); let remaining_time = hud::get_buff_time(*buff); let click_to_remove = format!("<{}>", &localized_strings.get("buff.remove")); let desc = format!("{}\n\n{}\n\n{}", desc_txt, remaining_time, click_to_remove); @@ -307,7 +307,7 @@ impl<'a> Widget for BuffsBar<'a> { .set(*id, ui); // Create Debuff tooltip let title = hud::get_buff_title(debuff.kind, localized_strings); - let desc_txt = hud::get_buff_desc(debuff.kind, localized_strings); + let desc_txt = hud::get_buff_desc(debuff.kind, debuff.data, localized_strings); let remaining_time = hud::get_buff_time(*debuff); let desc = format!("{}\n\n{}", desc_txt, remaining_time); Image::new(match duration_percentage as u64 { @@ -403,7 +403,7 @@ impl<'a> Widget for BuffsBar<'a> { .set(*id, ui); // Create Buff tooltip let title = hud::get_buff_title(buff.kind, localized_strings); - let desc_txt = hud::get_buff_desc(buff.kind, localized_strings); + let desc_txt = hud::get_buff_desc(buff.kind, buff.data, localized_strings); let remaining_time = hud::get_buff_time(*buff); let click_to_remove = format!("<{}>", &localized_strings.get("buff.remove")); let desc = if buff.is_buff { diff --git a/voxygen/src/hud/group.rs b/voxygen/src/hud/group.rs index 709c0cac23..4145e072f9 100644 --- a/voxygen/src/hud/group.rs +++ b/voxygen/src/hud/group.rs @@ -550,7 +550,8 @@ impl<'a> Widget for Group<'a> { .set(id, ui); // Create Buff tooltip let title = hud::get_buff_title(buff.kind, localized_strings); - let desc_txt = hud::get_buff_desc(buff.kind, localized_strings); + let desc_txt = + hud::get_buff_desc(buff.kind, buff.data, localized_strings); let remaining_time = hud::get_buff_time(buff); let desc = format!("{}\n\n{}", desc_txt, remaining_time); Image::new(match duration_percentage as u64 { diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 48ee2b7816..b2f6d6265f 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -72,7 +72,7 @@ use common::{ inventory::trade_pricing::TradePricing, item::{tool::ToolKind, ItemDesc, MaterialStatManifest, Quality}, skills::{Skill, SkillGroupKind}, - BuffKind, Item, + BuffData, BuffKind, Item, }, consts::MAX_PICKUP_RANGE, outcome::Outcome, @@ -96,6 +96,7 @@ use hashbrown::HashMap; use rand::Rng; use specs::{Join, WorldExt}; use std::{ + borrow::Cow, collections::VecDeque, sync::Arc, time::{Duration, Instant}, @@ -3632,21 +3633,33 @@ pub fn get_buff_title(buff: BuffKind, localized_strings: &Localization) -> &str } } -pub fn get_buff_desc(buff: BuffKind, localized_strings: &Localization) -> &str { +pub fn get_buff_desc(buff: BuffKind, data: BuffData, localized_strings: &Localization) -> Cow { match buff { // Buffs - BuffKind::Regeneration { .. } => localized_strings.get("buff.desc.heal"), - BuffKind::Saturation { .. } => localized_strings.get("buff.desc.saturation"), - BuffKind::Potion { .. } => localized_strings.get("buff.desc.potion"), - BuffKind::CampfireHeal { .. } => localized_strings.get("buff.desc.campfire_heal"), - BuffKind::IncreaseMaxHealth { .. } => localized_strings.get("buff.desc.IncreaseMaxHealth"), - BuffKind::IncreaseMaxEnergy { .. } => localized_strings.get("buff.desc.IncreaseMaxEnergy"), - BuffKind::Invulnerability => localized_strings.get("buff.desc.invulnerability"), - BuffKind::ProtectingWard => localized_strings.get("buff.desc.protectingward"), + BuffKind::Regeneration { .. } => Cow::Borrowed(localized_strings.get("buff.desc.heal")), + BuffKind::Saturation { .. } => Cow::Borrowed(localized_strings.get("buff.desc.saturation")), + BuffKind::Potion { .. } => Cow::Borrowed(localized_strings.get("buff.desc.potion")), + BuffKind::CampfireHeal { .. } => Cow::Owned( + localized_strings + .get("buff.desc.campfire_heal") + .replace("{rate}", &format!("{:.0}", data.strength * 100.0)), + ), + BuffKind::IncreaseMaxHealth { .. } => { + Cow::Borrowed(localized_strings.get("buff.desc.IncreaseMaxHealth")) + }, + BuffKind::IncreaseMaxEnergy { .. } => { + Cow::Borrowed(localized_strings.get("buff.desc.IncreaseMaxEnergy")) + }, + BuffKind::Invulnerability => { + Cow::Borrowed(localized_strings.get("buff.desc.invulnerability")) + }, + BuffKind::ProtectingWard => { + Cow::Borrowed(localized_strings.get("buff.desc.protectingward")) + }, // Debuffs - BuffKind::Bleeding { .. } => localized_strings.get("buff.desc.bleed"), - BuffKind::Cursed { .. } => localized_strings.get("buff.desc.cursed"), - BuffKind::Burning { .. } => localized_strings.get("buff.desc.burn"), + BuffKind::Bleeding { .. } => Cow::Borrowed(localized_strings.get("buff.desc.bleed")), + BuffKind::Cursed { .. } => Cow::Borrowed(localized_strings.get("buff.desc.cursed")), + BuffKind::Burning { .. } => Cow::Borrowed(localized_strings.get("buff.desc.burn")), } }