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

Blastdoor and Atmos Holofield ID multitool syncing #3004

Merged
merged 6 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
26 changes: 16 additions & 10 deletions code/game/machinery/buttons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -68,34 +68,40 @@
default_deconstruction_screwdriver(user, "button-open", "[skin]",W)
update_appearance()
else
to_chat(user, "<span class='alert'>Maintenance Access Denied.</span>")
to_chat(user, span_alert("Maintenance Access Denied."))
flick("[skin]-denied", src)
return

if(panel_open)
if(!device && istype(W, /obj/item/assembly))
if(!user.transferItemToLoc(W, src))
to_chat(user, "<span class='warning'>\The [W] is stuck to you!</span>")
to_chat(user, span_warning("\The [W] is stuck to you!"))
return
device = W
to_chat(user, "<span class='notice'>You add [W] to the button.</span>")
to_chat(user, span_notice("You add [W] to the button."))

if(!board && istype(W, /obj/item/electronics/airlock))
if(!user.transferItemToLoc(W, src))
to_chat(user, "<span class='warning'>\The [W] is stuck to you!</span>")
to_chat(user, span_warning("\The [W] is stuck to you!"))
return
board = W
if(board.one_access)
req_one_access = board.accesses
else
req_access = board.accesses
to_chat(user, "<span class='notice'>You add [W] to the button.</span>")
to_chat(user, span_notice("You add [W] to the button."))

if(device && W.tool_behaviour == TOOL_MULTITOOL)
var/obj/item/multitool/multi = W
if(istype(device, /obj/item/assembly/control))
multi.buffer = device
to_chat(user, span_notice("You copy the [device] to your multitool's buffer."))

if(!device && !board && W.tool_behaviour == TOOL_WRENCH)
to_chat(user, "<span class='notice'>You start unsecuring the button frame...</span>")
to_chat(user, span_notice("You start unsecuring the button frame..."))
W.play_tool_sound(src)
if(W.use_tool(src, user, 40))
to_chat(user, "<span class='notice'>You unsecure the button frame.</span>")
to_chat(user, span_notice("You unsecure the button frame."))
transfer_fingerprints_to(new /obj/item/wallframe/button(get_turf(src)))
playsound(loc, 'sound/items/deconstruct.ogg', 50, TRUE)
qdel(src)
Expand Down Expand Up @@ -153,14 +159,14 @@
req_one_access = list()
board = null
update_appearance()
to_chat(user, "<span class='notice'>You remove electronics from the button frame.</span>")
to_chat(user, span_notice("You remove electronics from the button frame."))

else
if(skin == "doorctrl")
skin = "launcher"
else
skin = "doorctrl"
to_chat(user, "<span class='notice'>You change the button frame's front panel.</span>")
to_chat(user, span_notice("You change the button frame's front panel."))
return

if((machine_stat & (NOPOWER|BROKEN)))
Expand All @@ -170,7 +176,7 @@
return

if(!allowed(user))
to_chat(user, "<span class='alert'>Access Denied.</span>")
to_chat(user, span_alert("Access Denied."))
flick("[skin]-denied", src)
return

Expand Down
34 changes: 20 additions & 14 deletions code/game/machinery/doors/poddoor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,32 @@
/obj/machinery/door/poddoor/attackby(obj/item/W, mob/user, params)
. = ..()
if((resistance_flags & INDESTRUCTIBLE) && W.tool_behaviour == TOOL_SCREWDRIVER) // This makes it so ERT members cannot cheese by opening their blast doors.
to_chat(user, "<span class='warning'>You can't find the panel!</span>")
to_chat(user, span_warning("You can't find the panel!"))
return

if(W.tool_behaviour == TOOL_SCREWDRIVER)
if(density)
to_chat(user, "<span class='warning'>You need to open [src] to access the maintenance panel!</span>")
to_chat(user, span_warning("You need to open [src] to access the maintenance panel"))
return
else if(default_deconstruction_screwdriver(user, icon_state, icon_state, W))
to_chat(user, "<span class='notice'>You [panel_open ? "open" : "close"] the maintenance hatch of [src].</span>")
to_chat(user, span_notice("You [panel_open ? "open" : "close"] the maintenance hatch of [src]."))
return TRUE

if(panel_open && !density)
if(W.tool_behaviour == TOOL_MULTITOOL)
var/change_id = input("Set [src]'s ID. It must be a number between 1 and 100.", "ID", id) as num|null
if(change_id)
id = clamp(round(change_id, 1), 1, 100)
to_chat(user, "<span class='notice'>You change the ID to [id].</span>")
var/obj/item/multitool/multi = W
if (istype(multi.buffer,/obj/item/assembly/control))
var/obj/item/assembly/control/controller = multi.buffer
id = controller.id
to_chat(user, span_notice("You copy the ID in your multitool's buffer into the [src]."))
else
var/change_id = input("Set [src]'s ID. It must be a number between 1 and 100.", "ID", id) as num|null
if(change_id)
id = clamp(round(change_id, 1), 1, 100)
to_chat(user, span_notice("You change the ID to [id]."))

if(W.tool_behaviour == TOOL_CROWBAR)
to_chat(user, "<span class='notice'>You start to remove the airlock electronics.</span>")
to_chat(user, span_notice("You start to remove the airlock electronics."))
if(!(machine_stat & NOPOWER))
do_sparks(5, TRUE, src)
electrocute_mob(user, get_area(src), src, 1, TRUE) //fuck this fella
Expand All @@ -52,9 +58,9 @@

/obj/machinery/door/poddoor/examine(mob/user)
. = ..()
. += "<span class='notice'>The maintenance panel is [panel_open ? "opened" : "closed"].</span>"
. += span_notice("The maintenance panel is [panel_open ? "opened" : "closed"].")
if(panel_open)
. += "<span class='notice'>The <b>airlock electronics</b> are exposed and could be <i>pried out</i>."
. += span_notice("The <b>airlock electronics</b> are exposed and could be <i>pried out</i>.")

/obj/machinery/door/poddoor/deconstruct(disassembled = TRUE, mob/user)
if(!(flags_1 & NODECONSTRUCT_1))
Expand Down Expand Up @@ -142,9 +148,9 @@
/obj/machinery/door/poddoor/attack_alien(mob/living/carbon/alien/humanoid/user)
if(density & !(resistance_flags & INDESTRUCTIBLE))
add_fingerprint(user)
user.visible_message("<span class='warning'>[user] begins prying open [src].</span>",\
"<span class='noticealien'>You begin digging your claws into [src] with all your might!</span>",\
"<span class='warning'>You hear groaning metal...</span>")
user.visible_message(span_warning("[user] begins prying open [src]."),\
span_noticealien("You begin digging your claws into [src] with all your might"),\
span_warning("You hear groaning metal..."))
playsound(src, 'sound/machines/creaking.ogg', 100, TRUE)

var/time_to_open = 5 SECONDS
Expand All @@ -153,7 +159,7 @@

if(do_after(user, time_to_open, TRUE, src))
if(density && !open(TRUE)) //The airlock is still closed, but something prevented it opening. (Another player noticed and bolted/welded the airlock in time!)
to_chat(user, "<span class='warning'>Despite your efforts, [src] managed to resist your attempts to open it!</span>")
to_chat(user, span_warning("Despite your efforts, [src] managed to resist your attempts to open it!"))

else
return ..()
Expand Down
Loading
Loading