1 //------------------------------------------------------------------------- 2 /* 3 Copyright (C) 1997, 2005 - 3D Realms Entertainment 4 5 This file is part of Shadow Warrior version 1.2 6 7 Shadow Warrior is free software; you can redistribute it and/or 8 modify it under the terms of the GNU General Public License 9 as published by the Free Software Foundation; either version 2 10 of the License, or (at your option) any later version. 11 12 This program is distributed in the hope that it will be useful, 13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 15 16 See the GNU General Public License for more details. 17 18 You should have received a copy of the GNU General Public License 19 along with this program; if not, write to the Free Software 20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 22 Original Source: 1997 - Frank Maddin and Jim Norwood 23 Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms 24 */ 25 //------------------------------------------------------------------------- 26 27 #ifndef TAGS_H 28 #define TAGS_H 29 30 #include "jtags.h" 31 32 // NOTE: Switches are always sprites and are usually on walls, triggers are on the floor. 33 34 35 ////////////////////////////////////////////////////////////////////////////////////////// 36 // 37 // MISC TAGS 38 // 39 ////////////////////////////////////////////////////////////////////////////////////////// 40 41 // Stepping on this finds actors closeby that are on a track at a point defined as 42 // TRACK_ACTOR_WAIT_FOR_TRIGGER and activates them. 43 // High tag = distance to look for actors 44 #define TAG_TRIGGER_ACTORS 3 45 46 // For ladders attached to white walls. 47 #define TAG_LADDER 30 48 49 //Shoots a fireball from a ST1 FIREBALL_TRAP (or BOLT) sprite with a matching number. 50 //High tag = match number to match with ST1 sprite 51 #define TAG_TRIGGER_MISSILE_TRAP 43 52 53 //Explodes wall sector 54 //High tag = match number 55 #define TAG_TRIGGER_EXPLODING_SECTOR 44 56 57 ////////////////////////////////////////////////////////////////////////////////////////// 58 // 59 // DOOR TAGS 60 // 61 ////////////////////////////////////////////////////////////////////////////////////////// 62 63 // High tag for z moving doors is always the speed unless otherwise noted - default 64 // 200 65 66 // Red sector rotating doors. They can have up to 15 points per door and 67 // rotate about any point you choose. Don't have to be rectangular, can be any shape. Can 68 // use masked walls with them. 69 70 // Red sector rotating door - Master sector that has doors inside of it 71 // To lock these types of doors place a SECT_LOCK_DOOR ST1 in this sector 72 #define TAG_DOOR_ROTATE 112 73 74 // Red sector rotating door - Tag the actual door with this. Rotate POSITIVE or NEGATIVE 90 degrees 75 #define TAG_DOOR_ROTATE_POS 113 76 #define TAG_DOOR_ROTATE_NEG 114 77 78 // Wall pivot point - MUST tag the ouside of the wall, NOT the inside!! - red sector method 79 // Remember - a wall is just an x,y location 80 #define TAG_WALL_ROTATE_PIVOT 2 81 82 // Tag for sliding door (Star Trek/Wolf type) 83 #define TAG_DOOR_SLIDING 115 84 // Wall tag for sliding door placed on the end of the door 85 #define TAG_WALL_SLIDING_DOOR 10 86 87 // Tag for exiting current level and starting up another one. 88 // High Tag - Destination level number - 89 // 0 - Title screen 90 // 1 - e1l1 91 // 2 - e1l2 92 // ... 93 #define TAG_LEVEL_EXIT_SWITCH 116 94 95 ////////////////////////////////////////////////////////////////////////////////////////// 96 // 97 // ELEVATOR TAGS 98 // 99 ////////////////////////////////////////////////////////////////////////////////////////// 100 101 // Mappers DONT use this!! Use ST1 SECT_VATOR. 102 #define TAG_VATOR 206 103 104 // toggles ST1 SECT_VATOR sectors 105 // TAG1 = match tag 106 #define TAG_SPRITE_SWITCH_VATOR 206 107 #define TAG_SECTOR_TRIGGER_VATOR 206 108 109 // toggles ST1 SCALE sector objects 110 // TAG1 = match tag 111 #define TAG_SO_SCALE_SWITCH 208 112 #define TAG_SO_SCALE_TRIGGER 208 113 114 // toggles ST1 SCALE sector objects 115 // TAG1 = match tag 116 #define TAG_SO_SCALE_ONCE_SWITCH 209 117 #define TAG_SO_SCALE_ONCE_TRIGGER 209 118 119 // TAG1 = match tag 120 #define TAG_LIGHT_SWITCH 210 121 #define TAG_LIGHT_TRIGGER 210 122 123 // EVERTHING tags will trigger everything with a match tag 124 // TAG1 = match tag 125 #define TAG_SWITCH_EVERYTHING 211 126 #define TAG_TRIGGER_EVERYTHING 211 127 128 // TAG1 = match tag 129 #define TAG_SWITCH_EVERYTHING_ONCE 212 130 #define TAG_TRIGGER_EVERYTHING_ONCE 212 131 132 #define TAG_COMBO_SWITCH_EVERYTHING 213 133 #define TAG_COMBO_SWITCH_EVERYTHING_ONCE 214 134 135 // High tag is the number to MATCH the ST1 match number. 136 #define TAG_SO_EVENT_SWITCH 215 137 // Same as switch but tag a sector as a trigger. 138 #define TAG_SO_EVENT_TRIGGER 215 139 140 // Spawns sprites with matching tags 141 // Same as switch but tag a sector as a trigger. 142 #define TAG_SPAWN_ACTOR_TRIGGER 216 143 144 // Spawns sprites with matching tags 145 // Same as switch but tag a sector as a trigger. 146 #define TAG_SECRET_AREA_TRIGGER 217 147 148 #define TAG_ROTATOR 218 149 #define TAG_SLIDOR 220 150 // wall tags for SLIDOR 151 // hitag = match 152 #define TAG_WALL_SLIDOR_LEFT 220 153 #define TAG_WALL_SLIDOR_RIGHT 221 154 #define TAG_WALL_SLIDOR_UP 222 155 #define TAG_WALL_SLIDOR_DOWN 223 156 157 // Step on the sector, press the space bar, and it shoves you high into the air. 158 // High tag has height of jump 159 #define TAG_SPRING_BOARD 240 160 161 // Sine wave floor effect - max 5 per level 162 // 163 // Tag the first sector with 400, the next with 401, and so on up to 419. 164 // The WAVE will actually flow from the opposite end. The WAVE direction is what is 165 // refered to when BEGINNING and END are referred to below. 166 // 167 // 1st Sector High Tag = the range in pixels the floor will undulate in the Z direction 168 // 2rd Sector High Tag = range decrement - takes the range from the 1st sector high tag and 169 // adjusts all the rest by this decrement - makes the WAVE start off 170 // small and get LARGER toward the end - THIS IS IN Z COORDINATES 171 // *NOT* PIXELS 172 // 3nd Sector High Tag = speed of the motion - a shift value - default to 3 173 // 4th Sector High Tag = a distance from one peak (top of curve) to the next - default is the 174 // number of sectors in the SINE WAVE (max of 20) 175 // Last Sector High Tag= special tag to make a realistic ocean wave - modifies the range 176 // toward the END (greatest range is usually here) of the WAVE 177 // so that it dissapates quickly. Without this it would just continue 178 // to get bigger toward the end of the WAVE. 179 180 #define TAG_SINE_WAVE_FLOOR 400 181 #define TAG_SINE_WAVE_CEILING 420 182 #define TAG_SINE_WAVE_BOTH 440 183 184 185 ////////////////////////////////////////////////////////////////////////////////////////// 186 // 187 // SECTOR OBJECT TAGS 188 // 189 ////////////////////////////////////////////////////////////////////////////////////////// 190 // Sector Objects (SOs) are groups of sectors that can be moved around on a track. 191 // All SOs must have at a minimum: 192 // 1. Bounding sprites (upper left and lower right) that contains all sectors to be moved. 193 // 2. A sector marked as the center of the SO. 194 // 195 // Tags 500-600 are set reserved for SOs. There is a maximum of 20 SOs per level. 196 // 197 // Tags 500-504 correspond to object 1, 505-509 to object 2, 510-514 to object 3, etc ... 198 // 199 // Bounding sprite tags are set up similar. 200 // Upper left tag of object 1 is 500, lower right is 501 201 // Upper left tag of object 2 is 505, lower right is 506 202 // Etc... 203 ////////////////////////////////////////////////////////////////////////////////////////// 204 205 // The center of this sector will be the center of the SO 206 // IMPORTANT: High Tag must be set to the track number 207 #define TAG_OBJECT_CENTER 501 208 209 ////////////////////////////////////////////////////////////////////////////////////////// 210 // 211 // TRACK TAGS FOR SECTOR OBJECTS 212 // 213 ////////////////////////////////////////////////////////////////////////////////////////// 214 // Tracks allow SOs and sprites to follow a path designated by the map-maker. 215 // All Tracks must have at a minimum: 216 // 1. A TRACK_START. 217 // 2. A TRACK_END. 218 // 219 // Tracks are set up by the program by connecting sprites placed by the map-maker in the BUILD 220 // editor. The track sprites start at location 1900 and end at 1999 so there are 100 available 221 // tracks. Tracks automatically loop back to the beginning when the TRACK_END sprite is 222 // detected. Track tags listed below can be set to modify the behavior of objects moving along 223 // them. 224 // 225 // Look at the tracks in example maps to see how they are placed. 226 // 227 // NOTE: Track direction is dependent on the next closest sprite to the TRACK_START sprite. 228 // As noted below, certain track tags are dependant on the direction the object is traveling on 229 // on the track. 230 // 231 // For placing actor sprite on the tracks: 232 // 1. Put a sprite down near the point you want it to start from. 233 // 2. Adjust the angle to the left to make the sprite move in the "reverse" direction 234 // and to the right to make the sprite move in the "forward" direction. 235 // 3. For the pic, place the first pic of the actor found in the editart file. 236 // 237 // Every track can have a type set in the high tag of TRACK_START. 238 ////////////////////////////////////////////////////////////////////////////////////////// 239 240 241 // Mark first track sprite with this 242 // High tag = Type of track (defined next) 243 #define TRACK_START 700 244 245 // 246 // TRACK TYPES - only valid for sprites only NOT for SOs 247 // 248 // Used to attach a name to a track purpose. The actors will "look around" for 249 // tracks to know what actions are available to them. 250 // 251 252 // All tracks are assumed to be SEGMENTS (non-circular, generally leading in a certain 253 // direction) unless otherwise noted. SEGMENTS are generally kept short with a few 254 // exceptions. 255 256 // Follow a circular route available for sprites to hop on and off. 257 // Generally covers a larger area than TT_WANDER. 258 #define TT_ROUTE 1 259 260 // Jump up only 261 #define TT_JUMP_UP 2 262 // Jump down only 263 #define TT_JUMP_DOWN 3 264 // Jump up/down track 265 #define TT_JUMP_BOTH 4 266 // Ladder track. Currently only good for going up. Must jump down. 267 #define TT_LADDER 5 268 // Stair track. Hard for sprites to maneuver narrow stairs well without tracks. 269 #define TT_STAIRS 6 270 271 // Traverse a complex route - generally thought of to move you from point A to point B 272 // in complex map situations. 273 #define TT_TRAVERSE 7 274 275 // Duck behind cover and attack 276 #define TT_DUCK_N_SHOOT 8 277 // Hide behind cover and attack 278 #define TT_HIDE_N_SHOOT 9 279 280 // Exit tracks to exit a room/area. Probably should lead to a door alot of the time. 281 #define TT_EXIT 10 282 283 // Wander track. Wander about general area until you come upon a player. 284 #define TT_WANDER 11 285 286 // Scan for other tracks. Generally a VERY short track put these in places where 287 // other tracks can be seen easily. Good "vantage points". 288 #define TT_SCAN 12 289 290 // Super Jump 291 #define TT_SUPER_JUMP_UP 13 292 293 // Operate Stuff 294 #define TT_OPERATE 14 295 296 297 // Mark last sprite with this 298 #define TRACK_END 701 299 // Set the target speed and actual speed at this point 300 // Valid values for target speed are 2 to 128 301 #define TRACK_SET_SPEED 702 302 // Stop for (seconds) in high tag 303 #define TRACK_STOP 703 304 // Reverse the direction 305 #define TRACK_REVERSE 704 306 307 // Note that the next two tags have the opposite effect when traveling the REVERSE direction 308 309 // Sets up a target speed by a delta (amt) in high tag 310 // velocity = (current target velocity) + (speed up amount in high tag) 311 // Valid values for target speed are 2 to 128 312 #define TRACK_SPEED_UP 705 313 314 // Sets up a target speed by a delta (amt) in high tag 315 // velocity = (current target velocity) - (speed up amount in high tag) 316 // Valid values for target speed are 2 to 128 317 #define TRACK_SLOW_DOWN 706 318 319 // The rate at which the velocity approaches the target speed. 320 // This is defined as a shift value (for processing speed) and defaults to 6. The valid range 321 // is 1 to 12. 322 #define TRACK_VEL_RATE 707 323 324 325 // Moves the floor of the object by a delta PIXEL position (amt) in high tag 326 #define TRACK_ZUP 709 327 // Moves the floor of the object by a delta PIXEL position (amt) in high tag 328 #define TRACK_ZDOWN 710 329 // Sets the rate at which the ZUP/ZDOWN moves. Defaults to 256. 330 #define TRACK_ZRATE 711 331 // Special mode where the object looks at the zcoord of the next track point and moves 332 // to achieve the destination. In high tag is a negative delta Z from the placement of 333 // the track sprites z value. 334 #define TRACK_ZDIFF_MODE 712 335 336 // Object spins as it goes along its track. Spin speed in high tag. 337 // For now, once you start it spinning you cannot stop it. 338 #define TRACK_SPIN 715 339 340 // Object stops spining. Angle to finish at in high tag. 341 #define TRACK_SPIN_STOP 716 342 343 // Bobbing for SO's. 344 // High tag = Bob amt in pixels. 345 #define TRACK_BOB_START 717 346 // High tag = Bob speed - shift amt pixels. 347 #define TRACK_BOB_SPEED 718 348 // Bobbing for SO's. 349 #define TRACK_BOB_STOP 719 350 // Start object spinning in the opposite direction. 351 #define TRACK_SPIN_REVERSE 720 352 353 // Start object sinking to ST1 SECT_SO_SINK_DEST 354 // For boats 355 // High tag = speed of sinking 356 #define TRACK_SO_SINK 723 357 358 // For boats - lower whirlpool sector - tagged with ST1 SECT_SO_FORM_WHIRLPOOL 359 #define TRACK_SO_FORM_WHIRLPOOL 724 360 361 // Move Sprite Objects (not sector objects) straight up or down in the z 362 // direction to the next points z height then continues along the track 363 // High tag = speed of movement - default is 256 364 #define TRACK_MOVE_VERTICAL 725 365 366 // Object will wait at this point on the track for a trigger/switch to be 367 // flipped. Use TAG_SO_EVENT_SWITCH and TRIGGER to free the SO to 368 // continue. In addition the these switches and triggers, others that have 369 // have MATCHing tags will work with this tag. The following is a list. 370 // 371 // TAG_SPRITE_HIT_MATCH 372 // TAG_OPEN_DOOR_SWITCH 373 // TAG_OPEN_DOOR_TRIGGER 374 // 375 // Basically anthing that has a match tag that operates on sectors can also 376 // operate a TRACK_WAIT_FOR_EVENT. 377 // 378 379 // High tag = match number 380 #define TRACK_WAIT_FOR_EVENT 726 381 382 // does a DoMatchEverything 383 // TAG1 = match tag 384 #define TRACK_MATCH_EVERYTHING 728 385 #define TRACK_MATCH_EVERYTHING_ONCE 729 386 387 /////////////// 388 // 389 // TRACK TAGS FOR SPRITES ONLY 390 // 391 /////////////// 392 393 // Set the target speed and actual speed at this point 394 // Valid values for target speed are 2 to 128 395 #define TRACK_ACTOR_SET_SPEED 750 396 // Stop for (seconds) in high tag 397 #define TRACK_ACTOR_STOP 751 398 // Reverse the direction 399 #define TRACK_ACTOR_REVERSE 752 400 401 // Note that the next two tags have the opposite effect when traveling the REVERSE direction 402 403 // Sets up a target speed by a delta (amt) in high tag 404 // velocity = (current target velocity) + (speed up amount in high tag) 405 // Valid values for target speed are 2 to 128 406 #define TRACK_ACTOR_SPEED_UP 753 407 408 // Sets up a target speed by a delta (amt) in high tag 409 // velocity = (current target velocity) - (speed up amount in high tag) 410 // Valid values for target speed are 2 to 128 411 #define TRACK_ACTOR_SLOW_DOWN 754 412 413 // The rate at which the velocity approaches the target speed. 414 // This is defined as a shift value (for processing speed) and defaults to 6. The valid range 415 // is 1 to 12. 416 #define TRACK_ACTOR_VEL_RATE 755 417 418 // Special mode where the object looks at the zcoord of the next track point and moves 419 // to achieve the destination. Should not be set when jumping/climbing etc. 420 #define TRACK_ACTOR_ZDIFF_MODE 759 421 422 423 424 //Note: All actions are preformed only if they exist for the character. 425 426 // High tag = seconds 427 #define TRACK_ACTOR_STAND 770 428 // High tag = height value (default 384) 429 #define TRACK_ACTOR_JUMP 771 430 // Toggle crawl state 431 #define TRACK_ACTOR_CRAWL 772 432 // Toggle swim state 433 #define TRACK_ACTOR_SWIM 773 434 // Toggle fly spell 435 #define TRACK_ACTOR_FLY 774 436 // High tag = seconds 437 #define TRACK_ACTOR_SIT 776 438 // High tag = seconds 439 #define TRACK_ACTOR_DEATH1 777 440 // High tag = seconds 441 #define TRACK_ACTOR_DEATH2 778 442 // Air Death! 443 // High tag = seconds 444 #define TRACK_ACTOR_DEATH_JUMP 779 445 446 // Close range attacks - in order of least powerful to most 447 // High tag = seconds 448 #define TRACK_ACTOR_CLOSE_ATTACK1 780 449 #define TRACK_ACTOR_CLOSE_ATTACK2 781 450 // Long range attacks - in order of least powerful to most 451 // High tag = seconds 452 #define TRACK_ACTOR_ATTACK1 782 453 #define TRACK_ACTOR_ATTACK2 783 454 #define TRACK_ACTOR_ATTACK3 784 455 #define TRACK_ACTOR_ATTACK4 785 456 #define TRACK_ACTOR_ATTACK5 786 457 #define TRACK_ACTOR_ATTACK6 787 458 459 // High tag = seconds 460 #define TRACK_ACTOR_LOOK 790 461 // High tag = seconds to pause 462 // Point of the sprite angle in the direction of the operatable sector/wall/switch 463 // Actor presses the space bar to operate sector/wall/switch. 464 #define TRACK_ACTOR_OPERATE 791 465 // High tag = height to go up before jumping to next point 466 // Sprite angle must be facing the ladder 467 #define TRACK_ACTOR_CLIMB_LADDER 792 468 // Set up a default jump value - for use before climbing ladders etc 469 #define TRACK_ACTOR_SET_JUMP 793 470 471 // Specail Action - depends on each actor 472 // High tag = seconds 473 #define TRACK_ACTOR_SPECIAL1 795 474 #define TRACK_ACTOR_SPECIAL2 796 475 476 // Jump if moving forward on track 477 #define TRACK_ACTOR_JUMP_IF_FORWARD 797 478 // Jump if moving backward on track 479 #define TRACK_ACTOR_JUMP_IF_REVERSE 798 480 481 // Wait for player to come into range before moving from this point. 482 // High tag = Distance from player at which NPC can start moving. 483 #define TRACK_ACTOR_WAIT_FOR_PLAYER 799 484 485 // Wait for trigger to be tripped before moving from this point. 486 // Use TAG_TRIGGER_ACTORS defined above is used to trigger the actor. 487 #define TRACK_ACTOR_WAIT_FOR_TRIGGER 800 488 489 // Quick TAGS - Used internally by ME ONLY 490 #define TRACK_ACTOR_QUICK_JUMP 801 491 #define TRACK_ACTOR_QUICK_JUMP_DOWN 802 492 #define TRACK_ACTOR_QUICK_SUPER_JUMP 803 493 #define TRACK_ACTOR_QUICK_SCAN 804 494 #define TRACK_ACTOR_QUICK_EXIT 805 495 #define TRACK_ACTOR_QUICK_LADDER 806 496 #define TRACK_ACTOR_QUICK_OPERATE 807 497 #define TRACK_ACTOR_QUICK_DUCK 808 498 #define TRACK_ACTOR_QUICK_DEFEND 809 499 500 ////////////////////////////////////////////////////////////////////////////////////////// 501 // 502 // SPRITE TAGS 503 // 504 ////////////////////////////////////////////////////////////////////////////////////////// 505 506 // 100-199 are reserved for placing actors on tracks 507 #define TAG_ACTOR_TRACK_BEGIN 30000 508 #define TAG_ACTOR_TRACK_END 30099 509 510 // When "operated" moves grating in the direction the sprite is pointing 511 // High tag = distance to move the grate - 1024 is a good distance 512 #define TAG_SPRITE_GRATING 200 513 514 // Place an actor with this tag and it will not spawn until it is triggered. 515 // High tag = Match number 516 #define TAG_SPAWN_ACTOR 203 517 #define TAG_SPRITE_HIT_MATCH 257 518 519 ////////////////////////////////////////////////////////////////////////////////////////// 520 // 521 // WALL TAGS 522 // 523 ////////////////////////////////////////////////////////////////////////////////////////// 524 525 526 // Sine wave wall effect - max 5 per level 527 // 528 // EXP - Tag the first wall with 300, last with 302. 529 // Use point2 to see which direction the wall goes. 530 // 531 // 1st Sector High Tag = range 532 // 2nd Sector High Tag = speed 533 // 3th Sector High Tag = a distance from one peak (top of curve) to the next 534 535 // Sine Wave wall in y direction 536 #define TAG_WALL_SINE_Y_BEGIN 300 537 // Sine Wave wall in x direction 538 #define TAG_WALL_SINE_X_BEGIN 301 539 #define TAG_WALL_SINE_Y_END 302 540 #define TAG_WALL_SINE_X_END 303 541 542 // Switch to rotate a SO 90 degrees when pressed. 543 // High tag = SO number to rotate. 544 #define TAG_ROTATE_SO_SWITCH 304 545 546 // Climbable wall that has a top. 547 #define TAG_WALL_CLIMB 305 548 549 // Smashable walls 550 // High Tag is SPAWN_SPOT match tag 551 #define TAG_WALL_BREAK 307 552 553 // For SO's that rotate - tag ONE wall of the loop to make loop NOT rotate with the rest of the 554 // SO. Does not matter if you tag the inside or outside wall. 555 // Exp - drill bit 556 #define TAG_WALL_LOOP_DONT_SPIN 500 557 // Reverse spin for this wall loop and sector. Tag same as DONT_SPIN. 558 // Exp - pit with teath 559 #define TAG_WALL_LOOP_REVERSE_SPIN 501 560 // Spin twice as fast as SO. Tag same as DONT_SPIN. 561 // Exp - whirlpool 562 #define TAG_WALL_LOOP_SPIN_2X 502 563 // Spin 4X as fast as SO. Tag same as DONT_SPIN. 564 // Exp - whirlpool 565 #define TAG_WALL_LOOP_SPIN_4X 503 566 // Tag the outer loop of a SO with this. 567 #define TAG_WALL_LOOP_OUTER 504 568 // Just tag one wall so it does not move. My attempt to fix sector splitting for the 569 // SO outer loop. Not working real well. 570 #define TAG_WALL_DONT_MOVE 505 571 572 // Just tag one wall of closed loop teleporter. 573 // High byte is speed - shift value 0-6 574 #define TAG_WALL_LOOP_TELEPORTER_PAN 506 575 576 // Just tag one wall in loop so it does not scale. 577 #define TAG_WALL_LOOP_DONT_SCALE 507 578 579 // Tag the secondary outer loop of a SO with this. Use with Rectangle Clipping 580 // and Stacked sectors. 581 #define TAG_WALL_LOOP_OUTER_SECONDARY 508 582 583 #define TAG_WALL_ALIGN_SLOPE_TO_POINT 550 584 #endif 585 586