From b1bd1d210f4c39d3260d08ef3c3b0ac08a286964 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Barou=C5=A1?= Date: Thu, 22 Oct 2020 17:26:12 +0200 Subject: [PATCH] SMES improvements - visible hatch actions, examine to see coils, coils show rating and throughput (#10288) --- code/modules/power/cell.dm | 4 ++-- code/modules/power/smes.dm | 25 ++++++++++++++++---- code/modules/power/smes_construction.dm | 21 +++++++++++----- html/changelogs/amunak-smes-improvements.yml | 5 ++++ 4 files changed, 43 insertions(+), 12 deletions(-) create mode 100755 html/changelogs/amunak-smes-improvements.yml diff --git a/code/modules/power/cell.dm b/code/modules/power/cell.dm index 42f06ecbc15..54be119c9a5 100644 --- a/code/modules/power/cell.dm +++ b/code/modules/power/cell.dm @@ -86,9 +86,9 @@ return if(maxcharge <= 2500) - to_chat(user, "[desc]\nThe manufacturer's label states this cell has a power rating of [maxcharge], and that you should not swallow it.\nThe charge meter reads [round(src.percent() )]%.") + to_chat(user, "[desc]\nThe manufacturer's label states this cell has a power rating of [maxcharge]J, and that you should not swallow it.\nThe charge meter reads [round(src.percent() )]%.") else - to_chat(user, "This power cell has an exciting chrome finish, as it is an uber-capacity cell type! It has a power rating of [maxcharge]!\nThe charge meter reads [round(src.percent() )]%.") + to_chat(user, "This power cell has an exciting chrome finish, as it is an uber-capacity cell type! It has a power rating of [maxcharge]J!\nThe charge meter reads [round(src.percent() )]%.") /obj/item/cell/attackby(obj/item/W, mob/user) ..() diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm index f7a8ef9c7de..0be1ad3a590 100644 --- a/code/modules/power/smes.dm +++ b/code/modules/power/smes.dm @@ -29,6 +29,7 @@ var/capacity = 5e6 // maximum charge var/charge = 1e6 // actual charge + var/max_coils = 0 var/input_attempt = 0 // 1 = attempting to charge, 0 = not attempting to charge var/inputting = 0 // 1 = actually inputting, 0 = not inputting @@ -113,6 +114,16 @@ if(!should_be_mapped) warning("Non-buildable or Non-magical SMES at [src.x]X [src.y]Y [src.z]Z") +/obj/machinery/power/smes/examine(mob/user) + . = ..() + if(open_hatch) + to_chat(user, SPAN_SUBTLE("The maintenance hatch is open.")) + if (max_coils > 1 && Adjacent(user)) + var/list/coils = list() + for(var/obj/item/smes_coil/C in component_parts) + coils += C + to_chat(user, "The [max_coils] coil slots contain: [counting_english_list(coils)]") + /obj/machinery/power/smes/add_avail(var/amount) if(..(amount)) powernet.smes_newavail += amount @@ -298,11 +309,17 @@ if(W.isscrewdriver()) if(!open_hatch) open_hatch = 1 - to_chat(user, "You open the maintenance hatch of [src].") + user.visible_message(\ + "\The [user] opens the maintenance hatch of \the [src].",\ + "You open the maintenance hatch of \the [src].",\ + range = 4) return 0 else open_hatch = 0 - to_chat(user, "You close the maintenance hatch of [src].") + user.visible_message(\ + "\The [user] closes the maintenance hatch of \the [src].",\ + "You close the maintenance hatch of \the [src].",\ + range = 4) return 0 if (!open_hatch) @@ -322,8 +339,8 @@ building_terminal = 0 CC.use(10) user.visible_message(\ - "[user.name] has added cables to the [src].",\ - "You added cables to the [src].") + "[user.name] has added cables to the [src].",\ + "You added cables to the [src].") terminal.connect_to_network() stat = 0 return 0 diff --git a/code/modules/power/smes_construction.dm b/code/modules/power/smes_construction.dm index 1db2c5ff6b4..ebaf0d7ab7c 100644 --- a/code/modules/power/smes_construction.dm +++ b/code/modules/power/smes_construction.dm @@ -8,31 +8,40 @@ //MAGNETIC COILS - These things actually store and transmit power within the SMES. Different types have different /obj/item/smes_coil name = "superconductive magnetic coil" - desc = "Standard superconductive magnetic coil with average capacity and I/O rating." + desc = "Standard superconductive magnetic coil with balanced capacity and I/O rating." icon = 'icons/obj/stock_parts.dmi' icon_state = "smes_coil" // Just few icons patched together. If someone wants to make better icon, feel free to do so! - w_class = ITEMSIZE_LARGE // It's LARGE (backpack size) + w_class = ITEMSIZE_LARGE // It's LARGE (backpack size) var/ChargeCapacity = 5000000 var/IOCapacity = 250000 +/obj/item/smes_coil/examine(mob/user) + . = ..() + if(Adjacent(user)) + to_chat(user, "The label reads:\ +
Only certified professionals are allowed to handle and install this component.
\ + Charge capacity: [ChargeCapacity/1000000] MJ
\ + Input/Output rating: [IOCapacity/1000] kW
", + trailing_newline = FALSE) + // 20% Charge Capacity, 60% I/O Capacity. Used for substation/outpost SMESs. /obj/item/smes_coil/weak name = "basic superconductive magnetic coil" - desc = "Cheaper model of standard superconductive magnetic coil. It's capacity and I/O rating are considerably lower." + desc = "Cheaper model of the standard superconductive magnetic coil. Its capacity and I/O rating are considerably lower." ChargeCapacity = 1000000 IOCapacity = 150000 // 1000% Charge Capacity, 20% I/O Capacity /obj/item/smes_coil/super_capacity name = "superconductive capacitance coil" - desc = "Specialised version of standard superconductive magnetic coil. This one has significantly stronger containment field, allowing for significantly larger power storage. It's IO rating is much lower, however." + desc = "Specialised version of the standard superconductive magnetic coil. It has significantly stronger containment field, allowing for immense power storage. However its I/O rating is much lower." ChargeCapacity = 50000000 IOCapacity = 50000 // 10% Charge Capacity, 400% I/O Capacity. Technically turns SMES into large super capacitor.Ideal for shields. /obj/item/smes_coil/super_io name = "superconductive transmission coil" - desc = "Specialised version of standard superconductive magnetic coil. While this one won't store almost any power, it rapidly transfers power, making it useful in systems which require large throughput." + desc = "Specialised version of the standard superconductive magnetic coil. While it's almost useless for power storage it can rapidly transfer power, making it useful in systems that require large throughput." ChargeCapacity = 500000 IOCapacity = 1000000 @@ -57,7 +66,7 @@ // SMES itself /obj/machinery/power/smes/buildable - var/max_coils = 6 //30M capacity, 1.5MW input/output when fully upgraded /w default coils + max_coils = 6 // 30M capacity, 1.5MW input/output when fully upgraded /w default coils var/cur_coils = 1 // Current amount of installed coils var/safeties_enabled = 1 // If 0 modifications can be done without discharging the SMES, at risk of critical failure. var/failing = 0 // If 1 critical failure has occured and SMES explosion is imminent. diff --git a/html/changelogs/amunak-smes-improvements.yml b/html/changelogs/amunak-smes-improvements.yml new file mode 100755 index 00000000000..21135b7a440 --- /dev/null +++ b/html/changelogs/amunak-smes-improvements.yml @@ -0,0 +1,5 @@ +author: Amunak +delete-after: True +changes: + - rscadd: "SMES now show whether the maintenance hatch is open, they visibly show (in short range) that the hatch was opened/closed, and when open you can examine the SMES and see what coils are inside." + - rscadd: "SMES coils, when examined closely, will now show a label with the charge capacity and I/O rating. Also tweaked descriptions of SMES coils and fixed some typos."