Merge pull request #6914 from VOREStation/aro-mapload

Speed up map load significantly
This commit is contained in:
Aronai Sieyes
2020-03-19 18:20:51 -04:00
committed by GitHub
42 changed files with 1337 additions and 1396 deletions

View File

@@ -29,6 +29,11 @@ var/global/defer_powernet_rebuild = 0 // True if net rebuild will be called
#define MAINT 0x8 // Under maintenance.
#define EMPED 0x10 // Temporary broken by EMP pulse.
// Remote control states
#define RCON_NO 1
#define RCON_AUTO 2
#define RCON_YES 3
// Used by firelocks
#define FIREDOOR_OPEN 1
#define FIREDOOR_CLOSED 2

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -8,9 +8,9 @@ SUBSYSTEM_DEF(atoms)
init_order = INIT_ORDER_ATOMS
flags = SS_NO_FIRE
var/initialized = INITIALIZATION_INSSATOMS
var/static/initialized = INITIALIZATION_INSSATOMS
// var/list/created_atoms // This is never used, so don't bother. ~Leshana
var/old_initialized
var/static/old_initialized
var/list/late_loaders
var/list/created_atoms

View File

@@ -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()

View File

@@ -25,8 +25,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()
loadEngine()
preloadShelterTemplates()

View File

@@ -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()
. = ..()

View File

@@ -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

View File

@@ -43,24 +43,17 @@
var/uid
/area/New()
icon_state = ""
uid = ++global_uid
all_areas += src
if(!requires_power)
power_light = 0
power_equip = 0
power_environ = 0
if(dynamic_lighting)
luminosity = 0
else
luminosity = 1
all_areas += src //Replace with /area in world? Byond optimizes X in world loops.
..()
/area/Initialize()
. = ..()
luminosity = !(dynamic_lighting)
icon_state = ""
return INITIALIZE_HINT_LATELOAD // Areas tradiationally are initialized AFTER other atoms.
/area/LateInitialize()

View File

@@ -41,8 +41,7 @@
_preloader.load(src)
// Pass our arguments to InitAtom so they can be passed to initialize(), but replace 1st with if-we're-during-mapload.
var/do_initialize = SSatoms && SSatoms.initialized // Workaround our non-ideal initialization order: SSatoms may not exist yet.
//var/do_initialize = SSatoms.initialized
var/do_initialize = SSatoms.initialized
if(do_initialize > INITIALIZATION_INSSATOMS)
args[1] = (do_initialize == INITIALIZATION_INNEW_MAPLOAD)
if(SSatoms.InitAtom(src, args))

View File

@@ -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)

View File

@@ -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

View File

@@ -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()

View File

@@ -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

View File

@@ -0,0 +1,324 @@
/*
FIRE ALARM
*/
/obj/machinery/firealarm
name = "fire alarm"
desc = "<i>\"Pull this in case of emergency\"</i>. Thus, keep pulling it forever."
icon = 'icons/obj/monitors.dmi'
icon_state = "fire0"
plane = TURF_PLANE
layer = ABOVE_TURF_LAYER
var/detecting = 1.0
var/working = 1.0
var/time = 10.0
var/timing = 0.0
var/lockdownbyai = 0
anchored = 1.0
use_power = 1
idle_power_usage = 2
active_power_usage = 6
power_channel = ENVIRON
var/last_process = 0
panel_open = 0
var/seclevel
circuit = /obj/item/weapon/circuitboard/firealarm
var/alarms_hidden = FALSE //If the alarms from this machine are visible on consoles
/obj/machinery/firealarm/alarms_hidden
alarms_hidden = TRUE
/obj/machinery/firealarm/Initialize()
. = ..()
if(z in using_map.contact_levels)
set_security_level(security_level ? get_security_level() : "green")
/obj/machinery/firealarm/update_icon()
cut_overlays()
if(panel_open)
set_light(0)
return
if(stat & BROKEN)
icon_state = "firex"
set_light(0)
else if(stat & NOPOWER)
icon_state = "firep"
set_light(0)
else
if(!detecting)
icon_state = "fire1"
set_light(l_range = 4, l_power = 0.9, l_color = "#ff0000")
else
icon_state = "fire0"
switch(seclevel)
if("green") set_light(l_range = 2, l_power = 0.25, l_color = "#00ff00")
if("yellow") set_light(l_range = 2, l_power = 0.25, l_color = "#ffff00")
if("violet") set_light(l_range = 2, l_power = 0.25, l_color = "#9933ff")
if("orange") set_light(l_range = 2, l_power = 0.25, l_color = "#ff9900")
if("blue") set_light(l_range = 2, l_power = 0.25, l_color = "#1024A9")
if("red") set_light(l_range = 4, l_power = 0.9, l_color = "#ff0000")
if("delta") set_light(l_range = 4, l_power = 0.9, l_color = "#FF6633")
add_overlay("overlay_[seclevel]")
/obj/machinery/firealarm/fire_act(datum/gas_mixture/air, temperature, volume)
if(detecting)
if(temperature > T0C + 200)
alarm() // added check of detector status here
return
/obj/machinery/firealarm/attack_ai(mob/user as mob)
return attack_hand(user)
/obj/machinery/firealarm/bullet_act()
return alarm()
/obj/machinery/firealarm/emp_act(severity)
if(prob(50 / severity))
alarm(rand(30 / severity, 60 / severity))
..()
/obj/machinery/firealarm/attackby(obj/item/W as obj, mob/user as mob)
add_fingerprint(user)
if(alarm_deconstruction_screwdriver(user, W))
return
if(alarm_deconstruction_wirecutters(user, W))
return
if(panel_open)
if(istype(W, /obj/item/device/multitool))
detecting = !(detecting)
if(detecting)
user.visible_message("<span class='notice'>\The [user] has reconnected [src]'s detecting unit!</span>", "<span class='notice'>You have reconnected [src]'s detecting unit.</span>")
else
user.visible_message("<span class='notice'>\The [user] has disconnected [src]'s detecting unit!</span>", "<span class='notice'>You have disconnected [src]'s detecting unit.</span>")
return
alarm()
return
/obj/machinery/firealarm/process()//Note: this processing was mostly phased out due to other code, and only runs when needed
if(stat & (NOPOWER|BROKEN))
return
if(timing)
if(time > 0)
time = time - ((world.timeofday - last_process) / 10)
else
alarm()
time = 0
timing = 0
STOP_PROCESSING(SSobj, src)
updateDialog()
last_process = world.timeofday
if(locate(/obj/fire) in src.loc)
alarm()
return
/obj/machinery/firealarm/power_change()
..()
spawn(rand(0,15))
update_icon()
/obj/machinery/firealarm/attack_hand(mob/user as mob)
if(user.stat || stat & (NOPOWER | BROKEN))
return
user.set_machine(src)
var/area/A = src.loc
var/d1
var/d2
if(istype(user, /mob/living/carbon/human) || istype(user, /mob/living/silicon))
A = A.loc
if(A.fire)
d1 = text("<A href='?src=\ref[];reset=1'>Reset - Lockdown</A>", src)
else
d1 = text("<A href='?src=\ref[];alarm=1'>Alarm - Lockdown</A>", src)
if(timing)
d2 = text("<A href='?src=\ref[];time=0'>Stop Time Lock</A>", src)
else
d2 = text("<A href='?src=\ref[];time=1'>Initiate Time Lock</A>", src)
var/second = round(time) % 60
var/minute = (round(time) - second) / 60
var/dat = "<HTML><HEAD></HEAD><BODY><TT><B>Fire alarm</B> [d1]\n<HR>The current alert level is: <b>[get_security_level()]</b><br><br>\nTimer System: [d2]<BR>\nTime Left: [(minute ? "[minute]:" : null)][second] <A href='?src=\ref[src];tp=-30'>-</A> <A href='?src=\ref[src];tp=-1'>-</A> <A href='?src=\ref[src];tp=1'>+</A> <A href='?src=\ref[src];tp=30'>+</A>\n</TT></BODY></HTML>"
user << browse(dat, "window=firealarm")
onclose(user, "firealarm")
else
A = A.loc
if(A.fire)
d1 = text("<A href='?src=\ref[];reset=1'>[]</A>", src, stars("Reset - Lockdown"))
else
d1 = text("<A href='?src=\ref[];alarm=1'>[]</A>", src, stars("Alarm - Lockdown"))
if(timing)
d2 = text("<A href='?src=\ref[];time=0'>[]</A>", src, stars("Stop Time Lock"))
else
d2 = text("<A href='?src=\ref[];time=1'>[]</A>", src, stars("Initiate Time Lock"))
var/second = round(time) % 60
var/minute = (round(time) - second) / 60
var/dat = "<HTML><HEAD></HEAD><BODY><TT><B>[stars("Fire alarm")]</B> [d1]\n<HR><b>The current alert level is: [stars(get_security_level())]</b><br><br>\nTimer System: [d2]<BR>\nTime Left: [(minute ? text("[]:", minute) : null)][second] <A href='?src=\ref[src];tp=-30'>-</A> <A href='?src=\ref[src];tp=-1'>-</A> <A href='?src=\ref[src];tp=1'>+</A> <A href='?src=\ref[src];tp=30'>+</A>\n</TT></BODY></HTML>"
user << browse(dat, "window=firealarm")
onclose(user, "firealarm")
return
/obj/machinery/firealarm/Topic(href, href_list)
..()
if(usr.stat || stat & (BROKEN | NOPOWER))
return
if((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
usr.set_machine(src)
if(href_list["reset"])
reset()
else if(href_list["alarm"])
alarm()
else if(href_list["time"])
timing = text2num(href_list["time"])
last_process = world.timeofday
START_PROCESSING(SSobj, src)
else if(href_list["tp"])
var/tp = text2num(href_list["tp"])
time += tp
time = min(max(round(time), 0), 120)
updateUsrDialog()
add_fingerprint(usr)
else
usr << browse(null, "window=firealarm")
return
return
/obj/machinery/firealarm/proc/reset()
if(!(working))
return
var/area/area = get_area(src)
for(var/obj/machinery/firealarm/FA in area)
fire_alarm.clearAlarm(src.loc, FA)
update_icon()
return
/obj/machinery/firealarm/proc/alarm(var/duration = 0)
if(!(working))
return
var/area/area = get_area(src)
for(var/obj/machinery/firealarm/FA in area)
fire_alarm.triggerAlarm(loc, FA, duration, hidden = alarms_hidden)
update_icon()
playsound(src.loc, 'sound/machines/airalarm.ogg', 25, 0, 4)
return
/obj/machinery/firealarm/proc/set_security_level(var/newlevel)
if(seclevel != newlevel)
seclevel = newlevel
update_icon()
/*
FIRE ALARM CIRCUIT
Just a object used in constructing fire alarms
/obj/item/weapon/firealarm_electronics
name = "fire alarm electronics"
icon = 'icons/obj/doors/door_assembly.dmi'
icon_state = "door_electronics"
desc = "A circuit. It has a label on it, it says \"Can handle heat levels up to 40 degrees celsius!\""
w_class = ITEMSIZE_SMALL
matter = list(DEFAULT_WALL_MATERIAL = 50, "glass" = 50)
*/
/obj/machinery/partyalarm
name = "\improper PARTY BUTTON"
desc = "Cuban Pete is in the house!"
icon = 'icons/obj/monitors.dmi'
icon_state = "fire0"
var/detecting = 1.0
var/working = 1.0
var/time = 10.0
var/timing = 0.0
var/lockdownbyai = 0
anchored = 1.0
use_power = 1
idle_power_usage = 2
active_power_usage = 6
/obj/machinery/partyalarm/attack_hand(mob/user as mob)
if(user.stat || stat & (NOPOWER|BROKEN))
return
user.machine = src
var/area/A = get_area(src)
ASSERT(isarea(A))
var/d1
var/d2
if(istype(user, /mob/living/carbon/human) || istype(user, /mob/living/silicon/ai))
if(A.party)
d1 = text("<A href='?src=\ref[];reset=1'>No Party :(</A>", src)
else
d1 = text("<A href='?src=\ref[];alarm=1'>PARTY!!!</A>", src)
if(timing)
d2 = text("<A href='?src=\ref[];time=0'>Stop Time Lock</A>", src)
else
d2 = text("<A href='?src=\ref[];time=1'>Initiate Time Lock</A>", src)
var/second = time % 60
var/minute = (time - second) / 60
var/dat = text("<HTML><HEAD></HEAD><BODY><TT><B>Party Button</B> []\n<HR>\nTimer System: []<BR>\nTime Left: [][] <A href='?src=\ref[];tp=-30'>-</A> <A href='?src=\ref[];tp=-1'>-</A> <A href='?src=\ref[];tp=1'>+</A> <A href='?src=\ref[];tp=30'>+</A>\n</TT></BODY></HTML>", d1, d2, (minute ? text("[]:", minute) : null), second, src, src, src, src)
user << browse(dat, "window=partyalarm")
onclose(user, "partyalarm")
else
if(A.fire)
d1 = text("<A href='?src=\ref[];reset=1'>[]</A>", src, stars("No Party :("))
else
d1 = text("<A href='?src=\ref[];alarm=1'>[]</A>", src, stars("PARTY!!!"))
if(timing)
d2 = text("<A href='?src=\ref[];time=0'>[]</A>", src, stars("Stop Time Lock"))
else
d2 = text("<A href='?src=\ref[];time=1'>[]</A>", src, stars("Initiate Time Lock"))
var/second = time % 60
var/minute = (time - second) / 60
var/dat = text("<HTML><HEAD></HEAD><BODY><TT><B>[]</B> []\n<HR>\nTimer System: []<BR>\nTime Left: [][] <A href='?src=\ref[];tp=-30'>-</A> <A href='?src=\ref[];tp=-1'>-</A> <A href='?src=\ref[];tp=1'>+</A> <A href='?src=\ref[];tp=30'>+</A>\n</TT></BODY></HTML>", stars("Party Button"), d1, d2, (minute ? text("[]:", minute) : null), second, src, src, src, src)
user << browse(dat, "window=partyalarm")
onclose(user, "partyalarm")
return
/obj/machinery/partyalarm/proc/reset()
if(!(working))
return
var/area/A = get_area(src)
ASSERT(isarea(A))
A.partyreset()
return
/obj/machinery/partyalarm/proc/alarm()
if(!(working))
return
var/area/A = get_area(src)
ASSERT(isarea(A))
A.partyalert()
return
/obj/machinery/partyalarm/Topic(href, href_list)
..()
if(usr.stat || stat & (BROKEN|NOPOWER))
return
if((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon/ai)))
usr.machine = src
if(href_list["reset"])
reset()
else if(href_list["alarm"])
alarm()
else if(href_list["time"])
timing = text2num(href_list["time"])
else if(href_list["tp"])
var/tp = text2num(href_list["tp"])
time += tp
time = min(max(round(time), 0), 120)
updateUsrDialog()
add_fingerprint(usr)
else
usr << browse(null, "window=partyalarm")
return
return

View File

@@ -55,8 +55,8 @@
B.clean_blood()
..()
/turf/simulated/New()
..()
/turf/simulated/Initialize(mapload)
. = ..()
if(istype(loc, /area/chapel))
holy = 1
levelupdate()

View File

@@ -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)

View File

@@ -35,12 +35,12 @@
/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)
set_flooring(get_flooring_data(floortype))
set_flooring(get_flooring_data(floortype), TRUE)
else
footstep_sounds = base_footstep_sounds
if(can_dirty && can_start_dirty)
@@ -48,29 +48,24 @@
dirt += rand(50,100)
update_dirt() //5% chance to start with dirt on a floor tile- give the janitor something to do
/turf/simulated/floor/proc/set_flooring(var/decl/flooring/newflooring)
/turf/simulated/floor/proc/swap_decals()
var/current_decals = decals
decals = old_decals
old_decals = current_decals
/turf/simulated/floor/proc/set_flooring(var/decl/flooring/newflooring, var/initializing)
make_plating(defer_icon_update = 1)
if(!flooring && !initializing) // Plating -> Flooring
swap_decals()
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
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 +73,8 @@
icon_state = base_icon_state
footstep_sounds = base_footstep_sounds
if(flooring)
if(flooring) // Flooring -> Plating
swap_decals()
if(flooring.build_type && place_product)
new flooring.build_type(src)
flooring = null

View File

@@ -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()

View File

@@ -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)

View File

@@ -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

View File

@@ -35,8 +35,8 @@
/turf/simulated/flesh/attackby()
return
/turf/simulated/flesh/New()
..()
/turf/simulated/flesh/Initialize(mapload)
. = ..()
update_icon(1)
var/list/flesh_overlay_cache = list()

View File

@@ -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

View File

@@ -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

View File

@@ -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]")

View File

@@ -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

View File

@@ -10,9 +10,10 @@
icon = 'icons/turf/space.dmi'
icon_state = "0"
dynamic_lighting = FALSE
initialized = FALSE
/turf/unsimulated/fake_space/New()
..()
/turf/unsimulated/fake_space/Initialize(mapload)
. = ..()
icon_state = "[((x + y) ^ ~(x * y) + z) % 25]"
//VOREStation Add End

View File

@@ -14,9 +14,10 @@
/turf/unsimulated/beach/water
name = "Water"
icon_state = "water"
initialized = FALSE
/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 +55,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))

View File

@@ -9,6 +9,7 @@
density = 1
alpha = 0
blocks_air = 0
initialized = FALSE
// Set these to get your desired planetary atmosphere.
oxygen = 0
@@ -17,8 +18,8 @@
phoron = 0
temperature = T20C
/turf/unsimulated/wall/planetary/New()
..()
/turf/unsimulated/wall/planetary/Initialize()
. = ..()
SSplanets.addTurf(src)
/turf/unsimulated/wall/planetary/Destroy()

View File

@@ -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))

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -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)

View File

@@ -17,8 +17,8 @@
updateVisibility(src)
return ..()
/turf/simulated/New()
..()
/turf/simulated/Initialize()
. = ..()
updateVisibility(src)

View File

@@ -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()

View File

@@ -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))

View File

@@ -1,2 +1,2 @@
/turf/simulated/wall/elevator/New(var/newloc)
..(newloc,"elevatorium")
/turf/simulated/wall/elevator/Initialize(mapload)
..(mapload, "elevatorium")