Skip to content

Commit

Permalink
Global Work Speed penalty removed for Vampires Fixes #28
Browse files Browse the repository at this point in the history
  • Loading branch information
jecrell committed Jan 28, 2018
1 parent d8b8a9d commit 5513fe7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Binary file modified Assemblies/Vampire.dll
Binary file not shown.
14 changes: 13 additions & 1 deletion Source/Vampires/HarmonyPatches/HarmonyPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -441,10 +441,14 @@ where typeof(WorkGiver).IsAssignableFrom(assemblyType)
harmony.Patch(AccessTools.Method(typeof(Listing_TreeThingFilter), "Visible", new Type[] { typeof(ThingDef) }), null,
new HarmonyMethod(typeof(HarmonyPatches), nameof(CorpsesAreNotVisible)));

//Hides corpses of temporary things from the filter menus
//Prevents the game from kicking players out of spawned maps when their vampire hides in a hidey hole.
harmony.Patch(AccessTools.Method(typeof(MapPawns), "get_AnyPawnBlockingMapRemoval"), null,
new HarmonyMethod(typeof(HarmonyPatches), nameof(get_LetVampiresKeepMapsOpen)));

//Vampires no longer suffer global work speed reduction at night.
harmony.Patch(AccessTools.Method(typeof(StatPart_Glow), "FactorFromGlow"), null,
new HarmonyMethod(typeof(HarmonyPatches), nameof(VampiresAlwaysWorkHard)));

//Remove temporary character (PawnTemporary) corpses from the list, since they can't tie.
//harmony.Patch(AccessTools.Method(typeof(ThingDefGenerator_Corpses), "ImpliedCorpseDefs"), null,
// new HarmonyMethod(typeof(HarmonyPatches), nameof(RemovePawnTemporaryCorpses)));
Expand Down Expand Up @@ -483,6 +487,14 @@ where typeof(WorkGiver).IsAssignableFrom(assemblyType)
#endregion
}

// RimWorld.StatPart_Glow
public static void VampiresAlwaysWorkHard(Thing t, ref float __result) //FactorFromGlow
{
if (t is Pawn p && p.IsVampire())
__result = 1.0f;
}


//public static int mapTimeoutTicks = 600;

// Verse.MapPawns
Expand Down

0 comments on commit 5513fe7

Please sign in to comment.