Пример #1
0
/*
===============
G_SetClientEffects
===============
*/
void G_SetClientEffects (edict_t *ent)
{
	int		pa_type;
	int		remaining;

	ent->s.effects = 0;
	ent->s.renderfx = 0;

	if (ent->health <= 0 || level.intermissiontime)
		return;

	if (ent->powerarmor_time > level.time)
	{
		pa_type = PowerArmorType (ent);
		if (pa_type == POWER_ARMOR_SCREEN)
		{
			ent->s.effects |= EF_POWERSCREEN;
		}
		else if (pa_type == POWER_ARMOR_SHIELD)
		{
			ent->s.effects |= EF_COLOR_SHELL;
			ent->s.renderfx |= RF_SHELL_GREEN;
		}
	}

//ZOID
	CTFEffects(ent);
//ZOID

	if (ent->client->quad_framenum > level.framenum)
	{
		remaining = ent->client->quad_framenum - level.framenum;
		if (remaining > 30 || (remaining & 4) )
//			ent->s.effects |= EF_QUAD;
			CTFSetPowerUpEffect(ent, EF_QUAD);
	}

	if (ent->client->invincible_framenum > level.framenum)
	{
		remaining = ent->client->invincible_framenum - level.framenum;
		if (remaining > 30 || (remaining & 4) )
//			ent->s.effects |= EF_PENT;
			CTFSetPowerUpEffect(ent, EF_PENT);
	}

	// show cheaters!!!
	if (ent->flags & FL_GODMODE)
	{
		ent->s.effects |= EF_COLOR_SHELL;
		ent->s.renderfx |= (RF_SHELL_RED|RF_SHELL_GREEN|RF_SHELL_BLUE);
	}
}
Пример #2
0
/*
===============
G_SetClientEffects
===============
*/
void G_SetClientEffects (edict_t *ent)
{
	int		pa_type;
	int		remaining;

	ent->s.effects = 0;
	ent->s.renderfx = RF_IR_VISIBLE; // was 0, because all players are ir-goggle visible

	if (ent->health <= 0 || level.intermissiontime)
		return;

	if(ent->flags & FL_DISGUISED)
		ent->s.renderfx |= RF_USE_DISGUISE;

	if (ent->powerarmor_time > level.time)
	{
		pa_type = PowerArmorType (ent);
		if (pa_type == POWER_ARMOR_SCREEN)
		{
			ent->s.effects |= EF_POWERSCREEN;
		}
		else if (pa_type == POWER_ARMOR_SHIELD)
		{
			ent->s.effects |= EF_COLOR_SHELL;
			ent->s.renderfx |= RF_SHELL_GREEN;
		}
	}

//ZOID
	CTFEffects(ent);
//ZOID

	if (ent->client->quad_framenum > level.framenum)
	{
		remaining = ent->client->quad_framenum - level.framenum;
		if (remaining > 30 || (remaining & 4) )
			ent->s.effects |= EF_QUAD;
	}

	if (ent->client->invincible_framenum > level.framenum)
	{
		remaining = ent->client->invincible_framenum - level.framenum;
		if (remaining > 30 || (remaining & 4) )
			ent->s.effects |= EF_PENT;
	}

	// show cheaters!!!
	if (ent->flags & FL_GODMODE)
	{
		ent->s.effects |= EF_COLOR_SHELL;
		ent->s.renderfx |= (RF_SHELL_RED|RF_SHELL_GREEN|RF_SHELL_BLUE);
	}

	if (ent->client->flashlight)
	{
		vec3_t end, forward, offset, right, start, up;
		trace_t tr;

		if(level.flashlight_cost > 0) {
			if(!Q_stricmp(FLASHLIGHT_ITEM,"health") || 
					(ent->client->pers.inventory[ITEM_INDEX(FindItem(FLASHLIGHT_ITEM))]>=level.flashlight_cost) ) {
				// Player has items remaining
				if(ent->client->flashlight_time <= level.time) {
					ent->client->pers.inventory[ITEM_INDEX(FindItem(FLASHLIGHT_ITEM))]-=level.flashlight_cost;
					ent->client->flashlight_time = level.time + FLASHLIGHT_DRAIN;
				}
			} else {
				// Out of item
				ent->client->flashlight = false;
			}
		}
		if(ent->client->flashlight) {
			AngleVectors (ent->s.angles, forward, right, up);
			VectorSet(offset, 0, 0, ent->viewheight-8);
			G_ProjectSource (ent->s.origin, offset, forward, right, start);
			VectorMA(start,384,forward,end);	// was 128		
			tr = gi.trace (start,NULL,NULL, end, ent, CONTENTS_SOLID|CONTENTS_MONSTER|CONTENTS_DEADMONSTER);
			if (tr.fraction != 1)
				VectorMA(tr.endpos,-4,forward,end);
			VectorCopy(tr.endpos,end);
			gi.WriteByte (svc_temp_entity);
			gi.WriteByte (TE_FLASHLIGHT);
			gi.WritePosition (end);
			gi.WriteShort (ent - g_edicts);
			gi.multicast (end, MULTICAST_PVS);

		}
	}
}
Пример #3
0
/*
===============
G_SetClientEffects
===============
*/
void G_SetClientEffects (edict_t * ent)
{
	int pa_type;
	int remaining;

	ent->s.effects = 0;
	// zucc added RF_IR_VISIBLE
	//FB 6/1/99 - only for live players
	if (ent->deadflag != DEAD_DEAD)
		ent->s.renderfx = RF_IR_VISIBLE;
	else
		ent->s.renderfx = 0;

	if (ent->health <= 0 || level.intermissiontime)
		return;

	if (ent->powerarmor_time > level.time)
	{
		pa_type = PowerArmorType (ent);
		if (pa_type == POWER_ARMOR_SCREEN)
		{
			ent->s.effects |= EF_POWERSCREEN;
		}
		else if (pa_type == POWER_ARMOR_SHIELD)
		{
			ent->s.effects |= EF_COLOR_SHELL;
			ent->s.renderfx |= RF_SHELL_GREEN;
		}
	}

	if (ctf->value)
		CTFEffects (ent);

	if (ent->client->quad_framenum > level.framenum)
	{
		remaining = ent->client->quad_framenum - level.framenum;
		if (remaining > 30 || (remaining & 4))
			ent->s.effects |= EF_QUAD;
	}

	if (ent->client->invincible_framenum > level.framenum)
	{
		remaining = ent->client->invincible_framenum - level.framenum;
		if (remaining > 30 || (remaining & 4))
			ent->s.effects |= EF_PENT;
	}

	// show cheaters!!!
	if (ent->flags & FL_GODMODE)
	{
		ent->s.effects |= EF_COLOR_SHELL;
		ent->s.renderfx |= (RF_SHELL_RED | RF_SHELL_GREEN | RF_SHELL_BLUE);
	}
	// AQ2:TNG - JBravo adding UVtime
	if (ctf->value && ((ent->client->ctf_uvtime & 4) || (lights_camera_action & 4)))
	{
		ent->s.effects |= EF_COLOR_SHELL;
		if (ent->client->resp.team == TEAM1)
			ent->s.renderfx |= RF_SHELL_RED;
		else if (ent->client->resp.team == TEAM2)
			ent->s.renderfx |= RF_SHELL_BLUE;
		else
			ent->s.renderfx |= RF_SHELL_GREEN;
	}
	// TNG Flashlight
	if ((darkmatch->value) && (ent->client) && (ent->flashlight))
	{
		//ent->s.effects |= EF_YELLOWSHELL; // no good one? :/
		ent->s.renderfx |= RF_FULLBRIGHT;
	}
}