Wikia

Duke Nukem Wiki

Con files/Files

Talk0
736pages on
this wiki

< Con files

DEFS.CON (v1.5)
/*
--------------------------------------------------------------------------------
Duke Nukem 3D Version 1.4
By Todd Replogle
(c) 1996 3D Realms Entertainment
--------------------------------------------------------------------------------
*/

define SECTOREFFECTOR 1
define ACTIVATOR 2
define TOUCHPLATE 3
define ACTIVATORLOCKED 4
define MUSICANDSFX 5
define LOCATORS 6
define CYCLER 7
define MASTERSWITCH 8
define RESPAWN 9
define GPSPEED 10
define ARROW 20
define FIRSTGUNSPRITE 21
define CHAINGUNSPRITE 22
define RPGSPRITE 23
define FREEZESPRITE 24
define SHRINKERSPRITE 25
define HEAVYHBOMB 26
define TRIPBOMBSPRITE 27
define SHOTGUNSPRITE 28
define DEVISTATORSPRITE 29
define HEALTHBOX 30
define AMMOBOX 31
define GROWSPRITEICON 32
define INVENTORYBOX 33
define FREEZEAMMO 37
define AMMO 40
define BATTERYAMMO 41
define DEVISTATORAMMO 42
define RPGAMMO 44
define GROWAMMO 45
define CRYSTALAMMO 46
define HBOMBAMMO 47
define AMMOLOTS 48
define SHOTGUNAMMO 49
define COLA 51
define SIXPAK 52
define FIRSTAID 53
define SHIELD 54
define STEROIDS 55
define AIRTANK 56
define JETPACK 57
define HEATSENSOR 59
define ACCESSCARD 60
define BOOTS 61
define MIRRORBROKE 70
define CLOUDYOCEAN 78
define CLOUDYSKIES 79
define MOONSKY1 80
define MOONSKY2 81
define MOONSKY3 82
define MOONSKY4 83
define BIGORBIT1 84
define BIGORBIT2 85
define BIGORBIT3 86
define BIGORBIT4 87
define BIGORBIT5 88
define LA 89
define REDSKY1 98
define REDSKY2 99
define ATOMICHEALTH 100
define TECHLIGHT2 120
define TECHLIGHTBUST2 121
define TECHLIGHT4 122
define TECHLIGHTBUST4 123
define WALLLIGHT4 124
define WALLLIGHTBUST4 125
define ACCESSSWITCH 130
define SLOTDOOR 132
define LIGHTSWITCH 134
define SPACEDOORSWITCH 136
define SPACELIGHTSWITCH 138
define FRANKENSTINESWITCH 140
define NUKEBUTTON 142
define MULTISWITCH 146
define DOORTILE5 150
define DOORTILE6 151
define DOORTILE1 152
define DOORTILE2 153
define DOORTILE3 154
define DOORTILE4 155
define DOORTILE7 156
define DOORTILE8 157
define DOORTILE9 158
define DOORTILE10 159
define DOORSHOCK 160
define DIPSWITCH 162
define DIPSWITCH2 164
define TECHSWITCH 166
define DIPSWITCH3 168
define ACCESSSWITCH2 170
define REFLECTWATERTILE 180
define FLOORSLIME 200
define BIGFORCE 230
define EPISODE 247
define MASKWALL9 255
define W_LIGHT 260
define SCREENBREAK1 263
define SCREENBREAK2 264
define SCREENBREAK3 265
define SCREENBREAK4 266
define SCREENBREAK5 267
define SCREENBREAK6 268
define SCREENBREAK7 269
define SCREENBREAK8 270
define SCREENBREAK9 271
define SCREENBREAK10 272
define SCREENBREAK11 273
define SCREENBREAK12 274
define SCREENBREAK13 275
define MASKWALL1 285
define W_TECHWALL1 293
define W_TECHWALL2 297
define W_TECHWALL15 299
define W_TECHWALL3 301
define W_TECHWALL4 305
define W_TECHWALL10 306
define W_TECHWALL16 307
define WATERTILE2 336
define BPANNEL1 341
define PANNEL1 342
define PANNEL2 343
define WATERTILE 344
define STATIC 351
define W_SCREENBREAK 357
define W_HITTECHWALL3 360
define W_HITTECHWALL4 361
define W_HITTECHWALL2 362
define W_HITTECHWALL1 363
define MASKWALL10 387
define MASKWALL11 391
define DOORTILE22 395
define FANSPRITE 407
define FANSPRITEBROKE 411
define FANSHADOW 412
define FANSHADOWBROKE 416
define DOORTILE18 447
define DOORTILE19 448
define DOORTILE20 449
// define SPACESHUTTLE 487
define SATELLITE 489
define VIEWSCREEN2 499
define VIEWSCREENBROKE 501
define VIEWSCREEN 502
define GLASS 503
define GLASS2 504
define STAINGLASS1 510
define MASKWALL5 514
define SATELITE 516
define FUELPOD 517
define SLIMEPIPE 538
define CRACK1 546
define CRACK2 547
define CRACK3 548
define CRACK4 549
define FOOTPRINTS 550
define DOMELITE 551
define CAMERAPOLE 554
define CHAIR1 556
define CHAIR2 557
define BROKENCHAIR 559
define MIRROR 560
define WATERFOUNTAIN 563
define WATERFOUNTAINBROKE 567
define FEMMAG1 568
define TOILET 569
define STALL 571
define STALLBROKE 573
define FEMMAG2 577
define REACTOR2 578
define REACTOR2BURNT 579
define REACTOR2SPARK 580
define GRATE1 595
define BGRATE1 596
define SOLARPANNEL 602
define NAKED1 603
define ANTENNA 607
define MASKWALL12 609
define TOILETBROKE 615
define PIPE2 616
define PIPE1B 617
define PIPE3 618
define PIPE1 619
define CAMERA1 621
define BRICK 626
define SPLINTERWOOD 630
define PIPE2B 633
define BOLT1 634
define W_NUMBERS 640
define WATERDRIP 660
define WATERBUBBLE 661
define WATERBUBBLEMAKER 662
define W_FORCEFIELD 663
define VACUUM 669
define FOOTPRINTS2 672
define FOOTPRINTS3 673
define FOOTPRINTS4 674
define EGG 675
define SCALE 678
define CHAIR3 680
define CAMERALIGHT 685
define MOVIECAMERA 686
define IVUNIT 689
define POT1 694
define POT2 695
define POT3 697
define PIPE3B 700
define WALLLIGHT3 701
define WALLLIGHTBUST3 702
define WALLLIGHT1 703
define WALLLIGHTBUST1 704
define WALLLIGHT2 705
define WALLLIGHTBUST2 706
define LIGHTSWITCH2 712
define WAITTOBESEATED 716
define DOORTILE14 717
define STATUE 753
define MIKE 762
define VASE 765
define SUSHIPLATE1 768
define SUSHIPLATE2 769
define SUSHIPLATE3 774
define SUSHIPLATE4 779
define DOORTILE16 781
define SUSHIPLATE5 792
define OJ 806
define MASKWALL13 830
define HURTRAIL 859
define POWERSWITCH1 860
define LOCKSWITCH1 862
define POWERSWITCH2 864
define ATM 867
define STATUEFLASH 869
define ATMBROKE 888
define BIGHOLE2 893
define STRIPEBALL 901
define QUEBALL 902
define POCKET 903
define WOODENHORSE 904
define TREE1 908
define TREE2 910
define CACTUS 911
define MASKWALL2 913
define MASKWALL3 914
define MASKWALL4 915
define FIREEXT 916
define TOILETWATER 921
define NEON1 925
define NEON2 926
define CACTUSBROKE 939
define BOUNCEMINE 940
define BROKEFIREHYDRENT 950
define BOX 951
define BULLETHOLE 952
define BOTTLE1 954
define BOTTLE2 955
define BOTTLE3 956
define BOTTLE4 957
define FEMPIC5 963
define FEMPIC6 964
define FEMPIC7 965
define HYDROPLANT 969
define OCEANSPRITE1 971
define OCEANSPRITE2 972
define OCEANSPRITE3 973
define OCEANSPRITE4 974
define OCEANSPRITE5 975
define GENERICPOLE 977
define CONE 978
define HANGLIGHT 979
define HYDRENT 981
define MASKWALL14 988
define TIRE 990
define PIPE5 994
define PIPE6 995
define PIPE4 996
define PIPE4B 997
define BROKEHYDROPLANT 1003
define PIPE5B 1005
define NEON3 1007
define NEON4 1008
define NEON5 1009
define BOTTLE5 1012
define BOTTLE6 1013
define BOTTLE8 1014
define SPOTLITE 1020
define HANGOOZ 1022
define MASKWALL15 1024
define BOTTLE7 1025
define HORSEONSIDE 1026
define GLASSPIECES 1031
define HORSELITE 1034
define DONUTS 1045
define NEON6 1046
define MASKWALL6 1059
define CLOCK 1060
define RUBBERCAN 1062
define BROKENCLOCK 1067
define PLUG 1069
define OOZFILTER 1079
define FLOORPLASMA 1082
define REACTOR 1088
define REACTORSPARK 1092
define REACTORBURNT 1096
define DOORTILE15 1102
define HANDSWITCH 1111
define CIRCLEPANNEL 1113
define CIRCLEPANNELBROKE 1114
define PULLSWITCH 1122
define MASKWALL8 1124
define BIGHOLE 1141
define ALIENSWITCH 1142
define DOORTILE21 1144
define HANDPRINTSWITCH 1155
define BOTTLE10 1157
define BOTTLE11 1158
define BOTTLE12 1159
define BOTTLE13 1160
define BOTTLE14 1161
define BOTTLE15 1162
define BOTTLE16 1163
define BOTTLE17 1164
define BOTTLE18 1165
define BOTTLE19 1166
define DOORTILE17 1169
define MASKWALL7 1174
define JAILBARBREAK 1175
define DOORTILE11 1178
define DOORTILE12 1179
define VENDMACHINE 1212
define VENDMACHINEBROKE 1214
define COLAMACHINE 1215
define COLAMACHINEBROKE 1217
define CRANEPOLE 1221
define CRANE 1222
define BARBROKE 1225
define BLOODPOOL 1226
define NUKEBARREL 1227
define NUKEBARRELDENTED 1228
define NUKEBARRELLEAKED 1229
define CANWITHSOMETHING 1232
define MONEY 1233
define BANNER 1236
define EXPLODINGBARREL 1238
define EXPLODINGBARREL2 1239
define FIREBARREL 1240
define SEENINE 1247
define SEENINEDEAD 1248
define STEAM 1250
define CEILINGSTEAM 1255
define PIPE6B 1260
define TRANSPORTERBEAM 1261
define RAT 1267
define TRASH 1272
define FEMPIC1 1280
define FEMPIC2 1289
define BLANKSCREEN 1293
define PODFEM1 1294
define FEMPIC3 1298
define FEMPIC4 1306
define FEM1 1312
define FEM2 1317
define FEM3 1321
define FEM5 1323
define BLOODYPOLE 1324
define FEM4 1325
define FEM6 1334
define FEM6PAD 1335
define FEM8 1336
define HELECOPT 1346
define FETUSJIB 1347
define HOLODUKE 1348
define SPACEMARINE 1353
define INDY 1355
define FETUS 1358
define FETUSBROKE 1359
define MONK 1352
define LUKE 1354
define COOLEXPLOSION1 1360
define WATERSPLASH2 1380
define FIREVASE 1390
define SCRATCH 1393
define FEM7 1395
define APLAYERTOP 1400
define APLAYER 1405
define PLAYERONWATER 1420
define DUKELYINGDEAD 1518
define DUKETORSO 1520
define DUKEGUN 1528
define DUKELEG 1536
define SHARK 1550
define BLOOD 1620
define FIRELASER 1625
define TRANSPORTERSTAR 1630
define SPIT 1636
define LOOGIE 1637
define FIST 1640
define FREEZEBLAST 1641
define DEVISTATORBLAST 1642
define SHRINKSPARK 1646
define TONGUE 1647
define MORTER 1650
define SHRINKEREXPLOSION 1656
define RADIUSEXPLOSION 1670
define FORCERIPPLE 1671
define LIZTROOP 1680
define LIZTROOPRUNNING 1681
define LIZTROOPSTAYPUT 1682
define LIZTOP 1705
define LIZTROOPSHOOT 1715
define LIZTROOPJETPACK 1725
define LIZTROOPDSPRITE 1734
define LIZTROOPONTOILET 1741
define LIZTROOPJUSTSIT 1742
define LIZTROOPDUCKING 1744
define HEADJIB1 1768
define ARMJIB1 1772
define LEGJIB1 1776
define CANNONBALL 1817
define OCTABRAIN 1820
define OCTABRAINSTAYPUT 1821
define OCTATOP 1845
define OCTADEADSPRITE 1855
define INNERJAW 1860
define DRONE 1880
define EXPLOSION2 1890
define COMMANDER 1920
define COMMANDERSTAYPUT 1921
define RECON 1960
define TANK 1975
define PIGCOP 2000
define PIGCOPSTAYPUT 2001
define PIGCOPDIVE 2045
define PIGCOPDEADSPRITE 2060
define PIGTOP 2061
define LIZMAN 2120
define LIZMANSTAYPUT 2121
define LIZMANSPITTING 2150
define LIZMANFEEDING 2160
define LIZMANJUMP 2165
define LIZMANDEADSPRITE 2185
define FECES 2200
define LIZMANHEAD1 2201
define LIZMANARM1 2205
define LIZMANLEG1 2209
define EXPLOSION2BOT 2219
define USERWEAPON 2235
define HEADERBAR 2242
define JIBS1 2245
define JIBS2 2250
define JIBS3 2255
define JIBS4 2260
define JIBS5 2265
define BURNING 2270
define FIRE 2271
define JIBS6 2286
define BLOODSPLAT1 2296
define BLOODSPLAT3 2297
define BLOODSPLAT2 2298
define BLOODSPLAT4 2299
define OOZ 2300
define OOZ2 2309
define WALLBLOOD1 2301
define WALLBLOOD2 2302
define WALLBLOOD3 2303
define WALLBLOOD4 2304
define WALLBLOOD5 2305
define WALLBLOOD6 2306
define WALLBLOOD7 2307
define WALLBLOOD8 2308
define BURNING2 2310
define FIRE2 2311
define CRACKKNUCKLES 2324
define SMALLSMOKE 2329
define SMALLSMOKEMAKER 2330
define FLOORFLAME 2333
define ROTATEGUN 2360
define GREENSLIME 2370
define WATERDRIPSPLASH 2380
define SCRAP6 2390
define SCRAP1 2400
define SCRAP2 2404
define SCRAP3 2408
define SCRAP4 2412
define SCRAP5 2416
define ORGANTIC 2420
define BETAVERSION 2440
define PLAYERISHERE 2442
define PLAYERWASHERE 2443
define SELECTDIR 2444
define F1HELP 2445
define NOTCHON 2446
define NOTCHOFF 2447
define GROWSPARK 2448
define DUKEICON 2452
define BADGUYICON 2453
define FOODICON 2454
define GETICON 2455
define MENUSCREEN 2456
define MENUBAR 2457
define KILLSICON 2458
define FIRSTAID_ICON 2460
define HEAT_ICON 2461
define BOTTOMSTATUSBAR 2462
define BOOT_ICON 2463
define FRAGBAR 2465
define JETPACK_ICON 2467
define AIRTANK_ICON 2468
define STEROIDS_ICON 2469
define HOLODUKE_ICON 2470
define ACCESS_ICON 2471
define DIGITALNUM 2472
define DUKECAR 2491
define CAMCORNER 2482
define CAMLIGHT 2484
define LOGO 2485
define TITLE 2486
define NUKEWARNINGICON 2487
define MOUSECURSOR 2488
define SLIDEBAR 2489
define DREALMS 2492
define BETASCREEN 2493
define WINDOWBORDER1 2494
define TEXTBOX 2495
define WINDOWBORDER2 2496
define DUKENUKEM 2497
define THREEDEE 2498
define INGAMEDUKETHREEDEE 2499
define TENSCREEN 2500
define PLUTOPAKSPRITE 2501
define DEVISTATOR 2510
define KNEE 2521
define CROSSHAIR 2523
define FIRSTGUN 2524
define FIRSTGUNRELOAD 2528
define FALLINGCLIP 2530
define CLIPINHAND 2531
define HAND 2532
define SHELL 2533
define SHOTGUNSHELL 2535
define CHAINGUN 2536
define RPGGUN 2544
define RPGMUZZLEFLASH 2545
define FREEZE 2548
define CATLITE 2552
define SHRINKER 2556
define HANDHOLDINGLASER 2563
define TRIPBOMB 2566
define LASERLINE 2567
define HANDHOLDINGACCESS 2568
define HANDREMOTE 2570
define HANDTHROW 2573
define TIP 2576
define GLAIR 2578
define SCUBAMASK 2581
define SPACEMASK 2584
define FORCESPHERE 2590
define SHOTSPARK1 2595
define RPG 2605
define LASERSITE 2612
define SHOTGUN 2613
define BOSS1 2630
define BOSS1STAYPUT 2631
define BOSS1SHOOT 2660
define BOSS1LOB 2670
define BOSSTOP 2696
define BOSS2 2710
define BOSS3 2760
define SPINNINGNUKEICON 2813
define BIGFNTCURSOR 2820
define SMALLFNTCURSOR 2821
define STARTALPHANUM 2822
define ENDALPHANUM 2915
define BIGALPHANUM 2940
define BIGPERIOD 3002
define BIGCOMMA 3003
define BIGX 3004
define BIGQ 3005
define BIGSEMI 3006
define BIGCOLIN 3007
define THREEBYFIVE 3010
define BIGAPPOS 3022
define BLANK 3026
define MINIFONT 3072
define BUTTON1 3164
define GLASS3 3187
define RESPAWNMARKERRED 3190
define RESPAWNMARKERYELLOW 3200
define RESPAWNMARKERGREEN 3210
define BONUSSCREEN 3240
define VIEWBORDER 3250
define VICTORY1 3260
define ORDERING 3270
define TEXTSTORY 3280
define LOADSCREEN 3281
define BORNTOBEWILDSCREEN 3370
define BLIMP 3400
define FEM9 3450
define FOOTPRINT 3701
define POOP 4094
define FRAMEEFFECT1 4095
define PANNEL3 4099
define SCREENBREAK14 4120
define SCREENBREAK15 4123
define SCREENBREAK19 4125
define SCREENBREAK16 4127
define SCREENBREAK17 4128
define SCREENBREAK18 4129
define W_TECHWALL11 4130
define W_TECHWALL12 4131
define W_TECHWALL13 4132
define W_TECHWALL14 4133
define W_TECHWALL5 4134
define W_TECHWALL6 4136
define W_TECHWALL7 4138
define W_TECHWALL8 4140
define W_TECHWALL9 4142
define BPANNEL3 4100
define W_HITTECHWALL16 4144
define W_HITTECHWALL10 4145
define W_HITTECHWALL15 4147
define W_MILKSHELF 4181
define W_MILKSHELFBROKE 4203
define PURPLELAVA 4240
define LAVABUBBLE 4340
define DUKECUTOUT 4352
define TARGET 4359
define GUNPOWDERBARREL 4360
define DUCK 4361
define HATRACK 4367
define DESKLAMP 4370
define COFFEEMACHINE 4372
define CUPS 4373
define GAVALS 4374
define GAVALS2 4375
define POLICELIGHTPOLE 4377
define FLOORBASKET 4388
define PUKE 4389
define DOORTILE23 4391
define TOPSECRET 4396
define SPEAKER 4397
define TEDDYBEAR 4400
define ROBOTDOG 4402
define ROBOTPIRATE 4404
define ROBOTMOUSE 4407
define MAIL 4410
define MAILBAG 4413
define HOTMEAT 4427
define COFFEEMUG 4438
define DONUTS2 4440
define TRIPODCAMERA 4444
define METER 4453
define DESKPHONE 4454
define GUMBALLMACHINE 4458
define GUMBALLMACHINEBROKE 4459
define PAPER 4460
define MACE 4464
define GENERICPOLE2 4465
define XXXSTACY 4470
define WETFLOOR 4495
define BROOM 4496
define MOP 4497
define LETTER 4502
define PIRATE1A 4510
define PIRATE4A 4511
define PIRATE2A 4512
define PIRATE5A 4513
define PIRATE3A 4514
define PIRATE6A 4515
define PIRATEHALF 4516
define CHESTOFGOLD 4520
define SIDEBOLT1 4525
define FOODOBJECT1 4530
define FOODOBJECT2 4531
define FOODOBJECT3 4532
define FOODOBJECT4 4533
define FOODOBJECT5 4534
define FOODOBJECT6 4535
define FOODOBJECT7 4536
define FOODOBJECT8 4537
define FOODOBJECT9 4538
define FOODOBJECT10 4539
define FOODOBJECT11 4540
define FOODOBJECT12 4541
define FOODOBJECT13 4542
define FOODOBJECT14 4543
define FOODOBJECT15 4544
define FOODOBJECT16 4545
define FOODOBJECT17 4546
define FOODOBJECT18 4547
define FOODOBJECT19 4548
define FOODOBJECT20 4549
define HEADLAMP 4550
define TAMPON 4557
define SKINNEDCHICKEN 4554
define FEATHEREDCHICKEN 4555
define ROBOTDOG2 4560
define JOLLYMEAL 4569
define DUKEBURGER 4570
define SHOPPINGCART 4576
define CANWITHSOMETHING2 4580
define CANWITHSOMETHING3 4581
define CANWITHSOMETHING4 4582
define SNAKEP 4590
define DOLPHIN1 4591
define DOLPHIN2 4592
define NEWBEAST 4610
define NEWBEASTSTAYPUT 4611
define NEWBEASTJUMP 4690
define NEWBEASTHANG 4670
define NEWBEASTHANGDEAD 4671
define BOSS4 4740
define BOSS4STAYPUT 4741
define FEM10 4864
define TOUGHGAL 4866
define MAN 4871
define MAN2 4872
define WOMAN 4874
define PLEASEWAIT 4887
define NATURALLIGHTNING 4890
define WEATHERWARN 4893
define DUKETAG 4900
define SIGN1 4909
define SIGN2 4912
define JURYGUY 4943


// These tile positions are reserved!

define RESERVEDSLOT1 6132
define RESERVEDSLOT2 6133
define RESERVEDSLOT3 6134
define RESERVEDSLOT4 6135
define RESERVEDSLOT5 6136
define RESERVEDSLOT6 6132
define RESERVEDSLOT7 6133
define RESERVEDSLOT8 6134
define RESERVEDSLOT9 6135
define RESERVEDSLOT10 6136
define RESERVEDSLOT11 6137
define RESERVEDSLOT12 6138
define RESERVEDSLOT13 6139
define RESERVEDSLOT14 6140
define RESERVEDSLOT15 6141
define RESERVEDSLOT16 6142
define RESERVEDSLOT17 6143

// Defines weapon, not to be used with the 'shoot' keyword.

define KNEE_WEAPON         0
define PISTOL_WEAPON       1
define SHOTGUN_WEAPON      2
define CHAINGUN_WEAPON     3
define RPG_WEAPON          4
define HANDBOMB_WEAPON     5
define SHRINKER_WEAPON     6
define DEVISTATOR_WEAPON   7
define TRIPBOMB_WEAPON     8
define FREEZE_WEAPON       9
define HANDREMOTE_WEAPON   10
define GROW_WEAPON         11

// Defines the motion characteristics of an actor
define faceplayer 1
define geth 2
define getv 4
define randomangle 8
define faceplayerslow 16
define spin 32
define faceplayersmart 64
define fleeenemy 128
define jumptoplayer 257
define seekplayer 512
define furthestdir 1024
define dodgebullet 4096

// Some misc defines
define NO       0
define YES      1

// Defines for 'useractor' keyword
define notenemy       0
define enemy          1
define enemystayput   2

// Player Actions.
define pstanding 1
define pwalking 2
define prunning 4
define pducking 8
define pfalling 16
define pjumping 32
define phigher 64
define pwalkingback 128
define prunningback 256
define pkicking 512
define pshrunk 1024
define pjetpack 2048
define ponsteroids 4096
define ponground 8192
define palive 16384
define pdead 32768
define pfacing 65536


define GET_STEROIDS     0
define GET_SHIELD       1
define GET_SCUBA        2
define GET_HOLODUKE     3
define GET_JETPACK      4
define GET_ACCESS       6
define GET_HEATS        7
define GET_FIRSTAID     9
define GET_BOOTS       10


define KICK_HIT                         0
define PISTOL_RICOCHET                  1
define PISTOL_BODYHIT                   2
define PISTOL_FIRE                      3
define EJECT_CLIP                       4
define INSERT_CLIP                      5
define CHAINGUN_FIRE                    6
define RPG_SHOOT                        7
define POOLBALLHIT                      8
define RPG_EXPLODE                      9
define CAT_FIRE                        10
define SHRINKER_FIRE                   11
define ACTOR_SHRINKING                 12
define PIPEBOMB_BOUNCE                 13
define PIPEBOMB_EXPLODE                14
define LASERTRIP_ONWALL                15
define LASERTRIP_ARMING                16
define LASERTRIP_EXPLODE               17
define VENT_BUST                       18
define GLASS_BREAKING                  19
define GLASS_HEAVYBREAK                20
define SHORT_CIRCUIT                   21
define ITEM_SPLASH                     22
define DUKE_BREATHING                  23
define DUKE_EXHALING                   24
define DUKE_GASP                       25
define SLIM_RECOG                      26
// define ENDSEQVOL3SND1                  27
define DUKE_URINATE                    28
define ENDSEQVOL3SND2                  29
define ENDSEQVOL3SND3                  30
define DUKE_PASSWIND                   32
define DUKE_CRACK                      33
define SLIM_ATTACK                     34
define SOMETHINGHITFORCE               35
define DUKE_DRINKING                   36
define DUKE_KILLED1                    37
define DUKE_GRUNT                      38
define DUKE_HARTBEAT                   39
define DUKE_ONWATER                    40
define DUKE_DEAD                       41
define DUKE_LAND                       42
define DUKE_WALKINDUCTS                43
define DUKE_GLAD                       44
define DUKE_YES                        45
define DUKE_HEHE                       46
define DUKE_SHUCKS                     47
define DUKE_UNDERWATER                 48
define DUKE_JETPACK_ON                 49
define DUKE_JETPACK_IDLE               50
define DUKE_JETPACK_OFF                51
define LIZTROOP_GROWL                  52
define LIZTROOP_TALK1                  53
define LIZTROOP_TALK2                  54
define LIZTROOP_TALK3                  55
define DUKETALKTOBOSS                  56
define LIZCAPT_GROWL                   57
define LIZCAPT_TALK1                   58
define LIZCAPT_TALK2                   59
define LIZCAPT_TALK3                   60
define LIZARD_BEG                      61
define LIZARD_PAIN                     62
define LIZARD_DEATH                    63
define LIZARD_SPIT                     64
define DRONE1_HISSRATTLE               65
define DRONE1_HISSSCREECH              66
define DUKE_TIP2                       67
define FLESH_BURNING                   68
define SQUISHED                        69
define TELEPORTER                      70
define ELEVATOR_ON                     71
define DUKE_KILLED3                    72
define ELEVATOR_OFF                    73
define DOOR_OPERATE1                   74
define SUBWAY                          75
define SWITCH_ON                       76
define FAN                             77
define DUKE_GETWEAPON3                 78
define FLUSH_TOILET                    79
define HOVER_CRAFT                     80
define EARTHQUAKE                      81
define INTRUDER_ALERT                  82
define END_OF_LEVEL_WARN               83
define ENGINE_OPERATING                84
define REACTOR_ON                      85
define COMPUTER_AMBIENCE               86
define GEARS_GRINDING                  87
define BUBBLE_AMBIENCE                 88
define MACHINE_AMBIENCE                89
define SEWER_AMBIENCE                  90
define WIND_AMBIENCE                   91
define SOMETHING_DRIPPING              92
define STEAM_HISSING                   93
define THEATER_BREATH                  94
define BAR_MUSIC                       95
define BOS1_ROAM                       96
define BOS1_RECOG                      97
define BOS1_ATTACK1                    98
define BOS1_PAIN                       99
define BOS1_DYING                     100
define BOS2_ROAM                      101
define BOS2_RECOG                     102
define BOS2_ATTACK                    103
define BOS2_PAIN                      104
define BOS2_DYING                     105
define GETATOMICHEALTH                106
define DUKE_GETWEAPON2                107
define BOS3_DYING                     108
define SHOTGUN_FIRE                   109
define PRED_ROAM                      110
define PRED_RECOG                     111
define PRED_ATTACK                    112
define PRED_PAIN                      113
define PRED_DYING                     114
define CAPT_ROAM                      115
define CAPT_ATTACK                    116
define CAPT_RECOG                     117
define CAPT_PAIN                      118
define CAPT_DYING                     119
define PIG_ROAM                       120
define PIG_RECOG                      121
define PIG_ATTACK                     122
define PIG_PAIN                       123
define PIG_DYING                      124
define RECO_ROAM                      125
define RECO_RECOG                     126
define RECO_ATTACK                    127
define RECO_PAIN                      128
define RECO_DYING                     129
define DRON_ROAM                      130
define DRON_RECOG                     131
define DRON_ATTACK1                   132
define DRON_PAIN                      133
define DRON_DYING                     134
define COMM_ROAM                      135
define COMM_RECOG                     136
define COMM_ATTACK                    137
define COMM_PAIN                      138
define COMM_DYING                     139
define OCTA_ROAM                      140
define OCTA_RECOG                     141
define OCTA_ATTACK1                   142
define OCTA_PAIN                      143
define OCTA_DYING                     144
define TURR_ROAM                      145
define TURR_RECOG                     146
define TURR_ATTACK                    147
define DUMPSTER_MOVE                  148
define SLIM_DYING                     149
define BOS3_ROAM                      150
define BOS3_RECOG                     151
define BOS3_ATTACK1                   152
define BOS3_PAIN                      153
define BOS1_ATTACK2                   154
define COMM_SPIN                      155
define BOS1_WALK                      156
define DRON_ATTACK2                   157
define THUD                           158
define OCTA_ATTACK2                   159
define WIERDSHOT_FLY                  160
define TURR_PAIN                      161
define TURR_DYING                     162
define SLIM_ROAM                      163
define LADY_SCREAM                    164
define DOOR_OPERATE2                  165
define DOOR_OPERATE3                  166
define DOOR_OPERATE4                  167
define BORNTOBEWILDSND                168
define SHOTGUN_COCK                   169
define GENERIC_AMBIENCE1              170
define GENERIC_AMBIENCE2              171
define GENERIC_AMBIENCE3              172
define GENERIC_AMBIENCE4              173
define GENERIC_AMBIENCE5              174
define GENERIC_AMBIENCE6              175
define BOS3_ATTACK2                   176
define GENERIC_AMBIENCE17             177
define GENERIC_AMBIENCE18             178
define GENERIC_AMBIENCE19             179
define GENERIC_AMBIENCE20             180
define GENERIC_AMBIENCE21             181
define GENERIC_AMBIENCE22             182
define SECRETLEVELSND                 183
define GENERIC_AMBIENCE8              184
define GENERIC_AMBIENCE9              185
define GENERIC_AMBIENCE10             186
define GENERIC_AMBIENCE11             187
define GENERIC_AMBIENCE12             188
define GENERIC_AMBIENCE13             189
define GENERIC_AMBIENCE14             190
define GENERIC_AMBIENCE15             192
define GENERIC_AMBIENCE16             193
define FIRE_CRACKLE                   194
define BONUS_SPEECH1                  195
define BONUS_SPEECH2                  196
define BONUS_SPEECH3                  197
define PIG_CAPTURE_DUKE               198
define BONUS_SPEECH4                  199
define DUKE_LAND_HURT                 200
define DUKE_HIT_STRIPPER1             201
define DUKE_TIP1                      202
define DUKE_KILLED2                   203
define PRED_ROAM2                     204
define PIG_ROAM2                      205
define DUKE_GETWEAPON1                206
define DUKE_SEARCH2                   207
define DUKE_CRACK2                    208
define DUKE_SEARCH                    209
define DUKE_GET                       210
define DUKE_LONGTERM_PAIN             211
define MONITOR_ACTIVE                 212
define NITEVISION_ONOFF               213
define DUKE_HIT_STRIPPER2             214
define DUKE_CRACK_FIRST               215
define DUKE_USEMEDKIT                 216
define DUKE_TAKEPILLS                 217
define DUKE_PISSRELIEF                218
define SELECT_WEAPON                  219
define WATER_GURGLE                   220
define DUKE_GETWEAPON4                221
define JIBBED_ACTOR1                  222
define JIBBED_ACTOR2                  223
define JIBBED_ACTOR3                  224
define JIBBED_ACTOR4                  225
define JIBBED_ACTOR5                  226
define JIBBED_ACTOR6                  227
define JIBBED_ACTOR7                  228
define DUKE_GOTHEALTHATLOW            229
define BOSSTALKTODUKE                 230
define WAR_AMBIENCE1                  231
define WAR_AMBIENCE2                  232
define WAR_AMBIENCE3                  233
define WAR_AMBIENCE4                  234
define WAR_AMBIENCE5                  235
define WAR_AMBIENCE6                  236
define WAR_AMBIENCE7                  237
define WAR_AMBIENCE8                  238
define WAR_AMBIENCE9                  239
define WAR_AMBIENCE10                 240
define ALIEN_TALK1                    241
define ALIEN_TALK2                    242
define EXITMENUSOUND                  243
define FLY_BY                         244
define DUKE_SCREAM                    245
define SHRINKER_HIT                   246
define RATTY                          247
define INTO_MENU                      248
define BONUSMUSIC                     249
define DUKE_BOOBY                     250
define DUKE_TALKTOBOSSFALL            251
define DUKE_LOOKINTOMIRROR            252
define PIG_ROAM3                      253
define KILLME                         254
define DRON_JETSND                    255
define SPACE_DOOR1                    256
define SPACE_DOOR2                    257
define SPACE_DOOR3                    258
define SPACE_DOOR4                    259
define SPACE_DOOR5                    260
define ALIEN_ELEVATOR1                261
define VAULT_DOOR                     262
define JIBBED_ACTOR13                 263
define DUKE_GETWEAPON6                264
define JIBBED_ACTOR8                  265
define JIBBED_ACTOR9                  266
define JIBBED_ACTOR10                 267
define JIBBED_ACTOR11                 268
define JIBBED_ACTOR12                 269
define DUKE_KILLED4                   270
define DUKE_KILLED5                   271
define ALIEN_SWITCH1                  272
define DUKE_STEPONFECES               273
define DUKE_LONGTERM_PAIN2            274
define DUKE_LONGTERM_PAIN3            275
define DUKE_LONGTERM_PAIN4            276
define COMPANB2                       277
define KTIT                           278
define HELICOP_IDLE                   279
define STEPNIT                        280
define SPACE_AMBIENCE1                281
define SPACE_AMBIENCE2                282
define SLIM_HATCH                     283
define RIPHEADNECK                    284
define FOUNDJONES                     285
define ALIEN_DOOR1                    286
define ALIEN_DOOR2                    287
define ENDSEQVOL3SND4                 288
define ENDSEQVOL3SND5                 289
define ENDSEQVOL3SND6                 290
define ENDSEQVOL3SND7                 291
define ENDSEQVOL3SND8                 292
define ENDSEQVOL3SND9                 293
define WHIPYOURASS                    294
define ENDSEQVOL2SND1                 295
define ENDSEQVOL2SND2                 296
define ENDSEQVOL2SND3                 297
define ENDSEQVOL2SND4                 298
define ENDSEQVOL2SND5                 299
define ENDSEQVOL2SND6                 300
define ENDSEQVOL2SND7                 301
define GENERIC_AMBIENCE23             302
define SOMETHINGFROZE                 303
define DUKE_LONGTERM_PAIN5            304
define DUKE_LONGTERM_PAIN6            305
define DUKE_LONGTERM_PAIN7            306
define DUKE_LONGTERM_PAIN8            307
define WIND_REPEAT                    308
define MYENEMY_ROAM                   309
define MYENEMY_HURT                   310
define MYENEMY_DEAD                   311
define MYENEMY_SHOOT                  312
define STORE_MUSIC                    313
define STORE_MUSIC_BROKE              314
define ACTOR_GROWING                  315
define NEWBEAST_ROAM                  316
define NEWBEAST_RECOG                 317
define NEWBEAST_ATTACK                318
define NEWBEAST_PAIN                  319
define NEWBEAST_DYING                 320
define NEWBEAST_SPIT                  321
define VOL4_1                         322
define SUPERMARKET                    323
define MOUSEANNOY                     324
define BOOKEM                         325
define SUPERMARKETCRY                 326
define DESTRUCT                       327
define EATFOOD                        328
define MAKEMYDAY                      329
define WITNESSSTAND                   330
define VACATIONSPEECH                 331
define YIPPEE1                        332
define YOHOO1                         333
define YOHOO2                         334
define DOLPHINSND                     335
define TOUGHGALSND1                   336
define TOUGHGALSND2                   337
define TOUGHGALSND3                   338
define TOUGHGALSND4                   339
define TANK_ROAM                      340
define BOS4_ROAM                      341
define BOS4_RECOG                     342
define BOS4_ATTACK                    343
define BOS4_PAIN                      344
define BOS4_DYING                     345
define NEWBEAST_ATTACKMISS            346
define VOL4_2                         347
define COOKINGDEEPFRIER               348
define WHINING_DOG                    349
define DEAD_DOG                       350
define LIGHTNING_SLAP                 351
define THUNDER                        352
define HAPPYMOUSESND1                 353
define HAPPYMOUSESND2                 354
define HAPPYMOUSESND3                 355
define HAPPYMOUSESND4                 356
define ALARM                          357
define RAIN                           358
define DTAG_GREENRUN                  359
define DTAG_BROWNRUN                  360
define DTAG_GREENSCORE                361
define DTAG_BROWNSCORE                362
define INTRO4_1                       363
define INTRO4_2                       364
define INTRO4_3                       365
define INTRO4_4                       366
define INTRO4_5                       367
define INTRO4_6                       368
define SCREECH                        369
define BOSS4_DEADSPEECH               370
define BOSS4_FIRSTSEE                 371
define PARTY_SPEECH                   372
define POSTAL_SPEECH                  373
define TGSPEECH                       374
define DOGROOMSPEECH                  375
define SMACKED                        376
define MDEVSPEECH                     377
define AREA51SPEECH                   378
define JEEPSOUND                      379
define BIGDOORSLAM                    380
define BOS4_LAY                       381
define WAVESOUND                      382
define ILLBEBACK                      383
define VOL4ENDSND1                    384
define VOL4ENDSND2                    385
define EXPANDERHIT                    386
define SNAKESPEECH                    387
define EXPANDERSHOOT                  388
define GETBACKTOWORK                  389
define JIBBED_ACTOR14                 390
define JIBBED_ACTOR15                 391
define INTRO4_B                       392
define BIGBANG                        393
define HORNSND                        394
define BELLSND                        395
define GOAWAY                         396
define JOKE                           397
// MAXIMUM NUMBER OF SOUNDS: 450 ( 0-449 )


USER.CON (v1.5)
/*
--------------------------------------------------------------------------------
Duke Nukem 3D Version 1.4
By Todd Replogle
(c) 1996 3D Realms Entertainment
--------------------------------------------------------------------------------

IMPORTANT NOTICE IF YOU USE MODIFIED .CON FILES

If you are playing a MULTIPLAY game (Dukematch or Co-op) and you are
using *modified* .CON files (USER.CON, GAME.CON, DEFS.CON), then each
multiplayer must be using the EXACT SAME .CON files, or the game will
get out of sync and/or develop interesting problems.

3D Realms encourages you to experiment freely with the parameters
contained in this file, and to share your discoveries with the rest
of the world.  However, BE ADVISED that 3D Realms does NOT offer 
any technical support on how to use this file or other user-modifiable 
features of this game.  Do NOT call 3D Realms or Apogee Software 
for advice or help with this subject.  

You make modifications to this and other files at your own risk. 
It is recommended that you first make a backup copy of this, or
any .CON files before making any changes.
--------------------------------------------------------------------------------
*/

// ******************
// MISC GAME SETTINGS
// ******************

define SWEARFREQUENCY          100      // The lower, the less.

define CAMERASDESTRUCTABLE      NO               // YES
define FREEZERHURTOWNER         YES

define MAXPLAYERHEALTH          100
define MAXWATERFOUNTAINHEALTH    50

define YELLHURTSOUNDSTRENGTH     40
define YELLHURTSOUNDSTRENGTHMP   50

define MAXXSTRETCH 70
define MAXYSTRETCH 70

define MINXSTRETCH 9
define MINYSTRETCH 8

define MAXPLAYERATOMICHEALTH    200     // doubles as maxarmor.
define DOUBLEMAXPLAYERHEALTH    MAXPLAYERATOMICHEALTH
define STARTARMORHEALTH         0
define RETRIEVEDISTANCE         844
define SQUISHABLEDISTANCE      1024 // For actors only!
define DEFAULTVISIBILITY        512
define FROZENQUICKKICKDIST      980

define GENERICIMPACTDAMAGE      10

define MAXPISTOLAMMO           200
define MAXSHOTGUNAMMO           50
define MAXCHAINGUNAMMO         200
define MAXRPGAMMO               50
define MAXHANDBOMBAMMO          50
define MAXSHRINKERAMMO          50
define MAXGROWAMMO              50
define MAXDEVISTATORAMMO        99
define MAXFREEZEAMMO            99
define MAXTRIPBOMBAMMO          10
define TRIPBOMBLASERMODE        0     // 0 = always visable
                                      // 1 = transluscense
                                      // 2 = invisible w/o IR goggles
                                      // 3 = totally invisable



define RESPAWNACTORTIME         768
define RESPAWNITEMTIME          768

define QSIZE                   64       // total number of active
                                        // bullet holes, blood,
                                        // footprints, money, ect...
                                        // (max 1024)

// The BLIMP has a high respawn time (any value smaller runs the risk
// of spawning too many sprites, resulting in "Bog City")

define BLIMPRESPAWNTIME 2048

define NUMFREEZEBOUNCES          3    // 0 - 255


define RUNNINGSPEED 53200
define GRAVITATIONALCONSTANT 176

define PLAYDEADTIME 120

define SHRUNKCOUNT 270
define SHRUNKDONECOUNT 304

define FROZENDRIPTIME 90
define THAWTIME 138


// Various blast radius distances

define RPGBLASTRADIUS           1780
define PIPEBOMBRADIUS           2500
define SHRINKERBLASTRADIUS      680
define TRIPBOMBBLASTRADIUS      3880
define MORTERBLASTRADIUS        2500
define BOUNCEMINEBLASTRADIUS    2500
define SEENINEBLASTRADIUS       2048

gamestartup     DEFAULTVISIBILITY GENERICIMPACTDAMAGE MAXPLAYERHEALTH
                STARTARMORHEALTH  RESPAWNACTORTIME RESPAWNITEMTIME
                RUNNINGSPEED GRAVITATIONALCONSTANT RPGBLASTRADIUS
                PIPEBOMBRADIUS SHRINKERBLASTRADIUS TRIPBOMBBLASTRADIUS
                MORTERBLASTRADIUS BOUNCEMINEBLASTRADIUS SEENINEBLASTRADIUS
                MAXPISTOLAMMO MAXSHOTGUNAMMO MAXCHAINGUNAMMO
                MAXRPGAMMO MAXHANDBOMBAMMO MAXSHRINKERAMMO
                MAXDEVISTATORAMMO MAXTRIPBOMBAMMO MAXFREEZEAMMO
                MAXGROWAMMO CAMERASDESTRUCTABLE NUMFREEZEBOUNCES
                FREEZERHURTOWNER QSIZE TRIPBOMBLASERMODE


// Weapon Strengths
define KNEE_WEAPON_STRENGTH             10
define PISTOL_WEAPON_STRENGTH            6
define HANDBOMB_WEAPON_STRENGTH        140



// For direct hits with the rocket launcher,
// this amount is actually doubled.  Otherwise,
// damage values depend on distance. The
// further, the weaker.

define RPG_WEAPON_STRENGTH              140


define SHRINKER_WEAPON_STRENGTH          0
define GROWSPARK_WEAPON_STRENGTH        15
define SHOTGUN_WEAPON_STRENGTH          10
define CHAINGUN_WEAPON_STRENGTH          9
define FREEZETHROWER_WEAPON_STRENGTH    20
define COOL_EXPLOSION_STRENGTH          38
define TRIPBOMB_STRENGTH               100
define FIRELASER_WEAPON_STRENGTH         7
define MORTER_WEAPON_STRENGTH           50
define BOUNCEMINE_WEAPON_STRENGTH      150
define SPIT_WEAPON_STRENGTH              8
define BULLET_WEAPON_STRENGTH           30

// Enemy strengths (hit points).

define TROOPSTRENGTH            30
define PIGCOPSTRENGTH          100
define PIG_SHIELD_AMOUNT1       75
define PIG_SHIELD_AMOUNT2       50
define LIZSTRENGTH             100
define LIZGETTINGDAZEDAT        15
define LIZEATINGPLAYER          -2
define OCTASTRENGTH            175
define OCTASCRATCHINGPLAYER    -11
define RECONSTRENGTH            50
define TURRETSTRENGTH           30
define ROTTURRETSTRENGTH        40
define DRONESTRENGTH           150
define CAPTAINSTRENGTH          50
define CAPTSPINNINGPLAYER      -11
define COMMANDERSTRENGTH        350
define SHARKSTRENGTH            35
define SHARKBITESTRENGTH        -9
define NEWBEASTSTRENGTH         300
define NEWBEASTSCRATCHAMOUNT   -22
define DOLPHINSTRENGTH          50

define PISTOLAMMOAMOUNT         12
define SHOTGUNAMMOAMOUNT        10
define CHAINGUNAMMOAMOUNT       50
define RPGAMMOBOX               5
define CRYSTALAMMOAMOUNT        5
define GROWCRYSTALAMMOAMOUNT    20
define DEVISTATORAMMOAMOUNT     15
define FREEZEAMMOAMOUNT         25
define HANDBOMBBOX              5


define BOSS1STRENGTH            4500
define BOSS1PALSTRENGTH         1000
define BOSS2STRENGTH            4500
define BOSS3STRENGTH            4500
define BOSS4STRENGTH            6000

// Miscellaneous strengths.

define WEAKEST           1
define WEAK              5
define MEDIUMSTRENGTH    10
define TOUGH             20
define REALLYTOUGH       30
define ROBOTMOUSESTRENGTH 45
define GOTTASMART        90
define PIRATEGALSTRENGTH 200

define MANWOMANSTRENGTH  100


// Players' inventory amounts.

define STEROID_AMOUNT           400
define SHIELD_AMOUNT            100
define SCUBA_AMOUNT            6400
define HOLODUKE_AMOUNT         2400
define JETPACK_AMOUNT          1600
define HEAT_AMOUNT             1200
define FIRSTAID_AMOUNT          MAXPLAYERHEALTH
define BOOT_AMOUNT              200

define SPAWNAMMOODDS             96


// Maximum quote size is 64 characters.
// Maximum quotes is 192 slots.


definequote  0        AUTO AIMING
definequote  1        SHOW MAP: OFF
definequote  2        ACTIVATED
definequote  3        PORTABLE MEDKIT
definequote  4        LOCKED
definequote  5        GIVING EVERYTHING!
definequote  6        BOOTS
definequote  7        WASTED!
definequote  8        UNLOCKED
definequote  9        A SECRET PLACE!
definequote 10        SQUISH!
definequote 11        ALL DOORS UNLOCKED
definequote 12        USED STEROIDS
definequote 13        PRESS SPACE TO RESTART LEVEL
definequote 14        AMMO FOR DEVASTATOR
definequote 15        DEACTIVATED
definequote 16        SWITCH OPERATED ONLY!
definequote 17        GOD MODE: ON
definequote 18        GOD MODE: OFF
definequote 19        ATOMIC HEALTH!
definequote 20        CROSSHAIR: ON
definequote 21        CROSSHAIR: OFF
definequote 22        YOU'RE TOO GOOD TO BE CHEATING!
definequote 23        MESSAGES: ON
definequote 24        MESSAGES: OFF
definequote 25        TYPE THE CHEAT CODE:
definequote 26        DETAIL: LOW
definequote 27        DETAIL: HIGH
definequote 28        WILL ALWAYS HAVE NO FUTURE
definequote 29        BRIGHTNESS LEVEL: ONE
definequote 30        BRIGHTNESS LEVEL: TWO
definequote 31        BRIGHTNESS LEVEL: THREE
definequote 32        BRIGHTNESS LEVEL: FOUR
definequote 33        BRIGHTNESS LEVEL: FIVE
definequote 34        SOUND: ON
definequote 35        SOUND: OFF
definequote 36        SCREEN CAPTURED
definequote 37        STEROIDS
definequote 38        ARMOR
definequote 39        SCUBA GEAR
definequote 40        Press F1 for Help
definequote 41        JETPACK
definequote 42        BODY SUIT
definequote 43        ACCESS CARD
definequote 44        MOUSE AIMING OFF
definequote 45        MOUSE AIMING ON
definequote 46        CHEAT CODE:  UNRECOGNIZED
definequote 47        HOLODUKE ON
definequote 48        HOLODUKE OFF
definequote 49        HOLODUKE NOT FOUND YET!
definequote 50        JETPACK NOT FOUND YET!
definequote 51        HOLODUKE
definequote 52        JETPACK ON
definequote 53        JETPACK OFF
definequote 54        CHAINGUN CANNON!
definequote 55        PIPEBOMB!
definequote 56        RPG!
definequote 57        SHOTGUN
definequote 58        LASER TRIPBOMB!
definequote 59        FREEZETHROWER!
definequote 60        GOT SHRINKER/EXPANDER!
definequote 61        SMALL MEDKIT: +10
definequote 62        LARGE MEDKIT: +30
definequote 63        AMMO FOR CHAINGUN CANNON!
definequote 64        AMMO FOR RPG!
definequote 65        AMMO FOR PISTOL!
definequote 66        AMMO FOR FREEZETHROWER!
definequote 67        BOOTS OFF
definequote 68        BOOTS ON
definequote 69        AMMO FOR SHOTGUN
definequote 70        BLUE ACCESS CARD REQUIRED
definequote 71        RED ACCESS CARD REQUIRED
definequote 72        YELLOW ACCESS CARD REQUIRED
definequote 73        WEAPON LOWERED
definequote 74        WEAPON RAISED
definequote 75        PROTECTIVE BOOTS ON
definequote 76        SCUBA GEAR ON
definequote 77        SPACE SUIT ON
definequote 78        AMMO FOR SHRINKER
definequote 79        BUY MAJOR STRYKER
definequote 80        MIGHTY FOOT ENGAGED
definequote 81        WEAPON MODE ON
definequote 82        WEAPON MODE OFF
definequote 83        FOLLOW MODE OFF
definequote 84        FOLLOW MODE ON
definequote 85        RUN MODE OFF
definequote 86        RUN MODE ON
definequote 87        DEVASTATOR WEAPON
definequote 88        JET PACK
definequote 89        AIRTANK
definequote 90        STEROIDS
definequote 91        HOLODUKE
definequote 92        MUSIC: ON
definequote 93        MUSIC: OFF
definequote 94        SCROLL MODE: ON
definequote 95        SCROLL MODE: OFF
definequote 96        BRIGHTNESS LEVEL: SIX
definequote 97        BRIGHTNESS LEVEL: SEVEN
definequote 98        BRIGHTNESS LEVEL: EIGHT
definequote 99        REGISTER COSMO TODAY!
definequote 100       ALL LOCKS TOGGLED
definequote 101       NIGHT VISION GOGGLES
definequote 102       WE'RE GONNA FRY YOUR ASS, NUKEM!
definequote 103       SCREEN SAVED
definequote 104       GOT USED ARMOR
definequote 105       PIRATES SUCK!
definequote 106       NIGHT VISION ON
definequote 107       NIGHT VISION OFF
definequote 108       YOU'RE BURNING!  
definequote 109       VIEW MODE OFF
definequote 110       VIEW MODE ON
definequote 111       SHOW MAP: ON
definequote 112       CLIPPING: ON
definequote 113       CLIPPING: OFF
definequote 114       !!! INCORRECT VERSION !!!
definequote 115       <Please Leave Blank>
definequote 116       <Please Leave Blank>
definequote 117       <Please Leave Blank>
definequote 118       YOU CANNOT "QUICK SAVE" WHEN DEAD
definequote 119       GOT ALL WEAPONS/AMMO
definequote 120       GOT ALL INVENTORY
definequote 121       GOT ALL KEYS
definequote 122       <Please Leave Blank>
definequote 123       AMMO FOR EXPANDER
definequote 124       MAP HAS A DIFFERENT NUMBER OF PLAYERS



// Volume titles cannot excede 32 characters.

definevolumename 0 L.A. MELTDOWN
definevolumename 1 LUNAR APOCALYPSE
definevolumename 2 SHRAPNEL CITY
definevolumename 3 THE BIRTH


// Skill titles cannot excede 32 characters.

defineskillname 0 PIECE OF CAKE
defineskillname 1 LET'S ROCK
defineskillname 2 COME GET SOME
defineskillname 3 DAMN I'M GOOD


// Level file names cannot excede 128 characters.
// Level par cannot excede 5 characters (min:sec)
// Level titles cannot excede 32 characters.

definelevelname 0 0 E1L1.map 01:45 00:53 HOLLYWOOD HOLOCAUST
definelevelname 0 1 E1L2.map 05:10 03:21 RED LIGHT DISTRICT
definelevelname 0 2 E1L3.map 05:35 03:41 DEATH ROW
definelevelname 0 3 E1L4.map 07:20 04:40 TOXIC DUMP
definelevelname 0 4 E1L5.map 09:10 05:00 THE ABYSS
definelevelname 0 5 E1L6.map 05:15 02:58 LAUNCH FACILITY
definelevelname 0 6 E1L7.map 00:00 00:00 FACES OF DEATH
definelevelname 0 7 E1L8.map 99:99 99:99 USER MAP
definelevelname 0 8 E1L9.map 12:48 16:32 VOID ZONE
definelevelname 0 9 E1L10.map 0T:HX 11:38 ROACH CONDO
definelevelname 0 10 E1L11.map 08:67 53:09 ANTIPROFIT

definelevelname 1 0 E2L1.map 02:30 01:19 SPACEPORT
definelevelname 1 1 E2L2.map 02:30 01:26 INCUBATOR
definelevelname 1 2 E2L3.map 05:00 02:26 WARP FACTOR
definelevelname 1 3 E2L4.map 04:30 02:14 FUSION STATION
definelevelname 1 4 E2L5.map 03:00 01:26 OCCUPIED TERRITORY
definelevelname 1 5 E2L6.map 02:30 01:04 TIBERIUS STATION
definelevelname 1 6 E2L7.map 04:45 02:15 LUNAR REACTOR
definelevelname 1 7 E2L8.map 11:30 04:59 DARK SIDE
definelevelname 1 8 E2L9.map 05:00 02:26 OVERLORD
definelevelname 1 9 E2L10.map 03:00 01:19 SPIN CYCLE
definelevelname 1 10 E2L11.map 03:00 00:52 LUNATIC FRINGE

definelevelname 2 0 E3L1.map 02:30 01:11 RAW MEAT
definelevelname 2 1 E3L2.map 04:45 02:18 BANK ROLL
definelevelname 2 2 E3L3.map 03:00 01:57 FLOOD ZONE
definelevelname 2 3 E3L4.map 03:15 01:46 L.A. RUMBLE
definelevelname 2 4 E3L5.map 02:30 01:04 MOVIE SET
definelevelname 2 5 E3L6.map 03:30 01:30 RABID TRANSIT
definelevelname 2 6 E3L7.map 02:00 00:55 FAHRENHEIT
definelevelname 2 7 E3L8.map 02:15 01:09 HOTEL HELL
definelevelname 2 8 E3L9.map 02:45 01:17 STADIUM
definelevelname 2 9 E3L10.map 00:45 00:10 TIER DROPS
definelevelname 2 10 E3L11.map 02:00 01:07 FREEWAY

definelevelname 3 0 E4L1.map 03:04 01:32 IT'S IMPOSSIBLE
definelevelname 3 1 E4L2.map 04:00 02:00 DUKE-BURGER
definelevelname 3 2 E4L3.map 03:30 01:45 SHOP-N-BAG
definelevelname 3 3 E4L4.map 06:32 03:16 BABE LAND
definelevelname 3 4 E4L5.map 02:02 01:01 PIGSTY
definelevelname 3 5 E4L6.map 03:04 01:52 GOING POSTAL
definelevelname 3 6 E4L7.map 01:24 00:42 XXX-STACY
definelevelname 3 7 E4L8.map 03:18 01:59 CRITICAL MASS
definelevelname 3 8 E4L9.map 05:02 02:51 DERELICT
definelevelname 3 9 E4L10.map 10:50 05:25 THE QUEEN
definelevelname 3 10 E4L11.map 04:20 02:10 AREA 51


// Music will not play if the .MID file excedes 72000 bytes.

// If you are an owner of a Gravis Ultrasound and wish to change the
// MIDI files, you may want to delete the ULTRAMID.INI file that we
// supply since it does not contain a full General MIDI patch set.
// Deleting the ULTRAMID.INI will cause the game to use the file found
// in your Ultrasound directory.  Remember to keep a backup of ours,
// or the music might not sound as good!

// Music for title and end
music 0 GRABBAG.MID BRIEFING.MID

// Music for the individual levels
music 1 stalker.mid dethtoll.mid streets.mid watrwld1.mid snake1.mid
        thecall.mid ahgeez.mid dethtoll.mid streets.mid watrwld1.mid snake1.mid

music 2 futurmil.mid storm.mid gutwrnch.mid robocrep.mid stalag.mid 
       pizzed.mid alienz.mid xplasma.mid alfredh.mid gloomy.mid intents.mid

music 3 inhiding.mid FATCMDR.mid NAMES.MID subway.mid invader.mid gotham.mid
        233c.mid lordofla.mid urban.mid spook.mid whomp.mid

music 4 missimp.mid prepd.mid bakedgds.mid cf.mid lemchill.mid
       pob.mid warehaus.mid layers.mid floghorn.mid depart.mid restrict.mid


/*
--------------------------------------------------------------------------------
ABOUT CHANGING SOUND FX

The sound fx section follows this explanation.  

1. The program expects to find any sound file that is in a
   .VOC or .WAV file format.
2. You can either change the VOC name listed below to match your new
   sound, or you can rename your file to match the name here.
3. New sound files should be added to the game directory.  Though
   all sound files shipped with the game are included inside the 
   .GRP file, the program will know if there are sound files outside
   the .GRP file, and will use them instead.
4. The numbers that are to the right of the sound file name are technical
   parameters which will not be explained here, except as follows...
   - The first 2 numbers define a random pitch variation range.  They
     can be positive or negative numbers.
   - The 3rd number is a priority flag.
   - The 4th number is a bit parsed set of technical variables that identify
     the type of sound it is in the game.
   - The 5th number is volume adjustment.
5. Duke may have up to 400 total sound definitions.
--------------------------------------------------------------------------------
*/

// *****************************************
//      ACTOR SOUNDS
// *****************************************

// BIT 0 (1) Repeat
// BIT 1 (2) MUSICANDSFX (used for)
// BIT 2 (4) A Duke Voice
// BIT 3 (8) Par. Lockout
// BIT 4 (16) Glob. Heard (sndist = 0)

// Predator Trooper
definesound PRED_ROAM     roam06.voc          0   0   3  0   0
definesound PRED_ROAM2    roam58.voc          0   0   3  0   0
definesound PRED_RECOG    predrg.voc          0   0   3  0   0
definesound PRED_ATTACK   gblasr01.voc      256  256  3  0   7680
definesound PRED_PAIN     predpn.voc          200 500 3  0   0
definesound PRED_DYING    preddy.voc          0   400 3  0   0
                                             
// Lizard Captain                                                                       
definesound CAPT_ROAM     predrm.voc          0  200  3   0   0
definesound CAPT_RECOG    predrg.voc        -400  0   3   0   0
definesound CAPT_ATTACK   chaingun.voc      0     0    3   0   -200
definesound CAPT_PAIN     predpn.voc        -200  100 3   0   0
definesound CAPT_DYING    preddy.voc        -200  100 3   0   0
definesound LIZARD_SPIT   lizspit.voc         0   0   0   0   0
definesound LIZARD_BEG    chokn12.voc         0   0   3  0   0

// Newbeast
definesound NEWBEAST_ROAM     blroam2a.voc     -128 128    3   0   0
definesound NEWBEAST_RECOG    blrec4b.voc      1400   0    3   0   0
definesound NEWBEAST_ATTACK   blrip1a.voc     -150  150    3   0   0
definesound NEWBEAST_ATTACKMISS blrip1b.voc     -256  256  3   0   0
definesound NEWBEAST_PAIN     blpain1b.voc      -256  256  3   0   0
definesound NEWBEAST_DYING    bldie3a.voc        1200  100 3   0   0
definesound NEWBEAST_SPIT     blspit1a.voc      -128 128   0   0   0

// Pig Cop
definesound PIG_ROAM      roam29.voc           -200 400   3   0   0
definesound PIG_ROAM2     roam67.voc           -200 400   3   0   0
definesound PIG_ROAM3     pigrm.voc            -200 400   3   0   0
definesound PIG_RECOG     pigrg.voc           -200 400   3   0   0
definesound PIG_ATTACK    shotgun7.voc        -256  256  4   0   0
definesound PIG_PAIN      pigpn.voc            100 800   3   0   0
definesound PIG_DYING     pigdy.voc           -800 100   3   0   0
definesound PIG_CAPTURE_DUKE !pig.voc           0   0   255 8   0

// Recon car
definesound RECO_ROAM     jetpaki.voc            0   0   3   0   0
definesound RECO_RECOG    pigrg.voc              0   0   3   0   0
definesound RECO_ATTACK   gblasr01.voc         256  256  3  0   7680
definesound RECO_PAIN     pigpn.voc              0   0   3   0   0
definesound RECO_DYING    pigdy.voc              0   0   3   0   0

// Drone drone
definesound DRON_ROAM     snakrm.voc             0   0   3   0   0
definesound DRON_RECOG    snakrg.voc             0   0   3   0   0
definesound DRON_ATTACK1  snakatA.voc            0   0   3   0   0
definesound DRON_ATTACK2  snakatB.voc            0   0   3   0   0
definesound DRON_PAIN     snakpn.voc             0   0   3   0   0
definesound DRON_DYING    snakdy.voc             0   0   3   0   0
definesound DRON_JETSND   ENGHUM.VOC             1300 1300 0   0   0


// Fat Commander
definesound COMM_ROAM     commrm.voc             0   0   3   0   0
definesound COMM_RECOG    commrg.voc             0   0   3   0   0
definesound COMM_ATTACK   commat.voc             0   0   3   0   0
definesound COMM_PAIN     commpn.voc             0   0   3   0   0
definesound COMM_DYING    commdy.voc             0   0   3   0   0
definesound COMM_SPIN     commsp.voc             0   0   3   0   0

// Octabrain
definesound OCTA_ROAM     octarm.voc          -200   0    3   0   0
definesound OCTA_RECOG    octarg.voc             0   0    3   0   0
definesound OCTA_ATTACK1  octaat1.voc            0   0    3   0   0
definesound OCTA_ATTACK2  octaat2.voc            0   600  3   0   0
definesound OCTA_PAIN     octapn.voc          -400   0    3   0   0
definesound OCTA_DYING    octady.voc          -400   -100 3   0   0
definesound WIERDSHOT_FLY octaat1.voc            0   0    3   0   0

// Organic turret
definesound TURR_ROAM     turrrm.voc             0   0   3   0   0
definesound TURR_RECOG    turrrg.voc             0   0   3   0   0
definesound TURR_ATTACK   turrat.voc             0   0   3   0   0
definesound TURR_PAIN     turrpn.voc             0   0   3   0   0
definesound TURR_DYING    turrdy.voc             0   0   3   0   0

// Green slimer
definesound SLIM_HATCH    slhtch01.voc          -256 256   3   0   0
definesound SLIM_ROAM     sliroa02.voc          -256 256   3   0   0
definesound SLIM_RECOG    slirec06.voc          -256 256   3   0   0
definesound SLIM_ATTACK   slimat.voc            -256 256   3   0   0
// definesound SLIM_PAIN     slimpn.voc         -256 256   3   0   0
definesound SLIM_DYING    slidie03.voc          -256 256   3   0   0

// BOSS2
definesound BOS2_ROAM     b2atk01.voc             0   0   3   0   0
definesound BOS2_RECOG    b2rec03.voc             0   0   3   0   0
definesound BOS2_ATTACK   b2atk02.voc             0   0   3   0   0
definesound BOS2_PAIN     b2pain03.voc             0   0   3   0   0
definesound BOS2_DYING    b2die03.voc             0   0   3   0   0

// BOSS3                                                                                
definesound BOS3_ROAM     b3roam01.voc             0   0   3   0   0
definesound BOS3_RECOG    b3pain04.voc             0   0   3   0   0
definesound BOS3_ATTACK1  b3atk01.voc              0   0   3   0   0
definesound BOS3_ATTACK2  b3atk01.voc              0   0   3   0   0
definesound BOS3_PAIN     b3rec03g.voc             0   0   3   0   0
definesound BOS3_DYING    b3die03g.voc             0   0   3   0   0

// BOSS4
definesound BOS4_ROAM     bqroam2a.voc          1024 1024  255 0  0
definesound BOS4_RECOG    bqrec2a.voc           1024 1024  255 0  3084
definesound BOS4_ATTACK   bqshock3.voc          1024 1024  255 0  0
definesound BOS4_PAIN     bqpain2a.voc          1024 1024  255 0  0
definesound BOS4_DYING    bqdie1a.voc           1024 1024  255 0  0
definesound BOS4_LAY      bqegg1a.voc           1024 1024  255 0  0

// BOSS1                                                                                
definesound BOS1_ROAM     bos1rm.voc             0   0   3   0   0
definesound BOS1_RECOG    bos1rg.voc             0   0   5   0   0
definesound BOS1_ATTACK1  chaingun.voc           0   0   3   0   0
definesound BOS1_ATTACK2  rpgfire.voc            0   0   3   0   0
definesound BOS1_PAIN     bos1pn.voc             0   0   3   0   0
definesound BOS1_DYING    bos1dy.voc             0   0   3   0   0
definesound BOS1_WALK     thud.voc               0   0   3   0   0


// *************
// WEAPON SOUNDS                                                                        
// *************
definesound KICK_HIT            kickhit.voc       0     0     4   0   0
definesound PISTOL_RICOCHET     ricochet.voc      0     0     0   0 4096
definesound PISTOL_BODYHIT      bulithit.voc      0     0     0   0   0
definesound PISTOL_FIRE         pistol.voc      -64     0   254   0   0
definesound EJECT_CLIP          clipout.voc       0     0     3   0   0
definesound INSERT_CLIP         clipin.voc        512   512   3   0   0
definesound CHAINGUN_FIRE       chaingun.voc     -204 -204  254   0   512
definesound SHOTGUN_FIRE        shotgun7.voc      0    512    254 0   0
definesound SHOTGUN_COCK        shotgnck.voc      96    192   3   0   0
definesound RPG_SHOOT           rpgfire.voc       -32   0     4   0   0
definesound FLY_BY              flyby.voc         -256  256   3   0   0
definesound RPG_EXPLODE         bombexpl.voc      -1024 1024  128 0   0
definesound CAT_FIRE            catfire.voc       512   768   4   0   0
definesound SHRINKER_FIRE       shrinker.voc      -512  0     5   0   0
definesound ACTOR_SHRINKING     shrink.voc        0     0     2   0   0
definesound ACTOR_GROWING       enlarge.voc    1024     0     2   0   0

definesound PIPEBOMB_BOUNCE     pbombbnc.voc      0     0     2   0 6144
definesound PIPEBOMB_EXPLODE    bombexpl.voc  -512      0     128 0   0
definesound LASERTRIP_ONWALL    lsrbmbpt.voc      0     0     3   0   0
definesound LASERTRIP_ARMING    lsrbmbwn.voc      0     0     3   0   0
definesound LASERTRIP_EXPLODE   bombexpl.voc  -512      0     4   0   0
definesound NITEVISION_ONOFF    goggle12.voc      0     0     0   0   0
definesound SELECT_WEAPON       WPNSEL21.VOC      128   128   3   0   0

// Affect Environment Sounds                                                            
definesound VENT_BUST           ventbust.voc      -32   32 2  0  0
definesound GLASS_BREAKING      glass.voc         -412  0  3  0  8192
definesound GLASS_HEAVYBREAK    glashevy.voc      -412  0  3  0  8192
definesound SHORT_CIRCUIT       shorted.voc       0 0 0 0 6500
definesound ITEM_SPLASH         splash.voc        0 0 2 0 0
definesound BONUSMUSIC          bonus.voc         0 0 255 1 0

// Duke's Body Sounds                                                                   
definesound DUKE_BREATHING      hlminhal.voc       0   0   255 4   0
definesound DUKE_EXHALING       hlmexhal.voc       0   0   255 4   0
definesound DUKE_GASP           gasp.voc           0   0   255 4   0
definesound DUKE_URINATE        pissing.voc        0   0   4   0   0
definesound DUKE_CRACK2         COMEON02.voc       0   0   255 4   0
definesound DUKE_CRACK          WAITIN03.voc       0   0   255 4   0
definesound DUKE_TALKTOBOSSFALL DIESOB03.voc       0   0   255 12  0
definesound DUKE_CRACK_FIRST    knuckle.voc        0   0   3   0   0
definesound DUKE_GET            getitm19.voc     -64  64   255 0   0
definesound DUKE_GETWEAPON1     cool01.voc         0   0   255 4   0
definesound DUKE_GETWEAPON2     getsom1a.voc       0   0   255 4   0
definesound DUKE_GETWEAPON3     groovy02.voc       0   0   255 4   0
definesound DUKE_GETWEAPON4     wansom4a.voc       0   0   255 4   0
definesound DUKE_GETWEAPON6     HAIL01.VOC         0   0   255 4   0
definesound DUKE_GOTHEALTHATLOW needed03.voc       0   0   255 4   0

definesound DUKE_SEARCH         pain87.VOC       0   0   2   4     0
definesound DUKE_SEARCH2        whrsit05.voc       0   0   255 4   0
definesound DUKE_LONGTERM_PAIN  gasps07.voc     -192   0   255 4   0
definesound DUKE_LONGTERM_PAIN2 dscrem15.voc      0   0   255 4   0
definesound DUKE_LONGTERM_PAIN3 dscrem16.voc      0   0   255 4   0
definesound DUKE_LONGTERM_PAIN4 dscrem17.voc      0   0   255 4   0
definesound DUKE_LONGTERM_PAIN5 pain54.voc        0   0   255 4   0
definesound DUKE_LONGTERM_PAIN6 pain75.voc        0   0   255 4   0
definesound DUKE_LONGTERM_PAIN7 pain93.voc        0   0   255 4   0
definesound DUKE_LONGTERM_PAIN8 pain68.voc        0   0   255 4   0

definesound DUKE_PISSRELIEF     ahmuch03.voc       0   0   255 4   0

// Duke Health Sounds
definesound SOMETHINGHITFORCE   teleport.voc       0   0    2   0   8192
definesound DUKE_DRINKING       drink18.voc     -128 128   2   4   0
definesound DUKE_KILLED1        damn03.voc         0   0   255 12  0
definesound DUKE_KILLED2        damnit04.voc       0   0   255 12  0
definesound DUKE_KILLED3        thsuk13a.voc       0   0   255 12  0
definesound DUKE_KILLED4        dscrem18.voc       0   0   255 4   0
definesound DUKE_KILLED5        pisses01.voc       0   0   255 12  0
definesound DUKE_GRUNT          exert.voc          0   0   2   4   0
definesound DUKE_DEAD           DMDEATH.VOC      -64  64   255 4  0
definesound DUKE_HARTBEAT       hartbeat.voc       0   0   0   0   0
definesound DUKE_STEPONFECES    happen01.voc       0   0   0   12  0

// Duke Movement Sounds                                                                 
definesound DUKE_ONWATER        wetfeet.voc        0   0    4   0   0
definesound DUKE_LAND           land02.voc         0   0    2   0   0
definesound DUKE_LAND_HURT      pain39.voc         0   0    255 4   0
definesound DUKE_WALKINDUCTS    ductwlk.voc      -64   128  2   0   0
definesound DUKE_LOOKINTOMIRROR   lookin01.voc     0   0    255 4   0

definesound DUKE_TIP1           dance01.voc        0   0   255  4   0
definesound DUKE_TIP2           shake2a.voc        0   0   255  4   0
definesound DUKE_BOOBY          BOOBY04.voc        0   0   255  4   0
definesound DUKE_HIT_STRIPPER1  damnit04.voc       0   0   255  12  0
definesound DUKE_HIT_STRIPPER2  damn03.voc         0   0   255  12  0
definesound ALIEN_TALK1         MUSTDIE.voc        0   0   255  12  0
definesound ALIEN_TALK2         DEFEATED.VOC       0   0   255  12  0
definesound BONUS_SPEECH1       letsrk03.voc       0   0   255  4   0
definesound BONUS_SPEECH2       ready2a.voc        0   0   255  4   0
definesound BONUS_SPEECH3       ripem08.voc        0   0   255  4   0
definesound BONUS_SPEECH4       rockin02.voc       0   0   255  4   0
definesound DUKE_YES            yes.voc            0   0   255  4   0
definesound DUKE_USEMEDKIT      ahh04.voc          0   0   255  4   0
definesound DUKE_TAKEPILLS      gulp01.voc         0   0   255  4   0
definesound DUKETALKTOBOSS      duknuk14.voc       0   0   255  12  0
definesound BOSSTALKTODUKE      !boss.voc          0   0   255  0   0
definesound SHRINKER_HIT        thud.voc           0   0   3    0   0
definesound SOMETHINGFROZE      freeze.voc         0   0   3    0   0

// Duke Equipment Sounds
definesound DUKE_UNDERWATER     scuba.voc          0   0   2   0   0
definesound DUKE_JETPACK_ON     jetpakon.voc       0   0   4   0   0
definesound DUKE_JETPACK_IDLE   jetpaki.voc        0   0   1   0   0
definesound DUKE_JETPACK_OFF    jetpakof.voc       0   0   2   0   0

// Common Death Sounds
definesound FLESH_BURNING       fire09.voc      -256   0   0   0   6100
definesound THUD                thud.voc           0   0   0   0   0
definesound SQUISHED            squish.voc      -128   0   3   0   0

// Equipment Sounds                                                                     
definesound TELEPORTER          teleport.voc       0   0   0   0   0
definesound ELEVATOR_ON         gbelev01.voc       0   0   0   0   0
definesound ELEVATOR_OFF        gbelev02.voc       0   0   0   0   0
definesound ALIEN_ELEVATOR1     hydro43.voc        0   0   0   0   0
definesound SUBWAY              subway.voc         0   0   0   0   0
definesound SWITCH_ON           switch.voc         0   0   0   0   0

definesound FAN                 fan.voc            0   0   0   0   0
definesound FLUSH_TOILET        flush.voc          0   0   3   2   0
definesound HOVER_CRAFT         hover.voc          0   0   0   0   0
definesound EARTHQUAKE          quake.voc          0   0   0   0   0
                                                                                        
// Warning Sounds                                                                       
definesound INTRUDER_ALERT      alert.voc          0   0   0   0   0
definesound END_OF_LEVEL_WARN   monitor.voc        0   0   0   0   0
definesound POOLBALLHIT         poolbal1.voc       0   0   0   0   0

// Ambience Sounds

definesound ENGINE_OPERATING    onboard.voc        0   0   0   2   0
definesound REACTOR_ON          reactor.voc        0   0   0   2   0
definesound COMPUTER_AMBIENCE   compamb.voc        0   0   0   2   0
definesound GEARS_GRINDING      geargrnd.voc       0   0   0   2   0
definesound BUBBLE_AMBIENCE     bubblamb.voc    -256   0   0   2   0
definesound MACHINE_AMBIENCE    machamb.voc        0   0   0   2   0
definesound SEWER_AMBIENCE      drip3.voc          0   0   0   0   0
definesound WIND_AMBIENCE       wind54.voc         0   0   0   2   0
definesound WIND_REPEAT         wind54.voc         0   0   0   2   0

definesound SOMETHING_DRIPPING  drip3.voc       0   0   0   0    9000
definesound STEAM_HISSING       steamhis.voc       0   0   0   0 10240
definesound BAR_MUSIC           barmusic.voc       0   0 254   2   0
definesound STORE_MUSIC         muzak028.voc       0   0 254   0 6144
definesound STORE_MUSIC_BROKE   muzakdie.voc       0   0   0   0 6144
definesound DUKE_SCREAM         DSCREM04.voc       0   0   0   0   0
definesound KILLME              killme.voc      -128   0   0   0   0

// Miscellaneous Sounds

definesound GETATOMICHEALTH     teleport.voc   2048 2048   255 0   0
definesound DOOR_OPERATE1       slidoor.voc     -256   0   0   0   0
definesound DOOR_OPERATE2       opendoor.voc    -256   0   0   0   0
definesound DOOR_OPERATE3       edoor10.voc     -256   0   0   0   0
definesound DOOR_OPERATE4       edoor11.voc     -256   0   0   0   0
definesound BORNTOBEWILDSND     2bwild.voc         0   0 254   2   0
definesound KTIT                ktitx.voc         0   0 254   2   0
definesound LADY_SCREAM         FSCRM10.voc     -256   0 254   8   0
definesound MONITOR_ACTIVE      monitor.voc        0   0   0   0   0
definesound WATER_GURGLE        h2ogrgl2.voc       0   0   1   2   9000
definesound EXITMENUSOUND       item15.voc         0   0   0   0   0
definesound RATTY               mice3.voc          0   0   0   0   0
definesound INTO_MENU           bulithit.voc    1024 1024  0   0   0

// Six misc ambience city sounds

definesound GENERIC_AMBIENCE1      grind.voc       0   0   0   1   0
definesound GENERIC_AMBIENCE2      enghum.voc      0   0   0   2   0
definesound GENERIC_AMBIENCE3      lava06.voc      0   0   0   2   0
definesound GENERIC_AMBIENCE4      bubblamb.voc -256   0   0   2   0
definesound GENERIC_AMBIENCE5      phonbusy.voc    0   0   0   0   0
definesound GENERIC_AMBIENCE6      roam22.voc      0   0   0   2   0
definesound SECRETLEVELSND         secret.voc      0   0   255 0   0
definesound GENERIC_AMBIENCE8      amb81b.voc      0   0   0   2   0
definesound GENERIC_AMBIENCE9      roam98b.voc     0   0   0   2   0
definesound GENERIC_AMBIENCE10     h2orush2.voc    0   0   0   3   0
definesound GENERIC_AMBIENCE11     projrun.voc     0   0   0   3   0
definesound GENERIC_AMBIENCE12     drip3.voc       0   0   0   0   0
definesound GENERIC_AMBIENCE13     pay02.voc       0   0   255 12  0
definesound GENERIC_AMBIENCE14     onlyon03.voc    0   0   255 4   0
definesound GENERIC_AMBIENCE15     rides09.voc     0   0   255 4   0
definesound GENERIC_AMBIENCE16     doomed16.voc    0   0   255 4   0
definesound GENERIC_AMBIENCE17     myself3a.voc    0   0   255 4   0
definesound GENERIC_AMBIENCE18     monolith.voc    0   0   0   2   0
definesound GENERIC_AMBIENCE19     hydro50.voc     0   0   0   2   0
definesound GENERIC_AMBIENCE20     con03.voc       0   0   0   4   0
definesound GENERIC_AMBIENCE21     !prison.voc     0   0   255 4   0
definesound GENERIC_AMBIENCE22     vpiss2.voc      0   0   255 4   0
definesound GENERIC_AMBIENCE23     2ride06.voc     0   0   255 4   0

definesound SUPERMARKET            aisle402.voc    0   0   0   4   0


definesound FIRE_CRACKLE           fire09.voc       0   0   254 2   0
definesound DUMPSTER_MOVE          grind.voc       0   0   0   0   0

definesound JIBBED_ACTOR1       AMESS06.voc       0   0   255 4   0
definesound JIBBED_ACTOR2       BITCHN04.voc      0   0   255 12  0
definesound JIBBED_ACTOR3       HOLYCW01.voc      0   0   255 4   0
definesound JIBBED_ACTOR4       HOLYSH02.voc      0   0   255 12  0
definesound JIBBED_ACTOR5       IMGOOD12.voc      0   0   255 12  0
definesound JIBBED_ACTOR6       PIECE02.voc       0   0   255 4   0
definesound JIBBED_ACTOR7       GOTHRT01.voc      0   0   255 4   0
definesound JIBBED_ACTOR8       BLOWIT01.VOC      0   0   255 12  0
definesound JIBBED_ACTOR9       EATSHT01.VOC      0   0   255 12  0
definesound JIBBED_ACTOR10      FACE01.VOC        0   0   255 12  0
definesound JIBBED_ACTOR11      INHELL01.VOC      0   0   255 12  0
definesound WHIPYOURASS         WHIPYU01.VOC      0   0   255 4   0
definesound JIBBED_ACTOR12      SUKIT01.VOC       0   0   255 4   0
definesound JIBBED_ACTOR13      LETGOD01.VOC      0   0   255 12  0
definesound JIBBED_ACTOR14      getcrap1.voc      0   0    0  12   0
definesound JIBBED_ACTOR15      guysuk01.voc    0   0    0  12   0

definesound WAR_AMBIENCE1    WARAMB13.VOC -512  0   255  16  0
definesound WAR_AMBIENCE2    WARAMB21.VOC -512  0   254  16  0
definesound WAR_AMBIENCE3    WARAMB23.VOC -512  0   254  16  0
definesound WAR_AMBIENCE4    WARAMB29.VOC -512  0   254  16  0
definesound WAR_AMBIENCE5    FORCE01.VOC    0   0   0    4   0
definesound WAR_AMBIENCE6    QUAKE06.VOC    0   0   0    4   0
definesound WAR_AMBIENCE7    TERMIN01.VOC   0   0   0    4   0
definesound WAR_AMBIENCE8    BORN01.VOC     0   0   254  20  0
definesound WAR_AMBIENCE9    NOBODY01.VOC   0   0   0    4   0
definesound WAR_AMBIENCE10   CHEW05.VOC     0   0   0    12  0

definesound SPACE_DOOR1      hydro22.voc      0   0   0    0   8192
definesound SPACE_DOOR2      hydro24.voc      0   0   0    0   0
definesound SPACE_DOOR3      hydro27.voc      0   0   0    0   8192
definesound SPACE_DOOR4      hydro34.voc      0   0   0    0   0
definesound SPACE_DOOR5      hydro40.voc      0   0   0    0   0

 definesound SPACE_AMBIENCE1   monolith.voc      0   0   0  16  0
 definesound SPACE_AMBIENCE2   hydro50.voc       0   0   0  16  0
 definesound VAULT_DOOR        vault04.voc      0   0   0   0   0

definesound ALIEN_ELEVATOR1   hydro43.voc       0   0   0  0   0
definesound ALIEN_DOOR1       adoor1.voc        0   0   0  0   0
definesound ALIEN_DOOR2       adoor2.voc        0   0   0  0   0

definesound ALIEN_SWITCH1     aswtch23.voc      0   0   0  0   0
definesound COMPANB2          CTRLRM25.VOC  0  0  0  2   0
definesound HELICOP_IDLE      hlidle03.voc  0  0  255  3   0
definesound FOUNDJONES        jones04.voc   0  0  0  4  0
definesound STEPNIT           LIZSHIT3.VOC  0  0  254  12  0
definesound RIPHEADNECK       rip01.voc     0  0  254  12 0

definesound ENDSEQVOL2SND1    gunhit2.voc     0   0   249 0   0
definesound ENDSEQVOL2SND2    headrip3.VOC    0   0   250 0   0
definesound ENDSEQVOL2SND3    buckle.VOC      0   0   251 0   0
definesound ENDSEQVOL2SND4    jetp2.VOC       0   0   252 0   0
definesound ENDSEQVOL2SND5    zipper2.voc     0   0   253 0   0
definesound ENDSEQVOL2SND6    news.voc        0   0   254 0   0
definesound ENDSEQVOL2SND7    whistle.voc     0   0   255 0   0

// definesound ENDSEQVOL3SND1    KICKHEAD.VOC    0   0   254 0   0
definesound ENDSEQVOL3SND2    GMEOVR05.VOC    0   0   254 0   0
definesound ENDSEQVOL3SND3    CHEER.VOC       0   0   254 0   0
definesound ENDSEQVOL3SND4    GRABBAG.VOC     0   0   254 1   0
definesound ENDSEQVOL3SND5    name01.voc      0   0   250 0   0
definesound ENDSEQVOL3SND6    r&r01.voc       0   0   251 0   0
definesound ENDSEQVOL3SND7    lani05.voc      0   0   252 0   0
definesound ENDSEQVOL3SND8    lani08.voc      0   0   253 0   0
definesound ENDSEQVOL3SND9    laniduk2.voc    0   0   254 0   0

definesound SUPERMARKET            aisle402.voc    0   0   0   4   0
definesound MOUSEANNOY             annoy03.voc     0   0   0   4   0
definesound BOOKEM                 bookem03.voc    0   0   0   4   0
definesound SUPERMARKETCRY         cry01.voc       0   0   0   4   0
definesound DESTRUCT               detruct2.voc    0   0 255   0   0
definesound EATFOOD                eat08.voc       0   0   0  12   0
definesound MAKEMYDAY              makeday1.voc    0   0   0   4   0
definesound WITNESSSTAND           sohelp02.voc    0   0   0   4   0
definesound VACATIONSPEECH         vacatn01.voc    0   0   0  12   0
definesound YIPPEE1                yippie01.voc    0   0 255  12   0
definesound YOHOO1                 yohoho01.voc    0   0 128   4   0
definesound YOHOO2                 yohoho09.voc    0   0 128   4   0
definesound DOLPHINSND             dolphin.voc  -512 512   0   0   0
definesound TOUGHGALSND1           dom03.voc       0   0   0   0   0
definesound TOUGHGALSND2           dom09.voc       0   0   0   0   0
definesound TOUGHGALSND3           dom11.voc       0   0   0   0   0
definesound TOUGHGALSND4           dom12.voc       0   0   0   0   0
definesound TANK_ROAM              tank3a.voc      0   0   255 0 6000

definesound VOL4_1                 jacuzzi2.voc    0   0   0   1   0
definesound VOL4_2                 typing.voc      0   0   0   1   0
definesound COOKINGDEEPFRIER       deepfry1.voc    0   0   0   0   0
definesound WHINING_DOG            dogwhine.voc    0   0   0   0   0
definesound DEAD_DOG               dogyelp.voc     0   0   0   0   0
definesound LIGHTNING_SLAP         tclap2a.voc  -256 256   0   0   0
definesound THUNDER                trumble.voc  -512 256   0   0   0
definesound HAPPYMOUSESND1         sweet03.voc     0   0   0   0   0
definesound HAPPYMOUSESND2         sweet04.voc     0   0   0   0   0
definesound HAPPYMOUSESND3         sweet05.voc     0   0   0   0   0
definesound HAPPYMOUSESND4         sweet16.voc     0   0   0   0   0
definesound ALARM                  alarm1a.voc  -128 128 255   2   0
definesound RAIN                   rain3a.voc     -128 128 0   2   0
definesound DTAG_GREENRUN          GRUN.VOC       -128 128 255 128 0
definesound DTAG_BROWNRUN          BRUN.VOC       -128 128 255 128 0
definesound DTAG_GREENSCORE        GSCORE.VOC     -128 128 255 128 0
definesound DTAG_BROWNSCORE        BSCORE.VOC     -128 128 255 128 0
definesound SCREECH                skidcr1.voc    -128 128   4 0   0


definesound INTRO4_1               intro4h1.voc    0   0   255 0   0
definesound INTRO4_B               intro4h2.voc    0   0   255 0   0
definesound INTRO4_2               typing.voc      0   0   255 0   0
definesound INTRO4_3               introa.voc      0   0   255 0   0
definesound INTRO4_4               introb.voc      0   0   255 0   0
definesound INTRO4_5               clang1.voc      0   0   255 0   0
definesound INTRO4_6               introc.voc      0   0   255 0   0

definesound BOSS4_DEADSPEECH       abort01.voc     0   0   255  4   0
definesound BOSS4_FIRSTSEE         kick01-i.voc    0   0   255 12   0
definesound PARTY_SPEECH           party03.voc     0   0   255 12   0
definesound POSTAL_SPEECH          postal01.voc    0   0   255  4   0
definesound TGSPEECH               vocal02.voc     0   0   254  8   0
definesound DOGROOMSPEECH          meat04-n.voc    0   0   255  4   0
definesound SMACKED                smack02.voc     0   0   255 12   0
definesound MDEVSPEECH             mdevl01.voc     0   0   255 12   0
definesound AREA51SPEECH           indpnc01.voc    0   0   255  4   0
definesound JEEPSOUND              jeep2a.voc      0   0   0    2   0
definesound BIGDOORSLAM            cdoor1b.voc     0   0   129  0   0
definesound WAVESOUND              wave1a.voc      0   0   129  3   0
definesound ILLBEBACK              beback01.voc    0   0   255  4   0

definesound VOL4ENDSND1            sbr1c.voc       0   0   255  0    0
definesound VOL4ENDSND2            squish1a.voc    0   0   254  0    0
definesound EXPANDERSHOOT          exshot3b.voc   -32 80   128  0    0
definesound EXPANDERHIT            deepfry1.voc    0   0   128  0    0
definesound SNAKESPEECH            escape01.voc    0   0   255  4    0
definesound GETBACKTOWORK          slacker1.voc    0   0   255  0    0
definesound BIGBANG                bang1.voc       0   0   255  0    0
definesound HORNSND                shorn1.voc      0   0   255  2    0
definesound BELLSND                sbell1a.voc     0   0   255  2    0
definesound GOAWAY                 goaway.voc      0   0    4   0    0
definesound JOKE                   joke.voc        0   0   128  0    0


GAME.CON (v1.5)
/*
--------------------------------------------------------------------------------
Duke Nukem 3D Version 1.4
By Todd Replogle
(c) 1996 3D Realms Entertainment
--------------------------------------------------------------------------------

IMPORTANT NOTICE IF YOU USE MODIFIED .CON FILES

If you are playing a MULTIPLAY game (Dukematch or Co-op) and you are
using *modified* .CON files (USER.CON, GAME.CON, DEFS.CON), then each
multiplayer must be using the EXACT SAME .CON files, or the game might
get out of sync and/or develop interesting problems.

3D Realms encourages you to experiment freely with the parameters
contained in this file, and to share your discoveries with the rest
of the world.  However, BE ADVISED that 3D Realms does NOT offer 
any technical support on how to use this file or other user-modifiable 
features of this game.  Do NOT call 3D Realms or Apogee Software 
for advice or help with this subject.  

You make modifications to this and other files at your own risk. 
It is recommended that you first make a backup copy of this, or
any .CON files before making any changes.
--------------------------------------------------------------------------------
*/

include DEFS.CON
include USER.CON

action ANULLACTION 0

// Below is example code that ADDS enemies/items in Duke Nukem 3D.

// "MYENEMY" is simply a three-framed object bouncing around in random angles
// mindlessly shooting the freeze weapon towards at closest player.
/*
define MYENEMY 3590            // A position in .art file
define MYENEMY_NORMAL_STRENGTH   100
define MYENEMY_TOUGHER_STRENGTH  200
define MYENEMY_DAMAGE_TO_PLAYER  -20

definesound MYENEMY_ROAM   my_eroam.voc   0 0 0 0 0
definesound MYENEMY_HURT   my_ehurt.voc   0 0 0 0 0
definesound MYENEMY_DEAD   my_edead.voc   0 0 0 0 0
definesound MYENEMY_SHOOT  my_eshot.voc   0 0 0 0 0

action MYENEMY_ANIMATIONS  0  3  1  1  4
move MYENEMY_SPEEDS 64

ai AIMYENEMY_BOUNCE   MYENEMY_ANIMATIONS MYENEMY_SPEEDS geth randomangle

useractor enemy MYENEMY

  ifai NO           // 'NO' is defined as '0'
  {               // Prepare(Initialize) MyEnemy for battle...

    // Give 'MYENEMY' strength.  If it
    // has a palette lookup other than
    // 0, make it twice as strong!

    ifspritepal 0
      strength MYENEMY_NORMAL_STRENGTH
    else
      strength MYENEMY_TOUGHER_STRENGTH

    sizeat 48 48      // Set the size of your actor

    cstator 257         // Force actor to block

    ai AIMYENEMY_BOUNCE   // Make it go!

  }

  ifrnd 8
  {

    // Used with keyword 'shoot'.
    // BLOODSPLAT1 ,BLOODSPLAT2 ,BLOODSPLAT3 ,BLOODSPLAT4 ,KNEE ,
    // SHOTSPARK1 ,SHOTGUN ,CHAINGUN ,FIRELASER ,SPIT ,COOLEXPLOSION1 ,
    // FREEZEBLAST ,RPG ,HANDHOLDINGLASER ,BOUNCEMINE ,MORTER ,SHRINKER
    // GROWSPARK

    shoot FREEZEBLAST


    // A sound effect to play for the shooting action.

    sound MYENEMY_SHOOT
  }

  ifcount 48   // if after about a second and a half and...
    ifrnd 16   // if a random value between 0-255 is less than 16...
      ai AIMYENEMY_BOUNCE // reset everything, including all counters

  ifpdistl 1024
    ifrnd 16
  {
    sound DUKE_GRUNT
    palfrom 24 24
    addphealth MYENEMY_DAMAGE_TO_PLAYER
  }

  ifhitweapon         // Was it hit by a weapon?
  {
    debris SCRAP1 2       // OUCH!  Make some peices fall off

    ifdead          // Is it dead yet?
    {             // If so, then...
      addkills 1        //   Add 1 kill to player score
      spawn EXPLOSION2      //   Make an explosion
      sound MYENEMY_DEAD    //   The sound of death

                    // Damage anything within a close distance.
      hitradius 2048 WEAKEST WEAK MEDIUMSTRENGTH TOUGH
      killit          //   Delete sprite (CODE ABORTS HERE)
    }

    sound MYENEMY_HURT    // No?, Make a hurt sound instead
  }
enda
*/



define SPACESHUTTLE 487
move SHUTTLEVELS 16
actor SPACESHUTTLE TOUGH
//  ifmove 0          //  Init once
//    move SHUTTLEVELS getv geth
enda


actor SATELLITE TOUGH
  //  ifmove 0 move SHUTTLEVELS getv geth
  //  ifcount 120 move SHUTTLEVELS getv geth randomangle
enda

state jib_sounds
  ifrnd SWEARFREQUENCY
  {
    ifrnd 128
    {
      ifrnd 128
      {
        ifrnd 128
        {
          ifrnd 128
          {
            ifrnd 128
              globalsound JIBBED_ACTOR12
            else
              globalsound JIBBED_ACTOR1
          }
          else
          {
            ifrnd 128
              globalsound JIBBED_ACTOR9
            else
              globalsound JIBBED_ACTOR14
          }
        }
        else
        {
          ifrnd 128
            globalsound SMACKED
          else
            globalsound JIBBED_ACTOR2
        }
      }
      else
      {
        ifrnd 128
          globalsound MDEVSPEECH
        else
          globalsound JIBBED_ACTOR5
      }
    }
    else
    {
      ifrnd 128
      {
        ifrnd 128
        {
          ifrnd 128
            globalsound JIBBED_ACTOR11
          else
            globalsound JIBBED_ACTOR13
        }
        else
        {
          ifrnd 128
            globalsound JIBBED_ACTOR3
          else
            globalsound JIBBED_ACTOR8
        }
      }
      else
      {
        ifrnd 128
        {
          ifrnd 128
            globalsound JIBBED_ACTOR6
          else
            globalsound JIBBED_ACTOR4
        }
        else
        {
          ifrnd 128
          {
            ifrnd 128
              globalsound JIBBED_ACTOR10
            else
              globalsound JIBBED_ACTOR15

          }
          else
            globalsound JIBBED_ACTOR7
        }
      }
    }
  }
ends


state standard_jibs
  guts JIBS2 1
  guts JIBS3 2
  guts JIBS4 3
  guts JIBS5 2
  guts JIBS6 3
  ifrnd 6
  {
    guts JIBS1 1
    spawn BLOODPOOL
  }         // a badly drawn spine

  state jib_sounds
ends

state genericshrunkcode
  ifcount 32
  {
    ifpdistl SQUISHABLEDISTANCE
    pstomp
  }
  else
  {
    sizeto MINXSTRETCH MINYSTRETCH
    spawn FRAMEEFFECT1
  }
ends

state genericgrowcode
  ifcount 32
  {
    guts JIBS4 24
    guts JIBS6 28
    addkills 1
    sound SQUISHED
    sound PIPEBOMB_EXPLODE
    hitradius 2048 60 70 80 90
    spawn BLOODPOOL
    spawn EXPLOSION2
    killit
  }
  else
  {
    ifactor COMMANDER
      sizeto 100 100
    else
      ifactor SHARK
        sizeto 84 84
    else
      sizeto MAXXSTRETCH MAXYSTRETCH
    break
  }
ends




action ASHARKCRUZING 0 8 5 1 24
action ASHARKFLEE  0 8 5 1 10
action ASHARKATACK   0 8 5 1 6
action ASHARKSHRUNK  0 8 5 1 24
action ASHARKGROW  0 8 5 1 24
action ASHARKFROZEN  0 1 5 1 24

move SHARKVELS 24
move SHARKFASTVELS 72
move SHARKFLEEVELS 40

actor SHARK SHARKSTRENGTH ASHARKCRUZING SHARKVELS randomangle geth
  ifaction ASHARKSHRUNK
  {
    ifcount SHRUNKDONECOUNT
      action ASHARKCRUZING
    else ifcount SHRUNKCOUNT
      sizeto 60 60
    else
      state genericshrunkcode
    break
  }
  else
    ifaction ASHARKGROW
  {
    ifcount SHRUNKDONECOUNT
      action ASHARKCRUZING
    else
      ifcount SHRUNKCOUNT
        sizeto 24 24
    else
      state genericgrowcode
  }
  else
    ifaction ASHARKFROZEN
  {
    fall

    ifp pfacing
      ifpdistl FROZENQUICKKICKDIST
        pkick

    ifcount THAWTIME
    {
      action ASHARKFLEE
      getlastpal
      break
    }
    else
      ifcount FROZENDRIPTIME
        ifactioncount 26
          resetactioncount

    ifhitweapon
    {
      ifwasweapon FREEZEBLAST
        break

      lotsofglass 30
      sound GLASS_BREAKING
      addkills 1
      killit
    }
    break
  }
  else
    ifaction ASHARKFLEE
  {
    ifcount 16
      ifrnd 48
    {
      action ASHARKCRUZING
      move SHARKVELS randomangle geth
    }
  }
  else
    ifaction ASHARKCRUZING
  {
    ifcansee
      ifcount 48
        ifrnd 2
          ifcanshoottarget
    {
      action ASHARKATACK
      move SHARKFASTVELS faceplayerslow getv break
    }
    ifcount 32
      ifnotmoving
    {
      ifrnd 128
        move SHARKVELS randomangle geth
      else
        move SHARKFASTVELS randomangle geth
    }
  }
  else
    ifaction ASHARKATACK
  {
    ifcount 4
    {
      ifpdistl 1280
      {
        ifp palive ifcanshoottarget
        {
          sound DUKE_GRUNT
          palfrom 32 32
          addphealth SHARKBITESTRENGTH
        }
        action ASHARKFLEE
        move SHARKFLEEVELS fleeenemy
      }
    }
    else
      ifnotmoving
    {
      ifcount 32
      {
        action ASHARKCRUZING
        move SHARKVELS randomangle geth
      }
    }
    else
      ifcount 48
        ifrnd 2
    {
      action ASHARKCRUZING
      move SHARKFASTVELS randomangle geth
    }
  }

  ifhitweapon
  {
    ifdead
    {
      ifwasweapon GROWSPARK
      {
        move 0
        cstat 0
        action ASHARKGROW
        sound ACTOR_GROWING
        break
      }
      else
        ifwasweapon FREEZEBLAST
      {
        spritepal 1
        strength 0
        action ASHARKFROZEN
        sound SOMETHINGFROZE
      }
      else
      {
        sound SQUISHED
        guts JIBS6 5
        addkills 1
        killit
      }
    }
    else
    {
      ifwasweapon SHRINKSPARK
      {
        action ASHARKSHRUNK
        sound ACTOR_SHRINKING
        move 0
        break
      }
      else
        ifwasweapon GROWSPARK
          sound EXPANDERHIT

      move SHARKVELS randomangle geth
    }
  }
enda


action BLIMPWAITTORESPAWN

state blimphitstate
  cstat 0
  spawn FIRSTGUNSPRITE
  spawn EXPLOSION2

  debris SCRAP1 40      // Weapons and ammo!
  debris SCRAP2 32
  debris SCRAP3 32
  debris SCRAP4 32
  debris SCRAP5 32

  sound PIPEBOMB_EXPLODE
  ifrespawn
  {
    action BLIMPWAITTORESPAWN
    count 0
    cstat 32768
  }
  else
    killit
ends

actor BLIMP 1

  ifaction BLIMPWAITTORESPAWN
  {
    ifcount BLIMPRESPAWNTIME
    {
      action 0
      cstat 0
    }
    break
  }

  ifhitweapon
  {
    ifwasweapon RADIUSEXPLOSION
      state blimphitstate
    ifwasweapon RPG
      state blimphitstate
    strength 1
  }
enda



state rats
  ifrnd 128
    spawn RAT
  ifrnd 128
    spawn RAT
  ifrnd 128
    spawn RAT
  ifrnd 128
    spawn RAT
  ifrnd 128
    spawn RAT
  ifrnd 128
    spawn RAT
  ifrnd 128
    spawn RAT
  ifrnd 128
    spawn RAT
ends

move RESPAWN_ACTOR_FLAG
move MOUSEVELS 32

action RUBCANDENT 1 1 1 1 1

actor RUBBERCAN WEAK
  ifaction RUBCANDENT
  {
    ifactioncount 16
    {
      strength 0
      action ANULLACTION
      break
    }
  }
  else
    ifhitweapon
  {
    ifwasweapon RADIUSEXPLOSION
    {
      state rats
      ifrnd 48
        spawn BURNING
      debris SCRAP3 12
      killit
    }
    else
      action RUBCANDENT
  }
enda

state toughgalspeech
  ifrnd 64
  {
    ifnosounds
      soundonce TOUGHGALSND1
  }
  else
    ifrnd 64
  {
    ifnosounds
      soundonce TOUGHGALSND2
  }
  else
    ifrnd 64
  {
    ifnosounds
      soundonce TOUGHGALSND3
  }
  else
    ifnosounds
      soundonce TOUGHGALSND4
ends

state jibfood
  sound SQUISHED
  guts JIBS6 3
  killit
ends

state breakobject
  ifaction 0
  {
    action ANULLACTION
    cstator 257
    ifactor ROBOTMOUSE
      clipdist 64
  }
  else
    ifactor ROBOTMOUSE
  {
      ifdead
      {
        ifcount 32
        {
          globalsound MOUSEANNOY
          killit
        }
        break
      }
      ifcount 64 ifrnd 6
      {
        ifrnd 128
          move MOUSEVELS randomangle geth
        else
        {
          ifrnd 64
            soundonce HAPPYMOUSESND1
          else
            ifrnd 64
              soundonce HAPPYMOUSESND2
          else
            ifrnd 64
              soundonce HAPPYMOUSESND3
          else
            soundonce HAPPYMOUSESND4
        }
        resetcount
      }
  }

  ifhitweapon
  {
    ifdead
    {
      ifactor FOODOBJECT6
        state jibfood
      else
        ifactor FOODOBJECT11
          state jibfood
      else
        ifactor FOODOBJECT12
          state jibfood
      else
        ifactor FOODOBJECT13
          state jibfood
      else
        ifactor FOODOBJECT14
          state jibfood
      else
        ifactor FOODOBJECT15
          state jibfood
      else
        ifactor FOODOBJECT16
          state jibfood
      else
        ifactor FOODOBJECT17
          state jibfood
      else
        ifactor SKINNEDCHICKEN
          state jibfood
      else
        ifactor SHOPPINGCART
      {
        debris SCRAP1 5
        debris SCRAP2 5
        debris SCRAP3 5
        sound GLASS_HEAVYBREAK
        killit
      }
      else
        ifactor ROBOTDOG2
      {
        soundonce DEAD_DOG
        guts JIBS2 1
        guts JIBS3 2
        guts JIBS6 3
        killit
      }
      else
        ifactor FEATHEREDCHICKEN
          state jibfood
      else
        ifactor DOLPHIN1
      {
        guts JIBS2 1
        guts JIBS3 2
        guts JIBS4 3
        guts JIBS5 2
        state jibfood
      }
      else
        ifactor DOLPHIN2
      {
        guts JIBS2 1
        guts JIBS3 2
        guts JIBS4 3
        guts JIBS5 2
        state jibfood
      }
      else
        ifactor SNAKEP
      {
        guts JIBS2 1
        guts JIBS3 2
        guts JIBS4 3
        guts JIBS5 2
        state jibfood
      }
      else
        ifactor DONUTS
      {
        spritepal 7
        guts JIBS6 2
        killit
      }
      else
        ifactor DONUTS2
      {
        debris SCRAP1 1
        spritepal 7
        guts JIBS6 2
        killit
      }
      else
        ifactor MAILBAG
        {
          mail 30
          debris SCRAP3 5
          debris SCRAP4 3
          killit
        }
      else
        ifactor TEDDYBEAR
      {
        debris SCRAP3 5
        spritepal 1
        debris SCRAP3 6
      }
      else
      {
        ifrnd 128
          sound GLASS_BREAKING
        else
          sound GLASS_HEAVYBREAK
      }

      ifactor CLOCK
      {
        cactor BROKENCLOCK
        break
      }
      else
        ifactor JOLLYMEAL
      {
        spawn ATOMICHEALTH
        debris SCRAP3 1
        debris SCRAP4 2
      }
      else
        ifactor GUMBALLMACHINE
      {
        cactor GUMBALLMACHINEBROKE
        strength 1
        debris SCRAP4 2
        lotsofglass 10
        break
      }
      else
        ifactor GUMBALLMACHINEBROKE
      {
        debris SCRAP3 3
        debris SCRAP4 2
        lotsofglass 10
      }
      else
        ifactor DUKEBURGER
      {
        debris SCRAP3 14
        debris SCRAP1 13
        debris SCRAP4 12
        debris SCRAP2 12
        debris SCRAP5 11
      }
      else
        ifactor POLICELIGHTPOLE
      {
        debris SCRAP3 4
        debris SCRAP1 3
        debris SCRAP4 2
        debris SCRAP2 2
        debris SCRAP5 1
      }
      else
        ifactor TOPSECRET
          paper 10
      else
        ifactor GUNPOWDERBARREL
      {
        spawn EXPLOSION2
        sound PIPEBOMB_EXPLODE
        hitradius 2048 WEAKEST WEAK MEDIUMSTRENGTH TOUGH
        ifpdistl 2048
          wackplayer
        debris SCRAP1 10      // Weapons and ammo!
        debris SCRAP2 13
        debris SCRAP3 4
        debris SCRAP4 17
        debris SCRAP5 6
      }
      else
        ifactor FLOORBASKET
      {
        spawn PUKE
        debris SCRAP1 2
        debris SCRAP3 3
        debris SCRAP4 2
      }
      else
        ifactor ROBOTMOUSE
      {
        debris SCRAP2 10
        spritepal 1
        debris SCRAP3 4
        resetcount
        cstat 32768
        break
      }
      else
        ifactor ROBOTPIRATE
      {
        debris SCRAP2 10
        debris SCRAP1 5
        debris SCRAP3 3
        lotsofglass 10
      }
      else
        ifactor PIRATE1A
      {
        debris SCRAP2 10
        debris SCRAP1 5
        debris SCRAP3 3
        lotsofglass 10
      }
      else
        ifactor MAN
      {
        debris SCRAP2 10
        debris SCRAP1 5
        debris SCRAP3 3
        lotsofglass 10
      }
      else
        ifactor MAN2
      {
        debris SCRAP2 10
        debris SCRAP1 5
        debris SCRAP3 3
        lotsofglass 10
      }
      else
        ifactor PIRATE2A
      {
        debris SCRAP2 10
        debris SCRAP1 5
        debris SCRAP3 3
        lotsofglass 10
      }
      else
        ifactor PIRATE3A
      {
        debris SCRAP2 10
        debris SCRAP1 5
        debris SCRAP3 3
        lotsofglass 10
      }
      else
        ifactor PIRATE4A
      {
        debris SCRAP2 10
        debris SCRAP1 5
        debris SCRAP3 3
        lotsofglass 10
      }
      else
        ifactor PIRATE4A
      {
        debris SCRAP2 10
        debris SCRAP1 5
        debris SCRAP3 3
        lotsofglass 10
      }
      else
        ifactor PIRATE5A
      {
        debris SCRAP2 10
        debris SCRAP1 5
        debris SCRAP3 3
        lotsofglass 10
      }
      else
        ifactor PIRATE6A
      {
        debris SCRAP2 10
        debris SCRAP1 5
        debris SCRAP3 3
        lotsofglass 10
      }
      else
      {
        lotsofglass 10
        debris SCRAP4 3
      }
      killit
    }
    else
      ifactor DOLPHIN1
    {
      guts JIBS6 1
      soundonce DOLPHINSND
      ifstrength TOUGH
      {
        cactor DOLPHIN2
        sound SQUISHED
      }
    }
    else
      ifactor DOLPHIN2
    {
      guts JIBS6 1
      soundonce DOLPHINSND
    }
    else
      ifactor ROBOTDOG2
    {
      guts JIBS6 1
      soundonce WHINING_DOG
    }
  }
  else
  {
    ifactor CLOCK
      nullop
    else
      ifactor TOPSECRET
        nullop
    else
      ifactor SKINNEDCHICKEN
        nullop
    else
      ifactor FEATHEREDCHICKEN
        nullop
    else
      ifactor FOODOBJECT2
        nullop
    else
      ifactor FOODOBJECT6
        nullop
    else
      ifactor DOLPHIN1
        nullop
    else
      ifactor DOLPHIN2
        nullop
    else
      fall
  }


ends

action ABURGERROTS 0 1 5
useractor notenemy DUKEBURGER PIRATEGALSTRENGTH ABURGERROTS state breakobject enda

useractor notenemy MOP WEAK state breakobject enda

useractor notenemy BROOM WEAK state breakobject enda

useractor notenemy WETFLOOR WEAK state breakobject enda

useractor notenemy DESKLAMP WEAK state breakobject enda

// useractor notenemy DUKECUTOUT WEAK state breakobject enda

useractor notenemy HATRACK WEAK state breakobject enda

useractor notenemy GUNPOWDERBARREL TOUGH state breakobject enda

useractor notenemy COFFEEMACHINE WEAK state breakobject enda

useractor notenemy TEDDYBEAR WEAK state breakobject enda

useractor notenemy TOPSECRET WEAK state breakobject enda

useractor notenemy ROBOTMOUSE ROBOTMOUSESTRENGTH state breakobject enda

useractor notenemy MAN PIRATEGALSTRENGTH state breakobject enda

useractor notenemy MAN2 PIRATEGALSTRENGTH state breakobject enda

useractor notenemy WOMAN PIRATEGALSTRENGTH state breakobject enda

useractor notenemy PIRATE1A PIRATEGALSTRENGTH state breakobject enda

useractor notenemy PIRATE2A PIRATEGALSTRENGTH state breakobject enda

useractor notenemy PIRATE3A PIRATEGALSTRENGTH state breakobject enda

useractor notenemy PIRATE4A PIRATEGALSTRENGTH state breakobject enda

useractor notenemy PIRATE5A PIRATEGALSTRENGTH state breakobject enda

useractor notenemy PIRATE6A PIRATEGALSTRENGTH state breakobject enda

useractor notenemy ROBOTPIRATE PIRATEGALSTRENGTH state breakobject enda

useractor notenemy PIRATEHALF TOUGH state breakobject enda

useractor notenemy CHESTOFGOLD WEAK state breakobject enda

useractor notenemy ROBOTDOG PIRATEGALSTRENGTH state breakobject enda

useractor notenemy ROBOTDOG2 TOUGH state breakobject enda

useractor notenemy PLEASEWAIT state breakobject enda

useractor notenemy FOODOBJECT1 WEAK state breakobject enda

useractor notenemy FOODOBJECT2 WEAK state breakobject enda

useractor notenemy FOODOBJECT3 WEAK state breakobject enda

useractor notenemy FOODOBJECT4 WEAK state breakobject enda

useractor notenemy FOODOBJECT5 WEAK state breakobject enda

useractor notenemy FOODOBJECT6 WEAK state breakobject enda

useractor notenemy FOODOBJECT7 WEAK state breakobject enda

useractor notenemy FOODOBJECT8 WEAK state breakobject enda

useractor notenemy FOODOBJECT9 WEAK state breakobject enda

useractor notenemy FOODOBJECT10 WEAK state breakobject enda

useractor notenemy FOODOBJECT11 WEAK state breakobject enda

useractor notenemy FOODOBJECT12 WEAK state breakobject enda

useractor notenemy FOODOBJECT13 WEAK state breakobject enda

useractor notenemy FOODOBJECT14 WEAK state breakobject enda

useractor notenemy FOODOBJECT15 WEAK state breakobject enda

useractor notenemy FOODOBJECT16 WEAK state breakobject enda

useractor notenemy FOODOBJECT17 WEAK state breakobject enda

useractor notenemy FOODOBJECT18 WEAK state breakobject enda

useractor notenemy FOODOBJECT19 WEAK state breakobject enda

useractor notenemy FOODOBJECT20 WEAK state breakobject enda

useractor notenemy JOLLYMEAL WEAK state breakobject enda

useractor notenemy GUMBALLMACHINE WEAK state breakobject enda

useractor notenemy GUMBALLMACHINEBROKE WEAK state breakobject enda

useractor notenemy POLICELIGHTPOLE TOUGH state breakobject enda

useractor notenemy CLOCK WEAK state breakobject enda

useractor notenemy MAILBAG WEAK state breakobject enda

useractor notenemy FEATHEREDCHICKEN WEAK state breakobject enda

useractor notenemy SKINNEDCHICKEN WEAK state breakobject enda

useractor notenemy HEADLAMP WEAK state breakobject enda

useractor notenemy DOLPHIN1 DOLPHINSTRENGTH state breakobject enda

useractor notenemy DOLPHIN2 DOLPHINSTRENGTH state breakobject enda

useractor notenemy SNAKEP MEDIUMSTRENGTH state breakobject enda

useractor notenemy DONUTS WEAK state breakobject enda

useractor notenemy GAVALS WEAK state breakobject enda

useractor notenemy GAVALS2 WEAK state breakobject enda

useractor notenemy CUPS WEAK state breakobject enda

useractor notenemy DONUTS2 WEAK state breakobject enda

useractor notenemy FLOORBASKET WEAK state breakobject enda

useractor notenemy METER WEAK state breakobject enda

useractor notenemy DESKPHONE WEAK state breakobject enda

useractor notenemy MACE WEAK state breakobject enda

useractor notenemy SHOPPINGCART WEAK state breakobject enda

useractor notenemy COFFEEMUG WEAK state breakobject enda



state headhitstate

// Unrem the following line to invoke screen tilting during
// low player hitpoint damage.

// wackplayer

ends


action EXPBARRELFRAME     0   2   1   1   15
actor EXPLODINGBARREL 26
  fall
  ifaction EXPBARRELFRAME
  {
    ifactioncount 2
    {
      hitradius 1024 WEAKEST WEAK MEDIUMSTRENGTH TOUGH
      spawn EXPLOSION2
      debris SCRAP2 2
      sound PIPEBOMB_EXPLODE
      killit
    }
    break
  }
  ifsquished
  {
    debris SCRAP1 5
    killit
    break
  }
  ifhitweapon
    action EXPBARRELFRAME
enda

action BURNING_FLAME  0   12   1   1   2
move BURNING_VELS 

state burningstate

  sleeptime 300


  ifspawnedby BURNING
  {
    ifgapzl 16
      break
  }
  else
    ifspawnedby BURNING2
  {
    ifgapzl 16
      break
  }

  ifpdistg 10240
    break

  ifcount 128
  {
    ifspawnedby TIRE
    {
      ifactioncount 512
        killit
      ifrnd 16
        sizeto 64 48
    }
    else
    {
      sizeto 8 8
      sizeto 8 8
      ifcount 192
        killit
    }
  }
  else
  {
    ifmove 0
      move BURNING_VELS

    sizeto 52 52

    ifp palive
      ifpdistl 844
        ifrnd 32
          ifcansee
    {
      soundonce DUKE_LONGTERM_PAIN
      addphealth -1
      palfrom 24 16
    }
  }

ends

actor BURNING WEAK BURNING_FLAME
  state burningstate
enda

actor BURNING2 WEAK BURNING_FLAME
  state burningstate
enda

action TOILETWATERFRAMES 0 4 1 1 1
actor TOILETWATER 0 TOILETWATERFRAMES
  ifpdistl 8192
  {
    soundonce WATER_GURGLE
    ifspawnedby TOILET
      sizeto 34 34
    else
    {
      ifspawnedby WATERFOUNTAINBROKE
        sizeto 6 15
      else
        ifspawnedby TOILETWATER
          nullop
      else
        sizeto 24 32
    }

    ifp palive
      ifpdistl RETRIEVEDISTANCE
        ifp pfacing
          ifactioncount 32
            ifphealthl MAXPLAYERHEALTH
              ifhitspace
                ifcansee
    {
      addphealth 1
      globalsound DUKE_DRINKING
      resetactioncount
    }
  }
enda

action WOODENHORSEFRAME  0   1   4
action WOODENFALLFRAME  122  1   5

actor HORSEONSIDE WEAKEST
  cactor WOODENHORSE
  action WOODENFALLFRAME
enda
actor WOODENHORSE WEAK WOODENHORSEFRAME
  fall
  ifhitweapon
  {
    ifdead
    {
      debris SCRAP1 4
      debris SCRAP2 3
      killit
    }
    else
      action WOODENFALLFRAME
  }
enda

state steamcode
  ifpdistl 6144
    soundonce STEAM_HISSING

  ifcount 20
    {
      resetcount
      ifp palive
        ifpdistl 1024
      {
        addphealth -1
        palfrom 16 16
      }
    }
  else
  {
    ifspawnedby STEAM
      break
    else
      ifspawnedby CEILINGSTEAM
        break

    sizeto 24 24
  }
ends

action STEAMFRAMES    0     5     1     1     1
actor STEAM 0 STEAMFRAMES
  state steamcode
enda

actor CEILINGSTEAM 0 STEAMFRAMES
  state steamcode
enda

actor WATERBUBBLEMAKER 0 0 randomangle
  ifpdistl 3084
    ifrnd 24
      spawn WATERBUBBLE
enda

action BUBBLE
action CRACKEDBUBBLE  1
move BUBMOVE       -10 -36
move BUBMOVEFAST     -10 -52

actor WATERBUBBLE 0 BUBBLE BUBMOVE getv geth randomangle

  ifaction CRACKEDBUBBLE
  {
    ifinwater
      ifrnd 192
        killit
    ifactioncount 7
      killit
  }
  else
  {
    ifcount 4
    {
      ifrnd 192
        move BUBMOVE getv geth randomangle
      else
        move BUBMOVEFAST getv geth randomangle
      resetcount

      ifrnd 84
        sizeat 8 10
      else
        ifrnd 84
          sizeat 10 8
      else
        sizeat 9 9
    }

    ifonwater
    {
      iffloordistl 8
        action CRACKEDBUBBLE
    }
    else
      ifactioncount 40
        action CRACKEDBUBBLE
  }
enda


move SMOKEVEL 8 -16
move ENGINE_SMOKE 64 -64
move SMOKESHOOTOUT -192
action SMOKEFRAMES 0 4 1 1 10
actor SMALLSMOKE 0 SMOKEFRAMES
  ifmove 0
  {
    ifspawnedby RECON
      move SMOKESHOOTOUT geth
    else
      ifspawnedby SECTOREFFECTOR
        move ENGINE_SMOKE geth getv
    else
      move SMOKEVEL geth getv faceplayer
    ifspawnedby RPG
      cstat 2
  }
  ifpdistl 1596
    ifspawnedby RPG
      killit
  ifactioncount 4
    killit
enda

action BARREL_DENTING  2 2 1 1 6
action BARREL_DENTED   1
action BARREL_DENTED2  2

move SPAWNED_BLOOD

actor NUKEBARRELDENTED WEAK
  cactor NUKEBARREL
  action BARREL_DENTED
enda

actor NUKEBARRELLEAKED WEAK
  cactor NUKEBARREL
  action BARREL_DENTED2
enda

state random_ooz
  ifrnd 128
    spawn OOZ2
  else
    spawn OOZ
ends

actor NUKEBARREL MEDIUMSTRENGTH
  ifsquished
  {
    debris SCRAP1 32
    spawn BLOODPOOL
    state random_ooz
    killit
  }
  fall
  ifaction BARREL_DENTING
  {
    ifactioncount 2
    {
      debris SCRAP1 10
      ifrnd 2 spawn BLOODPOOL
      killit
    }
  }
  else
    ifhitweapon
  {
    ifdead
    {
      sound VENT_BUST

      ifrnd 128
        spawn BLOODPOOL
      action BARREL_DENTING
    }
    else
    {
      ifaction 0
        action BARREL_DENTED
      else
        ifaction BARREL_DENTED
      {
        action BARREL_DENTED2
        spawn BLOODPOOL
      }
      else
        ifaction BARREL_DENTED2
          action BARREL_DENTING
    }
  }
enda

state burningbarrelcode
  fall
  ifcount 32
  {
    resetcount
    ifp palive
      ifpdistl 1480
        ifp phigher
    {
      addphealth -1
      palfrom 16 16
      ifrnd 96
        sound DUKE_LONGTERM_PAIN
    }
  }
  ifhitweapon
  {
    sound VENT_BUST
    debris SCRAP1 10
    ifrnd 128
      spawn BURNING
    else
      spawn BURNING2
    killit
  }
ends

actor FIREBARREL
  state burningbarrelcode
enda
actor FIREVASE
  state burningbarrelcode
enda

action SHRINKERFRAMES 0 4 1 1 10
actor SHRINKEREXPLOSION 0 SHRINKERFRAMES
  ifactioncount 4
    killit
enda

action EXPLOSION_FRAMES 0 20 1 1  4
actor EXPLOSION2 1 EXPLOSION_FRAMES
  ifactioncount 20
    killit
enda

actor EXPLOSION2BOT 1 EXPLOSION_FRAMES
  ifactioncount 20
    killit
enda

action FFLAME_FR 0 16 1 1 1
action FFLAME 0 1 1 1 1

actor FLOORFLAME 0 FFLAME_FR
  ifaction FFLAME_FR
  {
    ifpdistl 1024
      hitradius 1024 WEAKEST WEAKEST WEAKEST WEAKEST
    ifactioncount 16
      action FFLAME
  }
  ifaction FFLAME
    ifrnd 4
  {
    action FFLAME_FR
    sound CAT_FIRE
    resetactioncount
  }
enda



action ASATNSPIN     0 5 1 1 4
action ASATSHOOTING   -10 3 5 1 40
action ASATWAIT      0 1 5 1 1
move TURRVEL

actor ROTATEGUN ROTTURRETSTRENGTH
// ASATSHOOTING TURRVEL faceplayer

  ifaction 0
  {
    action ASATSHOOTING
    move TURRVEL faceplayer
  }
  else
    ifaction ASATNSPIN
  {
    ifactioncount 32
    {
      action ASATWAIT
      move TURRVEL faceplayer
    }
  }
  else
    ifaction ASATSHOOTING
  {
    ifactioncount 12
      ifrnd 32
    {
      action ASATWAIT
      move 0
    }
    ifcount 32
      resetcount
    else
      ifcount 16
    {
      ifcount 17 nullop
      else
      {
        sound PRED_ATTACK
        shoot FIRELASER
      }
    }
    else
      ifcount 4
    {
      ifcount 5 nullop
      else
      {
        ifcansee
          ifcanshoottarget
        {
          sound PRED_ATTACK
          shoot FIRELASER
        }
      }
    }
  }
  else
    ifaction ASATWAIT
  {
    ifactioncount 64
      ifrnd 32
        ifp palive
          ifcansee
    {
      action ASATSHOOTING
      move TURRVEL faceplayer
    }
  }
  ifhitweapon
  {
    ifdead
    {
      addkills 1
      sound LASERTRIP_EXPLODE
      debris SCRAP1 15
      spawn EXPLOSION2
      killit
    }
    else
    {
      action ASATNSPIN
      debris SCRAP1 4
    }
    move 0
  }
enda

action RIP_F 0 8 1 1 1
actor FORCERIPPLE 0 RIP_F
  ifactioncount 8
    killit
enda

action TRANSFOWARD 0  6  1  1  2
action TRANSBACK   5  6  1 -1  2
actor TRANSPORTERSTAR 0 TRANSFOWARD
  ifaction TRANSFOWARD
  {
    ifactioncount 6
      action TRANSBACK
  }
  else
    ifactioncount 6
      killit
enda

action BEAMFOWARD  0  4  1  1  9
actor TRANSPORTERBEAM 0 BEAMFOWARD
  sizeto 32 64
  sizeto 32 64
  sizeto 32 64
  ifactioncount 4
    killit
enda

state getcode
  ifactor ATOMICHEALTH
    globalsound GETATOMICHEALTH
  else
    globalsound DUKE_GET
  palfrom 16 0 32
  ifrespawn
  {
    move RESPAWN_ACTOR_FLAG
    spawn RESPAWNMARKERRED
    cstat 32768
  }
  else
    killit
ends

state randgetweapsnds
  ifrnd 64
    globalsound DUKE_GETWEAPON1
  else
    ifrnd 96
      globalsound DUKE_GETWEAPON2
  else
    ifrnd 128
      globalsound DUKE_GETWEAPON3
  else
    ifrnd 140
      globalsound DUKE_GETWEAPON4
  else
    globalsound DUKE_GETWEAPON6
ends

state getweaponcode

  state randgetweapsnds

  palfrom 32 0 32
  ifgotweaponce 1
    break
  ifrespawn
  {
    move RESPAWN_ACTOR_FLAG
    spawn RESPAWNMARKERRED
    cstat 32768
  }
  else
    killit
ends


state respawnit
  ifcount RESPAWNITEMTIME
  {
    spawn TRANSPORTERSTAR
    move 0
    cstat 0
    sound TELEPORTER
  }
ends

state quikget
  ifactor ATOMICHEALTH
    globalsound GETATOMICHEALTH
  else
    globalsound DUKE_GET
  palfrom 16 0 32
  killit
ends

state quikweaponget
  state randgetweapsnds
  palfrom 32 0 32
  ifgotweaponce 1
    break
  killit
ends

actor STEROIDS
  fall
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
    ifp pshrunk
      nullop
    else
      ifp palive
        ifcount 6
          ifpdistl RETRIEVEDISTANCE
            ifpinventory GET_STEROIDS STEROID_AMOUNT
              ifcanseetarget
      {
        addinventory GET_STEROIDS STEROID_AMOUNT
        quote 37
        ifspawnedby STEROIDS
          state getcode
        else
          state quikget
      }
enda

actor BOOTS
  fall
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
    ifp pshrunk
      nullop
    else
      ifp palive
        ifcount 6
          ifpdistl RETRIEVEDISTANCE
            ifpinventory GET_BOOTS BOOT_AMOUNT
              ifcanseetarget
      {
        addinventory GET_BOOTS BOOT_AMOUNT
        quote 6
        ifspawnedby BOOTS
          state getcode
        else
          state quikget
      }
enda

actor HEATSENSOR
  fall
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
    ifp pshrunk
      nullop
  else
    ifp palive
      ifcount 6
        ifpdistl RETRIEVEDISTANCE
          ifpinventory GET_HEATS HEAT_AMOUNT
            ifcanseetarget
      {
        addinventory GET_HEATS HEAT_AMOUNT
        quote 101
        ifspawnedby HEATSENSOR
          state getcode
        else
          state quikget
      }
enda

actor SHIELD
  fall
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
    ifp pshrunk nullop
    else
      ifp palive
        ifcount 6
          ifpdistl RETRIEVEDISTANCE
            ifpinventory GET_SHIELD SHIELD_AMOUNT
              ifcanseetarget
      {
        ifspawnedby PIGCOP
        {
          ifrnd 128
            addinventory GET_SHIELD PIG_SHIELD_AMOUNT1
          else
            addinventory GET_SHIELD PIG_SHIELD_AMOUNT2
          quote 104
          sound KICK_HIT
          palfrom 24 0 32
          killit
        }
        else
          addinventory GET_SHIELD SHIELD_AMOUNT
        quote 38
        ifspawnedby SHIELD
          state getcode
        else
          state quikget
      }
enda


actor AIRTANK
  fall
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
    ifp pshrunk nullop
    else
      ifp palive
        ifcount 6
          ifpdistl RETRIEVEDISTANCE
            ifpinventory GET_SCUBA SCUBA_AMOUNT
              ifcanseetarget
      {
        addinventory GET_SCUBA SCUBA_AMOUNT
        quote 39
        ifspawnedby AIRTANK
          state getcode
        else
          state quikget
      }
enda

action HOLODUKE_FRAMES 0 4 1 1 8
actor HOLODUKE 0 HOLODUKE_FRAMES
  fall
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
    ifp pshrunk nullop
    else
      ifp palive
        ifcount 6
          ifpdistl RETRIEVEDISTANCE
            ifpinventory GET_HOLODUKE HOLODUKE_AMOUNT
              ifcanseetarget
      {
        addinventory GET_HOLODUKE HOLODUKE_AMOUNT
        quote 51
        ifspawnedby HOLODUKE
          state getcode
        else
          state quikget
      }
enda

actor JETPACK
  fall
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
    ifp pshrunk nullop
    else
      ifp palive
        ifpdistl RETRIEVEDISTANCE
          ifcount 6
            ifpinventory GET_JETPACK JETPACK_AMOUNT
              ifcanseetarget
      {
        addinventory GET_JETPACK JETPACK_AMOUNT
        quote 41
        ifspawnedby JETPACK
          state getcode
        else
          state quikget
      }
enda

actor ACCESSCARD
  fall
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
    ifp pshrunk nullop
    else
      ifp palive
        ifpdistl RETRIEVEDISTANCE
          ifcount 6
            ifcanseetarget
      {
        ifpinventory GET_ACCESS 0
          break
        addinventory GET_ACCESS 1
        quote 43
        state getcode
      }
enda

actor AMMO
  fall
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
    ifp pshrunk nullop
    else
      ifp palive
        ifcount 6
          ifpdistl RETRIEVEDISTANCE
            ifcanseetarget
      {
        addammo PISTOL_WEAPON PISTOLAMMOAMOUNT
        quote 65
        ifspawnedby AMMO
          state getcode
        else
          state quikget
      }
enda

actor FREEZEAMMO
  fall
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
    ifp pshrunk nullop
    else
      ifp palive
        ifcount 6
          ifpdistl RETRIEVEDISTANCE
            ifcanseetarget
      {
        addammo FREEZE_WEAPON FREEZEAMMOAMOUNT
        quote 66
        ifspawnedby FREEZEAMMO
          state getcode
        else
          state quikget
      }
enda

actor SHOTGUNAMMO
  fall
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
    ifp pshrunk nullop
    else
      ifp palive
        ifcount 6
          ifpdistl RETRIEVEDISTANCE
            ifcanseetarget
      {
        addammo SHOTGUN_WEAPON SHOTGUNAMMOAMOUNT
        quote 69
        ifspawnedby SHOTGUNAMMO
          state getcode
        else
          state quikget
      }
enda

actor AMMOLOTS
  fall
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
    ifp pshrunk nullop
    else
      ifp palive
        ifcount 6
          ifpdistl RETRIEVEDISTANCE
            ifcanseetarget
      {
        addammo PISTOL_WEAPON 48
        quote 65
        ifspawnedby AMMOLOTS
          state getcode
        else
          state quikget
      }
enda

actor CRYSTALAMMO
  fall
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
    ifp pshrunk nullop
    else
      ifp palive
        ifpdistl RETRIEVEDISTANCE
          ifcount 6
            ifcanseetarget
      {
        addammo SHRINKER_WEAPON CRYSTALAMMOAMOUNT
        quote 78
        ifspawnedby CRYSTALAMMO
          state getcode
        else
          state quikget
      }
enda

actor GROWAMMO
  fall
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
    ifp pshrunk nullop
    else
      ifp palive
        ifpdistl RETRIEVEDISTANCE
          ifcount 6
            ifcanseetarget
      {
        addammo GROW_WEAPON GROWCRYSTALAMMOAMOUNT
        quote 123
        ifspawnedby GROWAMMO
          state getcode
        else
          state quikget
      }
enda

actor BATTERYAMMO
  fall
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
    ifp pshrunk nullop
    else
      ifp palive
        ifpdistl RETRIEVEDISTANCE
          ifcount 6
            ifcanseetarget
      {
        addammo CHAINGUN_WEAPON CHAINGUNAMMOAMOUNT
          quote 63
        ifspawnedby BATTERYAMMO
          state getcode
        else
          state quikget
      }
enda

actor DEVISTATORAMMO
  fall
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
    ifp pshrunk nullop
    else
      ifp palive
        ifpdistl RETRIEVEDISTANCE
          ifcount 6
            ifcanseetarget
      {
        addammo DEVISTATOR_WEAPON DEVISTATORAMMOAMOUNT
        quote 14
        ifspawnedby DEVISTATORAMMO
          state getcode
        else
          state quikget
      }
enda

actor RPGAMMO
  fall
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
    ifp pshrunk nullop
    else ifp palive
      ifpdistl RETRIEVEDISTANCE
        ifcount 6
          ifcanseetarget
      {
        addammo RPG_WEAPON RPGAMMOBOX
        quote 64
        ifspawnedby RPGAMMO
          state getcode
        else
          state quikget
      }
enda

actor HBOMBAMMO
  fall
  ifmove RESPAWN_ACTOR_FLAG state respawnit
  else
    ifp pshrunk nullop
    else
      ifp palive
        ifpdistl RETRIEVEDISTANCE
          ifcount 6
            ifcanseetarget
      {
        ifgotweaponce 0
          break

        addweapon HANDBOMB_WEAPON HANDBOMBBOX
        quote 55
//        addammo HANDBOMB_WEAPON HANDBOMBBOX

        ifspawnedby HBOMBAMMO
          state getweaponcode
        else
          state quikweaponget
      }
enda

actor RPGSPRITE
  fall
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
    ifp pshrunk nullop
    else
      ifp palive
        ifpdistl RETRIEVEDISTANCE
          ifcount 6
            ifcanseetarget
      {
        ifgotweaponce 0
          break

        addweapon RPG_WEAPON RPGAMMOBOX
        quote 56
        ifspawnedby RPGSPRITE
          state getweaponcode
        else
          state quikweaponget
      }
enda

actor SHOTGUNSPRITE
  fall
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
    ifp pshrunk nullop
    else
      ifp palive
        ifpdistl RETRIEVEDISTANCE
          ifcount 6
            ifcanseetarget
      {
        ifspawnedby PIGCOP
        {
          addweapon SHOTGUN_WEAPON 0
          ifrnd 64
            addammo SHOTGUN_WEAPON 4
          else ifrnd 64
            addammo SHOTGUN_WEAPON 3
          else ifrnd 64
            addammo SHOTGUN_WEAPON 2
          else
            addammo SHOTGUN_WEAPON 1
        }
        else
        {
          ifgotweaponce 0
            break
          addweapon SHOTGUN_WEAPON SHOTGUNAMMOAMOUNT
          quote 57
        }

        ifspawnedby SHOTGUNSPRITE
          state getweaponcode
        else
          state quikweaponget
      }
enda



actor SIXPAK
  fall
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
    ifp pshrunk nullop
    else
      ifp palive
        ifpdistl RETRIEVEDISTANCE
          ifcount 6
            ifphealthl MAXPLAYERHEALTH
              ifcanseetarget
      {
        addphealth 30
        quote 62
        ifspawnedby SIXPAK
          state getcode
        else
          state quikget
      }
enda

actor COLA
  fall
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
    ifp pshrunk nullop
    else
      ifp palive
        ifpdistl RETRIEVEDISTANCE
          ifcount 6
            ifphealthl MAXPLAYERHEALTH
              ifcanseetarget
      {
        addphealth 10
        quote 61
        ifspawnedby COLA
          state getcode
        else
          state quikget
      }
enda

actor ATOMICHEALTH
  fall
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
    ifp pshrunk nullop
    else
      ifp palive
        ifpdistl RETRIEVEDISTANCE
          ifcount 6
            ifphealthl MAXPLAYERATOMICHEALTH
              ifcanseetarget
      {
        addphealth 50
        quote 19
        ifspawnedby ATOMICHEALTH
          state getcode
        else
          state quikget
      }
enda




actor FIRSTAID
  fall
  ifmove RESPAWN_ACTOR_FLAG state respawnit
  else
    ifp pshrunk nullop
    else
      ifp palive
        ifpdistl RETRIEVEDISTANCE
          ifcount 6
            ifpinventory GET_FIRSTAID FIRSTAID_AMOUNT
              ifcanseetarget
      {
        addinventory GET_FIRSTAID FIRSTAID_AMOUNT
        quote 3

        ifspawnedby FIRSTAID
          state getcode
        else
          state quikget
      }
enda


actor FIRSTGUNSPRITE
  fall
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
    ifp pshrunk nullop
    else
      ifp palive
        ifpdistl RETRIEVEDISTANCE
          ifcount 6
            ifcanseetarget
      {
        ifgotweaponce 0
          break
        addweapon PISTOL_WEAPON 48
        ifspawnedby FIRSTGUNSPRITE
          state getweaponcode
        else
          state quikweaponget
      }
enda


actor TRIPBOMBSPRITE
  fall
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
    ifp pshrunk nullop
    else
      ifp palive
        ifpdistl RETRIEVEDISTANCE
          ifcount 6
            ifcanseetarget
      {
        ifgotweaponce 0
          break

        addweapon TRIPBOMB_WEAPON 1
        quote 58
        ifspawnedby TRIPBOMBSPRITE
          state getweaponcode
        else
          state quikweaponget
      }
enda

actor CHAINGUNSPRITE
  fall
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
    ifp pshrunk nullop
    else
      ifp palive
        ifpdistl RETRIEVEDISTANCE
          ifcount 6
            ifcanseetarget
      {
        ifgotweaponce 0
          break

        addweapon CHAINGUN_WEAPON 50
        quote 54
        ifspawnedby CHAINGUNSPRITE
          state getweaponcode
        else
          state quikweaponget
      }
enda



actor SHRINKERSPRITE
  fall
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
    ifp pshrunk nullop
    else
      ifp palive
        ifpdistl RETRIEVEDISTANCE
          ifcount 6
            ifcanseetarget
      {
        ifgotweaponce 0
          break
        addweapon SHRINKER_WEAPON 10
        quote 60
        ifspawnedby SHRINKERSPRITE
          state getweaponcode
        else
          state quikweaponget
      }
enda

actor FREEZESPRITE
  fall
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
    ifp pshrunk nullop
    else
      ifp palive
        ifpdistl RETRIEVEDISTANCE
          ifcount 6
            ifcanseetarget
      {
        ifgotweaponce 0
          break

        addweapon FREEZE_WEAPON FREEZEAMMOAMOUNT
        quote 59
        ifspawnedby FREEZESPRITE
          state getweaponcode
        else
          state quikweaponget
      }
enda

actor DEVISTATORSPRITE
  fall
  ifmove RESPAWN_ACTOR_FLAG state respawnit
  else
    ifp pshrunk nullop
    else
      ifp palive
        ifpdistl RETRIEVEDISTANCE
          ifcount 6
            ifcanseetarget
      {
        ifgotweaponce 0
          break
        addweapon DEVISTATOR_WEAPON DEVISTATORAMMOAMOUNT
        quote 87
        ifspawnedby DEVISTATORSPRITE
          state getweaponcode
        else
          state quikweaponget
      }
enda

action FIRE_FRAMES   -1 14 1 1 1
move FIREVELS

state firestate

  ifaction 0
    ifrnd 16
    {
      action FIRE_FRAMES
      cstator 128
    }

  sleeptime 300         // Never let it fall to sleep

  ifspawnedby FIRE
  {
    ifgapzl 16
      break
  }
  else
    ifspawnedby FIRE2
  {
    ifgapzl 16
      break
  }

  ifinwater
    killit

  ifp palive
    ifpdistl 844
      ifrnd 32
        ifcansee
  {
    soundonce DUKE_LONGTERM_PAIN
    addphealth -1
    palfrom 32 32
  }

  ifactor FIRE
  {
    ifspawnedby FIRE
      break
  }
  else
    ifactor FIRE2
      ifspawnedby FIRE2
        break

  iffloordistl 128
  {
    ifrnd 128
    {
      ifcount 84
        killit
                // This line(and the else below)
                // is not necessary, since actors
                // with zero x-size are automatically
                // deleted anyway!
      else
        ifcount 42
          sizeto 0 0
      else
        sizeto 32 32
    }
  }
  else
    killit

ends

useractor notenemy FIRE WEAK 0 FIREVELS state firestate enda
useractor notenemy FIRE2 WEAK 0 FIREVELS state firestate enda

actor FECES
  ifcount 24
  {
    ifpdistl RETRIEVEDISTANCE
    {
      ifrnd SWEARFREQUENCY
        soundonce DUKE_STEPONFECES

      sound STEPNIT

      spawn BLOODPOOL   // Will be brown
      killit
    }
  }
  else
    sizeto 32 32
enda

state drop_ammo
  ifrnd SPAWNAMMOODDS
    spawn AMMO
ends

state drop_battery
  ifrnd SPAWNAMMOODDS
    spawn BATTERYAMMO
ends
state drop_sgshells
  ifrnd SPAWNAMMOODDS
    spawn SHOTGUNAMMO
ends
state drop_shotgun
  ifrnd SPAWNAMMOODDS
    spawn SHOTGUNSPRITE
ends
state drop_chaingun
  ifrnd SPAWNAMMOODDS
  {
    ifrnd 32
      spawn CHAINGUNSPRITE
    else
      spawn BATTERYAMMO
  }
ends


state random_wall_jibs
  ifrnd 96
    shoot BLOODSPLAT1
  ifrnd 96
    shoot BLOODSPLAT2
  ifrnd 96
    shoot BLOODSPLAT3
  ifrnd 96
    shoot BLOODSPLAT4
  ifrnd 96
    shoot BLOODSPLAT1
ends




action FEMSHRUNK
action FEMFROZEN1 1
action FEMGROW
action FEMFROZEN2
action FEMDANCE1 19 1 1 1 16
action FEMDANCE3 19 1 1 1 26
action FEMDANCE2 20 2 1 1 10

action FEMANIMATESLOW 0 2 1 1 100
action TOUGHGALANIM   0 5 1 1 25
action FEMANIMATE

state femcode

  ifactor NAKED1 nullop
  else
    ifactor FEM6 nullop
    else
    {
      fall
      ifactor BLOODYPOLE
        ifhitweapon
          ifdead
      {
        state standard_jibs
        killit
      }
    }

  ifaction FEMSHRUNK
  {
    ifcount SHRUNKDONECOUNT
    {
      action FEMANIMATE
      cstat 257
    }
    else
      ifcount SHRUNKCOUNT
        sizeto 40 40
    else
      state genericshrunkcode
  }
  else ifaction FEMGROW
  {
    ifcount 32
    {
      respawnhitag
      guts JIBS4 20
      guts JIBS6 20
      spritepal 6
      soundonce LADY_SCREAM
      ifactor NAKED1
        debris SCRAP3 4
      else
        ifactor PODFEM1
          debris SCRAP3 4
      sound SQUISHED
      killit
    }
    else
      sizeto MAXXSTRETCH MAXYSTRETCH
  }

  else
    ifaction FEMDANCE1
  {
    ifactioncount 2
      action FEMDANCE2
  }
  else
    ifaction FEMDANCE2
  {
    ifactioncount 8
      action FEMDANCE3
  }
  else
    ifaction FEMDANCE3
  {
    ifactioncount 2
    action FEMANIMATE
  }
  else
    ifaction FEMFROZEN1
  {
    ifcount THAWTIME
    {
      action FEMANIMATE
      getlastpal
    }
    else
      ifcount FROZENDRIPTIME
    {
      ifactioncount 26
      {
        spawn WATERDRIP
        resetactioncount
      }
    }

    ifhitweapon
    {
      ifwasweapon FREEZEBLAST
      {
        strength 0
        break
      }
      lotsofglass 30
      sound GLASS_BREAKING
      respawnhitag
      ifrnd 84
        spawn BLOODPOOL
      killit
    }
    else
      ifp pfacing
        ifpdistl FROZENQUICKKICKDIST
          pkick
    break
  }
  else ifaction FEMFROZEN2
  {
    ifcount THAWTIME
    {
      ifactor TOUGHGAL
        action TOUGHGALANIM
      else
        ifactor FEM10
          action FEMANIMATESLOW
      else
        action FEMANIMATE

      getlastpal
    }
    else
      ifcount FROZENDRIPTIME
    {
      ifactioncount 26
      {
        spawn WATERDRIP
        resetactioncount
      }
    }

    ifhitweapon
    {
      ifwasweapon FREEZEBLAST
      {
        strength 0
          break
      }

      lotsofglass 30

      sound GLASS_BREAKING
      ifrnd 84
        spawn BLOODPOOL
      respawnhitag

      ifrnd 128
        sound DUKE_HIT_STRIPPER1
      else
        sound DUKE_HIT_STRIPPER2

      killit
    }
    else
      ifp pfacing
        ifpdistl FROZENQUICKKICKDIST
          pkick
    break
  }

  ifhitweapon
  {
    ifdead
    {
      ifwasweapon GROWSPARK
      {
        cstat 0
        move 0
        sound ACTOR_GROWING
        action FEMGROW
        break
      }
      else ifwasweapon FREEZEBLAST
      {
        ifaction FEMSHRUNK
          break

        ifactor NAKED1
          action FEMFROZEN2
        else
          ifactor FEM5
            action FEMFROZEN2
        else
          ifactor FEM6
            action FEMFROZEN2
        else
          ifactor FEM8
            action FEMFROZEN2
        else
          ifactor FEM9
            action FEMFROZEN2
        else
          ifactor FEM10
            action FEMFROZEN2
        else
          ifactor TOUGHGAL
            action FEMFROZEN2
        else
          ifactor PODFEM1
            action FEMFROZEN2
        else
          action FEMFROZEN1

        move 0
        spritepal 1
        strength 0

        sound SOMETHINGFROZE

        break
      }

      ifrnd 128
        sound DUKE_HIT_STRIPPER1
      else
        sound DUKE_HIT_STRIPPER2

      respawnhitag
      state standard_jibs
      state random_wall_jibs
      spawn BLOODPOOL

      ifactor FEM1
        money 5
      else
        ifactor FEM2
      {
        money 7
        cactor BARBROKE
        cstat 0
      }
      else
        ifactor FEM3
          money 4
      else
        ifactor FEM7
          money 8

      ifactor FEM5
      {
        strength TOUGH
        cactor BLOODYPOLE
      }
      else ifactor FEM6
      {
        cstat 0
        cactor FEM6PAD
      }
      else
        ifactor FEM8
      {
        strength TOUGH
        cactor BLOODYPOLE
      }
      else
      {
        spritepal 6
        soundonce LADY_SCREAM
        ifactor NAKED1
          debris SCRAP3 18
        else
          ifactor PODFEM1
            debris SCRAP3 18
        killit
      }
    }
    else
    {
      ifwasweapon SHRINKSPARK
      {
        sound ACTOR_SHRINKING
        move 0
        action FEMSHRUNK
        cstat 0
        break
      }
      else
        ifwasweapon GROWSPARK
          sound EXPANDERHIT
      ifactor FEM8
        break

      ifactor TOUGHGAL
          state toughgalspeech
      else sound SQUISHED

      guts JIBS6 1
    }
  }
ends

state killme
  ifinwater nullop
  else
    ifp pfacing
      ifpdistl 1280
        ifhitspace
          soundonce KILLME
ends

state tipme
  ifp pfacing
    ifpdistl 1280
      ifhitspace
  {
    tip
    ifrnd 128
      soundonce DUKE_TIP1
    else
      soundonce DUKE_TIP2
    ifactor FEM1
      action FEMDANCE1
  }
ends

state toughgaltalk
  ifp pfacing
    ifpdistl 1280
      ifhitspace
        state toughgalspeech
ends

actor FEM1 TOUGH FEMANIMATE
  state tipme
  state femcode
enda
actor FEM2 TOUGH FEMANIMATE
  state tipme
  state femcode
enda
actor FEM3 TOUGH FEMANIMATE
  state tipme
  state femcode
enda
actor FEM4 TOUGH FEMANIMATE
  state femcode
enda
actor FEM5 TOUGH FEMANIMATE
  state killme
  state femcode
enda
actor FEM6 TOUGH FEMANIMATE
  state killme
  state femcode
enda
actor FEM7 TOUGH FEMANIMATE
  state tipme
  state femcode
enda
actor FEM8 TOUGH FEMANIMATE
  state femcode
enda
actor FEM9 TOUGH FEMANIMATE
  state femcode
enda
actor FEM10 TOUGH FEMANIMATESLOW
  state tipme
  state femcode
enda

actor TOUGHGAL MANWOMANSTRENGTH TOUGHGALANIM
  state toughgaltalk
  state femcode
enda

actor NAKED1 TOUGH FEMANIMATE
  state killme
  state femcode
enda
actor PODFEM1 TOUGH FEMANIMATE
  state killme
  state femcode
enda
actor BLOODYPOLE TOUGH
  state femcode
enda
actor STATUEFLASH
  fall
  ifcount 32
    cactor STATUE
enda
actor STATUE
  fall
  ifp pfacing
    ifpdistl 1280
      ifhitspace
  {
    cactor STATUEFLASH
    move 0
  }
enda

actor MIKE
  ifp pfacing
    ifpdistl 1280
      ifhitspace
        mikesnd
enda



state troop_body_jibs
  ifrnd 64
    guts HEADJIB1 1
  ifrnd 64
    guts LEGJIB1 2
  ifrnd 64
    guts ARMJIB1 1
  ifrnd 48
    spawn BLOODPOOL
ends

state liz_body_jibs
  ifrnd 64
    guts LIZMANHEAD1 1
  ifrnd 64
    guts LIZMANLEG1 2
  ifrnd 64
    guts LIZMANARM1 1
  ifrnd 48
    spawn BLOODPOOL
ends

action BLOODFRAMES 0 4 1 1 15
actor BLOOD 0 BLOODFRAMES
  sizeto 72 72 sizeto 72 72 sizeto 72 72
  ifpdistg 3144 killit
  ifactioncount 4 killit
enda

action EGGOPEN1 1 1 1 1 4
action EGGOPEN2 2 1 1 1 4
action EGGOPEN3 2 1 1 1 4
action EGGWAIT  0
action EGGFROZEN 1
action EGGGROW 1
action EGGSHRUNK 1

actor EGG TOUGH
  fall
  ifaction 0
  {
    ifcount 64
    {
      ifrnd 128
      {
        action EGGWAIT
        move 0
      }
      else
      {
        sound SLIM_HATCH
        action EGGOPEN1
      }
    }
  }
  else
    ifaction EGGOPEN1
      ifactioncount 4
        action EGGOPEN2
  else
    ifaction EGGOPEN2
      ifactioncount 4
    {
      spawn GREENSLIME
      action EGGOPEN3
    }
  else
    ifaction EGGGROW
      state genericgrowcode
  else
    ifaction EGGSHRUNK
      state genericshrunkcode
  else
    ifaction EGGFROZEN
  {
    ifcount THAWTIME
    {
      action 0
      getlastpal
    }
    else
      ifcount FROZENDRIPTIME
    {
      ifactioncount 26
      {
        spawn WATERDRIP
        resetactioncount
      }
    }

    ifhitweapon
    {
      ifwasweapon FREEZEBLAST
      {
        strength 0
        break
      }
      lotsofglass 30

      sound GLASS_BREAKING
      ifrnd 84
        spawn BLOODPOOL

      addkills 1
      killit
    }

    // ifp pducking
    ifp pfacing
      ifpdistl FROZENQUICKKICKDIST
        pkick

    break
  }

  ifhitweapon
  {
    ifdead
    {
      ifwasweapon FREEZEBLAST
      {
        sound SOMETHINGFROZE
        spritepal 1
        move 0
        action EGGFROZEN
        strength 0
        break
      }
      else
        ifwasweapon GROWSPARK
      {
        cstat 0
        move 0
        sound ACTOR_GROWING
        action EGGGROW
        break
      }

      addkills 1

      sound SQUISHED

      state standard_jibs
      killit
    }
    else
      ifwasweapon SHRINKSPARK
      {
        move 0
        sound ACTOR_SHRINKING
        action EGGSHRUNK
        break
      }

      ifwasweapon GROWSPARK
        sound EXPANDERHIT
  }
  else
    ifaction EGGWAIT
  {
    ifcount 512
      ifrnd 2
    {
      ifaction EGGSHRUNK
        break
      sound SLIM_HATCH
      action EGGOPEN1
    }
  }

enda

actor KNEE KNEE_WEAPON_STRENGTH enda
actor SPIT SPIT_WEAPON_STRENGTH enda
actor CHAINGUN CHAINGUN_WEAPON_STRENGTH enda
actor SHOTGUN SHOTGUN_WEAPON_STRENGTH enda
actor FIRELASER FIRELASER_WEAPON_STRENGTH enda
actor HEAVYHBOMB HANDBOMB_WEAPON_STRENGTH enda
actor BOUNCEMINE BOUNCEMINE_WEAPON_STRENGTH enda
actor MORTER MORTER_WEAPON_STRENGTH enda
actor SHRINKSPARK SHRINKER_WEAPON_STRENGTH enda

actor GROWSPARK GROWSPARK_WEAPON_STRENGTH
  ifcount 18
    killit
  else
    ifcount 9
  {
    sizeto 0 0
    sizeto 0 0
    sizeto 0 0
    sizeto 0 0
  }
  else
  {
    sizeto 28 28
    sizeto 28 28
    sizeto 28 28
    sizeto 28 28
  }
enda

actor RPG RPG_WEAPON_STRENGTH enda
actor FREEZEBLAST FREEZETHROWER_WEAPON_STRENGTH enda
actor DEVISTATORBLAST FREEZETHROWER_WEAPON_STRENGTH enda
actor COOLEXPLOSION1 COOL_EXPLOSION_STRENGTH enda
actor TRIPBOMB TRIPBOMB_STRENGTH enda

action WEAP2FRAMES 0  4  1  1  6
actor SHOTSPARK1 PISTOL_WEAPON_STRENGTH WEAP2FRAMES
  ifdead
    killit
  ifactioncount 4
    killit
  else
  {
    ifactioncount 3
    {
      ifinwater
      spawn WATERBUBBLE
    }
    else
      ifcount 2 nullop
      else
        ifonwater
          spawn WATERSPLASH2
  }
enda

state standard_pjibs
  guts JIBS1 1
  guts JIBS3 2
  guts JIBS4 1
  guts JIBS5 1
  guts JIBS6 2
  guts DUKETORSO 1
  guts DUKELEG 2
  guts DUKEGUN 1
  ifrnd 16 money 1
ends

move DUKENOTMOVING
state handle_dead_dukes
  fall
  ifmove 0   // 1st time initializiation...
  {
    ifrnd 128
      cstat 4
    else
      cstat 0
    move DUKENOTMOVING
  }

  ifsquished
  {
    sound SQUISHED
    state random_ooz
    killit
  }
  else
    ifcount 1024
      ifpdistg 4096
        killit
  else
  {
    strength 0
    ifhitweapon
      ifwasweapon RADIUSEXPLOSION
    {
      state standard_jibs
      killit
    }
  }
ends

action PLYINGFRAMES 0 1 0 1 1
actor DUKELYINGDEAD 0 PLYINGFRAMES
  state handle_dead_dukes
enda

action PGROWING   0
action PSTAND     0   1   5   1  1
action PEXPLODE   106   5   1   1   10
action PEXPLODEAD   113   1   1
action PJPHOUVER  15   1   5   1
action PWALK    20   4   5   1   16
action PRUN     20   4   5   1   10
action PWALKBACK  45   4   5  -1   16
action PRUNBACK   45   4   5  -1   10
action PJUMPING   50   4   5   1   30
action PFALLING   65   1   5
action PDUCKING   86   1   5
action PCRAWLING  86   3   5   1   20
action PAKICKING  40   2   5   1   25
action PFLINTCHING  106  1   1   1   10
action PTHROWNBACK  106  5   1   1   18
action PFROZEN     20  1   5
action PLYINGDEAD   113  1   1

action PSWIMMINGGO   375   1   5   1   10
action PSWIMMING   375   4   5   1   13
action PSWIMMINGWAIT 395   1   5   1   13
action PTREDWATER  395   2   5   1   17

move PSTOPED
move PSHRINKING // used as a var only

state check_pstandard
  ifp pwalking
    action PWALK
  else
    ifp pkicking
      action PAKICKING
  else
    ifp pwalkingback
      action PWALKBACK
  else
    ifp prunning
      action PRUN
  else
    ifp prunningback
      action PRUNBACK
  else
    ifp pjumping
      action PJUMPING
  else
    ifp pducking
      action PDUCKING
ends



move PGROWINGPOP        // Used only as a variable

actor APLAYER MAXPLAYERHEALTH PSTAND 0 0

  ifaction 0
    action PSTAND

  ifaction PFROZEN
  {
    cstat 257

    fall

    palfrom 16 0 0 24

    ifmove 0
    {
      ifhitweapon
      {
        ifwasweapon FREEZEBLAST
          break
        lotsofglass 60
        ifrnd 84
          spawn BLOODPOOL

        sound GLASS_BREAKING
        spawn ATOMICHEALTH

        getlastpal

        move 1
        break
      }
    }
    else
    {
      cstat 32768
      quote 13
      ifhitspace
      {
        action PSTAND
        resetplayer
      }
      break
    }

    ifactioncount THAWTIME
    {
      getlastpal
      strength 1
      move 0
      action PSTAND
    }
    else
      ifactioncount FROZENDRIPTIME
    {
      ifrnd 32
      spawn WATERDRIP
    }

    ifp pfacing   // assumes another other player  (multiplayer)
      ifpdistl FROZENQUICKKICKDIST
        pkick

    break
  }

  ifdead
  {
    ifaction PGROWING
    {
      ifmove PGROWINGPOP
      {
        quote 13
        ifhitspace
        {
          action 0
          resetplayer
        }
        break
      }
      else
      {
        ifcount 32
        {
          sound SQUISHED
          palfrom 48 64

          state standard_pjibs

          guts JIBS4 20
          guts JIBS6 20
          move PGROWINGPOP
          cstat 32768
          tossweapon

          hitradius 2048 60 70 80 90

        }
        else
          sizeto MAXXSTRETCH MAXYSTRETCH
      }
      break
    }

    ifsquished
      palfrom 32 63 63 63
    else
      fall

    ifactioncount 7
      move 0
    else
      ifactioncount 6
    {
      ifmultiplayer nullop
      else
      {
        ifrnd 32
          sound DUKE_KILLED5
        else
          ifrnd 32
            sound DUKE_KILLED3
        else
          ifrnd 32
            sound DUKE_KILLED1
        else
          ifrnd 32
            sound DUKE_KILLED2
      }
    }

    ifaction PLYINGDEAD
    {
      ifactioncount 3
        move PSTOPED
      quote 13
      ifhitspace
      {
        action PSTAND
        spawn DUKELYINGDEAD
        resetplayer
      }
      break
    }

    ifaction PTHROWNBACK
    {
      ifactioncount 5
      {
        spawn BLOODPOOL
        action PLYINGDEAD
      }
      else
        ifactioncount 1
          move 0
      break
    }

    ifaction PEXPLODEAD
    {
      quote 13
      ifhitspace
      {
        resetplayer
        action PSTAND
      }
      break
    }
    ifaction PEXPLODE
    {
      ifactioncount 5
      {
        action PEXPLODEAD
        spawn BLOODPOOL
      }
      break
    }

    ifp pshrunk
    {
      state standard_pjibs
      spawn BLOODPOOL

      sound SQUISHED
      sound DUKE_DEAD

      cstat 32768         // Hide the sprite

      action PLYINGDEAD
    }
    else
    {
      ifinwater
      {
        action PLYINGDEAD
        spawn WATERBUBBLE
        spawn WATERBUBBLE
      }
      else
      {
        action PEXPLODE
        state standard_pjibs
        cstat 32768
        sound SQUISHED
        sound DUKE_DEAD
      }
    }

    tossweapon

    break
  }

  ifsquished
  {
    strength -1
    sound SQUISHED
    state random_ooz
    break
  }

  ifp ponsteroids
  {
    ifp pstanding nullop
    else
      spawn FRAMEEFFECT1
  }

  ifmove PSHRINKING
  {
    ifcount 32
    {
      ifcount SHRUNKDONECOUNT
      {
        move 0
        cstat 257
      }
      else
        ifcount SHRUNKCOUNT
      {
        sizeto 42 36
        ifgapzl 24
        {
          strength 0
          sound SQUISHED
          palfrom 48 64
          break
        }
      }
      else
        ifp ponsteroids
          count SHRUNKCOUNT
    }
    else
    {
      ifp ponsteroids
        count SHRUNKCOUNT
      else
      {
        sizeto 8 9
        spawn FRAMEEFFECT1
      }
    }
  }
  else ifhitweapon
  {
    ifdead
    {
      ifmultiplayer
        sound DUKE_KILLED4

      ifwasweapon GROWSPARK
      {
        palfrom 48 48
        action PGROWING
        count 0
        move 0
        sound ACTOR_GROWING
        cstat 0
        break
      }
    }
    else
    {
      ifmultiplayer
      {
        ifphealthl YELLHURTSOUNDSTRENGTHMP
        {
          ifrnd 64
            sound DUKE_LONGTERM_PAIN2
          else
            ifrnd 64
              sound DUKE_LONGTERM_PAIN3
          else
            ifrnd 64
              sound DUKE_LONGTERM_PAIN4
          else
            sound DUKE_DEAD
        }
        else
        {
          ifrnd 64
            sound DUKE_LONGTERM_PAIN5
          else ifrnd 64
            sound DUKE_LONGTERM_PAIN6
          else ifrnd 64
            sound DUKE_LONGTERM_PAIN7
          else
            sound DUKE_LONGTERM_PAIN8
        }
      }
      else
      {
        ifphealthl YELLHURTSOUNDSTRENGTH
        {
          ifrnd 74
            sound DUKE_LONGTERM_PAIN2
          else
            ifrnd 8
              sound DUKE_LONGTERM_PAIN3
          else
            sound DUKE_LONGTERM_PAIN4
        }
        ifrnd 128
          sound DUKE_LONGTERM_PAIN
      }
    }
    ifstrength TOUGH
    {
      state headhitstate
      sound DUKE_GRUNT
      ifp pstanding
        action PFLINTCHING
    }

    ifwasweapon RPG
    {
      ifrnd 32
        spawn BLOOD
      ifdead
        state standard_pjibs
      palfrom 48 52
      break
    }
    ifwasweapon RADIUSEXPLOSION
    {
      ifrnd 32
        spawn BLOOD
      ifdead
        state standard_pjibs
      palfrom 48 52
      break
    }
    ifwasweapon FIREEXT
    {
      ifrnd 32
        spawn BLOOD
      ifdead
        state standard_pjibs
      palfrom 48 52
      break
    }
    ifwasweapon GROWSPARK
    {
      palfrom 48 52
      sound EXPANDERHIT
      break
    }
    ifwasweapon SHRINKSPARK
    {
      palfrom 48 0 48
      move PSHRINKING // used as a var only.
      sound ACTOR_SHRINKING
      cstat 0
      break
    }
    ifwasweapon SHOTSPARK1
      palfrom 24 48
    ifwasweapon FREEZEBLAST
    {
      palfrom 48 0 0 48
      ifdead
      {
        sound SOMETHINGFROZE
        spritepal 1
        move 0
        action PFROZEN
        break
      }
    }
    ifwasweapon COOLEXPLOSION1
      palfrom 48 48 0 48
    ifwasweapon KNEE
      palfrom 16 32
    ifwasweapon FIRELASER
      palfrom 32 32

    ifdead
    {
      action PTHROWNBACK
      tossweapon
    }

    state random_wall_jibs

    break
  }

  ifaction PFLINTCHING
  {
    ifactioncount 2
      action PSTAND
    break
  }

  ifinwater
  {
    ifaction PTREDWATER
    {
      ifp pwalking prunning
        action PSWIMMINGGO
    }
    else
      ifp pstanding pwalkingback prunningback
        action PTREDWATER
    else
    {
      ifaction PSWIMMING
      {
        ifrnd 4
          spawn WATERBUBBLE
        ifactioncount 4
          action PSWIMMINGWAIT
      }
      else
        ifaction PSWIMMINGWAIT
      {
        ifactioncount 2
          action PSWIMMINGGO
      }
      else
        ifaction PSWIMMINGGO
      {
        ifactioncount 2
          action PSWIMMING
      }
      else
        action PTREDWATER
    }

    ifrnd 4
      spawn WATERBUBBLE // For effect

    break
  }
  else ifp pjetpack
  {
    ifaction PJPHOUVER
    {
      ifactioncount 4
        resetactioncount
    }
    else
      action PJPHOUVER
    break
  }
  else
  {
    ifaction PTREDWATER
      action PSTAND
    ifaction PSWIMMING
      action PSTAND
    ifaction PSWIMMINGWAIT
      action PSTAND
    ifaction PSWIMMINGGO
      action PSTAND
    ifaction PJPHOUVER
      action PFALLING
  }

  ifaction PFALLING
  {
    ifp ponground
      action PSTAND
    else
    {
      ifp pfalling
        break
      else
        state check_pstandard
    }
  }

  ifaction PDUCKING
  {
    ifgapzl 48
    {
      ifp pwalking pwalkingback prunning prunningback
        action PCRAWLING
    }
    else ifp pducking
    {
      ifp pwalking pwalkingback prunning prunningback
        action PCRAWLING
    }
    else
    {
      ifp pstanding
        action PSTAND
      else
        state check_pstandard
    }
  }

  else ifaction PCRAWLING
  {
    ifgapzl 48
    {
      ifp pstanding
        action PCRAWLING
    }
    else
      ifp pducking
    {
      ifp pstanding
        action PDUCKING
    }
    else
    {
      ifp pstanding
        action PSTAND
      else
        state check_pstandard
    }
  }
  else
    ifgapzl 48
      action PDUCKING

  else
    ifaction PJUMPING
  {
    ifp ponground
      action PSTAND
    else
      ifactioncount 4
        ifp pfalling
          action PFALLING
  }

  ifp pfalling
    action PFALLING
  else
    ifaction PSTAND
      state check_pstandard
  else
    ifaction PAKICKING
  {
    ifactioncount 2
      action PSTAND
    break
  }
  else
    ifaction PWALK
  {
    ifp pfalling
      action PFALLING
    else
      ifp pstanding
        action PSTAND
    else
      ifp prunning
        action PRUN
    else
      ifp pwalkingback
        action PWALKBACK
    else
      ifp prunningback
        action PRUNBACK
    else
      ifp pjumping
        action PJUMPING
    else
      ifp pducking
        action PDUCKING
  }

  else
    ifaction PRUN
  {
    ifp pstanding
      action PSTAND
    else
      ifp pwalking
        action PWALK
    else
      ifp pwalkingback
        action PWALKBACK
    else
      ifp prunningback
        action PRUNBACK
    else
      ifp pjumping
        action PJUMPING
    else
      ifp pducking
        action PDUCKING
  }

  else
    ifaction PWALKBACK
  {
    ifp pstanding
      action PSTAND
    else
      ifp pwalking
        action PWALK
    else
      ifp prunning
        action PRUN
    else
      ifp prunningback
        action PRUNBACK
    else
      ifp pjumping
        action PJUMPING
    else
      ifp pducking
        action PDUCKING
  }

  else
    ifaction PRUNBACK
  {
    ifp pstanding
      action PSTAND
    else
      ifp pwalking
        action PWALK
    else
      ifp prunning
        action PRUN
    else
      ifp pwalkingback
        action PWALKBACK
    else
      ifp pjumping
        action PJUMPING
    else
      ifp pducking
        action PDUCKING
  }
enda





actor ORGANTIC TURRETSTRENGTH
  ifcount 48
    resetcount
  else
  {
    ifcount 32
    sizeto 32 32
  }
  else
    ifcount 16
    {
      sizeto 48 18
      ifpdistl 2048
      {
        sound TURR_ATTACK
        addphealth -2
        palfrom 32 16
      }
    }
  ifhitweapon
  {
    ifdead
    {
      addkills 1
      sound TURR_DYING
      guts JIBS5 10
      killit
    }
    sound TURR_PAIN
    break
  }
  ifrnd 1
    soundonce TURR_ROAM
enda

state rf
  ifrnd 128
    cstat 4
  else
    cstat 0
ends


//
//
//    TROOP/LIZTROOP CODE
//
//

action ATROOPSTAND     0  1  5  1  1
action ATROOPGROW    0  1  5  1  1
action ATROOPSTAYSTAND  -2  1  5  1  1
action ATROOPWALKING   0  4  5  1   12
action ATROOPWALKINGBACK 15   4  5   -1   12
action ATROOPRUNNING   0  4  5  1  8
action ATROOPSHOOT    35  1  5  1   30
action ATROOPJETPACK  40  1  5  1  1
action ATROOPJETPACKILL 40  2  5  1   50
action ATROOPFLINTCH  50  1  1  1  6
action ATROOPDYING    50  5  1  1   16
action ATROOPDEAD     54
action ATROOPPLAYDEAD   54
action ATROOPSUFFERDEAD 58  2  1   -4   24
action ATROOPSUFFERING  59  2  1  1   21
action ATROOPDUCK     64  1  5  1  3
action ATROOPDUCKSHOOT  64  2  5  1   25
action ATROOPABOUTHIDE  74  1  1  1   25
action ATROOPHIDE     79  1  1  1   25
action ATROOPREAPPEAR   74  1  1  1   25
action ATROOPFROZEN    0  1  5

move TROOPWALKVELS 72
move TROOPWALKVELSBACK -72
move TROOPJETPACKVELS 64 -84
move TROOPJETPACKILLVELS 192 -38
move TROOPRUNVELS 108
move TROOPSTOPPED
move DONTGETUP
move SHRUNKVELS 32

ai AITROOPSEEKENEMY  ATROOPWALKING   TROOPWALKVELS seekplayer
ai AITROOPSEEKPLAYER ATROOPWALKING   TROOPWALKVELS seekplayer
ai AITROOPFLEEING  ATROOPWALKING   TROOPWALKVELS fleeenemy
ai AITROOPFLEEINGBACK ATROOPWALKINGBACK   TROOPWALKVELSBACK faceplayer
ai AITROOPDODGE    ATROOPWALKING   TROOPRUNVELS  dodgebullet
ai AITROOPSHOOTING   ATROOPSHOOT   TROOPSTOPPED  faceplayer
ai AITROOPDUCKING  ATROOPDUCK    TROOPSTOPPED  faceplayer
ai AITROOPJETPACK  ATROOPJETPACK   TROOPJETPACKVELS seekplayer
ai AITROOPSHRUNK   ATROOPWALKING   SHRUNKVELS fleeenemy
ai AITROOPHIDE     ATROOPABOUTHIDE TROOPSTOPPED faceplayer
ai AITROOPGROW     ATROOPGROW    DONTGETUP faceplayerslow

state troophidestate
  ifaction ATROOPREAPPEAR
  {
    ifactioncount 2
    {
      sound TELEPORTER
      ai AITROOPSHOOTING
      cstat 257
    }
    else
    {
      sizeto 41 40
      sizeto 41 40
      sizeto 41 40
      sizeto 41 40
      spawn FRAMEEFFECT1
    }
  }
  else
    ifaction ATROOPWALKING
  {
    ifpdistl 2448
      ifpdistg 1024
    {
      ifceilingdistl 48
        break
      ifp pfacing
        break

      ifgapzl 64 nullop
      else
        ifawayfromwall
      {
        spawn TRANSPORTERSTAR
        action ATROOPREAPPEAR
        move 0
        break
      }
    }
  }
  else
    ifaction ATROOPHIDE
  {
    ifactioncount 2
    {
      spawn TRANSPORTERSTAR
      sound TELEPORTER
      action ATROOPWALKING
      move TROOPWALKVELS faceplayer
      cstat 32768
    }
    else
    {
      sizeto 4 40
      sizeto 4 40
      sizeto 4 40
      sizeto 4 40
      spawn FRAMEEFFECT1
    }
  }
  else
    ifaction ATROOPABOUTHIDE
      ifactioncount 2
    {
      action ATROOPHIDE
      cstat 0
    }
ends


state troopgunnashoot
  ifp palive
  {
    ifpdistl 1024
      ai AITROOPSHOOTING
    else
      ifactornotstayput
    {
      ifactioncount 12
        ifrnd 16
          ifcanshoottarget
      {
        ifspritepal 21
          ifrnd 4
            ifpdistg 4096
              ai AITROOPHIDE
        else
        {
          ifpdistl 1100
            ai AITROOPFLEEING
          else
          {
            ifpdistl 4096
              ifcansee
                ifcanshoottarget
                  ai AITROOPSHOOTING
            else
            {
              move TROOPRUNVELS seekplayer
              action ATROOPRUNNING
            }
          }
        }
      }
    }
    else
      ifcount 26
        ifrnd 32
          ai AITROOPSHOOTING
  }
ends

state troopseekstate
  state troopgunnashoot
  ifinwater
  {
    ai AITROOPJETPACK
    break
  }
  ifcansee
  {
    ifmove TROOPRUNVELS
      ifpdistl 1596
        ai AITROOPDUCKING
    ifp phigher
    {
      ifceilingdistl 128 nullop
      else
        ifactornotstayput
          ai AITROOPJETPACK
      break
    }
    else
      ifrnd 2
    {
      ifspritepal 21
        ifpdistg 1596
      {
        ai AITROOPHIDE
        break
      }
      ifbulletnear
      {
        ifrnd 128
          ai AITROOPDODGE
        else
          ai AITROOPDUCKING
        break
      }
    }
  }
  ifnotmoving
  {
    ifrnd 32
      operate
    else
      ifcount 32
        ifp palive
          ifcansee
            ifcanshoottarget
              ai AITROOPSHOOTING
  }
  ifrnd 1
  {
    ifrnd 128
      soundonce PRED_ROAM
    else
      soundonce PRED_ROAM2
  }
ends

state troopduckstate
  ifaction ATROOPDUCK
  {
    ifactioncount 8
    {
      ifp palive
      {
        ifrnd 128
          action ATROOPDUCKSHOOT
      }
      else
        ifmove DONTGETUP
          break
        else
          ai AITROOPSEEKPLAYER
    }
  }
  else
    ifaction ATROOPDUCKSHOOT
  {
    ifcount 64
    {
      ifmove DONTGETUP
        resetcount
      else
      {
        ifpdistl 1100
          ai AITROOPFLEEING
        else
          ai AITROOPSEEKPLAYER
      }
    }
    else
      ifactioncount 2
      {
        ifcanshoottarget
        {
          sound PRED_ATTACK
          resetactioncount
          shoot FIRELASER
        }
        else ai AITROOPSEEKPLAYER
      }
  }
ends

state troopshootstate
  ifactioncount 2
  {
    ifcanshoottarget
    {
      shoot FIRELASER
      sound PRED_ATTACK
      resetactioncount
      ifrnd 128
        ai AITROOPSEEKPLAYER
      ifcount 24
      {
        ifrnd 96
          ifpdistg 2048
            ai AITROOPSEEKPLAYER
          else
          {
            ifpdistg 1596
              ai AITROOPFLEEING
            else
              ai AITROOPFLEEINGBACK
          }
      }
    }
    else
      ai AITROOPSEEKPLAYER
  }
ends

state troopfleestate
  ifactioncount 7
  {
    ifpdistg 3084
    {
      ai AITROOPSEEKPLAYER
      break
    }
    else
      ifrnd 32
        ifp palive
          ifcansee
            ifcanshoottarget
      {
        ifrnd 128
          ai AITROOPDUCKING
        else
          ai AITROOPSHOOTING
          break
      }
  }
  ifnotmoving
  {
    ifrnd 32
      operate
    else
      ifcount 32
        ifp palive
          ifcansee
            ifcanshoottarget
      {
        ifrnd 128
          ai AITROOPSHOOTING
        else
          ai AITROOPDUCKING
      }
  }
ends

state troopdying
  iffloordistl 32
  {
    ifactioncount 5
    {
      cstat 0
      iffloordistl 8
      sound THUD
      ifrnd 64
        spawn BLOODPOOL
      state rf
      strength 0
      move TROOPSTOPPED
      action ATROOPDEAD
    }
    break
  }
  else
  {
    state rf
    move 0
    action ATROOPDYING
  }
ends

state checktroophit
  ifaction ATROOPSUFFERING
  {
    stopsound LIZARD_BEG
    sound PRED_DYING
    cstat 0
    strength 0
    action ATROOPSUFFERDEAD
    break
  }
  ifdead
  {
    ifwasweapon FREEZEBLAST
    {
      sound SOMETHINGFROZE
      spritepal 1
      move 0
      action ATROOPFROZEN
      strength 0
      break
    }

    state drop_ammo
    state random_wall_jibs

    ifwasweapon GROWSPARK
    {
      cstat 0
      sound ACTOR_GROWING
      ai AITROOPGROW
      break
    }

    addkills 1

    ifwasweapon RPG
    {
      sound SQUISHED
      state troop_body_jibs
      state standard_jibs
      killit
    }
    else
      ifwasweapon RADIUSEXPLOSION
    {
      sound SQUISHED
      state troop_body_jibs
      state standard_jibs
      killit
    }
    else
    {
      sound PRED_DYING
      ifrnd 32
        iffloordistl 32
      {
        sound LIZARD_BEG
        spawn BLOODPOOL
        strength 0
        move 0
        action ATROOPSUFFERING
        break
      }
      action ATROOPDYING
      break
    }
  }
  else
  {
    state random_wall_jibs
    sound PRED_PAIN

    ifwasweapon SHRINKSPARK
    {
      sound ACTOR_SHRINKING
      ai AITROOPSHRUNK
    }
    else
      ifwasweapon GROWSPARK
        sound EXPANDERHIT
    else
      iffloordistl 32
        ifrnd 96
          action ATROOPFLINTCH
  }
ends

state troopjetpackstate
  ifaction ATROOPJETPACKILL
  {
    ifcansee
      ifactioncount 2
    {
      resetactioncount
      sound PRED_ATTACK
      shoot FIRELASER
    }

    ifp phigher
      ai AITROOPJETPACK
    else
      ifinwater
        ai AITROOPJETPACK
    else
      ifcount 26
        iffloordistl 32
          ai AITROOPSEEKPLAYER
  }
  else
    ifcount 48
      ifcansee
  {
    action ATROOPJETPACKILL
    move TROOPJETPACKILLVELS
    seekplayer
  }
ends

state checksquished
  ifsquished
  {
    addkills 1
    sound SQUISHED
    state standard_jibs
    state random_ooz
    killit
  }
ends

state troopsufferingstate
  ifactioncount 2
  {
    ifrnd 16
      spawn WATERDRIP
    ifactioncount 14
    {
      stopsound LIZARD_BEG
      cstat 0
      strength 0
      action ATROOPSUFFERDEAD
      break
    }
  }
ends

state troopshrunkstate
  ifcount SHRUNKDONECOUNT
    ai AITROOPSEEKENEMY
  else
    ifcount SHRUNKCOUNT
      sizeto 48 40
  else
    state genericshrunkcode
ends


state troopcode fall
  ifinwater
    ifrnd 1
      spawn WATERBUBBLE
  ifaction ATROOPSTAND
  {
    ifrnd 192
      ai AITROOPSHOOTING
    else
      ai AITROOPSEEKPLAYER
  }
  else
    ifaction ATROOPFROZEN
  {
    ifcount THAWTIME
    {
      ai AITROOPSEEKENEMY
      getlastpal
    }
    else
      ifcount FROZENDRIPTIME
    {
      ifactioncount 26
      {
        spawn WATERDRIP
        resetactioncount
      }
    }
    ifhitweapon
    {
      ifwasweapon FREEZEBLAST
      {
        strength 0
        break
      }
      addkills 1

      ifrnd 84
        spawn BLOODPOOL
      lotsofglass 30
      sound GLASS_BREAKING
      killit
    }
    ifp pfacing
      ifpdistl FROZENQUICKKICKDIST
        pkick
    break
  }
  else ifaction ATROOPPLAYDEAD
  {
    ifhitweapon
    {
      ifwasweapon RADIUSEXPLOSION
      {
        sound SQUISHED
        state troop_body_jibs
        state standard_jibs
        killit
      }
      break
    }
    else
      state checksquished

    ifcount PLAYDEADTIME
    {
      addkills -1
      soundonce PRED_ROAM
      cstat 257
      strength 1
      ai AITROOPSHOOTING
    }
    else
      ifp pfacing
        resetcount

    break
  }
  else
    ifaction ATROOPDEAD
  {
    strength 0
    ifrespawn
      ifcount RESPAWNACTORTIME
    {
      spawn TRANSPORTERSTAR
      cstat 257
      strength TROOPSTRENGTH
      ai AITROOPSEEKENEMY
    }
    ifhitweapon
    {
      ifwasweapon RADIUSEXPLOSION
      {
        sound SQUISHED
        state troop_body_jibs
        state standard_jibs
        killit
      }
      break
    }
    else
      state checksquished
    break
  }
  else
    ifaction ATROOPSUFFERDEAD
  {
    ifactioncount 2
    {
      ifrnd 64
      {
        resetcount
        action ATROOPPLAYDEAD
      }
      else
      {
        soundonce PRED_DYING
        action ATROOPDEAD
      }
    }
  }
  else
    ifaction ATROOPDYING
  {
    state troopdying
    break
  }
  else
    ifaction ATROOPSUFFERING
  {
    state troopsufferingstate
    ifhitweapon
      state checktroophit
    break
  }
  else
    ifaction ATROOPFLINTCH
  {
    ifactioncount 4
      ai AITROOPSEEKENEMY
  }
  else
  {
    ifai AITROOPSEEKPLAYER
      state troopseekstate
    else
      ifai AITROOPJETPACK
    {
      state troopjetpackstate
      ifinwater nullop
      else
        soundonce DUKE_JETPACK_IDLE
    }
    else
      ifai AITROOPSEEKENEMY
        state troopseekstate
    else
      ifai AITROOPSHOOTING
        state troopshootstate
    else
      ifai AITROOPFLEEING
        state troopfleestate
    else
      ifai AITROOPFLEEINGBACK
        state troopfleestate
    else
      ifai AITROOPDODGE
        state troopseekstate
    else
      ifai AITROOPDUCKING
        state troopduckstate
    else
      ifai AITROOPSHRUNK
        state troopshrunkstate
    else
      ifai AITROOPGROW
        state genericgrowcode
    else
      ifai AITROOPHIDE
    {
      state troophidestate
      break
    }
  }

  ifhitweapon
    state checktroophit
  else
    state checksquished
ends

state checktrooppalette
  ifai 0
  {
    ifspritepal 0
        nullop
    else
        ifspritepal 21
          addstrength TROOPSTRENGTH // Double the hitpoint vals
  }
ends


actor LIZTROOPJETPACK TROOPSTRENGTH
  state checktrooppalette
  ai AITROOPJETPACK
  cactor LIZTROOP
enda

actor LIZTROOPDUCKING TROOPSTRENGTH
  state checktrooppalette
  ai AITROOPDUCKING
  cactor LIZTROOP
  ifgapzl 48
    move DONTGETUP
enda

actor LIZTROOPSHOOT TROOPSTRENGTH ATROOPSTAND
  state checktrooppalette
  ai AITROOPSHOOTING
  cactor LIZTROOP
enda
actor LIZTROOPSTAYPUT TROOPSTRENGTH ATROOPSTAYSTAND
  state checktrooppalette
  ai AITROOPSEEKPLAYER
  cactor LIZTROOP
enda
actor LIZTROOPRUNNING TROOPSTRENGTH ATROOPSTAND
  state checktrooppalette
  ai AITROOPSEEKPLAYER
  cactor LIZTROOP
enda
actor LIZTROOPONTOILET TROOPSTRENGTH
  ifcount 24
  {
    sound FLUSH_TOILET
    operate
    ai AITROOPSEEKPLAYER
    cactor LIZTROOP
  }
  else
    ifcount 2
      nullop
  else
    state checktrooppalette
enda

actor LIZTROOPJUSTSIT TROOPSTRENGTH
  ifcount 30
  {
    operate
    ai AITROOPSEEKPLAYER
    cactor LIZTROOP
  }
  else
    ifcount 2
      nullop
  else
    state checktrooppalette
enda


actor LIZTROOP TROOPSTRENGTH ATROOPSTAND
  state checktrooppalette
  state troopcode
enda

action ALIZSTAND     0
action ALIZWALKING     0   4  5  1  15
action ALIZRUNNING     0   4  5  1  11
action ALIZTHINK     20  2  5  1  40
action ALIZSCREAM    30  1  5  1  2
action ALIZJUMP      45  3  5  1  20
action ALIZFALL      55  1  5
action ALIZSHOOTING    70  2  5  1  7
action ALIZDYING     60  6  1  1  15
action ALIZLYINGDEAD   65  1
action ALIZFROZEN     0  1  5

move LIZWALKVEL 72
move LIZRUNVEL 192
move LIZJUMPVEL 184
move LIZSTOP

ai AILIZGETENEMY ALIZWALKING LIZWALKVEL seekplayer
ai AILIZDODGE ALIZRUNNING LIZRUNVEL dodgebullet
ai AILIZCHARGEENEMY ALIZRUNNING LIZRUNVEL seekplayer
ai AILIZFLEENEMY ALIZWALKING LIZWALKVEL fleeenemy
ai AILIZSHOOTENEMY ALIZSHOOTING LIZSTOP faceplayer
ai AILIZJUMPENEMY ALIZJUMP LIZJUMPVEL jumptoplayer
ai AILIZTHINK ALIZTHINK LIZSTOP faceplayerslow
ai AILIZSHRUNK ALIZWALKING SHRUNKVELS fleeenemy
ai AILIZGROW ALIZSTAND  LIZSTOP faceplayerslow
ai AILIZSPIT ALIZSCREAM LIZSTOP faceplayerslow
ai AILIZDYING ALIZDYING LIZSTOP faceplayer

state lizseekstate

  ifactornotstayput
  {
    ifcansee
      ifp palive
        ifpdistl 2048
          ifcount 16
            ifcanshoottarget
    {
      ai AILIZSHOOTENEMY
      break
    }
    ifai AILIZCHARGEENEMY
    {
      ifcount 72
        ifcanshoottarget
      {
        ai AILIZSHOOTENEMY
        break
      }
      ifp phigher
        ifpdistg 2048
          ifrnd 6
      {
        ai AILIZJUMPENEMY
        break
      }
    }
    else
      ifpdistg 4096
    {
      ifrnd 92
      {
        ifcount 48
          ifcanshoottarget
            ai AILIZSHOOTENEMY
      }
      else
        ifcount 24
      {
        ai AILIZCHARGEENEMY
        break
      }
    }

    iffloordistl 16
    {
      ifcount 48
        ifnotmoving
          ifcansee
      {
        ai AILIZJUMPENEMY
        break
      }
    }
    else
    {
      ifpdistg 1280
        ai AILIZJUMPENEMY
      break
    }

    ifrnd 4
      ifnotmoving
        operate
    else
      ifrnd 1
        ifbulletnear
    {
      ifgapzl 128
        ai AILIZDODGE
      else
        ifactornotstayput
      {
        ifrnd 32
          ai AILIZJUMPENEMY
        else
          ai AILIZDODGE
      }
    }
  }
  else
  {
    ifactioncount 16
    {
      ifp palive
        ifrnd 32
          ifcansee
            ifcanshoottarget
              ai AILIZSHOOTENEMY
    }
    ifcount 16
      ifrnd 32
        move LIZWALKVEL randomangle geth
  }

ends

state lizshrunkstate
  ifcount SHRUNKDONECOUNT
    ai AILIZGETENEMY
  else
    ifcount SHRUNKCOUNT
      sizeto 48 40
  else
    state genericshrunkcode
ends

state lizfleestate
  ifcount 16
  {
    ifrnd 48
      ifp palive
        ifcansee
          ai AILIZSPIT
  }
  else
  {
    iffloordistl 16 nullop
    else
      ai AILIZGETENEMY
    break
  }
ends

state lizthinkstate
  ifrnd 8
    soundonce CAPT_ROAM
  ifactioncount 3
  {
    ifrnd 32
      ifp palive
        ifcansee
          ai AILIZSPIT
        else
          ifrnd 96
            ai AILIZGETENEMY
  }
  else
    ifactioncount 2
      ifrnd 1
        spawn FECES
  ifrnd 1
    ifbulletnear
  {
    ifgapzl 96
      ai AILIZDODGE
    else
    {
      ifrnd 128
        ai AILIZJUMPENEMY
      else
        ai AILIZDODGE
    }
  }
ends

state lizshootstate
  ifcount 20
    ifrnd 8
  {
    ifcansee
      ifpdistl 2048
    {
      ifrnd 128
        ai AILIZFLEENEMY
      break
    }
    ifrnd 80
      ai AILIZTHINK
    else
      ai AILIZGETENEMY
  }
  ifactioncount 2
  {
    ifcansee
    {
      ifcanshoottarget
      {
        sound CAPT_ATTACK
        shoot SHOTSPARK1
        resetactioncount
      }
      else
        ai AILIZTHINK
    }
    else
      ai AILIZGETENEMY
  }
ends

state checklizhit
  spawn BLOOD
  ifai AILIZSHRUNK
  {
    addkills 1
    sound SQUISHED
    state standard_jibs
    killit
  }
  ifdead
  {
    ifwasweapon FREEZEBLAST
    {
      sound SOMETHINGFROZE
      spritepal 1
      move 0
      action ALIZFROZEN
      strength 0
      break
    }

    state drop_chaingun

    ifwasweapon GROWSPARK
    {
      cstat 0
      sound ACTOR_GROWING
      ai AILIZGROW
      break
    }

    addkills 1

    ifwasweapon RPG
    {
      sound SQUISHED
      state liz_body_jibs
      state standard_jibs
      killit
    }
    else
      ifwasweapon RADIUSEXPLOSION
    {
      sound SQUISHED
      state liz_body_jibs
      state standard_jibs
      killit
    }
    else
    {
      state rf
      ai AILIZDYING
      ifrnd 64
        spawn BLOODPOOL
    }
    sound CAPT_DYING
  }
  else
  {
    sound CAPT_PAIN
    ifwasweapon SHRINKSPARK
    {
      sound ACTOR_SHRINKING
      ai AILIZSHRUNK
      break
    }
    ifwasweapon GROWSPARK
      sound EXPANDERHIT

    state random_wall_jibs
    ifp palive
      ifcansee
        ifcanshoottarget
    {
      ai AILIZSHOOTENEMY
      break
    }
  }
ends

state lizjumpstate
  ifaction ALIZFALL
  {
    iffloordistl 16
      ai AILIZGETENEMY
  }
  else
    ifactioncount 3
      action ALIZFALL
ends

state lizdyingstate
  ifaction ALIZLYINGDEAD
  {
    strength 0
    ifhitweapon
      ifwasweapon RADIUSEXPLOSION
    {
      sound SQUISHED
      state standard_jibs
      killit
    }
    ifcount RESPAWNACTORTIME
      ifrespawn
    {
      spawn TRANSPORTERSTAR
      cstat 257
      strength LIZSTRENGTH
      ai AILIZGETENEMY
    }
  }
  else
    ifai AILIZDYING
      ifactioncount 6
  {
    iffloordistl 8
      sound THUD
    move LIZSTOP
    action ALIZLYINGDEAD
  }
ends

state lizdodgestate
  ifcount 13
    ai AILIZGETENEMY
ends

actor LIZMANSTAYPUT LIZSTRENGTH ai AILIZGETENEMY cactor LIZMAN enda
actor LIZMANSPITTING LIZSTRENGTH ai AILIZSPIT cactor LIZMAN enda
actor LIZMANJUMP LIZSTRENGTH ai AILIZJUMPENEMY cactor LIZMAN enda

state lizcode
  state checksquished
  ifai 0
    ai AILIZGETENEMY
  else
    ifaction ALIZLYINGDEAD
  {
    fall
    state lizdyingstate
    break
  }
  else
    ifaction ALIZFROZEN
  {
    ifcount THAWTIME
    {
      ai AILIZGETENEMY
      getlastpal
    }
    else
      ifcount FROZENDRIPTIME
    {
      ifactioncount 26
      {
        spawn WATERDRIP
        resetactioncount
      }
    }

    ifhitweapon
    {
      ifwasweapon FREEZEBLAST
      {
        strength 0
        break
      }
      addkills 1

      ifrnd 84
        spawn BLOODPOOL
      lotsofglass 30
      sound GLASS_BREAKING
      killit
    }
    ifp pfacing
      ifpdistl FROZENQUICKKICKDIST
        pkick
    break
  }
  else
    ifai AILIZJUMPENEMY
      state lizjumpstate
  else
  {
    fall
    ifai AILIZGETENEMY
      state lizseekstate
    else
      ifai AILIZCHARGEENEMY
        state lizseekstate
    else
      ifai AILIZDODGE
        state lizdodgestate
    else
      ifai AILIZSHOOTENEMY
        state lizshootstate
    else
      ifai AILIZFLEENEMY
        state lizfleestate
    else
      ifai AILIZTHINK
        state lizthinkstate
    else
      ifai AILIZSHRUNK
        state lizshrunkstate
    else
      ifai AILIZGROW
        state genericgrowcode
    else
      ifai AILIZDYING
        state lizdyingstate
    else
      ifai AILIZSPIT
    {
      ifcount 26
        ai AILIZGETENEMY
      else
        ifcount 18
          ifrnd 96
      {
        shoot SPIT
        sound LIZARD_SPIT
      }
    }
  }

  ifai AILIZSHRUNK
    break
  ifhitweapon
    state checklizhit
ends

actor LIZMAN LIZSTRENGTH
  fall
  state lizcode
enda






action DRONEFRAMES   0   1   7   1   1
action DRONESCREAM   0   1   7   1   1
move DRONERUNVELS 128 64
move DRONERUNUPVELS 128 -64
move DRONEBULLVELS 252 -64
move DRONEBACKWARDS -64 -64
move DRONERISE 32 -32
move DRONESTOPPED -16

ai AIDRONEGETE DRONESCREAM DRONERUNVELS faceplayerslow getv
ai AIDRONEWAIT DRONEFRAMES DRONESTOPPED faceplayerslow
ai AIDRONEGETUP DRONESCREAM DRONERUNUPVELS faceplayer getv
ai AIDRONEPULLBACK DRONEFRAMES DRONEBACKWARDS faceplayerslow
ai AIDRONEHIT DRONESCREAM DRONEBACKWARDS faceplayer
ai AIDRONESHRUNK DRONEFRAMES SHRUNKVELS fleeenemy
ai AIDRONEDODGE DRONEFRAMES DRONEBULLVELS dodgebullet geth
ai AIDRONEDODGEUP DRONEFRAMES DRONERISE getv geth

state dronedead
  addkills 1
  debris SCRAP1 8
  debris SCRAP2 4
  debris SCRAP3 7
  spawn EXPLOSION2
  sound RPG_EXPLODE
  hitradius 2048 15 20 25 30
  killit
ends

state checkdronehitstate

  ifdead state dronedead
  else ifsquished state dronedead
  else
  {
    sound DRON_PAIN
    ifbulletnear
    {
      ifceilingdistl 64
        ifrnd 48
          ai AIDRONEDODGE
      ai AIDRONEDODGEUP
    }
    else
      ai AIDRONEGETE
  }
ends

state droneshrunkstate
  ifcount 24
    killit
  else
    sizeto 1 1
ends

state checkdronenearplayer

  ifp palive
    ifpdistl 1596
  {
    ifcount 8
    {
      addkills 1
      sound DRON_ATTACK2
      debris SCRAP1 8
      debris SCRAP2 4
      debris SCRAP3 7
      spawn EXPLOSION2
      sound RPG_EXPLODE
      hitradius 2048 15 20 25 30
      killit
    }
    else
      ifcount 3 nullop
      else
        sound LASERTRIP_ARMING
  }

ends

state dronegetstate
  ifrnd 192
  {
    ifcansee
    {
      ifbulletnear
      {
        ai AIDRONEDODGE
        break
      }
      ifmove DRONEBULLVELS
      {
        ifcount 64
          ai AIDRONEPULLBACK
        else
          ifnotmoving
            ifcount 16
              ai AIDRONEPULLBACK
      }
      else
        ifcount 32
      {
        ifp phigher
          move DRONEBULLVELS geth getv
        else
          move DRONEBULLVELS geth
      }
    }
    else
      ifrnd 1
        operate
  }
ends

state dronedodgestate
  ifai AIDRONEDODGEUP
  {
     ifcount 8
       ai AIDRONEGETE
     else
       ifnotmoving
         ai AIDRONEGETE
  }
  else
  {
    ifcount 8
      ai AIDRONEGETE
    else
      ifnotmoving
        ai AIDRONEGETE
  }
ends

actor DRONE DRONESTRENGTH
  state checkdronenearplayer

  ifrnd 2
    fall
  else
    soundonce DRON_JETSND

  ifaction 0
    ai AIDRONEGETE

  else
    ifai AIDRONEWAIT
  {
    ifactioncount 4
      ifrnd 16
        ifcansee
    {
      sound DRON_ATTACK1
      ifp phigher
        ai AIDRONEGETUP
      else ai AIDRONEGETE
    }
  }
  else
    ifai AIDRONEGETE
      state dronegetstate
  else
    ifai AIDRONEGETUP
      state dronegetstate
  else
    ifai AIDRONEPULLBACK
  {
    ifcount 32
    ai AIDRONEWAIT
  }
  else
    ifai AIDRONEHIT
  {
    ifcount 8
      ai AIDRONEWAIT
  }
  else
    ifai AIDRONESHRUNK
      state droneshrunkstate
  else
    ifai AIDRONEDODGE
      state dronedodgestate
  else
    ifai AIDRONEDODGEUP
      state dronedodgestate

  ifhitweapon
    state checkdronehitstate

  ifrnd 1
    soundonce DRON_ROAM

enda



action AOCTAWALK    0   3   5   1   15
action AOCTASTAND     0   1   5   1   15
action AOCTASCRATCH   0   4   5   1   15
action AOCTAHIT    30   1   1   1   10
action AOCTASHOOT    20   1   5   1   10
action AOCTADYING    30   8   1   1   17
action AOCTADEAD     38   1   1   1  1
action AOCTAFROZEN    0   1   5

move OCTAWALKVELS 96 -30
move OCTAUPVELS 96 -70
move OCTASTOPPED 0 -30
move OCTAINWATER 96 24

ai AIOCTAGETENEMY AOCTAWALK OCTAWALKVELS seekplayer
ai AIOCTASHOOTENEMY AOCTASHOOT OCTASTOPPED faceplayer
ai AIOCTASCRATCHENEMY AOCTASCRATCH OCTASTOPPED faceplayerslow
ai AIOCTAHIT AOCTAHIT OCTASTOPPED faceplayer
ai AIOCTASHRUNK AOCTAWALK SHRUNKVELS faceplayer
ai AIOCTAGROW AOCTASTAND OCTASTOPPED faceplayerslow
ai AIOCTADYING AOCTADYING OCTASTOPPED faceplayer

state octagetenemystate

  ifcansee
  {
    ifactioncount 32
    {
      ifrnd 48
        ifcanshoottarget
      {
        sound OCTA_ATTACK1
        ai AIOCTASHOOTENEMY
        break
      }
    }
    else
      ifpdistl 1280
        ai AIOCTASCRATCHENEMY
  }

ends

state octascratchenemystate
  ifpdistg 1280
    ai AIOCTAGETENEMY
  else
    ifcount 32
  {
    resetcount
    sound OCTA_ATTACK2
    palfrom 8 32
    addphealth OCTASCRATCHINGPLAYER
  }
ends

state octashootenemystate
  ifcount 25
  {
    ifcount 27
      ai AIOCTAGETENEMY
  }
  else
    ifcount 24
      shoot COOLEXPLOSION1
  else
    ifactioncount 6
      resetactioncount
ends

state checkoctahitstate
  ifwasweapon SHRINKSPARK
  {
    sound ACTOR_SHRINKING
    ai AIOCTASHRUNK
  }
  else
  {
    ifdead
    {
      ifwasweapon FREEZEBLAST
      {
        sound SOMETHINGFROZE
        spritepal 1
        move 0
        action AOCTAFROZEN
        strength 0
        break
      }

      addkills 1
      ifwasweapon RPG
      {
        sound SQUISHED
        state standard_jibs
        killit
      }
      else
        ifwasweapon RADIUSEXPLOSION
      {
        sound SQUISHED
        state standard_jibs
        killit
      }
      else
        ifwasweapon GROWSPARK
      {
        cstat 0
        sound ACTOR_GROWING
        ai AIOCTAGROW
        break
      }
      else
      {
        state rf
        ai AIOCTADYING
      }
      sound OCTA_DYING
    }
    else
    {
      ifwasweapon RPG
      {
        sound OCTA_DYING
        addkills 1
        state standard_jibs
        killit
      }
      else
        ifwasweapon GROWSPARK
          sound EXPANDERHIT

      sound OCTA_PAIN
      spawn BLOOD
      ifrnd 64
        ai AIOCTAHIT
    }
  }
  state random_wall_jibs
ends

state octashrunkstate
  ifcount SHRUNKDONECOUNT
    ai AILIZGETENEMY
  else
    ifcount SHRUNKCOUNT
      sizeto 40 40
  else
    state genericshrunkcode
ends


state octadyingstate
  ifactioncount 8
  {
    ifrnd 64
      spawn BLOODPOOL
    move OCTASTOPPED
    action AOCTADEAD
    break
  }
  else
    ifactioncount 5 nullop
  else
    ifactioncount 4
      iffloordistl 8
        sound THUD
ends

actor OCTABRAINSTAYPUT OCTASTRENGTH
  ai AIOCTAGETENEMY
  cactor OCTABRAIN
enda

actor OCTABRAIN OCTASTRENGTH
  fall
  state checksquished
  ifai 0
    ai AIOCTAGETENEMY
  else
    ifaction AOCTADEAD
  {
    strength 0
    ifcount RESPAWNACTORTIME
      ifrespawn
    {
      addkills -1
      spawn TRANSPORTERSTAR
      cstat 257
      strength OCTASTRENGTH
      ai AIOCTAGETENEMY
    }
    ifhitweapon
      ifwasweapon RADIUSEXPLOSION
    {
      state standard_jibs
      killit
    }
    break
  }
  else ifaction AOCTAFROZEN
  {
    ifcount THAWTIME
    {
      ai AIOCTAGETENEMY
      getlastpal
    }
    else
      ifcount FROZENDRIPTIME
      {
        ifactioncount 26
        {
          spawn WATERDRIP
          resetactioncount
        }
      }

    ifhitweapon
    {
      addkills 1
      ifwasweapon FREEZEBLAST
      {
        strength 0
        break
      }

      lotsofglass 30
      ifrnd 84
        spawn BLOODPOOL
      sound GLASS_BREAKING
      killit
    }
    ifp pfacing
      ifpdistl FROZENQUICKKICKDIST
        pkick
    break
  }
  else
  {
    ifrnd 1
      soundonce OCTA_ROAM

    ifai AIOCTAGETENEMY
      state octagetenemystate
    else
      ifai AIOCTAHIT
      {
        ifcount 8
          ai AIOCTASHOOTENEMY
      }
    else
      ifai AIOCTADYING
      {
        state octadyingstate
        break
      }
    else
      ifai AIOCTASCRATCHENEMY
        state octascratchenemystate
    else
      ifai AIOCTASHOOTENEMY
        state octashootenemystate
    else
      ifai AIOCTASHRUNK
      {
        state octashrunkstate
        break
      }
    else
      ifai AIOCTAGROW
        state genericgrowcode

    ifmove OCTAUPVELS nullop
    else
      ifp phigher
        move OCTAUPVELS seekplayer
    else
      ifmove OCTAINWATER nullop
      else
        ifinwater
          move OCTAINWATER seekplayer

    ifhitweapon
      state checkoctahitstate
  }
enda

action APIGWALK     0  4 5 1 20
action APIGRUN      0  4 5 1 11
action APIGSHOOT    30 2 5 1 58
action APIGCOCK     25 1 5 1 16
action APIGSTAND    30 1 5 1 1
action APIGDIVE     40 2 5 1 40
action APIGDIVESHOOT  45 2 5 1 58
action APIGDYING    55 5 1 1 15
action APIGHIT      55 1 1 1 10
action APIGDEAD     60 1 1 1 1
action APIGFROZEN    0 1 5
action APIGGROW      0


move PIGWALKVELS 72
move PIGRUNVELS 108
move PIGSTOPPED

ai AIPIGSEEKENEMY APIGWALK PIGWALKVELS seekplayer
ai AIPIGSHOOTENEMY APIGSHOOT PIGSTOPPED faceplayer
ai AIPIGFLEEENEMY APIGWALK PIGWALKVELS fleeenemy
ai AIPIGSHOOT APIGSHOOT PIGSTOPPED faceplayer
ai AIPIGDODGE APIGRUN PIGRUNVELS dodgebullet
ai AIPIGCHARGE APIGRUN PIGRUNVELS seekplayer
ai AIPIGDIVING APIGDIVE PIGSTOPPED faceplayer
ai AIPIGDYING APIGDYING PIGSTOPPED faceplayer
ai AIPIGSHRINK APIGWALK SHRUNKVELS fleeenemy
ai AIPIGGROW APIGGROW PIGSTOPPED faceplayerslow
ai AIPIGHIT APIGHIT PIGSTOPPED faceplayer

state pigseekenemystate

  ifai AIPIGCHARGE
  {
    ifcansee
      ifpdistl 3084
    {
      ifnotmoving
        ai AIPIGSEEKENEMY
      else
        ai AIPIGDIVING
    }
    break
  }
  else iffloordistl 32
  {
    ifpdistg 4096
    {
      ifactornotstayput
      ai AIPIGCHARGE
    }
    ifrnd 8
    {
      ifbulletnear
        ai AIPIGDODGE
    }
  }

  ifrnd 128
    ifcansee
  {
    ifai AIPIGDODGE
    {
      ifcount 32
        ai AIPIGCHARGE
          break
    }
    iffloordistl 32
    {
      ifpdistl 1024
        ifp palive
          ifcanshoottarget
      {
        ai AIPIGSHOOTENEMY
        break
      }
      ifcount 48
      {
        ifrnd 8
          ifp palive
            ifcanshoottarget
        {
          ifrnd 192
            ai AIPIGSHOOTENEMY
          else
            ai AIPIGDIVING
          break
        }
      }
    }
  }
ends


state pigshootenemystate
//  ifcansee
  {
    ifcount 12 nullop
    else
      ifcount 11
    {
      ifcanshoottarget
      {
        sound PIG_ATTACK
        shoot SHOTGUN
        shoot SHOTGUN
        shoot SHOTGUN
        shoot SHOTGUN
        shoot SHOTGUN
      }
      else
        ai AIPIGSEEKENEMY
    }
    ifcount 25 nullop
    else
      ifcount 24
      {
        action APIGCOCK
        sound SHOTGUN_COCK
      }
    ifcount 48 nullop
    else
      ifcount 47
    {
      ifcanshoottarget
      {
        sound PIG_ATTACK
        shoot SHOTGUN
        shoot SHOTGUN
        shoot SHOTGUN
        shoot SHOTGUN
        shoot SHOTGUN
      }
      else
        ai AIPIGSEEKENEMY
    }
    ifcount 60 nullop
    else
      ifcount 59
      {
        action APIGCOCK
        sound SHOTGUN_COCK
      }
    ifcount 72
    {
      ifrnd 64
        resetcount
      else
      {
        ifpdistl 768
          ai AIPIGFLEEENEMY
        else
          ai AIPIGSEEKENEMY
      }
    }
    ifaction APIGCOCK
      ifactioncount 2
        action APIGSHOOT
  }
  else
    ai AIPIGSEEKENEMY
ends

state pigfleeenemystate
  ifactioncount 8
    ai AIPIGSEEKENEMY
  else
    ifnotmoving
      ai AIPIGSEEKENEMY
ends

state pigdivestate
  ifaction APIGDIVESHOOT
  {
    ifcansee
    {
      ifcount 12 nullop
      else
        ifcount 11
      {
        ifcanshoottarget
        {
          sound PIG_ATTACK
          shoot SHOTGUN
          shoot SHOTGUN
          shoot SHOTGUN
          shoot SHOTGUN
        }
        else
          ai AIPIGSEEKENEMY
      }
      ifcount 25 nullop
      else
        ifcount 24
          sound SHOTGUN_COCK
      ifcount 48 nullop
      else
        ifcount 47
      {
        ifcanshoottarget
        {
          sound PIG_ATTACK
          shoot SHOTGUN
          shoot SHOTGUN
          shoot SHOTGUN
          shoot SHOTGUN
        }
        else
          ai AIPIGSEEKENEMY
      }
      ifcount 60 nullop
      else
        ifcount 59
      {
        sound SHOTGUN_COCK
        ifgapzl 32
          ai AIPIGDIVING
        else
        {
          ifpdistl 4096
            ai AIPIGFLEEENEMY
          else
            ai AIPIGSEEKENEMY
        }
      }
    }
    else
      ifgapzl 32
        ai AIPIGDIVING
      else
        ai AIPIGSEEKENEMY
  }
  else
    ifactioncount 2
    ifp palive
    {
      resetcount
      action APIGDIVESHOOT
    }
ends

state checkpighitstate
  spawn BLOOD
  ifdead
  {
    state random_wall_jibs
    ifrnd 16
      spawn SHIELD
    else
      state drop_shotgun

    ifwasweapon GROWSPARK
    {
      sound ACTOR_GROWING
      ai AIPIGGROW
      break
    }

    addkills 1

    ifwasweapon FREEZEBLAST
    {
      sound SOMETHINGFROZE
      spritepal 1
      move 0
      action APIGFROZEN
      strength 0
      break
    }
    ifwasweapon RADIUSEXPLOSION
    {
      sound SQUISHED
      state standard_jibs
      killit
    }
    else
      ifwasweapon RPG
    {
      sound SQUISHED
      state standard_jibs
      killit
    }
    else
      ai AIPIGDYING
        sound PIG_DYING
  }
  else
  {
    sound PIG_PAIN
    state random_wall_jibs

    ifwasweapon SHRINKSPARK
    {
      sound ACTOR_SHRINKING
      ai AIPIGSHRINK
    }
    else
      ifwasweapon GROWSPARK
        sound EXPANDERHIT
    else
      ifrnd 32
        ai AIPIGHIT
    else
      ifrnd 64
        ai AIPIGSHOOTENEMY
    else
      ifrnd 64
      {
        ai AIPIGDIVING
        action APIGDIVESHOOT
      }
  }
ends

state pigshrinkstate
  ifcount SHRUNKDONECOUNT
    ai AIPIGSEEKENEMY
  else
    ifcount SHRUNKCOUNT
      sizeto 48 40
  else
    state genericshrunkcode
ends

state pigdyingstate
  ifactioncount 5
  {
    ifrnd 64
      spawn BLOODPOOL
    state rf
    iffloordistl 8
      sound THUD
    action APIGDEAD
    move PIGSTOPPED
    break
  }
ends


actor PIGCOPDIVE PIGCOPSTRENGTH
  ai AIPIGDIVING
  action APIGDIVESHOOT
  cactor PIGCOP
enda
actor PIGCOPSTAYPUT PIGCOPSTRENGTH
  ai AIPIGSEEKENEMY
  cactor PIGCOP
enda
actor PIGCOP PIGCOPSTRENGTH APIGSTAND
  fall
  state checksquished
  ifaction APIGSTAND
    ai AIPIGSEEKENEMY
  else
    ifaction APIGDEAD
  {
    ifrespawn
      ifcount RESPAWNACTORTIME
    {
      spawn TRANSPORTERSTAR
      cstat 257
      strength PIGCOPSTRENGTH
      ai AIPIGSEEKENEMY
    }
    else
    {
      strength 0
      ifhitweapon
        ifwasweapon RADIUSEXPLOSION
      {
        sound SQUISHED
        state standard_jibs
        killit
      }
      break
    }
  }
  else
    ifaction APIGFROZEN
  {
    ifcount THAWTIME
    {
      ai AIPIGSEEKENEMY
      getlastpal
    }
    else
      ifcount FROZENDRIPTIME
        ifrnd 8
          spawn WATERDRIP

    ifhitweapon
    {
      ifwasweapon FREEZEBLAST
      {
        strength 0
        break
      }
      addkills 1

      lotsofglass 30
      ifrnd 84 spawn BLOODPOOL
      sound GLASS_BREAKING
      killit
    }
    ifp pfacing
      ifpdistl FROZENQUICKKICKDIST
        pkick
    break
  }
  else
    ifai AIPIGDYING
      state pigdyingstate
  else
    ifai AIPIGHIT
    {
      ifactioncount 3
      ai AIPIGSEEKENEMY
    }
  else
    ifai AIPIGSHRINK
      state pigshrinkstate
  else
  {
    ifai AIPIGSEEKENEMY
      state pigseekenemystate
    else
      ifai AIPIGDODGE
        state pigseekenemystate
    else
      ifai AIPIGSHOOTENEMY
        state pigshootenemystate
    else
      ifai AIPIGGROW
        state genericgrowcode
    else
      ifai AIPIGFLEEENEMY
        state pigfleeenemystate
    else
      ifai AIPIGDIVING
        state pigdivestate
    else
      ifai AIPIGCHARGE
        state pigseekenemystate
    ifhitweapon
      state checkpighitstate
    ifrnd 1
    {
      ifrnd 32
        soundonce PIG_ROAM
      else
        ifrnd 64
          soundonce PIG_ROAM2
      else
        soundonce PIG_ROAM3
    }
  }
enda



action ABOSS1WALK        0  4  5  1  12
action ABOSS1FROZEN        30 1  5
action ABOSS1RUN         0  6  5  1  5
action ABOSS1SHOOT         30 2  5  1  4
action ABOSS1LOB         40 2  5  1  35
action ABOSS1DYING        50 5  1  1  35
action BOSS1FLINTCH       50 1  1  1  1
action ABOSS1DEAD         55

move PALBOSS1SHRUNKRUNVELS 32
move PALBOSS1RUNVELS 128
move BOSS1WALKVELS 208
move BOSS1RUNVELS 296
move BOSS1STOPPED

ai AIBOSS1SEEKENEMY ABOSS1WALK BOSS1WALKVELS seekplayer
ai AIBOSS1RUNENEMY ABOSS1RUN BOSS1RUNVELS faceplayer
ai AIBOSS1SHOOTENEMY ABOSS1SHOOT BOSS1STOPPED faceplayer
ai AIBOSS1LOBBED ABOSS1LOB BOSS1STOPPED faceplayer // faceplayersmart
ai AIBOSS1DYING ABOSS1DYING BOSS1STOPPED faceplayer
ai AIBOSS1PALSHRINK ABOSS1WALK PALBOSS1SHRUNKRUNVELS furthestdir

state boss1palshrunkstate
  ifcount SHRUNKDONECOUNT
    ai AITROOPSEEKENEMY
  else
    ifcount SHRUNKCOUNT
      sizeto 40 40
  else
    state genericshrunkcode
ends

state checkboss1seekstate
  ai AIBOSS1SEEKENEMY
  ifspritepal 0 nullop
    else   // a fake way of doing a ifspritepal NOT.
      move PALBOSS1RUNVELS seekplayer
ends

state boss1runenemystate
  ifpdistl 2048
  {
    ifp palive
      ai AIBOSS1SHOOTENEMY
    break
  }
  else
    ifcansee
  {
    ifactioncount 6
    {
      ifcanshoottarget
      {
        resetactioncount
        sound BOS1_WALK
      }
      else
        ai AIBOSS1SEEKENEMY
    }
  }
  else
    ai AIBOSS1SEEKENEMY
ends

state boss1seekenemystate
  ifrnd 2
    soundonce BOS1_ROAM
  else
    ifactioncount 6
  {
    resetactioncount
    sound BOS1_WALK
  }

  ifpdistl 2548
    ifp palive
  {
    ai AIBOSS1SHOOTENEMY
    break
  }

  ifcansee
    ifcount 32
  {
    ifrnd 32
    {
      ifp palive
        ifcanshoottarget
          ai AIBOSS1SHOOTENEMY
    }
    else
      ifpdistg 2548
        ifrnd 192
          ifcanshoottarget
    {
      ifrnd 64
      {
        ai AIBOSS1RUNENEMY
        ifspritepal 0 nullop
        else
          move PALBOSS1RUNVELS seekplayer
      }
      else
        ai AIBOSS1LOBBED
    }
  }

ends

state boss1dyingstate
  ifaction ABOSS1DEAD
  {
    ifspritepal 0
      break
    ifrespawn
      ifcount RESPAWNACTORTIME
    {
      spawn TRANSPORTERSTAR
      cstat 257
      strength PIGCOPSTRENGTH
      state checkboss1seekstate
    }
    else
    {
      strength 0
      ifhitweapon
        ifwasweapon RADIUSEXPLOSION
      {
        sound SQUISHED
        state standard_jibs
        killit
      }
      break
    }
  }
  ifactioncount 5
  {
    iffloordistl 8
      sound THUD
    action ABOSS1DEAD
    cstat 0
    ifspritepal 0
    endofgame 52
  }
ends

state boss1lobbedstate
  ifcansee
  {
    ifactioncount 2
    {
      resetactioncount
      sound BOS1_ATTACK2
      shoot MORTER
    }
    else
      ifcount 64
        ifrnd 16
          state checkboss1seekstate
  }
  else
    state checkboss1seekstate
ends

state boss1shootenemy
  ifcount 72
    state checkboss1seekstate
  else
    ifaction ABOSS1SHOOT
      ifactioncount 2
  {
    sound BOS1_ATTACK1
    shoot SHOTSPARK1
    shoot SHOTSPARK1
    shoot SHOTSPARK1
    shoot SHOTSPARK1
    shoot SHOTSPARK1
    shoot SHOTSPARK1
    resetactioncount
  }
ends

state checkboss1hitstate
  ifrnd 2
    spawn BLOODPOOL
  ifdead
  {
    ifspritepal 0
      globalsound DUKE_TALKTOBOSSFALL
    else
    {
      ifrnd 64
        globalsound DUKE_TALKTOBOSSFALL
      ifwasweapon FREEZEBLAST
      {
        sound SOMETHINGFROZE
        spritepal 1
        move 0
        action ABOSS1FROZEN
        strength 0
        break
      }
    }

    sound BOS1_DYING

    addkills 1
    ai AIBOSS1DYING
  }
  else
  {
    ifrnd 32
    {
      action BOSS1FLINTCH
      move 0
    }

    ifspritepal 0 nullop
    else
      ifwasweapon SHRINKSPARK
    {
      sound ACTOR_SHRINKING
      ai AIBOSS1PALSHRINK
      cstat 0
      break
    }

    soundonce BOS1_PAIN

    debris SCRAP1 1
    guts JIBS6 1
  }
ends

state boss1code

  ifaction ABOSS1FROZEN
  {
    ifcount THAWTIME
    {
      ai AIBOSS1SEEKENEMY
      spritepal 21
    }
    else
      ifcount FROZENDRIPTIME
    {
      ifactioncount 26
      {
        spawn WATERDRIP
        resetactioncount
      }
    }

    ifhitweapon
    {
      ifwasweapon FREEZEBLAST
      {
        strength 0
        break
      }
      addkills 1
      lotsofglass 30

      ifrnd 84
        spawn BLOODPOOL
      sound GLASS_BREAKING
      killit
    }
    ifp pfacing
      ifpdistl FROZENQUICKKICKDIST
        pkick
    break
  }
  ifai 0
  {
    ifspritepal 0
      ai AIBOSS1RUNENEMY
    else
    {
      strength BOSS1PALSTRENGTH
      ai AIBOSS1SHOOTENEMY
    }
  }
  else
    ifaction BOSS1FLINTCH
  {
    ifactioncount 3
    ai AIBOSS1SHOOTENEMY
  }
  else
    ifai AIBOSS1SEEKENEMY
      state boss1seekenemystate
  else
    ifai AIBOSS1RUNENEMY
      state boss1runenemystate
  else
    ifai AIBOSS1SHOOTENEMY
      state boss1shootenemy
  else
    ifai AIBOSS1LOBBED
      state boss1lobbedstate
  else
    ifai AIBOSS1PALSHRINK
      state boss1palshrunkstate

  ifai AIBOSS1DYING
    state boss1dyingstate
  else
  {
    ifhitweapon
      state checkboss1hitstate
    else
      ifp palive
        ifspritepal 0
          ifpdistl 1280
    {
      addphealth -1000
      palfrom 63 63
    }
  }
ends

actor BOSS1STAYPUT BOSS1STRENGTH cactor BOSS1 enda
actor BOSS1 BOSS1STRENGTH fall state boss1code enda


action ABOSS2WALK        0  4  5  1  30
action ABOSS2FROZEN        0  1  5
action ABOSS2RUN         0  4  5  1  15
action ABOSS2SHOOT         20 2  5  1  15
action ABOSS2LOB         30 2  5  1  105
action ABOSS2DYING        40 8  1  1  35
action BOSS2FLINTCH       40 1  1  1  1
action ABOSS2DEAD         48

move PALBOSS2SHRUNKRUNVELS 32
move PALBOSS2RUNVELS 84
move BOSS2WALKVELS 192
move BOSS2RUNVELS 256
move BOSS2STOPPED

ai AIBOSS2SEEKENEMY ABOSS2WALK BOSS2WALKVELS seekplayer
ai AIBOSS2RUNENEMY ABOSS2RUN BOSS2RUNVELS faceplayer
ai AIBOSS2SHOOTENEMY ABOSS2SHOOT BOSS2STOPPED faceplayer
ai AIBOSS2LOBBED ABOSS2LOB BOSS2STOPPED faceplayer
ai AIBOSS2DYING ABOSS2DYING BOSS2STOPPED faceplayer
ai AIBOSS2PALSHRINK ABOSS2WALK PALBOSS2SHRUNKRUNVELS furthestdir

state boss2palshrunkstate
  ifcount SHRUNKDONECOUNT
  {
    cstat 257
    ai AITROOPSEEKENEMY
  }
  else
    ifcount SHRUNKCOUNT
      sizeto 40 40
  else
    state genericshrunkcode
ends

state checkboss2seekstate
  ai AIBOSS2SEEKENEMY
  ifspritepal 0 nullop
  else   // a fake way of doing a ifspritepal NOT.
    move PALBOSS2RUNVELS seekplayer
ends

state boss2runenemystate
  ifcansee
  {
    ifactioncount 3
    {
      ifcanshoottarget
      {
        resetactioncount
        sound BOS1_WALK
      }
      else
        ai AIBOSS2SEEKENEMY
    }
    ifcount 48
      ifrnd 2
    {
      ifp palive
      {
        sound BOS2_ATTACK
        ai AIBOSS2SHOOTENEMY
      }
      break
    }
  }
  else
    ai AIBOSS2SEEKENEMY
ends

state boss2seekenemystate
  ifrnd 2
    soundonce BOS2_ROAM
  else
    ifactioncount 3
  {
    resetactioncount
    sound BOS1_WALK
  }

  ifcansee
    ifcount 32
      ifp palive
        ifrnd 48
          ifcanshoottarget
  {
    ifrnd 64
      ifpdistg 4096
    {
      ai AIBOSS2RUNENEMY
      ifspritepal 0 nullop
      else
        move PALBOSS2RUNVELS seekplayer
      break
    }

    ifpdistl 10240
    {
      ifrnd 128
      {
        sound BOS2_ATTACK
        ai AIBOSS2LOBBED
      }
    }
    else
    {
      sound BOS2_ATTACK
      ai AIBOSS2SHOOTENEMY
    }
  }
ends

state boss2dyingstate
  ifaction ABOSS2DEAD
  {
    ifspritepal 0
      break
    ifrespawn
      ifcount RESPAWNACTORTIME
    {
      spawn TRANSPORTERSTAR
      cstat 257
      strength PIGCOPSTRENGTH
      state checkboss2seekstate
    }
    else
    {
      strength 0
      ifhitweapon
        ifwasweapon RADIUSEXPLOSION
      {
        sound SQUISHED
        state standard_jibs
        killit
      }
      break
    }
  }
  ifactioncount 8
  {
    iffloordistl 8
      sound THUD
    action ABOSS2DEAD
    cstat 0
    ifspritepal 0
      endofgame 52
  }
ends

state boss2lobbedstate
  ifcansee
  {
    ifactioncount 2
      resetactioncount
    else
      ifactioncount 1
    {
      ifrnd 128
        shoot COOLEXPLOSION1
    }
    else
      ifcount 64
        ifrnd 16
          state checkboss2seekstate
  }
  else
    state checkboss2seekstate
ends

state boss2shootenemy
  ifcount 72
    state checkboss2seekstate
  else
    ifaction ABOSS2SHOOT
      ifactioncount 2
  {
    shoot RPG
    resetactioncount
  }
ends

state checkboss2hitstate
  ifrnd 2
    spawn BLOODPOOL
  ifdead
  {
    ifspritepal 0
      globalsound DUKE_TALKTOBOSSFALL
    else
    {
      ifrnd 64
        globalsound DUKE_TALKTOBOSSFALL
      ifwasweapon FREEZEBLAST
      {
        sound SOMETHINGFROZE
        spritepal 1
        move 0
        action ABOSS2FROZEN
        strength 0
        break
      }
    }

    sound BOS2_DYING

    addkills 1

    ai AIBOSS2DYING
  }
  else
  {
    ifrnd 144
    {
      ifrnd 32
      {
        action BOSS2FLINTCH
        move 0
      }
      else
      {
        sound BOS2_ATTACK
        ai AIBOSS2SHOOTENEMY
      }
    }

    ifspritepal 0 nullop
    else
      ifwasweapon SHRINKSPARK
    {
      sound ACTOR_SHRINKING
      ai AIBOSS2PALSHRINK
      break
    }

    soundonce BOS2_PAIN

    debris SCRAP1 1
    guts JIBS6 1
  }
ends

state boss2code

  ifaction ABOSS2FROZEN
  {
    ifcount THAWTIME
    {
      ai AIBOSS2SEEKENEMY
        spritepal 21
    }
    else
      ifcount FROZENDRIPTIME
    {
      ifactioncount 26
      {
        spawn WATERDRIP
        resetactioncount
      }
    }

    ifhitweapon
    {
      ifwasweapon FREEZEBLAST
      {
        strength 0
        break
      }
      addkills 1

      lotsofglass 30
      sound GLASS_BREAKING
      ifrnd 84 spawn BLOODPOOL
      killit
    }
    ifp pfacing
      ifpdistl FROZENQUICKKICKDIST
        pkick
    break
  }
  ifai 0
  {
    ifspritepal 0
      ai AIBOSS2RUNENEMY
    else
    {
      strength 1
      sound BOS2_ATTACK ai AIBOSS2SHOOTENEMY
    }
  }
  else
    ifaction BOSS2FLINTCH
  {
    ifactioncount 3
      ai AIBOSS2SEEKENEMY
  }
  else
    ifai AIBOSS2SEEKENEMY
      state boss2seekenemystate
  else
    ifai AIBOSS2RUNENEMY
      state boss2runenemystate
  else
    ifai AIBOSS2SHOOTENEMY
      state boss2shootenemy
  else
    ifai AIBOSS2LOBBED
      state boss2lobbedstate
  else
    ifai AIBOSS2PALSHRINK
      state boss2palshrunkstate

  ifai AIBOSS2DYING
    state boss2dyingstate
  else
  {
    ifhitweapon state checkboss2hitstate
    else
      ifp palive
        ifspritepal 0 ifpdistl
          1280
    {
      addphealth -1000
      palfrom 63 63
    }
  }


ends

actor BOSS2 BOSS2STRENGTH fall state boss2code enda

action ABOSS3WALK        0  4  5  1  30
action ABOSS3FROZEN        0  1  5
action ABOSS3RUN         0  4  5  1  15
action ABOSS3LOB        20 4  5  1  50
action ABOSS3LOBBING      30 2  5  1  15
action ABOSS3DYING        40 8  1  1  20
action BOSS3FLINTCH       40 1  1  1  1
action ABOSS3DEAD         48

move PALBOSS3SHRUNKRUNVELS 32
move PALBOSS3RUNVELS 84
move BOSS3WALKVELS 208
move BOSS3RUNVELS 270
move BOSS3STOPPED

ai AIBOSS3SEEKENEMY ABOSS3WALK BOSS3WALKVELS seekplayer
ai AIBOSS3RUNENEMY ABOSS3RUN BOSS3RUNVELS faceplayerslow
ai AIBOSS3LOBENEMY ABOSS3LOB BOSS3STOPPED faceplayer
ai AIBOSS3DYING ABOSS3DYING BOSS3STOPPED faceplayer
ai AIBOSS3PALSHRINK ABOSS3WALK PALBOSS3SHRUNKRUNVELS faceplayer

state boss3palshrunkstate
  ifcount SHRUNKDONECOUNT
    ai AITROOPSEEKENEMY
  else
    ifcount SHRUNKCOUNT
      sizeto 40 40
  else
    state genericshrunkcode
ends

state checkboss3seekstate
  ai AIBOSS3SEEKENEMY
  ifspritepal 0 nullop
  else   // a fake way of doing a ifspritepal NOT.
    move PALBOSS3RUNVELS seekplayer
ends

state boss3runenemystate
  ifcansee
  {
    ifactioncount 3
    {
      ifcanshoottarget
      {
        resetactioncount
        sound BOS1_WALK
      }
      else
        ai AIBOSS3SEEKENEMY
    }
  }
  else
    ai AIBOSS3SEEKENEMY
ends

state boss3seekenemystate
  ifrnd 2
    soundonce BOS3_ROAM
  else
    ifactioncount 3
    {
      resetactioncount
      sound BOS1_WALK
    }

  ifcansee
    ifcount 32
      ifrnd 48
        ifcanshoottarget
  {
    ifrnd 64
      ifpdistg 4096
      {
        ai AIBOSS3RUNENEMY
        ifspritepal 0
          break
        move PALBOSS3RUNVELS seekplayer
        break
      }

    ifp palive
      ai AIBOSS3LOBENEMY
  }
ends

state boss3dyingstate
  ifaction ABOSS3DEAD
  {
    ifspritepal 0
      break
    ifrespawn
      ifcount RESPAWNACTORTIME
    {
      spawn TRANSPORTERSTAR
      cstat 257
      strength PIGCOPSTRENGTH
      state checkboss3seekstate
    }
    else
    {
      strength 0
      ifhitweapon
        ifwasweapon RADIUSEXPLOSION
      {
        sound SQUISHED
        state standard_jibs
        killit
      }
      break
    }
  }
  ifactioncount 8
  {
    iffloordistl 8
      sound THUD
    action ABOSS3DEAD
    cstat 0
    ifspritepal 0
    endofgame 52
  }
ends

state boss3lobbedstate
  ifcansee
  {
    ifaction ABOSS3LOBBING
      ifactioncount 2
    {
      shoot RPG
      resetactioncount
      ifrnd 8
        ai AIBOSS3SEEKENEMY
    }

    ifactioncount 3
    {
      action ABOSS3LOBBING
      resetcount
    }
  }
  else
    state checkboss3seekstate
ends

state checkboss3hitstate
  ifrnd 2
    spawn BLOODPOOL
  ifdead
  {
    ifspritepal 0
      globalsound DUKE_TALKTOBOSSFALL
    else
    {
      ifrnd 64
        globalsound DUKE_TALKTOBOSSFALL
      ifwasweapon FREEZEBLAST
      {
        sound SOMETHINGFROZE
        spritepal 1
        move 0
        action ABOSS3FROZEN
        strength 0
        break
      }
    }

    addkills 1
    ai AIBOSS3DYING

    sound BOS3_DYING
    sound JIBBED_ACTOR9

  }
  else
  {
    ifrnd 32
    {
      action BOSS3FLINTCH
      move 0
    }

    ifspritepal 0 nullop
    else
      ifwasweapon SHRINKSPARK
    {
      sound ACTOR_SHRINKING
      ai AIBOSS3PALSHRINK
      break
    }

    soundonce BOS3_PAIN

    debris SCRAP1 1
    guts JIBS6 1
  }
ends

state boss3code

  ifaction ABOSS3FROZEN
  {
    ifhitweapon
    {
      ifwasweapon FREEZEBLAST
      {
        strength 0
        break
      }

      addkills 1
      lotsofglass 30

      ifrnd 84
        spawn BLOODPOOL
      sound GLASS_BREAKING
      killit
    }
    ifp pfacing
      ifpdistl FROZENQUICKKICKDIST
        pkick
    break
  }
  ifai 0
  {
    ifspritepal 0
      ai AIBOSS3RUNENEMY
    else
    {
      strength 1
      ai AIBOSS3LOBENEMY
    }
  }
  else
    ifaction BOSS3FLINTCH
    {
      ifactioncount 3
      ai AIBOSS3SEEKENEMY
    }
  else
    ifai AIBOSS3SEEKENEMY
      state boss3seekenemystate
  else
    ifai AIBOSS3RUNENEMY
      state boss3runenemystate
  else
    ifai AIBOSS3LOBENEMY
      state boss3lobbedstate
  else
    ifai AIBOSS3PALSHRINK
      state boss3palshrunkstate

  ifai AIBOSS3DYING
    state boss3dyingstate
  else
  {
    ifhitweapon
      state checkboss3hitstate
    else
      ifp palive
        ifspritepal 0
          ifpdistl 1280
      {
        addphealth -1000
        palfrom 63 63
      }
  }
ends

actor BOSS3 BOSS3STRENGTH fall state boss3code enda


action ACOMMBREETH  0  3  5  1  40
action ACOMMFROZEN  0  1  5
action ACOMMSPIN   -5  1  5  1  12
action ACOMMGET   0  3  5  1  30
action ACOMMSHOOT  20  1  5   1 35
action ACOMMABOUTTOSHOOT 20 1 5 1 30
action ACOMMDYING  30  8  1  1  12
action ACOMMDEAD   38  1  1  1  1


move COMMGETUPVELS 128 -64
move COMMGETVELS 128 64
move COMMSLOW 64 24
move COMMSTOPPED

ai AICOMMWAIT ACOMMBREETH COMMSTOPPED faceplayerslow
ai AICOMMGET ACOMMGET COMMGETVELS seekplayer
ai AICOMMSHOOT ACOMMSHOOT COMMSTOPPED faceplayerslow
ai AICOMMABOUTTOSHOOT ACOMMABOUTTOSHOOT COMMSTOPPED faceplayerslow
ai AICOMMSPIN ACOMMSPIN COMMGETVELS spin
ai AICOMMDYING ACOMMDYING COMMSTOPPED faceplayer
ai AICOMMSHRUNK ACOMMGET COMMSLOW furthestdir
ai AICOMMGROW ACOMMGET COMMSTOPPED furthestdir

state checkcommhitstate

  ifhitweapon
  {
    guts JIBS6 2

    ifdead
    {
      ifwasweapon FREEZEBLAST
      {
        sound SOMETHINGFROZE
        spritepal 1
        move 0
        action ACOMMFROZEN
        strength 0
        break
      }
      else
        ifwasweapon GROWSPARK
      {
        sound ACTOR_GROWING
        ai AICOMMGROW
        break
      }

      addkills 1

      ifwasweapon RADIUSEXPLOSION
      {
        spawn BLOODPOOL
        sound SQUISHED
        state standard_jibs
        killit
      }
      else
        ifwasweapon RPG
      {
        sound SQUISHED
        spawn BLOODPOOL
        state standard_jibs
        killit
      }

      sound COMM_DYING
      ai AICOMMDYING
    }
    else
    {
      soundonce COMM_PAIN
      ifwasweapon SHRINKSPARK
      {
        sound ACTOR_SHRINKING
        ai AICOMMSHRUNK
      }
      else
        ifwasweapon GROWSPARK
          sound EXPANDERHIT
      else
        ifrnd 24
          ai AICOMMABOUTTOSHOOT
    }
  }
ends

actor COMMANDERSTAYPUT COMMANDERSTRENGTH
  cactor COMMANDER
  ai AICOMMABOUTTOSHOOT
enda

actor COMMANDER COMMANDERSTRENGTH

  state checksquished

  ifaction ACOMMFROZEN
  {
    fall

    ifcount THAWTIME
    {
      getlastpal
      ai AICOMMWAIT
    }
    else
      ifcount FROZENDRIPTIME
    {
      ifactioncount 26
      {
        spawn WATERDRIP
        resetactioncount
      }
    }

    ifhitweapon
    {
      ifwasweapon FREEZEBLAST
      {
        strength 0
        break
      }
      addkills 1

      ifrnd 84
        spawn BLOODPOOL
      lotsofglass 30
      sound GLASS_BREAKING
      killit
    }
    ifp pfacing
      ifpdistl FROZENQUICKKICKDIST
        pkick
    break
  }
  ifai 0
    ai AICOMMSHOOT
  else
    ifai AICOMMWAIT
  {
    ifcount 20
    {
      ifcansee
      {
        ifcanshoottarget
        {
          ifrnd 96
            ai AICOMMGET
          else
            ai AICOMMABOUTTOSHOOT
        }
      }
      else
        ai AICOMMGET
    }
  }
  else
    ifai AICOMMABOUTTOSHOOT
  {
    ifactioncount 2
    {
      ifcansee
        ai AICOMMSHOOT
      else
      {
        ai AICOMMGET
        break
      }
    }
    ifrnd 32 soundonce COMM_ATTACK
  }
  else
    ifai AICOMMSHOOT
  {
    ifcanshoottarget
    {
      ifcount 24
        ifrnd 16
          ai AICOMMWAIT
      ifactioncount 2
      {
        shoot RPG
        resetactioncount
      }
    }
    else
      ai AICOMMGET
  }
  else
    ifai AICOMMSHRUNK
  {
    ifcount SHRUNKDONECOUNT
      ai AICOMMGET
    else
      ifcount SHRUNKCOUNT
        sizeto 48 40
    else
      state genericshrunkcode
  }
  else
    ifai AICOMMGROW
      state genericgrowcode
  else
    ifai AICOMMGET
  {
    ifnotmoving
      ifrnd 4
        operate
    ifpdistl 1024
      ifp palive
    {
      sound COMM_SPIN
      ai AICOMMSPIN
      break
    }

    ifcansee
    {
      ifp phigher
        move COMMGETUPVELS getv geth faceplayer
      else
        move COMMGETVELS getv geth faceplayer
    }
    ifactioncount 8
      ifrnd 2
        ai AICOMMABOUTTOSHOOT
  }
  else
    ifai AICOMMSPIN
  {
    soundonce COMM_SPIN
    ifcount 16
    {
      ifpdistl 1280
      {
        addphealth CAPTSPINNINGPLAYER
        sound DUKE_GRUNT
        palfrom 32
        16 resetcount
      }
      else
        ifpdistg 2300
          ai AICOMMWAIT
    }
    ifactioncount 52
      ai AICOMMWAIT
    ifnotmoving
      ifrnd 32
        operate
  }

  ifai AICOMMDYING
  {
    fall
    strength 0

    ifhitweapon
      ifwasweapon RADIUSEXPLOSION
    {
      sound SQUISHED
      spawn BLOODPOOL
      state standard_jibs
      killit
    }

    ifaction ACOMMDYING
      ifactioncount 8
    {
      iffloordistl 8
        sound THUD
      cstat 0
      action ACOMMDEAD
    }
  }
  else
  {
    ifrnd 2
      soundonce COMM_ROAM
    state checkcommhitstate
  }
enda


// CANNONBALL for Pirates of the Carribean
define CANNONBALLSTRENGTH 400
move CANNONBALL1 512 0
move CANNONBALL2 512 10
move CANNONBALL3 512 20
move CANNONBALL4 512 40
move CANNONBALL5 512 80

useractor notenemy CANNONBALL CANNONBALLSTRENGTH

  ifaction 0
  {
    sizeat 32 32
    cstat 257         // Force actor to block
    action ANULLACTION
  }

    ifactioncount 46
    {
      ifactioncount 47 nullop
      else
        move CANNONBALL5 geth getv
    }
    else
      ifactioncount 44
    {
      ifactioncount 45 nullop
      else
        move CANNONBALL4 geth getv
    }
    else
      ifactioncount 40
    {
      ifactioncount 41 nullop
      else
        move CANNONBALL3 geth getv
    }
    else
      ifactioncount 32
    {
      ifactioncount 33 nullop
      else
        move CANNONBALL2 geth getv
    }
    else
      ifactioncount 16
    {
      ifactioncount 17 nullop
      else move CANNONBALL1 geth getv
    }

  ifnotmoving
  {
    spawn EXPLOSION2
    sound PIPEBOMB_EXPLODE
    hitradius 4096 WEAKEST WEAK MEDIUMSTRENGTH TOUGH
    killit
  }

  ifhitweapon
  {
    ifdead
    {
      spawn EXPLOSION2
      hitradius 4096 WEAKEST WEAK MEDIUMSTRENGTH TOUGH
      killit
    }
    else
      debris SCRAP1 3
  }

enda


define CANNONBALLS 1818
define CANNONBALLSSTRENGTH 10
move CANNONBALLSVEL

useractor notenemy CANNONBALLS CANNONBALLSSTRENGTH
  ifaction 0
  {
    cstator 257
    action ANULLACTION
  }
  ifhitweapon
  {
    ifdead
    {
      spawn EXPLOSION2
      hitradius 4096 WEAKEST WEAK MEDIUMSTRENGTH TOUGH
      killit
    }
    else
      debris SCRAP1 3
  }
enda


define CANNON 1810
define CANNONSTRENGTH 400
action ACANNONWAIT 0 1 7 1 1
action ACANNONSHOOTING 0 1 7 1 1
move CANNONSTOP

useractor enemy CANNON CANNONSTRENGTH // fall

  ifaction 0
  {
//    sizeat 64 64
    action ACANNONWAIT
  }
  else
    ifaction ACANNONSHOOTING
  {
    spawn CANNONBALL
    action ACANNONWAIT
  }
  else
    ifaction ACANNONWAIT
  {
    ifactioncount 64
    {
      ifrnd 128
        action ACANNONSHOOTING
      else
        resetactioncount
    }
  }

  ifhitweapon
  {
    ifdead
    {
      addkills 1
      hitradius 4096 WEAKEST WEAK MEDIUMSTRENGTH TOUGH
      spawn EXPLOSION2
      killit
    }
    else debris SCRAP1 3
  }

  ifpdistl 1024
    ifhitspace
  {
    ifp pfacing
      ifcanshoottarget
        spawn CANNONBALL
      else break
  }
enda

useractor notenemy HOTMEAT TOUGH
  ifaction 0
  {
    action ANULLACTION
    cstat 257
  }
  ifhitweapon
  {
    ifdead
    {
      sound SQUISHED
      guts JIBS5 8
      guts JIBS6 9
      killit
    }
    else
      guts JIBS6 1
  }
  ifrnd 1
    spawn WATERDRIP

enda

action ASPEAKERBROKE 1
useractor notenemy SPEAKER
  ifaction 0
  {
    ifhitweapon
    {
      stopsound STORE_MUSIC
      soundonce STORE_MUSIC_BROKE
      action ASPEAKERBROKE
    }
    else
    {
      ifpdistl 10240
          soundonce STORE_MUSIC
      cstat 289
    }
  }
enda

action ALAVABUBBLE
action ALAVABUBBLEANIM 0 5 1 1 16

useractor notenemy LAVABUBBLE
  ifaction 0
  {
    cstat 32768
    action ALAVABUBBLE
  }
  else
    ifaction ALAVABUBBLE
  {
    ifcount 72
      ifrnd 2
    {
      cstat 0
      action ALAVABUBBLEANIM
    }
  }
  else
  {
    ifactioncount 5
    {
      cstat 32768
      action ALAVABUBBLE
    }
  }
enda

// RIOT TANK with Pigcop inside

define TANKSTRENGTH       500      // 2 3 4 5 7 8
//           off-set, numofframes, numofrot, skipframes, delay
action ATANKSPIN   0 1 7 1 4
action ATANKSHOOTING 7 2 7 1 10
action ATANKWAIT 0 1 7 1 1
action ATANKDESTRUCT 0 1 7 1 1
action ATANKDEAD 0 1 7 1 1
// move TANKVEL horiz vert
move TANKFORWARD 100
move TANKSTOP

useractor enemy TANK TANKSTRENGTH fall

  ifaction 0
  {
    sizeat 60 60
    action ATANKWAIT
    cstat 257
    clipdist 100
  }
  else
    ifaction ATANKSPIN
  {
    soundonce TANK_ROAM

    ifactioncount 20
    {
      ifrnd 16
        ifcansee
          ifcanshoottarget
      {
        move TANKSTOP geth
        action ATANKSHOOTING
        stopsound TANK_ROAM
      }
    }

    ifrnd 16
      move TANKFORWARD seekplayer
  }
  else
    ifaction ATANKSHOOTING
  {
    ifactioncount 22
    {
      ifpdistg 8192
      {
        sound BOS1_ATTACK2
        shoot MORTER
      }
      resetcount
      move 0 action ATANKWAIT
    }
    else
      ifactioncount 2
    {
      ifcansee
      {
        ifpdistl 16384
        {
          ifrnd 128
          {
            sound PISTOL_FIRE
            shoot SHOTSPARK1
          }
        }
        else
          ifrnd 128
        {
          sound PRED_ATTACK
          shoot FIRELASER
        }
      }
      else
      {
        move TANKFORWARD seekplayer
        action ATANKSPIN
      }
    }

    ifrnd 16
    {
      stopsound TANK_ROAM
      move TANKSTOP faceplayerslow
    }
  }
  else
    ifaction ATANKWAIT
  {
    ifactioncount 32
    {
      move TANKFORWARD seekplayer
      action ATANKSPIN
    }
  }
  else
    ifaction ATANKDESTRUCT
  {
    ifactioncount 64
      action ATANKDEAD
    else
      ifactioncount 56
       sound LASERTRIP_ARMING
     else
       ifactioncount 48
         sound LASERTRIP_ARMING
     else
       ifactioncount 32
         sound LASERTRIP_ARMING
     else
       ifactioncount 16
         sound LASERTRIP_ARMING
     break
  }
  else
    ifaction ATANKDEAD
  {
    addkills 1
    hitradius 6144 TOUGH TOUGH TOUGH TOUGH
    sound LASERTRIP_EXPLODE
    debris SCRAP1 15
    spawn EXPLOSION2
    ifrnd 128 spawn PIGCOP
    killit
  }

  ifhitweapon
  {
    ifdead
      action ATANKDEAD
    else
    {
      debris SCRAP1 1
      ifaction ATANKSHOOTING break

      ifrnd 192
      {
        move TANKSTOP geth
        action ATANKSHOOTING
        stopsound TANK_ROAM
      }
    }
  }

  ifpdistl 1280
    ifhitspace
      ifp pfacing
        ifangdiffl 512
          action ATANKDESTRUCT
enda







action ABOSS4WALK          0 4  5  1  30
action ABOSS4DYING        40 9  1  1  20
action ABOSS4ABOUTTOSHOOT 20 1  5  1  40
action ABOSS4SHOOT        25 2  5  1  10
action ABOSS4LAYIT        50 3  5  1  120
action BOSS4FLINTCH       40 1  1  1  1
action ABOSS4DEAD         49

move BOSS4WALKVELS 128
move BOSS4STOPPED

ai AIBOSS4LAYEGGS ABOSS4WALK BOSS4WALKVELS randomangle geth
ai AIBOSS4SHOOT ABOSS4ABOUTTOSHOOT BOSS4STOPPED faceplayer
ai AIBOSS4DYING ABOSS4DYING BOSS4STOPPED faceplayer

state boss4shootstate
  ifaction ABOSS4ABOUTTOSHOOT
    ifactioncount 3
      action ABOSS4SHOOT

  ifaction ABOSS4SHOOT
  {
    ifcount 48
    {
      ifrnd 4
        ai AIBOSS4LAYEGGS
    }
    ifcount 26
      ifrnd 32
    {
      ifrnd 128
      {
        sound SHORT_CIRCUIT
        addphealth -2
      }
      else
      {
        sound DUKE_GRUNT
        addphealth -1
      }
      palfrom 32 32 0 0
    }
  }

ends

state boss4layeggs
  ifrnd 2
    sound BOS4_ROAM

  ifaction ABOSS4LAYIT
  {
    ifactioncount 3
      ifcount 32
    {
      ai AIBOSS4LAYEGGS
      ifrnd 32
        move BOSS4WALKVELS furthestdir geth
      spawn NEWBEASTHANG
    }
  }
  else
    ifcount 64
      ifrnd 4
  {
    move 0

    ifrnd 88
    {
      action ABOSS4LAYIT
      sound BOS4_LAY
    }
    else
      ifp palive
        ifcansee
    {
      ai AIBOSS4SHOOT
      sound BOS4_ATTACK
    }
  }

ends

state boss4dyingstate
  ifaction ABOSS4DEAD
    break
  else
    ifactioncount 9
  {
    iffloordistl 8
      sound THUD

    endofgame 52
    action ABOSS4DEAD
    cstat 0
  }
ends

state checkboss4hitstate
  ifrnd 2
    spawn BLOODPOOL

  ifdead
  {
    globalsound DUKE_TALKTOBOSSFALL

    addkills 1
    ai AIBOSS4DYING

    sound BOS4_DYING
    sound BOSS4_DEADSPEECH
  }
  else
  {
    soundonce BOS4_PAIN
    debris SCRAP1 1
    guts JIBS6 1

    ifaction ABOSS4LAYIT
      break

    ifrnd 16
    {
      action BOSS4FLINTCH
      move 0
    }
  }
ends

state boss4code

  ifai 0
    ai AIBOSS4LAYEGGS
  else
    ifaction BOSS4FLINTCH
    {
      ifactioncount 3
        ai AIBOSS4LAYEGGS
    }
  else
    ifai AIBOSS4LAYEGGS
      state boss4layeggs
  else
    ifai AIBOSS4SHOOT
      state boss4shootstate

  ifai AIBOSS4DYING
    state boss4dyingstate
  else
  {
    ifhitweapon
      state checkboss4hitstate
    else
      ifp palive
        ifpdistl 1280
      {
        addphealth -1000
        palfrom 63 63
      }
  }
ends

actor BOSS4STAYPUT BOSS4STRENGTH

  fall
  cactor BOSS4
  spritepal 6
  state boss4code
  getlastpal

enda

actor BOSS4 BOSS4STRENGTH

  fall
  cactor BOSS4
  spritepal 6
  state boss4code
  getlastpal

enda

action ANEWBEASTSTAND     0
action ANEWBEASTWALKING   10  4  5  1  12
action ANEWBEASTRUNNING   10  4  5  1  8
action ANEWBEASTTHINK     0   2  5  1  40
action ANEWBEASTSCRATCHING  30  3  5  1  20
action ANEWBEASTDYING     72  8  1  1  15
action ANEWBEASTFLINTCH   71  1  1  1  1
action ANEWBEASTLYINGDEAD 79  1  1
action ANEWBEASTSCREAM    50  2  5  1  40
action ANEWBEASTJUMP      80  2  5  1  50
action ANEWBEASTFALL      90  1  5
action ANEWBEASTFROZEN    10  1  5

action ANEWBEASTHANG      0  1  5
useractor enemy NEWBEASTHANG NEWBEASTSTRENGTH
  ifaction 0
  {
    action ANEWBEASTHANG
    cstator 257

    sizeat 40 40
  }
  else
    ifhitweapon
  {
    cactor NEWBEAST
    action ANEWBEASTSTAND
    sound NEWBEAST_PAIN
  }
  else
    ifspawnedby BOSS4
      ifcount 200
        ifrnd 1
  {
    cactor NEWBEAST
    action ANEWBEASTSTAND
    sound NEWBEAST_PAIN
  }
enda

action ANEWBEASTHANGDEAD      -1  1  5
useractor enemy NEWBEASTHANGDEAD TOUGH

  ifaction 0
  {
    action ANEWBEASTHANGDEAD
    sizeat 40 40
    cstator 257
  }
  else
    ifhitweapon
  {
    ifdead
    {
      state standard_jibs
      spawn BLOODPOOL
      sound SQUISHED
      killit
    }
    else
    {
      guts JIBS6 1
      sound SQUISHED
    }
  }
enda

move NEWBEASTWALKVEL 182
move NEWBEASTRUNVEL 256
move NEWBEASTJUMPVEL 264
move NEWBEASTSTOP

ai AINEWBEASTGETENEMY ANEWBEASTWALKING NEWBEASTWALKVEL seekplayer
ai AINEWBEASTDODGE ANEWBEASTRUNNING NEWBEASTRUNVEL dodgebullet
ai AINEWBEASTCHARGEENEMY ANEWBEASTRUNNING NEWBEASTRUNVEL seekplayer
ai AINEWBEASTFLEENEMY ANEWBEASTWALKING NEWBEASTWALKVEL fleeenemy
ai AINEWBEASTSCRATCHENEMY ANEWBEASTSCRATCHING NEWBEASTSTOP faceplayerslow
ai AINEWBEASTJUMPENEMY ANEWBEASTJUMP NEWBEASTJUMPVEL jumptoplayer
ai AINEWBEASTTHINK ANEWBEASTTHINK NEWBEASTSTOP
// ai AINEWBEASTSHRUNK ANEWBEASTWALKING SHRUNKVELS fleeenemy
ai AINEWBEASTGROW ANEWBEASTSTAND  NEWBEASTSTOP faceplayerslow
ai AINEWBEASTDYING ANEWBEASTDYING NEWBEASTSTOP faceplayer
ai AINEWBEASTSHOOT ANEWBEASTSCREAM NEWBEASTSTOP faceplayerslow
ai AINEWBEASTFLINTCH ANEWBEASTFLINTCH NEWBEASTSTOP faceplayerslow


state newbeastseekstate

  ifactornotstayput
  {
    ifp palive
      ifcansee
        ifpdistl 1596
    {
      ai AINEWBEASTSCRATCHENEMY
      break
    }

    ifai AINEWBEASTCHARGEENEMY
    {
      ifp palive
        ifpdistl 1596
          ifcansee
      {
        ai AINEWBEASTSCRATCHENEMY
        break
      }

      ifrnd 1
        ifpdistg 4096
          ifp palive
            ifcansee
      {
        ai AINEWBEASTSHOOT
        break
      }
    }
    else
      ifpdistg 4096
    {
      ai AINEWBEASTCHARGEENEMY
      break
    }

    iffloordistl 16
    {
      ifcount 32
        ifrnd 16
      {
        ifceilingdistl 96 break
        ai AINEWBEASTJUMPENEMY
      }
      break
    }

    ifrnd 4
    {
      ifnotmoving
        operate
    }
    else
      ifrnd 16
        ifbulletnear
    {
      ifgapzl 128
        ai AINEWBEASTDODGE
      else
        ifactornotstayput
      {
        ifrnd 128
        {
          ifceilingdistl 96 break
          ai AINEWBEASTJUMPENEMY
        }
        else
          ai AINEWBEASTDODGE
      }
    }
  }
  else
  {
    ifactioncount 16
    {
      ifp palive
        ifpdistl 1596
          ifcansee
      {
        ai AINEWBEASTSCRATCHENEMY
        break
      }
    }
    ifcount 16
      ifrnd 32
        move NEWBEASTWALKVEL randomangle geth
  }

ends

/*
state newbeastshrunkstate
  ifcount SHRUNKDONECOUNT
    ai AINEWBEASTGETENEMY
  else
    ifcount SHRUNKCOUNT
      sizeto 48 40
  else
    state genericshrunkcode
ends
*/

state newbeastfleestate
  ifcount 8
  {
    ifrnd 64
      ifpdistg 3500
        ifp palive
          ifcansee
            ai AINEWBEASTSHOOT
  }
  else
  {
    iffloordistl 16
    {
      ifnotmoving
        ai AINEWBEASTGETENEMY
    }
    else
      ai AINEWBEASTGETENEMY
    break
  }
ends

state newbeastthinkstate

  ifrnd 8
    soundonce NEWBEAST_ROAM

  ifactioncount 3
  {
    ifrnd 128
    {
      ifpdistg 3500
        ifp palive
          ifcansee
            ai AINEWBEASTSHOOT
    }
    else
      ai AINEWBEASTGETENEMY
  }

  ifrnd 16
    ifbulletnear
  {
    ifgapzl 96
      ai AINEWBEASTDODGE
    else
    {
      ifrnd 128
      {
        ifceilingdistl 144 break
        ai AINEWBEASTJUMPENEMY
      }
      else
        ai AINEWBEASTDODGE
    }
  }
ends

state newbeastscratchstate
  ifcount 20
    ifrnd 8
  {
    ifcansee
      ifpdistl 2048
    {
      ifrnd 128
        ai AINEWBEASTFLEENEMY
      break
    }
    ifrnd 80
      ai AINEWBEASTTHINK
    else
      ai AINEWBEASTGETENEMY
  }

  ifactioncount 3
  {
    ifpdistg 1596
      ai AINEWBEASTTHINK
    else ifp palive ifcansee
    {
      palfrom 16 16
      addphealth NEWBEASTSCRATCHAMOUNT
      sound DUKE_GRUNT
      resetactioncount
      resetcount
    }
  }
  else
    ifcount 15
      nullop
  else
    ifcount 14
  {
    ifpdistl 1596
      soundonce NEWBEAST_ATTACK
    else
      soundonce NEWBEAST_ATTACKMISS
  }
ends

state checknewbeasthit
  spawn BLOOD
/*
  ifai AINEWBEASTSHRUNK
  {
    addkills 1
    sound SQUISHED
    state standard_jibs
    killit
  }
*/
  ifdead
  {
    ifwasweapon FREEZEBLAST
    {
      sound SOMETHINGFROZE
      spritepal 1
      move 0
      action ANEWBEASTFROZEN
      strength 0
      break
    }

    ifwasweapon GROWSPARK
    {
      cstat 0
      sound ACTOR_GROWING
      ai AINEWBEASTGROW
      break
    }

    addkills 1

    ifwasweapon RPG
    {
      sound SQUISHED
      state liz_body_jibs
      state standard_jibs
      killit
    }
    else
      ifwasweapon RADIUSEXPLOSION
    {
      sound SQUISHED
      state liz_body_jibs
      state standard_jibs
      killit
    }
    else
    {
      state rf
      ai AINEWBEASTDYING
      ifrnd 64
        spawn BLOODPOOL
    }
    sound NEWBEAST_DYING
  }
  else
  {
    sound NEWBEAST_PAIN
    ifwasweapon GROWSPARK
      sound EXPANDERHIT
/*
//  The alien is immune to the shrinker
    ifwasweapon SHRINKSPARK
    {
      sound ACTOR_SHRINKING
      ai AINEWBEASTSHRUNK
      break
    }
*/
    state random_wall_jibs
    ifrnd 32
      ai AINEWBEASTFLINTCH
    else
      ifrnd 32
        ifpdistg 3500
          ifp palive
            ifcansee
              ai AINEWBEASTSHOOT
  }
ends

state newbeastjumpstate
  ifaction ANEWBEASTFALL
  {
    iffloordistl 16
      ai AINEWBEASTGETENEMY
  }
  else
    ifcount 32
      action ANEWBEASTFALL
ends

state newbeastdyingstate
  ifaction ANEWBEASTLYINGDEAD
  {
    strength 0
    ifhitweapon
      ifwasweapon RADIUSEXPLOSION
    {
      sound SQUISHED
      state standard_jibs
      killit
    }
    ifcount RESPAWNACTORTIME
      ifrespawn
    {
      spawn TRANSPORTERSTAR
      cstat 257
      strength NEWBEASTSTRENGTH
      ai AINEWBEASTGETENEMY
    }
  }
  else
    ifai AINEWBEASTDYING
      ifactioncount 7
  {
    iffloordistl 8
      sound THUD
    move NEWBEASTSTOP
    action ANEWBEASTLYINGDEAD
  }
ends

state newbeastdodgestate
  ifcount 13
    ai AINEWBEASTGETENEMY
ends

useractor enemystayput NEWBEASTSTAYPUT NEWBEASTSTRENGTH ai AINEWBEASTGETENEMY cstator 257 cactor NEWBEAST enda
useractor enemy NEWBEASTJUMP NEWBEASTSTRENGTH ai AINEWBEASTJUMPENEMY cstator 257 cactor NEWBEAST enda

state newbeastcode
  state checksquished
  ifai 0
  {
    cstator 257
    ai AINEWBEASTGETENEMY
  }
  else
    ifaction ANEWBEASTLYINGDEAD
  {
    fall
    state newbeastdyingstate
    break
  }
  else
    ifaction ANEWBEASTFROZEN
  {
    ifcount THAWTIME
    {
      ai AINEWBEASTGETENEMY
      spritepal 0
    }
    else
      ifcount FROZENDRIPTIME
    {
      ifactioncount 26
      {
        spawn WATERDRIP
        resetactioncount
      }
    }

    ifhitweapon
    {
      ifwasweapon FREEZEBLAST
      {
        strength 0
        break
      }
      addkills 1

      ifrnd 84
        spawn BLOODPOOL
      lotsofglass 30
      sound GLASS_BREAKING
      killit
    }
    ifp pfacing
      ifpdistl FROZENQUICKKICKDIST
        pkick
    break
  }
  else
    ifai AINEWBEASTJUMPENEMY
      state newbeastjumpstate
  else
  {
    fall
    ifai AINEWBEASTGETENEMY
      state newbeastseekstate
    else
      ifai AINEWBEASTCHARGEENEMY
        state newbeastseekstate
    else
      ifai AINEWBEASTFLINTCH
    {
      ifcount 8
        ai AINEWBEASTGETENEMY
    }

    else
      ifai AINEWBEASTDODGE
        state newbeastdodgestate
    else
      ifai AINEWBEASTSCRATCHENEMY
        state newbeastscratchstate
    else
      ifai AINEWBEASTFLEENEMY
        state newbeastfleestate
    else
      ifai AINEWBEASTTHINK
        state newbeastthinkstate
/*
    else
      ifai AINEWBEASTSHRUNK
        state newbeastshrunkstate
*/
    else
      ifai AINEWBEASTGROW
        state genericgrowcode
    else
      ifai AINEWBEASTDYING
        state newbeastdyingstate
    else
      ifai AINEWBEASTSHOOT
    {
      ifp pshrunk
        ai AINEWBEASTGETENEMY
      else
        ifcount 26
          ai AINEWBEASTGETENEMY
      else
        ifcount 25
          shoot SHRINKER
      else
      {
        ifcount 5
          nullop
        else
          ifcount 4
            sound NEWBEAST_SPIT
      }
    }
  }

  ifhitweapon
    state checknewbeasthit
ends


useractor enemy NEWBEAST NEWBEASTSTRENGTH
  fall
  ifaction 0
  {
    cstator 257
    sizeat 40 40
    ai AINEWBEASTDODGE
  }
  ifaction ANEWBEASTFROZEN
    state newbeastcode
  else
  {
    spritepal 6
    state newbeastcode
    ifaction ANEWBEASTFROZEN
      break
    getlastpal
  }
enda


DEFS.CON (v1.3)
/*
--------------------------------------------------------------------------------
Duke Nukem 3D .CON file.
By Todd Replogle
(c) 1996 3D Realms Entertainment
--------------------------------------------------------------------------------

IMPORTANT NOTICE IF YOU USE MODIFIED .CON FILES

If you are playing a MULTIPLAY game (Dukematch or Co-op) and you are
using *modified* .CON files (USER.CON, GAME.CON, DEFS.CON), then each
multiplayer must be using the EXACT SAME .CON files, or the game will
get out of sync and/or develop interesting problems.

3D Realms encourages you to experiment freely with the parameters
contained in this file, and to share your discoveries with the rest
of the world.  However, BE ADVISED that 3D Realms does NOT offer 
any technical support on how to use this file or other user-modifiable 
features of this game.  Do NOT call 3D Realms or Apogee Software 
for advice or help with this subject.  

You make modifications to this and other files at your own risk. 
It is recommended that you first make a backup copy of this, or
any .CON files before making any changes.

--------------------------------------------------------------------------------

*/


define SECTOREFFECTOR 1
define ACTIVATOR 2
define TOUCHPLATE 3
define ACTIVATORLOCKED 4
define MUSICANDSFX 5
define LOCATORS 6
define CYCLER 7
define MASTERSWITCH 8
define RESPAWN 9
define GPSPEED 10
define ARROW 20
define FIRSTGUNSPRITE 21
define CHAINGUNSPRITE 22
define RPGSPRITE 23
define FREEZESPRITE 24
define SHRINKERSPRITE 25
define HEAVYHBOMB 26
define TRIPBOMBSPRITE 27
define SHOTGUNSPRITE 28
define DEVISTATORSPRITE 29
define HEALTHBOX 30
define AMMOBOX 31
define INVENTORYBOX 33
define FREEZEAMMO 37
define AMMO 40
define BATTERYAMMO 41
define DEVISTATORAMMO 42
define RPGAMMO 44
define CRYSTALAMMO 46
define HBOMBAMMO 47
define AMMOLOTS 48
define SHOTGUNAMMO 49
define COLA 51
define SIXPAK 52
define FIRSTAID 53
define SHIELD 54
define STEROIDS 55
define AIRTANK 56
define JETPACK 57
define HEATSENSOR 59
define ACCESSCARD 60
define BOOTS 61
define MIRRORBROKE 70
define MOONSKY1 80
define MOONSKY2 81
define MOONSKY3 82
define MOONSKY4 83
define BIGORBIT1 84
define BIGORBIT2 85
define BIGORBIT3 86
define BIGORBIT4 87
define BIGORBIT5 88
define LA 89
define ATOMICHEALTH 100
define TECHLIGHT2 120
define TECHLIGHTBUST2 121
define TECHLIGHT4 122
define TECHLIGHTBUST4 123
define WALLLIGHT4 124
define WALLLIGHTBUST4 125
define ACCESSSWITCH 130
define SLOTDOOR 132
define LIGHTSWITCH 134
define SPACEDOORSWITCH 136
define SPACELIGHTSWITCH 138
define FRANKENSTINESWITCH 140
define NUKEBUTTON 142
define MULTISWITCH 146
define DOORTILE5 150
define DOORTILE6 151
define DOORTILE1 152
define DOORTILE2 153
define DOORTILE3 154
define DOORTILE4 155
define DOORTILE7 156
define DOORTILE8 157
define DOORTILE9 158
define DOORTILE10 159
define DOORSHOCK 160
define DIPSWITCH 162
define DIPSWITCH2 164
define TECHSWITCH 166
define DIPSWITCH3 168
define ACCESSSWITCH2 170
define REFLECTWATERTILE 180
define FLOORSLIME 200
define BIGFORCE 230
define EPISODE 247
define MASKWALL9 255
define W_LIGHT 260
define SCREENBREAK1 263
define SCREENBREAK2 264
define SCREENBREAK3 265
define SCREENBREAK4 266
define SCREENBREAK5 267
define SCREENBREAK6 268
define SCREENBREAK7 269
define SCREENBREAK8 270
define SCREENBREAK9 271
define SCREENBREAK10 272
define SCREENBREAK11 273
define SCREENBREAK12 274
define SCREENBREAK13 275
define MASKWALL1 285
define W_TECHWALL1 293
define W_TECHWALL2 297
define W_TECHWALL3 301
define W_TECHWALL4 305
define WATERTILE2 336
define BPANNEL1 341
define PANNEL1 342
define PANNEL2 343
define WATERTILE 344
define STATIC 351
define W_SCREENBREAK 357
define W_HITTECHWALL3 360
define W_HITTECHWALL4 361
define W_HITTECHWALL2 362
define W_HITTECHWALL1 363
define MASKWALL10 387
define MASKWALL11 391
define DOORTILE22 395
define FANSPRITE 407
define FANSPRITEBROKE 411
define FANSHADOW 412
define FANSHADOWBROKE 416
define DOORTILE18 447
define DOORTILE19 448
define DOORTILE20 449
define SPACESHUTTLE 487
define SATELLITE 489
define VIEWSCREEN2 499
define VIEWSCREENBROKE 501
define VIEWSCREEN 502
define GLASS 503
define GLASS2 504
define STAINGLASS1 510
define MASKWALL5 514
define SATELITE 516
define FUELPOD 517
define SLIMEPIPE 538
define CRACK1 546
define CRACK2 547
define CRACK3 548
define CRACK4 549
define FOOTPRINTS 550
define DOMELITE 551
define CAMERAPOLE 554
define CHAIR1 556
define CHAIR2 557
define BROKENCHAIR 559
define MIRROR 560
define WATERFOUNTAIN 563
define WATERFOUNTAINBROKE 567
define FEMMAG1 568
define TOILET 569
define STALL 571
define STALLBROKE 573
define FEMMAG2 577
define REACTOR2 578
define REACTOR2BURNT 579
define REACTOR2SPARK 580
define GRATE1 595
define BGRATE1 596
define SOLARPANNEL 602
define NAKED1 603
define ANTENNA 607
define MASKWALL12 609
define TOILETBROKE 615
define PIPE2 616
define PIPE1B 617
define PIPE3 618
define PIPE1 619
define CAMERA1 621
define BRICK 626
define SPLINTERWOOD 630
define PIPE2B 633
define BOLT1 634
define W_NUMBERS 640
define WATERDRIP 660
define WATERBUBBLE 661
define WATERBUBBLEMAKER 662
define W_FORCEFIELD 663
define VACUUM 669
define FOOTPRINTS2 672
define FOOTPRINTS3 673
define FOOTPRINTS4 674
define EGG 675
define SCALE 678
define CHAIR3 680
define CAMERALIGHT 685
define MOVIECAMERA 686
define IVUNIT 689
define POT1 694
define POT2 695
define POT3 697
define PIPE3B 700
define WALLLIGHT3 701
define WALLLIGHTBUST3 702
define WALLLIGHT1 703
define WALLLIGHTBUST1 704
define WALLLIGHT2 705
define WALLLIGHTBUST2 706
define LIGHTSWITCH2 712
define WAITTOBESEATED 716
define DOORTILE14 717
define STATUE 753
define MIKE 762
define VASE 765
define SUSHIPLATE1 768
define SUSHIPLATE2 769
define SUSHIPLATE3 774
define SUSHIPLATE4 779
define DOORTILE16 781
define SUSHIPLATE5 792
define OJ 806
define MASKWALL13 830
define HURTRAIL 859
define POWERSWITCH1 860
define LOCKSWITCH1 862
define POWERSWITCH2 864
define ATM 867
define STATUEFLASH 869
define ATMBROKE 888
define BIGHOLE2 893
define STRIPEBALL 901
define QUEBALL 902
define POCKET 903
define WOODENHORSE 904
define TREE1 908
define TREE2 910
define CACTUS 911
define MASKWALL2 913
define MASKWALL3 914
define MASKWALL4 915
define FIREEXT 916
define TOILETWATER 921
define NEON1 925
define NEON2 926
define CACTUSBROKE 939
define BOUNCEMINE 940
define BROKEFIREHYDRENT 950
define BOX 951
define BULLETHOLE 952
define BOTTLE1 954
define BOTTLE2 955
define BOTTLE3 956
define BOTTLE4 957
define FEMPIC5 963
define FEMPIC6 964
define FEMPIC7 965
define HYDROPLANT 969
define OCEANSPRITE1 971
define OCEANSPRITE2 972
define OCEANSPRITE3 973
define OCEANSPRITE4 974
define OCEANSPRITE5 975
define GENERICPOLE 977
define CONE 978
define HANGLIGHT 979
define HYDRENT 981
define MASKWALL14 988
define TIRE 990
define PIPE5 994
define PIPE6 995
define PIPE4 996
define PIPE4B 997
define BROKEHYDROPLANT 1003
define PIPE5B 1005
define NEON3 1007
define NEON4 1008
define NEON5 1009
define BOTTLE5 1012
define BOTTLE6 1013
define BOTTLE8 1014
define SPOTLITE 1020
define HANGOOZ 1022
define MASKWALL15 1024
define BOTTLE7 1025
define HORSEONSIDE 1026
define GLASSPIECES 1031
define HORSELITE 1034
define NEON6 1046
define MASKWALL6 1059
define CLOCK 1060
define RUBBERCAN 1062
define BROKENCLOCK 1067
define PLUG 1069
define OOZFILTER 1079
define FLOORPLASMA 1082
define REACTOR 1088
define REACTORSPARK 1092
define REACTORBURNT 1096
define DOORTILE15 1102
define HANDSWITCH 1111
define CIRCLEPANNEL 1113
define CIRCLEPANNELBROKE 1114
define PULLSWITCH 1122
define MASKWALL8 1124
define BIGHOLE 1141
define ALIENSWITCH 1142
define DOORTILE21 1144
define HANDPRINTSWITCH 1155
define BOTTLE10 1157
define BOTTLE11 1158
define BOTTLE12 1159
define BOTTLE13 1160
define BOTTLE14 1161
define BOTTLE15 1162
define BOTTLE16 1163
define BOTTLE17 1164
define BOTTLE18 1165
define BOTTLE19 1166
define DOORTILE17 1169
define MASKWALL7 1174
define JAILBARBREAK 1175
define DOORTILE11 1178
define DOORTILE12 1179
define VENDMACHINE 1212
define VENDMACHINEBROKE 1214
define COLAMACHINE 1215
define COLAMACHINEBROKE 1217
define CRANEPOLE 1221
define CRANE 1222
define BARBROKE 1225
define BLOODPOOL 1226
define NUKEBARREL 1227
define NUKEBARRELDENTED 1228
define NUKEBARRELLEAKED 1229
define CANWITHSOMETHING 1232
define MONEY 1233
define BANNER 1236
define EXPLODINGBARREL 1238
define EXPLODINGBARREL2 1239
define FIREBARREL 1240
define SEENINE 1247
define SEENINEDEAD 1248
define STEAM 1250
define CEILINGSTEAM 1255
define PIPE6B 1260
define TRANSPORTERBEAM 1261
define RAT 1267
define TRASH 1272
define FEMPIC1 1280
define FEMPIC2 1289
define BLANKSCREEN 1293
define PODFEM1 1294
define FEMPIC3 1298
define FEMPIC4 1306
define FEM1 1312
define FEM2 1317
define FEM3 1321
define FEM5 1323
define BLOODYPOLE 1324
define FEM4 1325
define FEM6 1334
define FEM6PAD 1335
define FEM8 1336
define HELECOPT 1346
define FETUSJIB 1347
define HOLODUKE 1348
define SPACEMARINE 1353
define INDY 1355
define FETUS 1358
define FETUSBROKE 1359
define MONK 1352
define LUKE 1354
define COOLEXPLOSION1 1360
define WATERSPLASH2 1380
define FIREVASE 1390
define SCRATCH 1393
define FEM7 1395
define APLAYERTOP 1400
define APLAYER 1405
define PLAYERONWATER 1420
define DUKELYINGDEAD 1518
define DUKETORSO 1520
define DUKEGUN 1528
define DUKELEG 1536
define SHARK 1550
define BLOOD 1620
define FIRELASER 1625
define TRANSPORTERSTAR 1630
define SPIT 1636
define LOOGIE 1637
define FIST 1640
define FREEZEBLAST 1641
define DEVISTATORBLAST 1642
define SHRINKSPARK 1646
define TONGUE 1647
define MORTER 1650
define SHRINKEREXPLOSION 1656
define RADIUSEXPLOSION 1670
define FORCERIPPLE 1671
define LIZTROOP 1680
define LIZTROOPRUNNING 1681
define LIZTROOPSTAYPUT 1682
define LIZTOP 1705
define LIZTROOPSHOOT 1715
define LIZTROOPJETPACK 1725
define LIZTROOPDSPRITE 1734
define LIZTROOPONTOILET 1741
define LIZTROOPDUCKING 1744
define HEADJIB1 1768
define ARMJIB1 1772
define LEGJIB1 1776
define OCTABRAIN 1820
define OCTABRAINSTAYPUT 1821
define OCTATOP 1845
define OCTADEADSPRITE 1855
define INNERJAW 1860
define DRONE 1880
define EXPLOSION2 1890
define COMMANDER 1920
define COMMANDERSTAYPUT 1921
define RECON 1960
define PIGCOP 2000
define PIGCOPSTAYPUT 2001
define PIGCOPDIVE 2045
define PIGCOPDEADSPRITE 2060
define PIGTOP 2061
define LIZMAN 2120
define LIZMANSTAYPUT 2121
define LIZMANSPITTING 2150
define LIZMANFEEDING 2160
define LIZMANJUMP 2165
define LIZMANDEADSPRITE 2185
define FECES 2200
define LIZMANHEAD1 2201
define LIZMANARM1 2205
define LIZMANLEG1 2209
define EXPLOSION2BOT 2219
define USERWEAPON 2235
define HEADERBAR 2242
define JIBS1 2245
define JIBS2 2250
define JIBS3 2255
define JIBS4 2260
define JIBS5 2265
define BURNING 2270
define FIRE 2271
define JIBS6 2286
define BLOODSPLAT1 2296
define BLOODSPLAT3 2297
define BLOODSPLAT2 2298
define BLOODSPLAT4 2299
define OOZ 2300
define WALLBLOOD1 2301
define WALLBLOOD2 2302
define WALLBLOOD3 2303
define WALLBLOOD4 2304
define WALLBLOOD5 2305
define WALLBLOOD6 2306
define WALLBLOOD7 2307
define WALLBLOOD8 2308
define BURNING2 2310
define FIRE2 2311
define CRACKKNUCKLES 2324
define SMALLSMOKE 2329
define SMALLSMOKEMAKER 2330
define FLOORFLAME 2333
define ROTATEGUN 2360
define GREENSLIME 2370
define WATERDRIPSPLASH 2380
define SCRAP6 2390
define SCRAP1 2400
define SCRAP2 2404
define SCRAP3 2408
define SCRAP4 2412
define SCRAP5 2416
define ORGANTIC 2420
define BETAVERSION 2440
define PLAYERISHERE 2442
define PLAYERWASHERE 2443
define SELECTDIR 2444
define F1HELP 2445
define NOTCHON 2446
define NOTCHOFF 2447
define BACKGROUNDSCREEN 2448
define DUKEICON 2452
define BADGUYICON 2453
define FOODICON 2454
define GETICON 2455
define MENUSCREEN 2456
define MENUBAR 2457
define KILLSICON 2458
define FIRSTAID_ICON 2460
define HEAT_ICON 2461
define BOTTOMSTATUSBAR 2462
define BOOT_ICON 2463
define FRAGBAR 2465
define JETPACK_ICON 2467
define AIRTANK_ICON 2468
define STEROIDS_ICON 2469
define HOLODUKE_ICON 2470
define ACCESS_ICON 2471
define DIGITALNUM 2472
define DUKECAR 2491
define CAMCORNER 2482
define CAMLIGHT 2484
define LOGO 2485
define TITLE 2486
define NUKEWARNINGICON 2487
define MOUSECURSOR 2488
define SLIDEBAR 2489
define DREALMS 2492
define BETASCREEN 2493
define WINDOWBORDER1 2494
define TEXTBOX 2495
define WINDOWBORDER2 2496
define DUKENUKEM 2497
define THREEDEE 2498
define INGAMEDUKETHREEDEE 2499
define DEVISTATOR 2510
define KNEE 2521
define CROSSHAIR 2523
define FIRSTGUN 2524
define FIRSTGUNRELOAD 2528
define FALLINGCLIP 2530
define CLIPINHAND 2531
define HAND 2532
define SHELL 2533
define SHOTGUNSHELL 2535
define CHAINGUN 2536
define RPGGUN 2544
define RPGMUZZLEFLASH 2545
define FREEZE 2548
define CATLITE 2552
define SHRINKER 2556
define HANDHOLDINGLASER 2563
define TRIPBOMB 2566
define LASERLINE 2567
define HANDHOLDINGACCESS 2568
define HANDREMOTE 2570
define HANDTHROW 2573
define TIP 2576
define GLAIR 2578
define SCUBAMASK 2581
define SPACEMASK 2584
define FORCESPHERE 2590
define SHOTSPARK1 2595
define RPG 2605
define LASERSITE 2612
define SHOTGUN 2613
define BOSS1 2630
define BOSS1STAYPUT 2631
define BOSS1SHOOT 2660
define BOSS1LOB 2670
define BOSSTOP 2696
define BOSS2 2710
define BOSS3 2760
define SPINNINGNUKEICON 2813
define BIGFNTCURSOR 2820
define SMALLFNTCURSOR 2821
define STARTALPHANUM 2822
define ENDALPHANUM 2915
define BIGALPHANUM 2940
define BIGPERIOD 3002
define BIGCOMMA 3003
define BIGX 3004
define BIGQ 3005
define BIGSEMI 3006
define BIGCOLIN 3007
define THREEBYFIVE 3010
define BIGAPPOS 3022
define BLANK 3026
define MINIFONT 3072
define BUTTON1 3164
define GLASS3 3187
define RESPAWNMARKERRED 3190
define RESPAWNMARKERYELLOW 3200
define RESPAWNMARKERGREEN 3210
define BONUSSCREEN 3240
define VIEWBORDER 3250
define VICTORY1 3260
define ORDERING 3270
define TEXTSTORY 3280
define BORNTOBEWILDSCREEN 3370
define BLIMP 3400
define FEM9 3450
define FOOTPRINT 3701
define POOP 3998
define FRAMEEFFECT1 3999


define KNEE_WEAPON         0
define PISTOL_WEAPON       1
define SHOTGUN_WEAPON      2
define CHAINGUN_WEAPON     3
define RPG_WEAPON          4
define HANDBOMB_WEAPON     5
define SHRINKER_WEAPON     6
define DEVISTATOR_WEAPON   7
define TRIPBOMB_WEAPON     8
define FREEZE_WEAPON       9


define faceplayer 1
define geth 2
define getv 4
define randomangle 8
define faceplayerslow 16
define spin 32
define faceplayersmart 64
define fleeenemy 128
define jumptoplayer 257
define seekplayer 512
define furthestdir 1024
define dodgebullet 4096


define NO       0
define YES      1


define pstanding 1
define pwalking 2
define prunning 4
define pducking 8
define pfalling 16
define pjumping 32
define phigher 64
define pwalkingback 128
define prunningback 256
define pkicking 512
define pshrunk 1024
define pjetpack 2048
define ponsteroids 4096
define ponground 8192
define palive 16384
define pdead 32768
define pfacing 65536


define GET_STEROIDS     0
define GET_SHIELD       1
define GET_SCUBA        2
define GET_HOLODUKE     3
define GET_JETPACK      4
define GET_ACCESS       6
define GET_HEATS        7
define GET_FIRSTAID     9
define GET_BOOTS       10


define KICK_HIT                         0
define PISTOL_RICOCHET                  1
define PISTOL_BODYHIT                   2
define PISTOL_FIRE                      3
define EJECT_CLIP                       4
define INSERT_CLIP                      5
define CHAINGUN_FIRE                    6
define RPG_SHOOT                        7
define POOLBALLHIT                      8
define RPG_EXPLODE                      9
define CAT_FIRE                        10
define SHRINKER_FIRE                   11
define ACTOR_SHRINKING                 12
define PIPEBOMB_BOUNCE                 13
define PIPEBOMB_EXPLODE                14
define LASERTRIP_ONWALL                15
define LASERTRIP_ARMING                16
define LASERTRIP_EXPLODE               17
define VENT_BUST                       18
define GLASS_BREAKING                  19
define GLASS_HEAVYBREAK                20
define SHORT_CIRCUIT                   21
define ITEM_SPLASH                     22
define DUKE_BREATHING                  23
define DUKE_EXHALING                   24
define DUKE_GASP                       25
define SLIM_RECOG                      26
define ENDSEQVOL3SND1                  27
define DUKE_URINATE                    28
define ENDSEQVOL3SND2                  29
define ENDSEQVOL3SND3                  30
define DUKE_PASSWIND                   32
define DUKE_CRACK                      33
define SLIM_ATTACK                     34
define SOMETHINGHITFORCE               35
define DUKE_DRINKING                   36
define DUKE_KILLED1                    37
define DUKE_GRUNT                      38
define DUKE_HARTBEAT                   39
define DUKE_ONWATER                    40
define DUKE_DEAD                       41
define DUKE_LAND                       42
define DUKE_WALKINDUCTS                43
define DUKE_GLAD                       44
define DUKE_YES                        45
define DUKE_HEHE                       46
define DUKE_SHUCKS                     47
define DUKE_UNDERWATER                 48
define DUKE_JETPACK_ON                 49
define DUKE_JETPACK_IDLE               50
define DUKE_JETPACK_OFF                51
define LIZTROOP_GROWL                  52
define LIZTROOP_TALK1                  53
define LIZTROOP_TALK2                  54
define LIZTROOP_TALK3                  55
define DUKETALKTOBOSS                  56
define LIZCAPT_GROWL                   57
define LIZCAPT_TALK1                   58
define LIZCAPT_TALK2                   59
define LIZCAPT_TALK3                   60
define LIZARD_BEG                      61
define LIZARD_PAIN                     62
define LIZARD_DEATH                    63
define LIZARD_SPIT                     64
define DRONE1_HISSRATTLE               65
define DRONE1_HISSSCREECH              66
define DUKE_TIP2                       67
define FLESH_BURNING                   68
define SQUISHED                        69
define TELEPORTER                      70
define ELEVATOR_ON                     71
define DUKE_KILLED3                    72
define ELEVATOR_OFF                    73
define DOOR_OPERATE1                   74
define SUBWAY                          75
define SWITCH_ON                       76
define FAN                             77
define DUKE_GETWEAPON3                 78
define FLUSH_TOILET                    79
define HOVER_CRAFT                     80
define EARTHQUAKE                      81
define INTRUDER_ALERT                  82
define END_OF_LEVEL_WARN               83
define ENGINE_OPERATING                84
define REACTOR_ON                      85
define COMPUTER_AMBIENCE               86
define GEARS_GRINDING                  87
define BUBBLE_AMBIENCE                 88
define MACHINE_AMBIENCE                89
define SEWER_AMBIENCE                  90
define WIND_AMBIENCE                   91
define SOMETHING_DRIPPING              92
define STEAM_HISSING                   93
define THEATER_BREATH                  94
define BAR_MUSIC                       95
define BOS1_ROAM                       96
define BOS1_RECOG                      97
define BOS1_ATTACK1                    98
define BOS1_PAIN                       99
define BOS1_DYING                     100
define BOS2_ROAM                      101
define BOS2_RECOG                     102
define BOS2_ATTACK                    103
define BOS2_PAIN                      104
define BOS2_DYING                     105
define GETATOMICHEALTH                106
define DUKE_GETWEAPON2                107
define BOS3_DYING                     108
define SHOTGUN_FIRE                   109
define PRED_ROAM                      110
define PRED_RECOG                     111
define PRED_ATTACK                    112
define PRED_PAIN                      113
define PRED_DYING                     114
define CAPT_ROAM                      115
define CAPT_ATTACK                    116
define CAPT_RECOG                     117
define CAPT_PAIN                      118
define CAPT_DYING                     119
define PIG_ROAM                       120
define PIG_RECOG                      121
define PIG_ATTACK                     122
define PIG_PAIN                       123
define PIG_DYING                      124
define RECO_ROAM                      125
define RECO_RECOG                     126
define RECO_ATTACK                    127
define RECO_PAIN                      128
define RECO_DYING                     129
define DRON_ROAM                      130
define DRON_RECOG                     131
define DRON_ATTACK1                   132
define DRON_PAIN                      133
define DRON_DYING                     134
define COMM_ROAM                      135
define COMM_RECOG                     136
define COMM_ATTACK                    137
define COMM_PAIN                      138
define COMM_DYING                     139
define OCTA_ROAM                      140
define OCTA_RECOG                     141
define OCTA_ATTACK1                   142
define OCTA_PAIN                      143
define OCTA_DYING                     144
define TURR_ROAM                      145
define TURR_RECOG                     146
define TURR_ATTACK                    147
define DUMPSTER_MOVE                  148
define SLIM_DYING                     149
define BOS3_ROAM                      150
define BOS3_RECOG                     151
define BOS3_ATTACK1                   152
define BOS3_PAIN                      153
define BOS1_ATTACK2                   154
define COMM_SPIN                      155
define BOS1_WALK                      156
define DRON_ATTACK2                   157
define THUD                           158
define OCTA_ATTACK2                   159
define WIERDSHOT_FLY                  160
define TURR_PAIN                      161
define TURR_DYING                     162
define SLIM_ROAM                      163
define LADY_SCREAM                    164
define DOOR_OPERATE2                  165
define DOOR_OPERATE3                  166
define DOOR_OPERATE4                  167
define BORNTOBEWILDSND                168
define SHOTGUN_COCK                   169
define GENERIC_AMBIENCE1              170
define GENERIC_AMBIENCE2              171
define GENERIC_AMBIENCE3              172
define GENERIC_AMBIENCE4              173
define GENERIC_AMBIENCE5              174
define GENERIC_AMBIENCE6              175
define BOS3_ATTACK2                   176
define GENERIC_AMBIENCE17             177
define GENERIC_AMBIENCE18             178
define GENERIC_AMBIENCE19             179
define GENERIC_AMBIENCE20             180
define GENERIC_AMBIENCE21             181
define GENERIC_AMBIENCE22             182
define SECRETLEVELSND                 183
define GENERIC_AMBIENCE8              184
define GENERIC_AMBIENCE9              185
define GENERIC_AMBIENCE10             186
define GENERIC_AMBIENCE11             187
define GENERIC_AMBIENCE12             188
define GENERIC_AMBIENCE13             189
define GENERIC_AMBIENCE14             190
define GENERIC_AMBIENCE15             192
define GENERIC_AMBIENCE16             193
define FIRE_CRACKLE                   194
define BONUS_SPEECH1                  195
define BONUS_SPEECH2                  196
define BONUS_SPEECH3                  197
define PIG_CAPTURE_DUKE               198
define BONUS_SPEECH4                  199
define DUKE_LAND_HURT                 200
define DUKE_HIT_STRIPPER1             201
define DUKE_TIP1                      202
define DUKE_KILLED2                   203
define PRED_ROAM2                     204
define PIG_ROAM2                      205
define DUKE_GETWEAPON1                206
define DUKE_SEARCH2                   207
define DUKE_CRACK2                    208
define DUKE_SEARCH                    209
define DUKE_GET                       210
define DUKE_LONGTERM_PAIN             211
define MONITOR_ACTIVE                 212
define NITEVISION_ONOFF               213
define DUKE_HIT_STRIPPER2             214
define DUKE_CRACK_FIRST               215
define DUKE_USEMEDKIT                 216
define DUKE_TAKEPILLS                 217
define DUKE_PISSRELIEF                218
define SELECT_WEAPON                  219
define WATER_GURGLE                   220
define DUKE_GETWEAPON4                221
define JIBBED_ACTOR1                  222
define JIBBED_ACTOR2                  223
define JIBBED_ACTOR3                  224
define JIBBED_ACTOR4                  225
define JIBBED_ACTOR5                  226
define JIBBED_ACTOR6                  227
define JIBBED_ACTOR7                  228
define DUKE_GOTHEALTHATLOW            229
define BOSSTALKTODUKE                 230
define WAR_AMBIENCE1                  231
define WAR_AMBIENCE2                  232
define WAR_AMBIENCE3                  233
define WAR_AMBIENCE4                  234
define WAR_AMBIENCE5                  235
define WAR_AMBIENCE6                  236
define WAR_AMBIENCE7                  237
define WAR_AMBIENCE8                  238
define WAR_AMBIENCE9                  239
define WAR_AMBIENCE10                 240
define ALIEN_TALK1                    241
define ALIEN_TALK2                    242
define EXITMENUSOUND                  243
define FLY_BY                         244
define DUKE_SCREAM                    245
define SHRINKER_HIT                   246
define RATTY                          247
define INTO_MENU                      248
define BONUSMUSIC                     249
define DUKE_BOOBY                     250
define DUKE_TALKTOBOSSFALL            251
define DUKE_LOOKINTOMIRROR            252
define PIG_ROAM3                      253
define KILLME                         254
define DRON_JETSND                    255
define SPACE_DOOR1                    256
define SPACE_DOOR2                    257
define SPACE_DOOR3                    258
define SPACE_DOOR4                    259
define SPACE_DOOR5                    260
define ALIEN_ELEVATOR1                261
define VAULT_DOOR                     262
define JIBBED_ACTOR13                 263
define DUKE_GETWEAPON6                264
define JIBBED_ACTOR8                  265
define JIBBED_ACTOR9                  266
define JIBBED_ACTOR10                 267
define JIBBED_ACTOR11                 268
define JIBBED_ACTOR12                 269
define DUKE_KILLED4                   270
define DUKE_KILLED5                   271
define ALIEN_SWITCH1                  272
define DUKE_STEPONFECES               273
define DUKE_LONGTERM_PAIN2            274
define DUKE_LONGTERM_PAIN3            275
define DUKE_LONGTERM_PAIN4            276
define COMPANB2                       277
define KTIT                           278
define HELICOP_IDLE                   279
define STEPNIT                        280
define SPACE_AMBIENCE1                281
define SPACE_AMBIENCE2                282
define SLIM_HATCH                     283
define RIPHEADNECK                    284
define FOUNDJONES                     285
define ALIEN_DOOR1                    286
define ALIEN_DOOR2                    287
define ENDSEQVOL3SND4                 288
define ENDSEQVOL3SND5                 289
define ENDSEQVOL3SND6                 290
define ENDSEQVOL3SND7                 291
define ENDSEQVOL3SND8                 292
define ENDSEQVOL3SND9                 293
define WHIPYOURASS                    294
define ENDSEQVOL2SND1                 295
define ENDSEQVOL2SND2                 296
define ENDSEQVOL2SND3                 297
define ENDSEQVOL2SND4                 298
define ENDSEQVOL2SND5                 299
define ENDSEQVOL2SND6                 300
define ENDSEQVOL2SND7                 301
define GENERIC_AMBIENCE23             302
define SOMETHINGFROZE                 303
define DUKE_LONGTERM_PAIN5            304
define DUKE_LONGTERM_PAIN6            305
define DUKE_LONGTERM_PAIN7            306
define DUKE_LONGTERM_PAIN8            307
define WIND_REPEAT                    308


USER.CON (v1.3)

/*

--------------------------------------------------------------------------------
Duke Nukem 3D USER.CON file.
By Todd Replogle
(c) 1996 3D Realms Entertainment
--------------------------------------------------------------------------------

IMPORTANT NOTICE IF YOU USE MODIFIED .CON FILES

If you are playing a MULTIPLAY game (Dukematch or Co-op) and you are
using *modified* .CON files (USER.CON, GAME.CON, DEFS.CON), then each
multiplayer must be using the EXACT SAME .CON files, or the game will
get out of sync and/or develop interesting problems.

3D Realms encourages you to experiment freely with the parameters
contained in this file, and to share your discoveries with the rest
of the world.  However, BE ADVISED that 3D Realms does NOT offer 
any technical support on how to use this file or other user-modifiable 
features of this game.  Do NOT call 3D Realms or Apogee Software 
for advice or help with this subject.  

You make modifications to this and other files at your own risk. 
It is recommended that you first make a backup copy of this, or
any .CON files before making any changes.

--------------------------------------------------------------------------------
*/

// ******************
// MISC GAME SETTINGS
// ******************

define CAMERASDESTRUCTABLE      NO               // YES
define FREEZERHURTOWNER         YES

define MAXPLAYERHEALTH          100
define MAXWATERFOUNTAINHEALTH    50

define YELLHURTSOUNDSTRENGTH     40
define YELLHURTSOUNDSTRENGTHMP   50

define MAXPLAYERATOMICHEALTH    200     // doubles as maxarmor.
define DOUBLEMAXPLAYERHEALTH    MAXPLAYERATOMICHEALTH
define STARTARMORHEALTH         0
define RETRIEVEDISTANCE         844
define SQUISHABLEDISTANCE      1024 // For actors only!
define DEFAULTVISIBILITY        512
define FROZENQUICKKICKDIST      980

define GENERICIMPACTDAMAGE      10
define SWEARFREQUENCY           42

define MAXPISTOLAMMO           200
define MAXSHOTGUNAMMO           50
define MAXCHAINGUNAMMO         200
define MAXRPGAMMO               50
define MAXHANDBOMBAMMO          50
define MAXSHRINKERAMMO          50
define MAXDEVISTATORAMMO        99
define MAXFREEZEAMMO            99
define MAXTRIPBOMBAMMO          10

define RESPAWNACTORTIME         768
define RESPAWNITEMTIME          768

// The BLIMP has a high respawn time (any value smaller runs the risk
// of spawning too many sprites, resulting in "Bog City")
define BLIMPRESPAWNTIME 2048

define NUMFREEZEBOUNCES          3  // 0 - 255


define RUNNINGSPEED 53200

define PLAYDEADTIME 120

define SHRUNKCOUNT 270
define SHRUNKDONECOUNT 304

define FROZENDRIPTIME 90
define THAWTIME 138


// Various blast radius distances

define RPGBLASTRADIUS           1780
define PIPEBOMBRADIUS           2500
define SHRINKERBLASTRADIUS      650
define TRIPBOMBBLASTRADIUS      3880
define MORTERBLASTRADIUS        2500
define BOUNCEMINEBLASTRADIUS    2500
define SEENINEBLASTRADIUS       2048

gamestartup     DEFAULTVISIBILITY GENERICIMPACTDAMAGE MAXPLAYERHEALTH
                STARTARMORHEALTH  RESPAWNACTORTIME RESPAWNITEMTIME RUNNINGSPEED
                RPGBLASTRADIUS PIPEBOMBRADIUS SHRINKERBLASTRADIUS TRIPBOMBBLASTRADIUS
                MORTERBLASTRADIUS BOUNCEMINEBLASTRADIUS SEENINEBLASTRADIUS
                MAXPISTOLAMMO MAXSHOTGUNAMMO MAXCHAINGUNAMMO
                MAXRPGAMMO MAXHANDBOMBAMMO MAXSHRINKERAMMO
                MAXDEVISTATORAMMO MAXTRIPBOMBAMMO MAXFREEZEAMMO
                CAMERASDESTRUCTABLE NUMFREEZEBOUNCES FREEZERHURTOWNER


// Weapon Strengths
define KNEE_WEAPON_STRENGTH             10
define PISTOL_WEAPON_STRENGTH            6  // Adds rand()%5 (0 to 5)
define HANDBOMB_WEAPON_STRENGTH        140



// For direct hits with the rocket launcher,
// this amount is actually doubled.  Otherwise,
// damage values depend on distance. The
// further, the weaker.

define RPG_WEAPON_STRENGTH              140


define SHRINKER_WEAPON_STRENGTH          0
define SHOTGUN_WEAPON_STRENGTH          10
define CHAINGUN_WEAPON_STRENGTH          9
define FREEZETHROWER_WEAPON_STRENGTH    16
define COOL_EXPLOSION_STRENGTH          38
define TRIPBOMB_STRENGTH               100
define FIRELASER_WEAPON_STRENGTH         7
define MORTER_WEAPON_STRENGTH           50
define BOUNCEMINE_WEAPON_STRENGTH      150
define SPIT_WEAPON_STRENGTH              8
define BULLET_WEAPON_STRENGTH           30

// Enemy strengths (hit points).

define TROOPSTRENGTH            30
define PIGCOPSTRENGTH          100
define PIG_SHIELD_AMOUNT1       75
define PIG_SHIELD_AMOUNT2       50
define LIZSTRENGTH             100
define LIZGETTINGDAZEDAT        15
define LIZEATINGPLAYER          -2
define OCTASTRENGTH           175
define OCTASCRATCHINGPLAYER   -11
define RECONSTRENGTH            50
define TURRETSTRENGTH           30
define ROTTURRETSTRENGTH        40
define DRONESTRENGTH           150
define CAPTAINSTRENGTH          50
define CAPTSPINNINGPLAYER      -11
define COMMANDERSTRENGTH        350
define SHARKSTRENGTH            35
define SHARKBITESTRENGTH        -9

define PISTOLAMMOAMOUNT         12
define SHOTGUNAMMOAMOUNT        10
define CHAINGUNAMMOAMOUNT       50
define RPGAMMOBOX               5
define CRYSTALAMMOAMOUNT        5
define DEVISTATORAMMOAMOUNT     15
define FREEZEAMMOAMOUNT         25
define HANDBOMBBOX              5


define BOSS1STRENGTH            4500
define BOSS1PALSTRENGTH         1000
define BOSS2STRENGTH            4500
define BOSS3STRENGTH            4500


// Miscellaneous strengths.

define WEAKEST           1
define WEAK              5
define MEDIUMSTRENGTH    10
define TOUGH             20
define REALLYTOUGH       30
define HBOMBTOUGH       100
define GOTTASMART        90
define BOMBTOUGH        100


// Players' inventory amounts.

define STEROID_AMOUNT           400
define SHIELD_AMOUNT            100
define SCUBA_AMOUNT            6400
define HOLODUKE_AMOUNT         2400
define JETPACK_AMOUNT          1600
define HEAT_AMOUNT             1200
define FIRSTAID_AMOUNT          MAXPLAYERHEALTH
define BOOT_AMOUNT              200

define SPAWNAMMOODDS             96


// Maximum quote size is 64 characters.

definequote  0        AUTO AIMING
definequote  1        SHOW MAP: OFF
definequote  2        ACTIVATED
definequote  3        PORTABLE MEDKIT
definequote  4        LOCKED
definequote  5        GIVING EVERYTHING!
definequote  6        BOOTS
definequote  7        WASTED!
definequote  8        UNLOCKED
definequote  9        A SECRET PLACE!
definequote 10        SQUISH!
definequote 11        ALL DOORS UNLOCKED
definequote 12        USED STEROIDS
definequote 13        PRESS SPACE TO RESTART LEVEL
definequote 14        AMMO FOR DEVASTATOR
definequote 15        DEACTIVATED
definequote 16        SWITCH OPERATED ONLY!
definequote 17        GOD MODE: ON
definequote 18        GOD MODE: OFF
definequote 19        ATOMIC HEALTH!
definequote 20        CROSSHAIR: ON
definequote 21        CROSSHAIR: OFF
definequote 22        YOU'RE TOO GOOD TO BE CHEATING!
definequote 23        MESSAGES: ON
definequote 24        MESSAGES: OFF
definequote 25        TYPE THE CHEAT CODE:
definequote 26        DETAIL: LOW
definequote 27        DETAIL: HIGH
definequote 28        < EMPTY >
definequote 29        BRIGHTNESS LEVEL: ONE
definequote 30        BRIGHTNESS LEVEL: TWO
definequote 31        BRIGHTNESS LEVEL: THREE
definequote 32        BRIGHTNESS LEVEL: FOUR
definequote 33        BRIGHTNESS LEVEL: FIVE
definequote 34        SOUND: ON
definequote 35        SOUND: OFF
definequote 36        SCREEN CAPTURED
definequote 37        STEROIDS
definequote 38        ARMOR
definequote 39        SCUBA GEAR
definequote 40        Press F1 for Help
definequote 41        JETPACK
definequote 42        BODY SUIT
definequote 43        ACCESS CARD
definequote 44        MOUSE AIMING OFF
definequote 45        MOUSE AIMING ON
definequote 46        CHEAT CODE:  UNRECOGNIZED
definequote 47        HOLODUKE ON
definequote 48        HOLODUKE OFF
definequote 49        HOLODUKE NOT FOUND YET!
definequote 50        JETPACK NOT FOUND YET!
definequote 51        HOLODUKE
definequote 52        JETPACK ON
definequote 53        JETPACK OFF
definequote 54        CHAINGUN CANNON!
definequote 55        PIPEBOMB!
definequote 56        RPG!
definequote 57        SHOTGUN
definequote 58        LASER TRIPBOMB!
definequote 59        FREEZETHROWER!
definequote 60        SHRINKER!
definequote 61        SMALL MEDKIT: +10
definequote 62        LARGE MEDKIT: +30
definequote 63        AMMO FOR CHAINGUN CANNON!
definequote 64        AMMO FOR RPG!
definequote 65        AMMO FOR PISTOL!
definequote 66        AMMO FOR FREEZETHROWER!
definequote 67        BOOTS OFF
definequote 68        BOOTS ON
definequote 69        AMMO FOR SHOTGUN
definequote 70        BLUE ACCESS CARD REQUIRED
definequote 71        RED ACCESS CARD REQUIRED
definequote 72        YELLOW ACCESS CARD REQUIRED
definequote 73        WEAPON LOWERED
definequote 74        WEAPON RAISED
definequote 75        PROTECTIVE BOOTS ON
definequote 76        SCUBA GEAR ON
definequote 77        SPACE SUIT ON
definequote 78        AMMO FOR SHRINKER
definequote 79        BUY MAJOR STRYKER
definequote 80        MIGHTY FOOT ENGAGED
definequote 81        WEAPON MODE ON
definequote 82        WEAPON MODE OFF
definequote 83        FOLLOW MODE OFF
definequote 84        FOLLOW MODE ON
definequote 85        RUN MODE OFF
definequote 86        RUN MODE ON
definequote 87        DEVASTATOR WEAPON
definequote 88        JET PACK
definequote 89        AIRTANK
definequote 90        STEROIDS
definequote 91        HOLODUKE
definequote 92        MUSIC: ON
definequote 93        MUSIC: OFF
definequote 94        SCROLL MODE: ON
definequote 95        SCROLL MODE: OFF
definequote 96        BRIGHTNESS LEVEL: SIX
definequote 97        BRIGHTNESS LEVEL: SEVEN
definequote 98        BRIGHTNESS LEVEL: EIGHT
definequote 99        REGISTER COSMO TODAY!
definequote 100       ALL LOCKS TOGGLED
definequote 101       NIGHT VISION GOGGLES
definequote 102       WE'RE GONNA FRY YOUR ASS, NUKEM!
definequote 103       SCREEN SAVED
definequote 104       GOT USED ARMOR
definequote 105       PIRATES SUCK!
definequote 106       NIGHT VISION ON
definequote 107       NIGHT VISION OFF
definequote 108       YOU'RE BURNING!  
definequote 109       VIEW MODE OFF
definequote 110       VIEW MODE ON
definequote 111       SHOW MAP: ON
definequote 112       CLIPPING: ON
definequote 113       CLIPPING: OFF
definequote 114       !!! INCORRECT VERSION !!!
definequote 115       <Please Leave Blank>
definequote 116       <Please Leave Blank>
definequote 117       <Please Leave Blank>
definequote 118       YOU CAN NOT "QUICK SAVE" WHEN DEAD
definequote 119       GOT ALL WEAPONS/AMMO
definequote 120       GOT ALL INVENTORY
definequote 121       GOT ALL KEYS



// Level file names cannot excede 13 characters.
// Level par cannot excede 5 characters (min:sec)
// Level titles cannot excede 32 characters.

definelevelname 0 0 E1L1.map 01:45 00:53 HOLLYWOOD HOLOCAUST
definelevelname 0 1 E1L2.map 05:10 03:21 RED LIGHT DISTRICT
definelevelname 0 2 E1L3.map 05:35 03:41 DEATH ROW
definelevelname 0 3 E1L4.map 07:20 04:40 TOXIC DUMP
definelevelname 0 4 E1L5.map 09:10 05:00 THE ABYSS
definelevelname 0 5 E1L6.map 05:15 02:58 LAUNCH FACILITY
definelevelname 0 6 E1L7.map 00:00 00:00 FACES OF DEATH
definelevelname 0 7 E1L8.map 00:00 00:00 USER MAP
definelevelname 0 8 E1L9.map 00:00 00:00 MULTIPLAYER 3
definelevelname 0 9 E1L10.map 00:00 00:00 MULTIPLAYER 4
definelevelname 0 10 E1L11.map 00:00 00:00 MULTIPLAYER 5

definelevelname 1 0 E2L1.map 02:30 01:19 SPACEPORT
definelevelname 1 1 E2L2.map 02:30 01:26 INCUBATOR
definelevelname 1 2 E2L3.map 05:00 02:26 WARP FACTOR
definelevelname 1 3 E2L4.map 04:30 02:14 FUSION STATION
definelevelname 1 4 E2L5.map 03:00 01:26 OCCUPIED TERRITORY
definelevelname 1 5 E2L6.map 02:30 01:04 TIBERIUS STATION
definelevelname 1 6 E2L7.map 04:45 02:15 LUNAR REACTOR
definelevelname 1 7 E2L8.map 11:30 04:59 DARK SIDE
definelevelname 1 8 E2L9.map 05:00 02:26 OVERLORD
definelevelname 1 9 E2L10.map 03:00 01:19 SPIN CYCLE
definelevelname 1 10 E2L11.map 03:00 00:52 LUNATIC FRINGE

definelevelname 2 0 E3L1.map 02:30 01:11 RAW MEAT
definelevelname 2 1 E3L2.map 04:45 02:18 BANK ROLL
definelevelname 2 2 E3L3.map 03:00 01:57 FLOOD ZONE
definelevelname 2 3 E3L4.map 03:15 01:46 L.A. RUMBLE
definelevelname 2 4 E3L5.map 02:30 01:04 MOVIE SET
definelevelname 2 5 E3L6.map 03:30 01:30 RABID TRANSIT
definelevelname 2 6 E3L7.map 02:00 00:55 FAHRENHEIT
definelevelname 2 7 E3L8.map 02:15 01:09 HOTEL HELL
definelevelname 2 8 E3L9.map 02:45 01:17 STADIUM
definelevelname 2 9 E3L10.map 00:45 00:10 TIER DROPS
definelevelname 2 10 E3L11.map 02:00 01:07 FREEWAY

// Music will not play if the .MID file excedes 72000 bytes.

// If you are an owner of a Gravis Ultrasound and wish to change the
// MIDI files, you may want to delete the ULTRAMID.INI file that we
// supply since it does not contain a full General MIDI patch set.
// Deleting the ULTRAMID.INI will cause the game to use the file found
// in your Ultrasound directory.  Remember to keep a backup of ours,
// or the music might not sound as good!

// Music for title and end
music 0 GRABBAG.MID ITSGREEN.MID

// Music for the individual levels
music 1 stalker.mid dethtoll.mid streets.mid watrwld1.mid snake1.mid
        thecall.mid ahgeez.mid dethtoll.mid streets.mid watrwld1.mid snake1.mid

music 2 futurmil.mid storm.mid gutwrnch.mid robocrep.mid stalag.mid 
       pizzed.mid alienz.mid xplasma.mid alfredh.mid gloomy.mid intents.mid

music 3 inhiding.mid FATCMDR.mid NAMES.MID subway.mid invader.mid gotham.mid
        233c.mid lordofla.mid urban.mid spook.mid whomp.mid

/*
--------------------------------------------------------------------------------
ABOUT CHANGING SOUND FX

þ Duke may have up to 348 different sounds, currently there
  are aprox. 254 slots used.

The sound fx section follows this explanation.  

1. The program expects to find any sound file that is in a
   .VOC or .WAV file format.
2. You can either change the VOC name listed below to match your new
   sound, or you can rename your file to match the name here.
3. New sound files should be added to the game directory.  Though
   all sound files shipped with the game are included inside the 
   .GRP file, the program will know if there are sound files outside
   the .GRP file, and will use them instead.
4. The numbers that are to the right of the sound file name are technical
   parameters which will not be explained here, except as follows...
   - The first 2 numbers define a random pitch variation range.  They
     can be positive or negative numbers.
   - The 3rd number is a priority flag.
   - The 4th number is a bit parsed set of technical variables that identify
     the type of sound it is in the game.
   - The 5th number is volume adjustment.

--------------------------------------------------------------------------------
*/

// *****************************************
//      ACTOR SOUNDS
// *****************************************

// Predator Trooper
definesound PRED_ROAM     roam06.voc          0   0   3  0   0
definesound PRED_ROAM2    roam58.voc          0   0   3  0   0
definesound PRED_RECOG    predrg.voc          0   0   3  0   0
definesound PRED_ATTACK   gblasr01.voc      256  256  3  0   7680
definesound PRED_PAIN     predpn.voc          200 500 3  0   0
definesound PRED_DYING    preddy.voc          0   400 3  0   0
definesound LIZARD_BEG    chokn12.voc         0   0   3  0   0
                                             
// Lizard Captain                                                                       
definesound CAPT_ROAM     predrm.voc          0  200  3   0   0
definesound CAPT_RECOG    predrg.voc        -400  0   3   0   0
definesound CAPT_ATTACK   chaingun.voc      0     0    3   0   -200
definesound CAPT_PAIN     predpn.voc        -200  100 3   0   0
definesound CAPT_DYING    preddy.voc        -200  100 3   0   0
definesound LIZARD_SPIT   lizspit.voc         0   0   0   0   0

// Pig Cop
definesound PIG_ROAM      roam29.voc           -200 400   3   0   0
definesound PIG_ROAM2     roam67.voc           -200 400   3   0   0
definesound PIG_ROAM3     pigrm.voc            -200 400   3   0   0
definesound PIG_RECOG     pigrg.voc           -200 400   3   0   0
definesound PIG_ATTACK    shotgun7.voc        -256  256  4   0   0
definesound PIG_PAIN      pigpn.voc            100 800   3   0   0
definesound PIG_DYING     pigdy.voc           -800 100   3   0   0
definesound PIG_CAPTURE_DUKE !pig.voc           0   0   255 8   0

// Recon car
definesound RECO_ROAM     jetpaki.voc            0   0   3   0   0
definesound RECO_RECOG    pigrg.voc              0   0   3   0   0
definesound RECO_ATTACK   gblasr01.voc         256  256  3  0   7680
definesound RECO_PAIN     pigpn.voc              0   0   3   0   0
definesound RECO_DYING    pigdy.voc              0   0   3   0   0

// Drone drone
definesound DRON_ROAM     snakrm.voc             0   0   3   0   0
definesound DRON_RECOG    snakrg.voc             0   0   3   0   0
definesound DRON_ATTACK1  snakatA.voc            0   0   3   0   0
definesound DRON_ATTACK2  snakatB.voc            0   0   3   0   0
definesound DRON_PAIN     snakpn.voc             0   0   3   0   0
definesound DRON_DYING    snakdy.voc             0   0   3   0   0
definesound DRON_JETSND   ENGHUM.VOC             1300 1300 0   0   0


// Fat Commander
definesound COMM_ROAM     commrm.voc             0   0   3   0   0
definesound COMM_RECOG    commrg.voc             0   0   3   0   0
definesound COMM_ATTACK   commat.voc             0   0   3   0   0
definesound COMM_PAIN     commpn.voc             0   0   3   0   0
definesound COMM_DYING    commdy.voc             0   0   3   0   0
definesound COMM_SPIN     commsp.voc             0   0   3   0   0

// Octabrain
definesound OCTA_ROAM     octarm.voc          -200   0    3   0   0
definesound OCTA_RECOG    octarg.voc             0   0    3   0   0
definesound OCTA_ATTACK1  octaat1.voc            0   0    3   0   0
definesound OCTA_ATTACK2  octaat2.voc            0   600  3   0   0
definesound OCTA_PAIN     octapn.voc          -400   0    3   0   0
definesound OCTA_DYING    octady.voc          -400   -100 3   0   0
definesound WIERDSHOT_FLY octaat1.voc            0   0    3   0   0

// Organic turret
definesound TURR_ROAM     turrrm.voc             0   0   3   0   0
definesound TURR_RECOG    turrrg.voc             0   0   3   0   0
definesound TURR_ATTACK   turrat.voc             0   0   3   0   0
definesound TURR_PAIN     turrpn.voc             0   0   3   0   0
definesound TURR_DYING    turrdy.voc             0   0   3   0   0

// Green slimer
definesound SLIM_HATCH    slhtch01.voc             0   0   3   0   0
definesound SLIM_ROAM     sliroa02.voc             0   0   3   0   0
definesound SLIM_RECOG    slirec06.voc             0   0   3   0   0
definesound SLIM_ATTACK   slimat.voc             0   0   3   0   0
// definesound SLIM_PAIN     slimpn.voc             0   0   3   0   0
definesound SLIM_DYING    slidie03.voc             0   0   3   0   0

// BOSS2
definesound BOS2_ROAM     b2atk01.voc             0   0   3   0   0
definesound BOS2_RECOG    b2rec03.voc             0   0   3   0   0
definesound BOS2_ATTACK   b2atk02.voc             0   0   3   0   0
definesound BOS2_PAIN     b2pain03.voc             0   0   3   0   0
definesound BOS2_DYING    b2die03.voc             0   0   3   0   0

// BOSS3                                                                                
definesound BOS3_ROAM     b3roam01.voc             0   0   3   0   0
definesound BOS3_RECOG    b3pain04.voc             0   0   3   0   0
definesound BOS3_ATTACK1  b3atk01.voc             0   0   3   0   0
definesound BOS3_ATTACK2  b3atk01.voc             0   0   3   0   0
definesound BOS3_PAIN     b3rec03g.voc             0   0   3   0   0
definesound BOS3_DYING    b3die03g.voc             0   0   3   0   0


// BOSS1                                                                                
definesound BOS1_ROAM     bos1rm.voc             0   0   3   0   0
definesound BOS1_RECOG    bos1rg.voc             0   0   5   0   0
definesound BOS1_ATTACK1  chaingun.voc           0   0   3   0   0
definesound BOS1_ATTACK2  rpgfire.voc            0   0   3   0   0
definesound BOS1_PAIN     bos1pn.voc             0   0   3   0   0
definesound BOS1_DYING    bos1dy.voc             0   0   3   0   0
definesound BOS1_WALK     thud.voc               0   0   3   0   0


// *************
// WEAPON SOUNDS                                                                        
// *************
definesound KICK_HIT            kickhit.voc       0     0     4   0   0
definesound PISTOL_RICOCHET     ricochet.voc      0     0     0   0 4096
definesound PISTOL_BODYHIT      bulithit.voc      0     0     0   0   0
definesound PISTOL_FIRE         pistol.voc      -64     0   254   0   0
definesound EJECT_CLIP          clipout.voc       0     0     3   0   0
definesound INSERT_CLIP         clipin.voc        512   512   3   0   0
definesound CHAINGUN_FIRE       chaingun.voc     -204 -204  254   0   512
definesound SHOTGUN_FIRE        shotgun7.voc      0    512    254 0   0
definesound SHOTGUN_COCK        shotgnck.voc      96    192   3   0   0
definesound RPG_SHOOT           rpgfire.voc       -32   0     4   0   0
definesound FLY_BY              flyby.voc         -256  256   3   0   0
definesound RPG_EXPLODE         bombexpl.voc      -1024 1024  254 0   0
definesound CAT_FIRE            catfire.voc       512   768   4   0   0
definesound SHRINKER_FIRE       shrinker.voc      -512  0     4   0   0
definesound ACTOR_SHRINKING     shrink.voc        0     0     2   0   0
definesound PIPEBOMB_BOUNCE     pbombbnc.voc      0     0     2   0 6144
definesound PIPEBOMB_EXPLODE    bombexpl.voc  -512      0     128 0   0
definesound LASERTRIP_ONWALL    lsrbmbpt.voc      0     0     3   0   0
definesound LASERTRIP_ARMING    lsrbmbwn.voc      0     0     3   0   0
definesound LASERTRIP_EXPLODE   bombexpl.voc  -512      0     4   0   0
definesound NITEVISION_ONOFF    goggle12.voc      0     0     0   0   0
definesound SELECT_WEAPON       WPNSEL21.VOC      128   128   3   0   0

// Affect Environment Sounds                                                            
definesound VENT_BUST           ventbust.voc      -32   32 2  0  0
definesound GLASS_BREAKING      glass.voc         -412  0  3  0  8192
definesound GLASS_HEAVYBREAK    glashevy.voc      -412  0  3  0  8192
definesound SHORT_CIRCUIT       shorted.voc       0 0 0 0 6500
definesound ITEM_SPLASH         splash.voc        0 0 2 0 0
definesound BONUSMUSIC          bonus.voc         0 0 255 1 0

// Duke's Body Sounds                                                                   
definesound DUKE_BREATHING      hlminhal.voc       0   0   255 4   0
definesound DUKE_EXHALING       hlmexhal.voc       0   0   255 4   0
definesound DUKE_GASP           gasp.voc           0   0   255 4   0
definesound DUKE_URINATE        pissing.voc        0   0   4   0   0
definesound DUKE_CRACK2         COMEON02.voc       0   0   255 4   0
definesound DUKE_CRACK          WAITIN03.voc       0   0   255 4   0
definesound DUKE_TALKTOBOSSFALL DIESOB03.voc       0   0   255 12  0
definesound DUKE_CRACK_FIRST    knuckle.voc        0   0   3   0   0
definesound DUKE_GET            getitm19.voc     -64  64   255 0   0
definesound DUKE_GETWEAPON1     cool01.voc         0   0   255 4   0
definesound DUKE_GETWEAPON2     getsom1a.voc       0   0   255 4   0
definesound DUKE_GETWEAPON3     groovy02.voc       0   0   255 4   0
definesound DUKE_GETWEAPON4     wansom4a.voc       0   0   255 4   0
definesound JIBBED_ACTOR13      LETGOD01.VOC       0   0   255 4   0
definesound DUKE_GETWEAPON6     HAIL01.VOC         0   0   255 4   0
definesound DUKE_GOTHEALTHATLOW needed03.voc       0   0   255 4   0

definesound DUKE_SEARCH         pain87.VOC       0   0   2   4     0
definesound DUKE_SEARCH2        whrsit05.voc       0   0   255 4   0
definesound DUKE_LONGTERM_PAIN  gasps07.voc     -192   0   255 4   0
definesound DUKE_LONGTERM_PAIN2 dscrem15.voc      0   0   255 4   0
definesound DUKE_LONGTERM_PAIN3 dscrem16.voc      0   0   255 4   0
definesound DUKE_LONGTERM_PAIN4 dscrem17.voc      0   0   255 4   0
definesound DUKE_LONGTERM_PAIN5 pain54.voc        0   0   255 4   0
definesound DUKE_LONGTERM_PAIN6 pain75.voc        0   0   255 4   0
definesound DUKE_LONGTERM_PAIN7 pain93.voc        0   0   255 4   0
definesound DUKE_LONGTERM_PAIN8 pain68.voc        0   0   255 4   0

definesound DUKE_PISSRELIEF     ahmuch03.voc       0   0   255 4   0

// Duke Health Sounds
definesound SOMETHINGHITFORCE   teleport.voc       0   0    2   0   8192
definesound DUKE_DRINKING       drink18.voc     -128 128   2   4   0
definesound DUKE_KILLED1        damn03.voc         0   0   255 12  0
definesound DUKE_KILLED2        damnit04.voc       0   0   255 12  0
definesound DUKE_KILLED3        thsuk13a.voc       0   0   255 12  0
definesound DUKE_KILLED4        dscrem18.voc       0   0   255 4   0
definesound DUKE_KILLED5        pisses01.voc       0   0   255 12  0
definesound DUKE_GRUNT          exert.voc          0   0   2   4   0
definesound DUKE_DEAD           DMDEATH.VOC      -64  64   255 4  0
definesound DUKE_HARTBEAT       hartbeat.voc       0   0   0   0   0
definesound DUKE_STEPONFECES    happen01.voc       0   0   0   12  0

// Duke Movement Sounds                                                                 
definesound DUKE_ONWATER        wetfeet.voc        0   0    4   0   0
definesound DUKE_LAND           land02.voc         0   0    2   0   0
definesound DUKE_LAND_HURT      pain39.voc         0   0    255 4   0
definesound DUKE_WALKINDUCTS    ductwlk.voc      -64   128  2   0   0
definesound DUKE_LOOKINTOMIRROR   lookin01.voc       0   0    255 12  0

definesound DUKE_TIP1           dance01.voc        0   0   255  4   0
definesound DUKE_TIP2           shake2a.voc        0   0   255  4   0
definesound DUKE_BOOBY          BOOBY04.voc        0   0   255  4   0
definesound DUKE_HIT_STRIPPER1  damnit04.voc       0   0   255  12  0
definesound DUKE_HIT_STRIPPER2  damn03.voc         0   0   255  12  0
definesound ALIEN_TALK1         MUSTDIE.voc        0   0   255  12  0
definesound ALIEN_TALK2         DEFEATED.VOC       0   0   255  12  0
definesound BONUS_SPEECH1       letsrk03.voc       0   0   255  4   0
definesound BONUS_SPEECH2       ready2a.voc        0   0   255  4   0
definesound BONUS_SPEECH3       ripem08.voc        0   0   255  4   0
definesound BONUS_SPEECH4       rockin02.voc       0   0   255  4   0
definesound DUKE_YES            yes.voc            0   0   255  4   0
definesound DUKE_USEMEDKIT      ahh04.voc          0   0   255  4   0
definesound DUKE_TAKEPILLS      gulp01.voc         0   0   255  4   0
definesound DUKETALKTOBOSS      duknuk14.voc       0   0   255  12  0
definesound BOSSTALKTODUKE      !boss.voc          0   0   255  0   0
definesound SHRINKER_HIT        thud.voc           0   0   3    0   0
definesound SOMETHINGFROZE      freeze.voc         0   0   3    0   0

// Duke Equipment Sounds
definesound DUKE_UNDERWATER     scuba.voc          0   0   2   0   0
definesound DUKE_JETPACK_ON     jetpakon.voc       0   0   4   0   0
definesound DUKE_JETPACK_IDLE   jetpaki.voc        0   0   1   0   0
definesound DUKE_JETPACK_OFF    jetpakof.voc       0   0   2   0   0

// Common Death Sounds
definesound FLESH_BURNING       fire09.voc      -256   0   0   0   6100
definesound THUD                thud.voc           0   0   0   0   0
definesound SQUISHED            squish.voc         0   0   3   0   0

// Equipment Sounds                                                                     
definesound TELEPORTER          teleport.voc       0   0   0   0   0
definesound ELEVATOR_ON         gbelev01.voc       0   0   0   0   0
definesound ELEVATOR_OFF        gbelev02.voc       0   0   0   0   0
definesound ALIEN_ELEVATOR1     hydro43.voc        0   0   0   0   0
definesound SUBWAY              subway.voc         0   0   0   0   0
definesound SWITCH_ON           switch.voc         0   0   0   0   0

definesound FAN                 fan.voc            0   0   0   0   0
definesound FLUSH_TOILET        flush.voc          0   0   3   2   0
definesound HOVER_CRAFT         hover.voc          0   0   0   0   0
definesound EARTHQUAKE          quake.voc          0   0   0   0   0
                                                                                        
// Warning Sounds                                                                       
definesound INTRUDER_ALERT      alert.voc          0   0   0   0   0
definesound END_OF_LEVEL_WARN   monitor.voc        0   0   0   0   0
definesound POOLBALLHIT         poolbal1.voc       0   0   0   0   0

// Ambience Sounds

definesound ENGINE_OPERATING    onboard.voc        0   0   0   2   0
definesound REACTOR_ON          reactor.voc        0   0   0   2   0
definesound COMPUTER_AMBIENCE   compamb.voc        0   0   0   2   0
definesound GEARS_GRINDING      geargrnd.voc       0   0   0   2   0
definesound BUBBLE_AMBIENCE     bubblamb.voc    -256   0   0   2   0
definesound MACHINE_AMBIENCE    machamb.voc        0   0   0   2   0
definesound SEWER_AMBIENCE      drip3.voc          0   0   0   0   0
definesound WIND_AMBIENCE       wind54.voc         0   0   0   2   0
definesound WIND_REPEAT         wind54.voc         0   0   0   3   0

definesound SOMETHING_DRIPPING  drip3.voc       0   0   0   0    9000
definesound STEAM_HISSING       steamhis.voc       0   0   0   1   8192
definesound BAR_MUSIC           barmusic.voc       0   0 254   3   0
definesound DUKE_SCREAM         DSCREM04.voc       0   0 255   0   0
definesound KILLME              killme.voc      -128   0   0   0   0

// Miscellaneous Sounds

definesound GETATOMICHEALTH     teleport.voc   2048 2048   255 0   0
definesound DOOR_OPERATE1       slidoor.voc     -256   0   0   0   0
definesound DOOR_OPERATE2       opendoor.voc    -256   0   0   0   0
definesound DOOR_OPERATE3       edoor10.voc     -256   0   0   0   0
definesound DOOR_OPERATE4       edoor11.voc     -256   0   0   0   0
definesound BORNTOBEWILDSND     2bwild.voc         0   0 254   2   0
definesound KTIT                ktitx.voc         0   0 254   2   0
definesound LADY_SCREAM         FSCRM10.voc     -256   0 254   8   0
definesound MONITOR_ACTIVE      monitor.voc        0   0   0   0   0
definesound WATER_GURGLE        h2ogrgl2.voc       0   0   1   2   9000
definesound EXITMENUSOUND       item15.voc         0   0   0   0   0
definesound RATTY               mice3.voc          0   0   0   0   0
definesound INTO_MENU           bulithit.voc    1024 1024  0   0   0

// Six misc ambience city sounds

definesound GENERIC_AMBIENCE1      grind.voc       0   0   0   1   0
definesound GENERIC_AMBIENCE2      enghum.voc      0   0   0   2   0
definesound GENERIC_AMBIENCE3      lava06.voc      0   0   0   2   0
definesound GENERIC_AMBIENCE4      bubblamb.voc -256   0   0   2   0
definesound GENERIC_AMBIENCE5      phonbusy.voc    0   0   0   0   0
definesound GENERIC_AMBIENCE6      roam22.voc      0   0   0   2   0
definesound SECRETLEVELSND         secret.voc      0   0   255 0   0
definesound GENERIC_AMBIENCE8      amb81b.voc      0   0   0   2   0
definesound GENERIC_AMBIENCE9      roam98b.voc     0   0   0   2   0
definesound GENERIC_AMBIENCE10     h2orush2.voc    0   0   0   3   0
definesound GENERIC_AMBIENCE11     projrun.voc     0   0   0   3   0
definesound GENERIC_AMBIENCE12     blank.voc       0   0   0   0   0
definesound GENERIC_AMBIENCE13     pay02.voc       0   0   255 12  0
definesound GENERIC_AMBIENCE14     onlyon03.voc    0   0   255 4   0
definesound GENERIC_AMBIENCE15     rides09.voc     0   0   255 4   0
definesound GENERIC_AMBIENCE16     doomed16.voc    0   0   255 4   0
definesound GENERIC_AMBIENCE17     myself3a.voc    0   0   255 4   0
definesound GENERIC_AMBIENCE18     monolith.voc    0   0   0   2   0
definesound GENERIC_AMBIENCE19     hydro50.voc     0   0   0   2   0
definesound GENERIC_AMBIENCE20     con03.voc       0   0   0   4   0
definesound GENERIC_AMBIENCE21     !prison.voc     0   0   255 4   0
definesound GENERIC_AMBIENCE22     vpiss2.voc      0   0   255 4   0
definesound GENERIC_AMBIENCE23     2ride06.voc     0   0   255 4   0

definesound FIRE_CRACKLE           fire09.voc       0   0   254 2   0
definesound DUMPSTER_MOVE          grind.voc       0   0   0   0   0

definesound JIBBED_ACTOR1       AMESS06.voc       0   0   255 4   0
definesound JIBBED_ACTOR2       BITCHN04.voc      0   0   255 12  0
definesound JIBBED_ACTOR3       HOLYCW01.voc      0   0   255 4   0
definesound JIBBED_ACTOR4       HOLYSH02.voc      0   0   255 12  0
definesound JIBBED_ACTOR5       IMGOOD12.voc      0   0   255 12  0
definesound JIBBED_ACTOR6       PIECE02.voc       0   0   255 4   0
definesound JIBBED_ACTOR7       GOTHRT01.voc      0   0   255 4   0
definesound JIBBED_ACTOR8       BLOWIT01.VOC      0   0   255 12  0
definesound JIBBED_ACTOR9       EATSHT01.VOC      0   0   255 12  0
definesound JIBBED_ACTOR10      FACE01.VOC        0   0   255 12  0
definesound JIBBED_ACTOR11      INHELL01.VOC      0   0   255 12  0
definesound WHIPYOURASS         WHIPYU01.VOC      0   0   255 4   0
definesound JIBBED_ACTOR12      SUKIT01.VOC       0   0   255 4   0

definesound WAR_AMBIENCE1    WARAMB13.VOC -512  0   255  16  0
definesound WAR_AMBIENCE2    WARAMB21.VOC -512  0   254  16  0
definesound WAR_AMBIENCE3    WARAMB23.VOC -512  0   254  16  0
definesound WAR_AMBIENCE4    WARAMB29.VOC -512  0   254  16  0
definesound WAR_AMBIENCE5    FORCE01.VOC    0   0   0    4   0
definesound WAR_AMBIENCE6    QUAKE06.VOC    0   0   0    4   0
definesound WAR_AMBIENCE7    TERMIN01.VOC   0   0   0    4   0
definesound WAR_AMBIENCE8    BORN01.VOC     0   0   254  20  0
definesound WAR_AMBIENCE9    NOBODY01.VOC   0   0   0    4   0
definesound WAR_AMBIENCE10   CHEW05.VOC     0   0   0    12  0

definesound SPACE_DOOR1      hydro22.voc      0   0   0    0   8192
definesound SPACE_DOOR2      hydro24.voc      0   0   0    0   0
definesound SPACE_DOOR3      hydro27.voc      0   0   0    0   8192
definesound SPACE_DOOR4      hydro34.voc      0   0   0    0   0
definesound SPACE_DOOR5      hydro40.voc      0   0   0    0   0

 definesound SPACE_AMBIENCE1   monolith.voc      0   0   0  16  0
 definesound SPACE_AMBIENCE2   hydro50.voc       0   0   0  16  0
 definesound VAULT_DOOR        vault04.voc      0   0   0   0   0

definesound ALIEN_ELEVATOR1   hydro43.voc       0   0   0  0   0
definesound ALIEN_DOOR1       adoor1.voc        0   0   0  0   0
definesound ALIEN_DOOR2       adoor2.voc        0   0   0  0   0

definesound ALIEN_SWITCH1     aswtch23.voc      0   0   0  0   0
definesound COMPANB2          CTRLRM25.VOC  0  0  0  2   0
definesound HELICOP_IDLE      hlidle03.voc  0  0  255  3   0
definesound FOUNDJONES        jones04.voc   0  0  0  4  0
definesound STEPNIT           LIZSHIT3.VOC  0  0  254  12  0
definesound RIPHEADNECK       rip01.voc     0  0  254  12 0

definesound ENDSEQVOL2SND1    gunhit2.voc     0   0   249 0   0
definesound ENDSEQVOL2SND2    headrip3.VOC    0   0   250 0   0
definesound ENDSEQVOL2SND3    buckle.VOC      0   0   251 0   0
definesound ENDSEQVOL2SND4    jetp2.VOC       0   0   252 0   0
definesound ENDSEQVOL2SND5    zipper2.voc     0   0   253 0   0
definesound ENDSEQVOL2SND6    news.voc        0   0   254 0   0
definesound ENDSEQVOL2SND7    whistle.voc     0   0   255 0   0

definesound ENDSEQVOL3SND1    KICKHEAD.VOC    0   0   254 0   0
definesound ENDSEQVOL3SND2    GMEOVR05.VOC    0   0   254 0    0
definesound ENDSEQVOL3SND3    CHEER.VOC       0   0   254 0   0
definesound ENDSEQVOL3SND4    GRABBAG.VOC     0   0   254 1   0
definesound ENDSEQVOL3SND5    name01.voc      0   0   250 0   0
definesound ENDSEQVOL3SND6    r&r01.voc       0   0   251 0   0
definesound ENDSEQVOL3SND7    lani05.voc      0   0   252 0   0
definesound ENDSEQVOL3SND8    lani08.voc      0   0   253 0   0
definesound ENDSEQVOL3SND9    laniduk2.voc    0   0   254 0   0


GAME.CON (v1.3)

/*
--------------------------------------------------------------------------------
Duke Nukem 3D GAME.CON file.
By Todd Replogle
(c) 1996 3D Realms Entertainment
--------------------------------------------------------------------------------


IMPORTANT NOTICE IF YOU USE MODIFIED .CON FILES

If you are playing a MULTIPLAY game (Dukematch or Co-op) and you are
using *modified* .CON files (USER.CON, GAME.CON, DEFS.CON), then each
multiplayer must be using the EXACT SAME .CON files, or the game will
get out of sync and/or develop interesting problems.

3D Realms encourages you to experiment freely with the parameters
contained in this file, and to share your discoveries with the rest
of the world.  However, BE ADVISED that 3D Realms does NOT offer 
any technical support on how to use this file or other user-modifiable 
features of this game.  Do NOT call 3D Realms or Apogee Software 
for advice or help with this subject.  

You make modifications to this and other files at your own risk. 
It is recommended that you first make a backup copy of this, or
any .CON files before making any changes.

--------------------------------------------------------------------------------

*/

include DEFS.CON
include USER.CON

state genericshrunkcode
    ifcount 32 { ifpdistl SQUISHABLEDISTANCE pstomp }
    else { sizeto 9 8 spawn FRAMEEFFECT1 }
ends

move SHUTTLEVELS 16

actor SPACESHUTTLE TOUGH
  //  ifmove 0 { move SHUTTLEVELS getv geth }
enda

actor SATELLITE TOUGH
  //  ifmove 0 { move SHUTTLEVELS getv geth }
  //  ifcount 120 move SHUTTLEVELS getv geth randomangle
enda

action ASHARKCRUZING 0 8 5 1 24
action ASHARKFLEE    0 8 5 1 10
action ASHARKATACK   0 8 5 1 6
action ASHARKSHRUNK  0 8 5 1 24
action ASHARKFROZEN  0 1 5 1 24

move SHARKVELS 24
move SHARKFASTVELS 72
move SHARKFLEEVELS 40

actor SHARK SHARKSTRENGTH ASHARKCRUZING SHARKVELS randomangle geth
    ifaction ASHARKSHRUNK
    {
        ifcount SHRUNKDONECOUNT action ASHARKCRUZING
        else ifcount SHRUNKCOUNT sizeto 24 24
        else state genericshrunkcode
    }
    else ifaction ASHARKFROZEN
    {
        fall

        ifcount THAWTIME { action ASHARKFLEE getlastpal }
        else ifcount FROZENDRIPTIME { ifactioncount 26 { spawn WATERDRIP resetactioncount } }

        ifhitweapon
        {
            ifwasweapon FREEZEBLAST { strength 0 break }
            lotsofglass 30
            sound GLASS_BREAKING
            killit
        }
        else ifp pfacing ifpdistl FROZENQUICKKICKDIST pkick
        break
    }
    else ifaction ASHARKFLEE
    {
        ifcount 16 ifrnd 48 { action ASHARKCRUZING move SHARKVELS randomangle geth }
    }
    else ifaction ASHARKCRUZING
    {
        ifcansee ifcount 48 ifrnd 2 { action ASHARKATACK move SHARKFASTVELS faceplayerslow getv break }
        ifcount 32 ifnotmoving
        {
            ifrnd 128 move SHARKVELS randomangle geth
            else move SHARKFASTVELS randomangle geth
        }
    }
    else ifaction ASHARKATACK
    {
        ifcount 4
        {
            ifpdistl 1280
            {
                ifp palive ifcanshoottarget
                {
                    sound DUKE_GRUNT
                    palfrom 32 32
                    addphealth SHARKBITESTRENGTH
                }
                action ASHARKFLEE
                move SHARKFLEEVELS fleeenemy
            }
        }
        else ifnotmoving
            { ifcount 32 { action ASHARKCRUZING move SHARKVELS randomangle geth } }
        else ifcount 48 ifrnd 2
            { action ASHARKCRUZING move SHARKFASTVELS randomangle geth }
    }

    ifhitweapon
    {
        ifdead
            { sound SQUISHED guts JIBS6 5 killit }
        else
        {
            ifwasweapon SHRINKSPARK
            {
                action ASHARKSHRUNK
                sound ACTOR_SHRINKING
            }
            else ifwasweapon FREEZEBLAST
            {
                action ASHARKFROZEN
                sound SOMETHINGFROZE
                move 0
            }
            else move SHARKVELS randomangle geth
        }
    }
enda


action BLIMPWAITTORESPAWN

state blimphitstate
    cstat 0
    spawn FIRSTGUNSPRITE
    spawn EXPLOSION2

    debris SCRAP1 40            // Weapons and ammo!
    debris SCRAP2 32
    debris SCRAP3 32
    debris SCRAP4 32
    debris SCRAP5 32

    sound PIPEBOMB_EXPLODE
    ifrespawn { action BLIMPRESPAWNTIME move 0 cstat 32768 }
    else killit
ends

actor BLIMP 1

    ifaction BLIMPWAITTORESPAWN
    {
        ifcount RESPAWNACTORTIME
        {
            action 0
            cstat 0
            move 0
        }
        break
    }

    ifhitweapon
    {
        ifwasweapon RADIUSEXPLOSION state blimphitstate
        ifwasweapon RPG state blimphitstate
        strength 1
    }
enda



state rats
    ifrnd 128 spawn RAT
    ifrnd 128 spawn RAT
    ifrnd 128 spawn RAT
    ifrnd 128 spawn RAT
    ifrnd 128 spawn RAT
    ifrnd 128 spawn RAT
    ifrnd 128 spawn RAT
    ifrnd 128 spawn RAT
ends

move RESPAWN_ACTOR_FLAG

action RUBCANDENT 1 1 1 1 1
action RUBCAN

actor RUBBERCAN WEAK
    ifaction RUBCANDENT { ifactioncount 16 { strength 0 action RUBCAN break } }
    else ifhitweapon
    {
        ifwasweapon RADIUSEXPLOSION { state rats ifrnd 48 spawn BURNING debris SCRAP3 12 killit }
        else action RUBCANDENT
    }
enda

state headhitstate
// Unrem the following line to involving screen tilting during
// low player hitpoint damage.


// wackplayer


ends


action EXPBARRELFRAME         0   2   1   1   15
actor EXPLODINGBARREL 26
    fall
    ifaction EXPBARRELFRAME
    {
        ifactioncount 2
        {
            hitradius 1024 WEAKEST WEAK MEDIUMSTRENGTH TOUGH
            spawn EXPLOSION2
            debris SCRAP2 2
            sound PIPEBOMB_EXPLODE
            killit
        }
        break
    }
    ifsquished
    {
        debris SCRAP1 5
        killit
        break
    }
    ifhitweapon
        action EXPBARRELFRAME
enda

action BURNING_FLAME    0   12   1   1   2
move BURNING_VELS 

state burningstate

    ifgapzl 16 break
    ifpdistg 10240 break

    ifcount 128
    {
        ifspawnedby TIRE
        {
            ifactioncount 512
            {
                sizeto 16 16
                killit
            }
            ifrnd 16 sizeto 64 48
        }
        else
        {
            sizeto 8 8 sizeto 8 8
            ifactioncount 192 killit
        }
    }
    else
    {
        ifmove 0 move BURNING_VELS

        ifspawnedby BOX
            { sizeto 32 32 ifcount 32 { spawn SMALLSMOKE killit } }
        else ifspawnedby TREE1 sizeto 96 96
        else ifspawnedby TREE2 sizeto 96 96
        else ifspawnedby APLAYER { sizeto 40 40 sizeto 40 40 }
        else sizeto 52 52
        ifp palive ifpdistl 844 ifrnd 32 ifcansee { soundonce DUKE_LONGTERM_PAIN addphealth -1 palfrom 24 16 }
    }

ends

actor BURNING WEAK BURNING_FLAME
    state burningstate
enda

actor BURNING2 WEAK BURNING_FLAME
    state burningstate
enda

action TOILETWATERFRAMES 0 4 1 1 1
actor TOILETWATER 0 TOILETWATERFRAMES
    ifpdistl 8192
    {
        soundonce WATER_GURGLE
        ifspawnedby TOILET sizeto 34 34
        else
        {
            ifspawnedby WATERFOUNTAINBROKE
                sizeto 6 15
            else ifspawnedby TOILETWATER { } else sizeto 24 32
        }

        ifp palive ifpdistl RETRIEVEDISTANCE ifp pfacing ifactioncount 32
            ifphealthl MAXPLAYERHEALTH ifhitspace ifcansee
        {
            addphealth 1
            globalsound DUKE_DRINKING
            resetactioncount
        }
    }
enda

action WOODENHORSEFRAME  0   1   4
action WOODENFALLFRAME  122  1   5

actor HORSEONSIDE WEAKEST cactor WOODENHORSE action WOODENFALLFRAME enda
actor WOODENHORSE WEAK WOODENHORSEFRAME
    fall
    ifhitweapon
    {
        ifdead
        {
            debris SCRAP1 4
            debris SCRAP2 3
            killit
        }
        else action WOODENFALLFRAME
    }
enda

state steamcode
    ifpdistl 8192 soundonce STEAM_HISSING

    ifcount 20
    {
        resetcount
        ifp palive ifpdistl 1024
        {
            addphealth -1
            palfrom 16 16
        }
    }
    else
    {
        ifspawnedby STEAM break ifspawnedby CEILINGSTEAM break
        sizeto 24 24
    }
ends

action STEAMFRAMES      0       5       1       1       1
actor STEAM 0 STEAMFRAMES
    state steamcode
enda

actor CEILINGSTEAM 0 STEAMFRAMES
    state steamcode
enda

actor WATERBUBBLEMAKER 0 0 randomangle
    ifpdistl 3084 ifrnd 24 spawn WATERBUBBLE
enda

action BUBBLE
action CRACKEDBUBBLE    1
move BUBMOVE           -10 -36
move BUBMOVEFAST           -10 -52

actor WATERBUBBLE 0 BUBBLE BUBMOVE getv geth randomangle

    ifaction CRACKEDBUBBLE
    {
        ifinwater ifrnd 192 killit
        ifactioncount 7 killit
    }
    else
    {
        ifcount 4
        {
            ifrnd 192 move BUBMOVE getv geth randomangle
            else move BUBMOVEFAST getv geth randomangle
            resetcount
        }

        ifonwater
        {
            iffloordistl 8 action CRACKEDBUBBLE
        }
        else ifactioncount 40 action CRACKEDBUBBLE
    }
enda


move SMOKEVEL 8 -16
move ENGINE_SMOKE 64 -64
move SMOKESHOOTOUT -192
action SMOKEFRAMES 0 4 1 1 10
actor SMALLSMOKE 0 SMOKEFRAMES
    ifmove 0
    {
        ifspawnedby RECON
            move SMOKESHOOTOUT geth
        else ifspawnedby SECTOREFFECTOR
            move ENGINE_SMOKE geth getv
        else move SMOKEVEL geth getv faceplayer
        ifspawnedby RPG
        cstat 2
    }
    ifpdistl 1596 ifspawnedby RPG killit
    ifactioncount 4 killit
enda

action BARREL_DENTING  2 2 1 1 6
action BARREL_DENTED   1
action BARREL_DENTED2  2

move SPAWNED_BLOOD

actor NUKEBARRELDENTED WEAK
    cactor NUKEBARREL
    action BARREL_DENTED
enda

actor NUKEBARRELLEAKED WEAK
    cactor NUKEBARREL
    action BARREL_DENTED2
enda

actor NUKEBARREL MEDIUMSTRENGTH
    ifsquished
    {
        debris SCRAP1 32
        spawn BLOODPOOL
        spawn OOZ
        killit
    }
    fall
    ifaction BARREL_DENTING
    {
        ifactioncount 2
        {
            debris SCRAP1 10
            ifrnd 2 spawn BLOODPOOL
            killit
        }
    }
    else ifhitweapon
    {
        ifdead
        {
            sound VENT_BUST

            ifrnd 128
                spawn BLOODPOOL
            action BARREL_DENTING
        }
        else
        {
            ifaction 0
                action BARREL_DENTED
            else ifaction BARREL_DENTED
            {
                action BARREL_DENTED2
                spawn BLOODPOOL
            }
            else ifaction BARREL_DENTED2
                action BARREL_DENTING
        }
    }
enda

state burningbarrelcode
    fall
    ifcount 32
    {
        resetcount
        ifp palive ifpdistl 1480 ifp phigher
        {
            addphealth -1
            palfrom 16 16
            ifrnd 96 sound DUKE_LONGTERM_PAIN
        }
    }
    ifhitweapon
    {
        sound VENT_BUST
        debris SCRAP1 10
        ifrnd 128 spawn BURNING
        else spawn BURNING2
        killit
    }
ends

actor FIREBARREL state burningbarrelcode enda
actor FIREVASE state burningbarrelcode enda

action SHRINKERFRAMES 0 4 1 1 10
actor SHRINKEREXPLOSION 0 SHRINKERFRAMES
    ifactioncount 4 killit
enda

action EXPLOSION_FRAMES 0 20 1 1  4
actor EXPLOSION2 1 EXPLOSION_FRAMES
    ifactioncount 20 killit
enda

actor EXPLOSION2BOT 1 EXPLOSION_FRAMES
    ifactioncount 20 killit
enda

action FFLAME_FR 0 16 1 1 1
action FFLAME 0 1 1 1 1

actor FLOORFLAME 0 FFLAME_FR
        ifaction FFLAME_FR
        {
                ifpdistl 1024 hitradius 1024 WEAKEST WEAKEST WEAKEST WEAKEST
                ifactioncount 16
                    action FFLAME
        }
        ifaction FFLAME ifrnd 4
        {
             action FFLAME_FR
             sound CAT_FIRE
             resetactioncount
        }

enda



action ASATNSPIN   0 5 1 1 4
action ASATSHOOTING -10 3 5 1 40
action ASATWAIT 0 1 5 1 1
move TURRVEL

actor ROTATEGUN ROTTURRETSTRENGTH
// ASATSHOOTING TURRVEL faceplayer

    ifaction 0
    {
        action ASATSHOOTING
        move TURRVEL faceplayer
    }
    else ifaction ASATNSPIN
        { ifactioncount 32 { action ASATWAIT move TURRVEL faceplayer } }
    else ifaction ASATSHOOTING
    {
        ifactioncount 12 { ifrnd 32 action ASATWAIT }
        ifcount 32 resetcount
        else ifcount 16 { ifcount 17 { } else { sound PRED_ATTACK shoot FIRELASER } }
        else ifcount 4 { ifcount 5 { } else { ifcansee ifcanshoottarget { sound PRED_ATTACK shoot FIRELASER } } }
    }
    else ifaction ASATWAIT
        { ifactioncount 64 ifrnd 32 ifp palive ifcansee { action ASATSHOOTING move TURRVEL faceplayer } }
    ifhitweapon { ifdead { addkills 1 sound LASERTRIP_EXPLODE debris SCRAP1 15 spawn EXPLOSION2 killit }
        else { action ASATNSPIN debris SCRAP1 4 } move 0 }

enda

action RIP_F 0 8 1 1 1
actor FORCERIPPLE 0 RIP_F
    ifactioncount 8 killit
enda

action TRANSFOWARD 0  6  1  1  2
action TRANSBACK   5  6  1 -1  2
actor TRANSPORTERSTAR 0 TRANSFOWARD
    ifaction TRANSFOWARD
    {
        ifactioncount 6
            action TRANSBACK
    }
    else
        ifactioncount 6 killit
enda

action BEAMFOWARD  0  4  1  1  9
actor TRANSPORTERBEAM 0 BEAMFOWARD
    sizeto 32 64 sizeto 32 64 sizeto 32 64
    ifactioncount 4 killit
enda

state getcode
    ifactor ATOMICHEALTH globalsound GETATOMICHEALTH
    else globalsound DUKE_GET
    palfrom 16 0 32
    ifrespawn
    {
        move RESPAWN_ACTOR_FLAG
        spawn RESPAWNMARKERRED
        cstat 32768
    }
    else killit
ends

state randgetweapsnds
    ifrnd 64 globalsound DUKE_GETWEAPON1
    else ifrnd 96 globalsound DUKE_GETWEAPON2
    else ifrnd 128 globalsound DUKE_GETWEAPON3
    else ifrnd 140 globalsound DUKE_GETWEAPON4
    else globalsound DUKE_GETWEAPON6
ends

state getweaponcode

    state randgetweapsnds

    palfrom 32 0 32
    ifgotweaponce 1 break
    ifrespawn
    {
        move RESPAWN_ACTOR_FLAG
        spawn RESPAWNMARKERRED
        cstat 32768
    }
    else killit
ends


state respawnit
    ifcount RESPAWNITEMTIME { spawn TRANSPORTERSTAR move 0 cstat 0 sound TELEPORTER }
ends

state quikget
    ifactor ATOMICHEALTH globalsound GETATOMICHEALTH
    else globalsound DUKE_GET
    palfrom 16 0 32
    killit
ends

state quikweaponget
    state randgetweapsnds
    palfrom 32 0 32
    ifgotweaponce 1 break
    killit
ends

actor STEROIDS
    fall
    ifmove RESPAWN_ACTOR_FLAG state respawnit
    else ifp pshrunk { } else ifp palive ifcount 6 ifpdistl RETRIEVEDISTANCE
        ifpinventory GET_STEROIDS STEROID_AMOUNT ifcanseetarget
    {
        addinventory GET_STEROIDS STEROID_AMOUNT quote 37 state getcode
        ifspawnedby STEROIDS state getcode
        else state quikget
    }
enda

actor HEATSENSOR
    fall
    ifmove RESPAWN_ACTOR_FLAG state respawnit
    else ifp pshrunk { } else ifp palive ifcount 6 ifpdistl RETRIEVEDISTANCE ifpinventory GET_HEATS HEAT_AMOUNT
        ifcanseetarget
    {
        addinventory GET_HEATS HEAT_AMOUNT quote 101 state getcode
        ifspawnedby HEATSENSOR state getcode
        else state quikget
    }
enda

actor BOOTS
    fall
    ifmove RESPAWN_ACTOR_FLAG state respawnit
    else ifp pshrunk { } else ifp palive ifcount 6 ifpdistl RETRIEVEDISTANCE ifpinventory GET_BOOTS BOOT_AMOUNT
        ifcanseetarget
    {
        addinventory GET_BOOTS BOOT_AMOUNT quote 6
        ifspawnedby BOOTS state getcode
        else state quikget
    }
enda

actor SHIELD
    fall
    ifmove RESPAWN_ACTOR_FLAG state respawnit
    else ifp pshrunk { } else ifp palive ifcount 6 ifpdistl RETRIEVEDISTANCE ifpinventory GET_SHIELD SHIELD_AMOUNT
        ifcanseetarget
    {
        ifspawnedby PIGCOP
        {
            ifrnd 128 addinventory GET_SHIELD PIG_SHIELD_AMOUNT1
            else addinventory GET_SHIELD PIG_SHIELD_AMOUNT2
            quote 104
            sound KICK_HIT palfrom 24 0 32 killit
        }
        else addinventory GET_SHIELD SHIELD_AMOUNT quote 38
        ifspawnedby SHIELD state getcode
        else state quikget
    }
enda

actor AIRTANK
    fall
    ifmove RESPAWN_ACTOR_FLAG state respawnit
    else ifp pshrunk { } else ifp palive ifcount 6 ifpdistl RETRIEVEDISTANCE ifpinventory GET_SCUBA SCUBA_AMOUNT
        ifcanseetarget
    {
        addinventory GET_SCUBA SCUBA_AMOUNT quote 39 state getcode
        ifspawnedby AIRTANK state getcode
        else state quikget
    }
enda

action HOLODUKE_FRAMES 0 4 1 1 8
actor HOLODUKE 0 HOLODUKE_FRAMES
    fall
    ifmove RESPAWN_ACTOR_FLAG state respawnit
    else ifp pshrunk { } else ifp palive ifcount 6 ifpdistl RETRIEVEDISTANCE ifpinventory GET_HOLODUKE HOLODUKE_AMOUNT
        ifcanseetarget
    {
        addinventory GET_HOLODUKE HOLODUKE_AMOUNT quote 51 state getcode
        ifspawnedby HOLODUKE state getcode
        else state quikget
    }
enda

actor JETPACK
    fall
    ifmove RESPAWN_ACTOR_FLAG state respawnit
    else ifp pshrunk { } else ifp palive ifpdistl RETRIEVEDISTANCE ifcount 6 ifpinventory GET_JETPACK JETPACK_AMOUNT ifcanseetarget
    {
        addinventory GET_JETPACK JETPACK_AMOUNT quote 41 state getcode
        ifspawnedby JETPACK state getcode
        else state quikget
    }
enda

actor ACCESSCARD
    fall
    ifmove RESPAWN_ACTOR_FLAG state respawnit
    else ifp pshrunk { } else ifp palive ifpdistl RETRIEVEDISTANCE ifcount 6 ifcanseetarget
    {
        ifpinventory GET_ACCESS 0 break
        addinventory GET_ACCESS 1
        quote 43
        state getcode
    }
enda

// test boss_recod


actor AMMO
    fall
    ifmove RESPAWN_ACTOR_FLAG state respawnit
    else ifp pshrunk { } else ifp palive ifcount 6 ifpdistl RETRIEVEDISTANCE ifcanseetarget
    {
        addammo PISTOL_WEAPON PISTOLAMMOAMOUNT quote 65
        ifspawnedby AMMO state getcode
        else state quikget
    }
enda

actor FREEZEAMMO
    fall
    ifmove RESPAWN_ACTOR_FLAG state respawnit
    else ifp pshrunk { } else ifp palive ifcount 6 ifpdistl RETRIEVEDISTANCE ifcanseetarget
    {
        addammo FREEZE_WEAPON FREEZEAMMOAMOUNT quote 66
        ifspawnedby FREEZEAMMO state getcode
        else state quikget
    }
enda



actor SHOTGUNAMMO
    fall
    ifmove RESPAWN_ACTOR_FLAG state respawnit
    else ifp pshrunk { } else ifp palive ifcount 6 ifpdistl RETRIEVEDISTANCE ifcanseetarget
    {
        addammo SHOTGUN_WEAPON SHOTGUNAMMOAMOUNT quote 69
        ifspawnedby SHOTGUNAMMO state getcode
        else state quikget
    }
enda

actor AMMOLOTS
    fall
    ifmove RESPAWN_ACTOR_FLAG state respawnit
    else ifp pshrunk { } else ifp palive ifcount 6 ifpdistl RETRIEVEDISTANCE ifcanseetarget
    {
        addammo PISTOL_WEAPON 48 quote 65
        ifspawnedby AMMOLOTS state getcode
        else state quikget
    }
enda

actor CRYSTALAMMO
    fall
    ifmove RESPAWN_ACTOR_FLAG state respawnit
    else ifp pshrunk { } else ifp palive ifpdistl RETRIEVEDISTANCE ifcount 6 ifcanseetarget
    {
        addammo SHRINKER_WEAPON CRYSTALAMMOAMOUNT quote 78
        ifspawnedby CRYSTALAMMO state getcode
        else state quikget
    }
enda

actor BATTERYAMMO
    fall
    ifmove RESPAWN_ACTOR_FLAG state respawnit
    else ifp pshrunk { } else ifp palive ifpdistl RETRIEVEDISTANCE ifcount 6 ifcanseetarget
    {
        addammo CHAINGUN_WEAPON CHAINGUNAMMOAMOUNT quote 63
        ifspawnedby BATTERYAMMO state getcode
        else state quikget
    }
enda

actor DEVISTATORAMMO
    fall
    ifmove RESPAWN_ACTOR_FLAG state respawnit
    else ifp pshrunk { } else ifp palive ifpdistl RETRIEVEDISTANCE ifcount 6 ifcanseetarget
    {
        addammo DEVISTATOR_WEAPON DEVISTATORAMMOAMOUNT quote 14
        ifspawnedby DEVISTATORAMMO state getcode
        else state quikget
    }
enda

actor RPGAMMO
    fall
    ifmove RESPAWN_ACTOR_FLAG state respawnit
    else ifp pshrunk { } else ifp palive ifpdistl RETRIEVEDISTANCE ifcount 6 ifcanseetarget
    {
        addammo RPG_WEAPON RPGAMMOBOX quote 64
        ifspawnedby RPGAMMO state getcode
        else state quikget
    }
enda

actor HBOMBAMMO
    fall
    ifmove RESPAWN_ACTOR_FLAG state respawnit
    else ifp pshrunk { } else ifp palive ifpdistl RETRIEVEDISTANCE ifcount 6 ifcanseetarget
    {
        ifgotweaponce 0 break // ( Multiplayer (mode 3) only )

        addweapon HANDBOMB_WEAPON 1 quote 55
        addammo HANDBOMB_WEAPON HANDBOMBBOX

        ifspawnedby HBOMBAMMO state getweaponcode
        else state quikweaponget
    }
enda

actor RPGSPRITE
    fall
    ifmove RESPAWN_ACTOR_FLAG state respawnit
    else ifp pshrunk { } else ifp palive ifpdistl RETRIEVEDISTANCE ifcount 6 ifcanseetarget
    {
        ifgotweaponce 0 break // ( Multiplayer (mode 3) only )

        addweapon RPG_WEAPON RPGAMMOBOX quote 56
        ifspawnedby RPGSPRITE state getweaponcode
        else state quikweaponget
    }
enda

// 531.89 GTE.
// IMA.
// PO BOX 4629
// Rocford ill, 61110-4629
// Ms. Lee

actor SHOTGUNSPRITE
    fall
    ifmove RESPAWN_ACTOR_FLAG state respawnit
    else ifp pshrunk { } else ifp palive ifpdistl RETRIEVEDISTANCE ifcount 6 ifcanseetarget
    {
        ifspawnedby PIGCOP
        {
            addweapon SHOTGUN_WEAPON 0
            ifrnd 64 addammo SHOTGUN_WEAPON 4
            else ifrnd 64 addammo SHOTGUN_WEAPON 3
            else ifrnd 64 addammo SHOTGUN_WEAPON 2
            else addammo SHOTGUN_WEAPON 1
        }
        else
        {
            ifgotweaponce 0 break // Multiplayer only
            addweapon SHOTGUN_WEAPON SHOTGUNAMMOAMOUNT quote 57
        }
        ifspawnedby SHOTGUNSPRITE state getweaponcode
        else state quikweaponget
    }
enda



actor SIXPAK
    fall
    ifmove RESPAWN_ACTOR_FLAG state respawnit
    else ifp pshrunk { } else ifp palive ifpdistl RETRIEVEDISTANCE ifcount 6 ifphealthl MAXPLAYERHEALTH ifcanseetarget
    {
        addphealth 30 quote 62
        ifspawnedby SIXPAK state getcode
        else state quikget
    }
enda

actor COLA
    fall
    ifmove RESPAWN_ACTOR_FLAG state respawnit
    else ifp pshrunk { } else ifp palive ifpdistl RETRIEVEDISTANCE ifcount 6 ifphealthl MAXPLAYERHEALTH // ifcanseetarget
    {
        addphealth 10 quote 61
        ifspawnedby COLA state getcode
        else state quikget
    }
enda

actor ATOMICHEALTH
    fall
    ifmove RESPAWN_ACTOR_FLAG state respawnit
    else ifp pshrunk { } else ifp palive ifpdistl RETRIEVEDISTANCE ifcount 6 ifcanseetarget
        ifphealthl MAXPLAYERATOMICHEALTH
    {
        addphealth 50 quote 19
        ifspawnedby ATOMICHEALTH state getcode
        else state quikget
    }
enda




actor FIRSTAID
    fall
    ifmove RESPAWN_ACTOR_FLAG state respawnit
    else ifp pshrunk { } else ifp palive ifpdistl RETRIEVEDISTANCE ifcount 6
        ifpinventory GET_FIRSTAID FIRSTAID_AMOUNT ifcanseetarget
    {
        addinventory GET_FIRSTAID FIRSTAID_AMOUNT quote 3

        ifspawnedby FIRSTAID state getcode
        else state quikget
    }
enda


actor FIRSTGUNSPRITE
    fall
    ifmove RESPAWN_ACTOR_FLAG state respawnit
    else ifp pshrunk { } else ifp palive ifpdistl RETRIEVEDISTANCE ifcount 6 ifcanseetarget
    {
        ifgotweaponce 0 break

        addweapon PISTOL_WEAPON 48
        ifspawnedby FIRSTGUNSPRITE state getweaponcode
        else state quikweaponget
    }
enda


actor TRIPBOMBSPRITE
    fall
    ifmove RESPAWN_ACTOR_FLAG state respawnit
    else ifp pshrunk { } else ifp palive ifpdistl RETRIEVEDISTANCE ifcount 6 ifcanseetarget
    {
        ifgotweaponce 0 break

        addweapon TRIPBOMB_WEAPON 1
        quote 58
        ifspawnedby TRIPBOMBSPRITE state getweaponcode
        else state quikweaponget
    }
enda

actor CHAINGUNSPRITE
    fall
    ifmove RESPAWN_ACTOR_FLAG state respawnit
    else ifp pshrunk { } else ifp palive ifpdistl RETRIEVEDISTANCE ifcount 6 ifcanseetarget
    {
        ifgotweaponce 0 break

        addweapon CHAINGUN_WEAPON 50 quote 54
        ifspawnedby CHAINGUNSPRITE state getweaponcode
        else state quikweaponget
    }
enda



actor SHRINKERSPRITE
    fall
    ifmove RESPAWN_ACTOR_FLAG state respawnit
    else ifp pshrunk { } else ifp palive ifpdistl RETRIEVEDISTANCE ifcount 6 ifcanseetarget
    {
        ifgotweaponce 0 break

        addweapon SHRINKER_WEAPON 10 quote 60
        ifspawnedby SHRINKERSPRITE state getweaponcode
        else state quikweaponget
    }
enda

actor FREEZESPRITE
    fall
    ifmove RESPAWN_ACTOR_FLAG state respawnit
    else ifp pshrunk { } else ifp palive ifpdistl RETRIEVEDISTANCE ifcount 6 ifcanseetarget
    {
        ifgotweaponce 0 break

        addweapon FREEZE_WEAPON FREEZEAMMOAMOUNT quote 59
        ifspawnedby FREEZESPRITE state getweaponcode
        else state quikweaponget
    }
enda

actor DEVISTATORSPRITE
    fall
    ifmove RESPAWN_ACTOR_FLAG state respawnit
    else ifp pshrunk { } else ifp palive ifpdistl RETRIEVEDISTANCE ifcount 6 ifcanseetarget
    {
        ifgotweaponce 0 break // ( Multiplayer (mode 3) only )

        addweapon DEVISTATOR_WEAPON DEVISTATORAMMOAMOUNT quote 87
        ifspawnedby DEVISTATORSPRITE state getweaponcode
        else state quikweaponget
    }
enda


state firestate

    ifgapzl 16 break
    ifinwater killit

    ifp palive ifpdistl 844 ifrnd 32 ifcansee { soundonce DUKE_LONGTERM_PAIN addphealth -1 palfrom 32 32 }

    ifactor FIRE ifspawnedby FIRE break
    else ifactor FIRE2 ifspawnedby FIRE2 break

    iffloordistl 128
    {
        ifcount 32 sizeto 8 8
        ifcount 64 killit
    }
    else killit

ends

action FIRE_FRAMES     -1 14 1 1 1
move FIREVELS
actor FIRE WEAK FIRE_FRAMES FIREVELS state firestate enda
actor FIRE2 WEAK FIRE_FRAMES FIREVELS state firestate enda

actor FECES
    ifcount 24
    {
        ifpdistl RETRIEVEDISTANCE
        {
            soundonce DUKE_STEPONFECES
            sound STEPNIT

            spawn BLOODPOOL   // Will be brown
            killit
        }
    }
    else sizeto 32 32
enda

state drop_ammo ifrnd SPAWNAMMOODDS spawn AMMO ends
state drop_battery ifrnd SPAWNAMMOODDS spawn BATTERYAMMO ends
state drop_sgshells ifrnd SPAWNAMMOODDS spawn SHOTGUNAMMO ends
state drop_shotgun ifrnd SPAWNAMMOODDS spawn SHOTGUNSPRITE ends
state drop_chaingun
    ifrnd SPAWNAMMOODDS
    {
        ifrnd 32 spawn CHAINGUNSPRITE
        else spawn BATTERYAMMO
    }
ends

state jib_sounds
    ifrnd SWEARFREQUENCY
    {
        ifrnd 16 globalsound JIBBED_ACTOR1
        else ifrnd 16 globalsound JIBBED_ACTOR2
        else ifrnd 16 globalsound JIBBED_ACTOR3
        else ifrnd 16 globalsound JIBBED_ACTOR5
        else ifrnd 16 globalsound JIBBED_ACTOR6
        else ifrnd 16 globalsound JIBBED_ACTOR10
        else ifrnd 16 globalsound JIBBED_ACTOR7
        else ifrnd 16 globalsound JIBBED_ACTOR4
        else ifrnd 16 globalsound JIBBED_ACTOR8
        else ifrnd 16 globalsound JIBBED_ACTOR13
        else ifrnd 16 globalsound JIBBED_ACTOR9
        else ifrnd 16 globalsound JIBBED_ACTOR11
        else ifrnd 16 globalsound JIBBED_ACTOR12
    }
ends

state standard_jibs
    guts JIBS2 1
    guts JIBS3 2
    guts JIBS4 3
    guts JIBS5 2
    guts JIBS6 3
    ifrnd 4 { guts JIBS1 1 spawn BLOODPOOL }               // spine
    state jib_sounds
ends

action FEMSHRUNK
action FEMFROZEN1 1
action FEMFROZEN2
action FEMDANCE1 19 1 1 1 16
action FEMDANCE3 19 1 1 1 26

action FEMDANCE2 20 2 1 1 10
action FEMANIMATE

state femcode

    ifactor NAKED1 { } else ifactor FEM6 { } else
    {
        fall
        ifactor BLOODYPOLE ifhitweapon ifdead
            { state standard_jibs killit }
    }

    ifaction FEMSHRUNK
    {
        ifcount SHRUNKDONECOUNT action FEMANIMATE
        else ifcount SHRUNKCOUNT sizeto 40 40
        else state genericshrunkcode
    }
    else ifaction FEMDANCE1 { ifactioncount 2 action FEMDANCE2 }
    else ifaction FEMDANCE2 { ifactioncount 8 action FEMDANCE3 }
    else ifaction FEMDANCE3 { ifactioncount 2 action FEMANIMATE }
    else ifaction FEMFROZEN1
    {
        ifcount THAWTIME { action FEMANIMATE getlastpal }
        else ifcount FROZENDRIPTIME { ifactioncount 26 { spawn WATERDRIP resetactioncount } }

        ifhitweapon
        {
            ifwasweapon FREEZEBLAST { strength 0 break }
            lotsofglass 30
            sound GLASS_BREAKING
            respawnhitag
            ifrnd 84 spawn BLOODPOOL
            killit
        }
        else ifp pfacing ifpdistl FROZENQUICKKICKDIST pkick
        break
    }
    else ifaction FEMFROZEN2
    {
        ifcount THAWTIME { action FEMANIMATE getlastpal }
        else ifcount FROZENDRIPTIME { ifactioncount 26 { spawn WATERDRIP resetactioncount } }

        ifhitweapon
        {
            ifwasweapon FREEZEBLAST { strength 0 break }
            lotsofglass 30

            sound GLASS_BREAKING
            ifrnd 84 spawn BLOODPOOL
            respawnhitag

            ifrnd 128 sound DUKE_HIT_STRIPPER1
            else sound DUKE_HIT_STRIPPER2

            killit
        }
        else ifp pfacing ifpdistl FROZENQUICKKICKDIST pkick
        break
    }

    ifhitweapon
    {
        ifwasweapon SHRINKSPARK { sound ACTOR_SHRINKING count 0 action FEMSHRUNK break }

        ifdead
        {
            ifwasweapon FREEZEBLAST
            {
                ifaction FEMSHRUNK break

                ifactor NAKED1 action FEMFROZEN2
                else ifactor FEM5 action FEMFROZEN2
                else ifactor FEM6 action FEMFROZEN2
                else ifactor FEM8 action FEMFROZEN2
                else ifactor FEM9 action FEMFROZEN2
                else ifactor PODFEM1 action FEMFROZEN2
                else action FEMFROZEN1

                move 0
                spritepal 1
                strength 0

                sound SOMETHINGFROZE

                break
            }

            ifrnd 128 sound DUKE_HIT_STRIPPER1
            else sound DUKE_HIT_STRIPPER2

            respawnhitag
            state standard_jibs

            shoot BLOODSPLAT1
            shoot BLOODSPLAT2
            shoot BLOODSPLAT3
            shoot BLOODSPLAT4
            spawn BLOODPOOL

            ifactor FEM1 money 5
            else ifactor FEM2 { money 7 cactor BARBROKE cstat 0 }
            else ifactor FEM3 money 4
            else ifactor FEM7 money 8

            ifactor FEM5 { strength TOUGH cactor BLOODYPOLE }
            else ifactor FEM6 { cstat 0 cactor FEM6PAD }
            else ifactor FEM8 { strength TOUGH cactor BLOODYPOLE }
            else
            {
                spritepal 6
                soundonce LADY_SCREAM
                ifactor NAKED1 debris SCRAP3 18
                else ifactor PODFEM1 debris SCRAP3 18
                killit
            }
        }
        else
        {
            sound SQUISHED
            guts JIBS6 1
            ifactor FEM8 break
            soundonce LADY_SCREAM
        }
    }
ends

state killme
    ifp pfacing ifpdistl 1280 ifhitspace soundonce KILLME
ends

state tipme
    ifp pfacing ifpdistl 1280 ifhitspace
    {
        tip
        ifrnd 128 soundonce DUKE_TIP1
        else soundonce DUKE_TIP2
        ifactor FEM1 action FEMDANCE1
    }
ends

actor FEM1 TOUGH FEMANIMATE state tipme state femcode enda
actor FEM2 TOUGH FEMANIMATE state tipme state femcode enda
actor FEM3 TOUGH FEMANIMATE state tipme state femcode enda
actor FEM4 TOUGH FEMANIMATE state femcode enda
actor FEM5 TOUGH FEMANIMATE state killme state femcode enda
actor FEM6 TOUGH FEMANIMATE state killme state femcode enda
actor FEM7 TOUGH FEMANIMATE state tipme state femcode enda
actor FEM8 TOUGH FEMANIMATE state femcode enda
actor FEM9 TOUGH FEMANIMATE state femcode enda
actor NAKED1 TOUGH FEMANIMATE state killme state femcode enda
actor PODFEM1 TOUGH FEMANIMATE state killme state femcode enda
actor BLOODYPOLE TOUGH state femcode enda

actor STATUEFLASH fall // state statuehit
    ifcount 32 cactor STATUE
enda

actor STATUE fall
    ifp pfacing ifpdistl 1280 ifhitspace { cactor STATUEFLASH move 0 }
enda

actor MIKE
    ifp pfacing ifpdistl 1280 ifhitspace mikesnd
enda

state troop_body_jibs
    ifrnd 64 guts HEADJIB1 1
    ifrnd 64 guts LEGJIB1 2
    ifrnd 64 guts ARMJIB1 1
    ifrnd 48 spawn BLOODPOOL
ends

state liz_body_jibs
ifrnd 64 guts LIZMANHEAD1 1
    ifrnd 64 guts LIZMANLEG1 2
    ifrnd 64 guts LIZMANARM1 1
    ifrnd 48 spawn BLOODPOOL
ends

state delete_enemy killit ends


action BLOODFRAMES 0 4 1 1 15
actor BLOOD 0 BLOODFRAMES
    sizeto 72 72 sizeto 72 72 sizeto 72 72
    ifpdistg 3144 killit
    ifactioncount 4 killit
enda

action EGGOPEN1 1 1 1 1 4
action EGGOPEN2 2 1 1 1 4
action EGGOPEN3 2 1 1 1 4
action EGGWAIT  0
action EGGFROZEN 1
action EGGSHRUNK 1

actor EGG TOUGH
    ifaction 0
    {
        ifcount 64
        {
            ifrnd 128 { action EGGWAIT move 0 }
            else
            {
                sound SLIM_HATCH
                action EGGOPEN1
            }
        }
    }
    else ifaction EGGOPEN1 ifactioncount 4 action EGGOPEN2
    else ifaction EGGOPEN2 ifactioncount 4 { spawn GREENSLIME action EGGOPEN3 }
    else ifaction EGGSHRUNK
    {
        ifcount SHRUNKDONECOUNT action EGGOPEN2
        else ifcount SHRUNKCOUNT sizeto 48 40
        else state genericshrunkcode
    }
    else ifaction EGGFROZEN
    {
        ifcount THAWTIME { action 0 getlastpal }
        else ifcount FROZENDRIPTIME { ifactioncount 26 { spawn WATERDRIP resetactioncount } }

        ifhitweapon
        {
            ifwasweapon FREEZEBLAST { strength 0 break }
            lotsofglass 30

            sound GLASS_BREAKING
            ifrnd 84 spawn BLOODPOOL

            addkills 1
            killit
        }

        // ifp pducking
        ifp pfacing ifpdistl FROZENQUICKKICKDIST pkick

        break
    }

    ifhitweapon
    {
        ifwasweapon SHRINKSPARK { move 0 sound ACTOR_SHRINKING action EGGSHRUNK break }

        ifdead
        {
            ifwasweapon FREEZEBLAST
                { sound SOMETHINGFROZE spritepal 1 move 0 action EGGFROZEN strength 0 break }

            addkills 1

            sound SQUISHED

            state standard_jibs
            state delete_enemy
        }
    }
    else ifaction EGGWAIT
    {
        ifcount 512 ifrnd 2
        {
            ifaction EGGSHRUNK break
            sound SLIM_HATCH
            action EGGOPEN1
        }
    }

enda

actor KNEE KNEE_WEAPON_STRENGTH enda
actor SPIT SPIT_WEAPON_STRENGTH enda
actor CHAINGUN CHAINGUN_WEAPON_STRENGTH enda
actor SHOTGUN SHOTGUN_WEAPON_STRENGTH enda
actor FIRELASER FIRELASER_WEAPON_STRENGTH enda
actor HEAVYHBOMB HANDBOMB_WEAPON_STRENGTH enda
actor BOUNCEMINE BOUNCEMINE_WEAPON_STRENGTH enda
actor MORTER MORTER_WEAPON_STRENGTH enda
actor SHRINKSPARK SHRINKER_WEAPON_STRENGTH enda
actor RPG RPG_WEAPON_STRENGTH enda
actor FREEZEBLAST FREEZETHROWER_WEAPON_STRENGTH enda
actor DEVISTATORBLAST FREEZETHROWER_WEAPON_STRENGTH enda
actor COOLEXPLOSION1 COOL_EXPLOSION_STRENGTH enda
actor TRIPBOMB TRIPBOMB_STRENGTH enda

action WEAP2FRAMES 0  4  1  1  6
actor SHOTSPARK1 PISTOL_WEAPON_STRENGTH WEAP2FRAMES
    ifdead killit
    ifactioncount 4 killit
    else
    {
        ifactioncount 3 { ifinwater spawn WATERBUBBLE }
        else ifcount 2 { } else ifonwater spawn WATERSPLASH2
    }
enda

state standard_pjibs
    guts JIBS1 1
    guts JIBS3 2
    guts JIBS4 1
    guts JIBS5 1
    guts JIBS6 2
    guts DUKETORSO 1
    guts DUKELEG 2
    guts DUKEGUN 1
    ifrnd 16 money 1
ends

move DUKENOTMOVING
state handle_dead_dukes
    fall
    ifmove 0     // 1st time initializiation...
    {
        ifrnd 128 cstat 4
        else cstat 0
        move DUKENOTMOVING
    }

    ifsquished
    {
        sound SQUISHED
        spawn OOZ
        killit
    }
    else ifcount 1024 ifpdistg 4096 killit
    else
    {
        strength 0
        ifhitweapon ifwasweapon RADIUSEXPLOSION
        {
            state standard_jibs
            killit
        }
    }
ends

action PLYINGFRAMES 0 1 0 1 1
actor DUKELYINGDEAD 0 PLYINGFRAMES
    state handle_dead_dukes
enda

action PSTAND       0   1   5   1    1
action PEXPLODE     106   5   1   1   10
action PEXPLODEAD   113   1   1

action PJPHOUVER    15   1   5   1
action PWALK        20   4   5   1   16
action PRUN         20   4   5   1   10
action PWALKBACK    45   4   5  -1   16
action PRUNBACK     45   4   5  -1   10
action PJUMPING     50   4   5   1   30
action PFALLING     65   1   5
action PDUCKING     86   1   5
action PCRAWLING    86   3   5   1   20
action PAKICKING    40   2   5   1   25
action PFLINTCHING  106  1   1   1   10
action PTHROWNBACK  106  5   1   1   18
action PFROZEN       20  1   5
action PLYINGDEAD   113  1   1

action PSWIMMINGGO   375   1   5   1   10
action PSWIMMING     375   4   5   1   13
action PSWIMMINGWAIT 395   1   5   1   13
action PTREDWATER    395   2   5   1   17

move PSTOPED
move PSHRINKING // used as a var only

state check_dead_thrown_back
    ifdead
    {
        strength 0
        action PTHROWNBACK
    }
ends

state check_pstandard
    ifp pwalking action PWALK
    else ifp pkicking action PAKICKING
    else ifp pwalkingback action PWALKBACK
    else ifp prunning action PRUN
    else ifp prunningback action PRUNBACK
    else ifp pjumping
        action PJUMPING
    else ifp pducking action PDUCKING
ends

state random_wall_jibs
    ifrnd 96 shoot BLOODSPLAT1
    ifrnd 96 shoot BLOODSPLAT2
    ifrnd 96 shoot BLOODSPLAT3
    ifrnd 96 shoot BLOODSPLAT4
    ifrnd 96 shoot BLOODSPLAT1
ends

actor APLAYER 100 PSTAND 0 0

    ifaction 0 action PSTAND
    ifdead
    {
        ifsquished palfrom 32 63 63 63
        else fall

        ifactioncount 7 { move 0 } else ifactioncount 6
        {
            ifmultiplayer { }
            else
            {
                ifrnd 32 sound DUKE_KILLED5
                else ifrnd 32 sound DUKE_KILLED3
                else ifrnd 32 sound DUKE_KILLED1
                else ifrnd 32 sound DUKE_KILLED2
            }
        }

        ifaction PLYINGDEAD
        {
            ifactioncount 3 move PSTOPED
            quote 13
            ifhitspace
            {
                action PSTAND
                spawn DUKELYINGDEAD
                resetplayer
            }
            break
        }
        else ifaction PTHROWNBACK
        {
            ifactioncount 5
            {
                spawn BLOODPOOL
                action PLYINGDEAD
            }
            else ifactioncount 1 move 0
            break
        }
        else ifaction PFROZEN
        {
            cstat 257

            palfrom 16 0 0 24

            ifhitweapon
            {
                ifwasweapon FREEZEBLAST break
                lotsofglass 60
                ifrnd 84 spawn BLOODPOOL

                getlastpal
                sound GLASS_BREAKING
                spawn ATOMICHEALTH
                cstat 32768
                action PLYINGDEAD
                break
            }

            ifactioncount THAWTIME { getlastpal strength 1 move 0 action PSTAND }
            else ifactioncount FROZENDRIPTIME { ifrnd 32 spawn WATERDRIP }

            ifp pfacing   // assumes some other player
                ifpdistl FROZENQUICKKICKDIST pkick

            break
        }
        else ifaction PEXPLODEAD
        {
            quote 13
            ifhitspace
            {
                action PSTAND
                resetplayer
            }
            break
        }
        else ifaction PEXPLODE
        {
            ifactioncount 5
            {
                action PEXPLODEAD
                spawn BLOODPOOL
            }
            break
        }

        else ifp pshrunk
        {
            state standard_pjibs
            spawn BLOODPOOL

            sound SQUISHED
            sound DUKE_DEAD

            cstat 32768                 // Hide the sprite

            action PLYINGDEAD
        }

        else
        {
            ifinwater
            {
                action PLYINGDEAD
                spawn WATERBUBBLE
                spawn WATERBUBBLE
            }
            else
            {
                action PEXPLODE
                state standard_pjibs
                cstat 32768
                sound SQUISHED
                sound DUKE_DEAD
            }
        }
        break
    }

    ifsquished
    {
        strength -1
        sound SQUISHED
        spawn OOZ
        break
    }

    ifp ponsteroids
    {
        ifp pstanding { }
        else spawn FRAMEEFFECT1
    }

    ifmove PSHRINKING
    {
        ifcount 32
        {
            ifcount SHRUNKDONECOUNT move 0
            else ifcount SHRUNKCOUNT
            {
                sizeto 42 36
                ifgapzl 24
                {
                    strength 0
                    sound SQUISHED
                    palfrom 48 64
                    break
                }
            }
            else ifp ponsteroids count SHRUNKCOUNT
        }
        else
        {
            ifp ponsteroids count SHRUNKCOUNT
            else { sizeto 8 9 spawn FRAMEEFFECT1 }
        }
    }

    else ifhitweapon
    {
        ifdead { ifmultiplayer sound DUKE_KILLED4 }
        else
        {
            ifmultiplayer
            {
                ifphealthl YELLHURTSOUNDSTRENGTHMP
                {
                    ifrnd 64 sound DUKE_LONGTERM_PAIN2
                    else ifrnd 64 sound DUKE_LONGTERM_PAIN3
                    else ifrnd 64 sound DUKE_LONGTERM_PAIN4
                    else sound DUKE_DEAD
                }
                else
                {
                    ifrnd 64 sound DUKE_LONGTERM_PAIN5
                    else ifrnd 64 sound DUKE_LONGTERM_PAIN6
                    else ifrnd 64 sound DUKE_LONGTERM_PAIN7
                    else sound DUKE_LONGTERM_PAIN8
                }
            }
            else
            {
                ifphealthl YELLHURTSOUNDSTRENGTH
                {
                    ifrnd 74 sound DUKE_LONGTERM_PAIN2
                    else ifrnd 8 sound DUKE_LONGTERM_PAIN3
                    else sound DUKE_LONGTERM_PAIN4
                }
                ifrnd 128 sound DUKE_LONGTERM_PAIN
            }
        }
        ifstrength TOUGH
        {
            state headhitstate
            sound DUKE_GRUNT
            ifp pstanding action PFLINTCHING
        }

        ifwasweapon RPG
        {
            ifrnd 32 spawn BLOOD
            ifdead state standard_pjibs
            palfrom 48 52
            break
        }
        ifwasweapon RADIUSEXPLOSION
        {
            ifrnd 32 spawn BLOOD
            ifdead state standard_pjibs
            palfrom 48 52
            break
        }
        ifwasweapon FIREEXT
        {
            ifrnd 32 spawn BLOOD
            ifdead state standard_pjibs
            palfrom 48 52
            break
        }

        ifwasweapon SHRINKSPARK
        {
            palfrom 48 0 48
            move PSHRINKING // used as a var only.
            sound ACTOR_SHRINKING
            break
        }

        ifwasweapon SHOTSPARK1 palfrom 24 48
        else ifwasweapon FREEZEBLAST
        {
            palfrom 48 0 0 48
            ifdead { sound SOMETHINGFROZE spritepal 1 action PFROZEN break }
        }
        else ifwasweapon COOLEXPLOSION1 palfrom 48 48 0 48
        else ifwasweapon KNEE palfrom 16 32
        else ifwasweapon FIRELASER palfrom 32 32
        state check_dead_thrown_back
        state random_wall_jibs

        break
    }

    ifaction PFLINTCHING
    {
        ifactioncount 2 action PSTAND
        break
    }

    ifinwater
    {
        ifaction PTREDWATER
        {
            ifp pwalking prunning action PSWIMMINGGO
        }
        else ifp pstanding pwalkingback prunningback action PTREDWATER
        else
        {
            ifaction PSWIMMING
            {
                ifrnd 4 spawn WATERBUBBLE
                ifactioncount 4
                    action PSWIMMINGWAIT
            }
            else ifaction PSWIMMINGWAIT
            {
                ifactioncount 2
                    action PSWIMMINGGO
            }
            else ifaction PSWIMMINGGO
            {
                ifactioncount 2
                    action PSWIMMING
            }
            else action PTREDWATER
        }

        ifrnd 4 spawn WATERBUBBLE // For effect

        break
    }
    else ifp pjetpack
    {
        ifaction PJPHOUVER
        {
            ifactioncount 4
                resetactioncount
        }
        else action PJPHOUVER
        break
    }
    else
    {
        ifaction PTREDWATER action PSTAND
        ifaction PSWIMMING action PSTAND
        ifaction PSWIMMINGWAIT action PSTAND
        ifaction PSWIMMINGGO action PSTAND
        ifaction PJPHOUVER action PFALLING
    }

    ifaction PFALLING
    {
        ifp ponground
            action PSTAND
        else
        {
            ifp pfalling break
            else state check_pstandard
        }
    }

    ifaction PDUCKING
    {
        ifgapzl 48
        {
            ifp pwalking pwalkingback prunning prunningback action PCRAWLING
        }
        else ifp pducking
        {
            ifp pwalking pwalkingback prunning prunningback action PCRAWLING
        }
        else
        {
            ifp pstanding action PSTAND
            else state check_pstandard
        }
    }

    else ifaction PCRAWLING
    {
        ifgapzl 48
        {
            ifp pstanding action PCRAWLING
        }
        else ifp pducking
        {
            ifp pstanding action PDUCKING
        }
        else
        {
            ifp pstanding action PSTAND
            else state check_pstandard
        }
    }
    else ifgapzl 48 action PDUCKING

    else ifaction PJUMPING
    {
        ifp ponground action PSTAND
        else ifactioncount 4 ifp pfalling action PFALLING
    }

    ifp pfalling action PFALLING
    else ifaction PSTAND state check_pstandard
    else ifaction PAKICKING
    {
        ifactioncount 2 action PSTAND
        break
    }
    else ifaction PWALK
    {
        ifp pfalling action PFALLING
        else ifp pstanding action PSTAND
        else ifp prunning action PRUN
        else ifp pwalkingback action PWALKBACK
        else ifp prunningback action PRUNBACK
        else ifp pjumping
            action PJUMPING
        else ifp pducking action PDUCKING
    }

    else ifaction PRUN
    {
        ifp pstanding action PSTAND
        else ifp pwalking action PWALK
        else ifp pwalkingback action PWALKBACK
        else ifp prunningback action PRUNBACK
        else ifp pjumping
            action PJUMPING
        else ifp pducking action PDUCKING
    }

    else ifaction PWALKBACK
    {
        ifp pstanding action PSTAND
        else ifp pwalking action PWALK
        else ifp prunning action PRUN
        else ifp prunningback action PRUNBACK
        else ifp pjumping
            action PJUMPING
        else ifp pducking action PDUCKING
    }

    else ifaction PRUNBACK
    {
        ifp pstanding action PSTAND
        else ifp pwalking action PWALK
        else ifp prunning action PRUN
        else ifp pwalkingback action PWALKBACK
        else ifp pjumping
            action PJUMPING
        else ifp pducking action PDUCKING
    }
enda

actor ORGANTIC TURRETSTRENGTH
    ifcount 48 resetcount
    else { ifcount 32 sizeto 32 32 }
    else ifcount 16 { sizeto 48 18 ifpdistl 2048 { sound TURR_ATTACK addphealth -2 palfrom 32 16 } }
    ifhitweapon { ifdead { addkills 1 sound TURR_DYING guts JIBS5 10 state delete_enemy } sound TURR_PAIN break }
    ifrnd 1 soundonce TURR_ROAM
enda

state rf
    ifrnd 128 cstat 4
    else cstat 0
ends


//
//
//      TROOP/LIZTROOP CODE
//
//

action ATROOPSTAND       0    1    5    1    1
action ATROOPSTAYSTAND  -2    1    5    1    1
action ATROOPWALKING     0    4    5    1   12
action ATROOPWALKINGBACK 15   4    5   -1   12
action ATROOPRUNNING     0    4    5    1    8
action ATROOPSHOOT      35    1    5    1   30
action ATROOPJETPACK    40    1    5    1    1
action ATROOPJETPACKILL 40    2    5    1   50
action ATROOPFLINTCH    50    1    1    1    6
action ATROOPDYING      50    5    1    1   16
action ATROOPDEAD       54
action ATROOPPLAYDEAD   54
action ATROOPSUFFERDEAD 58    2    1   -4   24
action ATROOPSUFFERING  59    2    1    1   21
action ATROOPDUCK       64    1    5    1    3
action ATROOPDUCKSHOOT  64    2    5    1   25
action ATROOPABOUTHIDE  74    1    1    1   25
action ATROOPHIDE       79    1    1    1   25
action ATROOPREAPPEAR   74    1    1    1   25
action ATROOPFROZEN      0    1    5

move TROOPWALKVELS 72
move TROOPWALKVELSBACK -72
move TROOPJETPACKVELS 64 -84
move TROOPJETPACKILLVELS 192 -38
move TROOPRUNVELS 108
move TROOPSTOPPED
move DONTGETUP
move SHRUNKVELS 32

ai AITROOPSEEKENEMY  ATROOPWALKING   TROOPWALKVELS seekplayer
ai AITROOPSEEKPLAYER ATROOPWALKING   TROOPWALKVELS seekplayer
ai AITROOPFLEEING    ATROOPWALKING   TROOPWALKVELS fleeenemy
ai AITROOPFLEEINGBACK ATROOPWALKINGBACK   TROOPWALKVELSBACK faceplayer
ai AITROOPDODGE      ATROOPWALKING   TROOPRUNVELS  dodgebullet
ai AITROOPSHOOTING   ATROOPSHOOT     TROOPSTOPPED  faceplayer
ai AITROOPDUCKING    ATROOPDUCK      TROOPSTOPPED  faceplayer
ai AITROOPJETPACK    ATROOPJETPACK   TROOPJETPACKVELS seekplayer
ai AITROOPSHRUNK     ATROOPWALKING   SHRUNKVELS fleeenemy
ai AITROOPHIDE       ATROOPABOUTHIDE TROOPSTOPPED faceplayer

state troophidestate
    ifaction ATROOPREAPPEAR
    {
        ifactioncount 2 { sound TELEPORTER ai AITROOPSHOOTING cstat 257 }
        else { sizeto 41 40 sizeto 41 40 sizeto 41 40 sizeto 41 40 spawn FRAMEEFFECT1 }
    }
    else ifaction ATROOPWALKING
    {
        ifpdistl 2448 ifpdistg 1024
        {
            ifceilingdistl 48 break
            ifp pfacing break

            ifgapzl 64 { } else ifawayfromwall { spawn TRANSPORTERSTAR action ATROOPREAPPEAR move 0 break }
        }
    }
    else ifaction ATROOPHIDE
    {
        ifactioncount 2
        {
            spawn TRANSPORTERSTAR
            sound TELEPORTER
            action ATROOPWALKING move TROOPWALKVELS faceplayer
            cstat 32768
        }
        else
        {
            sizeto 0 40
            sizeto 0 40
            sizeto 0 40
            sizeto 0 40
            spawn FRAMEEFFECT1
        }
    }
    else ifaction ATROOPABOUTHIDE ifactioncount 2 { action ATROOPHIDE cstat 0 }
ends


state troopgunnashoot
    ifp palive
    {
        ifpdistl 1024 ai AITROOPSHOOTING
        else ifactornotstayput
        {
            ifactioncount 12 ifrnd 16 ifcanshoottarget
            {
                ifspritepal 21 ifrnd 4 ifpdistg 4096 ai AITROOPHIDE
                else
                {
                    ifpdistl 1100 ai AITROOPFLEEING
                    else
                    {
                        ifpdistl 4096 ifcansee ifcanshoottarget ai AITROOPSHOOTING
                        else { move TROOPRUNVELS seekplayer action ATROOPRUNNING }
                    }
                }
            }
        }
        else ifcount 26 ifrnd 32 ai AITROOPSHOOTING
    }
ends

state troopseekstate
    state troopgunnashoot
    ifinwater { ai AITROOPJETPACK break }
    ifcansee
    {
        ifmove TROOPRUNVELS ifpdistl 1596 ai AITROOPDUCKING
        ifp phigher { ifceilingdistl 128 { } else ifactornotstayput ai AITROOPJETPACK break }
        else ifrnd 2
        {
            ifspritepal 21 ifpdistg 1596 { ai AITROOPHIDE break }
            ifbulletnear { ifrnd 128 ai AITROOPDODGE else ai AITROOPDUCKING break }
        }
    }
    ifnotmoving { ifrnd 32 operate else ifcount 32 ifp palive ifcansee ifcanshoottarget ai AITROOPSHOOTING }
    ifrnd 1
    {
        ifrnd 128 soundonce PRED_ROAM
        else soundonce PRED_ROAM2
    }
ends

state troopduckstate
    ifaction ATROOPDUCK
        { ifactioncount 8 { ifp palive { ifrnd 128 action ATROOPDUCKSHOOT } else ifmove DONTGETUP break else ai AITROOPSEEKPLAYER } }
    else ifaction ATROOPDUCKSHOOT
    {
        ifcount 64
        {
            ifmove DONTGETUP resetcount
            else
            {
                ifpdistl 1100
                    ai AITROOPFLEEING
                else ai AITROOPSEEKPLAYER
            }
        }
        else ifactioncount 2 { ifcanshoottarget { sound PRED_ATTACK resetactioncount shoot FIRELASER } else ai AITROOPSEEKPLAYER }
    }
ends

state troopshootstate
    ifactioncount 2
    {
        ifcanshoottarget
        {
            shoot FIRELASER sound PRED_ATTACK resetactioncount
            ifrnd 128 ai AITROOPSEEKPLAYER
            ifcount 24
            {
                ifrnd 96 ifpdistg 2048 ai AITROOPSEEKPLAYER
                else
                {
                    ifpdistg 1596 ai AITROOPFLEEING
                    else ai AITROOPFLEEINGBACK
                }
            }
        }
        else ai AITROOPSEEKPLAYER
    }
ends

state troopfleestate
    ifactioncount 7
    {
        ifpdistg 3084 { ai AITROOPSEEKPLAYER break }
        else ifrnd 32 ifp palive ifcansee ifcanshoottarget { ifrnd 128 ai AITROOPDUCKING else ai AITROOPSHOOTING break }
    }
    ifnotmoving
    {
        ifrnd 32 operate else ifcount 32 ifp palive ifcansee ifcanshoottarget
            { ifrnd 128 ai AITROOPSHOOTING else ai AITROOPDUCKING }
    }
ends

state troopdying
    iffloordistl 32 { ifactioncount 5 { cstat 0 iffloordistl 8 sound THUD ifrnd 64 spawn BLOODPOOL state rf strength 0 move TROOPSTOPPED action ATROOPDEAD } break }
    else { state rf move 0 action ATROOPDYING }
ends

state checktroophit
    ifaction ATROOPSUFFERING { stopsound LIZARD_BEG sound PRED_DYING cstat 0 strength 0 action ATROOPSUFFERDEAD break }
    ifdead
    {
        ifwasweapon FREEZEBLAST { sound SOMETHINGFROZE spritepal 1 move 0 action ATROOPFROZEN strength 0 break }

        state drop_ammo
        state random_wall_jibs
        addkills 1

        ifwasweapon RPG { sound SQUISHED state troop_body_jibs state standard_jibs state delete_enemy }
        else ifwasweapon RADIUSEXPLOSION { sound SQUISHED state troop_body_jibs state standard_jibs state delete_enemy }
        else { sound PRED_DYING ifrnd 32 iffloordistl 32 { sound LIZARD_BEG spawn BLOODPOOL strength 0 move 0 action ATROOPSUFFERING break } action ATROOPDYING break }
    }
    else
    {
        state random_wall_jibs
        sound PRED_PAIN
        ifwasweapon SHRINKSPARK { sound ACTOR_SHRINKING ai AITROOPSHRUNK }
        else iffloordistl 32 ifrnd 96 action ATROOPFLINTCH
    }
ends

state troopjetpackstate
    ifaction ATROOPJETPACKILL
    {
        ifcansee ifactioncount 2
        {
            resetactioncount
            sound PRED_ATTACK
            shoot FIRELASER
        }

        ifp phigher ai AITROOPJETPACK
        else ifinwater ai AITROOPJETPACK
        else ifcount 26 iffloordistl 32 ai AITROOPSEEKPLAYER
    }
    else ifcount 48 ifcansee
        { action ATROOPJETPACKILL move TROOPJETPACKILLVELS seekplayer }
ends

state checksquished
    ifsquished { addkills 1 sound SQUISHED state standard_jibs spawn OOZ state delete_enemy }
ends

state troopsufferingstate
    ifactioncount 2
    {
        ifrnd 16 spawn WATERDRIP
        ifactioncount 14 { stopsound LIZARD_BEG cstat 0 strength 0 action ATROOPSUFFERDEAD break }
    }
ends

state troopshrunkstate
    ifcount SHRUNKDONECOUNT ai AITROOPSEEKENEMY
    else ifcount SHRUNKCOUNT sizeto 48 40
    else state genericshrunkcode
ends

state troopcode fall
    ifinwater ifrnd 1 spawn WATERBUBBLE
    ifaction ATROOPSTAND { ifrnd 192 ai AITROOPSHOOTING else ai AITROOPSEEKPLAYER }
    else ifaction ATROOPFROZEN
    {
        ifcount THAWTIME { ai AITROOPSEEKENEMY getlastpal }
        else ifcount FROZENDRIPTIME { ifactioncount 26 { spawn WATERDRIP resetactioncount } }
        ifhitweapon
        {
            ifwasweapon FREEZEBLAST { strength 0 break }
            addkills 1

            ifrnd 84 spawn BLOODPOOL
            lotsofglass 30
            sound GLASS_BREAKING
            killit
        }
        ifp pfacing ifpdistl FROZENQUICKKICKDIST pkick
        break
    }
    else ifaction ATROOPPLAYDEAD
    {
        ifhitweapon
        {
            ifwasweapon RADIUSEXPLOSION { sound SQUISHED state troop_body_jibs state standard_jibs state delete_enemy }
            break
        }
        else state checksquished

        ifcount PLAYDEADTIME { addkills -1 soundonce PRED_ROAM cstat 257 strength 1 ai AITROOPSHOOTING }
        else ifp pfacing resetcount

        break
    }
    else ifaction ATROOPDEAD
    {
        strength 0
        ifrespawn ifcount RESPAWNACTORTIME { spawn TRANSPORTERSTAR cstat 257 strength TROOPSTRENGTH ai AITROOPSEEKENEMY }
        ifhitweapon
        {
            ifwasweapon RADIUSEXPLOSION { sound SQUISHED state troop_body_jibs state standard_jibs state delete_enemy }
            break
        }
        else state checksquished
        break
    }
    else ifaction ATROOPSUFFERDEAD
    {
        ifactioncount 2
        {
            ifrnd 64 { resetcount action ATROOPPLAYDEAD }
            else { soundonce PRED_DYING action ATROOPDEAD }
        }
    }
    else ifaction ATROOPDYING { state troopdying break }
    else ifaction ATROOPSUFFERING
        { state troopsufferingstate ifhitweapon state checktroophit break }
    else ifaction ATROOPFLINTCH { ifactioncount 4 ai AITROOPSEEKENEMY }
    else
    {
        ifai AITROOPSEEKPLAYER state troopseekstate
        else ifai AITROOPJETPACK
        {
            state troopjetpackstate
            ifinwater { } else soundonce DUKE_JETPACK_IDLE
        }
        else ifai AITROOPSEEKENEMY state troopseekstate
        else ifai AITROOPSHOOTING state troopshootstate
        else ifai AITROOPFLEEING state troopfleestate
        else ifai AITROOPFLEEINGBACK state troopfleestate
        else ifai AITROOPDODGE state troopseekstate
        else ifai AITROOPDUCKING state troopduckstate
        else ifai AITROOPSHRUNK state troopshrunkstate
        else ifai AITROOPHIDE { state troophidestate break }
    }

    ifhitweapon state checktroophit else state checksquished
ends


actor LIZTROOPJETPACK TROOPSTRENGTH ai AITROOPJETPACK cactor LIZTROOP enda
actor LIZTROOPDUCKING TROOPSTRENGTH
    ai AITROOPDUCKING cactor LIZTROOP
    ifgapzl 48 move DONTGETUP
enda

actor LIZTROOPSHOOT TROOPSTRENGTH ATROOPSTAND ai AITROOPSHOOTING cactor LIZTROOP enda
actor LIZTROOPSTAYPUT TROOPSTRENGTH ATROOPSTAYSTAND ai AITROOPSEEKPLAYER cactor LIZTROOP enda
actor LIZTROOPRUNNING TROOPSTRENGTH ATROOPSTAND ai AITROOPSEEKPLAYER cactor LIZTROOP enda
actor LIZTROOPONTOILET TROOPSTRENGTH ifcount 24 { sound FLUSH_TOILET operate ai AITROOPSEEKPLAYER cactor LIZTROOP } enda
actor LIZTROOP TROOPSTRENGTH ATROOPSTAND state troopcode enda

action ALIZWALKING       0     4    5    1    15
action ALIZRUNNING       0     4    5    1    11
action ALIZTHINK         20    2    5    1    40
action ALIZSCREAM        30    1    5    1    2
action ALIZJUMP          45    3    5    1    20
action ALIZFALL          55
action ALIZSHOOTING      70    2    5    1    7
action ALIZDYING         60    6    1    1    15
action ALIZLYINGDEAD     65    1
action ALIZFROZEN         0    1    5

move LIZWALKVEL 72
move LIZRUNVEL 192
move LIZJUMPVEL 184
move LIZSTOP

ai AILIZGETENEMY ALIZWALKING LIZWALKVEL seekplayer
ai AILIZDODGE ALIZRUNNING LIZRUNVEL dodgebullet
ai AILIZCHARGEENEMY ALIZRUNNING LIZRUNVEL seekplayer
ai AILIZFLEENEMY ALIZWALKING LIZWALKVEL fleeenemy
ai AILIZSHOOTENEMY ALIZSHOOTING LIZSTOP faceplayer
ai AILIZJUMPENEMY ALIZJUMP LIZJUMPVEL jumptoplayer
ai AILIZTHINK ALIZTHINK LIZSTOP faceplayerslow
ai AILIZSHRUNK ALIZWALKING SHRUNKVELS fleeenemy
ai AILIZSPIT ALIZSCREAM LIZSTOP faceplayerslow
ai AILIZDYING ALIZDYING LIZSTOP faceplayer

state lizseekstate

    ifactornotstayput
    {
        ifcansee ifp palive ifpdistl 2048 ifcount 16 ifcanshoottarget { ai AILIZSHOOTENEMY break }
        ifai AILIZCHARGEENEMY
        {
            ifcount 72 ifcanshoottarget { ai AILIZSHOOTENEMY break }
            ifp phigher ifpdistg 2048 ifrnd 6 { ai AILIZJUMPENEMY break }
        }
        else ifpdistg 4096 { ifrnd 92 { ifcount 48 ifcanshoottarget ai AILIZSHOOTENEMY } else ifcount 24 { ai AILIZCHARGEENEMY break } }

        iffloordistl 16 { ifcount 48 ifnotmoving ifcansee { ai AILIZJUMPENEMY break } }
        else { ifpdistg 1280 ai AILIZJUMPENEMY break }

        ifrnd 4 ifnotmoving operate
        else ifrnd 1 ifbulletnear
        {
            ifgapzl 128 ai AILIZDODGE
            else ifactornotstayput { ifrnd 32 ai AILIZJUMPENEMY else ai AILIZDODGE }
        }
    }
    else
    {
        ifactioncount 16 { ifp palive ifrnd 32 ifcansee ifcanshoottarget ai AILIZSHOOTENEMY }
        ifcount 16 ifrnd 32 move LIZWALKVEL randomangle geth
    }

ends

state lizshrunkstate
    ifcount SHRUNKDONECOUNT ai AILIZGETENEMY
    else ifcount SHRUNKCOUNT sizeto 48 40
    else state genericshrunkcode
ends

state lizfleestate
    ifcount 16 { ifrnd 48 ifp palive ifcansee ai AILIZSPIT }
    else { iffloordistl 16 { } else ai AILIZGETENEMY break }
ends

state lizthinkstate
    ifrnd 8 soundonce CAPT_ROAM
    ifactioncount 3
    {
        ifrnd 32 ifp palive ifcansee ai AILIZSPIT
        else ifrnd 96 ai AILIZGETENEMY
    }
    else ifactioncount 2 ifrnd 1 spawn FECES
    ifrnd 1 ifbulletnear
    {
        ifgapzl 96 ai AILIZDODGE
        else { ifrnd 128 ai AILIZJUMPENEMY else ai AILIZDODGE }
    }
ends

state lizshootstate
    ifcount 20 ifrnd 8
    {
        ifcansee ifpdistl 2048 { ifrnd 128 ai AILIZFLEENEMY break }
        ifrnd 80 ai AILIZTHINK else ai AILIZGETENEMY
    }
    ifactioncount 2
    {
        ifcansee
        {
            ifcanshoottarget { sound CAPT_ATTACK shoot SHOTSPARK1 resetactioncount }
            else ai AILIZTHINK
        }
        else ai AILIZGETENEMY
    }
ends

state checklizhit
    spawn BLOOD
    ifai AILIZSHRUNK
        { addkills 1 sound SQUISHED state standard_jibs state delete_enemy }
    ifdead
    {
        ifwasweapon FREEZEBLAST { sound SOMETHINGFROZE spritepal 1 move 0 action ALIZFROZEN strength 0 break }

        state drop_chaingun
        addkills 1

        ifwasweapon RPG { sound SQUISHED state liz_body_jibs state standard_jibs state delete_enemy }
        else ifwasweapon RADIUSEXPLOSION { sound SQUISHED state liz_body_jibs state standard_jibs state delete_enemy }
        else { state rf ai AILIZDYING ifrnd 64 spawn BLOODPOOL }
        sound CAPT_DYING
    }
    else
    {
        sound CAPT_PAIN
        ifwasweapon SHRINKSPARK { sound ACTOR_SHRINKING ai AILIZSHRUNK break }
        state random_wall_jibs
        ifp palive ifcansee ifcanshoottarget { ai AILIZSHOOTENEMY break }
    }
ends

state lizjumpstate
    ifaction ALIZFALL { iffloordistl 16 ai AILIZGETENEMY }
    else ifactioncount 3 action ALIZFALL
ends

state lizdyingstate
    ifaction ALIZLYINGDEAD
    {
        strength 0
        ifhitweapon ifwasweapon RADIUSEXPLOSION { sound SQUISHED state standard_jibs state delete_enemy }
        ifcount RESPAWNACTORTIME ifrespawn
        {
            spawn TRANSPORTERSTAR cstat 257 strength LIZSTRENGTH ai AILIZGETENEMY
        }
    }
    else ifai AILIZDYING ifactioncount 6 { iffloordistl 8 sound THUD move LIZSTOP action ALIZLYINGDEAD }
ends

state lizdodgestate
    ifcount 13 ai AILIZGETENEMY
ends

actor LIZMANSTAYPUT LIZSTRENGTH ai AILIZGETENEMY cactor LIZMAN enda
actor LIZMANSPITTING LIZSTRENGTH ai AILIZSPIT cactor LIZMAN enda
actor LIZMANJUMP LIZSTRENGTH ai AILIZJUMPENEMY cactor LIZMAN enda

actor LIZMAN LIZSTRENGTH fall
    state checksquished
    ifai 0 ai AILIZGETENEMY
    else ifaction ALIZLYINGDEAD { fall state lizdyingstate break }
    else ifaction ALIZFROZEN
    {
        ifcount THAWTIME { ai AILIZGETENEMY getlastpal }
        else ifcount FROZENDRIPTIME { ifactioncount 26 { spawn WATERDRIP resetactioncount } }

        ifhitweapon
        {
            ifwasweapon FREEZEBLAST { strength 0 break }
            addkills 1

            ifrnd 84 spawn BLOODPOOL
            lotsofglass 30
            sound GLASS_BREAKING
            killit
        }
        ifp pfacing ifpdistl FROZENQUICKKICKDIST pkick
        break
    }
    else ifai AILIZJUMPENEMY state lizjumpstate
    else
    {
        fall
        ifai AILIZGETENEMY state lizseekstate
        else ifai AILIZCHARGEENEMY state lizseekstate
        else ifai AILIZDODGE state lizdodgestate
        else ifai AILIZSHOOTENEMY state lizshootstate
        else ifai AILIZFLEENEMY state lizfleestate
        else ifai AILIZTHINK state lizthinkstate
        else ifai AILIZSHRUNK state lizshrunkstate
        else ifai AILIZDYING state lizdyingstate
        else ifai AILIZSPIT
            { ifcount 26 ai AILIZGETENEMY else ifcount 18 ifrnd 96 { shoot SPIT sound LIZARD_SPIT } }
    }

    ifai AILIZSHRUNK break
    ifhitweapon state checklizhit
enda

action DRONEFRAMES     0   1   7   1   1
action DRONESCREAM     0   1   7   1   1
move DRONERUNVELS 128 64
move DRONERUNUPVELS 128 -64
move DRONEBULLVELS 252 -64
move DRONEBACKWARDS -64 -64
move DRONERISE 32 -32
move DRONESTOPPED -16

ai AIDRONEGETE DRONESCREAM DRONERUNVELS faceplayerslow getv
ai AIDRONEWAIT DRONEFRAMES DRONESTOPPED faceplayerslow
ai AIDRONEGETUP DRONESCREAM DRONERUNUPVELS faceplayer getv
ai AIDRONEPULLBACK DRONEFRAMES DRONEBACKWARDS faceplayerslow
ai AIDRONEHIT DRONESCREAM DRONEBACKWARDS faceplayer
ai AIDRONESHRUNK DRONEFRAMES SHRUNKVELS fleeenemy
ai AIDRONEDODGE DRONEFRAMES DRONEBULLVELS dodgebullet geth
ai AIDRONEDODGEUP DRONEFRAMES DRONERISE getv geth

state checkdronehitstate

    ifdead
    {
        addkills 1
        debris SCRAP1 8
        debris SCRAP2 4
        debris SCRAP3 7
        spawn EXPLOSION2
        sound RPG_EXPLODE
        hitradius 2048 15 20 25 30
        killit
    }
    else
    {
        sound DRON_PAIN
        ifbulletnear
        {
            ifceilingdistl 64 ifrnd 48 ai AIDRONEDODGE
            ai AIDRONEDODGEUP
        }
        else ai AIDRONEGETE
    }
ends

state droneshrunkstate
    ifcount 24 state delete_enemy
    else sizeto 1 1
ends

state checkdronenearplayer

    ifp palive ifpdistl 1596
    {
        ifcount 8
        {
            addkills 1
            sound DRON_ATTACK2
            debris SCRAP1 8
            debris SCRAP2 4
            debris SCRAP3 7
            spawn EXPLOSION2
            sound RPG_EXPLODE
            hitradius 2048 15 20 25 30
            killit
        }
        else ifcount 3 { } else sound LASERTRIP_ARMING
    }

ends

state dronegetstate
    ifrnd 192
    {
        ifcansee
        {
            ifbulletnear { ai AIDRONEDODGE break }
            ifmove DRONEBULLVELS
            {
                ifcount 64 ai AIDRONEPULLBACK
                else ifnotmoving ifcount 16 ai AIDRONEPULLBACK
            }
            else ifcount 32
            {
                ifp phigher move DRONEBULLVELS geth getv
                else move DRONEBULLVELS geth
            }
        }
        else ifrnd 1 operate
    }
ends

state dronedodgestate
    ifai AIDRONEDODGEUP
    {
       ifcount 8 ai AIDRONEGETE
       else ifnotmoving ai AIDRONEGETE
    }
    else
    {
        ifcount 8 ai AIDRONEGETE
        else ifnotmoving ai AIDRONEGETE
    }
ends

actor DRONE DRONESTRENGTH
    state checksquished
    state checkdronenearplayer

    ifrnd 2 fall
    else soundonce DRON_JETSND

    ifaction 0 ai AIDRONEGETE

    else ifai AIDRONEWAIT
    {
        ifactioncount 4 ifrnd 16
            ifcansee { sound DRON_ATTACK1 ifp phigher ai AIDRONEGETUP else ai AIDRONEGETE }
    }
    else ifai AIDRONEGETE state dronegetstate
    else ifai AIDRONEGETUP state dronegetstate
    else ifai AIDRONEPULLBACK { ifcount 32 ai AIDRONEWAIT }
    else ifai AIDRONEHIT { ifcount 8 ai AIDRONEWAIT }
    else ifai AIDRONESHRUNK state droneshrunkstate
    else ifai AIDRONEDODGE state dronedodgestate
    else ifai AIDRONEDODGEUP state dronedodgestate

    ifhitweapon state checkdronehitstate

    ifrnd 1 soundonce DRON_ROAM

enda



action AOCTAWALK        0   3   5   1   15
action AOCTASTAND       0   1   5   1   15
action AOCTASCRATCH     0   4   5   1   15
action AOCTAHIT        30   1   1   1   10
action AOCTASHOOT      20   1   5   1   10
action AOCTADYING      30   8   1   1   17
action AOCTADEAD       38   1   1   1    1
action AOCTAFROZEN      0   1   5

move OCTAWALKVELS 96 -30
move OCTAUPVELS 96 -70
move OCTASTOPPED 0 -30
move OCTAINWATER 96 24

ai AIOCTAGETENEMY AOCTAWALK OCTAWALKVELS seekplayer
ai AIOCTASHOOTENEMY AOCTASHOOT OCTASTOPPED faceplayer
ai AIOCTASCRATCHENEMY AOCTASCRATCH OCTASTOPPED faceplayer
ai AIOCTAHIT AOCTAHIT OCTASTOPPED faceplayer
ai AIOCTASHRUNK AOCTAWALK SHRUNKVELS faceplayer
ai AIOCTADYING AOCTADYING OCTASTOPPED faceplayer

state octagetenemystate

    ifcansee
    {
        ifactioncount 32 { ifrnd 48 ifcanshoottarget { sound OCTA_ATTACK1 ai AIOCTASHOOTENEMY break } }
        else ifpdistl 1280 ai AIOCTASCRATCHENEMY
    }

ends

state octascratchenemystate
    ifpdistg 1280 ai AIOCTAGETENEMY
    else ifcount 32 { resetcount sound OCTA_ATTACK2 palfrom 8 32 addphealth OCTASCRATCHINGPLAYER }
ends

state octashootenemystate
    ifcount 25 { ifcount 27 ai AIOCTAGETENEMY }
    else ifcount 24 shoot COOLEXPLOSION1
    else ifactioncount 6 resetactioncount
ends

state checkoctahitstate
    ifwasweapon SHRINKSPARK { sound ACTOR_SHRINKING ai AIOCTASHRUNK }
    else
    {
        ifdead
        {
            ifwasweapon FREEZEBLAST { sound SOMETHINGFROZE spritepal 1 move 0 action AOCTAFROZEN strength 0 break }

            addkills 1
            ifwasweapon RPG { sound SQUISHED state standard_jibs state delete_enemy }
            else ifwasweapon RADIUSEXPLOSION { sound SQUISHED state standard_jibs state delete_enemy }
            else { state rf ai AIOCTADYING }
            sound OCTA_DYING
        }
        else
        {
            ifwasweapon RPG
            {
                sound OCTA_DYING
                addkills 1
                state standard_jibs
                killit
            }
            sound OCTA_PAIN spawn BLOOD
            ifrnd 64 ai AIOCTAHIT

        }
    }
    state random_wall_jibs
ends

state octashrunkstate
    ifcount SHRUNKDONECOUNT ai AILIZGETENEMY
    else ifcount SHRUNKCOUNT sizeto 48 40
    else state genericshrunkcode
ends

state octadyingstate
    ifactioncount 8 { ifrnd 64 spawn BLOODPOOL move OCTASTOPPED action AOCTADEAD break }
    else ifactioncount 5 { } else ifactioncount 4 iffloordistl 8 sound THUD
ends

actor OCTABRAINSTAYPUT OCTASTRENGTH ai AIOCTAGETENEMY cactor OCTABRAIN enda

actor OCTABRAIN OCTASTRENGTH fall

    state checksquished

    ifai 0 ai AIOCTAGETENEMY
    else ifaction AOCTADEAD
    {
        strength 0
        ifcount RESPAWNACTORTIME ifrespawn
            { addkills -1 spawn TRANSPORTERSTAR cstat 257 strength OCTASTRENGTH ai AIOCTAGETENEMY }
        ifhitweapon ifwasweapon RADIUSEXPLOSION { state standard_jibs killit }
        break
    }
    else ifaction AOCTAFROZEN
    {
        ifcount THAWTIME { ai AIOCTAGETENEMY getlastpal }
        else ifcount FROZENDRIPTIME { ifactioncount 26 { spawn WATERDRIP resetactioncount } }

        ifhitweapon
        {
            addkills 1
            ifwasweapon FREEZEBLAST { strength 0 break }

            lotsofglass 30
            ifrnd 84 spawn BLOODPOOL
            sound GLASS_BREAKING
            killit
        }
        ifp pfacing ifpdistl FROZENQUICKKICKDIST pkick
        break
    }
    else
    {
        ifrnd 1 soundonce OCTA_ROAM

        ifai AIOCTAGETENEMY state octagetenemystate
        else ifai AIOCTAHIT { ifcount 8 ai AIOCTASHOOTENEMY }
        else ifai AIOCTADYING { state octadyingstate break }
        else ifai AIOCTASCRATCHENEMY state octascratchenemystate
        else ifai AIOCTASHOOTENEMY state octashootenemystate
        else ifai AIOCTASHRUNK state octashrunkstate

        ifmove OCTAUPVELS { } else ifp phigher move OCTAUPVELS seekplayer
        else ifmove OCTAINWATER { } else ifinwater move OCTAINWATER seekplayer

        ifhitweapon state checkoctahitstate
    }
enda

action APIGWALK         0  4 5 1 20
action APIGRUN          0  4 5 1 11
action APIGSHOOT        30 2 5 1 58
action APIGCOCK         25 1 5 1 16
action APIGSTAND        30 1 5 1 1
action APIGDIVE         40 2 5 1 40
action APIGDIVESHOOT    45 2 5 1 58
action APIGDYING        55 5 1 1 15
action APIGHIT          55 1 1 1 10
action APIGDEAD         60 1 1 1 1
action APIGFROZEN        0 1 5

move PIGWALKVELS 72
move PIGRUNVELS 108
move PIGSTOPPED

ai AIPIGSEEKENEMY APIGWALK PIGWALKVELS seekplayer
ai AIPIGSHOOTENEMY APIGSHOOT PIGSTOPPED faceplayer
ai AIPIGFLEEENEMY APIGWALK PIGWALKVELS fleeenemy
ai AIPIGSHOOT APIGSHOOT PIGSTOPPED faceplayer
ai AIPIGDODGE APIGRUN PIGRUNVELS dodgebullet
ai AIPIGCHARGE APIGRUN PIGRUNVELS seekplayer
ai AIPIGDIVING APIGDIVE PIGSTOPPED faceplayer
ai AIPIGDYING APIGDYING PIGSTOPPED faceplayer
ai AIPIGSHRINK APIGWALK SHRUNKVELS fleeenemy
ai AIPIGHIT APIGHIT PIGSTOPPED faceplayer

state pigseekenemystate

    ifai AIPIGCHARGE
    {
        ifcansee ifpdistl 3084
        {
            ifnotmoving ai AIPIGSEEKENEMY
            else ai AIPIGDIVING
        }
        break
    }
    else iffloordistl 32
    {
        ifpdistg 4096 { ifactornotstayput ai AIPIGCHARGE }
        ifrnd 8 { ifbulletnear ai AIPIGDODGE }
    }

    ifrnd 128 ifcansee
    {
        ifai AIPIGDODGE { ifcount 32 ai AIPIGCHARGE break }
        iffloordistl 32
        {
            ifpdistl 1024 ifp palive ifcanshoottarget
                { ai AIPIGSHOOTENEMY break }
            ifcount 48 { ifrnd 8 ifp palive ifcanshoottarget { ifrnd 192 ai AIPIGSHOOTENEMY else ai AIPIGDIVING break } }
        }
    }
ends


state pigshootenemystate
//    ifcansee
    {
        ifcount 12 { } else ifcount 11
        {
            ifcanshoottarget { sound PIG_ATTACK shoot SHOTGUN shoot SHOTGUN shoot SHOTGUN shoot SHOTGUN shoot SHOTGUN }
            else ai AIPIGSEEKENEMY
        }
        ifcount 25 { } else ifcount 24 { action APIGCOCK sound SHOTGUN_COCK }
        ifcount 48 { } else ifcount 47
        {
            ifcanshoottarget { sound PIG_ATTACK shoot SHOTGUN shoot SHOTGUN shoot SHOTGUN shoot SHOTGUN shoot SHOTGUN }
            else ai AIPIGSEEKENEMY
        }
        ifcount 60 { } else ifcount 59 { action APIGCOCK sound SHOTGUN_COCK }
        ifcount 72
        {
            ifrnd 64 resetcount
            else
            {
                ifpdistl 768 ai AIPIGFLEEENEMY
                else ai AIPIGSEEKENEMY
            }
        }
        ifaction APIGCOCK ifactioncount 2 action APIGSHOOT
    }
    else ai AIPIGSEEKENEMY
ends

state pigfleeenemystate
    ifactioncount 8 ai AIPIGSEEKENEMY
    else ifnotmoving ai AIPIGSEEKENEMY
ends

state pigdivestate
    ifaction APIGDIVESHOOT
    {
        ifcansee
        {
            ifcount 12 { } else ifcount 11
            {
                ifcanshoottarget { sound PIG_ATTACK shoot SHOTGUN shoot SHOTGUN shoot SHOTGUN shoot SHOTGUN }
                else ai AIPIGSEEKENEMY
            }
            ifcount 25 { } else ifcount 24 { sound SHOTGUN_COCK }
            ifcount 48 { } else ifcount 47
            {
                ifcanshoottarget { sound PIG_ATTACK shoot SHOTGUN shoot SHOTGUN shoot SHOTGUN shoot SHOTGUN }
                else ai AIPIGSEEKENEMY
            }
            ifcount 60 { } else ifcount 59
            {
                sound SHOTGUN_COCK
                ifgapzl 32 ai AIPIGDIVING
                else
                {
                    ifpdistl 4096 ai AIPIGFLEEENEMY
                    else ai AIPIGSEEKENEMY
                }
            }
        }
        else ifgapzl 32 ai AIPIGDIVING else ai AIPIGSEEKENEMY
    }
    else ifactioncount 2 ifp palive { resetcount action APIGDIVESHOOT }
ends

state checkpighitstate
    spawn BLOOD
    ifdead
    {
        state random_wall_jibs
        ifrnd 16 spawn SHIELD else state drop_shotgun
        ifwasweapon FREEZEBLAST { sound SOMETHINGFROZE spritepal 1 move 0 action APIGFROZEN strength 0 break }

        addkills 1
        ifwasweapon RADIUSEXPLOSION { sound SQUISHED state standard_jibs state delete_enemy }
        else ifwasweapon RPG { sound SQUISHED state standard_jibs state delete_enemy }
        ai AIPIGDYING sound PIG_DYING
    }
    else
    {
        sound PIG_PAIN
        state random_wall_jibs

        ifwasweapon SHRINKSPARK { sound ACTOR_SHRINKING ai AIPIGSHRINK }
        else ifrnd 64 ai AIPIGHIT
        else ifrnd 64 ai AIPIGSHOOTENEMY
        else ifrnd 64 { ai AIPIGDIVING action APIGDIVESHOOT }
    }
ends

state pigshrinkstate
    ifcount SHRUNKDONECOUNT ai AIPIGSEEKENEMY
    else ifcount SHRUNKCOUNT sizeto 48 40
    else state genericshrunkcode
ends

state pigdyingstate
    ifactioncount 5 { ifrnd 64 spawn BLOODPOOL state rf iffloordistl 8 sound THUD action APIGDEAD move PIGSTOPPED break }
ends



actor PIGCOPDIVE PIGCOPSTRENGTH ai AIPIGDIVING action APIGDIVESHOOT cactor PIGCOP enda
actor PIGCOPSTAYPUT PIGCOPSTRENGTH ai AIPIGSEEKENEMY cactor PIGCOP enda
actor PIGCOP PIGCOPSTRENGTH APIGSTAND fall
    state checksquished
    ifaction APIGSTAND ai AIPIGSEEKENEMY
    else ifaction APIGDEAD
    {
        ifrespawn ifcount RESPAWNACTORTIME
            { spawn TRANSPORTERSTAR cstat 257 strength PIGCOPSTRENGTH ai AIPIGSEEKENEMY }
        else { strength 0 ifhitweapon ifwasweapon RADIUSEXPLOSION { sound SQUISHED state standard_jibs state delete_enemy } break }
    }
    else ifaction APIGFROZEN
    {
        ifcount THAWTIME { ai AIPIGSEEKENEMY getlastpal }
        else ifcount FROZENDRIPTIME ifrnd 8 spawn WATERDRIP

        ifhitweapon
        {
            ifwasweapon FREEZEBLAST { strength 0 break }
            addkills 1

            lotsofglass 30
            ifrnd 84 spawn BLOODPOOL
            sound GLASS_BREAKING
            killit
        }
        ifp pfacing ifpdistl FROZENQUICKKICKDIST pkick
        break
    }
    else ifai AIPIGDYING state pigdyingstate
    else ifai AIPIGHIT { ifactioncount 3 ai AIPIGSEEKENEMY }
    else ifai AIPIGSHRINK state pigshrinkstate
    else
    {
        ifai AIPIGSEEKENEMY state pigseekenemystate
        else ifai AIPIGDODGE state pigseekenemystate
        else ifai AIPIGSHOOTENEMY state pigshootenemystate
        else ifai AIPIGFLEEENEMY state pigfleeenemystate
        else ifai AIPIGDIVING state pigdivestate
        else ifai AIPIGCHARGE state pigseekenemystate
        ifhitweapon state checkpighitstate
        ifrnd 1
        {
            ifrnd 32 soundonce PIG_ROAM
            else ifrnd 64 soundonce PIG_ROAM2
            else soundonce PIG_ROAM3
        }
    }
enda




action ABOSS1WALK                0  4  5  1  12
action ABOSS1FROZEN              30 1  5
action ABOSS1RUN                 0  6  5  1  5
action ABOSS1SHOOT               30 2  5  1  4
action ABOSS1LOB                 40 2  5  1  35
action ABOSS1DYING              50 5  1  1  50
action BOSS1FLINTCH             50 1  1  1  1
action ABOSS1DEAD               55

move PALBOSS1SHRUNKRUNVELS 32
move PALBOSS1RUNVELS 128
move BOSS1WALKVELS 208
move BOSS1RUNVELS 296
move BOSS1STOPPED

ai AIBOSS1SEEKENEMY ABOSS1WALK BOSS1WALKVELS seekplayer
ai AIBOSS1RUNENEMY ABOSS1RUN BOSS1RUNVELS faceplayer
ai AIBOSS1SHOOTENEMY ABOSS1SHOOT BOSS1STOPPED faceplayer
ai AIBOSS1LOBBED ABOSS1LOB BOSS1STOPPED faceplayer // faceplayersmart
ai AIBOSS1DYING ABOSS1DYING BOSS1STOPPED faceplayer
ai AIBOSS1PALSHRINK ABOSS1WALK PALBOSS1SHRUNKRUNVELS furthestdir

state boss1palshrunkstate
    ifcount SHRUNKDONECOUNT ai AITROOPSEEKENEMY
    else ifcount SHRUNKCOUNT sizeto 40 40
    else state genericshrunkcode
ends

state checkboss1seekstate
    ai AIBOSS1SEEKENEMY
    ifspritepal 0 { } else     // a fake way of doing a ifspritepal NOT.
        move PALBOSS1RUNVELS seekplayer
ends

state boss1runenemystate
    ifpdistl 2048 { ifp palive ai AIBOSS1SHOOTENEMY break }
    else ifcansee { ifactioncount 6 { ifcanshoottarget { resetactioncount sound BOS1_WALK } else ai AIBOSS1SEEKENEMY } }
    else ai AIBOSS1SEEKENEMY
ends

state boss1seekenemystate
    ifrnd 2 soundonce BOS1_ROAM
    else ifactioncount 6 { resetactioncount sound BOS1_WALK }

    ifpdistl 2548 ifp palive { ai AIBOSS1SHOOTENEMY break }

    ifcansee ifcount 32
    {
        ifrnd 32 { ifp palive ifcanshoottarget ai AIBOSS1SHOOTENEMY }
        else ifpdistg 2548 ifrnd 192
            ifcanshoottarget
            {
                ifrnd 64
                {
                    ai AIBOSS1RUNENEMY
                    ifspritepal 0 { } else move PALBOSS1RUNVELS seekplayer
                }
                else ai AIBOSS1LOBBED
            }
    }

ends

state boss1dyingstate
  ifaction ABOSS1DEAD
  {
      ifspritepal 0 break
      ifrespawn ifcount RESPAWNACTORTIME
          { spawn TRANSPORTERSTAR cstat 257 strength PIGCOPSTRENGTH state checkboss1seekstate }
      else { strength 0 ifhitweapon ifwasweapon RADIUSEXPLOSION { sound SQUISHED state standard_jibs state delete_enemy } break }
  }
  ifactioncount 5 { iffloordistl 8 sound THUD action ABOSS1DEAD cstat 0 ifspritepal 0 endofgame 52 }
ends

state boss1lobbedstate
    ifcansee
    {
        ifactioncount 2
        {
            resetactioncount
            sound BOS1_ATTACK2
            shoot MORTER
        }
        else ifcount 64 ifrnd 16 state checkboss1seekstate
    }
    else state checkboss1seekstate
ends

state boss1shootenemy
    ifcount 72 state checkboss1seekstate
    else ifaction ABOSS1SHOOT ifactioncount 2
    {
        sound BOS1_ATTACK1
        shoot SHOTSPARK1
        shoot SHOTSPARK1
        shoot SHOTSPARK1
        shoot SHOTSPARK1
        shoot SHOTSPARK1
        shoot SHOTSPARK1
        resetactioncount
    }
ends

state checkboss1hitstate
    ifrnd 2 spawn BLOODPOOL
    ifdead
    {
        ifspritepal 0 globalsound DUKE_TALKTOBOSSFALL
        else
        {
            ifrnd 64 globalsound DUKE_TALKTOBOSSFALL
            ifwasweapon FREEZEBLAST { sound SOMETHINGFROZE spritepal 1 move 0 action ABOSS1FROZEN strength 0 break }
        }

        sound BOS1_DYING

        addkills 1
        ai AIBOSS1DYING
    }
    else
    {
        ifrnd 32 { action BOSS1FLINTCH move 0 }

        ifspritepal 0 { }
        else ifwasweapon SHRINKSPARK { sound ACTOR_SHRINKING ai AIBOSS1PALSHRINK break }

        soundonce BOS1_PAIN

        debris SCRAP1 1
        guts JIBS6 1
    }
ends

state boss1code

    ifaction ABOSS1FROZEN
    {
        ifcount THAWTIME { ai AIBOSS1SEEKENEMY spritepal 21 }
        else ifcount FROZENDRIPTIME { ifactioncount 26 { spawn WATERDRIP resetactioncount } }

        ifhitweapon
        {
            ifwasweapon FREEZEBLAST { strength 0 break }
            addkills 1
            lotsofglass 30

            ifrnd 84 spawn BLOODPOOL
            sound GLASS_BREAKING
            killit
        }
        ifp pfacing ifpdistl FROZENQUICKKICKDIST pkick
        break
    }
    ifai 0 { ifspritepal 0 ai AIBOSS1RUNENEMY else { strength BOSS1PALSTRENGTH ai AIBOSS1SHOOTENEMY } }
    else ifaction BOSS1FLINTCH { ifactioncount 3 ai AIBOSS1SHOOTENEMY }
    else ifai AIBOSS1SEEKENEMY state boss1seekenemystate
    else ifai AIBOSS1RUNENEMY state boss1runenemystate
    else ifai AIBOSS1SHOOTENEMY state boss1shootenemy
    else ifai AIBOSS1LOBBED state boss1lobbedstate
    else ifai AIBOSS1PALSHRINK state boss1palshrunkstate

    ifai AIBOSS1DYING state boss1dyingstate
    else
    {
        ifhitweapon state checkboss1hitstate
        else ifp palive ifspritepal 0 ifpdistl 1280 { addphealth -1000 palfrom 63 63 }
    }
ends

actor BOSS1STAYPUT BOSS1STRENGTH cactor BOSS1 enda
actor BOSS1 BOSS1STRENGTH fall state boss1code enda


action ABOSS2WALK                0  4  5  1  30
action ABOSS2FROZEN              0  1  5
action ABOSS2RUN                 0  4  5  1  15
action ABOSS2SHOOT               20 2  5  1  15
action ABOSS2LOB                 30 2  5  1  105
action ABOSS2DYING              40 8  1  1  35
action BOSS2FLINTCH             40 1  1  1  1
action ABOSS2DEAD               48

move PALBOSS2SHRUNKRUNVELS 32
move PALBOSS2RUNVELS 84
move BOSS2WALKVELS 192
move BOSS2RUNVELS 256
move BOSS2STOPPED

ai AIBOSS2SEEKENEMY ABOSS2WALK BOSS2WALKVELS seekplayer
ai AIBOSS2RUNENEMY ABOSS2RUN BOSS2RUNVELS faceplayer
ai AIBOSS2SHOOTENEMY ABOSS2SHOOT BOSS2STOPPED faceplayer
ai AIBOSS2LOBBED ABOSS2LOB BOSS2STOPPED faceplayer
ai AIBOSS2DYING ABOSS2DYING BOSS2STOPPED faceplayer
ai AIBOSS2PALSHRINK ABOSS2WALK PALBOSS2SHRUNKRUNVELS furthestdir

state boss2palshrunkstate
    ifcount SHRUNKDONECOUNT ai AITROOPSEEKENEMY
    else ifcount SHRUNKCOUNT sizeto 40 40
    else state genericshrunkcode
ends

state checkboss2seekstate
    ai AIBOSS2SEEKENEMY
    ifspritepal 0 { } else     // a fake way of doing a ifspritepal NOT.
        move PALBOSS2RUNVELS seekplayer
ends

state boss2runenemystate
    ifcansee
    {
        ifactioncount 3 { ifcanshoottarget { resetactioncount sound BOS1_WALK } else ai AIBOSS2SEEKENEMY }
        ifcount 48 ifrnd 2 { ifp palive { sound BOS2_ATTACK ai AIBOSS2SHOOTENEMY } break }
    }
    else ai AIBOSS2SEEKENEMY
ends

state boss2seekenemystate
    ifrnd 2 soundonce BOS2_ROAM
    else ifactioncount 3 { resetactioncount sound BOS1_WALK }

    ifcansee ifcount 32 ifp palive ifrnd 48 ifcanshoottarget
    {
        ifrnd 64 ifpdistg 4096
        {
            ai AIBOSS2RUNENEMY
            ifspritepal 0 { }
            else move PALBOSS2RUNVELS seekplayer
            break
        }

        ifpdistl 10240 { ifrnd 128 { sound BOS2_ATTACK ai AIBOSS2LOBBED } }
        else { sound BOS2_ATTACK ai AIBOSS2SHOOTENEMY }
    }
ends

state boss2dyingstate
  ifaction ABOSS2DEAD
  {
      ifspritepal 0 break
      ifrespawn ifcount RESPAWNACTORTIME
          { spawn TRANSPORTERSTAR cstat 257 strength PIGCOPSTRENGTH state checkboss2seekstate }
      else { strength 0 ifhitweapon ifwasweapon RADIUSEXPLOSION { sound SQUISHED state standard_jibs state delete_enemy } break }
  }
  ifactioncount 8 { iffloordistl 8 sound THUD action ABOSS2DEAD cstat 0 ifspritepal 0 endofgame 52 }
ends

state boss2lobbedstate
    ifcansee
    {
        ifactioncount 2 resetactioncount
        else ifactioncount 1 { ifrnd 128 shoot COOLEXPLOSION1 }
        else ifcount 64 ifrnd 16 state checkboss2seekstate
    }
    else state checkboss2seekstate
ends

state boss2shootenemy
    ifcount 72 state checkboss2seekstate
    else ifaction ABOSS2SHOOT ifactioncount 2
    {
        shoot RPG
        resetactioncount
    }
ends

state checkboss2hitstate
    ifrnd 2 spawn BLOODPOOL
    ifdead
    {
        ifspritepal 0 globalsound DUKE_TALKTOBOSSFALL
        else
        {
            ifrnd 64 globalsound DUKE_TALKTOBOSSFALL
            ifwasweapon FREEZEBLAST { sound SOMETHINGFROZE spritepal 1 move 0 action ABOSS2FROZEN strength 0 break }
        }

        sound BOS2_DYING

        addkills 1

        ai AIBOSS2DYING
    }
    else
    {
        ifrnd 144
        {
            ifrnd 32 { action BOSS2FLINTCH move 0 }
            else { sound BOS2_ATTACK ai AIBOSS2SHOOTENEMY }
        }

        ifspritepal 0 { }
        else ifwasweapon SHRINKSPARK { sound ACTOR_SHRINKING ai AIBOSS2PALSHRINK break }

        soundonce BOS2_PAIN

        debris SCRAP1 1
        guts JIBS6 1
    }
ends

state boss2code

    ifaction ABOSS2FROZEN
    {
        ifcount THAWTIME { ai AIBOSS2SEEKENEMY spritepal 21 }
        else ifcount FROZENDRIPTIME { ifactioncount 26 { spawn WATERDRIP resetactioncount } }

        ifhitweapon
        {
            ifwasweapon FREEZEBLAST { strength 0 break }
            addkills 1

            lotsofglass 30
            sound GLASS_BREAKING
            ifrnd 84 spawn BLOODPOOL
            killit
        }
        ifp pfacing ifpdistl FROZENQUICKKICKDIST pkick
        break
    }
    ifai 0 { ifspritepal 0 ai AIBOSS2RUNENEMY else { strength 1 { sound BOS2_ATTACK ai AIBOSS2SHOOTENEMY } } }
    else ifaction BOSS2FLINTCH { ifactioncount 3 ai AIBOSS2SEEKENEMY }
    else ifai AIBOSS2SEEKENEMY state boss2seekenemystate
    else ifai AIBOSS2RUNENEMY state boss2runenemystate
    else ifai AIBOSS2SHOOTENEMY state boss2shootenemy
    else ifai AIBOSS2LOBBED state boss2lobbedstate
    else ifai AIBOSS2PALSHRINK state boss2palshrunkstate

    ifai AIBOSS2DYING state boss2dyingstate
    else
    {
        ifhitweapon state checkboss2hitstate
        else ifp palive ifspritepal 0 ifpdistl 1280 { addphealth -1000 palfrom 63 63 }
    }


ends

actor BOSS2 BOSS2STRENGTH fall state boss2code enda


action ABOSS3WALK                0  4  5  1  30
action ABOSS3FROZEN              0  1  5
action ABOSS3RUN                 0  4  5  1  15
action ABOSS3LOB                20 4  5  1  50
action ABOSS3LOBBING            30 2  5  1  15
action ABOSS3DYING              40 8  1  1  20
action BOSS3FLINTCH             40 1  1  1  1
action ABOSS3DEAD               48

move PALBOSS3SHRUNKRUNVELS 32
move PALBOSS3RUNVELS 84
move BOSS3WALKVELS 208
move BOSS3RUNVELS 270
move BOSS3STOPPED

ai AIBOSS3SEEKENEMY ABOSS3WALK BOSS3WALKVELS seekplayer
ai AIBOSS3RUNENEMY ABOSS3RUN BOSS3RUNVELS faceplayerslow
ai AIBOSS3LOBENEMY ABOSS3LOB BOSS3STOPPED faceplayer
ai AIBOSS3DYING ABOSS3DYING BOSS3STOPPED faceplayer
ai AIBOSS3PALSHRINK ABOSS3WALK PALBOSS3SHRUNKRUNVELS faceplayer

state boss3palshrunkstate
    ifcount SHRUNKDONECOUNT ai AITROOPSEEKENEMY
    else ifcount SHRUNKCOUNT sizeto 40 40
    else state genericshrunkcode
ends

state checkboss3seekstate
    ai AIBOSS3SEEKENEMY
    ifspritepal 0 { } else     // a fake way of doing a ifspritepal NOT.
        move PALBOSS3RUNVELS seekplayer
ends

state boss3runenemystate
    ifcansee { ifactioncount 3 { ifcanshoottarget { resetactioncount sound BOS1_WALK } else ai AIBOSS3SEEKENEMY } }
    else ai AIBOSS3SEEKENEMY
ends

state boss3seekenemystate
    ifrnd 2 soundonce BOS3_ROAM
    else ifactioncount 3 { resetactioncount sound BOS1_WALK }

    ifcansee ifcount 32 ifrnd 48 ifcanshoottarget
    {
        ifrnd 64
            ifpdistg 4096
            {
                ai AIBOSS3RUNENEMY
                ifspritepal 0 break
                move PALBOSS3RUNVELS seekplayer
                break
            }

        ifp palive
            ai AIBOSS3LOBENEMY
    }
ends

state boss3dyingstate
  ifaction ABOSS3DEAD
  {
      ifspritepal 0 break
      ifrespawn ifcount RESPAWNACTORTIME
          { spawn TRANSPORTERSTAR cstat 257 strength PIGCOPSTRENGTH state checkboss3seekstate }
      else { strength 0 ifhitweapon ifwasweapon RADIUSEXPLOSION { sound SQUISHED state standard_jibs state delete_enemy } break }
  }
  ifactioncount 8 { iffloordistl 8 sound THUD action ABOSS3DEAD cstat 0 ifspritepal 0 endofgame 52 }
ends

state boss3lobbedstate
    ifcansee
    {
        ifaction ABOSS3LOBBING
            ifactioncount 2
        {
            shoot RPG
            resetactioncount
            ifrnd 8 ai AIBOSS3SEEKENEMY
        }

        ifactioncount 3 { action ABOSS3LOBBING resetcount }
    }
    else state checkboss3seekstate
ends

state checkboss3hitstate
    ifrnd 2 spawn BLOODPOOL
    ifdead
    {
        ifspritepal 0 globalsound DUKE_TALKTOBOSSFALL
        else
        {
            ifrnd 64 globalsound DUKE_TALKTOBOSSFALL
            ifwasweapon FREEZEBLAST { sound SOMETHINGFROZE spritepal 1 move 0 action ABOSS3FROZEN strength 0 break }
        }

        addkills 1
        ai AIBOSS3DYING

        sound BOS3_DYING
        sound JIBBED_ACTOR9

    }
    else
    {
        ifrnd 32 { action BOSS3FLINTCH move 0 }

        ifspritepal 0 { }
        else ifwasweapon SHRINKSPARK { sound ACTOR_SHRINKING ai AIBOSS3PALSHRINK break }

        soundonce BOS3_PAIN

        debris SCRAP1 1
        guts JIBS6 1
    }
ends

state boss3code

    ifaction ABOSS3FROZEN
    {
        ifhitweapon
        {
            ifwasweapon FREEZEBLAST { strength 0 break }

            addkills 1
            lotsofglass 30

            ifrnd 84 spawn BLOODPOOL
            sound GLASS_BREAKING
            killit
        }
        ifp pfacing ifpdistl FROZENQUICKKICKDIST pkick
        break
    }
    ifai 0 { ifspritepal 0 ai AIBOSS3RUNENEMY else { strength 1 ai AIBOSS3LOBENEMY } }
    else ifaction BOSS3FLINTCH { ifactioncount 3 ai AIBOSS3SEEKENEMY }
    else ifai AIBOSS3SEEKENEMY state boss3seekenemystate
    else ifai AIBOSS3RUNENEMY state boss3runenemystate
    else ifai AIBOSS3LOBENEMY state boss3lobbedstate
    else ifai AIBOSS3PALSHRINK state boss3palshrunkstate

    ifai AIBOSS3DYING state boss3dyingstate
    else
    {
        ifhitweapon state checkboss3hitstate
        else ifp palive ifspritepal 0 ifpdistl 1280 { addphealth -1000 palfrom 63 63 }
    }
ends

actor BOSS3 BOSS3STRENGTH fall state boss3code enda


action ACOMMBREETH  0  3  5  1  40
action ACOMMFROZEN  0  1  5
action ACOMMSPIN   -5  1  5  1  12
action ACOMMGET     0  3  5  1  30
action ACOMMSHOOT  20  1  5   1 35
action ACOMMABOUTTOSHOOT 20 1 5 1 30
action ACOMMDYING  30  8  1  1  12
action ACOMMDEAD   38  1  1  1  1


move COMMGETUPVELS 128 -64
move COMMGETVELS 128 64
move COMMSLOW 64 24
move COMMSTOPPED

ai AICOMMWAIT ACOMMBREETH COMMSTOPPED faceplayerslow
ai AICOMMGET ACOMMGET COMMGETVELS seekplayer
ai AICOMMSHOOT ACOMMSHOOT COMMSTOPPED faceplayerslow
ai AICOMMABOUTTOSHOOT ACOMMABOUTTOSHOOT COMMSTOPPED faceplayerslow
ai AICOMMSPIN ACOMMSPIN COMMGETVELS spin
ai AICOMMDYING ACOMMDYING COMMSTOPPED faceplayer
ai AICOMMSHRUNK ACOMMGET COMMSLOW furthestdir

state checkcommhitstate

    ifhitweapon
    {

        guts JIBS6 2

        ifdead
        {
            ifwasweapon FREEZEBLAST { sound SOMETHINGFROZE spritepal 1 move 0 action ACOMMFROZEN strength 0 break }

            addkills 1

            ifwasweapon RADIUSEXPLOSION { spawn BLOODPOOL sound SQUISHED state standard_jibs state delete_enemy }
            else ifwasweapon RPG { sound SQUISHED spawn BLOODPOOL state standard_jibs state delete_enemy }

            sound COMM_DYING
            ai AICOMMDYING
        }
        else
        {
            soundonce COMM_PAIN
            ifwasweapon SHRINKSPARK { sound ACTOR_SHRINKING ai AICOMMSHRUNK }
            else ifrnd 24 ai AICOMMABOUTTOSHOOT
        }
    }
ends

actor COMMANDERSTAYPUT COMMANDERSTRENGTH cactor COMMANDER ai AICOMMABOUTTOSHOOT enda
actor COMMANDER COMMANDERSTRENGTH

    state checksquished

    ifaction ACOMMFROZEN
    {
        fall

        ifcount THAWTIME { getlastpal ai AICOMMWAIT }
        else ifcount FROZENDRIPTIME { ifactioncount 26 { spawn WATERDRIP resetactioncount } }

        ifhitweapon
        {
            ifwasweapon FREEZEBLAST { strength 0 break }
            addkills 1

            ifrnd 84 spawn BLOODPOOL
            lotsofglass 30
            sound GLASS_BREAKING
            killit
        }
        ifp pfacing ifpdistl FROZENQUICKKICKDIST pkick
        break
    }
    ifai 0 ai AICOMMSHOOT
    else ifai AICOMMWAIT { ifcount 20 { ifcansee { ifcanshoottarget { ifrnd 96 ai AICOMMGET else ai AICOMMABOUTTOSHOOT } } else ai AICOMMGET } }
    else ifai AICOMMABOUTTOSHOOT
    {
        ifactioncount 2 { ifcansee ai AICOMMSHOOT else { ai AICOMMGET break } }
        soundonce COMM_ATTACK
    }
    else ifai AICOMMSHOOT
    {
        ifcanshoottarget
        {
            ifcount 24 ifrnd 16 ai AICOMMWAIT
            ifactioncount 2 { shoot RPG resetactioncount }
        }
        else ai AICOMMGET
    }
    else ifai AICOMMSHRUNK
    {
        ifcount SHRUNKDONECOUNT ai AICOMMGET
        else ifcount SHRUNKCOUNT sizeto 48 40
        else state genericshrunkcode
    }
    else ifai AICOMMGET
    {
        ifnotmoving ifrnd 4 operate
        ifpdistl 1024 ifp palive { sound COMM_SPIN ai AICOMMSPIN break }

        ifcansee
        {
            ifp phigher move COMMGETUPVELS getv geth faceplayer
            else move COMMGETVELS getv geth faceplayer
        }
        ifactioncount 8 ifrnd 2 ai AICOMMABOUTTOSHOOT
    }
    else ifai AICOMMSPIN
    {
        soundonce COMM_SPIN
        ifcount 16
        {
            ifpdistl 1280 { addphealth CAPTSPINNINGPLAYER sound DUKE_GRUNT palfrom 32 16 resetcount }
            else ifpdistg 2300 ai AICOMMWAIT
        }
        ifactioncount 52 ai AICOMMWAIT
        ifnotmoving ifrnd 32 operate
    }

    ifai AICOMMDYING
    {
        fall
        strength 0

        ifhitweapon ifwasweapon RADIUSEXPLOSION
            { sound SQUISHED spawn BLOODPOOL state standard_jibs state delete_enemy }

        ifaction ACOMMDYING
            ifactioncount 8 { iffloordistl 8 sound THUD cstat 0 action ACOMMDEAD }
    }
    else
    {
        ifrnd 2 soundonce COMM_ROAM
        state checkcommhitstate
    }
enda



Around Wikia's network

Random Wiki