mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-10 13:51:53 +09:00
a console command to fill up inventory with every item
This commit is contained in:
@@ -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.")
|
||||
}
|
||||
}
|
||||
@@ -119,5 +119,11 @@ class ActorInventory() : FixtureInventory() {
|
||||
//println("[ActorInventory] consumed; ${item.durability}")
|
||||
}
|
||||
}
|
||||
|
||||
override fun nuke() {
|
||||
super.nuke()
|
||||
itemEquipped.fill(null)
|
||||
quickSlot.fill(null)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -212,6 +212,10 @@ open class FixtureInventory() {
|
||||
}
|
||||
return -(low + 1) // key not found
|
||||
}
|
||||
|
||||
open fun nuke() {
|
||||
itemList.clear()
|
||||
}
|
||||
}
|
||||
|
||||
class InventoryPair : Comparable<InventoryPair> {
|
||||
|
||||
Reference in New Issue
Block a user