示例#1
0
void V_TF_FlashStuff (void)
{
	static float last_own_flash_time;
	static float last_other_flash_time;
	float blocktime;

	// 240 = Normal TF || 255 = Angel TF
	if (cshift_empty.percent == 240 || cshift_empty.percent == 255 ) {
		TP_ExecTrigger ("f_flash");
		if (!flashed && (!strncasecmp(Rulesets_Ruleset(), "MTFL", 4)))
			V_TF_FlashSettings (true);

		flashed = true;
		last_other_flash_time = cls.realtime;
	}

	if (cshift_empty.percent == 160) { // flashed by your own flash
		if (!flashed && (!strncasecmp(Rulesets_Ruleset(), "MTFL", 4)))
			V_TF_FlashSettings (true);

		flashed = true;
		last_own_flash_time = cls.realtime;
	}

	blocktime = (last_other_flash_time > last_own_flash_time) ? 20.0 : 10.0;

	// turn gamma and contrast back if
	if ((!(cls.realtime - max (last_own_flash_time, last_other_flash_time) < blocktime)) || // flashed for last 10 seconds or 
	(cshift_empty.percent == 0 && (cbuf_current = &cbuf_svc))) { // death while flashed
		if (flashed && (!strncasecmp(Rulesets_Ruleset(), "MTFL", 4))) {
			V_TF_FlashSettings (false);
			flashed = false;
		}
	}

	if (cls.demoplayback && cshift_empty.destcolor[0] == cshift_empty.destcolor[1])
			cshift_empty.percent *= cl_demoplay_flash.value/1.0f;
}
示例#2
0
static qbool FChecks_CheckFRulesetRequest (const char *s)
{
	// format of the reply:
	// [nick: ]
	// [padding] - so that "nick: " + padding is 17 chars long
	// [ip address] - padded with spaces to 21 chars
	// - this fits to 38 chars which is length of line with conwidth 320
	// [space]
	// [client version] - padded to 16 chars
	// [ruleset name]
	// [ruleset addition]
	// - these 4 should be less than 38 chars so that reply does never take up more than 2 lines
	char *fServer;
	const char *features;
	char *emptystring = "";
	char *brief_version = "ezq" VERSION_NUMBER;
	char *ruleset = Rulesets_Ruleset();
	size_t name_len = strlen(cl.players[cl.playernum].name);
	size_t pad_len = 15 - min(name_len, 15);

	if (cl.spectator || (f_ruleset_reply_time && cls.realtime - f_ruleset_reply_time < 20))
		return false;

	if (Util_F_Match(s, "f_ruleset"))	{
		features = FChecks_RulesetAdditionString();
		fServer = FChecks_FServerResponse_Text();
		if (!fServer) {
			fServer = "server-na";
		}

		Cbuf_AddText(va("say \"%*s%21s %16s %s%s\"\n",
			pad_len, emptystring, fServer, brief_version, ruleset, features));
		f_ruleset_reply_time = cls.realtime;
		return true;
	}

	return false;
}
示例#3
0
// BorisU -->
void V_TF_ClearGrenadeEffects ()
{
	cbuf_t *cbuf_tmp;
	extern cvar_t scr_fov, default_fov;
	
	cbuf_tmp = cbuf_current;
	cbuf_current = &cbuf_svc;
	// Concussion effect off
	concussioned = false;
	Cvar_SetValue (&scr_fov, default_fov.value);
	Cvar_SetValue (&v_idlescale, 0.0f);

	// Flash effect off
	if (flashed && (!strncasecmp(Rulesets_Ruleset(), "MTFL", 4))) {
		V_TF_FlashSettings (false);
		flashed = false;
	}

	cshift_empty.destcolor[0] = 0;
	cshift_empty.destcolor[1] = 0;
	cshift_empty.destcolor[2] = 0;
	cshift_empty.percent = 0;
	cbuf_current = cbuf_tmp;
}