Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DLL file
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using RimWorld;
- using UnityEngine;
- using Verse;
- using SK;
- using Rimefeller;
- namespace Canasiphon
- { public class Class1 : CompFuelPump
- { public override void CompTick()
- { if (Gen.IsHashIntervalTick(this.parent, 60) && this.pipeNet.TotalFuel >= (float)this.Props.pumpRate && this.MapComp.UnderFuelLimit())
- { Thing thing = this.storage.slotGroup.HeldThings.FirstOrDefault((Thing z) => z.def == ThingDefOfLocal.CrudeOil);
- if (thing == null)
- { this.pipeNet.PullFuel((float)this.Props.pumpRate); Thing thing2 = ThingMaker.MakeThing(ThingDefOfLocal.CrudeOil, null);
- thing2.stackCount = this.Props.pumpRate;
- GenPlace.TryPlaceThing(thing2, this.storage.Position, this.parent.Map, 0, null, null); return; }
- if (thing.stackCount != thing.def.stackLimit) { int num = Mathf.Min(thing.def.stackLimit - thing.stackCount, this.Props.pumpRate); if (num > 0)
- { this.pipeNet.PullFuel((float)num); thing.stackCount += num; } } } } } }
- XML FILE
- <?xml version="1.0" encoding="utf-8"?>
- <Defs>
- <ThingDef Name="ChemfuelHopperBase" ParentName="BuildingBase" Abstract="true">
- <minifiedDef>MinifiedThing</minifiedDef>
- <thingCategories>
- <li>Oil</li>
- </thingCategories>
- <thingClass>Building_Storage</thingClass>
- <graphicData>
- <texPath>Things/Building/Production/Hopper</texPath>
- <graphicClass>Graphic_Multi</graphicClass>
- <damageData>
- <rect>(0.05,0.1,0.9,0.9)</rect>
- <cornerTL>Damage/Corner</cornerTL>
- <cornerTR>Damage/Corner</cornerTR>
- </damageData>
- </graphicData>
- <altitudeLayer>Building</altitudeLayer>
- <passability>PassThroughOnly</passability>
- <fillPercent>0.5</fillPercent>
- <pathCost>70</pathCost>
- <canOverlapZones>false</canOverlapZones>
- <inspectorTabs>
- <li>ITab_Storage</li>
- </inspectorTabs>
- <castEdgeShadows>true</castEdgeShadows>
- <statBases>
- <WorkToBuild>300</WorkToBuild>
- <MaxHitPoints>100</MaxHitPoints>
- <Flammability>4</Flammability>
- <Mass>4</Mass>
- </statBases>
- <costList>
- <Plasteel>15</Plasteel>
- </costList>
- <tickerType>Normal</tickerType>
- <rotatable>false</rotatable>
- <neverMultiSelect>true</neverMultiSelect>
- <designationCategory>Rimefeller</designationCategory>
- <surfaceType>Item</surfaceType>
- <constructEffect>ConstructMetal</constructEffect>
- </ThingDef>
- <ThingDef ParentName="ChemfuelHopperBase">
- <defName>Crudeconvert</defName>
- <label>CrudeOil Pump</label>
- <description>Pumps Crudeoil from CrudeOil storage tanks into usable/sellable cans.</description>
- <graphicData>
- <texPath>Rimefeller/Things/Building/fuelpump</texPath>
- <graphicClass>Graphic_Single</graphicClass>
- <drawSize>(1,1)</drawSize>
- </graphicData>
- <building>
- <fixedStorageSettings>
- <priority>Important</priority>
- <filter>
- <thingDefs>
- <li>CrudeOil</li>
- </thingDefs>
- </filter>
- </fixedStorageSettings>
- <defaultStorageSettings>
- <filter>
- <thingDefs>
- <li>CrudeOil</li>
- </thingDefs>
- </filter>
- </defaultStorageSettings>
- </building>
- <comps>
- <li Class="Rimefeller.CompProperties_FuelPump">
- <compClass>Canadus.Canasiphon</compClass>
- <pumpRate>25</pumpRate>
- </li>
- <li Class="CompProperties_Power">
- <compClass>CompPowerTrader</compClass>
- <basePowerConsumption>50</basePowerConsumption>
- </li>
- <li Class="CompProperties_Flickable"/>
- <li Class="CompProperties_Breakdownable"/>
- </comps>
- <researchPrerequisites>
- <li>ChemfuelRefining</li>
- </researchPrerequisites>
- </ThingDef>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement