//---------------------------------------------------------------------------
// Lethal Enforcers 2
// 
// Level        Saloon
// Round        4
// Background   320, 240
// SetScale     0x02=4922, 0x2d=3665
// Layers       255 45 45 45 45   44 35 35 35 35   30 13 10 2 0
//---------------------------------------------------------------------------
// Sprites	Enemy Sets
// 		1   
// BGJACK       X   
// BGMEXK       X   
// BGMEXS       X   
// BGMIKE       X   
// BGSTEV       X   
// BGTHIN       X   
// BWANGE       X   
// GMRUSH       X   
// GWKAY        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 BWANGE_hp    1
define GMRUSH_hp    1
define GWKAY_hp     1

// Define character literals
define BGJACK1      0
define BGJACK2      1
define BGJACK3      2
define BGMEXK1      3
define BGMEXK2      4
define BGMEXS1      5
define BGMEXS2      6
define BGMIKE1      7
define BGMIKE2      8
define BGMIKE3      9
define BGMIKE4      10
define BGSTEV1      11
define BGSTEV2      12
define BGSTEV3      13
define BGSTEV4      14
define BGTHIN1      15
define BGTHIN2      16
define BWANGE1      17
define GMRUSH1      18
define GWKAY1       19
define SALTBL	    20
define CHAIR        21
define LAMP1        22
define LAMP1b       23
define PANE1        24
define PANE2        25
define PANE3        26
define PANE4        27
define DEER         28
define GATLING      29
define KNIFE1       30
define KNIFE2       31

// 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 (low from left)
define p01_x        120
define p01_y        175
define p01_l        6
define p01_scale    3957

// p02 (side from left)
define p02_x        229
define p02_y        150
define p02_l        1
define p02_scale    3665

// p03 (side from left)
define p03_x        -40
define p03_y        175
define p03_l        13
define p03_scale    4922

// p04 (side from right)
define p04_x        320
define p04_y        175
define p04_l        13
define p04_scale    4922

// p05 (stand behind table)
define p05_x        220
define p05_y        180
define p05_l        12
define p05_scale    4688

// p06 (right low from table)
define p06_x        219
define p06_y        185
define p06_l        11
define p06_scale    4600


// Load backgrounds and sounds
LoadBKD \BACKGRND\LE2\SALOON\SALOON4.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 p02_scale
SetTotalHitPoints BGJACK1 BGJACK_hp

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

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

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

CloneCharacter BGMEXK1                            // Ch 4 - BGMEXK2   
SetScale BGMEXK2 p04_scale
SetTotalHitPoints BGMEXK2 BGMEXK_hp

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

CloneCharacter BGMEXS1                            // Ch 6 - BGMEXS2   
SetScale BGMEXS2 p05_scale
SetTotalHitPoints BGMEXS2 BGMEXS_hp

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

CloneCharacter BGMIKE1                            // Ch 8 - BGMIKE2   
SetScale BGMIKE2 p01_scale
SetTotalHitPoints BGMIKE2 BGMIKE_hp

CloneCharacter BGMIKE1                            // Ch 9 - BGMIKE3   
SetScale BGMIKE3 p03_scale
SetTotalHitPoints BGMIKE3 BGMIKE_hp

CloneCharacter BGMIKE1                            // Ch 10 - BGMIKE4  
SetScale BGMIKE4 p03_scale
SetTotalHitPoints BGMIKE4 BGMIKE_hp

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

CloneCharacter BGSTEV1                            // Ch 12 - BGSTEV2  
SetScale BGSTEV2 p02_scale
SetTotalHitPoints BGSTEV2 BGSTEV_hp

CloneCharacter BGSTEV1                            // Ch 13 - BGSTEV3  
SetScale BGSTEV3 p06_scale
SetTotalHitPoints BGSTEV3 BGSTEV_hp

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

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

CloneCharacter BGTHIN1                            // Ch 16 - BGTHIN2  
SetScale BGTHIN2 p06_scale
SetTotalHitPoints BGTHIN2 BGTHIN_hp

LoadKRT \SPRITES\LE2\SALOON\S1\BWANGE.KRT     // Ch 17 - BWANGE1
SetScale BWANGE1 p03_scale
SetTotalHitPoints BWANGE1 BWANGE_hp

LoadKRT \SPRITES\LE2\SALOON\S1\GMRUSH.KRT     // Ch 18 - GMRUSH1
SetScale GMRUSH1 p05_scale
SetTotalHitPoints GMRUSH1 GMRUSH_hp
ObjectCharacteristics GMRUSH1 VICTIM|DISAPPEAR|SCROLL

LoadKRT \SPRITES\LE2\SALOON\S2\GWKAY.KRT      // Ch 19 - GWKAY1
SetScale GWKAY1 p05_scale
SetTotalHitPoints GWKAY1 GWKAY_hp
ObjectCharacteristics GWKAY1  VICTIM|DISAPPEAR|SCROLL

// Load objects
LoadKRT \SPRITES\LE2\SALOON\S2\SALTBL.KRT           // Ch 20 - SALTBL
ObjectCharacteristics SALTBL  SCROLL|NOKILL

LoadKRT \SPRITES\LE2\SALOON\S2\S1TABL.KRT           // Ch 21 - CHAIR
ObjectCharacteristics CHAIR  SCROLL|NOKILL

LoadKRT \SPRITES\LE2\SALOON\S1\B2LAMP.KRT           // Ch 22 - LAMP1
ObjectCharacteristics LAMP1 SCROLL
CloneCharacter LAMP1                             // Ch 23 - LAMP1b

LoadKRT \SPRITES\LE2\SALOON\S2\S4PANE.KRT           // Ch 24 - PANE1
ObjectCharacteristics PANE1 WINDOW|SCROLL
CloneCharacter PANE1                             // Ch 25 - PANE2
CloneCharacter PANE1                             // Ch 26 - PANE3
CloneCharacter PANE1                             // Ch 27 - PANE4

LoadKRT \SPRITES\LE2\SALOON\S2\S4DEER.KRT           // Ch 28 - DEER
ObjectCharacteristics DEER SCROLL|NODISPLAY
SetTotalHitPoints DEER 4

LoadKRT \SPRITES\LE2\L2GUNS.KRT                  // Ch 29 - GATLING
ObjectCharacteristics GATLING SCROLL|GUN

LoadKRT \SPRITES\LE2\L2NIFE.KRT                  // Ch 30 - KNIFE1
ObjectCharacteristics KNIFE1 DISAPPEAR|THROWN|SCROLL
CloneCharacter KNIFE1                            // Ch 31 - KNIFE2

// Projectiles
AssignProjectile BGMEXK1 KNIFE1
AssignProjectile BGMEXK2 KNIFE2

// Links
Link LAMP1b  LAMP1 4 3 0 0 185 92
Link GATLING DEER  4 1 0 0 100 50

PlayTrack 502 0                 // SD_BGM3

// Place objects
StartActionXY SALTBL    0     229       195       14 0        0 L1
StartActionXY CHAIR     2      10       200       14 0        0 L1
StartActionXY LAMP1     2     185        85        6 0        0 L1
StartActionXY PANE1     0     280        92        4 0        0 L1
StartActionXY PANE2     0     323        92        4 0        0 L1
StartActionXY PANE3     0     280       140        4 0        0 L1
StartActionXY PANE4     0     323       140        4 0        0 L1
StartActionXY DEER      0     100        50        6 0        0 L1

// Action!
define FC     0  // Frame Counter
StartActionXY BGSTEV1   8    p03_x    p03_y    p03_l FC+64    0 L1  // SIDE
StartActionXY BGMIKE1   5    p04_x    p04_y    p04_l FC+96    1 L5  // SIDE
StartActionXY BGTHIN1  14    p01_x    p01_y    p01_l FC+192   0 L2  // LOW
StartActionXY BGJACK1   8    p02_x    p02_y    p02_l FC+256   0 L7  // SIDE
StartActionXY BGMEXS1  14    p06_x    p06_y    p06_l FC+320   1 L1  // LOW
StartActionXY BGMEXK1   4    p05_x    p05_y    p05_l FC+328   0 L5  // STND
StartActionXY BWANGE1   6    p03_x    p03_y    p03_l FC+384   0 L2  // SIDE
StartActionXY BGMEXK2   6    p04_x    p04_y    p04_l FC+448   1 L3  // SIDE
StartActionXY GWKAY1    1    p05_x    p05_y    p05_l FC+512   1 L1  // STND
StartActionXY BGMIKE2   7    p01_x+20 p01_y-10 p01_l FC+576   0 L1  // LOW
StartActionXY BGSTEV2   8    p02_x    p02_y    p02_l FC+578   0 L5  // SIDE
StartActionXY BGSTEV3  12    p06_x    p06_y+5  p06_l FC+640   1 L2  // ROLL
StartActionXY BGMEXS2  10    p05_x    p05_y    p05_l FC+704   0 L6  // STND
StartActionXY BGMIKE3   5    p03_x    p03_y    p03_l FC+768   0 L5  // SIDE
StartActionXY BGJACK2   8    p04_x    p04_y    p04_l FC+832   1 L1  // SIDE
StartActionXY BGSTEV4  10    p01_x    p01_y-5  p01_l FC+834   0 L3  // LOW
StartActionXY BGJACK3   8    p02_x    p02_y    p02_l FC+896   0 L7  // SIDE
StartActionXY GMRUSH1   1    p05_x    p05_y+10 p05_l FC+960   0 L1  // STND
StartActionXY BGTHIN2  14    p06_x    p06_y+5  p06_l FC+1024  1 L4  // LOW
StartActionXY BGMIKE4   5    p03_x    p03_y    p03_l FC+1088  0 L1  // SIDE
ScrollBKDTo 0 0 0 0 FC+1120

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