Merge branch 'master' of https://github.com/Citadel-Station-13/Citadel-Station-13 into Ghommie-cit265
This commit is contained in:
@@ -15,7 +15,7 @@ GLOBAL_LIST_INIT(blacklisted_automated_baseturfs, typecacheof(list(
|
||||
if(turf_type)
|
||||
var/turf/newT = ChangeTurf(turf_type, baseturf_type, flags)
|
||||
SSair.remove_from_active(newT)
|
||||
newT.CalculateAdjacentTurfs()
|
||||
CALCULATE_ADJACENT_TURFS(newT)
|
||||
SSair.add_to_active(newT,1)
|
||||
|
||||
/turf/proc/copyTurf(turf/T)
|
||||
@@ -140,6 +140,8 @@ GLOBAL_LIST_INIT(blacklisted_automated_baseturfs, typecacheof(list(
|
||||
newTurf.air = stashed_air
|
||||
SSair.add_to_active(newTurf)
|
||||
else
|
||||
if(ispath(path,/turf/closed))
|
||||
flags |= CHANGETURF_RECALC_ADJACENT
|
||||
return ..()
|
||||
|
||||
// Take off the top layer turf and replace it with the next baseturf down
|
||||
@@ -263,7 +265,10 @@ GLOBAL_LIST_INIT(blacklisted_automated_baseturfs, typecacheof(list(
|
||||
//If you modify this function, ensure it works correctly with lateloaded map templates.
|
||||
/turf/proc/AfterChange(flags) //called after a turf has been replaced in ChangeTurf()
|
||||
levelupdate()
|
||||
CalculateAdjacentTurfs()
|
||||
if(flags & CHANGETURF_RECALC_ADJACENT)
|
||||
ImmediateCalculateAdjacentTurfs()
|
||||
else
|
||||
CALCULATE_ADJACENT_TURFS(src)
|
||||
|
||||
//update firedoor adjacency
|
||||
var/list/turfs_to_check = get_adjacent_open_turfs(src) | src
|
||||
|
||||
+26
-38
@@ -16,6 +16,22 @@
|
||||
if(wet)
|
||||
AddComponent(/datum/component/wet_floor, wet, INFINITY, 0, INFINITY, TRUE)
|
||||
|
||||
//direction is direction of travel of A
|
||||
/turf/open/zPassIn(atom/movable/A, direction, turf/source)
|
||||
return (direction == DOWN)
|
||||
|
||||
//direction is direction of travel of A
|
||||
/turf/open/zPassOut(atom/movable/A, direction, turf/destination)
|
||||
return (direction == UP)
|
||||
|
||||
//direction is direction of travel of air
|
||||
/turf/open/zAirIn(direction, turf/source)
|
||||
return (direction == DOWN)
|
||||
|
||||
//direction is direction of travel of air
|
||||
/turf/open/zAirOut(direction, turf/source)
|
||||
return (direction == UP)
|
||||
|
||||
/turf/open/MouseDrop_T(atom/dropping, mob/user)
|
||||
. = ..()
|
||||
if(dropping == user && isliving(user))
|
||||
@@ -184,43 +200,14 @@
|
||||
update_visuals()
|
||||
|
||||
current_cycle = times_fired
|
||||
|
||||
//cache some vars
|
||||
var/list/atmos_adjacent_turfs = src.atmos_adjacent_turfs
|
||||
|
||||
for(var/direction in GLOB.cardinals)
|
||||
var/turf/open/enemy_tile = get_step(src, direction)
|
||||
if(!istype(enemy_tile))
|
||||
if (atmos_adjacent_turfs)
|
||||
atmos_adjacent_turfs -= enemy_tile
|
||||
continue
|
||||
ImmediateCalculateAdjacentTurfs()
|
||||
for(var/i in atmos_adjacent_turfs)
|
||||
var/turf/open/enemy_tile = i
|
||||
var/datum/gas_mixture/enemy_air = enemy_tile.return_air()
|
||||
|
||||
//only check this turf, if it didn't check us when it was initalized
|
||||
if(enemy_tile.current_cycle < times_fired)
|
||||
if(CANATMOSPASS(src, enemy_tile))
|
||||
LAZYINITLIST(atmos_adjacent_turfs)
|
||||
LAZYINITLIST(enemy_tile.atmos_adjacent_turfs)
|
||||
atmos_adjacent_turfs[enemy_tile] = TRUE
|
||||
enemy_tile.atmos_adjacent_turfs[src] = TRUE
|
||||
else
|
||||
if (atmos_adjacent_turfs)
|
||||
atmos_adjacent_turfs -= enemy_tile
|
||||
if (enemy_tile.atmos_adjacent_turfs)
|
||||
enemy_tile.atmos_adjacent_turfs -= src
|
||||
UNSETEMPTY(enemy_tile.atmos_adjacent_turfs)
|
||||
continue
|
||||
else
|
||||
if (!atmos_adjacent_turfs || !atmos_adjacent_turfs[enemy_tile])
|
||||
continue
|
||||
|
||||
if(!excited && air.compare(enemy_air))
|
||||
//testing("Active turf found. Return value of compare(): [is_active]")
|
||||
excited = TRUE
|
||||
SSair.active_turfs |= src
|
||||
UNSETEMPTY(atmos_adjacent_turfs)
|
||||
if (atmos_adjacent_turfs)
|
||||
src.atmos_adjacent_turfs = atmos_adjacent_turfs
|
||||
|
||||
/turf/open/proc/GetHeatCapacity()
|
||||
. = air.heat_capacity()
|
||||
@@ -267,14 +254,15 @@
|
||||
if(!(lube&GALOSHES_DONT_HELP)) //can't slip while buckled unless it's lube.
|
||||
return 0
|
||||
else
|
||||
if(C.lying || !(C.status_flags & CANKNOCKDOWN)) // can't slip unbuckled mob if they're lying or can't fall.
|
||||
if(!(lube&SLIP_WHEN_CRAWLING) && (C.lying || !(C.status_flags & CANKNOCKDOWN))) // can't slip unbuckled mob if they're lying or can't fall.
|
||||
return 0
|
||||
if(C.m_intent == MOVE_INTENT_WALK && (lube&NO_SLIP_WHEN_WALKING))
|
||||
return 0
|
||||
if(ishuman(C) && (lube&NO_SLIP_WHEN_WALKING))
|
||||
var/mob/living/carbon/human/H = C
|
||||
if(!H.sprinting && H.getStaminaLoss() <= 20)
|
||||
if(lube & NO_SLIP_WHEN_WALKING)
|
||||
if(C.m_intent == MOVE_INTENT_WALK)
|
||||
return 0
|
||||
if(ishuman(C) && !(lube & SLIP_WHEN_JOGGING))
|
||||
var/mob/living/carbon/human/H = C
|
||||
if(!H.sprinting && H.getStaminaLoss() <= 20)
|
||||
return 0
|
||||
if(!(lube&SLIDE_ICE))
|
||||
to_chat(C, "<span class='notice'>You slipped[ O ? " on the [O.name]" : ""]!</span>")
|
||||
playsound(C.loc, 'sound/misc/slip.ogg', 50, 1, -3)
|
||||
|
||||
@@ -0,0 +1,134 @@
|
||||
/turf/open/openspace
|
||||
name = "open space"
|
||||
desc = "Watch your step!"
|
||||
icon_state = "grey"
|
||||
baseturfs = /turf/open/openspace
|
||||
CanAtmosPassVertical = ATMOS_PASS_YES
|
||||
//mouse_opacity = MOUSE_OPACITY_TRANSPARENT
|
||||
var/can_cover_up = TRUE
|
||||
var/can_build_on = TRUE
|
||||
|
||||
/turf/open/openspace/debug/update_multiz()
|
||||
..()
|
||||
return TRUE
|
||||
|
||||
/turf/open/openspace/Initialize() // handle plane and layer here so that they don't cover other obs/turfs in Dream Maker
|
||||
. = ..()
|
||||
plane = FLOOR_OPENSPACE_PLANE
|
||||
layer = OPENSPACE_LAYER
|
||||
return INITIALIZE_HINT_LATELOAD
|
||||
|
||||
/turf/open/openspace/LateInitialize()
|
||||
update_multiz(TRUE, TRUE)
|
||||
|
||||
/turf/open/openspace/Destroy()
|
||||
vis_contents.len = 0
|
||||
return ..()
|
||||
|
||||
/turf/open/openspace/update_multiz(prune_on_fail = FALSE, init = FALSE)
|
||||
. = ..()
|
||||
var/turf/T = below()
|
||||
if(!T)
|
||||
vis_contents.len = 0
|
||||
if(prune_on_fail)
|
||||
ChangeTurf(/turf/open/floor/plating)
|
||||
return FALSE
|
||||
if(init)
|
||||
vis_contents += T
|
||||
return TRUE
|
||||
|
||||
/turf/open/openspace/multiz_turf_del(turf/T, dir)
|
||||
if(dir != DOWN)
|
||||
return
|
||||
update_multiz()
|
||||
|
||||
/turf/open/openspace/multiz_turf_new(turf/T, dir)
|
||||
if(dir != DOWN)
|
||||
return
|
||||
update_multiz()
|
||||
|
||||
/turf/open/openspace/zAirIn()
|
||||
return TRUE
|
||||
|
||||
/turf/open/openspace/zAirOut()
|
||||
return TRUE
|
||||
|
||||
/turf/open/openspace/zPassIn(atom/movable/A, direction, turf/source)
|
||||
return TRUE
|
||||
|
||||
/turf/open/openspace/zPassOut(atom/movable/A, direction, turf/destination)
|
||||
if(A.anchored)
|
||||
return FALSE
|
||||
for(var/obj/O in contents)
|
||||
if(O.obj_flags & BLOCK_Z_FALL)
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/turf/open/openspace/proc/CanCoverUp()
|
||||
return can_cover_up
|
||||
|
||||
/turf/open/openspace/proc/CanBuildHere()
|
||||
return can_build_on
|
||||
|
||||
/turf/open/openspace/attackby(obj/item/C, mob/user, params)
|
||||
..()
|
||||
if(!CanBuildHere())
|
||||
return
|
||||
if(istype(C, /obj/item/stack/rods))
|
||||
var/obj/item/stack/rods/R = C
|
||||
var/obj/structure/lattice/L = locate(/obj/structure/lattice, src)
|
||||
var/obj/structure/lattice/catwalk/W = locate(/obj/structure/lattice/catwalk, src)
|
||||
if(W)
|
||||
to_chat(user, "<span class='warning'>There is already a catwalk here!</span>")
|
||||
return
|
||||
if(L)
|
||||
if(R.use(1))
|
||||
to_chat(user, "<span class='notice'>You construct a catwalk.</span>")
|
||||
playsound(src, 'sound/weapons/genhit.ogg', 50, 1)
|
||||
new/obj/structure/lattice/catwalk(src)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need two rods to build a catwalk!</span>")
|
||||
return
|
||||
if(R.use(1))
|
||||
to_chat(user, "<span class='notice'>You construct a lattice.</span>")
|
||||
playsound(src, 'sound/weapons/genhit.ogg', 50, 1)
|
||||
ReplaceWithLattice()
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need one rod to build a lattice.</span>")
|
||||
return
|
||||
if(istype(C, /obj/item/stack/tile/plasteel))
|
||||
if(!CanCoverUp())
|
||||
return
|
||||
var/obj/structure/lattice/L = locate(/obj/structure/lattice, src)
|
||||
if(L)
|
||||
var/obj/item/stack/tile/plasteel/S = C
|
||||
if(S.use(1))
|
||||
qdel(L)
|
||||
playsound(src, 'sound/weapons/genhit.ogg', 50, 1)
|
||||
to_chat(user, "<span class='notice'>You build a floor.</span>")
|
||||
PlaceOnTop(/turf/open/floor/plating)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need one floor tile to build a floor!</span>")
|
||||
else
|
||||
to_chat(user, "<span class='warning'>The plating is going to need some support! Place metal rods first.</span>")
|
||||
|
||||
/turf/open/openspace/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd)
|
||||
if(!CanBuildHere())
|
||||
return FALSE
|
||||
|
||||
switch(the_rcd.mode)
|
||||
if(RCD_FLOORWALL)
|
||||
var/obj/structure/lattice/L = locate(/obj/structure/lattice, src)
|
||||
if(L)
|
||||
return list("mode" = RCD_FLOORWALL, "delay" = 0, "cost" = 1)
|
||||
else
|
||||
return list("mode" = RCD_FLOORWALL, "delay" = 0, "cost" = 3)
|
||||
return FALSE
|
||||
|
||||
/turf/open/openspace/rcd_act(mob/user, obj/item/construction/rcd/the_rcd, passed_mode)
|
||||
switch(passed_mode)
|
||||
if(RCD_FLOORWALL)
|
||||
to_chat(user, "<span class='notice'>You build a floor.</span>")
|
||||
PlaceOnTop(/turf/open/floor/plating, flags = CHANGETURF_INHERIT_AIR)
|
||||
return TRUE
|
||||
return FALSE
|
||||
@@ -144,5 +144,5 @@
|
||||
..()
|
||||
ScrapeAway()
|
||||
|
||||
/turf/open/floor/plating/foam/tool_act(mob/living/user, obj/tool/I, tool_type)
|
||||
/turf/open/floor/plating/foam/tool_act(mob/living/user, obj/item/I, tool_type)
|
||||
return
|
||||
|
||||
@@ -227,3 +227,29 @@
|
||||
/turf/closed/wall/r_wall/rcd_act(mob/user, obj/item/construction/rcd/the_rcd, passed_mode)
|
||||
if(the_rcd.canRturf)
|
||||
return ..()
|
||||
|
||||
/turf/closed/wall/r_wall/syndicate
|
||||
name = "hull"
|
||||
desc = "The armored hull of an ominous looking ship."
|
||||
icon = 'icons/turf/walls/plastitanium_wall.dmi'
|
||||
icon_state = "map-shuttle"
|
||||
explosion_block = 20
|
||||
sheet_type = /obj/item/stack/sheet/mineral/plastitanium
|
||||
smooth = SMOOTH_MORE|SMOOTH_DIAGONAL
|
||||
canSmoothWith = list(/turf/closed/wall/r_wall/syndicate, /turf/closed/wall/mineral/plastitanium, /obj/machinery/door/airlock/shuttle, /obj/machinery/door/airlock, /obj/structure/window/plastitanium, /obj/structure/shuttle/engine, /obj/structure/falsewall/plastitanium)
|
||||
|
||||
/turf/closed/wall/r_wall/syndicate/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd)
|
||||
return FALSE
|
||||
|
||||
/turf/closed/wall/r_wall/syndicate/nodiagonal
|
||||
smooth = SMOOTH_MORE
|
||||
icon_state = "map-shuttle_nd"
|
||||
|
||||
/turf/closed/wall/r_wall/syndicate/nosmooth
|
||||
icon = 'icons/turf/shuttle.dmi'
|
||||
icon_state = "wall"
|
||||
smooth = SMOOTH_FALSE
|
||||
|
||||
/turf/closed/wall/r_wall/syndicate/overspace
|
||||
icon_state = "map-overspace"
|
||||
fixed_underlay = list("space"=1)
|
||||
|
||||
+75
-3
@@ -39,7 +39,7 @@
|
||||
return FALSE
|
||||
. = ..()
|
||||
|
||||
/turf/Initialize()
|
||||
/turf/Initialize(mapload)
|
||||
if(flags_1 & INITIALIZED_1)
|
||||
stack_trace("Warning: [src]([type]) initialized multiple times!")
|
||||
flags_1 |= INITIALIZED_1
|
||||
@@ -62,12 +62,21 @@
|
||||
add_overlay(/obj/effect/fullbright)
|
||||
|
||||
if(requires_activation)
|
||||
CalculateAdjacentTurfs()
|
||||
CALCULATE_ADJACENT_TURFS(src)
|
||||
SSair.add_to_active(src)
|
||||
|
||||
if (light_power && light_range)
|
||||
update_light()
|
||||
|
||||
var/turf/T = SSmapping.get_turf_above(src)
|
||||
if(T)
|
||||
T.multiz_turf_new(src, DOWN)
|
||||
SEND_SIGNAL(T, COMSIG_TURF_MULTIZ_NEW, src, DOWN)
|
||||
T = SSmapping.get_turf_below(src)
|
||||
if(T)
|
||||
T.multiz_turf_new(src, UP)
|
||||
SEND_SIGNAL(T, COMSIG_TURF_MULTIZ_NEW, src, UP)
|
||||
|
||||
if (opacity)
|
||||
has_opaque_atom = TRUE
|
||||
|
||||
@@ -76,13 +85,19 @@
|
||||
return INITIALIZE_HINT_NORMAL
|
||||
|
||||
/turf/proc/Initalize_Atmos(times_fired)
|
||||
CalculateAdjacentTurfs()
|
||||
CALCULATE_ADJACENT_TURFS(src)
|
||||
|
||||
/turf/Destroy(force)
|
||||
. = QDEL_HINT_IWILLGC
|
||||
if(!changing_turf)
|
||||
stack_trace("Incorrect turf deletion")
|
||||
changing_turf = FALSE
|
||||
var/turf/T = SSmapping.get_turf_above(src)
|
||||
if(T)
|
||||
T.multiz_turf_del(src, DOWN)
|
||||
T = SSmapping.get_turf_below(src)
|
||||
if(T)
|
||||
T.multiz_turf_del(src, UP)
|
||||
if(force)
|
||||
..()
|
||||
//this will completely wipe turf state
|
||||
@@ -105,6 +120,60 @@
|
||||
return
|
||||
user.Move_Pulled(src)
|
||||
|
||||
/turf/proc/multiz_turf_del(turf/T, dir)
|
||||
|
||||
/turf/proc/multiz_turf_new(turf/T, dir)
|
||||
|
||||
//zPassIn doesn't necessarily pass an atom!
|
||||
//direction is direction of travel of air
|
||||
/turf/proc/zPassIn(atom/movable/A, direction, turf/source)
|
||||
return FALSE
|
||||
|
||||
//direction is direction of travel of air
|
||||
/turf/proc/zPassOut(atom/movable/A, direction, turf/destination)
|
||||
return FALSE
|
||||
|
||||
//direction is direction of travel of air
|
||||
/turf/proc/zAirIn(direction, turf/source)
|
||||
return FALSE
|
||||
|
||||
//direction is direction of travel of air
|
||||
/turf/proc/zAirOut(direction, turf/source)
|
||||
return FALSE
|
||||
|
||||
/turf/proc/zImpact(atom/movable/A, levels = 1, turf/prev_turf)
|
||||
var/flags = NONE
|
||||
var/mov_name = A.name
|
||||
for(var/i in contents)
|
||||
var/atom/thing = i
|
||||
flags |= thing.intercept_zImpact(A, levels)
|
||||
if(flags & FALL_STOP_INTERCEPTING)
|
||||
break
|
||||
if(prev_turf && !(flags & FALL_NO_MESSAGE))
|
||||
prev_turf.visible_message("<span class='danger'>[mov_name] falls through [prev_turf]!</span>")
|
||||
if(flags & FALL_INTERCEPTED)
|
||||
return
|
||||
if(zFall(A, ++levels))
|
||||
return FALSE
|
||||
A.visible_message("<span class='danger'>[A] crashes into [src]!</span>")
|
||||
A.onZImpact(src, levels)
|
||||
return TRUE
|
||||
|
||||
/turf/proc/can_zFall(atom/movable/A, levels = 1, turf/target)
|
||||
return zPassOut(A, DOWN, target) && target.zPassIn(A, DOWN, src)
|
||||
|
||||
/turf/proc/zFall(atom/movable/A, levels = 1, force = FALSE)
|
||||
var/turf/target = get_step_multiz(src, DOWN)
|
||||
if(!target || (!isobj(A) && !ismob(A)))
|
||||
return FALSE
|
||||
if(!force && (!can_zFall(A, levels, target) || !A.can_zFall(src, levels, target, DOWN)))
|
||||
return FALSE
|
||||
A.zfalling = TRUE
|
||||
A.forceMove(target)
|
||||
A.zfalling = FALSE
|
||||
target.zImpact(A, levels, src)
|
||||
return TRUE
|
||||
|
||||
/turf/proc/handleRCL(obj/item/twohanded/rcl/C, mob/user)
|
||||
if(C.loaded)
|
||||
for(var/obj/structure/cable/LC in src)
|
||||
@@ -196,6 +265,9 @@
|
||||
if(O.obj_flags & FROZEN)
|
||||
O.make_unfrozen()
|
||||
|
||||
if(!AM.zfalling)
|
||||
zFall(AM)
|
||||
|
||||
/turf/proc/is_plasteel_floor()
|
||||
return FALSE
|
||||
|
||||
|
||||
Reference in New Issue
Block a user