diff --git a/code/__DEFINES/construction.dm b/code/__DEFINES/construction.dm index c394d003d8..c93f1b2435 100644 --- a/code/__DEFINES/construction.dm +++ b/code/__DEFINES/construction.dm @@ -110,4 +110,7 @@ #define RCD_DECONSTRUCT 3 #define RCD_WINDOWGRILLE 4 #define RCD_MACHINE 8 -#define RCD_COMPUTER 16 \ No newline at end of file +#define RCD_COMPUTER 16 + +#define RCD_UPGRADE_FRAMES 1 +#define RCD_UPGRADE_SIMPLE_CIRCUITS 2 \ No newline at end of file diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index dec41b0a59..39b6c8da1d 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -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("[user] fabricates a circuit and places it into [src].", \ + "You adapt a firelock circuit and slot it into the assembly.") + constructionStep = CONSTRUCTION_GUTTED + update_icon() + return TRUE + return FALSE + /obj/structure/firelock_frame/heavy name = "heavy firelock frame" reinforced = TRUE diff --git a/code/game/machinery/firealarm.dm b/code/game/machinery/firealarm.dm index 71f39608b5..51cd9de2d1 100644 --- a/code/game/machinery/firealarm.dm +++ b/code/game/machinery/firealarm.dm @@ -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("[user] fabricates a circuit and places it into [src].", \ + "You adapt a fire alarm circuit and slot it into the assembly.") + 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) . = ..() diff --git a/code/game/objects/items/RCD.dm b/code/game/objects/items/RCD.dm index c21c975f1a..b4f0f1459a 100644 --- a/code/game/objects/items/RCD.dm +++ b/code/game/objects/items/RCD.dm @@ -85,9 +85,11 @@ RLD to_chat(user, "[src] now holds [matter]/[max_matter] matter-units.") else if(istype(W, /obj/item/rcd_upgrade)) to_chat(user, "You upgrade the RCD with the [W]!") - 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 diff --git a/code/modules/atmospherics/machinery/airalarm.dm b/code/modules/atmospherics/machinery/airalarm.dm index cbbfc05f39..e49368016b 100644 --- a/code/modules/atmospherics/machinery/airalarm.dm +++ b/code/modules/atmospherics/machinery/airalarm.dm @@ -822,6 +822,21 @@ return ..() +/obj/machinery/airalarm/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/airalarm/rcd_act(mob/user, obj/item/construction/rcd/the_rcd, passed_mode) + switch(passed_mode) + if(RCD_UPGRADE_SIMPLE_CIRCUITS) + user.visible_message("[user] fabricates a circuit and places it into [src].", \ + "You adapt an air alarm circuit and slot it into the assembly.") + buildstage = 1 + update_icon() + return TRUE + return FALSE + /obj/machinery/airalarm/AltClick(mob/user) . = ..() if(!user.canUseTopic(src, !issilicon(user)) || !isturf(loc)) diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 2652026a11..0ad2983b91 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -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, "[src]'s frame is too damaged to support a circuit.") + return FALSE + return list("mode" = RCD_UPGRADE_SIMPLE_CIRCUITS, "delay" = 20, "cost" = 1) + else if(!cell) + if(stat & MAINT) + to_chat(user, "There's no connector for a power cell.") + return FALSE + return list("mode" = RCD_UPGRADE_SIMPLE_CIRCUITS, "delay" = 50, "cost" = 10) //16 for a wall + else + to_chat(user, "[src] has both electronics and a cell.") + 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, "[src]'s frame is too damaged to support a circuit.") + return + user.visible_message("[user] fabricates a circuit and places it into [src].", \ + "You adapt a power control board and click it into place in [src]'s guts.") + has_electronics = TRUE + locked = TRUE + return TRUE + else if(!cell) + if(stat & MAINT) + to_chat(user, "There's no connector for a power cell.") + return FALSE + var/obj/item/stock_parts/cell/crap/empty/C = new(src) + C.forceMove(src) + cell = C + chargecount = 0 + user.visible_message("[user] fabricates a weak power cell and places it into [src].", \ + "Your [the_rcd.name] whirrs with strain as you create a weak power cell and place it into [src]!") + update_icon() + return TRUE + else + to_chat(user, "[src] has both electronics and a cell.") + return FALSE + return FALSE + /obj/machinery/power/apc/AltClick(mob/user) . = ..() if(!user.canUseTopic(src, !issilicon(user)) || !isturf(loc)) diff --git a/code/modules/research/designs/misc_designs.dm b/code/modules/research/designs/misc_designs.dm index 5f7648b245..eeac6a5818 100644 --- a/code/modules/research/designs/misc_designs.dm +++ b/code/modules/research/designs/misc_designs.dm @@ -379,13 +379,23 @@ ////////////Tools////////////// /////////////////////////////// -/datum/design/rcd_upgrade - name = "Advanced RCD designs upgrade" +/datum/design/rcd_upgrade/frames + name = "RCD frames designs upgrade" desc = "Adds the computer frame and machine frame to the RCD." - id = "rcd_upgrade" + id = "rcd_upgrade_frames" build_type = PROTOLATHE materials = list(MAT_METAL = 5000, MAT_GLASS = 2500, MAT_SILVER = 1500, MAT_TITANIUM = 2000) - build_path = /obj/item/rcd_upgrade + build_path = /obj/item/rcd_upgrade/frames + category = list("Tool Designs") + departmental_flags = DEPARTMENTAL_FLAG_ENGINEERING + +/datum/design/rcd_upgrade/simple_circuits + name = "RCD simple circuits designs upgrade" + desc = "Adds the simple circuits to the RCD." + id = "rcd_upgrade_simple_circuits" + build_type = PROTOLATHE + materials = list(/datum/material/iron = 5000, /datum/material/glass = 2500, /datum/material/silver = 1500, /datum/material/titanium = 2000) + build_path = /obj/item/rcd_upgrade/simple_circuits category = list("Equipment") departmental_flags = DEPARTMENTAL_FLAG_ENGINEERING diff --git a/code/modules/research/techweb/all_nodes.dm b/code/modules/research/techweb/all_nodes.dm index 5f3fc0e85e..ce32c467c9 100644 --- a/code/modules/research/techweb/all_nodes.dm +++ b/code/modules/research/techweb/all_nodes.dm @@ -200,7 +200,7 @@ display_name = "Advanced Engineering" description = "Pushing the boundaries of physics, one chainsaw-fist at a time." prereq_ids = list("engineering", "emp_basic") - design_ids = list("engine_goggles", "magboots", "forcefield_projector", "weldingmask", "tray_goggles_prescription", "engine_goggles_prescription", "mesons_prescription", "rcd_upgrade") + design_ids = list("engine_goggles", "magboots", "forcefield_projector", "weldingmask", "tray_goggles_prescription", "engine_goggles_prescription", "mesons_prescription", "rcd_upgrade_frames", "rcd_upgrade_simple_circuits") research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 4000) export_price = 5000