//---------------------------------------------------------------------------
// Script file for the 3rd level of the Chemical Plant Sabotage
// Geoffroy Audy, December 1th 1996
//---------------------------------------------------------------------------
define  EXPLOSION1 0
define  EXPLOSION2 1
define  EXPLOSION3 2
define  EXPLOSION4 3
define  EXPLOSION5 4
define  EXPLOSION6 5
define  BARREL1    6
define  BARREL2    7
define  BARREL3    8
define  FIREBALL1  9
define  FIREBALL2  10
define  FIREBALL3  11
define  FIRE1      12
define  FIRE2      13
define  FIRE3      14
define  FIRE4      15
define  FIRE5      16
define  HOLEFILL1  17
define  HOLEFILL2  18
define  HOLEFILL3  19
define  HOLEFILL4  20
define  BIGYELLO1  21
define  BIGYELLO2  22
define  BIGYELLO3  23
define  BIGYELLO4  24
define  BIGYELLO5  25
define  BIGYELLO6  26
define  BIGYELLO7  27
define  YELLOW1    28
define  YELLOW2    29
define  YELLOW3    30
define  YELLOW4    31
define  YELLOW5    32
define  YELLOW6    33
define  YELLOW7    34
define  YELLOW8    35
define  YELLOW9    36
define  YELLOW10   37
define  YELLOW11   38
define  YELLOW12   39
define  YELLOW13   40
define  YELLOW14   41
define  YELLOW15   42
define  YELLOW16   43
define  YELLOW17   44
define  YELLOW18   45
define  YELLOW19   46
define  YELLOW20   47
define  YELLOW21   48
define  YELLOW22   49
define  YELLOW23   50
define  YELLOW24   51
define  YELLOW25   52
define  YELLOW26   53
define  YELLOW27   54
define  CLOUD1     55
define  CLOUD2     56
define  CLOUD3     57
define  CLOUD4     58
define  CLOUD5     59
define  CLOUD6     60
define  HELICO1    61
define  HELICO2    62
define  HELICO3    63
define  HELICO4    64
define  HELICO5    65
define  HELICO6    66
define  HELICO7    67
define  HELICO8    68
define  HELICO9    69
define  HELICO10   70
define  HELICO11   71
define  HELICO12   72
define  HELICO13   73
define  HELICO14   74
define  HELICO15   75
define  HELICO16   76
define  HELICO17   77
define  HELICO18   78
define  PILOT      79
define  CROSSHAIR  80
define  MISSILE1   81
define  MISSILE2   82
define  MISSILE3   83
define  MISSILE4   84
define  MISSILE5   85
define  MISSILE6   86
define  TANKBASE1  87
define  TANKBASE2  88
define  TANKBASE3  89
define  TANKBASE4  90
define  TANKTOP1   91
define  TANKTOP2   92
define  TANKTOP3   93
define  TANKTOP4   94
define  LASER1     95
define  LASER2     96
define  LASER3     97
define  LASER4     98

define  L1         0            // Difficulty levels
define  L2         1
define  L3         2
define  L4         3
define  L5         4
define  L6         5
define  L7         6
define  L8         7

//-------------------------------------
// Start initialization
//-------------------------------------
loadBKD \BACKGRND\CHEMICAL\CHEMICL3.BKD         // BKD 0        Inst. 0
setBKDLoc 0 0 -240 0                            //
loadVAB \SOUNDFX\CHINA.VAB                      // Sound fx

loadKRT \SPRITES\CHEMICAL\LEVEL3\EXPLO.KRT      // Char 0
CloneCharacter EXPLOSION1                       // Char 1
CloneCharacter EXPLOSION1                       // Char 2
CloneCharacter EXPLOSION1                       // Char 3
CloneCharacter EXPLOSION1                       // Char 4
CloneCharacter EXPLOSION1                       // Char 5
SetScale EXPLOSION1 6000
SetScale EXPLOSION2 6000
SetScale EXPLOSION3 6000
SetScale EXPLOSION4 6000
SetScale EXPLOSION5 6000
SetScale EXPLOSION6 6000
loadKRT \SPRITES\CHEMICAL\LEVEL3\BARREL.KRT     // Char 6
ObjectCharacteristics BARREL1 1024              // Char 6 is an object
CloneCharacter BARREL1                          // Char 7
CloneCharacter BARREL1                          // Char 8
CloneCharacter EXPLOSION1                       // Char 9
CloneCharacter EXPLOSION1                       // Char 10
CloneCharacter EXPLOSION1                       // Char 11
loadKRT \SPRITES\CHEMICAL\LEVEL3\FIRE.KRT       // Char 12
ObjectCharacteristics FIRE1 17408
CloneCharacter FIRE1                            // Char 13
CloneCharacter FIRE1                            // Char 14
CloneCharacter FIRE1                            // Char 15
CloneCharacter FIRE1                            // Char 16
SetScale FIRE1 6000
SetScale FIRE2 6000
SetScale FIRE3 6000
SetScale FIRE4 6000
SetScale FIRE5 6000
SetDepth FIRE1 7
SetDepth FIRE2 6
SetDepth FIRE3 7
SetDepth FIRE4 6
SetDepth FIRE5 7
loadKRT \SPRITES\CHEMICAL\LEVEL3\PATCH2.KRT     // Char 17
ObjectCharacteristics HOLEFILL1 1024            // Char 17 is a gun
CloneCharacter HOLEFILL1                        // Char 18
CloneCharacter HOLEFILL1                        // Char 19
CloneCharacter HOLEFILL1                        // Char 20
loadKRT \SPRITES\CHEMICAL\LEVEL1\BIGYELLO.KRT   // Char 21
CloneCharacter BIGYELLO1                        // Char 22
CloneCharacter BIGYELLO1                        // Char 23
CloneCharacter BIGYELLO1                        // Char 24
CloneCharacter BIGYELLO1                        // Char 25
CloneCharacter BIGYELLO1                        // Char 26
CloneCharacter BIGYELLO1                        // Char 27
loadKRT \SPRITES\CHEMICAL\LEVEL1\YELLOW.KRT     // Char 28
CloneCharacter YELLOW1                          // Char 29
CloneCharacter YELLOW1                          // Char 30
CloneCharacter YELLOW1                          // Char 31
CloneCharacter YELLOW1                          // Char 32
CloneCharacter YELLOW1                          // Char 33
CloneCharacter YELLOW1                          // Char 34
CloneCharacter YELLOW1                          // Char 35
CloneCharacter YELLOW1                          // Char 36
CloneCharacter YELLOW1                          // Char 37
CloneCharacter YELLOW1                          // Char 38
CloneCharacter YELLOW1                          // Char 39
CloneCharacter YELLOW1                          // Char 40
CloneCharacter YELLOW1                          // Char 41
CloneCharacter YELLOW1                          // Char 42
CloneCharacter YELLOW1                          // Char 43
CloneCharacter YELLOW1                          // Char 44
CloneCharacter YELLOW1                          // Char 45
CloneCharacter YELLOW1                          // Char 46
CloneCharacter YELLOW1                          // Char 47
CloneCharacter YELLOW1                          // Char 48
CloneCharacter YELLOW1                          // Char 49
CloneCharacter YELLOW1                          // Char 50
CloneCharacter YELLOW1                          // Char 51
CloneCharacter YELLOW1                          // Char 52
CloneCharacter YELLOW1                          // Char 53
CloneCharacter YELLOW1                          // Char 54
SetScale YELLOW1 6000
SetScale YELLOW4 5600
SetScale YELLOW7 5800
SetScale YELLOW9 3800
SetScale YELLOW10 5800
SetScale YELLOW12 3900
SetScale YELLOW13 5400
SetScale YELLOW14 3800
SetScale YELLOW15 5400
SetScale YELLOW16 5400
SetScale YELLOW17 3900
SetScale YELLOW18 5400
SetScale YELLOW19 3900
SetScale YELLOW20 5400
SetScale YELLOW21 3900
SetScale YELLOW24 3900
SetScale YELLOW26 5400
loadKRT \SPRITES\CHEMICAL\LEVEL3\SKY.KRT        // Char 55
CloneCharacter CLOUD1                           // Char 56
CloneCharacter CLOUD1                           // Char 57
CloneCharacter CLOUD1                           // Char 58
CloneCharacter CLOUD1                           // Char 59
CloneCharacter CLOUD1                           // Char 60
loadKRT \SPRITES\CHEMICAL\LEVEL3\HELICO.KRT     // Char 61
ObjectCharacteristics HELICO1 129
CloneCharacter HELICO1                          // Char 62
CloneCharacter HELICO1                          // Char 63
CloneCharacter HELICO1                          // Char 64
CloneCharacter HELICO1                          // Char 65
CloneCharacter HELICO1                          // Char 66
CloneCharacter HELICO1                          // Char 67
CloneCharacter HELICO1                          // Char 68
CloneCharacter HELICO1                          // Char 69
CloneCharacter HELICO1                          // Char 70
CloneCharacter HELICO1                          // Char 71
CloneCharacter HELICO1                          // Char 72
CloneCharacter HELICO1                          // Char 73
CloneCharacter HELICO1                          // Char 74
CloneCharacter HELICO1                          // Char 75
CloneCharacter HELICO1                          // Char 76
CloneCharacter HELICO1                          // Char 77
CloneCharacter HELICO1                          // Char 78
ObjectCharacteristics HELICO1 16513
ObjectCharacteristics HELICO2 16513
ObjectCharacteristics HELICO3 16513
SetTotalHitPoints HELICO5 20
SetTotalHitPoints HELICO6 10
SetTotalHitPoints HELICO7 10
SetTotalHitPoints HELICO8 10
SetTotalHitPoints HELICO9 10
SetTotalHitPoints HELICO10 10
SetTotalHitPoints HELICO11 10
SetTotalHitPoints HELICO12 20
SetTotalHitPoints HELICO13 20
SetTotalHitPoints HELICO14 20
SetTotalHitPoints HELICO15 20
SetTotalHitPoints HELICO16 20
SetTotalHitPoints HELICO17 20
SetScale HELICO1 3072
loadKRT \SPRITES\CHEMICAL\LEVEL3\PILOT.KRT      // Char 79
ObjectCharacteristics PILOT 2176                // It's the boss!!!
loadKRT \SPRITES\CHEMICAL\LEVEL3\CROSHR.KRT     // Char 80
loadKRT \SPRITES\AIRPORT\LEVEL4\MISSILE.KRT     // Char 81
ObjectCharacteristics MISSILE1 1348             //
loadKRT \SPRITES\CHEMICAL\LEVEL3\MISSILE2.KRT   // Char 82
ObjectCharacteristics MISSILE2 1348             //
CloneCharacter MISSILE1                         // Char 83
CloneCharacter MISSILE2                         // Char 84
CloneCharacter MISSILE1                         // Char 85
CloneCharacter MISSILE2                         // Char 86
loadKRT \SPRITES\CHEMICAL\LEVEL3\TANK.KRT       // Char 87
ObjectCharacteristics TANKBASE1 17412           //
CloneCharacter TANKBASE1                        // Char 88
CloneCharacter TANKBASE1                        // Char 89
CloneCharacter TANKBASE1                        // Char 90
CloneCharacter TANKBASE1                        // Char 91
ObjectCharacteristics TANKTOP1 4                //
CloneCharacter TANKTOP1                         // Char 92
CloneCharacter TANKTOP1                         // Char 93
CloneCharacter TANKTOP1                         // Char 94
SetScale TANKBASE1 4500                         //
SetScale TANKTOP1  4500                         //
SetScale TANKBASE2 5000                         //
SetScale TANKTOP2  5000                         //
SetTotalHitPoints TANKTOP1 5                    //
SetTotalHitPoints TANKTOP2 5                    //
SetTotalHitPoints TANKTOP3 5                    //
SetTotalHitPoints TANKTOP4 5                    //
loadKRT \SPRITES\CHEMICAL\LEVEL3\LASER.KRT      // Char 95
ObjectCharacteristics LASER1 17476              //
CloneCharacter LASER1                           // Char 96
CloneCharacter LASER1                           // Char 97
CloneCharacter LASER1                           // Char 98

PlayTrack 505 7           // Play STAGE3

//-------------------------------------
// Bunch of links...
//-------------------------------------
Link BARREL2 BARREL3 1 1 1 0 404 367
Link BARREL3 BARREL1 1 1 1 0 476 367
Link BARREL1 BARREL2 1 1 1 0 440 375
Link FIREBALL1 BARREL1 2 1 0 0 440 365
Link FIREBALL2 BARREL2 2 1 0 0 404 357
Link FIREBALL3 BARREL3 2 1 0 0 476 357
Link FIRE1 FIREBALL1 0 2 1 0 225 375
Link FIRE2 FIREBALL1 0 2 1 0 300 370
Link FIRE3 FIREBALL1 0 2 1 0 375 375
Link FIRE4 FIREBALL1 0 2 1 0 450 370
Link FIRE5 FIREBALL1 0 2 1 0 525 375

//AssignProjectile TANKTOP1 LASER1
//AssignProjectile TANKTOP2 LASER2
//AssignProjectile TANKTOP3 LASER3
//AssignProjectile TANKTOP4 LASER4

//-------------------------------------
// Various objects
//-------------------------------------
StartActionXY BARREL1    0 440 375  7    0 0 L1
StartActionXY BARREL2    0 404 367  6    0 0 L1
StartActionXY BARREL3    0 476 367  6    0 0 L1

//-------------------------------------
// Enemy group #1
//-------------------------------------
StartActionXY BIGYELLO1  0 240 530 14   60 0 L1
StartActionXY YELLOW1    7 150 400  9  120 0 L1
StartActionXY YELLOW2    5 325 340  4  180 1 L1
StartActionXY YELLOW3   10 160 360  4  240 0 L1
StartActionXY YELLOW4    5 325 362  9  300 1 L1
StartActionXY YELLOW5    5 325 340  4  360 1 L1
StartActionXY YELLOW6    3 140 352  4  420 1 L1
StartActionXY BIGYELLO2  0  90 530 14  480 0 L1

ScrollBKDTo 0 -125 -240 125 540

//-------------------------------------
// Enemy group #2
//-------------------------------------
StartActionXY BIGYELLO3  0 225 530 14  600 0 L1
StartActionXY YELLOW7    7 150 400  9  660 0 L1
StartActionXY YELLOW8    7 160 360  4  720 0 L1
StartActionXY YELLOW9    9 455 335  4  780 1 L1
StartActionXY YELLOW10  10 150 395  9  840 0 L1
StartActionXY YELLOW11   3 420 360  4  900 0 L1
StartActionXY BIGYELLO4  0 375 530 14  960 0 L1
StartActionXY TANKBASE1  7 465 410  9 1020 1 L1
Attach TANKTOP1 TANKBASE1 0 1 1021 -5 -45  9 L1
StartActionXY YELLOW12   7 160 355  4 1080 0 L1
StartActionXY YELLOW13   5 455 365 11 1140 1 L1

ScrollBKDTo 0 -268 -240 143 1200

//-------------------------------------
// Enemy group #3
//-------------------------------------
StartActionXY BIGYELLO5  0 350 530 14 1260 0 L1
StartActionXY BIGYELLO6  0 510 530 14 1320 0 L1
StartActionXY YELLOW14   9 595 325  6 1380 1 L1
StartActionXY BARREL2    1 404 367  8 1400 0 L1
StartActionXY YELLOW15   9 263 375 11 1440 0 L1
StartActionXY BIGYELLO7  0 350 530 14 1500 0 L1
StartActionXY YELLOW16   7 595 390 11 1560 1 L1
StartActionXY YELLOW17   9 263 340  6 1620 0 L1
StartActionXY YELLOW18   5 263 375 11 1680 0 L1
StartActionXY YELLOW19   9 595 340  6 1740 1 L1
StartActionXY TANKBASE3  7 608 370  6 1800 1 L1
Attach TANKTOP3 TANKBASE3 0 1 1801 -5 -42  6 L1
StartActionXY YELLOW20   7 595 390 11 1860 1 L1
StartActionXY YELLOW21   9 263 340  6 1920 0 L1
StartActionXY TANKBASE2  7 245 425 12 1980 0 L1
Attach TANKTOP2 TANKBASE2 0 0 1981  5 -43 12 L1
StartActionXY YELLOW22  10 263 360  6 2040 0 L1
StartActionXY YELLOW23   7 590 350  6 2100 1 L1
StartActionXY TANKBASE4  7 245 370  6 2160 0 L1
Attach TANKTOP4 TANKBASE4 0 0 2161  5 -42  6 L1
StartActionXY YELLOW24   5 265 340  6 2220 0 L1
StartActionXY YELLOW25   9 595 340  7 2280 1 L1
StartActionXY YELLOW26   9 263 367 11 2340 0 L1
StartActionXY YELLOW27   7 595 350  7 2400 1 L1

ScrollBKDTo 0 -268 -240 0 2460

//-------------------------------------
// Other various objects
//-------------------------------------
StartActionXY HOLEFILL1  0 442  41 12 2461 0 L1
StartActionXY HOLEFILL2  1 442  80 12 2461 0 L1
StartActionXY HOLEFILL3  2 442 119 12 2461 0 L1
StartActionXY HOLEFILL4  3 442 158 12 2461 0 L1

ScrollBKDTo 0 -268 0 240 2462

//-------------------------------------
// Boss time!!!
//-------------------------------------
StopAction FIRE1 2700
StopAction FIRE2 2700
StopAction FIRE3 2700
StopAction FIRE4 2700
StopAction FIRE5 2700

StartActionXY EXPLOSION1 0 440  90 14 2800 0 L1
StartActionXY EXPLOSION2 0 400 130 14 2810 0 L1
StartActionXY EXPLOSION3 0 480  60 14 2820 0 L1
StartActionXY EXPLOSION4 0 390  90 14 2830 0 L1
StartActionXY EXPLOSION5 0 485 135 14 2840 0 L1
StopAction    HOLEFILL1 2845
StopAction    HOLEFILL2 2845
StopAction    HOLEFILL3 2845
StopAction    HOLEFILL4 2845
StartActionXY CLOUD1     0 375  90  0 2845 0 L1
StartActionXY CLOUD2     1 425  90  0 2845 0 L1
StartActionXY CLOUD3     2 463  90  0 2845 0 L1
StartActionXY CLOUD4     0 503  90  0 2845 0 L1
StartActionXY CLOUD5     1 553  90  0 2845 0 L1
StartActionXY CLOUD6     3 415 178  0 2845 0 L1
StartActionXY HELICO1    0 428   0  1 2845 0 L1   // Main body
Attach HELICO2 HELICO1 17 0 2845 -78 -45 2 L1     // Top blade left
Attach HELICO3 HELICO1 17 1 2845  76 -45 2 L1     // Top blade right
Attach HELICO4 HELICO1 16 0 2845  13 -73 2 L1     // Back wing
Attach HELICO5 HELICO1  5 0 2845   0  68 1 L1     // Gun under
Attach HELICO6 HELICO1  8 0 2845 -40  69 2 L1     // Left wheel
Attach HELICO7 HELICO1  8 1 2845  38  69 2 L1     // Right wheel
Attach HELICO8 HELICO1  1 0 2845 -41  -7 2 L1     // Left vent
Attach HELICO9 HELICO1  1 1 2845  39  -7 2 L1     // Right vent
Attach HELICO10 HELICO1 3 0 2845 -17  40 2 L1     // Left front
Attach HELICO11 HELICO1 3 1 2845  15  40 2 L1     // Right front
Attach HELICO12 HELICO1 14 0 2845 -98  18 2 L1    // Left end-wing missile
Attach HELICO13 HELICO1 14 1 2845  96  18 2 L1    // Right end-wing missile
Attach HELICO14 HELICO1 12 0 2845 -83  35 2 L1    // Left 1-missile
Attach HELICO15 HELICO1 12 1 2845  81  35 2 L1    // Right 1-missile
Attach HELICO16 HELICO1 10 0 2845 -57  43 2 L1    // Left 4-missiles
Attach HELICO17 HELICO1 10 1 2845  55  43 2 L1    // Right 4-missiles
Attach HELICO18 HELICO1 18 0 2845  -1   1 2 L1    // Closed window

StartActionXY EXPLOSION6 0 475  55 14 2850 0 L1

EndLevel 0
