Skip to content

Instantly share code, notes, and snippets.

@nathan130200
Last active February 3, 2021 01:21
Show Gist options
  • Save nathan130200/ca610d1fcb46cd6a83c656e6836a6450 to your computer and use it in GitHub Desktop.
Save nathan130200/ca610d1fcb46cd6a83c656e6836a6450 to your computer and use it in GitHub Desktop.
Camera shake effect for overwatch workshop (with example).
variables
{
player:
0: cameraShakeStatus
1: cameraShakeStep
}
subroutines
{
0: ApplyCameraShake
}
rule("Camera shake effect.")
{
event
{
Player Took Damage;
All;
All;
}
conditions
{
Event Player.cameraShakeStatus == False;
Hero Of(Attacker) == Hero(Reinhardt);
Is Using Ultimate(Attacker) == True;
}
actions
{
Call Subroutine(ApplyCameraShake);
}
}
rule("Apply camera shake function.")
{
event
{
Subroutine;
ApplyCameraShake;
}
actions
{
Event Player.cameraShakeStep = 0;
Event Player.cameraShakeStatus = True;
For Player Variable(Event Player, cameraShakeStep, 0, 115, 1);
Set Facing(Event Player, Direction From Angles(Random Integer(-2, 2), Random Integer(-3, 3)), To Player);
Wait(0.016, Ignore Condition);
End;
Event Player.cameraShakeStatus = False;
}
}
variables
{
player:
0: petSlot
1: petIsLocked
}
rule("Criar pet do host.")
{
event
{
Ongoing - Global;
}
conditions
{
Has Spawned(Host Player) == True;
Is True For Any(Array(Is Waiting For Players, Is In Setup, Is Game In Progress), Current Array Element) == True;
}
actions
{
Destroy All Dummy Bots;
Wait(1, Ignore Condition);
Create Dummy Bot(Hero Of(Host Player), Team Of(Host Player), Team Of(Host Player) == Team 1 ? 6 : 4, Nearest Walkable Position(
Host Player), Vector(0, 0, 0));
}
}
rule("Salvar informações do pet (+ movimentação & mira)")
{
event
{
Ongoing - Each Player;
All;
All;
}
conditions
{
Is Dummy Bot(Event Player) == True;
}
actions
{
Host Player.petSlot = Slot Of(Event Player);
Start Throttle In Direction(Event Player, Is Alive(Host Player) ? Direction Towards(Event Player, Host Player)
: Facing Direction Of(Event Player), Is Alive(Host Player) ? (Distance Between(Event Player, Host Player)
<= 1.500 ? 0 : Distance Between(Event Player, Host Player)) : 1, To World, Replace existing throttle, Direction and Magnitude);
Start Facing(Event Player, Facing Direction Of(Host Player), 500, To World, Direction and Turn Rate);
}
}
rule("[PET] Pular")
{
event
{
Ongoing - Each Player;
All;
All;
}
conditions
{
Is Dummy Bot(Event Player) == True;
Is Button Held(Host Player, Button(Jump)) == True;
}
actions
{
Start Holding Button(Event Player, Button(Jump));
Wait(0.250, Ignore Condition);
Loop If Condition Is True;
Stop Holding Button(Event Player, Button(Jump));
}
}
rule("[PET] Agaixar")
{
event
{
Ongoing - Each Player;
All;
All;
}
conditions
{
Is Dummy Bot(Event Player) == True;
Is Button Held(Host Player, Button(Crouch)) == True;
}
actions
{
Start Holding Button(Event Player, Button(Crouch));
Wait(0.250, Ignore Condition);
Loop If Condition Is True;
Stop Holding Button(Event Player, Button(Crouch));
}
}
rule("[PET] Abilidade 1")
{
event
{
Ongoing - Each Player;
All;
All;
}
conditions
{
Is Dummy Bot(Event Player) == True;
Is Button Held(Host Player, Button(Ability 1)) == True;
}
actions
{
Start Holding Button(Event Player, Button(Ability 1));
Wait(0.250, Ignore Condition);
Loop If Condition Is True;
Stop Holding Button(Event Player, Button(Ability 1));
}
}
rule("[PET] Abilidade 2")
{
event
{
Ongoing - Each Player;
All;
All;
}
conditions
{
Is Dummy Bot(Event Player) == True;
Is Button Held(Host Player, Button(Ability 2)) == True;
}
actions
{
Start Holding Button(Event Player, Button(Ability 2));
Wait(0.250, Ignore Condition);
Loop If Condition Is True;
Stop Holding Button(Event Player, Button(Ability 2));
}
}
rule("[PET] Travar/Destravar.")
{
event
{
Ongoing - Each Player;
All;
All;
}
conditions
{
Is Dummy Bot(Event Player) == True;
Is Button Held(Host Player, Button(Interact)) == True;
}
actions
{
If(Host Player.petIsLocked);
Set Move Speed(Event Player, 0);
disabled Set Invisible(Event Player, All);
Else;
Set Move Speed(Event Player, 115);
disabled Set Invisible(Event Player, None);
End;
Wait(0.250, Ignore Condition);
Host Player.petIsLocked = !Host Player.petIsLocked;
Teleport(Event Player, Host Player);
}
}
rule("[PET] Disparo primário.")
{
event
{
Ongoing - Each Player;
All;
All;
}
conditions
{
Is Dummy Bot(Event Player) == True;
Is Button Held(Host Player, Button(Primary Fire)) == True;
}
actions
{
Start Holding Button(Event Player, Button(Primary Fire));
Wait(0.250, Ignore Condition);
Loop If Condition Is True;
Stop Holding Button(Event Player, Button(Primary Fire));
}
}
rule("[PET] Disparo secundário.")
{
event
{
Ongoing - Each Player;
All;
All;
}
conditions
{
Is Dummy Bot(Event Player) == True;
Is Button Held(Host Player, Button(Secondary Fire)) == True;
}
actions
{
Start Holding Button(Event Player, Button(Secondary Fire));
Wait(0.250, Ignore Condition);
Loop If Condition Is True;
Stop Holding Button(Event Player, Button(Secondary Fire));
}
}
rule("[PET] Corpo-a-corpo.")
{
event
{
Ongoing - Each Player;
All;
All;
}
conditions
{
Is Dummy Bot(Event Player) == True;
Is Button Held(Host Player, Button(Melee)) == True;
}
actions
{
Start Holding Button(Event Player, Button(Melee));
Wait(0.250, Ignore Condition);
Loop If Condition Is True;
Stop Holding Button(Event Player, Button(Melee));
}
}
rule("[PET] Abilidade suprema.")
{
event
{
Ongoing - Each Player;
All;
All;
}
conditions
{
Is Dummy Bot(Event Player) == True;
Is Button Held(Host Player, Button(Ultimate)) == True;
}
actions
{
Start Holding Button(Event Player, Button(Ultimate));
Wait(0.250, Ignore Condition);
Loop If Condition Is True;
Stop Holding Button(Event Player, Button(Ultimate));
}
}
rule("[PET] Remover ao final do round (impedir trapaça na equipe do jason)")
{
event
{
Ongoing - Each Player;
Team 2;
All;
}
conditions
{
Event Player == Host Player;
Match Time <= 10;
Is Game In Progress == True;
disabled Number Of Living Players(Team 1) > Number Of Living Players(Team 2);
}
actions
{
Kill(Players In Slot(Event Player.petSlot, Team Of(Event Player)), Random Value In Array(All Players(Team 1)));
}
}
rule("[PET] Comunicar voiceline.")
{
event
{
Ongoing - Each Player;
All;
All;
}
conditions
{
Is Dummy Bot(Event Player) == False;
Team Of(Event Player) == Team Of(Host Player);
Is Communicating Any(Event Player) == True;
}
actions
{
Communicate(Players In Slot(Host Player.petSlot, Team Of(Host Player)), Hello);
}
}
rule("[PET] Sincronizar heroi.")
{
event
{
Ongoing - Each Player;
All;
All;
}
conditions
{
Is Dummy Bot(Event Player) == True;
Is Alive(Event Player) == True;
Hero Of(Event Player) != Hero Of(Host Player);
}
actions
{
Start Forcing Player To Be Hero(Event Player, Hero Of(Host Player));
}
}
disabled rule("[PET] Detectar morte do dono.")
{
event
{
Player Died;
Team 1;
All;
}
conditions
{
Victim == Host Player;
Is Dead(Players In Slot(Host Player.petSlot, Team Of(Host Player))) == False;
}
actions
{
Set Environment Credit Player(Players In Slot(Host Player.petSlot, Team Of(Host Player)), Random Value In Array(All Players(
All Teams)));
Wait(0.250, Ignore Condition);
Kill(Players In Slot(Host Player.petSlot, Team Of(Host Player)), Attacker);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment