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

  <ThingDef ParentName="MSI_MakeableDrugBase">
    <defName>SmokeleafDistillate</defName>
    <label>smokeleaf distillate</label>
    <description>Smokeleaf distillate is the ultimate extract. Gives a clean high without the risks of other smokeleaf products. While not physically addictive, users may still develop a psychological dependence.</description>
    <graphicData>
  		<texPath>Things/Items/MSI_distillate</texPath>
  		<graphicClass>Graphic_StackCount</graphicClass>
    </graphicData>
    <rotatable>false</rotatable>
    <statBases>
  		<WorkToMake>750</WorkToMake>
  		<MarketValue>36</MarketValue>
  		<Mass>0.05</Mass>
  		<DeteriorationRate>6</DeteriorationRate>
    </statBases>
    <techLevel>Spacer</techLevel>
    <ingestible>
  		<foodType>Plant, Processed</foodType>
  		<joy>0.9</joy>
  		<ingestHoldOffsetStanding>
  			<northDefault>
  				<offset>(0.27,0,0.08)</offset>
  				<behind>true</behind>
  			</northDefault>
  			<east>
  				<offset>(0.45,0,0.08)</offset>
  			</east>
  			<south>
  				<offset>(0.27,0,0.08)</offset>
  			</south>
  			<west>
  				<offset>(-0.50,0,0.08)</offset>
  				<flip>false</flip>
  			</west>
  		</ingestHoldOffsetStanding>
  		<outcomeDoers>
  			<li Class="IngestionOutcomeDoer_GiveHediff">
  				<hediffDef>SmokeleafDistillateHigh</hediffDef>
  				<severity>0.75</severity>
  				<toleranceChemical>SmokeleafDistillate</toleranceChemical>
  			</li>
  			<li Class="IngestionOutcomeDoer_OffsetNeed">
  				<need>Rest</need>
  				<offset>-0.15</offset>
  			</li>
  			<li Class="IngestionOutcomeDoer_GiveHediff">
  				<hediffDef>SmokeleafDistillateTolerance</hediffDef>
  				<severity>0.03</severity>
  				<divideByBodySize>true</divideByBodySize>
  			</li>
      </outcomeDoers>
    </ingestible>
    <recipeMaker>
  		<researchPrerequisite>SmokeleafPharmacology</researchPrerequisite>
  		<recipeUsers>
  			<li>MedicinalsLab</li>
  		</recipeUsers>
    </recipeMaker>
    <costList>
		  <SmokeleafBuds>15</SmokeleafBuds>
      <Neutroamine>1</Neutroamine>
    </costList>
    <comps>
		<li Class="CompProperties_Drug">
			<chemical>SmokeleafDistillate</chemical>
			<addictiveness>0.005</addictiveness>
			<minToleranceToAddict>0.5</minToleranceToAddict>
			<existingAddictionSeverityOffset>0.02</existingAddictionSeverityOffset>
			<needLevelOffset>1</needLevelOffset>
			<listOrder>5</listOrder>
		</li>
    </comps>
  </ThingDef>

  <HediffDef>
    <defName>SmokeleafDistillateHigh</defName>
    <hediffClass>HediffWithComps</hediffClass>
    <label>lit on distillate</label>
    <defaultLabelColor>(1,0,0.5)</defaultLabelColor>
    <scenarioCanAdd>true</scenarioCanAdd>
    <maxSeverity>1.0</maxSeverity>
    <comps>
      <li Class="HediffCompProperties_Effecter">
        <stateEffecter>High</stateEffecter>
        <severityIndices>
          <min>1</min>
          <max>5</max>
        </severityIndices>
      </li>
      <li Class="HediffCompProperties_SeverityPerDay">
        <severityPerDay>-2.0</severityPerDay>
      </li>
    </comps>
    <stages>
        <li>
          <hungerRateFactor>0.9</hungerRateFactor>
          <painOffset>-0.35</painOffset>
          <capMods>
            <li>
              <capacity>Consciousness</capacity>
              <offset>-0.1</offset>
            </li>
            <li>
              <capacity>Moving</capacity>
              <offset>-0.05</offset>
            </li>
            <li>
              <capacity>Manipulation</capacity>
              <offset>-0.05</offset>
            </li>
          </capMods>
        </li>
    </stages>
  </HediffDef>
  
  <ThoughtDef>
    <defName>SmokeleafDistillateHigh</defName>
    <workerClass>ThoughtWorker_Hediff</workerClass>
    <hediff>SmokeleafDistillateHigh</hediff>
    <validWhileDespawned>true</validWhileDespawned>
    <stages>
      <li>
        <label>veerrry high on distillate</label>
        <description>Holy shit.</description>
        <baseMoodEffect>30</baseMoodEffect>
      </li>
    </stages>
  </ThoughtDef>

  <!--=== Smokeleaf distillate addiction ===-->

  <ChemicalDef>
    <defName>SmokeleafDistillate</defName>
    <label>smokeleaf distillate</label>
    <addictionHediff>SmokeleafDistillateAddiction</addictionHediff>
    <toleranceHediff>SmokeleafDistillateTolerance</toleranceHediff>
		<onGeneratedAddictedToleranceChance>0.8</onGeneratedAddictedToleranceChance>
	</ChemicalDef>

  <NeedDef ParentName="MSI_DrugAddictionNeedBase">
    <defName>Chemical_SmokeleafDistillate</defName>
    <needClass>Need_Chemical</needClass>
    <label>smokeleaf distillate</label>
    <description>Because of a developed distillate dependence, this person needs to regularly consume the drug to avoid withdrawal symptoms.</description>
    <listPriority>25</listPriority>
  </NeedDef>
  
  <HediffDef ParentName="MSI_DrugToleranceBase">
    <defName>SmokeleafDistillateTolerance</defName>
    <label>smokeleaf distillate tolerance</label>
    <comps>
      <li Class="HediffCompProperties_SeverityPerDay">
        <severityPerDay>-0.0666</severityPerDay>
      </li>
      <li Class="HediffCompProperties_DrugEffectFactor">
        <chemical>SmokeleafDistillate</chemical>
      </li>
    </comps>
  </HediffDef>

  <HediffDef ParentName="MSI_AddictionBase">
    <defName>SmokeleafDistillateAddiction</defName>
    <hediffClass>Hediff_Addiction</hediffClass>
    <label>smokeleaf distillate dependence</label>
    <causesNeed>Chemical_SmokeleafDistillate</causesNeed>
    <comps>
      <li Class="HediffCompProperties_SeverityPerDay">
        <severityPerDay>-0.0333</severityPerDay>
      </li>
    </comps>
    <stages>
      <li>
      </li>
      <li>
        <label>withdrawal</label>
        <capMods>
          <li>
            <capacity>Consciousness</capacity>
            <offset>-0.05</offset>
          </li>
          <li>
            <capacity>Moving</capacity>
            <offset>-0.05</offset>
          </li>
        </capMods>
		<mentalStateGivers>
			<li>
				<mentalState>WanderOwnRoom</mentalState>
				<mtbDays>60</mtbDays>
			</li>
			<li>
				<mentalState>BingingDrugMajor</mentalState>
				<mtbDays>50</mtbDays>
			</li>
		</mentalStateGivers>
      </li>
    </stages>
  </HediffDef>

  <ThoughtDef>
    <defName>SmokeleafDistillateWithdrawal</defName>
    <workerClass>ThoughtWorker_Hediff</workerClass>
    <hediff>SmokeleafDistillateAddiction</hediff>
    <validWhileDespawned>true</validWhileDespawned>
    <stages>
      <li>
        <visible>false</visible>
      </li>
      <li>
        <label>smokeleaf distillate withdrawal</label>
        <description>Waiting for the man...as usual...</description>
        <baseMoodEffect>-5</baseMoodEffect>
      </li>
    </stages>
  </ThoughtDef>

</Defs>