mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 20:48:56 +01:00
[MIRROR] Process procs now properly utilize deltatime when implementing rates, timers and probabilities (#709)
* 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 * Process procs now properly utilize deltatime when implementing rates, timers and probabilities Co-authored-by: Donkie <daniel.cf.hultgren@gmail.com>
This commit is contained in:
@@ -74,7 +74,7 @@
|
||||
|
||||
var/emitterhealth = 20
|
||||
var/emittermaxhealth = 20
|
||||
var/emitterregen = 0.25
|
||||
var/emitterregen = 0.125
|
||||
var/emittercd = 50
|
||||
var/emitteroverloadcd = 100
|
||||
var/emittersemicd = FALSE
|
||||
@@ -312,8 +312,8 @@
|
||||
set_health(maxHealth - getBruteLoss() - getFireLoss())
|
||||
update_stat()
|
||||
|
||||
/mob/living/silicon/pai/process()
|
||||
emitterhealth = clamp((emitterhealth + emitterregen), -50, emittermaxhealth)
|
||||
/mob/living/silicon/pai/process(delta_time)
|
||||
emitterhealth = clamp((emitterhealth + emitterregen * delta_time), -50, emittermaxhealth)
|
||||
|
||||
/obj/item/paicard/attackby(obj/item/W, mob/user, params)
|
||||
if(pai && (istype(W, /obj/item/encryptionkey) || W.tool_behaviour == TOOL_SCREWDRIVER))
|
||||
|
||||
@@ -342,7 +342,7 @@
|
||||
T.cell.give(S.e_cost * coeff)
|
||||
T.update_icon()
|
||||
else
|
||||
T.charge_tick = 0
|
||||
T.charge_timer = 0
|
||||
|
||||
/obj/item/robot_module/peacekeeper
|
||||
name = "Peacekeeper"
|
||||
|
||||
@@ -386,10 +386,10 @@
|
||||
START_PROCESSING(SSobj, E)
|
||||
|
||||
/obj/item/reagent_containers/food/snacks/egg/var/amount_grown = 0
|
||||
/obj/item/reagent_containers/food/snacks/egg/process()
|
||||
/obj/item/reagent_containers/food/snacks/egg/process(delta_time)
|
||||
if(isturf(loc))
|
||||
amount_grown += rand(1,2)
|
||||
if(amount_grown >= 100)
|
||||
amount_grown += rand(1,2) * delta_time
|
||||
if(amount_grown >= 200)
|
||||
visible_message("<span class='notice'>[src] hatches with a quiet cracking sound.</span>")
|
||||
new /mob/living/simple_animal/chick(get_turf(src))
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
|
||||
@@ -176,11 +176,11 @@ While using this makes the system rely on OnFire, it still gives options for tim
|
||||
activator = null
|
||||
return ..()
|
||||
|
||||
/obj/structure/elite_tumor/process()
|
||||
/obj/structure/elite_tumor/process(delta_time)
|
||||
if(isturf(loc))
|
||||
for(var/mob/living/simple_animal/hostile/asteroid/elite/elitehere in loc)
|
||||
if(elitehere == mychild && activity == TUMOR_PASSIVE)
|
||||
mychild.adjustHealth(-mychild.maxHealth*0.05)
|
||||
mychild.adjustHealth(-mychild.maxHealth*0.025*delta_time)
|
||||
var/obj/effect/temp_visual/heal/H = new /obj/effect/temp_visual/heal(get_turf(mychild))
|
||||
H.color = "#FF0000"
|
||||
|
||||
|
||||
@@ -193,11 +193,11 @@
|
||||
"<span class='userdanger'>Touching the portal, you are quickly pulled through into a world of unimaginable horror!</span>")
|
||||
contents.Add(user)
|
||||
|
||||
/obj/structure/spawner/nether/process()
|
||||
/obj/structure/spawner/nether/process(delta_time)
|
||||
for(var/mob/living/M in contents)
|
||||
if(M)
|
||||
playsound(src, 'sound/magic/demon_consume.ogg', 50, TRUE)
|
||||
M.adjustBruteLoss(60)
|
||||
M.adjustBruteLoss(60 * delta_time)
|
||||
new /obj/effect/gibspawner/generic(get_turf(M), M)
|
||||
if(M.stat == DEAD)
|
||||
var/mob/living/simple_animal/hostile/netherworld/blankbody/blank
|
||||
|
||||
@@ -428,7 +428,7 @@
|
||||
/// The amount of time the rift has charged for.
|
||||
var/time_charged = 0
|
||||
/// The maximum charge the rift can have. It actually goes to max_charge + 1, as to prevent constantly retriggering the effects on full charge.
|
||||
var/max_charge = 240
|
||||
var/max_charge = 480
|
||||
/// How many carp spawns it has available.
|
||||
var/carp_stored = 0
|
||||
/// A reference to the Space Dragon that created it.
|
||||
@@ -453,12 +453,12 @@
|
||||
playsound(src, 'sound/vehicles/rocketlaunch.ogg', 100, TRUE)
|
||||
return ..()
|
||||
|
||||
/obj/structure/carp_rift/process()
|
||||
time_charged = min(time_charged + 1, max_charge + 1)
|
||||
/obj/structure/carp_rift/process(delta_time)
|
||||
time_charged = min(time_charged + delta_time, max_charge + 1)
|
||||
update_check()
|
||||
for(var/mob/living/simple_animal/hostile/hostilehere in loc)
|
||||
if("carp" in hostilehere.faction)
|
||||
hostilehere.adjustHealth(-10)
|
||||
hostilehere.adjustHealth(-5 * delta_time)
|
||||
var/obj/effect/temp_visual/heal/H = new /obj/effect/temp_visual/heal(get_turf(hostilehere))
|
||||
H.color = "#0000FF"
|
||||
if(time_charged < max_charge)
|
||||
@@ -470,8 +470,7 @@
|
||||
icon_state = "carp_rift_carpspawn"
|
||||
light_color = LIGHT_COLOR_PURPLE
|
||||
else
|
||||
var/spawncarp = rand(1,40)
|
||||
if(spawncarp == 1)
|
||||
if(DT_PROB(1.25, delta_time))
|
||||
new /mob/living/simple_animal/hostile/carp(loc)
|
||||
|
||||
/obj/structure/carp_rift/attack_ghost(mob/user)
|
||||
|
||||
Reference in New Issue
Block a user