//---------------------------------------------------------------------------
// Lethal Enforcers 2
// 
// Level        Mine
// Round        1
// Background   560, 240
// SetScale     0x1b=4383, 0x48=2500
// Layers       255 72 72 72 72   71 45 27 27 27  26 -3 -48 -48 -48
//
// Originally <ecorral2.c>
//---------------------------------------------------------------------------
// Sprites	Enemy Sets
// 		1   2   
// BGBLAK	    X   
// BGJACK	    X   
// BGMEXB	    X   
// BGMEXD	    X   
// BGMEXS	X   X   
// BGMIKE	    X   
// BGSTEV	X   X   
// BGTHIN	X   X   
// BMBIG 	    X   
// BWBONI	    X   
// BWDEBI	    X   
// BWTINA	    X   
// GMCAPT	    X   
// GMLAMP	    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 BWBONI_hp    1
define BWDEBI_hp    1
define BWTINA_hp    1
define GMCAPT_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 BGMEXB1      5
define BGMEXB2      6
define BGMEXD1      7
define BGMEXS1      8
define BGMEXS2      9
define BGMEXS3      10
define BGMIKE1      11
define BGMIKE2      12
define BGSTEV1      13
define BGSTEV2      14
define BGSTEV3      15
define BGSTEV4      16
define BGTHIN1      17
define BGTHIN2      18
define BGTHIN3      19
define BGTHIN4      20
define BMBIG1       21
define BMBIG2       22
define BWBONI1      23
define BWDEBI1      24
define BWTINA1      25
define GMCAPT1      26
define GMLAMP1      27
define GWXYLA1      28
define DYNA1        29

// 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 behind wall #1)
define p01_x        340
define p01_y        190
define p01_l        7
define p01_scale    4383

// p02 (stand behind wall #2)
define p02_x        421
define p02_y        190
define p02_l        7
define p02_scale    4383

// p03 (stand behind wall #3)
define p03_x        500
define p03_y        190
define p03_l        7
define p03_scale    4383

// p04 (side, low, run, jump from screen left)
define p04_x        223
define p04_y        150
define p04_l        6
define p04_scale    3630

// p05 (right run, jump from screen right)
define p05_x        550
define p05_y        170
define p05_l        6
define p05_scale    3630

// p06 (stand behind box #1)
define p06_x        358
define p06_y        135
define p06_l        1
define p06_scale    2500

// p07 (stand behind box #2)
define p07_x        400
define p07_y        135
define p07_l        1
define p07_scale    2500

// p08 (big #1)
define p08_x        330
define p08_y        258
define p08_l        12
define p08_scale    4096

// p09 (big #2)
define p09_x        476
define p09_y        258
define p09_l        12
define p09_scale    4096

// ps1 (sheriff from screen left)
define ps1_x        250
define ps1_y        170
define ps1_l        11
define ps1_scale    5638

// pd1 (demo #1)
define pd1_x        124
define pd1_y        170
define pd1_l        7
define pd1_scale    4383

// pd2 (demo #2)
define pd2_x        190
define pd2_y        170
define pd2_l        7
define pd2_scale    4383

// pd3 (demo #3)
define pd3_x        249
define pd3_y        170
define pd3_l        7
define pd3_scale    4383

// pd4 (title demo)
define pd4_x        128
define pd4_y        103
define pd4_l        10
define pd4_scale    4425

// pd5 (title demo)
define pd5_x        190
define pd5_y        109
define pd5_l        10
define pd5_scale    4425

// pd6 (title demo)
define pd6_x        257
define pd6_y        97
define pd6_l        10
define pd6_scale    4425


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

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

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

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

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

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

LoadKRT \SPRITES\LE2\MINE\BGMEXB.KRT       // Ch 5 - BGMEXB1   
SetScale BGMEXB1 p08_scale
SetTotalHitPoints BGMEXB1 BGMEXB_hp

CloneCharacter BGMEXB1                            // Ch 6 - BGMEXB2   
SetScale BGMEXB2 p09_scale
SetTotalHitPoints BGMEXB2 BGMEXB_hp

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

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

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

CloneCharacter BGMEXS1                            // Ch 10 - BGMEXS3  
SetScale BGMEXS3 p04_scale
SetTotalHitPoints BGMEXS3 BGMEXS_hp

LoadKRT \SPRITES\LE2\MINE\BGMIKE.KRT       // Ch 11 - BGMIKE1  
SetScale BGMIKE1 p01_scale
SetTotalHitPoints BGMIKE1 BGMIKE_hp

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

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

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

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

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

LoadKRT \SPRITES\LE2\MINE\BGTHIN.KRT       // Ch 17 - BGTHIN1  
SetScale BGTHIN1 pd3_scale
SetTotalHitPoints BGTHIN1 BGTHIN_hp

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

CloneCharacter BGTHIN1                            // Ch 19 - BGTHIN3  
SetScale BGTHIN3 p05_scale
SetTotalHitPoints BGTHIN3 BGTHIN_hp

CloneCharacter BGTHIN1                            // Ch 20 - BGTHIN4  
SetScale BGTHIN4 p04_scale
SetTotalHitPoints BGTHIN4 BGTHIN_hp

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

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

LoadKRT \SPRITES\LE2\MINE\BWBONI.KRT       // Ch 23 - BWBONI1  
SetScale BWBONI1 p01_scale
SetTotalHitPoints BWBONI1 BWBONI_hp

LoadKRT \SPRITES\LE2\MINE\BWDEBI.KRT       // Ch 24 - BWDEBI1  
SetScale BWDEBI1 p02_scale
SetTotalHitPoints BWDEBI1 BWDEBI_hp

LoadKRT \SPRITES\LE2\MINE\BWTINA.KRT       // Ch 25 - BWTINA1  
SetScale BWTINA1 p07_scale
SetTotalHitPoints BWTINA1 BWTINA_hp

LoadKRT \SPRITES\LE2\MINE\GMCAPT.KRT       // Ch 26 - GMCAPT1  
SetScale GMCAPT1 ps1_scale
SetTotalHitPoints GMCAPT1 GMCAPT_hp
ObjectCharacteristics GMCAPT1 VICTIM|DISAPPEAR|SCROLL

LoadKRT \SPRITES\LE2\MINE\GMLAMP.KRT       // Ch 27 - GMLAMP1  
SetScale GMLAMP1 p03_scale
SetTotalHitPoints GMLAMP1 GMLAMP_hp
ObjectCharacteristics GMLAMP1 VICTIM|DISAPPEAR|SCROLL

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

LoadKRT \SPRITES\LE2\L2DYNA.KRT			  // Ch 29 - DYNA1
ObjectCharacteristics DYNA1 DISAPPEAR|THROWN|ARROW|SCROLL

// Projectiles
AssignProjectile BGMEXD1 DYNA1
	
PlayTrack 505 0                 // SD_BGM6

// Action!
define FC     0  // Frame Counter
StartActionXY BGMEXS1  10    pd1_x    pd1_y    pd1_l FC+0     0 L1  // 0x10
StartActionXY BGSTEV1   6    pd2_x    pd2_y    pd2_l FC+0     0 L1  // 0x03
StartActionXY BGTHIN1  10    pd3_x    pd3_y    pd3_l FC+0     0 L1  // 0x0f
ScrollBKDTo 0 -240 0 60 FC+32

define FC   FC+32  // Frame Counter
StartActionXY BGJACK1   6    p01_x    p01_y    p01_l FC+64    1 L1  // STND
StartActionXY BGTHIN2  10    p02_x    p02_y    p02_l FC+128   0 L5  // STND
StartActionXY BGSTEV2  13    p04_x    p04_y    p04_l FC+192   1 L1  // RUN
StartActionXY BGMEXS2  10    p06_x    p06_y    p06_l FC+256   1 L6  // STND
StartActionXY GMCAPT1   2    ps1_x    ps1_y    ps1_l FC+272   0 L1  // SIDE
StartActionXY BGMEXD1   4    p03_x    p03_y    p03_l FC+320   0 L1  // STND
StartActionXY BMBIG1    4    p08_x    p08_y-60 p08_l FC+384   0 L5  // STND
StartActionXY BGBLAK1   4    p07_x    p07_y    p07_l FC+448   0 L2  // STND
StartActionXY BMBIG2    4    p09_x    p09_y-60 p09_l FC+512   1 L1  // STND
StartActionXY BGJACK2  10    p05_x    p05_y    p05_l FC+576   1 L3  // JUMP
StartActionXY BWBONI1   4    p01_x    p01_y    p01_l FC+640   1 L5  // STND
StartActionXY BGBLAK2   4    p02_x    p02_y    p02_l FC+704   1 L1  // STND
StartActionXY BGMEXS3  14    p04_x    p04_y+20 p04_l FC+768   0 L5  // LOW
StartActionXY BGJACK3   6    p06_x    p06_y    p06_l FC+832   1 L1  // STND
StartActionXY BGSTEV3   6    p03_x    p03_y    p03_l FC+896   0 L5  // STND
StartActionXY GWXYLA1   1    p01_x    p01_y    p01_l FC+896   1 L1  // STND
StartActionXY BGMEXB1   5    p08_x    p08_y    p08_l FC+960   0 L3  // STND
StartActionXY BWTINA1   4    p07_x    p07_y+10 p07_l FC+1024  1 L5  // STND
StartActionXY BGMEXB2   5    p09_x    p09_y    p09_l FC+1088  1 L1  // STND
StartActionXY BGMIKE1   3    p01_x    p01_y    p01_l FC+1152  0 L1  // STND
StartActionXY BGSTEV4   6    p03_x    p03_y    p03_l FC+1153  0 L1  // STND
StartActionXY BGTHIN3  17    p05_x    p05_y-15 p05_l FC+1216  1 L6  // RUN
StartActionXY BGMIKE2   3    p01_x    p01_y    p01_l FC+1280  0 L1  // STND
StartActionXY BWDEBI1   4    p02_x    p02_y    p02_l FC+1344  1 L7  // STND
StartActionXY GMLAMP1   1    p03_x    p03_y-10 p03_l FC+1408  0 L1  // STND
StartActionXY BGTHIN4  14    p04_x    p04_y+10 p04_l FC+1472  0 L1  // LOW
ScrollBKDTo 0 -240 0 0 FC+1504

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