Skip to content

Commit

Permalink
Merge pull request #8 from DestinyPlayer/indev
Browse files Browse the repository at this point in the history
Indev
  • Loading branch information
DestinyPlayer authored Jun 28, 2023
2 parents 4b2c88a + 3b5e565 commit 84c2255
Show file tree
Hide file tree
Showing 20 changed files with 245 additions and 17 deletions.
16 changes: 8 additions & 8 deletions 1.4/Defs/RecipeDefs/GeneForge_Recipes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Defs>
<RecipeDef>
<defName>ForgeGenePack</defName>
<label>forge genepack</label>
<label>forge genepack (1gs)</label>
<recipeUsers>
<li>GeneSlurryForge</li>
</recipeUsers>
Expand Down Expand Up @@ -34,7 +34,7 @@
</RecipeDef>
<RecipeDef MayRequire="wvc.sergkart.races.biotech">
<defName>ForgeWVCGenePack</defName>
<label>forge wvc genepack</label>
<label>forge wvc genepack (1gs)</label>
<recipeUsers>
<li>GeneSlurryForge</li>
</recipeUsers>
Expand Down Expand Up @@ -67,7 +67,7 @@

<RecipeDef MayRequire="sarg.alphagenes">
<defName>ForgeAlphaGenePack</defName>
<label>forge alphapack</label>
<label>forge alphapack (1gs)</label>
<recipeUsers>
<li>GeneSlurryForge</li>
</recipeUsers>
Expand Down Expand Up @@ -100,7 +100,7 @@

<RecipeDef>
<defName>ForgeArchiteGenePack</defName>
<label>forge archite genepack</label>
<label>forge archite genepack (2gs)</label>
<recipeUsers>
<li>GeneSlurryForge</li>
</recipeUsers>
Expand Down Expand Up @@ -141,7 +141,7 @@

<RecipeDef>
<defName>ForgeHemoGenePack</defName>
<label>forge hemo genepack</label>
<label>forge hemo genepack (2gs)</label>
<recipeUsers>
<li>GeneSlurryForge</li>
</recipeUsers>
Expand Down Expand Up @@ -182,7 +182,7 @@

<RecipeDef>
<defName>ForgeAbilityGenePack</defName>
<label>forge ability genepack</label>
<label>forge ability genepack (2gs)</label>
<recipeUsers>
<li>GeneSlurryForge</li>
</recipeUsers>
Expand Down Expand Up @@ -223,7 +223,7 @@

<RecipeDef MayRequire="sarg.alphagenes">
<defName>ForgeMechanitorGenePack</defName>
<label>forge mechanitor genepack</label>
<label>forge mechanitor genepack (2gs)</label>
<recipeUsers>
<li>GeneSlurryForge</li>
</recipeUsers>
Expand Down Expand Up @@ -264,7 +264,7 @@

<RecipeDef MayRequire="phonicmas.biotechexpansionwarhammer40k">
<defName>ForgeWarhammerGenePack</defName>
<label>forge gene seed genepack</label>
<label>forge gene seed genepack (2gs)</label>
<recipeUsers>
<li>GeneSlurryForge</li>
</recipeUsers>
Expand Down
98 changes: 91 additions & 7 deletions 1.4/Defs/ThingDefs_Buildings/GeneForge_Buildings_Production.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<ThingDef ParentName="FurnitureBase">
<defName>GF_GeneSlurryExtractorCorpse</defName>
<label>gene slurry extractor</label>
<description>This apparatus extracts Genetic Slurry from humanoid corpses, genepacks and humanoid meat.</description>
<description>This apparatus extracts Genetic Slurry from humanoid corpses and humanoid meat.\n\n(To switch what you use to extract genetic slurry from, press the button in the UI.)</description>
<thingClass>Building_Storage</thingClass>
<graphicData>
<texPath>Things/Building/GeneSlurryExtractor</texPath>
Expand Down Expand Up @@ -48,6 +48,7 @@
<disallowedCategories>
<li>CorpsesMechanoid</li>
<li>CorpsesAnimal</li>
<li MayRequire="erdelf.humanoidalienraces">alienCorpseCategory</li>
</disallowedCategories>
</filter>
</fixedStorageSettings>
Expand All @@ -56,8 +57,8 @@
<filter>
<disallowNotEverStorable>true</disallowNotEverStorable>
<specialFiltersToAllow>
<li>AllowCorpsesColonist</li>
<li>AllowCorpsesStranger</li>
<li>AllowCorpsesSlave</li>
</specialFiltersToAllow>
</filter>
</defaultStorageSettings>
Expand All @@ -81,18 +82,101 @@
</li>
<li Class="CompProperties_Flickable"/>
<li Class="CompPropertiesSwapBuilding_GF">
<buttonName>Mode: Corpses</buttonName>
<buttonDescription>The Extractor is currently set to consume humanoid corpses. Click to switch to consuming humanoid meat.</buttonDescription>
<buildingSwap>GF_GeneSlurryExtractorMeat</buildingSwap>
<buttonName>Mode: Human Corpses</buttonName>
<buttonDescription>[HUMAN CORPSES] [alien corpses] [human meat]\nThe Extractor is currently set to consume human corpses. Click to switch to consuming alien corpses [HAR].</buttonDescription>
<buildingSwap>GF_GeneSlurryExtractorAlien</buildingSwap>
<uiIconPath>Things/UI/GeneExtractorCorpse</uiIconPath>
</li>
</comps>
</ThingDef>

<ThingDef ParentName="FurnitureBase">
<defName>GF_GeneSlurryExtractorAlien</defName>
<label>gene slurry extractor</label>
<description>This apparatus extracts Genetic Slurry from humanoid corpses and humanoid meat.\n\n(To switch what you use to extract genetic slurry from, press the button in the UI.)</description>
<thingClass>Building_Storage</thingClass>
<graphicData>
<texPath>Things/Building/GeneSlurryExtractor</texPath>
<graphicClass>Graphic_Single</graphicClass>
<allowFlip>false</allowFlip>
</graphicData>
<rotatable>false</rotatable>
<altitudeLayer>BuildingOnTop</altitudeLayer>
<!-- <altitudeLayer>Building</altitudeLayer> -->
<passability>Standable</passability>
<!-- <passability>PassThroughOnly</passability> -->
<fillPercent>0.5</fillPercent>
<castEdgeShadows>true</castEdgeShadows>
<pathCost>50</pathCost>
<statBases>
<MaxHitPoints>100</MaxHitPoints>
<Mass>8</Mass>
<WorkToBuild>600</WorkToBuild>
<Flammability>1.0</Flammability>
<Beauty>0.5</Beauty>
</statBases>
<building>
<preventDeteriorationOnTop>true</preventDeteriorationOnTop>
<ignoreStoredThingsBeauty>true</ignoreStoredThingsBeauty>
<fixedStorageSettings>
<filter>
<disallowNotEverStorable>true</disallowNotEverStorable>
<categories>
<li MayRequire="erdelf.humanoidalienraces">CorpsesHumanlike</li>
</categories>
<disallowedThingDefs>
<li>Corpse_Human</li>
</disallowedThingDefs>
<specialFiltersToDisallow>
<li>AllowRotten</li>
</specialFiltersToDisallow>
<disallowedCategories>
<li>CorpsesMechanoid</li>
<li>CorpsesAnimal</li>
</disallowedCategories>
</filter>
</fixedStorageSettings>
<defaultStorageSettings>
<priority>Important</priority>
<filter>
<disallowNotEverStorable>true</disallowNotEverStorable>
<specialFiltersToAllow>
<li>AllowCorpsesStranger</li>
<li>AllowCorpsesSlave</li>
</specialFiltersToAllow>
</filter>
</defaultStorageSettings>
</building>
<inspectorTabs>
<li>ITab_Storage</li>
</inspectorTabs>
<staticSunShadowHeight>0.5</staticSunShadowHeight>
<surfaceType>Item</surfaceType>
<canOverlapZones>false</canOverlapZones>
<comps>
<li MayRequire="erdelf.humanoidalienraces" Class="PipeSystem.CompProperties_ConvertThingToResource">
<pipeNet>GF_GeneSlurryNet</pipeNet>
<category>alienCorpseCategory</category>
<ratio>1</ratio>
</li>
<li Class="CompProperties_Power">
<compClass>CompPowerTrader</compClass>
<basePowerConsumption>100</basePowerConsumption>
</li>
<li Class="CompProperties_Flickable"/>
<li Class="CompPropertiesSwapBuilding_GF">
<buttonName>Mode: Alien Corpses [HAR]</buttonName>
<buttonDescription>[human corpses] [ALIEN CORPSES] [human meat]\nThe Extractor is currently set to consume alien corpses [HAR]. Click to switch to consuming human meat.</buttonDescription>
<buildingSwap>GF_GeneSlurryExtractorMeat</buildingSwap>
<uiIconPath>Things/UI/GeneExtractorAlien</uiIconPath>
</li>
</comps>
</ThingDef>-->

<ThingDef ParentName="FurnitureBase">
<defName>GF_GeneSlurryExtractorMeat</defName>
<label>gene slurry extractor</label>
<description>This apparatus extracts Genetic Slurry from humanoid corpses, genepacks and humanoid meat.</description>
<description>This apparatus extracts Genetic Slurry from humanoid corpses and humanoid meat.\n\n(To switch what you use to extract genetic slurry from, press the button in the UI.)</description>
<thingClass>Building_Storage</thingClass>
<graphicData>
<texPath>Things/Building/GeneSlurryExtractor</texPath>
Expand Down Expand Up @@ -157,7 +241,7 @@
<li Class="CompProperties_Flickable"/>
<li Class="CompPropertiesSwapBuilding_GF">
<buttonName>Mode: Meat</buttonName>
<buttonDescription>The Extractor is currently set to consume humanoid meat. Click to switch to consuming corpses.</buttonDescription>
<buttonDescription>[human corpses] [alien corpses] [HUMAN MEAT]\nThe Extractor is currently set to consume human meat. Click to switch to consuming corpses.</buttonDescription>
<buildingSwap>GF_GeneSlurryExtractorCorpse</buildingSwap>
<uiIconPath>Things/UI/GeneExtractorMeat</uiIconPath>
</li>
Expand Down
2 changes: 1 addition & 1 deletion 1.4/Defs/ThingDefs_Items/GeneSlurry_Items.xml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
</descriptionHyperlinks>
</ThingDef>

<ThingDef ParentName="GeneSetHolderBase" MayRequire="sarg.alphagenes">
<ThingDef ParentName="GeneSetHolderBase" MayRequire="phonicmas.biotechexpansionwarhammer40k">
<defName>GF_BEWH_WarhammerGenepack</defName>
<label>geneforged gene seed genepack</label>
<description>A small capsule containing a package of genetic information. To use a genepack, it must be placed in a gene bank near a gene assembler and combined into an implantable xenogerm.\n\nIf not kept in a powered gene bank, this genepack will slowly deteriorate.\n\nThis genepack has been deliberately Geneforged in order to produce a gene seed gene.\n\nNot approved by the Adeptus Mechanicus.</description>
Expand Down
Binary file modified Assemblies/CategoricGenepacks.dll
Binary file not shown.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ So I made this.

## CHANGELOG

- Version 1.4: Added compatibility for Humanoid Alien Races, fixed some bugs, added some extra information to the Gene Forge.
- Version 1.3.1: Removed that facility. I really cannot get it to work how I want it to to save my life.
- Version 1.3: Added a facility that's necessary for producing category-filtered genepacks.
- Version 1.2: Some research changes, plus compatibility for Warhammer 40k Genes and Psycasts.
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Source/CategoricGenepacks/.vs/CategoricGenepacks/v17/.suo
Binary file not shown.
18 changes: 18 additions & 0 deletions Source/CategoricGenepacks/CategoricGenepacks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,22 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="0Harmony">
<HintPath>..\..\..\..\..\..\workshop\content\294100\2009463077\Current\Assemblies\0Harmony.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="AlienRace">
<HintPath>..\..\..\..\..\..\workshop\content\294100\839005762\Assemblies\AlienRace.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>..\..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="PipeSystem">
<HintPath>..\..\..\..\..\..\workshop\content\294100\2023507013\1.4\Assemblies\PipeSystem.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
Expand All @@ -47,9 +59,15 @@
<HintPath>..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="VFECore">
<HintPath>..\..\..\..\..\..\workshop\content\294100\2023507013\1.4\Assemblies\VFECore.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="GF_Categories.cs" />
<Compile Include="GF_CompProperties_ConvertThingToResource.cs" />
<Compile Include="GF_ConvertThingToResource.cs" />
<Compile Include="GF_Utility.cs" />
<Compile Include="GF_ArchiteGenepack.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
using PipeSystem;
using RimWorld;
using System.Collections.Generic;
using Verse;

namespace CategoricGenepacks
{
public class GF_CompProperties_ConvertThingToResource : PipeSystem.CompProperties_Resource
{
public int ratio = 1;

public ThingCategoryDef catThing;

public GF_CompProperties_ConvertThingToResource()
{
compClass = typeof(GF_ConvertThingToResource);
}

public override IEnumerable<string> ConfigErrors(ThingDef parentDef)
{
foreach (string item in base.ConfigErrors(parentDef))
{
yield return item;
}

if (parentDef.thingClass != typeof(Building_Storage))
{
yield return "Can't use GF_CompProperties_ConvertThingToResource with a thing that don't have Building_Storage as thingClass.";
}

if (parentDef.comps.FindAll((CompProperties c) => c is CompProperties_ConvertThingToResource).Count > 1)
{
yield return "Can't use multiple GF_CompProperties_ConvertThingToResource on the same thing.";
}

if (catThing == null)
{
yield return "Can't use GF_CompProperties_ConvertThingToResource with a null thing.";
}
}
}
}
83 changes: 83 additions & 0 deletions Source/CategoricGenepacks/GF_ConvertThingToResource.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
using PipeSystem;
using RimWorld;
using System.Collections.Generic;
using Verse;

namespace CategoricGenepacks
{
public class GF_ConvertThingToResource : PipeSystem.CompResource
{
private CompBreakdownable compBreakdownable;

private CompPowerTrader compPowerTrader;

private CompFlickable compFlickable;

public new GF_CompProperties_ConvertThingToResource Props => (GF_CompProperties_ConvertThingToResource)props;

public bool CanInputNow => (compBreakdownable == null || !compBreakdownable.BrokenDown) && (compPowerTrader == null || compPowerTrader.PowerOn) && (compFlickable == null || compFlickable.SwitchIsOn);

public Thing HeldThing
{

get
{
List<Thing> list = parent.Map.thingGrid.ThingsListAt(parent.Position);
List<ThingDef> catList = Props.catThing.childThingDefs;

Log.Message("Grabbing category: " + catList.ToString());

for (int i = 0; i < catList.Count; i++)
{
Log.Message(" Grabbing corpse: " + catList[i].ToString());
for (int j = 0; j < list.Count; j++)
{
Log.Message(" Testing for corpses: " + list[j].ToString());
if (list[j].def == catList[i])
{
Log.Message(" Success! Depositing " + list[j].ToString() + " into the extractor.");
return list[j];
}
}
}
Log.Message("Nothing's been found mate");
return null;
}
}

public int MaxCanInput => (int)PipeNet.AvailableCapacity;

public override void PostSpawnSetup(bool respawningAfterLoad)
{
base.PostSpawnSetup(respawningAfterLoad);
compBreakdownable = parent.GetComp<CompBreakdownable>();
compPowerTrader = parent.GetComp<CompPowerTrader>();
compFlickable = parent.GetComp<CompFlickable>();
}

public override void CompTick()
{
base.CompTick();
if (parent.IsHashIntervalTick(250))
{
CompTickRare();
}
}

public override void CompTickRare()
{
base.CompTickRare();
Thing heldThing = HeldThing;
Log.Message("Blah blah testing if this bloody thing even loaded");
if (CanInputNow && heldThing != null)
{
int num = heldThing.stackCount / Props.ratio;
PipeNet.DistributeAmongStorage(num);
heldThing.DeSpawn();
}
}
}
public class PipeNet {
public List<GF_ConvertThingToResource> convertersC = new List<GF_ConvertThingToResource>();
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
23835f5d8f5a4b7ea9fb81dea1a0c03642aec250
d6b5851f9cd2ac645735b2c95fe4879bec2012f9
Binary file modified Source/CategoricGenepacks/obj/Debug/CategoricGenepacks.dll
Binary file not shown.
Binary file not shown.
Binary file added Textures/Things/UI/GeneExtractorAlien.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 84c2255

Please sign in to comment.