1 /*
2 ** p_lnspec.h
3 ** New line and sector specials (Using Hexen as a base.)
4 **
5 **---------------------------------------------------------------------------
6 ** Copyright 1998-2006 Randy Heit
7 ** All rights reserved.
8 **
9 ** Redistribution and use in source and binary forms, with or without
10 ** modification, are permitted provided that the following conditions
11 ** are met:
12 **
13 ** 1. Redistributions of source code must retain the above copyright
14 ** notice, this list of conditions and the following disclaimer.
15 ** 2. Redistributions in binary form must reproduce the above copyright
16 ** notice, this list of conditions and the following disclaimer in the
17 ** documentation and/or other materials provided with the distribution.
18 ** 3. The name of the author may not be used to endorse or promote products
19 ** derived from this software without specific prior written permission.
20 **
21 ** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 ** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 **---------------------------------------------------------------------------
32 **
33 */
34
35 #ifndef __P_LNSPEC_H__
36 #define __P_LNSPEC_H__
37
38 #include "doomtype.h"
39
40 #define DEFINE_SPECIAL(name, num, min, max, map) name = num,
41
42 typedef enum {
43 #include "actionspecials.h"
44 } linespecial_t;
45
46 struct FLineSpecial
47 {
48 const char *name;
49 BYTE number;
50 SBYTE min_args;
51 SBYTE max_args;
52 BYTE map_args;
53 };
54
55 extern const FLineSpecial *LineSpecialsInfo[256];
56
57 typedef enum {
58 Init_Gravity = 0,
59 Init_Color = 1,
60 Init_Damage = 2,
61 Init_SectorLink = 3,
62 NUM_STATIC_INITS,
63 Init_TransferSky = 255
64 } staticinit_t;
65
66 typedef enum {
67 Light_Phased = 1,
68 LightSequenceStart = 2,
69 LightSequenceSpecial1 = 3,
70 LightSequenceSpecial2 = 4,
71
72 Stairs_Special1 = 26,
73 Stairs_Special2 = 27,
74
75 Wind_East_Weak=40,
76 Wind_East_Medium,
77 Wind_East_Strong,
78 Wind_North_Weak,
79 Wind_North_Medium,
80 Wind_North_Strong,
81 Wind_South_Weak,
82 Wind_South_Medium,
83 Wind_South_Strong,
84 Wind_West_Weak,
85 Wind_West_Medium,
86 Wind_West_Strong,
87
88 // [RH] Equivalents for DOOM's sector specials
89 dLight_Flicker = 65,
90 dLight_StrobeFast = 66,
91 dLight_StrobeSlow = 67,
92 dLight_Strobe_Hurt = 68,
93 dDamage_Hellslime = 69,
94 dDamage_Nukage = 71,
95 dLight_Glow = 72,
96 dSector_DoorCloseIn30 = 74,
97 dDamage_End = 75,
98 dLight_StrobeSlowSync = 76,
99 dLight_StrobeFastSync = 77,
100 dSector_DoorRaiseIn5Mins = 78,
101 dFriction_Low = 79,
102 dDamage_SuperHellslime = 80,
103 dLight_FireFlicker = 81,
104 dDamage_LavaWimpy = 82,
105 dDamage_LavaHefty = 83,
106 dScroll_EastLavaDamage = 84,
107 hDamage_Sludge = 85,
108 Sector_Outside = 87,
109
110 // And here are some for Strife
111 sLight_Strobe_Hurt = 104,
112 sDamage_Hellslime = 105,
113 Damage_InstantDeath = 115,
114 sDamage_SuperHellslime = 116,
115 Scroll_StrifeCurrent = 118,
116
117
118 Sector_Hidden = 195,
119 Sector_Heal = 196, // Caverns of Darkness healing sector
120
121 Light_OutdoorLightning = 197,
122 Light_IndoorLightning1 = 198,
123 Light_IndoorLightning2 = 199,
124
125 Sky2 = 200,
126
127 // Hexen-type scrollers
128 Scroll_North_Slow = 201,
129 Scroll_North_Medium = 202,
130 Scroll_North_Fast = 203,
131 Scroll_East_Slow = 204,
132 Scroll_East_Medium = 205,
133 Scroll_East_Fast = 206,
134 Scroll_South_Slow = 207,
135 Scroll_South_Medium = 208,
136 Scroll_South_Fast = 209,
137 Scroll_West_Slow = 210,
138 Scroll_West_Medium = 211,
139 Scroll_West_Fast = 212,
140 Scroll_NorthWest_Slow = 213,
141 Scroll_NorthWest_Medium = 214,
142 Scroll_NorthWest_Fast = 215,
143 Scroll_NorthEast_Slow = 216,
144 Scroll_NorthEast_Medium = 217,
145 Scroll_NorthEast_Fast = 218,
146 Scroll_SouthEast_Slow = 219,
147 Scroll_SouthEast_Medium = 220,
148 Scroll_SouthEast_Fast = 221,
149 Scroll_SouthWest_Slow = 222,
150 Scroll_SouthWest_Medium = 223,
151 Scroll_SouthWest_Fast = 224,
152
153 // Heretic-type scrollers
154 Carry_East5 = 225,
155 Carry_East10,
156 Carry_East25,
157 Carry_East30,
158 Carry_East35,
159 Carry_North5,
160 Carry_North10,
161 Carry_North25,
162 Carry_North30,
163 Carry_North35,
164 Carry_South5,
165 Carry_South10,
166 Carry_South25,
167 Carry_South30,
168 Carry_South35,
169 Carry_West5,
170 Carry_West10,
171 Carry_West25,
172 Carry_West30,
173 Carry_West35
174
175 } sectorspecial_t;
176
177 // [RH] Equivalents for BOOM's generalized sector types
178
179 #define DAMAGE_MASK 0x0300
180 #define SECRET_MASK 0x0400
181 #define FRICTION_MASK 0x0800
182 #define PUSH_MASK 0x1000
183
184 struct line_t;
185 class AActor;
186
187 FName MODtoDamageType (int mod);
188
189 typedef int (*lnSpecFunc)(struct line_t *line,
190 class AActor *activator,
191 bool backSide,
192 int arg1,
193 int arg2,
194 int arg3,
195 int arg4,
196 int arg5);
197
198 extern lnSpecFunc LineSpecials[256];
199
200 extern BYTE NamedACSToNormalACS[7];
P_IsACSSpecial(int specnum)201 static inline bool P_IsACSSpecial(int specnum)
202 {
203 return (specnum >= ACS_Execute && specnum <= ACS_LockedExecuteDoor) ||
204 specnum == ACS_ExecuteAlways;
205 }
206
207 int P_FindLineSpecial (const char *string, int *min_args=NULL, int *max_args=NULL);
208 bool P_ActivateThingSpecial(AActor * thing, AActor * trigger, bool death=false);
209 int P_ExecuteSpecial(int num,
210 struct line_t *line,
211 class AActor *activator,
212 bool backSide,
213 int arg1,
214 int arg2,
215 int arg3,
216 int arg4,
217 int arg5);
218
219 #endif //__P_LNSPEC_H__
220