//---------------------------------------------------------------------------
// Lethal Enforcers 2
// 
// Level        Saloon
// Round        6
// Background   320, 240
// SetScale     -10=5000, 0x12=3094
// Layers       255 18 18 18 18   17 11 8 5 1   0 -9 -10 -13 -13
//---------------------------------------------------------------------------
// Sprites	Enemy Sets
// 		1   
// BGJACK	X   
// BGMEXK	X   
// BGMEXS	X   
// BGMIKE	X   
// BGSTEV	X   
// BGTHIN	X   
// GMDEPT	X   
// GMDRNK	X   
//---------------------------------------------------------------------------

// Define hit points
define BGJACK_hp    2
define BGMEXK_hp    2
define BGMEXS_hp    2
define BGMIKE_hp    2
define BGSTEV_hp    2
define BGTHIN_hp    2
define GMDEPT_hp    1
define GMDRNK_hp    1

// Define character literals
define BGJACK1      0
define BGJACK2      1
define BGJACK3      2
define BGJACK4      3
define BGJACK5      4
define BGMEXK1      5
define BGMEXS1      6
define BGMEXS2      7
define BGMEXS3      8
define BGMEXS4      9
define BGMEXS5      10
define BGMIKE1      11
define BGMIKE2      12
define BGMIKE3      13
define BGMIKE4      14
define BGMIKE5      15
define BGMIKE6      16
define BGMIKE7      17
define BGSTEV1      18
define BGSTEV2      19
define BGSTEV3      20
define BGSTEV4      21
define BGSTEV5      22
define BGSTEV6      23
define BGSTEV7      24
define BGTHIN1      25
define BGTHIN2      26
define BGTHIN3      27
define GMDEPT1      28
define GMDRNK1      29
define GMRUSH1      30
define SALWIND      31
define PANE1        32
define PANE2        33
define PANE3        34
define KNIFE1       35

// 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 or low from right behind box #1)
define p01_x        194
define p01_y        195
define p01_l        7
define p01_scale    3775

// p02 (stand behind box #2)
define p02_x        243
define p02_y        190
define p02_l        6
define p02_scale    3571

// p03 (side from left bihind house)
define p03_x        80
define p03_y        185
define p03_l        8
define p03_scale    3979

// p04 (stand from window)
define p04_x        20
define p04_y        195
define p04_l        8
define p04_scale    4251

// p05 (side from left screen)
define p05_x        -25
define p05_y        185
define p05_l        11
define p05_scale    4932

// p06 (low (not for side) from right screen)
define p06_x        338
define p06_y        190
define p06_l        13
define p06_scale    5204

// p07 (stand from above bihind house)
define p07_x        75
define p07_y        110
define p07_l        8
define p07_scale    3979

// p08 (right jump from bihind right screen)
define p08_x        285
define p08_y        190
define p08_l        6
define p08_scale    3230

// p09 (sheriff from screen right)
define p09_x        330
define p09_y        185
define p09_l        12
define p09_scale    5000

// p0a (stand from window #2)
define p0a_x        245
define p0a_y        180
define p0a_l        1
define p0a_scale    3094


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

// Load characters
LoadKRT \SPRITES\LE2\SALOON\S1\BGJACK.KRT     // Ch 0 - BGJACK1
SetScale BGJACK1 p07_scale
SetTotalHitPoints BGJACK1 BGJACK_hp

CloneCharacter BGJACK1                            // Ch 1 - BGJACK2   
SetScale BGJACK2 p0a_scale
SetTotalHitPoints BGJACK2 BGJACK_hp

CloneCharacter BGJACK1                            // Ch 2 - BGJACK3   
SetScale BGJACK3 p08_scale
SetTotalHitPoints BGJACK3 BGJACK_hp

CloneCharacter BGJACK1                            // Ch 3 - BGJACK4   
SetScale BGJACK4 p02_scale
SetTotalHitPoints BGJACK4 BGJACK_hp

CloneCharacter BGJACK1                            // Ch 4 - BGJACK5   
SetScale BGJACK5 p03_scale
SetTotalHitPoints BGJACK5 BGJACK_hp

LoadKRT \SPRITES\LE2\SALOON\S1\BGMEXK.KRT     // Ch 5 - BGMEXK1
SetScale BGMEXK1 p05_scale
SetTotalHitPoints BGMEXK1 BGMEXK_hp

LoadKRT \SPRITES\LE2\SALOON\S1\BGMEXS.KRT     // Ch 6 - BGMEXS1
SetScale BGMEXS1 p01_scale
SetTotalHitPoints BGMEXS1 BGMEXS_hp

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

CloneCharacter BGMEXS1                            // Ch 8 - BGMEXS3   
SetScale BGMEXS3 p0a_scale
SetTotalHitPoints BGMEXS3 BGMEXS_hp

CloneCharacter BGMEXS1                            // Ch 9 - BGMEXS4   
SetScale BGMEXS4 p01_scale
SetTotalHitPoints BGMEXS4 BGMEXS_hp

CloneCharacter BGMEXS1                            // Ch 10 - BGMEXS5  
SetScale BGMEXS5 p05_scale
SetTotalHitPoints BGMEXS5 BGMEXS_hp

LoadKRT \SPRITES\LE2\SALOON\S1\BGMIKE.KRT     // Ch 11 - BGMIKE1
SetScale BGMIKE1 p05_scale
SetTotalHitPoints BGMIKE1 BGMIKE_hp

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

CloneCharacter BGMIKE1                            // Ch 13 - BGMIKE3  
SetScale BGMIKE3 p01_scale
SetTotalHitPoints BGMIKE3 BGMIKE_hp

CloneCharacter BGMIKE1                            // Ch 14 - BGMIKE4  
SetScale BGMIKE4 p06_scale
SetTotalHitPoints BGMIKE4 BGMIKE_hp

CloneCharacter BGMIKE1                            // Ch 15 - BGMIKE5  
SetScale BGMIKE5 p04_scale
SetTotalHitPoints BGMIKE5 BGMIKE_hp

CloneCharacter BGMIKE1                            // Ch 16 - BGMIKE6  
SetScale BGMIKE6 p01_scale
SetTotalHitPoints BGMIKE6 BGMIKE_hp

CloneCharacter BGMIKE1                            // Ch 17 - BGMIKE7  
SetScale BGMIKE7 p02_scale
SetTotalHitPoints BGMIKE7 BGMIKE_hp

LoadKRT \SPRITES\LE2\SALOON\S1\BGSTEV.KRT     // Ch 18 - BGSTEV1
SetScale BGSTEV1 p01_scale
SetTotalHitPoints BGSTEV1 BGSTEV_hp

CloneCharacter BGSTEV1                            // Ch 19 - BGSTEV2  
SetScale BGSTEV2 p03_scale
SetTotalHitPoints BGSTEV2 BGSTEV_hp

CloneCharacter BGSTEV1                            // Ch 20 - BGSTEV3  
SetScale BGSTEV3 p02_scale
SetTotalHitPoints BGSTEV3 BGSTEV_hp

CloneCharacter BGSTEV1                            // Ch 21 - BGSTEV4  
SetScale BGSTEV4 p07_scale
SetTotalHitPoints BGSTEV4 BGSTEV_hp

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

CloneCharacter BGSTEV1                            // Ch 23 - BGSTEV6  
SetScale BGSTEV6 p07_scale
SetTotalHitPoints BGSTEV6 BGSTEV_hp

CloneCharacter BGSTEV1                            // Ch 24 - BGSTEV7  
SetScale BGSTEV7 p06_scale
SetTotalHitPoints BGSTEV7 BGSTEV_hp

LoadKRT \SPRITES\LE2\SALOON\S1\BGTHIN.KRT     // Ch 25 - BGTHIN1
SetScale BGTHIN1 p04_scale
SetTotalHitPoints BGTHIN1 BGTHIN_hp

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

CloneCharacter BGTHIN1                            // Ch 27 - BGTHIN3  
SetScale BGTHIN3 p0a_scale
SetTotalHitPoints BGTHIN3 BGTHIN_hp

LoadKRT \SPRITES\LE2\SALOON\S1\GMDEPT.KRT     // Ch 28 - GMDEPT1
SetScale GMDEPT1 p09_scale
SetTotalHitPoints GMDEPT1 GMDEPT_hp
ObjectCharacteristics GMDEPT1 VICTIM|DISAPPEAR|SCROLL

LoadKRT \SPRITES\LE2\SALOON\S1\GMDRNK.KRT     // Ch 29 - GMDRNK1
SetScale GMDRNK1 p08_scale
SetTotalHitPoints GMDRNK1 GMDRNK_hp
ObjectCharacteristics GMDRNK1 VICTIM|DISAPPEAR|SCROLL

LoadKRT \SPRITES\LE2\SALOON\S1\GMRUSH.KRT     // Ch 30 -- GMRUSH1
SetScale GMRUSH1 p01_scale
ObjectCharacteristics GMRUSH1 VICTIM|DISAPPEAR|SCROLL

LoadKRT \SPRITES\LE2\SALOON\S2\S6WIND.KRT            // Ch 31 -- SALWIND
SetScale SALWIND 4096
ObjectCharacteristics SALWIND SCROLL|NOKILL

LoadKRT \SPRITES\LE2\SALOON\S2\S6PANE.KRT            // Ch 32 - PANE1
ObjectCharacteristics PANE1 WINDOW|SCROLL
CloneCharacter PANE1				  // Ch 33 - PANE2
CloneCharacter PANE1				  // Ch 34 - PANE3

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

// Projectiles
AssignProjectile BGMEXK1 KNIFE1

// Hostage
SetDepth BGMIKE3 p01_l
Link BGMIKE3 GMRUSH1 9 1 0 0 p01_x-5 p01_y   // Stand when hostage stands
Link BGMIKE3 GMRUSH1 3 0 0 0 p01_x-5 p01_y   // Shoot when hostage dies

PlayTrack 501 0                 // SD_BGM2

// Place objects
StartActionXY SALWIND     0       25      139      7 0        0 L1
StartActionXY PANE1       0       25      115      9 0        0 L1
StartActionXY PANE2       0       25      157      9 0        0 L1
StartActionXY PANE3       0      246      134      4 0        0 L1

// Action!
define FC     0  // Frame Counter
StartActionXY GMDEPT1   3    p09_x    p09_y    p09_l FC+64    1 L1  // LOW
StartActionXY BGTHIN1  10    p04_x    p04_y    p04_l FC+80    0 L1  // STND
StartActionXY BGMEXS1  14    p01_x    p01_y    p01_l FC+128   1 L5  // LOW
StartActionXY BGJACK1   6    p07_x    p07_y    p07_l FC+192   0 L1  // STND
StartActionXY BGSTEV1  10    p01_x    p01_y    p01_l FC+224   1 L3  // LOW
StartActionXY BGMIKE1   5    p05_x    p05_y    p05_l FC+256   0 L2  // SIDE
StartActionXY BGJACK2   6    p0a_x    p0a_y    p0a_l FC+258   0 L4  // STND
StartActionXY BGMEXS2  14    p06_x    p06_y    p06_l FC+320   1 L6  // LOW
StartActionXY BGSTEV2   8    p03_x    p03_y    p03_l FC+384   0 L1  // SIDE
StartActionXY BGSTEV3   6    p02_x    p02_y    p02_l FC+416   1 L7  // STND
StartActionXY BGMIKE2   3    p04_x+5  p04_y    p04_l FC+448   0 L1  // STND
StartActionXY BGTHIN2  14    p01_x    p01_y    p01_l FC+512   1 L3  // LOW
StartActionXY BGSTEV4   6    p07_x+5  p07_y-5  p07_l FC+576   0 L1  // STND
StartActionXY BGMEXS3  10    p0a_x    p0a_y    p0a_l FC+580   0 L5  // STND
StartActionXY BGJACK3  10    p08_x    p08_y    p08_l FC+640   1 L4  // JUMP
StartActionXY GMRUSH1   1    p01_x+15 p01_y    p01_l+1 FC+703 0 L1  // Hostage
StartActionXY BGMIKE3   3    p01_x-5  p01_y    p01_l FC+704   0 L1  // STND (After hostage)
StartActionXY BGMEXK1   6    p05_x    p05_y    p05_l FC+736   0 L7  // SIDE
StartActionXY BGMIKE4   7    p06_x    p06_y    p06_l FC+768   1 L2  // LOW
StartActionXY BGSTEV5   8    p03_x    p03_y    p03_l FC+832   0 L5  // SIDE
StartActionXY BGJACK4   6    p02_x    p02_y    p02_l FC+864   1 L1  // STND
StartActionXY BGMIKE5   3    p04_x+5  p04_y    p04_l FC+896   0 L6  // STND
StartActionXY BGMEXS4  14    p01_x    p01_y    p01_l FC+960   1 L1  // LOW
StartActionXY BGSTEV6   6    p07_x    p07_y    p07_l FC+1024  0 L4  // STND
StartActionXY GMDRNK1   1    p08_x+20 p08_y    p08_l FC+1088  1 L1  // 0x05
StartActionXY BGMIKE6   5    p01_x    p01_y    p01_l FC+1120  1 L3  // LOW
StartActionXY BGTHIN3  10    p0a_x    p0a_y    p0a_l FC+1121  0 L1  // STND
StartActionXY BGMEXS5  12    p05_x    p05_y    p05_l FC+1152  0 L7  // SIDE
StartActionXY BGSTEV7   8    p06_x    p06_y    p06_l FC+1216  1 L5  // SIDE
StartActionXY BGJACK5   8    p03_x    p03_y    p03_l FC+1248  0 L2  // SIDE
StartActionXY BGMIKE7   3    p02_x    p02_y    p02_l FC+1280  1 L1  // STND
ScrollBKDTo 0 0 0 0 FC+1312

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