4b825dc642cb6eb9a060e54bf8d69288fbee490494a6641b73026d662261604d7d192beae70b11dc
 
 
1
#include "system.h"
 
 
2
#include "prototyp.h"
 
 
3
#include "stratdef.h"
 
 
4
#include "bh_types.h"
 
 
5
#include "lighting.h"
 
 
6
#include "userprofile.h"
 
 
7
#include "weapons.h"
 
 
8
#include "paintball.h"
 
 
9
#include "particle.h"
 
 
10
#include "generator.h"
 
 
11
#include "npc_xenoborg.h"
 
 
12
#include "npc_sentrygun.h"
 
 
13
#include "npc_facehugger.h"
 
 
14
#include "npc_predator.h"
 
 
15
#include "npc_alien.h"
 
 
16
#include "npc_marine.h"
 
 
17
#include "npc_queen.h"
 
 
18
#include "lighting.h"
 
 
19
#include "hud.h"
 
 
20
 
 
 
21
extern int FlyModeOn;
 
 
22
extern int show_console;
 
 
23
extern int sentrygun_reload_ammo;
 
 
24
extern int sentrygun_infinity_ammo;
 
 
25
extern int CloakingMode;
 
 
26
extern int DopplerShiftIsOn;
 
 
27
 
 
 
28
extern void RemoveAllDecals();
 
 
29
extern void check_preplaced_decal_modules();
 
 
30
extern void LoadAllWeapons();
 
 
31
extern void CastDummy(int type);
 
 
32
extern void Console_ZoneAlert(int input);
 
 
33
 
 
 
34
int CrouchIsToggleKey = 0;
 
 
35
int Observer = 0;
 
 
36
int CheaterCounter = 0;
 
 
37
 
 
 
38
void ActivateAllGenerators()
 
 
39
{
 
 
40
    int a = 0;
 
 
41
 
 
 
42
    for (; a < NumActiveStBlocks; a++)
 
 
43
    {
 
 
44
        STRATEGYBLOCK *candidate = ActiveStBlockList[a];
 
 
45
 
 
 
46
        if (candidate->type == I_BehaviourGenerator)
 
 
47
        {
 
 
48
            GENERATOR_BLOCK *genBlock = (GENERATOR_BLOCK *)candidate->dataptr;
 
 
49
            genBlock->Active = 1;
 
 
50
        }
 
 
51
    }
 
 
52
}
 
 
53
 
 
 
54
void KillAllVideoScreens()
 
 
55
{
 
 
56
    int a = 0;
 
 
57
 
 
 
58
    for (; a < NumActiveStBlocks; a++)
 
 
59
    {
 
 
60
        STRATEGYBLOCK *candidate = ActiveStBlockList[a];
 
 
61
 
 
 
62
        if (candidate->type == I_BehaviourVideoScreen)
 
 
63
            candidate->please_destroy_me = 1;
 
 
64
    }
 
 
65
}
 
 
66
 
 
 
67
void KillAllInanimates()
 
 
68
{
 
 
69
    int a = 0;
 
 
70
 
 
 
71
    for (; a < NumActiveStBlocks; a++)
 
 
72
    {
 
 
73
        STRATEGYBLOCK *candidate = ActiveStBlockList[a];
 
 
74
 
 
 
75
        if (candidate->type == I_BehaviourInanimateObject)
 
 
76
        {
 
 
77
            candidate->please_destroy_me = 1;
 
 
78
            if(candidate->name)
 
 
79
            puts(candidate->name);
 
 
80
        }
 
 
81
    }
 
 
82
}
 
 
83
 
 
 
84
void KillAllMarines()
 
 
85
{
 
 
86
    int a = 0;
 
 
87
 
 
 
88
    for (; a < NumActiveStBlocks; a++)
 
 
89
    {
 
 
90
        STRATEGYBLOCK *candidate = ActiveStBlockList[a];
 
 
91
 
 
 
92
        if (candidate->type == I_BehaviourMarine)
 
 
93
            CauseDamageToObject(candidate, &damage_profiles[CERTAINDEATH], ONE_FIXED, NULL);
 
 
94
    }
 
 
95
}
 
 
96
 
 
 
97
void KillAllAliens()
 
 
98
{
 
 
99
    int a = 0;
 
 
100
 
 
 
101
    for (; a < NumActiveStBlocks; a++)
 
 
102
    {
 
 
103
        STRATEGYBLOCK *candidate = ActiveStBlockList[a];
 
 
104
 
 
 
105
        if (candidate->type == I_BehaviourAlien)
 
 
106
            CauseDamageToObject(candidate, &damage_profiles[CERTAINDEATH], ONE_FIXED, NULL);
 
 
107
    }
 
 
108
}
 
 
109
 
 
 
110
void KillAllPreds()
 
 
111
{
 
 
112
    int a = 0;
 
 
113
 
 
 
114
    for (; a < NumActiveStBlocks; a++)
 
 
115
    {
 
 
116
        STRATEGYBLOCK *candidate = ActiveStBlockList[a];
 
 
117
 
 
 
118
        if (candidate->type == I_BehaviourPredator)
 
 
119
            CauseDamageToObject(candidate, &damage_profiles[CERTAINDEATH], ONE_FIXED, NULL);
 
 
120
    }
 
 
121
}
 
 
122
 
 
 
123
void KillAllDummies()
 
 
124
{
 
 
125
    int a = 0;
 
 
126
 
 
 
127
    for (; a < NumActiveStBlocks; a++)
 
 
128
    {
 
 
129
        STRATEGYBLOCK *candidate = ActiveStBlockList[a];
 
 
130
 
 
 
131
        if (candidate->type == I_BehaviourDummy)
 
 
132
            candidate->please_destroy_me = 1;
 
 
133
    }
 
 
134
}
 
 
135
 
 
 
136
void ToggleShapeRender()
 
 
137
{
 
 
138
    extern int Simplify_HModel_Rendering;
 
 
139
    Simplify_HModel_Rendering = ~Simplify_HModel_Rendering;
 
 
140
}
 
 
141
 
 
 
142
void GimmeCharge()
 
 
143
{
 
 
144
    if(I_Predator == AvP.PlayerType)
 
 
145
        PlayerStatus.FieldCharge = PLAYERCLOAK_MAXENERGY;
 
 
146
}
 
 
147
 
 
 
148
void GiveAllWeaponsCheat()
 
 
149
{
 
 
150
    switch(AvP.PlayerType)
 
 
151
    {
 
 
152
        case I_Marine:
 
 
153
        {
 
 
154
            int slot = MAX_NO_OF_WEAPON_SLOTS;
 
 
155
 
 
 
156
            while(slot--)
 
 
157
            {
 
 
158
                struct PLAYER_WEAPON_DATA *wdPtr = &PlayerStatus.WeaponSlot[slot];
 
 
159
 
 
 
160
                wdPtr->Possessed = 1;
 
 
161
 
 
 
162
                switch(wdPtr->WeaponIDNumber)
 
 
163
                {
 
 
164
                    case WEAPON_CUDGEL:
 
 
165
                        wdPtr->MagazinesRemaining = 0;
 
 
166
                    break;
 
 
167
                    case WEAPON_PULSERIFLE:
 
 
168
                        wdPtr->MagazinesRemaining = 50;
 
 
169
                        wdPtr->SecondaryRoundsRemaining = 99;
 
 
170
                    break;
 
 
171
                    case WEAPON_TWO_PISTOLS:
 
 
172
                        wdPtr->MagazinesRemaining = 100;
 
 
173
                    break;
 
 
174
                    case WEAPON_SMARTGUN:
 
 
175
                    case WEAPON_FLAMETHROWER:
 
 
176
                    case WEAPON_GRENADELAUNCHER:
 
 
177
                    case WEAPON_MINIGUN:
 
 
178
                    case WEAPON_MARINE_PISTOL:
 
 
179
                        wdPtr->MagazinesRemaining = 50;
 
 
180
                    break;
 
 
181
                    case WEAPON_FRISBEE_LAUNCHER:
 
 
182
                    case WEAPON_SADAR:
 
 
183
                        wdPtr->PrimaryRoundsRemaining = 50;
 
 
184
                    default:
 
 
185
                    break;
 
 
186
                }
 
 
187
            }
 
 
188
 
 
 
189
            GrenadeLauncherData.StandardMagazinesRemaining = 50;
 
 
190
            GrenadeLauncherData.ProximityMagazinesRemaining = 50;
 
 
191
            GrenadeLauncherData.FragmentationMagazinesRemaining = 50;
 
 
192
        }
 
 
193
        break;
 
 
194
        case I_Predator:
 
 
195
        {
 
 
196
            int slot = MAX_NO_OF_WEAPON_SLOTS;
 
 
197
 
 
 
198
            while(slot--)
 
 
199
            {
 
 
200
                struct PLAYER_WEAPON_DATA *wdPtr = &PlayerStatus.WeaponSlot[slot];
 
 
201
 
 
 
202
                if (wdPtr->WeaponIDNumber == NULL_WEAPON)
 
 
203
                    continue;
 
 
204
 
 
 
205
                wdPtr->Possessed = 1;
 
 
206
 
 
 
207
                switch(wdPtr->WeaponIDNumber)
 
 
208
                {
 
 
209
                    case WEAPON_PRED_RIFLE:
 
 
210
                        wdPtr->PrimaryRoundsRemaining = SPEARS_PER_PICKUP;
 
 
211
 
 
 
212
                    break;
 
 
213
                    case WEAPON_PRED_DISC:
 
 
214
                        wdPtr->PrimaryRoundsRemaining = 1;
 
 
215
 
 
 
216
                    default:
 
 
217
                    break;
 
 
218
                }
 
 
219
            }
 
 
220
        }
 
 
221
        break;
 
 
222
        default:
 
 
223
        return;
 
 
224
    }
 
 
225
 
 
 
226
LoadAllWeapons();
 
 
227
}
 
 
228
 
 
 
229
void Trip()
 
 
230
{
 
 
231
    if (CHEATMODE_TRIPTASTIC == UserProfile.active_bonus)
 
 
232
    {
 
 
233
        extern int TripTasticPhase;
 
 
234
        extern int CloakingPhase;
 
 
235
         int a = GetSin(CloakingPhase&4095);
 
 
236
         TripTasticPhase = MUL_FIXED(MUL_FIXED(a,a),128)+64;
 
 
237
    }
 
 
238
 
 
 
239
    if (CHEATMODE_JOHNWOO == UserProfile.active_bonus)
 
 
240
    {
 
 
241
        extern int TimeScale;
 
 
242
        TimeScaleThingy();
 
 
243
 
 
 
244
        PlayerStatus.LeanScale = ONE_FIXED;
 
 
245
 
 
 
246
        //in john woo mode leanscale is dependent on the TimeScale
 
 
247
        if (AvP.PlayerType == I_Alien)
 
 
248
            PlayerStatus.LeanScale *= 3;
 
 
249
 
 
 
250
        PlayerStatus.LeanScale += (ONE_FIXED-TimeScale) * 5;
 
 
251
    }
 
 
252
}
 
 
253
 
 
 
254
enum CONSOLE_COMMAND
 
 
255
{
 
 
256
    CSC_TOGGLEFIXEDDECALS = 0,
 
 
257
    CSC_CROUCHMODE,
 
 
258
    // rest is extra debug commands not enable by default
 
 
259
    CSC_TOGGLESHAPERENDER,
 
 
260
    CSC_CONSOLE_ZONEALERT,
 
 
261
    CSC_PAINTBALL,
 
 
262
    CSC_DOPPLERSHIFT,
 
 
263
    CSC_DEACTIVATEHIVE,
 
 
264
    CSC_ACTIVATEHIVE,
 
 
265
    CSC_ACTIVATEALLGENERATORS,
 
 
266
    CSC_KILLALLIVIDEOSCREENS,
 
 
267
    CSC_KILLALLINANIMATES,
 
 
268
    CSC_KILLALLMARINES,
 
 
269
    CSC_KILLALLALIENS,
 
 
270
    CSC_KILLALLPREDS,
 
 
271
    CSC_KILLALLDUMMIES,
 
 
272
    CSC_CHANGETOALIEN,
 
 
273
    CSC_CHANGETOMARINE,
 
 
274
    CSC_CHANGETOPREDATOR,
 
 
275
    CSC_OBSERVER,
 
 
276
        // yes you can complete level with debug but this will not enable any of the CHEATMODES
 
 
277
    CSC_COMPLETELEVEL,
 
 
278
    CSC_IMMORTAL,
 
 
279
    CSC_SENTRYGUNINFINITYAMMO,
 
 
280
    CSC_SENTRYGUNRELOAD,
 
 
281
    CSC_JETPACK,
 
 
282
    CSC_GRAPPLINGHOOK,
 
 
283
    CSC_LIGHT,
 
 
284
    CSC_GIMMECHARGE,
 
 
285
    CSC_GIVEALLWEAPONS,
 
 
286
    CSC_SENTRYGUN,
 
 
287
    CSC_ALIENBOT,
 
 
288
    CSC_MARINEBOT,
 
 
289
    CSC_PREDOBOT,
 
 
290
    CSC_DUMMY,
 
 
291
    CSC_DUMMYMARINE,
 
 
292
    CSC_DUMMYALIEN,
 
 
293
    CSC_DUMMYPREDATOR,
 
 
294
    CSC_PREDALIENBOT,
 
 
295
    CSC_PRAETORIANBOT,
 
 
296
    CSC_XENOBORGBOT,
 
 
297
    CSC_QUEENBOT,
 
 
298
    CSC_FACEHUGGERBOT,
 
 
299
 
 
 
300
    #ifdef AFRAID_OF_GROUND
 
 
301
    CSC_FLYMODE,
 
 
302
    #endif
 
 
303
    CSC_MAXCOMMANDS
 
 
304
};
 
 
305
 
 
 
306
struct console_command
 
 
307
{
 
 
308
    const char* command;
 
 
309
    enum CONSOLE_COMMAND what_now;
 
 
310
};
 
 
311
 
 
 
312
struct console_command console_commands[] =
 
 
313
{
 
 
314
    {"togglefixeddecals", CSC_TOGGLEFIXEDDECALS},
 
 
315
    {"crouchmode", CSC_CROUCHMODE},
 
 
316
    {"toggle shape render", CSC_TOGGLESHAPERENDER},
 
 
317
    {"console zone alert", CSC_CONSOLE_ZONEALERT},
 
 
318
    {"paintball", CSC_PAINTBALL},
 
 
319
    {"dopplershift", CSC_DOPPLERSHIFT},
 
 
320
    {"deactivate hive", CSC_DEACTIVATEHIVE},
 
 
321
    {"activate hive", CSC_ACTIVATEHIVE},
 
 
322
    {"activate all generators", CSC_ACTIVATEALLGENERATORS},
 
 
323
    {"kill all video screens", CSC_KILLALLIVIDEOSCREENS},
 
 
324
    {"kill all inanimates", CSC_KILLALLINANIMATES},
 
 
325
    {"kill all marines", CSC_KILLALLMARINES },
 
 
326
    {"kill all aliens", CSC_KILLALLALIENS},
 
 
327
    {"kill all predators", CSC_KILLALLPREDS},
 
 
328
    {"kill all dummies", CSC_KILLALLDUMMIES},
 
 
329
    {"changetoalien", CSC_CHANGETOALIEN},
 
 
330
    {"changetomarine", CSC_CHANGETOMARINE},
 
 
331
    {"changetopredator", CSC_CHANGETOPREDATOR},
 
 
332
    {"observer", CSC_OBSERVER},
 
 
333
    {"completelevel", CSC_COMPLETELEVEL},
 
 
334
    {"immortal", CSC_IMMORTAL},
 
 
335
    {"sentryguninfinityammo", CSC_SENTRYGUNINFINITYAMMO},
 
 
336
    {"sentrygunreload", CSC_SENTRYGUNRELOAD},
 
 
337
    {"jetpack", CSC_JETPACK},
 
 
338
    {"grapplinghook", CSC_GRAPPLINGHOOK},
 
 
339
    {"light", CSC_LIGHT},
 
 
340
    {"gimmecharge", CSC_GIMMECHARGE},
 
 
341
    {"giveallweapons", CSC_GIVEALLWEAPONS},
 
 
342
    {"sentrygun", CSC_SENTRYGUN},
 
 
343
    {"alienbot", CSC_ALIENBOT},
 
 
344
    {"marinebot", CSC_MARINEBOT},
 
 
345
    {"predobot", CSC_PREDOBOT},
 
 
346
    {"dummy", CSC_DUMMY},
 
 
347
    {"dummy marine", CSC_DUMMYMARINE},
 
 
348
    {"dummy alien", CSC_DUMMYALIEN},
 
 
349
    {"dummy predator", CSC_DUMMYPREDATOR},
 
 
350
    {"predalienbot", CSC_PREDALIENBOT},
 
 
351
    {"praetorianbot", CSC_PRAETORIANBOT},
 
 
352
    {"xenoborgbot", CSC_XENOBORGBOT},
 
 
353
    {"queenbot", CSC_QUEENBOT},
 
 
354
    {"facehuggerbot", CSC_FACEHUGGERBOT},
 
 
355
 
 
 
356
    #ifdef AFRAID_OF_GROUND
 
 
357
    {"flymode", CSC_FLYMODE},
 
 
358
    #endif
 
 
359
};
 
 
360
 
 
 
361
int current_console_pos = 0;
 
 
362
 
 
 
363
const char * next_console_command()
 
 
364
{
 
 
365
    if ( (current_console_pos > CSC_MAXCOMMANDS - 1) ||  (current_console_pos < 0) )
 
 
366
        current_console_pos = 0;
 
 
367
 
 
 
368
return console_commands[current_console_pos++].command;
 
 
369
}
 
 
370
 
 
 
371
const char * prev_console_command()
 
 
372
{
 
 
373
    if ( (current_console_pos < 0) || (current_console_pos > CSC_MAXCOMMANDS - 1) )
 
 
374
        current_console_pos = CSC_MAXCOMMANDS - 1;
 
 
375
 
 
 
376
return console_commands[current_console_pos--].command;
 
 
377
}
 
 
378
 
 
 
379
int exec_console_command(enum CONSOLE_COMMAND command)
 
 
380
{
 
 
381
    switch(command)
 
 
382
    {
 
 
383
        case CSC_TOGGLEFIXEDDECALS:
 
 
384
        {
 
 
385
            static int toogle = 0;
 
 
386
 
 
 
387
            if(toogle)
 
 
388
                check_preplaced_decal_modules();
 
 
389
            else
 
 
390
                RemoveAllDecals();
 
 
391
 
 
 
392
            toogle = !toogle;
 
 
393
        }
 
 
394
        break;
 
 
395
        case CSC_CROUCHMODE:
 
 
396
            CrouchIsToggleKey ^= 1;
 
 
397
        break;
 
 
398
        default:
 
 
399
        {
 
 
400
            //if(CHEATMODE_NONACTIVE != UserProfile.active_bonus)
 
 
401
            if(1)
 
 
402
            {
 
 
403
                switch(command)
 
 
404
                {
 
 
405
                    case CSC_PAINTBALL:
 
 
406
                        TogglePaintBallMode();
 
 
407
                    break;
 
 
408
                    case CSC_DOPPLERSHIFT:
 
 
409
                        DopplerShiftIsOn ^= 1;
 
 
410
                    break;
 
 
411
                    case CSC_DEACTIVATEHIVE:
 
 
412
                        DeActivateHive();
 
 
413
                    break;
 
 
414
                    case CSC_ACTIVATEHIVE:
 
 
415
                        ActivateHive();
 
 
416
                    break;
 
 
417
                    case CSC_ACTIVATEALLGENERATORS:
 
 
418
                        ActivateAllGenerators();
 
 
419
                    break;
 
 
420
                    case CSC_KILLALLIVIDEOSCREENS:
 
 
421
                        KillAllVideoScreens();
 
 
422
                    break;
 
 
423
                    case CSC_KILLALLINANIMATES:
 
 
424
                        KillAllInanimates();
 
 
425
                    break;
 
 
426
                    case CSC_KILLALLMARINES:
 
 
427
                        KillAllMarines();
 
 
428
                    break;
 
 
429
                    case CSC_KILLALLALIENS:
 
 
430
                        KillAllAliens();
 
 
431
                    break;
 
 
432
                    case CSC_KILLALLPREDS:
 
 
433
                        KillAllPreds();
 
 
434
                    break;
 
 
435
                    case CSC_KILLALLDUMMIES:
 
 
436
                        KillAllDummies();
 
 
437
                    break;
 
 
438
                    case CSC_TOGGLESHAPERENDER:
 
 
439
                        ToggleShapeRender();
 
 
440
                    break;
 
 
441
                    case CSC_CONSOLE_ZONEALERT:
 
 
442
                        Console_ZoneAlert(1);
 
 
443
                    break;
 
 
444
                    case CSC_GIVEALLWEAPONS:
 
 
445
                        GiveAllWeaponsCheat();
 
 
446
                        CheaterCounter = 10;
 
 
447
                    break;
 
 
448
                    case CSC_CHANGETOALIEN:
 
 
449
                        ChangeToAlien();
 
 
450
                    break;
 
 
451
                    case CSC_CHANGETOMARINE:
 
 
452
                        ChangeToMarine();
 
 
453
                    break;
 
 
454
                    case CSC_CHANGETOPREDATOR:
 
 
455
                        ChangeToPredator();
 
 
456
                    break;
 
 
457
                    case CSC_OBSERVER:
 
 
458
                        Observer = !Observer;
 
 
459
 
 
 
460
                        if (Observer)
 
 
461
                        {
 
 
462
                            //PlayerStatus.Hud = PlayerStatus.weapon_func = draw_no_hud;
 
 
463
                            PlayerStatus.Hud = draw_no_hud;
 
 
464
                        }
 
 
465
                        else
 
 
466
                        {
 
 
467
                            switch(AvP.PlayerType)
 
 
468
                            {
 
 
469
                                case I_Marine:
 
 
470
                                    PlayerStatus.Hud = marine_hud;
 
 
471
                                    PlayerStatus.weapon_func = maintain_marine_weapons;
 
 
472
                                break;
 
 
473
                                case I_Predator:
 
 
474
                                    PlayerStatus.Hud = predator_hud;
 
 
475
                                    PlayerStatus.weapon_func = maintain_predator_weapons;
 
 
476
                                break;
 
 
477
                                case I_Alien:
 
 
478
                                    PlayerStatus.Hud = alien_hud;
 
 
479
                                    PlayerStatus.weapon_func = maintain_alien_weapons;
 
 
480
                            }
 
 
481
                        }
 
 
482
 
 
 
483
                    break;
 
 
484
                    case CSC_COMPLETELEVEL:
 
 
485
                        if(SinglePlayer == AvP.PlayMode)
 
 
486
                        {
 
 
487
                            AvP.LevelCompleted = -1;
 
 
488
                            AvP.MainLoopRunning = 0;
 
 
489
                        }
 
 
490
                    break;
 
 
491
                    case CSC_IMMORTAL:
 
 
492
                        PlayerStatus.sbptr->DamageBlock.Indestructable ^= 1;
 
 
493
                    break;
 
 
494
                    case CSC_SENTRYGUNINFINITYAMMO:
 
 
495
                        sentrygun_infinity_ammo ^= 1;
 
 
496
                    break;
 
 
497
                    case CSC_SENTRYGUNRELOAD:
 
 
498
                        sentrygun_reload_ammo ^= 1;
 
 
499
                    break;
 
 
500
                    case CSC_JETPACK:
 
 
501
                        PlayerStatus.JetpackEnabled ^= 1;
 
 
502
                    break;
 
 
503
                    case CSC_GRAPPLINGHOOK:
 
 
504
                        PlayerStatus.GrapplingHookEnabled ^= 1;
 
 
505
                    break;
 
 
506
                    case CSC_LIGHT:
 
 
507
                        MakeLightElement(&PlayerStatus.DisplayBlock->ObWorld, LIGHTELEMENT_ROTATING);
 
 
508
                    break;
 
 
509
                    case CSC_GIMMECHARGE:
 
 
510
                        GimmeCharge();
 
 
511
                    break;
 
 
512
                    case CSC_SENTRYGUN:
 
 
513
                        CastSentrygunBot();
 
 
514
                    break;
 
 
515
                    case CSC_ALIENBOT:
 
 
516
                        CastAlienBot(0);
 
 
517
                    break;
 
 
518
                    case CSC_MARINEBOT:
 
 
519
                        //CastMarineBot(random() %15);
 
 
520
                        CastMarineBot(0);
 
 
521
                    break;
 
 
522
                    case CSC_PREDOBOT:
 
 
523
                        CastPredoBot();
 
 
524
                    break;
 
 
525
                    case CSC_DUMMY:
 
 
526
                        CastDummy(0);
 
 
527
                    break;
 
 
528
                    case CSC_DUMMYMARINE:
 
 
529
                        CastDummy(1);
 
 
530
                    break;
 
 
531
                    case CSC_DUMMYALIEN:
 
 
532
                        CastDummy(2);
 
 
533
                    break;
 
 
534
                    case CSC_DUMMYPREDATOR:
 
 
535
                        CastDummy(3);
 
 
536
                    break;
 
 
537
                    case CSC_PREDALIENBOT:
 
 
538
                        CastAlienBot(1);
 
 
539
                    break;
 
 
540
                    case CSC_PRAETORIANBOT:
 
 
541
                        CastAlienBot(2);
 
 
542
                    break;
 
 
543
                    case CSC_XENOBORGBOT:
 
 
544
                        CastXenoborgBot();
 
 
545
                    break;
 
 
546
                    case CSC_QUEENBOT:
 
 
547
                        CastQueenBot();
 
 
548
                    break;
 
 
549
                    case CSC_FACEHUGGERBOT:
 
 
550
                        CastFacehuggerBot();
 
 
551
                    break;
 
 
552
 
 
 
553
                #ifdef AFRAID_OF_GROUND
 
 
554
                    case CSC_FLYMODE:
 
 
555
                        FlyModeOn ^= 1;
 
 
556
                    break;
 
 
557
                #endif
 
 
558
                    default:
 
 
559
                    return 0;
 
 
560
                }
 
 
561
            }
 
 
562
            else
 
 
563
            {
 
 
564
                return 0;
 
 
565
            }
 
 
566
        }
 
 
567
    }
 
 
568
 
 
 
569
return 1;
 
 
570
}
 
 
571
 
 
 
572
int parse_and_exec_console_command(const char * command)
 
 
573
{
 
 
574
    int i = 0;
 
 
575
 
 
 
576
    for (; i < CSC_MAXCOMMANDS; i++)
 
 
577
    {
 
 
578
        if (!strcmp(console_commands[i].command, command))
 
 
579
            return exec_console_command(console_commands[i].what_now);
 
 
580
    }
 
 
581
 
 
 
582
return 0;
 
 
583
}