Merge pull request #32362 from tgstation/Cyberboss-patch-2
Improves hotspot code
This commit is contained in:
@@ -54,11 +54,11 @@
|
||||
|
||||
var/volume = 125
|
||||
var/temperature = FIRE_MINIMUM_TEMPERATURE_TO_EXIST
|
||||
var/just_spawned = 1
|
||||
var/bypassing = 0
|
||||
var/just_spawned = TRUE
|
||||
var/bypassing = FALSE
|
||||
|
||||
/obj/effect/hotspot/New()
|
||||
..()
|
||||
/obj/effect/hotspot/Initialize()
|
||||
. = ..()
|
||||
SSair.hotspots += src
|
||||
perform_exposure()
|
||||
setDir(pick(GLOB.cardinals))
|
||||
@@ -67,14 +67,14 @@
|
||||
/obj/effect/hotspot/proc/perform_exposure()
|
||||
var/turf/open/location = loc
|
||||
if(!istype(location) || !(location.air))
|
||||
return 0
|
||||
return
|
||||
|
||||
location.active_hotspot = src
|
||||
|
||||
if(volume > CELL_VOLUME*0.95)
|
||||
bypassing = 1
|
||||
bypassing = TRUE
|
||||
else
|
||||
bypassing = 0
|
||||
bypassing = FALSE
|
||||
|
||||
if(bypassing)
|
||||
if(!just_spawned)
|
||||
@@ -88,17 +88,17 @@
|
||||
volume = affected.reaction_results["fire"]*FIRE_GROWTH_RATE
|
||||
location.assume_air(affected)
|
||||
|
||||
for(var/A in loc)
|
||||
for(var/A in location)
|
||||
var/atom/AT = A
|
||||
if(AT && AT != src) // It's possible that the item is deleted in temperature_expose
|
||||
AT.fire_act(temperature, volume)
|
||||
return 0
|
||||
return
|
||||
|
||||
|
||||
/obj/effect/hotspot/process()
|
||||
if(just_spawned)
|
||||
just_spawned = 0
|
||||
return 0
|
||||
just_spawned = FALSE
|
||||
return
|
||||
|
||||
var/turf/open/location = loc
|
||||
if(!istype(location))
|
||||
@@ -140,11 +140,8 @@
|
||||
location.max_fire_temperature_sustained = temperature
|
||||
|
||||
if(location.heat_capacity && temperature > location.heat_capacity)
|
||||
location.to_be_destroyed = 1
|
||||
/*if(prob(25))
|
||||
location.ReplaceWithSpace()
|
||||
return 0*/
|
||||
return 1
|
||||
location.to_be_destroyed = TRUE
|
||||
return TRUE
|
||||
|
||||
/obj/effect/hotspot/Destroy()
|
||||
set_light(0)
|
||||
@@ -153,8 +150,7 @@
|
||||
if(istype(T) && T.active_hotspot == src)
|
||||
T.active_hotspot = null
|
||||
DestroyTurf()
|
||||
loc = null
|
||||
. = ..()
|
||||
return ..()
|
||||
|
||||
/obj/effect/hotspot/proc/DestroyTurf()
|
||||
if(isturf(loc))
|
||||
@@ -168,12 +164,13 @@
|
||||
if(prob(chance_of_deletion))
|
||||
T.ChangeTurf(T.baseturf)
|
||||
else
|
||||
T.to_be_destroyed = 0
|
||||
T.to_be_destroyed = FALSE
|
||||
T.max_fire_temperature_sustained = 0
|
||||
|
||||
/obj/effect/hotspot/Crossed(mob/living/L)
|
||||
/obj/effect/hotspot/Crossed(atom/movable/AM, oldLoc)
|
||||
..()
|
||||
if(isliving(L))
|
||||
if(isliving(AM))
|
||||
var/mob/living/L = AM
|
||||
L.fire_act(temperature, volume)
|
||||
|
||||
/obj/effect/dummy/fire
|
||||
@@ -186,4 +183,4 @@
|
||||
/obj/effect/dummy/fire/Initialize()
|
||||
. = ..()
|
||||
if(!isliving(loc))
|
||||
qdel(src)
|
||||
return INITIALIZE_HINT_QDEL
|
||||
|
||||
Reference in New Issue
Block a user