mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 20:31:51 +09:00
calendar fixture wip
This commit is contained in:
@@ -8,6 +8,7 @@ id;classname
|
||||
8;net.torvald.terrarum.modulebasegame.gameitems.ItemLogicSignalEmitter
|
||||
9;net.torvald.terrarum.modulebasegame.gameitems.WireCutterAll
|
||||
10;net.torvald.terrarum.modulebasegame.gameitems.ItemTypewriter
|
||||
11;net.torvald.terrarum.modulebasegame.gameitems.ItemWallCalendar
|
||||
|
||||
256;net.torvald.terrarum.modulebasegame.gameitems.ItemSwingingDoorOak
|
||||
257;net.torvald.terrarum.modulebasegame.gameitems.ItemSwingingDoorEbony
|
||||
|
||||
|
BIN
assets/mods/basegame/sprites/fixtures/calendar.tga
LFS
Normal file
BIN
assets/mods/basegame/sprites/fixtures/calendar.tga
LFS
Normal file
Binary file not shown.
@@ -1367,7 +1367,7 @@ open class ActorWithBody : Actor {
|
||||
//println("-> $stairHeight")
|
||||
|
||||
// edge-detect mode
|
||||
return if (yheight == 0) hitFloor.toInt() * 2 to stairHeight
|
||||
return if (yheight == 0) hitFloor.toInt(1) to stairHeight
|
||||
// not an edge-detect && no collision
|
||||
else if (stairHeight == 0) 0 to 0
|
||||
// there was collision and stairHeight <= AUTO_CLIMB_STRIDE
|
||||
|
||||
@@ -58,7 +58,7 @@ import kotlin.math.sin
|
||||
class WorldTime(initTime: Long = 0L) {
|
||||
|
||||
/** It is not recommended to directly modify the TIME_T. Use provided methods instead. */
|
||||
var TIME_T = 0L // Epoch: Year 125 Spring 1st, 0h00:00 (Mondag) // 125-01-01
|
||||
var TIME_T = 0L // Epoch: Year 1 Spring 1st, 0h00:00 (Mondag) // 0001-01-01
|
||||
|
||||
init {
|
||||
TIME_T = initTime
|
||||
@@ -181,7 +181,7 @@ class WorldTime(initTime: Long = 0L) {
|
||||
|
||||
const val MONTH_LENGTH = 30 // ingame calendar specific
|
||||
|
||||
const val EPOCH_YEAR = 125
|
||||
const val EPOCH_YEAR = 1
|
||||
|
||||
val YEAR_SECONDS = DAY_LENGTH * YEAR_DAYS
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ class FixtureTypewriter : FixtureBase {
|
||||
// constructor used when the game loads from the savefile
|
||||
constructor() : super(
|
||||
BlockBox(BlockBox.NO_COLLISION, 1, 1),
|
||||
nameFun = { Lang["ITEM_TYPEWRITER"] }
|
||||
nameFun = { Lang["GAME_ITEM_TYPEWRITER"] }
|
||||
) {
|
||||
|
||||
density = 2000.0
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package net.torvald.terrarum.modulebasegame.gameactors
|
||||
|
||||
import net.torvald.terrarum.TerrarumAppConfiguration.TILE_SIZE
|
||||
import net.torvald.terrarum.gameactors.AVKey
|
||||
import net.torvald.terrarum.langpack.Lang
|
||||
import net.torvald.terrarum.modulebasegame.gameitems.FixtureItemBase
|
||||
import net.torvald.terrarumsansbitmap.gdx.TextureRegionPack
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2023-08-08.
|
||||
*/
|
||||
class FixtureWallCalendar : FixtureBase {
|
||||
|
||||
constructor() : super(
|
||||
BlockBox(BlockBox.NO_COLLISION, 1, 1),
|
||||
nameFun = { Lang["GAME_ITEM_CALENDAR"] }
|
||||
) {
|
||||
val itemImage = FixtureItemBase.getItemImageFromSingleImage("basegame", "sprites/fixtures/calendar.tga")
|
||||
|
||||
density = 600.0
|
||||
setHitboxDimension(TILE_SIZE, TILE_SIZE, 0, 1)
|
||||
|
||||
makeNewSprite(TextureRegionPack(itemImage.texture, TILE_SIZE, TILE_SIZE)).let {
|
||||
it.setRowsAndFrames(1,1)
|
||||
}
|
||||
|
||||
actorValue[AVKey.BASEMASS] = 1.0
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -11,7 +11,7 @@ import net.torvald.terrarum.modulebasegame.gameactors.FixtureTikiTorch
|
||||
class ItemTypewriter(originalID: ItemID) : FixtureItemBase(originalID, "net.torvald.terrarum.modulebasegame.gameactors.FixtureTypewriter") {
|
||||
|
||||
override var dynamicID: ItemID = originalID
|
||||
override val originalName = "ITEM_TYPEWRITER"
|
||||
override val originalName = "GAME_ITEM_TYPEWRITER"
|
||||
override var baseMass = FixtureTikiTorch.MASS
|
||||
override var stackable = true
|
||||
override var inventoryCategory = Category.MISC
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package net.torvald.terrarum.modulebasegame.gameitems
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.TextureRegion
|
||||
import net.torvald.terrarum.TerrarumAppConfiguration.TILE_SIZE
|
||||
import net.torvald.terrarum.gameitems.ItemID
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2023-08-08.
|
||||
*/
|
||||
class ItemWallCalendar(originalID: ItemID) : FixtureItemBase(originalID, "net.torvald.terrarum.modulebasegame.gameactors.FixtureWallCalendar") {
|
||||
|
||||
override var dynamicID: ItemID = originalID
|
||||
override val originalName = "GAME_ITEM_CALENDAR"
|
||||
override var baseMass = 1.0
|
||||
override var stackable = true
|
||||
override var inventoryCategory = Category.MISC
|
||||
override val isUnique = false
|
||||
override val isDynamic = false
|
||||
override val materialId = ""
|
||||
override val itemImage: TextureRegion
|
||||
get() = getItemImageFromSingleImage("basegame", "sprites/fixtures/calendar.tga")
|
||||
|
||||
override var baseToolSize: Double? = baseMass
|
||||
|
||||
init {
|
||||
equipPosition = EquipPosition.HAND_GRIP
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user