1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00

growth handicap

This commit is contained in:
Laserlicht
2024-07-25 23:04:59 +02:00
parent 6273e678a4
commit ec005593d3
7 changed files with 61 additions and 16 deletions

View File

@@ -786,7 +786,7 @@ void CVCMIServer::setPlayerHandicap(PlayerColor color, PlayerSettings::Handicap
str.appendName(color);
str.appendRawString(":");
if(handicap.startBonus.empty() && handicap.percentIncome == 100)
if(handicap.startBonus.empty() && handicap.percentIncome == 100 && handicap.percentGrowth == 100)
{
str.appendRawString(" ");
str.appendTextID("core.genrltxt.523");
@@ -809,6 +809,13 @@ void CVCMIServer::setPlayerHandicap(PlayerColor color, PlayerSettings::Handicap
str.appendRawString(":");
str.appendRawString(std::to_string(handicap.percentIncome) + "%");
}
if(handicap.percentGrowth != 100)
{
str.appendRawString(" ");
str.appendTextID("core.genrltxt.194");
str.appendRawString(":");
str.appendRawString(std::to_string(handicap.percentGrowth) + "%");
}
announceTxt(str);
}
@@ -1059,7 +1066,7 @@ void CVCMIServer::multiplayerWelcomeMessage()
gh->playerMessages->broadcastSystemMessage("Use '!help' to list available commands");
for (const auto & pi : si->playerInfos)
if(!pi.second.handicap.startBonus.empty() || pi.second.handicap.percentIncome != 100)
if(!pi.second.handicap.startBonus.empty() || pi.second.handicap.percentIncome != 100 || pi.second.handicap.percentGrowth != 100)
{
MetaString str;
str.appendTextID("vcmi.lobby.handicap");
@@ -1081,6 +1088,13 @@ void CVCMIServer::multiplayerWelcomeMessage()
str.appendRawString(":");
str.appendRawString(std::to_string(pi.second.handicap.percentIncome) + "%");
}
if(pi.second.handicap.percentGrowth != 100)
{
str.appendRawString(" ");
str.appendTextID("core.genrltxt.194");
str.appendRawString(":");
str.appendRawString(std::to_string(pi.second.handicap.percentGrowth) + "%");
}
gh->playerMessages->broadcastSystemMessage(str);
}