mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
A sketch of new artifact system based on pointers.
This commit is contained in:
1
global.h
1
global.h
@@ -15,6 +15,7 @@ typedef boost::int32_t si32; //signed int 32 bits (4 bytes)
|
|||||||
typedef boost::int16_t si16; //signed int 16 bits (2 bytes)
|
typedef boost::int16_t si16; //signed int 16 bits (2 bytes)
|
||||||
typedef boost::int8_t si8; //signed int 8 bits (1 byte)
|
typedef boost::int8_t si8; //signed int 8 bits (1 byte)
|
||||||
typedef si64 expType;
|
typedef si64 expType;
|
||||||
|
typedef ui16 spelltype;
|
||||||
#include "int3.h"
|
#include "int3.h"
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
@@ -52,6 +52,50 @@ public:
|
|||||||
void getParents(TCNodes &out, const CBonusSystemNode *root = NULL) const;
|
void getParents(TCNodes &out, const CBonusSystemNode *root = NULL) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class DLL_EXPORT IModableArt //artifact which can have different properties, such as scroll or banner
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual void Init() = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
class DLL_EXPORT CScroll : public CArtifact, public IModableArt // Spell Scroll
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
spelltype spellid;
|
||||||
|
void Init(){};
|
||||||
|
template <typename Handler> void serialize(Handler &h, const int version)
|
||||||
|
{
|
||||||
|
h & static_cast<CArtifact&>(*this);
|
||||||
|
h & spellid;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class DLL_EXPORT CCustomizableArt : public CArtifact, public IModableArt // Warlord's Banner with multiple options
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ui8 mode;
|
||||||
|
void Init(){};
|
||||||
|
void SelectMode (int mod){};
|
||||||
|
template <typename Handler> void serialize(Handler &h, const int version)
|
||||||
|
{
|
||||||
|
h & static_cast<CArtifact&>(*this);
|
||||||
|
h & mode;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class DLL_EXPORT CCommanderArt : public CArtifact, public IModableArt // Growing with time
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ui32 level;
|
||||||
|
void Init(){};
|
||||||
|
void Upgrade(){level++;};
|
||||||
|
template <typename Handler> void serialize(Handler &h, const int version)
|
||||||
|
{
|
||||||
|
h & static_cast<CArtifact&>(*this);
|
||||||
|
h & level;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
class DLL_EXPORT CArtHandler //handles artifacts
|
class DLL_EXPORT CArtHandler //handles artifacts
|
||||||
{
|
{
|
||||||
void giveArtBonus(int aid, Bonus::BonusType type, int val, int subtype = -1, int valType = Bonus::BASE_NUMBER, ILimiter * limiter = NULL);
|
void giveArtBonus(int aid, Bonus::BonusType type, int val, int subtype = -1, int valType = Bonus::BASE_NUMBER, ILimiter * limiter = NULL);
|
||||||
|
@@ -16,7 +16,6 @@
|
|||||||
* Full text of license available in license.txt file, in main folder
|
* Full text of license available in license.txt file, in main folder
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
typedef ui16 spelltype;
|
|
||||||
|
|
||||||
class DLL_EXPORT CSpell
|
class DLL_EXPORT CSpell
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user