Add simple RCD Circuits
Port : https://github.com/tgstation/tgstation/pull/45357
This commit is contained in:
@@ -450,6 +450,21 @@
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/structure/firelock_frame/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd)
|
||||
if((constructionStep == CONSTRUCTION_NOCIRCUIT) && (the_rcd.upgrade & RCD_UPGRADE_SIMPLE_CIRCUITS))
|
||||
return list("mode" = RCD_UPGRADE_SIMPLE_CIRCUITS, "delay" = 20, "cost" = 1)
|
||||
return FALSE
|
||||
|
||||
/obj/structure/firelock_frame/rcd_act(mob/user, obj/item/construction/rcd/the_rcd, passed_mode)
|
||||
switch(passed_mode)
|
||||
if(RCD_UPGRADE_SIMPLE_CIRCUITS)
|
||||
user.visible_message("<span class='notice'>[user] fabricates a circuit and places it into [src].</span>", \
|
||||
"<span class='notice'>You adapt a firelock circuit and slot it into the assembly.</span>")
|
||||
constructionStep = CONSTRUCTION_GUTTED
|
||||
update_icon()
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/structure/firelock_frame/heavy
|
||||
name = "heavy firelock frame"
|
||||
reinforced = TRUE
|
||||
|
||||
@@ -256,6 +256,20 @@
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/machinery/firealarm/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd)
|
||||
if((buildstage == 0) && (the_rcd.upgrade & RCD_UPGRADE_SIMPLE_CIRCUITS))
|
||||
return list("mode" = RCD_UPGRADE_SIMPLE_CIRCUITS, "delay" = 20, "cost" = 1)
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/firealarm/rcd_act(mob/user, obj/item/construction/rcd/the_rcd, passed_mode)
|
||||
switch(passed_mode)
|
||||
if(RCD_UPGRADE_SIMPLE_CIRCUITS)
|
||||
user.visible_message("<span class='notice'>[user] fabricates a circuit and places it into [src].</span>", \
|
||||
"<span class='notice'>You adapt a fire alarm circuit and slot it into the assembly.</span>")
|
||||
buildstage = 1
|
||||
update_icon()
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/firealarm/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir)
|
||||
. = ..()
|
||||
|
||||
@@ -85,9 +85,11 @@ RLD
|
||||
to_chat(user, "<span class='notice'>[src] now holds [matter]/[max_matter] matter-units.</span>")
|
||||
else if(istype(W, /obj/item/rcd_upgrade))
|
||||
to_chat(user, "<span class='notice'>You upgrade the RCD with the [W]!</span>")
|
||||
upgrade = TRUE
|
||||
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
|
||||
qdel(W)
|
||||
var/obj/item/rcd_upgrade/rcd_up = W
|
||||
if(!(upgrade & rcd_up.upgrade))
|
||||
upgrade |= rcd_up.upgrade
|
||||
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
|
||||
qdel(W)
|
||||
else
|
||||
return ..()
|
||||
update_icon() //ensures that ammo counters (if present) get updated
|
||||
@@ -116,10 +118,10 @@ RLD
|
||||
if(matter < amount)
|
||||
if(user)
|
||||
to_chat(user, no_ammo_message)
|
||||
return 0
|
||||
return FALSE
|
||||
matter -= amount
|
||||
update_icon()
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/obj/item/construction/proc/checkResource(amount, mob/user)
|
||||
. = matter >= amount
|
||||
@@ -471,7 +473,7 @@ RLD
|
||||
"Grilles & Windows" = image(icon = 'icons/mob/radial.dmi', icon_state = "grillewindow"),
|
||||
"Floors & Walls" = image(icon = 'icons/mob/radial.dmi', icon_state = "wallfloor")
|
||||
)
|
||||
if(upgrade)
|
||||
if(upgrade & RCD_UPGRADE_FRAMES)
|
||||
choices += list(
|
||||
"Deconstruct" = image(icon= 'icons/mob/radial.dmi', icon_state = "delete"),
|
||||
"Machine Frames" = image(icon = 'icons/mob/radial.dmi', icon_state = "machine"),
|
||||
@@ -829,9 +831,18 @@ RLD
|
||||
|
||||
/obj/item/rcd_upgrade
|
||||
name = "RCD advanced design disk"
|
||||
desc = "It contains the design for machine frames, computer frames, and deconstruction."
|
||||
desc = "It seems to be empty."
|
||||
icon = 'icons/obj/module.dmi'
|
||||
icon_state = "datadisk3"
|
||||
var/upgrade
|
||||
|
||||
/obj/item/rcd_upgrade/frames
|
||||
desc = "It contains the design for machine frames, computer frames and deconstruction."
|
||||
upgrade = RCD_UPGRADE_FRAMES
|
||||
|
||||
/obj/item/rcd_upgrade/simple_circuits
|
||||
desc = "It contains the design for firelock, air alarm, fire alarm, apc circuits and crap power cells."
|
||||
upgrade = RCD_UPGRADE_SIMPLE_CIRCUITS
|
||||
|
||||
#undef GLOW_MODE
|
||||
#undef LIGHT_MODE
|
||||
|
||||
Reference in New Issue
Block a user