{
	"name": "ev_repair",
	"events": [
		{
			"eventType": "variable",
			"name": "repairSpeed",
			"type": "number",
			"initialValue": "100",
			"comment": "Per second",
			"isStatic": false,
			"isConstant": false,
			"sid": 592110588384774
		},
		{
			"eventType": "group",
			"disabled": false,
			"title": "Initialize",
			"description": "",
			"isActiveOnStart": true,
			"children": [
				{
					"eventType": "block",
					"conditions": [
						{
							"id": "on-start-of-layout",
							"objectClass": "System",
							"sid": 894610914742768
						}
					],
					"actions": [
						{
							"callFunction": "FadeIn",
							"sid": 838641564803455,
							"parameters": [
								"FADE_TIME"
							]
						},
						{
							"id": "set-layout-scale",
							"objectClass": "System",
							"sid": 189097394709820,
							"parameters": {
								"scale": "BASE_ZOOM"
							}
						},
						{
							"id": "set-eventvar-value",
							"objectClass": "System",
							"sid": 862048976541501,
							"parameters": {
								"variable": "zoomLevel",
								"value": "BASE_ZOOM"
							}
						},
						{
							"id": "set-position",
							"objectClass": "player_base",
							"sid": 566218539240408,
							"parameters": {
								"x": "playerSpawnLoc.X",
								"y": "playerSpawnLoc.Y"
							}
						},
						{
							"id": "move-to-layer",
							"objectClass": "player_anim",
							"sid": 325502509882809,
							"parameters": {
								"layer": "\"Player\""
							}
						},
						{
							"id": "destroy",
							"objectClass": "ship_col_1",
							"sid": 447550952054682
						},
						{
							"id": "set-eventvar-value",
							"objectClass": "System",
							"sid": 776606511801112,
							"parameters": {
								"variable": "curShipIndex",
								"value": "0"
							}
						}
					],
					"sid": 157000113480237,
					"children": [
						{
							"eventType": "block",
							"conditions": [
								{
									"id": "repeat",
									"objectClass": "System",
									"sid": 664665930045730,
									"parameters": {
										"count": "1000"
									}
								}
							],
							"actions": [
								{
									"id": "create-object",
									"objectClass": "System",
									"sid": 705438896456996,
									"parameters": {
										"object-to-create": "stars",
										"layer": "\"BG\"",
										"x": "random(0, LayoutWidth)",
										"y": "100"
									}
								},
								{
									"id": "set-animation-frame",
									"objectClass": "stars",
									"sid": 863892666068477,
									"parameters": {
										"frame-number": "floor(random(0, 7))"
									}
								},
								{
									"id": "set-z-elevation",
									"objectClass": "stars",
									"sid": 115956056316025,
									"parameters": {
										"z": "random(-50, 50)"
									}
								}
							],
							"sid": 761372694612184
						},
						{
							"eventType": "block",
							"conditions": [
								{
									"id": "compare-two-values",
									"objectClass": "System",
									"sid": 754576145278720,
									"parameters": {
										"first-value": "SysObj.Count",
										"comparison": 0,
										"second-value": "0"
									}
								}
							],
							"actions": [
								{
									"id": "create-object",
									"objectClass": "System",
									"sid": 114444102600851,
									"parameters": {
										"object-to-create": "SysObj",
										"layer": "\"BG\"",
										"x": "0",
										"y": "0"
									}
								},
								{
									"id": "set-visible",
									"objectClass": "SysObj",
									"sid": 251703940694505,
									"parameters": {
										"visibility": "invisible"
									}
								}
							],
							"sid": 203606924076507
						},
						{
							"eventType": "block",
							"conditions": [
								{
									"id": "compare-two-values",
									"objectClass": "System",
									"sid": 397337001299730,
									"parameters": {
										"first-value": "player_base.Count",
										"comparison": 0,
										"second-value": "0"
									}
								}
							],
							"actions": [
								{
									"id": "create-object",
									"objectClass": "System",
									"sid": 701869585622692,
									"parameters": {
										"object-to-create": "player_base",
										"layer": "\"Player\"",
										"x": "playerSpawnLoc.X",
										"y": "playerSpawnLoc.Y"
									}
								},
								{
									"id": "set-eventvar-value",
									"objectClass": "System",
									"sid": 591994900391367,
									"parameters": {
										"variable": "spaceLayoutGameplayState",
										"value": "GAME_STATE_PILOTING"
									}
								},
								{
									"id": "set-object-time-scale",
									"objectClass": "System",
									"sid": 457082343888529,
									"parameters": {
										"object": "SysObj",
										"time-scale": "1"
									}
								},
								{
									"id": "createPermutationTable",
									"objectClass": "AdvancedRandom",
									"sid": 665776975709320,
									"parameters": {
										"length": "NUM_SHIPS",
										"offset": "0"
									}
								},
								{
									"id": "destroy",
									"objectClass": "shipController",
									"sid": 106589949816154
								}
							],
							"sid": 727468435088492
						},
						{
							"eventType": "block",
							"conditions": [],
							"actions": [
								{
									"id": "create-object",
									"objectClass": "System",
									"sid": 319062976976940,
									"parameters": {
										"object-to-create": "shipController",
										"layer": "\"Ship\"",
										"x": "ship_spawn_loc.X",
										"y": "ship_spawn_loc.Y"
									}
								},
								{
									"id": "set-boolean-instvar",
									"objectClass": "shipController",
									"sid": 543430002035228,
									"parameters": {
										"instance-variable": "isActive",
										"value": "false"
									}
								},
								{
									"id": "set-instvar-value",
									"objectClass": "shipController",
									"sid": 782188385091267,
									"parameters": {
										"instance-variable": "id",
										"value": "AdvancedRandom.Permutation(curShipIndex)"
									}
								}
							],
							"sid": 464470911753029
						},
						{
							"eventType": "block",
							"conditions": [
								{
									"id": "compare-eventvar",
									"objectClass": "System",
									"sid": 546441704092299,
									"parameters": {
										"variable": "curShipIndex",
										"comparison": 0,
										"value": "0"
									}
								}
							],
							"actions": [
								{
									"id": "create-object",
									"objectClass": "System",
									"sid": 307461714004162,
									"parameters": {
										"object-to-create": "ship_col_1",
										"layer": "\"Ship\"",
										"x": "ship_spawn_loc.X - 140",
										"y": "ship_spawn_loc.Y - 174"
									}
								},
								{
									"id": "set-position-to-another-object",
									"objectClass": "ship_BG2_1",
									"sid": 745170848446417,
									"parameters": {
										"object": "ship_col_1",
										"image-point-optional": "0"
									}
								},
								{
									"id": "set-position-to-another-object",
									"objectClass": "ship_BG_1",
									"sid": 237064160123355,
									"parameters": {
										"object": "ship_col_1",
										"image-point-optional": "0"
									}
								},
								{
									"id": "set-position-to-another-object",
									"objectClass": "ship_jumpthru_1",
									"sid": 641673082592039,
									"parameters": {
										"object": "ship_col_1",
										"image-point-optional": "0"
									}
								},
								{
									"id": "set-position",
									"objectClass": "ship_entire_collider_1",
									"sid": 166722207206325,
									"parameters": {
										"x": "ship_col_1.X + 145",
										"y": "ship_col_1.Y + 92"
									}
								},
								{
									"id": "set-visible",
									"objectClass": "ship_entire_collider_1",
									"sid": 823619501902178,
									"parameters": {
										"visibility": "invisible"
									}
								},
								{
									"id": "pin-to-object",
									"objectClass": "ship_BG2_1",
									"sid": 388940488220492,
									"behaviorType": "Pin",
									"parameters": {
										"pin-to": "ship_col_1",
										"mode": "position-angle"
									}
								},
								{
									"id": "pin-to-object",
									"objectClass": "ship_BG_1",
									"sid": 901579485279095,
									"behaviorType": "Pin",
									"parameters": {
										"pin-to": "ship_col_1",
										"mode": "position-angle"
									}
								},
								{
									"id": "pin-to-object",
									"objectClass": "ship_jumpthru_1",
									"sid": 795003001078129,
									"behaviorType": "Pin",
									"parameters": {
										"pin-to": "ship_col_1",
										"mode": "position-angle"
									}
								},
								{
									"id": "pin-to-object",
									"objectClass": "ship_entire_collider_1",
									"sid": 702831136814509,
									"behaviorType": "Pin",
									"parameters": {
										"pin-to": "ship_col_1",
										"mode": "position-angle"
									}
								},
								{
									"id": "move-to-top",
									"objectClass": "ship_BG_1",
									"sid": 522695551370197
								},
								{
									"id": "move-to-top",
									"objectClass": "ship_BG2_1",
									"sid": 810415405059819
								},
								{
									"id": "move-to-top",
									"objectClass": "ship_col_1",
									"sid": 595358374426757
								},
								{
									"id": "move-to-top",
									"objectClass": "ship_jumpthru_1",
									"sid": 213294535294315
								}
							],
							"sid": 827298589290553
						},
						{
							"eventType": "block",
							"conditions": [
								{
									"id": "compare-eventvar",
									"objectClass": "System",
									"sid": 682878037933349,
									"parameters": {
										"variable": "curShipIndex",
										"comparison": 0,
										"value": "1"
									}
								}
							],
							"actions": [],
							"sid": 273267111079205
						},
						{
							"eventType": "block",
							"conditions": [
								{
									"id": "compare-eventvar",
									"objectClass": "System",
									"sid": 793502130115771,
									"parameters": {
										"variable": "curShipIndex",
										"comparison": 0,
										"value": "2"
									}
								}
							],
							"actions": [],
							"sid": 109536814236352
						},
						{
							"eventType": "block",
							"conditions": [
								{
									"id": "compare-eventvar",
									"objectClass": "System",
									"sid": 878232750641463,
									"parameters": {
										"variable": "curShipIndex",
										"comparison": 0,
										"value": "3"
									}
								}
							],
							"actions": [],
							"sid": 284227909429757
						},
						{
							"eventType": "block",
							"conditions": [
								{
									"id": "compare-eventvar",
									"objectClass": "System",
									"sid": 364904674056132,
									"parameters": {
										"variable": "curShipIndex",
										"comparison": 0,
										"value": "4"
									}
								}
							],
							"actions": [],
							"sid": 645447364910916
						},
						{
							"eventType": "block",
							"conditions": [
								{
									"id": "compare-eventvar",
									"objectClass": "System",
									"sid": 169931613176056,
									"parameters": {
										"variable": "curShipIndex",
										"comparison": 0,
										"value": "5"
									}
								}
							],
							"actions": [],
							"sid": 472400676183366
						},
						{
							"eventType": "block",
							"conditions": [],
							"actions": [
								{
									"id": "add-to-eventvar",
									"objectClass": "System",
									"sid": 906245839864847,
									"parameters": {
										"variable": "curShipIndex",
										"value": "1"
									}
								}
							],
							"sid": 962630491649591
						}
					]
				},
				{
					"eventType": "block",
					"conditions": [
						{
							"id": "on-created",
							"objectClass": "repairProgressBar",
							"sid": 390946925160620
						}
					],
					"actions": [
						{
							"id": "set-effect-enabled",
							"objectClass": "repairProgressBar",
							"sid": 283351773701323,
							"parameters": {
								"mode": "disable",
								"effect": "\"BlackWhite\""
							}
						}
					],
					"sid": 760160876500305
				}
			],
			"sid": 194434902478915
		},
		{
			"eventType": "group",
			"disabled": false,
			"title": "Flight controller to ship wheel",
			"description": "",
			"isActiveOnStart": true,
			"children": [
				{
					"eventType": "comment",
					"text": "Find the ship wheel"
				},
				{
					"eventType": "block",
					"conditions": [
						{
							"id": "trigger-once-while-true",
							"objectClass": "System",
							"sid": 874524486552638
						}
					],
					"actions": [],
					"sid": 418248498983162,
					"children": [
						{
							"eventType": "block",
							"conditions": [
								{
									"id": "for",
									"objectClass": "System",
									"sid": 756206675851002,
									"parameters": {
										"name": "\"tileX\"",
										"start-index": "0",
										"end-index": "200"
									}
								}
							],
							"actions": [],
							"sid": 285624085057103,
							"children": [
								{
									"eventType": "block",
									"conditions": [
										{
											"id": "for",
											"objectClass": "System",
											"sid": 531895791356302,
											"parameters": {
												"name": "\"tileY\"",
												"start-index": "0",
												"end-index": "500"
											}
										}
									],
									"actions": [],
									"sid": 730620559353208,
									"children": [
										{
											"eventType": "block",
											"conditions": [
												{
													"id": "compare-tile-at",
													"objectClass": "ship_BG2_1",
													"sid": 585379494524067,
													"parameters": {
														"tile-x": "loopindex(\"tileX\")",
														"tile-y": "loopindex(\"tileY\")",
														"comparison": 0,
														"tile": "332"
													}
												}
											],
											"actions": [
												{
													"id": "set-collisions-enabled",
													"objectClass": "shipController",
													"sid": 877054843205931,
													"parameters": {
														"collisions": "disabled"
													}
												},
												{
													"id": "set-position",
													"objectClass": "shipController",
													"sid": 540914217441415,
													"parameters": {
														"x": "ship_BG2_1.TileToPositionX(loopindex(\"tileX\")) + 8",
														"y": "ship_BG2_1.TileToPositionY(loopindex(\"tileY\")) + 8"
													}
												},
												{
													"id": "pin-to-object",
													"objectClass": "ship_col_1",
													"sid": 650575789412710,
													"behaviorType": "Pin",
													"parameters": {
														"pin-to": "shipController",
														"mode": "position-only"
													}
												},
												{
													"id": "set-collisions-enabled",
													"objectClass": "shipController",
													"sid": 628351080862642,
													"parameters": {
														"collisions": "enabled"
													}
												},
												{
													"id": "create-object",
													"objectClass": "System",
													"sid": 276299484720602,
													"parameters": {
														"object-to-create": "wheelHighlight",
														"layer": "\"Player\"",
														"x": "ship_BG2_1.TileToPositionX(loopindex(\"tileX\")) + 4",
														"y": "ship_BG2_1.TileToPositionY(loopindex(\"tileY\")) + 1"
													}
												},
												{
													"id": "pin-to-object",
													"objectClass": "wheelHighlight",
													"sid": 759874870642038,
													"behaviorType": "Pin",
													"parameters": {
														"pin-to": "ship_col_1",
														"mode": "position-angle"
													}
												},
												{
													"id": "set-visible",
													"objectClass": "wheelHighlight",
													"sid": 343301718958663,
													"parameters": {
														"visibility": "invisible"
													}
												},
												{
													"id": "stop-loop",
													"objectClass": "System",
													"sid": 866178194814743
												}
											],
											"sid": 258651065942892
										}
									]
								}
							]
						}
					]
				},
				{
					"eventType": "comment",
					"text": "Find the repair objs"
				},
				{
					"eventType": "block",
					"conditions": [
						{
							"id": "trigger-once-while-true",
							"objectClass": "System",
							"sid": 340395911010313
						}
					],
					"actions": [],
					"sid": 964974362556390,
					"children": [
						{
							"eventType": "variable",
							"name": "repairCount",
							"type": "number",
							"initialValue": "0",
							"comment": "",
							"isStatic": false,
							"isConstant": false,
							"sid": 337381962312724
						},
						{
							"eventType": "block",
							"conditions": [
								{
									"id": "for",
									"objectClass": "System",
									"sid": 292228073616239,
									"parameters": {
										"name": "\"tileX\"",
										"start-index": "0",
										"end-index": "200"
									}
								}
							],
							"actions": [],
							"sid": 443696458784966,
							"children": [
								{
									"eventType": "block",
									"conditions": [
										{
											"id": "for",
											"objectClass": "System",
											"sid": 191508649159457,
											"parameters": {
												"name": "\"tileY\"",
												"start-index": "0",
												"end-index": "500"
											}
										}
									],
									"actions": [],
									"sid": 980655691844298,
									"children": [
										{
											"eventType": "block",
											"conditions": [
												{
													"id": "compare-tile-at",
													"objectClass": "ship_BG2_1",
													"sid": 205821965393070,
													"parameters": {
														"tile-x": "loopindex(\"tileX\")",
														"tile-y": "loopindex(\"tileY\")",
														"comparison": 0,
														"tile": "45"
													}
												}
											],
											"actions": [
												{
													"id": "create-object",
													"objectClass": "System",
													"sid": 756153203017426,
													"parameters": {
														"object-to-create": "repairObj",
														"layer": "\"Ship\"",
														"x": "ship_BG2_1.TileToPositionX(loopindex(\"tileX\"))",
														"y": "ship_BG2_1.TileToPositionY(loopindex(\"tileY\"))"
													}
												},
												{
													"id": "set-instvar-value",
													"objectClass": "repairObj",
													"sid": 810710440203726,
													"parameters": {
														"instance-variable": "id",
														"value": "repairCount"
													}
												},
												{
													"id": "set-instvar-value",
													"objectClass": "repairObj",
													"sid": 101547740608211,
													"parameters": {
														"instance-variable": "repairProg",
														"value": "0"
													}
												},
												{
													"id": "set-instvar-value",
													"objectClass": "repairObj",
													"sid": 450168890253632,
													"parameters": {
														"instance-variable": "rndAnim",
														"value": "floor(random(1, 3))"
													}
												},
												{
													"id": "set-animation",
													"objectClass": "repairObj",
													"sid": 333015631939932,
													"parameters": {
														"animation": "Self.rndAnim & \"_broken\"",
														"from": "beginning"
													}
												},
												{
													"id": "pin-to-object",
													"objectClass": "repairObj",
													"sid": 431196100484958,
													"behaviorType": "Pin",
													"parameters": {
														"pin-to": "ship_col_1",
														"mode": "position-angle"
													}
												},
												{
													"id": "create-object",
													"objectClass": "System",
													"sid": 892763719381242,
													"disabled": true,
													"parameters": {
														"object-to-create": "repairHighlight",
														"layer": "\"Player\"",
														"x": "repairObj.X",
														"y": "repairObj.Y - 6"
													}
												},
												{
													"id": "flash",
													"objectClass": "repairHighlight",
													"sid": 464766082576136,
													"disabled": true,
													"behaviorType": "Flash",
													"parameters": {
														"on-time": "random(0.2, 0.4)",
														"off-time": "random(0.2, 0.4)",
														"duration": "2"
													}
												},
												{
													"id": "pin-to-object",
													"objectClass": "repairHighlight",
													"sid": 297361071629585,
													"disabled": true,
													"behaviorType": "Pin",
													"parameters": {
														"pin-to": "repairHighlight",
														"mode": "position-angle"
													}
												},
												{
													"id": "create-object",
													"objectClass": "System",
													"sid": 600294538491158,
													"parameters": {
														"object-to-create": "repairProgressBar",
														"layer": "\"Ship\"",
														"x": "ship_BG2_1.TileToPositionX(loopindex(\"tileX\")) - 16",
														"y": "ship_BG2_1.TileToPositionY(loopindex(\"tileY\")) - 12"
													}
												},
												{
													"id": "set-instvar-value",
													"objectClass": "repairProgressBar",
													"sid": 878155713806287,
													"parameters": {
														"instance-variable": "id",
														"value": "repairCount"
													}
												},
												{
													"id": "set-instvar-value",
													"objectClass": "repairProgressBar",
													"sid": 209745139381201,
													"parameters": {
														"instance-variable": "originalWidth",
														"value": "Self.Width"
													}
												},
												{
													"id": "set-visible",
													"objectClass": "repairProgressBar",
													"sid": 212710444513794,
													"parameters": {
														"visibility": "invisible"
													}
												},
												{
													"id": "pin-to-object",
													"objectClass": "repairProgressBar",
													"sid": 942157051219977,
													"behaviorType": "Pin",
													"parameters": {
														"pin-to": "ship_col_1",
														"mode": "position-angle"
													}
												},
												{
													"id": "set-position-to-another-object",
													"objectClass": "repairProgressBarBG",
													"sid": 349883195890862,
													"parameters": {
														"object": "repairProgressBar",
														"image-point-optional": "0"
													}
												},
												{
													"id": "move-to-object",
													"objectClass": "repairProgressBarBG",
													"sid": 547139547918539,
													"parameters": {
														"where": "behind",
														"object": "repairProgressBar"
													}
												},
												{
													"id": "set-visible",
													"objectClass": "repairProgressBarBG",
													"sid": 403203096839417,
													"parameters": {
														"visibility": "invisible"
													}
												},
												{
													"id": "pin-to-object",
													"objectClass": "repairProgressBarBG",
													"sid": 908532470512623,
													"behaviorType": "Pin",
													"parameters": {
														"pin-to": "repairProgressBarBG",
														"mode": "position-angle"
													}
												},
												{
													"id": "add-to-eventvar",
													"objectClass": "System",
													"sid": 325918642910208,
													"parameters": {
														"variable": "repairCount",
														"value": "1"
													}
												}
											],
											"sid": 373185588607947
										}
									]
								}
							]
						}
					]
				}
			],
			"sid": 741097980812758
		},
		{
			"eventType": "block",
			"conditions": [
				{
					"id": "is-boolean-instance-variable-set",
					"objectClass": "camera",
					"sid": 389721214706333,
					"parameters": {
						"instance-variable": "isEnabled"
					}
				}
			],
			"actions": [],
			"sid": 373939879975026,
			"children": [
				{
					"eventType": "block",
					"conditions": [
						{
							"id": "is-enabled",
							"objectClass": "player_base",
							"sid": 489213811101605,
							"behaviorType": "Platform"
						}
					],
					"actions": [
						{
							"id": "set-position",
							"objectClass": "camera",
							"sid": 304846827848416,
							"parameters": {
								"x": "player_base.X",
								"y": "player_base.Y"
							}
						}
					],
					"sid": 323369206087209
				},
				{
					"eventType": "block",
					"conditions": [
						{
							"id": "is-boolean-instance-variable-set",
							"objectClass": "shipController",
							"sid": 184810428592630,
							"parameters": {
								"instance-variable": "isActive"
							}
						}
					],
					"actions": [
						{
							"id": "set-position",
							"objectClass": "camera",
							"sid": 337459630073426,
							"parameters": {
								"x": "shipController.X",
								"y": "shipController.Y"
							}
						}
					],
					"sid": 728642067035094
				}
			]
		},
		{
			"eventType": "block",
			"conditions": [
				{
					"id": "on-collision-with-another-object",
					"objectClass": "shipController",
					"sid": 699274954743729,
					"parameters": {
						"object": "ground"
					}
				}
			],
			"actions": [
				{
					"id": "shake",
					"objectClass": "camera",
					"sid": 222686186551639,
					"behaviorType": "ScrollTo",
					"parameters": {
						"magnitude": "5",
						"duration": "0.4",
						"mode": "reducing-magnitude"
					}
				},
				{
					"callFunction": "StartFreezeFrame",
					"sid": 665783184848089,
					"parameters": [
						"0.08"
					]
				}
			],
			"sid": 436585212316107,
			"disabled": true
		},
		{
			"eventType": "include",
			"includeSheet": "ev_camera"
		},
		{
			"eventType": "include",
			"includeSheet": "ev_player"
		},
		{
			"eventType": "include",
			"includeSheet": "ev_triggers"
		}
	],
	"sid": 970568081279856
}