cleaned project, added death stats
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user