diff --git a/.idea/codeStyleSettings.xml b/.idea/codeStyleSettings.xml
index 446f81346..e65ac807b 100644
--- a/.idea/codeStyleSettings.xml
+++ b/.idea/codeStyleSettings.xml
@@ -6,9 +6,6 @@
-
-
-
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 000000000..adea9a3b8
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml
new file mode 100644
index 000000000..79ee123c2
--- /dev/null
+++ b/.idea/codeStyles/codeStyleConfig.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
index b87105a8d..3058433f8 100644
--- a/.idea/compiler.xml
+++ b/.idea/compiler.xml
@@ -1,22 +1,8 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml
index 992ca8389..0dd4b3546 100644
--- a/.idea/kotlinc.xml
+++ b/.idea/kotlinc.xml
@@ -1,14 +1,6 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/KotlinJavaRuntime.xml b/.idea/libraries/KotlinJavaRuntime.xml
deleted file mode 100644
index c630c0b87..000000000
--- a/.idea/libraries/KotlinJavaRuntime.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/COPYING.md b/COPYING.md
index ce176d958..be0c6a6a8 100644
--- a/COPYING.md
+++ b/COPYING.md
@@ -1,6 +1,6 @@
*Terrarum*
-Copyright (C) 2013-2017 Minjaesong (Torvald)
+Copyright (C) 2013-2018 Minjaesong (Torvald)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/assets/18BitColour.frag b/assets/18BitColour.frag
new file mode 100644
index 000000000..72b203fc6
--- /dev/null
+++ b/assets/18BitColour.frag
@@ -0,0 +1,14 @@
+varying vec4 v_color;
+varying vec2 v_texCoords;
+uniform sampler2D u_texture;
+
+void main(void) {
+ vec4 color = texture2D(u_texture, v_texCoords).rgba;
+
+ color.r = floor(63.0 * color.r + 0.5) / 63.0;
+ color.g = floor(63.0 * color.g + 0.5) / 63.0;
+ color.b = floor(63.0 * color.b + 0.5) / 63.0;
+ // a: passthrough
+
+ gl_FragColor = vec4(color.rgb, 0.0);
+}
\ No newline at end of file
diff --git a/assets/modules/basegame/sprites/phystest_lunarlander.tga b/assets/modules/basegame/sprites/phystest_lunarlander.tga
new file mode 100644
index 000000000..325508a8f
--- /dev/null
+++ b/assets/modules/basegame/sprites/phystest_lunarlander.tga
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:da06b05e9da722460afcfffb7aa62413bd249857ae4bb26fb43957e354f496ea
+size 2348
diff --git a/lib/TerrarumSansBitmap.jar b/lib/TerrarumSansBitmap.jar
index ba32af160..112d06133 100644
Binary files a/lib/TerrarumSansBitmap.jar and b/lib/TerrarumSansBitmap.jar differ
diff --git a/lib/kotlin-reflect.jar b/lib/kotlin-reflect.jar
index 83439d248..2194938dc 100755
Binary files a/lib/kotlin-reflect.jar and b/lib/kotlin-reflect.jar differ
diff --git a/lib/kotlin-stdlib.jar b/lib/kotlin-stdlib.jar
index b7cc29ec3..7bb6ac304 100644
Binary files a/lib/kotlin-stdlib.jar and b/lib/kotlin-stdlib.jar differ
diff --git a/src/net/torvald/random/HQRNG.kt b/src/net/torvald/random/HQRNG.kt
index 141faa06c..b30448ab3 100644
--- a/src/net/torvald/random/HQRNG.kt
+++ b/src/net/torvald/random/HQRNG.kt
@@ -1,5 +1,7 @@
package net.torvald.random
+import net.torvald.terrarum.serialise.toLittleLong
+import org.apache.commons.codec.digest.DigestUtils
import java.util.Random
/**
@@ -14,8 +16,10 @@ class HQRNG @JvmOverloads constructor(seed: Long = System.nanoTime()) : Random()
if (seed == 0L)
throw IllegalArgumentException("Invalid seed: cannot be zero")
- s0 = (6364136223846793005L * seed + 1442695040888963407L)
- s1 = (6364136223846793005L * s0 + 1442695040888963407L)
+ val hash = DigestUtils.sha256(seed.toString())
+
+ s0 = hash.copyOfRange(0, 8).toLittleLong()
+ s1 = hash.copyOfRange(8, 16).toLittleLong()
}
override fun nextLong(): Long {
diff --git a/src/net/torvald/terrarum/Ingame.kt b/src/net/torvald/terrarum/Ingame.kt
index ccea6600d..1e9aa988b 100644
--- a/src/net/torvald/terrarum/Ingame.kt
+++ b/src/net/torvald/terrarum/Ingame.kt
@@ -1449,6 +1449,7 @@ class Ingame(val batch: SpriteBatch) : Screen {
BlocksDrawer.resize(Terrarum.WIDTH, Terrarum.HEIGHT)
LightmapRenderer.resize(Terrarum.WIDTH, Terrarum.HEIGHT)
+ MegaRainGovernor.resize()
worldDrawFrameBuffer.dispose()
worldDrawFrameBuffer = FrameBuffer(worldFBOformat, Terrarum.WIDTH, Terrarum.HEIGHT, false)
diff --git a/src/net/torvald/terrarum/PostProcessor.kt b/src/net/torvald/terrarum/PostProcessor.kt
index f70ebc5a0..b88220ee8 100644
--- a/src/net/torvald/terrarum/PostProcessor.kt
+++ b/src/net/torvald/terrarum/PostProcessor.kt
@@ -6,6 +6,9 @@ import com.badlogic.gdx.graphics.Texture
import com.badlogic.gdx.graphics.g2d.SpriteBatch
import com.badlogic.gdx.graphics.glutils.FrameBuffer
+/**
+ * Must be called by the App Loader
+ */
object PostProcessor {
private val batch = SpriteBatch()
@@ -21,7 +24,7 @@ object PostProcessor {
//Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT)
- batch.shader = null
+ batch.shader = Terrarum.shader18Bit // essential design decision; 262 144 colours VGA; NOT related with LCD monitor's internals
batch.inUse {
val texture = screenTexHolder.colorBufferTexture
batch.shader.setUniformMatrix("u_projTrans", batch.projectionMatrix)
diff --git a/src/net/torvald/terrarum/Terrarum.kt b/src/net/torvald/terrarum/Terrarum.kt
index 08bb9909c..a4ba736c6 100644
--- a/src/net/torvald/terrarum/Terrarum.kt
+++ b/src/net/torvald/terrarum/Terrarum.kt
@@ -2,6 +2,7 @@ package net.torvald.terrarum
import com.badlogic.gdx.Gdx
import com.badlogic.gdx.Screen
+import com.badlogic.gdx.assets.AssetManager
import com.badlogic.gdx.graphics.*
import com.badlogic.gdx.graphics.g2d.SpriteBatch
import com.badlogic.gdx.graphics.glutils.FrameBuffer
@@ -10,6 +11,7 @@ import com.badlogic.gdx.graphics.glutils.ShapeRenderer
import com.badlogic.gdx.utils.GdxRuntimeException
import com.google.gson.JsonArray
import com.google.gson.JsonPrimitive
+import net.torvald.terrarum.gameactors.ActorWithPhysics
import net.torvald.terrarum.gameactors.floorInt
import net.torvald.terrarum.imagefont.TinyAlphNum
import net.torvald.terrarum.imagefont.Watch7SegMain
@@ -98,7 +100,9 @@ object Terrarum : Screen {
/**
* To be used with physics simulator
*/
- val TARGET_FPS: Double = 26.0 + (2.0 / 3.0) // lower value == faster gravity response (IT WON'T HOTSWAP!!)
+ val TARGET_FPS: Double = 26.0 + (2.0 / 3.0)
+ // 26.0 + (2.0 / 3.0) // lower value == faster gravity response (IT WON'T HOTSWAP!!)
+ // protip: using METER, game unit and SI unit will have same number
/**
* To be used with render, to achieve smooth frame drawing
@@ -212,6 +216,7 @@ object Terrarum : Screen {
lateinit var shaderBlendGlow: ShaderProgram
lateinit var shaderRGBOnly: ShaderProgram
lateinit var shaderAtoGrey: ShaderProgram
+ lateinit var shader18Bit: ShaderProgram
lateinit var textureWhiteSquare: Texture
@@ -225,6 +230,9 @@ object Terrarum : Screen {
val deltaTime: Float; get() = Gdx.graphics.rawDeltaTime
+ lateinit var assetManager: AssetManager
+
+
init {
println("$NAME version ${TerrarumAppLoader.getVERSION_STRING()}")
@@ -322,6 +330,8 @@ object Terrarum : Screen {
}
+ assetManager = AssetManager()
+
println("[Terrarum] GL_VERSION = $GL_VERSION")
println("[Terrarum] GL_MAX_TEXTURE_SIZE = $GL_MAX_TEXTURE_SIZE")
@@ -383,6 +393,8 @@ object Terrarum : Screen {
shaderRGBOnly = ShaderProgram(Gdx.files.internal("assets/4096.vert"), Gdx.files.internal("assets/rgbonly.frag"))
shaderAtoGrey = ShaderProgram(Gdx.files.internal("assets/4096.vert"), Gdx.files.internal("assets/aonly.frag"))
+ shader18Bit = ShaderProgram(Gdx.files.internal("assets/4096.vert"), Gdx.files.internal("assets/18BitColour.frag"))
+
if (!shaderBlendGlow.isCompiled) {
Gdx.app.log("shaderBlendGlow", shaderBlendGlow.log)
diff --git a/src/net/torvald/terrarum/blockproperties/BlockCodex.kt b/src/net/torvald/terrarum/blockproperties/BlockCodex.kt
index 323e05efa..6d6808094 100644
--- a/src/net/torvald/terrarum/blockproperties/BlockCodex.kt
+++ b/src/net/torvald/terrarum/blockproperties/BlockCodex.kt
@@ -124,6 +124,8 @@ object BlockCodex {
}
catch (e: NumberFormatException) {
}
+ catch (e1: IllegalStateException) {
+ }
return ret
}
@@ -135,6 +137,8 @@ object BlockCodex {
}
catch (e: NumberFormatException) {
}
+ catch (e1: IllegalStateException) {
+ }
return ret
}
diff --git a/src/net/torvald/terrarum/console/CommandDict.kt b/src/net/torvald/terrarum/console/CommandDict.kt
index be0c503f7..0b34f1191 100644
--- a/src/net/torvald/terrarum/console/CommandDict.kt
+++ b/src/net/torvald/terrarum/console/CommandDict.kt
@@ -54,6 +54,7 @@ object CommandDict {
"spawntapestry" to SpawnTapestry,
"imtest" to JavaIMTest,
"cheatmotherfuckernootnoot" to CheatWarnTest,
+ "spawnlunarlander" to SpawnPhysTestLunarLander,
/* !! */"exportlayer" to ExportLayerData,
diff --git a/src/net/torvald/terrarum/console/SpawnPhysTestBall.kt b/src/net/torvald/terrarum/console/SpawnPhysTestBall.kt
index 97a056a37..9df630d79 100644
--- a/src/net/torvald/terrarum/console/SpawnPhysTestBall.kt
+++ b/src/net/torvald/terrarum/console/SpawnPhysTestBall.kt
@@ -21,10 +21,7 @@ internal object SpawnPhysTestBall : ConsoleCommand {
val yvel = if (args.size >= 4) args[3].toDouble() else 0.0
val ball = PhysTestBall(Terrarum.ingame!!.world)
- ball.setPosition(
- (mouseX + WorldCamera.x).toDouble(),
- (mouseY + WorldCamera.y).toDouble()
- )
+ ball.setPosition(mouseX, mouseY)
ball.elasticity = elasticity
ball.applyForce(Vector2(xvel, yvel))
@@ -34,10 +31,7 @@ internal object SpawnPhysTestBall : ConsoleCommand {
val elasticity = args[1].toDouble()
val ball = PhysTestBall(Terrarum.ingame!!.world)
- ball.setPosition(
- (mouseX + WorldCamera.x).toDouble(),
- (mouseY + WorldCamera.y).toDouble()
- )
+ ball.setPosition(mouseX, mouseY)
ball.elasticity = elasticity
Terrarum.ingame!!.addNewActor(ball)
diff --git a/src/net/torvald/terrarum/console/SpawnPhysTestLunarLander.kt b/src/net/torvald/terrarum/console/SpawnPhysTestLunarLander.kt
new file mode 100644
index 000000000..6af77b71d
--- /dev/null
+++ b/src/net/torvald/terrarum/console/SpawnPhysTestLunarLander.kt
@@ -0,0 +1,24 @@
+package net.torvald.terrarum.console
+
+import net.torvald.terrarum.Terrarum
+import net.torvald.terrarum.gameactors.PhysTestLuarLander
+import net.torvald.terrarum.worlddrawer.WorldCamera
+
+/**
+ * Created by minjaesong on 2018-01-18.
+ */
+internal object SpawnPhysTestLunarLander : ConsoleCommand {
+ override fun execute(args: Array) {
+ val mouseX = Terrarum.mouseX
+ val mouseY = Terrarum.mouseY
+ val lander = PhysTestLuarLander(Terrarum.ingame!!.world)
+
+ lander.setPosition(mouseX, mouseY)
+
+ Terrarum.ingame!!.addNewActor(lander)
+ }
+
+ override fun printUsage() {
+ Echo("control it with arrow keys")
+ }
+}
\ No newline at end of file
diff --git a/src/net/torvald/terrarum/gameactors/ActorWithPhysics.kt b/src/net/torvald/terrarum/gameactors/ActorWithPhysics.kt
index 0dfc0ab45..7da1bf9e2 100644
--- a/src/net/torvald/terrarum/gameactors/ActorWithPhysics.kt
+++ b/src/net/torvald/terrarum/gameactors/ActorWithPhysics.kt
@@ -1375,7 +1375,7 @@ open class ActorWithPhysics(val world: GameWorld, renderOrder: RenderOrder, val
* Constants
*/
- @Transient private val METER = 24.0
+ @Transient val METER = 24.0
/**
* [m / s^2] * SI_TO_GAME_ACC -> [px / InternalFrame^2]
*/
diff --git a/src/net/torvald/terrarum/gameactors/ParticleMegaRain.kt b/src/net/torvald/terrarum/gameactors/ParticleMegaRain.kt
index 5aac6a78f..9d72aabcb 100644
--- a/src/net/torvald/terrarum/gameactors/ParticleMegaRain.kt
+++ b/src/net/torvald/terrarum/gameactors/ParticleMegaRain.kt
@@ -10,7 +10,7 @@ import net.torvald.terrarum.Terrarum
/**
* Created by minjaesong on 2017-12-18.
*/
-class ParticleMegaRain(posX: Double, posY: Double) : ParticleBase(Actor.RenderOrder.BEHIND, false, 3.2f) {
+class ParticleMegaRain(posX: Double, posY: Double) : ParticleBase(Actor.RenderOrder.BEHIND, true, 3.2f) {
init {
body = MegaRainGovernor.get()
@@ -22,7 +22,7 @@ class ParticleMegaRain(posX: Double, posY: Double) : ParticleBase(Actor.RenderOr
w, h
)
- velocity.y = 18.0
+ velocity.y = 11.5 * ActorWithPhysics.SI_TO_GAME_VEL
}
}
@@ -46,11 +46,12 @@ object MegaRainGovernor {
val h = body.height
bodies = Array(1024) {
- val pixmap = Pixmap(Terrarum.WIDTH * 2, Terrarum.HEIGHT / 4, Pixmap.Format.RGBA8888)
+ //val pixmap = Pixmap(Terrarum.WIDTH * 2, Terrarum.HEIGHT / 4, Pixmap.Format.RGBA8888)
+ val pixmap = Pixmap(64, 64, Pixmap.Format.RGBA8888)
val rng = HQRNG()
- repeat(64) {
+ repeat(rng.nextInt(2) + 3) { // 3 or 4
val rndX = rng.nextInt(pixmap.width - body.width)
val rndY = rng.nextInt(pixmap.height - body.height)
@@ -71,7 +72,7 @@ object MegaRainGovernor {
fun get(): TextureRegion {
if (withdrawCounter >= bodies.size) {
withdrawCounter = 0
- bodies.shuffle()
+ //bodies.shuffle() // if pre-rendered random set is sufficiently large, it'd look random enough
}
return bodies[withdrawCounter++]
diff --git a/src/net/torvald/terrarum/gameactors/PhysTestLuarLander.kt b/src/net/torvald/terrarum/gameactors/PhysTestLuarLander.kt
new file mode 100644
index 000000000..a5d4a538e
--- /dev/null
+++ b/src/net/torvald/terrarum/gameactors/PhysTestLuarLander.kt
@@ -0,0 +1,60 @@
+package net.torvald.terrarum.gameactors
+
+import com.badlogic.gdx.Gdx
+import com.badlogic.gdx.Input
+import com.badlogic.gdx.graphics.Color
+import com.badlogic.gdx.graphics.Texture
+import com.badlogic.gdx.graphics.g2d.SpriteBatch
+import net.torvald.terrarum.ModMgr
+import net.torvald.terrarum.gameworld.GameWorld
+
+/**
+ * Created by minjaesong on 2018-01-17.
+ */
+class PhysTestLuarLander(world: GameWorld) : ActorWithPhysics(world, RenderOrder.MIDTOP), Controllable {
+
+ private val texture = Texture(ModMgr.getGdxFile("basegame", "sprites/phystest_lunarlander.tga"))
+
+ override val hitbox: Hitbox
+
+ init {
+ hitbox = Hitbox(0.0, 0.0, 0.0, 0.0)
+ setHitboxDimension(texture.width, texture.height, 0, 0)
+
+ actorValue[AVKey.SPEED] = 8.0
+ avBaseMass = 18650.0
+ }
+
+ override fun run() {
+ super.run()
+ }
+
+ override fun update(delta: Float) {
+ super.update(delta)
+
+ if (Gdx.input.isKeyPressed(Input.Keys.UP)) {
+ controllerMoveDelta!!.y = avSpeedCap
+ }
+ }
+
+ override fun keyDown(keycode: Int): Boolean {
+ return true
+ }
+
+ override fun drawGlow(batch: SpriteBatch) {
+ }
+
+ override fun drawBody(batch: SpriteBatch) {
+ batch.color = Color.WHITE
+ batch.draw(texture, hitbox.startX.toFloat(), hitbox.endY.toFloat(), hitbox.width.toFloat(), -hitbox.height.toFloat())
+ }
+
+ override fun onActorValueChange(key: String, value: Any?) {
+ super.onActorValueChange(key, value)
+ }
+
+ override fun dispose() {
+ super.dispose()
+ texture.dispose()
+ }
+}
\ No newline at end of file
diff --git a/src/net/torvald/terrarum/gameactors/ai/SmarterSlimes.kt b/src/net/torvald/terrarum/gameactors/ai/SmarterSlimes.kt
index c33ff3b73..b469b2b36 100644
--- a/src/net/torvald/terrarum/gameactors/ai/SmarterSlimes.kt
+++ b/src/net/torvald/terrarum/gameactors/ai/SmarterSlimes.kt
@@ -1,7 +1,51 @@
package net.torvald.terrarum.gameactors.ai
+import net.torvald.terrarum.Terrarum
+import net.torvald.terrarum.gameactors.HumanoidNPC
+import net.torvald.terrarum.gameactors.Second
+
/**
+ * Slime's stupid AI but can adjust his jump power to smack you as fast as possible
+ * by achieving "allostasis".
+ *
* Created by minjaesong on 2017-12-10.
*/
-class SmarterSlimes {
+class SmarterSlimes : ActorAI {
+
+ val memoryCells = IntArray(12, { 0 })
+ // index 0: most recent memory
+ // intentionally making it stupid by using less precise INT
+ // also we're not discrimination different enemies, making it further dumb
+ // stores "overshoot" amount (learn target) of x position
+
+ var maxJumpDist: Double = -1.0
+
+ var cooltime: Second = 5f
+
+ override fun update(actor: HumanoidNPC, delta: Float) {
+ // sensor: compare(my X pos, nearest enemy's X pos)
+ maxJumpDist = actor.avSpeedCap * actor.jumpAirTime // speed * air_time
+ // (to be precise, we need simulation just like jumpAirTime, but oh well; we like it LINEAR)
+
+
+ // TEST: just target player
+ val playerXPos = Terrarum.ingame!!.player.centrePosPoint.x
+ val thisXPos = actor.centrePosPoint.x
+ val xDiff = thisXPos - playerXPos
+
+
+
+ // extrapolate from memories:
+ // otherwise linear extp. except the slope is d of 0th and 2nd point
+
+
+
+ if (xDiff > 0) {
+ actor.moveLeft()
+ }
+ }
+
+
+
+
}
\ No newline at end of file
diff --git a/src/net/torvald/terrarum/langpack/Lang.kt b/src/net/torvald/terrarum/langpack/Lang.kt
index 840b6d8cb..591cc0351 100644
--- a/src/net/torvald/terrarum/langpack/Lang.kt
+++ b/src/net/torvald/terrarum/langpack/Lang.kt
@@ -184,12 +184,12 @@ object Lang {
val index = lastChar.toInt() - HANGUL_SYL_START
return if (index % 28 == 0) word + "는" else word + "은"
}
- else if (lastChar >= 'A' && lastChar <= 'Z' || lastChar >= 'a' && lastChar <= 'z') {
+ else if (lastChar in 'A'..'Z' || lastChar in 'a'..'z') {
val index = (lastChar.toInt() - 0x41) % 0x20
return if (HANGUL_POST_INDEX_ALPH[index] == 0) word + "는" else word + "은"
}
else {
- return "은(는)"
+ return "은"
}
}
@@ -200,12 +200,12 @@ object Lang {
val index = lastChar.toInt() - HANGUL_SYL_START
return if (index % 28 == 0) word + "가" else word + "이"
}
- else if (lastChar >= 'A' && lastChar <= 'Z' || lastChar >= 'a' && lastChar <= 'z') {
+ else if (lastChar in 'A'..'Z' || lastChar in 'a'..'z') {
val index = (lastChar.toInt() - 0x41) % 0x20
return if (HANGUL_POST_INDEX_ALPH[index] == 0) word + "가" else word + "이"
}
else {
- return "이(가)"
+ return "이"
}
}
diff --git a/src/net/torvald/terrarum/ui/UICheatDetected.kt b/src/net/torvald/terrarum/ui/UICheatDetected.kt
index 8e1a15d0c..7ef0cb123 100644
--- a/src/net/torvald/terrarum/ui/UICheatDetected.kt
+++ b/src/net/torvald/terrarum/ui/UICheatDetected.kt
@@ -28,6 +28,9 @@ class UICheatDetected : UICanvas() {
private val backgroundCol = Color(0x181818C0)
override fun renderUI(batch: SpriteBatch, camera: Camera) {
+ Terrarum.ingame?.consoleHandler?.setAsClose()
+ Terrarum.ingame?.consoleHandler?.isVisible = false
+
batch.color = backgroundCol
batch.fillRect(0f, 0f, width.toFloat(), height.toFloat())
diff --git a/src/net/torvald/terrarum/weather/WeatherMixer.kt b/src/net/torvald/terrarum/weather/WeatherMixer.kt
index 8aee96016..8affcf1a2 100644
--- a/src/net/torvald/terrarum/weather/WeatherMixer.kt
+++ b/src/net/torvald/terrarum/weather/WeatherMixer.kt
@@ -84,11 +84,10 @@ object WeatherMixer {
if (KeyToggler.isOn(Input.Keys.F2)) {
val playerPosX = player.hitbox.centeredX
val playerPosY = player.hitbox.centeredY
- kotlin.repeat(1) {
- // 4 seems good
+ kotlin.repeat(7) {
val rainParticle = ParticleMegaRain(
playerPosX + HQRNG().nextInt(Terrarum.WIDTH) - Terrarum.HALFW,
- playerPosY - Terrarum.HALFH
+ playerPosY - Terrarum.HEIGHT
)
Terrarum.ingame!!.addParticle(rainParticle)
}
@@ -229,13 +228,13 @@ object WeatherMixer {
var mixFrom: String?
try { mixFrom = JSON.get("mixFrom").asJsonPrimitive.asString }
- catch (e: NullPointerException) { mixFrom = null }
+ catch (e: IllegalStateException) { mixFrom = null }
var mixPercentage: Double?
try { mixPercentage = JSON.get("mixPercentage").asJsonPrimitive.asDouble }
- catch (e: NullPointerException) { mixPercentage = null }
+ catch (e: IllegalStateException) { mixPercentage = null }
diff --git a/work_files/GameDesign/WORLD_BIOLOGY.md b/work_files/GameDesign/WORLD_BIOLOGY.md
index c9bc7bddc..47cde02e9 100644
--- a/work_files/GameDesign/WORLD_BIOLOGY.md
+++ b/work_files/GameDesign/WORLD_BIOLOGY.md
@@ -10,3 +10,78 @@ Follow these fomulae:
- (ThisWgt / TargetWgt) ^ (3/4)
+# Cultivation and Forestry
+
+Lots of species to grow, comsume, process and trade
+
+- _Stardew Valley_ is specialised for the cultivation
+
+- Ground texture: use Actors
+
+- Crops grow stages: 4
+- Item sprite stages: 2 (fresh and rotten)
+
+If any cheating is detected (corrupted or tampered save, _Resetti_ triggered, addinventory), all itemised crops will rot and cheat-inflicted ground plants will reset their age to zero
+
+## Edible
+
+### Primary Foodstuffs
+
+- Wheat
+- Maize
+- Aubergine
+- Tomato
+- Leek (Allium ampeloprasum) / Bunching onion (A. fistulosum, in Chinese/Japanese/Korean language pack)
+- Garlic
+- Pumpkin
+- Cabbage
+- Hot Pepper (Capsicum annuum)
+
+### Primary Rooting Foodstuffs
+
+- Potato
+- Parsnip
+- Carrot
+
+### Secondary Foodstuffs
+
+- Ginger
+- Green Bean
+- Coffee
+- Strawberry
+- Hop
+- Grape
+
+### Exotic Foodstuffs
+
+- Rice
+- Napa Cabbage (Brassica rapa Pekinensis)
+
+### Trade Plants
+
+- Ginseng (Panax ginseng)
+
+## Fruit Trees
+
+- Apple
+- Orange (Citrus × sinensis)
+- Peach
+- Cherry (Prunus avium)
+- Pomegranate
+- Lemon
+- Pear (Pyrus communis)
+
+## Inedible
+
+- Sunflower
+- Rose
+- Hibiscus Flower
+
+
+# "Stalk" Market
+
+Some crops have highly varing market prices, which resembles stock market.
+
+- 4 Random number sets, one set is chosen and consumed
+- Market price = RNG-Table + Randomised "deviation"
+- Random sets are value noise with different width of "waves"
\ No newline at end of file
diff --git a/work_files/graphics/sprites/fixtures/crops_-_part_of_1x3_fixtures_collection.psd b/work_files/graphics/sprites/fixtures/crops_-_part_of_1x3_fixtures_collection.psd
new file mode 100644
index 000000000..5b024502d
--- /dev/null
+++ b/work_files/graphics/sprites/fixtures/crops_-_part_of_1x3_fixtures_collection.psd
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:81803855d665c670f5789d86dd5eae1e36ad0421037b862ac8d6e0513d95a48e
+size 97786
diff --git a/work_files/graphics/sprites/fixtures/furnitures_2x2.psd b/work_files/graphics/sprites/fixtures/furnitures_2x2.psd
new file mode 100644
index 000000000..c01d29945
--- /dev/null
+++ b/work_files/graphics/sprites/fixtures/furnitures_2x2.psd
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:fbd537f6c46720fc8b71d9c1b6e51218d704b1870c014eef09094a4eef0b315b
+size 23392
diff --git a/work_files/graphics/terrain/wire.psd b/work_files/graphics/terrain/wire.psd
index 83de4330b..120fd6032 100755
--- a/work_files/graphics/terrain/wire.psd
+++ b/work_files/graphics/terrain/wire.psd
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:668514a0a84a0ddda99fb42acb231560794a9c565554f8e287b085137744db74
-size 3992662
+oid sha256:d9cf21bcea5d57f1d016b02a195438f80b09a30dcc00ec0587acc448459c4975
+size 3979520