<?xml version="1.0" encoding="utf-8"?>

<Defs>
	<ThingDef Name="SimpleLootBoxBase" ParentName="ResourceBase" Abstract="True">
		<thingClass>ThingWithComps</thingClass>
		<graphicData>
			<graphicClass>Graphic_Single</graphicClass><!-- 用 Graphic_StackCount 物品的贴图会反应物品的堆叠数量 -->
		</graphicData>
		<stackLimit>10</stackLimit><!-- 物品的堆叠数量 -->
		<techLevel>Medieval</techLevel><!-- 物品的科技等级，并不影响任何功能，只是个标签 -->
		<thingCategories><!-- 物品的分类 -->
			<li>Artifacts</li>
		</thingCategories>
		<tradeTags><!-- 物品的交易标签 -->
			<li>Artifacts</li>
		</tradeTags>
	</ThingDef>

	<ThingDef ParentName="SimpleLootBoxBase">
		<defName>SimpleLootBoxExampleA</defName><!-- 箱子的定义名 -->
		<label>simple loot box example A</label><!-- 箱子的名字，可以进行本地化翻译 -->
		<description>Example A.</description><!-- 箱子的描述，可以进行本地化翻译 -->
		<graphicData>
			<texPath>SimpleLootBox/ExampleA</texPath><!-- 箱子的贴图路径 -->
			<graphicClass>Graphic_Single</graphicClass>
		</graphicData>
		<statBases>
			<Mass>1.0</Mass><!-- 箱子的重量 -->
			<MarketValue>100</MarketValue><!-- 箱子本身的价值 -->
		</statBases>
		<tradeability>Buyable</tradeability><!-- 箱子是否可以交易，有几个字面意思可以理解的值 None Sellable Buyable All -->
		<comps>
			<li Class="CompProperties_Usable">
				<useJob>UseArtifact</useJob>
				<useLabel>Activate {0_label}</useLabel>
				<showUseGizmo>true</showUseGizmo>
				<useDuration>150</useDuration>
			</li>
			<li Class="SimpleLootBox.CompProperties_SpawnLootBox">
				<lootBoxList>
					<li>
						<thingDef>SimpleLootBoxExampleA</thingDef><!-- 箱子的定义名，加入到全局击杀生物后的掉落列表；如果有自定义的钥匙，也可以考虑加到这里来 -->
						<chance>0.01</chance><!-- 这个箱子的掉落概率，不填默认为0.05，也就是5%的击杀掉率 -->
					</li>
				</lootBoxList>
			</li>
			<li Class="SimpleLootBox.CompProperties_LootBox">
				<lootBoxOpenSound>lootBoxOpenSound</lootBoxOpenSound><!-- 进入开箱界面的音效，不填就没音效 -->
				<lootBoxSpinningSound>lootBoxSpinningSound</lootBoxSpinningSound><!-- 选取物品时的音效，单曲循环sustainer -->
				<lootBoxBackgroundMusicSound>lootBoxBackgroundMusicSoundA</lootBoxBackgroundMusicSound><!-- 开箱界面的背景音乐，单曲循环sustainer -->
				<lootBoxBackgroundTexturePath>SimpleLootBox/LootBoxBackgroundA</lootBoxBackgroundTexturePath><!-- 开箱界面的背景图，界面的分辨率为700*800 -->
				<lootBoxOpenCost>Silver</lootBoxOpenCost><!-- 开箱子所需要的物品，可以是白银，自定义的钥匙，或者任何物品，不填就默认为无 -->
				<lootBoxOpenCostCount>100</lootBoxOpenCostCount><!-- 开箱子所需要的物品的数量，不填默认为0 -->
				<lootBoxThingDef>
					<li>
						<thingDef>Silver</thingDef><!-- 箱子可以开出的物品的定义名，必填 -->
						<count>1000</count><!-- 该物品生成的数量，必填 -->
						<weight>5</weight><!-- 这项奖励的生成权重，必填 -->
						<rarity>2</rarity><!-- 这项奖励的稀有度（使用的颜色与文本）可用选项 0 1 2 3 4 5 ，不填默认为0，数字越大稀有度越高-->
						<effecterDef>Skip_ExitNoDelay</effecterDef><!-- 生成奖励时可以播放的特效，不设置就没特效 -->
						<lootBoxFinalizingRewardSound>lootBoxFinalizingRewardSound</lootBoxFinalizingRewardSound><!-- 该奖励被选中时的音效，不设置就没音效 -->
						<isHidden>false</isHidden><!-- 该物品是否会在可用的奖励列表里隐藏，如果你想给开箱的人一个惊喜，可以把他设置成true，默认为false -->
					</li>
					<li>
						<thingDef>Gold</thingDef>
						<count>500</count>
						<weight>1</weight>
						<rarity>4</rarity>
						<lootBoxFinalizingRewardSound>lootBoxFinalizingRewardSound</lootBoxFinalizingRewardSound>
					</li>
					<li>
						<thingDef>Bed</thingDef>
						<stuff>WoodLog</stuff><!-- 如果这个物品是stuffable，会使用这里设置的stuff，但如果没设置，会自动套用默认stuff -->
						<quality>Masterwork</quality><!-- 如果这个物品有品质，会使用这里设置的品质，不设置默认Normal，可用的品质为 Awful Poor Normal Good Excellent Masterwork Legendary-->
						<count>1</count>
						<weight>2</weight>
						<rarity>2</rarity>
						<isHidden>true</isHidden><!-- 该奖励在列表里被隐藏了 -->
					</li>
					<li>
						<thingDef>MeleeWeapon_MonoSword</thingDef>
						<quality>Legendary</quality>
						<count>1</count>
						<weight>1</weight>
						<rarity>5</rarity>
						<effecterDef>GiantExplosion</effecterDef>
					</li>
				</lootBoxThingDef>
			</li>
		</comps>
	</ThingDef>

	<ThingDef ParentName="SimpleLootBoxBase">
		<defName>SimpleLootBoxExampleB</defName>
		<label>simple loot box example B</label>
		<thingClass>ThingWithComps</thingClass>
		<description>Example B.</description>
		<graphicData>
			<texPath>SimpleLootBox/ExampleB</texPath>
			<graphicClass>Graphic_Single</graphicClass>
		</graphicData>
		<statBases>
			<Mass>1.0</Mass>
			<MarketValue>100</MarketValue>
		</statBases>
		<tradeability>Buyable</tradeability>
		<comps>
			<li Class="CompProperties_Usable">
				<useJob>UseArtifact</useJob>
				<useLabel>Activate {0_label}</useLabel>
				<showUseGizmo>true</showUseGizmo>
				<useDuration>100</useDuration>
			</li>
			<li Class="SimpleLootBox.CompProperties_SpawnLootBox">
				<lootBoxList>
					<li>
						<thingDef>SimpleLootBoxExampleB</thingDef>
						<chance>0.5</chance>
					</li>
				</lootBoxList>
			</li>
			<li Class="SimpleLootBox.CompProperties_LootBox">
				<lootBoxOpenSound>lootBoxOpenSound</lootBoxOpenSound>
				<lootBoxSpinningSound>lootBoxSpinningSound</lootBoxSpinningSound>
				<lootBoxBackgroundMusicSound>lootBoxBackgroundMusicSoundB</lootBoxBackgroundMusicSound>
				<lootBoxBackgroundTexturePath>SimpleLootBox/LootBoxBackgroundB</lootBoxBackgroundTexturePath>
				<lootBoxPawnKindDef>
					<li>
						<pawnKindDef>Mercenary_Gunner</pawnKindDef><!-- 箱子可以开出的人物的定义名 -->
						<count>2</count><!-- 该人物生成的数量 -->
						<weight>5</weight><!-- 这项奖励的生成权重 -->
						<isHostile>false</isHostile><!-- 生成的人物是否和玩家敌对，默认为false -->
						<lootBoxFinalizingRewardSound>lootBoxFinalizingRewardSound</lootBoxFinalizingRewardSound>
					</li>
					<li>
						<pawnKindDef>Baby_Example</pawnKindDef>
						<count>1</count>
						<weight>5</weight>
						<rarity>3</rarity>
					</li>
					<li>
						<pawnKindDef>Mech_Centurion</pawnKindDef>
						<count>1</count>
						<weight>5</weight>
						<rarity>4</rarity>
						<effecterDef>ExtinguisherExplosion</effecterDef>
					</li>
					<li>
						<pawnKindDef>Cat</pawnKindDef>
						<count>5</count>
						<weight>5</weight>
						<rarity>5</rarity>
						<isHostile>true</isHostile><!-- 生成的人物和玩家敌对 -->
					</li>
				</lootBoxPawnKindDef>
			</li>
		</comps>
	</ThingDef>

	<ThingDef ParentName="SimpleLootBoxBase">
		<defName>SimpleLootBoxExampleC</defName>
		<label>simple loot box example C</label>
		<thingClass>ThingWithComps</thingClass>
		<description>Example C.</description>
		<graphicData>
			<texPath>SimpleLootBox/ExampleC</texPath>
			<graphicClass>Graphic_Single</graphicClass>
		</graphicData>
		<statBases>
			<Mass>1.0</Mass>
			<MarketValue>100</MarketValue>
		</statBases>
		<tradeability>Buyable</tradeability>
		<comps>
			<li Class="CompProperties_Usable">
				<useJob>UseArtifact</useJob>
				<useLabel>Activate {0_label}</useLabel>
				<showUseGizmo>true</showUseGizmo>
				<useDuration>100</useDuration>
			</li>
			<li Class="SimpleLootBox.CompProperties_SpawnLootBox">
				<lootBoxList>
					<li>
						<thingDef>SimpleLootBoxExampleC</thingDef>
						<chance>0.5</chance>
					</li>
				</lootBoxList>
			</li>
			<li Class="SimpleLootBox.CompProperties_LootBox">
				<lootBoxOpenSound>lootBoxOpenSound</lootBoxOpenSound>
				<lootBoxSpinningSound>lootBoxSpinningSound</lootBoxSpinningSound>
				<lootBoxPawnKindDef><!-- 箱子开出的奖励可以混合人物和物品 -->
					<li>
						<pawnKindDef>Mercenary_Gunner</pawnKindDef>
						<count>2</count>
						<weight>5</weight>
					</li>
				</lootBoxPawnKindDef>
				<lootBoxThingDef><!-- 箱子开出的奖励可以混合人物和物品 -->
					<li>
						<thingDef>Silver</thingDef>
						<count>1000</count>
						<weight>5</weight>
						<rarity>2</rarity>
						<effecterDef>Skip_ExitNoDelay</effecterDef>
						<lootBoxFinalizingRewardSound>lootBoxFinalizingRewardSound</lootBoxFinalizingRewardSound>
					</li>
				</lootBoxThingDef>
			</li>
		</comps>
	</ThingDef>
	
</Defs>