mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 20:31:51 +09:00
multicolour storage chests
This commit is contained in:
@@ -65,7 +65,25 @@
|
||||
"item@basegame:6": { /* storage chest */
|
||||
"workbench": "basiccrafting",
|
||||
"ingredients": [
|
||||
[1, 20, "$WOOD"] /* 1 chest = 20 wood */
|
||||
[1, 20, "basegame:48"] /* 1 chest = 20 wood */
|
||||
]
|
||||
},
|
||||
"item@basegame:37": { /* storage chest */
|
||||
"workbench": "basiccrafting",
|
||||
"ingredients": [
|
||||
[1, 20, "basegame:49"] /* 1 chest = 20 wood */
|
||||
]
|
||||
},
|
||||
"item@basegame:38": { /* storage chest */
|
||||
"workbench": "basiccrafting",
|
||||
"ingredients": [
|
||||
[1, 20, "basegame:50"] /* 1 chest = 20 wood */
|
||||
]
|
||||
},
|
||||
"item@basegame:39": { /* storage chest */
|
||||
"workbench": "basiccrafting",
|
||||
"ingredients": [
|
||||
[1, 20, "basegame:51"] /* 1 chest = 20 wood */
|
||||
]
|
||||
},
|
||||
|
||||
|
||||
@@ -35,6 +35,9 @@ id;classname;tags
|
||||
34;net.torvald.terrarum.modulebasegame.gameitems.ItemSignalSwitchManual;FIXTURE,SIGNAL
|
||||
35;net.torvald.terrarum.modulebasegame.gameitems.ItemSignalBulb;FIXTURE,SIGNAL
|
||||
36;net.torvald.terrarum.modulebasegame.gameitems.ItemWireRollingMill;FIXTURE,CRAFTING
|
||||
37;net.torvald.terrarum.modulebasegame.gameitems.ItemStorageChestEbony;FIXTURE,STORAGE
|
||||
38;net.torvald.terrarum.modulebasegame.gameitems.ItemStorageChestBirch;FIXTURE,STORAGE
|
||||
39;net.torvald.terrarum.modulebasegame.gameitems.ItemStorageChestRosewood;FIXTURE,STORAGE
|
||||
|
||||
# ingots
|
||||
26;net.torvald.terrarum.modulebasegame.gameitems.IngotSteel;INGOT
|
||||
|
||||
|
@@ -16,6 +16,9 @@
|
||||
"TOOLTIP_item@basegame:4": "Breaks down walls",
|
||||
"TOOLTIP_item@basegame:5": "Provides light but fancier",
|
||||
"TOOLTIP_item@basegame:6": "“I am sworn to keep your burdens.”", /* skyrim/lydia reference */
|
||||
"TOOLTIP_item@basegame:37": "“I am sworn to keep your burdens.”", /* skyrim/lydia reference */
|
||||
"TOOLTIP_item@basegame:38": "“I am sworn to keep your burdens.”", /* skyrim/lydia reference */
|
||||
"TOOLTIP_item@basegame:39": "“I am sworn to keep your burdens.”", /* skyrim/lydia reference */
|
||||
"TOOLTIP_item@basegame:8": "Emits a signal",
|
||||
"TOOLTIP_item@basegame:9": "An electricians’ best friend",
|
||||
"TOOLTIP_item@basegame:10": "“Who needs a Book and Quill when you’ve got this?”", /* a jab on the Minecraft item Book and Quill */
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
"TOOLTIP_item@basegame:4": "벽을 부숩니다",
|
||||
"TOOLTIP_item@basegame:5": "빛을 더 이쁘게 냅니다",
|
||||
"TOOLTIP_item@basegame:6": "“짐을 맡아두기로 한 몸이니까요.”", /* skyrim/lydia reference */
|
||||
"TOOLTIP_item@basegame:37": "“짐을 맡아두기로 한 몸이니까요.”", /* skyrim/lydia reference */
|
||||
"TOOLTIP_item@basegame:38": "“짐을 맡아두기로 한 몸이니까요.”", /* skyrim/lydia reference */
|
||||
"TOOLTIP_item@basegame:39": "“짐을 맡아두기로 한 몸이니까요.”", /* skyrim/lydia reference */
|
||||
"TOOLTIP_item@basegame:8": "신호를 만들어냅니다",
|
||||
"TOOLTIP_item@basegame:9": "전기공의 친한 친구",
|
||||
"TOOLTIP_item@basegame:10": "“이게 있는데 책과 깃펜이 왜 필요하죠?”", /* a jab on the Minecraft item Book and Quill */
|
||||
|
||||
Binary file not shown.
BIN
assets/mods/basegame/sprites/fixtures/storage_chest_2.tga
LFS
Normal file
BIN
assets/mods/basegame/sprites/fixtures/storage_chest_2.tga
LFS
Normal file
Binary file not shown.
BIN
assets/mods/basegame/sprites/fixtures/storage_chest_3.tga
LFS
Normal file
BIN
assets/mods/basegame/sprites/fixtures/storage_chest_3.tga
LFS
Normal file
Binary file not shown.
BIN
assets/mods/basegame/sprites/fixtures/storage_chest_4.tga
LFS
Normal file
BIN
assets/mods/basegame/sprites/fixtures/storage_chest_4.tga
LFS
Normal file
Binary file not shown.
@@ -5,6 +5,9 @@ import net.torvald.terrarum.TerrarumAppConfiguration.TILE_SIZE
|
||||
import net.torvald.terrarum.gameactors.AVKey
|
||||
import net.torvald.terrarum.langpack.Lang
|
||||
import net.torvald.terrarum.modulebasegame.gameactors.FixtureInventory.Companion.CAPACITY_MODE_COUNT
|
||||
import net.torvald.terrarum.modulebasegame.gameactors.FixtureStorageChest.Companion.MASS
|
||||
import net.torvald.terrarum.modulebasegame.gameactors.FixtureStorageChest.Companion.MAXCAP_MODE
|
||||
import net.torvald.terrarum.modulebasegame.gameactors.FixtureStorageChest.Companion.MAXCAP_NUM
|
||||
import net.torvald.terrarum.modulebasegame.gameitems.FixtureItemBase
|
||||
import net.torvald.terrarum.modulebasegame.ui.*
|
||||
import net.torvald.terrarumsansbitmap.gdx.TextureRegionPack
|
||||
@@ -12,13 +15,11 @@ import net.torvald.terrarumsansbitmap.gdx.TextureRegionPack
|
||||
/**
|
||||
* Created by minjaesong on 2019-07-08.
|
||||
*/
|
||||
internal class FixtureStorageChest : FixtureBase {
|
||||
|
||||
|
||||
class FixtureStorageChest : FixtureBase {
|
||||
constructor() : super(
|
||||
BlockBox(BlockBox.ALLOW_MOVE_DOWN, 1, 1),
|
||||
mainUI = UIStorageChest(),
|
||||
inventory = FixtureInventory(40, CAPACITY_MODE_COUNT),
|
||||
inventory = FixtureInventory(MAXCAP_NUM, MAXCAP_MODE),
|
||||
nameFun = { Lang["ITEM_STORAGE_CHEST"] }
|
||||
) {
|
||||
|
||||
@@ -50,5 +51,121 @@ internal class FixtureStorageChest : FixtureBase {
|
||||
|
||||
companion object {
|
||||
const val MASS = 2.0
|
||||
const val MAXCAP_NUM = 40L
|
||||
val MAXCAP_MODE = CAPACITY_MODE_COUNT
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2024-03-02.
|
||||
*/
|
||||
class FixtureStorageChestEbony : FixtureBase {
|
||||
constructor() : super(
|
||||
BlockBox(BlockBox.ALLOW_MOVE_DOWN, 1, 1),
|
||||
mainUI = UIStorageChest(),
|
||||
inventory = FixtureInventory(MAXCAP_NUM, MAXCAP_MODE),
|
||||
nameFun = { Lang["ITEM_STORAGE_CHEST"] }
|
||||
) {
|
||||
|
||||
(mainUI as UIStorageChest).chestInventory = this.inventory!!
|
||||
(mainUI as UIStorageChest).chestNameFun = this.nameFun
|
||||
|
||||
val itemImage = FixtureItemBase.getItemImageFromSingleImage("basegame", "sprites/fixtures/storage_chest_2.tga")
|
||||
|
||||
setHitboxDimension(TILE_SIZE, TILE_SIZE, 1, 0)
|
||||
|
||||
makeNewSprite(TextureRegionPack(itemImage.texture, 18, 18)).let {
|
||||
it.setRowsAndFrames(1,1)
|
||||
}
|
||||
|
||||
actorValue[AVKey.BASEMASS] = MASS
|
||||
|
||||
|
||||
printStackTrace(this)
|
||||
}
|
||||
|
||||
override fun reload() {
|
||||
super.reload()
|
||||
// doing this is required as when things are deserialised, constructor is called, THEN the fields are
|
||||
// filled in, thus the initialised mainUI has a stale reference;
|
||||
// we fix it by simply giving a new reference to the mainUI
|
||||
(mainUI as UIStorageChest).chestInventory = this.inventory!!
|
||||
(mainUI as UIStorageChest).chestNameFun = this.nameFun
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2024-03-02.
|
||||
*/
|
||||
class FixtureStorageChestBirch : FixtureBase {
|
||||
constructor() : super(
|
||||
BlockBox(BlockBox.ALLOW_MOVE_DOWN, 1, 1),
|
||||
mainUI = UIStorageChest(),
|
||||
inventory = FixtureInventory(MAXCAP_NUM, MAXCAP_MODE),
|
||||
nameFun = { Lang["ITEM_STORAGE_CHEST"] }
|
||||
) {
|
||||
|
||||
(mainUI as UIStorageChest).chestInventory = this.inventory!!
|
||||
(mainUI as UIStorageChest).chestNameFun = this.nameFun
|
||||
|
||||
val itemImage = FixtureItemBase.getItemImageFromSingleImage("basegame", "sprites/fixtures/storage_chest_3.tga")
|
||||
|
||||
setHitboxDimension(TILE_SIZE, TILE_SIZE, 1, 0)
|
||||
|
||||
makeNewSprite(TextureRegionPack(itemImage.texture, 18, 18)).let {
|
||||
it.setRowsAndFrames(1,1)
|
||||
}
|
||||
|
||||
actorValue[AVKey.BASEMASS] = MASS
|
||||
|
||||
|
||||
printStackTrace(this)
|
||||
}
|
||||
|
||||
override fun reload() {
|
||||
super.reload()
|
||||
// doing this is required as when things are deserialised, constructor is called, THEN the fields are
|
||||
// filled in, thus the initialised mainUI has a stale reference;
|
||||
// we fix it by simply giving a new reference to the mainUI
|
||||
(mainUI as UIStorageChest).chestInventory = this.inventory!!
|
||||
(mainUI as UIStorageChest).chestNameFun = this.nameFun
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2024-03-02.
|
||||
*/
|
||||
class FixtureStorageChestRosewood : FixtureBase {
|
||||
constructor() : super(
|
||||
BlockBox(BlockBox.ALLOW_MOVE_DOWN, 1, 1),
|
||||
mainUI = UIStorageChest(),
|
||||
inventory = FixtureInventory(MAXCAP_NUM, MAXCAP_MODE),
|
||||
nameFun = { Lang["ITEM_STORAGE_CHEST"] }
|
||||
) {
|
||||
|
||||
(mainUI as UIStorageChest).chestInventory = this.inventory!!
|
||||
(mainUI as UIStorageChest).chestNameFun = this.nameFun
|
||||
|
||||
val itemImage = FixtureItemBase.getItemImageFromSingleImage("basegame", "sprites/fixtures/storage_chest_4.tga")
|
||||
|
||||
setHitboxDimension(TILE_SIZE, TILE_SIZE, 1, 0)
|
||||
|
||||
makeNewSprite(TextureRegionPack(itemImage.texture, 18, 18)).let {
|
||||
it.setRowsAndFrames(1,1)
|
||||
}
|
||||
|
||||
actorValue[AVKey.BASEMASS] = MASS
|
||||
|
||||
|
||||
printStackTrace(this)
|
||||
}
|
||||
|
||||
override fun reload() {
|
||||
super.reload()
|
||||
// doing this is required as when things are deserialised, constructor is called, THEN the fields are
|
||||
// filled in, thus the initialised mainUI has a stale reference;
|
||||
// we fix it by simply giving a new reference to the mainUI
|
||||
(mainUI as UIStorageChest).chestInventory = this.inventory!!
|
||||
(mainUI as UIStorageChest).chestNameFun = this.nameFun
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,6 @@ import net.torvald.terrarum.modulebasegame.gameactors.FixtureTikiTorch
|
||||
* Created by minjaesong on 2019-07-08.
|
||||
*/
|
||||
class ItemStorageChest(originalID: ItemID) : FixtureItemBase(originalID, "net.torvald.terrarum.modulebasegame.gameactors.FixtureStorageChest") {
|
||||
|
||||
override var dynamicID: ItemID = originalID
|
||||
override var baseMass = FixtureTikiTorch.MASS
|
||||
override val canBeDynamic = false
|
||||
@@ -20,5 +19,46 @@ class ItemStorageChest(originalID: ItemID) : FixtureItemBase(originalID, "net.to
|
||||
get() = getItemImageFromSingleImage("basegame", "sprites/fixtures/storage_chest.tga")
|
||||
override var baseToolSize: Double? = baseMass
|
||||
override var originalName = "ITEM_STORAGE_CHEST"
|
||||
}
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2024-03-02.
|
||||
*/
|
||||
class ItemStorageChestEbony(originalID: ItemID) : FixtureItemBase(originalID, "net.torvald.terrarum.modulebasegame.gameactors.FixtureStorageChestEbony") {
|
||||
override var dynamicID: ItemID = originalID
|
||||
override var baseMass = FixtureTikiTorch.MASS
|
||||
override val canBeDynamic = false
|
||||
override val materialId = ""
|
||||
override val itemImage: TextureRegion
|
||||
get() = getItemImageFromSingleImage("basegame", "sprites/fixtures/storage_chest_2.tga")
|
||||
override var baseToolSize: Double? = baseMass
|
||||
override var originalName = "ITEM_STORAGE_CHEST"
|
||||
}
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2024-03-02.
|
||||
*/
|
||||
class ItemStorageChestBirch(originalID: ItemID) : FixtureItemBase(originalID, "net.torvald.terrarum.modulebasegame.gameactors.FixtureStorageChestBirch") {
|
||||
override var dynamicID: ItemID = originalID
|
||||
override var baseMass = FixtureTikiTorch.MASS
|
||||
override val canBeDynamic = false
|
||||
override val materialId = ""
|
||||
override val itemImage: TextureRegion
|
||||
get() = getItemImageFromSingleImage("basegame", "sprites/fixtures/storage_chest_3.tga")
|
||||
override var baseToolSize: Double? = baseMass
|
||||
override var originalName = "ITEM_STORAGE_CHEST"
|
||||
}
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2024-03-02.
|
||||
*/
|
||||
class ItemStorageChestRosewood(originalID: ItemID) : FixtureItemBase(originalID, "net.torvald.terrarum.modulebasegame.gameactors.FixtureStorageChestRosewood") {
|
||||
override var dynamicID: ItemID = originalID
|
||||
override var baseMass = FixtureTikiTorch.MASS
|
||||
override val canBeDynamic = false
|
||||
override val materialId = ""
|
||||
override val itemImage: TextureRegion
|
||||
get() = getItemImageFromSingleImage("basegame", "sprites/fixtures/storage_chest_4.tga")
|
||||
override var baseToolSize: Double? = baseMass
|
||||
override var originalName = "ITEM_STORAGE_CHEST"
|
||||
}
|
||||
Binary file not shown.
Reference in New Issue
Block a user