1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-01 22:45:35 +00:00
openmw/components/esm3/loadcrea.hpp

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

99 lines
2.7 KiB
C++
Raw Normal View History

2012-09-23 18:11:08 +00:00
#ifndef OPENMW_ESM_CREA_H
#define OPENMW_ESM_CREA_H
2012-09-17 07:37:50 +00:00
#include <string>
2012-08-29 17:35:06 +00:00
#include "aipackage.hpp"
#include "loadcont.hpp"
2012-09-17 07:37:50 +00:00
#include "spelllist.hpp"
#include "transport.hpp"
2022-06-04 14:07:59 +00:00
#include "components/esm/defs.hpp"
namespace ESM
{
2012-09-30 20:51:54 +00:00
class ESMReader;
class ESMWriter;
/*
* Creature definition
2022-09-22 18:26:05 +00:00
*
*/
struct Creature
{
2022-06-04 14:34:23 +00:00
constexpr static RecNameInts sRecordId = REC_CREA;
2022-09-22 18:26:05 +00:00
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Creature"; }
2022-09-22 18:26:05 +00:00
// Default is 0x48?
enum Flags
2022-09-22 18:26:05 +00:00
{
Bipedal = 0x01,
Respawn = 0x02,
Weapon = 0x04, // Has weapon and shield
Base = 0x08, // This flag is set for every actor in Bethesda ESMs
Swims = 0x10,
Flies = 0x20, // Don't know what happens if several
Walks = 0x40, // of these are set
Essential = 0x80
2022-09-22 18:26:05 +00:00
};
enum Type
{
Creatures = 0,
Daedra = 1,
Undead = 2,
Humanoid = 3
2022-09-22 18:26:05 +00:00
};
struct NPDTstruct
2022-09-22 18:26:05 +00:00
{
2012-09-17 07:37:50 +00:00
int mType;
// For creatures we obviously have to use ints, not shorts and
// bytes like we use for NPCs.... this file format just makes so
// much sense! (Still, _much_ easier to decode than the NIFs.)
2012-09-17 07:37:50 +00:00
int mLevel;
int mStrength, mIntelligence, mWillpower, mAgility, mSpeed, mEndurance, mPersonality, mLuck;
2022-09-22 18:26:05 +00:00
2012-09-17 07:37:50 +00:00
int mHealth, mMana, mFatigue; // Stats
int mSoul; // The creatures soul value (used with soul gems.)
// Creatures have generalized combat, magic and stealth stats which substitute for
// the specific skills (in the same way as specializations).
int mCombat, mMagic, mStealth;
2012-09-17 07:37:50 +00:00
int mAttack[6]; // AttackMin1, AttackMax1, ditto2, ditto3
int mGold;
}; // 96 byte
2022-09-22 18:26:05 +00:00
2012-09-17 07:37:50 +00:00
NPDTstruct mData;
2022-09-22 18:26:05 +00:00
int mBloodType;
unsigned char mFlags;
2022-09-22 18:26:05 +00:00
2012-09-17 07:37:50 +00:00
float mScale;
2022-09-22 18:26:05 +00:00
unsigned int mRecordFlags;
std::string mId, mModel, mName, mScript;
2012-09-17 07:37:50 +00:00
std::string mOriginal; // Base creature that this is a modification of
2022-09-22 18:26:05 +00:00
2012-09-17 07:37:50 +00:00
InventoryList mInventory;
2012-08-29 17:35:06 +00:00
SpellList mSpells;
2022-09-22 18:26:05 +00:00
2012-08-29 17:35:06 +00:00
AIData mAiData;
AIPackageList mAiPackage;
Transport mTransport;
2022-09-22 18:26:05 +00:00
const std::vector<Transport::Dest>& getTransport() const;
2022-09-22 18:26:05 +00:00
void load(ESMReader& esm, bool& isDeleted);
void save(ESMWriter& esm, bool isDeleted = false) const;
2022-09-22 18:26:05 +00:00
void blank();
///< Set record to default state (does not touch the ID).
};
}
#endif