cleaned up the powerup code

This commit is contained in:
Bryce Hutchings 2002-07-22 06:35:03 +00:00
parent 2c80feef38
commit 862df910c1
14 changed files with 87 additions and 431 deletions

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.60 2002/07/22 06:31:32 niceass
// cleaned up the powerup code
//
// Revision 1.59 2002/07/19 04:34:48 niceass // Revision 1.59 2002/07/19 04:34:48 niceass
// drawping fixed // drawping fixed
// //
@ -1865,10 +1868,7 @@ static void CG_ScanForCrosshairEntity(void)
if (content & CONTENTS_FOG) { if (content & CONTENTS_FOG) {
return; return;
} }
// if the player is invisible, don't show it
if (cg_entities[trace.entityNum].currentState.powerups & (1 << PW_INVIS)) {
return;
}
// update the fade timer // update the fade timer
cg.crosshairClientNum = trace.entityNum; cg.crosshairClientNum = trace.entityNum;
cg.crosshairClientTime = cg.time; cg.crosshairClientTime = cg.time;

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.67 2002/07/22 06:31:11 niceass
// cleaned up the powerup code
//
// Revision 1.66 2002/07/07 18:36:13 jbravo // Revision 1.66 2002/07/07 18:36:13 jbravo
// Added an AntiIdle system. Can play insane sounds for idle players, drop them // Added an AntiIdle system. Can play insane sounds for idle players, drop them
// from teams or kick them. Upped version to Beta 2.1 // from teams or kick them. Upped version to Beta 2.1
@ -1336,30 +1339,6 @@ void CG_EntityEvent(centity_t * cent, vec3_t position)
// //
// powerup events // powerup events
// //
case EV_POWERUP_QUAD:
DEBUGNAME("EV_POWERUP_QUAD");
if (es->number == cg.snap->ps.clientNum) {
cg.powerupActive = PW_QUAD;
cg.powerupTime = cg.time;
}
trap_S_StartSound(NULL, es->number, CHAN_ITEM, cgs.media.quadSound);
break;
case EV_POWERUP_BATTLESUIT:
DEBUGNAME("EV_POWERUP_BATTLESUIT");
if (es->number == cg.snap->ps.clientNum) {
cg.powerupActive = PW_BATTLESUIT;
cg.powerupTime = cg.time;
}
trap_S_StartSound(NULL, es->number, CHAN_ITEM, cgs.media.protectSound);
break;
case EV_POWERUP_REGEN:
DEBUGNAME("EV_POWERUP_REGEN");
if (es->number == cg.snap->ps.clientNum) {
cg.powerupActive = PW_REGEN;
cg.powerupTime = cg.time;
}
trap_S_StartSound(NULL, es->number, CHAN_ITEM, cgs.media.regenSound);
break;
case EV_GIB_PLAYER: case EV_GIB_PLAYER:
DEBUGNAME("EV_GIB_PLAYER"); DEBUGNAME("EV_GIB_PLAYER");

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.41 2002/07/22 06:30:52 niceass
// cleaned up the powerup code
//
// Revision 1.40 2002/07/11 16:29:16 makro // Revision 1.40 2002/07/11 16:29:16 makro
// Dust has a different color for snow surfaces now // Dust has a different color for snow surfaces now
// //
@ -1506,11 +1509,7 @@ static void CG_PlayerAnimation(centity_t * cent, int *legsOld, int *legs, float
return; return;
} }
if (cent->currentState.powerups & (1 << PW_HASTE)) { speedScale = 1;
speedScale = 1.5;
} else {
speedScale = 1;
}
ci = &cgs.clientinfo[clientNum]; ci = &cgs.clientinfo[clientNum];
@ -1796,39 +1795,6 @@ static void CG_HCSmokeTrail(centity_t * cent)
smoke->leType = LE_SCALE_FADE; smoke->leType = LE_SCALE_FADE;
} }
/*
===============
CG_HasteTrail
===============
*/
static void CG_HasteTrail(centity_t * cent)
{
localEntity_t *smoke;
vec3_t origin;
int anim;
if (cent->trailTime > cg.time) {
return;
}
anim = cent->pe.legs.animationNumber & ~ANIM_TOGGLEBIT;
if (anim != LEGS_RUN && anim != LEGS_BACK) {
return;
}
cent->trailTime += 100;
if (cent->trailTime < cg.time) {
cent->trailTime = cg.time;
}
VectorCopy(cent->lerpOrigin, origin);
origin[2] -= 16;
smoke = CG_SmokePuff(origin, vec3_origin, 8, 1, 1, 1, 1, 500, cg.time, 0, 0, cgs.media.hastePuffShader);
// use the optimized local entity add
smoke->leType = LE_SCALE_FADE;
}
/* /*
=============== ===============
CG_BreathPuffs CG_BreathPuffs
@ -2109,15 +2075,6 @@ static void CG_PlayerPowerups(centity_t * cent, refEntity_t * torso)
if (!powerups) { if (!powerups) {
return; return;
} }
// quad gives a dlight
if (powerups & (1 << PW_QUAD)) {
trap_R_AddLightToScene(cent->lerpOrigin, 200 + (rand() & 31), 0.2f, 0.2f, 1);
}
// flight plays a looped sound
if (powerups & (1 << PW_FLIGHT)) {
trap_S_AddLoopingSound(cent->currentState.number, cent->lerpOrigin, vec3_origin, cgs.media.flightSound);
}
ci = &cgs.clientinfo[cent->currentState.clientNum]; ci = &cgs.clientinfo[cent->currentState.clientNum];
// redflag // redflag
if (powerups & (1 << PW_REDFLAG)) { if (powerups & (1 << PW_REDFLAG)) {
@ -2146,10 +2103,6 @@ static void CG_PlayerPowerups(centity_t * cent, refEntity_t * torso)
} }
trap_R_AddLightToScene(cent->lerpOrigin, 200 + (rand() & 31), 1.0, 1.0, 1.0); trap_R_AddLightToScene(cent->lerpOrigin, 200 + (rand() & 31), 1.0, 1.0, 1.0);
} }
// haste leaves smoke trails
if (powerups & (1 << PW_HASTE)) {
CG_HasteTrail(cent);
}
// Elder: HC Smoke // Elder: HC Smoke
//if ( powerups & ( 1 << PW_HANDCANNON_SMOKED) ) { //if ( powerups & ( 1 << PW_HANDCANNON_SMOKED) ) {
//CG_HCSmokeTrail( cent ); //CG_HCSmokeTrail( cent );
@ -2282,10 +2235,7 @@ static qboolean CG_PlayerShadow(centity_t * cent, float *shadowPlane)
if (cg_shadows.integer == 0) { if (cg_shadows.integer == 0) {
return qfalse; return qfalse;
} }
// no shadows when invisible
if (cent->currentState.powerups & (1 << PW_INVIS)) {
return qfalse;
}
// send a trace down from the player to the ground // send a trace down from the player to the ground
VectorCopy(cent->lerpOrigin, end); VectorCopy(cent->lerpOrigin, end);
end[2] -= SHADOW_DISTANCE; end[2] -= SHADOW_DISTANCE;
@ -2413,48 +2363,25 @@ Also called by CG_Missile for quad rockets, but nobody can tell...
void CG_AddRefEntityWithPowerups(refEntity_t * ent, entityState_t * state, int team) void CG_AddRefEntityWithPowerups(refEntity_t * ent, entityState_t * state, int team)
{ {
if (state->powerups & (1 << PW_INVIS)) { /*
ent->customShader = cgs.media.invisShader; if ( state->eFlags & EF_KAMIKAZE ) {
trap_R_AddRefEntityToScene(ent); if (team == TEAM_BLUE)
} else { ent->customShader = cgs.media.blueKamikazeShader;
/* else
if ( state->eFlags & EF_KAMIKAZE ) { ent->customShader = cgs.media.redKamikazeShader;
if (team == TEAM_BLUE) trap_R_AddRefEntityToScene( ent );
ent->customShader = cgs.media.blueKamikazeShader; }
else else { */
ent->customShader = cgs.media.redKamikazeShader; trap_R_AddRefEntityToScene(ent);
trap_R_AddRefEntityToScene( ent ); //}
}
else { */
trap_R_AddRefEntityToScene(ent);
//}
if (state->powerups & (1 << PW_QUAD)) { //Elder: IR Vision -- only on players that are alive
if (team == TEAM_RED) if (state->eType == ET_PLAYER) {
ent->customShader = cgs.media.redQuadShader; if (bg_itemlist[cg.snap->ps.stats[STAT_HOLDABLE_ITEM]].giTag == HI_BANDOLIER &&
else cg.rq3_irvision && !(state->eFlags & EF_DEAD)) {
ent->customShader = cgs.media.quadShader; ent->customShader = cgs.media.irPlayerShader;
trap_R_AddRefEntityToScene(ent); trap_R_AddRefEntityToScene(ent);
} }
if (state->powerups & (1 << PW_REGEN)) {
if (((cg.time / 100) % 10) == 1) {
ent->customShader = cgs.media.regenShader;
trap_R_AddRefEntityToScene(ent);
}
}
if (state->powerups & (1 << PW_BATTLESUIT)) {
ent->customShader = cgs.media.battleSuitShader;
trap_R_AddRefEntityToScene(ent);
}
//Elder: IR Vision -- only on players that are alive
if (state->eType == ET_PLAYER) {
if (bg_itemlist[cg.snap->ps.stats[STAT_HOLDABLE_ITEM]].giTag == HI_BANDOLIER &&
cg.rq3_irvision && !(state->eFlags & EF_DEAD)) {
ent->customShader = cgs.media.irPlayerShader;
trap_R_AddRefEntityToScene(ent);
}
}
} }
} }

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.91 2002/07/22 06:30:12 niceass
// cleaned up the powerup code
//
// Revision 1.90 2002/07/13 22:42:18 makro // Revision 1.90 2002/07/13 22:42:18 makro
// Semi-working fog hull, semi-working sky portals (cgame code commented out) // Semi-working fog hull, semi-working sky portals (cgame code commented out)
// Basically, semi-working stuff :P // Basically, semi-working stuff :P
@ -1375,22 +1378,7 @@ CG_AddWeaponWithPowerups
*/ */
static void CG_AddWeaponWithPowerups(refEntity_t * gun, int powerups) static void CG_AddWeaponWithPowerups(refEntity_t * gun, int powerups)
{ {
// add powerup effects trap_R_AddRefEntityToScene(gun);
if (powerups & (1 << PW_INVIS)) {
gun->customShader = cgs.media.invisShader;
trap_R_AddRefEntityToScene(gun);
} else {
trap_R_AddRefEntityToScene(gun);
if (powerups & (1 << PW_BATTLESUIT)) {
gun->customShader = cgs.media.battleWeaponShader;
trap_R_AddRefEntityToScene(gun);
}
if (powerups & (1 << PW_QUAD)) {
gun->customShader = cgs.media.quadWeaponShader;
trap_R_AddRefEntityToScene(gun);
}
}
} }
/* /*
@ -1750,6 +1738,7 @@ void CG_AddPlayerWeapon(refEntity_t * parent, playerState_t * ps, centity_t * ce
cent->ejectBrassTime = 0; cent->ejectBrassTime = 0;
} }
if ( cent->currentState.number != cg.predictedPlayerState.clientNum ) { if ( cent->currentState.number != cg.predictedPlayerState.clientNum ) {
refEntity_t muzzle; refEntity_t muzzle;
memset(&muzzle, 0, sizeof(muzzle)); memset(&muzzle, 0, sizeof(muzzle));
@ -2715,10 +2704,6 @@ void CG_FireWeapon(centity_t * cent, int weapModification)
} }
*/ */
// play quad sound if needed
if (cent->currentState.powerups & (1 << PW_QUAD)) {
trap_S_StartSound(NULL, cent->currentState.number, CHAN_ITEM, cgs.media.quadSound);
}
//Elder: silencer stuff //Elder: silencer stuff
if (weapModification == RQ3_WPMOD_SILENCER) { if (weapModification == RQ3_WPMOD_SILENCER) {
trap_S_StartSound(NULL, ent->number, CHAN_WEAPON, cgs.media.silencerSound); trap_S_StartSound(NULL, ent->number, CHAN_WEAPON, cgs.media.silencerSound);

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.9 2002/07/22 06:35:03 niceass
// cleaned up the powerup code
//
// Revision 1.8 2002/06/16 20:06:13 jbravo // Revision 1.8 2002/06/16 20:06:13 jbravo
// Reindented all the source files with "indent -kr -ut -i8 -l120 -lc120 -sob -bad -bap" // Reindented all the source files with "indent -kr -ut -i8 -l120 -lc120 -sob -bad -bap"
// //
@ -489,11 +492,7 @@ int BotValidChatPosition(bot_state_t * bs)
//if the bot is dead all positions are valid //if the bot is dead all positions are valid
if (BotIsDead(bs)) if (BotIsDead(bs))
return qtrue; return qtrue;
//never start chatting with a powerup
if (bs->inventory[INVENTORY_QUAD] ||
bs->inventory[INVENTORY_HASTE] ||
bs->inventory[INVENTORY_INVISIBILITY] || bs->inventory[INVENTORY_REGEN] || bs->inventory[INVENTORY_FLIGHT])
return qfalse;
//must be on the ground //must be on the ground
//if (bs->cur_ps.groundEntityNum != ENTITYNUM_NONE) return qfalse; //if (bs->cur_ps.groundEntityNum != ENTITYNUM_NONE) return qfalse;
//do not chat if in lava or slime //do not chat if in lava or slime

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.50 2002/07/22 06:34:46 niceass
// cleaned up the powerup code
//
// Revision 1.49 2002/07/02 20:22:35 jbravo // Revision 1.49 2002/07/02 20:22:35 jbravo
// Changed the files to use the right ui. // Changed the files to use the right ui.
// //
@ -768,9 +771,7 @@ qboolean EntityIsInvisible(aas_entityinfo_t * entinfo)
if (EntityCarriesFlag(entinfo)) { if (EntityCarriesFlag(entinfo)) {
return qfalse; return qfalse;
} }
if (entinfo->powerups & (1 << PW_INVIS)) {
return qtrue;
}
return qfalse; return qfalse;
} }
@ -807,9 +808,6 @@ EntityHasQuad
*/ */
qboolean EntityHasQuad(aas_entityinfo_t * entinfo) qboolean EntityHasQuad(aas_entityinfo_t * entinfo)
{ {
if (entinfo->powerups & (1 << PW_QUAD)) {
return qtrue;
}
return qfalse; return qfalse;
} }
@ -1815,12 +1813,6 @@ void BotUpdateInventory(bot_state_t * bs)
bs->inventory[INVENTORY_HEALTH] = bs->cur_ps.stats[STAT_HEALTH]; bs->inventory[INVENTORY_HEALTH] = bs->cur_ps.stats[STAT_HEALTH];
//bs->inventory[INVENTORY_TELEPORTER] = bs->cur_ps.stats[STAT_HOLDABLE_ITEM] == MODELINDEX_TELEPORTER; //bs->inventory[INVENTORY_TELEPORTER] = bs->cur_ps.stats[STAT_HOLDABLE_ITEM] == MODELINDEX_TELEPORTER;
//bs->inventory[INVENTORY_MEDKIT] = bs->cur_ps.stats[STAT_HOLDABLE_ITEM] == MODELINDEX_MEDKIT; //bs->inventory[INVENTORY_MEDKIT] = bs->cur_ps.stats[STAT_HOLDABLE_ITEM] == MODELINDEX_MEDKIT;
bs->inventory[INVENTORY_QUAD] = bs->cur_ps.powerups[PW_QUAD] != 0;
bs->inventory[INVENTORY_ENVIRONMENTSUIT] = bs->cur_ps.powerups[PW_BATTLESUIT] != 0;
bs->inventory[INVENTORY_HASTE] = bs->cur_ps.powerups[PW_HASTE] != 0;
bs->inventory[INVENTORY_INVISIBILITY] = bs->cur_ps.powerups[PW_INVIS] != 0;
bs->inventory[INVENTORY_REGEN] = bs->cur_ps.powerups[PW_REGEN] != 0;
bs->inventory[INVENTORY_FLIGHT] = bs->cur_ps.powerups[PW_FLIGHT] != 0;
bs->inventory[INVENTORY_REDFLAG] = bs->cur_ps.powerups[PW_REDFLAG] != 0; bs->inventory[INVENTORY_REDFLAG] = bs->cur_ps.powerups[PW_REDFLAG] != 0;
bs->inventory[INVENTORY_BLUEFLAG] = bs->cur_ps.powerups[PW_BLUEFLAG] != 0; bs->inventory[INVENTORY_BLUEFLAG] = bs->cur_ps.powerups[PW_BLUEFLAG] != 0;
@ -2143,14 +2135,6 @@ BotAggression
*/ */
float BotAggression(bot_state_t * bs) float BotAggression(bot_state_t * bs)
{ {
//if the bot has quad
if (bs->inventory[INVENTORY_QUAD]) {
//if the bot is not holding the gauntlet or the enemy is really nearby
//Blaze: Check for knife probably same logic as slashing as gauntlet???
if (bs->weaponnum != WP_KNIFE || bs->inventory[ENEMY_HORIZONTAL_DIST] < 80) {
return 70;
}
}
//if the enemy is located way higher than the bot //if the enemy is located way higher than the bot
if (bs->inventory[ENEMY_HEIGHT] > 200) if (bs->inventory[ENEMY_HEIGHT] > 200)
return 0; return 0;
@ -5173,11 +5157,6 @@ BotCheckAir
*/ */
void BotCheckAir(bot_state_t * bs) void BotCheckAir(bot_state_t * bs)
{ {
if (bs->inventory[INVENTORY_ENVIRONMENTSUIT] <= 0) {
if (trap_AAS_PointContents(bs->eye) & (CONTENTS_WATER | CONTENTS_SLIME | CONTENTS_LAVA)) {
return;
}
}
bs->lastair_time = FloatTime(); bs->lastair_time = FloatTime();
} }

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.44 2002/07/22 06:34:13 niceass
// cleaned up the powerup code
//
// Revision 1.43 2002/07/01 02:18:42 jbravo // Revision 1.43 2002/07/01 02:18:42 jbravo
// Small fixes to CTB and possible fix for subs and limchasecam // Small fixes to CTB and possible fix for subs and limchasecam
// //
@ -1158,10 +1161,6 @@ char *eventnames[] = {
"EV_OBITUARY_STOMACH", "EV_OBITUARY_STOMACH",
"EV_OBITUARY_LEGS", "EV_OBITUARY_LEGS",
"EV_POWERUP_QUAD",
"EV_POWERUP_BATTLESUIT",
"EV_POWERUP_REGEN",
"EV_GIB_PLAYER", // gib a previously living player "EV_GIB_PLAYER", // gib a previously living player
"EV_BREAK_GLASS1", // Blaze: Breakable glass "EV_BREAK_GLASS1", // Blaze: Breakable glass
"EV_BREAK_GLASS2", "EV_BREAK_GLASS2",
@ -1230,10 +1229,7 @@ void BG_TouchJumpPad(playerState_t * ps, entityState_t * jumppad)
if (ps->pm_type != PM_NORMAL) { if (ps->pm_type != PM_NORMAL) {
return; return;
} }
// flying characters don't hit bounce pads
if (ps->powerups[PW_FLIGHT]) {
return;
}
//Makro - disable all this for bot only triggers //Makro - disable all this for bot only triggers
if (!jumppad->powerups) { if (!jumppad->powerups) {
// if we didn't hit this same jumppad the previous frame // if we didn't hit this same jumppad the previous frame

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.87 2002/07/22 06:33:58 niceass
// cleaned up the powerup code
//
// Revision 1.86 2002/07/21 18:52:39 niceass // Revision 1.86 2002/07/21 18:52:39 niceass
// weapon prediction stuff // weapon prediction stuff
// //
@ -361,10 +364,6 @@ static void PM_Friction(void)
if (pm->waterlevel) { if (pm->waterlevel) {
drop += speed * pm_waterfriction * pm->waterlevel * pml.frametime; drop += speed * pm_waterfriction * pm->waterlevel * pml.frametime;
} }
// apply flying friction
if (pm->ps->powerups[PW_FLIGHT]) {
drop += speed * pm_flightfriction * pml.frametime;
}
if (pml.ladder) // If they're on a ladder... if (pml.ladder) // If they're on a ladder...
{ {
@ -1399,21 +1398,6 @@ static void PM_CheckDuck(void)
trace_t trace; trace_t trace;
vec3_t point; // NiceAss: Added for FUNKY CODE ALERT section vec3_t point; // NiceAss: Added for FUNKY CODE ALERT section
if (pm->ps->powerups[PW_INVULNERABILITY]) {
if (pm->ps->pm_flags & PMF_INVULEXPAND) {
// invulnerability sphere has a 42 units radius
VectorSet(pm->mins, -42, -42, -42);
VectorSet(pm->maxs, 42, 42, 42);
} else {
VectorSet(pm->mins, -15, -15, MINS_Z);
VectorSet(pm->maxs, 15, 15, 16);
}
pm->ps->pm_flags |= PMF_DUCKED;
pm->ps->viewheight = CROUCH_VIEWHEIGHT;
return;
}
pm->ps->pm_flags &= ~PMF_INVULEXPAND;
pm->mins[0] = -15; pm->mins[0] = -15;
pm->mins[1] = -15; pm->mins[1] = -15;
@ -1486,10 +1470,6 @@ static void PM_Footsteps(void)
+ pm->ps->velocity[1] * pm->ps->velocity[1]); + pm->ps->velocity[1] * pm->ps->velocity[1]);
if (pm->ps->groundEntityNum == ENTITYNUM_NONE) { if (pm->ps->groundEntityNum == ENTITYNUM_NONE) {
if (pm->ps->powerups[PW_INVULNERABILITY]) {
PM_ContinueLegsAnim(LEGS_IDLECR);
}
// airborne leaves position in cycle intact, but doesn't advance // airborne leaves position in cycle intact, but doesn't advance
if (pm->waterlevel > 1) { if (pm->waterlevel > 1) {
PM_ContinueLegsAnim(LEGS_SWIM); PM_ContinueLegsAnim(LEGS_SWIM);
@ -2539,10 +2519,6 @@ static void PM_Weapon(void)
break; break;
} }
if (pm->ps->powerups[PW_HASTE]) {
addTime /= 1.3;
}
pm->ps->weaponTime += addTime; pm->ps->weaponTime += addTime;
//Auto-switch when out of ammo with grenade or knife //Auto-switch when out of ammo with grenade or knife
@ -2938,10 +2914,7 @@ void PmoveSingle(pmove_t * pmove)
PM_DropTimers(); PM_DropTimers();
CheckLadder(); // ARTHUR TOMLIN check and see if they're on a ladder CheckLadder(); // ARTHUR TOMLIN check and see if they're on a ladder
if (pm->ps->powerups[PW_FLIGHT]) { if (pm->ps->pm_flags & PMF_GRAPPLE_PULL) {
// flight powerup doesn't allow jump and has different friction
PM_FlyMove();
} else if (pm->ps->pm_flags & PMF_GRAPPLE_PULL) {
PM_GrappleMove(); PM_GrappleMove();
// We can wiggle a bit // We can wiggle a bit
PM_AirMove(); PM_AirMove();

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.89 2002/07/22 06:33:34 niceass
// cleaned up the powerup code
//
// Revision 1.88 2002/07/21 18:48:24 niceass // Revision 1.88 2002/07/21 18:48:24 niceass
// weapon prediction stuff // weapon prediction stuff
// //
@ -629,7 +632,7 @@ typedef enum {
#define PMF_GRAPPLE_PULL 2048 // pull towards grapple location #define PMF_GRAPPLE_PULL 2048 // pull towards grapple location
#define PMF_FOLLOW 4096 // spectate following another player #define PMF_FOLLOW 4096 // spectate following another player
#define PMF_SCOREBOARD 8192 // spectate as a scoreboard #define PMF_SCOREBOARD 8192 // spectate as a scoreboard
#define PMF_INVULEXPAND 16384 // invulnerability sphere set to full size // NiceAss: Room for something right here, value 16384
#define PMF_RELOAD_HELD 32768 // Elder: new reload code #define PMF_RELOAD_HELD 32768 // Elder: new reload code
#define PMF_ALL_TIMES (PMF_TIME_WATERJUMP|PMF_TIME_LAND|PMF_TIME_KNOCKBACK) #define PMF_ALL_TIMES (PMF_TIME_WATERJUMP|PMF_TIME_LAND|PMF_TIME_KNOCKBACK)
@ -783,23 +786,10 @@ typedef enum {
typedef enum { typedef enum {
PW_NONE, PW_NONE,
PW_QUAD,
PW_BATTLESUIT,
PW_HASTE,
PW_INVIS,
PW_REGEN,
PW_FLIGHT,
PW_REDFLAG, PW_REDFLAG,
PW_BLUEFLAG, PW_BLUEFLAG,
PW_NEUTRALFLAG, PW_NEUTRALFLAG,
PW_SCOUT,
PW_GUARD,
PW_DOUBLER,
PW_AMMOREGEN,
PW_INVULNERABILITY,
PW_NUM_POWERUPS PW_NUM_POWERUPS
} powerup_t; } powerup_t;
@ -1088,10 +1078,6 @@ typedef enum {
EV_OBITUARY_STOMACH, EV_OBITUARY_STOMACH,
EV_OBITUARY_LEGS, EV_OBITUARY_LEGS,
EV_POWERUP_QUAD,
EV_POWERUP_BATTLESUIT,
EV_POWERUP_REGEN,
EV_GIB_PLAYER, // gib a previously living player EV_GIB_PLAYER, // gib a previously living player
EV_GIB_PLAYER_HEADSHOT, // JBravo: for sniper head shots EV_GIB_PLAYER_HEADSHOT, // JBravo: for sniper head shots
EV_GIB_PLAYER_STOMACH, // JBravo: for sniper stomach shots EV_GIB_PLAYER_STOMACH, // JBravo: for sniper stomach shots

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.85 2002/07/22 06:33:04 niceass
// cleaned up the powerup code
//
// Revision 1.84 2002/07/21 18:48:06 niceass // Revision 1.84 2002/07/21 18:48:06 niceass
// weapon prediction stuff // weapon prediction stuff
// //
@ -264,7 +267,6 @@ Check for lava / slime contents and drowning
*/ */
void P_WorldEffects(gentity_t * ent) void P_WorldEffects(gentity_t * ent)
{ {
qboolean envirosuit;
int waterlevel; int waterlevel;
if (ent->client->noclip) { if (ent->client->noclip) {
@ -274,16 +276,11 @@ void P_WorldEffects(gentity_t * ent)
waterlevel = ent->waterlevel; waterlevel = ent->waterlevel;
envirosuit = ent->client->ps.powerups[PW_BATTLESUIT] > level.time;
// //
// check for drowning // check for drowning
// //
if (waterlevel == 3) { if (waterlevel == 3) {
// envirosuit give air
if (envirosuit) {
ent->client->airOutTime = level.time + 10000;
}
// if out of air, start drowning // if out of air, start drowning
if (ent->client->airOutTime < level.time) { if (ent->client->airOutTime < level.time) {
// drown! // drown!
@ -320,19 +317,15 @@ void P_WorldEffects(gentity_t * ent)
if (waterlevel && (ent->watertype & (CONTENTS_LAVA | CONTENTS_SLIME))) { if (waterlevel && (ent->watertype & (CONTENTS_LAVA | CONTENTS_SLIME))) {
// Elder: changed around a bit -- using timestamp variable // Elder: changed around a bit -- using timestamp variable
if (ent->health > 0 && level.time > ent->timestamp) { if (ent->health > 0 && level.time > ent->timestamp) {
if (envirosuit) { if (ent->watertype & CONTENTS_LAVA) {
G_AddEvent(ent, EV_POWERUP_BATTLESUIT, 0); G_Damage(ent, NULL, NULL, NULL, NULL, 3 * waterlevel, 0, MOD_LAVA);
} else {
if (ent->watertype & CONTENTS_LAVA) {
G_Damage(ent, NULL, NULL, NULL, NULL, 3 * waterlevel, 0, MOD_LAVA);
}
if (ent->watertype & CONTENTS_SLIME) {
G_Damage(ent, NULL, NULL, NULL, NULL, waterlevel, 0, MOD_SLIME);
}
// Elder: added
ent->timestamp = level.time + FRAMETIME;
} }
if (ent->watertype & CONTENTS_SLIME) {
G_Damage(ent, NULL, NULL, NULL, NULL, waterlevel, 0, MOD_SLIME);
}
// Elder: added
ent->timestamp = level.time + FRAMETIME;
} }
} }
} }
@ -636,26 +629,9 @@ void ClientTimerActions(gentity_t * ent, int msec)
while (client->timeResidual >= 1000) { while (client->timeResidual >= 1000) {
client->timeResidual -= 1000; client->timeResidual -= 1000;
// regenerate // count down health when over max
if (client->ps.powerups[PW_REGEN]) { if (ent->health > 100) { //max is 100 client->ps.stats[STAT_MAX_HEALTH] ) {
if (ent->health < 100) { //max health 100 client->ps.stats[STAT_MAX_HEALTH]) { ent->health--;
ent->health += 15;
if (ent->health > 110) { //max health is 100x1.1 client->ps.stats[STAT_MAX_HEALTH] * 1.1 ) {
ent->health = 110; //max health is 100x1.1 client->ps.stats[STAT_MAX_HEALTH] * 1.1;
}
G_AddEvent(ent, EV_POWERUP_REGEN, 0);
} else if (ent->health < 200) { //max health is 200 in this case client->ps.stats[STAT_MAX_HEALTH] * 2) {
ent->health += 5;
if (ent->health > 200) { // max health is 200 client->ps.stats[STAT_MAX_HEALTH] * 2 ) {
ent->health = 200; //max health is 200 client->ps.stats[STAT_MAX_HEALTH] * 2;
}
G_AddEvent(ent, EV_POWERUP_REGEN, 0);
}
} else {
// count down health when over max
if (ent->health > 100) { //max is 100 client->ps.stats[STAT_MAX_HEALTH] ) {
ent->health--;
}
} }
// count down armor when over max // count down armor when over max
@ -1086,9 +1062,6 @@ void ClientThink_real(gentity_t * ent)
// set speed // set speed
client->ps.speed = g_speed.value; client->ps.speed = g_speed.value;
if (client->ps.powerups[PW_HASTE]) {
client->ps.speed *= 1.3;
}
// set up for pmove // set up for pmove
oldEventSequence = client->ps.eventSequence; oldEventSequence = client->ps.eventSequence;

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.6 2002/07/22 06:32:43 niceass
// cleaned up the powerup code
//
// Revision 1.5 2002/06/16 20:06:14 jbravo // Revision 1.5 2002/06/16 20:06:14 jbravo
// Reindented all the source files with "indent -kr -ut -i8 -l120 -lc120 -sob -bad -bap" // Reindented all the source files with "indent -kr -ut -i8 -l120 -lc120 -sob -bad -bap"
// //
@ -813,29 +816,6 @@ void G_RankPickupPowerup(int self, int powerup)
} }
trap_RankReportInt(self, -1, QGR_KEY_POWERUP, 1, 1); trap_RankReportInt(self, -1, QGR_KEY_POWERUP, 1, 1);
switch (powerup) {
case PW_QUAD:
trap_RankReportInt(self, -1, QGR_KEY_QUAD, 1, 1);
break;
case PW_BATTLESUIT:
trap_RankReportInt(self, -1, QGR_KEY_SUIT, 1, 1);
break;
case PW_HASTE:
trap_RankReportInt(self, -1, QGR_KEY_HASTE, 1, 1);
break;
case PW_INVIS:
trap_RankReportInt(self, -1, QGR_KEY_INVIS, 1, 1);
break;
case PW_REGEN:
trap_RankReportInt(self, -1, QGR_KEY_REGEN, 1, 1);
break;
case PW_FLIGHT:
trap_RankReportInt(self, -1, QGR_KEY_FLIGHT, 1, 1);
break;
default:
break;
}
} }
/* /*

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.24 2002/07/22 06:32:27 niceass
// cleaned up the powerup code
//
// Revision 1.23 2002/06/16 20:06:14 jbravo // Revision 1.23 2002/06/16 20:06:14 jbravo
// Reindented all the source files with "indent -kr -ut -i8 -l120 -lc120 -sob -bad -bap" // Reindented all the source files with "indent -kr -ut -i8 -l120 -lc120 -sob -bad -bap"
// //
@ -308,9 +311,6 @@ void Use_target_push(gentity_t * self, gentity_t * other, gentity_t * activator)
if (activator->client->ps.pm_type != PM_NORMAL) { if (activator->client->ps.pm_type != PM_NORMAL) {
return; return;
} }
if (activator->client->ps.powerups[PW_FLIGHT]) {
return;
}
VectorCopy(self->s.origin2, activator->client->ps.velocity); VectorCopy(self->s.origin2, activator->client->ps.velocity);

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.76 2002/07/22 06:32:15 niceass
// cleaned up the powerup code
//
// Revision 1.75 2002/07/09 05:41:23 niceass // Revision 1.75 2002/07/09 05:41:23 niceass
// fix to kicking in CTB // fix to kicking in CTB
// //
@ -156,7 +159,6 @@ int GetMaterialFromFlag(int flag);
qboolean IsMetalMat(int Material); qboolean IsMetalMat(int Material);
qboolean IsMetalFlag(int flag); qboolean IsMetalFlag(int flag);
static float s_quadFactor;
static vec3_t forward, right, up; static vec3_t forward, right, up;
static vec3_t muzzle; static vec3_t muzzle;
@ -272,17 +274,7 @@ qboolean JumpKick(gentity_t * ent)
} }
//end Makro //end Makro
//Makro - client check
if (ent->client) {
if (ent->client->ps.powerups[PW_QUAD]) {
G_AddEvent(ent, EV_POWERUP_QUAD, 0);
s_quadFactor = g_quadfactor.value;
} else {
s_quadFactor = 1;
}
}
//Makro - moved some code up by a few lines to allow breakables to be kicked //Makro - moved some code up by a few lines to allow breakables to be kicked
if (traceEnt->client != NULL && traceEnt->takedamage) { if (traceEnt->client != NULL && traceEnt->takedamage) {
tent = G_TempEntity(tr.endpos, EV_JUMPKICK); tent = G_TempEntity(tr.endpos, EV_JUMPKICK);
tent->s.otherEntityNum = traceEnt->s.number; tent->s.otherEntityNum = traceEnt->s.number;
@ -412,14 +404,7 @@ qboolean CheckGauntletAttack(gentity_t * ent)
return qfalse; return qfalse;
} }
if (ent->client->ps.powerups[PW_QUAD]) { damage = 50;
G_AddEvent(ent, EV_POWERUP_QUAD, 0);
s_quadFactor = g_quadfactor.value;
} else {
s_quadFactor = 1;
}
damage = 50 * s_quadFactor;
G_Damage(traceEnt, ent, ent, forward, tr.endpos, damage, 0, MOD_GAUNTLET); G_Damage(traceEnt, ent, ent, forward, tr.endpos, damage, 0, MOD_GAUNTLET);
return qtrue; return qtrue;
@ -493,9 +478,6 @@ void Bullet_Fire(gentity_t * ent, float spread, int damage, int MOD)
break; break;
} }
} }
//Elder: removed - for some reason it's set to 0
//damage *= s_quadFactor;
/* Original AQ2 code /* Original AQ2 code
vectoangles (aimdir, dir); vectoangles (aimdir, dir);
AngleVectors (dir, forward, right, up); AngleVectors (dir, forward, right, up);
@ -675,26 +657,6 @@ void Bullet_Fire(gentity_t * ent, float spread, int damage, int MOD)
/* /*
====================================================================== ======================================================================
BFG
======================================================================
*/
//Blaze: No more BFG
/*
void BFG_Fire ( gentity_t *ent ) {
gentity_t *m;
m = fire_bfg (ent, muzzle, forward);
m->damage *= s_quadFactor;
m->splashDamage *= s_quadFactor;
// VectorAdd( m->s.pos.trDelta, ent->client->ps.velocity, m->s.pos.trDelta ); // "real" physics
}
*/
/*
======================================================================
SHOTGUN SHOTGUN
====================================================================== ======================================================================
@ -850,68 +812,6 @@ void weapon_supershotgun_fire(gentity_t * ent)
/* /*
====================================================================== ======================================================================
GRENADE LAUNCHER
======================================================================
*/
//Blaze: No more grenade launcher, no need for fire function
/*
void weapon_grenadelauncher_fire (gentity_t *ent) {
gentity_t *m;
// extra vertical velocity
forward[2] += 0.2f;
VectorNormalize( forward );
m = fire_grenade (ent, muzzle, forward);
m->damage *= s_quadFactor;
m->splashDamage *= s_quadFactor;
// VectorAdd( m->s.pos.trDelta, ent->client->ps.velocity, m->s.pos.trDelta ); // "real" physics
}
*/
/*
======================================================================
ROCKET
======================================================================
*/
//Blaze: No more rocket launcher, no need for this function
/*
void Weapon_RocketLauncher_Fire (gentity_t *ent) {
gentity_t *m;
m = fire_rocket (ent, muzzle, forward);
m->damage *= s_quadFactor;
m->splashDamage *= s_quadFactor;
// VectorAdd( m->s.pos.trDelta, ent->client->ps.velocity, m->s.pos.trDelta ); // "real" physics
}
*/
/*
======================================================================
PLASMA GUN
======================================================================
*/
//Blaze: No plasma gun, no need for this function
/*
void Weapon_Plasmagun_Fire (gentity_t *ent) {
gentity_t *m;
m = fire_plasma (ent, muzzle, forward);
m->damage *= s_quadFactor;
m->splashDamage *= s_quadFactor;
// VectorAdd( m->s.pos.trDelta, ent->client->ps.velocity, m->s.pos.trDelta ); // "real" physics
}
*/
/*
======================================================================
RAILGUN RAILGUN
====================================================================== ======================================================================
@ -936,7 +836,7 @@ void weapon_railgun_fire(gentity_t * ent)
int passent; int passent;
gentity_t *unlinkedEntities[MAX_RAIL_HITS]; gentity_t *unlinkedEntities[MAX_RAIL_HITS];
damage = 100 * s_quadFactor; damage = 100;
VectorMA(muzzle, 8192, forward, end); VectorMA(muzzle, 8192, forward, end);
@ -1075,7 +975,7 @@ void Weapon_LightningFire(gentity_t * ent)
gentity_t *traceEnt, *tent; gentity_t *traceEnt, *tent;
int damage, i, passent; int damage, i, passent;
damage = 8 * s_quadFactor; damage = 8;
passent = ent->s.number; passent = ent->s.number;
for (i = 0; i < 10; i++) { for (i = 0; i < 10; i++) {
@ -1360,11 +1260,8 @@ void Weapon_Knife_Fire(gentity_t * ent)
// JBravo: ff // JBravo: ff
if (g_gametype.integer == GT_TEAMPLAY || g_gametype.integer == GT_CTF) if (g_gametype.integer == GT_TEAMPLAY || g_gametype.integer == GT_CTF)
setFFState(ent); setFFState(ent);
m = fire_knife(ent, muzzle, forward);
// m->damage *= s_quadFactor;
// m->splashDamage *= s_quadFactor;
// ^^^^ Homer: got quad?
m = fire_knife(ent, muzzle, forward);
} }
/* /*
@ -1517,7 +1414,6 @@ void Weapon_SSG3000_Fire(gentity_t * ent)
VectorMA(end, u, up, end); VectorMA(end, u, up, end);
} }
//damage = 100 * s_quadFactor;
damage = SNIPER_DAMAGE; damage = SNIPER_DAMAGE;
//VectorMA (muzzle, 8192*16, forward, end); //VectorMA (muzzle, 8192*16, forward, end);
@ -1942,12 +1838,10 @@ void Weapon_Grenade_Fire(gentity_t * ent)
// JBravo: ff // JBravo: ff
if (g_gametype.integer == GT_TEAMPLAY || g_gametype.integer == GT_CTF) if (g_gametype.integer == GT_TEAMPLAY || g_gametype.integer == GT_CTF)
setFFState(ent); setFFState(ent);
m = fire_grenade(ent, muzzle, forward);
//Elder: removed
//m->damage *= s_quadFactor;
//m->splashDamage *= s_quadFactor;
// VectorAdd( m->s.pos.trDelta, ent->client->ps.velocity, m->s.pos.trDelta ); // "real" physics m = fire_grenade(ent, muzzle, forward);
// VectorAdd( m->s.pos.trDelta, ent->client->ps.velocity, m->s.pos.trDelta ); // "real" physics
} }
@ -2033,14 +1927,6 @@ FireWeapon
*/ */
void FireWeapon(gentity_t * ent) void FireWeapon(gentity_t * ent)
{ {
/* Homer: got quad?
if (ent->client->ps.powerups[PW_QUAD] ) {
s_quadFactor = g_quadfactor.value;
} else { */
//Elder: uncommented so it won't be zero!
s_quadFactor = 1;
//}
// track shots taken for accuracy tracking. Grapple is not a weapon and gauntet is just not tracked // track shots taken for accuracy tracking. Grapple is not a weapon and gauntet is just not tracked
//Blaze: dont record accuracy for knife //Blaze: dont record accuracy for knife
// if( ent->s.weapon != WP_KNIFE) { // if( ent->s.weapon != WP_KNIFE) {

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.13 2002/07/22 06:31:47 niceass
// cleaned up the powerup code
//
// Revision 1.12 2002/06/16 20:06:14 jbravo // Revision 1.12 2002/06/16 20:06:14 jbravo
// Reindented all the source files with "indent -kr -ut -i8 -l120 -lc120 -sob -bad -bap" // Reindented all the source files with "indent -kr -ut -i8 -l120 -lc120 -sob -bad -bap"
// //
@ -90,17 +93,7 @@
#define INVENTORY_KAMIKAZE 32 #define INVENTORY_KAMIKAZE 32
#define INVENTORY_PORTAL 33 #define INVENTORY_PORTAL 33
#define INVENTORY_INVULNERABILITY 34 #define INVENTORY_INVULNERABILITY 34
#define INVENTORY_QUAD 35 //
#define INVENTORY_ENVIRONMENTSUIT 36
#define INVENTORY_HASTE 37
#define INVENTORY_INVISIBILITY 38
#define INVENTORY_REGEN 39
#define INVENTORY_FLIGHT 40
#define INVENTORY_SCOUT 41
#define INVENTORY_GUARD 42
#define INVENTORY_DOUBLER 43
#define INVENTORY_AMMOREGEN 44
#define INVENTORY_REDFLAG 45 #define INVENTORY_REDFLAG 45
#define INVENTORY_BLUEFLAG 46 #define INVENTORY_BLUEFLAG 46
#define INVENTORY_NEUTRALFLAG 47 #define INVENTORY_NEUTRALFLAG 47