mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
* added support for buildings showing with halls
* creatures base growth is showed * fixes in building reading * fixes in building grouping * fixes in Rampart townview
This commit is contained in:
parent
099af11606
commit
dfbe7d7c6b
@ -194,7 +194,7 @@ CCastleInterface::CCastleInterface(const CGTownInstance * Town, bool Activate)
|
||||
}
|
||||
if(obecny != s.end())
|
||||
{
|
||||
if(obecny->second < st->ID) //we have to replace old building with current one
|
||||
if((*(CGI->townh->structures[town->subID][obecny->second])) < (*(CGI->townh->structures[town->subID][st->ID]))) //we have to replace old building with current one
|
||||
{
|
||||
for(int itpb = 0; itpb<buildings.size(); itpb++)
|
||||
{
|
||||
@ -312,7 +312,7 @@ void CCastleInterface::showAll(SDL_Surface * to)
|
||||
pomy = (i>3)?(507):(459);
|
||||
blitAt(CGI->creh->smallImgs[cid],pomx,pomy,to);
|
||||
std::ostringstream oss;
|
||||
oss << '+' << town->creatureIncome[i];
|
||||
oss << '+' << (CGI->creh->creatures[cid].growth + town->creatureIncome[i]);
|
||||
CSDL_Ext::printAtMiddle(oss.str(),pomx+16,pomy+37,GEOR13,zwykly,to);
|
||||
}
|
||||
}
|
||||
|
@ -35,45 +35,45 @@
|
||||
0 42 TBCSUP_5.def 160 190
|
||||
0 43 TBCSUP_6.def 303 0
|
||||
0 20 TBCSBOAT.def 478 134
|
||||
1 16 TBRMBLAK.def 558 105
|
||||
1 16 TBRMBLAK.def 558 105
|
||||
1 9 TBRMCAS3.def 79 18
|
||||
1 8 TBRMCAS2.def 79 18
|
||||
1 7 TBRMCSTL.def 63 25
|
||||
1 30 TBRMDW_0.def 0 236
|
||||
1 31 TBRMDW_1.def 0 154
|
||||
1 32 TBRMDW_2.def 668 101
|
||||
1 33 TBRMDW_3.def 287 73
|
||||
1 34 TBRMDW_4.def 68 146
|
||||
1 35 TBRMDW_5.def 362 90
|
||||
1 36 TBRMDW_6.def 502 27
|
||||
1 21 TBRMEXT0.def 555 297
|
||||
1 22 TBRMEXT1.def 0 181
|
||||
1 27 TBRMEXT2.def 327 236
|
||||
1 27 TBRMEXT3.def 293 235
|
||||
1 27 TBRMEXT4.def 295 191
|
||||
1 29 TBRMEXT5.def 260 171
|
||||
1 43 TBRMUP_6.def 502 5
|
||||
1 42 TBRMUP_5.def 362 90
|
||||
1 41 TBRMUP_4.def 63 146
|
||||
1 40 TBRMUP_3.def 287 28
|
||||
1 39 TBRMUP_2.def 665 101
|
||||
1 38 TBRMUP_1.def 0 143
|
||||
1 37 TBRMUP_0.def 0 236
|
||||
1 5 TBRMTVRN.def 181 229
|
||||
1 17 TBRMSPEC.def 555 297
|
||||
1 15 TBRMSILO.def 245 324
|
||||
1 14 TBRMMARK.def 129 301
|
||||
1 0 TBRMMAGE.def 454 200
|
||||
1 1 TBRMMAG2.def 438 178
|
||||
1 2 TBRMMAG3.def 418 153
|
||||
1 3 TBRMMAG4.def 406 129
|
||||
1 4 TBRMMAG5.def 384 104
|
||||
1 25 TBRMHRD4.def 47 142
|
||||
1 24 TBRMHRD3.def 47 142
|
||||
1 19 TBRMHRD2.def 0 143
|
||||
1 18 TBRMHRD1.def 0 154
|
||||
1 26 TBRMHOLY.def 0 54
|
||||
1 10 TBRMHALL.def 565 216
|
||||
1 13 TBRMHAL4.def 534 187
|
||||
1 12 TBRMHAL3.def 538 187
|
||||
1 8 TBRMCAS2.def 79 18
|
||||
1 7 TBRMCSTL.def 63 25
|
||||
1 30 TBRMDW_0.def 0 236
|
||||
1 31 TBRMDW_1.def 0 154
|
||||
1 32 TBRMDW_2.def 668 101
|
||||
1 33 TBRMDW_3.def 287 73
|
||||
1 34 TBRMDW_4.def 68 146
|
||||
1 35 TBRMDW_5.def 362 90
|
||||
1 36 TBRMDW_6.def 502 27
|
||||
1 21 TBRMEXT0.def 555 297
|
||||
1 22 TBRMEXT1.def 0 181
|
||||
1 -1 TBRMEXT2.def 327 236
|
||||
1 27 TBRMEXT3.def 293 235
|
||||
1 28 TBRMEXT4.def 295 191
|
||||
1 29 TBRMEXT5.def 260 171
|
||||
1 43 TBRMUP_6.def 502 5
|
||||
1 42 TBRMUP_5.def 362 90
|
||||
1 41 TBRMUP_4.def 63 146
|
||||
1 40 TBRMUP_3.def 287 28
|
||||
1 39 TBRMUP_2.def 665 101
|
||||
1 38 TBRMUP_1.def 0 143
|
||||
1 37 TBRMUP_0.def 0 236
|
||||
1 5 TBRMTVRN.def 181 229
|
||||
1 17 TBRMSPEC.def 555 297
|
||||
1 15 TBRMSILO.def 245 324
|
||||
1 14 TBRMMARK.def 129 301
|
||||
1 0 TBRMMAGE.def 454 200
|
||||
1 1 TBRMMAG2.def 438 178
|
||||
1 2 TBRMMAG3.def 418 153
|
||||
1 3 TBRMMAG4.def 406 129
|
||||
1 4 TBRMMAG5.def 384 104
|
||||
1 25 TBRMHRD4.def 47 142
|
||||
1 24 TBRMHRD3.def 47 142
|
||||
1 19 TBRMHRD2.def 0 143
|
||||
1 18 TBRMHRD1.def 0 154
|
||||
1 26 TBRMHOLY.def 0 54
|
||||
1 10 TBRMHALL.def 565 216
|
||||
1 13 TBRMHAL4.def 534 187
|
||||
1 12 TBRMHAL3.def 538 187
|
||||
1 11 TBRMHAL2.def 538 187
|
@ -45,13 +45,17 @@ CASTLE 1
|
||||
30
|
||||
37
|
||||
14
|
||||
15
|
||||
10
|
||||
11
|
||||
12
|
||||
13
|
||||
21
|
||||
22
|
||||
-1
|
||||
27
|
||||
28
|
||||
29
|
||||
15
|
||||
END
|
||||
EOD
|
||||
|
||||
|
@ -42,4 +42,10 @@ GROUP
|
||||
GROUP
|
||||
18
|
||||
19
|
||||
CASTLE 1
|
||||
GROUP
|
||||
24
|
||||
25
|
||||
34
|
||||
41
|
||||
EOD
|
@ -89,7 +89,7 @@ std::set<int> convertBuildings(const std::set<int> h3m, int castleID)
|
||||
else if(mapa[*i] >= (-CREATURES_PER_TOWN)) // horde buildings
|
||||
{
|
||||
int level = (-mapa[*i]);
|
||||
if(h3m.find(36+level) != h3m.end()) //upgraded creature horde building
|
||||
if(h3m.find(20+(level*3)) != h3m.end()) //upgraded creature horde building
|
||||
{
|
||||
if(((castleID==1) || (castleID==3)) && ((level==3) || (level==5)))
|
||||
ret.insert(25);
|
||||
@ -111,6 +111,14 @@ std::set<int> convertBuildings(const std::set<int> h3m, int castleID)
|
||||
}
|
||||
|
||||
ret.insert(10); //village hall is always present
|
||||
ret.insert(-1); //houses near v.hall
|
||||
|
||||
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);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -439,7 +439,7 @@ public:
|
||||
|
||||
//TODO:
|
||||
std::set<int> possibleBuildings, builtBuildings, h3mbuildings;
|
||||
std::vector<int> creatureIncome; //vector by level
|
||||
std::vector<int> creatureIncome; //vector by level - that valueis addedto thebasic growth
|
||||
std::vector<int> creaturesLeft; //that can be recruited
|
||||
|
||||
const CGHeroInstance * garrisonHero, *visitingHero;
|
||||
|
@ -131,13 +131,15 @@ void CTownHandler::loadNames()
|
||||
}
|
||||
else
|
||||
{
|
||||
of >> s;
|
||||
int itr=1;
|
||||
while(!of.eof())
|
||||
{
|
||||
std::map<int,std::map<int, Structure*> >::iterator i;
|
||||
std::map<int, Structure*>::iterator i2;
|
||||
int itr=1, buildingID;
|
||||
int buildingID;
|
||||
int castleID;
|
||||
of >> s;
|
||||
itr++;
|
||||
if (s == "CASTLE")
|
||||
{
|
||||
of >> castleID;
|
||||
@ -158,7 +160,7 @@ void CTownHandler::loadNames()
|
||||
while(1)
|
||||
{
|
||||
of >> s;
|
||||
if((s == "GROUP") || (s == "EOD")) //
|
||||
if((s == "GROUP") || (s == "EOD") || (s == "CASTLE")) //
|
||||
break;
|
||||
buildingID = atoi(s.c_str());
|
||||
if(castleID>=0)
|
||||
@ -186,6 +188,8 @@ void CTownHandler::loadNames()
|
||||
}
|
||||
}
|
||||
}
|
||||
if(s == "CASTLE")
|
||||
break;
|
||||
itr++;
|
||||
}//if (s == "GROUP")
|
||||
else if(s == "EOD")
|
||||
|
@ -29,6 +29,13 @@ struct Structure
|
||||
int3 pos;
|
||||
std::string defName, borderName, areaName, name;
|
||||
int townID, group;
|
||||
bool operator<(const Structure & p2) const
|
||||
{
|
||||
if(pos.z != p2.pos.z)
|
||||
return (pos.z) < (p2.pos.z);
|
||||
else
|
||||
return (ID) < (p2.ID);
|
||||
}
|
||||
};
|
||||
|
||||
class CTownHandler
|
||||
|
Loading…
Reference in New Issue
Block a user