mirror of
https://github.com/FalloutCollaborationProject/FCP-Tools.git
synced 2026-07-27 16:59:37 -07:00
Introduces a new consumable grenade flow with a toggle in General settings, including localization strings and XML patching so vanilla grenades use a consumable launch verb and stack to 15. Added Harmony patches and a custom verb to handle stack consumption, prevent unwanted restacking when consumables are disabled, and auto-equip matching replacements from inventory. Also includes small supporting tweaks: safer holotape debug spawning, a log level adjustment in core mod startup, and minor def updates (apparel cleanup/category fix and energy explosion color tuning).
17 lines
459 B
C#
17 lines
459 B
C#
using HarmonyLib;
|
|
using Verse;
|
|
|
|
namespace FCP.Core;
|
|
|
|
[HarmonyPatch(typeof(Thing), nameof(Thing.TryAbsorbStack))]
|
|
public static class GrenadeStackAbsorb_Patch
|
|
{
|
|
public static bool Prefix(Thing __instance, Thing other, ref bool __result)
|
|
{
|
|
if (FCPCoreMod.Settings.General.consumableGrenades) return true;
|
|
if (!Thing_PostMake_Patch.IsConsumableGrenade(__instance.def)) return true;
|
|
__result = false;
|
|
return false;
|
|
}
|
|
}
|