OSDN Git Service

wwww
[proj16/16.git] / src / v2 / source / ENGINE / ENTITY.H
1 /*\r
2 Copyright (C) 1998 BJ Eirich (aka vecna)\r
3 This program is free software; you can redistribute it and/or\r
4 modify it under the terms of the GNU General Public License\r
5 as published by the Free Software Foundation; either version 2\r
6 of the License, or (at your option) any later version.\r
7 This program is distributed in the hope that it will be useful,\r
8 but WITHOUT ANY WARRANTY; without even the implied warranty of\r
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\r
10 See the GNU General Public Lic\r
11 See the GNU General Public License for more details.\r
12 You should have received a copy of the GNU General Public License\r
13 along with this program; if not, write to the Free Software\r
14 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.\r
15 */\r
16 \r
17 #ifndef ENTITY_H\r
18 #define ENTITY_H\r
19 \r
20 typedef struct\r
21 {\r
22   int x, y;                            // xwc, ywx position\r
23   word tx, ty;                         // xtc, ytc position\r
24   byte facing;                         // direction entity is facing\r
25   byte moving, movecnt;                // direction entity is moving\r
26   byte frame;                          // bottom-line frame to display\r
27   byte specframe;                      // special-frame set thingo\r
28   byte chrindex, reset;                // CHR index | Reset animation\r
29   byte obsmode1, obsmode2;             // can be obstructed | Is an obstruction\r
30   byte speed, speedct;                 // entity speed, speedcount :)\r
31   byte delayct;                        // animation frame-delay\r
32   char *animofs, *scriptofs;           // anim script | move script\r
33   byte face, actm;                     // auto-face | activation mode\r
34   byte movecode, movescript;           // movement type | movement script\r
35   byte ctr, mode;                      // sub-tile move ctr, mode flag (internal)\r
36   word step, delay;                    // step, delay\r
37   word stepctr, delayctr;              // internal use counters\r
38   word data1, data2, data3;            //\r
39   word data4, data5, data6;            //\r
40   int  actscript;                      // activation script\r
41   int  expand1, expand2;               //\r
42   int  expand3, expand4;               //\r
43   char desc[20];                       // Entity description.\r
44 } entity_r;\r
45 \r
46 typedef struct\r
47 {\r
48   char t[60];\r
49 } chrlist_r;\r
50 \r
51 typedef struct\r
52 {\r
53   byte *imagedata;                   // CHR frame data\r
54   int fxsize, fysize;                // frame x/y dimensions\r
55   int hx, hy;                        // x/y obstruction hotspot\r
56   int totalframes;                   // total # of frames.\r
57   int lidle, ridle;\r
58   int uidle, didle;\r
59   char lanim[100];\r
60   char ranim[100];\r
61   char uanim[100];\r
62   char danim[100];\r
63 } chrdata;\r
64 \r
65 extern chrlist_r chrlist[100];\r
66 extern byte nmchr, playernum;\r
67 extern entity_r *player;\r
68 extern entity_r entity[256];\r
69 extern chrdata chr[100];\r
70 extern byte entities, numchrs;\r
71 extern byte entidx[256], cc;\r
72 \r
73 void RenderEntities();\r
74 void AnimateEntity(entity_r *p);\r
75 void ProcessEntities();\r
76 void SiftEntities();\r
77 void LoadCHRList();\r
78 void FreeCHRList();\r
79 void EntityStat();\r
80 void ListActiveEnts();\r
81 void EntityS();\r
82 int EntityAt(int ex, int ey);\r
83 int EntityObsAt(int ex, int ey);\r
84 int ObstructionAt(int ex, int ey);\r
85 int CacheCHR(char *fname);\r
86 int AllocateEntity(int x1, int y1, char *fname);\r
87 \r
88 #endif\r