mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-12 15:45:25 +01:00
5728e0c46f
* this will work first try (adds water vapor and the electrolyzer) * naming fix * removes a warn * makes water vapor able to be seen and adds it to the tiny_test atmos map * Build Rust library * adds the electrolyzer to all maps, and linter fix * linter fix part 2 * electrolyzer tweak and more work on the test_atmos map * tgui rebuilding * re rebuilding tgui * makes the electrolyzer consume power and some small test atmos touch ups * im axing the test_tiny because i don't want to map it * clarifies how much power the electrolyzer uses * Build Rust library * suggestionss Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com> Co-authored-by: JimKil3 <47290811+JimKil3@users.noreply.github.com> Signed-off-by: Hayden Redacted <91229275+haydenredacted@users.noreply.github.com> * updating the SM manual * electrolyzer tweaks * dg suggestions pt. 2 Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com> Signed-off-by: Hayden Redacted <91229275+haydenredacted@users.noreply.github.com> * removed unused code --------- Signed-off-by: Hayden Redacted <91229275+haydenredacted@users.noreply.github.com> Co-authored-by: paradisess13[bot] <165046124+paradisess13[bot]@users.noreply.github.com> Co-authored-by: warriorstar-orion <orion@snowfrost.garden> Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com> Co-authored-by: JimKil3 <47290811+JimKil3@users.noreply.github.com>
154 lines
3.9 KiB
Plaintext
154 lines
3.9 KiB
Plaintext
/turf/proc/CanAtmosPass(direction, consider_objects = TRUE)
|
|
if(blocks_air)
|
|
return FALSE
|
|
|
|
if(!consider_objects)
|
|
return TRUE
|
|
|
|
for(var/obj/O in contents)
|
|
if(istype(O, /obj/item))
|
|
// Items can't block atmos.
|
|
continue
|
|
|
|
if(!O.CanAtmosPass(direction))
|
|
return FALSE
|
|
|
|
return TRUE
|
|
|
|
/atom/movable/proc/CanAtmosPass()
|
|
return TRUE
|
|
|
|
/atom/proc/CanPass(atom/movable/mover, border_dir)
|
|
return !density
|
|
|
|
/turf/CanPass(atom/movable/mover, border_dir)
|
|
var/turf/target = get_step(src, border_dir)
|
|
if(!target)
|
|
return FALSE
|
|
|
|
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, border_dir))
|
|
return 0
|
|
for(var/obj/obstacle in target)
|
|
if(!obstacle.CanPass(mover, src))
|
|
return 0
|
|
|
|
return 1
|
|
|
|
/atom/movable/proc/get_superconductivity(direction)
|
|
return OPEN_HEAT_TRANSFER_COEFFICIENT
|
|
|
|
/atom/movable/proc/recalculate_atmos_connectivity()
|
|
for(var/turf/T in locs) // used by double wide doors and other nonexistant multitile structures
|
|
T.recalculate_atmos_connectivity()
|
|
|
|
/atom/movable/proc/move_update_air(turf/T)
|
|
if(isturf(T))
|
|
T.recalculate_atmos_connectivity()
|
|
recalculate_atmos_connectivity()
|
|
|
|
//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)
|
|
if(!issimulatedturf(src))
|
|
return list()
|
|
|
|
var/adjacent_turfs = list()
|
|
for(var/turf/T in RANGE_EDGE_TURFS(1, src))
|
|
var/direction = get_dir(src, T)
|
|
if(!CanAtmosPass(direction))
|
|
continue
|
|
if(!T.CanAtmosPass(turn(direction, 180)))
|
|
continue
|
|
adjacent_turfs += T
|
|
|
|
if(!alldir)
|
|
return adjacent_turfs
|
|
|
|
for(var/turf/T in RANGE_TURFS(1, src))
|
|
var/direction = get_dir(src, T)
|
|
if(IS_DIR_CARDINAL(direction))
|
|
continue
|
|
// check_direction is the first way we move, from src
|
|
for(var/check_direction in GLOB.cardinal)
|
|
if(!(check_direction & direction))
|
|
// Wrong way.
|
|
continue
|
|
|
|
var/turf/intermediate = get_step(src, check_direction)
|
|
if(!(intermediate in adjacent_turfs))
|
|
continue
|
|
|
|
// other_direction is the second way we move, from intermediate.
|
|
var/other_direction = direction & ~check_direction
|
|
|
|
// We already know we can reach intermediate, so now we just need to check the second step.
|
|
if(!intermediate.CanAtmosPass(other_direction))
|
|
continue
|
|
if(!T.CanAtmosPass(turn(other_direction, 180)))
|
|
continue
|
|
|
|
adjacent_turfs += T
|
|
break
|
|
|
|
return adjacent_turfs
|
|
|
|
/atom/movable/proc/atmos_spawn_air(flag, amount) //because a lot of people loves to copy paste awful code lets just make a easy proc to spawn your plasma fires
|
|
var/turf/simulated/T = get_turf(src)
|
|
if(!istype(T))
|
|
return
|
|
T.atmos_spawn_air(flag, amount)
|
|
|
|
/turf/simulated/proc/atmos_spawn_air(flag, amount)
|
|
if(!flag || !amount || blocks_air)
|
|
return
|
|
|
|
var/datum/gas_mixture/G = new()
|
|
|
|
if(flag & LINDA_SPAWN_20C)
|
|
G.set_temperature(T20C)
|
|
|
|
if(flag & LINDA_SPAWN_HEAT)
|
|
G.set_temperature(G.temperature() + 1000)
|
|
|
|
if(flag & LINDA_SPAWN_COLD)
|
|
G.set_temperature(TCMB)
|
|
|
|
if(flag & LINDA_SPAWN_TOXINS)
|
|
G.set_toxins(G.toxins() + amount)
|
|
|
|
if(flag & LINDA_SPAWN_OXYGEN)
|
|
G.set_oxygen(G.oxygen() + amount)
|
|
|
|
if(flag & LINDA_SPAWN_CO2)
|
|
G.set_carbon_dioxide(G.carbon_dioxide() + amount)
|
|
|
|
if(flag & LINDA_SPAWN_NITROGEN)
|
|
G.set_nitrogen(G.nitrogen() + amount)
|
|
|
|
if(flag & LINDA_SPAWN_N2O)
|
|
G.set_sleeping_agent(G.sleeping_agent() + amount)
|
|
|
|
if(flag & LINDA_SPAWN_AGENT_B)
|
|
G.set_agent_b(G.agent_b() + amount)
|
|
|
|
if(flag & LINDA_SPAWN_AIR)
|
|
G.set_oxygen(G.oxygen() + MOLES_O2STANDARD * amount)
|
|
G.set_nitrogen(G.nitrogen() + MOLES_N2STANDARD * amount)
|
|
|
|
if(flag & LINDA_SPAWN_HYDROGEN)
|
|
G.set_hydrogen(G.hydrogen() + amount)
|
|
|
|
if(flag & LINDA_SPAWN_WATER_VAPOR)
|
|
G.set_water_vapor(G.water_vapor() + amount)
|
|
|
|
blind_release_air(G)
|