Skip to content

Commit

Permalink
Compiles for RW 1.4 unstable
Browse files Browse the repository at this point in the history
  • Loading branch information
jecrell committed Nov 13, 2022
1 parent 504a8bd commit 247a361
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 20 deletions.
Binary file modified 1.4/Assemblies/Vampire.dll
Binary file not shown.
4 changes: 3 additions & 1 deletion Source/Code/HarmonyPatches/HarmonyPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ static partial class HarmonyPatches

static HarmonyPatches()
{
var harmony = new Harmony("rimworld.jecrell.vampire");
Harmony.DEBUG = false;

var harmony = new Harmony("rimworld.jecrell.vampire");

HarmonyPatches_Needs(harmony);

HarmonyPatches_Ingestion(harmony);
Expand Down
24 changes: 14 additions & 10 deletions Source/Code/HarmonyPatches/HarmonyPatches_Ingestion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,43 +11,47 @@ public partial class HarmonyPatches
{
public static void HarmonyPatches_Ingestion(Harmony harmony)
{
//Log.Message("Ingestion: 1");
//Float Menus: Adds vampire blood consumption/consume buttons and hide regular consumption/consume
harmony.Patch(AccessTools.Method(typeof(FloatMenuMakerMap), "AddHumanlikeOrders"), null,
new HarmonyMethod(typeof(HarmonyPatches), nameof(Vamp_FloatMenus_Consume)));


//Log.Message("Ingestion: 2");
//Vampires should not try to do drugs when idle.
harmony.Patch(AccessTools.Method(typeof(JobGiver_IdleJoy), "TryGiveJob"), null,
new HarmonyMethod(typeof(HarmonyPatches), nameof(Vamps_DontDoIdleDrugs)));


//Log.Message("Ingestion: 3");
//Vampires should not be given food by wardens.
harmony.Patch(AccessTools.Method(typeof(Pawn_GuestTracker), "get_CanBeBroughtFood"), null,
new HarmonyMethod(typeof(HarmonyPatches), nameof(Vamps_DontWantGuestFood)));


//Log.Message("Ingestion: 4");
harmony.Patch(AccessTools.Method(typeof(FoodUtility), "InappropriateForTitle"),
new HarmonyMethod(typeof(HarmonyPatches), nameof(WhoNeeds___Titles)));

//Log.Message("Ingestion: 5");
harmony.Patch(
AccessTools.Method(typeof(FoodUtility), "WillEat",
new[] { typeof(Pawn), typeof(Thing), typeof(Pawn), typeof(bool) }),
new[] { typeof(Pawn), typeof(Thing), typeof(Pawn), typeof(bool), typeof(bool) }),
new HarmonyMethod(typeof(HarmonyPatches), nameof(WillEat_Nothing)));

//Log.Message("Ingestion: 6");
harmony.Patch(
AccessTools.Method(typeof(FoodUtility), "WillEat",
new[] { typeof(Pawn), typeof(ThingDef), typeof(Pawn), typeof(bool) }),
new[] { typeof(Pawn), typeof(ThingDef), typeof(Pawn), typeof(bool), typeof(bool) }),
new HarmonyMethod(typeof(HarmonyPatches), nameof(WillEat_NothingDef)));


//Log.Message("Ingestion: 7");
harmony.Patch(AccessTools.Method(typeof(Toils_Ingest), "FinalizeIngest"),
new HarmonyMethod(typeof(HarmonyPatches), nameof(VampiresDontIngestFood)));


//Log.Message("Ingestion: 8");
//Fixes random red errors relating to food need checks in this method (WillIngestStackCountOf).
harmony.Patch(AccessTools.Method(typeof(FoodUtility), "WillIngestStackCountOf"),
new HarmonyMethod(typeof(HarmonyPatches), nameof(Vamp_WillIngestStackCountOf)));
//Log.Message("04");

//Log.Message("Ingestion: 9");
//Prevents restful times.
harmony.Patch(AccessTools.Method(typeof(JoyGiver_SocialRelax), "TryFindIngestibleToNurse"),
new HarmonyMethod(typeof(HarmonyPatches), nameof(INeverDrink___Wine)));
Expand Down Expand Up @@ -120,7 +124,7 @@ public static bool WhoNeeds___Titles(ThingDef food, Pawn p, bool allowIfStarving


// RimWorld.FoodUtility.WillEat (Thing)
public static bool WillEat_Nothing(Pawn p, Thing food, Pawn getter, bool careIfNotAcceptableForTitle,
public static bool WillEat_Nothing(Pawn p, Thing food, Pawn getter, bool careIfNotAcceptableForTitle, bool allowVenerated,
ref bool __result)
{
if (p.IsVampire(true))
Expand All @@ -140,7 +144,7 @@ public static bool WillEat_Nothing(Pawn p, Thing food, Pawn getter, bool careIfN


// RimWorld.FoodUtility.WillEat (ThingDef)
public static bool WillEat_NothingDef(Pawn p, ThingDef food, Pawn getter, bool careIfNotAcceptableForTitle,
public static bool WillEat_NothingDef(Pawn p, ThingDef food, Pawn getter, bool careIfNotAcceptableForTitle, bool allowVenerated,
ref bool __result)
{
if (p.IsVampire(true))
Expand Down
42 changes: 42 additions & 0 deletions Source/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,48 @@

</ItemGroup>
</When>
<When Condition=" '$(Configuration)' == 'RW1.4Unstable' ">
<PropertyGroup>
<OutputPath>..\1.4\Assemblies\</OutputPath>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Lib.Harmony" Version="2.2.*" ExcludeAssets="runtime"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Krafs.Rimworld.Ref" Version="1.4.*-*" /> <!-- -* suffix allows beta/prerelease versions -->
</ItemGroup>

<!-- Note, all 'condition' hint paths will use the 'last' one in the list it finds -->
<!-- The order for these are:
- workshop (one directory up, two directories up)
- mod folder (one directory up, two directories up)
The reason for two directories up is that I (jecrell) normally mod in a seperate 'Workspace' directory
-->
<ItemGroup>
<Reference Include="DubsBadHygiene">
<HintPath>..\..\..\..\..\workshop\content\294100\836308268\1.4\Assemblies\BadHygiene.dll</HintPath>
<Private>false</Private>
</Reference>

<Reference Include="JecsTools">
<!-- Get a copy from the workshop directory if it exists... -->
<HintPath>..\..\JecsTools\1.4\Assemblies\0JecsTools.dll</HintPath>
<Private>false</Private>
</Reference>

<Reference Include="AbilityUser">
<HintPath>..\..\JecsTools\1.4\Assemblies\AbilityUser.dll</HintPath>
<Private>false</Private>
</Reference>

<Reference Include="CompAnimated">
<HintPath>..\..\JecsTools\1.4\Assemblies\CompAnimated.dll</HintPath>
<Private>false</Private>
</Reference>

</ItemGroup>
</When>
</Choose>

</Project>
7 changes: 5 additions & 2 deletions Source/Vampire.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ Global
Release|Any CPU = Release|Any CPU
RW1.3|Any CPU = RW1.3|Any CPU
RW1.4|Any CPU = RW1.4|Any CPU
RW1.4Unstable|Any CPU = RW1.4Unstable|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3A4FB893-1148-4E16-B548-867647DF1724}.RW1.4|Any CPU.ActiveCfg = RW1.4|Any CPU
{3A4FB893-1148-4E16-B548-867647DF1724}.RW1.4|Any CPU.Build.0 = RW1.4|Any CPU
{3A4FB893-1148-4E16-B548-867647DF1724}.RW1.4|Any CPU.ActiveCfg = RW1.4Unstable|Any CPU
{3A4FB893-1148-4E16-B548-867647DF1724}.RW1.4|Any CPU.Build.0 = RW1.4Unstable|Any CPU
{3A4FB893-1148-4E16-B548-867647DF1724}.RW1.4Unstable|Any CPU.ActiveCfg = RW1.4Unstable|Any CPU
{3A4FB893-1148-4E16-B548-867647DF1724}.RW1.4Unstable|Any CPU.Build.0 = RW1.4Unstable|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
14 changes: 7 additions & 7 deletions updateinfo
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
==============================

Rim of Madness - Vampires Update
v1.27.0.0 (08-08-2022)
v1.28.0.0 (10-29-2022)
====================

Meditation has been fixed. Vampire fangs now are added hediffs on tongues due to an underlying RimWorld issue that removes tongues if jaws are modified. Existing saves will have fangs moved to the new position. New settings for sun damage and rest added
Updates for RimWorld 1.4; Fixes bed coffin coloration issues; Neck wounds are cleaned after biting
--------------------

Download now on...
- Patreon: https://www.patreon.com/posts/rim-of-madness-1-54281813
- Patreon: https://www.patreon.com/posts/73953554
- GitHub: https://github.com/Rim-Of-Madness-Team/Rim-of-Madness---Vampires
- Steam: https://steamcommunity.com/sharedfiles/filedetails/?id=1187010034
Discuss the mod on...
Expand All @@ -25,12 +25,12 @@ Discuss the mod on...
[img width=260]https://raw.githubusercontent.com/Rim-Of-Madness-Team/Rim-of-Madness---Vampires/master/About/Preview.png[/img]
[hr]
[b]Rim of Madness - Vampires
Version: 1.27.0.0
Updated: 08-08-2022
Description: [color=orange]Meditation has been fixed. Vampire fangs now are added hediffs on tongues due to an underlying RimWorld issue that removes tongues if jaws are modified. Existing saves will have fangs moved to the new position. New settings for sun damage and rest added[/color]
Version: 1.28.0.0
Updated: 10-29-2022
Description: [color=orange]Updates for RimWorld 1.4; Fixes bed coffin coloration issues; Neck wounds are cleaned after biting[/color]
[hr]
[b]Download now on...[/b]
[url=https://www.patreon.com/posts/rim-of-madness-1-54281813]Patreon[/url]
[url=https://www.patreon.com/posts/73953554]Patreon[/url]
[url=https://github.com/Rim-Of-Madness-Team/Rim-of-Madness---Vampires]GitHub[/url]
[url=https://steamcommunity.com/sharedfiles/filedetails/?id=1187010034]Steam[/url]
[b]Discuss the mod on...[/b]
Expand Down

0 comments on commit 247a361

Please sign in to comment.