public void ThrowDamageCheck(DAMAGENATURES zNature, DAMAGELOCATIONS zLocation, int zIntensity) { int d20 = UnityEngine.Random.Range(1, 21); int complexity = 0; switch (zLocation) { case DAMAGELOCATIONS.SUPERFICIAL: complexity += 2; break; case DAMAGELOCATIONS.PUNTOVITAL: complexity -= 3; break; case DAMAGELOCATIONS.INDETERMINADO: case DAMAGELOCATIONS.EXTREMIDAD: break; } if (zIntensity <= 1) { complexity += 0; } else if (zIntensity <= 2) { complexity -= 1; } else if (zIntensity <= 3) { complexity -= 3; } else if (zIntensity <= 4) { complexity -= 5; } SUCCESSLEVELS successLevel = Defines.AttributesThrow(d20, complexity, CurrentProfile.Vigor); string message = ""; int damageLost = Defines.DamageLostThrow(successLevel, zIntensity); if (damageLost < 1) { message = "Evita el daño."; } else { CurrentProfile.Health = (HEALTHLEVELS)(Mathf.Clamp(((int)CurrentProfile.Health - damageLost), (int)HEALTHLEVELS.MUERTO, (int)HEALTHLEVELS.SANO)); message = "Pierde " + damageLost + " niveles de salud.\nQueda en estado " + Defines.HealthLevelToString(CurrentProfile.Health); } ProcessTrowResult(new LogMessage(DateTime.Now, AppManager.Instance.UIManager.PopupManager.LogPopup.DamageColor, "Tirada de Daño", message, true )); }
public static string DamageLocationToString(DAMAGELOCATIONS zLocation) { switch (zLocation) { case DAMAGELOCATIONS.INDETERMINADO: return "INDETERMINADO"; case DAMAGELOCATIONS.EXTREMIDAD: return "EXTREMIDAD"; case DAMAGELOCATIONS.PUNTOVITAL: return "PUNTO VITAL"; case DAMAGELOCATIONS.SUPERFICIAL: return "SUPERFICIAL"; } return "???"; }