summaryrefslogtreecommitdiff
path: root/src/strife/doomdef.h
blob: d48b41ee019fedb802193979422218064d36e1f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
// Emacs style mode select   -*- C++ -*- 
//-----------------------------------------------------------------------------
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
// DESCRIPTION:
//  Internally used data structures for virtually everything,
//   lots of other stuff.
//
//-----------------------------------------------------------------------------

#ifndef __DOOMDEF__
#define __DOOMDEF__

#include <stdio.h>
#include <string.h>

#include "doomtype.h"
#include "i_timer.h"
#include "d_mode.h"

//
// Global parameters/defines.
//
// DOOM version
//
// haleyjd 09/28/10: Replaced with Strife version
#define STRIFE_VERSION 101

// Version code for cph's longtics hack ("v1.91")
#define DOOM_191_VERSION 111


// Maximum players for Strife:
#define MAXPLAYERS 8

// If rangecheck is undefined,
// most parameter validation debugging code will not be compiled
#define RANGECHECK

// The current state of the game: whether we are
// playing, gazing at the intermission screen,
// the game final animation, or a demo. 
typedef enum
{
    GS_LEVEL,
    GS_UNKNOWN,
    GS_FINALE,
    GS_DEMOSCREEN,
} gamestate_t;

typedef enum
{
    ga_nothing,
    ga_loadlevel,
    ga_newgame,
    ga_loadgame,
    ga_savegame,
    ga_playdemo,
    ga_completed,
    ga_victory,
    ga_worlddone,
    ga_screenshot
} gameaction_t;

//
// Difficulty/skill settings/filters.
//

// Skill flags.
#define	MTF_EASY                1
#define	MTF_NORMAL              2
#define	MTF_HARD                4
// villsa [STRIFE] standing monsters
#define MTF_STAND               8
// villsa [STRIFE] don't spawn in single player
#define MTF_NOTSINGLE           16
// Deaf monsters/do not react to sound.
#define MTF_AMBUSH              32
// villsa [STRIFE] friendly to players
#define MTF_FRIEND              64
// villsa [STRIFE] TODO - identify
#define MTF_UNKNOWN1            128
// villsa [STRIFE] thing is translucent - STRIFE-TODO: But how much?
#define MTF_TRANSLUCENT         256
// villsa [STRIFE] thing is more - or less? - translucent - STRIFE-TODO
#define MTF_MVIS                512
// villsa [STRIFE] TODO - identify
#define MTF_UNKNOWN2            1024



//
// Key cards.
//
// villsa [STRIFE]
typedef enum
{
    key_BaseKey,        // 0
    key_GovsKey,        // 1
    key_Passcard,       // 2
    key_IDCard,         // 3
    key_PrisonKey,      // 4
    key_SeveredHand,    // 5
    key_Power1Key,      // 6
    key_Power2Key,      // 7
    key_Power3Key,      // 8
    key_GoldKey,        // 9
    key_IDBadge,        // 10
    key_SilverKey,      // 11
    key_OracleKey,      // 12
    key_MilitaryID,     // 13
    key_OrderKey,       // 14
    key_WarehouseKey,   // 15
    key_BrassKey,       // 16
    key_RedCrystalKey,  // 17
    key_BlueCrystalKey, // 18
    key_ChapelKey,      // 19
    key_CatacombKey,    // 20
    key_SecurityKey,    // 21
    key_CoreKey,        // 22
    key_MaulerKey,      // 23
    key_FactoryKey,     // 24
    key_MineKey,        // 25
    key_NewKey5,        // 26

    NUMCARDS            // 27
} card_t;



// The defined weapons,
//  including a marker indicating
//  user has not changed weapon.
// villsa [STRIFE]
typedef enum
{
    wp_fist,
    wp_elecbow,
    wp_rifle,
    wp_missile,
    wp_hegrenade,
    wp_flame,
    wp_mauler,
    wp_sigil,
    wp_poisonbow,
    wp_wpgrenade,
    wp_torpedo,

    NUMWEAPONS,
    
    // No pending weapon change.
    wp_nochange

} weapontype_t;


// Ammunition types defined.
typedef enum
{
    am_bullets,
    am_elecbolts,
    am_poisonbolts,
    am_cell,
    am_missiles,
    am_hegrenades,
    am_wpgrenades,

    NUMAMMO,

    am_noammo   // unlimited ammo

} ammotype_t;


// Power up artifacts.
// villsa [STRIFE]
typedef enum
{
    pw_strength,
    pw_invisibility,
    pw_ironfeet,
    pw_allmap,
    pw_communicator,
    pw_targeter,
    NUMPOWERS
    
} powertype_t;

// villsa [STRIFE]
// quest numbers
typedef enum
{               // Hex          Watcom Name               player_t offset
    tk_quest1,  // 0x00000001   questflags & 1            0x4D
    tk_quest2,  // 0x00000002   questflags & 2
    tk_quest3,  // 0x00000004   questflags & 4
    tk_quest4,  // 0x00000008   questflags & 8
    tk_quest5,  // 0x00000010   questflags & 10h
    tk_quest6,  // 0x00000020   questflags & 20h
    tk_quest7,  // 0x00000040   questflags & 40h
    tk_quest8,  // 0x00000080   questflags & 80h
    tk_quest9,  // 0x00000100   BYTE1(questflags) & 1     0x4E
    tk_quest10, // 0x00000200   BYTE1(questflags) & 2
    tk_quest11, // 0x00000400   BYTE1(questflags) & 4
    tk_quest12, // 0x00000800   BYTE1(questflags) & 8
    tk_quest13, // 0x00001000   BYTE1(questflags) & 10h
    tk_quest14, // 0x00002000   BYTE1(questflags) & 20h
    tk_quest15, // 0x00004000   BYTE1(questflags) & 40h
    tk_quest16, // 0x00008000   BYTE1(questflags) & 80h
    tk_quest17, // 0x00010000   BYTE2(questflags) & 1     0x4F
    tk_quest18, // 0x00020000   BYTE2(questflags) & 2
    tk_quest19, // 0x00040000   BYTE2(questflags) & 4
    tk_quest20, // 0x00080000   BYTE2(questflags) & 8
    tk_quest21, // 0x00100000   BYTE2(questflags) & 10h
    tk_quest22, // 0x00200000   BYTE2(questflags) & 20h
    tk_quest23, // 0x00400000   BYTE2(questflags) & 40h
    tk_quest24, // 0x00800000   BYTE2(questflags) & 80h
    tk_quest25, // 0x01000000   BYTE3(questflags) & 1     0x50
    tk_quest26, // 0x02000000   BYTE3(questflags) & 2
    tk_quest27, // 0x04000000   BYTE3(questflags) & 4
    tk_quest28, // 0x08000000   BYTE3(questflags) & 8
    tk_quest29, // 0x10000000   BYTE3(questflags) & 10h
    tk_quest30, // 0x20000000   BYTE3(questflags) & 20h
    tk_quest31, // 0x40000000   BYTE3(questflags) & 40h
    tk_quest32, // most likely unused
    tk_numquests
} questtype_t;

// haleyjd 09/12/10: [STRIFE]
// flag values for each quest.
enum
{ //  Name       Flag from bitnum      Purpose, if known
    QF_QUEST1  = (1 << tk_quest1),  // Obtained Beldin's ring
    QF_QUEST2  = (1 << tk_quest2),  // Stole the Chalice
    QF_QUEST3  = (1 << tk_quest3),  // Permission to visit Irale (visited Macil)
    QF_QUEST4  = (1 << tk_quest4),  // Accepted Gov. Mourel's "messy" chore
    QF_QUEST5  = (1 << tk_quest5),  // Accepted Gov. Mourel's "bloody" chore
    QF_QUEST6  = (1 << tk_quest6),  // Destroyed the Power Coupling
    QF_QUEST7  = (1 << tk_quest7),  // Killed Blue Acolytes ("Scanning Team")
    QF_QUEST8  = (1 << tk_quest8),  // Unused; formerly, picked up Broken Coupling
    QF_QUEST9  = (1 << tk_quest9),  // Obtained Derwin's ear
    QF_QUEST10 = (1 << tk_quest10), // Obtained Prison Pass
    QF_QUEST11 = (1 << tk_quest11), // Obtained Prison Key
    QF_QUEST12 = (1 << tk_quest12), // Obtained Judge Wolenick's hand
    QF_QUEST13 = (1 << tk_quest13), // Freed the Prisoners
    QF_QUEST14 = (1 << tk_quest14), // Destroyed the Power Crystal
    QF_QUEST15 = (1 << tk_quest15), // Obtained Guard Uniform
    QF_QUEST16 = (1 << tk_quest16), // Destroyed the Gate Mechanism
    QF_QUEST17 = (1 << tk_quest17), // Heard Macil's story about the Sigil (MAP10)
    QF_QUEST18 = (1 << tk_quest18), // Obtained Oracle Pass
    QF_QUEST19 = (1 << tk_quest19),
    QF_QUEST20 = (1 << tk_quest20),
    QF_QUEST21 = (1 << tk_quest21), // Killed Bishop
    QF_QUEST22 = (1 << tk_quest22), // Killed Oracle with QUEST21 set
    QF_QUEST23 = (1 << tk_quest23), // Killed Oracle (always given)
    QF_QUEST24 = (1 << tk_quest24), // Killed Macil
    QF_QUEST25 = (1 << tk_quest25), // Destroyed the Converter
    QF_QUEST26 = (1 << tk_quest26), // Killed Loremaster
    QF_QUEST27 = (1 << tk_quest27), // Destroyed the Computer (checked for good ending)
    QF_QUEST28 = (1 << tk_quest28), // Obtained Catacomb Key (checked by line type 228)
    QF_QUEST29 = (1 << tk_quest29), // Destroyed the Mines Transmitter
    QF_QUEST30 = (1 << tk_quest30),
    QF_QUEST31 = (1 << tk_quest31),
    QF_QUEST32 = (1 << tk_quest32), // Unused; BUG: Broken Coupling accidentally sets it.
    
    QF_ALLQUESTS  = (QF_QUEST31 + (QF_QUEST31 - 1)) // does not include bit 32!
};

//
// Power up durations,
//  how many seconds till expiration,
//  assuming TICRATE is 35 ticks/second.
//
typedef enum
{
    INVISTICS	= (55*TICRATE), // villsa [STRIFE] changed from 60 to 55
    IRONTICS	= (80*TICRATE), // villsa [STRIFE] changed from 60 to 80
    PMUPTICS    = (80*TICRATE), // villsa [STRIFE]
    TARGTICS    = (160*TICRATE),// villsa [STRIFE]
    
} powerduration_t;

#endif          // __DOOMDEF__