diff --git a/code/game/atom/_atom.dm b/code/game/atom/_atom.dm index c9e4dae3435..c40ccd7ae0c 100644 --- a/code/game/atom/_atom.dm +++ b/code/game/atom/_atom.dm @@ -53,10 +53,19 @@ var/gfi_layer_rotation = GFI_ROTATION_DEFAULT - // Extra descriptions. - var/desc_extended = null // Regular text about the atom's extended description, if any exists. - var/desc_info = null // Blue text (SPAN_NOTICE()), informing the user about how to use the item or about game controls. - var/desc_antag = null // Red text (SPAN_ALERT()), informing the user about how they can use an object to antagonize. + /// Extra Descriptions + /// Regular text about the atom's extended description, if any exists. + var/desc_extended = null + /// Blue text (SPAN_NOTICE()), informing the user about how to use the item or about game controls. + var/desc_info = null + /// Blue text (SPAN_NOTICE()), informing the user about how to assemble or disassemble the item. + var/desc_build = null + /// Blue text (SPAN_NOTICE()), informing the user about what upgrades the item has and what they do. + /// Format desc_upgrade = "This object/item/machine/structure/etc has the following upgrades available:" + /// Currently only supports machines, see "code\game\machinery\machinery.dm" for example. + var/desc_upgrade = null + /// Red text (SPAN_ALERT()), informing the user about how they can use an object to antagonize. + var/desc_antag = null /* SSicon_update VARS */ diff --git a/code/game/atom/atom_examine.dm b/code/game/atom/atom_examine.dm index 29e323a66f5..a41a8fc7651 100644 --- a/code/game/atom/atom_examine.dm +++ b/code/game/atom/atom_examine.dm @@ -63,18 +63,33 @@ else f_name += "oil-stained [name][infix]." - . += "[icon2html(src, user)] That's [f_name] [suffix]" // Object name. I.e. "This is an Object. It is a normal-sized item." + // Object name. I.e. "This is an Object. It is a normal-sized item." + . += "[icon2html(src, user)] That's [f_name] [suffix]" if(src.desc) . += src.desc // Object description. // Extra object descriptions examination code. if(show_extended) - if(desc_extended) // If the item has a extended description, show it. + // If the item has a extended description, show it. + if(desc_extended) . += desc_extended - if(desc_info) // If the item has a description regarding game mechanics, show it. + // If the item has a description regarding game mechanics, show it. + if(desc_info) + . += FONT_SMALL(SPAN_NOTICE("Mechanics")) . += FONT_SMALL(SPAN_NOTICE("- [desc_info]")) - if(desc_antag && player_is_antag(user.mind)) // If the item has an antagonist description and the user is an antagonist, show it. + // If the item has a description with assembly/disassembly instructions, show it. + if(desc_build) + . += FONT_SMALL(SPAN_NOTICE("Assembly/Disassembly")) + . += FONT_SMALL(SPAN_NOTICE("- [desc_build]")) + // If the item has a description about its upgrade components and what they do, show it. + // This one doesnt come prepended with a hyphen because theyre added when the desc is dynamically built. + if(desc_upgrade) + . += FONT_SMALL(SPAN_NOTICE("Upgrades")) + . += FONT_SMALL(SPAN_NOTICE("[desc_upgrade]")) + // If the item has an antagonist description and the user is an antagonist/ghost, show it. + if(desc_antag && (player_is_antag(user.mind) || isghost(user) || isstoryteller(user))) + . += FONT_SMALL(SPAN_ALERT("Antagonism")) . += FONT_SMALL(SPAN_ALERT("- [desc_antag]")) else if(desc_extended || desc_info || (desc_antag && player_is_antag(user.mind))) // Checks if the object has a extended description, a mechanics description, and/or an antagonist description (and if the user is an antagonist). diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm index 9a172195153..e0d67b351d3 100644 --- a/code/game/machinery/Sleeper.dm +++ b/code/game/machinery/Sleeper.dm @@ -38,7 +38,6 @@ idle_power_usage = 15 active_power_usage = 250 //builtin health analyzer, dialysis machine, injectors. - var/parts_power_usage var/stasis_power = 500 component_types = list( @@ -49,6 +48,11 @@ /obj/item/reagent_containers/glass/beaker/large ) + component_hint_cap = "Upgraded capacitors will reduce power usage." + component_hint_scan = "Upgraded scanning modules will reduce power usage." + + parts_power_mgmt = FALSE + /obj/machinery/sleeper/Initialize() . = ..() update_icon() diff --git a/code/game/machinery/autolathe/autolathe.dm b/code/game/machinery/autolathe/autolathe.dm index 6b5baf4e1c8..879e79035c1 100644 --- a/code/game/machinery/autolathe/autolathe.dm +++ b/code/game/machinery/autolathe/autolathe.dm @@ -43,6 +43,9 @@ /obj/item/stock_parts/console_screen ) + component_hint_bin = "Upgraded matter bins will increase material storage capacity." + component_hint_servo = "Upgraded manipulators will improve material use efficiency and increase fabrication speed." + /obj/machinery/autolathe/Initialize() ..() wires = new(src) diff --git a/code/game/machinery/biogenerator.dm b/code/game/machinery/biogenerator.dm index e3f899152e3..cd97428c1e8 100644 --- a/code/game/machinery/biogenerator.dm +++ b/code/game/machinery/biogenerator.dm @@ -14,6 +14,10 @@ var/eat_eff = 1 var/capacity = 100 + component_hint_servo = "Upgraded manipulators will increase the nutrients provided by new inputs." + component_hint_bin = "Upgraded matter bins will decrease the conversion cost of bio-goods." + + component_types = list( /obj/item/circuitboard/biogenerator, /obj/item/stock_parts/matter_bin, diff --git a/code/game/machinery/chem_heater.dm b/code/game/machinery/chem_heater.dm index 9394dcf573c..35b54e19675 100644 --- a/code/game/machinery/chem_heater.dm +++ b/code/game/machinery/chem_heater.dm @@ -18,6 +18,7 @@ var/min_temperature = 100 var/max_temperature = 600 var/slow_mode = FALSE + component_hint_servo = "Upgraded servos increase the speed at which vessel contents are heated." component_types = list( /obj/item/circuitboard/chem_heater, diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm index 8bc84208e3b..d13abd1d03d 100644 --- a/code/game/machinery/cryo.dm +++ b/code/game/machinery/cryo.dm @@ -54,6 +54,8 @@ var/slow_stasis_mult = 1.7 var/current_stasis_mult = 1 + component_hint_servo = "Upgraded manipulators will increase effectiveness of both hyper-metabolism and cryostasis functions." + /obj/machinery/atmospherics/unary/cryo_cell/Initialize() . = ..() update_icon() diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm index 58e91c9c29f..26b25d64969 100644 --- a/code/game/machinery/iv_drip.dm +++ b/code/game/machinery/iv_drip.dm @@ -2,8 +2,8 @@ name = "\improper IV drip" desc = "A professional standard intravenous stand with supplemental gas support for medical use." desc_info = "IV drips can be supplied beakers/bloodpacks for reagent transfusions, as well as one breath mask and gas tank for supplemental gas therapy. \ - It can be upgraded.
Click and Drag to attach/detach the IV or secure/remove the breath mask on your target.
Click the stand with an empty hand to \ - toggle between various modes. Using a wrench when it has a tank installed will secure it.
Alt Click the stand to remove items contained in the stand." +
- Click and Drag to attach/detach the IV or secure/remove the breath mask on your target.
- Click the stand with an empty hand to \ + toggle between various modes. Using a wrench when it has a tank installed will secure it.
- Alt Click the stand to remove items contained in the stand." icon = 'icons/obj/iv_drip.dmi' icon_state = "iv_stand" anchored = 0 @@ -60,6 +60,9 @@ /obj/item/stock_parts/manipulator, /obj/item/stock_parts/scanning_module) + component_hint_scan = "Upgraded scanning modules will provide the exact volume and composition of attached beakers." + component_hint_servo = "Upgraded manipulators will allow patients to be hooked to IV through armor and increase the maximum reagent transfer rate." + /obj/machinery/iv_drip/Initialize(mapload) . = ..() @@ -696,7 +699,7 @@ . = ..() if(distance > 2) return - . += SPAN_NOTICE("[src] is [mode ? "injecting" : "taking blood"] at a rate of [src.transfer_amount] u/sec, the automatic injection stop mode is [toggle_stop ? "on" : "off"]. The Emergency Positive Pressure \ + . += SPAN_NOTICE("
[src] is [mode ? "injecting" : "taking blood"] at a rate of [src.transfer_amount] u/sec, the automatic injection stop mode is [toggle_stop ? "on" : "off"]. The Emergency Positive Pressure \ system is [epp ? "on" : "off"].") if(attached) . += SPAN_NOTICE("\The [src] is attached to [attached]'s [vein.name].") diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index b9bff46b596..ab242cb8d45 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -68,7 +68,7 @@ Class Procs: contained in the component_parts list. (example: glass and material amounts for the autolathe) - Default definition does nothing. + Default definition handles power usage only (all parts contribute based on energy_rating). assign_uid() 'game/machinery/machine.dm' Called by machine to assign a value to the uid variable. @@ -121,6 +121,18 @@ Class Procs: var/list/component_types /// List of all the parts used to build it, if made from certain kinds of frames. var/list/component_parts = null + /// Use the generic power rating mechanics for parts, or bespoke. + var/parts_power_mgmt = TRUE + /// The total power rating of all parts serves as a power usage multiplier. + var/parts_power_usage = 0 + /// Blurbs for what each component type does. Appended to machine's /desc_info. + /// Kindly use the format in appended comments for consistency + var/component_hint_bin // "Upgraded matter bins will XYZ." + var/component_hint_cap // "Upgraded capacitors will XYZ." + var/component_hint_laser // "Upgraded micro-lasers will XYZ" + var/component_hint_scan // "Upgraded scanning modules will XYZ" + var/component_hint_servo // "Upgraded manipulators will XYZ" + var/uid var/panel_open = 0 var/global/gl_uid = 1 @@ -361,6 +373,23 @@ Class Procs: return S /obj/machinery/proc/RefreshParts() + if(parts_power_mgmt) + var/new_idle_power + var/new_active_power + + if(!component_parts || !component_parts.len) + return + var/parts_energy_rating = 0 + + for(var/obj/item/stock_parts/part in component_parts) + parts_energy_rating += part.energy_rating() + + new_idle_power = initial(idle_power_usage) * (1 + parts_energy_rating) + new_active_power = initial(active_power_usage) * (1 + parts_energy_rating) + + change_power_consumption(new_idle_power) + change_power_consumption(new_active_power, POWER_USE_ACTIVE) + GetPartUpgradeDesc() /obj/machinery/proc/assign_uid() uid = gl_uid @@ -425,56 +454,82 @@ Class Procs: return TRUE /obj/machinery/proc/default_part_replacement(var/mob/user, var/obj/item/storage/part_replacer/R) - if(!istype(R)) - return FALSE if(!LAZYLEN(component_parts)) return FALSE - var/parts_replaced = FALSE - if(panel_open) - var/obj/item/circuitboard/CB = locate(/obj/item/circuitboard) in component_parts - var/P - for(var/obj/item/reagent_containers/glass/G in component_parts) - for(var/D in CB.req_components) - var/T = text2path(D) - if(ispath(G.type, T)) - P = T - break - for(var/obj/item/reagent_containers/glass/B in R.contents) - if(B.reagents && B.reagents.total_volume > 0) continue - if(istype(B, P) && istype(G, P)) - if(B.volume > G.volume) - R.remove_from_storage(B, src) - R.handle_item_insertion(G, 1) - component_parts -= G - component_parts += B - B.forceMove(src) - to_chat(user, SPAN_NOTICE("[G.name] replaced with [B.name].")) + else if(istype(R)) + var/parts_replaced = FALSE + if(panel_open) + var/obj/item/circuitboard/CB = locate(/obj/item/circuitboard) in component_parts + var/P + for(var/obj/item/reagent_containers/glass/G in component_parts) + for(var/D in CB.req_components) + var/T = text2path(D) + if(ispath(G.type, T)) + P = T break - for(var/obj/item/stock_parts/A in component_parts) - for(var/D in CB.req_components) - var/T = text2path(D) - if(ispath(A.type, T)) - P = T - break - for(var/obj/item/stock_parts/B in R.contents) - if(istype(B, P) && istype(A, P)) - if(B.rating > A.rating) - R.remove_from_storage(B, src) - R.handle_item_insertion(A, 1) - component_parts -= A - component_parts += B - B.forceMove(src) - to_chat(user, SPAN_NOTICE("[A.name] replaced with [B.name].")) - parts_replaced = TRUE + for(var/obj/item/reagent_containers/glass/B in R.contents) + if(B.reagents && B.reagents.total_volume > 0) continue + if(istype(B, P) && istype(G, P)) + if(B.volume > G.volume) + R.remove_from_storage(B, src) + R.handle_item_insertion(G, 1) + component_parts -= G + component_parts += B + B.forceMove(src) + to_chat(user, SPAN_NOTICE("[G.name] replaced with [B.name].")) + break + for(var/obj/item/stock_parts/A in component_parts) + for(var/D in CB.req_components) + var/T = text2path(D) + if(ispath(A.type, T)) + P = T break - RefreshParts() - update_icon() - else - to_chat(user, SPAN_NOTICE("The following parts have been detected in \the [src]:")) - to_chat(user, counting_english_list(component_parts)) - if(parts_replaced) //only play sound when RPED actually replaces parts - playsound(src, 'sound/items/rped.ogg', 40, TRUE) - return 1 + for(var/obj/item/stock_parts/B in R.contents) + if(istype(B, P) && istype(A, P)) + if(B.rating > A.rating) + R.remove_from_storage(B, src) + R.handle_item_insertion(A, 1) + component_parts -= A + component_parts += B + B.forceMove(src) + to_chat(user, SPAN_NOTICE("[A.name] replaced with [B.name].")) + parts_replaced = TRUE + break + RefreshParts() + update_icon() + if(parts_replaced) //only play sound when RPED actually replaces parts + playsound(src, 'sound/items/rped.ogg', 40, TRUE) + return TRUE + else return FALSE + +/obj/machinery/proc/GetPartUpgradeDesc() + var/temp_desc_upgrade = initial(desc_upgrade) + // This is ugly code but it does get rid of even uglier double-line breaks in game. + var/first_line = TRUE + if(component_hint_cap) + temp_desc_upgrade += "- [component_hint_cap]" + first_line = FALSE + if(component_hint_scan) + if(!first_line) + temp_desc_upgrade += "
" + temp_desc_upgrade += "- [component_hint_scan]" + first_line = FALSE + if(component_hint_servo) + if(!first_line) + temp_desc_upgrade += "
" + temp_desc_upgrade += "- [component_hint_servo]" + first_line = FALSE + if(component_hint_laser) + if(!first_line) + temp_desc_upgrade += "
" + temp_desc_upgrade += "- [component_hint_laser]" + first_line = FALSE + if(component_hint_bin) + if(!first_line) + temp_desc_upgrade += "
" + temp_desc_upgrade += "- [component_hint_bin]" + first_line = FALSE + desc_upgrade = temp_desc_upgrade /obj/machinery/proc/dismantle() playsound(loc, /singleton/sound_category/crowbar_sound, 50, 1) diff --git a/code/game/machinery/mech_recharger.dm b/code/game/machinery/mech_recharger.dm index 2d51e05d86b..c7ec8a98d7c 100644 --- a/code/game/machinery/mech_recharger.dm +++ b/code/game/machinery/mech_recharger.dm @@ -22,6 +22,10 @@ /obj/item/stock_parts/manipulator = 2 ) + component_hint_cap = "Upgraded capacitors will increase charging rate." + component_hint_scan = "Upgraded scanning modules will increase both charging rate and repair speed." + component_hint_servo = "Upgraded manipulators will increase repair speed." + /obj/machinery/mech_recharger/Initialize(mapload) . = ..() diff --git a/code/game/machinery/mecha_fabricator.dm b/code/game/machinery/mecha_fabricator.dm index 2cbd385f545..ecbd4563cc8 100644 --- a/code/game/machinery/mecha_fabricator.dm +++ b/code/game/machinery/mecha_fabricator.dm @@ -44,6 +44,10 @@ ///The timer id for the build callback, if we're building something var/build_callback_timer + component_hint_bin = "Upgraded matter bins will increase material storage capacity." + component_hint_laser = "Upgraded micro-lasers will increase fabrication speed." + component_hint_servo = "Upgraded manipulators will improve material use efficiency." + /obj/machinery/mecha_part_fabricator/Initialize() . = ..() @@ -73,6 +77,7 @@ ..() /obj/machinery/mecha_part_fabricator/RefreshParts() + ..() res_max_amount = 0 for(var/obj/item/stock_parts/matter_bin/M in component_parts) diff --git a/code/game/machinery/rechargestation.dm b/code/game/machinery/rechargestation.dm index 1ff3dc26cd6..2587f1b4df4 100644 --- a/code/game/machinery/rechargestation.dm +++ b/code/game/machinery/rechargestation.dm @@ -45,6 +45,9 @@ /obj/item/stack/cable_coil{amount = 5} ) + component_hint_cap = "Upgraded capacitors will increase charging rate (for shipbounds only, not IPCs)." + component_hint_servo = "Upgraded manipulators will make the recharging station also start to repair brute damage, then also burn damage, at increasing speed (for shipbounds only, not IPCs)." + /obj/machinery/recharge_station/Initialize() . = ..() update_icon() @@ -133,8 +136,14 @@ D.master_matrix.apply_upgrades(D) /obj/machinery/recharge_station/get_examine_text(mob/user, distance, is_adjacent, infix, suffix) + desc = initial(desc) + desc += "
Uses a dedicated internal power cell to deliver [charging_power]W when in use." + desc += "
The charge meter reads: [round(chargepercentage())]%." + if(weld_rate) + desc += "
It is capable of repairing shipbounds' structural damage." + if(wire_rate) + desc += "
It is capable of repairing shipbounds' burn damage." . = ..() - . += "The charge meter reads: [round(chargepercentage())]%." /obj/machinery/recharge_station/proc/chargepercentage() if(!cell) @@ -182,6 +191,7 @@ /obj/machinery/recharge_station/RefreshParts() ..() + var/man_rating = 0 var/cap_rating = 0 @@ -199,13 +209,6 @@ weld_rate = max(0, man_rating - 3) wire_rate = max(0, man_rating - 5) - desc = initial(desc) - desc += " Uses a dedicated internal power cell to deliver [charging_power]W when in use." - if(weld_rate) - desc += "
It is capable of repairing stationbounds' structural damage." - if(wire_rate) - desc += "
It is capable of repairing stationbounds' burn damage." - /obj/machinery/recharge_station/proc/build_overlays() ClearOverlays() switch(round(chargepercentage())) diff --git a/code/game/machinery/stasis_cage.dm b/code/game/machinery/stasis_cage.dm index 6566432ff7a..681a8b90b25 100644 --- a/code/game/machinery/stasis_cage.dm +++ b/code/game/machinery/stasis_cage.dm @@ -36,6 +36,10 @@ */ var/obj/item/cell/cell = null + component_hint_cap = "Upgraded capacitors will reduce power usage." + + parts_power_mgmt = FALSE + /obj/machinery/stasis_cage/Initialize() . = ..() diff --git a/code/game/objects/items/devices/debugger.dm b/code/game/objects/items/devices/debugger.dm index 71d989ad872..7dbbeb7d9a4 100644 --- a/code/game/objects/items/devices/debugger.dm +++ b/code/game/objects/items/devices/debugger.dm @@ -1,7 +1,8 @@ // Used to resolve throwing vendors without going directly into wiring. /obj/item/device/debugger name = "debugger" - desc = "Used to debug electronic equipment." + desc = "Used to debug electronic equipment, debuggers come with a retractable data cable that can be plugged into most machines." + desc_info = "The debugger can be used on vending machines to identify and resolve any viral infections, or on upgradeable machinery to identify the component parts it contains." icon = 'icons/obj/hacktool.dmi' icon_state = "hacktool-g" obj_flags = OBJ_FLAG_CONDUCTABLE diff --git a/code/modules/atmospherics/components/unary/cold_sink.dm b/code/modules/atmospherics/components/unary/cold_sink.dm index e8d19eeeadb..af12ad3482f 100644 --- a/code/modules/atmospherics/components/unary/cold_sink.dm +++ b/code/modules/atmospherics/components/unary/cold_sink.dm @@ -31,6 +31,12 @@ /obj/item/stack/cable_coil{amount = 2} ) + component_hint_bin = "Upgraded matter bins will improve cooling efficiency and increase the volume of air it can cool at once." + component_hint_cap = "Upgraded capacitors will increase maximum power setting." + component_hint_servo = "Upgraded manipulators will improve cooling efficiency." + + parts_power_mgmt = FALSE + /obj/machinery/atmospherics/unary/freezer/Initialize() initialize_directions = dir . = ..() diff --git a/code/modules/atmospherics/components/unary/heat_source.dm b/code/modules/atmospherics/components/unary/heat_source.dm index 7867696fd37..6b324daa15d 100644 --- a/code/modules/atmospherics/components/unary/heat_source.dm +++ b/code/modules/atmospherics/components/unary/heat_source.dm @@ -30,6 +30,9 @@ /obj/item/stack/cable_coil{amount = 5} ) + component_hint_bin = "Upgraded matter bins will increase maximum temperature setting and the volume of air it can heat at once." + component_hint_cap = "Upgraded capacitors will increase maximum power setting and maximum temperature setting." + /obj/machinery/atmospherics/unary/heater/Initialize() initialize_directions = dir . = ..() diff --git a/code/modules/cooking/machinery/cooking_machines/_appliance.dm b/code/modules/cooking/machinery/cooking_machines/_appliance.dm index b3d7e7c6d69..64ecc3fa469 100644 --- a/code/modules/cooking/machinery/cooking_machines/_appliance.dm +++ b/code/modules/cooking/machinery/cooking_machines/_appliance.dm @@ -27,6 +27,8 @@ /obj/item/stock_parts/scanning_module = 1, /obj/item/stock_parts/matter_bin = 2) + parts_power_mgmt = FALSE + var/cooking_power = 0 // Effectiveness/speed at cooking var/cooking_coeff = 0 // Part-based cooking power multiplier var/heating_power = 1000 // Effectiveness at heating up; not used for mixers, should be equal to active_power_usage @@ -53,6 +55,9 @@ var/place_verb = "into" var/combine_first = FALSE//If 1, this appliance will do combination cooking before checking recipes + component_hint_cap = "Upgraded capacitors will increase heating power." + component_hint_scan = "Upgraded scanning modules will increase heating power and improve power efficiency." + /obj/machinery/appliance/Initialize() . = ..() if(length(output_options)) diff --git a/code/modules/mining/drilling/drill.dm b/code/modules/mining/drilling/drill.dm index 12bf7f2f737..a26368a64f5 100644 --- a/code/modules/mining/drilling/drill.dm +++ b/code/modules/mining/drilling/drill.dm @@ -58,6 +58,12 @@ /obj/item/cell/high ) + component_hint_bin = "Upgraded matter bins will increase ore capacity." + component_hint_cap = "Upgraded capacitors will improve power efficiency." + component_hint_laser = "Upgraded micro-lasers will increase the amount of ore harvested." + + parts_power_mgmt = FALSE + /// The list of ores currently held within the mining drill var/list/stored_ores = list() diff --git a/code/modules/mining/machine_processing.dm b/code/modules/mining/machine_processing.dm index 2f850e9a4e6..52c1c5b93e2 100644 --- a/code/modules/mining/machine_processing.dm +++ b/code/modules/mining/machine_processing.dm @@ -36,6 +36,10 @@ /obj/item/stock_parts/console_screen ) + component_hint_cap = "Upgraded capacitors will increase the amount of ore smelted per second." + component_hint_laser = "Upgraded micro-lasers will increase the amount of ore smelted per second." + component_hint_scan = "Upgraded scanning modules will increase the amount of ore smelted per second." + /obj/machinery/mineral/processing_unit_console/Initialize(mapload, d, populate_components) . = ..() var/mutable_appearance/screen_overlay = mutable_appearance(icon, "production_console-screen", plane = EFFECTS_ABOVE_LIGHTING_PLANE) diff --git a/code/modules/mob/living/carbon/slime/slime_extractor.dm b/code/modules/mob/living/carbon/slime/slime_extractor.dm index 22224576dc5..661779850ca 100644 --- a/code/modules/mob/living/carbon/slime/slime_extractor.dm +++ b/code/modules/mob/living/carbon/slime/slime_extractor.dm @@ -19,6 +19,9 @@ /obj/item/stack/cable_coil{amount = 5} ) + component_hint_bin = "Upgraded matter bins will increase slime capacity." + component_hint_laser = "Upgraded micro-lasers will increase extraction speed." + /obj/machinery/slime_extractor/get_examine_text(mob/user, distance, is_adjacent, infix, suffix) . = ..() . += FONT_SMALL(SPAN_NOTICE("It can hold [slime_limit] slime\s at a time.")) diff --git a/code/modules/power/batteryrack.dm b/code/modules/power/batteryrack.dm index 66079c8adbd..b0473aa95d0 100644 --- a/code/modules/power/batteryrack.dm +++ b/code/modules/power/batteryrack.dm @@ -17,7 +17,10 @@ /obj/item/cell/high = 3 ) + parts_power_mgmt = FALSE + /obj/machinery/power/smes/batteryrack/RefreshParts() + ..() capacitors_amount = 0 cells_amount = 0 diff --git a/code/modules/power/crystal_agitator.dm b/code/modules/power/crystal_agitator.dm index 7039b1a44bf..0637f584256 100644 --- a/code/modules/power/crystal_agitator.dm +++ b/code/modules/power/crystal_agitator.dm @@ -26,6 +26,11 @@ /obj/item/circuitboard/crystal_agitator ) + component_hint_cap = "Upgraded capacitors will reduce active power usage." + component_hint_servo = "Upgraded manipulators will increase agitation speed." + + parts_power_mgmt = FALSE + /obj/machinery/power/crystal_agitator/Initialize() . = ..() connect_to_network() @@ -87,6 +92,7 @@ last_agitation = world.time /obj/machinery/power/crystal_agitator/RefreshParts() + ..() for(var/obj/item/stock_parts/SP in component_parts) if(ismanipulator(SP)) agitation_rate = initial(agitation_rate) - (SP.rating * 5) diff --git a/code/modules/power/outlet.dm b/code/modules/power/outlet.dm index 30e74403d2b..a6efd406ea5 100644 --- a/code/modules/power/outlet.dm +++ b/code/modules/power/outlet.dm @@ -17,6 +17,10 @@ /obj/item/circuitboard/outlet ) + component_hint_cap = "Upgraded capacitors will increase the rate at which connected devices charge." + + parts_power_mgmt = FALSE + /obj/machinery/power/outlet/Initialize() . = ..() connect_to_network() @@ -25,6 +29,7 @@ icon_state = panel_open ? "[initial(icon_state)]-open" : initial(icon_state) /obj/machinery/power/outlet/RefreshParts() + ..() var/part_level = 0 for(var/obj/item/stock_parts/SP in component_parts) part_level += SP.rating diff --git a/code/modules/power/portgen.dm b/code/modules/power/portgen.dm index 944fb339359..78327ae24f8 100644 --- a/code/modules/power/portgen.dm +++ b/code/modules/power/portgen.dm @@ -15,6 +15,8 @@ var/portgen_lightcolour = "#000000" var/datum/looping_sound/generator/soundloop + component_hint_cap = "Upgraded capacitors will increase maximum power output." + /obj/machinery/power/portgen/Initialize() . = ..() soundloop = new(src, active) @@ -137,6 +139,8 @@ /obj/item/stock_parts/capacitor ) + parts_power_mgmt = FALSE + /obj/machinery/power/portgen/basic/Initialize() component_types += board_path . = ..() @@ -149,6 +153,7 @@ return ..() /obj/machinery/power/portgen/basic/RefreshParts() + ..() var/temp_rating = 0 for(var/obj/item/stock_parts/SP in component_parts) diff --git a/code/modules/power/rtg.dm b/code/modules/power/rtg.dm index 3d71bde12b3..1c5d5be41da 100644 --- a/code/modules/power/rtg.dm +++ b/code/modules/power/rtg.dm @@ -26,6 +26,10 @@ /obj/item/circuitboard/rtg ) + component_hint_cap = "Upgraded capacitors will increase maximum power output." + + parts_power_mgmt = FALSE + /obj/machinery/power/rtg/Initialize() . = ..() connect_to_network() @@ -41,6 +45,7 @@ icon_state = panel_open ? "[initial(icon_state)]-open" : initial(icon_state) /obj/machinery/power/rtg/RefreshParts() + ..() var/part_level = 0 for(var/obj/item/stock_parts/SP in component_parts) part_level += SP.rating diff --git a/code/modules/research/circuitprinter.dm b/code/modules/research/circuitprinter.dm index 60f3a8c0afb..cbce02fb55e 100644 --- a/code/modules/research/circuitprinter.dm +++ b/code/modules/research/circuitprinter.dm @@ -44,7 +44,11 @@ using metal and glass, it uses glass and reagents (usually sulphuric acid). ///The timer id for the build callback, if we're building something var/build_callback_timer + component_hint_bin = "Upgraded matter bins will increase material storage capacity." + component_hint_servo = "Upgraded manipulators will improve material use efficiency and increase fabrication speed." + /obj/machinery/r_n_d/circuit_imprinter/RefreshParts() + ..() // Adjust reagent container volume to match combined volume of the inserted beakers var/T = 0 for(var/obj/item/reagent_containers/glass/G in component_parts) diff --git a/code/modules/research/destructive_analyzer.dm b/code/modules/research/destructive_analyzer.dm index 084ba1b200a..ccdc978a086 100644 --- a/code/modules/research/destructive_analyzer.dm +++ b/code/modules/research/destructive_analyzer.dm @@ -23,7 +23,12 @@ Note: Must be placed within 3 tiles of the R&D Console /obj/item/stock_parts/micro_laser ) + component_hint_laser = "Upgraded micro-lasers will increase data gathered from destructive analysis." + component_hint_scan = "Upgraded scanning modules will increase data gathered from destructive analysis." + component_hint_servo = "Upgraded manipulators will increase data gathered from destructive analysis." + /obj/machinery/r_n_d/destructive_analyzer/RefreshParts() + ..() var/T = 0 for(var/obj/item/stock_parts/S in component_parts) diff --git a/code/modules/research/protolathe.dm b/code/modules/research/protolathe.dm index 9b7d9b53525..3b5c4603548 100644 --- a/code/modules/research/protolathe.dm +++ b/code/modules/research/protolathe.dm @@ -35,6 +35,9 @@ /obj/item/reagent_containers/glass/beaker = 2 ) + component_hint_bin = "Upgraded matter bins will increase material storage capacity." + component_hint_servo = "Upgraded manipulators will improve material use efficiency and increase fabrication speed." + ///Returns the total of all the stored materials /obj/machinery/r_n_d/protolathe/proc/TotalMaterials() var/t = 0 @@ -43,6 +46,7 @@ return t /obj/machinery/r_n_d/protolathe/RefreshParts() + ..() // Adjust reagent container volume to match combined volume of the inserted beakers var/T = 0 for(var/obj/item/reagent_containers/glass/G in component_parts) diff --git a/code/modules/research/server.dm b/code/modules/research/server.dm index a173d3dbe77..0822202f515 100644 --- a/code/modules/research/server.dm +++ b/code/modules/research/server.dm @@ -22,6 +22,10 @@ /obj/item/stack/cable_coil = 2 ) + component_hint_scan = "Upgraded scanning modules will reduce active power usage." + + parts_power_mgmt = FALSE + /obj/machinery/r_n_d/server/Destroy() for(var/obj/machinery/r_n_d/tech_processor/TP as anything in linked_processors) TP.set_server(null) @@ -29,6 +33,7 @@ return ..() /obj/machinery/r_n_d/server/RefreshParts() + ..() var/tot_rating = 0 for(var/obj/item/stock_parts/SP in component_parts) diff --git a/code/modules/research/stockparts.dm b/code/modules/research/stockparts.dm index 514d199029e..5fb38e5fd62 100644 --- a/code/modules/research/stockparts.dm +++ b/code/modules/research/stockparts.dm @@ -2,6 +2,27 @@ #define STOCK_PART_ADVANCED 2 #define STOCK_PART_SUPER 3 +/* + Stock parts (as of 2025/06) are only able to be installed in machinery objects. + + They improve the functionality of the machine in various ways, scaling with their rating. The + impact any given part type has on a machine should be described in a var/hint_[parttype]. + + By default, higher-rated parts will also increase machine power usage- refer to energy_rating() + to see the multiplier the total energy rating will apply to power usage. + + By assigning a machinery the variable "parts_power_mgmt = FALSE", bespoke power usage code can + be applied (i.e. upgrades that reduce power usage). This should be modified in the future to + accommodate more flexible and intuitive power draw changes due to stock parts, but was implemented + this way by Bat just to accommodate existing machine upgrades. Future changes will entail a more + in-depth balance pass. + + Tcomms stock parts are somewhat weirder, not following the same 'rank' behavior as the standard + cluster of ranked five. They are also no longer used exclusively in Tcomms machinery- for example, + the Hull Shield Generator requires both standard and Tcomms stock parts. This should also be + addressed in future. +*/ + /obj/item/storage/bag/stockparts_box name = "stock parts box" desc = "A low-tech method of storing stock parts used in machinery." @@ -82,6 +103,17 @@ . = ..() randpixel_xy() +/obj/item/stock_parts/proc/energy_rating() + switch(rating) + if(STOCK_PART_BASIC) + return 1 + if(STOCK_PART_ADVANCED) + return 3 + if(STOCK_PART_SUPER) + return 5 + else + return 0 + //Rank 1 /obj/item/stock_parts/console_screen @@ -112,7 +144,7 @@ /obj/item/stock_parts/manipulator name = "micro-manipulator" parent_stock_name = "micro-manipulator" - desc = "A tiny little manipulator used in the construction of certain devices." + desc = "A tiny micrometer-scale manipulator used in the construction of certain devices." icon_state = "micro_mani" origin_tech = list(TECH_MATERIAL = 1, TECH_DATA = 1) matter = list(DEFAULT_WALL_MATERIAL = 30) @@ -141,7 +173,7 @@ /obj/item/stock_parts/capacitor/adv name = "advanced capacitor" - desc = "An advanced capacitor used in the construction of a variety of devices." + desc = "A compact, ultra-high resolution scanning module used in the construction of certain devices." icon_state = "adv_capacitor" origin_tech = list(TECH_POWER = 3) rating = STOCK_PART_ADVANCED @@ -157,6 +189,7 @@ /obj/item/stock_parts/manipulator/nano name = "nano-manipulator" + desc = "A tiny nanometer-scale manipulator used in the construction of certain devices." icon_state = "nano_mani" origin_tech = list(TECH_MATERIAL = 3, TECH_DATA = 2) rating = STOCK_PART_ADVANCED @@ -164,6 +197,7 @@ /obj/item/stock_parts/micro_laser/high name = "high-power micro-laser" + desc = "A tiny, high-powered laser used in certain devices." icon_state = "high_micro_laser" origin_tech = list(TECH_MAGNET = 3) rating = STOCK_PART_ADVANCED @@ -188,7 +222,7 @@ /obj/item/stock_parts/scanning_module/phasic name = "phasic scanning module" - desc = "A compact, high resolution phasic scanning module used in the construction of certain devices." + desc = "A compact, ultra-high resolution phasic scanning module used in the construction of certain devices." icon_state = "super_scan_module" origin_tech = list(TECH_MAGNET = 5) rating = STOCK_PART_SUPER @@ -196,6 +230,7 @@ /obj/item/stock_parts/manipulator/pico name = "pico-manipulator" + desc = "A tiny picometer-scale manipulator used in the construction of certain devices." icon_state = "pico_mani" origin_tech = list(TECH_MATERIAL = 5, TECH_DATA = 2) rating = STOCK_PART_SUPER @@ -203,6 +238,7 @@ /obj/item/stock_parts/micro_laser/ultra name = "ultra-high-power micro-laser" + desc = "A tiny, alarmingly high-powered laser used in certain devices." icon_state = "ultra_high_micro_laser" origin_tech = list(TECH_MAGNET = 5) rating = STOCK_PART_SUPER @@ -210,6 +246,7 @@ /obj/item/stock_parts/matter_bin/super name = "super matter bin" + desc = "A container for holding compressed matter awaiting reconstruction. Fortunately, this is a super 'matter bin', not a 'super matter' bin." icon_state = "super_matter_bin" origin_tech = list(TECH_MATERIAL = 5) rating = STOCK_PART_SUPER diff --git a/code/modules/research/tech_processor.dm b/code/modules/research/tech_processor.dm index 91d469ab526..cc90aef36a2 100644 --- a/code/modules/research/tech_processor.dm +++ b/code/modules/research/tech_processor.dm @@ -18,11 +18,16 @@ var/heat_delay = 10 + component_hint_scan = "Upgraded scanning modules will increase speed at which research calculations are made and reduce active power usage." + + parts_power_mgmt = FALSE + /obj/machinery/r_n_d/tech_processor/Destroy() set_server(null) return ..() /obj/machinery/r_n_d/tech_processor/RefreshParts() + ..() tech_rate = 0 for(var/obj/item/stock_parts/scanning_module/SM in component_parts) tech_rate += SM.rating / 2 diff --git a/code/modules/telesci/telepad.dm b/code/modules/telesci/telepad.dm index bb04464716b..bea680aad16 100644 --- a/code/modules/telesci/telepad.dm +++ b/code/modules/telesci/telepad.dm @@ -18,7 +18,11 @@ /obj/item/stack/cable_coil{amount = 1} ) + component_hint_cap = "Upgraded capacitors will improve the power efficiency of the telepad." + parts_power_mgmt = FALSE + /obj/machinery/telepad/RefreshParts() + ..() var/E for(var/obj/item/stock_parts/capacitor/C in component_parts) E += C.rating diff --git a/html/changelogs/Batrachophreno-StockParts.yml b/html/changelogs/Batrachophreno-StockParts.yml new file mode 100644 index 00000000000..924dcea4a14 --- /dev/null +++ b/html/changelogs/Batrachophreno-StockParts.yml @@ -0,0 +1,63 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# - (fixes bugs) +# wip +# - (work in progress) +# qol +# - (quality of life) +# soundadd +# - (adds a sound) +# sounddel +# - (removes a sound) +# rscadd +# - (adds a feature) +# rscdel +# - (removes a feature) +# imageadd +# - (adds an image or sprite) +# imagedel +# - (removes an image or sprite) +# spellcheck +# - (fixes spelling or grammar) +# experiment +# - (experimental change) +# balance +# - (balance changes) +# code_imp +# - (misc internal code change) +# refactor +# - (refactors code) +# config +# - (makes a change to the config files) +# admin +# - (makes changes to administrator tools) +# server +# - (miscellaneous changes to server) +################################# + +# Your name. +author: Batrachophreno + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit. +# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog. +changes: + - qol: "Upgradeable objects now, on extended Examine (show more info), state what parts can be upgraded and what they do." + - qol: "Extended Examine text now formatted more cleanly and broken up by section (mechanics, upgrades, antag hooks, etc.)" + - refactor: "Minor refactor to get_examine_text() to accommodate the above and make room for future development." + - balance: "Machine stock parts now more consistently affect power draw (usually increases it, unless specified otherwise)." + - balance: "Antagonism extended descriptions now viewable by ghosts and Storytellers, not just active antags." + - rscadd: "Added missing descriptions or updated existing ones on several stock parts."