mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-11 11:04:05 +09:00
establishing the concept of creature defence AV, some function name changing
Former-commit-id: 309f15be553b2bb0d391f89dab457748b6e3f063 Former-commit-id: 537edfa27245453cd2c37feed8d21861286425e5
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"racename" : "CONTEXT_RACE_HUMAN",
|
"racename" : "RACE_HUMAN",
|
||||||
"racenameplural" : "CONTEXT_RACE_HUMAN_PLURAL",
|
"racenameplural" : "RACE_HUMAN_PLURAL",
|
||||||
"baseheight" : 40,
|
"baseheight" : 40,
|
||||||
"basemass" : 60.0,
|
"basemass" : 60.0,
|
||||||
|
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
"scalemult" : [100,100,100,100,100,100,100],
|
"scalemult" : [100,100,100,100,100,100,100],
|
||||||
|
|
||||||
"encumbrance" : 1000,
|
"encumbrance" : 1000,
|
||||||
"basedefence" : "work in progress",
|
"basedefence" : 100,
|
||||||
|
|
||||||
"toolsize" : 15,
|
"toolsize" : 15,
|
||||||
|
|
||||||
|
|||||||
@@ -161,6 +161,10 @@ constructor() : Font {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun drawString(x: Float, y: Float, s: String, color: Color) {
|
override fun drawString(x: Float, y: Float, s: String, color: Color) {
|
||||||
|
GL11.glEnable(GL11.GL_BLEND)
|
||||||
|
GL11.glColorMask(true, true, true, true)
|
||||||
|
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA)
|
||||||
|
|
||||||
// hangul fonts first
|
// hangul fonts first
|
||||||
//hangulSheet.startUse() // disabling texture binding to make the font coloured
|
//hangulSheet.startUse() // disabling texture binding to make the font coloured
|
||||||
// JOHAB
|
// JOHAB
|
||||||
@@ -376,6 +380,8 @@ constructor() : Font {
|
|||||||
if (prevInstance != -1) {
|
if (prevInstance != -1) {
|
||||||
//sheetKey[prevInstance].endUse()
|
//sheetKey[prevInstance].endUse()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GL11.glEnd()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getSheetType(c: Char): Int {
|
private fun getSheetType(c: Char): Int {
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ constructor() : BasicGameState() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun render(gc: GameContainer, sbg: StateBasedGame, g: Graphics) {
|
override fun render(gc: GameContainer, sbg: StateBasedGame, g: Graphics) {
|
||||||
setBlendModeNormal()
|
setBlendNormal()
|
||||||
|
|
||||||
Terrarum.gameConfig["smoothlighting"] = KeyToggler.isOn(KEY_LIGHTMAP_SMOOTH)
|
Terrarum.gameConfig["smoothlighting"] = KeyToggler.isOn(KEY_LIGHTMAP_SMOOTH)
|
||||||
|
|
||||||
@@ -203,16 +203,16 @@ constructor() : BasicGameState() {
|
|||||||
MapDrawer.render(gc, g)
|
MapDrawer.render(gc, g)
|
||||||
|
|
||||||
|
|
||||||
setBlendModeMul()
|
setBlendMul()
|
||||||
|
|
||||||
MapDrawer.drawEnvOverlay(g)
|
MapDrawer.drawEnvOverlay(g)
|
||||||
|
|
||||||
if (!KeyToggler.isOn(KEY_LIGHTMAP_RENDER)) setBlendModeMul()
|
if (!KeyToggler.isOn(KEY_LIGHTMAP_RENDER)) setBlendMul()
|
||||||
else setBlendModeNormal()
|
else setBlendNormal()
|
||||||
|
|
||||||
LightmapRenderer.draw(g)
|
LightmapRenderer.draw(g)
|
||||||
|
|
||||||
setBlendModeNormal()
|
setBlendNormal()
|
||||||
|
|
||||||
uiContainer.forEach { ui -> ui.render(gc, g) }
|
uiContainer.forEach { ui -> ui.render(gc, g) }
|
||||||
debugWindow.render(gc, g)
|
debugWindow.render(gc, g)
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import com.torvald.terrarum.Terrarum
|
|||||||
import com.torvald.terrarum.tileproperties.TileNameCode
|
import com.torvald.terrarum.tileproperties.TileNameCode
|
||||||
import com.torvald.terrarum.tileproperties.TilePropCodex
|
import com.torvald.terrarum.tileproperties.TilePropCodex
|
||||||
import com.jme3.math.FastMath
|
import com.jme3.math.FastMath
|
||||||
import com.torvald.terrarum.setBlendModeMul
|
import com.torvald.terrarum.setBlendMul
|
||||||
import com.torvald.terrarum.setBlendModeNormal
|
import com.torvald.terrarum.setBlendNormal
|
||||||
import org.lwjgl.opengl.GL11
|
import org.lwjgl.opengl.GL11
|
||||||
import org.newdawn.slick.GameContainer
|
import org.newdawn.slick.GameContainer
|
||||||
import org.newdawn.slick.Graphics
|
import org.newdawn.slick.Graphics
|
||||||
@@ -206,16 +206,16 @@ object MapCamera {
|
|||||||
/**
|
/**
|
||||||
* render to camera
|
* render to camera
|
||||||
*/
|
*/
|
||||||
setBlendModeNormal()
|
setBlendNormal()
|
||||||
drawTiles(WALL, false)
|
drawTiles(WALL, false)
|
||||||
drawTiles(TERRAIN, false)
|
drawTiles(TERRAIN, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun renderFront(gc: GameContainer, g: Graphics) {
|
fun renderFront(gc: GameContainer, g: Graphics) {
|
||||||
setBlendModeMul()
|
setBlendMul()
|
||||||
drawTiles(TERRAIN, true)
|
drawTiles(TERRAIN, true)
|
||||||
setBlendModeNormal()
|
setBlendNormal()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun drawTiles(mode: Int, drawModeTilesBlendMul: Boolean) {
|
private fun drawTiles(mode: Int, drawModeTilesBlendMul: Boolean) {
|
||||||
|
|||||||
@@ -350,23 +350,23 @@ constructor(gamename: String) : StateBasedGame(gamename) {
|
|||||||
|
|
||||||
fun main(args: Array<String>) = Terrarum.main(args)
|
fun main(args: Array<String>) = Terrarum.main(args)
|
||||||
|
|
||||||
fun setBlendModeMul() {
|
fun setBlendMul() {
|
||||||
GL11.glEnable(GL11.GL_BLEND)
|
GL11.glEnable(GL11.GL_BLEND)
|
||||||
GL11.glColorMask(true, true, true, true)
|
GL11.glColorMask(true, true, true, true)
|
||||||
GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_ONE_MINUS_SRC_ALPHA)
|
GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_ONE_MINUS_SRC_ALPHA)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setBlendModeNormal() {
|
fun setBlendNormal() {
|
||||||
GL11.glEnable(GL11.GL_BLEND)
|
GL11.glEnable(GL11.GL_BLEND)
|
||||||
GL11.glColorMask(true, true, true, true)
|
GL11.glColorMask(true, true, true, true)
|
||||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA)
|
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setBlendModeAlphaMap() {
|
fun setBlendAlphaMap() {
|
||||||
GL11.glDisable(GL11.GL_BLEND)
|
GL11.glDisable(GL11.GL_BLEND)
|
||||||
GL11.glColorMask(false, false, false, true)
|
GL11.glColorMask(false, false, false, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun disableBlend() {
|
fun setBlendDisable() {
|
||||||
GL11.glDisable(GL11.GL_BLEND)
|
GL11.glDisable(GL11.GL_BLEND)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import java.security.SecureRandom
|
|||||||
object CreatureRawInjector {
|
object CreatureRawInjector {
|
||||||
|
|
||||||
const val JSONPATH = "./res/raw/creatures/"
|
const val JSONPATH = "./res/raw/creatures/"
|
||||||
private const val MULTIPLIER_RAW_ELEM_SUFFIX = AVKey.MULTIPLIER_SUFFIX
|
private const val MULTIPLIER_RAW_ELEM_SUFFIX = AVKey.MULT
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 'Injects' creature raw ActorValue to the ActorValue reference provided.
|
* 'Injects' creature raw ActorValue to the ActorValue reference provided.
|
||||||
|
|||||||
@@ -56,6 +56,8 @@ object PFSigrid {
|
|||||||
|
|
||||||
p.actorValue[AVKey.LUMINOSITY] = 5980540
|
p.actorValue[AVKey.LUMINOSITY] = 5980540
|
||||||
|
|
||||||
|
p.actorValue[AVKey.BASEDEFENCE] = 141
|
||||||
|
|
||||||
p.actorValue["selectedtile"] = 16
|
p.actorValue["selectedtile"] = 16
|
||||||
|
|
||||||
p.setHitboxDimension(15, p.actorValue.getAsInt(AVKey.BASEHEIGHT)!!, 10, 0)
|
p.setHitboxDimension(15, p.actorValue.getAsInt(AVKey.BASEHEIGHT)!!, 10, 0)
|
||||||
|
|||||||
@@ -4,22 +4,22 @@ package com.torvald.terrarum.gameactors
|
|||||||
* Created by minjaesong on 16-04-02.
|
* Created by minjaesong on 16-04-02.
|
||||||
*/
|
*/
|
||||||
object AVKey {
|
object AVKey {
|
||||||
const val MULTIPLIER_SUFFIX = "mult"
|
const val MULT = "mult"
|
||||||
|
|
||||||
const val SPEED = "speed"
|
const val SPEED = "speed"
|
||||||
const val SPEEDMULT = "speed$MULTIPLIER_SUFFIX"
|
const val SPEEDMULT = "speed$MULT"
|
||||||
const val ACCEL = "accel"
|
const val ACCEL = "accel"
|
||||||
const val ACCELMULT = "accel$MULTIPLIER_SUFFIX"
|
const val ACCELMULT = "accel$MULT"
|
||||||
const val SCALE = "scale"
|
const val SCALE = "scale"
|
||||||
const val BASEHEIGHT = "baseheight"
|
const val BASEHEIGHT = "baseheight"
|
||||||
const val BASEMASS = "basemass"
|
const val BASEMASS = "basemass"
|
||||||
const val JUMPPOWER = "jumppower"
|
const val JUMPPOWER = "jumppower"
|
||||||
const val JUMPPOWERMULT = "jumppower$MULTIPLIER_SUFFIX"
|
const val JUMPPOWERMULT = "jumppower$MULT"
|
||||||
|
|
||||||
const val STRENGTH = "strength"
|
const val STRENGTH = "strength"
|
||||||
const val ENCUMBRANCE = "encumbrance"
|
const val ENCUMBRANCE = "encumbrance"
|
||||||
const val LUMINOSITY = "luminosity"
|
const val LUMINOSITY = "luminosity"
|
||||||
const val PHYSIQUEMULT = "physique$MULTIPLIER_SUFFIX"
|
const val PHYSIQUEMULT = "physique$MULT"
|
||||||
|
|
||||||
const val NAME = "name"
|
const val NAME = "name"
|
||||||
|
|
||||||
@@ -27,4 +27,8 @@ object AVKey {
|
|||||||
const val RACENAMEPLURAL = "racenameplural"
|
const val RACENAMEPLURAL = "racenameplural"
|
||||||
const val TOOLSIZE = "toolsize"
|
const val TOOLSIZE = "toolsize"
|
||||||
const val INTELLIGENT = "intelligent"
|
const val INTELLIGENT = "intelligent"
|
||||||
|
|
||||||
|
const val BASEDEFENCE = "basedefence" // creature base
|
||||||
|
const val ARMOURDEFENCE = "armourdefence" // armour points
|
||||||
|
const val ARMOURDEFENCEMULT = "armourdefence$MULT"
|
||||||
}
|
}
|
||||||
@@ -2,8 +2,8 @@ package com.torvald.terrarum.ui
|
|||||||
|
|
||||||
import com.torvald.imagefont.GameFontWhite
|
import com.torvald.imagefont.GameFontWhite
|
||||||
import com.jme3.math.FastMath
|
import com.jme3.math.FastMath
|
||||||
import com.torvald.terrarum.disableBlend
|
import com.torvald.terrarum.setBlendDisable
|
||||||
import com.torvald.terrarum.setBlendModeNormal
|
import com.torvald.terrarum.setBlendNormal
|
||||||
import org.lwjgl.opengl.GL11
|
import org.lwjgl.opengl.GL11
|
||||||
import org.newdawn.slick.*
|
import org.newdawn.slick.*
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ constructor(override var width: Int, isBlackVariant: Boolean) : UICanvas {
|
|||||||
override fun render(gc: GameContainer, g: Graphics) {
|
override fun render(gc: GameContainer, g: Graphics) {
|
||||||
val canvasG = uidrawCanvas.graphics
|
val canvasG = uidrawCanvas.graphics
|
||||||
|
|
||||||
disableBlend()
|
setBlendDisable()
|
||||||
drawSegments(canvasG)
|
drawSegments(canvasG)
|
||||||
canvasG.setDrawMode(Graphics.MODE_ALPHA_MAP)
|
canvasG.setDrawMode(Graphics.MODE_ALPHA_MAP)
|
||||||
drawSegments(canvasG)
|
drawSegments(canvasG)
|
||||||
@@ -74,7 +74,7 @@ constructor(override var width: Int, isBlackVariant: Boolean) : UICanvas {
|
|||||||
canvasG.drawString(messagesList[i], (messageWindowRadius + 4).toFloat(), (messageWindowRadius + GLYPH_HEIGHT * i).toFloat())
|
canvasG.drawString(messagesList[i], (messageWindowRadius + 4).toFloat(), (messageWindowRadius + GLYPH_HEIGHT * i).toFloat())
|
||||||
}
|
}
|
||||||
|
|
||||||
setBlendModeNormal()
|
setBlendNormal()
|
||||||
g.drawImage(uidrawCanvas, 0f, 0f, Color(1f,1f,1f,opacity))
|
g.drawImage(uidrawCanvas, 0f, 0f, Color(1f,1f,1f,opacity))
|
||||||
|
|
||||||
canvasG.clear()
|
canvasG.clear()
|
||||||
|
|||||||
Reference in New Issue
Block a user