Description: "In this fast-paced 4v4 brawl, there is one ball and a goal for each team. In order to score, the team must push the ball into the opposing team's goal. The ball can be pushed through dealing damage or healing it.\n[Created by CaptCaptain#11421] [https://workshop.codes/ball-soccer]"
}
lobby
{
Max Team 1 Players: 4
Max Team 2 Players: 4
Map Rotation: After A Game
Return To Lobby: Never
Team Balancing: After A Game
}
modes
{
Skirmish
{
enabled maps
{
Workshop Expanse
Workshop Island
Workshop Island Night
Workshop Expanse Night
Busan
Nepal
}
}
General
{
Limit Valid Control Points: First
}
}
}
variables {
global:
0: GLOBAL_INDEX
1: CURRENT_VERSION
2: TEAM_1_GOAL
3: TEAM_2_GOAL
4: ARENA
5: SPAWNPOINTS
6: SETTING_SCORE_NEEDED
7: SETTING_END_BEHAVIOR_RAW
8: SETTING_END_BEHAVIOR
9: SETTING_TIME_RAW
10: SETTING_WHILE_YOU_WAIT
11: SETTING_LAUNCH_RATE
12: SETTING_HAMMOND_SIZE
13: SETTING_SPEED_SCALAR
14: TEAM_1_SCORE
15: TEAM_2_SCORE
16: ROUND_NUMBER
17: TIME_REMAINING
18: CURRENT_GAME_STATE
19: WRECKING_BALLS
20: WRECKING_BALL_EFFECTS
21: ATTACHING_ALLOWED
22: TEAM_PHYSICS_OWNERSHIP
23: LAST_PUSHED_PLAYER
24: BALL_RESETTING
25: HeroRoster
26: GOAL_EFFECTS
27: ROUND_RESULT
player:
0: PLAYER_INDEX
1: HUDS
}
subroutines {
0: APPLY_IMPULSE
1: CREATE_BALL
2: REMOVE_BALL
3: RESET_BALL
4: KILL_BALL
5: SET_PHYSICS_OWNERSHIP_START
6: SET_PHYSICS_OWNERSHIP_END
7: DESTROY_HUDS
8: DESTROY_CONSTRUCTION
9: RESTRICT_ABILITIES
10: CREATE_GOAL_EFFECTS
11: CLEAR_GOAL_EFFECTS
12: DISABLE_ABILITIES
13: ENABLE_ABILITIES
}
rule ("Initialize global variables") {
event {
Ongoing - Global;
}
actions {
Set Global Variable(GLOBAL_INDEX, 0);
Set Global Variable(CURRENT_VERSION, Custom String("1.3.0", Null, Null, Null));
Set Global Variable(TEAM_1_GOAL, Value In Array(Array(Array(Vector(13, 0, 0), 3), Array(Vector(25, 0, 0), 4), Array(Add(Objective Position(1), Vector(30, 1.75, 0)), 2), Array(Add(Objective Position(0), Vector(2, -0.25, 16)), 3), Array(Vector(13, 0, 0), 3), Array(Vector(13, 0, 0), 3), Array(Vector(25, 0, 0), 4), Array(Vector(25, 0, 0), 4)), Index Of Array Value(Array(Map(Workshop Island), Map(Workshop Expanse), Map(Busan), Map(Nepal), Map(Workshop Island Night), Map(Workshop Chamber), Map(Workshop Expanse Night), Map(Workshop Green Screen)), Current Map)));
Set Global Variable(TEAM_2_GOAL, Value In Array(Array(Array(Vector(-13, 0, 0), 3), Array(Vector(-25, 0, 0), 4), Array(Add(Objective Position(1), Vector(-30, 1.75, 0)), 2), Array(Add(Objective Position(0), Vector(2, -0.25, -16)), 3), Array(Vector(-13, 0, 0), 3), Array(Vector(-13, 0, 0), 3), Array(Vector(-25, 0, 0), 4), Array(Vector(-25, 0, 0), 4)), Index Of Array Value(Array(Map(Workshop Island), Map(Workshop Expanse), Map(Busan), Map(Nepal), Map(Workshop Island Night), Map(Workshop Chamber), Map(Workshop Expanse Night), Map(Workshop Green Screen)), Current Map)));
Set Global Variable(ARENA, Value In Array(Array(Array(Vector(0, 1, 0), 20), Array(Vector(0, 1, 0), 30), Array(Add(Objective Position(1), Vector(0, 3, 0)), 35), Array(Add(Objective Position(0), Vector(0, 2, 0)), 20), Array(Vector(0, 1, 0), 20), Array(Vector(0, 1, 0), 20), Array(Vector(0, 1, 0), 30), Array(Vector(0, 1, 0), 30)), Index Of Array Value(Array(Map(Workshop Island), Map(Workshop Expanse), Map(Busan), Map(Nepal), Map(Workshop Island Night), Map(Workshop Chamber), Map(Workshop Expanse Night), Map(Workshop Green Screen)), Current Map)));
Set Global Variable(SETTING_WHILE_YOU_WAIT, Workshop Setting Toggle(Custom String("Ruleset", Null, Null, Null), Custom String("Enable While You Wait", Null, Null, Null), False, 2));
Set Global Variable(SETTING_LAUNCH_RATE, Workshop Setting Real(Custom String("Advanced", Null, Null, Null), Custom String("Launch Rate", Null, Null, Null), 1, 0.1, 2, 0));
Modify Global Variable(WRECKING_BALLS, Append To Array, Last Created Entity);
"Heal and give them the unkillable status so they can't die"
Start Heal Over Time(Global.WRECKING_BALLS, Null, 9999, 600);
Set Status(Global.WRECKING_BALLS, Null, Unkillable, 9999);
"Set ownership to a random team"
Set Global Variable(TEAM_PHYSICS_OWNERSHIP, Random Value In Array(Array(Team 1, Team 2)));
Set Global Variable(ATTACHING_ALLOWED, True);
"Label and scale ball"
Create In-World Text(Array(All Players(All Teams)), Custom String("{0}\nBALL", Ability Icon String(Hero(Wrecking Ball), Button(Ultimate)), Null, Null), First Of(Global.WRECKING_BALLS), 1.5, Do Not Clip, Visible To Position and Color, Color(Yellow), Default Visibility);
Modify Global Variable(WRECKING_BALL_EFFECTS, Append To Array, Last Text ID);
Start Forcing Player Position(Value In Array(Global.WRECKING_BALLS, Index Of Array Value(Array(Team 2, Team 1), Global.TEAM_PHYSICS_OWNERSHIP)), Vector(0, 100000, 0), False);
Set Status(Value In Array(Global.WRECKING_BALLS, Index Of Array Value(Array(Team 1, Team 2), Global.TEAM_PHYSICS_OWNERSHIP)), Null, Phased Out, 9999);
Set Status(Global.WRECKING_BALLS, Null, Unkillable, 9999);
Wait(1, Ignore Condition);
Communicate(Global.WRECKING_BALLS, Countdown);
Wait(3.5, Ignore Condition);
Start Forcing Player Position(Value In Array(Global.WRECKING_BALLS, Index Of Array Value(Array(Team 2, Team 1), Global.TEAM_PHYSICS_OWNERSHIP)), Random Value In Array(Global.SPAWNPOINTS), False);
Wait(0.25, Ignore Condition);
Communicate(Global.WRECKING_BALLS, Go);
Stop Forcing Player Position(Global.WRECKING_BALLS);
Clear Status(Value In Array(Global.WRECKING_BALLS, Index Of Array Value(Array(Team 1, Team 2), Global.TEAM_PHYSICS_OWNERSHIP)), Phased Out);
Set Global Variable(BALL_RESETTING, False);
}
}
rule ("Subroutine REMOVE_BALL") {
event {
Subroutine;
REMOVE_BALL;
}
actions {
"Remove Wrecking Ball Dummies"
Destroy Dummy Bot(Team 1, 5);
Destroy Dummy Bot(Team 2, 5);
Set Global Variable(WRECKING_BALLS, Empty Array);
"Remove Wrecking Ball Effects"
For Global Variable(GLOBAL_INDEX, 0, Count Of(Global.WRECKING_BALL_EFFECTS), 1);
Destroy In-World Text(Value In Array(Global.WRECKING_BALL_EFFECTS, Global.GLOBAL_INDEX));
End;
Set Global Variable(WRECKING_BALL_EFFECTS, Empty Array);
}
}
rule ("Subroutine KILL_BALL") {
event {
Subroutine;
KILL_BALL;
}
actions {
"Clears any invulnerability effects"
Clear Status(Global.WRECKING_BALLS, Invincible);
Clear Status(Global.WRECKING_BALLS, Unkillable);
Clear Status(Global.WRECKING_BALLS, Phased Out);
"Hides the kill message temporarily and kills the Wrecking Ball dummies"
Disable Messages(All Players(All Teams));
Wait(0.032, Ignore Condition);
Kill(Global.WRECKING_BALLS, If-Then-Else(Or(And(Compare(Team Of(Global.LAST_PUSHED_PLAYER), ==, Team 1), Compare(Distance Between(Position Of(First Of(Global.WRECKING_BALLS)), First Of(Global.TEAM_2_GOAL)), <, Value In Array(Global.TEAM_2_GOAL, 1))), And(Compare(Team Of(Global.LAST_PUSHED_PLAYER), ==, Team 2), Compare(Distance Between(Position Of(Value In Array(Global.WRECKING_BALLS, 1)), First Of(Global.TEAM_1_GOAL)), <, Value In Array(Global.TEAM_1_GOAL, 1)))), Global.LAST_PUSHED_PLAYER, Null));
Damage(Victim, Null, Max Health Of Type(Victim, Health));
Wait(0.5, Ignore Condition);
}
}
rule ("Subroutine DESTROY_CONSTRUCTION") {
event {
Subroutine;
DESTROY_CONSTRUCTION;
}
actions {
Press Button(Event Player, Button(Interact));
Wait(0.125, Ignore Condition);
Press Button(Event Player, Button(Ability 2));
Wait(0.125, Ignore Condition);
Loop If Condition Is True;
}
}
rule ("Subroutine DESTROY_HUDS") {
event {
Subroutine;
DESTROY_HUDS;
}
actions {
For Player Variable(Event Player, PLAYER_INDEX, 0, Count Of((Event Player).HUDS), 1);
Destroy HUD Text(Value In Array((Event Player).HUDS, Global.GLOBAL_INDEX));
End;
Set Player Variable(Event Player, HUDS, Empty Array);
}
}
rule ("Subroutine RESTRICT_ABILITIES") {
event {
Subroutine;
RESTRICT_ABILITIES;
}
actions {
Set Ability 1 Enabled(Event Player, True);
Set Ability 2 Enabled(Event Player, True);
Set Secondary Fire Enabled(Event Player, True);
If(True);
Skip(Value In Array(Array(2, 0), Add(1, Index Of Array Value(Array(Hero(Baptiste)), Hero Of(Event Player)))));
//__label_switch_2_0__:
Set Ability 2 Enabled(Event Player, False);
Else;
//__label_switch_2_default__:
End;
}
}
rule ("Player Hud") {
event {
Player Joined Match;
All;
All;
}
conditions {
Is Dummy Bot(Event Player) == False;
}
actions {
Call Subroutine(DESTROY_HUDS);
Wait(0.016, Ignore Condition);
Create HUD Text(If-Then-Else(Compare(Distance Between(Position Of(Event Player), Value In Array(Array(First Of(Global.TEAM_1_GOAL), First Of(Global.TEAM_2_GOAL)), Index Of Array Value(Array(Team 1, Team 2), Team Of(Event Player)))), <, Value In Array(Array(Value In Array(Global.TEAM_1_GOAL, 1), Value In Array(Global.TEAM_2_GOAL, 1)), Index Of Array Value(Array(Team 1, Team 2), Team Of(Event Player)))), Event Player, Null), Null, Null, Custom String(" {0}{1}", Evaluate Once(Custom String("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", Null, Null, Null)), If-Then-Else(Compare(Global.CURRENT_GAME_STATE, !=, 2), Custom String("PRESS {0} TO SWITCH HEROES", Input Binding String(Button(Interact)), Null, Null), Custom String("YOU CANNOT SWITCH HEROES DURING THE ROUND", Null, Null, Null)), Null), Top, 2, Null, Null, If-Then-Else(Compare(Global.CURRENT_GAME_STATE, !=, 2), Color(Yellow), Color(Red)), Visible To String and Color, Default Visibility);
Modify Player Variable(Event Player, HUDS, Append To Array, Last Text ID);
Create HUD Text(If-Then-Else(Compare(Global.CURRENT_GAME_STATE, !=, 0), Event Player, Null), Custom String("Score: {0} to {1}", Value In Array(Array(Global.TEAM_1_SCORE, Global.TEAM_2_SCORE), Index Of Array Value(Array(Team 1, Team 2), Team Of(Event Player))), Value In Array(Array(Global.TEAM_1_SCORE, Global.TEAM_2_SCORE), Index Of Array Value(Array(Team 2, Team 1), Team Of(Event Player))), Null), Custom String("", Null, Null, Null), If-Then-Else(Compare(Global.TIME_REMAINING, >, 60), Custom String("Time Remaining:\n{0}:{1}", Round To Integer(Divide(Modulo(Modulo(Global.TIME_REMAINING, 86400), 3600), 60), Down), Round To Integer(Modulo(Modulo(Modulo(Global.TIME_REMAINING, 86400), 3600), 60), Down), Null), Custom String("Time Remaining:\n{0}", Global.TIME_REMAINING, Null, Null)), Top, 0, Color(Turquoise), Color(Rose), Color(Rose), Visible To and String, Default Visibility);
Modify Player Variable(Event Player, HUDS, Append To Array, Last Text ID);
Create HUD Text(If-Then-Else(Compare(Global.CURRENT_GAME_STATE, ==, 0), Event Player, Null), Custom String("WAITING FOR PLAYERS", Null, Null, Null), Null, Null, Top, 0, Color(White), Null, Null, Visible To and String, Default Visibility);
Modify Player Variable(Event Player, HUDS, Append To Array, Last Text ID);
Create HUD Text(Event Player, Null, Null, Custom String("{0} Wreckingball Soccer by CaptCaptain#11421", Ability Icon String(Hero(Wrecking Ball), Button(Ultimate)), Null, Null), Right, 1, Null, Null, Color(Orange), Visible To and String, Default Visibility);
Modify Player Variable(Event Player, HUDS, Append To Array, Last Text ID);
Teleport(Event Player, Value In Array(Array(First Of(Global.TEAM_1_GOAL), First Of(Global.TEAM_2_GOAL)), Index Of Array Value(Array(Team 1, Team 2), Team Of(Event Player))));
Set Facing(Event Player, Direction Towards(Value In Array(Array(First Of(Global.TEAM_1_GOAL), First Of(Global.TEAM_2_GOAL)), Index Of Array Value(Array(Team 1, Team 2), Team Of(Event Player))), Value In Array(Array(First Of(Global.TEAM_1_GOAL), First Of(Global.TEAM_2_GOAL)), Index Of Array Value(Array(Team 2, Team 1), Team Of(Event Player)))), To World);
}
}
rule ("Switch Heroes") {
event {
Ongoing - Each Player;
All;
All;
}
conditions {
Global.CURRENT_GAME_STATE != 2;
Distance Between(Position Of(Event Player), Value In Array(Array(First Of(Global.TEAM_1_GOAL), First Of(Global.TEAM_2_GOAL)), Index Of Array Value(Array(Team 1, Team 2), Team Of(Event Player)))) < Value In Array(Array(Value In Array(Global.TEAM_1_GOAL, 1), Value In Array(Global.TEAM_2_GOAL, 1)), Index Of Array Value(Array(Team 1, Team 2), Team Of(Event Player)));
rule ("Allow Ultimate Confirmation for Doomfist") {
event {
Ongoing - Each Player;
All;
Doomfist;
}
conditions {
Is Using Ultimate(Event Player) == True;
}
actions {
Set Primary Fire Enabled(Event Player, True);
Wait Until(Not(Is Using Ultimate(Event Player)), 4);
Set Primary Fire Enabled(Event Player, False);
}
}
rule ("Prevent Primary Fire bypass with Ultimate Confirmation") {
event {
Ongoing - Each Player;
All;
All;
}
conditions {
Is True For Any(Array(Hero(Echo), Hero(Ana)), Or(Compare(Hero Of(Event Player), ==, Current Array Element), Compare(Hero Being Duplicated(Event Player), ==, Current Array Element))) == True;
Create Beam Effect(All Players(All Teams), Good Beam, Add(First Of(Global.TEAM_1_GOAL), Vector(Value In Array(Global.TEAM_1_GOAL, 1), 0, Value In Array(Global.TEAM_1_GOAL, 1))), Add(First Of(Global.TEAM_1_GOAL), Vector(Multiply(-1, Value In Array(Global.TEAM_1_GOAL, 1)), 0, Value In Array(Global.TEAM_1_GOAL, 1))), Color(Team 1), Visible To and Color);
Modify Global Variable(GOAL_EFFECTS, Append To Array, Last Created Entity);
Create Beam Effect(All Players(All Teams), Good Beam, Add(First Of(Global.TEAM_1_GOAL), Vector(Value In Array(Global.TEAM_1_GOAL, 1), 0, Value In Array(Global.TEAM_1_GOAL, 1))), Add(First Of(Global.TEAM_1_GOAL), Vector(Value In Array(Global.TEAM_1_GOAL, 1), 0, Multiply(-1, Value In Array(Global.TEAM_1_GOAL, 1)))), Color(Team 1), Visible To and Color);
Modify Global Variable(GOAL_EFFECTS, Append To Array, Last Created Entity);
Create Beam Effect(All Players(All Teams), Good Beam, Add(First Of(Global.TEAM_1_GOAL), Vector(Multiply(-1, Value In Array(Global.TEAM_1_GOAL, 1)), 0, Value In Array(Global.TEAM_1_GOAL, 1))), Add(First Of(Global.TEAM_1_GOAL), Vector(Multiply(-1, Value In Array(Global.TEAM_1_GOAL, 1)), 0, Multiply(-1, Value In Array(Global.TEAM_1_GOAL, 1)))), Color(Team 1), Visible To and Color);
Modify Global Variable(GOAL_EFFECTS, Append To Array, Last Created Entity);
Create Beam Effect(All Players(All Teams), Good Beam, Add(First Of(Global.TEAM_1_GOAL), Vector(Value In Array(Global.TEAM_1_GOAL, 1), 0, Multiply(-1, Value In Array(Global.TEAM_1_GOAL, 1)))), Add(First Of(Global.TEAM_1_GOAL), Vector(Multiply(-1, Value In Array(Global.TEAM_1_GOAL, 1)), 0, Multiply(-1, Value In Array(Global.TEAM_1_GOAL, 1)))), Color(Team 1), Visible To and Color);
Modify Global Variable(GOAL_EFFECTS, Append To Array, Last Created Entity);
"Top"
Create Beam Effect(All Players(All Teams), Good Beam, Add(Add(First Of(Global.TEAM_1_GOAL), Multiply(Up, Value In Array(Global.TEAM_1_GOAL, 1))), Vector(Value In Array(Global.TEAM_1_GOAL, 1), 0, Value In Array(Global.TEAM_1_GOAL, 1))), Add(Add(First Of(Global.TEAM_1_GOAL), Multiply(Up, Value In Array(Global.TEAM_1_GOAL, 1))), Vector(Multiply(-1, Value In Array(Global.TEAM_1_GOAL, 1)), 0, Value In Array(Global.TEAM_1_GOAL, 1))), Color(Team 1), Visible To and Color);
Modify Global Variable(GOAL_EFFECTS, Append To Array, Last Created Entity);
Create Beam Effect(All Players(All Teams), Good Beam, Add(Add(First Of(Global.TEAM_1_GOAL), Multiply(Up, Value In Array(Global.TEAM_1_GOAL, 1))), Vector(Value In Array(Global.TEAM_1_GOAL, 1), 0, Value In Array(Global.TEAM_1_GOAL, 1))), Add(Add(First Of(Global.TEAM_1_GOAL), Multiply(Up, Value In Array(Global.TEAM_1_GOAL, 1))), Vector(Value In Array(Global.TEAM_1_GOAL, 1), 0, Multiply(-1, Value In Array(Global.TEAM_1_GOAL, 1)))), Color(Team 1), Visible To and Color);
Modify Global Variable(GOAL_EFFECTS, Append To Array, Last Created Entity);
Create Beam Effect(All Players(All Teams), Good Beam, Add(Add(First Of(Global.TEAM_1_GOAL), Multiply(Up, Value In Array(Global.TEAM_1_GOAL, 1))), Vector(Multiply(-1, Value In Array(Global.TEAM_1_GOAL, 1)), 0, Value In Array(Global.TEAM_1_GOAL, 1))), Add(Add(First Of(Global.TEAM_1_GOAL), Multiply(Up, Value In Array(Global.TEAM_1_GOAL, 1))), Vector(Multiply(-1, Value In Array(Global.TEAM_1_GOAL, 1)), 0, Multiply(-1, Value In Array(Global.TEAM_1_GOAL, 1)))), Color(Team 1), Visible To and Color);
Modify Global Variable(GOAL_EFFECTS, Append To Array, Last Created Entity);
Create Beam Effect(All Players(All Teams), Good Beam, Add(Add(First Of(Global.TEAM_1_GOAL), Multiply(Up, Value In Array(Global.TEAM_1_GOAL, 1))), Vector(Value In Array(Global.TEAM_1_GOAL, 1), 0, Multiply(-1, Value In Array(Global.TEAM_1_GOAL, 1)))), Add(Add(First Of(Global.TEAM_1_GOAL), Multiply(Up, Value In Array(Global.TEAM_1_GOAL, 1))), Vector(Multiply(-1, Value In Array(Global.TEAM_1_GOAL, 1)), 0, Multiply(-1, Value In Array(Global.TEAM_1_GOAL, 1)))), Color(Team 1), Visible To and Color);
Modify Global Variable(GOAL_EFFECTS, Append To Array, Last Created Entity);
"Connecting bottom to top"
Create Beam Effect(All Players(All Teams), Good Beam, Add(First Of(Global.TEAM_1_GOAL), Vector(Value In Array(Global.TEAM_1_GOAL, 1), 0, Value In Array(Global.TEAM_1_GOAL, 1))), Add(First Of(Global.TEAM_1_GOAL), Vector(Multiply(Value In Array(Global.TEAM_1_GOAL, 1), 1.01), Value In Array(Global.TEAM_1_GOAL, 1), Value In Array(Global.TEAM_1_GOAL, 1))), Color(Team 1), Visible To and Color);
Modify Global Variable(GOAL_EFFECTS, Append To Array, Last Created Entity);
Create Beam Effect(All Players(All Teams), Good Beam, Add(First Of(Global.TEAM_1_GOAL), Vector(Multiply(-1, Value In Array(Global.TEAM_1_GOAL, 1)), 0, Value In Array(Global.TEAM_1_GOAL, 1))), Add(First Of(Global.TEAM_1_GOAL), Vector(Multiply(Multiply(-1, Value In Array(Global.TEAM_1_GOAL, 1)), 1.01), Value In Array(Global.TEAM_1_GOAL, 1), Value In Array(Global.TEAM_1_GOAL, 1))), Color(Team 1), Visible To and Color);
Modify Global Variable(GOAL_EFFECTS, Append To Array, Last Created Entity);
Create Beam Effect(All Players(All Teams), Good Beam, Add(First Of(Global.TEAM_1_GOAL), Vector(Value In Array(Global.TEAM_1_GOAL, 1), 0, Multiply(-1, Value In Array(Global.TEAM_1_GOAL, 1)))), Add(First Of(Global.TEAM_1_GOAL), Vector(Multiply(Value In Array(Global.TEAM_1_GOAL, 1), 1.01), Value In Array(Global.TEAM_1_GOAL, 1), Multiply(-1, Value In Array(Global.TEAM_1_GOAL, 1)))), Color(Team 1), Visible To and Color);
Modify Global Variable(GOAL_EFFECTS, Append To Array, Last Created Entity);
Create Beam Effect(All Players(All Teams), Good Beam, Add(First Of(Global.TEAM_1_GOAL), Vector(Multiply(-1, Value In Array(Global.TEAM_1_GOAL, 1)), 0, Multiply(-1, Value In Array(Global.TEAM_1_GOAL, 1)))), Add(First Of(Global.TEAM_1_GOAL), Vector(Multiply(Multiply(-1, Value In Array(Global.TEAM_1_GOAL, 1)), 1.01), Value In Array(Global.TEAM_1_GOAL, 1), Multiply(-1, Value In Array(Global.TEAM_1_GOAL, 1)))), Color(Team 1), Visible To and Color);
Modify Global Variable(GOAL_EFFECTS, Append To Array, Last Created Entity);
"Team 1 Labels"
Create In-World Text(All Players(Team 1), Custom String("Team Goal", Null, Null, Null), Add(First Of(Global.TEAM_1_GOAL), Vector(0, Value In Array(Global.TEAM_1_GOAL, 1), 0)), 2, Do Not Clip, Visible To and Color, Color(Team 1), Default Visibility);
Modify Global Variable(GOAL_EFFECTS, Append To Array, Last Text ID);
Create In-World Text(All Players(Team 1), Custom String("Enemy Goal", Null, Null, Null), Add(First Of(Global.TEAM_2_GOAL), Vector(0, Value In Array(Global.TEAM_2_GOAL, 1), 0)), 2, Do Not Clip, Visible To and Color, Color(Team 2), Default Visibility);
Modify Global Variable(GOAL_EFFECTS, Append To Array, Last Text ID);
"Team 2
\n Bottom"
Create Beam Effect(All Players(All Teams), Good Beam, Add(First Of(Global.TEAM_2_GOAL), Vector(Value In Array(Global.TEAM_2_GOAL, 1), 0, Value In Array(Global.TEAM_2_GOAL, 1))), Add(First Of(Global.TEAM_2_GOAL), Vector(Multiply(-1, Value In Array(Global.TEAM_2_GOAL, 1)), 0, Value In Array(Global.TEAM_2_GOAL, 1))), Color(Team 2), Visible To and Color);
Modify Global Variable(GOAL_EFFECTS, Append To Array, Last Created Entity);
Create Beam Effect(All Players(All Teams), Good Beam, Add(First Of(Global.TEAM_2_GOAL), Vector(Value In Array(Global.TEAM_2_GOAL, 1), 0, Value In Array(Global.TEAM_2_GOAL, 1))), Add(First Of(Global.TEAM_2_GOAL), Vector(Value In Array(Global.TEAM_2_GOAL, 1), 0, Multiply(-1, Value In Array(Global.TEAM_2_GOAL, 1)))), Color(Team 2), Visible To and Color);
Modify Global Variable(GOAL_EFFECTS, Append To Array, Last Created Entity);
Create Beam Effect(All Players(All Teams), Good Beam, Add(First Of(Global.TEAM_2_GOAL), Vector(Multiply(-1, Value In Array(Global.TEAM_2_GOAL, 1)), 0, Value In Array(Global.TEAM_2_GOAL, 1))), Add(First Of(Global.TEAM_2_GOAL), Vector(Multiply(-1, Value In Array(Global.TEAM_2_GOAL, 1)), 0, Multiply(-1, Value In Array(Global.TEAM_2_GOAL, 1)))), Color(Team 2), Visible To and Color);
Modify Global Variable(GOAL_EFFECTS, Append To Array, Last Created Entity);
Create Beam Effect(All Players(All Teams), Good Beam, Add(First Of(Global.TEAM_2_GOAL), Vector(Value In Array(Global.TEAM_2_GOAL, 1), 0, Multiply(-1, Value In Array(Global.TEAM_2_GOAL, 1)))), Add(First Of(Global.TEAM_2_GOAL), Vector(Multiply(-1, Value In Array(Global.TEAM_2_GOAL, 1)), 0, Multiply(-1, Value In Array(Global.TEAM_2_GOAL, 1)))), Color(Team 2), Visible To and Color);
Modify Global Variable(GOAL_EFFECTS, Append To Array, Last Created Entity);
"Top"
Create Beam Effect(All Players(All Teams), Good Beam, Add(Add(First Of(Global.TEAM_2_GOAL), Multiply(Up, Value In Array(Global.TEAM_2_GOAL, 1))), Vector(Value In Array(Global.TEAM_2_GOAL, 1), 0, Value In Array(Global.TEAM_2_GOAL, 1))), Add(Add(First Of(Global.TEAM_2_GOAL), Multiply(Up, Value In Array(Global.TEAM_2_GOAL, 1))), Vector(Multiply(-1, Value In Array(Global.TEAM_2_GOAL, 1)), 0, Value In Array(Global.TEAM_2_GOAL, 1))), Color(Team 2), Visible To and Color);
Modify Global Variable(GOAL_EFFECTS, Append To Array, Last Created Entity);
Create Beam Effect(All Players(All Teams), Good Beam, Add(Add(First Of(Global.TEAM_2_GOAL), Multiply(Up, Value In Array(Global.TEAM_2_GOAL, 1))), Vector(Value In Array(Global.TEAM_2_GOAL, 1), 0, Value In Array(Global.TEAM_2_GOAL, 1))), Add(Add(First Of(Global.TEAM_2_GOAL), Multiply(Up, Value In Array(Global.TEAM_2_GOAL, 1))), Vector(Value In Array(Global.TEAM_2_GOAL, 1), 0, Multiply(-1, Value In Array(Global.TEAM_2_GOAL, 1)))), Color(Team 2), Visible To and Color);
Modify Global Variable(GOAL_EFFECTS, Append To Array, Last Created Entity);
Create Beam Effect(All Players(All Teams), Good Beam, Add(Add(First Of(Global.TEAM_2_GOAL), Multiply(Up, Value In Array(Global.TEAM_2_GOAL, 1))), Vector(Multiply(-1, Value In Array(Global.TEAM_2_GOAL, 1)), 0, Value In Array(Global.TEAM_2_GOAL, 1))), Add(Add(First Of(Global.TEAM_2_GOAL), Multiply(Up, Value In Array(Global.TEAM_2_GOAL, 1))), Vector(Multiply(-1, Value In Array(Global.TEAM_2_GOAL, 1)), 0, Multiply(-1, Value In Array(Global.TEAM_2_GOAL, 1)))), Color(Team 2), Visible To and Color);
Modify Global Variable(GOAL_EFFECTS, Append To Array, Last Created Entity);
Create Beam Effect(All Players(All Teams), Good Beam, Add(Add(First Of(Global.TEAM_2_GOAL), Multiply(Up, Value In Array(Global.TEAM_2_GOAL, 1))), Vector(Value In Array(Global.TEAM_2_GOAL, 1), 0, Multiply(-1, Value In Array(Global.TEAM_2_GOAL, 1)))), Add(Add(First Of(Global.TEAM_2_GOAL), Multiply(Up, Value In Array(Global.TEAM_2_GOAL, 1))), Vector(Multiply(-1, Value In Array(Global.TEAM_2_GOAL, 1)), 0, Multiply(-1, Value In Array(Global.TEAM_2_GOAL, 1)))), Color(Team 2), Visible To and Color);
Modify Global Variable(GOAL_EFFECTS, Append To Array, Last Created Entity);
"Connecting bottom to top"
Create Beam Effect(All Players(All Teams), Good Beam, Add(First Of(Global.TEAM_2_GOAL), Vector(Value In Array(Global.TEAM_2_GOAL, 1), 0, Value In Array(Global.TEAM_2_GOAL, 1))), Add(First Of(Global.TEAM_2_GOAL), Vector(Multiply(Value In Array(Global.TEAM_2_GOAL, 1), 1.01), Value In Array(Global.TEAM_2_GOAL, 1), Value In Array(Global.TEAM_2_GOAL, 1))), Color(Team 2), Visible To and Color);
Modify Global Variable(GOAL_EFFECTS, Append To Array, Last Created Entity);
Create Beam Effect(All Players(All Teams), Good Beam, Add(First Of(Global.TEAM_2_GOAL), Vector(Multiply(-1, Value In Array(Global.TEAM_2_GOAL, 1)), 0, Value In Array(Global.TEAM_2_GOAL, 1))), Add(First Of(Global.TEAM_2_GOAL), Vector(Multiply(Multiply(-1, Value In Array(Global.TEAM_2_GOAL, 1)), 1.01), Value In Array(Global.TEAM_2_GOAL, 1), Value In Array(Global.TEAM_2_GOAL, 1))), Color(Team 2), Visible To and Color);
Modify Global Variable(GOAL_EFFECTS, Append To Array, Last Created Entity);
Create Beam Effect(All Players(All Teams), Good Beam, Add(First Of(Global.TEAM_2_GOAL), Vector(Value In Array(Global.TEAM_2_GOAL, 1), 0, Multiply(-1, Value In Array(Global.TEAM_2_GOAL, 1)))), Add(First Of(Global.TEAM_2_GOAL), Vector(Multiply(Value In Array(Global.TEAM_2_GOAL, 1), 1.01), Value In Array(Global.TEAM_2_GOAL, 1), Multiply(-1, Value In Array(Global.TEAM_2_GOAL, 1)))), Color(Team 2), Visible To and Color);
Modify Global Variable(GOAL_EFFECTS, Append To Array, Last Created Entity);
Create Beam Effect(All Players(All Teams), Good Beam, Add(First Of(Global.TEAM_2_GOAL), Vector(Multiply(-1, Value In Array(Global.TEAM_2_GOAL, 1)), 0, Multiply(-1, Value In Array(Global.TEAM_2_GOAL, 1)))), Add(First Of(Global.TEAM_2_GOAL), Vector(Multiply(Multiply(-1, Value In Array(Global.TEAM_2_GOAL, 1)), 1.01), Value In Array(Global.TEAM_2_GOAL, 1), Multiply(-1, Value In Array(Global.TEAM_2_GOAL, 1)))), Color(Team 2), Visible To and Color);
Modify Global Variable(GOAL_EFFECTS, Append To Array, Last Created Entity);
"Team 2 Labels"
Create In-World Text(All Players(Team 2), Custom String("Team Goal", Null, Null, Null), Add(First Of(Global.TEAM_2_GOAL), Vector(0, Value In Array(Global.TEAM_2_GOAL, 1), 0)), 2, Do Not Clip, Visible To and Color, Color(Team 2), Default Visibility);
Modify Global Variable(GOAL_EFFECTS, Append To Array, Last Text ID);
Create In-World Text(All Players(Team 2), Custom String("Enemy Goal", Null, Null, Null), Add(First Of(Global.TEAM_1_GOAL), Vector(0, Value In Array(Global.TEAM_1_GOAL, 1), 0)), 2, Do Not Clip, Visible To and Color, Color(Team 1), Default Visibility);
Modify Global Variable(GOAL_EFFECTS, Append To Array, Last Text ID);
"Arena"
Create Beam Effect(All Players(All Teams), Bad Beam, Add(First Of(Global.ARENA), Vector(Value In Array(Global.ARENA, 1), 0, Value In Array(Global.ARENA, 1))), Add(First Of(Global.ARENA), Vector(Multiply(-1, Value In Array(Global.ARENA, 1)), 0, Value In Array(Global.ARENA, 1))), Color(Rose), Visible To and Color);
Modify Global Variable(GOAL_EFFECTS, Append To Array, Last Created Entity);
Create Beam Effect(All Players(All Teams), Bad Beam, Add(First Of(Global.ARENA), Vector(Value In Array(Global.ARENA, 1), 0, Value In Array(Global.ARENA, 1))), Add(First Of(Global.ARENA), Vector(Value In Array(Global.ARENA, 1), 0, Multiply(-1, Value In Array(Global.ARENA, 1)))), Color(Rose), Visible To and Color);
Modify Global Variable(GOAL_EFFECTS, Append To Array, Last Created Entity);
Create Beam Effect(All Players(All Teams), Bad Beam, Add(First Of(Global.ARENA), Vector(Multiply(-1, Value In Array(Global.ARENA, 1)), 0, Value In Array(Global.ARENA, 1))), Add(First Of(Global.ARENA), Vector(Multiply(-1, Value In Array(Global.ARENA, 1)), 0, Multiply(-1, Value In Array(Global.ARENA, 1)))), Color(Rose), Visible To and Color);
Modify Global Variable(GOAL_EFFECTS, Append To Array, Last Created Entity);
Create Beam Effect(All Players(All Teams), Bad Beam, Add(First Of(Global.ARENA), Vector(Value In Array(Global.ARENA, 1), 0, Multiply(-1, Value In Array(Global.ARENA, 1)))), Add(First Of(Global.ARENA), Vector(Multiply(-1, Value In Array(Global.ARENA, 1)), 0, Multiply(-1, Value In Array(Global.ARENA, 1)))), Color(Rose), Visible To and Color);
Modify Global Variable(GOAL_EFFECTS, Append To Array, Last Created Entity);
}
}
rule ("Subroutine CLEAR_GOAL_EFFECTS") {
event {
Subroutine;
CLEAR_GOAL_EFFECTS;
}
actions {
For Global Variable(GLOBAL_INDEX, 0, Count Of(Global.GOAL_EFFECTS), 1);
Destroy Effect(Value In Array(Global.GOAL_EFFECTS, Global.GLOBAL_INDEX));
Destroy In-World Text(Value In Array(Global.GOAL_EFFECTS, Global.GLOBAL_INDEX));
End;
Set Global Variable(GOAL_EFFECTS, Empty Array);
}
}
rule ("Create Goals") {
event {
Ongoing - Global;
}
actions {
Call Subroutine(CREATE_GOAL_EFFECTS);
}
}
rule ("Keep in Arena") {
event {
Ongoing - Each Player;
All;
All;
}
conditions {
Is In Spawn Room(Event Player) == False;
Or(Or(Or(Compare(X Component Of(Position Of(Event Player)), >, X Component Of(Add(First Of(Global.ARENA), Vector(Value In Array(Global.ARENA, 1), 0, 0)))), Compare(X Component Of(Position Of(Event Player)), <, X Component Of(Add(First Of(Global.ARENA), Vector(Multiply(-1, Value In Array(Global.ARENA, 1)), 0, 0))))), Compare(Z Component Of(Position Of(Event Player)), <, Z Component Of(Add(First Of(Global.ARENA), Vector(0, 0, Multiply(-1, Value In Array(Global.ARENA, 1))))))), Compare(Z Component Of(Position Of(Event Player)), >, Z Component Of(Add(First Of(Global.ARENA), Vector(0, 0, Value In Array(Global.ARENA, 1)))))) == True;
}
actions {
If(And(Not(Array Contains(Global.WRECKING_BALLS, Event Player)), And(Compare(Hero Of(Event Player), ==, Hero(Reinhardt)), Is Using Ability 1(Event Player))));
Cancel Primary Action(Event Player);
End;
"Accelerate players toward the goal whose team has ownership of the ball"
Start Accelerating(Event Player, Direction Towards(Vector(X Component Of(Position Of(Event Player)), Y Component Of(Value In Array(Array(First Of(Global.TEAM_1_GOAL), First Of(Global.TEAM_2_GOAL)), Index Of Array Value(Array(Team 1, Team 2), Global.TEAM_PHYSICS_OWNERSHIP))), Z Component Of(Position Of(Event Player))), Value In Array(Array(First Of(Global.TEAM_1_GOAL), First Of(Global.TEAM_2_GOAL)), Index Of Array Value(Array(Team 1, Team 2), Global.TEAM_PHYSICS_OWNERSHIP))), 500, 1000, To World, Direction Rate and Max Speed);
If(And(Not(Array Contains(Global.WRECKING_BALLS, Event Player)), Compare(Distance Between(Vector(X Component Of(Position Of(Event Player)), Y Component Of(First Of(Global.ARENA)), Z Component Of(Position Of(Event Player))), First Of(Global.ARENA)), >, Add(Value In Array(Global.ARENA, 1), 13))));
Teleport(Event Player, Add(Position Of(Event Player), Direction Towards(Vector(X Component Of(Position Of(Event Player)), Y Component Of(First Of(Global.ARENA)), Z Component Of(Position Of(Event Player))), First Of(Global.ARENA))));
End;
Wait(0.016, Ignore Condition);
Loop If Condition Is True;
Stop Accelerating(Event Player);
Apply Impulse(Event Player, Direction Towards(Down, Up), 0.01, To Player, Cancel Contrary Motion XYZ);
}
}
rule ("Subroutine DISABLE_ABILITIES") {
event {
Subroutine;
DISABLE_ABILITIES;
}
actions {
Disallow Button(Remove From Array(All Players(All Teams), Global.WRECKING_BALLS), Button(Primary Fire));
Set Secondary Fire Enabled(Remove From Array(All Players(All Teams), Global.WRECKING_BALLS), False);
Set Ability 1 Enabled(Remove From Array(All Players(All Teams), Global.WRECKING_BALLS), False);
Set Ability 2 Enabled(Remove From Array(All Players(All Teams), Global.WRECKING_BALLS), False);
Disallow Button(Remove From Array(All Players(All Teams), Global.WRECKING_BALLS), Button(Ultimate));
}
}
rule ("Subroutine ENABLE_ABILITIES") {
event {
Subroutine;
ENABLE_ABILITIES;
}
actions {
Allow Button(Remove From Array(All Players(All Teams), Global.WRECKING_BALLS), Button(Primary Fire));
Set Secondary Fire Enabled(Remove From Array(All Players(All Teams), Global.WRECKING_BALLS), True);
Set Ability 1 Enabled(Remove From Array(All Players(All Teams), Global.WRECKING_BALLS), True);
Set Ability 2 Enabled(Remove From Array(All Players(All Teams), Global.WRECKING_BALLS), True);
Allow Button(Remove From Array(All Players(All Teams), Global.WRECKING_BALLS), Button(Ultimate));
}
}
rule ("Waiting for Players") {
event {
Ongoing - Global;
}
conditions {
Global.CURRENT_GAME_STATE == 0;
Count Of(Remove From Array(All Players(Team 1), Global.WRECKING_BALLS)) > 0;
Count Of(Remove From Array(All Players(Team 2), Global.WRECKING_BALLS)) > 0;
}
actions {
Wait Until(And(Is True For All(All Players(All Teams), Has Spawned(Current Array Element)), Not(Global.BALL_RESETTING)), 9999);
Wait(1, Ignore Condition);
"Reset ultimate charge for everyone and begin game"
Set Global Variable(CURRENT_GAME_STATE, 1);
Set Ultimate Charge(All Players(All Teams), 0);
}
}
rule ("Spawn Ball") {
event {
Ongoing - Global;
}
actions {
Call Subroutine(CREATE_BALL);
}
}
rule ("Reset Ball") {
event {
Ongoing - Global;
}
conditions {
Or(Or(Compare(Distance Between(Position Of(First Of(Global.WRECKING_BALLS)), First Of(Global.TEAM_2_GOAL)), <, Value In Array(Global.TEAM_2_GOAL, 1)), Compare(Distance Between(Position Of(Value In Array(Global.WRECKING_BALLS, 1)), First Of(Global.TEAM_1_GOAL)), <, Value In Array(Global.TEAM_1_GOAL, 1))), And(Is Dead(First Of(Global.WRECKING_BALLS)), Is Dead(Value In Array(Global.WRECKING_BALLS, 1)))) == True;
Global.CURRENT_GAME_STATE == 0;
}
actions {
Wait(0.016, Abort When False);
Call Subroutine(KILL_BALL);
Wait(1, Ignore Condition);
Set Global Variable(TEAM_PHYSICS_OWNERSHIP, Opposite Team Of(Global.TEAM_PHYSICS_OWNERSHIP));
Call Subroutine(RESET_BALL);
}
}
rule ("Setup") {
event {
Ongoing - Global;
}
conditions {
Global.CURRENT_GAME_STATE == 1;
Global.BALL_RESETTING == False;
}
actions {
Modify Global Variable(ROUND_NUMBER, Add, 1);
"Teleport players to their goals"
Set Status(Remove From Array(All Players(All Teams), Global.WRECKING_BALLS), Null, Rooted, 9999);
Cancel Primary Action(Remove From Array(All Players(All Teams), Global.WRECKING_BALLS));
Respawn(Remove From Array(All Players(All Teams), Global.WRECKING_BALLS));
Set Facing(Remove From Array(All Players(Team 1), Global.WRECKING_BALLS), Direction Towards(First Of(Global.TEAM_1_GOAL), First Of(Global.TEAM_2_GOAL)), To World);
Set Facing(Remove From Array(All Players(Team 2), Global.WRECKING_BALLS), Direction Towards(First Of(Global.TEAM_2_GOAL), First Of(Global.TEAM_1_GOAL)), To World);
Teleport(Remove From Array(All Players(Team 1), Global.WRECKING_BALLS), First Of(Global.TEAM_1_GOAL));
Teleport(Remove From Array(All Players(Team 2), Global.WRECKING_BALLS), First Of(Global.TEAM_2_GOAL));
Disable Movement Collision With Players(Remove From Array(All Players(All Teams), Global.WRECKING_BALLS));
Call Subroutine(DISABLE_ABILITIES);
Set Global Variable(TEAM_PHYSICS_OWNERSHIP, Opposite Team Of(Global.TEAM_PHYSICS_OWNERSHIP));
Set Global Variable(LAST_PUSHED_PLAYER, Null);
Big Message(All Players(All Teams), Custom String("ROUND {0}", Global.ROUND_NUMBER, Null, Null));
Call Subroutine(RESET_BALL);
Set Global Variable(CURRENT_GAME_STATE, 2);
}
}
rule ("Round") {
event {
Ongoing - Global;
}
conditions {
Global.CURRENT_GAME_STATE == 2;
}
actions {
Clear Status(Remove From Array(All Players(All Teams), Global.WRECKING_BALLS), Rooted);
Enable Movement Collision With Players(Remove From Array(All Players(All Teams), Global.WRECKING_BALLS));
Call Subroutine(ENABLE_ABILITIES);
Chase Global Variable At Rate(TIME_REMAINING, 0, 1, None);
}
}
rule ("Score") {
event {
Ongoing - Global;
}
conditions {
Global.CURRENT_GAME_STATE == 2;
Or(Compare(Distance Between(Position Of(First Of(Global.WRECKING_BALLS)), First Of(Global.TEAM_2_GOAL)), <, Value In Array(Global.TEAM_2_GOAL, 1)), Compare(Distance Between(Position Of(Value In Array(Global.WRECKING_BALLS, 1)), First Of(Global.TEAM_1_GOAL)), <, Value In Array(Global.TEAM_1_GOAL, 1))) == True;
}
actions {
"The round result is determined by which goal the ball is in."
Set Global Variable(ROUND_RESULT, Value In Array(Array(Team 1, Team 2), Index Of Array Value(Array(Compare(Distance Between(Position Of(First Of(Global.WRECKING_BALLS)), First Of(Global.TEAM_2_GOAL)), <, Value In Array(Global.TEAM_2_GOAL, 1)), Compare(Distance Between(Position Of(Value In Array(Global.WRECKING_BALLS, 1)), First Of(Global.TEAM_1_GOAL)), <, Value In Array(Global.TEAM_1_GOAL, 1))), True)));
"Remove ball and award score to player"
Call Subroutine(KILL_BALL);
Stop Chasing Global Variable(TIME_REMAINING);
Set Slow Motion(30);
Big Message(If-Then-Else(Or(And(Compare(Team Of(Global.LAST_PUSHED_PLAYER), ==, Team 1), Compare(Distance Between(Position Of(First Of(Global.WRECKING_BALLS)), First Of(Global.TEAM_2_GOAL)), <=, Value In Array(Global.TEAM_2_GOAL, 1))), And(Compare(Team Of(Global.LAST_PUSHED_PLAYER), ==, Team 2), Compare(Distance Between(Position Of(Value In Array(Global.WRECKING_BALLS, 1)), First Of(Global.TEAM_1_GOAL)), <=, Value In Array(Global.TEAM_1_GOAL, 1)))), All Players(All Teams), Null), Custom String("{0} scored!", Global.LAST_PUSHED_PLAYER, Null, Null));
"Kill any hero duplicating"
Kill(Filtered Array(Players On Hero(Hero(Echo), All Teams), Is Duplicating(Current Array Element)), Null);
"Kill any player currently in their ultimate that can't be canceled by respawning."
Kill(Filtered Array(All Living Players(All Teams), And(Is Using Ultimate(Current Array Element), Array Contains(Array(Hero(Mercy), Hero(Zenyatta)), Hero Of(Current Array Element)))), Null);