mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Added "tavernVideo","guildBackground" to "faction" JSON config and schema. If "primaryResource" is set to "gold", silo will generate 500 gold per day
This commit is contained in:
parent
fe4704157c
commit
b7b890acff
@ -2355,7 +2355,8 @@ TResources VCAI::estimateIncome() const
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ret[t->town->primaryRes] ++;
|
if (t->town->primaryRes != Res::GOLD)
|
||||||
|
ret[t->town->primaryRes]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -847,7 +847,9 @@ void CCastleBuildings::enterTownHall()
|
|||||||
|
|
||||||
void CCastleBuildings::openMagesGuild()
|
void CCastleBuildings::openMagesGuild()
|
||||||
{
|
{
|
||||||
GH.pushInt(new CMageGuildScreen(LOCPLINT->castleInt));
|
std::string mageGuildBackground;
|
||||||
|
mageGuildBackground = LOCPLINT->castleInt->town->town->clientInfo.guildBackground;
|
||||||
|
GH.pushInt(new CMageGuildScreen(LOCPLINT->castleInt,mageGuildBackground));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCastleBuildings::openTownHall()
|
void CCastleBuildings::openTownHall()
|
||||||
@ -1636,9 +1638,12 @@ void CFortScreen::RecruitArea::clickRight(tribool down, bool previousState)
|
|||||||
clickLeft(down, false); //r-click does same as l-click - opens recr. window
|
clickLeft(down, false); //r-click does same as l-click - opens recr. window
|
||||||
}
|
}
|
||||||
|
|
||||||
CMageGuildScreen::CMageGuildScreen(CCastleInterface * owner):
|
|
||||||
CWindowObject(BORDERED, "TPMAGE")
|
|
||||||
|
|
||||||
|
CMageGuildScreen::CMageGuildScreen(CCastleInterface * owner,std::string imagem) :CWindowObject(BORDERED,imagem)
|
||||||
{
|
{
|
||||||
|
|
||||||
OBJ_CONSTRUCTION_CAPTURING_ALL;
|
OBJ_CONSTRUCTION_CAPTURING_ALL;
|
||||||
|
|
||||||
window = new CPicture(owner->town->town->clientInfo.guildWindow , 332, 76);
|
window = new CPicture(owner->town->town->clientInfo.guildWindow , 332, 76);
|
||||||
|
@ -360,7 +360,7 @@ class CMageGuildScreen : public CWindowObject
|
|||||||
CGStatusBar *statusBar;
|
CGStatusBar *statusBar;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CMageGuildScreen(CCastleInterface * owner);
|
CMageGuildScreen(CCastleInterface * owner,std::string image);
|
||||||
};
|
};
|
||||||
|
|
||||||
/// The blacksmith window where you can buy available in town war machine
|
/// The blacksmith window where you can buy available in town war machine
|
||||||
|
@ -3742,8 +3742,8 @@ CTavernWindow::CTavernWindow(const CGObjectInstance *TavernObj):
|
|||||||
if(selected == -1)
|
if(selected == -1)
|
||||||
recruit->block(true);
|
recruit->block(true);
|
||||||
}
|
}
|
||||||
|
CCS->videoh->open(LOCPLINT->castleInt->town->town->clientInfo.tavernVideo);
|
||||||
|
|
||||||
CCS->videoh->open("TAVERN.BIK");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTavernWindow::recruitb()
|
void CTavernWindow::recruitb()
|
||||||
|
@ -116,7 +116,8 @@
|
|||||||
|
|
||||||
"musicTheme" : "music/CstleTown",
|
"musicTheme" : "music/CstleTown",
|
||||||
"defaultTavern" : 5,
|
"defaultTavern" : 5,
|
||||||
|
"tavernVideo" : "TAVERN.BIK",
|
||||||
|
"guildBackground" : "TPMAGE.bmp",
|
||||||
"townBackground": "TBCSBACK.bmp",
|
"townBackground": "TBCSBACK.bmp",
|
||||||
"guildWindow": "TPMAGECS.bmp",
|
"guildWindow": "TPMAGECS.bmp",
|
||||||
"buildingsIcons": "HALLCSTL.DEF",
|
"buildingsIcons": "HALLCSTL.DEF",
|
||||||
|
@ -120,7 +120,8 @@
|
|||||||
|
|
||||||
"musicTheme" : "music/ElemTown",
|
"musicTheme" : "music/ElemTown",
|
||||||
"defaultTavern" : 5,
|
"defaultTavern" : 5,
|
||||||
|
"tavernVideo" : "TAVERN.BIK",
|
||||||
|
"guildBackground" : "TPMAGE.bmp",
|
||||||
"townBackground": "TBELBACK.bmp",
|
"townBackground": "TBELBACK.bmp",
|
||||||
"guildWindow": "TPMAGEEL.bmp",
|
"guildWindow": "TPMAGEEL.bmp",
|
||||||
"buildingsIcons": "HALLELEM.DEF",
|
"buildingsIcons": "HALLELEM.DEF",
|
||||||
|
@ -115,7 +115,8 @@
|
|||||||
|
|
||||||
"musicTheme" : "music/Dungeon",
|
"musicTheme" : "music/Dungeon",
|
||||||
"defaultTavern" : 5,
|
"defaultTavern" : 5,
|
||||||
|
"tavernVideo" : "TAVERN.BIK",
|
||||||
|
"guildBackground" : "TPMAGE.bmp",
|
||||||
"townBackground": "TBDNBACK.bmp",
|
"townBackground": "TBDNBACK.bmp",
|
||||||
"guildWindow": "TPMAGEDN.bmp",
|
"guildWindow": "TPMAGEDN.bmp",
|
||||||
"buildingsIcons": "HALLDUNG.DEF",
|
"buildingsIcons": "HALLDUNG.DEF",
|
||||||
|
@ -116,7 +116,8 @@
|
|||||||
|
|
||||||
"musicTheme" : "music/FortressTown",
|
"musicTheme" : "music/FortressTown",
|
||||||
"defaultTavern" : 5,
|
"defaultTavern" : 5,
|
||||||
|
"tavernVideo" : "TAVERN.BIK",
|
||||||
|
"guildBackground" : "TPMAGE.bmp",
|
||||||
"townBackground": "TBFRBACK.bmp",
|
"townBackground": "TBFRBACK.bmp",
|
||||||
"guildWindow": "TPMAGEFR.bmp",
|
"guildWindow": "TPMAGEFR.bmp",
|
||||||
"buildingsIcons": "HALLFORT.DEF",
|
"buildingsIcons": "HALLFORT.DEF",
|
||||||
|
@ -116,7 +116,8 @@
|
|||||||
|
|
||||||
"musicTheme" : "music/InfernoTown",
|
"musicTheme" : "music/InfernoTown",
|
||||||
"defaultTavern" : 5,
|
"defaultTavern" : 5,
|
||||||
|
"tavernVideo" : "TAVERN.BIK",
|
||||||
|
"guildBackground" : "TPMAGE.bmp",
|
||||||
"townBackground": "TBINBACK.bmp",
|
"townBackground": "TBINBACK.bmp",
|
||||||
"guildWindow": "TPMAGEIN.bmp",
|
"guildWindow": "TPMAGEIN.bmp",
|
||||||
"buildingsIcons": "HALLINFR.DEF",
|
"buildingsIcons": "HALLINFR.DEF",
|
||||||
|
@ -120,7 +120,8 @@
|
|||||||
|
|
||||||
"musicTheme" : "music/NecroTown",
|
"musicTheme" : "music/NecroTown",
|
||||||
"defaultTavern" : 5,
|
"defaultTavern" : 5,
|
||||||
|
"tavernVideo" : "TAVERN.BIK",
|
||||||
|
"guildBackground" : "TPMAGE.bmp",
|
||||||
"townBackground": "TBNCBACK.bmp",
|
"townBackground": "TBNCBACK.bmp",
|
||||||
"guildWindow": "TPMAGENC.bmp",
|
"guildWindow": "TPMAGENC.bmp",
|
||||||
"buildingsIcons": "HALLNECR.DEF",
|
"buildingsIcons": "HALLNECR.DEF",
|
||||||
|
@ -120,7 +120,8 @@
|
|||||||
|
|
||||||
"musicTheme" : "music/Rampart",
|
"musicTheme" : "music/Rampart",
|
||||||
"defaultTavern" : 5,
|
"defaultTavern" : 5,
|
||||||
|
"tavernVideo" : "TAVERN.BIK",
|
||||||
|
"guildBackground" : "TPMAGE.bmp",
|
||||||
"townBackground": "TBRMBACK.bmp",
|
"townBackground": "TBRMBACK.bmp",
|
||||||
"guildWindow": "TPMAGERM.bmp",
|
"guildWindow": "TPMAGERM.bmp",
|
||||||
"buildingsIcons": "HALLRAMP.DEF",
|
"buildingsIcons": "HALLRAMP.DEF",
|
||||||
|
@ -114,7 +114,8 @@
|
|||||||
|
|
||||||
"musicTheme" : "music/Stronghold",
|
"musicTheme" : "music/Stronghold",
|
||||||
"defaultTavern" : 5,
|
"defaultTavern" : 5,
|
||||||
|
"tavernVideo" : "TAVERN.BIK",
|
||||||
|
"guildBackground" : "TPMAGE.bmp",
|
||||||
"townBackground": "TBSTBACK.bmp",
|
"townBackground": "TBSTBACK.bmp",
|
||||||
"guildWindow": "TPMAGEST.bmp",
|
"guildWindow": "TPMAGEST.bmp",
|
||||||
"buildingsIcons": "HALLSTRN.DEF",
|
"buildingsIcons": "HALLSTRN.DEF",
|
||||||
|
@ -115,7 +115,8 @@
|
|||||||
|
|
||||||
"musicTheme" : "music/TowerTown",
|
"musicTheme" : "music/TowerTown",
|
||||||
"defaultTavern" : 5,
|
"defaultTavern" : 5,
|
||||||
|
"tavernVideo" : "TAVERN.BIK",
|
||||||
|
"guildBackground" : "TPMAGE.bmp",
|
||||||
"townBackground": "TBTWBACK.bmp",
|
"townBackground": "TBTWBACK.bmp",
|
||||||
"guildWindow": "TPMAGETW.bmp",
|
"guildWindow": "TPMAGETW.bmp",
|
||||||
"buildingsIcons": "HALLTOWR.DEF",
|
"buildingsIcons": "HALLTOWR.DEF",
|
||||||
|
@ -105,8 +105,7 @@
|
|||||||
"additionalProperties" : false,
|
"additionalProperties" : false,
|
||||||
"required" : [
|
"required" : [
|
||||||
"adventureMap", "buildingsIcons", "buildings", "creatures", "guildWindow", "names",
|
"adventureMap", "buildingsIcons", "buildings", "creatures", "guildWindow", "names",
|
||||||
"hallBackground", "hallSlots", "horde", "mageGuild", "moatDamage", "defaultTavern",
|
"hallBackground", "hallSlots", "horde", "mageGuild", "moatDamage", "defaultTavern", "tavernVideo", "guildBackground", "musicTheme", "siege", "structures", "townBackground", "warMachine"
|
||||||
"musicTheme", "siege", "structures", "townBackground", "warMachine"
|
|
||||||
],
|
],
|
||||||
"description": "town",
|
"description": "town",
|
||||||
"properties":{
|
"properties":{
|
||||||
@ -168,6 +167,10 @@
|
|||||||
"minimum" : 0
|
"minimum" : 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"tavernVideo" : {
|
||||||
|
"type" : "string",
|
||||||
|
"description" : "Video for tavern window"
|
||||||
|
},
|
||||||
"names" : {
|
"names" : {
|
||||||
"type" : "array",
|
"type" : "array",
|
||||||
"description" : "Names for towns on adventure map",
|
"description" : "Names for towns on adventure map",
|
||||||
@ -199,6 +202,12 @@
|
|||||||
"type":"string",
|
"type":"string",
|
||||||
"description": "Image with small view on town from mage guild"
|
"description": "Image with small view on town from mage guild"
|
||||||
},
|
},
|
||||||
|
"guildBackground": {
|
||||||
|
"type":"string",
|
||||||
|
"description": "Image with background of mage guild",
|
||||||
|
"format" : "imageFile"
|
||||||
|
},
|
||||||
|
|
||||||
"hallBackground": {
|
"hallBackground": {
|
||||||
"type":"string",
|
"type":"string",
|
||||||
"description": "background image for town hall",
|
"description": "background image for town hall",
|
||||||
|
7202
lib/CGameState.cpp
7202
lib/CGameState.cpp
File diff suppressed because it is too large
Load Diff
@ -2283,6 +2283,8 @@ int CGTownInstance::dailyIncome() const
|
|||||||
ret+=1000;
|
ret+=1000;
|
||||||
else if (hasBuilt(BuildingID::VILLAGE_HALL))
|
else if (hasBuilt(BuildingID::VILLAGE_HALL))
|
||||||
ret+=500;
|
ret+=500;
|
||||||
|
if (hasBuilt(BuildingID::RESOURCE_SILO)&&(town->primaryRes==Res::GOLD))
|
||||||
|
ret += 500;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
bool CGTownInstance::hasFort() const
|
bool CGTownInstance::hasFort() const
|
||||||
|
@ -510,6 +510,17 @@ void CTownHandler::loadClientData(CTown &town, const JsonNode & source)
|
|||||||
info.guildWindow = source["guildWindow"].String();
|
info.guildWindow = source["guildWindow"].String();
|
||||||
info.buildingsIcons = source["buildingsIcons"].String();
|
info.buildingsIcons = source["buildingsIcons"].String();
|
||||||
|
|
||||||
|
//left for back compatibility - will be removed later
|
||||||
|
if (source["guildBackground"].String() != "")
|
||||||
|
info.guildBackground = source["guildBackground"].String();
|
||||||
|
else
|
||||||
|
info.guildBackground = "TPMAGE.bmp";
|
||||||
|
if (source["tavernVideo"].String() != "")
|
||||||
|
info.tavernVideo = source["tavernVideo"].String();
|
||||||
|
else
|
||||||
|
info.tavernVideo = "TAVERN.BIK";
|
||||||
|
//end of legacy assignment
|
||||||
|
|
||||||
info.advMapVillage = source["adventureMap"]["village"].String();
|
info.advMapVillage = source["adventureMap"]["village"].String();
|
||||||
info.advMapCastle = source["adventureMap"]["castle"].String();
|
info.advMapCastle = source["adventureMap"]["castle"].String();
|
||||||
info.advMapCapitol = source["adventureMap"]["capitol"].String();
|
info.advMapCapitol = source["adventureMap"]["capitol"].String();
|
||||||
@ -535,6 +546,8 @@ void CTownHandler::loadTown(CTown &town, const JsonNode & source)
|
|||||||
|
|
||||||
town.moatDamage = source["moatDamage"].Float();
|
town.moatDamage = source["moatDamage"].Float();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
town.mageLevel = source["mageGuild"].Float();
|
town.mageLevel = source["mageGuild"].Float();
|
||||||
town.names = source["names"].convertTo<std::vector<std::string> >();
|
town.names = source["names"].convertTo<std::vector<std::string> >();
|
||||||
|
|
||||||
@ -648,6 +661,7 @@ CFaction * CTownHandler::loadFromJson(const JsonNode &source, std::string identi
|
|||||||
faction->creatureBg120 = source["creatureBackground"]["120px"].String();
|
faction->creatureBg120 = source["creatureBackground"]["120px"].String();
|
||||||
faction->creatureBg130 = source["creatureBackground"]["130px"].String();
|
faction->creatureBg130 = source["creatureBackground"]["130px"].String();
|
||||||
|
|
||||||
|
|
||||||
faction->nativeTerrain = ETerrainType(vstd::find_pos(GameConstants::TERRAIN_NAMES,
|
faction->nativeTerrain = ETerrainType(vstd::find_pos(GameConstants::TERRAIN_NAMES,
|
||||||
source["nativeTerrain"].String()));
|
source["nativeTerrain"].String()));
|
||||||
int alignment = vstd::find_pos(EAlignment::names, source["alignment"].String());
|
int alignment = vstd::find_pos(EAlignment::names, source["alignment"].String());
|
||||||
|
@ -116,6 +116,8 @@ public:
|
|||||||
|
|
||||||
std::string creatureBg120;
|
std::string creatureBg120;
|
||||||
std::string creatureBg130;
|
std::string creatureBg130;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
std::vector<SPuzzleInfo> puzzleMap;
|
std::vector<SPuzzleInfo> puzzleMap;
|
||||||
|
|
||||||
@ -132,7 +134,7 @@ public:
|
|||||||
~CTown();
|
~CTown();
|
||||||
|
|
||||||
CFaction * faction;
|
CFaction * faction;
|
||||||
|
|
||||||
std::vector<std::string> names; //names of the town instances
|
std::vector<std::string> names; //names of the town instances
|
||||||
|
|
||||||
/// level -> list of creatures on this tier
|
/// level -> list of creatures on this tier
|
||||||
@ -170,9 +172,10 @@ public:
|
|||||||
int icons[2][2];
|
int icons[2][2];
|
||||||
std::string iconSmall[2][2]; /// icon names used during loading
|
std::string iconSmall[2][2]; /// icon names used during loading
|
||||||
std::string iconLarge[2][2];
|
std::string iconLarge[2][2];
|
||||||
|
std::string tavernVideo;
|
||||||
std::string musicTheme;
|
std::string musicTheme;
|
||||||
std::string townBackground;
|
std::string townBackground;
|
||||||
|
std::string guildBackground;
|
||||||
std::string guildWindow;
|
std::string guildWindow;
|
||||||
std::string buildingsIcons;
|
std::string buildingsIcons;
|
||||||
std::string hallBackground;
|
std::string hallBackground;
|
||||||
@ -193,7 +196,7 @@ public:
|
|||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
template <typename Handler> void serialize(Handler &h, const int version)
|
||||||
{
|
{
|
||||||
h & icons & iconSmall & iconLarge & musicTheme & townBackground & guildWindow & buildingsIcons & hallBackground;
|
h & icons & iconSmall & iconLarge & tavernVideo & musicTheme & townBackground & guildBackground & guildWindow & buildingsIcons & hallBackground;
|
||||||
h & advMapVillage & advMapCastle & advMapCapitol & hallSlots & structures;
|
h & advMapVillage & advMapCastle & advMapCapitol & hallSlots & structures;
|
||||||
h & siegePrefix & siegePositions & siegeShooter;
|
h & siegePrefix & siegePositions & siegeShooter;
|
||||||
}
|
}
|
||||||
|
2240
lib/JsonDetail.cpp
2240
lib/JsonDetail.cpp
File diff suppressed because it is too large
Load Diff
@ -1339,7 +1339,8 @@ void CGameHandler::newTurn()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
n.res[player][t->town->primaryRes] ++;
|
if (t->town->primaryRes != Res::GOLD)
|
||||||
|
n.res[player][t->town->primaryRes] ++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user