Skip to content

Commit

Permalink
Blastdoor and Atmos Holofield ID multitool syncing (shiptest-ss13#3004)
Browse files Browse the repository at this point in the history
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request

<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

Multitools can be used on a button with it's panel open to add a blast
door or holofield controller to it's buffer.

The ID can be copied onto a blast door the same way as changing it
normally with a multitool. For holofields, you need to have the access
mode on unlocked and it's panel closed.

Adds holofield controllers to the autolathe.

Changes all the span classes to span macros

## Why It's Good For The Game

<!-- Please add a short description of why you think these changes would
benefit the game. If you can't justify it in words, it might not be
worth adding. -->

When you have a roundstart blast door break or holofield break for
whatever reason, it's almost impossible to replace and properly resync
without ripping out the rest of the blastdoors or the other holofield.
This should make reconstruction more convienent.

Also being able to make and use your own holofield controller adds a
more intuitive way to rig up player made holofields, as currently you
have to use signallers on the activation wire.

## Changelog

:cl:
add: Autolathe can print holofield controllers.
add: You can sync blastdoors and holofields to a controller in a button
with a multitool
code: span macros for blast doors, buttons and holofields
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->

---------

Signed-off-by: Gristlebee <[email protected]>
Co-authored-by: FalloutFalcon <[email protected]>
  • Loading branch information
2 people authored and MysticalFaceLesS committed Jun 1, 2024
1 parent 7d05b1a commit d2498da
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 71 deletions.
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

0 comments on commit d2498da

Please sign in to comment.