//---------------------------------------------------------------------------
// Lethal Enforcers 2
// 
// Level        Mine
// Round        3
// Background   320, 240
// SetScale     0x14=4096, 0x05=4096
// Layers       255 20 18 18 18   17 5 5 5 5   4 -48 -48 -48 -48
//
// Originally <emine2.c>
//---------------------------------------------------------------------------
// Sprites	Enemy Sets
// 		1   2   
// BGBLAK	X   X   
// BGJACK	X   X   
// BGMEXB	X       
// BGMEXK	X   X   
// BGMEXS	X   X   
// BGMIKE	X   X   
// BGSTEV	X   X   
// BGTHIN	X   X   
// BMBIG	X       
// BWBONI	X   X   
// BWDEBI	X       
// GMLAMP	X   X   
// GWXYLA	X       
//---------------------------------------------------------------------------

// Define hit points
define BGBLAK_hp    2
define BGJACK_hp    2
define BGMEXB_hp    2
define BGMEXK_hp    2
define BGMEXS_hp    2
define BGMIKE_hp    2
define BGSTEV_hp    2
define BGTHIN_hp    2
define BMBIG_hp     2
define BWBONI_hp    1
define BWDEBI_hp    1
define GMLAMP_hp    1
define GWXYLA_hp    1

// Define character literals
define BGBLAK1      0
define BGBLAK2      1
define BGJACK1      2
define BGJACK2      3
define BGJACK3      4
define BGJACK4      5
define BGJACK5      6
define BGJACK6      7
define BGMEXB1      8
define BGMEXK1      9
define BGMEXK2      10
define BGMEXS1      11
define BGMEXS2      12
define BGMEXS3      13
define BGMEXS4      14
define BGMIKE1      15
define BGMIKE2      16
define BGMIKE3      17
define BGMIKE4      18
define BGMIKE5      19
define BGSTEV1      20
define BGSTEV2      21
define BGSTEV3      22
define BGSTEV4      23
define BGSTEV5      24
define BGSTEV6      25
define BGTHIN1      26
define BGTHIN2      27
define BGTHIN3      28
define BGTHIN4      29
define BGTHIN5      30
define BMBIG1       31
define BMBIG2       32
define BWBONI1      33
define BWBONI2      34
define BWDEBI1      35
define GMLAMP1      36
define GMLAMP2      37
define GWXYLA1      38
define ELEV         39
define CHAIN        40
define GATLING      41
define CANNON       42
define KNIFE1       43
define KNIFE2       44

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

// Define object characteristics
define ENEMY        0x0001    // Enemy
define VICTIM       0x0002    // Victim
define DISAPPEAR    0x0004    // Disappear when out of screen
define GUN          0x0008    // Gun (red contour)
define FALL         0x0010    // Fall, so check for collision
define WINDOW       0x0020    // Window (translucent)
define THROWN       0x0040    // Thrown object (zoom)
define START_ANIM   0x0080    // Can start another anim. over actual one
define ARROW        0x0100    // Arrow (do an arc)
define BLINK        0x0200    // Blink at the end
define SCROLL       0x0400    // We can scroll even though he's not dead
define BOSS         0x0800    // Boss
define VEH_SINUSOID 0x1000    // Vehicle (sinusoidal movement)
define VEH_LINEAR   0x2000    // Vehicle (linear movement)
define NOKILL       0x4000    // Can't be killed
define NODISPLAY    0x8000    // Don't display

// Define positions
// p01 (stand from window #1)
define p01_x        40
define p01_y        130
define p01_l        1
define p01_scale    4096

// p02 (stand from window #2)
define p02_x        220
define p02_y        100
define p02_l        1
define p02_scale    4096

// p03 (stand from window #3)
define p03_x        280
define p03_y        140
define p03_l        1
define p03_scale    4096

// p04 (side, run from left rail)
define p04_x        -22
define p04_y        150
define p04_l        6
define p04_scale    4096

// p05 (right side, run from right rail)
define p05_x        347
define p05_y        150
define p05_l        6
define p05_scale    4096

// p11 (stand from gondra)
define p11_x        146
define p11_y        53
define p11_l        2
define p11_scale    4096

// p21 (big enemy left)
define p21_x        75
define p21_y        258
define p21_l        11
define p21_scale    4096

// p22 (big enemy center)
define p22_x        160
define p22_y        258
define p22_l        11
define p22_scale    4096

// p23 (big enemy right)
define p23_x        241
define p23_y        258
define p23_l        11
define p23_scale    4096


// Load backgrounds and sounds
LoadBKD \BACKGRND\LE2\MINE\MINE4.BKD	// Mine 3 and 4 are swapped!
SetBKDLoc 0 0 0 0
LoadVAB \SOUNDFX\LE2\HIDEOUT.VAB

// Load characters
LoadKRT \SPRITES\LE2\MINE\BGBLAK.KRT              // Ch 0 - BGBLAK1   
SetScale BGBLAK1 p02_scale
SetTotalHitPoints BGBLAK1 BGBLAK_hp

CloneCharacter BGBLAK1                            // Ch 1 - BGBLAK2   
SetScale BGBLAK2 p11_scale
SetTotalHitPoints BGBLAK2 BGBLAK_hp

LoadKRT \SPRITES\LE2\MINE\BGJACK.KRT              // Ch 2 - BGJACK1   
SetScale BGJACK1 p03_scale
SetTotalHitPoints BGJACK1 BGJACK_hp

CloneCharacter BGJACK1                            // Ch 3 - BGJACK2   
SetScale BGJACK2 p02_scale
SetTotalHitPoints BGJACK2 BGJACK_hp

CloneCharacter BGJACK1                            // Ch 4 - BGJACK3   
SetScale BGJACK3 p01_scale
SetTotalHitPoints BGJACK3 BGJACK_hp

CloneCharacter BGJACK1                            // Ch 5 - BGJACK4   
SetScale BGJACK4 p11_scale
SetTotalHitPoints BGJACK4 BGJACK_hp

CloneCharacter BGJACK1                            // Ch 6 - BGJACK5   
SetScale BGJACK5 p11_scale
SetTotalHitPoints BGJACK5 BGJACK_hp

CloneCharacter BGJACK1                            // Ch 7 - BGJACK6   
SetScale BGJACK6 p11_scale
SetTotalHitPoints BGJACK6 BGJACK_hp

LoadKRT \SPRITES\LE2\MINE\BGMEXB.KRT              // Ch 8 - BGMEXB1   
SetScale BGMEXB1 p21_scale
SetTotalHitPoints BGMEXB1 BGMEXB_hp

LoadKRT \SPRITES\LE2\MINE\BGMEXK.KRT              // Ch 9 - BGMEXK1   
SetScale BGMEXK1 p01_scale
SetTotalHitPoints BGMEXK1 BGMEXK_hp

CloneCharacter BGMEXK1                            // Ch 10 - BGMEXK2  
SetScale BGMEXK2 p11_scale
SetTotalHitPoints BGMEXK2 BGMEXK_hp

LoadKRT \SPRITES\LE2\MINE\BGMEXS.KRT              // Ch 11 - BGMEXS1  
SetScale BGMEXS1 p03_scale
SetTotalHitPoints BGMEXS1 BGMEXS_hp

CloneCharacter BGMEXS1                            // Ch 12 - BGMEXS2  
SetScale BGMEXS2 p02_scale
SetTotalHitPoints BGMEXS2 BGMEXS_hp

CloneCharacter BGMEXS1                            // Ch 13 - BGMEXS3  
SetScale BGMEXS3 p11_scale
SetTotalHitPoints BGMEXS3 BGMEXS_hp

CloneCharacter BGMEXS1                            // Ch 14 - BGMEXS4  
SetScale BGMEXS4 p11_scale
SetTotalHitPoints BGMEXS4 BGMEXS_hp

LoadKRT \SPRITES\LE2\MINE\BGMIKE.KRT              // Ch 15 - BGMIKE1  
SetScale BGMIKE1 p02_scale
SetTotalHitPoints BGMIKE1 BGMIKE_hp

CloneCharacter BGMIKE1                            // Ch 16 - BGMIKE2  
SetScale BGMIKE2 p01_scale
SetTotalHitPoints BGMIKE2 BGMIKE_hp

CloneCharacter BGMIKE1                            // Ch 17 - BGMIKE3  
SetScale BGMIKE3 p03_scale
SetTotalHitPoints BGMIKE3 BGMIKE_hp

CloneCharacter BGMIKE1                            // Ch 18 - BGMIKE4  
SetScale BGMIKE4 p11_scale
SetTotalHitPoints BGMIKE4 BGMIKE_hp

CloneCharacter BGMIKE1                            // Ch 19 - BGMIKE5  
SetScale BGMIKE5 p11_scale
SetTotalHitPoints BGMIKE5 BGMIKE_hp

LoadKRT \SPRITES\LE2\MINE\BGSTEV.KRT              // Ch 20 - BGSTEV1  
SetScale BGSTEV1 p02_scale
SetTotalHitPoints BGSTEV1 BGSTEV_hp

CloneCharacter BGSTEV1                            // Ch 21 - BGSTEV2  
SetScale BGSTEV2 p05_scale
SetTotalHitPoints BGSTEV2 BGSTEV_hp

CloneCharacter BGSTEV1                            // Ch 22 - BGSTEV3  
SetScale BGSTEV3 p03_scale
SetTotalHitPoints BGSTEV3 BGSTEV_hp

CloneCharacter BGSTEV1                            // Ch 23 - BGSTEV4  
SetScale BGSTEV4 p04_scale
SetTotalHitPoints BGSTEV4 BGSTEV_hp

CloneCharacter BGSTEV1                            // Ch 24 - BGSTEV5  
SetScale BGSTEV5 p11_scale
SetTotalHitPoints BGSTEV5 BGSTEV_hp

CloneCharacter BGSTEV1                            // Ch 25 - BGSTEV6  
SetScale BGSTEV6 p11_scale
SetTotalHitPoints BGSTEV6 BGSTEV_hp

LoadKRT \SPRITES\LE2\MINE\BGTHIN.KRT              // Ch 26 - BGTHIN1  
SetScale BGTHIN1 p01_scale
SetTotalHitPoints BGTHIN1 BGTHIN_hp

CloneCharacter BGTHIN1                            // Ch 27 - BGTHIN2  
SetScale BGTHIN2 p04_scale
SetTotalHitPoints BGTHIN2 BGTHIN_hp

CloneCharacter BGTHIN1                            // Ch 28 - BGTHIN3  
SetScale BGTHIN3 p02_scale
SetTotalHitPoints BGTHIN3 BGTHIN_hp

CloneCharacter BGTHIN1                            // Ch 29 - BGTHIN4  
SetScale BGTHIN4 p11_scale
SetTotalHitPoints BGTHIN4 BGTHIN_hp

CloneCharacter BGTHIN1                            // Ch 30 - BGTHIN5  
SetScale BGTHIN5 p11_scale
SetTotalHitPoints BGTHIN5 BGTHIN_hp

LoadKRT \SPRITES\LE2\MINE\BMBIG.KRT               // Ch 31 - BMBIG1   
SetScale BMBIG1 p22_scale
SetTotalHitPoints BMBIG1 BMBIG_hp

CloneCharacter BMBIG1                             // Ch 32 - BMBIG2   
SetScale BMBIG2 p23_scale
SetTotalHitPoints BMBIG2 BMBIG_hp

LoadKRT \SPRITES\LE2\MINE\BWBONI.KRT              // Ch 33 - BWBONI1  
SetScale BWBONI1 p03_scale
SetTotalHitPoints BWBONI1 BWBONI_hp

CloneCharacter BWBONI1                            // Ch 34 - BWBONI2  
SetScale BWBONI2 p11_scale
SetTotalHitPoints BWBONI2 BWBONI_hp

LoadKRT \SPRITES\LE2\MINE\BWDEBI.KRT              // Ch 35 - BWDEBI1  
SetScale BWDEBI1 p01_scale
SetTotalHitPoints BWDEBI1 BWDEBI_hp

LoadKRT \SPRITES\LE2\MINE\GMLAMP.KRT              // Ch 36 - GMLAMP1  
SetScale GMLAMP1 p01_scale
SetTotalHitPoints GMLAMP1 GMLAMP_hp
ObjectCharacteristics GMLAMP1 VICTIM|DISAPPEAR|NOKILL

CloneCharacter GMLAMP1                            // Ch 37 - GMLAMP2  
SetScale GMLAMP2 p11_scale
SetTotalHitPoints GMLAMP2 GMLAMP_hp
ObjectCharacteristics GMLAMP2 VICTIM|DISAPPEAR|NOKILL

LoadKRT \SPRITES\LE2\MINE\GWXYLA.KRT              // Ch 38 - GWXYLA1  
SetScale GWXYLA1 p03_scale
SetTotalHitPoints GWXYLA1 GWXYLA_hp
ObjectCharacteristics GWXYLA1 VICTIM|DISAPPEAR|NOKILL

LoadKRT \SPRITES\LE2\MINE\M3ELEV.KRT		  // Ch 39 - ELEV
ObjectCharacteristics ELEV SCROLL|NOKILL
CloneCharacter ELEV				  // Ch 40 - CHAIN

LoadKRT \SPRITES\LE2\L2GUNS.KRT			  // Ch 41 - GATLING
ObjectCharacteristics GATLING SCROLL|GUN
CloneCharacter GATLING				  // Ch 42 - CANNON

LoadKRT \SPRITES\LE2\L2NIFE.KRT			  // Ch 43 - KNIFE1
ObjectCharacteristics KNIFE1 SCROLL|THROWN|DISAPPEAR
CloneCharacter KNIFE1				  // Ch 44 - KNIFE2

// Projectiles
AssignProjectile BGMEXK1 KNIFE1
AssignProjectile BGMEXK2 KNIFE2

PlayTrack 505 0                 // SD_BGM6

// Elevator
StartActionXY ELEV      0     145        57        4 0     0 L1
StartActionXY CHAIN     1     144    57-160        4 0     0 L1

// Action!
define FC     0  // Frame Counter
MoveTo	      ELEV             145      163    120   FC+0
MoveTo        CHAIN            144  163-160    120   FC+0

StartActionXY BGSTEV1   6    p02_x    p02_y    p02_l FC+64    0 L1  // STND
StartActionXY BWDEBI1   4    p01_x    p01_y    p01_l FC+66    0 L2  // STND
StartActionXY BGJACK1   6    p03_x    p03_y    p03_l FC+128   0 L5  // STND
StartActionXY BGMIKE1   3    p02_x    p02_y    p02_l FC+190   0 L1  // STND

MoveTo	      ELEV             145       57    120   FC+240
MoveTo        CHAIN            144   57-160    120   FC+240
	
StartActionXY BGTHIN1  10    p01_x    p01_y    p01_l FC+256   0 L4  // STND
StartActionXY BGSTEV2  13    p05_x    p05_y    p05_l FC+320   0 L1  // RUN
Attach GATLING BGSTEV2 4 0 FC+320 0 0 p05_l L1
StartActionXY BGMEXS1  10    p03_x    p03_y-5  p03_l FC+322   0 L7  // STND
StartActionXY BGBLAK1   4    p02_x    p02_y    p02_l FC+384   1 L2  // STND
StartActionXY GMLAMP1   1    p01_x    p01_y-5  p01_l FC+386   0 L1  // STND
StartActionXY BGMEXB1   5    p21_x    p21_y    p21_l FC+448   0 L6  // STND
StartActionXY BWBONI1   4    p03_x    p03_y-5  p03_l FC+450   0 L3  // STND

MoveTo	      ELEV             145      163    120   FC+480
MoveTo        CHAIN            144  163-160    120   FC+480
	
StartActionXY BGTHIN2  17    p04_x    p04_y    p04_l FC+576   0 L1  // RUN
StartActionXY BGJACK2   6    p02_x    p02_y    p02_l FC+640   0 L1  // STND
StartActionXY BGMIKE2   3    p01_x    p01_y    p01_l FC+704   0 L2  // STND
StartActionXY BGSTEV3   6    p03_x+10 p03_y    p03_l FC+706   0 L6  // STND

MoveTo	      ELEV             145       57    120   FC+720
MoveTo        CHAIN            144   57-160    120   FC+720
	
StartActionXY BGTHIN3  10    p02_x    p02_y+10 p02_l FC+768   1 L1  // STND
StartActionXY BMBIG1    4    p22_x    p22_y-60 p22_l FC+832   0 L1  // STND
StartActionXY BGMEXK1   4    p01_x-5  p01_y    p01_l FC+834   0 L1  // STND
StartActionXY GWXYLA1   1    p03_x    p03_y    p03_l FC+896   0 L1  // STND

MoveTo	      ELEV             145      163    120   FC+960
MoveTo        CHAIN            144  163-160    120   FC+960
	
StartActionXY BMBIG2    4    p23_x    p23_y-60 p23_l FC+960   0 L5  // STND
StartActionXY BGMEXS2  10    p02_x    p02_y    p02_l FC+962   1 L2  // STND
StartActionXY BGSTEV4  13    p04_x    p04_y    p04_l FC+1024  1 L5  // RUN
Attach CANNON BGSTEV4 5 0 FC+1024 0 0 p04_l L5
StartActionXY BGJACK3   6    p01_x    p01_y    p01_l FC+1088  0 L1  // STND
StartActionXY BGMIKE3   3    p03_x    p03_y    p03_l FC+1152  0 L1  // STND
	
ScrollBKDTo 0 0 0 0 FC+1200

// Guys in the elevator
define FC  FC+1200  // Frame Counter
//StartActionXY BGMEXK2   4    p11_x    p11_y    p11_l FC+0     0 L1  // STND
//StartActionXY BWBONI2   4    p11_x    p11_y    p11_l FC+0     0 L1  // STND
//StartActionXY BGMIKE4   3    p11_x    p11_y    p11_l FC+0     0 L1  // STND
//StartActionXY GMLAMP2   1    p11_x    p11_y    p11_l FC+0     0 L1  // STND
//StartActionXY BGSTEV5   6    p11_x    p11_y    p11_l FC+0     0 L1  // STND
//StartActionXY BGBLAK2   4    p11_x    p11_y    p11_l FC+0     0 L1  // STND
//StartActionXY BGTHIN4  10    p11_x    p11_y    p11_l FC+0     0 L1  // STND
//StartActionXY BGJACK4   6    p11_x    p11_y    p11_l FC+0     0 L1  // STND
//StartActionXY BGSTEV6   6    p11_x    p11_y    p11_l FC+0     0 L1  // STND
//StartActionXY BGMIKE5   3    p11_x    p11_y    p11_l FC+0     0 L1  // STND
//StartActionXY BGJACK5   6    p11_x    p11_y    p11_l FC+0     0 L1  // STND
//StartActionXY BGTHIN5  10    p11_x    p11_y    p11_l FC+0     0 L1  // STND
//StartActionXY BGMEXS3  10    p11_x    p11_y    p11_l FC+0     0 L1  // STND
//StartActionXY BGMEXS4  10    p11_x    p11_y    p11_l FC+0     0 L1  // STND
//StartActionXY BGJACK6   6    p11_x    p11_y    p11_l FC+0     0 L1  // STND
ScrollBKDTo 0 0 0 0 FC+32

define FC  FC+32  // Frame Counter
EndRound FC+30
