DEF.H 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865
  1. /* Catacomb Armageddon Source Code
  2. * Copyright (C) 1993-2014 Flat Rock Software
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (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. * You should have received a copy of the GNU General Public License along
  15. * with this program; if not, write to the Free Software Foundation, Inc.,
  16. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  17. */
  18. #include "ID_HEADS.H"
  19. #include <MATH.H>
  20. #include <VALUES.H>
  21. //#define PROFILE
  22. #define DEBUG_KEYS_AVAILABLE 0
  23. /*
  24. =============================================================================
  25. GLOBAL CONSTANTS
  26. =============================================================================
  27. */
  28. //
  29. // SOFTLIB GFX FILENAME
  30. //
  31. #define SLIB_GFX "ARM_SLIB."EXT
  32. #define USE_INERT_LIST false
  33. //
  34. // MAX_BASE - represents 100 percent in 1st base
  35. // MAX_PERC - represents 100 percent in 2nd base
  36. // PERC - fractional portion of 2nd base
  37. // SCALE - arbitrary scaling value (bigger number means more accurate)
  38. //
  39. // ex: PERCENTAGE(320,16,8,7) returns 160
  40. //
  41. // Make sure values used won't overflow a WORD! In general, if largest number
  42. // to be used (320 in ex: above) * (1<<SCALE) is greater than 65535, use
  43. // LONG_PERCENTAGE or a lower SCALE. Using a SCALE of 8 in the example
  44. // above would overflow a WORD in some circumstances!
  45. //
  46. // LONG_PERCENTAGE is to be used for larger SCALEs, thus, giving you
  47. // massive accuracy!
  48. //
  49. #define PERCENTAGE(MAX_BASE,MAX_PERC,PERC,SCALE) ((unsigned)(MAX_BASE*((PERC<<SCALE)/MAX_PERC))>>SCALE)
  50. #define LONG_PERCENTAGE(MAX_BASE,MAX_PERC,PERC,SCALE) (((long)MAX_BASE*(((long)PERC<<SCALE)/MAX_PERC))>>SCALE)
  51. #define PI 3.141592657
  52. //#define SIZE_TEST 65000
  53. #define SIZE_TEST 0
  54. #define FL_QUICK 0x01
  55. #define FL_NOMEMCHECK 0x02
  56. #define FL_HELPTEST 0x04
  57. #define FL_CLEAR (FL_QUICK|FL_NOMEMCHECK|FL_HELPTEST)
  58. #if 0
  59. #define GEM_SHIFT 2
  60. #define FL_RGEM 0x04
  61. #define FL_GGEM 0x08
  62. #define FL_BGEM 0x10
  63. #define FL_YGEM 0x20
  64. #define FL_PGEM 0x40
  65. #endif
  66. #define FL_DEAD 0x80
  67. #define MAXBOLTS 10
  68. #define MAXNUKES 10
  69. #define MAXPOTIONS 10
  70. #define NUKE_COST (1000)
  71. #define BOLT_COST (1200)
  72. #define POTION_COST (1300)
  73. #define NUKE_COST_TXT ("1000") // Allows for Q&D positioning..
  74. #define BOLT_COST_TXT ("1200")
  75. #define POTION_COST_TXT ("1300")
  76. #define RADARX 31 // bytes
  77. #define RADARY 11 // pixels
  78. #define RADAR_WIDTH 51 // "
  79. #define RADAR_HEIGHT 51 // "
  80. #define RADAR_XCENTER ((RADARX*8)+(RADAR_WIDTH/2)+3) // "
  81. #define RADAR_YCENTER ((RADARY-8)+(RADAR_HEIGHT/2)+5) // "
  82. #define MAX_RADAR_BLIPS 60
  83. #define RADAR_RADIUS 17
  84. #define RADAR_RADIUS_NSEW 15
  85. #define RADAR_X_IRADIUS (113/5)
  86. #define RADAR_Y_IRADIUS (113/7)
  87. #define RADAR_ICON_CENTER 4 // Center offset into icon.
  88. #define NAMESTART 180
  89. #define REMOVED_DOOR_TILE NAMESTART
  90. #define NEXT_LEVEL_CODE 0xff
  91. #define REMOVE_DOOR_CODE 0xfe
  92. #define CANT_OPEN_CODE 0xfd
  93. #define EXP_WALL_CODE 0xfc
  94. #define UNMARKGRCHUNK(chunk) (grneeded[chunk]&=~ca_levelbit)
  95. #define MOUSEINT 0x33
  96. #define EXPWALLSTART 8
  97. #define NUMEXPWALLS 7
  98. #define WALLEXP 59
  99. #define WATEREXP 62
  100. #define NUMFLOORS 80 //71
  101. #define NUMLATCHPICS (FIRSTWALLPIC-FIRSTLATCHPIC) //+5
  102. #define NUMSCALEPICS (FIRSTWALLPIC-FIRSTSCALEPIC) //+5
  103. #define NUMSCALEWALLS (LASTWALLPIC-FIRSTWALLPIC) //+5
  104. #define FLASHCOLOR 12
  105. #define FLASHTICS 4
  106. #define NUMLEVELS 32 //21
  107. #define VIEWX 0 // corner of view window
  108. #define VIEWY 0
  109. #define VIEWWIDTH (40*8) // size of view window // 33
  110. #define VIEWHEIGHT (15*8) // 18
  111. #define VIEWXH (VIEWX+VIEWWIDTH-1)
  112. #define VIEWYH (VIEWY+VIEWHEIGHT-1)
  113. #define CENTERX (VIEWX+VIEWWIDTH/2-1) // middle of view window
  114. #define CENTERY (VIEWY+VIEWHEIGHT/2-1)
  115. #define GLOBAL1 (1l<<16)
  116. #define TILEGLOBAL GLOBAL1
  117. #define TILESHIFT 16l
  118. #define MINDIST (2*GLOBAL1/5)
  119. #define FOCALLENGTH (TILEGLOBAL) // in global coordinates
  120. #define ANGLES 360 // must be divisable by 4
  121. #define MAPSIZE 64 // maps are 64*64 max
  122. #define MAXACTORS 100 // max number of tanks, etc / map
  123. #define NORTH 0
  124. #define EAST 1
  125. #define SOUTH 2
  126. #define WEST 3
  127. #define SIGN(x) ((x)>0?1:-1)
  128. #define ABS(x) ((int)(x)>0?(x):-(x))
  129. #define LABS(x) ((long)(x)>0?(x):-(x))
  130. #define MAXSCALE (VIEWWIDTH/2)
  131. #define MAXBODY 100
  132. #define MAXSHOTPOWER 56
  133. #define SCREEN1START 0
  134. #define SCREEN2START 8320
  135. #define STATUSLEN 0xc80
  136. #define PAGELEN 0x1700
  137. #define PAGE1START STATUSLEN
  138. #define PAGE2START (PAGE1START+PAGELEN)
  139. #define PAGE3START (PAGE2START+PAGELEN)
  140. #define FREESTART (PAGE3START+PAGELEN)
  141. #define PIXRADIUS 512
  142. #define STATUSLINES (200-VIEWHEIGHT)
  143. enum bonusnumbers {B_BOLT,B_NUKE,B_POTION,B_RKEY,B_YKEY,B_GKEY,B_BKEY,B_SCROLL1,
  144. B_SCROLL2,B_SCROLL3,B_SCROLL4,B_SCROLL5,B_SCROLL6,B_SCROLL7,B_SCROLL8,
  145. B_GOAL,B_CHEST,B_RGEM,B_GGEM,B_BGEM,B_YGEM,B_PGEM};
  146. #define MAX_DOOR_STORAGE 5
  147. #define GEM_DELAY_TIME (120*60)
  148. #define ROTATE_SPEED (6)
  149. #define WALL_SKELETON_CODE 6
  150. #define MAXREALTICS (2*60)
  151. #define MAXFREEZETIME (100*30) // 50 secs (100 half)
  152. #define INVISIBLEWALL 0x46
  153. #define USE_STRIPS FALSE
  154. /*
  155. =============================================================================
  156. GLOBAL TYPES
  157. =============================================================================
  158. */
  159. enum {BLANKCHAR=9,BOLTCHAR,NUKECHAR,POTIONCHAR,KEYCHARS,SCROLLCHARS=17,
  160. NUMBERCHARS=25};
  161. typedef long fixed;
  162. typedef struct {int x,y;} tilept;
  163. typedef struct {fixed x,y;} globpt;
  164. typedef struct
  165. {
  166. int x1,x2,leftclip,rightclip;// first pixel of wall (may not be visable)
  167. unsigned height1,height2,color,walllength,side;
  168. long planecoord;
  169. } walltype;
  170. typedef enum
  171. {nothing,playerobj,bonusobj,succubusobj,batobj,skeletonobj,fatdemonobj,godessobj,
  172. mageobj,pshotobj,bigpshotobj,mshotobj,inertobj,bounceobj,grelmobj,sshotobj,
  173. gateobj,zombieobj,antobj,wetobj,expobj,eyeobj,wallskelobj,eshotobj,treeobj,
  174. gshotobj,reddemonobj,freezeobj,solidobj,cloudobj,dshotobj,hbunnyobj,bunnyobj,
  175. realsolidobj} classtype;
  176. typedef enum {north,east,south,west,northeast,southeast,southwest,
  177. northwest,nodir} dirtype; // a catacombs 2 carryover
  178. typedef struct statestruct
  179. {
  180. int shapenum;
  181. int tictime;
  182. void (*think) ();
  183. struct statestruct far *next;
  184. } statetypestruct;
  185. #define statetype statetypestruct far
  186. #define of_shootable 0x01
  187. #define of_damagedone 0x02
  188. #define of_forcefield 0x40 // defines a solid object as a forcefield???????????
  189. #define of_tree 0x80 // used to identify between a tree and a statue --
  190. // last minute changes for Greg
  191. typedef struct objstruct
  192. {
  193. int ticcount; //
  194. statetype *state; // THESE MEMBERS MUST BE IN THE SAME
  195. fixed x,y; // ORDER AS THE MEMBERS DEFINED IN
  196. int viewx; // IOBJSTRUCT OR ALL HELL WILL BREAK
  197. unsigned tilex,tiley; // LOOSE!!
  198. unsigned viewheight; //
  199. unsigned size; //
  200. struct objstruct *next; //
  201. struct objstruct *prev;
  202. enum {no,noalways,yes,always} active;
  203. classtype obclass;
  204. unsigned char flags;
  205. long distance;
  206. dirtype dir;
  207. int angle;
  208. int hitpoints;
  209. long speed;
  210. fixed xl,xh,yl,yh; // hit rectangle
  211. int temp1,temp2;
  212. } objtype;
  213. #if USE_INERT_LIST
  214. #define MAXINERTOBJ 20
  215. typedef struct iobjstruct {
  216. int ticcount;
  217. statetype *state;
  218. fixed x,y;
  219. int viewx;
  220. unsigned tilex,tiley;
  221. unsigned viewheight;
  222. unsigned size;
  223. struct iobjstruct *next;
  224. } inertobjtype;
  225. #endif
  226. typedef enum {ex_stillplaying,ex_died,ex_warped,ex_resetgame
  227. ,ex_loadedgame,ex_victorious,ex_turning,ex_abort} exittype;
  228. typedef enum {S_NONE, S_HELP, S_SND, S_SAVING, S_RESTORING,
  229. S_JOYSTICK, S_RETREAT, S_ADVANCE, S_SIDESTEP, S_QTURN,
  230. S_MISSLE, S_ZAPPER, S_XTER, S_CURING, S_READ,
  231. S_VIEWING, S_ITEMDES, S_DAMAGE, S_TURN, S_TIMESTOP} status_flags;
  232. typedef struct {
  233. char x,y;
  234. unsigned ondoor,underdoor;
  235. } doorinfo;
  236. typedef struct {
  237. char x,y;
  238. short angle;
  239. doorinfo doors[MAX_DOOR_STORAGE];
  240. } levelinfo;
  241. typedef struct
  242. {
  243. int difficulty;
  244. int mapon;
  245. int bolts,nukes,potions,keys[4],scrolls[8];
  246. int gems[5]; // "int allgems[5]" is used for 1:1 comparison
  247. // in play loop for radar... CHANGE IT, TOO!
  248. long score;
  249. int body,shotpower;
  250. short mapwidth,mapheight;
  251. // levelinfo levels[NUMLEVELS];
  252. } gametype;
  253. /*
  254. =============================================================================
  255. C3_MAIN DEFINITIONS
  256. =============================================================================
  257. */
  258. extern char inlevel[][2];
  259. extern char str[80],str2[20];
  260. extern unsigned tedlevelnum;
  261. extern boolean tedlevel;
  262. extern gametype gamestate;
  263. extern exittype playstate;
  264. extern char SlowMode;
  265. extern unsigned Flags;
  266. extern boolean LoadShapes;
  267. extern boolean EASYMODEON;
  268. void NewGame (void);
  269. boolean SaveTheGame(int file);
  270. boolean LoadTheGame(int file);
  271. void ResetGame(void);
  272. void ShutdownId (void);
  273. void InitGame (void);
  274. void Quit (char *error, ...);
  275. void TEDDeath(void);
  276. void DemoLoop (void);
  277. void SetupScalePic (unsigned picnum);
  278. void SetupScaleWall (unsigned picnum);
  279. void SetupScaling (void);
  280. void main (void);
  281. void Display320(void);
  282. void Display640(void);
  283. void PrintHelp(void);
  284. /*
  285. =============================================================================
  286. C3_GAME DEFINITIONS
  287. =============================================================================
  288. */
  289. extern unsigned latchpics[NUMLATCHPICS];
  290. extern unsigned tileoffsets[NUMTILE16];
  291. extern unsigned textstarts[27];
  292. #define L_CHARS 0
  293. #define L_NOSHOT 1
  294. #define L_SHOTBAR 2
  295. #define L_NOBODY 3
  296. #define L_BODYBAR 4
  297. void ScanInfoPlane (void);
  298. void ScanText (void);
  299. void SetupGameLevel(void);
  300. void Victory (boolean playsounds);
  301. void Died (void);
  302. void NormalScreen (void);
  303. void DrawPlayScreen (void);
  304. void LoadLatchMem (void);
  305. void FizzleFade (unsigned source, unsigned dest,
  306. unsigned width,unsigned height, boolean abortable);
  307. void FizzleOut (int showlevel);
  308. void FreeUpMemory (void);
  309. void GameLoop (void);
  310. /*
  311. =============================================================================
  312. C3_PLAY DEFINITIONS
  313. =============================================================================
  314. */
  315. #define BGF_NIGHT 0x01 // it is officially night
  316. #define BGF_NOT_LIGHTNING 0x02 // lightning flash has ended
  317. extern byte BGFLAGS,bcolor;
  318. extern unsigned *skycolor,*groundcolor;
  319. extern ControlInfo control;
  320. extern boolean running,slowturn;
  321. extern int bordertime;
  322. extern byte tilemap[MAPSIZE][MAPSIZE];
  323. extern objtype *actorat[MAPSIZE][MAPSIZE];
  324. extern byte spotvis[MAPSIZE][MAPSIZE];
  325. extern objtype objlist[MAXACTORS],*new,*obj,*player;
  326. extern unsigned farmapylookup[MAPSIZE];
  327. extern byte *nearmapylookup[MAPSIZE];
  328. extern byte update[];
  329. extern boolean godmode,singlestep;
  330. extern int extravbls;
  331. extern int mousexmove,mouseymove;
  332. extern int pointcount,pointsleft;
  333. extern status_flags status_flag;
  334. extern int status_delay;
  335. extern objtype dummyobj;
  336. extern short BeepTime;
  337. extern unsigned scolor,gcolor;
  338. void CenterWindow(word w,word h);
  339. void DebugMemory (void);
  340. void PicturePause (void);
  341. int DebugKeys (void);
  342. void CheckKeys (void);
  343. void InitObjList (void);
  344. void GetNewObj (boolean usedummy);
  345. void RemoveObj (objtype *gone);
  346. void PollControlls (void);
  347. void PlayLoop (void);
  348. void InitBgChange(short stimer, unsigned *scolors, short gtimer, unsigned *gcolors, byte flag);
  349. void DisplayStatus (status_flags *stat_flag);
  350. /*
  351. =============================================================================
  352. C3_STATE DEFINITIONS
  353. =============================================================================
  354. */
  355. //void SpawnNewObj (unsigned x, unsigned y, statetype *state, unsigned size);
  356. //void SpawnNewObjFrac (long x, long y, statetype *state, unsigned size);
  357. void Internal_SpawnNewObj (unsigned x, unsigned y, statetype *state, unsigned size, boolean UseDummy, boolean PutInActorat);
  358. void Internal_SpawnNewObjFrac (long x, long y, statetype *state, unsigned size,boolean UseDummy);
  359. #define DSpawnNewObj(x, y, state, size) Internal_SpawnNewObj(x,y,state,size,true,true)
  360. #define SpawnNewObj(x, y, state, size) Internal_SpawnNewObj(x,y,state,size,false,true)
  361. #define ASpawnNewObj(x, y, state, size) Internal_SpawnNewObj(x,y,state,size,false,false)
  362. #define SpawnNewObjFrac(x, y, state, size,Dummy) Internal_SpawnNewObjFrac(x, y, state, size,false)
  363. #define DSpawnNewObjFrac(x, y, state, size) Internal_SpawnNewObjFrac(x, y, state, size,true)
  364. boolean CheckHandAttack (objtype *ob);
  365. void T_DoDamage (objtype *ob);
  366. boolean Walk (objtype *ob);
  367. void ChaseThink (objtype *obj, boolean diagonal);
  368. void MoveObj (objtype *ob, long move);
  369. boolean Chase (objtype *ob, boolean diagonal);
  370. extern dirtype opposite[9];
  371. /*
  372. =============================================================================
  373. C3_TRACE DEFINITIONS
  374. =============================================================================
  375. */
  376. int FollowTrace (fixed tracex, fixed tracey, long deltax, long deltay, int max);
  377. int BackTrace (int finish);
  378. void ForwardTrace (void);
  379. int FinishWall (void);
  380. void InsideCorner (void);
  381. void OutsideCorner (void);
  382. void FollowWalls (void);
  383. extern boolean aborttrace;
  384. /*
  385. =============================================================================
  386. C3_DRAW DEFINITIONS
  387. =============================================================================
  388. */
  389. #define MAXWALLS 50
  390. #define DANGERHIGH 45
  391. #define MIDWALL (MAXWALLS/2)
  392. //==========================================================================
  393. extern tilept tile,lasttile,focal,left,mid,right;
  394. extern globpt edge,view;
  395. extern unsigned screenloc[3];
  396. extern unsigned freelatch;
  397. extern int screenpage;
  398. extern boolean fizzlein;
  399. extern long lasttimecount;
  400. extern int firstangle,lastangle;
  401. extern fixed prestep;
  402. extern int traceclip,tracetop;
  403. extern fixed sintable[ANGLES+ANGLES/4],*costable;
  404. extern fixed viewx,viewy,viewsin,viewcos; // the focal point
  405. extern int viewangle;
  406. extern fixed scale,scaleglobal;
  407. extern unsigned slideofs;
  408. extern int zbuffer[VIEWXH+1];
  409. extern walltype walls[MAXWALLS],*leftwall,*rightwall;
  410. extern fixed tileglobal;
  411. extern fixed focallength;
  412. extern fixed mindist;
  413. extern int viewheight;
  414. extern fixed scale;
  415. extern int far walllight1[NUMFLOORS];
  416. extern int far walldark1[NUMFLOORS];
  417. extern unsigned topcolor,bottomcolor;
  418. extern char wall_anim_info[NUMFLOORS];
  419. extern char wall_anim_pos[NUMFLOORS];
  420. //==========================================================================
  421. void DrawLine (int xl, int xh, int y,int color);
  422. void DrawWall (walltype *wallptr);
  423. void TraceRay (unsigned angle);
  424. fixed FixedByFrac (fixed a, fixed b);
  425. void TransformPoint (fixed gx, fixed gy, int *screenx, unsigned *screenheight);
  426. fixed TransformX (fixed gx, fixed gy);
  427. int FollowTrace (fixed tracex, fixed tracey, long deltax, long deltay, int max);
  428. void ForwardTrace (void);
  429. int FinishWall (void);
  430. int TurnClockwise (void);
  431. int TurnCounterClockwise (void);
  432. void FollowWall (void);
  433. void NewScene (void);
  434. void BuildTables (void);
  435. /*
  436. =============================================================================
  437. C3_SCALE DEFINITIONS
  438. =============================================================================
  439. */
  440. #define COMPSCALECODESTART (65*6) // offset to start of code in comp scaler
  441. typedef struct
  442. {
  443. unsigned codeofs[65];
  444. unsigned start[65];
  445. unsigned width[65];
  446. byte code[];
  447. } t_compscale;
  448. typedef struct
  449. {
  450. unsigned width;
  451. unsigned codeofs[64];
  452. } t_compshape;
  453. extern unsigned scaleblockwidth,
  454. scaleblockheight,
  455. scaleblockdest;
  456. extern byte plotpix[8];
  457. extern byte bitmasks1[8][8];
  458. extern byte bitmasks2[8][8];
  459. extern t_compscale _seg *scaledirectory[NUMSCALEPICS];
  460. extern t_compshape _seg *shapedirectory[NUMSCALEPICS];
  461. extern memptr walldirectory[NUMSCALEWALLS];
  462. extern unsigned shapesize[NUMSCALEPICS];
  463. void DeplanePic (int picnum);
  464. void ScaleShape (int xcenter, t_compshape _seg *compshape, unsigned scale);
  465. unsigned BuildCompShape (t_compshape _seg **finalspot);
  466. /*
  467. =============================================================================
  468. C3_ASM DEFINITIONS
  469. =============================================================================
  470. */
  471. extern unsigned wallheight [VIEWWIDTH];
  472. extern unsigned wallwidth [VIEWWIDTH];
  473. extern unsigned wallseg [VIEWWIDTH];
  474. extern unsigned wallofs [VIEWWIDTH];
  475. extern unsigned screenbyte [VIEWWIDTH];
  476. extern unsigned screenbit [VIEWWIDTH];
  477. extern unsigned bitmasks [64];
  478. extern long wallscalecall;
  479. void ScaleWalls (void);
  480. /*
  481. =============================================================================
  482. C3_WIZ DEFINITIONS
  483. =============================================================================
  484. */
  485. #define MAXHANDHEIGHT 72
  486. extern statetype s_pshot_exp1;
  487. extern statetype s_pshot_exp2;
  488. extern statetype s_pshot_exp3;
  489. extern long lastnuke;
  490. extern int lasttext;
  491. extern int handheight;
  492. extern int boltsleft,bolttimer;
  493. extern short RadarXY[][3];
  494. extern short RotateAngle;
  495. extern short FreezeTime;
  496. //void FaceDir(short x, short y, boolean StopTime);
  497. //short CalcAngle(short dx, short dy);
  498. void FaceAngle(short DestAngle);
  499. void RotateView();
  500. void InitRotate(short DestAngle);
  501. short FaceDoor(short x, short y);
  502. char DisplayMsg(char *text,char *choices);
  503. char DisplaySMsg(char *text,char *choices);
  504. extern statetype s_explode;
  505. void SpawnExplosion(fixed x, fixed y,short Delay);
  506. void T_ExpThink(objtype *obj);
  507. void SpawnBigExplosion(fixed x, fixed y, short Delay, fixed Range);
  508. /*
  509. =============================================================================
  510. C3_ACT1 DEFINITIONS
  511. =============================================================================
  512. */
  513. int EasyHitPoints(int NrmHitPts);
  514. int EasyDoDamage(int Damage);
  515. #define zombie_mode ob->temp1
  516. #define zombie_delay ob->temp2
  517. enum zombie_modes {zm_wait_for_dark,zm_wait_to_rise,zm_active};
  518. enum eye_modes {em_other1,em_player1,em_other2,em_player2,em_other3,em_player3,em_other4,em_player4,em_dummy};
  519. #define MSHOTDAMAGE 2
  520. #define MSHOTSPEED 10000
  521. #define ESHOTDAMAGE 1
  522. #define ESHOTSPEED 5000
  523. #define SSHOTDAMAGE 3
  524. #define SSHOTSPEED 6500
  525. #define RANDOM_ATTACK 20
  526. extern dirtype dirtable[];
  527. extern short other_x[], other_y[];
  528. extern short zombie_base_delay;
  529. extern statetype s_fatdemon_ouch;
  530. extern statetype s_fatdemon_blowup1;
  531. extern statetype s_succubus_ouch;
  532. extern statetype s_succubus_death1;
  533. extern statetype s_godessouch;
  534. extern statetype s_godessdie1;
  535. extern statetype s_mageouch;
  536. extern statetype s_magedie1;
  537. extern statetype s_grelouch;
  538. extern statetype s_greldie1;
  539. extern statetype s_batdie1;
  540. extern statetype s_zombie_death1;
  541. extern statetype s_zombie_ouch;
  542. extern statetype s_zombie_rise1;
  543. extern statetype s_zombie_rise2;
  544. extern statetype s_zombie_rise3;
  545. extern statetype s_zombie_rise4;
  546. extern statetype s_ant_wait;
  547. extern statetype s_ant_egg;
  548. extern statetype s_ant_walk1;
  549. extern statetype s_ant_walk2;
  550. extern statetype s_ant_walk3;
  551. extern statetype s_ant_attack1;
  552. extern statetype s_ant_pause;
  553. extern statetype s_ant_ouch;
  554. extern statetype s_ant_die1;
  555. extern statetype s_ant_die2;
  556. extern statetype s_ant_die3;
  557. extern statetype s_skel_pause;
  558. extern statetype s_skel_1;
  559. extern statetype s_skel_2;
  560. extern statetype s_skel_3;
  561. extern statetype s_skel_4;
  562. extern statetype s_skel_attack1;
  563. extern statetype s_skel_attack2;
  564. extern statetype s_skel_attack3;
  565. extern statetype s_skel_ouch;
  566. extern statetype s_skel_die1;
  567. extern statetype s_skel_die2;
  568. extern statetype s_skel_die3;
  569. extern statetype s_wet_pause;
  570. extern statetype s_wet_bubbles1;
  571. extern statetype s_wet_bubbles2;
  572. extern statetype s_wet_bubbles3;
  573. extern statetype s_wet_bubbles4;
  574. extern statetype s_wet_peek;
  575. extern statetype s_wet_rise1;
  576. extern statetype s_wet_rise2;
  577. extern statetype s_wet_rise3;
  578. extern statetype s_wet_rise4;
  579. extern statetype s_wet_rise5;
  580. extern statetype s_wet_sink1;
  581. extern statetype s_wet_sink2;
  582. extern statetype s_wet_sink3;
  583. extern statetype s_wet_walk1;
  584. extern statetype s_wet_walk2;
  585. extern statetype s_wet_walk3;
  586. extern statetype s_wet_walk4;
  587. extern statetype s_wet_attack1;
  588. extern statetype s_wet_attack2;
  589. extern statetype s_wet_attack3;
  590. extern statetype s_wet_attack4;
  591. extern statetype s_wet_ouch;
  592. extern statetype s_wet_die1;
  593. extern statetype s_wet_die2;
  594. extern statetype s_wet_die3;
  595. extern statetype s_wet_die4;
  596. extern statetype s_wet_die5;
  597. extern statetype s_obj_gate1;
  598. extern statetype s_obj_gate2;
  599. extern statetype s_obj_gate3;
  600. extern statetype s_obj_gate4;
  601. extern statetype s_eye_pause;
  602. extern statetype s_eye_1;
  603. extern statetype s_eye_2;
  604. extern statetype s_eye_3;
  605. extern statetype s_eye_4;
  606. extern statetype s_eye_ouch;
  607. extern statetype s_eye_ouch2;
  608. extern statetype s_eye_die1;
  609. extern statetype s_eye_die2;
  610. extern statetype s_eye_die3;
  611. extern statetype s_mshot1;
  612. extern statetype s_mshot2;
  613. extern statetype s_bonus_die;
  614. extern statetype s_red_demonouch;
  615. extern statetype s_red_demondie1;
  616. extern statetype s_bunny_death1;
  617. extern statetype s_bunny_ouch;
  618. extern statetype s_tree_death1;
  619. extern statetype s_tree_ouch;
  620. extern statetype s_force_field_die;