Modular Cmp Updates
This commit is contained in:
@@ -6,8 +6,8 @@
|
||||
|
||||
/obj/item/computer_hardware/recharger/proc/use_power(amount, charging=0)
|
||||
if(charging)
|
||||
return 1
|
||||
return 0
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/item/computer_hardware/recharger/process()
|
||||
..()
|
||||
@@ -23,28 +23,28 @@
|
||||
holder.give_power(charge_rate * GLOB.CELLRATE)
|
||||
|
||||
|
||||
/obj/item/computer_hardware/recharger/APC
|
||||
/obj/item/computer_hardware/recharger/apc_recharger
|
||||
name = "area power connector"
|
||||
desc = "A device that wirelessly recharges connected device from nearby APC."
|
||||
icon_state = "charger_APC"
|
||||
w_class = WEIGHT_CLASS_SMALL // Can't be installed into tablets/PDAs
|
||||
|
||||
/obj/item/computer_hardware/recharger/APC/use_power(amount, charging=0)
|
||||
/obj/item/computer_hardware/recharger/apc_recharger/use_power(amount, charging=0)
|
||||
if(ismachinery(holder.physical))
|
||||
var/obj/machinery/M = holder.physical
|
||||
if(M.powered())
|
||||
M.use_power(amount)
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
else
|
||||
var/area/A = get_area(src)
|
||||
if(!istype(A))
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
if(A.powered(EQUIP))
|
||||
A.use_power(amount, EQUIP)
|
||||
return 1
|
||||
return 0
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/item/computer_hardware/recharger/wired
|
||||
name = "wired power connector"
|
||||
@@ -56,27 +56,34 @@
|
||||
if(ismachinery(M.physical) && M.physical.anchored)
|
||||
return ..()
|
||||
to_chat(user, "<span class='warning'>\The [src] is incompatible with portable computers!</span>")
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
/obj/item/computer_hardware/recharger/wired/use_power(amount, charging=0)
|
||||
if(ismachinery(holder.physical) && holder.physical.anchored)
|
||||
var/obj/machinery/M = holder.physical
|
||||
var/turf/T = M.loc
|
||||
if(!T || !istype(T))
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
var/obj/structure/cable/C = T.get_cable_node()
|
||||
if(!C || !C.powernet)
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
var/power_in_net = C.powernet.avail-C.powernet.load
|
||||
|
||||
if(power_in_net && power_in_net > amount)
|
||||
C.powernet.load += amount
|
||||
return 1
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
return 0
|
||||
/// This recharger exists only in borg built-in tablets. I would have tied it to the borg's cell but
|
||||
/// the program that displays laws should always be usable, and the exceptions were starting to pile.
|
||||
/obj/item/computer_hardware/recharger/cyborg
|
||||
name = "modular interface power harness"
|
||||
desc = "A standard connection to power a small computer device from a cyborg's chassis."
|
||||
|
||||
/obj/item/computer_hardware/recharger/cyborg/use_power(amount, charging=0)
|
||||
return TRUE
|
||||
|
||||
|
||||
// This is not intended to be obtainable in-game. Intended for adminbus and debugging purposes.
|
||||
|
||||
Reference in New Issue
Block a user