Starshatter_Open
Open source Starshatter engine
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
ShipDesign.h
Go to the documentation of this file.
1
/* Project Starshatter 4.6
2
Destroyer Studios LLC
3
Copyright © 1997-2006. All Rights Reserved.
4
5
SUBSYSTEM: Stars.exe
6
FILE: ShipDesign.h
7
AUTHOR: John DiCamillo
8
9
10
OVERVIEW
11
========
12
Starship Design parameters class
13
*/
14
15
#ifndef ShipDesign_h
16
#define ShipDesign_h
17
18
#include "
Types.h
"
19
#include "
Bitmap.h
"
20
#include "
Geometry.h
"
21
#include "
term.h
"
22
#include "
List.h
"
23
24
// +----------------------------------------------------------------------+
25
26
class
ShipDesign
;
27
class
Model
;
28
class
Skin
;
29
class
PowerSource
;
30
class
Weapon
;
31
class
HardPoint
;
32
class
Computer
;
33
class
Drive
;
34
class
QuantumDrive
;
35
class
Farcaster
;
36
class
Thruster
;
37
class
Sensor
;
38
class
NavLight
;
39
class
NavSystem
;
40
class
Shield
;
41
class
FlightDeck
;
42
class
LandingGear
;
43
class
System
;
44
class
Sound
;
45
46
// +====================================================================+
47
48
class
ShipLoad
49
{
50
public
:
51
static
const
char
*
TYPENAME
() {
return
"ShipLoad"
; }
52
53
ShipLoad
();
54
55
char
name
[64];
56
int
load
[16];
57
double
mass
;
58
};
59
60
class
ShipSquadron
61
{
62
public
:
63
static
const
char
*
TYPENAME
() {
return
"ShipSquadron"
; }
64
65
ShipSquadron
();
66
67
char
name
[64];
68
ShipDesign
*
design
;
69
int
count
;
70
int
avail
;
71
};
72
73
class
ShipExplosion
74
{
75
public
:
76
static
const
char
*
TYPENAME
() {
return
"ShipExplosion"
; }
77
78
ShipExplosion
() { ZeroMemory(
this
,
sizeof
(
ShipExplosion
)); }
79
80
int
type
;
81
float
time
;
82
Vec3
loc
;
83
bool
final
;
84
};
85
86
class
ShipDebris
87
{
88
public
:
89
static
const
char
*
TYPENAME
() {
return
"ShipDebris"
; }
90
91
ShipDebris
() { ZeroMemory(
this
,
sizeof
(
ShipDebris
)); }
92
93
Model
*
model
;
94
int
count
;
95
int
life
;
96
Vec3
loc
;
97
float
mass
;
98
float
speed
;
99
float
drag
;
100
int
fire_type
;
101
Vec3
fire_loc
[5];
102
};
103
104
// +====================================================================+
105
// Used to share common information about ships of a single type.
106
// ShipDesign objects are loaded from a text file and stored in a
107
// static list (catalog) member for use by the Ship.
108
109
class
ShipDesign
110
{
111
public
:
112
static
const
char
*
TYPENAME
() {
return
"ShipDesign"
; }
113
114
enum
CONSTANTS
{
115
MAX_DEBRIS
= 10,
116
MAX_EXPLOSIONS
= 10
117
};
118
119
ShipDesign
();
120
ShipDesign
(
const
char
*
name
,
const
char
* path,
const
char
*
filename
,
bool
secret
=
false
);
121
~ShipDesign
();
122
123
// public interface:
124
static
void
Initialize
();
125
static
void
Close
();
126
static
bool
CheckName
(
const
char
*
name
);
127
static
ShipDesign
*
Get
(
const
char
* design_name,
const
char
* design_path=0);
128
static
ShipDesign
*
FindModDesign
(
const
char
* design_name,
const
char
* design_path=0);
129
static
void
ClearModCatalog
();
130
static
int
GetDesignList
(
int
type
,
List<Text>
& designs);
// never destroy the design list!
131
132
static
int
ClassForName
(
const
char
*
name
);
133
static
const
char
*
ClassName
(
int
type
);
134
135
static
int
LoadCatalog
(
const
char
* path,
const
char
* file,
bool
mod=
false
);
136
static
void
LoadSkins
(
const
char
* path,
const
char
* archive=0);
137
static
void
PreloadCatalog
(
int
index=-1);
138
static
int
StandardCatalogSize
();
139
140
int
operator ==
(
const
ShipDesign
& s)
const
{
return
!strncmp(
name
, s.
name
, 31); }
141
142
// Parser:
143
void
ParseShip
(
TermDef
* def);
144
145
void
ParsePower
(
TermStruct
* val);
146
void
ParseDrive
(
TermStruct
* val);
147
void
ParseQuantumDrive
(
TermStruct
* val);
148
void
ParseFarcaster
(
TermStruct
* val);
149
void
ParseThruster
(
TermStruct
* val);
150
void
ParseNavlight
(
TermStruct
* val);
151
void
ParseFlightDeck
(
TermStruct
* val);
152
void
ParseLandingGear
(
TermStruct
* val);
153
void
ParseWeapon
(
TermStruct
* val);
154
void
ParseHardPoint
(
TermStruct
* val);
155
void
ParseSensor
(
TermStruct
* val);
156
void
ParseNavsys
(
TermStruct
* val);
157
void
ParseComputer
(
TermStruct
* val);
158
void
ParseShield
(
TermStruct
* val);
159
void
ParseDeathSpiral
(
TermStruct
* val);
160
void
ParseExplosion
(
TermStruct
* val,
int
index);
161
void
ParseDebris
(
TermStruct
* val,
int
index);
162
void
ParseLoadout
(
TermStruct
* val);
163
void
ParseMap
(
TermStruct
* val);
164
void
ParseSquadron
(
TermStruct
* val);
165
Skin
*
ParseSkin
(
TermStruct
* val);
166
void
ParseSkinMtl
(
TermStruct
* val,
Skin
* skin);
167
168
// general information:
169
const
char
*
DisplayName
()
const
;
170
171
char
filename
[64];
172
char
path_name
[64];
173
char
name
[64];
174
char
display_name
[64];
175
char
abrv
[16];
176
int
type
;
177
float
scale
;
178
int
auto_roll
;
179
bool
valid
;
180
bool
secret
;
// don't display in editor
181
Text
description
;
// background info for tactical reference
182
183
// LOD representation:
184
int
lod_levels
;
185
List<Model>
models
[4];
186
List<Point>
offsets
[4];
187
float
feature_size
[4];
188
List<Point>
spin_rates
;
189
190
// player selectable skins:
191
List<Skin>
skins
;
192
const
Skin
*
FindSkin
(
const
char
* skin_name)
const
;
193
194
// virtual cockpit:
195
Model
*
cockpit_model
;
196
float
cockpit_scale
;
197
198
// performance:
199
float
vlimit
;
200
float
agility
;
201
float
air_factor
;
202
float
roll_rate
;
203
float
pitch_rate
;
204
float
yaw_rate
;
205
float
trans_x
;
206
float
trans_y
;
207
float
trans_z
;
208
float
turn_bank
;
209
Vec3
chase_vec
;
210
Vec3
bridge_vec
;
211
Vec3
beauty_cam
;
212
213
float
prep_time
;
214
215
// physical data:
216
float
drag
,
roll_drag
,
pitch_drag
,
yaw_drag
;
217
float
arcade_drag
;
218
float
mass
,
integrity
,
radius
;
219
220
// aero data:
221
float
CL
,
CD
,
stall
;
222
223
// weapons:
224
int
primary
;
225
int
secondary
;
226
227
// drives:
228
int
main_drive
;
229
230
// visibility:
231
float
pcs
;
// passive sensor cross section
232
float
acs
;
// active sensor cross section
233
float
detet
;
// maximum detection range
234
float
e_factor
[3];
// pcs scaling by emcon setting
235
236
// ai settings:
237
float
avoid_time
;
238
float
avoid_fighter
;
239
float
avoid_strike
;
240
float
avoid_target
;
241
float
commit_range
;
242
243
// death spriral sequence:
244
float
death_spiral_time
;
245
float
explosion_scale
;
246
ShipExplosion
explosion
[
MAX_EXPLOSIONS
];
247
ShipDebris
debris
[
MAX_DEBRIS
];
248
249
List<PowerSource>
reactors
;
250
List<Weapon>
weapons
;
251
List<HardPoint>
hard_points
;
252
List<Drive>
drives
;
253
List<Computer>
computers
;
254
List<FlightDeck>
flight_decks
;
255
List<NavLight>
navlights
;
256
QuantumDrive
*
quantum_drive
;
257
Farcaster
*
farcaster
;
258
Thruster
*
thruster
;
259
Sensor
*
sensor
;
260
NavSystem
*
navsys
;
261
Shield
*
shield
;
262
Model
*
shield_model
;
263
Weapon
*
decoy
;
264
Weapon
*
probe
;
265
LandingGear
*
gear
;
266
267
float
splash_radius
;
268
float
scuttle
;
269
float
repair_speed
;
270
int
repair_teams
;
271
bool
repair_auto
;
272
bool
repair_screen
;
273
bool
wep_screen
;
274
275
Text
bolt_hit_sound
;
276
Text
beam_hit_sound
;
277
278
Sound
*
bolt_hit_sound_resource
;
279
Sound
*
beam_hit_sound_resource
;
280
281
List<ShipLoad>
loadouts
;
282
List<Bitmap>
map_sprites
;
283
List<ShipSquadron>
squadrons
;
284
285
Bitmap
beauty
;
286
Bitmap
hud_icon
;
287
};
288
289
// +--------------------------------------------------------------------+
290
291
#endif ShipDesign_h
292
Stars45
ShipDesign.h
Generated on Thu May 31 2012 16:31:16 for Starshatter_Open by
1.8.1