cleaned project, added death stats

This commit is contained in:
TAASONI3
2023-12-29 16:39:53 +01:00
parent 02a20443c2
commit 661aa6704b
132 changed files with 655 additions and 962 deletions

View File

@@ -311,6 +311,27 @@ namespace Assets.Scripts
public void showDeathScreen()
{
state = UIState.DEATH;
PlayerObject player = GameObject.Find("Player").GetComponent<PlayerGameObject>().getPlayer();
GameObject statText = GameObject.Find("txtDeathStats");
string text = statText.GetComponent<Text>().text;
text = text.Replace("NAME", player.getPlayerName());
text = text.Replace("RACE", player.getRace().racename);
text = text.Replace("CLASS", player.getClass().classname);
text = text.Replace("LEVEL", player.getStat("Level").getAmount().ToString());
text = text.Replace("KILLS", player.getStat("Killcount").getAmount().ToString());
text = text.Replace("HEALTH", player.getStat("MaxHealth").getAmount().ToString());
text = text.Replace("SECONDARY", player.getStat("MaxSecondary").getAmount().ToString());
text = text.Replace("INT", player.getStat("Intelligence").getAmount().ToString());
text = text.Replace("STR", player.getStat("Strength").getAmount().ToString());
text = text.Replace("DEX", player.getStat("Dexterity").getAmount().ToString());
text = text.Replace("TREES", player.getStat("TreeCount").getAmount().ToString());
text = text.Replace("ORES", player.getStat("OreCount").getAmount().ToString());
text = text.Replace("DIFFICULTY", player.getDifficulty() == 0 ? "Easy" : player.getDifficulty() == 1 ? "Normal" : "Hard");
statText.GetComponent<Text>().text = text;
hideOtherElements(deathscreen);
EventSystem.current.SetSelectedGameObject(GameObject.Find("btnMenu"));
}