Create
Return to post

Comparing difference between and

View raw
  • settings
  • {
  • main
  • {
  • Description: "Randomat! Every x seconds a new random event shakes up your round of Deathmatch. More info at workshop.codes/randomat"
  • }
  • lobby
  • {
  • Allow Players Who Are In Queue: Yes
  • Match Voice Chat: Enabled
  • }
  • modes
  • {
  • Deathmatch
  • {
  • Game Length In Minutes: 15
  • Score To Win: 50
  • disabled maps
  • {
  • Workshop Chamber
  • Workshop Expanse
  • Workshop Expanse Night
  • Workshop Island
  • Workshop Island Night
  • }
  • }
  • General
  • {
  • Game Mode Start: Immediately
  • Hero Limit: Off
  • }
  • }
  • }
  • variables
  • {
  • global:
  • 0: Timer
  • 1: Interval
  • 2: Player1
  • 3: Player2
  • 4: PositionPlayer1
  • 5: PositionPlayer2
  • 6: FacingPlayer1
  • 7: FacingPlayer2
  • 8: CurrentRandomEffect
  • 9: Radius
  • 10: PositionsArray
  • 12: CurrentPosition
  • 13: DamageDealt
  • 14: ArrayForRandomat
  • 15: RandomatTimer
  • 21: RandomnessIntensifiesArray
  • 22: Loop
  • 23: RandomValue
  • 24: NewEventStarted
  • 26: JumpHeight
  • 27: TotalAmountOfEffects
  • 28: AllCoinPositions
  • 29: PositionOfCurrentCoin
  • 30: CoinLoop
  • 31: MaxCoins
  • 32: CoinEffectsArray
  • 33: InfiniteGame
  • 34: MomentumMultiplier
  • 35: FlopperDamage
  • 36: TrueFalseArray
  • 37: HUDTimer
  • 38: AvailableSoulmates
  • player:
  • 0: SpawnTimer
  • 1: RandomPlayer
  • 2: HasDied
  • 3: FallSpeed
  • 4: DamageToBeDone
  • 5: LastDamagedBy
  • 6: PlayerCoinLoop
  • 7: AmountOfCollectedCoins
  • 8: AmountOfCoinsToDrop
  • 9: DroppedCoinLoop
  • 10: PlayersInRadius
  • 11: ShortLoop
  • 12: PositivePolarity
  • 13: PolarityEffect
  • 14: PolarityIcon
  • 15: PolarityHud
  • 16: Soulmate
  • }
  • subroutines
  • {
  • 0: MakeRandomnessArray
  • 1: HardReset
  • 2: SpawnCoin
  • 3: CreateHUDTimer
  • }
  • disabled rule("Randomat! - More info at https://workshop.codes/randomat")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • }
  • rule("Game Settings")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • actions
  • {
  • "Change me to adjust how often Randomat effects happen"
  • Global.RandomatTimer = 45;
  • "Set me to False to end the game after the time ends, or after someone reaches the score limit. Set me to True to keep the game going forever."
  • Global.InfiniteGame = True;
  • }
  • }
  • rule("Infinite timer")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • Match Time < 1800;
  • Global.InfiniteGame == True;
  • Is Game In Progress == True;
  • }
  • actions
  • {
  • Set Match Time(3599);
  • }
  • }
  • rule("Pre-game")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • Is Assembling Heroes == True;
  • }
  • actions
  • {
  • Set Match Time(5);
  • }
  • }
  • rule("Disable default game ending")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • Global.InfiniteGame == True;
  • }
  • actions
  • {
  • Disable Built-In Game Mode Completion;
  • Disable Built-In Game Mode Announcer;
  • Disable Built-In Game Mode Music;
  • }
  • }
  • rule("Subroutine - HUD Timer")
  • {
  • event
  • {
  • Subroutine;
  • CreateHUDTimer;
  • }
  • actions
  • {
  • Create HUD Text(All Players(All Teams), Null, Custom String("Read more at workshop.codes/randomat"), Null, Right, 0, White, White,
  • White, Visible To and String, Default Visibility);
  • Create HUD Text(All Players(All Teams), Null, Custom String(" "), Null, Left, 2, White, White, White, Visible To and String,
  • Default Visibility);
  • Create HUD Text(All Players(All Teams), Null, Custom String("Next Randomat in: {0}", Round To Integer(
  • Global.RandomatTimer - Global.HUDTimer, Up)), Null, Right, 5, White, Orange, White, Visible To and String, Default Visibility);
  • "Timer on HUD that counts down"
  • Global.HUDTimer = 0;
  • "Chase Timer HUD"
  • Chase Global Variable At Rate(HUDTimer, Global.RandomatTimer, 1, Destination and Rate);
  • }
  • }
  • rule("Subroutine - Make randomness array")
  • {
  • event
  • {
  • Subroutine;
  • MakeRandomnessArray;
  • }
  • actions
  • {
  • "Total random events in number (+1)"
  • For Global Variable(Loop, 0, Global.TotalAmountOfEffects, 1);
  • Global.ArrayForRandomat[Global.Loop] = Global.Loop;
  • End;
  • }
  • }
  • rule("Subroutine - Hard reset of variables and states")
  • {
  • event
  • {
  • Subroutine;
  • HardReset;
  • }
  • actions
  • {
  • Start Forcing Throttle(Event Player, 0, 1, 0, 1, 0, 1);
  • Set Gravity(Event Player, 100);
  • Allow Button(Event Player, Jump);
  • Set Invisible(Event Player, None);
  • Event Player.HasDied = False;
  • }
  • }
  • rule("Initialise")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • actions
  • {
  • "Make sure I start empty to prevent crazy things"
  • Global.CurrentRandomEffect = 1000;
  • Global.RandomnessIntensifiesArray = Empty Array;
  • Global.NewEventStarted = False;
  • Global.TotalAmountOfEffects = 14;
  • Global.TotalAmountOfEffects = 15;
  • Global.MomentumMultiplier = False;
  • "This array is used for several random effects that require unique numbers"
  • Call Subroutine(MakeRandomnessArray);
  • Global.TrueFalseArray[0] = True;
  • Global.TrueFalseArray[1] = False;
  • }
  • }
  • rule("Cycle Random Effect")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • actions
  • {
  • "Show countdown 3 seconds before change"
  • Small Message(All Players(All Teams), Custom String("New Randomat incoming..."));
  • Wait(1, Ignore Condition);
  • Communicate(All Players(All Teams), Countdown);
  • Small Message(All Players(All Teams), Custom String("3..."));
  • Wait(1, Ignore Condition);
  • Small Message(All Players(All Teams), Custom String("2..."));
  • Wait(1, Ignore Condition);
  • Small Message(All Players(All Teams), Custom String("1..."));
  • Global.MomentumMultiplier = True;
  • Wait(1, Ignore Condition);
  • "Reset all values and effects"
  • Global.CurrentRandomEffect = 1000;
  • Global.RandomnessIntensifiesArray = Empty Array;
  • Destroy All HUD Text;
  • Destroy All Icons;
  • Destroy All In-World Text;
  • Destroy All Effects;
  • Global.NewEventStarted = True;
  • "Re-create HUD"
  • Create HUD Text(All Players(All Teams), Null, String("{0} {1} {2}", Custom String("A new Random effect will occur every"),
  • Global.RandomatTimer, Custom String("seconds")), Null, Right, 1, White, Turquoise, White, Visible To and String,
  • Default Visibility);
  • Wait(0.250, Ignore Condition);
  • Global.MomentumMultiplier = False;
  • "Set the new event"
  • Global.CurrentRandomEffect = Random Value In Array(Global.ArrayForRandomat);
  • Global.ArrayForRandomat = Remove From Array(Global.ArrayForRandomat, Global.CurrentRandomEffect);
  • "Re-create HUD"
  • Create HUD Text(All Players(All Teams), Null, Custom String("{0} Current Randomat", Icon String(Recycle)), Null, Left, -2, White,
  • Blue, Blue, Visible To and String, Default Visibility);
  • Call Subroutine(CreateHUDTimer);
  • Wait(Global.RandomatTimer - 4, Ignore Condition);
  • Loop;
  • }
  • }
  • rule("New event starts - Player event")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Global.NewEventStarted == True;
  • }
  • actions
  • {
  • Start Forcing Throttle(Event Player, 0, 1, 0, 1, 0, 1);
  • Set Gravity(Event Player, 100);
  • Allow Button(Event Player, Jump);
  • Set Invisible(Event Player, None);
  • Event Player.HasDied = False;
  • Event Player.FallSpeed = 0;
  • Event Player.Soulmate = False;
  • Play Effect(Event Player, Ring Explosion Sound, White, Event Player, 100);
  • Big Message(Event Player, Custom String("Randomat!"));
  • Global.NewEventStarted = False;
  • Stop Camera(Event Player);
  • }
  • }
  • disabled rule("Spawn bots - For debugging")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Button Held(Event Player, Crouch) == True;
  • Is Button Held(Event Player, Interact) == True;
  • }
  • actions
  • {
  • Create Dummy Bot(Random Value In Array(All Heroes), Opposite Team Of(Team Of(Event Player)), -1,
  • Event Player + Facing Direction Of(Event Player) * 0.500, Facing Direction Of(Event Player));
  • }
  • }
  • disabled rule("Dev stuff")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • actions
  • {
  • Global.RandomnessIntensifiesArray[0] = 0;
  • Global.RandomnessIntensifiesArray[0] = 4;
  • }
  • }
  • disabled rule("Dev stuff - Player event")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • }
  • disabled rule("----- Swap! ----- = 0")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • }
  • rule("Settings")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 0 || Array Contains(Global.RandomnessIntensifiesArray, 0)) == True;
  • }
  • actions
  • {
  • "Change this number to adjust the frequency of Swaps"
  • Global.Interval = 5;
  • }
  • }
  • rule("Initialise")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 0 || Array Contains(Global.RandomnessIntensifiesArray, 0)) == True;
  • }
  • actions
  • {
  • Global.Timer = Global.Interval;
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Null, String("{0} {1} {2}", Custom String("Every"), Global.Interval, Custom String(
  • "seconds 2 random players will swap position.")), Null, Left, 0, White, White, White, Visible To and String,
  • Default Visibility);
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Custom String("{0} Swap!", Icon String(Dizzy)), Null, Null, Left, 0, Yellow, White, White,
  • Visible To and String, Default Visibility);
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Null, Custom String(" "), Null, Left, 0, White, White, White, Visible To and String,
  • Default Visibility);
  • }
  • }
  • rule("Timer")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 0 || Array Contains(Global.RandomnessIntensifiesArray, 0)) == True;
  • Global.Timer == Global.Interval;
  • }
  • actions
  • {
  • Chase Global Variable At Rate(Timer, 0, 1, Destination and Rate);
  • }
  • }
  • rule("Swap 2 random players")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 0 || Array Contains(Global.RandomnessIntensifiesArray, 0)) == True;
  • Global.Timer <= 0;
  • Count Of(All Living Players(All Teams)) > 1;
  • }
  • actions
  • {
  • Global.Player1 = Random Value In Array(All Living Players(All Teams));
  • Global.Player2 = Random Value In Array(Remove From Array(All Living Players(All Teams), Global.Player1));
  • Global.PositionPlayer1 = Position Of(Global.Player1);
  • Global.PositionPlayer2 = Position Of(Global.Player2);
  • Global.FacingPlayer1 = Facing Direction Of(Global.Player1);
  • Global.FacingPlayer2 = Facing Direction Of(Global.Player2);
  • Skip If(Global.PositionPlayer1 == 0 || Global.PositionPlayer2 == 0, 11);
  • Big Message(All Players(All Teams), Custom String("Swap!"));
  • Teleport(Global.Player1, Global.PositionPlayer2);
  • Set Facing(Global.Player1, Global.FacingPlayer2, To World);
  • Teleport(Global.Player2, Global.PositionPlayer1);
  • Set Facing(Global.Player2, Global.FacingPlayer1, To World);
  • Play Effect(All Players(All Teams), Good Pickup Effect, Yellow, Global.Player1, 1);
  • Play Effect(All Players(All Teams), Ring Explosion, Yellow, Global.Player1, 2);
  • Play Effect(All Players(All Teams), Buff Explosion Sound, Yellow, Global.Player1, 50);
  • Play Effect(All Players(All Teams), Good Pickup Effect, Yellow, Global.Player2, 1);
  • Play Effect(All Players(All Teams), Ring Explosion, Yellow, Global.Player2, 2);
  • Play Effect(All Players(All Teams), Buff Explosion Sound, Yellow, Global.Player2, 50);
  • Global.Timer = Global.Interval;
  • }
  • }
  • disabled rule("----- Contagious Bodies ----- = 1")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • }
  • rule("Settings")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 1 || Array Contains(Global.RandomnessIntensifiesArray, 1)) == True;
  • }
  • actions
  • {
  • "Change me to adjust the radius of the contagion dropped by dead bodies"
  • Global.Radius = 5;
  • "Change me to adjust the damage dealt per second when inside a Contagion blob"
  • Global.DamageDealt = 100;
  • }
  • }
  • rule("Initialise")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 1 || Array Contains(Global.RandomnessIntensifiesArray, 1)) == True;
  • }
  • actions
  • {
  • Global.PositionsArray = Empty Array;
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Null, Custom String(
  • "Dead bodies leave behind a puddle that deals a large amount of damage"), Null, Left, 1, White, White, White,
  • Visible To and String, Default Visibility);
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Custom String("{0} Contagious Bodies", Icon String(Poison 2)), Null, Null, Left, 1, Purple,
  • White, White, Visible To and String, Default Visibility);
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Null, Custom String(" "), Null, Left, 1, White, White, White, Visible To and String,
  • Default Visibility);
  • }
  • }
  • rule("Drop Contagion on dead bodies")
  • {
  • event
  • {
  • Player Died;
  • All;
  • All;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 1 || Array Contains(Global.RandomnessIntensifiesArray, 1)) == True;
  • }
  • actions
  • {
  • Global.CurrentPosition = Position Of(Event Player);
  • Global.PositionsArray = Append To Array(Global.PositionsArray, Global.CurrentPosition);
  • "Create ring effect"
  • Create Effect(All Players(All Teams), Ring, Purple, Global.CurrentPosition, Global.Radius, None);
  • "Create cloud effect"
  • Create Effect(All Players(All Teams), Cloud, Purple, Vector(X Component Of(Position Of(Event Player)), Y Component Of(Position Of(
  • Event Player)) - Global.Radius / 8, Z Component Of(Position Of(Event Player))), Global.Radius, None);
  • "Create sparkles effect"
  • Create Effect(All Players(All Teams), Sparkles, Purple, Vector(X Component Of(Position Of(Event Player)), Y Component Of(
  • Position Of(Event Player)) - Global.Radius / 4, Z Component Of(Position Of(Event Player))), Global.Radius, None);
  • }
  • }
  • rule("Spawn Protection")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 1 || Array Contains(Global.RandomnessIntensifiesArray, 1)) == True;
  • Has Spawned(Event Player) == True;
  • Is Alive(Event Player) == True;
  • }
  • actions
  • {
  • Event Player.SpawnTimer = 0;
  • Chase Player Variable Over Time(Event Player, SpawnTimer, 3, 3, Destination and Duration);
  • }
  • }
  • rule("Damage Players in Contagion")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 1 || Array Contains(Global.RandomnessIntensifiesArray, 1)) == True;
  • Is True For Any(Global.PositionsArray, Distance Between(Current Array Element, Event Player) <= Global.Radius) == True;
  • (Event Player.SpawnTimer >= 2) == True;
  • }
  • actions
  • {
  • Damage(Event Player, Null, Global.DamageDealt / 4);
  • Wait(0.250, Ignore Condition);
  • Loop If Condition Is True;
  • }
  • }
  • disabled rule("----- Can't stop, Won't stop ----- = 2")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • }
  • rule("Settings")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 2 || Array Contains(Global.RandomnessIntensifiesArray, 2)) == True;
  • }
  • }
  • rule("Initialise")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 2 || Array Contains(Global.RandomnessIntensifiesArray, 2)) == True;
  • }
  • actions
  • {
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Null, Custom String("You can't stop walking forward!"), Null, Left, 2, White, White, White,
  • Visible To and String, Default Visibility);
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Custom String("{0} Can't stop, Won't stop", Icon String(Exclamation Mark)), Null, Null,
  • Left, 2, Green, White, White, Visible To and String, Default Visibility);
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Null, Custom String(" "), Null, Left, 2, White, White, White, Visible To and String,
  • Default Visibility);
  • }
  • }
  • rule("All players move forward")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 2 || Array Contains(Global.RandomnessIntensifiesArray, 2)) == True;
  • }
  • actions
  • {
  • Start Forcing Throttle(Event Player, 1, 1, 0, 0, 0, 1);
  • }
  • }
  • disabled rule("----- Stay down! ----- = 3")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • }
  • rule("Settings")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 3 || Array Contains(Global.RandomnessIntensifiesArray, 3)) == True;
  • }
  • }
  • rule("Initialise")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 3 || Array Contains(Global.RandomnessIntensifiesArray, 3)) == True;
  • }
  • actions
  • {
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Null, Custom String("Can't jump, and gravity is heavily increased"), Null, Left, 3, White,
  • White, White, Visible To and String, Default Visibility);
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Custom String("{0} Stay down!", Icon String(Stop)), Null, Null, Left, 3, White, White,
  • White, Visible To and String, Default Visibility);
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Null, Custom String(" "), Null, Left, 3, White, White, White, Visible To and String,
  • Default Visibility);
  • }
  • }
  • rule("Gravity rules")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 3 || Array Contains(Global.RandomnessIntensifiesArray, 3)) == True;
  • }
  • actions
  • {
  • Set Gravity(Event Player, 1500);
  • }
  • }
  • rule("Disable jump")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 3 || Array Contains(Global.RandomnessIntensifiesArray, 3)) == True;
  • }
  • actions
  • {
  • Disallow Button(Event Player, Jump);
  • }
  • }
  • disabled rule("----- Hard of seeing ----- = 4")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • }
  • rule("Settings")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 4 || Array Contains(Global.RandomnessIntensifiesArray, 4)) == True;
  • }
  • }
  • rule("Initialise")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 4 || Array Contains(Global.RandomnessIntensifiesArray, 4)) == True;
  • }
  • actions
  • {
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Null, Custom String("Everyone is invisible but can be found by their hero icon"), Null,
  • Left, 4, White, White, White, Visible To and String, Default Visibility);
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Custom String("{0} Hard of seeing", Icon String(Eye)), Null, Null, Left, 4, Turquoise,
  • White, White, Visible To and String, Default Visibility);
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Null, Custom String(" "), Null, Left, 4, White, White, White, Visible To and String,
  • Default Visibility);
  • }
  • }
  • rule("Make all players invisible")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 4 || Array Contains(Global.RandomnessIntensifiesArray, 4)) == True;
  • }
  • actions
  • {
  • Set Invisible(Event Player, All);
  • Create In-World Text(All Players(All Teams), Hero Icon String(Hero Of(Event Player)), Event Player, 2.500, Clip Against Surfaces,
  • Visible To Position and String, White, Default Visibility);
  • }
  • }
  • disabled rule("----- This could get messy ----- = 5")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • }
  • rule("Settings")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 5 || Array Contains(Global.RandomnessIntensifiesArray, 5)) == True;
  • }
  • }
  • rule("Initialise")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 5 || Array Contains(Global.RandomnessIntensifiesArray, 5)) == True;
  • }
  • actions
  • {
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Null, Custom String("When respawning you spawn right on top of someone else"), Null, Left,
  • 5, White, White, White, Visible To and String, Default Visibility);
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Custom String("{0} This could get messy", Icon String(Skull)), Null, Null, Left, 5, Red,
  • White, White, Visible To and String, Default Visibility);
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Null, Custom String(" "), Null, Left, 5, White, White, White, Visible To and String,
  • Default Visibility);
  • }
  • }
  • rule("Player died")
  • {
  • event
  • {
  • Player Died;
  • All;
  • All;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 5 || Array Contains(Global.RandomnessIntensifiesArray, 5)) == True;
  • }
  • actions
  • {
  • Event Player.HasDied = True;
  • }
  • }
  • rule("Teleport player on spawn")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 5 || Array Contains(Global.RandomnessIntensifiesArray, 5)) == True;
  • Is Alive(Event Player) == True;
  • Count Of(All Players(All Teams)) > 1;
  • Count Of(All Living Players(All Teams)) > 0;
  • Event Player.HasDied == True;
  • }
  • actions
  • {
  • Event Player.RandomPlayer = Random Value In Array(Remove From Array(All Living Players(All Teams), Event Player));
  • Teleport(Event Player, Nearest Walkable Position(Vector(X Component Of(Position Of(Event Player.RandomPlayer)), Y Component Of(
  • Position Of(Event Player.RandomPlayer) + 0.500), Z Component Of(Position Of(Event Player.RandomPlayer)))));
  • }
  • }
  • disabled rule("----- I don't do \"bouncy\" ----- = 6")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • }
  • rule("Settings")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 6 || Array Contains(Global.RandomnessIntensifiesArray, 6)) == True;
  • }
  • actions
  • {
  • "Change me to adjust the initial radius of the Resource"
  • Global.JumpHeight = 10;
  • }
  • }
  • rule("Initialise")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 6 || Array Contains(Global.RandomnessIntensifiesArray, 6)) == True;
  • }
  • actions
  • {
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Null, Custom String("You can't stop bouncing!"), Null, Left, 6, Sky Blue, White, White,
  • Visible To and String, Default Visibility);
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Custom String("{0} I don't do 'bouncy'", Icon String(Arrow: Up)), Null, Null, Left, 6,
  • Aqua, White, White, Visible To and String, Default Visibility);
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Null, Custom String(" "), Null, Left, 6, White, White, White, Visible To and String,
  • Default Visibility);
  • }
  • }
  • rule("Bouncy if on the ground")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 6 || Array Contains(Global.RandomnessIntensifiesArray, 6)) == True;
  • Is On Ground(Event Player) == True;
  • }
  • actions
  • {
  • Apply Impulse(Event Player, Up, Global.JumpHeight, To Player, Incorporate Contrary Motion);
  • Wait(0.250, Ignore Condition);
  • Loop If Condition Is True;
  • }
  • }
  • disabled rule("----- Fear of heights ----- = 7")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • }
  • rule("Settings")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 7 || Array Contains(Global.RandomnessIntensifiesArray, 7)) == True;
  • }
  • actions
  • {
  • "Change me to adjust how much damage is dealt when hitting the floor. Higher = more."
  • Global.DamageDealt = 12;
  • }
  • }
  • rule("Initialise")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 7 || Array Contains(Global.RandomnessIntensifiesArray, 7)) == True;
  • }
  • actions
  • {
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Null, Custom String(
  • "Fall damage is enabled! Kill credit goes to those who last hit the target"), Null, Left, 7, Sky Blue, White, White,
  • Visible To and String, Default Visibility);
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Custom String("{0} Fear of heights", Icon String(Warning)), Null, Null, Left, 7, Sky Blue,
  • White, White, Visible To and String, Default Visibility);
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Null, Custom String(" "), Null, Left, 7, White, White, White, Visible To and String,
  • Default Visibility);
  • }
  • }
  • rule("Check vertical speed")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 7 || Array Contains(Global.RandomnessIntensifiesArray, 7)) == True;
  • Altitude Of(Event Player) < 1;
  • Is In Air(Event Player) == True;
  • }
  • actions
  • {
  • Event Player.FallSpeed = Vertical Speed Of(Event Player);
  • }
  • }
  • rule("Player is on the ground")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 7 || Array Contains(Global.RandomnessIntensifiesArray, 7)) == True;
  • Is On Ground(Event Player) == True;
  • Event Player.FallSpeed < -10;
  • }
  • actions
  • {
  • Event Player.DamageToBeDone = Event Player.FallSpeed * Global.DamageDealt * -1;
  • Damage(Event Player, Event Player.LastDamagedBy, Event Player.DamageToBeDone);
  • Play Effect(All Players(All Teams), Explosion Sound, White, Event Player, 5);
  • Play Effect(All Players(All Teams), Bad Explosion, Sky Blue, Event Player, 2);
  • }
  • }
  • rule("Set attacker")
  • {
  • event
  • {
  • Player Took Damage;
  • All;
  • All;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 7 || Array Contains(Global.RandomnessIntensifiesArray, 7)) == True;
  • }
  • actions
  • {
  • Event Player.LastDamagedBy = Attacker;
  • }
  • }
  • rule("Unset attacker")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 7 || Array Contains(Global.RandomnessIntensifiesArray, 7)) == True;
  • Health(Event Player) == Max Health(Event Player);
  • }
  • actions
  • {
  • Event Player.LastDamagedBy = Null;
  • }
  • }
  • disabled rule("----- Bounty Hunter ----- = 8")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • }
  • rule("Settings")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 8 || Array Contains(Global.RandomnessIntensifiesArray, 8)) == True;
  • }
  • actions
  • {
  • "Change me to adjust how many coins spawn on the map. If there are performance problems, reducing this number will certainly help. Don't go higher than 100."
  • Global.MaxCoins = 100;
  • }
  • }
  • rule("Initialise")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 8 || Array Contains(Global.RandomnessIntensifiesArray, 8)) == True;
  • }
  • actions
  • {
  • Global.AllCoinPositions = Empty Array;
  • Global.CoinEffectsArray = Empty Array;
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Null, Custom String(
  • "The player with the most coins at the end of the round gets +5 added to their Kill score"), Null, Left, 8, White, White,
  • White, Visible To and String, Default Visibility);
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Null, Custom String(
  • "Pick up the coins dropped all over the map. Getting killed will drop half your coins."), Null, Left, 8, White, White, White,
  • Visible To and String, Default Visibility);
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Custom String("{0} Bounty Hunter", Icon String(Ring Thick)), Null, Null, Left, 8, Orange,
  • White, White, Visible To and String, Default Visibility);
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Null, Custom String(" "), Null, Left, 8, White, White, White, Visible To and String,
  • Default Visibility);
  • }
  • }
  • rule("Initialise Player")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 8 || Array Contains(Global.RandomnessIntensifiesArray, 8)) == True;
  • }
  • actions
  • {
  • Event Player.AmountOfCoinsToDrop = 0;
  • Event Player.PlayerCoinLoop = 0;
  • Event Player.AmountOfCollectedCoins = 0;
  • Create HUD Text(Event Player, String("{0}: {1}", Custom String("Coins Collected"), Event Player.AmountOfCollectedCoins), Null,
  • Null, Top, 0, Orange, White, White, Visible To and String, Default Visibility);
  • Create In-World Text(All Players(All Teams), Event Player.AmountOfCollectedCoins, Event Player, 2, Clip Against Surfaces,
  • Visible To Position and String, Orange, Default Visibility);
  • }
  • }
  • rule("Subroutine - Spawn a single coin")
  • {
  • event
  • {
  • Subroutine;
  • SpawnCoin;
  • }
  • actions
  • {
  • "Get the position of a random player"
  • Global.PositionOfCurrentCoin = Position Of(Random Value In Array(All Living Players(All Teams)));
  • "Get a position near a player"
  • Global.PositionOfCurrentCoin = Vector(X Component Of(Global.PositionOfCurrentCoin) + Random Real(-20, 20), Y Component Of(
  • Global.PositionOfCurrentCoin) + 0.500, Z Component Of(Global.PositionOfCurrentCoin) + Random Real(-20, 20));
  • "Get nearest walkable position"
  • Global.PositionOfCurrentCoin = Nearest Walkable Position(Global.PositionOfCurrentCoin);
  • "Set position in array"
  • Global.AllCoinPositions[Global.CoinLoop] = Global.PositionOfCurrentCoin;
  • "Create the coin effect"
  • Create Effect(All Players(All Teams), Sphere, Orange, Global.AllCoinPositions[Global.CoinLoop], 0.250, None);
  • Global.CoinEffectsArray[Global.CoinLoop] = Last Created Entity;
  • }
  • }
  • rule("Spawn Coins")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 8 || Array Contains(Global.RandomnessIntensifiesArray, 8)) == True;
  • Count Of(All Players(All Teams)) > 1;
  • }
  • actions
  • {
  • Wait(0.250, Ignore Condition);
  • For Global Variable(CoinLoop, 0, Global.MaxCoins, 1);
  • Call Subroutine(SpawnCoin);
  • disabled Wait(0.250, Ignore Condition);
  • End;
  • }
  • }
  • rule("Check if player is on a coin")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 8 || Array Contains(Global.RandomnessIntensifiesArray, 8)) == True;
  • Is True For Any(Global.AllCoinPositions, Distance Between(Current Array Element, Event Player) <= 1) == True;
  • }
  • actions
  • {
  • For Player Variable(Event Player, PlayerCoinLoop, 0, Count Of(Global.AllCoinPositions), 1);
  • If(Distance Between(Global.AllCoinPositions[Event Player.PlayerCoinLoop], Event Player) <= 1);
  • Global.AllCoinPositions[Event Player.PlayerCoinLoop] = Vector(0, 0, 0);
  • Event Player.AmountOfCollectedCoins += 1;
  • Destroy Effect(Global.CoinEffectsArray[Event Player.PlayerCoinLoop]);
  • Play Effect(Event Player, Buff Explosion Sound, White, Event Player, 75);
  • End;
  • End;
  • }
  • }
  • rule("Player Died with Coins")
  • {
  • event
  • {
  • Player Died;
  • All;
  • All;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 8 || Array Contains(Global.RandomnessIntensifiesArray, 8)) == True;
  • Event Player.AmountOfCollectedCoins > 0;
  • }
  • actions
  • {
  • Play Effect(All Players(All Teams), Good Explosion, Orange, Event Player, 3);
  • "Get number of coins to drop"
  • Event Player.AmountOfCoinsToDrop = Round To Integer(Event Player.AmountOfCollectedCoins / 2, Up);
  • "Set new coin amount"
  • Event Player.AmountOfCollectedCoins = Event Player.AmountOfCollectedCoins - Event Player.AmountOfCoinsToDrop;
  • "Loop to drop all coins"
  • For Player Variable(Event Player, DroppedCoinLoop, 1, Event Player.AmountOfCoinsToDrop, 1);
  • Global.CoinLoop += 1;
  • "Get a position near a player"
  • Global.PositionOfCurrentCoin = Vector(X Component Of(Position Of(Event Player)) + Random Real(-3, 3), Y Component Of(Position Of(
  • Event Player)) + 0.500, Z Component Of(Position Of(Event Player)) + Random Real(-3, 3));
  • "Get nearest walkable position"
  • Global.PositionOfCurrentCoin = Nearest Walkable Position(Global.PositionOfCurrentCoin);
  • "Set position in array"
  • Global.AllCoinPositions[Global.CoinLoop] = Global.PositionOfCurrentCoin;
  • "Create the coin effect"
  • Create Effect(All Players(All Teams), Sphere, Orange, Global.AllCoinPositions[Global.CoinLoop], 0.250, None);
  • Global.CoinEffectsArray[Global.CoinLoop] = Last Created Entity;
  • End;
  • }
  • }
  • rule("On end")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 8 || Array Contains(Global.RandomnessIntensifiesArray, 8)) == True;
  • Global.MomentumMultiplier == True;
  • }
  • actions
  • {
  • Modify Player Score(Last Of(Sorted Array(All Players(All Teams), Current Array Element.AmountOfCollectedCoins)), 5);
  • }
  • }
  • disabled rule("----- Send 'em flying! ----- = 9")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • }
  • rule("Settings")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 9 || Array Contains(Global.RandomnessIntensifiesArray, 9)) == True;
  • }
  • actions
  • {
  • "Change me to adjust how for people go flying"
  • Global.MomentumMultiplier = 2;
  • }
  • }
  • rule("Initialise")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 9 || Array Contains(Global.RandomnessIntensifiesArray, 9)) == True;
  • }
  • actions
  • {
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Null, Custom String("The more damage you deal, the further they fly"), Null, Left, 9,
  • White, White, White, Visible To and String, Default Visibility);
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Null, Custom String("Damaging someone pushes them back away from you."), Null, Left, 9,
  • White, White, White, Visible To and String, Default Visibility);
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Custom String("{0} Send 'em flying!", Icon String(Asterisk)), Null, Null, Left, 9, Blue,
  • White, White, Visible To and String, Default Visibility);
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Null, Custom String(" "), Null, Left, 9, White, White, White, Visible To and String,
  • Default Visibility);
  • }
  • }
  • rule("Player takes damage")
  • {
  • event
  • {
  • Player Took Damage;
  • All;
  • All;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 9 || Array Contains(Global.RandomnessIntensifiesArray, 9)) == True;
  • }
  • actions
  • {
  • Skip If(Event Damage < 10, 3);
  • Apply Impulse(Event Player, Up, Event Damage * Global.MomentumMultiplier * 0.050, To Player, Incorporate Contrary Motion);
  • Apply Impulse(Event Player, Direction Towards(Attacker, Event Player),
  • Event Damage * Global.MomentumMultiplier * 0.050 * Global.MomentumMultiplier, To World, Incorporate Contrary Motion);
  • }
  • }
  • disabled rule("----- PHD Flopper ----- = 10")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • }
  • rule("Settings")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 10 || Array Contains(Global.RandomnessIntensifiesArray, 10)) == True;
  • }
  • actions
  • {
  • "Change me to adjust how much damage is dealt when hitting the floor. Higher = more."
  • Global.FlopperDamage = 250;
  • }
  • }
  • rule("Initialise")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 10 || Array Contains(Global.RandomnessIntensifiesArray, 10)) == True;
  • }
  • actions
  • {
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Null, Custom String("Dealing a large amount of damage to those around you"), Null, Left,
  • 10, White, White, White, Visible To and String, Default Visibility);
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Null, Custom String("Jumping from a great height causes an explosion when landing"), Null,
  • Left, 10, White, White, White, Visible To and String, Default Visibility);
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Custom String("{0} PHD Flopper", Icon String(Fire)), Null, Null, Left, 10, Red, White,
  • White, Visible To and String, Default Visibility);
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Null, Custom String(" "), Null, Left, 10, White, White, White, Visible To and String,
  • Default Visibility);
  • }
  • }
  • rule("Check vertical speed")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 10 || Array Contains(Global.RandomnessIntensifiesArray, 10)) == True;
  • Altitude Of(Event Player) < 1;
  • Is In Air(Event Player) == True;
  • }
  • actions
  • {
  • Event Player.FallSpeed = Vertical Speed Of(Event Player);
  • }
  • }
  • rule("Player is on the ground")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 10 || Array Contains(Global.RandomnessIntensifiesArray, 10)) == True;
  • Is On Ground(Event Player) == True;
  • Event Player.FallSpeed < -15;
  • }
  • actions
  • {
  • Event Player.PlayersInRadius = Empty Array;
  • "Play effects on landing"
  • Play Effect(All Players(All Teams), Debuff Impact Sound, Red, Event Player, 100);
  • Play Effect(All Players(All Teams), Bad Explosion, Red, Event Player, 5);
  • Play Effect(All Players(All Teams), Ring Explosion, Red, Event Player, 5);
  • "Get all players in radius"
  • Event Player.PlayersInRadius = Filtered Array(All Living Players(All Teams), Distance Between(Current Array Element, Event Player)
  • <= 5);
  • "Remove event player from array"
  • Event Player.PlayersInRadius = Remove From Array(Event Player.PlayersInRadius, Event Player);
  • "Loop through players in radius and damage them"
  • For Player Variable(Event Player, ShortLoop, 0, Count Of(Event Player.PlayersInRadius), 1);
  • Apply Impulse(Event Player.PlayersInRadius[Event Player.ShortLoop], Up, 5, To Player, Incorporate Contrary Motion);
  • Apply Impulse(Event Player.PlayersInRadius[Event Player.ShortLoop], Direction Towards(Event Player,
  • Event Player.PlayersInRadius[Event Player.ShortLoop]), 15, To World, Incorporate Contrary Motion);
  • Wait(0.075, Ignore Condition);
  • Damage(Event Player.PlayersInRadius[Event Player.ShortLoop], Event Player, Global.FlopperDamage);
  • End;
  • }
  • }
  • disabled rule("----- Changing Polarity ----- = 11")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • }
  • rule("Settings")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 11 || Array Contains(Global.RandomnessIntensifiesArray, 11)) == True;
  • }
  • }
  • rule("Initialise")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 11 || Array Contains(Global.RandomnessIntensifiesArray, 11)) == True;
  • }
  • actions
  • {
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Null, Custom String("Landing a melee attack will swap their Polarity"), Null, Left, 11,
  • White, White, White, Visible To and String, Default Visibility);
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Null, Custom String(
  • "Damaging someone of the opposit polarity will damage and stun you for a brief moment"), Null, Left, 11, White, White, White,
  • Visible To and String, Default Visibility);
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Null, Custom String("Everyone is given Positive or Negative polarity on spawning"), Null,
  • Left, 11, White, White, White, Visible To and String, Default Visibility);
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Custom String("{0} Changing Polarity", Icon String(Bolt)), Null, Null, Left, 11, Yellow,
  • White, White, Visible To and String, Default Visibility);
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Null, Custom String(" "), Null, Left, 11, White, White, White, Visible To and String,
  • Default Visibility);
  • }
  • }
  • rule("Give player random polarity")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 11 || Array Contains(Global.RandomnessIntensifiesArray, 11)) == True;
  • Is Alive(Event Player) == True;
  • }
  • actions
  • {
  • Event Player.PositivePolarity = Random Value In Array(Global.TrueFalseArray);
  • }
  • }
  • rule("Player has positive polarity")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 11 || Array Contains(Global.RandomnessIntensifiesArray, 11)) == True;
  • Event Player.PositivePolarity == True;
  • }
  • actions
  • {
  • Destroy Effect(Event Player.PolarityEffect);
  • Destroy In-World Text(Event Player.PolarityIcon);
  • Destroy HUD Text(Event Player.PolarityHud);
  • Wait(0.050, Ignore Condition);
  • Create Effect(All Players(All Teams), Ring, Yellow, Event Player, 0.500, Visible To Position and Radius);
  • Event Player.PolarityEffect = Last Created Entity;
  • Create In-World Text(All Players(All Teams), Custom String("+"), Event Player, 2, Clip Against Surfaces,
  • Visible To Position and String, Yellow, Default Visibility);
  • Event Player.PolarityIcon = Last Text ID;
  • Create HUD Text(Event Player, Custom String("You are Positively charged"), Null, Null, Top, 2, Yellow, White, White,
  • Visible To and String, Default Visibility);
  • Event Player.PolarityHud = Last Text ID;
  • }
  • }
  • rule("Player has negative polarity")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 11 || Array Contains(Global.RandomnessIntensifiesArray, 11)) == True;
  • Event Player.PositivePolarity == False;
  • }
  • actions
  • {
  • Destroy Effect(Event Player.PolarityEffect);
  • Destroy In-World Text(Event Player.PolarityIcon);
  • Destroy HUD Text(Event Player.PolarityHud);
  • Wait(0.050, Ignore Condition);
  • Create Effect(All Players(All Teams), Ring, Blue, Event Player, 0.500, Visible To Position and Radius);
  • Event Player.PolarityEffect = Last Created Entity;
  • Create In-World Text(All Players(All Teams), Custom String("-"), Event Player, 2, Clip Against Surfaces,
  • Visible To Position and String, Blue, Default Visibility);
  • Event Player.PolarityIcon = Last Text ID;
  • Create HUD Text(Event Player, Custom String("You are Negatively charged"), Null, Null, Top, 2, Blue, White, White,
  • Visible To and String, Default Visibility);
  • Event Player.PolarityHud = Last Text ID;
  • }
  • }
  • rule("Player dealt damage")
  • {
  • event
  • {
  • Player Dealt Damage;
  • All;
  • All;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 11 || Array Contains(Global.RandomnessIntensifiesArray, 11)) == True;
  • }
  • actions
  • {
  • If(Event Player.PositivePolarity != Victim.PositivePolarity);
  • Set Status(Event Player, Victim, Stunned, 1);
  • Damage(Event Player, Null, 50);
  • End;
  • }
  • }
  • rule("Player dealt melee damage")
  • {
  • event
  • {
  • Player Dealt Damage;
  • All;
  • All;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 11 || Array Contains(Global.RandomnessIntensifiesArray, 11)) == True;
  • Distance Between(Event Player, Victim) <= 3;
  • (Event Damage == 30 || Event Damage == 25) == True;
  • }
  • actions
  • {
  • If(Victim.PositivePolarity == True);
  • Victim.PositivePolarity = False;
  • Else;
  • Victim.PositivePolarity = True;
  • End;
  • }
  • }
  • disabled rule("----- Out of body experience ----- = 12")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • }
  • rule("Settings")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 12 || Array Contains(Global.RandomnessIntensifiesArray, 12)) == True;
  • }
  • }
  • rule("Initialise")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 12 || Array Contains(Global.RandomnessIntensifiesArray, 12)) == True;
  • }
  • actions
  • {
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Null, Custom String("Yes, it's janky"), Null, Left, 12, White, White, White,
  • Visible To and String, Default Visibility);
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Null, Custom String("You're stuck in Third Person"), Null, Left, 12, White, White, White,
  • Visible To and String, Default Visibility);
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Custom String("{0} Out of body experience", Icon String(Dizzy)), Null, Null, Left, 12,
  • White, White, White, Visible To and String, Default Visibility);
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Null, Custom String(" "), Null, Left, 12, White, White, White, Visible To and String,
  • Default Visibility);
  • }
  • }
  • rule("Set Third Person")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 12 || Array Contains(Global.RandomnessIntensifiesArray, 12)) == True;
  • Is Alive(Event Player) == True;
  • }
  • actions
  • {
  • Wait(0.250, Ignore Condition);
  • Start Camera(Event Player, Ray Cast Hit Position(Eye Position(Event Player), Eye Position(Event Player) + World Vector Of(Vector(
  • -1, 0, 0), Event Player, Rotation) + Facing Direction Of(Event Player) * -2.500, All Players(All Teams), Event Player, False),
  • Ray Cast Hit Position(Eye Position(Event Player), Eye Position(Event Player) + Facing Direction Of(Event Player) * 200,
  • All Players(All Teams), Event Player, False), 60);
  • }
  • }
  • disabled rule("----- Soulmates ----- = 13")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • }
  • rule("Settings")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 13 || Array Contains(Global.RandomnessIntensifiesArray, 13)) == True;
  • }
  • }
  • rule("Initialise")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 13 || Array Contains(Global.RandomnessIntensifiesArray, 13)) == True;
  • }
  • actions
  • {
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Null, Custom String(
  • "Any healing or damage that happens to you also happens to your soulmate, and vice versa"), Null, Left, 13, White, White,
  • White, Visible To and String, Default Visibility);
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Null, Custom String("You have a soulmate, yay!"), Null, Left, 13, White, White, White,
  • Visible To and String, Default Visibility);
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Custom String("{0} Soulmates", Icon String(Heart)), Null, Null, Left, 13, Red, White,
  • White, Visible To and String, Default Visibility);
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Null, Custom String(" "), Null, Left, 13, White, White, White, Visible To and String,
  • Default Visibility);
  • }
  • }
  • rule("Pick soulmates")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 13 || Array Contains(Global.RandomnessIntensifiesArray, 13)) == True;
  • }
  • actions
  • {
  • Global.AvailableSoulmates = All Players(All Teams);
  • "Pick 1 player and remove it from the list of possible choices"
  • While(Count Of(Global.AvailableSoulmates) > 1);
  • Global.Player1 = Random Value In Array(Global.AvailableSoulmates);
  • Global.Player2 = Random Value In Array(Remove From Array(Global.AvailableSoulmates, Global.Player1));
  • Global.Player1.Soulmate = Global.Player2;
  • Global.Player2.Soulmate = Global.Player1;
  • Global.AvailableSoulmates = Remove From Array(Global.AvailableSoulmates, Global.Player1);
  • Global.AvailableSoulmates = Remove From Array(Global.AvailableSoulmates, Global.Player2);
  • End;
  • }
  • }
  • rule("Initialise player")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 13 || Array Contains(Global.RandomnessIntensifiesArray, 13)) == True;
  • }
  • actions
  • {
  • Wait(0.016, Ignore Condition);
  • "Show who is your soulmate, or show when no soulmate was selected"
  • Create HUD Text(Event Player, Null, Custom String(" "), Custom String("{0} Your Soulmate: {1}", Icon String(Heart),
  • Event Player.Soulmate ? Custom String("{0} {1}", Event Player.Soulmate, Hero Icon String(Hero Of(Event Player.Soulmate)))
  • : Custom String("No one, sorry :(")), Top, 1, White, White, White, Visible To and String, Default Visibility);
  • If(Event Player.Soulmate);
  • Create Icon(Event Player, Event Player.Soulmate, Heart, Visible To and Position, Red, True);
  • Create Beam Effect(Event Player, Good Beam, Event Player, Event Player.Soulmate, Red, Visible To Position and Radius);
  • End;
  • }
  • }
  • rule("Player receives damage while soul linked")
  • {
  • event
  • {
  • Player Took Damage;
  • All;
  • All;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 13 || Array Contains(Global.RandomnessIntensifiesArray, 13)) == True;
  • Event Player.Soulmate != False;
  • Event Ability != Null;
  • }
  • actions
  • {
  • Damage(Event Player.Soulmate, Attacker, Event Damage);
  • }
  • }
  • rule("Player receives healing while soul linked")
  • {
  • event
  • {
  • Player Received Healing;
  • All;
  • All;
  • }
  • conditions
  • {
  • (Global.CurrentRandomEffect == 13 || Array Contains(Global.RandomnessIntensifiesArray, 13)) == True;
  • Event Player.Soulmate != False;
  • Event Ability != Null;
  • }
  • actions
  • {
  • Heal(Event Player.Soulmate, Event Player, Event Healing);
  • }
  • }
  • disabled rule("----- Randomness Intensifies ----- = Last")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • }
  • rule("Settings")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • Global.CurrentRandomEffect == Global.TotalAmountOfEffects - 1;
  • }
  • }
  • rule("Initialise")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • Global.CurrentRandomEffect == Global.TotalAmountOfEffects - 1;
  • }
  • actions
  • {
  • "Build Randomness array, without Randomness Intensifies"
  • For Global Variable(Loop, 0, Global.TotalAmountOfEffects - 1, 1);
  • Global.ArrayForRandomat[Global.Loop] = Global.Loop;
  • End;
  • Wait(0.050, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Null, Custom String("3 Random effects are enabled at once! Good luck"), Null, Left, -1,
  • White, White, White, Visible To and String, Default Visibility);
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Custom String("{0} Randomness Intensifies", Icon String(Spiral)), Null, Null, Left, -1,
  • Lime Green, White, White, Visible To and String, Default Visibility);
  • Wait(0.016, Ignore Condition);
  • Create HUD Text(All Players(All Teams), Null, Custom String(" "), Null, Left, -1, White, White, White, Visible To and String,
  • Default Visibility);
  • }
  • }
  • rule("Pick 3 random events")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • Global.CurrentRandomEffect == Global.TotalAmountOfEffects - 1;
  • }
  • actions
  • {
  • For Global Variable(Loop, 0, 3, 1);
  • Global.RandomValue = Random Value In Array(Global.ArrayForRandomat);
  • Global.ArrayForRandomat = Remove From Array(Global.ArrayForRandomat, Global.RandomValue);
  • Global.RandomnessIntensifiesArray[Global.Loop] = Global.RandomValue;
  • End;
  • Call Subroutine(MakeRandomnessArray);
  • }
  • }
Join the Workshop.codes Discord