new utility tiles: Sunstone and Daylight Capacitor

Former-commit-id: 1cd01c381d395a413baf50d851718205b2bfe1fd
Former-commit-id: 0199c31f7e83ff6396128602985cfa3c13e07e63
This commit is contained in:
Song Minjae
2016-05-08 23:32:38 +09:00
parent 127e6344cf
commit d3e1b17abd
9 changed files with 74 additions and 22 deletions

View File

@@ -107,6 +107,10 @@ object TileNameCode {
val SANDSTONE_BLACK = TilePropCodex.idDamageToIndex(15, 4)
val SANDSTONE_GREEN = TilePropCodex.idDamageToIndex(15, 5)
val LANTERN = TilePropCodex.idDamageToIndex(16, 0)
val SUNSTONE = TilePropCodex.idDamageToIndex(16, 1)
val DAYLIGHT_CAPACITOR = TilePropCodex.idDamageToIndex(16, 2)
val WATER_1 = TilePropCodex.idDamageToIndex(255, 0)
val WATER_2 = TilePropCodex.idDamageToIndex(255, 1)
val WATER_3 = TilePropCodex.idDamageToIndex(255, 2)

View File

@@ -1,5 +1,8 @@
package net.torvald.terrarum.tileproperties
import net.torvald.terrarum.Terrarum
import net.torvald.terrarum.gamemap.WorldTime
/**
* Created by minjaesong on 16-02-16.
*/
@@ -7,8 +10,7 @@ class TileProp {
var id: Int = 0
var damage: Int = 0
var name: String = ""
var nameKey: String = ""
/**
* @param opacity Raw RGB value, without alpha
@@ -29,7 +31,17 @@ class TileProp {
/**
* @param luminosity Raw RGB value, without alpha
*/
var luminosity: Int = 0
private var realLum: Int = 0
var luminosity: Int
set(value) {
realLum = value
}
get() = if (id == TileNameCode.SUNSTONE)
Terrarum.game.map.globalLight
else if (id == TileNameCode.DAYLIGHT_CAPACITOR)
Terrarum.game.globalLightByTime(WorldTime.DAY_LENGTH / 2)
else
realLum
var drop: Int = 0
var dropDamage: Int = 0

View File

@@ -67,10 +67,9 @@ class TilePropCodex {
}
private fun setProp(prop: TileProp, record: CSVRecord) {
prop.name = record.get("name")
prop.nameKey = record.get("name")
prop.id = intVal(record, "id")
prop.damage = intVal(record, "dmg")
prop.id = idDamageToIndex(intVal(record, "id"), intVal(record, "dmg"))
prop.opacity = intVal(record, "opacity")
prop.strength = intVal(record, "strength")
@@ -85,8 +84,8 @@ class TilePropCodex {
prop.isWallable = boolVal(record, "wall")
prop.isFallable = boolVal(record, "fall")
print(formatNum3(prop.id) + ":" + formatNum2(prop.damage))
println("\t" + prop.name)
print(formatNum3(intVal(record, "id")) + ":" + formatNum2(intVal(record, "dmg")))
println("\t" + prop.nameKey)
}
private fun intVal(rec: CSVRecord, s: String): Int {

View File

@@ -84,6 +84,8 @@
"15"; "4";"TILE_SANDSTONE_BLACK" ; "33587232"; "25";"1900"; "0"; "1"; "1"; "0"; "15"; "4"; "0";"16"
"15"; "5";"TILE_SANDSTONE_BLACK" ; "33587232"; "25";"1900"; "0"; "1"; "1"; "0"; "15"; "5"; "0";"16"
"16"; "0";"TILE_LANTERN_IRON_REGULAR"; "8396808"; "0"; "N/A"; "0"; "0"; "0"; "267619480"; "16"; "0"; "0";"16"
"16"; "1";"TILE_SUNSTONE" ; "33587232"; "0"; "N/A"; "0"; "1"; "0"; "0"; "16"; "1"; "0";"16"
"16"; "2";"TILE_DAYLIGHT_CAPACITOR" ; "33587232"; "0"; "N/A"; "0"; "1"; "0"; "0"; "16"; "2"; "0";"16"
"254"; "0";"TILE_LAVA" ;"260301048"; "100";"2600"; "1"; "0"; "0"; "205574144"; "N/A"; "N/A"; "0";"16"
"254"; "1";"TILE_LAVA" ;"260301048"; "100";"2600"; "1"; "0"; "0"; "205574144"; "N/A"; "N/A"; "0";"16"
"254"; "2";"TILE_LAVA" ;"260301048"; "100";"2600"; "1"; "0"; "0"; "205574144"; "N/A"; "N/A"; "0";"16"
@@ -123,6 +125,9 @@
# movr: Movement resistance, (walkspeedmax) / (1 + (n/16)), 16 halves movement speed
# dsty: density. As we are putting water an 1000, it is identical to specific gravity. [g/l]
# Sunstone: Artificial sunlight, change colour over time in sync with sunlight
# Sunlight capacitor: daylight at 11h of 22h day
# Defalut torch : L 70 a 51 b 59; real candlelight colour taken from properly configured camera.
# 16 colour palette : Old Apple Macintosh 16-colour palette
Can't render this file because it contains an unexpected character in line 1 and column 18.