﻿{
	"counters":
	[
		{
			"sid": "Tutorial_M1_Win_Counter",
			"comment": "win_condition_counter"
		},

		{
			"sid": "Tutorial_M1_Step_by_Step_Counter_1",
			"comment": "Step_by_Step_activator"
		},

		{
			"sid": "Tutorial_M1_Step_by_Step_Counter_2",
			"comment": "Step_by_Step_activator"
		},

		{
			"sid": "Tutorial_M1_Step_by_Step_Counter_3",
			"comment": "Step_by_Step_activator"
		},

		{
			"sid": "Tutorial_M1_Step_by_Step_Counter_4",
			"comment": "Step_by_Step_activator"
		},

		{
			"sid": "Tutorial_M1_Step_by_Step_Counter_5",
			"comment": "Step_by_Step_activator"
		},

		{
			"sid": "Tutorial_M1_Step_by_Step_Counter_6",
			"comment": "Step_by_Step_activator"
		},

		{
			"sid": "Tutorial_M1_Step_by_Step_Counter_7",
			"comment": "Step_by_Step_activator"
		},

		{
			"sid": "Tutorial_M1_Step_1_Counter",
			"comment": "Tutorial_M1_Step_1"
		},

		{
			"sid": "Tutorial_M1_Step_2_Counter",
			"comment": "Tutorial_M1_Step_2"
		},

		{
			"sid": "Tutorial_M1_Step_3_Counter",
			"comment": "Tutorial_M1_Step_3"
		},

		{
			"sid": "Tutorial_M1_Step_4_Counter",
			"comment": "Tutorial_M1_Step_4"
		},

		{
			"sid": "Tutorial_M1_Step_5_Counter",
			"comment": "Tutorial_M1_Step_5"
		},

		{
			"sid": "Tutorial_M1_Step_6_Counter",
			"comment": "Tutorial_M1_Step_6"
		}
	],

	"quests":
	[
		{
			"sid": "intro",

			"hidden": true,

			"comment": "intro",

			"activeOnStart": true,
			"sharing": "Clone",

			"name": "1",

			"subQuests":
			[	
				{
					"sid": "1",
					"activeOnStart": true,

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "StartTurn", "p": [ "1", "1" ] }
							],

							"actions":
							[
								{ "a": "RevealFogOfWar", "p": [ "746", "1" ] },						
								{ "a": "Guide", "p": [ "tutorial_M1_start" ] },
								{ "a": "RemoveRes", "p": [ "gold", "50000" ] },
								{ "a": "RemoveRes", "p": [ "wood", "50" ] },
								{ "a": "RemoveRes", "p": [ "ore", "50" ] },
								{ "a": "RemoveRes", "p": [ "crystals", "50" ] },
								{ "a": "RemoveRes", "p": [ "gemstones", "50" ] },
								{ "a": "RemoveRes", "p": [ "mercury", "50" ] },
								{ "a": "RemoveRes", "p": [ "dust", "500" ] }
							]
						}
					]
				}
			]
		},

		{
			"sid": "win_lose_conditions",
			"hidden": true,

			"comment": "conditions for losing, sometimes winning",

			"activeOnStart": true,
			"name": "1",
			"sharing": "Clone",

			"subQuests":
			[	
				{
					"sid": "lose_condition",
					"activeOnStart": true,

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "HeroKill", "p": [ "tutorial_hero_1" ] }
							],

							"actions":
							[
								{ "a": "GameLose" }
							]
						}
					]
				}
			]
		},

		{
			"sid": "step_by_step_activator_quest",
			"hidden": true,

			"comment": "step by step activator",

			"activeOnStart": true,
			"name": "step_by_step_activetor",
			"sharing": "Clone",

			"subQuests":
			[	
				{
					"sid": "step_by_step_activator",
					"activeOnStart": true,

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "Tutorial_M1_Step_by_Step_Counter_1", "=", "1" ] }
							],

							"actions":
							[
								{ "a": "NextQuest", "p": [ "Questlog" ] }
							]
						}
					]
				}
			]
		},
		{
			"sid": "step_by_step_activator_quest_0",
			"hidden": true,

			"comment": "step by step activator",

			"activeOnStart": true,
			"name": "step_by_step_activetor",
			"sharing": "Clone",

			"subQuests":
			[	
				{
					"sid": "step_by_step_activator",
					"activeOnStart": true,

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "StartTurn", "p": [ "1", "2" ] }
							],

							"actions":
							[					
								{ "a": "Guide", "p": [ "tutorial_M1_3" ] }
							]
						}
					]
				}
			]
		},
		{
			"sid": "step_by_step_activator_quest_3",
			"hidden": true,

			"comment": "step by step activator",

			"activeOnStart": true,
			"name": "step_by_step_activetor",
			"sharing": "Clone",

			"subQuests":
			[	
				{
					"sid": "step_by_step_activator",
					"activeOnStart": true,

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "Tutorial_M1_Step_by_Step_Counter_3", "=", "1" ] }
							],

							"actions":
							[
								{ "a": "NextQuest", "p": [ "Questlog_Main" ] }
							]
						}
					]
				}
			]
		},
		{
			"sid": "step_by_step_activator_quest_8",
			"hidden": true,

			"comment": "step by step activator",

			"activeOnStart": true,
			"name": "step_by_step_activetor",
			"sharing": "Clone",

			"subQuests":
			[	
				{
					"sid": "step_by_step_activator",
					"activeOnStart": true,

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "SquadKill", "p": [ "guard_1" ] }
							],

							"actions":
							[
								{ "a": "CounterPlus", "p": [ "Tutorial_M1_Step_6_Counter", "1" ] },
								{ "a": "Guide", "p": [ "tutorial_M1_7" ] }
							]
						}
					]
				}
			]
		},
		{
			"sid": "step_by_step_activator_quest_9",
			"hidden": true,

			"comment": "step by step activator",

			"activeOnStart": true,
			"name": "step_by_step_activetor",
			"sharing": "Clone",

			"subQuests":
			[	
				{
					"sid": "step_by_step_activator",
					"activeOnStart": true,

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "SquadKill", "p": [ "guard_2" ] }
							],

							"actions":
							[
								{ "a": "Guide", "p": [ "tutorial_M1_9" ] }
							]
						}
					]
				}
			]
		},

		{
			"sid": "Questlog_Main",
			"main": true,

			"comment": "Main Goal",

			"activeOnStart": false,
			"sharing": "Clone",

			"name": "Основная задача",

			"subQuests":
			[	
				{
					"sid": "win_condition",
					"activeOnStart": true,
					
					"name": "Захватите город на северо-востоке карты",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "Tutorial_M1_Win_Counter", "=", "1" ] }
							],

							"actions":
							[
								{ "a": "SubQuestDone", "p": [ "Questlog", "step_9" ] },
								{ "a": "GameVictory" }
							]
						}
					]
				}
			]
		},

		{
			"sid": "Questlog",
			"main": true,

			"comment": "Step by Step",

			"activeOnStart": false,
			"sharing": "Clone",

			"name": "Обучение",

			"subQuests":
			[	
				{
					"sid": "step_1",
					"activeOnStart": true,
					
					"name": "Переместитесь в отмеченную зону",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "Tutorial_M1_Step_1_Counter", "=", "1" ] }
							],

							"actions":
							[
								{ "a": "CurrentSubQuestDone" },
								{ "a": "NextSubQuest", "p": [ "step_2" ] }
							]
						}
					]
				},
				{
					"sid": "step_2",
					"activeOnStart": false,
					
					"name": "Продолжайте путь дальше",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "Tutorial_M1_Step_2_Counter", "=", "1" ] }
							],

							"actions":
							[
								{ "a": "CurrentSubQuestDone" }
							]
						}
					]
				},
				{
					"sid": "step_3",
					"activeOnStart": false,
					
					"name": "Начните новый игровой день",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "Tutorial_M1_Step_3_Counter", "=", "1" ] }
							],

							"actions":
							[
								{ "a": "RevealFogOfWar", "p": [ "790", "2" ] },	
								{ "a": "CurrentSubQuestDone" }
							]
						}
					]
				},
				{
					"sid": "step_4",
					"activeOnStart": false,
					
					"name": "Продолжайте движение по дороге",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "Tutorial_M1_Step_4_Counter", "=", "1" ] }
							],

							"actions":
							[
								{ "a": "CurrentSubQuestDone" },
								{ "a": "NextSubQuest", "p": [ "step_5" ] }
							]
						}
					]
				},
				{
					"sid": "step_5",
					"activeOnStart": false,
					
					"name": "Провзаимодействуйте с смотровой вышкой",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "Tutorial_M1_Step_5_Counter", "=", "1" ] }
							],

							"actions":
							[
								{ "a": "CurrentSubQuestDone" }
							]
						}
					]
				},
				{
					"sid": "step_6",
					"activeOnStart": false,
					
					"name": "Соберите 5000 золота",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "ResCounter", "p": [ "gold", ">", "4999" ] }
							],

							"actions":
							[
								{ "a": "CurrentSubQuestDone" },
								{ "a": "Guide", "p": [ "tutorial_M1_6" ] }
							]
						}
					]
				},
				{
					"sid": "step_7",
					"activeOnStart": false,
					
					"name": "Нападите на противника дальше по дороге",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "Counter", "p": [ "Tutorial_M1_Step_6_Counter", "=", "1" ] }
							],

							"actions":
							[
								{ "a": "CurrentSubQuestDone" }
							]
						}
					]
				},
				{
					"sid": "step_8",
					"activeOnStart": false,
					
					"name": "Наймите подкрепление",

					"triggers":
					[
						{
							"conditionsLogic": "And",

							"conditions":
							[
								{ "c": "UnitOwnHero", "p": [ "human_hero_3", "esquire", ">=" ,"30" ] },								
								{ "c": "UnitOwnHero", "p": [ "human_hero_3", "crossbowman", ">=" , "20" ] }
							],

							"actions":
							[
								{ "a": "CurrentSubQuestDone" },
								{ "a": "NextSubQuest", "p": [ "step_9" ] },
								{ "a": "DeleteEntity", "p": [ "block_2_1" ] },
								{ "a": "DeleteEntity", "p": [ "block_2_2" ] },
								{ "a": "DeleteEntity", "p": [ "block_2_3" ] },
								{ "a": "Guide", "p": [ "tutorial_M1_8" ] }
							]
						}
					]
				},
				{
					"sid": "step_9",
					"activeOnStart": false,
					
					"name": "Продолжайте путь дальше",

					"triggers":
					[
						{
							"conditionsLogic": "And",

							"conditions":
							[

							],

							"actions":
							[

							]
						}
					]
				}
			]
		}
	]
}