aboutsummaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/map/tile_factory.gd4
-rw-r--r--client/map/tiles/ceiling_lamp.gd21
-rw-r--r--client/map/tiles/ceiling_lamp.resbin0 -> 7229 bytes
-rw-r--r--client/map/tiles/ceiling_lamp.tscn16
-rw-r--r--client/map/tiles/chandelier.gd21
-rw-r--r--client/map/tiles/chandelier.resbin0 -> 25437 bytes
-rw-r--r--client/map/tiles/chandelier.tscn15
-rw-r--r--client/map/tiles/lamp.tscn8
-rw-r--r--client/map/tiles/light_tile.gd29
9 files changed, 110 insertions, 4 deletions
diff --git a/client/map/tile_factory.gd b/client/map/tile_factory.gd
index fdc40185..feadea9c 100644
--- a/client/map/tile_factory.gd
+++ b/client/map/tile_factory.gd
@@ -76,6 +76,10 @@ static func produce(tile_name: String, node_name: String, neighbors: Array) -> T
return PlayerPortal.new(node_name, neighbors, true)
"lamp":
return Lamp.new(node_name, neighbors)
+ "chandelier":
+ return Chandelier.new(node_name, neighbors)
+ "ceiling-lamp":
+ return CeilingLamp.new(node_name, neighbors)
var t:
push_warning("tile %s unknown" % t)
return GenericTile.new(node_name, neighbors, t)
diff --git a/client/map/tiles/ceiling_lamp.gd b/client/map/tiles/ceiling_lamp.gd
new file mode 100644
index 00000000..ada24c8b
--- /dev/null
+++ b/client/map/tiles/ceiling_lamp.gd
@@ -0,0 +1,21 @@
+# Hurry Curry! - a game about cooking
+# Copyright 2024 nokoe
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, version 3 of the License only.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+#
+class_name CeilingLamp
+extends Floor
+
+func _init(rename: String, neighbors: Array):
+ super(rename, neighbors)
+ base.add_child(load("res://map/tiles/ceiling_lamp.tscn").instantiate())
diff --git a/client/map/tiles/ceiling_lamp.res b/client/map/tiles/ceiling_lamp.res
new file mode 100644
index 00000000..f35e266b
--- /dev/null
+++ b/client/map/tiles/ceiling_lamp.res
Binary files differ
diff --git a/client/map/tiles/ceiling_lamp.tscn b/client/map/tiles/ceiling_lamp.tscn
new file mode 100644
index 00000000..899b8500
--- /dev/null
+++ b/client/map/tiles/ceiling_lamp.tscn
@@ -0,0 +1,16 @@
+[gd_scene load_steps=3 format=3 uid="uid://c8hu5h6dt0ixj"]
+
+[ext_resource type="ArrayMesh" uid="uid://bsir47jru4um7" path="res://map/tiles/ceiling_lamp.res" id="1_twi66"]
+[ext_resource type="Script" path="res://map/tiles/light_tile.gd" id="1_yyibl"]
+
+[node name="CeilingLamp" type="Node3D" node_paths=PackedStringArray("lights")]
+script = ExtResource("1_yyibl")
+lights = [NodePath("OmniLight3D")]
+
+[node name="Mesh" type="MeshInstance3D" parent="."]
+transform = Transform3D(100, 0, 0, 0, -1.19209e-05, 100, 0, -100, -1.19209e-05, 0, 1.875, 0)
+mesh = ExtResource("1_twi66")
+skeleton = NodePath("")
+
+[node name="OmniLight3D" type="OmniLight3D" parent="."]
+transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.4, 0)
diff --git a/client/map/tiles/chandelier.gd b/client/map/tiles/chandelier.gd
new file mode 100644
index 00000000..7ed8bbb5
--- /dev/null
+++ b/client/map/tiles/chandelier.gd
@@ -0,0 +1,21 @@
+# Hurry Curry! - a game about cooking
+# Copyright 2024 nokoe
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, version 3 of the License only.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+#
+class_name Chandelier
+extends Floor
+
+func _init(rename: String, neighbors: Array):
+ super(rename, neighbors)
+ base.add_child(load("res://map/tiles/chandelier.tscn").instantiate())
diff --git a/client/map/tiles/chandelier.res b/client/map/tiles/chandelier.res
new file mode 100644
index 00000000..d8007bb8
--- /dev/null
+++ b/client/map/tiles/chandelier.res
Binary files differ
diff --git a/client/map/tiles/chandelier.tscn b/client/map/tiles/chandelier.tscn
new file mode 100644
index 00000000..dfc366e6
--- /dev/null
+++ b/client/map/tiles/chandelier.tscn
@@ -0,0 +1,15 @@
+[gd_scene load_steps=3 format=3 uid="uid://coql3wlp3jwoc"]
+
+[ext_resource type="Script" path="res://map/tiles/light_tile.gd" id="1_6vise"]
+[ext_resource type="ArrayMesh" uid="uid://d11c3fl48g7qb" path="res://map/tiles/chandelier.res" id="1_urqpe"]
+
+[node name="Chandelier" type="Node3D"]
+script = ExtResource("1_6vise")
+
+[node name="Mesh" type="MeshInstance3D" parent="."]
+transform = Transform3D(100, 0, 0, 0, -1.19209e-05, 100, 0, -100, -1.19209e-05, 0, 1.875, 0)
+mesh = ExtResource("1_urqpe")
+skeleton = NodePath("")
+
+[node name="OmniLight3D" type="OmniLight3D" parent="."]
+light_color = Color(0.945098, 0.886275, 0.745098, 1)
diff --git a/client/map/tiles/lamp.tscn b/client/map/tiles/lamp.tscn
index 17a96b20..30ec4ec3 100644
--- a/client/map/tiles/lamp.tscn
+++ b/client/map/tiles/lamp.tscn
@@ -1,10 +1,11 @@
[gd_scene load_steps=3 format=3 uid="uid://b6x5xlchih2mc"]
[ext_resource type="ArrayMesh" uid="uid://cranpcmdoa8mx" path="res://map/tiles/lamp.res" id="1_2f0v1"]
-[ext_resource type="Script" path="res://map/tiles/lamp.gd" id="1_snoxq"]
+[ext_resource type="Script" path="res://map/tiles/light_tile.gd" id="1_87gp4"]
-[node name="Lamp" type="Node3D"]
-script = ExtResource("1_snoxq")
+[node name="Lamp" type="Node3D" node_paths=PackedStringArray("lights")]
+script = ExtResource("1_87gp4")
+lights = [NodePath("OmniLight3D")]
[node name="Mesh" type="MeshInstance3D" parent="."]
transform = Transform3D(0.3, 0, 0, 0, 0.3, 0, 0, 0, 0.3, 0, 0, 0)
@@ -15,4 +16,3 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.68634, 0)
light_color = Color(0.896459, 0.717604, 0.587842, 1)
light_energy = 3.0
light_size = 0.503
-omni_range = 8.0
diff --git a/client/map/tiles/light_tile.gd b/client/map/tiles/light_tile.gd
new file mode 100644
index 00000000..fac3ee39
--- /dev/null
+++ b/client/map/tiles/light_tile.gd
@@ -0,0 +1,29 @@
+# Hurry Curry! - a game about cooking
+# Copyright 2024 nokoe
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, version 3 of the License only.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+#
+extends Node3D
+
+@export var lights: Array[Light3D]
+
+func _ready():
+ Global.settings_changed.connect(func():
+ for l in lights:
+ update_shadows()
+ )
+ update_shadows()
+
+func update_shadows():
+ for l in lights:
+ l.shadow_enabled = Global.get_setting("shadows")