private static void Prefix(FleeOnDamage __instance, DamageInfo damageInfo) { if (damageInfo.damage < ((__instance.creature.liveMixin?.health ?? 0) / 2)) { damageInfo.damage = 0f; } }
static void Prefix(FleeOnDamage __instance, DamageInfo damageInfo) { if (__instance.creature.name.ToLower().Contains("shocker") && damageInfo.type == DamageType.Electrical) { damageInfo.damage = 0f; } }
private static void Prefix(FleeOnDamage __instance, DamageInfo damageInfo) { if (__instance.creature.name.ToLower().Contains("leviathan")) { damageInfo.damage = 0f; } }
//[HarmonyPrefix] public static bool OnTakeDamage(FleeOnDamage __instance, DamageInfo damageInfo) { return true; /* //Disable this for now if (damageInfo.type == DamageType.Electrical) return true; TechType t = DeathRunUtils.getTechType(__instance.gameObject); switch (t) { // These guys don't flee on damage anymore. case TechType.Stalker: case TechType.Crabsnake: case TechType.CrabSquid: case TechType.Sandshark: case TechType.BoneShark: case TechType.SpineEel: case TechType.Shocker: case TechType.LavaLizard: case TechType.Warper: case TechType.ReaperLeviathan: case TechType.GhostLeviathan: case TechType.GhostLeviathanJuvenile: case TechType.SeaDragon: return false; default: return true; } */ }
private static void Prefix(FleeOnDamage __instance, DamageInfo damageInfo) { var liveMixin = __instance.creature.liveMixin; if (liveMixin != null && damageInfo.damage < liveMixin.health / 2) { damageInfo.damage = 0f; } }