Skip to content

Commit

Permalink
Updated for RimWorld v1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Heremeus committed Nov 28, 2018
1 parent 7ff6f0a commit 3f19f67
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 20 deletions.
6 changes: 3 additions & 3 deletions About/About.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<ModMetaData>
<name>Medical Dissection</name>
<name>[DEV]Medical Dissection</name>
<author>Heremeus</author>
<targetVersion>0.18.0</targetVersion>
<targetVersion>1.0.0</targetVersion>
<description>Adds a dissection table to the game.

Human corpses can be dissected at the table to improve the medical knowledge of your doctors.

Available languages: English, German (in progress)

(v1.1.3)
(v1.2.0)
</description>
</ModMetaData>
2 changes: 1 addition & 1 deletion About/Version.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<!--overrideVersion>1.0.0</overrideVersion-->
<!-- Optional. Use this to specify the version of HugsLib you are targeting.
See https://github.com/UnlimitedHugs/RimworldHugsLib/releases for the current version of the library.-->
<requiredLibraryVersion>4.1.0</requiredLibraryVersion>
<requiredLibraryVersion>6.1.0</requiredLibraryVersion>
<!-- Optional. This is read by the build.js script for the purpose of release publishing. Not used if you don't use the script. -->
<gitHubRepository>UnlimitedHugs/RimworldHugsLibChecker</gitHubRepository>
</VersionData>
Binary file modified Assemblies/$HugsLibChecker.dll
Binary file not shown.
Binary file modified Assemblies/HMDissection.dll
Binary file not shown.
12 changes: 6 additions & 6 deletions Defs/Recipes/Recipes_DissectCorpse.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@
<categories>
<li>Corpses</li>
</categories>
<exceptedCategories>
<disallowedCategories>
<li>CorpsesMechanoid</li>
<li>CorpsesAnimal</li>
</exceptedCategories>
</disallowedCategories>
<specialFiltersToDisallow>
<li>AllowRotten</li>
</specialFiltersToDisallow>
</fixedIngredientFilter>
<defaultIngredientFilter>
<thingDefs>
<li>Human_Corpse</li>
<li>Corpse_Human</li>
</thingDefs>
<specialFiltersToAllow>
<li>AllowCorpsesColonist</li>
Expand Down Expand Up @@ -82,10 +82,10 @@
<categories>
<li>Corpses</li>
</categories>
<exceptedCategories>
<li>Human_Corpse</li>
<disallowedCategories>
<li>CorpsesHumanlike</li>
<li>CorpsesMechanoid</li>
</exceptedCategories>
</disallowedCategories>
<specialFiltersToDisallow>
<li>AllowRotten</li>
</specialFiltersToDisallow>
Expand Down
3 changes: 1 addition & 2 deletions Defs/ThingDefs_Buildings/Buildings_Production.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,12 @@
<ThingDef Name="BuildingBase" Abstract="True">
<category>Building</category>
<thingClass>Building</thingClass>
<soundImpactDefault>BulletImpactMetal</soundImpactDefault>
<selectable>true</selectable>
<drawerType>MapMeshAndRealTime</drawerType>
<terrainAffordanceNeeded>Light</terrainAffordanceNeeded>
<repairEffect>Repair</repairEffect>
<leaveResourcesWhenKilled>true</leaveResourcesWhenKilled>
<filthLeaving>BuildingRubble</filthLeaving>
<filthLeaving>Filth_RubbleBuilding</filthLeaving>
<statBases>
<SellPriceFactor>0.70</SellPriceFactor>
</statBases>
Expand Down
10 changes: 5 additions & 5 deletions Source/HMDissection/CompDissectionHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public override void CompTick()
float bodyPartsLeftPercent;
if (PawnOrCorpseStatUtility.TryGetPawnOrCorpseStat(StatRequest.For(corpse), (Pawn x) => x.health.hediffSet.GetCoverageOfNotMissingNaturalParts(x.RaceProps.body.corePart), (ThingDef x) => 1f, out bodyPartsLeftPercent))
{
float workLeftPercent = bodyPartsLeftPercent - (currentDissectedPart.coverageAbs - currentDissectedPart.coverageAbs * (leftoverNutritionToDissect / FoodUtility.GetBodyPartNutrition(corpse.InnerPawn, currentDissectedPart)));
float workLeftPercent = bodyPartsLeftPercent - (currentDissectedPart.coverageAbs - currentDissectedPart.coverageAbs * (leftoverNutritionToDissect / FoodUtility.GetBodyPartNutrition(corpse, currentDissectedPart)));
jobDriver_DoBill.workLeft = Mathf.Max(10f, workLeftPercent * RECIPE_WORK_AMOUNT);
}
else
Expand Down Expand Up @@ -196,7 +196,7 @@ private void DissectedCalculateAmounts(Corpse corpse, Pawn dissector, out float
}));
dissectedPart = corpse.InnerPawn.RaceProps.body.corePart;
}
float bodyPartNutrition = FoodUtility.GetBodyPartNutrition(corpse.InnerPawn, dissectedPart);
float bodyPartNutrition = FoodUtility.GetBodyPartNutrition(corpse, dissectedPart);
nutritionDissected = bodyPartNutrition;
}

Expand All @@ -209,17 +209,17 @@ private void DissectedCalculateAmounts(Corpse corpse, Pawn dissector, out float
private BodyPartRecord GetNextBodyPartToDissect(Corpse corpse, Pawn dissector)
{
IEnumerable<BodyPartRecord> source = from x in corpse.InnerPawn.health.hediffSet.GetNotMissingParts(BodyPartHeight.Undefined, BodyPartDepth.Undefined)
where x.depth == BodyPartDepth.Outside && FoodUtility.GetBodyPartNutrition(corpse.InnerPawn, x) > 0.00001f
where x.depth == BodyPartDepth.Outside && FoodUtility.GetBodyPartNutrition(corpse, x) > 0.00001f
select x;
if (!source.Any<BodyPartRecord>())
{
return null;
}
BodyPartRecord bodyPart = source.RandomElementByWeight(part => 1f / FoodUtility.GetBodyPartNutrition(corpse.InnerPawn, part));
BodyPartRecord bodyPart = source.RandomElementByWeight(part => 1f / FoodUtility.GetBodyPartNutrition(corpse, part));
var notMissingChildParts = bodyPart.GetDirectChildParts().Where(part => !corpse.InnerPawn.health.hediffSet.PartIsMissing(part));
while (notMissingChildParts.Any())
{
bodyPart = notMissingChildParts.RandomElementByWeight(part => 1f / FoodUtility.GetBodyPartNutrition(corpse.InnerPawn, part));
bodyPart = notMissingChildParts.RandomElementByWeight(part => 1f / FoodUtility.GetBodyPartNutrition(corpse, part));
notMissingChildParts = bodyPart.GetDirectChildParts().Where(part => !corpse.InnerPawn.health.hediffSet.PartIsMissing(part));
}
return bodyPart;
Expand Down
6 changes: 3 additions & 3 deletions Source/HMDissection/HMDissection.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@
<Private>False</Private>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>..\..\..\..\RimWorldWin_Data\Managed\Assembly-CSharp.dll</HintPath>
<HintPath>..\..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="HugsLib">
<HintPath>..\..\..\HugsLib\Assemblies\HugsLib.dll</HintPath>
<HintPath>..\..\..\HugsLib.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
Expand All @@ -54,7 +54,7 @@
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="UnityEngine">
<HintPath>..\..\..\..\RimWorldWin_Data\Managed\UnityEngine.dll</HintPath>
<HintPath>..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
Expand Down

0 comments on commit 3f19f67

Please sign in to comment.