diff --git a/AI/Nullkiller/Engine/FuzzyEngines.cpp b/AI/Nullkiller/Engine/FuzzyEngines.cpp index a7fb1b26c..7659f1352 100644 --- a/AI/Nullkiller/Engine/FuzzyEngines.cpp +++ b/AI/Nullkiller/Engine/FuzzyEngines.cpp @@ -208,12 +208,6 @@ float TacticalAdvantageEngine::getTacticalAdvantage(const CArmedInstance * we, c enemyFlyers->setValue(enemyStructure.flyers); enemySpeed->setValue(enemyStructure.maxSpeed); - bool bank = dynamic_cast(enemy); - if(bank) - bankPresent->setValue(1); - else - bankPresent->setValue(0); - const CGTownInstance * fort = dynamic_cast(enemy); if(fort) castleWalls->setValue(fort->fortLevel()); diff --git a/AI/Nullkiller/Engine/FuzzyHelper.cpp b/AI/Nullkiller/Engine/FuzzyHelper.cpp index ed7abb7c1..9188ed66f 100644 --- a/AI/Nullkiller/Engine/FuzzyHelper.cpp +++ b/AI/Nullkiller/Engine/FuzzyHelper.cpp @@ -20,25 +20,6 @@ namespace NKAI { -ui64 FuzzyHelper::estimateBankDanger(const CBank * bank) -{ - //this one is not fuzzy anymore, just calculate weighted average - - auto objectInfo = bank->getObjectHandler()->getObjectInfo(bank->appearance); - - CBankInfo * bankInfo = dynamic_cast(objectInfo.get()); - - ui64 totalStrength = 0; - ui8 totalChance = 0; - for(auto config : bankInfo->getPossibleGuards(bank->cb)) - { - totalStrength += config.second.totalStrength * config.first; - totalChance += config.first; - } - return totalStrength / std::max(totalChance, 1); //avoid division by zero - -} - ui64 FuzzyHelper::evaluateDanger(const int3 & tile, const CGHeroInstance * visitor, bool checkGuards) { auto cb = ai->cb.get(); @@ -171,14 +152,11 @@ ui64 FuzzyHelper::evaluateDanger(const CGObjectInstance * obj) case Obj::DRAGON_UTOPIA: case Obj::SHIPWRECK: //shipwreck case Obj::DERELICT_SHIP: //derelict ship + case Obj::PYRAMID: { const CArmedInstance * a = dynamic_cast(obj); return a->getArmyStrength(); } - case Obj::PYRAMID: - { - return estimateBankDanger(dynamic_cast(obj)); - } default: return 0; } diff --git a/AI/Nullkiller/Engine/FuzzyHelper.h b/AI/Nullkiller/Engine/FuzzyHelper.h index b203916ad..455da61e6 100644 --- a/AI/Nullkiller/Engine/FuzzyHelper.h +++ b/AI/Nullkiller/Engine/FuzzyHelper.h @@ -10,12 +10,6 @@ #pragma once #include "FuzzyEngines.h" -VCMI_LIB_NAMESPACE_BEGIN - -class CBank; - -VCMI_LIB_NAMESPACE_END - namespace NKAI { @@ -30,8 +24,6 @@ private: public: FuzzyHelper(const Nullkiller * ai): ai(ai) {} - ui64 estimateBankDanger(const CBank * bank); //TODO: move to another class? - ui64 evaluateDanger(const CGObjectInstance * obj); ui64 evaluateDanger(const int3 & tile, const CGHeroInstance * visitor, bool checkGuards = true); }; diff --git a/AI/VCAI/AIUtility.cpp b/AI/VCAI/AIUtility.cpp index ac68fa71b..a7c4c2f7a 100644 --- a/AI/VCAI/AIUtility.cpp +++ b/AI/VCAI/AIUtility.cpp @@ -16,7 +16,6 @@ #include "../../lib/UnlockGuard.h" #include "../../lib/CConfigHandler.h" #include "../../lib/CHeroHandler.h" -#include "../../lib/mapObjects/CBank.h" #include "../../lib/mapObjects/CGTownInstance.h" #include "../../lib/mapObjects/CQuest.h" #include "../../lib/mapping/CMapDefines.h" diff --git a/AI/VCAI/FuzzyEngines.cpp b/AI/VCAI/FuzzyEngines.cpp index 95c3dc4a9..05db1b15a 100644 --- a/AI/VCAI/FuzzyEngines.cpp +++ b/AI/VCAI/FuzzyEngines.cpp @@ -219,12 +219,6 @@ float TacticalAdvantageEngine::getTacticalAdvantage(const CArmedInstance * we, c enemyFlyers->setValue(enemyStructure.flyers); enemySpeed->setValue(enemyStructure.maxSpeed); - bool bank = dynamic_cast(enemy); - if(bank) - bankPresent->setValue(1); - else - bankPresent->setValue(0); - const CGTownInstance * fort = dynamic_cast(enemy); if(fort) castleWalls->setValue(fort->fortLevel()); diff --git a/AI/VCAI/FuzzyHelper.cpp b/AI/VCAI/FuzzyHelper.cpp index 332610ac6..ce51b2f7d 100644 --- a/AI/VCAI/FuzzyHelper.cpp +++ b/AI/VCAI/FuzzyHelper.cpp @@ -16,7 +16,6 @@ #include "../../lib/mapObjectConstructors/AObjectTypeHandler.h" #include "../../lib/mapObjectConstructors/CObjectClassesHandler.h" #include "../../lib/mapObjectConstructors/CBankInstanceConstructor.h" -#include "../../lib/mapObjects/CBank.h" #include "../../lib/mapObjects/CGCreature.h" #include "../../lib/mapObjects/CGDwelling.h" #include "../../lib/gameState/InfoAboutArmy.h" @@ -62,25 +61,6 @@ Goals::TSubgoal FuzzyHelper::chooseSolution(Goals::TGoalVec vec) return result; } -ui64 FuzzyHelper::estimateBankDanger(const CBank * bank) -{ - //this one is not fuzzy anymore, just calculate weighted average - - auto objectInfo = bank->getObjectHandler()->getObjectInfo(bank->appearance); - - CBankInfo * bankInfo = dynamic_cast(objectInfo.get()); - - ui64 totalStrength = 0; - ui8 totalChance = 0; - for(auto config : bankInfo->getPossibleGuards(bank->cb)) - { - totalStrength += config.second.totalStrength * config.first; - totalChance += config.first; - } - return totalStrength / std::max(totalChance, 1); //avoid division by zero - -} - float FuzzyHelper::evaluate(Goals::VisitTile & g) { if(g.parent) @@ -302,7 +282,6 @@ ui64 FuzzyHelper::evaluateDanger(const CGObjectInstance * obj, const VCAI * ai) return iat.army.getStrength(); } case Obj::MONSTER: - case Obj::CRYPT: { //TODO!!!!!!!! const CGCreature * cre = dynamic_cast(obj); @@ -320,12 +299,16 @@ ui64 FuzzyHelper::evaluateDanger(const CGObjectInstance * obj, const VCAI * ai) const CArmedInstance * a = dynamic_cast(obj); return a->getArmyStrength(); } + case Obj::CRYPT: case Obj::CREATURE_BANK: //crebank case Obj::DRAGON_UTOPIA: case Obj::SHIPWRECK: //shipwreck case Obj::DERELICT_SHIP: //derelict ship case Obj::PYRAMID: - return estimateBankDanger(dynamic_cast(obj)); + { + const CArmedInstance * a = dynamic_cast(obj); + return a->getArmyStrength(); + } default: return 0; } diff --git a/AI/VCAI/FuzzyHelper.h b/AI/VCAI/FuzzyHelper.h index 7542e7f70..dc0709a67 100644 --- a/AI/VCAI/FuzzyHelper.h +++ b/AI/VCAI/FuzzyHelper.h @@ -10,12 +10,6 @@ #pragma once #include "FuzzyEngines.h" -VCMI_LIB_NAMESPACE_BEGIN - -class CBank; - -VCMI_LIB_NAMESPACE_END - class DLL_EXPORT FuzzyHelper { public: @@ -42,8 +36,6 @@ public: float evaluate(Goals::AbstractGoal & g); void setPriority(Goals::TSubgoal & g); - ui64 estimateBankDanger(const CBank * bank); //TODO: move to another class? - Goals::TSubgoal chooseSolution(Goals::TGoalVec vec); //std::shared_ptr chooseSolution (std::vector> & vec); diff --git a/AI/VCAI/VCAI.cpp b/AI/VCAI/VCAI.cpp index 4da3ce9ef..3757c56d3 100644 --- a/AI/VCAI/VCAI.cpp +++ b/AI/VCAI/VCAI.cpp @@ -2750,8 +2750,6 @@ bool isWeeklyRevisitable(const CGObjectInstance * obj) if(dynamic_cast(obj)) return true; - if(dynamic_cast(obj)) //banks tend to respawn often in mods - return true; switch(obj->ID) { diff --git a/config/objects/creatureBanks.json b/config/objects/creatureBanks.json index fd8786c53..f05744014 100644 --- a/config/objects/creatureBanks.json +++ b/config/objects/creatureBanks.json @@ -1,7 +1,7 @@ { "creatureBank" : { "index" :16, - "handler": "bank", + "handler" : "configurable", "lastReservedIndex" : 6, "base" : { "sounds" : { @@ -21,106 +21,97 @@ "value" : 3000, "rarity" : 100 }, - "levels": [ + "onGuardedMessage" : 32, + "onVisitedMessage" : 33, + "visitMode" : "once", + "selectMode" : "selectFirst", + "rewards" : [ { - "chance": 30, - "guards": [ - { "amount": 4, "type": "cyclop" }, - { "amount": 4, "type": "cyclop" }, - { "amount": 4, "type": "cyclop", "upgradeChance": 50 }, - { "amount": 4, "type": "cyclop" }, - { "amount": 4, "type": "cyclop" } + "message" : 34, + "appearChance" : { "min" : 0, "max" : 30 }, + "guards" : [ + { "amount" : 4, "type" : "cyclop" }, + { "amount" : 4, "type" : "cyclop" }, + { "amount" : 4, "type" : "cyclop", "upgradeChance" : 50 }, + { "amount" : 4, "type" : "cyclop" }, + { "amount" : 4, "type" : "cyclop" } ], - "combat_value": 506, - "reward" : { - "value": 10000, - "resources": - { - "wood" : 4, - "mercury" : 4, - "ore" : 4, - "sulfur" : 4, - "crystal" : 4, - "gems" : 4 - } + "resources" : + { + "wood" : 4, + "mercury" : 4, + "ore" : 4, + "sulfur" : 4, + "crystal" : 4, + "gems" : 4 } }, { - "chance": 30, - "guards": [ - { "amount": 6, "type": "cyclop" }, - { "amount": 6, "type": "cyclop" }, - { "amount": 6, "type": "cyclop", "upgradeChance": 50 }, - { "amount": 6, "type": "cyclop" }, - { "amount": 6, "type": "cyclop" } + "message" : 34, + "appearChance" : { "min" : 30, "max" : 60 }, + "guards" : [ + { "amount" : 6, "type" : "cyclop" }, + { "amount" : 6, "type" : "cyclop" }, + { "amount" : 6, "type" : "cyclop", "upgradeChance" : 50 }, + { "amount" : 6, "type" : "cyclop" }, + { "amount" : 6, "type" : "cyclop" } ], - "combat_value": 760, - "reward" : { - "value": 15000, - "resources": - { - "wood" : 6, - "mercury" : 6, - "ore" : 6, - "sulfur" : 6, - "crystal" : 6, - "gems" : 6 - } + "resources" : + { + "wood" : 6, + "mercury" : 6, + "ore" : 6, + "sulfur" : 6, + "crystal" : 6, + "gems" : 6 } }, { - "chance": 30, - "guards": [ - { "amount": 8, "type": "cyclop" }, - { "amount": 8, "type": "cyclop" }, - { "amount": 8, "type": "cyclop", "upgradeChance": 50 }, - { "amount": 8, "type": "cyclop" }, - { "amount": 8, "type": "cyclop" } + "message" : 34, + "appearChance" : { "min" : 60, "max" : 90 }, + "guards" : [ + { "amount" : 8, "type" : "cyclop" }, + { "amount" : 8, "type" : "cyclop" }, + { "amount" : 8, "type" : "cyclop", "upgradeChance" : 50 }, + { "amount" : 8, "type" : "cyclop" }, + { "amount" : 8, "type" : "cyclop" } ], - "combat_value": 1013, - "reward" : { - "value": 20000, - "resources": - { - "wood" : 8, - "mercury" : 8, - "ore" : 8, - "sulfur" : 8, - "crystal" : 8, - "gems" : 8 - } + "resources" : + { + "wood" : 8, + "mercury" : 8, + "ore" : 8, + "sulfur" : 8, + "crystal" : 8, + "gems" : 8 } }, { - "chance": 10, - "guards": [ - { "amount": 10, "type": "cyclop" }, - { "amount": 10, "type": "cyclop" }, - { "amount": 10, "type": "cyclop", "upgradeChance": 50 }, - { "amount": 10, "type": "cyclop" }, - { "amount": 10, "type": "cyclop" } + "message" : 34, + "appearChance" : { "min" : 90, "max" : 100 }, + "guards" : [ + { "amount" : 10, "type" : "cyclop" }, + { "amount" : 10, "type" : "cyclop" }, + { "amount" : 10, "type" : "cyclop", "upgradeChance" : 50 }, + { "amount" : 10, "type" : "cyclop" }, + { "amount" : 10, "type" : "cyclop" } ], - "combat_value": 1266, - "reward" : { - "value": 25000, - "resources": - { - "wood" : 10, - "mercury" : 10, - "ore" : 10, - "sulfur" : 10, - "crystal" : 10, - "gems" : 10 - } + "resources" : + { + "wood" : 10, + "mercury" : 10, + "ore" : 10, + "sulfur" : 10, + "crystal" : 10, + "gems" : 10 } } ] }, "dwarvenTreasury" : { "index" : 1, - "resetDuration" : 0, "name" : "Dwarven Treasury", "aiValue" : 2000, "sounds" : { @@ -130,88 +121,79 @@ "value" : 2000, "rarity" : 100 }, - "levels": [ + "onGuardedMessage" : 32, + "onVisitedMessage" : 33, + "visitMode" : "once", + "selectMode" : "selectFirst", + "rewards" : [ { - "chance": 30, - "guards": [ - { "amount": 10, "type": "dwarf" }, - { "amount": 10, "type": "dwarf" }, - { "amount": 10, "type": "dwarf", "upgradeChance": 50 }, - { "amount": 10, "type": "dwarf" }, - { "amount": 10, "type": "dwarf" } + "message" : 34, + "appearChance" : { "min" : 0, "max" : 30 }, + "guards" : [ + { "amount" : 10, "type" : "dwarf" }, + { "amount" : 10, "type" : "dwarf" }, + { "amount" : 10, "type" : "dwarf", "upgradeChance" : 50 }, + { "amount" : 10, "type" : "dwarf" }, + { "amount" : 10, "type" : "dwarf" } ], - "combat_value": 194, - "reward" : { - "value": 3500, - "resources": - { - "crystal" : 2, - "gold" : 2500 - } + "resources" : + { + "crystal" : 2, + "gold" : 2500 } }, { - "chance": 30, - "guards": [ - { "amount": 15, "type": "dwarf" }, - { "amount": 15, "type": "dwarf" }, - { "amount": 15, "type": "dwarf", "upgradeChance": 50 }, - { "amount": 15, "type": "dwarf" }, - { "amount": 15, "type": "dwarf" } + "message" : 34, + "appearChance" : { "min" : 30, "max" : 60 }, + "guards" : [ + { "amount" : 15, "type" : "dwarf" }, + { "amount" : 15, "type" : "dwarf" }, + { "amount" : 15, "type" : "dwarf", "upgradeChance" : 50 }, + { "amount" : 15, "type" : "dwarf" }, + { "amount" : 15, "type" : "dwarf" } ], - "combat_value": 291, - "reward" : { - "value": 5500, - "resources": - { - "crystal" : 3, - "gold" : 4000 - } + "resources" : + { + "crystal" : 3, + "gold" : 4000 } }, { - "chance": 30, - "guards": [ - { "amount": 20, "type": "dwarf" }, - { "amount": 20, "type": "dwarf" }, - { "amount": 20, "type": "dwarf", "upgradeChance": 50 }, - { "amount": 20, "type": "dwarf" }, - { "amount": 20, "type": "dwarf" } + "message" : 34, + "appearChance" : { "min" : 60, "max" : 90 }, + "guards" : [ + { "amount" : 20, "type" : "dwarf" }, + { "amount" : 20, "type" : "dwarf" }, + { "amount" : 20, "type" : "dwarf", "upgradeChance" : 50 }, + { "amount" : 20, "type" : "dwarf" }, + { "amount" : 20, "type" : "dwarf" } ], - "combat_value": 388, - "reward" : { - "value": 7500, - "resources": - { - "crystal" : 5, - "gold" : 5000 - } + "resources" : + { + "crystal" : 5, + "gold" : 5000 } }, { - "chance": 10, - "guards": [ - { "amount": 30, "type": "dwarf" }, - { "amount": 30, "type": "dwarf" }, - { "amount": 30, "type": "dwarf", "upgradeChance": 50 }, - { "amount": 30, "type": "dwarf" }, - { "amount": 30, "type": "dwarf" } + "message" : 34, + "appearChance" : { "min" : 90, "max" : 100 }, + "guards" : [ + { "amount" : 30, "type" : "dwarf" }, + { "amount" : 30, "type" : "dwarf" }, + { "amount" : 30, "type" : "dwarf", "upgradeChance" : 50 }, + { "amount" : 30, "type" : "dwarf" }, + { "amount" : 30, "type" : "dwarf" } ], - "combat_value": 582, - "reward" : { - "value": 12500, - "resources": - { - "crystal" : 10, - "gold" : 7500 - } + "resources" : + { + "crystal" : 10, + "gold" : 7500 } } ] }, "griffinConservatory" : { "index" : 2, - "resetDuration" : 0, "name" : "Griffin Conservatory", "aiValue" : 9000, "sounds" : { @@ -221,72 +203,63 @@ "value" : 2000, "rarity" : 100 }, - "levels": [ + "onGuardedMessage" : 32, + "onVisitedMessage" : 33, + "visitMode" : "once", + "selectMode" : "selectFirst", + "rewards" : [ { - "chance": 30, - "guards": [ - { "amount": 10, "type": "griffin" }, - { "amount": 10, "type": "griffin" }, - { "amount": 10, "type": "griffin", "upgradeChance": 50 }, - { "amount": 10, "type": "griffin" }, - { "amount": 10, "type": "griffin" } + "message" : 34, + "appearChance" : { "min" : 0, "max" : 30 }, + "guards" : [ + { "amount" : 10, "type" : "griffin" }, + { "amount" : 10, "type" : "griffin" }, + { "amount" : 10, "type" : "griffin", "upgradeChance" : 50 }, + { "amount" : 10, "type" : "griffin" }, + { "amount" : 10, "type" : "griffin" } ], - "combat_value": 351, - "reward" : { - "value": 3000, - "creatures": [ { "amount": 1, "type": "angel" } ] - } + "creatures" : [ { "amount" : 1, "type" : "angel" } ] }, { - "chance": 30, - "guards": [ - { "amount": 20, "type": "griffin" }, - { "amount": 20, "type": "griffin" }, - { "amount": 20, "type": "griffin", "upgradeChance": 50 }, - { "amount": 20, "type": "griffin" }, - { "amount": 20, "type": "griffin" } + "message" : 34, + "appearChance" : { "min" : 30, "max" : 60 }, + "guards" : [ + { "amount" : 20, "type" : "griffin" }, + { "amount" : 20, "type" : "griffin" }, + { "amount" : 20, "type" : "griffin", "upgradeChance" : 50 }, + { "amount" : 20, "type" : "griffin" }, + { "amount" : 20, "type" : "griffin" } ], - "combat_value": 702, - "reward" : { - "value": 6000, - "creatures": [ { "amount": 2, "type": "angel" } ] - } + "creatures" : [ { "amount" : 2, "type" : "angel" } ] }, { - "chance": 30, - "guards": [ - { "amount": 30, "type": "griffin" }, - { "amount": 30, "type": "griffin" }, - { "amount": 30, "type": "griffin", "upgradeChance": 50 }, - { "amount": 30, "type": "griffin" }, - { "amount": 30, "type": "griffin" } + "message" : 34, + "appearChance" : { "min" : 60, "max" : 90 }, + "guards" : [ + { "amount" : 30, "type" : "griffin" }, + { "amount" : 30, "type" : "griffin" }, + { "amount" : 30, "type" : "griffin", "upgradeChance" : 50 }, + { "amount" : 30, "type" : "griffin" }, + { "amount" : 30, "type" : "griffin" } ], - "combat_value": 1053, - "reward" : { - "value": 9000, - "creatures": [ { "amount": 3, "type": "angel" } ] - } + "creatures" : [ { "amount" : 3, "type" : "angel" } ] }, { - "chance": 10, - "guards": [ - { "amount": 40, "type": "griffin" }, - { "amount": 40, "type": "griffin" }, - { "amount": 40, "type": "griffin", "upgradeChance": 50 }, - { "amount": 40, "type": "griffin" }, - { "amount": 40, "type": "griffin" } + "message" : 34, + "appearChance" : { "min" : 90, "max" : 100 }, + "guards" : [ + { "amount" : 40, "type" : "griffin" }, + { "amount" : 40, "type" : "griffin" }, + { "amount" : 40, "type" : "griffin", "upgradeChance" : 50 }, + { "amount" : 40, "type" : "griffin" }, + { "amount" : 40, "type" : "griffin" } ], - "combat_value": 1404, - "reward" : { - "value": 12000, - "creatures": [ { "amount": 4, "type": "angel" } ] - } + "creatures" : [ { "amount" : 4, "type" : "angel" } ] } ] }, "inpCache" : { "index" : 3, - "resetDuration" : 0, "name" : "Imp Cache", "aiValue" : 1500, "sounds" : { @@ -296,87 +269,78 @@ "value" : 5000, "rarity" : 100 }, - "levels": [ + "onGuardedMessage" : 32, + "onVisitedMessage" : 33, + "visitMode" : "once", + "selectMode" : "selectFirst", + "rewards" : [ { - "chance": 30, - "guards": [ - { "amount": 20, "type": "imp" }, - { "amount": 20, "type": "imp" }, - { "amount": 20, "type": "imp", "upgradeChance": 50 }, - { "amount": 20, "type": "imp" }, - { "amount": 20, "type": "imp" } + "message" : 34, + "appearChance" : { "min" : 0, "max" : 30 }, + "guards" : [ + { "amount" : 20, "type" : "imp" }, + { "amount" : 20, "type" : "imp" }, + { "amount" : 20, "type" : "imp", "upgradeChance" : 50 }, + { "amount" : 20, "type" : "imp" }, + { "amount" : 20, "type" : "imp" } ], - "combat_value": 100, - "reward" : { - "value": 2000, - "resources": - { - "gold" : 1000 - } + "resources" : + { + "gold" : 1000 } }, { - "chance": 30, - "guards": [ - { "amount": 30, "type": "imp" }, - { "amount": 30, "type": "imp" }, - { "amount": 30, "type": "imp", "upgradeChance": 50 }, - { "amount": 30, "type": "imp" }, - { "amount": 30, "type": "imp" } + "message" : 34, + "appearChance" : { "min" : 30, "max" : 60 }, + "guards" : [ + { "amount" : 30, "type" : "imp" }, + { "amount" : 30, "type" : "imp" }, + { "amount" : 30, "type" : "imp", "upgradeChance" : 50 }, + { "amount" : 30, "type" : "imp" }, + { "amount" : 30, "type" : "imp" } ], - "combat_value": 150, - "reward" : { - "value": 3000, - "resources": - { - "mercury" : 3, - "gold" : 1500 - } + "resources" : + { + "mercury" : 3, + "gold" : 1500 } }, { - "chance": 30, - "guards": [ - { "amount": 40, "type": "imp" }, - { "amount": 40, "type": "imp" }, - { "amount": 40, "type": "imp", "upgradeChance": 50 }, - { "amount": 40, "type": "imp" }, - { "amount": 40, "type": "imp" } + "message" : 34, + "appearChance" : { "min" : 60, "max" : 90 }, + "guards" : [ + { "amount" : 40, "type" : "imp" }, + { "amount" : 40, "type" : "imp" }, + { "amount" : 40, "type" : "imp", "upgradeChance" : 50 }, + { "amount" : 40, "type" : "imp" }, + { "amount" : 40, "type" : "imp" } ], - "combat_value": 200, - "reward" : { - "value": 4000, - "resources": - { - "mercury" : 4, - "gold" : 2000 - } + "resources" : + { + "mercury" : 4, + "gold" : 2000 } }, { - "chance": 10, - "guards": [ - { "amount": 60, "type": "imp" }, - { "amount": 60, "type": "imp" }, - { "amount": 60, "type": "imp", "upgradeChance": 50 }, - { "amount": 60, "type": "imp" }, - { "amount": 60, "type": "imp" } + "message" : 34, + "appearChance" : { "min" : 90, "max" : 100 }, + "guards" : [ + { "amount" : 60, "type" : "imp" }, + { "amount" : 60, "type" : "imp" }, + { "amount" : 60, "type" : "imp", "upgradeChance" : 50 }, + { "amount" : 60, "type" : "imp" }, + { "amount" : 60, "type" : "imp" } ], - "combat_value": 300, - "reward" : { - "value": 6000, - "resources": - { - "mercury" : 6, - "gold" : 3000 - } + "resources" : + { + "mercury" : 6, + "gold" : 3000 } } ] }, "medusaStore" : { "index" : 4, - "resetDuration" : 0, "name" : "Medusa Stores", "aiValue" : 1500, "sounds" : { @@ -386,88 +350,79 @@ "value" : 1500, "rarity" : 100 }, - "levels": [ + "onGuardedMessage" : 32, + "onVisitedMessage" : 33, + "visitMode" : "once", + "selectMode" : "selectFirst", + "rewards" : [ { - "chance": 30, - "guards": [ - { "amount": 4, "type": "medusa" }, - { "amount": 4, "type": "medusa" }, - { "amount": 4, "type": "medusa", "upgradeChance": 50 }, - { "amount": 4, "type": "medusa" }, - { "amount": 4, "type": "medusa" } + "message" : 34, + "appearChance" : { "min" : 0, "max" : 30 }, + "guards" : [ + { "amount" : 4, "type" : "medusa" }, + { "amount" : 4, "type" : "medusa" }, + { "amount" : 4, "type" : "medusa", "upgradeChance" : 50 }, + { "amount" : 4, "type" : "medusa" }, + { "amount" : 4, "type" : "medusa" } ], - "combat_value": 207, - "reward" : { - "value": 4500, - "resources": - { - "sulfur" : 5, - "gold" : 2000 - } + "resources" : + { + "sulfur" : 5, + "gold" : 2000 } }, { - "chance": 30, - "guards": [ - { "amount": 6, "type": "medusa" }, - { "amount": 6, "type": "medusa" }, - { "amount": 6, "type": "medusa", "upgradeChance": 50 }, - { "amount": 6, "type": "medusa" }, - { "amount": 6, "type": "medusa" } + "message" : 34, + "appearChance" : { "min" : 30, "max" : 60 }, + "guards" : [ + { "amount" : 6, "type" : "medusa" }, + { "amount" : 6, "type" : "medusa" }, + { "amount" : 6, "type" : "medusa", "upgradeChance" : 50 }, + { "amount" : 6, "type" : "medusa" }, + { "amount" : 6, "type" : "medusa" } ], - "combat_value": 310, - "reward" : { - "value": 6000, - "resources": - { - "sulfur" : 6, - "gold" : 3000 - } + "resources" : + { + "sulfur" : 6, + "gold" : 3000 } }, { - "chance": 30, - "guards": [ - { "amount": 8, "type": "medusa" }, - { "amount": 8, "type": "medusa" }, - { "amount": 8, "type": "medusa", "upgradeChance": 50 }, - { "amount": 8, "type": "medusa" }, - { "amount": 8, "type": "medusa" } + "message" : 34, + "appearChance" : { "min" : 60, "max" : 90 }, + "guards" : [ + { "amount" : 8, "type" : "medusa" }, + { "amount" : 8, "type" : "medusa" }, + { "amount" : 8, "type" : "medusa", "upgradeChance" : 50 }, + { "amount" : 8, "type" : "medusa" }, + { "amount" : 8, "type" : "medusa" } ], - "combat_value": 414, - "reward" : { - "value": 8000, - "resources": - { - "sulfur" : 8, - "gold" : 4000 - } + "resources" : + { + "sulfur" : 8, + "gold" : 4000 } }, { - "chance": 10, - "guards": [ - { "amount": 10, "type": "medusa" }, - { "amount": 10, "type": "medusa" }, - { "amount": 10, "type": "medusa", "upgradeChance": 50 }, - { "amount": 10, "type": "medusa" }, - { "amount": 10, "type": "medusa" } + "message" : 34, + "appearChance" : { "min" : 90, "max" : 100 }, + "guards" : [ + { "amount" : 10, "type" : "medusa" }, + { "amount" : 10, "type" : "medusa" }, + { "amount" : 10, "type" : "medusa", "upgradeChance" : 50 }, + { "amount" : 10, "type" : "medusa" }, + { "amount" : 10, "type" : "medusa" } ], - "combat_value": 517, - "reward" : { - "value": 10000, - "resources": - { - "sulfur" : 10, - "gold" : 5000 - } + "resources" : + { + "sulfur" : 10, + "gold" : 5000 } } ] }, "nagaBank" : { "index" : 5, - "resetDuration" : 0, "name" : "Naga Bank", "aiValue" : 3000, "sounds" : { @@ -477,88 +432,79 @@ "value" : 3000, "rarity" : 100 }, - "levels": [ + "onGuardedMessage" : 32, + "onVisitedMessage" : 33, + "visitMode" : "once", + "selectMode" : "selectFirst", + "rewards" : [ { - "chance": 30, - "guards": [ - { "amount": 2, "type": "naga" }, - { "amount": 2, "type": "naga" }, - { "amount": 2, "type": "naga", "upgradeChance": 50 }, - { "amount": 2, "type": "naga" }, - { "amount": 2, "type": "naga" } + "message" : 34, + "appearChance" : { "min" : 0, "max" : 30 }, + "guards" : [ + { "amount" : 2, "type" : "naga" }, + { "amount" : 2, "type" : "naga" }, + { "amount" : 2, "type" : "naga", "upgradeChance" : 50 }, + { "amount" : 2, "type" : "naga" }, + { "amount" : 2, "type" : "naga" } ], - "combat_value": 403, - "reward" : { - "value": 8000, - "resources": - { - "gems" : 8, - "gold" : 4000 - } + "resources" : + { + "gems" : 8, + "gold" : 4000 } }, { - "chance": 30, - "guards": [ - { "amount": 3, "type": "naga" }, - { "amount": 3, "type": "naga" }, - { "amount": 3, "type": "naga", "upgradeChance": 50 }, - { "amount": 3, "type": "naga" }, - { "amount": 3, "type": "naga" } + "message" : 34, + "appearChance" : { "min" : 30, "max" : 60 }, + "guards" : [ + { "amount" : 3, "type" : "naga" }, + { "amount" : 3, "type" : "naga" }, + { "amount" : 3, "type" : "naga", "upgradeChance" : 50 }, + { "amount" : 3, "type" : "naga" }, + { "amount" : 3, "type" : "naga" } ], - "combat_value": 605, - "reward" : { - "value": 12000, - "resources": - { - "gems" : 12, - "gold" : 6000 - } + "resources" : + { + "gems" : 12, + "gold" : 6000 } }, { - "chance": 30, - "guards": [ - { "amount": 4, "type": "naga" }, - { "amount": 4, "type": "naga" }, - { "amount": 4, "type": "naga", "upgradeChance": 50 }, - { "amount": 4, "type": "naga" }, - { "amount": 4, "type": "naga" } + "message" : 34, + "appearChance" : { "min" : 30, "max" : 60 }, + "guards" : [ + { "amount" : 4, "type" : "naga" }, + { "amount" : 4, "type" : "naga" }, + { "amount" : 4, "type" : "naga", "upgradeChance" : 50 }, + { "amount" : 4, "type" : "naga" }, + { "amount" : 4, "type" : "naga" } ], - "combat_value": 806, - "reward" : { - "value": 16000, - "resources": - { - "gems" : 16, - "gold" : 8000 - } + "resources" : + { + "gems" : 16, + "gold" : 8000 } }, { - "chance": 10, - "guards": [ - { "amount": 6, "type": "naga" }, - { "amount": 6, "type": "naga" }, - { "amount": 6, "type": "naga", "upgradeChance": 50 }, - { "amount": 6, "type": "naga" }, - { "amount": 6, "type": "naga" } + "message" : 34, + "appearChance" : { "min" : 90, "max" : 100 }, + "guards" : [ + { "amount" : 6, "type" : "naga" }, + { "amount" : 6, "type" : "naga" }, + { "amount" : 6, "type" : "naga", "upgradeChance" : 50 }, + { "amount" : 6, "type" : "naga" }, + { "amount" : 6, "type" : "naga" } ], - "combat_value": 1210, - "reward" : { - "value": 24000, - "resources": - { - "gems" : 24, - "gold" : 12000 - } + "resources" : + { + "gems" : 24, + "gold" : 12000 } } ] }, "dragonFlyHive" : { "index" : 6, - "resetDuration" : 0, "name" : "Dragon Fly Hive", "aiValue" : 9000, "sounds" : { @@ -568,66 +514,58 @@ "value" : 9000, "rarity" : 100 }, - "levels": [ + "onGuardedMessage" : 32, + "onVisitedMessage" : 33, + "visitMode" : "once", + "selectMode" : "selectFirst", + "rewards" : [ { - "chance": 30, - "guards": [ - { "amount": 6, "type": "fireDragonFly" }, - { "amount": 6, "type": "fireDragonFly" }, - { "amount": 6, "type": "fireDragonFly" }, - { "amount": 6, "type": "fireDragonFly" }, - { "amount": 6, "type": "fireDragonFly" } + "message" : 34, + "appearChance" : { "min" : 0, "max" : 30 }, + "guards" : [ + { "amount" : 6, "type" : "fireDragonFly" }, + { "amount" : 6, "type" : "fireDragonFly" }, + { "amount" : 6, "type" : "fireDragonFly" }, + { "amount" : 6, "type" : "fireDragonFly" }, + { "amount" : 6, "type" : "fireDragonFly" } ], - "combat_value": 154, - "reward" : { - "value": 3200, - "creatures": [ { "amount": 4, "type": "wyvern" } ] - } + "creatures" : [ { "amount" : 4, "type" : "wyvern" } ] }, { - "chance": 30, - "guards": [ - { "amount": 9, "type": "fireDragonFly" }, - { "amount": 9, "type": "fireDragonFly" }, - { "amount": 9, "type": "fireDragonFly" }, - { "amount": 9, "type": "fireDragonFly" }, - { "amount": 9, "type": "fireDragonFly" } + "message" : 34, + "appearChance" : { "min" : 30, "max" : 60 }, + "guards" : [ + { "amount" : 9, "type" : "fireDragonFly" }, + { "amount" : 9, "type" : "fireDragonFly" }, + { "amount" : 9, "type" : "fireDragonFly" }, + { "amount" : 9, "type" : "fireDragonFly" }, + { "amount" : 9, "type" : "fireDragonFly" } ], - "combat_value": 230, - "reward" : { - "value": 4800, - "creatures": [ { "amount": 6, "type": "wyvern" } ] - } + "creatures" : [ { "amount" : 6, "type" : "wyvern" } ] }, { - "chance": 30, - "guards": [ - { "amount": 12, "type": "fireDragonFly" }, - { "amount": 12, "type": "fireDragonFly" }, - { "amount": 12, "type": "fireDragonFly" }, - { "amount": 12, "type": "fireDragonFly" }, - { "amount": 12, "type": "fireDragonFly" } + "message" : 34, + "appearChance" : { "min" : 60, "max" : 90 }, + "guards" : [ + { "amount" : 12, "type" : "fireDragonFly" }, + { "amount" : 12, "type" : "fireDragonFly" }, + { "amount" : 12, "type" : "fireDragonFly" }, + { "amount" : 12, "type" : "fireDragonFly" }, + { "amount" : 12, "type" : "fireDragonFly" } ], - "combat_value": 307, - "reward" : { - "value": 6400, - "creatures": [ { "amount": 8, "type": "wyvern" } ] - } + "creatures" : [ { "amount" : 8, "type" : "wyvern" } ] }, { - "chance": 10, - "guards": [ - { "amount": 18, "type": "fireDragonFly" }, - { "amount": 18, "type": "fireDragonFly" }, - { "amount": 18, "type": "fireDragonFly" }, - { "amount": 18, "type": "fireDragonFly" }, - { "amount": 18, "type": "fireDragonFly" } + "message" : 34, + "appearChance" : { "min" : 90, "max" : 100 }, + "guards" : [ + { "amount" : 18, "type" : "fireDragonFly" }, + { "amount" : 18, "type" : "fireDragonFly" }, + { "amount" : 18, "type" : "fireDragonFly" }, + { "amount" : 18, "type" : "fireDragonFly" }, + { "amount" : 18, "type" : "fireDragonFly" } ], - "combat_value": 461, - "reward" : { - "value": 9600, - "creatures": [ { "amount": 12, "type": "wyvern" } ] - } + "creatures" : [ { "amount" : 12, "type" : "wyvern" } ] } ] } @@ -635,7 +573,7 @@ }, "shipwreck" : { "index" :85, - "handler": "bank", + "handler" : "configurable", "base" : { "sounds" : { "visit" : ["ROGUE"] @@ -644,7 +582,7 @@ "types" : { "shipwreck" : { "index" : 0, - "resetDuration" : 0, + "blockedVisitable" : true, "coastVisitable" : true, "name" : "Shipwreck", @@ -653,80 +591,77 @@ "value" : 2000, "rarity" : 100 }, - "levels": [ + "visitMode" : "once", + "selectMode" : "selectFirst", + "onGuardedMessage" : 122, + "onVisited" : [ { - "chance": 30, - "guards": [ - { "amount": 2, "type": "wight" }, - { "amount": 2, "type": "wight" }, - { "amount": 2, "type": "wight" }, - { "amount": 2, "type": "wight" }, - { "amount": 2, "type": "wight" } + "message" : 123, // Such a despicable act reduces your army's morale. + "bonuses" : [ { "type" : "MORALE", "val" : -1, "duration" : "ONE_BATTLE", "description" : 99 } ] + } + ], + "rewards" : [ + { + "message" : 124, + "appearChance" : { "min" : 0, "max" : 30 }, + "guards" : [ + { "amount" : 2, "type" : "wight" }, + { "amount" : 2, "type" : "wight" }, + { "amount" : 2, "type" : "wight" }, + { "amount" : 2, "type" : "wight" }, + { "amount" : 2, "type" : "wight" } ], - "combat_value": 31, - "reward" : { - "value": 2000, - "resources": - { - "gold" : 2000 - } + "resources" : + { + "gold" : 2000 } }, { - "chance": 30, - "guards": [ - { "amount": 3, "type": "wight" }, - { "amount": 3, "type": "wight" }, - { "amount": 3, "type": "wight" }, - { "amount": 3, "type": "wight" }, - { "amount": 3, "type": "wight" } + "message" : 124, + "appearChance" : { "min" : 30, "max" : 60 }, + "guards" : [ + { "amount" : 3, "type" : "wight" }, + { "amount" : 3, "type" : "wight" }, + { "amount" : 3, "type" : "wight" }, + { "amount" : 3, "type" : "wight" }, + { "amount" : 3, "type" : "wight" } ], - "combat_value": 46, - "reward" : { - "value": 3000, - "resources": - { - "gold" : 3000 - } + "resources" : + { + "gold" : 3000 } }, { - "chance": 30, - "guards": [ - { "amount": 5, "type": "wight" }, - { "amount": 5, "type": "wight" }, - { "amount": 5, "type": "wight" }, - { "amount": 5, "type": "wight" }, - { "amount": 5, "type": "wight" } + "message" : 124, + "appearChance" : { "min" : 60, "max" : 90 }, + "guards" : [ + { "amount" : 5, "type" : "wight" }, + { "amount" : 5, "type" : "wight" }, + { "amount" : 5, "type" : "wight" }, + { "amount" : 5, "type" : "wight" }, + { "amount" : 5, "type" : "wight" } ], - "combat_value": 77, - "reward" : { - "value": 5000, - "resources": - { - "gold" : 4000 - }, - "artifacts": [ { "class" : "TREASURE" } ] - } + "resources" : + { + "gold" : 4000 + }, + "artifacts" : [ { "class" : "TREASURE" } ] }, { - "chance": 10, - "guards": [ - { "amount": 10, "type": "wight" }, - { "amount": 10, "type": "wight" }, - { "amount": 10, "type": "wight" }, - { "amount": 10, "type": "wight" }, - { "amount": 10, "type": "wight" } + "message" : 124, + "appearChance" : { "min" : 90, "max" : 100 }, + "guards" : [ + { "amount" : 10, "type" : "wight" }, + { "amount" : 10, "type" : "wight" }, + { "amount" : 10, "type" : "wight" }, + { "amount" : 10, "type" : "wight" }, + { "amount" : 10, "type" : "wight" } ], - "combat_value": 154, - "reward" : { - "value": 7000, - "resources": - { - "gold" : 5000 - }, - "artifacts": [ { "class" : "MINOR" } ] - } + "resources" : + { + "gold" : 5000 + }, + "artifacts" : [ { "class" : "MINOR" } ] } ] } @@ -734,7 +669,7 @@ }, "derelictShip" : { "index" :24, - "handler": "bank", + "handler" : "configurable", "base" : { "sounds" : { "visit" : ["ROGUE"] @@ -743,7 +678,7 @@ "types" : { "derelictShip" : { "index" : 0, - "resetDuration" : 0, + "blockedVisitable" : true, "name" : "Derelict Ship", "aiValue" : 4000, @@ -751,81 +686,75 @@ "value" : 4000, "rarity" : 20 }, - "levels": [ + "visitMode" : "once", + "selectMode" : "selectFirst", + "onGuardedMessage" : 41, + "onVisited" : [ { - "chance": 30, - "guards": [ - { "amount": 4, "type": "waterElemental" }, - { "amount": 4, "type": "waterElemental" }, - { "amount": 4, "type": "waterElemental" }, - { "amount": 4, "type": "waterElemental" }, - { "amount": 4, "type": "waterElemental" } + "message" : 42, // Such a despicable act reduces your army's morale. + "bonuses" : [ { "type" : "MORALE", "val" : -1, "duration" : "ONE_BATTLE", "description" : 101 } ] + } + ], + "rewards" : [ + { + "message" : 43, + "appearChance" : { "min" : 0, "max" : 30 }, + "guards" : [ + { "amount" : 4, "type" : "waterElemental" }, + { "amount" : 4, "type" : "waterElemental" }, + { "amount" : 4, "type" : "waterElemental" }, + { "amount" : 4, "type" : "waterElemental" }, + { "amount" : 4, "type" : "waterElemental" } ], - "combat_value": 138, - "reward" : { - "value": 3000, - "resources": - { - "gold" : 3000 - } + "resources" : + { + "gold" : 3000 } }, { - "chance": 30, - "guards": [ - { "amount": 6, "type": "waterElemental" }, - { "amount": 6, "type": "waterElemental" }, - { "amount": 6, "type": "waterElemental" }, - { "amount": 6, "type": "waterElemental" }, - { "amount": 6, "type": "waterElemental" } + "message" : 43, + "appearChance" : { "min" : 30, "max" : 60 }, + "guards" : [ + { "amount" : 6, "type" : "waterElemental" }, + { "amount" : 6, "type" : "waterElemental" }, + { "amount" : 6, "type" : "waterElemental" }, + { "amount" : 6, "type" : "waterElemental" }, + { "amount" : 6, "type" : "waterElemental" } ], - "combat_value": 207, - "reward" : { - "value": 4000, - "resources": - { - "gold" : 3000 - }, - "artifacts": [ { "class" : "TREASURE" } ] - } + "resources" : { + "gold" : 3000 + }, + "artifacts" : [ { "class" : "TREASURE" } ] }, { - "chance": 30, - "guards": [ - { "amount": 8, "type": "waterElemental" }, - { "amount": 8, "type": "waterElemental" }, - { "amount": 8, "type": "waterElemental" }, - { "amount": 8, "type": "waterElemental" }, - { "amount": 8, "type": "waterElemental" } + "message" : 43, + "appearChance" : { "min" : 60, "max" : 90 }, + "guards" : [ + { "amount" : 8, "type" : "waterElemental" }, + { "amount" : 8, "type" : "waterElemental" }, + { "amount" : 8, "type" : "waterElemental" }, + { "amount" : 8, "type" : "waterElemental" }, + { "amount" : 8, "type" : "waterElemental" } ], - "combat_value": 276, - "reward" : { - "value": 5000, - "resources": - { - "gold" : 4000 - }, - "artifacts": [ { "class" : "TREASURE" } ] - } + "resources" : { + "gold" : 4000 + }, + "artifacts" : [ { "class" : "TREASURE" } ] }, { - "chance": 10, - "guards": [ - { "amount": 12, "type": "waterElemental" }, - { "amount": 12, "type": "waterElemental" }, - { "amount": 12, "type": "waterElemental" }, - { "amount": 12, "type": "waterElemental" }, - { "amount": 12, "type": "waterElemental" } + "message" : 43, + "appearChance" : { "min" : 90, "max" : 100 }, + "guards" : [ + { "amount" : 12, "type" : "waterElemental" }, + { "amount" : 12, "type" : "waterElemental" }, + { "amount" : 12, "type" : "waterElemental" }, + { "amount" : 12, "type" : "waterElemental" }, + { "amount" : 12, "type" : "waterElemental" } ], - "combat_value": 414, - "reward" : { - "value": 8000, - "resources": - { - "gold" : 6000 - }, - "artifacts": [ { "class" : "MINOR" } ] - } + "resources" : { + "gold" : 6000 + }, + "artifacts" : [ { "class" : "MINOR" } ] } ] } @@ -833,7 +762,7 @@ }, "crypt" : { "index" :84, - "handler": "configurable", + "handler" : "configurable", "base" : { "sounds" : { "ambient" : ["LOOPDEAD"], @@ -860,68 +789,66 @@ "bonuses" : [ { "type" : "MORALE", "val" : -1, "duration" : "ONE_BATTLE" } ] } ], - - "rewards": [ + "rewards" : [ { "appearChance" : { "min" : 0, "max" : 30 }, - "guards": [ - { "amount": 10, "type": "skeleton" }, - { "amount": 10, "type": "walkingDead" }, - { "amount": 10, "type": "walkingDead" }, - { "amount": 10, "type": "skeleton" }, - { "amount": 10, "type": "skeleton" } + "guards" : [ + { "amount" : 10, "type" : "skeleton" }, + { "amount" : 10, "type" : "walkingDead" }, + { "amount" : 10, "type" : "walkingDead" }, + { "amount" : 10, "type" : "skeleton" }, + { "amount" : 10, "type" : "skeleton" } ], "message" : 121, // you search the graves and find something - "resources": + "resources" : { "gold" : 1500 } }, { "appearChance" : { "min" : 30, "max" : 60 }, - "guards": [ - { "amount": 13, "type": "skeleton" }, - { "amount": 10, "type": "walkingDead" }, - { "amount": 5, "type": "wight" }, - { "amount": 10, "type": "walkingDead" }, - { "amount": 12, "type": "skeleton" } + "guards" : [ + { "amount" : 13, "type" : "skeleton" }, + { "amount" : 10, "type" : "walkingDead" }, + { "amount" : 5, "type" : "wight" }, + { "amount" : 10, "type" : "walkingDead" }, + { "amount" : 12, "type" : "skeleton" } ], "message" : 121, // you search the graves and find something - "resources": + "resources" : { "gold" : 2000 } }, { "appearChance" : { "min" : 60, "max" : 90 }, - "guards": [ - { "amount": 20, "type": "skeleton" }, - { "amount": 20, "type": "walkingDead" }, - { "amount": 10, "type": "wight" }, - { "amount": 5, "type": "vampire" } + "guards" : [ + { "amount" : 20, "type" : "skeleton" }, + { "amount" : 20, "type" : "walkingDead" }, + { "amount" : 10, "type" : "wight" }, + { "amount" : 5, "type" : "vampire" } ], "message" : 121, // you search the graves and find something - "resources": + "resources" : { "gold" : 2500 }, - "artifacts": [ { "class" : "TREASURE" } ] - } + "artifacts" : [ { "class" : "TREASURE" } ] }, { "appearChance" : { "min" : 90, "max" : 100 }, - "guards": [ - { "amount": 20, "type": "skeleton" }, - { "amount": 20, "type": "walkingDead" }, - { "amount": 10, "type": "wight" }, - { "amount": 10, "type": "vampire" } + "guards" : [ + { "amount" : 20, "type" : "skeleton" }, + { "amount" : 20, "type" : "walkingDead" }, + { "amount" : 10, "type" : "wight" }, + { "amount" : 10, "type" : "vampire" } ], "message" : 121, // you search the graves and find something - "resources": + "resources" : { "gold" : 5000 }, - "artifacts": [ { "class" : "TREASURE" } ] + "artifacts" : [ { "class" : "TREASURE" } ] } ] } @@ -929,7 +856,7 @@ }, "dragonUtopia" : { "index" :25, - "handler": "bank", + "handler" : "configurable", "base" : { "sounds" : { "ambient" : ["LOOPDRAG"], @@ -939,105 +866,98 @@ "types" : { "dragonUtopia" : { "index" : 0, - "resetDuration" : 0, + "name" : "Dragon Utopia", "aiValue" : 11000, "rmg" : { "value" : 10000, "rarity" : 100 }, - "levels": [ + + "visitMode" : "once", + "selectMode" : "selectFirst", + "onGuardedMessage" : 47, + "onVisitedMessage" : 33, + "rewards" : [ { - "chance": 30, - "guards": [ - { "amount": 8, "type": "greenDragon" }, - { "amount": 5, "type": "redDragon" }, - { "amount": 2, "type": "goldDragon" }, - { "amount": 1, "type": "blackDragon" } + "message" : 34, + "appearChance" : { "min" : 0, "max" : 30 }, + "guards" : [ + { "amount" : 8, "type" : "greenDragon" }, + { "amount" : 5, "type" : "redDragon" }, + { "amount" : 2, "type" : "goldDragon" }, + { "amount" : 1, "type" : "blackDragon" } ], - "combat_value": 769, - "reward" : { - "value": 38000, - "resources": - { - "gold" : 20000 - }, - "artifacts": [ - { "class" : "TREASURE" }, - { "class" : "MINOR" }, - { "class" : "MAJOR" }, - { "class" : "RELIC" } - ] - } + "resources" : + { + "gold" : 20000 + }, + "artifacts" : [ + { "class" : "TREASURE" }, + { "class" : "MINOR" }, + { "class" : "MAJOR" }, + { "class" : "RELIC" } + ] }, { - "chance": 30, - "guards": [ - { "amount": 8, "type": "greenDragon" }, - { "amount": 6, "type": "redDragon" }, - { "amount": 3, "type": "goldDragon" }, - { "amount": 2, "type": "blackDragon" } + "message" : 34, + "appearChance" : { "min" : 30, "max" : 60 }, + "guards" : [ + { "amount" : 8, "type" : "greenDragon" }, + { "amount" : 6, "type" : "redDragon" }, + { "amount" : 3, "type" : "goldDragon" }, + { "amount" : 2, "type" : "blackDragon" } ], - "combat_value": 209, - "reward" : { - "value": 57000, - "resources": - { - "gold" : 30000 - }, - "artifacts": [ - { "class" : "MINOR" }, - { "class" : "MAJOR" }, - { "class" : "RELIC" }, - { "class" : "RELIC" } - ] - } + "resources" : + { + "gold" : 30000 + }, + "artifacts" : [ + { "class" : "MINOR" }, + { "class" : "MAJOR" }, + { "class" : "RELIC" }, + { "class" : "RELIC" } + ] }, { - "chance": 30, - "guards": [ - { "amount": 8, "type": "greenDragon" }, - { "amount": 6, "type": "redDragon" }, - { "amount": 4, "type": "goldDragon" }, - { "amount": 3, "type": "blackDragon" } + "message" : 34, + "appearChance" : { "min" : 60, "max" : 90 }, + "guards" : [ + { "amount" : 8, "type" : "greenDragon" }, + { "amount" : 6, "type" : "redDragon" }, + { "amount" : 4, "type" : "goldDragon" }, + { "amount" : 3, "type" : "blackDragon" } ], - "combat_value": 556, - "reward" : { - "value": 75000, - "resources": - { - "gold" : 40000 - }, - "artifacts": [ - { "class" : "MAJOR" }, - { "class" : "RELIC" }, - { "class" : "RELIC" }, - { "class" : "RELIC" } - ] - } + "resources" : + { + "gold" : 40000 + }, + "artifacts" : [ + { "class" : "MAJOR" }, + { "class" : "RELIC" }, + { "class" : "RELIC" }, + { "class" : "RELIC" } + ] }, { - "chance": 10, - "guards": [ - { "amount": 8, "type": "greenDragon" }, - { "amount": 7, "type": "redDragon" }, - { "amount": 6, "type": "goldDragon" }, - { "amount": 5, "type": "blackDragon" } + "message" : 34, + "appearChance" : { "min" : 90, "max" : 100 }, + "guards" : [ + { "amount" : 8, "type" : "greenDragon" }, + { "amount" : 7, "type" : "redDragon" }, + { "amount" : 6, "type" : "goldDragon" }, + { "amount" : 5, "type" : "blackDragon" } ], - "combat_value": 343, - "reward" : { - "value": 90000, - "resources": - { - "gold" : 50000 - }, - "artifacts": [ - { "class" : "RELIC" }, - { "class" : "RELIC" }, - { "class" : "RELIC" }, - { "class" : "RELIC" } - ] - } + "resources" : + { + "gold" : 50000 + }, + "artifacts" : [ + { "class" : "RELIC" }, + { "class" : "RELIC" }, + { "class" : "RELIC" }, + { "class" : "RELIC" } + ] } ] } @@ -1045,7 +965,7 @@ }, "pyramid" : { "index" :63, - "handler": "bank", + "handler" : "configurable", "base" : { "sounds" : { "visit" : ["MYSTERY"] @@ -1054,26 +974,32 @@ "types" : { "pyramid" : { "index" : 0, - "resetDuration" : 0, + "name" : "Pyramid", "aiValue" : 8000, "rmg" : { "value" : 5000, "rarity" : 20 }, - "levels": [ + + "onGuardedMessage" : 105, + "visitMode" : "once", + "selectMode" : "selectFirst", + "onVisited" : [ { - "chance": 100, - "guards": [ - { "amount": 40, "type": "goldGolem" }, - { "amount": 10, "type": "diamondGolem" }, - { "amount": 10, "type": "diamondGolem" } + "message" : 107, + "bonuses" : [ { "type" : "LUCK", "val" : -2, "duration" : "ONE_BATTLE", "description" : 70 } ] + } + ], + "rewards" : [ + { + "message" : 106, + "guards" : [ + { "amount" : 40, "type" : "goldGolem" }, + { "amount" : 10, "type" : "diamondGolem" }, + { "amount" : 10, "type" : "diamondGolem" } ], - "combat_value": 786, - "reward" : { - "value": 15000, - "spells" : [ { "level" : 5 } ] - } + "spells" : [ { "level" : 5 } ] } ] } diff --git a/config/schemas/rewardable.json b/config/schemas/rewardable.json index bc76b743f..eaa54aff4 100644 --- a/config/schemas/rewardable.json +++ b/config/schemas/rewardable.json @@ -98,6 +98,9 @@ "max" : { "type" : "number", "exclusiveMinimum" : 0, "maximum" : 100 } } }, + + "guards" : {}, //TODO + "limiter" : { "$ref" : "#/definitions/limiter" }, "message" : { "$ref" : "#/definitions/message" }, "description" : { "$ref" : "#/definitions/message" }, @@ -256,6 +259,9 @@ }, }, + "onGuardedMessage" : { + "$ref" : "#/definitions/message" + }, "onSelectMessage" : { "$ref" : "#/definitions/message" }, diff --git a/lib/mapObjectConstructors/CommonConstructors.h b/lib/mapObjectConstructors/CommonConstructors.h index 2b16f3112..d7ce61f5e 100644 --- a/lib/mapObjectConstructors/CommonConstructors.h +++ b/lib/mapObjectConstructors/CommonConstructors.h @@ -26,7 +26,6 @@ class CGHeroInstance; class CGMarket; class CHeroClass; class CGCreature; -class CBank; class CGBoat; class CFaction; class CStackBasicDescriptor; diff --git a/lib/mapObjects/CBank.cpp b/lib/mapObjects/CBank.cpp index 8ec1baa9c..d0f371195 100644 --- a/lib/mapObjects/CBank.cpp +++ b/lib/mapObjects/CBank.cpp @@ -140,119 +140,28 @@ void CBank::onHeroVisit(const CGHeroInstance * h) const ChangeObjectVisitors cov(ChangeObjectVisitors::VISITOR_ADD_PLAYER, id, h->id); cb->sendAndApply(&cov); - if(!bankConfig && (ID.toEnum() == Obj::CREATURE_BANK || ID.toEnum() == Obj::DRAGON_UTOPIA)) - { - blockingDialogAnswered(h, 1); - return; - } - - int banktext = 0; - switch (ID.toEnum()) - { - case Obj::DERELICT_SHIP: - banktext = 41; - break; - case Obj::DRAGON_UTOPIA: - banktext = 47; - break; - case Obj::SHIPWRECK: - banktext = 122; - break; - case Obj::PYRAMID: - banktext = 105; - break; - default: - banktext = 32; - break; - } BlockingDialog bd(true, false); bd.player = h->getOwner(); - bd.text.appendLocalString(EMetaText::ADVOB_TXT, banktext); + bd.text.appendLocalString(EMetaText::ADVOB_TXT, 32); bd.components = getPopupComponents(h->getOwner()); - if (banktext == 32) - bd.text.replaceRawString(getObjectName()); - + bd.text.replaceRawString(getObjectName()); cb->showBlockingDialog(this, &bd); } void CBank::doVisit(const CGHeroInstance * hero) const { - int textID = -1; InfoWindow iw; iw.type = EInfoWindowMode::AUTO; iw.player = hero->getOwner(); MetaString loot; - if (bankConfig) + if (!bankConfig) { - switch (ID.toEnum()) - { - case Obj::DERELICT_SHIP: - textID = 43; - break; - case Obj::SHIPWRECK: - textID = 124; - break; - case Obj::PYRAMID: - textID = 106; - break; - default: - textID = 34; - break; - } - } - else - { - switch (ID.toEnum()) - { - case Obj::SHIPWRECK: - case Obj::DERELICT_SHIP: - { - GiveBonus gbonus; - gbonus.id = hero->id; - gbonus.bonus.duration = BonusDuration::ONE_BATTLE; - gbonus.bonus.source = BonusSource::OBJECT_TYPE; - gbonus.bonus.sid = BonusSourceID(ID); - gbonus.bonus.type = BonusType::MORALE; - gbonus.bonus.val = -1; - switch (ID.toEnum()) - { - case Obj::SHIPWRECK: - textID = 123; - gbonus.bonus.description = MetaString::createFromTextID("core.arraytxt.99"); - break; - case Obj::DERELICT_SHIP: - textID = 42; - gbonus.bonus.description = MetaString::createFromTextID("core.arraytxt.101"); - break; - } - cb->giveHeroBonus(&gbonus); - iw.components.emplace_back(ComponentType::MORALE, -1); - break; - } - case Obj::PYRAMID: - { - GiveBonus gb; - gb.bonus = Bonus(BonusDuration::ONE_BATTLE, BonusType::LUCK, BonusSource::OBJECT_INSTANCE, -2, BonusSourceID(id)); - gb.bonus.description = MetaString::createFromTextID("core.arraytxt.70"); - gb.id = hero->id; - cb->giveHeroBonus(&gb); - textID = 107; - iw.components.emplace_back(ComponentType::LUCK, -2); - break; - } - default: - iw.text.appendRawString(VLC->generaltexth->advobtxt[33]);// This was X, now is completely empty - iw.text.replaceRawString(getObjectName()); - } - if(textID != -1) - { - iw.text.appendLocalString(EMetaText::ADVOB_TXT, textID); - } + iw.text.appendRawString(VLC->generaltexth->advobtxt[33]);// This was X, now is completely empty + iw.text.replaceRawString(getObjectName()); cb->showInfoDialog(&iw); } - //grant resources if (bankConfig) { @@ -278,17 +187,15 @@ void CBank::doVisit(const CGHeroInstance * hero) const //display loot if (!iw.components.empty()) { - iw.text.appendLocalString(EMetaText::ADVOB_TXT, textID); - if (textID == 34) + iw.text.appendLocalString(EMetaText::ADVOB_TXT, 34); + const auto * strongest = boost::range::max_element(bankConfig->guards, [](const CStackBasicDescriptor & a, const CStackBasicDescriptor & b) { - const auto * strongest = boost::range::max_element(bankConfig->guards, [](const CStackBasicDescriptor & a, const CStackBasicDescriptor & b) - { - return a.type->getFightValue() < b.type->getFightValue(); - })->type; + return a.type->getFightValue() < b.type->getFightValue(); + })->type; + + iw.text.replaceNamePlural(strongest->getId()); + iw.text.replaceRawString(loot.buildList()); - iw.text.replaceNamePlural(strongest->getId()); - iw.text.replaceRawString(loot.buildList()); - } cb->showInfoDialog(&iw); } @@ -301,10 +208,7 @@ void CBank::doVisit(const CGHeroInstance * hero) const std::set spells; bool noWisdom = false; - if(textID == 106) - { - iw.text.appendLocalString(EMetaText::ADVOB_TXT, textID); //pyramid - } + for(const SpellID & spellId : bankConfig->spells) { const auto * spell = spellId.toEntity(VLC); diff --git a/lib/mapObjects/CRewardableObject.h b/lib/mapObjects/CRewardableObject.h index 7aed36cce..99bbef46d 100644 --- a/lib/mapObjects/CRewardableObject.h +++ b/lib/mapObjects/CRewardableObject.h @@ -100,13 +100,6 @@ public: }; //TODO: - -// MAX -// class DLL_LINKAGE CBank : public CArmedInstance -// class DLL_LINKAGE CGPyramid : public CBank - -// EXTRA -// class DLL_LINKAGE CTownBonus : public CGTownBuilding // class DLL_LINKAGE CGKeys : public CGObjectInstance //Base class for Keymaster and guards // class DLL_LINKAGE CGKeymasterTent : public CGKeys // class DLL_LINKAGE CGBorderGuard : public CGKeys, public IQuestObject diff --git a/lib/mapObjects/MapObjects.h b/lib/mapObjects/MapObjects.h index 01e38b4d8..7a54592ae 100644 --- a/lib/mapObjects/MapObjects.h +++ b/lib/mapObjects/MapObjects.h @@ -14,7 +14,6 @@ #include "CObjectHandler.h" #include "CArmedInstance.h" -#include "CBank.h" #include "CGDwelling.h" #include "CGHeroInstance.h" #include "CGMarket.h" diff --git a/lib/mapping/MapFormatH3M.cpp b/lib/mapping/MapFormatH3M.cpp index 543711e1b..32e0057ac 100644 --- a/lib/mapping/MapFormatH3M.cpp +++ b/lib/mapping/MapFormatH3M.cpp @@ -1459,7 +1459,7 @@ CGObjectInstance * CMapLoaderH3M::readGeneric(const int3 & mapPosition, std::sha CGObjectInstance * CMapLoaderH3M::readPyramid(const int3 & mapPosition, std::shared_ptr objectTemplate) { if(objectTemplate->subid == 0) - return new CBank(map->cb); + return readGeneric(mapPosition, objectTemplate); return new CGObjectInstance(map->cb); }