1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-21 00:19:29 +02:00

Reworked resource piles loading to fix wog maps with mithril

This commit is contained in:
Ivan Savenko
2025-01-20 11:15:45 +00:00
parent baa9b1e312
commit 09db3e4bef
16 changed files with 271 additions and 165 deletions

View File

@ -15,6 +15,9 @@
#include "../mapObjects/MiscObjects.h"
#include "../mapObjects/CGCreature.h"
#include "../mapObjects/CGHeroInstance.h"
#include "../mapObjects/CGMarket.h"
#include "../mapObjects/CGResource.h"
#include "../mapObjects/CGTownInstance.h"
#include "../mapObjects/ObstacleSetHandler.h"
VCMI_LIB_NAMESPACE_BEGIN
@ -46,9 +49,19 @@ public:
class ResourceInstanceConstructor : public CDefaultObjectTypeHandler<CGResource>
{
JsonNode config;
GameResID resourceType;
public:
void initTypeData(const JsonNode & input) override;
bool hasNameTextID() const override;
std::string getNameTextID() const override;
GameResID getResourceType() const;
int getAmountMultiplier() const;
int getBaseAmount(vstd::RNG & rng) const;
void randomizeObject(CGResource * object, vstd::RNG & rng) const override;
};
class CTownInstanceConstructor : public CDefaultObjectTypeHandler<CGTownInstance>