1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-15 13:33:36 +02:00

Update accurate shot translation handling

Co-authored-by: Ivan Savenko <saven.ivan@gmail.com>
This commit is contained in:
Dydzio 2024-01-10 23:57:29 +01:00 committed by GitHub
parent 3a83de5e70
commit 250b1b69a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -155,17 +155,11 @@ void Damage::describeEffect(std::vector<MetaString> & log, const Mechanics * m,
else if(m->getSpell()->getJsonKey().find("accurateShot") != std::string::npos && !multiple)
{
MetaString line;
if(kills > 1)
{
line.appendTextID("vcmi.battleWindow.accurateShot.resultDescription"); //(number) (unit type) was killed with an accurate shot!
line.replaceNumber(kills);
firstTarget->addNameReplacement(line, true);
}
else
{
line.appendTextID("vcmi.battleWindow.accurateShot.resultDescription.1"); //1 (unit type) were killed by accurate shots!
firstTarget->addNameReplacement(line, false);
}
std::string preferredLanguage = VLC->generaltexth->getPreferredLanguage();
std::string textID = "vcmi.battleWindow.accurateShot.resultDescription";
line.appendTextID(Languages::getPluralFormTextID( preferredLanguage, kills, text));
line.replaceNumber(kills);
firstTarget->addNameReplacement(line, true);
log.push_back(line);
}
else if(m->getSpellIndex() == SpellID::THUNDERBOLT && !multiple)