mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +02:00
Necromancy & Eagle eye infowindows
This commit is contained in:
@@ -968,7 +968,7 @@ CStackBasicDescriptor CGHeroInstance::calculateNecromancy (const BattleResult &b
|
||||
double necromancySkill = valOfBonuses(BonusType::UNDEAD_RAISE_PERCENTAGE) / 100.0;
|
||||
const ui8 necromancyLevel = valOfBonuses(BonusType::IMPROVED_NECROMANCY);
|
||||
vstd::amin(necromancySkill, 1.0); //it's impossible to raise more creatures than all...
|
||||
const std::map<CreatureID,si32> casualties {}; //= battleResult.casualties[CBattleInfoEssentials::otherSide(battleResult.winner)];
|
||||
const std::map<CreatureID,si32> &casualties = battleResult.casualties[CBattleInfoEssentials::otherSide(battleResult.winner)];
|
||||
// figure out what to raise - pick strongest creature meeting requirements
|
||||
CreatureID creatureTypeRaised = CreatureID::NONE; //now we always have IMPROVED_NECROMANCY, no need for hardcode
|
||||
int requiredCasualtyLevel = 1;
|
||||
@@ -1037,32 +1037,6 @@ CStackBasicDescriptor CGHeroInstance::calculateNecromancy (const BattleResult &b
|
||||
return CStackBasicDescriptor();
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the necromancy dialog with information about units raised.
|
||||
* @param raisedStack Pair where the first element represents ID of the raised creature
|
||||
* and the second element the amount.
|
||||
*/
|
||||
void CGHeroInstance::showNecromancyDialog(const CStackBasicDescriptor &raisedStack, vstd::RNG & rand) const
|
||||
{
|
||||
InfoWindow iw;
|
||||
iw.type = EInfoWindowMode::AUTO;
|
||||
iw.soundID = soundBase::pickup01 + rand.nextInt(6);
|
||||
iw.player = tempOwner;
|
||||
iw.components.emplace_back(ComponentType::CREATURE, raisedStack.getId(), raisedStack.count);
|
||||
|
||||
if (raisedStack.count > 1) // Practicing the dark arts of necromancy, ... (plural)
|
||||
{
|
||||
iw.text.appendLocalString(EMetaText::GENERAL_TXT, 145);
|
||||
iw.text.replaceNumber(raisedStack.count);
|
||||
}
|
||||
else // Practicing the dark arts of necromancy, ... (singular)
|
||||
{
|
||||
iw.text.appendLocalString(EMetaText::GENERAL_TXT, 146);
|
||||
}
|
||||
iw.text.replaceName(raisedStack);
|
||||
|
||||
cb->showInfoDialog(&iw);
|
||||
}
|
||||
/*
|
||||
int3 CGHeroInstance::getSightCenter() const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user