//---------------------------------------------------------------------------
// Lethal Enforcers 2
// 
// Level        Bank
// Round        5
// Background   568, 240
// SetScale     0x01=8192, 0x53=3391
// Layers       255 103 82 73 73   72 64 57 53 53   52 12 1 0 0
//---------------------------------------------------------------------------
// Sprites	Enemy Sets
// 		1   2   
// BMBOLF	X       
// BMJUN	X       
// BMKEVN	X       
// BMLONG	X       
// BMSTEV	X       
// BMTETS	X       
// BMTHIN	X       
// BMYOSI	X       
// BS1JUN	    X   
// BWTINA	X       
// GMBILL	X       
// GWMARL	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 BOSS_hp      2
define BWTINA_hp    1
define GMBILL_hp    1
define GWMARL_hp    1

// Define character literals
define BMBOLF1      0
define BMBOLF2      1
define BMBOLF3      2
define BMJUN1       3
define BMKEVN1      4
define BMKEVN2      5
define BMKEVN3      6
define BMKEVN4      7
define BMKEVN5      8
define BMLONG1      9
define BMLONG2      10
define BMSTEV1      11
define BMSTEV2      12
define BMSTEV3      13
define BMSTEV4      14
define BMTETS1      15
define BMTHIN1      16
define BMTHIN2      17
define BMTHIN3      18
define BMTHIN4      19
define BMTHIN5      20
define BMYOSI1      21
define BOSSCANNON   22
define BWTINA1      23
define BWTINA2      24
define GMBILL1      25
define GWMARL1      26
define WALLTOP      27
define WALLBOT      28
define EXPLODE      29
define CANNONBALL1  30
define CANNONBALL2  31
define CANNONBALL3  32
define CANNONBALL4  33
define CANNON1      34
define CANNON2      35
define CANNON3      36
define CURTAIN      37
define WOODBOARD    38
define SMALLFIRE    39

// 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: right 1)
define p01_x        380
define p01_y        140
define p01_l        12
define p01_scale    8192

// p02 (2: right 2)
define p02_x        325
define p02_y        150
define p02_l        8
define p02_scale    5147

// p03 (3: right 3)
define p03_x        329
define p03_y        140
define p03_l        3
define p03_scale    3976

// p04 (4: right 4)
define p04_x        321
define p04_y        120
define p04_l        2
define p04_scale    3450

// p04_1 (right 4 for bma run)
define p04_1_x      350
define p04_1_y      110
define p04_1_l      2
define p04_1_scale  3450

// p05 (5: right 5)
define p05_x        304
define p05_y        105
define p05_l        1
define p05_scale    2161

// p06 (6: left 1)
define p06_x        119
define p06_y        120
define p06_l        2
define p06_scale    3391

// p07 (behinkd bank for left side, run)
define p07_x        129
define p07_y        110
define p07_l        1
define p07_scale    2220

// p08 (8: left 3)
define p08_x        -10
define p08_y        160
define p08_l        11
define p08_scale    7548

// p09 (9: jump from window)
define p09_x        61
define p09_y        150
define p09_l        6
define p09_scale    4503

// p0a (side from window)
define p0a_x        55
define p0a_y        135
define p0a_l        7
define p0a_scale    4913

// pbos (a: boss)
define pbos_x       421
define pbos_y       124
define pbos_l       2
define pbos_scale   4096

// p0l (b: left)
define p0l_x        291
define p0l_y        190
define p0l_l        6
define p0l_scale    4445

// p0r (c: right)
define p0r_x        580
define p0r_y        190
define p0r_l        6
define p0r_scale    4503


// Load backgrounds and sounds
LoadBKD \BACKGRND\LE2\BANK\BANK5.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 p0a_scale
SetTotalHitPoints BMBOLF1 BMBOLF_hp

CloneCharacter BMBOLF1                            // Ch 1 - BMBOLF2   
SetScale BMBOLF2 p03_scale
SetTotalHitPoints BMBOLF2 BMBOLF_hp

CloneCharacter BMBOLF1                            // Ch 2 - BMBOLF3   
SetScale BMBOLF3 p05_scale
SetTotalHitPoints BMBOLF3 BMBOLF_hp

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

LoadKRT \SPRITES\LE2\BANK\B1\BMKEVN.KRT              // Ch 4 - BMKEVN1
SetScale BMKEVN1 p01_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 p06_scale
SetTotalHitPoints BMKEVN3 BMKEVN_hp

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

CloneCharacter BMKEVN1                            // Ch 8 - BMKEVN5   
SetScale BMKEVN5 p04_1_scale
SetTotalHitPoints BMKEVN5 BMKEVN_hp

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

CloneCharacter BMLONG1                            // Ch 10 - BMLONG2  
SetScale BMLONG2 p03_scale
SetTotalHitPoints BMLONG2 BMLONG_hp

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

CloneCharacter BMSTEV1                            // Ch 12 - BMSTEV2  
SetScale BMSTEV2 p04_1_scale
SetTotalHitPoints BMSTEV2 BMSTEV_hp

CloneCharacter BMSTEV1                            // Ch 13 - BMSTEV3  
SetScale BMSTEV3 p05_scale
SetTotalHitPoints BMSTEV3 BMSTEV_hp

CloneCharacter BMSTEV1                            // Ch 14 - BMSTEV4  
SetScale BMSTEV4 p06_scale
SetTotalHitPoints BMSTEV4 BMSTEV_hp

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

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

CloneCharacter BMTHIN1                            // Ch 17 - BMTHIN2  
SetScale BMTHIN2 p09_scale
SetTotalHitPoints BMTHIN2 BMTHIN_hp

CloneCharacter BMTHIN1                            // Ch 18 - BMTHIN3  
SetScale BMTHIN3 p01_scale
SetTotalHitPoints BMTHIN3 BMTHIN_hp

CloneCharacter BMTHIN1                            // Ch 19 - BMTHIN4  
SetScale BMTHIN4 p06_scale
SetTotalHitPoints BMTHIN4 BMTHIN_hp

CloneCharacter BMTHIN1                            // Ch 20 - BMTHIN5  
SetScale BMTHIN5 p06_scale
SetTotalHitPoints BMTHIN5 BMTHIN_hp

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

LoadKRT \SPRITES\LE2\BANK\B2\BOSS1.KRT               // Ch 22 - BOSS
ObjectCharacteristics BOSSCANNON BOSS|START_ANIM
SetScale BOSSCANNON pbos_scale

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

CloneCharacter BWTINA1                            // Ch 24 - BWTINA2  
SetScale BWTINA2 p07_scale
SetTotalHitPoints BWTINA2 BWTINA_hp

LoadKRT \SPRITES\LE2\BANK\B2\GMBILL.KRT              // Ch 25 - GMBILL1
SetScale GMBILL1 p07_scale
SetTotalHitPoints GMBILL1 GMBILL_hp
ObjectCharacteristics GMBILL1 VICTIM|DISAPPEAR|SCROLL

LoadKRT \SPRITES\LE2\BANK\B2\GWMARL.KRT              // Ch 26 - GWMARL1
SetScale GWMARL1 p04_scale
SetTotalHitPoints GWMARL1 GWMARL_hp
ObjectCharacteristics GWMARL1 VICTIM|DISAPPEAR|SCROLL

LoadKRT \SPRITES\LE2\BANK\B1\B5WALL.KRT              // Ch 27 - WALLTOP
ObjectCharacteristics WALLTOP NOKILL|SCROLL 
CloneCharacter WALLTOP                            // Ch 28 - WALLBOT
	
LoadKRT \SPRITES\LE2\BANK\B1\B5EXP.KRT               // Ch 29 - EXPLODE
ObjectCharacteristics EXPLODE NOKILL|SCROLL

LoadKRT \SPRITES\LE2\BANK\B2\CANONB.KRT              // Ch 30 - CANNONBALL1
ObjectCharacteristics CANNONBALL1 SCROLL|ARROW|THROWN|DISAPPEAR
CloneCharacter CANNONBALL1                        // Ch 31 - CANNONBALL2
CloneCharacter CANNONBALL1                        // Ch 32 - CANNONBALL3
CloneCharacter CANNONBALL1                        // Ch 33 - CANNONBALL4

LoadKRT \SPRITES\LE2\BANK\B2\CANON.KRT               // Ch 34 - CANNON1
ObjectCharacteristics CANNON1 NOKILL|SCROLL
CloneCharacter CANNON1                            // Ch 35 - CANNON2
CloneCharacter CANNON1                            // Ch 36 - CANNON3

LoadKRT \SPRITES\LE2\BANK\B2\CURTAIN.KRT             // Ch 37 - CURTAIN
ObjectCharacteristics CURTAIN NOKILL|SCROLL|START_ANIM

LoadKRT \SPRITES\LE2\BANK\B2\WDBOARD.KRT             // Ch 38 - WOODBOARD
ObjectCharacteristics WOODBOARD NOKILL|SCROLL|START_ANIM

LoadKRT \SPRITES\LE2\BANK\B2\SMLFIRE.KRT             // Ch 39 - SMALLFIRE
ObjectCharacteristics SMALLFIRE NOKILL

AssignProjectile BOSSCANNON CANNONBALL1
AssignProjectile BOSSCANNON CANNONBALL2
AssignProjectile BOSSCANNON CANNONBALL3
AssignProjectile BOSSCANNON CANNONBALL4

PlayTrack 503 0                 // SD_BGM4

// Boom!
define FC     0
StartActionXY CURTAIN   0    417      47        3    FC+0     0 L1
StartActionXY WOODBOARD 0    417      93        3    FC+0     0 L1
StartActionXY WALLTOP   0    92       60       11    FC+0     0 L1
StartActionXY WALLBOT   1    92       180      11    FC+0     0 L1
StopAction    WALLTOP   FC+120
StopAction    WALLBOT   FC+120
StartActionXY EXPLODE   0    120      88       6     FC+120   0 L1

// Action!
define FC     100  // Frame Counter
StartActionXY BMKEVN1  12    p01_x    p01_y    p01_l FC+32    1 L1  // SIDE
StartActionXY BMTHIN1  12    p06_x    p06_y    p06_l FC+160   0 L5  // SIDE
StartActionXY BMSTEV1  12    p02_x    p02_y    p02_l FC+192   1 L1  // SIDE
StartActionXY GMBILL1   2    p07_x    p07_y    p07_l FC+208   0 L1  // 0x05
StartActionXY BMLONG1   6    p08_x    p08_y    p08_l FC+320   0 L1  // SIDE
StartActionXY BMTHIN2  14    p09_x    p09_y    p09_l FC+322   0 L5  // JUMP
StartActionXY BMKEVN2  14    p03_x    p03_y    p03_l FC+384   1 L2  // LOW
StartActionXY BMBOLF1   9    p0a_x    p0a_y    p0a_l FC+512   0 L1  // 0x08
StartActionXY BMSTEV2  18  p04_1_x  p04_1_y  p04_1_l FC+528   1 L3  // RUN
StartActionXY BMKEVN3  16    p06_x    p06_y+10 p06_l FC+688   0 L4  // ROLL
StartActionXY BWTINA1   6    p08_x    p08_y    p08_l FC+704   0 L1  // SIDE
StartActionXY BMSTEV3  18    p05_x    p05_y    p05_l FC+768   1 L6  // WALK
StartActionXY GWMARL1   2    p04_x    p04_y    p04_l FC+832   1 L1  // WALK
StartActionXY BMTHIN3  14    p01_x-30 p01_y+60 p01_l FC+928   1 L3  // JUMP
StartActionXY BMTHIN4  18    p06_x    p06_y    p06_l FC+930   0 L2  // WALK
StartActionXY BMBOLF2   7    p03_x    p03_y    p03_l FC+962   1 L1  // SIDE
StartActionXY BMKEVN4  18    p07_x    p07_y    p07_l FC+994   0 L7  // WALK
StartActionXY BMLONG2   8    p03_x    p03_y    p03_l FC+1120  1 L5  // LOW
StartActionXY BMJUN1   17    p07_x    p07_y    p07_l FC+1216  0 L1  // WALK
StartActionXY BMKEVN5  18  p04_1_x  p04_1_y+10 p04_1_l FC+1218  1 L5  // WALK
StartActionXY BMYOSI1  10    p0a_x-5  p0a_y    p0a_l FC+1224  0 L1  // LOW
StartActionXY BMSTEV4  17    p06_x-9  p06_y    p06_l FC+1344  0 L7  // ROLL
StartActionXY BMTETS1  14    p08_x    p08_y+30 p08_l FC+1346  0 L3  // LOW
StartActionXY BMBOLF3   7    p05_x    p05_y+5  p05_l FC+1408  1 L5  // SIDE
StartActionXY BWTINA2   6    p07_x-4  p07_y    p07_l FC+1424  0 L6  // SIDE
StartActionXY BMTHIN5  16    p06_x+6  p06_y    p06_l FC+1440  0 L1  // LOW

StopAction EXPLODE FC+1472
ScrollBKDTo 0 -248 0 248 FC+1472

define FC  FC+1472+248  // Frame Counter
StartActionXY CANNON1   0    369      93        3    FC+0     0 L1
StartActionXY CANNON2   0    418      93        3    FC+0     0 L1
StartActionXY CANNON3   0    467      93        3    FC+0     0 L1
StartActionXY BOSSCANNON  9  418      84        1    FC+0     0 L1
AddEnemyLife  BOSSCANNON  FC+0
StartActionXY SMALLFIRE   0  478     130        2    FC+0     0 L1
StartActionXY CURTAIN     1  417      47        4    FC+0     0 L1
StartActionXY WOODBOARD   1  417      93        4    FC+90    0 L1
//StartActionXY CANNONBALL1 0  370      92       14    FC+150   0 L1
//StartActionXY CANNONBALL2 0  424      92       14    FC+250   0 L1
//StartActionXY CANNONBALL3 0  467      92       14    FC+350   0 L1

EndRound 0
