From 959873413dfa08ad862f69a19f504dba2f50d07c Mon Sep 17 00:00:00 2001 From: minjaesong Date: Sun, 7 May 2017 18:39:26 +0900 Subject: [PATCH] =?UTF-8?q?fucked=20up=20while=20making=20ActorValue=20del?= =?UTF-8?q?egated=20=E2=80=93=20not=20applicable;=20can't=20have=20default?= =?UTF-8?q?=20value=20making=20commits=20for=20files=20to=20keep=20so=20th?= =?UTF-8?q?at=20I=20can=20discard=20changes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basegame/weathers/generic_light.tga | 2 +- .../weathers/generic_light_new_untested.tga | 3 - .../dwarventech/virtualcomputer/bfvt.kts | 4 +- src/net/torvald/terrarum/StateInGame.kt | 2 +- .../torvald/terrarum/console/CommandDict.kt | 86 +++++++++---------- src/net/torvald/terrarum/gameactors/Hitbox.kt | 4 + .../torvald/terrarum/gameworld/WorldTime.kt | 4 +- .../{ => Engine-specific}/BACKEND_DESIGN.md | 0 8 files changed, 53 insertions(+), 52 deletions(-) delete mode 100644 assets/modules/basegame/weathers/generic_light_new_untested.tga rename work_files/GameDesign/{ => Engine-specific}/BACKEND_DESIGN.md (100%) diff --git a/assets/modules/basegame/weathers/generic_light.tga b/assets/modules/basegame/weathers/generic_light.tga index 0c362a7ea..e0c02b01b 100644 --- a/assets/modules/basegame/weathers/generic_light.tga +++ b/assets/modules/basegame/weathers/generic_light.tga @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:eb1262241005177bed648b2d2217e84e0cde6ec969755fd7e445cbce389d065a +oid sha256:109fa915564f7ec2a8e1e56f018a0ef20a5ae8f014573ac355684de8921e75d8 size 836 diff --git a/assets/modules/basegame/weathers/generic_light_new_untested.tga b/assets/modules/basegame/weathers/generic_light_new_untested.tga deleted file mode 100644 index e0c02b01b..000000000 --- a/assets/modules/basegame/weathers/generic_light_new_untested.tga +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:109fa915564f7ec2a8e1e56f018a0ef20a5ae8f014573ac355684de8921e75d8 -size 836 diff --git a/assets/modules/dwarventech/virtualcomputer/bfvt.kts b/assets/modules/dwarventech/virtualcomputer/bfvt.kts index ca82d7311..332198b86 100644 --- a/assets/modules/dwarventech/virtualcomputer/bfvt.kts +++ b/assets/modules/dwarventech/virtualcomputer/bfvt.kts @@ -241,9 +241,9 @@ class BFVM( if (r1 in bfOpcodes) { if (optimizeLevel >= 1) { - // [-] + // [-] or [+] if (r1 == JPZ) { - if (program[pc + 1] == DEC && program[pc + 2] == JPN) { + if ((program[pc + 1] == DEC || program[pc + 1] == INC) && program[pc + 2] == JPN) { pc += 3 putOp(LDZ) continue diff --git a/src/net/torvald/terrarum/StateInGame.kt b/src/net/torvald/terrarum/StateInGame.kt index 1c330ca24..e0da95e20 100644 --- a/src/net/torvald/terrarum/StateInGame.kt +++ b/src/net/torvald/terrarum/StateInGame.kt @@ -142,7 +142,7 @@ class StateInGame : BasicGameState() { // test actor - addNewActor(PlayerBuilderCynthia()) + //addNewActor(PlayerBuilderCynthia()) diff --git a/src/net/torvald/terrarum/console/CommandDict.kt b/src/net/torvald/terrarum/console/CommandDict.kt index dcce18f6f..5a9bee6fb 100644 --- a/src/net/torvald/terrarum/console/CommandDict.kt +++ b/src/net/torvald/terrarum/console/CommandDict.kt @@ -8,51 +8,51 @@ import java.util.HashMap object CommandDict { internal val dict: HashMap = hashMapOf( - Pair("echo", Echo), - Pair("error", EchoError), - Pair("setav", SetAV), - Pair("qqq", QuitApp), - Pair("codex", CodexEdictis), - Pair("export", ExportMap), - Pair("gc", ForceGC), - Pair("getav", GetAV), - Pair("getlocale", GetLocale), - Pair("togglenoclip", ToggleNoClip), - Pair("nc", ToggleNoClip), - Pair("setlocale", SetLocale), - Pair("zoom", Zoom), - Pair("teleport", Teleport), - Pair("tp", Teleport), - Pair("cat", CatStdout), - Pair("exportav", ExportAV), - Pair("setgl", SetGlobalLightOverride), - Pair("getfaction", GetFactioning), - Pair("auth", Authenticator), - Pair("batch", Batch), - Pair("settime", SetTime), - Pair("gettime", GetTime), - Pair("settimedelta", SetTimeDelta), - Pair("help", Help), - Pair("version", Version), - Pair("seed", Seed), - Pair("println", EchoConsole), - Pair("inventory", Inventory), - Pair("avtracker", AVTracker), - Pair("actorslist", ActorsList), - Pair("setscale", SetScale), - Pair("kill", KillActor), + "echo" to Echo, + "error" to EchoError, + "setav" to SetAV, + "qqq" to QuitApp, + "codex" to CodexEdictis, + "export" to ExportMap, + "gc" to ForceGC, + "getav" to GetAV, + "getlocale" to GetLocale, + "togglenoclip" to ToggleNoClip, + "nc" to ToggleNoClip, + "setlocale" to SetLocale, + "zoom" to Zoom, + "teleport" to Teleport, + "tp" to Teleport, + "cat" to CatStdout, + "exportav" to ExportAV, + "setgl" to SetGlobalLightOverride, + "getfaction" to GetFactioning, + "auth" to Authenticator, + "batch" to Batch, + "settime" to SetTime, + "gettime" to GetTime, + "settimedelta" to SetTimeDelta, + "help" to Help, + "version" to Version, + "seed" to Seed, + "println" to EchoConsole, + "inventory" to Inventory, + "avtracker" to AVTracker, + "actorslist" to ActorsList, + "setscale" to SetScale, + "kill" to KillActor, // Test codes - Pair("bulletintest", SetBulletin), - Pair("gsontest", GsonTest), - Pair("tips", PrintRandomTips), - Pair("langtest", LangTest), - Pair("testgetlight", TestGetLight), - Pair("spawnball", SpawnPhysTestBall), - Pair("spawntorch", SpawnTikiTorch), - Pair("musictest", MusicTest), - Pair("spawntapestry", SpawnTapestry), - Pair("imtest", JavaIMTest) + "bulletintest" to SetBulletin, + "gsontest" to GsonTest, + "tips" to PrintRandomTips, + "langtest" to LangTest, + "testgetlight" to TestGetLight, + "spawnball" to SpawnPhysTestBall, + "spawntorch" to SpawnTikiTorch, + "musictest" to MusicTest, + "spawntapestry" to SpawnTapestry, + "imtest" to JavaIMTest ) operator fun get(commandName: String): ConsoleCommand { diff --git a/src/net/torvald/terrarum/gameactors/Hitbox.kt b/src/net/torvald/terrarum/gameactors/Hitbox.kt index b24d3d5e4..33c5f4b0b 100644 --- a/src/net/torvald/terrarum/gameactors/Hitbox.kt +++ b/src/net/torvald/terrarum/gameactors/Hitbox.kt @@ -133,4 +133,8 @@ class Hitbox(x1: Double, y1: Double, width: Double, height: Double) { fun fromTwoPoints(x1: Double, y1: Double, x2: Double, y2: Double) = Hitbox(x1, y1, x2 - x1, y2 - y1) } + + operator fun minus(other: Hitbox): Vector2 { + return Vector2(other.centeredX - this.centeredX, other.centeredY - this.centeredY) + } } diff --git a/src/net/torvald/terrarum/gameworld/WorldTime.kt b/src/net/torvald/terrarum/gameworld/WorldTime.kt index be201d0af..c46d43c53 100644 --- a/src/net/torvald/terrarum/gameworld/WorldTime.kt +++ b/src/net/torvald/terrarum/gameworld/WorldTime.kt @@ -163,8 +163,8 @@ class WorldTime(initTime: Long = 0L) { private fun Long.toPositiveInt() = this.and(0x7FFFFFFF).toInt() private fun Long.abs() = Math.abs(this) - /** Format: "%A %d %B %Y %X" */ - fun getFormattedTime() = "${getDayNameShort()} " + + /** Format: "%A, %d %B %Y %X" */ + fun getFormattedTime() = "${getDayNameShort()}, " + "$days " + "${getMonthNameShort()} " + "$years " + diff --git a/work_files/GameDesign/BACKEND_DESIGN.md b/work_files/GameDesign/Engine-specific/BACKEND_DESIGN.md similarity index 100% rename from work_files/GameDesign/BACKEND_DESIGN.md rename to work_files/GameDesign/Engine-specific/BACKEND_DESIGN.md