Back to home

Get to Cover! [While You Wait/Jam Mode]

B0HF3
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:
CactusPuppy

Rating:
1

Version:
1.0.0

Posted:
21 days ago

Tags:
lucio ashe dva while you wait

Share this workshop!

Options

Get to Cover!

Death is coming from the sky and the only safety is a bunch of convenient white balloons! Boop back your rival players and fight to secure the longest streak!

Note:

Polish of 2020-01-24's Workshop Jam. Supports While You Wait players.

variables
{
	global:
		0: currentCoverCount
		1: currentCoverSize
		2: currentTimeLimit
		3: timer
		5: covers
		6: coverLocations
		7: gameActive
		8: index
		9: newCovers
		10: newRound

	player:
		0: tpFlag
		1: isSetup
}

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

	actions
	{
		Disable Built-In Game Mode Completion;
		Disable Built-In Game Mode Music;
		Disable Built-In Game Mode Announcer;
		Disable Built-In Game Mode Scoring;
		Create Effect(All Players(All Teams), Light Shaft, Red, Vector(212, 27.500, -33.000), 16.100, Visible To);
		Set Global Variable(covers, Empty Array);
		Set Global Variable(coverLocations, Empty Array);
		Set Global Variable(gameActive, False);
		Set Global Variable(currentCoverCount, 5);
		Set Global Variable(currentCoverSize, 1.500);
		Set Global Variable(currentTimeLimit, 10);
	}
}

rule("Pause Match Time")
{
	event
	{
		Ongoing - Global;
	}

	conditions
	{
		Global Variable(gameActive) == False;
		Is Game In Progress == True;
	}

	actions
	{
		Wait(0.016, Ignore Condition);
		Pause Match Time;
	}
}

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

	conditions
	{
		Has Spawned(Event Player) == True;
		Is Alive(Event Player) == True;
	}

	actions
	{
		Set Healing Received(Event Player, 0);
		Set Damage Dealt(Event Player, 0);
		Set Player Variable(Event Player, tpFlag, True);
		Disable Built-In Game Mode Respawning(Event Player);
		Wait(0.016, Ignore Condition);
		Set Player Variable(Event Player, isSetup, True);
	}
}

rule("Push outside player")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Has Spawned(Event Player) == True;
		Distance Between(Position Of(Event Player), Vector(X Component Of(Vector(212, 27.500, -33.000)), Y Component Of(Position Of(
			Event Player)), Z Component Of(Vector(212, 27.500, -33.000)))) > 15.400;
	}

	actions
	{
		Apply Impulse(Event Player, Direction Towards(Position Of(Event Player), Vector(X Component Of(Vector(212, 27.500, -33.000)),
			Y Component Of(Position Of(Event Player)), Z Component Of(Vector(212, 27.500, -33.000)))), 10, To World,
			Cancel Contrary Motion);
		Wait(0.016, Ignore Condition);
		Loop If Condition Is True;
	}
}

rule("When player gets tp flag, teleport randomly")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Player Variable(Event Player, tpFlag) == True;
	}

	actions
	{
		Teleport(Event Player, Add(Vector(212, 27.500, -33.000), Vector(Random Real(-12.600, 12.600), 0, Random Real(-12.600, 12.600))));
		Set Player Variable(Event Player, tpFlag, False);
	}
}

rule("====GAMEPLAY====")
{
	event
	{
		Ongoing - Global;
	}

	actions
	{
		Abort;
	}
}

rule("Shorten assemble heroes")
{
	event
	{
		Ongoing - Global;
	}

	conditions
	{
		Is Assembling Heroes == True;
	}

	actions
	{
		Set Match Time(6);
	}
}

rule("Once not waiting for players, start mode")
{
	event
	{
		Ongoing - Global;
	}

	conditions
	{
		Is Game In Progress == True;
		Global Variable(gameActive) == False;
		Count Of(Filtered Array(All Players(All Teams), Player Variable(Current Array Element, isSetup))) > 1;
	}

	actions
	{
		Set Status(All Players(All Teams), Null, Frozen, 5);
		Big Message(All Players(All Teams), Custom String("Starting Game!", Null, Null, Null));
		Small Message(All Players(All Teams), Custom String("Starting Game!", Null, Null, Null));
		Set Player Variable(All Players(All Teams), tpFlag, True);
		Wait(2, Ignore Condition);
		Big Message(All Players(All Teams), Custom String("3", Null, Null, Null));
		Small Message(All Players(All Teams), Custom String("3", Null, Null, Null));
		Wait(2, Ignore Condition);
		Big Message(All Players(All Teams), Custom String("2", Null, Null, Null));
		Small Message(All Players(All Teams), Custom String("2", Null, Null, Null));
		Wait(2, Ignore Condition);
		Big Message(All Players(All Teams), Custom String("1", Null, Null, Null));
		Small Message(All Players(All Teams), Custom String("1", Null, Null, Null));
		Wait(2, Ignore Condition);
		Big Message(All Players(All Teams), Custom String("GO!", Null, Null, Null));
		Small Message(All Players(All Teams), Custom String("GO!", Null, Null, Null));
		Set Match Time(70);
		Unpause Match Time;
		Big Message(All Players(All Teams), Custom String("GET TO COVER!", Null, Null, Null));
		Create HUD Text(All Players(All Teams), Custom String("Get to Cover! {0}", Round To Integer(Global Variable(timer), Up), Null,
			Null), Null, Null, Top, 1, Red, White, White, Visible To and String, Visible Always);
		Create Effect(All Players(All Teams), Sphere, White, First Of(Global Variable(coverLocations)), Global Variable(currentCoverSize),
			Visible To Position and Radius);
		Create Effect(All Players(All Teams), Sphere, White, Value In Array(Global Variable(coverLocations), 1), Global Variable(
			currentCoverSize), Visible To Position and Radius);
		Create Effect(All Players(All Teams), Sphere, White, Value In Array(Global Variable(coverLocations), 2), Global Variable(
			currentCoverSize), Visible To Position and Radius);
		Create Effect(All Players(All Teams), Sphere, White, Value In Array(Global Variable(coverLocations), 3), Global Variable(
			currentCoverSize), Visible To Position and Radius);
		Create Effect(All Players(All Teams), Sphere, White, Value In Array(Global Variable(coverLocations), 4), Global Variable(
			currentCoverSize), Visible To Position and Radius);
		Set Global Variable(newRound, True);
		Set Global Variable(gameActive, True);
	}
}

rule("On newCovers, create new covers")
{
	event
	{
		Ongoing - Global;
	}

	conditions
	{
		Global Variable(gameActive) == True;
		Global Variable(newCovers) == True;
		Global Variable(index) > 0;
	}

	actions
	{
		Set Global Variable At Index(coverLocations, 0, Add(Vector(212, 27.500, -33.000), Vector(Random Real(-12.600, 12.600), 5,
			Random Real(-12.600, 12.600))));
		Set Global Variable At Index(coverLocations, 1, Add(Vector(212, 27.500, -33.000), Vector(Random Real(-12.600, 12.600), 5,
			Random Real(-12.600, 12.600))));
		Set Global Variable At Index(coverLocations, 2, Add(Vector(212, 27.500, -33.000), Vector(Random Real(-12.600, 12.600), 5,
			Random Real(-12.600, 12.600))));
		Set Global Variable At Index(coverLocations, 3, Add(Vector(212, 27.500, -33.000), Vector(Random Real(-12.600, 12.600), 5,
			Random Real(-12.600, 12.600))));
		Set Global Variable At Index(coverLocations, 4, Add(Vector(212, 27.500, -33.000), Vector(Random Real(-12.600, 12.600), 5,
			Random Real(-12.600, 12.600))));
		Set Global Variable(newCovers, False);
	}
}

rule("On new mini-round flag, begin round")
{
	event
	{
		Ongoing - Global;
	}

	conditions
	{
		Global Variable(gameActive) == True;
		Global Variable(newRound) == True;
	}

	actions
	{
		Set Global Variable(index, Global Variable(currentCoverCount));
		Set Global Variable(newCovers, True);
		Set Global Variable(timer, Global Variable(currentTimeLimit));
		Chase Global Variable At Rate(timer, 0, 1, None);
		Set Global Variable(currentTimeLimit, Max(3, Subtract(Global Variable(currentTimeLimit), 1)));
		Set Global Variable(currentCoverSize, Max(1.100, Subtract(Global Variable(currentCoverSize), 0.100)));
		Set Global Variable(currentCoverCount, Max(2, Subtract(Global Variable(currentCoverCount), 1)));
		Set Global Variable(newRound, False);
	}
}

rule("When mini-round ends, kill everyone not under cover, award points to those under cover")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Global Variable(gameActive) == True;
		Global Variable(timer) == 0;
	}

	actions
	{
		Skip If(Is True For Any(Global Variable(coverLocations), Compare(Distance Between(Add(Position Of(Event Player), Vector(0, 5, 0)),
			Current Array Element), <=, Multiply(Global Variable(currentCoverSize), 1.050))), 9);
		Kill(Event Player, Null);
		Skip If(And(Compare(Hero Of(Event Player), ==, Hero(D.Va)), Compare(Max Health(Event Player), >, 200)), 1);
		Set Player Score(Event Player, 0);
		Wait(0.500, Ignore Condition);
		Skip If(Is Alive(Event Player), 2);
		Respawn(Event Player);
		Set Player Variable(Event Player, tpFlag, True);
		Abort;
		Skip(2);
		Skip If(Not(Is Alive(Event Player)), 1);
		Modify Player Score(Event Player, 1);
	}
}

rule("Restart mini-round")
{
	event
	{
		Ongoing - Global;
	}

	conditions
	{
		Global Variable(timer) == 0;
		Global Variable(gameActive) == True;
	}

	actions
	{
		Set Global Variable(newRound, True);
	}
}

rule("When round ends, respawn everyone")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Global Variable(gameActive) == True;
		Or(Compare(Match Time, ==, 0), Compare(Count Of(Filtered Array(All Players(All Teams), And(Is Alive(Current Array Element),
			Player Variable(Current Array Element, isSetup)))), <, 2)) == True;
	}

	actions
	{
		Skip If(Is Alive(Event Player), 2);
		Respawn(Event Player);
		Set Player Variable(Event Player, tpFlag, True);
	}
}

rule("Restart at end of rounds")
{
	event
	{
		Ongoing - Global;
	}

	conditions
	{
		Global Variable(gameActive) == True;
		Or(Compare(Match Time, ==, 0), Compare(Count Of(Filtered Array(All Players(All Teams), And(Is Alive(Current Array Element),
			Player Variable(Current Array Element, isSetup)))), <, 2)) == True;
	}

	actions
	{
		Stop Chasing Global Variable(timer);
		Big Message(All Players(All Teams), Custom String("Round Complete!", Null, Null, Null));
		Small Message(All Players(All Teams), Custom String("Round Complete!", Null, Null, Null));
		Set Global Variable(timer, 10);
		Pause Match Time;
		Wait(2, Ignore Condition);
		Unpause Match Time;
		Set Match Time(70);
		Set Global Variable(newRound, True);
		Set Global Variable(currentCoverCount, 5);
		Set Global Variable(currentCoverSize, 1.500);
		Set Global Variable(currentTimeLimit, 10);
	}
}

rule("Enable spectating")
{
	event
	{
		Player Died;
		All;
		All;
	}

	actions
	{
		Enable Death Spectate All Players(Victim);
	}
}