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:
commit
a8dcbd8ff9
@ -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;
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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 =
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user