From c76ce99a4d6503750bff5f99c195568efccc56fe Mon Sep 17 00:00:00 2001 From: Atermonera Date: Thu, 4 Jun 2020 19:37:53 -0700 Subject: [PATCH] Adds proc to replace default cells with high cap on machinery (#7241) * Adds proc to replace default cells with high cap on machinery * *grumbling* --- code/game/machinery/machinery.dm | 10 +++++++++- code/game/machinery/rechargestation.dm | 3 ++- code/modules/mining/drilling/drill.dm | 5 +++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index e61076587b..cf582cfb99 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -305,6 +305,14 @@ Class Procs: CB.apply_default_parts(src) 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) if(!istype(R)) return 0 @@ -460,4 +468,4 @@ Class Procs: return /datum/proc/remove_visual(mob/M) - return \ No newline at end of file + return diff --git a/code/game/machinery/rechargestation.dm b/code/game/machinery/rechargestation.dm index cdc3d4621a..0f1a96c8c7 100644 --- a/code/game/machinery/rechargestation.dm +++ b/code/game/machinery/rechargestation.dm @@ -24,7 +24,8 @@ /obj/machinery/recharge_station/Initialize() . = ..() - default_apply_parts() + default_apply_parts() + default_use_hicell() update_icon() /obj/machinery/recharge_station/proc/has_cell_power() diff --git a/code/modules/mining/drilling/drill.dm b/code/modules/mining/drilling/drill.dm index f4e51a0c30..94ef0425b6 100644 --- a/code/modules/mining/drilling/drill.dm +++ b/code/modules/mining/drilling/drill.dm @@ -55,6 +55,7 @@ /obj/machinery/mining/drill/Initialize() . = ..() default_apply_parts() + default_use_hicell() /obj/machinery/mining/drill/process() @@ -166,7 +167,7 @@ to_chat(user, "The drill already has a cell installed.") else user.drop_item() - O.loc = src + O.forceMove(src) cell = O component_parts += O to_chat(user, "You install \the [O].") @@ -178,7 +179,7 @@ if (panel_open && cell && user.Adjacent(src)) to_chat(user, "You take out \the [cell].") - cell.loc = get_turf(user) + cell.forceMove(get_turf(user)) component_parts -= cell cell = null return