1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-06 09:39:49 +00:00
OpenMW/components/esm3/loadspel.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

59 lines
1.5 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>
2022-06-04 16:07:59 +02:00
#include "components/esm/defs.hpp"
2012-09-17 11:37:50 +04:00
#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;
2010-02-19 14:23:22 +01:00
struct Spell
{
2022-06-04 16:34:23 +02:00
constexpr static RecNameInts sRecordId = REC_SPEL;
2022-09-22 21:26:05 +03:00
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Spell"; }
2022-09-22 21:26:05 +03:00
enum SpellType
2022-09-22 21:26:05 +03: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
2022-09-22 21:26:05 +03:00
};
enum Flags
2022-09-22 21:26:05 +03:00
{
F_Autocalc = 1, // Can be selected by NPC spells auto-calc
F_PCStart = 2, // Can be selected by player spells auto-calc
F_Always = 4 // Casting always succeeds
2022-09-22 21:26:05 +03:00
};
2012-09-17 11:37:50 +04:00
struct SPDTstruct
2022-09-22 21:26:05 +03:00
{
2012-09-17 11:37:50 +04:00
int mType; // SpellType
int mCost; // Mana cost
int mFlags; // Flags
2022-09-22 21:26:05 +03:00
};
2012-09-17 11:37:50 +04:00
SPDTstruct mData;
unsigned int mRecordFlags;
std::string mId, mName;
2012-09-17 11:37:50 +04:00
EffectList mEffects;
2022-09-22 21:26:05 +03:00
void load(ESMReader& esm, bool& isDeleted);
void save(ESMWriter& esm, bool isDeleted = false) const;
2022-09-22 21:26:05 +03:00
2013-04-09 11:40:36 +02:00
void blank();
///< Set record to default state (does not touch the ID/index).
};
2010-02-19 14:23:22 +01:00
}
#endif