Преглед изворни кода

- Fixed guard generation
- Added Jebus template for comparison

DjWarmonger пре 11 година
родитељ
комит
c82bfd0f3e
2 измењених фајлова са 63 додато и 4 уклоњено
  1. 58 0
      config/rmg.json
  2. 5 4
      lib/rmg/CRmgTemplateZone.cpp

+ 58 - 0
config/rmg.json

@@ -200,5 +200,63 @@
 			{ "a" : "3", "b" : "5", "guard" : 2000 },
 			{ "a" : "4", "b" : "6", "guard" : 2000 }
 		]
+	},
+	"Jebus Cross":
+	{
+		"minSize" : "l", "maxSize" : "xl",
+		"players" : "4",
+		"zones":
+		{
+			"1":
+			{
+				"type" : "playerStart", "size" : 30, "owner" : 1,
+				"playerTowns" : { "castles" : 1 },
+				"neutralTowns" : { "towns" : 2 },
+				"treasure" : [
+								{"min" : 12000, "max": 22000, "density": 1},
+								{"min" : 500, "max": 1600, "density": 6},
+								{"min" : 300, "max": 3000, "density": 14}
+							]
+			},
+			"2":
+			{
+				"type" : "playerStart", "size" : 30, "owner" : 2,
+				"playerTowns" : { "castles" : 1 },
+				"neutralTowns" : { "towns" : 2 },
+				"treasureLikeZone" : 1
+			},
+			"3":
+			{
+				"type" : "playerStart", "size" : 30, "owner" : 3,
+				"playerTowns" : { "castles" : 1 },
+				"neutralTowns" : { "towns" : 2 },
+				"treasureLikeZone" : 1
+			},
+			"4":
+			{
+				"type" : "playerStart", "size" : 30, "owner" : 4,
+				"playerTowns" : { "castles" : 1 },
+				"neutralTowns" : { "towns" : 2 },
+				"treasureLikeZone" : 1
+			},
+			"5" :
+			{
+				"type" : "treasure", "size" : 40,
+				"neutralTowns" : { "towns" : 2 },
+				"terrainTypes" : [ "sand" ],
+				"treasure" : [
+								{"min" : 35000, "max": 55000, "density" : 3},
+								{"min" : 25000, "max": 35000, "density" : 10},
+								{"min" : 10000, "max": 25000, "density" : 10}
+							]
+			}
+		}
+		"connections" :
+		[
+			{ "a" : "1", "b" : "5", "guard" : 45000 },
+			{ "a" : "2", "b" : "5", "guard" : 45000 },
+			{ "a" : "3", "b" : "5", "guard" : 45000 },
+			{ "a" : "4", "b" : "5", "guard" : 45000 }
+		]
 	}
 }

+ 5 - 4
lib/rmg/CRmgTemplateZone.cpp

@@ -442,15 +442,16 @@ bool CRmgTemplateZone::addMonster(CMapGenerator* gen, int3 &pos, si32 strength)
 			continue;
 		if ((cre->AIValue * (cre->ammMin + cre->ammMax) / 2 < strength) && (strength < cre->AIValue * 100)) //at least one full monster. size between minimum size of given stack and 100
 		{
-			amount = strength / cre->AIValue;
-			if (amount >= 4)
-				amount *= gen->rand.nextDouble(0.75, 1.25);
-
 			possibleCreatures.push_back(cre->idNumber);
 		}
 	}
 	if (possibleCreatures.size())
+	{
 		creId = *RandomGeneratorUtil::nextItem(possibleCreatures, gen->rand);
+		amount = strength / VLC->creh->creatures[creId]->AIValue;
+		if (amount >= 4)
+			amount *= gen->rand.nextDouble(0.75, 1.25);
+	}
 	else //just pick any available creature
 	{
 		creId = CreatureID(132); //Azure Dragon