Back to home

50K Damage TDM

WQS4B
click to copy
This game is archived.
If you with to unarchive it, click the "restore" button in the options menu.

Category:
Custom game mode

Author:
rabbîts

Rating:
0

Version:
1.0.0

Posted:
about 1 month ago

Last updated:
about 1 month ago

Share this workshop!

Options

Deal 50,000 damage to the opposing team to win. Adjust "score to win" in team deathmatch settings to control winning damage (score X 1k damage). Inspired by the wonderful 10k FFA by DarwinStreams

rule("Disable normal scoring")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	actions
	{
		Disable Built-In Game Mode Scoring;
		Disable Built-In Game Mode Announcer;
	}
}

rule("Global Init")
{
	event
	{
		Ongoing - Global;
	}

	conditions
	{
		Is Game In Progress == True;
	}

	actions
	{
		Set Global Variable(P, Number of Players(Team 1));
		Set Global Variable(A, 0);
		Set Global Variable(B, 0);
		Set Team Score(Team 1, 0);
		Set Team Score(Team 2, 0);
	}
}

rule("Player Init")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Is Game In Progress == True;
	}

	actions
	{
		Set Player Variable(Event Player, D, 0);
	}
}

rule("Damage track")
{
	event
	{
		Player dealt damage;
		All;
		All;
	}

	conditions
	{
		Victim != Attacker;
	}

	actions
	{
		Destroy In-World Text(Player Variable(Event Player, E));
		Modify Player Variable(Event Player, D, Add, Event Damage);
		Set Player Variable(Event Player, P, Eye Position(Victim));
		Set Player Variable(Event Player, C, Add(Eye Position(Victim), Vector(0, 1, 0)));
		Set Player Variable(Event Player, S, Add(0.700, Divide(Event Damage, 20)));
		Create In-World Text(Event Player, Round To Integer(Event Damage, Down), Player Variable(Event Player, P), Player Variable(
			Event Player, S), Clip Against Surfaces, Visible To Position and String);
		Chase Player Variable At Rate(Event Player, P, Player Variable(Event Player, C), 1, Destination and Rate);
		Chase Player Variable At Rate(Event Player, S, 0, 1, Destination and Rate);
		Set Player Variable(Event Player, E, Last Text ID);
		Skip If(Compare(Team Of(Event Player), ==, Team 1), 1);
		Modify Global Variable(B, Add, Event Damage);
		Skip If(Compare(Team Of(Event Player), ==, Team 2), 1);
		Modify Global Variable(A, Add, Event Damage);
		Set Team Score(Team 1, Divide(Global Variable(A), 1000));
		Set Team Score(Team 2, Divide(Global Variable(B), 1000));
	}
}

rule("Player Leaderboard")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	actions
	{
		Create HUD Text(All Players(All Teams), Null, String("{0}: {1}", Event Player, Round To Integer(Player Variable(Event Player, D),
			To Nearest), Null), Null, Left, Multiply(Player Variable(Event Player, D), -0.010), White, White, White,
			Visible To and String);
		Set Player Variable(Event Player, T, Last Text ID);
		Wait(2, Ignore Condition);
		Destroy HUD Text(Player Variable(Event Player, T));
		Destroy In-World Text(Player Variable(Event Player, E));
		Loop;
	}
}

rule("Global Leaderboard")
{
	event
	{
		Ongoing - Global;
	}

	actions
	{
		Create HUD Text(All Players(All Teams), Null, String("{0} - {1}", Round To Integer(Global Variable(A), To Nearest),
			Round To Integer(Global Variable(B), To Nearest), Null), Null, Top, 0, White, White, White, Visible To and String);
		Set Global Variable(T, Last Text ID);
		Wait(2, Ignore Condition);
		Destroy HUD Text(Global Variable(T));
		Loop;
	}
}

rule("Player Jumped Off Map")
{
	event
	{
		Player Died;
		All;
		All;
	}

	conditions
	{
		Attacker == Event Player;
	}

	actions
	{
		Modify Player Variable(Event Player, D, Subtract, Event Damage);
		Skip If(Compare(Team Of(Event Player), ==, Team 1), 1);
		Modify Global Variable(B, Subtract, Event Damage);
		Skip If(Compare(Team Of(Event Player), ==, Team 2), 1);
		Modify Global Variable(A, Subtract, Event Damage);
		Set Team Score(Team 1, Divide(Global Variable(A), 1000));
		Set Team Score(Team 2, Divide(Global Variable(B), 1000));
	}
}