Exosuit Nuclear Power Cores (#18268)

* Added power cores, a type of large battery cell that get used by
exosuits. The nuclear and phoron variants are self-charging.
* Combat mechs now start with nuclear power cores, allowing them to
sustain themselves indefinitely, so long as they stay out of the action
for a bit.
* Removed basic power cells from the mechfab, replaced with the mech
powercores.
* Mech cell statuses now instantly update as soon as the cell charges or
discharges.
* Added a stack of 10 uranium to the machinist's workshop, which can
print two nuclear power cores.
This commit is contained in:
Geeves
2024-06-09 21:14:59 +00:00
committed by GitHub
parent 566aeaa2da
commit 2bf39c7ee9
22 changed files with 178 additions and 74 deletions
+11 -2
View File
@@ -445,9 +445,13 @@
visible_message(SPAN_NOTICE("\The [user] pries out \the [body.cell] using the \the [attacking_item]."))
power = MECH_POWER_OFF
hud_power_control.update_icon()
UnregisterSignal(body.cell, COMSIG_CELL_CHARGE)
body.cell = null
return
else if(istype(attacking_item, /obj/item/cell))
if(!istype(attacking_item, /obj/item/cell/mecha))
to_chat(user, SPAN_WARNING("You can only use power cores in \the [src]!"))
return
if(!maintenance_protocols)
to_chat(user, SPAN_WARNING("The cell compartment remains locked while maintenance protocols are disabled."))
return
@@ -458,9 +462,9 @@
if(user.unEquip(attacking_item))
attacking_item.forceMove(body)
body.cell = attacking_item
to_chat(user, SPAN_NOTICE("You install \the [body.cell] into \the [src]."))
RegisterSignal(body.cell, COMSIG_CELL_CHARGE, PROC_REF(handle_cell_charge))
playsound(user.loc, 'sound/items/Screwdriver.ogg', 50, 1)
visible_message(SPAN_NOTICE("\The [user] installs \the [body.cell] into \the [src]."))
user.visible_message(SPAN_NOTICE("\The [user] installs \the [body.cell] into \the [src]."), SPAN_NOTICE("You install \the [body.cell] into \the [src]."))
return
else if(istype(attacking_item, /obj/item/device/robotanalyzer))
to_chat(user, SPAN_NOTICE("Diagnostic Report for \the [src]:"))
@@ -730,3 +734,8 @@
say("Following [ID.registered_name].")
break
return
/mob/living/heavy_vehicle/proc/handle_cell_charge(var/obj/item/cell/cell, var/new_charge)
SIGNAL_HANDLER
handle_power_hud()