Rearange menu of mpegplayer. Add new menu with "settings" and "quit", and remove...
[kugel-rb.git] / apps / plugins / doom / p_switch.c
blob698c4c8ee3aaff14cec07f76fa837c280ccddd1f
1 /* Emacs style mode select -*- C++ -*-
2 *-----------------------------------------------------------------------------
5 * PrBoom a Doom port merged with LxDoom and LSDLDoom
6 * based on BOOM, a modified and improved DOOM engine
7 * Copyright (C) 1999 by
8 * id Software, Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman
9 * Copyright (C) 1999-2000 by
10 * Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian Schulze
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
25 * 02111-1307, USA.
27 * DESCRIPTION:
28 * Switches, buttons. Two-state animation. Exits.
30 *-----------------------------------------------------------------------------*/
32 #include "doomstat.h"
33 #include "w_wad.h"
34 #include "r_main.h"
35 #include "p_spec.h"
36 #include "g_game.h"
37 #include "s_sound.h"
38 #include "sounds.h"
39 #include "m_swap.h"
40 #include "i_system.h"
41 #include "rockmacros.h"
42 // killough 2/8/98: Remove switch limit
44 static int *switchlist; // killough
45 static int max_numswitches; // killough
46 static int numswitches; // killough
48 button_t buttonlist[MAXBUTTONS];
51 // P_InitSwitchList()
53 // Only called at game initialization in order to list the set of switches
54 // and buttons known to the engine. This enables their texture to change
55 // when activated, and in the case of buttons, change back after a timeout.
57 // This routine modified to read its data from a predefined lump or
58 // PWAD lump called SWITCHES rather than a static table in this module to
59 // allow wad designers to insert or modify switches.
61 // Lump format is an array of byte packed switchlist_t structures, terminated
62 // by a structure with episode == -0. The lump can be generated from a
63 // text source file using SWANTBLS.EXE, distributed with the BOOM utils.
64 // The standard list of switches and animations is contained in the example
65 // source text file DEFSWANI.DAT also in the BOOM util distribution.
67 // Rewritten by Lee Killough to remove limit 2/8/98
69 void P_InitSwitchList(void)
71 int i, index = 0;
72 int episode = (gamemode == registered || gamemode==retail) ?
73 2 : gamemode == commercial ? 3 : 1;
74 const switchlist_t *alphSwitchList; //jff 3/23/98 pointer to switch table
75 int lump = W_GetNumForName("SWITCHES"); // cph - new wad lump handling
77 //jff 3/23/98 read the switch table from a predefined lump
78 alphSwitchList = (const switchlist_t *)W_CacheLumpNum(lump);
80 for (i=0;;i++)
82 if (index+1 >= max_numswitches)
83 switchlist = realloc(switchlist, sizeof *switchlist *
84 (max_numswitches = max_numswitches ? max_numswitches*2 : 8));
85 if (SHORT(alphSwitchList[i].episode) <= episode) //jff 5/11/98 endianess
87 if (!SHORT(alphSwitchList[i].episode))
88 break;
89 switchlist[index++] = R_TextureNumForName(alphSwitchList[i].name1);
90 switchlist[index++] = R_TextureNumForName(alphSwitchList[i].name2);
94 numswitches = index/2;
95 switchlist[index] = -1;
96 W_UnlockLumpNum(lump);
100 // P_StartButton()
102 // Start a button (retriggerable switch) counting down till it turns off.
104 // Passed the linedef the button is on, which texture on the sidedef contains
105 // the button, the texture number of the button, and the time the button is
106 // to remain active in gametics.
107 // No return.
109 void P_StartButton
110 ( line_t* line,
111 bwhere_e w,
112 int texture,
113 int time )
115 int i;
117 // See if button is already pressed
118 for (i = 0;i < MAXBUTTONS;i++)
119 if (buttonlist[i].btimer && buttonlist[i].line == line)
120 return;
122 for (i = 0;i < MAXBUTTONS;i++)
123 if (!buttonlist[i].btimer) // use first unused element of list
125 buttonlist[i].line = line;
126 buttonlist[i].where = w;
127 buttonlist[i].btexture = texture;
128 buttonlist[i].btimer = time;
129 buttonlist[i].soundorg = (mobj_t *)&line->frontsector->soundorg;
130 return;
133 I_Error("P_StartButton: no button slots left!");
137 // P_ChangeSwitchTexture()
139 // Function that changes switch wall texture on activation.
141 // Passed the line which the switch is on, and whether its retriggerable.
142 // If not retriggerable, this function clears the line special to insure that
144 // No return
146 void P_ChangeSwitchTexture
147 ( line_t* line,
148 int useAgain )
150 int texTop;
151 int texMid;
152 int texBot;
153 int i;
154 int sound;
156 if (!useAgain)
157 line->special = 0;
159 texTop = sides[line->sidenum[0]].toptexture;
160 texMid = sides[line->sidenum[0]].midtexture;
161 texBot = sides[line->sidenum[0]].bottomtexture;
163 sound = sfx_swtchn;
165 // EXIT SWITCH?
166 if (line->special == 11)
167 sound = sfx_swtchx;
169 for (i = 0;i < numswitches*2;i++)
171 if (switchlist[i] == texTop) // if an upper texture
173 S_StartSound(buttonlist->soundorg,sound); // switch activation sound
174 sides[line->sidenum[0]].toptexture = switchlist[i^1]; //chg texture
176 if (useAgain)
177 P_StartButton(line,top,switchlist[i],BUTTONTIME); //start timer
179 return;
181 else
183 if (switchlist[i] == texMid) // if a normal texture
185 S_StartSound(buttonlist->soundorg,sound); // switch activation sound
186 sides[line->sidenum[0]].midtexture = switchlist[i^1]; //chg texture
188 if (useAgain)
189 P_StartButton(line, middle,switchlist[i],BUTTONTIME); //start timer
191 return;
193 else
195 if (switchlist[i] == texBot) // if a lower texture
197 S_StartSound(buttonlist->soundorg,sound); // switch activation sound
198 sides[line->sidenum[0]].bottomtexture = switchlist[i^1];//chg texture
200 if (useAgain)
201 P_StartButton(line, bottom,switchlist[i],BUTTONTIME); //start timer
203 return;
212 // P_UseSpecialLine
215 // Called when a thing uses (pushes) a special line.
216 // Only the front sides of lines are usable.
217 // Dispatches to the appropriate linedef function handler.
219 // Passed the thing using the line, the line being used, and the side used
220 // Returns true if a thinker was created
222 boolean
223 P_UseSpecialLine
224 ( mobj_t* thing,
225 line_t* line,
226 int side )
229 if (side) //jff 6/1/98 fix inadvertent deletion of side test
230 return false;
232 //jff 02/04/98 add check here for generalized floor/ceil mover
233 if (!demo_compatibility)
235 // pointer to line function is NULL by default, set non-null if
236 // line special is push or switch generalized linedef type
237 int (*linefunc)(line_t *line)=NULL;
239 // check each range of generalized linedefs
240 if ((unsigned)line->special >= GenEnd)
242 // Out of range for GenFloors
244 else if ((unsigned)line->special >= GenFloorBase)
246 if (!thing->player)
247 if ((line->special & FloorChange) || !(line->special & FloorModel))
248 return false; // FloorModel is "Allow Monsters" if FloorChange is 0
249 if (!line->tag && ((line->special&6)!=6)) //jff 2/27/98 all non-manual
250 return false; // generalized types require tag
251 linefunc = EV_DoGenFloor;
253 else if ((unsigned)line->special >= GenCeilingBase)
255 if (!thing->player)
256 if ((line->special & CeilingChange) || !(line->special & CeilingModel))
257 return false; // CeilingModel is "Allow Monsters" if CeilingChange is 0
258 if (!line->tag && ((line->special&6)!=6)) //jff 2/27/98 all non-manual
259 return false; // generalized types require tag
260 linefunc = EV_DoGenCeiling;
262 else if ((unsigned)line->special >= GenDoorBase)
264 if (!thing->player)
266 if (!(line->special & DoorMonster))
267 return false; // monsters disallowed from this door
268 if (line->flags & ML_SECRET) // they can't open secret doors either
269 return false;
271 if (!line->tag && ((line->special&6)!=6)) //jff 3/2/98 all non-manual
272 return false; // generalized types require tag
273 linefunc = EV_DoGenDoor;
275 else if ((unsigned)line->special >= GenLockedBase)
277 if (!thing->player)
278 return false; // monsters disallowed from unlocking doors
279 if (!P_CanUnlockGenDoor(line,thing->player))
280 return false;
281 if (!line->tag && ((line->special&6)!=6)) //jff 2/27/98 all non-manual
282 return false; // generalized types require tag
284 linefunc = EV_DoGenLockedDoor;
286 else if ((unsigned)line->special >= GenLiftBase)
288 if (!thing->player)
289 if (!(line->special & LiftMonster))
290 return false; // monsters disallowed
291 if (!line->tag && ((line->special&6)!=6)) //jff 2/27/98 all non-manual
292 return false; // generalized types require tag
293 linefunc = EV_DoGenLift;
295 else if ((unsigned)line->special >= GenStairsBase)
297 if (!thing->player)
298 if (!(line->special & StairMonster))
299 return false; // monsters disallowed
300 if (!line->tag && ((line->special&6)!=6)) //jff 2/27/98 all non-manual
301 return false; // generalized types require tag
302 linefunc = EV_DoGenStairs;
304 else if ((unsigned)line->special >= GenCrusherBase)
306 if (!thing->player)
307 if (!(line->special & CrusherMonster))
308 return false; // monsters disallowed
309 if (!line->tag && ((line->special&6)!=6)) //jff 2/27/98 all non-manual
310 return false; // generalized types require tag
311 linefunc = EV_DoGenCrusher;
314 if (linefunc)
315 switch((line->special & TriggerType) >> TriggerTypeShift)
317 case PushOnce:
318 if (!side)
319 if (linefunc(line))
320 line->special = 0;
321 return true;
322 case PushMany:
323 if (!side)
324 linefunc(line);
325 return true;
326 case SwitchOnce:
327 if (linefunc(line))
328 P_ChangeSwitchTexture(line,0);
329 return true;
330 case SwitchMany:
331 if (linefunc(line))
332 P_ChangeSwitchTexture(line,1);
333 return true;
334 default: // if not a switch/push type, do nothing here
335 return false;
339 // Switches that other things can activate.
340 if (!thing->player)
342 // never open secret doors
343 if (line->flags & ML_SECRET)
344 return false;
346 switch(line->special)
348 case 1: // MANUAL DOOR RAISE
349 case 32: // MANUAL BLUE
350 case 33: // MANUAL RED
351 case 34: // MANUAL YELLOW
352 //jff 3/5/98 add ability to use teleporters for monsters
353 case 195: // switch teleporters
354 case 174:
355 case 210: // silent switch teleporters
356 case 209:
357 break;
359 default:
360 return false;
361 break;
365 if (!P_CheckTag(line)) //jff 2/27/98 disallow zero tag on some types
366 return false;
368 // Dispatch to handler according to linedef type
369 switch (line->special)
371 // Manual doors, push type with no tag
372 case 1: // Vertical Door
373 case 26: // Blue Door/Locked
374 case 27: // Yellow Door /Locked
375 case 28: // Red Door /Locked
377 case 31: // Manual door open
378 case 32: // Blue locked door open
379 case 33: // Red locked door open
380 case 34: // Yellow locked door open
382 case 117: // Blazing door raise
383 case 118: // Blazing door open
384 EV_VerticalDoor (line, thing);
385 break;
387 // Switches (non-retriggerable)
388 case 7:
389 // Build Stairs
390 if (EV_BuildStairs(line,build8))
391 P_ChangeSwitchTexture(line,0);
392 break;
394 case 9:
395 // Change Donut
396 if (EV_DoDonut(line))
397 P_ChangeSwitchTexture(line,0);
398 break;
400 case 11:
401 /* Exit level
402 * killough 10/98: prevent zombies from exiting levels
404 if (thing->player && thing->player->health <= 0 && !comp[comp_zombie])
406 S_StartSound(thing, sfx_noway);
407 return false;
410 P_ChangeSwitchTexture(line,0);
411 G_ExitLevel ();
412 break;
414 case 14:
415 // Raise Floor 32 and change texture
416 if (EV_DoPlat(line,raiseAndChange,32))
417 P_ChangeSwitchTexture(line,0);
418 break;
420 case 15:
421 // Raise Floor 24 and change texture
422 if (EV_DoPlat(line,raiseAndChange,24))
423 P_ChangeSwitchTexture(line,0);
424 break;
426 case 18:
427 // Raise Floor to next highest floor
428 if (EV_DoFloor(line, raiseFloorToNearest))
429 P_ChangeSwitchTexture(line,0);
430 break;
432 case 20:
433 // Raise Plat next highest floor and change texture
434 if (EV_DoPlat(line,raiseToNearestAndChange,0))
435 P_ChangeSwitchTexture(line,0);
436 break;
438 case 21:
439 // PlatDownWaitUpStay
440 if (EV_DoPlat(line,downWaitUpStay,0))
441 P_ChangeSwitchTexture(line,0);
442 break;
444 case 23:
445 // Lower Floor to Lowest
446 if (EV_DoFloor(line,lowerFloorToLowest))
447 P_ChangeSwitchTexture(line,0);
448 break;
450 case 29:
451 // Raise Door
452 if (EV_DoDoor(line,normal))
453 P_ChangeSwitchTexture(line,0);
454 break;
456 case 41:
457 // Lower Ceiling to Floor
458 if (EV_DoCeiling(line,lowerToFloor))
459 P_ChangeSwitchTexture(line,0);
460 break;
462 case 71:
463 // Turbo Lower Floor
464 if (EV_DoFloor(line,turboLower))
465 P_ChangeSwitchTexture(line,0);
466 break;
468 case 49:
469 // Ceiling Crush And Raise
470 if (EV_DoCeiling(line,crushAndRaise))
471 P_ChangeSwitchTexture(line,0);
472 break;
474 case 50:
475 // Close Door
476 if (EV_DoDoor(line,p_close))
477 P_ChangeSwitchTexture(line,0);
478 break;
480 case 51:
481 /* Secret EXIT
482 * killough 10/98: prevent zombies from exiting levels
484 if (thing->player && thing->player->health <= 0 && !comp[comp_zombie])
486 S_StartSound(thing, sfx_noway);
487 return false;
490 P_ChangeSwitchTexture(line,0);
491 G_SecretExitLevel ();
492 break;
494 case 55:
495 // Raise Floor Crush
496 if (EV_DoFloor(line,raiseFloorCrush))
497 P_ChangeSwitchTexture(line,0);
498 break;
500 case 101:
501 // Raise Floor
502 if (EV_DoFloor(line,raiseFloor))
503 P_ChangeSwitchTexture(line,0);
504 break;
506 case 102:
507 // Lower Floor to Surrounding floor height
508 if (EV_DoFloor(line,lowerFloor))
509 P_ChangeSwitchTexture(line,0);
510 break;
512 case 103:
513 // Open Door
514 if (EV_DoDoor(line,p_open))
515 P_ChangeSwitchTexture(line,0);
516 break;
518 case 111:
519 // Blazing Door Raise (faster than TURBO!)
520 if (EV_DoDoor (line,blazeRaise))
521 P_ChangeSwitchTexture(line,0);
522 break;
524 case 112:
525 // Blazing Door Open (faster than TURBO!)
526 if (EV_DoDoor (line,blazeOpen))
527 P_ChangeSwitchTexture(line,0);
528 break;
530 case 113:
531 // Blazing Door Close (faster than TURBO!)
532 if (EV_DoDoor (line,blazeClose))
533 P_ChangeSwitchTexture(line,0);
534 break;
536 case 122:
537 // Blazing PlatDownWaitUpStay
538 if (EV_DoPlat(line,blazeDWUS,0))
539 P_ChangeSwitchTexture(line,0);
540 break;
542 case 127:
543 // Build Stairs Turbo 16
544 if (EV_BuildStairs(line,turbo16))
545 P_ChangeSwitchTexture(line,0);
546 break;
548 case 131:
549 // Raise Floor Turbo
550 if (EV_DoFloor(line,raiseFloorTurbo))
551 P_ChangeSwitchTexture(line,0);
552 break;
554 case 133:
555 // BlzOpenDoor BLUE
556 case 135:
557 // BlzOpenDoor RED
558 case 137:
559 // BlzOpenDoor YELLOW
560 if (EV_DoLockedDoor (line,blazeOpen,thing))
561 P_ChangeSwitchTexture(line,0);
562 break;
564 case 140:
565 // Raise Floor 512
566 if (EV_DoFloor(line,raiseFloor512))
567 P_ChangeSwitchTexture(line,0);
568 break;
570 // killough 1/31/98: factored out compatibility check;
571 // added inner switch, relaxed check to demo_compatibility
573 default:
574 if (!demo_compatibility)
575 switch (line->special)
577 //jff 1/29/98 added linedef types to fill all functions out so that
578 // all possess SR, S1, WR, W1 types
580 case 158:
581 // Raise Floor to shortest lower texture
582 // 158 S1 EV_DoFloor(raiseToTexture), CSW(0)
583 if (EV_DoFloor(line,raiseToTexture))
584 P_ChangeSwitchTexture(line,0);
585 break;
587 case 159:
588 // Raise Floor to shortest lower texture
589 // 159 S1 EV_DoFloor(lowerAndChange)
590 if (EV_DoFloor(line,lowerAndChange))
591 P_ChangeSwitchTexture(line,0);
592 break;
594 case 160:
595 // Raise Floor 24 and change
596 // 160 S1 EV_DoFloor(raiseFloor24AndChange)
597 if (EV_DoFloor(line,raiseFloor24AndChange))
598 P_ChangeSwitchTexture(line,0);
599 break;
601 case 161:
602 // Raise Floor 24
603 // 161 S1 EV_DoFloor(raiseFloor24)
604 if (EV_DoFloor(line,raiseFloor24))
605 P_ChangeSwitchTexture(line,0);
606 break;
608 case 162:
609 // Moving floor min n to max n
610 // 162 S1 EV_DoPlat(perpetualRaise,0)
611 if (EV_DoPlat(line,perpetualRaise,0))
612 P_ChangeSwitchTexture(line,0);
613 break;
615 case 163:
616 // Stop Moving floor
617 // 163 S1 EV_DoPlat(perpetualRaise,0)
618 EV_StopPlat(line);
619 P_ChangeSwitchTexture(line,0);
620 break;
622 case 164:
623 // Start fast crusher
624 // 164 S1 EV_DoCeiling(fastCrushAndRaise)
625 if (EV_DoCeiling(line,fastCrushAndRaise))
626 P_ChangeSwitchTexture(line,0);
627 break;
629 case 165:
630 // Start slow silent crusher
631 // 165 S1 EV_DoCeiling(silentCrushAndRaise)
632 if (EV_DoCeiling(line,silentCrushAndRaise))
633 P_ChangeSwitchTexture(line,0);
634 break;
636 case 166:
637 // Raise ceiling, Lower floor
638 // 166 S1 EV_DoCeiling(raiseToHighest), EV_DoFloor(lowerFloortoLowest)
639 if (EV_DoCeiling(line, raiseToHighest) ||
640 EV_DoFloor(line, lowerFloorToLowest))
641 P_ChangeSwitchTexture(line,0);
642 break;
644 case 167:
645 // Lower floor and Crush
646 // 167 S1 EV_DoCeiling(lowerAndCrush)
647 if (EV_DoCeiling(line, lowerAndCrush))
648 P_ChangeSwitchTexture(line,0);
649 break;
651 case 168:
652 // Stop crusher
653 // 168 S1 EV_CeilingCrushStop()
654 if (EV_CeilingCrushStop(line))
655 P_ChangeSwitchTexture(line,0);
656 break;
658 case 169:
659 // Lights to brightest neighbor sector
660 // 169 S1 EV_LightTurnOn(0)
661 EV_LightTurnOn(line,0);
662 P_ChangeSwitchTexture(line,0);
663 break;
665 case 170:
666 // Lights to near dark
667 // 170 S1 EV_LightTurnOn(35)
668 EV_LightTurnOn(line,35);
669 P_ChangeSwitchTexture(line,0);
670 break;
672 case 171:
673 // Lights on full
674 // 171 S1 EV_LightTurnOn(255)
675 EV_LightTurnOn(line,255);
676 P_ChangeSwitchTexture(line,0);
677 break;
679 case 172:
680 // Start Lights Strobing
681 // 172 S1 EV_StartLightStrobing()
682 EV_StartLightStrobing(line);
683 P_ChangeSwitchTexture(line,0);
684 break;
686 case 173:
687 // Lights to Dimmest Near
688 // 173 S1 EV_TurnTagLightsOff()
689 EV_TurnTagLightsOff(line);
690 P_ChangeSwitchTexture(line,0);
691 break;
693 case 174:
694 // Teleport
695 // 174 S1 EV_Teleport(side,thing)
696 if (EV_Teleport(line,side,thing))
697 P_ChangeSwitchTexture(line,0);
698 break;
700 case 175:
701 // Close Door, Open in 30 secs
702 // 175 S1 EV_DoDoor(close30ThenOpen)
703 if (EV_DoDoor(line,close30ThenOpen))
704 P_ChangeSwitchTexture(line,0);
705 break;
707 case 189: //jff 3/15/98 create texture change no motion type
708 // Texture Change Only (Trigger)
709 // 189 S1 Change Texture/Type Only
710 if (EV_DoChange(line,trigChangeOnly))
711 P_ChangeSwitchTexture(line,0);
712 break;
714 case 203:
715 // Lower ceiling to lowest surrounding ceiling
716 // 203 S1 EV_DoCeiling(lowerToLowest)
717 if (EV_DoCeiling(line,lowerToLowest))
718 P_ChangeSwitchTexture(line,0);
719 break;
721 case 204:
722 // Lower ceiling to highest surrounding floor
723 // 204 S1 EV_DoCeiling(lowerToMaxFloor)
724 if (EV_DoCeiling(line,lowerToMaxFloor))
725 P_ChangeSwitchTexture(line,0);
726 break;
728 case 209:
729 // killough 1/31/98: silent teleporter
730 //jff 209 S1 SilentTeleport
731 if (EV_SilentTeleport(line, side, thing))
732 P_ChangeSwitchTexture(line,0);
733 break;
735 case 241: //jff 3/15/98 create texture change no motion type
736 // Texture Change Only (Numeric)
737 // 241 S1 Change Texture/Type Only
738 if (EV_DoChange(line,numChangeOnly))
739 P_ChangeSwitchTexture(line,0);
740 break;
742 case 221:
743 // Lower floor to next lowest floor
744 // 221 S1 Lower Floor To Nearest Floor
745 if (EV_DoFloor(line,lowerFloorToNearest))
746 P_ChangeSwitchTexture(line,0);
747 break;
749 case 229:
750 // Raise elevator next floor
751 // 229 S1 Raise Elevator next floor
752 if (EV_DoElevator(line,elevateUp))
753 P_ChangeSwitchTexture(line,0);
754 break;
756 case 233:
757 // Lower elevator next floor
758 // 233 S1 Lower Elevator next floor
759 if (EV_DoElevator(line,elevateDown))
760 P_ChangeSwitchTexture(line,0);
761 break;
763 case 237:
764 // Elevator to current floor
765 // 237 S1 Elevator to current floor
766 if (EV_DoElevator(line,elevateCurrent))
767 P_ChangeSwitchTexture(line,0);
768 break;
771 // jff 1/29/98 end of added S1 linedef types
773 //jff 1/29/98 added linedef types to fill all functions out so that
774 // all possess SR, S1, WR, W1 types
776 case 78: //jff 3/15/98 create texture change no motion type
777 // Texture Change Only (Numeric)
778 // 78 SR Change Texture/Type Only
779 if (EV_DoChange(line,numChangeOnly))
780 P_ChangeSwitchTexture(line,1);
781 break;
783 case 176:
784 // Raise Floor to shortest lower texture
785 // 176 SR EV_DoFloor(raiseToTexture), CSW(1)
786 if (EV_DoFloor(line,raiseToTexture))
787 P_ChangeSwitchTexture(line,1);
788 break;
790 case 177:
791 // Raise Floor to shortest lower texture
792 // 177 SR EV_DoFloor(lowerAndChange)
793 if (EV_DoFloor(line,lowerAndChange))
794 P_ChangeSwitchTexture(line,1);
795 break;
797 case 178:
798 // Raise Floor 512
799 // 178 SR EV_DoFloor(raiseFloor512)
800 if (EV_DoFloor(line,raiseFloor512))
801 P_ChangeSwitchTexture(line,1);
802 break;
804 case 179:
805 // Raise Floor 24 and change
806 // 179 SR EV_DoFloor(raiseFloor24AndChange)
807 if (EV_DoFloor(line,raiseFloor24AndChange))
808 P_ChangeSwitchTexture(line,1);
809 break;
811 case 180:
812 // Raise Floor 24
813 // 180 SR EV_DoFloor(raiseFloor24)
814 if (EV_DoFloor(line,raiseFloor24))
815 P_ChangeSwitchTexture(line,1);
816 break;
818 case 181:
819 // Moving floor min n to max n
820 // 181 SR EV_DoPlat(perpetualRaise,0)
822 EV_DoPlat(line,perpetualRaise,0);
823 P_ChangeSwitchTexture(line,1);
824 break;
826 case 182:
827 // Stop Moving floor
828 // 182 SR EV_DoPlat(perpetualRaise,0)
829 EV_StopPlat(line);
830 P_ChangeSwitchTexture(line,1);
831 break;
833 case 183:
834 // Start fast crusher
835 // 183 SR EV_DoCeiling(fastCrushAndRaise)
836 if (EV_DoCeiling(line,fastCrushAndRaise))
837 P_ChangeSwitchTexture(line,1);
838 break;
840 case 184:
841 // Start slow crusher
842 // 184 SR EV_DoCeiling(crushAndRaise)
843 if (EV_DoCeiling(line,crushAndRaise))
844 P_ChangeSwitchTexture(line,1);
845 break;
847 case 185:
848 // Start slow silent crusher
849 // 185 SR EV_DoCeiling(silentCrushAndRaise)
850 if (EV_DoCeiling(line,silentCrushAndRaise))
851 P_ChangeSwitchTexture(line,1);
852 break;
854 case 186:
855 // Raise ceiling, Lower floor
856 // 186 SR EV_DoCeiling(raiseToHighest), EV_DoFloor(lowerFloortoLowest)
857 if (EV_DoCeiling(line, raiseToHighest) ||
858 EV_DoFloor(line, lowerFloorToLowest))
859 P_ChangeSwitchTexture(line,1);
860 break;
862 case 187:
863 // Lower floor and Crush
864 // 187 SR EV_DoCeiling(lowerAndCrush)
865 if (EV_DoCeiling(line, lowerAndCrush))
866 P_ChangeSwitchTexture(line,1);
867 break;
869 case 188:
870 // Stop crusher
871 // 188 SR EV_CeilingCrushStop()
872 if (EV_CeilingCrushStop(line))
873 P_ChangeSwitchTexture(line,1);
874 break;
876 case 190: //jff 3/15/98 create texture change no motion type
877 // Texture Change Only (Trigger)
878 // 190 SR Change Texture/Type Only
879 if (EV_DoChange(line,trigChangeOnly))
880 P_ChangeSwitchTexture(line,1);
881 break;
883 case 191:
884 // Lower Pillar, Raise Donut
885 // 191 SR EV_DoDonut()
886 if (EV_DoDonut(line))
887 P_ChangeSwitchTexture(line,1);
888 break;
890 case 192:
891 // Lights to brightest neighbor sector
892 // 192 SR EV_LightTurnOn(0)
893 EV_LightTurnOn(line,0);
894 P_ChangeSwitchTexture(line,1);
895 break;
897 case 193:
898 // Start Lights Strobing
899 // 193 SR EV_StartLightStrobing()
900 EV_StartLightStrobing(line);
901 P_ChangeSwitchTexture(line,1);
902 break;
904 case 194:
905 // Lights to Dimmest Near
906 // 194 SR EV_TurnTagLightsOff()
907 EV_TurnTagLightsOff(line);
908 P_ChangeSwitchTexture(line,1);
909 break;
911 case 195:
912 // Teleport
913 // 195 SR EV_Teleport(side,thing)
914 if (EV_Teleport(line,side,thing))
915 P_ChangeSwitchTexture(line,1);
916 break;
918 case 196:
919 // Close Door, Open in 30 secs
920 // 196 SR EV_DoDoor(close30ThenOpen)
921 if (EV_DoDoor(line,close30ThenOpen))
922 P_ChangeSwitchTexture(line,1);
923 break;
925 case 205:
926 // Lower ceiling to lowest surrounding ceiling
927 // 205 SR EV_DoCeiling(lowerToLowest)
928 if (EV_DoCeiling(line,lowerToLowest))
929 P_ChangeSwitchTexture(line,1);
930 break;
932 case 206:
933 // Lower ceiling to highest surrounding floor
934 // 206 SR EV_DoCeiling(lowerToMaxFloor)
935 if (EV_DoCeiling(line,lowerToMaxFloor))
936 P_ChangeSwitchTexture(line,1);
937 break;
939 case 210:
940 // killough 1/31/98: silent teleporter
941 //jff 210 SR SilentTeleport
942 if (EV_SilentTeleport(line, side, thing))
943 P_ChangeSwitchTexture(line,1);
944 break;
946 case 211: //jff 3/14/98 create instant toggle floor type
947 // Toggle Floor Between C and F Instantly
948 // 211 SR Toggle Floor Instant
949 if (EV_DoPlat(line,toggleUpDn,0))
950 P_ChangeSwitchTexture(line,1);
951 break;
953 case 222:
954 // Lower floor to next lowest floor
955 // 222 SR Lower Floor To Nearest Floor
956 if (EV_DoFloor(line,lowerFloorToNearest))
957 P_ChangeSwitchTexture(line,1);
958 break;
960 case 230:
961 // Raise elevator next floor
962 // 230 SR Raise Elevator next floor
963 if (EV_DoElevator(line,elevateUp))
964 P_ChangeSwitchTexture(line,1);
965 break;
967 case 234:
968 // Lower elevator next floor
969 // 234 SR Lower Elevator next floor
970 if (EV_DoElevator(line,elevateDown))
971 P_ChangeSwitchTexture(line,1);
972 break;
974 case 238:
975 // Elevator to current floor
976 // 238 SR Elevator to current floor
977 if (EV_DoElevator(line,elevateCurrent))
978 P_ChangeSwitchTexture(line,1);
979 break;
981 case 258:
982 // Build stairs, step 8
983 // 258 SR EV_BuildStairs(build8)
984 if (EV_BuildStairs(line,build8))
985 P_ChangeSwitchTexture(line,1);
986 break;
988 case 259:
989 // Build stairs, step 16
990 // 259 SR EV_BuildStairs(turbo16)
991 if (EV_BuildStairs(line,turbo16))
992 P_ChangeSwitchTexture(line,1);
993 break;
995 // 1/29/98 jff end of added SR linedef types
998 break;
1000 // Buttons (retriggerable switches)
1001 case 42:
1002 // Close Door
1003 if (EV_DoDoor(line,p_close))
1004 P_ChangeSwitchTexture(line,1);
1005 break;
1007 case 43:
1008 // Lower Ceiling to Floor
1009 if (EV_DoCeiling(line,lowerToFloor))
1010 P_ChangeSwitchTexture(line,1);
1011 break;
1013 case 45:
1014 // Lower Floor to Surrounding floor height
1015 if (EV_DoFloor(line,lowerFloor))
1016 P_ChangeSwitchTexture(line,1);
1017 break;
1019 case 60:
1020 // Lower Floor to Lowest
1021 if (EV_DoFloor(line,lowerFloorToLowest))
1022 P_ChangeSwitchTexture(line,1);
1023 break;
1025 case 61:
1026 // Open Door
1027 if (EV_DoDoor(line,p_open))
1028 P_ChangeSwitchTexture(line,1);
1029 break;
1031 case 62:
1032 // PlatDownWaitUpStay
1033 if (EV_DoPlat(line,downWaitUpStay,1))
1034 P_ChangeSwitchTexture(line,1);
1035 break;
1037 case 63:
1038 // Raise Door
1039 if (EV_DoDoor(line,normal))
1040 P_ChangeSwitchTexture(line,1);
1041 break;
1043 case 64:
1044 // Raise Floor to ceiling
1045 if (EV_DoFloor(line,raiseFloor))
1046 P_ChangeSwitchTexture(line,1);
1047 break;
1049 case 66:
1050 // Raise Floor 24 and change texture
1051 if (EV_DoPlat(line,raiseAndChange,24))
1052 P_ChangeSwitchTexture(line,1);
1053 break;
1055 case 67:
1056 // Raise Floor 32 and change texture
1057 if (EV_DoPlat(line,raiseAndChange,32))
1058 P_ChangeSwitchTexture(line,1);
1059 break;
1061 case 65:
1062 // Raise Floor Crush
1063 if (EV_DoFloor(line,raiseFloorCrush))
1064 P_ChangeSwitchTexture(line,1);
1065 break;
1067 case 68:
1068 // Raise Plat to next highest floor and change texture
1069 if (EV_DoPlat(line,raiseToNearestAndChange,0))
1070 P_ChangeSwitchTexture(line,1);
1071 break;
1073 case 69:
1074 // Raise Floor to next highest floor
1075 if (EV_DoFloor(line, raiseFloorToNearest))
1076 P_ChangeSwitchTexture(line,1);
1077 break;
1079 case 70:
1080 // Turbo Lower Floor
1081 if (EV_DoFloor(line,turboLower))
1082 P_ChangeSwitchTexture(line,1);
1083 break;
1085 case 114:
1086 // Blazing Door Raise (faster than TURBO!)
1087 if (EV_DoDoor (line,blazeRaise))
1088 P_ChangeSwitchTexture(line,1);
1089 break;
1091 case 115:
1092 // Blazing Door Open (faster than TURBO!)
1093 if (EV_DoDoor (line,blazeOpen))
1094 P_ChangeSwitchTexture(line,1);
1095 break;
1097 case 116:
1098 // Blazing Door Close (faster than TURBO!)
1099 if (EV_DoDoor (line,blazeClose))
1100 P_ChangeSwitchTexture(line,1);
1101 break;
1103 case 123:
1104 // Blazing PlatDownWaitUpStay
1105 if (EV_DoPlat(line,blazeDWUS,0))
1106 P_ChangeSwitchTexture(line,1);
1107 break;
1109 case 132:
1110 // Raise Floor Turbo
1111 if (EV_DoFloor(line,raiseFloorTurbo))
1112 P_ChangeSwitchTexture(line,1);
1113 break;
1115 case 99:
1116 // BlzOpenDoor BLUE
1117 case 134:
1118 // BlzOpenDoor RED
1119 case 136:
1120 // BlzOpenDoor YELLOW
1121 if (EV_DoLockedDoor (line,blazeOpen,thing))
1122 P_ChangeSwitchTexture(line,1);
1123 break;
1125 case 138:
1126 // Light Turn On
1127 EV_LightTurnOn(line,255);
1128 P_ChangeSwitchTexture(line,1);
1129 break;
1131 case 139:
1132 // Light Turn Off
1133 EV_LightTurnOn(line,35);
1134 P_ChangeSwitchTexture(line,1);
1135 break;
1137 return true;