Inducers accept megacells now. (#84395)

They still allow regular cells. Tested in-game, works fine.

Fixes: https://github.com/tgstation/tgstation/issues/84388

## About The Pull Request

Due to an oversight in the code, megacells were installed in inducers
but inducers wouldn't accept them to be installed in the first place.

## Why It's Good For The Game

Fixes an oversight. (bug)

## Changelog

🆑
fix: Inducers now accept megacells AND regular cells.
/🆑
This commit is contained in:
hyperjll
2024-06-28 16:09:22 -06:00
committed by GitHub
parent e8b9e64e4d
commit 9a4e14eb7e
+11 -11
View File
@@ -11,13 +11,13 @@
var/power_transfer_multiplier = 1
var/opened = FALSE
var/cell_type = /obj/item/stock_parts/power_store/battery/high
var/obj/item/stock_parts/power_store/cell
var/obj/item/stock_parts/power_store/powerdevice
var/recharging = FALSE
/obj/item/inducer/Initialize(mapload)
. = ..()
if(!cell && cell_type)
cell = new cell_type
if(!powerdevice && cell_type)
powerdevice = new cell_type
/obj/item/inducer/proc/induce(obj/item/stock_parts/power_store/target, coefficient)
var/obj/item/stock_parts/power_store/our_cell = get_cell()
@@ -30,7 +30,7 @@
target.update_appearance()
/obj/item/inducer/get_cell()
return cell
return powerdevice
/obj/item/inducer/emp_act(severity)
. = ..()
@@ -81,14 +81,14 @@
return
/obj/item/inducer/attackby(obj/item/used_item, mob/user)
if(istype(used_item, /obj/item/stock_parts/power_store/cell))
if(istype(used_item, /obj/item/stock_parts/power_store))
if(opened)
var/obj/item/stock_parts/power_store/our_cell = get_cell()
if(isnull(our_cell))
if(!user.transferItemToLoc(used_item, src))
return
to_chat(user, span_notice("You insert [used_item] into [src]."))
cell = used_item
powerdevice = used_item
update_appearance()
return
else
@@ -158,11 +158,11 @@
/obj/item/inducer/attack_self(mob/user)
if(opened && cell)
user.visible_message(span_notice("[user] removes [cell] from [src]!"), span_notice("You remove [cell]."))
cell.update_appearance()
user.put_in_hands(cell)
cell = null
if(opened && powerdevice)
user.visible_message(span_notice("[user] removes [powerdevice] from [src]!"), span_notice("You remove [powerdevice]."))
powerdevice.update_appearance()
user.put_in_hands(powerdevice)
powerdevice = null
update_appearance()