arsa  2.7
gamebasetype.h
Go to the documentation of this file.
1 #ifndef _GAMEBASETYPE
2 #define _GAMEBASETYPE
3 
4 //#include <list>
5 #include "cdx.h"
6 
7 #ifdef _DEBUG_MEM_TRACK
8 
9 #include <list>
10 #include "mem_track.h"
11 
12 inline void* __cdecl operator new(unsigned int size, const char *file, int line)
13 {
14  void *ptr = (void *)malloc(size);
15  AddTrack((DWORD)ptr, size, file, line);
16  return(ptr);
17 }
18 
19 inline void __cdecl operator delete(void *p)
20 {
21  RemoveTrack((DWORD)p);
22  free(p);
23  p = NULL;
24 }
25 
26 #define DEBUG_NEW new (__FILE__, __LINE__)
27 #define new DEBUG_NEW
28 
29 #endif
30 
31 //using namespace std;
32 
33 // max name of string
34 #define _MAXNAME 256
35 #define _MAXNAME30 30
36 
37 // time per unit is 1 second = 1000 milisecond
38 //#define _TIME 1000.0f
39 // time per unit is 1 second = 30 tick
40 #define _TIME 30
41 
42 // area of check collision around cdxmotion / pixel
43 #define AREACOLLISION 50
44 
45 // look distance use for ai
46 #define AI_NEAR 50
47 #define AI_FAR 200
48 
49 #ifndef LIFETIMEINFO
50 // life timw info
51 typedef struct LIFETIMEINFO
52 {
54  {
55  Active = FALSE;
56  LifeTime = 0;
57  LeftLifeTime = 0;
58  LifeTimeMax = 0;
59  }
60 
61  BOOL Active; // active var
62  float LifeTime; // 0.0 = infinite
63  float LeftLifeTime; // left life time
64  float LifeTimeMax; // life time max
66 #endif
67 
68 // object type set to flags var -> actorm.h
69 typedef enum
70 {
74 }OBJTYPE;
75 
76 // use states 1 - 6 in UpdateState() function each ai class
77 // if u have more state please change this value it important
78 // because UpdateState() use this value to random for change state every time
79 #define MAXUPDATESTATE 6
80 
81 // AI STATE
82 typedef enum
83 {
84  SPAWN = 0,
85 
86  // use states 1 - 6 in UpdateState() function each ai class
87  STANDING = 1,
88  JUMPING, // 2
89  SLIDING, // 3
90  WALKING, // 4
91  ATTACKING, // 5
92  RANDOM, // 6
98 
99  // hit state
100  BEGIN_HIT = 12,
109 
110  // action state
111  RUNING = 21,
130 
134 
136 
137  // addination hit
138  // clear move in trigger.cpp
141  HITMOVEANIMATIONJUGGLE, // first hit floor
142  HITMOVEANIMATIONJUGGLE2, // second hit floor and getup
143  HITMOVENOANIMATIONJUGGLE, // first hit floor
144  HITMOVENOANIMATIONJUGGLE2, // second hit floor and getup
147 
148  // wait
149  // not clear move in trigger.cpp
150  // use hit function in cbaseactor.cpp
154 
155  // state for apo only
156  THINKING, // thinking state
157  WARP_BEGIN, // warp begin state , exit this state when endmotion and find enemy and setpos to it.
158  WARP_END, // warp end state
159 
160  GUARD_BACK, // when other actor hit guard actor will backing
161  CHALLENGE, // challenge state
162  CALLPARTNER, // use when call partner eg. changechar[push HP+HK], crazy partner NOT include doubleteam
163 
164  DIEJUGGLE, // die juggle actor is up in the air
165  DIEJUGGLE2, // after DIEJUGGLE same ITMOVEANIMATIONJUGGLE2 then set state to DIE
166  DIENOANIMATION, // die no animation call from BATTLEUPDATE when p1 or p2 KO use for partner dead
167 
168  TIMEOVER, // draw only not check anything
169 
170  // guard attack
174 
175  // back step state
178 
179  // largeface in-out at selectchar
181 
182  // wait until hitter exit attact state
183  // use for attack
185 
186  // show extend pose
188 
189 }AI_STATE;
190 
191 // ai type
192 typedef enum
193 {
194  // player
197 
198  // dialog npc & player
201 
202  // map npc & player
206 
207  // battle ai
218 
219  // player 3p/4p battle
224 
227 
231 
232 }AI_TYPE;
233 
234 // command info
235 typedef struct CMDINFO
236 {
238  {
239  Name = name;
240  Flags = 0;
241  }
242 
243  bool operator==(const CMDINFO& other) const
244  {
245  return Name == other.Name ? true : false;
246  }
247 
248  irr::core::stringc Name; // name of command
250  irr::core::stringc Action; // action name
251  BYTE Flags; // command flags
252 }CMDINFO, *PCMDINFO;
253 
254 // block data
255 typedef enum
256 {
257  SOLID = 1, // 1
258  BROKEN, // 2
259  PBROKEN, // 3
262 }BLKDATA;
263 
264 // attack level
265 typedef enum
266 {
267  HIGH = 1, // 1
268  MIDDLE, // 2
269  LOW // 3
270 }ATTACKLEVEL;
271 
272 // attack type
273 typedef enum
274 {
275  COMBO = 1, // combo attack
276  SKILLNEAR, // skill near
277  SKILLFAR, // skill far
278  GUARDCRASH, // guard crash
279  GUARDCANCEL = 5, // guard cancel
280  HEALHP, // heal hp, mp
281  ABNATTADD, // abnormal status att add
282  ABNDEFADD, // abnormal status def add
283  ABNATTDEC, // abnormal status att dec
284  ABNDEFDEC = 10, // abnormal status def dec
285  UNPOISONFREEZE, // un poison freeze
286  UNPOISONDECHP, // un poison dec hp
287  UNPOISONNOSKILL, // un poison no skill
288  POISONFREEZE, // poison freeze
289  POISONDECHP = 15, // poison dec hp
290  POISONNOSKILL, // poison no skill
291  RELIFE, // relife
292  UNABNATT, // un abnormal status att
293  UNABNDEF // un abnormal status att
294 }ATTACKTYPE;
295 
296 //======================================
297 // item type
298 // use this in menu function
299 //======================================
300 // use for name of menu
301 #define TYPE_PORTRAIT_MENU "PORTRAIT_MENU"
302 
303 #define TYPE_SKILL "SKILL"
304 #define TYPE_PORTRAIT "PORTRAIT"
305 
306 //======================================
307 // player string use when get player control button
308 // NOW!!! i think use player 1 only for select main menu or battle menu
309 //======================================
310 #define PLAYER1 "PLAYER1"
311 #define PLAYER2 "PLAYER2"
312 #define PLAYER1WORLD "PLAYER1WORLD"
313 #define PLAYER2WORLD "PLAYER2WORLD"
314 
315 // for 3p/4p battle
316 #define PLAYER1B "PLAYER1B"
317 #define PLAYER2B "PLAYER2B"
318 #define PLAYER3B "PLAYER3B"
319 #define PLAYER4B "PLAYER4B"
320 #define PLAYER1BWORLD "PLAYER1BWORLD"
321 #define PLAYER2BWORLD "PLAYER2BWORLD"
322 
323 
324 
325 
326 //======================================
327 // font name
328 // 3 fonts are SMALLENG, MEDIUMENG, LARGEENG use for menu only and this's a bitmap font
329 // 3 fonts are SMALLUPC, MEDIUMUPC, LARGEUPC use for item or thai and other font this's a true type font
330 // 3 fonts are SMALLNUM, MEDIUMNUM, LARGENUM use for number 0-9 show hit point, counter, hp or mp and this's a bitmap font
331 //======================================
332 /*#define SMALLENG "font6x9"
333 #define MEDIUMENG "font8x16"
334 #define LARGEENG "font17x19"
335 
336 #define SMALLUPC "SMALLUPC"
337 #define MEDIUMUPC "MEDIUMUPC"
338 #define LARGEUPC "LARGEUPC"
339 
340 #define SMALLNUM "SMALLNUM"
341 #define MEDIUMNUM "MEDIUMNUM"
342 #define LARGENUM "LARGENUM"*/
343 
344 // ------------------------------------------------------------------
345 // key input
346 // ------------------------------------------------------------------
347 #define MAXKEY 16
348 #define REPEATKEY 10
349 #define RESETKEY 1000
350 
351 typedef struct KEYINFO
352 {
354  {
355  Key = 0;
356  Time = 0;
357  }
358 
361 }KEYINFO, *PKEYINFO;
362 
363 #endif
#define FALSE
Definition: cdx.h:170
ATTACKLEVEL
Definition: gamebasetype.h:265
UINT32 Key
Definition: gamebasetype.h:359
irr::core::stringc Action
Definition: gamebasetype.h:250
struct LIFETIMEINFO * PLIFETIMEINFO
BYTE Flags
Definition: gamebasetype.h:251
GLfloat GLfloat p
float LifeTimeMax
Definition: gamebasetype.h:64
irr::core::stringc Cmd
Definition: gamebasetype.h:249
float LifeTime
Definition: gamebasetype.h:62
struct KEYINFO KEYINFO
struct LIFETIMEINFO LIFETIMEINFO
GLuint const GLchar * name
ATTACKTYPE
Definition: gamebasetype.h:273
AI_TYPE
Definition: gamebasetype.h:192
GLsizeiptr size
Very simple string class with some useful features.
Definition: irrString.h:37
#define BYTE
Definition: cdx.h:156
float LeftLifeTime
Definition: gamebasetype.h:63
struct CMDINFO * PCMDINFO
OBJTYPE
Definition: gamebasetype.h:69
#define UINT
Definition: cdx.h:159
AI_STATE
Definition: gamebasetype.h:82
struct KEYINFO * PKEYINFO
#define NULL
Definition: begin_code.h:167
#define UINT32
Definition: cdx.h:161
BLKDATA
Definition: gamebasetype.h:255
struct CMDINFO CMDINFO
UINT Time
Definition: gamebasetype.h:360
bool operator==(const CMDINFO &other) const
Definition: gamebasetype.h:243
irr::core::stringc Name
Definition: gamebasetype.h:248
#define BOOL
Definition: cdx.h:160
#define DWORD
Definition: cdx.h:162