Subversion Repositories spk

Rev

Rev 59 | Rev 170 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 cycrow 1
#pragma once
2
 
3
#include "CyString.h"
4
#include "lists.h"
94 cycrow 5
#include "Utils/String.h"
1 cycrow 6
 
7
/**
8
 * Ship class defines
9
 */
10
typedef enum {
11
	SG_SH_TL,	
12
	SG_SH_TS,
13
	SG_SH_M0,
14
	SG_SH_M1,
15
	SG_SH_M2,
16
	SG_SH_M3,
17
	SG_SH_M4,
18
	SG_SH_M5,
19
	SG_SH_TL_P,
20
	SG_SH_TS_P,
21
	SG_SH_GO,
22
	SG_SH_M6,
23
	SG_SH_TP,
24
	SG_SH_M7, 
25
	SG_SH_TM, 
26
	SG_SH_M8, 
27
	SG_SH_MAX
28
} ShipClasses;
29
 
30
/**
31
 * Ship Object Classes
32
 */
33
typedef enum {
34
	OBJ_SHIP_M0			= 2020,
35
	OBJ_SHIP_M1			= 2021,
36
	OBJ_SHIP_M2			= 2022,
37
	OBJ_SHIP_M3			= 2023,
38
	OBJ_SHIP_M4			= 2024,
39
	OBJ_SHIP_M5			= 2025,
40
	OBJ_SHIP_M6			= 2026,
41
	OBJ_SHIP_M7			= 2027,
42
	OBJ_SHIP_TP			= 2030,
43
	OBJ_SHIP_TS			= 2031,
44
	OBJ_SHIP_TL			= 2032,
45
	OBJ_SHIP_M8			= 2142,
46
	OBJ_SHIP_TM			= 2141,
47
	OBJ_SHIP_TS_PIRATE	= 2035,
48
	OBJ_SHIP_TL_PIRATE	= 2036,
49
	OBJ_SHIP_GONER		= 2039,
50
	OBJ_SHIP_MAX		= 16
51
} ShipObjectClasses;
52
 
53
/**
54
 * Missle flags
55
 */
56
typedef enum {
57
	SG_MISSILE_LIGHT			= 1,
58
	SG_MISSILE_MEDIUM			= 2,
59
	SG_MISSILE_HEAVY			= 4,
60
	SG_MISSILE_TR_LIGHT			= 8,
61
	SG_MISSILE_TR_MEDIUM		= 16,
62
	SG_MISSILE_TR_HEAVY			= 32,
63
	SG_MISSILE_KHAAK			= 64,
64
	SG_MISSILE_BOMBER			= 128,
65
	SG_MISSILE_TORP_CAPTIAL		= 256,
66
	SG_MISSILE_AF_CAPTIAL		= 512,
67
	SG_MISSILE_TR_BOMBER		= 1024,
68
	SG_MISSILE_TR_TORP_CAPTIAL	= 2048,
69
	SG_MISSILE_TR_AF_CAPTIAL	= 4096,
70
	SG_MISSILE_BOARDINGPOD		= 8192,
71
	SG_MISSILE_DMBF				= 16384,
72
	SG_MISSILE_MAX				= 15
73
} MissileFlags;
74
 
75
/**
76
 * structure for ships individual guns
77
 */
78
typedef struct SWeaponGroup {
79
	int			iGunIndex;
80
	int			iLaser;
81
	CyString	sModel1;
82
	int			iNode1;
83
	CyString	sModel2;
84
	int			iNode2;
85
} SWeaponGroup;
86
 
87
/**
88
 * structure for each gun placement on the ships
89
 * Can hold multiple weapons
90
 */
91
typedef struct SGunGroup {
92
	int			iGunIndex;
93
	int			iLaserCount;
94
	int			iIndex;
95
	int			iWeaponCount;
96
	CLinkList<SWeaponGroup> lWeapons;
97
} SGunGroup;
98
 
99
/**
100
 * structure for each turret cockpit on the ship
101
 */
102
typedef struct STurretEntry
103
{
104
	int			iIndex;
105
	int			iTurret;
106
	CyString	sModel;
107
	int			iSceneNode;
108
} STurretEntry;
109
 
110
typedef struct STurretData {
111
	int			iPos;
112
	int			iCockpit;
113
	CyString	sCockpit;
114
} STurretData;
115
 
116
/**
117
 * Class to split the TShips data into individual values
118
 */
119
class SPKEXPORT CShipData
120
{
121
public:
122
	CShipData(void);
123
	CShipData(CyString a_data)
124
	{
125
		this->ReadShipData(a_data);
126
	}
127
	virtual ~CShipData(void);
128
 
129
	CyString CreateData();
130
	void CreateDefault();
131
	void ClearLists();
132
	bool ReadShipData(CyString a_data);
133
	void UpdateGunEntries();
134
	void AddNewTurret(int dir);
135
 
136
	void ClearTurrets();
137
	void RemoveTurret(int t);
138
 
139
	static CyString ConvertShipSubType(int subtype);
94 cycrow 140
	static Utils::String ConvertShipClass(int shipclass);
1 cycrow 141
	static int		GetShipClassFromNum(int shipclass);
142
	static int		ConvertShipSubType(CyString subtype);
143
	static int		ConvertShipClassToNum(int shipclass);
94 cycrow 144
	static int		ConvertShipClass(const Utils::String &shipclass);
1 cycrow 145
	static int		ConvertMissileGroup(CyString type);
146
	static int		ConvertMissileGroupToID(CyString type);
147
	static int		ConvertMissileGroupToID(int type);
148
	static CyString	ConvertMissileGroup(int type);
149
 
150
	CyString	sModel;
151
	int			iPictureID;
152
	float		fRotX, fRotY, fRotZ;
153
	int			iSubType;
154
	int			iDesc;
155
	int			iRace;
156
	int			iVariation;
157
	int			iClass;
158
	int			iDocking;
159
	int			iSpeed;
160
	int			iAccel;
161
	int			iEngineSound;
162
	int			iReactionDelay;
163
	int			iEngineEffect;
164
	int			iEngineGlow;
165
	int			iPower;
166
	int			iSoundMin;
167
	int			iSoundMax;
168
	CyString	sModelScene;
169
	CyString	sCockpitScene;
170
	int			iLaserMask;
171
	int			iGunCount;
172
	int			iLaserEnergy;
173
	float		fLaserRecharge;
174
	int			iShieldType;
175
	int			iMaxShields;
176
	int			iMissileMask;
177
	int			iMissileCount;
178
	int			iSpeedExtension;
179
	int			iSteeringExtension;
180
	int			iCargoMin;
181
	int			iCargoMax;
182
	int			iWareListID;
183
	STurretData cockpits[6];
184
	int			iCargoClass;
185
	int			iHull;
186
	int			iExplosionDef;
187
	int			iExplosionBody;
188
	int			iParticle;
189
	int			iRotationAccel;
190
	int			iTurretCount;
191
	CLinkList<STurretEntry> lTurrets;
192
	int			iGunsCount;
193
	CLinkList<SGunGroup> lGuns;
194
	int			iVolumn;
195
	int			iRelVal;
196
	int			iPriceMod1;
197
	int			iPriceMod2;
198
	int			iSize;
199
	int			iRelValPlayer;
200
	int			iMinNoto;
201
	int			iVideoID;
202
	int			iSkin;
203
	CyString	sID;
59 cycrow 204
 
205
private:
206
	void _capValues();
1 cycrow 207
};