Kaynağa Gözat

Merge branch 'develop' of https://github.com/vcmi/vcmi into RMG

DjWarmonger 11 yıl önce
ebeveyn
işleme
383280f72a

+ 17 - 17
config/objects/generic.json

@@ -64,26 +64,26 @@
 	},
 
 	/// Random objects
-	"randomResource"				: { "index" :76,  "handler": "resource" },
-	"randomTown"					: { "index" :77,  "handler": "town" },
-	"randomHero"					: { "index" :70,  "handler": "hero" },
+	"randomResource"				: { "index" :76,  "handler": "randomResource", "types" : { "object" : { "index" : 0} }  },
+	"randomTown"					: { "index" :77,  "handler": "randomTown", "types" : { "object" : { "index" : 0} }  },
+	"randomHero"					: { "index" :70,  "handler": "randomHero", "types" : { "object" : { "index" : 0} }  },
 	
-	"randomDwelling"				: { "index" :216, "handler": "dwelling" },
+	"randomDwelling"				: { "index" :216, "handler": "randomDwelling", "types" : { "object" : { "index" : 0} }  },
 
-	"randomArtifact"				: { "index" :65,  "handler": "artifact" },
-	"randomArtifactTreasure"		: { "index" :66,  "handler": "artifact" },
-	"randomArtifactMinor"			: { "index" :67,  "handler": "artifact" },
-	"randomArtifactMajor"			: { "index" :68,  "handler": "artifact" },
-	"randomArtifactRelic"			: { "index" :69,  "handler": "artifact" },
+	"randomArtifact"				: { "index" :65,  "handler": "randomArtifact", "types" : { "object" : { "index" : 0} }  },
+	"randomArtifactTreasure"		: { "index" :66,  "handler": "randomArtifact", "types" : { "object" : { "index" : 0} }  },
+	"randomArtifactMinor"			: { "index" :67,  "handler": "randomArtifact", "types" : { "object" : { "index" : 0} }  },
+	"randomArtifactMajor"			: { "index" :68,  "handler": "randomArtifact", "types" : { "object" : { "index" : 0} }  },
+	"randomArtifactRelic"			: { "index" :69,  "handler": "randomArtifact", "types" : { "object" : { "index" : 0} }  },
 
-	"randomMonster"					: { "index" :71,  "handler": "monster" },
-	"randomMonsterLevel1"			: { "index" :72,  "handler": "monster" },
-	"randomMonsterLevel2"			: { "index" :73,  "handler": "monster" },
-	"randomMonsterLevel3"			: { "index" :74,  "handler": "monster" },
-	"randomMonsterLevel4"			: { "index" :75,  "handler": "monster" },
-	"randomMonsterLevel5"			: { "index" :162, "handler": "monster" },
-	"randomMonsterLevel6"			: { "index" :163, "handler": "monster" },
-	"randomMonsterLevel7"			: { "index" :164, "handler": "monster" },
+	"randomMonster"					: { "index" :71,  "handler": "randomMonster", "types" : { "object" : { "index" : 0} }  },
+	"randomMonsterLevel1"			: { "index" :72,  "handler": "randomMonster", "types" : { "object" : { "index" : 0} }  },
+	"randomMonsterLevel2"			: { "index" :73,  "handler": "randomMonster", "types" : { "object" : { "index" : 0} }  },
+	"randomMonsterLevel3"			: { "index" :74,  "handler": "randomMonster", "types" : { "object" : { "index" : 0} }  },
+	"randomMonsterLevel4"			: { "index" :75,  "handler": "randomMonster", "types" : { "object" : { "index" : 0} }  },
+	"randomMonsterLevel5"			: { "index" :162, "handler": "randomMonster", "types" : { "object" : { "index" : 0} }  },
+	"randomMonsterLevel6"			: { "index" :163, "handler": "randomMonster", "types" : { "object" : { "index" : 0} }  },
+	"randomMonsterLevel7"			: { "index" :164, "handler": "randomMonster", "types" : { "object" : { "index" : 0} }  },
 
 	/// Classes without dedicated object
 	"hillFort"						: { "index" :35,  "handler": "generic", "types" : { "object" : { "index" : 0} } },

+ 29 - 4
config/objects/moddables.json

@@ -236,12 +236,37 @@
 	"seerHut" : { "index" :83, "handler": "seerHut" },
 
 	// subtype: level
-	"randomDwellingLvl"				: { "index" :217, "handler": "dwelling" },
+	"randomDwellingLvl" : {
+		"index" :217, "handler": "randomDwelling",
+			"types" : {
+				"objectLvl1" : { "index" : 0},
+				"objectLvl2" : { "index" : 1},
+				"objectLvl3" : { "index" : 2},
+				"objectLvl4" : { "index" : 3},
+				"objectLvl5" : { "index" : 4},
+				"objectLvl6" : { "index" : 5},
+				"objectLvl7" : { "index" : 6}
+			} 
+	},
 	
 	// subtype: faction ID
-	"randomDwellingFaction"			: { "index" :218, "handler": "dwelling" },
+	"randomDwellingFaction" : {
+		"index" :218,
+		"handler": "randomDwelling",
+			"types" : {
+				"objectCastle"     : { "index" : 0},
+				"objectRampart"    : { "index" : 1},
+				"objectTower"      : { "index" : 2},
+				"objectInferno"    : { "index" : 3},
+				"objectNecropolis" : { "index" : 4},
+				"objectDungeon"    : { "index" : 5},
+				"objectStronghold" : { "index" : 6},
+				"objectFortress"   : { "index" : 7},
+				"objectConflux"     : { "index" : 8},
+			}
+	},
 
 	// don't have subtypes (at least now), but closely connected to this objects
-	"spellScroll"					: { "index" :93, "handler": "artifact" },
-	"heroPlaceholder"				: { "index" :214, "handler": "heroPlaceholder" }
+	"spellScroll"					: { "index" :93, "handler": "artifact", "types" : { "object" : { "index" : 0 } } },
+	"heroPlaceholder"				: { "index" :214, "handler": "heroPlaceholder", "types" : { "object" : { "index" : 0 } } }
 }

+ 8 - 0
lib/mapObjects/CObjectClassesHandler.cpp

@@ -40,6 +40,13 @@ CObjectClassesHandler::CObjectClassesHandler()
 	SET_HANDLER_CLASS("static", CObstacleConstructor);
 	SET_HANDLER_CLASS("", CObstacleConstructor);
 
+	SET_HANDLER("randomArtifact", CGArtifact);
+	SET_HANDLER("randomHero", CGHeroInstance);
+	SET_HANDLER("randomResource", CGResource);
+	SET_HANDLER("randomTown", CGTownInstance);
+	SET_HANDLER("randomMonster", CGCreature);
+	SET_HANDLER("randomDwelling", CGDwelling);
+
 	SET_HANDLER("generic", CGObjectInstance);
 	SET_HANDLER("market", CGMarket);
 	SET_HANDLER("cartographer", CCartographer);
@@ -67,6 +74,7 @@ CObjectClassesHandler::CObjectClassesHandler()
 	SET_HANDLER("pandora", CGPandoraBox);
 	SET_HANDLER("pickable", CGPickable);
 	SET_HANDLER("prison", CGHeroInstance);
+	SET_HANDLER("prison", CGHeroInstance);
 	SET_HANDLER("questGuard", CGQuestGuard);
 	SET_HANDLER("resource", CGResource);
 	SET_HANDLER("scholar", CGScholar);

+ 1 - 2
scripting/erm/ERM.cbp

@@ -48,7 +48,7 @@
 			<Add option="-lboost_thread$(#boost.libsuffix)" />
 			<Add option="-lboost_chrono$(#boost.libsuffix)" />
 			<Add option="-lVCMI_lib" />
-			<Add directory="$(#boost.lib)" />
+			<Add directory="$(#boost.lib32)" />
 			<Add directory="../.." />
 		</Linker>
 		<Unit filename="ERMInterpreter.cpp" />
@@ -58,7 +58,6 @@
 		<Unit filename="ERMScriptModule.cpp" />
 		<Unit filename="ERMScriptModule.h" />
 		<Unit filename="StdInc.h">
-			<Option compile="1" />
 			<Option weight="0" />
 		</Unit>
 		<Extensions>

+ 2 - 0
scripting/erm/ERMInterpreter.cpp

@@ -8,6 +8,8 @@
 #include "../../lib/CCreatureHandler.h"
 #include "../../lib/VCMIDirs.h"
 #include "../../lib/IGameCallback.h"
+#include "../../lib/mapObjects/CGHeroInstance.h"
+#include "../../lib/mapObjects/MiscObjects.h"
 
 /*
  * ERMInterpreter.cpp, part of VCMI engine