Skip to content

Commit

Permalink
finish shield name/desc translations
Browse files Browse the repository at this point in the history
  • Loading branch information
Lamby777 committed Jun 12, 2024
1 parent 64848cb commit 77c16e8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
8 changes: 7 additions & 1 deletion pets-gd/i18n/translations.csv
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,18 @@ SKILL_ATTACK_FX_CHANCE_ALWAYS,Always inflicts {fx}.
SKILL_ATTACK_FX_CHANCE_HIGH,High chance of inflicting {fx}.
SKILL_ATTACK_FX_CHANCE_LOW,May inflict {fx}.
,
SKILL_SHIELD_NAME,{affinity} {width} {name}
SKILL_SHIELD_NAME,{adjective} {width} {name}
SKILL_SHIELD_DESC,Casts a {width} {potency} {name} that {reflect_action} {affinity} damage.
,
SKILL_SHIELD_PHYSICAL_ADJ,Physical
SKILL_SHIELD_MAGICAL_ADJ,Magical
SKILL_SHIELD_UNIQUE_ADJ,Forceful
SKILL_SHIELD_SPECIALIZED_ADJ,Strange
SKILL_SHIELD_PHYSICAL_DESC,physical
SKILL_SHIELD_MAGICAL_DESC,magical
SKILL_SHIELD_UNIQUE_DESC,magical and unique
SKILL_SHIELD_SPECIALIZED_DESC,certain types of
,
SKILL_SHIELD_WIDTH_WIDE,Wide
SKILL_SHIELD_WIDTH_NARROW,Narrow
SKILL_SHIELD_POTENCY_IMPENETRABLE,Impenetrable
Expand Down
4 changes: 0 additions & 4 deletions pets-lib/dg/src/debug-menu.dg
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,3 @@ Skill Desc: {SKILL_DESC2}

---

Last page

---

20 changes: 18 additions & 2 deletions pets-lib/src/battle/skills/shields.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ impl SkillFamily for ShieldSkill {
fn name(&self) -> String {
let name = self.shield_type_str();
let width = self.shield_width_str();
let affinity = describe_damage_blocked(&self.affinity);
let adjective = describe_shield_adjective(&self.affinity);

tr_replace! {
"SKILL_SHIELD_NAME";
affinity, width, name,
adjective, width, name,
}
}

Expand Down Expand Up @@ -123,6 +123,22 @@ impl SkillFamily for ShieldSkill {
}
}

pub fn describe_shield_adjective(aff: &Affinities) -> GString {
if is_physical_shield(&aff) {
return tr("SKILL_SHIELD_PHYSICAL_ADJ");
}

if is_magical_shield(&aff) {
return tr("SKILL_SHIELD_MAGICAL_ADJ");
}

if is_unique_shield(&aff) {
return tr("SKILL_SHIELD_UNIQUE_ADJ");
}

tr("SKILL_SHIELD_SPECIALIZED_ADJ")
}

pub fn describe_damage_blocked(aff: &Affinities) -> GString {
if is_physical_shield(&aff) {
return tr("SKILL_SHIELD_PHYSICAL_DESC");
Expand Down

0 comments on commit 77c16e8

Please sign in to comment.