diff --git a/code/_helpers/_lists.dm b/code/_helpers/_lists.dm index fdd6fc03a7..f60f113c69 100644 --- a/code/_helpers/_lists.dm +++ b/code/_helpers/_lists.dm @@ -843,3 +843,18 @@ proc/dd_sortedTextList(list/incoming) if(L.len) . = L[1] L.Cut(1,2) + +//generates a list used to randomize transit animations so they aren't in lockstep +/proc/get_cross_shift_list(var/size) + var/list/result = list() + + result += rand(0, 14) + for(var/i in 2 to size) + var/shifts = list(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14) + shifts -= result[i - 1] //consecutive shifts should not be equal + if(i == size) + shifts -= result[1] //because shift list is a ring buffer + result += pick(shifts) + + return result + \ No newline at end of file diff --git a/code/_helpers/global_lists.dm b/code/_helpers/global_lists.dm index 854b02e3bf..ca862dbf3e 100644 --- a/code/_helpers/global_lists.dm +++ b/code/_helpers/global_lists.dm @@ -19,8 +19,6 @@ var/global/list/side_effects = list() //list of all medical sideeffects types var/global/list/mechas_list = list() //list of all mechs. Used by hostile mobs target tracking. var/global/list/joblist = list() //list of all jobstypes, minus borg and AI -var/global/list/turfs = list() //list of all turfs - #define all_genders_define_list list(MALE,FEMALE,PLURAL,NEUTER,HERM) //VOREStaton Edit #define all_genders_text_list list("Male","Female","Plural","Neuter","Herm") //VOREStation Edit diff --git a/code/controllers/subsystems/air.dm b/code/controllers/subsystems/air.dm index 263e290968..40d2cc3133 100644 --- a/code/controllers/subsystems/air.dm +++ b/code/controllers/subsystems/air.dm @@ -38,7 +38,7 @@ SUBSYSTEM_DEF(air) current_cycle = 0 var/simulated_turf_count = 0 - for(var/turf/simulated/S in turfs) + for(var/turf/simulated/S in world) simulated_turf_count++ S.update_air_properties() CHECK_TICK diff --git a/code/controllers/subsystems/mapping.dm b/code/controllers/subsystems/mapping.dm index cc69931426..5e13e28e8f 100644 --- a/code/controllers/subsystems/mapping.dm +++ b/code/controllers/subsystems/mapping.dm @@ -16,8 +16,7 @@ SUBSYSTEM_DEF(mapping) if(config.generate_map) // Map-gen is still very specific to the map, however putting it here should ensure it loads in the correct order. - if(using_map.perform_map_generation()) - using_map.refresh_mining_turfs() + using_map.perform_map_generation() /datum/controller/subsystem/mapping/proc/load_map_templates() diff --git a/code/controllers/subsystems/skybox.dm b/code/controllers/subsystems/skybox.dm index b876c6a2c8..59e841ee52 100644 --- a/code/controllers/subsystems/skybox.dm +++ b/code/controllers/subsystems/skybox.dm @@ -6,6 +6,38 @@ SUBSYSTEM_DEF(skybox) flags = SS_NO_FIRE var/list/skybox_cache = list() + var/list/dust_cache = list() + var/list/speedspace_cache = list() + var/list/phase_shift_by_x = list() + var/list/phase_shift_by_y = list() + +/datum/controller/subsystem/skybox/PreInit() + //Static + for (var/i in 0 to 25) + var/image/im = image('icons/turf/space_dust.dmi', "[i]") + im.plane = DUST_PLANE + im.alpha = 128 //80 + im.blend_mode = BLEND_ADD + dust_cache["[i]"] = im + //Moving + for (var/i in 0 to 14) + // NORTH/SOUTH + var/image/im = image('icons/turf/space_dust_transit.dmi', "speedspace_ns_[i]") + im.plane = DUST_PLANE + im.blend_mode = BLEND_ADD + speedspace_cache["NS_[i]"] = im + // EAST/WEST + im = image('icons/turf/space_dust_transit.dmi', "speedspace_ew_[i]") + im.plane = DUST_PLANE + im.blend_mode = BLEND_ADD + speedspace_cache["EW_[i]"] = im + + //Shuffle some lists + phase_shift_by_x = get_cross_shift_list(15) + phase_shift_by_y = get_cross_shift_list(15) + + . = ..() + /datum/controller/subsystem/skybox/Initialize() . = ..() diff --git a/code/controllers/subsystems/xenoarch.dm b/code/controllers/subsystems/xenoarch.dm index d863ad8269..c8184d783e 100644 --- a/code/controllers/subsystems/xenoarch.dm +++ b/code/controllers/subsystems/xenoarch.dm @@ -30,7 +30,7 @@ SUBSYSTEM_DEF(xenoarch) . = ..() /datum/controller/subsystem/xenoarch/proc/SetupXenoarch() - for(var/turf/simulated/mineral/M in turfs) + for(var/turf/simulated/mineral/M in world) if(!M.density || M.z in using_map.xenoarch_exempt_levels) continue diff --git a/code/game/gamemodes/cult/hell_universe.dm b/code/game/gamemodes/cult/hell_universe.dm index ee79453933..27dd86df13 100644 --- a/code/game/gamemodes/cult/hell_universe.dm +++ b/code/game/gamemodes/cult/hell_universe.dm @@ -65,11 +65,11 @@ In short: for(var/datum/lighting_corner/L in world) L.update_lumcount(1, 0, 0) - for(var/turf/space/T in turfs) + for(var/turf/space/T in world) OnTurfChange(T) /datum/universal_state/hell/proc/MiscSet() - for(var/turf/simulated/floor/T in turfs) + for(var/turf/simulated/floor/T in world) if(!T.holy && prob(1)) new /obj/effect/gateway/active/cult(T) diff --git a/code/game/gamemodes/endgame/supermatter_cascade/blob.dm b/code/game/gamemodes/endgame/supermatter_cascade/blob.dm index be85616143..88da43257d 100644 --- a/code/game/gamemodes/endgame/supermatter_cascade/blob.dm +++ b/code/game/gamemodes/endgame/supermatter_cascade/blob.dm @@ -14,8 +14,8 @@ var/next_check=0 var/list/avail_dirs = list(NORTH,SOUTH,EAST,WEST) -/turf/unsimulated/wall/supermatter/New() - ..() +/turf/unsimulated/wall/supermatter/Initialize(mapload) + . = ..() START_PROCESSING(SSturfs, src) next_check = world.time+5 SECONDS diff --git a/code/game/gamemodes/endgame/supermatter_cascade/universe.dm b/code/game/gamemodes/endgame/supermatter_cascade/universe.dm index 0c0d4c1a40..8f4f861b42 100644 --- a/code/game/gamemodes/endgame/supermatter_cascade/universe.dm +++ b/code/game/gamemodes/endgame/supermatter_cascade/universe.dm @@ -98,7 +98,7 @@ The access requirements on the Asteroid Shuttles' consoles have now been revoked else L.update_lumcount(0.0, 0.4, 1) - for(var/turf/space/T in turfs) + for(var/turf/space/T in world) OnTurfChange(T) /datum/universal_state/supermatter_cascade/proc/MiscSet() diff --git a/code/game/gamemodes/events/wormholes.dm b/code/game/gamemodes/events/wormholes.dm index 83f4246696..20f7da63f3 100644 --- a/code/game/gamemodes/events/wormholes.dm +++ b/code/game/gamemodes/events/wormholes.dm @@ -3,7 +3,7 @@ var/list/pick_turfs = list() var/list/Z_choices = list() Z_choices |= using_map.get_map_levels(1, FALSE) - for(var/turf/simulated/floor/T in turfs) + for(var/turf/simulated/floor/T in world) if(T.z in Z_choices) if(!T.block_tele) pick_turfs += T diff --git a/code/game/turfs/simulated.dm b/code/game/turfs/simulated.dm index 21488e5f26..9e48b3777c 100644 --- a/code/game/turfs/simulated.dm +++ b/code/game/turfs/simulated.dm @@ -55,8 +55,8 @@ B.clean_blood() ..() -/turf/simulated/New() - ..() +/turf/simulated/Initialize(mapload) + . = ..() if(istype(loc, /area/chapel)) holy = 1 levelupdate() diff --git a/code/game/turfs/simulated/dungeon/wall.dm b/code/game/turfs/simulated/dungeon/wall.dm index be26ab2393..b5a5866d21 100644 --- a/code/game/turfs/simulated/dungeon/wall.dm +++ b/code/game/turfs/simulated/dungeon/wall.dm @@ -3,8 +3,8 @@ /turf/simulated/wall/dungeon block_tele = TRUE // Anti-cheese. -/turf/simulated/wall/dungeon/New(var/newloc) - ..(newloc,"dungeonium") +/turf/simulated/wall/dungeon/Initialize(mapload) + . = ..(mapload, "dungeonium") /turf/simulated/wall/dungeon/attackby() return @@ -20,8 +20,8 @@ var/rock_side = "rock_side" block_tele = TRUE -/turf/simulated/wall/solidrock/New(var/newloc) - ..(newloc,"bedrock") +/turf/simulated/wall/solidrock/Initialize(mapload) + . = ..(mapload, "bedrock") /turf/simulated/wall/solidrock/Initialize() ..() @@ -81,8 +81,8 @@ desc = "An old, yet impressively durably rock wall." var/mossyrock_side = "mossyrock_side" -/turf/simulated/wall/solidrock/New(var/newloc) - ..(newloc,"mossyrock") +/turf/simulated/wall/solidrock/Initialize(mapload) + . = ..(mapload, "mossyrock") /turf/simulated/wall/solidrock/mossyrockpoi/update_icon(var/update_neighbors) if(density) diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm index 31bfd62684..e5ab3685ea 100644 --- a/code/game/turfs/simulated/floor.dm +++ b/code/game/turfs/simulated/floor.dm @@ -35,8 +35,8 @@ /turf/simulated/floor/is_plating() return !flooring -/turf/simulated/floor/New(var/newloc, var/floortype) - ..(newloc) +/turf/simulated/floor/Initialize(mapload, floortype) + . = ..() if(!floortype && initial_flooring) floortype = initial_flooring if(floortype) @@ -52,25 +52,16 @@ make_plating(defer_icon_update = 1) flooring = newflooring footstep_sounds = newflooring.footstep_sounds - // VOREStation Edit - We are plating switching to flooring, swap out old_decals for decals - var/tmp/list/overfloor_decals = old_decals - old_decals = decals - decals = overfloor_decals - // VOREStation Edit End + if(old_decals) // Flooring -> Plating -> Flooring + decals = old_decals + old_decals = null update_icon(1) levelupdate() //This proc will set floor_type to null and the update_icon() proc will then change the icon_state of the turf //This proc auto corrects the grass tiles' siding. /turf/simulated/floor/proc/make_plating(var/place_product, var/defer_icon_update) - cut_overlays() - // VOREStation Edit - We are flooring switching to plating, swap out old_decals for decals. - if(flooring) - var/tmp/list/underfloor_decals = old_decals - old_decals = decals - decals = underfloor_decals - // VOREStation Edit End name = base_name desc = base_desc @@ -78,7 +69,9 @@ icon_state = base_icon_state footstep_sounds = base_footstep_sounds - if(flooring) + if(flooring) // Flooring -> Plating + old_decals = decals + decals = null if(flooring.build_type && place_product) new flooring.build_type(src) flooring = null diff --git a/code/game/turfs/simulated/floor_types.dm b/code/game/turfs/simulated/floor_types.dm index 6b2215a11c..2a85a6d131 100644 --- a/code/game/turfs/simulated/floor_types.dm +++ b/code/game/turfs/simulated/floor_types.dm @@ -85,7 +85,7 @@ var/join_group = "shuttle" //A tag for what other walls to join with. Null if you don't want them to. var/static/list/antilight_cache -/turf/simulated/shuttle/New() +/turf/simulated/shuttle/Initialize(mapload) ..() if(!antilight_cache) antilight_cache = list() diff --git a/code/game/turfs/simulated/outdoors/outdoors.dm b/code/game/turfs/simulated/outdoors/outdoors.dm index a378cc48da..7bef49cd49 100644 --- a/code/game/turfs/simulated/outdoors/outdoors.dm +++ b/code/game/turfs/simulated/outdoors/outdoors.dm @@ -24,10 +24,10 @@ var/list/turf_edge_cache = list() update_icon() . = ..() -/turf/simulated/floor/New() +/turf/simulated/floor/Initialize(mapload) if(outdoors) SSplanets.addTurf(src) - ..() + . = ..() /turf/simulated/floor/Destroy() if(outdoors) diff --git a/code/game/turfs/simulated/wall_types.dm b/code/game/turfs/simulated/wall_types.dm index bff82d6e0e..96979c8452 100644 --- a/code/game/turfs/simulated/wall_types.dm +++ b/code/game/turfs/simulated/wall_types.dm @@ -1,89 +1,89 @@ /turf/simulated/wall/r_wall icon_state = "rgeneric" -/turf/simulated/wall/r_wall/New(var/newloc) - ..(newloc, "plasteel","plasteel") //3strong +/turf/simulated/wall/r_wall/Initialize(mapload) + . = ..(mapload, "plasteel","plasteel") //3strong -/turf/simulated/wall/shull/New(var/newloc) //Spaaaace ship. - ..(newloc, MAT_STEELHULL, null, MAT_STEELHULL) -/turf/simulated/wall/rshull/New(var/newloc) - ..(newloc, MAT_STEELHULL, MAT_STEELHULL, MAT_STEELHULL) -/turf/simulated/wall/pshull/New(var/newloc) //Spaaaace-er ship. - ..(newloc, MAT_PLASTEELHULL, null, MAT_PLASTEELHULL) -/turf/simulated/wall/rpshull/New(var/newloc) - ..(newloc, MAT_PLASTEELHULL, MAT_PLASTEELHULL, MAT_PLASTEELHULL) -/turf/simulated/wall/dshull/New(var/newloc) //Spaaaace-est ship. - ..(newloc, MAT_DURASTEELHULL, null, MAT_DURASTEELHULL) -/turf/simulated/wall/rdshull/New(var/newloc) - ..(newloc, MAT_DURASTEELHULL, MAT_DURASTEELHULL, MAT_DURASTEELHULL) -/turf/simulated/wall/thull/New(var/newloc) - ..(newloc, MAT_TITANIUMHULL, null, MAT_TITANIUMHULL) -/turf/simulated/wall/rthull/New(var/newloc) - ..(newloc, MAT_TITANIUMHULL, MAT_TITANIUMHULL, MAT_TITANIUMHULL) +/turf/simulated/wall/shull/Initialize(mapload) //Spaaaace ship. + . = ..(mapload, MAT_STEELHULL, null, MAT_STEELHULL) +/turf/simulated/wall/rshull/Initialize(mapload) + . = ..(mapload, MAT_STEELHULL, MAT_STEELHULL, MAT_STEELHULL) +/turf/simulated/wall/pshull/Initialize(mapload) //Spaaaace-er ship. + . = ..(mapload, MAT_PLASTEELHULL, null, MAT_PLASTEELHULL) +/turf/simulated/wall/rpshull/Initialize(mapload) + . = ..(mapload, MAT_PLASTEELHULL, MAT_PLASTEELHULL, MAT_PLASTEELHULL) +/turf/simulated/wall/dshull/Initialize(mapload) //Spaaaace-est ship. + . = ..(mapload, MAT_DURASTEELHULL, null, MAT_DURASTEELHULL) +/turf/simulated/wall/rdshull/Initialize(mapload) + . = ..(mapload, MAT_DURASTEELHULL, MAT_DURASTEELHULL, MAT_DURASTEELHULL) +/turf/simulated/wall/thull/Initialize(mapload) + . = ..(mapload, MAT_TITANIUMHULL, null, MAT_TITANIUMHULL) +/turf/simulated/wall/rthull/Initialize(mapload) + . = ..(mapload, MAT_TITANIUMHULL, MAT_TITANIUMHULL, MAT_TITANIUMHULL) /turf/simulated/wall/cult icon_state = "cult" -/turf/simulated/wall/cult/New(var/newloc) - ..(newloc,"cult","cult2","cult") +/turf/simulated/wall/cult/Initialize(mapload) + . = ..(mapload, "cult","cult2","cult") /turf/unsimulated/wall/cult name = "cult wall" desc = "Hideous images dance beneath the surface." icon = 'icons/turf/wall_masks.dmi' icon_state = "cult" -/turf/simulated/wall/iron/New(var/newloc) - ..(newloc,"iron") -/turf/simulated/wall/uranium/New(var/newloc) - ..(newloc,"uranium") -/turf/simulated/wall/diamond/New(var/newloc) - ..(newloc,"diamond") -/turf/simulated/wall/gold/New(var/newloc) - ..(newloc,"gold") -/turf/simulated/wall/silver/New(var/newloc) - ..(newloc,"silver") -/turf/simulated/wall/lead/New(var/newloc) - ..(newloc,"lead") -/turf/simulated/wall/r_lead/New(var/newloc) - ..(newloc,"lead", "lead") -/turf/simulated/wall/phoron/New(var/newloc) - ..(newloc,"phoron") -/turf/simulated/wall/sandstone/New(var/newloc) - ..(newloc,"sandstone") -/turf/simulated/wall/ironphoron/New(var/newloc) - ..(newloc,"iron","phoron") -/turf/simulated/wall/golddiamond/New(var/newloc) - ..(newloc,"gold","diamond") -/turf/simulated/wall/silvergold/New(var/newloc) - ..(newloc,"silver","gold") -/turf/simulated/wall/sandstonediamond/New(var/newloc) - ..(newloc,"sandstone","diamond") -/turf/simulated/wall/snowbrick/New(var/newloc) - ..(newloc,"packed snow") +/turf/simulated/wall/iron/Initialize(mapload) + . = ..(mapload, "iron") +/turf/simulated/wall/uranium/Initialize(mapload) + . = ..(mapload, "uranium") +/turf/simulated/wall/diamond/Initialize(mapload) + . = ..(mapload, "diamond") +/turf/simulated/wall/gold/Initialize(mapload) + . = ..(mapload, "gold") +/turf/simulated/wall/silver/Initialize(mapload) + . = ..(mapload, "silver") +/turf/simulated/wall/lead/Initialize(mapload) + . = ..(mapload, "lead") +/turf/simulated/wall/r_lead/Initialize(mapload) + . = ..(mapload, "lead", "lead") +/turf/simulated/wall/phoron/Initialize(mapload) + . = ..(mapload, "phoron") +/turf/simulated/wall/sandstone/Initialize(mapload) + . = ..(mapload, "sandstone") +/turf/simulated/wall/ironphoron/Initialize(mapload) + . = ..(mapload, "iron","phoron") +/turf/simulated/wall/golddiamond/Initialize(mapload) + . = ..(mapload, "gold","diamond") +/turf/simulated/wall/silvergold/Initialize(mapload) + . = ..(mapload, "silver","gold") +/turf/simulated/wall/sandstonediamond/Initialize(mapload) + . = ..(mapload, "sandstone","diamond") +/turf/simulated/wall/snowbrick/Initialize(mapload) + . = ..(mapload, "packed snow") -/turf/simulated/wall/resin/New(var/newloc) - ..(newloc,"resin",null,"resin") +/turf/simulated/wall/resin/Initialize(mapload) + . = ..(mapload, "resin",null,"resin") // Kind of wondering if this is going to bite me in the butt. -/turf/simulated/wall/skipjack/New(var/newloc) - ..(newloc,"alienalloy") +/turf/simulated/wall/skipjack/Initialize(mapload) + . = ..(mapload, "alienalloy") /turf/simulated/wall/skipjack/attackby() return -/turf/simulated/wall/titanium/New(var/newloc) - ..(newloc,"titanium") +/turf/simulated/wall/titanium/Initialize(mapload) + . = ..(mapload, "titanium") -/turf/simulated/wall/durasteel/New(var/newloc) - ..(newloc,"durasteel", "durasteel") +/turf/simulated/wall/durasteel/Initialize(mapload) + . = ..(mapload, "durasteel", "durasteel") -/turf/simulated/wall/wood/New(var/newloc) - ..(newloc, MAT_WOOD) +/turf/simulated/wall/wood/Initialize(mapload) + . = ..(mapload, MAT_WOOD) -/turf/simulated/wall/sifwood/New(var/newloc) - ..(newloc, MAT_SIFWOOD) +/turf/simulated/wall/sifwood/Initialize(mapload) + . = ..(mapload, MAT_SIFWOOD) -/turf/simulated/wall/log/New(var/newloc) - ..(newloc, MAT_LOG) +/turf/simulated/wall/log/Initialize(mapload) + . = ..(mapload, MAT_LOG) -/turf/simulated/wall/log_sif/New(var/newloc) - ..(newloc, MAT_SIFLOG) +/turf/simulated/wall/log_sif/Initialize(mapload) + . = ..(mapload, MAT_SIFLOG) // Shuttle Walls /turf/simulated/shuttle/wall @@ -152,16 +152,14 @@ icon_state = "alien-nj" join_group = null -/turf/simulated/shuttle/wall/New() - ..() - //To allow mappers to rename shuttle walls to like "redfloor interior" or whatever for ease of use. - name = true_name - /turf/simulated/shuttle/wall/Initialize() . = ..() + //To allow mappers to rename shuttle walls to like "redfloor interior" or whatever for ease of use. + name = true_name + if(join_group) - src.auto_join() + auto_join() else icon_state = base_state diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm index bf5f711b20..d72beb290c 100644 --- a/code/game/turfs/simulated/walls.dm +++ b/code/game/turfs/simulated/walls.dm @@ -27,8 +27,8 @@ for(var/obj/O in src) O.hide(1) -/turf/simulated/wall/New(var/newloc, var/materialtype, var/rmaterialtype, var/girdertype) - ..(newloc) +/turf/simulated/wall/Initialize(mapload, materialtype, rmaterialtype, girdertype) + . = ..() icon_state = "blank" if(!materialtype) materialtype = DEFAULT_WALL_MATERIAL diff --git a/code/game/turfs/space/space.dm b/code/game/turfs/space/space.dm index cf5d512cf5..47cdf43555 100644 --- a/code/game/turfs/space/space.dm +++ b/code/game/turfs/space/space.dm @@ -9,82 +9,38 @@ thermal_conductivity = OPEN_HEAT_TRANSFER_COEFFICIENT can_build_into_floor = TRUE var/keep_sprite = FALSE -// heat_capacity = 700000 No. - var/static/list/dust_cache - var/static/list/speedspace_cache - var/static/list/phase_shift_by_x - var/static/list/phase_shift_by_y - -/turf/space/proc/build_dust_cache() - //Static - LAZYINITLIST(dust_cache) - for (var/i in 0 to 25) - var/image/im = image('icons/turf/space_dust.dmi', "[i]") - im.plane = DUST_PLANE - im.alpha = 128 //80 - im.blend_mode = BLEND_ADD - dust_cache["[i]"] = im - //Moving - LAZYINITLIST(speedspace_cache) - for (var/i in 0 to 14) - // NORTH/SOUTH - var/image/im = image('icons/turf/space_dust_transit.dmi', "speedspace_ns_[i]") - im.plane = DUST_PLANE - im.blend_mode = BLEND_ADD - speedspace_cache["NS_[i]"] = im - // EAST/WEST - im = image('icons/turf/space_dust_transit.dmi', "speedspace_ew_[i]") - im.plane = DUST_PLANE - im.blend_mode = BLEND_ADD - speedspace_cache["EW_[i]"] = im /turf/space/Initialize() . = ..() + if(!keep_sprite) icon_state = "white" - update_starlight() - if (!dust_cache) - build_dust_cache() - toggle_transit() //add static dust + + if(config.starlight) + update_starlight() + + toggle_transit() //Add static dust (not passing a dir) /turf/space/proc/toggle_transit(var/direction) cut_overlays() if(!direction) - add_overlay(dust_cache["[((x + y) ^ ~(x * y) + z) % 25]"]) + add_overlay(SSskybox.dust_cache["[((x + y) ^ ~(x * y) + z) % 25]"]) return if(direction & (NORTH|SOUTH)) - if(!phase_shift_by_x) - phase_shift_by_x = get_cross_shift_list(15) - var/x_shift = phase_shift_by_x[src.x % (phase_shift_by_x.len - 1) + 1] + var/x_shift = SSskybox.phase_shift_by_x[src.x % (SSskybox.phase_shift_by_x.len - 1) + 1] var/transit_state = ((direction & SOUTH ? world.maxy - src.y : src.y) + x_shift)%15 - add_overlay(speedspace_cache["NS_[transit_state]"]) + add_overlay(SSskybox.speedspace_cache["NS_[transit_state]"]) else if(direction & (EAST|WEST)) - if(!phase_shift_by_y) - phase_shift_by_y = get_cross_shift_list(15) - var/y_shift = phase_shift_by_y[src.y % (phase_shift_by_y.len - 1) + 1] + var/y_shift = SSskybox.phase_shift_by_y[src.y % (SSskybox.phase_shift_by_y.len - 1) + 1] var/transit_state = ((direction & WEST ? world.maxx - src.x : src.x) + y_shift)%15 - add_overlay(speedspace_cache["EW_[transit_state]"]) + add_overlay(SSskybox.speedspace_cache["EW_[transit_state]"]) for(var/atom/movable/AM in src) if (AM.simulated && !AM.anchored) AM.throw_at(get_step(src,reverse_direction(direction)), 5, 1) -//generates a list used to randomize transit animations so they aren't in lockstep -/turf/space/proc/get_cross_shift_list(var/size) - var/list/result = list() - - result += rand(0, 14) - for(var/i in 2 to size) - var/shifts = list(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14) - shifts -= result[i - 1] //consecutive shifts should not be equal - if(i == size) - shifts -= result[1] //because shift list is a ring buffer - result += pick(shifts) - - return result - /turf/space/is_space() return 1 @@ -97,8 +53,6 @@ return locate(/obj/structure/lattice, src) //counts as solid structure if it has a lattice /turf/space/proc/update_starlight() - if(!config.starlight) - return if(locate(/turf/simulated) in orange(src,1)) set_light(config.starlight) else diff --git a/code/game/turfs/space/transit.dm b/code/game/turfs/space/transit.dm index 8b9c7b2d35..5f19e691f2 100644 --- a/code/game/turfs/space/transit.dm +++ b/code/game/turfs/space/transit.dm @@ -13,12 +13,10 @@ icon_state = "arrow-north" pushdirection = SOUTH // south because the space tile is scrolling south -/turf/space/transit/north/New() - ..() - if(!phase_shift_by_x) - phase_shift_by_x = get_cross_shift_list(15) +/turf/space/transit/north/Initialize() + . = ..() - var/x_shift = phase_shift_by_x[src.x % (phase_shift_by_x.len - 1) + 1] + var/x_shift = SSskybox.phase_shift_by_x[src.x % (SSskybox.phase_shift_by_x.len - 1) + 1] var/transit_state = (world.maxy - src.y + x_shift)%15 + 1 icon_state = "speedspace_ns_[transit_state]" @@ -28,12 +26,10 @@ icon_state = "arrow-south" pushdirection = SOUTH // south because the space tile is scrolling south -/turf/space/transit/south/New() - ..() - if(!phase_shift_by_x) - phase_shift_by_x = get_cross_shift_list(15) +/turf/space/transit/south/Initialize() + . = ..() - var/x_shift = phase_shift_by_x[src.x % (phase_shift_by_x.len - 1) + 1] + var/x_shift = SSskybox.phase_shift_by_x[src.x % (SSskybox.phase_shift_by_x.len - 1) + 1] var/transit_state = (world.maxy - src.y + x_shift)%15 + 1 var/icon/I = new(icon, "speedspace_ns_[transit_state]") @@ -45,12 +41,10 @@ icon_state = "arrow-east" pushdirection = WEST -/turf/space/transit/east/New() - ..() - if(!phase_shift_by_y) - phase_shift_by_y = get_cross_shift_list(15) +/turf/space/transit/east/Initialize() + . = ..() - var/y_shift = phase_shift_by_y[src.y % (phase_shift_by_y.len - 1) + 1] + var/y_shift = SSskybox.phase_shift_by_y[src.y % (SSskybox.phase_shift_by_y.len - 1) + 1] var/transit_state = (world.maxx - src.x + y_shift)%15 + 1 icon_state = "speedspace_ew_[transit_state]" @@ -60,12 +54,10 @@ icon_state = "arrow-west" pushdirection = WEST -/turf/space/transit/west/New() - ..() - if(!phase_shift_by_y) - phase_shift_by_y = get_cross_shift_list(15) +/turf/space/transit/west/Initialize() + . = ..() - var/y_shift = phase_shift_by_y[src.y % (phase_shift_by_y.len - 1) + 1] + var/y_shift = SSskybox.phase_shift_by_y[src.y % (SSskybox.phase_shift_by_y.len - 1) + 1] var/transit_state = (world.maxx - src.x + y_shift)%15 + 1 var/icon/I = new(icon, "speedspace_ew_[transit_state]") diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index f46ff9501f..237fae8fa9 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -34,26 +34,22 @@ var/can_build_into_floor = FALSE // Used for things like RCDs (and maybe lattices/floor tiles in the future), to see if a floor should replace it. var/list/dangerous_objects // List of 'dangerous' objs that the turf holds that can cause something bad to happen when stepped on, used for AI mobs. -/turf/New() - ..() - for(var/atom/movable/AM as mob|obj in src) - spawn( 0 ) - src.Entered(AM) - return - turfs |= src - - if(dynamic_lighting) - luminosity = 0 - else - luminosity = 1 +/turf/Initialize(mapload) + . = ..() + for(var/atom/movable/AM in src) + Entered(AM) + //Lighting related + luminosity = !(dynamic_lighting) + has_opaque_atom = (opacity) + + //Pathfinding related if(movement_cost && pathweight == 1) // This updates pathweight automatically. pathweight = movement_cost /turf/Destroy() - turfs -= src + . = QDEL_HINT_IWILLGC ..() - return QDEL_HINT_IWILLGC /turf/ex_act(severity) return 0 diff --git a/code/game/turfs/unsimulated.dm b/code/game/turfs/unsimulated.dm index 894fac57b2..8f06fffe0a 100644 --- a/code/game/turfs/unsimulated.dm +++ b/code/game/turfs/unsimulated.dm @@ -11,8 +11,8 @@ icon_state = "0" dynamic_lighting = FALSE -/turf/unsimulated/fake_space/New() - ..() +/turf/unsimulated/fake_space/Initialize(mapload) + . = ..() icon_state = "[((x + y) ^ ~(x * y) + z) % 25]" //VOREStation Add End diff --git a/code/game/turfs/unsimulated/beach.dm b/code/game/turfs/unsimulated/beach.dm index 4638b15cab..0776984d0a 100644 --- a/code/game/turfs/unsimulated/beach.dm +++ b/code/game/turfs/unsimulated/beach.dm @@ -15,8 +15,8 @@ name = "Water" icon_state = "water" -/turf/unsimulated/beach/water/New() - ..() +/turf/unsimulated/beach/water/Initialize() + . = ..() add_overlay(image("icon"='icons/misc/beach.dmi',"icon_state"="water2","layer"=MOB_LAYER+0.1)) /turf/simulated/floor/beach @@ -54,6 +54,6 @@ /turf/simulated/floor/beach/water/ocean icon_state = "seadeep" -/turf/simulated/floor/beach/water/New() - ..() +/turf/simulated/floor/beach/water/Initialize() + . = ..() add_overlay(image("icon"='icons/misc/beach.dmi',"icon_state"="water5","layer"=MOB_LAYER+0.1)) diff --git a/code/game/turfs/unsimulated/planetary.dm b/code/game/turfs/unsimulated/planetary.dm index 35cd7aa4a8..a1ef0aadc9 100644 --- a/code/game/turfs/unsimulated/planetary.dm +++ b/code/game/turfs/unsimulated/planetary.dm @@ -17,8 +17,8 @@ phoron = 0 temperature = T20C -/turf/unsimulated/wall/planetary/New() - ..() +/turf/unsimulated/wall/planetary/Initialize() + . = ..() SSplanets.addTurf(src) /turf/unsimulated/wall/planetary/Destroy() diff --git a/code/modules/admin/verbs/adminjump.dm b/code/modules/admin/verbs/adminjump.dm index 8859439ce7..db948d08e6 100644 --- a/code/modules/admin/verbs/adminjump.dm +++ b/code/modules/admin/verbs/adminjump.dm @@ -21,7 +21,7 @@ else alert("Admin jumping disabled") -/client/proc/jumptoturf(var/turf/T in turfs) +/client/proc/jumptoturf(var/turf/T in world) set name = "Jump to Turf" set category = "Admin" if(!check_rights(R_ADMIN|R_MOD|R_DEBUG|R_EVENT)) diff --git a/code/modules/admin/verbs/atmosdebug.dm b/code/modules/admin/verbs/atmosdebug.dm index 653b62ddee..2f7d65db05 100644 --- a/code/modules/admin/verbs/atmosdebug.dm +++ b/code/modules/admin/verbs/atmosdebug.dm @@ -28,7 +28,7 @@ to_chat(usr, "Checking for overlapping pipes...") next_turf: - for(var/turf/T in turfs) + for(var/turf/T in world) for(var/dir in cardinal) var/list/connect_types = list(1 = 0, 2 = 0, 3 = 0) for(var/obj/machinery/atmospherics/pipe in T) diff --git a/code/modules/admin/verbs/grief_fixers.dm b/code/modules/admin/verbs/grief_fixers.dm index 00e5ee1e05..b8815876b2 100644 --- a/code/modules/admin/verbs/grief_fixers.dm +++ b/code/modules/admin/verbs/grief_fixers.dm @@ -38,7 +38,7 @@ unsorted_overlays |= gas_data.tile_overlay[id] - for(var/turf/simulated/T in turfs) + for(var/turf/simulated/T in world) T.air = null T.overlays.Remove(unsorted_overlays) T.zone = null diff --git a/code/modules/holodeck/HolodeckObjects.dm b/code/modules/holodeck/HolodeckObjects.dm index ca18f84d6f..7b923d8c53 100644 --- a/code/modules/holodeck/HolodeckObjects.dm +++ b/code/modules/holodeck/HolodeckObjects.dm @@ -67,7 +67,8 @@ name = "reinforced holofloor" icon_state = "reinforced" -/turf/simulated/floor/holofloor/space/New() +/turf/simulated/floor/holofloor/space/Initialize() + . = ..() icon_state = "[((x + y) ^ ~(x * y) + z) % 25]" /turf/simulated/floor/holofloor/beach diff --git a/code/modules/lighting/lighting_turf.dm b/code/modules/lighting/lighting_turf.dm index 743a0d8e2b..bc3c099091 100644 --- a/code/modules/lighting/lighting_turf.dm +++ b/code/modules/lighting/lighting_turf.dm @@ -9,12 +9,6 @@ var/tmp/list/datum/lighting_corner/corners var/tmp/has_opaque_atom = FALSE // Not to be confused with opacity, this will be TRUE if there's any opaque atom on the tile. -/turf/New() - . = ..() - - if(opacity) - has_opaque_atom = TRUE - // Causes any affecting light sources to be queued for a visibility update, for example a door got opened. /turf/proc/reconsider_lights() for(var/datum/light_source/L in affecting_lights) diff --git a/code/modules/mob/freelook/update_triggers.dm b/code/modules/mob/freelook/update_triggers.dm index 0b31e24cce..e6d1976fad 100644 --- a/code/modules/mob/freelook/update_triggers.dm +++ b/code/modules/mob/freelook/update_triggers.dm @@ -17,8 +17,8 @@ updateVisibility(src) return ..() -/turf/simulated/New() - ..() +/turf/simulated/Initialize() + . = ..() updateVisibility(src) diff --git a/code/modules/overmap/_defines.dm b/code/modules/overmap/_defines.dm index bf967eb3b9..6cfde46793 100644 --- a/code/modules/overmap/_defines.dm +++ b/code/modules/overmap/_defines.dm @@ -33,8 +33,8 @@ var/global/list/map_sectors = list() opacity = 1 density = 1 -/turf/unsimulated/map/New() - ..() +/turf/unsimulated/map/Initialize() + . = ..() name = "[x]-[y]" var/list/numbers = list() diff --git a/code/modules/random_map/automata/diona.dm b/code/modules/random_map/automata/diona.dm index e9e58a03a4..d6bee1c0ff 100644 --- a/code/modules/random_map/automata/diona.dm +++ b/code/modules/random_map/automata/diona.dm @@ -1,5 +1,5 @@ -/turf/simulated/wall/diona/New(var/newloc) - ..(newloc,"biomass") +/turf/simulated/wall/diona/Initialize(mapload) + ..(mapload, "biomass") /turf/simulated/wall/diona/attack_generic(var/mob/user, var/damage, var/attack_message) if(istype(user, /mob/living/carbon/alien/diona)) diff --git a/code/modules/turbolift/turbolift_turfs.dm b/code/modules/turbolift/turbolift_turfs.dm index 632160efaa..8949f71448 100644 --- a/code/modules/turbolift/turbolift_turfs.dm +++ b/code/modules/turbolift/turbolift_turfs.dm @@ -1,2 +1,2 @@ -/turf/simulated/wall/elevator/New(var/newloc) - ..(newloc,"elevatorium") +/turf/simulated/wall/elevator/Initialize(mapload) + ..(mapload, "elevatorium") diff --git a/maps/~map_system/maps.dm b/maps/~map_system/maps.dm index efd8667f62..c3dd9ba0f1 100644 --- a/maps/~map_system/maps.dm +++ b/maps/~map_system/maps.dm @@ -141,17 +141,6 @@ var/list/all_maps = list() /datum/map/proc/perform_map_generation() return -// Used to apply various post-compile procedural effects to the map. -/datum/map/proc/refresh_mining_turfs() - - set background = 1 - set waitfor = 0 - - // Update all turfs to ensure everything looks good post-generation. Yes, - // it's brute-forcey, but frankly the alternative is a mine turf rewrite. - for(var/turf/simulated/mineral/M in turfs) // Ugh. - M.update_icon() - /datum/map/proc/get_network_access(var/network) return 0