//---------------------------------------------------------------------------
// Lethal Enforcers 2
// 
// Level        Mine
// Round        5
// Background   320, 240
// SetScale     0x22=3120, 0x10=4096
// Layers       255 52 41 34 32   31 16 16 16 16   15 -48 -48 -48 -48
//
// Originally <emine4.c>
//---------------------------------------------------------------------------
// Sprites	Enemy Sets
// 		1   
// BGBLAK	X   
// BGJACK	X   
// BGMEXD	X   
// BGMEXK	X   
// BGMEXS	X   
// BGMIKE	X   
// BGSTEV	X   
// BGTHIN	X   
// BMBIG	X   
// BMSTEV	X   
// BWBONI	X   
// BWDEBI	X   
// GWBLAK	X   
//---------------------------------------------------------------------------

// Define hit points
define BGBLAK_hp    2
define BGJACK_hp    2
define BGMEXD_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 BMSTEV_hp    2
define BWBONI_hp    1
define BWDEBI_hp    1
define GWBLAK_hp    1

// Define character literals
define BGBLAK1      0
define BGBLAK2      1
define BGJACK1      2
define BGMEXD1      3
define BGMEXD2      4
define BGMEXK1      5
define BGMEXS1      6
define BGMIKE1      7
define BGSTEV1      8
define BGSTEV2      9
define BGSTEV3      10
define BGSTEV4      11
define BGSTEV5      12
define BGTHIN1      13
define BGTHIN2      14
define BGTHIN3      15
define BMBIG1       16
define BMBIG2       17
define BMBIG3       18
define BMBIG4       19
define BMBIG5       20
define BMBIG6       21
define BMBIG7       22
define BMBIG8       23
define BMSTEV1      24
define BMSTEV2      25
define BMSTEV3      26
define BWBONI1      27
define BWBONI2      28
define BWDEBI1      29
define BWDEBI2      30
define GWBLAK1      31
define CART         32
define RIFLE        33
define DYNA1        34
define DYNA2        35
define KNIFE1       36

// 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 (side from left)
define p01_x        42
define p01_y        140
define p01_l        4
define p01_scale    3228

// p01_1 (side from left for Renee)
define p01_1_x      45
define p01_1_y      145
define p01_1_l      3
define p01_1_scale  3120

// p02 (side from right)
define p02_x        328
define p02_y        130
define p02_l        4
define p02_scale    3228

// p03 (run from left (NYZM))
define p03_x        -60
define p03_y        122
define p03_l        6
define p03_scale    4096

// p04 (run from right (NYZM))
define p04_x        323
define p04_y        135
define p04_l        6
define p04_scale    2740

// p03tr (trolley from left)
define p03tr_x      0
define p03tr_y      141
define p03tr_l      7
define p03tr_scale  4096

// p04tr (trolley from right)
define p04tr_x      320
define p04tr_y      141
define p04tr_l      7
define p04tr_scale  3072

// ptr (trolley)
define ptr_x        23
define ptr_y        130
define ptr_l        7
define ptr_scale    4096

// p05 (big stand)
define p05_x        83
define p05_y        258
define p05_l        11
define p05_scale    4096

// p06 (big stand)
define p06_x        157
define p06_y        258
define p06_l        11
define p06_scale    4096

// p07 (big stand)
define p07_x        254
define p07_y        258
define p07_l        11
define p07_scale    4096

// ph1 (Renee)
define ph1_x        107
define ph1_y        162
define ph1_l        3
define ph1_scale    4096

// pcv (Curve in track)
define pcv_x        (320/2)
define pcv_y        p03_y
define pcv_l        p03_l
define pcv_scale    p03_scale
	

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

// Load characters
LoadKRT \SPRITES\LE2\MINE\BGBLAK.KRT              // Ch 0 - BGBLAK1   
SetScale BGBLAK1 p01_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 p02_scale
SetTotalHitPoints BGJACK1 BGJACK_hp

LoadKRT \SPRITES\LE2\MINE\BGMEXD.KRT              // Ch 3 - BGMEXD1   
SetScale BGMEXD1 p02_scale
SetTotalHitPoints BGMEXD1 BGMEXD_hp

CloneCharacter BGMEXD1                            // Ch 4 - BGMEXD2   
SetScale BGMEXD2 p01_scale
SetTotalHitPoints BGMEXD2 BGMEXD_hp

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

LoadKRT \SPRITES\LE2\MINE\BGMEXS.KRT              // Ch 6 - BGMEXS1   
SetScale BGMEXS1 p02_scale
SetTotalHitPoints BGMEXS1 BGMEXS_hp

LoadKRT \SPRITES\LE2\MINE\BGMIKE.KRT              // Ch 7 - BGMIKE1   
SetScale BGMIKE1 p03tr_scale
SetTotalHitPoints BGMIKE1 BGMIKE_hp

LoadKRT \SPRITES\LE2\MINE\BGSTEV.KRT              // Ch 8 - BGSTEV1   
SetScale BGSTEV1 p03_scale
SetTotalHitPoints BGSTEV1 BGSTEV_hp

CloneCharacter BGSTEV1                            // Ch 9 - BGSTEV2   
SetScale BGSTEV2 p04tr_scale
SetTotalHitPoints BGSTEV2 BGSTEV_hp

CloneCharacter BGSTEV1                            // Ch 10 - BGSTEV3  
SetScale BGSTEV3 p04_scale
SetTotalHitPoints BGSTEV3 BGSTEV_hp

CloneCharacter BGSTEV1                            // Ch 11 - BGSTEV4  
SetScale BGSTEV4 p01_scale
SetTotalHitPoints BGSTEV4 BGSTEV_hp

CloneCharacter BGSTEV1                            // Ch 12 - BGSTEV5  
SetScale BGSTEV5 p03_scale
SetTotalHitPoints BGSTEV5 BGSTEV_hp

LoadKRT \SPRITES\LE2\MINE\BGTHIN.KRT              // Ch 13 - BGTHIN1  
SetScale BGTHIN1 p04_scale
SetTotalHitPoints BGTHIN1 BGTHIN_hp

CloneCharacter BGTHIN1                            // Ch 14 - BGTHIN2  
SetScale BGTHIN2 p01_scale
SetTotalHitPoints BGTHIN2 BGTHIN_hp

CloneCharacter BGTHIN1                            // Ch 15 - BGTHIN3  
SetScale BGTHIN3 p03_scale
SetTotalHitPoints BGTHIN3 BGTHIN_hp

LoadKRT \SPRITES\LE2\MINE\BMBIG.KRT               // Ch 16 - BMBIG1   
SetScale BMBIG1 p06_scale
SetTotalHitPoints BMBIG1 BMBIG_hp

CloneCharacter BMBIG1                             // Ch 17 - BMBIG2   
SetScale BMBIG2 p07_scale
SetTotalHitPoints BMBIG2 BMBIG_hp

CloneCharacter BMBIG1                             // Ch 18 - BMBIG3   
SetScale BMBIG3 p05_scale
SetTotalHitPoints BMBIG3 BMBIG_hp

CloneCharacter BMBIG1                             // Ch 19 - BMBIG4   
SetScale BMBIG4 p07_scale
SetTotalHitPoints BMBIG4 BMBIG_hp

CloneCharacter BMBIG1                             // Ch 20 - BMBIG5   
SetScale BMBIG5 p06_scale
SetTotalHitPoints BMBIG5 BMBIG_hp

CloneCharacter BMBIG1                             // Ch 21 - BMBIG6   
SetScale BMBIG6 p05_scale
SetTotalHitPoints BMBIG6 BMBIG_hp

CloneCharacter BMBIG1                             // Ch 22 - BMBIG7   
SetScale BMBIG7 p06_scale
SetTotalHitPoints BMBIG7 BMBIG_hp

CloneCharacter BMBIG1                             // Ch 23 - BMBIG8   
SetScale BMBIG8 p07_scale
SetTotalHitPoints BMBIG8 BMBIG_hp

LoadKRT \SPRITES\LE2\MINE\BMSTEV.KRT              // Ch 24 - BMSTEV1  
SetScale BMSTEV1 p03_scale
SetTotalHitPoints BMSTEV1 BMSTEV_hp

CloneCharacter BMSTEV1                            // Ch 25 - BMSTEV2  
SetScale BMSTEV2 p04_scale
SetTotalHitPoints BMSTEV2 BMSTEV_hp

CloneCharacter BMSTEV1                            // Ch 26 - BMSTEV3  
SetScale BMSTEV3 p04_scale
SetTotalHitPoints BMSTEV3 BMSTEV_hp

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

CloneCharacter BWBONI1                            // Ch 28 - BWBONI2  
SetScale BWBONI2 p02_scale
SetTotalHitPoints BWBONI2 BWBONI_hp

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

CloneCharacter BWDEBI1                            // Ch 30 - BWDEBI2  
SetScale BWDEBI2 p01_scale
SetTotalHitPoints BWDEBI2 BWDEBI_hp

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

LoadKRT \SPRITES\LE2\MINE\M5CART.KRT		  // Ch 32 - CART
ObjectCharacteristics CART SCROLL|NOKILL|START_ANIM

LoadKRT \SPRITES\LE2\L2GUNS.KRT			  // Ch 33 - RIFLE
ObjectCharacteristics RIFLE SCROLL|GUN

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

LoadKRT \SPRITES\LE2\L2NIFE.KRT			  // Ch 36 - KNIFE1
ObjectCharacteristics KNIFE1 DISAPPEAR|THROWN|SCROLL

// Projectiles
AssignProjectile BGMEXD1 DYNA1
AssignProjectile BGMEXD2 DYNA2
AssignProjectile BGMEXK1 KNIFE1

PlayTrack 505 0                 // SD_BGM6

// Action!
define FC     0  // Frame Counter

StartActionXY CART      0  p03tr_x  p03tr_y  p03tr_l   FC+0     0 L1
ScaleTo       CART      p03tr_scale       0  FC+0
ScaleTo       CART      pcv_scale        80  FC+0
MoveTo        CART      pcv_x p03tr_y    80  FC+0
	
StartActionXY GWBLAK1   3  p01_1_x  p01_1_y  p01_1_l FC+16    0 L1  // WALK
MoveTo        GWBLAK1      p01_1_x+60 p01_1_y 120 FC+16
	
StartActionXY BGSTEV1  13    p03_x  p03_y+10 p03_l FC+64    1 L1  // RUN
ScaleTo       BGSTEV1  p03_scale          0  FC+64
ScaleTo       BGSTEV1  pcv_scale        220  FC+64
MoveTo        BGSTEV1  pcv_x  pcv_y+10  220  FC+64

ScaleTo       CART     p04tr_scale       80  FC+80
MoveTo        CART     p04tr_x p04tr_y   80  FC+80
	
StartActionXY BGJACK1   8    p02_x    p02_y    p02_l FC+128   1 L5  // SIDE
//StartActionXY BGMIKE1   3  p03tr_x  p03tr_y  p03tr_l FC+192   0 L1  // STND
StartActionXY BWDEBI1   6    p01_x-5  p01_y    p01_l FC+256   0 L5  // SIDE
Attach RIFLE BWDEBI1 2 0 FC+256 0 0 p01_l L5

ScaleTo       BGSTEV1  p04_scale        220  FC+64+220
MoveTo        BGSTEV1  p04_x  p04_y+10  220  FC+64+220

StartActionXY BGTHIN1  17    p04_x    p04_y    p04_l FC+320   1 L1  // RUN
ScaleTo       BGTHIN1  p04_scale          0  FC+320
ScaleTo       BGTHIN1  pcv_scale        220  FC+320
MoveTo        BGTHIN1  pcv_x  pcv_y     220  FC+320

StartActionXY BMBIG1    4    p06_x    p06_y-60 p06_l FC+384   0 L5  // STND
StartActionXY BMBIG2    4    p07_x    p07_y-60 p07_l FC+448   0 L1  // STND
StartActionXY BGBLAK1   6    p01_x    p01_y    p01_l FC+448   0 L1  // 0x07

ScaleTo       BGTHIN1  p03_scale     220  FC+320+220
MoveTo        BGTHIN1  p03_x  p03_y  220  FC+320+220
	
StartActionXY BMSTEV1  18    p03_x    p03_y    p03_l FC+576   0 L5  // RUN
ScaleTo       BMSTEV1  p03_scale          0  FC+576
ScaleTo       BMSTEV1  pcv_scale        220  FC+576
MoveTo        BMSTEV1  pcv_x  pcv_y+10  220  FC+576

StartActionXY BGMEXD1   6    p02_x    p02_y    p02_l FC+640   1 L1  // SIDE
//StartActionXY BGSTEV2   6  p04tr_x  p04tr_y  p04tr_l FC+704   0 L1  // STND
StartActionXY BWBONI1   6    p01_x+10 p01_y    p01_l FC+768   0 L1  // SIDE

ScaleTo       BMSTEV1  p04_scale        220  FC+576+220
MoveTo        BMSTEV1  p04_x  p04_y     220  FC+576+220
	
StartActionXY BMSTEV2  18    p04_x    p04_y    p04_l FC+832   1 L7  // RUN
ScaleTo       BMSTEV2  p04_scale          0  FC+832
ScaleTo       BMSTEV2  pcv_scale        220  FC+832
MoveTo        BMSTEV2  pcv_x  pcv_y     220  FC+832
	
StartActionXY BMBIG3    4    p05_x    p05_y-60 p05_l FC+896   0 L1  // STND
StartActionXY BMBIG4    4    p07_x    p07_y-60 p07_l FC+960   0 L4  // STND
StartActionXY BGTHIN2  12    p01_x    p01_y    p01_l FC+1024  0 L1  // SIDE

ScaleTo       BMSTEV2  p03_scale     220  FC+832+220
MoveTo        BMSTEV2  p03_x  p03_y  220  FC+832+220
	
StartActionXY BGTHIN3  17    p03_x    p03_y    p03_l FC+1088  0 L1  // RUN
ScaleTo       BGTHIN3  p03_scale          0  FC+1088
ScaleTo       BGTHIN3  pcv_scale        220  FC+1088
MoveTo        BGTHIN3  pcv_x  pcv_y     220  FC+1088

	
StartActionXY BGMEXS1  14    p02_x    p02_y+10 p02_l FC+1152  1 L3  // LOW
StartActionXY BGMEXK1   6    p01_x+5  p01_y    p01_l FC+1280  0 L5  // SIDE
StartActionXY BGBLAK2   6    p02_x-5  p02_y    p02_l FC+1296  1 L1  // 0x07

ScaleTo       BGTHIN3  p04_scale        220  FC+1088+220
MoveTo        BGTHIN3  p04_x  p04_y     220  FC+1088+220
	
StartActionXY BGSTEV3  13    p04_x    p04_y+10 p04_l FC+1344  0 L1  // RUN
ScaleTo       BGSTEV3  p04_scale          0  FC+1344
ScaleTo       BGSTEV3  pcv_scale        220  FC+1344
MoveTo        BGSTEV3  pcv_x  pcv_y+10  220  FC+1344
	
StartActionXY BMBIG5    4    p06_x    p06_y-60 p06_l FC+1408  0 L6  // STND
StartActionXY BMBIG6    4    p05_x    p05_y-60 p05_l FC+1472  0 L1  // STND
StartActionXY BGSTEV4  10    p01_x    p01_y+10 p01_l FC+1536  0 L7  // LOW

ScaleTo       BGSTEV3  p03_scale        220  FC+1344+220
MoveTo        BGSTEV3  p03_x  p03_y+10  220  FC+1344+220
	
StartActionXY BGSTEV5  13    p03_x    p03_y+10 p03_l FC+1600  1 L5  // RUN
ScaleTo       BGSTEV5  p03_scale          0  FC+1600
ScaleTo       BGSTEV5  pcv_scale        220  FC+1600
MoveTo        BGSTEV5  pcv_x  pcv_y+10  220  FC+1600

	
StartActionXY BWBONI2   6    p02_x-15 p02_y    p02_l FC+1664  1 L1  // SIDE
StartActionXY BGMEXD2   6    p01_x    p01_y    p01_l FC+1792  0 L1  // SIDE

ScaleTo       BGSTEV5  p04_scale        220  FC+1600+220
MoveTo        BGSTEV5  p04_x  p04_y+10  220  FC+1600+220
	
StartActionXY BMSTEV3  18    p04_x    p04_y    p04_l FC+1856  1 L5  // RUN
ScaleTo       BMSTEV3  p04_scale          0  FC+1856
ScaleTo       BMSTEV3  pcv_scale        220  FC+1856
MoveTo        BMSTEV3  pcv_x  pcv_y     220  FC+1856
	
StartActionXY BMBIG7    4    p06_x    p06_y-60 p06_l FC+1920  0 L1  // STND
StartActionXY BMBIG8    4    p07_x    p07_y-60 p07_l FC+1984  0 L5  // STND
StartActionXY BWDEBI2   6    p01_x    p01_y    p01_l FC+2048  0 L1  // SIDE

ScaleTo       BMSTEV3  p03_scale     220  FC+1856+220
MoveTo        BMSTEV3  p03_x  p03_y  220  FC+1856+220
	
ScrollBKDTo 0 0 0 0 FC+2080

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