diff options
-rw-r--r-- | client/map/tile_factory.gd | 4 | ||||
-rw-r--r-- | client/map/tiles/ceiling_lamp.gd | 21 | ||||
-rw-r--r-- | client/map/tiles/ceiling_lamp.res | bin | 0 -> 7229 bytes | |||
-rw-r--r-- | client/map/tiles/ceiling_lamp.tscn | 16 | ||||
-rw-r--r-- | client/map/tiles/chandelier.gd | 21 | ||||
-rw-r--r-- | client/map/tiles/chandelier.res | bin | 0 -> 25437 bytes | |||
-rw-r--r-- | client/map/tiles/chandelier.tscn | 15 | ||||
-rw-r--r-- | client/map/tiles/lamp.tscn | 8 | ||||
-rw-r--r-- | client/map/tiles/light_tile.gd | 29 | ||||
-rw-r--r-- | data/maps/debug.yaml | 5 | ||||
-rw-r--r-- | data/maps/paris.yaml | 10 |
11 files changed, 120 insertions, 9 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 Binary files differnew file mode 100644 index 00000000..f35e266b --- /dev/null +++ b/client/map/tiles/ceiling_lamp.res 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 Binary files differnew file mode 100644 index 00000000..d8007bb8 --- /dev/null +++ b/client/map/tiles/chandelier.res 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") diff --git a/data/maps/debug.yaml b/data/maps/debug.yaml index ba984001..93139286 100644 --- a/data/maps/debug.yaml +++ b/data/maps/debug.yaml @@ -22,10 +22,10 @@ map: - "..X01234567....." - "..............¹." - "..⌷ffC.SSoo...⌷." - - "..s⌷⌷⌷.⌷⌷⌷⌷...²." + - "..s⌷⌷⌷ɷ⌷⌷⌷⌷...²." - "................" - "..ppppbpppp.³..." - - "..cccc.cccc..'''''" + - "..ccccɷcccc..'''''" - ".............'''''" - "6.>>>}o>>>>..''l''" - "p.°>>>>v.....'''''" @@ -81,6 +81,7 @@ tiles: "L": counter-window "+": counter-window "°": counter-window + "ɷ": chandelier items: "S": pot diff --git a/data/maps/paris.yaml b/data/maps/paris.yaml index cb1aed69..e0007474 100644 --- a/data/maps/paris.yaml +++ b/data/maps/paris.yaml @@ -21,13 +21,13 @@ map: - "'''''''''''''''''''''''''" - "''''██▒▒████▒▒██▒▒███'''*" - "''''█#ppppp#ss█oooo#█''''" - - "'*''▒.........d....R▒''*'" + - "'*''▒.1....1..d...1R▒''*'" - "''''█wwwdd█www█.ff.T█'''*" - "*'''▒.........█....F▒''''" - "''''█ctc..ctc.█.SS.L█''''" - - "*'''▒.........█....R▒'''*" + - "*'''▒.8....8..█....R▒'''*" - "''''█ctc..ctc.█.SS.T█''''" - - "''''▒.........█....F▒''*'" + - "''''▒.........█...1F▒''*'" - "*'''█ctc..ctc.█XCC##█'''*" - "''''██▒▒dd▒▒███▒▒████''''" - "'l'''''l__l'''''l'''''l''" @@ -53,6 +53,8 @@ tiles: "L": leek-crate "X": trash "l": lamp + "8": chandelier + "1": ceiling-lamp "c": chair ".": floor @@ -84,6 +86,8 @@ walkable: - chair - grass - path + - chandelier + - ceiling-lamp collider: - wall |