Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit da98b9d

Browse files
Makes extinguishers slightly less broken (#21733)
* extinguished * nuh uh * Update effects_foam.dm
1 parent 9949d53 commit da98b9d

File tree

21 files changed

+80
-61
lines changed

21 files changed

+80
-61
lines changed

code/__DEFINES/dcs/signals/signals_turf.dm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,10 @@
4040
#define COMSIG_TURF_RESET_ELEVATION "turf_reset_elevation"
4141
#define ELEVATION_CURRENT_PIXEL_SHIFT 1
4242
#define ELEVATION_MAX_PIXEL_SHIFT 2
43+
44+
///From /datum/hotspot/perform_exposure()
45+
#define COMSIG_TURF_HOTSPOT_EXPOSE "turf_hotspot_expose"
46+
///From /turf/ignite_turf(): (power, fire_color)
47+
#define COMSIG_TURF_IGNITED "turf_ignited"
48+
///Prevents hotspots and turf fires
49+
#define SUPPRESS_FIRE (1<<0)

code/controllers/subsystem/explosions.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ SUBSYSTEM_DEF(explosions)
522522
for(var/thing in flame_turf)
523523
if(thing)
524524
var/turf/T = thing
525-
T.IgniteTurf(rand(4, 24)) //Mostly for ambience!
525+
T.ignite_turf(rand(4, 24)) //Mostly for ambience!
526526
cost_flameturf = MC_AVERAGE(cost_flameturf, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))
527527

528528
if (low_turf.len || med_turf.len || high_turf.len)

code/game/objects/effects/anomalies.dm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,10 +301,10 @@
301301
/obj/effect/anomaly/pyro/anomalyEffect(delta_time)
302302
..()
303303
var/turf/center = get_turf(src)
304-
center.IgniteTurf(delta_time * fire_power)
304+
center.ignite_turf(delta_time * fire_power)
305305
for(var/turf/open/T in center.GetAtmosAdjacentTurfs())
306306
if(prob(5 * delta_time))
307-
T.IgniteTurf(delta_time)
307+
T.ignite_turf(delta_time)
308308

309309
/obj/effect/anomaly/pyro/detonate()
310310
INVOKE_ASYNC(src, PROC_REF(makepyroslime))
@@ -314,7 +314,7 @@
314314
for(var/turf/open/T in spiral_range_turfs(5, center))
315315
if(prob(get_dist(center, T) * 15))
316316
continue
317-
T.IgniteTurf(fire_power * 10) //Make it hot and burny for the new slime
317+
T.ignite_turf(fire_power * 10) //Make it hot and burny for the new slime
318318
var/new_colour = pick("red", "orange")
319319
var/mob/living/simple_animal/slime/S = new(center, new_colour)
320320
S.rabid = TRUE

code/game/objects/effects/effect_system/effects_water.dm

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,14 @@
3535
reagents.reaction(A, transfer_methods)
3636
qdel(src) // delete itself if it got blocked and can't move
3737
return
38-
addtimer(CALLBACK(src, PROC_REF(move_particle)), 2)
38+
if(life)
39+
addtimer(CALLBACK(src, PROC_REF(move_particle)), 2)
3940

4041
/obj/effect/particle_effect/water/Move(turf/newloc)
41-
if (--src.life < 1)
42+
if(life < 1)
4243
qdel(src)
4344
return FALSE
45+
life--
4446
if(reagents)
4547
reagents.reaction(newloc, transfer_methods)
4648
for(var/atom/A in newloc)

code/game/objects/effects/effect_system/fluid_spread/effects_foam.dm

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -237,36 +237,36 @@
237237
affecting_turf = T
238238
affecting_turf.flammability = -10 // set the turf to be non-flammable while the foam is covering it
239239
//Remove_element(/datum/element/atmos_sensitive)
240+
var/static/list/loc_connections = list(
241+
COMSIG_TURF_HOTSPOT_EXPOSE = PROC_REF(on_hotspot_expose),
242+
COMSIG_TURF_IGNITED = PROC_REF(on_turf_ignite),
243+
)
244+
AddElement(/datum/element/connect_loc, loc_connections)
245+
246+
/obj/effect/particle_effect/fluid/foam/firefighting/proc/on_hotspot_expose()
247+
return SUPPRESS_FIRE
248+
249+
/obj/effect/particle_effect/fluid/foam/firefighting/proc/on_turf_ignite()
250+
return SUPPRESS_FIRE
240251

241252
/obj/effect/particle_effect/fluid/foam/firefighting/Destroy()
242253
if(affecting_turf && !QDELETED(affecting_turf))
243254
affecting_turf.flammability = initial(affecting_turf.flammability)
244255
return ..()
245256

246257
/obj/effect/particle_effect/fluid/foam/firefighting/process()
247-
..()
258+
. = ..()
248259

249260
var/turf/open/location = loc
250261
if(!istype(location))
251262
return
252263

253-
var/obj/effect/hotspot/hotspot = location.active_hotspot
254-
var/obj/effect/abstract/turf_fire/turf_fire = location.turf_fire
255-
if(!((hotspot||turf_fire) && location.air))
256-
return
257-
258-
if(hotspot)
259-
QDEL_NULL(hotspot)
260-
if(turf_fire)
261-
QDEL_NULL(turf_fire)
262-
263264
var/datum/gas_mixture/air = location.air
264265
var/scrub_amt = min(30, air.get_moles(GAS_PLASMA)) //Absorb some plasma
265266
air.adjust_moles(GAS_PLASMA, -scrub_amt)
266267
absorbed_plasma += scrub_amt
267268

268-
if (air.return_temperature() > T20C)
269-
air.set_temperature(max(air.return_temperature() / 2, T20C))
269+
location.extinguish_turf()
270270

271271
/obj/effect/particle_effect/fluid/foam/firefighting/make_result()
272272
if(!absorbed_plasma) // don't bother if it didn't scrub any plasma

code/game/objects/effects/turf_fire.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@
162162
var/list/turfs_to_spread = open_turf.atmos_adjacent_turfs
163163
for(var/turf/open/T in turfs_to_spread)
164164
if(prob(T.flammability * fire_power * TURF_FIRE_SPREAD_RATE))
165-
T.IgniteTurf(fire_power * TURF_FIRE_SPREAD_RATE)
165+
T.ignite_turf(fire_power * TURF_FIRE_SPREAD_RATE)
166166
if(magical)
167167
if(prob(fire_power))
168168
open_turf.burn_tile()

code/game/objects/items/extinguisher.dm

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
var/sprite_name = "fire_extinguisher"
2626
var/power = 5 //Maximum distance launched water will travel
2727
var/precision = FALSE //By default, turfs picked from a spray are random, set to 1 to make it always have at least one water effect per row
28-
var/cooling_power = 2 //Sets the cooling_temperature of the water reagent datum inside of the extinguisher when it is refilled
2928

3029
/obj/item/extinguisher/mini
3130
name = "pocket fire extinguisher"
@@ -116,8 +115,6 @@
116115
if(transferred > 0)
117116
to_chat(user, span_notice("\The [src] has been refilled by [transferred] units."))
118117
playsound(src.loc, 'sound/effects/refill.ogg', 50, 1, -6)
119-
for(var/datum/reagent/water/R in reagents.reagent_list)
120-
R.cooling_temperature = cooling_power
121118
else
122119
to_chat(user, span_warning("\The [W] is empty!"))
123120
safety = safety_save

code/game/objects/items/flamethrower.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@
298298
//Burn it
299299
var/list/hit_list = list()
300300
hit_list += src
301-
target.IgniteTurf(rand(damage, damage * 4))
301+
target.ignite_turf(rand(damage, damage * 4))
302302

303303
// Fire go brrrr
304304
for(var/mob/living/L in target.contents)

code/game/objects/items/tanks/watertank.dm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@
209209
power = 8
210210
force = 10
211211
precision = 1
212-
cooling_power = 5
213212
w_class = WEIGHT_CLASS_HUGE
214213
item_flags = ABSTRACT // don't put in storage
215214
var/obj/item/watertank/tank

code/game/turfs/open/_open.dm

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,10 @@
685685
air.set_moles(GAS_H2, max(air.get_moles(GAS_H2) - (pulse_strength * 0.001), 0))
686686
air.adjust_moles(GAS_TRITIUM, pulse_strength * 0.001)
687687

688-
/turf/open/IgniteTurf(power, fire_color="red")
688+
/turf/open/ignite_turf(power, fire_color="red")
689+
. = ..()
690+
if(. & SUPPRESS_FIRE)
691+
return
689692
if(air.get_moles(GAS_O2) < 1)
690693
return
691694
if(turf_fire)
@@ -694,6 +697,17 @@
694697
if(!isgroundlessturf(src))
695698
new /obj/effect/abstract/turf_fire(src, power, fire_color)
696699

700+
/turf/open/extinguish_turf()
701+
if(!air)
702+
return
703+
if(air.return_temperature() > T20C)
704+
air.set_temperature(max(air.return_temperature() / 2, T20C))
705+
air.react(src)
706+
if(active_hotspot)
707+
qdel(active_hotspot)
708+
if(turf_fire)
709+
qdel(turf_fire)
710+
697711
/turf/open/proc/set_flammability(new_flammability)
698712
if(isnull(new_flammability))
699713
flammability = initial(flammability)

0 commit comments

Comments
 (0)