/
item.h
127 lines (101 loc) · 3.85 KB
/
item.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/* xoreos - A reimplementation of BioWare's Aurora engine
*
* xoreos is the legal property of its developers, whose names can be
* found in the AUTHORS file distributed with this source
* distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*
* The Infinity, Aurora, Odyssey and Eclipse engines, Copyright (c) BioWare corp.
* The Electron engine, Copyright (c) Obsidian Entertainment and BioWare corp.
*/
/** @file engines/nwn/item.h
* NWN inventory item.
*/
#ifndef ENGINES_NWN_ITEM_H
#define ENGINES_NWN_ITEM_H
#include "aurora/types.h"
#include "graphics/aurora/types.h"
#include "engines/nwn/object.h"
namespace Engines {
namespace NWN {
/** NWN inventory item. */
class Item : public Object {
public:
Item();
~Item();
void loadModel(); ///< Load the situated object's model.
void unloadModel(); ///< Unload the situated object's model.
void show(); ///< Show the situated object's model.
void hide(); ///< Hide the situated object's model.
void load(const Aurora::GFFStruct &instance, const Aurora::GFFStruct *blueprint = 0);
bool isArmor();
int getArmorPart(int index);
// TODO: Use _colors array like plt file
uint32 _colorMetal1; ///< The 1. color of the creature's metal armor.
uint32 _colorMetal2; ///< The 2. color of the creature's metal armor.
uint32 _colorLeather1; ///< The 1. color of the creature's leather armor.
uint32 _colorLeather2; ///< The 2. color of the creature's leather armor.
uint32 _colorCloth1; ///< The 1. color of the creature's cloth armor.
uint32 _colorCloth2; ///< The 2. color of the creature's cloth armor.
protected:
Common::UString _modelName; ///< The model's resource name.
uint32 _appearanceID; ///< The index within the situated appearance 2DA.
uint32 _soundAppType; ///< The index within the situated sounds 2DA.
uint32 _baseitem; ///< The index within the baseitem 2DA.
Graphics::Aurora::Model *_model; ///< The situated object's model.
/** Load the situated object from an instance and its blueprint. */
/** Load object-specific properties. */
// virtual void loadObject(const Aurora::GFFStruct &gff) = 0;
/** Load appearance-specific properties. */
// virtual void loadAppearance() = 0;
private:
/** Parts of an armor set. */
enum ArmorPartType {
kArmorPartHead = 0,
kArmorPartNeck ,
kArmorPartTorso ,
kArmorPartPelvis ,
kArmorPartBelt ,
kArmorPartRightFoot ,
kArmorPartLeftFoot ,
kArmorPartRightShin ,
kArmorPartLeftShin ,
kArmorPartLeftThigh ,
kArmorPartRightThigh ,
kArmorPartRightFArm ,
kArmorPartLeftFArm ,
kArmorPartRightBicep ,
kArmorPartLeftBicep ,
kArmorPartRightShoul ,
kArmorPartLeftShoul ,
kArmorPartRightHand ,
kArmorPartLeftHand ,
kArmorPartMAX
};
void loadProperties(const Aurora::GFFStruct &gff);
void loadPortrait(const Aurora::GFFStruct &gff);
void loadArmorParts(const Aurora::GFFStruct &gff);
void loadSounds();
/** Index to appropriate armor part. */
struct ArmorPart {
uint32 id; ///< Index of the part variant.
};
std::vector<ArmorPart> _armorParts; ///< The item's armor parts.
};
} // End of namespace NWN
} // End of namespace Engines
#endif // ENGINES_NWN_ITEM_H