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 4 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."))
Gristlebee marked this conversation as resolved.
Show resolved Hide resolved
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
108 changes: 61 additions & 47 deletions code/game/machinery/shieldgen.dm
Original file line number Diff line number Diff line change
Expand Up @@ -122,86 +122,84 @@
if(.)
return
if(locked && !issilicon(user))
to_chat(user, "<span class='warning'>The machine is locked, you are unable to use it!</span>")
to_chat(user, span_notice("The machine is locked, you are unable to use it!"))
return
if(panel_open)
to_chat(user, "<span class='warning'>The panel must be closed before operating this machine!</span>")
to_chat(user, span_warning("The panel must be closed before operating this machine!"))
return

if (active)
user.visible_message("<span class='notice'>[user] deactivated \the [src].</span>", \
"<span class='notice'>You deactivate \the [src].</span>", \
"<span class='hear'>You hear heavy droning fade out.</span>")
user.visible_message(span_notice("[user] deactivated \the [src]."), span_notice("You deactivate \the [src]."), span_hear("You hear heavy droning fade out"))
shields_down()
else
if(anchored)
user.visible_message("<span class='notice'>[user] activated \the [src].</span>", \
"<span class='notice'>You activate \the [src].</span>", \
"<span class='hear'>You hear heavy droning.</span>")
user.visible_message(span_notice("[user] activated \the [src]."), \
span_notice("You activate \the [src]."), \
span_hear("You hear heavy droning."))
shields_up()
else
to_chat(user, "<span class='warning'>The device must first be secured to the floor!</span>")
to_chat(user, span_warning("The device must first be secured to the floor!"))
return

/obj/machinery/shieldgen/attackby(obj/item/W, mob/user, params)
if(W.tool_behaviour == TOOL_SCREWDRIVER)
W.play_tool_sound(src, 100)
panel_open = !panel_open
if(panel_open)
to_chat(user, "<span class='notice'>You open the panel and expose the wiring.</span>")
to_chat(user, span_notice("You open the panel and expose the wiring."))
else
to_chat(user, "<span class='notice'>You close the panel.</span>")
to_chat(user, span_notice("You close the panel."))
else if(istype(W, /obj/item/stack/cable_coil) && (machine_stat & BROKEN) && panel_open)
var/obj/item/stack/cable_coil/coil = W
if (coil.get_amount() < 1)
to_chat(user, "<span class='warning'>You need one length of cable to repair [src]!</span>")
to_chat(user, span_warning("You need one length of cable to repair [src]!"))
return
to_chat(user, "<span class='notice'>You begin to replace the wires...</span>")
to_chat(user, span_notice("You begin to replace the wires..."))
if(do_after(user, 30, target = src))
if(coil.get_amount() < 1)
return
coil.use(1)
obj_integrity = max_integrity
set_machine_stat(machine_stat & ~BROKEN)
to_chat(user, "<span class='notice'>You repair \the [src].</span>")
to_chat(user, span_notice("You repair \the [src]."))
update_appearance()

else if(W.tool_behaviour == TOOL_WRENCH)
if(locked)
to_chat(user, "<span class='warning'>The bolts are covered! Unlocking this would retract the covers.</span>")
to_chat(user, span_warning("The bolts are covered! Unlocking this would retract the covers."))
return
if(!anchored && !isinspace())
W.play_tool_sound(src, 100)
to_chat(user, "<span class='notice'>You secure \the [src] to the floor!</span>")
to_chat(user, span_notice("You secure \the [src] to the floor!"))
set_anchored(TRUE)
else if(anchored)
W.play_tool_sound(src, 100)
to_chat(user, "<span class='notice'>You unsecure \the [src] from the floor!</span>")
to_chat(user, span_notice("You unsecure \the [src] from the floor!"))
if(active)
to_chat(user, "<span class='notice'>\The [src] shuts off!</span>")
to_chat(user, span_notice("\The [src] shuts off!"))
shields_down()
set_anchored(FALSE)

else if(W.GetID())
if(allowed(user) && !(obj_flags & EMAGGED))
locked = !locked
to_chat(user, "<span class='notice'>You [locked ? "lock" : "unlock"] the controls.</span>")
to_chat(user, span_notice("You [locked ? "lock" : "unlock"] the controls."))
else if(obj_flags & EMAGGED)
to_chat(user, "<span class='danger'>Error, access controller damaged!</span>")
to_chat(user, span_danger("Error, access controller damaged!"))
else
to_chat(user, "<span class='danger'>Access denied.</span>")
to_chat(user, span_danger("Access denied."))

else
return ..()

/obj/machinery/shieldgen/emag_act(mob/user)
if(obj_flags & EMAGGED)
to_chat(user, "<span class='warning'>The access controller is damaged!</span>")
to_chat(user, span_warning("The access controller is damaged!"))
return
obj_flags |= EMAGGED
locked = FALSE
playsound(src, "sparks", 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
to_chat(user, "<span class='warning'>You short out the access controller.</span>")
to_chat(user, span_warning("You short out the access controller."))

/obj/machinery/shieldgen/update_icon_state()
icon_state = "shield[active ? "on" : "off"][(machine_stat & BROKEN) ? "br" : null]"
Expand Down Expand Up @@ -275,9 +273,7 @@
if(!active_power_usage || surplus() >= active_power_usage)
add_load(active_power_usage)
else
visible_message("<span class='danger'>The [src.name] shuts down due to lack of power!</span>", \
"If this message is ever seen, something is wrong.",
"<span class='hear'>You hear heavy droning fade out.</span>")
visible_message(span_danger("The [src.name] shuts down due to lack of power!"), "If this message is ever seen, something is wrong.",span_hear("You hear heavy droning fade out.</"))
active = FALSE
log_game("[src] deactivated due to lack of power at [AREACOORD(src)]")
for(var/direction in GLOB.cardinals)
Expand Down Expand Up @@ -348,7 +344,7 @@
/obj/machinery/power/shieldwallgen/can_be_unfasten_wrench(mob/user, silent)
if(active)
if(!silent)
to_chat(user, "<span class='warning'>Turn off the shield generator first!</span>")
to_chat(user, span_warning("Turn off the shield generator first!"))
return FAILED_UNFASTEN
return ..()

Expand Down Expand Up @@ -388,11 +384,11 @@
if(item.GetID())
if(allowed(user) && !(obj_flags & EMAGGED))
locked = !locked
to_chat(user, "<span class='notice'>You [src.locked ? "lock" : "unlock"] the controls.</span>")
to_chat(user, span_notice("You [src.locked ? "lock" : "unlock"] the controls."))
else if(obj_flags & EMAGGED)
to_chat(user, "<span class='danger'>Error, access controller damaged!</span>")
to_chat(user, span_danger("Error, access controller damaged!"))
else
to_chat(user, "<span class='danger'>Access denied.</span>")
to_chat(user, span_danger("Access denied."))

else
add_fingerprint(user)
Expand All @@ -406,25 +402,23 @@
shock(user,50)
return
if(!anchored)
to_chat(user, "<span class='warning'>\The [src] needs to be firmly secured to the floor first!</span>")
to_chat(user, span_warning("\The [src] needs to be firmly secured to the floor first!"))
return
if(locked && !issilicon(user))
to_chat(user, "<span class='warning'>The controls are locked!</span>")
to_chat(user, span_warning("The controls are locked!"))
return
if(!powernet)
to_chat(user, "<span class='warning'>\The [src] needs to be powered by a wire!</span>")
to_chat(user, span_warning("\The [src] needs to be powered by a wire!"))
return

if(active)
user.visible_message("<span class='notice'>[user] turned \the [src] off.</span>", \
"<span class='notice'>You turn off \the [src].</span>", \
"<span class='hear'>You hear heavy droning fade out.</span>")
user.visible_message(span_notice("[user] turned \the [src] off."), \
span_notice("You turn off \the [src]."), \
span_hear("You hear heavy droning fade out."))
active = FALSE
log_game("[src] was deactivated by [key_name(user)] at [AREACOORD(src)]")
else
user.visible_message("<span class='notice'>[user] turned \the [src] on.</span>", \
"<span class='notice'>You turn on \the [src].</span>", \
"<span class='hear'>You hear heavy droning.</span>")
user.visible_message(span_notice("[user] turned \the [src] on."), span_notice("ou turn on \the [src]."), span_hear("ou hear heavy droning."))
active = ACTIVE_SETUPFIELDS
log_game("[src] was activated by [key_name(user)] at [AREACOORD(src)]")
add_fingerprint(user)
Expand All @@ -435,28 +429,28 @@
if(!powernet)
return
if(active)
visible_message("<span class= 'notice'>The [src.name] hums as it powers down.</span>", \
visible_message(span_notice("The [src.name] hums as it powers down."), \
"If this message is ever seen, something is wrong.", \
"<span class= 'notice'>You hear heavy droning fade out.</span>")
span_notice("You hear heavy droning fade out."))
playsound(src, 'sound/machines/synth_no.ogg', 50, TRUE, frequency = 6120)
active = FALSE
log_game("[src] was deactivated by wire pulse at [AREACOORD(src)]")
else
visible_message("<span class= 'notice'>The [src.name] beeps as it powers up.</span>", \
visible_message(span_notice("The [src.name] beeps as it powers up."), \
"If this message is ever seen, something is wrong.", \
"<span class= 'notice'>You hear heavy droning.</span>")
span_notice("You hear heavy droning."))
playsound(src, 'sound/machines/synth_yes.ogg', 50, TRUE, frequency = 6120)
active = ACTIVE_SETUPFIELDS
log_game("[src] was activated by wire pulse at [AREACOORD(src)]")

/obj/machinery/power/shieldwallgen/emag_act(mob/user)
if(obj_flags & EMAGGED)
to_chat(user, "<span class='warning'>The access controller is damaged!</span>")
to_chat(user, span_warning("The access controller is damaged!"))
return
obj_flags |= EMAGGED
locked = FALSE
playsound(src, "sparks", 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
to_chat(user, "<span class='warning'>You short out the access controller.</span>")
to_chat(user, span_warning("You short out the access controller."))

/obj/machinery/power/shieldwallgen/proc/shock(mob/user, prb)
if(machine_stat & (BROKEN|NOPOWER)) // unpowered, no shock
Expand Down Expand Up @@ -511,9 +505,29 @@

/obj/machinery/power/shieldwallgen/atmos/proc/can_be_rotated(mob/user, rotation_type)
if (anchored)
to_chat(user, "<span class='warning'>It is fastened to the floor!</span>")
to_chat(user, span_warning("It is fastened to the floor!"))
return FALSE
return TRUE
/obj/machinery/power/shieldwallgen/atmos/attacked_by(obj/item/I, mob/living/user)
if(I.tool_behaviour == TOOL_MULTITOOL)
Gristlebee marked this conversation as resolved.
Show resolved Hide resolved
var/obj/item/multitool/multi = I
if(!panel_open && !locked)
if(istype(multi.buffer,/obj/item/assembly/control/shieldwallgen))
var/obj/item/assembly/control/shieldwallgen/controller = multi.buffer
to_chat(user, span_notice("You copy the ID in your multitool's buffer to the [src]."))
id = controller.id
return TRUE

else
to_chat(user, span_warning("The controls are locked!"))
return

return ..()

/obj/machinery/power/shieldwallgen/atmos/multitool_act(mob/living/user, obj/item/I)
. = ..()



/// Same as in the normal shieldwallgen, but with the shieldwalls replaced with atmos shieldwalls
/obj/machinery/power/shieldwallgen/atmos/setup_field(direction)
Expand Down Expand Up @@ -586,7 +600,7 @@
setDir(get_dir(gen_primary, gen_secondary))
if(hardshield == TRUE)
for(var/mob/living/victim in get_turf(src))
visible_message("<span class='danger'>\The [src] is suddenly occupying the same space as \the [victim]!</span>")
visible_message(span_danger("\The [src] is suddenly occupying the same space as \the [victim]!"))
victim.gib()

/obj/machinery/shieldwall/Destroy()
Expand Down
Loading
Loading