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 23:14:59 +02:00
committed by GitHub
parent 566aeaa2da
commit 2bf39c7ee9
22 changed files with 178 additions and 74 deletions

View File

@@ -166,6 +166,9 @@
if(cell)
to_chat(user, SPAN_WARNING("There is \a [cell] already installed here."))
else
if(attacking_item.w_class != ITEMSIZE_NORMAL)
to_chat(user, SPAN_WARNING("\The [attacking_item] is too [attacking_item.w_class < ITEMSIZE_NORMAL ? "small" : "large"] to fit here."))
return
user.drop_from_inventory(attacking_item,src)
cell = attacking_item
to_chat(user, SPAN_NOTICE("You insert \the [cell]."))

View File

@@ -17,6 +17,9 @@
matter = list(DEFAULT_WALL_MATERIAL = 700, MATERIAL_GLASS = 50)
recyclable = TRUE
/// Percentage of maxcharge to recharge per minute, though it will trickle charge every process tick (every ~2 seconds), leave null for no self-recharge
var/self_charge_percentage
/// Smaller variant, used by energy guns and similar small devices
/obj/item/cell/device
name = "device power cell"
@@ -82,13 +85,6 @@
maxcharge = 10000
matter = list(DEFAULT_WALL_MATERIAL = 700, MATERIAL_GLASS = 60)
/obj/item/cell/mecha
name = "exosuit-grade power cell"
origin_tech = list(TECH_POWER = 3)
icon_state = "hcell"
maxcharge = 15000
matter = list(DEFAULT_WALL_MATERIAL = 700, MATERIAL_GLASS = 70)
/obj/item/cell/high/empty/Initialize()
. = ..()
charge = 0
@@ -151,42 +147,20 @@
icon_state = "yellow slime extract"
maxcharge = 15000
matter = null
var/next_recharge
/obj/item/cell/slime/Initialize()
. = ..()
START_PROCESSING(SSprocessing, src)
/obj/item/cell/slime/Destroy()
STOP_PROCESSING(SSprocessing, src)
return ..()
/obj/item/cell/slime/process()
if(next_recharge < world.time)
charge = min(charge + (maxcharge / 10), maxcharge)
next_recharge = world.time + 1 MINUTE
// slime cores recharges 10% every one minute
self_charge_percentage = 10
/obj/item/cell/nuclear
name = "miniaturized nuclear power core"
desc = "A small self-charging thorium core that can store an immense amount of charge."
name = "miniaturized nuclear power cell"
desc = "A small self-charging cell with a thorium core that can store an immense amount of charge."
origin_tech = list(TECH_POWER = 8, TECH_ILLEGAL = 4)
icon_state = "icell"
maxcharge = 50000
matter = null
var/next_recharge
/obj/item/cell/nuclear/Initialize()
. = ..()
START_PROCESSING(SSprocessing, src)
/obj/item/cell/nuclear/Destroy()
STOP_PROCESSING(SSprocessing, src)
return ..()
/obj/item/cell/nuclear/process()
if(next_recharge < world.time)
charge = min(charge + (maxcharge / 10), maxcharge)
next_recharge = world.time + 30 SECONDS
// nuclear cores recharges 20% every one minute
self_charge_percentage = 10
/obj/item/cell/device/emergency_light
name = "miniature power cell"
@@ -222,3 +196,31 @@
drop_sound = 'sound/items/drop/gascan.ogg'
pickup_sound = 'sound/items/pickup/gascan.ogg'
origin_tech = list(TECH_POWER = 4)
/obj/item/cell/mecha
name = "power core"
origin_tech = list(TECH_POWER = 2)
icon_state = "core"
w_class = ITEMSIZE_LARGE
maxcharge = 20000
matter = list(DEFAULT_WALL_MATERIAL = 20000, MATERIAL_GLASS = 10000)
/obj/item/cell/mecha/nuclear
name = "nuclear power core"
origin_tech = list(TECH_POWER = 3, TECH_MATERIAL = 3)
icon_state = "nuclear_core"
maxcharge = 30000
matter = list(DEFAULT_WALL_MATERIAL = 20000, MATERIAL_GLASS = 10000, MATERIAL_URANIUM = 10000)
// nuclear mecha cores recharges 5% every one minute
self_charge_percentage = 5
/obj/item/cell/mecha/phoron
name = "phoron power core"
origin_tech = list(TECH_POWER = 5, TECH_MATERIAL = 5)
icon_state = "phoron_core"
maxcharge = 50000
matter = list(DEFAULT_WALL_MATERIAL = 20000, MATERIAL_GLASS = 10000, MATERIAL_PHORON = 5000)
// nuclear mecha cores recharges 10% every one minute
self_charge_percentage = 10

View File

@@ -70,6 +70,9 @@
/obj/item/melee/baton/attackby(obj/item/attacking_item, mob/user)
if(istype(attacking_item, /obj/item/cell))
if(attacking_item.w_class != ITEMSIZE_NORMAL)
to_chat(user, SPAN_WARNING("\The [attacking_item] is too [attacking_item.w_class < ITEMSIZE_NORMAL ? "small" : "large"] to fit here."))
return
if(!bcell)
user.drop_from_inventory(attacking_item, src)
bcell = attacking_item