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
|
|
|
{
|
2013-09-24 11:17:28 +00:00
|
|
|
static unsigned int sRecordId;
|
2015-06-14 00:31:00 +00:00
|
|
|
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
|
|
|
|
static std::string getRecordType() { return "Weapon"; }
|
2013-09-24 11:17:28 +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
|
|
|
};
|
|
|
|
|
2014-01-27 21:05:17 +00:00
|
|
|
enum AttackType
|
|
|
|
{
|
|
|
|
AT_Chop,
|
|
|
|
AT_Slash,
|
|
|
|
AT_Thrust
|
|
|
|
};
|
|
|
|
|
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;
|
2018-06-02 12:41:05 +00:00
|
|
|
unsigned short mHealth;
|
2012-09-17 07:37:50 +00:00
|
|
|
float mSpeed, mReach;
|
2013-04-29 08:19:09 +00:00
|
|
|
short mEnchant; // Enchantment points. The real value is mEnchant/10.f
|
2012-09-17 07:37:50 +00:00
|
|
|
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
|
|
|
|
2015-07-20 14:23:14 +00:00
|
|
|
void load(ESMReader &esm, bool &isDeleted);
|
|
|
|
void save(ESMWriter &esm, bool isDeleted = false) const;
|
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
|