<h3>Item - {{obj.name}}</h3>
<div class="prevNext">
	<a class="btn btn-secondary" ng-click="previous()"><i class="icon-backward"></i></a>
	<a class="btn btn-secondary" ng-click="next()"><i class="icon-forward"></i></a>
</div>
<fieldset>
	<legend>General</legend>
	<div class="fieldWithLabel">
		<label for="iconID">Icon:</label>
		<span class="field">
			<div ng-tile-image="obj.iconID" class="at-input-icon" ng-select-image="item" ng-select-image-dest="obj.iconID"></div>
			<input type="text" id="iconID" class="at-input-iconID" ng-model="obj.iconID" />
		</span>
	</div>
	<div class="fieldWithLabel">
		<label for="name">Display name:</label>
		<input type="text" size="30" id="name" class="field at-input-name" ng-model="obj.name" />
	</div>
	<div class="fieldWithLabel">
		<label for="id" class="hint  hint--top" data-hint="The id is not displayed to the player anywhere. Must be a unique id (no two items may have the same id). Prefer short ids since it keeps savegames smaller.">Internal ID:</label>
		<input type="text" size="30" id="id" class="field at-input-id" ng-model="obj.id" />
	</div>
	<div class="fieldWithLabel">
		<label for="category">Category:</label>
		<select class="field" id="category" ng-model="obj.category" ng-options="s.name for s in itemCategories">
		</select>
	</div>
	<div class="fieldWithLabel">
		<label for="description" class="hint  hint--top" data-hint="Background story of the item, that ties its history into the rest of the world.">Lore/Description:</label>
		<textarea class="field" rows="4" cols="40" id="description" ng-model="obj.description" placeholder="Leave empty for most normal items"></textarea>
	</div>
	<div class="fieldWithLabel">
		<label for="displaytype">Display as:</label>
		<select class="field" id="displaytype" ng-model="obj.displaytype">
			<option value="ordinary">Ordinary item</option>
			<option value="quest">Quest item (yellow)</option>
			<option value="legendary">Legendary (green)</option>
			<option value="extraordinary">Extraordinary (blue)</option>
			<option value="rare">Rare (purple)</option>
		</select>
	</div>
	<div class="fieldWithLabel" ng-ds-fade="isWearable">
		<label class="checkbox"><input type="checkbox" id="hasEquipEffect" ng-model="obj.hasEquipEffect" />Has equip effect</label>
	</div>
	<div class="fieldWithLabel" ng-ds-fade="isUsable">
		<label class="checkbox"><input type="checkbox" id="hasUseEffect" ng-model="obj.hasUseEffect" />Has use effect</label>
	</div>
	<div class="fieldWithLabel" ng-ds-fade="isWearable">
		<label class="checkbox"><input type="checkbox" id="hasHitEffect" ng-model="obj.hasHitEffect" />Has effect on every hit</label>
	</div>
	<div class="fieldWithLabel" ng-ds-fade="isWearable">
		<label class="checkbox"><input type="checkbox" id="hasKillEffect" ng-model="obj.hasKillEffect" />Has effect on every kill</label>
	</div>
</fieldset>
<fieldset>
	<legend>Price</legend>
	<div class="fieldWithLabel">
		<label class="checkbox"><input type="checkbox" id="hasManualPrice" ng-model="obj.hasManualPrice" ng-true-value="1" ng-false-value="0" ng-change="updateCost(obj)" />Item has manually specified store price</label>
	</div>
	<div class="fieldWithLabel">
		<label for="baseMarketCost">Base market cost (gold):</label>
		<input type="text" size="7" id="baseMarketCost" ng-show="obj.hasManualPrice == 0" class="field at-input-gold" readonly="readonly" value="{{getItemCost(obj)}}" />
		<input type="text" size="7" id="baseMarketCost" ng-show="obj.hasManualPrice == 1" class="field at-input-gold" ng-model="obj.baseMarketCost" title="The actual price is adjusted 15% depending on if the item is being bought or sold. Set to 0 to prohibit selling this item type (for example, for a quest item)." />
	</div>
	<div class="fieldWithLabel">
		<label for="marketCost_Sell">Actual price (gold):</label>
		<div class="field">
			<span>Sell: <input type="text" size="7" id="marketCost_Sell" class="at-input-gold" value="{{getItemSellingCost(obj)}}" readonly="readonly" /></span>
			<span>Buy: <input type="text" size="7" id="marketCost_Buy" class="at-input-gold" value="{{getItemBuyingCost(obj)}}" readonly="readonly" /></span>
		</div>
	</div>
</fieldset>
<fieldset id="hasEquipEffectDisplay" ng-ds-fade="obj.hasEquipEffect">
	<legend>When equipped</legend>
	<div class="fieldWithLabel">
		<label for="equip_boostMaxHP">Increase max HP:</label>
		<input type="text" size="5" id="equip_boostMaxHP" class="field at-input-stat" ng-model="obj.equipEffect.increaseMaxHP" />
	</div>
	<div class="fieldWithLabel">
		<label class="checkbox"><input type="checkbox" id="hasEquipEffect" ng-model="obj.hasEquipAPEffect" />Has AP effect</label>
	</div>
	<div class="fieldWithLabel" ng-ds-fade="obj.hasEquipAPEffect">
		<label for="equip_boostMaxAP">Increase max AP:</label>
		<input type="text" size="5" id="equip_boostMaxAP" class="field at-input-stat" ng-model="obj.equipEffect.increaseMaxAP" />
	</div>
	<div class="fieldWithLabel" ng-ds-fade="obj.hasEquipAPEffect">
		<label for="equip_moveCostPenalty">Increase move cost (AP):</label>
		<input type="text" size="5" id="equip_moveCostPenalty" class="field at-input-stat" ng-model="obj.equipEffect.increaseMoveCost" />
	</div>
	<div class="fieldWithLabel" ng-ds-fade="obj.hasEquipAPEffect">
		<label for="equip_increaseUseItemCost">Increase use item cost (AP):</label>
		<input type="text" size="5" id="equip_increaseUseItemCost" class="field at-input-stat" ng-model="obj.equipEffect.increaseUseItemCost" />
	</div>
	<div class="fieldWithLabel" ng-ds-fade="obj.hasEquipAPEffect">
		<label for="equip_increaseReequipCost">Increase re-equip cost (AP):</label>
		<input type="text" size="5" id="equip_increaseReequipCost" class="field at-input-stat" ng-model="obj.equipEffect.increaseReequipCost" />
	</div>
	<div class="fieldWithLabel" ng-ds-fade="!isWeapon">
		<label for="equip_attackCost">Increase attack cost (AP):</label>
		<input type="text" size="5" id="equip_attackCost" class="field at-input-stat" ng-model="obj.equipEffect.increaseAttackCost" />
	</div>
	<div class="fieldWithLabel" ng-ds-fade="isWeapon">
		<label for="equip_attackCost">Attack cost (AP):</label>
		<input type="text" size="5" id="equip_attackCost" class="field at-input-stat" ng-model="obj.equipEffect.increaseAttackCost" />
	</div>
	<div class="fieldWithLabel">
		<label for="equip_attackChance">Increase attack chance:</label>
		<input type="text" size="5" id="equip_attackChance" class="field at-input-stat" ng-model="obj.equipEffect.increaseAttackChance" />%
	</div>
	<div class="fieldWithLabel">
		<label for="equip_attackDamage">Increase attack damage (range):</label>
		<div class="field">
			<input type="text" size="3" id="equip_attackDamage_Min" class="at-input-stat-minmax" ng-model="obj.equipEffect.increaseAttackDamage.min" />
			-
			<input type="text" size="3" id="equip_attackDamage_Max" class="at-input-stat-minmax" ng-model="obj.equipEffect.increaseAttackDamage.max" />
		</div>
	</div>
	<div class="fieldWithLabel">
		<label for="equip_criticalChance">Increase critical skill:</label>
		<input type="text" size="5" id="equip_criticalChance" class="field at-input-stat" ng-model="obj.equipEffect.increaseCriticalSkill" />
	</div>
	<div class="fieldWithLabel" ng-ds-fade="isWeapon">
		<label for="equip_criticalMultiplier" class="hint  hint--top" data-hint="Only for weapons">Critical multiplier:</label>
		<input type="text" size="5" id="equip_criticalMultiplier" class="field at-input-stat" ng-model="obj.equipEffect.setCriticalMultiplier" />
	</div>
	<div class="fieldWithLabel">
		<label for="equip_blockChance">Increase block chance:</label>
		<input type="text" size="5" id="equip_blockChance" class="field at-input-stat" ng-model="obj.equipEffect.increaseBlockChance" />%
	</div>
	<div class="fieldWithLabel">
		<label for="equip_damageResistance">Increase damage resistance:</label>
		<input type="text" size="5" id="equip_damageResistance" class="field at-input-stat" ng-model="obj.equipEffect.increaseDamageResistance" />
	</div>
	<div class="fieldWithLabel">
		<label for="equip_conditions">Apply actor condition</label>
		<table class="field" id="equip_conditions">
			<thead><tr>
				<th><span class="hint  hint--left" data-hint="Id of the actor condition to be applied.">Condition</span></th>
				<th><span class="hint  hint--left" data-hint="How strong the effect should be. For example, magnitude=2 is equal to having two effects active at the same time. Use -99 to remove permanent effects.">Magnitude</span></th>
				<th></th>
			</tr></thead>
			<tbody>
				<tr ng-repeat="condition in obj.equipEffect.addedConditions">
					<td><input type="text" ng-model="condition.condition" class="at-input-id" /></td>
					<td><input type="text" size="3" ng-model="condition.magnitude" class="at-input-magnitude" /></td>
					<td><a ng-click="removeCondition(obj.equipEffect.addedConditions, condition)" class="btn btn-mini" title="Remove row"><i class="icon-trash"></i></a></td>
				</tr>
			</tbody>
		</table>
		<button ng-click="addCondition(obj.equipEffect.addedConditions)" class="btn" title="Add row"><i class="icon-plus-sign"></i> Add</button>
	</div>
</fieldset>
<fieldset id="hasUseEffectDisplay" ng-ds-fade="obj.hasUseEffect">
	<legend>When used</legend>
	<div class="fieldWithLabel">
		<label for="use_boostHP">Boost current HP (range):</label>
		<div class="field">
			<input type="text" size="3" id="use_boostHP_Min" class="at-input-stat-minmax" ng-model="obj.useEffect.increaseCurrentHP.min" />
			-
			<input type="text" size="3" id="use_boostHP_Max" class="at-input-stat-minmax" ng-model="obj.useEffect.increaseCurrentHP.max" />
		</div>
	</div>
	<div class="fieldWithLabel">
		<label for="use_boostAP">Boost current AP (range):</label>
		<div class="field">
			<input type="text" size="3" id="use_boostAP_Min" class="at-input-stat-minmax" ng-model="obj.useEffect.increaseCurrentAP.min" />
			-
			<input type="text" size="3" id="use_boostAP_Max" class="at-input-stat-minmax" ng-model="obj.useEffect.increaseCurrentAP.max" />
		</div>
	</div>
	<div class="fieldWithLabel">
		<label for="use_conditionsSource">Apply actor condition</label>
		<table class="field" id="use_conditionsSource">
			<thead><tr>
				<th><span class="hint  hint--left" data-hint="Id of the actor condition to be applied.">Condition</span></th>
				<th><span class="hint  hint--left" data-hint="How strong the effect should be. For example, magnitude=2 is equal to having two effects active at the same time. Use -99 to remove permanent effects.">Magnitude</span></th>
				<th><span class="hint  hint--left" data-hint="How many rounds the actor condtions should last. Use 999 for a permanent effect.">Duration</span></th>
				<th><span class="hint  hint--left" data-hint="Percentage chance, integer value from 1 (very unlikely) to 100 (always).">Chance</span></th>
				<th></th>
			</tr></thead>
			<tbody>
				<tr ng-repeat="condition in obj.useEffect.conditionsSource">
					<td><input type="text" ng-model="condition.condition" class="at-input-id" /></td>
					<td><input type="text" size="3" ng-model="condition.magnitude" class="at-input-magnitude" /></td>
					<td><input type="text" size="3" ng-model="condition.duration" class="at-input-duration" /></td>
					<td><input type="text" size="3" ng-model="condition.chance" class="at-input-chance" /></td>
					<td><a ng-click="removeCondition(obj.useEffect.conditionsSource, condition)" class="btn btn-mini" title="Remove row"><i class="icon-trash"></i></a></td>
				</tr>
			</tbody>
		</table>
		<button ng-click="addCondition(obj.useEffect.conditionsSource)" class="btn" title="Add row"><i class="icon-plus-sign"></i> Add</button>
	</div>
</fieldset>
<fieldset id="hasHitEffectDisplay" ng-ds-fade="obj.hasHitEffect">
	<legend>When making a successful hit</legend>
	<div class="fieldWithLabel">
		<label for="hit_boostHP">Boost current HP (range):</label>
		<div class="field">
			<input type="text" size="3" id="hit_boostHP_Min" class="at-input-stat-minmax" ng-model="obj.hitEffect.increaseCurrentHP.min" />
			-
			<input type="text" size="3" id="hit_boostHP_Max" class="at-input-stat-minmax" ng-model="obj.hitEffect.increaseCurrentHP.max" />
		</div>
	</div>
	<div class="fieldWithLabel">
		<label for="hit_boostAP">Boost current AP (range):</label>
		<div class="field">
			<input type="text" size="3" id="hit_boostAP_Min" class="at-input-stat-minmax" ng-model="obj.hitEffect.increaseCurrentAP.min" />
			-
			<input type="text" size="3" id="hit_boostAP_Max" class="at-input-stat-minmax" ng-model="obj.hitEffect.increaseCurrentAP.max" />
		</div>
	</div>
	<div class="fieldWithLabel">
		<label for="hit_conditionsSource">Apply actor condition to source</label>
		<table class="field" id="hit_conditionsSource">
			<thead><tr>
				<th><span class="hint  hint--left" data-hint="Id of the actor condition to be applied.">Condition</span></th>
				<th><span class="hint  hint--left" data-hint="How strong the effect should be. For example, magnitude=2 is equal to having two effects active at the same time. Use -99 to remove permanent effects.">Magnitude</span></th>
				<th><span class="hint  hint--left" data-hint="How many rounds the actor condtions should last. Use 999 for a permanent effect.">Duration</span></th>
				<th><span class="hint  hint--left" data-hint="Percentage chance, integer value from 1 (very unlikely) to 100 (always).">Chance</span></th>
				<th></th>
			</tr></thead>
			<tbody>
				<tr ng-repeat="condition in obj.hitEffect.conditionsSource">
					<td><input type="text" ng-model="condition.condition" class="at-input-id" /></td>
					<td><input type="text" size="3" ng-model="condition.magnitude" class="at-input-magnitude" /></td>
					<td><input type="text" size="3" ng-model="condition.duration" class="at-input-duration" /></td>
					<td><input type="text" size="3" ng-model="condition.chance" class="at-input-chance" /></td>
					<td><a ng-click="removeCondition(obj.hitEffect.conditionsSource, condition)" class="btn btn-mini" title="Remove row"><i class="icon-trash"></i></a></td>
				</tr>
			</tbody>
		</table>
		<button ng-click="addCondition(obj.hitEffect.conditionsSource)" class="btn" title="Add row"><i class="icon-plus-sign"></i> Add</button>
	</div>
	<div class="fieldWithLabel">
		<label for="hit_conditionsTarget">Apply actor condition to target</label>
		<table class="field" id="hit_conditionsTarget">
			<thead><tr>
				<th><span class="hint  hint--left" data-hint="Id of the actor condition to be applied.">Condition</span></th>
				<th><span class="hint  hint--left" data-hint="How strong the effect should be. For example, magnitude=2 is equal to having two effects active at the same time. Use -99 to remove permanent effects.">Magnitude</span></th>
				<th><span class="hint  hint--left" data-hint="How many rounds the actor condtions should last. Use 999 for a permanent effect.">Duration</span></th>
				<th><span class="hint  hint--left" data-hint="Percentage chance, integer value from 1 (very unlikely) to 100 (always).">Chance</span></th>
				<th></th>
			</tr></thead>
			<tbody>
				<tr ng-repeat="condition in obj.hitEffect.conditionsTarget">
					<td><input type="text" ng-model="condition.condition" class="at-input-id" /></td>
					<td><input type="text" size="3" ng-model="condition.magnitude" class="at-input-magnitude" /></td>
					<td><input type="text" size="3" ng-model="condition.duration" class="at-input-duration" /></td>
					<td><input type="text" size="3" ng-model="condition.chance" class="at-input-chance" /></td>
					<td><a ng-click="removeCondition(obj.hitEffect.conditionsTarget, condition)" class="btn btn-mini" title="Remove row"><i class="icon-trash"></i></a></td>
				</tr>
			</tbody>
		</table>
		<button ng-click="addCondition(obj.hitEffect.conditionsTarget)" class="btn" title="Add row"><i class="icon-plus-sign"></i> Add</button>
	</div>
</fieldset>
<fieldset id="hasKillEffectDisplay" ng-ds-fade="obj.hasKillEffect">
	<legend>On every kill</legend>
	<div class="fieldWithLabel">
		<label for="kill_boostHP">Boost current HP (range):</label>
		<div class="field">
			<input type="text" size="3" id="kill_boostHP_Min" class="at-input-stat-minmax" ng-model="obj.killEffect.increaseCurrentHP.min" />
			-
			<input type="text" size="3" id="kill_boostHP_Max" class="at-input-stat-minmax" ng-model="obj.killEffect.increaseCurrentHP.max" />
		</div>
	</div>
	<div class="fieldWithLabel">
		<label for="kill_boostAP">Boost current AP (range):</label>
		<div class="field">
			<input type="text" size="3" id="kill_boostAP_Min" class="at-input-stat-minmax" ng-model="obj.killEffect.increaseCurrentAP.min" />
			-
			<input type="text" size="3" id="kill_boostAP_Max" class="at-input-stat-minmax" ng-model="obj.killEffect.increaseCurrentAP.max" />
		</div>
	</div>
	<div class="fieldWithLabel">
		<label for="kill_conditionsSource">Apply actor condition</label>
		<table class="field" id="kill_conditionsSource">
			<thead><tr>
				<th><span class="hint  hint--left" data-hint="Id of the actor condition to be applied.">Condition</span></th>
				<th><span class="hint  hint--left" data-hint="How strong the effect should be. For example, magnitude=2 is equal to having two effects active at the same time. Use -99 to remove permanent effects.">Magnitude</span></th>
				<th><span class="hint  hint--left" data-hint="How many rounds the actor condtions should last. Use 999 for a permanent effect.">Duration</span></th>
				<th><span class="hint  hint--left" data-hint="Percentage chance, integer value from 1 (very unlikely) to 100 (always).">Chance</span></th>
				<th></th>
			</tr></thead>
			<tbody>
				<tr ng-repeat="condition in obj.killEffect.conditionsSource">
					<td><input type="text" ng-model="condition.condition" class="at-input-id" /></td>
					<td><input type="text" size="3" ng-model="condition.magnitude" class="at-input-magnitude" /></td>
					<td><input type="text" size="3" ng-model="condition.duration" class="at-input-duration" /></td>
					<td><input type="text" size="3" ng-model="condition.chance" class="at-input-chance" /></td>
					<td><a ng-click="removeCondition(obj.killEffect.conditionsSource, condition)" class="btn btn-mini" title="Remove row"><i class="icon-trash"></i></a></td>
				</tr>
			</tbody>
		</table>
		<button ng-click="addCondition(obj.killEffect.conditionsSource)" class="btn" title="Add row"><i class="icon-plus-sign"></i> Add</button>
	</div>
</fieldset>
<div class="endSets"> </div>
