Skip to content

Commit

Permalink
Merge pull request #9 from tomchang25/1.5
Browse files Browse the repository at this point in the history
1.5 update
  • Loading branch information
Heremeus authored Apr 28, 2024
2 parents 8451bdc + 4d43d59 commit 2e7f732
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 20 deletions.
1 change: 1 addition & 0 deletions About/About.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<li>1.2</li>
<li>1.3</li>
<li>1.4</li>
<li>1.5</li>
</supportedVersions>
<packageId>Heremeus.MedicalDissection</packageId>
<description>Medical Dissection adds a dissection table to the game, allowing your doctors to train on human corpses. You can add the mod to an existing save.
Expand Down
5 changes: 5 additions & 0 deletions LoadFolders.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,9 @@
<li>Common</li>
<li>v1.4</li>
</v1.4>
<v1.5>
<li>/</li>
<li>Common</li>
<li>v1.5</li>
</v1.5>
</loadFolders>
Binary file added Source/HMDissection/Assembly-CSharp.dll
Binary file not shown.
14 changes: 13 additions & 1 deletion Source/HMDissection/DissectionDefOf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,20 @@ public static class DissectionDefOf
public static TaleDef DissectedEnemyWithoutPassionTale;
public static RecipeDef DissectHumanRecipe;
public static HediffDef DissectedHediff;
public static BodyPartDef Lung;
public static JobDef DoDissectionBill;
public static WorkTypeDef MedicalTraining;

public static TraitDef Cannibal;

public static BodyPartDef Arm;
public static BodyPartDef Leg;
public static BodyPartDef Jaw;
public static BodyPartDef Brain;
public static BodyPartDef Eye;
public static BodyPartDef Heart;
public static BodyPartDef Liver;
public static BodyPartDef Lung;
public static BodyPartDef Stomach;

}
}
16 changes: 8 additions & 8 deletions Source/HMDissection/DissectionUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ internal static class DissectionUtility
{
public static readonly HashSet<BodyPartDef> DissectableBodyParts = new HashSet<BodyPartDef>
{
BodyPartDefOf.Arm,
BodyPartDefOf.Leg,
BodyPartDefOf.Jaw,
BodyPartDefOf.Brain,
BodyPartDefOf.Eye,
BodyPartDefOf.Heart,
BodyPartDefOf.Liver,
DissectionDefOf.Arm,
DissectionDefOf.Leg,
DissectionDefOf.Jaw,
DissectionDefOf.Brain,
DissectionDefOf.Eye,
DissectionDefOf.Heart,
DissectionDefOf.Liver,
DissectionDefOf.Lung,
BodyPartDefOf.Stomach
DissectionDefOf.Stomach
};
}
}
7 changes: 6 additions & 1 deletion Source/HMDissection/HMDissection.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<DebugSymbols>false</DebugSymbols>
<DebugType>none</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\v1.4\Assemblies\</OutputPath>
<OutputPath>..\..\v1.5\Assemblies\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand Down Expand Up @@ -73,6 +73,11 @@
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Content Include="Assembly-CSharp.dll" />
<Content Include="UnityEngine.CoreModule.dll" />
<Content Include="UnityEngine.dll" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>call "$(ProjectDir)..\..\CopyModFolder.exe"</PostBuildEvent>
Expand Down
14 changes: 4 additions & 10 deletions Source/HMDissection/Toils_Dissection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ public static Toil StripCorpse(TargetIndex corpseIndex)
Job curJob = actor.jobs.curJob;
Thing thing = curJob.GetTarget(corpseIndex).Thing;
Designation designation = actor.Map.designationManager.DesignationOn(thing, DesignationDefOf.Strip);
if (designation != null)
{
designation.Delete();
}
designation?.Delete();

if (thing is IStrippable strippable)
{
strippable.Strip();
Expand Down Expand Up @@ -132,11 +130,7 @@ public static Toil FinishRecipeAndStartStoringCorpse(TargetIndex corpseIndex)
}
else if (curJob.bill.GetStoreMode() == BillStoreModeDefOf.SpecificStockpile)
{
StoreUtility.TryFindBestBetterStoreCellForIn(corpse, actor, actor.Map, StoragePriority.Unstored, actor.Faction, curJob.bill.GetStoreZone().slotGroup, out bestStoreCell, true);
}
else
{
Log.ErrorOnce("Unknown store mode", 9158246);
StoreUtility.TryFindBestBetterStoreCellForIn(corpse, actor, actor.Map, StoragePriority.Unstored, actor.Faction, curJob.bill.GetSlotGroup(), out bestStoreCell, true);
}

if (bestStoreCell.IsValid)
Expand Down Expand Up @@ -250,7 +244,7 @@ private static void ApplyThoughts(Pawn worker, Corpse corpse)
if (worker.needs.mood != null)
{
List<ThoughtDef> thoughts = new List<ThoughtDef>();
if (worker.skills.GetSkill(SkillDefOf.Medicine).passion == Passion.None && !worker.story.traits.HasTrait(TraitDefOf.Cannibal) && !worker.story.traits.HasTrait(TraitDefOf.Psychopath))
if (worker.skills.GetSkill(SkillDefOf.Medicine).passion == Passion.None && !worker.story.traits.HasTrait(DissectionDefOf.Cannibal) && !worker.story.traits.HasTrait(TraitDefOf.Psychopath))
{
thoughts.Add(DissectionDefOf.DissectionNoPassion);
}
Expand Down
Binary file added Source/HMDissection/UnityEngine.CoreModule.dll
Binary file not shown.
Binary file added Source/HMDissection/UnityEngine.dll
Binary file not shown.
Binary file added v1.5/Assemblies/HMDissection.dll
Binary file not shown.

0 comments on commit 2e7f732

Please sign in to comment.