Starshatter_Open
Open source Starshatter engine
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
MissionEvent.h
Go to the documentation of this file.
1
/* Project Starshatter 4.5
2
Destroyer Studios LLC
3
Copyright © 1997-2004. All Rights Reserved.
4
5
SUBSYSTEM: Stars.exe
6
FILE: MissionEvent.h
7
AUTHOR: John DiCamillo
8
9
10
OVERVIEW
11
========
12
Events for mission scripting
13
*/
14
15
#ifndef MissionEvent_h
16
#define MissionEvent_h
17
18
#include "
Types.h
"
19
#include "
List.h
"
20
#include "
Text.h
"
21
#include "
Geometry.h
"
22
#include "
Bitmap.h
"
23
24
// +--------------------------------------------------------------------+
25
26
class
Mission
;
27
class
MissionElement
;
28
class
MissionLoad
;
29
class
MissionEvent
;
30
31
class
Ship
;
32
class
System
;
33
class
Element
;
34
class
ShipDesign
;
35
class
WeaponDesign
;
36
class
StarSystem
;
37
class
Instruction
;
38
class
Sound
;
39
40
// +--------------------------------------------------------------------+
41
42
class
MissionEvent
43
{
44
friend
class
Mission
;
45
friend
class
MissionTemplate
;
46
friend
class
MsnEditDlg
;
47
friend
class
MsnEventDlg
;
48
49
public
:
50
static
const
char
*
TYPENAME
() {
return
"MissionEvent"
; }
51
52
enum
EVENT_TYPE
{
53
MESSAGE
,
54
OBJECTIVE
,
55
INSTRUCTION
,
56
IFF
,
57
DAMAGE
,
58
JUMP
,
59
HOLD
,
60
SKIP
,
61
END_MISSION
,
62
63
BEGIN_SCENE
,
64
CAMERA
,
65
VOLUME
,
66
DISPLAY
,
67
FIRE_WEAPON
,
68
END_SCENE
,
69
70
NUM_EVENTS
71
};
72
73
enum
EVENT_STATUS
{
74
PENDING
,
ACTIVE
,
COMPLETE
,
SKIPPED
75
};
76
77
enum
EVENT_TRIGGER
{
78
TRIGGER_TIME
,
TRIGGER_DAMAGE
,
TRIGGER_DESTROYED
,
79
TRIGGER_JUMP
,
TRIGGER_LAUNCH
,
TRIGGER_DOCK
,
80
TRIGGER_NAVPT
,
TRIGGER_EVENT
,
TRIGGER_SKIPPED
,
81
TRIGGER_TARGET
,
TRIGGER_SHIPS_LEFT
,
TRIGGER_DETECT
,
82
TRIGGER_RANGE
,
TRIGGER_EVENT_ALL
,
TRIGGER_EVENT_ANY
,
83
NUM_TRIGGERS
84
};
85
86
MissionEvent
();
87
~MissionEvent
();
88
89
// operations:
90
void
ExecFrame
(
double
seconds);
91
void
Activate
();
92
93
virtual
bool
CheckTrigger
();
94
virtual
void
Execute
(
bool
silent=
false
);
95
virtual
void
Skip
();
96
97
// accessors:
98
int
EventID
()
const
{
return
id
; }
99
int
Status
()
const
{
return
status
; }
100
bool
IsPending
()
const
{
return
status
==
PENDING
; }
101
bool
IsActive
()
const
{
return
status
==
ACTIVE
; }
102
bool
IsComplete
()
const
{
return
status
==
COMPLETE
; }
103
bool
IsSkipped
()
const
{
return
status
==
SKIPPED
; }
104
105
double
Time
()
const
{
return
time
; }
106
double
Delay
()
const
{
return
delay
; }
107
108
int
Event
()
const
{
return
event
; }
109
const
char
*
EventName
()
const
;
110
Text
EventShip
()
const
{
return
event_ship
; }
111
Text
EventSource
()
const
{
return
event_source
; }
112
Text
EventTarget
()
const
{
return
event_target
; }
113
Text
EventMessage
()
const
{
return
event_message
; }
114
Text
EventSound
()
const
{
return
event_sound
; }
115
116
int
EventParam
(
int
index=0)
const
;
117
int
NumEventParams
()
const
;
118
119
int
EventChance
()
const
{
return
event_chance
; }
120
Point
EventPoint
()
const
{
return
event_point
; }
121
Rect
EventRect
()
const
{
return
event_rect
; }
122
123
int
Trigger
()
const
{
return
trigger
; }
124
const
char
*
TriggerName
()
const
;
125
Text
TriggerShip
()
const
{
return
trigger_ship
; }
126
Text
TriggerTarget
()
const
{
return
trigger_target
; }
127
128
Text
TriggerParamStr
()
const
;
129
int
TriggerParam
(
int
index=0)
const
;
130
int
NumTriggerParams
()
const
;
131
132
static
const
char
*
EventName
(
int
n);
133
static
int
EventForName
(
const
char
* n);
134
static
const
char
*
TriggerName
(
int
n);
135
static
int
TriggerForName
(
const
char
* n);
136
137
protected
:
138
int
id
;
139
int
status
;
140
double
time
;
141
double
delay
;
142
143
int
event
;
144
Text
event_ship
;
145
Text
event_source
;
146
Text
event_target
;
147
Text
event_message
;
148
Text
event_sound
;
149
int
event_param
[10];
150
int
event_nparams
;
151
int
event_chance
;
152
Vec3
event_point
;
153
Rect
event_rect
;
154
155
int
trigger
;
156
Text
trigger_ship
;
157
Text
trigger_target
;
158
int
trigger_param
[10];
159
int
trigger_nparams
;
160
161
Bitmap
image
;
162
Sound
*
sound
;
163
};
164
165
166
#endif MissionEvent_h
167
Stars45
MissionEvent.h
Generated on Thu May 31 2012 16:31:10 for Starshatter_Open by
1.8.1