#define M_PI 3.14159265358979323846f // matches value in gcc v2 math.h
#endif
typedefenum{
BLK_NO,
BLK_TIGHT,// Block only attacks and shots around the saber itself, a bbox of around 12x12x12
BLK_WIDE// Block all attacks in an area around the player in a rough arc of 180 degrees
}saberBlockType_t;
typedefenum{
BLOCKED_NONE,
BLOCKED_BOUNCE_MOVE,
BLOCKED_PARRY_BROKEN,
BLOCKED_ATK_BOUNCE,
BLOCKED_UPPER_RIGHT,
BLOCKED_UPPER_LEFT,
BLOCKED_LOWER_RIGHT,
BLOCKED_LOWER_LEFT,
BLOCKED_TOP,
BLOCKED_UPPER_RIGHT_PROJ,
BLOCKED_UPPER_LEFT_PROJ,
BLOCKED_LOWER_RIGHT_PROJ,
BLOCKED_LOWER_LEFT_PROJ,
BLOCKED_TOP_PROJ
}saberBlockedType_t;
typedefenum
{
SABER_RED,
SABER_ORANGE,
SABER_YELLOW,
SABER_GREEN,
SABER_BLUE,
SABER_PURPLE,
NUM_SABER_COLORS
};
typedefintsaber_colors_t;
typedefenum
{
FP_FIRST=0,//marker
FP_HEAL=0,//instant
FP_LEVITATION,//hold/duration
FP_SPEED,//duration
FP_PUSH,//hold/duration
FP_PULL,//hold/duration
FP_TELEPATHY,//instant
FP_GRIP,//hold/duration
FP_LIGHTNING,//hold/duration
FP_RAGE,//duration
FP_PROTECT,
FP_ABSORB,
FP_TEAM_HEAL,
FP_TEAM_FORCE,
FP_DRAIN,
FP_SEE,
FP_SABER_OFFENSE,
FP_SABER_DEFENSE,
FP_SABERTHROW,
NUM_FORCE_POWERS
};
typedefintforcePowers_t;
typedefenum
{
SABER_NONE=0,
SABER_SINGLE,
SABER_STAFF,
SABER_DAGGER,
SABER_BROAD,
SABER_PRONG,
SABER_ARC,
SABER_SAI,
SABER_CLAW,
SABER_LANCE,
SABER_STAR,
SABER_TRIDENT,
SABER_SITH_SWORD,
NUM_SABERS
}saberType_t;
typedefstruct
{
// Actual trail stuff
intinAction;// controls whether should we even consider starting one
intduration;// how long each trail seg stays in existence
intlastTime;// time a saber segement was last stored
vec3_tbase;
vec3_ttip;
vec3_tdualbase;
vec3_tdualtip;
// Marks stuff
qbooleanhaveOldPos[2];
vec3_toldPos[2];
vec3_toldNormal[2];// store this in case we don't have a connect-the-dots situation
// ..then we'll need the normal to project a mark blob onto the impact point
}saberTrail_t;
typedefstruct
{
qbooleanactive;
saber_colors_tcolor;
floatradius;
floatlength;
floatlengthMax;
floatlengthOld;
floatdesiredLength;
vec3_tmuzzlePoint;
vec3_tmuzzlePointOld;
vec3_tmuzzleDir;
vec3_tmuzzleDirOld;
saberTrail_ttrail;
inthitWallDebounceTime;
intstorageTime;
intextendDebounce;
}bladeInfo_t;
#define MAX_BLADES 8
typedefenum
{
SS_NONE=0,
SS_FAST,
SS_MEDIUM,
SS_STRONG,
SS_DESANN,
SS_TAVION,
SS_DUAL,
SS_STAFF,
SS_NUM_SABER_STYLES
}saber_styles_t;
//SABER FLAGS
//Old bools converted to a flag now
#define SFL_NOT_LOCKABLE (1<<0)//can't get into a saberlock
#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?
#define SFL_NOT_DISARMABLE (1<<2)//can't be dropped
#define SFL_NOT_ACTIVE_BLOCKING (1<<3)//don't to try to block incoming shots with this saber
#define SFL_TWO_HANDED (1<<4)//uses both hands
#define SFL_SINGLE_BLADE_THROWABLE (1<<5)//can throw this saber if only the first blade is on
#define SFL_RETURN_DAMAGE (1<<6)//when returning from a saber throw, it keeps spinning and doing damage
//NEW FLAGS
#define SFL_ON_IN_WATER (1<<7)//if set, weapon stays active even in water
#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)
#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.
//#define SFL_STICK_ON_IMPACT (1<<?)//if set, the saber will stick in the wall when thrown and hits solid architecture (good for sabers that are meant to be thrown).
//#define SFL_NO_ATTACK (1<<?)//if set, you cannot attack with the saber (for sabers/weapons that are meant to be thrown only, not used as melee weapons).
//Move Restrictions
#define SFL_NO_PULL_ATTACK (1<<10)//if set, cannot do pull+attack move (move not available in MP anyway)
#define SFL_NO_BACK_ATTACK (1<<11)//if set, cannot do back-stab moves
#define SFL_NO_STABDOWN (1<<12)//if set, cannot do stabdown move (when enemy is on ground)
#define SFL_NO_WALL_RUNS (1<<13)//if set, cannot side-run or forward-run on walls
#define SFL_NO_WALL_FLIPS (1<<14)//if set, cannot do backflip off wall or side-flips off walls
#define SFL_NO_WALL_GRAB (1<<15)//if set, cannot grab wall & jump off
#define SFL_NO_ROLLS (1<<16)//if set, cannot roll
#define SFL_NO_FLIPS (1<<17)//if set, cannot do flips
#define SFL_NO_CARTWHEELS (1<<18)//if set, cannot do cartwheels
#define SFL_NO_KICKS (1<<19)//if set, cannot do kicks (can't do kicks anyway if using a throwable saber/sword)
#define SFL_NO_MIRROR_ATTACKS (1<<20)//if set, cannot do the simultaneous attack left/right moves (only available in Dual Lightsaber Combat Style)
#define SFL_NO_ROLL_STAB (1<<21)//if set, cannot do roll-stab move at end of roll
//SABER FLAGS2
//Primary Blade Style
#define SFL2_NO_WALL_MARKS (1<<0)//if set, stops the saber from drawing marks on the world (good for real-sword type mods)
#define SFL2_NO_DLIGHT (1<<1)//if set, stops the saber from drawing a dynamic light (good for real-sword type mods)
#define SFL2_NO_BLADE (1<<2)//if set, stops the saber from drawing a blade (good for real-sword type mods)
#define SFL2_NO_CLASH_FLARE (1<<3)//if set, the saber will not do the big, white clash flare with other sabers
#define SFL2_NO_DISMEMBERMENT (1<<4)//if set, the saber never does dismemberment (good for pointed/blunt melee weapons)
#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)
#define SFL2_ALWAYS_BLOCK (1<<6)//if set, the blades will always be blocking (good for things like shields that should always block)
#define SFL2_NO_MANUAL_DEACTIVATE (1<<7)//if set, the blades cannot manually be toggled on and off
#define SFL2_TRANSITION_DAMAGE (1<<8)//if set, the blade does damage in start, transition and return anims (like strong style does)
//Secondary Blade Style
#define SFL2_NO_WALL_MARKS2 (1<<9)//if set, stops the saber from drawing marks on the world (good for real-sword type mods)
#define SFL2_NO_DLIGHT2 (1<<10)//if set, stops the saber from drawing a dynamic light (good for real-sword type mods)
#define SFL2_NO_BLADE2 (1<<11)//if set, stops the saber from drawing a blade (good for real-sword type mods)
#define SFL2_NO_CLASH_FLARE2 (1<<12)//if set, the saber will not do the big, white clash flare with other sabers
#define SFL2_NO_DISMEMBERMENT2 (1<<13)//if set, the saber never does dismemberment (good for pointed/blunt melee weapons)
#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)
#define SFL2_ALWAYS_BLOCK2 (1<<15)//if set, the blades will always be blocking (good for things like shields that should always block)
#define SFL2_NO_MANUAL_DEACTIVATE2 (1<<16)//if set, the blades cannot manually be toggled on and off
#define SFL2_TRANSITION_DAMAGE2 (1<<17)//if set, the blade does damage in start, transition and return anims (like strong style does)
typedefstruct
{
charname[64];//entry in sabers.cfg, if any
charfullName[64];//the "Proper Name" of the saber, shown in UI
saberType_ttype;//none, single or staff
charmodel[MAX_QPATH];//hilt model
qhandle_tskin;//registered skin id
intsoundOn;//game soundindex for turning on sound
intsoundLoop;//game soundindex for hum/loop sound
intsoundOff;//game soundindex for turning off sound
intnumBlades;
bladeInfo_tblade[MAX_BLADES];//blade info - like length, trail, origin, dir, etc.
intstylesLearned;//styles you get when you get this saber, if any
intstylesForbidden;//styles you cannot use with this saber, if any
intmaxChain;//how many moves can be chained in a row with this weapon (-1 is infinite, 0 is use default behavior)
intforceRestrictions;//force powers that cannot be used while this saber is on (bitfield) - FIXME: maybe make this a limit on the max level, per force power, that can be used with this type?
intlockBonus;//in saberlocks, this type of saber pushes harder or weaker
intparryBonus;//added to strength of parry with this saber
intbreakParryBonus;//added to strength when hit a parry
intbreakParryBonus2;//for bladeStyle2 (see bladeStyle2Start below)
intdisarmBonus;//added to disarm chance when win saberlock or have a good parry (knockaway)
intdisarmBonus2;//for bladeStyle2 (see bladeStyle2Start below)
saber_styles_tsingleBladeStyle;//makes it so that you use a different style if you only have the first blade active
// char *brokenSaber1; //if saber is actually hit by another saber, it can be cut in half/broken and will be replaced with this saber in your right hand
// char *brokenSaber2; //if saber is actually hit by another saber, it can be cut in half/broken and will be replaced with this saber in your left hand
//these values are global to the saber, like all of the ones above
intsaberFlags;//from SFL_ list above
intsaberFlags2;//from SFL2_ list above
//done in cgame (client-side code)
qhandle_tspinSound;//none - if set, plays this sound as it spins when thrown
qhandle_tswingSound[3];//none - if set, plays one of these 3 sounds when swung during an attack - NOTE: must provide all 3!!!
//done in game (server-side code)
floatmoveSpeedScale;//1.0 - you move faster/slower when using this saber
floatanimSpeedScale;//1.0 - plays normal attack animations faster/slower
//done in both cgame and game (BG code)
intkataMove;//LS_INVALID - if set, player will execute this move when they press both attack buttons at the same time
intlungeAtkMove;//LS_INVALID - if set, player will execute this move when they crouch+fwd+attack
intjumpAtkUpMove;//LS_INVALID - if set, player will execute this move when they jump+attack
intjumpAtkFwdMove;//LS_INVALID - if set, player will execute this move when they jump+fwd+attack
intjumpAtkBackMove;//LS_INVALID - if set, player will execute this move when they jump+back+attack
intjumpAtkRightMove;//LS_INVALID - if set, player will execute this move when they jump+rightattack
intjumpAtkLeftMove;//LS_INVALID - if set, player will execute this move when they jump+left+attack
intreadyAnim;//-1 - anim to use when standing idle
intdrawAnim;//-1 - anim to use when drawing weapon
intputawayAnim;//-1 - anim to use when putting weapon away
inttauntAnim;//-1 - anim to use when hit "taunt"
intbowAnim;//-1 - anim to use when hit "bow"
intmeditateAnim;//-1 - anim to use when hit "meditate"
intflourishAnim;//-1 - anim to use when hit "flourish"
intgloatAnim;//-1 - anim to use when hit "gloat"
//***NOTE: you can only have a maximum of 2 "styles" of blades, so this next value, "bladeStyle2Start" is the number of the first blade to use these value on... all blades before this use the normal values above, all blades at and after this number use the secondary values below***
intbladeStyle2Start;//0 - if set, blades from this number and higher use the following values (otherwise, they use the normal values already set)
//***The following can be different for the extra blades - not setting them individually defaults them to the value for the whole saber (and first blade)***
//===PRIMARY BLADES=====================
//done in cgame (client-side code)
inttrailStyle;//0 - default (0) is normal, 1 is a motion blur and 2 is no trail at all (good for real-sword type mods)
intg2MarksShader;//none - if set, the game will use this shader for marks on enemies instead of the default "gfx/damage/saberglowmark"
intg2WeaponMarkShader;//none - if set, the game will ry to project this shader onto the weapon when it damages a person (good for a blood splatter on the weapon)
//int bladeShader; //none - if set, overrides the shader used for the saber blade?
//int trailShader; //none - if set, overrides the shader used for the saber trail?
qhandle_thitSound[3];//none - if set, plays one of these 3 sounds when saber hits a person - NOTE: must provide all 3!!!
qhandle_tblockSound[3];//none - if set, plays one of these 3 sounds when saber/sword hits another saber/sword - NOTE: must provide all 3!!!
qhandle_tbounceSound[3];//none - if set, plays one of these 3 sounds when saber/sword hits a wall and bounces off (must set bounceOnWall to 1 to use these sounds) - NOTE: must provide all 3!!!
intblockEffect;//none - if set, plays this effect when the saber/sword hits another saber/sword (instead of "saber/saber_block.efx")
inthitPersonEffect;//none - if set, plays this effect when the saber/sword hits a person (instead of "saber/blood_sparks_mp.efx")
inthitOtherEffect;//none - if set, plays this effect when the saber/sword hits something else damagable (instead of "saber/saber_cut.efx")
intbladeEffect;//none - if set, plays this effect at the blade tag
//done in game (server-side code)
floatknockbackScale;//0 - if non-zero, uses damage done to calculate an appropriate amount of knockback
floatdamageScale;//1 - scale up or down the damage done by the saber
floatsplashRadius;//0 - radius of splashDamage
intsplashDamage;//0 - amount of splashDamage, 100% at a distance of 0, 0% at a distance = splashRadius
floatsplashKnockback;//0 - amount of splashKnockback, 100% at a distance of 0, 0% at a distance = splashRadius
//===SECONDARY BLADES===================
//done in cgame (client-side code)
inttrailStyle2;//0 - default (0) is normal, 1 is a motion blur and 2 is no trail at all (good for real-sword type mods)
intg2MarksShader2;//none - if set, the game will use this shader for marks on enemies instead of the default "gfx/damage/saberglowmark"
intg2WeaponMarkShader2;//none - if set, the game will ry to project this shader onto the weapon when it damages a person (good for a blood splatter on the weapon)
//int bladeShader2; //none - if set, overrides the shader used for the saber blade?
//int trailShader2; //none - if set, overrides the shader used for the saber trail?
qhandle_thit2Sound[3];//none - if set, plays one of these 3 sounds when saber hits a person - NOTE: must provide all 3!!!
qhandle_tblock2Sound[3];//none - if set, plays one of these 3 sounds when saber/sword hits another saber/sword - NOTE: must provide all 3!!!
qhandle_tbounce2Sound[3];//none - if set, plays one of these 3 sounds when saber/sword hits a wall and bounces off (must set bounceOnWall to 1 to use these sounds) - NOTE: must provide all 3!!!
intblockEffect2;//none - if set, plays this effect when the saber/sword hits another saber/sword (instead of "saber/saber_block.efx")
inthitPersonEffect2;//none - if set, plays this effect when the saber/sword hits a person (instead of "saber/blood_sparks_mp.efx")
inthitOtherEffect2;//none - if set, plays this effect when the saber/sword hits something else damagable (instead of "saber/saber_cut.efx")
intbladeEffect2;//none - if set, plays this effect at the blade tag
//done in game (server-side code)
floatknockbackScale2;//0 - if non-zero, uses damage done to calculate an appropriate amount of knockback
floatdamageScale2;//1 - scale up or down the damage done by the saber
floatsplashRadius2;//0 - radius of splashDamage
intsplashDamage2;//0 - amount of splashDamage, 100% at a distance of 0, 0% at a distance = splashRadius
floatsplashKnockback2;//0 - amount of splashKnockback, 100% at a distance of 0, 0% at a distance = splashRadius
//rww - a C-ified structure version of the class which fires off callbacks and gives arguments to update ragdoll status.
enumsharedERagPhase
{
RP_START_DEATH_ANIM,
RP_END_DEATH_ANIM,
RP_DEATH_COLLISION,
RP_CORPSE_SHOT,
RP_GET_PELVIS_OFFSET,// this actually does nothing but set the pelvisAnglesOffset, and pelvisPositionOffset
RP_SET_PELVIS_OFFSET,// this actually does nothing but set the pelvisAnglesOffset, and pelvisPositionOffset
RP_DISABLE_EFFECTORS// this removes effectors given by the effectorsToTurnOff member
};
enumsharedERagEffector
{
RE_MODEL_ROOT=0x00000001,//"model_root"
RE_PELVIS=0x00000002,//"pelvis"
RE_LOWER_LUMBAR=0x00000004,//"lower_lumbar"
RE_UPPER_LUMBAR=0x00000008,//"upper_lumbar"
RE_THORACIC=0x00000010,//"thoracic"
RE_CRANIUM=0x00000020,//"cranium"
RE_RHUMEROUS=0x00000040,//"rhumerus"
RE_LHUMEROUS=0x00000080,//"lhumerus"
RE_RRADIUS=0x00000100,//"rradius"
RE_LRADIUS=0x00000200,//"lradius"
RE_RFEMURYZ=0x00000400,//"rfemurYZ"
RE_LFEMURYZ=0x00000800,//"lfemurYZ"
RE_RTIBIA=0x00001000,//"rtibia"
RE_LTIBIA=0x00002000,//"ltibia"
RE_RHAND=0x00004000,//"rhand"
RE_LHAND=0x00008000,//"lhand"
RE_RTARSAL=0x00010000,//"rtarsal"
RE_LTARSAL=0x00020000,//"ltarsal"
RE_RTALUS=0x00040000,//"rtalus"
RE_LTALUS=0x00080000,//"ltalus"
RE_RRADIUSX=0x00100000,//"rradiusX"
RE_LRADIUSX=0x00200000,//"lradiusX"
RE_RFEMURX=0x00400000,//"rfemurX"
RE_LFEMURX=0x00800000,//"lfemurX"
RE_CEYEBROW=0x01000000//"ceyebrow"
};
typedefstruct
{
vec3_tangles;
vec3_tposition;
vec3_tscale;
vec3_tpelvisAnglesOffset;// always set on return, an argument for RP_SET_PELVIS_OFFSET
vec3_tpelvisPositionOffset;// always set on return, an argument for RP_SET_PELVIS_OFFSET
floatfImpactStrength;//should be applicable when RagPhase is RP_DEATH_COLLISION
floatfShotStrength;//should be applicable for setting velocity of corpse on shot (probably only on RP_CORPSE_SHOT)
intme;//index of entity giving this update
//rww - we have convenient animation/frame access in the game, so just send this info over from there.
intstartFrame;
intendFrame;
intcollisionType;// 1 = from a fall, 0 from effectors, this will be going away soon, hence no enum
qbooleanCallRagDollBegin;// a return value, means that we are now begininng ragdoll and the NPC stuff needs to happen
intRagPhase;
// effector control, used for RP_DISABLE_EFFECTORS call
inteffectorsToTurnOff;// set this to an | of the above flags for a RP_DISABLE_EFFECTORS
}sharedRagDollParams_t;
//And one for updating during model animation.
typedefstruct
{
vec3_tangles;
vec3_tposition;
vec3_tscale;
vec3_tvelocity;
intme;
intsettleFrame;
}sharedRagDollUpdateParams_t;
//rww - update parms for ik bone stuff
typedefstruct
{
charboneName[512];//name of bone
vec3_tdesiredOrigin;//world coordinate that this bone should be attempting to reach
vec3_torigin;//world coordinate of the entity who owns the g2 instance that owns the bone
floatmovementSpeed;//how fast the bone should move toward the destination
}sharedIKMoveParams_t;
typedefstruct
{
vec3_tpcjMins;//ik joint limit
vec3_tpcjMaxs;//ik joint limit
vec3_torigin;//origin of caller
vec3_tangles;//angles of caller
vec3_tscale;//scale of caller
floatradius;//bone rad
intblendTime;//bone blend time
intpcjOverrides;//override ik bone flags
intstartFrame;//base pose start
intendFrame;//base pose end
qbooleanforceAnimOnBone;//normally if the bone has specified start/end frames already it will leave it alone.. if this is true, then the animation will be restarted on the bone with the specified frames anyway.
}sharedSetBoneIKStateParams_t;
enumsharedEIKMoveState
{
IKS_NONE=0,
IKS_DYNAMIC
};
//material stuff needs to be shared
typedefenum//# material_e
{
MAT_METAL=0,// scorched blue-grey metal
MAT_GLASS,// not a real chunk type, just plays an effect with glass sprites
MAT_ELECTRICAL,// sparks only
MAT_ELEC_METAL,// sparks/electrical type metal
MAT_DRK_STONE,// brown
MAT_LT_STONE,// tan
MAT_GLASS_METAL,// glass sprites and METAl chunk
MAT_METAL2,// electrical metal type
MAT_NONE,// no chunks
MAT_GREY_STONE,// grey
MAT_METAL3,// METAL and METAL2 chunks
MAT_CRATE1,// yellow multi-colored crate chunks
MAT_GRATE1,// grate chunks
MAT_ROPE,// for yavin trial...no chunks, just wispy bits
MAT_CRATE2,// read multi-colored crate chunks
MAT_WHITE_METAL,// white angular chunks
MAT_SNOWY_ROCK,// gray & brown chunks
NUM_MATERIALS
};
typedefintmaterial_t;
//rww - bot stuff that needs to be shared
#define MAX_WPARRAY_SIZE 4096
#define MAX_NEIGHBOR_SIZE 32
#define MAX_NEIGHBOR_LINK_DISTANCE 128
#define MAX_NEIGHBOR_FORCEJUMP_LINK_DISTANCE 400
#define DEFAULT_GRID_SPACING 400
typedefstructwpneighbor_s
{
intnum;
intforceJumpTo;
}wpneighbor_t;
typedefstructwpobject_s
{
vec3_torigin;
intinuse;
intindex;
floatweight;
floatdisttonext;
intflags;
intassociated_entity;
intforceJumpTo;
intneighbornum;
wpneighbor_tneighbors[MAX_NEIGHBOR_SIZE];
}wpobject_t;
#define NUMVERTEXNORMALS 162
externvec3_tbytedirs[NUMVERTEXNORMALS];
// all drawing is done to a 640*480 virtual screen size
// and will be automatically scaled to the real resolution
#define SCREEN_WIDTH 640
#define SCREEN_HEIGHT 480
#define TINYCHAR_WIDTH (SMALLCHAR_WIDTH)
#define TINYCHAR_HEIGHT (SMALLCHAR_HEIGHT/2)
#define SMALLCHAR_WIDTH 8
#define SMALLCHAR_HEIGHT 16
#define BIGCHAR_WIDTH 16
#define BIGCHAR_HEIGHT 16
#define GIANTCHAR_WIDTH 32
#define GIANTCHAR_HEIGHT 48
typedefenum
{
CT_NONE,
CT_BLACK,
CT_RED,
CT_GREEN,
CT_BLUE,
CT_YELLOW,
CT_MAGENTA,
CT_CYAN,
CT_WHITE,
CT_LTGREY,
CT_MDGREY,
CT_DKGREY,
CT_DKGREY2,
CT_VLTORANGE,
CT_LTORANGE,
CT_DKORANGE,
CT_VDKORANGE,
CT_VLTBLUE1,
CT_LTBLUE1,
CT_DKBLUE1,
CT_VDKBLUE1,
CT_VLTBLUE2,
CT_LTBLUE2,
CT_DKBLUE2,
CT_VDKBLUE2,
CT_VLTBROWN1,
CT_LTBROWN1,
CT_DKBROWN1,
CT_VDKBROWN1,
CT_VLTGOLD1,
CT_LTGOLD1,
CT_DKGOLD1,
CT_VDKGOLD1,
CT_VLTPURPLE1,
CT_LTPURPLE1,
CT_DKPURPLE1,
CT_VDKPURPLE1,
CT_VLTPURPLE2,
CT_LTPURPLE2,
CT_DKPURPLE2,
CT_VDKPURPLE2,
CT_VLTPURPLE3,
CT_LTPURPLE3,
CT_DKPURPLE3,
CT_VDKPURPLE3,
CT_VLTRED1,
CT_LTRED1,
CT_DKRED1,
CT_VDKRED1,
CT_VDKRED,
CT_DKRED,
CT_VLTAQUA,
CT_LTAQUA,
CT_DKAQUA,
CT_VDKAQUA,
CT_LTPINK,
CT_DKPINK,
CT_LTCYAN,
CT_DKCYAN,
CT_LTBLUE3,
CT_BLUE3,
CT_DKBLUE3,
CT_HUD_GREEN,
CT_HUD_RED,
CT_ICON_BLUE,
CT_NO_AMMO_RED,
CT_HUD_ORANGE,
CT_MAX
}ct_table_t;
externvec4_tcolorTable[CT_MAX];
externvec4_tcolorBlack;
externvec4_tcolorRed;
externvec4_tcolorGreen;
externvec4_tcolorBlue;
externvec4_tcolorYellow;
externvec4_tcolorMagenta;
externvec4_tcolorCyan;
externvec4_tcolorWhite;
externvec4_tcolorLtGrey;
externvec4_tcolorMdGrey;
externvec4_tcolorDkGrey;
externvec4_tcolorLtBlue;
externvec4_tcolorDkBlue;
#define Q_COLOR_ESCAPE '^'
// you MUST have the last bit on here about colour strings being less than 7 or taiwanese strings register as colour!!!!
intforcePowerDebounce[NUM_FORCE_POWERS];//for effects that must have an interval
intforcePowersKnown;
intforcePowersActive;
intforcePowerSelected;
intforceButtonNeedRelease;
intforcePowerDuration[NUM_FORCE_POWERS];
intforcePower;
intforcePowerMax;
intforcePowerRegenDebounceTime;
intforcePowerLevel[NUM_FORCE_POWERS];//so we know the max forceJump power you have
intforcePowerBaseLevel[NUM_FORCE_POWERS];
intforceUsingAdded;
floatforceJumpZStart;//So when you land, you don't get hurt as much
floatforceJumpCharge;//you're current forceJump charge-up level, increases the longer you hold the force jump button down
intforceJumpSound;
intforceJumpAddTime;
intforceGripEntityNum;//what entity I'm gripping
intforceGripDamageDebounceTime;//debounce for grip damage
floatforceGripBeingGripped;//if > level.time then client is in someone's grip
intforceGripCripple;//if != 0 then make it so this client can't move quickly (he's being gripped)
intforceGripUseTime;//can't use if > level.time
floatforceGripSoundTime;
floatforceGripStarted;//level.time when the grip was activated
intforceHealTime;
intforceHealAmount;
//This hurts me somewhat to do, but there's no other real way to allow completely "dynamic" mindtricking.
intforceMindtrickTargetIndex;//0-15
intforceMindtrickTargetIndex2;//16-32
intforceMindtrickTargetIndex3;//33-48
intforceMindtrickTargetIndex4;//49-64
intforceRageRecoveryTime;
intforceDrainEntNum;
floatforceDrainTime;
intforceDoInit;
intforceSide;
intforceRank;
intforceDeactivateAll;
intkillSoundEntIndex[TRACK_CHANNEL_MAX];//this goes here so it doesn't get wiped over respawn
qbooleansentryDeployed;
intsaberAnimLevelBase;//sigh...
intsaberAnimLevel;
intsaberDrawAnimLevel;
intsuicides;
intprivateDuelTime;
}forcedata_t;
typedefenum{
SENTRY_NOROOM=1,
SENTRY_ALREADYPLACED,
SHIELD_NOROOM,
SEEKER_ALREADYDEPLOYED
}itemUseFail_t;
// bit field limits
#define MAX_STATS 16
#define MAX_PERSISTANT 16
#define MAX_POWERUPS 16
#define MAX_WEAPONS 19
#define MAX_PS_EVENTS 2
#define PS_PMOVEFRAMECOUNTBITS 6
#define FORCE_LIGHTSIDE 1
#define FORCE_DARKSIDE 2
#define MAX_FORCE_RANK 7
#define FALL_FADE_TIME 3000
//#define _ONEBIT_COMBO
//Crazy optimization attempt to take all those 1 bit values and shove them into a single
//send. May help us not have to send so many 1/0 bits to acknowledge modified values. -rww
#define _OPTIMIZED_VEHICLE_NETWORKING
//Instead of sending 2 full playerStates for the pilot and the vehicle, send a smaller,
//specialized pilot playerState and vehicle playerState. Also removes some vehicle
//fields from the normal playerState -mcg
// playerState_t is the information needed by both the client and server
// to predict player motion and actions
// nothing outside of pmove should modify these, or some degree of prediction error
// will occur
// you can't add anything to this without modifying the code in msg.c
// playerState_t is a full superset of entityState_t as it is used by players,
// so if a playerState_t is transmitted, the entityState_t can be fully derived
// from it.
typedefstructplayerState_s{
intcommandTime;// cmd->serverTime of last executed command
intpm_type;
intbobCycle;// for view bobbing and footstep generation
intpm_flags;// ducked, jump_held, etc
intpm_time;
vec3_torigin;
vec3_tvelocity;
vec3_tmoveDir;//NOT sent over the net - nor should it be.
intweaponTime;
intweaponChargeTime;
intweaponChargeSubtractTime;
intgravity;
floatspeed;
intbasespeed;//used in prediction to know base server g_speed value when modifying speed between updates
intdelta_angles[3];// add to command angles to get view direction
// changed by spawns, rotating objects, and teleporters
intslopeRecalcTime;//this is NOT sent across the net and is maintained seperately on game and cgame in pmove code.
intuseTime;
intgroundEntityNum;// ENTITYNUM_NONE = in air
intlegsTimer;// don't change low priority animations until this runs out
intlegsAnim;
inttorsoTimer;// don't change low priority animations until this runs out
inttorsoAnim;
qbooleanlegsFlip;//set to opposite when the same anim needs restarting, sent over in only 1 bit. Cleaner and makes porting easier than having that god forsaken ANIM_TOGGLEBIT.
qbooleantorsoFlip;
intmovementDir;// a number 0 to 7 that represents the reletive angle
// of movement to the view angle (axial and diagonals)
// when at rest, the value will remain unchanged
// used to twist the legs during strafing
inteFlags;// copied to entityState_t->eFlags
inteFlags2;// copied to entityState_t->eFlags2, EF2_??? used much less frequently
inteventSequence;// pmove generated events
intevents[MAX_PS_EVENTS];
inteventParms[MAX_PS_EVENTS];
intexternalEvent;// events set on player from another source
intexternalEventParm;
intexternalEventTime;
intclientNum;// ranges from 0 to MAX_CLIENTS-1
intweapon;// copied to entityState_t->weapon
intweaponstate;
vec3_tviewangles;// for fixed views
intviewheight;
// damage feedback
intdamageEvent;// when it changes, latch the other parms
intdamageYaw;
intdamagePitch;
intdamageCount;
intdamageType;
intpainTime;// used for both game and client side to process the pain twitch - NOT sent across the network
intpainDirection;// NOT sent across the network
floatyawAngle;// NOT sent across the network
qbooleanyawing;// NOT sent across the network
floatpitchAngle;// NOT sent across the network
qbooleanpitching;// NOT sent across the network
intstats[MAX_STATS];
intpersistant[MAX_PERSISTANT];// stats that aren't cleared on death
intpowerups[MAX_POWERUPS];// level.time that the powerup runs out
intammo[MAX_WEAPONS];
intgeneric1;
intloopSound;
intjumppad_ent;// jumppad entity hit this frame
// not communicated over the net at all
intping;// server to game info for scoreboard
intpmove_framecount;// FIXME: don't transmit over the network
intjumppad_frame;
intentityEventSequence;
intlastOnGround;//last time you were on the ground
qbooleansaberInFlight;
intsaberMove;
intsaberBlocking;
intsaberBlocked;
intsaberLockTime;
intsaberLockEnemy;
intsaberLockFrame;//since we don't actually have the ability to get the current anim frame
intsaberLockHits;//every x number of buttons hits, allow one push forward in a saber lock (server only)
intsaberLockHitCheckTime;//so we don't allow more than 1 push per server frame
intsaberLockHitIncrementTime;//so we don't add a hit per attack button press more than once per server frame
qbooleansaberLockAdvance;//do an advance (sent across net as 1 bit)
intsaberEntityNum;
floatsaberEntityDist;
intsaberEntityState;
intsaberThrowDelay;
qbooleansaberCanThrow;
intsaberDidThrowTime;
intsaberDamageDebounceTime;
intsaberHitWallSoundDebounceTime;
intsaberEventFlags;
introcketLockIndex;
floatrocketLastValidTime;
floatrocketLockTime;
floatrocketTargetTime;
intemplacedIndex;
floatemplacedTime;
qbooleanisJediMaster;
qbooleanforceRestricted;
qbooleantrueJedi;
qbooleantrueNonJedi;
intsaberIndex;
intgenericEnemyIndex;
floatdroneFireTime;
floatdroneExistTime;
intactiveForcePass;
qbooleanhasDetPackPlanted;//better than taking up an eFlag isn't it?
floatholocronsCarried[NUM_FORCE_POWERS];
intholocronCantTouch;
floatholocronCantTouchTime;//for keeping track of the last holocron that just popped out of me (if any)
intholocronBits;
intelectrifyTime;
intsaberAttackSequence;
intsaberIdleWound;
intsaberAttackWound;
intsaberBlockTime;
intotherKiller;
intotherKillerTime;
intotherKillerDebounceTime;
forcedata_tfd;
qbooleanforceJumpFlip;
intforceHandExtend;
intforceHandExtendTime;
intforceRageDrainTime;
intforceDodgeAnim;
qbooleanquickerGetup;
intgroundTime;// time when first left ground
intfootstepTime;
intotherSoundTime;
floatotherSoundLen;
intforceGripMoveInterval;
intforceGripChangeMovetype;
intforceKickFlip;
intduelIndex;
intduelTime;
qbooleanduelInProgress;
intsaberAttackChainCount;
intsaberHolstered;
intforceAllowDeactivateTime;
// zoom key
intzoomMode;// 0 - not zoomed, 1 - disruptor weapon
intzoomTime;
qbooleanzoomLocked;
floatzoomFov;
intzoomLockTime;
intfallingToDeath;
intuseDelay;
qbooleaninAirAnim;
vec3_tlastHitLoc;
intheldByClient;//can only be a client index - this client should be holding onto my arm using IK stuff.
intragAttach;//attach to ent while ragging
intiModelScale;
intbrokenLimbs;
//for looking at an entity's origin (NPCs and players)
qbooleanhasLookTarget;
intlookTarget;
intcustomRGBA[4];
intstandheight;
intcrouchheight;
//If non-0, this is the index of the vehicle a player/NPC is riding.
intm_iVehicleNum;
//lovely hack for keeping vehicle orientation in sync with prediction
vec3_tvehOrientation;
qbooleanvehBoarding;
intvehSurfaces;
//vehicle turnaround stuff (need this in ps so it doesn't jerk too much in prediction)
intvehTurnaroundIndex;
intvehTurnaroundTime;
//vehicle has weapons linked
qbooleanvehWeaponsLinked;
//when hyperspacing, you just go forward really fast for HYPERSPACE_TIME
inthyperSpaceTime;
vec3_thyperSpaceAngles;
//hacking when > time
inthackingTime;
//actual hack amount - only for the proper percentage display when
//drawing progress bar (is there a less bandwidth-eating way to do
//this without a lot of hassle?)
inthackingBaseTime;
//keeps track of jetpack fuel
intjetpackFuel;
//keeps track of cloak fuel
intcloakFuel;
//rww - spare values specifically for use by mod authors.
//See psf_overrides.txt if you want to increase the send
intweapon;// determines weapon and flash model, etc
intlegsAnim;
inttorsoAnim;
qbooleanlegsFlip;//set to opposite when the same anim needs restarting, sent over in only 1 bit. Cleaner and makes porting easier than having that god forsaken ANIM_TOGGLEBIT.
qbooleantorsoFlip;
intforceFrame;//if non-zero, force the anim frame
intgeneric1;
intheldByClient;//can only be a client index - this client should be holding onto my arm using IK stuff.
intragAttach;//attach to ent while ragging
intiModelScale;//rww - transfer a percentage of the normal scale in a single int instead of 3 x-y-z scale values
intbrokenLimbs;
intboltToPlayer;//set to index of a real client+1 to bolt the ent to that client. Must be a real client, NOT an NPC.
//for looking at an entity's origin (NPCs and players)
qbooleanhasLookTarget;
intlookTarget;
intcustomRGBA[4];
//I didn't want to do this, but I.. have no choice. However, we aren't setting this for all ents or anything,
//only ones we want health knowledge about on cgame (like siege objective breakables) -rww
inthealth;
intmaxhealth;//so I know how to draw the stupid health bar
wordowner;// so crosshair knows what it's looking at
wordpowerups;// bit flags
wordlegsAnim;
wordtorsoAnim;
wordforceFrame;//if non-zero, force the anim frame
wordragAttach;//attach to ent while ragging
shortiModelScale;//rww - transfer a percentage of the normal scale in a single int instead of 3 x-y-z scale values
wordlookTarget;
wordhealth;
wordmaxhealth;//so I know how to draw the stupid health bar
wordnpcSaber1;
wordnpcSaber2;
wordboneOrient;//packed with x, y, z orientations for bone angles
//If non-0, this is the index of the vehicle a player/NPC is riding.
wordm_iVehicleNum;
// Now, the 8-bit members. These start out two bytes off, thanks to the above word
byteeType;// entityType_t
byteeFlags2;// EF2_??? used much less frequently
bytebolt1;
bytefireflag;
byteactiveForcePass;
byteloopSound;// constantly loop this sound
byteloopIsSoundset;//qtrue if the loopSound index is actually a soundset index
bytesoundSetIndex;
bytemodelGhoul2;
byteg2radius;
bytemodelindex2;
bytesaberInFlight;
bytesaberMove;
byteisJediMaster;
bytesaberHolstered;//sent in only 2 bytes, should be 0, 1 or 2
byteisPortalEnt;//this needs to be seperate for all entities I guess, which is why I couldn't reuse another value.
byteeventParm;
byteteamowner;
byteshouldtarget;
byteweapon;// determines weapon and flash model, etc
bytelegsFlip;//set to opposite when the same anim needs restarting, sent over in only 1 bit. Cleaner and makes porting easier than having that god forsaken ANIM_TOGGLEBIT.
bytetorsoFlip;
bytegeneric1;
byteheldByClient;//can only be a client index - this client should be holding onto my arm using IK stuff.
bytebrokenLimbs;
byteboltToPlayer;//set to index of a real client+1 to bolt the ent to that client. Must be a real client, NOT an NPC.
bytehasLookTarget;//for looking at an entity's origin (NPCs and players)
//index values for each type of sound, gets the folder the sounds
//are in. I wish there were a better way to do this,
bytecsSounds_Std;
bytecsSounds_Combat;
bytecsSounds_Extra;
bytecsSounds_Jedi;
//Allow up to 4 PCJ lookup values to be stored here.
//The resolve to configstrings which contain the name of the
//desired bone.
byteboneIndex1;
byteboneIndex2;
byteboneIndex3;
byteboneIndex4;
byteNPC_class;//we need to see what it is on the client for a few effects.
bytealignPad[3];
}entityState_t;
#pragma pack(pop)
#endif
typedefenum{
CA_UNINITIALIZED,
CA_DISCONNECTED,// not talking to a server
CA_AUTHORIZING,// not used any more, was checking cd key
CA_CONNECTING,// sending request packets to the server
CA_CHALLENGING,// sending challenge packets to the server
CA_LOADING,// only during cgame initialization, never during main loop
CA_PRIMED,// got gamestate, waiting for first frame
CA_ACTIVE,// game views should be displayed
CA_CINEMATIC// playing a cinematic or a static pic, not connected to a server
}connstate_t;
#define Square(x) ((x)*(x))
// real time
//=============================================
typedefstructqtime_s{
inttm_sec;/* seconds after the minute - [0,59] */
inttm_min;/* minutes after the hour - [0,59] */
inttm_hour;/* hours since midnight - [0,23] */
inttm_mday;/* day of the month - [1,31] */
inttm_mon;/* months since January - [0,11] */
inttm_year;/* years since 1900 */
inttm_wday;/* days since Sunday - [0,6] */
inttm_yday;/* days since January 1 - [0,365] */
inttm_isdst;/* daylight savings time flag */
}qtime_t;
// server browser sources
#define AS_LOCAL 0
#define AS_GLOBAL 1
#define AS_FAVORITES 2
#define AS_MPLAYER 3 // (Obsolete)
// cinematic states
typedefenum{
FMV_IDLE,
FMV_PLAY,// play
FMV_EOF,// all other conditions, i.e. stop/EOF/abort
FMV_ID_BLT,
FMV_ID_IDLE,
FMV_LOOPED,
FMV_ID_WAIT
};
typedefinte_status;
typedefenum_flag_status{
FLAG_ATBASE=0,
FLAG_TAKEN,// CTF
FLAG_TAKEN_RED,// One Flag CTF
FLAG_TAKEN_BLUE,// One Flag CTF
FLAG_DROPPED
};
typedefintflagStatus_t;
#ifdef _XBOX
#define MAX_GLOBAL_SERVERS 50
#define MAX_OTHER_SERVERS 16
#else
#define MAX_GLOBAL_SERVERS 2048
#define MAX_OTHER_SERVERS 128
#endif
#define MAX_PINGREQUESTS 32
#define MAX_SERVERSTATUSREQUESTS 16
#define SAY_ALL 0
#define SAY_TEAM 1
#define SAY_TELL 2
#define CDKEY_LEN 16
#define CDCHKSUM_LEN 2
voidRand_Init(intseed);
floatflrand(floatmin,floatmax);
intirand(intmin,intmax);
intQ_irand(intvalue1,intvalue2);
/*
Ghoul2InsertStart
*/
typedefstruct{
floatmatrix[3][4];
}mdxaBone_t;
// For ghoul2 axis use
typedefenumEorientations
{
ORIGIN=0,
POSITIVE_X,
POSITIVE_Z,
POSITIVE_Y,
NEGATIVE_X,
NEGATIVE_Z,
NEGATIVE_Y
};
/*
Ghoul2InsertEnd
*/
// define the new memory tags for the zone, used by all modules now
//
#define TAGDEF(blah) TAG_ ## blah
typedefenum{
#include"../qcommon/tags.h"
};
typedefcharmemtag_t;
//rww - conveniently toggle "gore" code, for model decals and stuff.
#define _G2_GORE
typedefstructSSkinGoreData_s
{
vec3_tangles;
vec3_tposition;
intcurrentTime;
intentNum;
vec3_trayDirection;// in world space
vec3_thitLocation;// in world space
vec3_tscale;
floatSSize;// size of splotch in the S texture direction in world units
floatTSize;// size of splotch in the T texture direction in world units
floattheta;// angle to rotate the splotch
// growing stuff
intgrowDuration;// time over which we want this to scale up, set to -1 for no scaling
floatgoreScaleStartFraction;// fraction of the final size at which we want the gore to initially appear
qbooleanfrontFaces;
qbooleanbackFaces;
qbooleanbaseModelOnly;
intlifeTime;// effect expires after this amount of time
intfadeOutTime;//specify the duration of fading, from the lifeTime (e.g. 3000 will start fading 3 seconds before removal and be faded entirely by removal)
intshrinkOutTime;// unimplemented
floatalphaModulate;// unimplemented
vec3_ttint;// unimplemented
floatimpactStrength;// unimplemented
intshader;// shader handle
intmyIndex;// used internally
qbooleanfadeRGB;//specify fade method to modify RGB (by default, the alpha is set instead)