daily pastebin goal
6%
SHARE
TWEET

Untitled

a guest Feb 21st, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. DLL file
  2.  
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using RimWorld;
  8. using UnityEngine;
  9. using Verse;
  10. using SK;
  11. using Rimefeller;
  12.  
  13. namespace Canasiphon
  14. { public class Class1 : CompFuelPump
  15.     { public override void CompTick()
  16.         { if (Gen.IsHashIntervalTick(this.parent, 60) && this.pipeNet.TotalFuel >= (float)this.Props.pumpRate && this.MapComp.UnderFuelLimit())
  17.             { Thing thing = this.storage.slotGroup.HeldThings.FirstOrDefault((Thing z) => z.def == ThingDefOfLocal.CrudeOil);
  18.                 if (thing == null)
  19.                 { this.pipeNet.PullFuel((float)this.Props.pumpRate); Thing thing2 = ThingMaker.MakeThing(ThingDefOfLocal.CrudeOil, null);
  20.                     thing2.stackCount = this.Props.pumpRate;
  21.                     GenPlace.TryPlaceThing(thing2, this.storage.Position, this.parent.Map, 0, null, null); return; }
  22.  
  23.                 if (thing.stackCount != thing.def.stackLimit) { int num = Mathf.Min(thing.def.stackLimit - thing.stackCount, this.Props.pumpRate); if (num > 0)
  24.                     { this.pipeNet.PullFuel((float)num); thing.stackCount += num; } } } } } }
  25.  
  26.  
  27. XML FILE
  28. <?xml version="1.0" encoding="utf-8"?>
  29. <Defs>
  30.   <ThingDef Name="ChemfuelHopperBase" ParentName="BuildingBase" Abstract="true">
  31.     <minifiedDef>MinifiedThing</minifiedDef>
  32.     <thingCategories>
  33.       <li>Oil</li>
  34.     </thingCategories>
  35.     <thingClass>Building_Storage</thingClass>
  36.     <graphicData>
  37.       <texPath>Things/Building/Production/Hopper</texPath>
  38.       <graphicClass>Graphic_Multi</graphicClass>
  39.       <damageData>
  40.         <rect>(0.05,0.1,0.9,0.9)</rect>
  41.         <cornerTL>Damage/Corner</cornerTL>
  42.         <cornerTR>Damage/Corner</cornerTR>
  43.       </damageData>
  44.     </graphicData>
  45.     <altitudeLayer>Building</altitudeLayer>
  46.     <passability>PassThroughOnly</passability>
  47.     <fillPercent>0.5</fillPercent>
  48.     <pathCost>70</pathCost>
  49.     <canOverlapZones>false</canOverlapZones>
  50.     <inspectorTabs>
  51.       <li>ITab_Storage</li>
  52.     </inspectorTabs>
  53.     <castEdgeShadows>true</castEdgeShadows>
  54.     <statBases>
  55.       <WorkToBuild>300</WorkToBuild>
  56.       <MaxHitPoints>100</MaxHitPoints>
  57.       <Flammability>4</Flammability>
  58.       <Mass>4</Mass>
  59.     </statBases>
  60.     <costList>
  61.       <Plasteel>15</Plasteel>
  62.     </costList>
  63.     <tickerType>Normal</tickerType>
  64.     <rotatable>false</rotatable>
  65.     <neverMultiSelect>true</neverMultiSelect>
  66.     <designationCategory>Rimefeller</designationCategory>
  67.     <surfaceType>Item</surfaceType>
  68.     <constructEffect>ConstructMetal</constructEffect>
  69.   </ThingDef>
  70.    
  71.   <ThingDef ParentName="ChemfuelHopperBase">
  72.     <defName>Crudeconvert</defName>
  73.     <label>CrudeOil Pump</label>
  74.     <description>Pumps Crudeoil from CrudeOil storage tanks into usable/sellable cans.</description>
  75.     <graphicData>
  76.       <texPath>Rimefeller/Things/Building/fuelpump</texPath>
  77.       <graphicClass>Graphic_Single</graphicClass>
  78.       <drawSize>(1,1)</drawSize>
  79.     </graphicData>
  80.     <building>
  81.       <fixedStorageSettings>
  82.         <priority>Important</priority>
  83.         <filter>
  84.           <thingDefs>
  85.             <li>CrudeOil</li>
  86.           </thingDefs>
  87.         </filter>
  88.       </fixedStorageSettings>
  89.       <defaultStorageSettings>
  90.         <filter>
  91.           <thingDefs>
  92.             <li>CrudeOil</li>
  93.           </thingDefs>
  94.         </filter>
  95.       </defaultStorageSettings>
  96.     </building>
  97.     <comps>
  98.       <li Class="Rimefeller.CompProperties_FuelPump">
  99.         <compClass>Canadus.Canasiphon</compClass>
  100.     <pumpRate>25</pumpRate>
  101.       </li>
  102.       <li Class="CompProperties_Power">
  103.         <compClass>CompPowerTrader</compClass>
  104.         <basePowerConsumption>50</basePowerConsumption>
  105.       </li>
  106.       <li Class="CompProperties_Flickable"/>
  107.       <li Class="CompProperties_Breakdownable"/>
  108.     </comps>
  109.     <researchPrerequisites>
  110.       <li>ChemfuelRefining</li>
  111.     </researchPrerequisites>
  112.   </ThingDef>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top