📄 h2def.h
字号:
//**************************************************************************//**//** h2def.h : Heretic 2 : Raven Software, Corp.//**//** $RCSfile: h2def.h,v $//** $Revision: 1.128 $//** $Date: 96/01/16 10:35:31 $//** $Author: bgokey $//**//**************************************************************************#ifndef __H2DEF__#define __H2DEF__#include <stdio.h>#include <string.h>#include <stdlib.h>#include "st_start.h"#ifdef __WATCOMC__#include <malloc.h>#define strcasecmp strcmpi#define strncasecmp strnicmp#endif#define VERSION 110#define VERSION_TEXT "v1.1"// Uncomment, to enable all timebomb stuff//#define TIMEBOMB#define TIMEBOMB_YEAR 95 // years since 1900#define TIMEBOMB_STARTDATE 268 // initial date (9/26)#define TIMEBOMB_ENDDATE 301 // end date (10/29)// if rangecheck is undefined, most parameter validation debugging code// will not be compiled#ifndef NORANGECHECKING#define RANGECHECK#endif// Past distributions#ifndef VER_ID#define VER_ID "DVL"#endif//#define VERSIONTEXT "ID V1.2"//#define VERSIONTEXT "RETAIL STORE BETA" // 9/26/95//#define VERSIONTEXT "DVL BETA 10 05 95" // Used for GT for testing//#define VERSIONTEXT "DVL BETA 10 07 95" // Just an update for Romero//#define VERSIONTEXT "FINAL 1.0 (10 13 95)" // Just an update for Romero#ifdef RANGECHECK#define VERSIONTEXT "Version 1.1 +R "__DATE__" ("VER_ID")"#else#define VERSIONTEXT "Version 1.1 "__DATE__" ("VER_ID")"#endif// all exterior data is defined here#include "xddefs.h"// all important printed strings#include "textdefs.h"// header generated by multigen utility#include "info.h"extern byte *destview, *destscreen; // PC direct to screen pointers//// most key data are simple ascii (uppercased)//#define KEY_RIGHTARROW 0xae#define KEY_LEFTARROW 0xac#define KEY_UPARROW 0xad#define KEY_DOWNARROW 0xaf#define KEY_ESCAPE 27#define KEY_ENTER 13#define KEY_F1 (0x80+0x3b)#define KEY_F2 (0x80+0x3c)#define KEY_F3 (0x80+0x3d)#define KEY_F4 (0x80+0x3e)#define KEY_F5 (0x80+0x3f)#define KEY_F6 (0x80+0x40)#define KEY_F7 (0x80+0x41)#define KEY_F8 (0x80+0x42)#define KEY_F9 (0x80+0x43)#define KEY_F10 (0x80+0x44)#define KEY_F11 (0x80+0x57)#define KEY_F12 (0x80+0x58)#define KEY_BACKSPACE 127#define KEY_PAUSE 0xff#define KEY_EQUALS 0x3d#define KEY_MINUS 0x2d#define KEY_RSHIFT (0x80+0x36)#define KEY_RCTRL (0x80+0x1d)#define KEY_RALT (0x80+0x38)#define KEY_LALT KEY_RALT#define KEY_FIVE 0x35#define KEY_SIX 0x36#define KEY_SEVEN 0x37#define KEY_EIGHT 0x38#define KEY_NINE 0x39#define KEY_ZERO 0x30#define KEY_BACKSLASH 0x5C#define MAXCHAR ((char)0x7f)#define MAXSHORT ((short)0x7fff)#define MAXINT ((int)0x7fffffff) /* max pos 32-bit int */#define MAXLONG ((long)0x7fffffff)#define MINCHAR ((char)0x80)#define MINSHORT ((short)0x8000)#define MININT ((int)0x80000000) /* max negative 32-bit integer */#define MINLONG ((long)0x80000000)#define FINEANGLES 8192#define FINEMASK (FINEANGLES-1)#define ANGLETOFINESHIFT 19 // 0x100000000 to 0x2000/*=============================================================================== GLOBAL TYPES===============================================================================*///#define NUMARTIFCTS 28#define MAXPLAYERS 8#define TICRATE 35 // number of tics / second#define TICSPERSEC 35#define MINIMUM_HEAP_SIZE 0x800000 // 8 meg#define MAXIMUM_HEAP_SIZE 0x2000000 // 32 meg#define FRACBITS 16#define FRACUNIT (1<<FRACBITS)typedef int fixed_t;typedef unsigned int uint;//#define ANGLE_1 0x01000000#define ANGLE_45 0x20000000#define ANGLE_90 0x40000000#define ANGLE_180 0x80000000#define ANGLE_MAX 0xffffffff#define ANGLE_1 (ANGLE_45/45)#define ANGLE_60 (ANGLE_180/3)#define ANG45 0x20000000#define ANG90 0x40000000#define ANG180 0x80000000#define ANG270 0xc0000000typedef unsigned angle_t;typedef enum{ sk_baby, sk_easy, sk_medium, sk_hard, sk_nightmare} skill_t;typedef enum{ ev_keydown, ev_keyup, ev_mouse, ev_joystick} evtype_t;typedef struct{ evtype_t type; int data1; // keys / mouse/joystick buttons int data2; // mouse/joystick x move int data3; // mouse/joystick y move} event_t;typedef struct{ char forwardmove; // *2048 for move char sidemove; // *2048 for move short angleturn; // <<16 for angle delta short consistancy; // checks for net game byte chatchar; byte buttons; byte lookfly; // look/fly up/down/centering byte arti; // artitype_t to use} ticcmd_t;#define BT_ATTACK 1#define BT_USE 2#define BT_CHANGE 4 // if true, the next 3 bits hold weapon num#define BT_WEAPONMASK (8+16+32)#define BT_WEAPONSHIFT 3#define BT_SPECIAL 128 // game events, not really buttons#define BTS_SAVEMASK (4+8+16)#define BTS_SAVESHIFT 2#define BT_SPECIALMASK 3#define BTS_PAUSE 1 // pause the game#define BTS_SAVEGAME 2 // save the game at each console// savegame slot numbers occupy the second byte of buttons// The top 3 bits of the artifact field in the ticcmd_t struct are used// as additional flags #define AFLAG_MASK 0x3F#define AFLAG_SUICIDE 0x40#define AFLAG_JUMP 0x80typedef enum{ GS_LEVEL, GS_INTERMISSION, GS_FINALE, GS_DEMOSCREEN} gamestate_t;typedef enum{ ga_nothing, ga_loadlevel, ga_initnew, ga_newgame, ga_loadgame, ga_savegame, ga_playdemo, ga_completed, ga_leavemap, ga_singlereborn, ga_victory, ga_worlddone, ga_screenshot} gameaction_t;typedef enum{ wipe_0, wipe_1, wipe_2, wipe_3, wipe_4, NUMWIPES, wipe_random} wipe_t;/*=============================================================================== MAPOBJ DATA===============================================================================*/// think_t is a function pointer to a routine to handle an actortypedef void (*think_t) ();typedef struct thinker_s{ struct thinker_s *prev, *next; think_t function;} thinker_t;struct player_s;typedef struct mobj_s{ thinker_t thinker; // thinker node// info for drawing fixed_t x,y,z; struct mobj_s *snext, *sprev; // links in sector (if needed) angle_t angle; spritenum_t sprite; // used to find patch_t and flip value int frame; // might be ord with FF_FULLBRIGHT// interaction info struct mobj_s *bnext, *bprev; // links in blocks (if needed) struct subsector_s *subsector; fixed_t floorz, ceilingz; // closest together of contacted secs fixed_t floorpic; // contacted sec floorpic fixed_t radius, height; // for movement checking fixed_t momx, momy, momz; // momentums int validcount; // if == validcount, already checked mobjtype_t type; mobjinfo_t *info; // &mobjinfo[mobj->type] int tics; // state tic counter state_t *state; int damage; // For missiles int flags; int flags2; // Heretic flags int special1; // Special info int special2; // Special info int health; int movedir; // 0-7 int movecount; // when 0, select a new dir struct mobj_s *target; // thing being chased/attacked (or NULL) // also the originator for missiles int reactiontime; // if non 0, don't attack yet // used by player to freeze a bit after // teleporting int threshold; // if > 0, the target will be chased // no matter what (even if shot) struct player_s *player; // only valid if type == MT_PLAYER int lastlook; // player number last looked for fixed_t floorclip; // value to use for floor clipping int archiveNum; // Identity during archive short tid; // thing identifier byte special; // special byte args[5]; // special arguments} mobj_t;// each sector has a degenmobj_t in it's center for sound origin purposestypedef struct{ thinker_t thinker; // not used for anything fixed_t x,y,z;} degenmobj_t;// Most damage defined using HITDICE#define HITDICE(a) ((1+(P_Random()&7))*a)//// frame flags//#define FF_FULLBRIGHT 0x8000 // flag in thing->frame#define FF_FRAMEMASK 0x7fff// --- mobj.flags ---#define MF_SPECIAL 1 // call P_SpecialThing when touched#define MF_SOLID 2#define MF_SHOOTABLE 4#define MF_NOSECTOR 8 // don't use the sector links // (invisible but touchable)#define MF_NOBLOCKMAP 16 // don't use the blocklinks // (inert but displayable)#define MF_AMBUSH 32#define MF_JUSTHIT 64 // try to attack right back#define MF_JUSTATTACKED 128 // take at least one step before attacking#define MF_SPAWNCEILING 256 // hang from ceiling instead of floor#define MF_NOGRAVITY 512 // don't apply gravity every tic// movement flags#define MF_DROPOFF 0x400 // allow jumps from high places#define MF_PICKUP 0x800 // for players to pick up items#define MF_NOCLIP 0x1000 // player cheat#define MF_SLIDE 0x2000 // keep info about sliding along walls#define MF_FLOAT 0x4000 // allow moves to any height, no gravity#define MF_TELEPORT 0x8000 // don't cross lines or look at heights#define MF_MISSILE 0x10000 // don't hit same species, explode on block#define MF_ALTSHADOW 0x20000 // alternate fuzzy draw#define MF_SHADOW 0x40000 // use fuzzy draw (shadow demons / invis)#define MF_NOBLOOD 0x80000 // don't bleed when shot (use puff)#define MF_CORPSE 0x100000 // don't stop moving halfway off a step#define MF_INFLOAT 0x200000 // floating to a height for a move, don't // auto float to target's height#define MF_COUNTKILL 0x400000 // count towards intermission kill total#define MF_ICECORPSE 0x800000 // a frozen corpse (for blasting)#define MF_SKULLFLY 0x1000000 // skull in flight#define MF_NOTDMATCH 0x2000000 // don't spawn in death match (key cards)//#define MF_TRANSLATION 0xc000000 // if 0x4 0x8 or 0xc, use a translation#define MF_TRANSLATION 0x1c000000 // use a translation table (>>MF_TRANSHIFT)#define MF_TRANSSHIFT 26 // table for player colormaps// --- mobj.flags2 ---#define MF2_LOGRAV 0x00000001 // alternate gravity setting#define MF2_WINDTHRUST 0x00000002 // gets pushed around by the wind // specials#define MF2_FLOORBOUNCE 0x00000004 // bounces off the floor#define MF2_BLASTED 0x00000008 // missile will pass through ghosts#define MF2_FLY 0x00000010 // fly mode is active#define MF2_FLOORCLIP 0x00000020 // if feet are allowed to be clipped#define MF2_SPAWNFLOAT 0x00000040 // spawn random float z#define MF2_NOTELEPORT 0x00000080 // does not teleport#define MF2_RIP 0x00000100 // missile rips through solid // targets#define MF2_PUSHABLE 0x00000200 // can be pushed by other moving // mobjs#define MF2_SLIDE 0x00000400 // slides against walls#define MF2_ONMOBJ 0x00000800 // mobj is resting on top of another // mobj#define MF2_PASSMOBJ 0x00001000 // Enable z block checking. If on, // this flag will allow the mobj to // pass over/under other mobjs.#define MF2_CANNOTPUSH 0x00002000 // cannot push other pushable mobjs#define MF2_DROPPED 0x00004000 // dropped by a demon#define MF2_BOSS 0x00008000 // mobj is a major boss#define MF2_FIREDAMAGE 0x00010000 // does fire damage#define MF2_NODMGTHRUST 0x00020000 // does not thrust target when // damaging#define MF2_TELESTOMP 0x00040000 // mobj can stomp another#define MF2_FLOATBOB 0x00080000 // use float bobbing z movement#define MF2_DONTDRAW 0x00100000 // don't generate a vissprite#define MF2_IMPACT 0x00200000 // an MF_MISSILE mobj can activate // SPAC_IMPACT#define MF2_PUSHWALL 0x00400000 // mobj can push walls#define MF2_MCROSS 0x00800000 // can activate monster cross lines#define MF2_PCROSS 0x01000000 // can activate projectile cross lines#define MF2_CANTLEAVEFLOORPIC 0x02000000 // stay within a certain floor type#define MF2_NONSHOOTABLE 0x04000000 // mobj is totally non-shootable, // but still considered solid#define MF2_INVULNERABLE 0x08000000 // mobj is invulnerable#define MF2_DORMANT 0x10000000 // thing is dormant#define MF2_ICEDAMAGE 0x20000000 // does ice damage#define MF2_SEEKERMISSILE 0x40000000 // is a seeker (for reflection)#define MF2_REFLECTIVE 0x80000000 // reflects missiles//=============================================================================// ===== Player Class Types =====typedef enum{ PCLASS_FIGHTER, PCLASS_CLERIC, PCLASS_MAGE, PCLASS_PIG, NUMCLASSES} pclass_t;typedef enum{ PST_LIVE, // playing PST_DEAD, // dead on the ground PST_REBORN // ready to restart} playerstate_t;// psprites are scaled shapes directly on the view screen// coordinates are given for a 320*200 view screentypedef enum{ ps_weapon, ps_flash, NUMPSPRITES} psprnum_t;typedef struct{ state_t *state; // a NULL state means not active int tics; fixed_t sx, sy;} pspdef_t;/* Old Heretic key typetypedef enum{ key_yellow, key_green, key_blue, NUMKEYS} keytype_t;*/typedef enum{ KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, KEY_A, KEY_B, NUMKEYS} keytype_t;typedef enum{ ARMOR_ARMOR, ARMOR_SHIELD, ARMOR_HELMET, ARMOR_AMULET,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -