fresh-new dynamic items (e.g. pickaxe) can be stacked

This commit is contained in:
Song Minjae
2017-04-25 02:59:59 +09:00
parent c35ba8201a
commit ebc8174d2c
12 changed files with 102 additions and 47 deletions

View File

@@ -32,13 +32,16 @@ interface Pocketed {
* Equips an item. If the item is not in the inventory, adds the item first.
*/
fun equipItem(item: InventoryItem) {
if (!inventory.contains(item))
if (!inventory.contains(item)) {
println("[Pocketed] Item does not exist; adding one before equipped")
inventory.add(item)
}
if (item.equipPosition >= 0) {
inventory.itemEquipped[item.equipPosition] = item
item.effectWhenEquipped(Terrarum.appgc, Terrarum.delta)
}
// else do nothing
}
fun equipped(item: InventoryItem): Boolean {