mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Add terrain overlays morale and luck bonuses description, fix #2740
This commit is contained in:
parent
7d8adcc083
commit
2a22d9ec12
@ -14,6 +14,7 @@
|
||||
#include "../NetPacks.h"
|
||||
#include "../filesystem/Filesystem.h"
|
||||
#include "../mapObjects/CGTownInstance.h"
|
||||
#include "../CGeneralTextHandler.h"
|
||||
|
||||
const CStack * BattleInfo::getNextStack() const
|
||||
{
|
||||
@ -561,25 +562,35 @@ BattleInfo * BattleInfo::setupBattle(int3 tile, ETerrainType terrain, BFieldType
|
||||
}
|
||||
case BFieldType::HOLY_GROUND:
|
||||
{
|
||||
curB->addNewBonus(std::make_shared<Bonus>(Bonus::ONE_BATTLE, Bonus::MORALE, Bonus::TERRAIN_OVERLAY, +1, battlefieldType, 0)->addLimiter(good));
|
||||
curB->addNewBonus(std::make_shared<Bonus>(Bonus::ONE_BATTLE, Bonus::MORALE, Bonus::TERRAIN_OVERLAY, -1, battlefieldType, 0)->addLimiter(evil));
|
||||
std::string goodArmyDesc = VLC->generaltexth->arraytxt[123];
|
||||
goodArmyDesc.erase(goodArmyDesc.size() - 2, 2); //omitting hardcoded +1 in description
|
||||
std::string evilArmyDesc = VLC->generaltexth->arraytxt[124];
|
||||
evilArmyDesc.erase(evilArmyDesc.size() - 2, 2);
|
||||
curB->addNewBonus(std::make_shared<Bonus>(Bonus::ONE_BATTLE, Bonus::MORALE, Bonus::TERRAIN_OVERLAY, +1, battlefieldType, goodArmyDesc, 0)->addLimiter(good));
|
||||
curB->addNewBonus(std::make_shared<Bonus>(Bonus::ONE_BATTLE, Bonus::MORALE, Bonus::TERRAIN_OVERLAY, -1, battlefieldType, evilArmyDesc, 0)->addLimiter(evil));
|
||||
break;
|
||||
}
|
||||
case BFieldType::CLOVER_FIELD:
|
||||
{ //+2 luck bonus for neutral creatures
|
||||
curB->addNewBonus(std::make_shared<Bonus>(Bonus::ONE_BATTLE, Bonus::LUCK, Bonus::TERRAIN_OVERLAY, +2, battlefieldType, 0)->addLimiter(neutral));
|
||||
std::string desc = VLC->generaltexth->arraytxt[83];
|
||||
desc.erase(desc.size() - 2, 2);
|
||||
curB->addNewBonus(std::make_shared<Bonus>(Bonus::ONE_BATTLE, Bonus::LUCK, Bonus::TERRAIN_OVERLAY, +2, battlefieldType, desc, 0)->addLimiter(neutral));
|
||||
break;
|
||||
}
|
||||
case BFieldType::EVIL_FOG:
|
||||
{
|
||||
curB->addNewBonus(std::make_shared<Bonus>(Bonus::ONE_BATTLE, Bonus::MORALE, Bonus::TERRAIN_OVERLAY, -1, battlefieldType, 0)->addLimiter(good));
|
||||
curB->addNewBonus(std::make_shared<Bonus>(Bonus::ONE_BATTLE, Bonus::MORALE, Bonus::TERRAIN_OVERLAY, +1, battlefieldType, 0)->addLimiter(evil));
|
||||
std::string goodArmyDesc = VLC->generaltexth->arraytxt[126];
|
||||
goodArmyDesc.erase(goodArmyDesc.size() - 2, 2);
|
||||
std::string evilArmyDesc = VLC->generaltexth->arraytxt[125];
|
||||
evilArmyDesc.erase(evilArmyDesc.size() - 2, 2);
|
||||
curB->addNewBonus(std::make_shared<Bonus>(Bonus::ONE_BATTLE, Bonus::MORALE, Bonus::TERRAIN_OVERLAY, -1, battlefieldType, goodArmyDesc, 0)->addLimiter(good));
|
||||
curB->addNewBonus(std::make_shared<Bonus>(Bonus::ONE_BATTLE, Bonus::MORALE, Bonus::TERRAIN_OVERLAY, +1, battlefieldType, evilArmyDesc, 0)->addLimiter(evil));
|
||||
break;
|
||||
}
|
||||
case BFieldType::CURSED_GROUND:
|
||||
{
|
||||
curB->addNewBonus(std::make_shared<Bonus>(Bonus::ONE_BATTLE, Bonus::NO_MORALE, Bonus::TERRAIN_OVERLAY, 0, battlefieldType, 0));
|
||||
curB->addNewBonus(std::make_shared<Bonus>(Bonus::ONE_BATTLE, Bonus::NO_LUCK, Bonus::TERRAIN_OVERLAY, 0, battlefieldType, 0));
|
||||
curB->addNewBonus(std::make_shared<Bonus>(Bonus::ONE_BATTLE, Bonus::NO_MORALE, Bonus::TERRAIN_OVERLAY, 0, battlefieldType, VLC->generaltexth->arraytxt[112], 0));
|
||||
curB->addNewBonus(std::make_shared<Bonus>(Bonus::ONE_BATTLE, Bonus::NO_LUCK, Bonus::TERRAIN_OVERLAY, 0, battlefieldType, VLC->generaltexth->arraytxt[81], 0));
|
||||
curB->addNewBonus(std::make_shared<Bonus>(Bonus::ONE_BATTLE, Bonus::BLOCK_MAGIC_ABOVE, Bonus::TERRAIN_OVERLAY, 1, battlefieldType, 0, Bonus::INDEPENDENT_MIN));
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user