Create
Return to post

Comparing difference between and

View raw
  • variables
  • {
  • global:
  • 0: BallPos
  • 1: BallEntityID
  • 2: BallOwner
  • 3: BallIsHeld
  • 4: BallVelocity
  • 5: BallRespawnTime
  • 6: BallHasKillVelocity
  • 7: BallSpawnLocation
  • 8: ArenaRadius
  • 9: ArenaCenter
  • 10: CustomSpawnPoints
  • 11: JumpPadLocations
  • 12: JumpPadLaunchForces
  • 23: Debug
  • 24: TempVar
  • 25: TickTimer
  • player:
  • 0: CanSoak
  • 1: SoakEffectID
  • 2: CanDeflect
  • 3: OutOfBoundsKillTimer
  • 4: LastTimeHeldBall
  • 24: TempVar2
  • 25: TempVar
  • }
  • subroutines
  • {
  • 0: SpawnBall
  • 1: SpawnPlayer
  • 2: PlayerPickupBall
  • 3: DropBall
  • 4: KillPlayer
  • 5: PlayerBallCollision
  • 6: ActivateBallPhysics
  • }
  • rule("Reduce Hero Pick Time")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • Is Assembling Heroes == True;
  • }
  • actions
  • {
  • Set Match Time(10);
  • }
  • }
  • rule("Setup: Pre Maps")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • actions
  • {
  • Global.CustomSpawnPoints = Empty Array;
  • Global.JumpPadLocations = Empty Array;
  • Global.JumpPadLaunchForces = Empty Array;
  • }
  • }
  • rule("Setup: Castillo")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • Current Map == Map(Castillo);
  • }
  • actions
  • {
  • Global.BallSpawnLocation = Vector(-102.500, 41.500, 58.500);
  • Global.ArenaCenter = Global.BallSpawnLocation;
  • Global.ArenaRadius = 42;
  • }
  • }
  • rule("Setup: Workshop Chamber")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • Current Map == Map(Workshop Chamber);
  • }
  • actions
  • {
  • Global.BallSpawnLocation = Vector(0, 20, 0);
  • Global.ArenaCenter = Vector(0, 10, 0);
  • Global.ArenaRadius = 100;
  • Global.JumpPadLocations = Append To Array(Global.JumpPadLocations, Vector(-16, 0, -16));
  • Global.JumpPadLaunchForces = Append To Array(Global.JumpPadLaunchForces, Vector Towards(Vector(-16, 0, -16),
  • Global.ArenaCenter + Up * 10));
  • Global.JumpPadLocations = Append To Array(Global.JumpPadLocations, Vector(16, 0, -16));
  • Global.JumpPadLaunchForces = Append To Array(Global.JumpPadLaunchForces, Vector Towards(Vector(16, 0, -16),
  • Global.ArenaCenter + Up * 10));
  • Global.JumpPadLocations = Append To Array(Global.JumpPadLocations, Vector(16, 0, 16));
  • Global.JumpPadLaunchForces = Append To Array(Global.JumpPadLaunchForces, Vector Towards(Vector(16, 0, 16),
  • Global.ArenaCenter + Up * 10));
  • Global.JumpPadLocations = Append To Array(Global.JumpPadLocations, Vector(-16, 0, 16));
  • Global.JumpPadLaunchForces = Append To Array(Global.JumpPadLaunchForces, Vector Towards(Vector(-16, 0, 16),
  • Global.ArenaCenter + Up * 10));
  • }
  • }
  • rule("Setup: Hanamura")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • Current Map == Map(Hanamura);
  • }
  • actions
  • {
  • Global.BallSpawnLocation = Vector(-11, 8, -85);
  • Global.ArenaCenter = Vector(-8.500, 8, -82.300);
  • Global.ArenaRadius = 26;
  • Global.CustomSpawnPoints = Append To Array(Global.CustomSpawnPoints, Vector(0, 0, -73.700));
  • Global.CustomSpawnPoints = Append To Array(Global.CustomSpawnPoints, Vector(-2.150, 4, -62.800));
  • Global.CustomSpawnPoints = Append To Array(Global.CustomSpawnPoints, Vector(11, 4, -76.500));
  • Global.CustomSpawnPoints = Append To Array(Global.CustomSpawnPoints, Vector(11.300, 7, -85.500));
  • Global.CustomSpawnPoints = Append To Array(Global.CustomSpawnPoints, Vector(4, 7, -93));
  • Global.CustomSpawnPoints = Append To Array(Global.CustomSpawnPoints, Vector(-9.500, 9, -64));
  • Global.CustomSpawnPoints = Append To Array(Global.CustomSpawnPoints, Vector(-17, 9, -71));
  • Global.CustomSpawnPoints = Append To Array(Global.CustomSpawnPoints, Vector(5, 5, -69));
  • Global.CustomSpawnPoints = Append To Array(Global.CustomSpawnPoints, Vector(-18, -1, -73.700));
  • Global.CustomSpawnPoints = Append To Array(Global.CustomSpawnPoints, Vector(-2, -1, -90));
  • Global.CustomSpawnPoints = Append To Array(Global.CustomSpawnPoints, Vector(-10, 1, -97.700));
  • Global.CustomSpawnPoints = Append To Array(Global.CustomSpawnPoints, Vector(-25, 1, -83.700));
  • }
  • }
  • rule("Setup: Paris")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • Current Map == Map(Paris);
  • }
  • actions
  • {
  • Global.BallSpawnLocation = Vector(-95.400, 22, -82);
  • Global.ArenaCenter = Global.BallSpawnLocation;
  • Global.ArenaRadius = 29;
  • Global.CustomSpawnPoints = Append To Array(Global.CustomSpawnPoints, Vector(-109, 12, -90));
  • Global.CustomSpawnPoints = Append To Array(Global.CustomSpawnPoints, Vector(-92.500, 12, -97.500));
  • Global.CustomSpawnPoints = Append To Array(Global.CustomSpawnPoints, Vector(-81, 12, -75.500));
  • Global.CustomSpawnPoints = Append To Array(Global.CustomSpawnPoints, Vector(-99, 12, -68));
  • Global.CustomSpawnPoints = Append To Array(Global.CustomSpawnPoints, Vector(-101, 15, -94));
  • Global.CustomSpawnPoints = Append To Array(Global.CustomSpawnPoints, Vector(-88.500, 12, -69.500));
  • Global.CustomSpawnPoints = Append To Array(Global.CustomSpawnPoints, Vector(-112.500, 13, -81.500));
  • Global.CustomSpawnPoints = Append To Array(Global.CustomSpawnPoints, Vector(-84, 13, -95));
  • Global.CustomSpawnPoints = Append To Array(Global.CustomSpawnPoints, Vector(-104.500, 12, -77.300));
  • Global.CustomSpawnPoints = Append To Array(Global.CustomSpawnPoints, Vector(-85, 12, -87));
  • }
  • }
  • rule("Setup: Global")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • actions
  • {
  • "Debug Mode"
  • Global.Debug = False;
  • If(Global.Debug);
  • "Display all spawn points"
  • For Global Variable(TempVar, 0, Count Of(Global.CustomSpawnPoints), 1);
  • Create Effect(All Players(All Teams), Sphere, Color(Purple), Evaluate Once(Global.CustomSpawnPoints[Global.TempVar] + Up * 0.500),
  • 0.500, Visible To Position and Radius);
  • End;
  • Create HUD Text(All Players(All Teams), Null, Custom String("Server Load [Cur: {0}%, Avg: {1}%, Peak: {2}%]", Server Load,
  • Server Load Average, Server Load Peak), Null, Right, 0, Color(White), Color(White), Color(White), Visible To and String,
  • Default Visibility);
  • Else;
  • Disable Inspector Recording;
  • End;
  • Create In-World Text(Filtered Array(All Players(All Teams), Global.BallRespawnTime > 0), Round To Integer(Global.BallRespawnTime,
  • Up), Global.BallSpawnLocation, 3, Clip Against Surfaces, Visible To Position and String, Color(White), Default Visibility);
  • Create Effect(All Players(All Teams), Sphere, Color(Aqua), Global.ArenaCenter, Global.ArenaRadius, Visible To Position and Radius);
  • If(Current Game Mode == Game Mode(Elimination));
  • Create HUD Text(All Players(All Teams), Null, Null, Custom String(" \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"),
  • Top, 1, Color(White), Color(White), Color(White), Visible To and String, Default Visibility);
  • Else If(Current Game Mode == Game Mode(Team Deathmatch));
  • Create HUD Text(All Players(All Teams), Null, Null, Custom String(" \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"), Top, 1, Color(
  • White), Color(White), Color(White), Visible To and String, Default Visibility);
  • End;
  • Create Progress Bar HUD Text(Filtered Array(All Players(All Teams),
  • Global.BallIsHeld && Global.BallOwner == Current Array Element), Global.BallRespawnTime / 5 * 100, Custom String(
  • "Ball Respawn"), Top, 2, Color(Blue), Color(White), Visible To Values and Color, Default Visibility);
  • Call Subroutine(SpawnBall);
  • Chase Global Variable At Rate(TickTimer, 1, 1, Destination and Rate);
  • "Display all Jump Pads"
  • For Global Variable(TempVar, 0, Count Of(Global.JumpPadLocations), 1);
  • Create Effect(All Players(All Teams), Sphere, Color(Rose), Evaluate Once(Global.JumpPadLocations[Global.TempVar]), 3,
  • Visible To Position and Radius);
  • End;
  • }
  • }
  • rule("Setup: Controls")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • actions
  • {
  • "Hold [Interact] to see controls."
  • Create HUD Text(Filtered Array(All Players(All Teams), !Is Button Held(Current Array Element, Button(Interact))), Null, Null,
  • Custom String("Hold [{0}] to see controls.", Input Binding String(Button(Interact))), Left, 0, Color(White), Color(White),
  • Color(Green), Visible To and String, Visible Never);
  • "Use [Primary Fire] to throw the ball when holding it."
  • Create HUD Text(Filtered Array(All Players(All Teams), Is Button Held(Current Array Element, Button(Interact))), Null, Null,
  • Custom String("Use [{0}] to throw the ball when holding it.", Input Binding String(Button(Primary Fire))), Left, 0, Color(
  • White), Color(White), Color(Yellow), Visible To and String, Visible Never);
  • "Deal ANY damage to a player to steal the ball from them"
  • Create HUD Text(Filtered Array(All Players(All Teams), Is Button Held(Current Array Element, Button(Interact))), Null, Null,
  • Custom String("Deal ANY damage to a player to steal the ball from them"), Left, 1, Color(White), Color(White), Color(Yellow),
  • Visible To and String, Visible Never);
  • "============== Hero Abilities =============="
  • Create HUD Text(Filtered Array(All Players(All Teams), Is Button Held(Current Array Element, Button(Interact))), Null, Null,
  • Custom String("============== Hero Abilities =============="), Left, 2, Color(White), Color(White), Color(Red),
  • Visible To and String, Visible Never);
  • "Use your [Uppercut] and [Seismic Slam] to pick up a ball that normally would kill you."
  • Create HUD Text(Filtered Array(All Players(All Teams), Is Button Held(Current Array Element, Button(Interact)) && Has Spawned(
  • Current Array Element) && Hero Of(Current Array Element) == Hero(Doomfist)), Null, Null, Custom String(
  • "Use your [Uppercut] and [Seismic Slam] to pick up a ball that normally would kill you."), Left, 3, Color(White), Color(White),
  • Color(Green), Visible To and String, Visible Never);
  • "Use your [Deflect] to deflect the ball with a high speed."
  • Create HUD Text(Filtered Array(All Players(All Teams), Is Button Held(Current Array Element, Button(Interact)) && Has Spawned(
  • Current Array Element) && Hero Of(Current Array Element) == Hero(Genji)), Null, Null, Custom String(
  • "Use your [Deflect] to deflect the ball with a high speed."), Left, 3, Color(White), Color(White), Color(Green),
  • Visible To and String, Visible Never);
  • "Your [Dash] can be used to steal the ball from another player."
  • Create HUD Text(Filtered Array(All Players(All Teams), Is Button Held(Current Array Element, Button(Interact)) && Has Spawned(
  • Current Array Element) && Hero Of(Current Array Element) == Hero(Genji)), Null, Null, Custom String(
  • "Your [Dash] can be used to steal the ball from another player."), Left, 4, Color(White), Color(White), Color(Green),
  • Visible To and String, Visible Never);
  • "Use your [Breather] to pick up a ball that normally would kill you."
  • Create HUD Text(Filtered Array(All Players(All Teams), Is Button Held(Current Array Element, Button(Interact)) && Has Spawned(
  • Current Array Element) && Hero Of(Current Array Element) == Hero(Roadhog)), Null, Null, Custom String(
  • "Use your [Breather] to pick up a ball that normally would kill you."), Left, 3, Color(White), Color(White), Color(Green),
  • Visible To and String, Visible Never);
  • "Your [Hook] can be used to hook the ball towards you."
  • Create HUD Text(Filtered Array(All Players(All Teams), Is Button Held(Current Array Element, Button(Interact)) && Has Spawned(
  • Current Array Element) && Hero Of(Current Array Element) == Hero(Roadhog)), Null, Null, Custom String(
  • "Your [Hook] can be used to hook the ball towards you."), Left, 4, Color(White), Color(White), Color(Green),
  • Visible To and String, Visible Never);
  • "Your [Hook] can be used to steal the ball from another player."
  • Create HUD Text(Filtered Array(All Players(All Teams), Is Button Held(Current Array Element, Button(Interact)) && Has Spawned(
  • Current Array Element) && Hero Of(Current Array Element) == Hero(Roadhog)), Null, Null, Custom String(
  • "Your [Hook] can be used to steal the ball from another player."), Left, 5, Color(White), Color(White), Color(Green),
  • Visible To and String, Visible Never);
  • "You can use [Recall] to pick up the ball if you lost it within 3 seconds."
  • Create HUD Text(Filtered Array(All Players(All Teams), Is Button Held(Current Array Element, Button(Interact)) && Has Spawned(
  • Current Array Element) && Hero Of(Current Array Element) == Hero(Tracer)), Null, Null, Custom String(
  • "You can use [Recall] to pick up the ball if you lost it within 3 seconds."), Left, 3, Color(White), Color(White), Color(
  • Green), Visible To and String, Visible Never);
  • }
  • }
  • rule("Setup: Player")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • actions
  • {
  • Event Player.CanSoak = False;
  • Event Player.CanDeflect = False;
  • If(Global.Debug);
  • Create HUD Text(Event Player, Null, Position Of(Event Player), Null, Right, 0, Color(White), Color(White), Color(White),
  • Visible To and String, Default Visibility);
  • Else;
  • Create HUD Text(Event Player, Null, Custom String("- Created by Lym -\nworkshop.codes/ultimatedodgeball"), Null, Right, 0, Color(
  • White), Color(Orange), Color(White), Visible To and String, Default Visibility);
  • End;
  • Create HUD Text(Filtered Array(All Players(All Teams), Current Array Element == Event Player && Distance Between(
  • Global.ArenaCenter, Position Of(Event Player)) > Global.ArenaRadius), Null, Custom String("{1} RETURN TO ARENA: {0} {1}",
  • Event Player.OutOfBoundsKillTimer, Icon String(Skull)), Null, Top, 3, Color(White), Color(Red), Color(White),
  • Visible To and String, Default Visibility);
  • }
  • }
  • rule("Player Spawn")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • (Has Spawned(Event Player) && Is Alive(Event Player)) == True;
  • }
  • actions
  • {
  • Call Subroutine(SpawnPlayer);
  • Stop Chasing Player Variable(Event Player, OutOfBoundsKillTimer);
  • Event Player.OutOfBoundsKillTimer = 5;
  • }
  • }
  • rule("Debug: Spawn Bot")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • (Global.Debug && Is Communicating(Event Player, Hello)) == True;
  • }
  • actions
  • {
  • disabled Destroy All Dummy Bots;
  • Create Dummy Bot(Hero(Doomfist), Opposite Team Of(Team Of(Event Player)), -1, Ray Cast Hit Position(Eye Position(Event Player),
  • Eye Position(Event Player) + Facing Direction Of(Event Player) * 1000, Null, Null, False), Facing Direction Of(Event Player)
  • * -1);
  • }
  • }
  • rule("Debug: Dummy Bot Primary Fire")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • (Global.Debug && Is Communicating(Event Player, Voice Line Up)) == True;
  • }
  • actions
  • {
  • Press Button(Filtered Array(All Players(All Teams), Is Dummy Bot(Current Array Element)), Button(Primary Fire));
  • }
  • }
  • rule("Debug: Dummy Bot Ability 1")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • (Global.Debug && Is Communicating(Event Player, Voice Line Left)) == True;
  • }
  • actions
  • {
  • Press Button(Filtered Array(All Players(All Teams), Is Dummy Bot(Current Array Element)), Button(Ability 1));
  • }
  • }
  • rule("Debug: Dummy Bot Ability 2")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • (Global.Debug && Is Communicating(Event Player, Voice Line Right)) == True;
  • }
  • actions
  • {
  • Press Button(Filtered Array(All Players(All Teams), Is Dummy Bot(Current Array Element)), Button(Ability 2));
  • }
  • }
  • rule("Player Ball Collision")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • (Distance Between(Position Of(Event Player), Global.BallPos) <= 3 && !Global.BallIsHeld && Has Spawned(Event Player) && Is Alive(
  • Event Player) && (!Global.BallHasKillVelocity || Dot Product(Normalize(Global.BallVelocity), Normalize(Vector Towards(
  • Global.BallPos, Eye Position(Event Player)))) >= 0)) == True;
  • }
  • actions
  • {
  • Call Subroutine(PlayerBallCollision);
  • }
  • }
  • rule("Sub: Spawn Ball")
  • {
  • event
  • {
  • Subroutine;
  • SpawnBall;
  • }
  • actions
  • {
  • Call Subroutine(DropBall);
  • Global.BallRespawnTime = 0;
  • Global.BallPos = Global.BallSpawnLocation;
  • Global.BallVelocity = Vector(0, 0, 0);
  • Global.BallOwner = Null;
  • Global.BallIsHeld = False;
  • Global.BallHasKillVelocity = False;
  • Stop Chasing Global Variable(BallPos);
  • Stop Chasing Global Variable(BallVelocity);
  • If(!Entity Exists(Global.BallEntityID));
  • "Red Ball"
  • Create Effect(Filtered Array(All Players(All Teams), !Entity Exists(Global.BallOwner) || Team Of(Global.BallOwner) != Team Of(
  • Current Array Element)), Orb, Color(Red), Update Every Frame(Global.BallPos), 0.500, Visible To Position Radius and Color);
  • "Neutral Ball"
  • Create Effect(Filtered Array(All Players(All Teams), !Entity Exists(Global.BallOwner)), Orb, Color(Gray), Update Every Frame(
  • Global.BallPos), 0.500, Visible To Position Radius and Color);
  • Global.BallEntityID = Last Created Entity;
  • "Red Ball"
  • Create Effect(Filtered Array(All Players(All Teams), Entity Exists(Global.BallOwner) && Team Of(Global.BallOwner)
  • == Opposite Team Of(Team Of(Event Player))), Orb, Color(Red), Update Every Frame(Global.BallPos), 0.500,
  • Visible To Position Radius and Color);
  • "Blue Ball"
  • Create Effect(Filtered Array(All Players(All Teams), Entity Exists(Global.BallOwner) && Team Of(Global.BallOwner) == Team Of(
  • Current Array Element)), Orb, Color(Blue), Update Every Frame(Global.BallPos), 0.500, Visible To Position Radius and Color);
  • "Ghost Ball (Spawn, black)"
  • Create Effect(Filtered Array(All Players(All Teams), Entity Exists(Global.BallOwner)), Orb, Color(Black), Global.BallSpawnLocation,
  • 0.500, Visible To Position Radius and Color);
  • "Kill Velocity Aura"
  • Create Effect(Filtered Array(All Players(All Teams), Global.BallHasKillVelocity), Good Aura, Color(Yellow), Global.BallPos, 0.500,
  • Visible To Position Radius and Color);
  • "Ball Icon"
  • Create Icon(Filtered Array(All Players(All Teams), !Global.BallIsHeld || Current Array Element != Global.BallOwner),
  • Update Every Frame(Global.BallPos), Ring Thick, Visible To and Position, Color(Yellow), True);
  • "Neutral Ball Icon"
  • Create Icon(Filtered Array(All Players(All Teams), !Global.BallIsHeld || !Entity Exists(Global.BallOwner)), Update Every Frame(
  • Global.BallPos), Ring Thick, Visible To and Position, Color(White), True);
  • "Red Ball Icon"
  • Create Icon(Filtered Array(All Players(All Teams), (!Global.BallIsHeld || Current Array Element != Global.BallOwner)
  • && Entity Exists(Global.BallOwner) && Team Of(Current Array Element) == Opposite Team Of(Global.BallOwner)),
  • Update Every Frame(Global.BallPos), Ring Thick, Visible To and Position, Color(Red), True);
  • "Blue Ball Icon"
  • Create Icon(Filtered Array(All Players(All Teams), (!Global.BallIsHeld || Current Array Element != Global.BallOwner)
  • && Entity Exists(Global.BallOwner) && Team Of(Current Array Element) == Team Of(Global.BallOwner)), Update Every Frame(
  • Global.BallPos), Ring Thick, Visible To and Position, Color(Blue), True);
  • Else;
  • Play Effect(All Players(All Teams), Ring Explosion, Color(Yellow), Global.BallPos, 10);
  • Play Effect(All Players(All Teams), Explosion Sound, Color(White), Global.BallPos, 1000);
  • End;
  • }
  • }
  • rule("Sub: Activate Ball Physics")
  • {
  • event
  • {
  • Subroutine;
  • ActivateBallPhysics;
  • }
  • actions
  • {
  • Chase Global Variable At Rate(BallPos, Global.BallPos + Global.BallVelocity, Magnitude Of(Global.BallVelocity),
  • Destination and Rate);
  • Chase Global Variable At Rate(BallVelocity, Global.BallVelocity + Vector(X Component Of(Global.BallVelocity), -100, Z Component Of(
  • Global.BallVelocity)), 9.820, Destination and Rate);
  • }
  • }
  • rule("Tick Ball")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • (Global.BallIsHeld || Magnitude Of(Global.BallVelocity) > 0) == True;
  • }
  • actions
  • {
  • While(True);
  • Abort If Condition Is False;
  • If(Global.BallIsHeld);
  • Global.BallPos = Eye Position(Global.BallOwner) + Velocity Of(Global.BallOwner) * 0.010 + Facing Direction Of(Global.BallOwner)
  • * 2.500;
  • Else;
  • "Ball Bounce"
  • If(Distance Between(Global.BallPos + Normalize(Global.BallVelocity) * -0.500, Ray Cast Hit Position(Global.BallPos + Normalize(
  • Global.BallVelocity) * -0.500, Global.BallPos + Normalize(Global.BallVelocity) * 1000, Null, Null, False)) <= 1);
  • Global.TempVar = Ray Cast Hit Normal(Global.BallPos, Global.BallPos + Global.BallVelocity, Null, Null, False);
  • "Resolve Collision"
  • Global.BallPos = Global.BallPos + Normalize(Global.BallVelocity) * -1 * (0.500 - Distance Between(Global.BallPos,
  • Ray Cast Hit Position(Global.BallPos + Normalize(Global.BallVelocity) * -0.500, Global.BallPos + Normalize(Global.BallVelocity)
  • * 1000, Null, Null, False)));
  • "Reflect Ball Velocity on Normal"
  • Global.BallVelocity = Global.BallVelocity + Global.TempVar * Dot Product(Global.BallVelocity, Global.TempVar) * -2;
  • "Bounciness"
  • Global.BallVelocity = Global.BallVelocity * 0.850;
  • If(Global.BallHasKillVelocity);
  • Play Effect(All Players(All Teams), Explosion Sound, Color(White), Global.BallPos, 100);
  • End;
  • "Colliding With Terrain"
  • End;
  • "!Ball Is Held"
  • End;
  • If(!Global.BallIsHeld && Magnitude Of(Global.BallVelocity) < 25);
  • Global.BallOwner = Null;
  • End;
  • "Set Ball Kill Velocity Bool"
  • Global.BallHasKillVelocity = !Global.BallIsHeld && Magnitude Of(Global.BallVelocity) >= 25;
  • Global.BallHasKillVelocity = !Global.BallIsHeld && Entity Exists(Global.BallOwner) && Magnitude Of(Global.BallVelocity) >= 25;
  • If(Global.BallHasKillVelocity);
  • Play Effect(All Players(All Teams), Bad Explosion, Color(Yellow), Global.BallPos, 0.200);
  • End;
  • Wait(0, Ignore Condition);
  • End;
  • }
  • }
  • rule("Sub: Spawn Player")
  • {
  • event
  • {
  • Subroutine;
  • SpawnPlayer;
  • }
  • actions
  • {
  • If(Count Of(Global.CustomSpawnPoints) > 0);
  • Event Player.TempVar = Random Value In Array(Global.CustomSpawnPoints);
  • If(Count Of(All Players(All Teams)) > 1);
  • "Offset Start Index"
  • Event Player.TempVar = Random Integer(0, Count Of(Global.CustomSpawnPoints));
  • "Loop through all spawn points"
  • For Player Variable(Event Player, TempVar2, 0, Count Of(Global.CustomSpawnPoints), 1);
  • "Find non-occupied spawn point"
  • If(Distance Between(Position Of(First Of(Sorted Array(Filtered Array(All Players(All Teams),
  • Current Array Element != Event Player), Distance Between(Position Of(Current Array Element), Global.CustomSpawnPoints[(
  • Event Player.TempVar2 + Event Player.TempVar) % Count Of(Global.CustomSpawnPoints)])))), Global.CustomSpawnPoints[(
  • Event Player.TempVar2 + Event Player.TempVar) % Count Of(Global.CustomSpawnPoints)]) > 1);
  • "Set Spawn Point to current value"
  • Event Player.TempVar = Global.CustomSpawnPoints[(Event Player.TempVar2 + Event Player.TempVar) % Count Of(Global.CustomSpawnPoints)
  • ];
  • Break;
  • End;
  • "Set Spawnpoint to a random one if we didn't find any available"
  • If(!Array Contains(Global.CustomSpawnPoints, Event Player.TempVar));
  • Event Player.TempVar = Random Value In Array(Global.CustomSpawnPoints);
  • End;
  • End;
  • End;
  • Event Player.TempVar = Nearest Walkable Position(Event Player.TempVar + Up);
  • Teleport(Event Player, Event Player.TempVar);
  • Set Facing(Event Player, Normalize(Vector Towards(Eye Position(Event Player), Global.ArenaCenter) - Vector(0, Y Component Of(
  • Global.ArenaCenter) - Y Component Of(Eye Position(Event Player)), 0)), To World);
  • End;
  • }
  • }
  • rule("Sub: Player Pickup Ball")
  • {
  • event
  • {
  • Subroutine;
  • PlayerPickupBall;
  • }
  • actions
  • {
  • Global.BallIsHeld = True;
  • Global.BallOwner = Event Player;
  • Stop Chasing Global Variable(BallPos);
  • Stop Chasing Global Variable(BallVelocity);
  • Global.BallRespawnTime = 5;
  • Chase Global Variable At Rate(BallRespawnTime, 0, 1, Destination and Rate);
  • }
  • }
  • rule("Sub: Player Ball Collision")
  • {
  • event
  • {
  • Subroutine;
  • PlayerBallCollision;
  • }
  • actions
  • {
  • If(!Global.BallIsHeld);
  • If(Event Player.CanDeflect && !Has Status(Event Player, Stunned));
  • Call Subroutine(DropBall);
  • Play Effect(All Players(All Teams), Buff Impact Sound, Color(White), Event Player, 100);
  • Global.BallOwner = Event Player;
  • "Deflect Ball"
  • Global.BallVelocity = Facing Direction Of(Event Player) * 50;
  • Play Effect(All Players(All Teams), Ring Explosion, Color(Green), Event Player, 2);
  • Else;
  • If(!Global.BallHasKillVelocity || (Event Player.CanSoak && !Has Status(Event Player, Stunned)) || Team Of(Event Player) == Team Of(
  • Global.BallOwner));
  • Call Subroutine(PlayerPickupBall);
  • Else;
  • If(Global.BallHasKillVelocity);
  • Call Subroutine(KillPlayer);
  • End;
  • End;
  • End;
  • End;
  • }
  • }
  • rule("Sub: Drop Ball")
  • {
  • event
  • {
  • Subroutine;
  • DropBall;
  • }
  • actions
  • {
  • Global.BallIsHeld = False;
  • Global.BallVelocity = Velocity Of(Global.BallOwner);
  • Global.BallOwner.LastTimeHeldBall = Total Time Elapsed;
  • Call Subroutine(ActivateBallPhysics);
  • Global.BallRespawnTime = 4;
  • Chase Global Variable At Rate(BallRespawnTime, 0, 1, Destination and Rate);
  • }
  • }
  • rule("Sub: Kill Player")
  • {
  • event
  • {
  • Subroutine;
  • KillPlayer;
  • }
  • actions
  • {
  • Kill(Event Player, Global.BallOwner);
  • Play Effect(All Players(All Teams), Ring Explosion, Color(Yellow), Event Player, 7);
  • Play Effect(All Players(All Teams), Bad Explosion, Color(Yellow), Event Player, 3);
  • Play Effect(All Players(All Teams), Buff Explosion Sound, Color(White), Event Player, 100);
  • }
  • }
  • rule("Player Shoot")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Button Held(Event Player, Button(Primary Fire)) == True;
  • }
  • actions
  • {
  • If(Global.BallIsHeld && Global.BallOwner == Event Player);
  • Call Subroutine(DropBall);
  • Global.BallPos = Eye Position(Event Player) + Facing Direction Of(Event Player) * 0.500;
  • Global.BallVelocity = Velocity Of(Event Player) * 0.500 + Facing Direction Of(Event Player) * 35;
  • Play Effect(All Players(All Teams), Debuff Impact Sound, Color(White), Event Player, 100);
  • End;
  • }
  • }
  • rule("Ball Respawn Timer")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • Global.BallRespawnTime <= 0;
  • }
  • actions
  • {
  • Call Subroutine(SpawnBall);
  • Stop Chasing Global Variable(BallRespawnTime);
  • }
  • }
  • rule("Steal Ball On Damage")
  • {
  • event
  • {
  • Player Dealt Damage;
  • All;
  • All;
  • }
  • conditions
  • {
  • (Global.BallIsHeld && Victim == Global.BallOwner) == True;
  • }
  • actions
  • {
  • Small Message(All Players(All Teams), Custom String("{0} stole ball from {1}", Custom String("{0}{1}", Hero Icon String(Hero Of(
  • Attacker)), Attacker), Custom String("{0}{1}", Hero Icon String(Hero Of(Victim)), Victim)));
  • Call Subroutine(DropBall);
  • Call Subroutine(PlayerPickupBall);
  • }
  • }
  • rule("Doomfist Uppercut")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • Doomfist;
  • }
  • conditions
  • {
  • Is Using Ability 1(Event Player) == True;
  • }
  • actions
  • {
  • Event Player.CanSoak = True;
  • Wait(0.400, Ignore Condition);
  • Event Player.CanSoak = False;
  • }
  • }
  • rule("Doomfist Slam")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • Doomfist;
  • }
  • conditions
  • {
  • Is Using Ability 2(Event Player) == True;
  • }
  • actions
  • {
  • Event Player.CanSoak = True;
  • }
  • }
  • rule("Doomfist Landing")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • Doomfist;
  • }
  • conditions
  • {
  • Is On Ground(Event Player) == True;
  • }
  • actions
  • {
  • Event Player.CanSoak = False;
  • }
  • }
  • rule("Genji Deflect")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • Genji;
  • }
  • conditions
  • {
  • Is Using Ability 2(Event Player) == True;
  • }
  • actions
  • {
  • Event Player.CanDeflect = True;
  • Wait(2, Ignore Condition);
  • Event Player.CanDeflect = False;
  • }
  • }
  • rule("Genji Dash")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • Genji;
  • }
  • conditions
  • {
  • Is Using Ability 1(Event Player) == True;
  • }
  • actions
  • {
  • Event Player.CanDeflect = False;
  • }
  • }
  • rule("Tracer Recall")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • Tracer;
  • }
  • conditions
  • {
  • Is Using Ability 2(Event Player) == True;
  • }
  • actions
  • {
  • Wait(1, Ignore Condition);
  • If(Total Time Elapsed - Event Player.LastTimeHeldBall <= 3);
  • Call Subroutine(PlayerPickupBall);
  • End;
  • If(Global.BallIsHeld && Global.BallOwner == Event Player);
  • Global.BallRespawnTime = 5;
  • End;
  • }
  • }
  • rule("Tracer Blink")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • Tracer;
  • }
  • conditions
  • {
  • Is Using Ability 1(Event Player) == True;
  • }
  • actions
  • {
  • Play Effect(All Players(All Teams), Good Explosion, Color(Sky Blue), Vector(X Component Of(Position Of(Event Player)),
  • Y Component Of(Position Of(Event Player)), Z Component Of(Position Of(Event Player))), 3);
  • If(Distance Between(Throttle Of(Event Player) * Dot Product(Local Vector Of(Global.BallPos, Event Player,
  • Rotation And Translation), Throttle Of(Event Player)), Local Vector Of(Global.BallPos, Event Player, Rotation And Translation))
  • <= 3);
  • If(Dot Product(World Vector Of(Throttle Of(Event Player), Event Player, Rotation), Normalize(Vector Towards(Position Of(
  • Event Player), Global.BallPos))) >= 0 && Distance Between(Position Of(Event Player), Global.BallPos) <= 7.500);
  • Call Subroutine(PlayerBallCollision);
  • End;
  • End;
  • }
  • }
  • rule("Roadhog Breather")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • Roadhog;
  • }
  • conditions
  • {
  • Is Using Ability 2(Event Player) == True;
  • }
  • actions
  • {
  • Event Player.CanSoak = True;
  • Wait(2, Ignore Condition);
  • Event Player.CanSoak = False;
  • }
  • }
  • rule("Roadhog Hook")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • Roadhog;
  • }
  • conditions
  • {
  • Is Using Ability 1(Event Player) == True;
  • }
  • actions
  • {
  • Wait(0.100, Ignore Condition);
  • Abort If(!Is In Line of Sight(Eye Position(Event Player), Global.BallPos, Barriers Do Not Block LOS));
  • Event Player.TempVar = Facing Direction Of(Event Player);
  • Wait(Min(Distance Between(Eye Position(Event Player), Global.BallPos) / 40, 0.200), Ignore Condition);
  • If(Distance Between(Event Player.TempVar * Dot Product(Vector Towards(Eye Position(Event Player), Global.BallPos),
  • Event Player.TempVar), Vector Towards(Eye Position(Event Player), Global.BallPos)) <= 2.500);
  • If(Dot Product(Event Player.TempVar, Normalize(Vector Towards(Eye Position(Event Player), Global.BallPos)))
  • >= 0 && Distance Between(Eye Position(Event Player), Global.BallPos) <= 20);
  • If(!Global.BallIsHeld);
  • Call Subroutine(DropBall);
  • Global.BallVelocity = Velocity Of(Event Player) + Normalize(Vector Towards(Global.BallPos, Eye Position(Event Player)))
  • * Distance Between(Global.BallPos, Eye Position(Event Player)) * 2.500;
  • Global.BallOwner = Event Player;
  • End;
  • End;
  • End;
  • }
  • }
  • rule("Player Death")
  • {
  • event
  • {
  • Player Died;
  • All;
  • All;
  • }
  • actions
  • {
  • Event Player.CanSoak = False;
  • Event Player.CanDeflect = False;
  • }
  • }
  • rule("Player Stunned")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Has Status(Event Player, Stunned) == True;
  • }
  • actions
  • {
  • Event Player.CanSoak = False;
  • Event Player.CanDeflect = False;
  • }
  • }
  • rule("Player Soak Active")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Event Player.CanSoak == True;
  • }
  • actions
  • {
  • If(!Entity Exists(Event Player.SoakEffectID));
  • Create Effect(Filtered Array(All Players(All Teams), Current Array Element != Event Player), Good Aura, Color(Orange),
  • Event Player, 1, Visible To Position and Radius);
  • Event Player.SoakEffectID = Last Created Entity;
  • End;
  • Play Effect(Filtered Array(All Players(All Teams), Current Array Element != Event Player), Good Explosion, Color(Orange),
  • Event Player, 0.500);
  • Wait(0.050, Ignore Condition);
  • Loop If Condition Is True;
  • }
  • }
  • rule("Player Soak Inactive")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Event Player.CanSoak == False;
  • }
  • actions
  • {
  • Destroy Effect(Event Player.SoakEffectID);
  • Event Player.SoakEffectID = 0;
  • }
  • }
  • rule("Respawn Ball When Out of Bounds")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • Distance Between(Global.BallPos, Global.ArenaCenter) >= Global.ArenaRadius;
  • }
  • actions
  • {
  • Call Subroutine(SpawnBall);
  • }
  • }
  • rule("Player Out Of Bounds Start")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • (Is Alive(Event Player) && Has Spawned(Event Player) && Distance Between(Global.ArenaCenter, Position Of(Event Player))
  • > Global.ArenaRadius) == True;
  • }
  • actions
  • {
  • Chase Player Variable At Rate(Event Player, OutOfBoundsKillTimer, 0, 1, Destination and Rate);
  • }
  • }
  • rule("Player Out Of Bounds End")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • (Is Alive(Event Player) && Has Spawned(Event Player) && Distance Between(Global.ArenaCenter, Position Of(Event Player))
  • > Global.ArenaRadius) == False;
  • }
  • actions
  • {
  • Stop Chasing Player Variable(Event Player, OutOfBoundsKillTimer);
  • }
  • }
  • rule("Player Out Of Bounds Kill")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Event Player.OutOfBoundsKillTimer <= 0;
  • }
  • actions
  • {
  • Kill(Event Player, Null);
  • }
  • }
  • rule("Player Jumppad Collision")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • (Distance Between(Position Of(Event Player), First Of(Sorted Array(Global.JumpPadLocations, Distance Between(Position Of(
  • Event Player), Current Array Element)))) <= 3 && Dot Product(Normalize(Velocity Of(Event Player)), Normalize(Vector Towards(
  • Position Of(Event Player), First Of(Sorted Array(Global.JumpPadLocations, Distance Between(Position Of(Event Player),
  • Current Array Element)))))) >= 0) == True;
  • }
  • actions
  • {
  • Abort If(!Has Spawned(Event Player) || !Is Alive(Event Player));
  • Event Player.TempVar = Index Of Array Value(Global.JumpPadLocations, First Of(Sorted Array(Global.JumpPadLocations,
  • Distance Between(Position Of(Event Player), Current Array Element))));
  • Apply Impulse(Event Player, Normalize(Global.JumpPadLaunchForces[Event Player.TempVar]), Magnitude Of(
  • Global.JumpPadLaunchForces[Event Player.TempVar]), To World, Cancel Contrary Motion);
  • Play Effect(All Players(All Teams), Good Explosion, Color(Rose), Global.JumpPadLocations[Event Player.TempVar], 2);
  • Play Effect(All Players(All Teams), Ring Explosion, Color(White), Global.JumpPadLocations[Event Player.TempVar], 5);
  • Play Effect(All Players(All Teams), Buff Impact Sound, Color(White), Global.JumpPadLocations[Event Player.TempVar], 100);
  • }
  • }
Join the Workshop.codes Discord