Subversion Repositories spk

Rev

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