<data>
	<maps>
		<map r_name="'gameParameters'"
				 difficulty="difficulty=globalParameters.baseDifficulty"
				 cheat="cheat=globalParameters.cheatEnabled"
				 
				 gender="'Male'"
				 baseRace="globalParameters.lastPlayedRace"
				 race="baseRace+gender"
				 class="globalParameters.lastPlayedClass"
				 heroPackages="{race,'Mage','Priest','Rogue','Warrior','ConjurationPackage','EnchantmentPackage','EvocationPackage','TransmutationPackage',class+'Init'}"
				 characterName="(globalParameters.w_userName)?(globalParameters.w_userName):(text.defaultHeroName)"
				 
				 map="''"
				 r_gameScreen="'gameScreen'"
				 shortcutHelp="0"
				 combatLog="{}"
				 combatLogMax="100"
				 
				 fleeingDungeon="0"
				 totalTime="0"
				 spendDays="0"
				 maxDay="15"
				 daysLeft="max(0,6-spendDays)"
				 childrenAlive="max(0,min(maxDay-1-spendDays,8))"
				 princessAlive="maxDay>spendDays"
				 campaignVictory="0"
				 campaignDarkVictory="0"
				 campaignFailed="0"
				 deathCount="0"
				 fleeingCount="0"
				 mapMessage="''"
				 trapVisibility="0"
				 objectiveVisibility="0"
				 
				 pickupTarget="null"
				 picker="null"
				 
				 notifications="{}"
				 w_isSaving="0"
				 w_currentTime="0"
				 
				 lootPowerChest="randomElement(createArray(20,1)+createArray(20,2)+createArray(4,3)+{4})"
				 lootPowerLoot="randomElement(createArray(30,1)+createArray(15,2)+createArray(3,3))"
				 lootPowerEquipment="randomElement({0,0,0,1,1,1,2})"
				 lootTiers2="randomElement(createArray(7-min(6,$0),0)+(($0>3)?{1}:{}))"
				 lootTiers3="randomElement(createArray(7-min(6,$0),0)+createArray(4-floor(min(6,$0)/2),1)+{2})"
				 lootTiers4="randomElement(createArray(7-min(6,$0),0)+createArray(4-floor(min(6,$0)/2),1)+{2}+(($0>3)?{3}:{}))"
				 randomValueBetween="$0+1D($1-$0+1)-1"
				 lootLowEnchantmentBonus="min(10,eval(randomValueBetween, 1+floor($0/5), 1+floor(($0+3)/5)))"
				 lootLowArtefactEnchantmentBonus="min(10,1+floor((world.lastDungeonDepth+3)/5))"
				 lootStandardEnchantmentBonus="min(20,eval(randomValueBetween, 1+floor($0/5), floor((2*$0+4)/3)))"
				 lootStandardArtefactEnchantmentBonus="min(20,floor((2*world.lastDungeonDepth+4)/3))"
				 lootHighEnchantmentBonus="min(20,eval(randomValueBetween, 1+floor($0/3), floor((2*$0+5)/3)))"
				 lootHighArtefactEnchantmentBonus="min(20,floor((2*world.lastDungeonDepth+5)/3))"
				 
				 r_autoEquiphead="1"
				 r_autoEquipneck="1"
				 r_autoEquiparmor="1"
				 r_autoEquipgloves="1"
				 r_autoEquipboots="1"
				 r_autoEquipbelt="1"
				 r_autoEquipback="1"
				 r_autoEquipbracers="1"
				 r_autoEquipleftring="1"
				 r_autoEquiprightring="1"
				 r_autoEquipmainhand="1"
				 r_autoEquipoffhand="1"
				 r_autoEquipranged="1"
				 >
			<event r_name="'onLeaveDungeon'" r_template="'mainEventTemplate'" r_enabled="exists(world)" r_eventTarget="'world.currentDungeon'" r_targetType="'evaluator'">
				<effect r_name="'exitFromDungeon'" r_template="{'mainSelfEffectTemplate','multiEffect'}" r_enabled="!exists(world.currentDungeon)&&!campaignVictory">
					<effect r_name="'killPrincess'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="(daysLeft==0)&&(childrenAlive==0)" r_effect="princessAlive=0"/>
					<effect r_name="'killKids'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="(daysLeft==0)&&(childrenAlive>0)" r_effect="--childrenAlive"/>
					<effect r_name="'setDays'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_effect="++spendDays"/>
					<effect r_name="'messageRitualStartingDay'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="(world.isCampaign)&&(daysLeft==0)&&(childrenAlive==8)" r_effect="mapMessage=text.mapMessageRitualStartingDay"/>
					<effect r_name="'messageRitualEndingDay'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="(world.isCampaign)&&(childrenAlive==0)&&princessAlive" r_effect="mapMessage=text.mapMessageDayRitualEndingDay"/>
					<effect r_name="'messageDemonSummoningDay'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="(world.isCampaign)&&!princessAlive" r_effect="mapMessage=text.mapMessageDemonSummoningDay"/>
				</effect>
			</event>
			<event r_name="'onHeroDeath'" r_template="'mainEventTemplate'" r_enabled="exists(world)&&exists(heroes.@0)" r_eventTarget="'heroes.@0.isDead'" r_targetType="'attribute'">
				<effect r_name="'deathCount'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="heroes.@0.isDead" r_effect="deathCount++"/>
				<effect r_name="'gameOver'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="(heroes.@0.isDead)&&(world.isCampaign)&&!gameParameters.princessAlive" r_effect="campaignFailed=1"/>
			</event>
			<event r_name="'onCombatLog'" r_template="'mainEventTemplate'" r_eventTarget="'combatLog'" r_targetType="'attribute'">
				<effect r_name="'cutCombatLog'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="length(combatLog)>100" r_effect="splice(combatLog, 0, length(combatLog)-100)"/>
			</event>
			<event r_name="'onVictory'" r_template="'mainEventTemplate'" r_eventTarget="'campaignVictory'" r_targetType="'attribute'">
				<effect r_name="'achievWinGameEasy'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="(!gameParameters.cheat)&&campaignVictory&&princessAlive" r_effect="globalParameters.achievWinGameEasy=1"/>
				<effect r_name="'achievWinGame'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="(!gameParameters.cheat)&&campaignVictory&&princessAlive" r_effect="globalParameters.achievWinGame=1"/>
				<effect r_name="'achievWinGameAlive'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="(!gameParameters.cheat)&&campaignVictory&&princessAlive&&(deathCount==0)" r_effect="globalParameters.achievWinGameAlive=1"/>
				<effect r_name="'achievWinGame7days'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="(!gameParameters.cheat)&&campaignVictory&&princessAlive&&(8==childrenAlive)" r_effect="globalParameters.achievWinGame7Days=1"/>
				<effect r_name="'paramSave'" r_template="'mainSelfEffectTemplate'" r_type="'SaveGlobalParameters'"/>
			</event>
			<event r_name="'onDarkVictory'" r_template="'mainEventTemplate'" r_eventTarget="'campaignDarkVictory'" r_targetType="'attribute'">
				<effect r_name="'achievKillRNG'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="(!gameParameters.cheat)&&campaignDarkVictory" r_effect="globalParameters.achievKillRNG=1"/>
				<effect r_name="'achievKillRNGAlive'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="(!gameParameters.cheat)&&campaignDarkVictory&&(deathCount==0)" r_effect="globalParameters.achievKillRNGAlive=1"/>
				<effect r_name="'achievKillRNGNoExtra'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="(!gameParameters.cheat)&&campaignDarkVictory&&(6>=spendDays)" r_effect="globalParameters.achievKillRNG7Days=1"/>
				<effect r_name="'paramSave'" r_template="'mainSelfEffectTemplate'" r_type="'SaveGlobalParameters'"/>
			</event>
			<event r_name="'onConjuration'" r_template="'mainEventTemplate'" r_enabled="exists(globalParameters)&&!globalParameters.achievConjuration&&(heroes.count>0)" r_eventTarget="'heroes.@0.Conjuration'" r_targetType="'attribute'">
				<effect r_name="'cutCombatLog'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="(!gameParameters.cheat)&&(heroes.@0.Conjuration>=10)" r_effect="globalParameters.achievConjuration=1"/>
			</event>
			<event r_name="'onEnchantment'" r_template="'mainEventTemplate'" r_enabled="exists(globalParameters)&&!globalParameters.achievEnchantment&&(heroes.count>0)" r_eventTarget="'heroes.@0.Enchantment'" r_targetType="'attribute'">
				<effect r_name="'cutCombatLog'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="(!gameParameters.cheat)&&(heroes.@0.Enchantment>=10)" r_effect="globalParameters.achievEnchantment=1"/>
			</event>
			<event r_name="'onEvocation'" r_template="'mainEventTemplate'" r_enabled="exists(globalParameters)&&!globalParameters.achievEvocation&&(heroes.count>0)" r_eventTarget="'heroes.@0.Evocation'" r_targetType="'attribute'">
				<effect r_name="'cutCombatLog'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="(!gameParameters.cheat)&&(heroes.@0.Evocation>=10)" r_effect="globalParameters.achievEvocation=1"/>
			</event>
			<event r_name="'onTransmutation'" r_template="'mainEventTemplate'" r_enabled="exists(globalParameters)&&!globalParameters.achievTransmutation&&(heroes.count>0)" r_eventTarget="'heroes.@0.Transmutation'" r_targetType="'attribute'">
				<effect r_name="'cutCombatLog'" r_template="{'mainSelfEffectTemplate','evaluationEffect'}" r_enabled="(!gameParameters.cheat)&&(heroes.@0.Transmutation>=10)" r_effect="globalParameters.achievTransmutation=1"/>
			</event>
			<event r_name="'onWorldChange'" r_template="'mainEventTemplate'" r_eventTarget="'world'" r_targetType="'evaluator'">
				<effect r_name="'eventRefresh'" r_template="{'mainSelfEffectTemplate','utilityEffect'}" r_className="'CutiEffectRefreshHierarchy'" r_refreshTarget="'gameParameters'"/>
			</event>
		</map>
	</maps>
</data>