Files
VOREStation/code/modules/power/batteryrack_vr.dm
T
Cameron Lennox d73f6b8dbd Makes uses of do_after sane (#18334)
* Prevents insta-actions

* Do_after sanity

NOTE: NUKE do_after_action

* Update bonfire.dm

* The  rest of them

Also fixes a tpyo

* no minitest :)

* .

* .

* Gets rid of the slowdown for now

---------

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
2025-09-08 02:25:08 +02:00

22 lines
745 B
Plaintext

/obj/machinery/power/smes/batteryrack/mapped
var/cell_type = /obj/item/cell/apc
var/cell_number = 3
/obj/machinery/power/smes/batteryrack/mapped/Initialize(mapload)
. = ..()
for(var/i = 1 to cell_number)
if(i > max_cells)
break
var/obj/item/cell/newcell = new cell_type(src.loc)
insert_cell(newcell)
/obj/item/module/power_control/attackby(var/obj/item/I, var/mob/user)
if(I.has_tool_quality(TOOL_MULTITOOL))
to_chat(user, span_notice("You begin tweaking the power control circuits to support a power cell rack."))
if(do_after(user, 5 SECONDS * I.toolspeed, target = src))
var/obj/item/newcircuit = new/obj/item/circuitboard/batteryrack(get_turf(user))
qdel(src)
user.put_in_hands(newcircuit)
return
return ..()