1 /**\file
2  *\section License
3  * License: GPL
4  * Online License Link: http://www.gnu.org/licenses/gpl.html
5  *
6  *\author Copyright © 2003-2017 Jaakko Keränen <jaakko.keranen@iki.fi>
7  *\author Copyright © 2005-2013 Daniel Swanson <danij@dengine.net>
8  *\author Copyright © 1993-1996 by id Software, Inc.
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin St, Fifth Floor,
23  * Boston, MA  02110-1301  USA
24  */
25 
26 /**
27  * p_spec.h: Implements special effects:
28  *
29  * Texture animation, height or lighting changes according to adjacent
30  * sectors, respective utility functions, etc.
31  *
32  * Line Tag handling. Line and Sector triggers.
33  *
34  * Events are operations triggered by using, crossing, or shooting
35  * special lines, or by timed thinkers.
36  */
37 
38 #ifndef __P_SPEC_H__
39 #define __P_SPEC_H__
40 
41 #ifndef __JHERETIC__
42 #  error "Using jHeretic headers without __JHERETIC__"
43 #endif
44 
45 #include "h_player.h"
46 #include "r_data.h"
47 
48 #define MO_TELEPORTMAN          14
49 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
54 // at game start
55 void            P_InitLava(void);
56 
57 // at map load
58 void P_SpawnSectorSpecialThinkers(void);
59 void P_SpawnLineSpecialThinkers(void);
60 void P_SpawnAllSpecialThinkers(void);
61 
62 void P_InitAmbientSound(void);
63 
64 void P_DefineAmbientSfx(int sequence, const int *seq, size_t count);
65 
66 /**
67  * Called by spawnMapThing during @ref P_SetupMap()
68  */
69 void P_AddAmbientSfx(int sequence);
70 
71 /**
72  * Called every tic by (P_tick):P_Ticker.
73  */
74 void P_AmbientSound(void);
75 
76 dd_bool         P_ActivateLine(Line* ld, mobj_t* mo, int side,
77                                int activationType);
78 
79 void            P_PlayerInSpecialSector(player_t* player);
80 
81 void            P_PlayerInWindSector(player_t* player);
82 
83 int             EV_DoDonut(Line* line);
84 
85 typedef enum {
86     ok,
87     crushed,
88     pastdest
89 } result_e;
90 
91 typedef enum {
92     build8, // Slowly build by 8.
93     build16 // Slowly build by 16.
94 } stair_e;
95 
96 result_e        T_MovePlane(Sector* sector, float speed, coord_t dest,
97                             int crush, int floorOrCeiling, int direction);
98 
99 int             EV_BuildStairs(Line* line, stair_e type);
100 
101 dd_bool         P_UseSpecialLine2(mobj_t* mo, Line* line, int side);
102 
103 #ifdef __cplusplus
104 } // extern "C"
105 #endif
106 
107 #endif
108