Merge branch 'master' of https://github.com/PolarisSS13/Polaris into virologyfixes

This commit is contained in:
Cerebulon
2018-02-07 03:40:06 +00:00
191 changed files with 2301 additions and 996 deletions
@@ -194,7 +194,7 @@
return 1
/obj/machinery/atmospherics/binary/dp_vent_pump/initialize()
..()
. = ..()
if(frequency)
set_frequency(frequency)
@@ -128,7 +128,7 @@
return 1
/obj/machinery/atmospherics/binary/passive_gate/initialize()
..()
. = ..()
if(frequency)
set_frequency(frequency)
@@ -148,7 +148,7 @@ Thus, the two variables affect pump operation are set in New():
ui.set_auto_update(1) // auto update every Master Controller tick
/obj/machinery/atmospherics/binary/pump/initialize()
..()
. = ..()
if(frequency)
set_frequency(frequency)
@@ -129,8 +129,9 @@
return 1
/obj/machinery/atmospherics/trinary/atmos_filter/initialize()
set_frequency(frequency)
..()
. = ..()
if(frequency)
set_frequency(frequency)
/obj/machinery/atmospherics/trinary/atmos_filter/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
if (!istype(W, /obj/item/weapon/wrench))
+2 -2
View File
@@ -318,7 +318,7 @@
/obj/machinery/atmospherics/tvalve/digital/initialize()
..()
. = ..()
if(frequency)
set_frequency(frequency)
@@ -458,7 +458,7 @@
radio_connection = radio_controller.add_object(src, frequency, RADIO_ATMOSIA)
/obj/machinery/atmospherics/tvalve/mirrored/digital/initialize()
..()
. = ..()
if(frequency)
set_frequency(frequency)
@@ -123,9 +123,9 @@
return 1
/obj/machinery/atmospherics/unary/outlet_injector/initialize()
..()
set_frequency(frequency)
. = ..()
if(frequency)
set_frequency(frequency)
/obj/machinery/atmospherics/unary/outlet_injector/receive_signal(datum/signal/signal)
if(!signal.data["tag"] || (signal.data["tag"] != id) || (signal.data["sigtype"]!="command"))
+1 -1
View File
@@ -266,7 +266,7 @@
radio_connection = radio_controller.add_object(src, frequency, RADIO_ATMOSIA)
/obj/machinery/atmospherics/valve/digital/initialize()
..()
. = ..()
if(frequency)
set_frequency(frequency)
+4
View File
@@ -0,0 +1,4 @@
#define GLOBAL_PROC "some_magic_bullshit"
#define CALLBACK new /datum/callback
#define INVOKE_ASYNC world.ImmediateInvokeAsync
+1
View File
@@ -18,5 +18,6 @@
#define GC_QUEUED_FOR_HARD_DEL -2
#define GC_CURRENTLY_BEING_QDELETED -3
#define QDELING(X) (X.gc_destroyed)
#define QDELETED(X) (!X || X.gc_destroyed)
#define QDESTROYING(X) (!X || X.gc_destroyed == GC_CURRENTLY_BEING_QDELETED)
+12
View File
@@ -1,4 +1,12 @@
#define INITIALIZATION_INSSATOMS 0 //New should not call Initialize
#define INITIALIZATION_INNEW_MAPLOAD 1 //New should call Initialize(TRUE)
#define INITIALIZATION_INNEW_REGULAR 2 //New should call Initialize(FALSE)
#define INITIALIZE_HINT_NORMAL 0 //Nothing happens
#define INITIALIZE_HINT_LATELOAD 1 //Call LateInitialize
#define INITIALIZE_HINT_QDEL 2 //Call qdel on the atom
// SS runlevels
#define RUNLEVEL_INIT 0 // "Initialize Only" - Used for subsystems that should never be fired (Should also have SS_NO_FIRE set)
@@ -15,6 +23,10 @@ var/global/list/runlevel_flags = list(RUNLEVEL_LOBBY, RUNLEVEL_SETUP, RUNLEVEL_G
// Subsystem init_order, from highest priority to lowest priority
// Subsystems shutdown in the reverse of the order they initialize in
// The numbers just define the ordering, they are meaningless otherwise.
#define INIT_ORDER_DECALS 16
#define INIT_ORDER_ATOMS 15
#define INIT_ORDER_MACHINES 10
#define INIT_ORDER_SHUTTLES 3
#define INIT_ORDER_LIGHTING 0
#define INIT_ORDER_AIR -1
#define INIT_ORDER_XENOARCH -20
-9
View File
@@ -1,9 +0,0 @@
/datum/controller/process/Shuttle/setup()
name = "shuttle controller"
schedule_interval = 20 // every 2 seconds
if(!shuttle_controller)
shuttle_controller = new
/datum/controller/process/Shuttle/doWork()
shuttle_controller.process()
+26 -4
View File
@@ -7,8 +7,30 @@
for(last_object in clients)
var/client/C = last_object
if(C.is_afk(config.kick_inactive MINUTES))
if(!istype(C.mob, /mob/observer/dead))
log_access("AFK: [key_name(C)]")
C << "<SPAN CLASS='warning'>You have been inactive for more than [config.kick_inactive] minute\s and have been disconnected.</SPAN>"
del(C) // Don't qdel, cannot override finalize_qdel behaviour for clients.
if(!istype(C.mob, /mob/observer/dead) && !istype(C.mob, /mob/new_player))
to_chat(C,"<span class='warning'>You have been inactive for more than [config.kick_inactive] minute\s and have been disconnected.</span>")
var/information
if(ishuman(C.mob))
var/job
var/mob/living/carbon/human/H = C.mob
var/datum/data/record/R = find_general_record("name", H.real_name)
if(R)
job = R.fields["real_rank"]
if(!job && H.mind)
job = H.mind.assigned_role
if(!job && H.job)
job = H.job
if(job)
information = " while [job]."
else if(issilicon(C.mob))
information = " while a silicon."
var/adminlinks
adminlinks = " (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[C.mob.x];Y=[C.mob.y];Z=[C.mob.z]'>JMP</a>|<A HREF='?_src_=holder;cryoplayer=\ref[C.mob]'>CRYO</a>)"
log_and_message_admins("being kicked for AFK[information][adminlinks]", C.mob)
qdel(C)
SCHECK
+12 -10
View File
@@ -36,22 +36,22 @@ datum/controller/game_controller/New()
datum/controller/game_controller/proc/setup()
setup_objects()
setupgenetics()
SetupXenoarch()
// setupgenetics() Moved to SSatoms
// SetupXenoarch() - Moved to SSxenoarch
transfer_controller = new
admin_notice("<span class='danger'>Initializations complete.</span>", R_DEBUG)
#if UNIT_TEST
#define CHECK_SLEEP_MASTER // For unit tests we don't care about a smooth lobby screen experience. We care about speed.
#else
#define CHECK_SLEEP_MASTER if(++initialized_objects > 500) { initialized_objects=0;sleep(world.tick_lag); }
#endif
// #if UNIT_TEST
// #define CHECK_SLEEP_MASTER // For unit tests we don't care about a smooth lobby screen experience. We care about speed.
// #else
// #define CHECK_SLEEP_MASTER if(++initialized_objects > 500) { initialized_objects=0;sleep(world.tick_lag); }
// #endif
datum/controller/game_controller/proc/setup_objects()
#if !UNIT_TEST
var/initialized_objects = 0
#endif
// #if !UNIT_TEST
// var/initialized_objects = 0
// #endif
// Set up antagonists.
populate_antag_type_list()
@@ -59,6 +59,7 @@ datum/controller/game_controller/proc/setup_objects()
//Set up spawn points.
populate_spawn_points()
/*
admin_notice("<span class='danger'>Initializing Floor Decals</span>", R_DEBUG)
var/list/turfs_with_decals = list()
for(var/obj/effect/floor_decal/D in world)
@@ -111,3 +112,4 @@ datum/controller/game_controller/proc/setup_objects()
if(!QDELETED(lift))
lift.initialize()
CHECK_SLEEP_MASTER
*/
-39
View File
@@ -1,39 +0,0 @@
var/global/datum/shuttle_controller/shuttle_controller
/datum/shuttle_controller
var/list/shuttles //maps shuttle tags to shuttle datums, so that they can be looked up.
var/list/process_shuttles //simple list of shuttles, for processing
/datum/shuttle_controller/proc/process()
//process ferry shuttles
for (var/datum/shuttle/shuttle in process_shuttles)
if(istype(shuttle, /datum/shuttle/ferry))
var/datum/shuttle/ferry/F = shuttle
if(F.process_state || F.always_process)
F.process()
else
shuttle.process()
//This is called by gameticker after all the machines and radio frequencies have been properly initialized
/datum/shuttle_controller/proc/setup_shuttle_docks()
// for(var/shuttle_tag in shuttles)
// var/datum/shuttle/shuttle = shuttles[shuttle_tag]
for(var/shuttle_type in subtypesof(/datum/shuttle))
var/datum/shuttle/shuttle = shuttle_type
if(initial(shuttle.category) == shuttle_type)
continue
shuttle = new shuttle()
shuttle.init_docking_controllers()
shuttle.dock() //makes all shuttles docked to something at round start go into the docked state
for(var/obj/machinery/embedded_controller/C in machines)
if(istype(C.program, /datum/computer/file/embedded_program/docking))
C.program.tag = null //clear the tags, 'cause we don't need 'em anymore
/datum/shuttle_controller/New()
shuttles = list()
process_shuttles = list()
+1 -1
View File
@@ -166,7 +166,7 @@
if(can_fire && !(SS_NO_FIRE in flags))
if(can_fire && !(SS_NO_FIRE & flags))
msg = "[round(cost,1)]ms|[round(tick_usage,1)]%|[round(ticks,0.1)]\t[msg]"
else
msg = "OFFLINE\t[msg]"
+145
View File
@@ -0,0 +1,145 @@
#define BAD_INIT_QDEL_BEFORE 1
#define BAD_INIT_DIDNT_INIT 2
#define BAD_INIT_SLEPT 4
#define BAD_INIT_NO_HINT 8
SUBSYSTEM_DEF(atoms)
name = "Atoms"
init_order = INIT_ORDER_ATOMS
flags = SS_NO_FIRE
var/initialized = INITIALIZATION_INSSATOMS
// var/list/created_atoms // This is never used, so don't bother. ~Leshana
var/old_initialized
var/list/late_loaders
var/list/created_atoms
var/list/BadInitializeCalls = list()
/datum/controller/subsystem/atoms/Initialize(timeofday)
setupgenetics() //to set the mutations' place in structural enzymes, so initializers know where to put mutations.
initialized = INITIALIZATION_INNEW_MAPLOAD
to_world_log("Initializing objects")
admin_notice("<span class='danger'>Initializing objects</span>", R_DEBUG)
InitializeAtoms()
return ..()
/datum/controller/subsystem/atoms/proc/InitializeAtoms(list/atoms)
if(initialized == INITIALIZATION_INSSATOMS)
return
initialized = INITIALIZATION_INNEW_MAPLOAD
LAZYINITLIST(late_loaders)
var/count
var/list/mapload_arg = list(TRUE)
if(atoms)
created_atoms = list()
count = atoms.len
for(var/I in atoms)
var/atom/A = I
if(!A.initialized)
if(InitAtom(I, mapload_arg))
atoms -= I
CHECK_TICK
else
count = 0
for(var/atom/A in world)
if(!A.initialized)
InitAtom(A, mapload_arg)
++count
CHECK_TICK
log_world("Initialized [count] atoms")
initialized = INITIALIZATION_INNEW_REGULAR
if(late_loaders.len)
for(var/I in late_loaders)
var/atom/A = I
A.LateInitialize()
CHECK_TICK
testing("Late initialized [late_loaders.len] atoms")
late_loaders.Cut()
// Nothing ever checks return value of this proc, so don't bother. If this ever changes fix code in /atom/New() ~Leshana
// if(atoms)
// . = created_atoms + atoms
// created_atoms = null
/datum/controller/subsystem/atoms/proc/InitAtom(atom/A, list/arguments)
var/the_type = A.type
if(QDELING(A))
BadInitializeCalls[the_type] |= BAD_INIT_QDEL_BEFORE
return TRUE
var/start_tick = world.time
var/result = A.initialize(arglist(arguments))
if(start_tick != world.time)
BadInitializeCalls[the_type] |= BAD_INIT_SLEPT
var/qdeleted = FALSE
if(result != INITIALIZE_HINT_NORMAL)
switch(result)
if(INITIALIZE_HINT_LATELOAD)
if(arguments[1]) //mapload
late_loaders += A
else
A.LateInitialize()
if(INITIALIZE_HINT_QDEL)
qdel(A)
qdeleted = TRUE
else
BadInitializeCalls[the_type] |= BAD_INIT_NO_HINT
if(!A) //possible harddel
qdeleted = TRUE
else if(!A.initialized)
BadInitializeCalls[the_type] |= BAD_INIT_DIDNT_INIT
return qdeleted || QDELING(A)
/datum/controller/subsystem/atoms/proc/map_loader_begin()
old_initialized = initialized
initialized = INITIALIZATION_INSSATOMS
/datum/controller/subsystem/atoms/proc/map_loader_stop()
initialized = old_initialized
/datum/controller/subsystem/atoms/Recover()
initialized = SSatoms.initialized
if(initialized == INITIALIZATION_INNEW_MAPLOAD)
InitializeAtoms()
old_initialized = SSatoms.old_initialized
BadInitializeCalls = SSatoms.BadInitializeCalls
/datum/controller/subsystem/atoms/proc/InitLog()
. = ""
for(var/path in BadInitializeCalls)
. += "Path : [path] \n"
var/fails = BadInitializeCalls[path]
if(fails & BAD_INIT_DIDNT_INIT)
. += "- Didn't call atom/Initialize()\n"
if(fails & BAD_INIT_NO_HINT)
. += "- Didn't return an Initialize hint\n"
if(fails & BAD_INIT_QDEL_BEFORE)
. += "- Qdel'd in New()\n"
if(fails & BAD_INIT_SLEPT)
. += "- Slept during Initialize()\n"
/datum/controller/subsystem/atoms/Shutdown()
var/initlog = InitLog()
if(initlog)
//text2file(initlog, "[GLOB.log_directory]/initialize.log")
var/date_string = time2text(world.realtime, "YYYY/MM-Month/DD-Day")
text2file(initlog, "data/logs/[date_string]-initialize.log")
#undef BAD_INIT_QDEL_BEFORE
#undef BAD_INIT_DIDNT_INIT
#undef BAD_INIT_SLEPT
#undef BAD_INIT_NO_HINT
@@ -0,0 +1,28 @@
//
// Floor Decals Initialization Subsystem
// This is part of the giant decal hack that works around a BYOND bug where DreamDaemon will crash if you
// update overlays on turfs too much.
// The master_controller on Polaris used to init decals prior to initializing areas (which initilized turfs)
// Now that we switched to subsystems we still want to do the same thing, so this takes care of it.
//
SUBSYSTEM_DEF(floor_decals)
name = "Floor Decals"
init_order = INIT_ORDER_DECALS
flags = SS_NO_FIRE
/datum/controller/subsystem/floor_decals/Initialize(timeofday)
if(floor_decals_initialized)
return ..()
to_world_log("Initializing Floor Decals")
admin_notice("<span class='danger'>Initializing Floor Decals</span>", R_DEBUG)
var/list/turfs_with_decals = list()
for(var/obj/effect/floor_decal/D in world)
var/T = D.add_to_turf_decals()
if(T) turfs_with_decals |= T
CHECK_TICK
for(var/item in turfs_with_decals)
var/turf/T = item
if(T.decals) T.apply_decals()
CHECK_TICK
floor_decals_initialized = TRUE
return ..()
+24 -3
View File
@@ -33,8 +33,9 @@ SUBSYSTEM_DEF(machines)
var/list/current_run = list()
/datum/controller/subsystem/machines/Initialize(timeofday)
SSmachines.makepowernets()
// TODO - Move world-creation time setup of atmos machinery and pipenets to here
makepowernets()
admin_notice("<span class='danger'>Initializing atmos machinery.</span>", R_DEBUG)
setup_atmos_machinery(global.machines)
fire()
..()
@@ -53,13 +54,33 @@ SUBSYSTEM_DEF(machines)
for(var/datum/powernet/PN in powernets)
qdel(PN)
powernets.Cut()
setup_powernets_for_cables(cable_list)
for(var/obj/structure/cable/PC in cable_list)
/datum/controller/subsystem/machines/proc/setup_powernets_for_cables(list/cables)
for(var/obj/structure/cable/PC in cables)
if(!PC.powernet)
var/datum/powernet/NewPN = new()
NewPN.add_cable(PC)
propagate_network(PC,PC.powernet)
/datum/controller/subsystem/machines/proc/setup_atmos_machinery(list/atmos_machines)
for(var/obj/machinery/atmospherics/machine in atmos_machines)
machine.atmos_init()
CHECK_TICK
for(var/obj/machinery/atmospherics/machine in atmos_machines)
machine.build_network()
CHECK_TICK
for(var/obj/machinery/atmospherics/unary/U in atmos_machines)
if(istype(U, /obj/machinery/atmospherics/unary/vent_pump))
var/obj/machinery/atmospherics/unary/vent_pump/T = U
T.broadcast_status()
else if(istype(U, /obj/machinery/atmospherics/unary/vent_scrubber))
var/obj/machinery/atmospherics/unary/vent_scrubber/T = U
T.broadcast_status()
CHECK_TICK
/datum/controller/subsystem/machines/stat_entry()
var/msg = list()
msg += "C:{"
+83
View File
@@ -0,0 +1,83 @@
//
// SSshuttles subsystem - Handles initialization and processing of shuttles.
//
// This global variable exists for legacy support so we don't have to rename every shuttle_controller to SSshuttles yet.
var/global/datum/controller/subsystem/shuttles/shuttle_controller
SUBSYSTEM_DEF(shuttles)
name = "Shuttles"
wait = 2 SECONDS
priority = 5
init_order = INIT_ORDER_SHUTTLES
flags = SS_KEEP_TIMING|SS_NO_TICK_CHECK
runlevels = RUNLEVEL_GAME|RUNLEVEL_POSTGAME
var/list/shuttles = list() // Maps shuttle tags to shuttle datums, so that they can be looked up.
var/list/process_shuttles = list() // Simple list of shuttles, for processing
var/list/current_run = list() // Shuttles remaining to process this fire() tick
var/list/docks_init_callbacks // List of callbacks to run when we finish setting up shuttle docks.
var/docks_initialized = FALSE
/datum/controller/subsystem/shuttles/Initialize(timeofday)
global.shuttle_controller = src
setup_shuttle_docks()
for(var/I in docks_init_callbacks)
var/datum/callback/cb = I
cb.InvokeAsync()
LAZYCLEARLIST(docks_init_callbacks)
docks_init_callbacks = null
return ..()
/datum/controller/subsystem/shuttles/fire(resumed = 0)
do_process_shuttles(resumed)
/datum/controller/subsystem/shuttles/stat_entry()
var/msg = list()
msg += "AS:[shuttles.len]|"
msg += "PS:[process_shuttles.len]|"
..(jointext(msg, null))
/datum/controller/subsystem/shuttles/proc/do_process_shuttles(resumed = 0)
if (!resumed)
src.current_run = process_shuttles.Copy()
var/list/current_run = src.current_run // Cache for sanic speed
while(current_run.len)
var/datum/shuttle/S = current_run[current_run.len]
current_run.len--
if(istype(S) && !QDELETED(S))
if(istype(S, /datum/shuttle/ferry)) // Ferry shuttles get special treatment
var/datum/shuttle/ferry/F = S
if(F.process_state || F.always_process)
F.process()
else
S.process()
else
process_shuttles -= S
if(MC_TICK_CHECK)
return
// This should be called after all the machines and radio frequencies have been properly initialized
/datum/controller/subsystem/shuttles/proc/setup_shuttle_docks()
// Find all declared shuttle datums and initailize them.
for(var/shuttle_type in subtypesof(/datum/shuttle))
var/datum/shuttle/shuttle = shuttle_type
if(initial(shuttle.category) == shuttle_type)
continue
shuttle = new shuttle()
shuttle.init_docking_controllers()
shuttle.dock() //makes all shuttles docked to something at round start go into the docked state
CHECK_TICK
for(var/obj/machinery/embedded_controller/C in machines)
if(istype(C.program, /datum/computer/file/embedded_program/docking))
C.program.tag = null //clear the tags, 'cause we don't need 'em anymore
docks_initialized = TRUE
// Register a callback that will be invoked once the shuttles have been initialized
/datum/controller/subsystem/shuttles/proc/OnDocksInitialized(datum/callback/cb)
if(!docks_initialized)
LAZYADD(docks_init_callbacks, cb)
else
cb.InvokeAsync()
@@ -1,14 +1,35 @@
/datum/controller/game_controller
var/list/artifact_spawning_turfs = list()
var/list/digsite_spawning_turfs = list()
#define XENOARCH_SPAWN_CHANCE 0.5
#define DIGSITESIZE_LOWER 4
#define DIGSITESIZE_UPPER 12
#define ARTIFACTSPAWNNUM_LOWER 6
#define ARTIFACTSPAWNNUM_UPPER 12
/datum/controller/game_controller/proc/SetupXenoarch()
//
// Xenoarch subsystem handles initialization of Xenoarcheaology artifacts and digsites.
//
SUBSYSTEM_DEF(xenoarch)
name = "Xenoarch"
init_order = INIT_ORDER_XENOARCH
flags = SS_NO_FIRE
var/list/artifact_spawning_turfs = list()
var/list/digsite_spawning_turfs = list()
/datum/controller/subsystem/xenoarch/Initialize(timeofday)
SetupXenoarch()
..()
/datum/controller/subsystem/xenoarch/Recover()
if (istype(SSxenoarch.artifact_spawning_turfs))
artifact_spawning_turfs = SSxenoarch.artifact_spawning_turfs
if (istype(SSxenoarch.digsite_spawning_turfs))
digsite_spawning_turfs = SSxenoarch.digsite_spawning_turfs
/datum/controller/subsystem/xenoarch/stat_entry(msg)
if (!Debug2)
return // Only show up in stat panel if debugging is enabled.
. = ..()
/datum/controller/subsystem/xenoarch/proc/SetupXenoarch()
for(var/turf/simulated/mineral/M in world)
if(!M.density)
continue
+172
View File
@@ -0,0 +1,172 @@
/*
USAGE:
var/datum/callback/C = new(object|null, /proc/type/path|"procstring", arg1, arg2, ... argn)
var/timerid = addtimer(C, time, timertype)
OR
var/timerid = addtimer(CALLBACK(object|null, /proc/type/path|procstring, arg1, arg2, ... argn), time, timertype)
Note: proc strings can only be given for datum proc calls, global procs must be proc paths
Also proc strings are strongly advised against because they don't compile error if the proc stops existing
See the note on proc typepath shortcuts
INVOKING THE CALLBACK:
var/result = C.Invoke(args, to, add) //additional args are added after the ones given when the callback was created
OR
var/result = C.InvokeAsync(args, to, add) //Sleeps will not block, returns . on the first sleep (then continues on in the "background" after the sleep/block ends), otherwise operates normally.
OR
INVOKE_ASYNC(<CALLBACK args>) to immediately create and call InvokeAsync
PROC TYPEPATH SHORTCUTS (these operate on paths, not types, so to these shortcuts, datum is NOT a parent of atom, etc...)
global proc while in another global proc:
.procname
Example:
CALLBACK(GLOBAL_PROC, .some_proc_here)
proc defined on current(src) object (when in a /proc/ and not an override) OR overridden at src or any of it's parents:
.procname
Example:
CALLBACK(src, .some_proc_here)
when the above doesn't apply:
.proc/procname
Example:
CALLBACK(src, .proc/some_proc_here)
proc defined on a parent of a some type:
Example: /some/type/.proc/some_proc_here
Other wise you will have to do the full typepath of the proc (/type/of/thing/proc/procname)
*/
/datum/callback
var/datum/object = GLOBAL_PROC
var/delegate
var/list/arguments
var/weakref/user
/datum/callback/New(thingtocall, proctocall, ...)
if (thingtocall)
object = thingtocall
delegate = proctocall
if (length(args) > 2)
arguments = args.Copy(3)
if(usr)
user = weakref(usr)
/world/proc/ImmediateInvokeAsync(thingtocall, proctocall, ...)
set waitfor = FALSE
if (!thingtocall)
return
var/list/calling_arguments = length(args) > 2 ? args.Copy(3) : null
if (thingtocall == GLOBAL_PROC)
call(proctocall)(arglist(calling_arguments))
else
call(thingtocall, proctocall)(arglist(calling_arguments))
/datum/callback/proc/Invoke(...)
if(!usr)
var/weakref/W = user
if(W)
var/mob/M = W.resolve()
if(M)
return world.PushUsr(M, src)
if (!object)
return
var/list/calling_arguments = arguments
if (length(args))
if (length(arguments))
calling_arguments = calling_arguments + args //not += so that it creates a new list so the arguments list stays clean
else
calling_arguments = args
if (object == GLOBAL_PROC)
return call(delegate)(arglist(calling_arguments))
return call(object, delegate)(arglist(calling_arguments))
//copy and pasted because fuck proc overhead
/datum/callback/proc/InvokeAsync(...)
set waitfor = FALSE
if(!usr)
var/weakref/W = user
if(W)
var/mob/M = W.resolve()
if(M)
return world.PushUsr(M, src)
if (!object)
return
var/list/calling_arguments = arguments
if (length(args))
if (length(arguments))
calling_arguments = calling_arguments + args //not += so that it creates a new list so the arguments list stays clean
else
calling_arguments = args
if (object == GLOBAL_PROC)
return call(delegate)(arglist(calling_arguments))
return call(object, delegate)(arglist(calling_arguments))
/datum/callback_select
var/list/finished
var/pendingcount
var/total
/datum/callback_select/New(count, savereturns)
total = count
if (savereturns)
finished = new(count)
/datum/callback_select/proc/invoke_callback(index, datum/callback/callback, list/callback_args, savereturn = TRUE)
set waitfor = FALSE
if (!callback || !istype(callback))
//This check only exists because the alternative is callback_select would block forever if given invalid data
CRASH("invalid callback passed to invoke_callback")
if (!length(callback_args))
callback_args = list()
pendingcount++
var/rtn = callback.Invoke(arglist(callback_args))
pendingcount--
if (savereturn)
finished[index] = rtn
//runs a list of callbacks asynchronously, returning once all of them return.
//callbacks can be repeated.
//callbacks-args is an optional list of argument lists, in the same order as the callbacks,
// the inner lists will be sent to the callbacks when invoked() as additional args.
//can optionly save and return a list of return values, in the same order as the original list of callbacks
//resolution is the number of byond ticks between checks.
/proc/callback_select(list/callbacks, list/callback_args, savereturns = TRUE, resolution = 1)
if (!callbacks)
return
var/count = length(callbacks)
if (!count)
return
if (!callback_args)
callback_args = list()
callback_args.len = count
var/datum/callback_select/CS = new(count, savereturns)
for (var/i in 1 to count)
CS.invoke_callback(i, callbacks[i], callback_args[i], savereturns)
while(CS.pendingcount)
sleep(resolution*world.tick_lag)
return CS.finished
// Makes a call in the context of a different usr
// Use sparingly
/world/proc/PushUsr(mob/M, datum/callback/CB)
var/temp = usr
testing("PushUsr() in use")
usr = M
. = CB.Invoke()
usr = temp
+11 -11
View File
@@ -503,53 +503,53 @@
//slime
/mob/living/simple_animal/slime/mind_initialize()
..()
. = ..()
mind.assigned_role = "slime"
/mob/living/carbon/alien/larva/mind_initialize()
..()
. = ..()
mind.special_role = "Larva"
//AI
/mob/living/silicon/ai/mind_initialize()
..()
. = ..()
mind.assigned_role = "AI"
//BORG
/mob/living/silicon/robot/mind_initialize()
..()
. = ..()
mind.assigned_role = "Cyborg"
//PAI
/mob/living/silicon/pai/mind_initialize()
..()
. = ..()
mind.assigned_role = "pAI"
mind.special_role = ""
//Animals
/mob/living/simple_animal/mind_initialize()
..()
. = ..()
mind.assigned_role = "Animal"
/mob/living/simple_animal/corgi/mind_initialize()
..()
. = ..()
mind.assigned_role = "Corgi"
/mob/living/simple_animal/shade/mind_initialize()
..()
. = ..()
mind.assigned_role = "Shade"
/mob/living/simple_animal/construct/builder/mind_initialize()
..()
. = ..()
mind.assigned_role = "Artificer"
mind.special_role = "Cultist"
/mob/living/simple_animal/construct/wraith/mind_initialize()
..()
. = ..()
mind.assigned_role = "Wraith"
mind.special_role = "Cultist"
/mob/living/simple_animal/construct/armoured/mind_initialize()
..()
. = ..()
mind.assigned_role = "Juggernaut"
mind.special_role = "Cultist"
+1 -1
View File
@@ -116,7 +116,7 @@ var/global/repository/radiation/radiation_repository = new()
else if(O.density) //So open doors don't get counted
var/material/M = O.get_material()
if(!M) continue
cached_rad_resistance += M.weight
cached_rad_resistance += M.radiation_resistance
// Looks like storing the contents length is meant to be a basic check if the cache is stale due to items enter/exiting. Better than nothing so I'm leaving it as is. ~Leshana
radiation_repository.resistance_cache[src] = (length(contents) + 1)
+2 -2
View File
@@ -330,8 +330,8 @@
access = access_cmo
/datum/supply_packs/med/defib
name = "Defibrilator crate"
name = "Defibrillator crate"
contains = list(/obj/item/device/defib_kit = 2)
cost = 30
containertype = /obj/structure/closet/crate/medical
containername = "Defibrilator crate"
containername = "Defibrillator crate"
+8 -1
View File
@@ -25,11 +25,18 @@
..()
/area/proc/initialize()
/area/initialize()
. = ..()
return INITIALIZE_HINT_LATELOAD // Areas tradiationally are initialized AFTER other atoms.
/area/LateInitialize()
if(!requires_power || !apc)
power_light = 0
power_equip = 0
power_environ = 0
return INITIALIZE_HINT_LATELOAD
/area/LateInitialize()
power_change() // all machines set to current power level, also updates lighting icon
/area/proc/get_contents()
+42 -2
View File
@@ -24,13 +24,53 @@
//Detective Work, used for the duplicate data points kept in the scanners
var/list/original_atom
// Track if we are already had initialize() called to prevent double-initialization.
var/initialized = FALSE
//atom creation method that preloads variables at creation
/atom/New()
/atom/New(loc, ...)
// Don't call ..() unless /datum/New() ever exists
// During dynamic mapload (reader.dm) this assigns the var overrides from the .dmm file
// Native BYOND maploading sets those vars before invoking New(), by doing this FIRST we come as close to that behavior as we can.
if(use_preloader && (src.type == _preloader.target_path))//in case the instanciated atom is creating other atoms in New()
_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
if(do_initialize > INITIALIZATION_INSSATOMS)
args[1] = (do_initialize == INITIALIZATION_INNEW_MAPLOAD)
if(SSatoms.InitAtom(src, args))
// We were deleted. No sense continuing
return
// Uncomment if anything ever uses the return value of SSatoms.InitializeAtoms ~Leshana
// If a map is being loaded, it might want to know about newly created objects so they can be handled.
// var/list/created = SSatoms.created_atoms
// if(created)
// created += src
// Note: I removed "auto_init" feature (letting types disable auto-init) since it shouldn't be needed anymore.
// You can replicate the same by checking the value of the first parameter to initialize() ~Leshana
// Called after New if the map is being loaded, with mapload = TRUE
// Called from base of New if the map is not being loaded, with mapload = FALSE
// This base must be called or derivatives must set initialized to TRUE
// Must not sleep!
// Other parameters are passed from New (excluding loc), this does not happen if mapload is TRUE
// Must return an Initialize hint. Defined in code/__defines/subsystems.dm
/atom/proc/initialize(mapload, ...)
if(QDELETED(src))
crash_with("GC: -- [type] had initialize() called after qdel() --")
if(initialized)
crash_with("Warning: [src]([type]) initialized multiple times!")
initialized = TRUE
return INITIALIZE_HINT_NORMAL
// Called after all object's normal initialize() if initialize() returns INITIALIZE_HINT_LATELOAD
/atom/proc/LateInitialize()
return
/atom/proc/reveal_blood()
return
-13
View File
@@ -18,15 +18,6 @@
var/icon_scale = 1 // Used to scale icons up or down in update_transform().
var/old_x = 0
var/old_y = 0
var/auto_init = 1
/atom/movable/New()
..()
if(auto_init && ticker && ticker.current_state == GAME_STATE_PLAYING)
if(SScreation && SScreation.map_loading) // If a map is being loaded, newly created objects need to wait for it to finish.
SScreation.atoms_needing_initialize += src
else
initialize()
/atom/movable/Destroy()
. = ..()
@@ -47,10 +38,6 @@
pulledby.pulling = null
pulledby = null
/atom/movable/proc/initialize()
if(QDELETED(src))
crash_with("GC: -- [type] had initialize() called after qdel() --")
/atom/movable/Bump(var/atom/A, yes)
if(src.throwing)
src.throw_impact(A)
-2
View File
@@ -132,8 +132,6 @@ var/global/datum/controller/gameticker/ticker
callHook("roundstart")
shuttle_controller.setup_shuttle_docks()
// TODO - Leshana - Dear God Fix This. Fix all of this. Not just this line, this entire proc. This entire file!
spawn(0)//Forking here so we dont have to wait for this to finish
mode.post_setup()
+1
View File
@@ -181,6 +181,7 @@
RefreshParts()
/obj/machinery/sleeper/initialize()
. = ..()
update_icon()
/obj/machinery/sleeper/process()
+2
View File
@@ -131,6 +131,7 @@
/obj/machinery/alarm/initialize()
. = ..()
set_frequency(frequency)
if(!master_is_operating())
elect_master()
@@ -990,6 +991,7 @@ FIRE ALARM
update_icon()
/obj/machinery/firealarm/initialize()
. = ..()
if(z in using_map.contact_levels)
set_security_level(security_level? get_security_level() : "green")
+7 -3
View File
@@ -64,12 +64,14 @@
radio_connection = radio_controller.add_object(src, frequency, RADIO_ATMOSIA)
/obj/machinery/air_sensor/initialize()
set_frequency(frequency)
. = ..()
if(frequency)
set_frequency(frequency)
obj/machinery/air_sensor/Destroy()
if(radio_controller)
radio_controller.remove_object(src,frequency)
..()
. = ..()
/obj/machinery/computer/general_air_control
icon_keyboard = "atmos_key"
@@ -128,7 +130,9 @@ obj/machinery/computer/general_air_control/Destroy()
radio_connection = radio_controller.add_object(src, frequency, RADIO_ATMOSIA)
/obj/machinery/computer/general_air_control/initialize()
set_frequency(frequency)
. = ..()
if(frequency)
set_frequency(frequency)
/obj/machinery/computer/general_air_control/large_tank_control
icon = 'icons/obj/computer.dmi'
+1 -8
View File
@@ -12,17 +12,10 @@
use_power = 1
idle_power_usage = 15
/obj/machinery/meter/New()
..()
spawn(5)
target = select_target()
return 1
/obj/machinery/meter/initialize()
. = ..()
if (!target)
spawn(5)
target = select_target()
target = select_target()
/obj/machinery/meter/Destroy()
pipes_on_turf.Cut()
+1 -1
View File
@@ -224,7 +224,7 @@
var/obj/item/device/radio/radio = null
/obj/machinery/computer/security/telescreen/entertainment/initialize()
..()
. = ..()
radio = new(src)
radio.listening = TRUE
radio.broadcasting = FALSE
+1 -1
View File
@@ -17,7 +17,7 @@
/obj/machinery/computer/cloning/initialize()
..()
. = ..()
updatemodules()
/obj/machinery/computer/cloning/Destroy()
+1
View File
@@ -20,6 +20,7 @@
..()
/obj/machinery/computer/initialize()
. = ..()
power_change()
update_icon()
+1 -1
View File
@@ -76,7 +76,7 @@
if(!linkedServer)
if(message_servers && message_servers.len > 0)
linkedServer = message_servers[1]
return
return ..()
/obj/machinery/computer/message_monitor/attack_hand(var/mob/living/user as mob)
if(stat & (NOPOWER|BROKEN))
@@ -20,7 +20,7 @@
/obj/machinery/computer/station_alert/initialize()
alarm_monitor = new monitor_type(src)
alarm_monitor.register_alarm(src, /obj/machinery/computer/station_alert/update_icon)
..()
. = ..()
/obj/machinery/computer/station_alert/Destroy()
alarm_monitor.unregister_alarm(src)
+3 -3
View File
@@ -299,7 +299,7 @@
return ..()
/obj/machinery/cryopod/initialize()
..()
. = ..()
find_control_computer()
@@ -346,8 +346,8 @@
// This function can not be undone; do not call this unless you are sure
// Also make sure there is a valid control computer
/obj/machinery/cryopod/robot/despawn_occupant()
var/mob/living/silicon/robot/R = occupant
/obj/machinery/cryopod/robot/despawn_occupant(var/mob/to_despawn)
var/mob/living/silicon/robot/R = to_despawn
if(!istype(R)) return ..()
qdel(R.mmi)
+1
View File
@@ -1177,6 +1177,7 @@ About the new airlock wires panel:
if(A.closeOtherId == src.closeOtherId && A != src)
src.closeOther = A
break
. = ..()
/obj/machinery/door/airlock/Destroy()
qdel(wires)
+3 -19
View File
@@ -130,18 +130,12 @@ obj/machinery/door/airlock/proc/set_frequency(new_frequency)
obj/machinery/door/airlock/initialize()
. = ..()
if(frequency)
set_frequency(frequency)
update_icon()
obj/machinery/door/airlock/New()
..()
if(radio_controller)
set_frequency(frequency)
obj/machinery/door/airlock/Destroy()
if(frequency && radio_controller)
radio_controller.remove_object(src,frequency)
@@ -210,13 +204,9 @@ obj/machinery/airlock_sensor/proc/set_frequency(new_frequency)
radio_connection = radio_controller.add_object(src, frequency, RADIO_AIRLOCK)
obj/machinery/airlock_sensor/initialize()
. = ..()
set_frequency(frequency)
obj/machinery/airlock_sensor/New()
..()
if(radio_controller)
set_frequency(frequency)
obj/machinery/airlock_sensor/Destroy()
if(radio_controller)
radio_controller.remove_object(src,frequency)
@@ -280,15 +270,9 @@ obj/machinery/access_button/proc/set_frequency(new_frequency)
obj/machinery/access_button/initialize()
. = ..()
set_frequency(frequency)
obj/machinery/access_button/New()
..()
if(radio_controller)
set_frequency(frequency)
obj/machinery/access_button/Destroy()
if(radio_controller)
radio_controller.remove_object(src, frequency)
+1 -1
View File
@@ -19,7 +19,7 @@
..()
/obj/machinery/door/airlock/alarmlock/initialize()
..()
. = ..()
radio_controller.remove_object(src, air_frequency)
air_connection = radio_controller.add_object(src, air_frequency, RADIO_TO_AIRALARM)
open()
+1 -1
View File
@@ -30,7 +30,7 @@
block_air_zones = 0
/obj/machinery/door/blast/initialize()
..()
. = ..()
implicit_material = get_material_by_name("plasteel")
/obj/machinery/door/blast/get_material()
@@ -13,7 +13,7 @@
var/tag_secure = 0
/obj/machinery/embedded_controller/radio/airlock/initialize()
..()
. = ..()
program = new/datum/computer/file/embedded_program/airlock(src)
//Advanced airlock controller for when you want a more versatile airlock controller - useful for turning simple access control rooms into airlocks
@@ -6,7 +6,7 @@
tag_secure = 1
/obj/machinery/embedded_controller/radio/airlock/docking_port/initialize()
..()
. = ..()
airlock_program = new/datum/computer/file/embedded_program/airlock/docking(src)
docking_program = new/datum/computer/file/embedded_program/docking/airlock(src, airlock_program)
program = docking_program
@@ -10,7 +10,7 @@
var/datum/computer/file/embedded_program/docking/multi/docking_program
/obj/machinery/embedded_controller/radio/docking_port_multi/initialize()
..()
. = ..()
docking_program = new/datum/computer/file/embedded_program/docking/multi(src)
program = docking_program
@@ -56,7 +56,7 @@
tag_secure = 1
/obj/machinery/embedded_controller/radio/airlock/docking_port_multi/initialize()
..()
. = ..()
airlock_program = new/datum/computer/file/embedded_program/airlock/multi_docking(src)
program = airlock_program
@@ -58,6 +58,7 @@ obj/machinery/embedded_controller/radio/Destroy()
unacidable = 1
/obj/machinery/embedded_controller/radio/initialize()
. = ..()
set_frequency(frequency)
/obj/machinery/embedded_controller/radio/update_icon()
@@ -5,7 +5,7 @@
var/datum/computer/file/embedded_program/docking/simple/docking_program
/obj/machinery/embedded_controller/radio/simple_docking_controller/initialize()
..()
. = ..()
docking_program = new/datum/computer/file/embedded_program/docking/simple(src)
program = docking_program
+1 -1
View File
@@ -52,7 +52,7 @@
return "vanilla"
/obj/machinery/icecream_vat/initialize()
..()
. = ..()
create_reagents(100)
while(product_types.len < 6)
product_types.Add(5)
+4 -1
View File
@@ -118,10 +118,13 @@ Class Procs:
..(l)
if(d)
set_dir(d)
START_MACHINE_PROCESSING(src)
if(circuit)
circuit = new circuit(src)
/obj/machinery/initialize()
. = ..()
START_MACHINE_PROCESSING(src)
/obj/machinery/Destroy()
STOP_MACHINE_PROCESSING(src)
if(component_parts)
+1 -1
View File
@@ -61,7 +61,7 @@
// register for radio system
/obj/machinery/status_display/initialize()
..()
. = ..()
if(radio_controller)
radio_controller.add_object(src, frequency)
@@ -131,6 +131,7 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
else
for(var/obj/machinery/telecomms/T in telecomms_list)
add_link(T)
. = ..()
/obj/machinery/telecomms/Destroy()
telecomms_list -= src
+1 -1
View File
@@ -18,7 +18,7 @@
return
/obj/machinery/computer/teleporter/initialize()
..()
. = ..()
var/obj/machinery/teleport/station/station
var/obj/machinery/teleport/hub/hub
+1 -1
View File
@@ -62,7 +62,7 @@
control_area = null
power_change() //Checks power and initial settings
return
. = ..()
/obj/machinery/turretid/proc/isLocked(mob/user)
if(ailock && issilicon(user))
+1
View File
@@ -24,6 +24,7 @@
RefreshParts()
/obj/machinery/vr_sleeper/initialize()
. = ..()
update_icon()
/obj/machinery/vr_sleeper/process()
+1
View File
@@ -40,6 +40,7 @@
/obj/machinery/mecha_part_fabricator/initialize()
update_categories()
. = ..()
/obj/machinery/mecha_part_fabricator/process()
..()
+1
View File
@@ -40,6 +40,7 @@
return
/obj/machinery/pros_fabricator/initialize()
. = ..()
manufacturer = basic_robolimb.company
update_categories()
+1
View File
@@ -70,6 +70,7 @@
icon_state = "airlock_sensor_off"
/obj/machinery/mech_sensor/initialize()
. = ..()
set_frequency(frequency)
/obj/machinery/mech_sensor/proc/set_frequency(new_frequency)
+1 -2
View File
@@ -1,9 +1,8 @@
/obj/mecha/medical/initialize()
..()
. = ..()
var/turf/T = get_turf(src)
if(isPlayerLevel(T.z))
new /obj/item/mecha_parts/mecha_tracking(src)
return
/obj/mecha/medical/mechturn(direction)
+1 -2
View File
@@ -4,11 +4,10 @@
var/cargo_capacity = 5
/obj/mecha/working/initialize()
..()
. = ..()
var/turf/T = get_turf(src)
if(isPlayerLevel(T.z))
new /obj/item/mecha_parts/mecha_tracking(src)
return
/obj/mecha/working/Destroy()
for(var/mob/M in src)
@@ -110,6 +110,7 @@
pixel_y = 0
/obj/structure/sign/poster/initialize()
. = ..()
if (poster_type)
var/path = text2path(poster_type)
var/datum/poster/design = new path
+1 -1
View File
@@ -104,7 +104,7 @@ steam.start() -- spawns the effect
T.hotspot_expose(1000,100)
/obj/effect/effect/sparks/initialize()
..()
. = ..()
schedule_task_in(5 SECONDS, /proc/qdel, list(src))
/obj/effect/effect/sparks/Destroy()
+2 -2
View File
@@ -84,9 +84,9 @@
delete_me = 1
/obj/effect/landmark/initialize()
..()
. = ..()
if(delete_me)
qdel(src)
return INITIALIZE_HINT_QDEL
/obj/effect/landmark/Destroy(var/force = FALSE)
if(delete_me || force)
+2 -1
View File
@@ -34,6 +34,7 @@
pixel_y = -32
/obj/effect/temporary_effect/cleave_attack/initialize() // Makes the slash fade smoothly. When completely transparent it should qdel itself.
. = ..()
animate(src, alpha = 0, time = time_to_die - 1)
/obj/effect/temporary_effect/shuttle_landing
@@ -44,4 +45,4 @@
/obj/effect/temporary_effect/shuttle_landing/initialize()
flick("shuttle_warning", src) // flick() forces the animation to always begin at the start.
..()
. = ..()
+5 -3
View File
@@ -129,6 +129,7 @@
var/landmark_id = null
/obj/effect/step_trigger/teleporter/landmark/initialize()
. = ..()
for(var/obj/effect/landmark/teleport_mark/mark in tele_landmarks)
if(mark.landmark_id == landmark_id)
the_landmark = mark
@@ -185,10 +186,11 @@ var/global/list/tele_landmarks = list() // Terrible, but the alternative is loop
return
A.forceMove(T)
if(isliving(A)) // Someday, implement parachutes. For now, just turbomurder whoever falls.
// Living things should probably be logged when they fall...
if(isliving(A))
message_admins("\The [A] fell out of the sky.")
var/mob/living/L = A
L.fall_impact(T, 42, 90, FALSE, TRUE) //You will not be defibbed from this.
// ... because they're probably going to die from it.
A.fall_impact(T, 42, 90, FALSE, TRUE) //You will not be defibbed from this.
else
message_admins("ERROR: planetary_fall step trigger lacks a planet to fall onto.")
return
+4 -4
View File
@@ -110,7 +110,7 @@ var/list/civilian_cartridges = list(
/obj/item/weapon/cartridge/security/initialize()
radio = new /obj/item/radio/integrated/beepsky(src)
..()
. = ..()
/obj/item/weapon/cartridge/detective
name = "\improper D.E.T.E.C.T. cartridge"
@@ -166,7 +166,7 @@ var/list/civilian_cartridges = list(
/obj/item/weapon/cartridge/signal/initialize()
radio = new /obj/item/radio/integrated/signal(src)
..()
. = ..()
/obj/item/weapon/cartridge/quartermaster
name = "\improper Space Parts & Space Vendors cartridge"
@@ -200,7 +200,7 @@ var/list/civilian_cartridges = list(
/obj/item/weapon/cartridge/hos/initialize()
radio = new /obj/item/radio/integrated/beepsky(src)
..()
. = ..()
/obj/item/weapon/cartridge/ce
name = "\improper Power-On DELUXE"
@@ -225,7 +225,7 @@ var/list/civilian_cartridges = list(
/obj/item/weapon/cartridge/rd/initialize()
radio = new /obj/item/radio/integrated/signal(src)
..()
. = ..()
/obj/item/weapon/cartridge/captain
name = "\improper Value-PAK cartridge"
@@ -42,7 +42,7 @@
comm.visible_message("<span class='notice'>\icon[src] Connecting to [src].</span>")
to_chat(user, "<span class='notice'>\icon[src] Attempting to call [comm].</span>")
sleep(10)
to_chat(user, "<span class='notice'>\icon[src] Dialing internally from [station_name()], Kara Subsystem, [system_name()].</span>")
to_chat(user, "<span class='notice'>\icon[src] Dialing internally from [station_name()], [system_name()].</span>")
sleep(20) //If they don't have an exonet something is very wrong and we want a runtime.
to_chat(user, "<span class='notice'>\icon[src] Connection re-routed to [comm] at [comm.exonet.address].</span>")
sleep(40)
@@ -18,7 +18,7 @@
var/power_use = 1
/obj/item/device/flashlight/initialize()
..()
. = ..()
update_icon()
/obj/item/device/flashlight/New()
+1
View File
@@ -18,6 +18,7 @@ var/list/GPS_list = list()
var/can_hide_signal = FALSE // If it can toggle the above var.
/obj/item/device/gps/initialize()
. = ..()
GPS_list += src
name = "global positioning system ([gps_tag])"
update_icon()
@@ -81,7 +81,7 @@
ks1type = /obj/item/device/encryptionkey/raider
/obj/item/device/radio/headset/raider/initialize()
..()
. = ..()
set_frequency(RAID_FREQ)
/obj/item/device/radio/headset/binary
@@ -80,7 +80,7 @@ var/global/list/default_medbay_channels = list(
/obj/item/device/radio/initialize()
. = ..()
if(frequency < RADIO_LOW_FREQ || frequency > RADIO_HIGH_FREQ)
frequency = sanitize_frequency(frequency, RADIO_LOW_FREQ, RADIO_HIGH_FREQ)
set_frequency(frequency)
+11 -7
View File
@@ -266,22 +266,26 @@ REAGENT SCANNER
if(0)
to_chat(usr, "The scanner will now perform a basic analysis.")
/obj/item/device/healthanalyzer/improved //reports bone fractures, IB, quantity of beneficial reagents in stomach; also regular health analyzer stuff
/obj/item/device/healthanalyzer/advanced //reports bone fractures, IB, quantity of beneficial reagents in stomach; also regular health analyzer stuff
name = "advanced health analyzer"
desc = "A miracle of medical technology, this handheld scanner can produce an accurate and specific report of a patient's biosigns."
advscan = 1
origin_tech = list(TECH_MAGNET = 5, TECH_BIO = 6)
icon_state = "advhealth"
icon_state = "health1"
/obj/item/device/healthanalyzer/advanced //reports all of the above, as well as radiation severity and minor brain damage
name = "advanced health analyzer"
/obj/item/device/healthanalyzer/enhanced //reports all of the above, as well as radiation severity and minor brain damage
name = "enhanced health analyzer"
desc = "An even more advanced handheld health scanner, complete with a full biosign monitor and on-board radiation and neurological analysis suites."
advscan = 2
icon_state = "advhealth"
origin_tech = list(TECH_MAGNET = 6, TECH_BIO = 7)
icon_state = "health2"
/obj/item/device/healthanalyzer/enhanced //reports all of the above, as well as name and quantity of nonmed reagents in stomach
/obj/item/device/healthanalyzer/phasic //reports all of the above, as well as name and quantity of nonmed reagents in stomach
name = "phasic health analyzer"
desc = "Possibly the most advanced health analyzer to ever have existed, utilising bluespace technology to determine almost everything worth knowing about a patient."
advscan = 3
icon_state = "advhealth"
origin_tech = list(TECH_MAGNET = 7, TECH_BIO = 8)
icon_state = "health3"
/obj/item/device/analyzer
name = "analyzer"
+1 -1
View File
@@ -27,7 +27,7 @@
to_chat(usr, "Audio feed is [radio.broadcasting ? "on" : "off"]")
/obj/item/device/tvcamera/initialize()
..()
. = ..()
camera = new(src)
camera.c_tag = channel
camera.status = FALSE
@@ -100,6 +100,7 @@
force_divisor = 0.3 // 18 when hardness 60 (steel)
attack_verb = list("slashed", "chopped", "gouged", "ripped", "cut")
var/should_cleave = TRUE //Now hatchets inherit from the machete, and thus knives. Tables turned.
slot_flags = SLOT_BELT
// This cannot go into afterattack since some mobs delete themselves upon dying.
/obj/item/weapon/material/knife/machete/pre_attack(var/mob/living/target, var/mob/living/user)
@@ -12,7 +12,7 @@
var/apply_tape = FALSE
/obj/item/taperoll/initialize()
..()
. = ..()
if(apply_tape)
var/turf/T = get_turf(src)
if(!T)
@@ -20,7 +20,7 @@
var/obj/machinery/door/airlock/airlock = locate(/obj/machinery/door/airlock) in T
if(airlock)
afterattack(airlock, null, TRUE)
qdel(src)
return INITIALIZE_HINT_QDEL
var/list/image/hazard_overlays
@@ -128,6 +128,7 @@
new /obj/item/weapon/storage/pill_bottle/spaceacillin(src)
new /obj/item/weapon/reagent_containers/hypospray/autoinjector/biginjector/clotting(src)
new /obj/item/stack/medical/splint(src)
new /obj/item/device/healthanalyzer/advanced(src)
return
/obj/item/weapon/storage/firstaid/surgery
@@ -149,7 +150,7 @@
new /obj/item/weapon/surgical/bonegel(src)
new /obj/item/weapon/surgical/FixOVein(src)
new /obj/item/stack/medical/advanced/bruise_pack(src)
new /obj/item/device/healthanalyzer/advanced(src)
new /obj/item/device/healthanalyzer/enhanced(src)
return
/obj/item/weapon/storage/firstaid/clotting
@@ -68,26 +68,29 @@
item_state_slots = list(slot_r_hand_str = "toolbox_syndi", slot_l_hand_str = "toolbox_syndi")
origin_tech = list(TECH_COMBAT = 1, TECH_ILLEGAL = 1)
force = 14
var/powertools = FALSE
/obj/item/weapon/storage/toolbox/syndicate/powertools
powertools = TRUE
/obj/item/weapon/storage/toolbox/syndicate/New() // This is found in maint, so it should have the basics, plus some gloves.
..()
new /obj/item/clothing/gloves/yellow(src)
new /obj/item/weapon/screwdriver(src)
new /obj/item/weapon/wrench(src)
new /obj/item/weapon/weldingtool(src)
new /obj/item/weapon/crowbar(src)
new /obj/item/weapon/wirecutters(src)
new /obj/item/device/multitool(src)
/obj/item/weapon/storage/toolbox/syndicate/powertools/New() // Available in the uplink and is the 'real' syndie toolbox.
// ..() isn't called or else this box would contain the basic tools, power tools, and duplicate gloves.
new /obj/item/clothing/gloves/yellow(src)
new /obj/item/weapon/screwdriver/power(src)
new /obj/item/weapon/weldingtool/experimental(src)
new /obj/item/weapon/crowbar/power(src)
new /obj/item/device/multitool(src)
new /obj/item/stack/cable_coil/random(src,30)
new /obj/item/device/analyzer(src)
..() //all storage items need this to work properly!
if(powertools)
new /obj/item/clothing/gloves/yellow(src)
new /obj/item/weapon/screwdriver/power(src)
new /obj/item/weapon/weldingtool/experimental(src)
new /obj/item/weapon/crowbar/power(src)
new /obj/item/device/multitool(src)
new /obj/item/stack/cable_coil/random(src,30)
new /obj/item/device/analyzer(src)
else
new /obj/item/clothing/gloves/yellow(src)
new /obj/item/weapon/screwdriver(src)
new /obj/item/weapon/wrench(src)
new /obj/item/weapon/weldingtool(src)
new /obj/item/weapon/crowbar(src)
new /obj/item/weapon/wirecutters(src)
new /obj/item/device/multitool(src)
/obj/item/weapon/storage/toolbox/lunchbox
max_storage_space = ITEMSIZE_COST_SMALL * 4 //slightly smaller than a toolbox
+1 -1
View File
@@ -974,7 +974,7 @@ var/list/multi_point_spawns
var/weight // Probability weight for this spawn point
/obj/random_multi/initialize()
..()
. = ..()
weight = max(1, round(weight))
if(!multi_point_spawns)
+1 -1
View File
@@ -69,7 +69,7 @@
var/static/list/possible_tech = list(TECH_MATERIAL, TECH_ENGINEERING, TECH_PHORON, TECH_POWER, TECH_BIO, TECH_COMBAT, TECH_MAGNET, TECH_DATA)
/obj/item/prop/alien/junk/initialize()
..()
. = ..()
icon_state = pick(possible_states)
var/list/techs = possible_tech.Copy()
origin_tech = list()
+2 -1
View File
@@ -11,12 +11,13 @@
anchored = 1.0
/obj/structure/catwalk/initialize()
. = ..()
for(var/obj/structure/catwalk/O in range(1))
O.update_icon()
for(var/obj/structure/catwalk/C in get_turf(src))
if(C != src)
warning("Duplicate [type] in [loc] ([x], [y], [z])")
qdel(C)
return INITIALIZE_HINT_QDEL
update_icon()
/obj/structure/catwalk/Destroy()
@@ -24,7 +24,7 @@
var/list/will_contain
/obj/structure/closet/initialize()
..()
. = ..()
if(will_contain)
create_objects_in_loc(src, will_contain)
@@ -6,7 +6,7 @@
density = 1
/obj/structure/largecrate/initialize()
..()
. = ..()
for(var/obj/I in src.loc)
if(I.density || I.anchored || I == src || !I.simulated)
continue
+2 -2
View File
@@ -306,7 +306,7 @@
/obj/structure/flora/sif/subterranean/initialize()
icon_state = "[initial(icon_state)][rand(1,2)]"
..()
. = ..()
/obj/structure/flora/sif/eyes
name = "mysterious bulbs"
@@ -315,4 +315,4 @@
/obj/structure/flora/sif/eyes/initialize()
icon_state = "[initial(icon_state)][rand(1,3)]"
..()
. = ..()
@@ -55,7 +55,7 @@
var/delay_to_try_again = 20 MINUTES // How long to wait if first attempt fails. Set to 0 to never try again.
/obj/structure/ghost_pod/automatic/initialize()
..()
. = ..()
spawn(delay_to_self_open)
if(src)
trigger()
+4 -4
View File
@@ -10,15 +10,15 @@
// flags = CONDUCT
/obj/structure/lattice/initialize()
..()
. = ..()
if(!(istype(src.loc, /turf/space) || istype(src.loc, /turf/simulated/open) || istype(src.loc, /turf/simulated/mineral)))
qdel(src)
return
return INITIALIZE_HINT_QDEL
for(var/obj/structure/lattice/LAT in src.loc)
if(LAT != src)
qdel(LAT)
crash_with("Found multiple lattices at '[log_info_line(loc)]'")
return INITIALIZE_HINT_QDEL
icon = 'icons/obj/smoothlattice.dmi'
icon_state = "latticeblank"
updateOverlays()
+1 -1
View File
@@ -119,7 +119,7 @@ Loot piles can be depleted, if loot_depleted is turned on. Note that players wh
/obj/structure/loot_pile/maint/initialize()
icon_state = pick(icon_states_to_use)
..()
. = ..()
// Has large amounts of possible items, most of which may or may not be useful.
/obj/structure/loot_pile/maint/junk
@@ -26,6 +26,7 @@
I.loc = src
notices++
icon_state = "nboard0[notices]"
. = ..()
//attaching papers!!
/obj/structure/noticeboard/attackby(var/obj/item/weapon/O as obj, var/mob/user as mob)
+1 -1
View File
@@ -24,7 +24,7 @@
verbs += /obj/structure/proc/climb_on
/obj/structure/railing/initialize()
..()
. = ..()
if(src.anchored)
update_icon(0)
+3 -3
View File
@@ -31,13 +31,13 @@ FLOOR SAFES
/obj/structure/safe/initialize()
. = ..()
for(var/obj/item/I in loc)
if(space >= maxspace)
return
if(I.w_class + space <= maxspace)
space += I.w_class
I.loc = src
I.forceMove(src)
/obj/structure/safe/proc/check_unlocked(mob/user as mob, canhear)
if(user && canhear)
@@ -175,7 +175,7 @@ obj/structure/safe/ex_act(severity)
layer = 2.5
/obj/structure/safe/floor/initialize()
..()
. = ..()
var/turf/T = loc
if(istype(T) && !T.is_plating())
hide(1)
@@ -26,7 +26,7 @@
return FALSE
/obj/effect/wingrille_spawn/initialize()
..()
. = ..()
if(!win_path)
return
if(ticker && ticker.current_state < GAME_STATE_PLAYING)
+1 -1
View File
@@ -18,7 +18,7 @@
else return ..()
/obj/structure/shuttle/window/initialize()
..()
. = ..()
auto_join()
/obj/structure/shuttle/window/proc/auto_join()
+4 -4
View File
@@ -21,8 +21,8 @@ var/list/floor_decals = list()
add_to_turf_decals()
var/turf/T = get_turf(src)
T.apply_decals()
qdel(src)
return
initialized = TRUE
return INITIALIZE_HINT_QDEL
/obj/effect/floor_decal/reset
name = "reset marker"
@@ -32,8 +32,8 @@ var/list/floor_decals = list()
if(T.decals && T.decals.len)
T.decals.Cut()
T.update_icon()
qdel(src)
return
initialized = TRUE
return INITIALIZE_HINT_QDEL
/obj/effect/floor_decal/corner
icon_state = "corner_white"
@@ -16,7 +16,12 @@ var/global/floor_decals_initialized = FALSE
icon = null
icon_state = null
mouse_opacity = 0
auto_init = 0
// auto_init = 0
/atom/movable/turf_overlay_holder/initialize()
// doesn't need special init
initialized = TRUE
return INITIALIZE_HINT_NORMAL
/atom/movable/turf_overlay_holder/New(var/atom/newloc)
..()
+6 -11
View File
@@ -1,16 +1,11 @@
/datum/turf_initializer/proc/initialize(var/turf/T)
/datum/turf_initializer/proc/InitializeTurf(var/turf/T)
return
/area
var/datum/turf_initializer/turf_initializer = null
/area/initialize()
..()
var/list/minerals = list()
for(var/turf/simulated/T in src)
if(T.initialize())
minerals += T
if(turf_initializer)
turf_initializer.initialize(T)
for(var/turf/simulated/mineral/M in minerals)
M.MineralSpread()
/area/LateInitialize()
. = ..()
if(turf_initializer)
for(var/turf/simulated/T in src)
turf_initializer.InitializeTurf(T)
@@ -1,4 +1,4 @@
/datum/turf_initializer/maintenance/initialize(var/turf/simulated/T)
/datum/turf_initializer/maintenance/InitializeTurf(var/turf/simulated/T)
if(T.density)
return
// Quick and dirty check to avoid placing things inside windows
-3
View File
@@ -59,9 +59,6 @@
holy = 1
levelupdate()
/turf/simulated/proc/initialize()
return
/turf/simulated/proc/AddTracks(var/typepath,var/bloodDNA,var/comingdir,var/goingdir,var/bloodcolor="#A10808")
var/obj/effect/decal/cleanable/blood/tracks/tracks = locate(typepath) in src
if(!tracks)
+1 -1
View File
@@ -194,7 +194,7 @@
block_tele = TRUE
/turf/simulated/shuttle/floor/alien/initialize()
..()
. = ..()
icon_state = "alienpod[rand(1, 9)]"
/turf/simulated/shuttle/floor/alienplating
+2 -2
View File
@@ -32,7 +32,7 @@ var/list/grass_types = list(
/turf/simulated/floor/outdoors/grass/sif/initialize()
if(tree_chance && prob(tree_chance))
new /obj/structure/flora/tree/sif(src)
..()
. = ..()
/turf/simulated/floor/outdoors/grass/initialize()
if(prob(50))
@@ -42,7 +42,7 @@ var/list/grass_types = list(
if(grass_chance && prob(grass_chance))
var/grass_type = pick(grass_types)
new grass_type(src)
..()
. = ..()
/turf/simulated/floor/outdoors/grass/forest
name = "thick grass"
@@ -22,7 +22,7 @@ var/list/outdoor_turfs = list()
/turf/simulated/floor/outdoors/initialize()
update_icon()
..()
. = ..()
/turf/simulated/floor/New()
if(outdoors)
@@ -13,6 +13,7 @@
phoron = 0
/turf/simulated/sky/initialize()
. = ..()
outdoor_turfs.Add(src)
set_light(2, 2, "#FFFFFF")
+2 -2
View File
@@ -132,7 +132,7 @@
name = true_name
/turf/simulated/shuttle/wall/initialize()
..()
. = ..()
if(join_group)
src.auto_join()
@@ -213,7 +213,7 @@
stripe_color = "#00FF00"
/turf/simulated/shuttle/wall/voidcraft/initialize()
..()
. = ..()
update_icon()
/turf/simulated/shuttle/wall/voidcraft/update_icon()

Some files were not shown because too many files have changed in this diff Show More