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

@@ -69,7 +69,7 @@ object AxeCore {
val actionInterval = actorvalue.getAsDouble(AVKey.ACTION_INTERVAL)!!
val swingDmgToFrameDmg = delta.toDouble() / actionInterval
if (INGAME.WORLD_UPDATE_TIMER % 11 == (Math.random() * 3).toInt()) {
if (INGAME.WORLD_UPDATE_TIMER % 11 == (Math.random() * 3).toLong()) {
PickaxeCore.makeNoiseTileTouching(actor, tile)
}
@@ -95,7 +95,7 @@ object AxeCore {
val actionInterval = actorvalue.getAsDouble(AVKey.ACTION_INTERVAL)!!
val swingDmgToFrameDmg = delta.toDouble() / actionInterval
if (INGAME.WORLD_UPDATE_TIMER % 11 == (Math.random() * 3).toInt()) {
if (INGAME.WORLD_UPDATE_TIMER % 11 == (Math.random() * 3).toLong()) {
PickaxeCore.makeNoiseTileTouching(actor, tile)
}
@@ -121,13 +121,13 @@ object AxeCore {
usageStatus = usageStatus or true
}
// check if tile under mouse is a tree
else if (tileprop.hasAllTag(listOf("TREE", "TREETRUNK") + additionalCheckTags)) {
else if (tileprop.hasAllTags(listOf("TREE", "TREETRUNK") + additionalCheckTags)) {
val actionInterval = actorvalue.getAsDouble(AVKey.ACTION_INTERVAL)!!
val swingDmgToFrameDmg = delta.toDouble() / actionInterval
val isLargeTree = tileprop.hasTag("TREELARGE")
val axePowerMult = if (isLargeTree) 0.5f else 1f
if (INGAME.WORLD_UPDATE_TIMER % 11 == (Math.random() * 3).toInt()) {
if (INGAME.WORLD_UPDATE_TIMER % 11 == (Math.random() * 3).toLong()) {
PickaxeCore.makeNoiseTileTouching(actor, tile)
}
@@ -144,8 +144,8 @@ object AxeCore {
val tileThereR = INGAME.world.getTileFromTerrain(x+1, y - upCtr)
val propThereL = BlockCodex[tileThereL]
val propThereR = BlockCodex[tileThereR]
val treeTrunkXoff = if (propThereL.hasAllTagOf("TREELARGE", "TREETRUNK")) -1
else if (propThereR.hasAllTagOf("TREELARGE", "TREETRUNK")) 1
val treeTrunkXoff = if (propThereL.hasAllTagsOf("TREELARGE", "TREETRUNK")) -1
else if (propThereR.hasAllTagsOf("TREELARGE", "TREETRUNK")) 1
else 0
if (treeTrunkXoff != 0) {
@@ -162,7 +162,7 @@ object AxeCore {
val tileHere = INGAME.world.getTileFromTerrain(x, y - upCtr)
val propHere = BlockCodex[tileHere]
if (propHere.hasAllTagOf("TREELARGE", "TREETRUNK")) {
if (propHere.hasAllTagsOf("TREELARGE", "TREETRUNK")) {
INGAME.world.setTileTerrain(x, y - upCtr, Block.AIR, false)
PickaxeCore.dropItem(propHere.drop, x, y - upCtr)
PickaxeCore.makeDust(tile, x, y - upCtr, 2 + Math.random().roundToInt())

View File

@@ -68,7 +68,7 @@ open class FixtureItemBase(originalID: ItemID, val fixtureClassName: String) : G
// update the ghost sparingly
if (INGAME.WORLD_UPDATE_TIMER % 2 == 0) {
if (INGAME.WORLD_UPDATE_TIMER % 2 == 0L) {
(INGAME as TerrarumIngame).blockMarkingActor.let {
val item = ghostItem.get()

View File

@@ -2,12 +2,11 @@ package net.torvald.terrarum.modulebasegame.gameitems
import com.badlogic.gdx.graphics.Color
import com.badlogic.gdx.graphics.g2d.TextureRegion
import com.jme3.math.FastMath.pow
import net.torvald.terrarum.*
import net.torvald.terrarum.TerrarumAppConfiguration.TILE_SIZE
import net.torvald.terrarum.TerrarumAppConfiguration.TILE_SIZED
import net.torvald.terrarum.audio.MixerTrackProcessor
import net.torvald.terrarum.audio.MusicContainer
import net.torvald.terrarum.audio.audiobank.MusicContainer
import net.torvald.terrarum.blockproperties.Block
import net.torvald.terrarum.gameactors.AVKey
import net.torvald.terrarum.gameactors.ActorWithBody
@@ -84,7 +83,7 @@ object PickaxeCore {
}
// return false for punchable trees
// non-punchable trees (= "log" tile placed by log item) must be mineable in order to make them useful as decor tiles
if (BlockCodex[tile].hasAllTagOf("TREE", "TREETRUNK", "TREESMALL")) {
if (BlockCodex[tile].hasAllTagsOf("TREE", "TREETRUNK", "TREESMALL")) {
usageStatus = usageStatus or false
continue
}
@@ -93,7 +92,7 @@ object PickaxeCore {
val actionInterval = actorvalue.getAsDouble(AVKey.ACTION_INTERVAL)!!
val swingDmgToFrameDmg = delta.toDouble() / actionInterval
if (INGAME.WORLD_UPDATE_TIMER % 11 == (Math.random() * 3).toInt()) {
if (INGAME.WORLD_UPDATE_TIMER % 11 == (Math.random() * 3).toLong()) {
makeNoiseTileTouching(actor, tile)
}

View File

@@ -82,7 +82,7 @@ object SledgehammerCore {
val actionInterval = actorvalue.getAsDouble(AVKey.ACTION_INTERVAL)!!
val swingDmgToFrameDmg = delta.toDouble() / actionInterval
if (INGAME.WORLD_UPDATE_TIMER % 11 == (Math.random() * 3).toInt()) {
if (INGAME.WORLD_UPDATE_TIMER % 11 == (Math.random() * 3).toLong()) {
PickaxeCore.makeNoiseTileTouching(actor, wall)
}