mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-10 18:44:05 +09:00
dump (another useless message)
This commit is contained in:
@@ -16,7 +16,7 @@ internal object AVTracker : ConsoleCommand {
|
||||
|
||||
override fun execute(args: Array<String>) {
|
||||
if (args.size < 2) {
|
||||
jPanelInstances.add(ActorValueTracker((Terrarum.ingame!! as Ingame).player))
|
||||
jPanelInstances.add(ActorValueTracker((Terrarum.ingame!! as Ingame).playableActor))
|
||||
}
|
||||
else {
|
||||
try {
|
||||
|
||||
@@ -16,7 +16,7 @@ internal object ExportAV : ConsoleCommand {
|
||||
if (args.size == 2) {
|
||||
try {
|
||||
JsonWriter.writeToFile(
|
||||
(Terrarum.ingame!! as Ingame).player.actorValue,
|
||||
(Terrarum.ingame!! as Ingame).playableActor.actorValue,
|
||||
Terrarum.defaultDir + "/Exports/" + args[1] + ".json")
|
||||
|
||||
Echo("ExportAV: exported to " + args[1] + ".json")
|
||||
|
||||
@@ -62,7 +62,7 @@ internal object ExportMap : ConsoleCommand {
|
||||
}
|
||||
|
||||
override fun execute(args: Array<String>) {
|
||||
val world = (Terrarum.ingame!! as Ingame).world
|
||||
val world = (Terrarum.ingame!!.world)
|
||||
|
||||
if (args.size == 2) {
|
||||
|
||||
|
||||
@@ -17,9 +17,9 @@ internal object GetAV : ConsoleCommand {
|
||||
val ingame = Terrarum.ingame!! as Ingame
|
||||
|
||||
|
||||
if (args.size == 1 && ingame.player != null) {
|
||||
if (args.size == 1 && ingame.playableActor != null) {
|
||||
// print all actorvalue of player
|
||||
val av = ingame.player.actorValue
|
||||
val av = ingame.playableActor.actorValue
|
||||
val keyset = av.keySet
|
||||
|
||||
Echo("$ccW== ActorValue list for ${ccY}player $ccW==")
|
||||
@@ -37,14 +37,14 @@ internal object GetAV : ConsoleCommand {
|
||||
if (!args[1].isNum()) { // args[1] is ActorValue name
|
||||
Echo("${ccW}player.$ccM${args[1]} $ccW= " +
|
||||
ccG +
|
||||
ingame.player.actorValue[args[1]] +
|
||||
ingame.playableActor.actorValue[args[1]] +
|
||||
" $ccO" +
|
||||
ingame.player.actorValue[args[1]]!!.javaClass.simpleName
|
||||
ingame.playableActor.actorValue[args[1]]!!.javaClass.simpleName
|
||||
)
|
||||
println("[GetAV] player.${args[1]} = " +
|
||||
ingame.player.actorValue[args[1]] +
|
||||
ingame.playableActor.actorValue[args[1]] +
|
||||
" " +
|
||||
ingame.player.actorValue[args[1]]!!.javaClass.simpleName
|
||||
ingame.playableActor.actorValue[args[1]]!!.javaClass.simpleName
|
||||
)
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -6,8 +6,7 @@ import net.torvald.terrarum.console.ConsoleCommand
|
||||
import net.torvald.terrarum.console.Echo
|
||||
import net.torvald.terrarum.console.EchoError
|
||||
import net.torvald.terrarum.gameactors.Factionable
|
||||
import net.torvald.terrarum.modulebasegame.Ingame
|
||||
import net.torvald.terrarum.modulebasegame.gameactors.Player
|
||||
import net.torvald.terrarum.modulebasegame.gameactors.IngamePlayer
|
||||
import net.torvald.terrarumsansbitmap.gdx.GameFontBase
|
||||
|
||||
/**
|
||||
@@ -29,8 +28,8 @@ internal object GetFactioning : ConsoleCommand {
|
||||
fun printOutFactioning(id: Int) {
|
||||
val a = Terrarum.ingame!!.getActorByID(id)
|
||||
if (a is Factionable) {
|
||||
Echo("$ccW== Faction assignment for $ccY${if (id == Player.PLAYER_REF_ID) "player" else id.toString()} $ccW==")
|
||||
println("[GetFactioning] == Faction assignment for '${if (id == Player.PLAYER_REF_ID) "player" else id.toString()}' ==")
|
||||
Echo("$ccW== Faction assignment for $ccY${if (id == Terrarum.PLAYER_REF_ID) "player" else id.toString()} $ccW==")
|
||||
println("[GetFactioning] == Faction assignment for '${if (id == Terrarum.PLAYER_REF_ID) "player" else id.toString()}' ==")
|
||||
|
||||
// get all factioning data of player
|
||||
val factionSet = a.faction
|
||||
@@ -84,7 +83,7 @@ internal object GetFactioning : ConsoleCommand {
|
||||
}
|
||||
|
||||
if (args.size == 1) {
|
||||
printOutFactioning(Player.PLAYER_REF_ID)
|
||||
printOutFactioning(Terrarum.PLAYER_REF_ID)
|
||||
}
|
||||
else {
|
||||
if (!args[1].isNum()) {
|
||||
|
||||
@@ -3,7 +3,7 @@ package net.torvald.terrarum.modulebasegame.console
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.console.ConsoleCommand
|
||||
import net.torvald.terrarum.console.Echo
|
||||
import net.torvald.terrarum.modulebasegame.Ingame
|
||||
import net.torvald.terrarum.modulebasegame.gameworld.GameWorldExtension
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2016-03-20.
|
||||
@@ -11,7 +11,7 @@ import net.torvald.terrarum.modulebasegame.Ingame
|
||||
internal object GetTime : ConsoleCommand {
|
||||
override fun execute(args: Array<String>) {
|
||||
|
||||
val worldTime = (Terrarum.ingame!! as Ingame).world.time
|
||||
val worldTime = (Terrarum.ingame!!.world as GameWorldExtension).time
|
||||
Echo(worldTime.getFormattedTime())
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import java.io.IOException
|
||||
internal object GsonTest : ConsoleCommand {
|
||||
override fun execute(args: Array<String>) {
|
||||
if (args.size == 2) {
|
||||
val avelem = Gson().toJsonTree((Terrarum.ingame!! as Ingame).player)
|
||||
val avelem = Gson().toJsonTree((Terrarum.ingame!! as Ingame).playableActor)
|
||||
|
||||
val jsonString = avelem.toString()
|
||||
|
||||
|
||||
@@ -20,10 +20,10 @@ object ImportLayerData : ConsoleCommand {
|
||||
|
||||
//val fis = GZIPInputStream(FileInputStream(args[1])) // this gzip is kaput
|
||||
val fis = FileInputStream(args[1])
|
||||
(Terrarum.ingame!! as Ingame).world = ReadLayerData(fis)
|
||||
(Terrarum.ingame!! as Ingame).player.setPosition(
|
||||
(Terrarum.ingame!! as Ingame).world.spawnY * FeaturesDrawer.TILE_SIZE.toDouble(),
|
||||
(Terrarum.ingame!! as Ingame).world.spawnX * FeaturesDrawer.TILE_SIZE.toDouble()
|
||||
(Terrarum.ingame!!.world) = ReadLayerData(fis)
|
||||
(Terrarum.ingame!! as Ingame).playableActor.setPosition(
|
||||
(Terrarum.ingame!!.world).spawnY * FeaturesDrawer.TILE_SIZE.toDouble(),
|
||||
(Terrarum.ingame!!.world).spawnX * FeaturesDrawer.TILE_SIZE.toDouble()
|
||||
)
|
||||
fis.close()
|
||||
Echo("Successfully loaded ${args[1]}")
|
||||
|
||||
@@ -4,7 +4,7 @@ import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.console.ConsoleCommand
|
||||
import net.torvald.terrarum.console.Echo
|
||||
import net.torvald.terrarum.console.EchoError
|
||||
import net.torvald.terrarum.modulebasegame.gameactors.Player
|
||||
import net.torvald.terrarum.modulebasegame.gameactors.IngamePlayer
|
||||
import net.torvald.terrarum.modulebasegame.gameactors.Pocketed
|
||||
import net.torvald.terrarum.itemproperties.ItemCodex
|
||||
import net.torvald.terrarum.modulebasegame.Ingame
|
||||
@@ -14,7 +14,7 @@ import net.torvald.terrarum.modulebasegame.Ingame
|
||||
*/
|
||||
internal object Inventory : ConsoleCommand {
|
||||
|
||||
private var target: Pocketed? = (Terrarum.ingame!! as Ingame).player
|
||||
private var target: Pocketed? = (Terrarum.ingame!! as Ingame).playableActor
|
||||
|
||||
override fun execute(args: Array<String>) {
|
||||
if (args.size == 1) {
|
||||
@@ -48,7 +48,7 @@ internal object Inventory : ConsoleCommand {
|
||||
}
|
||||
}
|
||||
|
||||
private fun setTarget(actorRefId: Int = Player.PLAYER_REF_ID) {
|
||||
private fun setTarget(actorRefId: Int = Terrarum.PLAYER_REF_ID) {
|
||||
val actor = Terrarum.ingame!!.getActorByID(actorRefId)
|
||||
if (actor !is Pocketed) {
|
||||
EchoError("Cannot edit inventory of incompatible actor: $actor")
|
||||
|
||||
@@ -12,8 +12,8 @@ import net.torvald.terrarum.modulebasegame.Ingame
|
||||
internal object Seed : ConsoleCommand {
|
||||
|
||||
override fun execute(args: Array<String>) {
|
||||
Echo("Map$ccW: $ccG${(Terrarum.ingame!! as Ingame).world.generatorSeed}")
|
||||
println("[seed] Map$ccW: $ccG${(Terrarum.ingame!! as Ingame).world.generatorSeed}")
|
||||
Echo("Map$ccW: $ccG${(Terrarum.ingame!!.world).generatorSeed}")
|
||||
println("[seed] Map$ccW: $ccG${(Terrarum.ingame!!.world).generatorSeed}")
|
||||
// TODO display randomiser seed
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ internal object SetAV : ConsoleCommand {
|
||||
return
|
||||
}
|
||||
|
||||
(Terrarum.ingame!! as Ingame).player.actorValue[args[1]] = newValue
|
||||
(Terrarum.ingame!! as Ingame).playableActor.actorValue[args[1]] = newValue
|
||||
Echo("${ccW}Set $ccM${args[1]} ${ccW}for ${ccY}player ${ccW}to $ccG$newValue")
|
||||
println("[SetAV] set ActorValue '${args[1]}' for player to '$newValue'.")
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import net.torvald.terrarum.console.ConsoleCommand
|
||||
import net.torvald.terrarum.console.Echo
|
||||
import net.torvald.terrarum.console.EchoError
|
||||
import net.torvald.terrarum.modulebasegame.Ingame
|
||||
import net.torvald.terrarum.modulebasegame.gameactors.ActorWithPhysics
|
||||
import net.torvald.terrarum.gameactors.ActorWBMovable
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2017-01-20.
|
||||
@@ -14,13 +14,13 @@ internal object SetScale : ConsoleCommand {
|
||||
override fun execute(args: Array<String>) {
|
||||
if (args.size == 2 || args.size == 3) {
|
||||
try {
|
||||
val targetID = if (args.size == 3) args[1].toInt() else (Terrarum.ingame!! as Ingame).player.referenceID
|
||||
val targetID = if (args.size == 3) args[1].toInt() else (Terrarum.ingame!! as Ingame).playableActor.referenceID
|
||||
val scale = args[if (args.size == 3) 2 else 1].toDouble()
|
||||
|
||||
val target = Terrarum.ingame!!.getActorByID(targetID!!)
|
||||
|
||||
if (target !is ActorWithPhysics) {
|
||||
EchoError("Target is not ActorWithPhysics")
|
||||
if (target !is ActorWBMovable) {
|
||||
EchoError("Target is not ActorWBMovable")
|
||||
}
|
||||
else {
|
||||
target.scale = scale
|
||||
|
||||
@@ -11,7 +11,7 @@ import net.torvald.terrarum.modulebasegame.Ingame
|
||||
*/
|
||||
internal object SetTime : ConsoleCommand {
|
||||
override fun execute(args: Array<String>) {
|
||||
val world = (Terrarum.ingame!! as Ingame).world
|
||||
val world = (Terrarum.ingame!! as Ingame).gameworld
|
||||
|
||||
|
||||
if (args.size == 2) {
|
||||
|
||||
@@ -13,7 +13,7 @@ internal object SetTimeDelta : ConsoleCommand {
|
||||
val HARD_LIMIT = 60
|
||||
|
||||
override fun execute(args: Array<String>) {
|
||||
val world = (Terrarum.ingame!! as Ingame).world
|
||||
val world = (Terrarum.ingame!! as Ingame).gameworld
|
||||
|
||||
|
||||
if (args.size == 2) {
|
||||
|
||||
@@ -13,7 +13,7 @@ import org.dyn4j.geometry.Vector2
|
||||
internal object SpawnPhysTestBall : ConsoleCommand {
|
||||
@Throws(Exception::class)
|
||||
override fun execute(args: Array<String>) {
|
||||
val world = (Terrarum.ingame!! as Ingame).world
|
||||
val world = (Terrarum.ingame!!.world)
|
||||
|
||||
|
||||
val mouseX = Terrarum.mouseX
|
||||
|
||||
@@ -13,7 +13,7 @@ internal object SpawnPhysTestLunarLander : ConsoleCommand {
|
||||
override fun execute(args: Array<String>) {
|
||||
val mouseX = Terrarum.mouseX
|
||||
val mouseY = Terrarum.mouseY
|
||||
val lander = PhysTestLuarLander((Terrarum.ingame!! as Ingame).world)
|
||||
val lander = PhysTestLuarLander((Terrarum.ingame!!.world))
|
||||
|
||||
lander.setPosition(mouseX, mouseY)
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import net.torvald.terrarum.modulebasegame.gameactors.FixtureTikiTorch
|
||||
*/
|
||||
internal object SpawnTikiTorch : ConsoleCommand {
|
||||
override fun execute(args: Array<String>) {
|
||||
val torch = FixtureTikiTorch((Terrarum.ingame!! as Ingame).world)
|
||||
val torch = FixtureTikiTorch((Terrarum.ingame!!.world))
|
||||
torch.setPosition(Terrarum.mouseX, Terrarum.mouseY)
|
||||
|
||||
Terrarum.ingame!!.addNewActor(torch)
|
||||
|
||||
@@ -6,7 +6,7 @@ import net.torvald.terrarum.console.ConsoleCommand
|
||||
import net.torvald.terrarum.console.Echo
|
||||
import net.torvald.terrarum.console.EchoError
|
||||
import net.torvald.terrarum.modulebasegame.Ingame
|
||||
import net.torvald.terrarum.modulebasegame.gameactors.ActorWithPhysics
|
||||
import net.torvald.terrarum.gameactors.ActorWBMovable
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2016-01-24.
|
||||
@@ -27,32 +27,32 @@ internal object Teleport : ConsoleCommand {
|
||||
return
|
||||
}
|
||||
|
||||
(Terrarum.ingame!! as Ingame).player.setPosition(x.toDouble(), y.toDouble())
|
||||
(Terrarum.ingame!! as Ingame).playableActor.setPosition(x.toDouble(), y.toDouble())
|
||||
}
|
||||
else if (args.size == 4) {
|
||||
if (args[2].toLowerCase() != "to") {
|
||||
EchoError("missing 'to' on teleport command")
|
||||
return
|
||||
}
|
||||
val fromActor: ActorWithPhysics
|
||||
val targetActor: ActorWithPhysics
|
||||
val fromActor: ActorWBMovable
|
||||
val targetActor: ActorWBMovable
|
||||
try {
|
||||
val fromActorID = args[1].toInt()
|
||||
val targetActorID = if (args[3].toLowerCase() == "player")
|
||||
(Terrarum.ingame!! as Ingame).player.referenceID!!
|
||||
(Terrarum.ingame!! as Ingame).playableActor.referenceID!!
|
||||
else
|
||||
args[3].toInt()
|
||||
|
||||
// if from == target, ignore the action
|
||||
if (fromActorID == targetActorID) return
|
||||
|
||||
if (Terrarum.ingame!!.getActorByID(fromActorID) !is ActorWithPhysics ||
|
||||
Terrarum.ingame!!.getActorByID(targetActorID) !is ActorWithPhysics) {
|
||||
if (Terrarum.ingame!!.getActorByID(fromActorID) !is ActorWBMovable ||
|
||||
Terrarum.ingame!!.getActorByID(targetActorID) !is ActorWBMovable) {
|
||||
throw IllegalArgumentException()
|
||||
}
|
||||
else {
|
||||
fromActor = Terrarum.ingame!!.getActorByID(fromActorID) as ActorWithPhysics
|
||||
targetActor = Terrarum.ingame!!.getActorByID(targetActorID) as ActorWithPhysics
|
||||
fromActor = Terrarum.ingame!!.getActorByID(fromActorID) as ActorWBMovable
|
||||
targetActor = Terrarum.ingame!!.getActorByID(targetActorID) as ActorWBMovable
|
||||
}
|
||||
}
|
||||
catch (e: NumberFormatException) {
|
||||
@@ -75,7 +75,7 @@ internal object Teleport : ConsoleCommand {
|
||||
return
|
||||
}
|
||||
|
||||
val actor: ActorWithPhysics
|
||||
val actor: ActorWBMovable
|
||||
val x: Int
|
||||
val y: Int
|
||||
try {
|
||||
@@ -83,11 +83,11 @@ internal object Teleport : ConsoleCommand {
|
||||
y = args[4].toInt() * FeaturesDrawer.TILE_SIZE + FeaturesDrawer.TILE_SIZE / 2
|
||||
val actorID = args[1].toInt()
|
||||
|
||||
if (Terrarum.ingame!!.getActorByID(actorID) !is ActorWithPhysics) {
|
||||
if (Terrarum.ingame!!.getActorByID(actorID) !is ActorWBMovable) {
|
||||
throw IllegalArgumentException()
|
||||
}
|
||||
else {
|
||||
actor = Terrarum.ingame!!.getActorByID(actorID) as ActorWithPhysics
|
||||
actor = Terrarum.ingame!!.getActorByID(actorID) as ActorWBMovable
|
||||
}
|
||||
}
|
||||
catch (e: NumberFormatException) {
|
||||
|
||||
@@ -10,9 +10,9 @@ import net.torvald.terrarum.modulebasegame.Ingame
|
||||
*/
|
||||
internal object ToggleNoClip : ConsoleCommand {
|
||||
override fun execute(args: Array<String>) {
|
||||
val status = (Terrarum.ingame!! as Ingame).player.isNoClip()
|
||||
val status = (Terrarum.ingame!! as Ingame).playableActor.isNoClip
|
||||
|
||||
(Terrarum.ingame!! as Ingame).player.setNoClip(!status)
|
||||
(Terrarum.ingame!! as Ingame).playableActor.isNoClip = !status
|
||||
Echo("Set no-clip status to " + (!status).toString())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user