6 #include "ID_HEADS.H"
\r
10 #include "WL_MENU.H"
\r
13 #include "SPANISH.H"
\r
15 #include "FOREIGN.H"
\r
19 #include "F_SPEAR.H"
\r
23 =============================================================================
\r
27 =============================================================================
\r
31 #define COLORBORDER(color) asm{mov dx,STATUS_REGISTER_1;in al,dx;\
\r
32 mov dx,ATR_INDEX;mov al,ATR_OVERSCAN;out dx,al;mov al,color;out dx,al;\
\r
33 mov al,32;out dx,al};
\r
35 #define MAPSPOT(x,y,plane) (*(mapsegs[plane]+farmapylookup[y]+x))
\r
37 #define SIGN(x) ((x)>0?1:-1)
\r
38 #define ABS(x) ((int)(x)>0?(x):-(x))
\r
39 #define LABS(x) ((long)(x)>0?(x):-(x))
\r
42 =============================================================================
\r
46 =============================================================================
\r
49 #define MAXACTORS 150 // max number of nazis, etc / map
\r
50 #define MAXSTATS 400 // max number of lamps, bonus, etc
\r
51 #define MAXDOORS 64 // max number of sliding doors
\r
52 #define MAXWALLTILES 64 // max number of wall tiles
\r
58 #define ICONARROWS 90
\r
59 #define PUSHABLETILE 98
\r
60 #define EXITTILE 99 // at end of castle
\r
61 #define AREATILE 107 // first of NUMAREAS floor tiles
\r
63 #define ELEVATORTILE 21
\r
64 #define AMBUSHTILE 106
\r
65 #define ALTELEVATORTILE 107
\r
67 #define NUMBERCHARS 9
\r
72 #define EXTRAPOINTS 40000
\r
74 #define PLAYERSPEED 3000
\r
75 #define RUNSPEED 6000
\r
77 #define SCREENSEG 0xa000
\r
79 #define SCREENBWIDE 80
\r
81 #define HEIGHTRATIO 0.50 // also defined in id_mm.c
\r
83 #define BORDERCOLOR 3
\r
84 #define FLASHCOLOR 5
\r
88 #define PLAYERSIZE MINDIST // player radius
\r
89 #define MINACTORDIST 0x10000l // minimum dist from player center
\r
90 // to any actor center
\r
92 #define NUMLATCHPICS 100
\r
95 #define PI 3.141592657
\r
97 #define GLOBAL1 (1l<<16)
\r
98 #define TILEGLOBAL GLOBAL1
\r
99 #define PIXGLOBAL (GLOBAL1/64)
\r
100 #define TILESHIFT 16l
\r
101 #define UNSIGNEDSHIFT 8
\r
103 #define ANGLES 360 // must be divisable by 4
\r
104 #define ANGLEQUAD (ANGLES/4)
\r
105 #define FINEANGLES 3600
\r
106 #define ANG90 (FINEANGLES/4)
\r
107 #define ANG180 (ANG90*2)
\r
108 #define ANG270 (ANG90*3)
\r
109 #define ANG360 (ANG90*4)
\r
110 #define VANG90 (ANGLES/4)
\r
111 #define VANG180 (VANG90*2)
\r
112 #define VANG270 (VANG90*3)
\r
113 #define VANG360 (VANG90*4)
\r
115 #define MINDIST (0x5800l)
\r
118 #define MAXSCALEHEIGHT 256 // largest scale on largest view
\r
120 #define MAXVIEWWIDTH 320
\r
122 #define MAPSIZE 64 // maps are 64*64 max
\r
129 #define STATUSLINES 40
\r
131 #define SCREENSIZE (SCREENBWIDE*208)
\r
132 #define PAGE1START 0
\r
133 #define PAGE2START (SCREENSIZE)
\r
134 #define PAGE3START (SCREENSIZE*2u)
\r
135 #define FREESTART (SCREENSIZE*3u)
\r
138 #define PIXRADIUS 512
\r
140 #define STARTAMMO 8
\r
143 // object flag values
\r
145 #define FL_SHOOTABLE 1
\r
147 #define FL_NEVERMARK 4
\r
148 #define FL_VISABLE 8
\r
149 #define FL_ATTACKMODE 16
\r
150 #define FL_FIRSTATTACK 32
\r
151 #define FL_AMBUSH 64
\r
152 #define FL_NONMARK 128
\r
156 // sprite constants
\r
165 SPR_STAT_0,SPR_STAT_1,SPR_STAT_2,SPR_STAT_3,
\r
166 SPR_STAT_4,SPR_STAT_5,SPR_STAT_6,SPR_STAT_7,
\r
168 SPR_STAT_8,SPR_STAT_9,SPR_STAT_10,SPR_STAT_11,
\r
169 SPR_STAT_12,SPR_STAT_13,SPR_STAT_14,SPR_STAT_15,
\r
171 SPR_STAT_16,SPR_STAT_17,SPR_STAT_18,SPR_STAT_19,
\r
172 SPR_STAT_20,SPR_STAT_21,SPR_STAT_22,SPR_STAT_23,
\r
174 SPR_STAT_24,SPR_STAT_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ABB_SHOOT1,SPR_SCHABB_SHOOT2,
\r
320 SPR_SCHABB_DIE1,SPR_SCHABB_DIE2,SPR_SCHABB_DIE3,SPR_SCHABB_DEAD,
\r
321 SPR_HYPO1,SPR_HYPO2,SPR_HYPO3,SPR_HYPO4,
\r
326 SPR_FAKE_W1,SPR_FAKE_W2,SPR_FAKE_W3,SPR_FAKE_W4,
\r
327 SPR_FAKE_SHOOT,SPR_FIRE1,SPR_FIRE2,
\r
329 SPR_FAKE_DIE1,SPR_FAKE_DIE2,SPR_FAKE_DIE3,SPR_FAKE_DIE4,
\r
330 SPR_FAKE_DIE5,SPR_FAKE_DEAD,
\r
335 SPR_MECHA_W1,SPR_MECHA_W2,SPR_MECHA_W3,SPR_MECHA_W4,
\r
336 SPR_MECHA_SHOOT1,SPR_MECHA_SHOOT2,SPR_MECHA_SHOOT3,SPR_MECHA_DEAD,
\r
338 SPR_MECHA_DIE1,SPR_MECHA_DIE2,SPR_MECHA_DIE3,
\r
340 SPR_HITLER_W1,SPR_HITLER_W2,SPR_HITLER_W3,SPR_HITLER_W4,
\r
341 SPR_HITLER_SHOOT1,SPR_HITLER_SHOOT2,SPR_HITLER_SHOOT3,SPR_HITLER_DEAD,
\r
343 SPR_HITLER_DIE1,SPR_HITLER_DIE2,SPR_HITLER_DIE3,SPR_HITLER_DIE4,
\r
344 SPR_HITLER_DIE5,SPR_HITLER_DIE6,SPR_HITLER_DIE7,
\r
349 SPR_GIFT_W1,SPR_GIFT_W2,SPR_GIFT_W3,SPR_GIFT_W4,
\r
350 SPR_GIFT_SHOOT1,SPR_GIFT_SHOOT2,
\r
352 SPR_GIFT_DIE1,SPR_GIFT_DIE2,SPR_GIFT_DIE3,SPR_GIFT_DEAD,
\r
355 // Rocket, smoke and small explosion
\r
357 SPR_ROCKET_1,SPR_ROCKET_2,SPR_ROCKET_3,SPR_ROCKET_4,
\r
358 SPR_ROCKET_5,SPR_ROCKET_6,SPR_ROCKET_7,SPR_ROCKET_8,
\r
360 SPR_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DIE3,
\r
414 SPR_WILL_W1,SPR_WILL_W2,SPR_WILL_W3,SPR_WILL_W4,
\r
415 SPR_WILL_SHOOT1,SPR_WILL_SHOOT2,SPR_WILL_SHOOT3,SPR_WILL_SHOOT4,
\r
417 SPR_WILL_DIE1,SPR_WILL_DIE2,SPR_WILL_DIE3,SPR_WILL_DEAD,
\r
422 SPR_UBER_W1,SPR_UBER_W2,SPR_UBER_W3,SPR_UBER_W4,
\r
423 SPR_UBER_SHOOT1,SPR_UBER_SHOOT2,SPR_UBER_SHOOT3,SPR_UBER_SHOOT4,
\r
425 SPR_UBER_DIE1,SPR_UBER_DIE2,SPR_UBER_DIE3,SPR_UBER_DIE4,
\r
431 SPR_DEATH_W1,SPR_DEATH_W2,SPR_DEATH_W3,SPR_DEATH_W4,
\r
432 SPR_DEATH_SHOOT1,SPR_DEATH_SHOOT2,SPR_DEATH_SHOOT3,SPR_DEATH_SHOOT4,
\r
434 SPR_DEATH_DIE1,SPR_DEATH_DIE2,SPR_DEATH_DIE3,SPR_DEATH_DIE4,
\r
435 SPR_DEATH_DIE5,SPR_DEATH_DIE6,SPR_DEATH_DEAD,
\r
440 SPR_SPECTRE_W1,SPR_SPECTRE_W2,SPR_SPECTRE_W3,SPR_SPECTRE_W4,
\r
441 SPR_SPECTRE_F1,SPR_SPECTRE_F2,SPR_SPECTRE_F3,SPR_SPECTRE_F4,
\r
446 SPR_ANGEL_W1,SPR_ANGEL_W2,SPR_ANGEL_W3,SPR_ANGEL_W4,
\r
447 SPR_ANGEL_SHOOT1,SPR_ANGEL_SHOOT2,SPR_ANGEL_TIRED1,SPR_ANGEL_TIRED2,
\r
449 SPR_ANGEL_DIE1,SPR_ANGEL_DIE2,SPR_ANGEL_DIE3,SPR_ANGEL_DIE4,
\r
450 SPR_ANGEL_DIE5,SPR_ANGEL_DIE6,SPR_ANGEL_DIE7,SPR_ANGEL_DEAD,
\r
455 // player attack frames
\r
457 SPR_KNIFEREADY,SPR_KNIFEATK1,SPR_KNIFEATK2,SPR_KNIFEATK3,
\r
460 SPR_PISTOLREADY,SPR_PISTOLATK1,SPR_PISTOLATK2,SPR_PISTOLATK3,
\r
463 SPR_MACHINEGUNREADY,SPR_MACHINEGUNATK1,SPR_MACHINEGUNATK2,MACHINEGUNATK3,
\r
464 SPR_MACHINEGUNATK4,
\r
466 SPR_CHAINREADY,SPR_CHAINATK1,SPR_CHAINATK2,SPR_CHAINATK3,
\r
473 =============================================================================
\r
477 =============================================================================
\r
480 typedef long fixed;
\r
575 #define NUMENEMIES 22
\r
602 typedef struct statestruct
\r
605 int shapenum; // a shapenum of -1 means get from ob->temp1
\r
607 void (*think) (),(*action) ();
\r
608 struct statestruct *next;
\r
612 //---------------------
\r
614 // trivial actor structure
\r
616 //---------------------
\r
618 typedef struct statstruct
\r
622 int shapenum; // if shapenum == -1 the obj has been removed
\r
628 //---------------------
\r
630 // door actor structure
\r
632 //---------------------
\r
634 typedef struct doorstruct
\r
639 enum {dr_open,dr_closed,dr_opening,dr_closing} action;
\r
644 //--------------------
\r
646 // thinking actor structure
\r
648 //--------------------
\r
650 typedef struct objstruct
\r
657 byte flags; // FL_SHOOTABLE, etc
\r
659 long distance; // if negative, wait for that door to open
\r
663 unsigned tilex,tiley;
\r
667 unsigned viewheight;
\r
668 fixed transx,transy; // in global coord
\r
674 int temp1,temp2,temp3;
\r
675 struct objstruct *next,*prev;
\r
679 #define NUMBUTTONS 8
\r
688 bt_readymachinegun,
\r
693 #define NUMWEAPONS 5
\r
711 // gamestate structure
\r
719 long oldscore,score,nextextra;
\r
724 weapontype bestweapon,weapon,chosenweapon;
\r
727 int attackframe,attackcount,weaponframe;
\r
729 int episode,secretcount,treasurecount,killcount,
\r
730 secrettotal,treasuretotal,killtotal;
\r
733 boolean victoryflag; // set during victory animations
\r
752 =============================================================================
\r
754 WL_MAIN DEFINITIONS
\r
756 =============================================================================
\r
759 extern boolean MS_CheckParm (char far *string);
\r
761 extern char str[80],str2[20];
\r
762 extern int tedlevelnum;
\r
763 extern boolean tedlevel;
\r
764 extern boolean nospr;
\r
765 extern boolean IsA386;
\r
767 extern byte far *scalermemory;
\r
769 extern fixed focallength;
\r
770 extern unsigned viewangles;
\r
771 extern unsigned screenofs;
\r
772 extern int viewwidth;
\r
773 extern int viewheight;
\r
774 extern int centerx;
\r
775 extern int shootdelta;
\r
777 extern int dirangle[9];
\r
779 extern boolean startgame,loadedgame,virtualreality;
\r
780 extern int mouseadjustment;
\r
784 extern int pixelangle[MAXVIEWWIDTH];
\r
785 extern long far finetangent[FINEANGLES/4];
\r
786 extern fixed far sintable[],far *costable;
\r
789 // derived constants
\r
791 extern fixed scale,maxslope;
\r
792 extern long heightnumerator;
\r
793 extern int minheightdiv;
\r
795 extern char configname[13];
\r
799 void HelpScreens (void);
\r
800 void OrderingInfo (void);
\r
801 void TEDDeath(void);
\r
802 void Quit (char *error);
\r
803 void CalcProjection (long focal);
\r
804 boolean SetViewSize (unsigned width, unsigned height);
\r
805 void NewGame (int difficulty,int episode);
\r
806 void NewViewSize (int width);
\r
807 boolean LoadTheGame(int file,int x,int y);
\r
808 boolean SaveTheGame(int file,int x,int y);
\r
809 void ShowViewSize (int width);
\r
810 void ShutdownId (void);
\r
814 =============================================================================
\r
816 WL_GAME DEFINITIONS
\r
818 =============================================================================
\r
822 extern boolean ingame,fizzlein;
\r
823 extern unsigned latchpics[NUMLATCHPICS];
\r
824 extern gametype gamestate;
\r
825 extern int doornum;
\r
827 extern char demoname[13];
\r
829 extern long spearx,speary;
\r
830 extern unsigned spearangle;
\r
831 extern boolean spearflag;
\r
834 void DrawPlayBorder (void);
\r
835 void ScanInfoPlane (void);
\r
836 void SetupGameLevel (void);
\r
837 void NormalScreen (void);
\r
838 void DrawPlayScreen (void);
\r
839 void FizzleOut (void);
\r
840 void GameLoop (void);
\r
841 void ClearMemory (void);
\r
842 void PlayDemo (int demonumber);
\r
843 void RecordDemo (void);
\r
844 void DrawAllPlayBorder (void);
\r
845 void DrawHighScores(void);
\r
846 void DrawAllPlayBorderSides (void);
\r
850 #define PlaySoundLocTile(s,tx,ty) PlaySoundLocGlobal(s,(((long)(tx) << TILESHIFT) + (1L << (TILESHIFT - 1))),(((long)ty << TILESHIFT) + (1L << (TILESHIFT - 1))))
\r
851 #define PlaySoundLocActor(s,ob) PlaySoundLocGlobal(s,(ob)->x,(ob)->y)
\r
852 void PlaySoundLocGlobal(word s,fixed gx,fixed gy);
\r
853 void UpdateSoundLoc(void);
\r
857 =============================================================================
\r
859 WL_PLAY DEFINITIONS
\r
861 =============================================================================
\r
865 extern long funnyticount; // FOR FUNNY BJ FACE
\r
868 extern exit_t playstate;
\r
870 extern boolean madenoise;
\r
872 extern objtype objlist[MAXACTORS],*new,*obj,*player,*lastobj,
\r
873 *objfreelist,*killerobj;
\r
874 extern statobj_t statobjlist[MAXSTATS],*laststatobj;
\r
875 extern doorobj_t doorobjlist[MAXDOORS],*lastdoorobj;
\r
877 extern unsigned farmapylookup[MAPSIZE];
\r
878 extern byte *nearmapylookup[MAPSIZE];
\r
880 extern byte tilemap[MAPSIZE][MAPSIZE]; // wall values only
\r
881 extern byte spotvis[MAPSIZE][MAPSIZE];
\r
882 extern objtype *actorat[MAPSIZE][MAPSIZE];
\r
884 #define UPDATESIZE (UPDATEWIDE*UPDATEHIGH)
\r
885 extern byte update[UPDATESIZE];
\r
887 extern boolean singlestep,godmode,noclip;
\r
888 extern int extravbls;
\r
893 extern boolean mouseenabled,joystickenabled,joypadenabled,joystickprogressive;
\r
894 extern int joystickport;
\r
895 extern int dirscan[4];
\r
896 extern int buttonscan[NUMBUTTONS];
\r
897 extern int buttonmouse[4];
\r
898 extern int buttonjoy[4];
\r
900 extern boolean buttonheld[NUMBUTTONS];
\r
902 extern int viewsize;
\r
905 // curent user input
\r
907 extern int controlx,controly; // range from -100 to 100
\r
908 extern boolean buttonstate[NUMBUTTONS];
\r
910 extern boolean demorecord,demoplayback;
\r
911 extern char far *demoptr, far *lastdemoptr;
\r
912 extern memptr demobuffer;
\r
916 void InitRedShifts (void);
\r
917 void FinishPaletteShifts (void);
\r
919 void CenterWindow(word w,word h);
\r
920 void InitActorList (void);
\r
921 void GetNewActor (void);
\r
922 void RemoveObj (objtype *gone);
\r
923 void PollControls (void);
\r
924 void StopMusic(void);
\r
925 void StartMusic(void);
\r
926 void PlayLoop (void);
\r
927 void StartDamageFlash (int damage);
\r
928 void StartBonusFlash (void);
\r
931 =============================================================================
\r
935 =============================================================================
\r
938 void IntroScreen (void);
\r
939 void PreloadGraphics(void);
\r
940 void LevelCompleted (void);
\r
941 void CheckHighScore (long score,word other);
\r
942 void Victory (void);
\r
943 void ClearSplitVWB (void);
\r
947 =============================================================================
\r
951 =============================================================================
\r
954 int DebugKeys (void);
\r
955 void PicturePause (void);
\r
959 =============================================================================
\r
961 WL_DRAW DEFINITIONS
\r
963 =============================================================================
\r
966 extern unsigned screenloc[3];
\r
967 extern unsigned freelatch;
\r
969 extern long lasttimecount;
\r
970 extern long frameon;
\r
971 extern boolean fizzlein;
\r
973 extern unsigned wallheight[MAXVIEWWIDTH];
\r
975 extern fixed tileglobal;
\r
976 extern fixed focallength;
\r
977 extern fixed mindist;
\r
982 extern int pixelangle[MAXVIEWWIDTH];
\r
983 extern long far finetangent[FINEANGLES/4];
\r
984 extern fixed far sintable[],far *costable;
\r
987 // derived constants
\r
989 extern fixed scale;
\r
990 extern long heightnumerator,mindist;
\r
993 // refresh variables
\r
995 extern fixed viewx,viewy; // the focal point
\r
996 extern int viewangle;
\r
997 extern fixed viewsin,viewcos;
\r
999 extern long postsource;
\r
1000 extern unsigned postx;
\r
1001 extern unsigned postwidth;
\r
1004 extern int horizwall[],vertwall[];
\r
1006 extern unsigned pwallpos;
\r
1009 fixed FixedByFrac (fixed a, fixed b);
\r
1010 void TransformActor (objtype *ob);
\r
1011 void BuildTables (void);
\r
1012 void ClearScreen (void);
\r
1013 int CalcRotate (objtype *ob);
\r
1014 void DrawScaleds (void);
\r
1015 void CalcTics (void);
\r
1016 void FixOfs (void);
\r
1017 void ThreeDRefresh (void);
\r
1018 void FarScalePost (void);
\r
1021 =============================================================================
\r
1023 WL_STATE DEFINITIONS
\r
1025 =============================================================================
\r
1027 #define TURNTICS 10
\r
1028 #define SPDPATROL 512
\r
1029 #define SPDDOG 1500
\r
1032 extern dirtype opposite[9];
\r
1033 extern dirtype diagonal[9][9];
\r
1036 void InitHitRect (objtype *ob, unsigned radius);
\r
1037 void SpawnNewObj (unsigned tilex, unsigned tiley, statetype *state);
\r
1038 void NewState (objtype *ob, statetype *state);
\r
1040 boolean TryWalk (objtype *ob);
\r
1041 void SelectChaseDir (objtype *ob);
\r
1042 void SelectDodgeDir (objtype *ob);
\r
1043 void SelectRunDir (objtype *ob);
\r
1044 void MoveObj (objtype *ob, long move);
\r
1045 boolean SightPlayer (objtype *ob);
\r
1047 void KillActor (objtype *ob);
\r
1048 void DamageActor (objtype *ob, unsigned damage);
\r
1050 boolean CheckLine (objtype *ob);
\r
1051 boolean CheckSight (objtype *ob);
\r
1055 =============================================================================
\r
1057 WL_SCALE DEFINITIONS
\r
1059 =============================================================================
\r
1063 #define COMPSCALECODESTART (65*4) // offset to start of code in comp scaler
\r
1067 unsigned codeofs[65];
\r
1068 unsigned width[65];
\r
1074 unsigned leftpix,rightpix;
\r
1075 unsigned dataofs[64];
\r
1076 // table data after dataofs[rightpix-leftpix+1]
\r
1080 extern t_compscale _seg *scaledirectory[MAXSCALEHEIGHT+1];
\r
1081 extern long fullscalefarcall[MAXSCALEHEIGHT+1];
\r
1083 extern byte bitmasks1[8][8];
\r
1084 extern byte bitmasks2[8][8];
\r
1085 extern unsigned wordmasks[8][8];
\r
1087 extern byte mapmasks1[4][8];
\r
1088 extern byte mapmasks2[4][8];
\r
1089 extern byte mapmasks3[4][8];
\r
1091 extern int maxscale,maxscaleshl2;
\r
1093 extern boolean insetupscaling;
\r
1095 void SetupScaling (int maxscaleheight);
\r
1096 void ScaleShape (int xcenter, int shapenum, unsigned height);
\r
1097 void SimpleScaleShape (int xcenter, int shapenum, unsigned height);
\r
1100 =============================================================================
\r
1102 WL_AGENT DEFINITIONS
\r
1104 =============================================================================
\r
1108 // player state info
\r
1110 extern boolean running;
\r
1111 extern long thrustspeed;
\r
1112 extern unsigned plux,pluy; // player coordinates scaled to unsigned
\r
1114 extern int anglefrac;
\r
1115 extern int facecount;
\r
1117 void SpawnPlayer (int tilex, int tiley, int dir);
\r
1118 void DrawFace (void);
\r
1119 void DrawHealth (void);
\r
1120 void TakeDamage (int points,objtype *attacker);
\r
1121 void HealSelf (int points);
\r
1122 void DrawLevel (void);
\r
1123 void DrawLives (void);
\r
1124 void GiveExtraMan (void);
\r
1125 void DrawScore (void);
\r
1126 void GivePoints (long points);
\r
1127 void DrawWeapon (void);
\r
1128 void DrawKeys (void);
\r
1129 void GiveWeapon (int weapon);
\r
1130 void DrawAmmo (void);
\r
1131 void GiveAmmo (int ammo);
\r
1132 void GiveKey (int key);
\r
1133 void GetBonus (statobj_t *check);
\r
1135 void Thrust (int angle, long speed);
\r
1138 =============================================================================
\r
1140 WL_ACT1 DEFINITIONS
\r
1142 =============================================================================
\r
1145 extern doorobj_t doorobjlist[MAXDOORS],*lastdoorobj;
\r
1146 extern int doornum;
\r
1148 extern unsigned doorposition[MAXDOORS],pwallstate;
\r
1150 extern byte far areaconnect[NUMAREAS][NUMAREAS];
\r
1152 extern boolean areabyplayer[NUMAREAS];
\r
1154 extern unsigned pwallstate;
\r
1155 extern unsigned pwallpos; // amount a pushable wall has been moved (0-63)
\r
1156 extern unsigned pwallx,pwally;
\r
1157 extern int pwalldir;
\r
1160 void InitDoorList (void);
\r
1161 void InitStaticList (void);
\r
1162 void SpawnStatic (int tilex, int tiley, int type);
\r
1163 void SpawnDoor (int tilex, int tiley, boolean vertical, int lock);
\r
1164 void MoveDoors (void);
\r
1165 void MovePWalls (void);
\r
1166 void OpenDoor (int door);
\r
1167 void PlaceItemType (int itemtype, int tilex, int tiley);
\r
1168 void PushWall (int checkx, int checky, int dir);
\r
1169 void OperateDoor (int door);
\r
1170 void InitAreas (void);
\r
1173 =============================================================================
\r
1175 WL_ACT2 DEFINITIONS
\r
1177 =============================================================================
\r
1180 #define s_nakedbody s_static10
\r
1182 extern statetype s_grddie1;
\r
1183 extern statetype s_dogdie1;
\r
1184 extern statetype s_ofcdie1;
\r
1185 extern statetype s_mutdie1;
\r
1186 extern statetype s_ssdie1;
\r
1187 extern statetype s_bossdie1;
\r
1188 extern statetype s_schabbdie1;
\r
1189 extern statetype s_fakedie1;
\r
1190 extern statetype s_mechadie1;
\r
1191 extern statetype s_hitlerdie1;
\r
1192 extern statetype s_greteldie1;
\r
1193 extern statetype s_giftdie1;
\r
1194 extern statetype s_fatdie1;
\r
1196 extern statetype s_spectredie1;
\r
1197 extern statetype s_angeldie1;
\r
1198 extern statetype s_transdie0;
\r
1199 extern statetype s_uberdie0;
\r
1200 extern statetype s_willdie1;
\r
1201 extern statetype s_deathdie1;
\r
1204 extern statetype s_grdchase1;
\r
1205 extern statetype s_dogchase1;
\r
1206 extern statetype s_ofcchase1;
\r
1207 extern statetype s_sschase1;
\r
1208 extern statetype s_mutchase1;
\r
1209 extern statetype s_bosschase1;
\r
1210 extern statetype s_schabbchase1;
\r
1211 extern statetype s_fakechase1;
\r
1212 extern statetype s_mechachase1;
\r
1213 extern statetype s_gretelchase1;
\r
1214 extern statetype s_giftchase1;
\r
1215 extern statetype s_fatchase1;
\r
1217 extern statetype s_spectrechase1;
\r
1218 extern statetype s_angelchase1;
\r
1219 extern statetype s_transchase1;
\r
1220 extern statetype s_uberchase1;
\r
1221 extern statetype s_willchase1;
\r
1222 extern statetype s_deathchase1;
\r
1224 extern statetype s_blinkychase1;
\r
1225 extern statetype s_hitlerchase1;
\r
1227 extern statetype s_grdpain;
\r
1228 extern statetype s_grdpain1;
\r
1229 extern statetype s_ofcpain;
\r
1230 extern statetype s_ofcpain1;
\r
1231 extern statetype s_sspain;
\r
1232 extern statetype s_sspain1;
\r
1233 extern statetype s_mutpain;
\r
1234 extern statetype s_mutpain1;
\r
1236 extern statetype s_deathcam;
\r
1238 extern statetype s_schabbdeathcam2;
\r
1239 extern statetype s_hitlerdeathcam2;
\r
1240 extern statetype s_giftdeathcam2;
\r
1241 extern statetype s_fatdeathcam2;
\r
1243 void SpawnStand (enemy_t which, int tilex, int tiley, int dir);
\r
1244 void SpawnPatrol (enemy_t which, int tilex, int tiley, int dir);
\r
1245 void KillActor (objtype *ob);
\r
1247 void US_ControlPanel(byte);
\r
1249 void SpawnDeadGuard (int tilex, int tiley);
\r
1250 void SpawnBoss (int tilex, int tiley);
\r
1251 void SpawnGretel (int tilex, int tiley);
\r
1252 void SpawnTrans (int tilex, int tiley);
\r
1253 void SpawnUber (int tilex, int tiley);
\r
1254 void SpawnWill (int tilex, int tiley);
\r
1255 void SpawnDeath (int tilex, int tiley);
\r
1256 void SpawnAngel (int tilex, int tiley);
\r
1257 void SpawnSpectre (int tilex, int tiley);
\r
1258 void SpawnGhosts (int which, int tilex, int tiley);
\r
1259 void SpawnSchabbs (int tilex, int tiley);
\r
1260 void SpawnGift (int tilex, int tiley);
\r
1261 void SpawnFat (int tilex, int tiley);
\r
1262 void SpawnFakeHitler (int tilex, int tiley);
\r
1263 void SpawnHitler (int tilex, int tiley);
\r
1266 =============================================================================
\r
1268 WL_TEXT DEFINITIONS
\r
1270 =============================================================================
\r
1273 extern char helpfilename[],endfilename[];
\r
1275 extern void HelpScreens(void);
\r
1276 extern void EndText(void);
\r