Buffs APC Construction/Deconstruction (#28795)

* initial commit

* Update apc_construction.dm

* Apply suggestions from code review

Co-authored-by: 1080pCat <96908085+1080pCat@users.noreply.github.com>
Signed-off-by: CRUNCH <143041327+Fordoxia@users.noreply.github.com>

* speed

---------

Signed-off-by: CRUNCH <143041327+Fordoxia@users.noreply.github.com>
Co-authored-by: 1080pCat <96908085+1080pCat@users.noreply.github.com>
This commit is contained in:
CRUNCH
2025-04-18 22:07:56 +00:00
committed by GitHub
co-authored by 1080pCat
parent 8dbbc06f3d
commit 11fa22bf10
3 changed files with 18 additions and 24 deletions
+3 -19
View File
@@ -20,12 +20,8 @@
move_resist = INFINITY
/*** APC construction vars***/
// These exist here and not as defines in `apc_defines.dm` so they can be modified for `test_apc_construction.dm`. I hate that these timers exist at all.
var/apc_cover_replacement_time = 2 SECONDS
var/apc_frame_replacement_time = 5 SECONDS
var/apc_frame_welding_time = 5 SECONDS
var/apc_electronics_installation_time = 1 SECONDS
var/apc_electronics_crowbar_time = 5 SECONDS
// These exist here and not as defines in `apc_defines.dm` so they can be modified for `test_apc_construction.dm`.
var/apc_frame_welding_time = 2 SECONDS
var/apc_terminal_wiring_time = 2 SECONDS
// set so that APCs aren't found as powernet nodes //Hackish, Horrible, was like this before I changed it :(
@@ -343,10 +339,6 @@
return ITEM_INTERACT_COMPLETE
if(!has_electronics())
to_chat(user, "<span class='notice'>You start to add [used] to [src].</span>")
if(!do_after(user, apc_electronics_installation_time, target = src))
return ITEM_INTERACT_COMPLETE
user.visible_message(
"<span class='notice'>[user] installs [used] into [src].</span>",
"<span class='notice'>You install [used] into [src].</span>"
@@ -359,7 +351,7 @@
qdel(used)
return ITEM_INTERACT_COMPLETE
// APC frame repair.
// APC frame repair. Instant, but you consume 2 metal instead of doing it for free.
if(istype(used, /obj/item/mounted/frame/apc_frame) && opened)
if(!(stat & BROKEN || opened == APC_COVER_OFF || obj_integrity < max_integrity))
to_chat(user, "<span class='warning'>[src] has no damage to fix!</span>")
@@ -367,10 +359,6 @@
// Only cover is broken, no need to remove any components.
if(!(stat & BROKEN) && opened == APC_COVER_OFF)
to_chat(user, "<span class='notice'>You begin to replace the missing cover of [src].</span>")
if(!do_after(user, apc_cover_replacement_time, target = src))
return ITEM_INTERACT_COMPLETE
user.visible_message(
"<span class='notice'>[user] replaces the missing cover of [src].</span>",
"<span class='notice'>You replace the missing cover of [src].</span>"
@@ -384,10 +372,6 @@
to_chat(user, "<span class='warning'>You cannot repair [src] until you remove the electronics!</span>")
return ITEM_INTERACT_COMPLETE
to_chat(user, "<span class='notice'>You begin to replace the damaged APC frame...</span>")
if(!do_after(user, apc_frame_replacement_time, target = src))
return ITEM_INTERACT_COMPLETE
user.visible_message(
"<span class='notice'>[user] replaces the damaged frame of [src].</span>",
"<span class='notice'>You replace the damaged frame of [src].</span>"
+15 -1
View File
@@ -45,7 +45,7 @@
to_chat(user, "<span class='warning'>Disconnect the wires first!</span>")
return
if(I.use_tool(src, user, apc_electronics_crowbar_time, volume = I.tool_volume))
if(I.use_tool(src, user, FALSE, volume = I.tool_volume))
if(has_electronics())
electronics_state = APC_ELECTRONICS_NONE
if(stat & BROKEN)
@@ -104,6 +104,20 @@
opened = APC_OPENED
update_icon()
// 3. Broken, closed APC
if((stat & BROKEN) && opened == APC_CLOSED)
if(!I.use_tool(src, user, 1 SECONDS, volume = I.tool_volume))
return
user.visible_message(
"<span class='notice'>[user] rips the cover off [src].</span>",
"<span class='notice'>You rip the cover off [src].</span>",
"<span class='warning'>You hear metallic levering and a small flat object falling to the floor!</span>"
)
panel_open = FALSE // Avoid wacky behavour with wires.
opened = APC_COVER_OFF
update_icon()
/obj/machinery/power/apc/screwdriver_act(mob/living/user, obj/item/I)
. = TRUE
-4
View File
@@ -13,11 +13,7 @@
player.click_on(wall)
var/obj/machinery/power/apc/apc_frame = player.find_nearby(/obj/machinery/power/apc)
// Make this not take 5 billion years.
apc_frame.apc_cover_replacement_time = 0
apc_frame.apc_frame_replacement_time = 0
apc_frame.apc_frame_welding_time = 0
apc_frame.apc_electronics_installation_time = 0
apc_frame.apc_electronics_crowbar_time = 0
apc_frame.apc_terminal_wiring_time = 0
var/obj/the_electronics = player.spawn_obj_in_hand(/obj/item/apc_electronics/)