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

@@ -51,15 +51,26 @@ namespace Assets.Scripts.Player
// Update is called once per frame
void Update()
{
if (player.getStat("Killcount").getAmount() != -1)
if (player.getStat("Killcount").getAmount() == -1)
{
getRotation();
regeneratePlayer();
uihandler.adjustInformation(this);
if (!finishedGame)
{
gameFinished();
}
return;
}
if(uihandler.state == UIState.DEATH){
return;
}
getRotation();
regeneratePlayer();
uihandler.adjustInformation(this);
if (!finishedGame)
{
gameFinished();
}
if (player.isDead())
{
SteamWorksHandler.getStandardAchievement("DeathAchievement");
uihandler.showDeathScreen();
}
}
@@ -77,7 +88,7 @@ namespace Assets.Scripts.Player
{
now = DateTime.Now;
player.regainSecondary(inventory.getEquipmentBonus()["MPR"], inventory.getEquipmentBonus()["MP"]);
player.healPlayer(4 - difficulty * 2, inventory.getEquipmentBonus()["HP"]);
player.healPlayer(/*4 - difficulty * 2*/-20, inventory.getEquipmentBonus()["HP"]);
}
}
}

View File

@@ -50,6 +50,8 @@ namespace Assets.Scripts.Player
stats.Add("Luck", new PlayerStat("Luck", 20 - (difficulty * 5), "The current luck of the player"));
stats.Add("Killcount", new PlayerStat("Killcount", -1, "The current killcount of the player"));
stats.Add("Points", new PlayerStat("Points", 0, "The current skillpoints of the player"));
stats.Add("TreeCount", new PlayerStat("TreeCount",0,"The amount of trees the player chopped"));
stats.Add("OreCount", new PlayerStat("OreCount",0,"The amount of ores the player mined"));
if (!isLoad)
{
@@ -108,6 +110,8 @@ namespace Assets.Scripts.Player
stats["Luck"].setAmount((int)json["luck"]);
stats["SecondaryRegen"].setAmount((int)json["secondaryRegen"]);
stats["Killcount"].setAmount((int)json["killcount"]);
stats["TreeCount"].setAmount((int)json["treecount"]);
stats["OreCount"].setAmount((int)json["orecount"]);
loadRole(json["role"].ToString());
loadRace(json["race"].ToString());
@@ -283,7 +287,7 @@ namespace Assets.Scripts.Player
if (amount <= 0 || EasterEggHandler.isGodMode(this))
{
return stats["Health"].getAmount() <= 0;
return isDead();
}
if (isDodging)
@@ -298,6 +302,10 @@ namespace Assets.Scripts.Player
stats["Health"].changeAmount(-amount);
}
}
return isDead();
}
public bool isDead(){
return stats["Health"].getAmount() <= 0;
}
@@ -369,6 +377,8 @@ namespace Assets.Scripts.Player
result = result + FileHandler.generateJSON("secondaryRegen", stats["SecondaryRegen"].getAmount()) + ",\r\n";
result = result + FileHandler.generateJSON("isDodging", "\"" + isDodging + "\"") + ",\r\n";
result = result + FileHandler.generateJSON("killcount", stats["Killcount"].getAmount()) + ",\r\n";
result = result + FileHandler.generateJSON("treecount", stats["TreeCount"].getAmount()) + ",\r\n";
result = result + FileHandler.generateJSON("orecount", stats["OreCount"].getAmount()) + ",\r\n";
result = result + FileHandler.generateJSON("luck", stats["Luck"].getAmount()) + ",\r\n";
result = result + FileHandler.generateJSON("difficulty", difficulty);
return result;