diff --git a/AI/VCAI/VCAI.cpp b/AI/VCAI/VCAI.cpp index c18507881..83b4e2f06 100644 --- a/AI/VCAI/VCAI.cpp +++ b/AI/VCAI/VCAI.cpp @@ -1241,7 +1241,7 @@ bool VCAI::tryBuildStructure(const CGTownInstance * t, int building, unsigned in //erase all already built buildings for (auto buildIter = toBuild.begin(); buildIter != toBuild.end();) { - if (vstd::contains(t->builtBuildings, *buildIter)) + if (t->hasBuilt(*buildIter)) toBuild.erase(buildIter++); else buildIter++; @@ -1991,7 +1991,7 @@ void VCAI::tryRealize(CGoal g) const CGTownInstance * VCAI::findTownWithTavern() const { BOOST_FOREACH(const CGTownInstance *t, cb->getTownsInfo()) - if(vstd::contains(t->builtBuildings, EBuilding::TAVERN) && !t->visitingHero) + if(t->hasBuilt(EBuilding::TAVERN) && !t->visitingHero) return t; return NULL; diff --git a/CCallback.cpp b/CCallback.cpp index 3a4a6e964..4c75abd04 100644 --- a/CCallback.cpp +++ b/CCallback.cpp @@ -165,17 +165,11 @@ bool CCallback::assembleArtifacts (const CGHeroInstance * hero, ui16 artifactSlo bool CCallback::buildBuilding(const CGTownInstance *town, si32 buildingID) { - //CGTownInstance * t = const_cast(town); - if(town->tempOwner!=player) return false; if(!canBuildStructure(town, buildingID)) return false; -// const CBuilding *b = CGI->buildh->buildings[t->subID][buildingID]; -// for(int i=0;iresources.size();i++) -// if(b->resources[i] > gs->players[player].resources[i]) -// return false; //lack of resources BuildStructure pack(town->id,buildingID); sendRequest(&pack); diff --git a/client/AdventureMapClasses.cpp b/client/AdventureMapClasses.cpp index e789fb173..eeeee0262 100644 --- a/client/AdventureMapClasses.cpp +++ b/client/AdventureMapClasses.cpp @@ -5,6 +5,7 @@ #include "../lib/JsonNode.h" #include "../lib/Filesystem/CResourceLoader.h" #include "../lib/map.h" +#include "../lib/CModHandler.h" #include "../lib/CObjectHandler.h" #include "../lib/CGameState.h" #include "../lib/CGeneralTextHandler.h" @@ -294,7 +295,7 @@ void CTownList::CTownItem::update() if (!town->hasFort()) iconIndex += GameConstants::F_NUMBER*2; - if(town->builded >= GameConstants::MAX_BUILDING_PER_TURN) + if(town->builded >= CGI->modh->settings.MAX_BUILDING_PER_TURN) iconIndex++; picture->setFrame(iconIndex + 2); diff --git a/client/CAdvmapInterface.cpp b/client/CAdvmapInterface.cpp index 3eb70c9ec..65117a850 100644 --- a/client/CAdvmapInterface.cpp +++ b/client/CAdvmapInterface.cpp @@ -760,7 +760,8 @@ void CAdvMapInt::show(SDL_Surface * to) void CAdvMapInt::selectionChanged() { const CGTownInstance *to = LOCPLINT->towns[townList.getSelectedIndex()]; - select(to); + if (selection != to) + select(to); } void CAdvMapInt::centerOn(int3 on) { @@ -877,7 +878,7 @@ void CAdvMapInt::keyPressed(const SDL_KeyboardEvent & key) const CGTownInstance *townWithMarket = NULL; BOOST_FOREACH(const CGTownInstance *t, LOCPLINT->cb->getTownsInfo()) { - if(vstd::contains(t->builtBuildings, 14)) + if(t->hasBuilt(EBuilding::MARKETPLACE)) { townWithMarket = t; break; diff --git a/client/CCastleInterface.cpp b/client/CCastleInterface.cpp index 3193b4495..e74e01db8 100644 --- a/client/CCastleInterface.cpp +++ b/client/CCastleInterface.cpp @@ -6,6 +6,7 @@ #include "../lib/CBuildingHandler.h" #include "../lib/CCreatureHandler.h" #include "../lib/CGeneralTextHandler.h" +#include "../lib/CModHandler.h" #include "../lib/CObjectHandler.h" #include "../lib/CSpellHandler.h" #include "../lib/CTownHandler.h" @@ -36,19 +37,6 @@ using namespace boost::assign; * */ -int hordeToDwellingID(int bid)//helper, converts horde buiding ID into corresponding dwelling ID -{ - const CGTownInstance * t = LOCPLINT->castleInt->town; - switch (bid) - { - case 18: return t->town->hordeLvl[0] + 30; - case 19: return t->town->hordeLvl[0] + 37; - case 24: return t->town->hordeLvl[1] + 30; - case 25: return t->town->hordeLvl[1] + 37; - default: return bid; - } -} - CBuildingRect::CBuildingRect(CCastleBuildings * Par, const CGTownInstance *Town, const CStructure *Str) :CShowableAnim(0, 0, Str->defName, CShowableAnim::BASE | CShowableAnim::USE_RLE), parent(Par), @@ -80,10 +68,8 @@ CBuildingRect::~CBuildingRect() bool CBuildingRect::operator<(const CBuildingRect & p2) const { - if(str->pos.z != p2.str->pos.z) - return (str->pos.z) < (p2.str->pos.z); - else - return (str->ID) < (p2.str->ID); + return (str->pos.z) < (p2.str->pos.z); + } void CBuildingRect::hover(bool on) @@ -108,18 +94,18 @@ void CBuildingRect::hover(bool on) void CBuildingRect::clickLeft(tribool down, bool previousState) { - if( previousState && !down && area && (parent->selectedBuilding==this) ) + if( previousState && !down && area && (parent->selectedBuilding==this) && str->building ) if (!CSDL_Ext::isTransparent(area, GH.current->motion.x-pos.x, GH.current->motion.y-pos.y) ) //inside building image - parent->buildingClicked(str->ID); + parent->buildingClicked(str->building->bid); } void CBuildingRect::clickRight(tribool down, bool previousState) { - if((!area) || (!((bool)down)) || (this!=parent->selectedBuilding)) + if((!area) || (!((bool)down)) || (this!=parent->selectedBuilding) || str->building == nullptr) return; if( !CSDL_Ext::isTransparent(area, GH.current->motion.x-pos.x, GH.current->motion.y-pos.y) ) //inside building image { - int bid = hordeToDwellingID(str->ID); + int bid = str->building->bid; const CBuilding *bld = town->town->buildings[bid]; if (bid < EBuilding::DWELL_FIRST) { @@ -208,13 +194,16 @@ void CBuildingRect::showAll(SDL_Surface * to) blitAtLoc(border,0,0,to); } -std::string getBuildingSubtitle(int tid, int bid)//hover text for building +std::string getBuildingSubtitle(const CStructure * structure)//hover text for building { const CGTownInstance * t = LOCPLINT->castleInt->town; - bid = hordeToDwellingID(bid); + if (!structure->building) + return ""; + + int bid = structure->building->bid; if (bid<30)//non-dwellings - only buiding name - return CGI->townh->towns[tid].buildings[bid]->Name(); + return t->town->buildings[structure->building->bid]->Name(); else//dwellings - recruit %creature% { int creaID = t->creatures[(bid-30)%GameConstants::CREATURES_PER_TOWN].second.back();//taking last of available creatures @@ -240,7 +229,7 @@ void CBuildingRect::mouseMoved (const SDL_MouseMotionEvent & sEvent) || (*parent->selectedBuilding)<(*this)) //or we are on top { parent->selectedBuilding = this; - GH.statusbar->print(getBuildingSubtitle(str->townID, str->ID)); + GH.statusbar->print(getBuildingSubtitle(str)); } } } @@ -453,177 +442,113 @@ CCastleBuildings::CCastleBuildings(const CGTownInstance* Town): { OBJ_CONSTRUCTION_CAPTURING_ALL; - background = new CPicture(graphics->townBgs[town->subID]); + background = new CPicture(town->town->clientInfo.townBackground); pos.w = background->pos.w; pos.h = background->pos.h; + + recreate(); +} + +void CCastleBuildings::recreate() +{ + selectedBuilding = nullptr; + OBJ_CONSTRUCTION_CAPTURING_ALL; + //clear existing buildings + BOOST_FOREACH(auto build, buildings) + delete build; + buildings.clear(); + groups.clear(); + //Generate buildings list - for (std::set::const_iterator building=town->builtBuildings.begin(); building!=town->builtBuildings.end(); building++) - { - auto structure = town->town->clientInfo.structures.find(*building); - if(structure != town->town->clientInfo.structures.end() && structure->second) - { - if(structure->second->group<0) // no group - just add it - buildings.push_back(new CBuildingRect(this, town, structure->second)); - else // generate list for each group - groups[structure->second->group].push_back(structure->second); - } - } + auto buildingsCopy = town->builtBuildings;// a bit modified copy of built buildings - CStructure * shipyard = town->town->clientInfo.structures[6]; - //ship in shipyard - if(shipyard && vstd::contains(groups, shipyard->group)) + if(vstd::contains(town->builtBuildings, EBuilding::SHIPYARD)) { std::vector vobjs = LOCPLINT->cb->getVisitableObjs(town->bestLocation()); - if(!vobjs.empty() && (vobjs.front()->ID == 8 || vobjs.front()->ID == GameConstants::HEROI_TYPE)) //there is visitable obj at shipyard output tile and it's a boat or hero (on boat) + //there is visitable obj at shipyard output tile and it's a boat or hero (on boat) + if(!vobjs.empty() && (vobjs.front()->ID == 8 || vobjs.front()->ID == GameConstants::HEROI_TYPE)) { - groups[shipyard->group].push_back(town->town->clientInfo.structures[20]); + buildingsCopy.insert(EBuilding::SHIP); } } - //Create building for each group - for (std::map< int, std::vector >::iterator group = groups.begin(); group != groups.end(); group++) + + BOOST_FOREACH(const CStructure * structure, town->town->clientInfo.structures) { - std::sort(group->second.begin(), group->second.end(), structSorter); - buildings.push_back(new CBuildingRect(this, town, group->second.back())); + if (!structure->building) + { + buildings.push_back(new CBuildingRect(this, town, structure)); + continue; + } + if (vstd::contains(buildingsCopy, structure->building->bid)) + { + groups[structure->building->getBase()].push_back(structure); + } } - std::sort(buildings.begin(),buildings.end(),buildSorter); - checkRules(); + + BOOST_FOREACH(auto & entry, groups) + { + const CBuilding * build = town->town->buildings[entry.first]; + + const CStructure * toAdd = *boost::max_element(entry.second, [=](const CStructure * a, const CStructure * b) + { + return build->getDistance(a->building->bid) + < build->getDistance(b->building->bid); + }); + + buildings.push_back(new CBuildingRect(this, town, toAdd)); + } + boost::sort(buildings, [] (const CBuildingRect * a, const CBuildingRect * b) + { + return *a < *b; + }); } CCastleBuildings::~CCastleBuildings() { } -void CCastleBuildings::checkRules() -{ - //if town tonwID have building toCheck - //then set animation of building buildID to firstA..lastA - //else set to firstB..lastB - struct AnimRule - { - int townID, buildID; - int toCheck; - size_t firstA, lastA; - size_t firstB, lastB; - }; - - static const AnimRule animRule[2] = - { - {5, 21, 4, 10, size_t(-1), 0, 10}, //Mana Vortex, Dungeon - {0, 6, 8, 1, size_t(-1), 0, 1} //Shipyard, Castle - }; - - for (size_t i=0; i<2; i++) - { - if ( town->subID != animRule[i].townID ) //wrong town - continue; - - int buildingID = animRule[i].buildID; - //check if this building have been upgraded (Ship is upgrade of Shipyard) - int groupID = town->town->clientInfo.structures[animRule[i].buildID]->group; - if (groupID != -1) - { - std::map< int, std::vector >::const_iterator git= groups.find(groupID); - if ( git == groups.end() || git->second.empty() ) - continue; - buildingID = git->second.back()->ID; - } - - BOOST_FOREACH(CBuildingRect* rect, buildings) - { - if ( rect->str->ID == buildingID ) - { - if (vstd::contains(town->builtBuildings, animRule[i].toCheck)) - rect->set(0,animRule[i].firstA, animRule[i].lastA); - else - rect->set(0,animRule[i].firstB, animRule[i].lastB); - - break; - } - } - } -} - void CCastleBuildings::addBuilding(int building) { - OBJ_CONSTRUCTION_CAPTURING_ALL; - auto structure = town->town->clientInfo.structures.find(building); + //FIXME: implement faster method without complete recreation of town + int base = town->town->buildings[building]->getBase(); - if(structure != town->town->clientInfo.structures.end()) //we have info about that structure + recreate(); + + auto & structures = groups[base]; + + BOOST_FOREACH(CBuildingRect * rect, buildings) { - if(structure->second->group<0) //no group - just add it + if (vstd::contains(structures, rect->str)) { - buildings.push_back(new CBuildingRect(this, town, structure->second)); - buildings.back()->stateCounter = 0; - } - else - { - //find last building in this group and replace it with new building if needed - groups[structure->second->group].push_back(structure->second); - int newBuilding = groups[structure->second->group].back()->ID; - if (newBuilding == building) - { - for (std::vector< CBuildingRect* >::iterator it=buildings.begin() ; it !=buildings.end(); it++ ) - { - if ((*it)->str->ID == newBuilding) - { - delete *it; - buildings.erase(it); - break; - } - } - buildings.push_back(new CBuildingRect(this, town, structure->second)); - buildings.back()->stateCounter = 0; - } + //reset animation + if (structures.size() == 1) + rect->stateCounter = 0; // transparency -> fully visible stage + else + rect->stateCounter = 16; // already in fully visible stage + break; } } - std::sort(buildings.begin(),buildings.end(),buildSorter); - checkRules(); } void CCastleBuildings::removeBuilding(int building) { - OBJ_CONSTRUCTION_CAPTURING_ALL; - auto structure = town->town->clientInfo.structures.find(building); - - if(structure != town->town->clientInfo.structures.end()) //we have info about that structure - { - if(structure->second->group<0) //no group - just add it - { - for (std::vector< CBuildingRect* >::iterator it=buildings.begin() ; it !=buildings.end(); it++ ) - { - if ((*it)->str->ID == building) - { - delete *it; - buildings.erase(it); - break; - } - } - } - else - { - groups[structure->second->group].pop_back(); - delete buildings[building]; - if (!groups[structure->second->group].empty()) - buildings.push_back(new CBuildingRect(this, town, structure->second)); - } - } - std::sort(buildings.begin(),buildings.end(),buildSorter); - checkRules(); + //FIXME: implement faster method without complete recreation of town + recreate(); } void CCastleBuildings::show(SDL_Surface * to) { CIntObject::show(to); - for (std::vector< CBuildingRect* >::const_iterator it=buildings.begin() ; it !=buildings.end(); it++ ) - (*it)->show(to); + BOOST_FOREACH(CBuildingRect * str, buildings) + str->show(to); } void CCastleBuildings::showAll(SDL_Surface * to) { CIntObject::showAll(to); - for (std::vector< CBuildingRect* >::const_iterator it=buildings.begin() ; it !=buildings.end(); it++ ) - (*it)->showAll(to); + BOOST_FOREACH(CBuildingRect * str, buildings) + str->showAll(to); } const CGHeroInstance* CCastleBuildings::getHero() @@ -638,7 +563,6 @@ const CGHeroInstance* CCastleBuildings::getHero() void CCastleBuildings::buildingClicked(int building) { tlog5<<"You've clicked on "<town->buildings.find(building)->second; if(building >= EBuilding::DWELL_FIRST) @@ -689,11 +613,13 @@ void CCastleBuildings::buildingClicked(int building) case EBuilding::SPECIAL_1: switch(town->subID) { - case 1://Mystic Pond + case ETownType::RAMPART://Mystic Pond enterFountain(building); break; - case 2: case 5: case 8://Artifact Merchant + case ETownType::TOWER: + case ETownType::DUNGEON://Artifact Merchant + case ETownType::CONFLUX: if(town->visitingHero) GH.pushInt(new CMarketplaceWindow(town, town->visitingHero, EMarketMode::RESOURCE_ARTIFACT)); else @@ -713,18 +639,18 @@ void CCastleBuildings::buildingClicked(int building) case EBuilding::SPECIAL_2: switch(town->subID) { - case 1: //Fountain of Fortune + case ETownType::RAMPART: //Fountain of Fortune enterFountain(building); break; - case 6: //Freelancer's Guild + case ETownType::STRONGHOLD: //Freelancer's Guild if(getHero()) GH.pushInt(new CMarketplaceWindow(town, getHero(), EMarketMode::CREATURE_RESOURCE)); else LOCPLINT->showInfoDialog(boost::str(boost::format(CGI->generaltexth->allTexts[273]) % b->Name())); //Only visiting heroes may use the %s. break; - case 8: //Magic University + case ETownType::CONFLUX: //Magic University if (getHero()) GH.pushInt(new CUniversityWindow(getHero(), town)); else @@ -740,26 +666,26 @@ void CCastleBuildings::buildingClicked(int building) case EBuilding::SPECIAL_3: switch(town->subID) { - case 0: //Brotherhood of sword + case ETownType::CASTLE: //Brotherhood of sword LOCPLINT->showTavernWindow(town); break; - case 3: //Castle Gate + case ETownType::INFERNO: //Castle Gate enterCastleGate(); break; - case 4: //Skeleton Transformer + case ETownType::NECROPOLIS: //Skeleton Transformer GH.pushInt( new CTransformerWindow(getHero(), town) ); break; - case 5: //Portal of Summoning + case ETownType::DUNGEON: //Portal of Summoning if (town->creatures[GameConstants::CREATURES_PER_TOWN].second.empty())//No creatures LOCPLINT->showInfoDialog(CGI->generaltexth->tcommands[30]); else enterDwelling(GameConstants::CREATURES_PER_TOWN); break; - case 6: //Ballista Yard + case ETownType::STRONGHOLD: //Ballista Yard enterBlacksmith(4); break; @@ -810,12 +736,12 @@ void CCastleBuildings::enterCastleGate() { const CGTownInstance *t = Towns[i]; if (t->id != this->town->id && t->visitingHero == NULL && //another town, empty and this is - t->subID == 3 && vstd::contains(t->builtBuildings, 22))//inferno with castle gate + t->hasBuilt(EBuilding::CASTLE_GATE, ETownType::INFERNO)) { availableTowns.push_back(t->id);//add to the list } } - CPicture *titlePic = new CPicture (LOCPLINT->castleInt->bicons->ourImages[22].bitmap, 0,0, false);//will be deleted by selection window + CPicture *titlePic = new CPicture (LOCPLINT->castleInt->bicons->ourImages[EBuilding::CASTLE_GATE].bitmap, 0,0, false);//will be deleted by selection window GH.pushInt (new CObjectListWindow(availableTowns, titlePic, CGI->generaltexth->jktexts[40], CGI->generaltexth->jktexts[41], boost::bind (&CCastleInterface::castleTeleport, LOCPLINT->castleInt, _1))); } @@ -831,8 +757,10 @@ void CCastleBuildings::enterFountain(int building) std::vector comps(1, new CComponent(CComponent::building,town->subID,building)); std::string descr = town->town->buildings.find(building)->second->Description(); - if ( building == 21)//we need description for mystic pond as well - descr += "\n\n"+town->town->buildings.find(17)->second->Description(); + + if ( building == EBuilding::FOUNTAIN_OF_FORTUNE) + descr += "\n\n"+town->town->buildings.find(EBuilding::MYSTIC_POND)->second->Description(); + if (town->bonusValue.first == 0)//fountain was builded this week descr += "\n\n"+ CGI->generaltexth->allTexts[677]; else//fountain produced something; @@ -948,9 +876,9 @@ CCastleInterface::CCastleInterface(const CGTownInstance * Town, const CGTownInst townlist->onSelect = boost::bind(&CCastleInterface::townChange, this); recreateIcons(); - CCS->musich->playMusicFromSet("town-theme", town->subID, true); + CCS->musich->playMusic(town->town->clientInfo.musicTheme, true); - bicons = CDefHandler::giveDefEss(graphics->buildingPics[town->subID]); + bicons = CDefHandler::giveDefEss(town->town->clientInfo.buildingsIcons); } CCastleInterface::~CCastleInterface() @@ -1013,7 +941,7 @@ void CCastleInterface::recreateIcons() if (!town->hasFort()) iconIndex += GameConstants::F_NUMBER*2; - if(town->builded >= GameConstants::MAX_BUILDING_PER_TURN) + if(town->builded >= CGI->modh->settings.MAX_BUILDING_PER_TURN) iconIndex++; icon->setFrame(iconIndex); @@ -1319,7 +1247,7 @@ CHallInterface::CBuildingBox::CBuildingBox(int x, int y, const CGTownInstance * static int panelIndex[9] = { 3, 3, 3, 0, 0, 2, 2, 1, 2}; static int iconIndex[9] = {-1, -1, -1, 0, 0, 1, 2, -1, 1}; - picture = new CAnimImage(graphics->buildingPics[town->subID], building->bid, 0, 2, 2); + picture = new CAnimImage(town->town->clientInfo.buildingsIcons, building->bid, 0, 2, 2); panel = new CAnimImage("TPTHBAR", panelIndex[state], 0, 1, 73); if ( iconIndex[state] >=0 ) icon = new CAnimImage("TPTHCHK", iconIndex[state], 0, 136, 56); @@ -1355,18 +1283,8 @@ CHallInterface::CHallInterface(const CGTownInstance *Town): int buildingID = boxList[row][col][item]; building = town->town->buildings[buildingID]; - if (buildingID == 18 || buildingID == 24) - { - if ( (buildingID == 18 && !vstd::contains(town->builtBuildings, town->town->hordeLvl[0]+37)) - || (buildingID == 24 && !vstd::contains(town->builtBuildings, town->town->hordeLvl[1]+37)) ) - break; // horde present, no upgraded dwelling -> select 18 or 24 - else - continue; //upgraded dwelling, no horde -> select 19 or 25 - } - - if(vstd::contains(town->builtBuildings,buildingID)) - continue; - break; + if(!vstd::contains(town->builtBuildings,buildingID)) + break; } int posX = pos.w/2 - boxList[row].size()*154/2 - (boxList[row].size()-1)*20 + 194*col, posY = 35 + 104*row; @@ -1419,7 +1337,7 @@ CBuildWindow::CBuildWindow(const CGTownInstance *Town, const CBuilding * Buildin { OBJ_CONSTRUCTION_CAPTURING_ALL; - new CAnimImage(graphics->buildingPics[town->subID], building->bid, 0, 125, 50); + new CAnimImage(town->town->clientInfo.buildingsIcons, building->bid, 0, 125, 50); new CGStatusBar(new CPicture(*background, Rect(8, pos.h - 26, pos.w - 16, 19), 8, pos.h - 26)); new CLabel(197, 30, FONT_MEDIUM, CENTER, Colors::Cornsilk, @@ -1581,7 +1499,7 @@ CFortScreen::RecruitArea::RecruitArea(int posX, int posY, const CGTownInstance * addUsedEvents(LCLICK | RCLICK | HOVER);//Activate only if dwelling is present icons = new CPicture("ZPCAINFO", 261, 3); - buildingPic = new CAnimImage(graphics->buildingPics[town->subID], buildingID, 0, 4, 21); + buildingPic = new CAnimImage(town->town->clientInfo.buildingsIcons, buildingID, 0, 4, 21); const CCreature* creature = NULL; @@ -1651,7 +1569,7 @@ CMageGuildScreen::CMageGuildScreen(CCastleInterface * owner): { OBJ_CONSTRUCTION_CAPTURING_ALL; - window = new CPicture(graphics->guildBgs[owner->town->subID], 332, 76); + window = new CPicture(owner->town->town->clientInfo.guildWindow , 332, 76); resdatabar = new CMinorResDataBar; resdatabar->pos.x += pos.x; diff --git a/client/CCastleInterface.h b/client/CCastleInterface.h index 8eb2eb1e3..554a93d7a 100644 --- a/client/CCastleInterface.h +++ b/client/CCastleInterface.h @@ -114,15 +114,14 @@ public: class CCastleBuildings : public CIntObject { CPicture *background; - //List of buildings for each group - std::map< int, std::vector > groups; - //Vector with all blittable buildings - std::vector buildings; + //List of buildings and structures that can represent them + std::map< si32, std::vector > groups; + // actual IntObject's visible on screen + std::vector< CBuildingRect * > buildings; const CGTownInstance * town; const CGHeroInstance* getHero();//Select hero for buildings usage - void checkRules();//Check animation rules (special anims for Shipyard and Mana Vortex) void enterBlacksmith(int ArtifactID);//support for blacksmith + ballista yard void enterBuilding(int building);//for buildings with simple description + pic left-click messages @@ -134,6 +133,7 @@ class CCastleBuildings : public CIntObject void openMagesGuild(); void openTownHall(); + void recreate(); public: CBuildingRect * selectedBuilding; diff --git a/client/CKingdomInterface.cpp b/client/CKingdomInterface.cpp index 8ab0b545d..992229da0 100644 --- a/client/CKingdomInterface.cpp +++ b/client/CKingdomInterface.cpp @@ -4,6 +4,7 @@ #include "../CCallback.h" #include "../lib/CCreatureHandler.h" //creatures name for objects list #include "../lib/CGeneralTextHandler.h" +#include "../lib/CModHandler.h" //for buildings per turn #include "../lib/CObjectHandler.h" //Hero/Town objects #include "../lib/CHeroHandler.h" // only for calculating required xp? worth it? #include "CAnimation.h" //CAnimImage @@ -797,7 +798,7 @@ CTownItem::CTownItem(const CGTownInstance* Town): if (!town->hasFort()) iconIndex += GameConstants::F_NUMBER*2; - if(town->builded >= GameConstants::MAX_BUILDING_PER_TURN) + if(town->builded >= CGI->modh->settings.MAX_BUILDING_PER_TURN) iconIndex++; picture = new CAnimImage("ITPT", iconIndex, 0, 5, 6); diff --git a/client/CMusicHandler.cpp b/client/CMusicHandler.cpp index 600c756b7..0595d33f6 100644 --- a/client/CMusicHandler.cpp +++ b/client/CMusicHandler.cpp @@ -329,8 +329,6 @@ CMusicHandler::CMusicHandler(): const std::string setEnemy[] = {"AITheme0", "AITheme1", "AITheme2"}; const std::string setBattle[] = {"Combat01", "Combat02", "Combat03", "Combat04"}; const std::string setTerrain[] = {"Dirt", "Sand", "Grass", "Snow", "Swamp", "Rough", "Underground", "Lava", "Water"}; - const std::string setTowns[] = {"CstleTown", "Rampart", "TowerTown", "InfernoTown", - "NecroTown", "Dungeon", "Stronghold", "FortressTown", "ElemTown"}; auto fillSet = [=](std::string setName, const std::string list[], size_t amount) { @@ -340,7 +338,6 @@ CMusicHandler::CMusicHandler(): fillSet("enemy-turn", setEnemy, ARRAY_COUNT(setEnemy)); fillSet("battle", setBattle, ARRAY_COUNT(setBattle)); fillSet("terrain", setTerrain, ARRAY_COUNT(setTerrain)); - fillSet("town-theme", setTowns, ARRAY_COUNT(setTowns)); } void CMusicHandler::addEntryToSet(std::string set, int musicID, std::string musicURI) diff --git a/client/GUIClasses.cpp b/client/GUIClasses.cpp index 80bca94f7..e7c577d96 100644 --- a/client/GUIClasses.cpp +++ b/client/GUIClasses.cpp @@ -22,6 +22,7 @@ #include "../lib/CBuildingHandler.h" #include "../lib/CGeneralTextHandler.h" #include "../lib/CHeroHandler.h" +#include "../lib/CModHandler.h" #include "../lib/CObjectHandler.h" #include "../lib/CSpellHandler.h" #include "../lib/CTownHandler.h" @@ -162,7 +163,7 @@ void CTownTooltip::init(const InfoAboutTown &town) size_t imageIndex = town.tType->typeID * 2; if (town.fortLevel == 0) imageIndex += GameConstants::F_NUMBER * 2; - if (town.built >= GameConstants::MAX_BUILDING_PER_TURN) + if (town.built >= CGI->modh->settings.MAX_BUILDING_PER_TURN) imageIndex++; new CAnimImage("itpt", imageIndex, 0, 3, 2); @@ -861,7 +862,7 @@ const std::vector CComponent::getFileName() case spell: return gen(spellsArr); case morale: return gen(moraleArr); case luck: return gen(luckArr); - case building: return std::vector(4, graphics->buildingPics[subtype]); + case building: return std::vector(4, CGI->townh->towns[subtype].clientInfo.buildingsIcons); case hero: return gen(heroArr); case flag: return gen(flagArr); } @@ -1244,18 +1245,17 @@ void CSelWindow::madeChoice() LOCPLINT->cb->selectionMade(ret+1,ID); } - - CCreaturePic::CCreaturePic(int x, int y, const CCreature *cre, bool Big, bool Animated) { OBJ_CONSTRUCTION_CAPTURING_ALL; pos.x+=x; pos.y+=y; + assert(vstd::contains(CGI->townh->factions, cre->faction)); if(Big) - bg = new CPicture(graphics->backgrounds[cre->faction],0,0,false); + bg = new CPicture(CGI->townh->factions[cre->faction].creatureBg130); else - bg = new CPicture(graphics->backgroundsm[cre->faction],0,0,false); + bg = new CPicture(CGI->townh->factions[cre->faction].creatureBg120); bg->needRefresh = true; anim = new CCreatureAnim(0, 0, cre->animDefName, Rect()); anim->clipRect(cre->isDoubleWide()?170:150, 155, bg->pos.w, bg->pos.h); @@ -2437,10 +2437,17 @@ CMarketplaceWindow::CMarketplaceWindow(const IMarket *Market, const CGHeroInstan { switch (mode) { - break; case EMarketMode::CREATURE_RESOURCE: title = CGI->townh->towns[6].buildings[21]->Name(); - break; case EMarketMode::RESOURCE_ARTIFACT: title = CGI->townh->towns[market->o->subID].buildings[17]->Name(); - break; case EMarketMode::ARTIFACT_RESOURCE: title = CGI->townh->towns[market->o->subID].buildings[17]->Name(); - break; default: title = CGI->generaltexth->allTexts[158]; + break; case EMarketMode::CREATURE_RESOURCE: + title = CGI->townh->towns[ETownType::STRONGHOLD].buildings[EBuilding::FREELANCERS_GUILD]->Name(); + + break; case EMarketMode::RESOURCE_ARTIFACT: + title = CGI->townh->towns[market->o->subID].buildings[EBuilding::ARTIFACT_MERCHANT]->Name(); + + break; case EMarketMode::ARTIFACT_RESOURCE: + title = CGI->townh->towns[market->o->subID].buildings[EBuilding::ARTIFACT_MERCHANT]->Name(); + + break; default: + title = CGI->generaltexth->allTexts[158]; } } else @@ -5253,7 +5260,7 @@ CUniversityWindow::CUniversityWindow(const CGHeroInstance * _hero, const IMarket titlePic = new CPicture("UNIVBLDG"); else if (market->o->ID == GameConstants::TOWNI_TYPE) - titlePic = new CAnimImage(graphics->buildingPics[market->o->subID], 21); + titlePic = new CAnimImage(CGI->townh->towns[ETownType::CONFLUX].clientInfo.buildingsIcons, EBuilding::MAGIC_UNIVERSITY); else tlog0<<"Error: Image for university was not found!\n";//This should not happen diff --git a/client/Graphics.cpp b/client/Graphics.cpp index 9270eb989..03a8564a3 100644 --- a/client/Graphics.cpp +++ b/client/Graphics.cpp @@ -87,13 +87,6 @@ void Graphics::loadPaletteAndColors() playerColors[i].unused = 255; } neutralColor->r = 0x84; neutralColor->g = 0x84; neutralColor->b = 0x84; neutralColor->unused = 255;//gray - const JsonNode config(ResourceID("config/town_pictures.json")); - BOOST_FOREACH(const JsonNode &p, config["town_pictures"].Vector()) { - - townBgs.push_back(p["town_background"].String()); - guildBgs.push_back(p["guild_background"].String()); - buildingPics.push_back(p["building_picture"].String()); - } } void Graphics::initializeBattleGraphics() @@ -158,13 +151,6 @@ Graphics::Graphics() tasks += GET_DEF_ESS(spellscr,"SPELLSCR.DEF"); tasks += GET_DEF_ESS(heroMoveArrows,"ADAG.DEF"); - const JsonNode config(ResourceID("config/creature_backgrounds.json")); - BOOST_FOREACH(const JsonNode &b, config["backgrounds"].Vector()) { - const int id = b["id"].Float(); - tasks += GET_SURFACE(backgrounds[id], b["bg130"].String()); - tasks += GET_SURFACE(backgroundsm[id], b["bg120"].String()); - } - CThreadHelper th(&tasks,std::max((ui32)1,boost::thread::hardware_concurrency())); th.run(); diff --git a/client/Graphics.h b/client/Graphics.h index e696854ff..597931811 100644 --- a/client/Graphics.h +++ b/client/Graphics.h @@ -64,12 +64,7 @@ public: //creatures std::map smallImgs; //creature ID -> small 32x32 img of creature; //ID=-2 is for blank (black) img; -1 for the border std::map bigImgs; //creature ID -> big 58x64 img of creature; //ID=-2 is for blank (black) img; -1 for the border - std::map backgrounds; //castle ID -> 100x130 background creature image // -1 is for neutral - std::map backgroundsm; //castle ID -> 100x120 background creature image // -1 is for neutral //towns - std::vector< std::string > buildingPics;//filenames of def with building images (used rarely, too big to keep them loaded) - std::vector< std::string > townBgs;//backgrounds of town - std::vector< std::string > guildBgs;// name of bitmaps with imgs for mage guild screen std::map ERMUtoPicture[GameConstants::F_NUMBER]; //maps building ID to it's picture's name for each town type //for battles std::vector< std::vector< std::string > > battleBacks; //battleBacks[terType] - vector of possible names for certain terrain type diff --git a/client/NetPacksClient.cpp b/client/NetPacksClient.cpp index 36cf5270b..728adf8ac 100644 --- a/client/NetPacksClient.cpp +++ b/client/NetPacksClient.cpp @@ -401,11 +401,11 @@ void NewStructures::applyCl( CClient *cl ) CGTownInstance *town = GS(cl)->getTown(tid); BOOST_FOREACH(si32 id, bid) { - if(id==13) //fort or capitol + if(id== EBuilding::CAPITOL) //fort or capitol { town->defInfo = GS(cl)->capitols[town->subID]; } - if(id ==7) + if(id == EBuilding::FORT) { town->defInfo = GS(cl)->forts[town->subID]; } diff --git a/config/buildings.json b/config/buildings.json index c8b5473c5..85972a773 100644 --- a/config/buildings.json +++ b/config/buildings.json @@ -1,63 +1,62 @@ { - "towns" : - [ + "castle" : + { + "index" : 0, + "nativeTerrain": "grass", + "creatureBackground" : + { + "120px" : "TPCASCAS", + "130px" : "CRBKGCAS" + }, + "town" : { - // 0 - Castle "structures" : [ - { "id" : 16, "defname" : "TBCSBLAK.def", "x" : 213, "y" : 251, "border" : "TOCSBLAK.bmp", "area" : "TZCSBLAK.bmp" }, - { "id" : 8, "defname" : "TBCSCAS2.def", "x" : 478, "y" : 66, "border" : "TOCSCAS2.bmp", "area" : "TZCSCAS2.bmp" }, - { "id" : 9, "defname" : "TBCSCAS3.def", "x" : 478, "y" : 37, "border" : "TOCSCAS3.bmp", "area" : "TZCSCAS3.bmp" }, - { "id" : 7, "defname" : "TBCSCSTL.def", "x" : 595, "y" : 66, "border" : "TOCSCAS1.bmp", "area" : "TZCSCAS1.bmp" }, - { "id" : 6, "defname" : "TBCSDOCK.def", "x" : 478, "y" : 134, "border" : "TOCSDKMS.bmp", "area" : "TZCSDKMS.bmp" }, - { "id" : 30, "defname" : "TBCSDW_0.def", "x" : 304, "y" : 92, "border" : "TOCSPIK1.bmp", "area" : "TZCSPIK1.bmp" }, - { "id" : 31, "defname" : "TBCSDW_1.def", "x" : 360, "y" : 130, "border" : "TOCSCRS1.bmp", "area" : "TZCSCRS1.bmp" }, - { "id" : 32, "defname" : "TBCSDW_2.def", "x" : 76, "y" : 57, "border" : "TOCSGR1N.bmp", "area" : "TZCSGR1N.bmp" }, - { "id" : 33, "defname" : "TBCSDW_3.def", "x" : 176, "y" : 101, "border" : "TOCSSWD1.bmp", "area" : "TZCSSWD1.bmp" }, - { "id" : 34, "defname" : "TBCSDW_4.def", "x" : 563, "y" : 211, "border" : "TOCSMON1.bmp", "area" : "TZCSMON1.bmp" }, - { "id" : 35, "defname" : "TBCSDW_5.def", "x" : 174, "y" : 190, "border" : "TOCSC101.bmp", "area" : "TZCSCAV1.bmp" }, - { "id" : 36, "defname" : "TBCSDW_6.def", "x" : 303, "y" : 0, "border" : "TOCSANG1.bmp", "area" : "TZCSANG1.bmp" }, - { "id" : 21, "defname" : "TBCSEXT0.def", "x" : 384, "y" : 193, "border" : "TOCSCAVM.bmp", "area" : "TZCSCAVM.bmp" }, - { "id" : 22, "defname" : "TBCSEXT1.def", "x" : 0, "y" : 198, "border" : "TOCSTAV2.bmp", "area" : "TZCSTAV2.bmp" }, - { "id" : -1, "defname" : "TBCSEXT2.def", "x" : 46, "y" : 119 }, - { "id" : 11, "defname" : "TBCSHAL2.def", "x" : 0, "y" : 176, "border" : "TOCSH201.bmp", "area" : "TZCSH201.bmp" }, - { "id" : 12, "defname" : "TBCSHAL3.def", "x" : 0, "y" : 164, "border" : "TOCSH301.bmp", "area" : "TZCSH301.bmp" }, - { "id" : 13, "defname" : "TBCSHAL4.def", "x" : 0, "y" : 154, "border" : "TOCSH401.bmp", "area" : "TZCSH401.bmp" }, - { "id" : 10, "defname" : "TBCSHALL.def", "x" : 0, "y" : 209, "border" : "TOCSH101.bmp", "area" : "TZCSH101.bmp" }, - { "id" : 26, "defname" : "TBCSHOLY.def", "x" : 456, "y" : 109, "border" : "TOCSHOLY.bmp", "area" : "TZCSHOLY.bmp" }, - { "id" : 18, "defname" : "TBCSHRD1.def", "x" : 76, "y" : 53, "border" : "TOCSGR1H.bmp", "area" : "TZCSGR1H.bmp" }, - { "id" : 19, "defname" : "TBCSHRD2.def", "x" : 76, "y" : 35, "border" : "TOCSGR2H.bmp", "area" : "TZCSGR2H.bmp" }, - { "id" : 1, "defname" : "TBCSMAG2.def", "x" : 706, "y" : 135, "border" : "TOCSMAG2.bmp", "area" : "TZCSMAG2.bmp" }, - { "id" : 2, "defname" : "TBCSMAG3.def", "x" : 704, "y" : 107, "border" : "TOCSM301.bmp", "area" : "TZCSM301.bmp" }, - { "id" : 3, "defname" : "TBCSMAG4.def", "x" : 704, "y" : 76, "border" : "TOCSM401.bmp", "area" : "TZCSM401.bmp" }, - { "id" : 0, "defname" : "TBCSMAGE.def", "x" : 707, "y" : 166, "border" : "TOCSMAG1.bmp", "area" : "TZCSMAG1.bmp" }, - { "id" : 14, "defname" : "TBCSMARK.def", "x" : 413, "y" : 264, "border" : "TOCSMRK1.bmp", "area" : "TZCSMRK1.bmp" }, - { "id" : 15, "defname" : "TBCSSILO.def", "x" : 488, "y" : 228, "border" : "TOCSMRK2.bmp", "area" : "TZCSMRK2.bmp" }, - { "id" : 17, "defname" : "TBCSSPEC.def", "x" : 533, "y" : 71, "border" : "TOCSLT01.bmp", "area" : "TZCSLT01.bmp" }, - { "id" : 5, "defname" : "TBCSTVRN.def", "x" : 0, "y" : 230, "border" : "TOCSTAV1.bmp", "area" : "TZCSTAV1.bmp" }, - { "id" : 37, "defname" : "TBCSUP_0.def", "x" : 304, "y" : 65, "border" : "TOCSPIK2.bmp", "area" : "TZCSPIK2.bmp" }, - { "id" : 38, "defname" : "TBCSUP_1.def", "x" : 360, "y" : 115, "border" : "TOCSCRS2.bmp", "area" : "TZCSCRS2.bmp" }, - { "id" : 39, "defname" : "TBCSUP_2.def", "x" : 76, "y" : 35, "border" : "TOCSGR2N.bmp", "area" : "TZCSGR2N.bmp" }, - { "id" : 40, "defname" : "TBCSUP_3.def", "x" : 176, "y" : 85, "border" : "TOCSSWD2.bmp", "area" : "TZCSSWD2.bmp" }, - { "id" : 41, "defname" : "TBCSUP_4.def", "x" : 563, "y" : 173, "border" : "TOCSMON2.bmp", "area" : "TZCSMON2.bmp" }, - { "id" : 42, "defname" : "TBCSUP_5.def", "x" : 160, "y" : 190, "border" : "TOCSCAV2.bmp", "area" : "TZCSCAV2.bmp" }, - { "id" : 43, "defname" : "TBCSUP_6.def", "x" : 303, "y" : 0, "border" : "TOCSANG2.bmp", "area" : "TZCSANG2.bmp" }, - { "id" : 20, "defname" : "TBCSBOAT.def", "x" : 478, "y" : 134, "border" : "TOCSDKMN.bmp", "area" : "TZCSDKMN.bmp" } - ], - "groups" : - [ - [ 0, 1, 2, 3, 4 ], - [ 6, 20 ], - [ 7, 8, 9 ], - [ 10, 11, 12, 13 ], - [ 30, 37 ], - [ 31, 38 ], - [ 32, 39, 18, 19 ], - [ 33, 40 ], - [ 34, 41 ], - [ 35, 42 ], - [ 36, 43 ] + { "animation" : "TBCSEXT2.def", "x" : 46, "y" : 119 }, + { "id" : 0, "animation" : "TBCSMAGE.def", "x" : 707, "y" : 166, "z" : 1, "border" : "TOCSMAG1.bmp", "area" : "TZCSMAG1.bmp" }, + { "id" : 1, "animation" : "TBCSMAG2.def", "x" : 706, "y" : 135, "z" : 1, "border" : "TOCSMAG2.bmp", "area" : "TZCSMAG2.bmp" }, + { "id" : 2, "animation" : "TBCSMAG3.def", "x" : 704, "y" : 107, "z" : 1, "border" : "TOCSM301.bmp", "area" : "TZCSM301.bmp" }, + { "id" : 3, "animation" : "TBCSMAG4.def", "x" : 704, "y" : 76, "z" : 1, "border" : "TOCSM401.bmp", "area" : "TZCSM401.bmp" }, + { "id" : 5, "animation" : "TBCSTVRN.def", "x" : 0, "y" : 230, "z" : 1, "border" : "TOCSTAV1.bmp", "area" : "TZCSTAV1.bmp" }, + { "id" : 6, "animation" : "TBCSDOCK.def", "x" : 478, "y" : 134, "border" : "TOCSDKMS.bmp", "area" : "TZCSDKMS.bmp" }, + { "id" : 7, "animation" : "TBCSCSTL.def", "x" : 595, "y" : 66, "border" : "TOCSCAS1.bmp", "area" : "TZCSCAS1.bmp" }, + { "id" : 8, "animation" : "TBCSCAS2.def", "x" : 478, "y" : 66, "border" : "TOCSCAS2.bmp", "area" : "TZCSCAS2.bmp" }, + { "id" : 9, "animation" : "TBCSCAS3.def", "x" : 478, "y" : 37, "border" : "TOCSCAS3.bmp", "area" : "TZCSCAS3.bmp" }, + { "id" : 10, "animation" : "TBCSHALL.def", "x" : 0, "y" : 209, "border" : "TOCSH101.bmp", "area" : "TZCSH101.bmp" }, + { "id" : 11, "animation" : "TBCSHAL2.def", "x" : 0, "y" : 176, "border" : "TOCSH201.bmp", "area" : "TZCSH201.bmp" }, + { "id" : 12, "animation" : "TBCSHAL3.def", "x" : 0, "y" : 164, "border" : "TOCSH301.bmp", "area" : "TZCSH301.bmp" }, + { "id" : 13, "animation" : "TBCSHAL4.def", "x" : 0, "y" : 154, "border" : "TOCSH401.bmp", "area" : "TZCSH401.bmp" }, + { "id" : 14, "animation" : "TBCSMARK.def", "x" : 413, "y" : 264, "border" : "TOCSMRK1.bmp", "area" : "TZCSMRK1.bmp" }, + { "id" : 15, "animation" : "TBCSSILO.def", "x" : 488, "y" : 228, "border" : "TOCSMRK2.bmp", "area" : "TZCSMRK2.bmp" }, + { "id" : 16, "animation" : "TBCSBLAK.def", "x" : 213, "y" : 251, "border" : "TOCSBLAK.bmp", "area" : "TZCSBLAK.bmp" }, + { "id" : 17, "animation" : "TBCSSPEC.def", "x" : 533, "y" : 71, "border" : "TOCSLT01.bmp", "area" : "TZCSLT01.bmp" }, + { "id" : 18, "animation" : "TBCSHRD1.def", "x" : 76, "y" : 53, "border" : "TOCSGR1H.bmp", "area" : "TZCSGR1H.bmp", "hidden" : true }, + { "id" : 19, "animation" : "TBCSHRD2.def", "x" : 76, "y" : 35, "border" : "TOCSGR2H.bmp", "area" : "TZCSGR2H.bmp", "hidden" : true, "builds" : 18 }, + { "id" : 20, "animation" : "TBCSBOAT.def", "x" : 478, "y" : 134, "border" : "TOCSDKMN.bmp", "area" : "TZCSDKMN.bmp", "hidden" : true }, + { "id" : 21, "animation" : "TBCSEXT0.def", "x" : 384, "y" : 193, "z" : -2, "border" : "TOCSCAVM.bmp", "area" : "TZCSCAVM.bmp" }, + { "id" : 22, "animation" : "TBCSEXT1.def", "x" : 0, "y" : 198, "z" : 1, "border" : "TOCSTAV2.bmp", "area" : "TZCSTAV2.bmp" }, + { "id" : 26, "animation" : "TBCSHOLY.def", "x" : 456, "y" : 109, "z" : -1, "border" : "TOCSHOLY.bmp", "area" : "TZCSHOLY.bmp" }, + { "id" : 30, "animation" : "TBCSDW_0.def", "x" : 304, "y" : 92, "border" : "TOCSPIK1.bmp", "area" : "TZCSPIK1.bmp" }, + { "id" : 31, "animation" : "TBCSDW_1.def", "x" : 360, "y" : 130, "border" : "TOCSCRS1.bmp", "area" : "TZCSCRS1.bmp" }, + { "id" : 32, "animation" : "TBCSDW_2.def", "x" : 76, "y" : 57, "border" : "TOCSGR1N.bmp", "area" : "TZCSGR1N.bmp" }, + { "id" : 33, "animation" : "TBCSDW_3.def", "x" : 176, "y" : 101, "border" : "TOCSSWD1.bmp", "area" : "TZCSSWD1.bmp" }, + { "id" : 34, "animation" : "TBCSDW_4.def", "x" : 563, "y" : 211, "z" : 1, "border" : "TOCSMON1.bmp", "area" : "TZCSMON1.bmp" }, + { "id" : 35, "animation" : "TBCSDW_5.def", "x" : 174, "y" : 190, "z" : -1, "border" : "TOCSC101.bmp", "area" : "TZCSCAV1.bmp" }, + { "id" : 36, "animation" : "TBCSDW_6.def", "x" : 303, "y" : 0, "z" : -1, "border" : "TOCSANG1.bmp", "area" : "TZCSANG1.bmp" }, + { "id" : 37, "animation" : "TBCSUP_0.def", "x" : 304, "y" : 65, "border" : "TOCSPIK2.bmp", "area" : "TZCSPIK2.bmp" }, + { "id" : 38, "animation" : "TBCSUP_1.def", "x" : 360, "y" : 115, "border" : "TOCSCRS2.bmp", "area" : "TZCSCRS2.bmp" }, + { "id" : 39, "animation" : "TBCSUP_2.def", "x" : 76, "y" : 35, "border" : "TOCSGR2N.bmp", "area" : "TZCSGR2N.bmp" }, + { "id" : 40, "animation" : "TBCSUP_3.def", "x" : 176, "y" : 85, "border" : "TOCSSWD2.bmp", "area" : "TZCSSWD2.bmp" }, + { "id" : 41, "animation" : "TBCSUP_4.def", "x" : 563, "y" : 173, "z" : 1, "border" : "TOCSMON2.bmp", "area" : "TZCSMON2.bmp" }, + { "id" : 42, "animation" : "TBCSUP_5.def", "x" : 160, "y" : 190, "z" : -1, "border" : "TOCSCAV2.bmp", "area" : "TZCSCAV2.bmp" }, + { "id" : 43, "animation" : "TBCSUP_6.def", "x" : 303, "y" : 0, "z" : -1, "border" : "TOCSANG2.bmp", "area" : "TZCSANG2.bmp" }, + ], + "musicTheme" : "music/CstleTown", + + "townBackground": "TBCSBACK.bmp", + "guildWindow": "TPMAGECS.bmp", + "buildingsIcons": "HALLCSTL.DEF", "hallBackground": "TPTHBKCS.BMP", "hallSlots": [ @@ -67,40 +66,41 @@ [ [ 30, 37 ], [ 31, 38 ], [ 32, 39 ], [ 33, 40 ] ], [ [ 34, 41 ], [ 35, 42 ], [ 36, 43 ] ] ], - - "blit_order" : [ 0, 1, 2, 3, 10, 11, 12, 13, 5, 22, 30, 37, 16, 6, 20, 18, 19, 34, 41 ], "creatures" : [ [0, 1], [2, 3], [4, 5], [6, 7], [8, 9], [10, 11], [12, 13] ], "horde" : [ 2, -1 ], - "primary_resource" : 127, - "mage_guild" : 4, - "war_machine" : 4, + "primaryResource" : 127, + "mageGuild" : 4, + "warMachine" : 4, "buildings" : [ { "id" : 0 }, - { "id" : 1, "requires" : [ 0 ] }, - { "id" : 2, "requires" : [ 1 ] }, - { "id" : 3, "requires" : [ 2 ] }, - { "id" : 4, "requires" : [ 3 ] }, + { "id" : 1, "upgrades" : 0 }, + { "id" : 2, "upgrades" : 1 }, + { "id" : 3, "upgrades" : 2 }, + { "id" : 4, "upgrades" : 3 }, { "id" : 5 }, { "id" : 6 }, { "id" : 7 }, - { "id" : 8, "requires" : [ 7 ] }, - { "id" : 9, "requires" : [ 8 ] }, - { "id" : 10 }, - { "id" : 11, "requires" : [ 10, 5 ] }, - { "id" : 12, "requires" : [ 11, 0, 14, 16 ] }, - { "id" : 13, "requires" : [ 12, 9 ] }, + { "id" : 8, "upgrades" : 7 }, + { "id" : 9, "upgrades" : 8 }, + { "id" : 10, "mode" : "auto" }, + { "id" : 11, "upgrades" : 10, "requires" : [ 5 ] }, + { "id" : 12, "upgrades" : 11, "requires" : [ 0, 14, 16 ] }, + { "id" : 13, "upgrades" : 12, "requires" : [ 9 ] }, { "id" : 14 }, { "id" : 15, "requires" : [ 14 ] }, { "id" : 16 }, { "id" : 17, "requires" : [ 6 ] }, - { "id" : 18, "requires" : [ 32 ] }, - { "id" : 19, "requires" : [ 39 ] }, - { "id" : 20 }, + { "id" : 18, "upgrades" : 32 }, + { "id" : 19, "upgrades" : 39, "requires" : [ 18 ], "mode" : "auto" }, + { "id" : 20, "upgrades" : 6 }, { "id" : 21, "requires" : [ 33 ] }, - { "id" : 22, "requires" : [ 5 ] }, - { "id" : 26 }, + { "id" : 22, "upgrades" : 5 }, + { "id" : 26, "mode" : "grail"}, + { "id" : 27, "requires" : [ 11 ], "mode" : "auto" }, + { "id" : 28, "requires" : [ 12 ], "mode" : "auto" }, + { "id" : 29, "requires" : [ 13 ], "mode" : "auto" }, { "id" : 30, "requires" : [ 7 ] }, { "id" : 31, "requires" : [ 30 ] }, { "id" : 32, "requires" : [ 33 ] }, @@ -108,78 +108,77 @@ { "id" : 34, "requires" : [ 0, 33 ] }, { "id" : 35, "requires" : [ 21 ] }, { "id" : 36, "requires" : [ 34 ] }, - { "id" : 37, "requires" : [ 30 ] }, - { "id" : 38, "requires" : [ 31 ] }, - { "id" : 39, "requires" : [ 32 ] }, - { "id" : 40, "requires" : [ 33 ] }, - { "id" : 41, "requires" : [ 34 ] }, - { "id" : 42, "requires" : [ 35 ] }, - { "id" : 43, "requires" : [ 36 ] } + { "id" : 37, "upgrades" : 30 }, + { "id" : 38, "upgrades" : 31 }, + { "id" : 39, "upgrades" : 32 }, + { "id" : 40, "upgrades" : 33 }, + { "id" : 41, "upgrades" : 34 }, + { "id" : 42, "upgrades" : 35 }, + { "id" : 43, "upgrades" : 36 } ] - }, - + } + }, + "rampart" : + { + "index" : 1, + "nativeTerrain": "grass", + "creatureBackground" : + { + "120px" : "TPCASRAM", + "130px" : "CRBKGRAM" + }, + "town" : { - // 1 - Rampart "structures" : [ - { "id" : 16, "defname" : "TBRMBLAK.def", "x" : 558, "y" : 105, "border" : "TORAID.bmp", "area" : "TZRAID.bmp" }, - { "id" : 9, "defname" : "TBRMCAS3.def", "x" : 79, "y" : 18, "border" : "TORCAS2.bmp", "area" : "TZRCAS2.bmp" }, - { "id" : 8, "defname" : "TBRMCAS2.def", "x" : 79, "y" : 18, "border" : "TORCAS3.bmp", "area" : "TZRCAS3.bmp" }, - { "id" : 7, "defname" : "TBRMCSTL.def", "x" : 63, "y" : 25, "border" : "TORCAS1.bmp", "area" : "TZRCAS1.bmp" }, - { "id" : 30, "defname" : "TBRMDW_0.def", "x" : 0, "y" : 236, "border" : "TORCEN1A.bmp", "area" : "TZRCEN1A.bmp" }, - { "id" : 31, "defname" : "TBRMDW_1.def", "x" : 0, "y" : 154, "border" : "TORDWF1.bmp", "area" : "TZRDWF1.bmp" }, - { "id" : 32, "defname" : "TBRMDW_2.def", "x" : 668, "y" : 101, "border" : "TORELF1.bmp", "area" : "TZRELF1.bmp" }, - { "id" : 33, "defname" : "TBRMDW_3.def", "x" : 287, "y" : 73, "border" : "TORPEG1A.bmp", "area" : "TZRPEG1A.bmp" }, - { "id" : 34, "defname" : "TBRMDW_4.def", "x" : 68, "y" : 146, "border" : "TORTRE1.bmp", "area" : "TZRTRE1.bmp" }, - { "id" : 35, "defname" : "TBRMDW_5.def", "x" : 362, "y" : 90, "border" : "TORUNI1.bmp", "area" : "TZRUNI1.bmp" }, - { "id" : 36, "defname" : "TBRMDW_6.def", "x" : 502, "y" : 27, "border" : "TORDR1AA.bmp", "area" : "TZRDR1AA.bmp" }, - { "id" : 21, "defname" : "TBRMEXT0.def", "x" : 555, "y" : 297, "border" : "TORGAR2A.bmp", "area" : "TZRGAR2A.bmp" }, - { "id" : 22, "defname" : "TBRMEXT1.def", "x" : 0, "y" : 181, "border" : "TORDWFT.bmp", "area" : "TZRDWFT.bmp" }, - { "id" : -1, "defname" : "TBRMEXT2.def", "x" : 327, "y" : 236 }, - { "id" : 27, "defname" : "TBRMEXT3.def", "x" : 293, "y" : 235 }, - { "id" : 28, "defname" : "TBRMEXT4.def", "x" : 295, "y" : 191 }, - { "id" : 29, "defname" : "TBRMEXT5.def", "x" : 260, "y" : 171 }, - { "id" : 43, "defname" : "TBRMUP_6.def", "x" : 502, "y" : 5, "border" : "TORDR2AA.bmp", "area" : "TZRDR2AA.bmp" }, - { "id" : 42, "defname" : "TBRMUP_5.def", "x" : 362, "y" : 90, "border" : "TORUNI2.bmp", "area" : "TZRUNI2.bmp" }, - { "id" : 41, "defname" : "TBRMUP_4.def", "x" : 63, "y" : 146, "border" : "TORTRE2.bmp", "area" : "TZRTRE2.bmp" }, - { "id" : 40, "defname" : "TBRMUP_3.def", "x" : 287, "y" : 28, "border" : "TORPEG2A.bmp", "area" : "TZRPEG2A.bmp" }, - { "id" : 39, "defname" : "TBRMUP_2.def", "x" : 665, "y" : 101, "border" : "TORELF2.bmp", "area" : "TZRELF2.bmp" }, - { "id" : 38, "defname" : "TBRMUP_1.def", "x" : 0, "y" : 143, "border" : "TORDWF2.bmp", "area" : "TZRDWF2.bmp" }, - { "id" : 37, "defname" : "TBRMUP_0.def", "x" : 0, "y" : 236, "border" : "TORCEN2A.bmp", "area" : "TZRCEN2A.bmp" }, - { "id" : 5, "defname" : "TBRMTVRN.def", "x" : 181, "y" : 229, "border" : "TORTAV.bmp", "area" : "TZRTAV.bmp" }, - { "id" : 17, "defname" : "TBRMSPEC.def", "x" : 555, "y" : 297, "border" : "TORGAR1A.bmp", "area" : "TZRGAR1A.bmp" }, - { "id" : 15, "defname" : "TBRMSILO.def", "x" : 245, "y" : 324, "border" : "TORMRK2.bmp", "area" : "TZRMRK2.bmp" }, - { "id" : 14, "defname" : "TBRMMARK.def", "x" : 129, "y" : 301, "border" : "TORMRK1.bmp", "area" : "TZRMRK1.bmp" }, - { "id" : 0, "defname" : "TBRMMAGE.def", "x" : 454, "y" : 200, "border" : "TORMAG1.bmp", "area" : "TZRMAG1.bmp" }, - { "id" : 1, "defname" : "TBRMMAG2.def", "x" : 438, "y" : 178, "border" : "TORMAG2.bmp", "area" : "TZRMAG2.bmp" }, - { "id" : 2, "defname" : "TBRMMAG3.def", "x" : 418, "y" : 153, "border" : "TORMAG3.bmp", "area" : "TZRMAG3.bmp" }, - { "id" : 3, "defname" : "TBRMMAG4.def", "x" : 406, "y" : 129, "border" : "TORMAG4.bmp", "area" : "TZRMAG4.bmp" }, - { "id" : 4, "defname" : "TBRMMAG5.def", "x" : 384, "y" : 104, "border" : "TORMAG5.bmp", "area" : "TZRMAG5.bmp" }, - { "id" : 25, "defname" : "TBRMHRD4.def", "x" : 47, "y" : 142, "border" : "TORTRE2H.bmp", "area" : "TZRTRE2H.bmp" }, - { "id" : 24, "defname" : "TBRMHRD3.def", "x" : 47, "y" : 142, "border" : "TORTRE1H.bmp", "area" : "TZRTRE1H.bmp" }, - { "id" : 19, "defname" : "TBRMHRD2.def", "x" : 0, "y" : 143, "border" : "TORDWF2H.bmp", "area" : "TZRDWF2H.bmp" }, - { "id" : 18, "defname" : "TBRMHRD1.def", "x" : 0, "y" : 154, "border" : "TORDWF1H.bmp", "area" : "TZRDWF1H.bmp" }, - { "id" : 26, "defname" : "TBRMHOLY.def", "x" : 0, "y" : 54, "border" : "TORHOLY.bmp", "area" : "TZRHOLY.bmp" }, - { "id" : 10, "defname" : "TBRMHALL.def", "x" : 565, "y" : 216, "border" : "TORHAL1.bmp", "area" : "TZRHAL1.bmp" }, - { "id" : 13, "defname" : "TBRMHAL4.def", "x" : 534, "y" : 187, "border" : "TORHAL4.bmp", "area" : "TZRHAL4.bmp" }, - { "id" : 12, "defname" : "TBRMHAL3.def", "x" : 538, "y" : 187, "border" : "TORHAL3.bmp", "area" : "TZRHAL3.bmp" }, - { "id" : 11, "defname" : "TBRMHAL2.def", "x" : 538, "y" : 187, "border" : "TORHAL2.bmp", "area" : "TZRHAL2.bmp" } - ], - "groups" : - [ - [ 0, 1, 2, 3, 4 ], - [ 6, 20 ], - [ 7, 8, 9 ], - [ 10, 11, 12, 13 ], - [ 30, 37 ], - [ 32, 39 ], - [ 33, 40 ], - [ 35, 42 ], - [ 36, 43 ], - [ 24, 25, 34, 41 ], - [ 17, 21 ], - [ 31, 18, 38, 19 ] + { "animation" : "TBRMEXT2.def", "x" : 327, "y" : 236 }, + { "id" : 0, "animation" : "TBRMMAGE.def", "x" : 454, "y" : 200, "z" : -1, "border" : "TORMAG1.bmp", "area" : "TZRMAG1.bmp" }, + { "id" : 1, "animation" : "TBRMMAG2.def", "x" : 438, "y" : 178, "z" : -1, "border" : "TORMAG2.bmp", "area" : "TZRMAG2.bmp" }, + { "id" : 2, "animation" : "TBRMMAG3.def", "x" : 418, "y" : 153, "z" : -1, "border" : "TORMAG3.bmp", "area" : "TZRMAG3.bmp" }, + { "id" : 3, "animation" : "TBRMMAG4.def", "x" : 406, "y" : 129, "z" : -1, "border" : "TORMAG4.bmp", "area" : "TZRMAG4.bmp" }, + { "id" : 4, "animation" : "TBRMMAG5.def", "x" : 384, "y" : 104, "z" : -1, "border" : "TORMAG5.bmp", "area" : "TZRMAG5.bmp" }, + { "id" : 5, "animation" : "TBRMTVRN.def", "x" : 181, "y" : 229, "z" : 1, "border" : "TORTAV.bmp", "area" : "TZRTAV.bmp" }, + { "id" : 7, "animation" : "TBRMCSTL.def", "x" : 63, "y" : 25, "z" : -2, "border" : "TORCAS1.bmp", "area" : "TZRCAS1.bmp" }, + { "id" : 8, "animation" : "TBRMCAS2.def", "x" : 79, "y" : 18, "z" : -2, "border" : "TORCAS3.bmp", "area" : "TZRCAS3.bmp" }, + { "id" : 9, "animation" : "TBRMCAS3.def", "x" : 79, "y" : 18, "z" : -2, "border" : "TORCAS2.bmp", "area" : "TZRCAS2.bmp" }, + { "id" : 10, "animation" : "TBRMHALL.def", "x" : 565, "y" : 216, "border" : "TORHAL1.bmp", "area" : "TZRHAL1.bmp" }, + { "id" : 11, "animation" : "TBRMHAL2.def", "x" : 538, "y" : 187, "border" : "TORHAL2.bmp", "area" : "TZRHAL2.bmp" }, + { "id" : 12, "animation" : "TBRMHAL3.def", "x" : 538, "y" : 187, "border" : "TORHAL3.bmp", "area" : "TZRHAL3.bmp" }, + { "id" : 13, "animation" : "TBRMHAL4.def", "x" : 534, "y" : 187, "border" : "TORHAL4.bmp", "area" : "TZRHAL4.bmp" }, + { "id" : 14, "animation" : "TBRMMARK.def", "x" : 129, "y" : 301, "z" : 3, "border" : "TORMRK1.bmp", "area" : "TZRMRK1.bmp" }, + { "id" : 15, "animation" : "TBRMSILO.def", "x" : 245, "y" : 324, "z" : 4, "border" : "TORMRK2.bmp", "area" : "TZRMRK2.bmp" }, + { "id" : 16, "animation" : "TBRMBLAK.def", "x" : 558, "y" : 105, "z" : -3, "border" : "TORAID.bmp", "area" : "TZRAID.bmp" }, + { "id" : 17, "animation" : "TBRMSPEC.def", "x" : 555, "y" : 297, "border" : "TORGAR1A.bmp", "area" : "TZRGAR1A.bmp" }, + { "id" : 18, "animation" : "TBRMHRD1.def", "x" : 0, "y" : 154, "border" : "TORDWF1H.bmp", "area" : "TZRDWF1H.bmp", "hidden" : true }, + { "id" : 19, "animation" : "TBRMHRD2.def", "x" : 0, "y" : 143, "border" : "TORDWF2H.bmp", "area" : "TZRDWF2H.bmp", "hidden" : true, "builds" : 18 }, + { "id" : 21, "animation" : "TBRMEXT0.def", "x" : 555, "y" : 297, "z" : 2, "border" : "TORGAR2A.bmp", "area" : "TZRGAR2A.bmp" }, + { "id" : 22, "animation" : "TBRMEXT1.def", "x" : 0, "y" : 181, "z" : 1, "border" : "TORDWFT.bmp", "area" : "TZRDWFT.bmp" }, + { "id" : 24, "animation" : "TBRMHRD3.def", "x" : 47, "y" : 142, "z" : -1, "border" : "TORTRE1H.bmp", "area" : "TZRTRE1H.bmp", "hidden" : true }, + { "id" : 25, "animation" : "TBRMHRD4.def", "x" : 47, "y" : 142, "z" : -1, "border" : "TORTRE2H.bmp", "area" : "TZRTRE2H.bmp", "hidden" : true, "builds" : 24 }, + { "id" : 26, "animation" : "TBRMHOLY.def", "x" : 0, "y" : 54, "z" : -1, "border" : "TORHOLY.bmp", "area" : "TZRHOLY.bmp" }, + { "id" : 27, "animation" : "TBRMEXT3.def", "x" : 293, "y" : 235 }, + { "id" : 28, "animation" : "TBRMEXT4.def", "x" : 295, "y" : 191 }, + { "id" : 29, "animation" : "TBRMEXT5.def", "x" : 260, "y" : 171 }, + { "id" : 30, "animation" : "TBRMDW_0.def", "x" : 0, "y" : 236, "z" : 2, "border" : "TORCEN1A.bmp", "area" : "TZRCEN1A.bmp" }, + { "id" : 31, "animation" : "TBRMDW_1.def", "x" : 0, "y" : 154, "border" : "TORDWF1.bmp", "area" : "TZRDWF1.bmp" }, + { "id" : 32, "animation" : "TBRMDW_2.def", "x" : 668, "y" : 101, "border" : "TORELF1.bmp", "area" : "TZRELF1.bmp" }, + { "id" : 33, "animation" : "TBRMDW_3.def", "x" : 287, "y" : 73, "z" : -1, "border" : "TORPEG1A.bmp", "area" : "TZRPEG1A.bmp" }, + { "id" : 34, "animation" : "TBRMDW_4.def", "x" : 68, "y" : 146, "z" : -1, "border" : "TORTRE1.bmp", "area" : "TZRTRE1.bmp" }, + { "id" : 35, "animation" : "TBRMDW_5.def", "x" : 362, "y" : 90, "z" : -2, "border" : "TORUNI1.bmp", "area" : "TZRUNI1.bmp" }, + { "id" : 36, "animation" : "TBRMDW_6.def", "x" : 502, "y" : 27, "z" : -5, "border" : "TORDR1AA.bmp", "area" : "TZRDR1AA.bmp" }, + { "id" : 37, "animation" : "TBRMUP_0.def", "x" : 0, "y" : 236, "z" : 2, "border" : "TORCEN2A.bmp", "area" : "TZRCEN2A.bmp" }, + { "id" : 38, "animation" : "TBRMUP_1.def", "x" : 0, "y" : 143, "border" : "TORDWF2.bmp", "area" : "TZRDWF2.bmp" }, + { "id" : 39, "animation" : "TBRMUP_2.def", "x" : 665, "y" : 101, "border" : "TORELF2.bmp", "area" : "TZRELF2.bmp" }, + { "id" : 40, "animation" : "TBRMUP_3.def", "x" : 287, "y" : 28, "z" : -1, "border" : "TORPEG2A.bmp", "area" : "TZRPEG2A.bmp" }, + { "id" : 41, "animation" : "TBRMUP_4.def", "x" : 63, "y" : 146, "z" : -1, "border" : "TORTRE2.bmp", "area" : "TZRTRE2.bmp" }, + { "id" : 42, "animation" : "TBRMUP_5.def", "x" : 362, "y" : 90, "z" : -2, "border" : "TORUNI2.bmp", "area" : "TZRUNI2.bmp" }, + { "id" : 43, "animation" : "TBRMUP_6.def", "x" : 502, "y" : 5, "z" : -5, "border" : "TORDR2AA.bmp", "area" : "TZRDR2AA.bmp" } ], + "musicTheme" : "music/Rampart", + + "townBackground": "TBRMBACK.bmp", + "guildWindow": "TPMAGERM.bmp", + "buildingsIcons": "HALLRAMP.DEF", "hallBackground": "TPTHBKRM.BMP", "hallSlots": [ @@ -189,38 +188,41 @@ [ [ 30, 37 ], [ 31, 38 ], [ 32, 39 ], [ 33, 40 ] ], [ [ 34, 41 ], [ 35, 42 ], [ 36, 43 ] ] ], - "blit_order" : [ 33, 40, 35, 42, 16, 32, 39, 0, 1, 2, 3, 4, 31, 18, 38, 19, 34, 24, 41, 25, 5, 30, 37, 14, 10, 11, 12, 13, 17, 21, 22, -1, 27, 28, 29, 15 ], "creatures" : [ [14, 15], [16, 17], [18, 19], [20, 21], [22, 23], [24, 25], [26, 27] ], "horde" : [ 1, 4 ], - "mage_guild" : 5, - "primary_resource" : 4, - "war_machine" : 6, + "mageGuild" : 5, + "primaryResource" : 4, + "warMachine" : 6, "buildings" : [ { "id" : 0 }, - { "id" : 1, "requires" : [ 0 ] }, - { "id" : 2, "requires" : [ 1 ] }, - { "id" : 3, "requires" : [ 2 ] }, - { "id" : 4, "requires" : [ 3 ] }, + { "id" : 1, "upgrades" : 0 }, + { "id" : 2, "upgrades" : 1 }, + { "id" : 3, "upgrades" : 2 }, + { "id" : 4, "upgrades" : 3 }, { "id" : 5 }, { "id" : 7 }, - { "id" : 8, "requires" : [ 7 ] }, - { "id" : 9, "requires" : [ 8 ] }, - { "id" : 10 }, - { "id" : 11, "requires" : [ 10, 5 ] }, - { "id" : 12, "requires" : [ 11, 0, 14, 16 ] }, - { "id" : 13, "requires" : [ 12, 9 ] }, + { "id" : 8, "upgrades" : 7 }, + { "id" : 9, "upgrades" : 8 }, + { "id" : 10, "mode" : "auto" }, + { "id" : 11, "upgrades" : 10, "requires" : [ 5 ] }, + { "id" : 12, "upgrades" : 11, "requires" : [ 0, 14, 16 ] }, + { "id" : 13, "upgrades" : 12, "requires" : [ 9 ] }, { "id" : 14 }, { "id" : 15, "requires" : [ 14 ] }, { "id" : 16 }, { "id" : 17 }, - { "id" : 18, "requires" : [ 31 ] }, - { "id" : 19, "requires" : [ 38 ] }, + { "id" : 18, "upgrades" : 31 }, + { "id" : 19, "upgrades" : 38, "requires" : [ 18 ], "mode" : "auto" }, { "id" : 21, "requires" : [ 17 ] }, - { "id" : 22, "requires" : [ 18 ] }, - { "id" : 24, "requires" : [ 34 ] }, - { "id" : 25, "requires" : [ 41 ] }, + { "id" : 22, "requires" : [ 18, 19 ] }, + { "id" : 24, "upgrades" : 34 }, + { "id" : 25, "upgrades" : 41, "requires" : [ 24 ], "mode" : "auto" }, + { "id" : 26, "mode" : "grail"}, + { "id" : 27, "requires" : [ 11 ], "mode" : "auto" }, + { "id" : 28, "requires" : [ 12 ], "mode" : "auto" }, + { "id" : 29, "requires" : [ 13 ], "mode" : "auto" }, { "id" : 26 }, { "id" : 30, "requires" : [ 7 ] }, { "id" : 31, "requires" : [ 30 ] }, @@ -229,72 +231,72 @@ { "id" : 34, "requires" : [ 32 ] }, { "id" : 35, "requires" : [ 33, 34 ] }, { "id" : 36, "requires" : [ 35, 1 ] }, - { "id" : 37, "requires" : [ 30 ] }, - { "id" : 38, "requires" : [ 31 ] }, - { "id" : 39, "requires" : [ 32 ] }, - { "id" : 40, "requires" : [ 33 ] }, - { "id" : 41, "requires" : [ 34 ] }, - { "id" : 42, "requires" : [ 35 ] }, - { "id" : 43, "requires" : [ 36, 2 ] } + { "id" : 37, "upgrades" : 30 }, + { "id" : 38, "upgrades" : 31 }, + { "id" : 39, "upgrades" : 32 }, + { "id" : 40, "upgrades" : 33 }, + { "id" : 41, "upgrades" : 34 }, + { "id" : 42, "upgrades" : 35 }, + { "id" : 43, "upgrades" : 36, "requires" : [ 2 ] } ] - }, - + } + }, + "tower" : + { + "index" : 2, + "nativeTerrain" : "snow", + "creatureBackground" : + { + "120px" : "TPCASTOW", + "130px" : "CRBKGTOW" + }, + "town" : { - // 2 - Tower "structures" : [ - { "id" : 16, "defname" : "TBTWBLAK.def", "x" : 478, "y" : 211, "border" : "TOTBLKA.bmp", "area" : "TZTBLKA.bmp" }, - { "id" : 9, "defname" : "TBTWCAS3.def", "x" : 301, "y" : 0, "border" : "TOTCAS3.bmp", "area" : "TZTCAS3.bmp" }, - { "id" : 7, "defname" : "TBTWCSTL.def", "x" : 304, "y" : 0, "border" : "TOTCAS1.bmp", "area" : "TZTCAS1.bmp" }, - { "id" : 30, "defname" : "TBTWDW_0.def", "x" : 453, "y" : 221, "border" : "TOTGRM1A.bmp", "area" : "TZTGRM1A.bmp" }, - { "id" : 31, "defname" : "TBTWDW_1.def", "x" : 4, "y" : 46, "border" : "TOTGAR1.bmp", "area" : "TZTGAR1.bmp" }, - { "id" : 32, "defname" : "TBTWDW_2.def", "x" : 209, "y" : 177, "border" : "TOTGOL1A.bmp", "area" : "TZTGOL1A.bmp" }, - { "id" : 33, "defname" : "TBTWDW_3.def", "x" : 613, "y" : 95, "border" : "TOTMAG1.bmp", "area" : "TZTMAG1.bmp" }, - { "id" : 34, "defname" : "TBTWDW_4.def", "x" : 511, "y" : 75, "border" : "TOTGEN1.bmp", "area" : "TZTGEN1.bmp" }, - { "id" : 35, "defname" : "TBTWDW_5.def", "x" : 681, "y" : 208, "border" : "TOTNAG1.bmp", "area" : "TZTNAG1.bmp" }, - { "id" : 36, "defname" : "TBTWDW_6.def", "x" : 75, "y" : 144, "border" : "TOTTIT1.bmp", "area" : "TZTTIT1.bmp" }, - { "id" : 21, "defname" : "TBTWEXT0.def", "x" : 409, "y" : 82, "border" : "TOTCASW.bmp", "area" : "TZTCASW.bmp" }, - { "id" : 22, "defname" : "TBTWEXT1.def", "x" : 702, "y" : 115, "border" : "TOTGLDL.bmp", "area" : "TZTGLDL.bmp" }, - { "id" : 23, "defname" : "TBTWEXT2.def", "x" : 592, "y" : 189, "border" : "TOTGLDW.bmp", "area" : "TZTGLDW.bmp" }, - { "id" : 11, "defname" : "TBTWHAL2.def", "x" : 0, "y" : 220, "border" : "TOTHAL2.bmp", "area" : "TZTHAL2.bmp" }, - { "id" : 12, "defname" : "TBTWHAL3.def", "x" : 0, "y" : 82, "border" : "TOTHAL3.bmp", "area" : "TZTHAL3.bmp" }, - { "id" : 13, "defname" : "TBTWHAL4.def", "x" : 0, "y" : 82, "border" : "TOTHAL4.bmp", "area" : "TZTHAL4.bmp" }, - { "id" : 10, "defname" : "TBTWHALL.def", "x" : 0, "y" : 259, "border" : "TOTHAL1.bmp", "area" : "TZTHAL1.bmp" }, - { "id" : 26, "defname" : "TBTWHOLY.def", "x" : 237, "y" : 14, "border" : "TOTHOLYA.bmp", "area" : "TZTHOLYA.bmp" }, - { "id" : 18, "defname" : "TBTWHRD1.def", "x" : 0, "y" : 47, "border" : "TOTGAR1H.bmp", "area" : "TZTGAR1H.bmp" }, - { "id" : 19, "defname" : "TBTWHRD2.def", "x" : 0, "y" : 28, "border" : "TOTGAR2H.bmp", "area" : "TZTGAR2H.bmp" }, - { "id" : 1, "defname" : "TBTWMAG2.def", "x" : 593, "y" : 65, "border" : "TOTGLD2.bmp", "area" : "TZTGLD2.bmp" }, - { "id" : 2, "defname" : "TBTWMAG3.def", "x" : 593, "y" : 48, "border" : "TOTGLD3.bmp", "area" : "TZTGLD3.bmp" }, - { "id" : 3, "defname" : "TBTWMAG4.def", "x" : 593, "y" : 31, "border" : "TOTGLD4.bmp", "area" : "TZTGLD4.bmp" }, - { "id" : 4, "defname" : "TBTWMAG5.def", "x" : 593, "y" : 14, "border" : "TOTGLD5.bmp", "area" : "TZTGLD5.bmp" }, - { "id" : 0, "defname" : "TBTWMAGE.def", "x" : 597, "y" : 82, "border" : "TOTGLD1.bmp", "area" : "TZTGLD1.bmp" }, - { "id" : 14, "defname" : "TBTWMARK.def", "x" : 614, "y" : 292, "border" : "TOTMRK.bmp", "area" : "TZTMRK.bmp" }, - { "id" : 15, "defname" : "TBTWSILO.def", "x" : 763, "y" : 214, "border" : "TOTMRKS.bmp", "area" : "TZTMRKS.bmp" }, - { "id" : 17, "defname" : "TBTWSPEC.def", "x" : 674, "y" : 276, "border" : "TOTMRKA.bmp", "area" : "TZTMRKA.bmp" }, - { "id" : 5, "defname" : "TBTWTVRN.def", "x" : 375, "y" : 278, "border" : "TOTTAV.bmp", "area" : "TZTTAV.bmp" }, - { "id" : 37, "defname" : "TBTWUP_0.def", "x" : 446, "y" : 221, "border" : "TOTGRM2A.bmp", "area" : "TZTGRM2A.bmp" }, - { "id" : 38, "defname" : "TBTWUP_1.def", "x" : 4, "y" : 28, "border" : "TOTGAR2.bmp", "area" : "TZTGAR2.bmp" }, - { "id" : 39, "defname" : "TBTWUP_2.def", "x" : 209, "y" : 177, "border" : "TOTGOL2A.bmp", "area" : "TZTGOL2A.bmp" }, - { "id" : 40, "defname" : "TBTWUP_3.def", "x" : 613, "y" : 74, "border" : "TOTMAG2.bmp", "area" : "TZTMAG2.bmp" }, - { "id" : 41, "defname" : "TBTWUP_4.def", "x" : 511, "y" : 8, "border" : "TOTGEN2.bmp", "area" : "TZTGEN2.bmp" }, - { "id" : 42, "defname" : "TBTWUP_5.def", "x" : 681, "y" : 157, "border" : "TOTNAG2.bmp", "area" : "TZTNAG2.bmp" }, - { "id" : 43, "defname" : "TBTWUP_6.def", "x" : 75, "y" : 91, "border" : "TOTTIT2.bmp", "area" : "TZTTIT2.bmp" }, - { "id" : 8, "defname" : "TBTWCAS2.def", "x" : 301, "y" : 0, "border" : "TOTCAS2.bmp", "area" : "TZTCAS2.bmp" } - ], - "groups" : - [ - [ 0, 1, 2, 3, 4 ], - [ 6, 20 ], - [ 7, 8, 9 ], - [ 10, 11, 12, 13 ], - [ 30, 37 ], - [ 32, 39 ], - [ 33, 40 ], - [ 34, 41 ], - [ 35, 42 ], - [ 36, 43 ], - [ 18, 19, 31, 38 ] + { "id" : 0, "animation" : "TBTWMAGE.def", "x" : 597, "y" : 82, "border" : "TOTGLD1.bmp", "area" : "TZTGLD1.bmp" }, + { "id" : 1, "animation" : "TBTWMAG2.def", "x" : 593, "y" : 65, "border" : "TOTGLD2.bmp", "area" : "TZTGLD2.bmp" }, + { "id" : 2, "animation" : "TBTWMAG3.def", "x" : 593, "y" : 48, "border" : "TOTGLD3.bmp", "area" : "TZTGLD3.bmp" }, + { "id" : 3, "animation" : "TBTWMAG4.def", "x" : 593, "y" : 31, "border" : "TOTGLD4.bmp", "area" : "TZTGLD4.bmp" }, + { "id" : 4, "animation" : "TBTWMAG5.def", "x" : 593, "y" : 14, "border" : "TOTGLD5.bmp", "area" : "TZTGLD5.bmp" }, + { "id" : 5, "animation" : "TBTWTVRN.def", "x" : 375, "y" : 278, "z" : 1, "border" : "TOTTAV.bmp", "area" : "TZTTAV.bmp" }, + { "id" : 7, "animation" : "TBTWCSTL.def", "x" : 304, "y" : 0, "border" : "TOTCAS1.bmp", "area" : "TZTCAS1.bmp" }, + { "id" : 8, "animation" : "TBTWCAS2.def", "x" : 301, "y" : 0, "border" : "TOTCAS2.bmp", "area" : "TZTCAS2.bmp" }, + { "id" : 9, "animation" : "TBTWCAS3.def", "x" : 301, "y" : 0, "border" : "TOTCAS3.bmp", "area" : "TZTCAS3.bmp" }, + { "id" : 10, "animation" : "TBTWHALL.def", "x" : 0, "y" : 259, "z" : 1, "border" : "TOTHAL1.bmp", "area" : "TZTHAL1.bmp" }, + { "id" : 11, "animation" : "TBTWHAL2.def", "x" : 0, "y" : 220, "z" : 1, "border" : "TOTHAL2.bmp", "area" : "TZTHAL2.bmp" }, + { "id" : 12, "animation" : "TBTWHAL3.def", "x" : 0, "y" : 82, "z" : 1, "border" : "TOTHAL3.bmp", "area" : "TZTHAL3.bmp" }, + { "id" : 13, "animation" : "TBTWHAL4.def", "x" : 0, "y" : 82, "z" : 1, "border" : "TOTHAL4.bmp", "area" : "TZTHAL4.bmp" }, + { "id" : 14, "animation" : "TBTWMARK.def", "x" : 614, "y" : 292, "border" : "TOTMRK.bmp", "area" : "TZTMRK.bmp" }, + { "id" : 15, "animation" : "TBTWSILO.def", "x" : 763, "y" : 214, "z" : 3, "border" : "TOTMRKS.bmp", "area" : "TZTMRKS.bmp" }, + { "id" : 16, "animation" : "TBTWBLAK.def", "x" : 478, "y" : 211, "border" : "TOTBLKA.bmp", "area" : "TZTBLKA.bmp" }, + { "id" : 17, "animation" : "TBTWSPEC.def", "x" : 674, "y" : 276, "z" : 2, "border" : "TOTMRKA.bmp", "area" : "TZTMRKA.bmp" }, + { "id" : 18, "animation" : "TBTWHRD1.def", "x" : 0, "y" : 47, "border" : "TOTGAR1H.bmp", "area" : "TZTGAR1H.bmp", "hidden" : true }, + { "id" : 19, "animation" : "TBTWHRD2.def", "x" : 0, "y" : 28, "border" : "TOTGAR2H.bmp", "area" : "TZTGAR2H.bmp", "hidden" : true, "builds" : 18 }, + { "id" : 21, "animation" : "TBTWEXT0.def", "x" : 409, "y" : 82, "border" : "TOTCASW.bmp", "area" : "TZTCASW.bmp" }, + { "id" : 22, "animation" : "TBTWEXT1.def", "x" : 702, "y" : 115, "border" : "TOTGLDL.bmp", "area" : "TZTGLDL.bmp" }, + { "id" : 23, "animation" : "TBTWEXT2.def", "x" : 592, "y" : 189, "z" : 1, "border" : "TOTGLDW.bmp", "area" : "TZTGLDW.bmp" }, + { "id" : 26, "animation" : "TBTWHOLY.def", "x" : 237, "y" : 14, "z" : -1, "border" : "TOTHOLYA.bmp", "area" : "TZTHOLYA.bmp" }, + { "id" : 30, "animation" : "TBTWDW_0.def", "x" : 453, "y" : 221, "z" : 1, "border" : "TOTGRM1A.bmp", "area" : "TZTGRM1A.bmp" }, + { "id" : 31, "animation" : "TBTWDW_1.def", "x" : 4, "y" : 46, "border" : "TOTGAR1.bmp", "area" : "TZTGAR1.bmp" }, + { "id" : 32, "animation" : "TBTWDW_2.def", "x" : 209, "y" : 177, "z" : 1, "border" : "TOTGOL1A.bmp", "area" : "TZTGOL1A.bmp" }, + { "id" : 33, "animation" : "TBTWDW_3.def", "x" : 613, "y" : 95, "border" : "TOTMAG1.bmp", "area" : "TZTMAG1.bmp" }, + { "id" : 34, "animation" : "TBTWDW_4.def", "x" : 511, "y" : 75, "border" : "TOTGEN1.bmp", "area" : "TZTGEN1.bmp" }, + { "id" : 35, "animation" : "TBTWDW_5.def", "x" : 681, "y" : 208, "z" : 2, "border" : "TOTNAG1.bmp", "area" : "TZTNAG1.bmp" }, + { "id" : 36, "animation" : "TBTWDW_6.def", "x" : 75, "y" : 144, "z" : -1, "border" : "TOTTIT1.bmp", "area" : "TZTTIT1.bmp" }, + { "id" : 37, "animation" : "TBTWUP_0.def", "x" : 446, "y" : 221, "z" : 1, "border" : "TOTGRM2A.bmp", "area" : "TZTGRM2A.bmp" }, + { "id" : 38, "animation" : "TBTWUP_1.def", "x" : 4, "y" : 28, "border" : "TOTGAR2.bmp", "area" : "TZTGAR2.bmp" }, + { "id" : 39, "animation" : "TBTWUP_2.def", "x" : 209, "y" : 177, "z" : 1, "border" : "TOTGOL2A.bmp", "area" : "TZTGOL2A.bmp" }, + { "id" : 40, "animation" : "TBTWUP_3.def", "x" : 613, "y" : 74, "border" : "TOTMAG2.bmp", "area" : "TZTMAG2.bmp" }, + { "id" : 41, "animation" : "TBTWUP_4.def", "x" : 511, "y" : 8, "border" : "TOTGEN2.bmp", "area" : "TZTGEN2.bmp" }, + { "id" : 42, "animation" : "TBTWUP_5.def", "x" : 681, "y" : 157, "z" : 2, "border" : "TOTNAG2.bmp", "area" : "TZTNAG2.bmp" }, + { "id" : 43, "animation" : "TBTWUP_6.def", "x" : 75, "y" : 91, "z" : -1, "border" : "TOTTIT2.bmp", "area" : "TZTTIT2.bmp" } ], + "musicTheme" : "music/TowerTown", + + "townBackground": "TBTWBACK.bmp", + "guildWindow": "TPMAGETW.bmp", + "buildingsIcons": "HALLTOWR.DEF", "hallBackground": "TPTHBKTW.BMP", "hallSlots": [ @@ -304,38 +306,40 @@ [ [ 30, 37 ], [ 31, 38 ], [ 32, 39 ], [ 33, 40 ] ], [ [ 34, 41 ], [ 35, 42 ], [ 36, 43 ] ] ], - "blit_order" : [ 36, 43, 32, 39, 10, 11, 12, 13, 32, 35, 42, 15, 5, 18, 19 ], "creatures" : [ [28, 29], [30, 31], [32, 33], [34, 35], [36, 37], [38, 39], [40, 41] ], "horde" : [ 1, -1 ], - "primary_resource" : 5, - "mage_guild" : 5, - "war_machine" : 5, + "primaryResource" : 5, + "mageGuild" : 5, + "warMachine" : 5, "buildings" : [ { "id" : 0 }, - { "id" : 1, "requires" : [ 0 ] }, - { "id" : 2, "requires" : [ 1 ] }, - { "id" : 3, "requires" : [ 2 ] }, - { "id" : 4, "requires" : [ 3 ] }, + { "id" : 1, "upgrades" : 0 }, + { "id" : 2, "upgrades" : 1 }, + { "id" : 3, "upgrades" : 2 }, + { "id" : 4, "upgrades" : 3 }, { "id" : 5 }, { "id" : 7 }, - { "id" : 8, "requires" : [ 7 ] }, - { "id" : 9, "requires" : [ 8 ] }, - { "id" : 10 }, - { "id" : 11, "requires" : [ 10, 5 ] }, - { "id" : 12, "requires" : [ 11, 0, 14, 16 ] }, - { "id" : 13, "requires" : [ 12, 9 ] }, + { "id" : 8, "upgrades" : 7 }, + { "id" : 9, "upgrades" : 8 }, + { "id" : 10, "mode" : "auto" }, + { "id" : 11, "upgrades" : 10, "requires" : [ 5 ] }, + { "id" : 12, "upgrades" : 11, "requires" : [ 0, 14, 16 ] }, + { "id" : 13, "upgrades" : 12, "requires" : [ 9 ] }, { "id" : 14 }, { "id" : 15, "requires" : [ 14 ] }, { "id" : 16 }, { "id" : 17, "requires" : [ 14 ] }, - { "id" : 18, "requires" : [ 31 ] }, - { "id" : 19, "requires" : [ 38 ] }, + { "id" : 18, "upgrades" : 31 }, + { "id" : 19, "upgrades" : 38, "requires" : [ 18 ], "mode" : "auto" }, { "id" : 21, "requires" : [ 7 ] }, { "id" : 22, "requires" : [ 0 ] }, { "id" : 23, "requires" : [ 0 ] }, - { "id" : 26 }, + { "id" : 26, "mode" : "grail"}, + { "id" : 27, "requires" : [ 11 ], "mode" : "auto" }, + { "id" : 28, "requires" : [ 12 ], "mode" : "auto" }, + { "id" : 29, "requires" : [ 13 ], "mode" : "auto" }, { "id" : 30, "requires" : [ 7 ] }, { "id" : 31, "requires" : [ 30 ] }, { "id" : 32, "requires" : [ 30 ] }, @@ -343,74 +347,73 @@ { "id" : 34, "requires" : [ 33 ] }, { "id" : 35, "requires" : [ 33 ] }, { "id" : 36, "requires" : [ 34, 35 ] }, - { "id" : 37, "requires" : [ 30 ] }, - { "id" : 38, "requires" : [ 31 ] }, - { "id" : 39, "requires" : [ 32 ] }, - { "id" : 40, "requires" : [ 33, 22 ] }, - { "id" : 41, "requires" : [ 34 ] }, - { "id" : 42, "requires" : [ 35 ] }, - { "id" : 43, "requires" : [ 36 ] } + { "id" : 37, "upgrades" : 30 }, + { "id" : 38, "upgrades" : 31 }, + { "id" : 39, "upgrades" : 32 }, + { "id" : 40, "upgrades" : 33, "requires" : [ 22 ] }, + { "id" : 41, "upgrades" : 34 }, + { "id" : 42, "upgrades" : 35 }, + { "id" : 43, "upgrades" : 36 } ] - }, - + } + }, + "inferno" : + { + "index" : 3, + "nativeTerrain": "lava", + "creatureBackground" : + { + "120px" : "TPCASINF", + "130px" : "CRBKGINF" + }, + "town" : { - // 3 - Inferno "structures" : [ - { "id" : 16, "defname" : "TBINBLAK.def", "x" : 684, "y" : 253, "border" : "TOIBLKA.bmp", "area" : "TZIBLKA.bmp" }, - { "id" : 9, "defname" : "TBINCAS3.def", "x" : 222, "y" : 18, "border" : "TOICAS3A.bmp", "area" : "TZICAS3A.bmp" }, - { "id" : 7, "defname" : "TBINCSTL.def", "x" : 222, "y" : 44, "border" : "TOICAS2A.bmp", "area" : "TZICAS2A.bmp" }, - { "id" : 30, "defname" : "TBINDW_0.def", "x" : 614, "y" : 256, "border" : "TOIMP1A.bmp", "area" : "TZIMP1A.bmp" }, - { "id" : 31, "defname" : "TBINDW_1.def", "x" : 187, "y" : 248, "border" : "TOIGOG1A.bmp", "area" : "TZIGOG1A.bmp" }, - { "id" : 32, "defname" : "TBINDW_2.def", "x" : 9, "y" : 325, "border" : "TOIHND1.bmp", "area" : "TZIHND1.bmp" }, - { "id" : 33, "defname" : "TBINDW_3.def", "x" : 414, "y" : 204, "border" : "TOIDMN1.bmp", "area" : "TZIDMN1.bmp" }, - { "id" : 34, "defname" : "TBINDW_4.def", "x" : 359, "y" : 296, "border" : "TOIPIT1.bmp", "area" : "TZIPIT1.bmp" }, - { "id" : 35, "defname" : "TBINDW_5.def", "x" : 220, "y" : 350, "border" : "TOIEFR1.bmp", "area" : "TZIEFR1.bmp" }, - { "id" : 36, "defname" : "TBINDW_6.def", "x" : 420, "y" : 153, "border" : "TOIDVL1.bmp", "area" : "TZIDVL1.bmp" }, - { "id" : 21, "defname" : "TBINEXT0.def", "x" : 297, "y" : 0, "border" : "TOICAB1A.bmp", "area" : "TZICAB1A.bmp" }, - { "id" : 22, "defname" : "TBINEXT1.def", "x" : 227, "y" : 174, "border" : "TOICASGA.bmp", "area" : "TZICASGA.bmp" }, - { "id" : 23, "defname" : "TBINEXT2.def", "x" : 593, "y" : 104, "border" : "TOIPAIN.bmp", "area" : "TZIPAIN.bmp" }, - { "id" : 11, "defname" : "TBINHAL2.def", "x" : 0, "y" : 174, "border" : "TOIHAL2.bmp", "area" : "TZIHAL2.bmp" }, - { "id" : 12, "defname" : "TBINHAL3.def", "x" : 0, "y" : 174, "border" : "TOIHAL3.bmp", "area" : "TZIHAL3.bmp" }, - { "id" : 13, "defname" : "TBINHAL4.def", "x" : 0, "y" : 131, "border" : "TOIHAL4.bmp", "area" : "TZIHAL4.bmp" }, - { "id" : 10, "defname" : "TBINHALL.def", "x" : 0, "y" : 174, "border" : "TOIHAL1.bmp", "area" : "TZIHAL1.bmp" }, - { "id" : 26, "defname" : "TBINHOLY.def", "x" : 24, "y" : 10, "border" : "TOIHOLY.bmp", "area" : "TZIHOLY.bmp" }, - { "id" : 18, "defname" : "TBINHRD1.def", "x" : 614, "y" : 256, "border" : "TOIMP1HA.bmp", "area" : "TZIMP1HA.bmp" }, - { "id" : 19, "defname" : "TBINHRD2.def", "x" : 614, "y" : 221, "border" : "TOIMP2HA.bmp", "area" : "TZIMP2HA.bmp" }, - { "id" : 24, "defname" : "TBINHRD3.def", "x" : 10, "y" : 301, "border" : "TOIHND1H.bmp", "area" : "TZIHND1H.bmp" }, - { "id" : 25, "defname" : "TBINHRD4.def", "x" : 9, "y" : 273, "border" : "TOIHND2H.bmp", "area" : "TZIHND2H.bmp" }, - { "id" : 1, "defname" : "TBINMAG2.def", "x" : 667, "y" : 101, "border" : "TOIMAG2A.bmp", "area" : "TZIMAG2A.bmp" }, - { "id" : 2, "defname" : "TBINMAG3.def", "x" : 667, "y" : 83, "border" : "TOIMAG3A.bmp", "area" : "TZIMAG3A.bmp" }, - { "id" : 3, "defname" : "TBINMAG4.def", "x" : 667, "y" : 56, "border" : "TOIMAG4A.bmp", "area" : "TZIMAG4A.bmp" }, - { "id" : 4, "defname" : "TBINMAG5.def", "x" : 667, "y" : 35, "border" : "TOIMAG5A.bmp", "area" : "TZIMAG5A.bmp" }, - { "id" : 0, "defname" : "TBINMAGE.def", "x" : 667, "y" : 127, "border" : "TOIMAG1A.bmp", "area" : "TZIMAG1A.bmp" }, - { "id" : 14, "defname" : "TBINMARK.def", "x" : 511, "y" : 301, "border" : "TOIMAR1.bmp", "area" : "TZIMAR1.bmp" }, - { "id" : 15, "defname" : "TBINSILO.def", "x" : 497, "y" : 337, "border" : "TOIMAR2.bmp", "area" : "TZIMAR2.bmp" }, - { "id" : 5, "defname" : "TBINTVRN.def", "x" : 105, "y" : 219, "border" : "TOITAV.bmp", "area" : "TZITAV.bmp" }, - { "id" : 37, "defname" : "TBINUP_0.def", "x" : 614, "y" : 221, "border" : "TOIMP2A.bmp", "area" : "TZIMP2A.bmp" }, - { "id" : 38, "defname" : "TBINUP_1.def", "x" : 187, "y" : 212, "border" : "TOIGOG2A.bmp", "area" : "TZIGOG2A.bmp" }, - { "id" : 39, "defname" : "TBINUP_2.def", "x" : 9, "y" : 273, "border" : "TOIHND2.bmp", "area" : "TZIHND2.bmp" }, - { "id" : 40, "defname" : "TBINUP_3.def", "x" : 412, "y" : 197, "border" : "TOIDMN2.bmp", "area" : "TZIDMN2.bmp" }, - { "id" : 41, "defname" : "TBINUP_4.def", "x" : 359, "y" : 244, "border" : "TOIPIT2.bmp", "area" : "TZIPIT2.bmp" }, - { "id" : 42, "defname" : "TBINUP_5.def", "x" : 220, "y" : 282, "border" : "TOIEFR2.bmp", "area" : "TZIEFR2.bmp" }, - { "id" : 43, "defname" : "TBINUP_6.def", "x" : 420, "y" : 105, "border" : "TOIDVL2.bmp", "area" : "TZIDVL2.bmp" }, - { "id" : 8, "defname" : "TBINCAS2.def", "x" : 222, "y" : 44, "border" : "TOICAS1A.bmp", "area" : "TZICAS1A.bmp" } - ], - "groups" : - [ - [ 0, 1, 2, 3, 4 ], - [ 6, 20 ], - [ 7, 8, 9 ], - [ 10, 11, 12, 13 ], - [ 30, 37 ], - [ 31, 38 ], - [ 33, 40 ], - [ 34, 41 ], - [ 35, 42 ], - [ 36, 43 ], - [ 18, 19, 30, 37 ], - [ 32, 39, 24, 25 ] + { "id" : 0, "animation" : "TBINMAGE.def", "x" : 667, "y" : 127, "border" : "TOIMAG1A.bmp", "area" : "TZIMAG1A.bmp" }, + { "id" : 1, "animation" : "TBINMAG2.def", "x" : 667, "y" : 101, "border" : "TOIMAG2A.bmp", "area" : "TZIMAG2A.bmp" }, + { "id" : 2, "animation" : "TBINMAG3.def", "x" : 667, "y" : 83, "border" : "TOIMAG3A.bmp", "area" : "TZIMAG3A.bmp" }, + { "id" : 3, "animation" : "TBINMAG4.def", "x" : 667, "y" : 56, "border" : "TOIMAG4A.bmp", "area" : "TZIMAG4A.bmp" }, + { "id" : 4, "animation" : "TBINMAG5.def", "x" : 667, "y" : 35, "border" : "TOIMAG5A.bmp", "area" : "TZIMAG5A.bmp" }, + { "id" : 5, "animation" : "TBINTVRN.def", "x" : 105, "y" : 219, "z" : 1, "border" : "TOITAV.bmp", "area" : "TZITAV.bmp" }, + { "id" : 7, "animation" : "TBINCSTL.def", "x" : 222, "y" : 44, "border" : "TOICAS2A.bmp", "area" : "TZICAS2A.bmp" }, + { "id" : 8, "animation" : "TBINCAS2.def", "x" : 222, "y" : 44, "border" : "TOICAS1A.bmp", "area" : "TZICAS1A.bmp" }, + { "id" : 9, "animation" : "TBINCAS3.def", "x" : 222, "y" : 18, "border" : "TOICAS3A.bmp", "area" : "TZICAS3A.bmp" }, + { "id" : 10, "animation" : "TBINHALL.def", "x" : 0, "y" : 174, "border" : "TOIHAL1.bmp", "area" : "TZIHAL1.bmp" }, + { "id" : 11, "animation" : "TBINHAL2.def", "x" : 0, "y" : 174, "border" : "TOIHAL2.bmp", "area" : "TZIHAL2.bmp" }, + { "id" : 12, "animation" : "TBINHAL3.def", "x" : 0, "y" : 174, "border" : "TOIHAL3.bmp", "area" : "TZIHAL3.bmp" }, + { "id" : 13, "animation" : "TBINHAL4.def", "x" : 0, "y" : 131, "border" : "TOIHAL4.bmp", "area" : "TZIHAL4.bmp" }, + { "id" : 14, "animation" : "TBINMARK.def", "x" : 511, "y" : 301, "z" : 4, "border" : "TOIMAR1.bmp", "area" : "TZIMAR1.bmp" }, + { "id" : 15, "animation" : "TBINSILO.def", "x" : 497, "y" : 337, "z" : 5, "border" : "TOIMAR2.bmp", "area" : "TZIMAR2.bmp" }, + { "id" : 16, "animation" : "TBINBLAK.def", "x" : 684, "y" : 253, "z" : 1, "border" : "TOIBLKA.bmp", "area" : "TZIBLKA.bmp" }, + { "id" : 18, "animation" : "TBINHRD1.def", "x" : 614, "y" : 256, "border" : "TOIMP1HA.bmp", "area" : "TZIMP1HA.bmp", "hidden" : true }, + { "id" : 19, "animation" : "TBINHRD2.def", "x" : 614, "y" : 221, "border" : "TOIMP2HA.bmp", "area" : "TZIMP2HA.bmp", "hidden" : true, "builds" : 18 }, + { "id" : 21, "animation" : "TBINEXT0.def", "x" : 297, "y" : 0, "z" : -1, "border" : "TOICAB1A.bmp", "area" : "TZICAB1A.bmp" }, + { "id" : 22, "animation" : "TBINEXT1.def", "x" : 227, "y" : 174, "z" : 2, "border" : "TOICASGA.bmp", "area" : "TZICASGA.bmp" }, + { "id" : 23, "animation" : "TBINEXT2.def", "x" : 593, "y" : 104, "border" : "TOIPAIN.bmp", "area" : "TZIPAIN.bmp" }, + { "id" : 24, "animation" : "TBINHRD3.def", "x" : 10, "y" : 301, "border" : "TOIHND1H.bmp", "area" : "TZIHND1H.bmp", "hidden" : true }, + { "id" : 25, "animation" : "TBINHRD4.def", "x" : 9, "y" : 273, "border" : "TOIHND2H.bmp", "area" : "TZIHND2H.bmp", "hidden" : true, "builds" : 24 }, + { "id" : 26, "animation" : "TBINHOLY.def", "x" : 24, "y" : 10, "z" : -1, "border" : "TOIHOLY.bmp", "area" : "TZIHOLY.bmp" }, + { "id" : 30, "animation" : "TBINDW_0.def", "x" : 614, "y" : 256, "border" : "TOIMP1A.bmp", "area" : "TZIMP1A.bmp" }, + { "id" : 31, "animation" : "TBINDW_1.def", "x" : 187, "y" : 248, "z" : 4, "border" : "TOIGOG1A.bmp", "area" : "TZIGOG1A.bmp" }, + { "id" : 32, "animation" : "TBINDW_2.def", "x" : 9, "y" : 325, "border" : "TOIHND1.bmp", "area" : "TZIHND1.bmp" }, + { "id" : 33, "animation" : "TBINDW_3.def", "x" : 414, "y" : 204, "z" : 2, "border" : "TOIDMN1.bmp", "area" : "TZIDMN1.bmp" }, + { "id" : 34, "animation" : "TBINDW_4.def", "x" : 359, "y" : 296, "z" : 3, "border" : "TOIPIT1.bmp", "area" : "TZIPIT1.bmp" }, + { "id" : 35, "animation" : "TBINDW_5.def", "x" : 220, "y" : 350, "z" : 5, "border" : "TOIEFR1.bmp", "area" : "TZIEFR1.bmp" }, + { "id" : 36, "animation" : "TBINDW_6.def", "x" : 420, "y" : 153, "z" : -1, "border" : "TOIDVL1.bmp", "area" : "TZIDVL1.bmp" }, + { "id" : 37, "animation" : "TBINUP_0.def", "x" : 614, "y" : 221, "border" : "TOIMP2A.bmp", "area" : "TZIMP2A.bmp" }, + { "id" : 38, "animation" : "TBINUP_1.def", "x" : 187, "y" : 212, "z" : 4, "border" : "TOIGOG2A.bmp", "area" : "TZIGOG2A.bmp" }, + { "id" : 39, "animation" : "TBINUP_2.def", "x" : 9, "y" : 273, "border" : "TOIHND2.bmp", "area" : "TZIHND2.bmp" }, + { "id" : 40, "animation" : "TBINUP_3.def", "x" : 412, "y" : 197, "z" : 2, "border" : "TOIDMN2.bmp", "area" : "TZIDMN2.bmp" }, + { "id" : 41, "animation" : "TBINUP_4.def", "x" : 359, "y" : 244, "z" : 3, "border" : "TOIPIT2.bmp", "area" : "TZIPIT2.bmp" }, + { "id" : 42, "animation" : "TBINUP_5.def", "x" : 220, "y" : 282, "z" : 5, "border" : "TOIEFR2.bmp", "area" : "TZIEFR2.bmp" }, + { "id" : 43, "animation" : "TBINUP_6.def", "x" : 420, "y" : 105, "z" : -1, "border" : "TOIDVL2.bmp", "area" : "TZIDVL2.bmp" } ], + "musicTheme" : "music/InfernoTown", + + "townBackground": "TBINBACK.bmp", + "guildWindow": "TPMAGEIN.bmp", + "buildingsIcons": "HALLINFR.DEF", "hallBackground": "TPTHBKIN.BMP", "hallSlots": [ @@ -420,38 +423,41 @@ [ [ 30, 37 ], [ 31, 38 ], [ 32, 39 ], [ 33, 40 ] ], [ [ 34, 41 ], [ 35, 42 ], [ 36, 43 ] ] ], - "blit_order" : [ 26, 21, 7, 8, 9, 22, 31, 38, 36, 43, 10, 11, 12, 13, 5, 32, 39, 24, 25, 33, 40, 34, 41, 30, 37, 18, 19, 14, 15, 16, 35, 42 ], "creatures" : [ [42, 43], [44, 45], [46, 47], [48, 49], [50, 51], [52, 53], [54, 55] ], "horde" : [ 0, 2 ], - "mage_guild" : 5, - "primary_resource" : 1, - "war_machine" : 5, + "mageGuild" : 5, + "primaryResource" : 1, + "warMachine" : 5, "buildings" : [ { "id" : 0 }, - { "id" : 1, "requires" : [ 0 ] }, - { "id" : 2, "requires" : [ 1 ] }, - { "id" : 3, "requires" : [ 2 ] }, - { "id" : 4, "requires" : [ 3 ] }, + { "id" : 1, "upgrades" : 0 }, + { "id" : 2, "upgrades" : 1 }, + { "id" : 3, "upgrades" : 2 }, + { "id" : 4, "upgrades" : 3 }, { "id" : 5 }, { "id" : 7 }, - { "id" : 8, "requires" : [ 7 ] }, - { "id" : 9, "requires" : [ 8 ] }, - { "id" : 10 }, - { "id" : 11, "requires" : [ 10, 5 ] }, - { "id" : 12, "requires" : [ 11, 0, 14, 16 ] }, - { "id" : 13, "requires" : [ 12, 9 ] }, + { "id" : 8, "upgrades" : 7 }, + { "id" : 9, "upgrades" : 8 }, + { "id" : 10, "mode" : "auto" }, + { "id" : 11, "upgrades" : 10, "requires" : [ 5 ] }, + { "id" : 12, "upgrades" : 11, "requires" : [ 0, 14, 16 ] }, + { "id" : 13, "upgrades" : 12, "requires" : [ 9 ] }, { "id" : 14 }, { "id" : 15, "requires" : [ 14 ] }, { "id" : 16 }, - { "id" : 18, "requires" : [ 30 ] }, - { "id" : 19, "requires" : [ 37 ] }, + { "id" : 18, "upgrades" : 30 }, + { "id" : 19, "upgrades" : 37, "requires" : [ 18, 19 ], "mode" : "auto" }, { "id" : 21, "requires" : [ 7 ] }, { "id" : 22, "requires" : [ 8 ] }, { "id" : 23, "requires" : [ 0 ] }, - { "id" : 24, "requires" : [ 32 ] }, - { "id" : 25, "requires" : [ 39 ] }, + { "id" : 24, "upgrades" : 32 }, + { "id" : 25, "upgrades" : 39, "requires" : [ 24, 25 ], "mode" : "auto" }, + { "id" : 26, "mode" : "grail"}, + { "id" : 27, "requires" : [ 11 ], "mode" : "auto" }, + { "id" : 28, "requires" : [ 12 ], "mode" : "auto" }, + { "id" : 29, "requires" : [ 13 ], "mode" : "auto" }, { "id" : 26 }, { "id" : 30, "requires" : [ 7 ] }, { "id" : 31, "requires" : [ 30 ] }, @@ -460,77 +466,77 @@ { "id" : 34, "requires" : [ 33 ] }, { "id" : 35, "requires" : [ 0, 33 ] }, { "id" : 36, "requires" : [ 34, 35 ] }, - { "id" : 37, "requires" : [ 30 ] }, - { "id" : 38, "requires" : [ 31 ] }, - { "id" : 39, "requires" : [ 32 ] }, - { "id" : 40, "requires" : [ 33 ] }, - { "id" : 41, "requires" : [ 34, 1 ] }, - { "id" : 42, "requires" : [ 35 ] }, - { "id" : 43, "requires" : [ 36 ] } + { "id" : 37, "upgrades" : 30 }, + { "id" : 38, "upgrades" : 31 }, + { "id" : 39, "upgrades" : 32 }, + { "id" : 40, "upgrades" : 33 }, + { "id" : 41, "upgrades" : 34, "requires" : [ 1 ] }, + { "id" : 42, "upgrades" : 35 }, + { "id" : 43, "upgrades" : 36 } ] - }, - + } + }, + "necropolis" : + { + "index" : 4, + "nativeTerrain": "dirt", + "creatureBackground" : + { + "120px" : "TPCASNEC", + "130px" : "CRBKGNEC" + }, + "town" : { - // 4 - Necropolis "structures" : [ - { "id" : 16, "defname" : "TBNCBLAK.def", "x" : 382, "y" : 252, "border" : "TONSMITA.bmp", "area" : "TZNSMITA.bmp" }, - { "id" : 8, "defname" : "TBNCCAS2.def", "x" : 139, "y" : 66, "border" : "TONCAS2.bmp", "area" : "TZNCAS2.bmp" }, - { "id" : 9, "defname" : "TBNCCAS3.def", "x" : 34, "y" : 18, "border" : "TONCAS3.bmp", "area" : "TZNCAS3.bmp" }, - { "id" : 7, "defname" : "TBNCCSTL.def", "x" : 138, "y" : 66, "border" : "TONCAS1.bmp", "area" : "TZNCAS1.bmp" }, - { "id" : 6, "defname" : "TBNCDOCK.def", "x" : 617, "y" : 265, "border" : "TONSHPBA.bmp", "area" : "TZNSHPBA.bmp" }, - { "id" : 30, "defname" : "TBNCDW_0.def", "x" : 80, "y" : 222, "border" : "TONSKEL1.bmp", "area" : "TZNSKEL1.bmp" }, - { "id" : 31, "defname" : "TBNCDW_1.def", "x" : 502, "y" : 223, "border" : "TONZOMB1.bmp", "area" : "TZNZOMB1.bmp" }, - { "id" : 32, "defname" : "TBNCDW_2.def", "x" : 0, "y" : 187, "border" : "TONWIGH1.bmp", "area" : "TZNWIGH1.bmp" }, - { "id" : 33, "defname" : "TBNCDW_3.def", "x" : 607, "y" : 212, "border" : "TONVAM1.bmp", "area" : "TZNVAM1.bmp" }, - { "id" : 34, "defname" : "TBNCDW_4.def", "x" : 206, "y" : 207, "border" : "TONLICH1.bmp", "area" : "TZNLICH1.bmp" }, - { "id" : 35, "defname" : "TBNCDW_5.def", "x" : 0, "y" : 31, "border" : "TONBKN1.bmp", "area" : "TZNBKN1.bmp" }, - { "id" : 36, "defname" : "TBNCDW_6.def", "x" : 663, "y" : 25, "border" : "TONBON1.bmp", "area" : "TZNBON1.bmp" }, - { "id" : 21, "defname" : "TBNCEXT0.def", "x" : 307, "y" : 61, "border" : "TONNECRA.bmp", "area" : "TZNNECRA.bmp" }, - { "id" : 22, "defname" : "TBNCEXT1.def", "x" : 247, "y" : 275, "border" : "TONSKELT.bmp", "area" : "TZNSKELT.bmp" }, - { "id" : -1, "defname" : "TBNCEXT2.def", "x" : 25, "y" : 279 }, - { "id" : 27, "defname" : "TBNCEXT3.def", "x" : 0, "y" : 241 }, - { "id" : 28, "defname" : "TBNCEXT4.def", "x" : 321, "y" : 255 }, - { "id" : 29, "defname" : "TBNCEXT5.def", "x" : 475, "y" : 257 }, - { "id" : 11, "defname" : "TBNCHAL2.def", "x" : 482, "y" : 56, "border" : "TONHAL2.bmp", "area" : "TZNHAL2.bmp" }, - { "id" : 12, "defname" : "TBNCHAL3.def", "x" : 478, "y" : 26, "border" : "TONHAL3.bmp", "area" : "TZNHAL3.bmp" }, - { "id" : 13, "defname" : "TBNCHAL4.def", "x" : 481, "y" : 26, "border" : "TONHAL4.bmp", "area" : "TZNHAL4.bmp" }, - { "id" : 10, "defname" : "TBNCHALL.def", "x" : 468, "y" : 76, "border" : "TONHAL1.bmp", "area" : "TZNHAL1.bmp" }, - { "id" : 26, "defname" : "TBNCHOLY.def", "x" : 410, "y" : 88, "border" : "TONHOLYA.bmp", "area" : "TZNHOLYA.bmp" }, - { "id" : 18, "defname" : "TBNCHRD1.def", "x" : 80, "y" : 222, "border" : "TONSKE1H.bmp", "area" : "TZNSKE1H.bmp" }, - { "id" : 19, "defname" : "TBNCHRD2.def", "x" : 64, "y" : 222, "border" : "TONSKE2H.bmp", "area" : "TZNSKE2H.bmp" }, - { "id" : 1, "defname" : "TBNCMAG2.def", "x" : 341, "y" : 97, "border" : "TONMAG2.bmp", "area" : "TZNMAG2.bmp" }, - { "id" : 2, "defname" : "TBNCMAG3.def", "x" : 341, "y" : 78, "border" : "TONMAG3.bmp", "area" : "TZNMAG3.bmp" }, - { "id" : 3, "defname" : "TBNCMAG4.def", "x" : 340, "y" : 62, "border" : "TONMAG4.bmp", "area" : "TZNMAG4.bmp" }, - { "id" : 4, "defname" : "TBNCMAG5.def", "x" : 343, "y" : 35, "border" : "TONMAG5.bmp", "area" : "TZNMAG5.bmp" }, - { "id" : 0, "defname" : "TBNCMAGE.def", "x" : 341, "y" : 116, "border" : "TONMAG1.bmp", "area" : "TZNMAG1.bmp" }, - { "id" : 14, "defname" : "TBNCMARK.def", "x" : 347, "y" : 215, "border" : "TONMRK1.bmp", "area" : "TZNMRK1.bmp" }, - { "id" : 15, "defname" : "TBNCSILO.def", "x" : 276, "y" : 185, "border" : "TONMRK2.bmp", "area" : "TZNMRK2.bmp" }, - { "id" : 17, "defname" : "TBNCSPEC.def", "x" : 18, "y" : 0, "border" : "TONSHRDA.bmp", "area" : "TZNSHRDA.bmp" }, - { "id" : 5, "defname" : "TBNCTVRN.def", "x" : 508, "y" : 189, "border" : "TONTAV.bmp", "area" : "TZNTAV.bmp" }, - { "id" : 37, "defname" : "TBNCUP_0.def", "x" : 64, "y" : 222, "border" : "TONSKEL2.bmp", "area" : "TZNSKEL2.bmp" }, - { "id" : 38, "defname" : "TBNCUP_1.def", "x" : 498, "y" : 224, "border" : "TONZOMB2.bmp", "area" : "TZNZOMB2.bmp" }, - { "id" : 39, "defname" : "TBNCUP_2.def", "x" : 0, "y" : 179, "border" : "TONWIGH2.bmp", "area" : "TZNWIGH2.bmp" }, - { "id" : 40, "defname" : "TBNCUP_3.def", "x" : 615, "y" : 193, "border" : "TONVAM2.bmp", "area" : "TZNVAM2.bmp" }, - { "id" : 41, "defname" : "TBNCUP_4.def", "x" : 222, "y" : 171, "border" : "TONLICH2.bmp", "area" : "TZNLICH2.bmp" }, - { "id" : 42, "defname" : "TBNCUP_5.def", "x" : 0, "y" : 30, "border" : "TONBKN2.bmp", "area" : "TZNBKN2.bmp" }, - { "id" : 43, "defname" : "TBNCUP_6.def", "x" : 662, "y" : 23, "border" : "TONBON2.bmp", "area" : "TZNBON2.bmp" }, - { "id" : 20, "defname" : "TBNCBOAT.def", "x" : 617, "y" : 265, "border" : "TONSHPNA.bmp", "area" : "TZNSHPNA.bmp" } - ], - "groups" : - [ - [ 0, 1, 2, 3, 4 ], - [ 6, 20 ], - [ 7, 8, 9 ], - [ 10, 11, 12, 13 ], - [ 31, 38 ], - [ 32, 39 ], - [ 33, 40 ], - [ 34, 41 ], - [ 35, 42 ], - [ 36, 43 ], - [ 30, 37, 18, 19 ] + { "animation" : "TBNCEXT2.def", "x" : 25, "y" : 279 }, + { "id" : 0, "animation" : "TBNCMAGE.def", "x" : 341, "y" : 116, "z" : -1, "border" : "TONMAG1.bmp", "area" : "TZNMAG1.bmp" }, + { "id" : 1, "animation" : "TBNCMAG2.def", "x" : 341, "y" : 97, "z" : -1, "border" : "TONMAG2.bmp", "area" : "TZNMAG2.bmp" }, + { "id" : 2, "animation" : "TBNCMAG3.def", "x" : 341, "y" : 78, "z" : -1, "border" : "TONMAG3.bmp", "area" : "TZNMAG3.bmp" }, + { "id" : 3, "animation" : "TBNCMAG4.def", "x" : 340, "y" : 62, "z" : -1, "border" : "TONMAG4.bmp", "area" : "TZNMAG4.bmp" }, + { "id" : 4, "animation" : "TBNCMAG5.def", "x" : 343, "y" : 35, "z" : -1, "border" : "TONMAG5.bmp", "area" : "TZNMAG5.bmp" }, + { "id" : 5, "animation" : "TBNCTVRN.def", "x" : 508, "y" : 189, "border" : "TONTAV.bmp", "area" : "TZNTAV.bmp" }, + { "id" : 6, "animation" : "TBNCDOCK.def", "x" : 617, "y" : 265, "z" : -2, "border" : "TONSHPBA.bmp", "area" : "TZNSHPBA.bmp" }, + { "id" : 7, "animation" : "TBNCCSTL.def", "x" : 138, "y" : 66, "border" : "TONCAS1.bmp", "area" : "TZNCAS1.bmp" }, + { "id" : 8, "animation" : "TBNCCAS2.def", "x" : 139, "y" : 66, "border" : "TONCAS2.bmp", "area" : "TZNCAS2.bmp" }, + { "id" : 9, "animation" : "TBNCCAS3.def", "x" : 34, "y" : 18, "border" : "TONCAS3.bmp", "area" : "TZNCAS3.bmp" }, + { "id" : 10, "animation" : "TBNCHALL.def", "x" : 468, "y" : 76, "z" : -1, "border" : "TONHAL1.bmp", "area" : "TZNHAL1.bmp" }, + { "id" : 11, "animation" : "TBNCHAL2.def", "x" : 482, "y" : 56, "z" : -1, "border" : "TONHAL2.bmp", "area" : "TZNHAL2.bmp" }, + { "id" : 12, "animation" : "TBNCHAL3.def", "x" : 478, "y" : 26, "z" : -1, "border" : "TONHAL3.bmp", "area" : "TZNHAL3.bmp" }, + { "id" : 13, "animation" : "TBNCHAL4.def", "x" : 481, "y" : 26, "z" : -1, "border" : "TONHAL4.bmp", "area" : "TZNHAL4.bmp" }, + { "id" : 14, "animation" : "TBNCMARK.def", "x" : 347, "y" : 215, "z" : 2, "border" : "TONMRK1.bmp", "area" : "TZNMRK1.bmp" }, + { "id" : 15, "animation" : "TBNCSILO.def", "x" : 276, "y" : 185, "z" : 1, "border" : "TONMRK2.bmp", "area" : "TZNMRK2.bmp" }, + { "id" : 16, "animation" : "TBNCBLAK.def", "x" : 382, "y" : 252, "z" : 4, "border" : "TONSMITA.bmp", "area" : "TZNSMITA.bmp" }, + { "id" : 17, "animation" : "TBNCSPEC.def", "x" : 18, "y" : 0, "z" : -1, "border" : "TONSHRDA.bmp", "area" : "TZNSHRDA.bmp" }, + { "id" : 18, "animation" : "TBNCHRD1.def", "x" : 80, "y" : 222, "z" : 4, "border" : "TONSKE1H.bmp", "area" : "TZNSKE1H.bmp", "hidden" : true }, + { "id" : 19, "animation" : "TBNCHRD2.def", "x" : 64, "y" : 222, "z" : 4, "border" : "TONSKE2H.bmp", "area" : "TZNSKE2H.bmp", "hidden" : true, "builds" : 18 }, + { "id" : 20, "animation" : "TBNCBOAT.def", "x" : 617, "y" : 265, "z" : -2, "border" : "TONSHPNA.bmp", "area" : "TZNSHPNA.bmp", "hidden" : true }, + { "id" : 21, "animation" : "TBNCEXT0.def", "x" : 307, "y" : 61, "z" : -2, "border" : "TONNECRA.bmp", "area" : "TZNNECRA.bmp" }, + { "id" : 22, "animation" : "TBNCEXT1.def", "x" : 247, "y" : 275, "z" : 4, "border" : "TONSKELT.bmp", "area" : "TZNSKELT.bmp" }, + { "id" : 26, "animation" : "TBNCHOLY.def", "x" : 410, "y" : 88, "border" : "TONHOLYA.bmp", "area" : "TZNHOLYA.bmp" }, + { "id" : 27, "animation" : "TBNCEXT3.def", "x" : 0, "y" : 241 }, + { "id" : 28, "animation" : "TBNCEXT4.def", "x" : 321, "y" : 255 }, + { "id" : 29, "animation" : "TBNCEXT5.def", "x" : 475, "y" : 257 }, + { "id" : 30, "animation" : "TBNCDW_0.def", "x" : 80, "y" : 222, "z" : 4, "border" : "TONSKEL1.bmp", "area" : "TZNSKEL1.bmp" }, + { "id" : 31, "animation" : "TBNCDW_1.def", "x" : 502, "y" : 223, "border" : "TONZOMB1.bmp", "area" : "TZNZOMB1.bmp" }, + { "id" : 32, "animation" : "TBNCDW_2.def", "x" : 0, "y" : 187, "z" : 2, "border" : "TONWIGH1.bmp", "area" : "TZNWIGH1.bmp" }, + { "id" : 33, "animation" : "TBNCDW_3.def", "x" : 607, "y" : 212, "z" : 2, "border" : "TONVAM1.bmp", "area" : "TZNVAM1.bmp" }, + { "id" : 34, "animation" : "TBNCDW_4.def", "x" : 206, "y" : 207, "z" : 3, "border" : "TONLICH1.bmp", "area" : "TZNLICH1.bmp" }, + { "id" : 35, "animation" : "TBNCDW_5.def", "x" : 0, "y" : 31, "border" : "TONBKN1.bmp", "area" : "TZNBKN1.bmp" }, + { "id" : 36, "animation" : "TBNCDW_6.def", "x" : 663, "y" : 25, "border" : "TONBON1.bmp", "area" : "TZNBON1.bmp" }, + { "id" : 37, "animation" : "TBNCUP_0.def", "x" : 64, "y" : 222, "z" : 4, "border" : "TONSKEL2.bmp", "area" : "TZNSKEL2.bmp" }, + { "id" : 38, "animation" : "TBNCUP_1.def", "x" : 498, "y" : 224, "border" : "TONZOMB2.bmp", "area" : "TZNZOMB2.bmp" }, + { "id" : 39, "animation" : "TBNCUP_2.def", "x" : 0, "y" : 179, "z" : 2, "border" : "TONWIGH2.bmp", "area" : "TZNWIGH2.bmp" }, + { "id" : 40, "animation" : "TBNCUP_3.def", "x" : 615, "y" : 193, "z" : 2, "border" : "TONVAM2.bmp", "area" : "TZNVAM2.bmp" }, + { "id" : 41, "animation" : "TBNCUP_4.def", "x" : 222, "y" : 171, "z" : 3, "border" : "TONLICH2.bmp", "area" : "TZNLICH2.bmp" }, + { "id" : 42, "animation" : "TBNCUP_5.def", "x" : 0, "y" : 30, "border" : "TONBKN2.bmp", "area" : "TZNBKN2.bmp" }, + { "id" : 43, "animation" : "TBNCUP_6.def", "x" : 662, "y" : 23, "border" : "TONBON2.bmp", "area" : "TZNBON2.bmp" } ], + "musicTheme" : "music/NecroTown", + + "townBackground": "TBNCBACK.bmp", + "guildWindow": "TPMAGENC.bmp", + "buildingsIcons": "HALLNECR.DEF", "hallBackground": "TPTHBKNC.BMP", "hallSlots": [ @@ -540,40 +546,41 @@ [ [ 30, 37 ], [ 31, 38 ], [ 32, 39 ], [ 33, 40 ] ], [ [ 34, 41 ], [ 35, 42 ], [ 36, 43 ] ] ], - "blit_order" : [ 17, 0, 1, 2, 3, 4, 7, 8, 9, 32, 39, 26, 15, 14, 34, 41, 16, 5, 33, 40, 31, 38, 6, 30, 18, 37, 19, 22, 20 ], "creatures" : [ [56, 57], [58, 59], [60, 61], [62, 63], [64, 65], [66, 67], [68, 69] ], "horde" : [ 0, -1 ], - "mage_guild" : 5, - "primary_resource" : 127, - "war_machine" : 6, - + "mageGuild" : 5, + "primaryResource" : 127, + "warMachine" : 6, "buildings" : [ { "id" : 0 }, - { "id" : 1, "requires" : [ 0 ] }, - { "id" : 2, "requires" : [ 1 ] }, - { "id" : 3, "requires" : [ 2 ] }, - { "id" : 4, "requires" : [ 3 ] }, + { "id" : 1, "upgrades" : 0 }, + { "id" : 2, "upgrades" : 1 }, + { "id" : 3, "upgrades" : 2 }, + { "id" : 4, "upgrades" : 3 }, { "id" : 5 }, { "id" : 6 }, { "id" : 7 }, - { "id" : 8, "requires" : [ 7 ] }, - { "id" : 9, "requires" : [ 8 ] }, - { "id" : 10 }, - { "id" : 11, "requires" : [ 10, 5 ] }, - { "id" : 12, "requires" : [ 11, 0, 14, 16 ] }, - { "id" : 13, "requires" : [ 12, 9 ] }, + { "id" : 8, "upgrades" : 7 }, + { "id" : 9, "upgrades" : 8 }, + { "id" : 10, "mode" : "auto" }, + { "id" : 11, "upgrades" : 10, "requires" : [ 5 ] }, + { "id" : 12, "upgrades" : 11, "requires" : [ 0, 14, 16 ] }, + { "id" : 13, "upgrades" : 12, "requires" : [ 9 ] }, { "id" : 14 }, { "id" : 15, "requires" : [ 14 ] }, { "id" : 16 }, { "id" : 17, "requires" : [ 7 ] }, - { "id" : 18, "requires" : [ 22, 30 ] }, - { "id" : 19, "requires" : [ 22, 37 ] }, - { "id" : 20 }, + { "id" : 18, "upgrades" : 30, "requires" : [ 22 ] }, + { "id" : 19, "upgrades" : 37, "requires" : [ 18 ], "mode" : "auto" }, + { "id" : 20, "upgrades" : 6 }, { "id" : 21, "requires" : [ 0 ] }, { "id" : 22, "requires" : [ 30 ] }, - { "id" : 26 }, + { "id" : 26, "mode" : "grail"}, + { "id" : 27, "requires" : [ 11 ], "mode" : "auto" }, + { "id" : 28, "requires" : [ 12 ], "mode" : "auto" }, + { "id" : 29, "requires" : [ 13 ], "mode" : "auto" }, { "id" : 30, "requires" : [ 7 ] }, { "id" : 31, "requires" : [ 30 ] }, { "id" : 32, "requires" : [ 30 ] }, @@ -581,72 +588,72 @@ { "id" : 34, "requires" : [ 0, 31 ] }, { "id" : 35, "requires" : [ 33, 34 ] }, { "id" : 36, "requires" : [ 35 ] }, - { "id" : 37, "requires" : [ 30 ] }, - { "id" : 38, "requires" : [ 31 ] }, - { "id" : 39, "requires" : [ 32 ] }, - { "id" : 40, "requires" : [ 33, 21 ] }, - { "id" : 41, "requires" : [ 34 ] }, - { "id" : 42, "requires" : [ 35 ] }, - { "id" : 43, "requires" : [ 36 ] } + { "id" : 37, "upgrades" : 30 }, + { "id" : 38, "upgrades" : 31 }, + { "id" : 39, "upgrades" : 32 }, + { "id" : 40, "upgrades" : 33, "requires" : [ 21 ] }, + { "id" : 41, "upgrades" : 34 }, + { "id" : 42, "upgrades" : 35 }, + { "id" : 43, "upgrades" : 36 } ] - }, - + } + }, + "dungeon" : + { + "index" : 5, + "nativeTerrain": "subterra", + "creatureBackground" : + { + "120px" : "TPCASDUN", + "130px" : "CRBKGDUN" + }, + "town" : { - // 5 - Dungeon "structures" : [ - { "id" : 16, "defname" : "TBDNBLAK.def", "x" : 544, "y" : 248, "border" : "TODSMITH.bmp", "area" : "TZDSMITH.bmp" }, - { "id" : 9, "defname" : "TBDNCAS3.def", "x" : 363, "y" : 87, "border" : "TODCAS3.bmp", "area" : "TZDCAS3.bmp" }, - { "id" : 7, "defname" : "TBDNCSTL.def", "x" : 363, "y" : 87, "border" : "TODCAS1.bmp", "area" : "TZDCAS1.bmp" }, - { "id" : 30, "defname" : "TBDNDW_0.def", "x" : 0, "y" : 326, "border" : "TODTRG1A.bmp", "area" : "TZDTRG1A.bmp" }, - { "id" : 31, "defname" : "TBDNDW_1.def", "x" : 0, "y" : 26, "border" : "TODHAR1.bmp", "area" : "TZDHAR1.bmp" }, - { "id" : 32, "defname" : "TBDNDW_2.def", "x" : 118, "y" : 308, "border" : "TODBEH1A.bmp", "area" : "TZDBEH1A.bmp" }, - { "id" : 33, "defname" : "TBDNDW_3.def", "x" : 300, "y" : 29, "border" : "TODMED1.bmp", "area" : "TZDMED1.bmp" }, - { "id" : 34, "defname" : "TBDNDW_4.def", "x" : 551, "y" : 186, "border" : "TODMIN1.bmp", "area" : "TZDMIN1.bmp" }, - { "id" : 35, "defname" : "TBDNDW_5.def", "x" : 270, "y" : 253, "border" : "TODMAN1.bmp", "area" : "TZDMAN1.bmp" }, - { "id" : 36, "defname" : "TBDNDW_6.def", "x" : 550, "y" : 0, "border" : "TODDRA1A.bmp", "area" : "TZDDRA1A.bmp" }, - { "id" : 21, "defname" : "TBDNEXT0.def", "x" : 131, "y" : 26 , "border" : "TODVOR1A.bmp", "area" : "TZDVOR1A.bmp" }, - { "id" : 22, "defname" : "TBDNEXT1.def", "x" : 687, "y" : 177, "border" : "TODPORTA.bmp", "area" : "TZDPORTA.bmp" }, - { "id" : 23, "defname" : "TBDNEXT2.def", "x" : 313, "y" : 298, "border" : "TODACAD.bmp", "area" : "TZDACAD.bmp" }, - { "id" : 11, "defname" : "TBDNHAL2.def", "x" : 0, "y" : 223, "border" : "TODHALL2.bmp", "area" : "TZDHALL2.bmp" }, - { "id" : 12, "defname" : "TBDNHAL3.def", "x" : 0, "y" : 223, "border" : "TODHALL3.bmp", "area" : "TZDHALL3.bmp" }, - { "id" : 13, "defname" : "TBDNHAL4.def", "x" : 0, "y" : 203, "border" : "TODHALL4.bmp", "area" : "TZDHALL4.bmp" }, - { "id" : 10, "defname" : "TBDNHALL.def", "x" : 0, "y" : 234, "border" : "TODHALL1.bmp", "area" : "TZDHALL1.bmp" }, - { "id" : 26, "defname" : "TBDNHOLY.def", "x" : 562, "y" : 24, "border" : "TODHOLY.bmp", "area" : "TZDHOLY.bmp" }, - { "id" : 18, "defname" : "TBDNHRD1.def", "x" : 0, "y" : 326, "border" : "TODTR1HA.bmp", "area" : "TZDTR1HA.bmp" }, - { "id" : 19, "defname" : "TBDNHRD2.def", "x" : 0, "y" : 300, "border" : "TODTR2HA.bmp", "area" : "TZDTR2HA.bmp" }, - { "id" : 1, "defname" : "TBDNMAG2.def", "x" : 164, "y" : 97, "border" : "TODMAG2.bmp", "area" : "TZDMAG2.bmp" }, - { "id" : 2, "defname" : "TBDNMAG3.def", "x" : 164, "y" : 77, "border" : "TODMAG3.bmp", "area" : "TZDMAG3.bmp" }, - { "id" : 3, "defname" : "TBDNMAG4.def", "x" : 164, "y" : 61, "border" : "TODMAG4.bmp", "area" : "TZDMAG4.bmp" }, - { "id" : 4, "defname" : "TBDNMAG5.def", "x" : 164, "y" : 15, "border" : "TODMAG5.bmp", "area" : "TZDMAG5.bmp" }, - { "id" : 0, "defname" : "TBDNMAGE.def", "x" : 164, "y" : 119, "border" : "TODMAG1.bmp", "area" : "TZDMAG1.bmp" }, - { "id" : 14, "defname" : "TBDNMARK.def", "x" : 590, "y" : 318, "border" : "TODMARK.bmp", "area" : "TZDMARK.bmp" }, - { "id" : 15, "defname" : "TBDNSILO.def", "x" : 624, "y" : 335, "border" : "TODSILO.bmp", "area" : "TZDSILO.bmp" }, - { "id" : 17, "defname" : "TBDNSPEC.def", "x" : 746, "y" : 294, "border" : "TODART.bmp", "area" : "TZDART.bmp" }, - { "id" : 5, "defname" : "TBDNTVRN.def", "x" : 211, "y" : 297, "border" : "TODTAV.bmp", "area" : "TZDTAV.bmp" }, - { "id" : 37, "defname" : "TBDNUP_0.def", "x" : 0, "y" : 300, "border" : "TODTRG2A.bmp", "area" : "TZDTRG2A.bmp" }, - { "id" : 38, "defname" : "TBDNUP_1.def", "x" : 0, "y" : 26, "border" : "TODHAR2.bmp", "area" : "TZDHAR2.bmp" }, - { "id" : 39, "defname" : "TBDNUP_2.def", "x" : 118, "y" : 256, "border" : "TODBEH2A.bmp", "area" : "TZDBEH2A.bmp" }, - { "id" : 40, "defname" : "TBDNUP_3.def", "x" : 300, "y" : 29, "border" : "TODMED2.bmp", "area" : "TZDMED2.bmp" }, - { "id" : 41, "defname" : "TBDNUP_4.def", "x" : 519, "y" : 172, "border" : "TODMIN2.bmp", "area" : "TZDMIN2.bmp" }, - { "id" : 42, "defname" : "TBDNUP_5.def", "x" : 270, "y" : 253, "border" : "TODMAN2.bmp", "area" : "TZDMAN2.bmp" }, - { "id" : 43, "defname" : "TBDNUP_6.def", "x" : 550, "y" : 0, "border" : "TODDRA2A.bmp", "area" : "TZDDRA2A.bmp" }, - { "id" : 8, "defname" : "TBDNCAS2.def", "x" : 363, "y" : 87, "border" : "TODCAS2.bmp", "area" : "TZDCAS2.bmp" } - ], - "groups" : - [ - [ 0, 1, 2, 3, 4 ], - [ 6, 20 ], - [ 7, 8, 9 ], - [ 10, 11, 12, 13 ], - [ 31, 38 ], - [ 32, 39 ], - [ 33, 40 ], - [ 34, 41 ], - [ 35, 42 ], - [ 36, 43 ], - [ 30, 37, 18, 19 ] + { "id" : 0, "animation" : "TBDNMAGE.def", "x" : 164, "y" : 119, "z" : -1, "border" : "TODMAG1.bmp", "area" : "TZDMAG1.bmp" }, + { "id" : 1, "animation" : "TBDNMAG2.def", "x" : 164, "y" : 97, "z" : -1, "border" : "TODMAG2.bmp", "area" : "TZDMAG2.bmp" }, + { "id" : 2, "animation" : "TBDNMAG3.def", "x" : 164, "y" : 77, "z" : -1, "border" : "TODMAG3.bmp", "area" : "TZDMAG3.bmp" }, + { "id" : 3, "animation" : "TBDNMAG4.def", "x" : 164, "y" : 61, "z" : -1, "border" : "TODMAG4.bmp", "area" : "TZDMAG4.bmp" }, + { "id" : 4, "animation" : "TBDNMAG5.def", "x" : 164, "y" : 15, "z" : -1, "border" : "TODMAG5.bmp", "area" : "TZDMAG5.bmp" }, + { "id" : 5, "animation" : "TBDNTVRN.def", "x" : 211, "y" : 297, "border" : "TODTAV.bmp", "area" : "TZDTAV.bmp" }, + { "id" : 7, "animation" : "TBDNCSTL.def", "x" : 363, "y" : 87, "z" : 2, "border" : "TODCAS1.bmp", "area" : "TZDCAS1.bmp" }, + { "id" : 8, "animation" : "TBDNCAS2.def", "x" : 363, "y" : 87, "z" : 2, "border" : "TODCAS2.bmp", "area" : "TZDCAS2.bmp" }, + { "id" : 9, "animation" : "TBDNCAS3.def", "x" : 363, "y" : 87, "z" : 2, "border" : "TODCAS3.bmp", "area" : "TZDCAS3.bmp" }, + { "id" : 10, "animation" : "TBDNHALL.def", "x" : 0, "y" : 234, "border" : "TODHALL1.bmp", "area" : "TZDHALL1.bmp" }, + { "id" : 11, "animation" : "TBDNHAL2.def", "x" : 0, "y" : 223, "border" : "TODHALL2.bmp", "area" : "TZDHALL2.bmp" }, + { "id" : 12, "animation" : "TBDNHAL3.def", "x" : 0, "y" : 223, "border" : "TODHALL3.bmp", "area" : "TZDHALL3.bmp" }, + { "id" : 13, "animation" : "TBDNHAL4.def", "x" : 0, "y" : 203, "z" : -1, "border" : "TODHALL4.bmp", "area" : "TZDHALL4.bmp" }, + { "id" : 14, "animation" : "TBDNMARK.def", "x" : 590, "y" : 318, "z" : -2, "border" : "TODMARK.bmp", "area" : "TZDMARK.bmp" }, + { "id" : 15, "animation" : "TBDNSILO.def", "x" : 624, "y" : 335, "z" : 1, "border" : "TODSILO.bmp", "area" : "TZDSILO.bmp" }, + { "id" : 16, "animation" : "TBDNBLAK.def", "x" : 544, "y" : 248, "z" : -3, "border" : "TODSMITH.bmp", "area" : "TZDSMITH.bmp" }, + { "id" : 17, "animation" : "TBDNSPEC.def", "x" : 746, "y" : 294, "z" : 1, "border" : "TODART.bmp", "area" : "TZDART.bmp" }, + { "id" : 18, "animation" : "TBDNHRD1.def", "x" : 0, "y" : 326, "z" : 2, "border" : "TODTR1HA.bmp", "area" : "TZDTR1HA.bmp", "hidden" : true }, + { "id" : 19, "animation" : "TBDNHRD2.def", "x" : 0, "y" : 300, "z" : 2, "border" : "TODTR2HA.bmp", "area" : "TZDTR2HA.bmp", "hidden" : true, "builds" : 18 }, + { "id" : 21, "animation" : "TBDNEXT0.def", "x" : 131, "y" : 26 , "border" : "TODVOR1A.bmp", "area" : "TZDVOR1A.bmp" }, + { "id" : 22, "animation" : "TBDNEXT1.def", "x" : 687, "y" : 177, "border" : "TODPORTA.bmp", "area" : "TZDPORTA.bmp" }, + { "id" : 23, "animation" : "TBDNEXT2.def", "x" : 313, "y" : 298, "border" : "TODACAD.bmp", "area" : "TZDACAD.bmp" }, + { "id" : 26, "animation" : "TBDNHOLY.def", "x" : 562, "y" : 24, "z" : 1, "border" : "TODHOLY.bmp", "area" : "TZDHOLY.bmp" }, + { "id" : 30, "animation" : "TBDNDW_0.def", "x" : 0, "y" : 326, "z" : 2, "border" : "TODTRG1A.bmp", "area" : "TZDTRG1A.bmp" }, + { "id" : 31, "animation" : "TBDNDW_1.def", "x" : 0, "y" : 26, "border" : "TODHAR1.bmp", "area" : "TZDHAR1.bmp" }, + { "id" : 32, "animation" : "TBDNDW_2.def", "x" : 118, "y" : 308, "z" : 1, "border" : "TODBEH1A.bmp", "area" : "TZDBEH1A.bmp" }, + { "id" : 33, "animation" : "TBDNDW_3.def", "x" : 300, "y" : 29, "z" : -1, "border" : "TODMED1.bmp", "area" : "TZDMED1.bmp" }, + { "id" : 34, "animation" : "TBDNDW_4.def", "x" : 551, "y" : 186, "z" : 1, "border" : "TODMIN1.bmp", "area" : "TZDMIN1.bmp" }, + { "id" : 35, "animation" : "TBDNDW_5.def", "x" : 270, "y" : 253, "z" : -1, "border" : "TODMAN1.bmp", "area" : "TZDMAN1.bmp" }, + { "id" : 36, "animation" : "TBDNDW_6.def", "x" : 550, "y" : 0, "z" : -1, "border" : "TODDRA1A.bmp", "area" : "TZDDRA1A.bmp" }, + { "id" : 37, "animation" : "TBDNUP_0.def", "x" : 0, "y" : 300, "z" : 2, "border" : "TODTRG2A.bmp", "area" : "TZDTRG2A.bmp" }, + { "id" : 38, "animation" : "TBDNUP_1.def", "x" : 0, "y" : 26, "border" : "TODHAR2.bmp", "area" : "TZDHAR2.bmp" }, + { "id" : 39, "animation" : "TBDNUP_2.def", "x" : 118, "y" : 256, "z" : 1, "border" : "TODBEH2A.bmp", "area" : "TZDBEH2A.bmp" }, + { "id" : 40, "animation" : "TBDNUP_3.def", "x" : 300, "y" : 29, "z" : -1, "border" : "TODMED2.bmp", "area" : "TZDMED2.bmp" }, + { "id" : 41, "animation" : "TBDNUP_4.def", "x" : 519, "y" : 172, "z" : 1, "border" : "TODMIN2.bmp", "area" : "TZDMIN2.bmp" }, + { "id" : 42, "animation" : "TBDNUP_5.def", "x" : 270, "y" : 253, "z" : -1, "border" : "TODMAN2.bmp", "area" : "TZDMAN2.bmp" }, + { "id" : 43, "animation" : "TBDNUP_6.def", "x" : 550, "y" : 0, "z" : -1, "border" : "TODDRA2A.bmp", "area" : "TZDDRA2A.bmp" }, ], + "musicTheme" : "music/Dungeon", + + "townBackground": "TBDNBACK.bmp", + "guildWindow": "TPMAGEDN.bmp", + "buildingsIcons": "HALLDUNG.DEF", "hallBackground": "TPTHBKDG.BMP", "hallSlots": [ @@ -656,38 +663,40 @@ [ [ 30, 37 ], [ 31, 38 ], [ 32, 39 ], [ 33, 40 ] ], [ [ 34, 41 ], [ 35, 42 ], [ 36, 43 ] ] ], - "blit_order" : [ 0, 1, 2, 3, 4, 21, 35, 42, 5, 30, 18, 37, 19, 32, 39, 26, 7, 8, 9, 23 ], "creatures" : [ [70, 71], [72, 73], [74, 75], [76, 77], [78, 79], [80, 81], [82, 83] ], "horde" : [ 0, -1 ], - "mage_guild" : 5, - "primary_resource" : 3, - "war_machine" : 4, + "mageGuild" : 5, + "primaryResource" : 3, + "warMachine" : 4, "buildings" : [ { "id" : 0 }, - { "id" : 1, "requires" : [ 0 ] }, - { "id" : 2, "requires" : [ 1 ] }, - { "id" : 3, "requires" : [ 2 ] }, - { "id" : 4, "requires" : [ 3 ] }, + { "id" : 1, "upgrades" : 0 }, + { "id" : 2, "upgrades" : 1 }, + { "id" : 3, "upgrades" : 2 }, + { "id" : 4, "upgrades" : 3 }, { "id" : 5 }, { "id" : 7 }, - { "id" : 8, "requires" : [ 7 ] }, - { "id" : 9, "requires" : [ 8 ] }, - { "id" : 10 }, - { "id" : 11, "requires" : [ 10, 5 ] }, - { "id" : 12, "requires" : [ 11, 0, 14, 16 ] }, - { "id" : 13, "requires" : [ 12, 9 ] }, + { "id" : 8, "upgrades" : 7 }, + { "id" : 9, "upgrades" : 8 }, + { "id" : 10, "mode" : "auto" }, + { "id" : 11, "upgrades" : 10, "requires" : [ 5 ] }, + { "id" : 12, "upgrades" : 11, "requires" : [ 0, 14, 16 ] }, + { "id" : 13, "upgrades" : 12, "requires" : [ 9 ] }, { "id" : 14 }, { "id" : 15, "requires" : [ 14 ] }, { "id" : 16 }, { "id" : 17, "requires" : [ 14 ] }, - { "id" : 18, "requires" : [ 30 ] }, - { "id" : 19, "requires" : [ 37 ] }, + { "id" : 18, "upgrades" : 30 }, + { "id" : 19, "upgrades" : 37, "requires" : [ 18 ], "mode" : "auto" }, { "id" : 21, "requires" : [ 0 ] }, { "id" : 22 }, { "id" : 23 }, - { "id" : 26 }, + { "id" : 26, "mode" : "grail"}, + { "id" : 27, "requires" : [ 11 ], "mode" : "auto" }, + { "id" : 28, "requires" : [ 12 ], "mode" : "auto" }, + { "id" : 29, "requires" : [ 13 ], "mode" : "auto" }, { "id" : 30, "requires" : [ 7 ] }, { "id" : 31, "requires" : [ 30 ] }, { "id" : 32, "requires" : [ 30 ] }, @@ -695,71 +704,71 @@ { "id" : 34, "requires" : [ 33 ] }, { "id" : 35, "requires" : [ 33 ] }, { "id" : 36, "requires" : [ 1, 34, 35 ] }, - { "id" : 37, "requires" : [ 30 ] }, - { "id" : 38, "requires" : [ 31 ] }, - { "id" : 39, "requires" : [ 32 ] }, - { "id" : 40, "requires" : [ 33 ] }, - { "id" : 41, "requires" : [ 34 ] }, - { "id" : 42, "requires" : [ 35 ] }, - { "id" : 43, "requires" : [ 36, 2 ] } + { "id" : 37, "upgrades" : 30 }, + { "id" : 38, "upgrades" : 31 }, + { "id" : 39, "upgrades" : 32 }, + { "id" : 40, "upgrades" : 33 }, + { "id" : 41, "upgrades" : 34 }, + { "id" : 42, "upgrades" : 35 }, + { "id" : 43, "upgrades" : 36, "requires" : [ 2 ] } ] - }, - + } + }, + "stronghold" : + { + "index" : 6, + "nativeTerrain": "rough", + "creatureBackground" : + { + "120px" : "TPCASSTR", + "130px" : "CRBKGSTR" + }, + "town" : { - // 6 - Stronghold "structures" : [ - { "id" : 31, "defname" : "TBSTDW_1.def", "x" : 266, "y" : 246, "border" : "TOSWOL1.bmp", "area" : "TZSWOL1.bmp" }, - { "id" : 43, "defname" : "TBSTUP_6.def", "x" : 604, "y" : 0, "border" : "TOSBEH2A.bmp", "area" : "TZSBEH2A.bmp" }, - { "id" : 8, "defname" : "TBSTCAS2.def", "x" : 402, "y" : 114, "border" : "TOSCA2.bmp", "area" : "TZSCA2.bmp" }, - { "id" : 9, "defname" : "TBSTCAS3.def", "x" : 402, "y" : 114, "border" : "TOSCA3.bmp", "area" : "TZSCA3.bmp" }, - { "id" : 7, "defname" : "TBSTCSTL.def", "x" : 402, "y" : 148, "border" : "TOSCA1.bmp", "area" : "TZSCA1.bmp" }, - { "id" : 30, "defname" : "TBSTDW_0.def", "x" : 373, "y" : 239, "border" : "TOSGOB1.bmp", "area" : "TZSGOB1.bmp" }, - { "id" : 32, "defname" : "TBSTDW_2.def", "x" : 566, "y" : 232, "border" : "TOSORC1.bmp", "area" : "TZSORC1.bmp" }, - { "id" : 33, "defname" : "TBSTDW_3.def", "x" : 197, "y" : 204, "border" : "TOSOGR1.bmp", "area" : "TZSOGR1.bmp" }, - { "id" : 34, "defname" : "TBSTDW_4.def", "x" : 137, "y" : 30, "border" : "TOSROC1.bmp", "area" : "TZSROC1.bmp" }, - { "id" : 35, "defname" : "TBSTDW_5.def", "x" : 622, "y" : 160, "border" : "TOSCYC1.bmp", "area" : "TZSCYC1.bmp" }, - { "id" : 36, "defname" : "TBSTDW_6.def", "x" : 604, "y" : 0, "border" : "TOSBEH1A.bmp", "area" : "TZSBEH1A.bmp" }, - { "id" : 21, "defname" : "TBSTEXT0.def", "x" : 473, "y" : 282, "border" : "TOSMRK1C.bmp", "area" : "TZSMRK1C.bmp" }, - { "id" : 22, "defname" : "TBSTEXT1.def", "x" : 617, "y" : 286, "border" : "TOSBLK2.bmp", "area" : "TZSBLK2.bmp" }, - { "id" : 23, "defname" : "TBSTEXT2.def", "x" : 313, "y" : 13, "border" : "TOSVAH.bmp", "area" : "TZSVAH.bmp" }, - { "id" : -1, "defname" : "TBSTEXT3.def", "x" : 23, "y" : 20 }, - { "id" : 11, "defname" : "TBSTHAL2.def", "x" : 0, "y" : 225, "border" : "TOSHAL2A.bmp", "area" : "TZSHAL2A.bmp" }, - { "id" : 12, "defname" : "TBSTHAL3.def", "x" : 0, "y" : 201, "border" : "TOSHAL3A.bmp", "area" : "TZSHAL3A.bmp" }, - { "id" : 13, "defname" : "TBSTHAL4.def", "x" : 0, "y" : 148, "border" : "TOSHAL4A.bmp", "area" : "TZSHAL4A.bmp" }, - { "id" : 10, "defname" : "TBSTHALL.def", "x" : 0, "y" : 259, "border" : "TOSHAL1A.bmp", "area" : "TZSHAL1A.bmp" }, - { "id" : 26, "defname" : "TBSTHOLY.def", "x" : 321, "y" : 105, "border" : "TOSHOLYA.bmp", "area" : "TZSHOLYA.bmp" }, - { "id" : 18, "defname" : "TBSTHRD1.def", "x" : 373, "y" : 239, "border" : "TOSGOB1H.bmp", "area" : "TZSGOB1H.bmp" }, - { "id" : 19, "defname" : "TBSTHRD2.def", "x" : 373, "y" : 220, "border" : "TOSGOB2H.bmp", "area" : "TZSGOB2H.bmp" }, - { "id" : 1, "defname" : "TBSTMAG2.def", "x" : 473, "y" : 37, "border" : "TOSMAG2.bmp", "area" : "TZSMAG2.bmp" }, - { "id" : 2, "defname" : "TBSTMAG3.def", "x" : 473, "y" : 1, "border" : "TOSMAG3.bmp", "area" : "TZSMAG3.bmp" }, - { "id" : 0, "defname" : "TBSTMAGE.def", "x" : 473, "y" : 67, "border" : "TOSMAG1.bmp", "area" : "TZSMAG1.bmp" }, - { "id" : 14, "defname" : "TBSTMARK.def", "x" : 397, "y" : 308, "border" : "TOSMRK1.bmp", "area" : "TZSMRK1.bmp" }, - { "id" : 15, "defname" : "TBSTSILO.def", "x" : 458, "y" : 248, "border" : "TOSMRK2.bmp", "area" : "TZSMRK2.bmp" }, - { "id" : 17, "defname" : "TBSTSPEC.def", "x" : 550, "y" : 229, "border" : "TOSCA1EA.bmp", "area" : "TZSCA1EA.bmp" }, - { "id" : 5, "defname" : "TBSTTVRN.def", "x" : 170, "y" : 280, "border" : "TOSTAV.bmp", "area" : "TZSTAV.bmp" }, - { "id" : 37, "defname" : "TBSTUP_0.def", "x" : 373, "y" : 220, "border" : "TOSGOB2.bmp", "area" : "TZSGOB2.bmp" }, - { "id" : 38, "defname" : "TBSTUP_1.def", "x" : 266, "y" : 225, "border" : "TOSWOL2.bmp", "area" : "TZSWOL2.bmp" }, - { "id" : 39, "defname" : "TBSTUP_2.def", "x" : 566, "y" : 158, "border" : "TOSORC2.bmp", "area" : "TZSORC2.bmp" }, - { "id" : 40, "defname" : "TBSTUP_3.def", "x" : 197, "y" : 137, "border" : "TOSOGR2.bmp", "area" : "TZSOGR2.bmp" }, - { "id" : 41, "defname" : "TBSTUP_4.def", "x" : 129, "y" : 15, "border" : "TOSROC2.bmp", "area" : "TZSROC2.bmp" }, - { "id" : 42, "defname" : "TBSTUP_5.def", "x" : 616, "y" : 93, "border" : "TOSCYC2A.bmp", "area" : "TZSCYC2A.bmp" }, - { "id" : 16, "defname" : "TBSTBLAK.def", "x" : 660, "y" : 286, "border" : "TOSBLK1.bmp", "area" : "TZSBLK1.bmp" } - ], - "groups" : - [ - [ 0, 1, 2, 3, 4 ], - [ 6, 20 ], - [ 7, 8, 9 ], - [ 10, 11, 12, 13 ], - [ 31, 38 ], - [ 32, 39 ], - [ 33, 40 ], - [ 34, 41 ], - [ 35, 42 ], - [ 36, 43 ], - [ 30, 37, 18, 19 ] + { "animation" : "TBSTEXT3.def", "x" : 23, "y" : 20 }, + { "id" : 0, "animation" : "TBSTMAGE.def", "x" : 473, "y" : 67, "z" : -1, "border" : "TOSMAG1.bmp", "area" : "TZSMAG1.bmp" }, + { "id" : 1, "animation" : "TBSTMAG2.def", "x" : 473, "y" : 37, "z" : -1, "border" : "TOSMAG2.bmp", "area" : "TZSMAG2.bmp" }, + { "id" : 2, "animation" : "TBSTMAG3.def", "x" : 473, "y" : 1, "z" : -1, "border" : "TOSMAG3.bmp", "area" : "TZSMAG3.bmp" }, + { "id" : 5, "animation" : "TBSTTVRN.def", "x" : 170, "y" : 280, "z" : 2, "border" : "TOSTAV.bmp", "area" : "TZSTAV.bmp" }, + { "id" : 7, "animation" : "TBSTCSTL.def", "x" : 402, "y" : 148, "z" : -1, "border" : "TOSCA1.bmp", "area" : "TZSCA1.bmp" }, + { "id" : 8, "animation" : "TBSTCAS2.def", "x" : 402, "y" : 114, "z" : -1, "border" : "TOSCA2.bmp", "area" : "TZSCA2.bmp" }, + { "id" : 9, "animation" : "TBSTCAS3.def", "x" : 402, "y" : 114, "z" : -1, "border" : "TOSCA3.bmp", "area" : "TZSCA3.bmp" }, + { "id" : 10, "animation" : "TBSTHALL.def", "x" : 0, "y" : 259, "border" : "TOSHAL1A.bmp", "area" : "TZSHAL1A.bmp" }, + { "id" : 11, "animation" : "TBSTHAL2.def", "x" : 0, "y" : 225, "border" : "TOSHAL2A.bmp", "area" : "TZSHAL2A.bmp" }, + { "id" : 12, "animation" : "TBSTHAL3.def", "x" : 0, "y" : 201, "border" : "TOSHAL3A.bmp", "area" : "TZSHAL3A.bmp" }, + { "id" : 13, "animation" : "TBSTHAL4.def", "x" : 0, "y" : 148, "border" : "TOSHAL4A.bmp", "area" : "TZSHAL4A.bmp" }, + { "id" : 14, "animation" : "TBSTMARK.def", "x" : 397, "y" : 308, "z" : 1, "border" : "TOSMRK1.bmp", "area" : "TZSMRK1.bmp" }, + { "id" : 15, "animation" : "TBSTSILO.def", "x" : 458, "y" : 248, "z" : 1, "border" : "TOSMRK2.bmp", "area" : "TZSMRK2.bmp" }, + { "id" : 16, "animation" : "TBSTBLAK.def", "x" : 660, "y" : 286, "border" : "TOSBLK1.bmp", "area" : "TZSBLK1.bmp" }, + { "id" : 17, "animation" : "TBSTSPEC.def", "x" : 550, "y" : 229, "border" : "TOSCA1EA.bmp", "area" : "TZSCA1EA.bmp" }, + { "id" : 18, "animation" : "TBSTHRD1.def", "x" : 373, "y" : 239, "border" : "TOSGOB1H.bmp", "area" : "TZSGOB1H.bmp", "hidden" : true }, + { "id" : 19, "animation" : "TBSTHRD2.def", "x" : 373, "y" : 220, "border" : "TOSGOB2H.bmp", "area" : "TZSGOB2H.bmp", "hidden" : true, "builds" : 18 }, + { "id" : 21, "animation" : "TBSTEXT0.def", "x" : 473, "y" : 282, "z" : 3, "border" : "TOSMRK1C.bmp", "area" : "TZSMRK1C.bmp" }, + { "id" : 22, "animation" : "TBSTEXT1.def", "x" : 617, "y" : 286, "z" : 1, "border" : "TOSBLK2.bmp", "area" : "TZSBLK2.bmp" }, + { "id" : 23, "animation" : "TBSTEXT2.def", "x" : 313, "y" : 13, "z" : -1, "border" : "TOSVAH.bmp", "area" : "TZSVAH.bmp" }, + { "id" : 26, "animation" : "TBSTHOLY.def", "x" : 321, "y" : 105, "z" : 2, "border" : "TOSHOLYA.bmp", "area" : "TZSHOLYA.bmp" }, + { "id" : 30, "animation" : "TBSTDW_0.def", "x" : 373, "y" : 239, "border" : "TOSGOB1.bmp", "area" : "TZSGOB1.bmp" }, + { "id" : 31, "animation" : "TBSTDW_1.def", "x" : 266, "y" : 246, "z" : 1, "border" : "TOSWOL1.bmp", "area" : "TZSWOL1.bmp" }, + { "id" : 32, "animation" : "TBSTDW_2.def", "x" : 566, "y" : 232, "z" : 2, "border" : "TOSORC1.bmp", "area" : "TZSORC1.bmp" }, + { "id" : 33, "animation" : "TBSTDW_3.def", "x" : 197, "y" : 204, "border" : "TOSOGR1.bmp", "area" : "TZSOGR1.bmp" }, + { "id" : 34, "animation" : "TBSTDW_4.def", "x" : 137, "y" : 30, "z" : -1, "border" : "TOSROC1.bmp", "area" : "TZSROC1.bmp" }, + { "id" : 35, "animation" : "TBSTDW_5.def", "x" : 622, "y" : 160, "z" : -2, "border" : "TOSCYC1.bmp", "area" : "TZSCYC1.bmp" }, + { "id" : 36, "animation" : "TBSTDW_6.def", "x" : 604, "y" : 0, "border" : "TOSBEH1A.bmp", "area" : "TZSBEH1A.bmp" }, + { "id" : 37, "animation" : "TBSTUP_0.def", "x" : 373, "y" : 220, "border" : "TOSGOB2.bmp", "area" : "TZSGOB2.bmp" }, + { "id" : 38, "animation" : "TBSTUP_1.def", "x" : 266, "y" : 225, "z" : 1, "border" : "TOSWOL2.bmp", "area" : "TZSWOL2.bmp" }, + { "id" : 39, "animation" : "TBSTUP_2.def", "x" : 566, "y" : 158, "z" : 2, "border" : "TOSORC2.bmp", "area" : "TZSORC2.bmp" }, + { "id" : 40, "animation" : "TBSTUP_3.def", "x" : 197, "y" : 137, "border" : "TOSOGR2.bmp", "area" : "TZSOGR2.bmp" }, + { "id" : 41, "animation" : "TBSTUP_4.def", "x" : 129, "y" : 15, "z" : -1, "border" : "TOSROC2.bmp", "area" : "TZSROC2.bmp" }, + { "id" : 42, "animation" : "TBSTUP_5.def", "x" : 616, "y" : 93, "z" : -2, "border" : "TOSCYC2A.bmp", "area" : "TZSCYC2A.bmp" }, + { "id" : 43, "animation" : "TBSTUP_6.def", "x" : 604, "y" : 0, "border" : "TOSBEH2A.bmp", "area" : "TZSBEH2A.bmp" } ], + "musicTheme" : "music/Stronghold", + + "townBackground": "TBSTBACK.bmp", + "guildWindow": "TPMAGEST.bmp", + "buildingsIcons": "HALLSTRN.DEF", "hallBackground": "TPTHBKTW.BMP", "hallSlots": [ @@ -769,38 +778,40 @@ [ [ 30, 37 ], [ 31, 38 ], [ 32, 39 ], [ 33, 40 ] ], [ [ 34, 41 ], [ 35, 42 ], [ 36, 43 ] ] ], - "blit_order" : [ 33, 40, 30, 18, 37, 19, 31, 38, 23, 26, 5, 32, 39, 15, 14, 21, 16, 22 ], "creatures" : [ [84, 85], [86, 87], [88, 89], [90, 91], [92, 93], [94, 95], [96, 97] ], "horde" : [ 0, -1 ], - "mage_guild" : 3, - "primary_resource" : 127, - "war_machine" : 5, + "mageGuild" : 3, + "primaryResource" : 127, + "warMachine" : 5, "buildings" : [ { "id" : 0 }, - { "id" : 1, "requires" : [ 0 ] }, - { "id" : 2, "requires" : [ 1 ] }, - { "id" : 3, "requires" : [ 2 ] }, - { "id" : 4, "requires" : [ 3 ] }, + { "id" : 1, "upgrades" : 0 }, + { "id" : 2, "upgrades" : 1 }, + { "id" : 3, "upgrades" : 2 }, + { "id" : 4, "upgrades" : 3 }, { "id" : 5 }, { "id" : 7 }, - { "id" : 8, "requires" : [ 7 ] }, - { "id" : 9, "requires" : [ 8 ] }, - { "id" : 10 }, - { "id" : 11, "requires" : [ 10, 5 ] }, - { "id" : 12, "requires" : [ 11, 0, 14, 16 ] }, - { "id" : 13, "requires" : [ 12, 9 ] }, + { "id" : 8, "upgrades" : 7 }, + { "id" : 9, "upgrades" : 8 }, + { "id" : 10, "mode" : "auto" }, + { "id" : 11, "upgrades" : 10, "requires" : [ 5 ] }, + { "id" : 12, "upgrades" : 11, "requires" : [ 0, 14, 16 ] }, + { "id" : 13, "upgrades" : 12, "requires" : [ 9 ] }, { "id" : 14 }, { "id" : 15, "requires" : [ 14 ] }, { "id" : 16 }, { "id" : 17, "requires" : [ 7 ] }, - { "id" : 18, "requires" : [ 30 ] }, - { "id" : 19, "requires" : [ 37 ] }, + { "id" : 18, "upgrades" : 30 }, + { "id" : 19, "upgrades" : 37, "requires" : [ 18 ], "mode" : "auto" }, { "id" : 21, "requires" : [ 14 ] }, { "id" : 22, "requires" : [ 16 ] }, { "id" : 23, "requires" : [ 7 ] }, - { "id" : 26 }, + { "id" : 26, "mode" : "grail"}, + { "id" : 27, "requires" : [ 11 ], "mode" : "auto" }, + { "id" : 28, "requires" : [ 12 ], "mode" : "auto" }, + { "id" : 29, "requires" : [ 13 ], "mode" : "auto" }, { "id" : 30, "requires" : [ 7 ] }, { "id" : 31, "requires" : [ 30 ] }, { "id" : 32, "requires" : [ 30 ] }, @@ -808,73 +819,73 @@ { "id" : 34, "requires" : [ 31 ] }, { "id" : 35, "requires" : [ 33 ] }, { "id" : 36, "requires" : [ 34 ] }, - { "id" : 37, "requires" : [ 30 ] }, - { "id" : 38, "requires" : [ 31, 37 ] }, - { "id" : 39, "requires" : [ 32, 16 ] }, - { "id" : 40, "requires" : [ 33, 0 ] }, - { "id" : 41, "requires" : [ 34 ] }, - { "id" : 42, "requires" : [ 35 ] }, - { "id" : 43, "requires" : [ 36 ] } + { "id" : 37, "upgrades" : 30 }, + { "id" : 38, "upgrades" : 31, "requires" : [ 37 ] }, + { "id" : 39, "upgrades" : 32, "requires" : [ 16 ] }, + { "id" : 40, "upgrades" : 33, "requires" : [ 0 ] }, + { "id" : 41, "upgrades" : 34 }, + { "id" : 42, "upgrades" : 35 }, + { "id" : 43, "upgrades" : 36 } ] - }, - + } + }, + "fortress" : + { + "index" : 7, + "nativeTerrain": "swamp", + "creatureBackground" : + { + "120px" : "TPCASFOR", + "130px" : "CRBKGFOR" + }, + "town" : { - // 7 - Fortress "structures" : [ - { "id" : 16, "defname" : "TBFRBLAK.def", "x" : 360, "y" : 160, "border" : "TOFAIDA.bmp", "area" : "TZFAIDA.bmp" }, - { "id" : 8, "defname" : "TBFRCAS2.def", "x" : 368, "y" : 98, "border" : "TOFCAS2.bmp", "area" : "TZFCAS2.bmp" }, - { "id" : 9, "defname" : "TBFRCAS3.def", "x" : 368, "y" : 55, "border" : "TOFCAS3.bmp", "area" : "TZFCAS3.bmp" }, - { "id" : 7, "defname" : "TBFRCSTL.def", "x" : 368, "y" : 118, "border" : "TOFCAS1.bmp", "area" : "TZFCAS1.bmp" }, - { "id" : 6, "defname" : "TBFRDOCK.def", "x" : 197, "y" : 294, "border" : "TOFDCK2.bmp", "area" : "TZFDCK2.bmp" }, - { "id" : 30, "defname" : "TBFRDW_0.def", "x" : 641, "y" : 168, "border" : "TOFGNL1.bmp", "area" : "TZFGNL1.bmp" }, - { "id" : 31, "defname" : "TBFRDW_1.def", "x" : 141, "y" : 178, "border" : "TOFLIZ1.bmp", "area" : "TZFLIZ1.bmp" }, - { "id" : 34, "defname" : "TBFRDW_2.def", "x" : 15, "y" : 127, "border" : "TOFGOR1.bmp", "area" : "TZFGOR1.bmp" }, - { "id" : 32, "defname" : "TBFRDW_3.def", "x" : 192, "y" : 85, "border" : "TOFFLY1A.bmp", "area" : "TZFFLY1A.bmp" }, - { "id" : 33, "defname" : "TBFRDW_4.def", "x" : 0, "y" : 292, "border" : "TOFBAS1.bmp", "area" : "TZFBAS1.bmp" }, - { "id" : 35, "defname" : "TBFRDW_5.def", "x" : 0, "y" : 4, "border" : "TOFWYV1.bmp", "area" : "TZFWYV1.bmp" }, - { "id" : 36, "defname" : "TBFRDW_6.def", "x" : 612, "y" : 291, "border" : "TOFHYD1A.bmp", "area" : "TZFHYD1A.bmp" }, - { "id" : 21, "defname" : "TBFREXT0.def", "x" : 341, "y" : 174, "border" : "TOFCASD.bmp", "area" : "TZFCASD.bmp" }, - { "id" : 22, "defname" : "TBFREXT1.def", "x" : 349, "y" : 79, "border" : "TOFCASA.bmp", "area" : "TZFCASA.bmp" }, - { "id" : -1, "defname" : "TBFREXT2.def", "x" : 372, "y" : 227 }, - { "id" : 11, "defname" : "TBFRHAL2.def", "x" : 166, "y" : 97, "border" : "TOFHAL2.bmp", "area" : "TZFHAL2.bmp" }, - { "id" : 12, "defname" : "TBFRHAL3.def", "x" : 166, "y" : 51, "border" : "TOFHAL3.bmp", "area" : "TZFHAL3.bmp" }, - { "id" : 13, "defname" : "TBFRHAL4.def", "x" : 166, "y" : 2, "border" : "TOFHAL4.bmp", "area" : "TZFHAL4.bmp" }, - { "id" : 10, "defname" : "TBFRHALL.def", "x" : 166, "y" : 128, "border" : "TOFHAL1.bmp", "area" : "TZFHAL1.bmp" }, - { "id" : 26, "defname" : "TBFRHOLY.def", "x" : 468, "y" : 260, "border" : "TOFHLYAA.bmp", "area" : "TZFHLYAA.bmp" }, - { "id" : 18, "defname" : "TBFRHRD1.def", "x" : 641, "y" : 121, "border" : "TOFGNL1H.bmp", "area" : "TZFGNL1H.bmp" }, - { "id" : 19, "defname" : "TBFRHRD2.def", "x" : 641, "y" : 68, "border" : "TOFGNL2H.bmp", "area" : "TZFGNL2H.bmp" }, - { "id" : 1, "defname" : "TBFRMAG2.def", "x" : 0, "y" : 177, "border" : "TOFMAG2A.bmp", "area" : "TZFMAG2A.bmp" }, - { "id" : 2, "defname" : "TBFRMAG3.def", "x" : 0, "y" : 135, "border" : "TOFMAG3A.bmp", "area" : "TZFMAG3A.bmp" }, - { "id" : 0, "defname" : "TBFRMAGE.def", "x" : 0, "y" : 200, "border" : "TOFMAG1A.bmp", "area" : "TZFMAG1A.bmp" }, - { "id" : 14, "defname" : "TBFRMARK.def", "x" : 382, "y" : 219, "border" : "TOFMRKAA.bmp", "area" : "TZFMRKAA.bmp" }, - { "id" : 15, "defname" : "TBFRSILO.def", "x" : 448, "y" : 210, "border" : "TOFMRK2A.bmp", "area" : "TZFMRK2A.bmp" }, - { "id" : 17, "defname" : "TBFRSPEC.def", "x" : 703, "y" : 36, "border" : "TOFCAGE.bmp", "area" : "TZFCAGE.bmp" }, - { "id" : 5, "defname" : "TBFRTVRN.def", "x" : 634, "y" : 219, "border" : "TOFTAVA.bmp", "area" : "TZFTAVA.bmp" }, - { "id" : 37, "defname" : "TBFRUP_0.def", "x" : 641, "y" : 107, "border" : "TOFGNL2.bmp", "area" : "TZFGNL2.bmp" }, - { "id" : 38, "defname" : "TBFRUP_1.def", "x" : 125, "y" : 163, "border" : "TOFLIZ2.bmp", "area" : "TZFLIZ2.bmp" }, - { "id" : 41, "defname" : "TBFRUP_2.def", "x" : 15, "y" : 69, "border" : "TOFGOR2.bmp", "area" : "TZFGOR2.bmp" }, - { "id" : 39, "defname" : "TBFRUP_3.def", "x" : 159, "y" : 19, "border" : "TOFFLY2A.bmp", "area" : "TZFFLY2A.bmp" }, - { "id" : 40, "defname" : "TBFRUP_4.def", "x" : 0, "y" : 257, "border" : "TOFBAS2.bmp", "area" : "TZFBAS2.bmp" }, - { "id" : 42, "defname" : "TBFRUP_5.def", "x" : 0, "y" : 4, "border" : "TOFWYV2.bmp", "area" : "TZFWYV2.bmp" }, - { "id" : 43, "defname" : "TBFRUP_6.def", "x" : 587, "y" : 263, "border" : "TOFHYD2A.bmp", "area" : "TZFHYD2A.bmp" }, - { "id" : 29, "defname" : "TBFRWTRW.def", "x" : 320, "y" : 141 }, - { "id" : 20, "defname" : "TBFRBOAT.def", "x" : 197, "y" : 294, "border" : "TOFDCK1.bmp", "area" : "TZFDCK1.bmp" } - ], - "groups" : - [ - [ 0, 1, 2, 3, 4 ], - [ 6, 20 ], - [ 7, 8, 9 ], - [ 10, 11, 12, 13 ], - [ 31, 38 ], - [ 32, 39 ], - [ 33, 40 ], - [ 34, 41 ], - [ 35, 42 ], - [ 36, 43 ], - [ 30, 37, 18, 19 ] + { "animation" : "TBFREXT2.def", "x" : 372, "y" : 227 }, + { "id" : 0, "animation" : "TBFRMAGE.def", "x" : 0, "y" : 200, "z" : -1, "border" : "TOFMAG1A.bmp", "area" : "TZFMAG1A.bmp" }, + { "id" : 1, "animation" : "TBFRMAG2.def", "x" : 0, "y" : 177, "z" : -1, "border" : "TOFMAG2A.bmp", "area" : "TZFMAG2A.bmp" }, + { "id" : 2, "animation" : "TBFRMAG3.def", "x" : 0, "y" : 135, "z" : -1, "border" : "TOFMAG3A.bmp", "area" : "TZFMAG3A.bmp" }, + { "id" : 5, "animation" : "TBFRTVRN.def", "x" : 634, "y" : 219, "z" : 3, "border" : "TOFTAVA.bmp", "area" : "TZFTAVA.bmp" }, + { "id" : 6, "animation" : "TBFRDOCK.def", "x" : 197, "y" : 294, "border" : "TOFDCK2.bmp", "area" : "TZFDCK2.bmp" }, + { "id" : 7, "animation" : "TBFRCSTL.def", "x" : 368, "y" : 118, "z" : -1, "border" : "TOFCAS1.bmp", "area" : "TZFCAS1.bmp" }, + { "id" : 8, "animation" : "TBFRCAS2.def", "x" : 368, "y" : 98, "z" : -1, "border" : "TOFCAS2.bmp", "area" : "TZFCAS2.bmp" }, + { "id" : 9, "animation" : "TBFRCAS3.def", "x" : 368, "y" : 55, "z" : -1, "border" : "TOFCAS3.bmp", "area" : "TZFCAS3.bmp" }, + { "id" : 10, "animation" : "TBFRHALL.def", "x" : 166, "y" : 128, "z" : 1, "border" : "TOFHAL1.bmp", "area" : "TZFHAL1.bmp" }, + { "id" : 11, "animation" : "TBFRHAL2.def", "x" : 166, "y" : 97, "z" : 1, "border" : "TOFHAL2.bmp", "area" : "TZFHAL2.bmp" }, + { "id" : 12, "animation" : "TBFRHAL3.def", "x" : 166, "y" : 51, "z" : 1, "border" : "TOFHAL3.bmp", "area" : "TZFHAL3.bmp" }, + { "id" : 13, "animation" : "TBFRHAL4.def", "x" : 166, "y" : 2, "z" : 1, "border" : "TOFHAL4.bmp", "area" : "TZFHAL4.bmp" }, + { "id" : 14, "animation" : "TBFRMARK.def", "x" : 382, "y" : 219, "z" : 4, "border" : "TOFMRKAA.bmp", "area" : "TZFMRKAA.bmp" }, + { "id" : 15, "animation" : "TBFRSILO.def", "x" : 448, "y" : 210, "z" : 2, "border" : "TOFMRK2A.bmp", "area" : "TZFMRK2A.bmp" }, + { "id" : 16, "animation" : "TBFRBLAK.def", "x" : 360, "y" : 160, "border" : "TOFAIDA.bmp", "area" : "TZFAIDA.bmp" }, + { "id" : 17, "animation" : "TBFRSPEC.def", "x" : 703, "y" : 36, "border" : "TOFCAGE.bmp", "area" : "TZFCAGE.bmp" }, + { "id" : 18, "animation" : "TBFRHRD1.def", "x" : 641, "y" : 121, "z" : 1, "border" : "TOFGNL1H.bmp", "area" : "TZFGNL1H.bmp", "hidden" : true }, + { "id" : 19, "animation" : "TBFRHRD2.def", "x" : 641, "y" : 68, "z" : 1, "border" : "TOFGNL2H.bmp", "area" : "TZFGNL2H.bmp", "hidden" : true, "builds" : 18 }, + { "id" : 20, "animation" : "TBFRBOAT.def", "x" : 197, "y" : 294, "z" : 1, "border" : "TOFDCK1.bmp", "area" : "TZFDCK1.bmp", "hidden" : true }, + { "id" : 21, "animation" : "TBFREXT0.def", "x" : 341, "y" : 174, "border" : "TOFCASD.bmp", "area" : "TZFCASD.bmp" }, + { "id" : 22, "animation" : "TBFREXT1.def", "x" : 349, "y" : 79, "z" : -2, "border" : "TOFCASA.bmp", "area" : "TZFCASA.bmp" }, + { "id" : 26, "animation" : "TBFRHOLY.def", "x" : 468, "y" : 260, "z" : 5, "border" : "TOFHLYAA.bmp", "area" : "TZFHLYAA.bmp" }, + { "id" : 29, "animation" : "TBFRWTRW.def", "x" : 320, "y" : 141 }, + { "id" : 30, "animation" : "TBFRDW_0.def", "x" : 641, "y" : 168, "z" : 1, "border" : "TOFGNL1.bmp", "area" : "TZFGNL1.bmp" }, + { "id" : 31, "animation" : "TBFRDW_1.def", "x" : 141, "y" : 178, "border" : "TOFLIZ1.bmp", "area" : "TZFLIZ1.bmp" }, + { "id" : 32, "animation" : "TBFRDW_3.def", "x" : 192, "y" : 85, "border" : "TOFFLY1A.bmp", "area" : "TZFFLY1A.bmp" }, + { "id" : 33, "animation" : "TBFRDW_4.def", "x" : 0, "y" : 292, "border" : "TOFBAS1.bmp", "area" : "TZFBAS1.bmp" }, + { "id" : 34, "animation" : "TBFRDW_2.def", "x" : 15, "y" : 127, "z" : -2, "border" : "TOFGOR1.bmp", "area" : "TZFGOR1.bmp" }, + { "id" : 35, "animation" : "TBFRDW_5.def", "x" : 0, "y" : 4, "border" : "TOFWYV1.bmp", "area" : "TZFWYV1.bmp" }, + { "id" : 36, "animation" : "TBFRDW_6.def", "x" : 612, "y" : 291, "z" : 5, "border" : "TOFHYD1A.bmp", "area" : "TZFHYD1A.bmp" }, + { "id" : 37, "animation" : "TBFRUP_0.def", "x" : 641, "y" : 107, "z" : 1, "border" : "TOFGNL2.bmp", "area" : "TZFGNL2.bmp" }, + { "id" : 38, "animation" : "TBFRUP_1.def", "x" : 125, "y" : 163, "border" : "TOFLIZ2.bmp", "area" : "TZFLIZ2.bmp" }, + { "id" : 39, "animation" : "TBFRUP_3.def", "x" : 159, "y" : 19, "border" : "TOFFLY2A.bmp", "area" : "TZFFLY2A.bmp" }, + { "id" : 40, "animation" : "TBFRUP_4.def", "x" : 0, "y" : 257, "border" : "TOFBAS2.bmp", "area" : "TZFBAS2.bmp" }, + { "id" : 41, "animation" : "TBFRUP_2.def", "x" : 15, "y" : 69, "z" : -2, "border" : "TOFGOR2.bmp", "area" : "TZFGOR2.bmp" }, + { "id" : 42, "animation" : "TBFRUP_5.def", "x" : 0, "y" : 4, "border" : "TOFWYV2.bmp", "area" : "TZFWYV2.bmp" }, + { "id" : 43, "animation" : "TBFRUP_6.def", "x" : 587, "y" : 263, "z" : 5, "border" : "TOFHYD2A.bmp", "area" : "TZFHYD2A.bmp" } ], + "musicTheme" : "music/FortressTown", + + "townBackground": "TBFRBACK.bmp", + "guildWindow": "TPMAGEFR.bmp", + "buildingsIcons": "HALLFORT.DEF", "hallBackground": "TPTHBKFR.BMP", "hallSlots": [ @@ -884,39 +895,41 @@ [ [ 30, 37 ], [ 31, 38 ], [ 32, 39 ], [ 33, 40 ] ], [ [ 34, 41 ], [ 35, 42 ], [ 36, 43 ] ] ], - "blit_order" : [ 16, 15, 14, 34, 41, 31, 38, 10, 11, 12, 13, 29, 0, 1, 2, 33, 40, 30, 18, 37, 19, 5, 36, 43, 26 ], "creatures" : [ [98, 99], [100, 101], [104, 105], [106, 107], [102, 103], [108, 109], [110, 111] ], "horde" : [ 0, -1 ], - "mage_guild" : 3, - "primary_resource" : 127, - "war_machine" : 6, + "mageGuild" : 3, + "primaryResource" : 127, + "warMachine" : 6, "buildings" : [ { "id" : 0 }, - { "id" : 1, "requires" : [ 0 ] }, - { "id" : 2, "requires" : [ 1 ] }, - { "id" : 3, "requires" : [ 2 ] }, - { "id" : 4, "requires" : [ 3 ] }, + { "id" : 1, "upgrades" : 0 }, + { "id" : 2, "upgrades" : 1 }, + { "id" : 3, "upgrades" : 2 }, + { "id" : 4, "upgrades" : 3 }, { "id" : 5 }, { "id" : 6 }, { "id" : 7 }, - { "id" : 8, "requires" : [ 7 ] }, - { "id" : 9, "requires" : [ 8 ] }, - { "id" : 10 }, - { "id" : 11, "requires" : [ 10, 5 ] }, - { "id" : 12, "requires" : [ 11, 0, 14, 16 ] }, - { "id" : 13, "requires" : [ 12, 9 ] }, + { "id" : 8, "upgrades" : 7 }, + { "id" : 9, "upgrades" : 8 }, + { "id" : 10, "mode" : "auto" }, + { "id" : 11, "upgrades" : 10, "requires" : [ 5 ] }, + { "id" : 12, "upgrades" : 11, "requires" : [ 0, 14, 16 ] }, + { "id" : 13, "upgrades" : 12, "requires" : [ 9 ] }, { "id" : 14 }, { "id" : 15, "requires" : [ 14 ] }, { "id" : 16 }, { "id" : 17, "requires" : [ 11, 21 ] }, - { "id" : 18, "requires" : [ 30 ] }, - { "id" : 19, "requires" : [ 37 ] }, - { "id" : 20 }, + { "id" : 18, "upgrades" : 30 }, + { "id" : 19, "upgrades" : 37, "requires" : [ 18 ], "mode" : "auto" }, + { "id" : 20, "upgrades" : 6 }, { "id" : 21, "requires" : [ 7 ] }, { "id" : 22, "requires" : [ 21 ] }, - { "id" : 26 }, + { "id" : 26, "mode" : "grail"}, + { "id" : 27, "requires" : [ 11 ], "mode" : "auto" }, + { "id" : 28, "requires" : [ 12 ], "mode" : "auto" }, + { "id" : 29, "requires" : [ 13 ], "mode" : "auto" }, { "id" : 30, "requires" : [ 7 ] }, { "id" : 31, "requires" : [ 30 ] }, { "id" : 32, "requires" : [ 30 ] }, @@ -924,77 +937,77 @@ { "id" : 34, "requires" : [ 31, 32 ] }, { "id" : 35, "requires" : [ 31 ] }, { "id" : 36, "requires" : [ 33, 35 ] }, - { "id" : 37, "requires" : [ 30, 5 ] }, - { "id" : 38, "requires" : [ 31 ] }, - { "id" : 39, "requires" : [ 32 ] }, - { "id" : 40, "requires" : [ 33 ] }, - { "id" : 41, "requires" : [ 34, 15 ] }, - { "id" : 42, "requires" : [ 35 ] }, - { "id" : 43, "requires" : [ 36 ] } + { "id" : 37, "upgrades" : 30, "requires" : [ 5 ] }, + { "id" : 38, "upgrades" : 31 }, + { "id" : 39, "upgrades" : 32 }, + { "id" : 40, "upgrades" : 33 }, + { "id" : 41, "upgrades" : 34, "requires" : [ 15 ] }, + { "id" : 42, "upgrades" : 35 }, + { "id" : 43, "upgrades" : 36 } ] - }, - + } + }, + "conflux" : + { + "index" : 8, + "nativeTerrain": "grass", + "creatureBackground" : + { + "120px" : "TPCASELE", + "130px" : "CRBKGELE" + }, + "town" : { - // 8 - Conflux "structures" : [ - { "id" : 16, "defname" : "TBELBLAK.def", "x" : 449, "y" : 151, "border" : "TOELBLAK.bmp", "area" : "TZELBLAK.bmp" }, - { "id" : 8, "defname" : "TBELCAS2.def", "x" : 349, "y" : 101, "border" : "TOELCAS2.bmp", "area" : "TZELCAS2.bmp" }, - { "id" : 9, "defname" : "TBELCAS3.def", "x" : 349, "y" : 101, "border" : "TOELCAS3.bmp", "area" : "TZELCAS3.bmp" }, - { "id" : 7, "defname" : "TBELCSTL.def", "x" : 349, "y" : 101, "border" : "TOELCSTL.bmp", "area" : "TZELCSTL.bmp" }, - { "id" : 6, "defname" : "TBELDOCK.def", "x" : 239, "y" : 215, "border" : "TOELDOCK.bmp", "area" : "TZELDOCK.bmp" }, - { "id" : 30, "defname" : "TBELDW_0.def", "x" : 689, "y" : 250, "border" : "TOELDW_0.bmp", "area" : "TZELDW_0.bmp" }, - { "id" : 31, "defname" : "TBELDW_1.def", "x" : 630, "y" : 50, "border" : "TOELDW_1.bmp", "area" : "TZELDW_1.bmp" }, - { "id" : 32, "defname" : "TBELDW_2.def", "x" : 709, "y" : 210, "border" : "TOELDW_2.bmp", "area" : "TZELDW_2.bmp" }, - { "id" : 33, "defname" : "TBELDW_3.def", "x" : 108, "y" : 131, "border" : "TOELDW_3.bmp", "area" : "TZELDW_3.bmp" }, - { "id" : 34, "defname" : "TBELDW_4.def", "x" : 264, "y" : 168, "border" : "TOELDW_4.bmp", "area" : "TZELDW_4.bmp" }, - { "id" : 35, "defname" : "TBELDW_5.def", "x" : 394, "y" : 283, "border" : "TOELDW_5.bmp", "area" : "TZELDW_5.bmp" }, - { "id" : 36, "defname" : "TBELDW_6.def", "x" : 43, "y" : 16, "border" : "TOELDW_6.bmp", "area" : "TZELDW_6.bmp" }, - { "id" : -1, "defname" : "TBELEXT1.def", "x" : 23, "y" : 218 }, - { "id" : 27, "defname" : "TBELEXT2.def", "x" : 232, "y" : 205 }, - { "id" : 28, "defname" : "TBELEXT3.def", "x" : 516, "y" : 223 }, - { "id" : 29, "defname" : "TBELEXT4.def", "x" : 0, "y" : 252 }, - { "id" : -2, "defname" : "TBELEXT5.def", "x" : 682, "y" : 183 }, - { "id" : 21, "defname" : "TBELEXT6.def", "x" : 104, "y" : 170, "border" : "TOELEXT6.bmp", "area" : "TZELEXT6.bmp" }, - { "id" : 11, "defname" : "TBELHAL2.def", "x" : 0, "y" : 165, "border" : "TOELHAL2.bmp", "area" : "TZELHAL2.bmp" }, - { "id" : 12, "defname" : "TBELHAL3.def", "x" : 0, "y" : 165, "border" : "TOELHAL3.bmp", "area" : "TZELHAL3.bmp" }, - { "id" : 13, "defname" : "TBELHAL4.def", "x" : 0, "y" : 164, "border" : "TOELHAL4.bmp", "area" : "TZELHAL4.bmp" }, - { "id" : 10, "defname" : "TBELHALL.def", "x" : -1, "y" : 164, "border" : "TOELHALL.bmp", "area" : "TZELHALL.bmp" }, - { "id" : 26, "defname" : "TBELHOLY.def", "x" : 307, "y" : 2, "border" : "TOELHOLY.bmp", "area" : "TZELHOLY.bmp" }, - { "id" : 18, "defname" : "TBELHRD1.def", "x" : 689, "y" : 250, "border" : "TOELHRD1.bmp", "area" : "TZELHRD1.bmp" }, - { "id" : 19, "defname" : "TBELHRD2.def", "x" : 689, "y" : 250, "border" : "TOELHRD2.bmp", "area" : "TZELHRD2.bmp" }, - { "id" : 1, "defname" : "TBELMAG2.def", "x" : 206, "y" : 58, "border" : "TOELMAG2.bmp", "area" : "TZELMAG2.bmp" }, - { "id" : 2, "defname" : "TBELMAG3.def", "x" : 206, "y" : 58, "border" : "TOELMAG3.bmp", "area" : "TZELMAG3.bmp" }, - { "id" : 3, "defname" : "TBELMAG4.def", "x" : 206, "y" : 58, "border" : "TOELMAG4.bmp", "area" : "TZELMAG4.bmp" }, - { "id" : 4, "defname" : "TBELMAG5.def", "x" : 206, "y" : 58, "border" : "TOELMAG5.bmp", "area" : "TZELMAG5.bmp" }, - { "id" : 0, "defname" : "TBELMAGE.def", "x" : 206, "y" : 58, "border" : "TOELMAGE.bmp", "area" : "TZELMAGE.bmp" }, - { "id" : 14, "defname" : "TBELMARK.def", "x" : 347, "y" : 216, "border" : "TOELMARK.bmp", "area" : "TZELMARK.bmp" }, - { "id" : 15, "defname" : "TBELSILO.def", "x" : 372, "y" : 171, "border" : "TOELSILO.bmp", "area" : "TZELSILO.bmp" }, - { "id" : 17, "defname" : "TBELSPEC.def", "x" : 284, "y" : 246, "border" : "TOELSPEC.bmp", "area" : "TZELSPEC.bmp" }, - { "id" : 5, "defname" : "TBELTVRN.def", "x" : 553, "y" : 203, "border" : "TOELTVRN.bmp", "area" : "TZELTVRN.bmp" }, - { "id" : 37, "defname" : "TBELUP_0.def", "x" : 689, "y" : 250, "border" : "TOELUP_0.bmp", "area" : "TZELUP_0.bmp" }, - { "id" : 38, "defname" : "TBELUP_1.def", "x" : 630, "y" : 50, "border" : "TOELUP_1.bmp", "area" : "TZELUP_1.bmp" }, - { "id" : 39, "defname" : "TBELUP_2.def", "x" : 709, "y" : 210, "border" : "TOELUP_2.bmp", "area" : "TZELUP_2.bmp" }, - { "id" : 40, "defname" : "TBELUP_3.def", "x" : 108, "y" : 131, "border" : "TOELUP_3.bmp", "area" : "TZELUP_3.bmp" }, - { "id" : 41, "defname" : "TBELUP_4.def", "x" : 264, "y" : 168, "border" : "TOELUP_4.bmp", "area" : "TZELUP_4.bmp" }, - { "id" : 42, "defname" : "TBELUP_5.def", "x" : 394, "y" : 283, "border" : "TOELUP_5.bmp", "area" : "TZELUP_5.bmp" }, - { "id" : 43, "defname" : "TBELUP_6.def", "x" : 43, "y" : 0, "border" : "TOELUP_6.bmp", "area" : "TZELUP_6.bmp" }, - { "id" : 20, "defname" : "TBELBOAT.def", "x" : 239, "y" : 215, "border" : "TOELBOAT.bmp", "area" : "TZELBOAT.bmp" } - ], - "groups" : - [ - [ 0, 1, 2, 3, 4 ], - [ 6, 20 ], - [ 7, 8, 9 ], - [ 10, 11, 12, 13 ], - [ 31, 38 ], - [ 32, 39 ], - [ 33, 40 ], - [ 34, 41 ], - [ 35, 42 ], - [ 36, 43 ], - [ 30, 37, 18, 19 ] + { "animation" : "TBELEXT5.def", "x" : 682, "y" : 183, "z" : -1, }, + { "animation" : "TBELEXT1.def", "x" : 23, "y" : 218 }, + { "id" : 0, "animation" : "TBELMAGE.def", "x" : 206, "y" : 58, "z" : 4, "border" : "TOELMAGE.bmp", "area" : "TZELMAGE.bmp" }, + { "id" : 1, "animation" : "TBELMAG2.def", "x" : 206, "y" : 58, "z" : 4, "border" : "TOELMAG2.bmp", "area" : "TZELMAG2.bmp" }, + { "id" : 2, "animation" : "TBELMAG3.def", "x" : 206, "y" : 58, "z" : 4, "border" : "TOELMAG3.bmp", "area" : "TZELMAG3.bmp" }, + { "id" : 3, "animation" : "TBELMAG4.def", "x" : 206, "y" : 58, "z" : 4, "border" : "TOELMAG4.bmp", "area" : "TZELMAG4.bmp" }, + { "id" : 4, "animation" : "TBELMAG5.def", "x" : 206, "y" : 58, "z" : 4, "border" : "TOELMAG5.bmp", "area" : "TZELMAG5.bmp" }, + { "id" : 5, "animation" : "TBELTVRN.def", "x" : 553, "y" : 203, "z" : 1, "border" : "TOELTVRN.bmp", "area" : "TZELTVRN.bmp" }, + { "id" : 6, "animation" : "TBELDOCK.def", "x" : 239, "y" : 215, "z" : 2, "border" : "TOELDOCK.bmp", "area" : "TZELDOCK.bmp" }, + { "id" : 7, "animation" : "TBELCSTL.def", "x" : 349, "y" : 101, "z" : -1, "border" : "TOELCSTL.bmp", "area" : "TZELCSTL.bmp" }, + { "id" : 8, "animation" : "TBELCAS2.def", "x" : 349, "y" : 101, "z" : -1, "border" : "TOELCAS2.bmp", "area" : "TZELCAS2.bmp" }, + { "id" : 9, "animation" : "TBELCAS3.def", "x" : 349, "y" : 101, "z" : -1, "border" : "TOELCAS3.bmp", "area" : "TZELCAS3.bmp" }, + { "id" : 10, "animation" : "TBELHALL.def", "x" : -1, "y" : 164, "z" : 5, "border" : "TOELHALL.bmp", "area" : "TZELHALL.bmp" }, + { "id" : 11, "animation" : "TBELHAL2.def", "x" : 0, "y" : 165, "z" : 5, "border" : "TOELHAL2.bmp", "area" : "TZELHAL2.bmp" }, + { "id" : 12, "animation" : "TBELHAL3.def", "x" : 0, "y" : 165, "z" : 5, "border" : "TOELHAL3.bmp", "area" : "TZELHAL3.bmp" }, + { "id" : 13, "animation" : "TBELHAL4.def", "x" : 0, "y" : 164, "z" : 5, "border" : "TOELHAL4.bmp", "area" : "TZELHAL4.bmp" }, + { "id" : 14, "animation" : "TBELMARK.def", "x" : 347, "y" : 216, "z" : 4, "border" : "TOELMARK.bmp", "area" : "TZELMARK.bmp" }, + { "id" : 15, "animation" : "TBELSILO.def", "x" : 372, "y" : 171, "z" : 2, "border" : "TOELSILO.bmp", "area" : "TZELSILO.bmp" }, + { "id" : 16, "animation" : "TBELBLAK.def", "x" : 449, "y" : 151, "z" : 1, "border" : "TOELBLAK.bmp", "area" : "TZELBLAK.bmp" }, + { "id" : 17, "animation" : "TBELSPEC.def", "x" : 284, "y" : 246, "z" : 4, "border" : "TOELSPEC.bmp", "area" : "TZELSPEC.bmp" }, + { "id" : 18, "animation" : "TBELHRD1.def", "x" : 689, "y" : 250, "border" : "TOELHRD1.bmp", "area" : "TZELHRD1.bmp", "hidden" : true }, + { "id" : 19, "animation" : "TBELHRD2.def", "x" : 689, "y" : 250, "border" : "TOELHRD2.bmp", "area" : "TZELHRD2.bmp", "hidden" : true, "builds" : 18 }, + { "id" : 20, "animation" : "TBELBOAT.def", "x" : 239, "y" : 215, "z" : 2, "border" : "TOELBOAT.bmp", "area" : "TZELBOAT.bmp", "hidden" : true }, + { "id" : 21, "animation" : "TBELEXT6.def", "x" : 104, "y" : 170, "z" : 3, "border" : "TOELEXT6.bmp", "area" : "TZELEXT6.bmp" }, + { "id" : 26, "animation" : "TBELHOLY.def", "x" : 307, "y" : 2, "border" : "TOELHOLY.bmp", "area" : "TZELHOLY.bmp" }, + { "id" : 27, "animation" : "TBELEXT2.def", "x" : 232, "y" : 205 }, + { "id" : 28, "animation" : "TBELEXT3.def", "x" : 516, "y" : 223, "z" : 1 }, + { "id" : 29, "animation" : "TBELEXT4.def", "x" : 0, "y" : 252, "z" : 6 }, + { "id" : 30, "animation" : "TBELDW_0.def", "x" : 689, "y" : 250, "border" : "TOELDW_0.bmp", "area" : "TZELDW_0.bmp" }, + { "id" : 31, "animation" : "TBELDW_1.def", "x" : 630, "y" : 50, "border" : "TOELDW_1.bmp", "area" : "TZELDW_1.bmp" }, + { "id" : 32, "animation" : "TBELDW_2.def", "x" : 709, "y" : 210, "z" : -1, "border" : "TOELDW_2.bmp", "area" : "TZELDW_2.bmp" }, + { "id" : 33, "animation" : "TBELDW_3.def", "x" : 108, "y" : 131, "z" : -1, "border" : "TOELDW_3.bmp", "area" : "TZELDW_3.bmp" }, + { "id" : 34, "animation" : "TBELDW_4.def", "x" : 264, "y" : 168, "z" : -1, "border" : "TOELDW_4.bmp", "area" : "TZELDW_4.bmp" }, + { "id" : 35, "animation" : "TBELDW_5.def", "x" : 394, "y" : 283, "z" : 2, "border" : "TOELDW_5.bmp", "area" : "TZELDW_5.bmp" }, + { "id" : 36, "animation" : "TBELDW_6.def", "x" : 43, "y" : 16, "z" : -2, "border" : "TOELDW_6.bmp", "area" : "TZELDW_6.bmp" }, + { "id" : 37, "animation" : "TBELUP_0.def", "x" : 689, "y" : 250, "border" : "TOELUP_0.bmp", "area" : "TZELUP_0.bmp" }, + { "id" : 38, "animation" : "TBELUP_1.def", "x" : 630, "y" : 50, "border" : "TOELUP_1.bmp", "area" : "TZELUP_1.bmp" }, + { "id" : 39, "animation" : "TBELUP_2.def", "x" : 709, "y" : 210, "z" : -1, "border" : "TOELUP_2.bmp", "area" : "TZELUP_2.bmp" }, + { "id" : 40, "animation" : "TBELUP_3.def", "x" : 108, "y" : 131, "z" : -1, "border" : "TOELUP_3.bmp", "area" : "TZELUP_3.bmp" }, + { "id" : 41, "animation" : "TBELUP_4.def", "x" : 264, "y" : 168, "z" : -1, "border" : "TOELUP_4.bmp", "area" : "TZELUP_4.bmp" }, + { "id" : 42, "animation" : "TBELUP_5.def", "x" : 394, "y" : 283, "z" : 2, "border" : "TOELUP_5.bmp", "area" : "TZELUP_5.bmp" }, + { "id" : 43, "animation" : "TBELUP_6.def", "x" : 43, "y" : 0, "z" : -2, "border" : "TOELUP_6.bmp", "area" : "TZELUP_6.bmp" }, ], + "musicTheme" : "music/ElemTown", + + "townBackground": "TBELBACK.bmp", + "guildWindow": "TPMAGEEL.bmp", + "buildingsIcons": "HALLELEM.DEF", "hallBackground": "TPTHBKFR.BMP", "hallSlots": [ @@ -1004,38 +1017,40 @@ [ [ 30, 37 ], [ 31, 38 ], [ 32, 39 ], [ 33, 40 ] ], [ [ 34, 41 ], [ 35, 42 ], [ 36, 43 ] ] ], - "blit_order" : [ -1, 27, 28, 16, 34, 41, 6, 20, 33, 40, 36, 43, 21, 0, 1, 2, 3, 4, 5, 15, 14, 17, 35, 42, 30, 18, 37, 19, 10, 11, 12, 13, 29 ], "creatures" : [ [118, 119], [112, 127], [115, 123], [114, 129], [113, 125], [120, 121], [130, 131] ], "horde" : [ 0, -1 ], - "mage_guild" : 5, - "primary_resource" : 1, - "war_machine" : 4, + "mageGuild" : 5, + "primaryResource" : 1, + "warMachine" : 4, "buildings" : [ { "id" : 0 }, - { "id" : 1, "requires" : [ 0 ] }, - { "id" : 2, "requires" : [ 1 ] }, - { "id" : 3, "requires" : [ 2 ] }, - { "id" : 4, "requires" : [ 3 ] }, + { "id" : 1, "upgrades" : 0 }, + { "id" : 2, "upgrades" : 1 }, + { "id" : 3, "upgrades" : 2 }, + { "id" : 4, "upgrades" : 3 }, { "id" : 5 }, { "id" : 6 }, { "id" : 7 }, - { "id" : 8, "requires" : [ 7 ] }, - { "id" : 9, "requires" : [ 8 ] }, - { "id" : 10 }, - { "id" : 11, "requires" : [ 10, 5 ] }, - { "id" : 12, "requires" : [ 11, 0, 14, 16 ] }, - { "id" : 13, "requires" : [ 12, 9 ] }, + { "id" : 8, "upgrades" : 7 }, + { "id" : 9, "upgrades" : 8 }, + { "id" : 10, "mode" : "auto" }, + { "id" : 11, "upgrades" : 10, "requires" : [ 5 ] }, + { "id" : 12, "upgrades" : 11, "requires" : [ 0, 14, 16 ] }, + { "id" : 13, "upgrades" : 12, "requires" : [ 9 ] }, { "id" : 14 }, { "id" : 15, "requires" : [ 14 ] }, { "id" : 16 }, { "id" : 17, "requires" : [ 14 ] }, - { "id" : 18, "requires" : [ 30 ] }, - { "id" : 19, "requires" : [ 37 ] }, - { "id" : 20 }, + { "id" : 18, "upgrades" : 30 }, + { "id" : 19, "upgrades" : 37, "requires" : [ 18 ], "mode" : "auto" }, + { "id" : 20, "upgrades" : 6 }, { "id" : 21, "requires" : [ 0 ] }, - { "id" : 26 }, + { "id" : 26, "mode" : "grail"}, + { "id" : 27, "requires" : [ 11 ], "mode" : "auto" }, + { "id" : 28, "requires" : [ 12 ], "mode" : "auto" }, + { "id" : 29, "requires" : [ 13 ], "mode" : "auto" }, { "id" : 30, "requires" : [ 7 ] }, { "id" : 31, "requires" : [ 30, 0 ] }, { "id" : 32, "requires" : [ 30, 0 ] }, @@ -1043,14 +1058,25 @@ { "id" : 34, "requires" : [ 32 ] }, { "id" : 35, "requires" : [ 33, 34 ] }, { "id" : 36, "requires" : [ 35 ] }, - { "id" : 37, "requires" : [ 30 ] }, - { "id" : 38, "requires" : [ 31 ] }, - { "id" : 39, "requires" : [ 32 ] }, - { "id" : 40, "requires" : [ 33, 31 ] }, - { "id" : 41, "requires" : [ 34 ] }, - { "id" : 42, "requires" : [ 35, 1 ] }, - { "id" : 43, "requires" : [ 36 ] } + { "id" : 37, "upgrades" : 30 }, + { "id" : 38, "upgrades" : 31 }, + { "id" : 39, "upgrades" : 32 }, + { "id" : 40, "upgrades" : 33, "requires" : [ 31 ] }, + { "id" : 41, "upgrades" : 34 }, + { "id" : 42, "upgrades" : 35, "requires" : [ 1 ] }, + { "id" : 43, "upgrades" : 36 } ] } - ] + }, + "neutral" : + { + "index" : 9, + "creatureBackground" : + { + "120px" : "TPCASNEU", + "130px" : "CRBKGNEU" + } + } + + } diff --git a/config/creature_backgrounds.json b/config/creature_backgrounds.json deleted file mode 100644 index 474fba5cf..000000000 --- a/config/creature_backgrounds.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - // Backgrounds for creatures. - // id: town ID (0 to 8, -1 is neutral) - // bg120: 100x120 background creature image - // bg130: 100x130 background creature image - - "backgrounds": [ - { "id": -1, "bg120": "TPCASNEU.bmp", "bg130": "CRBKGNEU.bmp" }, - { "id": 0, "bg120": "TPCASCAS.bmp", "bg130": "CRBKGCAS.bmp" }, - { "id": 1, "bg120": "TPCASRAM.bmp", "bg130": "CRBKGRAM.bmp" }, - { "id": 2, "bg120": "TPCASTOW.bmp", "bg130": "CRBKGTOW.bmp" }, - { "id": 3, "bg120": "TPCASINF.bmp", "bg130": "CRBKGINF.bmp" }, - { "id": 4, "bg120": "TPCASNEC.bmp", "bg130": "CRBKGNEC.bmp" }, - { "id": 5, "bg120": "TPCASDUN.bmp", "bg130": "CRBKGDUN.bmp" }, - { "id": 6, "bg120": "TPCASSTR.bmp", "bg130": "CRBKGSTR.bmp" }, - { "id": 7, "bg120": "TPCASFOR.bmp", "bg130": "CRBKGFOR.bmp" }, - { "id": 8, "bg120": "TPCASELE.bmp", "bg130": "CRBKGELE.bmp" } - ] -} diff --git a/config/creatures.json b/config/creatures.json index a6c070168..f4f397c02 100644 --- a/config/creatures.json +++ b/config/creatures.json @@ -1225,7 +1225,7 @@ "id": 116, "level": 4, "name": [ "GoldGolem" ], - "faction": -1, + "faction": 9, "ability_add": [ [ "SPELL_DAMAGE_REDUCTION", 85, -1, 0 ], //gold golems reduce dmg from spells [ "NON_LIVING", 0, 0, 0 ] ], //diamond golems are non-living "defname": "CGGOLE.DEF" @@ -1235,7 +1235,7 @@ "id": 117, "level": 5, "name": [ "DiamondGolem" ], - "faction": -1, + "faction": 9, "ability_add": [ [ "SPELL_DAMAGE_REDUCTION", 95, -1, 0 ], //diamond golems reduce dmg from spells [ "NON_LIVING", 0, 0, 0 ] ], //psychic elementals shouldn't get morale "defname": "CDGOLE.DEF" @@ -1357,7 +1357,7 @@ "id": 132, "level": 10, "name": [ "AzureDragon" ], - "faction": -1, + "faction": 9, "ability_add": [ [ "DRAGON_NATURE", 0, 0, 0 ], [ "TWO_HEX_ATTACK_BREATH", 0, 0, 0 ], //azure dragon's breath [ "FEARLESS", 0, 0, 0 ], //azure dragon is immune to fear @@ -1370,7 +1370,7 @@ "id": 133, "level": 10, "name": [ "CrystalDragon" ], - "faction": -1, + "faction": 9, "ability_add": [ [ "DRAGON_NATURE", 0, 0, 0 ] ], //crystal dragon is a dragon "ability_remove": [ "FLYING" ], "defname": "CCDRGN.DEF" @@ -1380,7 +1380,7 @@ "id": 134, "level": 8, "name": [ "FairieDragon" ], - "faction": -1, + "faction": 9, "ability_add": [ [ "DRAGON_NATURE", 0, 0, 0 ], //faerie dragon is a dragon [ "CASTS", 5, 0, 0 ], [ "CREATURE_SPELL_POWER", 500, 0, 0], //5 spell power per dragon @@ -1399,7 +1399,7 @@ "id": 135, "level": 10, "name": [ "RustDragon" ], - "faction": -1, + "faction": 9, "ability_add": [ [ "SPELL_AFTER_ATTACK", 100, 80, 0 ], //always reduce defense [ "ACID_BREATH", 25, 0, 20 ], //20% chance to do 25 damage [ "DRAGON_NATURE", 0, 0, 0 ] ], //rust dragon is a dragon @@ -1410,7 +1410,7 @@ "id": 136, "level": 6, "name": [ "Enchanter" ], - "faction": -1, + "faction": 9, "ability_add": [ [ "NO_WALL_PENALTY", 0, 0, 0 ], [ "ENCHANTER", 3, 28, 3], //air shield [ "ENCHANTER", 3, 41, 3], //bless @@ -1428,7 +1428,7 @@ "id": 137, "level": 4, "name": [ "Sharpshooter" ], - "faction": -1, + "faction": 9, "ability_add": [ [ "NO_WALL_PENALTY", 0, 0, 0 ], [ "NO_DISTANCE_PENALTY", 0, 0, 0 ] ], //Sharpshooter "defname": "CSHARP.DEF", @@ -1440,7 +1440,7 @@ "id": 138, "level": 1, "name": [ "Halfling" ], - "faction": -1, + "faction": 9, "defname": "CHALF.DEF", "projectile_defname": "PHALF.DEF", "projectile_spin": true @@ -1450,7 +1450,7 @@ "id": 139, "level": 1, "name": [ "Peasant" ], - "faction": -1, + "faction": 9, "defname": "CPEAS.DEF" }, @@ -1458,7 +1458,7 @@ "id": 140, "level": 2, "name": [ "Boar" ], - "faction": -1, + "faction": 9, "ability_add": [ [ "DOUBLE_WIDE", 0, 0, 0 ] ], //boar should be treated as double-wide "defname": "CBOAR.DEF" }, @@ -1467,7 +1467,7 @@ "id": 141, "level": 3, "name": [ "Mummy" ], - "faction": -1, + "faction": 9, "ability_add": [ [ "UNDEAD", 0, 0, 0 ] ], "defname": "CMUMMY.DEF" }, @@ -1476,7 +1476,7 @@ "id": 142, "level": 3, "name": [ "warrior" ], - "faction": -1, + "faction": 9, "ability_add": [ [ "DOUBLE_WIDE", 0, 0, 0 ] ], //nomads should be treated as double-wide "defname": "CNOMAD.DEF" }, @@ -1485,7 +1485,7 @@ "id": 143, "level": 2, "name": [ "Rogue" ], - "faction": -1, + "faction": 9, "defname": "CROGUE.DEF" }, @@ -1493,7 +1493,7 @@ "id": 144, "level": 5, "name": [ "OgreShaman" ], - "faction": -1, + "faction": 9, "ability_add": [ [ "FULL_HP_REGENERATION", 0, 0, 0 ] ], //troll "defname": "CTROLL.DEF" }, @@ -1502,7 +1502,7 @@ "id": 145, "level": 0, "name": [ "Catapult" ], - "faction": -1, + "faction": 9, "defname": "SMCATA.DEF", "projectile_defname": "SMCATX.DEF", "projectile_spin": true @@ -1512,7 +1512,7 @@ "id": 146, "level": 0, "name": [ "Ballista" ], - "faction": -1, + "faction": 9, "defname": "SMBAL.DEF", "projectile_defname": "SMBALX.DEF", "projectile_spin": false @@ -1522,7 +1522,7 @@ "id": 147, "level": 0, "name": [ "FirstAidTent" ], - "faction": -1, + "faction": 9, "ability_add": [ [ "HEALER", 0, 0, 0 ] ], //Gorynyches fly "defname": "SMTENT.DEF" }, @@ -1531,7 +1531,7 @@ "id": 148, "level": 0, "name": [ "AmmoCart" ], - "faction": -1, + "faction": 9, "ability_add": [ [ "NOT_ACTIVE", 0, 0, 0 ] ], //hell hound doesn't fly "defname": "SMCART.DEF" }, @@ -1540,7 +1540,7 @@ "id": 149, "level": 0, "name": [ "ArrowTower" ], - "faction": -1, + "faction": 9, "ability_add": [ [ "SHOOTER", 0, 0, 0 ] ], //cerberus doesn't fly "defname": "x" }, @@ -1627,7 +1627,7 @@ "id": 159, "level": 0, "name": [ "Ghost" ], - "faction": -1, + "faction": 9, "defname": "ZM159G.DEF" }, @@ -1635,7 +1635,7 @@ "id": 160, "level": 0, "name": [ "God1War" ], - "faction": -1, + "faction": 9, "defname": "ZM160G.DEF" }, @@ -1643,7 +1643,7 @@ "id": 161, "level": 0, "name": [ "God2Peace" ], - "faction": -1, + "faction": 9, "defname": "ZM161G.DEF" }, @@ -1651,7 +1651,7 @@ "id": 162, "level": 0, "name": [ "God3Mana" ], - "faction": -1, + "faction": 9, "defname": "ZM162G.DEF" }, @@ -1659,7 +1659,7 @@ "id": 163, "level": 0, "name": [ "God4Lore" ], - "faction": -1, + "faction": 9, "defname": "ZM163G.DEF" }, @@ -1667,7 +1667,7 @@ "id": 164, "level": 0, "name": [ "MinotaurKing" ], - "faction": -1, + "faction": 9, "defname": "ZM164GD.DEF" }, @@ -1675,7 +1675,7 @@ "id": 165, "level": 0, "name": [ "MineralElemental" ], - "faction": -1, + "faction": 9, "defname": "ZM165GD.DEF" }, @@ -1683,7 +1683,7 @@ "id": 166, "level": 0, "name": [ "ElectricityElemental" ], - "faction": -1, + "faction": 9, "defname": "ZM166GD.DEF" }, @@ -1691,7 +1691,7 @@ "id": 167, "level": 0, "name": [ "AncientBasilisk" ], - "faction": -1, + "faction": 9, "defname": "ZM167GD.DEF" }, @@ -1699,7 +1699,7 @@ "id": 168, "level": 0, "name": [ "Gorynych" ], - "faction": -1, + "faction": 9, "ability_add": [ [ "FLYING", 0, 0, 0 ] ], "defname": "ZM168DG.DEF" }, @@ -1708,7 +1708,7 @@ "id": 169, "level": 0, "name": [ "WarZealot" ], - "faction": -1, + "faction": 9, "defname": "ZM169ZL.DEF", "projectile_defname": "CPRZEAX.DEF", "projectile_spin": false @@ -1718,7 +1718,7 @@ "id": 170, "level": 0, "name": [ "Myriad" ], - "faction": -1, + "faction": 9, "defname": "ZM170SW.DEF", "projectile_defname": "PLCBOWX.DEF", "projectile_spin": false @@ -1728,7 +1728,7 @@ "id": 171, "level": 0, "name": [ "MedusaMatriarch" ], - "faction": -1, + "faction": 9, "defname": "ZM171SR.DEF", "projectile_defname": "PLCBOWX.DEF", "projectile_spin": false @@ -1738,7 +1738,7 @@ "id": 172, "level": 0, "name": [ "Nightmare" ], - "faction": -1, + "faction": 9, "defname": "ZM172N.DEF" }, @@ -1746,7 +1746,7 @@ "id": 173, "level": 0, "name": [ "SantaGremlin" ], - "faction": -1, + "faction": 9, "defname": "ZM173M.DEF", "projectile_defname": "CPRGRE.DEF", "projectile_spin": true @@ -1756,7 +1756,7 @@ "id": 174, "level": 0, "name": [ "Paladin1" ], - "faction": -1, + "faction": 9, "ability_add": [ [ "MAGIC_RESISTANCE", 5, 0, 0 ], [ "CASTS", 1, 0, 0 ] , [ "CREATURE_ENCHANT_POWER", 1, 0, 0 ] , @@ -1769,7 +1769,7 @@ "id": 175, "level": 0, "name": [ "Hierophant1" ], - "faction": -1, + "faction": 9, "ability_add": [ [ "MAGIC_RESISTANCE", 5, 0, 0 ], [ "CASTS", 1, 0, 0 ] , [ "CREATURE_ENCHANT_POWER", 1, 0, 0 ] , @@ -1782,7 +1782,7 @@ "id": 176, "level": 0, "name": [ "TempleGuardian1" ], - "faction": -1, + "faction": 9, "ability_add": [ [ "MAGIC_RESISTANCE", 5, 0, 0 ], [ "CASTS", 1, 0, 0 ] , [ "CREATURE_ENCHANT_POWER", 1, 0, 0 ] , @@ -1795,7 +1795,7 @@ "id": 177, "level": 0, "name": [ "Succubus1" ], - "faction": -1, + "faction": 9, "ability_add": [ [ "MAGIC_RESISTANCE", 5, 0, 0 ], [ "CASTS", 1, 0, 0 ] , [ "CREATURE_ENCHANT_POWER", 1, 0, 0 ] , @@ -1808,7 +1808,7 @@ "id": 178, "level": 0, "name": [ "SoulEater1" ], - "faction": -1, + "faction": 9, "ability_add": [ [ "MAGIC_RESISTANCE", 5, 0, 0 ], [ "CASTS", 1, 0, 0 ] , [ "CREATURE_ENCHANT_POWER", 1, 0, 0 ] , @@ -1821,7 +1821,7 @@ "id": 179, "level": 0, "name": [ "Brute1" ], - "faction": -1, + "faction": 9, "ability_add": [ [ "MAGIC_RESISTANCE", 5, 0, 0 ], [ "CASTS", 1, 0, 0 ] , [ "CREATURE_ENCHANT_POWER", 1, 0, 0 ] , @@ -1834,7 +1834,7 @@ "id": 180, "level": 0, "name": [ "OgreLeader1" ], - "faction": -1, + "faction": 9, "ability_add": [ [ "MAGIC_RESISTANCE", 5, 0, 0 ], [ "CASTS", 1, 0, 0 ] , [ "CREATURE_ENCHANT_POWER", 1, 0, 0 ] , @@ -1847,7 +1847,7 @@ "id": 181, "level": 0, "name": [ "Shaman1" ], - "faction": -1, + "faction": 9, "ability_add": [ [ "MAGIC_RESISTANCE", 5, 0, 0 ], [ "CASTS", 1, 0, 0 ] , [ "CREATURE_ENCHANT_POWER", 1, 0, 0 ] , @@ -1860,7 +1860,7 @@ "id": 182, "level": 0, "name": [ "AstralSpirit1" ], - "faction": -1, + "faction": 9, "ability_add": [ [ "MAGIC_RESISTANCE", 5, 0, 0 ], [ "CASTS", 1, 0, 0 ] , [ "CREATURE_ENCHANT_POWER", 1, 0, 0 ] , @@ -1873,7 +1873,7 @@ "id": 183, "level": 0, "name": [ "Paladin2" ], - "faction": -1, + "faction": 9, "defname": "ZM174NPC.DEF" }, @@ -1881,7 +1881,7 @@ "id": 184, "level": 0, "name": [ "Hierophant2" ], - "faction": -1, + "faction": 9, "defname": "ZM175NPC.DEF" }, @@ -1889,7 +1889,7 @@ "id": 185, "level": 0, "name": [ "TempleGuardian2" ], - "faction": -1, + "faction": 9, "defname": "ZM176NPC.DEF" }, @@ -1897,7 +1897,7 @@ "id": 186, "level": 0, "name": [ "Succubus2" ], - "faction": -1, + "faction": 9, "defname": "ZM177NPC.DEF" }, @@ -1905,7 +1905,7 @@ "id": 187, "level": 0, "name": [ "SoulEater2" ], - "faction": -1, + "faction": 9, "defname": "ZM178NPC.DEF" }, @@ -1913,7 +1913,7 @@ "id": 188, "level": 0, "name": [ "Brute2" ], - "faction": -1, + "faction": 9, "defname": "ZM179NPC.DEF" }, @@ -1921,7 +1921,7 @@ "id": 189, "level": 0, "name": [ "OgreLeader2" ], - "faction": -1, + "faction": 9, "defname": "ZM180NPC.DEF" }, @@ -1929,7 +1929,7 @@ "id": 190, "level": 0, "name": [ "Shaman2" ], - "faction": -1, + "faction": 9, "defname": "ZM181NPC.DEF" }, @@ -1937,7 +1937,7 @@ "id": 191, "level": 0, "name": [ "AstralSpirit2" ], - "faction": -1, + "faction": 9, "defname": "ZM182NPC.DEF" }, @@ -1945,7 +1945,7 @@ "id": 192, "level": 0, "name": [ "SylvanCentaur" ], - "faction": -1, + "faction": 9, "defname": "ZM192Z.DEF", "projectile_defname": "PELFX.DEF", "projectile_spin": false @@ -1955,7 +1955,7 @@ "id": 193, "level": 0, "name": [ "Sorceress" ], - "faction": -1, + "faction": 9, "defname": "ZM193Z.DEF", "projectile_defname": "CPRZEAX.DEF", "projectile_spin": false @@ -1965,7 +1965,7 @@ "id": 194, "level": 0, "name": [ "Werewolf" ], - "faction": -1, + "faction": 9, "defname": "ZM194Z.DEF" }, @@ -1973,7 +1973,7 @@ "id": 195, "level": 0, "name": [ "HellSteed" ], - "faction": -1, + "faction": 9, "defname": "ZM195Z.DEF" }, @@ -1981,7 +1981,7 @@ "id": 196, "level": 0, "name": [ "Dracolich" ], - "faction": -1, + "faction": 9, "defname": "ZM196Z.DEF", "projectile_defname": "SMBALX.DEF", "projectile_spin": false diff --git a/config/defaultMods.json b/config/defaultMods.json index 69ae0ecb3..b207621d0 100644 --- a/config/defaultMods.json +++ b/config/defaultMods.json @@ -6,6 +6,7 @@ "CREEP_SIZE": 4000, "WEEKLY_GROWTH_PERCENT" : 10, "NEUTRAL_STACK_EXP_DAILY" : 500, + "MAX_BUILDING_PER_TURN" : 1, "DWELLINGS_ACCUMULATE_CREATURES" : true, "ALL_CREATURES_GET_DOUBLE_MONTHS" : false }, @@ -16,4 +17,4 @@ "COMMANDERS": true, "MITHRIL": false //so far unused } -} \ No newline at end of file +} diff --git a/config/terrains.json b/config/terrains.json index 5fc82be11..a167fe0aa 100644 --- a/config/terrains.json +++ b/config/terrains.json @@ -1,52 +1,13 @@ { - // Terrains properties related to heroes - ordered by faction (0 to 8) - // cost: ?? - // native: native terrain for the faction - - "terrains": [ - { - "costs": [ 100, 150, 100, 150, 175, 125, 100, 100, 100, -1 ], - "native": 2 - }, - - { - "costs": [ 100, 150, 100, 150, 175, 125, 100, 100, 100, -1 ], - "native": 2 - }, - - { - "costs": [ 100, 150, 100, 100, 175, 125, 100, 100, 100, -1 ], - "native": 3 - }, - - { - "costs": [ 100, 150, 100, 150, 175, 125, 100, 100, 100, -1 ], - "native": 7 - }, - - { - "costs": [ 100, 150, 100, 150, 175, 125, 100, 100, 100, -1 ], - "native": 0 - }, - - { - "costs": [ 100, 150, 100, 150, 175, 125, 100, 100, 100, -1 ], - "native": 6 - }, - - { - "costs": [ 100, 150, 100, 150, 175, 100, 100, 100, 100, -1 ], - "native": 5 - }, - - { - "costs": [ 100, 150, 100, 150, 100, 125, 100, 100, 100, -1 ], - "native": 4 - }, - - { - "costs": [ 100, 150, 100, 150, 175, 125, 100, 100, 100, -1 ], - "native": 2 - } - ] + // Movement costs on different terrains + "dirt" : 100, + "sand" : 150, + "grass" : 100, + "snow" : 150, + "swamp" : 175, + "rough" : 125, + "subterra" : 100, + "lava" : 100, + "water" : 100, + "rock" : -1, } diff --git a/config/town_pictures.json b/config/town_pictures.json deleted file mode 100644 index fe07a8361..000000000 --- a/config/town_pictures.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - // Some town pictures, ordered by the town number (0 to 8) - // town_background: background inside the town - // guild_background: background inside the mage guild - // building_picture: picture inside the city hall - "town_pictures": [ - { "town_background": "TBCSBACK.bmp", "guild_background": "TPMAGECS.bmp", "building_picture": "HALLCSTL.DEF" }, - { "town_background": "TBRMBACK.bmp", "guild_background": "TPMAGERM.bmp", "building_picture": "HALLRAMP.DEF" }, - { "town_background": "TBTWBACK.bmp", "guild_background": "TPMAGETW.bmp", "building_picture": "HALLTOWR.DEF" }, - { "town_background": "TBINBACK.bmp", "guild_background": "TPMAGEIN.bmp", "building_picture": "HALLINFR.DEF" }, - { "town_background": "TBNCBACK.bmp", "guild_background": "TPMAGENC.bmp", "building_picture": "HALLNECR.DEF" }, - { "town_background": "TBDNBACK.bmp", "guild_background": "TPMAGEDN.bmp", "building_picture": "HALLDUNG.DEF" }, - { "town_background": "TBSTBACK.bmp", "guild_background": "TPMAGEST.bmp", "building_picture": "HALLSTRN.DEF" }, - { "town_background": "TBFRBACK.bmp", "guild_background": "TPMAGEFR.bmp", "building_picture": "HALLFORT.DEF" }, - { "town_background": "TBELBACK.bmp", "guild_background": "TPMAGEEL.bmp", "building_picture": "HALLELEM.DEF" } - ] -} diff --git a/lib/BattleState.cpp b/lib/BattleState.cpp index 3d23bb6b9..5e2661d59 100644 --- a/lib/BattleState.cpp +++ b/lib/BattleState.cpp @@ -596,7 +596,7 @@ BattleInfo * BattleInfo::setupBattle( int3 tile, int terrain, int battlefieldTyp { curB->town = town; curB->siege = town->fortLevel(); - curB->terrainType = VLC->heroh->nativeTerrains[town->town->typeID]; + curB->terrainType = VLC->townh->factions[town->town->typeID].nativeTerrain; } else { diff --git a/lib/CBattleCallback.cpp b/lib/CBattleCallback.cpp index 3203bedfa..04c1cfd46 100644 --- a/lib/CBattleCallback.cpp +++ b/lib/CBattleCallback.cpp @@ -321,7 +321,7 @@ bool CBattleInfoEssentials::battleCanFlee(int player) const if(mySide == BattleSide::DEFENDER && battleGetSiegeLevel()) { auto town = battleGetDefendedTown(); - if(!(town->subID == 6 && town->hasBuilt(EBuilding::SPECIAL_1))) //not a stronghold with escape tunnel + if(!town->hasBuilt(EBuilding::ESCAPE_TUNNEL, ETownType::STRONGHOLD)) return false; } diff --git a/lib/CCreatureHandler.cpp b/lib/CCreatureHandler.cpp index b467d221c..1254854de 100644 --- a/lib/CCreatureHandler.cpp +++ b/lib/CCreatureHandler.cpp @@ -5,7 +5,7 @@ #include "Filesystem/CResourceLoader.h" #include "VCMI_Lib.h" #include "CGameState.h" -#include "CHeroHandler.h" +#include "CTownHandler.h" #include "CModHandler.h" using namespace boost::assign; @@ -148,11 +148,9 @@ std::string CCreature::nodeName() const bool CCreature::isItNativeTerrain(int terrain) const { - if(!vstd::iswithin(faction, 0, 9)) - return false; - + assert(vstd::contains(VLC->townh->factions, faction)); //not good handler dependency - return VLC->heroh->nativeTerrains[faction] == terrain; + return VLC->townh->factions[faction].nativeTerrain == terrain; } int readNumber(int & befi, int & i, int andame, std::string & buf) //helper function for void CCreatureHandler::loadCreatures() and loadUnitAnimInfo() diff --git a/lib/CGameState.cpp b/lib/CGameState.cpp index 240db5409..7dbe442eb 100644 --- a/lib/CGameState.cpp +++ b/lib/CGameState.cpp @@ -528,7 +528,12 @@ std::pair CGameState::pickObject (CGObjectInstance *obj) { f = scenarioOps->getIthPlayersSettings(align).castle; } - if(f<0) f = ran()%VLC->townh->towns.size(); + if(f<0) + { + auto iter = VLC->townh->towns.begin(); + std::advance(iter, ran()%VLC->townh->towns.size()); + f = iter->first; + } return std::pair(GameConstants::TOWNI_TYPE,f); } case 162: //random monster lvl5 @@ -1290,15 +1295,15 @@ void CGameState::init(StartInfo * si) if(vti->builtBuildings.find(-50)!=vti->builtBuildings.end()) //give standard set of buildings { vti->builtBuildings.erase(-50); - vti->builtBuildings.insert(10); - vti->builtBuildings.insert(5); - vti->builtBuildings.insert(30); + vti->builtBuildings.insert(EBuilding::VILLAGE_HALL); + vti->builtBuildings.insert(EBuilding::TAVERN); + vti->builtBuildings.insert(EBuilding::DWELL_FIRST); if(ran()%2) - vti->builtBuildings.insert(31); + vti->builtBuildings.insert(EBuilding::DWELL_FIRST+1); } - if (vstd::contains(vti->builtBuildings,(6)) && vti->state()==2) - vti->builtBuildings.erase(6);//if we have harbor without water - erase it (this is H3 behaviour) + if (vstd::contains(vti->builtBuildings, EBuilding::SHIPYARD) && vti->state()==2) + vti->builtBuildings.erase(EBuilding::SHIPYARD);//if we have harbor without water - erase it (this is H3 behaviour) //init hordes for (int i = 0; ibuiltBuildings.erase(-31-i);//remove old ID if (vti->town->hordeLvl[0] == i)//if town first horde is this one { - vti->builtBuildings.insert(18);//add it - if (vstd::contains(vti->builtBuildings,(37+i)))//if we have upgraded dwelling as well - vti->builtBuildings.insert(19);//add it as well + vti->builtBuildings.insert(EBuilding::HORDE_1);//add it + if (vstd::contains(vti->builtBuildings,(EBuilding::DWELL_UP_FIRST+i)))//if we have upgraded dwelling as well + vti->builtBuildings.insert(EBuilding::HORDE_1_UPGR);//add it as well } if (vti->town->hordeLvl[1] == i)//if town second horde is this one { - vti->builtBuildings.insert(24); - if (vstd::contains(vti->builtBuildings,(37+i))) - vti->builtBuildings.insert(25); + vti->builtBuildings.insert(EBuilding::HORDE_2); + if (vstd::contains(vti->builtBuildings,(EBuilding::DWELL_UP_FIRST+i))) + vti->builtBuildings.insert(EBuilding::HORDE_2_UPGR); } } @@ -1327,9 +1332,9 @@ void CGameState::init(StartInfo * si) { ev->buildings.erase(-31-i); if (vti->town->hordeLvl[0] == i) - ev->buildings.insert(18); + ev->buildings.insert(EBuilding::HORDE_1); if (vti->town->hordeLvl[1] == i) - ev->buildings.insert(24); + ev->buildings.insert(EBuilding::HORDE_2); } } //init spells @@ -2058,7 +2063,7 @@ int CGameState::victoryCheck( ui8 player ) const BOOST_FOREACH(const CGTownInstance *t, map->towns) if((t == map->victoryCondition.obj || !map->victoryCondition.obj) && t->tempOwner == player - && vstd::contains(t->builtBuildings, EBuilding::GRAIL)) + && t->hasBuilt(EBuilding::GRAIL)) return 1; break; @@ -2687,7 +2692,7 @@ void InfoAboutTown::initFromTown(const CGTownInstance *t, bool detailed) //include details about hero details = new Details; details->goldIncome = t->dailyIncome(); - details->customRes = vstd::contains(t->builtBuildings, 15); + details->customRes = t->hasBuilt(EBuilding::RESOURCE_SILO); details->hallLevel = t->hallLevel(); details->garrisonedHero = t->garrisonHero; } diff --git a/lib/CHeroHandler.cpp b/lib/CHeroHandler.cpp index 569c73f3f..6d6a770cc 100644 --- a/lib/CHeroHandler.cpp +++ b/lib/CHeroHandler.cpp @@ -356,26 +356,11 @@ ui64 CHeroHandler::reqExp (ui32 level) const void CHeroHandler::loadTerrains() { - int faction = 0; const JsonNode config(ResourceID("config/terrains.json")); - nativeTerrains.resize(GameConstants::F_NUMBER); - - BOOST_FOREACH(const JsonNode &terrain, config["terrains"].Vector()) { - - BOOST_FOREACH(const JsonNode &cost, terrain["costs"].Vector()) { - int curCost = cost.Float(); - - heroClasses[2*faction]->terrCosts.push_back(curCost); - heroClasses[2*faction+1]->terrCosts.push_back(curCost); - } - - nativeTerrains[faction] = terrain["native"].Float(); - - faction ++; - } - - assert(faction == GameConstants::F_NUMBER); + terrCosts.reserve(GameConstants::TERRAIN_TYPES); + BOOST_FOREACH(const std::string & name, GameConstants::TERRAIN_NAMES) + terrCosts.push_back(config[name].Float()); } CHero::CHero() diff --git a/lib/CHeroHandler.h b/lib/CHeroHandler.h index efe28c699..4039d4123 100644 --- a/lib/CHeroHandler.h +++ b/lib/CHeroHandler.h @@ -69,7 +69,6 @@ public: std::vector > primChance;//primChance[PRIMARY_SKILL_ID] - first is for levels 2 - 9, second for 10+;;; probability (%) of getting point of primary skill when getting new level std::vector proSec; //probabilities of gaining secondary skills (out of 112), in id order int selectionProbability[9]; //probability of selection in towns - std::vector terrCosts; //default costs of going through terrains: dirt, sand, grass, snow, swamp, rough, subterranean, lava, water, rock; -1 means terrain is imapassable int chooseSecSkill(const std::set & possibles) const; //picks secondary skill out from given possibilities CHeroClass(); //c-tor @@ -78,7 +77,7 @@ public: template void serialize(Handler &h, const int version) { h & skillLimit & name & aggression & initialAttack & initialDefence & initialPower & initialKnowledge & primChance - & proSec & selectionProbability & terrCosts & alignment; + & proSec & selectionProbability & alignment; } EAlignment::EAlignment getAlignment(); }; @@ -125,6 +124,9 @@ public: std::vector< ConstTransitivePtr > heroes; //changed from nodrze std::vector heroClasses; std::vector expPerLevel; //expPerLEvel[i] is amount of exp needed to reach level i; if it is not in this vector, multiplicate last value by 1,2 to get next value + + //default costs of going through terrains: dirt, sand, grass, snow, swamp, rough, subterranean, lava, water, rock; -1 means terrain is imapassable + std::vector terrCosts; struct SBallisticsLevelInfo { @@ -142,8 +144,6 @@ public: std::map obstacles; //info about obstacles that may be placed on battlefield std::map absoluteObstacles; //info about obstacles that may be placed on battlefield - std::vector nativeTerrains; //info about native terrains of different factions - void loadObstacles(); //loads info about obstacles std::vector puzzleInfo[GameConstants::F_NUMBER]; //descriptions of puzzles @@ -161,7 +161,7 @@ public: template void serialize(Handler &h, const int version) { - h & heroClasses & heroes & expPerLevel & ballistics & nativeTerrains & puzzleInfo; + h & heroClasses & heroes & expPerLevel & ballistics & terrCosts & puzzleInfo; h & obstacles & absoluteObstacles; if(!h.saving) { diff --git a/lib/CModHandler.cpp b/lib/CModHandler.cpp index 3de87c2d2..20188bf5a 100644 --- a/lib/CModHandler.cpp +++ b/lib/CModHandler.cpp @@ -53,6 +53,7 @@ void CModHandler::loadConfigFromFile (std::string name) settings.CREEP_SIZE = hardcodedFeatures["CREEP_SIZE"].Float(); settings.WEEKLY_GROWTH = hardcodedFeatures["WEEKLY_GROWTH_PERCENT"].Float(); settings.NEUTRAL_STACK_EXP = hardcodedFeatures["NEUTRAL_STACK_EXP_DAILY"].Float(); + settings.MAX_BUILDING_PER_TURN = hardcodedFeatures["MAX_BUILDING_PER_TURN"].Float(); settings.DWELLINGS_ACCUMULATE_CREATURES = hardcodedFeatures["DWELLINGS_ACCUMULATE_CREATURES"].Bool(); settings.ALL_CREATURES_GET_DOUBLE_MONTHS = hardcodedFeatures["ALL_CREATURES_GET_DOUBLE_MONTHS"].Bool(); @@ -125,11 +126,7 @@ CCreature * CModHandler::loadCreature (const JsonNode &node) if (!value->isNull()) cre->addBonus(value->Float(), Bonus::CASTS); - value = &node["doubleWide"]; - if (!value->isNull()) - cre->doubleWide = value->Bool(); - else - cre->doubleWide = false; + cre->doubleWide = value->Bool(); value = &node["abilities"]; if (!value->isNull()) @@ -191,7 +188,7 @@ void CModHandler::recreateHandlers() { //TODO: consider some template magic to unify all handlers? - VLC->arth->artifacts.clear(); + VLC->arth->artifacts.clear(); VLC->creh->creatures.clear(); //TODO: what about items from original game? BOOST_FOREACH (auto mod, activeMods) @@ -213,4 +210,4 @@ void CModHandler::recreateHandlers() CModHandler::~CModHandler() { -} \ No newline at end of file +} diff --git a/lib/CModHandler.h b/lib/CModHandler.h index c8c744fe7..41a0efa8d 100644 --- a/lib/CModHandler.h +++ b/lib/CModHandler.h @@ -83,6 +83,7 @@ public: int CREEP_SIZE; // neutral stacks won't grow beyond this number int WEEKLY_GROWTH; //percent int NEUTRAL_STACK_EXP; + int MAX_BUILDING_PER_TURN; bool DWELLINGS_ACCUMULATE_CREATURES; bool ALL_CREATURES_GET_DOUBLE_MONTHS; diff --git a/lib/CObjectHandler.cpp b/lib/CObjectHandler.cpp index 71d414b5e..0ae9b4a79 100644 --- a/lib/CObjectHandler.cpp +++ b/lib/CObjectHandler.cpp @@ -553,7 +553,10 @@ ui32 CGHeroInstance::getTileCost(const TerrainTile &dest, const TerrainTile &fro } else { - ret = type->heroClass->terrCosts[from.tertype]; + assert(vstd::contains(VLC->townh->factions, type->heroType / 2)); + if (VLC->townh->factions[type->heroType / 2].nativeTerrain != from.tertype) //non-native terrain + ret = VLC->heroh->terrCosts[from.tertype]; + ret = std::max(ret - 25*unsigned(getSecSkillLevel(CGHeroInstance::PATHFINDING)), 100u); //reduce 25% of terrain penalty for each pathfinding level } return ret; @@ -1820,11 +1823,11 @@ void CGDwelling::fightOver(const CGHeroInstance *h, BattleResult *result) const int CGTownInstance::getSightRadious() const //returns sight distance { - if (subID == 2) //tower + if (subID == ETownType::TOWER) { - if ((builtBuildings.find(26)) != builtBuildings.end()) //skyship + if (hasBuilt(EBuilding::GRAIL)) //skyship return -1; //entire map - else if ((builtBuildings.find(21)) != builtBuildings.end()) //lookout tower + else if (hasBuilt(EBuilding::LOOKOUT_TOWER)) //lookout tower return 20; } return 5; @@ -1854,38 +1857,38 @@ void CGTownInstance::setPropertyDer(ui8 what, ui32 val) } CGTownInstance::EFortLevel CGTownInstance::fortLevel() const //0 - none, 1 - fort, 2 - citadel, 3 - castle { - if((builtBuildings.find(9))!=builtBuildings.end()) + if (hasBuilt(EBuilding::CASTLE)) return CASTLE; - if((builtBuildings.find(8))!=builtBuildings.end()) + if (hasBuilt(EBuilding::CITADEL)) return CITADEL; - if((builtBuildings.find(7))!=builtBuildings.end()) + if (hasBuilt(EBuilding::FORT)) return FORT; return NONE; } int CGTownInstance::hallLevel() const // -1 - none, 0 - village, 1 - town, 2 - city, 3 - capitol { - if ((builtBuildings.find(13))!=builtBuildings.end()) + if (hasBuilt(EBuilding::CAPITOL)) return 3; - if ((builtBuildings.find(12))!=builtBuildings.end()) + if (hasBuilt(EBuilding::CITY_HALL)) return 2; - if ((builtBuildings.find(11))!=builtBuildings.end()) + if (hasBuilt(EBuilding::TOWN_HALL)) return 1; - if ((builtBuildings.find(10))!=builtBuildings.end()) + if (hasBuilt(EBuilding::VILLAGE_HALL)) return 0; return -1; } int CGTownInstance::mageGuildLevel() const { - if ((builtBuildings.find(4))!=builtBuildings.end()) + if (hasBuilt(EBuilding::MAGES_GUILD_5)) return 5; - if ((builtBuildings.find(3))!=builtBuildings.end()) + if (hasBuilt(EBuilding::MAGES_GUILD_4)) return 4; - if ((builtBuildings.find(2))!=builtBuildings.end()) + if (hasBuilt(EBuilding::MAGES_GUILD_3)) return 3; - if ((builtBuildings.find(1))!=builtBuildings.end()) + if (hasBuilt(EBuilding::MAGES_GUILD_2)) return 2; - if ((builtBuildings.find(0))!=builtBuildings.end()) + if (hasBuilt(EBuilding::MAGES_GUILD_1)) return 1; return 0; } @@ -1896,7 +1899,7 @@ int CGTownInstance::creatureDwellingLevel(int dwelling) const return -1; for (int i=0; ; i++) { - if (!vstd::contains(builtBuildings, 30+dwelling+i*GameConstants::CREATURES_PER_TOWN)) + if (!hasBuilt(EBuilding::DWELL_FIRST+dwelling+i*GameConstants::CREATURES_PER_TOWN)) return i-1; } } @@ -1915,7 +1918,7 @@ GrowthInfo CGTownInstance::getGrowthInfo(int level) const if (level<0 || level >=GameConstants::CREATURES_PER_TOWN) return ret; - if (!vstd::contains(builtBuildings, EBuilding::DWELL_FIRST+level)) + if (!hasBuilt(EBuilding::DWELL_FIRST+level)) return ret; //no dwelling const CCreature *creature = VLC->creh->creatures[creatures[level].second.back()]; @@ -1924,17 +1927,17 @@ GrowthInfo CGTownInstance::getGrowthInfo(int level) const ret.entries.push_back(GrowthInfo::Entry(VLC->generaltexth->allTexts[590], base));// \n\nBasic growth %d" - if ( vstd::contains(builtBuildings, EBuilding::CASTLE)) + if (hasBuilt(EBuilding::CASTLE)) ret.entries.push_back(GrowthInfo::Entry(subID, EBuilding::CASTLE, castleBonus = base)); - else if ( vstd::contains(builtBuildings, EBuilding::CITADEL)) + else if (hasBuilt(EBuilding::CITADEL)) ret.entries.push_back(GrowthInfo::Entry(subID, EBuilding::CITADEL, castleBonus = base / 2)); if(town->hordeLvl[0] == level)//horde 1 - if( vstd::contains(builtBuildings, EBuilding::HORDE_1) || vstd::contains(builtBuildings, EBuilding::HORDE_1_UPGR)) + if(hasBuilt(EBuilding::HORDE_1)) ret.entries.push_back(GrowthInfo::Entry(subID, EBuilding::HORDE_1, creature->hordeGrowth)); if(town->hordeLvl[1] == level)//horde 2 - if(vstd::contains(builtBuildings, EBuilding::HORDE_2) || vstd::contains(builtBuildings, EBuilding::HORDE_2_UPGR)) + if(hasBuilt(EBuilding::HORDE_2)) ret.entries.push_back(GrowthInfo::Entry(subID, EBuilding::HORDE_2, creature->hordeGrowth)); int dwellingBonus = 0; @@ -1958,7 +1961,7 @@ GrowthInfo CGTownInstance::getGrowthInfo(int level) const BOOST_FOREACH(const Bonus *b, *bonuses2) ret.entries.push_back(GrowthInfo::Entry(b->Description() + " %+d", b->val * (base + castleBonus) / 100)); - if(vstd::contains(builtBuildings, EBuilding::GRAIL)) //grail - +50% to ALL (so far added) growth + if(hasBuilt(EBuilding::GRAIL)) //grail - +50% to ALL (so far added) growth ret.entries.push_back(GrowthInfo::Entry(subID, EBuilding::GRAIL, ret.totalGrowth() / 2)); return ret; @@ -1967,25 +1970,26 @@ GrowthInfo CGTownInstance::getGrowthInfo(int level) const int CGTownInstance::dailyIncome() const { int ret = 0; - if ((builtBuildings.find(26))!=builtBuildings.end()) + if (hasBuilt(EBuilding::GRAIL)) ret+=5000; - if ((builtBuildings.find(13))!=builtBuildings.end()) + + if (hasBuilt(EBuilding::CAPITOL)) ret+=4000; - else if ((builtBuildings.find(12))!=builtBuildings.end()) + else if (hasBuilt(EBuilding::CITY_HALL)) ret+=2000; - else if ((builtBuildings.find(11))!=builtBuildings.end()) + else if (hasBuilt(EBuilding::TOWN_HALL)) ret+=1000; - else if ((builtBuildings.find(10))!=builtBuildings.end()) + else if (hasBuilt(EBuilding::VILLAGE_HALL)) ret+=500; return ret; } bool CGTownInstance::hasFort() const { - return (builtBuildings.find(7))!=builtBuildings.end(); + return hasBuilt(EBuilding::FORT); } bool CGTownInstance::hasCapitol() const { - return (builtBuildings.find(13))!=builtBuildings.end(); + return hasBuilt(EBuilding::CAPITOL); } CGTownInstance::CGTownInstance() :IShipyard(this), IMarket(this) @@ -2006,8 +2010,10 @@ int CGTownInstance::spellsAtLevel(int level, bool checkGuild) const if(checkGuild && mageGuildLevel() < level) return 0; int ret = 6 - level; //how many spells are available at this level - if(subID == 2 && vstd::contains(builtBuildings,22)) //magic library in Tower + + if (hasBuilt(EBuilding::LIBRARY, ETownType::TOWER)) ret++; + return ret; } @@ -2074,7 +2080,7 @@ void CGTownInstance::initObj() blockVisit = true; hoverName = name + ", " + town->Name(); - if (subID == 5) + if (subID == ETownType::DUNGEON) creatures.resize(GameConstants::CREATURES_PER_TOWN+1);//extra dwelling for Dungeon else creatures.resize(GameConstants::CREATURES_PER_TOWN); @@ -2109,7 +2115,9 @@ void CGTownInstance::newTurn() const { if (cb->getDate(1) == 1) //reset on new week { - if (vstd::contains(builtBuildings,17) && subID == 1 && cb->getDate(0) != 1 && (tempOwner < GameConstants::PLAYER_LIMIT) )//give resources for Rampart, Mystic Pond + //give resources for Rampart, Mystic Pond + if (hasBuilt(EBuilding::MYSTIC_POND, ETownType::RAMPART) + && cb->getDate(0) != 1 && (tempOwner < GameConstants::PLAYER_LIMIT)) { int resID = rand()%4+2;//bonus to random rare resource resID = (resID==2)?1:resID; @@ -2119,10 +2127,10 @@ void CGTownInstance::newTurn() const cb->setObjProperty (id, 15, resVal); } - if ( subID == 5 ) + if ( subID == ETownType::DUNGEON ) for (std::vector::const_iterator i = bonusingBuildings.begin(); i!=bonusingBuildings.end(); i++) { - if ((*i)->ID == 21) + if ((*i)->ID == EBuilding::MANA_VORTEX) cb->setObjProperty (id, 12, (*i)->id); //reset visitors for Mana Vortex } @@ -2249,7 +2257,7 @@ int CGTownInstance::getBoatType() const int CGTownInstance::getMarketEfficiency() const { - if(!vstd::contains(builtBuildings, 14)) + if (!hasBuilt(EBuilding::MARKETPLACE)) return 0; const PlayerState *p = cb->getPlayer(tempOwner); @@ -2257,7 +2265,7 @@ int CGTownInstance::getMarketEfficiency() const int marketCount = 0; BOOST_FOREACH(const CGTownInstance *t, p->towns) - if(vstd::contains(t->builtBuildings, 14)) + if(t->hasBuilt(EBuilding::MARKETPLACE)) marketCount++; return marketCount; @@ -2269,16 +2277,22 @@ bool CGTownInstance::allowsTrade(EMarketMode::EMarketMode mode) const { case EMarketMode::RESOURCE_RESOURCE: case EMarketMode::RESOURCE_PLAYER: - return vstd::contains(builtBuildings, 14); // marketplace + return hasBuilt(EBuilding::MARKETPLACE); + case EMarketMode::ARTIFACT_RESOURCE: case EMarketMode::RESOURCE_ARTIFACT: - return (subID == 2 || subID == 5 || subID == 8) && vstd::contains(builtBuildings, 17);//artifact merchants + return hasBuilt(EBuilding::ARTIFACT_MERCHANT, ETownType::TOWER) + || hasBuilt(EBuilding::ARTIFACT_MERCHANT, ETownType::DUNGEON) + || hasBuilt(EBuilding::ARTIFACT_MERCHANT, ETownType::CONFLUX); + case EMarketMode::CREATURE_RESOURCE: - return subID == 6 && vstd::contains(builtBuildings, 21); //Freelancer's guild + return hasBuilt(EBuilding::FREELANCERS_GUILD, ETownType::STRONGHOLD); + case EMarketMode::CREATURE_UNDEAD: - return subID == 4 && vstd::contains(builtBuildings, 22);//Skeleton transformer + return hasBuilt(EBuilding::SKELETON_TRANSFORMER, ETownType::NECROPOLIS); + case EMarketMode::RESOURCE_SKILL: - return subID == 8 && vstd::contains(builtBuildings, 21);//Magic University + return hasBuilt(EBuilding::MAGIC_UNIVERSITY, ETownType::CONFLUX); default: assert(0); return false; @@ -2326,50 +2340,50 @@ void CGTownInstance::recreateBuildingsBonuses() BOOST_FOREACH(Bonus *b, bl) removeBonus(b); + //tricky! -> checks tavern only if no bratherhood of sword or not a castle + if(subID != ETownType::CASTLE || !addBonusIfBuilt(EBuilding::BROTHERHOOD, Bonus::MORALE, +2)) + addBonusIfBuilt(EBuilding::TAVERN, Bonus::MORALE, +1); - if(subID != 0 || !addBonusIfBuilt(22, Bonus::MORALE, +2)) //tricky! -> checks tavern only if no bratherhood of sword or not a castle - addBonusIfBuilt(5, Bonus::MORALE, +1); - - if(subID == 0) //castle + if(subID == ETownType::CASTLE) //castle { - addBonusIfBuilt(17, Bonus::SEA_MOVEMENT, +500, make_shared(PLAYER)); //lighthouses - addBonusIfBuilt(26, Bonus::MORALE, +2, make_shared(PLAYER)); //colossus + addBonusIfBuilt(EBuilding::LIGHTHOUSE, Bonus::SEA_MOVEMENT, +500, make_shared(PLAYER)); + addBonusIfBuilt(EBuilding::GRAIL, Bonus::MORALE, +2, make_shared(PLAYER)); //colossus } - else if(subID == 1) //rampart + else if(subID == ETownType::RAMPART) //rampart { - addBonusIfBuilt(21, Bonus::LUCK, +2); //fountain of fortune - addBonusIfBuilt(21, Bonus::LUCK, +2, make_shared(PLAYER)); //guardian spirit + addBonusIfBuilt(EBuilding::FOUNTAIN_OF_FORTUNE, Bonus::LUCK, +2); //fountain of fortune + addBonusIfBuilt(EBuilding::GRAIL, Bonus::LUCK, +2, make_shared(PLAYER)); //guardian spirit } - else if(subID == 2) //tower + else if(subID == ETownType::RAMPART) //tower { - addBonusIfBuilt(26, Bonus::PRIMARY_SKILL, +15, PrimarySkill::KNOWLEDGE); //grail + addBonusIfBuilt(EBuilding::GRAIL, Bonus::PRIMARY_SKILL, +15, PrimarySkill::KNOWLEDGE); //grail } - else if(subID == 3) //Inferno + else if(subID == ETownType::TOWER) //Inferno { - addBonusIfBuilt(21, Bonus::PRIMARY_SKILL, +2, PrimarySkill::SPELL_POWER); //Brimstone Clouds + addBonusIfBuilt(EBuilding::STORMCLOUDS, Bonus::PRIMARY_SKILL, +2, PrimarySkill::SPELL_POWER); //Brimstone Clouds } - else if(subID == 4) //necropolis + else if(subID == ETownType::NECROPOLIS) //necropolis { - addBonusIfBuilt(17, Bonus::DARKNESS, +20); - addBonusIfBuilt(21, Bonus::SECONDARY_SKILL_PREMY, +10, make_shared(PLAYER), CGHeroInstance::NECROMANCY); //necromancy amplifier - addBonusIfBuilt(26, Bonus::SECONDARY_SKILL_PREMY, +20, make_shared(PLAYER), CGHeroInstance::NECROMANCY); //Soul prison + addBonusIfBuilt(EBuilding::COVER_OF_DARKNESS, Bonus::DARKNESS, +20); + addBonusIfBuilt(EBuilding::NECROMANCY_AMPLIFIER, Bonus::SECONDARY_SKILL_PREMY, +10, make_shared(PLAYER), CGHeroInstance::NECROMANCY); //necromancy amplifier + addBonusIfBuilt(EBuilding::GRAIL, Bonus::SECONDARY_SKILL_PREMY, +20, make_shared(PLAYER), CGHeroInstance::NECROMANCY); //Soul prison } - else if(subID == 5) //Dungeon + else if(subID == ETownType::DUNGEON) //Dungeon { - addBonusIfBuilt(26, Bonus::PRIMARY_SKILL, +12, PrimarySkill::SPELL_POWER); //grail + addBonusIfBuilt(EBuilding::GRAIL, Bonus::PRIMARY_SKILL, +12, PrimarySkill::SPELL_POWER); //grail } - else if(subID == 6) //Stronghold + else if(subID == ETownType::STRONGHOLD) //Stronghold { - addBonusIfBuilt(26, Bonus::PRIMARY_SKILL, +20, PrimarySkill::ATTACK); //grail + addBonusIfBuilt(EBuilding::GRAIL, Bonus::PRIMARY_SKILL, +20, PrimarySkill::ATTACK); //grail } - else if(subID == 7) //Fortress + else if(subID == ETownType::FORTRESS) //Fortress { - addBonusIfBuilt(21, Bonus::PRIMARY_SKILL, +2, PrimarySkill::DEFENSE); //Glyphs of Fear - addBonusIfBuilt(22, Bonus::PRIMARY_SKILL, +2, PrimarySkill::ATTACK); //Blood Obelisk - addBonusIfBuilt(26, Bonus::PRIMARY_SKILL, +10, PrimarySkill::ATTACK); //grail - addBonusIfBuilt(26, Bonus::PRIMARY_SKILL, +10, PrimarySkill::DEFENSE); //grail + addBonusIfBuilt(EBuilding::GLYPHS_OF_FEAR, Bonus::PRIMARY_SKILL, +2, PrimarySkill::DEFENSE); //Glyphs of Fear + addBonusIfBuilt(EBuilding::BLOOD_OBELISK, Bonus::PRIMARY_SKILL, +2, PrimarySkill::ATTACK); //Blood Obelisk + addBonusIfBuilt(EBuilding::GRAIL, Bonus::PRIMARY_SKILL, +10, PrimarySkill::ATTACK); //grail + addBonusIfBuilt(EBuilding::GRAIL, Bonus::PRIMARY_SKILL, +10, PrimarySkill::DEFENSE); //grail } - else if(subID == 8) + else if(subID == ETownType::CONFLUX) { } @@ -2382,7 +2396,7 @@ bool CGTownInstance::addBonusIfBuilt(int building, int type, int val, int subtyp bool CGTownInstance::addBonusIfBuilt(int building, int type, int val, TPropagatorPtr prop, int subtype /*= -1*/) { - if(vstd::contains(builtBuildings, building)) + if(hasBuilt(building)) { std::ostringstream descr; descr << VLC->generaltexth->buildings[subID][building].first << " "; @@ -2466,11 +2480,19 @@ const CArmedInstance * CGTownInstance::getUpperArmy() const return this; } +bool CGTownInstance::hasBuilt(int buildingID, int townID) const +{ + if (townID == town->typeID || townID == ETownType::ANY) + return hasBuilt(buildingID); + return false; +} + bool CGTownInstance::hasBuilt(int buildingID) const { return vstd::contains(builtBuildings, buildingID); } + bool CGVisitableOPH::wasVisited (const CGHeroInstance * h) const { return vstd::contains(visitors, h->id); @@ -2828,13 +2850,13 @@ void COPWBonus::setProperty(ui8 what, ui32 val) void COPWBonus::onHeroVisit (const CGHeroInstance * h) const { int heroID = h->id; - if (town->builtBuildings.find(ID) != town->builtBuildings.end()) + if (town->hasBuilt(ID)) { InfoWindow iw; iw.player = h->tempOwner; switch (town->subID) { - case 0: //Stables + case ETownType::CASTLE: //Stables if (!h->hasBonusFrom(Bonus::OBJECT, 94)) //does not stack with advMap Stables { GiveBonus gb; @@ -2845,7 +2867,7 @@ void COPWBonus::onHeroVisit (const CGHeroInstance * h) const cb->showInfoDialog(&iw); } break; - case 5: //Mana Vortex + case ETownType::DUNGEON: //Mana Vortex if (visitors.empty() && h->mana <= h->manaLimit() * 2) { cb->setManaPoints (heroID, 2 * h->manaLimit()); @@ -2872,34 +2894,34 @@ void CTownBonus::setProperty (ui8 what, ui32 val) void CTownBonus::onHeroVisit (const CGHeroInstance * h) const { int heroID = h->id; - if ((town->builtBuildings.find(ID) != town->builtBuildings.end()) && (visitors.find(heroID) == visitors.end())) + if (town->hasBuilt(ID) && visitors.find(heroID) == visitors.end()) { InfoWindow iw; int what=0, val=0, mid=0; switch (ID) { - case 23: + case EBuilding::SPECIAL_4: switch(town->subID) { - case 2: //wall + case ETownType::TOWER: //wall what = 3; val = 1; mid = 581; iw.components.push_back (Component(Component::PRIM_SKILL, 3, 1, 0)); break; - case 3: //order of fire + case ETownType::INFERNO: //order of fire what = 2; val = 1; mid = 582; iw.components.push_back (Component(Component::PRIM_SKILL, 2, 1, 0)); break; - case 6://hall of valhalla + case ETownType::STRONGHOLD://hall of valhalla what = 0; val = 1; mid = 584; iw.components.push_back (Component(Component::PRIM_SKILL, 0, 1, 0)); break; - case 5://academy of battle scholars + case ETownType::DUNGEON://academy of battle scholars what = 4; val = 1000*(100+h->getSecSkillLevel(CGHeroInstance::LEARNING)*5)/100.0; mid = 583; @@ -2907,10 +2929,10 @@ void CTownBonus::onHeroVisit (const CGHeroInstance * h) const break; } break; - case 17: + case EBuilding::SPECIAL_1: switch(town->subID) { - case 7: //cage of warlords + case ETownType::FORTRESS: //cage of warlords what = 1; val = 1; mid = 585; @@ -6919,7 +6941,7 @@ void CArmedInstance::updateMoraleBonusFromArmy() //-1 modifier for any Necropolis unit in army const ui8 UNDEAD_MODIFIER_ID = -2; Bonus *undeadModifier = getBonusList().getFirst(Selector::source(Bonus::ARMY, UNDEAD_MODIFIER_ID)); - if(vstd::contains(factions,4)) + if(vstd::contains(factions, ETownType::NECROPOLIS)) { if(!undeadModifier) addNewBonus(new Bonus(Bonus::PERMANENT, Bonus::MORALE, Bonus::ARMY, -1, UNDEAD_MODIFIER_ID, VLC->generaltexth->arraytxt[116])); diff --git a/lib/CObjectHandler.h b/lib/CObjectHandler.h index 1b5d6f33c..3c7f591fe 100644 --- a/lib/CObjectHandler.h +++ b/lib/CObjectHandler.h @@ -1,11 +1,5 @@ #pragma once - -#ifndef _MSC_VER -#include "CHeroHandler.h" -#include "CTownHandler.h" -#include "../lib/VCMI_Lib.h" -#endif #include "../lib/CCreatureSet.h" #include "CArtHandler.h" #include "../lib/ConstTransitivePtr.h" @@ -636,7 +630,9 @@ public: GrowthInfo getGrowthInfo(int level) const; bool hasFort() const; bool hasCapitol() const; + //checks if building is constructed and town has same subID bool hasBuilt(int buildingID) const; + bool hasBuilt(int buildingID, int townID) const; int dailyIncome() const; //calculates daily income of this town int spellsAtLevel(int level, bool checkGuild) const; //levels are counted from 1 (1 - 5) void removeCapitols (ui8 owner) const; diff --git a/lib/CTownHandler.cpp b/lib/CTownHandler.cpp index 378c25120..f1c082838 100644 --- a/lib/CTownHandler.cpp +++ b/lib/CTownHandler.cpp @@ -17,8 +17,6 @@ * */ -static std::string emptyStr = ""; - const std::string & CBuilding::Name() const { if(name.length()) @@ -26,7 +24,7 @@ const std::string & CBuilding::Name() const else if(vstd::contains(VLC->generaltexth->buildings,tid) && vstd::contains(VLC->generaltexth->buildings[tid],bid)) return VLC->generaltexth->buildings[tid][bid].first; tlog2 << "Warning: Cannot find name text for building " << bid << "for " << tid << "town.\n"; - return emptyStr; + return name; } const std::string & CBuilding::Description() const @@ -36,7 +34,30 @@ const std::string & CBuilding::Description() const else if(vstd::contains(VLC->generaltexth->buildings,tid) && vstd::contains(VLC->generaltexth->buildings[tid],bid)) return VLC->generaltexth->buildings[tid][bid].second; tlog2 << "Warning: Cannot find description text for building " << bid << "for " << tid << "town.\n"; - return emptyStr; + return description; +} + +CBuilding::BuildingType CBuilding::getBase() const +{ + const CBuilding * build = this; + while (build->upgrade >= 0) + build = VLC->townh->towns[build->tid].buildings[build->upgrade]; + + return build->bid; +} + +si32 CBuilding::getDistance(CBuilding::BuildingType buildID) const +{ + const CBuilding * build = VLC->townh->towns[tid].buildings[buildID]; + int distance = 0; + while (build->upgrade >= 0 && build != this) + { + build = VLC->townh->towns[build->tid].buildings[build->upgrade]; + distance++; + } + if (build == this) + return distance; + return -1; } const std::string & CTown::Name() const @@ -65,9 +86,8 @@ JsonNode readBuilding(CLegacyConfigParser & parser) JsonNode ret; JsonNode & cost = ret["cost"]; - const std::string resources [] = {"wood", "mercury", "ore", "sulfur", "crystal", "gems", "gold"}; - - BOOST_FOREACH(const std::string & resID, resources) + //note: this code will try to parse mithril as well but wil always return 0 for it + BOOST_FOREACH(const std::string & resID, GameConstants::RESOURCE_NAMES) cost[resID].Float() = parser.readNumber(); parser.endLine(); @@ -139,17 +159,27 @@ void CTownHandler::loadBuilding(CTown &town, const JsonNode & source) { CBuilding * ret = new CBuilding; - ret->name = source["name"].String(); - ret->description = source["description"].String(); + static const std::string modes [] = {"normal", "auto", "special", "grail"}; + + ret->mode = boost::find(modes, source["mode"].String()) - modes; ret->tid = town.typeID; ret->bid = source["id"].Float(); - + ret->name = source["name"].String(); + ret->description = source["description"].String(); ret->resources = TResources(source["cost"]); BOOST_FOREACH(const JsonNode &building, source["requires"].Vector()) ret->requirements.insert(building.Float()); + if (!source["upgrades"].isNull()) + { + ret->requirements.insert(source["upgrades"].Float()); + ret->upgrade = source["upgrades"].Float(); + } + else + ret->upgrade = -1; + town.buildings[ret->bid] = ret; } @@ -165,57 +195,39 @@ void CTownHandler::loadStructure(CTown &town, const JsonNode & source) { CStructure * ret = new CStructure; - ret->ID = source["id"].Float(); + if (source["id"].isNull()) + { + ret->building = nullptr; + ret->buildable = nullptr; + } + else + { + ret->building = town.buildings[source["id"].Float()]; + + if (source["builds"].isNull()) + ret->buildable = ret->building; + else + ret->buildable = town.buildings[source["builds"].Float()]; + } + ret->pos.x = source["x"].Float(); ret->pos.y = source["y"].Float(); - ret->pos.z = 0; + ret->pos.z = source["z"].Float(); - ret->defName = source["defname"].String(); + ret->hiddenUpgrade = source["hidden"].Bool(); + ret->defName = source["animation"].String(); ret->borderName = source["border"].String(); ret->areaName = source["area"].String(); - ret->group = -1; - ret->townID = town.typeID; - - town.clientInfo.structures[ret->ID] = ret; + town.clientInfo.structures.push_back(ret); } void CTownHandler::loadStructures(CTown &town, const JsonNode & source) { - BOOST_FOREACH(const JsonNode &node, source["structures"].Vector()) + BOOST_FOREACH(const JsonNode &node, source.Vector()) { loadStructure(town, node); } - - // Read buildings blit order for that city - int itr = 1; - BOOST_FOREACH(const JsonNode &node, source["blit_order"].Vector()) - { - int buildingID = node.Float(); - - /* Find the building and set its order. */ - auto i2 = town.clientInfo.structures.find(buildingID); - if (i2 != (town.clientInfo.structures.end())) - i2->second->pos.z = itr++; - } - - // Iterate for each group for that city - int groupID = 0; - BOOST_FOREACH(const JsonNode &group, source["groups"].Vector()) - { - groupID++; - - // Iterate for each bulding value in the group - BOOST_FOREACH(const JsonNode &value, group.Vector()) - { - auto buildingIter = town.clientInfo.structures.find(value.Float()); - - if (buildingIter != town.clientInfo.structures.end()) - { - buildingIter->second->group = groupID; - } - } - } } void CTownHandler::loadTownHall(CTown &town, const JsonNode & source) @@ -238,23 +250,27 @@ void CTownHandler::loadTownHall(CTown &town, const JsonNode & source) } } -void CTownHandler::loadTown(std::vector &towns, const JsonNode & source) +void CTownHandler::loadClientData(CTown &town, const JsonNode & source) { - towns.push_back(CTown()); - CTown & town = towns.back(); + town.clientInfo.hallBackground = source["hallBackground"].String(); + town.clientInfo.musicTheme = source["musicTheme"].String(); + town.clientInfo.townBackground = source["townBackground"].String(); + town.clientInfo.guildWindow = source["guildWindow"].String(); + town.clientInfo.buildingsIcons = source["buildingsIcons"].String(); - //TODO: allow loading name and names vector from json and from h3 txt's - - town.typeID = towns.size() - 1; + loadTownHall(town, source["hallSlots"]); + loadStructures(town, source["structures"]); +} +void CTownHandler::loadTown(CTown &town, const JsonNode & source) +{ town.bonus = town.typeID; if (town.bonus==8) town.bonus=3; - town.clientInfo.hallBackground = source["hallBackground"].String(); - town.mageLevel = source["mage_guild"].Float(); - town.primaryRes = source["primary_resource"].Float(); - town.warMachine = source["war_machine"].Float(); + town.mageLevel = source["mageGuild"].Float(); + town.primaryRes = source["primaryResource"].Float(); + town.warMachine = source["warMachine"].Float(); // Horde building creature level BOOST_FOREACH(const JsonNode &node, source["horde"].Vector()) @@ -272,20 +288,37 @@ void CTownHandler::loadTown(std::vector &towns, const JsonNode & source) town.creatures.push_back(level); } - loadTownHall(town, source["hallSlots"]); - loadBuildings(town, source["buildings"]); - loadStructures(town, source); + loadBuildings(town, source["buildings"]); + loadClientData(town,source); } -void CTownHandler::loadTowns(std::vector &towns, const JsonNode & source) +void CTownHandler::loadFactions(const JsonNode &source) { - BOOST_FOREACH(const JsonNode & node, source.Vector()) + BOOST_FOREACH(auto & node, source.Struct()) { - loadTown(towns, node); - } + int id = node.second["index"].Float(); + CFaction & faction = factions[id]; - // ensure that correct number of town have been loaded. Safe to remove - assert(towns.size() == GameConstants::F_NUMBER); + faction.factionID = id; + faction.name = node.first; + + faction.creatureBg120 = node.second["creatureBackground"]["120px"].String(); + faction.creatureBg130 = node.second["creatureBackground"]["130px"].String(); + + if (!node.second["nativeTerrain"].isNull()) + { + //get terrain as string and converto to numeric ID + faction.nativeTerrain = boost::find(GameConstants::TERRAIN_NAMES, node.second["nativeTerrain"].String()) - GameConstants::TERRAIN_NAMES; + } + else + faction.nativeTerrain = -1; + + if (!node.second["town"].isNull()) + { + towns[id].typeID = id; + loadTown(towns[id], node.second["town"]); + } + } } void CTownHandler::load() @@ -295,23 +328,33 @@ void CTownHandler::load() JsonNode legacyConfig; loadLegacyData(legacyConfig); + //hardocoded list of H3 factions. Should be only used to convert H3 configs + static const std::string factionName [GameConstants::F_NUMBER] = + { + "castle", "rampart", "tower", + "inferno", "necropolis", "dungeon", + "stronghold", "fortress", "conflux" + }; + // semi-manually merge legacy config with towns json // legacy config have only one item: town buildings stored in 2d vector - size_t townsToMerge = std::min(buildingsConf["towns"].Vector().size(), legacyConfig.Vector().size()); - for (size_t i=0; i< townsToMerge; i++) + + for (size_t i=0; i< legacyConfig.Vector().size(); i++) { - JsonNode & buildings = buildingsConf["towns"].Vector()[i]["buildings"]; + JsonNode & buildings = buildingsConf[factionName[i]]["town"]["buildings"]; BOOST_FOREACH(JsonNode & building, buildings.Vector()) { + JsonNode & legacyFaction = legacyConfig.Vector()[i]; if (vstd::contains(building.Struct(), "id")) { - JsonNode & legacyBuilding = legacyConfig.Vector()[i].Vector()[building["id"].Float()]; + //find same buildings in legacy and json configs + JsonNode & legacyBuilding = legacyFaction.Vector()[building["id"].Float()]; - if (!legacyBuilding.isNull()) + if (!legacyBuilding.isNull()) //merge if h3 config was found for this building JsonNode::merge(building, legacyBuilding); } } } - loadTowns(towns, buildingsConf["towns"]); + loadFactions(buildingsConf); } diff --git a/lib/CTownHandler.h b/lib/CTownHandler.h index 2f51cb4da..ec580b5da 100644 --- a/lib/CTownHandler.h +++ b/lib/CTownHandler.h @@ -3,6 +3,7 @@ #include "ConstTransitivePtr.h" #include "ResourceSet.h" #include "int3.h" +//#include "GameConstants.h" /* * CTownHandler.h, part of VCMI engine @@ -22,20 +23,39 @@ class JsonNode; /// contains all mechanics-related data about town structures class DLL_LINKAGE CBuilding { + typedef si32 BuildingType;//TODO: replace int with pointer? + std::string name; std::string description; public: si32 tid, bid; //town ID and structure ID TResources resources; - std::set requirements; //set of required buildings + + std::set requirements; /// set of required buildings, includes upgradeOf; + BuildingType upgrade; /// indicates that building "upgrade" can be improved by this, -1 = empty + + enum EBuildMode + { + BUILD_NORMAL, // 0 - normal, default + BUILD_AUTO, // 1 - auto - building appears when all requirements are built + BUILD_SPECIAL, // 2 - special - building can not be built normally + BUILD_GRAIL // 3 - grail - building reqires grail to be built + }; + ui32 mode; const std::string &Name() const; const std::string &Description() const; + //return base of upgrade(s) or this + BuildingType getBase() const; + + // returns how many times build has to be upgraded to become build + si32 getDistance(BuildingType build) const; + template void serialize(Handler &h, const int version) { - h & tid & bid & resources & name & description & requirements; + h & tid & bid & resources & name & description & requirements & upgrade & mode; } friend class CTownHandler; @@ -43,38 +63,35 @@ public: /// This is structure used only by client /// Consists of all gui-related data about town structures -/// Should be mode from lib to client +/// Should be moved from lib to client struct DLL_LINKAGE CStructure { - int ID; + CBuilding * building; // base building. If null - this structure will be always present on screen + CBuilding * buildable; // building that will be used to determine built building and visible cost. Usually same as "building" + + bool hiddenUpgrade; // used only if "building" is upgrade, if true - structure on town screen will behave exactly like parent (mouse clicks, hover texts, etc) + int3 pos; std::string defName, borderName, areaName; - int townID, group; - - bool operator<(const CStructure & p2) const - { - if(pos.z != p2.pos.z) - return (pos.z) < (p2.pos.z); - else - return (ID) < (p2.ID); - } template void serialize(Handler &h, const int version) { - h & ID & pos & defName & borderName & areaName & townID & group; + h & pos & defName & borderName & areaName & building & buildable; } }; class DLL_LINKAGE CTown { - std::string name; //name of type + std::string name; + std::string description; + std::vector names; //names of the town instances public: - ui32 typeID; + ui32 typeID;//also works as factionID /// level -> list of creatures on this tier - /// TODO: replace with pointers to CCreature? + // TODO: replace with pointers to CCreature std::vector > creatures; bmap > buildings; @@ -88,13 +105,21 @@ public: // Client-only data. Should be moved away from lib struct ClientInfo { + std::string musicTheme; + std::string townBackground; + std::string guildWindow; + std::string buildingsIcons; std::string hallBackground; - std::vector< std::vector< std::vector > > hallSlots; /// vector[row][column] = list of buildings in this slot - bmap > structures; + /// vector[row][column] = list of buildings in this slot + std::vector< std::vector< std::vector > > hallSlots; + + /// list of town screen structures. + /// NOTE: index in vector is meaningless. Vector used instead of list for a bit faster access + std::vector > structures; template void serialize(Handler &h, const int version) { - h & hallBackground & hallSlots & structures; + h & musicTheme & townBackground & guildWindow & buildingsIcons & hallBackground & hallSlots & structures; } } clientInfo; @@ -110,6 +135,23 @@ public: friend class CTownHandler; }; +class CFaction +{ +public: + std::string name; //reference name, usually lower case + ui32 factionID; + + ui32 nativeTerrain; + + std::string creatureBg120; + std::string creatureBg130; + + template void serialize(Handler &h, const int version) + { + h & name & factionID & nativeTerrain & creatureBg120 & creatureBg130; + } +}; + class DLL_LINKAGE CTownHandler { /// loads CBuilding's into town @@ -123,28 +165,32 @@ class DLL_LINKAGE CTownHandler /// loads town hall vector (hallSlots) void loadTownHall(CTown &town, const JsonNode & source); - /// load town and insert it into towns vector - void loadTown(std::vector &towns, const JsonNode & source); + void loadClientData(CTown &town, const JsonNode & source); + + void loadTown(CTown &town, const JsonNode & source); /// main loading function, accepts merged JSON source and add all entries from it into game /// all entries in JSON should be checked for validness before using this function - void loadTowns(std::vector &towns, const JsonNode & source); + void loadFactions(const JsonNode & source); /// load all available data from h3 txt(s) into json structure using format similar to vcmi configs /// returns 2d array [townID] [buildID] of buildings void loadLegacyData(JsonNode & dest); + public: - std::vector towns; + std::map towns; + std::map factions; CTownHandler(); //c-tor, set pointer in VLC to this /// "entry point" for towns loading. /// reads legacy txt's from H3 + vcmi json, merges them /// and loads resulting structure to game using loadTowns method + /// in future may require loaded Creature Handler void load(); template void serialize(Handler &h, const int version) { - h & towns; + h & towns & factions; } }; diff --git a/lib/GameConstants.h b/lib/GameConstants.h index f788ee736..c9d3c7ac8 100644 --- a/lib/GameConstants.h +++ b/lib/GameConstants.h @@ -72,19 +72,26 @@ namespace GameConstants const int ARTIFACTS_QUANTITY=171; const int HEROES_QUANTITY=156; const int SPELLS_QUANTITY=70; - const int RESOURCE_QUANTITY=8; - const int TERRAIN_TYPES=10; const int PRIMARY_SKILLS=4; const int NEUTRAL_PLAYER=255; const int NAMES_PER_TOWN=16; const int CREATURES_PER_TOWN = 7; //without upgrades - const int MAX_BUILDING_PER_TURN = 1; const int SPELL_LEVELS = 5; const int AVAILABLE_HEROES_PER_PLAYER = 2; const int SPELLBOOK_GOLD_COST = 500; const ui16 BACKPACK_START = 19; const int ID_CATAPULT = 3, ID_LOCK = 145; + + const int TERRAIN_TYPES=10; + const std::string TERRAIN_NAMES [TERRAIN_TYPES] = { + "dirt", "sand", "grass", "snow", "swamp", "rough", "subterra", "lava", "water", "rock" + }; + + const int RESOURCE_QUANTITY=8; + const std::string RESOURCE_NAMES [RESOURCE_QUANTITY] = { + "wood", "mercury", "ore", "sulfur", "crystal", "gems", "gold", "mithril" + }; } // Enum declarations @@ -109,18 +116,67 @@ namespace EAlignment enum EAlignment { GOOD, EVIL, NEUTRAL }; } +namespace ETownType +{ + enum ETownType + { + ANY = -1, + CASTLE, RAMPART, TOWER, INFERNO, NECROPOLIS, DUNGEON, STRONGHOLD, FORTRESS, CONFLUX + }; +} + namespace EBuilding { //Quite useful as long as most of building mechanics hardcoded + // NOTE: all building with completely configurable mechanics will be removed from list enum EBuilding { - MAGES_GUILD_1, MAGES_GUILD_2, MAGES_GUILD_3, MAGES_GUILD_4, MAGES_GUILD_5, + MAGES_GUILD_1, MAGES_GUILD_2, MAGES_GUILD_3, MAGES_GUILD_4, MAGES_GUILD_5, TAVERN, SHIPYARD, FORT, CITADEL, CASTLE, VILLAGE_HALL, TOWN_HALL, CITY_HALL, CAPITOL, MARKETPLACE, RESOURCE_SILO, BLACKSMITH, SPECIAL_1, HORDE_1, HORDE_1_UPGR, SHIP, SPECIAL_2, SPECIAL_3, SPECIAL_4, HORDE_2, - HORDE_2_UPGR, GRAIL, EXTRA_CITY_HALL, EXTRA_TOWN_HALL, EXTRA_CAPITOL, - DWELL_FIRST=30, DWELL_LAST=36, DWELL_UP_FIRST=37, DWELL_UP_LAST=43 + HORDE_2_UPGR, GRAIL, EXTRA_TOWN_HALL, EXTRA_CITY_HALL, EXTRA_CAPITOL, + DWELL_FIRST=30, DWELL_LAST=36, DWELL_UP_FIRST=37, DWELL_UP_LAST=43, + + //Special buildings for towns. + LIGHTHOUSE = SPECIAL_1, + STABLES = SPECIAL_2, //Castle + BROTHERHOOD = SPECIAL_3, + + MYSTIC_POND = SPECIAL_1, + FOUNTAIN_OF_FORTUNE = SPECIAL_3, //Rampart + TREASURY = SPECIAL_4, + + ARTIFACT_MERCHANT = SPECIAL_1, + LOOKOUT_TOWER = SPECIAL_2, //Tower + LIBRARY = SPECIAL_3, + WALL_OF_KNOWLEDGE = SPECIAL_4, + + STORMCLOUDS = SPECIAL_2, + CASTLE_GATE = SPECIAL_3, //Inferno + ORDER_OF_FIRE = SPECIAL_4, + + COVER_OF_DARKNESS = SPECIAL_1, + NECROMANCY_AMPLIFIER = SPECIAL_2, //Necropolis + SKELETON_TRANSFORMER = SPECIAL_3, + + //ARTIFACT_MERCHANT - same ID as in tower + MANA_VORTEX = SPECIAL_2, + PORTAL_OF_SUMMON = SPECIAL_3, //Dungeon + BATTLE_ACADEMY = SPECIAL_4, + + ESCAPE_TUNNEL = SPECIAL_1, + FREELANCERS_GUILD = SPECIAL_2, //Stronghold + BALLISTA_YARD = SPECIAL_3, + HALL_OF_VALHALLA = SPECIAL_4, + + CAGE_OF_WARLORDS = SPECIAL_1, + GLYPHS_OF_FEAR = SPECIAL_2, // Fortress + BLOOD_OBELISK = SPECIAL_3, + + //ARTIFACT_MERCHANT - same ID as in tower + MAGIC_UNIVERSITY = SPECIAL_2, // Conflux }; } diff --git a/lib/IGameCallback.cpp b/lib/IGameCallback.cpp index c319ad610..72e37c3d4 100644 --- a/lib/IGameCallback.cpp +++ b/lib/IGameCallback.cpp @@ -1,20 +1,22 @@ #include "StdInc.h" #include "IGameCallback.h" -#include "../lib/CGameState.h" -#include "../lib/map.h" +#include + +#include "CGameState.h" +#include "map.h" #include "CObjectHandler.h" #include "CHeroHandler.h" #include "StartInfo.h" #include "CArtHandler.h" #include "CSpellHandler.h" -#include "../lib/VCMI_Lib.h" -#include +#include "VCMI_Lib.h" #include "CTownHandler.h" #include "BattleState.h" #include "NetPacks.h" #include "CBuildingHandler.h" #include "GameConstants.h" +#include "CModHandler.h" /* * IGameCallback.cpp, part of VCMI engine @@ -544,7 +546,7 @@ int CGameInfoCallback::canBuildStructure( const CGTownInstance *t, int ID ) ERROR_RET_VAL_IF(!canGetFullInfo(t), "Town is not owned!", -1); int ret = EBuildingState::ALLOWED; - if(t->builded >= GameConstants::MAX_BUILDING_PER_TURN) + if(t->builded >= VLC->modh->settings.MAX_BUILDING_PER_TURN) ret = EBuildingState::CANT_BUILD_TODAY; //building limit CBuilding * pom = t->town->buildings[ID]; @@ -561,7 +563,7 @@ int CGameInfoCallback::canBuildStructure( const CGTownInstance *t, int ID ) for( std::set::iterator ri = reqs.begin(); ri != reqs.end(); ri++ ) { - if(t->builtBuildings.find(*ri)==t->builtBuildings.end()) + if(!t->hasBuilt(*ri)) ret = EBuildingState::PREREQUIRES; //lack of requirements - cannot build } @@ -576,7 +578,7 @@ int CGameInfoCallback::canBuildStructure( const CGTownInstance *t, int ID ) { BOOST_FOREACH(const CGTownInstance *t, ps->towns) { - if(vstd::contains(t->builtBuildings, 13)) + if(t->hasBuilt(EBuilding::CAPITOL)) { ret = EBuildingState::HAVE_CAPITAL; //no more than one capitol break; @@ -592,7 +594,7 @@ int CGameInfoCallback::canBuildStructure( const CGTownInstance *t, int ID ) ret = EBuildingState::NO_WATER; //lack of water } - if(t->builtBuildings.find(ID)!=t->builtBuildings.end()) //already built + if(t->hasBuilt(ID)) //already built ret = EBuildingState::ALREADY_PRESENT; return ret; } @@ -603,32 +605,27 @@ std::set CGameInfoCallback::getBuildingRequiments( const CGTownInstance *t, std::set used; used.insert(ID); - std::set reqs = t->town->buildings[ID]->requirements; + auto reqs = t->town->buildings[ID]->requirements; - while(true) + bool found; + do { - size_t noloop=0; - for(std::set::iterator i=reqs.begin();i!=reqs.end();i++) + found = false; + for(auto i=reqs.begin();i!=reqs.end();i++) { if(used.find(*i)==used.end()) //we haven't added requirements for this building { + found = true; + auto & requires = t->town->buildings[*i]->requirements; + used.insert(*i); - for( - std::set::iterator j= t->town->buildings[*i]->requirements.begin(); - j!= t->town->buildings[*i]->requirements.end(); - j++) - { + for(auto j = requires.begin(); j!= requires.end(); j++) reqs.insert(*j);//creating full list of requirements - } - } - else - { - noloop++; } } - if(noloop==reqs.size()) - break; } + while (found); + return reqs; } diff --git a/lib/JsonNode.cpp b/lib/JsonNode.cpp index 51ba93ce2..1d9909c5b 100644 --- a/lib/JsonNode.cpp +++ b/lib/JsonNode.cpp @@ -501,7 +501,7 @@ bool JsonParser::extractString(std::string &str) str.append( &input[first], pos-first); return error("Closing quote not found!", true); } - if (input[pos] < ' ') // control character + if ((unsigned char)(input[pos]) < ' ') // control character { str.append( &input[first], pos-first); first = pos+1; diff --git a/lib/ResourceSet.cpp b/lib/ResourceSet.cpp index eb558816a..25e199630 100644 --- a/lib/ResourceSet.cpp +++ b/lib/ResourceSet.cpp @@ -2,23 +2,17 @@ #include "ResourceSet.h" #include "GameConstants.h" #include "JsonNode.h" - + Res::ResourceSet::ResourceSet() { resize(GameConstants::RESOURCE_QUANTITY, 0); -} +} Res::ResourceSet::ResourceSet(const JsonNode & node) -{ - resize(GameConstants::RESOURCE_QUANTITY, 0); - at(0) = node["wood"].Float(); - at(1) = node["mercury"].Float(); - at(2) = node["ore"].Float(); - at(3) = node["sulfur"].Float(); - at(4) = node["crystal"].Float(); - at(5) = node["gems"].Float(); - at(6) = node["gold"].Float(); - at(7) = node["mithril"].Float(); +{ + reserve(GameConstants::RESOURCE_QUANTITY); + BOOST_FOREACH(std::string name, GameConstants::RESOURCE_NAMES) + push_back(node[name].Float()); } bool Res::ResourceSet::nonZero() const diff --git a/lib/map.cpp b/lib/map.cpp index d037e3aae..b8ffa53d5 100644 --- a/lib/map.cpp +++ b/lib/map.cpp @@ -57,18 +57,14 @@ static std::set convertBuildings(const std::set h3m, int castleID, b } if(addAuxiliary) - { - ret.insert(10); //village hall is always present - ret.insert(-1); //houses near v.hall / eyecandies - ret.insert(-2); //terrain eyecandy, if -1 is used - } + ret.insert(EBuilding::VILLAGE_HALL); //village hall is always present - if(ret.find(11)!=ret.end()) - ret.insert(27); - if(ret.find(12)!=ret.end()) - ret.insert(28); - if(ret.find(13)!=ret.end()) - ret.insert(29); + if(ret.find(EBuilding::CITY_HALL)!=ret.end()) + ret.insert(EBuilding::EXTRA_CITY_HALL); + if(ret.find(EBuilding::TOWN_HALL)!=ret.end()) + ret.insert(EBuilding::EXTRA_TOWN_HALL); + if(ret.find(EBuilding::CAPITOL)!=ret.end()) + ret.insert(EBuilding::EXTRA_CAPITOL); return ret; } @@ -711,7 +707,7 @@ void Mapa::loadTown( CGObjectInstance * &nobj, const ui8 * bufor, int &i, int su else //standard buildings { if(readChar(bufor,i)) //has fort - nt->builtBuildings.insert(7); + nt->builtBuildings.insert(EBuilding::FORT); nt->builtBuildings.insert(-50); //means that set of standard building should be included } diff --git a/server/CGameHandler.cpp b/server/CGameHandler.cpp index 8c0c459a3..8b0245052 100644 --- a/server/CGameHandler.cpp +++ b/server/CGameHandler.cpp @@ -1138,7 +1138,7 @@ void CGameHandler::newTurn() bool deityOfFireBuilt = false; BOOST_FOREACH(const CGTownInstance *t, gs->map->towns) { - if(t->subID == 3 && vstd::contains(t->builtBuildings, EBuilding::GRAIL)) + if(t->hasBuilt(EBuilding::GRAIL, ETownType::INFERNO)) { deityOfFireBuilt = true; break; @@ -1231,7 +1231,7 @@ void CGameHandler::newTurn() hth.id = h->id; hth.move = h->maxMovePoints(gs->map->getTile(h->getPosition(false)).tertype != TerrainTile::water); - if(h->visitedTown && vstd::contains(h->visitedTown->builtBuildings,0)) //if hero starts turn in town with mage guild + if(h->visitedTown && h->visitedTown->hasBuilt(EBuilding::MAGES_GUILD_1)) //if hero starts turn in town with mage guild hth.mana = std::max(h->mana, h->manaLimit()); //restore all mana else hth.mana = std::max((si32)(0), std::max(h->mana, std::min((si32)(h->mana + h->manaRegain()), h->manaLimit()))); @@ -1258,11 +1258,11 @@ void CGameHandler::newTurn() handleTownEvents(t, n, newCreas); if(newWeek) //first day of week { - if(t->subID == 5 && vstd::contains(t->builtBuildings, EBuilding::SPECIAL_3)) + if(t->hasBuilt(EBuilding::PORTAL_OF_SUMMON, ETownType::DUNGEON)) setPortalDwelling(t, true, (n.specialWeek == NewTurn::PLAGUE ? true : false)); //set creatures for Portal of Summoning if(!firstTurn) - if (t->subID == 1 && player < GameConstants::PLAYER_LIMIT && vstd::contains(t->builtBuildings, EBuilding::SPECIAL_3))//dwarven treasury + if (t->hasBuilt(EBuilding::TREASURY, ETownType::RAMPART) && player < GameConstants::PLAYER_LIMIT) n.res[player][Res::GOLD] += hadGold[player]/10; //give 10% of starting gold SetAvailableCreatures sac; @@ -1307,7 +1307,7 @@ void CGameHandler::newTurn() } if(!firstTurn && player < GameConstants::PLAYER_LIMIT)//not the first day and town not neutral { - if(vstd::contains(t->builtBuildings, EBuilding::RESOURCE_SILO)) //there is resource silo + if(t->hasBuilt(EBuilding::RESOURCE_SILO)) //there is resource silo { if(t->town->primaryRes == 127) //we'll give wood and ore { @@ -1322,7 +1322,7 @@ void CGameHandler::newTurn() n.res[player][Res::GOLD] += t->dailyIncome(); } - if(vstd::contains(t->builtBuildings, EBuilding::GRAIL) && t->subID == 2) + if(t->hasBuilt(EBuilding::GRAIL, ETownType::TOWER)) { // Skyship, probably easier to handle same as Veil of darkness //do it every new day after veils apply @@ -1579,7 +1579,7 @@ void CGameHandler::giveSpells( const CGTownInstance *t, const CGHeroInstance *h cs.learn = true; for(int i=0; imageGuildLevel(),h->getSecSkillLevel(CGHeroInstance::WISDOM)+2);i++) { - if (t->subID == 8 && vstd::contains(t->builtBuildings, EBuilding::GRAIL)) //Aurora Borealis + if (t->hasBuilt(EBuilding::GRAIL, ETownType::CONFLUX)) //Aurora Borealis { std::vector spells; getAllowedSpells(spells, i); @@ -1795,9 +1795,9 @@ bool CGameHandler::teleportHero(si32 hid, si32 dstid, ui8 source, ui8 asker/* = const CGTownInstance *from = h->visitedTown; if(((h->getOwner() != t->getOwner()) && complain("Cannot teleport hero to another player")) - || ((!from || from->subID!=3 || !vstd::contains(from->builtBuildings, EBuilding::SPECIAL_3)) + || ((!from || from->hasBuilt(EBuilding::CASTLE_GATE, ETownType::INFERNO)) && complain("Hero must be in town with Castle gate for teleporting")) - || ((t->subID!=3 || !vstd::contains(t->builtBuildings, EBuilding::SPECIAL_3)) + || (t->hasBuilt(EBuilding::CASTLE_GATE, ETownType::INFERNO) && complain("Cannot teleport hero to town without Castle gate in it"))) return false; int3 pos = t->visitablePos(); @@ -1818,7 +1818,7 @@ void CGameHandler::setOwner(int objid, ui8 owner) if(owner < GameConstants::PLAYER_LIMIT && getTown(objid)) //town captured { const CGTownInstance * town = getTown(objid); - if (town->subID == 5 && vstd::contains(town->builtBuildings, 22)) + if (town->hasBuilt(EBuilding::PORTAL_OF_SUMMON, ETownType::DUNGEON)) setPortalDwelling(town, true, false); if (!gs->getPlayer(owner)->towns.size())//player lost last town @@ -1837,7 +1837,7 @@ void CGameHandler::setOwner(int objid, ui8 owner) { BOOST_FOREACH(const CGTownInstance *t, gs->getPlayer(owner)->towns) { - if (t->subID == 5 && vstd::contains(t->builtBuildings, 22)) + if (t->hasBuilt(EBuilding::PORTAL_OF_SUMMON, ETownType::DUNGEON)) setPortalDwelling(t);//set initial creatures for all portals of summoning } } @@ -2421,27 +2421,34 @@ bool CGameHandler::buildStructure( si32 tid, si32 bid, bool force /*=false*/ ) if(!force) { - if (gs->canBuildStructure(t,bid) != 7) - COMPLAIN_RET("Cannot build that building!"); - - if(bid == 26) //grail + switch (b->mode) { - if(!t->visitingHero || !t->visitingHero->hasArt(2)) - COMPLAIN_RET("Cannot build grail - hero doesn't have it") - else - removeArtifact(ArtifactLocation(t->visitingHero, t->visitingHero->getArtPos(2, false))); + case CBuilding::BUILD_NORMAL : + case CBuilding::BUILD_AUTO : + if (gs->canBuildStructure(t,bid) != EBuildingState::ALLOWED) + COMPLAIN_RET("Cannot build that building!"); + break; + + case CBuilding::BUILD_SPECIAL: + COMPLAIN_RET("This building can not be constructed!"); + break; + + case CBuilding::BUILD_GRAIL : + if(b->mode == CBuilding::BUILD_GRAIL) //needs grail + { + if(!t->visitingHero || !t->visitingHero->hasArt(2)) + COMPLAIN_RET("Cannot build this without grail!") + else + removeArtifact(ArtifactLocation(t->visitingHero, t->visitingHero->getArtPos(2, false))); + } + break; } } NewStructures ns; ns.tid = tid; - //we have upgr. dwelling, upgr. horde will be builded as well - if ( (bid == 18) && (vstd::contains(t->builtBuildings,(t->town->hordeLvl[0]+37))) ) - ns.bid.insert(19); - else if ( (bid == 24) && (vstd::contains(t->builtBuildings,(t->town->hordeLvl[1]+37))) ) - ns.bid.insert(25); - else if(bid >= EBuilding::DWELL_FIRST) //dwelling + if(bid >= EBuilding::DWELL_FIRST) //dwelling { int level = (bid - EBuilding::DWELL_FIRST) % GameConstants::CREATURES_PER_TOWN; int upgradeNumber = (bid - EBuilding::DWELL_FIRST) / GameConstants::CREATURES_PER_TOWN; @@ -2451,14 +2458,6 @@ bool CGameHandler::buildStructure( si32 tid, si32 bid, bool force /*=false*/ ) CCreature * crea = VLC->creh->creatures[t->town->creatures[level][upgradeNumber]]; - if (vstd::iswithin(bid, EBuilding::DWELL_UP_FIRST, EBuilding::DWELL_UP_LAST)) - { - if ( (bid-37 == t->town->hordeLvl[0]) && (vstd::contains(t->builtBuildings,18)) ) - ns.bid.insert(19);//we have horde, will be upgraded as well as dwelling - if ( (bid-37 == t->town->hordeLvl[1]) && (vstd::contains(t->builtBuildings,24)) ) - ns.bid.insert(25); - } - SetAvailableCreatures ssi; ssi.tid = tid; ssi.creatures = t->creatures; @@ -2467,19 +2466,34 @@ bool CGameHandler::buildStructure( si32 tid, si32 bid, bool force /*=false*/ ) ssi.creatures[level].second.push_back(crea->idNumber); sendAndApply(&ssi); } - else if(bid == 11) - ns.bid.insert(27); - else if(bid == 12) - ns.bid.insert(28); - else if(bid == 13) - ns.bid.insert(29); - else if ( t->subID == 5 && bid == 22 ) + else if ( t->subID == ETownType::DUNGEON && bid == EBuilding::MANA_VORTEX ) { setPortalDwelling(t); } ns.bid.insert(bid); ns.builded = force?t->builded:(t->builded+1); + + BOOST_FOREACH(auto & build, t->town->buildings) + { + if (build.second->mode == CBuilding::BUILD_AUTO + && !vstd::contains(t->builtBuildings, build.second->bid)) + { + bool canBuild = true; + BOOST_FOREACH(int requires, build.second->requirements) + { + if (!vstd::contains(t->builtBuildings, requires) + && !vstd::contains(ns.bid, requires)) + { + canBuild = false; + break; + } + } + if (canBuild) + ns.bid.insert(build.second->bid); + } + } + sendAndApply(&ns); //reveal ground for lookout tower @@ -2866,7 +2880,7 @@ bool CGameHandler::buyArtifact( ui32 hid, si32 aid ) CGTownInstance *town = hero->visitedTown; if(aid==0) //spellbook { - if((!vstd::contains(town->builtBuildings,si32(EBuilding::MAGES_GUILD_1)) && complain("Cannot buy a spellbook, no mage guild in the town!")) + if((!town->hasBuilt(EBuilding::MAGES_GUILD_1) && complain("Cannot buy a spellbook, no mage guild in the town!")) || (getResource(hero->getOwner(), Res::GOLD) < GameConstants::SPELLBOOK_GOLD_COST && complain("Cannot buy a spellbook, not enough gold!") ) || (hero->getArt(ArtifactPosition::SPELLBOOK) && complain("Cannot buy a spellbook, hero already has a one!")) ) @@ -2881,18 +2895,21 @@ bool CGameHandler::buyArtifact( ui32 hid, si32 aid ) else if(aid < 7 && aid > 3) //war machine { int price = VLC->arth->artifacts[aid]->price; - if((hero->getArt(9+aid) && complain("Hero already has this machine!")) - || (!vstd::contains(town->builtBuildings,si32(EBuilding::BLACKSMITH)) && complain("No blackismith!")) - || (gs->getPlayer(hero->getOwner())->resources[Res::GOLD] < price && complain("Not enough gold!")) //no gold - || ((!(town->subID == 6 && vstd::contains(town->builtBuildings,si32(EBuilding::SPECIAL_3) ) ) - && town->town->warMachine!= aid ) && complain("This machine is unavailable here!"))) + + if(( hero->getArt(9+aid) && complain("Hero already has this machine!")) + || (gs->getPlayer(hero->getOwner())->resources[Res::GOLD] < price && complain("Not enough gold!"))) { return false; } - - giveResource(hero->getOwner(),Res::GOLD,-price); - giveHeroNewArtifact(hero, VLC->arth->artifacts[aid], 9+aid); - return true; + if ((town->hasBuilt(EBuilding::BLACKSMITH) && town->town->warMachine == aid ) + || ((town->hasBuilt(EBuilding::BALLISTA_YARD, ETownType::STRONGHOLD)) && aid == 4)) + { + giveResource(hero->getOwner(),Res::GOLD,-price); + giveHeroNewArtifact(hero, VLC->arth->artifacts[aid], 9+aid); + return true; + } + else + COMPLAIN_RET("This machine is unavailable here!"); } return false; } @@ -3136,7 +3153,7 @@ bool CGameHandler::hireHero(const CGObjectInstance *obj, ui8 hid, ui8 player) if(t) //tavern in town { - if( (!vstd::contains(t->builtBuildings,EBuilding::TAVERN) && complain("No tavern!")) + if( (!t->hasBuilt(EBuilding::TAVERN) && complain("No tavern!")) || (t->visitingHero && complain("There is visiting hero - no place!"))) return false; } @@ -3731,8 +3748,7 @@ void CGameHandler::playerMessage( ui8 player, const std::string &message ) { BOOST_FOREACH (auto & build, town->town->buildings) { - if (!vstd::contains(town->builtBuildings, build.first) - && !build.second->Name().empty()) + if (!town->hasBuilt(build.first) && !build.second->Name().empty()) { buildStructure(town->id, build.first, true); } @@ -4739,7 +4755,7 @@ void CGameHandler::handleTownEvents(CGTownInstance * town, NewTurn &n, std::map< } for(std::set::iterator i = ev->buildings.begin(); i!=ev->buildings.end();i++) - if ( !vstd::contains(town->builtBuildings, *i)) + if ( town->hasBuilt(*i)) { buildStructure(town->id, *i, true); iw.components.push_back(Component(Component::BUILDING, town->subID, *i, 0)); @@ -4902,14 +4918,14 @@ bool CGameHandler::buildBoat( ui32 objid ) return false; } else if(obj->o->ID == GameConstants::TOWNI_TYPE - && !vstd::contains((static_cast(obj))->builtBuildings,6)) + && !static_cast(obj)->hasBuilt(EBuilding::SHIPYARD)) { complain("Cannot build boat in the town - no shipyard!"); return false; } //TODO use "real" cost via obj->getBoatCost - if(getResource(obj->o->tempOwner, 6) < 1000 || getResource(obj->o->tempOwner, 0) < 10) + if(getResource(obj->o->tempOwner, Res::GOLD) < 1000 || getResource(obj->o->tempOwner, Res::WOOD) < 10) { complain("Not enough resources to build a boat!"); return false;