Exemple #1
0
        private static float HowMuchIsTooMuch(ref WearNTear instance, float health, float damage)
        {
            float remainingHealth  = health - (damage / 100f * instance.m_health);
            float howMuchIsTooMuch = Mathf.Abs(minHealths[instance.GetInstanceID()] - remainingHealth);

            return(howMuchIsTooMuch / instance.m_health * 100f);
        }
Exemple #2
0
 public static void WearNTear_Awake(ref WearNTear __instance)
 {
     minHealthPercentage = (1.0f - Mathf.Clamp(maxRainDamagePercentage.Value, 0.0f, 1.0f));
     minHealths.Add(__instance.GetInstanceID(), __instance.m_health * minHealthPercentage);
 }
Exemple #3
0
 public static void WearNTear_OnDestroy(ref WearNTear __instance)
 {
     minHealths.Remove(__instance.GetInstanceID());
 }
Exemple #4
0
        private static bool IsTooMuchDamage(ref WearNTear instance, float health, float damage)
        {
            float healthAfterDamage = health - (damage / 100f * instance.m_health);

            return(healthAfterDamage < minHealths[instance.GetInstanceID()]);
        }