From 4d883a67ef81ef9428e39734664430724668077f Mon Sep 17 00:00:00 2001 From: nokoe Date: Mon, 29 Sep 2025 23:57:44 +0200 Subject: use deep fryer basket; persist item rotation on counters --- client/map/tiles/deep_fryer.gd | 5 +++++ client/map/tiles/floor_like.gd | 1 + client/map/tiles/tile.gd | 10 ++++++++-- 3 files changed, 14 insertions(+), 2 deletions(-) (limited to 'client/map/tiles') diff --git a/client/map/tiles/deep_fryer.gd b/client/map/tiles/deep_fryer.gd index b5951630..82204cb8 100644 --- a/client/map/tiles/deep_fryer.gd +++ b/client/map/tiles/deep_fryer.gd @@ -22,5 +22,10 @@ func _init(ctx: TileFactory.TileCC): super(ctx) base.add_child(deep_fryer) +func set_item(i: Item): + super(i) + if i != null: + i.rotation_target = item_base.global_rotation.y + PI + static func interact_target() -> Vector3: return Vector3(0., 0.55, 0.) diff --git a/client/map/tiles/floor_like.gd b/client/map/tiles/floor_like.gd index d3da5fe0..228a95e9 100644 --- a/client/map/tiles/floor_like.gd +++ b/client/map/tiles/floor_like.gd @@ -13,6 +13,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . # +@abstract class_name FloorLike extends Tile diff --git a/client/map/tiles/tile.gd b/client/map/tiles/tile.gd index 7cf7be9b..9d4d732e 100644 --- a/client/map/tiles/tile.gd +++ b/client/map/tiles/tile.gd @@ -77,9 +77,15 @@ func pass_to(tile: Tile): tile.set_item(i) func set_item(i: Item): - if item != null: item.remove() + if item != null: + if i != null: + i.rotation.y = item.rotation.y + i.rotation_target = item.rotation_target + item.remove() item = i - if i != null: i.owned_by = item_base + if i != null: + i.owned_by = item_base + i.position_target = item_base.global_position func take_item() -> Item: var i = item -- cgit v1.2.3-70-g09d2