weather in weathercodex

This commit is contained in:
minjaesong
2024-04-14 00:18:30 +09:00
parent 670a308c78
commit 4fba0f70c9
48 changed files with 311 additions and 208 deletions

View File

@@ -9,7 +9,7 @@ import net.torvald.terrarum.gameworld.fmod
/**
* Created by minjaesong on 2016-02-16.
*/
class BlockProp {
class BlockProp : TaggedProp {
var id: ItemID = ""
var numericID: Int = -1
@@ -75,16 +75,7 @@ class BlockProp {
BlockCodex[BlockCodex.tileToVirtual[id]!![offset]]._lumCol.lane(channel)
}
fun hasTag(s: String) = tags.contains(s)
fun hasAnyTagOf(vararg s: String) = s.any { hasTag(it) }
fun hasAnyTag(s: Collection<String>) = s.any { hasTag(it) }
fun hasAnyTag(s: Array<String>) = s.any { hasTag(it) }
fun hasAllTagOf(vararg s: String) = s.all { hasTag(it) }
fun hasAllTag(s: Collection<String>) = s.all { hasTag(it) }
fun hasAllTag(s: Array<String>) = s.all { hasTag(it) }
fun hasNoTagOf(vararg s: String) = s.none { hasTag(it) }
fun hasNoTag(s: Collection<String>) = s.none { hasTag(it) }
fun hasNoTag(s: Array<String>) = s.none { hasTag(it) }
override fun hasTag(s: String) = tags.contains(s)
/**
* @param luminosity

View File

@@ -108,7 +108,7 @@ object BlockPropUtil {
return when (prop.dynamicLuminosityFunction) {
1 -> getTorchFlicker(prop)
2 -> (INGAME.world).globalLight.cpy() // current global light
3 -> WeatherMixer.getGlobalLightOfTimeOfNoon(WeatherMixer.weatherDict["generic01"]!!).cpy() // daylight at noon
3 -> WeatherMixer.getGlobalLightOfTimeOfNoon(WeatherCodex.getById("generic01")!!).cpy() // daylight at noon
4 -> getSlowBreath(prop)
5 -> getPulsate(prop)
else -> prop.baseLumCol

View File

@@ -1,6 +1,7 @@
package net.torvald.terrarum.blockproperties
import net.torvald.terrarum.App
import net.torvald.terrarum.TaggedProp
import net.torvald.terrarum.gameitems.ItemID
import net.torvald.terrarum.utils.CSVFetcher
import org.apache.commons.csv.CSVRecord
@@ -78,11 +79,11 @@ class OreCodex {
}
class OreProp {
class OreProp : TaggedProp {
var id: String = ""
var item: ItemID = ""
var tags = HashSet<String>()
fun hasTag(s: String) = tags.contains(s)
override fun hasTag(s: String) = tags.contains(s)
}

View File

@@ -1,12 +1,13 @@
package net.torvald.terrarum.blockproperties
import net.torvald.terrarum.Codex
import net.torvald.terrarum.TaggedProp
import net.torvald.terrarum.gameitems.ItemID
/**
* Created by minjaesong on 2021-07-28.
*/
class WireProp {
class WireProp : TaggedProp {
var id: ItemID = ""
var numericID: Int = -1
@@ -27,15 +28,5 @@ class WireProp {
@Transient var tags = HashSet<String>()
fun hasTag(s: String) = tags.contains(s)
fun hasAnyTagOf(vararg s: String) = s.any { hasTag(it) }
fun hasAnyTag(s: Collection<String>) = s.any { hasTag(it) }
fun hasAnyTag(s: Array<String>) = s.any { hasTag(it) }
fun hasAllTagOf(vararg s: String) = s.all { hasTag(it) }
fun hasAllTag(s: Collection<String>) = s.all { hasTag(it) }
fun hasAllTag(s: Array<String>) = s.all { hasTag(it) }
fun hasNoTagOf(vararg s: String) = s.none { hasTag(it) }
fun hasNoTag(s: Collection<String>) = s.none { hasTag(it) }
fun hasNoTag(s: Array<String>) = s.none { hasTag(it) }
override fun hasTag(s: String) = tags.contains(s)
}