From f8f6df02f399fd6c8e0689d79a75fa4869d69ac0 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Mon, 23 Jan 2023 15:27:01 +0200 Subject: [PATCH] Removed remaining hardcoded objects --- AI/Nullkiller/AIUtility.cpp | 5 +- AI/Nullkiller/Engine/AIMemory.cpp | 3 - AI/VCAI/VCAI.cpp | 14 +- config/gameConfig.json | 2 +- config/objects/generic.json | 22 --- config/objects/rewardable.json | 87 ----------- config/objects/rewardableOncePerHero.json | 38 ++++- config/objects/rewardableOncePerWeek.json | 176 ++++++++++++++++++++++ lib/mapObjects/CObjectClassesHandler.cpp | 4 - lib/mapObjects/CRewardableObject.cpp | 162 ++------------------ lib/mapObjects/CRewardableObject.h | 50 +----- lib/mapObjects/MiscObjects.cpp | 26 ---- lib/mapObjects/MiscObjects.h | 12 -- lib/registerTypes/RegisterTypes.h | 8 - 14 files changed, 228 insertions(+), 381 deletions(-) delete mode 100644 config/objects/rewardable.json create mode 100644 config/objects/rewardableOncePerWeek.json diff --git a/AI/Nullkiller/AIUtility.cpp b/AI/Nullkiller/AIUtility.cpp index 86d25e84d..fa62afa19 100644 --- a/AI/Nullkiller/AIUtility.cpp +++ b/AI/Nullkiller/AIUtility.cpp @@ -314,8 +314,9 @@ bool isWeeklyRevisitable(const CGObjectInstance * obj) return false; //TODO: allow polling of remaining creatures in dwelling - if(dynamic_cast(obj)) // ensures future compatibility, unlike IDs - return true; + if(const auto * rewardable = dynamic_cast(obj)) + return rewardable->getResetDuration() == 7; + if(dynamic_cast(obj)) return true; if(dynamic_cast(obj)) //banks tend to respawn often in mods diff --git a/AI/Nullkiller/Engine/AIMemory.cpp b/AI/Nullkiller/Engine/AIMemory.cpp index 7cab8641b..1091f9664 100644 --- a/AI/Nullkiller/Engine/AIMemory.cpp +++ b/AI/Nullkiller/Engine/AIMemory.cpp @@ -79,9 +79,6 @@ void AIMemory::markObjectVisited(const CGObjectInstance * obj) return; } - if(dynamic_cast(obj)) //we may want to visit it with another hero - return; - if(obj->ID == Obj::MONSTER) return; diff --git a/AI/VCAI/VCAI.cpp b/AI/VCAI/VCAI.cpp index 6d25abbc2..ab669343a 100644 --- a/AI/VCAI/VCAI.cpp +++ b/AI/VCAI/VCAI.cpp @@ -29,12 +29,6 @@ extern FuzzyHelper * fh; -VCMI_LIB_NAMESPACE_BEGIN - -class CGVisitableOPW; - -VCMI_LIB_NAMESPACE_END - const double SAFE_ATTACK_CONSTANT = 1.5; //one thread may be turn of AI and another will be handling a side effect for AI2 @@ -1616,9 +1610,6 @@ void VCAI::markObjectVisited(const CGObjectInstance * obj) return; } - if(dynamic_cast(obj)) //we may want to visit it with another hero - return; - if(obj->ID == Obj::MONSTER) return; @@ -2752,8 +2743,9 @@ bool AIStatus::channelProbing() bool isWeeklyRevisitable(const CGObjectInstance * obj) { //TODO: allow polling of remaining creatures in dwelling - if(dynamic_cast(obj)) // ensures future compatibility, unlike IDs - return true; + if(const auto * rewardable = dynamic_cast(obj)) + return rewardable->getResetDuration() == 7; + if(dynamic_cast(obj)) return true; if(dynamic_cast(obj)) //banks tend to respawn often in mods diff --git a/config/gameConfig.json b/config/gameConfig.json index 9eb5678bc..0f27f57ac 100644 --- a/config/gameConfig.json +++ b/config/gameConfig.json @@ -51,7 +51,7 @@ "config/objects/moddables.json", "config/objects/creatureBanks.json", "config/objects/dwellings.json", - "config/objects/rewardable.json", + "config/objects/rewardableOncePerWeek.json", "config/objects/rewardablePickable.json", "config/objects/rewardableOnceVisitable.json", "config/objects/rewardableOncePerHero.json", diff --git a/config/objects/generic.json b/config/objects/generic.json index 12ec81e17..99c7838b0 100644 --- a/config/objects/generic.json +++ b/config/objects/generic.json @@ -597,28 +597,6 @@ } } }, - "magicWell" : { - "index" :49, - "handler" : "magicWell", - "base" : { - "sounds" : { - "visit" : ["FAERIE"] - } - }, - "types" : { - "object" : { - "index" : 0, - "aiValue" : 250, - "rmg" : { - "zoneLimit" : 1, - "value" : 250, - "rarity" : 100 - } - }, - "objectWoG" : { "index" : 1} // WoG object? Present on VCMI_Test 2011b - } - }, - /// Random objects "randomTown" : { "index" :77, "handler": "randomTown", "types" : { "object" : { "index" : 0} } }, "randomHero" : { diff --git a/config/objects/rewardable.json b/config/objects/rewardable.json deleted file mode 100644 index d9bbc8c97..000000000 --- a/config/objects/rewardable.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - /// These are objects that covered by concept of "configurable object" - /// Most or even all of their configuration located in this file - "magicSpring" : {//magic source - "index" : 48, - "handler": "magicSpring", - "base" : { - "sounds" : { - "ambient" : ["LOOPFOUN"], - "visit" : ["FAERIE"] - } - }, - "types" : { - "object" : { - "index" : 0, - "aiValue" : 500//, - //"rmg" : { - // "zoneLimit" : 1, - // "value" : 500, - // "rarity" : 50 - //} - //banned due to problems with 2 viistable offsets - } - } - }, - - "mysticalGarden" : { - "index" : 55, - "handler": "oncePerWeek", - "base" : { - "sounds" : { - "ambient" : ["LOOPLEPR"], - "visit" : ["EXPERNCE"] - } - }, - "types" : { - "object" : { - "index" : 0, - "aiValue" : 500, - "rmg" : { - "value" : 500, - "rarity" : 50 - } - } - } - }, - "windmill" :{ - "index" : 112, - "handler": "oncePerWeek", - "base" : { - "sounds" : { - "ambient" : ["LOOPWIND"], - "visit" : ["GENIE"] - } - }, - "types" : { - "object" : { - "index" : 0, - "aiValue" : 1500, - "rmg" : { - "value" : 1500, - "rarity" : 80 - } - } - } - }, - "waterWheel" : { - "index" : 109, - "handler": "oncePerWeek", - "base" : { - "sounds" : { - "ambient" : ["LOOPMILL"], - "visit" : ["GENIE"] - } - }, - "types" : { - "object" : { - "index" : 0, - "aiValue" : 750, - "rmg" : { - "value" : 750, - "rarity" : 50 - } - } - } - } -} diff --git a/config/objects/rewardableOncePerHero.json b/config/objects/rewardableOncePerHero.json index 7e94fa450..ce395d7e5 100644 --- a/config/objects/rewardableOncePerHero.json +++ b/config/objects/rewardableOncePerHero.json @@ -54,7 +54,7 @@ "onVisitedMessage" : 40, "visitMode" : "hero", - "selectMode" : "selectPlayer", + "selectMode" : "selectFirst", "rewards" : [ { "message" : 39, @@ -84,7 +84,7 @@ "onVisitedMessage" : 60, "visitMode" : "hero", - "selectMode" : "selectPlayer", + "selectMode" : "selectFirst", "rewards" : [ { "message" : 59, @@ -191,7 +191,7 @@ "onVisitedMessage" : 81, "visitMode" : "hero", - "selectMode" : "selectPlayer", + "selectMode" : "selectFirst", "rewards" : [ { "message" : 80, @@ -221,7 +221,7 @@ "onVisitedMessage" : 101, "visitMode" : "hero", - "selectMode" : "selectPlayer", + "selectMode" : "selectFirst", "rewards" : [ { "message" : 100, @@ -233,7 +233,7 @@ }, "treeOfKnowledge" : { "index" : 102, - "handler": "oncePerHero", //TODO: configurable + "handler": "configurable", "base" : { "sounds" : { "visit" : ["GAZEBO"] @@ -247,7 +247,33 @@ "mapLimit" : 100, "value" : 2500, "rarity" : 50 - } + }, + + "onEmptyMessage" : 150, //TODO: ID 150 should be used for Gold version, ID 152 - for Gems version + "visitMode" : "hero", + "selectMode" : "selectFirst", + "canRefuse" : true, + "rewards" : [ + { + "message" : 148, + "appearChance" : { "max" : 34 }, + "gainedLevels" : 1 + }, + { + "message" : 149, + "appearChance" : { "min" : 34, "max" : 67 }, + "limiter" : { "resources" : { "gold" : 2000 } }, + "resources" : { "gold" : -2000 }, + "gainedLevels" : 1 + }, + { + "message" : 151, + "appearChance" : { "min" : 67 }, + "limiter" : { "resources" : { "gems" : 10 } }, + "resources" : { "gems" : -10 }, + "gainedLevels" : 1 + }, + ] } } }, diff --git a/config/objects/rewardableOncePerWeek.json b/config/objects/rewardableOncePerWeek.json new file mode 100644 index 000000000..ee4fd7eb1 --- /dev/null +++ b/config/objects/rewardableOncePerWeek.json @@ -0,0 +1,176 @@ +{ + /// These are objects that covered by concept of "configurable object" and have their entire configuration in this config + + "magicWell" : { + "index" :49, + "handler" : "configurable", + "base" : { + "sounds" : { + "visit" : ["FAERIE"] + } + }, + "types" : { + "magicWell" : { + "index" : 0, + "aiValue" : 250, + "rmg" : { + "zoneLimit" : 1, + "value" : 250, + "rarity" : 100 + }, + + "onEmptyMessage" : 79, + "onVisitedMessage" : 78, + "resetDuration" : 1, + "visitMode" : "once", + "selectMode" : "selectFirst", + "rewards" : [ + { + // TODO: limiter "below mana maximum" + "message" : 77, + "manaPercentage" : 100 + } + ] + }, + } + }, + "magicSpring" : { + "index" : 48, + "handler": "configurable", + "base" : { + "sounds" : { + "ambient" : ["LOOPFOUN"], + "visit" : ["FAERIE"] + } + }, + "types" : { + "magicSpring" : { + "index" : 0, + "aiValue" : 500, + //banned due to problems with 2 viistable offsets + //"rmg" : { + // "zoneLimit" : 1, + // "value" : 500, + // "rarity" : 50 + //}, + + "onEmptyMessage" : 75, + "resetDuration" : 7, + "visitMode" : "once", + "selectMode" : "selectFirst", + "rewards" : [ + { + // TODO: limiter "below mana maximum" + "message" : 74, + "manaPercentage" : 200 + } + ] + } + } + }, + "mysticalGarden" : { + "index" : 55, + "handler": "configurable", + "base" : { + "sounds" : { + "ambient" : ["LOOPLEPR"], + "visit" : ["EXPERNCE"] + } + }, + "types" : { + "mysticalGarden" : { + "index" : 0, + "aiValue" : 500, + "rmg" : { + "value" : 500, + "rarity" : 50 + }, + + "onEmptyMessage" : 93, + "resetDuration" : 7, + "visitMode" : "once", + "selectMode" : "selectFirst", + "rewards" : [ + { + "message" : 92, + "appearChance" : { "max" : 50 }, + "resources" : { "gems" : 5 } + }, + { + "message" : 92, + "appearChance" : { "min" : 50 }, + "resources" : { "gold" : 500 } + } + ] + } + } + }, + "windmill" :{ + "index" : 112, + "handler": "configurable", + "base" : { + "sounds" : { + "ambient" : ["LOOPWIND"], + "visit" : ["GENIE"] + } + }, + "types" : { + "windmill" : { + "index" : 0, + "aiValue" : 1500, + "rmg" : { + "value" : 1500, + "rarity" : 80 + }, + + "onEmptyMessage" : 169, + "resetDuration" : 7, + "visitMode" : "once", + "selectMode" : "selectFirst", + "rewards" : [ + { + "message" : 170, + "resources" : [ + { + "list" : [ "ore", "mercury", "gems", "sulfur", "crystal" ], + "min" : 3, + "max" : 6 + } + ] + } + ] + } + } + }, + "waterWheel" : { + "index" : 109, + "handler": "configurable", + "base" : { + "sounds" : { + "ambient" : ["LOOPMILL"], + "visit" : ["GENIE"] + } + }, + "types" : { + "waterWheel" : { + "index" : 0, + "aiValue" : 750, + "rmg" : { + "value" : 750, + "rarity" : 50 + }, + + "onEmptyMessage" : 165, + "resetDuration" : 7, + "visitMode" : "once", + "selectMode" : "selectFirst", + "rewards" : [ + { + "message" : 164, + "resources" : { "gold" : 1000 } + } + ] + } + } + } +} diff --git a/lib/mapObjects/CObjectClassesHandler.cpp b/lib/mapObjects/CObjectClassesHandler.cpp index 93fa6f823..bcb8bd1a4 100644 --- a/lib/mapObjects/CObjectClassesHandler.cpp +++ b/lib/mapObjects/CObjectClassesHandler.cpp @@ -64,8 +64,6 @@ CObjectClassesHandler::CObjectClassesHandler() SET_HANDLER("keymaster", CGKeymasterTent); SET_HANDLER("lighthouse", CGLighthouse); SET_HANDLER("magi", CGMagi); - SET_HANDLER("magicSpring", CGMagicSpring); - SET_HANDLER("magicWell", CGMagicWell); SET_HANDLER("market", CGMarket); SET_HANDLER("mine", CGMine); SET_HANDLER("obelisk", CGObelisk); @@ -84,8 +82,6 @@ CObjectClassesHandler::CObjectClassesHandler() SET_HANDLER("subterraneanGate", CGSubterraneanGate); SET_HANDLER("whirlpool", CGWhirlpool); SET_HANDLER("university", CGUniversity); - SET_HANDLER("oncePerHero", CGVisitableOPH); - SET_HANDLER("oncePerWeek", CGVisitableOPW); SET_HANDLER("witch", CGWitchHut); SET_HANDLER("terrain", CGTerrainPatch); diff --git a/lib/mapObjects/CRewardableObject.cpp b/lib/mapObjects/CRewardableObject.cpp index 239515af0..d929fd29f 100644 --- a/lib/mapObjects/CRewardableObject.cpp +++ b/lib/mapObjects/CRewardableObject.cpp @@ -111,11 +111,11 @@ void CRewardableObject::onHeroVisit(const CGHeroInstance *h) const // grant reward afterwards. Note that it may remove object grantReward(index, h); }; - auto selectRewardsMessage = [&](std::vector rewards) -> void + auto selectRewardsMessage = [&](std::vector rewards, const MetaString & dialog) -> void { BlockingDialog sd(canRefuse, rewards.size() > 1); sd.player = h->tempOwner; - sd.text = onSelect; + sd.text = dialog; for (auto index : rewards) sd.components.push_back(getVisitInfo(index, h).reward.getDisplayedComponent(h)); cb->showBlockingDialog(&sd); @@ -148,7 +148,7 @@ void CRewardableObject::onHeroVisit(const CGHeroInstance *h) const case 1: // one reward. Just give it with message { if (canRefuse) - selectRewardsMessage(rewards); + selectRewardsMessage(rewards, getVisitInfo(rewards[0], h).message); else grantRewardWithMessage(rewards[0]); break; @@ -157,7 +157,7 @@ void CRewardableObject::onHeroVisit(const CGHeroInstance *h) const { switch (selectMode) { case SELECT_PLAYER: // player must select - selectRewardsMessage(rewards); + selectRewardsMessage(rewards, onSelect); break; case SELECT_FIRST: // give first available grantRewardWithMessage(rewards[0]); @@ -269,7 +269,7 @@ void CRewardableObject::grantRewardAfterLevelup(const CVisitInfo & info, const C if (info.reward.manaPercentage >= 0) manaScaled = hero->manaLimit() * info.reward.manaPercentage / 100; - si32 manaMissing = hero->manaLimit() - manaScaled; + si32 manaMissing = std::max(0, hero->manaLimit() - manaScaled); si32 manaGranted = std::min(manaMissing, info.reward.manaDiff); si32 manaOverflow = info.reward.manaDiff - manaGranted; si32 manaOverLimit = manaOverflow * info.reward.manaOverflowFactor / 100; @@ -364,6 +364,11 @@ CRewardableObject::EVisitMode CRewardableObject::getVisitMode() const return EVisitMode(visitMode); } +ui16 CRewardableObject::getResetDuration() const +{ + return resetDuration; +} + void CRewardInfo::loadComponents(std::vector & comps, const CGHeroInstance * h) const { @@ -473,150 +478,7 @@ CRewardableObject::CRewardableObject(): {} /////////////////////////////////////////////////////////////////////////////////////////////////// - -CGVisitableOPH::CGVisitableOPH() -{ - visitMode = VISIT_HERO; - selectMode = SELECT_PLAYER; -} - -void CGVisitableOPH::initObj(CRandomGenerator & rand) -{ - switch(ID) - { - case Obj::TREE_OF_KNOWLEDGE: - info.resize(1); - canRefuse = true; - info[0].reward.gainedLevels = 1; - onVisited.addTxt(MetaString::ADVOB_TXT, 147); - info.resize(1); - switch (rand.nextInt(2)) - { - case 0: // free - onSelect.addTxt(MetaString::ADVOB_TXT, 148); - break; - case 1: - info[0].limiter.resources[Res::GOLD] = 2000; - info[0].reward.resources[Res::GOLD] = -2000; - onSelect.addTxt(MetaString::ADVOB_TXT, 149); - onEmpty.addTxt(MetaString::ADVOB_TXT, 150); - break; - case 2: - info[0].limiter.resources[Res::GEMS] = 10; - info[0].reward.resources[Res::GEMS] = -10; - onSelect.addTxt(MetaString::ADVOB_TXT, 151); - onEmpty.addTxt(MetaString::ADVOB_TXT, 152); - break; - } - break; - } -} - -/////////////////////////////////////////////////////////////////////////////////////////////////// - -CGVisitableOPW::CGVisitableOPW() -{ - visitMode = VISIT_ONCE; - resetDuration = 7; -} - -void CGVisitableOPW::triggerRewardReset() const -{ - CRewardableObject::triggerRewardReset(); - - ChangeObjectVisitors cov(ChangeObjectVisitors::VISITOR_CLEAR, id); - cb->sendAndApply(&cov); -} - -void CGVisitableOPW::initObj(CRandomGenerator & rand) -{ - setRandomReward(rand); - - switch (ID) - { - case Obj::MYSTICAL_GARDEN: - onEmpty.addTxt(MetaString::ADVOB_TXT, 93); - info[0].message.addTxt(MetaString::ADVOB_TXT, 92); - break; - case Obj::WINDMILL: - onEmpty.addTxt(MetaString::ADVOB_TXT, 169); - info[0].message.addTxt(MetaString::ADVOB_TXT, 170); - break; - case Obj::WATER_WHEEL: - onEmpty.addTxt(MetaString::ADVOB_TXT, 165); - info[0].message.addTxt(MetaString::ADVOB_TXT, 164); - break; - } -} - -void CGVisitableOPW::setPropertyDer(ui8 what, ui32 val) -{ - if(what == ObjProperty::REWARD_RESET) - { - setRandomReward(cb->gameState()->getRandomGenerator()); - - if (ID == Obj::WATER_WHEEL) - { - auto& reward = info[0].reward.resources[Res::GOLD]; - if(cb->getDate() > 7) - { - reward = 1000; - } - else - { - reward = 500; - } - } - } - - CRewardableObject::setPropertyDer(what, val); -} - -void CGVisitableOPW::setRandomReward(CRandomGenerator &rand) -{ - switch (ID) - { - case Obj::MYSTICAL_GARDEN: - info.resize(1); - info[0].limiter.numOfGrants = 1; - info[0].reward.resources.amin(0); - if (rand.nextInt(1) == 0) - { - info[0].reward.resources[Res::GEMS] = 5; - } - else - { - info[0].reward.resources[Res::GOLD] = 500; - } - break; - case Obj::WINDMILL: - info.resize(1); - info[0].reward.resources.amin(0); - // 3-6 of any resource but wood and gold - info[0].reward.resources[rand.nextInt(Res::MERCURY, Res::GEMS)] = rand.nextInt(3, 6); - info[0].limiter.numOfGrants = 1; - break; - case Obj::WATER_WHEEL: - info.resize(1); - info[0].reward.resources.amin(0); - info[0].reward.resources[Res::GOLD] = 500; - info[0].limiter.numOfGrants = 1; - break; - } -} - -/////////////////////////////////////////////////////////////////////////////////////////////////// - -void CGMagicSpring::initObj(CRandomGenerator & rand) -{ - CVisitInfo visit; // TODO: "player above max mana" limiter. Use logical expressions for limiters? - visit.reward.manaPercentage = 200; - visit.message.addTxt(MetaString::ADVOB_TXT, 74); - info.push_back(visit); // two rewards, one for each entrance - info.push_back(visit); - onEmpty.addTxt(MetaString::ADVOB_TXT, 75); -} - +/* std::vector CGMagicSpring::getVisitableOffsets() const { std::vector visitableTiles; @@ -660,5 +522,5 @@ std::vector CGMagicSpring::getAvailableRewards(const CGHeroInstance * hero // hero is either not on visitable tile (should not happen) or tile is already used return std::vector(); } - +*/ VCMI_LIB_NAMESPACE_END diff --git a/lib/mapObjects/CRewardableObject.h b/lib/mapObjects/CRewardableObject.h index 8fe76e131..c45be93d9 100644 --- a/lib/mapObjects/CRewardableObject.h +++ b/lib/mapObjects/CRewardableObject.h @@ -249,6 +249,7 @@ protected: public: EVisitMode getVisitMode() const; + ui16 getResetDuration() const; void setPropertyDer(ui8 what, ui32 val) override; std::string getHoverText(PlayerColor player) const override; @@ -295,55 +296,6 @@ public: friend class CRandomRewardObjectInfo; }; -class DLL_LINKAGE CGVisitableOPH : public CRewardableObject //objects visitable only once per hero -{ -public: - void initObj(CRandomGenerator & rand) override; - - CGVisitableOPH(); - - template void serialize(Handler &h, const int version) - { - h & static_cast(*this); - } -}; - -class DLL_LINKAGE CGVisitableOPW : public CRewardableObject //objects visitable once per week -{ -protected: - void triggerRewardReset() const override; - -public: - void initObj(CRandomGenerator & rand) override; - - CGVisitableOPW(); - - void setPropertyDer(ui8 what, ui32 val) override; - void setRandomReward(CRandomGenerator & rand); - - template void serialize(Handler &h, const int version) - { - h & static_cast(*this); - } -}; - -///Special case - magic spring that has two separate visitable entrances -class DLL_LINKAGE CGMagicSpring : public CGVisitableOPW -{ -protected: - std::vector getAvailableRewards(const CGHeroInstance * hero) const override; - -public: - void initObj(CRandomGenerator & rand) override; - std::vector getVisitableOffsets() const; - int3 getVisitableOffset() const override; - - template void serialize(Handler &h, const int version) - { - h & static_cast(*this); - } -}; - //TODO: // MAX diff --git a/lib/mapObjects/MiscObjects.cpp b/lib/mapObjects/MiscObjects.cpp index 85f568957..4f3fa8699 100644 --- a/lib/mapObjects/MiscObjects.cpp +++ b/lib/mapObjects/MiscObjects.cpp @@ -1527,32 +1527,6 @@ void CGWitchHut::serializeJsonOptions(JsonSerializeFormat & handler) } } -void CGMagicWell::onHeroVisit( const CGHeroInstance * h ) const -{ - int message; - - if(h->hasBonusFrom(Bonus::OBJECT,ID)) //has already visited Well today - { - message = 78;//"A second drink at the well in one day will not help you." - } - else if(h->mana < h->manaLimit()) - { - giveDummyBonus(h->id); - cb->setManaPoints(h->id,h->manaLimit()); - message = 77; - } - else - { - message = 79; - } - showInfoDialog(h, message); -} - -std::string CGMagicWell::getHoverText(const CGHeroInstance * hero) const -{ - return getObjectName() + " " + visitedTxt(hero->hasBonusFrom(Bonus::OBJECT,ID)); -} - void CGObservatory::onHeroVisit( const CGHeroInstance * h ) const { InfoWindow iw; diff --git a/lib/mapObjects/MiscObjects.h b/lib/mapObjects/MiscObjects.h index 71491d768..696b5d6aa 100644 --- a/lib/mapObjects/MiscObjects.h +++ b/lib/mapObjects/MiscObjects.h @@ -391,18 +391,6 @@ public: } }; -class DLL_LINKAGE CGMagicWell : public CGObjectInstance //objects giving bonuses to luck/morale/movement -{ -public: - void onHeroVisit(const CGHeroInstance * h) const override; - std::string getHoverText(const CGHeroInstance * hero) const override; - - template void serialize(Handler &h, const int version) - { - h & static_cast(*this); - } -}; - class DLL_LINKAGE CGSirens : public CGObjectInstance { public: diff --git a/lib/registerTypes/RegisterTypes.h b/lib/registerTypes/RegisterTypes.h index 4acd27a62..cb543bd4c 100644 --- a/lib/registerTypes/RegisterTypes.h +++ b/lib/registerTypes/RegisterTypes.h @@ -45,7 +45,6 @@ void registerTypesMapObjects1(Serializer &s) s.template registerType(); s.template registerType(); s.template registerType(); - s.template registerType(); s.template registerType(); s.template registerType(); s.template registerType(); @@ -112,8 +111,6 @@ void registerTypesMapObjectTypes(Serializer &s) REGISTER_GENERIC_HANDLER(CGLighthouse); REGISTER_GENERIC_HANDLER(CGTerrainPatch); REGISTER_GENERIC_HANDLER(CGMagi); - REGISTER_GENERIC_HANDLER(CGMagicSpring); - REGISTER_GENERIC_HANDLER(CGMagicWell); REGISTER_GENERIC_HANDLER(CGMarket); REGISTER_GENERIC_HANDLER(CGMine); REGISTER_GENERIC_HANDLER(CGObelisk); @@ -132,8 +129,6 @@ void registerTypesMapObjectTypes(Serializer &s) REGISTER_GENERIC_HANDLER(CGWhirlpool); REGISTER_GENERIC_HANDLER(CGTownInstance); REGISTER_GENERIC_HANDLER(CGUniversity); - REGISTER_GENERIC_HANDLER(CGVisitableOPH); - REGISTER_GENERIC_HANDLER(CGVisitableOPW); REGISTER_GENERIC_HANDLER(CGWitchHut); #undef REGISTER_GENERIC_HANDLER @@ -159,9 +154,6 @@ void registerTypesMapObjects2(Serializer &s) s.template registerType(); s.template registerType(); - s.template registerType(); - s.template registerType(); - s.template registerType(); s.template registerType(); s.template registerType();