2012-09-23 18:11:08 +00:00
|
|
|
#ifndef OPENMW_ESM_WEAP_H
|
|
|
|
#define OPENMW_ESM_WEAP_H
|
2010-02-21 16:55:12 +00:00
|
|
|
|
2012-09-17 07:37:50 +00:00
|
|
|
#include <string>
|
|
|
|
|
2011-04-08 13:58:21 +00:00
|
|
|
namespace ESM
|
|
|
|
{
|
2010-02-21 16:55:12 +00:00
|
|
|
|
2012-09-30 20:51:54 +00:00
|
|
|
class ESMReader;
|
|
|
|
class ESMWriter;
|
|
|
|
|
2010-02-21 16:55:12 +00:00
|
|
|
/*
|
|
|
|
* Weapon definition
|
|
|
|
*/
|
|
|
|
|
2012-09-30 19:34:53 +00:00
|
|
|
struct Weapon
|
2010-02-21 16:55:12 +00:00
|
|
|
{
|
2011-04-08 13:58:21 +00:00
|
|
|
enum Type
|
2010-02-21 16:55:12 +00:00
|
|
|
{
|
2011-04-08 13:58:21 +00:00
|
|
|
ShortBladeOneHand = 0,
|
|
|
|
LongBladeOneHand = 1,
|
|
|
|
LongBladeTwoHand = 2,
|
|
|
|
BluntOneHand = 3,
|
|
|
|
BluntTwoClose = 4,
|
|
|
|
BluntTwoWide = 5,
|
|
|
|
SpearTwoWide = 6,
|
|
|
|
AxeOneHand = 7,
|
|
|
|
AxeTwoHand = 8,
|
|
|
|
MarksmanBow = 9,
|
|
|
|
MarksmanCrossbow = 10,
|
|
|
|
MarksmanThrown = 11,
|
|
|
|
Arrow = 12,
|
|
|
|
Bolt = 13
|
2010-02-21 16:55:12 +00:00
|
|
|
};
|
|
|
|
|
2011-04-08 13:58:21 +00:00
|
|
|
enum Flags
|
2010-02-21 16:55:12 +00:00
|
|
|
{
|
2011-04-08 13:58:21 +00:00
|
|
|
Magical = 0x01,
|
|
|
|
Silver = 0x02
|
2010-02-21 16:55:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#pragma pack(push)
|
|
|
|
#pragma pack(1)
|
2011-04-08 13:58:21 +00:00
|
|
|
struct WPDTstruct
|
|
|
|
{
|
2012-09-17 07:37:50 +00:00
|
|
|
float mWeight;
|
|
|
|
int mValue;
|
|
|
|
short mType;
|
|
|
|
short mHealth;
|
|
|
|
float mSpeed, mReach;
|
|
|
|
short mEnchant; // Enchantment points
|
|
|
|
unsigned char mChop[2], mSlash[2], mThrust[2]; // Min and max
|
|
|
|
int mFlags;
|
2011-04-08 13:58:21 +00:00
|
|
|
}; // 32 bytes
|
2010-02-21 16:55:12 +00:00
|
|
|
#pragma pack(pop)
|
|
|
|
|
2012-09-17 07:37:50 +00:00
|
|
|
WPDTstruct mData;
|
2010-02-21 16:55:12 +00:00
|
|
|
|
2012-10-07 17:24:47 +00:00
|
|
|
std::string mId, mName, mModel, mIcon, mEnchant, mScript;
|
2010-02-21 16:55:12 +00:00
|
|
|
|
2011-04-08 13:58:21 +00:00
|
|
|
void load(ESMReader &esm);
|
2012-04-06 19:04:30 +00:00
|
|
|
void save(ESMWriter &esm);
|
2013-05-06 12:10:43 +00:00
|
|
|
|
|
|
|
void blank();
|
|
|
|
///< Set record to default state (does not touch the ID).
|
2010-02-21 16:55:12 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|