1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00

Merge pull request #4061 from Laserlicht/hota_buildings

Support HotA thives guild
This commit is contained in:
Ivan Savenko 2024-06-05 12:41:35 +03:00 committed by GitHub
commit a8dcbd8ff9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 14 additions and 5 deletions

View File

@ -744,6 +744,7 @@ void CCastleBuildings::buildingClicked(BuildingID building, BuildingSubID::EBuil
case BuildingID::SPECIAL_1:
case BuildingID::SPECIAL_2:
case BuildingID::SPECIAL_3:
case BuildingID::SPECIAL_4:
switch (subID)
{
case BuildingSubID::NONE:
@ -808,6 +809,10 @@ void CCastleBuildings::buildingClicked(BuildingID building, BuildingSubID::EBuil
enterBlacksmith(ArtifactID::BALLISTA);
break;
case BuildingSubID::THIEVES_GUILD:
enterAnyThievesGuild();
break;
default:
enterBuilding(building);
break;

View File

@ -224,15 +224,17 @@ void CGameInfoCallback::getThievesGuildInfo(SThievesGuildInfo & thi, const CGObj
ERROR_RET_IF(obj->ID == Obj::TOWN && !canGetFullInfo(obj), "Cannot get info about town guild object!");
//TODO: advmap object -> check if they're visited by our hero
if(obj->ID == Obj::TOWN || obj->ID == Obj::TAVERN)
if(obj->ID == Obj::TOWN || obj->ID == Obj::TAVERN)
{
int taverns = 0;
for(auto town : gs->players[*getPlayerID()].towns)
{
if(town->hasBuilt(BuildingID::TAVERN))
taverns++;
if(town->hasBuilt(BuildingSubID::THIEVES_GUILD))
taverns += 2;
}
gs->obtainPlayersStats(thi, taverns);
}
else if(obj->ID == Obj::DEN_OF_THIEVES)

View File

@ -50,6 +50,7 @@ namespace BuildingSubID
EXPERIENCE_VISITING_BONUS,
LIGHTHOUSE,
TREASURY,
THIEVES_GUILD,
CUSTOM_VISITING_BONUS,
CUSTOM_VISITING_REWARD
};
@ -59,7 +60,7 @@ enum class EMarketMode : int8_t
{
RESOURCE_RESOURCE, RESOURCE_PLAYER, CREATURE_RESOURCE, RESOURCE_ARTIFACT,
ARTIFACT_RESOURCE, ARTIFACT_EXP, CREATURE_EXP, CREATURE_UNDEAD, RESOURCE_SKILL,
MARTKET_AFTER_LAST_PLACEHOLDER
MARKET_AFTER_LAST_PLACEHOLDER
};
enum class EAiTactic : int8_t

View File

@ -198,7 +198,8 @@ namespace MappedKeys
{ "knowledgeVisitingBonus", BuildingSubID::KNOWLEDGE_VISITING_BONUS },
{ "experienceVisitingBonus", BuildingSubID::EXPERIENCE_VISITING_BONUS },
{ "lighthouse", BuildingSubID::LIGHTHOUSE },
{ "treasury", BuildingSubID::TREASURY }
{ "treasury", BuildingSubID::TREASURY },
{ "thievesGuild", BuildingSubID::THIEVES_GUILD }
};
static const std::map<std::string, EMarketMode> MARKET_NAMES_TO_TYPES =

View File

@ -161,7 +161,7 @@ IMarket::IMarket()
std::vector<EMarketMode> IMarket::availableModes() const
{
std::vector<EMarketMode> ret;
for (EMarketMode i = static_cast<EMarketMode>(0); i < EMarketMode::MARTKET_AFTER_LAST_PLACEHOLDER; i = vstd::next(i, 1))
for (EMarketMode i = static_cast<EMarketMode>(0); i < EMarketMode::MARKET_AFTER_LAST_PLACEHOLDER; i = vstd::next(i, 1))
if(allowsTrade(i))
ret.push_back(i);