Added save for inventory, slot and item, changed item generation, fixed luck in calculation
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user