Add simple RCD Circuits
Port : https://github.com/tgstation/tgstation/pull/45357
This commit is contained in:
@@ -701,6 +701,52 @@
|
||||
else
|
||||
return ..()
|
||||
|
||||
/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)
|
||||
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)
|
||||
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
|
||||
else
|
||||
to_chat(user, "<span class='warning'>[src] has both electronics and a cell.</span>")
|
||||
return FALSE
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/power/apc/rcd_act(mob/user, obj/item/construction/rcd/the_rcd, passed_mode)
|
||||
switch(passed_mode)
|
||||
if(RCD_UPGRADE_SIMPLE_CIRCUITS)
|
||||
if(!has_electronics)
|
||||
if(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>", \
|
||||
"<span class='notice'>You adapt a power control board and click it into place in [src]'s guts.</span>")
|
||||
has_electronics = TRUE
|
||||
locked = TRUE
|
||||
return TRUE
|
||||
else if(!cell)
|
||||
if(stat & MAINT)
|
||||
to_chat(user, "<span class='warning'>There's no connector for a power cell.</span>")
|
||||
return FALSE
|
||||
var/obj/item/stock_parts/cell/crap/empty/C = new(src)
|
||||
C.forceMove(src)
|
||||
cell = C
|
||||
chargecount = 0
|
||||
user.visible_message("<span class='notice'>[user] fabricates a weak power cell and places it into [src].</span>", \
|
||||
"<span class='warning'>Your [the_rcd.name] whirrs with strain as you create a weak power cell and place it into [src]!</span>")
|
||||
update_icon()
|
||||
return TRUE
|
||||
else
|
||||
to_chat(user, "<span class='warning'>[src] has both electronics and a cell.</span>")
|
||||
return FALSE
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/power/apc/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(!user.canUseTopic(src, !issilicon(user)) || !isturf(loc))
|
||||
|
||||
Reference in New Issue
Block a user