mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-22 03:27:46 +01:00
Revert "[MIRROR] /atom New() => Initialize() [MDB IGNORE]"
This commit is contained in:
@@ -2,13 +2,14 @@
|
||||
var/list/z_levels = list()// Each bit re... haha just kidding this is a list of bools now
|
||||
|
||||
// If the height is more than 1, we mark all contained levels as connected.
|
||||
INITIALIZE_IMMEDIATE(/obj/effect/landmark/map_data)
|
||||
/obj/effect/landmark/map_data/Initialize()
|
||||
..()
|
||||
/obj/effect/landmark/map_data/New()
|
||||
for(var/i = (z - height + 1) to (z-1))
|
||||
if (z_levels.len <i)
|
||||
z_levels.len = i
|
||||
z_levels[i] = TRUE
|
||||
|
||||
/obj/effect/landmark/map_data/Initialize()
|
||||
..()
|
||||
return INITIALIZE_HINT_QDEL
|
||||
|
||||
// The storage of connections between adjacent levels means some bitwise magic is needed.
|
||||
|
||||
@@ -14,11 +14,7 @@
|
||||
var/const/climb_time = 2 SECONDS
|
||||
|
||||
/obj/structure/ladder/Initialize()
|
||||
..()
|
||||
return INITIALIZE_HINT_LATELOAD
|
||||
|
||||
/obj/structure/ladder/LateInitialize()
|
||||
..()
|
||||
. = ..()
|
||||
// the upper will connect to the lower
|
||||
if(allowed_directions & DOWN) //we only want to do the top one, as it will initialize the ones before it.
|
||||
for(var/obj/structure/ladder/L in GetBelow(src))
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
|
||||
level = 1
|
||||
|
||||
/obj/machinery/atmospherics/pipe/zpipe/Initialize()
|
||||
. = ..()
|
||||
/obj/machinery/atmospherics/pipe/zpipe/New()
|
||||
..()
|
||||
init_dir()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/zpipe/init_dir()
|
||||
|
||||
@@ -12,11 +12,7 @@
|
||||
layer = STAIRS_LAYER
|
||||
|
||||
/obj/structure/stairs/Initialize()
|
||||
..()
|
||||
return INITIALIZE_HINT_LATELOAD
|
||||
|
||||
/obj/structure/stairs/LateInitialize()
|
||||
..()
|
||||
. = ..()
|
||||
if(check_integrity())
|
||||
update_icon()
|
||||
|
||||
@@ -77,8 +73,8 @@
|
||||
var/obj/structure/stairs/top/top = null
|
||||
var/obj/structure/stairs/middle/middle = null
|
||||
|
||||
/obj/structure/stairs/bottom/LateInitialize()
|
||||
..()
|
||||
/obj/structure/stairs/bottom/Initialize()
|
||||
. = ..()
|
||||
if(!GetAbove(src))
|
||||
warning("Stair created without level above: ([loc.x], [loc.y], [loc.z])")
|
||||
return INITIALIZE_HINT_QDEL
|
||||
@@ -247,8 +243,8 @@
|
||||
var/obj/structure/stairs/top/top = null
|
||||
var/obj/structure/stairs/bottom/bottom = null
|
||||
|
||||
/obj/structure/stairs/middle/LateInitialize()
|
||||
..()
|
||||
/obj/structure/stairs/middle/Initialize()
|
||||
. = ..()
|
||||
if(!GetAbove(src))
|
||||
warning("Stair created without level above: ([loc.x], [loc.y], [loc.z])")
|
||||
return INITIALIZE_HINT_QDEL
|
||||
@@ -499,7 +495,7 @@
|
||||
icon = 'icons/obj/structures/stairs_64x64.dmi'
|
||||
icon_state = ""
|
||||
|
||||
/obj/structure/stairs/spawner/LateInitialize()
|
||||
/obj/structure/stairs/spawner/Initialize()
|
||||
..()
|
||||
var/turf/B1 = get_step(get_turf(src), turn(dir, 180))
|
||||
var/turf/B2 = get_turf(src)
|
||||
|
||||
@@ -62,11 +62,7 @@ GLOBAL_DATUM_INIT(openspace_backdrop_one_for_all, /atom/movable/openspace_backdr
|
||||
temperature = TCMB
|
||||
|
||||
/turf/simulated/open/Initialize()
|
||||
..()
|
||||
return INITIALIZE_HINT_LATELOAD
|
||||
|
||||
/turf/simulated/open/LateInitialize()
|
||||
..()
|
||||
. = ..()
|
||||
ASSERT(HasBelow(z))
|
||||
add_overlay(GLOB.openspace_backdrop_one_for_all, TRUE) //Special grey square for projecting backdrop darkness filter on it.
|
||||
return INITIALIZE_HINT_LATELOAD
|
||||
|
||||
@@ -1,127 +0,0 @@
|
||||
/mob // TODO: rewrite as obj.
|
||||
var/mob/zshadow/shadow
|
||||
|
||||
/mob/zshadow
|
||||
plane = OVER_OPENSPACE_PLANE
|
||||
name = "shadow"
|
||||
desc = "Z-level shadow"
|
||||
status_flags = GODMODE
|
||||
anchored = 1
|
||||
unacidable = 1
|
||||
density = 0
|
||||
opacity = 0 // Don't trigger lighting recalcs gah! TODO - consider multi-z lighting.
|
||||
//auto_init = FALSE // We do not need to be initialize()d
|
||||
var/mob/owner = null // What we are a shadow of.
|
||||
|
||||
/mob/zshadow/can_fall()
|
||||
return FALSE
|
||||
|
||||
INITIALIZE_IMMEDIATE(/mob/zshadow)
|
||||
/mob/zshadow/Initialize(var/ml, var/mob/L)
|
||||
. = ..()
|
||||
if(!istype(L))
|
||||
return INITIALIZE_HINT_QDEL
|
||||
owner = L
|
||||
sync_icon(L)
|
||||
|
||||
/mob/zshadow/Destroy()
|
||||
owner.shadow = null
|
||||
owner = null
|
||||
..() //But we don't return because the hint is wrong
|
||||
return QDEL_HINT_QUEUE
|
||||
|
||||
/mob/Destroy()
|
||||
QDEL_NULL(shadow)
|
||||
. = ..()
|
||||
|
||||
/mob/zshadow/examine(mob/user, distance, infix, suffix)
|
||||
if(!owner)
|
||||
// The only time we should have a null owner is if we are in nullspace. Help figure out why we were examined.
|
||||
crash_with("[src] ([type]) @ [log_info_line()] was examined by [user] @ [global.log_info_line(user)]")
|
||||
return list()
|
||||
return owner.examine(user, distance, infix, suffix)
|
||||
|
||||
// Relay some stuff they hear
|
||||
/mob/zshadow/hear_say(var/list/message_pieces, var/verb = "says", var/italics = 0, var/mob/speaker = null, var/sound/speech_sound, var/sound_vol)
|
||||
if(speaker && speaker.z != src.z)
|
||||
return // Only relay speech on our acutal z, otherwise we might relay sounds that were themselves relayed up!
|
||||
if(isliving(owner))
|
||||
verb += " from above"
|
||||
return owner.hear_say(message_pieces, verb, italics, speaker, speech_sound, sound_vol)
|
||||
|
||||
/mob/zshadow/proc/sync_icon(var/mob/M)
|
||||
name = M.name
|
||||
icon = M.icon
|
||||
icon_state = M.icon_state
|
||||
//color = M.color
|
||||
color = "#848484"
|
||||
overlays = M.overlays
|
||||
transform = M.transform
|
||||
dir = M.dir
|
||||
invisibility = M.invisibility
|
||||
if(shadow)
|
||||
shadow.sync_icon(src)
|
||||
|
||||
/mob/living/Moved()
|
||||
. = ..()
|
||||
check_shadow()
|
||||
|
||||
/mob/living/forceMove()
|
||||
. = ..()
|
||||
check_shadow()
|
||||
|
||||
/mob/living/on_mob_jump()
|
||||
// We're about to be admin-jumped.
|
||||
// Unfortuantely loc isn't set until after this proc is called. So we must spawn() so check_shadow executes with the new loc.
|
||||
. = ..()
|
||||
if(shadow)
|
||||
spawn(0)
|
||||
check_shadow()
|
||||
|
||||
/mob/living/proc/check_shadow()
|
||||
var/mob/M = src
|
||||
if(isturf(M.loc))
|
||||
var/turf/simulated/open/OS = GetAbove(src)
|
||||
while(OS && istype(OS))
|
||||
if(!M.shadow)
|
||||
M.shadow = new /mob/zshadow(null, M)
|
||||
M.shadow.forceMove(OS)
|
||||
M = M.shadow
|
||||
OS = GetAbove(M)
|
||||
// The topmost level does not need a shadow!
|
||||
if(M.shadow)
|
||||
qdel(M.shadow)
|
||||
M.shadow = null
|
||||
|
||||
//
|
||||
// Handle cases where the owner mob might have changed its icon or overlays.
|
||||
//
|
||||
|
||||
/mob/living/update_icons()
|
||||
. = ..()
|
||||
if(shadow)
|
||||
shadow.sync_icon(src)
|
||||
|
||||
// WARNING - the true carbon/human/update_icons does not call ..(), therefore we must sideways override this.
|
||||
// But be careful, we don't want to screw with that proc. So lets be cautious about what we do here.
|
||||
/mob/living/carbon/human/update_icons()
|
||||
. = ..()
|
||||
if(shadow)
|
||||
shadow.sync_icon(src)
|
||||
|
||||
/mob/set_dir(new_dir)
|
||||
. = ..()
|
||||
if(shadow)
|
||||
shadow.set_dir(new_dir)
|
||||
|
||||
/mob/zshadow/set_typing_indicator(var/state)
|
||||
if(!typing_indicator)
|
||||
init_typing_indicator("typing")
|
||||
if(state && !typing)
|
||||
overlays += typing_indicator
|
||||
typing = 1
|
||||
else if(!state && typing)
|
||||
overlays -= typing_indicator
|
||||
typing = 0
|
||||
if(shadow)
|
||||
shadow.set_typing_indicator(state)
|
||||
Reference in New Issue
Block a user