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

  <!-- Note that this ThingSetMakerDef is used by the standard rewards generator
       It's also used directly by various quest generators -->
  <ThingSetMakerDef>
    <defName>WMH_Reward_Monster</defName>
    <debugParams> <!-- debug only! -->
      <totalMarketValueRange>2500~5000</totalMarketValueRange>
    </debugParams>
    <root Class="ThingSetMaker_RandomOption">
      <options>

        <!-- Note: Weights must be balanced against the number of items in each category -->

        <!-- Three tiers of misc items, with different preference levels --> 
        <li>
          <weight>4</weight>
          <thingSetMaker Class="ThingSetMaker_MarketValue">
            <fixedParams>
              <qualityGenerator>Reward</qualityGenerator>
              <filter>
                <thingSetMakerTagsToAllow>
                  <li>RewardStandardHighFreq</li>
                </thingSetMakerTagsToAllow>
              </filter>
            </fixedParams>
          </thingSetMaker>
        </li>
        <li>
          <weight>2</weight>
          <thingSetMaker Class="ThingSetMaker_MarketValue">
            <fixedParams>
              <qualityGenerator>Reward</qualityGenerator>
              <filter>
                <thingSetMakerTagsToAllow>
                  <li>RewardStandardMidFreq</li>
                </thingSetMakerTagsToAllow>
              </filter>
            </fixedParams>
          </thingSetMaker>
        </li>
        <li>
          <weight>1</weight>
          <thingSetMaker Class="ThingSetMaker_MarketValue">
            <fixedParams>
              <qualityGenerator>Reward</qualityGenerator>
              <filter>
                <thingSetMakerTagsToAllow>
                  <li>RewardStandardLowFreq</li>
                </thingSetMakerTagsToAllow>
              </filter>
            </fixedParams>
          </thingSetMaker>
        </li>

        <!-- Normal items, but in masterwork/legendary quality -->
        <li>
          <weight>1.5</weight>
          <thingSetMaker Class="ThingSetMaker_MarketValue">
            <fixedParams>
              <qualityGenerator>Super</qualityGenerator>
              <filter>
                <thingSetMakerTagsToAllow>
                  <li>RewardStandardQualitySuper</li>
                </thingSetMakerTagsToAllow>
              </filter>
            </fixedParams>
          </thingSetMaker>
        </li>

        <!-- Techprints -->
        <li>
          <weight>1</weight>
          <thingSetMaker Class="ThingSetMaker_Techprints">
            <marketValueFactor>1.4</marketValueFactor>
          </thingSetMaker>
        </li>

        <!-- High-value raw resources. Generally plasteel, gold, etc. -->
        <li>
          <weight>0.5</weight>
          <thingSetMaker Class="ThingSetMaker_MarketValue">
            <fixedParams>
              <filter>
                <categories>
                  <li>ResourcesRaw</li>
                </categories>
                <disallowCheaperThan>7</disallowCheaperThan>
                <thingSetMakerTagsToDisallow>
                  <li>RewardStandardHighFreq</li>
                </thingSetMakerTagsToDisallow>
              </filter>
            </fixedParams>
          </thingSetMaker>
        </li>

      

        <!-- Special anti-Empire items -->
        <!-- If you're enemy of Empire, you don't have normal access to some special items, so 
             we increase the probability of getting them. -->
        <li>
          <weight>12</weight> 
          <thingSetMaker Class="ThingSetMaker_Conditional_FactionRelation">
            <factionDef MayRequire="Ludeon.RimWorld.Royalty">Empire</factionDef>
            <allowHostile>true</allowHostile>
            <thingSetMaker Class="ThingSetMaker_MarketValue">
              <fixedParams>
                <filter>
                  <thingDefs>
                    <li MayRequire="Ludeon.RimWorld.Royalty">PsychicAmplifier</li>
                  </thingDefs>
                </filter>
              </fixedParams>
            </thingSetMaker>
          </thingSetMaker>
        </li>
        <li>
          <weight>2</weight> 
          <thingSetMaker Class="ThingSetMaker_Conditional_FactionRelation">
            <factionDef MayRequire="Ludeon.RimWorld.Royalty">Empire</factionDef>
            <allowHostile>true</allowHostile>
            <thingSetMaker Class="ThingSetMaker_MarketValue">
              <fixedParams>
                <filter>
                  <thingDefs>
                    <li MayRequire="Ludeon.RimWorld.Royalty">PsychicSilencer</li>
                  </thingDefs>
                </filter>
              </fixedParams>
            </thingSetMaker>
          </thingSetMaker>
        </li>



        <!-- Special royal items -->
        <!-- Most factions can't make these, so if we're using a faction that can we want
             the probability of using them to be high. In addition, Empire usually gives
             royal favor so if they're giving items we want it to be one of their special
             items. -->
        <li>
          <weight>20</weight> 
          <thingSetMaker Class="ThingSetMaker_Conditional_MakingFaction">
            <makingFaction MayRequire="Ludeon.RimWorld.Royalty">Empire</makingFaction>
            <requireNonNull>true</requireNonNull>
            <thingSetMaker Class="ThingSetMaker_MarketValue">
              <fixedParams>
                <qualityGenerator>Reward</qualityGenerator>
                <filter>
                  <thingSetMakerTagsToAllow>
                    <li>ImplantEmpireRoyal</li>
                    <li>WeaponBladelink</li>
                  </thingSetMakerTagsToAllow>
                  <thingSetMakerTagsToDisallow>
                    <li>RewardNonEmpireFactionsOnly</li>
                  </thingSetMakerTagsToDisallow>
                  <tradeTagsToAllow>
                    <li>PsychicWeapon</li>
                    <li>PsychicApparel</li>
                  </tradeTagsToAllow>
                </filter>
              </fixedParams>
            </thingSetMaker>
          </thingSetMaker>
        </li>

      </options>
    </root>
  </ThingSetMakerDef>

</Defs>

