o Enabled TRACE_TEST code.

o Throttle player joined team message to prevent overflow.  ( no more than one message every 0.2s)
o Gorges heal themselves at half the normal rate ( gorges heal each other normally )


git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@378 67975925-1194-0748-b3d5-c16f83f1a3a1
This commit is contained in:
puzl 2006-03-19 15:23:06 +00:00
parent 723b23baf6
commit 4a2f07f8b5
6 changed files with 49 additions and 17 deletions

View file

@ -297,7 +297,7 @@ void MoveModel( void )
}
#endif
*/
//#define TRACE_TEST
#if defined( TRACE_TEST )
@ -328,7 +328,7 @@ void TraceModel( void )
}
#endif
*/
/*
void ParticleCallback( struct particle_s *particle, float frametime )
@ -545,11 +545,11 @@ void CL_DLLEXPORT HUD_CreateEntities( void )
#if defined( TEST_IT )
MoveModel();
#endif
*/
#if defined( TRACE_TEST )
TraceModel();
#endif
*/
/*
Particles();
*/

View file

@ -427,7 +427,7 @@ void IN_MouseMove ( float frametime, float ioRotationDeltas[3], float ioTranslat
}
}
/*
//#define TRACE_TEST
#if defined( TRACE_TEST )
{
@ -437,7 +437,7 @@ void IN_MouseMove ( float frametime, float ioRotationDeltas[3], float ioTranslat
V_Move( mx, my );
}
#endif
*/
}
/*

View file

@ -7,6 +7,7 @@
// view/refresh setup functions
#include "hud.h"
#include "cl_util.h"
#include "common/cvardef.h"
@ -20,6 +21,7 @@
#include "pm_shared/pm_movevars.h"
#include "pm_shared/pm_shared.h"
#include "pm_shared/pm_defs.h"
#include "pm_shared/pm_debug.h"
#include "common/event_api.h"
#include "common/pmtrace.h"
#include "common/screenfade.h"
@ -41,8 +43,8 @@ extern float gTopDownViewAngles[3];
#ifndef M_PI
#define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h
#endif
void PM_ParticleLine( float *start, float *end, int pcolor, float life, float vert);
//#include "pm_shared/pm_debug.h"
//void PM_ParticleLine(vec3_t start, vec3_t end, int pcolor, float life, float vert);
int PM_GetVisEntInfo( int ent );
int PM_GetPhysEntInfo( int ent );
void InterpolateAngles( float *start, float *end, float *output, float frac );
@ -2385,7 +2387,32 @@ float CalcFov (float fov_x, float width, float height)
}
int hitent = -1;
extern playermove_t *pmove;
void PM_ParticleLine(vec3_t start, vec3_t end, int pcolor, float life, float vert)
{
float linestep = 2.0f;
float curdist;
float len;
vec3_t curpos;
vec3_t diff;
int i;
// Determine distance;
VectorSubtract(end, start, diff);
len = VectorNormalize(diff);
curdist = 0;
while (curdist <= len)
{
for (i = 0; i < 3; i++)
curpos[i] = start[i] + curdist * diff[i];
pmove->PM_Particle( curpos, pcolor, life, 0, vert);
curdist += linestep;
}
}
void V_Move( int mx, int my )
{
float fov;
@ -2399,10 +2426,10 @@ void V_Move( int mx, int my )
vec3_t farpoint;
pmtrace_t tr;
fov = CalcFov( in_fov, (float)ScreenWidth, (float)ScreenHeight );
fov = CalcFov( in_fov, (float)ScreenWidth(), (float)ScreenHeight() );
c_x = (float)ScreenWidth / 2.0;
c_y = (float)ScreenHeight / 2.0;
c_x = (float)ScreenWidth() / 2.0;
c_y = (float)ScreenHeight() / 2.0;
dx = (float)mx - c_x;
dy = (float)my - c_y;
@ -2430,7 +2457,7 @@ void V_Move( int mx, int my )
if ( tr.fraction != 1.0 && tr.ent != 0 )
{
hitent = PM_GetPhysEntInfo( tr.ent );
PM_ParticleLine( (float *)&v_origin, (float *)&tr.endpos, 5, 1.0, 0.0 );
PM_ParticleLine( (vec3_t)v_origin, (vec3_t)tr.endpos, 5, 1.0, 0.0 );
}
else
{

View file

@ -305,6 +305,7 @@ void SetGameRules(AvHGamerules* inGameRules)
static float gSvCheatsLastUpdateTime;
AvHGamerules::AvHGamerules() : mTeamA(TEAM_ONE), mTeamB(TEAM_TWO)
{
this->mLastJoinMessage = 0.0f;
this->mGameStarted = false;
this->mPreserveTeams = false;
@ -442,15 +443,15 @@ bool AvHGamerules::AttemptToJoinTeam(AvHPlayer* inPlayer, AvHTeamNumber inTeamTo
{
// joev: Bug 0000767
// Tell the other players that this player is joining a team.
if (!this->GetCheatsEnabled()) {
if (!this->GetCheatsEnabled() && this->mGameStarted == true && ( gpGlobals->time > this->mLastJoinMessage + 0.2f ) ) {
AvHTeam* theTeam = GetTeam(inTeamToJoin);
// ensure that the sound only plays if the game already has started
if (this->mGameStarted == true) {
theTeam->PlayHUDSoundForAlivePlayers(HUD_SOUND_PLAYERJOIN);
}
char* theMessage = UTIL_VarArgs("%s has joined the %s\n",STRING(inPlayer->pev->netname),theTeam->GetTeamPrettyName());
UTIL_ClientPrintAll(HUD_PRINTTALK, theMessage);
UTIL_LogPrintf( "%s joined team \"%s\"\n", GetLogStringForPlayer( inPlayer->edict() ).c_str(), AvHSUGetTeamName(inPlayer->pev->team) );
this->mLastJoinMessage=gpGlobals->time;
}
// :joev
}
@ -2685,6 +2686,7 @@ void AvHGamerules::InternalResetGameRules()
AvHNexus::cancelGame();
}
this->mGameStarted = false;
this->mLastJoinMessage = 0.0f;
this->mTimeCountDownStarted = 0;
this->mTimeGameStarted = -1;
this->mTimeOfLastGameTimeUpdate = -1;

View file

@ -341,6 +341,7 @@ private:
bool mFirstUpdate;
bool mPreserveTeams;
bool mGameStarted;
float mLastJoinMessage;
AvHTeamNumber mVictoryTeam;
float mTimeCountDownStarted;
float mTimeGameStarted;

View file

@ -165,11 +165,12 @@ void AvHHealingSpray::FireProjectiles(void)
while((theCurrentEntity = UTIL_FindEntityInSphere(theCurrentEntity, theOriginatingPosition, kHealingSprayRange)) != NULL)
{
bool isSelf=(theCurrentEntity == this->m_pPlayer);
// Can't affect self
// if(theCurrentEntity != this->m_pPlayer)
// {
// If entity is in view cone, and within range
if(theCurrentEntity == this->m_pPlayer || this->m_pPlayer->FInViewCone(&theCurrentEntity->pev->origin) )
if(isSelf || this->m_pPlayer->FInViewCone(&theCurrentEntity->pev->origin) )
{
// UTIL_FindEntityInSphere doesn't seem to take height into account. Make sure the entity is within range.
float theMaxEntitySize = max(Length(theCurrentEntity->pev->mins), Length(theCurrentEntity->pev->maxs));
@ -208,6 +209,7 @@ void AvHHealingSpray::FireProjectiles(void)
// Players heal by base amount, plus percentage of health
float thePercentage = BALANCE_VAR(kHealingSprayPlayerPercent)/100.0f;
theDamage += thePercentage*theCurrentEntity->pev->max_health;
if ( isSelf ) theDamage *= 0.5f;
thePlayer->Heal(theDamage, true);
}
else if(theBuildable)