mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-18 11:36:24 +01:00
Process procs now properly utilize deltatime when implementing rates, timers and probabilities (#52981)
* Process procs now properly use deltatime when implementing rates, timers and probabilities * Review fixes * Geiger counters cleanup Made hardsuit geiger code more similar to geiger counter code Geiger counters are more responsive now * Moved SS*_DT defines to subsystems.dm * Rebase fix * Redefined the SS*_DT defines to use the subsystem wait vars * Implemented suggested changes by @AnturK * Commented /datum/proc/process about the deltatime stuff * Send delta_time as a process parameter instead of the defines Also DTfied acid_processing * Dtfied new acid component
This commit is contained in:
@@ -69,11 +69,11 @@
|
||||
armor = list(MELEE = 70, BULLET = 40, LASER = 10, ENERGY = 20, BOMB = 50, BIO = 100, RAD = 100, FIRE = 100, ACID = 100)
|
||||
allowed = list(/obj/item/flashlight, /obj/item/tank/internals, /obj/item/resonator, /obj/item/mining_scanner, /obj/item/t_scanner/adv_mining_scanner, /obj/item/gun/energy/kinetic_accelerator, /obj/item/pickaxe)
|
||||
|
||||
/obj/item/clothing/suit/space/hostile_environment/process()
|
||||
/obj/item/clothing/suit/space/hostile_environment/process(delta_time)
|
||||
. = ..()
|
||||
var/mob/living/carbon/C = loc
|
||||
if(istype(C) && prob(2)) //cursed by bubblegum
|
||||
if(prob(15))
|
||||
if(istype(C) && DT_PROB(1, delta_time)) //cursed by bubblegum
|
||||
if(DT_PROB(7.5, delta_time))
|
||||
new /datum/hallucination/oh_yeah(C)
|
||||
to_chat(C, "<span class='colossus'><b>[pick("I AM IMMORTAL.","I SHALL TAKE BACK WHAT'S MINE.","I SEE YOU.","YOU CANNOT ESCAPE ME FOREVER.","DEATH CANNOT HOLD ME.")]</b></span>")
|
||||
else
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#define SMELT_AMOUNT 10
|
||||
/// Smelt amount per second
|
||||
#define SMELT_AMOUNT 5
|
||||
|
||||
/**********************Mineral processing unit console**************************/
|
||||
|
||||
@@ -194,13 +195,13 @@
|
||||
if(istype(target, /obj/item/stack/ore))
|
||||
process_ore(target)
|
||||
|
||||
/obj/machinery/mineral/processing_unit/process()
|
||||
/obj/machinery/mineral/processing_unit/process(delta_time)
|
||||
if(on)
|
||||
if(selected_material)
|
||||
smelt_ore()
|
||||
smelt_ore(delta_time)
|
||||
|
||||
else if(selected_alloy)
|
||||
smelt_alloy()
|
||||
smelt_alloy(delta_time)
|
||||
|
||||
|
||||
if(CONSOLE)
|
||||
@@ -208,11 +209,11 @@
|
||||
else
|
||||
end_processing()
|
||||
|
||||
/obj/machinery/mineral/processing_unit/proc/smelt_ore()
|
||||
/obj/machinery/mineral/processing_unit/proc/smelt_ore(delta_time = 2)
|
||||
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
|
||||
var/datum/material/mat = selected_material
|
||||
if(mat)
|
||||
var/sheets_to_remove = (materials.materials[mat] >= (MINERAL_MATERIAL_AMOUNT * SMELT_AMOUNT) ) ? SMELT_AMOUNT : round(materials.materials[mat] / MINERAL_MATERIAL_AMOUNT)
|
||||
var/sheets_to_remove = (materials.materials[mat] >= (MINERAL_MATERIAL_AMOUNT * SMELT_AMOUNT * delta_time) ) ? SMELT_AMOUNT * delta_time : round(materials.materials[mat] / MINERAL_MATERIAL_AMOUNT)
|
||||
if(!sheets_to_remove)
|
||||
on = FALSE
|
||||
else
|
||||
@@ -220,13 +221,13 @@
|
||||
materials.retrieve_sheets(sheets_to_remove, mat, out)
|
||||
|
||||
|
||||
/obj/machinery/mineral/processing_unit/proc/smelt_alloy()
|
||||
/obj/machinery/mineral/processing_unit/proc/smelt_alloy(delta_time = 2)
|
||||
var/datum/design/alloy = stored_research.isDesignResearchedID(selected_alloy) //check if it's a valid design
|
||||
if(!alloy)
|
||||
on = FALSE
|
||||
return
|
||||
|
||||
var/amount = can_smelt(alloy)
|
||||
var/amount = can_smelt(alloy, delta_time)
|
||||
|
||||
if(!amount)
|
||||
on = FALSE
|
||||
@@ -237,11 +238,11 @@
|
||||
|
||||
generate_mineral(alloy.build_path)
|
||||
|
||||
/obj/machinery/mineral/processing_unit/proc/can_smelt(datum/design/D)
|
||||
/obj/machinery/mineral/processing_unit/proc/can_smelt(datum/design/D, delta_time = 2)
|
||||
if(D.make_reagents.len)
|
||||
return FALSE
|
||||
|
||||
var/build_amount = SMELT_AMOUNT
|
||||
var/build_amount = SMELT_AMOUNT * delta_time
|
||||
|
||||
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user