1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00
vcmi/hch/CSpellHandler.h
2008-12-26 01:46:53 +00:00

51 lines
1.4 KiB
C++

#ifndef __CSPELLHANDLER_H__
#define __CSPELLHANDLER_H__
#include <string>
#include <vector>
class CSpell
{
public:
ui32 id;
std::string name;
std::string abbName; //abbreviated name
std::vector<std::string> descriptions; //descriptions of spell for skill levels: 0 - none, 1 - basic, etc
si32 level;
bool earth;
bool water;
bool fire;
bool air;
si32 power; //spell's power
std::vector<si32> costs; //per skill level: 0 - none, 1 - basic, etc
std::vector<si32> powers; //[er skill level: 0 - none, 1 - basic, etc
std::vector<si32> probabilities; //% chance to gain for castles
std::vector<si32> AIVals; //AI values: per skill level: 0 - none, 1 - basic, etc
std::string attributes; //reference only attributes
bool combatSpell; //is this spell combat (true) or adventure (false)
bool creatureAbility; //if true, only creatures can use this spell
si8 positiveness; //1 if spell is positive for influenced stacks, 0 if it is indifferent, -1 if it's negative
template <typename Handler> void serialize(Handler &h, const int version)
{
h & id & name & abbName & descriptions & level & earth & water & fire & air & power & costs
& powers & probabilities & AIVals & attributes & combatSpell & creatureAbility & positiveness;
}
};
class DLL_EXPORT CSpellHandler
{
public:
std::vector<CSpell> spells;
void loadSpells();
template <typename Handler> void serialize(Handler &h, const int version)
{
h & spells;
}
};
#endif // __CSPELLHANDLER_H__