#ifndef __WL_DEF_H__ #define __WL_DEF_H__ #include "id_heads.h" #include "wl_menu.h" #include "foreign.h" extern int vwidth, vheight; /* size of screen */ /* ============================================================================= GLOBAL CONSTANTS ============================================================================= */ #define MAXACTORS 150 // max number of nazis, etc / map #define MAXSTATS 400 // max number of lamps, bonus, etc #define MAXDOORS 64 // max number of sliding doors #define MAXWALLTILES 64 // max number of wall tiles // // tile constants // #define ICONARROWS 90 #define PUSHABLETILE 98 #define EXITTILE 99 // at end of castle #define AREATILE 107 // first of NUMAREAS floor tiles #define NUMAREAS 37 #define ELEVATORTILE 21 #define AMBUSHTILE 106 #define ALTELEVATORTILE 107 #define HEIGHTRATIO 0.50 //---------------- #define EXTRAPOINTS 40000 #define RUNSPEED 6000 #define PLAYERSIZE MINDIST /* player radius */ #define MINACTORDIST 0x10000 /* minimum dist from player center */ /* to any actor center */ #define TILESHIFT 16 #define UNSIGNEDSHIFT (TILESHIFT-8) #define GLOBAL1 (1<temp1 */ int tictime; void (*think)(), (*action)(); int next; /* stateenum */ } statetype; //--------------------- // // trivial actor structure // //--------------------- typedef struct statstruct { byte tilex,tiley; byte *visspot; int shapenum; /* if shapenum == -1 the obj has been removed */ byte flags; byte itemnumber; } statobj_t; //--------------------- // // door actor structure // //--------------------- typedef struct doorstruct { byte tilex,tiley; boolean vertical; byte lock; enum {dr_open,dr_closed,dr_opening,dr_closing} action; int ticcount; } doorobj_t; //-------------------- // // thinking actor structure // //-------------------- typedef struct objstruct { int id; activetype active; int ticcount; classtype obclass; int state; /* stateenum */ byte flags; /* FL_SHOOTABLE, etc */ long distance; /* if negative, wait for that door to open */ dirtype dir; fixed x,y; unsigned tilex,tiley; byte areanumber; int viewx; unsigned viewheight; fixed transx, transy; /* in global coord */ int angle; int hitpoints; long speed; int temp1,temp2,temp3; struct objstruct *next,*prev; } objtype; #define NUMBUTTONS 8 enum { bt_nobutton=-1, bt_attack=0, bt_strafe, bt_run, bt_use, bt_readyknife, bt_readypistol, bt_readymachinegun, bt_readychaingun }; #define NUMWEAPONS 4 typedef enum { wp_knife, wp_pistol, wp_machinegun, wp_chaingun } weapontype; enum { gd_baby, gd_easy, gd_medium, gd_hard }; //--------------- // // gamestate structure // //--------------- typedef struct { int difficulty; int mapon; long oldscore,score,nextextra; int lives; int health; int ammo; int keys; weapontype bestweapon,weapon,chosenweapon; int faceframe; int attackframe,attackcount,weaponframe; int episode,secretcount,treasurecount,killcount, secrettotal,treasuretotal,killtotal; long TimeCount; long killx,killy; boolean victoryflag; // set during victory animations } gametype; typedef enum { ex_stillplaying, ex_completed, ex_died, ex_warped, ex_resetgame, ex_loadedgame, ex_victorious, ex_abort, ex_demodone, ex_secretlevel } exit_t; /* ============================================================================= WL_MAIN DEFINITIONS ============================================================================= */ extern char str[80], str2[20]; extern int viewwidth, viewheight; extern int viewwidthwin, viewheightwin; extern int xoffset, yoffset; extern int centerx; extern int shootdelta; extern boolean startgame,loadedgame; extern int mouseadjustment; /* math tables */ extern int pixelangle[MAXVIEWWIDTH]; extern long finetangent[FINEANGLES/4]; extern fixed sintable[], *costable; extern char configname[13]; void CalcProjection(long focal); void NewGame(int difficulty,int episode); void NewViewSize(int width); void ShowViewSize(int width); int LoadTheGame(char *fn, int x, int y); int SaveTheGame(char *fn, char *tag, int x, int y); int ReadSaveTag(char *fn, char *tag); void ShutdownId(); int WriteConfig(); int WolfMain(int argc, char *argv[]); /* ============================================================================= WL_GAME DEFINITIONS ============================================================================= */ extern boolean ingame; extern gametype gamestate; extern int doornum; extern char demoname[13]; extern long spearx,speary; extern unsigned spearangle; extern boolean spearflag; void ScanInfoPlane (void); void SetupGameLevel (void); void DrawPlayScreen (void); void GameLoop (void); void ClearMemory (void); void PlayDemo(int demonumber); int PlayDemoFromFile(char *demoname); void RecordDemo(); void DrawHighScores(); void DrawPlayBorder(); void DrawPlayBorderSides(); void DrawStatusBar(); #define PlaySoundLocTile(s,tx,ty) PlaySoundLocGlobal(s,(int)((tx<<6)|(ty)), (tx << TILESHIFT) + (1 << (TILESHIFT - 1)), (ty << TILESHIFT) + (1L << (TILESHIFT - 1))) #define PlaySoundLocActor(s,ob) PlaySoundLocGlobal(s,(int)ob,(ob)->x,(ob)->y) /* ============================================================================= WL_PLAY DEFINITIONS ============================================================================= */ extern long funnyticount; // FOR FUNNY BJ FACE extern exit_t playstate; extern boolean madenoise; extern objtype objlist[MAXACTORS],*new,*obj,*player,*lastobj, *objfreelist,*killerobj; extern statobj_t statobjlist[MAXSTATS],*laststatobj; extern doorobj_t doorobjlist[MAXDOORS],*lastdoorobj; extern unsigned farmapylookup[MAPSIZE]; extern byte tilemap[MAPSIZE][MAPSIZE]; // wall values only extern byte spotvis[MAPSIZE][MAPSIZE]; extern int actorat[MAPSIZE][MAPSIZE]; extern boolean singlestep,godmode,noclip; // // control info // extern boolean mouseenabled,joystickenabled,joypadenabled; extern int joystickport; extern int dirscan[4]; extern int buttonscan[NUMBUTTONS]; extern int buttonmouse[4]; extern int buttonjoy[4]; extern boolean buttonheld[NUMBUTTONS]; extern int viewsize; // // curent user input // extern int controlx,controly; // range from -100 to 100 extern boolean buttonstate[NUMBUTTONS]; extern boolean demorecord,demoplayback; extern byte *demoptr, *lastdemoptr; extern memptr demobuffer; void StatusDrawPic(unsigned x, unsigned y, unsigned picnum); void InitRedShifts (void); void FinishPaletteShifts (void); void CenterWindow(word w,word h); void InitActorList (void); void GetNewActor (void); void StopMusic(void); void StartMusic(void); void PlayLoop (void); void StartDamageFlash (int damage); void StartBonusFlash (void); /* ============================================================================= WL_INTER ============================================================================= */ void IntroScreen (void); void PreloadGraphics(void); void LevelCompleted (void); void CheckHighScore (long score,word other); void Victory (void); void ClearSplitVWB (void); void PG13(); /* ============================================================================= WL_DEBUG ============================================================================= */ int DebugKeys (void); void PicturePause (void); /* ============================================================================= WL_DRAW DEFINITIONS ============================================================================= */ extern long lasttimecount; extern long frameon; /* refresh variables */ extern fixed viewx, viewy; /* the focal point */ extern fixed viewsin, viewcos; extern int horizwall[], vertwall[]; fixed FixedByFrac(fixed a, fixed b); void BuildTables(); void CalcTics(); void ThreeDRefresh(); void FizzleFade(boolean abortable, int frames, int color); /* ============================================================================= WL_STATE DEFINITIONS ============================================================================= */ #define SPDPATROL 512 #define SPDDOG 1500 void SpawnNewObj(unsigned tilex, unsigned tiley, int state); /* stateenum */ void NewState(objtype *ob, int state); /* stateenum */ boolean TryWalk (objtype *ob); void SelectChaseDir (objtype *ob); void SelectDodgeDir (objtype *ob); void SelectRunDir (objtype *ob); void MoveObj (objtype *ob, long move); boolean SightPlayer (objtype *ob); void KillActor (objtype *ob); void DamageActor (objtype *ob, unsigned damage); boolean CheckLine (objtype *ob); boolean CheckSight (objtype *ob); /* ============================================================================= WL_AGENT DEFINITIONS ============================================================================= */ // // player state info // extern long thrustspeed; extern unsigned plux,pluy; // player coordinates scaled to unsigned extern int anglefrac; extern int facecount; void SpawnPlayer (int tilex, int tiley, int dir); void DrawFace (void); void DrawHealth (void); void TakeDamage (int points,objtype *attacker); void HealSelf (int points); void DrawLevel (void); void DrawLives (void); void GiveExtraMan (void); void DrawScore (void); void GivePoints (long points); void DrawWeapon (void); void DrawKeys (void); void GiveWeapon (int weapon); void DrawAmmo (void); void GiveAmmo (int ammo); void GiveKey (int key); void GetBonus (statobj_t *check); void Thrust (int angle, long speed); /* ============================================================================= WL_ACT1 DEFINITIONS ============================================================================= */ extern doorobj_t doorobjlist[MAXDOORS],*lastdoorobj; extern int doornum; extern unsigned doorposition[MAXDOORS],pwallstate; extern byte areaconnect[NUMAREAS][NUMAREAS]; extern boolean areabyplayer[NUMAREAS]; extern unsigned pwallstate; extern unsigned pwallpos; // amount a pushable wall has been moved (0-63) extern unsigned pwallx,pwally; extern int pwalldir; void InitDoorList (void); void InitStaticList (void); void SpawnStatic (int tilex, int tiley, int type); void SpawnDoor (int tilex, int tiley, boolean vertical, int lock); void MoveDoors (void); void MovePWalls (void); void OpenDoor (int door); void PlaceItemType (int itemtype, int tilex, int tiley); void PushWall (int checkx, int checky, int dir); void OperateDoor (int door); void InitAreas (void); /* ============================================================================= WL_ACT2 DEFINITIONS ============================================================================= */ void A_DeathScream(objtype *ob); void SpawnBJVictory(void); void SpawnStand (enemy_t which, int tilex, int tiley, int dir); void SpawnPatrol (enemy_t which, int tilex, int tiley, int dir); void US_ControlPanel(byte); void SpawnDeadGuard (int tilex, int tiley); void SpawnBoss (int tilex, int tiley); void SpawnGretel (int tilex, int tiley); void SpawnTrans (int tilex, int tiley); void SpawnUber (int tilex, int tiley); void SpawnWill (int tilex, int tiley); void SpawnDeath (int tilex, int tiley); void SpawnAngel (int tilex, int tiley); void SpawnSpectre (int tilex, int tiley); void SpawnGhosts (int which, int tilex, int tiley); void SpawnSchabbs (int tilex, int tiley); void SpawnGift (int tilex, int tiley); void SpawnFat (int tilex, int tiley); void SpawnFakeHitler (int tilex, int tiley); void SpawnHitler (int tilex, int tiley); /* ============================================================================= WL_TEXT DEFINITIONS ============================================================================= */ extern void HelpScreens(); extern void EndText(); #include "wl_act3.h" #endif