2014-05-12 21:04:02 +02:00
|
|
|
#ifndef OPENMW_ESM_SPELLSTATE_H
|
|
|
|
#define OPENMW_ESM_SPELLSTATE_H
|
|
|
|
|
|
|
|
#include <map>
|
2016-07-01 18:50:28 +02:00
|
|
|
#include <set>
|
2014-05-12 21:04:02 +02:00
|
|
|
#include <string>
|
2014-08-21 03:11:49 +02:00
|
|
|
#include <vector>
|
2014-05-12 21:04:02 +02:00
|
|
|
|
2022-01-22 15:58:41 +01:00
|
|
|
#include "components/esm/defs.hpp"
|
2014-05-12 21:04:02 +02:00
|
|
|
|
|
|
|
namespace ESM
|
|
|
|
{
|
|
|
|
class ESMReader;
|
|
|
|
class ESMWriter;
|
|
|
|
|
2015-01-21 21:24:25 +01:00
|
|
|
// NOTE: spell ids must be lower case
|
2014-05-12 21:04:02 +02:00
|
|
|
struct SpellState
|
|
|
|
{
|
2014-08-19 03:17:31 +02:00
|
|
|
struct CorprusStats
|
|
|
|
{
|
|
|
|
int mWorsenings;
|
|
|
|
TimeStamp mNextWorsening;
|
|
|
|
};
|
|
|
|
|
2014-08-21 03:11:49 +02:00
|
|
|
struct PermanentSpellEffectInfo
|
|
|
|
{
|
|
|
|
int mId;
|
|
|
|
int mArg;
|
|
|
|
float mMagnitude;
|
|
|
|
};
|
|
|
|
|
2019-09-30 20:27:42 +04:00
|
|
|
struct SpellParams
|
|
|
|
{
|
2021-08-27 20:07:50 +02:00
|
|
|
std::map<int, float> mEffectRands; // <effect index, normalised random magnitude>
|
|
|
|
std::set<int> mPurgedEffects; // indices of purged effects
|
2016-07-01 18:50:28 +02:00
|
|
|
};
|
2021-08-27 20:07:50 +02:00
|
|
|
std::vector<std::string> mSpells;
|
2014-05-12 21:04:02 +02:00
|
|
|
|
2019-09-30 20:27:42 +04:00
|
|
|
// FIXME: obsolete, used only for old saves
|
2021-08-27 20:07:50 +02:00
|
|
|
std::map<std::string, SpellParams> mSpellParams;
|
2014-08-21 03:11:49 +02:00
|
|
|
std::map<std::string, std::vector<PermanentSpellEffectInfo>> mPermanentSpellEffects;
|
2014-08-19 03:17:31 +02:00
|
|
|
std::map<std::string, CorprusStats> mCorprusSpells;
|
|
|
|
|
2014-05-12 21:04:02 +02:00
|
|
|
std::map<std::string, TimeStamp> mUsedPowers;
|
|
|
|
|
|
|
|
std::string mSelectedSpell;
|
|
|
|
|
|
|
|
void load(ESMReader& esm);
|
|
|
|
void save(ESMWriter& esm) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|