-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUSLCVP.bos
328 lines (288 loc) · 5.94 KB
/
USLCVP.bos
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
#define TAK
piece base, hull, ramp, turret, grabber, link,
mount1, sleeve1, gun1, flare1, mount2, sleeve2, gun2, flare2,
wake1, wake2, wake3;
#define BASE_SMOKE_PERIOD 40
#define MIN_SMOKE_PERIOD 240
//********************Guns
#define MG_TURN_SPEED <45>
#define MG_PITCH_SPEED <45>
//********************Ramp
#define RAMP_OPEN_ANGLE <90>
#define RAMP_OPEN_SPEED <30>
#define LOAD_DIST [125]
#define SIG_DEATH 1
#define SIG_MOVE 2
#define SIG_LOAD 4
#define SIG_AIM1 8
#define SIG_AIM2 16
#define SMOKEPIECE hull
//effects
#define placeholder_EFFECT01 1024+1
#define placeholder_EFFECT02 1024+2
#define placeholder_EFFECT03 1024+3
#define placeholder_EFFECT04 1024+4
#define placeholder_EFFECT05 1024+5
#define placeholder_EFFECT06 1024+6
#define MG_MUZZLEFLASH 1024+7
#define SMALL_MUZZLEFLASH 1024+8
#define SMALL_MUZZLEDUST 1024+9
// tracers
#define SMALL_TRACER 2048+2
#include "exptype.h"
#include "sfxtype.h"
#include "damageSmoke.h"
static-var MaxSpeed, bRampOpen, bMoving, bTooFar, boom_len, boom_heading, boom_pitch;
WorkingLoop()
{
while(TRUE)
{
if(bMoving)
{
// engine smoke comes here. And engine sound.
sleep 500;
}
sleep 500;
}
}
WaitForConstructionToFinish()
{
while(get BUILD_PERCENT_LEFT)
{
sleep 150;
}
}
HideFlares()
{
hide flare1;
hide flare2;
}
Create()
{
start-script HideFlares();
bMoving = FALSE;
MaxSpeed = get MAX_SPEED;
call-script WaitForConstructionToFinish();
start-script DamageSmoke();
start-script WorkingLoop();
}
OpenRamp()
{
var newSpeed;
// we are opening the ramp, let's slow down (else we'll have the hold full of water)
newSpeed = MaxSpeed/10;
set MAX_SPEED to newSpeed;
turn ramp to x-axis RAMP_OPEN_ANGLE speed RAMP_OPEN_SPEED;
wait-for-turn ramp around x-axis;
bRampOpen = TRUE;
return;
}
CloseRamp()
{
bRampOpen = FALSE;
turn ramp to x-axis 0 speed RAMP_OPEN_SPEED;
wait-for-turn ramp around x-axis;
// now the ramp is closed, we can go full speed again
set MAX_SPEED to MaxSpeed;
return;
}
//Transport stuff
BoomCalc(posxz,posy)
{
var dxz,dy,lenxz;
dxz = get PIECE_XZ(turret) - posxz;
dy = posy - get PIECE_Y(turret);
lenxz = get XZ_HYPOT(dxz);
boom_len = get HYPOT(lenxz,dy);
boom_heading = get XZ_ATAN(dxz);
boom_pitch = get ATAN(dy,lenxz);
bTooFar = (boom_len > LOAD_DIST);
}
PositionLink(posxz,posy)
{
turn turret to y-axis boom_heading now;
turn grabber to x-axis 0-boom_pitch now;
move grabber to z-axis boom_len now;
}
ReturnLink()
{
turn turret to y-axis <0> now;
turn grabber to x-axis <0> now;
move grabber to z-axis [0] now;
}
TransportPickup(unitid)
{
signal SIG_LOAD;
set-signal-mask SIG_LOAD;
call-script BoomCalc(get UNIT_XZ(unitid),get UNIT_Y(unitid));
if( bTooFar )
{
return (FALSE);
}
call-script OpenRamp();
while (!bRampOpen)
{
sleep 250;
}
set BUSY to 1;
attach-unit unitid to (0-1);
//sleep 500;
sleep 50;
set BUSY to 0;
sleep 2500;
start-script CloseRamp();
}
TransportDrop(unitid, position)
{
signal SIG_LOAD;
set-signal-mask SIG_LOAD;
call-script BoomCalc(position,get GROUND_HEIGHT(position));
if( bTooFar )
{
return (1);
}
call-script OpenRamp();
while (!bRampOpen)
{
sleep 250;
}
set BUSY to 1;
attach-unit unitid to link;
call-script PositionLink();
sleep 50;
drop-unit unitid;
call-script ReturnLink();
//sleep 1000;
sleep 50;
set BUSY to 0;
sleep 1500;
start-script CloseRamp();
}
SweetSpot(piecenum)
{
piecenum = hull;
}
EmitWakes()
{
set-signal-mask SIG_MOVE|SIG_DEATH;
while( TRUE )
{
emit-sfx 2 from wake1;
emit-sfx 2 from wake2;
emit-sfx 2 from wake3;
sleep 300;
}
}
StopMoving()
{
signal SIG_MOVE;
set-signal-mask SIG_MOVE;
// We don't want this to trigger on VERY short stops
sleep 300;
bMoving = FALSE;
}
StopCatcher()
{
var newXZ, oldXZ, newHeading, oldHeading;
set-signal-mask SIG_MOVE|SIG_DEATH;
while(TRUE)
{
sleep 300;
newXZ = get PIECE_XZ(base);
newHeading = get HEADING;
if((oldXZ == newXZ) && (oldHeading == newHeading))
{
call-script StopMoving();
}
oldXZ = newXZ;
oldHeading = newHeading;
}
}
StartMoving()
{
signal SIG_MOVE;
start-script EmitWakes();
start-script StopCatcher();
bMoving = TRUE;
}
RestoreTurrets()
{
set-signal-mask SIG_DEATH|SIG_AIM1|SIG_AIM2;
sleep 2500;
turn mount1 to y-axis 0 speed MG_TURN_SPEED;
turn mount2 to y-axis 0 speed MG_TURN_SPEED;
turn sleeve1 to x-axis 0 speed MG_TURN_SPEED;
turn sleeve2 to x-axis 0 speed MG_TURN_SPEED;
}
QueryWeapon1(piecenum)
{
piecenum = flare1;
}
AimFromWeapon1(piecenum)
{
piecenum = mount1;
}
AimWeapon1(heading, pitch)
{
signal SIG_AIM1;
set-signal-mask SIG_AIM1;
turn mount1 to y-axis heading speed MG_TURN_SPEED;
turn gun1 to x-axis (0-pitch) speed MG_PITCH_SPEED;
wait-for-turn mount1 around y-axis;
wait-for-turn gun1 around x-axis;
start-script RestoreTurrets();
return TRUE;
}
FireWeapon1()
{
/* show flare1;
sleep 200;
hide flare1;*/
}
Shot1(foo)
{
emit-sfx SMALL_TRACER from flare1;
emit-sfx MG_MUZZLEFLASH from flare1;
}
QueryWeapon2(piecenum)
{
piecenum = flare2;
}
AimFromWeapon2(piecenum)
{
piecenum = mount2;
}
AimWeapon2(heading, pitch)
{
signal SIG_AIM2;
set-signal-mask SIG_AIM2;
turn mount2 to y-axis heading speed MG_TURN_SPEED;
turn gun2 to x-axis (0-pitch) speed MG_PITCH_SPEED;
wait-for-turn mount2 around y-axis;
wait-for-turn gun2 around x-axis;
start-script RestoreTurrets();
return TRUE;
}
FireWeapon2()
{
/* show flare2;
sleep 200;
hide flare2;*/
}
Shot2(foo)
{
emit-sfx SMALL_TRACER from flare2;
emit-sfx MG_MUZZLEFLASH from flare2;
}
Killed(severity, corpsetype)
{
signal SIG_DEATH;
if (severity<50)
{
corpsetype = 1;
return (TRUE);
}
corpsetype = 2;
explode hull type SHATTER|BITMAP1;
return (TRUE);
}