Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds Professor DUMMY to the CMO office, accessible by the CMO and the SEA #5874

Merged
merged 28 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
614fe0d
Adds Professor Dummy to the morgue
Vicacrov Mar 3, 2024
68c5219
I love copypaste code
Vicacrov Mar 3, 2024
88dfca2
de_dust()
Vicacrov Mar 3, 2024
43b761d
Clears up dummy reference in the tablet
Vicacrov Mar 3, 2024
c526d7c
Adds lateinit, undos test stuff
Vicacrov Mar 3, 2024
e135211
Fixes dust() runtime
Vicacrov Mar 3, 2024
2a43f63
Fixes bad logic
Vicacrov Mar 3, 2024
4011f1c
Dust message styling
Vicacrov Mar 3, 2024
8fa0633
Fixes linter issue
Vicacrov Mar 3, 2024
9382f6b
Removes hijack started, dusts upon impact
Vicacrov Mar 4, 2024
1afab65
Requested changes
Vicacrov Mar 4, 2024
9d700b0
Removes lateinit, removes gamemode check
Vicacrov Mar 5, 2024
84807d4
Adds self-deleting to the tablet upon linked dummy deleting
Vicacrov Mar 5, 2024
b7aa62e
Handles removal from storages
Vicacrov Mar 5, 2024
be63eed
Combines the loadout with the mob, the mob self-spawns its tablet, au…
Vicacrov Mar 5, 2024
cadf41a
The cabinet no longer has surgical tools
Vicacrov Mar 5, 2024
9b7baff
Why do I use range here, cringe
Vicacrov Mar 5, 2024
ca822fe
accidental /
Vicacrov Mar 5, 2024
7b3efad
Missing parentheses
Vicacrov Mar 5, 2024
d9b8184
No need for double link
Vicacrov Mar 5, 2024
4f6110f
Adds auto-locking, makes it indestructible, emp deletes the dummy
Vicacrov Mar 5, 2024
a573a6e
Minor wording change
Vicacrov Mar 5, 2024
26dc005
Addresses review except for the preset part
Vicacrov Mar 5, 2024
ce58706
Readds the preset
Vicacrov Mar 5, 2024
e062207
Renamed proc
Vicacrov Mar 5, 2024
20ebb4b
Linter and typecasting
Vicacrov Mar 5, 2024
b534605
Space identation my beloved
Vicacrov Mar 5, 2024
c8ecfe8
Tweak signal location
Drulikar Mar 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 23 additions & 8 deletions code/game/objects/items/devices/dummy_tablet.dm
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/obj/item/device/professor_dummy_tablet
icon = 'icons/obj/items/devices.dmi'
name = "Professor DUMMY tablet"
name = "\improper Professor DUMMY tablet"
desc = "A Professor DUMMY Control Tablet."
suffix = "\[3\]"
icon_state = "Cotablet"
item_state = "Cotablet"

var/mob/living/carbon/human/linked_dummy
var/mob/living/carbon/human/dummy/professor_dummy/linked_dummy

/obj/item/device/professor_dummy_tablet/Destroy()
linked_dummy = null
Expand All @@ -21,23 +21,38 @@
*/
/obj/item/device/professor_dummy_tablet/proc/is_adjacent_to_dummy(mob/user)
if (get_dist(linked_dummy, user) > 1)
to_chat(user, "You are too far away to use the tablet.")
to_chat(user, SPAN_WARNING("You are too far away from the dummy to use its tablet."))
return FALSE

return TRUE

/obj/item/device/professor_dummy_tablet/proc/link_mob(mob/living/carbon/human/H)
linked_dummy = H
/obj/item/device/professor_dummy_tablet/proc/link_mob(mob/user)
for(var/mob/living/carbon/human/dummy/professor_dummy/dummy_to_link in range(1))
if(dummy_to_link)
linked_dummy = dummy_to_link
RegisterSignal(linked_dummy, COMSIG_PARENT_QDELETING, PROC_REF(clear_linked_mob))
if(user)
balloon_alert(user, "new dummy registered")
return TRUE
if(user)
balloon_alert(user, "no dummy detected nearby")
return FALSE

/obj/item/device/professor_dummy_tablet/proc/clear_linked_mob()
SIGNAL_HANDLER

UnregisterSignal(linked_dummy, COMSIG_PARENT_QDELETING)
linked_dummy = null

/obj/item/device/professor_dummy_tablet/attack_self(mob/user as mob)
..()
interact(user)

/obj/item/device/professor_dummy_tablet/interact(mob/user as mob)
if (isnull(linked_dummy))
if(isnull(linked_dummy))
link_mob(user)
return

if (!is_adjacent_to_dummy(user))
if(!is_adjacent_to_dummy(user))
return

user.set_interaction(src)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,38 @@
. = ..()
new /obj/item/storage/surgical_tray(src)
new /obj/item/roller/surgical(src)

/obj/structure/closet/secure_closet/surgical/professor_dummy
name = "professor dummy cabinet"
desc = "An ultrasafe cabinet containing Professor DUMMY and its tablet. Only accessible by Chief Medical Officers and Senior Listed Advisors."
unacidable = TRUE
unslashable = TRUE
store_mobs = TRUE

/obj/structure/closet/secure_closet/surgical/professor_dummy/Initialize()
. = ..()
new /obj/item/device/professor_dummy_tablet(src)
new /mob/living/carbon/human/dummy/professor_dummy(src)

/obj/structure/closet/secure_closet/surgical/professor_dummy/togglelock(mob/living/user)
if(user.job == JOB_CMO || user.job == JOB_SEA)
..()
return
Vicacrov marked this conversation as resolved.
Show resolved Hide resolved

to_chat(user, SPAN_WARNING("Only the [JOB_CMO] or the [JOB_SEA] can toggle this lock."))

/obj/structure/closet/secure_closet/surgical/professor_dummy/dump_contents()
if(locate(/mob/living/carbon/human/dummy/professor_dummy) in src)
visible_message(SPAN_HIGHDANGER("Professor DUMMY should only be used for teaching medical personnel, exclusively done by the [JOB_CMO] or the [JOB_SEA]. Do not abuse it."))
..()
Vicacrov marked this conversation as resolved.
Show resolved Hide resolved

/obj/structure/closet/secure_closet/surgical/professor_dummy/toggle(mob/living/user)
if(opened)
for(var/mob/M in loc)
if(!istype(M, /mob/living/carbon/human/dummy/professor_dummy))
visible_message(SPAN_WARNING("[src] won't budge!"))
return
..()

/obj/structure/closet/secure_closet/surgical/professor_dummy/flashbang(datum/source, obj/item/explosive/grenade/flashbang/FB)
return
22 changes: 21 additions & 1 deletion code/modules/mob/living/carbon/human/human_dummy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,31 @@ GLOBAL_LIST_EMPTY(dummy_mob_list)
/mob/living/carbon/human/dummy/add_to_all_mob_huds()
return


/mob/living/carbon/human/dummy/tutorial // Effectively an even more disabled dummy

/mob/living/carbon/human/dummy/tutorial/Initialize(mapload)
. = ..()
status_flags = GODMODE
ADD_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_SOURCE_TUTORIAL)
anchored = TRUE

// Used by the CMO and the SEA for teaching medical personnel
/mob/living/carbon/human/dummy/professor_dummy/Initialize(mapload)
. = ..()
change_real_name(src, "Professor DUMMY")
return INITIALIZE_HINT_ROUNDSTART

// It should absolutely self-destroy upon hijack, so xenos don't get an effectively godmoded mob
/mob/living/carbon/human/dummy/professor_dummy/LateInitialize()
if(is_mainship_level(z) && istype(SSticker.mode, /datum/game_mode/colonialmarines))
RegisterSignal(SSdcs, COMSIG_GLOB_HIJACK_LANDED, PROC_REF(destroy_upon_hijack))

/mob/living/carbon/human/dummy/professor_dummy/proc/destroy_upon_hijack()
Drulikar marked this conversation as resolved.
Show resolved Hide resolved
SIGNAL_HANDLER

visible_message(SPAN_WARNING("The [src] suddenly disintegrates!"))
dust(create_cause_data("hijack autodelete"))

/mob/living/carbon/human/dummy/professor_dummy/Destroy()
UnregisterSignal(src, COMSIG_GLOB_HIJACK_LANDED)
return ..()
7 changes: 5 additions & 2 deletions maps/map_files/USS_Almayer/USS_Almayer.dmm
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mapping lgtm

Original file line number Diff line number Diff line change
Expand Up @@ -7504,6 +7504,9 @@
pixel_y = 16
},
/obj/item/clothing/accessory/stethoscope,
/obj/structure/closet/secure_closet/surgical/professor_dummy{
pixel_x = -32
},
/turf/open/floor/almayer{
dir = 8;
icon_state = "sterile_green_corner"
Expand Down Expand Up @@ -19311,9 +19314,9 @@
},
/area/almayer/medical/morgue)
"cnZ" = (
/obj/item/tool/surgery/hemostat,
/obj/item/tool/surgery/scalpel,
/obj/structure/surface/table/reinforced/prison,
/obj/item/tool/surgery/scalpel,
/obj/item/tool/surgery/hemostat,
/turf/open/floor/almayer{
dir = 8;
icon_state = "sterile_green_corner"
Expand Down
Loading