//---------------------------------------------------------------------------
// Lethal Enforcers 2
// 
// Level        Bank
// Round        3
// Background   320, 240
// SetScale     0x00=6680, 0x27=5080
// Layers       255 255 255 255 255   80 54 30 30 30   29 12 0 0 0
//---------------------------------------------------------------------------
// Sprites	Enemy Sets
// 		1   
// BMBOLF	X   
// BMJUN	X   
// BMKEVN	X   
// BMLONG	X   
// BMSTEV	X   
// BMTETS	X   
// BMTHIN	X   
// BMYOSI	X   
// BWTINA	X   
// GMSHEL	X   
// GWCHEK	X   
//---------------------------------------------------------------------------

// Define hit points
define BMBOLF_hp    2
define BMJUN_hp     2
define BMKEVN_hp    2
define BMLONG_hp    2
define BMSTEV_hp    2
define BMTETS_hp    2
define BMTHIN_hp    2
define BMYOSI_hp    2
define BWTINA_hp    1
define GMSHEL_hp    1
define GWCHEK_hp    1

// Define character literals
define BMBOLF1      0
define BMJUN1       1
define BMJUN2       2
define BMJUN3       3
define BMKEVN1      4
define BMKEVN2      5
define BMKEVN3      6
define BMKEVN4      7
define BMLONG1      8
define BMSTEV1      9
define BMSTEV2      10
define BMSTEV3      11
define BMSTEV4      12
define BMTETS1      13
define BMTHIN1      14
define BMTHIN2      15
define BMTHIN3      16
define BMYOSI1      17
define BWTINA1      18
define BWTINA2      19
define GMSHEL1      20
define GWCHEK1      21
define LAMP1        22
define LAMP1b       23
define LAMP2        24
define LAMP2b       25

// 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 (*	1:	front left	*)
define p01_x        0
define p01_y        140
define p01_l        12
define p01_scale    6680

// p02 (*	2:	left	*)
define p02_x        0
define p02_y        130
define p02_l        7
define p02_scale    5244

// p03 (*	3:	left	*)
define p03_x        -27
define p03_y        110
define p03_l        6
define p03_scale    3931

// p04 (*	4:	left counter	*)
define p04_x        89
define p04_y        160
define p04_l        7
define p04_scale    5449

// p05 (*	5:	right counter	*)
define p05_x        124
define p05_y        150
define p05_l        7
define p05_scale    5121

// p06 (*	6:	counter	*)
define p06_x        160
define p06_y        150
define p06_l        7
define p06_scale    4916

// p07 (*	7:	counter	*)
define p07_x        196
define p07_y        150
define p07_l        6
define p07_scale    4465

// p08 (*	8:	counter	*)
define p08_x        235
define p08_y        140
define p08_l        6
define p08_scale    4095

// p09 ()
define p09_x        340
define p09_y        140
define p09_l        13
define p09_scale    5080

// p0A ()
define p0A_x        310
define p0A_y        165
define p0A_l        11
define p0A_scale    6188

// p0B ()
define p0B_x        271
define p0B_y        105
define p0B_l        6
define p0B_scale    3521


// Load backgrounds and sounds
LoadBKD \BACKGRND\LE2\BANK\BANK3.BKD
SetBKDLoc 0 0 0 0
LoadVAB \SOUNDFX\LE2\BANK.VAB

// Load characters
LoadKRT \SPRITES\LE2\BANK\B1\BMBOLF.KRT              // Ch 0 - BMBOLF1
SetScale BMBOLF1 p04_scale
SetTotalHitPoints BMBOLF1 BMBOLF_hp

LoadKRT \SPRITES\LE2\BANK\B1\BMJUN.KRT               // Ch 1 - BMJUN1
SetScale BMJUN1 p05_scale
SetTotalHitPoints BMJUN1 BMJUN_hp

CloneCharacter BMJUN1                             // Ch 2 - BMJUN2    
SetScale BMJUN2 p0B_scale
SetTotalHitPoints BMJUN2 BMJUN_hp

CloneCharacter BMJUN1                             // Ch 3 - BMJUN3    
SetScale BMJUN3 p02_scale
SetTotalHitPoints BMJUN3 BMJUN_hp

LoadKRT \SPRITES\LE2\BANK\B1\BMKEVN.KRT              // Ch 4 - BMKEVN1
SetScale BMKEVN1 p04_scale
SetTotalHitPoints BMKEVN1 BMKEVN_hp

CloneCharacter BMKEVN1                            // Ch 5 - BMKEVN2   
SetScale BMKEVN2 p03_scale
SetTotalHitPoints BMKEVN2 BMKEVN_hp

CloneCharacter BMKEVN1                            // Ch 6 - BMKEVN3   
SetScale BMKEVN3 p01_scale
SetTotalHitPoints BMKEVN3 BMKEVN_hp

CloneCharacter BMKEVN1                            // Ch 7 - BMKEVN4   
SetScale BMKEVN4 p0A_scale
SetTotalHitPoints BMKEVN4 BMKEVN_hp

LoadKRT \SPRITES\LE2\BANK\B1\BMLONG.KRT              // Ch 8 - BMLONG1
SetScale BMLONG1 p07_scale
SetTotalHitPoints BMLONG1 BMLONG_hp

LoadKRT \SPRITES\LE2\BANK\B2\BMSTEV.KRT              // Ch 9 - BMSTEV1
SetScale BMSTEV1 p01_scale
SetTotalHitPoints BMSTEV1 BMSTEV_hp

CloneCharacter BMSTEV1                            // Ch 10 - BMSTEV2  
SetScale BMSTEV2 p02_scale
SetTotalHitPoints BMSTEV2 BMSTEV_hp

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

CloneCharacter BMSTEV1                            // Ch 12 - BMSTEV4  
SetScale BMSTEV4 p03_scale
SetTotalHitPoints BMSTEV4 BMSTEV_hp

LoadKRT \SPRITES\LE2\BANK\B2\BMTETS.KRT              // Ch 13 - BMTETS1
SetScale BMTETS1 p06_scale
SetTotalHitPoints BMTETS1 BMTETS_hp

LoadKRT \SPRITES\LE2\BANK\B2\BMTHIN.KRT              // Ch 14 - BMTHIN1
SetScale BMTHIN1 p0A_scale
SetTotalHitPoints BMTHIN1 BMTHIN_hp

CloneCharacter BMTHIN1                            // Ch 15 - BMTHIN2  
SetScale BMTHIN2 p06_scale
SetTotalHitPoints BMTHIN2 BMTHIN_hp

CloneCharacter BMTHIN1                            // Ch 16 - BMTHIN3  
SetScale BMTHIN3 p0B_scale
SetTotalHitPoints BMTHIN3 BMTHIN_hp

LoadKRT \SPRITES\LE2\BANK\B2\BMYOSI.KRT              // Ch 17 - BMYOSI1
SetScale BMYOSI1 p07_scale*120/100
SetTotalHitPoints BMYOSI1 BMYOSI_hp

LoadKRT \SPRITES\LE2\BANK\B2\BWTINA.KRT              // Ch 18 - BWTINA1
SetScale BWTINA1 p08_scale
SetTotalHitPoints BWTINA1 BWTINA_hp

CloneCharacter BWTINA1                            // Ch 19 - BWTINA2  
SetScale BWTINA2 p08_scale
SetTotalHitPoints BWTINA2 BWTINA_hp

LoadKRT \SPRITES\LE2\BANK\B2\GMSHEL.KRT              // Ch 20 - GMSHEL1
SetScale GMSHEL1 p09_scale
SetTotalHitPoints GMSHEL1 GMSHEL_hp
ObjectCharacteristics GMSHEL1 VICTIM|DISAPPEAR|SCROLL

LoadKRT \SPRITES\LE2\BANK\B2\GWCHEK.KRT              // Ch 21 - GWCHEK1
SetScale GWCHEK1 p07_scale
SetTotalHitPoints GWCHEK1 GWCHEK_hp
ObjectCharacteristics GWCHEK1 VICTIM|DISAPPEAR|SCROLL

LoadKRT \SPRITES\LE2\BANK\B1\B2LAMP.KRT              // Ch 22 - LAMP1
ObjectCharacteristics LAMP1 SCROLL
CloneCharacter LAMP1				  // Ch 23 - LAMP1b
CloneCharacter LAMP1				  // Ch 24 - LAMP2
CloneCharacter LAMP1				  // Ch 25 - LAMP2b
SetDepth LAMP1b 6
SetDepth LAMP2b 6
SetScale LAMP1  4096*75/100
SetScale LAMP1b 4096*75/100
SetScale LAMP2  4096*75/100
SetScale LAMP2b 4096*75/100

// Broken lamps
Link LAMP1b  LAMP1    4  3  0  0  132      66+5
Link LAMP2b  LAMP2    4  3  0  0  236      66+5

PlayTrack 500 0                 // SD_BGM1

// Objects
StartActionXY LAMP1     2    132      66       6     0        0 L1
StartActionXY LAMP2     2    236      66       6     0        0 L1

// Action!
define FC     0  // Frame Counter
StartActionXY BMSTEV1  18    p01_x    p01_y    p01_l FC+64    0 L3  // RUN
StartActionXY BMLONG1   4    p07_x    p07_y    p07_l FC+80    1 L1  // STND
StartActionXY BMJUN1   10    p05_x    p05_y    p05_l FC+160   0 L5  // STND
StartActionXY BMTETS1  10    p06_x    p06_y    p06_l FC+256   0 L5  // STND
StartActionXY BMTHIN1  16    p0A_x    p0A_y    p0A_l FC+258   1 L2  // LOW
StartActionXY BMKEVN1  10    p04_x    p04_y    p04_l FC+352   0 L3  // STND
StartActionXY GMSHEL1   5    p09_x    p09_y    p09_l FC+368   1 L1  // 0x01
StartActionXY BWTINA1   4    p08_x    p08_y    p08_l FC+496   0 L4  // STND
	
StartActionXY BMSTEV2  18    p02_x    p02_y    p02_l FC+512   0 L2  // RUN
ScaleTo       BMSTEV2        p02_scale         0              FC+512
ScaleTo       BMSTEV2        p0B_scale         (p0B_x-p02_x)  FC+512
MoveTo        BMSTEV2        p0B_x    p0B_y    (p0B_x-p02_x)  FC+512
	
StartActionXY BMJUN2   17    p0B_x    p0B_y    p0B_l FC+624   1 L7  // WALK
ScaleTo       BMJUN2         p0B_scale         0              FC+624
ScaleTo       BMJUN2         p02_scale         (p0B_x-p02_x)  FC+624
MoveTo        BMJUN2         p02_x    p02_y    (p0B_x-p02_x)  FC+624
	
StartActionXY BMKEVN2  12    p03_x    p03_y    p03_l FC+628   0 L3  // SIDE
StartActionXY BMKEVN3  16    p01_x-40 p01_y+35 p01_l FC+688   0 L5  // ROLL
StartActionXY BMYOSI1   8    p07_x    p07_y    p07_l FC+724   1 L2  // STND
StartActionXY BMSTEV3  10    p04_x    p04_y    p04_l FC+768   0 L1  // STND
StartActionXY BMTHIN2  10    p06_x    p06_y    p06_l FC+784   0 L4  // STND
StartActionXY BMKEVN4  14    p0A_x    p0A_y    p0A_l FC+864   1 L7  // LOW
StartActionXY BMBOLF1   5    p04_x    p04_y    p04_l FC+865   0 L2  // STND
StartActionXY GWCHEK1   1    p07_x    p07_y-10 p07_l FC+928   0 L1  // STND
StartActionXY BWTINA2   4    p08_x    p08_y    p08_l FC+1024  0 L2  // STND
StartActionXY BMJUN3   12    p02_x    p02_y    p02_l FC+1072  0 L4  // SIDE
	
StartActionXY BMTHIN3  18    p0B_x    p0B_y    p0B_l FC+1152  1 L5  // WALK
ScaleTo       BMTHIN3        p0B_scale         0              FC+1152
ScaleTo       BMTHIN3        p02_scale         (p0B_x-p02_x)  FC+1152
MoveTo        BMTHIN3        p02_x    p02_y    (p0B_x-p02_x)  FC+1152
	
StartActionXY BMSTEV4  12    p03_x    p03_y    p03_l FC+1153  0 L1  // SIDE
ScrollBKDTo 0 0 0 0 FC+1185

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