mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Adds proc to replace default cells with high cap on machinery (#7241)
* Adds proc to replace default cells with high cap on machinery * *grumbling*
This commit is contained in:
@@ -305,6 +305,14 @@ Class Procs:
|
|||||||
CB.apply_default_parts(src)
|
CB.apply_default_parts(src)
|
||||||
RefreshParts()
|
RefreshParts()
|
||||||
|
|
||||||
|
/obj/machinery/proc/default_use_hicell()
|
||||||
|
var/obj/item/weapon/cell/C = locate(/obj/item/weapon/cell) in component_parts
|
||||||
|
if(C)
|
||||||
|
component_parts -= C
|
||||||
|
qdel(C)
|
||||||
|
C = new /obj/item/weapon/cell/high(src)
|
||||||
|
component_parts += C
|
||||||
|
|
||||||
/obj/machinery/proc/default_part_replacement(var/mob/user, var/obj/item/weapon/storage/part_replacer/R)
|
/obj/machinery/proc/default_part_replacement(var/mob/user, var/obj/item/weapon/storage/part_replacer/R)
|
||||||
if(!istype(R))
|
if(!istype(R))
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
@@ -24,7 +24,8 @@
|
|||||||
|
|
||||||
/obj/machinery/recharge_station/Initialize()
|
/obj/machinery/recharge_station/Initialize()
|
||||||
. = ..()
|
. = ..()
|
||||||
default_apply_parts()
|
default_apply_parts()
|
||||||
|
default_use_hicell()
|
||||||
update_icon()
|
update_icon()
|
||||||
|
|
||||||
/obj/machinery/recharge_station/proc/has_cell_power()
|
/obj/machinery/recharge_station/proc/has_cell_power()
|
||||||
|
|||||||
@@ -57,6 +57,7 @@
|
|||||||
if(ispath(cell))
|
if(ispath(cell))
|
||||||
cell = new cell(src)
|
cell = new cell(src)
|
||||||
default_apply_parts()
|
default_apply_parts()
|
||||||
|
default_use_hicell()
|
||||||
|
|
||||||
/obj/machinery/mining/drill/loaded
|
/obj/machinery/mining/drill/loaded
|
||||||
cell = /obj/item/weapon/cell/high
|
cell = /obj/item/weapon/cell/high
|
||||||
@@ -174,7 +175,7 @@
|
|||||||
to_chat(user, "The drill already has a cell installed.")
|
to_chat(user, "The drill already has a cell installed.")
|
||||||
else
|
else
|
||||||
user.drop_item()
|
user.drop_item()
|
||||||
O.loc = src
|
O.forceMove(src)
|
||||||
cell = O
|
cell = O
|
||||||
component_parts += O
|
component_parts += O
|
||||||
to_chat(user, "You install \the [O].")
|
to_chat(user, "You install \the [O].")
|
||||||
@@ -186,7 +187,7 @@
|
|||||||
|
|
||||||
if (panel_open && cell && user.Adjacent(src))
|
if (panel_open && cell && user.Adjacent(src))
|
||||||
to_chat(user, "You take out \the [cell].")
|
to_chat(user, "You take out \the [cell].")
|
||||||
cell.loc = get_turf(user)
|
cell.forceMove(get_turf(user))
|
||||||
component_parts -= cell
|
component_parts -= cell
|
||||||
cell = null
|
cell = null
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user