This commit is contained in:
SandPoot
2024-08-24 21:28:55 -03:00
parent 9604090014
commit c07e94be66
218 changed files with 1001 additions and 979 deletions
+31 -31
View File
@@ -254,7 +254,7 @@
opened = APC_COVER_OPENED
operating = FALSE
name = "\improper [A.name] APC"
set_machine_stat(stat | MAINT)
set_machine_stat(machine_stat | MAINT)
update_appearance()
addtimer(CALLBACK(src, PROC_REF(update)), 5)
@@ -291,7 +291,7 @@
opened = APC_COVER_OPENED
operating = FALSE
name = "\improper [get_area_name(area, TRUE)] APC"
set_machine_stat(stat | MAINT)
set_machine_stat(machine_stat | MAINT)
update_appearance()
addtimer(CALLBACK(src, PROC_REF(update)), 5)
register_context()
@@ -337,7 +337,7 @@
/obj/machinery/power/apc/examine(mob/user)
. = ..()
if(stat & BROKEN)
if(machine_stat & BROKEN)
return
if(opened)
if(has_electronics && terminal)
@@ -349,7 +349,7 @@
. += "<span class='warning'>[src]'s innards have been replaced by strange brass machinery!</span>"
else
if (stat & MAINT)
if (machine_stat & MAINT)
. += "The cover is closed. Something is wrong with it. It doesn't work."
else if (malfhack)
. += "The cover is broken. It may be hard to force it open."
@@ -419,7 +419,7 @@
/obj/machinery/power/apc/update_overlays()
. = ..()
if((stat & (BROKEN|MAINT)) || update_state)
if((machine_stat & (BROKEN|MAINT)) || update_state)
return
. += mutable_appearance(icon, "apcox-[locked]")
@@ -443,9 +443,9 @@
// Handle icon status:
var/new_update_state = NONE
if(stat & BROKEN)
if(machine_stat & BROKEN)
new_update_state |= UPSTATE_BROKE
if(stat & MAINT)
if(machine_stat & MAINT)
new_update_state |= UPSTATE_MAINT
if(opened)
@@ -504,7 +504,7 @@
if(W.use_tool(src, user, 50))
if (has_electronics == APC_ELECTRONICS_INSTALLED)
has_electronics = APC_ELECTRONICS_MISSING
if (stat & BROKEN)
if (machine_stat & BROKEN)
user.visible_message(\
"[user.name] has broken the power control board inside [src.name]!",\
"<span class='notice'>You break the charred power control board and remove the remains.</span>",
@@ -544,8 +544,8 @@
coverlocked = TRUE //closing cover relocks it
update_appearance()
return
else if (!(stat & BROKEN))
if(coverlocked && !(stat & MAINT)) // locked...
else if (!(machine_stat & BROKEN))
if(coverlocked && !(machine_stat & MAINT)) // locked...
to_chat(user, "<span class='warning'>The cover is locked and cannot be opened!</span>")
return
else if (panel_open)
@@ -575,12 +575,12 @@
switch (has_electronics)
if (APC_ELECTRONICS_INSTALLED)
has_electronics = APC_ELECTRONICS_SECURED
stat &= ~MAINT
machine_stat &= ~MAINT
W.play_tool_sound(src)
to_chat(user, "<span class='notice'>You screw the circuit electronics into place.</span>")
if (APC_ELECTRONICS_SECURED)
has_electronics = APC_ELECTRONICS_INSTALLED
set_machine_stat(stat | MAINT)
set_machine_stat(machine_stat | MAINT)
W.play_tool_sound(src)
to_chat(user, "<span class='notice'>You unfasten the electronics.</span>")
else
@@ -611,7 +611,7 @@
"<span class='notice'>You start welding the APC frame...</span>", \
"<span class='italics'>You hear welding.</span>")
if(W.use_tool(src, user, 50, volume=50, amount=3))
if ((stat & BROKEN) || opened==APC_COVER_REMOVED)
if ((machine_stat & BROKEN) || opened==APC_COVER_REMOVED)
new /obj/item/stack/sheet/metal(loc)
user.visible_message(\
"[user.name] has cut [src] apart with [W].",\
@@ -634,7 +634,7 @@
to_chat(user, "<span class='warning'>There is a power cell already installed!</span>")
return
else
if(stat & MAINT)
if(machine_stat & MAINT)
to_chat(user, "<span class='warning'>There is no connector for your power cell!</span>")
return
if(!user.transferItemToLoc(W, src))
@@ -685,7 +685,7 @@
if (has_electronics)
to_chat(user, "<span class='warning'>There is already a board inside the [src]!</span>")
return
else if (stat & BROKEN)
else if (machine_stat & BROKEN)
to_chat(user, "<span class='warning'>You cannot put the board inside, the frame is damaged!</span>")
return
@@ -701,7 +701,7 @@
else if(istype(W, /obj/item/electroadaptive_pseudocircuit) && opened)
var/obj/item/electroadaptive_pseudocircuit/P = W
if(!has_electronics)
if(stat & BROKEN)
if(machine_stat & BROKEN)
to_chat(user, "<span class='warning'>[src]'s frame is too damaged to support a circuit.</span>")
return
if(!P.adapt_circuit(user, 50))
@@ -711,7 +711,7 @@
has_electronics = APC_ELECTRONICS_INSTALLED
locked = FALSE
else if(!cell)
if(stat & MAINT)
if(machine_stat & MAINT)
to_chat(user, "<span class='warning'>There's no connector for a power cell.</span>")
return
if(!P.adapt_circuit(user, 500))
@@ -727,10 +727,10 @@
to_chat(user, "<span class='warning'>[src] has both electronics and a cell.</span>")
return
else if (istype(W, /obj/item/wallframe/apc) && opened)
if (!(stat & BROKEN || opened==APC_COVER_REMOVED || obj_integrity < max_integrity)) // There is nothing to repair
if (!(machine_stat & BROKEN || opened==APC_COVER_REMOVED || obj_integrity < max_integrity)) // There is nothing to repair
to_chat(user, "<span class='warning'>You found no reason for repairing this APC</span>")
return
if (!(stat & BROKEN) && opened==APC_COVER_REMOVED) // Cover is the only thing broken, we do not need to remove elctronicks to replace cover
if (!(machine_stat & BROKEN) && opened==APC_COVER_REMOVED) // Cover is the only thing broken, we do not need to remove elctronicks to replace cover
user.visible_message("[user.name] replaces missing APC's cover.",\
"<span class='notice'>You begin to replace APC's cover...</span>")
if(do_after(user, 20, target = src)) // replacing cover is quicker than replacing whole frame
@@ -747,7 +747,7 @@
if(do_after(user, 50, target = src))
to_chat(user, "<span class='notice'>You replace the damaged APC frame with a new one.</span>")
qdel(W)
stat &= ~BROKEN
machine_stat &= ~BROKEN
obj_integrity = max_integrity
if (opened==APC_COVER_REMOVED)
opened = APC_COVER_OPENED
@@ -787,12 +787,12 @@
/obj/machinery/power/apc/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd)
if(the_rcd.upgrade & RCD_UPGRADE_SIMPLE_CIRCUITS)
if(!has_electronics)
if(stat & BROKEN)
if(machine_stat & BROKEN)
to_chat(user, "<span class='warning'>[src]'s frame is too damaged to support a circuit.</span>")
return FALSE
return list("mode" = RCD_UPGRADE_SIMPLE_CIRCUITS, "delay" = 20, "cost" = 1)
else if(!cell)
if(stat & MAINT)
if(machine_stat & MAINT)
to_chat(user, "<span class='warning'>There's no connector for a power cell.</span>")
return FALSE
return list("mode" = RCD_UPGRADE_SIMPLE_CIRCUITS, "delay" = 50, "cost" = 10) //16 for a wall
@@ -805,7 +805,7 @@
switch(passed_mode)
if(RCD_UPGRADE_SIMPLE_CIRCUITS)
if(!has_electronics)
if(stat & BROKEN)
if(machine_stat & BROKEN)
to_chat(user, "<span class='warning'>[src]'s frame is too damaged to support a circuit.</span>")
return
user.visible_message("<span class='notice'>[user] fabricates a circuit and places it into [src].</span>", \
@@ -814,7 +814,7 @@
locked = TRUE
return TRUE
else if(!cell)
if(stat & MAINT)
if(machine_stat & MAINT)
to_chat(user, span_warning("There's no connector for a power cell."))
return FALSE
var/obj/item/stock_parts/cell/crap/empty/C = new(src)
@@ -844,7 +844,7 @@
to_chat(user, "<span class='warning'>You must close the cover to swipe an ID card!</span>")
else if(panel_open)
to_chat(user, "<span class='warning'>You must close the panel!</span>")
else if(stat & (BROKEN|MAINT))
else if(machine_stat & (BROKEN|MAINT))
to_chat(user, "<span class='warning'>Nothing happens!</span>")
else
if(allowed(usr) && !wires.is_cut(WIRE_IDSCAN) && !malfhack)
@@ -863,7 +863,7 @@
set_nightshift(!nightshift_lights)
/obj/machinery/power/apc/run_obj_armor(damage_amount, damage_type, damage_flag = 0, attack_dir)
if(damage_flag == MELEE && damage_amount < 10 && (!(stat & BROKEN) || malfai))
if(damage_flag == MELEE && damage_amount < 10 && (!(machine_stat & BROKEN) || malfai))
return FALSE
. = ..()
@@ -875,7 +875,7 @@
/obj/machinery/power/apc/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
if(!(stat & BROKEN))
if(!(machine_stat & BROKEN))
set_broken()
if(opened != APC_COVER_REMOVED)
opened = APC_COVER_REMOVED
@@ -891,7 +891,7 @@
to_chat(user, "<span class='warning'>You must close the cover to swipe an ID card!</span>")
else if(panel_open)
to_chat(user, "<span class='warning'>You must close the panel first!</span>")
else if(stat & (BROKEN|MAINT))
else if(machine_stat & (BROKEN|MAINT))
to_chat(user, "<span class='warning'>Nothing happens!</span>")
else
flick("apc-spark", src)
@@ -954,7 +954,7 @@
charging = APC_NOT_CHARGING
src.update_appearance()
return
if((stat & MAINT) && !opened) //no board; no interface
if((machine_stat & MAINT) && !opened) //no board; no interface
return
/obj/machinery/power/apc/ui_interact(mob/user, datum/tgui/ui)
@@ -1090,7 +1090,7 @@
switch(action)
if("lock")
if(area.hasSiliconAccessInArea(usr))
if((obj_flags & EMAGGED) || (stat & (BROKEN|MAINT)))
if((obj_flags & EMAGGED) || (machine_stat & (BROKEN|MAINT)))
to_chat(usr, "<span class='warning'>The APC does not respond to the command!</span>")
else
locked = !locked
@@ -1362,7 +1362,7 @@
/obj/machinery/power/apc/process()
if(icon_update_needed)
update_appearance()
if(stat & (BROKEN|MAINT))
if(machine_stat & (BROKEN|MAINT))
return
if(!area || !area.requires_power)
return