Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIRROR] Added an exterior variant of open space, refactored open space type checks to use isopenspace() and isspaceturf(). #284

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions code/_helpers/turfs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@
Predicate helpers
*/

/proc/is_space_turf(var/turf/T)
return istype(T, /turf/space)

/proc/is_not_space_turf(var/turf/T)
return !is_space_turf(T)

/proc/is_holy_turf(var/turf/T)
return T && T.holy
Expand All @@ -83,7 +78,7 @@
return !!T.return_air()

/proc/IsTurfAtmosUnsafe(var/turf/T)
if(istype(T, /turf/space)) // Space tiles
if(isspaceturf(T)) // Space tiles
return "Spawn location is open to space."
var/datum/gas_mixture/air = T.return_air()
if(!air)
Expand Down
4 changes: 4 additions & 0 deletions code/_macros.dm
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,13 @@

#define attack_animation(A) if(istype(A)) A.do_attack_animation(src)

<<<<<<< HEAD
#define isopenspace(A) istype(A, /turf/simulated/open)

#define isPlunger(A) istype(A, /obj/item/clothing/mask/plunger) || istype(A, /obj/item/plunger/robot)
=======
#define isplunger(A) istype(A, /obj/item/plunger)
>>>>>>> 6716c3a72d... Merge pull request #1011 from MistakeNot4892/opensesame

/proc/isspecies(A, B)
if(!iscarbon(A))
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystems/fluids.dm
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ SUBSYSTEM_DEF(fluids)
qdel(F)
continue

if(T.density || istype(T, /turf/space) || istype(T, /turf/exterior))
if(T.density || isspaceturf(T) || istype(T, /turf/exterior))
F.reagents.remove_any(max(FLUID_EVAPORATION_POINT-1, round(F.reagents.total_volume * 0.5)))
if(F.reagents.total_volume <= FLUID_EVAPORATION_POINT)
qdel(F)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/movement/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
return MOVEMENT_HANDLED

if(mob.buckled) // Wheelchair driving!
if(istype(mob.loc, /turf/space))
if(isspaceturf(mob.loc))
return // No wheelchair driving in space
if(istype(mob.buckled, /obj/structure/bed/chair/wheelchair))
. = MOVEMENT_HANDLED
Expand Down
2 changes: 1 addition & 1 deletion code/game/area/areas.dm
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ var/list/mob/living/forced_ambiance_list = new
M.update_floating()

/area/proc/thunk(mob/mob)
if(istype(get_turf(mob), /turf/space)) // Can't fall onto nothing.
if(isspaceturf(get_turf(mob))) // Can't fall onto nothing.
return

if(mob.Check_Shoegrip())
Expand Down
6 changes: 0 additions & 6 deletions code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -399,12 +399,6 @@ its easier to just keep the beam vertical.
/atom/proc/checkpass(passflag)
return pass_flags&passflag

/atom/proc/isinspace()
if(istype(get_turf(src), /turf/space))
return 1
else
return 0

// Show a message to all mobs and objects in sight of this atom
// Use for objects performing visible actions
// message is output to anyone who can see, e.g. "The [src] does something!"
Expand Down
4 changes: 2 additions & 2 deletions code/game/gamemodes/cult/narsie.dm
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ var/global/list/narsie_list = list()
return 1

/obj/singularity/narsie/proc/narsiefloor(var/turf/T)//leaving "footprints"
if(!(istype(T, /turf/simulated/wall/cult)||istype(T, /turf/space)))
if(!(istype(T, /turf/simulated/wall/cult) || isspaceturf(T)))
if(T.icon_state != "cult-narsie")
T.desc = "something that goes beyond your understanding went this way"
T.icon = 'icons/turf/flooring/cult.dmi'
Expand Down Expand Up @@ -184,7 +184,7 @@ var/global/list/narsie_list = list()
consume(AM)
continue

if (dist <= consume_range && !istype(A, /turf/space))
if (dist <= consume_range && !isspaceturf(A))
var/turf/T = A
if(T.holy)
T.holy = 0 //Nar-Sie doesn't give a shit about sacred grounds.
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/computer/prisoner.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
if(!T.implanted) continue
var/loc_display = "Space"
var/mob/living/carbon/M = T.imp_in
if(!istype(M.loc, /turf/space))
if(!isspaceturf(M.loc))
var/turf/mob_loc = get_turf(M)
loc_display = mob_loc.loc
if(T.malfunction)
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/cryopod.dm
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@
if(possible_locations.len && prob(10))
newz = pick(possible_locations)
var/turf/nloc = locate(rand(TRANSITIONEDGE, world.maxx-TRANSITIONEDGE), rand(TRANSITIONEDGE, world.maxy-TRANSITIONEDGE),newz)
if(!istype(nloc, /turf/space))
if(!isspaceturf(nloc))
explosion(nloc, 1, 2, 3)
playsound(loc,'sound/effects/rocket.ogg',100)
forceMove(nloc)
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/nuclear_bomb.dm
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ var/bomb_set
visible_message("<span class='warning'>\The [src] makes a highly unpleasant crunching noise. It looks like the anchoring bolts have been cut.</span>")
return 1

if(!isinspace())
if(!isspaceturf(get_turf(src)))
anchored = !anchored
if(anchored)
visible_message("<span class='warning'>With a steely snap, bolts slide out of \the [src] and anchor it to the flooring.</span>")
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/portable_turret.dm
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ var/list/turret_icons
if(wrenching)
to_chat(user, "<span class='warning'>Someone is already [anchored ? "un" : ""]securing the turret!</span>")
return
if(!anchored && isinspace())
if(!anchored && isspaceturf(get_turf(src)))
to_chat(user, "<span class='warning'>Cannot secure turrets in space!</span>")
return

Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/weapons/RCD.dm
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
if(!proximity) return
if(disabled && !isrobot(user))
return 0
if(istype(get_area(A),/area/shuttle)||istype(get_area(A),/turf/space/transit))
if(istype(get_area(A),/area/shuttle) || istype(get_turf(A), /turf/space/transit))
return 0
work_id++
work_mode.do_work(src, A, user)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/weapons/flamethrower.dm
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
if(!lit || operating) return
operating = 1
for(var/turf/T in turflist)
if(T.density || istype(T, /turf/space))
if(T.density || isspaceturf(T))
break
if(!previousturf && length(turflist)>1)
previousturf = get_turf(src)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/weapons/policetape.dm
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ var/list/tape_roll_applications = list()
while (can_place)
if(cur.density == 1)
can_place = 0
else if (istype(cur, /turf/space))
else if (isspaceturf(cur))
can_place = 0
else
for(var/obj/O in cur)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/structures/curtains.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
to_chat(user, SPAN_DANGER("You cannot install \the [src] from your hands."))
return

if(is_space_turf(loc))
if(isspaceturf(loc))
to_chat(user, SPAN_DANGER("You cannot install \the [src] in space."))
return

Expand Down
9 changes: 4 additions & 5 deletions code/game/objects/structures/girders.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@

/obj/structure/girder/can_unanchor(var/mob/user)
. = ..()
if(!anchored && .)
var/turf/simulated/open/T = loc
if(istype(T))
to_chat(user, SPAN_WARNING("You can only secure \the [src] to solid ground."))
return FALSE
var/turf/T = loc
if(!anchored && . && (!istype(T) || T.is_open()))
to_chat(user, SPAN_WARNING("You can only secure \the [src] to solid ground."))
return FALSE

/obj/structure/girder/handle_default_screwdriver_attackby(var/mob/user, var/obj/item/screwdriver)

Expand Down
6 changes: 4 additions & 2 deletions code/game/objects/structures/lattice.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
DELETE_IF_DUPLICATE_OF(/obj/structure/lattice)
if(!istype(material))
return INITIALIZE_HINT_QDEL
if(!istype(src.loc, /turf/space) && !istype(src.loc, /turf/simulated/open))
var/turf/T = loc
if(!istype(T) || !T.is_open())
return INITIALIZE_HINT_QDEL
. = INITIALIZE_HINT_LATELOAD

Expand Down Expand Up @@ -99,6 +100,7 @@
if(locate(/obj/structure/lattice, T) || locate(/obj/structure/catwalk, T))
dir_sum += direction
else
if(!(istype(get_step(src, direction), /turf/space)) && !(istype(get_step(src, direction), /turf/simulated/open)))
var/turf/O = get_step(src, direction)
if(!istype(O) || !O.is_open())
dir_sum += direction
icon_state = "lattice[dir_sum]"
6 changes: 1 addition & 5 deletions code/game/objects/structures/transit_tubes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@
do
sleep(last_delay)

if(!istype(loc, /turf/space))
if(!isspaceturf(loc))
last_delay++

if(last_delay > 10)
Expand Down Expand Up @@ -351,10 +351,6 @@
mob.forceMove(T)
mob.client.Move(get_step(T, direction), direction)

//if(moving && istype(loc, /turf/space))
// Todo: If you get out of a moving pod in space, you should move as well.
// Same direction as pod? Direcion you moved? Halfway between?

if(!moving)
for(var/obj/structure/transit_tube/station/station in loc)
if(dir in station.directions())
Expand Down
7 changes: 7 additions & 0 deletions code/game/turfs/exterior/_exterior.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
if(istype(ext))
ext.affecting_heat_sources = last_affecting_heat_sources

/turf/exterior/is_plating()
return !density

/turf/exterior/can_engrave()
return FALSE

Expand Down Expand Up @@ -59,6 +62,10 @@
update_icon(TRUE)
. = ..()

/turf/exterior/levelupdate()
for(var/obj/O in src)
O.hide(0)

/turf/exterior/attackby(obj/item/C, mob/user)

if(diggable && istype(C,/obj/item/shovel))
Expand Down
2 changes: 1 addition & 1 deletion code/game/turfs/space/space.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
return
var/turf/below = GetBelow(src)

if(istype(below, /turf/space))
if(isspaceturf(below))
return
var/area/A = below.loc

Expand Down
2 changes: 1 addition & 1 deletion code/game/turfs/turf_changing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
// This makes sure that turfs are not changed to space when one side is part of a zone
if(N == /turf/space)
var/turf/below = GetBelow(src)
if(istype(below) && !istype(below,/turf/space))
if(istype(below) && !isspaceturf(below))
N = /turf/simulated/open

var/old_air = air
Expand Down
2 changes: 1 addition & 1 deletion code/modules/admin/buildmode/basic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

/datum/build_mode/basic/OnClick(var/atom/object, var/list/pa)
if(istype(object,/turf) && pa["left"] && !pa["alt"] && !pa["ctrl"] )
if(istype(object,/turf/space))
if(isspaceturf(object))
var/turf/T = object
Log("Upgraded - [log_info_line(object)]")
T.ChangeTurf(/turf/simulated/floor)
Expand Down
6 changes: 3 additions & 3 deletions code/modules/admin/verbs/fluids.dm
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ GLOBAL_LIST_INIT(submerged_levels, new)
if(A && (A.area_flags & AREA_FLAG_EXTERNAL))
if(A.base_turf)
A.base_turf = /turf/exterior/seafloor/non_flooded
if(!istype(T, /turf/space))
if(!isspaceturf(T))
T.make_flooded()

// Generate the sea floor on the highest z-level in the set.
Expand All @@ -122,9 +122,9 @@ GLOBAL_LIST_INIT(submerged_levels, new)
if(A && (A.area_flags & AREA_FLAG_EXTERNAL))
if(A.base_turf)
A.base_turf = /turf/simulated/open
if(istype(T, /turf/space))
if(isspaceturf(T))
T.ChangeTurf(/turf/simulated/open/flooded)
else if(istype(T, /turf/simulated/open))
else if(T.is_open())
T.make_flooded()
CHECK_TICK

Expand Down
2 changes: 1 addition & 1 deletion code/modules/blob/blob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
update_icon()

/obj/effect/blob/proc/expand(var/turf/T)
if(istype(T, /turf/unsimulated/) || istype(T, /turf/space))
if(istype(T, /turf/unsimulated/) || isspaceturf(T))
return
if(istype(T, /turf/simulated/wall))
var/turf/simulated/wall/SW = T
Expand Down
2 changes: 1 addition & 1 deletion code/modules/clothing/suits/armor/reactive.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
user.visible_message("<span class='danger'>The reactive teleport system flings [user] clear of the attack!</span>")
var/list/turfs = new/list()
for(var/turf/T in orange(6, user))
if(istype(T,/turf/space)) continue
if(isspaceturf(T)) continue
if(T.density) continue
if(T.x>world.maxx-6 || T.x<6) continue
if(T.y>world.maxy-6 || T.y<6) continue
Expand Down
2 changes: 1 addition & 1 deletion code/modules/events/carp_migration.dm
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ GLOBAL_LIST_INIT(carp_count,list())// a list of Z levels (string), associated wi
var/I = 0
while(I < n)
var/turf/T = get_random_edge_turf(direction,TRANSITIONEDGE + 2, Z)
if(istype(T,/turf/space))
if(isspaceturf(T))
var/mob/living/simple_animal/hostile/M
if(prob(96))
M = new /mob/living/simple_animal/hostile/carp(T)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/events/solar_storm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
if(!T || !(T.z in GLOB.using_map.player_levels))
continue

if(!istype(T.loc,/area/space) && !istype(T,/turf/space)) //Make sure you're in a space area or on a space turf
if(!istype(T.loc,/area/space) && !isspaceturf(T)) //Make sure you're in a space area or on a space turf
continue

//Apply some heat or burn damage from the sun.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

/datum/goal/movement/walk/eva/valid_step()
var/datum/mind/mind = owner
return istype(mind.current.loc, /turf/space)
return isspaceturf(mind.current.loc)

/datum/goal/movement/walk/eva/update_strings()
description = "It's so stuffy inside. Go for a spacewalk - at least [required_steps] step\s."
2 changes: 1 addition & 1 deletion code/modules/holodeck/HolodeckControl.dm
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@

/obj/machinery/computer/HolodeckControl/proc/checkInteg(var/area/A)
for(var/turf/T in A)
if(istype(T, /turf/space))
if(isspaceturf(T))
return 0

return 1
Expand Down
2 changes: 1 addition & 1 deletion code/modules/hydroponics/grown.dm
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@
if(!seed)
return

if(istype(user.loc,/turf/space))
if(isspaceturf(user.loc))
return

if(user.a_intent == I_HURT)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/hydroponics/seed.dm
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
var/turf/neighbor = get_step(T,dir)
if(!neighbor || (neighbor in closed_turfs) || (neighbor in open_turfs))
continue
if(neighbor.density || get_dist(neighbor,origin_turf) > flood_dist || istype(neighbor,/turf/space))
if(neighbor.density || get_dist(neighbor,origin_turf) > flood_dist || isspaceturf(neighbor))
closed_turfs |= neighbor
continue
// Check for windows.
Expand Down
9 changes: 4 additions & 5 deletions code/modules/lighting/lighting_source.dm
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,8 @@
corners |= T.get_corners()
turfs += T

var/turf/simulated/open/O = T
if(istype(O) && O.below)
var/turf/O = T
if(istype(O) && O.is_open() && O.below)
// Consider the turf below us as well. (Z-lights)
for(T = O.below; !isnull(T); T = update_the_turf(T,corners, turfs));

Expand Down Expand Up @@ -316,9 +316,8 @@
corners |= T.get_corners()
turfs += T

var/turf/simulated/open/O = T
if(istype(O) && O.below)
return O.below
if(T.is_open() && T.below)
return T.below
return null

#undef effect_update
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
var/min_temperature = T20C + rand(0, 20) // Room temperature + some variance. An actual diminishing return would be better, but this is *like* that. In a way. . This has the potential for weird behavior, but I says fuck it. Water grenades for everyone.

var/hotspot = (locate(/obj/fire) in T)
if(hotspot && !istype(T, /turf/space))
if(hotspot && !isspaceturf(T))
var/datum/gas_mixture/lowertemp = T.remove_air(T:air:total_moles)
lowertemp.temperature = max(min(lowertemp.temperature-2000, lowertemp.temperature / 2), 0)
lowertemp.react()
Expand Down
Loading