Create
Return to post

Comparing difference between and

View raw
  • settings
  • {
  • main
  • {
  • 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(SPAWNPOINTS, Value In Array(Array(Array(Vector(0, 0, 0), Vector(0, 0, 12), Vector(0, 0, -12)), Array(Vector(0, 0, 0), Vector(0, 0, 24), Vector(0, 0, -24)), Array(Nearest Walkable Position(Add(Objective Position(1), Vector(0, 0, -15))), Nearest Walkable Position(Add(Objective Position(1), Vector(0, 0, 15)))), Array(Nearest Walkable Position(Objective Position(0))), Array(Vector(0, 0, 0), Vector(0, 0, 12), Vector(0, 0, -12)), Array(Vector(0, 0, 0), Vector(0, 0, 12), Vector(0, 0, -12)), Array(Vector(0, 0, 0), Vector(0, 0, 24), Vector(0, 0, -24)), Array(Vector(0, 0, 0), Vector(0, 0, 24), Vector(0, 0, -24))), 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_SCORE_NEEDED, Workshop Setting Integer(Custom String("Ruleset", Null, Null, Null), Custom String("Score to Win", Null, Null, Null), 6, 2, 10, 0));
  • Set Global Variable(SETTING_END_BEHAVIOR_RAW, Workshop Setting Combo(Custom String("Ruleset", Null, Null, Null), Custom String("When Match is Complete", Null, Null, Null), 0, Array(Custom String("Skip End Game Screen", Null, Null, Null), Custom String("Skip POTG", Null, Null, Null), Custom String("Do Nothing", Null, Null, Null)), 2));
  • Set Global Variable(SETTING_END_BEHAVIOR, Value In Array(Array(25.9, 8, 9999), Global.SETTING_END_BEHAVIOR_RAW));
  • Set Global Variable(SETTING_TIME_RAW, Workshop Setting Combo(Custom String("Ruleset", Null, Null, Null), Custom String("Time Remaining", Null, Null, Null), 0, Array(Custom String("3󠀺00", Null, Null, Null), Custom String("2󠀺30", Null, Null, Null), Custom String("2󠀺00", Null, Null, Null), Custom String("1󠀺30", Null, Null, Null), Custom String("1󠀺00", Null, Null, Null)), 1));
  • 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));
  • Set Global Variable(SETTING_HAMMOND_SIZE, Workshop Setting Real(Custom String("Advanced", Null, Null, Null), Custom String("Wrecking Ball Size Scalar", Null, Null, Null), 1.25, 0.1, 5, 0));
  • Set Global Variable(SETTING_SPEED_SCALAR, Workshop Setting Real(Custom String("Advanced", Null, Null, Null), Custom String("Player Speed Scalar", Null, Null, Null), 2, 1, 2, 1));
  • Set Global Variable(TEAM_1_SCORE, 0);
  • Set Global Variable(TEAM_2_SCORE, 0);
  • Set Global Variable(ROUND_NUMBER, 0);
  • Set Global Variable(TIME_REMAINING, Value In Array(Array(180, 150, 120, 90, 60), Global.SETTING_TIME_RAW));
  • Set Global Variable(CURRENT_GAME_STATE, 0);
  • Set Global Variable(BALL_RESETTING, False);
  • Set Global Variable(HeroRoster, Remove From Array(All Heroes, Array(Hero(Wrecking Ball), Hero(Torbjörn), Hero(Ashe), Hero(Bastion))));
  • }
  • }
  • rule ("Initialize player variables") {
  • event {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • actions {
  • Set Player Variable(Event Player, PLAYER_INDEX, 0);
  • Set Player Variable(Event Player, HUDS, Empty Array);
  • }
  • }
  • rule ("Subroutine CREATE_BALL") {
  • event {
  • Subroutine;
  • CREATE_BALL;
  • }
  • actions {
  • "Create Wrecking Ball Dummies"
  • Set Global Variable(WRECKING_BALLS, Empty Array);
  • Create Dummy Bot(Hero(Wrecking Ball), Team 1, 5, Vector(0, 0, 0), Vector(0, 0, 0));
  • Modify Global Variable(WRECKING_BALLS, Append To Array, Last Created Entity);
  • Create Dummy Bot(Hero(Wrecking Ball), Team 2, 5, Vector(0, 0, 0), Vector(0, 0, 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 Holding Button(Global.WRECKING_BALLS, Button(Interact));
  • Start Damage Modification(Global.WRECKING_BALLS, Players On Hero(Hero(Brigitte), All Teams), 150, Receivers and Damagers);
  • Start Healing Modification(Global.WRECKING_BALLS, Players On Hero(Hero(Mercy), All Teams), 150, Receivers and Healers);
  • Start Healing Modification(Global.WRECKING_BALLS, Players On Hero(Hero(Moira), All Teams), 150, Receivers and Healers);
  • Start Scaling Player(Global.WRECKING_BALLS, Global.SETTING_HAMMOND_SIZE, True);
  • }
  • }
  • rule ("Subroutine RESET_BALL") {
  • event {
  • Subroutine;
  • RESET_BALL;
  • }
  • actions {
  • Set Global Variable(BALL_RESETTING, True);
  • Resurrect(Global.WRECKING_BALLS);
  • 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));
  • Wait(0.032, Ignore Condition);
  • Enable Messages(All Players(All Teams));
  • }
  • }
  • rule ("Subroutine APPLY_IMPULSE") {
  • event {
  • Subroutine;
  • APPLY_IMPULSE;
  • }
  • actions {
  • Apply Impulse(Victim, Direction Towards(Vector(X Component Of(Position Of(Attacker)), Y Component Of(Position Of(Global.WRECKING_BALLS)), Z Component Of(Position Of(Attacker))), Position Of(Victim)), If-Then-Else(Or(Or(Compare(Event Ability, ==, Button(Melee)), And(Compare(Event Ability, ==, Button(Secondary Fire)), Compare(Hero Of(Event Player), ==, Hero(Lúcio)))), And(Compare(Event Ability, ==, Button(Ability 2)), Compare(Hero Of(Event Player), ==, Hero(Widowmaker)))), Multiply(Event Damage, Global.SETTING_LAUNCH_RATE), Multiply(Divide(Event Damage, 8), Global.SETTING_LAUNCH_RATE)), To World, Incorporate Contrary Motion);
  • }
  • }
  • rule ("Subroutine SET_PHYSICS_OWNERSHIP_START") {
  • event {
  • Subroutine;
  • SET_PHYSICS_OWNERSHIP_START;
  • }
  • actions {
  • Disable Movement Collision With Players(Global.WRECKING_BALLS);
  • Detach Players(Global.WRECKING_BALLS);
  • Wait(0.032, Ignore Condition);
  • }
  • }
  • rule ("Force Into Ball Form") {
  • event {
  • Ongoing - Global;
  • }
  • conditions {
  • Is True For Any(Global.WRECKING_BALLS, Not(Is In Alternate Form(Current Array Element))) == True;
  • }
  • actions {
  • Press Button(Filtered Array(Global.WRECKING_BALLS, Not(Is In Alternate Form(Current Array Element))), Button(Ability 1));
  • Wait(0.25, Ignore Condition);
  • Loop If Condition Is True;
  • }
  • }
  • rule ("Force Half Health Ball") {
  • event {
  • Ongoing - Global;
  • }
  • conditions {
  • Is True For Any(Global.WRECKING_BALLS, Compare(Normalized Health(Current Array Element), ==, 1)) == True;
  • }
  • actions {
  • Damage(Filtered Array(Global.WRECKING_BALLS, Compare(Normalized Health(Current Array Element), ==, 1)), Null, 100);
  • Wait(0.016, Ignore Condition);
  • Loop If Condition Is True;
  • }
  • }
  • rule ("Enforce Ball Attachment") {
  • event {
  • Ongoing - Global;
  • }
  • conditions {
  • Distance Between(Position Of(First Of(Global.WRECKING_BALLS)), Position Of(Value In Array(Global.WRECKING_BALLS, 1))) > 1;
  • }
  • actions {
  • "If the Wrecking Ball Dummies are too far apart, re-attach them."
  • If(Compare(Global.TEAM_PHYSICS_OWNERSHIP, ==, Team 1));
  • Set Global Variable(TEAM_PHYSICS_OWNERSHIP, Team 2);
  • Wait(0.125, Ignore Condition);
  • Set Global Variable(TEAM_PHYSICS_OWNERSHIP, Team 1);
  • Else If(Compare(Global.TEAM_PHYSICS_OWNERSHIP, ==, Team 2));
  • Set Global Variable(TEAM_PHYSICS_OWNERSHIP, Team 1);
  • Wait(0.125, Ignore Condition);
  • Set Global Variable(TEAM_PHYSICS_OWNERSHIP, Team 2);
  • End;
  • Wait(0.125, Ignore Condition);
  • Loop If Condition Is True;
  • }
  • }
  • rule ("Set Physics Ownership to Team 1") {
  • event {
  • Ongoing - Global;
  • }
  • conditions {
  • Global.TEAM_PHYSICS_OWNERSHIP == Team 1;
  • }
  • actions {
  • Call Subroutine(SET_PHYSICS_OWNERSHIP_START);
  • Attach Players(First Of(Global.WRECKING_BALLS), Value In Array(Global.WRECKING_BALLS, 1), Vector(0, 0, 0));
  • Set Invisible(First Of(Global.WRECKING_BALLS), All);
  • Set Invisible(Value In Array(Global.WRECKING_BALLS, 1), None);
  • Enable Movement Collision With Players(Global.WRECKING_BALLS);
  • }
  • }
  • rule ("Set Physics Ownership to Team 2") {
  • event {
  • Ongoing - Global;
  • }
  • conditions {
  • Global.TEAM_PHYSICS_OWNERSHIP == Team 2;
  • }
  • actions {
  • Call Subroutine(SET_PHYSICS_OWNERSHIP_START);
  • Attach Players(Value In Array(Global.WRECKING_BALLS, 1), First Of(Global.WRECKING_BALLS), Vector(0, 0, 0));
  • Set Invisible(First Of(Global.WRECKING_BALLS), None);
  • Set Invisible(Value In Array(Global.WRECKING_BALLS, 1), All);
  • Enable Movement Collision With Players(Global.WRECKING_BALLS);
  • }
  • }
  • rule ("Set Physics Ownership (Damage)") {
  • event {
  • Player Dealt Damage;
  • All;
  • All;
  • }
  • conditions {
  • Array Contains(Global.WRECKING_BALLS, Attacker) == False;
  • Array Contains(Global.WRECKING_BALLS, Victim) == True;
  • Global.ATTACHING_ALLOWED == True;
  • Global.TEAM_PHYSICS_OWNERSHIP != Team Of(Event Player);
  • Is True For All(Global.WRECKING_BALLS, Not(Has Status(Current Array Element, Hacked))) == True;
  • }
  • actions {
  • Set Global Variable(ATTACHING_ALLOWED, False);
  • Set Global Variable(TEAM_PHYSICS_OWNERSHIP, Team Of(Event Player));
  • Wait(0.032, Ignore Condition);
  • Call Subroutine(APPLY_IMPULSE);
  • Set Global Variable(ATTACHING_ALLOWED, True);
  • }
  • }
  • rule ("Set Physics Ownership (Knockback)") {
  • event {
  • Player Dealt Knockback;
  • All;
  • All;
  • }
  • conditions {
  • Array Contains(Global.WRECKING_BALLS, Attacker) == False;
  • Array Contains(Global.WRECKING_BALLS, Victim) == True;
  • Global.ATTACHING_ALLOWED == True;
  • Global.TEAM_PHYSICS_OWNERSHIP != Team Of(Event Player);
  • Is True For All(Global.WRECKING_BALLS, Not(Has Status(Current Array Element, Hacked))) == True;
  • }
  • actions {
  • Set Global Variable(ATTACHING_ALLOWED, False);
  • Set Global Variable(TEAM_PHYSICS_OWNERSHIP, Team Of(Event Player));
  • Wait(0.032, Ignore Condition);
  • Apply Impulse(Victim, Event Direction, Multiply(Global.SETTING_LAUNCH_RATE, 25), To World, Incorporate Contrary Motion);
  • Set Global Variable(ATTACHING_ALLOWED, True);
  • }
  • }
  • rule ("Set Last Pushed Player (Damage)") {
  • event {
  • Player Dealt Damage;
  • All;
  • All;
  • }
  • conditions {
  • Array Contains(Global.WRECKING_BALLS, Attacker) == False;
  • Array Contains(Global.WRECKING_BALLS, Victim) == True;
  • }
  • actions {
  • Set Global Variable(LAST_PUSHED_PLAYER, Event Player);
  • }
  • }
  • rule ("Set Last Pushed Player (Knockback)") {
  • event {
  • Player Dealt Knockback;
  • All;
  • All;
  • }
  • conditions {
  • Array Contains(Global.WRECKING_BALLS, Attacker) == False;
  • Array Contains(Global.WRECKING_BALLS, Victim) == True;
  • }
  • actions {
  • Set Global Variable(LAST_PUSHED_PLAYER, Event Player);
  • }
  • }
  • rule ("Set Last Pushed Player (Healing)") {
  • event {
  • Player Dealt Healing;
  • All;
  • All;
  • }
  • conditions {
  • Array Contains(Global.WRECKING_BALLS, Healer) == False;
  • Array Contains(Global.WRECKING_BALLS, Healee) == True;
  • }
  • actions {
  • Abort If(Compare(Hero Of(Healer), ==, Hero(Lúcio)));
  • Set Global Variable(LAST_PUSHED_PLAYER, Event Player);
  • Wait(1, Ignore Condition);
  • }
  • }
  • rule ("Apply Impulse") {
  • event {
  • Player Dealt Damage;
  • All;
  • All;
  • }
  • conditions {
  • Array Contains(Global.WRECKING_BALLS, Attacker) == False;
  • Array Contains(Global.WRECKING_BALLS, Victim) == True;
  • }
  • actions {
  • Call Subroutine(APPLY_IMPULSE);
  • If(Compare(Event Ability, ==, Button(Melee)));
  • Set Ultimate Charge(Event Player, Add(Ultimate Charge Percent(Event Player), 5));
  • }
  • }
  • rule ("Apply Healing Impulse") {
  • event {
  • Player Dealt Healing;
  • All;
  • All;
  • }
  • conditions {
  • Array Contains(Global.WRECKING_BALLS, Healer) == False;
  • Array Contains(Global.WRECKING_BALLS, Healee) == True;
  • }
  • actions {
  • Apply Impulse(Global.WRECKING_BALLS, Direction Towards(Vector(X Component Of(Position Of(Healer)), Y Component Of(Position Of(Global.WRECKING_BALLS)), Z Component Of(Position Of(Healer))), Position Of(Global.WRECKING_BALLS)), Multiply(Divide(Event Healing, 5), Global.SETTING_LAUNCH_RATE), To World, Incorporate Contrary Motion);
  • }
  • }
  • rule ("Set Ball Outlines") {
  • event {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions {
  • Entity Exists(Global.WRECKING_BALLS) == True;
  • }
  • actions {
  • Wait(0.032, Ignore Condition);
  • Disable Nameplates(Global.WRECKING_BALLS, Event Player);
  • Start Forcing Player Outlines(Global.WRECKING_BALLS, Event Player, True, Color(White), Always);
  • }
  • }
  • rule ("Set Team Ownership When Reinhardt Pins Ball") {
  • event {
  • Ongoing - Each Player;
  • All;
  • Reinhardt;
  • }
  • conditions {
  • Is Using Ability 1(Event Player) == True;
  • Global.ATTACHING_ALLOWED != False;
  • Ray Cast Hit Player(Divide(Add(Eye Position(Event Player), Position Of(Event Player)), 2), Add(Divide(Add(Eye Position(Event Player), Position Of(Event Player)), 2), World Vector Of(Vector(0, 0, 5), Event Player, Rotation And Translation)), Global.WRECKING_BALLS, Event Player, False) != Null;
  • }
  • actions {
  • Set Global Variable(ATTACHING_ALLOWED, False);
  • Set Global Variable(TEAM_PHYSICS_OWNERSHIP, Team Of(Event Player));
  • Set Global Variable(LAST_PUSHED_PLAYER, Event Player);
  • Set Status(Global.WRECKING_BALLS, Null, Invincible, 3);
  • Wait Until(Not(Is Using Ability 1(Event Player)), 3);
  • Clear Status(Global.WRECKING_BALLS, Invincible);
  • Set Global Variable(ATTACHING_ALLOWED, True);
  • }
  • }
  • rule ("Zarya Bubble Disappearing Fix") {
  • event {
  • Ongoing - Global;
  • }
  • conditions {
  • Is True For Any(Global.WRECKING_BALLS, Has Status(Current Array Element, Invincible)) == True;
  • }
  • actions {
  • Set Damage Received(Global.WRECKING_BALLS, 0);
  • Wait Until(Is True For All(Global.WRECKING_BALLS, Not(Has Status(Current Array Element, Invincible))), 9999);
  • Set Damage Received(Global.WRECKING_BALLS, 100);
  • }
  • }
  • rule ("Set Team Ownership When Sombra Hacks Ball") {
  • event {
  • Ongoing - Global;
  • }
  • conditions {
  • Is True For Any(Global.WRECKING_BALLS, Has Status(Current Array Element, Hacked)) == True;
  • }
  • actions {
  • If(Or(And(Has Status(First Of(Global.WRECKING_BALLS), Hacked), Compare(Global.TEAM_PHYSICS_OWNERSHIP, ==, Team 1)), And(Has Status(Value In Array(Global.WRECKING_BALLS, 1), Hacked), Compare(Global.TEAM_PHYSICS_OWNERSHIP, ==, Team 2))));
  • Set Global Variable(TEAM_PHYSICS_OWNERSHIP, Opposite Team Of(Global.TEAM_PHYSICS_OWNERSHIP));
  • }
  • }
  • rule ("Lower Ball Health for Echo Beam") {
  • event {
  • Player Dealt Damage;
  • All;
  • Echo;
  • }
  • conditions {
  • Is Duplicating(Event Player) == False;
  • Is Using Ability 2(Event Player) == True;
  • Array Contains(Global.WRECKING_BALLS, Attacker) == False;
  • Array Contains(Global.WRECKING_BALLS, Victim) == True;
  • Global.ATTACHING_ALLOWED != False;
  • }
  • actions {
  • 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);
  • Create HUD Text(Event Player, Null, Custom String("Current Version: {0}", Global.CURRENT_VERSION, Null, Null), Null, Right, 2, Null, Color(Orange), 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, Custom String("https://workshop.codes/ball-soccer", Null, Null, Null), Null, Right, 2, Null, Color(Orange), Null, Visible To and String, Default Visibility);
  • Modify Player Variable(Event Player, HUDS, Append To Array, Last Text ID);
  • }
  • }
  • rule ("Destroy Player Hud") {
  • event {
  • Player Left Match;
  • All;
  • All;
  • }
  • actions {
  • Call Subroutine(DESTROY_HUDS);
  • }
  • }
  • rule ("Player Setup") {
  • event {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions {
  • Has Spawned(Event Player) == True;
  • Array Contains(Global.WRECKING_BALLS, Event Player) == False;
  • }
  • actions {
  • Set Primary Fire Enabled(Event Player, False);
  • Set Status(Event Player, Null, Invincible, 9999);
  • Disable Scoreboard(Event Player);
  • Disable Kill Feed(Event Player);
  • Set Damage Received(Event Player, 500);
  • Disable Game Mode HUD(Event Player);
  • Set Move Speed(Event Player, Multiply(Global.SETTING_SPEED_SCALAR, 100));
  • Set Jump Vertical Speed(Event Player, Add(100, Divide(Multiply(Global.SETTING_SPEED_SCALAR, 100), 4)));
  • }
  • }
  • rule ("Player Hero Roster") {
  • event {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions {
  • Array Contains(Global.WRECKING_BALLS, Event Player) == False;
  • }
  • actions {
  • Set Player Allowed Heroes(Event Player, Global.HeroRoster);
  • }
  • }
  • rule ("Teleport to Goal") {
  • event {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions {
  • Has Spawned(Event Player) == True;
  • Is In Spawn Room(Event Player) == True;
  • Array Contains(Global.WRECKING_BALLS, Event Player) == False;
  • }
  • actions {
  • 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)));
  • Array Contains(Global.WRECKING_BALLS, Event Player) == False;
  • Is Button Held(Event Player, Button(Interact)) == True;
  • }
  • actions {
  • Set Player Allowed Heroes(Event Player, Remove From Array(Allowed Heroes(Event Player), Hero Of(Event Player)));
  • Wait(0.25, Ignore Condition);
  • Set Player Allowed Heroes(Event Player, Global.HeroRoster);
  • }
  • }
  • rule ("Allow Primary: Reinhardt") {
  • event {
  • Ongoing - Each Player;
  • All;
  • Reinhardt;
  • }
  • actions {
  • Set Primary Fire Enabled(Event Player, True);
  • }
  • }
  • rule ("Allow Primary: Brigitte") {
  • event {
  • Ongoing - Each Player;
  • All;
  • Brigitte;
  • }
  • actions {
  • Set Primary Fire Enabled(Event Player, True);
  • }
  • }
  • rule ("Allow Primary: Moira") {
  • event {
  • Ongoing - Each Player;
  • All;
  • Moira;
  • }
  • actions {
  • Set Primary Fire Enabled(Event Player, True);
  • }
  • }
  • rule ("Allow Primary: Mercy") {
  • event {
  • Ongoing - Each Player;
  • All;
  • Mercy;
  • }
  • conditions {
  • Is In Alternate Form(Event Player) == False;
  • }
  • actions {
  • Set Primary Fire Enabled(Event Player, True);
  • Wait Until(Is In Alternate Form(Event Player), 9999);
  • Set Primary Fire Enabled(Event Player, False);
  • }
  • }
  • rule ("Allow Sentry: Bastion") {
  • event {
  • Ongoing - Each Player;
  • All;
  • Bastion;
  • }
  • conditions {
  • Is In Alternate Form(Event Player) == True;
  • }
  • actions {
  • Set Primary Fire Enabled(Event Player, True);
  • Wait Until(Not(Is In Alternate Form(Event Player)), 9999);
  • Set Primary Fire Enabled(Event Player, False);
  • }
  • }
  • rule ("Bind Melee: Primary") {
  • event {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions {
  • Is Button Held(Event Player, Button(Primary Fire)) == True;
  • }
  • actions {
  • Abort If(Or(Is Firing Primary(Event Player), And(Compare(Hero Of(Event Player), ==, Hero(Hanzo)), Is Using Ability 2(Event Player))));
  • Press Button(Event Player, Button(Melee));
  • }
  • }
  • rule ("Allow Ultimate Confirmation") {
  • event {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions {
  • Is Button Held(Event Player, Button(Ultimate)) == True;
  • Is True For Any(Array(Hero(Echo), Hero(Ana)), Compare(Hero Of(Event Player), ==, Current Array Element)) == True;
  • }
  • actions {
  • If(Compare(Ultimate Charge Percent(Event Player), ==, 100));
  • Set Primary Fire Enabled(Event Player, True);
  • Wait Until(Is True For Any(Array(Is Button Held(Event Player, Button(Primary Fire)), Is Button Held(Event Player, Button(Secondary Fire)), Compare(Ultimate Charge Percent(Event Player), ==, 0)), Compare(Current Array Element, ==, True)), 3);
  • Set Primary Fire Enabled(Event Player, False);
  • }
  • }
  • 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;
  • }
  • actions {
  • Set Ammo(Event Player, 0, 0);
  • Set Max Ammo(Event Player, 0, 0);
  • }
  • }
  • rule ("Switch out of Ball Form") {
  • event {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions {
  • Or(Compare(Hero Of(Event Player), ==, Hero(Wrecking Ball)), Compare(Hero Being Duplicated(Event Player), ==, Hero(Wrecking Ball))) == True;
  • Is Button Held(Event Player, Button(Primary Fire)) == True;
  • Is In Alternate Form(Event Player) == True;
  • }
  • actions {
  • Cancel Primary Action(Event Player);
  • }
  • }
  • rule ("Reduce Ability 1 Cooldown") {
  • event {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions {
  • Is Using Ability 1(Event Player) == False;
  • Ability Cooldown(Event Player, Button(Ability 1)) > 0;
  • }
  • actions {
  • Abort If(Or(Compare(Hero Of(Event Player), ==, Hero(Roadhog)), Compare(Hero Being Duplicated(Event Player), ==, Hero(Roadhog))));
  • Set Ability Cooldown(Event Player, Button(Ability 1), Divide(Ability Cooldown(Event Player, Button(Ability 1)), 2));
  • }
  • }
  • rule ("Reduce Ability 2 Cooldown") {
  • event {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions {
  • Is Using Ability 2(Event Player) == False;
  • Ability Cooldown(Event Player, Button(Ability 2)) > 0;
  • }
  • actions {
  • Abort If(Or(Or(Compare(Hero Of(Event Player), ==, Hero(Sombra)), Compare(Hero Being Duplicated(Event Player), ==, Hero(Sombra))), Or(Compare(Hero Of(Event Player), ==, Hero(Mei)), Compare(Hero Being Duplicated(Event Player), ==, Hero(Mei)))));
  • Set Ability Cooldown(Event Player, Button(Ability 2), Divide(Ability Cooldown(Event Player, Button(Ability 2)), 2));
  • }
  • }
  • rule ("Reduce Secondary Cooldown") {
  • event {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions {
  • Is Firing Secondary(Event Player) == False;
  • Ability Cooldown(Event Player, Button(Secondary Fire)) > 0;
  • }
  • actions {
  • Abort If(Or(Compare(Hero Of(Event Player), ==, Hero(Sombra)), Compare(Hero Being Duplicated(Event Player), ==, Hero(Sombra))));
  • Set Ability Cooldown(Event Player, Button(Secondary Fire), Divide(Ability Cooldown(Event Player, Button(Secondary Fire)), 2));
  • }
  • }
  • rule ("Destroy Symmetra Teleporter") {
  • event {
  • Ongoing - Each Player;
  • All;
  • Symmetra;
  • }
  • conditions {
  • Is Using Ability 2(Event Player) == True;
  • Or(Compare(Global.CURRENT_GAME_STATE, ==, 1), Compare(Global.CURRENT_GAME_STATE, ==, 3)) == True;
  • }
  • actions {
  • Call Subroutine(DESTROY_CONSTRUCTION);
  • }
  • }
  • rule ("Destroy Torb Turret") {
  • event {
  • Ongoing - Each Player;
  • All;
  • Torbjörn;
  • }
  • conditions {
  • Is Using Ability 1(Event Player) == True;
  • Or(Compare(Global.CURRENT_GAME_STATE, ==, 1), Compare(Global.CURRENT_GAME_STATE, ==, 3)) == True;
  • }
  • actions {
  • Call Subroutine(DESTROY_CONSTRUCTION);
  • }
  • }
  • rule ("Destroy Sombra Translocator") {
  • event {
  • Ongoing - Each Player;
  • All;
  • Sombra;
  • }
  • conditions {
  • Is Using Ability 2(Event Player) == True;
  • Or(Compare(Global.CURRENT_GAME_STATE, ==, 1), Compare(Global.CURRENT_GAME_STATE, ==, 3)) == True;
  • }
  • actions {
  • Call Subroutine(DESTROY_CONSTRUCTION);
  • }
  • }
  • rule ("Subroutine CREATE_GOAL_EFFECTS") {
  • event {
  • Subroutine;
  • CREATE_GOAL_EFFECTS;
  • }
  • actions {
  • "Team 1
  • \n Bottom"
  • 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);
  • Resurrect(Filtered Array(All Dead Players(All Teams), Array Contains(Array(Hero(Mercy), Hero(Zenyatta)), Hero Of(Current Array Element))));
  • Call Subroutine(DISABLE_ABILITIES);
  • Set Global Variable(CURRENT_GAME_STATE, 3);
  • }
  • }
  • rule ("Results") {
  • event {
  • Ongoing - Global;
  • }
  • conditions {
  • Global.CURRENT_GAME_STATE == 3;
  • }
  • actions {
  • Skip If(Compare(Global.SETTING_WHILE_YOU_WAIT, ==, True), 17);
  • If(True);
  • Skip(Value In Array(Array(14, 0, 7), Add(1, Index Of Array Value(Array(Team 1, Team 2), Global.ROUND_RESULT))));
  • //__label_switch_3_0__:
  • Modify Global Variable(TEAM_1_SCORE, Add, 1);
  • If(Compare(Global.TEAM_1_SCORE, >=, Global.SETTING_SCORE_NEEDED));
  • Declare Team Victory(Team 1);
  • Set Global Variable(CURRENT_GAME_STATE, 4);
  • Abort;
  • End;
  • Else;
  • //__label_switch_3_1__:
  • Modify Global Variable(TEAM_2_SCORE, Add, 1);
  • If(Compare(Global.TEAM_2_SCORE, >=, Global.SETTING_SCORE_NEEDED));
  • Declare Team Victory(Team 2);
  • Set Global Variable(CURRENT_GAME_STATE, 4);
  • Abort;
  • End;
  • Else;
  • //__label_switch_3_default__:
  • End;
  • //skip_scoring:
  • Wait(1, Ignore Condition);
  • Set Slow Motion(100);
  • Set Global Variable(LAST_PUSHED_PLAYER, Null);
  • Set Global Variable(CURRENT_GAME_STATE, 1);
  • }
  • }
  • rule ("Time Ran Out") {
  • event {
  • Ongoing - Global;
  • }
  • conditions {
  • Global.CURRENT_GAME_STATE == 2;
  • Global.TIME_REMAINING == 0;
  • }
  • actions {
  • If(Compare(Global.SETTING_WHILE_YOU_WAIT, ==, True));
  • Set Match Time(0);
  • End;
  • If(Compare(Global.TEAM_1_SCORE, >, Global.TEAM_2_SCORE));
  • Declare Team Victory(Team 1);
  • Set Global Variable(CURRENT_GAME_STATE, 4);
  • Else If(Compare(Global.TEAM_2_SCORE, >, Global.TEAM_1_SCORE));
  • Declare Team Victory(Team 2);
  • Set Global Variable(CURRENT_GAME_STATE, 4);
  • Else;
  • Declare Match Draw;
  • }
  • }
  • rule ("End Game") {
  • event {
  • Ongoing - Global;
  • }
  • conditions {
  • Global.CURRENT_GAME_STATE == 4;
  • }
  • actions {
  • Call Subroutine(REMOVE_BALL);
  • Wait(Global.SETTING_END_BEHAVIOR, Ignore Condition);
  • Set Match Time(0);
  • }
  • }
Join the Workshop.codes Discord