diff --git a/code/datums/supplypacks/engineering.dm b/code/datums/supplypacks/engineering.dm index 376bdf8bd0c..9db13f4a4f2 100644 --- a/code/datums/supplypacks/engineering.dm +++ b/code/datums/supplypacks/engineering.dm @@ -15,6 +15,14 @@ containertype = /obj/structure/closet/crate/galaksi containername = "Replacement lights" +/datum/supply_pack/eng/fusion_coils + name = "Fusion Coils (SMES Recharge)" + desc = "A pair of single-use heavy-duty fusion coils, for recharging depleted SMES units." + contains = list(/obj/item/fusion_coil, /obj/item/fusion_coil) + cost = 150 + containertype = /obj/structure/closet/crate/einstein + containername = "Fusion Coil crate" + /datum/supply_pack/eng/smescoil name = "Superconducting Magnetic Coil" desc = "A single standard superconducting magnetic coil." diff --git a/code/modules/power/fusion_coil.dm b/code/modules/power/fusion_coil.dm new file mode 100644 index 00000000000..7e97cba1ea1 --- /dev/null +++ b/code/modules/power/fusion_coil.dm @@ -0,0 +1,20 @@ +/obj/item/fusion_coil + name = "fusion coil" + desc = "A special heavy-duty battery used to recharge SMES units. It dumps its entire power reserve into the SMES unit at once, and cannot be recharged locally. Safety systems on the coil itself mean it can't be used on charged SMES units if it would put them over their capacity." + icon = 'icons/obj/power_cells.dmi' + icon_state = "fc_charged" + var/spent_icon = "fc_spent" //icon state used after a fusion coil is "burned out" + item_state = "egg6" + drop_sound = 'sound/items/drop/metalboots.ogg' + pickup_sound = 'sound/items/pickup/gascan.ogg' + + //these things are big and heavy, they're awkward to transport, and you can't throw them very far + w_class = ITEMSIZE_LARGE + force = 15 + throw_speed = 4 + throw_range = 4 + slowdown = 0.5 + + var/spent = FALSE //have we been discharged into something yet? + var/coil_charge = 4800000 //how much power do we dump into the SMES on use? restores the main (if unupgraded) by 20%, or engine by 80% + matter = list(MAT_STEEL = 6000, MAT_COPPER = 4000, MAT_PLASTIC = 2000) diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm index 8d5468b1bba..2909be49c32 100644 --- a/code/modules/power/smes.dm +++ b/code/modules/power/smes.dm @@ -324,7 +324,26 @@ GLOBAL_LIST_EMPTY(smeses) to_chat(user, span_filter_notice(span_warning("You need to open access hatch on [src] first!"))) return FALSE - if(W.has_tool_quality(TOOL_WELDER)) + if(istype(W, /obj/item/fusion_coil)) + var/obj/item/fusion_coil/FC = W + if(FC.spent || FC.coil_charge == 0) + to_chat(user, span_filter_notice("\The [FC] has no charge remaining.")) + return FALSE + else if(charge + FC.coil_charge > capacity) + to_chat(user, span_filter_notice("\The [FC] has too much charge stored to recharge \the [src].")) + return FALSE + else + playsound(src, 'sound/effects/lightning_chargeup.ogg', 75, 0, 1) + if(do_after(user, 10 SECONDS, target = src)) + to_chat(user, span_filter_notice("You successfully recharge \the [src] with \the [FC]. It is now depleted.")) + charge += FC.coil_charge + FC.coil_charge = 0 + FC.spent = TRUE + FC.name = "depleted [FC.name]" + FC.icon_state = FC.spent_icon + return FALSE + + else if(W.has_tool_quality(TOOL_WELDER)) var/obj/item/weldingtool/WT = W.get_welder() if(!WT.isOn()) to_chat(user, span_filter_notice("Turn on \the [WT] first!")) @@ -336,6 +355,7 @@ GLOBAL_LIST_EMPTY(smeses) to_chat(user, span_filter_notice("You repair all structural damage to \the [src]")) damage = 0 return FALSE + else if(istype(W, /obj/item/stack/cable_coil) && !building_terminal) building_terminal = 1 var/obj/item/stack/cable_coil/CC = W diff --git a/icons/obj/power_cells.dmi b/icons/obj/power_cells.dmi index 880c4ca5824..13fc56bd9e6 100644 Binary files a/icons/obj/power_cells.dmi and b/icons/obj/power_cells.dmi differ diff --git a/maps/groundbase/gb-z1.dmm b/maps/groundbase/gb-z1.dmm index e8d2ee64180..b96b00b6b72 100644 --- a/maps/groundbase/gb-z1.dmm +++ b/maps/groundbase/gb-z1.dmm @@ -11457,6 +11457,13 @@ /obj/machinery/requests_console/preset/engineering{ pixel_x = 30 }, +/obj/structure/table/reinforced, +/obj/item/fusion_coil{ + pixel_x = 6 + }, +/obj/item/fusion_coil{ + pixel_x = -6 + }, /turf/simulated/floor/tiled, /area/groundbase/engineering/workshop) "zw" = ( diff --git a/maps/stellar_delight/stellar_delight2.dmm b/maps/stellar_delight/stellar_delight2.dmm index 75427ec9752..cbe11cd69f7 100644 --- a/maps/stellar_delight/stellar_delight2.dmm +++ b/maps/stellar_delight/stellar_delight2.dmm @@ -4132,7 +4132,12 @@ /obj/machinery/light{ dir = 4 }, -/obj/item/reagent_containers/spray/cleaner, +/obj/item/fusion_coil{ + pixel_x = 6 + }, +/obj/item/fusion_coil{ + pixel_x = -6 + }, /turf/simulated/floor/tiled/eris/dark/orangecorner, /area/engineering/workshop) "iJ" = ( diff --git a/maps/tether/tether-05-station1.dmm b/maps/tether/tether-05-station1.dmm index c21d704581f..a9a2ec07034 100644 --- a/maps/tether/tether-05-station1.dmm +++ b/maps/tether/tether-05-station1.dmm @@ -8791,6 +8791,13 @@ dir = 8; pixel_x = 30 }, +/obj/item/fusion_coil{ + pixel_x = 6 + }, +/obj/item/fusion_coil{ + pixel_x = -6 + }, +/obj/structure/table/reinforced, /turf/simulated/floor/tiled, /area/engineering/workshop) "awC" = ( diff --git a/vorestation.dme b/vorestation.dme index 7cc77e277aa..76632cde72f 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -4020,6 +4020,7 @@ #include "code\modules\power\cable_heavyduty.dm" #include "code\modules\power\cell.dm" #include "code\modules\power\debug_items.dm" +#include "code\modules\power\fusion_coil.dm" #include "code\modules\power\generator.dm" #include "code\modules\power\gravitygenerator_vr.dm" #include "code\modules\power\grid_checker.dm"