From c82bfd0f3e2bf3426dda8728fe8c947af3a9fa1d Mon Sep 17 00:00:00 2001 From: DjWarmonger Date: Sun, 8 Jun 2014 08:42:29 +0200 Subject: [PATCH] - Fixed guard generation - Added Jebus template for comparison --- config/rmg.json | 58 ++++++++++++++++++++++++++++++++++++ lib/rmg/CRmgTemplateZone.cpp | 9 +++--- 2 files changed, 63 insertions(+), 4 deletions(-) diff --git a/config/rmg.json b/config/rmg.json index 7a5d31080..49934560e 100644 --- a/config/rmg.json +++ b/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 } + ] } } diff --git a/lib/rmg/CRmgTemplateZone.cpp b/lib/rmg/CRmgTemplateZone.cpp index ef1e616ef..280d6b2ef 100644 --- a/lib/rmg/CRmgTemplateZone.cpp +++ b/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