a console command to fill up inventory with every item

This commit is contained in:
minjaesong
2022-02-22 17:22:54 +09:00
parent df6950c0b8
commit 596cd9b102
5 changed files with 51 additions and 1 deletions

View File

@@ -30,3 +30,4 @@ Teleport
ToggleNoClip ToggleNoClip
Zoom Zoom
DynToStatic DynToStatic
DebugFillInventory
1 CatStdout
30 ToggleNoClip
31 Zoom
32 DynToStatic
33 DebugFillInventory

View File

@@ -0,0 +1,17 @@
{
"CONTEXT_WORLD_NEW": "नयी दुनिया",
"MENU_LABEL_DELETE_WORLD": "दुनिया हटाओ",
"CONTEXT_WORLD_COUNT": "Worlds: ",
"GAME_INVENTORY_INGREDIENTS": "Ingredients",
"GAME_INVENTORY_POTIONS": "Potions",
"GAME_INVENTORY_BLOCKS": "Blocks",
"GAME_INVENTORY_WALLS": "Walls",
"CONTEXT_ITEM_TOOL_PLURAL": "Tools",
"GAME_INVENTORY_FAVORITES": "Favorites",
"GAME_INVENTORY_REGISTER": "Register",
"CONTEXT_ITEM_MAP": "नक्शा",
"MENU_LABEL_MENU": "मेन्यू",
"CONTEXT_GENERATOR_SEED": "बीज",
"GAME_ACTION_GRAPPLE": "ग्रेपल",
"GAME_ACTION_QUICKSEL": "तुरंत चयन"
}

View File

@@ -0,0 +1,22 @@
package net.torvald.terrarum.modulebasegame.console
import net.torvald.terrarum.INGAME
import net.torvald.terrarum.console.ConsoleCommand
import net.torvald.terrarum.console.Echo
import net.torvald.terrarum.modulebasegame.gameactors.PlayerBuilderSigrid
/**
* Created by minjaesong on 2022-02-22.
*/
internal object DebugFillInventory : ConsoleCommand {
override fun execute(args: Array<String>) {
INGAME.actorNowPlaying?.let {
it.inventory.nuke()
PlayerBuilderSigrid.fillTestInventory(it.inventory)
}
}
override fun printUsage() {
Echo("Populates inventory of the currently playing actor with every item currently available. Will overwrite existing inventory.")
}
}

View File

@@ -119,5 +119,11 @@ class ActorInventory() : FixtureInventory() {
//println("[ActorInventory] consumed; ${item.durability}") //println("[ActorInventory] consumed; ${item.durability}")
} }
} }
override fun nuke() {
super.nuke()
itemEquipped.fill(null)
quickSlot.fill(null)
}
} }

View File

@@ -212,6 +212,10 @@ open class FixtureInventory() {
} }
return -(low + 1) // key not found return -(low + 1) // key not found
} }
open fun nuke() {
itemList.clear()
}
} }
class InventoryPair : Comparable<InventoryPair> { class InventoryPair : Comparable<InventoryPair> {