You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openmw/components/esm3/creaturestats.hpp

105 lines
2.5 KiB
C++

#ifndef OPENMW_ESM_CREATURESTATS_H
#define OPENMW_ESM_CREATURESTATS_H
#include <array>
#include <map>
#include <string>
#include <vector>
#include "statstate.hpp"
#include "components/esm/defs.hpp"
#include "activespells.hpp"
#include "aisequence.hpp"
#include "components/esm/attr.hpp"
Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID Slowly going through all the changes to make, still hundreds of errors a lot of functions/structures use std::string or stringview to designate an ID. So it takes time Continues slowly replacing ids. There are technically more and more compilation errors I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type Continue moving forward, changes to the stores slowly moving along Starting to see the fruit of those changes. still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type. More replacements. Things are starting to get easier I can see more and more often the issue is that the function is awaiting a RefId, but is given a string there is less need to go down functions and to fix a long list of them. Still moving forward, and for the first time error count is going down! Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably Cells are back to using string for the name, haven't fixed everything yet. Many other changes Under the bar of 400 compilation errors. more good progress <100 compile errors! More progress Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string some more progress on other fronts Mostly game settings clean one error opened a lot of other errors. Down to 18, but more will prbably appear only link errors left?? Fixed link errors OpenMW compiles, and launches, with some issues, but still!
2 years ago
#include "components/esm/refid.hpp"
#include "magiceffects.hpp"
#include "spellstate.hpp"
#include "timestamp.hpp"
namespace ESM
{
class ESMReader;
class ESMWriter;
// format 0, saved games only
struct CreatureStats
{
struct CorprusStats
{
std::array<int32_t, Attribute::Length> mWorsenings;
TimeStamp mNextWorsening;
};
std::array<StatState<float>, Attribute::Length> mAttributes;
std::array<StatState<float>, 3> mDynamic;
MagicEffects mMagicEffects;
AiSequence::AiSequence mAiSequence;
bool mHasAiSettings;
std::array<StatState<int>, 4> mAiSettings;
std::map<SummonKey, int> mSummonedCreatureMap;
std::multimap<int, int> mSummonedCreatures;
std::vector<int> mSummonGraveyard;
TimeStamp mTradeTime;
int32_t mGoldPool;
int32_t mActorId;
enum Flags
{
Dead = 0x0001,
DeathAnimationFinished = 0x0002,
Died = 0x0004,
Murdered = 0x0008,
TalkedTo = 0x0010,
Alarmed = 0x0020,
Attacked = 0x0040,
Knockdown = 0x0080,
KnockdownOneFrame = 0x0100,
KnockdownOverOneFrame = 0x0200,
HitRecovery = 0x0400,
Block = 0x0800,
RecalcDynamicStats = 0x1000
};
bool mDead;
bool mDeathAnimationFinished;
bool mDied;
bool mMurdered;
bool mTalkedTo;
bool mAlarmed;
bool mAttacked;
bool mKnockdown;
bool mKnockdownOneFrame;
bool mKnockdownOverOneFrame;
bool mHitRecovery;
bool mBlock;
uint32_t mMovementFlags;
float mFallHeight;
Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID Slowly going through all the changes to make, still hundreds of errors a lot of functions/structures use std::string or stringview to designate an ID. So it takes time Continues slowly replacing ids. There are technically more and more compilation errors I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type Continue moving forward, changes to the stores slowly moving along Starting to see the fruit of those changes. still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type. More replacements. Things are starting to get easier I can see more and more often the issue is that the function is awaiting a RefId, but is given a string there is less need to go down functions and to fix a long list of them. Still moving forward, and for the first time error count is going down! Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably Cells are back to using string for the name, haven't fixed everything yet. Many other changes Under the bar of 400 compilation errors. more good progress <100 compile errors! More progress Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string some more progress on other fronts Mostly game settings clean one error opened a lot of other errors. Down to 18, but more will prbably appear only link errors left?? Fixed link errors OpenMW compiles, and launches, with some issues, but still!
2 years ago
ESM::RefId mLastHitObject;
ESM::RefId mLastHitAttemptObject;
bool mRecalcDynamicStats;
int32_t mDrawState;
int8_t mDeathAnimation;
TimeStamp mTimeOfDeath;
int32_t mLevel;
bool mMissingACDT;
Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID Slowly going through all the changes to make, still hundreds of errors a lot of functions/structures use std::string or stringview to designate an ID. So it takes time Continues slowly replacing ids. There are technically more and more compilation errors I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type Continue moving forward, changes to the stores slowly moving along Starting to see the fruit of those changes. still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type. More replacements. Things are starting to get easier I can see more and more often the issue is that the function is awaiting a RefId, but is given a string there is less need to go down functions and to fix a long list of them. Still moving forward, and for the first time error count is going down! Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably Cells are back to using string for the name, haven't fixed everything yet. Many other changes Under the bar of 400 compilation errors. more good progress <100 compile errors! More progress Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string some more progress on other fronts Mostly game settings clean one error opened a lot of other errors. Down to 18, but more will prbably appear only link errors left?? Fixed link errors OpenMW compiles, and launches, with some issues, but still!
2 years ago
std::map<ESM::RefId, CorprusStats> mCorprusSpells;
SpellState mSpells;
ActiveSpells mActiveSpells;
/// Initialize to default state
void blank();
void load(ESMReader& esm);
void save(ESMWriter& esm) const;
};
}
#endif