2012-09-23 22:11:08 +04:00
|
|
|
#ifndef OPENMW_ESM_WEAP_H
|
|
|
|
#define OPENMW_ESM_WEAP_H
|
2010-02-21 17:55:12 +01:00
|
|
|
|
2012-09-17 11:37:50 +04:00
|
|
|
#include <string>
|
|
|
|
|
2011-04-08 17:58:21 +04:00
|
|
|
namespace ESM
|
|
|
|
{
|
2010-02-21 17:55:12 +01:00
|
|
|
|
2012-10-01 00:51:54 +04:00
|
|
|
class ESMReader;
|
|
|
|
class ESMWriter;
|
|
|
|
|
2010-02-21 17:55:12 +01:00
|
|
|
/*
|
|
|
|
* Weapon definition
|
|
|
|
*/
|
|
|
|
|
2012-09-30 23:34:53 +04:00
|
|
|
struct Weapon
|
2010-02-21 17:55:12 +01:00
|
|
|
{
|
2013-09-24 13:17:28 +02:00
|
|
|
static unsigned int sRecordId;
|
2015-06-14 02:31:00 +02: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 13:17:28 +02:00
|
|
|
|
2011-04-08 17:58:21 +04:00
|
|
|
enum Type
|
2010-02-21 17:55:12 +01:00
|
|
|
{
|
2011-04-08 17:58:21 +04: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 17:55:12 +01:00
|
|
|
};
|
|
|
|
|
2014-01-27 23:05:17 +02:00
|
|
|
enum AttackType
|
|
|
|
{
|
|
|
|
AT_Chop,
|
|
|
|
AT_Slash,
|
|
|
|
AT_Thrust
|
|
|
|
};
|
|
|
|
|
2011-04-08 17:58:21 +04:00
|
|
|
enum Flags
|
2010-02-21 17:55:12 +01:00
|
|
|
{
|
2011-04-08 17:58:21 +04:00
|
|
|
Magical = 0x01,
|
|
|
|
Silver = 0x02
|
2010-02-21 17:55:12 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#pragma pack(push)
|
|
|
|
#pragma pack(1)
|
2011-04-08 17:58:21 +04:00
|
|
|
struct WPDTstruct
|
|
|
|
{
|
2012-09-17 11:37:50 +04:00
|
|
|
float mWeight;
|
|
|
|
int mValue;
|
|
|
|
short mType;
|
|
|
|
short mHealth;
|
|
|
|
float mSpeed, mReach;
|
2013-04-29 10:19:09 +02:00
|
|
|
short mEnchant; // Enchantment points. The real value is mEnchant/10.f
|
2012-09-17 11:37:50 +04:00
|
|
|
unsigned char mChop[2], mSlash[2], mThrust[2]; // Min and max
|
|
|
|
int mFlags;
|
2011-04-08 17:58:21 +04:00
|
|
|
}; // 32 bytes
|
2010-02-21 17:55:12 +01:00
|
|
|
#pragma pack(pop)
|
|
|
|
|
2012-09-17 11:37:50 +04:00
|
|
|
WPDTstruct mData;
|
2010-02-21 17:55:12 +01:00
|
|
|
|
2012-10-07 21:24:47 +04:00
|
|
|
std::string mId, mName, mModel, mIcon, mEnchant, mScript;
|
2010-02-21 17:55:12 +01:00
|
|
|
|
2015-07-20 17:23:14 +03:00
|
|
|
void load(ESMReader &esm, bool &isDeleted);
|
|
|
|
void save(ESMWriter &esm, bool isDeleted = false) const;
|
2013-05-06 14:10:43 +02:00
|
|
|
|
|
|
|
void blank();
|
|
|
|
///< Set record to default state (does not touch the ID).
|
2010-02-21 17:55:12 +01:00
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|