Return to post
settings
{
main
{
Description: "Legacy version of Mei Training Chamber. Controls: Primary Fire for 0.5s to choose hero/training, Interact for 2s to go back to Main Menu."
}
lobby
{
Map Rotation: After A Game
Max Spectators: 6
Max Team 1 Players: 1
Max Team 2 Players: 0
Return To Lobby: Never
Swap Teams After Match: No
}
modes
{
Skirmish
{
enabled maps
{
Workshop Chamber
}
}
General
{
Hero Limit: Off
Respawn Time Scalar: 0%
}
}
heroes
{
Team 2
{
Ability Cooldown Time: 50%
Reinhardt
{
Barrier Field Recharge Rate: 500%
}
}
General
{
enabled heroes
{
Mei
}
}
}
}
variables
{
global:
0: chosenTraining
1: controlIndex
2: headerText
3: subheaderText
4: footnoteText
5: botAimingAccuracy
6: multipleBots
7: exitButton
8: mainMenu_ButtonPos
9: mainMenu_ButtonTexts
10: mainMenu_ButtonColour
11: trainingButton_isEnabled
12: aiming_ButtonPos
13: aiming_EnemyHeroes
14: aimingModifier_isEnabled
15: aimingModifier_ButtonPos
16: aimingModifier_ButtonTexts
17: reaction_ButtonPos
18: reaction_EnemyHeroes
19: reaction_LargerDistanceHeroes
20: testIsRunning
21: placement_ButtonPos
22: placement_EnemyHeroes
23: placement_DeathEffects
24: tossing_SpawnLocation
25: tossing_ButtonPos
26: tossing_ButtonTexts
27: tossing_ButtonColour
28: hideUIButton
29: isUIHidden
player:
0: botThrottle
1: botFacing
2: botState
3: botFacingOffset
4: cameraState
5: botSpawnLocation
6: botSpawnFacing
}
subroutines
{
0: ChangeDirection
1: JumpAndCrouch
4: PreparePlacementTest
5: ClearDeathEffects
}
rule("[Init] Global Variable")
{
event
{
Ongoing - Global;
}
actions
{
Disable Inspector Recording;
"Currently selected training"
Global.chosenTraining = 0;
"Top header text"
Global.headerText = Array(Custom String("{0} Training Chamber", Hero Icon String(Hero(Mei))), Custom String("{0} Aiming",
Ability Icon String(Hero(Mei), Button(Primary Fire))), Custom String("{0} Reaction", Ability Icon String(Hero(Mei), Button(
Ability 1))), Custom String("{0} Placement", Ability Icon String(Hero(Mei), Button(Ability 2))), Custom String("{0} Tossing",
Ability Icon String(Hero(Mei), Button(Ultimate))));
"Subheader text"
Global.subheaderText = Array(Custom String("Main Menu"), Custom String("Select enemy"), Custom String("Select enemy"),
Custom String("Select enemy"), Custom String("Controls"));
"Footnote text"
Global.footnoteText = Array(Custom String("Select training"), Custom String("Select enemy"), Custom String("Select enemy"),
Custom String("Select enemy"), Custom String("reset configuration"));
"Exit button location"
Global.exitButton = Vector(-19.500, 25, 16);
"Hide UI"
Global.hideUIButton = Vector(-19.500, 25, -16);
Global.isUIHidden = False;
"Bot's aiming accuracy"
Global.botAimingAccuracy = Workshop Setting Real(Custom String("Aim Training settings"), Custom String("Bot's aiming accuracy"),
0.500, 0, 1, 0);
"Multiple bots spawning"
Global.multipleBots = Workshop Setting Toggle(Custom String("Aim Training settings"), Custom String(
"Allow multiple bots spawning"), False, 0);
}
}
rule("[Init] Menu data")
{
event
{
Ongoing - Global;
}
actions
{
"Main Menu training buttons and text locations"
Global.mainMenu_ButtonPos = Array(Vector(-19.500, 12, 8), Vector(-19.500, 12, -8), Vector(-19.500, 6, 8), Vector(-19.500, 6, -8));
Global.mainMenu_ButtonTexts = Array(Custom String("{0} Aiming", Ability Icon String(Hero(Mei), Button(Primary Fire))),
Custom String("{0} Reaction", Ability Icon String(Hero(Mei), Button(Ability 1))), Custom String("{0} Placement",
Ability Icon String(Hero(Mei), Button(Ability 2))), Custom String("{0} Tossing", Ability Icon String(Hero(Mei), Button(
Ultimate))));
Global.mainMenu_ButtonColour = Array(Color(Blue), Color(Sky Blue), Color(Aqua), Color(Turquoise));
"Aim training heroes list and button location"
Global.aiming_ButtonPos = Array(Vector(-19.500, 10, 16), Vector(-19.500, 10, 12), Vector(-19.500, 10, 8), Vector(-19.500, 10, 4),
Vector(-19.500, 10, 0), Vector(-19.500, 10, -4), Vector(-19.500, 10, -8), Vector(-19.500, 10, -12), Vector(-19.500, 10, -16),
Vector(-19.500, 5, 16), Vector(-19.500, 5, 12), Vector(-19.500, 5, 8), Vector(-19.500, 5, 4), Vector(-19.500, 5, 0), Vector(
-19.500, 5, -4), Vector(-19.500, 5, -8), Vector(-19.500, 5, -12), Vector(-19.500, 5, -16));
Global.aiming_EnemyHeroes = Array(Hero(Ana), Hero(McCree), Hero(Soldier: 76), Hero(Reaper), Hero(Reinhardt), Hero(Moira), Hero(
Hanzo), Hero(D.Va), Hero(Winston), Hero(Tracer), Hero(Genji), Hero(Doomfist), Hero(Lúcio), Hero(Echo), Hero(Pharah), Hero(
Widowmaker), Hero(Ashe), Hero(Mei));
"Aim Training Modifiers"
Global.aimingModifier_ButtonPos = Array(Vector(-19.500, 15, 16), Vector(-19.500, 15, 9.600), Vector(-19.500, 15, 3.200), Vector(
-19.500, 15, -3.200), Vector(-19.500, 15, -9.600), Vector(-19.500, 15, -16));
Global.aimingModifier_ButtonTexts = Array(Custom String("{0} More HP", Icon String(Plus)), Custom String("{0} {1}", String(
"Enemy"), Hero Icon String(Hero(Mercy))), Custom String("{0} Invincible", Ability Icon String(Hero(Baptiste), Button(
Ability 2))), Custom String("{0} {1}", String("Ally"), Hero Icon String(Hero(Mercy))), Custom String("{0} Infinite Ammo",
Icon String(Recycle)), Custom String("{0} Middle Wall", Ability Icon String(Hero(Mei), Button(Ability 2))));
"Reactions training heroes list and buttons location"
Global.reaction_ButtonPos = Array(Vector(-19.500, 10, 12), Vector(-19.500, 10, 8), Vector(-19.500, 10, 4), Vector(-19.500, 10, 0),
Vector(-19.500, 10, -4), Vector(-19.500, 10, -8), Vector(-19.500, 10, -12), Vector(-19.500, 5, 10), Vector(-19.500, 5, 6),
Vector(-19.500, 5, 2), Vector(-19.500, 5, -2), Vector(-19.500, 5, -6), Vector(-19.500, 5, -10));
Global.reaction_EnemyHeroes = Array(Hero(Sigma), Hero(Wrecking Ball), Hero(Reinhardt), Hero(D.Va), Hero(Tracer), Hero(Sombra),
Hero(Ana), Hero(Junkrat), Hero(Roadhog), Hero(Doomfist), Hero(Pharah), Hero(McCree), Hero(Brigitte));
Global.reaction_LargerDistanceHeroes = Array(Hero(Sigma), Hero(Junkrat), Hero(Roadhog), Hero(Pharah));
"Placement training heroes list and buttons location"
Global.placement_ButtonPos = Array(Vector(-19.500, 10, 8), Vector(-19.500, 10, 4), Vector(-19.500, 10, 0), Vector(-19.500, 10, -4),
Vector(-19.500, 10, -8), Vector(-19.500, 5, 8), Vector(-19.500, 5, 4), Vector(-19.500, 5, 0), Vector(-19.500, 5, -4), Vector(
-19.500, 5, -8));
Global.placement_EnemyHeroes = Array(Hero(McCree), Hero(Doomfist), Hero(Ashe), Hero(Bastion), Hero(Soldier: 76), Hero(D.Va), Hero(
Reinhardt), Hero(Sombra), Hero(Lúcio), Hero(Zenyatta));
"Tossing buttons location"
Global.tossing_SpawnLocation = Vector(0, 0, 0);
Global.tossing_ButtonPos = Array(Vector(-19.500, 10, 8), Vector(-19.500, 10, -8), Vector(-19.500, 5, 0));
Global.tossing_ButtonTexts = Array(Custom String("{0} Add {1}", Icon String(Arrow: Up), String("Enemy")), Custom String(
"{0} Remove {1}", Icon String(Arrow: Down), String("Enemy")), Custom String("{0} Reset Configuration", Icon String(Recycle)));
Global.tossing_ButtonColour = Array(Color(Green), Color(Orange), Color(Sky Blue));
}
}
rule("[Player] Disable collision with players")
{
event
{
Ongoing - Each Player;
Team 1;
Slot 0;
}
conditions
{
Has Spawned(Event Player) == True;
}
actions
{
Disable Movement Collision With Players(Event Player);
}
}
disabled rule("----- Main Menu -----")
{
event
{
Ongoing - Global;
}
}
rule("[Effects] - Init texts, hide UI, back button for the trainer")
{
event
{
Ongoing - Global;
}
actions
{
"Header text"
Create In-World Text(!Global.isUIHidden ? All Players(All Teams) : Null, Global.headerText[Global.chosenTraining], Vector(-19.500,
30, 0), 5, Do Not Clip, Visible To String and Color, Global.chosenTraining >= 1 ? Color(Orange) : Color(Sky Blue),
Default Visibility);
"Sub header text"
Create In-World Text(!Global.isUIHidden ? All Players(All Teams) : Null, Global.subheaderText[Global.chosenTraining], Vector(
-19.500, 25, 0), 2.500, Do Not Clip, Visible To Position and String, Color(Lime Green), Default Visibility);
"Hold for 0.5 sec"
Create In-World Text(!Global.isUIHidden ? All Players(All Teams) : Null, Custom String("Hold [{1}] for 0.5s to {0}",
Global.footnoteText[Global.chosenTraining], Input Binding String(Button(Primary Fire))), Vector(-19.500, 0, 0), 1.500,
Do Not Clip, Visible To Position and String, Color(Yellow), Default Visibility);
"Exit button"
Create Effect(Global.chosenTraining >= 1 ? All Players(All Teams) : Null, Sphere, Color(Rose), Global.exitButton, 1,
Visible To and Color);
Create In-World Text(Global.chosenTraining >= 1 ? All Players(All Teams) : Null, Custom String("{0} Back", Icon String(
Arrow: Left)), Global.exitButton, 1.500, Do Not Clip, Visible To, Color(Rose), Default Visibility);
"Hide UI button"
Create Effect(Global.chosenTraining >= 1 ? All Players(All Teams) : Null, Sphere, Global.isUIHidden ? Color(Green) : Color(
Sky Blue), Global.hideUIButton, 1, Visible To and Color);
Create In-World Text(Global.chosenTraining >= 1 ? All Players(All Teams) : Null, Custom String("{0} Hide UI: {1}",
Ability Icon String(Hero(Sombra), Button(Ability 1)), Global.isUIHidden ? Icon String(Checkmark) : Icon String(X)),
Global.hideUIButton, 1.500, Do Not Clip, Visible To String and Color, Global.isUIHidden ? Color(Green) : Color(Sky Blue),
Default Visibility);
"Reaction Training Ring"
Create Effect(Global.chosenTraining == 2 ? All Players(All Teams) : Null, Ring, Color(Green), Vector(0, 0, 0), 2, Visible To);
"Creator info"
Create HUD Text(All Players(All Teams), Custom String(" BSRXK "), Custom String("{0} Mei Training Chamber by DragonEngineer",
Ability Icon String(Hero(Mei), Button(Ultimate))), Custom String("discord.gg/9su249k [All lowercase]"), Right, False, Color(
Sky Blue), Color(Green), Color(Yellow), Visible To and String, Default Visibility);
}
}
rule("[Effects] - Create button effects for all gamemodes")
{
event
{
Ongoing - Global;
}
actions
{
"Create button effect for the trainings"
For Global Variable(controlIndex, 0, Count Of(Global.mainMenu_ButtonPos), 1);
Create Effect(Global.chosenTraining == 0 ? All Players(All Teams) : Null, Sphere, Global.mainMenu_ButtonColour[Evaluate Once(
Global.controlIndex)], Global.mainMenu_ButtonPos[Evaluate Once(Global.controlIndex)], 1, Visible To);
Create In-World Text(Global.chosenTraining == 0 ? All Players(All Teams) : Null, Global.mainMenu_ButtonTexts[Evaluate Once(
Global.controlIndex)], Global.mainMenu_ButtonPos[Evaluate Once(Global.controlIndex)], 2, Do Not Clip, Visible To,
Global.mainMenu_ButtonColour[Evaluate Once(Global.controlIndex)], Default Visibility);
End;
"Create the button effects aim training hero selection"
For Global Variable(controlIndex, 0, Count Of(Global.aiming_ButtonPos), 1);
Create Effect(Global.chosenTraining == 1 && !Global.isUIHidden ? All Players(All Teams) : Null, Sphere,
Global.trainingButton_isEnabled[Evaluate Once(Global.controlIndex)] ? Color(Green) : Color(Orange),
Global.aiming_ButtonPos[Evaluate Once(Global.controlIndex)], 1, Visible To and Color);
Create In-World Text(Global.chosenTraining == 1 && !Global.isUIHidden ? All Players(All Teams) : Null, Hero Icon String(
Global.aiming_EnemyHeroes[Evaluate Once(Global.controlIndex)]), Global.aiming_ButtonPos[Evaluate Once(Global.controlIndex)], 2,
Clip Against Surfaces, Visible To, Color(White), Default Visibility);
End;
"Create the button effects aim training modifiers"
For Global Variable(controlIndex, 0, Count Of(Global.aimingModifier_ButtonPos), 1);
Create Effect(Global.chosenTraining == 1 && !Global.isUIHidden ? All Players(All Teams) : Null, Sphere,
Global.aimingModifier_isEnabled[Evaluate Once(Global.controlIndex)] ? Color(Green) : Color(Yellow),
Global.aimingModifier_ButtonPos[Evaluate Once(Global.controlIndex)], 1, Visible To and Color);
Create In-World Text(Global.chosenTraining == 1 && !Global.isUIHidden ? All Players(All Teams) : Null, Custom String("{0}: {1}",
Global.aimingModifier_ButtonTexts[Evaluate Once(Global.controlIndex)], Global.aimingModifier_isEnabled[Evaluate Once(
Global.controlIndex)] ? Icon String(Checkmark) : Icon String(X)), Global.aimingModifier_ButtonPos[Evaluate Once(
Global.controlIndex)], 1.300, Do Not Clip, Visible To String and Color, Global.aimingModifier_isEnabled[Evaluate Once(
Global.controlIndex)] ? Color(Green) : Color(Yellow), Default Visibility);
End;
"Create the button effects reaction hero selection"
For Global Variable(controlIndex, 0, Count Of(Global.reaction_ButtonPos), 1);
Create Effect(Global.chosenTraining == 2 && !Global.isUIHidden ? All Players(All Teams) : Null, Sphere,
Global.trainingButton_isEnabled[Evaluate Once(Global.controlIndex)] ? Color(Green) : Color(Orange),
Global.reaction_ButtonPos[Evaluate Once(Global.controlIndex)], 1, Visible To and Color);
Create In-World Text(Global.chosenTraining == 2 && !Global.isUIHidden ? All Players(All Teams) : Null, Hero Icon String(
Global.reaction_EnemyHeroes[Evaluate Once(Global.controlIndex)]), Global.reaction_ButtonPos[Evaluate Once(Global.controlIndex)
], 2, Clip Against Surfaces, Visible To, Color(White), Default Visibility);
End;
"Create the button effects wall placement"
For Global Variable(controlIndex, 0, Count Of(Global.placement_ButtonPos), 1);
Create Effect(Global.chosenTraining == 3 && !Global.isUIHidden ? All Players(All Teams) : Null, Sphere,
Global.trainingButton_isEnabled[Evaluate Once(Global.controlIndex)] ? Color(Green) : Color(Orange),
Global.placement_ButtonPos[Evaluate Once(Global.controlIndex)], 1, Visible To and Color);
Create In-World Text(Global.chosenTraining == 3 && !Global.isUIHidden ? All Players(All Teams) : Null, Hero Icon String(
Global.placement_EnemyHeroes[Evaluate Once(Global.controlIndex)]), Global.placement_ButtonPos[Evaluate Once(
Global.controlIndex)], 2, Clip Against Surfaces, Visible To, Color(White), Default Visibility);
End;
"Create button effect for ultimate tossing"
For Global Variable(controlIndex, 0, Count Of(Global.tossing_ButtonPos), 1);
Create Effect(Global.chosenTraining == 4 && !Global.isUIHidden ? All Players(All Teams) : Null, Sphere,
Global.tossing_ButtonColour[Evaluate Once(Global.controlIndex)], Global.tossing_ButtonPos[Evaluate Once(Global.controlIndex)],
1, Visible To);
Create In-World Text(Global.chosenTraining == 4 && !Global.isUIHidden ? All Players(All Teams) : Null,
Global.tossing_ButtonTexts[Evaluate Once(Global.controlIndex)], Global.tossing_ButtonPos[Evaluate Once(Global.controlIndex)],
2, Do Not Clip, Visible To, Global.tossing_ButtonColour[Evaluate Once(Global.controlIndex)], Default Visibility);
End;
"Extra text: Toggle camera text"
Create In-World Text(Global.chosenTraining >= 3 && !Global.isUIHidden ? All Players(All Teams) : Null, Custom String(
"Press [{0}] to toggle camera", Input Binding String(Button(Interact))), Vector(-19.500, 20, 0), 1.500, Do Not Clip,
Visible To and String, Color(Aqua), Default Visibility);
}
}
rule("[Main Menu] When at main menu, reset some of the settings and destroy bots")
{
event
{
Ongoing - Global;
}
conditions
{
Global.chosenTraining == 0;
}
actions
{
"Destroy bots"
Destroy All Dummy Bots;
"Reset the buttons"
Global.aimingModifier_isEnabled = Array(False, False, False, False, False);
Global.trainingButton_isEnabled = Empty Array;
Global.isUIHidden = False;
"Disable camera from Wall/Tossing training"
disabled Players In Slot(0, Team 1).cameraState = False;
disabled Stop Camera(Players In Slot(0, Team 1));
"Fully restore player HP and clear invincible"
Set Player Health(Players In Slot(0, Team 1), Max Health(Players In Slot(0, Team 1)));
Clear Status(Players In Slot(0, Team 1), Unkillable);
}
}
rule("[Back button] Pressing back button")
{
event
{
Ongoing - Each Player;
Team 1;
Slot 0;
}
conditions
{
Global.chosenTraining >= 1;
Is Button Held(Event Player, Button(Primary Fire)) == True;
Distance Between(Global.exitButton, Ray Cast Hit Position(Eye Position(Event Player), Eye Position(Event Player)
+ Facing Direction Of(Event Player) * Distance Between(Eye Position(Event Player), Global.exitButton), Null, Event Player,
True)) <= 1;
"Prevent players from overlapping selection of training bots and back button"
X Component Of(Position Of(Event Player)) >= -16;
}
actions
{
Wait(0.500, Abort When False);
"Clear death effects for Wall Placement Training"
If(Global.chosenTraining == 3);
Players In Slot(0, Team 1).cameraState = False;
Stop Camera(Players In Slot(0, Team 1));
Call Subroutine(ClearDeathEffects);
"Disable camera for Tossing Training"
Else If(Global.chosenTraining == 4);
Players In Slot(0, Team 1).cameraState = False;
Stop Camera(Players In Slot(0, Team 1));
End;
"Set state to 0"
Global.chosenTraining = 0;
}
}
rule("[Selection] Select a training")
{
event
{
Ongoing - Each Player;
Team 1;
Slot 0;
}
conditions
{
Global.chosenTraining == 0;
Is Button Held(Event Player, Button(Primary Fire)) == True;
Is True For Any(Global.mainMenu_ButtonPos, Distance Between(Current Array Element, Ray Cast Hit Position(Eye Position(
Event Player), Eye Position(Event Player) + Facing Direction Of(Event Player) * Distance Between(Eye Position(Event Player),
Current Array Element), Null, Event Player, True)) <= 1) == True;
}
actions
{
Wait(0.500, Abort When False);
"Detect which button index is pressed"
Global.chosenTraining = Index Of Array Value(Global.mainMenu_ButtonPos, First Of(Sorted Array(Filtered Array(
Global.mainMenu_ButtonPos, Distance Between(Current Array Element, Ray Cast Hit Position(Eye Position(Event Player),
Eye Position(Event Player) + Facing Direction Of(Event Player) * Distance Between(Eye Position(Event Player),
Current Array Element), Null, Event Player, True)) <= 1), Distance Between(Eye Position(Event Player),
Current Array Element))));
Global.chosenTraining += 1;
}
}
disabled rule("----- Weapon Aiming -----")
{
event
{
Ongoing - Global;
}
}
rule("[Aiming] - Init settings")
{
event
{
Ongoing - Global;
}
conditions
{
Global.chosenTraining == 1;
}
actions
{
"Set false for the buttons"
For Global Variable(controlIndex, 0, Count Of(Global.aiming_ButtonPos), 1);
Global.trainingButton_isEnabled[Global.controlIndex] = False;
End;
"Aim training modifiers"
Global.aimingModifier_isEnabled = Array(False, False, False, False, False);
}
}
rule("[Aiming] - Choosing Enemy")
{
event
{
Ongoing - Each Player;
Team 1;
Slot 0;
}
conditions
{
Global.chosenTraining == 1;
Is Button Held(Event Player, Button(Primary Fire)) == True;
Global.isUIHidden == False;
Is True For Any(Global.aiming_ButtonPos, Distance Between(Current Array Element, Ray Cast Hit Position(Eye Position(Event Player),
Eye Position(Event Player) + Facing Direction Of(Event Player) * Distance Between(Eye Position(Event Player),
Current Array Element), Null, Event Player, True)) <= 1) == True;
}
actions
{
Wait(0.500, Abort When False);
"Find the hero that is selected"
Global.controlIndex = Index Of Array Value(Global.aiming_ButtonPos, First Of(Sorted Array(Filtered Array(Global.aiming_ButtonPos,
Distance Between(Current Array Element, Ray Cast Hit Position(Eye Position(Event Player), Eye Position(Event Player)
+ Facing Direction Of(Event Player) * Distance Between(Eye Position(Event Player), Current Array Element), Null, Event Player,
True)) <= 1), Distance Between(Eye Position(Event Player), Current Array Element))));
Abort If(Global.controlIndex == -1);
"If allows for multiple bots to spawn"
If(Global.multipleBots);
"if the selected hero is not active"
If(!Is Hero Being Played(Global.aiming_EnemyHeroes[Global.controlIndex], Team 2));
Abort If(Number Of Players(Team 2) >= 6);
Create Dummy Bot(Global.aiming_EnemyHeroes[Global.controlIndex], Team 2, -1, Vector(0, 0, 0), Vector(0, 0, 0));
Global.trainingButton_isEnabled[Global.controlIndex] = True;
Play Effect(Event Player, Buff Explosion Sound, Color(White), Event Player, 100);
Else;
Abort If(Number Of Players(Team 2) <= 0);
Destroy Dummy Bot(Team 2, Slot Of(Filtered Array(All Players(Team 2), Is Dummy Bot(Current Array Element) && Hero Of(
Current Array Element) == Global.aiming_EnemyHeroes[Global.controlIndex])));
Global.trainingButton_isEnabled[Global.controlIndex] = False;
Play Effect(Event Player, Ring Explosion Sound, Color(White), Event Player, 100);
End;
"If only allows 1 bot"
Else;
"if the selected hero is active"
If(Entity Exists(Players In Slot(0, Team 2)));
Global.trainingButton_isEnabled[Index Of Array Value(Global.aiming_EnemyHeroes, Hero Of(Players In Slot(0, Team 2)))] = False;
End;
"If the selected hero is the same as the active hero, despawn the bot"
If(Global.aiming_EnemyHeroes[Global.controlIndex] == Hero Of(Players In Slot(0, Team 2)));
Destroy Dummy Bot(Team 2, 0);
Play Effect(Event Player, Ring Explosion Sound, Color(White), Event Player, 100);
Abort;
End;
"Created dummy bot that is different from the active one"
Create Dummy Bot(Global.aiming_EnemyHeroes[Global.controlIndex], Team 2, 0, Vector(0, 0, 0), Vector(0, 0, 0));
Global.trainingButton_isEnabled[Global.controlIndex] = True;
Play Effect(Event Player, Buff Explosion Sound, Color(White), Event Player, 100);
End;
}
}
rule("[Aiming] [All] - Init the Enemies")
{
event
{
Ongoing - Each Player;
Team 2;
All;
}
conditions
{
Global.chosenTraining == 1;
Is Dummy Bot(Event Player) == True;
Is Alive(Event Player) == True;
Hero Of(Event Player) != Hero(Mercy);
}
actions
{
Teleport(Event Player, Vector(0, 0, 0));
Event Player.botState = 0;
"Start moving"
Start Throttle In Direction(Event Player, Event Player.botThrottle, 1, To Player, Replace existing throttle,
Direction and Magnitude);
"Start facing player"
Start Facing(Event Player, Direction Towards(Eye Position(Event Player), Event Player.botFacingOffset + Eye Position(
Players In Slot(0, Team 1))), 100, To World, Direction and Turn Rate);
"More HP if the mode has more nemey health enabled"
If(Global.aimingModifier_isEnabled[0]);
Set Max Health(Event Player, 1000);
Wait(0.100, Ignore Condition);
Set Player Health(Event Player, Max Health(Event Player));
End;
}
}
rule("[Aiming] [Ana] - Movement control")
{
event
{
Ongoing - Each Player;
Team 2;
Ana;
}
conditions
{
Global.chosenTraining == 1;
Is Dummy Bot(Event Player) == True;
}
actions
{
"Change Throttle direction"
Call Subroutine(ChangeDirection);
"Jump and Crouch"
If(Is On Ground(Event Player));
Start Rule(JumpAndCrouch, Do Nothing);
End;
"Use sleep dart"
If(Ability Cooldown(Event Player, Button(Ability 1)) == 0);
Press Button(Event Player, Button(Ability 1));
Wait(2, Ignore Condition);
Clear Status(Players In Slot(0, Team 1), Asleep);
End;
Wait(0.500, Abort When False);
Loop If Condition Is True;
}
}
rule("[Aiming] [Mccree] - Movement control")
{
event
{
Ongoing - Each Player;
Team 2;
McCree;
}
conditions
{
Global.chosenTraining == 1;
Is Dummy Bot(Event Player) == True;
}
actions
{
"Change throttle direction"
Call Subroutine(ChangeDirection);
"Use roll when ready"
If(Ability Cooldown(Event Player, Button(Ability 1)) == 0);
Press Button(Event Player, Button(Ability 1));
End;
"Use flashbang when ready"
If(Ability Cooldown(Event Player, Button(Ability 2)) == 0 && Distance Between(Event Player, Players In Slot(0, Team 1)) < 10);
Press Button(Event Player, Button(Ability 2));
End;
"Jump and Crouch"
If(Is On Ground(Event Player));
Start Rule(JumpAndCrouch, Do Nothing);
End;
"Use weapon"
Press Button(Event Player, Button(Primary Fire));
Wait(0.500, Abort When False);
Loop If Condition Is True;
}
}
rule("[Aiming] [Soldier 76] - Movement control")
{
event
{
Ongoing - Each Player;
Team 2;
Soldier: 76;
}
conditions
{
Global.chosenTraining == 1;
Is Dummy Bot(Event Player) == True;
}
actions
{
"Change throttle direction"
Call Subroutine(ChangeDirection);
"Jump and Crouch"
If(Is On Ground(Event Player));
Start Rule(JumpAndCrouch, Do Nothing);
End;
"Use heal when ready and low HP"
If(Ability Cooldown(Event Player, Button(Ability 2)) == 0 && Normalized Health(Event Player) < 0.500);
Stop Holding Button(Event Player, Button(Primary Fire));
Press Button(Event Player, Button(Ability 2));
End;
Wait(0.500, Abort When False);
"Use weapon"
If(!Is Firing Primary(Event Player));
Start Holding Button(Event Player, Button(Primary Fire));
End;
Wait(0.500, Abort When False);
Loop If Condition Is True;
}
}
rule("[Aiming] [Reaper] - Movement control")
{
event
{
Ongoing - Each Player;
Team 2;
Reaper;
}
conditions
{
Global.chosenTraining == 1;
Is Dummy Bot(Event Player) == True;
}
actions
{
"Change Throttle direction"
Call Subroutine(ChangeDirection);
"Jump and Crouch"
If(Is On Ground(Event Player));
Start Rule(JumpAndCrouch, Do Nothing);
End;
"Use wraith formwhen ready"
If(Ability Cooldown(Event Player, Button(Ability 1)) == 0 && !Is Using Ability 1(Event Player));
Press Button(Event Player, Button(Ability 1));
End;
"Use weapon"
If(!Is Using Ability 1(Event Player));
Press Button(Event Player, Button(Primary Fire));
End;
Wait(0.500, Abort When False);
Loop If Condition Is True;
}
}
rule("[Aiming] [Reinhardt] - Movement control")
{
event
{
Ongoing - Each Player;
Team 2;
Reinhardt;
}
conditions
{
Global.chosenTraining == 1;
Is Dummy Bot(Event Player) == True;
}
actions
{
"Change Throttle direction"
Call Subroutine(ChangeDirection);
"Use hammer"
If(!Is Firing Primary(Event Player) && Distance Between(Position Of(Event Player), Position Of(Players In Slot(0, Team 1))) <= 5);
Stop Holding Button(Event Player, Button(Secondary Fire));
Start Holding Button(Event Player, Button(Primary Fire));
End;
"Use shield"
If(!Is Firing Secondary(Event Player) && Distance Between(Position Of(Event Player), Position Of(Players In Slot(0, Team 1))) > 5);
Stop Holding Button(Event Player, Button(Primary Fire));
Start Holding Button(Event Player, Button(Secondary Fire));
End;
"Use charge when player is near Rein"
If(Ability Cooldown(Event Player, Button(Ability 1)) == 0 && Distance Between(Event Player, Players In Slot(0, Team 1)) <= 3);
Press Button(Event Player, Button(Ability 1));
End;
Wait(1, Abort When False);
Loop If Condition Is True;
}
}
rule("[Aiming] [Moira] - Movement control")
{
event
{
Ongoing - Each Player;
Team 2;
Moira;
}
conditions
{
Global.chosenTraining == 1;
Is Dummy Bot(Event Player) == True;
}
actions
{
"Change Throttle direction"
Call Subroutine(ChangeDirection);
"Jump and Crouch"
If(Is On Ground(Event Player));
Start Rule(JumpAndCrouch, Do Nothing);
End;
"Use Fade when ready"
If(Ability Cooldown(Event Player, Button(Ability 1)) == 0);
Press Button(Event Player, Button(Ability 1));
End;
Wait(0.500, Abort When False);
"Use weapon"
If(!Is Firing Secondary(Event Player));
Start Holding Button(Event Player, Button(Secondary Fire));
End;
Loop If Condition Is True;
}
}
rule("[Aiming] [Winston] - Movement control")
{
event
{
Ongoing - Each Player;
Team 2;
Winston;
}
conditions
{
Global.chosenTraining == 1;
Is Dummy Bot(Event Player) == True;
}
actions
{
"Change Throttle direction"
Call Subroutine(ChangeDirection);
"Use Leap when ready"
If(Ability Cooldown(Event Player, Button(Ability 1)) == 0 && !Has Status(Event Player, Frozen));
Start Facing(Event Player, Vector(Random Real(-1, 1), Random Real(0, 1), Random Real(-1, 1)), 360, To World,
Direction and Turn Rate);
Wait(0.250, Ignore Condition);
Press Button(Event Player, Button(Ability 1));
Wait(1, Ignore Condition);
Skip If(Has Status(Event Player, Frozen), 1);
"Start facing player"
Start Facing(Event Player, Direction Towards(Eye Position(Event Player), Event Player.botFacingOffset + Eye Position(
Players In Slot(0, Team 1))), 100, To World, Direction and Turn Rate);
End;
"Use shield when player is near Winston"
If(Ability Cooldown(Event Player, Button(Ability 2)) == 0 && Distance Between(Event Player, Players In Slot(0, Team 1)) <= 8);
Press Button(Event Player, Button(Ability 2));
End;
Wait(0.500, Abort When False);
Loop If Condition Is True;
}
}
rule("[Aiming] [Dva] - Movement control")
{
event
{
Ongoing - Each Player;
Team 2;
D.Va;
}
conditions
{
Global.chosenTraining == 1;
Is Dummy Bot(Event Player) == True;
}
actions
{
"Change Throttle direction"
Call Subroutine(ChangeDirection);
"For mech dva only"
If(!Is In Alternate Form(Event Player));
"Use Boosters when ready"
If(Ability Cooldown(Event Player, Button(Ability 1)) == 0 && !Is Using Ability 1(Event Player) && !Has Status(Event Player,
Frozen));
"Random facing when player is using ability"
Start Facing(Event Player, Event Player.botFacing, 360, To World, Direction and Turn Rate);
Press Button(Event Player, Button(Ability 1));
Wait(0.500, Abort When False);
"Change facing direction throughout "
While(Is Using Ability 1(Event Player));
Event Player.botFacing = Vector(Random Real(-1, 1), Random Real(-0.500, 0.500), Random Real(-1, 1));
Wait(0.500, Abort When False);
End;
Skip If(Has Status(Event Player, Frozen), 1);
"Start facing player"
Start Facing(Event Player, Direction Towards(Eye Position(Event Player), Event Player.botFacingOffset + Eye Position(
Players In Slot(0, Team 1))), 100, To World, Direction and Turn Rate);
End;
"When in Baby Dva"
Else;
"Jump and Crouch"
If(Is On Ground(Event Player));
Start Rule(JumpAndCrouch, Do Nothing);
End;
End;
Wait(0.500, Abort When False);
Loop If Condition Is True;
}
}
rule("[Aiming] [Hanzo] - Movement control")
{
event
{
Ongoing - Each Player;
Team 2;
Hanzo;
}
conditions
{
Global.chosenTraining == 1;
Is Dummy Bot(Event Player) == True;
}
actions
{
"Change Throttle direction"
Call Subroutine(ChangeDirection);
"Jump and Crouch"
If(Is On Ground(Event Player));
Start Rule(JumpAndCrouch, Do Nothing);
End;
"Use Lunge when ready"
If(Ability Cooldown(Event Player, Button(Jump)) == 0);
Press Button(Event Player, Button(Jump));
Wait(0.250, Ignore Condition);
Press Button(Event Player, Button(Jump));
End;
"Use weapon"
Start Holding Button(Event Player, Button(Primary Fire));
Wait(Random Real(0.500, 0.800), Abort When False);
Stop Holding Button(Event Player, Button(Primary Fire));
Wait(0.500, Abort When False);
Loop If Condition Is True;
}
}
rule("[Aiming] [Tracer] - Movement control")
{
event
{
Ongoing - Each Player;
Team 2;
Tracer;
}
conditions
{
Global.chosenTraining == 1;
Is Dummy Bot(Event Player) == True;
}
actions
{
"Change Throttle direction"
Call Subroutine(ChangeDirection);
"Use blink when ready"
If(Ability Cooldown(Event Player, Button(Ability 1)) == 0);
Press Button(Event Player, Button(Ability 1));
End;
"Use recall when ready and less than 80% HP"
If(Ability Cooldown(Event Player, Button(Ability 2)) == 0 && Normalized Health(Event Player) < 0.800);
Wait(0.500, Ignore Condition);
Stop Holding Button(Event Player, Button(Primary Fire));
Press Button(Event Player, Button(Ability 2));
End;
"Jump and Crouch"
If(Is On Ground(Event Player));
Start Rule(JumpAndCrouch, Do Nothing);
End;
"Use weapon"
If(!Is Firing Primary(Event Player));
Start Holding Button(Event Player, Button(Primary Fire));
End;
Wait(0.500, Abort When False);
Loop If Condition Is True;
}
}
rule("[Aiming] [Genji] - Movement control")
{
event
{
Ongoing - Each Player;
Team 2;
Genji;
}
conditions
{
Global.chosenTraining == 1;
Is Dummy Bot(Event Player) == True;
}
actions
{
"Change Throttle direction"
Call Subroutine(ChangeDirection);
"Choosing which ability to use"
If(Ability Cooldown(Event Player, Button(Ability 1)) == 0 && Ability Cooldown(Event Player, Button(Ability 2))
== 0 && !Is Using Ability 2(Event Player));
Event Player.botState = Random Integer(1, 2);
Else If(Ability Cooldown(Event Player, Button(Ability 1)) == 0);
Event Player.botState = 1;
Else;
Event Player.botState = 2;
End;
"Use Dash"
If(Event Player.botState == 1 && !Is Using Ability 2(Event Player) && !Has Status(Event Player, Frozen));
Start Facing(Event Player, Vector(Random Real(-1, 1), Random Real(0, 1), Random Real(-1, 1)), 360, To World,
Direction and Turn Rate);
Wait(0.250, Ignore Condition);
Press Button(Event Player, Button(Ability 1));
Wait(0.250, Ignore Condition);
Skip If(Has Status(Event Player, Frozen), 1);
"Start facing player"
Start Facing(Event Player, Direction Towards(Eye Position(Event Player), Event Player.botFacingOffset + Eye Position(
Players In Slot(0, Team 1))), 100, To World, Direction and Turn Rate);
"Use deflect"
Else If(Event Player.botState == 2 && !Is Using Ability 2(Event Player));
Press Button(Event Player, Button(Ability 2));
End;
"Use weapon"
If(!Is Firing Primary(Event Player) && !Is Using Ability 2(Event Player));
Start Holding Button(Event Player, Button(Primary Fire));
End;
Wait(0.500, Abort When False);
Loop If Condition Is True;
}
}
rule("[Aiming] [Genji] - Double Jump control")
{
event
{
Ongoing - Each Player;
Team 2;
Genji;
}
conditions
{
Global.chosenTraining == 1;
Is Dummy Bot(Event Player) == True;
Is On Ground(Event Player) == True;
}
actions
{
Press Button(Event Player, Button(Jump));
Wait(0.500, Ignore Condition);
Press Button(Event Player, Button(Jump));
}
}
rule("[Aiming] [Doomfist] - Movement control")
{
event
{
Ongoing - Each Player;
Team 2;
Doomfist;
}
conditions
{
Global.chosenTraining == 1;
Is Dummy Bot(Event Player) == True;
}
actions
{
"Change Throttle direction"
Call Subroutine(ChangeDirection);
"Use abilities"
If(Event Player.botState == 0 && !Is Firing Secondary(Event Player) && !Is Using Ability 1(Event Player) && !Is Using Ability 2(
Event Player));
Event Player.botState = Random Integer(1, 3);
End;
Wait(0.500, Abort When False);
Loop If Condition Is True;
}
}
rule("[Aiming] [Doomfist] - Abilities control")
{
event
{
Ongoing - Each Player;
Team 2;
Doomfist;
}
conditions
{
Global.chosenTraining == 1;
Is Dummy Bot(Event Player) == True;
Event Player.botState > 0;
}
actions
{
If(Event Player.botState == 1 && Ability Cooldown(Event Player, Button(Secondary Fire)) == 0);
Start Holding Button(Event Player, Button(Secondary Fire));
Wait(Random Integer(0.700, 1.400), Ignore Condition);
Stop Holding Button(Event Player, Button(Secondary Fire));
Else If(Event Player.botState == 2 && Ability Cooldown(Event Player, Button(Ability 1)) == 0);
Press Button(Event Player, Button(Ability 1));
Else If(Event Player.botState == 3 && Ability Cooldown(Event Player, Button(Ability 2)) == 0);
Press Button(Event Player, Button(Ability 2));
End;
Wait(0.250, Ignore Condition);
Event Player.botState = 0;
}
}
rule("[Aiming] [Lucio] - Movement control")
{
event
{
Ongoing - Each Player;
Team 2;
Lúcio;
}
conditions
{
Global.chosenTraining == 1;
Is Dummy Bot(Event Player) == True;
}
actions
{
"Change Throttle direction"
Call Subroutine(ChangeDirection);
"Jump and Crouch"
If(Is On Ground(Event Player));
Start Rule(JumpAndCrouch, Do Nothing);
End;
"Use amp it up"
If(Ability Cooldown(Event Player, Button(Ability 2)) == 0 && !Is Using Ability 2(Event Player));
Press Button(Event Player, Button(Ability 2));
End;
"Change to speed song"
If(Normalized Health(Event Player) >= 1 && !Is In Alternate Form(Event Player));
Press Button(Event Player, Button(Ability 1));
"Change to heal song"
Else If(Normalized Health(Event Player) < 0.800 && Is In Alternate Form(Event Player));
Press Button(Event Player, Button(Ability 1));
End;
"Use boop"
If(Ability Cooldown(Event Player, Button(Secondary Fire)) == 0 && !Is Using Ability 2(Event Player) && Distance Between(
Event Player, Players In Slot(0, Team 1)) < 8);
Press Button(Event Player, Button(Secondary Fire));
End;
Wait(0.500, Abort When False);
Loop If Condition Is True;
}
}
rule("[Aiming] [Echo] - Movement control")
{
event
{
Ongoing - Each Player;
Team 2;
Echo;
}
conditions
{
Global.chosenTraining == 1;
Is Dummy Bot(Event Player) == True;
}
actions
{
"Change Throttle direction"
Call Subroutine(ChangeDirection);
"Use flight when ready"
If(Ability Cooldown(Event Player, Button(Ability 1)) == 0 && !Is Using Ability 1(Event Player) && !Has Status(Event Player,
Frozen));
"Random facing when player is using ability"
Start Facing(Event Player, Event Player.botFacing, 360, To World, Direction and Turn Rate);
Press Button(Event Player, Button(Ability 1));
Wait(0.500, Abort When False);
Start Holding Button(Event Player, Button(Jump));
"Change facing direction throughout "
While(Is Using Ability 1(Event Player));
Event Player.botFacing = Vector(Random Real(-1, 1), Random Real(0, 0.750), Random Real(-1, 1));
Event Player.botThrottle = Vector(Random Real(-1, 1), 0, 1);
Wait(0.500, Abort When False);
End;
Skip If(Has Status(Event Player, Frozen), 1);
"Start facing player"
Start Facing(Event Player, Direction Towards(Eye Position(Event Player), Event Player.botFacingOffset + Eye Position(
Players In Slot(0, Team 1))), 100, To World, Direction and Turn Rate);
End;
"Stop gliding"
If(Is On Ground(Event Player) && !Is Using Ability 1(Event Player));
Stop Holding Button(Event Player, Button(Jump));
End;
Wait(0.500, Abort When False);
Loop If Condition Is True;
}
}
rule("[Aiming] [Pharah] - Movement control")
{
event
{
Ongoing - Each Player;
Team 2;
Pharah;
}
conditions
{
Global.chosenTraining == 1;
Is Dummy Bot(Event Player) == True;
}
actions
{
"Change Throttle direction"
Call Subroutine(ChangeDirection);
"Use jump jet when ready"
If(Ability Cooldown(Event Player, Button(Ability 1)) == 0 && Altitude Of(Event Player) < 10);
Press Button(Event Player, Button(Ability 1));
End;
"Use concussion blast"
If(Ability Cooldown(Event Player, Button(Ability 2)) == 0);
Press Button(Event Player, Button(Ability 2));
End;
"Use weapon"
Press Button(Event Player, Button(Primary Fire));
Wait(0.500, Abort When False);
Loop If Condition Is True;
}
}
rule("[Aiming] [Pharah] - Hover control")
{
event
{
Ongoing - Each Player;
Team 2;
Pharah;
}
conditions
{
Global.chosenTraining == 1;
Is Dummy Bot(Event Player) == True;
Is In Air(Event Player) == True;
}
actions
{
"Hover"
Start Holding Button(Event Player, Button(Jump));
Wait(Random Real(0.250, 1), Ignore Condition);
Stop Holding Button(Event Player, Button(Jump));
Wait(0.500, Abort When False);
Loop If Condition Is True;
}
}
rule("[Aiming] [Widow] - Movement control")
{
event
{
Ongoing - Each Player;
Team 2;
Widowmaker;
}
conditions
{
Global.chosenTraining == 1;
Is Dummy Bot(Event Player) == True;
}
actions
{
"Change Throttle direction"
Call Subroutine(ChangeDirection);
"Jump and Crouch"
If(Is On Ground(Event Player));
Start Rule(JumpAndCrouch, Do Nothing);
End;
"Use grappling hook when ready"
If(Ability Cooldown(Event Player, Button(Ability 1)) == 0 && !Has Status(Event Player, Frozen));
Stop Holding Button(Event Player, Button(Secondary Fire));
Start Facing(Event Player, Vector(Random Real(-1, 1), Random Real(-0.250, -0.100), Random Real(-1, 1)), 360, To World,
Direction and Turn Rate);
Wait(0.250, Ignore Condition);
Press Button(Event Player, Button(Ability 1));
Wait(0.250, Ignore Condition);
Skip If(Has Status(Event Player, Frozen), 1);
"Start facing player"
Start Facing(Event Player, Direction Towards(Eye Position(Event Player), Event Player.botFacingOffset + Eye Position(
Players In Slot(0, Team 1))), 100, To World, Direction and Turn Rate);
End;
Wait(0.250, Abort When False);
"Use scope"
If(!Is Firing Secondary(Event Player));
Start Holding Button(Event Player, Button(Secondary Fire));
End;
Wait(Random Real(0.600, 0.900), Abort When False);
"Fire weapon"
Press Button(Event Player, Button(Primary Fire));
Wait(0.500, Abort When False);
Loop If Condition Is True;
}
}
rule("[Aiming] [Ashe] - Movement control")
{
event
{
Ongoing - Each Player;
Team 2;
Ashe;
}
conditions
{
Global.chosenTraining == 1;
Is Dummy Bot(Event Player) == True;
}
actions
{
"Change Throttle direction"
Call Subroutine(ChangeDirection);
"Jump and Crouch"
If(Is On Ground(Event Player));
Start Rule(JumpAndCrouch, Do Nothing);
End;
"Refill ammo"
If(Ammo(Event Player, 0) == 0);
Set Ammo(Event Player, 0, Max Ammo(Event Player, 0));
End;
"Use coach gun when ready"
If(Ability Cooldown(Event Player, Button(Ability 1)) == 0 && !Has Status(Event Player, Frozen));
Stop Holding Button(Event Player, Button(Secondary Fire));
Start Facing(Event Player, Vector(Random Real(-1, 1), Random Real(-1, 0), Random Real(-1, 1)), 360, To World,
Direction and Turn Rate);
Wait(0.250, Ignore Condition);
Press Button(Event Player, Button(Ability 1));
Wait(0.250, Ignore Condition);
Skip If(Has Status(Event Player, Frozen), 1);
"Start facing player"
Start Facing(Event Player, Direction Towards(Eye Position(Event Player), Event Player.botFacingOffset + Eye Position(
Players In Slot(0, Team 1))), 100, To World, Direction and Turn Rate);
End;
"Use hipfire"
If(Event Player.botState == 0);
If(Is Firing Secondary(Event Player));
Stop Holding Button(Event Player, Button(Secondary Fire));
End;
"Fire weapon"
Press Button(Event Player, Button(Primary Fire));
Wait(0.250, Abort When False);
Press Button(Event Player, Button(Primary Fire));
Wait(0.250, Abort When False);
"Use scope"
Else;
If(!Is Firing Secondary(Event Player));
Start Holding Button(Event Player, Button(Secondary Fire));
Wait(0.250, Abort When False);
End;
"Fire weapon"
Press Button(Event Player, Button(Primary Fire));
Wait(0.700, Abort When False);
End;
Loop If Condition Is True;
}
}
rule("[Aiming] [Ashe] - Scope/unscope control")
{
event
{
Ongoing - Each Player;
Team 2;
Ashe;
}
conditions
{
Global.chosenTraining == 1;
Is Dummy Bot(Event Player) == True;
}
actions
{
Event Player.botState = Random Integer(0, 1);
Wait(Random Real(1, 3), Abort When False);
Loop If Condition Is True;
}
}
rule("[Aiming] [Mei] - Movement control")
{
event
{
Ongoing - Each Player;
Team 2;
Mei;
}
conditions
{
Global.chosenTraining == 1;
Is Dummy Bot(Event Player) == True;
}
actions
{
"Change Throttle direction"
Call Subroutine(ChangeDirection);
"Jump and Crouch"
If(Is On Ground(Event Player));
Start Rule(JumpAndCrouch, Do Nothing);
End;
"Use cryofreeze when ready"
If(Ability Cooldown(Event Player, Button(Ability 1)) == 0 && Normalized Health(Event Player) < 0.500 && !Is Using Ability 1(
Event Player));
Stop Holding Button(Event Player, Button(Secondary Fire));
Stop Holding Button(Event Player, Button(Primary Fire));
Press Button(Event Player, Button(Ability 1));
End;
Wait(0.250, Abort When False);
"Use primary fire"
If(Distance Between(Event Player, Players In Slot(0, Team 1)) < 10 && !Has Status(Players In Slot(0, Team 1), Frozen)
&& !Is Firing Primary(Event Player) && !Is Using Ability 1(Event Player));
Stop Holding Button(Event Player, Button(Secondary Fire));
Start Holding Button(Event Player, Button(Primary Fire));
End;
"Use secondary fire"
If((Distance Between(Event Player, Players In Slot(0, Team 1)) >= 10 || Has Status(Players In Slot(0, Team 1), Frozen))
&& !Is Firing Secondary(Event Player) && !Is Using Ability 1(Event Player));
Stop Holding Button(Event Player, Button(Primary Fire));
Start Holding Button(Event Player, Button(Secondary Fire));
End;
Wait(0.500, Abort When False);
Loop If Condition Is True;
}
}
rule("[Aiming] [Subroutine] - Change throttle and facing direction")
{
event
{
Subroutine;
ChangeDirection;
}
actions
{
"Change movement direction"
If(Distance Between(Position Of(Event Player), Vector(0, Y Component Of(Position Of(Event Player)), 0)) <= 18);
Event Player.botThrottle = Vector(Random Real(-1, 1), 0, Random Real(-1, 1));
Else;
Event Player.botThrottle = Local Vector Of(Direction Towards(Position Of(Event Player), Vector(Random Real(-15, 15), 0,
Random Real(-15, 15))), Event Player, Rotation);
End;
Event Player.botFacingOffset = Vector(Random Real(Global.botAimingAccuracy * -1, Global.botAimingAccuracy), Random Real(
Global.botAimingAccuracy * -1, Global.botAimingAccuracy), Random Real(Global.botAimingAccuracy * -1,
Global.botAimingAccuracy));
}
}
rule("[Aiming] [Subroutine] - Jumping/Crouching Control")
{
event
{
Subroutine;
JumpAndCrouch;
}
actions
{
If(Random Integer(0, 1) == 0 && Hero Of(Event Player) != Hero(Widowmaker));
Press Button(Event Player, Button(Jump));
Else;
Start Holding Button(Event Player, Button(Crouch));
Wait(Random Integer(0.250, 0.750), Ignore Condition);
Stop Holding Button(Event Player, Button(Crouch));
End;
}
}
rule("[Aiming] - If frozen, stop facing")
{
event
{
Ongoing - Each Player;
Team 2;
All;
}
conditions
{
Global.chosenTraining == 1;
Has Status(Event Player, Frozen) == True;
}
actions
{
Stop Facing(Event Player);
}
}
rule("[Aiming] - If not frozen, start facing again")
{
event
{
Ongoing - Each Player;
Team 2;
All;
}
conditions
{
Global.chosenTraining == 1;
Has Status(Event Player, Frozen) == False;
}
actions
{
If(Hero Of(Event Player) == Hero(Mercy));
"Start facing "
Start Facing(Event Player, Direction Towards(Eye Position(Event Player), Event Player.botFacingOffset + Eye Position(
Random Value In Array(Remove From Array(All Players(Team 2), Event Player)))), 180, To World, Direction and Turn Rate);
Else;
"Start facing"
Start Facing(Event Player, Direction Towards(Eye Position(Event Player), Eye Position(Players In Slot(0, Team 1))), 100, To World,
Direction and Turn Rate);
End;
}
}
rule("[Aiming] - Bot died")
{
event
{
Player Died;
All;
All;
}
conditions
{
Global.chosenTraining == 1;
Is Dummy Bot(Event Player) == True;
}
actions
{
Stop Facing(Event Player);
Stop Throttle In Direction(Event Player);
}
}
disabled rule("---- Aim Training Modifiers -----")
{
event
{
Ongoing - Global;
}
}
rule("[Aiming Modifiers] - Enable modifiers")
{
event
{
Ongoing - Each Player;
Team 1;
Slot 0;
}
conditions
{
Global.chosenTraining == 1;
Is Button Held(Event Player, Button(Primary Fire)) == True;
Global.isUIHidden == False;
Is True For Any(Global.aimingModifier_ButtonPos, Distance Between(Current Array Element, Ray Cast Hit Position(Eye Position(
Event Player), Eye Position(Event Player) + Facing Direction Of(Event Player) * Distance Between(Eye Position(Event Player),
Current Array Element), Null, Event Player, True)) <= 1) == True;
}
actions
{
Wait(0.500, Abort When False);
"Find the modifier that is selected"
Global.controlIndex = Index Of Array Value(Global.aimingModifier_ButtonPos, First Of(Sorted Array(Filtered Array(
Global.aimingModifier_ButtonPos, Distance Between(Current Array Element, Ray Cast Hit Position(Eye Position(Event Player),
Eye Position(Event Player) + Facing Direction Of(Event Player) * Distance Between(Eye Position(Event Player),
Current Array Element), Null, Event Player, True)) <= 1), Distance Between(Eye Position(Event Player),
Current Array Element))));
Abort If(Global.controlIndex == -1);
"if the selected modifier is not active"
If(Global.aimingModifier_isEnabled[Global.controlIndex] == False);
disabled Small Message(All Players(Team 1), Custom String("{0}: {1}", Global.aimingModifier_ButtonTexts[Global.controlIndex], Icon String(
Checkmark)));
Play Effect(Event Player, Buff Explosion Sound, Color(White), Event Player, 100);
Global.aimingModifier_isEnabled[Global.controlIndex] = True;
Else;
disabled Small Message(All Players(Team 1), Custom String("{0}: {1}", Global.aimingModifier_ButtonTexts[Global.controlIndex], Icon String(
X)));
Play Effect(Event Player, Ring Explosion Sound, Color(White), Event Player, 100);
Global.aimingModifier_isEnabled[Global.controlIndex] = False;
End;
}
}
rule("[Aiming Modifiers] [More HP] Give enemy bots more HP")
{
event
{
Ongoing - Global;
}
conditions
{
Global.chosenTraining == 1;
Global.aimingModifier_isEnabled[0] == True;
}
actions
{
Set Max Health(All Players(Team 2), 1000);
Wait(0.100, Ignore Condition);
Heal(All Players(Team 2), Null, 10000);
}
}
rule("[Aiming Modifiers] [More HP] Disable")
{
event
{
Ongoing - Global;
}
conditions
{
Global.chosenTraining == 1;
Global.aimingModifier_isEnabled[0] == False;
}
actions
{
Set Max Health(All Players(Team 2), 100);
}
}
rule("[Aiming Modifiers] [Enemy Mercy] Spawn enemy Mercy")
{
event
{
Ongoing - Global;
}
conditions
{
Global.chosenTraining == 1;
Global.aimingModifier_isEnabled[1] == True;
}
actions
{
"Despawns the old one bot that will be replaced"
If(Global.multipleBots && Entity Exists(Players In Slot(5, Team 2)));
Global.trainingButton_isEnabled[Index Of Array Value(Global.aiming_EnemyHeroes, Hero Of(Players In Slot(5, Team 2)))] = False;
End;
Create Dummy Bot(Hero(Mercy), Team 2, 5, Vector(0, 0, 0), Vector(0, 0, 0));
}
}
rule("[Aiming Modifiers] [Enemy Mercy] Disable")
{
event
{
Ongoing - Global;
}
conditions
{
Global.chosenTraining == 1;
Global.aimingModifier_isEnabled[1] == False;
}
actions
{
Destroy Dummy Bot(Team 2, 5);
}
}
rule("[Aiming Modifiers] [Enemy Mercy] Init enemy Mercy")
{
event
{
Ongoing - Each Player;
Team 2;
Mercy;
}
conditions
{
Global.chosenTraining == 1;
Is Dummy Bot(Event Player) == True;
Is Alive(Event Player) == True;
}
actions
{
"Start moving"
Start Throttle In Direction(Event Player, Event Player.botThrottle, 1, To Player, Replace existing throttle,
Direction and Magnitude);
"Start facing "
Start Facing(Event Player, Direction Towards(Eye Position(Event Player), Event Player.botFacingOffset + Eye Position(
Random Value In Array(Remove From Array(All Players(Team 2), Event Player)))), 180, To World, Direction and Turn Rate);
"Set to staff"
Set Weapon(Event Player, 1);
"For GA"
Start Holding Button(Event Player, Button(Jump));
"More HP if the mode has more nemey health enabled"
If(Global.aimingModifier_isEnabled[0]);
Set Max Health(Event Player, 1000);
Wait(0.100, Ignore Condition);
Set Player Health(Event Player, Max Health(Event Player));
End;
}
}
rule("[Aiming Modifiers] [Enemy Mercy] Use GA, heal/damage boost and move around")
{
event
{
Ongoing - Each Player;
Team 2;
Mercy;
}
conditions
{
Global.chosenTraining == 1;
Is Dummy Bot(Event Player) == True;
}
actions
{
"Change Throttle direction"
Call Subroutine(ChangeDirection);
"Holding GA"
If(Ability Cooldown(Event Player, Button(Ability 1)) == 0 && !Is Using Ability 1(Event Player));
Start Holding Button(Event Player, Button(Ability 1));
Wait(Random Real(1, 3), Ignore Condition);
Stop Holding Button(Event Player, Button(Ability 1));
End;
"Give enemy heal or damage boost"
If(Is True For Any(Remove From Array(All Players(Team 2), Event Player), Normalized Health(Current Array Element) <= 0.800)
&& !Is Button Held(Event Player, Button(Primary Fire)));
"Heal the lowest HP player"
Start Facing(Event Player, Direction Towards(Eye Position(Event Player), Event Player.botFacingOffset + Eye Position(First Of(
Sorted Array(Remove From Array(All Players(Team 2), Event Player), Normalized Health(Current Array Element))))), 180, To World,
Direction and Turn Rate);
Stop Holding Button(Event Player, Button(Secondary Fire));
Wait(0.250, Ignore Condition);
Start Holding Button(Event Player, Button(Primary Fire));
Else If(Is True For All(Remove From Array(All Players(Team 2), Event Player), Normalized Health(Current Array Element) > 0.800)
&& !Is Button Held(Event Player, Button(Secondary Fire)));
"Damage boost a random player"
Start Facing(Event Player, Direction Towards(Eye Position(Event Player), Event Player.botFacingOffset + Eye Position(
Random Value In Array(Remove From Array(All Players(Team 2), Event Player)))), 180, To World, Direction and Turn Rate);
Stop Holding Button(Event Player, Button(Primary Fire));
Wait(0.250, Ignore Condition);
Start Holding Button(Event Player, Button(Secondary Fire));
End;
Wait(0.500, Abort When False);
Loop If Condition Is True;
}
}
rule("[Aiming Modifiers] [Enemy Mercy] If enemy is still low HP, re-attach the beam")
{
event
{
Ongoing - Each Player;
Team 2;
Mercy;
}
conditions
{
Global.chosenTraining == 1;
Is Dummy Bot(Event Player) == True;
Is Button Held(Event Player, Button(Primary Fire)) == True;
}
actions
{
Wait(3, Abort When False);
Stop Holding Button(Event Player, Button(Primary Fire));
}
}
rule("[Aiming Modifiers] [Invincible] Give player unkillable")
{
event
{
Ongoing - Global;
}
conditions
{
Global.chosenTraining == 1;
Global.aimingModifier_isEnabled[2] == True;
}
actions
{
Set Status(Players In Slot(0, Team 1), Null, Unkillable, 9999);
}
}
rule("[Aiming Modifiers] [Invincible] Disable")
{
event
{
Ongoing - Global;
}
conditions
{
Global.chosenTraining == 1;
Global.aimingModifier_isEnabled[2] == False;
}
actions
{
Clear Status(Players In Slot(0, Team 1), Unkillable);
}
}
rule("[Aiming Modifiers] [Ally Mercy] Spawn ally Mercy")
{
event
{
Ongoing - Global;
}
conditions
{
Global.chosenTraining == 1;
Global.aimingModifier_isEnabled[3] == True;
}
actions
{
Create Dummy Bot(Hero(Mercy), Team 1, 1, Vector(0, 0, 0), Vector(0, 0, 0));
}
}
rule("[Aiming Modifiers] [Ally Mercy] Disable")
{
event
{
Ongoing - Global;
}
conditions
{
Global.chosenTraining == 1;
Global.aimingModifier_isEnabled[3] == False;
}
actions
{
Destroy Dummy Bot(Team 1, 1);
}
}
rule("[Aiming Modifiers] [Ally Mercy] Init ally Mercy")
{
event
{
Ongoing - Each Player;
Team 1;
Mercy;
}
conditions
{
Global.chosenTraining == 1;
Is Dummy Bot(Event Player) == True;
Is Alive(Event Player) == True;
}
actions
{
"Start moving"
Start Throttle In Direction(Event Player, Event Player.botThrottle, 1, To Player, Replace existing throttle,
Direction and Magnitude);
"Start facing player"
Start Facing(Event Player, Direction Towards(Eye Position(Event Player), Event Player.botFacingOffset + Eye Position(
Players In Slot(0, Team 1))), 180, To World, Direction and Turn Rate);
"Set to staff"
Set Weapon(Event Player, 1);
"For GA"
Start Holding Button(Event Player, Button(Jump));
}
}
rule("[Aiming Modifiers] [Ally Mercy] Use GA, heal/damage boost and move around")
{
event
{
Ongoing - Each Player;
Team 1;
Mercy;
}
conditions
{
Global.chosenTraining == 1;
Is Dummy Bot(Event Player) == True;
}
actions
{
"Change Throttle direction"
Call Subroutine(ChangeDirection);
"Holding GA"
If(Ability Cooldown(Event Player, Button(Ability 1)) == 0 && !Is Using Ability 1(Event Player));
Start Holding Button(Event Player, Button(Ability 1));
Wait(Random Real(1, 3), Ignore Condition);
Stop Holding Button(Event Player, Button(Ability 1));
End;
"Give you heal or damage boost"
If(Normalized Health(Players In Slot(0, Team 1)) <= 0.800 && !Is Button Held(Event Player, Button(Primary Fire)));
Stop Holding Button(Event Player, Button(Secondary Fire));
Start Holding Button(Event Player, Button(Primary Fire));
Else If(Normalized Health(Players In Slot(0, Team 1)) >= 1 && !Is Button Held(Event Player, Button(Secondary Fire)));
Stop Holding Button(Event Player, Button(Primary Fire));
Start Holding Button(Event Player, Button(Secondary Fire));
End;
Wait(0.500, Abort When False);
Loop If Condition Is True;
}
}
rule("[Aiming Modifiers] [Infinite Reload]")
{
event
{
Ongoing - Each Player;
Team 1;
Slot 0;
}
conditions
{
Global.chosenTraining == 1;
Global.aimingModifier_isEnabled[4] == True;
"If left 10% ammo, reload"
Ammo(Event Player, 0) < Max Ammo(Event Player, 0) * 0.100;
}
actions
{
Set Ammo(Event Player, 0, Max Ammo(Event Player, 0));
}
}
rule("[Aiming Modifiers] [Middle Wall] Spawn ally Mei for the middle wall")
{
event
{
Ongoing - Global;
}
conditions
{
Global.chosenTraining == 1;
Global.aimingModifier_isEnabled[5] == True;
}
actions
{
Create Dummy Bot(Hero(Mei), Team 1, 2, Vector(0, 0, 0), Vector(0, 0, 0));
Create Dummy Bot(Hero(Mei), Team 1, 3, Vector(0, 0, 0), Vector(0, 0, 0));
Players In Slot(2, Team 1).botSpawnLocation = Vector(6, 20, 0);
Players In Slot(2, Team 1).botSpawnFacing = Vector(-0.020, -1, 0);
Players In Slot(3, Team 1).botSpawnLocation = Vector(6, 20, 0);
Players In Slot(3, Team 1).botSpawnFacing = Vector(0, -1, 0.020);
}
}
rule("[Aiming Modifiers] [Middle Wall] Disable")
{
event
{
Ongoing - Global;
}
conditions
{
Global.chosenTraining == 1;
Global.aimingModifier_isEnabled[5] == False;
}
actions
{
Destroy Dummy Bot(Team 1, 2);
Destroy Dummy Bot(Team 1, 3);
}
}
rule("[Aiming Modifiers] [Middle Wall] Init the Meis")
{
event
{
Ongoing - Each Player;
Team 1;
Mei;
}
conditions
{
Global.chosenTraining == 1;
Global.aimingModifier_isEnabled[5] == True;
Is Dummy Bot(Event Player) == True;
}
actions
{
Set Status(Event Player, Null, Phased Out, 9999);
Set Invisible(Event Player, All);
Wait(0.100, Ignore Condition);
Start Forcing Player Position(Event Player, Event Player.botSpawnLocation, False);
Set Facing(Event Player, Event Player.botSpawnFacing, To World);
}
}
rule("[Aiming Modifiers] [Middle Wall] Mei uses their walls")
{
event
{
Ongoing - Global;
}
conditions
{
Global.chosenTraining == 1;
Global.aimingModifier_isEnabled[5] == True;
}
actions
{
Wait(0.050, Abort When False);
"Prepare to use ice walls"
Press Button(Players In Slot(2, Team 1), Button(Ability 2));
Press Button(Players In Slot(3, Team 1), Button(Ability 2));
Wait(0.250, Abort When False);
"Use the ice walls"
Press Button(Players In Slot(2, Team 1), Button(Primary Fire));
Wait(0.050, Abort When False);
Press Button(Players In Slot(3, Team 1), Button(Primary Fire));
Wait Until(!Is Using Ability 2(Players In Slot(3, Team 1)), 6);
"Reset wall cooldown"
Set Ability Cooldown(Players In Slot(2, Team 1), Button(Ability 2), 0);
Set Ability Cooldown(Players In Slot(3, Team 1), Button(Ability 2), 0);
Loop If Condition Is True;
}
}
disabled rule("----- Reaction Training -----")
{
event
{
Ongoing - Global;
}
}
rule("[Reaction] - Init settings")
{
event
{
Ongoing - Global;
}
conditions
{
Global.chosenTraining == 2;
}
actions
{
"Set false for the button"
For Global Variable(controlIndex, 0, Count Of(Global.reaction_ButtonPos), 1);
Global.trainingButton_isEnabled[Global.controlIndex] = False;
End;
Global.testIsRunning = False;
}
}
rule("[Reaction] - Teleport player to the centre ring")
{
event
{
Ongoing - Each Player;
Team 1;
Slot 0;
}
conditions
{
Global.chosenTraining == 2;
Global.testIsRunning == False;
Distance Between(Position Of(Event Player), Vector(0, 0, 0)) > 2;
}
actions
{
Teleport(Event Player, Vector(0, 0, 0));
Small Message(Event Player, Custom String("Stay in the circle"));
}
}
rule("[Reaction] - Choosing Enemy")
{
event
{
Ongoing - Each Player;
Team 1;
Slot 0;
}
conditions
{
Global.chosenTraining == 2;
Is Button Held(Event Player, Button(Primary Fire)) == True;
Global.isUIHidden == False;
Is True For Any(Global.reaction_ButtonPos, Distance Between(Current Array Element, Ray Cast Hit Position(Eye Position(
Event Player), Eye Position(Event Player) + Facing Direction Of(Event Player) * Distance Between(Eye Position(Event Player),
Current Array Element), Null, Event Player, True)) <= 1) == True;
}
actions
{
Wait(0.500, Abort When False);
"Find the hero that is selected"
Global.controlIndex = Index Of Array Value(Global.reaction_ButtonPos, First Of(Sorted Array(Filtered Array(
Global.reaction_ButtonPos, Distance Between(Current Array Element, Ray Cast Hit Position(Eye Position(Event Player),
Eye Position(Event Player) + Facing Direction Of(Event Player) * Distance Between(Eye Position(Event Player),
Current Array Element), Null, Event Player, True)) <= 1), Distance Between(Eye Position(Event Player),
Current Array Element))));
Abort If(Global.controlIndex == -1);
"if the selected hero is active"
If(Entity Exists(Players In Slot(0, Team 2)));
Global.trainingButton_isEnabled[Index Of Array Value(Global.reaction_EnemyHeroes, Hero Of(Players In Slot(0, Team 2)))] = False;
End;
"If the selected hero is the same as the active hero, despawn the bot"
If(Global.reaction_EnemyHeroes[Global.controlIndex] == Hero Of(Players In Slot(0, Team 2)));
Destroy Dummy Bot(Team 2, 0);
Play Effect(Event Player, Ring Explosion Sound, Color(White), Event Player, 100);
Abort;
End;
"Created dummy bot that is different from the active one"
Create Dummy Bot(Global.reaction_EnemyHeroes[Global.controlIndex], Team 2, 0, Array Contains(Global.reaction_LargerDistanceHeroes,
Global.reaction_EnemyHeroes[Global.controlIndex]) ? Vector(0, 0, 10) : Vector(0, 0, 5), Vector(0, 0, 0));
Global.trainingButton_isEnabled[Global.controlIndex] = True;
Play Effect(Event Player, Buff Explosion Sound, Color(White), Event Player, 100);
}
}
rule("[Reaction] [All] - Init the Enemies")
{
event
{
Ongoing - Each Player;
Team 2;
Slot 0;
}
conditions
{
Global.chosenTraining == 2;
}
actions
{
Global.testIsRunning = False;
Wait(0.100, Ignore Condition);
Set Status(Event Player, Null, Invincible, 9999);
Start Facing(Event Player, Direction Towards(Eye Position(Event Player), Eye Position(Players In Slot(False, Team 1))), 360,
To World, Direction and Turn Rate);
}
}
rule("[Reaction] [All] - Start the reaction test")
{
event
{
Ongoing - Each Player;
Team 2;
Slot 0;
}
conditions
{
Global.chosenTraining == 2;
Global.testIsRunning == False;
}
actions
{
Teleport(Event Player, Array Contains(Global.reaction_LargerDistanceHeroes, Hero Of(Event Player)) ? Vector(0, 0, 10) : Vector(0,
0, 5));
Wait(Random Real(3, 6), Abort When False);
Global.testIsRunning = True;
}
}
rule("[Reaction] [Sigma] - Abilities control")
{
event
{
Ongoing - Each Player;
Team 2;
Sigma;
}
conditions
{
Global.chosenTraining == 2;
Global.testIsRunning == True;
}
actions
{
"Using Rock"
If(Random Integer(0, 1) == 0);
Set Ability Cooldown(Event Player, Button(Ability 2), 0);
Press Button(Event Player, Button(Ability 2));
"Using Ultimate"
Else;
Set Ultimate Charge(Event Player, 100);
Press Button(Event Player, Button(Ultimate));
Start Facing(Event Player, Direction Towards(Eye Position(Event Player), Position Of(Players In Slot(0, Team 1))), 360, To World,
Direction and Turn Rate);
Wait(Random Real(0.700, 1.500), Ignore Condition);
Press Button(Event Player, Button(Primary Fire));
Wait(1, Ignore Condition);
Start Facing(Event Player, Direction Towards(Eye Position(Event Player), Eye Position(Players In Slot(0, Team 1))), 360, To World,
Direction and Turn Rate);
End;
}
}
rule("[Reaction] [Wrecking Ball] - Abilities control")
{
event
{
Ongoing - Each Player;
Team 2;
Wrecking Ball;
}
conditions
{
Global.chosenTraining == 2;
Global.testIsRunning == True;
}
actions
{
"Use piledriver"
Set Ability Cooldown(Event Player, Button(Crouch), 0);
Teleport(Event Player, Position Of(Event Player) + Vector(Random Real(-5, 5), 8, Random Real(-5, 5)));
Wait(0.100, Ignore Condition);
Press Button(Event Player, Button(Crouch));
}
}
rule("[Reaction] [Reinhardt] - Abilities control")
{
event
{
Ongoing - Each Player;
Team 2;
Reinhardt;
}
conditions
{
Global.chosenTraining == 2;
Global.testIsRunning == True;
}
actions
{
"Use charge"
If(Random Integer(0, 1) == 0);
Set Ability Cooldown(Event Player, Button(Ability 1), 0);
Press Button(Event Player, Button(Ability 1));
"Use Shatter"
Else;
Set Ultimate Charge(Event Player, 100);
Press Button(Event Player, Button(Ultimate));
End;
}
}
rule("[Reaction] [Dva] - Abilities control")
{
event
{
Ongoing - Each Player;
Team 2;
D.Va;
}
conditions
{
Global.chosenTraining == 2;
Global.testIsRunning == True;
}
actions
{
"Self destruct"
Skip If(Is In Alternate Form(Event Player), 2);
Set Ultimate Charge(Event Player, 100);
Press Button(Event Player, Button(Ultimate));
Wait(3, Ignore Condition);
"Call mech"
Skip If(!Is In Alternate Form(Event Player), 2);
Set Ultimate Charge(Event Player, 100);
Press Button(Event Player, Button(Ultimate));
}
}
rule("[Reaction] [Tracer] - Abilities control")
{
event
{
Ongoing - Each Player;
Team 2;
Tracer;
}
conditions
{
Global.chosenTraining == 2;
Global.testIsRunning == True;
}
actions
{
"Use pulse bomb"
Set Ultimate Charge(Event Player, 100);
Press Button(Event Player, Button(Ultimate));
}
}
rule("[Reaction] [Sombra] - Abilities control")
{
event
{
Ongoing - Each Player;
Team 2;
Sombra;
}
conditions
{
Global.chosenTraining == 2;
Global.testIsRunning == True;
}
actions
{
"Use Hack"
If(Random Integer(0, 1) == 0);
Set Ability Cooldown(Event Player, Button(Secondary Fire), 0);
Start Holding Button(Event Player, Button(Secondary Fire));
Wait(1, Ignore Condition);
Stop Holding Button(Event Player, Button(Secondary Fire));
"Use EMP"
Else;
Set Ultimate Charge(Event Player, 100);
Press Button(Event Player, Button(Ultimate));
End;
}
}
rule("[Reaction] [Ana] - Abilities control")
{
event
{
Ongoing - Each Player;
Team 2;
Ana;
}
conditions
{
Global.chosenTraining == 2;
Global.testIsRunning == True;
}
actions
{
"Use sleep dart"
Set Ability Cooldown(Event Player, Button(Ability 1), 0);
Press Button(Event Player, Button(Ability 1));
Wait(2, Ignore Condition);
Clear Status(Players In Slot(0, Team 1), Asleep);
}
}
rule("[Reaction] [Roadhog] - Abilities control")
{
event
{
Ongoing - Each Player;
Team 2;
Roadhog;
}
conditions
{
Global.chosenTraining == 2;
Global.testIsRunning == True;
}
actions
{
"Use hook"
Set Ability Cooldown(Event Player, Button(Ability 1), 0);
Press Button(Event Player, Button(Ability 1));
}
}
rule("[Reaction] [Pharah] - Abilities control")
{
event
{
Ongoing - Each Player;
Team 2;
Pharah;
}
conditions
{
Global.chosenTraining == 2;
Global.testIsRunning == True;
}
actions
{
"Use concussion blast"
Set Ability Cooldown(Event Player, Button(Ability 2), 0);
Press Button(Event Player, Button(Ability 2));
}
}
rule("[Reaction] [Doomfist] - Abilities control")
{
event
{
Ongoing - Each Player;
Team 2;
Doomfist;
}
conditions
{
Global.chosenTraining == 2;
Global.testIsRunning == True;
}
actions
{
"Rocket Punch"
If(Random Integer(0, 1) == 0);
Set Ability Cooldown(Event Player, Button(Secondary Fire), 0);
Start Holding Button(Event Player, Button(Secondary Fire));
Wait(Random Real(0.300, 0.500), Ignore Condition);
Stop Holding Button(Event Player, Button(Secondary Fire));
"Meteor Strike"
Else;
Set Ultimate Charge(Event Player, 100);
Press Button(Event Player, Button(Ultimate));
Wait(Random Real(1, 3), Ignore Condition);
Teleport(Event Player, Players In Slot(0, Team 1));
Press Button(Event Player, Button(Primary Fire));
End;
}
}
rule("[Reaction] [Junkrat] - Abilities control")
{
event
{
Ongoing - Each Player;
Team 2;
Junkrat;
}
conditions
{
Global.chosenTraining == 2;
Global.testIsRunning == True;
}
actions
{
"Use concussion mines"
Set Ability Cooldown(Event Player, Button(Ability 1), 0);
Press Button(Event Player, Button(Ability 1));
Wait(0.600, Ignore Condition);
Press Button(Event Player, Button(Secondary Fire));
}
}
rule("[Reaction] [Mccree] - Abilities control")
{
event
{
Ongoing - Each Player;
Team 2;
McCree;
}
conditions
{
Global.chosenTraining == 2;
Global.testIsRunning == True;
}
actions
{
"Use flashbang"
Set Ability Cooldown(Event Player, Button(Ability 2), 0);
Press Button(Event Player, Button(Ability 2));
}
}
rule("[Reaction] [Brigette] - Abilities control")
{
event
{
Ongoing - Each Player;
Team 2;
Brigitte;
}
conditions
{
Global.chosenTraining == 2;
Global.testIsRunning == True;
}
actions
{
"Use whip shot"
If(Random Integer(0, 1) == 0);
Set Ability Cooldown(Event Player, Button(Ability 1), 0);
Press Button(Event Player, Button(Ability 1));
"Use shield bash"
Else;
Set Ability Cooldown(Event Player, Button(Primary Fire), 0);
Start Holding Button(Event Player, Button(Secondary Fire));
Press Button(Event Player, Button(Primary Fire));
Wait(0.250, Ignore Condition);
Stop Holding Button(Event Player, Button(Secondary Fire));
End;
}
}
rule("[Reaction] [Failed] If received any form of damage, fail the test")
{
event
{
Player Took Damage;
Team 1;
Slot 0;
}
conditions
{
Global.chosenTraining == 2;
Global.testIsRunning == True;
}
actions
{
"Do not consider fail if hit but pulse bomb initial damage"
Abort If(Hero Of(Players In Slot(0, Team 2)) == Hero(Tracer) && Event Ability == Button(Ultimate));
"Disable Cryofreeze"
Set Ability Cooldown(Event Player, Button(Ability 1), 3);
"Failed"
Small Message(Event Player, String("Failed"));
Wait(1, Ignore Condition);
}
}
rule("[Reaction] [Failed] If received hacked, fail the test")
{
event
{
Ongoing - Each Player;
Team 1;
Slot 0;
}
conditions
{
Global.chosenTraining == 2;
Global.testIsRunning == True;
Has Status(Event Player, Hacked) == True;
}
actions
{
Abort If(Is Using Ability 1(Event Player));
"Disable Cryofreeze"
Set Ability Cooldown(Event Player, Button(Ability 1), 3);
"Failed"
Small Message(Event Player, String("Failed"));
}
}
rule("[Reaction] [Failed] If received knockback from pharah, fail the test")
{
event
{
Player Received Knockback;
Team 1;
Slot 0;
}
conditions
{
Global.chosenTraining == 2;
Global.testIsRunning == True;
Hero Of(Players In Slot(0, Team 2)) == Hero(Pharah);
}
actions
{
"Disable Cryofreeze"
Set Ability Cooldown(Event Player, Button(Ability 1), 3);
"Failed"
Small Message(Event Player, String("Failed"));
}
}
rule("[Reaction] - Reset after 5s")
{
event
{
Ongoing - Global;
}
conditions
{
Global.chosenTraining == 2;
Entity Exists(Players In Slot(False, Team 2)) == True;
Global.testIsRunning == True;
}
actions
{
Wait(5, Abort When False);
Global.testIsRunning = False;
}
}
rule("[Reaction] - If in Cryofreeze, stop using it after 1s")
{
event
{
Ongoing - Each Player;
Team 1;
Slot 0;
}
conditions
{
Global.chosenTraining == 2;
Is Using Ability 1(Event Player) == True;
}
actions
{
Wait(1, Abort When False);
"Cancel Cryofreeze"
Press Button(Event Player, Button(Primary Fire));
}
}
rule("[Reaction] - When out of Cryofreeze, set cooldown to 3s")
{
event
{
Ongoing - Each Player;
Team 1;
Slot 0;
}
conditions
{
Global.chosenTraining == 2;
Ability Cooldown(Event Player, Button(Ability 1)) > 4;
}
actions
{
Set Ability Cooldown(Event Player, Button(Ability 1), 3);
}
}
rule("[Reaction] - After using Ice Wall, set cooldown to 3s")
{
event
{
Ongoing - Each Player;
Team 1;
Slot 0;
}
conditions
{
Global.chosenTraining == 2;
Ability Cooldown(Event Player, Button(Ability 2)) > 4;
}
actions
{
Set Ability Cooldown(Event Player, Button(Ability 2), 3);
}
}
rule("[Reaction] - Heal player when taking damage")
{
event
{
Player Took Damage;
Team 1;
Slot 0;
}
conditions
{
Global.chosenTraining == 2;
}
actions
{
Wait(0.100, Ignore Condition);
Heal(Event Player, Null, Event Damage);
}
}
disabled rule("----- Wall Placement -----")
{
event
{
Ongoing - Global;
}
}
rule("[Placement] - Init settings")
{
event
{
Ongoing - Global;
}
conditions
{
Global.chosenTraining == 3;
}
actions
{
"Set false for the button"
For Global Variable(controlIndex, 0, Count Of(Global.placement_ButtonPos), 1);
Global.trainingButton_isEnabled[Global.controlIndex] = False;
End;
Global.testIsRunning = False;
"Disable camera state"
Players In Slot(0, Team 1).cameraState = False;
"An array that contains a list of death effects"
Global.placement_DeathEffects = Empty Array;
}
}
rule("[Placement] - Choosing Enemy")
{
event
{
Ongoing - Each Player;
Team 1;
Slot 0;
}
conditions
{
Global.chosenTraining == 3;
Is Button Held(Event Player, Button(Primary Fire)) == True;
Global.isUIHidden == False;
Is True For Any(Global.placement_ButtonPos, Distance Between(Current Array Element, Ray Cast Hit Position(Eye Position(
Event Player), Eye Position(Event Player) + Facing Direction Of(Event Player) * Distance Between(Eye Position(Event Player),
Current Array Element), Null, Event Player, True)) <= 1) == True;
}
actions
{
Wait(0.500, Abort When False);
"Find the hero that is selected"
Global.controlIndex = Index Of Array Value(Global.placement_ButtonPos, First Of(Sorted Array(Filtered Array(
Global.placement_ButtonPos, Distance Between(Current Array Element, Ray Cast Hit Position(Eye Position(Event Player),
Eye Position(Event Player) + Facing Direction Of(Event Player) * Distance Between(Eye Position(Event Player),
Current Array Element), Null, Event Player, True)) <= 1), Distance Between(Eye Position(Event Player),
Current Array Element))));
Abort If(Global.controlIndex == -1);
"if the selected hero is active"
If(Entity Exists(Players In Slot(0, Team 2)));
Global.trainingButton_isEnabled[Index Of Array Value(Global.placement_EnemyHeroes, Hero Of(Players In Slot(0, Team 2)))] = False;
End;
"If the selected hero is the same as the active hero, despawn the bot"
If(Global.placement_EnemyHeroes[Global.controlIndex] == Hero Of(Players In Slot(0, Team 2)));
Destroy Dummy Bot(Team 2, 0);
Play Effect(Event Player, Ring Explosion Sound, Color(White), Event Player, 100);
"Remove previous death effects"
Call Subroutine(ClearDeathEffects);
Abort;
End;
"Created dummy bot that is different from the active one"
Create Dummy Bot(Global.placement_EnemyHeroes[Global.controlIndex], Team 2, 0, Vector(0, 0, 0), Vector(0, 0, 0));
Global.trainingButton_isEnabled[Global.controlIndex] = True;
Play Effect(Event Player, Buff Explosion Sound, Color(White), Event Player, 100);
"Remove previous death effects"
Call Subroutine(ClearDeathEffects);
}
}
rule("[Placement] [All] - Init the training enemy, and spawn complementary bots")
{
event
{
Ongoing - Each Player;
Team 2;
Slot 0;
}
conditions
{
Global.chosenTraining == 3;
}
actions
{
Global.testIsRunning = False;
Wait(0.100, Ignore Condition);
Set Status(Event Player, Null, Invincible, 9999);
"Create complementary Bots on the enemy team"
If(Hero Of(Event Player) == Hero(Zenyatta) || Hero Of(Event Player) == Hero(Lúcio));
For Global Variable(controlIndex, 1, 6, 1);
"Destroy the ally team bots if there's any"
If(Entity Exists(Players In Slot(Global.controlIndex, Team 1)));
Destroy Dummy Bot(Team 1, Global.controlIndex);
End;
"Create/Reset bots on the enemy team"
If(Entity Exists(Players In Slot(Global.controlIndex, Team 2)));
Teleport(Players In Slot(Global.controlIndex, Team 2), Vector(Random Real(-10, 10), 0, Random Real(-10, 10)));
Else;
Create Dummy Bot(Random Value In Array(Remove From Array(All Heroes, Hero Of(Event Player))), Team 2, Global.controlIndex, Vector(
Random Real(-10, 10), 0, Random Real(-10, 10)), Vector(Random Real(-1, 1), 0, Random Real(-1, 1)));
End;
End;
Else;
For Global Variable(controlIndex, 1, 6, 1);
"Destroy the enemy bots if there is any"
If(Entity Exists(Players In Slot(Global.controlIndex, Team 2)));
Destroy Dummy Bot(Team 2, Global.controlIndex);
End;
"Create/reset bots on the enemy team"
If(Entity Exists(Players In Slot(Global.controlIndex, Team 1)));
Teleport(Players In Slot(Global.controlIndex, Team 1), Vector(Random Real(-10, 10), 0, Random Real(-10, 10)));
Else;
Create Dummy Bot(Random Value In Array(All Heroes), Team 1, Global.controlIndex, Vector(Random Real(-10, 10), 0, Random Real(-10,
10)), Vector(Random Real(-1, 1), 0, Random Real(-1, 1)));
End;
End;
End;
}
}
rule("[Placement] [All] - Init the complementary bots throttle and facing direction")
{
event
{
Ongoing - Each Player;
All;
All;
}
conditions
{
Global.chosenTraining == 3;
Is Dummy Bot(Event Player) == True;
Slot Of(Event Player) != 0;
}
actions
{
"Start moving"
Start Throttle In Direction(Event Player, Event Player.botThrottle, 1, To Player, Replace existing throttle,
Direction and Magnitude);
"Start facing player"
Start Facing(Event Player, Direction Towards(Eye Position(Event Player), Event Player.botFacingOffset + Vector(0, 1, 0)), 100,
To World, Direction and Turn Rate);
}
}
rule("[Placement] [All] - Make all the bots throttle around")
{
event
{
Ongoing - Each Player;
All;
All;
}
conditions
{
Global.chosenTraining == 3;
Is Dummy Bot(Event Player) == True;
}
actions
{
"Change movement direction"
If(Distance Between(Position Of(Event Player), Vector(0, Y Component Of(Position Of(Event Player)), 0)) <= 15);
Event Player.botThrottle = Vector(Random Real(-1, 1), 0, Random Real(-1, 1));
Else;
Event Player.botThrottle = Local Vector Of(Direction Towards(Position Of(Event Player), Vector(Random Real(-12, 12), 0,
Random Real(-12, 12))), Event Player, Rotation);
End;
Event Player.botFacingOffset = Vector(Random Real(-5, 5), Random Real(0, 2), Random Real(-5, 5));
Wait(0.500, Abort When False);
Loop If Condition Is True;
}
}
rule("[Placement] [All] - Respawn when bot died")
{
event
{
Player Died;
All;
All;
}
conditions
{
Global.chosenTraining == 3;
Is Dummy Bot(Event Player) == True;
}
actions
{
Wait(1, Ignore Condition);
Teleport(Event Player, Vector(Random Real(-10, 10), 0, Random Real(-10, 10)));
}
}
rule("[Placement] [Subroutine] - Prepare Placement Test, put all the bots to a new location, reset wall and cryo cooldown")
{
event
{
Subroutine;
PreparePlacementTest;
}
actions
{
Wait(3, Abort When False);
"Teleport all the complementary bots to a new location"
For Global Variable(controlIndex, 1, 6, 1);
If(Hero Of(Event Player) == Hero(Zenyatta) || Hero Of(Event Player) == Hero(Lúcio));
Teleport(Players In Slot(Global.controlIndex, Team 2), Vector(Random Real(-10, 10), 0, Random Real(-10, 10)));
Else;
Teleport(Players In Slot(Global.controlIndex, Team 1), Vector(Random Real(-10, 10), 0, Random Real(-10, 10)));
End;
End;
"Remove the previous death effects"
Call Subroutine(ClearDeathEffects);
"Heal all the players"
Heal(All Players(All Teams), Null, 1000);
"If using cryofreeze, cancel cryofreeze"
If(Is Using Ability 1(Players In Slot(0, Team 1)));
Press Button(Players In Slot(0, Team 1), Button(Primary Fire));
End;
"If using wall, destroy wall"
If(Is Using Ability 2(Players In Slot(0, Team 1)));
Press Button(Players In Slot(0, Team 1), Button(Ability 2));
End;
Wait(0.250, Ignore Condition);
"Reset wall and cryofreeze cooldown"
Set Ability Cooldown(Players In Slot(0, Team 1), Button(Ability 1), 0);
Set Ability Cooldown(Players In Slot(0, Team 1), Button(Ability 2), 0);
}
}
rule("[Placement] [Mccree] - Abilities control")
{
event
{
Ongoing - Each Player;
Team 2;
McCree;
}
conditions
{
Global.chosenTraining == 3;
Slot Of(Event Player) == 0;
}
actions
{
"Teleport to place, and set facing direction"
Call Subroutine(PreparePlacementTest);
"Teleport to a random place"
Teleport(Event Player, Vector(Random Real(-15, 15), 0, Random Real(-15, 15)));
"Set a random facing direction"
Set Facing(Event Player, Direction Towards(Eye Position(Event Player), Vector(Random Real(-3, 3), 0, Random Real(-3, 3))),
To World);
"Move to dodge the wall"
Start Throttle In Direction(Event Player, Vector(Random Integer(-1, 1), 0, 0), 1, To Player, Replace existing throttle,
Direction and Magnitude);
"Use ability"
Set Ultimate Charge(Event Player, 100);
Press Button(Event Player, Button(Ultimate));
Wait(Random Real(1.500, 5.500), Abort When False);
Press Button(Event Player, Button(Primary Fire));
"Stop moving"
Stop Throttle In Direction(Event Player);
"End"
Wait(3, Abort When False);
Loop If Condition Is True;
}
}
rule("[Placement] [Doomfist] - Abilities control")
{
event
{
Ongoing - Each Player;
Team 2;
Doomfist;
}
conditions
{
Global.chosenTraining == 3;
Slot Of(Event Player) == 0;
}
actions
{
"Teleport to place, and set facing direction"
Call Subroutine(PreparePlacementTest);
"Use ability"
Set Ultimate Charge(Event Player, 100);
Press Button(Event Player, Button(Ultimate));
Wait(Random Real(1.500, 3.500), Abort When False);
Teleport(Event Player, Random Value In Array(All Players(Team 1)));
Press Button(Event Player, Button(Primary Fire));
"End"
Wait(3, Abort When False);
Loop If Condition Is True;
}
}
rule("[Placement] [Ashe] - Abilities control")
{
event
{
Ongoing - Each Player;
Team 2;
Ashe;
}
conditions
{
Global.chosenTraining == 3;
Slot Of(Event Player) == 0;
}
actions
{
"Teleport to place, and set facing direction"
Call Subroutine(PreparePlacementTest);
"Teleport to a random place"
Teleport(Event Player, Vector(Random Real(-15, 15), 0, Random Real(-15, 15)));
"Set a random facing direction"
Set Facing(Event Player, Direction Towards(Eye Position(Event Player), Vector(Random Real(-3, 3), 0, Random Real(-3, 3))),
To World);
Wait(0.250, Ignore Condition);
"Use ability"
Set Ultimate Charge(Event Player, 100);
Press Button(Event Player, Button(Ultimate));
"End"
Wait(7, Abort When False);
Loop If Condition Is True;
}
}
rule("[Placement] [Bastion] - Abilities control")
{
event
{
Ongoing - Each Player;
Team 2;
Bastion;
}
conditions
{
Global.chosenTraining == 3;
Slot Of(Event Player) == 0;
}
actions
{
"Teleport to place, and set facing direction"
Call Subroutine(PreparePlacementTest);
"Teleport to a random place"
Teleport(Event Player, Vector(Random Real(-15, 15), 0, Random Real(-15, 15)));
"Start moving and facing"
Start Throttle In Direction(Event Player, Event Player.botThrottle, 1, To Player, Replace existing throttle,
Direction and Magnitude);
Start Facing(Event Player, Direction Towards(Eye Position(Event Player), Eye Position(Player Closest To Reticle(Event Player,
Team 1))), 60, To World, Direction and Turn Rate);
"Use ability"
Set Ultimate Charge(Event Player, 100);
Press Button(Event Player, Button(Ultimate));
Start Holding Button(Event Player, Button(Primary Fire));
Wait Until(!Is Using Ultimate(Event Player), 10);
Stop Holding Button(Event Player, Button(Primary Fire));
"Stop moving and facing"
Stop Throttle In Direction(Event Player);
Stop Facing(Event Player);
"End"
Wait(3, Abort When False);
Loop If Condition Is True;
}
}
rule("[Placement] [Soldier76] - Abilities control")
{
event
{
Ongoing - Each Player;
Team 2;
Soldier: 76;
}
conditions
{
Global.chosenTraining == 3;
Slot Of(Event Player) == 0;
}
actions
{
"Teleport to place, and set facing direction"
Call Subroutine(PreparePlacementTest);
"Teleport to a random place"
Teleport(Event Player, Vector(Random Real(-15, 15), 0, Random Real(-15, 15)));
"Start moving and facing"
Start Throttle In Direction(Event Player, Event Player.botThrottle, 1, To Player, Replace existing throttle,
Direction and Magnitude);
Start Facing(Event Player, Direction Towards(Eye Position(Event Player), Eye Position(Player Closest To Reticle(Event Player,
Team 1))), 100, To World, Direction and Turn Rate);
"Use ability"
Set Ultimate Charge(Event Player, 100);
Press Button(Event Player, Button(Ultimate));
Start Holding Button(Event Player, Button(Primary Fire));
Wait Until(!Is Using Ultimate(Event Player), 8);
Stop Holding Button(Event Player, Button(Primary Fire));
"Stop moving and facing"
Stop Throttle In Direction(Event Player);
Stop Facing(Event Player);
"End"
Wait(3, Abort When False);
Loop If Condition Is True;
}
}
rule("[Placement] [Dva] - Abilities control")
{
event
{
Ongoing - Each Player;
Team 2;
D.Va;
}
conditions
{
Global.chosenTraining == 3;
Slot Of(Event Player) == 0;
}
actions
{
"Teleport to place, and set facing direction"
Call Subroutine(PreparePlacementTest);
"Choose the region to teleport to"
Event Player.botState = Random Integer(0, 3);
If(Event Player.botState == 0);
Teleport(Event Player, Vector(Random Real(12, 18), 0, Random Real(-18, 18)));
Else If(Event Player.botState == 1);
Teleport(Event Player, Vector(Random Real(-18, -12), 0, Random Real(-18, 18)));
Else If(Event Player.botState == 2);
Teleport(Event Player, Vector(Random Real(-18, 18), 0, Random Real(12, 18)));
Else;
Teleport(Event Player, Vector(Random Real(-18, 18), 0, Random Real(-18, -12)));
End;
"Set a random facing direction"
Set Facing(Event Player, Direction Towards(Eye Position(Event Player), Vector(Random Real(-5, 5), Random Real(5, 15), Random Real(
-5, 5))), To World);
"Use ability"
Set Ultimate Charge(Event Player, 100);
Press Button(Event Player, Button(Ability 1));
Wait(Random Real(0.250, 1), Abort When False);
Press Button(Event Player, Button(Ultimate));
"End"
Wait(4, Abort When False);
"Use call mech"
Skip If(!Is In Alternate Form(Event Player), True);
Press Button(Event Player, Button(Ultimate));
Loop If Condition Is True;
}
}
rule("[Placement] [Reinhardt] - Abilities control")
{
event
{
Ongoing - Each Player;
Team 2;
Reinhardt;
}
conditions
{
Global.chosenTraining == 3;
Slot Of(Event Player) == 0;
}
actions
{
"Teleport to place, and set facing direction"
Call Subroutine(PreparePlacementTest);
"Teleport to a random place"
Teleport(Event Player, Vector(Random Real(-15, 15), 0, Random Real(-15, 15)));
"Start moving and facing"
Start Throttle In Direction(Event Player, Event Player.botThrottle, 1, To Player, Replace existing throttle,
Direction and Magnitude);
Start Facing(Event Player, Direction Towards(Eye Position(Event Player), Eye Position(Closest Player To(Event Player, Team 1))),
100, To World, Direction and Turn Rate);
"Hold up shield"
Start Holding Button(Event Player, Button(Secondary Fire));
Wait(Random Real(3, 8), Abort When False);
Stop Holding Button(Event Player, Button(Secondary Fire));
"Stop moving"
Stop Throttle In Direction(Event Player);
"Use ability"
Set Ultimate Charge(Event Player, 100);
Press Button(Event Player, Button(Ultimate));
"Stop facing"
Stop Facing(Event Player);
Wait(1.250, Abort When False);
"Select a target to charge"
If(Count Of(Filtered Array(All Players(Team 1), Has Status(Current Array Element, Knocked Down))) > 0);
"Face the nearest downed player if any"
Set Facing(Event Player, Direction Towards(Eye Position(Event Player), Random Value In Array(Filtered Array(All Players(Team 1),
Has Status(Current Array Element, Knocked Down)))), To World);
Else;
"Otherwise face the nearest player"
Set Facing(Event Player, Direction Towards(Position Of(Event Player), Closest Player To(Event Player, Team 1)), To World);
End;
"Use charge"
Press Button(Event Player, Button(Ability 1));
"End"
Wait(3, Abort When False);
Loop If Condition Is True;
}
}
rule("[Placement] [Sombra] - Abilities control")
{
event
{
Ongoing - Each Player;
Team 2;
Sombra;
}
conditions
{
Global.chosenTraining == 3;
Slot Of(Event Player) == 0;
}
actions
{
"Teleport to place, and set facing direction"
Call Subroutine(PreparePlacementTest);
"Teleport to a random place"
Teleport(Event Player, Vector(0, 0, 0));
"Start moving and facing"
Start Throttle In Direction(Event Player, Event Player.botThrottle, 1, To Player, Replace existing throttle,
Direction and Magnitude);
Start Facing(Event Player, Direction Towards(Eye Position(Event Player), Eye Position(Player Closest To Reticle(Event Player,
Team 1))), 100, To World, Direction and Turn Rate);
"Use ability"
Set Ultimate Charge(Event Player, 100);
Press Button(Event Player, Button(Ability 1));
Wait(Random Real(3, 6), Abort When False);
"Remove stealth"
Press Button(Event Player, Button(Ability 1));
Wait(1, Abort When False);
Press Button(Event Player, Button(Ultimate));
"Stop moving and facing"
Stop Throttle In Direction(Event Player);
Stop Facing(Event Player);
"end"
Wait(3, Abort When False);
Loop If Condition Is True;
}
}
rule("[Placement] [Lucio] - Abilities control")
{
event
{
Ongoing - Each Player;
Team 2;
Lúcio;
}
conditions
{
Global.chosenTraining == 3;
Slot Of(Event Player) == 0;
}
actions
{
"Teleport to place, and set facing direction"
Call Subroutine(PreparePlacementTest);
"Teleport to a random place"
Teleport(Event Player, Vector(Random Real(-10, 10), 0, Random Real(-10, 10)));
"Set ult charge to 100%"
Set Ultimate Charge(Event Player, 100);
"Start moving and facing"
Start Throttle In Direction(Event Player, Event Player.botThrottle, 1, To Player, Replace existing throttle,
Direction and Magnitude);
Start Facing(Event Player, Direction Towards(Eye Position(Event Player), Vector(0, 1, 0)), 100, To World, Direction and Turn Rate);
Wait(Random Real(3, 8), Abort When False);
"Use ability"
Press Button(Event Player, Button(Ultimate));
Wait(1, Abort When False);
"Stop moving and facing"
Stop Throttle In Direction(Event Player);
Stop Facing(Event Player);
"End"
Wait(3, Abort When False);
Loop If Condition Is True;
}
}
rule("[Placement] [Zenyatta] - Abilities control")
{
event
{
Ongoing - Each Player;
Team 2;
Zenyatta;
}
conditions
{
Global.chosenTraining == 3;
Slot Of(Event Player) == 0;
}
actions
{
"Teleport to place, and set facing direction"
Call Subroutine(PreparePlacementTest);
"Teleport to a random place"
Teleport(Event Player, Vector(Random Real(-10, 10), 0, Random Real(-10, 10)));
"Set ult charge to 100%"
Set Ultimate Charge(Event Player, 100);
"Start moving and facing"
Start Throttle In Direction(Event Player, Event Player.botThrottle, 1, To Player, Replace existing throttle,
Direction and Magnitude);
Start Facing(Event Player, Direction Towards(Eye Position(Event Player), Vector(0, 1, 0)), 100, To World, Direction and Turn Rate);
Wait(Random Real(3, 8), Abort When False);
"Use ability"
Press Button(Event Player, Button(Ultimate));
Wait(6, Abort When False);
"Stop moving and facing"
Stop Throttle In Direction(Event Player);
Stop Facing(Event Player);
"End"
Wait(3, Abort When False);
Loop If Condition Is True;
}
}
rule("[Placement] - Changes camera between the player and the intended ultimate landing location")
{
event
{
Ongoing - Each Player;
Team 1;
Slot 0;
}
conditions
{
Global.chosenTraining == 3;
Is Button Held(Event Player, Button(Interact)) == True;
}
actions
{
If(Event Player.cameraState == False);
Event Player.cameraState = True;
Start Camera(Event Player, Vector(0.100, 29.500, 0), Vector(0, 0, 0), 0);
Else;
Event Player.cameraState = False;
Stop Camera(Event Player);
End;
}
}
rule("[Placement] [Indicator] - Create effect to show location of damage taken")
{
event
{
Player Died;
Team 1;
All;
}
conditions
{
Global.chosenTraining == 3;
}
actions
{
Create Effect(All Players(All Teams), Bad Aura, Color(Red), Position Of(Event Player) + Up, 1, Visible To);
Modify Global Variable(placement_DeathEffects, Append To Array, Last Created Entity);
}
}
rule("[Placement] [Indicator] - Create effect to show location of being hacked/stunned")
{
event
{
Ongoing - Each Player;
Team 1;
All;
}
conditions
{
Global.chosenTraining == 3;
(Has Status(Event Player, Hacked) || Has Status(Event Player, Knocked Down)) == True;
}
actions
{
Create Effect(All Players(All Teams), Bad Aura, Color(Purple), Position Of(Event Player) + Up, 1, Visible To);
Modify Global Variable(placement_DeathEffects, Append To Array, Last Created Entity);
}
}
rule("[Placement] [Indicator] - Create effect to show location of getting lucio sound barrier")
{
event
{
Ongoing - Each Player;
Team 2;
All;
}
conditions
{
Global.chosenTraining == 3;
Slot Of(Event Player) != 0;
Max Health(Event Player) > 600;
Hero Of(Players In Slot(0, Team 2)) == Hero(Lúcio);
}
actions
{
Create Effect(All Players(All Teams), Bad Aura, Color(Blue), Position Of(Event Player) + Up, 1, Visible To);
Modify Global Variable(placement_DeathEffects, Append To Array, Last Created Entity);
}
}
rule("[Placement] [Subroutine] - Clear death effects")
{
event
{
Subroutine;
ClearDeathEffects;
}
actions
{
"Destroy the previous death effects"
For Global Variable(controlIndex, 0, Count Of(Global.placement_DeathEffects), 1);
Destroy Effect(Global.placement_DeathEffects[Global.controlIndex]);
End;
"Reset variables"
Global.placement_DeathEffects = Empty Array;
}
}
disabled rule("----- Ultimate Tossing -----")
{
event
{
Ongoing - Global;
}
}
rule("[Tossing] - Init settings")
{
event
{
Ongoing - Global;
}
conditions
{
Global.chosenTraining == 4;
}
actions
{
"Set the location where the enemies will spawn around, then create bot"
Global.tossing_SpawnLocation = Vector(Random Real(-10, 10), 0, Random Real(-10, 10));
"Disable camera state"
Players In Slot(0, Team 1).cameraState = False;
Set Ultimate Charge(Players In Slot(0, Team 1), 100);
}
}
rule("[Tossing] [Controls] - Add 1 enemy")
{
event
{
Ongoing - Each Player;
Team 1;
Slot 0;
}
conditions
{
Global.chosenTraining == 4;
Is Button Held(Event Player, Button(Primary Fire)) == True;
Global.isUIHidden == False;
Number Of Players(Team 2) < 6;
Distance Between(Global.tossing_ButtonPos[0], Ray Cast Hit Position(Eye Position(Event Player), Eye Position(Event Player)
+ Facing Direction Of(Event Player) * Distance Between(Eye Position(Event Player), Global.tossing_ButtonPos[0]), Null,
Event Player, True)) <= 1;
}
actions
{
Create Dummy Bot(Random Value In Array(All Heroes), Team 2, -1, Global.tossing_SpawnLocation + Vector(Random Real(-9.500, 9.500),
False, Random Real(-9.500, 9.500)), Vector(Random Real(-1, 1), False, Random Real(-1, 1)));
Small Message(Event Player, Custom String("+1 enemy"));
}
}
rule("[Tossing] [Controls] - Remove 1 enemy")
{
event
{
Ongoing - Each Player;
Team 1;
Slot 0;
}
conditions
{
Global.chosenTraining == 4;
Is Button Held(Event Player, Button(Primary Fire)) == True;
Global.isUIHidden == False;
Number Of Players(Team 2) > 0;
Distance Between(Global.tossing_ButtonPos[1], Ray Cast Hit Position(Eye Position(Event Player), Eye Position(Event Player)
+ Facing Direction Of(Event Player) * Distance Between(Eye Position(Event Player), Global.tossing_ButtonPos[1]), Null,
Event Player, True)) <= 1;
}
actions
{
Destroy Dummy Bot(Team 2, Number Of Players(Team 2) - 1);
Small Message(Event Player, Custom String("-1 enemy"));
}
}
rule("[Tossing] [Controls] - Reset configuration")
{
event
{
Ongoing - Each Player;
Team 1;
Slot 0;
}
conditions
{
Global.chosenTraining == 4;
Is Button Held(Event Player, Button(Primary Fire)) == True;
Global.isUIHidden == False;
Distance Between(Global.tossing_ButtonPos[2], Ray Cast Hit Position(Eye Position(Event Player), Eye Position(Event Player)
+ Facing Direction Of(Event Player) * Distance Between(Eye Position(Event Player), Global.tossing_ButtonPos[2]), Null,
Event Player, True)) <= 1;
}
actions
{
Wait(0.500, Abort When False);
Small Message(Event Player, Custom String("Resetting positions"));
"Set the location where the enemies will spawn around, then create bot"
Global.tossing_SpawnLocation = Vector(Random Real(-10, 10), 0, Random Real(-10, 10));
"Heal all the bots"
Heal(All Players(Team 2), Null, 1000);
"Then teleport players to the final spot"
For Global Variable(controlIndex, 0, Number Of Players(Team 2), 1);
Teleport(Players In Slot(Global.controlIndex, Team 2), Global.tossing_SpawnLocation + Vector(Random Real(-9.500, 9.500), 0,
Random Real(-9.500, 9.500)));
Set Facing(Players In Slot(Global.controlIndex, Team 2), Vector(Random Real(-1, 1), 0, Random Real(-1, 1)), To World);
End;
Play Effect(Event Player, Buff Explosion Sound, Color(White), Event Player, 100);
}
}
rule("[Tossing] [Bots] - Respawn the bots when they die")
{
event
{
Player Died;
Team 2;
All;
}
conditions
{
Global.chosenTraining == 4;
}
actions
{
Wait(1, Ignore Condition);
Teleport(Event Player, Global.tossing_SpawnLocation + Vector(Random Real(-9.500, 9.500), 0, Random Real(-9.500, 9.500)));
Set Facing(Event Player, Vector(Random Real(-1, 1), 0, Random Real(-1, 1)), To World);
}
}
rule("[Tossing] [Dva] - Randomly uses Defence Matrix")
{
event
{
Ongoing - Each Player;
Team 2;
D.Va;
}
conditions
{
Global.chosenTraining == 4;
Is Dummy Bot(Event Player) == True;
Is In Alternate Form(Event Player) == False;
}
actions
{
Wait(Random Real(2, 4), Abort When False);
Start Holding Button(Event Player, Button(Secondary Fire));
Wait(Random Real(0.500, 2), Abort When False);
Stop Holding Button(Event Player, Button(Secondary Fire));
Loop If Condition Is True;
}
}
rule("[Tossing] [Sigma] - Randomly uses Kinetic Grasp")
{
event
{
Ongoing - Each Player;
Team 2;
Sigma;
}
conditions
{
Global.chosenTraining == 4;
Is Dummy Bot(Event Player) == True;
}
actions
{
Wait(Random Real(4, 8), Abort When False);
Set Ability Cooldown(Event Player, Button(Ability 1), 0);
Press Button(Event Player, Button(Ability 1));
Loop If Condition Is True;
}
}
rule("[Tossing] [Genji] - Randomly uses Deflect")
{
event
{
Ongoing - Each Player;
Team 2;
Genji;
}
conditions
{
Global.chosenTraining == 4;
Is Dummy Bot(Event Player) == True;
}
actions
{
Wait(Random Real(4, 8), Abort When False);
Set Ability Cooldown(Event Player, Button(Ability 2), 0);
Press Button(Event Player, Button(Ability 2));
Loop If Condition Is True;
}
}
rule("[Tossing] - Changes camera between the player and the intended ultimate landing location")
{
event
{
Ongoing - Each Player;
Team 1;
Slot 0;
}
conditions
{
Global.chosenTraining == 4;
Is Button Held(Event Player, Button(Interact)) == True;
}
actions
{
If(Event Player.cameraState == False);
Event Player.cameraState = True;
Start Camera(Event Player, Global.tossing_SpawnLocation + Vector(0.100, 22, False), Global.tossing_SpawnLocation, 0);
Else;
Event Player.cameraState = False;
Stop Camera(Event Player);
End;
}
}
rule("[Tossing] - Reset ultimate charge after using ult")
{
event
{
Ongoing - Each Player;
Team 1;
Slot 0;
}
conditions
{
Global.chosenTraining == 4;
Is Using Ultimate(Event Player) == False;
}
actions
{
Set Ultimate Charge(Event Player, 100);
}
}
disabled rule("----- Miscellaneous Functions -----")
{
event
{
Ongoing - Global;
}
}
rule("[All modes] Hold interact for 2s to go back to main menu")
{
event
{
Ongoing - Each Player;
Team 1;
Slot 0;
}
conditions
{
Is Button Held(Event Player, Button(Interact)) == True;
(Global.chosenTraining == 1 || Global.chosenTraining == 2) == True;
}
actions
{
Small Message(Event Player, Custom String("Returning to Main Menu, Hold [{0}] for 2 seconds.", Input Binding String(Button(
Interact))));
Wait(2, Abort When False);
"Set state to 0"
Global.chosenTraining = 0;
}
}
rule("[All modes] Pressing hide UI buttons")
{
event
{
Ongoing - Each Player;
Team 1;
Slot 0;
}
conditions
{
Global.chosenTraining >= 1;
Is Button Held(Event Player, Button(Primary Fire)) == True;
Distance Between(Global.hideUIButton, Ray Cast Hit Position(Eye Position(Event Player), Eye Position(Event Player)
+ Facing Direction Of(Event Player) * Distance Between(Eye Position(Event Player), Global.hideUIButton), Null, Event Player,
True)) <= 1;
"Prevent players from overlapping selection of training bots and back button"
X Component Of(Position Of(Event Player)) >= -16;
}
actions
{
Wait(0.500, Abort When False);
"if the selected modifier is not active"
If(Global.isUIHidden);
Play Effect(Event Player, Ring Explosion Sound, Color(White), Event Player, 100);
Global.isUIHidden = False;
Else;
Play Effect(Event Player, Buff Explosion Sound, Color(White), Event Player, 100);
Global.isUIHidden = True;
End;
}
}