From fbcca6cffb670a773b7bbbd9775184b82da1cb39 Mon Sep 17 00:00:00 2001 From: FelixRuin Date: Thu, 2 Jan 2025 00:35:21 +0300 Subject: [PATCH 1/4] inf dorms locking --- .../ruins/spaceruin_code/hilbertshotel.dm | 16 +++++++++++++-- .../SmiLeY/code/hilbertshotel_ghost.dm | 20 +++++++++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/code/modules/ruins/spaceruin_code/hilbertshotel.dm b/code/modules/ruins/spaceruin_code/hilbertshotel.dm index 6dc73d6cca80..d6592af1ee7d 100644 --- a/code/modules/ruins/spaceruin_code/hilbertshotel.dm +++ b/code/modules/ruins/spaceruin_code/hilbertshotel.dm @@ -31,6 +31,7 @@ GLOBAL_VAR_INIT(hhmysteryRoomNumber, 1337) var/list/activeRooms = list() var/list/storedRooms = list() var/list/checked_in_ckeys = list() + var/list/lockedRooms = list() var/storageTurf //Lore Stuff var/ruinSpawned = FALSE @@ -91,6 +92,11 @@ GLOBAL_VAR_INIT(hhmysteryRoomNumber, 1337) return chosenRoomNumber = input(user, "What number room will you be checking into?", "Room Number") as null|num + if(!mob_dorms[user] || !mob_dorms[user].Find(chosenRoomNumber)) //BLUEMOON ADD владелец комнаты может зайти в комнату даже если она закрыта и активна + if(activeRooms.len && activeRooms["[chosenRoomNumber]"]) //лесенка ради удобства восприятия, точно-точно говорю + if(lockedRooms.len && lockedRooms["[chosenRoomNumber]"]) + to_chat(user, span_warning("Your cant enter in locked room, contact with room owner.")) + return //BLUEMOON ADD END if(max_rooms > 0 && mob_dorms[user]?.len >= max_rooms && !activeRooms["[chosenRoomNumber]"] && !storedRooms["[chosenRoomNumber]"]) to_chat(user, span_warning("Your free trial of Hilbert's Hotel has ended! Please select one of the rooms you've already visited.")) chosenRoomNumber = input(user, "Select one of your previous rooms", "Room number") as null|anything in mob_dorms[user] @@ -317,7 +323,10 @@ GLOBAL_VAR_INIT(hhmysteryRoomNumber, 1337) currentArea.reservation = currentReservation for(var/turf/closed/indestructible/hoteldoor/door in currentArea) door.parentSphere = src - door.desc = "The door to this hotel room. The placard reads 'Room [currentRoomnumber]'. Strange, this door doesnt even seem openable. The doorknob, however, seems to buzz with unusual energy...
Alt-Click to look through the peephole." + door.desc = "The door to this hotel room. The placard reads 'Room [currentRoomnumber]'. \ + Strange, this door doesnt even seem openable. The doorknob, however, seems to buzz with unusual energy...
\ + Alt-Click to look through the peephole.
\ + Ctrl-Click to lock door if you owner of the room." for(var/turf/open/space/bluespace/BSturf in currentArea) BSturf.parentSphere = src @@ -373,7 +382,10 @@ GLOBAL_VAR_INIT(hhmysteryRoomNumber, 1337) var/area/hilbertshotel/currentArea = get_area(locate(currentReservation.bottom_left_coords[1], currentReservation.bottom_left_coords[2], currentReservation.bottom_left_coords[3])) for(var/turf/closed/indestructible/hoteldoor/door in currentArea) door.parentSphere = src - door.desc = "The door to this hotel room. Strange, this door doesnt even seem openable. The doorknob, however, seems to buzz with unusual energy...
Alt-Click to look through the peephole." + door.desc = "The door to this hotel room. The placard reads 'Room [currentRoomnumber]'. \ + Strange, this door doesnt even seem openable. The doorknob, however, seems to buzz with unusual energy...
\ + Alt-Click to look through the peephole.
\ + Ctrl-Click to lock door if you owner of the room." //Template Stuff /datum/map_template/hilbertshotel diff --git a/modular_bluemoon/SmiLeY/code/hilbertshotel_ghost.dm b/modular_bluemoon/SmiLeY/code/hilbertshotel_ghost.dm index e28baa3bf87e..740d3cb801b8 100644 --- a/modular_bluemoon/SmiLeY/code/hilbertshotel_ghost.dm +++ b/modular_bluemoon/SmiLeY/code/hilbertshotel_ghost.dm @@ -16,6 +16,26 @@ return //you can't enter infinity dormitories if you are a role return promptAndCheckIn(user, user) +/turf/closed/indestructible/hoteldoor/CtrlClick(mob/user) + . = ..() + var/area/hilbertshotel/HB = get_area(src) + var/roomnumber = "[HB.roomnumber]" + if(!parentSphere ) + return + if(!parentSphere.mob_dorms[user] || !parentSphere.mob_dorms[user].Find(HB.roomnumber)) + return + if(get_dist(get_turf(src), get_turf(user)) > 1) + return + + if(parentSphere.lockedRooms[roomnumber]) + parentSphere.lockedRooms -= roomnumber + playsound(src, 'sound/machines/locker_open.ogg', 50, 1) + else + parentSphere.lockedRooms[roomnumber] = TRUE + playsound(src, 'sound/machines/locker_close.ogg', 50, 1) + + to_chat(user, "You [parentSphere.lockedRooms[roomnumber] ? "locked" : "unlocked"] room...") + /datum/map_template/hilbertshotel/apartment name = "Apartment" mappath = '_maps/templates/apartment.dmm' From 6ee5c22dc1bfff816b7e7492154479b5fa2a8987 Mon Sep 17 00:00:00 2001 From: FelixRuin Date: Thu, 2 Jan 2025 12:16:44 +0300 Subject: [PATCH 2/4] Update hilbertshotel.dm --- code/modules/ruins/spaceruin_code/hilbertshotel.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/ruins/spaceruin_code/hilbertshotel.dm b/code/modules/ruins/spaceruin_code/hilbertshotel.dm index d6592af1ee7d..cba31f8d38e9 100644 --- a/code/modules/ruins/spaceruin_code/hilbertshotel.dm +++ b/code/modules/ruins/spaceruin_code/hilbertshotel.dm @@ -95,7 +95,7 @@ GLOBAL_VAR_INIT(hhmysteryRoomNumber, 1337) if(!mob_dorms[user] || !mob_dorms[user].Find(chosenRoomNumber)) //BLUEMOON ADD владелец комнаты может зайти в комнату даже если она закрыта и активна if(activeRooms.len && activeRooms["[chosenRoomNumber]"]) //лесенка ради удобства восприятия, точно-точно говорю if(lockedRooms.len && lockedRooms["[chosenRoomNumber]"]) - to_chat(user, span_warning("Your cant enter in locked room, contact with room owner.")) + to_chat(user, span_warning("You cant enter in locked room, contact with room owner.")) return //BLUEMOON ADD END if(max_rooms > 0 && mob_dorms[user]?.len >= max_rooms && !activeRooms["[chosenRoomNumber]"] && !storedRooms["[chosenRoomNumber]"]) to_chat(user, span_warning("Your free trial of Hilbert's Hotel has ended! Please select one of the rooms you've already visited.")) From b7624e62c339753067dccbd6adad948e6e26bd53 Mon Sep 17 00:00:00 2001 From: FelixRuin Date: Thu, 2 Jan 2025 14:12:06 +0300 Subject: [PATCH 3/4] desk change --- code/modules/ruins/spaceruin_code/hilbertshotel.dm | 12 ++++-------- modular_bluemoon/SmiLeY/code/hilbertshotel_ghost.dm | 8 ++++++++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/code/modules/ruins/spaceruin_code/hilbertshotel.dm b/code/modules/ruins/spaceruin_code/hilbertshotel.dm index cba31f8d38e9..8dd84b3b2e62 100644 --- a/code/modules/ruins/spaceruin_code/hilbertshotel.dm +++ b/code/modules/ruins/spaceruin_code/hilbertshotel.dm @@ -323,10 +323,7 @@ GLOBAL_VAR_INIT(hhmysteryRoomNumber, 1337) currentArea.reservation = currentReservation for(var/turf/closed/indestructible/hoteldoor/door in currentArea) door.parentSphere = src - door.desc = "The door to this hotel room. The placard reads 'Room [currentRoomnumber]'. \ - Strange, this door doesnt even seem openable. The doorknob, however, seems to buzz with unusual energy...
\ - Alt-Click to look through the peephole.
\ - Ctrl-Click to lock door if you owner of the room." + door.roomnumber = currentRoomnumber for(var/turf/open/space/bluespace/BSturf in currentArea) BSturf.parentSphere = src @@ -382,10 +379,7 @@ GLOBAL_VAR_INIT(hhmysteryRoomNumber, 1337) var/area/hilbertshotel/currentArea = get_area(locate(currentReservation.bottom_left_coords[1], currentReservation.bottom_left_coords[2], currentReservation.bottom_left_coords[3])) for(var/turf/closed/indestructible/hoteldoor/door in currentArea) door.parentSphere = src - door.desc = "The door to this hotel room. The placard reads 'Room [currentRoomnumber]'. \ - Strange, this door doesnt even seem openable. The doorknob, however, seems to buzz with unusual energy...
\ - Alt-Click to look through the peephole.
\ - Ctrl-Click to lock door if you owner of the room." + door.roomnumber = currentRoomnumber //Template Stuff /datum/map_template/hilbertshotel @@ -444,6 +438,8 @@ GLOBAL_VAR_INIT(hhmysteryRoomNumber, 1337) icon_state = "hoteldoor" explosion_block = INFINITY var/obj/item/hilbertshotel/parentSphere + var/roomnumber + desc = "The door to this hotel room. Strange, this door doesnt even seem openable. The doorknob, however, seems to buzz with unusual energy..." /turf/closed/indestructible/hoteldoor/proc/promptExit(mob/living/user) if(!isliving(user)) diff --git a/modular_bluemoon/SmiLeY/code/hilbertshotel_ghost.dm b/modular_bluemoon/SmiLeY/code/hilbertshotel_ghost.dm index 740d3cb801b8..d3df67b9fa51 100644 --- a/modular_bluemoon/SmiLeY/code/hilbertshotel_ghost.dm +++ b/modular_bluemoon/SmiLeY/code/hilbertshotel_ghost.dm @@ -36,6 +36,14 @@ to_chat(user, "You [parentSphere.lockedRooms[roomnumber] ? "locked" : "unlocked"] room...") +/turf/closed/indestructible/hoteldoor/examine(mob/user) + . = ..() + if(!isliving(user)) + return + . += "The placard reads 'Room [roomnumber]'." + . += "Alt-Click to look through the peephole." + . += "Ctrl-Click to lock door if you owner of the room." + /datum/map_template/hilbertshotel/apartment name = "Apartment" mappath = '_maps/templates/apartment.dmm' From e70d916605acd6bc7e8d47e33d5c33139625bd0d Mon Sep 17 00:00:00 2001 From: FelixRuin Date: Thu, 16 Jan 2025 23:30:20 +0300 Subject: [PATCH 4/4] var for rooms can be locked --- _maps/map_files/generic/CentCom.dmm | 2 +- modular_bluemoon/SmiLeY/code/hilbertshotel_ghost.dm | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/_maps/map_files/generic/CentCom.dmm b/_maps/map_files/generic/CentCom.dmm index dde889c69ed9..48833557720c 100644 --- a/_maps/map_files/generic/CentCom.dmm +++ b/_maps/map_files/generic/CentCom.dmm @@ -25204,7 +25204,7 @@ /turf/open/floor/plating, /area/syndicate_mothership/control) "pgm" = ( -/obj/item/hilbertshotel/ghostdojo, +/obj/item/hilbertshotel/ghostdojo/ghostcafe, /turf/open/indestructible/hotelwood, /area/centcom/holding) "pgn" = ( diff --git a/modular_bluemoon/SmiLeY/code/hilbertshotel_ghost.dm b/modular_bluemoon/SmiLeY/code/hilbertshotel_ghost.dm index d3df67b9fa51..fb6d391d437a 100644 --- a/modular_bluemoon/SmiLeY/code/hilbertshotel_ghost.dm +++ b/modular_bluemoon/SmiLeY/code/hilbertshotel_ghost.dm @@ -1,7 +1,13 @@ +/obj/item/hilbertshotel + var/rooms_can_be_locked = FALSE + /obj/item/hilbertshotel/ghostdojo name = "infinite dormitories" anchored = TRUE +/obj/item/hilbertshotel/ghostdojo/ghostcafe + rooms_can_be_locked = TRUE + /obj/item/hilbertshotel/ghostdojo/attack_hand(mob/user, list/modifiers) . = ..() if(.) @@ -20,7 +26,9 @@ . = ..() var/area/hilbertshotel/HB = get_area(src) var/roomnumber = "[HB.roomnumber]" - if(!parentSphere ) + if(!parentSphere) + return + if(!parentSphere.rooms_can_be_locked) return if(!parentSphere.mob_dorms[user] || !parentSphere.mob_dorms[user].Find(HB.roomnumber)) return @@ -42,7 +50,8 @@ return . += "The placard reads 'Room [roomnumber]'." . += "Alt-Click to look through the peephole." - . += "Ctrl-Click to lock door if you owner of the room." + if(parentSphere && parentSphere.rooms_can_be_locked) + . += "Ctrl-Click to lock door if you owner of the room." /datum/map_template/hilbertshotel/apartment name = "Apartment"