Upload from upload_mods.ps1

This commit is contained in:
Nathaniel Cosford
2025-06-04 16:44:53 +09:30
commit f1fbbe67bb
1722 changed files with 165268 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
namespace Harmony.BlockDamagePatches
{
[HarmonyPatch(typeof(BlockDamage))]
[HarmonyPatch("OnEntityCollidedWithBlock")]
public class OnEntityCollidedWithBlockPatch
{
public static bool Prefix(BlockDamage __instance, ref bool __result, WorldBase _world, int _clrIdx, Vector3i _blockPos, BlockValue _blockValue, Entity _targetEntity)
{
if (_targetEntity is EntityNPCRebirth)
{
if (_targetEntity.EntityClass.Properties.Values.ContainsKey("PreventTrapDamage"))
{
string preventTrapDamage = _targetEntity.EntityClass.Properties.Values["PreventTrapDamage"];
if (preventTrapDamage == "true")
{
return false;
}
}
}
return true;
}
}
}