Debian Codegraph @

prboom2/src/dsda/global.c

raw
1 //
2 // Copyright(C) 2020 by Ryan Krafnick
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
7 // of the License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // DESCRIPTION:
15 // DSDA Global - define top level globals for doom vs heretic
16 //
17
18 #include <stdlib.h>
19 #include <string.h>
20
21 #include "info.h"
22 #include "d_items.h"
23 #include "p_inter.h"
24 #include "p_spec.h"
25 #include "p_map.h"
26 #include "sounds.h"
27 #include "d_main.h"
28 #include "v_video.h"
29 #include "hu_stuff.h"
30 #include "heretic/def.h"
31
32 #include "global.h"
33
34 #include "dsda/args.h"
35 #include "dsda/map_format.h"
36 #include "dsda/mobjinfo.h"
37 #include "dsda/music.h"
38 #include "dsda/sfx.h"
39 #include "dsda/sprite.h"
40 #include "dsda/state.h"
41
42 #define IGNORE_VALUE -1
43
44 const demostate_t (*demostates)[4];
45 extern const demostate_t doom_demostates[][4];
46 extern const demostate_t heretic_demostates[][4];
47 extern const demostate_t hexen_demostates[][4];
48
49 weaponinfo_t* weaponinfo;
50
51 int g_maxplayers = 4;
52 int g_viewheight = 41 * FRACUNIT;
53 int g_numammo;
54
55 int g_mt_player;
56 int g_mt_tfog;
57 int g_mt_blood;
58 int g_skullpop_mt;
59 int g_s_bloodyskullx1;
60 int g_s_bloodyskullx2;
61 int g_s_play_fdth20;
62
63 int g_wp_fist;
64 int g_wp_chainsaw;
65 int g_wp_pistol;
66
67 int g_telefog_height;
68 int g_thrust_factor;
69 int g_fuzzy_aim_shift;
70 int g_jump;
71
72 int g_s_null;
73
74 int g_mt_bloodsplatter;
75 int g_bloodsplatter_shift;
76 int g_bloodsplatter_weight;
77 int g_mons_look_range;
78 int g_hide_state;
79 int g_lava_type;
80
81 int g_mntr_charge_speed;
82 int g_mntr_atk1_sfx;
83 int g_mntr_decide_range;
84 int g_mntr_charge_rng;
85 int g_mntr_fire_rng;
86 int g_mntr_charge_state;
87 int g_mntr_fire_state;
88 int g_mntr_charge_puff;
89 int g_mntr_atk2_sfx;
90 int g_mntr_atk2_dice;
91 int g_mntr_atk2_missile;
92 int g_mntr_atk3_sfx;
93 int g_mntr_atk3_dice;
94 int g_mntr_atk3_missile;
95 int g_mntr_atk3_state;
96 int g_mntr_fire;
97
98 int g_arti_health;
99 int g_arti_superhealth;
100 int g_arti_fly;
101 int g_arti_limit;
102
103 int g_sfx_sawup;
104 int g_sfx_telept;
105 int g_sfx_stnmov;
106 int g_sfx_stnmov_plats;
107 int g_sfx_swtchn;
108 int g_sfx_swtchx;
109 int g_sfx_dorcls;
110 int g_sfx_doropn;
111 int g_sfx_dorlnd;
112 int g_sfx_pstart;
113 int g_sfx_pstop;
114 int g_sfx_itemup;
115 int g_sfx_pistol;
116 int g_sfx_oof;
117 int g_sfx_menu;
118 int g_sfx_respawn;
119 int g_sfx_secret;
120 int g_sfx_revive;
121 int g_sfx_console;
122
123 int g_door_normal;
124 int g_door_raise_in_5_mins;
125 int g_door_open;
126
127 int g_st_height;
128 int g_border_offset;
129 int g_mf_translucent;
130 int g_mf_shadow;
131
132 const char* g_menu_flat;
133 int g_menu_save_page_size;
134 int g_menu_font_spacing;
135
136 const char* g_skyflatname;
137
138 dboolean hexen = false;
139 dboolean heretic = false;
140 dboolean raven = false;
141
142 static void dsda_InitDoom(void) {
143 int i;
144 doom_mobjinfo_t* mobjinfo_p;
145
146 dsda_InitializeMobjInfo(DOOM_MT_ZERO, DOOM_NUMMOBJTYPES, DOOM_NUMMOBJTYPES);
147 dsda_InitializeStates(doom_states, DOOM_NUMSTATES);
148 dsda_InitializeSprites(doom_sprnames, DOOM_NUMSPRITES);
149 dsda_InitializeSFX(doom_S_sfx, DOOM_NUMSFX);
150 dsda_InitializeMusic(doom_S_music, DOOM_NUMMUSIC);
151
152 demostates = doom_demostates;
153
154 weaponinfo = doom_weaponinfo;
155
156 g_maxplayers = 4;
157 g_viewheight = 41 * FRACUNIT;
158 g_numammo = DOOM_NUMAMMO;
159
160 g_mt_player = MT_PLAYER;
161 g_mt_tfog = MT_TFOG;
162 g_mt_blood = MT_BLOOD;
163 g_skullpop_mt = MT_NULL;
164
165 g_wp_fist = wp_fist;
166 g_wp_chainsaw = wp_chainsaw;
167 g_wp_pistol = wp_pistol;
168
169 g_telefog_height = 0;
170 g_thrust_factor = 100;
171 g_fuzzy_aim_shift = 20;
172 g_jump = 8;
173
174 g_s_null = S_NULL;
175
176 g_sfx_sawup = sfx_sawup;
177 g_sfx_telept = sfx_telept;
178 g_sfx_stnmov = sfx_stnmov;
179 g_sfx_stnmov_plats = sfx_stnmov;
180 g_sfx_swtchn = sfx_swtchn;
181 g_sfx_swtchx = sfx_swtchx;
182 g_sfx_dorcls = sfx_dorcls;
183 g_sfx_doropn = sfx_doropn;
184 g_sfx_dorlnd = sfx_dorcls;
185 g_sfx_pstart = sfx_pstart;
186 g_sfx_pstop = sfx_pstop;
187 g_sfx_itemup = sfx_itemup;
188 g_sfx_pistol = sfx_pistol;
189 g_sfx_oof = sfx_oof;
190 g_sfx_menu = sfx_pstop;
191 g_sfx_secret = sfx_secret;
192 g_sfx_revive = sfx_slop;
193 g_sfx_console = sfx_radio;
194
195 g_door_normal = normal;
196 g_door_raise_in_5_mins = waitRaiseDoor;
197 g_door_open = openDoor;
198
199 g_st_height = 32;
200 g_border_offset = 8;
201 g_mf_translucent = MF_TRANSLUCENT;
202 g_mf_shadow = MF_SHADOW;
203
204 g_menu_flat = "FLOOR4_6";
205 g_menu_save_page_size = 7;
206 g_menu_font_spacing = -1;
207
208 g_skyflatname = "F_SKY1";
209
210 // convert doom mobj types to shared type
211 for (i = 0; i < DOOM_NUMMOBJTYPES; ++i) {
212 mobjinfo_p = &doom_mobjinfo[i];
213
214 mobjinfo[i].doomednum = mobjinfo_p->doomednum;
215 mobjinfo[i].spawnstate = mobjinfo_p->spawnstate;
216 mobjinfo[i].spawnhealth = mobjinfo_p->spawnhealth;
217 mobjinfo[i].seestate = mobjinfo_p->seestate;
218 mobjinfo[i].seesound = mobjinfo_p->seesound;
219 mobjinfo[i].reactiontime = mobjinfo_p->reactiontime;
220 mobjinfo[i].attacksound = mobjinfo_p->attacksound;
221 mobjinfo[i].painstate = mobjinfo_p->painstate;
222 mobjinfo[i].painchance = mobjinfo_p->painchance;
223 mobjinfo[i].painsound = mobjinfo_p->painsound;
224 mobjinfo[i].meleestate = mobjinfo_p->meleestate;
225 mobjinfo[i].missilestate = mobjinfo_p->missilestate;
226 mobjinfo[i].deathstate = mobjinfo_p->deathstate;
227 mobjinfo[i].xdeathstate = mobjinfo_p->xdeathstate;
228 mobjinfo[i].deathsound = mobjinfo_p->deathsound;
229 mobjinfo[i].speed = mobjinfo_p->speed;
230 mobjinfo[i].radius = mobjinfo_p->radius;
231 mobjinfo[i].height = mobjinfo_p->height;
232 mobjinfo[i].mass = mobjinfo_p->mass;
233 mobjinfo[i].damage = mobjinfo_p->damage;
234 mobjinfo[i].activesound = mobjinfo_p->activesound;
235 mobjinfo[i].flags = mobjinfo_p->flags;
236 mobjinfo[i].raisestate = mobjinfo_p->raisestate;
237 mobjinfo[i].droppeditem = MT_NULL;
238 mobjinfo[i].crashstate = 0; // not in doom
239 mobjinfo[i].flags2 = 0; // not in doom
240
241 // mbf21
242 mobjinfo[i].infighting_group = IG_DEFAULT;
243 mobjinfo[i].projectile_group = PG_DEFAULT;
244 mobjinfo[i].splash_group = SG_DEFAULT;
245 mobjinfo[i].ripsound = sfx_None;
246 mobjinfo[i].altspeed = NO_ALTSPEED;
247 mobjinfo[i].meleerange = MELEERANGE;
248
249 // misc
250 mobjinfo[i].bloodcolor = 0; // default
251 mobjinfo[i].visibility = VF_DOOM;
252 }
253
254 // don't want to reorganize info.c structure for a few tweaks...
255 mobjinfo[MT_WOLFSS].droppeditem = MT_CLIP;
256 mobjinfo[MT_POSSESSED].droppeditem = MT_CLIP;
257 mobjinfo[MT_SHOTGUY].droppeditem = MT_SHOTGUN;
258 mobjinfo[MT_CHAINGUY].droppeditem = MT_CHAINGUN;
259
260 mobjinfo[MT_VILE].flags2 = MF2_SHORTMRANGE | MF2_DMGIGNORED | MF2_NOTHRESHOLD;
261 mobjinfo[MT_CYBORG].flags2 = MF2_NORADIUSDMG | MF2_HIGHERMPROB | MF2_RANGEHALF |
262 MF2_FULLVOLSOUNDS | MF2_E2M8BOSS | MF2_E4M6BOSS;
263 mobjinfo[MT_SPIDER].flags2 = MF2_NORADIUSDMG | MF2_RANGEHALF | MF2_FULLVOLSOUNDS |
264 MF2_E3M8BOSS | MF2_E4M8BOSS;
265 mobjinfo[MT_SKULL].flags2 = MF2_RANGEHALF;
266 mobjinfo[MT_FATSO].flags2 = MF2_MAP07BOSS1;
267 mobjinfo[MT_BABY].flags2 = MF2_MAP07BOSS2;
268 mobjinfo[MT_BRUISER].flags2 = MF2_E1M8BOSS;
269 mobjinfo[MT_UNDEAD].flags2 = MF2_LONGMELEE | MF2_RANGEHALF;
270
271 mobjinfo[MT_BRUISER].projectile_group = PG_BARON;
272 mobjinfo[MT_KNIGHT].projectile_group = PG_BARON;
273
274 mobjinfo[MT_BRUISERSHOT].altspeed = 20 * FRACUNIT;
275 mobjinfo[MT_HEADSHOT].altspeed = 20 * FRACUNIT;
276 mobjinfo[MT_TROOPSHOT].altspeed = 20 * FRACUNIT;
277
278 for (i = S_SARG_RUN1; i <= S_SARG_PAIN2; ++i)
279 states[i].flags |= STATEF_SKILL5FAST;
280 }
281
282 static void dsda_InitHeretic(void) {
283 int i, j;
284 raven_mobjinfo_t* mobjinfo_p;
285
286 dsda_InitializeMobjInfo(HERETIC_MT_ZERO, HERETIC_NUMMOBJTYPES, HERETIC_NUMMOBJTYPES);
287 dsda_InitializeStates(heretic_states, HERETIC_NUMSTATES);
288 dsda_InitializeSprites(heretic_sprnames, HERETIC_NUMSPRITES);
289 dsda_InitializeSFX(heretic_S_sfx, HERETIC_NUMSFX);
290 dsda_InitializeMusic(heretic_S_music, HERETIC_NUMMUSIC);
291
292 demostates = heretic_demostates;
293
294 weaponinfo = wpnlev1info;
295
296 g_maxplayers = 4;
297 g_viewheight = 41 * FRACUNIT;
298 g_numammo = HERETIC_NUMAMMO;
299
300 g_mt_player = HERETIC_MT_PLAYER;
301 g_mt_tfog = HERETIC_MT_TFOG;
302 g_mt_blood = HERETIC_MT_BLOOD;
303 g_skullpop_mt = HERETIC_MT_BLOODYSKULL;
304 g_s_bloodyskullx1 = HERETIC_S_BLOODYSKULLX1;
305 g_s_bloodyskullx2 = HERETIC_S_BLOODYSKULLX2;
306 g_s_play_fdth20 = HERETIC_S_PLAY_FDTH20;
307
308 g_wp_fist = wp_staff;
309 g_wp_chainsaw = wp_gauntlets;
310 g_wp_pistol = wp_goldwand;
311
312 g_telefog_height = TELEFOGHEIGHT;
313 g_thrust_factor = 150;
314 g_fuzzy_aim_shift = 21;
315 g_jump = 8;
316
317 g_s_null = HERETIC_S_NULL;
318
319 g_mt_bloodsplatter = HERETIC_MT_BLOODSPLATTER;
320 g_bloodsplatter_shift = 9;
321 g_bloodsplatter_weight = 2;
322 g_mons_look_range = 20 * 64 * FRACUNIT;
323 g_hide_state = HERETIC_S_HIDESPECIAL1;
324 g_lava_type = HERETIC_MT_PHOENIXFX2;
325
326 g_mntr_atk1_sfx = heretic_sfx_stfpow;
327 g_mntr_charge_speed = 13 * FRACUNIT;
328 g_mntr_decide_range = 8;
329 g_mntr_charge_rng = 150;
330 g_mntr_charge_state = HERETIC_S_MNTR_ATK4_1;
331 g_mntr_fire_rng = 220;
332 g_mntr_fire_state = HERETIC_S_MNTR_ATK3_1;
333 g_mntr_charge_puff = HERETIC_MT_PHOENIXPUFF;
334 g_mntr_atk2_sfx = heretic_sfx_minat2;
335 g_mntr_atk2_dice = 5;
336 g_mntr_atk2_missile = HERETIC_MT_MNTRFX1;
337 g_mntr_atk3_sfx = heretic_sfx_minat1;
338 g_mntr_atk3_dice = 5;
339 g_mntr_atk3_missile = HERETIC_MT_MNTRFX2;
340 g_mntr_atk3_state = HERETIC_S_MNTR_ATK3_4;
341 g_mntr_fire = HERETIC_MT_MNTRFX3;
342
343 g_arti_health = arti_health;
344 g_arti_superhealth = arti_superhealth;
345 g_arti_fly = arti_fly;
346 g_arti_limit = 16;
347
348 g_sfx_sawup = heretic_sfx_gntact;
349 g_sfx_telept = heretic_sfx_telept;
350 g_sfx_stnmov = heretic_sfx_dormov;
351 g_sfx_stnmov_plats = heretic_sfx_stnmov;
352 g_sfx_swtchn = heretic_sfx_switch;
353 g_sfx_swtchx = heretic_sfx_switch;
354 g_sfx_dorcls = heretic_sfx_doropn;
355 g_sfx_doropn = heretic_sfx_doropn;
356 g_sfx_dorlnd = heretic_sfx_dorcls;
357 g_sfx_pstart = heretic_sfx_pstart;
358 g_sfx_pstop = heretic_sfx_pstop;
359 g_sfx_itemup = heretic_sfx_itemup;
360 g_sfx_pistol = heretic_sfx_gldhit;
361 g_sfx_oof = heretic_sfx_plroof;
362 g_sfx_menu = heretic_sfx_dorcls;
363 g_sfx_respawn = heretic_sfx_respawn;
364 g_sfx_secret = heretic_sfx_chat;
365 g_sfx_revive = heretic_sfx_telept;
366 g_sfx_console = heretic_sfx_chat;
367
368 g_door_normal = vld_normal;
369 g_door_raise_in_5_mins = vld_raiseIn5Mins;
370 g_door_open = vld_open;
371
372 g_st_height = 42;
373 g_border_offset = 4;
374 g_mf_translucent = MF_SHADOW;
375 g_mf_shadow = 0; // doesn't exist in heretic
376
377 g_menu_flat = "FLOOR30";
378 g_menu_save_page_size = 5;
379 g_menu_font_spacing = 0;
380
381 g_skyflatname = "F_SKY1";
382
383 // convert heretic mobj types to shared type
384 for (i = 0; i < HERETIC_NUMMOBJTYPES - HERETIC_MT_ZERO; ++i) {
385 mobjinfo_p = &heretic_mobjinfo[i];
386
387 j = i + HERETIC_MT_ZERO;
388 mobjinfo[j].doomednum = mobjinfo_p->doomednum;
389 mobjinfo[j].spawnstate = mobjinfo_p->spawnstate;
390 mobjinfo[j].spawnhealth = mobjinfo_p->spawnhealth;
391 mobjinfo[j].seestate = mobjinfo_p->seestate;
392 mobjinfo[j].seesound = mobjinfo_p->seesound;
393 mobjinfo[j].reactiontime = mobjinfo_p->reactiontime;
394 mobjinfo[j].attacksound = mobjinfo_p->attacksound;
395 mobjinfo[j].painstate = mobjinfo_p->painstate;
396 mobjinfo[j].painchance = mobjinfo_p->painchance;
397 mobjinfo[j].painsound = mobjinfo_p->painsound;
398 mobjinfo[j].meleestate = mobjinfo_p->meleestate;
399 mobjinfo[j].missilestate = mobjinfo_p->missilestate;
400 mobjinfo[j].deathstate = mobjinfo_p->deathstate;
401 mobjinfo[j].xdeathstate = mobjinfo_p->xdeathstate;
402 mobjinfo[j].deathsound = mobjinfo_p->deathsound;
403 mobjinfo[j].speed = mobjinfo_p->speed;
404 mobjinfo[j].radius = mobjinfo_p->radius;
405 mobjinfo[j].height = mobjinfo_p->height;
406 mobjinfo[j].mass = mobjinfo_p->mass;
407 mobjinfo[j].damage = mobjinfo_p->damage;
408 mobjinfo[j].activesound = mobjinfo_p->activesound;
409 mobjinfo[j].flags = mobjinfo_p->flags;
410 mobjinfo[j].raisestate = 0; // not in heretic
411 mobjinfo[j].droppeditem = 0; // not in heretic
412 mobjinfo[j].crashstate = mobjinfo_p->crashstate;
413 mobjinfo[j].flags2 = mobjinfo_p->flags2;
414
415 // mbf21
416 mobjinfo[j].infighting_group = IG_DEFAULT;
417 mobjinfo[j].projectile_group = PG_DEFAULT;
418 mobjinfo[j].splash_group = SG_DEFAULT;
419 mobjinfo[j].ripsound = heretic_sfx_None;
420 mobjinfo[j].altspeed = NO_ALTSPEED;
421 mobjinfo[j].meleerange = MELEERANGE;
422
423 // misc
424 mobjinfo[j].bloodcolor = 0; // default
425 mobjinfo[j].visibility = VF_HERETIC;
426 }
427
428 // heretic doesn't use "clip" concept
429 for (i = 0; i < NUMAMMO; ++i) clipammo[i] = 1;
430
431 // so few it's not worth implementing a pointer swap
432 maxammo[0] = 100; // gold wand
433 maxammo[1] = 50; // crossbow
434 maxammo[2] = 200; // blaster
435 maxammo[3] = 200; // skull rod
436 maxammo[4] = 20; // phoenix rod
437 maxammo[5] = 150; // mace
438 }
439
440 static void dsda_InitHexen(void) {
441 int i, j;
442 raven_mobjinfo_t* mobjinfo_p;
443
444 dsda_InitializeMobjInfo(HEXEN_MT_ZERO, HEXEN_NUMMOBJTYPES, TOTAL_NUMMOBJTYPES);
445 dsda_InitializeStates(hexen_states, HEXEN_NUMSTATES);
446 dsda_InitializeSprites(hexen_sprnames, HEXEN_NUMSPRITES);
447 dsda_InitializeSFX(hexen_S_sfx, HEXEN_NUMSFX);
448 dsda_InitializeMusic(hexen_S_music, HEXEN_NUMMUSIC);
449
450 demostates = hexen_demostates;
451
452 // weaponinfo = wpnlev1info;
453
454 g_maxplayers = 8;
455 g_viewheight = 48 * FRACUNIT;
456 g_numammo = NUMMANA;
457
458 // g_mt_player = HERETIC_MT_PLAYER;
459 g_mt_tfog = HEXEN_MT_TFOG;
460 g_mt_blood = HEXEN_MT_BLOOD;
461 g_skullpop_mt = HEXEN_MT_BLOODYSKULL;
462 g_s_bloodyskullx1 = HEXEN_S_BLOODYSKULLX1;
463 g_s_bloodyskullx2 = HEXEN_S_BLOODYSKULLX2;
464 g_s_play_fdth20 = HEXEN_S_PLAY_FDTH20;
465
466 // g_wp_fist = wp_staff;
467 // g_wp_chainsaw = wp_gauntlets;
468 // g_wp_pistol = wp_goldwand;
469
470 g_telefog_height = TELEFOGHEIGHT;
471 g_thrust_factor = 150;
472 g_fuzzy_aim_shift = 21;
473 g_jump = 9;
474
475 g_s_null = HEXEN_S_NULL;
476
477 g_mt_bloodsplatter = HEXEN_MT_BLOODSPLATTER;
478 g_bloodsplatter_shift = 10;
479 g_bloodsplatter_weight = 3;
480 g_mons_look_range = 16 * 64 * FRACUNIT;
481 g_hide_state = HEXEN_S_HIDESPECIAL1;
482 g_lava_type = HEXEN_MT_CIRCLEFLAME;
483
484 g_mntr_atk1_sfx = hexen_sfx_maulator_hammer_swing;
485 g_mntr_charge_speed = 23 * FRACUNIT;
486 g_mntr_decide_range = 16;
487 g_mntr_charge_rng = 230;
488 g_mntr_charge_state = HEXEN_S_MNTR_ATK4_1;
489 g_mntr_fire_rng = 100;
490 g_mntr_fire_state = HEXEN_S_MNTR_ATK3_1;
491 g_mntr_charge_puff = HEXEN_MT_PUNCHPUFF;
492 g_mntr_atk2_sfx = hexen_sfx_maulator_hammer_swing;
493 g_mntr_atk2_dice = 3;
494 g_mntr_atk2_missile = HEXEN_MT_MNTRFX1;
495 g_mntr_atk3_sfx = hexen_sfx_maulator_hammer_hit;
496 g_mntr_atk3_dice = 3;
497 g_mntr_atk3_missile = HEXEN_MT_MNTRFX2;
498 g_mntr_atk3_state = HEXEN_S_MNTR_ATK3_4;
499 g_mntr_fire = HEXEN_MT_MNTRFX3;
500
501 g_arti_health = hexen_arti_health;
502 g_arti_superhealth = hexen_arti_superhealth;
503 g_arti_fly = hexen_arti_fly;
504 g_arti_limit = 25;
505
506 g_sfx_telept = hexen_sfx_teleport;
507 g_sfx_stnmov = hexen_sfx_door_light_close;
508 g_sfx_swtchn = hexen_sfx_fighter_hammer_hitwall;
509 g_sfx_swtchx = hexen_sfx_fighter_hammer_hitwall;
510 g_sfx_dorcls = hexen_sfx_door_light_close;
511 g_sfx_doropn = hexen_sfx_door_open;
512 g_sfx_dorlnd = hexen_sfx_door_light_close;
513 g_sfx_itemup = hexen_sfx_pickup_key;
514 g_sfx_pistol = hexen_sfx_fighter_hammer_hitwall;
515 g_sfx_oof = hexen_sfx_player_fighter_grunt;
516 g_sfx_menu = hexen_sfx_door_light_close;
517 g_sfx_respawn = hexen_sfx_respawn;
518 g_sfx_secret = hexen_sfx_chat;
519 g_sfx_revive = hexen_sfx_teleport;
520 g_sfx_console = hexen_sfx_chat;
521
522 g_st_height = 39;
523 g_border_offset = 4;
524 g_mf_translucent = MF_SHADOW; // hexen_note: how does ALTSHADOW fit in?
525 g_mf_shadow = 0; // doesn't exist in hexen
526
527 g_menu_flat = "F_032";
528 g_menu_save_page_size = 5;
529 g_menu_font_spacing = 0;
530
531 g_skyflatname = "F_SKY";
532
533 // convert hexen mobj types to shared type
534 for (i = 0; i < HEXEN_NUMMOBJTYPES - HEXEN_MT_ZERO; ++i) {
535 mobjinfo_p = &hexen_mobjinfo[i];
536
537 j = i + HEXEN_MT_ZERO;
538 mobjinfo[j].doomednum = mobjinfo_p->doomednum;
539 mobjinfo[j].spawnstate = mobjinfo_p->spawnstate;
540 mobjinfo[j].spawnhealth = mobjinfo_p->spawnhealth;
541 mobjinfo[j].seestate = mobjinfo_p->seestate;
542 mobjinfo[j].seesound = mobjinfo_p->seesound;
543 mobjinfo[j].reactiontime = mobjinfo_p->reactiontime;
544 mobjinfo[j].attacksound = mobjinfo_p->attacksound;
545 mobjinfo[j].painstate = mobjinfo_p->painstate;
546 mobjinfo[j].painchance = mobjinfo_p->painchance;
547 mobjinfo[j].painsound = mobjinfo_p->painsound;
548 mobjinfo[j].meleestate = mobjinfo_p->meleestate;
549 mobjinfo[j].missilestate = mobjinfo_p->missilestate;
550 mobjinfo[j].deathstate = mobjinfo_p->deathstate;
551 mobjinfo[j].xdeathstate = mobjinfo_p->xdeathstate;
552 mobjinfo[j].deathsound = mobjinfo_p->deathsound;
553 mobjinfo[j].speed = mobjinfo_p->speed;
554 mobjinfo[j].radius = mobjinfo_p->radius;
555 mobjinfo[j].height = mobjinfo_p->height;
556 mobjinfo[j].mass = mobjinfo_p->mass;
557 mobjinfo[j].damage = mobjinfo_p->damage;
558 mobjinfo[j].activesound = mobjinfo_p->activesound;
559 mobjinfo[j].flags = mobjinfo_p->flags;
560 mobjinfo[j].raisestate = 0; // not in hexen
561 mobjinfo[j].droppeditem = 0; // not in hexen
562 mobjinfo[j].crashstate = mobjinfo_p->crashstate;
563 mobjinfo[j].flags2 = mobjinfo_p->flags2;
564
565 // mbf21
566 mobjinfo[j].infighting_group = IG_DEFAULT;
567 mobjinfo[j].projectile_group = PG_DEFAULT;
568 mobjinfo[j].splash_group = SG_DEFAULT;
569 mobjinfo[j].ripsound = hexen_sfx_None;
570 mobjinfo[j].altspeed = NO_ALTSPEED;
571 mobjinfo[j].meleerange = MELEERANGE;
572
573 // misc
574 mobjinfo[j].bloodcolor = 0; // default
575 mobjinfo[j].visibility = VF_HEXEN;
576 }
577
578 {
579 extern void P_UseHexenRNG(void);
580
581 P_UseHexenRNG();
582 }
583 }
584
585 static dboolean dsda_AutoDetectHeretic(void)
586 {
587 dsda_arg_t* arg;
588 int length;
589 arg = dsda_Arg(dsda_arg_iwad);
590 if (arg->found) {
591 length = strlen(arg->value.v_string);
592 if (length >= 11 && !strnicmp(arg->value.v_string + length - 11, "heretic.wad", 11))
593 return true;
594 else if (length >= 12 && !strnicmp(arg->value.v_string + length - 12, "heretic1.wad", 12))
595 return true;
596 }
597
598 return false;
599 }
600
601 static dboolean dsda_AutoDetectHexen(void)
602 {
603 dsda_arg_t* arg;
604 int length;
605 arg = dsda_Arg(dsda_arg_iwad);
606 if (arg->found) {
607 length = strlen(arg->value.v_string);
608 if (length >= 9 && !strnicmp(arg->value.v_string + length - 9, "hexen.wad", 9))
609 return true;
610 }
611
612 return false;
613 }
614
615 extern void dsda_ResetNullPClass(void);
616
617 void dsda_InitGlobal(void) {
618 heretic = dsda_Flag(dsda_arg_heretic) || dsda_AutoDetectHeretic();
619 hexen = dsda_Flag(dsda_arg_hexen) || dsda_AutoDetectHexen();
620 raven = heretic || hexen;
621
622 if (hexen)
623 dsda_InitHexen();
624 else if (heretic)
625 dsda_InitHeretic();
626 else
627 dsda_InitDoom();
628
629 dsda_ResetNullPClass();
630 }