The Mapping Update

Cleans up the map (again)
Makes mining code more better
This commit is contained in:
Letter N
2021-03-12 12:11:35 +08:00
parent cc81a6d65e
commit 935e46b492
149 changed files with 206322 additions and 206270 deletions
+27 -9
View File
@@ -5,8 +5,8 @@
// effectout: effect to show right after teleportation
// asoundin: soundfile to play before teleportation
// asoundout: soundfile to play after teleportation
// no_effects: disable the default effectin/effectout of sparks
// forceMove: if false, teleport will use Move() proc (dense objects will prevent teleportation)
// no_effects: disable the default effectin/effectout of sparks
// forced: whether or not to ignore no_teleport
/proc/do_teleport(atom/movable/teleatom, atom/destination, precision=null, forceMove = TRUE, datum/effect_system/effectin=null, datum/effect_system/effectout=null, asoundin=null, asoundout=null, no_effects=FALSE, channel=TELEPORT_CHANNEL_BLUESPACE, forced = FALSE)
// teleporting most effects just deletes them
@@ -15,7 +15,8 @@
)) - typecacheof(list(
/obj/effect/dummy/chameleon,
/obj/effect/wisp,
/obj/effect/mob_spawn
/obj/effect/mob_spawn,
/obj/effect/immovablerod,
))
if(delete_atoms[teleatom.type])
qdel(teleatom)
@@ -66,7 +67,7 @@
var/area/A = get_area(curturf)
var/area/B = get_area(destturf)
if(!forced && (HAS_TRAIT(teleatom, TRAIT_NO_TELEPORT) || A.noteleport || B.noteleport))
if(!forced && (HAS_TRAIT(teleatom, TRAIT_NO_TELEPORT) || (A.area_flags & NOTELEPORT) || (B.area_flags & NOTELEPORT)))
return FALSE
if(SEND_SIGNAL(destturf, COMSIG_ATOM_INTERCEPT_TELEPORT, channel, curturf, destturf))
@@ -99,13 +100,13 @@
/proc/tele_play_specials(atom/movable/teleatom, atom/location, datum/effect_system/effect, sound)
if (location && !isobserver(teleatom))
if (sound)
playsound(location, sound, 60, 1)
playsound(location, sound, 60, TRUE)
if (effect)
effect.attach(location)
effect.start()
// Safe location finder
/proc/find_safe_turf(zlevel, list/zlevels, extended_safety_checks = FALSE)
/proc/find_safe_turf(zlevel, list/zlevels, extended_safety_checks = FALSE, dense_atoms = TRUE)
if(!zlevels)
if (zlevel)
zlevels = list(zlevel)
@@ -122,12 +123,17 @@
if(!isfloorturf(random_location))
continue
var/turf/open/floor/F = random_location
var/area/destination_area = F.loc
if(cycle < 300 && destination_area.area_flags & NOTELEPORT)//if the area is mostly NOTELEPORT (centcom) we gotta give up on this fantasy at some point.
continue
if(!F.air)
continue
var/datum/gas_mixture/A = F.air
var/list/A_gases = A.get_gases()
var/trace_gases
for(var/id in A.get_gases())
for(var/id in A_gases)
if(id in GLOB.hardcoded_gases)
continue
trace_gases = TRUE
@@ -136,7 +142,7 @@
// Can most things breathe?
if(trace_gases)
continue
if(A.get_moles(/datum/gas/oxygen) < 16)
if(A.get_moles(/datum/gas/oxygen) >= 16)
continue
if(A.get_moles(/datum/gas/plasma))
continue
@@ -156,6 +162,16 @@
if(!L.is_safe())
continue
// Check that we're not warping onto a table or window
if(!dense_atoms)
var/density_found = FALSE
for(var/atom/movable/found_movable in F)
if(found_movable.density)
density_found = TRUE
break
if(density_found)
continue
// DING! You have passed the gauntlet, and are "probably" safe.
return F
@@ -167,9 +183,11 @@
if(T.is_transition_turf())
continue // Avoid picking these.
var/area/A = T.loc
if(!A.noteleport)
if(!(A.area_flags & NOTELEPORT))
posturfs.Add(T)
return posturfs
/proc/get_teleport_turf(turf/center, precision = 0)
return safepick(get_teleport_turfs(center, precision))
var/list/turfs = get_teleport_turfs(center, precision)
if (length(turfs))
return pick(turfs)