1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 06:35:30 +00:00
OpenMW/components/esm/loadspel.hpp

54 lines
1.0 KiB
C++
Raw Normal View History

2012-09-23 22:11:08 +04:00
#ifndef OPENMW_ESM_SPEL_H
#define OPENMW_ESM_SPEL_H
2010-02-19 14:23:22 +01:00
2012-09-17 11:37:50 +04:00
#include <string>
#include "effectlist.hpp"
2010-02-19 14:23:22 +01:00
namespace ESM
{
2010-02-19 14:23:22 +01:00
2012-10-01 00:51:54 +04:00
class ESMReader;
class ESMWriter;
struct Spell
2010-02-19 14:23:22 +01:00
{
static unsigned int sRecordId;
enum SpellType
2010-02-19 14:23:22 +01:00
{
ST_Spell = 0, // Normal spell, must be cast and costs mana
ST_Ability = 1, // Inert ability, always in effect
ST_Blight = 2, // Blight disease
ST_Disease = 3, // Common disease
ST_Curse = 4, // Curse (?)
ST_Power = 5 // Power, can use once a day
2010-02-19 14:23:22 +01:00
};
enum Flags
2010-02-19 14:23:22 +01:00
{
F_Autocalc = 1,
F_PCStart = 2,
F_Always = 4 // Casting always succeeds
2010-02-19 14:23:22 +01:00
};
struct SPDTstruct
{
2012-09-17 11:37:50 +04:00
int mType; // SpellType
int mCost; // Mana cost
int mFlags; // Flags
};
2010-02-19 14:23:22 +01:00
2012-09-17 11:37:50 +04:00
SPDTstruct mData;
std::string mId, mName;
2012-09-17 11:37:50 +04:00
EffectList mEffects;
2010-02-19 14:23:22 +01:00
void load(ESMReader &esm);
void save(ESMWriter &esm) const;
2013-04-09 11:40:36 +02:00
void blank();
///< Set record to default state (does not touch the ID/index).
2010-02-20 21:55:51 +01:00
};
2010-02-19 14:23:22 +01:00
}
#endif