mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-16 10:19:47 +02:00
ab475195ac
- Implemented Bank Constructor object. - Merged Pyramid object into common Bank class. Banks can now grant spells as part of their reward. - Move bank config code to config/objects/creatureBanks.json. Note: WoG banks are not updated yet, should be moved to WoG mod. - Updated AI code so it can correctly evaluate bank danger (should be generic enough for use with other objects) - New files JsonRandom.* that contain routines for loading random objects from Json (still WiP but should be stable)
59 lines
1.4 KiB
C++
59 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#include "CRewardableObject.h"
|
|
#include "CObjectClassesHandler.h"
|
|
|
|
#include "../JsonNode.h"
|
|
|
|
/*
|
|
* CRewardableConstructor.h, part of VCMI engine
|
|
*
|
|
* Authors: listed in file AUTHORS in main folder
|
|
*
|
|
* License: GNU General Public License v2.0 or later
|
|
* Full text of license available in license.txt file, in main folder
|
|
*
|
|
*/
|
|
|
|
class CRandomRewardObjectInfo : public IObjectInfo
|
|
{
|
|
JsonNode parameters;
|
|
public:
|
|
bool givesResources() const override;
|
|
|
|
bool givesExperience() const override;
|
|
bool givesMana() const override;
|
|
bool givesMovement() const override;
|
|
|
|
bool givesPrimarySkills() const override;
|
|
bool givesSecondarySkills() const override;
|
|
|
|
bool givesArtifacts() const override;
|
|
bool givesCreatures() const override;
|
|
bool givesSpells() const override;
|
|
|
|
bool givesBonuses() const override;
|
|
|
|
void configureObject(CRewardableObject * object, CRandomGenerator & rng) const;
|
|
|
|
CRandomRewardObjectInfo()
|
|
{}
|
|
|
|
void init(const JsonNode & objectConfig);
|
|
};
|
|
|
|
class CRewardableConstructor : public AObjectTypeHandler
|
|
{
|
|
CRandomRewardObjectInfo objectInfo;
|
|
|
|
void initTypeData(const JsonNode & config) override;
|
|
public:
|
|
CRewardableConstructor();
|
|
|
|
CGObjectInstance * create(ObjectTemplate tmpl) const override;
|
|
|
|
void configureObject(CGObjectInstance * object, CRandomGenerator & rng) const override;
|
|
|
|
std::unique_ptr<IObjectInfo> getObjectInfo(ObjectTemplate tmpl) const override;
|
|
};
|