diff options
Diffstat (limited to 'client/map')
-rw-r--r-- | client/map/tile_factory.gd | 1 | ||||
-rw-r--r-- | client/map/tiles/rolling_board.gd | 57 | ||||
-rw-r--r-- | client/map/tiles/rolling_board.gd.uid | 1 | ||||
-rw-r--r-- | client/map/tiles/rolling_board.tscn | 14 | ||||
-rw-r--r-- | client/map/tiles/rolling_pin.res | bin | 0 -> 28783 bytes | |||
-rw-r--r-- | client/map/tiles/rolling_pin.tscn | 10 | ||||
-rw-r--r-- | client/map/tiles/sounds/roll.ogg | bin | 0 -> 11722 bytes | |||
-rw-r--r-- | client/map/tiles/sounds/roll.ogg.import | 19 |
8 files changed, 102 insertions, 0 deletions
diff --git a/client/map/tile_factory.gd b/client/map/tile_factory.gd index 4049ea47..fb72fe77 100644 --- a/client/map/tile_factory.gd +++ b/client/map/tile_factory.gd @@ -54,6 +54,7 @@ func produce(tile_name: String, position: Vector2i, neighbors: Array) -> Tile: "lamp": return Lamp.new(ctx) "oven": return Oven.new(ctx) "path": return Path.new(ctx) + "rolling-board": return RollingBoard.new(ctx) "sink": return Sink.new(ctx) "stove": return Stove.new(ctx) "street": return Street.new(ctx) diff --git a/client/map/tiles/rolling_board.gd b/client/map/tiles/rolling_board.gd new file mode 100644 index 00000000..078897b1 --- /dev/null +++ b/client/map/tiles/rolling_board.gd @@ -0,0 +1,57 @@ +# Hurry Curry! - a game about cooking +# Copyright (C) 2025 Hurry Curry! contributors +# +# 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 RollingBoard +extends CounterBase + +var board = load("res://map/tiles/rolling_board.tscn").instantiate() +var rolling: AudioStreamPlayer3D = AudioStreamPlayer3D.new() +var acting_player + +func _init(ctx: TileFactory.TileCC): + super(ctx) + rolling.stream = preload("res://map/tiles/sounds/roll.ogg") + rolling.volume_db = -10 + add_child(rolling) + base.add_child(board) + +func progress(position_: float, speed: float, warn: bool, acting_player_): + super(position_, speed, warn, acting_player) + var pin: Node3D = board.get_node("RollingPin") + acting_player = acting_player_ + + if not rolling.playing and speed != 0.: + rolling.play() + if acting_player != null: + pin.visible = false + var acting_character: Character = acting_player.character + acting_character.rolling = true + elif speed == 0: + rolling.stop() + pin.visible = true + if acting_player != null: + var acting_character: Character = acting_player.character + acting_character.rolling = false + +func finish(): + super() + if is_instance_valid(acting_player): + var acting_character: Character = acting_player.character + acting_character.rolling = false + board.get_node("RollingPin").visible = true + rolling.stop() + +static func interact_target() -> Vector3: + return Vector3(0., 0.575, 0.) diff --git a/client/map/tiles/rolling_board.gd.uid b/client/map/tiles/rolling_board.gd.uid new file mode 100644 index 00000000..f394f40e --- /dev/null +++ b/client/map/tiles/rolling_board.gd.uid @@ -0,0 +1 @@ +uid://dqo2vciij8w47 diff --git a/client/map/tiles/rolling_board.tscn b/client/map/tiles/rolling_board.tscn new file mode 100644 index 00000000..ecf1c036 --- /dev/null +++ b/client/map/tiles/rolling_board.tscn @@ -0,0 +1,14 @@ +[gd_scene load_steps=3 format=3 uid="uid://c15xsbx0bduqt"] + +[ext_resource type="ArrayMesh" uid="uid://dd4g04lgvsly5" path="res://map/tiles/cutting_board.res" id="1_cuxby"] +[ext_resource type="PackedScene" uid="uid://c8t04dfp45a86" path="res://map/tiles/rolling_pin.tscn" id="2_cuxby"] + +[node name="CuttingBoard" type="Node3D"] + +[node name="Mesh" type="MeshInstance3D" parent="."] +transform = Transform3D(0.4, 0, 0, 0, 0.5, 0, 0, 0, 0.5, -0.075, 0.5, 0) +mesh = ExtResource("1_cuxby") +skeleton = NodePath("") + +[node name="RollingPin" parent="." instance=ExtResource("2_cuxby")] +transform = Transform3D(0.0979824, 0, -0.9951882, 0, 1, 0, 0.9951882, 0, 0.0979824, 0.3562666, 0.575, 0) diff --git a/client/map/tiles/rolling_pin.res b/client/map/tiles/rolling_pin.res Binary files differnew file mode 100644 index 00000000..29a31bc7 --- /dev/null +++ b/client/map/tiles/rolling_pin.res diff --git a/client/map/tiles/rolling_pin.tscn b/client/map/tiles/rolling_pin.tscn new file mode 100644 index 00000000..b25419cd --- /dev/null +++ b/client/map/tiles/rolling_pin.tscn @@ -0,0 +1,10 @@ +[gd_scene load_steps=2 format=3 uid="uid://c8t04dfp45a86"] + +[ext_resource type="ArrayMesh" uid="uid://bijk6tpibbek3" path="res://map/tiles/rolling_pin.res" id="1_s0lm5"] + +[node name="RollingPin" type="Node3D"] + +[node name="Mesh" type="MeshInstance3D" parent="."] +transform = Transform3D(1.75, 0, 0, 0, 1.75, 0, 0, 0, 1.75, 0, 0, 0) +mesh = ExtResource("1_s0lm5") +skeleton = NodePath("") diff --git a/client/map/tiles/sounds/roll.ogg b/client/map/tiles/sounds/roll.ogg Binary files differnew file mode 100644 index 00000000..75eb8812 --- /dev/null +++ b/client/map/tiles/sounds/roll.ogg diff --git a/client/map/tiles/sounds/roll.ogg.import b/client/map/tiles/sounds/roll.ogg.import new file mode 100644 index 00000000..fb536ed1 --- /dev/null +++ b/client/map/tiles/sounds/roll.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://drck03qv37u3w" +path="res://.godot/imported/roll.ogg-777f87bf2da0dd0836179ee4fabb9c55.oggvorbisstr" + +[deps] + +source_file="res://map/tiles/sounds/roll.ogg" +dest_files=["res://.godot/imported/roll.ogg-777f87bf2da0dd0836179ee4fabb9c55.oggvorbisstr"] + +[params] + +loop=true +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 |