aboutsummaryrefslogtreecommitdiff
path: root/client/scripts/tiles
diff options
context:
space:
mode:
Diffstat (limited to 'client/scripts/tiles')
-rw-r--r--client/scripts/tiles/counter.gd7
-rw-r--r--client/scripts/tiles/crate.gd3
-rw-r--r--client/scripts/tiles/flour_counter.gd9
-rw-r--r--client/scripts/tiles/full_tile.gd8
-rw-r--r--client/scripts/tiles/raw_steak_crate.gd6
-rw-r--r--client/scripts/tiles/tomato_crate.gd6
-rw-r--r--client/scripts/tiles/trash.gd2
-rw-r--r--client/scripts/tiles/window.gd3
8 files changed, 40 insertions, 4 deletions
diff --git a/client/scripts/tiles/counter.gd b/client/scripts/tiles/counter.gd
index 22802d36..f4b609d5 100644
--- a/client/scripts/tiles/counter.gd
+++ b/client/scripts/tiles/counter.gd
@@ -16,6 +16,9 @@ enum CounterKind {
var kind: CounterKind = CounterKind.STRAIGHT
+static func interact_target() -> Vector3:
+ return Vector3(0, 0.5, 0)
+
func _init(rename: String, neighbors: Array):
super(rename, neighbors)
var facing = 0
@@ -57,7 +60,7 @@ func _init(rename: String, neighbors: Array):
turn_facing(facing)
-func is_counter(tile_name_t) -> bool:
+static func is_counter(tile_name_t) -> bool:
if tile_name_t == null:
return false
- return name.ends_with("crate")||counters.has(name)
+ return tile_name_t.ends_with("crate")||counters.has(tile_name_t)
diff --git a/client/scripts/tiles/crate.gd b/client/scripts/tiles/crate.gd
index de154609..3fe43525 100644
--- a/client/scripts/tiles/crate.gd
+++ b/client/scripts/tiles/crate.gd
@@ -1,7 +1,8 @@
class_name Crate
extends Counter
-const KIND: int = -1
+static func interact_target() -> Vector3:
+ return Vector3(0, 0.25, 0)
func _init(rename: String, neighbors: Array):
super(rename, neighbors)
diff --git a/client/scripts/tiles/flour_counter.gd b/client/scripts/tiles/flour_counter.gd
new file mode 100644
index 00000000..6c512d92
--- /dev/null
+++ b/client/scripts/tiles/flour_counter.gd
@@ -0,0 +1,9 @@
+class_name FlourCounter
+extends CounterBase
+
+func _init(rename: String, neighbors: Array):
+ super(rename, neighbors)
+ var bag = load("res://models/prefabs/map/bag.tscn").instantiate()
+ bag.position = interact_target()
+ bag.rotation_degrees.y = 45
+ base.add_child(bag)
diff --git a/client/scripts/tiles/full_tile.gd b/client/scripts/tiles/full_tile.gd
index 863046ba..7ee1e1fc 100644
--- a/client/scripts/tiles/full_tile.gd
+++ b/client/scripts/tiles/full_tile.gd
@@ -13,3 +13,11 @@ func _init(rename: String, neighbors: Array):
static_body.add_child(shape)
static_body.name = "Body"
base.add_child(static_body)
+
+# defines where items go when interacting
+static func interact_target() -> Vector3:
+ return Vector3(0, 0, 0)
+
+# actions when interacting, e.g. animations
+func interact():
+ pass
diff --git a/client/scripts/tiles/raw_steak_crate.gd b/client/scripts/tiles/raw_steak_crate.gd
new file mode 100644
index 00000000..3a15b942
--- /dev/null
+++ b/client/scripts/tiles/raw_steak_crate.gd
@@ -0,0 +1,6 @@
+class_name RawSteakCrate
+extends Crate
+
+func _init(rename: String, neighbors: Array):
+ super(rename, neighbors)
+ base.add_child(load("res://models/prefabs/map/crate_steak.tscn").instantiate())
diff --git a/client/scripts/tiles/tomato_crate.gd b/client/scripts/tiles/tomato_crate.gd
new file mode 100644
index 00000000..f19bdd08
--- /dev/null
+++ b/client/scripts/tiles/tomato_crate.gd
@@ -0,0 +1,6 @@
+class_name TomatoCrate
+extends Crate
+
+func _init(rename: String, neighbors: Array):
+ super(rename, neighbors)
+ base.add_child(load("res://models/prefabs/map/crate_tomatoes.tscn").instantiate())
diff --git a/client/scripts/tiles/trash.gd b/client/scripts/tiles/trash.gd
index fd24cbd6..c680e72d 100644
--- a/client/scripts/tiles/trash.gd
+++ b/client/scripts/tiles/trash.gd
@@ -1,5 +1,5 @@
class_name Trash
-extends FullTile
+extends Crate
func _init(rename: String, neighbors: Array):
super(rename, neighbors)
diff --git a/client/scripts/tiles/window.gd b/client/scripts/tiles/window.gd
index 907377d6..7df5e9db 100644
--- a/client/scripts/tiles/window.gd
+++ b/client/scripts/tiles/window.gd
@@ -1,6 +1,9 @@
class_name WallWindow
extends WallTile
+static func interact_target() -> Vector3:
+ return Vector3(0, 0.625, 0)
+
func _init(rename: String, neighbors: Array):
super(rename, neighbors)
match kind: