#ifndef TAGS_H
#define TAGS_H

#include "jtags.h" 

//
// CONTACT Information
//
// Frank Maddin
// (512) 251-3897
// CIS 75230,3647
//
// NOTE: Switches are always sprites and are usually on walls, triggers are on the floor.  

/*
Note that "inside" walls go clockwise and "outside" walls go counter clockwise.

SECTOR/WALL TAGGING WITH SPRITES
---------------------------
NEW TAGGING - Use Quote Key and number keys to set these tags

tag 1  =  hitag  !!!!!!!!!!!! I switched the first two
tag 2  =  lotag  !!!!!!!!!!!! I switched the first two
tag 3  =  clipdist
tag 4  =  ang     
tag 5  =  xvel    
tag 6  =  yvel    
tag 7  =  zvel 1
tag 8  =  zvel 2   
tag 9  =  owner 1 
tag 10 =  owner 2

//
// SHRAPNEL TYPES
//

#define SHRAP_TYPE_NONE         0                                                           
#define SHRAP_TYPE_GLASS        1
#define SHRAP_TYPE_TREE         2
#define SHRAP_TYPE_SMOKE        3  // only used for damaged SO's
#define SHRAP_TYPE_RICE_PAPER   4
#define SHRAP_BLOOD             5
#define SHRAP_EXPLOSION         6

    ------------------------------------------------------------------------------------
    |       TYPE                   |       DATA is in     |                            |
    ------------------------------------------------------------------------------------
    | name                   hitag | lotag  |    other    |        Description         |
    ------------------------------------------------------------------------------------ 
    SECT_SINK                  0     depth
    SECT_RESERVED              1
    SECT_CURRENT               3     speed    ang-Tag 4   
    SECT_NO_RIDE               5                           cannot ride this moving sector
    SECT_DIVE_AREA             7     number                Diving area - pressing the CRAWL
                                                           key when here will teleport you
                                                           to a UNDERWATER area with a matching
                                                           UNIQUE "number"
    SECT_UNDERWATER            8     number                Underwater area - floating to the 
                                                           surface of this area will teleport
                                                           you to the DIVE_AREA with a matching
                                                           UNIQUE "number"
                                                           IMPORTANT: The SECT_DIVE_AREA sprite
                                                           and the SECT_UNDERWATER sprite need
                                                           to be in the same position for both
                                                           sectors (exp: centered in each room).
    SECT_UNDERWATER2           9     number                Secondary Underwater area - floating 
                                                           to the surface of this area will 
                                                           teleport you to the DIVE_AREA with 
                                                           a matching UNIQUE "number"
                                               
    NOTE: These 3 are tags
    are generic.  Tag 
    descriptions will let 
    you know when to use
    them.
    
    SECT_ANGLE                16              ang-Tag 4
    SECT_HEIGHT               17     height   
    SECT_SPEED                18     speed                 shift value (0-6)
    
    SECT_FLOOR_PAN            19     speed    ang-Tag 4    "
    SECT_CEILING_PAN          21     speed    ang-Tag 4    "
    
    WALL_PAN_SPEED            23     speed                 point sprite at desired wall
    WALL_PAN_ANG              24     pan ang               point sprite at desired wall
    
    SECT_DEBRIS_SEWER         25     seconds  ang-Tag 4    spawns sewer debris after
                                                           time
                                                           
    SECT_SO_CENTER            27              position     Place center of SO at the sprite
                                                           x,y,z location.  Overrides norm
                                                           center.                                        
                                                           
    SECT_MATCH                28     number                Used to match multiple sectors
                                                           to one action.  "number" must
                                                           be UNIQUE and non 0.                                                                
                                                           
    SECT_LOCK_DOOR            29     key num               Lock the door.  Must have the                                                         
                                                           correct key to open it.
                                                           RED     1
                                                           BLUE    2
                                                           GREEN   3
                                                           YELLOW  4
                                                           Currently only works for rotating
                                                           and UP type doors, but I can extend 
                                                           it for others easily as needed.
                                                           
    SPRI_CLIMB_MARKER         30              pos/angle    Center this sprite on the ladder
                                                           and set the angle pointing out.                                
                                                           
    SECT_SO_SPRITE_OBJ        31                           Makes a SO become a SPRITE OBJECT.
                                                           The sprites will move but the sector
                                                           will not.  Sprites can cross sector
                                                           boundries.
                                                           
    SECT_SO_DONT_BOB          32                           Mark a bobbing SO sector so it will
                                                           not bob with the rest of the SO.

    SECT_SO_SINK_DEST         33     offset                Mark a SO sector as the destination
                                                           for sinking.so it will
                                                           not sink with other sectors.
                                                           
    SECT_SO_DONT_SINK         34                           Mark a SO sector so it will
                                                           not sink with other sectors.

    SECT_SO_FORM_WHIRLPOOL    37     depth                 Used for the boat in level 1.
                                                           Lower the whirlpool sectors
                                                           to a "depth" level.
                                                           
    SECT_ACTOR_BLOCK          38                           Tag sector to keep enemy actors
                                                           from entering.  Player can still
                                                           enter.  Can still fire through
                                                           the sector.  

    SECT_SO_CLIP_DIST         39     dist                  Sets clipping distance for          
                                                           operational SO's.
                                                                                                        
    MULTI_PLAYER_START        42     pnum     angle-Tag 4  Spawn spots for multi-player games.
                                                           Valid values for player number (pnum)
                                                           are 1-15 - Note that 0 is the first  
                                                           player.  Do set the angle.
                                                           
    FIREBALL_TRAP             43     match    angle-Tag 4  Shoots a fireball from the location
                                                           of this sprite in the direction the  
                                                           angle is pointing when a TRIGGER     
                                                           is stepped on.  Sector trigger set 
                                                           TAG_TRIGGER_MISSILE_TRAP 
                                                           

    BOLT_TRAP                 44     match    angle-Tag 4  Shoots a bow bolt from the location
                                                           of this sprite in the direction the  
                                                           angle is pointing when a TRIGGER     
                                                           is stepped on.  Sector trigger set 
                                                           TAG_TRIGGER_MISSILE_TRAP 

    SECT_SO_DONT_ROTATE       45                           Makes a SO move without rotating.  
                                                           Place in the center sector.

    PARALLAX_LEVEL            46     plaxnum               Set parallax sky type 1-6. Only 
                                                           need one per level in a single 
                                                           sector.  Will effect the whole level.
                                                           
    SECT_DONT_COPY_PALETTE    47                           Normally a actor/player standing on 
                                                           a palette swapped floor takes on the
                                                           palette of the floor.  Use this ST1
                                                           tag on sectors that should act like 
                                                           this.
                                                           
    MULTI_COOPERATIVE_START   48     pnum     angle-Tag 4  Spawn spots for coperative multi-player 
                                                           games.  Use just like MULT_PLAYE_START.

                                                                
    The following several ST1 tags
    can be placed in the center sector
    of a SO instead of using the TRACK
    equivelents.
    
    SO_SET_SPEED              49     speed                 Same function as TRACK_SET_SPEED
    SO_SPIN                   50     speed                 Same function as TRACK_SPIN     
    SO_SPIN_REVERSE           51     speed                 Same function as TRACK_SPIN_REVERSE
    SO_BOB_START              52     amt                   Same function as TRACK_BOB_START
    SO_BOB_SPEED              53     speed                 Same function as TRACK_BOB_SPEED
    SO_STOMP                  54     speed                 Same function as TRACK_STOMP    
    
    SO_TURN_SPEED             55     speed                 Determines how fast a SO turns to 
                                                           meet the new angle.  Shift value.
                                                           Default is 4.
                                                           
    LAVA_ERUPT                56     random   Tag 4        Spawn spots for lava eruption.
                                              pal          Random number determines how often
                                              Tag 3        something is spawned. 
                                                           Tag 4 = interval in seconds.
                                                           Pal is time to erupt.
                                                           Tag 3 is for future.
                                                           
    SECT_EXPLODING_CEIL_FLOOR 57     match                 See sectexpl.map for example.
                         
    SECT_EXPLODING_CEIL       58     match    Tag 3        See sectexpl.map for example.
                                                           Tag 3 is the number of PG UP
                                                           needed to set the sect to the 
                                                           blown up z height.     
                                                                                        
    SECT_EXPLODING_FLOOR      59     match    Tag 3        See sectexpl.map for example.                             
                                                           Same as CEIL only its PG DN.
                                                
    SO_SHOOT_POINT            62                           For operation SOs. Sets the shooting
                                                           point.  Place on end of gun barrel
                                                           and point in desired shooting 
                                                           direction. 
                                                           
    SPEAR_TRAP                63     match    Tag 4        Shoots a spear from the location
                                                           of this sprite in the direction the  
                                                           Tag 4 is pointing when a TRIGGER     
                                                           is stepped on.  Sector trigger set 
                                                           TAG_TRIGGER_MISSILE_TRAP 
                                                       
    SO_SYNC1                  64                           Keeps SO's runing a a constant rate
                                                           so they can stay in sync better if
                                                           needed.  If its ridable use SYNC1.
                                                           Slower so only used it when you
                                                           have to.

    SO_SYNC2                  65                           Same as SO_SYNC1 only slightly
                                                           faster.  If not ridable use this.
                                                           
    DEMO_CAMERA               66     delta                 Camera angle.  Point it in the 
                                     angle                 direction you want it to default to.
                                                           Delta Angle is the amount the camera
                                                           will move in either direction.
                                                           
    SO_LIMIT_TURN             68     delta                 Limit turning of sector object.
                                     angle                 Useful with turrets.  Point sprite
                                                           in the center direction.
                                                           
    SPAWN_SPOT                69     Tag 2    Match        Spawns explosions at that the
                                     Tag 3    Kill Type    x,y,z location when triggered by
                                     Tag 4    Angle/Dir    an event that has a matching tag.                          
                                     Tag 5    Kill Delay        
                                     Tag 6    Damage Type
                                     Tag 7    Damage Delay
                                     Tag 8    Kill Velocity   - Not Implemented
                                     Tag 9    Damage Velocity - Not Implemented
                                     
                                                           Tag 3 is the type of shrapnel
                                                           spawned when Killed.
                                                           
                                                           0 - Explosion
                                                           1 - Glass
                                                           2 - Tree
                                                           3 - Smoke for damaged SO's
                                                               Doesn't need match tag
                                                               
                                                           Tag 4 is the general direction of
                                                           the explosion.  
                                                           Tag 5 is delay of explosion
                                                           in 1/8 seconds. Exp 10 = 5 secs
                                                           Tag 6 is the type of shrapnel
                                                           spawned when DAMAGED but not
                                                           killed.  Same types as Tag 3.
                                                           Tag 7 is same as Tag 5 except
                                                           used for damage shrap instead 
                                                           of Kill delay.

    SO_MATCH_EVENT            70     match                 Sets up a match tag for SO's
                                                           This is used for Killing Sectors
                                                           among other things.

    SO_SLOPE_FLOOR_TO_POINT   71                           Aligns slope to SO point tagged
                                                           as TTAG_WALL_ALIGN_SLOPE_TO_POINT.
                                                           
    SO_SLOPE_CEILING_TO_POINT 72                           Aligns slope to SO point tagged
                                                           as TAG_WALL_ALIGN_SLOPE_TO_POINT.
                                                           
    SO_TORNADO                73                           Tornado quick setup for SO
    
    SO_FLOOR_MORPH            74                           Floor Morph quick setup
    
    SO_AMOEBA                 75                           Amoeba quick setup
    
    SO_MAX_DAMAGE             76     amt      Tag 3        Damage for sector objects
                                                           Tag 3 VALUES
                                                           32 - Normal weapons won't kill - default
                                                           0 - Normal weapons will kill
    
    SO_RAM_DAMAGE             77     amt                   Damage amt done by ramming with
                                                           a vehicle
                                                           
    SO_CLIP_BOX               78     dist                  Clip box for sector object
                                                           For multiple clip boxes
                                                           
    SO_SLIDE                  79                           Sliding type of SO                                     
    
    SO_KILLABLE               80     type                  Killable Sector Object
    
    SO_AUTO_TURRET            81                           Auto Turret quick setup
    
    SECT_DAMAGE               82     amt                   does damage to player and actors
    
    WARP_TELEPORTER           84
    	TAG 2 = match
    	TAG 3 = Type
    		Sprite - (60 or 0 default) - always teleports you to the matching
            sprite location at the angle the sprite is facing
    		Offset - (1) - always teleports you by the offset.  Does not touch
            the angle
    	TAG 4 = angle
    	TAG 5 to 8 = random match locations in addition to the TAG 2 match
    	TAG 9 - reserved for future use
    	TAG 10 = Teleport or Don't
    		( 64 default) Teleport when you hit this sector
    		65 - Don't teleport when you hit this sector    
    
    WARP_CEILING_PLANE        85
    WARP_FLOOR_PLANE          86
    WARP_COPY_SPRITE1         87                           Copies sprite image only at
                                                           draw time to matching sector.
    WARP_COPY_SPRITE2         88                           Copies sprite image only at
                                                           draw time to matching sector.
                                                           

    PLAX_GLOB_Z_ADJUST        90              Tag 2        Global plax ceiling adjustment.
                                              Tag 3        Default is 500 pixels.
                                                           Tag 2 is ceiling z movement in pixels. 
                                                           Tag 3 is floor z movement in pixels. 
                                                           
    PLAX_Z_ADJUST             91     amt                   NOT IMPLEMENTED. Local override.
    
    SECT_VATOR                92
    SECT_FOLLOW_VATOR         93
    SECT_VATOR_DEST           94
    
    VIEW_THRU_CEILING         120
    VIEW_THRU_FLOOR           121

    VIEW_LEVEL1               110
    VIEW_LEVEL2               111
    VIEW_LEVEL3               112
    VIEW_LEVEL4               113
    VIEW_LEVEL5               114
    VIEW_LEVEL6               115

    BOUND_FLOOR_UPPER         200
    BOUND_FLOOR_LOWER         201
    BOUND_FLOOR_BASE_OFFSET   202
    BOUND_FLOOR_OFFSET        203
    
    SECT_SO_BOUNDING          500-600                      Bounding sprites for SO's                  
                                                           Look at Sector Object Tags Info
                                                           
*/


//////////////////////////////////////////////////////////////////////////////////////////
//
// MISC TAGS
//
//////////////////////////////////////////////////////////////////////////////////////////

//* Stepping on this finds actors closeby that are on a track at a point defined as
//* TRACK_ACTOR_WAIT_FOR_TRIGGER and activates them.
//* High tag = distance to look for actors
#define TAG_TRIGGER_ACTORS      3

//* For ladders attached to white walls.
#define TAG_LADDER              30

//Shoots a fireball from a ST1 FIREBALL_TRAP (or BOLT) sprite with a matching number.
//High tag = match number to match with ST1 sprite 
#define TAG_TRIGGER_MISSILE_TRAP 43

//Explodes wall sector
//High tag = match number  
#define TAG_TRIGGER_EXPLODING_SECTOR 44

//////////////////////////////////////////////////////////////////////////////////////////
//
// DOOR TAGS
//
//////////////////////////////////////////////////////////////////////////////////////////

//* High tag for z moving doors is always the speed unless otherwise noted - default
//* 200

//* Red sector rotating doors.  They can have up to 15 points per door and
//* rotate about any point you choose.  Don't have to be rectangular, can be any shape.  Can
//* use masked walls with them.

//* Red sector rotating door - Master sector that has doors inside of it
//* To lock these types of doors place a SECT_LOCK_DOOR ST1 in this sector
#define TAG_DOOR_ROTATE         112

//* Red sector rotating door - Tag the actual door with this. Rotate POSITIVE or NEGATIVE 90 degrees
#define TAG_DOOR_ROTATE_POS     113
#define TAG_DOOR_ROTATE_NEG     114

//* Wall pivot point - MUST tag the ouside of the wall, NOT the inside!! - red sector method
//  Remember - a wall is just an x,y location
#define TAG_WALL_ROTATE_PIVOT 2

//* Tag for sliding door (Star Trek/Wolf type)
#define TAG_DOOR_SLIDING        115

//* Tag for exiting current level and starting up another one.
//* High Tag - Destination level number - 
//* 0 - Title screen
//* 1 - e1l1
//* 2 - e1l2
//* ...
#define TAG_LEVEL_EXIT_SWITCH 116

//////////////////////////////////////////////////////////////////////////////////////////
//
// ELEVATOR TAGS
//
//////////////////////////////////////////////////////////////////////////////////////////

// Mappers DONT use this!!  Use ST1 SECT_VATOR.
#define TAG_VATOR 206

// toggles ST1 SECT_VATOR sectors
//* High tag is match tag
#define TAG_SPRITE_SWITCH_VATOR   206
#define TAG_SECTOR_TRIGGER_VATOR  206

// same as 206 tags but only activates sector ONCE
#define TAG_SPRITE_SWITCH_ONCE_VATOR   207
#define TAG_SECTOR_TRIGGER_ONCE_VATOR  207

//* High tag is the number to MATCH the ST1 match number.
#define TAG_SO_EVENT_SWITCH   215
//* Same as switch but tag a sector as a trigger.
#define TAG_SO_EVENT_TRIGGER  215

//* Spawns sprites with matching tags
//* Same as switch but tag a sector as a trigger.
#define TAG_SPAWN_ACTOR_TRIGGER  216

//* Step on the sector, press the space bar, and it shoves you high into the air.
//* High tag has height of jump
#define TAG_SPRING_BOARD        240

//* Switch to make stairs from the ceiling or floor.  START is the first sector.  Other sectors are 
//* tagged with UP/DOWN.
//* High tag for switch is maximum distance for finding the next stair.
#define TAG_STAIRS_DOWN_SWITCH  241
#define TAG_STAIRS_DOWN_START   242
//* High tag = delta Z in pixels from the last stair.
#define TAG_STAIRS_DOWN         243
#define TAG_STAIRS_UP_SWITCH    244
#define TAG_STAIRS_UP_START     245
#define TAG_STAIRS_UP           246

//* Raise or Lower water with the TAG_SPRITE_WATER_VALVE
//* High tag = height to raise or lower water in pixels.  Add 10000 for a negative number.
//* Exp: -256 would be 10256.
#define TAG_WATER_GATE          254
//* Same as WATER_GATE except that all sectors tagged with 255 are effected.
//* Note that this can only be used once per level.
#define TAG_WATER_GATE_ALL      255

//* Sine wave floor effect - max 5 per level
//*
//* Tag the first sector with 400, the next with 401, and so on up to 419.
//* The WAVE will actually flow from the opposite end.  The WAVE direction is what is 
//* refered to when BEGINNING and END are referred to below.
//*
//* 1st Sector High Tag = the range in pixels the floor will undulate in the Z direction
//* 2rd Sector High Tag = range decrement - takes the range from the 1st sector high tag and
//*                       adjusts all the rest by this decrement - makes the WAVE start off 
//*                       small and get LARGER toward the end - THIS IS IN Z COORDINATES 
//*                       *NOT* PIXELS
//* 3nd Sector High Tag = speed of the motion - a shift value - default to 3 
//* 4th Sector High Tag = a distance from one peak (top of curve) to the next - default is the
//*                       number of sectors in the SINE WAVE (max of 20)
//* Last Sector High Tag= special tag to make a realistic ocean wave - modifies the range 
//*                       toward the END (greatest range is usually here) of the WAVE
//*                       so that it dissapates quickly. Without this it would just continue
//*                       to get bigger toward the end of the WAVE.

#define TAG_SINE_WAVE_FLOOR     400
#define TAG_SINE_WAVE_CEILING   420
#define TAG_SINE_WAVE_BOTH      440


//////////////////////////////////////////////////////////////////////////////////////////
//
// SECTOR OBJECT TAGS
//
//////////////////////////////////////////////////////////////////////////////////////////
// Sector Objects (SOs) are groups of sectors that can be moved around on a track.
// All SOs must have at a minimum:
//      1. Bounding sprites (upper left and lower right) that contains all sectors to be moved.
//      2. A sector marked as the center of the SO.
// 
// Tags 500-600 are set reserved for SOs.  There is a maximum of 20 SOs per level.  
//
// Tags 500-504 correspond to object 1, 505-509 to object 2, 510-514 to object 3, etc ...
// 
// Bounding sprite tags are set up similar.  
//      Upper left tag of object 1 is 500, lower right is 501
//      Upper left tag of object 2 is 505, lower right is 506
//      Etc...
//////////////////////////////////////////////////////////////////////////////////////////

// Not really used yet.
#define TAG_OBJECT              500
// The center of this sector will be the center of the SO
// IMPORTANT: High Tag must be set to the track number
#define TAG_OBJECT_CENTER       501
// Velocity of object in high tag
#define TAG_OBJECT_VELOCITY     502
// Not really used yet.
//#define TAG_OBJECT              503
// Bounding sector for sector object
//#define TAG_OBJECT_BOUNDS       504


//////////////////////////////////////////////////////////////////////////////////////////
//
// TRACK TAGS FOR SECTOR OBJECTS
//
//////////////////////////////////////////////////////////////////////////////////////////
// Tracks allow SOs and sprites to follow a path designated by the map-maker.
// All Tracks must have at a minimum:
//      1. A TRACK_START.
//      2. A TRACK_END.
//
// Tracks are set up by the program by connecting sprites placed by the map-maker in the BUILD 
// editor.  The track sprites start at location 1900 and end at 1999 so there are 100 available
// tracks.  Tracks automatically loop back to the beginning when the TRACK_END sprite is
// detected.  Track tags listed below can be set to modify the behavior of objects moving along 
// them.
//
// Look at the tracks in example maps to see how they are placed.
//
// NOTE: Track direction is dependent on the next closest sprite to the TRACK_START sprite.
// As noted below, certain track tags are dependant on the direction the object is traveling on
// on the track.
//
// For placing actor sprite on the tracks:
//      1. Put a sprite down near the point you want it to start from.
//      2. Adjust the angle to the left to make the sprite move in the "reverse" direction
//         and to the right to make the sprite move in the "forward" direction.
//      3. For the pic, place the first pic of the actor found in the editart file.
//
// Every track can have a type set in the high tag of TRACK_START.
//////////////////////////////////////////////////////////////////////////////////////////

    
//* Mark first track sprite with this
//* High tag = Type of track (defined next)
#define TRACK_START             700 

    //
    // TRACK TYPES - only valid for sprites only NOT for SOs
    //
    // Used to attach a name to a track purpose.  The actors will "look around" for
    // tracks to know what actions are available to them.
    //
    
    // All tracks are assumed to be SEGMENTS (non-circular, generally leading in a certain
    // direction) unless otherwise noted.  SEGMENTS are generally kept short with a few
    // exceptions.

    // Follow a circular route available for sprites to hop on and off.
    // Generally covers a larger area than TT_WANDER.
    #define TT_ROUTE            1
        
    // Jump up only
    #define TT_JUMP_UP          2
    // Jump down only
    #define TT_JUMP_DOWN        3
    // Jump up/down track
    #define TT_JUMP_BOTH        4
    // Ladder track.  Currently only good for going up.  Must jump down.
    #define TT_LADDER           5
    // Stair track.  Hard for sprites to maneuver narrow stairs well without tracks.
    #define TT_STAIRS           6
    
    // Traverse a complex route - generally thought of to move you from point A to point B
    // in complex map situations.
    #define TT_TRAVERSE         7
    
    // Duck behind cover and attack
    #define TT_DUCK_N_SHOOT     8
    // Hide behind cover and attack
    #define TT_HIDE_N_SHOOT     9
    
    // Exit tracks to exit a room/area.  Probably should lead to a door alot of the time.
    #define TT_EXIT             10

    // Wander track. Wander about general area until you come upon a player.
    #define TT_WANDER           11
    
    // Scan for other tracks.  Generally a VERY short track put these in places where 
    // other tracks can be seen easily.  Good "vantage points".
    #define TT_SCAN             12
    
    // Super Jump 
    #define TT_SUPER_JUMP_UP    13
    

//* Mark last sprite with this
#define TRACK_END               701
//* Set the target speed and actual speed at this point
//* Valid values for target speed are 2 to 128
#define TRACK_SET_SPEED         702
//* Stop for (seconds) in high tag
#define TRACK_STOP              703
//* Reverse the direction
#define TRACK_REVERSE           704    

// Note that the next two tags have the opposite effect when traveling the REVERSE direction

//* Sets up a target speed by a delta (amt) in high tag
//* velocity = (current target velocity) + (speed up amount in high tag)
//* Valid values for target speed are 2 to 128
#define TRACK_SPEED_UP          705    

//* Sets up a target speed by a delta (amt) in high tag
//* velocity = (current target velocity) - (speed up amount in high tag)
//* Valid values for target speed are 2 to 128
#define TRACK_SLOW_DOWN         706    

//* The rate at which the velocity approaches the target speed.
//* This is defined as a shift value (for processing speed) and defaults to 6.  The valid range
//* is 1 to 12.
#define TRACK_VEL_RATE          707   


//* Moves the floor of the object by a delta PIXEL position (amt) in high tag
#define TRACK_ZUP               709
//* Moves the floor of the object by a delta PIXEL position (amt) in high tag
#define TRACK_ZDOWN             710
//* Sets the rate at which the ZUP/ZDOWN moves. Defaults to 256.
#define TRACK_ZRATE             711
//* Special mode where the object looks at the zcoord of the next track point and moves
//* to achieve the destination.  In high tag is a negative delta Z from the placement of 
//* the track sprites z value.
#define TRACK_ZDIFF_MODE        712

//* Object spins as it goes along its track.  Spin speed in high tag.
//* For now, once you start it spinning you cannot stop it.
#define TRACK_SPIN              715

//* Object stops spining.  Angle to finish at in high tag.
#define TRACK_SPIN_STOP         716

//* Bobbing for SO's. 
//* High tag = Bob amt in pixels.
#define TRACK_BOB_START         717
//* High tag = Bob speed - shift amt pixels.
#define TRACK_BOB_SPEED         718
// Bobbing for SO's. 
#define TRACK_BOB_STOP          719
//* Start object spinning in the opposite direction.
#define TRACK_SPIN_REVERSE      720

//* Start object stomping from ceiling
#define TRACK_STOMP             721

//* Start object sinking to ST1 SECT_SO_SINK_DEST
//* For boats
//* High tag = speed of sinking
#define TRACK_SO_SINK           723

//* For boats - lower whirlpool sector - tagged with ST1 SECT_SO_FORM_WHIRLPOOL
#define TRACK_SO_FORM_WHIRLPOOL   724

//* Move Sprite Objects (not sector objects) straight up or down in the z 
//* direction to the next points z height then continues along the track
//* High tag = speed of movement - default is 256
#define TRACK_MOVE_VERTICAL    725

//* Object will wait at this point on the track for a trigger/switch to be
//* flipped.  Use TAG_SO_EVENT_SWITCH and TRIGGER to free the SO to
//* continue. In addition the these switches and triggers, others that have
//* have MATCHing tags will work with this tag.  The following is a list.
//* 
//* TAG_SPRITE_EXPLODE_SECTOR
//* TAG_OPEN_DOOR_SWITCH
//* TAG_OPEN_DOOR_TRIGGER
//* 
//* Basically anthing that has a match tag that operates on sectors can also
//* operate a TRACK_WAIT_FOR_EVENT.
//* 

//* High tag = match number 
#define TRACK_WAIT_FOR_EVENT   726

///////////////
//
// TRACK TAGS FOR SPRITES ONLY
//
///////////////

//* Set the target speed and actual speed at this point
// Valid values for target speed are 2 to 128
#define TRACK_ACTOR_SET_SPEED         750
//* Stop for (seconds) in high tag
#define TRACK_ACTOR_STOP              751
//* Reverse the direction
#define TRACK_ACTOR_REVERSE           752    

// Note that the next two tags have the opposite effect when traveling the REVERSE direction

//* Sets up a target speed by a delta (amt) in high tag
// velocity = (current target velocity) + (speed up amount in high tag)
// Valid values for target speed are 2 to 128
#define TRACK_ACTOR_SPEED_UP          753    

//* Sets up a target speed by a delta (amt) in high tag
// velocity = (current target velocity) - (speed up amount in high tag)
// Valid values for target speed are 2 to 128
#define TRACK_ACTOR_SLOW_DOWN         754    

//* The rate at which the velocity approaches the target speed.
// This is defined as a shift value (for processing speed) and defaults to 6.  The valid range
// is 1 to 12.
#define TRACK_ACTOR_VEL_RATE          755   

//* Special mode where the object looks at the zcoord of the next track point and moves
// to achieve the destination.  Should not be set when jumping/climbing etc.
#define TRACK_ACTOR_ZDIFF_MODE        759



//Note: All actions are preformed only if they exist for the character.

// High tag = seconds
#define TRACK_ACTOR_STAND           770
//* High tag = height value (default 384)
#define TRACK_ACTOR_JUMP            771
//* Toggle crawl state
#define TRACK_ACTOR_CRAWL           772
// Toggle swim state
#define TRACK_ACTOR_SWIM            773
// Toggle fly spell
#define TRACK_ACTOR_FLY             774
//* High tag = seconds
#define TRACK_ACTOR_SIT             776
// High tag = seconds
#define TRACK_ACTOR_DEATH1          777
//* High tag = seconds
#define TRACK_ACTOR_DEATH2          778
// Air Death!
// High tag = seconds
#define TRACK_ACTOR_DEATH_JUMP      779

//* Close range attacks - in order of least powerful to most
//* High tag = seconds
#define TRACK_ACTOR_CLOSE_ATTACK1   780
#define TRACK_ACTOR_CLOSE_ATTACK2   781
//* Long range attacks - in order of least powerful to most
//* High tag = seconds
#define TRACK_ACTOR_ATTACK1         782
#define TRACK_ACTOR_ATTACK2         783
#define TRACK_ACTOR_ATTACK3         784
#define TRACK_ACTOR_ATTACK4         785
#define TRACK_ACTOR_ATTACK5         786
#define TRACK_ACTOR_ATTACK6         787

//* High tag = seconds
#define TRACK_ACTOR_LOOK            790
//* High tag = seconds to pause
//* Point of the sprite angle in the direction of the operatable sector/wall/switch
//* Actor presses the space bar to operate sector/wall/switch. 
#define TRACK_ACTOR_OPERATE         791
// High tag = height to go up before jumping to next point
// Sprite angle must be facing the ladder
#define TRACK_ACTOR_CLIMB_LADDER    792
//* Set up a default jump value - for use before climbing ladders etc
#define TRACK_ACTOR_SET_JUMP        793

//* Specail Action - depends on each actor
//* High tag = seconds
#define TRACK_ACTOR_SPECIAL1        795
#define TRACK_ACTOR_SPECIAL2        796

//* Jump if moving forward on track
#define TRACK_ACTOR_JUMP_IF_FORWARD 797
//* Jump if moving backward on track
#define TRACK_ACTOR_JUMP_IF_REVERSE 798

//* Wait for player to come into range before moving from this point.
//* High tag = Distance from player at which NPC can start moving.
#define TRACK_ACTOR_WAIT_FOR_PLAYER 799

//* Wait for trigger to be tripped before moving from this point.
//* Use TAG_TRIGGER_ACTORS defined above is used to trigger the actor.
#define TRACK_ACTOR_WAIT_FOR_TRIGGER 800

//* Quick TAGS - Used internally by ME ONLY
#define TRACK_ACTOR_QUICK_JUMP       801
#define TRACK_ACTOR_QUICK_JUMP_DOWN  802
#define TRACK_ACTOR_QUICK_SUPER_JUMP 803
#define TRACK_ACTOR_QUICK_SCAN       804
#define TRACK_ACTOR_QUICK_EXIT       805
#define TRACK_ACTOR_QUICK_LADDER     806

//////////////////////////////////////////////////////////////////////////////////////////
//
// SPRITE TAGS
//
//////////////////////////////////////////////////////////////////////////////////////////

// 100-199 are reserved for placing actors on tracks
#define TAG_ACTOR_TRACK_BEGIN       30000
#define TAG_ACTOR_TRACK_END         30099

//* When "operated" moves grating in the direction the sprite is pointing
//* High tag = distance to move the grate - 1024 is a good distance
#define TAG_SPRITE_GRATING          200

//* Switch to rotate a SO 180 degrees when pressed.  Operates on the nearest TAG_WATER_GATE
//* as defined above.
//* High tag = Sector Object number to rotate.
#define TAG_SPRITE_ROTATE_WATER_VALVE   201
//* Same as above except operates for TAG_WATER_GATE_ALL as defined above.
#define TAG_SPRITE_ROTATE_WATER_VALVE2  202

//* Place an actor with this tag and it will not spawn until it is triggered.
//* High tag = Match number
#define TAG_SPAWN_ACTOR  203

#define TAG_SPRITE_EXPLODE_SECTOR  257

//////////////////////////////////////////////////////////////////////////////////////////
//
// LIGHTING TAGS
//
//////////////////////////////////////////////////////////////////////////////////////////

//*X Stobing effect - took this out, use TAG_LIGHT_TORCH
//#define TAG_LIGHT_STROBE        300

//* Fade effect.  Fades in and out smoothly.  
//* Ceiling is minimum darkness.
//* Floor is maximum darkness.
//* High byte is speed of fading.  The lower the number the faster.  Default is 3.
#define TAG_LIGHT_FADE          301
//* Diffuse fade light across multiple sectors (up to 10).
//* Place these types of sectors around TAG_LIGHT_FADE's.  The program will automatically
//* attach these to the TAG_LIGHT_FADE's.
//* High byte = amt of diffusion 1,2,3,4 valid values - only need to tag one of the high bytes
#define TAG_LIGHT_FADE_DIFFUSE  304

//* Torch flicker effect - random shade changes
//* Ceiling is minimum darkness.
#define TAG_LIGHT_TORCH         302
//* Same as previous except floor is not changed.
#define TAG_LIGHT_TORCH_NO_FLOOR 303

//* Programmer use
#define TAG_SPRITE_DEBUG        999

//////////////////////////////////////////////////////////////////////////////////////////
//
// HIGH TAGS
//
//////////////////////////////////////////////////////////////////////////////////////////


// Set aside 1000-1099 for high tag coordinating bits


//////////////////////////////////////////////////////////////////////////////////////////
//
// WALL TAGS
//
//////////////////////////////////////////////////////////////////////////////////////////

//* Wall tag for sliding door placed on the end of the door
#define TAG_WALL_SLIDING_DOOR 10

//* Opens the closest door - no matter the type
#define TAG_WALL_SWITCH 199

//* Sine wave wall effect - max 5 per level
//*
//* EXP - Tag the first wall with 300, last with 302.
//*       Use point2 to see which direction the wall goes.
//*
//* 1st Sector High Tag = range
//* 2nd Sector High Tag = speed
//* 3th Sector High Tag = a distance from one peak (top of curve) to the next

//* Sine Wave wall in y direction
#define TAG_WALL_SINE_Y_BEGIN 300
//* Sine Wave wall in x direction
#define TAG_WALL_SINE_X_BEGIN 301
#define TAG_WALL_SINE_Y_END 302
#define TAG_WALL_SINE_X_END 303

//* Switch to rotate a SO 90 degrees when pressed.
//* High tag = SO number to rotate.
#define TAG_ROTATE_SO_SWITCH 304

//* Climbable wall that has a top.
#define TAG_WALL_CLIMB 305

//* Smashable walls
//* High Tag is SPAWN_SPOT match tag
#define TAG_WALL_BREAK       307
  
//* For SO's that rotate - tag ONE wall of the loop to make loop NOT rotate with the rest of the
//* SO.  Does not matter if you tag the inside or outside wall.
//* Exp - drill bit
#define TAG_WALL_LOOP_DONT_SPIN 500                                             
//* Reverse spin for this wall loop and sector.  Tag same as DONT_SPIN.
//* Exp - pit with teath
#define TAG_WALL_LOOP_REVERSE_SPIN 501                                             
//* Spin twice as fast as SO.  Tag same as DONT_SPIN.
//* Exp - whirlpool
#define TAG_WALL_LOOP_SPIN_2X 502                                             
//* Spin 4X as fast as SO.  Tag same as DONT_SPIN.
//* Exp - whirlpool
#define TAG_WALL_LOOP_SPIN_4X 503                                             
//* Tag the outer loop of a SO with this.
#define TAG_WALL_LOOP_OUTER 504                                             
//* Just tag one wall so it does not move.  My attempt to fix sector splitting for the 
//* SO outer loop.  Not working real well.
#define TAG_WALL_DONT_MOVE 505                                             

//* Just tag one wall of closed loop teleporter.  
//* High byte is speed - shift value 0-6
#define TAG_WALL_LOOP_TELEPORTER_PAN 506

#define TAG_WALL_ALIGN_SLOPE_TO_POINT    550
#endif

/*******************************************************************************

/////////////////////////////////////////////////////////////////////////////////
//
// Skill Notes from history.txt
//
/////////////////////////////////////////////////////////////////////////////////

    SKILL & AGRESSIVNESS

        Can set skill level on the command line with -s#
        
        Press F8 on sprite to get a menu to set these values.
        
            Skill - Valid values 0-4
            
                Enemy Actors
                
                    0 Fewest Enemys
                    1
                    2 Default
                    3
                    4 Most Enemys
                    
                Ammo/Weapon Sprites
                
                    0 Most A/W
                    1
                    2 Default
                    3
                    4 Fewest A/W
                 
            Aggressiveness - Valid values 0-3

                    0 Random - Default
                    1 Least Agressive
                    2
                    3 Most Agressive
                    
/////////////////////////////////////////////////////////////////////////////////
//
// Track Notes from history.txt
//
/////////////////////////////////////////////////////////////////////////////////

QUICK TRACK (tm) FEATURES    

    Quick Tracks (tm) save Mappers time in placing certain types of tracks.
    They let you place a single sprite for a track instead of 3 or 4.  See
    ACTOR.MAP for examples.

    Quick Jump -  Place "QJ" sprite (located next to ST1) and set
    TRACK_ACTOR_QUICK_JUMP in lotag, jump height in high tag, and turn angle to
    dirction of jump.  NOTE that jump height is not required and generally
    should not be used unless the actors are not doing what they are supposed
    to.  The program will figure the jump height.

    Quick Jump Down - Place "QJD" sprite similar to "QJ".

    Quick Super Jump -  "QSJ" sprite.  Only used by creatures that can jump
    really high (panther, ripper).

    Quick Scan -  Just like the scan track only a single sprite.
        
    NO they're not REALLY TradeMarked!  I was just goof'in on ya!

********************************************************************************

As I implement Actor Code and such I will sometimes define (very generally) in
LOGIC sections what is going on in the code to let you guys know what is
happening logic wise.  Read it! :)

NOTE: Look at tags.h for Track Type (TT_name) descriptions.

LOGIC: RUN WAY

    A ninja runs away when his health is low and on a random number.

    Ninja looks for track types near by in this order.
    
    1. TT_EXIT
    2. TT_LADDER
    3. TT_TRAVERSE
    4. TT_STAIRS
    5. TT_JUMP_UP
    6. TT_JUMP_DOWN
    7. TT_SCAN
    
    If he finds one of these that leads AWAY from the player, he will take it.
                                
    When a ninja gets to the end of a track he will then search again for for a
    track leading away from the player.  Theoretically you would be able to
    chase a fleeing ninja ALL THE WAY ACROSS A MAP if tracks were set up
    nicely.
    
LOGIC: FIND PLAYER

    A ninja can try to find the player via a track if 
        A) Ninja is moving toward player and is blocked by something.
        B) Ninja looses sight of player.

    If Player is above, looks for track types nearby in this order.
        1. TT_LADDER
        2. TT_STAIRS
        3. TT_JUMP_UP
        4. TT_TRAVERSE
        5. TT_SCAN
        6. TT_EXIT
    
    If Player is below, looks for track types nearby in this order.
        1. TT_JUMP_DOWN
        2. TT_TRAVERSE
        3. TT_SCAN
        4. TT_EXIT

    If Player is at same level, looks for track types nearby in this order.
        1. TT_TRAVERSE
        2. TT_EXIT
        3. TT_SCAN
        
    If he finds one of these that leads CLOSER to the player, he will take it.
    
LOGIC: WANDER

    When loosing sight of the player, a ninja can then choose to wander.
          
    Looks for track types nearby in this order.
    
        1. TT_DUCK_N_SHOOT
        2. TT_HIDE_N_SHOOT
        3. TT_WANDER
        4. TT_JUMP_DOWN
        5. TT_JUMP_UP
        6. TT_TRAVERSE
        7. TT_STAIRS
        8. TT_LADDER
        9. TT_EXIT
    
    
IMPORTANT NOTE: Currently when searching for track types, actors stop looking
after they find the first satisfactory track.  This is NOT optimal.  Should
search through all types for the best case.  This will be fixed in the future.

*******************************************************************************/

