diff --git a/code/_globalvars/bitfields.dm b/code/_globalvars/bitfields.dm index 3e9f5f0d97a..31fa3219444 100644 --- a/code/_globalvars/bitfields.dm +++ b/code/_globalvars/bitfields.dm @@ -608,3 +608,12 @@ DEFINE_BITFIELD(bot_mode_flags, list( "SAPIENCE_ALLOWED" = BOT_MODE_CAN_BE_SAPIENT, "STARTS_POSSESSABLE" = BOT_MODE_ROUNDSTART_POSSESSION, )) + +DEFINE_BITFIELD(construction_upgrades, list( + "RCD_UPGRADE_FRAMES" = RCD_UPGRADE_FRAMES, + "RCD_UPGRADE_SIMPLE_CIRCUITS" = RCD_UPGRADE_SIMPLE_CIRCUITS, + "RCD_UPGRADE_SILO_LINK" = RCD_UPGRADE_SILO_LINK, + "RCD_UPGRADE_FURNISHING" = RCD_UPGRADE_FURNISHING, + "RCD_UPGRADE_ANTI_INTERRUPT" = RCD_UPGRADE_ANTI_INTERRUPT, + "RCD_UPGRADE_NO_FREQUENT_USE_COOLDOWN" = RCD_UPGRADE_NO_FREQUENT_USE_COOLDOWN, +)) diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index 4b21585de4d..3d73cc42343 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -943,7 +943,7 @@ /obj/structure/firelock_frame/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd) if(the_rcd.mode == RCD_DECONSTRUCT) return list("delay" = 5 SECONDS, "cost" = 16) - else if((constructionStep == CONSTRUCTION_NO_CIRCUIT) && (the_rcd.upgrade & RCD_UPGRADE_SIMPLE_CIRCUITS)) + else if((constructionStep == CONSTRUCTION_NO_CIRCUIT) && (the_rcd.construction_upgrades & RCD_UPGRADE_SIMPLE_CIRCUITS)) return list("delay" = 2 SECONDS, "cost" = 1) return FALSE diff --git a/code/game/machinery/firealarm.dm b/code/game/machinery/firealarm.dm index 4505be8be47..b6ce3641c16 100644 --- a/code/game/machinery/firealarm.dm +++ b/code/game/machinery/firealarm.dm @@ -406,7 +406,7 @@ return ..() /obj/machinery/firealarm/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd) - if((buildstage == FIRE_ALARM_BUILD_NO_CIRCUIT) && (the_rcd.upgrade & RCD_UPGRADE_SIMPLE_CIRCUITS)) + if((buildstage == FIRE_ALARM_BUILD_NO_CIRCUIT) && (the_rcd.construction_upgrades & RCD_UPGRADE_SIMPLE_CIRCUITS)) return list("delay" = 2 SECONDS, "cost" = 1) return FALSE diff --git a/code/game/objects/items/rcd/RCD.dm b/code/game/objects/items/rcd/RCD.dm index 3dab53cb8ff..eb3d8af2e83 100644 --- a/code/game/objects/items/rcd/RCD.dm +++ b/code/game/objects/items/rcd/RCD.dm @@ -75,6 +75,23 @@ GLOB.rcd_list += src AddElement(/datum/element/openspace_item_click_handler) +/obj/item/construction/rcd/examine(mob/user) + . = ..() + if(construction_upgrades) + . += "It has the following upgrades installed:" + if(construction_upgrades & RCD_UPGRADE_FRAMES) + . += /obj/item/rcd_upgrade/frames::name + if(construction_upgrades & RCD_UPGRADE_SIMPLE_CIRCUITS) + . += /obj/item/rcd_upgrade/simple_circuits::name + if(construction_upgrades & RCD_UPGRADE_SILO_LINK) + . += /obj/item/rcd_upgrade/silo_link::name + if(construction_upgrades & RCD_UPGRADE_FURNISHING) + . += /obj/item/rcd_upgrade/furnishing::name + if(construction_upgrades & RCD_UPGRADE_ANTI_INTERRUPT) + . += /obj/item/rcd_upgrade/anti_interrupt::name + if(construction_upgrades & RCD_UPGRADE_NO_FREQUENT_USE_COOLDOWN) + . += /obj/item/rcd_upgrade/cooling::name + /obj/item/construction/rcd/Destroy() QDEL_NULL(airlock_electronics) GLOB.rcd_list -= src @@ -232,7 +249,7 @@ var/delay = rcd_results["delay"] * delay_mod if ( - !(upgrade & RCD_UPGRADE_NO_FREQUENT_USE_COOLDOWN) \ + !(construction_upgrades & RCD_UPGRADE_NO_FREQUENT_USE_COOLDOWN) \ && !rcd_results[RCD_RESULT_BYPASS_FREQUENT_USE_COOLDOWN] \ && current_active_effects > 0 ) @@ -262,7 +279,7 @@ /obj/item/construction/rcd/proc/_rcd_create_effect(atom/target, mob/user, delay, list/rcd_results) PRIVATE_PROC(TRUE) - var/obj/effect/constructing_effect/rcd_effect = new(get_turf(target), delay, rcd_results["[RCD_DESIGN_MODE]"], upgrade) + var/obj/effect/constructing_effect/rcd_effect = new(get_turf(target), delay, rcd_results["[RCD_DESIGN_MODE]"], construction_upgrades) //resource & structure placement sanity checks before & after delay along with beam effects if(!checkResource(rcd_results["cost"], user) || !can_place(target, rcd_results, user)) @@ -327,9 +344,9 @@ continue //skip category if upgrades were not installed for these - if(sub_category == "Machines" && !(upgrade & RCD_UPGRADE_FRAMES)) + if(sub_category == "Machines" && !(construction_upgrades & RCD_UPGRADE_FRAMES)) continue - if(sub_category == "Furniture" && !(upgrade & RCD_UPGRADE_FURNISHING)) + if(sub_category == "Furniture" && !(construction_upgrades & RCD_UPGRADE_FURNISHING)) continue var/list/designs = list() //initialize all designs under this category @@ -383,10 +400,10 @@ * You can ignore an complete category if the design disk upgrade for that category isn't installed. */ //You can't select designs from the Machines category if you don't have the frames upgrade installed. - if(category == "Machines" && !(upgrade & RCD_UPGRADE_FRAMES)) + if(category == "Machines" && !(construction_upgrades & RCD_UPGRADE_FRAMES)) return TRUE //You can't select designs from the Furniture category if you don't have the furnishing upgrade installed. - if(category == "Furniture" && !(upgrade & RCD_UPGRADE_FURNISHING)) + if(category == "Furniture" && !(construction_upgrades & RCD_UPGRADE_FURNISHING)) return TRUE //use UI params to set variables @@ -501,12 +518,12 @@ matter = 160 /obj/item/construction/rcd/loaded/upgraded - upgrade = RCD_ALL_UPGRADES + construction_upgrades = RCD_ALL_UPGRADES /obj/item/construction/rcd/ce name = "professional RCD" desc = "A higher-end model of the rapid construction device, prefitted with improved cooling and disruption prevention. Provided to the chief engineer." - upgrade = RCD_UPGRADE_ANTI_INTERRUPT | RCD_UPGRADE_NO_FREQUENT_USE_COOLDOWN + construction_upgrades = RCD_UPGRADE_ANTI_INTERRUPT | RCD_UPGRADE_NO_FREQUENT_USE_COOLDOWN matter = 160 color = list( 0.3, 0.3, 0.7, 0.0, @@ -523,13 +540,13 @@ max_matter = 500 matter = 500 canRturf = TRUE - upgrade = RCD_ALL_UPGRADES + construction_upgrades = RCD_ALL_UPGRADES /obj/item/construction/rcd/combat/admin name = "admin RCD" max_matter = INFINITY matter = INFINITY - upgrade = RCD_ALL_UPGRADES & ~RCD_UPGRADE_SILO_LINK + construction_upgrades = RCD_ALL_UPGRADES & ~RCD_UPGRADE_SILO_LINK delay_mod = 0.1 // Ranged RCD @@ -544,7 +561,7 @@ icon_state = "arcd" inhand_icon_state = "oldrcd" has_ammobar = FALSE - upgrade = RCD_ALL_UPGRADES & ~RCD_UPGRADE_SILO_LINK + construction_upgrades = RCD_ALL_UPGRADES & ~RCD_UPGRADE_SILO_LINK ///How much charge is used up for each matter unit. #define MASS_TO_ENERGY (0.016 * STANDARD_CELL_CHARGE) diff --git a/code/game/objects/items/rcd/RHD.dm b/code/game/objects/items/rcd/RHD.dm index 8bd90adc8a0..c7cc3bd0520 100644 --- a/code/game/objects/items/rcd/RHD.dm +++ b/code/game/objects/items/rcd/RHD.dm @@ -30,7 +30,7 @@ /// amount of divisions in the ammo indicator overlay/number of ammo indicator states var/ammo_sections = 10 /// bitflags for upgrades - var/upgrade = NONE + var/construction_upgrades = NONE /// bitflags for banned upgrades var/banned_upgrades = NONE /// remote connection to the silo @@ -49,7 +49,7 @@ spark_system = new /datum/effect_system/spark_spread spark_system.set_up(5, 0, src) spark_system.attach(src) - if(upgrade & RCD_UPGRADE_SILO_LINK) + if(construction_upgrades & RCD_UPGRADE_SILO_LINK) silo_mats = AddComponent(/datum/component/remote_materials, mapload, FALSE) update_appearance() @@ -80,7 +80,7 @@ /obj/item/construction/examine(mob/user) . = ..() . += "It currently holds [get_matter(user)]/[max_matter] matter-units." - if(upgrade & RCD_UPGRADE_SILO_LINK) + if(construction_upgrades & RCD_UPGRADE_SILO_LINK) . += "Remote storage link state: [silo_link ? "[silo_mats.on_hold() ? "ON HOLD" : "ON"]" : "OFF"]." var/iron = get_silo_iron() if(iron) @@ -113,13 +113,13 @@ /// Installs an upgrade into the RCD checking if it is already installed, or if it is a banned upgrade /obj/item/construction/proc/install_upgrade(obj/item/rcd_upgrade/design_disk, mob/user) - if(design_disk.upgrade & upgrade) + if(design_disk.upgrade & construction_upgrades) balloon_alert(user, "already installed!") return FALSE if(design_disk.upgrade & banned_upgrades) balloon_alert(user, "cannot install upgrade!") return FALSE - upgrade |= design_disk.upgrade + construction_upgrades |= design_disk.upgrade if((design_disk.upgrade & RCD_UPGRADE_SILO_LINK) && !silo_mats) silo_mats = AddComponent(/datum/component/remote_materials, FALSE, FALSE) playsound(loc, 'sound/machines/click.ogg', 50, TRUE) @@ -209,14 +209,14 @@ /obj/item/construction/ui_static_data(mob/user) . = list() - .["silo_upgraded"] = !!(upgrade & RCD_UPGRADE_SILO_LINK) + .["silo_upgraded"] = !!(construction_upgrades & RCD_UPGRADE_SILO_LINK) ///shared data for rcd,rld & plumbing /obj/item/construction/ui_data(mob/user) var/list/data = list() //matter in the rcd - var/total_matter = ((upgrade & RCD_UPGRADE_SILO_LINK) && silo_link) ? get_silo_iron() : get_matter(user) + var/total_matter = ((construction_upgrades & RCD_UPGRADE_SILO_LINK) && silo_link) ? get_silo_iron() : get_matter(user) if(!total_matter) total_matter = 0 data["matterLeft"] = total_matter @@ -244,7 +244,7 @@ if(.) return - if(action == "toggle_silo" && (upgrade & RCD_UPGRADE_SILO_LINK)) + if(action == "toggle_silo" && (construction_upgrades & RCD_UPGRADE_SILO_LINK)) toggle_silo(ui.user) return TRUE diff --git a/code/game/objects/items/rcd/RLD.dm b/code/game/objects/items/rcd/RLD.dm index 367456f6ec0..3b2c6b1befe 100644 --- a/code/game/objects/items/rcd/RLD.dm +++ b/code/game/objects/items/rcd/RLD.dm @@ -52,7 +52,7 @@ /obj/item/construction/rld/attack_self(mob/user) . = ..() - if((upgrade & RCD_UPGRADE_SILO_LINK) && display_options["Silo Link"] == null) //silo upgrade instaled but option was not updated then update it just one + if((construction_upgrades & RCD_UPGRADE_SILO_LINK) && display_options["Silo Link"] == null) //silo upgrade instaled but option was not updated then update it just one display_options["Silo Link"] = icon(icon = 'icons/obj/machines/ore_silo.dmi', icon_state = "silo") var/choice = show_radial_menu(user, src, display_options, custom_check = CALLBACK(src, PROC_REF(check_menu), user), require_near = TRUE, tooltips = TRUE) diff --git a/code/modules/atmospherics/machinery/air_alarm/air_alarm_interact.dm b/code/modules/atmospherics/machinery/air_alarm/air_alarm_interact.dm index 1d2dbfa3363..7c1ba224ce9 100644 --- a/code/modules/atmospherics/machinery/air_alarm/air_alarm_interact.dm +++ b/code/modules/atmospherics/machinery/air_alarm/air_alarm_interact.dm @@ -46,7 +46,7 @@ /obj/machinery/airalarm/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd) - if((buildstage == AIR_ALARM_BUILD_NO_CIRCUIT) && (the_rcd.upgrade & RCD_UPGRADE_SIMPLE_CIRCUITS)) + if((buildstage == AIR_ALARM_BUILD_NO_CIRCUIT) && (the_rcd.construction_upgrades & RCD_UPGRADE_SIMPLE_CIRCUITS)) return list("delay" = 2 SECONDS, "cost" = 1) return FALSE diff --git a/code/modules/power/apc/apc_tool_act.dm b/code/modules/power/apc/apc_tool_act.dm index 3ff5a89f4aa..71bd3f226d3 100644 --- a/code/modules/power/apc/apc_tool_act.dm +++ b/code/modules/power/apc/apc_tool_act.dm @@ -388,7 +388,7 @@ return TRUE /obj/machinery/power/apc/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd) - if(!(the_rcd.upgrade & RCD_UPGRADE_SIMPLE_CIRCUITS)) + if(!(the_rcd.construction_upgrades & RCD_UPGRADE_SIMPLE_CIRCUITS)) return FALSE if(!has_electronics) @@ -407,7 +407,7 @@ return FALSE /obj/machinery/power/apc/rcd_act(mob/user, obj/item/construction/rcd/the_rcd, list/rcd_data) - if(!(the_rcd.upgrade & RCD_UPGRADE_SIMPLE_CIRCUITS) || rcd_data["[RCD_DESIGN_MODE]"] != RCD_WALLFRAME) + if(!(the_rcd.construction_upgrades & RCD_UPGRADE_SIMPLE_CIRCUITS) || rcd_data["[RCD_DESIGN_MODE]"] != RCD_WALLFRAME) return FALSE if(!has_electronics)