Untitled

mail@pastecode.io avatar
unknown
plain_text
8 months ago
182 kB
2
Indexable
Never
variables
{
	global:
		0: EditMode
		1: NewCheckpointDefaultRadius
		2: NewCheckpointDefaultCtrl
		3: NewCheckpointDefaultMaxRefresh
		4: BotGravity
		5: Error
		6: TeleportAnimation
		7: Cheat
		8: FinishedCheat
		9: Sparkle
		10: FinishedDisplaySparkle
		11: Aura
		12: FinishedDisplayAura
		13: Dome
		14: FinishedDisplayDome
		15: Hexagram
		16: FinishedDisplayHexagram
		17: Checkpoint
		18: ChooseOrbPosition
		19: ChooseSpherePosition
		20: ChooseCloudPosition
		21: CurrentChooseOrb
		22: CurrentChooseSphere
		23: CurrentChooseCloud
		24: TempArray
		25: I
		26: Once
		27: NumberOfUsedEntity
		28: Vips
		29: CircleLoop
		30: Chase
		31: PlayersRecord
		32: PlayersData
		33: Top5
		34: TipHudSpaceHolder
		35: OnGround
		36: CreatorAndCode
		37: FirstPlaceTimeArray
		38: Config
		39: Top5Color
		40: WorldTexts
		41: BigMessages
		42: SmallMessages
		43: Tips
		44: Debug
		45: II
		46: ShowHotKeyPlayers
		47: EmoteSyncPlayers
		48: PreviewPosition
		49: CheckpointBPosition
		50: TempVar
		52: nullTimeArray
		53: FirstPlaceTimeString
		54: FirstPlaceTime

	player:
		0: editMode
		1: checkpoint
		2: third
		3: freeMode
		4: spectatorMode
		5: cheat
		6: time
		7: mistake
		8: sphereEffects
		9: cloudEffects
		10: objectivePosition
		11: displayedCheckpoint
		13: bhop
		14: bestRecord
		15: playerData
		16: tempCurrentOrb
		17: chooseHero
		18: playerEffect
		19: choosePlayerEffect
		20: isSetAbilities
		21: voice
		22: bodySize
		23: barrierSize
		24: projectile
		25: playerColor
		26: playerNickname
		27: currentWorldText
		28: recentDamage
		29: currentBigMessage
		30: currentSmallMessage
		31: i
		32: dataIndex
		33: tp
		34: leaveOriginalCheckpoint
		35: finished
		36: checkpointA
		37: checkpointB
		38: currentCheckpoint
		39: currentCloud
		40: currentSphere
		41: currentOrb
		42: orbEffects
		43: orbIcons
		44: botIcons
		45: nearestOrb
		46: botEffects
		47: targetBot
		48: movementCollision
		50: resurrectNumber
		51: numberOfNeedResurrect
		52: ability2
		53: killTargetBot
		54: playerTittle
		55: segmentTimeString
		56: segmentTimeArray
		57: segmentVsPersonalBestArray
		58: segmentStart
		59: segmentEnd
		60: personalBestString
		61: segmentTimeArrayCounter
		62: personalBestArray
		63: vsPersonalBestRunningTally
		64: sumOfBestSegments
		65: bestSegmentsArray
		66: bestSegmentsArrayString
		67: editModeCharacterResetted
}

subroutines
{
	0: CreateNewEffect
	1: EditChoosedEffect
	2: CreatePlayerHUDAndEffects
	3: InitializePlayerVariables
	4: CreatePlayerTargetBot
	5: SetCurrentAbilities
	6: DisplayCurrentAbilityMsgs
	7: CreateCurrentEffects
	8: GetCurrentCheckpoint
	9: EditPlayerData
	10: TempSavePlayerData
	11: CreateGlobalHUD
	12: TeleportCurrentBot
	13: CreateCurrentWorldText
	14: DisplayCurrentCustomBigMsgs
	15: DisplayCurrentCustomSmallMsgs
	16: InitializeGlobalVariables
	17: TeleportToCurrentCheckoint
	18: ValidationPlayerData
	19: ClearRedundantData
	20: PlayDestroyMapEffect
	21: CancelAbilityAndMomentum
	22: EnableAllAbilities
	23: ContinueTiming
	24: ErrorWarningMessage
	25: TeleportBotToRefreshPosition
	26: SkipOrBackCheckpoint
	27: ChooseCheckpoint
	28: KillOrResurrectBot
}

rule("Put the data here (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Global;
	}

	actions
	{
		Global.Checkpoint = Array(Array(Vector(14.026, -2.071, -135.350), 3, True, Array(Vector(51.042, 0, -107.917), False, True), False,
			False, Empty Array, Empty Array, Empty Array), Array(Vector(24.114, -5.379, -150.718), 3, True, Array(Vector(36.391, 4,
			-119.672), False, True), False, False, Empty Array, Empty Array, Empty Array), Array(Vector(48.345, 1, -146.183), 3, True,
			Array(Vector(60.726, 1, -113.809), False, True), False, False, Empty Array, Array(Array(Vector(52.891, 1.750, -138.519), 4)),
			Empty Array), Array(Vector(61.111, -6.263, -130.171), 3, True, Array(Vector(29.703, 4, -106.197), False, True), False, False,
			Empty Array, Empty Array, Empty Array), Array(Vector(57.045, 9.401, -118.030), 3, True, Array(Vector(5.057, -5, -75.838),
			False, True), False, False, Empty Array, Empty Array, Empty Array), Array(Vector(29.164, 0, -99.137), 3, True, Array(Vector(
			21.568, 3, -62.394), False, True), False, False, Empty Array, Empty Array, Empty Array), Array(Vector(39.774, 0, -95.842), 3,
			True, Array(False, False, True), False, False, Array(Array(Vector(52.701, 3.051, -111.193), False, False, True)), Empty Array,
			Empty Array), Array(Vector(58.356, 1, -110.599), 3, True, Array(Vector(18.169, 6, -131.047), False, True), False, False,
			Empty Array, Empty Array, Empty Array), Array(Vector(46.896, -5.869, -124.632), 3, True, Array(Vector(36.170, -2, -154.229),
			False, True), False, False, Empty Array, Empty Array, Empty Array), Array(Vector(43.230, 4.010, -128.602), 3, True, Array(
			False, False, True), False, False, Array(Array(Vector(28.968, 4.750, -115.615), False, False, True)), Empty Array,
			Empty Array), Array(Vector(25.016, 4, -110.987), 3, True, Array(False, False, True), False, False, Empty Array, Empty Array,
			Empty Array), Array(Vector(29.063, 4, -107.228), 3, True, Array(Vector(22.204, -5, -58.881), False, True), False, False,
			Empty Array, Empty Array, Empty Array), Array(Vector(21.842, -5.185, -85.652), 3, True, Array(Vector(12.071, 3, -69.083),
			False, True), False, False, Empty Array, Empty Array, Empty Array), Array(Vector(30.467, 3.013, -82.765), 3, True, Array(False,
			False, True), False, False, Empty Array, Empty Array, Empty Array), Array(Vector(23.624, 3, -57.825), 3, True, Array(Vector(
			55.752, -1, -80.878), False, True), False, False, Empty Array, Empty Array, Empty Array), Array(Vector(32.863, 3, -50.725), 3,
			True, Array(Vector(44.200, 3, -32.570), False, True), False, False, Empty Array, Empty Array, Empty Array), Array(Vector(
			53.428, 9.817, -44.362), 3, True, Array(Vector(61.590, -0.279, -25.435), False, True), False, False, Empty Array, Empty Array,
			Empty Array), Array(Vector(76.926, 3, -37.426), 3, True, Array(Vector(22.803, 3.038, -58.085), False, True), False, False,
			Empty Array, Empty Array, Empty Array), Array(Vector(60.052, 9.683, -32.745), 3, True, Array(Vector(45.074, 3.020, -33.537),
			False, True), False, False, Empty Array, Empty Array, Empty Array), Array(Vector(40.621, -5.012, -45.587), 3, True, Array(
			Vector(55.058, 3.342, -41.403), False, True), False, False, Empty Array, Empty Array, Empty Array), Array(Vector(34.967, 6.537,
			-48.064), 3, True, Array(Vector(65.580, -3.003, -15.904), False, True), False, False, Empty Array, Empty Array, Empty Array),
			Array(Vector(59.521, -0.134, -24.925), 3, True, Array(Vector(86.821, 3, -30.511), False, True), False, False, Empty Array,
			Empty Array, Empty Array), Array(Vector(76.841, 3, -38.467), 3, True, Array(False, False, True), False, False, Empty Array,
			Empty Array, Empty Array), Array(Vector(90.170, 3, -26.428), 3, True, Array(Vector(99.698, 2.745, -16.946), False, True),
			False, False, Empty Array, Empty Array, Empty Array), Array(Vector(74.322, -3.202, -17.343), 3, True, Array(Vector(57.391, 9,
			2.336), False, True), False, False, Empty Array, Empty Array, Empty Array), Array(Vector(80.210, -3.219, -0.552), 3, True,
			Array(Vector(82.481, 1, 56.559), False, True), False, False, Empty Array, Empty Array, Empty Array), Array(Vector(85.770, 6,
			7.659), 3, True, Array(Vector(49.188, 9, 9.363), False, True), False, False, Empty Array, Empty Array, Empty Array), Array(
			Vector(71.808, 9, 23.775), 3, True, Array(Vector(76.303, -3.189, -15.412), False, True), False, False, Empty Array,
			Empty Array, Empty Array), Array(Vector(58.075, 8.354, 20.509), 3, True, Array(Vector(90.053, 6, 8.427), False, True), False,
			False, Empty Array, Empty Array, Empty Array), Array(Vector(53.044, 9, -1.591), 3, True, Array(Vector(89.757, -0.941, 38.951),
			False, True), False, False, Empty Array, Empty Array, Empty Array), Array(Vector(58.679, 0.521, 16.140), 3, True, Array(Vector(
			58.846, 7.422, 36.705), False, True), False, False, Empty Array, Empty Array, Empty Array), Array(Vector(77.706, 9, 18.105), 3,
			True, Array(Vector(74.485, 1.039, 56.789), False, True), False, False, Empty Array, Empty Array, Empty Array), Array(Vector(
			93.451, -0.941, 36.701), 3, True, Array(Vector(58.777, 1, 3.217), False, True), False, False, Empty Array, Empty Array,
			Empty Array), Array(Vector(80.451, 0.418, 51.217), 3, True, Array(Vector(57.905, 9, 3.407), False, True), False, False,
			Empty Array, Empty Array, Empty Array), Array(Vector(94.243, -0.941, 36.054), 3, True, Array(False, False, True), False, False,
			Empty Array, Empty Array, Empty Array), Array(Vector(71.825, -0.041, 31.656), 3, True, Array(Vector(54.290, 9, -0.954), False,
			True), False, False, Array(Array(Vector(66.672, 12.043, 21.969), Vector(77.218, 1.881, -10.263), False, True)), Empty Array,
			Empty Array), Array(Vector(53.444, 1, 12.011), 3, True, Array(Vector(58.852, 8.354, 21.015), False, True), False, False,
			Empty Array, Empty Array, Empty Array), Array(Vector(59.729, 9, -0.099), 3, True, Array(Vector(86.113, 3, -28.239), False,
			True), False, False, Empty Array, Empty Array, Empty Array), Array(Vector(83.500, 6, 5.174), 3, True, Array(Vector(83.161, 1,
			56.539), False, True), False, False, Empty Array, Empty Array, Empty Array), Array(Vector(79.297, 1, 27.066), 3, True, Array(
			False, False, True), False, False, Empty Array, Empty Array, Empty Array), Array(Vector(74.213, 4.074, 45.404), 3, True, Array(
			Vector(69.186, 9, 26.647), False, True), False, False, Empty Array, Empty Array, Empty Array), Array(Vector(82.510, -0.480,
			40.017), 6, True, Array(False, False, True), False, False, Empty Array, Empty Array, Empty Array));
	}
}

rule("Creator and code (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Global;
	}

	actions
	{
		"String, Fill in the creator"
		Global.CreatorAndCode[0] = Custom String("EggsBenna on TikTok");
		"String, Fill in the code"
		Global.CreatorAndCode[1] = Custom String("Y4Q4E");
	}
}

rule("HUD guidance text (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Global;
	}

	actions
	{
		Global.Tips[0] = Custom String("WELCOME! FOR MORE MAPS,\nCHECK OUT MY TIKTOK @EGGSBENNA ♡");
		Global.Tips[2] = Custom String("WALK OFF THE LEDGE THEN GRAPPLE");
		Global.Tips[4] = Custom String("WALK OFF THE LEDGE AND THEN GRAPPLE FOR MORE HEIGHT");
		Global.Tips[20] = Custom String("WALK OFF THEN GRAPPLE TO THE END OF THE WING");
		Global.Tips[28] = Custom String("WALK OFF THE LEDGE AND THEN GRAPPLE FOR MORE HEIGHT");
		Global.Tips[35] = Custom String("THIS HAS 2 BOTS TO KILL, GRAB THE ORB AFTER YOUR FIRST ELIM THEN GRAPPLE AND ELIM THE NEXT");
		Global.Tips[37] = Custom String("WALK OFF THE LEDGE AND THEN GRAPPLE FOR MORE HEIGHT");
		Global.Tips[40] = Custom String("THANKS FOR PLAYING! ♡");
		Global.Tips[15] = Custom String("WALK OFF THE LEDGE AND THEN GRAPPLE FOR MORE HEIGHT");
	}
}

rule("Big message text (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Global;
	}

	actions
	{
		"index, Fill in the level;    \r\n string, Fill in the text (Multiple texts in one level)"
		Global.BigMessages[0] = Array(Custom String(""), Custom String(""));
	}
}

rule("Small message text (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Global;
	}

	actions
	{
		"index, Fill in the level;    \r\nString, Fill in the text (Multiple texts in one level)"
		Global.SmallMessages[0] = Array(Custom String(""), Custom String(""));
	}
}

rule("Player title (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Global;
	}

	actions
	{
		Global.Vips = Array(Array(Custom String("Peace"), Custom String("{0} Peace", Ability Icon String(Hero(Mercy), Button(Ability 1))),
			Color(White)), Array(Custom String("冰丶柠檬"), Custom String("{0} IceLemon", Ability Icon String(Hero(Ana), Button(Ability 1))),
			Color(White)), Array(Custom String("Sera"), Custom String(""), Color(White)), Array(Custom String("풋사과의그린애플"), Custom String(
			""), Color(Green)), Array(Custom String("kroissant"), Custom String(""), Color(Sky Blue)));
		Global.Vips[Count Of(Global.Vips)] = Array(Custom String("Felicity"), Custom String("{0}Felicity{0}", Ability Icon String(Hero(
			Kiriko), Button(Ultimate))), Custom Color(126, 132, 247, 211));
		Global.Vips[Count Of(Global.Vips)] = Array(Custom String(""), Custom String(""), Color(White));
		Global.Vips[Count Of(Global.Vips)] = Array(Custom String(""), Custom String(""), Color(White));
	}
}

rule("Personalized Configuration (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Global;
	}

	actions
	{
		"Ring color of this level"
		Global.Config[0] = Color(Purple);
		"Bot icon color (Crouch Enabled)"
		Global.Config[1] = Color(Red);
		"Next checkpoint text"
		Global.Config[2] = Custom String("over here!");
		"Next checkpoint text size"
		Global.Config[3] = 1.600;
		"Next checkpoint text color"
		Global.Config[4] = Color(Rose);
		"Next checkpoint icon color"
		Global.Config[5] = Color(Purple);
		"Next checkpoint effect color"
		Global.Config[6] = Color(Purple);
		"Next checkpoint ring color"
		Global.Config[7] = Color(Rose);
		"Next Checkpoint effect: 0 = Light Shaft; 1 = sparkle; 2 = cloud; 3 = Harmful Aura"
		Global.Config[8] = 1;
		"TP checkpoint effect color"
		Global.Config[9] = Color(Rose);
		"TP checkpoint ring color"
		Global.Config[10] = Color(Rose);
		"Bot name text"
		Global.Config[11] = Custom String("`s widow");
		"Creator, code text color"
		Global.Config[12] = Color(Purple);
		"Level Progress text"
		Global.Config[13] = Custom String("Level Progress");
		"Level Progress text color"
		Global.Config[14] = Color(White);
		"Free mode enabled text"
		Global.Config[15] = Custom String("Free mode enabled");
		"Spectator mode enabled text"
		Global.Config[16] = Custom String("Spectator mode enabled");
		"Crouch disabled text"
		Global.Config[17] = Custom String("{0}Crouch Disabled", Icon String(No));
		"Crouch enabled text"
		Global.Config[18] = Custom String("Crouch Enabled");
		"No target bot text"
		Global.Config[19] = Custom String("no widow for this level");
		"Need get orb text \r\nDisplay if not filled in: \r\nThis level has {number} orbs to pick up"
		Global.Config[20] = Custom String("");
		"Get orb text"
		Global.Config[21] = Custom String("BINGO");
		"Arrive but no get all the orbs"
		Global.Config[22] = Custom String("You have to pick up the orb");
		"Ga refresh text"
		Global.Config[23] = Custom String("{0} Also refreshed!", Ability Icon String(Hero(Mercy), Button(Ability 1)));
		"Top5 text\r\nDisplay if not filled in: \r\nToday`s Top {number}"
		Global.Config[24] = Custom String("");
		"Top5 text color"
		Global.Config[25] = Color(Purple);
		"Other winner text"
		Global.Config[26] = Custom String("HighLights");
		"Other winner text color"
		Global.Config[27] = Color(Rose);
		"Other winner ranking color"
		Global.Config[28] = Color(White);
		"Unlimited Ga text"
		Global.Config[29] = Custom String("{0} set to unlimited", Ability Icon String(Hero(Mercy), Button(Ability 1)));
		"Single Ga text"
		Global.Config[30] = Custom String("{0} set to single", Ability Icon String(Hero(Mercy), Button(Ability 1)));
		"Get bhop text"
		Global.Config[31] = Custom String("Get bhop");
		"Resurrection success text"
		Global.Config[32] = Custom String("You have successfully resurrected the target");
		"Arrive but no resurrect bot"
		Global.Config[33] = Custom String("kill widow then collect all the orbs (if there are any).");
		"Obstacle sphere color"
		Global.Config[40] = Color(Black);
		"Elastic cloud color"
		Global.Config[41] = Color(Rose);
		"Orb color(Plus)"
		Global.Config[42] = Color(Rose);
		"Orb icon color(Plus)"
		Global.Config[43] = Color(Rose);
		"Orb color(Refresh)"
		Global.Config[44] = Color(Purple);
		"Orb icon color(Refresh)"
		Global.Config[45] = Color(Purple);
		"Bot teleport position icon color"
		Global.Config[46] = Color(Purple);
		"Bot teleport position effect color"
		Global.Config[47] = Color(Purple);
		"Orb icon color(Refresh, Need Resurrect)"
		Global.Config[48] = Color(Red);
		"Bot teleport position icon color(Refresh, Need Resurrect)"
		Global.Config[49] = Color(Red);
		"Bot teleport position effect color(Refresh, Need Resurrect)"
		Global.Config[50] = Color(Red);
		"Bot default position"
		Global.Config[60] = Vector(0, -999, 0);
		"Dome personalization configuration: [0] color; [1] postion; [2] radius"
		Global.Config[61] = Array(Color(Violet), (Nearest Walkable Position(Vector(500, -500, 500)) + Nearest Walkable Position(Vector(
			-500, -500, -500))) / 2, 10000);
		"Six-man star personalized configuration: [0] color; [1] postion; [2] radius"
		Global.Config[62] = Array(Color(Violet), (Nearest Walkable Position(Vector(500, -500, 500)) + Nearest Walkable Position(Vector(
			-500, -500, -500))) / 2 + Vector(0, 100, 0), 45);
	}
}

rule("Global initialization (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Global;
	}

	actions
	{
		Call Subroutine(InitializeGlobalVariables);
		Disable Built-In Game Mode Announcer;
		Disable Built-In Game Mode Scoring;
		Disable Built-In Game Mode Music;
		Disable Built-In Game Mode Completion;
		If(!Global.Debug);
			Disable Inspector Recording;
		End;
		Call Subroutine(CreateGlobalHUD);
		If(Current Game Mode != Game Mode(Skirmish));
			Set Match Time(1);
		End;
		Pause Match Time;
	}
}

rule("Player initialization (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Has Spawned(Event Player) == True;
	}

	actions
	{
		"@Condition eventPlayer.isDummy() == false"
		Disable Game Mode In-World UI(Event Player);
		Disable Nameplates(All Players(All Teams), All Players(All Teams));
		Enable Death Spectate All Players(Event Player);
		Enable Death Spectate Target HUD(Event Player);
		If(Current Game Mode != Game Mode(Skirmish));
			Disable Game Mode HUD(Event Player);
		End;
		Call Subroutine(InitializePlayerVariables);
		Call Subroutine(ValidationPlayerData);
		Teleport(Event Player, Global.Checkpoint[Event Player.checkpoint] ? First Of(Global.Checkpoint[Event Player.checkpoint])
			: Event Player);
		Call Subroutine(CreatePlayerTargetBot);
		Call Subroutine(CreatePlayerHUDAndEffects);
		Call Subroutine(GetCurrentCheckpoint);
		If(!Event Player.finished);
			Call Subroutine(SetCurrentAbilities);
		End;
		Call Subroutine(TeleportCurrentBot);
		Call Subroutine(DisplayCurrentAbilityMsgs);
		Start Rule(CreateCurrentEffects, Restart Rule);
		Call Subroutine(CreateCurrentWorldText);
		Start Rule(DisplayCurrentCustomBigMsgs, Do Nothing);
		Start Rule(DisplayCurrentCustomSmallMsgs, Do Nothing);
	}
}

rule("Switch edit mode (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Global.EditMode == True;
		Event Player == Host Player;
		Is Button Held(Event Player, Button(Interact)) == True;
		Is Button Held(Event Player, Button(Ability 1)) == False;
		Is Button Held(Event Player, Button(Primary Fire)) == False;
		Is Button Held(Event Player, Button(Secondary Fire)) == False;
		Is Button Held(Event Player, Button(Ability 2)) == False;
		Is Button Held(Event Player, Button(Ultimate)) == False;
		Is Button Held(Event Player, Button(Jump)) == False;
		Is Button Held(Event Player, Button(Crouch)) == False;
		Is Button Held(Event Player, Button(Melee)) == False;
		Is Button Held(Event Player, Button(Reload)) == False;
	}

	actions
	{
		Wait Until(!Is Button Held(Event Player, Button(Interact)), 9999);
		Wait Until(Is Button Held(Event Player, Button(Interact)), 0.300);
		If(Is Button Held(Event Player, Button(Interact)));
			Event Player.editMode += Event Player.editMode == 4 ? -3 : 1;
			Event Player.nearestOrb = Null;
			Call Subroutine(KillOrResurrectBot);
			Small Message(All Players(All Teams), Custom String("Swtiched to {0} mode", Array(Null, Custom String("Checkpoint"), Custom String(
				"Orb"), Custom String("Sphere"), Custom String("Cloud"))[Event Player.editMode]));
			Play Effect(Event Player, Ring Explosion Sound, Null, Event Player, 100);
	}
}

rule("create / delete checkpoint, orb, sphere, cloud (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Global.EditMode == True;
		Event Player == Host Player;
		Is Button Held(Event Player, Button(Interact)) == True;
		(Is Button Held(Event Player, Button(Primary Fire)) || Is Button Held(Event Player, Button(Secondary Fire))) == True;
		Is Button Held(Event Player, Button(Ability 1)) == False;
		Is Button Held(Event Player, Button(Ability 2)) == False;
		Is Button Held(Event Player, Button(Ultimate)) == False;
		Is Button Held(Event Player, Button(Jump)) == False;
		Is Button Held(Event Player, Button(Crouch)) == False;
		Is Button Held(Event Player, Button(Melee)) == False;
		Is Button Held(Event Player, Button(Reload)) == False;
	}

	actions
	{
		If(Is Button Held(Event Player, Button(Primary Fire)));
			If(Event Player.editMode == 1);
				"1, checkpoint radius\r\n2, crouch\r\n3, bot, default empty array(BotVector, NeedResurrect, RefreshAbility1)\r\n4, unlimited ga\r\n5, teleport, defalut false\r\n6, orb, default empty array\r\n7, sphere, default empty array\r\n8, cloud, default empty array"
				Global.Checkpoint[Count Of(Global.Checkpoint)] = Array(Position Of(Event Player), Global.NewCheckpointDefaultRadius,
					Global.NewCheckpointDefaultCtrl, Array(False, False, True), Global.NewCheckpointDefaultMaxRefresh, False, Empty Array,
					Empty Array, Empty Array);
				Event Player.checkpoint = Count Of(Global.Checkpoint) - 1;
				Call Subroutine(GetCurrentCheckpoint);
				Call Subroutine(TeleportCurrentBot);
				Start Rule(CreateCurrentEffects, Restart Rule);
				Small Message(All Players(All Teams), Custom String("New level created"));
			Else If(Event Player.editMode == 2);
				Call Subroutine(ErrorWarningMessage);
				If(Global.Error);
					Global.Error = False;
					Abort;
				End;
				"0, orb position\r\n1, bot position, default false"
				Event Player.currentOrb[Count Of(Event Player.currentOrb)] = Array((Position Of(Event Player) + Eye Position(Event Player)) / 2,
					False, False, True);
				Global.CurrentChooseOrb = Count Of(Event Player.currentOrb) - 1;
				Global.ChooseOrbPosition = First Of(Event Player.currentOrb[Global.CurrentChooseOrb]);
				Global.Checkpoint[Event Player.checkpoint] = Mapped Array(Event Player.checkpointA,
					Current Array Index == 6 ? Event Player.currentOrb : Current Array Element);
				Call Subroutine(GetCurrentCheckpoint);
				Call Subroutine(KillOrResurrectBot);
				Call Subroutine(CreateNewEffect);
				Small Message(All Players(All Teams), Custom String("New orb created"));
			Else If(Event Player.editMode == 3);
				Call Subroutine(ErrorWarningMessage);
				If(Global.Error);
					Global.Error = False;
					Abort;
				End;
				"0, sphere position\r\n1, sphere radius"
				Event Player.currentSphere[Count Of(Event Player.currentSphere)] = Array((Position Of(Event Player) + Eye Position(Event Player))
					/ 2, 4);
				Global.CurrentChooseSphere = Count Of(Event Player.currentSphere) - 1;
				Global.ChooseSpherePosition = First Of(Event Player.currentSphere[Global.CurrentChooseSphere]);
				Global.Checkpoint[Event Player.checkpoint] = Mapped Array(Event Player.checkpointA,
					Current Array Index == 7 ? Event Player.currentSphere : Current Array Element);
				Call Subroutine(GetCurrentCheckpoint);
				Call Subroutine(CreateNewEffect);
				Small Message(All Players(All Teams), Custom String("New sphere created"));
			Else;
				Call Subroutine(ErrorWarningMessage);
				If(Global.Error);
					Global.Error = False;
					Abort;
				End;
				"0, cloud position\r\n1, cloud level"
				Event Player.currentCloud[Count Of(Event Player.currentCloud)] = Array(Position Of(Event Player), 8);
				Global.CurrentChooseCloud = Count Of(Event Player.currentCloud) - 1;
				Global.ChooseCloudPosition = First Of(Event Player.currentCloud[Global.CurrentChooseCloud]);
				Global.Checkpoint[Event Player.checkpoint] = Mapped Array(Event Player.checkpointA,
					Current Array Index == 8 ? Event Player.currentCloud : Current Array Element);
				Call Subroutine(GetCurrentCheckpoint);
				Call Subroutine(CreateNewEffect);
				Small Message(All Players(All Teams), Custom String("New cloud created"));
			End;
			Play Effect(Event Player, Buff Impact Sound, Null, Event Player, 100);
		Else If(Weapon(Event Player) == 2);
			If(Event Player.editMode == 1);
				Call Subroutine(ErrorWarningMessage);
				If(Global.Error);
					Global.Error = False;
					Abort;
				End;
				Modify Global Variable(Checkpoint, Remove From Array By Index, Event Player.checkpoint);
				If(First Of(Global.Checkpoint));
					Teleport(Event Player, Event Player.checkpoint > 0 ? First Of(Global.Checkpoint[Event Player.checkpoint - 1]) : First Of(
						Global.Checkpoint[Event Player.checkpoint]));
					Event Player.checkpoint -= Event Player.checkpoint > 0 ? 1 : 0;
				End;
				Call Subroutine(GetCurrentCheckpoint);
				If(!Event Player.finished && !Event Player.freeMode);
					Call Subroutine(SetCurrentAbilities);
				End;
				Call Subroutine(KillOrResurrectBot);
				Call Subroutine(DisplayCurrentAbilityMsgs);
				Start Rule(CreateCurrentEffects, Restart Rule);
				Small Message(All Players(All Teams), Custom String("The selected checkpoint has been deleted"));
			Else If(Event Player.editMode == 2);
				Call Subroutine(ErrorWarningMessage);
				If(Global.Error);
					Global.Error = False;
					Abort;
				End;
				Modify Player Variable(Event Player, currentOrb, Remove From Array By Index, Global.CurrentChooseOrb);
				Destroy Effect(Event Player.orbEffects[Global.CurrentChooseOrb]);
				Modify Player Variable(Event Player, orbEffects, Remove From Array By Index, Global.CurrentChooseOrb);
				Destroy Icon(Event Player.orbIcons[Global.CurrentChooseOrb]);
				Modify Player Variable(Event Player, orbIcons, Remove From Array By Index, Global.CurrentChooseOrb);
				Destroy Icon(Event Player.botIcons[Global.CurrentChooseOrb]);
				Modify Player Variable(Event Player, botIcons, Remove From Array By Index, Global.CurrentChooseOrb);
				Destroy Effect(Event Player.botEffects[Global.CurrentChooseOrb]);
				Modify Player Variable(Event Player, botEffects, Remove From Array By Index, Global.CurrentChooseOrb);
				Global.CurrentChooseOrb -= Global.CurrentChooseOrb > 0 ? 1 : 0;
				Global.ChooseOrbPosition = First Of(Event Player.currentOrb[Global.CurrentChooseOrb]);
				Global.Checkpoint[Event Player.checkpoint] = Mapped Array(Event Player.checkpointA,
					Current Array Index == 6 ? Event Player.currentOrb : Current Array Element);
				Call Subroutine(GetCurrentCheckpoint);
				Call Subroutine(KillOrResurrectBot);
				Small Message(All Players(All Teams), Custom String("The selected orb has been deleted"));
			Else If(Event Player.editMode == 3);
				Call Subroutine(ErrorWarningMessage);
				If(Global.Error);
					Global.Error = False;
					Abort;
				End;
				Modify Player Variable(Event Player, currentSphere, Remove From Array By Index, Global.CurrentChooseSphere);
				Destroy Effect(Event Player.sphereEffects[Global.CurrentChooseSphere]);
				Modify Player Variable(Event Player, sphereEffects, Remove From Array By Index, Global.CurrentChooseSphere);
				Global.CurrentChooseSphere -= Global.CurrentChooseSphere > 0 ? 1 : 0;
				Global.ChooseSpherePosition = First Of(Event Player.currentSphere[Global.CurrentChooseSphere]);
				Global.Checkpoint[Event Player.checkpoint] = Mapped Array(Event Player.checkpointA,
					Current Array Index == 7 ? Event Player.currentSphere : Current Array Element);
				Call Subroutine(GetCurrentCheckpoint);
				Small Message(All Players(All Teams), Custom String("The selected sphere has been deleted"));
			Else;
				Call Subroutine(ErrorWarningMessage);
				If(Global.Error);
					Global.Error = False;
					Abort;
				End;
				Modify Player Variable(Event Player, currentCloud, Remove From Array By Index, Global.CurrentChooseCloud);
				Destroy Effect(Event Player.cloudEffects[Global.CurrentChooseCloud]);
				Modify Player Variable(Event Player, cloudEffects, Remove From Array By Index, Global.CurrentChooseCloud);
				Global.CurrentChooseCloud -= Global.CurrentChooseCloud > 0 ? 1 : 0;
				Global.ChooseCloudPosition = First Of(Event Player.currentCloud[Global.CurrentChooseCloud]);
				Global.Checkpoint[Event Player.checkpoint] = Mapped Array(Event Player.checkpointA,
					Current Array Index == 8 ? Event Player.currentCloud : Current Array Element);
				Call Subroutine(GetCurrentCheckpoint);
				Small Message(All Players(All Teams), Custom String("The selected cloud has been deleted"));
			End;
			Play Effect(Event Player, Debuff Impact Sound, Null, Event Player, 100);
	}
}

rule("Move checkpoint (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Global.EditMode == True;
		Count Of(Global.Checkpoint) > 0;
		Event Player == Host Player;
		Event Player.editMode == 1;
		Is Button Held(Event Player, Button(Ability 2)) == True;
		Is Button Held(Event Player, Button(Interact)) == True;
		Is Button Held(Event Player, Button(Primary Fire)) == False;
		Is Button Held(Event Player, Button(Secondary Fire)) == False;
		Is Button Held(Event Player, Button(Ability 1)) == False;
		Is Button Held(Event Player, Button(Ultimate)) == False;
		Is Button Held(Event Player, Button(Jump)) == False;
		Is Button Held(Event Player, Button(Crouch)) == False;
		Is Button Held(Event Player, Button(Melee)) == False;
		Is Button Held(Event Player, Button(Reload)) == False;
	}

	actions
	{
		Global.Checkpoint[Event Player.checkpoint] = Mapped Array(Event Player.checkpointA, Current Array Index == 0 ? Position Of(
			Event Player) : Current Array Element);
		Call Subroutine(GetCurrentCheckpoint);
		Small Message(All Players(All Teams), Custom String("Moved checkpoint to player position"));
		Play Effect(Event Player, Buff Explosion Sound, Null, Event Player, 100);
	}
}

rule("Insert point (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Global.EditMode == True;
		Event Player.finished == False;
		Event Player.editMode == 1;
		Event Player == Host Player;
		Is Button Held(Event Player, Button(Melee)) == True;
		Is Button Held(Event Player, Button(Interact)) == True;
		Is Button Held(Event Player, Button(Crouch)) == False;
		Is Button Held(Event Player, Button(Ability 1)) == False;
		Is Button Held(Event Player, Button(Primary Fire)) == False;
		Is Button Held(Event Player, Button(Reload)) == False;
		Is Button Held(Event Player, Button(Ability 2)) == False;
		Is Button Held(Event Player, Button(Secondary Fire)) == False;
		Is Button Held(Event Player, Button(Ultimate)) == False;
		Is Button Held(Event Player, Button(Jump)) == False;
	}

	actions
	{
		Global.TempArray = Array Slice(Global.Checkpoint, Event Player.checkpoint + 1, Count Of(Global.Checkpoint));
		Global.Checkpoint = Array Slice(Global.Checkpoint, 0, Event Player.checkpoint + 1);
		Global.Checkpoint[Count Of(Global.Checkpoint)] = Array(Position Of(Event Player), Global.NewCheckpointDefaultRadius,
			Global.NewCheckpointDefaultCtrl, Array(False, False, True), Global.NewCheckpointDefaultMaxRefresh, False, Empty Array,
			Empty Array, Empty Array);
		Modify Global Variable(Checkpoint, Append To Array, Global.TempArray);
		Event Player.checkpoint += 1;
		Call Subroutine(GetCurrentCheckpoint);
		Call Subroutine(TeleportCurrentBot);
		Start Rule(CreateCurrentEffects, Restart Rule);
		Wait(0.100, Ignore Condition);
		Small Message(All Players(All Teams), Custom String("Already at level{0} and level{1} between Insertion point",
			Event Player.checkpoint - 1, Event Player.checkpoint));
		Play Effect(Event Player, Buff Impact Sound, Null, Event Player, 100);
	}
}

rule("Create / Delete bot (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Global.EditMode == True;
		Event Player.editMode < 3;
		Event Player == Host Player;
		Is Button Held(Event Player, Button(Melee)) == True;
		(Is Button Held(Event Player, Button(Primary Fire)) || Is Button Held(Event Player, Button(Secondary Fire))) == True;
		Is Button Held(Event Player, Button(Ability 1)) == False;
		Is Button Held(Event Player, Button(Ability 2)) == False;
		Is Button Held(Event Player, Button(Ultimate)) == False;
		Is Button Held(Event Player, Button(Interact)) == False;
		Is Button Held(Event Player, Button(Jump)) == False;
		Is Button Held(Event Player, Button(Reload)) == False;
	}

	actions
	{
		Call Subroutine(ErrorWarningMessage);
		If(Global.Error);
			Global.Error = False;
			Abort;
		End;
		If(Event Player.editMode == 1);
			If(Is Button Held(Event Player, Button(Primary Fire)));
				Global.Checkpoint[Event Player.checkpoint] = Mapped Array(Event Player.checkpointA, Current Array Index == 3 ? Array(Position Of(
					Event Player), Current Array Element[1], Current Array Element[2]) : Current Array Element);
				Play Effect(Event Player, Buff Impact Sound, Null, Event Player, 100);
			Else;
				Global.Checkpoint[Event Player.checkpoint] = Mapped Array(Event Player.checkpointA, Current Array Index == 3 ? Array(False, False,
					Current Array Element[2]) : Current Array Element);
				Play Effect(Event Player, Debuff Impact Sound, Null, Event Player, 100);
			End;
			Call Subroutine(GetCurrentCheckpoint);
			If(!Event Player.finished && !Event Player.freeMode);
				Call Subroutine(SetCurrentAbilities);
			End;
			Call Subroutine(KillOrResurrectBot);
			Small Message(All Players(All Teams), Event Player.checkpointA[3] ? Custom String("Created/Moved Bot") : Custom String(
				"Bot Deleted"));
		Else;
			If(Is Button Held(Event Player, Button(Primary Fire)));
				Event Player.currentOrb[Global.CurrentChooseOrb] = Mapped Array(Event Player.currentOrb[Global.CurrentChooseOrb],
					Current Array Index == 1 ? Position Of(Event Player) : Current Array Element);
				Global.Checkpoint[Event Player.checkpoint] = Mapped Array(Event Player.checkpointA,
					Current Array Index == 6 ? Event Player.currentOrb : Current Array Element);
				Call Subroutine(GetCurrentCheckpoint);
				Call Subroutine(KillOrResurrectBot);
				Call Subroutine(CreateNewEffect);
				Small Message(All Players(All Teams), Custom String("Created/Moved Bot"));
				Play Effect(Event Player, Buff Impact Sound, Null, Event Player, 100);
			Else;
				Event Player.currentOrb[Global.CurrentChooseOrb] = Mapped Array(Event Player.currentOrb[Global.CurrentChooseOrb],
					Current Array Index == 1 || Current Array Index == 2 ? False : Current Array Element);
				Global.Checkpoint[Event Player.checkpoint] = Mapped Array(Event Player.checkpointA,
					Current Array Index == 6 ? Event Player.currentOrb : Current Array Element);
				Call Subroutine(GetCurrentCheckpoint);
				Call Subroutine(KillOrResurrectBot);
				Call Subroutine(CreateNewEffect);
				Small Message(All Players(All Teams), Custom String("Bot Deleted"));
				Play Effect(Event Player, Debuff Impact Sound, Null, Event Player, 100);
	}
}

rule("Choose checkpoint, orb, sphere, cloud (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Global.EditMode == True;
		Count Of(Global.Checkpoint) > 0;
		Event Player == Host Player;
		Is Button Held(Event Player, Button(Ability 2)) == True;
		(Is Button Held(Event Player, Button(Primary Fire)) || Is Button Held(Event Player, Button(Secondary Fire))) == True;
		Is Button Held(Event Player, Button(Melee)) == False;
		Is Button Held(Event Player, Button(Ability 1)) == False;
		Is Button Held(Event Player, Button(Ultimate)) == False;
		Is Button Held(Event Player, Button(Interact)) == False;
		Is Button Held(Event Player, Button(Jump)) == False;
		Is Button Held(Event Player, Button(Crouch)) == False;
		Is Button Held(Event Player, Button(Reload)) == False;
	}

	actions
	{
		If(Event Player.editMode == 1 && Count Of(Global.Checkpoint) > 1);
			Call Subroutine(ChooseCheckpoint);
			Teleport(Event Player, First Of(Global.Checkpoint[Event Player.checkpoint]));
			Call Subroutine(GetCurrentCheckpoint);
			If(!Event Player.freeMode);
				Call Subroutine(SetCurrentAbilities);
			End;
			Call Subroutine(KillOrResurrectBot);
			Start Rule(CreateCurrentEffects, Restart Rule);
			Call Subroutine(CreateCurrentWorldText);
		Else If(Event Player.editMode == 2 && Count Of(Event Player.currentOrb) > 1);
			If(Is Button Held(Event Player, Button(Primary Fire)) && Global.CurrentChooseOrb < Count Of(Event Player.currentOrb) - 1);
				Global.CurrentChooseOrb += 1;
				Global.ChooseOrbPosition = First Of(Event Player.currentOrb[Global.CurrentChooseOrb]);
				Call Subroutine(KillOrResurrectBot);
			Else If(Is Button Held(Event Player, Button(Secondary Fire)) && Global.CurrentChooseOrb > 0);
				Global.CurrentChooseOrb -= 1;
				Global.ChooseOrbPosition = First Of(Event Player.currentOrb[Global.CurrentChooseOrb]);
				Call Subroutine(KillOrResurrectBot);
			End;
		Else If(Event Player.editMode == 3 && Count Of(Event Player.currentSphere) > 1);
			If(Is Button Held(Event Player, Button(Primary Fire)) && Global.CurrentChooseSphere < Count Of(Event Player.currentSphere) - 1);
				Global.CurrentChooseSphere += 1;
				Global.ChooseSpherePosition = First Of(Event Player.currentSphere[Global.CurrentChooseSphere]);
			Else If(Is Button Held(Event Player, Button(Secondary Fire)) && Global.CurrentChooseSphere > 0);
				Global.CurrentChooseSphere -= 1;
				Global.ChooseSpherePosition = First Of(Event Player.currentSphere[Global.CurrentChooseSphere]);
			End;
		Else If(Event Player.editMode == 4 && Count Of(Event Player.currentCloud) > 1);
			If(Is Button Held(Event Player, Button(Primary Fire)) && Global.CurrentChooseCloud < Count Of(Event Player.currentCloud) - 1);
				Global.CurrentChooseCloud += 1;
				Global.ChooseCloudPosition = First Of(Event Player.currentCloud[Global.CurrentChooseCloud]);
			Else If(Is Button Held(Event Player, Button(Secondary Fire)) && Global.CurrentChooseCloud > 0);
				Global.CurrentChooseCloud -= 1;
				Global.ChooseCloudPosition = First Of(Event Player.currentCloud[Global.CurrentChooseCloud]);
	}
}

rule("Switch crouch,teleport, unlimited ga, need resurrect (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Global.EditMode == True;
		Event Player.editMode < 3;
		Event Player == Host Player;
		Is Button Held(Event Player, Button(Interact)) == True;
		(Is Button Held(Event Player, Button(Crouch)) || Is Button Held(Event Player, Button(Jump)) || Is Button Held(Event Player, Button(
			Ultimate)) || Is Button Held(Event Player, Button(Reload)) || Is Button Held(Event Player, Button(Ability 1))) == True;
		Is Button Held(Event Player, Button(Primary Fire)) == False;
		Is Button Held(Event Player, Button(Secondary Fire)) == False;
		Is Button Held(Event Player, Button(Ability 2)) == False;
		Is Button Held(Event Player, Button(Melee)) == False;
	}

	actions
	{
		Call Subroutine(ErrorWarningMessage);
		If(Global.Error);
			Global.Error = False;
			Abort;
		End;
		If(Event Player.editMode == 1);
			If(Is Button Held(Event Player, Button(Crouch)));
				Global.Checkpoint[Event Player.checkpoint] = Mapped Array(Event Player.checkpointA,
					Current Array Index == 2 ? !Current Array Element : Current Array Element);
				Call Subroutine(GetCurrentCheckpoint);
				Set Crouch Enabled(Event Player, Event Player.checkpointA[2]);
				Call Subroutine(TeleportCurrentBot);
				Wait(0.100, Ignore Condition);
				Small Message(All Players(All Teams), Custom String("Selected level {0} crouch", Event Player.checkpointA[2] ? Custom String(
					"Enable") : Custom String("Disable")));
			Else If(Is Button Held(Event Player, Button(Jump)));
				Global.Checkpoint[Event Player.checkpoint] = Mapped Array(Event Player.checkpointA,
					Current Array Index == 5 ? !Current Array Element : Current Array Element);
				Call Subroutine(GetCurrentCheckpoint);
				Wait(0.100, Ignore Condition);
				Small Message(All Players(All Teams), Custom String("Selected level teleport {0}", Event Player.checkpointA[5] ? Custom String(
					"Enabled ( Official game takes effect )") : Custom String("Disabled")));
			Else If(Is Button Held(Event Player, Button(Ultimate)));
				Global.Checkpoint[Event Player.checkpoint] = Mapped Array(Event Player.checkpointA,
					Current Array Index == 4 ? !Current Array Element : Current Array Element);
				Call Subroutine(GetCurrentCheckpoint);
				Wait(0.100, Ignore Condition);
				Small Message(All Players(All Teams), Custom String("Selected level {0} has been set to {1}", Ability Icon String(Hero(Mercy),
					Button(Ability 1)), Event Player.checkpointA[4] ? Custom String("Infinite times") : Custom String("Single time")));
			Else If(Is Button Held(Event Player, Button(Reload)));
				Global.Checkpoint[Event Player.checkpoint] = Mapped Array(Event Player.checkpointA, Current Array Index == 3 ? Array(First Of(
					Current Array Element), !Current Array Element[1], Current Array Element[2]) : Current Array Element);
				Call Subroutine(GetCurrentCheckpoint);
				Call Subroutine(KillOrResurrectBot);
				Set Ability 2 Enabled(Event Player, Event Player.checkpointA[3][1]);
				Event Player.ability2 = Event Player.checkpointA[3][1];
				Wait(0.100, Ignore Condition);
				Small Message(All Players(All Teams), Event Player.checkpointA[3][1] ? Custom String(
					"The selected level's mercy has enabled resurrection(interact+shift Turn off or on to refresh the ga after resurrection)")
					: Custom String("The selected level's mercy has disabled resurrection"));
			Else If(Is Button Held(Event Player, Button(Ability 1)));
				Global.Checkpoint[Event Player.checkpoint] = Mapped Array(Event Player.checkpointA, Current Array Index == 3 ? Array(First Of(
					Current Array Element), Current Array Element[1], !Current Array Element[2]) : Current Array Element);
				Call Subroutine(GetCurrentCheckpoint);
				Wait(0.100, Ignore Condition);
				Small Message(All Players(All Teams), Event Player.checkpointA[3][2] ? Custom String(
					"The selected level resurrection has enabled refresh the ga") : Custom String(
					"The selected level resurrection has disabled refresh the ga"));
			End;
			Play Effect(Event Player, Buff Explosion Sound, Null, Event Player, 100);
		Else;
			If(Is Button Held(Event Player, Button(Reload)));
				Event Player.currentOrb[Global.CurrentChooseOrb] = Mapped Array(Event Player.currentOrb[Global.CurrentChooseOrb],
					Current Array Index == 2 ? !Current Array Element : Current Array Element);
				Global.Checkpoint[Event Player.checkpoint] = Mapped Array(Event Player.checkpointA,
					Current Array Index == 6 ? Event Player.currentOrb : Current Array Element);
				Call Subroutine(GetCurrentCheckpoint);
				Call Subroutine(KillOrResurrectBot);
				Call Subroutine(CreateNewEffect);
				Wait(0.100, Ignore Condition);
				Small Message(All Players(All Teams), Event Player.nearestOrb[2] ? Custom String(
					"The selected orb's mercy has enabled resurrection(interact+shift Turn off or on to refresh the ga after resurrection)")
					: Custom String("The selected orb's mercy has disabled resurrection"));
			Else If(Is Button Held(Event Player, Button(Ability 1)));
				Event Player.currentOrb[Global.CurrentChooseOrb] = Mapped Array(Event Player.currentOrb[Global.CurrentChooseOrb],
					Current Array Index == 3 ? !Current Array Element : Current Array Element);
				Global.Checkpoint[Event Player.checkpoint] = Mapped Array(Event Player.checkpointA,
					Current Array Index == 6 ? Event Player.currentOrb : Current Array Element);
				Call Subroutine(GetCurrentCheckpoint);
				Call Subroutine(KillOrResurrectBot);
				Wait(0.100, Ignore Condition);
				Small Message(All Players(All Teams), Event Player.nearestOrb[3] ? Custom String(
					"The selected orb resurrection has enabled refresh the ga") : Custom String(
					"The selected orb resurrection has disabled refresh the ga"));
			End;
			Play Effect(Event Player, Buff Explosion Sound, Null, Event Player, 100);
	}
}

rule("Modify the size of the checkpoint / sphere / cloud (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Global.EditMode == True;
		Event Player.editMode != 2;
		Event Player == Host Player;
		Is Button Held(Event Player, Button(Jump)) == True;
		(Is Button Held(Event Player, Button(Primary Fire)) || Is Button Held(Event Player, Button(Secondary Fire))) == True;
		Is Button Held(Event Player, Button(Ability 1)) == False;
		Is Button Held(Event Player, Button(Crouch)) == False;
		Is Button Held(Event Player, Button(Ability 2)) == False;
		Is Button Held(Event Player, Button(Ultimate)) == False;
		Is Button Held(Event Player, Button(Interact)) == False;
		Is Button Held(Event Player, Button(Melee)) == False;
		Is Button Held(Event Player, Button(Reload)) == False;
	}

	actions
	{
		If(Is Button Held(Host Player, Button(Primary Fire)));
			If(Weapon(Event Player) == 2 && Event Player.editMode == 1 && Count Of(Global.Checkpoint) > 0);
				Global.Checkpoint[Event Player.checkpoint] = Mapped Array(Event Player.checkpointA,
					Current Array Index == 1 ? Current Array Element + 0.050 : Current Array Element);
				Call Subroutine(GetCurrentCheckpoint);
				Wait(0.100, Ignore Condition);
				Loop If Condition Is True;
				Small Message(All Players(All Teams), Custom String("Change the selected level radius to {0}", Event Player.checkpointA[1]));
				Play Effect(Event Player, Buff Explosion Sound, Null, Event Player, 100);
			Else If(Event Player.editMode == 3 && Count Of(Event Player.currentSphere) > 0);
				If(Global.Once);
					Call Subroutine(EditChoosedEffect);
					Global.Once = False;
				End;
				Event Player.currentSphere[Global.CurrentChooseSphere] = Mapped Array(Event Player.currentSphere[Global.CurrentChooseSphere],
					Current Array Index == 1 ? Current Array Element + 0.100 : Current Array Element);
				Wait(0.050, Ignore Condition);
				Loop If Condition Is True;
				Global.Once = True;
				Global.Checkpoint[Event Player.checkpoint] = Mapped Array(Event Player.checkpointA,
					Current Array Index == 7 ? Event Player.currentSphere : Current Array Element);
				Call Subroutine(GetCurrentCheckpoint);
				Call Subroutine(CreateNewEffect);
				Play Effect(Event Player, Buff Explosion Sound, Null, Event Player, 100);
			Else If(Event Player.editMode == 4 && Count Of(Event Player.currentCloud) > 0);
				Event Player.currentCloud[Global.CurrentChooseCloud] = Mapped Array(Event Player.currentCloud[Global.CurrentChooseCloud],
					Current Array Index == 1 ? Current Array Element + 1 : Current Array Element);
				Wait(0.100, Ignore Condition);
				Loop If Condition Is True;
				Global.Checkpoint[Event Player.checkpoint] = Mapped Array(Event Player.checkpointA,
					Current Array Index == 8 ? Event Player.currentCloud : Current Array Element);
				Call Subroutine(GetCurrentCheckpoint);
				Play Effect(Event Player, Buff Explosion Sound, Null, Event Player, 100);
			End;
		Else If(Is Button Held(Host Player, Button(Secondary Fire)));
			If(Weapon(Event Player) == 2 && Event Player.editMode == 1 && Count Of(Global.Checkpoint)
				> 0 && Event Player.checkpointA[1] > 0.500);
				Global.Checkpoint[Event Player.checkpoint] = Mapped Array(Event Player.checkpointA,
					Current Array Index == 1 ? Current Array Element - 0.050 : Current Array Element);
				Call Subroutine(GetCurrentCheckpoint);
				Wait(0.100, Ignore Condition);
				Loop If Condition Is True;
				Small Message(All Players(All Teams), Custom String("Change the selected level radius to {0}", Event Player.checkpointA[1]));
				Play Effect(Event Player, Buff Explosion Sound, Null, Event Player, 100);
			Else If(Event Player.editMode == 3 && Count Of(Event Player.currentSphere)
					> 0 && Event Player.currentSphere[Global.CurrentChooseSphere][1] > 1);
				If(Global.Once);
					Call Subroutine(EditChoosedEffect);
					Global.Once = False;
				End;
				Event Player.currentSphere[Global.CurrentChooseSphere] = Mapped Array(Event Player.currentSphere[Global.CurrentChooseSphere],
					Current Array Index == 1 ? Current Array Element - 0.100 : Current Array Element);
				Wait(0.050, Ignore Condition);
				Loop If Condition Is True;
				Global.Once = True;
				Global.Checkpoint[Event Player.checkpoint] = Mapped Array(Event Player.checkpointA,
					Current Array Index == 7 ? Event Player.currentSphere : Current Array Element);
				Call Subroutine(GetCurrentCheckpoint);
				Call Subroutine(CreateNewEffect);
				Play Effect(Event Player, Buff Explosion Sound, Null, Event Player, 100);
			Else If(Event Player.editMode == 4 && Count Of(Event Player.currentCloud)
					> 0 && Event Player.currentCloud[Global.CurrentChooseCloud][1] > 1);
				Event Player.currentCloud[Global.CurrentChooseCloud] = Mapped Array(Event Player.currentCloud[Global.CurrentChooseCloud],
					Current Array Index == 1 ? Current Array Element - 1 : Current Array Element);
				Wait(0.100, Ignore Condition);
				Loop If Condition Is True;
				Global.Checkpoint[Event Player.checkpoint] = Mapped Array(Event Player.checkpointA,
					Current Array Index == 8 ? Event Player.currentCloud : Current Array Element);
				Call Subroutine(GetCurrentCheckpoint);
				Play Effect(Event Player, Buff Explosion Sound, Null, Event Player, 100);
	}
}

rule("Move Sphere / Cloud (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Global.EditMode == True;
		Event Player.editMode != 1;
		Event Player == Host Player;
		Is Button Held(Event Player, Button(Reload)) == True;
		(Is Button Held(Event Player, Button(Primary Fire)) || Is Button Held(Event Player, Button(Secondary Fire))) == True;
		Is Button Held(Event Player, Button(Ability 2)) == False;
		Is Button Held(Event Player, Button(Ultimate)) == False;
		Is Button Held(Event Player, Button(Interact)) == False;
		Is Button Held(Event Player, Button(Jump)) == False;
		Is Button Held(Event Player, Button(Melee)) == False;
		Is Button Held(Event Player, Button(Crouch)) == False;
	}

	actions
	{
		If(Is Button Held(Event Player, Button(Primary Fire)));
			If(Event Player.editMode == 2 && Count Of(Event Player.currentOrb) > 0);
				If(Global.Once);
					Call Subroutine(EditChoosedEffect);
					Global.Once = False;
				End;
				Chase Global Variable At Rate(ChooseOrbPosition, Eye Position(Event Player) + Facing Direction Of(Event Player) * (
					Distance Between(Position Of(Event Player), Global.ChooseOrbPosition) + 10), 1, Destination and Rate);
				Wait(0.016, Ignore Condition);
				Loop If Condition Is True;
				Stop Chasing Global Variable(ChooseOrbPosition);
				Global.Once = True;
				Event Player.currentOrb[Global.CurrentChooseOrb] = Mapped Array(Event Player.currentOrb[Global.CurrentChooseOrb],
					Current Array Index == 0 ? Global.ChooseOrbPosition : Current Array Element);
				Global.Checkpoint[Event Player.checkpoint] = Mapped Array(Event Player.checkpointA,
					Current Array Index == 6 ? Event Player.currentOrb : Current Array Element);
				Call Subroutine(GetCurrentCheckpoint);
				Call Subroutine(CreateNewEffect);
				Play Effect(Event Player, Buff Explosion Sound, Null, Event Player, 100);
			Else If(Event Player.editMode == 3 && Count Of(Event Player.currentSphere) > 0);
				If(Global.Once);
					Call Subroutine(EditChoosedEffect);
					Global.Once = False;
				End;
				Chase Global Variable At Rate(ChooseSpherePosition, Eye Position(Event Player) + Facing Direction Of(Event Player) * (
					Distance Between(Position Of(Event Player), Global.ChooseSpherePosition) + 10), 1, Destination and Rate);
				Wait(0.016, Ignore Condition);
				Loop If Condition Is True;
				Stop Chasing Global Variable(ChooseSpherePosition);
				Global.Once = True;
				Event Player.currentSphere[Global.CurrentChooseSphere] = Mapped Array(Event Player.currentSphere[Global.CurrentChooseSphere],
					Current Array Index == 0 ? Global.ChooseSpherePosition : Current Array Element);
				Global.Checkpoint[Event Player.checkpoint] = Mapped Array(Event Player.checkpointA,
					Current Array Index == 7 ? Event Player.currentSphere : Current Array Element);
				Call Subroutine(GetCurrentCheckpoint);
				Call Subroutine(CreateNewEffect);
				Play Effect(Event Player, Buff Explosion Sound, Null, Event Player, 100);
			Else If(Event Player.editMode == 4 && Count Of(Event Player.currentCloud) > 0);
				If(Global.Once);
					Call Subroutine(EditChoosedEffect);
					Global.Once = False;
				End;
				Chase Global Variable At Rate(ChooseCloudPosition, Eye Position(Event Player) + Facing Direction Of(Event Player) * (
					Distance Between(Position Of(Event Player), Global.ChooseCloudPosition) + 10), 1, Destination and Rate);
				Wait(0.016, Ignore Condition);
				Loop If Condition Is True;
				Stop Chasing Global Variable(ChooseCloudPosition);
				Global.Once = True;
				Event Player.currentCloud[Global.CurrentChooseCloud] = Mapped Array(Event Player.currentCloud[Global.CurrentChooseCloud],
					Current Array Index == 0 ? Global.ChooseCloudPosition : Current Array Element);
				Global.Checkpoint[Event Player.checkpoint] = Mapped Array(Event Player.checkpointA,
					Current Array Index == 8 ? Event Player.currentCloud : Current Array Element);
				Call Subroutine(GetCurrentCheckpoint);
				Call Subroutine(CreateNewEffect);
				Play Effect(Event Player, Buff Explosion Sound, Null, Event Player, 100);
			End;
		Else If(Is Button Held(Event Player, Button(Secondary Fire)));
			If(Event Player.editMode == 2 && Count Of(Event Player.currentOrb) > 0);
				If(Global.Once);
					Call Subroutine(EditChoosedEffect);
					Global.Once = False;
				End;
				Chase Global Variable At Rate(ChooseOrbPosition, Eye Position(Event Player) - Facing Direction Of(Event Player) * (
					Distance Between(Position Of(Event Player), Global.ChooseOrbPosition) + 10), 1, Destination and Rate);
				Wait(0.016, Ignore Condition);
				Loop If Condition Is True;
				Stop Chasing Global Variable(ChooseOrbPosition);
				Global.Once = True;
				Event Player.currentOrb[Global.CurrentChooseOrb] = Mapped Array(Event Player.currentOrb[Global.CurrentChooseOrb],
					Current Array Index == 0 ? Global.ChooseOrbPosition : Current Array Element);
				Global.Checkpoint[Event Player.checkpoint] = Mapped Array(Event Player.checkpointA,
					Current Array Index == 6 ? Event Player.currentOrb : Current Array Element);
				Call Subroutine(GetCurrentCheckpoint);
				Call Subroutine(CreateNewEffect);
				Play Effect(Event Player, Buff Explosion Sound, Null, Event Player, 100);
			Else If(Event Player.editMode == 3 && Count Of(Event Player.currentSphere) > 0);
				If(Global.Once);
					Call Subroutine(EditChoosedEffect);
					Global.Once = False;
				End;
				Chase Global Variable At Rate(ChooseSpherePosition, Eye Position(Event Player) - Facing Direction Of(Event Player) * (
					Distance Between(Position Of(Event Player), Global.ChooseSpherePosition) + 10), 1, Destination and Rate);
				Wait(0.016, Ignore Condition);
				Loop If Condition Is True;
				Stop Chasing Global Variable(ChooseSpherePosition);
				Global.Once = True;
				Event Player.currentSphere[Global.CurrentChooseSphere] = Mapped Array(Event Player.currentSphere[Global.CurrentChooseSphere],
					Current Array Index == 0 ? Global.ChooseSpherePosition : Current Array Element);
				Global.Checkpoint[Event Player.checkpoint] = Mapped Array(Event Player.checkpointA,
					Current Array Index == 7 ? Event Player.currentSphere : Current Array Element);
				Call Subroutine(GetCurrentCheckpoint);
				Call Subroutine(CreateNewEffect);
				Play Effect(Event Player, Buff Explosion Sound, Null, Event Player, 100);
			Else If(Event Player.editMode == 4 && Count Of(Event Player.currentCloud) > 0);
				If(Global.Once);
					Call Subroutine(EditChoosedEffect);
					Global.Once = False;
				End;
				Chase Global Variable At Rate(ChooseCloudPosition, Eye Position(Event Player) - Facing Direction Of(Event Player) * (
					Distance Between(Position Of(Event Player), Global.ChooseCloudPosition) + 10), 1, Destination and Rate);
				Wait(0.016, Ignore Condition);
				Loop If Condition Is True;
				Stop Chasing Global Variable(ChooseCloudPosition);
				Global.Once = True;
				Event Player.currentCloud[Global.CurrentChooseCloud] = Mapped Array(Event Player.currentCloud[Global.CurrentChooseCloud],
					Current Array Index == 0 ? Global.ChooseCloudPosition : Current Array Element);
				Global.Checkpoint[Event Player.checkpoint] = Mapped Array(Event Player.checkpointA,
					Current Array Index == 8 ? Event Player.currentCloud : Current Array Element);
				Call Subroutine(GetCurrentCheckpoint);
				Call Subroutine(CreateNewEffect);
				Play Effect(Event Player, Buff Explosion Sound, Null, Event Player, 100);
	}
}

rule("If the map is a 3CP map, group up can transfer to other map (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Global.EditMode == True;
		Is Communicating(Event Player, Group Up) == True;
		Array Contains(Array(Map(Busan), Map(Ilios), Map(Lijiang Tower), Map(Lijiang Tower), Map(Nepal), Map(Oasis)), Current Map) == True;
	}

	actions
	{
		Event Player.objectivePosition += Event Player.objectivePosition == 2 ? -2 : 1;
		Teleport(Event Player, Nearest Walkable Position(Objective Position(Event Player.objectivePosition)));
	}
}

rule("Export data (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Global.EditMode == True;
		Event Player == Host Player;
		"@Condition eventPlayer.isCommunicatingEmote() == true\r\n@Condition eventPlayer.isHoldingButton(Button.INTERACT) == true"
		Is Button Held(Event Player, Button(Ultimate)) == True;
		Is Button Held(Event Player, Button(Crouch)) == True;
		Is Button Held(Event Player, Button(Melee)) == True;
		Is Button Held(Event Player, Button(Jump)) == True;
	}

	actions
	{
		Call Subroutine(ClearRedundantData);
		Enable Inspector Recording;
		Disable Inspector Recording;
		Destroy All In-World Text;
		Destroy All HUD Text;
		Destroy All Icons;
		Destroy All Effects;
		Start Camera(All Players(All Teams), Objective Position(Array Contains(Array(Map(Lijiang Tower), Map(Lijiang Tower), Map(
			King's Row), Map(King's Row), Map(Temple of Anubis)), Current Map) ? 0 : (Current Map == Map(Watchpoint: Gibraltar) ? 2 : 1))
			+ Vector(-25, 50, 25), Objective Position(Array Contains(Array(Map(Lijiang Tower), Map(Lijiang Tower), Map(King's Row), Map(
			King's Row), Map(Temple of Anubis)), Current Map) ? 0 : (Current Map == Map(Watchpoint: Gibraltar) ? 2 : 1)) + Vector(0, 0, 0),
			0);
		Create HUD Text(Host Player, Null, Null, Custom String("\n\n\n\n\n\n\n"), Left, -1, Null, Null, Null, Visible To,
			Default Visibility);
		Create HUD Text(Host Player, Null, Custom String("Step"), Custom String(
			"1. ESC calls out the menu, select \"Open Workshop Inspector\" and open;"), Left, 0, Color(Black), Custom Color(192, 196, 195,
			255), Custom Color(205, 209, 211, 255), Visible To and String, Default Visibility);
		Create HUD Text(Host Player, Null, Null, Custom String(
			"2. Change the variable target at the bottom right of the viewer from Auto to Global;"), Left, 1, Null, Null, Custom Color(205,
			209, 211, 255), Visible To and String, Default Visibility);
		Create HUD Text(Host Player, Null, Null, Custom String(
			"3. Click (X) directly below the viewer (the point data has been obtained on your clipboard at this time);"), Left, 2, Null,
			Null, Custom Color(205, 209, 211, 255), Visible To and String, Default Visibility);
		Create HUD Text(Host Player, Null, Null, Custom String("4. ESC calls up the menu, select \"Open Workshop Editor\" and open;"),
			Left, 3, Null, Null, Custom Color(205, 209, 211, 255), Visible To and String, Default Visibility);
		Create HUD Text(Host Player, Null, Null, Custom String(
			"5. Click the + sign on the left to expand the data rules (Rule 1), Then click the yellow + (paste);"), Left, 4, Null, Null,
			Custom Color(205, 209, 211, 255), Visible To and String, Default Visibility);
		Create HUD Text(Host Player, Null, Null, Custom String(
			"6. If the data is not 1, check whether the steps are wrong, and repeat the above operation;"), Left, 5, Null, Null,
			Custom Color(205, 209, 211, 255), Visible To and String, Default Visibility);
		Create HUD Text(Host Player, Null, Null, Custom String(
			"7. ESC calls up the menu, selects \"Show Lobby\" and opens it. After entering the lobby interface,{0}", Custom String(
			"\n    click on the \"Settings\" on the right, and find the orange \"Workshop Settings\" at the bottom left to open;")), Left,
			6, Null, Null, Custom Color(205, 209, 211, 255), Visible To and String, Default Visibility);
		Create HUD Text(Host Player, Null, Null, Custom String(
			"8. Turn off the edit mode in the map workshop settings, click the link button on the right to share and copy this code;"),
			Left, 7, Null, Null, Custom Color(205, 209, 211, 255), Visible To and String, Default Visibility);
		Create HUD Text(Host Player, Null, Null, Custom String("9. ESC will go back to \"Settings\" and open \"Workshop\";"), Left, 8,
			Null, Null, Custom Color(205, 209, 211, 255), Visible To and String, Default Visibility);
		Create HUD Text(Host Player, Null, Null, Custom String(
			"10. Expand the creator rules (Rule 2), and fill in the nickname and code as required;"), Left, 9, Null, Null, Custom Color(
			205, 209, 211, 255), Visible To and String, Default Visibility);
		Create HUD Text(Host Player, Null, Null, Custom String(
			"11. ESC goes back to \"Settings\", share the code again and choose to upload to the existing code,{0}", Custom String(
			"\n      and fill in the code copied before (End).")), Left, 10, Null, Null, Custom Color(205, 209, 211, 255),
			Visible To and String, Default Visibility);
		Big Message(All Players(All Teams), Custom String("Data exported"));
	}
}

rule("Arrival checkpoint (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Event Player.finished == False;
		Event Player.freeMode == False;
		Event Player.checkpointB == True;
		(Is On Ground(Event Player) || Is On Ground(Event Player) == Global.OnGround) == True;
		"@Condition eventPlayer.isDummy() == false"
		Distance Between(Event Player, First Of(Event Player.checkpointB)) <= Event Player.checkpointB[1];
	}

	actions
	{
		If(Count Of(Event Player.tempCurrentOrb) > 0);
			Call Subroutine(TeleportToCurrentCheckoint);
			Small Message(Event Player, Global.Config[22]);
			Play Effect(Event Player, Explosion Sound, Null, Event Player, 100);
			Abort;
		End;
		If(Is Alive(Event Player.targetBot));
			Call Subroutine(TeleportToCurrentCheckoint);
			Small Message(Event Player, Global.Config[33]);
			Play Effect(Event Player, Explosion Sound, Null, Event Player, 100);
			Abort;
		End;
		Event Player.checkpoint += 1;
		If(!Event Player.cheat);
			Call Subroutine(EditPlayerData);
		End;
		Call Subroutine(GetCurrentCheckpoint);
		Call Subroutine(SetCurrentAbilities);
		Call Subroutine(TeleportCurrentBot);
		Call Subroutine(DisplayCurrentAbilityMsgs);
		Start Rule(CreateCurrentEffects, Restart Rule);
		Call Subroutine(CreateCurrentWorldText);
		Start Rule(DisplayCurrentCustomBigMsgs, Do Nothing);
		Start Rule(DisplayCurrentCustomSmallMsgs, Do Nothing);
		If(!Global.EditMode && !Event Player.cheat);
			Event Player.segmentEnd = Event Player.time;
			Event Player.segmentTimeArray[Event Player.checkpoint - 1] = Event Player.segmentEnd - Event Player.segmentStart;
			Event Player.segmentStart = Event Player.time;
			If(Event Player.checkpoint);
				If(Event Player.personalBestArray);
					Event Player.segmentVsPersonalBestArray[Event Player.checkpoint - 1] = Event Player.segmentTimeArray[Event Player.checkpoint - 1] - Event Player.personalBestArray[Event Player.checkpoint - 1];
					Event Player.vsPersonalBestRunningTally = Event Player.segmentVsPersonalBestArray[Event Player.checkpoint - 1] + Event Player.vsPersonalBestRunningTally;
				End;
				If(Event Player.bestSegmentsArray[Event Player.checkpoint - 1]);
					If(Event Player.segmentTimeArray[Event Player.checkpoint - 1] < Event Player.bestSegmentsArray[Event Player.checkpoint - 1]);
						Event Player.sumOfBestSegments -= Event Player.bestSegmentsArray[Event Player.checkpoint - 1] - Event Player.segmentTimeArray[Event Player.checkpoint - 1];
						Event Player.bestSegmentsArray[Event Player.checkpoint - 1] = Event Player.segmentTimeArray[Event Player.checkpoint - 1];
						Event Player.bestSegmentsArrayString = Null;
					End;
				Else;
					Event Player.bestSegmentsArray[Event Player.checkpoint - 1] = Event Player.segmentTimeArray[Event Player.checkpoint - 1];
					Event Player.sumOfBestSegments += Event Player.segmentTimeArray[Event Player.checkpoint - 1];
					Event Player.bestSegmentsArrayString = Null;
				End;
			End;
		End;
		If(Event Player.checkpoint < Count Of(Global.Checkpoint) - 1);
			Abort If(!Global.EditMode && Event Player.checkpointA[5]);
			Play Effect(Event Player, Buff Explosion Sound, Null, Event Player, 100);
		Else;
			Stop Chasing Player Variable(Event Player, time);
			If(!Global.EditMode && !Event Player.cheat);
				Global.FirstPlaceTime = Global.FirstPlaceTime ? (
					Event Player.time < Global.FirstPlaceTime ? Event Player.time : Global.FirstPlaceTime) : Event Player.time;
				Event Player.bestRecord = Event Player.bestRecord && Event Player.bestRecord < Event Player.time ? Event Player.bestRecord : Event Player.time;
				Global.PlayersRecord[Index Of Array Value(Global.PlayersRecord, Event Player.playerNickname) > -1 ? Index Of Array Value(
					Global.PlayersRecord, Event Player.playerNickname) / 2 : Count Of(Global.PlayersRecord)] = Index Of Array Value(
					Global.PlayersRecord, Event Player.playerNickname) > -1 && First Of(Filtered Array(Global.PlayersRecord, First Of(
					Current Array Element) == Event Player.playerNickname))[1] < Event Player.time ? First Of(Filtered Array(Global.PlayersRecord,
					First Of(Current Array Element) == Event Player.playerNickname)) : Array(Event Player.playerNickname, Event Player.time);
				Global.Top5 = Array Slice(Sorted Array(Global.PlayersRecord, Current Array Element[1]), 0, 5);
				Big Message(All Players(All Teams), Custom String("{0} finished in {1} seconds!", Event Player.playerNickname, Event Player.time));
				Event Player.personalBestArray = Event Player.time == Event Player.bestRecord ? Event Player.segmentTimeArray : Event Player.personalBestArray;
				Global.FirstPlaceTimeArray = Event Player.time == Global.FirstPlaceTime ? Event Player.segmentTimeArray : Global.FirstPlaceTimeArray;
			End;
			Play Effect(All Players(All Teams), Ring Explosion Sound, Null, Event Player, 200);
			Abort If(Global.EditMode);
			Destroy Dummy Bot(Team Of(Event Player), Slot Of(Event Player) + Number Of Slots(All Teams));
	}
}

rule("Set status for players (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Has Status(Event Player, Phased Out) == False;
	}

	actions
	{
		Disable Movement Collision With Players(Event Player);
		"eventPlayer.setStatusEffect(null, Status.PHASED_OUT, 9999)"
		If(!Is Dummy Bot(Event Player));
			Wait(2, Ignore Condition);
			Start Scaling Player(Event Player, Event Player.bodySize, True);
			Start Modifying Hero Voice Lines(Event Player, Event Player.voice, True);
			Start Scaling Barriers(Event Player, Event Player.barrierSize, True);
		Else;
			Disable Built-In Game Mode Respawning(Event Player);
			Set Knockback Received(Event Player, 0);
			If(Global.BotGravity);
				Wait(0.016, Ignore Condition);
				Set Gravity(Event Player, 0);
				While(True);
					If(!Has Status(Event Player, Phased Out));
						Set Status(Event Player, Null, Phased Out, 9999);
					End;
					Start Holding Button(Event Player, Button(Jump));
					Wait(1, Ignore Condition);
				End;
	}
}

rule("Resurrection after death (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Player Died;
		Team 1;
		All;
	}

	conditions
	{
		Event Player.spectatorMode == False;
	}

	actions
	{
		"@Condition eventPlayer.isDummy() == false"
		If(!Event Player.finished && !Event Player.freeMode);
			Teleport(Event Player, First Of(Event Player.checkpointA));
			Event Player.mistake += 1;
			Call Subroutine(SetCurrentAbilities);
			If(Event Player.currentOrb);
				Call Subroutine(TeleportCurrentBot);
			End;
		Else;
			Teleport(Event Player, Nearest Walkable Position(Position Of(Event Player)));
		End;
		Resurrect(Event Player);
	}
}

rule("Kill bot (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Event Player.numberOfNeedResurrect != 0;
		Is Alive(Event Player.targetBot) == True;
		((Event Player.killTargetBot && (Event Player.freeMode || Event Player.finished)) || (
			Event Player.ability2 && !Event Player.freeMode && !Event Player.finished)) == True;
	}

	actions
	{
		Kill(Event Player.targetBot, Null);
	}
}

rule("back point after landing (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Event Player.finished == False;
		Event Player.freeMode == False;
		Is On Ground(Event Player) == True;
		"@Condition eventPlayer.isDummy() == false"
		Distance Between(Event Player, First Of(Event Player.checkpointA)) > Event Player.checkpointA[1];
		Distance Between(Event Player, First Of(Event Player.checkpointB)) > Event Player.checkpointB[1];
		Array Contains(Array(-1, -1, -1), Event Player.checkpoint) == False;
	}

	actions
	{
		Call Subroutine(TeleportToCurrentCheckoint);
	}
}

rule("Ga usage restrictions (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Event Player.finished == False;
		Event Player.freeMode == False;
		Event Player.checkpointA[4] == False;
		Is Using Ability 1(Event Player) == True;
	}

	actions
	{
		Event Player.currentCheckpoint = Event Player.checkpoint;
		Wait Until(!Is Using Ability 1(Event Player), 9999);
		If(!Event Player.freeMode && Event Player.checkpoint == Event Player.currentCheckpoint && (Is In Air(Event Player)
			|| Distance Between(Event Player, First Of(Event Player.checkpointA)) > Event Player.checkpointA[1]));
			Set Ability 1 Enabled(Event Player, False);
	}
}

rule("Get orb (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Event Player.tempCurrentOrb != Empty Array;
		Event Player.checkpointA == True;
		Is True For Any(Event Player.tempCurrentOrb, Distance Between(Event Player, First Of(Current Array Element))
			<= 1.500 || Distance Between(Eye Position(Event Player), First Of(Current Array Element)) <= 1.500) == True;
	}

	actions
	{
		If(Is Alive(Event Player.targetBot) && !Event Player.freeMode && !Event Player.finished);
			Call Subroutine(TeleportToCurrentCheckoint);
			Small Message(Event Player, Global.Config[33]);
			Play Effect(Event Player, Explosion Sound, Null, Event Player, 100);
			Abort;
		End;
		Event Player.nearestOrb = First Of(Filtered Array(Event Player.tempCurrentOrb, Distance Between(Event Player, First Of(
			Current Array Element)) <= 1.500 || Distance Between(Eye Position(Event Player), First Of(Current Array Element)) <= 1.500));
		Event Player.tempCurrentOrb = !Event Player.finished && !Event Player.freeMode ? Filtered Array(Event Player.tempCurrentOrb,
			Distance Between(Event Player, First Of(Current Array Element)) > 1.500 && Distance Between(Eye Position(Event Player),
			First Of(Current Array Element)) > 1.500) : Event Player.tempCurrentOrb;
		If(Event Player.nearestOrb[1] && (Event Player.editMode != 2 || (!Event Player.freeMode && !Event Player.finished)));
			If(Event Player.nearestOrb[2]);
				Set Ability 2 Enabled(Event Player, True);
				Kill(Event Player.targetBot, Null);
				Event Player.ability2 = True;
			Else If(Is Dead(Event Player.targetBot));
				Resurrect(Event Player.targetBot);
			End;
			Call Subroutine(TeleportBotToRefreshPosition);
		End;
		Small Message(Event Player, Custom String("{0}{1}{2}", Global.Config[21],
			!Event Player.finished && !Event Player.freeMode ? Custom String(" {0} / {1}", Count Of(Event Player.currentOrb) - Count Of(
			Event Player.tempCurrentOrb), Count Of(Event Player.currentOrb)) : Custom String(""),
			Event Player.nearestOrb[1] && !Event Player.checkpointA[4] ? Global.Config[23] : Custom String("")));
		Play Effect(Event Player, Buff Impact Sound, Null, Event Player, 80);
		Abort If(!Event Player.nearestOrb[1] || Event Player.freeMode || Event Player.finished || (Event Player.checkpointA[4] && First Of(
			Event Player.checkpointA[3])));
		Wait Until(!Is Using Ability 1(Event Player), 9999);
		Set Ability 1 Enabled(Event Player, True);
	}
}

rule("Back to point refresh ablities (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Event Player.finished == False;
		Event Player.freeMode == False;
		Event Player.checkpointA == True;
		Is On Ground(Event Player) == True;
		Distance Between(Event Player, First Of(Event Player.checkpointA)) <= Event Player.checkpointA[1];
	}

	actions
	{
		If(!Event Player.isSetAbilities);
			Call Subroutine(SetCurrentAbilities);
			If(Event Player.currentOrb);
				Call Subroutine(TeleportCurrentBot);
			End;
		End;
		Event Player.isSetAbilities = False;
	}
}

rule("Crouch disabled tips (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Is Button Held(Event Player, Button(Crouch)) == True;
		Event Player.checkpointA[2] == False;
		Event Player.finished == False;
		Event Player.freeMode == False;
	}

	actions
	{
		Small Message(Event Player, Global.Config[17]);
		Wait(1, Ignore Condition);
	}
}

rule("3rd person (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Is Button Held(Event Player, Button(Reload)) == True;
		Is Button Held(Event Player, Button(Jump)) == True;
		Is Button Held(Event Player, Button(Melee)) == False;
		Is Alive(Event Player) == True;
	}

	actions
	{
		Event Player.third = !Event Player.third;
		If(Event Player.third);
			"by overclocking"
			Start Camera(Event Player, Ray Cast Hit Position(Event Player + Up * (Distance Between(Eye Position(Event Player), Event Player)
				+ 0.500), Ray Cast Hit Position(Event Player + Up * (Distance Between(Eye Position(Event Player), Event Player) + 0.500),
				Event Player + Up * (Distance Between(Eye Position(Event Player), Event Player) + 0.500) + Facing Direction Of(Event Player)
				* -3, Null, Event Player, True), Null, Event Player, True), Event Player + Facing Direction Of(Event Player) * 100, 100);
		Else;
			Stop Camera(Event Player);
	}
}

rule("Back to point (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Event Player.checkpointA == True;
		(Is Button Held(Event Player, Button(Ultimate)) || Is Communicating(Event Player, Spray Up)) == True;
	}

	actions
	{
		If(!Event Player.finished && !Event Player.freeMode && Is Button Held(Event Player, Button(Ultimate)));
			Call Subroutine(TeleportToCurrentCheckoint);
		Else If(Global.EditMode && Is Communicating(Event Player, Spray Up));
			Call Subroutine(CancelAbilityAndMomentum);
			Teleport(Event Player, First Of(Event Player.checkpointA));
			If(Event Player.currentOrb);
				Call Subroutine(TeleportCurrentBot);
	}
}

rule("Free mode (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Event Player.finished == False;
		Is Button Held(Event Player, Button(Reload)) == True;
		Is Button Held(Event Player, Button(Melee)) == True;
		Is Alive(Event Player) == True;
	}

	actions
	{
		If(!Event Player.freeMode);
			Stop Chasing Player Variable(Event Player, time);
			Call Subroutine(EnableAllAbilities);
			Event Player.freeMode = !Event Player.freeMode;
			Small Message(Event Player, Global.Config[15]);
		Else;
			If(!Event Player.movementCollision);
				Enable Movement Collision With Environment(Event Player);
				Event Player.movementCollision = True;
			End;
			Disallow Button(Event Player, Button(Primary Fire));
			Disallow Button(Event Player, Button(Secondary Fire));
			Call Subroutine(CreatePlayerTargetBot);
			Set Ultimate Ability Enabled(Event Player, False);
			Call Subroutine(TeleportToCurrentCheckoint);
			Call Subroutine(DisplayCurrentAbilityMsgs);
			If(Is Using Ultimate(Event Player));
				Kill(Event Player, Null);
				Resurrect(Event Player);
			End;
			Event Player.freeMode = !Event Player.freeMode;
			Call Subroutine(ContinueTiming);
			Allow Button(Event Player, Button(Primary Fire));
			Allow Button(Event Player, Button(Secondary Fire));
	}
}

rule("Spectator mode (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Is Button Held(Event Player, Button(Ultimate)) == True;
		Is Button Held(Event Player, Button(Ability 2)) == True;
		Is Button Held(Event Player, Button(Interact)) == False;
		Is Button Held(Event Player, Button(Ability 1)) == False;
		Is Button Held(Event Player, Button(Reload)) == False;
		Is Button Held(Event Player, Button(Melee)) == False;
		Is Button Held(Event Player, Button(Primary Fire)) == False;
		Is Button Held(Event Player, Button(Secondary Fire)) == False;
		Is Button Held(Event Player, Button(Jump)) == False;
		Is Button Held(Event Player, Button(Crouch)) == False;
	}

	actions
	{
		Event Player.spectatorMode = !Event Player.spectatorMode;
		If(Event Player.spectatorMode);
			Disable Built-In Game Mode Respawning(Event Player);
			Stop Chasing Player Variable(Event Player, time);
			Event Player.tp[0] = Position Of(Event Player);
			Kill(Event Player, Null);
			Wait(0.016, Ignore Condition);
			Teleport(Event Player, Vector(0, -999, 0));
			Small Message(Event Player, Global.Config[16]);
		Else;
			Enable Built-In Game Mode Respawning(Event Player);
			Teleport(Event Player, Nearest Walkable Position(Position Of(Event Player)));
			Resurrect(Event Player);
			Call Subroutine(ContinueTiming);
	}
}

rule("voice (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		(Is Communicating(Event Player, Need Help) || Is Communicating(Event Player, Sorry) || Is Communicating(Event Player, Thanks))
			== True;
	}

	actions
	{
		If(Is Communicating(Event Player, Need Help));
			If(Event Player.cheat);
				Call Subroutine(TempSavePlayerData);
				Event Player.checkpoint = First Of(Event Player.playerData);
				Call Subroutine(SkipOrBackCheckpoint);
			End;
		Else If(Event Player.freeMode || Event Player.finished);
			If(Is Communicating(Event Player, Sorry));
				Event Player.tp[0] = Position Of(Event Player);
				Kill(Event Player, Null);
				Wait(0.016, Ignore Condition);
				Teleport(Event Player, First Of(Event Player.tp));
			Else If(Event Player.numberOfNeedResurrect != 0);
				Event Player.killTargetBot = !Event Player.killTargetBot;
				Small Message(Event Player, Event Player.killTargetBot ? Custom String("The target bot is set to always die") : Custom String(
					"Setting canceled"));
			End;
		End;
		Wait(2, Ignore Condition);
	}
}

rule("set temporary checkpoint (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		(Event Player.freeMode || Event Player.finished) == True;
		Event Player.editMode < 2;
		(Is Button Held(Event Player, Button(Ability 2)) || Is Button Held(Event Player, Button(Reload))) == True;
		Is Button Held(Event Player, Button(Ultimate)) == False;
		Is Button Held(Event Player, Button(Interact)) == False;
		Is Button Held(Event Player, Button(Ability 1)) == False;
		Is Button Held(Event Player, Button(Melee)) == False;
		Is Button Held(Event Player, Button(Primary Fire)) == False;
		Is Button Held(Event Player, Button(Secondary Fire)) == False;
		Is Button Held(Event Player, Button(Jump)) == False;
		Is Button Held(Event Player, Button(Crouch)) == False;
	}

	actions
	{
		If(Is Button Held(Event Player, Button(Ability 2)));
			Wait Until(!Is Button Held(Event Player, Button(Ability 2)), 9999);
			Wait Until(Is Button Held(Event Player, Button(Ability 2)), 0.200);
			If(Is Button Held(Event Player, Button(Ability 2)) && !Is Button Held(Event Player, Button(Jump)) && !Is Button Held(Event Player,
				Button(Primary Fire)) && !Is Button Held(Event Player, Button(Secondary Fire)) && (
				Event Player.freeMode || Event Player.finished));
				Event Player.tp[1] = Event Player.tp[1] ? False : Position Of(Event Player);
				Small Message(Event Player, Event Player.tp[1] ? Custom String("Temporary cp has been set, press {0} to use", Input Binding String(
					Button(Reload))) : Custom String("Temporary cp deleted"));
			End;
		Else If(Event Player.tp[1] && !Is Button Held(Event Player, Button(Melee)) && !Is Communicating Any Emote(Event Player));
			Call Subroutine(CancelAbilityAndMomentum);
			Teleport(Event Player, Event Player.tp[1]);
	}
}

rule("Obstacle Sphere effect (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Event Player.currentSphere != Empty Array;
		Event Player.checkpointA == True;
		Is True For Any(Event Player.currentSphere, Distance Between(Event Player, First Of(Current Array Element))
			<= Current Array Element[1] || Distance Between(Eye Position(Event Player), First Of(Current Array Element))
			<= Current Array Element[1]) == True;
	}

	actions
	{
		If(!Event Player.finished && !Event Player.freeMode);
			Set Status(Event Player, Null, Burning, 0.150);
			Call Subroutine(TeleportToCurrentCheckoint);
		Else;
			Set Status(Event Player, Null, Burning, 9999);
			Wait Until(Is True For All(Event Player.currentSphere, Distance Between(Event Player, First Of(Current Array Element))
				> Current Array Element[1] && Distance Between(Eye Position(Event Player), First Of(Current Array Element))
				> Current Array Element[1]), 9999);
			Clear Status(Event Player, Burning);
	}
}

rule("Elastic cloud effect (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Event Player.currentCloud != Empty Array;
		Event Player.checkpointA == True;
		(Altitude Of(Event Player) >= 0.030 || Is On Ground(Event Player)) == True;
		Is True For Any(Event Player.currentCloud, Distance Between(Event Player, First Of(Current Array Element)) <= 1.500) == True;
	}

	actions
	{
		Apply Impulse(Event Player, Up, First Of(Filtered Array(Event Player.currentCloud, Distance Between(Event Player, First Of(
			Current Array Element)) <= 1.500))[1], To World, Cancel Contrary Motion);
		Play Effect(Event Player, Explosion Sound, Null, Event Player, 80);
	}
}

rule("Player left match, destroy the player`s mercy (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Player Left Match;
		Team 1;
		All;
	}

	actions
	{
		If(Array Contains(Global.ShowHotKeyPlayers, Event Player));
			Modify Global Variable(ShowHotKeyPlayers, Remove From Array By Value, Event Player);
		End;
		For Global Variable(I, 0, Number Of Slots(All Teams), 1);
			If(!Entity Exists(Players In Slot(Global.I, Number Of Slots(Team 1) > Number Of Slots(Team 2) ? Team 1 : Team 2)));
				Destroy Dummy Bot(Number Of Slots(Team 1) > Number Of Slots(Team 2) ? Team 1 : Team 2, Global.I + Number Of Slots(All Teams));
			End;
		End;
	}
}

rule("Start timing after leaving the initial point (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Global.EditMode == False;
		Event Player.freeMode == False;
		Event Player.cheat == False;
		Event Player.leaveOriginalCheckpoint == False;
		Event Player.checkpointB == True;
		Distance Between(Event Player, First Of(Event Player.checkpointA)) > Event Player.checkpointA[1];
	}

	actions
	{
		Chase Player Variable At Rate(Event Player, time, 16200, 1, None);
		Event Player.leaveOriginalCheckpoint = True;
		If(Event Player.currentCheckpoint == 0);
			Event Player.segmentStart = 0;
	}
}

rule("Return to the initial point to reset the timing (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Global.EditMode == False;
		Event Player.checkpoint == 0;
		Event Player.cheat == False;
		Distance Between(Event Player, First Of(First Of(Global.Checkpoint))) <= First Of(Global.Checkpoint)[1];
	}

	actions
	{
		Stop Chasing Player Variable(Event Player, time);
		Event Player.time = 0;
		Event Player.mistake = 0;
		Event Player.leaveOriginalCheckpoint = False;
	}
}

rule("Restart (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Is Button Held(Event Player, Button(Crouch)) == True;
		Is Button Held(Event Player, Button(Ability 2)) == True;
		Is Button Held(Event Player, Button(Melee)) == False;
		Is Button Held(Event Player, Button(Interact)) == True;
		Is Button Held(Event Player, Button(Ability 1)) == False;
		Is Button Held(Event Player, Button(Reload)) == False;
		Is Button Held(Event Player, Button(Primary Fire)) == False;
		Is Button Held(Event Player, Button(Secondary Fire)) == False;
		Is Button Held(Event Player, Button(Ultimate)) == False;
		Is Button Held(Event Player, Button(Jump)) == False;
		(!Global.EditMode || Event Player != Host Player) == True;
		(!Event Player.checkpointA[5] || Event Player.finished) == True;
	}

	actions
	{
		Play Effect(Event Player, Tracer Recall Disappear Sound, Null, Event Player, 200);
		Destroy Effect(Event Player.playerEffect);
		Teleport(Event Player, First Of(First Of(Global.Checkpoint)));
		If(Is Using Ultimate(Event Player));
			Kill(Event Player, Null);
			Resurrect(Event Player);
		End;
		Start Forcing Player To Be Hero(Event Player, Hero(Widowmaker));
		Call Subroutine(InitializePlayerVariables);
		Call Subroutine(EditPlayerData);
		Call Subroutine(CreatePlayerTargetBot);
		Call Subroutine(GetCurrentCheckpoint);
		Set Ultimate Ability Enabled(Event Player, False);
		Call Subroutine(SetCurrentAbilities);
		Call Subroutine(TeleportCurrentBot);
		Call Subroutine(DisplayCurrentAbilityMsgs);
		Start Rule(CreateCurrentEffects, Restart Rule);
		Call Subroutine(CreateCurrentWorldText);
		Start Rule(DisplayCurrentCustomBigMsgs, Do Nothing);
		Start Rule(DisplayCurrentCustomSmallMsgs, Do Nothing);
		Play Effect(Event Player, Tracer Recall Reappear Sound, Null, Event Player, 200);
		Event Player.segmentStart = 0;
	}
}

rule("Skip / Back (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Is Button Held(Event Player, Button(Ability 2)) == True;
		Is Button Held(Event Player, Button(Melee)) == True;
		(Is Button Held(Event Player, Button(Primary Fire)) || Is Button Held(Event Player, Button(Secondary Fire))) == True;
		Is Button Held(Event Player, Button(Jump)) == False;
		Is Button Held(Event Player, Button(Crouch)) == False;
		Is Button Held(Event Player, Button(Ability 1)) == False;
		Is Button Held(Event Player, Button(Interact)) == False;
		Is Button Held(Event Player, Button(Reload)) == False;
		Is Button Held(Event Player, Button(Ultimate)) == False;
		(Global.EditMode || (Global.Cheat && (!Global.FinishedCheat || Event Player.bestRecord)) || Event Player.playerTittle) == True;
		(!Global.EditMode || Event Player != Host Player) == True;
		Count Of(Global.Checkpoint) > 1;
		(!Event Player.checkpointA[5] || Global.EditMode) == True;
	}

	actions
	{
		Call Subroutine(TempSavePlayerData);
		Call Subroutine(ChooseCheckpoint);
		While(!Global.EditMode && Global.Checkpoint[Event Player.checkpoint][5]);
			Call Subroutine(ChooseCheckpoint);
		End;
		Call Subroutine(SkipOrBackCheckpoint);
	}
}

rule("Show or hide shortcuts (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Is Button Held(Event Player, Button(Interact)) == True;
		Is Button Held(Event Player, Button(Crouch)) == False;
		Is Button Held(Event Player, Button(Melee)) == False;
		Is Button Held(Event Player, Button(Ability 1)) == False;
		Is Button Held(Event Player, Button(Reload)) == False;
		Is Button Held(Event Player, Button(Primary Fire)) == False;
		Is Button Held(Event Player, Button(Secondary Fire)) == False;
		Is Button Held(Event Player, Button(Ability 2)) == False;
		Is Button Held(Event Player, Button(Ultimate)) == False;
		Is Button Held(Event Player, Button(Jump)) == False;
		Global.EditMode == False;
	}

	actions
	{
		Wait Until(!Is Button Held(Event Player, Button(Interact)), 9999);
		Wait Until(Is Button Held(Event Player, Button(Interact)), 0.300);
		If(Is Button Held(Event Player, Button(Interact)));
			If(!Array Contains(Global.ShowHotKeyPlayers, Event Player));
				Modify Global Variable(ShowHotKeyPlayers, Append To Array, Event Player);
			Else;
				Modify Global Variable(ShowHotKeyPlayers, Remove From Array By Value, Event Player);
	}
}

rule("Send hello or goodbye robot automatic reply (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		(Is Communicating(Event Player, Hello) || Is Communicating(Event Player, Goodbye)) == True;
	}

	actions
	{
		If(Is Communicating(Event Player, Hello));
			Wait(0.500, Ignore Condition);
			Communicate(Event Player.targetBot, Hello);
		Else;
			Wait(0.500, Ignore Condition);
			Communicate(Event Player.targetBot, Goodbye);
	}
}

rule("Teleport animation (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Global.EditMode == False;
		Event Player.finished == False;
		Event Player.freeMode == False;
		Event Player.checkpointA[5] == True;
		Event Player.checkpointB == True;
		Distance Between(Event Player, First Of(Event Player.checkpointA)) <= Event Player.checkpointA[1];
	}

	actions
	{
		If(Global.TeleportAnimation);
			Start Camera(Event Player, Ray Cast Hit Position(Event Player + Up, Event Player + Facing Direction Of(Event Player) * -1 * 20,
				Null, Null, False), Event Player + Up, 0);
			Set Status(Event Player, Null, Rooted, 1.200);
			Play Effect(Event Player, Sombra Translocator Disappear Sound, Null, Event Player, 100);
			Wait(0.300, Ignore Condition);
			Set Invisible(Event Player, All);
			Wait(0.500, Ignore Condition);
			Teleport(Event Player, First Of(Event Player.checkpointB));
			Wait(0.500, Ignore Condition);
			Set Invisible(Event Player, None);
			Play Effect(Event Player, Sombra Translocator Reappear Sound, Null, Event Player, 100);
			Wait(0.500, Ignore Condition);
			Stop Camera(Event Player);
			Event Player.third = False;
		Else;
			Wait(0.016, Ignore Condition);
			Teleport(Event Player, First Of(Event Player.checkpointB));
	}
}

rule("Sparks, dome, aura, hexagram effect (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Global;
	}

	conditions
	{
		Global.EditMode == False;
		(Global.Dome || Global.Aura || Global.Sparkle || Global.Hexagram) == True;
	}

	actions
	{
		Wait(0.250, Ignore Condition);
		If(Global.Dome);
			Create Effect(Global.FinishedDisplayDome ? Filtered Array(All Players(All Teams), Current Array Element.finished) : All Players(
				All Teams), Sphere, First Of(Global.Config[61]), Global.Config[61][1], Global.Config[61][2], Visible To);
		End;
		If(Global.Aura);
			For Global Variable(II, 0, 6, 1);
				Create Effect(Global.FinishedDisplayAura ? Filtered Array(All Players(All Teams), Current Array Element.finished) : All Players(
					All Teams), Good Aura, Array(Color(Aqua), Color(Lime Green), Color(Green), Color(Yellow), Color(Turquoise), Color(Sky Blue))
					[Global.II], Global.Config[61][1], 10000, Visible To);
				Wait(0.250, Ignore Condition);
			End;
		End;
		If(Global.Sparkle);
			For Global Variable(II, 0, 50, 2);
				Create Effect(Global.FinishedDisplaySparkle ? Filtered Array(All Players(All Teams), Current Array Element.finished) : All Players(
					All Teams), Sparkles, Custom Color(Random Integer(0, 255), Random Integer(0, 255), Random Integer(0, 255), 255),
					Global.Config[61][1] + Vector(0, -2 + Global.II, 0), 10000, Visible To);
				Wait(0.250, Ignore Condition);
			End;
		End;
		If(Global.Hexagram);
			"by Crystal#54774"
			For Global Variable(II, 0, 6, 1);
				Create Beam Effect(Global.FinishedDisplayHexagram ? Filtered Array(All Players(All Teams), Current Array Element.finished)
					: All Players(All Teams), Bad Beam, Global.Config[62][1] + Vector(0, -0.800, 0) + Direction From Angles(
					Global.CircleLoop * 6 + Evaluate Once(Global.II * 60), 0) * Global.Config[62][2], Global.Config[62][1] + Vector(0, -0.800, 0)
					+ Direction From Angles(Global.CircleLoop * 6 + Evaluate Once(Global.II * 60 + (Global.II < 2 ? 240 : -120)), 0)
					* Global.Config[62][2], First Of(Global.Config[62]), Visible To Position and Radius);
				Wait(0.250, Ignore Condition);
			End;
			Chase Global Variable At Rate(CircleLoop, 360, 1, Destination and Rate);
			While(Global.CircleLoop < 361);
				Wait Until(Global.CircleLoop >= 360, 360);
				Global.CircleLoop = 0;
			End;
	}
}

rule("Bombing effect (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Global;
	}

	conditions
	{
		Total Time Elapsed > 16140;
	}

	actions
	{
		Small Message(All Players(All Teams), Custom String("Countdown: 60 seconds"));
		Abort If(Global.EditMode);
		Wait(50, Ignore Condition);
		Big Message(All Players(All Teams), Custom String("— 10 —"));
		Wait(1, Ignore Condition);
		Big Message(All Players(All Teams), Custom String("— 9 —"));
		Wait(1, Ignore Condition);
		Big Message(All Players(All Teams), Custom String("— 8 —"));
		Wait(1, Ignore Condition);
		Big Message(All Players(All Teams), Custom String("— 7 —"));
		Wait(1, Ignore Condition);
		Big Message(All Players(All Teams), Custom String("— 6 —"));
		Wait(1, Ignore Condition);
		Big Message(All Players(All Teams), Custom String("— 5 —"));
		Wait(1, Ignore Condition);
		Big Message(All Players(All Teams), Custom String("— 4 —"));
		Wait(1, Ignore Condition);
		Big Message(All Players(All Teams), Custom String("— 3 —"));
		Communicate(All Players(All Teams), Countdown);
		Wait(1, Ignore Condition);
		Big Message(All Players(All Teams), Custom String("— 2 —"));
		Wait(1, Ignore Condition);
		Big Message(All Players(All Teams), Custom String("— 1 —"));
		Wait(1, Ignore Condition);
		Big Message(All Players(All Teams), Custom String("Boom!"));
		Disable Hero HUD(All Players(All Teams));
		Disable Game Mode HUD(All Players(All Teams));
		Disable Scoreboard(All Players(All Teams));
		Disable Game Mode In-World UI(All Players(All Teams));
		Disable Nameplates(All Players(All Teams), All Players(All Teams));
		Destroy All Effects;
		Destroy All Icons;
		Destroy All HUD Text;
		Destroy All In-World Text;
		Destroy All Dummy Bots;
		Wait(0.160, Ignore Condition);
		Teleport(All Players(All Teams), Vector(0, 500, 0));
		Set Invisible(All Players(All Teams), All);
		Set Gravity(All Players(All Teams), 0);
		Resurrect(All Players(All Teams));
		Start Camera(All Players(All Teams), (Nearest Walkable Position(Vector(999, 999, 999)) + Nearest Walkable Position(Vector(-999,
			-999, -999))) / 2 + Direction From Angles(Match Time * 7.500, -30) * 200, (Nearest Walkable Position(Vector(999, 999, 999))
			+ Nearest Walkable Position(Vector(-999, -999, -999))) / 2, 5);
		Call Subroutine(PlayDestroyMapEffect);
		Wait(1, Ignore Condition);
		Restart Match;
	}
}

rule("Finished setting (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Event Player.checkpoint >= Count Of(Global.Checkpoint) - 1;
	}

	actions
	{
		"@Condition eventPlayer.isDummy() == false"
		Event Player.finished = True;
		Call Subroutine(EnableAllAbilities);
	}
}

rule("Not finished setting (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Event Player.checkpoint < Count Of(Global.Checkpoint) - 1;
	}

	actions
	{
		"@Condition eventPlayer.isDummy() == false"
		Event Player.finished = False;
		If(!Event Player.freeMode);
			Set Ultimate Ability Enabled(Event Player, False);
			If(!Event Player.movementCollision);
				Enable Movement Collision With Environment(Event Player);
				Event Player.movementCollision = True;
	}
}

rule("Set Ultimate Charge 100% (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		(Event Player.finished || Event Player.freeMode) == True;
		Ultimate Charge Percent(Event Player) < 100;
	}

	actions
	{
		"@Condition eventPlayer.isDummy() == false"
		Set Ultimate Charge(Event Player, 100);
	}
}

rule("Hold R, go through the wall (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		(Event Player.finished || Event Player.freeMode) == True;
		Is Button Held(Event Player, Button(Reload)) == True;
		Is Button Held(Event Player, Button(Interact)) == False;
		Is Button Held(Event Player, Button(Crouch)) == False;
		Is Button Held(Event Player, Button(Melee)) == False;
		Is Button Held(Event Player, Button(Ability 1)) == False;
		Is Button Held(Event Player, Button(Primary Fire)) == False;
		Is Button Held(Event Player, Button(Secondary Fire)) == False;
		Is Button Held(Event Player, Button(Ability 2)) == False;
		Is Button Held(Event Player, Button(Ultimate)) == False;
		Is Button Held(Event Player, Button(Jump)) == False;
	}

	actions
	{
		Wait(1, Abort When False);
		Event Player.movementCollision = !Event Player.movementCollision;
		If(Event Player.movementCollision);
			Enable Movement Collision With Environment(Event Player);
			Small Message(Event Player, Custom String("Enable Movement Collision With Environment"));
		Else;
			Disable Movement Collision With Environment(Event Player, False);
			Small Message(Event Player, Custom String("Disable Movement Collision With Environment"));
	}
}

rule("Interact, teleporting players (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Is Button Held(Event Player, Button(Interact)) == True;
		Is Button Held(Event Player, Button(Ability 1)) == False;
		Is Button Held(Event Player, Button(Melee)) == False;
		Is Button Held(Event Player, Button(Primary Fire)) == False;
		Is Button Held(Event Player, Button(Secondary Fire)) == False;
		Is Button Held(Event Player, Button(Ability 2)) == False;
		Is Button Held(Event Player, Button(Ultimate)) == False;
		Is Button Held(Event Player, Button(Jump)) == False;
		Is Button Held(Event Player, Button(Crouch)) == False;
		(Event Player.finished || Event Player.freeMode) == True;
		Is Dummy Bot(Player Closest To Reticle(Event Player, All Teams)) == False;
		Is In View Angle(Event Player, Player Closest To Reticle(Event Player, All Teams), 10) == True;
		(!Global.EditMode || Event Player != Host Player) == True;
		Count Of(Global.Checkpoint) > 1;
		Event Player.checkpointA[5] == False;
		(Current Map != Map(Busan) || Distance Between(Event Player, Vector(134, 17, -125)) > 5) == True;
	}

	actions
	{
		If(Is Button Held(Event Player, Button(Reload)) && !Player Closest To Reticle(Event Player, All Teams).checkpointA[5] && (
			Global.EditMode || (Global.Cheat && (!Global.FinishedCheat || Event Player.bestRecord)) || Event Player.playerTittle));
			Call Subroutine(TempSavePlayerData);
			Event Player.checkpoint = Player Closest To Reticle(Event Player, All Teams).checkpoint;
			Call Subroutine(SkipOrBackCheckpoint);
		Else;
			Teleport(Event Player, Player Closest To Reticle(Event Player, All Teams));
	}
}

rule("Primary / Secondary Fire, select hero (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Global.EditMode == False;
		Event Player.finished == True;
		(Is Button Held(Event Player, Button(Primary Fire)) || Is Button Held(Event Player, Button(Secondary Fire))) == True;
	}

	actions
	{
		If(Is Button Held(Event Player, Button(Primary Fire)));
			Event Player.chooseHero += Event Player.chooseHero == Count Of(All Heroes) - 1 ? 1 - Count Of(All Heroes) : 1;
		Else If(Is Button Held(Event Player, Button(Secondary Fire)));
			Event Player.chooseHero -= Event Player.chooseHero == 0 ? 1 - Count Of(All Heroes) : 1;
		End;
		Preload Hero(Event Player, All Heroes[Event Player.chooseHero]);
	}
}

rule("emote sync within the radius (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Global.EditMode == False;
		Is Communicating Any Emote(Event Player) == True;
		Is Button Held(Event Player, Button(Reload)) == True;
		(Event Player.finished || Event Player.freeMode) == True;
	}

	actions
	{
		Global.EmoteSyncPlayers = Filtered Array(Players Within Radius(Event Player, 15, All Teams, Off), Is Communicating Any Emote(
			Current Array Element) && Hero Of(Current Array Element) == Hero Of(Event Player));
		Global.EmoteSyncPlayers = Mapped Array(Global.EmoteSyncPlayers, Array(Current Array Element, Is Communicating(
			Current Array Element, Emote Up) ? 0 : (Is Communicating(Current Array Element, Emote Down) ? 1 : (Is Communicating(
			Current Array Element, Emote Left) ? 2 : 3))));
		Cancel Primary Action(Mapped Array(Global.EmoteSyncPlayers, First Of(Current Array Element)));
		Wait(0.200, Ignore Condition);
		For Global Variable(I, 0, Count Of(Global.EmoteSyncPlayers), 1);
			If(Global.EmoteSyncPlayers[Global.I][1] == 0);
				Communicate(First Of(Global.EmoteSyncPlayers[Global.I]), Emote Up);
			Else If(Global.EmoteSyncPlayers[Global.I][1] == 1);
				Communicate(First Of(Global.EmoteSyncPlayers[Global.I]), Emote Down);
			Else If(Global.EmoteSyncPlayers[Global.I][1] == 2);
				Communicate(First Of(Global.EmoteSyncPlayers[Global.I]), Emote Left);
			Else If(Global.EmoteSyncPlayers[Global.I][1] == 3);
				Communicate(First Of(Global.EmoteSyncPlayers[Global.I]), Emote Right);
			End;
		End;
	}
}

rule("Voice Line Up,  Swap effect (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Global.EditMode == False;
		Event Player.finished == True;
		Is Communicating(Event Player, Voice Line Up) == True;
	}

	actions
	{
		Destroy Effect(Event Player.playerEffect ? Event Player.playerEffect : Null);
		Event Player.choosePlayerEffect = Random Integer(0, 21);
		If(Event Player.choosePlayerEffect == 0);
			Create Effect(All Players(All Teams), Sphere, Event Player.playerColor, Event Player, Event Player.bodySize,
				Visible To Position Radius and Color);
		Else If(Event Player.choosePlayerEffect == 1);
			Create Effect(All Players(All Teams), Light Shaft, Event Player.playerColor, Event Player, Event Player.bodySize,
				Visible To Position Radius and Color);
		Else If(Event Player.choosePlayerEffect == 2);
			Create Effect(All Players(All Teams), Orb, Event Player.playerColor, Event Player, Event Player.bodySize,
				Visible To Position Radius and Color);
		Else If(Event Player.choosePlayerEffect == 3);
			Create Effect(All Players(All Teams), Ring, Event Player.playerColor, Event Player, Event Player.bodySize,
				Visible To Position Radius and Color);
		Else If(Event Player.choosePlayerEffect == 4);
			Create Effect(All Players(All Teams), Cloud, Event Player.playerColor, Event Player, Event Player.bodySize,
				Visible To Position Radius and Color);
		Else If(Event Player.choosePlayerEffect == 5);
			Create Effect(All Players(All Teams), Sparkles, Event Player.playerColor, Event Player, Event Player.bodySize,
				Visible To Position Radius and Color);
		Else If(Event Player.choosePlayerEffect == 6);
			Create Effect(All Players(All Teams), Good Aura, Event Player.playerColor, Event Player, Event Player.bodySize,
				Visible To Position Radius and Color);
		Else If(Event Player.choosePlayerEffect == 7);
			Create Effect(All Players(All Teams), Bad Aura, Event Player.playerColor, Event Player, Event Player.bodySize,
				Visible To Position Radius and Color);
		Else If(Event Player.choosePlayerEffect == 8);
			Create Effect(All Players(All Teams), Heal Target Active Effect, Event Player.playerColor, Event Player, Event Player.bodySize,
				Visible To Position Radius and Color);
		Else If(Event Player.choosePlayerEffect == 9);
			Create Effect(All Players(All Teams), Heal Target Effect, Event Player.playerColor, Event Player, Event Player.bodySize,
				Visible To Position Radius and Color);
		Else If(Event Player.choosePlayerEffect == 10);
			Create Effect(All Players(All Teams), Ana Biotic Grenade Increased Healing Effect, Event Player.playerColor, Event Player,
				Event Player.bodySize, Visible To Position Radius and Color);
		Else If(Event Player.choosePlayerEffect == 11);
			Create Effect(All Players(All Teams), Ana Nano Boosted Effect, Event Player.playerColor, Event Player, Event Player.bodySize,
				Visible To Position Radius and Color);
		Else If(Event Player.choosePlayerEffect == 12);
			Create Effect(All Players(All Teams), Baptiste Immortality Field Protected Effect, Event Player.playerColor, Event Player,
				Event Player.bodySize, Visible To Position Radius and Color);
		Else If(Event Player.choosePlayerEffect == 13);
			Create Effect(All Players(All Teams), Echo Cloning Effect, Event Player.playerColor, Event Player, Event Player.bodySize,
				Visible To Position Radius and Color);
		Else If(Event Player.choosePlayerEffect == 14);
			Create Effect(All Players(All Teams), Lúcio Sound Barrier Protected Effect, Event Player.playerColor, Event Player,
				Event Player.bodySize, Visible To Position Radius and Color);
		Else If(Event Player.choosePlayerEffect == 15);
			Create Effect(All Players(All Teams), Mercy Damage Boosted Effect, Event Player.playerColor, Event Player, Event Player.bodySize,
				Visible To Position Radius and Color);
		Else If(Event Player.choosePlayerEffect == 16);
			Create Effect(All Players(All Teams), Reaper Wraith Form Effect, Event Player.playerColor, Event Player, Event Player.bodySize,
				Visible To Position Radius and Color);
		Else If(Event Player.choosePlayerEffect == 17);
			Create Effect(All Players(All Teams), Soldier: 76 Sprinting Effect, Event Player.playerColor, Event Player, Event Player.bodySize,
				Visible To Position Radius and Color);
		Else If(Event Player.choosePlayerEffect == 18);
			Create Effect(All Players(All Teams), Torbjörn Overloading Effect, Event Player.playerColor, Event Player, Event Player.bodySize,
				Visible To Position Radius and Color);
		Else If(Event Player.choosePlayerEffect == 19);
			Create Effect(All Players(All Teams), Winston Primal Rage Effect, Event Player.playerColor, Event Player, Event Player.bodySize,
				Visible To Position Radius and Color);
		Else If(Event Player.choosePlayerEffect == 20);
			Create Effect(All Players(All Teams), Wrecking Ball Adaptive Shield Target Effect, Event Player.playerColor, Event Player,
				Event Player.bodySize, Visible To Position Radius and Color);
		Else If(Event Player.choosePlayerEffect == 21);
			Create Effect(All Players(All Teams), Wrecking Ball Piledriver Fire Effect, Event Player.playerColor, Event Player,
				Event Player.bodySize, Visible To Position Radius and Color);
		End;
		Event Player.playerEffect = Last Created Entity;
	}
}

rule("Fast melee (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Global.EditMode == False;
		(Event Player.finished || Event Player.freeMode) == True;
		Hero Of(Event Player) != Hero(Reinhardt);
		Hero Of(Event Player) != Hero(Brigitte);
		Is Button Held(Event Player, Button(Melee)) == True;
		Is Button Held(Event Player, Button(Reload)) == False;
		Is Button Held(Event Player, Button(Ability 1)) == False;
		Is Button Held(Event Player, Button(Ability 2)) == False;
	}

	actions
	{
		Wait(0.500, Abort When False);
		Disallow Button(Event Player, Button(Primary Fire));
		Disallow Button(Event Player, Button(Secondary Fire));
		Disallow Button(Event Player, Button(Ability 1));
		Disallow Button(Event Player, Button(Ability 2));
		Disallow Button(Event Player, Button(Ultimate));
		While(Is Button Held(Event Player, Button(Melee)));
			Wait(0.016, Ignore Condition);
			Press Button(Event Player, Button(Melee));
			Wait(0.034, Ignore Condition);
			Cancel Primary Action(Event Player);
			Set Ability Cooldown(Event Player, Button(Melee), 0);
			Wait(0.050, Ignore Condition);
		End;
		Allow Button(Event Player, Button(Primary Fire));
		Allow Button(Event Player, Button(Secondary Fire));
		Allow Button(Event Player, Button(Ability 1));
		Allow Button(Event Player, Button(Ability 2));
		Allow Button(Event Player, Button(Ultimate));
	}
}

rule("Subroutine ErrorWarningMessage (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Subroutine;
		ErrorWarningMessage;
	}

	actions
	{
		If(Count Of(Global.Checkpoint) == 0);
			Small Message(Event Player, Custom String("There are no checkpoints yet"));
			Play Effect(Event Player, Explosion Sound, Null, Event Player, 100);
			Global.Error = True;
		Else If(Is Button Held(Event Player, Button(Primary Fire)));
			If(Count Of(Event Player.currentSphere) + Count Of(Event Player.currentCloud) + Count Of(Event Player.currentOrb) * 2 + Count Of(
				Filtered Array(Event Player.currentOrb, Current Array Element[1])) * 2 >= Round To Integer((256 - Global.NumberOfUsedEntity)
				/ Number Of Slots(All Teams), Down));
				Small Message(Event Player, Custom String("The available effects of this level have reached the upper limit"));
				Play Effect(Event Player, Explosion Sound, Null, Event Player, 100);
				Global.Error = True;
			Else If(Is Button Held(Event Player, Button(Melee)) && Event Player.editMode == 2 && Count Of(Event Player.currentOrb) == 0);
				Small Message(Event Player, Custom String("There is no orb yet"));
				Play Effect(Event Player, Explosion Sound, Null, Event Player, 100);
				Global.Error = True;
			End;
		Else If(Is Button Held(Event Player, Button(Secondary Fire)));
			If(Event Player.editMode == 2 && Count Of(Event Player.currentOrb) == 0);
				Small Message(Event Player, Custom String("There is no orb yet"));
				Play Effect(Event Player, Explosion Sound, Null, Event Player, 100);
				Global.Error = True;
			Else If(Event Player.editMode == 3 && Count Of(Event Player.currentSphere) == 0);
				Small Message(Event Player, Custom String("There is no sphere yet"));
				Play Effect(Event Player, Explosion Sound, Null, Event Player, 100);
				Global.Error = True;
			Else If(Event Player.editMode == 4 && Count Of(Event Player.currentCloud) == 0);
				Small Message(Event Player, Custom String("There is no cloud yet"));
				Play Effect(Event Player, Explosion Sound, Null, Event Player, 100);
				Global.Error = True;
			End;
		Else If(Is Button Held(Event Player, Button(Reload)));
			If(Event Player.editMode == 1 && !First Of(Event Player.checkpointA[3]));
				Small Message(Event Player, Custom String("Target mercy not created in current level"));
				Play Effect(Event Player, Explosion Sound, Null, Event Player, 100);
				Global.Error = True;
			Else If(Event Player.editMode == 2 && !Event Player.currentOrb[Global.CurrentChooseOrb][1]);
				Small Message(Event Player, Custom String("Target mercy not created in current orb"));
				Play Effect(Event Player, Explosion Sound, Null, Event Player, 100);
				Global.Error = True;
			End;
		Else If(Is Button Held(Event Player, Button(Ability 1)));
			If(Event Player.editMode == 1 && !Event Player.checkpointA[3][1]);
				Small Message(Event Player, Custom String("The current level's target mercy is not set and needs to be resurrected"));
				Play Effect(Event Player, Explosion Sound, Null, Event Player, 100);
				Global.Error = True;
			Else If(Event Player.editMode == 2 && !Event Player.currentOrb[Global.CurrentChooseOrb][2]);
				Small Message(Event Player, Custom String("The current orb's target mercy is not set and needs to be resurrected"));
				Play Effect(Event Player, Explosion Sound, Null, Event Player, 100);
				Global.Error = True;
			End;
		End;
	}
}

rule("Subroutine  CreateNewEffect (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Subroutine;
		CreateNewEffect;
	}

	actions
	{
		If(Event Player.editMode == 2);
			Destroy Icon(Event Player.botIcons[Global.CurrentChooseOrb]);
			Modify Player Variable(Event Player, botIcons, Remove From Array By Index, Global.CurrentChooseOrb);
			Destroy Effect(Event Player.botEffects[Global.CurrentChooseOrb]);
			Modify Player Variable(Event Player, botEffects, Remove From Array By Index, Global.CurrentChooseOrb);
			Destroy Icon(Event Player.orbIcons[Global.CurrentChooseOrb]);
			Destroy Effect(Event Player.orbEffects[Global.CurrentChooseOrb]);
			If(Event Player.currentOrb[Global.CurrentChooseOrb][1]);
				Create Icon(Is True For Any(Event Player.tempCurrentOrb, First Of(Current Array Element) == Evaluate Once(First Of(
					Event Player.currentOrb[Global.CurrentChooseOrb]))) || Event Player.finished || Event Player.freeMode ? Event Player : Null,
					Event Player.currentOrb[Global.CurrentChooseOrb][1] + Vector(0, 2, 0), Arrow: Down, Visible To,
					Event Player.currentOrb[Global.CurrentChooseOrb][2] ? Global.Config[49] : Global.Config[46], True);
				Event Player.botIcons[Global.CurrentChooseOrb] = Last Created Entity;
				Create Effect(Is True For Any(Event Player.tempCurrentOrb, First Of(Current Array Element) == Evaluate Once(First Of(
					Event Player.currentOrb[Global.CurrentChooseOrb]))) || Event Player.finished || Event Player.freeMode ? Event Player : Null,
					Good Aura, Event Player.currentOrb[Global.CurrentChooseOrb][2] ? Global.Config[50] : Global.Config[47],
					Event Player.currentOrb[Global.CurrentChooseOrb][1] + Vector(0, 0.800, 0), 1, Visible To);
				Event Player.botEffects[Global.CurrentChooseOrb] = Last Created Entity;
				Create Icon(Is True For Any(Event Player.tempCurrentOrb, First Of(Current Array Element) == Evaluate Once(First Of(
					Event Player.currentOrb[Global.CurrentChooseOrb]))) || Event Player.finished || Event Player.freeMode ? Event Player : Null,
					First Of(Event Player.currentOrb[Global.CurrentChooseOrb]) + Vector(0, 0.500, 0), Recycle, Visible To,
					Event Player.currentOrb[Global.CurrentChooseOrb][2] ? Global.Config[48] : Global.Config[45], True);
			Else;
				Create Icon(Is True For Any(Event Player.tempCurrentOrb, First Of(Current Array Element) == Evaluate Once(First Of(
					Event Player.currentOrb[Global.CurrentChooseOrb]))) || Event Player.finished || Event Player.freeMode ? Event Player : Null,
					First Of(Event Player.currentOrb[Global.CurrentChooseOrb]) + Vector(0, 0.500, 0), Halo, Visible To, Global.Config[43], True);
			End;
			Event Player.orbIcons[Global.CurrentChooseOrb] = Last Created Entity;
			Create Effect(Is True For Any(Event Player.tempCurrentOrb, First Of(Current Array Element) == Evaluate Once(First Of(
				Event Player.currentOrb[Global.CurrentChooseOrb]))) || Event Player.finished || Event Player.freeMode ? Event Player : Null,
				Orb, Event Player.currentOrb[Global.CurrentChooseOrb][1] ? Global.Config[44] : Global.Config[42], First Of(
				Event Player.currentOrb[Global.CurrentChooseOrb]), 1, Visible To);
			Event Player.orbEffects[Global.CurrentChooseOrb] = Last Created Entity;
		Else If(Event Player.editMode == 3);
			Destroy Effect(Event Player.sphereEffects[Global.CurrentChooseSphere]);
			Create Effect(Event Player, Sphere, Global.Config[40], First Of(Event Player.currentSphere[Global.CurrentChooseSphere]),
				Event Player.currentSphere[Global.CurrentChooseSphere][1], None);
			Event Player.sphereEffects[Global.CurrentChooseSphere] = Last Created Entity;
		Else If(Event Player.editMode == 4);
			Destroy Effect(Event Player.cloudEffects[Global.CurrentChooseCloud]);
			Create Effect(Event Player, Cloud, Global.Config[41], First Of(Event Player.currentCloud[Global.CurrentChooseCloud]), 1, None);
			Event Player.cloudEffects[Global.CurrentChooseCloud] = Last Created Entity;
		End;
	}
}

rule("Subroutine  EditChoosedEffect (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Subroutine;
		EditChoosedEffect;
	}

	actions
	{
		If(Event Player.editMode == 2);
			Destroy Icon(Event Player.orbIcons[Global.CurrentChooseOrb]);
			Destroy Effect(Event Player.orbEffects[Global.CurrentChooseOrb]);
			If(Event Player.currentOrb[Global.CurrentChooseOrb][1]);
				Create Icon(Is True For Any(Event Player.tempCurrentOrb, First Of(Current Array Element) == Evaluate Once(First Of(
					Event Player.currentOrb[Global.CurrentChooseOrb]))) || Event Player.finished || Event Player.freeMode ? Event Player : Null,
					Global.ChooseOrbPosition + Vector(0, 0.500, 0), Recycle, Visible To and Position,
					Event Player.currentOrb[Global.CurrentChooseOrb][2] ? Global.Config[49] : Global.Config[46], True);
			Else;
				Create Icon(Is True For Any(Event Player.tempCurrentOrb, First Of(Current Array Element) == Evaluate Once(First Of(
					Event Player.currentOrb[Global.CurrentChooseOrb]))) || Event Player.finished || Event Player.freeMode ? Event Player : Null,
					Global.ChooseOrbPosition + Vector(0, 0.500, 0), Halo, Visible To and Position, Global.Config[43], True);
			End;
			Event Player.orbIcons[Global.CurrentChooseOrb] = Last Created Entity;
			Create Effect(Is True For Any(Event Player.tempCurrentOrb, First Of(Current Array Element) == Evaluate Once(First Of(
				Event Player.currentOrb[Global.CurrentChooseOrb]))) || Event Player.finished || Event Player.freeMode ? Event Player : Null,
				Orb, Event Player.currentOrb[Global.CurrentChooseOrb][1] ? Global.Config[44] : Global.Config[42], Global.ChooseOrbPosition, 1,
				Visible To Position and Radius);
			Event Player.orbEffects[Global.CurrentChooseOrb] = Last Created Entity;
		Else If(Event Player.editMode == 3);
			Destroy Effect(Event Player.sphereEffects[Global.CurrentChooseSphere]);
			Create Effect(Event Player, Sphere, Global.Config[40], Global.ChooseSpherePosition,
				Event Player.currentSphere[Global.CurrentChooseSphere][1], Position and Radius);
			Event Player.sphereEffects[Global.CurrentChooseSphere] = Last Created Entity;
		Else If(Event Player.editMode == 4);
			Destroy Effect(Event Player.cloudEffects[Global.CurrentChooseCloud]);
			Create Effect(Event Player, Cloud, Global.Config[41], Global.ChooseCloudPosition, 1, Position and Radius);
			Event Player.cloudEffects[Global.CurrentChooseCloud] = Last Created Entity;
		End;
	}
}

rule("Subroutine  KillOrResurrectBot (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Subroutine;
		KillOrResurrectBot;
	}

	actions
	{
		If(Event Player.editMode == 2);
			Event Player.nearestOrb = Event Player.currentOrb[Global.CurrentChooseOrb];
			If(Event Player.nearestOrb[2]);
				Kill(Event Player.targetBot, Null);
			Else;
				Resurrect(Event Player.targetBot);
				Heal(Event Player.targetBot, Null, 1000);
			End;
			Call Subroutine(TeleportBotToRefreshPosition);
		Else;
			If(Event Player.checkpointA[3][1]);
				Kill(Event Player.targetBot, Null);
			Else;
				Resurrect(Event Player.targetBot);
				Heal(Event Player.targetBot, Null, 1000);
			End;
			Call Subroutine(TeleportCurrentBot);
		End;
	}
}

rule("Subroutine  TeleportBotToRefreshPosition (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Subroutine;
		TeleportBotToRefreshPosition;
	}

	actions
	{
		Teleport(Event Player.targetBot, Event Player.nearestOrb[1] ? Event Player.nearestOrb[1] : Global.Config[60]);
		Start Forcing Player Outlines(Event Player.targetBot, Event Player, True, Event Player.nearestOrb[1] ? Color(Red) : Null, Always);
		Heal(Event Player.targetBot, Null, 1000);
		Kill(Event Player.nearestOrb[2] ? Event Player.targetBot : Null, Null);
	}
}

rule("Subroutine ClearRedundantData (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Subroutine;
		ClearRedundantData;
	}

	actions
	{
		Global.EditMode = Null;
		Global.Debug = Null;
		Global.Error = Null;
		Global.ChooseOrbPosition = Null;
		Global.ChooseSpherePosition = Null;
		Global.ChooseCloudPosition = Null;
		Global.TipHudSpaceHolder = Null;
		Global.Cheat = Null;
		Global.Vips = Null;
		Global.PlayersRecord = Null;
		Global.PlayersData = Null;
		Global.BigMessages = Null;
		Global.Tips = Null;
		Global.WorldTexts = Null;
		Global.SmallMessages = Null;
		Global.BotGravity = Null;
		Global.CurrentChooseOrb = Null;
		Global.CurrentChooseSphere = Null;
		Global.CurrentChooseCloud = Null;
		Global.NewCheckpointDefaultCtrl = Null;
		Global.NewCheckpointDefaultRadius = Null;
		Global.NewCheckpointDefaultMaxRefresh = Null;
		Global.Config = Null;
		Global.NumberOfUsedEntity = Null;
		Global.Sparkle = Null;
		Global.FinishedDisplaySparkle = Null;
		Global.FinishedDisplayDome = Null;
		Global.Dome = Null;
		Global.Aura = Null;
		Global.FinishedDisplayAura = Null;
		Global.TempArray = Null;
		Global.FinishedCheat = Null;
		Global.I = Null;
		Global.II = Null;
		Global.CircleLoop = Null;
		Global.Hexagram = Null;
		Global.FinishedDisplayHexagram = Null;
		Global.OnGround = Null;
		Global.Chase = Null;
		Global.Once = Null;
		Global.CreatorAndCode = Null;
		Global.Top5 = Null;
		Global.Top5Color = Null;
		Global.TeleportAnimation = Null;
		Global.ShowHotKeyPlayers = Null;
		Global.EmoteSyncPlayers = Null;
		Global.PreviewPosition = Null;
		Global.TempVar = Null;
		Global.CheckpointBPosition = Null;
		Global.FirstPlaceTimeArray = Null;
		Global.nullTimeArray = Null;
	}
}

rule("Subroutine  InitializeGlobalVariables (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Subroutine;
		InitializeGlobalVariables;
	}

	actions
	{
		Global.EditMode = Workshop Setting Toggle(Custom String("Edit Mode(편집 모드)"), Custom String("Edit Mode(편집 모드)"), True, 0);
		Global.NewCheckpointDefaultRadius = Workshop Setting Real(Custom String("Edit Mode(편집 모드)"), Custom String(
			"New level radius(새 관문 반경)"), 1.600, 1, 5, 1);
		Global.NewCheckpointDefaultCtrl = Workshop Setting Toggle(Custom String("Edit Mode(편집 모드)"), Custom String(
			"New level crouch(새 관문 앉기)"), False, 2);
		Global.NewCheckpointDefaultMaxRefresh = Workshop Setting Toggle(Custom String("Edit Mode(편집 모드)"), Custom String(
			"New level Ga infinite times(새 관문 수호천사를 무제한)"), False, 3);
		Global.BotGravity = Workshop Setting Toggle(Custom String("Edit Mode(편집 모드)"), Custom String("Bot floating(로봇이 떠다니다)"), False, 4);
		Global.OnGround = Workshop Setting Toggle(Custom String("Edit Mode(편집 모드)"), Custom String("Land on arrival point(도착은 착지가 필요하다)"),
			False, 5);
		Global.Cheat = Workshop Setting Toggle(Custom String("Official game"), Custom String("Skip / Back"), True, 0);
		Global.FinishedCheat = Workshop Setting Toggle(Custom String("Official game"), Custom String(
			"Skip / Back only after clearing the level (need to turn on the Skip / Back)"), True, 1);
		Global.TeleportAnimation = Workshop Setting Toggle(Custom String("Official game"), Custom String("Teleport animation"), True, 2);
		Global.Sparkle = Workshop Setting Toggle(Custom String("Official game"), Custom String("Spark effect"), False, 3);
		Global.FinishedDisplaySparkle = Workshop Setting Toggle(Custom String("Official game"), Custom String(
			"Only visible sparks after clearing the level(Need to turn on the spark effect"), True, 4);
		Global.Dome = Workshop Setting Toggle(Custom String("Official game"), Custom String("Dome effect"), False, 5);
		Global.FinishedDisplayDome = Workshop Setting Toggle(Custom String("Official game"), Custom String(
			"Only visible dome after clearing the level(Need to turn on the dome effect)"), True, 6);
		Global.Aura = Workshop Setting Toggle(Custom String("Official game"), Custom String("Halo effect"), False, 7);
		Global.FinishedDisplayAura = Workshop Setting Toggle(Custom String("Official game"), Custom String(
			"Only visible halo after clearing the level(Need to turn on the halo effect)"), True, 8);
		Global.Hexagram = Workshop Setting Toggle(Custom String("Official game"), Custom String("Six-pointed star effect"), False, 9);
		Global.FinishedDisplayHexagram = Workshop Setting Toggle(Custom String("Official game"), Custom String(
			"Only visible six-pointed star after clearing the level(Need to turn on the six-pointed star effect)"), True, 10);
		Global.Debug = Workshop Setting Toggle(Custom String("Debug (Don't change)"), Custom String("Debug"), False, 0);
		Global.Checkpoint = Global.Checkpoint ? Global.Checkpoint : Empty Array;
		Global.PreviewPosition = Empty Array;
		Global.TempVar[11] = Null;
		Global.Once = True;
		Global.NumberOfUsedEntity = Number Of Slots(All Teams) * 5 + 25 + 6 + 1 + 6 + 1;
		Global.ShowHotKeyPlayers = Empty Array;
		Global.PlayersRecord = Empty Array;
		Global.PlayersData = Empty Array;
		Global.Top5 = Empty Array;
		Global.Top5Color = Array(Custom Color(255, 215, 0, 255), Custom Color(220, 223, 227, 255), Custom Color(191, 173, 111, 255),
			Custom Color(192, 192, 192, 255), Custom Color(128, 138, 135, 255));
		Global.TipHudSpaceHolder[0] = Custom String("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
		Global.TipHudSpaceHolder[1] = Custom String("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
		Global.nullTimeArray = Array(Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null,
			Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null,
			Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null,
			Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null,
			Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null,
			Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null,
			Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null,
			Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null, Null);
		Global.FirstPlaceTimeArray = Array Slice(Global.nullTimeArray, 0, Count Of(Global.Checkpoint) - 1);
	}
}

rule("Subroutine InitializePlayerVariables (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Subroutine;
		InitializePlayerVariables;
	}

	actions
	{
		Event Player.checkpoint = 0;
		Event Player.freeMode = False;
		Event Player.spectatorMode = False;
		Event Player.cheat = False;
		Event Player.leaveOriginalCheckpoint = False;
		Event Player.time = 0;
		Event Player.mistake = 0;
		Event Player.bodySize = 1;
		If(!Event Player.movementCollision);
			Enable Movement Collision With Environment(Event Player);
			Event Player.movementCollision = True;
		End;
		If(!Event Player.playerNickname);
			Event Player.editMode = Global.EditMode ? 1 : 0;
			Event Player.bestRecord = First Of(Filtered Array(Global.PlayersRecord, First Of(Current Array Element) == Custom String("{0}",
				Event Player)))[1];
			Event Player.chooseHero = 0;
			Event Player.voice = 1;
			Event Player.barrierSize = 1;
			Event Player.projectile = 100;
			Event Player.currentOrb = Empty Array;
			Event Player.currentSphere = Empty Array;
			Event Player.currentCloud = Empty Array;
			Event Player.playerTittle = First Of(Filtered Array(Global.Vips, First Of(Current Array Element) == Custom String("{0}",
				Event Player)));
			Event Player.playerNickname = Event Player.playerTittle ? (
				Event Player.playerTittle[1] ? Event Player.playerTittle[1] : Custom String("{0}", Event Player)) : Custom String("{0}",
				Event Player);
			Event Player.playerColor = Event Player.playerTittle ? (Event Player.playerTittle[2] == Color(White) ? Custom Color(Random Integer(
				0, 255), Random Integer(0, 255), Random Integer(0, 255), 255) : Event Player.playerTittle[2]) : Color(White);
			If(Global.EditMode && !Array Contains(Global.ShowHotKeyPlayers, Event Player));
				Modify Global Variable(ShowHotKeyPlayers, Append To Array, Event Player);
			End;
		End;
		Event Player.segmentTimeArray = Array Slice(Global.nullTimeArray, 0, Count Of(Global.Checkpoint) - 1);
		Event Player.segmentVsPersonalBestArray = Empty Array;
		Event Player.vsPersonalBestRunningTally = 0;
		If(!Event Player.editMode && Hero Of(Event Player) != Hero(Widowmaker));
			Start Forcing Player To Be Hero(Event Player, Hero(Widowmaker));
		End;
	}
}

rule("Subroutine  CreatePlayerTargetBot (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Subroutine;
		CreatePlayerTargetBot;
	}

	actions
	{
		If(!Entity Exists(Event Player.targetBot));
			Create Dummy Bot(Hero(Widowmaker), Opposite Team Of(Team Of(Event Player)), Slot Of(Event Player) + Number Of Slots(All Teams),
				First Of(Global.Checkpoint[Event Player.checkpoint][3]) ? First Of(Global.Checkpoint[Event Player.checkpoint][3])
				: Global.Config[60], Null);
			Event Player.targetBot = Last Created Entity;
			Set Max Health(Event Player.targetBot, 500);
			Wait(0.016, Ignore Condition);
			Start Forcing Dummy Bot Name(Event Player.targetBot, Custom String("{0}{1}", Event Player, Global.Config[11]));
			Wait(0.016, Ignore Condition);
			Start Facing(Event Player.targetBot, Direction Towards(Update Every Frame(Eye Position(Event Player.targetBot)),
				Update Every Frame(Eye Position(Event Player))), 9999, To World, Direction and Turn Rate);
			If(Hero Of(Event Player.targetBot) == Hero(Tracer) || Hero Of(Event Player.targetBot) == Hero(D.Va));
				Event Player.editModeCharacterResetted = 150;
			Else;
				If(Hero Of(Event Player.targetBot) == Hero(Widowmaker));
					Event Player.editModeCharacterResetted = 175;
				Else;
					Event Player.editModeCharacterResetted = 200;
				End;
			End;
		End;
	}
}

rule("Subroutine CreateGlobalHUD (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Subroutine;
		CreateGlobalHUD;
	}

	actions
	{
		"运行时间"
		If(Current Game Mode == Game Mode(Skirmish));
			Set Objective Description(All Players(All Teams), Custom String("Elapsed time {0} minutes {1} seconds", Round To Integer(
				Total Time Elapsed / 60, Down), Round To Integer(Total Time Elapsed % 60, Down)), Visible To and String);
		Else;
			Create HUD Text(All Players(All Teams), Null, Custom String("Elapsed time {0} minutes {1} seconds", Round To Integer(
				Total Time Elapsed / 60, Down), Round To Integer(Total Time Elapsed % 60, Down)), Null, Top, 0, Null, Color(White), Null,
				Visible To and String, Default Visibility);
		End;
		Create Effect(Local Player.bhop ? Local Player : Null, Ana Nano Boosted Effect, Null, Local Player, 1,
			Visible To Position and Radius);
		Create HUD Text(All Players(All Teams), Null, Null, Custom String("Widow Parkour {0}\nby {1}\nCode: {2}", Current Map, First Of(
			Global.CreatorAndCode) ? First Of(Global.CreatorAndCode) : Custom String("Anonymous"),
			Global.CreatorAndCode[1] ? Global.CreatorAndCode[1] : Custom String("Not yet")), Left, -999, Null, Null, Global.Config[12],
			Visible To and String, Default Visibility);
		Create HUD Text(All Players(All Teams), Null, Null, Custom String("{0} Double click ({1}) Show or hide controls",
			Ability Icon String(Hero(Torbjörn), Button(Ability 2)), Input Binding String(Button(Interact))), Right, 98, Null, Null,
			Custom Color(220, 220, 220, 200), Visible To and String, Default Visibility);
		Create HUD Text(Global.ShowHotKeyPlayers, Null, Custom String("--------------------{0}{1}", Custom String("{0}", Hero(Mercy))
			== Custom String("Mercy") ? Custom String("----") : (String Length(Input Binding String(Button(Interact))) > 1 ? (
			String Length(Input Binding String(Button(Interact))) > 3 ? (String Length(Input Binding String(Button(Interact)))
			> 5 ? Custom String("-----") : Custom String("---")) : Custom String("--")) : Custom String("")), Custom String("{0}", Hero(
			Mercy)) == Custom String("マーシー") ? Custom String("-------------") : (Custom String("{0}", Hero(Mercy)) == Custom String("慈悲")
			? Custom String("----------") : Custom String(""))), Custom String("Preview next point : {0} + {1}\n{2}", Input Binding String(
			Button(Primary Fire)), Input Binding String(Button(Secondary Fire)), Custom String("Back to point : {0}{1}\n{2}",
			Input Binding String(Button(Ultimate)), Global.EditMode ? Custom String(" / Spray Up") : Custom String(""), Custom String(
			"Free Mode : {0} + {1}\n{2}", Input Binding String(Button(Reload)), Input Binding String(Button(Melee)), Custom String(
			"3rd Person : {0} + {1}\n{2}", Input Binding String(Button(Reload)), Input Binding String(Button(Jump)), Custom String(
			"Spectator Mode : {0} + {1}{2}", Input Binding String(Button(Ultimate)), Input Binding String(Button(Ability 2)),
			Global.EditMode && Local Player == Host Player ? Custom String("") : Custom String("\nRestart : {0} + {1} + {2}",
			Input Binding String(Button(Crouch)), Input Binding String(Button(Ability 2)), Input Binding String(Button(Interact)))))))),
			Right, 100, Null, Null, Custom Color(205, 209, 211, 255), Visible To and String, Default Visibility);
		Create HUD Text(Filtered Array(Global.ShowHotKeyPlayers, Current Array Element.freeMode || Current Array Element.finished), Null,
			Custom String("--------------------{0}{1}", Custom String("{0}", Hero(Mercy)) == Custom String("Mercy") ? Custom String("----")
			: (String Length(Input Binding String(Button(Interact))) > 1 ? (String Length(Input Binding String(Button(Interact))) > 3 ? (
			String Length(Input Binding String(Button(Interact))) > 5 ? Custom String("-----") : Custom String("---")) : Custom String(
			"--")) : Custom String("")), Custom String("{0}", Hero(Mercy)) == Custom String("マーシー") ? Custom String("-------------") : (
			Custom String("{0}", Hero(Mercy)) == Custom String("慈悲") ? Custom String("----------") : Custom String(""))), Custom String(
			"{0}", Hero(Mercy)) == Custom String("메르시") ? Custom String("앞으로 텔포 : Hold {0}\n{1}", Input Binding String(Button(Reload)),
			Custom String("발키리 해제 : 음성 \"{0}\"\n{1}", String("Sorry"), Custom String("임시 CP 설정 : 두 번 탭 {0}{1}", Input Binding String(
			Button(Ability 2)), Global.EditMode && Local Player == Host Player ? Custom String("") : Custom String("\n상대에게 텔포 : {0}{1}",
			Input Binding String(Button(Interact)), Global.EditMode || (Global.Cheat && (!Global.FinishedCheat || Local Player.bestRecord))
			|| Local Player.playerTittle ? Custom String("\n상대 레벨로 이동 : {0} + {1}", Input Binding String(Button(Interact)),
			Input Binding String(Button(Reload))) : Custom String(""))))) : Custom String("Cancel Movement collision : Hold {0}\n{1}",
			Input Binding String(Button(Reload)), Custom String("Interrupt Valkyrie : Voice Line \"Sorry\"\n{0}", Custom String(
			"Set Temporary cp : Double click {0}{1}", Input Binding String(Button(Ability 2)),
			Global.EditMode && Local Player == Host Player ? Custom String("") : Custom String("\nTo player's position : {0}{1}",
			Input Binding String(Button(Interact)), Global.EditMode || (Global.Cheat && (!Global.FinishedCheat || Local Player.bestRecord))
			|| Local Player.playerTittle ? Custom String("\nTo player's level : {0} + {1}", Input Binding String(Button(Interact)),
			Input Binding String(Button(Reload))) : Custom String(""))))), Right, 101, Null, Custom Color(205, 209, 211, 255),
			Custom Color(205, 209, 211, 175), Visible To and String, Default Visibility);
		Create HUD Text(Filtered Array(Global.ShowHotKeyPlayers, (Global.EditMode && Current Array Element != Host Player) || (
			!Global.EditMode && ((Global.Cheat && (!Global.FinishedCheat || Current Array Element.bestRecord))
			|| Current Array Element.playerTittle))), Null, Custom String("--------------------{0}{1}", Custom String("{0}", Hero(Mercy))
			== Custom String("Mercy") ? Custom String("----") : (String Length(Input Binding String(Button(Interact))) > 1 ? (
			String Length(Input Binding String(Button(Interact))) > 3 ? (String Length(Input Binding String(Button(Interact)))
			> 5 ? Custom String("-----") : Custom String("---")) : Custom String("--")) : Custom String("")), Custom String("{0}", Hero(
			Mercy)) == Custom String("マーシー") ? Custom String("-------------") : (Custom String("{0}", Hero(Mercy)) == Custom String("慈悲")
			? Custom String("----------") : Custom String(""))), Custom String("Next level : {0} + {1} + {2}", Input Binding String(Button(
			Ability 2)), Input Binding String(Button(Melee)), Custom String("{0}\nPrev Level : {1} + {2}", Input Binding String(Button(
			Primary Fire)), Input Binding String(Button(Ability 2)), Custom String("{0} + {1}", Input Binding String(Button(Melee)),
			Input Binding String(Button(Secondary Fire))))), Right, 102, Null, Custom Color(205, 209, 211, 175), Color(Orange),
			Visible To and String, Default Visibility);
		If(!Global.EditMode);
			"TOP5"
			Create HUD Text(Global.Top5 ? All Players(All Teams) : Null, Null, Null, Global.Config[24] ? Global.Config[24] : Custom String(
				"Today`s Top {0}", Count Of(Global.Top5)), Left, -991, Null, Null, Global.Config[25], Visible To and String,
				Default Visibility);
			For Global Variable(I, 0, 5, 1);
				Create HUD Text(Global.Top5[Evaluate Once(Global.I)] ? All Players(All Teams) : Null, Hero Icon String(Hero(Widowmaker)),
					Custom String("{0} {1}", Array(Custom String("1st"), Custom String("2nd"), Custom String("3rd"), Custom String("4th"),
					Custom String("5th"))[Evaluate Once(Global.I)], First Of(Global.Top5[Evaluate Once(Global.I)])), Custom String("{0} sec",
					Global.Top5[Evaluate Once(Global.I)][1]), Left, -990 + Global.I, Global.Top5Color[Global.I], Global.Top5Color[Global.I],
					Global.Top5Color[Global.I], Visible To and String, Default Visibility);
			End;
			Create HUD Text(All Players(All Teams), Null, Null, Custom String(" "), Left, -901, Null, Null, Null, Visible To,
				Default Visibility);
			"HighLights"
			Create HUD Text(Is True For Any(All Players(All Teams), Current Array Element.bestRecord && Index Of Array Value(Global.Top5,
				Custom String("{0}", Current Array Element.playerNickname)) < 0) ? All Players(All Teams) : Null, Null, Null,
				Global.Config[26], Left, -900, Null, Null, Global.Config[27], Visible To, Default Visibility);
			Create HUD Text(All Players(All Teams), Null, Null, Custom String(" "), Left, -996, Null, Null, Null, Visible To,
				Default Visibility);
		Else;
			Create HUD Text(Host Player, Null, Array(Custom String(""), Custom String("Controls: Checkpoint"), Custom String("Controls: Orb"),
				Custom String("Controls: Sphere"), Custom String("Controls: Cloud"))[Host Player.editMode], Array(Custom String(""),
				Custom String("Create Point | Interact + Primary Fire\nInsert Point | Interact + Melee{0}", Custom String(
				"\nSelect Point | E + Primary / Secondary Fire\nMove Point | Interact + E\nSwitch Crouch | Interact + Crouch")), Custom String(
				"Create Orb | Interact + Primary Fire\nSelect Orb | E + Primary / Secondary Fire{0}", Custom String(
				"\nMove Position | Reload + Primary / Secondary Fire\nCreate Bot | Melee + Primary Fire\nDelete Bot | Melee + Secondary Fire")),
				Custom String("Create Sphere | Interact + Primary Fire\nSelect Sphere | E + Primary / Secondary {0}", Custom String(
				"Fire\nMove Position | Reload + Primary / Secondary Fire\nAdjust Radius | Jump + Primary / Secondary Fire")), Custom String(
				"Create Cloud | Interact + Primary Fire\nSelect Cloud | E + Primary / Secondary Fire{0}", Custom String(
				"\nMove Position | Reload + Primary / Secondary Fire\nAdjust Level | Jump + Primary / Secondary Fire")))[Host Player.editMode],
				Left, 100, Null, Color(White), Color(Turquoise), Visible To Sort Order String and Color, Default Visibility);
			Create HUD Text(Host Player, Null, Null, Array(Custom String(""), Custom String(
				"Set Unlimited Grapple | Interact + Ultimate\nSwitch Teleport | Interact + Jump{0}", Custom String(
				"\nCreate Bot | Melee + Primary Fire\nDelete Bot | Melee + Secondary Fire\nKill Bot | Interact + Reload")), Custom String(
				"Kill Bot | Interact + Melee"), Custom String(""), Custom String(""))[Host Player.editMode], Left, 101, Null, Null, Color(
				Turquoise), Visible To Sort Order String and Color, Default Visibility);
			Create HUD Text(Host Player, Null, Null, Array(Custom String(""), Custom String(
				"Only Usable on Mercy (use \"I need healing\" to switch)\n{0}", Custom String(
				"Adjust Radius | Jump + Primary / Secondary Fire [Gun]\nDelete Checkpoint | Interact + Secondary Fire [Gun]")), Custom String(
				"Only Usable on Mercy (Switch to spectator and back to switch)\nDelete Orb | Interact + Secondary Fire [Gun]"), Custom String(
				"Only Usable on Mercy (Switch to spectator and back to switch)\nDelete Sphere | Interact + Secondary Fire [Gun]"),
				Custom String("Only Usable on Mercy (Switch to spectator and back to switch)\nDelete Cloud | Interact + Secondary Fire [Gun]"))
				[Host Player.editMode], Left, 102, Null, Null, Weapon(Host Player) == 2 ? Color(Turquoise) : Custom Color(181, 152, 161, 255),
				Visible To Sort Order String and Color, Default Visibility);
			Create HUD Text(Host Player.editMode == 1 && Array Contains(Array(Map(Busan), Map(Ilios), Map(Lijiang Tower), Map(Lijiang Tower),
				Map(Nepal), Map(Oasis)), Current Map) ? Host Player : Null, Null, Null, Custom String(
				"Teleport Other Map | Voice Line \"Group Up\""), Left, 103, Null, Null, Color(Turquoise),
				Visible To Sort Order String and Color, Default Visibility);
			Create HUD Text(Host Player, Null, Custom String("--------------"), Custom String(
				"Current Mode | {0} (Double click {1} Switch) \nExport data | {2}", Array(Custom String(""), Custom String("Checkpoint"),
				Custom String("Orb"), Custom String("Sphere"), Custom String("Cloud"))[Host Player.editMode], Input Binding String(Button(
				Interact)), Custom String("{0} + {1} + {2}", Input Binding String(Button(Ultimate)), Input Binding String(Button(Crouch)),
				Custom String("{0} + {1}", Input Binding String(Button(Jump)), Input Binding String(Button(Melee))))), Left, 104, Null,
				Custom Color(205, 209, 211, 255), Custom Color(205, 209, 211, 255), Visible To Sort Order String and Color,
				Default Visibility);
			Create Icon(Count Of(Global.Checkpoint) > 0 ? All Players(All Teams) : Null, First Of(Host Player.checkpointA) + Vector(0, 1.200,
				0), Flag, Visible To and Position, Color(Red), True);
			Create Effect(Count Of(Global.Checkpoint) > 0 ? All Players(All Teams) : Null, Light Shaft, Color(Red), First Of(
				Host Player.checkpointA), Host Player.checkpointA[1], Visible To Position and Radius);
			Create In-World Text(Count Of(Global.Checkpoint) > 0 ? All Players(All Teams) : Null, Custom String("LEVEL : {0}\n{1}",
				Host Player.checkpoint, Custom String("RADIUS : {0}\n{1}", Host Player.checkpointA[1], Custom String("CROUCH : {0}\n{1}",
				Host Player.checkpointA[2] ? Custom String("√") : Custom String("×"), Custom String("RESURRECT : {0}\n{1}",
				Host Player.checkpointA[3][1] ? Custom String("√") : Custom String("×"), Custom String("Resurrection refresh GA : {0}\n{1}",
				Host Player.checkpointA[3][1] && Host Player.checkpointA[3][2] ? Custom String("√") : Custom String("×"), Custom String(
				"UNLIMITED GA : {0}\n{1}", Host Player.checkpointA[4] ? Custom String("√") : Custom String("×"), Custom String(
				"TELEPORT : {0}\n{1}", Host Player.checkpointA[5] ? Custom String("√") : Custom String("×"), Custom String(
				"EFFECTS : {0}\n{1}", Round To Integer((256 - Global.NumberOfUsedEntity) / Number Of Slots(All Teams), Down) - Count Of(
				Host Player.currentOrb) * 2 - Count Of(Filtered Array(Host Player.currentOrb, Current Array Element[1])) * 2 - Count Of(
				Host Player.currentSphere) - Count Of(Host Player.currentCloud), Custom String("POSITION : {0}", First Of(
				Host Player.checkpointA)))))))))), First Of(Host Player.checkpointA) + Vector(0, 0.500, 0), 1.200, Do Not Clip,
				Visible To Position and String, Color(Green), Default Visibility);
			Create Effect(Count Of(Host Player.currentOrb) > 0 && Host Player.editMode == 2 ? All Players(All Teams) : Null, Good Aura,
				Host Player.currentOrb[Global.CurrentChooseOrb][1] ? Global.Config[44] : Global.Config[42], Global.ChooseOrbPosition, 1.300,
				Visible To Position Radius and Color);
			Create In-World Text(Count Of(Host Player.currentOrb) > 0 && Host Player.editMode == 2 ? All Players(All Teams) : Null,
				Custom String("TELEPORT BOT : {0}\n{1}", Host Player.currentOrb[Global.CurrentChooseOrb][1] ? Custom String("√")
				: Custom String("×"), Custom String("RESURRECT : {0}\n{1}", Host Player.currentOrb[Global.CurrentChooseOrb][2] ? Custom String(
				"√") : Custom String("×"), Custom String("Resurrection refresh GA : {0}\n{1}",
				Host Player.currentOrb[Global.CurrentChooseOrb][2] && Host Player.currentOrb[Global.CurrentChooseOrb][3] ? Custom String("√")
				: Custom String("×"), Custom String("DISTANCE : {0}\n{1}", Distance Between(Host Player, Global.ChooseOrbPosition) - First Of(
				Host Player.currentOrb[Global.CurrentChooseOrb]), Custom String("POSITION : {0}", Global.ChooseOrbPosition))))),
				Global.ChooseOrbPosition + Vector(0, 0.500, 0), 1.200, Do Not Clip, Visible To Position and String, Color(Green),
				Default Visibility);
			Create Effect(Count Of(Host Player.currentSphere) > 0 && Host Player.editMode == 3 ? All Players(All Teams) : Null, Orb, Color(
				Green), Global.ChooseSpherePosition, 1, Visible To Position and Radius);
			Create In-World Text(Count Of(Host Player.currentSphere) > 0 && Host Player.editMode == 3 ? All Players(All Teams) : Null,
				Custom String("RADIUS: {0}\n{1}", Host Player.currentSphere[Global.CurrentChooseSphere][1], Custom String(
				"DISTANCE : {0}\n{1}", Distance Between(Host Player, Global.ChooseSpherePosition) - First Of(
				Host Player.currentSphere[Global.CurrentChooseSphere]), Custom String("POSITION : {0}", Global.ChooseSpherePosition))),
				Global.ChooseSpherePosition + Vector(0, 0.500, 0), 1.200, Do Not Clip, Visible To Position and String, Color(Green),
				Default Visibility);
			Create Effect(Count Of(Host Player.currentCloud) > 0 && Host Player.editMode == 4 ? All Players(All Teams) : Null, Good Aura,
				Color(Green), Global.ChooseCloudPosition, 1.300, Visible To Position and Radius);
			Create In-World Text(Count Of(Host Player.currentCloud) > 0 && Host Player.editMode == 4 ? All Players(All Teams) : Null,
				Custom String("LEVEL : {0}\n{1}", Host Player.currentCloud[Global.CurrentChooseCloud][1], Custom String("DISTANCE : {0}\n{1}",
				Distance Between(Host Player, Global.ChooseCloudPosition) - First Of(Host Player.currentCloud[Global.CurrentChooseCloud]),
				Custom String("POSITION : {0}", Global.ChooseCloudPosition))), Global.ChooseCloudPosition + Vector(0, 0.500, 0), 1.200,
				Do Not Clip, Visible To Position and String, Color(Green), Default Visibility);
		End;
	}
}

rule("Subroutine CreatePlayerHUDAndEffects (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Subroutine;
		CreatePlayerHUDAndEffects;
	}

	actions
	{
		If(!Global.EditMode);
			Create In-World Text(Event Player.checkpoint == Count Of(Global.Checkpoint) - 1 ? Event Player : Null,
				Event Player.segmentTimeString, Vector(54.660, -12, 30.900), 1, Do Not Clip, Visible To Position and String, Color(Sky Blue),
				Default Visibility);
			Create In-World Text(Event Player.checkpoint == Count Of(Global.Checkpoint) - 1 ? Event Player : Null,
				Event Player.personalBestString, Vector(61.420, -12, 25.740), 1, Do Not Clip, Visible To Position and String, Color(Blue),
				Default Visibility);
			Create In-World Text(Event Player.checkpoint == Count Of(Global.Checkpoint) - 1 ? Event Player : Null, Global.FirstPlaceTimeString,
				Vector(68.180, -12, 18.880), 1, Do Not Clip, Visible To Position and String, Custom Color(255, 215, 0, 255),
				Default Visibility);
			Create In-World Text(Event Player.checkpoint == Count Of(Global.Checkpoint) - 1 ? Event Player : Null,
				Event Player.bestSegmentsArrayString, Vector(74.940, -12, 12.020), 1, Do Not Clip, Visible To Position and String,
				Custom Color(150, 230, 210, 255), Default Visibility);
		End;
		Create HUD Text(Event Player, Null, Null, First Of(Event Player.checkpointA[3]) ? Custom String(
			"Distance to bot: {0}\r\nCharge Needed: {1}%\r\n{2}", Distance Between(Event Player, Event Player.targetBot) - 0.190,
			Distance Between(Event Player, Event Player.targetBot) > 40.190 ? 66.670 + (Distance Between(Event Player,
			Event Player.targetBot) - 40.190) * 2.500 : 66.670, Custom String("Last Damage: {0}", Event Player.recentDamage))
			: Custom String("Distance to bot: N/A\nCharge Needed: N/A\nLast Damage: {0}", Event Player.recentDamage), Right, 2, Null, Null,
			Distance Between(Event Player, Event Player.targetBot) < 40.190 ? Color(Green) : (Distance Between(Event Player,
			Event Player.targetBot) < 53.520 ? Color(Yellow) : Color(Red)), Visible To String and Color, Default Visibility);
		If(Event Player.editModeCharacterResetted == 1);
			Wait(0.030, Ignore Condition);
			Destroy HUD Text(Last Text ID);
		End;
		Create In-World Text(All Players(All Teams), Custom String("{0}  {1}", Event Player.playerNickname,
			Global.EditMode ? Event Player.checkpoint : Event Player.displayedCheckpoint), Event Player, 1.300, Do Not Clip,
			Visible To Position String and Color, Event Player.playerColor, Default Visibility);
		Create HUD Text(Event Player, Null, Null, Custom String("{0} {1} / {2}", Global.Config[13],
			Global.EditMode ? Event Player.checkpoint : Event Player.displayedCheckpoint, Custom String("{0}{1}{2}",
			Global.EditMode ? Count Of(Global.Checkpoint) - 1 : Evaluate Once(Count Of(Filtered Array(Global.Checkpoint,
			!Current Array Element[5])) - 1), Global.EditMode && Is True For Any(Global.Checkpoint, Current Array Element[5])
			? Custom String(" [{0}]", Count Of(Filtered Array(Global.Checkpoint, !Current Array Element[5])) - 1) : Custom String(""),
			First Of(Global.TipHudSpaceHolder))), Top, 1, Null, Null, Global.Config[14], Visible To and String, Default Visibility);
		Create Effect(First Of(Event Player.checkpointA) && (Global.EditMode || First Of(Event Player.checkpointB)) ? Event Player : Null,
			Ring, Event Player.checkpointA[5] ? Global.Config[10] : First Of(Global.Config), First Of(Event Player.checkpointA),
			Event Player.checkpointA[1], Visible To Position Radius and Color);
		Create Icon((First Of(Event Player.checkpointA[3]) && Event Player.editMode != 2 && !Event Player.nearestOrb)
			|| Event Player.nearestOrb[1] ? Event Player : Null, Is Alive(Event Player.targetBot) ? Event Player.targetBot : Position Of(
			Event Player.targetBot) + Vector(0, 2, 0), Arrow: Down, Visible To Position and Color,
			Event Player.checkpointA[2] && !Event Player.nearestOrb[1] ? Global.Config[1] : Color(Red), True);
		Create In-World Text(First Of(Event Player.checkpointB) ? Event Player : Null, Global.Config[2], First Of(Event Player.checkpointB)
			+ Vector(0, 0.200, 0), Global.Config[3], Do Not Clip, Visible To Position and String, Global.Config[4], Default Visibility);
		Create Icon(First Of(Event Player.checkpointB) ? Event Player : Null, First Of(Event Player.checkpointB) + Vector(0, 1.300, 0),
			Flag, Visible To and Position, Global.Config[5], True);
		Create Effect(First Of(Event Player.checkpointB) ? Event Player : Null, Ring,
			Event Player.checkpointB[5] ? Global.Config[10] : Global.Config[7], First Of(Event Player.checkpointB),
			Event Player.checkpointB[1], Visible To Position Radius and Color);
		If(Global.Config[8] == 0);
			Create Effect(First Of(Event Player.checkpointB) ? Event Player : Null, Light Shaft,
				Event Player.checkpointB[5] ? Global.Config[9] : Global.Config[6], First Of(Event Player.checkpointB),
				Event Player.checkpointB[1], Visible To Position Radius and Color);
		Else If(Global.Config[8] == 1);
			Create Effect(First Of(Event Player.checkpointB) ? Event Player : Null, Sparkles,
				Event Player.checkpointB[5] ? Global.Config[9] : Global.Config[6], First Of(Event Player.checkpointB),
				Event Player.checkpointB[1], Visible To Position Radius and Color);
		Else If(Global.Config[8] == 2);
			Create Effect(First Of(Event Player.checkpointB) ? Event Player : Null, Cloud,
				Event Player.checkpointB[5] ? Global.Config[9] : Global.Config[6], First Of(Event Player.checkpointB),
				Event Player.checkpointB[1], Visible To Position Radius and Color);
		Else;
			Create Effect(First Of(Event Player.checkpointB) ? Event Player : Null, Bad Aura,
				Event Player.checkpointB[5] ? Global.Config[9] : Global.Config[6], First Of(Event Player.checkpointB),
				Event Player.checkpointB[1], Visible To Position Radius and Color);
		End;
		If(!Global.EditMode);
			Create HUD Text(Event Player.bestRecord && Index Of Array Value(Global.Top5, Event Player.playerNickname) < 0 ? All Players(
				All Teams) : Null, Hero Icon String(Hero(Mercy)), Event Player.playerNickname, Custom String("{0} sec",
				Event Player.bestRecord), Left, Event Player.bestRecord / 100, Global.Config[28], Global.Config[28], Global.Config[28],
				Visible To Sort Order and String, Default Visibility);
			Create HUD Text(Event Player, Null, Custom String("Previous Segment: {0} {1}",
				Event Player.checkpoint ? Event Player.segmentTimeArray[Event Player.checkpoint - 1] : Custom String("N/A"),
				Event Player.checkpoint && Event Player.personalBestArray ? Custom String("({0})",
				Event Player.segmentVsPersonalBestArray[Event Player.checkpoint - 1]) : Custom String("")), Null, Right, 1, Null,
				Event Player.checkpoint && Event Player.personalBestArray ? (
				Event Player.segmentTimeArray[Event Player.checkpoint - 1] <= Event Player.bestSegmentsArray[Event Player.checkpoint - 1] ? Custom Color(
				255, 215, 0, 255) : (
				Event Player.segmentTimeArray[Event Player.checkpoint - 1] <= Event Player.personalBestArray[Event Player.checkpoint - 1] ? Color(
				Green) : Color(Red))) : Color(Green), Null, Visible To String and Color, Default Visibility);
			Create HUD Text(Event Player, Null, Event Player.checkpoint && Event Player.personalBestArray ? Custom String(
				"Running Total vs pb: {0}", Event Player.vsPersonalBestRunningTally) : Custom String(""), Null, Right, 1, Null,
				Event Player.vsPersonalBestRunningTally <= 0 ? Color(Green) : Color(Red), Null, Visible To String and Color,
				Default Visibility);
			Create HUD Text(Event Player, Null, Event Player.personalBestArray ? Custom String("Sum of Best: {0}",
				Event Player.sumOfBestSegments) : Custom String(""), Null, Right, 1, Null, Custom Color(150, 230, 210, 255), Null,
				Visible To and String, Default Visibility);
			Create HUD Text(
				Global.Tips[Event Player.displayedCheckpoint] && !Event Player.freeMode && !Event Player.finished ? Event Player : Null,
				Custom String("{0} : {1}", Hero Icon String(Hero(Mercy)), Global.Tips[Event Player.displayedCheckpoint]), Null, Null, Top, 100,
				Color(Turquoise), Null, Null, Visible To and String, Default Visibility);
			Create HUD Text(Event Player, Null, Null, Custom String("Mistakes: {0} Times\nTime: {1} Seconds",
				Event Player.cheat ? Custom String("∞") : Event Player.mistake, Event Player.cheat ? Custom String("∞") : Event Player.time),
				Right, 0, Null, Null, Color(White), Visible To and String, Default Visibility);
		End;
	}
}

rule("Subroutine TeleportToCurrentCheckoint (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Subroutine;
		TeleportToCurrentCheckoint;
	}

	actions
	{
		Call Subroutine(CancelAbilityAndMomentum);
		Event Player.mistake += Event Player.checkpoint != 0 && !Event Player.freeMode && Distance Between(Event Player, First Of(
			Event Player.checkpointA)) > Event Player.checkpointA[1] ? 1 : 0;
		Teleport(Event Player, First Of(Event Player.checkpointA));
		Set Status(Event Player, Null, Rooted, 0.250);
		Call Subroutine(SetCurrentAbilities);
		If(Event Player.currentOrb);
			Call Subroutine(TeleportCurrentBot);
		End;
	}
}

rule("Subroutine ContinueTiming (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Subroutine;
		ContinueTiming;
	}

	actions
	{
		If(
			!Global.EditMode && !Event Player.finished && !Event Player.freeMode && !Event Player.cheat && Event Player.leaveOriginalCheckpoint);
			Chase Player Variable At Rate(Event Player, time, 16200, 1, None);
		End;
	}
}

rule("Subroutine GetCurrentCheckpoint (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Subroutine;
		GetCurrentCheckpoint;
	}

	actions
	{
		Event Player.checkpointA = Global.Checkpoint[Event Player.checkpoint] ? Global.Checkpoint[Event Player.checkpoint] : Null;
		Event Player.checkpointB = Global.Checkpoint[Event Player.checkpoint + 1] ? Global.Checkpoint[Event Player.checkpoint + 1] : Null;
		Event Player.displayedCheckpoint = Event Player.checkpoint - Count Of(Filtered Array(Global.Checkpoint,
			Current Array Index <= Event Player.checkpoint && Current Array Element[5]));
		Event Player.numberOfNeedResurrect = (Event Player.checkpointA[3][1] ? 1 : 0) + Count Of(Filtered Array(
			Event Player.checkpointA[6], Current Array Element[2] && Current Array Element[1]));
		Event Player.currentOrb = Event Player.checkpointA[6];
		Event Player.tempCurrentOrb = Event Player.currentOrb;
		Event Player.currentSphere = Event Player.checkpointA[7];
		Event Player.currentCloud = Event Player.checkpointA[8];
	}
}

rule("Subroutine  SetCurrentAbilities (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Subroutine;
		SetCurrentAbilities;
	}

	actions
	{
		Set Crouch Enabled(Event Player, Event Player.checkpointA[2]);
		"eventPlayer.setAbility1Enabled(true if eventPlayer.checkpointA[3][0] else false)"
		Set Ability 1 Enabled(Event Player, True);
		Set Ability 2 Enabled(Event Player, False);
		If(Event Player.checkpointA[3][1]);
			Kill(Event Player.targetBot, Null);
		Else;
			Resurrect(Event Player.targetBot);
			Heal(Event Player.targetBot, Null, 1000);
		End;
		Event Player.ability2 = False;
		Event Player.resurrectNumber = 0;
		Event Player.tempCurrentOrb = Event Player.currentOrb;
		Event Player.nearestOrb = Null;
		Event Player.isSetAbilities = True;
	}
}

rule("Subroutine TeleportCurrentBot (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Subroutine;
		TeleportCurrentBot;
	}

	actions
	{
		Teleport(Event Player.targetBot, First Of(Event Player.checkpointA[3]) ? First Of(Event Player.checkpointA[3])
			: Global.Config[60]);
		Start Forcing Player Outlines(Event Player.targetBot, Event Player, True, First Of(Event Player.checkpointA[3]) ? (
			Event Player.checkpointA[2] ? Global.Config[1] : Color(Red)) : Null, Always);
	}
}

rule("Subroutine  DisplayCurrentAbilityMsgs (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Subroutine;
		DisplayCurrentAbilityMsgs;
	}

	actions
	{
		Abort If(Event Player.checkpointA[5] || !Event Player.checkpointB);
		If(Count Of(Event Player.currentOrb) > 0);
			Small Message(Event Player, Global.Config[20] ? Global.Config[20] : Custom String("This level has {0} orb to get", Count Of(
				Event Player.currentOrb)));
		End;
		If(!First Of(Event Player.checkpointA[3]));
			Small Message(Event Player, Global.Config[19]);
		Else;
			If(Count Of(Filtered Array(Global.Checkpoint, Current Array Element[2])) >= Count Of(Filtered Array(Global.Checkpoint,
				!Current Array Element[2])) && !Event Player.checkpointA[2]);
				Small Message(Event Player, Global.Config[17]);
			Else If(Count Of(Filtered Array(Global.Checkpoint, Current Array Element[2])) < Count Of(Filtered Array(Global.Checkpoint,
					!Current Array Element[2])) && Event Player.checkpointA[2]);
				Small Message(Event Player, Global.Config[18]);
			End;
			If(Event Player.checkpointA[4]);
				Small Message(Event Player, Global.Config[29]);
			Else If(Count Of(Filtered Array(Global.Checkpoint, Current Array Element[4])) >= Count Of(Filtered Array(Global.Checkpoint,
					!Current Array Element[4])) && !Event Player.checkpointA[4]);
				Small Message(Event Player, Global.Config[30]);
			End;
		End;
	}
}

rule("Subroutine  CreateCurrentEffects (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Subroutine;
		CreateCurrentEffects;
	}

	actions
	{
		Destroy Effect(Event Player.orbEffects);
		Destroy Effect(Event Player.botEffects);
		Event Player.orbEffects = Empty Array;
		Event Player.botEffects = Empty Array;
		While(Count Of(Event Player.orbIcons) > 0);
			Destroy Icon(First Of(Event Player.orbIcons));
			Modify Player Variable(Event Player, orbIcons, Remove From Array By Index, 0);
			Destroy Icon(First Of(Event Player.botIcons));
			Modify Player Variable(Event Player, botIcons, Remove From Array By Index, 0);
		End;
		Destroy Effect(Event Player.sphereEffects);
		Event Player.sphereEffects = Empty Array;
		Destroy Effect(Event Player.cloudEffects);
		Event Player.cloudEffects = Empty Array;
		If(Global.EditMode && Event Player == Host Player);
			Global.CurrentChooseOrb = 0;
			Global.ChooseOrbPosition = First Of(Event Player.currentOrb[Global.CurrentChooseOrb]);
			Global.CurrentChooseSphere = 0;
			Global.ChooseSpherePosition = First Of(Event Player.currentSphere[Global.CurrentChooseSphere]);
			Global.CurrentChooseCloud = 0;
			Global.ChooseCloudPosition = First Of(Event Player.currentCloud[Global.CurrentChooseCloud]);
		End;
		For Player Variable(Event Player, i, 0, Count Of(Event Player.currentOrb), 1);
			If(Event Player.currentOrb[Event Player.i][1]);
				Create Icon(Is True For Any(Event Player.tempCurrentOrb, First Of(Current Array Element) == Evaluate Once(First Of(
					Event Player.currentOrb[Event Player.i]))) || Event Player.finished || Event Player.freeMode ? Event Player : Null,
					Event Player.currentOrb[Event Player.i][1] + Vector(0, 2, 0), Arrow: Down, Visible To,
					Event Player.currentOrb[Event Player.i][2] ? Global.Config[49] : Global.Config[46], True);
				Event Player.botIcons[Event Player.i] = Last Created Entity;
				Create Effect(Is True For Any(Event Player.tempCurrentOrb, First Of(Current Array Element) == Evaluate Once(First Of(
					Event Player.currentOrb[Event Player.i]))) || Event Player.finished || Event Player.freeMode ? Event Player : Null, Good Aura,
					Event Player.currentOrb[Event Player.i][2] ? Global.Config[50] : Global.Config[47],
					Event Player.currentOrb[Event Player.i][1] + Vector(0, 0.800, 0), 1, Visible To);
				Event Player.botEffects[Event Player.i] = Last Created Entity;
				Create Icon(Is True For Any(Event Player.tempCurrentOrb, First Of(Current Array Element) == Evaluate Once(First Of(
					Event Player.currentOrb[Event Player.i]))) || Event Player.finished || Event Player.freeMode ? Event Player : Null, First Of(
					Event Player.currentOrb[Event Player.i]) + Vector(0, 0.500, 0), Recycle, Visible To,
					Event Player.currentOrb[Event Player.i][2] ? Global.Config[48] : Global.Config[45], True);
			Else;
				Create Icon(Is True For Any(Event Player.tempCurrentOrb, First Of(Current Array Element) == Evaluate Once(First Of(
					Event Player.currentOrb[Event Player.i]))) || Event Player.finished || Event Player.freeMode ? Event Player : Null, First Of(
					Event Player.currentOrb[Event Player.i]) + Vector(0, 0.500, 0), Skull, Visible To, Global.Config[43], True);
			End;
			Event Player.orbIcons[Event Player.i] = Last Created Entity;
			Create Effect(Is True For Any(Event Player.tempCurrentOrb, First Of(Current Array Element) == Evaluate Once(First Of(
				Event Player.currentOrb[Event Player.i]))) || Event Player.finished || Event Player.freeMode ? Event Player : Null, Orb,
				Event Player.currentOrb[Event Player.i][1] ? Global.Config[44] : Global.Config[42], First Of(
				Event Player.currentOrb[Event Player.i]), 1, Visible To);
			Event Player.orbEffects[Event Player.i] = Last Created Entity;
		End;
		For Player Variable(Event Player, i, 0, Count Of(Event Player.currentSphere), 1);
			Create Effect(Event Player, Sphere, Global.Config[40], First Of(Event Player.currentSphere[Event Player.i]),
				Event Player.currentSphere[Event Player.i][1], Visible To);
			Event Player.sphereEffects[Event Player.i] = Last Created Entity;
		End;
		For Player Variable(Event Player, i, 0, Count Of(Event Player.currentCloud), 1);
			Create Effect(Event Player, Cloud, Global.Config[41], First Of(Event Player.currentCloud[Event Player.i]), 1, Visible To);
			Event Player.cloudEffects[Event Player.i] = Last Created Entity;
		End;
	}
}

rule("Subroutine CreateCurrentWorldText (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Subroutine;
		CreateCurrentWorldText;
	}

	actions
	{
		Destroy In-World Text(Event Player.currentWorldText);
		If(Global.WorldTexts[Event Player.displayedCheckpoint] && !Event Player.checkpointA[5]);
			Create In-World Text(Event Player, First Of(Global.WorldTexts[Event Player.displayedCheckpoint]),
				Global.WorldTexts[Event Player.displayedCheckpoint][1] ? Global.WorldTexts[Event Player.displayedCheckpoint][1] : First Of(
				Event Player.checkpointB) + Vector(0, 1.800, 0), Global.WorldTexts[Event Player.displayedCheckpoint][2], Do Not Clip,
				Visible To, Global.WorldTexts[Event Player.displayedCheckpoint][3], Default Visibility);
			Event Player.currentWorldText = Last Text ID;
		End;
	}
}

rule("Subroutine DisplayCurrentCustomBigMsgs (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Subroutine;
		DisplayCurrentCustomBigMsgs;
	}

	actions
	{
		If(Global.BigMessages[Event Player.displayedCheckpoint] && !Event Player.checkpointA[5]);
			Event Player.currentBigMessage = Filtered Array(Global.BigMessages[Event Player.displayedCheckpoint], Current Array Element);
			While(Count Of(Event Player.currentBigMessage) > 0);
				Wait(0.500, Ignore Condition);
				Big Message(Event Player, First Of(Event Player.currentBigMessage));
				Wait(2.300, Ignore Condition);
				Modify Player Variable(Event Player, currentBigMessage, Remove From Array By Index, 0);
			End;
		End;
	}
}

rule("Subroutine DisplayCurrentCustomSmallMsgs (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Subroutine;
		DisplayCurrentCustomSmallMsgs;
	}

	actions
	{
		If(Global.SmallMessages[Event Player.displayedCheckpoint] && !Event Player.checkpointA[5]);
			Event Player.currentSmallMessage = Filtered Array(Global.SmallMessages[Event Player.displayedCheckpoint], Current Array Element);
			While(Count Of(Event Player.currentSmallMessage) > 0);
				Wait(0.500, Ignore Condition);
				Small Message(Event Player, First Of(Event Player.currentSmallMessage));
				Wait(2.300, Ignore Condition);
				Modify Player Variable(Event Player, currentSmallMessage, Remove From Array By Index, 0);
			End;
		End;
	}
}

rule("Subroutine EnableAllAbilities (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Subroutine;
		EnableAllAbilities;
	}

	actions
	{
		Set Crouch Enabled(Event Player, True);
		Set Ability 1 Enabled(Event Player, True);
		Set Ability 2 Enabled(Event Player, False);
		Set Ultimate Ability Enabled(Event Player, False);
		Set Ultimate Charge(Event Player, 100);
	}
}

rule("Subroutine  CancelAbilityAndMomentum (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Subroutine;
		CancelAbilityAndMomentum;
	}

	actions
	{
		Cancel Primary Action(Event Player);
		Apply Impulse(Event Player, Up, 0, To World, Cancel Contrary Motion XYZ);
		Wait(0.016, Restart When True);
		Apply Impulse(Event Player, Normalize(Velocity Of(Event Player)) * -1, Speed Of(Event Player), To World,
			Incorporate Contrary Motion);
	}
}

rule("Subroutine ValidationPlayerData (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Subroutine;
		ValidationPlayerData;
	}

	actions
	{
		If(Index Of Array Value(Global.PlayersData, Custom String("{0}", Event Player)) > -1);
			Event Player.checkpoint = First Of(Filtered Array(Global.PlayersData, First Of(Current Array Element) == Custom String("{0}",
				Event Player)))[1];
			Event Player.time = First Of(Filtered Array(Global.PlayersData, First Of(Current Array Element) == Custom String("{0}",
				Event Player)))[2];
			Event Player.mistake = First Of(Filtered Array(Global.PlayersData, First Of(Current Array Element) == Custom String("{0}",
				Event Player)))[3];
			Small Message(Event Player, Custom String("Welcome back, {0}", Event Player.playerNickname));
		Else;
			Global.PlayersData[Count Of(Global.PlayersData)] = Array(Custom String("{0}", Event Player), Event Player.checkpoint,
				Event Player.time, Event Player.mistake);
		End;
		Event Player.dataIndex = Index Of Array Value(Global.PlayersData, Custom String("{0}", Event Player)) / 4;
	}
}

rule("Subroutine EditPlayerData (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Subroutine;
		EditPlayerData;
	}

	actions
	{
		Global.PlayersData[Event Player.dataIndex] = Event Player.checkpoint < Count Of(Global.Checkpoint) - 1 ? Array(Custom String("{0}",
			Event Player), Event Player.checkpoint, Event Player.time, Event Player.mistake) : Array(Custom String("{0}", Event Player), 0,
			0, 0);
	}
}

rule("Subroutine TempSavePlayerData (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Subroutine;
		TempSavePlayerData;
	}

	actions
	{
		If(!Global.EditMode);
			If(!Event Player.cheat);
				Stop Chasing Player Variable(Event Player, time);
				Call Subroutine(EditPlayerData);
				Event Player.playerData = Filtered Array(Global.PlayersData[Event Player.dataIndex], Current Array Index != 0);
				Modify Player Variable(Event Player, playerData, Append To Array, Event Player.displayedCheckpoint);
				If(!Event Player.finished);
					Small Message(Event Player, Custom String("Timer paused, Return to the level {0} again to continue timing >_<",
						Event Player.playerData[3]));
					Big Message(Event Player, Custom String("\"Need Help\", Return to level {0}", Event Player.playerData[3]));
				End;
			End;
			If(Event Player.finished);
				Event Player.bodySize = 1;
				Start Forcing Player To Be Hero(Event Player, Hero(Widowmaker));
				Call Subroutine(CreatePlayerTargetBot);
			End;
		End;
	}
}

rule("Subroutine ChooseCheckpoint (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Subroutine;
		ChooseCheckpoint;
	}

	actions
	{
		If(Is Button Held(Event Player, Button(Primary Fire)));
			Event Player.checkpoint += Event Player.checkpoint == Count Of(Global.Checkpoint) - 1 ? 1 - Count Of(Global.Checkpoint) : 1;
		Else;
			Event Player.checkpoint -= Event Player.checkpoint == 0 ? 1 - Count Of(Global.Checkpoint) : 1;
		End;
	}
}

rule("Subroutine SkipOrBackCheckpoint (Originally from peace's mercy parkour editor: T6QQT)")
{
	event
	{
		Subroutine;
		SkipOrBackCheckpoint;
	}

	actions
	{
		If(!Global.EditMode);
			If(Event Player.checkpoint == First Of(Event Player.playerData));
				Event Player.cheat = False;
				Event Player.leaveOriginalCheckpoint = False;
				Event Player.time = Event Player.playerData[1];
				Event Player.mistake = Event Player.playerData[2];
				If(Event Player.checkpoint != 0 || Event Player.playerData[3] == 0);
					Small Message(Event Player, Custom String("You have returned to level {0}, Leave the checkpoint and continue timing!",
						Event Player.playerData[3]));
				End;
			Else;
				Event Player.cheat = True;
			End;
		End;
		Teleport(Event Player, First Of(Global.Checkpoint[Event Player.checkpoint]));
		Call Subroutine(GetCurrentCheckpoint);
		If(!Event Player.freeMode);
			Call Subroutine(SetCurrentAbilities);
		End;
		Call Subroutine(KillOrResurrectBot);
		Start Rule(CreateCurrentEffects, Restart Rule);
		Call Subroutine(CreateCurrentWorldText);
		If(!Global.EditMode && Event Player.checkpoint == Count Of(Global.Checkpoint) - 1);
			Destroy Dummy Bot(Team Of(Event Player), Slot Of(Event Player) + Number Of Slots(All Teams));
		End;
	}
}

rule("Subroutine  PlayDestroyMapEffect -- by Mazattack#1183")
{
	event
	{
		Subroutine;
		PlayDestroyMapEffect;
	}

	actions
	{
		If(Current Map == Map(Watchpoint: Gibraltar));
			Set Match Time(48 + Random Integer(Horizontal Angle From Direction(Direction Towards(Objective Position(1), Objective Position(0)))
				/ 7.500 - 12, Horizontal Angle From Direction(Direction Towards(Objective Position(1), Objective Position(0))) / 7.500 + -6));
		Else If(Current Map == Map(Route 66));
			Set Match Time(48 + Random Integer(Horizontal Angle From Direction(Direction Towards(Objective Position(1), Objective Position(0)))
				/ 7.500 - -6, Horizontal Angle From Direction(Direction Towards(Objective Position(1), Objective Position(0))) / 7.500 + 12));
		Else;
			Set Match Time(48 + Random Integer(Horizontal Angle From Direction(Direction Towards(Objective Position(1), Objective Position(0)))
				/ 7.500 - 6, Horizontal Angle From Direction(Direction Towards(Objective Position(1), Objective Position(0))) / 7.500 + 9));
		End;
		Global.Chase = (Nearest Walkable Position(Vector(999, 999, 999)) + Nearest Walkable Position(Vector(-999, -999, -999)))
			/ 2 + Direction From Angles(Random Integer(0, 359), Random Real(-45, -60)) * 500;
		Wait(0.016, Ignore Condition);
		Chase Global Variable Over Time(Chase, (Nearest Walkable Position(Vector(999, 999, 999)) + Nearest Walkable Position(Vector(-999,
			-999, -999))) / 2, 5, Destination and Duration);
		While(Distance Between(Global.Chase, (Nearest Walkable Position(Vector(999, 999, 999)) + Nearest Walkable Position(Vector(-999,
			-999, -999))) / 2) > 1);
			Play Effect(All Players(All Teams), Good Explosion, Color(Sky Blue), Global.Chase, 3);
			Wait(0.016, Ignore Condition);
		End;
		For Global Variable(I, 0, 400, 1);
			Play Effect(All Players(All Teams), Bad Explosion, Color(Orange), (Nearest Walkable Position(Vector(999, 999, 999))
				+ Nearest Walkable Position(Vector(-999, -999, -999))) / 2 + Direction From Angles(Random Real(0, 360), 0) * Random Integer(0,
				Global.I + 1), Random Integer(Global.I / 5, Global.I));
			Play Effect(All Players(All Teams), Bad Explosion, Color(Orange), (Nearest Walkable Position(Vector(999, 999, 999))
				+ Nearest Walkable Position(Vector(-999, -999, -999))) / 2 + Direction From Angles(Random Real(0, 360), 0) * Random Integer(0,
				Global.I + 1), Global.I);
			Wait(0.016, Ignore Condition);
		End;
	}
}

rule("Redirect damage to attacker's bot (I made this *smile*)")
{
	event
	{
		Player Dealt Damage;
		All;
		All;
	}

	conditions
	{
		Is Dummy Bot(Event Player) == False;
	}

	actions
	{
		If(Victim != Event Player.targetBot);
			If(Is Dead(Victim));
				Resurrect(Victim);
				Heal(Victim, Null, 1000);
			Else;
				Heal(Victim, Null, Event Damage);
			End;
			If(Distance Between(Victim, Event Player.targetBot) <= 1);
				Damage(Event Player.targetBot, Event Player, Event Damage);
			Else;
				If(Event Damage >= 100);
					Small Message(Event Player, Custom String("you are shooting the wrong zen"));
				End;
			End;
		Else;
			If(!(Event Damage > 300));
				Event Player.recentDamage = Event Damage;
			End;
			If(Health(Event Player.targetBot) <= Max Health(Event Player.targetBot) - Event Player.editModeCharacterResetted);
				Kill(Event Player.targetBot, Event Player);
	}
}

rule("Prevent killing the bot from starting cp")
{
	event
	{
		Player Dealt Damage;
		All;
		All;
	}

	conditions
	{
		Is Dummy Bot(Event Player) == False;
		Distance Between(Event Player, First Of(Event Player.checkpointA)) < Event Player.checkpointA[1];
	}

	actions
	{
		If(Is Dead(Victim));
			Small Message(Event Player, Custom String("You can't kill zen from the starting CP."));
			Resurrect(Victim);
			Heal(Victim, Null, 1000);
		Else;
			Heal(Victim, Null, Event Damage);
	}
}

rule("Rule 102")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Is Alive(Event Player) == True;
		Event Player.checkpoint == Count Of(Global.Checkpoint) - 1;
		Global.EditMode == False;
	}

	actions
	{
		Event Player.segmentTimeString = Custom String("This Run Segments:");
		For Player Variable(Event Player, segmentTimeArrayCounter, 0, Count Of(Event Player.segmentTimeArray), 1);
			Event Player.segmentTimeString = Custom String("{0}\r\nCheckpoint {1}: {2}", Event Player.segmentTimeString,
				Event Player.segmentTimeArrayCounter, Event Player.segmentTimeArray[Event Player.segmentTimeArrayCounter]);
		End;
		Event Player.segmentTimeString = Custom String("{0}\r\nTotal Time: {1}", Event Player.segmentTimeString, Event Player.time);
		If(Event Player.time <= Event Player.bestRecord);
			If(Event Player.time <= Global.FirstPlaceTime);
				Global.FirstPlaceTimeString = Custom String("1ST Place Segments:");
				For Player Variable(Event Player, segmentTimeArrayCounter, 0, Count Of(Event Player.segmentTimeArray), 1);
					Global.FirstPlaceTimeString = Custom String("{0}\r\nCheckpoint {1}: {2}", Global.FirstPlaceTimeString,
						Event Player.segmentTimeArrayCounter, Global.FirstPlaceTimeArray[Event Player.segmentTimeArrayCounter]);
				End;
				Global.FirstPlaceTimeString = Custom String("{0}\nTotal Time: {1}", Global.FirstPlaceTimeString, Global.FirstPlaceTime);
			End;
			Event Player.personalBestString = Custom String("Personal Best Segments:");
			For Player Variable(Event Player, segmentTimeArrayCounter, 0, Count Of(Event Player.segmentTimeArray), 1);
				Event Player.personalBestString = Custom String("{0}\r\nCheckpoint {1}: {2}", Event Player.personalBestString,
					Event Player.segmentTimeArrayCounter, Event Player.personalBestArray[Event Player.segmentTimeArrayCounter]);
			End;
			Event Player.personalBestString = Custom String("{0}\r\nTotal Time: {1}", Event Player.personalBestString, Event Player.time);
		End;
		"wait(5)"
		If(!Event Player.bestSegmentsArrayString);
			Event Player.bestSegmentsArrayString = Custom String("Best Segments (Across Your Runs):");
			For Player Variable(Event Player, segmentTimeArrayCounter, 0, Count Of(Event Player.segmentTimeArray), 1);
				Event Player.bestSegmentsArrayString = Custom String("{0}\r\nCheckpoint {1}: {2}", Event Player.bestSegmentsArrayString,
					Event Player.segmentTimeArrayCounter, Event Player.bestSegmentsArray[Event Player.segmentTimeArrayCounter]);
			End;
			Event Player.bestSegmentsArrayString = Custom String("{0}\r\nTotal Time: {1}", Event Player.bestSegmentsArrayString,
				Event Player.personalBestArray ? Event Player.sumOfBestSegments : Custom String("N/A"));
	}
}

rule("changing hero (hit need healing comms button) - ty to felicity for the code for this rule")
{
	event
	{
		Ongoing - Each Player;
		Team 1;
		All;
	}

	conditions
	{
		Is Communicating(Event Player, Need Healing) == True;
		Global.EditMode == True;
	}

	actions
	{
		Set Player Allowed Heroes(Event Player, Remove From Array(All Heroes, Hero Of(Event Player)));
		Wait(0.250, Ignore Condition);
		Event Player.editModeCharacterResetted = 1;
		Reset Player Hero Availability(Event Player);
	}
}

rule("position indicator on hud")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Global.EditMode == True;
		Event Player == Host Player;
	}

	actions
	{
		Create HUD Text(Event Player, Null, Custom String("{0} -> {1}", Position Of(Event Player), Ray Cast Hit Position(Eye Position(
			Event Player), Facing Direction Of(Event Player), All Players(All Teams), Event Player, True)), Null, Left, 0, Color(Red),
			Color(Red), Color(White), Visible To and String, Default Visibility);
	}
}
Leave a Comment