00001
00002
00003 #ifndef __Q_SHARED_H
00004 #define __Q_SHARED_H
00005
00006
00007
00008
00009
00010 #define Q3_SCRIPT_DIR "scripts"
00011
00012 #define MAX_TEAMNAME 32
00013
00014 #include "../qcommon/disablewarnings.h"
00015
00016 #include "teams.h"
00017
00018 #define MAX_WORLD_COORD ( 64 * 1024 )
00019 #define MIN_WORLD_COORD ( -64 * 1024 )
00020 #define WORLD_SIZE ( MAX_WORLD_COORD - MIN_WORLD_COORD )
00021
00022
00023 #define VALID( a ) ( a != NULL )
00024 #define VALIDATE( a ) ( assert( a ) )
00025
00026 #define VALIDATEV( a ) if ( a == NULL ) { assert(0); return; }
00027 #define VALIDATEB( a ) if ( a == NULL ) { assert(0); return qfalse; }
00028 #define VALIDATEP( a ) if ( a == NULL ) { assert(0); return NULL; }
00029
00030 #define VALIDSTRING( a ) ( ( a != 0 ) && ( a[0] != 0 ) )
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045 #ifndef FINAL_BUILD
00046 #define G2_PERFORMANCE_ANALYSIS
00047 #define _FULL_G2_LEAK_CHECKING
00048 extern int g_Ghoul2Allocations;
00049 extern int g_G2ServerAlloc;
00050 extern int g_G2ClientAlloc;
00051 extern int g_G2AllocServer;
00052 #endif
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070 #ifdef Q3_VM
00071
00072 #include "bg_lib.h"
00073
00074 #define assert(exp) ((void)0)
00075
00076 #define min(x,y) ((x)<(y)?(x):(y))
00077 #define max(x,y) ((x)>(y)?(x):(y))
00078
00079 #else
00080
00081 #include <assert.h>
00082 #include <math.h>
00083 #include <stdio.h>
00084 #include <stdarg.h>
00085 #include <string.h>
00086 #include <stdlib.h>
00087 #include <time.h>
00088 #include <ctype.h>
00089 #include <limits.h>
00090
00091
00092
00093 #ifdef _XBOX
00094 #define min(x,y) ((x)<(y)?(x):(y))
00095 #define max(x,y) ((x)>(y)?(x):(y))
00096
00097 #define tvector(T) std::vector< T >
00098 #define tdeque(T) std::deque< T >
00099
00100 #define tlist(T) std::list< T >
00101 #define tslist(T) std::slist< T >
00102
00103 #define tset(T) std::set< T, std::less< T > >
00104 #define tmultiset(T) std::multiset< T, std::less< T > >
00105
00106 #define tcset(T,C) std::set< T, C >
00107 #define tcmultiset(T,C) std::multiset< T, C >
00108
00109 #define tmap(K,T) std::map< K, T, std::less< K > >
00110 #define tmultimap(K,T) std::multimap< K, T, std::less< K > >
00111
00112 #define tcmap(K,T,C) std::map< K, T, C >
00113 #define tcmultimap(K,T,C) std::multimap< K, T, C >
00114 #endif
00115
00116 #endif
00117
00118 #ifdef _WIN32
00119
00120
00121
00122 #endif
00123
00124
00125 #if (defined _M_IX86 || defined __i386__) && !defined __sun__ && !defined __LCC__
00126 #define id386 1
00127 #else
00128 #define id386 0
00129 #endif
00130
00131 #if (defined(powerc) || defined(powerpc) || defined(ppc) || defined(__ppc) || defined(__ppc__)) && !defined(C_ONLY)
00132 #define idppc 1
00133 #else
00134 #define idppc 0
00135 #endif
00136
00137
00138
00139 #define QDECL
00140
00141 short ShortSwap (short l);
00142 int LongSwap (int l);
00143 float FloatSwap (const float *f);
00144
00145
00146
00147 #ifdef WIN32
00148
00149 #define MAC_STATIC
00150
00151 #undef QDECL
00152 #define QDECL __cdecl
00153
00154
00155 #ifdef NDEBUG
00156 #ifdef _M_IX86
00157 #define CPUSTRING "win-x86"
00158 #elif defined _M_ALPHA
00159 #define CPUSTRING "win-AXP"
00160 #endif
00161 #else
00162 #ifdef _M_IX86
00163 #define CPUSTRING "win-x86-debug"
00164 #elif defined _M_ALPHA
00165 #define CPUSTRING "win-AXP-debug"
00166 #endif
00167 #endif
00168
00169 #define ID_INLINE __inline
00170
00171 static ID_INLINE short BigShort( short l) { return ShortSwap(l); }
00172 #define LittleShort
00173 static ID_INLINE int BigLong(int l) { return LongSwap(l); }
00174 #define LittleLong
00175 static ID_INLINE float BigFloat(const float *l) { FloatSwap(l); }
00176 #define LittleFloat
00177
00178 #define PATH_SEP '\\'
00179
00180 #endif
00181
00182
00183
00184 #if defined(MACOS_X)
00185
00186 #define MAC_STATIC
00187 #define __cdecl
00188 #define __declspec(x)
00189 #define stricmp strcasecmp
00190 #define ID_INLINE inline
00191
00192 #ifdef __ppc__
00193 #define CPUSTRING "MacOSX-ppc"
00194 #elif defined __i386__
00195 #define CPUSTRING "MacOSX-i386"
00196 #else
00197 #define CPUSTRING "MacOSX-other"
00198 #endif
00199
00200 #define PATH_SEP '/'
00201
00202 #define __rlwimi(out, in, shift, maskBegin, maskEnd) asm("rlwimi %0,%1,%2,%3,%4" : "=r" (out) : "r" (in), "i" (shift), "i" (maskBegin), "i" (maskEnd))
00203 #define __dcbt(addr, offset) asm("dcbt %0,%1" : : "b" (addr), "r" (offset))
00204
00205 static inline unsigned int __lwbrx(register void *addr, register int offset) {
00206 register unsigned int word;
00207
00208 asm("lwbrx %0,%2,%1" : "=r" (word) : "r" (addr), "b" (offset));
00209 return word;
00210 }
00211
00212 static inline unsigned short __lhbrx(register void *addr, register int offset) {
00213 register unsigned short halfword;
00214
00215 asm("lhbrx %0,%2,%1" : "=r" (halfword) : "r" (addr), "b" (offset));
00216 return halfword;
00217 }
00218
00219 static inline float __fctiw(register float f) {
00220 register float fi;
00221
00222 asm("fctiw %0,%1" : "=f" (fi) : "f" (f));
00223
00224 return fi;
00225 }
00226
00227 #define BigShort
00228 static inline short LittleShort(short l) { return ShortSwap(l); }
00229 #define BigLong
00230 static inline int LittleLong (int l) { return LongSwap(l); }
00231 #define BigFloat
00232 static inline float LittleFloat (const float l) { return FloatSwap(&l); }
00233
00234 #endif
00235
00236
00237
00238 #ifdef __MACOS__
00239
00240 #include <MacTypes.h>
00241 #define MAC_STATIC
00242 #define ID_INLINE inline
00243
00244 #define CPUSTRING "MacOS-PPC"
00245
00246 #define PATH_SEP ':'
00247
00248 void Sys_PumpEvents( void );
00249
00250 #define BigShort
00251 static inline short LittleShort(short l) { return ShortSwap(l); }
00252 #define BigLong
00253 static inline int LittleLong (int l) { return LongSwap(l); }
00254 #define BigFloat
00255 static inline float LittleFloat (const float l) { return FloatSwap(&l); }
00256
00257 #endif
00258
00259
00260
00261
00262
00263 #ifdef __linux__
00264
00265
00266 #define stricmp strcasecmp
00267
00268 #define MAC_STATIC // bk: FIXME
00269 #define ID_INLINE inline
00270
00271 #ifdef __i386__
00272 #define CPUSTRING "linux-i386"
00273 #elif defined __axp__
00274 #define CPUSTRING "linux-alpha"
00275 #else
00276 #define CPUSTRING "linux-other"
00277 #endif
00278
00279 #define PATH_SEP '/'
00280
00281
00282 #ifdef Q3_STATIC
00283 #define GAME_HARD_LINKED
00284 #define CGAME_HARD_LINKED
00285 #define UI_HARD_LINKED
00286 #define BOTLIB_HARD_LINKED
00287 #endif
00288
00289 #if !idppc
00290 inline static short BigShort( short l) { return ShortSwap(l); }
00291 #define LittleShort
00292 inline static int BigLong(int l) { return LongSwap(l); }
00293 #define LittleLong
00294 inline static float BigFloat(const float *l) { return FloatSwap(l); }
00295 #define LittleFloat
00296 #else
00297 #define BigShort
00298 inline static short LittleShort(short l) { return ShortSwap(l); }
00299 #define BigLong
00300 inline static int LittleLong (int l) { return LongSwap(l); }
00301 #define BigFloat
00302 inline static float LittleFloat (const float *l) { return FloatSwap(l); }
00303 #endif
00304
00305 #endif
00306
00307
00308 #ifdef __FreeBSD__ // rb010123
00309
00310 #define stricmp strcasecmp
00311
00312 #define MAC_STATIC
00313 #define ID_INLINE inline
00314
00315 #ifdef __i386__
00316 #define CPUSTRING "freebsd-i386"
00317 #elif defined __axp__
00318 #define CPUSTRING "freebsd-alpha"
00319 #else
00320 #define CPUSTRING "freebsd-other"
00321 #endif
00322
00323 #define PATH_SEP '/'
00324
00325
00326
00327 #if !idppc
00328 static short BigShort( short l) { return ShortSwap(l); }
00329 #define LittleShort
00330 static int BigLong(int l) { LongSwap(l); }
00331 #define LittleLong
00332 static float BigFloat(const float *l) { FloatSwap(l); }
00333 #define LittleFloat
00334 #else
00335 #define BigShort
00336 static short LittleShort(short l) { return ShortSwap(l); }
00337 #define BigLong
00338 static int LittleLong (int l) { return LongSwap(l); }
00339 #define BigFloat
00340 static float LittleFloat (const float *l) { return FloatSwap(l); }
00341 #endif
00342
00343 #endif
00344
00345
00346
00347
00348
00349 typedef unsigned char byte;
00350 typedef unsigned short word;
00351 typedef unsigned long ulong;
00352
00353 typedef enum {qfalse, qtrue} qboolean;
00354 #ifdef _XBOX
00355 #define qboolean int //don't want strict type checking on the qboolean
00356 #endif
00357
00358 typedef int qhandle_t;
00359 typedef int thandle_t;
00360 typedef int fxHandle_t;
00361 typedef int sfxHandle_t;
00362 typedef int fileHandle_t;
00363 typedef int clipHandle_t;
00364
00365 #ifndef NULL
00366 #define NULL ((void *)0)
00367 #endif
00368
00369 #define MAX_QINT 0x7fffffff
00370 #define MIN_QINT (-MAX_QINT-1)
00371
00372
00373
00374 #define PITCH 0 // up / down
00375 #define YAW 1 // left / right
00376 #define ROLL 2 // fall over
00377
00378
00379
00380 #define MAX_STRING_CHARS 1024 // max length of a string passed to Cmd_TokenizeString
00381 #define MAX_STRING_TOKENS 1024 // max tokens resulting from Cmd_TokenizeString
00382 #define MAX_TOKEN_CHARS 1024 // max length of an individual token
00383
00384 #define MAX_INFO_STRING 1024
00385 #define MAX_INFO_KEY 1024
00386 #define MAX_INFO_VALUE 1024
00387
00388 #define BIG_INFO_STRING 8192 // used for system info key only
00389 #define BIG_INFO_KEY 8192
00390 #define BIG_INFO_VALUE 8192
00391
00392
00393 #define MAX_QPATH 64 // max length of a quake game pathname
00394 #ifdef PATH_MAX
00395 #define MAX_OSPATH PATH_MAX
00396 #else
00397 #define MAX_OSPATH 256 // max length of a filesystem pathname
00398 #endif
00399
00400 #define MAX_NAME_LENGTH 32 // max length of a client name
00401
00402 #define MAX_SAY_TEXT 150
00403
00404
00405 typedef enum {
00406 EXEC_NOW,
00407
00408 EXEC_INSERT,
00409 EXEC_APPEND
00410 } cbufExec_t;
00411
00412
00413
00414
00415
00416 #define MAX_MAP_AREA_BYTES 32 // bit vector of area visibility
00417
00418
00419 #define LS_STYLES_START 0
00420 #define LS_NUM_STYLES 32
00421 #define LS_SWITCH_START (LS_STYLES_START+LS_NUM_STYLES)
00422 #define LS_NUM_SWITCH 32
00423 #if !defined MAX_LIGHT_STYLES
00424 #define MAX_LIGHT_STYLES 64
00425 #endif
00426
00427
00428 enum WL_e {
00429 WL_ERROR=1,
00430 WL_WARNING,
00431 WL_VERBOSE,
00432 WL_DEBUG
00433 };
00434
00435 extern float forceSpeedLevels[4];
00436
00437
00438 typedef enum {
00439 PRINT_ALL,
00440 PRINT_DEVELOPER,
00441 PRINT_WARNING,
00442 PRINT_ERROR
00443 } printParm_t;
00444
00445
00446 #ifdef ERR_FATAL
00447 #undef ERR_FATAL // this is be defined in malloc.h
00448 #endif
00449
00450
00451 typedef enum {
00452 ERR_FATAL,
00453 ERR_DROP,
00454 ERR_SERVERDISCONNECT,
00455 ERR_DISCONNECT,
00456 ERR_NEED_CD
00457 } errorParm_t;
00458
00459
00460
00461
00462
00463
00464
00465
00466
00467 #define PROP_GAP_WIDTH 2
00468
00469 #define PROP_SPACE_WIDTH 4
00470 #define PROP_HEIGHT 16
00471
00472 #define PROP_TINY_SIZE_SCALE 1
00473 #define PROP_SMALL_SIZE_SCALE 1
00474 #define PROP_BIG_SIZE_SCALE 1
00475 #define PROP_GIANT_SIZE_SCALE 2
00476
00477 #define PROP_TINY_HEIGHT 10
00478 #define PROP_GAP_TINY_WIDTH 1
00479 #define PROP_SPACE_TINY_WIDTH 3
00480
00481 #define PROP_BIG_HEIGHT 24
00482 #define PROP_GAP_BIG_WIDTH 3
00483 #define PROP_SPACE_BIG_WIDTH 6
00484
00485 #define BLINK_DIVISOR 200
00486 #define PULSE_DIVISOR 75
00487
00488 #define UI_LEFT 0x00000000 // default
00489 #define UI_CENTER 0x00000001
00490 #define UI_RIGHT 0x00000002
00491 #define UI_FORMATMASK 0x00000007
00492 #define UI_SMALLFONT 0x00000010
00493 #define UI_BIGFONT 0x00000020 // default
00494
00495 #define UI_DROPSHADOW 0x00000800
00496 #define UI_BLINK 0x00001000
00497 #define UI_INVERSE 0x00002000
00498 #define UI_PULSE 0x00004000
00499
00500 #if defined(_DEBUG) && !defined(BSPC) && !defined(_XBOX)
00501 #define HUNK_DEBUG
00502 #endif
00503
00504 typedef enum {
00505 h_high,
00506 h_low,
00507 h_dontcare
00508 } ha_pref;
00509
00510 void *Hunk_Alloc( int size, ha_pref preference );
00511
00512 void Com_Memset (void* dest, const int val, const size_t count);
00513 void Com_Memcpy (void* dest, const void* src, const size_t count);
00514
00515 #define CIN_system 1
00516 #define CIN_loop 2
00517 #define CIN_hold 4
00518 #define CIN_silent 8
00519 #define CIN_shader 16
00520
00521
00522
00523
00524
00525
00526
00527
00528
00529
00530 typedef float vec_t;
00531 typedef vec_t vec2_t[2];
00532 typedef vec_t vec3_t[3];
00533 typedef vec_t vec4_t[4];
00534 typedef vec_t vec5_t[5];
00535
00536
00537 typedef vec3_t vec3pair_t[2];
00538
00539 typedef int ivec3_t[3];
00540 typedef int ivec4_t[4];
00541 typedef int ivec5_t[5];
00542
00543 typedef int fixed4_t;
00544 typedef int fixed8_t;
00545 typedef int fixed16_t;
00546
00547 #ifndef M_PI
00548 #define M_PI 3.14159265358979323846f // matches value in gcc v2 math.h
00549 #endif
00550
00551
00552 typedef enum {
00553 BLK_NO,
00554 BLK_TIGHT,
00555 BLK_WIDE
00556 } saberBlockType_t;
00557
00558 typedef enum {
00559 BLOCKED_NONE,
00560 BLOCKED_BOUNCE_MOVE,
00561 BLOCKED_PARRY_BROKEN,
00562 BLOCKED_ATK_BOUNCE,
00563 BLOCKED_UPPER_RIGHT,
00564 BLOCKED_UPPER_LEFT,
00565 BLOCKED_LOWER_RIGHT,
00566 BLOCKED_LOWER_LEFT,
00567 BLOCKED_TOP,
00568 BLOCKED_UPPER_RIGHT_PROJ,
00569 BLOCKED_UPPER_LEFT_PROJ,
00570 BLOCKED_LOWER_RIGHT_PROJ,
00571 BLOCKED_LOWER_LEFT_PROJ,
00572 BLOCKED_TOP_PROJ
00573 } saberBlockedType_t;
00574
00575
00576
00577 typedef enum
00578 {
00579 SABER_RED,
00580 SABER_ORANGE,
00581 SABER_YELLOW,
00582 SABER_GREEN,
00583 SABER_BLUE,
00584 SABER_PURPLE,
00585 NUM_SABER_COLORS
00586
00587 };
00588 typedef int saber_colors_t;
00589
00590 typedef enum
00591 {
00592 FP_FIRST = 0,
00593 FP_HEAL = 0,
00594 FP_LEVITATION,
00595 FP_SPEED,
00596 FP_PUSH,
00597 FP_PULL,
00598 FP_TELEPATHY,
00599 FP_GRIP,
00600 FP_LIGHTNING,
00601 FP_RAGE,
00602 FP_PROTECT,
00603 FP_ABSORB,
00604 FP_TEAM_HEAL,
00605 FP_TEAM_FORCE,
00606 FP_DRAIN,
00607 FP_SEE,
00608 FP_SABER_OFFENSE,
00609 FP_SABER_DEFENSE,
00610 FP_SABERTHROW,
00611 NUM_FORCE_POWERS
00612 };
00613 typedef int forcePowers_t;
00614
00615 typedef enum
00616 {
00617 SABER_NONE = 0,
00618 SABER_SINGLE,
00619 SABER_STAFF,
00620 SABER_DAGGER,
00621 SABER_BROAD,
00622 SABER_PRONG,
00623 SABER_ARC,
00624 SABER_SAI,
00625 SABER_CLAW,
00626 SABER_LANCE,
00627 SABER_STAR,
00628 SABER_TRIDENT,
00629 SABER_SITH_SWORD,
00630 NUM_SABERS
00631 } saberType_t;
00632
00633 typedef struct
00634 {
00635
00636 int inAction;
00637 int duration;
00638 int lastTime;
00639 vec3_t base;
00640 vec3_t tip;
00641
00642 vec3_t dualbase;
00643 vec3_t dualtip;
00644
00645
00646 qboolean haveOldPos[2];
00647 vec3_t oldPos[2];
00648 vec3_t oldNormal[2];
00649
00650 } saberTrail_t;
00651
00652 typedef struct
00653 {
00654 qboolean active;
00655 saber_colors_t color;
00656 float radius;
00657 float length;
00658 float lengthMax;
00659 float lengthOld;
00660 float desiredLength;
00661 vec3_t muzzlePoint;
00662 vec3_t muzzlePointOld;
00663 vec3_t muzzleDir;
00664 vec3_t muzzleDirOld;
00665 saberTrail_t trail;
00666 int hitWallDebounceTime;
00667 int storageTime;
00668 int extendDebounce;
00669 } bladeInfo_t;
00670 #define MAX_BLADES 8
00671
00672 typedef enum
00673 {
00674 SS_NONE = 0,
00675 SS_FAST,
00676 SS_MEDIUM,
00677 SS_STRONG,
00678 SS_DESANN,
00679 SS_TAVION,
00680 SS_DUAL,
00681 SS_STAFF,
00682 SS_NUM_SABER_STYLES
00683 } saber_styles_t;
00684
00685
00686
00687 #define SFL_NOT_LOCKABLE (1<<0)//can't get into a saberlock
00688 #define SFL_NOT_THROWABLE (1<<1)//can't be thrown - FIXME: maybe make this a max level of force saber throw that can be used with this saber?
00689 #define SFL_NOT_DISARMABLE (1<<2)//can't be dropped
00690 #define SFL_NOT_ACTIVE_BLOCKING (1<<3)//don't to try to block incoming shots with this saber
00691 #define SFL_TWO_HANDED (1<<4)//uses both hands
00692 #define SFL_SINGLE_BLADE_THROWABLE (1<<5)//can throw this saber if only the first blade is on
00693 #define SFL_RETURN_DAMAGE (1<<6)//when returning from a saber throw, it keeps spinning and doing damage
00694
00695 #define SFL_ON_IN_WATER (1<<7)//if set, weapon stays active even in water
00696 #define SFL_BOUNCE_ON_WALLS (1<<8)//if set, the saber will bounce back when it hits solid architecture (good for real-sword type mods)
00697 #define SFL_BOLT_TO_WRIST (1<<9)//if set, saber model is bolted to wrist, not in hand... useful for things like claws & shields, etc.
00698
00699
00700
00701 #define SFL_NO_PULL_ATTACK (1<<10)//if set, cannot do pull+attack move (move not available in MP anyway)
00702 #define SFL_NO_BACK_ATTACK (1<<11)//if set, cannot do back-stab moves
00703 #define SFL_NO_STABDOWN (1<<12)//if set, cannot do stabdown move (when enemy is on ground)
00704 #define SFL_NO_WALL_RUNS (1<<13)//if set, cannot side-run or forward-run on walls
00705 #define SFL_NO_WALL_FLIPS (1<<14)//if set, cannot do backflip off wall or side-flips off walls
00706 #define SFL_NO_WALL_GRAB (1<<15)//if set, cannot grab wall & jump off
00707 #define SFL_NO_ROLLS (1<<16)//if set, cannot roll
00708 #define SFL_NO_FLIPS (1<<17)//if set, cannot do flips
00709 #define SFL_NO_CARTWHEELS (1<<18)//if set, cannot do cartwheels
00710 #define SFL_NO_KICKS (1<<19)//if set, cannot do kicks (can't do kicks anyway if using a throwable saber/sword)
00711 #define SFL_NO_MIRROR_ATTACKS (1<<20)//if set, cannot do the simultaneous attack left/right moves (only available in Dual Lightsaber Combat Style)
00712 #define SFL_NO_ROLL_STAB (1<<21)//if set, cannot do roll-stab move at end of roll
00713
00714
00715 #define SFL2_NO_WALL_MARKS (1<<0)//if set, stops the saber from drawing marks on the world (good for real-sword type mods)
00716 #define SFL2_NO_DLIGHT (1<<1)//if set, stops the saber from drawing a dynamic light (good for real-sword type mods)
00717 #define SFL2_NO_BLADE (1<<2)//if set, stops the saber from drawing a blade (good for real-sword type mods)
00718 #define SFL2_NO_CLASH_FLARE (1<<3)//if set, the saber will not do the big, white clash flare with other sabers
00719 #define SFL2_NO_DISMEMBERMENT (1<<4)//if set, the saber never does dismemberment (good for pointed/blunt melee weapons)
00720 #define SFL2_NO_IDLE_EFFECT (1<<5)//if set, the saber will not do damage or any effects when it is idle (not in an attack anim). (good for real-sword type mods)
00721 #define SFL2_ALWAYS_BLOCK (1<<6)//if set, the blades will always be blocking (good for things like shields that should always block)
00722 #define SFL2_NO_MANUAL_DEACTIVATE (1<<7)//if set, the blades cannot manually be toggled on and off
00723 #define SFL2_TRANSITION_DAMAGE (1<<8)//if set, the blade does damage in start, transition and return anims (like strong style does)
00724
00725 #define SFL2_NO_WALL_MARKS2 (1<<9)//if set, stops the saber from drawing marks on the world (good for real-sword type mods)
00726 #define SFL2_NO_DLIGHT2 (1<<10)//if set, stops the saber from drawing a dynamic light (good for real-sword type mods)
00727 #define SFL2_NO_BLADE2 (1<<11)//if set, stops the saber from drawing a blade (good for real-sword type mods)
00728 #define SFL2_NO_CLASH_FLARE2 (1<<12)//if set, the saber will not do the big, white clash flare with other sabers
00729 #define SFL2_NO_DISMEMBERMENT2 (1<<13)//if set, the saber never does dismemberment (good for pointed/blunt melee weapons)
00730 #define SFL2_NO_IDLE_EFFECT2 (1<<14)//if set, the saber will not do damage or any effects when it is idle (not in an attack anim). (good for real-sword type mods)
00731 #define SFL2_ALWAYS_BLOCK2 (1<<15)//if set, the blades will always be blocking (good for things like shields that should always block)
00732 #define SFL2_NO_MANUAL_DEACTIVATE2 (1<<16)//if set, the blades cannot manually be toggled on and off
00733 #define SFL2_TRANSITION_DAMAGE2 (1<<17)//if set, the blade does damage in start, transition and return anims (like strong style does)
00734
00735 typedef struct
00736 {
00737 char name[64];
00738 char fullName[64];
00739 saberType_t type;
00740 char model[MAX_QPATH];
00741 qhandle_t skin;
00742 int soundOn;
00743 int soundLoop;
00744 int soundOff;
00745 int numBlades;
00746 bladeInfo_t blade[MAX_BLADES];
00747 int stylesLearned;
00748 int stylesForbidden;
00749 int maxChain;
00750 int forceRestrictions;
00751 int lockBonus;
00752 int parryBonus;
00753 int breakParryBonus;
00754 int breakParryBonus2;
00755 int disarmBonus;
00756 int disarmBonus2;
00757 saber_styles_t singleBladeStyle;
00758
00759
00760
00761
00762 int saberFlags;
00763 int saberFlags2;
00764
00765
00766 qhandle_t spinSound;
00767 qhandle_t swingSound[3];
00768
00769
00770 float moveSpeedScale;
00771 float animSpeedScale;
00772
00773
00774 int kataMove;
00775 int lungeAtkMove;
00776 int jumpAtkUpMove;
00777 int jumpAtkFwdMove;
00778 int jumpAtkBackMove;
00779 int jumpAtkRightMove;
00780 int jumpAtkLeftMove;
00781 int readyAnim;
00782 int drawAnim;
00783 int putawayAnim;
00784 int tauntAnim;
00785 int bowAnim;
00786 int meditateAnim;
00787 int flourishAnim;
00788 int gloatAnim;
00789
00790
00791 int bladeStyle2Start;
00792
00793
00794
00795
00796
00797 int trailStyle;
00798 int g2MarksShader;
00799 int g2WeaponMarkShader;
00800
00801
00802 qhandle_t hitSound[3];
00803 qhandle_t blockSound[3];
00804 qhandle_t bounceSound[3];
00805 int blockEffect;
00806 int hitPersonEffect;
00807 int hitOtherEffect;
00808 int bladeEffect;
00809
00810
00811 float knockbackScale;
00812 float damageScale;
00813 float splashRadius;
00814 int splashDamage;
00815 float splashKnockback;
00816
00817
00818
00819 int trailStyle2;
00820 int g2MarksShader2;
00821 int g2WeaponMarkShader2;
00822
00823
00824 qhandle_t hit2Sound[3];
00825 qhandle_t block2Sound[3];
00826 qhandle_t bounce2Sound[3];
00827 int blockEffect2;
00828 int hitPersonEffect2;
00829 int hitOtherEffect2;
00830 int bladeEffect2;
00831
00832
00833 float knockbackScale2;
00834 float damageScale2;
00835 float splashRadius2;
00836 int splashDamage2;
00837 float splashKnockback2;
00838
00839
00840 } saberInfo_t;
00841 #define MAX_SABERS 2
00842
00843 typedef enum
00844 {
00845 FORCE_LEVEL_0,
00846 FORCE_LEVEL_1,
00847 FORCE_LEVEL_2,
00848 FORCE_LEVEL_3,
00849 NUM_FORCE_POWER_LEVELS
00850 };
00851
00852 #define FORCE_LEVEL_4 (FORCE_LEVEL_3+1)
00853 #define FORCE_LEVEL_5 (FORCE_LEVEL_4+1)
00854
00855
00856 enum sharedERagPhase
00857 {
00858 RP_START_DEATH_ANIM,
00859 RP_END_DEATH_ANIM,
00860 RP_DEATH_COLLISION,
00861 RP_CORPSE_SHOT,
00862 RP_GET_PELVIS_OFFSET,
00863 RP_SET_PELVIS_OFFSET,
00864 RP_DISABLE_EFFECTORS
00865 };
00866
00867 enum sharedERagEffector
00868 {
00869 RE_MODEL_ROOT= 0x00000001,
00870 RE_PELVIS= 0x00000002,
00871 RE_LOWER_LUMBAR= 0x00000004,
00872 RE_UPPER_LUMBAR= 0x00000008,
00873 RE_THORACIC= 0x00000010,
00874 RE_CRANIUM= 0x00000020,
00875 RE_RHUMEROUS= 0x00000040,
00876 RE_LHUMEROUS= 0x00000080,
00877 RE_RRADIUS= 0x00000100,
00878 RE_LRADIUS= 0x00000200,
00879 RE_RFEMURYZ= 0x00000400,
00880 RE_LFEMURYZ= 0x00000800,
00881 RE_RTIBIA= 0x00001000,
00882 RE_LTIBIA= 0x00002000,
00883 RE_RHAND= 0x00004000,
00884 RE_LHAND= 0x00008000,
00885 RE_RTARSAL= 0x00010000,
00886 RE_LTARSAL= 0x00020000,
00887 RE_RTALUS= 0x00040000,
00888 RE_LTALUS= 0x00080000,
00889 RE_RRADIUSX= 0x00100000,
00890 RE_LRADIUSX= 0x00200000,
00891 RE_RFEMURX= 0x00400000,
00892 RE_LFEMURX= 0x00800000,
00893 RE_CEYEBROW= 0x01000000
00894 };
00895
00896 typedef struct
00897 {
00898 vec3_t angles;
00899 vec3_t position;
00900 vec3_t scale;
00901 vec3_t pelvisAnglesOffset;
00902 vec3_t pelvisPositionOffset;
00903
00904 float fImpactStrength;
00905 float fShotStrength;
00906 int me;
00907
00908
00909 int startFrame;
00910 int endFrame;
00911
00912 int collisionType;
00913
00914 qboolean CallRagDollBegin;
00915
00916 int RagPhase;
00917
00918
00919
00920 int effectorsToTurnOff;
00921
00922 } sharedRagDollParams_t;
00923
00924
00925 typedef struct
00926 {
00927 vec3_t angles;
00928 vec3_t position;
00929 vec3_t scale;
00930 vec3_t velocity;
00931 int me;
00932 int settleFrame;
00933 } sharedRagDollUpdateParams_t;
00934
00935
00936 typedef struct
00937 {
00938 char boneName[512];
00939 vec3_t desiredOrigin;
00940 vec3_t origin;
00941 float movementSpeed;
00942 } sharedIKMoveParams_t;
00943
00944
00945 typedef struct
00946 {
00947 vec3_t pcjMins;
00948 vec3_t pcjMaxs;
00949 vec3_t origin;
00950 vec3_t angles;
00951 vec3_t scale;
00952 float radius;
00953 int blendTime;
00954 int pcjOverrides;
00955 int startFrame;
00956 int endFrame;
00957 qboolean forceAnimOnBone;
00958 } sharedSetBoneIKStateParams_t;
00959
00960 enum sharedEIKMoveState
00961 {
00962 IKS_NONE = 0,
00963 IKS_DYNAMIC
00964 };
00965
00966
00967 typedef enum
00968 {
00969 MAT_METAL = 0,
00970 MAT_GLASS,
00971 MAT_ELECTRICAL,
00972 MAT_ELEC_METAL,
00973 MAT_DRK_STONE,
00974 MAT_LT_STONE,
00975 MAT_GLASS_METAL,
00976 MAT_METAL2,
00977 MAT_NONE,
00978 MAT_GREY_STONE,
00979 MAT_METAL3,
00980 MAT_CRATE1,
00981 MAT_GRATE1,
00982 MAT_ROPE,
00983 MAT_CRATE2,
00984 MAT_WHITE_METAL,
00985 MAT_SNOWY_ROCK,
00986
00987 NUM_MATERIALS
00988
00989 };
00990 typedef int material_t;
00991
00992
00993 #define MAX_WPARRAY_SIZE 4096
00994 #define MAX_NEIGHBOR_SIZE 32
00995
00996 #define MAX_NEIGHBOR_LINK_DISTANCE 128
00997 #define MAX_NEIGHBOR_FORCEJUMP_LINK_DISTANCE 400
00998
00999 #define DEFAULT_GRID_SPACING 400
01000
01001 typedef struct wpneighbor_s
01002 {
01003 int num;
01004 int forceJumpTo;
01005 } wpneighbor_t;
01006
01007 typedef struct wpobject_s
01008 {
01009 vec3_t origin;
01010 int inuse;
01011 int index;
01012 float weight;
01013 float disttonext;
01014 int flags;
01015 int associated_entity;
01016
01017 int forceJumpTo;
01018
01019 int neighbornum;
01020 wpneighbor_t neighbors[MAX_NEIGHBOR_SIZE];
01021 } wpobject_t;
01022
01023
01024 #define NUMVERTEXNORMALS 162
01025 extern vec3_t bytedirs[NUMVERTEXNORMALS];
01026
01027
01028
01029 #define SCREEN_WIDTH 640
01030 #define SCREEN_HEIGHT 480
01031
01032 #define TINYCHAR_WIDTH (SMALLCHAR_WIDTH)
01033 #define TINYCHAR_HEIGHT (SMALLCHAR_HEIGHT/2)
01034
01035 #define SMALLCHAR_WIDTH 8
01036 #define SMALLCHAR_HEIGHT 16