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

  <ThingDef ParentName="MSI_MakeableDrugBase">
    <defName>SmokeleafHash</defName>
    <label>smokeleaf hash</label>
    <description>Smokeleaf hash is teh original concentrated form of smokeleaf. It is made from the resin collected from the buds.  While not physically addictive, users may still develop a psychological dependence.</description>
    <graphicData>
  		<texPath>Things/Items/MSI_hash</texPath>
  		<graphicClass>Graphic_StackCount</graphicClass>
    </graphicData>
    <rotatable>false</rotatable>
    <statBases>
  		<WorkToMake>500</WorkToMake>
  		<MarketValue>12</MarketValue>
  		<Mass>0.05</Mass>
  		<DeteriorationRate>6</DeteriorationRate>
    </statBases>
    <techLevel>Industrial</techLevel>
    <ingestible>
  		<foodType>Plant, Processed</foodType>
  		<joy>0.85</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>HashHigh</hediffDef>
  				<severity>0.5</severity>
  				<toleranceChemical>Hash</toleranceChemical>
  			</li>
  			<li Class="IngestionOutcomeDoer_OffsetNeed">
  				<need>Rest</need>
  				<offset>-0.15</offset>
  			</li>
  			<li Class="IngestionOutcomeDoer_GiveHediff">
  				<hediffDef>HashTolerance</hediffDef>
  				<severity>0.03</severity>
  				<divideByBodySize>true</divideByBodySize>
  			</li>
  		</outcomeDoers>
    </ingestible>
    <recipeMaker>
  		<researchPrerequisite>IndustrialSmokeleafCultivation</researchPrerequisite>
  		<recipeUsers>
  			<li>PoweredCultivationBench</li>
  		</recipeUsers>
    </recipeMaker>
    <costList>
		  <SmokeleafBuds>8</SmokeleafBuds>
    </costList>
    <comps>
		<li Class="CompProperties_Drug">
			<chemical>Hash</chemical>
			<addictiveness>0.015</addictiveness>
			<minToleranceToAddict>0.15</minToleranceToAddict>
			<existingAddictionSeverityOffset>0.06</existingAddictionSeverityOffset>
			<needLevelOffset>1</needLevelOffset>
			<listOrder>15</listOrder>
      </li>
    </comps>
  </ThingDef>

  <HediffDef>
    <defName>HashHigh</defName>
    <hediffClass>HediffWithComps</hediffClass>
    <label>ripped on hash</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>1.2</hungerRateFactor>
          <painOffset>-0.3</painOffset>
          <capMods>
            <li>
              <capacity>Consciousness</capacity>
              <offset>-0.2</offset>
            </li>
            <li>
              <capacity>Moving</capacity>
              <offset>-0.15</offset>
            </li>
          </capMods>
        </li>
    </stages>
  </HediffDef>
  
  <ThoughtDef>
    <defName>HashHigh</defName>
    <workerClass>ThoughtWorker_Hediff</workerClass>
    <hediff>HashHigh</hediff>
    <validWhileDespawned>true</validWhileDespawned>
    <stages>
      <li>
        <label>high on hash</label>
        <description>It's a little harsh, but it gets me wrecked.</description>
        <baseMoodEffect>20</baseMoodEffect>
      </li>
    </stages>
  </ThoughtDef>

  <!--=== Hash addiction ===-->

  <ChemicalDef>
    <defName>Hash</defName>
    <label>Hash</label>
    <addictionHediff>HashAddiction</addictionHediff>
    <toleranceHediff>HashTolerance</toleranceHediff>
	<onGeneratedAddictedToleranceChance>0.8</onGeneratedAddictedToleranceChance>
  </ChemicalDef>

  <NeedDef ParentName="MSI_DrugAddictionNeedBase">
    <defName>Chemical_Hash</defName>
    <needClass>Need_Chemical</needClass>
    <label>hash</label>
    <description>Because of a developed Hash dependence, this person needs to regularly consume the drug to avoid withdrawal symptoms.</description>
    <listPriority>25</listPriority>
  </NeedDef>
  
  <HediffDef ParentName="MSI_DrugToleranceBase">
    <defName>HashTolerance</defName>
    <label>Hash tolerance</label>
    <comps>
      <li Class="HediffCompProperties_SeverityPerDay">
        <severityPerDay>-0.0666</severityPerDay>
      </li>
      <li Class="HediffCompProperties_DrugEffectFactor">
        <chemical>Hash</chemical>
      </li>
    </comps>
		<hediffGivers>
			<li Class="HediffGiver_RandomDrugEffect">
				<hediff>Asthma</hediff>
				<baseMtbDays>180</baseMtbDays>
				<minSeverity>0.5</minSeverity>
				<partsToAffect>
					<li>LeftLung</li>
					<li>RightLung</li>
				</partsToAffect>
				<countToAffect>2</countToAffect>
			</li>
			<li Class="HediffGiver_RandomDrugEffect">
				<hediff>Carcinoma</hediff>
				<baseMtbDays>180</baseMtbDays>
				<minSeverity>0.40</minSeverity>
				<partsToAffect>
					<li>LeftLung</li>
					<li>RightLung</li>
				</partsToAffect>
				<countToAffect>1</countToAffect>
			</li>
		</hediffGivers>
	</HediffDef>

  <HediffDef ParentName="MSI_AddictionBase">
    <defName>HashAddiction</defName>
    <hediffClass>Hediff_Addiction</hediffClass>
    <label>Hash dependence</label>
    <causesNeed>Chemical_Hash</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.2</offset>
			  </li>
			  <li>
				<capacity>Moving</capacity>
				<offset>-0.2</offset>
			  </li>
			</capMods>
			<mentalStateGivers>
				<li>
					<mentalState>BingingFood</mentalState>
					<mtbDays>20</mtbDays>
				</li>
				<li>
					<mentalState>BingingDrugMajor</mentalState>
					<mtbDays>30</mtbDays>
				</li>
			</mentalStateGivers>
      </li>
    </stages>
  </HediffDef>

  <ThoughtDef>
    <defName>HashWithdrawal</defName>
    <workerClass>ThoughtWorker_Hediff</workerClass>
    <hediff>HashAddiction</hediff>
    <validWhileDespawned>true</validWhileDespawned>
    <stages>
      <li>
        <visible>false</visible>
      </li>
      <li>
        <label>Hash withdrawal</label>
        <description>This place is so boring, some more hash would be nice..</description>
        <baseMoodEffect>-15</baseMoodEffect>
      </li>
    </stages>
  </ThoughtDef>

</Defs>