Overwatch 2 Talents - Tracer Flash

PFXKX


This code adds Tracer's Flash talent from Overwatch 2 to the current game. Flash was shown during Blizzcon. The talent reads "Blinking through enemies damages them".

  • Dashing through someone will cause 100 damage.
  • You can hit multiple enemies with a single dash.
  • Due to the nature of how positions checks are done in the Workshop, dashing in to (but not through) someone will also damage them.
  • There is a small delay on when you dash and when the damage is actually done. This is roughly 200ms.

You can spawn bots to test out the ability. Hold Crouch and Press Interact [F] to spawn a bot. You can spawn a maximum of 6 bots and they don't respawn. This is just for testing purposes, so feel free to adjust this if necessary.

The code won't work in Deathmatch, but it will work in all Team modes. As it is right now it's mostly just meant to play around with the new talents. I plan on adjusting it some more so it could be adding to your own gamesmodes.


For anyone wondering how this is done;

  • When dashing your starting position is recorded.
  • When you dash is complete your ending position is recorded.
  • The difference between these two values is calculated by subtracting the starting position from the ending position.
  • Between these two points we draw different spheres. The position of the spheres is determined by the difference between the start and end, and divided by the amount of spheres we want to draw.
  • For each sphere we check if there's players inside and add these to an array.
  • It's possible players are in more than 1 sphere. We loop over the array we created and place the players in a new array. If they already exist in this array, we skip them. Essenstially creating a new array without duplicated.
  • These players are then damaged.

Code Snippet

settings { main { Description: "Overwatch 2 Talents in the Workshop. Tracers's \"Flash\"; Blinking through enemies damages them." } modes { disabled Assault { Limit Roles: 2 Of Each Role Per Team } disabled Control { Limit Roles: 2 Of Each Role Per Team } disabled Escort { Limit Roles: 2 Of Each Role Per Team } Hybrid { Limit Roles: 2 Of Each Role Per Team enabled maps { King's Row } } } heroes { General { Spawn With Ultimate Ready: On Ultimate Generation: 500% Ultimate Generation - Combat: 500% Ultimate Generation - Passive: 500% Tracer { Blink Cooldown Time: 20% } enabled heroes { Tracer } } } } rule("Spawn bots") { event { Ongoing - Each Player; All; All; } conditions { Is Button Held(Event Player, Crouch) == True; Is Button Held(Event Player, Interact) == True; } actions { Create Dummy Bot(Hero(Bastion), Opposite Team Of(Team Of(Event Player)), -1, Add(Event Player, Multiply(Facing Direction Of( Event Player), 0.500)), Facing Direction Of(Event Player)); } } rule("Settings - [Global] [D = Divisions] [R = Radius (Bigger = easier to hit things)] [S = Show Debugging stuff]") { event { Ongoing - Global; } actions { Set Global Variable(D, 10); Set Global Variable(R, 1.500); Set Global Variable(S, False); } } rule("HUD") { event { Ongoing - Each Player; All; All; } conditions { Has Spawned(Event Player) == True; } actions { Skip If(Compare(Global Variable(S), ==, False), 20); Create HUD Text(Event Player, Player Variable(Event Player, A), Null, Null, Left, 0, White, White, White, Visible To and String, Default Visibility); Create HUD Text(Event Player, Player Variable(Event Player, B), Null, Null, Left, 0, White, White, White, Visible To and String, Default Visibility); Create HUD Text(Event Player, Player Variable(Event Player, C), Null, Null, Left, 0, White, White, White, Visible To and String, Default Visibility); Create HUD Text(Event Player, Player Variable(Event Player, X), Null, Null, Left, 0, White, White, White, Visible To and String, Default Visibility); Create HUD Text(Event Player, Player Variable(Event Player, Z), Null, Null, Left, 0, White, White, White, Visible To and String, Default Visibility); Create HUD Text(Event Player, Player Variable(Event Player, J), Null, Null, Left, 0, White, White, White, Visible To and String, Default Visibility); Create HUD Text(Event Player, Player Variable(Event Player, I), Null, Null, Left, 0, White, White, White, Visible To and String, Default Visibility); Create HUD Text(Event Player, Player Variable(Event Player, Q), Null, Null, Left, 0, White, White, White, Visible To and String, Default Visibility); Create HUD Text(Event Player, Player Variable(Event Player, P), Null, Null, Right, 0, Red, Red, Red, Visible To and String, Default Visibility); Create HUD Text(Event Player, Player Variable(Event Player, K), Null, Null, Left, 0, Blue, Blue, Blue, Visible To and String, Default Visibility); } } rule("Before using ability - [A = Starting position]") { event { Ongoing - Each Player; All; All; } conditions { Hero Of(Event Player) == Hero(Tracer); Is Using Ability 1(Event Player) == True; } actions { Set Player Variable(Event Player, I, 0); Set Player Variable(Event Player, J, 0); Set Player Variable(Event Player, K, 0); Set Player Variable(Event Player, Q, 0); Set Player Variable(Event Player, P, Empty Array); Set Player Variable(Event Player, H, Empty Array); Set Player Variable(Event Player, A, Position Of(Event Player)); Skip If(Compare(Global Variable(S), ==, False), 1); Create Effect(All Players(All Teams), Sphere, White, Player Variable(Event Player, A), Global Variable(R), Visible To Position and Radius); } } rule("Using ability - [B = Ending Position]") { event { Ongoing - Each Player; All; All; } conditions { Hero Of(Event Player) == Hero(Tracer); Is Using Ability 1(Event Player) == True; } actions { Wait(0.010, Ignore Condition); Set Player Variable(Event Player, B, Position Of(Event Player)); Skip If(Compare(Global Variable(S), ==, False), 2); Create Effect(All Players(All Teams), Sphere, White, Player Variable(Event Player, B), Global Variable(R), Visible To Position and Radius); Create Beam Effect(All Players(All Teams), Grapple Beam, Player Variable(Event Player, A), Player Variable(Event Player, B), White, Visible To Position and Radius); } } rule("After using ability - [C = Distance between] [I = Loop]") { event { Ongoing - Each Player; All; All; } conditions { Hero Of(Event Player) == Hero(Tracer); Is Using Ability 1(Event Player) == True; } actions { Skip If(Compare(Player Variable(Event Player, I), !=, 0), 1); Wait(0.020, Ignore Condition); Modify Player Variable(Event Player, I, Add, 1); Set Player Variable(Event Player, C, Distance Between(Player Variable(Event Player, A), Player Variable(Event Player, B))); Set Player Variable(Event Player, X, Subtract(X Component Of(Player Variable(Event Player, A)), X Component Of(Player Variable( Event Player, B)))); Set Player Variable(Event Player, Z, Subtract(Z Component Of(Player Variable(Event Player, A)), Z Component Of(Player Variable( Event Player, B)))); Wait(0.001, Ignore Condition); Loop If(Compare(Player Variable(Event Player, I), !=, Global Variable(D))); } } rule("Check who to damage - [Q = Current Damage check position] [P = Players that are affected] [J = Loop]") { event { Ongoing - Each Player; All; All; } conditions { Hero Of(Event Player) == Hero(Tracer); Is Using Ability 1(Event Player) == True; } actions { Skip If(Compare(Player Variable(Event Player, J), !=, 0), 1); Wait(0.030, Ignore Condition); Modify Player Variable(Event Player, J, Add, 1); Set Player Variable(Event Player, Q, Vector(Subtract(X Component Of(Player Variable(Event Player, A)), Multiply(Divide( Player Variable(Event Player, X), Global Variable(D)), Player Variable(Event Player, J))), Y Component Of(Player Variable( Event Player, A)), Subtract(Z Component Of(Player Variable(Event Player, A)), Multiply(Divide(Player Variable(Event Player, Z), Global Variable(D)), Player Variable(Event Player, J))))); Set Player Variable(Event Player, P, Append To Array(Player Variable(Event Player, P), Players Within Radius(Player Variable( Event Player, Q), Global Variable(R), Opposite Team Of(Team Of(Event Player)), Surfaces))); Skip If(Compare(Global Variable(S), ==, False), 1); Create Effect(All Players(All Teams), Sphere, Red, Player Variable(Event Player, Q), Global Variable(R), Visible To Position and Radius); Wait(0.001, Ignore Condition); Loop If(Compare(Player Variable(Event Player, J), !=, Global Variable(D))); } } rule("Deal the damage - [H = Players that have been damaged] [K = Loop]") { event { Ongoing - Each Player; All; All; } conditions { Hero Of(Event Player) == Hero(Tracer); Is Using Ability 1(Event Player) == True; } actions { Skip If(Compare(Player Variable(Event Player, K), !=, 0), 1); Wait(0.200, Ignore Condition); Skip If(Array Contains(Player Variable(Event Player, H), Value In Array(Player Variable(Event Player, P), Player Variable( Event Player, K))), 2); Set Player Variable(Event Player, H, Append To Array(Player Variable(Event Player, H), Value In Array(Player Variable(Event Player, P), Player Variable(Event Player, K)))); Damage(Value In Array(Player Variable(Event Player, H), Index Of Array Value(Player Variable(Event Player, H), Value In Array( Player Variable(Event Player, P), Player Variable(Event Player, K)))), Event Player, 100); Modify Player Variable(Event Player, K, Add, 1); Wait(0.016, Ignore Condition); Loop If(Compare(Player Variable(Event Player, K), <, 20)); } }
View Fullscreen
Copy to clipboard
Categories | Hero Adjustments
Heroes | Tracer
Maps | King's Row
Created at |
Last updated |
Current version | 1

Update Log

Updated expired code

1
This code is over 6 months old. This might mean the code has expired and will no longer function.
H0XSA

1 Comments

Log in or Sign up to place a comment.
tracergod

Very cool!

Websites are expensive, support Workshop.codes
Workshop.codes - Background image