From c68345cf64cbcf1c4abe64a4ebc6dec5b7a07fcd Mon Sep 17 00:00:00 2001
From: PowerfulBacon <26465327+PowerfulBacon@users.noreply.github.com>
Date: Mon, 3 Jun 2024 01:26:30 +0100
Subject: [PATCH 1/3] Simple fires
---
beestation.dme | 2 +
code/__HELPERS/heap.dm | 16 ++-
code/__HELPERS/path.dm | 2 +-
.../subsystem/async_map_generator.dm | 1 +
code/controllers/subsystem/enumeration.dm | 1 +
code/controllers/subsystem/explosion.dm | 2 +-
.../subsystem/processing/effects.dm | 32 ++++++
code/datums/components/chasm.dm | 1 +
.../diseases/advance/symptoms/necropolis.dm | 3 +-
code/datums/status_effects/debuffs.dm | 8 +-
.../effects/decals/cleanable/robots.dm | 2 +-
.../effects/effect_system/effects_foam.dm | 5 +
.../effects/effect_system/effects_smoke.dm | 2 +
code/game/objects/effects/simple_fire.dm | 105 ++++++++++++++++++
.../temporary_visuals/temporary_visual.dm | 16 ++-
code/game/objects/structures/traps.dm | 2 +-
.../blob/blobstrains/blazing_oil.dm | 2 +-
code/modules/antagonists/cult/runes.dm | 2 +-
.../heretic/magic/ash_ascension.dm | 6 +-
.../food_and_drinks/drinks/drinks/bottle.dm | 2 +-
code/modules/mining/equipment/resonator.dm | 2 -
.../simple_animal/hostile/megafauna/drake.dm | 4 +-
.../mining_mobs/elites/goliath_broodmother.dm | 3 +-
.../hostile/mining_mobs/goliath.dm | 12 +-
.../simple_animal/hostile/space_dragon.dm | 2 +-
.../projectiles/guns/misc/beam_rifle.dm | 2 +-
.../projectile/bullets/_incendiary.dm | 2 +-
.../chemistry/reagents/food_reagents.dm | 2 +
.../chemistry/reagents/other_reagents.dm | 2 +
.../reagents/pyrotechnic_reagents.dm | 8 +-
.../chemistry/recipes/pyrotechnics.dm | 6 +-
.../xenobiology/crossbreeding/charged.dm | 3 +-
.../xenobiology/crossbreeding/chilling.dm | 3 +-
.../xenobiology/crossbreeding/regenerative.dm | 3 +-
34 files changed, 210 insertions(+), 56 deletions(-)
create mode 100644 code/controllers/subsystem/processing/effects.dm
create mode 100644 code/game/objects/effects/simple_fire.dm
diff --git a/beestation.dme b/beestation.dme
index e2e970ee39cbb..784fb6a0563b4 100644
--- a/beestation.dme
+++ b/beestation.dme
@@ -489,6 +489,7 @@
#include "code\controllers\subsystem\processing\ai_controllers.dm"
#include "code\controllers\subsystem\processing\clock_component.dm"
#include "code\controllers\subsystem\processing\digital_clock.dm"
+#include "code\controllers\subsystem\processing\effects.dm"
#include "code\controllers\subsystem\processing\fastprocess.dm"
#include "code\controllers\subsystem\processing\fields.dm"
#include "code\controllers\subsystem\processing\fluids.dm"
@@ -1223,6 +1224,7 @@
#include "code\game\objects\effects\overlays.dm"
#include "code\game\objects\effects\portals.dm"
#include "code\game\objects\effects\proximity.dm"
+#include "code\game\objects\effects\simple_fire.dm"
#include "code\game\objects\effects\spiders.dm"
#include "code\game\objects\effects\step_triggers.dm"
#include "code\game\objects\effects\wanted_poster.dm"
diff --git a/code/__HELPERS/heap.dm b/code/__HELPERS/heap.dm
index c860b2013ca78..0a80c843ab3e8 100644
--- a/code/__HELPERS/heap.dm
+++ b/code/__HELPERS/heap.dm
@@ -23,7 +23,7 @@
/datum/heap/proc/insert(atom/A)
L.Add(A)
- swim(length(L))
+ return swim(length(L))
//removes and returns the first element of the heap
//(i.e the max or the min dependant on the comparison function)
@@ -37,6 +37,19 @@
if(length(L))
sink(1)
+/datum/heap/proc/delete_at(index)
+ if (index <= 0)
+ CRASH("Attempted to delete from heap where index is less than 0. This is an error.")
+ if (index > length(L))
+ CRASH("Attempted to delete from a heap outside of the bounds of the heap.")
+ var/deleted = L[index]
+ L.Swap(index, length(L))
+ L.len--
+ // Edge case where we remove the sole element of the heap
+ if (index <= L.len)
+ swim(index)
+ return deleted
+
//Get a node up to its right position in the heap
/datum/heap/proc/swim(index)
var/parent = round(index * 0.5)
@@ -45,6 +58,7 @@
L.Swap(index,parent)
index = parent
parent = round(index * 0.5)
+ return index
//Get a node down to its right position in the heap
/datum/heap/proc/sink(index)
diff --git a/code/__HELPERS/path.dm b/code/__HELPERS/path.dm
index 3c6eae7e2b012..22de777928c9d 100644
--- a/code/__HELPERS/path.dm
+++ b/code/__HELPERS/path.dm
@@ -124,7 +124,7 @@
/datum/pathfind/New(atom/movable/caller, atom/goal, id, max_distance, mintargetdist, simulated_only, avoid, avoid_mobs)
src.caller = caller
end = get_turf(goal)
- open = new /datum/heap(/proc/HeapPathWeightCompare)
+ open = new /datum/heap(GLOBAL_PROC_REF(HeapPathWeightCompare))
sources = new()
src.id = id
src.max_distance = max_distance
diff --git a/code/controllers/subsystem/async_map_generator.dm b/code/controllers/subsystem/async_map_generator.dm
index b080a226c92b5..5ec0f50cbef65 100644
--- a/code/controllers/subsystem/async_map_generator.dm
+++ b/code/controllers/subsystem/async_map_generator.dm
@@ -28,6 +28,7 @@ SUBSYSTEM_DEF(async_map_generator)
current_run_length = length(executing_generators)
//Split the tick
MC_SPLIT_TICK_INIT(current_run_length)
+ MC_SPLIT_TICK
//Start processing
while (current_run_index <= current_run_length)
//Get current action
diff --git a/code/controllers/subsystem/enumeration.dm b/code/controllers/subsystem/enumeration.dm
index f4088c4e17246..5a6383f3bdd69 100644
--- a/code/controllers/subsystem/enumeration.dm
+++ b/code/controllers/subsystem/enumeration.dm
@@ -15,6 +15,7 @@ SUBSYSTEM_DEF(enumeration)
/datum/controller/subsystem/enumeration/fire()
MC_SPLIT_TICK_INIT(length(tick_enumerations))
+ MC_SPLIT_TICK
//No need to copy the list, so use indexing enumeration isntead
//Go backwards to prevent concurrent modification issues
for (var/i in length(tick_enumerations) to 1 step -1)
diff --git a/code/controllers/subsystem/explosion.dm b/code/controllers/subsystem/explosion.dm
index b3aefebebff7e..5f192ed55997e 100644
--- a/code/controllers/subsystem/explosion.dm
+++ b/code/controllers/subsystem/explosion.dm
@@ -555,7 +555,7 @@ SUBSYSTEM_DEF(explosions)
for(var/thing in flame_turf)
if(thing)
var/turf/T = thing
- new /obj/effect/hotspot(T) //Mostly for ambience!
+ new /obj/effect/simple_fire(T) //Mostly for ambience!
cost_flameturf = MC_AVERAGE(cost_flameturf, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))
if (low_turf.len || med_turf.len || high_turf.len)
diff --git a/code/controllers/subsystem/processing/effects.dm b/code/controllers/subsystem/processing/effects.dm
new file mode 100644
index 0000000000000..8bba96e4be2c1
--- /dev/null
+++ b/code/controllers/subsystem/processing/effects.dm
@@ -0,0 +1,32 @@
+PROCESSING_SUBSYSTEM_DEF(effects)
+ name = "Effects"
+ wait = 0.2 SECONDS
+ stat_tag = "EFF"
+ var/datum/heap/destroy_heap = new /datum/heap(GLOBAL_PROC_REF(HeapEffectDestroyAtCompare))
+
+/datum/controller/subsystem/processing/effects/fire(resumed)
+ MC_SPLIT_TICK_INIT(2)
+ MC_SPLIT_TICK
+ var/obj/effect/temp_visual/top_visual = destroy_heap.pop()
+ while (istype(top_visual))
+ if (top_visual.destroy_at > world.time)
+ // Re-enter the queue if we were bumped
+ if (top_visual.bumped)
+ destroy_heap.insert(top_visual)
+ continue
+ break
+ qdel(top_visual)
+ top_visual = destroy_heap.pop()
+ MC_SPLIT_TICK
+ return ..()
+
+/datum/controller/subsystem/processing/effects/proc/join_temp_visual(obj/effect/temp_visual/visual)
+ visual.heap_position = destroy_heap.insert(visual)
+
+/datum/controller/subsystem/processing/effects/proc/leave_temp_visual(obj/effect/temp_visual/visual)
+ if (visual.heap_position)
+ destroy_heap.delete_at(visual.heap_position)
+ visual.heap_position = null
+
+/proc/HeapEffectDestroyAtCompare(obj/effect/temp_visual/a, obj/effect/temp_visual/b)
+ return b.destroy_at - a.destroy_at
diff --git a/code/datums/components/chasm.dm b/code/datums/components/chasm.dm
index 2838e70c19450..8dc686cf2f41c 100644
--- a/code/datums/components/chasm.dm
+++ b/code/datums/components/chasm.dm
@@ -17,6 +17,7 @@
/obj/effect/portal,
/obj/effect/abstract,
/obj/effect/hotspot,
+ /obj/effect/simple_fire,
/obj/effect/landmark,
/obj/effect/temp_visual,
/obj/effect/light_emitter/tendril,
diff --git a/code/datums/diseases/advance/symptoms/necropolis.dm b/code/datums/diseases/advance/symptoms/necropolis.dm
index 333305ecfd5db..4026bd5e67d9b 100644
--- a/code/datums/diseases/advance/symptoms/necropolis.dm
+++ b/code/datums/diseases/advance/symptoms/necropolis.dm
@@ -140,5 +140,4 @@
if(!latched)
retract()
else
- deltimer(timerid)
- timerid = addtimer(CALLBACK(src, PROC_REF(retract)), 10, TIMER_STOPPABLE)
+ set_destroy_at_time(world.time + 1 SECONDS)
diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm
index 690e0f17ca0f9..73765c8b8cdfe 100644
--- a/code/datums/status_effects/debuffs.dm
+++ b/code/datums/status_effects/debuffs.dm
@@ -521,7 +521,7 @@
var/curse_flags = NONE
var/effect_last_activation = 0
var/effect_cooldown = 100
- var/obj/effect/temp_visual/curse/wasting_effect = new
+ var/obj/effect/curse/wasting_effect = new
/datum/status_effect/necropolis_curse/on_creation(mob/living/new_owner, set_curse)
. = ..()
@@ -585,13 +585,9 @@
C.preparePixelProjectile(ownerloc, spawn_turf)
C.fire()
-/obj/effect/temp_visual/curse
+/obj/effect/curse
icon_state = "curse"
-/obj/effect/temp_visual/curse/Initialize(mapload)
- . = ..()
- deltimer(timerid)
-
/datum/status_effect/gonbolaPacify
id = "gonbolaPacify"
status_type = STATUS_EFFECT_MULTIPLE
diff --git a/code/game/objects/effects/decals/cleanable/robots.dm b/code/game/objects/effects/decals/cleanable/robots.dm
index 8ec6a6bef4f8d..35ba1ec7ad68a 100644
--- a/code/game/objects/effects/decals/cleanable/robots.dm
+++ b/code/game/objects/effects/decals/cleanable/robots.dm
@@ -98,7 +98,7 @@
visible_message("[src] catches fire!")
var/turf/T = get_turf(src)
qdel(src)
- new /obj/effect/hotspot(T)
+ new /obj/effect/simple_fire(T)
/obj/effect/decal/cleanable/oil/streak
icon_state = "streak1"
diff --git a/code/game/objects/effects/effect_system/effects_foam.dm b/code/game/objects/effects/effect_system/effects_foam.dm
index 5ea702d1d52d5..7e07eadb5aa7a 100644
--- a/code/game/objects/effects/effect_system/effects_foam.dm
+++ b/code/game/objects/effects/effect_system/effects_foam.dm
@@ -46,6 +46,9 @@
if(G.return_temperature() > T20C)
G.set_temperature(max(G.return_temperature()/2,T20C))
T.air_update_turf()
+ var/obj/effect/simple_fire/simple_fire = locate() in T
+ if (simple_fire)
+ qdel(simple_fire)
/obj/effect/particle_effect/foam/firefighting/kill_foam()
STOP_PROCESSING(SSfastprocess, src)
@@ -336,6 +339,8 @@
G.set_temperature(293.15)
for(var/obj/effect/hotspot/H in O)
qdel(H)
+ for(var/obj/effect/simple_fire/H in O)
+ qdel(H)
for(var/I in G.get_gases())
if(I == GAS_O2 || I == GAS_N2)
continue
diff --git a/code/game/objects/effects/effect_system/effects_smoke.dm b/code/game/objects/effects/effect_system/effects_smoke.dm
index 62922d034df1b..c1940579a67f4 100644
--- a/code/game/objects/effects/effect_system/effects_smoke.dm
+++ b/code/game/objects/effects/effect_system/effects_smoke.dm
@@ -179,6 +179,8 @@
T.air_update_turf()
for(var/obj/effect/hotspot/H in T)
qdel(H)
+ for(var/obj/effect/simple_fire/H in T)
+ qdel(H)
if(G.get_moles(GAS_PLASMA))
G.adjust_moles(GAS_N2, G.get_moles(GAS_PLASMA))
G.set_moles(GAS_PLASMA, 0)
diff --git a/code/game/objects/effects/simple_fire.dm b/code/game/objects/effects/simple_fire.dm
new file mode 100644
index 0000000000000..752abac5e28ec
--- /dev/null
+++ b/code/game/objects/effects/simple_fire.dm
@@ -0,0 +1,105 @@
+#define INSUFFICIENT(path) (location.air.get_moles(path) < 0.5)
+#define SPREAD_FIRE_POWER 5 SECONDS
+#define DEFAULT_FIRE_POWER 3 SECONDS
+
+/**
+ * Simple atmospheric fire that requires oxygen, but doesn't consume it.
+ * Will die out after a set amount of time.
+ * Intended for non-atmospheric fires which shouldn't be tied to atmospherics.
+ */
+/obj/effect/simple_fire
+ anchored = TRUE
+ mouse_opacity = MOUSE_OPACITY_TRANSPARENT
+ icon = 'icons/effects/fire.dmi'
+ icon_state = "2"
+ layer = GASFIRE_LAYER
+ blend_mode = BLEND_ADD
+ light_system = MOVABLE_LIGHT
+ light_range = LIGHT_RANGE_FIRE
+ // increase power for more bloom
+ light_power = 4
+ light_color = LIGHT_COLOR_FIRE
+ // Fire loses 1 power per second as it dies down
+ var/fire_power = DEFAULT_FIRE_POWER
+ var/last_fire = 0
+
+/obj/effect/simple_fire/Initialize(mapload, power)
+ if (!isnull(power))
+ fire_power = power
+ // Try a proper ignition
+ var/turf/location = loc
+ if (istype(location))
+ location.hotspot_expose(FIRE_MINIMUM_TEMPERATURE_TO_EXIST)
+ // Can't set on fire if something is already there
+ if (locate(/obj/effect/hotspot) in loc)
+ return INITIALIZE_HINT_QDEL
+ // Merge with other fires
+ for (var/obj/effect/simple_fire/other_fire in loc)
+ if (other_fire == src)
+ continue
+ other_fire.fire_power = fire_power + other_fire.fire_power
+ return INITIALIZE_HINT_QDEL
+ . = ..()
+ setDir(pick(GLOB.cardinals))
+ // Process to die out
+ START_PROCESSING(SSeffects, src)
+ // When someone enters, they burn
+ var/static/list/loc_connections = list(
+ COMSIG_ATOM_ENTERED = PROC_REF(on_entered),
+ )
+ AddElement(/datum/element/connect_loc, loc_connections)
+
+/obj/effect/simple_fire/process(delta_time)
+ var/turf/open/location = loc
+ if(!istype(location))
+ qdel(src)
+ return
+ // Fire dires out
+ if(fire_power <= 0)
+ qdel(src)
+ return
+ // These can exist without any actual gas, although will ignite gas
+ if(!location.air || location.air.get_oxidation_power() < 0.5)
+ qdel(src)
+ return
+ fire_power -= delta_time * SSeffects.wait
+ switch (fire_power)
+ if (3 SECONDS to INFINITY)
+ icon_state = "3"
+ if (1 SECONDS to 3 SECONDS)
+ icon_state = "2"
+ else
+ icon_state = "1"
+ // Fire at a rate of 1 per-second
+ if (last_fire + 1 SECONDS > world.time)
+ return
+ last_fire = world.time
+ // Spread the fire, so that it burns out quicker but makes a bigger effect
+ if (fire_power > SPREAD_FIRE_POWER)
+ var/turf/adjacent = get_step(src, pick(GLOB.cardinals))
+ if (isopenturf(adjacent))
+ new /obj/effect/simple_fire(adjacent, fire_power * 0.5)
+ fire_power *= 0.5
+ location.hotspot_expose(FIRE_MINIMUM_TEMPERATURE_TO_EXIST)
+ location.burn_tile()
+ // Burn things in this place
+ for(var/A in location)
+ var/atom/AT = A
+ // Stop if another fire starts here
+ if (istype(AT, /obj/effect/hotspot))
+ qdel(src)
+ return
+ if(!QDELETED(AT) && AT != src) // It's possible that the item is deleted in temperature_expose
+ AT.fire_act(FIRE_MINIMUM_TEMPERATURE_TO_EXIST, 125)
+
+/obj/effect/simple_fire/proc/on_entered(datum/source, atom/movable/arrived, atom/old_loc, list/atom/old_locs)
+ SIGNAL_HANDLER
+
+ if(isliving(arrived))
+ var/mob/living/immolated = arrived
+ immolated.fire_act(FIRE_MINIMUM_TEMPERATURE_TO_EXIST, 125)
+
+/obj/effect/simple_fire/singularity_pull(S, current_size)
+ return
+
+#undef INSUFFICIENT
diff --git a/code/game/objects/effects/temporary_visuals/temporary_visual.dm b/code/game/objects/effects/temporary_visuals/temporary_visual.dm
index ec4c0b9a7db59..b08e694205ae8 100644
--- a/code/game/objects/effects/temporary_visuals/temporary_visual.dm
+++ b/code/game/objects/effects/temporary_visuals/temporary_visual.dm
@@ -6,18 +6,20 @@
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
var/duration = 10 //in deciseconds
var/randomdir = TRUE
- var/timerid
+ var/heap_position
+ VAR_PRIVATE/destroy_at
+ VAR_PRIVATE/bumped = FALSE
/obj/effect/temp_visual/Initialize(mapload)
+ destroy_at = world.time + duration
+ SSeffects.join_temp_visual(src)
. = ..()
if(randomdir)
setDir(pick(GLOB.cardinals))
- timerid = QDEL_IN(src, duration)
-
-/obj/effect/temp_visual/Destroy()
+/obj/effect/temp_visual/Destroy(force)
. = ..()
- deltimer(timerid)
+ SSeffects.leave_temp_visual(src)
/obj/effect/temp_visual/singularity_act()
return
@@ -33,4 +35,6 @@
setDir(set_dir)
. = ..()
-
+/obj/effect/temp_visual/proc/set_destroy_at_time(new_time)
+ destroy_at = new_time
+ bumped = TRUE
diff --git a/code/game/objects/structures/traps.dm b/code/game/objects/structures/traps.dm
index 529d541797a49..c749073dadcfb 100644
--- a/code/game/objects/structures/traps.dm
+++ b/code/game/objects/structures/traps.dm
@@ -192,7 +192,7 @@
/obj/structure/trap/fire/flare()
..()
- new /obj/effect/hotspot(get_turf(src))
+ new /obj/effect/simple_fire(get_turf(src))
/obj/structure/trap/chill
diff --git a/code/modules/antagonists/blob/blobstrains/blazing_oil.dm b/code/modules/antagonists/blob/blobstrains/blazing_oil.dm
index 42fb6feb1a791..3d7247d57a963 100644
--- a/code/modules/antagonists/blob/blobstrains/blazing_oil.dm
+++ b/code/modules/antagonists/blob/blobstrains/blazing_oil.dm
@@ -21,7 +21,7 @@
for(var/turf/open/T in RANGE_TURFS(1, B))
var/obj/structure/blob/C = locate() in T
if(!(C?.overmind && C.overmind.blobstrain.type == B.overmind.blobstrain.type) && prob(80))
- new /obj/effect/hotspot(T)
+ new /obj/effect/simple_fire(T)
if(damage_flag == FIRE)
return 0
return ..()
diff --git a/code/modules/antagonists/cult/runes.dm b/code/modules/antagonists/cult/runes.dm
index b5f983fb2db9e..5204973ff7b7c 100644
--- a/code/modules/antagonists/cult/runes.dm
+++ b/code/modules/antagonists/cult/runes.dm
@@ -847,7 +847,7 @@ structure_check() searches for nearby cultist structures required for the invoca
if(QDELETED(src))
return
do_area_burn(T, 1.5)
- new /obj/effect/hotspot(T)
+ new /obj/effect/simple_fire(T)
qdel(src)
/obj/effect/rune/blood_boil/proc/do_area_burn(turf/T, multiplier)
diff --git a/code/modules/antagonists/heretic/magic/ash_ascension.dm b/code/modules/antagonists/heretic/magic/ash_ascension.dm
index 4b4d2ef267ed8..3f445b2b08881 100644
--- a/code/modules/antagonists/heretic/magic/ash_ascension.dm
+++ b/code/modules/antagonists/heretic/magic/ash_ascension.dm
@@ -39,7 +39,7 @@
return
for(var/turf/nearby_turf as anything in RANGE_TURFS(1, current_user))
- new /obj/effect/hotspot(nearby_turf)
+ new /obj/effect/simple_fire(nearby_turf)
nearby_turf.hotspot_expose(750, 25 * delta_time, 1)
for(var/mob/living/fried_living in nearby_turf.contents - current_user)
fried_living.adjustFireLoss(2.5 * delta_time)
@@ -65,7 +65,7 @@
var/current_range = 1
for(var/i in 0 to max_range)
for(var/turf/nearby_turf as anything in spiral_range_turfs(current_range, centre))
- new /obj/effect/hotspot(nearby_turf)
+ new /obj/effect/simple_fire(nearby_turf)
nearby_turf.hotspot_expose(750, 50, 1)
for(var/mob/living/fried_living in nearby_turf.contents - centre)
fried_living.adjustFireLoss(5)
@@ -133,7 +133,7 @@
L.adjustFireLoss(20)
to_chat(L, "You're hit by [source]'s eldritch flames!")
- new /obj/effect/hotspot(T)
+ new /obj/effect/simple_fire(T)
T.hotspot_expose(700,50,1)
// deals damage to mechs
for(var/obj/vehicle/sealed/mecha/M in T.contents)
diff --git a/code/modules/food_and_drinks/drinks/drinks/bottle.dm b/code/modules/food_and_drinks/drinks/drinks/bottle.dm
index 6cd70bf1f8356..3b4cd160b2249 100644
--- a/code/modules/food_and_drinks/drinks/drinks/bottle.dm
+++ b/code/modules/food_and_drinks/drinks/drinks/bottle.dm
@@ -539,7 +539,7 @@
break
if(firestarter && active)
hit_atom.fire_act()
- new /obj/effect/hotspot(get_turf(hit_atom))
+ new /obj/effect/simple_fire(get_turf(hit_atom), 400)
..()
/obj/item/reagent_containers/food/drinks/bottle/molotov/attackby(obj/item/I, mob/user, params)
diff --git a/code/modules/mining/equipment/resonator.dm b/code/modules/mining/equipment/resonator.dm
index 150ae9fdcab7e..4054c044cfb3b 100644
--- a/code/modules/mining/equipment/resonator.dm
+++ b/code/modules/mining/equipment/resonator.dm
@@ -80,8 +80,6 @@
playsound(src,'sound/weapons/resonator_fire.ogg',50,1)
transform = matrix()*0.75
animate(src, transform = matrix()*1.5, time = duration)
- deltimer(timerid)
- timerid = addtimer(CALLBACK(src, PROC_REF(burst)), duration, TIMER_STOPPABLE)
/obj/effect/temp_visual/resonance/Destroy()
if(res)
diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm
index ebceb4d1aafc0..7c37e1998f5a3 100644
--- a/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm
+++ b/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm
@@ -266,7 +266,7 @@ Difficulty: Medium
for(var/turf/T in turfs)
if(istype(T, /turf/closed))
break
- new /obj/effect/hotspot(T)
+ new /obj/effect/simple_fire(T)
T.hotspot_expose(700,50,1)
for(var/mob/living/L in T.contents)
if(L in hit_list || L == source)
@@ -541,7 +541,7 @@ Difficulty: Medium
var/turf/closed/mineral/M = T
M.gets_drilled()
playsound(T, "explosion", 80, 1)
- new /obj/effect/hotspot(T)
+ new /obj/effect/simple_fire(T)
T.hotspot_expose(700, 50, 1)
for(var/mob/living/L in T.contents)
if(istype(L, /mob/living/simple_animal/hostile/megafauna/dragon))
diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/goliath_broodmother.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/goliath_broodmother.dm
index 27c2d0d675fbe..39fa278247f29 100644
--- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/goliath_broodmother.dm
+++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/goliath_broodmother.dm
@@ -206,8 +206,7 @@
if(!latched)
retract()
else
- deltimer(timerid)
- timerid = addtimer(CALLBACK(src, PROC_REF(retract)), 10, TIMER_STOPPABLE)
+ set_destroy_at_time(world.time + 1 SECONDS)
/obj/effect/temp_visual/goliath_tentacle/broodmother/patch/Initialize(mapload, new_spawner)
. = ..()
diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/goliath.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/goliath.dm
index dd7f054f8be9f..50061bd76a0b3 100644
--- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/goliath.dm
+++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/goliath.dm
@@ -164,8 +164,7 @@
if(ismineralturf(loc))
var/turf/closed/mineral/M = loc
M.gets_drilled()
- deltimer(timerid)
- timerid = addtimer(CALLBACK(src, PROC_REF(tripanim)), 7, TIMER_STOPPABLE)
+ set_destroy_at_time(world.time + 7)
/obj/effect/temp_visual/goliath_tentacle/original/Initialize(mapload, new_spawner)
. = ..()
@@ -178,8 +177,7 @@
/obj/effect/temp_visual/goliath_tentacle/proc/tripanim()
icon_state = "Goliath_tentacle_wiggle"
- deltimer(timerid)
- timerid = addtimer(CALLBACK(src, PROC_REF(trip)), 3, TIMER_STOPPABLE)
+ set_destroy_at_time(world.time + 3)
/obj/effect/temp_visual/goliath_tentacle/proc/trip()
var/latched = FALSE
@@ -194,10 +192,8 @@
if(!latched)
retract()
else
- deltimer(timerid)
- timerid = addtimer(CALLBACK(src, PROC_REF(retract)), 10, TIMER_STOPPABLE)
+ set_destroy_at_time(world.time + 1 SECONDS)
/obj/effect/temp_visual/goliath_tentacle/proc/retract()
icon_state = "Goliath_tentacle_retract"
- deltimer(timerid)
- timerid = QDEL_IN(src, 7)
+ set_destroy_at_time(world.time + 7)
diff --git a/code/modules/mob/living/simple_animal/hostile/space_dragon.dm b/code/modules/mob/living/simple_animal/hostile/space_dragon.dm
index e59213910dd7b..916da1486add9 100644
--- a/code/modules/mob/living/simple_animal/hostile/space_dragon.dm
+++ b/code/modules/mob/living/simple_animal/hostile/space_dragon.dm
@@ -309,7 +309,7 @@
/mob/living/simple_animal/hostile/space_dragon/proc/dragon_fire_line(turf/T)
var/list/hit_list = list()
hit_list += src
- new /obj/effect/hotspot(T)
+ new /obj/effect/simple_fire(T)
T.hotspot_expose(700,50,1)
for(var/mob/living/L in T.contents)
if(L.faction_check_mob(src) && L != src)
diff --git a/code/modules/projectiles/guns/misc/beam_rifle.dm b/code/modules/projectiles/guns/misc/beam_rifle.dm
index 790dec3188be6..92d3d465309fd 100644
--- a/code/modules/projectiles/guns/misc/beam_rifle.dm
+++ b/code/modules/projectiles/guns/misc/beam_rifle.dm
@@ -442,7 +442,7 @@
to_chat(L, "\The [src] sears you!")
for(var/turf/T in RANGE_TURFS(aoe_fire_range, epicenter)) //handle aoe fire
if(prob(aoe_fire_chance))
- new /obj/effect/hotspot(T)
+ new /obj/effect/simple_fire(T)
for(var/obj/O in range(aoe_structure_range, epicenter))
if(!isitem(O))
O.take_damage(aoe_structure_damage * get_damage_coeff(O), BURN, LASER, FALSE)
diff --git a/code/modules/projectiles/projectile/bullets/_incendiary.dm b/code/modules/projectiles/projectile/bullets/_incendiary.dm
index 59baefa6ba741..650fcb1f8f294 100644
--- a/code/modules/projectiles/projectile/bullets/_incendiary.dm
+++ b/code/modules/projectiles/projectile/bullets/_incendiary.dm
@@ -13,5 +13,5 @@
. = ..()
var/turf/location = get_turf(src)
if(location)
- new /obj/effect/hotspot(location)
+ new /obj/effect/simple_fire(location)
location.hotspot_expose(700, 50, 1)
diff --git a/code/modules/reagents/chemistry/reagents/food_reagents.dm b/code/modules/reagents/chemistry/reagents/food_reagents.dm
index 4dbd49cc71059..f78237072d44f 100755
--- a/code/modules/reagents/chemistry/reagents/food_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/food_reagents.dm
@@ -475,6 +475,8 @@
if (!istype(T))
return
T.MakeSlippery(TURF_WET_LUBE, min_wet_time = 10 SECONDS, wet_time_to_add = reac_volume*2 SECONDS)
+ if (locate(/obj/effect/simple_fire) in T)
+ new /obj/effect/hotspot(T)
var/obj/effect/hotspot/hotspot = (locate(/obj/effect/hotspot) in T)
if(hotspot)
var/datum/gas_mixture/lowertemp = T.return_air()
diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm
index 79482f58bea95..3722c8345790f 100644
--- a/code/modules/reagents/chemistry/reagents/other_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm
@@ -183,6 +183,8 @@
for(var/mob/living/simple_animal/slime/M in T)
M.apply_water()
+ for (var/obj/effect/simple_fire/simple_fire in T)
+ qdel(simple_fire)
var/obj/effect/hotspot/hotspot = (locate(/obj/effect/hotspot) in T)
if(hotspot && !isspaceturf(T))
if(T.air)
diff --git a/code/modules/reagents/chemistry/reagents/pyrotechnic_reagents.dm b/code/modules/reagents/chemistry/reagents/pyrotechnic_reagents.dm
index 3d8aa24424613..28300d7747cd0 100644
--- a/code/modules/reagents/chemistry/reagents/pyrotechnic_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/pyrotechnic_reagents.dm
@@ -62,8 +62,7 @@
F.burn_tile()
if(isfloorturf(F))
for(var/turf/open/turf in RANGE_TURFS(1,F))
- if(!locate(/obj/effect/hotspot) in turf)
- new /obj/effect/hotspot(F)
+ new /obj/effect/simple_fire(F, max(reac_volume / 9, 3))
if(iswallturf(T))
var/turf/closed/wall/W = T
if(prob(reac_volume))
@@ -74,8 +73,7 @@
if(method != INGEST && method != INJECT)
M.adjust_fire_stacks(min(reac_volume/5, 10))
M.IgniteMob()
- if(!locate(/obj/effect/hotspot) in M.loc)
- new /obj/effect/hotspot(M.loc)
+ new /obj/effect/simple_fire(M.loc, max(reac_volume / 9, 3))
/datum/reagent/sorium
name = "Sorium"
@@ -317,6 +315,8 @@
else if(istype(F))
F.lifetime = initial(F.lifetime) //reduce object churn a little bit when using smoke by keeping existing foam alive a bit longer
+ for (var/obj/effect/simple_fire/fire in T)
+ qdel(fire)
var/obj/effect/hotspot/hotspot = (locate(/obj/effect/hotspot) in T)
if(hotspot && !isspaceturf(T))
if(T.air)
diff --git a/code/modules/reagents/chemistry/recipes/pyrotechnics.dm b/code/modules/reagents/chemistry/recipes/pyrotechnics.dm
index c881dd1653ea5..f48ffe233550b 100644
--- a/code/modules/reagents/chemistry/recipes/pyrotechnics.dm
+++ b/code/modules/reagents/chemistry/recipes/pyrotechnics.dm
@@ -176,8 +176,7 @@
/datum/chemical_reaction/clf3/on_reaction(datum/reagents/holder, created_volume)
var/turf/T = get_turf(holder.my_atom)
for(var/turf/open/turf in RANGE_TURFS(1,T))
- if(!locate(/obj/effect/hotspot) in turf)
- new /obj/effect/hotspot(turf)
+ new /obj/effect/simple_fire(turf, max(created_volume / 9, 30))
holder.chem_temp = 1000 // hot as shit
/datum/chemical_reaction/reagent_explosion/methsplosion
@@ -192,8 +191,7 @@
/datum/chemical_reaction/reagent_explosion/methsplosion/on_reaction(datum/reagents/holder, created_volume)
var/turf/T = get_turf(holder.my_atom)
for(var/turf/open/turf in RANGE_TURFS(1,T))
- if(!locate(/obj/effect/hotspot) in turf)
- new /obj/effect/hotspot(turf)
+ new /obj/effect/simple_fire(turf, max(created_volume / 9, 30))
holder.chem_temp = 1000 // hot as shit
..()
diff --git a/code/modules/research/xenobiology/crossbreeding/charged.dm b/code/modules/research/xenobiology/crossbreeding/charged.dm
index e8181b449e407..6c030f7656e39 100644
--- a/code/modules/research/xenobiology/crossbreeding/charged.dm
+++ b/code/modules/research/xenobiology/crossbreeding/charged.dm
@@ -43,8 +43,7 @@ Charged extracts:
/obj/item/slimecross/charged/orange/do_effect(mob/user)
for(var/turf/open/turf in RANGE_TURFS(5, user))
- if(!locate(/obj/effect/hotspot) in turf)
- new /obj/effect/hotspot(turf)
+ new /obj/effect/simple_fire(turf)
..()
/obj/item/slimecross/charged/purple
diff --git a/code/modules/research/xenobiology/crossbreeding/chilling.dm b/code/modules/research/xenobiology/crossbreeding/chilling.dm
index 9a1e4d432f6ce..f637b05e53698 100644
--- a/code/modules/research/xenobiology/crossbreeding/chilling.dm
+++ b/code/modules/research/xenobiology/crossbreeding/chilling.dm
@@ -44,8 +44,7 @@ Chilling extracts:
/obj/item/slimecross/chilling/orange/do_effect(mob/user)
user.visible_message("[src] shatters, and lets out a jet of heat!")
for(var/turf/open/T in (RANGE_TURFS(2, user)-RANGE_TURFS(1, user)))
- if(!locate(/obj/effect/hotspot) in T)
- new /obj/effect/hotspot(T)
+ new /obj/effect/simple_fire(T)
..()
/obj/item/slimecross/chilling/purple
diff --git a/code/modules/research/xenobiology/crossbreeding/regenerative.dm b/code/modules/research/xenobiology/crossbreeding/regenerative.dm
index 643514632acb8..1b38eac2e9ea1 100644
--- a/code/modules/research/xenobiology/crossbreeding/regenerative.dm
+++ b/code/modules/research/xenobiology/crossbreeding/regenerative.dm
@@ -49,8 +49,7 @@ Regenerative extracts:
/obj/item/slimecross/regenerative/orange/core_effect_before(mob/living/target, mob/user)
target.visible_message("The [src] boils over!")
for(var/turf/open/turf in RANGE_TURFS(1,target))
- if(!locate(/obj/effect/hotspot) in turf)
- new /obj/effect/hotspot(turf)
+ new /obj/effect/simple_fire(turf)
/obj/item/slimecross/regenerative/purple
colour = "purple"
From 0ab02361c7ea632a31da4066e240d48cae296ad8 Mon Sep 17 00:00:00 2001
From: PowerfulBacon <26465327+PowerfulBacon@users.noreply.github.com>
Date: Mon, 3 Jun 2024 11:58:17 +0100
Subject: [PATCH 2/3] Pre-deletion
---
code/__HELPERS/heap.dm | 22 +++++++--
.../subsystem/processing/effects.dm | 47 ++++++++++++++++++-
code/game/objects/effects/simple_fire.dm | 2 +-
.../temporary_visuals/temporary_visual.dm | 4 +-
4 files changed, 65 insertions(+), 10 deletions(-)
diff --git a/code/__HELPERS/heap.dm b/code/__HELPERS/heap.dm
index 0a80c843ab3e8..0d3d7bcb97090 100644
--- a/code/__HELPERS/heap.dm
+++ b/code/__HELPERS/heap.dm
@@ -69,19 +69,25 @@
index = g_child
g_child = get_greater_child(index)
+#define parent_index(index) (index == 1 ? index : index / 2)
+
+#define left_child_index(index) (index * 2)
+
+#define right_child_index(index) (index * 2 + 1)
+
//Returns the greater (relative to the comparison proc) of a node children
//or 0 if there's no child
/datum/heap/proc/get_greater_child(index)
- if(index * 2 > length(L))
+ if(left_child_index(index) > length(L))
return 0
- if(index * 2 + 1 > length(L))
- return index * 2
+ if(right_child_index(index) > length(L))
+ return left_child_index(index)
if(call(cmp)(L[index * 2],L[index * 2 + 1]) < 0)
- return index * 2 + 1
+ return left_child_index(index)
else
- return index * 2
+ return right_child_index(index)
//Replaces a given node so it verify the heap condition
/datum/heap/proc/resort(atom/A)
@@ -92,3 +98,9 @@
/datum/heap/proc/List()
. = L.Copy()
+
+#undef parent_index
+
+#undef left_child_index
+
+#undef right_child_index
diff --git a/code/controllers/subsystem/processing/effects.dm b/code/controllers/subsystem/processing/effects.dm
index 8bba96e4be2c1..b0c3d0de582b1 100644
--- a/code/controllers/subsystem/processing/effects.dm
+++ b/code/controllers/subsystem/processing/effects.dm
@@ -1,8 +1,8 @@
PROCESSING_SUBSYSTEM_DEF(effects)
name = "Effects"
wait = 0.2 SECONDS
- stat_tag = "EFF"
- var/datum/heap/destroy_heap = new /datum/heap(GLOBAL_PROC_REF(HeapEffectDestroyAtCompare))
+ stat_tag = "EFFECTS"
+ var/datum/heap/destroy_heap = new /datum/heap/effect_heap(GLOBAL_PROC_REF(HeapEffectDestroyAtCompare))
/datum/controller/subsystem/processing/effects/fire(resumed)
MC_SPLIT_TICK_INIT(2)
@@ -13,6 +13,8 @@ PROCESSING_SUBSYSTEM_DEF(effects)
// Re-enter the queue if we were bumped
if (top_visual.bumped)
destroy_heap.insert(top_visual)
+ top_visual.bumped = FALSE
+ top_visual = destroy_heap.pop()
continue
break
qdel(top_visual)
@@ -30,3 +32,44 @@ PROCESSING_SUBSYSTEM_DEF(effects)
/proc/HeapEffectDestroyAtCompare(obj/effect/temp_visual/a, obj/effect/temp_visual/b)
return b.destroy_at - a.destroy_at
+
+/**
+ * Elements need to maintain knowledge of where they are within the heap for fast removal
+ * in cases where events are prematurely deleted from the heap.
+ */
+/datum/heap/effect_heap/delete_at(index)
+ var/obj/effect/temp_visual/removed = ..()
+ if (removed)
+ removed.heap_position = null
+ return removed
+
+/datum/heap/effect_heap/pop()
+ var/obj/effect/temp_visual/swapped = ..()
+ swapped.heap_position = null
+
+/datum/heap/effect_heap/swim(index)
+ var/parent = round(index * 0.5)
+ var/obj/effect/temp_visual/swapped
+
+ while(parent > 0 && (call(cmp)(L[index],L[parent]) > 0))
+ swapped = L[index]
+ swapped.heap_position = parent
+ swapped = L[parent]
+ swapped.heap_position = index
+ L.Swap(index,parent)
+ index = parent
+ parent = round(index * 0.5)
+ return index
+
+/datum/heap/effect_heap/sink(index)
+ var/g_child = get_greater_child(index)
+ var/obj/effect/temp_visual/swapped
+
+ while(g_child > 0 && (call(cmp)(L[index],L[g_child]) < 0))
+ swapped = L[index]
+ swapped.heap_position = g_child
+ swapped = L[g_child]
+ swapped.heap_position = index
+ L.Swap(index,g_child)
+ index = g_child
+ g_child = get_greater_child(index)
diff --git a/code/game/objects/effects/simple_fire.dm b/code/game/objects/effects/simple_fire.dm
index 752abac5e28ec..01a8f8210828a 100644
--- a/code/game/objects/effects/simple_fire.dm
+++ b/code/game/objects/effects/simple_fire.dm
@@ -62,7 +62,7 @@
if(!location.air || location.air.get_oxidation_power() < 0.5)
qdel(src)
return
- fire_power -= delta_time * SSeffects.wait
+ fire_power -= delta_time * 1 SECONDS
switch (fire_power)
if (3 SECONDS to INFINITY)
icon_state = "3"
diff --git a/code/game/objects/effects/temporary_visuals/temporary_visual.dm b/code/game/objects/effects/temporary_visuals/temporary_visual.dm
index b08e694205ae8..930729f02c3f6 100644
--- a/code/game/objects/effects/temporary_visuals/temporary_visual.dm
+++ b/code/game/objects/effects/temporary_visuals/temporary_visual.dm
@@ -7,8 +7,8 @@
var/duration = 10 //in deciseconds
var/randomdir = TRUE
var/heap_position
- VAR_PRIVATE/destroy_at
- VAR_PRIVATE/bumped = FALSE
+ var/destroy_at
+ var/bumped = FALSE
/obj/effect/temp_visual/Initialize(mapload)
destroy_at = world.time + duration
From f89c17b9d67007067f37377c04acd4edbd8e925c Mon Sep 17 00:00:00 2001
From: PowerfulBacon <26465327+PowerfulBacon@users.noreply.github.com>
Date: Mon, 3 Jun 2024 12:01:48 +0100
Subject: [PATCH 3/3] Deletes the timer stuff
---
.../subsystem/processing/effects.dm | 71 -------------------
.../diseases/advance/symptoms/necropolis.dm | 3 +-
.../temporary_visuals/temporary_visual.dm | 16 ++---
code/modules/mining/equipment/resonator.dm | 2 +
.../mining_mobs/elites/goliath_broodmother.dm | 3 +-
.../hostile/mining_mobs/goliath.dm | 12 ++--
6 files changed, 20 insertions(+), 87 deletions(-)
diff --git a/code/controllers/subsystem/processing/effects.dm b/code/controllers/subsystem/processing/effects.dm
index b0c3d0de582b1..02dadda056451 100644
--- a/code/controllers/subsystem/processing/effects.dm
+++ b/code/controllers/subsystem/processing/effects.dm
@@ -2,74 +2,3 @@ PROCESSING_SUBSYSTEM_DEF(effects)
name = "Effects"
wait = 0.2 SECONDS
stat_tag = "EFFECTS"
- var/datum/heap/destroy_heap = new /datum/heap/effect_heap(GLOBAL_PROC_REF(HeapEffectDestroyAtCompare))
-
-/datum/controller/subsystem/processing/effects/fire(resumed)
- MC_SPLIT_TICK_INIT(2)
- MC_SPLIT_TICK
- var/obj/effect/temp_visual/top_visual = destroy_heap.pop()
- while (istype(top_visual))
- if (top_visual.destroy_at > world.time)
- // Re-enter the queue if we were bumped
- if (top_visual.bumped)
- destroy_heap.insert(top_visual)
- top_visual.bumped = FALSE
- top_visual = destroy_heap.pop()
- continue
- break
- qdel(top_visual)
- top_visual = destroy_heap.pop()
- MC_SPLIT_TICK
- return ..()
-
-/datum/controller/subsystem/processing/effects/proc/join_temp_visual(obj/effect/temp_visual/visual)
- visual.heap_position = destroy_heap.insert(visual)
-
-/datum/controller/subsystem/processing/effects/proc/leave_temp_visual(obj/effect/temp_visual/visual)
- if (visual.heap_position)
- destroy_heap.delete_at(visual.heap_position)
- visual.heap_position = null
-
-/proc/HeapEffectDestroyAtCompare(obj/effect/temp_visual/a, obj/effect/temp_visual/b)
- return b.destroy_at - a.destroy_at
-
-/**
- * Elements need to maintain knowledge of where they are within the heap for fast removal
- * in cases where events are prematurely deleted from the heap.
- */
-/datum/heap/effect_heap/delete_at(index)
- var/obj/effect/temp_visual/removed = ..()
- if (removed)
- removed.heap_position = null
- return removed
-
-/datum/heap/effect_heap/pop()
- var/obj/effect/temp_visual/swapped = ..()
- swapped.heap_position = null
-
-/datum/heap/effect_heap/swim(index)
- var/parent = round(index * 0.5)
- var/obj/effect/temp_visual/swapped
-
- while(parent > 0 && (call(cmp)(L[index],L[parent]) > 0))
- swapped = L[index]
- swapped.heap_position = parent
- swapped = L[parent]
- swapped.heap_position = index
- L.Swap(index,parent)
- index = parent
- parent = round(index * 0.5)
- return index
-
-/datum/heap/effect_heap/sink(index)
- var/g_child = get_greater_child(index)
- var/obj/effect/temp_visual/swapped
-
- while(g_child > 0 && (call(cmp)(L[index],L[g_child]) < 0))
- swapped = L[index]
- swapped.heap_position = g_child
- swapped = L[g_child]
- swapped.heap_position = index
- L.Swap(index,g_child)
- index = g_child
- g_child = get_greater_child(index)
diff --git a/code/datums/diseases/advance/symptoms/necropolis.dm b/code/datums/diseases/advance/symptoms/necropolis.dm
index 4026bd5e67d9b..333305ecfd5db 100644
--- a/code/datums/diseases/advance/symptoms/necropolis.dm
+++ b/code/datums/diseases/advance/symptoms/necropolis.dm
@@ -140,4 +140,5 @@
if(!latched)
retract()
else
- set_destroy_at_time(world.time + 1 SECONDS)
+ deltimer(timerid)
+ timerid = addtimer(CALLBACK(src, PROC_REF(retract)), 10, TIMER_STOPPABLE)
diff --git a/code/game/objects/effects/temporary_visuals/temporary_visual.dm b/code/game/objects/effects/temporary_visuals/temporary_visual.dm
index 930729f02c3f6..ec4c0b9a7db59 100644
--- a/code/game/objects/effects/temporary_visuals/temporary_visual.dm
+++ b/code/game/objects/effects/temporary_visuals/temporary_visual.dm
@@ -6,20 +6,18 @@
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
var/duration = 10 //in deciseconds
var/randomdir = TRUE
- var/heap_position
- var/destroy_at
- var/bumped = FALSE
+ var/timerid
/obj/effect/temp_visual/Initialize(mapload)
- destroy_at = world.time + duration
- SSeffects.join_temp_visual(src)
. = ..()
if(randomdir)
setDir(pick(GLOB.cardinals))
-/obj/effect/temp_visual/Destroy(force)
+ timerid = QDEL_IN(src, duration)
+
+/obj/effect/temp_visual/Destroy()
. = ..()
- SSeffects.leave_temp_visual(src)
+ deltimer(timerid)
/obj/effect/temp_visual/singularity_act()
return
@@ -35,6 +33,4 @@
setDir(set_dir)
. = ..()
-/obj/effect/temp_visual/proc/set_destroy_at_time(new_time)
- destroy_at = new_time
- bumped = TRUE
+
diff --git a/code/modules/mining/equipment/resonator.dm b/code/modules/mining/equipment/resonator.dm
index 4054c044cfb3b..150ae9fdcab7e 100644
--- a/code/modules/mining/equipment/resonator.dm
+++ b/code/modules/mining/equipment/resonator.dm
@@ -80,6 +80,8 @@
playsound(src,'sound/weapons/resonator_fire.ogg',50,1)
transform = matrix()*0.75
animate(src, transform = matrix()*1.5, time = duration)
+ deltimer(timerid)
+ timerid = addtimer(CALLBACK(src, PROC_REF(burst)), duration, TIMER_STOPPABLE)
/obj/effect/temp_visual/resonance/Destroy()
if(res)
diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/goliath_broodmother.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/goliath_broodmother.dm
index 39fa278247f29..27c2d0d675fbe 100644
--- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/goliath_broodmother.dm
+++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/goliath_broodmother.dm
@@ -206,7 +206,8 @@
if(!latched)
retract()
else
- set_destroy_at_time(world.time + 1 SECONDS)
+ deltimer(timerid)
+ timerid = addtimer(CALLBACK(src, PROC_REF(retract)), 10, TIMER_STOPPABLE)
/obj/effect/temp_visual/goliath_tentacle/broodmother/patch/Initialize(mapload, new_spawner)
. = ..()
diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/goliath.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/goliath.dm
index 50061bd76a0b3..dd7f054f8be9f 100644
--- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/goliath.dm
+++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/goliath.dm
@@ -164,7 +164,8 @@
if(ismineralturf(loc))
var/turf/closed/mineral/M = loc
M.gets_drilled()
- set_destroy_at_time(world.time + 7)
+ deltimer(timerid)
+ timerid = addtimer(CALLBACK(src, PROC_REF(tripanim)), 7, TIMER_STOPPABLE)
/obj/effect/temp_visual/goliath_tentacle/original/Initialize(mapload, new_spawner)
. = ..()
@@ -177,7 +178,8 @@
/obj/effect/temp_visual/goliath_tentacle/proc/tripanim()
icon_state = "Goliath_tentacle_wiggle"
- set_destroy_at_time(world.time + 3)
+ deltimer(timerid)
+ timerid = addtimer(CALLBACK(src, PROC_REF(trip)), 3, TIMER_STOPPABLE)
/obj/effect/temp_visual/goliath_tentacle/proc/trip()
var/latched = FALSE
@@ -192,8 +194,10 @@
if(!latched)
retract()
else
- set_destroy_at_time(world.time + 1 SECONDS)
+ deltimer(timerid)
+ timerid = addtimer(CALLBACK(src, PROC_REF(retract)), 10, TIMER_STOPPABLE)
/obj/effect/temp_visual/goliath_tentacle/proc/retract()
icon_state = "Goliath_tentacle_retract"
- set_destroy_at_time(world.time + 7)
+ deltimer(timerid)
+ timerid = QDEL_IN(src, 7)