Revert "12/21 modernizations from TG live"

This commit is contained in:
LetterJay
2016-12-22 22:35:44 -06:00
committed by GitHub
parent cf59ac1c3d
commit ae40d4134e
2215 changed files with 86928 additions and 707332 deletions
@@ -46,6 +46,7 @@
/obj/effect/hotspot
anchored = 1
mouse_opacity = 0
unacidable = 1//So you can't melt fire with acid.
icon = 'icons/effects/fire.dmi'
icon_state = "1"
layer = ABOVE_OPEN_TURF_LAYER
@@ -58,6 +59,7 @@
/obj/effect/hotspot/New()
..()
set_light(3,1,LIGHT_COLOR_FIRE)
SSair.hotspots += src
perform_exposure()
setDir(pick(cardinal))
@@ -69,8 +71,6 @@
if(!istype(location) || !(location.air))
return 0
location.active_hotspot = src
if(volume > CELL_VOLUME*0.95)
bypassing = 1
else
@@ -89,9 +89,9 @@
location.assume_air(affected)
for(var/A in loc)
var/atom/AT = A
if(AT && AT != src) // It's possible that the item is deleted in temperature_expose
AT.fire_act(temperature, volume)
var/atom/item = A
if(item && item != src) // It's possible that the item is deleted in temperature_expose
item.fire_act(null, temperature, volume)
return 0
@@ -147,10 +147,9 @@
return 1
/obj/effect/hotspot/Destroy()
SetLuminosity(0)
SSair.hotspots -= src
DestroyTurf()
if(isturf(loc))
if(istype(loc, /turf))
var/turf/open/T = loc
if(T.active_hotspot == src)
T.active_hotspot = null
@@ -159,7 +158,8 @@
return QDEL_HINT_PUTINPOOL
/obj/effect/hotspot/proc/DestroyTurf()
if(isturf(loc))
if(istype(loc, /turf))
var/turf/T = loc
if(T.to_be_destroyed)
var/chance_of_deletion
@@ -176,4 +176,4 @@
/obj/effect/hotspot/Crossed(mob/living/L)
..()
if(isliving(L))
L.fire_act(temperature, volume)
L.fire_act()
@@ -1,16 +1,8 @@
/atom/var/CanAtmosPass = ATMOS_PASS_YES
/atom/proc/CanAtmosPass(turf/T)
switch (CanAtmosPass)
if (ATMOS_PASS_PROC)
return ATMOS_PASS_YES
if (ATMOS_PASS_DENSITY)
return !density
else
return CanAtmosPass
/turf/proc/CanAtmosPass(turf/T)
/turf/closed/CanAtmosPass = ATMOS_PASS_NO
/turf/closed/CanAtmosPass(turf/T)
return 0
/turf/open/CanAtmosPass = ATMOS_PASS_PROC
/turf/open/CanAtmosPass(turf/T)
var/R
if(blocks_air || T.blocks_air)
@@ -18,7 +10,7 @@
for(var/obj/O in contents+T.contents)
var/turf/other = (O.loc == src ? T : src)
if(!CANATMOSPASS(O, other))
if(!O.CanAtmosPass(other))
R = 1
if(O.BlockSuperconductivity()) //the direction and open/closed are already checked on CanAtmosPass() so there are no arguments
var/D = get_dir(src, T)
@@ -32,44 +24,53 @@
return !R
/atom/movable/proc/CanAtmosPass()
return 1
/atom/proc/CanPass(atom/movable/mover, turf/target, height=1.5)
return (!density || !height)
/turf/CanPass(atom/movable/mover, turf/target, height=1.5)
if(!target) return 0
if(istype(mover)) // turf/Enter(...) will perform more advanced checks
return !density
else // Now, doing more detailed checks for air movement and air group formation
if(target.blocks_air||blocks_air)
return 0
for(var/obj/obstacle in src)
if(!obstacle.CanPass(mover, target, height))
return 0
for(var/obj/obstacle in target)
if(!obstacle.CanPass(mover, src, height))
return 0
return 1
/atom/movable/proc/BlockSuperconductivity() // objects that block air and don't let superconductivity act. Only firelocks atm.
return 0
/turf/proc/CalculateAdjacentTurfs()
var/list/atmos_adjacent_turfs = src.atmos_adjacent_turfs
for(var/direction in cardinal)
var/turf/T = get_step(src, direction)
if(!T)
var/turf/open/T = get_step(src, direction)
if(!istype(T))
continue
if(CANATMOSPASS(T, src))
LAZYINITLIST(atmos_adjacent_turfs)
LAZYINITLIST(T.atmos_adjacent_turfs)
atmos_adjacent_turfs[T] = TRUE
T.atmos_adjacent_turfs[src] = TRUE
if(CanAtmosPass(T))
atmos_adjacent_turfs |= T
T.atmos_adjacent_turfs |= src
else
if (atmos_adjacent_turfs)
atmos_adjacent_turfs -= T
if (T.atmos_adjacent_turfs)
T.atmos_adjacent_turfs -= src
UNSETEMPTY(T.atmos_adjacent_turfs)
UNSETEMPTY(atmos_adjacent_turfs)
src.atmos_adjacent_turfs = atmos_adjacent_turfs
atmos_adjacent_turfs -= T
T.atmos_adjacent_turfs -= src
//returns a list of adjacent turfs that can share air with this one.
//alldir includes adjacent diagonal tiles that can share
// air with both of the related adjacent cardinal tiles
/turf/proc/GetAtmosAdjacentTurfs(alldir = 0)
var/adjacent_turfs
if (atmos_adjacent_turfs)
adjacent_turfs = atmos_adjacent_turfs.Copy()
else
adjacent_turfs = list()
var/adjacent_turfs = atmos_adjacent_turfs.Copy()
if (!alldir)
return adjacent_turfs
var/turf/curloc = src
for (var/direction in diagonals)
@@ -78,10 +79,10 @@
for (var/checkDirection in cardinal)
var/turf/checkTurf = get_step(S, checkDirection)
if(!S.atmos_adjacent_turfs || !S.atmos_adjacent_turfs[checkTurf])
if(!(checkTurf in S.atmos_adjacent_turfs))
continue
if (adjacent_turfs[checkTurf])
if (checkTurf in adjacent_turfs)
matchingDirections++
if (matchingDirections >= 2)
@@ -90,29 +91,29 @@
return adjacent_turfs
/atom/proc/air_update_turf(command = 0)
if(!isturf(loc) && command)
/atom/movable/proc/air_update_turf(command = 0)
if(!istype(loc,/turf) && command)
return
var/turf/T = get_turf(loc)
T.air_update_turf(command)
/turf/air_update_turf(command = 0)
/turf/proc/air_update_turf(command = 0)
if(command)
CalculateAdjacentTurfs()
SSair.add_to_active(src,command)
/atom/movable/proc/move_update_air(turf/T)
if(isturf(T))
if(istype(T,/turf))
T.air_update_turf(1)
air_update_turf(1)
/atom/proc/atmos_spawn_air(text) //because a lot of people loves to copy paste awful code lets just make a easy proc to spawn your plasma fires
/atom/movable/proc/atmos_spawn_air(text) //because a lot of people loves to copy paste awful code lets just make a easy proc to spawn your plasma fires
var/turf/open/T = get_turf(src)
if(!istype(T))
return
T.atmos_spawn_air(text)
/turf/open/atmos_spawn_air(text)
/turf/open/proc/atmos_spawn_air(text)
if(!text || !air)
return
@@ -5,7 +5,7 @@
var/temperature_archived
//list of open turfs adjacent to us
var/list/atmos_adjacent_turfs
var/list/atmos_adjacent_turfs = list()
//bitfield of dirs in which we are superconducitng
var/atmos_supeconductivity = 0
@@ -33,7 +33,7 @@
var/atmos_cooldown = 0
var/planetary_atmos = FALSE //air will revert to initial_gas_mix over time
var/list/atmos_overlay_types //gas IDs of current active gas overlays
var/list/atmos_overlay_types = list() //gas IDs of current active gas overlays
/turf/open/New()
..()
@@ -98,17 +98,13 @@
/turf/open/proc/update_visuals()
var/list/new_overlay_types = tile_graphic()
if (atmos_overlay_types)
for(var/overlay in atmos_overlay_types-new_overlay_types) //doesn't remove overlays that would only be added
overlays -= overlay
for(var/overlay in atmos_overlay_types-new_overlay_types) //doesn't remove overlays that would only be added
overlays -= overlay
atmos_overlay_types -= overlay
if (new_overlay_types.len)
if (atmos_overlay_types)
add_overlay(new_overlay_types - atmos_overlay_types) //don't add overlays that already exist
else
add_overlay(new_overlay_types)
for(var/overlay in new_overlay_types-atmos_overlay_types) //doesn't add overlays that already exist
add_overlay(overlay)
UNSETEMPTY(new_overlay_types)
atmos_overlay_types = new_overlay_types
/turf/open/proc/tile_graphic()
@@ -134,7 +130,7 @@
//cache for sanic speed
var/list/adjacent_turfs = atmos_adjacent_turfs
var/datum/excited_group/our_excited_group = excited_group
var/adjacent_turfs_length = LAZYLEN(adjacent_turfs)
var/adjacent_turfs_length = adjacent_turfs.len
atmos_cooldown++
if (planetary_atmos)
adjacent_turfs_length++
@@ -250,24 +246,16 @@
for(var/atom/movable/M in src)
M.experience_pressure_difference(pressure_difference, pressure_direction)
/atom/movable/var/pressure_resistance = 10
/atom/movable/var/pressure_resistance = 5
/atom/movable/var/last_high_pressure_movement_air_cycle = 0
/atom/movable/proc/experience_pressure_difference(pressure_difference, direction, pressure_resistance_prob_delta = 0)
var/const/PROBABILITY_OFFSET = 25
var/const/PROBABILITY_BASE_PRECENT = 75
/atom/movable/proc/experience_pressure_difference(pressure_difference, direction)
set waitfor = 0
. = 0
if (!anchored && !pulledby)
if(!anchored && !pulledby)
. = 1
if (last_high_pressure_movement_air_cycle < SSair.times_fired)
var/move_prob = 100
if (pressure_resistance > 0)
move_prob = (pressure_difference/pressure_resistance*PROBABILITY_BASE_PRECENT)-PROBABILITY_OFFSET
move_prob += pressure_resistance_prob_delta
if (move_prob > PROBABILITY_OFFSET && prob(move_prob))
step(src, direction)
last_high_pressure_movement_air_cycle = SSair.times_fired
if(pressure_difference > pressure_resistance && last_high_pressure_movement_air_cycle < SSair.times_fired)
last_high_pressure_movement_air_cycle = SSair.times_fired
step(src, direction)
///////////////////////////EXCITED GROUPS/////////////////////////////
@@ -457,4 +445,4 @@
(heat_capacity*sharer.heat_capacity/(heat_capacity+sharer.heat_capacity))
temperature -= heat/heat_capacity
sharer.temperature += heat/sharer.heat_capacity
sharer.temperature += heat/sharer.heat_capacity