mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Update
- Creates a global list of items which have pwr_drain() called every powernet tick - Makes powersink use this list - Adds scheck
This commit is contained in:
@@ -22,8 +22,11 @@
|
|||||||
|
|
||||||
powernets.Remove(powerNetwork)
|
powernets.Remove(powerNetwork)
|
||||||
|
|
||||||
for(var/obj/item/device/powersink/S in processing_objects)
|
// Currently only used by powersinks. These items get priority processed before machinery
|
||||||
S.drain()
|
for(var/obj/item/I in processing_power_items)
|
||||||
|
if(!I.pwr_drain()) // 0 = Process Kill, remove from processing list.
|
||||||
|
processing_power_items.Remove(I)
|
||||||
|
scheck()
|
||||||
|
|
||||||
for(var/obj/machinery/M in machines)
|
for(var/obj/machinery/M in machines)
|
||||||
if(M && !M.gcDestroyed)
|
if(M && !M.gcDestroyed)
|
||||||
|
|||||||
@@ -599,4 +599,7 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
|
|||||||
if(!cannotzoom)
|
if(!cannotzoom)
|
||||||
usr.visible_message("[zoomdevicename ? "[usr] looks up from the [src.name]" : "[usr] lowers the [src.name]"].")
|
usr.visible_message("[zoomdevicename ? "[usr] looks up from the [src.name]" : "[usr] lowers the [src.name]"].")
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
/obj/item/proc/pwr_drain()
|
||||||
|
return 0 // Process Kill
|
||||||
@@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
/obj/item/device/powersink/Destroy()
|
/obj/item/device/powersink/Destroy()
|
||||||
processing_objects.Remove(src)
|
processing_objects.Remove(src)
|
||||||
|
processing_power_items.Remove(src)
|
||||||
..()
|
..()
|
||||||
|
|
||||||
/obj/item/device/powersink/attackby(var/obj/item/I, var/mob/user)
|
/obj/item/device/powersink/attackby(var/obj/item/I, var/mob/user)
|
||||||
@@ -49,6 +50,7 @@
|
|||||||
else
|
else
|
||||||
if (mode == 2)
|
if (mode == 2)
|
||||||
processing_objects.Remove(src) // Now the power sink actually stops draining the station's power if you unhook it. --NeoFite
|
processing_objects.Remove(src) // Now the power sink actually stops draining the station's power if you unhook it. --NeoFite
|
||||||
|
processing_power_items.Remove(src)
|
||||||
anchored = 0
|
anchored = 0
|
||||||
mode = 0
|
mode = 0
|
||||||
src.visible_message("<span class='notice'>[user] detaches [src] from the cable!</span>")
|
src.visible_message("<span class='notice'>[user] detaches [src] from the cable!</span>")
|
||||||
@@ -71,25 +73,27 @@
|
|||||||
mode = 2
|
mode = 2
|
||||||
icon_state = "powersink1"
|
icon_state = "powersink1"
|
||||||
processing_objects.Add(src)
|
processing_objects.Add(src)
|
||||||
|
processing_power_items.Add(src)
|
||||||
if(2) //This switch option wasn't originally included. It exists now. --NeoFite
|
if(2) //This switch option wasn't originally included. It exists now. --NeoFite
|
||||||
src.visible_message("<span class='notice'>[user] deactivates [src]!</span>")
|
src.visible_message("<span class='notice'>[user] deactivates [src]!</span>")
|
||||||
mode = 1
|
mode = 1
|
||||||
set_light(0)
|
set_light(0)
|
||||||
icon_state = "powersink0"
|
icon_state = "powersink0"
|
||||||
processing_objects.Remove(src)
|
processing_objects.Remove(src)
|
||||||
|
processing_power_items.Remove(src)
|
||||||
|
|
||||||
/obj/item/device/powersink/proc/drain()
|
/obj/item/device/powersink/pwr_drain()
|
||||||
if(!attached)
|
if(!attached)
|
||||||
return
|
return 0
|
||||||
|
|
||||||
if(drained_this_tick)
|
if(drained_this_tick)
|
||||||
return
|
return 1
|
||||||
drained_this_tick = 1
|
drained_this_tick = 1
|
||||||
|
|
||||||
var/drained = 0
|
var/drained = 0
|
||||||
|
|
||||||
if(!PN)
|
if(!PN)
|
||||||
return
|
return 1
|
||||||
|
|
||||||
set_light(12)
|
set_light(12)
|
||||||
PN.trigger_warning()
|
PN.trigger_warning()
|
||||||
@@ -110,6 +114,7 @@
|
|||||||
A.cell.use(drain_val * CELLRATE)
|
A.cell.use(drain_val * CELLRATE)
|
||||||
drained += drain_val
|
drained += drain_val
|
||||||
power_drained += drained
|
power_drained += drained
|
||||||
|
return 1
|
||||||
|
|
||||||
|
|
||||||
/obj/item/device/powersink/process()
|
/obj/item/device/powersink/process()
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ var/global/obj/effect/datacore/data_core = null
|
|||||||
var/global/list/all_areas = list()
|
var/global/list/all_areas = list()
|
||||||
var/global/list/machines = list()
|
var/global/list/machines = list()
|
||||||
var/global/list/processing_objects = list()
|
var/global/list/processing_objects = list()
|
||||||
|
var/global/list/processing_power_items = list()
|
||||||
var/global/list/active_diseases = list()
|
var/global/list/active_diseases = list()
|
||||||
var/global/list/med_hud_users = list() // List of all entities using a medical HUD.
|
var/global/list/med_hud_users = list() // List of all entities using a medical HUD.
|
||||||
var/global/list/sec_hud_users = list() // List of all entities using a security HUD.
|
var/global/list/sec_hud_users = list() // List of all entities using a security HUD.
|
||||||
|
|||||||
Reference in New Issue
Block a user