public void DisplayHighScore() { if (sc.GetGameActive() && gops.GetSave().highScore < Mathf.FloorToInt(Altar.GetTimeSinceStart()) && gops.GetMaxHealth() <= 250) { gops.GetSave().highScore = Mathf.FloorToInt(Altar.GetTimeSinceStart()); SaveSystem.SaveGame(gops.GetSave().highScore, gops, ic, mp.GetChosenVolume(), Screen.currentResolution.width, Screen.currentResolution.height, QualitySettings.GetQualityLevel()); } TMPHS.text = "BEST TIME: " + gops.GetSave().highScore + "\n\nPress " + ic.Reset + " to try again."; }
private void Update() { TMPBank.text = MakeRoman(statl.GetDetrizideBank()); if (!player.gameObject.GetComponent <Unit>().IsDead() && sc.GetGameActive()) { TMPTime.text = MakeRoman(Mathf.FloorToInt(Altar.GetTimeSinceStart())); } if (gops.GetUIEnabled() && !player.gameObject.GetComponent <Unit>().IsDead() && sc.GetGameActive()) { DisplayStats(); } else if (!player.gameObject.GetComponent <Unit>().IsDead() && !gops.GetUIEnabled()) { ClearStats(); } UpdateAndCheckTutorials(); }
private void CalculateCosts() { int timefactor = 3; temphealthcost = unit.GetMaxHealth() - unit.GetHealth(); temphealthcost /= unit.GetMaxHealth(); temphealthcost *= 100.0f; temphealthcost += Altar.GetTimeSinceStart() / timefactor; healthcost = Mathf.FloorToInt(Mathf.Clamp(temphealthcost, 0, costlimit)); rescost = Mathf.Clamp(altar.GetResCost() + Mathf.FloorToInt(Altar.GetTimeSinceStart() / timefactor), 0, costlimit); if (unit.GetHealth() < unit.GetMaxHealth() && statl.GetDetrizide() > healthcost) { spellavailable = true; healavailable = true; } else if (unit.GetHealth() == unit.GetMaxHealth() && statl.GetDetrizide() > rescost && CountFriends("Friendlies") < altar.GetResMax()) { spellavailable = true; summonavailable = true; healavailable = false; } else if (unit.GetHealth() == unit.GetMaxHealth() && statl.GetDetrizide() > 0) { spellavailable = true; bankavailable = true; summonavailable = false; healavailable = false; } else { spellavailable = false; bankavailable = false; summonavailable = false; healavailable = false; } }
public void DisplayStats() { TMPBUI.text = "DETRIZIDE : " + TMPBank.text + " [" + statl.GetDetrizideBank() + "]"; TMPTUI.text = "TIME : " + TMPTime.text + " [" + Mathf.FloorToInt(Altar.GetTimeSinceStart()) + "]"; }