item is useable (wall is not!); tile breakage works confirmed

This commit is contained in:
minjaesong
2021-02-24 16:46:37 +09:00
parent b6a688c484
commit ed0bec0ee8
4 changed files with 12 additions and 139 deletions

View File

@@ -45,7 +45,7 @@ class ActorInventory(@Transient val actor: Pocketed, var maxCapacity: Int, var c
init {
}
fun add(itemID: ItemID, count: Int = 1) = add(ItemCodex[itemID]!!, count)
fun add(itemID: ItemID, count: Int = 1) = if (ItemCodex[itemID] == null) throw NullPointerException("Item not found: "+itemID) else add(ItemCodex[itemID]!!, count)
fun add(item: GameItem, count: Int = 1) {
println("[ActorInventory] add $item, $count")

View File

@@ -84,13 +84,13 @@ object PlayerBuilderSigrid {
}
// item ids are defined in <module>/items/itemid.csv
/*
inventory.add("item@basegame:0", 16) // copper pick
inventory.add("item@basegame:1") // iron pick
inventory.add("item@basegame:2") // steel pick
inventory.add("item@basegame:3", 9995) // wire piece
inventory.add("item@basegame:4", 385930603) // test tiki torch
inventory.add("item@basegame:5", 95) // crafting table
*/
inventory.add("item@basegame:1", 16) // copper pick
inventory.add("item@basegame:2") // iron pick
inventory.add("item@basegame:3") // steel pick
inventory.add("item@basegame:4", 9995) // wire piece
inventory.add("item@basegame:5", 385930603) // test tiki torch
//inventory.add("item@basegame:6", 95) // crafting table
}
}