Return to post
- variables
- {
- global:
- 0: rotationLimit
- 1: shieldVerticalPos
- 2: shieldDistance
- 3: rotationHud
- 4: barrierHealthModifier
- 5: allowShieldToggle
- player:
- 0: reinhardt
- 1: facingDirection
- 2: shieldToggle
- }
- rule("Settings")
- {
- event
- {
- Ongoing - Global;
- }
- actions
- {
- Global.rotationLimit = Workshop Setting Integer(Custom String("Bastion"), Custom String("Rotation degree limit"), 180, 0, 360, 0);
- Global.rotationHud = Workshop Setting Toggle(Custom String("Bastion"), Custom String("Rotation range indicator"), True, 0);
- "If you want higher shield hp, edit the maxium value here."
- Global.barrierHealthModifier = 0.625 * Workshop Setting Real(Custom String("Bastion"), Custom String("Barrier health"), 1, 0, 2,
- 0);
- Global.allowShieldToggle = Workshop Setting Toggle(Custom String("Bastion"), Custom String("Toggleable shield"), False, 0);
- Global.shieldVerticalPos = -0.550;
- Global.shieldDistance = 1;
- }
- }
- rule("Create reinhardt for bastion")
- {
- event
- {
- Ongoing - Each Player;
- All;
- All;
- }
- conditions
- {
- Hero Of(Event Player) == Hero(Bastion);
- }
- actions
- {
- Create Dummy Bot(Hero(Reinhardt), Team Of(Event Player), -1, Vector(0, 10000, 0), Vector(0, 0, 0));
- Event Player.reinhardt = Last Created Entity;
- Start Forcing Player Position(Event Player.reinhardt, Update Every Frame(Ray Cast Hit Position(Eye Position(Event Player) + Vector(
- 0, Global.shieldVerticalPos, 0), Eye Position(Event Player) + Vector(0, Global.shieldVerticalPos, 0) + Facing Direction Of(
- Event Player) * Global.shieldDistance, Null, Event Player, False)), True);
- Start Facing(Event Player.reinhardt, Facing Direction Of(Event Player), 10000, To World, Direction and Turn Rate);
- Start Scaling Player(Event Player.reinhardt, 0, True);
- Start Scaling Barriers(Event Player.reinhardt, 4, True);
- Disable Nameplates(Event Player.reinhardt, All Players(All Teams));
- Start Forcing Player Outlines(Event Player.reinhardt, All Players(All Teams), False, Color(White), Default);
- Set Max Health(Event Player.reinhardt, 100 * Global.barrierHealthModifier);
- Set Player Health(Event Player.reinhardt, Max Health(Event Player.reinhardt));
- Event Player.shieldToggle = True;
- }
- }
- rule("Destroy reinhardt for bastion")
- {
- event
- {
- Ongoing - Each Player;
- All;
- All;
- }
- conditions
- {
- Hero Of(Event Player) != Hero(Bastion);
- Event Player.reinhardt != 0;
- }
- actions
- {
- Destroy Dummy Bot(Team Of(Event Player.reinhardt), Slot Of(Event Player.reinhardt));
- Event Player.reinhardt = 0;
- }
- }
- rule("Bastion in sentry")
- {
- event
- {
- Ongoing - Each Player;
- All;
- All;
- }
- conditions
- {
- Hero Of(Event Player) == Hero(Bastion);
- Is In Alternate Form(Event Player) == True;
- Is Using Ultimate(Event Player) == False;
- Event Player.shieldToggle == True;
- }
- actions
- {
- Event Player.facingDirection = Facing Direction Of(Event Player);
- Wait(1, Ignore Condition);
- Start Holding Button(Event Player.reinhardt, Button(Secondary Fire));
- Set Invisible(Event Player.reinhardt, None);
- Disallow Button(Event Player, Button(Ability 1));
- Wait(0.250, Ignore Condition);
- Allow Button(Event Player, Button(Ability 1));
- }
- }
- rule("Bastion not in sentry")
- {
- event
- {
- Ongoing - Each Player;
- All;
- All;
- }
- conditions
- {
- Hero Of(Event Player) == Hero(Bastion);
- (!Is In Alternate Form(Event Player) || Is Using Ultimate(Event Player)) == True;
- }
- actions
- {
- Event Player.facingDirection = 0;
- Stop Holding Button(Event Player.reinhardt, Button(Secondary Fire));
- Set Invisible(Event Player.reinhardt, All);
- Disallow Button(Event Player, Button(Ability 1));
- Wait(0.250, Ignore Condition);
- Allow Button(Event Player, Button(Ability 1));
- }
- }
- rule("Shield disabled")
- {
- event
- {
- Ongoing - Each Player;
- All;
- All;
- }
- conditions
- {
- Hero Of(Event Player) == Hero(Bastion);
- Event Player.shieldToggle == False;
- }
- actions
- {
- Stop Holding Button(Event Player.reinhardt, Button(Secondary Fire));
- Set Invisible(Event Player.reinhardt, All);
- }
- }
- rule("Rotation outside range")
- {
- event
- {
- Ongoing - Each Player;
- All;
- All;
- }
- conditions
- {
- Event Player.facingDirection != 0;
- Absolute Value(((Arctangent In Degrees(X Component Of(Facing Direction Of(Event Player)), Z Component Of(Facing Direction Of(
- Event Player))) + 360) % 360 - (Arctangent In Degrees(X Component Of(Event Player.facingDirection), Z Component Of(
- Event Player.facingDirection)) + 360) % 360 + 360) % 360 - 180) < 180 - Global.rotationLimit / 2;
- }
- actions
- {
- Start Facing(Event Player, Vector(X Component Of(Event Player.facingDirection), Y Component Of(Facing Direction Of(Event Player)),
- Z Component Of(Event Player.facingDirection)), 100, To World, None);
- Wait Until(Absolute Value(((Arctangent In Degrees(X Component Of(Facing Direction Of(Event Player)), Z Component Of(
- Facing Direction Of(Event Player))) + 360) % 360 - (Arctangent In Degrees(X Component Of(Event Player.facingDirection),
- Z Component Of(Event Player.facingDirection)) + 360) % 360 + 360) % 360 - 180) > 180 - Global.rotationLimit / 2, 99999);
- Stop Facing(Event Player);
- }
- }
rule("Create hud text")
- rule("Create rotation hud text")
- {
- event
- {
- Ongoing - Each Player;
- All;
- All;
- }
- conditions
- {
- Global.rotationHud == True;
- }
- actions
- {
- "Don't open this action, it could potentialy crash your game on weaker systems"
- Create Progress Bar HUD Text(Filtered Array(Event Player, Hero Of(Event Player) == Hero(Bastion) && Is In Alternate Form(
Event Player)), (180 - Absolute Value(((Arctangent In Degrees(X Component Of(Facing Direction Of(Event Player)),
Z Component Of(Facing Direction Of(Event Player))) + 360) % 360 - (Arctangent In Degrees(X Component Of(
Event Player.facingDirection), Z Component Of(Event Player.facingDirection)) + 360) % 360 + 360) % 360 - 180)) / (
Global.rotationLimit / 2) * 100, Custom String("Rotation"), Left, 0, Custom Color((180 - Absolute Value(((
- Event Player) && !Is Using Ultimate(Event Player)), (180 - Absolute Value(((Arctangent In Degrees(X Component Of(
- Facing Direction Of(Event Player)), Z Component Of(Facing Direction Of(Event Player))) + 360) % 360 - (Arctangent In Degrees(
- X Component Of(Event Player.facingDirection), Z Component Of(Event Player.facingDirection)) + 360) % 360 + 360) % 360 - 180))
- / (Global.rotationLimit / 2) * 100, Custom String("Rotation"), Left, 10, Custom Color((180 - Absolute Value(((
- Arctangent In Degrees(X Component Of(Facing Direction Of(Event Player)), Z Component Of(Facing Direction Of(Event Player)))
- + 360) % 360 - (Arctangent In Degrees(X Component Of(Event Player.facingDirection), Z Component Of(
- Event Player.facingDirection)) + 360) % 360 + 360) % 360 - 180)) / (Global.rotationLimit / 2) * 128, 0, 0, 255), Color(White),
- Visible To Values and Color, Default Visibility);
- }
- }
- rule("Create toggle shield hud")
- {
- event
- {
- Ongoing - Each Player;
- All;
- All;
- }
- conditions
- {
- Global.allowShieldToggle == True;
- }
- actions
- {
- Create HUD Text(Filtered Array(Event Player, Hero Of(Event Player) == Hero(Bastion) && Is In Alternate Form(Event Player)
- && !Is Using Ultimate(Event Player)), Custom String("Shield {0}", Event Player.shieldToggle ? Custom String("enabled")
- : Custom String("disabled")), Null, Null, Left, 0, Custom Color(Event Player.shieldToggle ? 0 : 255,
- Event Player.shieldToggle ? 255 : 0, 0, 255), Color(White), Color(White), Visible To String and Color, Default Visibility);
- }
- }
- rule("Toggle shield")
- {
- event
- {
- Ongoing - Each Player;
- All;
- All;
- }
- conditions
- {
- Hero Of(Event Player) == Hero(Bastion);
- Is Button Held(Event Player, Button(Melee)) == True;
- Is In Alternate Form(Event Player) == True;
- Is Using Ultimate(Event Player) == False;
- }
- actions
- {
- Event Player.shieldToggle = !Event Player.shieldToggle;
- Wait Until(Is Button Held(Event Player, Button(Melee)), 99999);
- }
- }
- rule("End of game")
- {
- event
- {
- Ongoing - Each Player;
- All;
- All;
- }
- conditions
- {
- Is Match Complete == True;
- }
- actions
- {
- "Destroy bot, so it doesn't get POTG or appear in ending screen"
- Destroy Dummy Bot(Team Of(Event Player.reinhardt), Slot Of(Event Player.reinhardt));
- }
- }