<data>
	<items>
		<!-- Templates -->
		<itemTemplate r_name="'Consumable'" r_template="'selfActivableItemTemplate'"
									itemActionTemplate="'mainActionWithChargeTemplate'"
									r_autoStack="1"
									rw_charge="1">
			<action r_name="'use'" timeCost="50" canBeInActionList="1" r_autoAddToActionList="1" r_actionIndexOffset="100">
				<effect r_name="'mainEffect'">
					<effect r_name="'anim'" r_template="'mainGraphicEffectTemplate'" r_enabled="isAnimated" r_type="'LaunchAnimation'" r_graphicTarget="actorName" r_animationName="'potion'" r_freezeDelay="3"/>
				</effect>
			</action>
			<event r_name="'outOfCharge'" r_template="'mainEventTemplate'" r_eventTarget="'rw_charge'" r_targetType="'attribute'">
				<effect r_name="'remove'" r_template="{'mainSelfEffectTemplate','controllerEffect'}" r_enabled="rw_charge==0" r_className="'CctlEffectDestructor'"/>
			</event>
		</itemTemplate>
		
		<itemTemplate r_name="'ConsumableBuff'" r_template="'Consumable'"
									itemEffectTemplate="{'mainTargetEffectTemplate','mainBuffEffectTemplate'}"
									actionLogMethod="'logPowerWithBuff'"
									endBuffLogMethod="'logBuffEnd'"
									cancellableItem="0"
									itemDuration="100"
									itemTickCount="2"
									itemRecastRule="'replace'">
			<action r_name="'use'" canTargetFaction="(actor.r_allyFaction)[target.r_faction]">
				<effect r_name="'mainEffect'"
								r_tickDuration="itemDuration"
								r_tickCount="itemTickCount"
								cancellable="cancellableItem"
								recastRule="itemRecastRule"/>
			</action>
		</itemTemplate>
		
		<!-- Potions -->
		<itemTemplate r_name="'HealthPotionTemplate'" r_template="'Consumable'"
									itemEffectTemplate="'standardHealTemplate'"
									actionLogMethod="'logPowerWithHeal'"
									itemHealBonus="0">
			<action r_name="'use'" r_enabled="maxHitPoints>hitPoints">
				<effect r_name="'mainEffect'"
								healBonus="itemHealBonus"/>
			</action>
		</itemTemplate>
		<item r_name="'SmallHealthPotion'" r_template="'HealthPotionTemplate'"
					itemName="text.itemSmallHealthPotion"
					r_graphic="'potion_health_small.png'"
					itemHealBonus="50"
					tooltip="text.tooltipItemSmallHealthPotion"/>
		<item r_name="'GreaterHealthPotion'" r_template="'HealthPotionTemplate'"
					itemName="text.itemGreaterHealthPotion"
					r_graphic="'potion_health_greater.png'"
					itemHealBonus="150"
					tooltip="text.tooltipItemGreaterHealthPotion"/>
		
		<itemTemplate r_name="'FatiguePotionTemplate'" r_template="'Consumable'"
									itemEffectTemplate="'standardRestoreTemplate'"
									itemFatigueBonus="0"
									itemExhaustionBonus="0"
									actionLogMethod="'logPowerWithRestore'">
			<action r_name="'use'" r_enabled="exhaustion>fatigue">
				<effect r_name="'mainEffect'"
								fatigueBonus="itemFatigueBonus"
								exhaustionBonus="itemExhaustionBonus"/>
			</action>
		</itemTemplate>
		<item r_name="'SmallFatiguePotion'" r_template="'FatiguePotionTemplate'"
					itemName="text.itemSmallFatiguePotion"
					r_graphic="'potion_fatigue_small.png'"
					itemFatigueBonus="50"
					tooltip="text.tooltipItemSmallFatiguePotion"/>
		<item r_name="'GreaterFatiguePotion'" r_template="'FatiguePotionTemplate'"
					itemName="text.itemGreaterFatiguePotion"
					r_graphic="'potion_fatigue_greater.png'"
					itemFatigueBonus="50"
					itemExhaustionBonus="5"
					tooltip="text.tooltipItemGreaterFatiguePotion"/>

		<item r_name="'curePoisonPotion'" r_template="'Consumable'"
					itemName="text.itemCurePoisonPotion"
					r_graphic="'potion_curepoison.png'"
					itemEffectTemplate="{'mainSelfEffectTemplate','controllerEffect'}"
					tooltip="text.tooltipItemCurePoisonPotion">
			<action r_name="'use'">
				<effect r_name="'mainEffect'"
								r_className="'CctlEffectRemoveDurable'"
								r_condition="contains(targetEffect.effectTags,'poison')"/>
				<effect r_name="'log'" r_template="'logPower'" r_enabled="costPaid"/>
			</action>
		</item>

		<item r_name="'ArmorPotion'" r_template="'ConsumableBuff'"
					r_effectName="text.itemArmorPotion"
					itemName="text.itemArmorPotion"
					itemDuration="2000"
					r_graphic="'potion_armor.png'"
					tooltip="text.tooltipItemArmorPotion">
			<action r_name="'use'">
				<effect r_name="'mainEffect'">
					<modifier r_name="'Armor'" r_template="'mainEffectModifier'" r_modifierTarget="'target.Armor'" r_modifiedValue="$0+8"/>
					<modifier r_name="'Immunities'" r_template="'mainEffectModifier'" r_modifierTarget="'target.immunities'" r_modifiedValue="$0+{'Stun'}"/>
				</effect>
			</action>
		</item>
		<item r_name="'BearPotion'" r_template="'ConsumableBuff'"
					r_effectName="text.itemBearPotion"
					itemName="text.itemBearPotion"
					itemDuration="2000"
					r_graphic="'potion_bear.png'"
					tooltip="text.tooltipItemBearPotion">
			<action r_name="'use'">
				<effect r_name="'mainEffect'">
					<modifier r_name="'customCloseCombatDamageBonus'" r_template="'mainEffectModifier'" r_modifierTarget="'target.customCloseCombatDamageBonus'" r_modifiedValue="$0+6"/>
					<modifier r_name="'customCloseCombatHitBonus'" r_template="'mainEffectModifier'" r_modifierTarget="'target.customCloseCombatHitBonus'" r_modifiedValue="$0+6"/>
				</effect>
			</action>
		</item>
		<item r_name="'EaglePotion'" r_template="'ConsumableBuff'"
					r_effectName="text.itemEaglePotion"
					itemName="text.itemEaglePotion"
					itemDuration="2000"
					r_graphic="'potion_eagle.png'"
					tooltip="text.tooltipItemEaglePotion">
			<action r_name="'use'">
				<effect r_name="'mainEffect'">
					<modifier r_name="'customRangedDamageBonus'" r_template="'mainEffectModifier'" r_modifierTarget="'target.customRangedDamageBonus'" r_modifiedValue="$0+6"/>
					<modifier r_name="'customRangedHitBonus'" r_template="'mainEffectModifier'" r_modifierTarget="'target.customRangedHitBonus'" r_modifiedValue="$0+6"/>
				</effect>
			</action>
		</item>
		<item r_name="'ManaSurgePotion'" r_template="'ConsumableBuff'"
					r_effectName="text.itemManaSurgePotion"
					itemName="text.itemManaSurgePotion"
					itemDuration="2000"
					r_graphic="'potion_manasurge.png'"
					tooltip="text.tooltipItemManaSurgePotion">
			<action r_name="'use'">
				<effect r_name="'mainEffect'">
					<modifier r_name="'spellCostModifier'" r_template="'mainEffectModifier'" r_modifierTarget="'target.spellCostModifier'" r_modifiedValue="$0-5"/>
				</effect>
			</action>
		</item>
		<item r_name="'SpeedPotion'" r_template="'ConsumableBuff'"
					r_effectName="text.itemSpeedPotion"
					itemName="text.itemSpeedPotion"
					itemDuration="1000"
					r_graphic="'potion_speed.png'"
					tooltip="text.tooltipItemSpeedPotion">
			<action r_name="'use'">
				<effect r_name="'mainEffect'">
					<modifier r_name="'moveTimeCostMultiplier'" r_template="'mainEffectModifier'" r_modifierTarget="'target.moveTimeCostMultiplier'" r_modifiedValue="$0*0.5"/>
					<modifier r_name="'actionTimeCostMultiplier'" r_template="'mainEffectModifier'" r_modifierTarget="'target.actionTimeCostMultiplier'" r_modifiedValue="$0*0.5"/>
				</effect>
			</action>
		</item>
		<item r_name="'ResistancePotion'" r_template="'ConsumableBuff'"
					r_effectName="text.itemResistancePotion"
					itemName="text.itemResistancePotion"
					itemDuration="5000"
					r_graphic="'potion_resistance.png'"
					tooltip="text.tooltipItemResistancePotion">
			<action r_name="'use'">
				<effect r_name="'mainEffect'">
					<modifier r_name="'Armor'" r_template="'mainEffectModifier'" r_modifierTarget="'target.Armor'" r_modifiedValue="$0+5"/>
					<modifier r_name="'Resistance'" r_template="'mainEffectModifier'" r_modifierTarget="'target.Resistance'" r_modifiedValue="$0+5"/>
				</effect>
			</action>
		</item>

		<item r_name="'ElixirTemplate'" r_template="'ConsumableBuff'"
					itemEffectTemplate="{'mainSelfEffectTemplate','evaluationEffect'}"
					attributeName="''">
			<action r_name="'use'">
				<effect r_name="'mainEffect'" r_effect="(target.attributeByName(attributeName+'Bonus'))++"/>
				<effect r_name="'log'" r_template="'logPower'" r_enabled="costPaid"/>
			</action>
		</item>
		<item r_name="'StrengthElixir'" r_template="'ElixirTemplate'"
					attributeName="'Strength'"
					itemName="text.itemStrengthElixir"
					tooltip="text.tooltipItemStrengthElixir"
					r_graphic="'potion_elixir.png'"/>
		<item r_name="'DexterityElixir'" r_template="'ElixirTemplate'"
					attributeName="'Dexterity'"
					itemName="text.itemDexterityElixir"
					tooltip="text.tooltipItemDexterityElixir"
					r_graphic="'potion_elixir.png'"/>
		<item r_name="'IntelligenceElixir'" r_template="'ElixirTemplate'"
					attributeName="'Intelligence'"
					itemName="text.itemIntelligenceElixir"
					tooltip="text.tooltipItemIntelligenceElixir"
					r_graphic="'potion_elixir.png'"/>
		<item r_name="'ConstitutionElixir'" r_template="'ElixirTemplate'"
					attributeName="'Constitution'"
					itemName="text.itemConstitutionElixir"
					tooltip="text.tooltipItemConstitutionElixir"
					r_graphic="'potion_elixir.png'"/>
		
		<item r_name="'randomTiers1Potion'" r_template="randomElement({'SmallHealthPotion','SmallFatiguePotion','curePoisonPotion'})"/>
		<item r_name="'randomTiers2Potion'" r_template="randomElement({'SmallHealthPotion','SmallFatiguePotion','ArmorPotion','BearPotion','EaglePotion','ManaSurgePotion'})"/>
		<item r_name="'randomTiers3Potion'" r_template="(1D20==1)?randomElement({'StrengthElixir','DexterityElixir','IntelligenceElixir','ConstitutionElixir'}):randomElement({'GreaterHealthPotion','GreaterFatiguePotion','SpeedPotion','ResistancePotion'})"/>
		<item r_name="'randomPotion'" r_template="{'randomTiers1Potion','randomTiers2Potion','randomTiers3Potion'}[eval(gameParameters.lootTiers3,dungeonDepth)]"/>
	</items>
</data>