mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-26 05:27:39 +01:00
fusion coils (#18716)
Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
co-authored by
Cameron Lennox
parent
4b1115d9f8
commit
51e591a527
@@ -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)
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user