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
28 * Switches, buttons. Two-state animation. Exits.
30 *-----------------------------------------------------------------------------*/
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
];
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)
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
);
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
))
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
);
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.
117 // See if button is already pressed
118 for (i
= 0;i
< MAXBUTTONS
;i
++)
119 if (buttonlist
[i
].btimer
&& buttonlist
[i
].line
== line
)
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
;
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
146 void P_ChangeSwitchTexture
159 texTop
= sides
[line
->sidenum
[0]].toptexture
;
160 texMid
= sides
[line
->sidenum
[0]].midtexture
;
161 texBot
= sides
[line
->sidenum
[0]].bottomtexture
;
166 if (line
->special
== 11)
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
177 P_StartButton(line
,top
,switchlist
[i
],BUTTONTIME
); //start timer
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
189 P_StartButton(line
, middle
,switchlist
[i
],BUTTONTIME
); //start timer
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
201 P_StartButton(line
, bottom
,switchlist
[i
],BUTTONTIME
); //start timer
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
229 if (side
) //jff 6/1/98 fix inadvertent deletion of side test
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
)
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
)
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
)
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
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
)
278 return false; // monsters disallowed from unlocking doors
279 if (!P_CanUnlockGenDoor(line
,thing
->player
))
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
)
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
)
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
)
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
;
315 switch((line
->special
& TriggerType
) >> TriggerTypeShift
)
328 P_ChangeSwitchTexture(line
,0);
332 P_ChangeSwitchTexture(line
,1);
334 default: // if not a switch/push type, do nothing here
339 // Switches that other things can activate.
342 // never open secret doors
343 if (line
->flags
& ML_SECRET
)
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
355 case 210: // silent switch teleporters
365 if (!P_CheckTag(line
)) //jff 2/27/98 disallow zero tag on some types
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
);
387 // Switches (non-retriggerable)
390 if (EV_BuildStairs(line
,build8
))
391 P_ChangeSwitchTexture(line
,0);
396 if (EV_DoDonut(line
))
397 P_ChangeSwitchTexture(line
,0);
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
);
410 P_ChangeSwitchTexture(line
,0);
415 // Raise Floor 32 and change texture
416 if (EV_DoPlat(line
,raiseAndChange
,32))
417 P_ChangeSwitchTexture(line
,0);
421 // Raise Floor 24 and change texture
422 if (EV_DoPlat(line
,raiseAndChange
,24))
423 P_ChangeSwitchTexture(line
,0);
427 // Raise Floor to next highest floor
428 if (EV_DoFloor(line
, raiseFloorToNearest
))
429 P_ChangeSwitchTexture(line
,0);
433 // Raise Plat next highest floor and change texture
434 if (EV_DoPlat(line
,raiseToNearestAndChange
,0))
435 P_ChangeSwitchTexture(line
,0);
439 // PlatDownWaitUpStay
440 if (EV_DoPlat(line
,downWaitUpStay
,0))
441 P_ChangeSwitchTexture(line
,0);
445 // Lower Floor to Lowest
446 if (EV_DoFloor(line
,lowerFloorToLowest
))
447 P_ChangeSwitchTexture(line
,0);
452 if (EV_DoDoor(line
,normal
))
453 P_ChangeSwitchTexture(line
,0);
457 // Lower Ceiling to Floor
458 if (EV_DoCeiling(line
,lowerToFloor
))
459 P_ChangeSwitchTexture(line
,0);
464 if (EV_DoFloor(line
,turboLower
))
465 P_ChangeSwitchTexture(line
,0);
469 // Ceiling Crush And Raise
470 if (EV_DoCeiling(line
,crushAndRaise
))
471 P_ChangeSwitchTexture(line
,0);
476 if (EV_DoDoor(line
,p_close
))
477 P_ChangeSwitchTexture(line
,0);
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
);
490 P_ChangeSwitchTexture(line
,0);
491 G_SecretExitLevel ();
496 if (EV_DoFloor(line
,raiseFloorCrush
))
497 P_ChangeSwitchTexture(line
,0);
502 if (EV_DoFloor(line
,raiseFloor
))
503 P_ChangeSwitchTexture(line
,0);
507 // Lower Floor to Surrounding floor height
508 if (EV_DoFloor(line
,lowerFloor
))
509 P_ChangeSwitchTexture(line
,0);
514 if (EV_DoDoor(line
,p_open
))
515 P_ChangeSwitchTexture(line
,0);
519 // Blazing Door Raise (faster than TURBO!)
520 if (EV_DoDoor (line
,blazeRaise
))
521 P_ChangeSwitchTexture(line
,0);
525 // Blazing Door Open (faster than TURBO!)
526 if (EV_DoDoor (line
,blazeOpen
))
527 P_ChangeSwitchTexture(line
,0);
531 // Blazing Door Close (faster than TURBO!)
532 if (EV_DoDoor (line
,blazeClose
))
533 P_ChangeSwitchTexture(line
,0);
537 // Blazing PlatDownWaitUpStay
538 if (EV_DoPlat(line
,blazeDWUS
,0))
539 P_ChangeSwitchTexture(line
,0);
543 // Build Stairs Turbo 16
544 if (EV_BuildStairs(line
,turbo16
))
545 P_ChangeSwitchTexture(line
,0);
550 if (EV_DoFloor(line
,raiseFloorTurbo
))
551 P_ChangeSwitchTexture(line
,0);
559 // BlzOpenDoor YELLOW
560 if (EV_DoLockedDoor (line
,blazeOpen
,thing
))
561 P_ChangeSwitchTexture(line
,0);
566 if (EV_DoFloor(line
,raiseFloor512
))
567 P_ChangeSwitchTexture(line
,0);
570 // killough 1/31/98: factored out compatibility check;
571 // added inner switch, relaxed check to demo_compatibility
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
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);
588 // Raise Floor to shortest lower texture
589 // 159 S1 EV_DoFloor(lowerAndChange)
590 if (EV_DoFloor(line
,lowerAndChange
))
591 P_ChangeSwitchTexture(line
,0);
595 // Raise Floor 24 and change
596 // 160 S1 EV_DoFloor(raiseFloor24AndChange)
597 if (EV_DoFloor(line
,raiseFloor24AndChange
))
598 P_ChangeSwitchTexture(line
,0);
603 // 161 S1 EV_DoFloor(raiseFloor24)
604 if (EV_DoFloor(line
,raiseFloor24
))
605 P_ChangeSwitchTexture(line
,0);
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);
617 // 163 S1 EV_DoPlat(perpetualRaise,0)
619 P_ChangeSwitchTexture(line
,0);
623 // Start fast crusher
624 // 164 S1 EV_DoCeiling(fastCrushAndRaise)
625 if (EV_DoCeiling(line
,fastCrushAndRaise
))
626 P_ChangeSwitchTexture(line
,0);
630 // Start slow silent crusher
631 // 165 S1 EV_DoCeiling(silentCrushAndRaise)
632 if (EV_DoCeiling(line
,silentCrushAndRaise
))
633 P_ChangeSwitchTexture(line
,0);
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);
645 // Lower floor and Crush
646 // 167 S1 EV_DoCeiling(lowerAndCrush)
647 if (EV_DoCeiling(line
, lowerAndCrush
))
648 P_ChangeSwitchTexture(line
,0);
653 // 168 S1 EV_CeilingCrushStop()
654 if (EV_CeilingCrushStop(line
))
655 P_ChangeSwitchTexture(line
,0);
659 // Lights to brightest neighbor sector
660 // 169 S1 EV_LightTurnOn(0)
661 EV_LightTurnOn(line
,0);
662 P_ChangeSwitchTexture(line
,0);
666 // Lights to near dark
667 // 170 S1 EV_LightTurnOn(35)
668 EV_LightTurnOn(line
,35);
669 P_ChangeSwitchTexture(line
,0);
674 // 171 S1 EV_LightTurnOn(255)
675 EV_LightTurnOn(line
,255);
676 P_ChangeSwitchTexture(line
,0);
680 // Start Lights Strobing
681 // 172 S1 EV_StartLightStrobing()
682 EV_StartLightStrobing(line
);
683 P_ChangeSwitchTexture(line
,0);
687 // Lights to Dimmest Near
688 // 173 S1 EV_TurnTagLightsOff()
689 EV_TurnTagLightsOff(line
);
690 P_ChangeSwitchTexture(line
,0);
695 // 174 S1 EV_Teleport(side,thing)
696 if (EV_Teleport(line
,side
,thing
))
697 P_ChangeSwitchTexture(line
,0);
701 // Close Door, Open in 30 secs
702 // 175 S1 EV_DoDoor(close30ThenOpen)
703 if (EV_DoDoor(line
,close30ThenOpen
))
704 P_ChangeSwitchTexture(line
,0);
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);
715 // Lower ceiling to lowest surrounding ceiling
716 // 203 S1 EV_DoCeiling(lowerToLowest)
717 if (EV_DoCeiling(line
,lowerToLowest
))
718 P_ChangeSwitchTexture(line
,0);
722 // Lower ceiling to highest surrounding floor
723 // 204 S1 EV_DoCeiling(lowerToMaxFloor)
724 if (EV_DoCeiling(line
,lowerToMaxFloor
))
725 P_ChangeSwitchTexture(line
,0);
729 // killough 1/31/98: silent teleporter
730 //jff 209 S1 SilentTeleport
731 if (EV_SilentTeleport(line
, side
, thing
))
732 P_ChangeSwitchTexture(line
,0);
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);
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);
750 // Raise elevator next floor
751 // 229 S1 Raise Elevator next floor
752 if (EV_DoElevator(line
,elevateUp
))
753 P_ChangeSwitchTexture(line
,0);
757 // Lower elevator next floor
758 // 233 S1 Lower Elevator next floor
759 if (EV_DoElevator(line
,elevateDown
))
760 P_ChangeSwitchTexture(line
,0);
764 // Elevator to current floor
765 // 237 S1 Elevator to current floor
766 if (EV_DoElevator(line
,elevateCurrent
))
767 P_ChangeSwitchTexture(line
,0);
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);
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);
791 // Raise Floor to shortest lower texture
792 // 177 SR EV_DoFloor(lowerAndChange)
793 if (EV_DoFloor(line
,lowerAndChange
))
794 P_ChangeSwitchTexture(line
,1);
799 // 178 SR EV_DoFloor(raiseFloor512)
800 if (EV_DoFloor(line
,raiseFloor512
))
801 P_ChangeSwitchTexture(line
,1);
805 // Raise Floor 24 and change
806 // 179 SR EV_DoFloor(raiseFloor24AndChange)
807 if (EV_DoFloor(line
,raiseFloor24AndChange
))
808 P_ChangeSwitchTexture(line
,1);
813 // 180 SR EV_DoFloor(raiseFloor24)
814 if (EV_DoFloor(line
,raiseFloor24
))
815 P_ChangeSwitchTexture(line
,1);
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);
828 // 182 SR EV_DoPlat(perpetualRaise,0)
830 P_ChangeSwitchTexture(line
,1);
834 // Start fast crusher
835 // 183 SR EV_DoCeiling(fastCrushAndRaise)
836 if (EV_DoCeiling(line
,fastCrushAndRaise
))
837 P_ChangeSwitchTexture(line
,1);
841 // Start slow crusher
842 // 184 SR EV_DoCeiling(crushAndRaise)
843 if (EV_DoCeiling(line
,crushAndRaise
))
844 P_ChangeSwitchTexture(line
,1);
848 // Start slow silent crusher
849 // 185 SR EV_DoCeiling(silentCrushAndRaise)
850 if (EV_DoCeiling(line
,silentCrushAndRaise
))
851 P_ChangeSwitchTexture(line
,1);
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);
863 // Lower floor and Crush
864 // 187 SR EV_DoCeiling(lowerAndCrush)
865 if (EV_DoCeiling(line
, lowerAndCrush
))
866 P_ChangeSwitchTexture(line
,1);
871 // 188 SR EV_CeilingCrushStop()
872 if (EV_CeilingCrushStop(line
))
873 P_ChangeSwitchTexture(line
,1);
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);
884 // Lower Pillar, Raise Donut
885 // 191 SR EV_DoDonut()
886 if (EV_DoDonut(line
))
887 P_ChangeSwitchTexture(line
,1);
891 // Lights to brightest neighbor sector
892 // 192 SR EV_LightTurnOn(0)
893 EV_LightTurnOn(line
,0);
894 P_ChangeSwitchTexture(line
,1);
898 // Start Lights Strobing
899 // 193 SR EV_StartLightStrobing()
900 EV_StartLightStrobing(line
);
901 P_ChangeSwitchTexture(line
,1);
905 // Lights to Dimmest Near
906 // 194 SR EV_TurnTagLightsOff()
907 EV_TurnTagLightsOff(line
);
908 P_ChangeSwitchTexture(line
,1);
913 // 195 SR EV_Teleport(side,thing)
914 if (EV_Teleport(line
,side
,thing
))
915 P_ChangeSwitchTexture(line
,1);
919 // Close Door, Open in 30 secs
920 // 196 SR EV_DoDoor(close30ThenOpen)
921 if (EV_DoDoor(line
,close30ThenOpen
))
922 P_ChangeSwitchTexture(line
,1);
926 // Lower ceiling to lowest surrounding ceiling
927 // 205 SR EV_DoCeiling(lowerToLowest)
928 if (EV_DoCeiling(line
,lowerToLowest
))
929 P_ChangeSwitchTexture(line
,1);
933 // Lower ceiling to highest surrounding floor
934 // 206 SR EV_DoCeiling(lowerToMaxFloor)
935 if (EV_DoCeiling(line
,lowerToMaxFloor
))
936 P_ChangeSwitchTexture(line
,1);
940 // killough 1/31/98: silent teleporter
941 //jff 210 SR SilentTeleport
942 if (EV_SilentTeleport(line
, side
, thing
))
943 P_ChangeSwitchTexture(line
,1);
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);
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);
961 // Raise elevator next floor
962 // 230 SR Raise Elevator next floor
963 if (EV_DoElevator(line
,elevateUp
))
964 P_ChangeSwitchTexture(line
,1);
968 // Lower elevator next floor
969 // 234 SR Lower Elevator next floor
970 if (EV_DoElevator(line
,elevateDown
))
971 P_ChangeSwitchTexture(line
,1);
975 // Elevator to current floor
976 // 238 SR Elevator to current floor
977 if (EV_DoElevator(line
,elevateCurrent
))
978 P_ChangeSwitchTexture(line
,1);
982 // Build stairs, step 8
983 // 258 SR EV_BuildStairs(build8)
984 if (EV_BuildStairs(line
,build8
))
985 P_ChangeSwitchTexture(line
,1);
989 // Build stairs, step 16
990 // 259 SR EV_BuildStairs(turbo16)
991 if (EV_BuildStairs(line
,turbo16
))
992 P_ChangeSwitchTexture(line
,1);
995 // 1/29/98 jff end of added SR linedef types
1000 // Buttons (retriggerable switches)
1003 if (EV_DoDoor(line
,p_close
))
1004 P_ChangeSwitchTexture(line
,1);
1008 // Lower Ceiling to Floor
1009 if (EV_DoCeiling(line
,lowerToFloor
))
1010 P_ChangeSwitchTexture(line
,1);
1014 // Lower Floor to Surrounding floor height
1015 if (EV_DoFloor(line
,lowerFloor
))
1016 P_ChangeSwitchTexture(line
,1);
1020 // Lower Floor to Lowest
1021 if (EV_DoFloor(line
,lowerFloorToLowest
))
1022 P_ChangeSwitchTexture(line
,1);
1027 if (EV_DoDoor(line
,p_open
))
1028 P_ChangeSwitchTexture(line
,1);
1032 // PlatDownWaitUpStay
1033 if (EV_DoPlat(line
,downWaitUpStay
,1))
1034 P_ChangeSwitchTexture(line
,1);
1039 if (EV_DoDoor(line
,normal
))
1040 P_ChangeSwitchTexture(line
,1);
1044 // Raise Floor to ceiling
1045 if (EV_DoFloor(line
,raiseFloor
))
1046 P_ChangeSwitchTexture(line
,1);
1050 // Raise Floor 24 and change texture
1051 if (EV_DoPlat(line
,raiseAndChange
,24))
1052 P_ChangeSwitchTexture(line
,1);
1056 // Raise Floor 32 and change texture
1057 if (EV_DoPlat(line
,raiseAndChange
,32))
1058 P_ChangeSwitchTexture(line
,1);
1062 // Raise Floor Crush
1063 if (EV_DoFloor(line
,raiseFloorCrush
))
1064 P_ChangeSwitchTexture(line
,1);
1068 // Raise Plat to next highest floor and change texture
1069 if (EV_DoPlat(line
,raiseToNearestAndChange
,0))
1070 P_ChangeSwitchTexture(line
,1);
1074 // Raise Floor to next highest floor
1075 if (EV_DoFloor(line
, raiseFloorToNearest
))
1076 P_ChangeSwitchTexture(line
,1);
1080 // Turbo Lower Floor
1081 if (EV_DoFloor(line
,turboLower
))
1082 P_ChangeSwitchTexture(line
,1);
1086 // Blazing Door Raise (faster than TURBO!)
1087 if (EV_DoDoor (line
,blazeRaise
))
1088 P_ChangeSwitchTexture(line
,1);
1092 // Blazing Door Open (faster than TURBO!)
1093 if (EV_DoDoor (line
,blazeOpen
))
1094 P_ChangeSwitchTexture(line
,1);
1098 // Blazing Door Close (faster than TURBO!)
1099 if (EV_DoDoor (line
,blazeClose
))
1100 P_ChangeSwitchTexture(line
,1);
1104 // Blazing PlatDownWaitUpStay
1105 if (EV_DoPlat(line
,blazeDWUS
,0))
1106 P_ChangeSwitchTexture(line
,1);
1110 // Raise Floor Turbo
1111 if (EV_DoFloor(line
,raiseFloorTurbo
))
1112 P_ChangeSwitchTexture(line
,1);
1120 // BlzOpenDoor YELLOW
1121 if (EV_DoLockedDoor (line
,blazeOpen
,thing
))
1122 P_ChangeSwitchTexture(line
,1);
1127 EV_LightTurnOn(line
,255);
1128 P_ChangeSwitchTexture(line
,1);
1133 EV_LightTurnOn(line
,35);
1134 P_ChangeSwitchTexture(line
,1);