Skip to content

Commit

Permalink
Added tiny workbenches of [url=https://steamcommunity.com/sharedfiles…
Browse files Browse the repository at this point in the history
…/filedetails/?id=1880253632]Vanilla Furniture Expanded - Production[/url] if loaded
  • Loading branch information
emipa606 committed Mar 28, 2023
1 parent a67a1e8 commit 3a99076
Show file tree
Hide file tree
Showing 27 changed files with 220 additions and 9 deletions.
Binary file modified 1.4/Assemblies/TinyWorkbenches.dll
Binary file not shown.
188 changes: 188 additions & 0 deletions 1.4/Patches/VanillaExpanded.VFEProduction.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
<?xml version="1.0" encoding="utf-8"?>
<Patch>
<Operation Class="PatchOperationConditional">
<xpath>/Defs/ThingDef[defName="VFE_TableButcherElectric"]</xpath>
<success>Always</success>
<match Class="PatchOperationAdd">
<xpath>Defs</xpath>
<value>
<ThingDef ParentName="TWB_MiniBenchBase">
<defName>TWB_VFE_TableButcherElectricMini</defName>
<label>tiny electric butcher</label>
<thingClass>Building_WorkTable</thingClass>
<description>A tiny motorized table with a rotating saw blade for butchering dead creatures quicker into precise slices of raw meat. Consumes some power.</description>
<graphicData>
<texPath>Things/Buildings/TWB_VFE_TableButcherElectricMini/TWB_VFE_TableButcherElectricMini</texPath>
</graphicData>
<stuffCategories>
<li>Metallic</li>
<li>Woody</li>
</stuffCategories>
<costStuffCount>40</costStuffCount>
<costList>
<Steel>15</Steel>
<ComponentIndustrial>2</ComponentIndustrial>
</costList>
<statBases>
<Cleanliness>-15</Cleanliness>
<WorkTableWorkSpeedFactor>1.1</WorkTableWorkSpeedFactor>
</statBases>
<comps>
<li Class="CompProperties_Power">
<compClass>CompPowerTrader</compClass>
<basePowerConsumption>250</basePowerConsumption>
<shortCircuitInRain>true</shortCircuitInRain>
</li>
<li Class="CompProperties_Flickable" />
<li Class="CompProperties_AffectedByFacilities">
<linkableFacilities>
<li>ToolCabinet</li>
</linkableFacilities>
</li>
<li Class="CompProperties_Breakdownable" />
</comps>
<placeWorkers>
<li>PlaceWorker_ShowFacilitiesConnections</li>
</placeWorkers>
<constructionSkillPrerequisite>5</constructionSkillPrerequisite>
<researchPrerequisites>
<li>Electricity</li>
</researchPrerequisites>
</ThingDef>
<ThingDef ParentName="TWB_MiniBenchBase">
<defName>TWB_VFE_TableDrugLabElectricMini</defName>
<label>tiny electric drug lab</label>
<thingClass>Building_WorkTable</thingClass>
<description>An tiny advanced work bench equipped with containers, heaters, and measurement devices for producing various drugs with more efficiency. Consumes some power.</description>
<graphicData>
<texPath>Things/Buildings/TWB_VFE_TableDrugLabElectricMini/TWB_VFE_TableDrugLabElectricMini</texPath>
<shaderType>CutoutComplex</shaderType>
</graphicData>
<stuffCategories>
<li>Metallic</li>
<li>Woody</li>
</stuffCategories>
<costStuffCount>60</costStuffCount>
<costList>
<Steel>95</Steel>
<ComponentIndustrial>6</ComponentIndustrial>
</costList>
<statBases>
<WorkTableWorkSpeedFactor>1.1</WorkTableWorkSpeedFactor>
</statBases>
<comps>
<li Class="CompProperties_Power">
<compClass>CompPowerTrader</compClass>
<basePowerConsumption>275</basePowerConsumption>
<shortCircuitInRain>true</shortCircuitInRain>
</li>
<li Class="CompProperties_Flickable" />
<li Class="CompProperties_AffectedByFacilities">
<linkableFacilities>
<li>ToolCabinet</li>
</linkableFacilities>
</li>
<li Class="CompProperties_Breakdownable" />
</comps>
<placeWorkers>
<li>PlaceWorker_ShowFacilitiesConnections</li>
</placeWorkers>
<constructionSkillPrerequisite>5</constructionSkillPrerequisite>
<researchPrerequisites>
<li>Electricity</li>
<li>DrugProduction</li>
</researchPrerequisites>
</ThingDef>
<ThingDef ParentName="TWB_MiniBenchBase">
<defName>TWB_VFE_FueledSmelterMini</defName>
<label>tiny fueled smelter</label>
<thingClass>Building_WorkTable_HeatPush</thingClass>
<description>A tiny wood-fueled station for smelting. Extracts usable metal from slag chunks and other mixed metal items.</description>
<graphicData>
<texPath>Things/Buildings/TWB_VFE_FueledSmelterMini/TWB_VFE_FueledSmelterMini</texPath>
</graphicData>
<costList>
<Steel>120</Steel>
</costList>
<constructionSkillPrerequisite>3</constructionSkillPrerequisite>
<recipes>
<li>ExtractMetalFromSlag</li>
<li>SmeltWeapon</li>
<li>DestroyWeapon</li>
</recipes>
<comps>
<li Class="CompProperties_Refuelable">
<fuelConsumptionRate>140.0</fuelConsumptionRate>
<fuelCapacity>40.0</fuelCapacity>
<fuelFilter>
<thingDefs>
<li>WoodLog</li>
</thingDefs>
</fuelFilter>
<consumeFuelOnlyWhenUsed>true</consumeFuelOnlyWhenUsed>
</li>
<li Class="CompProperties_HeatPusher">
<compClass>CompHeatPusherPowered</compClass>
<heatPerSecond>7</heatPerSecond>
</li>
</comps>
<building>
<spawnedConceptLearnOpportunity>BillsTab</spawnedConceptLearnOpportunity>
<heatPerTickWhileWorking>0.75</heatPerTickWhileWorking>
</building>
<researchPrerequisites>
<li>Smithing</li>
</researchPrerequisites>
</ThingDef>
<ThingDef ParentName="TWB_MiniBenchBase">
<defName>TWB_VFE_TableStonecutterElectricMini</defName>
<label>tiny electric stonecutter's table</label>
<thingClass>Building_WorkTable_HeatPush</thingClass>
<description>An tiny advanced work table with electrical saws and holders for cutting stone chunks into usable blocks in shorter duration of time on an assembly line. Consumes some power.</description>
<graphicData>
<texPath>Things/Buildings/TWB_VFE_TableStonecutterElectricMini/TWB_VFE_TableStonecutterElectricMini</texPath>
<shaderType>CutoutComplex</shaderType>
</graphicData>
<stuffCategories>
<li>Metallic</li>
<li>Woody</li>
</stuffCategories>
<costStuffCount>90</costStuffCount>
<costList>
<Steel>45</Steel>
<ComponentIndustrial>3</ComponentIndustrial>
</costList>
<statBases>
<WorkTableWorkSpeedFactor>1.1</WorkTableWorkSpeedFactor>
</statBases>
<comps>
<li Class="CompProperties_Power">
<compClass>CompPowerTrader</compClass>
<basePowerConsumption>150</basePowerConsumption>
<shortCircuitInRain>true</shortCircuitInRain>
</li>
<li Class="CompProperties_Flickable" />
<li Class="CompProperties_AffectedByFacilities">
<linkableFacilities>
<li>ToolCabinet</li>
</linkableFacilities>
</li>
<li Class="CompProperties_Breakdownable" />
</comps>
<placeWorkers>
<li>PlaceWorker_ShowFacilitiesConnections</li>
</placeWorkers>
<building>
<spawnedConceptLearnOpportunity>BillsTab</spawnedConceptLearnOpportunity>
<paintable>true</paintable>
</building>
<constructionSkillPrerequisite>5</constructionSkillPrerequisite>
<researchPrerequisites>
<li>Stonecutting</li>
<li>Electricity</li>
</researchPrerequisites>
</ThingDef>
</value>
</match>
</Operation>
</Patch>
5 changes: 3 additions & 2 deletions About/About.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ https://steamcommunity.com/sharedfiles/filedetails/?id=1546657623

[table]
[tr]
[td][url=https://invite.gg/Mlie][img]https://i.imgur.com/zdzzBrc.png[/img][/url][/td]
[td][url=https://dsc.gg/mlie][img]https://i.imgur.com/zdzzBrc.png[/img][/url][/td]
[td][url=https://github.com/emipa606/TinyWorkbenchs][img]https://i.imgur.com/kTkpTOE.png[/img][/url][/td]
[/tr]
[tr]
Expand Down Expand Up @@ -66,5 +66,6 @@ These textures aren't up to 1.0 quality, and I'm a lazy person who made them all
[*] If you have the solution for a problem, please post it to the GitHub repository.
[/list]

</description>

[url=https://steamcommunity.com/sharedfiles/filedetails/changelog/2387981423]Last updated 2023-03-28[/url]</description>
</ModMetaData>
3 changes: 3 additions & 0 deletions About/Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog for TinyWorkbenchs

1.4.2 - Added tiny workbenches of [url=https://steamcommunity.com/sharedfiles/filedetails/?id=1880253632]Vanilla Furniture Expanded - Production[/url] if loaded


1.4.1 - Mod updated for 1.4 and passed autotests


Expand Down
2 changes: 1 addition & 1 deletion About/Manifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Manifest>
<identifier>TinyWorkbenchs</identifier>
<version>1.4.1</version>
<version>1.4.2</version>
<dependencies />
<incompatibleWith />
<loadBefore />
Expand Down
2 changes: 1 addition & 1 deletion About/ModSync.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<ModSyncNinjaData>
<ID>3b55fe60-bf16-410e-b0fa-91f9da742a9d</ID>
<ModName>Tiny Workbenchs (Continued)</ModName>
<Version>1.4.1</Version>
<Version>1.4.2</Version>
<SaveBreaking>False</SaveBreaking>
<Host name="Github">
<Owner>emipa606</Owner>
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,5 @@ These textures aren't up to 1.0 quality, and I'm a lazy person who made them all





https://steamcommunity.com/sharedfiles/filedetails/changelog/2387981423]Last updated 2023-03-28
Expand Down
22 changes: 20 additions & 2 deletions Source/TinyWorkbenches/TinyWorkbenches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ static TinyWorkbenches()
foreach (var bench in DefDatabase<ThingDef>.AllDefsListForReading.Where(def => def.defName.StartsWith("TWB_")))
{
var originalBench = ThingDef.Named(bench.defName.Replace("TWB_", "").Replace("Mini", ""));
Log.Message(
$"[TinyWorkbenches]: Cloning {originalBench.AllRecipes.Count} recipes from {originalBench.LabelCap} to {bench.LabelCap}");
foreach (var recipeDef in originalBench.AllRecipes)
{
if (bench.recipes == null)
Expand All @@ -35,6 +33,26 @@ static TinyWorkbenches()
workGiverDef.fixedBillGiverDefs.Add(bench);
}
}

var affectionComp = bench.GetCompProperties<CompProperties_AffectedByFacilities>();
if (affectionComp == null)
{
continue;
}

var originalComp = originalBench.GetCompProperties<CompProperties_AffectedByFacilities>();
if (originalComp == null)
{
continue;
}

affectionComp.linkableFacilities = originalComp.linkableFacilities;
}

foreach (var facility in DefDatabase<ThingDef>.AllDefsListForReading.Where(def =>
def.HasComp(typeof(CompFacility))))
{
facility.GetCompProperties<CompProperties_Facility>().ResolveReferences(facility);
}
}
}
4 changes: 2 additions & 2 deletions Source/TinyWorkbenches/TinyWorkbenches.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<DebugType>None</DebugType>
<LangVersion>latest</LangVersion>
<FileVersion>1.4.1</FileVersion>
<FileVersion>1.4.2</FileVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Krafs.Rimworld.Ref">
<Version>1.4.3510-beta</Version>
<Version>*</Version>
<ExcludeAssets>runtime</ExcludeAssets>
<IncludeAssets>compile; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 3a99076

Please sign in to comment.