mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-17 18:13:34 +01:00
Battery ETA
This commit is contained in:
@@ -191,7 +191,7 @@
|
||||
icon_state = icon_state_unpowered
|
||||
else
|
||||
icon_state = icon_state_powered
|
||||
if(active_program)
|
||||
if(active_program && active_program.program_state != PROGRAM_STATE_KILLED)
|
||||
overlays += active_program.program_icon_state ? active_program.program_icon_state : icon_state_menu
|
||||
else
|
||||
overlays += icon_state_menu
|
||||
|
||||
@@ -56,6 +56,18 @@
|
||||
power_failure()
|
||||
return FALSE
|
||||
|
||||
/obj/item/device/modular_computer/proc/get_power_eta()
|
||||
var/obj/item/weapon/computer_hardware/battery/battery_module = all_components[MC_CELL]
|
||||
if(battery_module && battery_module.battery)
|
||||
var/hours = 0
|
||||
var/minutes = (battery_module.battery.charge) / (last_power_usage / 20) // 20 = obj processing interval
|
||||
if(minutes > 60)
|
||||
hours = minutes/60
|
||||
minutes = (hours - round(hours)) * 60
|
||||
var/seconds = (minutes - round(minutes)) * 60
|
||||
return list("hours" = hours, "minutes" = minutes, "seconds" = seconds)
|
||||
return list()
|
||||
|
||||
// Used by child types if they have other power source than battery or recharger
|
||||
/obj/item/device/modular_computer/proc/check_power_override()
|
||||
return FALSE
|
||||
|
||||
Reference in New Issue
Block a user