Skip to content

Commit

Permalink
Allow to configure head to ct damage transfer.
Browse files Browse the repository at this point in the history
  • Loading branch information
CptMoore committed May 11, 2024
1 parent 6215694 commit d0f1534
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ public class ComponentExplosionsSettings : ISettings
{
public bool Enabled { get; set; } = true;
public string EnabledDescription => "Allows each component to define destructive forces in case they explode, also implements proper CASE.";

public bool PassthroughHeadToCenterTorso { get; set; }
public string PassthroughHeadToCenterTorsoorsoDescription => "Pass excessive head damage to the center torso.";
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ namespace MechEngineer.Features.ComponentExplosions.Patches;
[HarmonyPatch(typeof(MechStructureRules), nameof(MechStructureRules.GetPassthroughLocation))]
internal static class MechStructureRules_GetPassthroughLocation_Patch
{
[HarmonyPrepare]
public static bool Prepare()
{
return ComponentExplosionsFeature.settings.PassthroughHeadToCenterTorso;
}

[HarmonyPrefix]
[HarmonyWrapSafe]
public static void Prefix(ref bool __runOriginal, ArmorLocation location, ref ArmorLocation __result)
Expand Down

0 comments on commit d0f1534

Please sign in to comment.