//---------------------------------------------------------------------------
// Lethal Enforcers 2
// 
// Level        Bank
// Round        2
// Background   568, 240
// SetScale     0x36=4096, 0x1d=5280
// Layers       255 255 255 255 255   66 65 54 53 53   52 32 29 29 29
//---------------------------------------------------------------------------
// Sprites	Enemy Sets
// 		1   2   
// BMBOLF	    X   
// BMJUN	X   X   
// BMKEVN	X   X   
// BMLONG	X   X   
// BMSTEV	X   X   
// BMTETS	    X   
// BMTHIN	X   X   
// BMYOSI	    X   
// BWTINA	X       
// GWCHEK	    X   
// GWLIND	    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 BWTINA_hp    1
define GWCHEK_hp    1
define GWLIND_hp    1
define GWMARL_hp    1
define GMTALL_hp    1
define GMBILL_hp    1

// Define character literals
define BMBOLF1      0
define BMJUN1       1
define BMJUN2       2
define BMKEVN1      3
define BMKEVN2      4
define BMKEVN3      5
define BMKEVN4      6
define BMKEVN5      7
define BMKEVN6      8
define BMKEVN7      9
define BMLONG1      10
define BMLONG2      11
define BMLONG3      12
define BMLONG4      13
define BMSTEV1      14
define BMSTEV2      15
define BMSTEV3      16
define BMSTEV4      17
define BMSTEV5      18
define BMSTEV6      19
define BMSTEV7      20
define BMSTEV8      21
define BMTETS1      22
define BMTETS2      23
define BMTHIN1      24
define BMTHIN2      25
define BMTHIN3      26
define BMTHIN4      27
define BMTHIN5      28
define BMTHIN6      29
define BMTHIN7      30
define BMYOSI1      31
define BWTINA1      32
define GWCHEK1      33
define GWLIND1      34
define GWMARL1      35
define GMTALL1      36
define GMBILL1      37
define SAFEDOOR     38
define LAMP1        39
define LAMP1b       40
define LAMP2        41
define LAMP2b	    42
define TWIN         43
define CANNON       44

// 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 (front left)
define p01_x        5
define p01_y        130
define p01_l        12
define p01_scale    5280

// p02 (left)
define p02_x        10
define p02_y        130
define p02_l        8
define p02_scale    4096

// p03 (side from left screen behind counter)
define p03_x        0
define p03_y        125
define p03_l        9
define p03_scale    4143

// p04 (low from right, stand behind counter)
define p04_x        165
define p04_y        135
define p04_l        9
define p04_scale    4143

// p05 (counter)
define p05_x        210
define p05_y        140
define p05_l        9
define p05_scale    4143

// p06 (counter)
define p06_x        235
define p06_y        150
define p06_l        9
define p06_scale    4143

// p07 (counter)
define p07_x        245
define p07_y        140
define p07_l        9
define p07_scale    4143

// p08 (door left)
define p08_x        320
define p08_y        140
define p08_l        12
define p08_scale    5280

// p11 (front left)
define p11_x        249
define p11_y        140
define p11_l        12
define p11_scale    5280

// p13 (counter)
define p13_x        302
define p13_y        145
define p13_l        9
define p13_scale    4143

// p14 (counter)
define p14_x        340
define p14_y        125
define p14_l        9
define p14_scale    4143

// p15 (counter)
define p15_x        373
define p15_y        135
define p15_l        9
define p15_scale    4143

// p16 (side from left entrance)
define p16_x        430
define p16_y        120
define p16_l        9
define p16_scale    4143

// p17 ()
define p17_x        535
define p17_y        140
define p17_l        9
define p17_scale    4143

// p18 (right door)
define p18_x        575
define p18_y        140
define p18_l        11
define p18_scale    5138

// p19 (inside safe)
define p19_x        370
define p19_y        135
define p19_l        6
define p19_scale    3575


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

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

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

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

CloneCharacter BMKEVN1                            // Ch 4 - BMKEVN2   
SetScale BMKEVN2 p04_scale
SetTotalHitPoints BMKEVN2 BMKEVN_hp

CloneCharacter BMKEVN1                            // Ch 5 - BMKEVN3   
SetScale BMKEVN3 p05_scale
SetTotalHitPoints BMKEVN3 BMKEVN_hp

CloneCharacter BMKEVN1                            // Ch 6 - BMKEVN4   
SetScale BMKEVN4 p13_scale
SetTotalHitPoints BMKEVN4 BMKEVN_hp

CloneCharacter BMKEVN1                            // Ch 7 - BMKEVN5   
SetScale BMKEVN5 p11_scale
SetTotalHitPoints BMKEVN5 BMKEVN_hp

CloneCharacter BMKEVN1                            // Ch 8 - BMKEVN6   
SetScale BMKEVN6 p13_scale
SetTotalHitPoints BMKEVN6 BMKEVN_hp

CloneCharacter BMKEVN1                            // Ch 9 - BMKEVN7   
SetScale BMKEVN7 p18_scale
SetTotalHitPoints BMKEVN7 BMKEVN_hp

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

CloneCharacter BMLONG1                            // Ch 11 - BMLONG2  
SetScale BMLONG2 p07_scale
SetTotalHitPoints BMLONG2 BMLONG_hp

CloneCharacter BMLONG1                            // Ch 12 - BMLONG3  
SetScale BMLONG3 p16_scale
SetTotalHitPoints BMLONG3 BMLONG_hp

CloneCharacter BMLONG1                            // Ch 13 - BMLONG4  
SetScale BMLONG4 p18_scale
SetTotalHitPoints BMLONG4 BMLONG_hp

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

CloneCharacter BMSTEV1                            // Ch 15 - BMSTEV2  
SetScale BMSTEV2 p01_scale
SetTotalHitPoints BMSTEV2 BMSTEV_hp

CloneCharacter BMSTEV1                            // Ch 16 - BMSTEV3  
SetScale BMSTEV3 p08_scale
SetTotalHitPoints BMSTEV3 BMSTEV_hp

CloneCharacter BMSTEV1                            // Ch 17 - BMSTEV4  
SetScale BMSTEV4 p01_scale
SetTotalHitPoints BMSTEV4 BMSTEV_hp

CloneCharacter BMSTEV1                            // Ch 18 - BMSTEV5  
SetScale BMSTEV5 p07_scale
SetTotalHitPoints BMSTEV5 BMSTEV_hp

CloneCharacter BMSTEV1                            // Ch 19 - BMSTEV6  
SetScale BMSTEV6 p19_scale
SetTotalHitPoints BMSTEV6 BMSTEV_hp

CloneCharacter BMSTEV1                            // Ch 20 - BMSTEV7  
SetScale BMSTEV7 p13_scale
SetTotalHitPoints BMSTEV7 BMSTEV_hp

CloneCharacter BMSTEV1                            // Ch 21 - BMSTEV8  
SetScale BMSTEV8 p16_scale
SetTotalHitPoints BMSTEV8 BMSTEV_hp

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

CloneCharacter BMTETS1                            // Ch 23 - BMTETS2  
SetScale BMTETS2 p15_scale
SetTotalHitPoints BMTETS2 BMTETS_hp

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

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

CloneCharacter BMTHIN1                            // Ch 26 - BMTHIN3  
SetScale BMTHIN3 p02_scale
SetTotalHitPoints BMTHIN3 BMTHIN_hp

CloneCharacter BMTHIN1                            // Ch 27 - BMTHIN4  
SetScale BMTHIN4 p11_scale
SetTotalHitPoints BMTHIN4 BMTHIN_hp

CloneCharacter BMTHIN1                            // Ch 28 - BMTHIN5  
SetScale BMTHIN5 p13_scale
SetTotalHitPoints BMTHIN5 BMTHIN_hp

CloneCharacter BMTHIN1                            // Ch 29 - BMTHIN6  
SetScale BMTHIN6 p17_scale
SetTotalHitPoints BMTHIN6 BMTHIN_hp

CloneCharacter BMTHIN1                            // Ch 30 - BMTHIN7  
SetScale BMTHIN7 p13_scale
SetTotalHitPoints BMTHIN7 BMTHIN_hp

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

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

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

LoadKRT \SPRITES\LE2\BANK\B2\GWLIND.KRT              // Ch 34 - GWLIND1
SetScale GWLIND1 p14_scale
SetTotalHitPoints GWLIND1 GWLIND_hp
ObjectCharacteristics GWLIND1 VICTIM|DISAPPEAR|SCROLL

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

LoadKRT \SPRITES\LE2\BANK\B2\GMTALL.KRT              // Ch 36 - GMTALL1
SetScale GMTALL1 p05_scale
SetTotalHitPoints GMBILL1 GMTALL_hp
ObjectCharacteristics GMTALL1 VICTIM|DISAPPEAR|SCROLL
	
LoadKRT \SPRITES\LE2\BANK\B2\GMBILL.KRT              // Ch 37 - GMBILL1
SetScale GMBILL1 p14_scale
SetTotalHitPoints GMBILL1 GMBILL_hp
ObjectCharacteristics GMBILL1 VICTIM|DISAPPEAR|SCROLL

LoadKRT \SPRITES\LE2\BANK\B1\B2DOOR.KRT              // Ch 38 - SAFEDOOR
ObjectCharacteristics SAFEDOOR SCROLL|NOKILL

LoadKRT \SPRITES\LE2\BANK\B1\B2LAMP.KRT              // Ch 39 - LAMP1
ObjectCharacteristics LAMP1 SCROLL
CloneCharacter LAMP1				  // Ch 40 - LAMP1b
CloneCharacter LAMP1				  // Ch 41 - LAMP2
CloneCharacter LAMP1				  // Ch 42 - LAMP2b
SetDepth LAMP1b 6
SetDepth LAMP2b 6

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

// Hostages
SetDepth BMSTEV1 p05_l
Link BMSTEV1 GMTALL1 16  1  0  0  p05_x    p05_y	// Stand when hostage stands
Link BMSTEV1 GMTALL1 10  0  0  0  p05_x    p05_y	// Shoot when hostage dies
Link GMTALL1 BMSTEV1  2  0  0  0  p05_x+27 p05_y	// Run when bad guy dies

SetDepth BMKEVN4 p13_l
Link BMKEVN4 GMBILL1 17  1  0  0  p13_x    p13_y	// Stand when hostage stands
Link BMKEVN4 GMBILL1 10  0  0  0  p13_x    p13_y	// Shoot when hostage dies
Link GMBILL1 BMKEVN4  2  0  0  0  p13_x+27 p13_y	// Run when bad guy dies

// Broken lamps
Link LAMP1b  LAMP1    4  3  0  0  48       72+7
Link LAMP2b  LAMP2    4  3  0  0  224      72+7

PlayTrack 500 0                 // SD_BGM1

// Objects
StartActionXY LAMP1     2    48       72       6     0        0 L1
StartActionXY LAMP2     2    224      72       6     0        0 L1
StartActionXY TWIN      0    172      68       6     0        0 L1

// Action!
define FC     0  // Frame Counter
StartActionXY BMLONG1   8    p02_x    p02_y    p02_l FC+32    0 L1  // LOW
StartActionXY GMTALL1   1    p05_x+27 p05_y    p05_l+1 FC+63  0 L1  // Hostage
StartActionXY BMSTEV1  10    p05_x    p05_y    p05_l FC+64    0 L1  // STND (after hostage)
StartActionXY BMKEVN1  10    p07_x    p07_y    p07_l FC+192   0 L2  // STND
StartActionXY BMTHIN1  12    p03_x    p03_y    p03_l FC+224   0 L5  // SIDE
StartActionXY BMSTEV2  18    p01_x    p01_y    p01_l FC+288   0 L3  // RUN
StartActionXY BMJUN1   17    p08_x    p08_y    p08_l FC+384   1 L7  // WALK
StartActionXY BMKEVN2  14    p04_x    p04_y    p04_l FC+386   1 L1  // LOW
StartActionXY BMLONG2   4    p07_x    p07_y    p07_l FC+512   0 L1  // STND
StartActionXY BMSTEV3  17    p08_x+20 p08_y+20 p08_l FC+576   1 L4  // ROLL
Attach CANNON BMSTEV3 5 0 FC+576 0 0 p08_l L1
	
StartActionXY BMTHIN2  10    p06_x    p06_y    p06_l FC+640   1 L2  // STND
StartActionXY BWTINA1   6    p03_x+5  p03_y    p03_l FC+641   0 L5  // SIDE
StartActionXY GWMARL1   2    p14_x    p14_y    p14_l FC+704   1 L1  // WALK
StartActionXY BMSTEV4  12    p01_x    p01_y    p01_l FC+768   0 L6  // SIDE
StartActionXY BMTHIN3  12    p02_x    p02_y    p02_l FC+832   0 L2  // SIDE
StartActionXY BMKEVN3  10    p05_x    p05_y    p05_l FC+833   0 L5  // STND
StartActionXY BMSTEV5  10    p07_x    p07_y    p07_l FC+896   0 L3  // STND
ScrollBKDTo 0 -248 0 60 FC+928

define FC  FC+928  // Frame Counter
StartActionXY SAFEDOOR  4    p19_x-5  p19_y-45 7     FC+1     0 L1  // Delay 120 frame & open
StartActionXY BMSTEV6  10    p19_x    p19_y    p19_l FC+129   0 L1  // 0x11
StartActionXY BMTHIN4  12    p11_x    p11_y    p11_l FC+176   0 L1  // SIDE
StartActionXY BMSTEV7  10    p13_x    p13_y    p13_l FC+256   0 L5  // STND
StartActionXY BMLONG3   6    p16_x    p16_y    p16_l FC+272   0 L1  // SIDE
StartActionXY BMJUN2   17    p18_x    p18_y    p18_l FC+384   1 L5  // WALK
StartActionXY GMBILL1   1    p13_x+27 p13_y    p13_l+1 FC+399   0 L1  // Hostage
StartActionXY BMKEVN4  10    p13_x    p13_y    p13_l FC+400   0 L1  // STND (after hostage)
StartActionXY BMTETS1  14    p16_x    p16_y+15 p16_l FC+448   0 L5  // LOW
StartActionXY BMLONG4   6    p18_x    p18_y    p18_l FC+450   1 L2  // SIDE
StartActionXY BMTHIN5  10    p13_x    p13_y    p13_l FC+512   0 L5  // STND
StartActionXY GWLIND1   1    p14_x    p14_y+20 p14_l FC+576   0 L1  // STND
StartActionXY BMKEVN5  14    p11_x    p11_y+15 p11_l FC+578   0 L6  // LOW
StartActionXY BMYOSI1   8    p15_x-5  p15_y+10  p15_l FC+672   0 L3  // STND
StartActionXY BMKEVN6  10    p13_x    p13_y    p13_l FC+768   0 L5  // STND
StartActionXY BMTHIN6  16    p17_x    p17_y    p17_l FC+770   1 L2  // LOW
StartActionXY BMTETS2  10    p15_x    p15_y    p15_l FC+772   0 L5  // STND
StartActionXY BMTHIN7  10    p13_x    p13_y    p13_l FC+800   0 L1  // STND
StartActionXY GWCHEK1   1    p15_x    p15_y+5  p15_l FC+896   0 L1  // STND
StartActionXY BMSTEV8  12    p16_x    p16_y    p16_l FC+912   0 L4  // SIDE
StartActionXY BMKEVN7  18    p18_x    p18_y    p18_l FC+960   1 L5  // WALK
StartActionXY BMBOLF1   9    p16_x    p16_y    p16_l FC+1000  1 L1  // 0x08
ScrollBKDTo 0 -248 0 0 FC+1056

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