Ejemplo n.º 1
0
 private static void Prefix(FleeOnDamage __instance, DamageInfo damageInfo)
 {
     if (damageInfo.damage < ((__instance.creature.liveMixin?.health ?? 0) / 2))
     {
         damageInfo.damage = 0f;
     }
 }
Ejemplo n.º 2
0
 static void Prefix(FleeOnDamage __instance, DamageInfo damageInfo)
 {
     if (__instance.creature.name.ToLower().Contains("shocker") && damageInfo.type == DamageType.Electrical)
     {
         damageInfo.damage = 0f;
     }
 }
Ejemplo n.º 3
0
 private static void Prefix(FleeOnDamage __instance, DamageInfo damageInfo)
 {
     if (__instance.creature.name.ToLower().Contains("leviathan"))
     {
         damageInfo.damage = 0f;
     }
 }
Ejemplo n.º 4
0
        //[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;
            }
            */
        }
Ejemplo n.º 5
0
        private static void Prefix(FleeOnDamage __instance, DamageInfo damageInfo)
        {
            var liveMixin = __instance.creature.liveMixin;

            if (liveMixin != null && damageInfo.damage < liveMixin.health / 2)
            {
                damageInfo.damage = 0f;
            }
        }