monstermos wow
This commit is contained in:
@@ -9,46 +9,31 @@
|
||||
return
|
||||
|
||||
|
||||
/turf/open/hotspot_expose(exposed_temperature, exposed_volume, soh = FALSE, holo = FALSE)
|
||||
var/datum/gas_mixture/air_contents = return_air()
|
||||
if(!air_contents)
|
||||
return 0
|
||||
/turf/open/hotspot_expose(exposed_temperature, exposed_volume, soh)
|
||||
if(!air)
|
||||
return
|
||||
|
||||
var/oxy = air_contents.get_moles(/datum/gas/oxygen)
|
||||
var/tox = air_contents.get_moles(/datum/gas/plasma)
|
||||
var/trit = air_contents.get_moles(/datum/gas/tritium)
|
||||
var/oxy = air.get_moles(/datum/gas/oxygen)
|
||||
if (oxy < 0.5)
|
||||
return
|
||||
var/tox = air.get_moles(/datum/gas/plasma)
|
||||
var/trit = air.get_moles(/datum/gas/tritium)
|
||||
if(active_hotspot)
|
||||
if(soh)
|
||||
if((tox > 0.5 || trit > 0.5) && oxy > 0.5)
|
||||
if(active_hotspot.temperature < exposed_temperature*50)
|
||||
active_hotspot.temperature = exposed_temperature*50
|
||||
if(tox > 0.5 || trit > 0.5)
|
||||
if(active_hotspot.temperature < exposed_temperature)
|
||||
active_hotspot.temperature = exposed_temperature
|
||||
if(active_hotspot.volume < exposed_volume)
|
||||
active_hotspot.volume = exposed_volume
|
||||
return 1
|
||||
|
||||
var/igniting = 0
|
||||
return
|
||||
|
||||
if((exposed_temperature > PLASMA_MINIMUM_BURN_TEMPERATURE) && (tox > 0.5 || trit > 0.5))
|
||||
igniting = 1
|
||||
|
||||
if(igniting)
|
||||
if(oxy < 0.5)
|
||||
return 0
|
||||
|
||||
active_hotspot = new /obj/effect/hotspot(src, holo)
|
||||
active_hotspot.temperature = exposed_temperature*50
|
||||
active_hotspot.volume = exposed_volume*25
|
||||
active_hotspot = new /obj/effect/hotspot(src, exposed_volume*25, exposed_temperature)
|
||||
|
||||
active_hotspot.just_spawned = (current_cycle < SSair.times_fired)
|
||||
//remove just_spawned protection if no longer processing this cell
|
||||
SSair.add_to_active(src, 0)
|
||||
else
|
||||
var/datum/gas_mixture/heating = air_contents.remove_ratio(exposed_volume/air_contents.return_volume())
|
||||
heating.set_temperature(exposed_temperature)
|
||||
heating.react()
|
||||
assume_air(heating)
|
||||
air_update_turf()
|
||||
return igniting
|
||||
|
||||
//This is the icon for fire on turfs, also helps for nurturing small fires until they are full tile
|
||||
/obj/effect/hotspot
|
||||
@@ -67,11 +52,13 @@
|
||||
var/bypassing = FALSE
|
||||
var/visual_update_tick = 0
|
||||
|
||||
/obj/effect/hotspot/Initialize(mapload, holo = FALSE)
|
||||
/obj/effect/hotspot/Initialize(mapload, starting_volume, starting_temperature)
|
||||
. = ..()
|
||||
if(holo)
|
||||
flags_1 |= HOLOGRAM_1
|
||||
SSair.hotspots += src
|
||||
if(!isnull(starting_volume))
|
||||
volume = starting_volume
|
||||
if(!isnull(starting_temperature))
|
||||
temperature = starting_temperature
|
||||
perform_exposure()
|
||||
setDir(pick(GLOB.cardinals))
|
||||
air_update_turf()
|
||||
@@ -83,22 +70,19 @@
|
||||
|
||||
location.active_hotspot = src
|
||||
|
||||
if(volume > CELL_VOLUME*0.95)
|
||||
bypassing = TRUE
|
||||
else
|
||||
bypassing = FALSE
|
||||
bypassing = !just_spawned && (volume > CELL_VOLUME*0.95)
|
||||
|
||||
if(bypassing)
|
||||
if(!just_spawned)
|
||||
volume = location.air.reaction_results["fire"]*FIRE_GROWTH_RATE
|
||||
temperature = location.air.return_temperature()
|
||||
volume = location.air.reaction_results["fire"]*FIRE_GROWTH_RATE
|
||||
temperature = location.air.return_temperature()
|
||||
else
|
||||
var/datum/gas_mixture/affected = location.air.remove_ratio(volume/location.air.return_volume())
|
||||
affected.set_temperature(temperature)
|
||||
affected.react(src)
|
||||
temperature = affected.return_temperature()
|
||||
volume = affected.reaction_results["fire"]*FIRE_GROWTH_RATE
|
||||
location.assume_air(affected)
|
||||
if(affected) //in case volume is 0
|
||||
affected.set_temperature(temperature)
|
||||
affected.react(src)
|
||||
temperature = affected.return_temperature()
|
||||
volume = affected.reaction_results["fire"]*FIRE_GROWTH_RATE
|
||||
location.assume_air(affected)
|
||||
|
||||
for(var/A in location)
|
||||
var/atom/AT = A
|
||||
@@ -175,8 +159,7 @@
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
if(location.excited_group)
|
||||
location.excited_group.reset_cooldowns()
|
||||
location.eg_reset_cooldowns()
|
||||
|
||||
if((temperature < FIRE_MINIMUM_TEMPERATURE_TO_EXIST) || (volume <= 1))
|
||||
qdel(src)
|
||||
@@ -185,12 +168,17 @@
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
//Not enough to burn
|
||||
// god damn it previous coder you made the INSUFFICIENT macro for a fucking reason why didn't you use it here smh
|
||||
if((INSUFFICIENT(/datum/gas/plasma) && INSUFFICIENT(/datum/gas/tritium)) || INSUFFICIENT(/datum/gas/oxygen))
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
perform_exposure()
|
||||
|
||||
if(bypassing)
|
||||
icon_state = "3"
|
||||
if(!(flags_1 & HOLOGRAM_1))
|
||||
location.burn_tile()
|
||||
location.burn_tile()
|
||||
|
||||
//Possible spread due to radiated heat
|
||||
if(location.air.return_temperature() > FIRE_MINIMUM_TEMPERATURE_TO_SPREAD)
|
||||
@@ -198,7 +186,7 @@
|
||||
for(var/t in location.atmos_adjacent_turfs)
|
||||
var/turf/open/T = t
|
||||
if(!T.active_hotspot)
|
||||
T.hotspot_expose(radiated_temperature, CELL_VOLUME/4, flags_1 & HOLOGRAM_1)
|
||||
T.hotspot_expose(radiated_temperature, CELL_VOLUME/4)
|
||||
|
||||
else
|
||||
if(volume > CELL_VOLUME*0.4)
|
||||
@@ -222,14 +210,13 @@
|
||||
var/turf/open/T = loc
|
||||
if(istype(T) && T.active_hotspot == src)
|
||||
T.active_hotspot = null
|
||||
if(!(flags_1 & HOLOGRAM_1))
|
||||
DestroyTurf()
|
||||
DestroyTurf()
|
||||
return ..()
|
||||
|
||||
/obj/effect/hotspot/proc/DestroyTurf()
|
||||
if(isturf(loc))
|
||||
var/turf/T = loc
|
||||
if(T.to_be_destroyed)
|
||||
if(T.to_be_destroyed && !T.changing_turf)
|
||||
var/chance_of_deletion
|
||||
if (T.heat_capacity) //beware of division by zero
|
||||
chance_of_deletion = T.max_fire_temperature_sustained / T.heat_capacity * 8 //there is no problem with prob(23456), min() was redundant --rastaf0
|
||||
|
||||
@@ -44,25 +44,32 @@
|
||||
return FALSE
|
||||
|
||||
/turf/proc/ImmediateCalculateAdjacentTurfs()
|
||||
var/canpass = CANATMOSPASS(src, src)
|
||||
var/canpass = CANATMOSPASS(src, src)
|
||||
var/canvpass = CANVERTICALATMOSPASS(src, src)
|
||||
for(var/direction in GLOB.cardinals_multiz)
|
||||
var/turf/T = get_step_multiz(src, direction)
|
||||
var/opp_dir = dir_inverse_multiz(direction)
|
||||
if(!isopenturf(T))
|
||||
continue
|
||||
if(!(blocks_air || T.blocks_air) && ((direction & (UP|DOWN))? (canvpass && CANVERTICALATMOSPASS(T, src)) : (canpass && CANATMOSPASS(T, src))) )
|
||||
LAZYINITLIST(atmos_adjacent_turfs)
|
||||
LAZYINITLIST(T.atmos_adjacent_turfs)
|
||||
atmos_adjacent_turfs[T] = TRUE
|
||||
T.atmos_adjacent_turfs[src] = TRUE
|
||||
atmos_adjacent_turfs[T] = direction
|
||||
T.atmos_adjacent_turfs[src] = opp_dir
|
||||
T.__update_extools_adjacent_turfs()
|
||||
else
|
||||
if (atmos_adjacent_turfs)
|
||||
atmos_adjacent_turfs -= T
|
||||
if (T.atmos_adjacent_turfs)
|
||||
T.atmos_adjacent_turfs -= src
|
||||
T.__update_extools_adjacent_turfs()
|
||||
UNSETEMPTY(T.atmos_adjacent_turfs)
|
||||
UNSETEMPTY(atmos_adjacent_turfs)
|
||||
src.atmos_adjacent_turfs = atmos_adjacent_turfs
|
||||
__update_extools_adjacent_turfs()
|
||||
|
||||
/turf/proc/__update_extools_adjacent_turfs()
|
||||
|
||||
|
||||
//returns a list of adjacent turfs that can share air with this one.
|
||||
//alldir includes adjacent diagonal tiles that can share
|
||||
@@ -111,9 +118,9 @@
|
||||
SSair.add_to_active(src,command)
|
||||
|
||||
/atom/movable/proc/move_update_air(turf/T)
|
||||
if(isturf(T))
|
||||
T.air_update_turf(1)
|
||||
air_update_turf(1)
|
||||
if(isturf(T))
|
||||
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 an easy proc to spawn your plasma fires
|
||||
var/turf/open/T = get_turf(src)
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
var/list/atmos_adjacent_turfs
|
||||
//bitfield of dirs in which we are superconducitng
|
||||
var/atmos_supeconductivity = NONE
|
||||
var/is_openturf = FALSE // used by extools shizz.
|
||||
|
||||
//used to determine whether we should archive
|
||||
var/archived_cycle = 0
|
||||
@@ -23,21 +24,21 @@
|
||||
//used for spacewind
|
||||
var/pressure_difference = 0
|
||||
var/pressure_direction = 0
|
||||
var/turf/pressure_specific_target
|
||||
|
||||
var/datum/excited_group/excited_group
|
||||
var/excited = FALSE
|
||||
var/datum/gas_mixture/turf/air
|
||||
|
||||
var/obj/effect/hotspot/active_hotspot
|
||||
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
|
||||
is_openturf = TRUE
|
||||
|
||||
/turf/open/Initialize()
|
||||
if(!blocks_air)
|
||||
air = new
|
||||
air.copy_from_turf(src)
|
||||
update_air_ref()
|
||||
. = ..()
|
||||
|
||||
/turf/open/Destroy()
|
||||
@@ -48,6 +49,8 @@
|
||||
SSair.add_to_active(T)
|
||||
return ..()
|
||||
|
||||
/turf/proc/update_air_ref()
|
||||
|
||||
/////////////////GAS MIXTURE PROCS///////////////////
|
||||
|
||||
/turf/open/assume_air(datum/gas_mixture/giver) //use this for machines to adjust air
|
||||
@@ -93,11 +96,33 @@
|
||||
archived_cycle = SSair.times_fired
|
||||
temperature_archived = temperature
|
||||
|
||||
/turf/open/proc/eg_reset_cooldowns()
|
||||
/turf/open/proc/eg_garbage_collect()
|
||||
/turf/open/proc/get_excited()
|
||||
/turf/open/proc/set_excited()
|
||||
|
||||
/////////////////////////GAS OVERLAYS//////////////////////////////
|
||||
|
||||
|
||||
/turf/open/proc/update_visuals()
|
||||
var/list/new_overlay_types = tile_graphic()
|
||||
|
||||
var/list/atmos_overlay_types = src.atmos_overlay_types // Cache for free performance
|
||||
var/list/new_overlay_types = list()
|
||||
var/static/list/nonoverlaying_gases = typecache_of_gases_with_no_overlays()
|
||||
|
||||
if(!air) // 2019-05-14: was not able to get this path to fire in testing. Consider removing/looking at callers -Naksu
|
||||
if (atmos_overlay_types)
|
||||
for(var/overlay in atmos_overlay_types)
|
||||
vis_contents -= overlay
|
||||
src.atmos_overlay_types = null
|
||||
return
|
||||
|
||||
for(var/id in air.get_gases())
|
||||
if (nonoverlaying_gases[id])
|
||||
continue
|
||||
var/gas_overlay = GLOB.meta_gas_overlays[id]
|
||||
if(gas_overlay && air.get_moles(id) > GLOB.meta_gas_visibility[META_GAS_MOLES_VISIBLE])
|
||||
new_overlay_types += gas_overlay[min(FACTOR_GAS_VISIBLE_MAX, CEILING(air.get_moles(id) / MOLES_GAS_VISIBLE_STEP, 1))]
|
||||
|
||||
if (atmos_overlay_types)
|
||||
for(var/overlay in atmos_overlay_types-new_overlay_types) //doesn't remove overlays that would only be added
|
||||
@@ -112,18 +137,18 @@
|
||||
UNSETEMPTY(new_overlay_types)
|
||||
src.atmos_overlay_types = new_overlay_types
|
||||
|
||||
/turf/open/proc/tile_graphic()
|
||||
var/static/list/nonoverlaying_gases = typecache_of_gases_with_no_overlays()
|
||||
if(!air)
|
||||
return
|
||||
. = new /list
|
||||
for(var/id in air.get_gases())
|
||||
if (nonoverlaying_gases[id])
|
||||
continue
|
||||
var/gas = air.get_moles(id)
|
||||
var/gas_overlay = GLOB.meta_gas_overlays[id]
|
||||
if(gas_overlay && gas > GLOB.meta_gas_visibility[id])
|
||||
. += gas_overlay[min(FACTOR_GAS_VISIBLE_MAX, CEILING(gas / MOLES_GAS_VISIBLE_STEP, 1))]
|
||||
/turf/open/proc/set_visuals(list/new_overlay_types)
|
||||
if (atmos_overlay_types)
|
||||
for(var/overlay in atmos_overlay_types-new_overlay_types) //doesn't remove overlays that would only be added
|
||||
vis_contents -= overlay
|
||||
|
||||
if (length(new_overlay_types))
|
||||
if (atmos_overlay_types)
|
||||
vis_contents += new_overlay_types - atmos_overlay_types //don't add overlays that already exist
|
||||
else
|
||||
vis_contents += new_overlay_types
|
||||
UNSETEMPTY(new_overlay_types)
|
||||
src.atmos_overlay_types = new_overlay_types
|
||||
|
||||
/proc/typecache_of_gases_with_no_overlays()
|
||||
. = list()
|
||||
@@ -134,7 +159,7 @@
|
||||
|
||||
/////////////////////////////SIMULATION///////////////////////////////////
|
||||
|
||||
#define LAST_SHARE_CHECK \
|
||||
/*#define LAST_SHARE_CHECK \
|
||||
var/last_share = our_air.get_last_share();\
|
||||
if(last_share > MINIMUM_AIR_TO_SUSPEND){\
|
||||
our_excited_group.reset_cooldowns();\
|
||||
@@ -143,102 +168,32 @@
|
||||
our_excited_group.dismantle_cooldown = 0;\
|
||||
cached_atmos_cooldown = 0;\
|
||||
}
|
||||
|
||||
*/
|
||||
/turf/proc/process_cell(fire_count)
|
||||
SSair.remove_from_active(src)
|
||||
|
||||
/turf/open/process_cell(fire_count)
|
||||
if(archived_cycle < fire_count) //archive self if not already done
|
||||
archive()
|
||||
|
||||
current_cycle = fire_count
|
||||
|
||||
//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/cached_atmos_cooldown = atmos_cooldown + 1
|
||||
|
||||
var/planet_atmos = planetary_atmos
|
||||
if (planet_atmos)
|
||||
adjacent_turfs_length++
|
||||
|
||||
var/datum/gas_mixture/our_air = air
|
||||
|
||||
for(var/t in adjacent_turfs)
|
||||
var/turf/open/enemy_tile = t
|
||||
|
||||
if(fire_count <= enemy_tile.current_cycle)
|
||||
/turf/open/proc/equalize_pressure_in_zone(cyclenum)
|
||||
/turf/open/proc/consider_firelocks(turf/T2)
|
||||
var/reconsider_adj = FALSE
|
||||
for(var/obj/machinery/door/firedoor/FD in T2)
|
||||
if((FD.flags_1 & ON_BORDER_1) && get_dir(T2, src) != FD.dir)
|
||||
continue
|
||||
enemy_tile.archive()
|
||||
FD.emergency_pressure_stop()
|
||||
reconsider_adj = TRUE
|
||||
for(var/obj/machinery/door/firedoor/FD in src)
|
||||
if((FD.flags_1 & ON_BORDER_1) && get_dir(src, T2) != FD.dir)
|
||||
continue
|
||||
FD.emergency_pressure_stop()
|
||||
reconsider_adj = TRUE
|
||||
if(reconsider_adj)
|
||||
T2.ImmediateCalculateAdjacentTurfs() // We want those firelocks closed yesterday.
|
||||
|
||||
/******************* GROUP HANDLING START *****************************************************************/
|
||||
/turf/proc/handle_decompression_floor_rip()
|
||||
/turf/open/floor/handle_decompression_floor_rip(sum)
|
||||
if(sum > 20 && prob(clamp(sum / 10, 0, 30)))
|
||||
remove_tile()
|
||||
|
||||
var/should_share_air = FALSE
|
||||
var/datum/gas_mixture/enemy_air = enemy_tile.air
|
||||
|
||||
//cache for sanic speed
|
||||
var/datum/excited_group/enemy_excited_group = enemy_tile.excited_group
|
||||
|
||||
if(our_excited_group && enemy_excited_group)
|
||||
if(our_excited_group != enemy_excited_group)
|
||||
//combine groups (this also handles updating the excited_group var of all involved turfs)
|
||||
our_excited_group.merge_groups(enemy_excited_group)
|
||||
our_excited_group = excited_group //update our cache
|
||||
should_share_air = TRUE
|
||||
|
||||
else if(our_air.compare(enemy_air))
|
||||
if(!enemy_tile.excited)
|
||||
SSair.add_to_active(enemy_tile)
|
||||
var/datum/excited_group/EG = our_excited_group || enemy_excited_group || new
|
||||
if(!our_excited_group)
|
||||
EG.add_turf(src)
|
||||
if(!enemy_excited_group)
|
||||
EG.add_turf(enemy_tile)
|
||||
our_excited_group = excited_group
|
||||
should_share_air = TRUE
|
||||
|
||||
//air sharing
|
||||
if(should_share_air)
|
||||
var/difference = our_air.share(enemy_air, adjacent_turfs_length)
|
||||
if(difference)
|
||||
if(difference > 0)
|
||||
consider_pressure_difference(enemy_tile, difference)
|
||||
else
|
||||
enemy_tile.consider_pressure_difference(src, -difference)
|
||||
LAST_SHARE_CHECK
|
||||
|
||||
|
||||
/******************* GROUP HANDLING FINISH *********************************************************************/
|
||||
|
||||
if (planet_atmos) //share our air with the "atmosphere" "above" the turf
|
||||
var/datum/gas_mixture/G = new
|
||||
G.copy_from_turf(src)
|
||||
G.archive()
|
||||
if(our_air.compare(G))
|
||||
if(!our_excited_group)
|
||||
var/datum/excited_group/EG = new
|
||||
EG.add_turf(src)
|
||||
our_excited_group = excited_group
|
||||
our_air.share(G, adjacent_turfs_length)
|
||||
LAST_SHARE_CHECK
|
||||
|
||||
SSair.add_to_react_queue(src)
|
||||
|
||||
if((!our_excited_group && !(our_air.return_temperature() > MINIMUM_TEMPERATURE_START_SUPERCONDUCTION && consider_superconductivity(starting = TRUE))) \
|
||||
|| (cached_atmos_cooldown > (EXCITED_GROUP_DISMANTLE_CYCLES * 2)))
|
||||
SSair.remove_from_active(src)
|
||||
|
||||
atmos_cooldown = cached_atmos_cooldown
|
||||
|
||||
/turf/proc/process_cell_reaction()
|
||||
SSair.remove_from_react_queue(src)
|
||||
|
||||
/turf/open/process_cell_reaction()
|
||||
air.react(src)
|
||||
update_visuals()
|
||||
SSair.remove_from_react_queue(src)
|
||||
return
|
||||
/turf/open/process_cell(fire_count)
|
||||
|
||||
//////////////////////////SPACEWIND/////////////////////////////
|
||||
|
||||
@@ -250,17 +205,24 @@
|
||||
|
||||
/turf/open/proc/high_pressure_movements()
|
||||
var/atom/movable/M
|
||||
var/multiplier = 1
|
||||
if(locate(/obj/structure/rack) in src)
|
||||
multiplier *= 0.1
|
||||
else if(locate(/obj/structure/table) in src)
|
||||
multiplier *= 0.2
|
||||
for(var/thing in src)
|
||||
M = thing
|
||||
if (!M.anchored && !M.pulledby && M.last_high_pressure_movement_air_cycle < SSair.times_fired)
|
||||
M.experience_pressure_difference(pressure_difference, pressure_direction)
|
||||
M.experience_pressure_difference(pressure_difference * multiplier, pressure_direction, 0, pressure_specific_target)
|
||||
if(pressure_difference > 100)
|
||||
new /obj/effect/temp_visual/dir_setting/space_wind(src, pressure_direction, clamp(round(sqrt(pressure_difference) * 2), 10, 255))
|
||||
|
||||
/atom/movable/var/pressure_resistance = 10
|
||||
/atom/movable/var/last_high_pressure_movement_air_cycle = 0
|
||||
|
||||
/atom/movable/proc/experience_pressure_difference(pressure_difference, direction, pressure_resistance_prob_delta = 0)
|
||||
/atom/movable/proc/experience_pressure_difference(pressure_difference, direction, pressure_resistance_prob_delta = 0, throw_target)
|
||||
var/const/PROBABILITY_OFFSET = 25
|
||||
var/const/PROBABILITY_BASE_PRECENT = 75
|
||||
var/const/PROBABILITY_BASE_PRECENT = 10
|
||||
var/max_force = sqrt(pressure_difference)*(MOVE_FORCE_DEFAULT / 5)
|
||||
set waitfor = 0
|
||||
var/move_prob = 100
|
||||
@@ -268,91 +230,19 @@
|
||||
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) && (move_resist != INFINITY) && (!anchored && (max_force >= (move_resist * MOVE_FORCE_PUSH_RATIO))) || (anchored && (max_force >= (move_resist * MOVE_FORCE_FORCEPUSH_RATIO))))
|
||||
step(src, direction)
|
||||
var/move_force = max_force * clamp(move_prob, 0, 100) / 100
|
||||
if(move_force > 4000)
|
||||
// WALLSLAM HELL TIME OH BOY
|
||||
var/turf/throw_turf = get_ranged_target_turf(get_turf(src), direction, round(move_force / 2000))
|
||||
if(throw_target && (get_dir(src, throw_target) & direction))
|
||||
throw_turf = get_turf(throw_target)
|
||||
var/throw_speed = clamp(round(move_force / 2000), 1, 10)
|
||||
throw_at(throw_turf, move_force / 2000, throw_speed)
|
||||
else
|
||||
step(src, direction)
|
||||
last_high_pressure_movement_air_cycle = SSair.times_fired
|
||||
|
||||
///////////////////////////EXCITED GROUPS/////////////////////////////
|
||||
|
||||
/datum/excited_group
|
||||
var/list/turf_list = list()
|
||||
var/breakdown_cooldown = 0
|
||||
var/dismantle_cooldown = 0
|
||||
|
||||
/datum/excited_group/New()
|
||||
SSair.excited_groups += src
|
||||
|
||||
/datum/excited_group/proc/add_turf(turf/open/T)
|
||||
turf_list += T
|
||||
T.excited_group = src
|
||||
reset_cooldowns()
|
||||
|
||||
/datum/excited_group/proc/merge_groups(datum/excited_group/E)
|
||||
if(turf_list.len > E.turf_list.len)
|
||||
SSair.excited_groups -= E
|
||||
for(var/t in E.turf_list)
|
||||
var/turf/open/T = t
|
||||
T.excited_group = src
|
||||
turf_list += T
|
||||
reset_cooldowns()
|
||||
else
|
||||
SSair.excited_groups -= src
|
||||
for(var/t in turf_list)
|
||||
var/turf/open/T = t
|
||||
T.excited_group = E
|
||||
E.turf_list += T
|
||||
E.reset_cooldowns()
|
||||
|
||||
/datum/excited_group/proc/reset_cooldowns()
|
||||
breakdown_cooldown = 0
|
||||
dismantle_cooldown = 0
|
||||
|
||||
//argument is so world start can clear out any turf differences quickly.
|
||||
/datum/excited_group/proc/self_breakdown(space_is_all_consuming = FALSE)
|
||||
var/datum/gas_mixture/A = new
|
||||
|
||||
//make local for sanic speed
|
||||
var/list/turf_list = src.turf_list
|
||||
var/turflen = turf_list.len
|
||||
var/space_in_group = FALSE
|
||||
|
||||
for(var/t in turf_list)
|
||||
var/turf/open/T = t
|
||||
if (space_is_all_consuming && !space_in_group && istype(T.air, /datum/gas_mixture/immutable/space))
|
||||
space_in_group = TRUE
|
||||
qdel(A)
|
||||
A = new /datum/gas_mixture/immutable/space()
|
||||
break
|
||||
A.merge(T.air)
|
||||
|
||||
A.multiply(1/turflen)
|
||||
|
||||
for(var/t in turf_list)
|
||||
var/turf/open/T = t
|
||||
T.air.copy_from(A)
|
||||
T.atmos_cooldown = 0
|
||||
T.update_visuals()
|
||||
|
||||
breakdown_cooldown = 0
|
||||
|
||||
/datum/excited_group/proc/dismantle()
|
||||
for(var/t in turf_list)
|
||||
var/turf/open/T = t
|
||||
T.excited = FALSE
|
||||
T.excited_group = null
|
||||
SSair.active_turfs -= T
|
||||
garbage_collect()
|
||||
|
||||
/datum/excited_group/proc/garbage_collect()
|
||||
for(var/t in turf_list)
|
||||
var/turf/open/T = t
|
||||
T.excited_group = null
|
||||
turf_list.Cut()
|
||||
SSair.excited_groups -= src
|
||||
|
||||
////////////////////////SUPERCONDUCTIVITY/////////////////////////////
|
||||
/atom/movable/proc/blocksTemperature()
|
||||
return FALSE
|
||||
|
||||
/turf/proc/conductivity_directions()
|
||||
if(archived_cycle < SSair.times_fired)
|
||||
archive()
|
||||
@@ -367,9 +257,6 @@
|
||||
. |= direction
|
||||
|
||||
/turf/proc/neighbor_conduct_with_src(turf/open/other)
|
||||
for (var/atom/movable/G in src)
|
||||
if (G.blocksTemperature())
|
||||
return
|
||||
if(!other.blocks_air) //Open but neighbor is solid
|
||||
other.temperature_share_open_to_solid(src)
|
||||
else //Both tiles are solid
|
||||
@@ -380,9 +267,7 @@
|
||||
if(blocks_air)
|
||||
..()
|
||||
return
|
||||
for (var/atom/movable/G in src)
|
||||
if (G.blocksTemperature())
|
||||
return
|
||||
|
||||
if(!other.blocks_air) //Both tiles are open
|
||||
var/turf/open/T = other
|
||||
T.air.temperature_share(air, WINDOW_HEAT_TRANSFER_COEFFICIENT)
|
||||
@@ -401,8 +286,10 @@
|
||||
|
||||
if(!neighbor.thermal_conductivity)
|
||||
continue
|
||||
|
||||
if(neighbor.archived_cycle < SSair.times_fired)
|
||||
neighbor.archive()
|
||||
|
||||
neighbor.neighbor_conduct_with_src(src)
|
||||
|
||||
neighbor.consider_superconductivity()
|
||||
|
||||
@@ -81,20 +81,17 @@
|
||||
parent1.update = 1
|
||||
|
||||
else //external -> output
|
||||
var/pressure_delta = 10000
|
||||
if(environment.return_pressure() > 0)
|
||||
var/our_multiplier = air2.return_volume() / (environment.return_temperature() * R_IDEAL_GAS_EQUATION)
|
||||
var/moles_delta = 10000 * our_multiplier
|
||||
if(pressure_checks&EXT_BOUND)
|
||||
moles_delta = min(moles_delta, (environment_pressure - output_pressure_max) * environment.return_volume() / (environment.return_temperature() * R_IDEAL_GAS_EQUATION))
|
||||
if(pressure_checks&INPUT_MIN)
|
||||
moles_delta = min(moles_delta, (input_pressure_min - air2.return_pressure()) * our_multiplier)
|
||||
|
||||
if(pressure_checks&EXT_BOUND)
|
||||
pressure_delta = min(pressure_delta, (environment_pressure - external_pressure_bound))
|
||||
if(pressure_checks&INPUT_MIN)
|
||||
pressure_delta = min(pressure_delta, (output_pressure_max - air2.return_pressure()))
|
||||
|
||||
if(pressure_delta > 0)
|
||||
if(environment.return_temperature() > 0)
|
||||
var/transfer_moles = pressure_delta*air2.return_volume()/(environment.return_temperature() * R_IDEAL_GAS_EQUATION)
|
||||
|
||||
var/datum/gas_mixture/removed = loc.remove_air(transfer_moles)
|
||||
//removed can be null if there is no air in the location
|
||||
if(!removed)
|
||||
if(moles_delta > 0)
|
||||
var/datum/gas_mixture/removed = loc.remove_air(moles_delta)
|
||||
if (isnull(removed)) // in space
|
||||
return
|
||||
|
||||
air2.merge(removed)
|
||||
|
||||
@@ -113,21 +113,21 @@
|
||||
air_update_turf()
|
||||
|
||||
else // external -> internal
|
||||
var/pressure_delta = 10000
|
||||
if(pressure_checks&EXT_BOUND)
|
||||
pressure_delta = min(pressure_delta, (environment_pressure - external_pressure_bound))
|
||||
if(pressure_checks&INT_BOUND)
|
||||
pressure_delta = min(pressure_delta, (internal_pressure_bound - air_contents.return_pressure()))
|
||||
if(environment.return_pressure() > 0)
|
||||
var/our_multiplier = air_contents.return_volume() / (environment.return_temperature() * R_IDEAL_GAS_EQUATION)
|
||||
var/moles_delta = 10000 * our_multiplier
|
||||
if(pressure_checks&EXT_BOUND)
|
||||
moles_delta = min(moles_delta, (environment_pressure - external_pressure_bound) * environment.return_volume() / (environment.return_temperature() * R_IDEAL_GAS_EQUATION))
|
||||
if(pressure_checks&INT_BOUND)
|
||||
moles_delta = min(moles_delta, (internal_pressure_bound - air_contents.return_pressure()) * our_multiplier)
|
||||
|
||||
if(pressure_delta > 0 && environment.return_temperature() > 0)
|
||||
var/transfer_moles = pressure_delta * air_contents.return_volume() / (environment.return_temperature() * R_IDEAL_GAS_EQUATION)
|
||||
if(moles_delta > 0)
|
||||
var/datum/gas_mixture/removed = loc.remove_air(moles_delta)
|
||||
if (isnull(removed)) // in space
|
||||
return
|
||||
|
||||
var/datum/gas_mixture/removed = loc.remove_air(transfer_moles)
|
||||
if (isnull(removed)) // in space
|
||||
return
|
||||
|
||||
air_contents.merge(removed)
|
||||
air_update_turf()
|
||||
air_contents.merge(removed)
|
||||
air_update_turf()
|
||||
update_parents()
|
||||
|
||||
//Radio remote control
|
||||
|
||||
@@ -213,6 +213,7 @@
|
||||
var/list/modelCache = build_cache(no_changeturf)
|
||||
var/space_key = modelCache[SPACE_KEY]
|
||||
var/list/bounds
|
||||
var/did_expand = FALSE
|
||||
src.bounds = bounds = list(1.#INF, 1.#INF, 1.#INF, -1.#INF, -1.#INF, -1.#INF)
|
||||
var/datum/map_orientation_pattern/mode = forced_pattern || GLOB.map_orientation_patterns["[orientation]"] || GLOB.map_orientation_patterns["[SOUTH]"]
|
||||
var/invert_y = mode.invert_y
|
||||
@@ -235,6 +236,7 @@
|
||||
else
|
||||
while(parsed_z > world.maxz)
|
||||
world.incrementMaxZ()
|
||||
did_expand = TRUE
|
||||
if(!no_changeturf)
|
||||
WARNING("Z-level expansion occurred without no_changeturf set, this may cause problems when /turf/AfterChange is called")
|
||||
//these values are the same until a new gridset is reached.
|
||||
@@ -256,11 +258,13 @@
|
||||
continue
|
||||
else
|
||||
world.maxx = placement_x
|
||||
did_expand = TRUE
|
||||
if(placement_y > world.maxy)
|
||||
if(cropMap)
|
||||
break
|
||||
else
|
||||
world.maxy = placement_y
|
||||
did_expand = TRUE
|
||||
if(placement_x < 1)
|
||||
actual_x += xi
|
||||
continue
|
||||
@@ -301,6 +305,9 @@
|
||||
testing("Skipped loading [turfsSkipped] default turfs")
|
||||
#endif
|
||||
|
||||
if(did_expand)
|
||||
world.refresh_atmos_grid()
|
||||
|
||||
return TRUE
|
||||
|
||||
/datum/parsed_map/proc/build_cache(no_changeturf, bad_paths=null)
|
||||
|
||||
Reference in New Issue
Block a user