mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-12 11:34:05 +09:00
class for door variants
This commit is contained in:
@@ -178,15 +178,6 @@ open class FixtureSwingingDoorBase : FixtureBase, Luminous {
|
|||||||
doorCloseQueued = false
|
doorCloseQueued = false
|
||||||
}
|
}
|
||||||
|
|
||||||
/*override fun forEachBlockbox(action: (Int, Int, Int, Int) -> Unit) {
|
|
||||||
val xStart = worldBlockPos!!.x - ((tw * 2 - twClosed - 1) / 2) // worldBlockPos.x is where the mouse was, of when the tilewise width was 1.
|
|
||||||
for (y in worldBlockPos!!.y until worldBlockPos!!.y + blockBox.height) {
|
|
||||||
for (x in xStart until xStart + blockBox.width) {
|
|
||||||
action(x, y, x - xStart, y - worldBlockPos!!.y)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
override fun placeActorBlocks() {
|
override fun placeActorBlocks() {
|
||||||
forEachBlockbox { x, y, ox, oy ->
|
forEachBlockbox { x, y, ox, oy ->
|
||||||
printdbg(this, "placeActorBlocks xy=$x,$y oxy=$ox,$oy")
|
printdbg(this, "placeActorBlocks xy=$x,$y oxy=$ox,$oy")
|
||||||
@@ -279,6 +270,7 @@ open class FixtureSwingingDoorBase : FixtureBase, Luminous {
|
|||||||
|
|
||||||
// auto opening and closing
|
// auto opening and closing
|
||||||
// TODO make this work with "player_alies" faction, not just a player
|
// TODO make this work with "player_alies" faction, not just a player
|
||||||
|
// TODO auto open from the other side does not work if X-coord is 0 or (world width - 1)
|
||||||
val installer: IngamePlayer? = if (actorThatInstalledThisFixture == null) null
|
val installer: IngamePlayer? = if (actorThatInstalledThisFixture == null) null
|
||||||
else INGAME.actorContainerActive.filterIsInstance<IngamePlayer>().filter { it.uuid == actorThatInstalledThisFixture }.ifEmpty {
|
else INGAME.actorContainerActive.filterIsInstance<IngamePlayer>().filter { it.uuid == actorThatInstalledThisFixture }.ifEmpty {
|
||||||
INGAME.actorContainerInactive.filterIsInstance<IngamePlayer>().filter { it.uuid == actorThatInstalledThisFixture }
|
INGAME.actorContainerInactive.filterIsInstance<IngamePlayer>().filter { it.uuid == actorThatInstalledThisFixture }
|
||||||
|
|||||||
@@ -6,8 +6,58 @@ import net.torvald.terrarum.blockproperties.Block
|
|||||||
/**
|
/**
|
||||||
* Created by minjaesong on 2022-07-28.
|
* Created by minjaesong on 2022-07-28.
|
||||||
*/
|
*/
|
||||||
class FixtureSwingingDoorRosewood : FixtureSwingingDoorBase {
|
class FixtureSwingingDoorOak : FixtureSwingingDoorBase {
|
||||||
|
constructor() : super() {
|
||||||
|
_construct(
|
||||||
|
2,
|
||||||
|
1,
|
||||||
|
3,
|
||||||
|
BlockCodex[Block.STONE].opacity,
|
||||||
|
false,
|
||||||
|
"basegame",
|
||||||
|
"sprites/fixtures/door_basegame-48.tga",
|
||||||
|
"fixtures-door_basegame-48.tga",
|
||||||
|
"DOOR_OAK",
|
||||||
|
true
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class FixtureSwingingDoorEbony : FixtureSwingingDoorBase {
|
||||||
|
constructor() : super() {
|
||||||
|
_construct(
|
||||||
|
2,
|
||||||
|
1,
|
||||||
|
3,
|
||||||
|
BlockCodex[Block.STONE].opacity,
|
||||||
|
false,
|
||||||
|
"basegame",
|
||||||
|
"sprites/fixtures/door_basegame-49.tga",
|
||||||
|
"fixtures-door_basegame-49.tga",
|
||||||
|
"DOOR_EBONY",
|
||||||
|
true
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class FixtureSwingingDoorBirch : FixtureSwingingDoorBase {
|
||||||
|
constructor() : super() {
|
||||||
|
_construct(
|
||||||
|
2,
|
||||||
|
1,
|
||||||
|
3,
|
||||||
|
BlockCodex[Block.STONE].opacity,
|
||||||
|
false,
|
||||||
|
"basegame",
|
||||||
|
"sprites/fixtures/door_basegame-50.tga",
|
||||||
|
"fixtures-door_basegame-50.tga",
|
||||||
|
"DOOR_BIRCH",
|
||||||
|
true
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class FixtureSwingingDoorRosewood : FixtureSwingingDoorBase {
|
||||||
constructor() : super() {
|
constructor() : super() {
|
||||||
_construct(
|
_construct(
|
||||||
2,
|
2,
|
||||||
@@ -22,5 +72,4 @@ class FixtureSwingingDoorRosewood : FixtureSwingingDoorBase {
|
|||||||
true
|
true
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user