Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak Affix Descriptions #7709

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
215 changes: 90 additions & 125 deletions Source/items.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3885,205 +3885,170 @@ bool DoOil(Player &player, int cii)
switch (plidx) {
case IPL_TOHIT:
case IPL_TOHIT_CURSE:
return fmt::format(fmt::runtime(_("chance to hit: {:+d}%")), item._iPLToHit);
return fmt::format(fmt::runtime(_("{:+d}% to Chance To Hit")), item._iPLToHit);
case IPL_DAMP:
case IPL_DAMP_CURSE:
return fmt::format(fmt::runtime(_(/*xgettext:no-c-format*/ "{:+d}% damage")), item._iPLDam);
case IPL_DECAY:
return fmt::format(fmt::runtime(_(/*xgettext:no-c-format*/ "{:+d}% Damage")), item._iPLDam);
case IPL_TOHIT_DAMP:
case IPL_TOHIT_DAMP_CURSE:
return fmt::format(fmt::runtime(_("to hit: {:+d}%, {:+d}% damage")), item._iPLToHit, item._iPLDam);
case IPL_DOPPELGANGER:
return fmt::format(fmt::runtime(_("{:+d}% to Chance To Hit; {:+d}% damage")), item._iPLToHit, item._iPLDam);
case IPL_ACP:
case IPL_ACP_CURSE:
return fmt::format(fmt::runtime(_(/*xgettext:no-c-format*/ "{:+d}% armor")), item._iPLAC);
return fmt::format(fmt::runtime(_(/*xgettext:no-c-format*/ "{:+d}% Armor Class")), item._iPLAC);
case IPL_SETAC:
case IPL_AC_CURSE:
return fmt::format(fmt::runtime(_("armor class: {:d}")), item._iAC);
return fmt::format(fmt::runtime(_("Armor Class: {:d}")), item._iAC);
case IPL_FIRERES:
case IPL_FIRERES_CURSE:
if (item._iPLFR < MaxResistance)
return fmt::format(fmt::runtime(_("Resist Fire: {:+d}%")), item._iPLFR);
else
return fmt::format(fmt::runtime(_("Resist Fire: {:+d}% MAX")), MaxResistance);
return fmt::format(fmt::runtime(_("Fire Resist {:+d}%")), item._iPLFR);
case IPL_LIGHTRES:
case IPL_LIGHTRES_CURSE:
if (item._iPLLR < MaxResistance)
return fmt::format(fmt::runtime(_("Resist Lightning: {:+d}%")), item._iPLLR);
else
return fmt::format(fmt::runtime(_("Resist Lightning: {:+d}% MAX")), MaxResistance);
return fmt::format(fmt::runtime(_("Lightning Resist {:+d}%")), item._iPLLR);
case IPL_MAGICRES:
case IPL_MAGICRES_CURSE:
if (item._iPLMR < MaxResistance)
return fmt::format(fmt::runtime(_("Resist Magic: {:+d}%")), item._iPLMR);
else
return fmt::format(fmt::runtime(_("Resist Magic: {:+d}% MAX")), MaxResistance);
return fmt::format(fmt::runtime(_("Magic Resist {:+d}%")), item._iPLMR);
case IPL_ALLRES:
if (item._iPLFR < MaxResistance)
return fmt::format(fmt::runtime(_("Resist All: {:+d}%")), item._iPLFR);
else
return fmt::format(fmt::runtime(_("Resist All: {:+d}% MAX")), MaxResistance);
return fmt::format(fmt::runtime(_("All Resistances {:+d}%")), item._iPLFR);
case IPL_SPLLVLADD:
if (item._iSplLvlAdd > 0)
return fmt::format(fmt::runtime(ngettext("spells are increased {:d} level", "spells are increased {:d} levels", item._iSplLvlAdd)), item._iSplLvlAdd);
else if (item._iSplLvlAdd < 0)
return fmt::format(fmt::runtime(ngettext("spells are decreased {:d} level", "spells are decreased {:d} levels", -item._iSplLvlAdd)), -item._iSplLvlAdd);
else
return _("spell levels unchanged (?)");
return fmt::format(fmt::runtime(_("{:+d} to Spell Levels")), item._iSplLvlAdd);
case IPL_CHARGES:
return _("Extra charges");
return _("Increased Charges");
case IPL_SPELL:
return fmt::format(fmt::runtime(ngettext("{:d} {:s} charge", "{:d} {:s} charges", item._iMaxCharges)), item._iMaxCharges, pgettext("spell", GetSpellData(item._iSpell).sNameText));
return fmt::format(fmt::runtime(_("Level {:d} {:s} ({:d}/{:d} Charges)")), MyPlayer->GetSpellLevel(item._iSpell), pgettext("spell", GetSpellData(item._iSpell).sNameText), item._iCharges, item._iMaxCharges);
case IPL_FIREDAM:
case IPL_FIRE_ARROWS:
case IPL_FIREBALL:
if (item._iFMinDam == item._iFMaxDam)
return fmt::format(fmt::runtime(_("Fire hit damage: {:d}")), item._iFMinDam);
return fmt::format(fmt::runtime(_("Adds {:d} Fire Damage")), item._iFMinDam);
else
return fmt::format(fmt::runtime(_("Fire hit damage: {:d}-{:d}")), item._iFMinDam, item._iFMaxDam);
return fmt::format(fmt::runtime(_("Adds {:d}-{:d} Fire Damage")), item._iFMinDam, item._iFMaxDam);
case IPL_LIGHTDAM:
case IPL_LIGHT_ARROWS:
case IPL_ADDACLIFE:
if (item._iLMinDam == item._iLMaxDam)
return fmt::format(fmt::runtime(_("Lightning hit damage: {:d}")), item._iLMinDam);
return fmt::format(fmt::runtime(_("Adds {:d} Lightning Damage")), item._iLMinDam);
else
return fmt::format(fmt::runtime(_("Lightning hit damage: {:d}-{:d}")), item._iLMinDam, item._iLMaxDam);
return fmt::format(fmt::runtime(_("Adds {:d}-{:d} Lightning Damage")), item._iLMinDam, item._iLMaxDam);
case IPL_STR:
case IPL_STR_CURSE:
return fmt::format(fmt::runtime(_("{:+d} to strength")), item._iPLStr);
return fmt::format(fmt::runtime(_("{:+d} to Strength")), item._iPLStr);
case IPL_MAG:
case IPL_MAG_CURSE:
return fmt::format(fmt::runtime(_("{:+d} to magic")), item._iPLMag);
return fmt::format(fmt::runtime(_("{:+d} to Magic")), item._iPLMag);
case IPL_DEX:
case IPL_DEX_CURSE:
return fmt::format(fmt::runtime(_("{:+d} to dexterity")), item._iPLDex);
return fmt::format(fmt::runtime(_("{:+d} to Dexterity")), item._iPLDex);
case IPL_VIT:
case IPL_VIT_CURSE:
return fmt::format(fmt::runtime(_("{:+d} to vitality")), item._iPLVit);
return fmt::format(fmt::runtime(_("{:+d} to Vitality")), item._iPLVit);
case IPL_ATTRIBS:
case IPL_ATTRIBS_CURSE:
return fmt::format(fmt::runtime(_("{:+d} to all attributes")), item._iPLStr);
return fmt::format(fmt::runtime(_("{:+d} to All Attributes")), item._iPLStr);
case IPL_GETHIT_CURSE:
return fmt::format(fmt::runtime(_("Damage Taken Increased by {:d}")), item._iPLGetHit);
case IPL_GETHIT:
return fmt::format(fmt::runtime(_("{:+d} damage from enemies")), item._iPLGetHit);
return fmt::format(fmt::runtime(_("Damage Taken Reduced by {:d}")), -item._iPLGetHit);
case IPL_LIFE:
case IPL_LIFE_CURSE:
return fmt::format(fmt::runtime(_("Hit Points: {:+d}")), item._iPLHP >> 6);
return fmt::format(fmt::runtime(_("{:+d} to Life")), item._iPLHP >> 6);
case IPL_MANA:
case IPL_MANA_CURSE:
return fmt::format(fmt::runtime(_("Mana: {:+d}")), item._iPLMana >> 6);
return fmt::format(fmt::runtime(_("{:+d} to Mana")), item._iPLMana >> 6);
case IPL_DUR:
return _("high durability");
return _("Increased Durability");
case IPL_DUR_CURSE:
return _("decreased durability");
return _("Decreased Durability");
case IPL_INDESTRUCTIBLE:
return _("indestructible");
return _("Indestructible");
case IPL_LIGHT:
return fmt::format(fmt::runtime(_(/*xgettext:no-c-format*/ "+{:d}% light radius")), 10 * item._iPLLight);
case IPL_LIGHT_CURSE:
return fmt::format(fmt::runtime(_(/*xgettext:no-c-format*/ "-{:d}% light radius")), -10 * item._iPLLight);
return fmt::format(fmt::runtime(_(/*xgettext:no-c-format*/ "{:+d} to Light Radius")), item._iPLLight);
case IPL_MULT_ARROWS:
return _("multiple arrows per shot");
case IPL_FIRE_ARROWS:
if (item._iFMinDam == item._iFMaxDam)
return fmt::format(fmt::runtime(_("fire arrows damage: {:d}")), item._iFMinDam);
else
return fmt::format(fmt::runtime(_("fire arrows damage: {:d}-{:d}")), item._iFMinDam, item._iFMaxDam);
case IPL_LIGHT_ARROWS:
if (item._iLMinDam == item._iLMaxDam)
return fmt::format(fmt::runtime(_("lightning arrows damage {:d}")), item._iLMinDam);
else
return fmt::format(fmt::runtime(_("lightning arrows damage {:d}-{:d}")), item._iLMinDam, item._iLMaxDam);
case IPL_FIREBALL:
if (item._iFMinDam == item._iFMaxDam)
return fmt::format(fmt::runtime(_("fireball damage: {:d}")), item._iFMinDam);
else
return fmt::format(fmt::runtime(_("fireball damage: {:d}-{:d}")), item._iFMinDam, item._iFMaxDam);
return _("Multishot");
case IPL_THORNS:
return _("attacker takes 1-3 damage");
return _("Attacker Takes Damage of 1-3");
case IPL_NOMANA:
return _("user loses all mana");
return _("Mana set to 0");
case IPL_ABSHALFTRAP:
return _("absorbs half of trap damage");
return _("Damage From Traps -50%");
case IPL_KNOCKBACK:
return _("knocks target back");
return _("Knockback");
case IPL_3XDAMVDEM:
return _(/*xgettext:no-c-format*/ "+200% damage vs. demons");
return _(/*xgettext:no-c-format*/ "Triple Damage vs. Demons");
case IPL_ALLRESZERO:
return _("All Resistance equals 0");
return _("All Resistances set to 0");
case IPL_STEALMANA:
if (HasAnyOf(item._iFlags, ItemSpecialEffect::StealMana3))
return _(/*xgettext:no-c-format*/ "hit steals 3% mana");
return _(/*xgettext:no-c-format*/ "3% Mana Stolen per Hit");
if (HasAnyOf(item._iFlags, ItemSpecialEffect::StealMana5))
return _(/*xgettext:no-c-format*/ "hit steals 5% mana");
return _(/*xgettext:no-c-format*/ "5% Mana Stolen per Hit");
return {};
case IPL_STEALLIFE:
if (HasAnyOf(item._iFlags, ItemSpecialEffect::StealLife3))
return _(/*xgettext:no-c-format*/ "hit steals 3% life");
return _(/*xgettext:no-c-format*/ "3% Life Stolen Per Hit");
if (HasAnyOf(item._iFlags, ItemSpecialEffect::StealLife5))
return _(/*xgettext:no-c-format*/ "hit steals 5% life");
return _(/*xgettext:no-c-format*/ "5% Life Stolen Per Hit");
return {};
case IPL_TARGAC:
return _("penetrates target's armor");
return _("Increased Chance To Hit");
case IPL_FASTATTACK:
if (HasAnyOf(item._iFlags, ItemSpecialEffect::QuickAttack))
return _("quick attack");
return _("Quick Attack Speed");
if (HasAnyOf(item._iFlags, ItemSpecialEffect::FastAttack))
return _("fast attack");
return _("Fast Attack Speed");
if (HasAnyOf(item._iFlags, ItemSpecialEffect::FasterAttack))
return _("faster attack");
return _("Faster Attack Speed");
if (HasAnyOf(item._iFlags, ItemSpecialEffect::FastestAttack))
return _("fastest attack");
return _("Another ability (NW)");
return _("Fastest Attack Speed");
return _("");
case IPL_FASTRECOVER:
if (HasAnyOf(item._iFlags, ItemSpecialEffect::FastHitRecovery))
return _("fast hit recovery");
return _("Fast Hit Recovery");
if (HasAnyOf(item._iFlags, ItemSpecialEffect::FasterHitRecovery))
return _("faster hit recovery");
return _("Faster Hit Recovery");
if (HasAnyOf(item._iFlags, ItemSpecialEffect::FastestHitRecovery))
return _("fastest hit recovery");
return _("Fastest Hit Recovery");
return _("Another ability (NW)");
case IPL_FASTBLOCK:
return _("fast block");
return _("Fastest Block Rate");
case IPL_DAMMOD:
return fmt::format(fmt::runtime(ngettext("adds {:d} point to damage", "adds {:d} points to damage", item._iPLDamMod)), item._iPLDamMod);
return fmt::format(fmt::runtime(_("{:+d} to Damage")), item._iPLDamMod);
case IPL_RNDARROWVEL:
return _("fires random speed arrows");
return _("Random Speed Arrows");
case IPL_SETDAM:
return _("unusual item damage");
return _("Unusual Damage");
case IPL_SETDUR:
return _("altered durability");
return _("Altered Durability");
case IPL_ONEHAND:
return _("one handed sword");
return _("One-Handed");
case IPL_DRAINLIFE:
return _("constantly lose hit points");
return _("Life Drain");
case IPL_RNDSTEALLIFE:
return _("life stealing");
return _("0-12.5% Life Stolen Per Hit");
case IPL_NOMINSTR:
return _("no strength requirement");
case IPL_ADDACLIFE:
if (item._iFMinDam == item._iFMaxDam)
return fmt::format(fmt::runtime(_("lightning damage: {:d}")), item._iFMinDam);
else
return fmt::format(fmt::runtime(_("lightning damage: {:d}-{:d}")), item._iFMinDam, item._iFMaxDam);
return _("No Strength Requirement");
case IPL_ADDMANAAC:
return _("charged bolts on hits");
return _("Casts Charged Bolt on Attack");
case IPL_DEVASTATION:
return _("occasional triple damage");
case IPL_DECAY:
return fmt::format(fmt::runtime(_(/*xgettext:no-c-format*/ "decaying {:+d}% damage")), item._iPLDam);
return _("5% Chance for Triple Damage");
case IPL_PERIL:
return _("2x dmg to monst, 1x to you");
return fmt::format(fmt::runtime(_("Double Damage; Damages User {:d}-{:d}")), item._iMinDam, item._iMaxDam);
case IPL_JESTERS:
return std::string(_(/*xgettext:no-c-format*/ "Random 0 - 600% damage"));
return std::string(_(/*xgettext:no-c-format*/ "-100% to +500% Damage"));
case IPL_CRYSTALLINE:
return fmt::format(fmt::runtime(_(/*xgettext:no-c-format*/ "low dur, {:+d}% damage")), item._iPLDam);
case IPL_DOPPELGANGER:
return fmt::format(fmt::runtime(_("to hit: {:+d}%, {:+d}% damage")), item._iPLToHit, item._iPLDam);
return fmt::format(fmt::runtime(_(/*xgettext:no-c-format*/ "Decreased Durability; {:+d}% Damage")), item._iPLDam);
case IPL_ACDEMON:
return _("extra AC vs demons");
return _("+120 to Armor Class vs. Demons");
case IPL_ACUNDEAD:
return _("extra AC vs undead");
return _("+60 to Armor Class vs. Undead");
case IPL_MANATOLIFE:
return _("50% Mana moved to Health");
return _("50% Mana moved to Life");
case IPL_LIFETOMANA:
return _("40% Health moved to Mana");
return _("40% Life moved to Mana");
default:
return _("Another ability (NW)");
return _("");
}
}

Expand Down Expand Up @@ -4124,24 +4089,24 @@ void PrintItemDetails(const Item &item)
if (item._iClass == ICLASS_WEAPON) {
if (item._iMinDam == item._iMaxDam) {
if (item._iMaxDur == DUR_INDESTRUCTIBLE)
AddInfoBoxString(fmt::format(fmt::runtime(_("damage: {:d} Indestructible")), item._iMinDam));
AddInfoBoxString(fmt::format(fmt::runtime(_("Damage: {:d}")), item._iMinDam));
else
AddInfoBoxString(fmt::format(fmt::runtime(_(/* TRANSLATORS: Dur: is durability */ "damage: {:d} Dur: {:d}/{:d}")), item._iMinDam, item._iDurability, item._iMaxDur));
AddInfoBoxString(fmt::format(fmt::runtime(_(/* TRANSLATORS: Dur: is durability */ "Damage: {:d} Dur: {:d}/{:d}")), item._iMinDam, item._iDurability, item._iMaxDur));
} else {
if (item._iMaxDur == DUR_INDESTRUCTIBLE)
AddInfoBoxString(fmt::format(fmt::runtime(_("damage: {:d}-{:d} Indestructible")), item._iMinDam, item._iMaxDam));
AddInfoBoxString(fmt::format(fmt::runtime(_("Damage: {:d}-{:d}")), item._iMinDam, item._iMaxDam));
else
AddInfoBoxString(fmt::format(fmt::runtime(_(/* TRANSLATORS: Dur: is durability */ "damage: {:d}-{:d} Dur: {:d}/{:d}")), item._iMinDam, item._iMaxDam, item._iDurability, item._iMaxDur));
AddInfoBoxString(fmt::format(fmt::runtime(_(/* TRANSLATORS: Dur: is durability */ "Damage: {:d}-{:d} Dur: {:d}/{:d}")), item._iMinDam, item._iMaxDam, item._iDurability, item._iMaxDur));
}
}
if (item._iClass == ICLASS_ARMOR) {
if (item._iMaxDur == DUR_INDESTRUCTIBLE)
AddInfoBoxString(fmt::format(fmt::runtime(_("armor: {:d} Indestructible")), item._iAC));
AddInfoBoxString(fmt::format(fmt::runtime(_("Armor Class: {:d}")), item._iAC));
else
AddInfoBoxString(fmt::format(fmt::runtime(_(/* TRANSLATORS: Dur: is durability */ "armor: {:d} Dur: {:d}/{:d}")), item._iAC, item._iDurability, item._iMaxDur));
AddInfoBoxString(fmt::format(fmt::runtime(_(/* TRANSLATORS: Dur: is durability */ "Armor Class: {:d} Dur: {:d}/{:d}")), item._iAC, item._iDurability, item._iMaxDur));
}
if (item._iMiscId == IMISC_STAFF && item._iMaxCharges != 0) {
AddInfoBoxString(fmt::format(fmt::runtime(_("Charges: {:d}/{:d}")), item._iCharges, item._iMaxCharges));
AddInfoBoxString(fmt::format(fmt::runtime(_("Lvl {:d} {:s} ({:d}/{:d} Charges)")), MyPlayer->GetSpellLevel(item._iSpell), pgettext("spell", GetSpellData(item._iSpell).sNameText), item._iCharges, item._iMaxCharges));
}
if (item._iPrePower != -1) {
AddInfoBoxString(PrintItemPower(item._iPrePower, item));
Expand All @@ -4150,7 +4115,7 @@ void PrintItemDetails(const Item &item)
AddInfoBoxString(PrintItemPower(item._iSufPower, item));
}
if (item._iMagical == ITEM_QUALITY_UNIQUE) {
AddInfoBoxString(_("unique item"));
AddInfoBoxString(_("Unique Item"));
ShowUniqueItemInfoBox = true;
curruitem = item;
}
Expand All @@ -4165,30 +4130,30 @@ void PrintItemDur(const Item &item)
if (item._iClass == ICLASS_WEAPON) {
if (item._iMinDam == item._iMaxDam) {
if (item._iMaxDur == DUR_INDESTRUCTIBLE)
AddInfoBoxString(fmt::format(fmt::runtime(_("damage: {:d} Indestructible")), item._iMinDam));
AddInfoBoxString(fmt::format(fmt::runtime(_("Damage: {:d}")), item._iMinDam));
else
AddInfoBoxString(fmt::format(fmt::runtime(_("damage: {:d} Dur: {:d}/{:d}")), item._iMinDam, item._iDurability, item._iMaxDur));
AddInfoBoxString(fmt::format(fmt::runtime(_("Damage: {:d} Dur: {:d}/{:d}")), item._iMinDam, item._iDurability, item._iMaxDur));
} else {
if (item._iMaxDur == DUR_INDESTRUCTIBLE)
AddInfoBoxString(fmt::format(fmt::runtime(_("damage: {:d}-{:d} Indestructible")), item._iMinDam, item._iMaxDam));
AddInfoBoxString(fmt::format(fmt::runtime(_("Damage: {:d}-{:d}")), item._iMinDam, item._iMaxDam));
else
AddInfoBoxString(fmt::format(fmt::runtime(_("damage: {:d}-{:d} Dur: {:d}/{:d}")), item._iMinDam, item._iMaxDam, item._iDurability, item._iMaxDur));
AddInfoBoxString(fmt::format(fmt::runtime(_("Damage: {:d}-{:d} Dur: {:d}/{:d}")), item._iMinDam, item._iMaxDam, item._iDurability, item._iMaxDur));
}
if (item._iMiscId == IMISC_STAFF && item._iMaxCharges > 0) {
AddInfoBoxString(fmt::format(fmt::runtime(_("Charges: {:d}/{:d}")), item._iCharges, item._iMaxCharges));
AddInfoBoxString(fmt::format(fmt::runtime(_("Lvl {:d} {:s} ({:d}/{:d} Charges)")), MyPlayer->GetSpellLevel(item._iSpell), pgettext("spell", GetSpellData(item._iSpell).sNameText), item._iCharges, item._iMaxCharges));
}
if (item._iMagical != ITEM_QUALITY_NORMAL)
AddInfoBoxString(_("Not Identified"));
}
if (item._iClass == ICLASS_ARMOR) {
if (item._iMaxDur == DUR_INDESTRUCTIBLE)
AddInfoBoxString(fmt::format(fmt::runtime(_("armor: {:d} Indestructible")), item._iAC));
AddInfoBoxString(fmt::format(fmt::runtime(_("Armor Class: {:d}")), item._iAC));
else
AddInfoBoxString(fmt::format(fmt::runtime(_("armor: {:d} Dur: {:d}/{:d}")), item._iAC, item._iDurability, item._iMaxDur));
AddInfoBoxString(fmt::format(fmt::runtime(_("Armor Class: {:d} Dur: {:d}/{:d}")), item._iAC, item._iDurability, item._iMaxDur));
if (item._iMagical != ITEM_QUALITY_NORMAL)
AddInfoBoxString(_("Not Identified"));
if (item._iMiscId == IMISC_STAFF && item._iMaxCharges > 0) {
AddInfoBoxString(fmt::format(fmt::runtime(_("Charges: {:d}/{:d}")), item._iCharges, item._iMaxCharges));
AddInfoBoxString(fmt::format(fmt::runtime(_("Lvl {:d} {:s} ({:d}/{:d} Charges)")), MyPlayer->GetSpellLevel(item._iSpell), pgettext("spell", GetSpellData(item._iSpell).sNameText), item._iCharges, item._iMaxCharges));
}
}
if (IsAnyOf(item._itype, ItemType::Ring, ItemType::Amulet))
Expand Down
Loading