Odamex
Setting the Standard in Multiplayer Doom
common/p_spec.h
Go to the documentation of this file.
00001 // Emacs style mode select   -*- C++ -*- 
00002 //-----------------------------------------------------------------------------
00003 //
00004 // $Id: p_spec.h 2121 2011-02-23 23:22:58Z russellrice $
00005 //
00006 // Copyright (C) 1993-1996 by id Software, Inc.
00007 // Copyright (C) 2006-2010 by The Odamex Team.
00008 //
00009 // This program is free software; you can redistribute it and/or
00010 // modify it under the terms of the GNU General Public License
00011 // as published by the Free Software Foundation; either version 2
00012 // of the License, or (at your option) any later version.
00013 //
00014 // This program is distributed in the hope that it will be useful,
00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 // GNU General Public License for more details.
00018 //
00019 // DESCRIPTION:  none
00020 //      Implements special effects:
00021 //      Texture animation, height or lighting changes
00022 //       according to adjacent sectors, respective
00023 //       utility functions, etc.
00024 //
00025 //-----------------------------------------------------------------------------
00026 
00027 
00028 #ifndef __P_SPEC__
00029 #define __P_SPEC__
00030 
00031 #include "dsectoreffect.h"
00032 
00033 //jff 2/23/98 identify the special classes that can share sectors
00034 
00035 typedef enum
00036 {
00037         floor_special,
00038         ceiling_special,
00039         lighting_special
00040 } special_e;
00041 
00042 // killough 3/7/98: Add generalized scroll effects
00043 
00044 class DScroller : public DThinker
00045 {
00046         DECLARE_SERIAL (DScroller, DThinker)
00047 public:
00048         enum EScrollType
00049         {
00050                 sc_side,
00051                 sc_floor,
00052                 sc_ceiling,
00053                 sc_carry,
00054                 sc_carry_ceiling        // killough 4/11/98: carry objects hanging on ceilings
00055 
00056         };
00057         
00058         DScroller (EScrollType type, fixed_t dx, fixed_t dy, int control, int affectee, int accel);
00059         DScroller (fixed_t dx, fixed_t dy, const line_t *l, int control, int accel);
00060 
00061         void RunThink ();
00062 
00063         bool AffectsWall (int wallnum) { return m_Type == sc_side && m_Affectee == wallnum; }
00064         int GetWallNum () { return m_Type == sc_side ? m_Affectee : -1; }
00065         void SetRate (fixed_t dx, fixed_t dy) { m_dx = dx; m_dy = dy; }
00066 
00067 protected:
00068         EScrollType m_Type;             // Type of scroll effect
00069         fixed_t m_dx, m_dy;             // (dx,dy) scroll speeds
00070         int m_Affectee;                 // Number of affected sidedef, sector, tag, or whatever
00071         int m_Control;                  // Control sector (-1 if none) used to control scrolling
00072         fixed_t m_LastHeight;           // Last known height of control sector
00073         fixed_t m_vdx, m_vdy;           // Accumulated velocity if accelerative
00074         int m_Accel;                    // Whether it's accelerative
00075 
00076 private:
00077         DScroller ();
00078 };
00079 
00080 inline FArchive &operator<< (FArchive &arc, DScroller::EScrollType type)
00081 {
00082         return arc << (BYTE)type;
00083 }
00084 inline FArchive &operator>> (FArchive &arc, DScroller::EScrollType &out)
00085 {
00086         BYTE in; arc >> in; out = (DScroller::EScrollType)in; return arc;
00087 }
00088 
00089 // phares 3/20/98: added new model of Pushers for push/pull effects
00090 
00091 class DPusher : public DThinker
00092 {
00093         DECLARE_SERIAL (DPusher, DThinker)
00094 public:
00095         enum EPusher
00096         {
00097                 p_push,
00098                 p_pull,
00099                 p_wind,
00100                 p_current
00101         };
00102 
00103         DPusher ();
00104         DPusher (EPusher type, line_t *l, int magnitude, int angle, AActor *source, int affectee);
00105         int CheckForSectorMatch (EPusher type, int tag)
00106         {
00107                 if (m_Type == type && sectors[m_Affectee].tag == tag)
00108                         return m_Affectee;
00109                 else
00110                         return -1;
00111         }
00112         void ChangeValues (int magnitude, int angle)
00113         {
00114                 angle_t ang = (angle<<24) >> ANGLETOFINESHIFT;
00115                 m_Xmag = (magnitude * finecosine[ang]) >> FRACBITS;
00116                 m_Ymag = (magnitude * finesine[ang]) >> FRACBITS;
00117                 m_Magnitude = magnitude;
00118         }
00119 
00120         virtual void RunThink ();
00121 
00122 protected:
00123         EPusher m_Type;
00124         AActor::AActorPtr m_Source;             // Point source if point pusher
00125         int m_Xmag;                             // X Strength
00126         int m_Ymag;                             // Y Strength
00127         int m_Magnitude;                // Vector strength for point pusher
00128         int m_Radius;                   // Effective radius for point pusher
00129         int m_X;                                // X of point source if point pusher
00130         int m_Y;                                // Y of point source if point pusher
00131         int m_Affectee;                 // Number of affected sector
00132 
00133         friend BOOL PIT_PushThing (AActor *thing);
00134 };
00135 
00136 inline FArchive &operator<< (FArchive &arc, DPusher::EPusher type)
00137 {
00138         return arc << (BYTE)type;
00139 }
00140 inline FArchive &operator>> (FArchive &arc, DPusher::EPusher &out)
00141 {
00142         BYTE in; arc >> in; out = (DPusher::EPusher)in; return arc;
00143 }
00144 
00145 BOOL P_CheckKeys (player_t *p, card_t lock, BOOL remote);
00146 
00147 // Define values for map objects
00148 #define MO_TELEPORTMAN                  14
00149 
00150 
00151 // [RH] If a deathmatch game, checks to see if noexit is enabled.
00152 //              If so, it kills the player and returns false. Otherwise,
00153 //              it returns true, and the player is allowed to live.
00154 BOOL    CheckIfExitIsGood (AActor *self);
00155 
00156 // at game start
00157 void    P_InitPicAnims (void);
00158 
00159 // at map load
00160 void    P_SpawnSpecials (void);
00161 
00162 // every tic
00163 void    P_UpdateSpecials (void);
00164 
00165 // when needed
00166 void    P_CrossSpecialLine (int linenum, int side, AActor*      thing, bool FromServer = false);
00167 void    P_ShootSpecialLine (AActor* thing, line_t*      line, bool FromServer = false);
00168 bool    P_UseSpecialLine (AActor* thing, line_t* line, int      side, bool FromServer = false);
00169 bool    P_PushSpecialLine (AActor* thing, line_t* line, int     side, bool FromServer = false);
00170 
00171 void    P_PlayerInSpecialSector (player_t *player);
00172 
00173 //
00174 // getSide()
00175 // Will return a side_t*
00176 //      given the number of the current sector,
00177 //      the line number, and the side (0/1) that you want.
00178 //
00179 inline side_t *getSide (int currentSector, int line, int side)
00180 {
00181         return &sides[ (sectors[currentSector].lines[line])->sidenum[side] ];
00182 }
00183 
00184 //
00185 // getSector()
00186 // Will return a sector_t*
00187 //      given the number of the current sector,
00188 //      the line number and the side (0/1) that you want.
00189 //
00190 inline sector_t *getSector (int currentSector, int line, int side)
00191 {
00192         return sides[ (sectors[currentSector].lines[line])->sidenum[side] ].sector;
00193 }
00194 
00195 
00196 //
00197 // twoSided()
00198 // Given the sector number and the line number,
00199 //      it will tell you whether the line is two-sided or not.
00200 //
00201 inline int twoSided (int sector, int line)
00202 {
00203         return (sectors[sector].lines[line])->flags & ML_TWOSIDED;
00204 }
00205 
00206 //
00207 // getNextSector()
00208 // Return sector_t * of sector next to current.
00209 // NULL if not two-sided line
00210 //
00211 inline sector_t *getNextSector (line_t *line, sector_t *sec)
00212 {
00213         if (!(line->flags & ML_TWOSIDED))
00214                 return NULL;
00215         
00216         return (line->frontsector == sec) ? line->backsector : line->frontsector;
00217                 
00218         return line->frontsector;
00219 }
00220 
00221 
00222 fixed_t P_FindLowestFloorSurrounding (sector_t *sec);
00223 fixed_t P_FindHighestFloorSurrounding (sector_t *sec);
00224 
00225 fixed_t P_FindNextHighestFloor (sector_t *sec, int currentheight);
00226 fixed_t P_FindNextLowestFloor (sector_t* sec, int currentheight);
00227 
00228 fixed_t P_FindLowestCeilingSurrounding (sector_t *sec);         // jff 2/04/98
00229 fixed_t P_FindHighestCeilingSurrounding (sector_t *sec);        // jff 2/04/98
00230 
00231 fixed_t P_FindNextLowestCeiling (sector_t *sec, int currentheight);             // jff 2/04/98
00232 fixed_t P_FindNextHighestCeiling (sector_t *sec, int currentheight);    // jff 2/04/98
00233 
00234 fixed_t P_FindShortestTextureAround (int secnum);       // jff 2/04/98
00235 fixed_t P_FindShortestUpperAround (int secnum);         // jff 2/04/98
00236 
00237 sector_t* P_FindModelFloorSector (fixed_t floordestheight, int secnum); //jff 02/04/98
00238 sector_t* P_FindModelCeilingSector (fixed_t ceildestheight, int secnum);        //jff 02/04/98 
00239 
00240 int             P_FindSectorFromTag (int tag, int start);
00241 int             P_FindLineFromID (int id, int start);
00242 
00243 int             P_FindMinSurroundingLight (sector_t *sector, int max);
00244 
00245 sector_t *P_NextSpecialSector (sector_t *sec, int type, sector_t *back2);       // [RH]
00246 
00247 
00248 
00249 //
00250 // P_LIGHTS
00251 //
00252 
00253 class DLighting : public DSectorEffect
00254 {
00255         DECLARE_SERIAL (DLighting, DSectorEffect);
00256 public:
00257         DLighting (sector_t *sector);
00258 protected:
00259         DLighting ();
00260 };
00261 
00262 class DFireFlicker : public DLighting
00263 {
00264         DECLARE_SERIAL (DFireFlicker, DLighting)
00265 public:
00266         DFireFlicker (sector_t *sector);
00267         DFireFlicker (sector_t *sector, int upper, int lower);
00268         void            RunThink ();
00269 protected:
00270         int             m_Count;
00271         int             m_MaxLight;
00272         int             m_MinLight;
00273 private:
00274         DFireFlicker ();
00275 };
00276 
00277 class DFlicker : public DLighting
00278 {
00279         DECLARE_SERIAL (DFlicker, DLighting)
00280 public:
00281         DFlicker (sector_t *sector, int upper, int lower);
00282         void            RunThink ();
00283 protected:
00284         int             m_Count;
00285         int             m_MaxLight;
00286         int             m_MinLight;
00287 private:
00288         DFlicker ();
00289 };
00290 
00291 class DLightFlash : public DLighting
00292 {
00293         DECLARE_SERIAL (DLightFlash, DLighting)
00294 public:
00295         DLightFlash (sector_t *sector);
00296         DLightFlash (sector_t *sector, int min, int max);
00297         void            RunThink ();
00298 protected:
00299         int             m_Count;
00300         int             m_MaxLight;
00301         int             m_MinLight;
00302         int             m_MaxTime;
00303         int             m_MinTime;
00304 private:
00305         DLightFlash ();
00306 };
00307 
00308 class DStrobe : public DLighting
00309 {
00310         DECLARE_SERIAL (DStrobe, DLighting)
00311 public:
00312         DStrobe (sector_t *sector, int utics, int ltics, bool inSync);
00313         DStrobe (sector_t *sector, int upper, int lower, int utics, int ltics);
00314         void            RunThink ();
00315 protected:
00316         int             m_Count;
00317         int             m_MinLight;
00318         int             m_MaxLight;
00319         int             m_DarkTime;
00320         int             m_BrightTime;
00321 private:
00322         DStrobe ();
00323 };
00324 
00325 class DGlow : public DLighting
00326 {
00327         DECLARE_SERIAL (DGlow, DLighting)
00328 public:
00329         DGlow (sector_t *sector);
00330         void            RunThink ();
00331 protected:
00332         int             m_MinLight;
00333         int             m_MaxLight;
00334         int             m_Direction;
00335 private:
00336         DGlow ();
00337 };
00338 
00339 // [RH] Glow from Light_Glow and Light_Fade specials
00340 class DGlow2 : public DLighting
00341 {
00342         DECLARE_SERIAL (DGlow2, DLighting)
00343 public:
00344         DGlow2 (sector_t *sector, int start, int end, int tics, bool oneshot);
00345         void            RunThink ();
00346 protected:
00347         int                     m_Start;
00348         int                     m_End;
00349         int                     m_MaxTics;
00350         int                     m_Tics;
00351         bool            m_OneShot;
00352 private:
00353         DGlow2 ();
00354 };
00355 
00356 // [RH] Phased light thinker
00357 class DPhased : public DLighting
00358 {
00359         DECLARE_SERIAL (DPhased, DLighting)
00360 public:
00361         DPhased (sector_t *sector);
00362         DPhased (sector_t *sector, int baselevel, int phase);
00363         void            RunThink ();
00364 protected:
00365         byte            m_BaseLevel;
00366         byte            m_Phase;
00367 private:
00368         DPhased ();
00369         DPhased (sector_t *sector, int baselevel);
00370         int PhaseHelper (sector_t *sector, int index, int light, sector_t *prev);
00371 };
00372 
00373 #define GLOWSPEED                               8
00374 #define STROBEBRIGHT                    5
00375 #define FASTDARK                                15
00376 #define SLOWDARK                                TICRATE
00377 
00378 void    EV_StartLightFlickering (int tag, int upper, int lower);
00379 void    EV_StartLightStrobing (int tag, int upper, int lower, int utics, int ltics);
00380 void    EV_StartLightStrobing (int tag, int utics, int ltics);
00381 void    EV_TurnTagLightsOff (int tag);
00382 void    EV_LightTurnOn (int tag, int bright);
00383 void    EV_LightChange (int tag, int value);
00384 int     EV_LightTurnOnPartway(int tag, int level);
00385 
00386 void    P_SpawnGlowingLight (sector_t *sector);
00387 
00388 void    EV_StartLightGlowing (int tag, int upper, int lower, int tics);
00389 void    EV_StartLightFading (int tag, int value, int tics);
00390 
00391 
00392 //
00393 // P_SWITCH
00394 //
00395 typedef struct
00396 {
00397         char            name1[9];
00398         char            name2[9];
00399         short           episode;
00400         
00401 } switchlist_t;
00402 
00403 
00404 // 1 second, in ticks. 
00405 #define BUTTONTIME              TICRATE
00406 
00407 void    P_ChangeSwitchTexture (line_t *line, int useAgain);
00408 
00409 void    P_InitSwitchList ();
00410 
00411 bool    P_GetButtonInfo (line_t *line, unsigned &state, unsigned &time);
00412 bool    P_SetButtonInfo (line_t *line, unsigned state, unsigned time);
00413 
00414 
00415 //
00416 // P_PLATS
00417 //
00418 class DPlat : public DMovingFloor
00419 {
00420         DECLARE_SERIAL (DPlat, DMovingFloor);
00421 public:
00422         enum EPlatState
00423         {
00424                 up,
00425                 down,
00426                 waiting,
00427                 in_stasis
00428         };
00429 
00430         enum EPlatType
00431         {
00432                 platPerpetualRaise,
00433                 platDownWaitUpStay,
00434                 platUpWaitDownStay,
00435                 platDownByValue,
00436                 platUpByValue,
00437                 platUpByValueStay,
00438                 platRaiseAndStay,
00439                 platToggle,
00440                 platDownToNearestFloor,
00441                 platDownToLowestCeiling
00442         };
00443 
00444         void RunThink ();
00445 
00446         void SetState(byte state, int count) { m_Status = (EPlatState)state; m_Count = count; }
00447         void GetState(byte &state, int &count) { state = (byte)m_Status; count = m_Count; }
00448 
00449         DPlat (sector_t *sector);
00450 
00451         fixed_t         m_Speed;
00452         fixed_t         m_Low;
00453         fixed_t         m_High;
00454         int             m_Wait;
00455         int             m_Count;
00456         EPlatState      m_Status;
00457         EPlatState      m_OldStatus;
00458         bool            m_Crush;
00459         int             m_Tag;
00460         EPlatType       m_Type;
00461         bool            m_PostWait;
00462 protected:
00463 
00464         void PlayPlatSound (const char *sound);
00465         void Reactivate ();
00466         void Stop ();
00467 
00468 private:
00469         DPlat ();
00470 
00471         friend BOOL     EV_DoPlat (int tag, line_t *line, EPlatType type,
00472                                                    int height, int speed, int delay, int lip, int change);
00473         friend void EV_StopPlat (int tag);
00474         friend void P_ActivateInStasis (int tag);
00475 };
00476 
00477 inline FArchive &operator<< (FArchive &arc, DPlat::EPlatType type)
00478 {
00479         return arc << (BYTE)type;
00480 }
00481 inline FArchive &operator>> (FArchive &arc, DPlat::EPlatType &out)
00482 {
00483         BYTE in; arc >> in; out = (DPlat::EPlatType)in; return arc;
00484 }
00485 inline FArchive &operator<< (FArchive &arc, DPlat::EPlatState state)
00486 {
00487         return arc << (BYTE)state;
00488 }
00489 inline FArchive &operator>> (FArchive &arc, DPlat::EPlatState &out)
00490 {
00491         BYTE in; arc >> in; out = (DPlat::EPlatState)in; return arc;
00492 }
00493 
00494 //
00495 // [RH]
00496 // P_PILLAR
00497 //
00498 
00499 class DPillar : public DMover
00500 {
00501         DECLARE_SERIAL (DPillar, DMover)
00502 public:
00503         enum EPillar
00504         {
00505                 pillarBuild,
00506                 pillarOpen
00507 
00508         };
00509 
00510         DPillar ();
00511 
00512         DPillar (sector_t *sector, EPillar type, fixed_t speed, fixed_t height,
00513                          fixed_t height2, bool crush);
00514 
00515         void RunThink ();
00516 
00517         EPillar         m_Type;
00518         fixed_t         m_FloorSpeed;
00519         fixed_t         m_CeilingSpeed;
00520         fixed_t         m_FloorTarget;
00521         fixed_t         m_CeilingTarget;
00522         bool            m_Crush;
00523 
00524 };
00525 
00526 inline FArchive &operator<< (FArchive &arc, DPillar::EPillar type)
00527 {
00528         return arc << (BYTE)type;
00529 }
00530 inline FArchive &operator>> (FArchive &arc, DPillar::EPillar &out)
00531 {
00532         BYTE in; arc >> in; out = (DPillar::EPillar)in; return arc;
00533 }
00534 
00535 BOOL EV_DoPillar (DPillar::EPillar type, int tag, fixed_t speed, fixed_t height,
00536                                   fixed_t height2, bool crush);
00537 void P_SpawnDoorCloseIn30 (sector_t *sec);
00538 void P_SpawnDoorRaiseIn5Mins (sector_t *sec);
00539 
00540 //
00541 // P_DOORS
00542 //
00543 class DDoor : public DMovingCeiling
00544 {
00545         DECLARE_SERIAL (DDoor, DMovingCeiling)
00546 public:
00547         enum EVlDoor
00548         {
00549                 doorClose,
00550                 doorOpen,
00551                 doorRaise,
00552                 doorRaiseIn5Mins,
00553                 doorCloseWaitOpen
00554         };
00555 
00556         DDoor (sector_t *sector);
00557         // DDoor (sector_t *sec, EVlDoor type, fixed_t speed, int delay);
00558     DDoor (sector_t *sec, line_t *ln, EVlDoor type, fixed_t speed, int delay);
00559 
00560         void RunThink ();
00561 
00562         EVlDoor         m_Type;
00563         fixed_t         m_TopHeight;
00564         fixed_t         m_Speed;
00565 
00566         // 1 = up, 0 = waiting at top, -1 = down
00567         int             m_Direction;
00568         
00569         // tics to wait at the top
00570         int             m_TopWait;
00571         // (keep in case a door going down is reset)
00572         // when it reaches 0, start going down
00573         int             m_TopCountdown;
00574 
00575     line_t      *m_Line;
00576 protected:
00577         void DoorSound (bool raise) const;
00578 
00579         friend BOOL     EV_DoDoor (DDoor::EVlDoor type, line_t *line, AActor *thing,
00580                                    int tag, int speed, int delay, card_t lock);
00581         friend void P_SpawnDoorCloseIn30 (sector_t *sec);
00582         friend void P_SpawnDoorRaiseIn5Mins (sector_t *sec);
00583 private:
00584         DDoor ();
00585 
00586 };
00587 
00588 inline FArchive &operator<< (FArchive &arc, DDoor::EVlDoor type)
00589 {
00590         return arc << (BYTE)type;
00591 }
00592 inline FArchive &operator>> (FArchive &arc, DDoor::EVlDoor &out)
00593 {
00594         BYTE in; arc >> in; out = (DDoor::EVlDoor)in; return arc;
00595 }
00596 
00597 
00598 //
00599 // P_CEILNG
00600 //
00601 
00602 // [RH] Changed these
00603 class DCeiling : public DMovingCeiling
00604 {
00605         DECLARE_SERIAL (DCeiling, DMovingCeiling)
00606 public:
00607         enum ECeiling
00608         {
00609                 ceilLowerByValue,
00610                 ceilRaiseByValue,
00611                 ceilMoveToValue,
00612                 ceilLowerToHighestFloor,
00613                 ceilLowerInstant,
00614                 ceilRaiseInstant,
00615                 ceilCrushAndRaise,
00616                 ceilLowerAndCrush,
00617                 ceilCrushRaiseAndStay,
00618                 ceilRaiseToNearest,
00619                 ceilLowerToLowest,
00620                 ceilLowerToFloor,
00621 
00622                 // The following are only used by Generic_Ceiling
00623                 ceilRaiseToHighest,
00624                 ceilLowerToHighest,
00625                 ceilRaiseToLowest,
00626                 ceilLowerToNearest,
00627                 ceilRaiseToHighestFloor,
00628                 ceilRaiseToFloor,
00629                 ceilRaiseByTexture,
00630                 ceilLowerByTexture,
00631 
00632                 genCeilingChg0,
00633                 genCeilingChgT,
00634                 genCeilingChg
00635         };
00636 
00637         DCeiling (sector_t *sec);
00638         DCeiling (sector_t *sec, fixed_t speed1, fixed_t speed2, int silent);
00639 
00640         void RunThink ();
00641 
00642         ECeiling        m_Type;
00643         fixed_t         m_BottomHeight;
00644         fixed_t         m_TopHeight;
00645         fixed_t         m_Speed;
00646         fixed_t         m_Speed1;               // [RH] dnspeed of crushers
00647         fixed_t         m_Speed2;               // [RH] upspeed of crushers
00648         bool            m_Crush;
00649         int                     m_Silent;
00650         int             m_Direction;    // 1 = up, 0 = waiting, -1 = down
00651 
00652         // [RH] Need these for BOOM-ish transferring ceilings
00653         int                     m_Texture;
00654         int                     m_NewSpecial;
00655 
00656         // ID
00657         int             m_Tag;
00658         int             m_OldDirection;
00659 protected:
00660 
00661         void PlayCeilingSound ();
00662 
00663 private:
00664         DCeiling ();
00665 
00666         friend BOOL EV_DoCeiling (DCeiling::ECeiling type, line_t *line,
00667                 int tag, fixed_t speed, fixed_t speed2, fixed_t height,
00668                 bool crush, int silent, int change);
00669         friend BOOL EV_CeilingCrushStop (int tag);
00670         friend void P_ActivateInStasisCeiling (int tag);
00671 };
00672 
00673 inline FArchive &operator<< (FArchive &arc, DCeiling::ECeiling type)
00674 {
00675         return arc << (BYTE)type;
00676 }
00677 inline FArchive &operator>> (FArchive &arc, DCeiling::ECeiling &type)
00678 {
00679         BYTE in; arc >> in; type = (DCeiling::ECeiling)in; return arc;
00680 }
00681 
00682 
00683 //
00684 // P_FLOOR
00685 //
00686 
00687 class DFloor : public DMovingFloor
00688 {
00689         DECLARE_SERIAL (DFloor, DMovingFloor)
00690 public:
00691         enum EFloor
00692         {
00693                 floorLowerToLowest,
00694                 floorLowerToNearest,
00695                 floorLowerToHighest,
00696                 floorLowerByValue,
00697                 floorRaiseByValue,
00698                 floorRaiseToHighest,
00699                 floorRaiseToNearest,
00700                 floorRaiseAndCrush,
00701                 floorCrushStop,
00702                 floorLowerInstant,
00703                 floorRaiseInstant,
00704                 floorMoveToValue,
00705                 floorRaiseToLowestCeiling,
00706                 floorRaiseByTexture,
00707 
00708                 floorLowerAndChange,
00709                 floorRaiseAndChange,
00710 
00711                 floorRaiseToLowest,
00712                 floorRaiseToCeiling,
00713                 floorLowerToLowestCeiling,
00714                 floorLowerByTexture,
00715                 floorLowerToCeiling,
00716                  
00717                 donutRaise,
00718 
00719                 buildStair,
00720                 waitStair,
00721                 resetStair,
00722 
00723                 // Not to be used as parameters to EV_DoFloor()
00724                 genFloorChg0,
00725                 genFloorChgT,
00726                 genFloorChg
00727         };
00728 
00729         // [RH] Changed to use Hexen-ish specials
00730         enum EStair
00731         {
00732                 buildUp,
00733                 buildDown
00734         };
00735 
00736         DFloor (sector_t *sec);
00737 
00738         void RunThink ();
00739 
00740         EFloor          m_Type;
00741         bool            m_Crush;
00742         int             m_Direction;
00743         short           m_NewSpecial;
00744         short           m_Texture;
00745         fixed_t         m_FloorDestHeight;
00746         fixed_t         m_Speed;
00747 
00748         // [RH] New parameters used to reset and delay stairs
00749         int                     m_ResetCount;
00750         int                     m_OrgHeight;
00751         int                     m_Delay;
00752         int                     m_PauseTime;
00753         int                     m_StepTime;
00754         int                     m_PerStepTime;
00755 
00756 protected:
00757 
00758         void StartFloorSound ();
00759 
00760         friend BOOL EV_BuildStairs (int tag, DFloor::EStair type, line_t *line,
00761                 fixed_t stairsize, fixed_t speed, int delay, int reset, int igntxt,
00762                 int usespecials);
00763         friend BOOL EV_DoFloor (DFloor::EFloor floortype, line_t *line, int tag,
00764                 fixed_t speed, fixed_t height, bool crush, int change);
00765         friend int EV_DoDonut (int tag, fixed_t pillarspeed, fixed_t slimespeed);
00766 private:
00767         DFloor ();
00768 };
00769 
00770 inline FArchive &operator<< (FArchive &arc, DFloor::EFloor type)
00771 {
00772         return arc << (BYTE)type;
00773 }
00774 inline FArchive &operator>> (FArchive &arc, DFloor::EFloor &type)
00775 {
00776         BYTE in; arc >> in; type = (DFloor::EFloor)in; return arc;
00777 }
00778 
00779 class DElevator : public DMover
00780 {
00781         DECLARE_SERIAL (DElevator, DMover)
00782 public:
00783         enum EElevator
00784         {
00785                 elevateUp,
00786                 elevateDown,
00787                 elevateCurrent,
00788                 // [RH] For FloorAndCeiling_Raise/Lower
00789                 elevateRaise,
00790                 elevateLower
00791         };
00792 
00793         DElevator (sector_t *sec);
00794 
00795         void RunThink ();
00796 
00797         EElevator       m_Type;
00798         int                     m_Direction;
00799         fixed_t         m_FloorDestHeight;
00800         fixed_t         m_CeilingDestHeight;
00801         fixed_t         m_Speed;
00802 
00803 protected:
00804         void StartFloorSound ();
00805 
00806         friend BOOL EV_DoElevator (line_t *line, DElevator::EElevator type, fixed_t speed,
00807                 fixed_t height, int tag);
00808 private:
00809         DElevator ();
00810 };
00811 
00812 inline FArchive &operator<< (FArchive &arc, DElevator::EElevator type)
00813 {
00814         return arc << (BYTE)type;
00815 }
00816 inline FArchive &operator>> (FArchive &arc, DElevator::EElevator &out)
00817 {
00818         BYTE in; arc >> in; out = (DElevator::EElevator)in; return arc;
00819 }
00820 
00821 //jff 3/15/98 pure texture/type change for better generalized support
00822 enum EChange
00823 {
00824         trigChangeOnly,
00825         numChangeOnly
00826 };
00827 
00828 BOOL EV_DoChange (line_t *line, EChange changetype, int tag);
00829 
00830 
00831 
00832 //
00833 // P_TELEPT
00834 //
00835 BOOL EV_Teleport (int tid, int side, AActor *thing);
00836 BOOL EV_SilentTeleport (int tid, line_t *line, int side, AActor *thing);
00837 BOOL EV_SilentLineTeleport (line_t *line, int side, AActor *thing, int id,
00838                                                         BOOL reverse);
00839 
00840 //
00841 // [RH] ACS (see also p_acs.h)
00842 //
00843 
00844 BOOL P_StartScript (AActor *who, line_t *where, int script, char *map, int lineSide,
00845                                         int arg0, int arg1, int arg2, int always);
00846 void P_SuspendScript (int script, char *map);
00847 void P_TerminateScript (int script, char *map);
00848 void P_StartOpenScripts (void);
00849 void P_DoDeferedScripts (void);
00850 
00851 
00852 //
00853 // [RH] p_quake.c
00854 //
00855 BOOL P_StartQuake (int tid, int intensity, int duration, int damrad, int tremrad);
00856 
00857 #endif
00858 
00859 
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends