diff --git a/1.6/1.6/Assemblies/WulaFallenEmpire.dll b/1.6/1.6/Assemblies/WulaFallenEmpire.dll index b5f2825b..00ea8919 100644 Binary files a/1.6/1.6/Assemblies/WulaFallenEmpire.dll and b/1.6/1.6/Assemblies/WulaFallenEmpire.dll differ diff --git a/Source/WulaFallenEmpire/HarmonyPatches/Patch_Pawn_PreApplyDamage.cs b/Source/WulaFallenEmpire/HarmonyPatches/Patch_Pawn_PreApplyDamage.cs index 056b92ea..012b2e55 100644 --- a/Source/WulaFallenEmpire/HarmonyPatches/Patch_Pawn_PreApplyDamage.cs +++ b/Source/WulaFallenEmpire/HarmonyPatches/Patch_Pawn_PreApplyDamage.cs @@ -1,4 +1,5 @@ -using HarmonyLib; +using System; +using HarmonyLib; using RimWorld; using Verse; @@ -10,17 +11,14 @@ namespace WulaFallenEmpire [HarmonyPrefix] public static bool Prefix(Pawn __instance, ref DamageInfo dinfo) { - // 检查Pawn是否有伤害拦截组件 var interceptorComp = __instance.TryGetComp(); if (interceptorComp != null) { WulaLog.Debug($"[DamageInterceptor] {__instance.LabelShort} 即将受到 {dinfo.Amount} 点伤害,拦截组件激活"); - - // 让拦截组件处理伤害 return interceptorComp.PreApplyDamage(ref dinfo); } - - return true; // 继续正常处理伤害 + + return true; } } @@ -30,11 +28,17 @@ namespace WulaFallenEmpire [HarmonyPostfix] public static void Postfix(Pawn __instance, DamageInfo dinfo, float totalDamageDealt) { - // 记录实际承受的伤害 - var interceptorComp = __instance.TryGetComp(); - if (interceptorComp != null && totalDamageDealt == 0f) + try { - WulaLog.Debug($"[DamageInterceptor] {__instance.LabelShort} 成功拦截所有伤害,实际承受0点伤害"); + var interceptorComp = __instance.TryGetComp(); + if (interceptorComp != null && totalDamageDealt == 0f) + { + WulaLog.Debug($"[DamageInterceptor] {__instance.LabelShort} 成功拦截所有伤害,实际承受0点伤害"); + } + } + catch (Exception ex) + { + WulaLog.Debug($"[DamageInterceptor] Error in PostApplyDamage patch: {ex}"); } } } diff --git a/opencode.json b/opencode.json new file mode 100644 index 00000000..bfc4a5c5 --- /dev/null +++ b/opencode.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://opencode.ai/config.json", + "mcp": { + "rimworld-code-rag": { + "type": "local", + "command": [ + "C:/Users/Kalo/miniconda3/python.exe", + "C:/Steam/steamapps/common/RimWorld/Mods/3516260226/MCP/mcpserver_stdio_complete.py" + ], + "enabled": true + } + } +}