Added interaction for trees and stones, added items wood, stone, book and slimeball, v1.4.0

This commit is contained in:
Nicola Sovic
2022-07-12 12:11:32 +02:00
parent 8dbc177dcb
commit d898a1c5fd
23 changed files with 643 additions and 17 deletions

View File

@@ -357,19 +357,32 @@ namespace Assets.Scripts
Item endItem = endDrag.getItem(endDrag.getCurrentBag());
if (endItem != null)
{
if (((Equipment)endItem).getPlace() != startDrag.place)
if (endItem is Equipment)
{
return;
}
if (startDrag.place == ItemPlace.BAG)
{
startDrag.setItem(endItem, endDrag.getCurrentBag());
if (((Equipment)endItem).getPlace() != startDrag.place)
{
return;
}
}
else
{
startDrag.setEquip((Equipment)endItem);
inventory.calculateStatBoost(attributes, false);
inventory.calculateStatBoost(((Equipment)endItem).getAttributes(), true);
if (startDrag.place == ItemPlace.BAG)
{
startDrag.setItem(endItem, endDrag.getCurrentBag());
}
else
{
if (endItem is Equipment)
{
startDrag.setEquip((Equipment)endItem);
inventory.calculateStatBoost(attributes, false);
inventory.calculateStatBoost(((Equipment)endItem).getAttributes(), true);
}
else
{
return;
}
}
}
isSwap = true;
}