diff --git a/code/controllers/subsystem/fastprocess.dm b/code/controllers/subsystem/fastprocess.dm new file mode 100644 index 00000000000..021891661aa --- /dev/null +++ b/code/controllers/subsystem/fastprocess.dm @@ -0,0 +1,36 @@ +var/datum/subsystem/fastprocess/SSfastprocess + +/datum/subsystem/fastprocess + name = "Fast Process" + priority = -1 + wait = 1 + dynamic_wait = 1 + dwait_upper = 300 + dwait_lower = 1 + dwait_delta = 7 + + var/list/processing = list() + var/list/currentrun = list() + +/datum/subsystem/fastprocess/New() + NEW_SS_GLOBAL(SSfastprocess) + +/datum/subsystem/fastprocess/stat_entry() + ..("FP:[processing.len]") + + +/datum/subsystem/fastprocess/fire(resumed = 0) + if (!resumed) + src.currentrun = processing.Copy() + //cache for sanic speed (lists are references anyways) + var/list/currentrun = src.currentrun + + while(currentrun.len) + var/datum/thing = currentrun[1] + currentrun.Cut(1, 2) + if(thing) + thing.process(wait) + else + SSobj.processing.Remove(thing) + if (MC_TICK_CHECK) + return diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index a316b84ea61..0e209bbc190 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -117,16 +117,23 @@ Class Procs: var/unsecuring_tool = /obj/item/weapon/wrench var/interact_open = 0 // Can the machine be interacted with when in maint/when the panel is open. var/interact_offline = 0 // Can the machine be interacted with while de-powered. + var/speed_process = 0 // Process as fast as possible? /obj/machinery/New() ..() machines += src - SSmachine.processing += src + if(!speed_process) + SSmachine.processing += src + else + SSfastprocess.processing += src power_change() /obj/machinery/Destroy() machines.Remove(src) - SSmachine.processing -= src + if(!speed_process) + SSmachine.processing -= src + else + SSfastprocess.processing -= src dropContents() return ..() diff --git a/code/game/objects/effects/effect_system/effects_foam.dm b/code/game/objects/effects/effect_system/effects_foam.dm index 91b9c1ecd36..25b1a307cdb 100644 --- a/code/game/objects/effects/effect_system/effects_foam.dm +++ b/code/game/objects/effects/effect_system/effects_foam.dm @@ -29,16 +29,16 @@ /obj/effect/particle_effect/foam/New(loc) ..(loc) create_reagents(1000) //limited by the size of the reagent holder anyway. - SSobj.processing |= src + SSfastprocess.processing |= src playsound(src, 'sound/effects/bubbles2.ogg', 80, 1, -3) /obj/effect/particle_effect/foam/Destroy() - SSobj.processing.Remove(src) + SSfastprocess.processing.Remove(src) return ..() /obj/effect/particle_effect/foam/proc/kill_foam() - SSobj.processing.Remove(src) + SSfastprocess.processing.Remove(src) if(metal) var/obj/structure/foamedmetal/M = new(src.loc) M.metal = metal diff --git a/code/game/objects/items/weapons/grenades/clusterbuster.dm b/code/game/objects/items/weapons/grenades/clusterbuster.dm index d75fc7b7db1..4c37eb05a0d 100644 --- a/code/game/objects/items/weapons/grenades/clusterbuster.dm +++ b/code/game/objects/items/weapons/grenades/clusterbuster.dm @@ -124,3 +124,7 @@ /obj/item/weapon/grenade/clusterbuster/soap name = "Slipocalypse" payload = /obj/item/weapon/grenade/spawnergrenade/syndiesoap + +/obj/item/weapon/grenade/clusterbuster/clf3 + name = "WELCOME TO HELL" + payload = /obj/item/weapon/grenade/chem_grenade/clf3 \ No newline at end of file diff --git a/code/modules/mining/equipment_locker.dm b/code/modules/mining/equipment_locker.dm index 491f18d616a..f64ef5d7411 100644 --- a/code/modules/mining/equipment_locker.dm +++ b/code/modules/mining/equipment_locker.dm @@ -20,6 +20,7 @@ var/sheet_per_ore = 1 var/point_upgrade = 1 var/list/ore_values = list(("sand" = 1), ("iron" = 1), ("plasma" = 15), ("silver" = 16), ("gold" = 18), ("uranium" = 30), ("diamond" = 50), ("bananium" = 60)) + speed_process = 1 /obj/machinery/mineral/ore_redemption/New() ..() diff --git a/code/modules/mining/machine_processing.dm b/code/modules/mining/machine_processing.dm index 2274a61b20b..43e0b8cac4d 100644 --- a/code/modules/mining/machine_processing.dm +++ b/code/modules/mining/machine_processing.dm @@ -8,6 +8,7 @@ anchored = 1 var/obj/machinery/mineral/processing_unit/machine = null var/machinedir = EAST + speed_process = 1 /obj/machinery/mineral/processing_unit_console/New() ..() diff --git a/code/modules/mining/machine_stacking.dm b/code/modules/mining/machine_stacking.dm index 37ce43abc46..9d63e3de4de 100644 --- a/code/modules/mining/machine_stacking.dm +++ b/code/modules/mining/machine_stacking.dm @@ -8,6 +8,7 @@ anchored = 1 var/obj/machinery/mineral/stacking_machine/machine = null var/machinedir = SOUTHEAST + speed_process = 1 /obj/machinery/mineral/stacking_unit_console/New() ..() diff --git a/code/modules/mining/machine_unloading.dm b/code/modules/mining/machine_unloading.dm index 4c86526f01d..becb4624805 100644 --- a/code/modules/mining/machine_unloading.dm +++ b/code/modules/mining/machine_unloading.dm @@ -9,6 +9,7 @@ anchored = 1 input_dir = WEST output_dir = EAST + speed_process = 1 /obj/machinery/mineral/unloading_machine/process() var/turf/T = get_step(src,input_dir) @@ -21,8 +22,11 @@ limit++ if (limit>=10) return + CHECK_TICK + CHECK_TICK for(var/obj/item/I in T) unload_mineral(I) limit++ if (limit>=10) - return \ No newline at end of file + return + CHECK_TICK \ No newline at end of file diff --git a/code/modules/mining/mint.dm b/code/modules/mining/mint.dm index 3caefd09573..6da4c611b2a 100644 --- a/code/modules/mining/mint.dm +++ b/code/modules/mining/mint.dm @@ -20,6 +20,7 @@ var/processing = 0 var/chosen = "metal" //which material will be used to make coins var/coinsToProduce = 10 + speed_process = 1 /obj/machinery/mineral/mint/process() var/turf/T = get_step(src,input_dir) diff --git a/code/modules/recycling/conveyor2.dm b/code/modules/recycling/conveyor2.dm index 98c99e77274..b8cc961621f 100644 --- a/code/modules/recycling/conveyor2.dm +++ b/code/modules/recycling/conveyor2.dm @@ -16,6 +16,7 @@ var/list/affecting // the list of all items that will be moved this ptick var/id = "" // the control ID - must match controller ID var/verted = 1 // set to -1 to have the conveyour belt be inverted, so you can use the other corner icons + speed_process = 1 /obj/machinery/conveyor/centcom_auto id = "round_end_belt" @@ -105,15 +106,12 @@ use_power(100) affecting = loc.contents - src // moved items will be all in loc - sleep(1) // slight delay to prevent infinite propagation due to map order - var/items_moved = 0 + sleep(1) for(var/atom/movable/A in affecting) if(!A.anchored) if(A.loc == src.loc) // prevents the object from being affected if it's not currently here. step(A,movedir) - items_moved++ - if(items_moved >= 10) - break + CHECK_TICK // attack with item, place item on conveyor /obj/machinery/conveyor/attackby(obj/item/I, mob/user, params) @@ -125,7 +123,7 @@ user << "You remove the conveyor belt." qdel(src) return - if(istype(I, /obj/item/weapon/wrench)) + if(istype(I, /obj/item/weapon/wrench)) if(!(stat & BROKEN)) playsound(loc, 'sound/items/Ratchet.ogg', 50, 1) dir = turn(dir,-45) @@ -203,6 +201,7 @@ var/list/conveyors // the list of converyors that are controlled by this switch anchored = 1 + speed_process = 1 @@ -240,6 +239,7 @@ for(var/obj/machinery/conveyor/C in conveyors) C.operating = position C.update_move_direction() + CHECK_TICK // attack with hand, switch position /obj/machinery/conveyor_switch/attack_hand(mob/user) @@ -266,6 +266,7 @@ if(S.id == src.id) S.position = position S.update() + CHECK_TICK /obj/machinery/conveyor_switch/attackby(obj/item/I, mob/user, params) if(istype(I, /obj/item/weapon/crowbar)) diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index d416f60b429..77e9d350cd3 100644 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -8,7 +8,6 @@ var/giftwrapped = 0 var/sortTag = 0 - /obj/structure/bigDelivery/attack_hand(mob/user) playsound(src.loc, 'sound/items/poster_ripped.ogg', 50, 1) qdel(src) diff --git a/tgstation.dme b/tgstation.dme index 6d912111be7..cc6bf447bb2 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -127,6 +127,7 @@ #include "code\controllers\subsystem\assets.dm" #include "code\controllers\subsystem\diseases.dm" #include "code\controllers\subsystem\events.dm" +#include "code\controllers\subsystem\fastprocess.dm" #include "code\controllers\subsystem\garbage.dm" #include "code\controllers\subsystem\icon_smooth.dm" #include "code\controllers\subsystem\jobs.dm"