mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
Makes extinguishers slightly less broken (#21733)
* extinguished * nuh uh * Update effects_foam.dm
This commit is contained in:
@@ -40,3 +40,10 @@
|
||||
#define COMSIG_TURF_RESET_ELEVATION "turf_reset_elevation"
|
||||
#define ELEVATION_CURRENT_PIXEL_SHIFT 1
|
||||
#define ELEVATION_MAX_PIXEL_SHIFT 2
|
||||
|
||||
///From /datum/hotspot/perform_exposure()
|
||||
#define COMSIG_TURF_HOTSPOT_EXPOSE "turf_hotspot_expose"
|
||||
///From /turf/ignite_turf(): (power, fire_color)
|
||||
#define COMSIG_TURF_IGNITED "turf_ignited"
|
||||
///Prevents hotspots and turf fires
|
||||
#define SUPPRESS_FIRE (1<<0)
|
||||
|
||||
@@ -522,7 +522,7 @@ SUBSYSTEM_DEF(explosions)
|
||||
for(var/thing in flame_turf)
|
||||
if(thing)
|
||||
var/turf/T = thing
|
||||
T.IgniteTurf(rand(4, 24)) //Mostly for ambience!
|
||||
T.ignite_turf(rand(4, 24)) //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)
|
||||
|
||||
@@ -301,10 +301,10 @@
|
||||
/obj/effect/anomaly/pyro/anomalyEffect(delta_time)
|
||||
..()
|
||||
var/turf/center = get_turf(src)
|
||||
center.IgniteTurf(delta_time * fire_power)
|
||||
center.ignite_turf(delta_time * fire_power)
|
||||
for(var/turf/open/T in center.GetAtmosAdjacentTurfs())
|
||||
if(prob(5 * delta_time))
|
||||
T.IgniteTurf(delta_time)
|
||||
T.ignite_turf(delta_time)
|
||||
|
||||
/obj/effect/anomaly/pyro/detonate()
|
||||
INVOKE_ASYNC(src, PROC_REF(makepyroslime))
|
||||
@@ -314,7 +314,7 @@
|
||||
for(var/turf/open/T in spiral_range_turfs(5, center))
|
||||
if(prob(get_dist(center, T) * 15))
|
||||
continue
|
||||
T.IgniteTurf(fire_power * 10) //Make it hot and burny for the new slime
|
||||
T.ignite_turf(fire_power * 10) //Make it hot and burny for the new slime
|
||||
var/new_colour = pick("red", "orange")
|
||||
var/mob/living/simple_animal/slime/S = new(center, new_colour)
|
||||
S.rabid = TRUE
|
||||
|
||||
@@ -35,12 +35,14 @@
|
||||
reagents.reaction(A, transfer_methods)
|
||||
qdel(src) // delete itself if it got blocked and can't move
|
||||
return
|
||||
addtimer(CALLBACK(src, PROC_REF(move_particle)), 2)
|
||||
if(life)
|
||||
addtimer(CALLBACK(src, PROC_REF(move_particle)), 2)
|
||||
|
||||
/obj/effect/particle_effect/water/Move(turf/newloc)
|
||||
if (--src.life < 1)
|
||||
if(life < 1)
|
||||
qdel(src)
|
||||
return FALSE
|
||||
life--
|
||||
if(reagents)
|
||||
reagents.reaction(newloc, transfer_methods)
|
||||
for(var/atom/A in newloc)
|
||||
|
||||
@@ -237,6 +237,17 @@
|
||||
affecting_turf = T
|
||||
affecting_turf.flammability = -10 // set the turf to be non-flammable while the foam is covering it
|
||||
//Remove_element(/datum/element/atmos_sensitive)
|
||||
var/static/list/loc_connections = list(
|
||||
COMSIG_TURF_HOTSPOT_EXPOSE = PROC_REF(on_hotspot_expose),
|
||||
COMSIG_TURF_IGNITED = PROC_REF(on_turf_ignite),
|
||||
)
|
||||
AddElement(/datum/element/connect_loc, loc_connections)
|
||||
|
||||
/obj/effect/particle_effect/fluid/foam/firefighting/proc/on_hotspot_expose()
|
||||
return SUPPRESS_FIRE
|
||||
|
||||
/obj/effect/particle_effect/fluid/foam/firefighting/proc/on_turf_ignite()
|
||||
return SUPPRESS_FIRE
|
||||
|
||||
/obj/effect/particle_effect/fluid/foam/firefighting/Destroy()
|
||||
if(affecting_turf && !QDELETED(affecting_turf))
|
||||
@@ -244,29 +255,18 @@
|
||||
return ..()
|
||||
|
||||
/obj/effect/particle_effect/fluid/foam/firefighting/process()
|
||||
..()
|
||||
. = ..()
|
||||
|
||||
var/turf/open/location = loc
|
||||
if(!istype(location))
|
||||
return
|
||||
|
||||
var/obj/effect/hotspot/hotspot = location.active_hotspot
|
||||
var/obj/effect/abstract/turf_fire/turf_fire = location.turf_fire
|
||||
if(!((hotspot||turf_fire) && location.air))
|
||||
return
|
||||
|
||||
if(hotspot)
|
||||
QDEL_NULL(hotspot)
|
||||
if(turf_fire)
|
||||
QDEL_NULL(turf_fire)
|
||||
|
||||
var/datum/gas_mixture/air = location.air
|
||||
var/scrub_amt = min(30, air.get_moles(GAS_PLASMA)) //Absorb some plasma
|
||||
air.adjust_moles(GAS_PLASMA, -scrub_amt)
|
||||
absorbed_plasma += scrub_amt
|
||||
|
||||
if (air.return_temperature() > T20C)
|
||||
air.set_temperature(max(air.return_temperature() / 2, T20C))
|
||||
location.extinguish_turf()
|
||||
|
||||
/obj/effect/particle_effect/fluid/foam/firefighting/make_result()
|
||||
if(!absorbed_plasma) // don't bother if it didn't scrub any plasma
|
||||
|
||||
@@ -162,7 +162,7 @@
|
||||
var/list/turfs_to_spread = open_turf.atmos_adjacent_turfs
|
||||
for(var/turf/open/T in turfs_to_spread)
|
||||
if(prob(T.flammability * fire_power * TURF_FIRE_SPREAD_RATE))
|
||||
T.IgniteTurf(fire_power * TURF_FIRE_SPREAD_RATE)
|
||||
T.ignite_turf(fire_power * TURF_FIRE_SPREAD_RATE)
|
||||
if(magical)
|
||||
if(prob(fire_power))
|
||||
open_turf.burn_tile()
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
var/sprite_name = "fire_extinguisher"
|
||||
var/power = 5 //Maximum distance launched water will travel
|
||||
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
|
||||
var/cooling_power = 2 //Sets the cooling_temperature of the water reagent datum inside of the extinguisher when it is refilled
|
||||
|
||||
/obj/item/extinguisher/mini
|
||||
name = "pocket fire extinguisher"
|
||||
@@ -116,8 +115,6 @@
|
||||
if(transferred > 0)
|
||||
to_chat(user, span_notice("\The [src] has been refilled by [transferred] units."))
|
||||
playsound(src.loc, 'sound/effects/refill.ogg', 50, 1, -6)
|
||||
for(var/datum/reagent/water/R in reagents.reagent_list)
|
||||
R.cooling_temperature = cooling_power
|
||||
else
|
||||
to_chat(user, span_warning("\The [W] is empty!"))
|
||||
safety = safety_save
|
||||
|
||||
@@ -298,7 +298,7 @@
|
||||
//Burn it
|
||||
var/list/hit_list = list()
|
||||
hit_list += src
|
||||
target.IgniteTurf(rand(damage, damage * 4))
|
||||
target.ignite_turf(rand(damage, damage * 4))
|
||||
|
||||
// Fire go brrrr
|
||||
for(var/mob/living/L in target.contents)
|
||||
|
||||
@@ -209,7 +209,6 @@
|
||||
power = 8
|
||||
force = 10
|
||||
precision = 1
|
||||
cooling_power = 5
|
||||
w_class = WEIGHT_CLASS_HUGE
|
||||
item_flags = ABSTRACT // don't put in storage
|
||||
var/obj/item/watertank/tank
|
||||
|
||||
@@ -685,7 +685,10 @@
|
||||
air.set_moles(GAS_H2, max(air.get_moles(GAS_H2) - (pulse_strength * 0.001), 0))
|
||||
air.adjust_moles(GAS_TRITIUM, pulse_strength * 0.001)
|
||||
|
||||
/turf/open/IgniteTurf(power, fire_color="red")
|
||||
/turf/open/ignite_turf(power, fire_color="red")
|
||||
. = ..()
|
||||
if(. & SUPPRESS_FIRE)
|
||||
return
|
||||
if(air.get_moles(GAS_O2) < 1)
|
||||
return
|
||||
if(turf_fire)
|
||||
@@ -694,6 +697,17 @@
|
||||
if(!isgroundlessturf(src))
|
||||
new /obj/effect/abstract/turf_fire(src, power, fire_color)
|
||||
|
||||
/turf/open/extinguish_turf()
|
||||
if(!air)
|
||||
return
|
||||
if(air.return_temperature() > T20C)
|
||||
air.set_temperature(max(air.return_temperature() / 2, T20C))
|
||||
air.react(src)
|
||||
if(active_hotspot)
|
||||
qdel(active_hotspot)
|
||||
if(turf_fire)
|
||||
qdel(turf_fire)
|
||||
|
||||
/turf/open/proc/set_flammability(new_flammability)
|
||||
if(isnull(new_flammability))
|
||||
flammability = initial(flammability)
|
||||
|
||||
@@ -52,6 +52,7 @@ GLOBAL_LIST_EMPTY(starlight)
|
||||
initial_temperature = TCMB
|
||||
thermal_conductivity = 0
|
||||
heat_capacity = 700000
|
||||
flammability = 0 // nuh uh
|
||||
var/starlight_source_count = 0
|
||||
|
||||
var/destination_z
|
||||
@@ -97,6 +98,13 @@ GLOBAL_LIST_EMPTY(starlight)
|
||||
/turf/open/space/Initalize_Atmos(times_fired)
|
||||
return
|
||||
|
||||
/turf/open/space/ignite_turf(power, fire_color)
|
||||
return // no fire in space
|
||||
|
||||
/turf/open/space/extinguish_turf()
|
||||
if(active_hotspot) // there's no actual fire in space, but space dragons and stuff can make fire effects which should be cleared
|
||||
qdel(active_hotspot)
|
||||
|
||||
/turf/open/space/TakeTemperature(temp)
|
||||
|
||||
/turf/open/space/RemoveLattice()
|
||||
|
||||
@@ -770,8 +770,12 @@ GLOBAL_LIST_EMPTY(station_turfs)
|
||||
movable_content.wash(clean_types)
|
||||
|
||||
/// Called when attempting to set fire to a turf
|
||||
/turf/proc/IgniteTurf(power, fire_color="red")
|
||||
/turf/proc/ignite_turf(power, fire_color="red")
|
||||
return SEND_SIGNAL(src, COMSIG_TURF_IGNITED, power, fire_color)
|
||||
|
||||
/turf/proc/extinguish_turf()
|
||||
return
|
||||
|
||||
/// Returns whether it is safe for an atom to move across this turf
|
||||
/turf/proc/can_cross_safely(atom/movable/crossing)
|
||||
return TRUE
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
/turf/open/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
|
||||
if(prob(flammability * 100))
|
||||
IgniteTurf(rand(IGNITE_TURF_LOW_POWER,IGNITE_TURF_HIGH_POWER))
|
||||
ignite_turf(rand(IGNITE_TURF_LOW_POWER,IGNITE_TURF_HIGH_POWER))
|
||||
return ..()
|
||||
|
||||
/turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0)
|
||||
@@ -68,6 +68,9 @@
|
||||
var/turf/open/location = loc
|
||||
if(!istype(location) || !(location.air))
|
||||
return FALSE
|
||||
|
||||
if(SEND_SIGNAL(location, COMSIG_TURF_HOTSPOT_EXPOSE) & SUPPRESS_FIRE)
|
||||
return FALSE
|
||||
|
||||
if(location.active_hotspot != src)
|
||||
qdel(location.active_hotspot)
|
||||
@@ -174,7 +177,9 @@
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
perform_exposure()
|
||||
if(!perform_exposure())
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
if(bypassing)
|
||||
icon_state = "3"
|
||||
|
||||
@@ -530,10 +530,10 @@
|
||||
var/turf/center_turf = get_turf(hit_atom)
|
||||
if(isclosedturf(center_turf) && isopenturf(get_turf(src)))
|
||||
center_turf = get_turf(src) // if it hits a wall, light the floor in front of the wall on fire, not the wall itself
|
||||
center_turf.IgniteTurf(fire_power)
|
||||
center_turf.ignite_turf(fire_power)
|
||||
for(var/turf/T in center_turf.reachableAdjacentAtmosTurfs())
|
||||
if(prob(fire_power))
|
||||
T.IgniteTurf(fire_power)
|
||||
T.ignite_turf(fire_power)
|
||||
return ..()
|
||||
|
||||
/obj/item/reagent_containers/food/drinks/bottle/molotov/attackby(obj/item/I, mob/user, params)
|
||||
|
||||
@@ -376,7 +376,7 @@
|
||||
. = ..()
|
||||
if(prob(tracer_fire_chance))
|
||||
var/turf/new_turf = newloc
|
||||
new_turf.IgniteTurf(rand(16, 22), fire_color) // FIRE IN THE HOLE!!!!
|
||||
new_turf.ignite_turf(rand(16, 22), fire_color) // FIRE IN THE HOLE!!!!
|
||||
|
||||
/obj/projectile/beam/beam_rifle/proc/do_area_damage(turf/epicenter)
|
||||
set waitfor = FALSE
|
||||
@@ -386,7 +386,7 @@
|
||||
for(var/turf/T in spiral_range_turfs(aoe_range, epicenter))
|
||||
var/modified_damage = damage / max(get_dist(epicenter, T), 1) // damage decreases with range
|
||||
if(prob(aoe_fire_chance))
|
||||
T.IgniteTurf(rand(16, 22), fire_color)
|
||||
T.ignite_turf(rand(16, 22), fire_color)
|
||||
for(var/mob/living/L in T) //handle aoe mob damage
|
||||
L.apply_damage(modified_damage, BURN, null, L.getarmor(null, BOMB))
|
||||
to_chat(L, span_userdanger("\The [src] sears you!"))
|
||||
@@ -399,7 +399,7 @@
|
||||
playsound(target_turf, 'sound/effects/explosion3.ogg', 100, 1)
|
||||
if(isclosedturf(target)) // if hitting a wall
|
||||
SSexplosions.lowturf += target
|
||||
target_turf.IgniteTurf(rand(16, 22), fire_color)
|
||||
target_turf.ignite_turf(rand(16, 22), fire_color)
|
||||
if(aoe_range)
|
||||
do_area_damage(target_turf)
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
if(fire_hazard)
|
||||
var/turf/open/target_turf = get_turf(target)
|
||||
if(istype(target_turf))
|
||||
target_turf.IgniteTurf(rand(8, 16))
|
||||
target_turf.ignite_turf(rand(8, 16))
|
||||
return ..()
|
||||
|
||||
/obj/projectile/beam/weak
|
||||
@@ -127,7 +127,7 @@
|
||||
. = ..()
|
||||
var/turf/open/target_turf = get_turf(target)
|
||||
if(istype(target_turf))
|
||||
target_turf.IgniteTurf(rand(8, 22), "blue")
|
||||
target_turf.ignite_turf(rand(8, 22), "blue")
|
||||
|
||||
/obj/projectile/beam/pulse/shotgun
|
||||
damage = 40
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
M.ignite_mob()
|
||||
var/turf/open/target_turf = get_turf(target)
|
||||
if(istype(target_turf))
|
||||
target_turf.IgniteTurf(rand(8, 22))
|
||||
target_turf.ignite_turf(rand(8, 22))
|
||||
|
||||
/obj/projectile/bullet/incendiary/Move()
|
||||
. = ..()
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
..()
|
||||
var/turf/open/target_turf = get_turf(target)
|
||||
if(istype(target_turf))
|
||||
target_turf.IgniteTurf(rand(8, 16))
|
||||
target_turf.ignite_turf(rand(8, 16))
|
||||
|
||||
if(!isliving(target) || (blocked == 100))
|
||||
return
|
||||
|
||||
@@ -128,7 +128,6 @@
|
||||
description = "An ubiquitous chemical substance that is composed of hydrogen and oxygen."
|
||||
color = "#609bdf77" // rgb: 96, 155, 223, 77 (alpha)
|
||||
taste_description = "water"
|
||||
var/cooling_temperature = 2
|
||||
glass_icon_state = "glass_clear"
|
||||
glass_name = "glass of water"
|
||||
glass_desc = "The father of all refreshments."
|
||||
@@ -143,21 +142,15 @@
|
||||
/datum/reagent/water/reaction_turf(turf/open/T, reac_volume)
|
||||
if(!istype(T))
|
||||
return
|
||||
var/CT = cooling_temperature
|
||||
|
||||
if(reac_volume >= 5)
|
||||
T.MakeSlippery(TURF_WET_WATER, 120 SECONDS, min(reac_volume*3 SECONDS, 300 SECONDS)) //yogs
|
||||
T.MakeSlippery(TURF_WET_WATER, 120 SECONDS, min(reac_volume * 3 SECONDS, 300 SECONDS)) //yogs
|
||||
|
||||
for(var/mob/living/simple_animal/slime/M in T)
|
||||
M.apply_water()
|
||||
|
||||
var/obj/effect/hotspot/hotspot = (locate(/obj/effect/hotspot) in T)
|
||||
if(hotspot && !isspaceturf(T))
|
||||
if(T.air)
|
||||
var/datum/gas_mixture/G = T.air
|
||||
G.set_temperature(max(min(G.return_temperature()-(CT*1000),G.return_temperature()/CT),TCMB))
|
||||
G.react(src)
|
||||
qdel(hotspot)
|
||||
T.extinguish_turf()
|
||||
|
||||
var/obj/effect/acid/A = (locate(/obj/effect/acid) in T)
|
||||
if(A)
|
||||
A.acid_level = max(A.acid_level - reac_volume*50, 0)
|
||||
|
||||
@@ -297,17 +297,7 @@
|
||||
foam.lifetime = initial(foam.lifetime) //reduce object churn a little bit when using smoke by keeping existing foam alive a bit longer
|
||||
|
||||
// If there's a hotspot or turf fire, get rid of them and make the air colder
|
||||
var/obj/effect/hotspot/hotspot = exposed_turf.active_hotspot
|
||||
var/obj/effect/abstract/turf_fire/turf_fire = exposed_turf.turf_fire
|
||||
if((hotspot || turf_fire) && !isspaceturf(exposed_turf) && exposed_turf.air)
|
||||
var/datum/gas_mixture/air = exposed_turf.air
|
||||
if(air.return_temperature() > T20C)
|
||||
air.set_temperature(max(air.return_temperature()/2, T20C))
|
||||
air.react(src)
|
||||
if(hotspot)
|
||||
qdel(hotspot)
|
||||
if(turf_fire)
|
||||
qdel(turf_fire)
|
||||
exposed_turf.extinguish_turf()
|
||||
|
||||
/datum/reagent/firefighting_foam/reaction_obj(obj/O, reac_volume)
|
||||
O.extinguish()
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
|
||||
if(isopenturf(get_turf(D)))
|
||||
var/turf/open/flashy = get_turf(D)
|
||||
flashy.IgniteTurf(rand(5, 10)) //for the flashy
|
||||
flashy.ignite_turf(rand(5, 10)) //for the flashy
|
||||
|
||||
D.ignite_mob()
|
||||
D.apply_damage(A.get_punchdamagehigh() + 3, BRUTE, selected_zone, brute_block) //10 brute
|
||||
@@ -360,7 +360,7 @@
|
||||
target.adjustFireLoss(30)
|
||||
target.ignite_mob()
|
||||
for(var/turf/open/flashy in view_or_range(2, A, "range"))
|
||||
flashy.IgniteTurf(15)
|
||||
flashy.ignite_turf(15)
|
||||
|
||||
var/obj/item/bodypart/hed = D.get_bodypart(BODY_ZONE_HEAD)
|
||||
var/armor_block = D.run_armor_check(hed, BOMB)
|
||||
|
||||
Reference in New Issue
Block a user