Added save for inventory, slot and item, changed item generation, fixed luck in calculation

This commit is contained in:
Nicola Sovic
2022-07-04 12:40:24 +02:00
parent dd0251cb3e
commit 22137fffde
7 changed files with 274 additions and 19 deletions

View File

@@ -19,6 +19,7 @@ namespace Assets.Scripts.Slimes
protected int level;
protected int experience;
protected Item item;
protected int luck;
public BasicSlime(Player player)
{
@@ -33,10 +34,7 @@ namespace Assets.Scripts.Slimes
intelligence = playerStats[6];
experience = (int)(10 + playerStats[7] * 2.5f);
level = playerStats[7];
if (new System.Random().Next(100) + 1 < 1000)//10 + playerStats[11])
{
item = new Item(playerStats[11]);
}
luck = playerStats[11];
}
public BasicSlime(JToken json)
@@ -102,6 +100,10 @@ namespace Assets.Scripts.Slimes
public Item getItem()
{
if (new System.Random().Next(100) + 1 < 10 + luck)
{
item = new Item(luck);
}
return item;
}