From 7d1e661e6f3cad3e8b3b57e92bb1207a692971b7 Mon Sep 17 00:00:00 2001 From: Laserlicht <13953785+Laserlicht@users.noreply.github.com> Date: Tue, 16 Sep 2025 02:07:25 +0200 Subject: [PATCH] mithril removal --- Mods/vcmi/Content/config/english.json | 4 +--- Mods/vcmi/Content/config/german.json | 4 +--- client/lobby/OptionsTab.cpp | 2 -- client/windows/GUIClasses.h | 2 +- config/difficulty.json | 20 ++++++++++---------- config/resources.json | 6 ------ docs/modders/Difficulty.md | 2 +- docs/modders/Game_Identifiers.md | 1 - docs/players/Game_Mechanics.md | 4 ---- lib/CCreatureHandler.cpp | 2 +- lib/constants/EntityIdentifiers.h | 1 - lib/constants/NumericConstants.h | 2 +- lib/constants/StringConstants.h | 2 +- lib/entities/faction/CTownHandler.cpp | 3 ++- scripts/lib/erm/MA.lua | 2 +- test/vcai/ResourceManagerTest.cpp | 1 - 16 files changed, 20 insertions(+), 38 deletions(-) diff --git a/Mods/vcmi/Content/config/english.json b/Mods/vcmi/Content/config/english.json index 05ee6cc94..31e3896d2 100644 --- a/Mods/vcmi/Content/config/english.json +++ b/Mods/vcmi/Content/config/english.json @@ -1083,7 +1083,5 @@ "spellSchool.core.air.name" : "Air", "spellSchool.core.earth.name" : "Earth", "spellSchool.core.fire.name" : "Fire", - "spellSchool.core.water.name" : "Water", - - "resources.core.mithril.name" : "Mithril" + "spellSchool.core.water.name" : "Water" } diff --git a/Mods/vcmi/Content/config/german.json b/Mods/vcmi/Content/config/german.json index c5fd761e5..7a676eccc 100644 --- a/Mods/vcmi/Content/config/german.json +++ b/Mods/vcmi/Content/config/german.json @@ -1076,7 +1076,5 @@ "spellSchool.core.air.name" : "Luft", "spellSchool.core.earth.name" : "Erde", "spellSchool.core.fire.name" : "Feuer", - "spellSchool.core.water.name" : "Wasser", - - "resources.core.mithril.name" : "Mithril" + "spellSchool.core.water.name" : "Wasser" } \ No newline at end of file diff --git a/client/lobby/OptionsTab.cpp b/client/lobby/OptionsTab.cpp index 5d81ebcd1..ed4756d9d 100644 --- a/client/lobby/OptionsTab.cpp +++ b/client/lobby/OptionsTab.cpp @@ -162,8 +162,6 @@ size_t OptionsTab::CPlayerSettingsHelper::getImageIndex(bool big) return GEM; case EGameResID::GOLD: return GOLD; - case EGameResID::MITHRIL: - return MITHRIL; } } } diff --git a/client/windows/GUIClasses.h b/client/windows/GUIClasses.h index c95c1407d..cd909cc0c 100644 --- a/client/windows/GUIClasses.h +++ b/client/windows/GUIClasses.h @@ -464,7 +464,7 @@ private: enum class State { UNAFFORDABLE, ALREADY_UPGRADED, MAKE_UPGRADE, EMPTY, UNAVAILABLE }; static constexpr std::size_t slotsCount = 7; - //todo: mithril support + //todo: configurable resource support static constexpr std::size_t resCount = 7; const CGObjectInstance * fort; diff --git a/config/difficulty.json b/config/difficulty.json index 50f93d545..8144e58c9 100644 --- a/config/difficulty.json +++ b/config/difficulty.json @@ -4,31 +4,31 @@ { "pawn": { - "resources": { "wood" : 30, "mercury": 15, "ore": 30, "sulfur": 15, "crystal": 15, "gems": 15, "gold": 30000, "mithril": 0 }, + "resources": { "wood" : 30, "mercury": 15, "ore": 30, "sulfur": 15, "crystal": 15, "gems": 15, "gold": 30000 }, "globalBonuses": [], "battleBonuses": [] }, "knight": { - "resources": { "wood" : 20, "mercury": 10, "ore": 20, "sulfur": 10, "crystal": 10, "gems": 10, "gold": 20000, "mithril": 0 }, + "resources": { "wood" : 20, "mercury": 10, "ore": 20, "sulfur": 10, "crystal": 10, "gems": 10, "gold": 20000 }, "globalBonuses": [], "battleBonuses": [] }, "rook": { - "resources": { "wood" : 15, "mercury": 7, "ore": 15, "sulfur": 7, "crystal": 7, "gems": 7, "gold": 15000, "mithril": 0 }, + "resources": { "wood" : 15, "mercury": 7, "ore": 15, "sulfur": 7, "crystal": 7, "gems": 7, "gold": 15000 }, "globalBonuses": [], "battleBonuses": [] }, "queen": { - "resources": { "wood" : 10, "mercury": 4, "ore": 10, "sulfur": 4, "crystal": 4, "gems": 4, "gold": 10000, "mithril": 0 }, + "resources": { "wood" : 10, "mercury": 4, "ore": 10, "sulfur": 4, "crystal": 4, "gems": 4, "gold": 10000 }, "globalBonuses": [], "battleBonuses": [] }, "king": { - "resources": { "wood" : 0, "mercury": 0, "ore": 0, "sulfur": 0, "crystal": 0, "gems": 0, "gold": 0, "mithril": 0 }, + "resources": { "wood" : 0, "mercury": 0, "ore": 0, "sulfur": 0, "crystal": 0, "gems": 0, "gold": 0 }, "globalBonuses": [], "battleBonuses": [] } @@ -37,31 +37,31 @@ { "pawn": { - "resources": { "wood" : 5, "mercury": 2, "ore": 5, "sulfur": 2, "crystal": 2, "gems": 2, "gold": 5000, "mithril": 0 }, + "resources": { "wood" : 5, "mercury": 2, "ore": 5, "sulfur": 2, "crystal": 2, "gems": 2, "gold": 5000 }, "globalBonuses": [], "battleBonuses": [] }, "knight": { - "resources": { "wood" : 10, "mercury": 4, "ore": 10, "sulfur": 4, "crystal": 4, "gems": 4, "gold": 7500, "mithril": 0 }, + "resources": { "wood" : 10, "mercury": 4, "ore": 10, "sulfur": 4, "crystal": 4, "gems": 4, "gold": 7500 }, "globalBonuses": [], "battleBonuses": [] }, "rook": { - "resources": { "wood" : 15, "mercury": 7, "ore": 15, "sulfur": 7, "crystal": 7, "gems": 7, "gold": 10000, "mithril": 0 }, + "resources": { "wood" : 15, "mercury": 7, "ore": 15, "sulfur": 7, "crystal": 7, "gems": 7, "gold": 10000 }, "globalBonuses": [], "battleBonuses": [] }, "queen": { - "resources": { "wood" : 15, "mercury": 7, "ore": 15, "sulfur": 7, "crystal": 7, "gems": 7, "gold": 10000, "mithril": 0 }, + "resources": { "wood" : 15, "mercury": 7, "ore": 15, "sulfur": 7, "crystal": 7, "gems": 7, "gold": 10000 }, "globalBonuses": [], "battleBonuses": [] }, "king": { - "resources": { "wood" : 15, "mercury": 7, "ore": 15, "sulfur": 7, "crystal": 7, "gems": 7, "gold": 10000, "mithril": 0 }, + "resources": { "wood" : 15, "mercury": 7, "ore": 15, "sulfur": 7, "crystal": 7, "gems": 7, "gold": 10000 }, "globalBonuses": [], "battleBonuses": [] } diff --git a/config/resources.json b/config/resources.json index 484fd5d0a..b52e99f15 100644 --- a/config/resources.json +++ b/config/resources.json @@ -32,11 +32,5 @@ "gold": { "index" : 6, "price": 1 - }, - - "mithril": { - "index" : 7, - "name" : "Mithril", - "price": 0 } } diff --git a/docs/modders/Difficulty.md b/docs/modders/Difficulty.md index fc5801f4c..846518c4f 100644 --- a/docs/modders/Difficulty.md +++ b/docs/modders/Difficulty.md @@ -14,7 +14,7 @@ Difficulty configuration is located in [config/difficulty.json](../../config/dif "pawn": //parameters for specific difficulty { //starting resources - "resources": { "wood" : 30, "mercury": 15, "ore": 30, "sulfur": 15, "crystal": 15, "gems": 15, "gold": 30000, "mithril": 0 }, + "resources": { "wood" : 30, "mercury": 15, "ore": 30, "sulfur": 15, "crystal": 15, "gems": 15, "gold": 30000 }, //bonuses will be given to player globally "globalBonuses": [], //bonuses will be given to player every battle diff --git a/docs/modders/Game_Identifiers.md b/docs/modders/Game_Identifiers.md index 24e95b530..3fec38e33 100644 --- a/docs/modders/Game_Identifiers.md +++ b/docs/modders/Game_Identifiers.md @@ -568,7 +568,6 @@ Deprecated, please use primarySkill instead - resource.gems - resource.gold - resource.mercury -- resource.mithril - resource.ore - resource.sulfur - resource.wood diff --git a/docs/players/Game_Mechanics.md b/docs/players/Game_Mechanics.md index cc3bddd59..9640a7593 100644 --- a/docs/players/Game_Mechanics.md +++ b/docs/players/Game_Mechanics.md @@ -41,10 +41,6 @@ Stack experience interface has been merged with regular creature window. Among o VCMI offers native support for Commanders. Commanders are part of WoG mod for VCMI and require it to be enabled. However, once this is done, any new faction can use its own Commander, too. -### Mithril module - -VCMI natively supports Mithril resource known from WoG. However, it is not currently used by any mod. - ### Stack Artifact module In original WoG, there is one available Stack Artifact - Warlord's Banner, which is related directly to stack experience. VCMI natively supports any number of Stack Artifacts regardless if of Stack Experience module is enabled or not. However, currently no mods make use of this feature and it hasn't been tested for many years. diff --git a/lib/CCreatureHandler.cpp b/lib/CCreatureHandler.cpp index 6a9d5c58a..1b29fc0d8 100644 --- a/lib/CCreatureHandler.cpp +++ b/lib/CCreatureHandler.cpp @@ -568,7 +568,7 @@ std::vector CCreatureHandler::loadLegacyData() data["name"]["plural"].String() = parser.readString(); - for(int v=0; v<7; ++v) + for(int v=0; v needs mapping to resource from mithril mod + parser.endLine(); return ret; diff --git a/scripts/lib/erm/MA.lua b/scripts/lib/erm/MA.lua index 9047d4678..ab0d9e971 100644 --- a/scripts/lib/erm/MA.lua +++ b/scripts/lib/erm/MA.lua @@ -8,7 +8,7 @@ local Bonus = require("Bonus") local BonusBearer = require("BonusBearer") local BonusList = require("BonusList") -local RES = {[0] = "wood", [1] = "mercury", [2] = "ore", [3] = "sulfur", [4] = "crystal", [5] = "gems", [6] = "gold", [7] = "mithril"} +local RES = {[0] = "wood", [1] = "mercury", [2] = "ore", [3] = "sulfur", [4] = "crystal", [5] = "gems", [6] = "gold"} local SERVICES = SERVICES local creatures = SERVICES:creatures() diff --git a/test/vcai/ResourceManagerTest.cpp b/test/vcai/ResourceManagerTest.cpp index abeba4748..26636fe67 100644 --- a/test/vcai/ResourceManagerTest.cpp +++ b/test/vcai/ResourceManagerTest.cpp @@ -214,7 +214,6 @@ TEST_F(ResourceManagerTest, freeResources) ASSERT_GE(res[EGameResID::CRYSTAL], 0); ASSERT_GE(res[EGameResID::GEMS], 0); ASSERT_GE(res[EGameResID::GOLD], 0); - ASSERT_GE(res[EGameResID::MITHRIL], 0); } TEST_F(ResourceManagerTest, freeResourcesWithManyGoals)