mirror of
https://github.com/vcmi/vcmi.git
synced 2025-09-16 09:26:28 +02:00
Deprecate artifact-related building types
This commit is contained in:
@@ -1673,7 +1673,7 @@ void CPlayerInterface::showUniversityWindow(const IMarket *market, const CGHeroI
|
|||||||
auto onWindowClosed = [this, queryID](){
|
auto onWindowClosed = [this, queryID](){
|
||||||
cb->selectionMade(0, queryID);
|
cb->selectionMade(0, queryID);
|
||||||
};
|
};
|
||||||
GH.windows().createAndPushWindow<CUniversityWindow>(visitor, market, onWindowClosed);
|
GH.windows().createAndPushWindow<CUniversityWindow>(visitor, BuildingID::NONE, market, onWindowClosed);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPlayerInterface::showHillFortWindow(const CGObjectInstance *object, const CGHeroInstance *visitor)
|
void CPlayerInterface::showHillFortWindow(const CGObjectInstance *object, const CGHeroInstance *visitor)
|
||||||
|
@@ -145,7 +145,7 @@ void CBuildingRect::clickPressed(const Point & cursorPosition)
|
|||||||
if(getBuilding() && area && (parent->selectedBuilding==this))
|
if(getBuilding() && area && (parent->selectedBuilding==this))
|
||||||
{
|
{
|
||||||
auto building = getBuilding();
|
auto building = getBuilding();
|
||||||
parent->buildingClicked(building->bid, building->subId, building->upgrade);
|
parent->buildingClicked(building->bid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -681,24 +681,78 @@ const CGHeroInstance * CCastleBuildings::getHero()
|
|||||||
return town->garrisonHero;
|
return town->garrisonHero;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCastleBuildings::buildingClicked(BuildingID building, BuildingSubID::EBuildingSubID subID, BuildingID upgrades)
|
void CCastleBuildings::buildingClicked(BuildingID building)
|
||||||
{
|
{
|
||||||
logGlobal->trace("You've clicked on %d", (int)building.toEnum());
|
BuildingID buildingToEnter = building;
|
||||||
const CBuilding *b = town->town->buildings.find(building)->second;
|
for(;;)
|
||||||
|
|
||||||
if (town->getWarMachineInBuilding(building).hasValue())
|
|
||||||
{
|
{
|
||||||
enterBlacksmith(building, town->getWarMachineInBuilding(building));
|
const CBuilding *b = town->town->buildings.find(buildingToEnter)->second;
|
||||||
return;
|
|
||||||
|
if (buildingTryActivateCustomUI(buildingToEnter, building))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!b->upgrade.hasValue())
|
||||||
|
{
|
||||||
|
enterBuilding(building);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
buildingToEnter = b->upgrade;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CCastleBuildings::buildingTryActivateCustomUI(BuildingID buildingToTest, BuildingID buildingTarget)
|
||||||
|
{
|
||||||
|
logGlobal->trace("You've clicked on %d", (int)buildingToTest.toEnum());
|
||||||
|
const CBuilding *b = town->town->buildings.at(buildingToTest);
|
||||||
|
|
||||||
|
if (town->getWarMachineInBuilding(buildingToTest).hasValue())
|
||||||
|
{
|
||||||
|
enterBlacksmith(buildingTarget, town->getWarMachineInBuilding(buildingToTest));
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (building >= BuildingID::DWELL_FIRST)
|
// FIXME: implement correct visiting of thieves guild
|
||||||
|
|
||||||
|
if (!b->marketModes.empty())
|
||||||
{
|
{
|
||||||
enterDwelling((BuildingID::getLevelFromDwelling(building)));
|
switch (*b->marketModes.begin())
|
||||||
|
{
|
||||||
|
case EMarketMode::CREATURE_UNDEAD:
|
||||||
|
GH.windows().createAndPushWindow<CTransformerWindow>(town, getHero(), nullptr);
|
||||||
|
return true;
|
||||||
|
|
||||||
|
case EMarketMode::RESOURCE_SKILL:
|
||||||
|
if (getHero())
|
||||||
|
GH.windows().createAndPushWindow<CUniversityWindow>(getHero(), buildingTarget, town, nullptr);
|
||||||
|
return true;
|
||||||
|
|
||||||
|
case EMarketMode::RESOURCE_RESOURCE:
|
||||||
|
// can't use allied marketplace
|
||||||
|
if (town->getOwner() == LOCPLINT->playerID)
|
||||||
|
{
|
||||||
|
GH.windows().createAndPushWindow<CMarketWindow>(town, getHero(), nullptr, *b->marketModes.begin());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
default:
|
||||||
|
if(getHero())
|
||||||
|
GH.windows().createAndPushWindow<CMarketWindow>(town, getHero(), nullptr, *b->marketModes.begin());
|
||||||
|
else
|
||||||
|
LOCPLINT->showInfoDialog(boost::str(boost::format(CGI->generaltexth->allTexts[273]) % b->getNameTranslated())); //Only visiting heroes may use the %s.
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (buildingToTest >= BuildingID::DWELL_FIRST)
|
||||||
|
{
|
||||||
|
enterDwelling((BuildingID::getLevelFromDwelling(buildingToTest)));
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
switch(building)
|
switch(buildingToTest)
|
||||||
{
|
{
|
||||||
case BuildingID::MAGES_GUILD_1:
|
case BuildingID::MAGES_GUILD_1:
|
||||||
case BuildingID::MAGES_GUILD_2:
|
case BuildingID::MAGES_GUILD_2:
|
||||||
@@ -706,117 +760,74 @@ void CCastleBuildings::buildingClicked(BuildingID building, BuildingSubID::EBuil
|
|||||||
case BuildingID::MAGES_GUILD_4:
|
case BuildingID::MAGES_GUILD_4:
|
||||||
case BuildingID::MAGES_GUILD_5:
|
case BuildingID::MAGES_GUILD_5:
|
||||||
enterMagesGuild();
|
enterMagesGuild();
|
||||||
break;
|
return true;
|
||||||
|
|
||||||
case BuildingID::TAVERN:
|
case BuildingID::TAVERN:
|
||||||
LOCPLINT->showTavernWindow(town, nullptr, QueryID::NONE);
|
LOCPLINT->showTavernWindow(town, nullptr, QueryID::NONE);
|
||||||
break;
|
return true;
|
||||||
|
|
||||||
case BuildingID::SHIPYARD:
|
case BuildingID::SHIPYARD:
|
||||||
if(town->shipyardStatus() == IBoatGenerator::GOOD)
|
if(town->shipyardStatus() == IBoatGenerator::GOOD)
|
||||||
|
{
|
||||||
LOCPLINT->showShipyardDialog(town);
|
LOCPLINT->showShipyardDialog(town);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
else if(town->shipyardStatus() == IBoatGenerator::BOAT_ALREADY_BUILT)
|
else if(town->shipyardStatus() == IBoatGenerator::BOAT_ALREADY_BUILT)
|
||||||
|
{
|
||||||
LOCPLINT->showInfoDialog(CGI->generaltexth->allTexts[51]);
|
LOCPLINT->showInfoDialog(CGI->generaltexth->allTexts[51]);
|
||||||
break;
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
|
||||||
case BuildingID::FORT:
|
case BuildingID::FORT:
|
||||||
case BuildingID::CITADEL:
|
case BuildingID::CITADEL:
|
||||||
case BuildingID::CASTLE:
|
case BuildingID::CASTLE:
|
||||||
GH.windows().createAndPushWindow<CFortScreen>(town);
|
GH.windows().createAndPushWindow<CFortScreen>(town);
|
||||||
break;
|
return true;
|
||||||
|
|
||||||
case BuildingID::VILLAGE_HALL:
|
case BuildingID::VILLAGE_HALL:
|
||||||
case BuildingID::CITY_HALL:
|
case BuildingID::CITY_HALL:
|
||||||
case BuildingID::TOWN_HALL:
|
case BuildingID::TOWN_HALL:
|
||||||
case BuildingID::CAPITOL:
|
case BuildingID::CAPITOL:
|
||||||
enterTownHall();
|
enterTownHall();
|
||||||
break;
|
return true;
|
||||||
|
|
||||||
case BuildingID::MARKETPLACE:
|
|
||||||
// can't use allied marketplace
|
|
||||||
if (town->getOwner() == LOCPLINT->playerID)
|
|
||||||
GH.windows().createAndPushWindow<CMarketWindow>(town, town->visitingHero, nullptr, EMarketMode::RESOURCE_RESOURCE);
|
|
||||||
else
|
|
||||||
enterBuilding(building);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case BuildingID::SHIP:
|
case BuildingID::SHIP:
|
||||||
LOCPLINT->showInfoDialog(CGI->generaltexth->allTexts[51]); //Cannot build another boat
|
LOCPLINT->showInfoDialog(CGI->generaltexth->allTexts[51]); //Cannot build another boat
|
||||||
break;
|
return true;
|
||||||
|
|
||||||
case BuildingID::SPECIAL_1:
|
case BuildingID::SPECIAL_1:
|
||||||
case BuildingID::SPECIAL_2:
|
case BuildingID::SPECIAL_2:
|
||||||
case BuildingID::SPECIAL_3:
|
case BuildingID::SPECIAL_3:
|
||||||
case BuildingID::SPECIAL_4:
|
case BuildingID::SPECIAL_4:
|
||||||
switch (subID)
|
switch (b->subId)
|
||||||
{
|
{
|
||||||
case BuildingSubID::NONE:
|
|
||||||
enterBuilding(building);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case BuildingSubID::MYSTIC_POND:
|
case BuildingSubID::MYSTIC_POND:
|
||||||
enterFountain(building, subID, upgrades);
|
enterFountain(buildingToTest, b->subId, buildingTarget);
|
||||||
break;
|
return true;
|
||||||
|
|
||||||
case BuildingSubID::ARTIFACT_MERCHANT:
|
|
||||||
if(town->visitingHero)
|
|
||||||
GH.windows().createAndPushWindow<CMarketWindow>(town, town->visitingHero, nullptr, EMarketMode::RESOURCE_ARTIFACT);
|
|
||||||
else
|
|
||||||
LOCPLINT->showInfoDialog(boost::str(boost::format(CGI->generaltexth->allTexts[273]) % b->getNameTranslated())); //Only visiting heroes may use the %s.
|
|
||||||
break;
|
|
||||||
|
|
||||||
case BuildingSubID::FOUNTAIN_OF_FORTUNE:
|
|
||||||
enterFountain(building, subID, upgrades);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case BuildingSubID::FREELANCERS_GUILD:
|
|
||||||
if(getHero())
|
|
||||||
GH.windows().createAndPushWindow<CMarketWindow>(town, getHero(), nullptr, EMarketMode::CREATURE_RESOURCE);
|
|
||||||
else
|
|
||||||
LOCPLINT->showInfoDialog(boost::str(boost::format(CGI->generaltexth->allTexts[273]) % b->getNameTranslated())); //Only visiting heroes may use the %s.
|
|
||||||
break;
|
|
||||||
|
|
||||||
case BuildingSubID::MAGIC_UNIVERSITY:
|
|
||||||
if (getHero())
|
|
||||||
GH.windows().createAndPushWindow<CUniversityWindow>(getHero(), town, nullptr);
|
|
||||||
else
|
|
||||||
enterBuilding(building);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case BuildingSubID::CASTLE_GATE:
|
case BuildingSubID::CASTLE_GATE:
|
||||||
if (LOCPLINT->makingTurn)
|
if (LOCPLINT->makingTurn)
|
||||||
|
{
|
||||||
enterCastleGate();
|
enterCastleGate();
|
||||||
else
|
return true;
|
||||||
enterBuilding(building);
|
}
|
||||||
break;
|
return false;
|
||||||
|
|
||||||
case BuildingSubID::CREATURE_TRANSFORMER: //Skeleton Transformer
|
|
||||||
GH.windows().createAndPushWindow<CTransformerWindow>(town, getHero(), nullptr);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case BuildingSubID::PORTAL_OF_SUMMONING:
|
case BuildingSubID::PORTAL_OF_SUMMONING:
|
||||||
if (town->creatures[town->town->creatures.size()].second.empty())//No creatures
|
if (town->creatures[town->town->creatures.size()].second.empty())//No creatures
|
||||||
LOCPLINT->showInfoDialog(CGI->generaltexth->tcommands[30]);
|
LOCPLINT->showInfoDialog(CGI->generaltexth->tcommands[30]);
|
||||||
else
|
else
|
||||||
enterDwelling(town->town->creatures.size());
|
enterDwelling(town->town->creatures.size());
|
||||||
break;
|
return true;
|
||||||
|
|
||||||
case BuildingSubID::BANK:
|
case BuildingSubID::BANK:
|
||||||
enterBank();
|
enterBank();
|
||||||
break;
|
return true;
|
||||||
|
|
||||||
default:
|
|
||||||
if(upgrades == BuildingID::TAVERN)
|
|
||||||
LOCPLINT->showTavernWindow(town, nullptr, QueryID::NONE);
|
|
||||||
else
|
|
||||||
enterBuilding(building);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
break;
|
return false;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
enterBuilding(building);
|
return false;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -173,7 +173,8 @@ public:
|
|||||||
void enterBank();
|
void enterBank();
|
||||||
void enterToTheQuickRecruitmentWindow();
|
void enterToTheQuickRecruitmentWindow();
|
||||||
|
|
||||||
void buildingClicked(BuildingID building, BuildingSubID::EBuildingSubID subID = BuildingSubID::NONE, BuildingID upgrades = BuildingID::NONE);
|
bool buildingTryActivateCustomUI(BuildingID buildingToTest, BuildingID buildingTarget);
|
||||||
|
void buildingClicked(BuildingID building);
|
||||||
void addBuilding(BuildingID building);
|
void addBuilding(BuildingID building);
|
||||||
void removeBuilding(BuildingID building);//FIXME: not tested!!!
|
void removeBuilding(BuildingID building);//FIXME: not tested!!!
|
||||||
};
|
};
|
||||||
|
@@ -946,7 +946,7 @@ void CUniversityWindow::CItem::hover(bool on)
|
|||||||
GH.statusbar()->clear();
|
GH.statusbar()->clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
CUniversityWindow::CUniversityWindow(const CGHeroInstance * _hero, const IMarket * _market, const std::function<void()> & onWindowClosed)
|
CUniversityWindow::CUniversityWindow(const CGHeroInstance * _hero, BuildingID building, const IMarket * _market, const std::function<void()> & onWindowClosed)
|
||||||
: CWindowObject(PLAYER_COLORED, ImagePath::builtin("UNIVERS1")),
|
: CWindowObject(PLAYER_COLORED, ImagePath::builtin("UNIVERS1")),
|
||||||
hero(_hero),
|
hero(_hero),
|
||||||
onWindowClosed(onWindowClosed),
|
onWindowClosed(onWindowClosed),
|
||||||
@@ -961,8 +961,7 @@ CUniversityWindow::CUniversityWindow(const CGHeroInstance * _hero, const IMarket
|
|||||||
if(auto town = dynamic_cast<const CGTownInstance *>(_market))
|
if(auto town = dynamic_cast<const CGTownInstance *>(_market))
|
||||||
{
|
{
|
||||||
auto faction = town->town->faction->getId();
|
auto faction = town->town->faction->getId();
|
||||||
auto bid = town->town->getSpecialBuilding(BuildingSubID::MAGIC_UNIVERSITY)->bid;
|
titlePic = std::make_shared<CAnimImage>((*CGI->townh)[faction]->town->clientInfo.buildingsIcons, building);
|
||||||
titlePic = std::make_shared<CAnimImage>((*CGI->townh)[faction]->town->clientInfo.buildingsIcons, bid);
|
|
||||||
}
|
}
|
||||||
else if(auto uni = dynamic_cast<const CGUniversity *>(_market); uni->appearance)
|
else if(auto uni = dynamic_cast<const CGUniversity *>(_market); uni->appearance)
|
||||||
{
|
{
|
||||||
|
@@ -391,7 +391,7 @@ class CUniversityWindow final : public CStatusbarWindow, public IMarketHolder
|
|||||||
std::function<void()> onWindowClosed;
|
std::function<void()> onWindowClosed;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CUniversityWindow(const CGHeroInstance * _hero, const IMarket * _market, const std::function<void()> & onWindowClosed);
|
CUniversityWindow(const CGHeroInstance * _hero, BuildingID building, const IMarket * _market, const std::function<void()> & onWindowClosed);
|
||||||
|
|
||||||
void makeDeal(SecondarySkill skill);
|
void makeDeal(SecondarySkill skill);
|
||||||
void close() override;
|
void close() override;
|
||||||
|
@@ -48,7 +48,10 @@
|
|||||||
"produce": { "gold": 4000 }
|
"produce": { "gold": 4000 }
|
||||||
},
|
},
|
||||||
|
|
||||||
"marketplace": { "id" : 14 },
|
"marketplace": {
|
||||||
|
"id" : 14,
|
||||||
|
"marketModes" : ["resource-resource", "resource-player"]
|
||||||
|
},
|
||||||
"resourceSilo": { "id" : 15, "requires" : [ "marketplace" ] },
|
"resourceSilo": { "id" : 15, "requires" : [ "marketplace" ] },
|
||||||
"blacksmith": { "id" : 16 },
|
"blacksmith": { "id" : 16 },
|
||||||
|
|
||||||
@@ -205,7 +208,26 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// Section 3 - buildings that now have dedicated mechanics
|
// Section 3 - markets
|
||||||
|
"artifactMerchant" : {
|
||||||
|
"requires" : [ "marketplace" ],
|
||||||
|
"marketModes" : ["resource-artifact", "artifact-resource"]
|
||||||
|
},
|
||||||
|
|
||||||
|
"freelancersGuild" : {
|
||||||
|
"requires" : [ "marketplace" ],
|
||||||
|
"marketModes" : ["creature-resource"]
|
||||||
|
},
|
||||||
|
|
||||||
|
"magicUniversity" : {
|
||||||
|
"marketModes" : ["resource-skill"]
|
||||||
|
},
|
||||||
|
|
||||||
|
"creatureTransformer" : {
|
||||||
|
"marketModes" : ["creature-undead"]
|
||||||
|
},
|
||||||
|
|
||||||
|
// Section 4 - buildings that now have dedicated mechanics
|
||||||
"ballistaYard": {
|
"ballistaYard": {
|
||||||
"blacksmith" : "ballista"
|
"blacksmith" : "ballista"
|
||||||
},
|
},
|
||||||
|
@@ -165,7 +165,7 @@
|
|||||||
"townHall": { },
|
"townHall": { },
|
||||||
"cityHall": { },
|
"cityHall": { },
|
||||||
"capitol": { },
|
"capitol": { },
|
||||||
"marketplace": { "marketModes" : ["resource-resource", "resource-player"] },
|
"marketplace": { },
|
||||||
"resourceSilo": { "produce": { "ore": 1, "wood": 1 } },
|
"resourceSilo": { "produce": { "ore": 1, "wood": 1 } },
|
||||||
"blacksmith": { "warMachine" : "ballista" },
|
"blacksmith": { "warMachine" : "ballista" },
|
||||||
|
|
||||||
|
@@ -170,15 +170,15 @@
|
|||||||
"townHall": { },
|
"townHall": { },
|
||||||
"cityHall": { },
|
"cityHall": { },
|
||||||
"capitol": { },
|
"capitol": { },
|
||||||
"marketplace": { "marketModes" : ["resource-resource", "resource-player"] },
|
"marketplace": { },
|
||||||
"resourceSilo": { "produce": { "mercury": 1 } },
|
"resourceSilo": { "produce": { "mercury": 1 } },
|
||||||
"blacksmith": { "warMachine" : "ballista" },
|
"blacksmith": { "warMachine" : "ballista" },
|
||||||
|
|
||||||
"special1": { "type" : "artifactMerchant", "requires" : [ "marketplace" ], "marketModes" : ["resource-artifact", "artifact-resource"] },
|
"special1": { "requires" : [ "marketplace" ], "marketModes" : ["resource-artifact", "artifact-resource"] },
|
||||||
"horde1": { "id" : 18, "upgrades" : "dwellingLvl1" },
|
"horde1": { "id" : 18, "upgrades" : "dwellingLvl1" },
|
||||||
"horde1Upgr": { "id" : 19, "upgrades" : "dwellingUpLvl1", "requires" : [ "horde1" ], "mode" : "auto" },
|
"horde1Upgr": { "id" : 19, "upgrades" : "dwellingUpLvl1", "requires" : [ "horde1" ], "mode" : "auto" },
|
||||||
"ship": { "id" : 20, "upgrades" : "shipyard" },
|
"ship": { "id" : 20, "upgrades" : "shipyard" },
|
||||||
"special2": { "type" : "magicUniversity", "requires" : [ "mageGuild1" ] },
|
"special2": { "requires" : [ "mageGuild1" ], "marketModes" : ["resource-skill"] },
|
||||||
"grail": { "id" : 26, "mode" : "grail", "produce": { "gold": 5000 }},
|
"grail": { "id" : 26, "mode" : "grail", "produce": { "gold": 5000 }},
|
||||||
"extraTownHall": { "id" : 27, "requires" : [ "townHall" ], "mode" : "auto" },
|
"extraTownHall": { "id" : 27, "requires" : [ "townHall" ], "mode" : "auto" },
|
||||||
"extraCityHall": { "id" : 28, "requires" : [ "cityHall" ], "mode" : "auto" },
|
"extraCityHall": { "id" : 28, "requires" : [ "cityHall" ], "mode" : "auto" },
|
||||||
|
@@ -165,11 +165,11 @@
|
|||||||
"townHall": { },
|
"townHall": { },
|
||||||
"cityHall": { },
|
"cityHall": { },
|
||||||
"capitol": { },
|
"capitol": { },
|
||||||
"marketplace": { "marketModes" : ["resource-resource", "resource-player"] },
|
"marketplace": { },
|
||||||
"resourceSilo": { "produce": { "sulfur": 1 } },
|
"resourceSilo": { "produce": { "sulfur": 1 } },
|
||||||
"blacksmith": { "warMachine" : "ballista" },
|
"blacksmith": { "warMachine" : "ballista" },
|
||||||
|
|
||||||
"special1": { "type" : "artifactMerchant", "requires" : [ "marketplace" ], "marketModes" : ["resource-artifact", "artifact-resource"] },
|
"special1": { "requires" : [ "marketplace" ], "marketModes" : ["resource-artifact", "artifact-resource"] },
|
||||||
"horde1": { "id" : 18, "upgrades" : "dwellingLvl1" },
|
"horde1": { "id" : 18, "upgrades" : "dwellingLvl1" },
|
||||||
"horde1Upgr": { "id" : 19, "upgrades" : "dwellingUpLvl1", "requires" : [ "horde1" ], "mode" : "auto" },
|
"horde1Upgr": { "id" : 19, "upgrades" : "dwellingUpLvl1", "requires" : [ "horde1" ], "mode" : "auto" },
|
||||||
"special2": {
|
"special2": {
|
||||||
|
@@ -164,7 +164,7 @@
|
|||||||
"townHall": { },
|
"townHall": { },
|
||||||
"cityHall": { },
|
"cityHall": { },
|
||||||
"capitol": { },
|
"capitol": { },
|
||||||
"marketplace": { "marketModes" : ["resource-resource", "resource-player"] },
|
"marketplace": { },
|
||||||
"resourceSilo": { "produce": { "wood": 1, "ore": 1 } },
|
"resourceSilo": { "produce": { "wood": 1, "ore": 1 } },
|
||||||
"blacksmith": { "warMachine" : "firstAidTent" },
|
"blacksmith": { "warMachine" : "firstAidTent" },
|
||||||
|
|
||||||
|
@@ -166,7 +166,7 @@
|
|||||||
"townHall": { },
|
"townHall": { },
|
||||||
"cityHall": { },
|
"cityHall": { },
|
||||||
"capitol": { },
|
"capitol": { },
|
||||||
"marketplace": { "marketModes" : ["resource-resource", "resource-player"] },
|
"marketplace": { },
|
||||||
"resourceSilo": { "produce": { "mercury": 1 } },
|
"resourceSilo": { "produce": { "mercury": 1 } },
|
||||||
"blacksmith": { "warMachine" : "ammoCart" },
|
"blacksmith": { "warMachine" : "ammoCart" },
|
||||||
|
|
||||||
|
@@ -171,7 +171,7 @@
|
|||||||
"townHall": { },
|
"townHall": { },
|
||||||
"cityHall": { },
|
"cityHall": { },
|
||||||
"capitol": { },
|
"capitol": { },
|
||||||
"marketplace": { "marketModes" : ["resource-resource", "resource-player"] },
|
"marketplace": { },
|
||||||
"resourceSilo": { "produce": { "ore": 1, "wood": 1 } },
|
"resourceSilo": { "produce": { "ore": 1, "wood": 1 } },
|
||||||
"blacksmith": { "warMachine" : "firstAidTent" },
|
"blacksmith": { "warMachine" : "firstAidTent" },
|
||||||
|
|
||||||
@@ -181,7 +181,7 @@
|
|||||||
"ship": { "id" : 20, "upgrades" : "shipyard" },
|
"ship": { "id" : 20, "upgrades" : "shipyard" },
|
||||||
"special2": { "requires" : [ "mageGuild1" ],
|
"special2": { "requires" : [ "mageGuild1" ],
|
||||||
"bonuses": [ { "type": "UNDEAD_RAISE_PERCENTAGE", "val": 10, "propagator": "PLAYER_PROPAGATOR" } ] },
|
"bonuses": [ { "type": "UNDEAD_RAISE_PERCENTAGE", "val": 10, "propagator": "PLAYER_PROPAGATOR" } ] },
|
||||||
"special3": { "type" : "creatureTransformer", "requires" : [ "dwellingLvl1" ], "marketModes" : ["creature-undead"] },
|
"special3": { "requires" : [ "dwellingLvl1" ], "marketModes" : ["creature-undead"] },
|
||||||
"grail": { "id" : 26, "mode" : "grail", "produce": { "gold": 5000 },
|
"grail": { "id" : 26, "mode" : "grail", "produce": { "gold": 5000 },
|
||||||
"bonuses": [ { "type": "UNDEAD_RAISE_PERCENTAGE", "val": 20, "propagator": "PLAYER_PROPAGATOR" } ] },
|
"bonuses": [ { "type": "UNDEAD_RAISE_PERCENTAGE", "val": 20, "propagator": "PLAYER_PROPAGATOR" } ] },
|
||||||
|
|
||||||
|
@@ -169,7 +169,7 @@
|
|||||||
"townHall": { },
|
"townHall": { },
|
||||||
"cityHall": { },
|
"cityHall": { },
|
||||||
"capitol": { },
|
"capitol": { },
|
||||||
"marketplace": { "marketModes" : ["resource-resource", "resource-player"] },
|
"marketplace": { },
|
||||||
"resourceSilo": { "produce": { "crystal": 1 } },
|
"resourceSilo": { "produce": { "crystal": 1 } },
|
||||||
"blacksmith": { "warMachine" : "firstAidTent" },
|
"blacksmith": { "warMachine" : "firstAidTent" },
|
||||||
|
|
||||||
|
@@ -161,14 +161,14 @@
|
|||||||
"townHall": { },
|
"townHall": { },
|
||||||
"cityHall": { },
|
"cityHall": { },
|
||||||
"capitol": { },
|
"capitol": { },
|
||||||
"marketplace": { "marketModes" : ["resource-resource", "resource-player"] },
|
"marketplace": { },
|
||||||
"resourceSilo": { "produce": { "ore": 1, "wood": 1 } },
|
"resourceSilo": { "produce": { "ore": 1, "wood": 1 } },
|
||||||
"blacksmith": { "warMachine" : "ammoCart" },
|
"blacksmith": { "warMachine" : "ammoCart" },
|
||||||
|
|
||||||
"special1": { "type" : "escapeTunnel", "requires" : [ "fort" ] },
|
"special1": { "type" : "escapeTunnel", "requires" : [ "fort" ] },
|
||||||
"horde1": { "id" : 18, "upgrades" : "dwellingLvl1" },
|
"horde1": { "id" : 18, "upgrades" : "dwellingLvl1" },
|
||||||
"horde1Upgr": { "id" : 19, "upgrades" : "dwellingUpLvl1", "requires" : [ "horde1" ], "mode" : "auto" },
|
"horde1Upgr": { "id" : 19, "upgrades" : "dwellingUpLvl1", "requires" : [ "horde1" ], "mode" : "auto" },
|
||||||
"special2": { "type" : "freelancersGuild", "requires" : [ "marketplace" ], "marketModes" : ["creature-resource"] },
|
"special2": { "requires" : [ "marketplace" ], "marketModes" : ["creature-resource"] },
|
||||||
"special3": { "warMachine" : "ballista", "requires" : [ "blacksmith" ] },
|
"special3": { "warMachine" : "ballista", "requires" : [ "blacksmith" ] },
|
||||||
"special4": {
|
"special4": {
|
||||||
"requires" : [ "fort" ],
|
"requires" : [ "fort" ],
|
||||||
|
@@ -164,11 +164,11 @@
|
|||||||
"townHall": { },
|
"townHall": { },
|
||||||
"cityHall": { },
|
"cityHall": { },
|
||||||
"capitol": { },
|
"capitol": { },
|
||||||
"marketplace": { "marketModes" : ["resource-resource", "resource-player"] },
|
"marketplace": { },
|
||||||
"resourceSilo": { "produce" : { "gems": 1 } },
|
"resourceSilo": { "produce" : { "gems": 1 } },
|
||||||
"blacksmith": { "warMachine" : "ammoCart" },
|
"blacksmith": { "warMachine" : "ammoCart" },
|
||||||
|
|
||||||
"special1": { "type" : "artifactMerchant", "requires" : [ "marketplace" ], "marketModes" : ["resource-artifact", "artifact-resource"] },
|
"special1": { "requires" : [ "marketplace" ], "marketModes" : ["resource-artifact", "artifact-resource"] },
|
||||||
"horde1": { "id" : 18, "upgrades" : "dwellingLvl2" },
|
"horde1": { "id" : 18, "upgrades" : "dwellingLvl2" },
|
||||||
"horde1Upgr": { "id" : 19, "upgrades" : "dwellingUpLvl2", "requires" : [ "horde1" ], "mode" : "auto" },
|
"horde1Upgr": { "id" : 19, "upgrades" : "dwellingUpLvl2", "requires" : [ "horde1" ], "mode" : "auto" },
|
||||||
"special2": { "height" : "high", "requires" : [ "fort" ] },
|
"special2": { "height" : "high", "requires" : [ "fort" ] },
|
||||||
|
@@ -36,7 +36,7 @@
|
|||||||
},
|
},
|
||||||
"type" : {
|
"type" : {
|
||||||
"type" : "string",
|
"type" : "string",
|
||||||
"enum" : [ "mysticPond", "artifactMerchant", "freelancersGuild", "magicUniversity", "castleGate", "creatureTransformer", "portalOfSummoning", "library", "escapeTunnel", "treasury", "bank" ],
|
"enum" : [ "mysticPond", "castleGate", "portalOfSummoning", "library", "escapeTunnel", "treasury", "bank" ],
|
||||||
"description" : "Subtype for some special buildings"
|
"description" : "Subtype for some special buildings"
|
||||||
},
|
},
|
||||||
"mode" : {
|
"mode" : {
|
||||||
@@ -104,7 +104,10 @@
|
|||||||
},
|
},
|
||||||
"marketModes" : {
|
"marketModes" : {
|
||||||
"type" : "array",
|
"type" : "array",
|
||||||
"enum" : [ "resource-resource", "resource-player", "creature-resource", "resource-artifact", "artifact-resource", "artifact-experience", "creature-experience", "creature-undead", "resource-skill"],
|
"items" : {
|
||||||
|
"type" : "string",
|
||||||
|
"enum" : [ "resource-resource", "resource-player", "creature-resource", "resource-artifact", "artifact-resource", "artifact-experience", "creature-experience", "creature-undead", "resource-skill"],
|
||||||
|
},
|
||||||
"description" : "List of modes available in this market"
|
"description" : "List of modes available in this market"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -26,15 +26,10 @@ namespace BuildingSubID
|
|||||||
DEFAULT = -50,
|
DEFAULT = -50,
|
||||||
NONE = -1,
|
NONE = -1,
|
||||||
CASTLE_GATE,
|
CASTLE_GATE,
|
||||||
CREATURE_TRANSFORMER,
|
|
||||||
MYSTIC_POND,
|
MYSTIC_POND,
|
||||||
FOUNTAIN_OF_FORTUNE,
|
|
||||||
ARTIFACT_MERCHANT,
|
|
||||||
LIBRARY,
|
LIBRARY,
|
||||||
PORTAL_OF_SUMMONING,
|
PORTAL_OF_SUMMONING,
|
||||||
ESCAPE_TUNNEL,
|
ESCAPE_TUNNEL,
|
||||||
FREELANCERS_GUILD,
|
|
||||||
MAGIC_UNIVERSITY,
|
|
||||||
TREASURY,
|
TREASURY,
|
||||||
BANK
|
BANK
|
||||||
};
|
};
|
||||||
|
@@ -178,14 +178,9 @@ namespace MappedKeys
|
|||||||
static const std::map<std::string, BuildingSubID::EBuildingSubID> SPECIAL_BUILDINGS =
|
static const std::map<std::string, BuildingSubID::EBuildingSubID> SPECIAL_BUILDINGS =
|
||||||
{
|
{
|
||||||
{ "mysticPond", BuildingSubID::MYSTIC_POND },
|
{ "mysticPond", BuildingSubID::MYSTIC_POND },
|
||||||
{ "artifactMerchant", BuildingSubID::ARTIFACT_MERCHANT },
|
|
||||||
{ "freelancersGuild", BuildingSubID::FREELANCERS_GUILD },
|
|
||||||
{ "magicUniversity", BuildingSubID::MAGIC_UNIVERSITY },
|
|
||||||
{ "castleGate", BuildingSubID::CASTLE_GATE },
|
{ "castleGate", BuildingSubID::CASTLE_GATE },
|
||||||
{ "creatureTransformer", BuildingSubID::CREATURE_TRANSFORMER },//only skeleton transformer yet
|
|
||||||
{ "portalOfSummoning", BuildingSubID::PORTAL_OF_SUMMONING },
|
{ "portalOfSummoning", BuildingSubID::PORTAL_OF_SUMMONING },
|
||||||
{ "library", BuildingSubID::LIBRARY },
|
{ "library", BuildingSubID::LIBRARY },
|
||||||
{ "fountainOfFortune", BuildingSubID::FOUNTAIN_OF_FORTUNE },//luck garrison bonus
|
|
||||||
{ "escapeTunnel", BuildingSubID::ESCAPE_TUNNEL },
|
{ "escapeTunnel", BuildingSubID::ESCAPE_TUNNEL },
|
||||||
{ "treasury", BuildingSubID::TREASURY },
|
{ "treasury", BuildingSubID::TREASURY },
|
||||||
{ "bank", BuildingSubID::BANK }
|
{ "bank", BuildingSubID::BANK }
|
||||||
|
@@ -44,13 +44,10 @@ int CGTownInstance::getSightRadius() const //returns sight distance
|
|||||||
|
|
||||||
for(const auto & bid : builtBuildings)
|
for(const auto & bid : builtBuildings)
|
||||||
{
|
{
|
||||||
if(bid.IsSpecialOrGrail())
|
auto height = town->buildings.at(bid)->height;
|
||||||
{
|
if(ret < height)
|
||||||
auto height = town->buildings.at(bid)->height;
|
ret = height;
|
||||||
if(ret < height)
|
|
||||||
ret = height;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user