//---------------------------------------------------------------------------
// Lethal Enforcers 2
// 
// Level        Mine
// Round        2
// Background   568, 240
// SetScale     0x06=5526, 0x1f=3425
// Layers       255 31 27 27 27   26 25 24 19 17   16 7 6 -48 -48
//---------------------------------------------------------------------------
// Sprites	Enemy Sets
// 		1   2   
// BGBLAK	X   X   
// BGJACK	X       
// BGMEXB	    X   
// BGMEXD	X       
// BGMEXS	X       
// BGMIKE	X   X   
// BGSTEV	X   X   
// BGTHIN	X   X   
// BMBIG	    X   
// BMBOLF	X       
// BMGALO	X       
// BMLONG	X       
// BMTETS	X       
// BMYOSI	    X   
// BWBONI	X       
// BWDEBI	X   X   
// BWTINA	    X   
// GMDRNK	X       
// GWBLAK	    X   
// GWXYLA	X       
//---------------------------------------------------------------------------

// Define hit points
define BGBLAK_hp    2
define BGJACK_hp    2
define BGMEXB_hp    2
define BGMEXD_hp    2
define BGMEXS_hp    2
define BGMIKE_hp    2
define BGSTEV_hp    2
define BGTHIN_hp    2
define BMBIG_hp     2
define BMBOLF_hp    2
define BMGALO_hp    2
define BMLONG_hp    2
define BMTETS_hp    2
define BMYOSI_hp    2
define BWBONI_hp    1
define BWDEBI_hp    1
define BWTINA_hp    1
define GMDRNK_hp    1
define GWBLAK_hp    1
define GWXYLA_hp    1

// Define character literals
define BGTHIN1      0
define BGTHIN2      1
define BGTHIN3      2
define BGBLAK1      3
define BGBLAK2      4
define BGJACK1      5
define BGJACK2      6
define BGMEXB1      7
define BGMEXB2      8
define BGMEXB3      9
define BGMEXD1      10
define BGMEXS1      11
define BGMEXS2      12
define BGMIKE1      13
define BGMIKE2      14
define BGMIKE3      15
define BGSTEV1      16
define BGSTEV2      17
define BGSTEV3      18
define BGSTEV4      19
define BGSTEV5      20
define BMBIG1       21
define BMBIG2       22
define BMBIG3       23
define BMBOLF1      24
define BMGALO1      25
define BMLONG1      26
define BMTETS1      27
define BMYOSI1      28
define BWBONI1      29
define BWBONI2      30
define BWDEBI1      31
define BWDEBI2      32
define BWDEBI3      33
define BWTINA1      34
define GMDRNK1      35
define GWBLAK1      36
define GMRUSH1      37
define GWXYLA1      38
define SHUTTER1     39
define SHUTTER2     40
define DOOR1        41
define DOOR2        42
define TWIN         43
define CAL50        44
define DYNA1        45
define DYNA2        46

// 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 abobe garage #1)
define p01_x        87
define p01_y        77
define p01_l        7
define p01_scale    4013

// p01j (jump from abobe garage #1)
define p01j_x       0
define p01j_y       185
define p01j_l       14
define p01j_scale   4013

// p02 (stand from abobe garage #2)
define p02_x        110
define p02_y        95
define p02_l        6
define p02_scale    3929

// p03 (side, low, roll from garage #1)
define p03_x        10
define p03_y        180
define p03_l        12
define p03_scale    5526

// p04 (side, low from garage #2)
define p04_x        110
define p04_y        165
define p04_l        6
define p04_scale    3600

// p05 (stand behind trolley)
define p05_x        250
define p05_y        180
define p05_l        8
define p05_scale    4433

// p06 (right low from screen right)
define p06_x        325
define p06_y        180
define p06_l        11
define p06_scale    5442

// p07 (stand from window #1)
define p07_x        217
define p07_y        90
define p07_l        1
define p07_scale    3425

// p08 (stand from window #2)
define p08_x        249
define p08_y        90
define p08_l        1
define p08_scale    3425

// ph1 (right stand with hostage)
define ph1_x        275
define ph1_y        180
define ph1_l        8
define ph1_scale    4433

// p09 (side from entrance left)
define p09_x        368
define p09_y        145
define p09_l        2
define p09_scale    3761

// p0a (right side from entrance right)
define p0a_x        558
define p0a_y        145
define p0a_l        2
define p0a_scale    3761

// p0b (stand, low behind trolley)
define p0b_x        283
define p0b_y        190
define p0b_l        9
define p0b_scale    4602

// p0c (big enemy)
define p0c_x        336
define p0c_y        258
define p0c_l        13
define p0c_scale    4096

// p0d (big enemy)
define p0d_x        468
define p0d_y        258
define p0d_l        13
define p0d_scale    4096


// Load backgrounds and sounds
LoadBKD \BACKGRND\LE2\MINE\MINE2.BKD
SetBKDLoc 0 0 0 0
LoadVAB \SOUNDFX\LE2\HIDEOUT.VAB

// Load characters
LoadKRT \SPRITES\LE2\MINE\BGTHIN.KRT              // Ch 18 - BGTHIN1  
SetScale BGTHIN1 p03_scale
SetTotalHitPoints BGTHIN1 BGTHIN_hp

CloneCharacter BGTHIN1                            // Ch 19 - BGTHIN2  
SetScale BGTHIN2 p02_scale
SetTotalHitPoints BGTHIN2 BGTHIN_hp

CloneCharacter BGTHIN1                            // Ch 20 - BGTHIN3  
SetScale BGTHIN3 p0b_scale
SetTotalHitPoints BGTHIN3 BGTHIN_hp

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

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

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

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

LoadKRT \SPRITES\LE2\MINE\BGMEXB.KRT              // Ch 4 - BGMEXB1   
SetScale BGMEXB1 p0d_scale
SetTotalHitPoints BGMEXB1 BGMEXB_hp

CloneCharacter BGMEXB1                            // Ch 5 - BGMEXB2   
SetScale BGMEXB2 p0c_scale
SetTotalHitPoints BGMEXB2 BGMEXB_hp

CloneCharacter BGMEXB1                            // Ch 6 - BGMEXB3   
SetScale BGMEXB3 p0d_scale
SetTotalHitPoints BGMEXB3 BGMEXB_hp

LoadKRT \SPRITES\LE2\MINE\BGMEXD.KRT              // Ch 7 - BGMEXD1   
SetScale BGMEXD1 p04_scale
SetTotalHitPoints BGMEXD1 BGMEXD_hp

//LoadKRT \SPRITES\LE2\MINE\BGMEXS.KRT              // Ch 8 - BGMEXS1
CloneCharacter BGMEXD1
SetScale BGMEXS1 p05_scale
SetTotalHitPoints BGMEXS1 BGMEXS_hp

//CloneCharacter BGMEXS1                            // Ch 9 - BGMEXS2
CloneCharacter BGTHIN1
SetScale BGMEXS2 p06_scale
SetTotalHitPoints BGMEXS2 BGMEXS_hp

LoadKRT \SPRITES\LE2\MINE\BGMIKE.KRT              // Ch 10 - BGMIKE1  
SetScale BGMIKE1 ph1_scale
SetTotalHitPoints BGMIKE1 BGMIKE_hp

CloneCharacter BGMIKE1                            // Ch 11 - BGMIKE2  
SetScale BGMIKE2 p06_scale
SetTotalHitPoints BGMIKE2 BGMIKE_hp

CloneCharacter BGMIKE1                            // Ch 12 - BGMIKE3  
SetScale BGMIKE3 p0a_scale
SetTotalHitPoints BGMIKE3 BGMIKE_hp

LoadKRT \SPRITES\LE2\MINE\BGSTEV.KRT              // Ch 13 - BGSTEV1  
SetScale BGSTEV1 p06_scale
SetTotalHitPoints BGSTEV1 BGSTEV_hp

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

CloneCharacter BGSTEV1                            // Ch 15 - BGSTEV3  
SetScale BGSTEV3 p05_scale
SetTotalHitPoints BGSTEV3 BGSTEV_hp

CloneCharacter BGSTEV1                            // Ch 16 - BGSTEV4  
SetScale BGSTEV4 p0b_scale
SetTotalHitPoints BGSTEV4 BGSTEV_hp

CloneCharacter BGSTEV1                            // Ch 17 - BGSTEV5  
SetScale BGSTEV5 p09_scale
SetTotalHitPoints BGSTEV5 BGSTEV_hp

LoadKRT \SPRITES\LE2\MINE\BMBIG.KRT               // Ch 21 - BMBIG1   
SetScale BMBIG1 p0c_scale
SetTotalHitPoints BMBIG1 BMBIG_hp

CloneCharacter BMBIG1                             // Ch 22 - BMBIG2   
SetScale BMBIG2 p0d_scale
SetTotalHitPoints BMBIG2 BMBIG_hp

CloneCharacter BMBIG1                             // Ch 23 - BMBIG3   
SetScale BMBIG3 p0c_scale
SetTotalHitPoints BMBIG3 BMBIG_hp

//LoadKRT \SPRITES\LE2\MINE\BMBOLF.KRT              // Ch 24 - BMBOLF1
CloneCharacter BGTHIN1
SetScale BMBOLF1 p07_scale
SetTotalHitPoints BMBOLF1 BMBOLF_hp

LoadKRT \SPRITES\LE2\MINE\BMGALO.KRT              // Ch 25 - BMGALO1  
SetScale BMGALO1 p01j_scale
SetTotalHitPoints BMGALO1 BMGALO_hp

LoadKRT \SPRITES\LE2\MINE\BMLONG.KRT              // Ch 26 - BMLONG1  
SetScale BMLONG1 p07_scale
SetTotalHitPoints BMLONG1 BMLONG_hp

LoadKRT \SPRITES\LE2\MINE\BMTETS.KRT              // Ch 27 - BMTETS1  
SetScale BMTETS1 p08_scale
SetTotalHitPoints BMTETS1 BMTETS_hp

LoadKRT \SPRITES\LE2\MINE\BMYOSI.KRT              // Ch 28 - BMYOSI1  
SetScale BMYOSI1 p0a_scale*120/100
SetTotalHitPoints BMYOSI1 BMYOSI_hp

LoadKRT \SPRITES\LE2\MINE\BWBONI.KRT              // Ch 29 - BWBONI1  
SetScale BWBONI1 p07_scale
SetTotalHitPoints BWBONI1 BWBONI_hp

CloneCharacter BWBONI1                            // Ch 30 - BWBONI2  
SetScale BWBONI2 p03_scale
SetTotalHitPoints BWBONI2 BWBONI_hp

LoadKRT \SPRITES\LE2\MINE\BWDEBI.KRT              // Ch 31 - BWDEBI1  
SetScale BWDEBI1 p04_scale
SetTotalHitPoints BWDEBI1 BWDEBI_hp

CloneCharacter BWDEBI1                            // Ch 32 - BWDEBI2  
SetScale BWDEBI2 p09_scale
SetTotalHitPoints BWDEBI2 BWDEBI_hp

CloneCharacter BWDEBI1                            // Ch 33 - BWDEBI3  
SetScale BWDEBI3 p0b_scale
SetTotalHitPoints BWDEBI3 BWDEBI_hp

LoadKRT \SPRITES\LE2\MINE\BWTINA.KRT              // Ch 34 - BWTINA1  
SetScale BWTINA1 p09_scale
SetTotalHitPoints BWTINA1 BWTINA_hp

LoadKRT \SPRITES\LE2\MINE\GMDRNK.KRT              // Ch 35 - GMDRNK1  
SetScale GMDRNK1 p04_scale
SetTotalHitPoints GMDRNK1 GMDRNK_hp
ObjectCharacteristics GMDRNK1 VICTIM|DISAPPEAR|SCROLL

LoadKRT \SPRITES\LE2\MINE\GWBLAK.KRT              // Ch 36 - GWBLAK1  
SetScale GWBLAK1 p0a_scale
SetTotalHitPoints GWBLAK1 GWBLAK_hp
ObjectCharacteristics GWBLAK1 VICTIM|DISAPPEAR|SCROLL

LoadKRT \SPRITES\LE2\MINE\GMRUSH.KRT		  // Ch 37 - GMRUSH1
SetScale GMRUSH1 ph1_scale
ObjectCharacteristics GMRUSH1 VICTIM|DISAPPEAR|SCROLL

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

LoadKRT \SPRITES\LE2\MINE\M2DOOR.KRT		  // Ch 39 - SHUTTER1
ObjectCharacteristics SHUTTER1 SCROLL|NOKILL|START_ANIM
CloneCharacter SHUTTER1				  // Ch 40 - SHUTTER2
CloneCharacter SHUTTER1				  // Ch 41 - DOOR1
CloneCharacter SHUTTER1				  // Ch 42 - DOOR2

LoadKRT \SPRITES\LE2\L2GUNS.KRT                   // Ch 43 - TWIN
ObjectCharacteristics TWIN SCROLL|GUN
CloneCharacter TWIN				  // Ch 44 - CAL50

LoadKRT \SPRITES\LE2\L2DYNA.KRT                   // Ch 45 - DYNA1
ObjectCharacteristics DYNA1 THROWN|DISAPPEAR|ARROW|SCROLL
CloneCharacter DYNA1				  // Ch 46 - DYNA2

// Projectiles
AssignProjectile BGMEXD1 DYNA1
AssignProjectile BGMEXS1 DYNA1

// Links
Link SHUTTER1 BWBONI1 3 4 0 1 210 37	
Link SHUTTER2 BWBONI1 3 4 0 0 253 37
Link DOOR1    BWDEBI2 1 6 0 1 423 145
Link DOOR2    BGBLAK2 1 6 0 0 495 145

// Hostages
SetDepth BGMIKE1 ph1_l
Link BGMIKE1 GMRUSH1 9 1 0 1 ph1_x ph1_y	// Stand when hostage stands
Link BGMIKE1 GMRUSH1 3 0 0 1 ph1_x ph1_y        // Shoot when hostage dies

PlayTrack 504 0                 // SD_BGM5

// Objects
StartActionXY SHUTTER1  2    210      37       6     0        1 L1
StartActionXY SHUTTER2  2    253      37       6     0        0 L1
StartActionXY DOOR1     0    423      145      6     0        1 L1
StartActionXY DOOR2     0    495      145      6     0        0 L1
	
// Action!
define FC     0  // Frame Counter
StartActionXY BGMEXS1   4    p05_x    p05_y    p05_l FC+64    0 L1  // STND (really bgmexd)
StartActionXY BGSTEV1  10    p06_x    p06_y    p06_l FC+128   1 L5  // LOW
StartActionXY BWBONI1   4    p07_x    p07_y    p07_l FC+192   0 L1  // STND
StartActionXY BGTHIN1  16    p03_x-50 p03_y+15 p03_l FC+256   0 L5  // ROLL
StartActionXY BWDEBI1   6    p04_x    p04_y    p04_l FC+320   0 L2  // SIDE
StartActionXY GMRUSH1   1    ph1_x-30 ph1_y    ph1_l+1 FC+328   1 L1  // HOST
StartActionXY BGMIKE1   3    ph1_x    ph1_y    ph1_l FC+329   1 L1  // STND (after hostage)
StartActionXY BGJACK1  10   p01j_x+20 p01j_y-5 p01j_l FC+384   0 L6  // JUMP
StartActionXY BMTETS1  10    p08_x    p08_y    p08_l FC+448   0 L1  // STND
StartActionXY BGBLAK1   4    p02_x    p02_y    p02_l FC+512   0 L5  // STND
StartActionXY BGSTEV2   6    p05_x    p05_y+5  p05_l FC+576   0 L5  // STND
StartActionXY BGMEXS2  14    p06_x    p06_y+5  p06_l FC+640   1 L1  // LOW  (really bgthin)
StartActionXY GMDRNK1   1    p04_x    p04_y    p04_l FC+704   0 L1  // WALK
StartActionXY BMBOLF1  10    p07_x    p07_y    p07_l FC+768   0 L7  // STND (really bgthin)
StartActionXY BWBONI2   6    p03_x    p03_y-5  p03_l FC+784   0 L1  // SIDE
Attach TWIN BWBONI2 0 0 FC+784 0 0 p03_l L1
StartActionXY GWXYLA1   1    p08_x    p08_y    p08_l FC+832   0 L1  // STND
StartActionXY BGMEXD1   6    p04_x    p04_y    p04_l FC+896   0 L6  // SIDE
StartActionXY BMGALO1   7   p01j_x   p01j_y   p01j_l FC+960   0 L1  // JUMP
StartActionXY BGJACK2   6    p08_x    p08_y    p08_l FC+1024  0 L5  // STND
StartActionXY BGTHIN2  10    p02_x    p02_y+10 p02_l FC+1040  0 L2  // STND
StartActionXY BGSTEV3   6    p05_x    p05_y    p05_l FC+1088  0 L1  // STND
StartActionXY BGMIKE2   5    p06_x    p06_y    p06_l FC+1152  1 L5  // LOW
StartActionXY BMLONG1   4    p07_x    p07_y    p07_l FC+1216  0 L1  // STND

ResetCharacteristics SHUTTER1 SCROLL|NOKILL FC+1216
ResetCharacteristics SHUTTER2 SCROLL|NOKILL FC+1216
ScrollBKDTo 0 -248 0 62 FC+1248

define FC  FC+1248  // Frame Counter
StartActionXY BGTHIN3  16    p0b_x-20 p0b_y-5  p0b_l FC+64    0 L1  // ROLL
StartActionXY BGMEXB1   5    p0d_x    p0d_y    p0d_l FC+128   1 L5  // STND
StartActionXY BWDEBI2   6    p09_x    p09_y    p09_l FC+192   0 L1  // SIDE
StartActionXY BMBIG1    4    p0c_x    p0c_y-60 p0c_l FC+256   0 L5  // STND
StartActionXY BGBLAK2   6    p0a_x    p0a_y    p0a_l FC+320   1 L1  // SIDE
StartActionXY BGSTEV4   6    p0b_x    p0b_y    p0b_l FC+384   0 L5  // STND
StartActionXY GWBLAK1   2    p0a_x-5  p0a_y    p0a_l FC+448   1 L1  // SIDE
StartActionXY BMBIG2    4    p0d_x    p0d_y-60 p0d_l FC+512   0 L1  // STND
StartActionXY BWTINA1   8    p09_x    p09_y    p09_l FC+576   0 L6  // RUN
StartActionXY BGMEXB2   5    p0c_x    p0c_y    p0c_l FC+640   0 L4  // STND
StartActionXY BMYOSI1  12    p0a_x    p0a_y+10 p0a_l FC+704   1 L1  // ROLL
Attach CAL50 BMYOSI1 3 0 FC+704 0 0 p0a_l L1
StartActionXY BWDEBI3   4    p0b_x    p0b_y    p0b_l FC+768   0 L3  // STND
StartActionXY BGMEXB3   5    p0d_x    p0d_y    p0d_l FC+832   0 L5  // STND
StartActionXY BGSTEV5  12    p09_x    p09_y+10 p09_l FC+896   0 L1  // ROLL
StartActionXY BMBIG3    4    p0c_x    p0c_y-60 p0c_l FC+960   1 L6  // STND
StartActionXY BGMIKE3   5    p0a_x    p0a_y    p0a_l FC+1024  1 L1  // SIDE

ResetCharacteristics DOOR1 SCROLL|NOKILL FC+1024
ResetCharacteristics DOOR2 SCROLL|NOKILL FC+1024
ScrollBKDTo 0 -248 0 0 FC+1056

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