﻿{
	"counters":
	[
		{
			"sid": "mushrooms",
			"comment": "sharing, value, minValue, maxValue можно не задавать",
			
			"sharing": "Clone",
			"value": 0,
			"minValue": 0,
			"maxValue": 10
		}
	],

	"quests":
	[
		{
			"comment": "Квест для проверки завершения фазы по квест группк",

			"sid": "quest_day_per_day",
			"activeOnStart": true,
			"name": "Name",
			"sharing": "Clone",

			"subQuestGroups":
			[
				{
					"sid": "testQuestGroup",
					"subQuests": [ "subQuestA", "subQuestB" ]
				}
			],

			"subQuests":
			[	
				{
					"sid": "subQuestA",
					"activeOnStart": true,

					"triggers":
					[
						{
							"conditionsLogic": "And",

							"conditions":
							[
								{ "c": "StartTurn", "p": [ "1", "1" ] }
							],

							"actions":
							[
								{ "a": "Print", "p": [ "subQuestA done" ] },
								{ "a": "NextAfterGroup", "p": [ "testQuestGroup", "subQuestAfter" ] }
							]
						}
					]
				},
				{
					"sid": "subQuestB",
					"activeOnStart": true,

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "StartTurn", "counter": 3 }
							],

							"actions":
							[
								{ "a": "Print", "p": [ "subQuestB done" ] },
								{ "a": "NextAfterGroup", "p": [ "testQuestGroup", "subQuestAfter" ] }
							]
						}
					]
				},
				{
					"sid": "subQuestAfter",

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "StartTurn", "counter": 2 }
							],

							"actions":
							[
								{ "a": "Print", "p": [ "subQuestAfter done" ] },
								{ "a": "NextQuest", "p": [ "quest_2" ] }
							]
						}
					]
				}
			]
		},
		{
			"sid": "quest_2",
			"name": "Quest 2",

			"subQuests":
			[	
				{
					"sid": "quest_2_subquest",
					"activeOnStart": true,

					"triggers":
					[
						{
							"conditions":
							[
								{ "c": "StartTurn", "counter": 2 }
							],

							"actions":
							[
								{ "a": "Print", "p": [ "hello from quest 2!!!!" ] },
								{ "a": "NextQuest", "p": [ "quest 3 with counters" ] }
							]
						}
					]
				}
			]
		},
		{
			"sid": "quest 3 with counters",
			"name": "Quest 3",
			"activeOnStart": true,

			"subQuests":
			[	
				{
					"sid": "quest_3_subquest",
					"activeOnStart": true,

					"triggers":
					[
						{
							"repeat": true,
							
							"conditions":
							[
								{ "c": "StartTurn", "counter": 1 }
							],

							"actions":
							[
								{ "a": "Print", "p": [ "mushrooms up" ] },
								{ "a": "CounterPlus", "p": [ "mushrooms", "1" ] }
							]
						},
						{
							"comment": "заканчиваем игру, если есть 10 грибов",
							"conditions":
							[
								{ "c": "CounterMoreOrEqual", "p": [ "mushrooms" ], "counter": 10 }
							],

							"actions":
							[
								{ "a": "GameVictory" }
							]
						}
					]
				}
			]
		}
	]
}