Merge branch 'Aurorastation/development' into Map-Development

# Conflicts:
#	code/TriDimension/controller_presets.dm
#	code/game/objects/structures/crates_lockers/closets/secure/security.dm
#	code/game/objects/structures/crates_lockers/closets/wardrobe.dm
#	code/game/objects/structures/signs.dm
#	code/game/turfs/simulated/floor_types.dm
#	code/modules/random_map/mining_distribution.dm
#	code/modules/random_map/random_map.dm
#	code/world.dm
#	icons/obj/barsigns.dmi
#	icons/obj/decals.dmi
#	icons/obj/plants.dmi
#	icons/obj/structures.dmi
#	icons/turf/floors.dmi
#	icons/turf/wall_masks.dmi
#	maps/exodus-2.dmm
This commit is contained in:
LordFowl
2017-01-27 01:57:29 -05:00
2113 changed files with 97032 additions and 69020 deletions
@@ -107,6 +107,8 @@
last_task = 0
last_object = null
/datum/controller/process/proc/preStart()
/datum/controller/process/proc/started()
var/timeofhour = TimeOfHour
// Initialize last_slept so we can record timing information
@@ -366,6 +368,9 @@
spawn(6000)
exceptions[eid] = 0
e.time_stamp()
log_exception(e)
/datum/controller/process/proc/catchBadType(var/datum/caught)
if(isnull(caught) || !istype(caught) || !isnull(caught.gcDestroyed))
return // Only bother with types we can identify and that don't belong
@@ -84,10 +84,16 @@ var/global/datum/controller/processScheduler/processScheduler
isRunning = 1
// tick_lag will have been set by now, so re-initialize these
scheduler_sleep_interval = world.tick_lag
callPreStart()
updateStartDelays()
spawn(0)
process()
/datum/controller/processScheduler/proc/callPreStart()
for (var/datum/controller/process/P in processes)
if (!P.disabled)
P.preStart()
/datum/controller/processScheduler/proc/process()
while(isRunning)
checkRunningProcesses()
+2 -1
View File
@@ -19,7 +19,8 @@ var/datum/controller/process/alarm/alarm_manager
alarm_manager = src
/datum/controller/process/alarm/doWork()
for(var/datum/alarm_handler/AH in all_handlers)
for(last_object in all_handlers)
var/datum/alarm_handler/AH = last_object
AH.process()
SCHECK
+33
View File
@@ -0,0 +1,33 @@
var/datum/controller/process/chemistry/chemistryProcess
/datum/controller/process/chemistry
var/list/active_holders
var/list/chemical_reactions
var/list/chemical_reagents
/datum/controller/process/chemistry/setup()
name = "chemistry"
schedule_interval = 20 // every 2 seconds
chemistryProcess = src
active_holders = list()
chemical_reactions = chemical_reactions_list
chemical_reagents = chemical_reagents_list
/datum/controller/process/chemistry/statProcess()
..()
stat(null, "[active_holders.len] reagent holder\s")
/datum/controller/process/chemistry/doWork()
for(last_object in active_holders)
var/datum/reagents/holder = last_object
if(!holder.process_reactions())
active_holders -= holder
SCHECK
/datum/controller/process/chemistry/proc/mark_for_update(var/datum/reagents/holder)
if(holder in active_holders)
return
//Process once, right away. If we still need to continue then add to the active_holders list and continue later
if(holder.process_reactions())
active_holders += holder
+2 -2
View File
@@ -6,8 +6,8 @@
schedule_interval = 20 // every 2 seconds
/datum/controller/process/disease/doWork()
for(var/disease in active_diseases)
var/datum/disease/D = disease
for(last_object in active_diseases)
var/datum/disease/D = last_object
D.process()
SCHECK
+10 -1
View File
@@ -3,4 +3,13 @@
schedule_interval = 20 // every 2 seconds
/datum/controller/process/event/doWork()
event_manager.process()
for(last_object in event_manager.active_events)
var/datum/event/E = last_object
E.process()
SCHECK
for(var/i = EVENT_LEVEL_MUNDANE to EVENT_LEVEL_MAJOR)
last_object = event_manager.event_containers[i]
var/list/datum/event_container/EC = last_object
EC.process()
SCHECK
+289
View File
@@ -0,0 +1,289 @@
var/datum/controller/process/explosives/bomb_processor
// yes, let's move the laggiest part of the game to a process
// nothing could go wrong -- Lohikar
/datum/controller/process/explosives
var/list/work_queue
var/ticks_without_work = 0
var/list/explosion_turfs
var/explosion_in_progress
var/powernet_update_pending = 0
/datum/controller/process/explosives/setup()
name = "explosives"
schedule_interval = 5 // every half-second
tick_allowance = 25 // 25% of a tick
work_queue = list()
bomb_processor = src
// Kill it until we have an explosion to run.
disable()
/datum/controller/process/explosives/doWork()
if (!work_queue)
setup() // fix for process failing to re-init after termination
if (!(work_queue.len))
ticks_without_work++
if (powernet_update_pending && ticks_without_work > 5)
makepowernets()
powernet_update_pending = 0
// All explosions handled, powernet rebuilt.
// We can sleep now.
disable()
return
ticks_without_work = 0
powernet_update_pending = 1
for (var/A in work_queue)
lighting_process.disable()
var/datum/explosiondata/data = A
if (data.is_rec)
explosion_rec(data.epicenter, data.rec_pow)
else
explosion(data)
SCHECK
work_queue -= data
lighting_process.enable()
// Handle a non-recusrive explosion.
/datum/controller/process/explosives/proc/explosion(var/datum/explosiondata/data)
var/turf/epicenter = data.epicenter
var/devastation_range = data.devastation_range
var/heavy_impact_range = data.heavy_impact_range
var/light_impact_range = data.light_impact_range
var/flash_range = data.flash_range
var/adminlog = data.adminlog
var/z_transfer = data.z_transfer
var/power = data.rec_pow
if(config.use_recursive_explosions)
explosion_rec(epicenter, power)
return
var/start = world.timeofday
epicenter = get_turf(epicenter)
if(!epicenter) return
// Handles recursive propagation of explosions.
if(devastation_range > 2 || heavy_impact_range > 2)
if(HasAbove(epicenter.z) && z_transfer & UP)
explosion(GetAbove(epicenter), max(0, devastation_range - 2), max(0, heavy_impact_range - 2), max(0, light_impact_range - 2), max(0, flash_range - 2), 0, UP)
if(HasBelow(epicenter.z) && z_transfer & DOWN)
explosion(GetAbove(epicenter), max(0, devastation_range - 2), max(0, heavy_impact_range - 2), max(0, light_impact_range - 2), max(0, flash_range - 2), 0, DOWN)
var/max_range = max(devastation_range, heavy_impact_range, light_impact_range, flash_range)
// Play sounds; we want sounds to be different depending on distance so we will manually do it ourselves.
// Stereo users will also hear the direction of the explosion!
// Calculate far explosion sound range. Only allow the sound effect for heavy/devastating explosions.
// 3/7/14 will calculate to 80 + 35
var/far_dist = 0
far_dist += heavy_impact_range * 5
far_dist += devastation_range * 20
// Play sounds; we want sounds to be different depending on distance so we will manually do it ourselves.
// Stereo users will also hear the direction of the explosion!
// Calculate far explosion sound range. Only allow the sound effect for heavy/devastating explosions.
// 3/7/14 will calculate to 80 + 35
var/volume = 10 + (power * 20)
var/frequency = get_rand_frequency()
var/closedist = round(max_range + world.view - 2, 1)
//Whether or not this explosion causes enough vibration to send sound or shockwaves through the station
var/vibration = 1
if (istype(epicenter,/turf/space))
vibration = 0
for (var/turf/T in range(src, max_range))
if (!istype(T,/turf/space))
//If there is a nonspace tile within the explosion radius
//Then we can reverberate shockwaves through that, and allow it to be felt in a vacuum
vibration = 1
if (vibration)
for(var/mob/M in player_list)
SCHECK
// Double check for client
var/reception = 2//Whether the person can be shaken or hear sound
//2 = BOTH
//1 = shockwaves only
//0 = no effect
if(M && M.client)
var/turf/M_turf = get_turf(M)
if(M_turf && M_turf.z == epicenter.z)
if (istype(M_turf,/turf/space))
//If the person is standing in space, they wont hear
//But they may still feel the shaking
reception = 0
for (var/turf/T in range(M, 1))
if (!istype(T,/turf/space))
//If theyre touching the hull or on some extruding part of the station
reception = 1//They will get screenshake
break
if (!reception)
continue
var/dist = get_dist(M_turf, epicenter)
if (reception == 2 && (M.ear_deaf <= 0 || !M.ear_deaf))//Dont play sounds to deaf people
// If inside the blast radius + world.view - 2
if(dist <= closedist)
M.playsound_local(epicenter, get_sfx("explosion"), min(100, volume), 1, frequency, falloff = 5) // get_sfx() is so that everyone gets the same sound
//You hear a far explosion if you're outside the blast radius. Small bombs shouldn't be heard all over the station.
else
volume = M.playsound_local(epicenter, 'sound/effects/explosionfar.ogg', volume, 1, frequency, usepressure = 0, falloff = 1000)
//Playsound local will return the final volume the sound is actually played at
//It will return 0 if the sound volume falls to 0 due to falloff or pressure
//Also return zero if sound playing failed for some other reason
//Deaf people will feel vibrations though
if (volume > 0)//Only shake camera if someone was close enough to hear it
shake_camera(M, min(60,max(2,(power*18) / dist)), min(3.5,((power*3) / dist)),0.05)
//Maximum duration is 6 seconds, and max strength is 3.5
//Becuse values higher than those just get really silly
if(adminlog)
message_admins("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range]) in area [epicenter.loc.name] ([epicenter.x],[epicenter.y],[epicenter.z]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[epicenter.x];Y=[epicenter.y];Z=[epicenter.z]'>JMP</a>)")
log_game("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range]) in area [epicenter.loc.name] ")
if(heavy_impact_range > 1)
var/datum/effect/system/explosion/E = new/datum/effect/system/explosion()
E.set_up(epicenter)
E.start()
var/x0 = epicenter.x
var/y0 = epicenter.y
var/z0 = epicenter.z
for(var/turf/T in trange(max_range, epicenter))
var/dist = sqrt((T.x - x0)**2 + (T.y - y0)**2)
if(dist < devastation_range) dist = 1
else if(dist < heavy_impact_range) dist = 2
else if(dist < light_impact_range) dist = 3
else continue
T.ex_act(dist)
SCHECK
if(T)
for(var/atom_movable in T.contents) //bypass type checking since only atom/movable can be contained by turfs anyway
var/atom/movable/AM = atom_movable
if(AM && AM.simulated) AM.ex_act(dist)
SCHECK
var/took = (world.timeofday-start)/10
//You need to press the DebugGame verb to see these now....they were getting annoying and we've collected a fair bit of data. Just -test- changes to explosion code using this please so we can compare
if(Debug2) world.log << "## DEBUG: Explosion([x0],[y0],[z0])(d[devastation_range],h[heavy_impact_range],l[light_impact_range]): Took [took] seconds."
//Machines which report explosions.
for(var/i,i<=doppler_arrays.len,i++)
var/obj/machinery/doppler_array/Array = doppler_arrays[i]
if(Array)
Array.sense_explosion(x0,y0,z0,devastation_range,heavy_impact_range,light_impact_range,took)
// Handle a recursive explosion.
/datum/controller/process/explosives/proc/explosion_rec(turf/epicenter, power)
if(power <= 0) return
epicenter = get_turf(epicenter)
if(!epicenter) return
message_admins("Explosion with size ([power]) in area [epicenter.loc.name] ([epicenter.x],[epicenter.y],[epicenter.z])")
log_game("Explosion with size ([power]) in area [epicenter.loc.name] ")
playsound(epicenter, 'sound/effects/explosionfar.ogg', 100, 1, round(power*2,1) )
playsound(epicenter, "explosion", 100, 1, round(power,1) )
explosion_in_progress = 1
explosion_turfs = list()
explosion_turfs[epicenter] = power
//This steap handles the gathering of turfs which will be ex_act() -ed in the next step. It also ensures each turf gets the maximum possible amount of power dealt to it.
for(var/direction in cardinal)
var/turf/T = get_step(epicenter, direction)
explosion_spread(T, power - epicenter.explosion_resistance, direction)
SCHECK
//This step applies the ex_act effects for the explosion, as planned in the previous step.
for(var/turf/T in explosion_turfs)
if(explosion_turfs[T] <= 0) continue
if(!T) continue
//Wow severity looks confusing to calculate... Fret not, I didn't leave you with any additional instructions or help. (just kidding, see the line under the calculation)
var/severity = 4 - round(max(min( 3, ((explosion_turfs[T] - T.explosion_resistance) / (max(3,(power/3)))) ) ,1), 1) //sanity effective power on tile divided by either 3 or one third the total explosion power
// One third because there are three power levels and I
// want each one to take up a third of the crater
var/x = T.x
var/y = T.y
var/z = T.z
T.ex_act(severity)
if(!T)
T = locate(x,y,z)
for(var/atom/A in T)
A.ex_act(severity)
SCHECK
explosion_in_progress = 0
// A proc used by recursive explosions. (The actually recursive bit.)
/datum/controller/process/explosives/proc/explosion_spread(turf/s, power, direction)
SCHECK
if (istype(s, /turf/unsimulated))
return
if(power <= 0)
return
if(explosion_turfs[s] >= power)
return //The turf already sustained and spread a power greated than what we are dealing with. No point spreading again.
explosion_turfs[s] = power
var/spread_power = power - s.explosion_resistance //This is the amount of power that will be spread to the tile in the direction of the blast
for(var/obj/O in s)
if(O.explosion_resistance)
spread_power -= O.explosion_resistance
var/turf/T = get_step(s, direction)
explosion_spread(T, spread_power, direction)
T = get_step(s, turn(direction,90))
explosion_spread(T, spread_power, turn(direction,90))
T = get_step(s, turn(direction,-90))
explosion_spread(T, spread_power, turn(direction,90))
// Add an explosion to the queue for processing.
/datum/controller/process/explosives/proc/queue(var/datum/explosiondata/data)
if (!data || !istype(data))
return
work_queue += data
// Wake it up from sleeping if necessary.
if (disabled)
enable()
/datum/controller/process/explosives/statProcess()
..()
stat(null, "[work_queue.len] items in explosion queue")
// The data datum for explosions.
/datum/explosiondata
var/turf/epicenter
var/devastation_range
var/heavy_impact_range
var/light_impact_range
var/flash_range
var/adminlog
var/z_transfer
var/is_rec
var/rec_pow
+39 -5
View File
@@ -1,7 +1,7 @@
// The time a datum was destroyed by the GC, or null if it hasn't been
/datum/var/gcDestroyed
#define GC_COLLECTIONS_PER_RUN 150
#define GC_COLLECTIONS_PER_RUN 300
#define GC_COLLECTION_TIMEOUT (30 SECONDS)
#define GC_FORCE_DEL_PER_RUN 30
@@ -23,7 +23,7 @@ var/list/delayed_garbage = list()
/datum/controller/process/garbage_collector/setup()
name = "garbage"
schedule_interval = 10 SECONDS
schedule_interval = 5 SECONDS
start_delay = 3
if(!garbage_collector)
@@ -34,6 +34,10 @@ var/list/delayed_garbage = list()
delayed_garbage.Cut()
delayed_garbage = null
#ifdef GC_FINDREF
world/loop_checks = 0
#endif
/datum/controller/process/garbage_collector/doWork()
if(!garbage_collect)
return
@@ -62,7 +66,7 @@ var/list/delayed_garbage = list()
#endif
if(A && A.gcDestroyed == GCd_at_time) // So if something else coincidently gets the same ref, it's not deleted by mistake
// Something's still referring to the qdel'd object. Kill it.
testing("GC: -- \ref[A] | [A.type] was unable to be GC'd and was deleted --")
log_hard_delete(A)
logging["[A.type]"]++
del(A)
@@ -82,6 +86,32 @@ var/list/delayed_garbage = list()
#undef GC_COLLECTION_TIMEOUT
#undef GC_COLLECTIONS_PER_TICK
#ifdef GC_FINDREF
/datum/controller/process/garbage_collector/proc/LookForRefs(var/datum/D, var/list/targ)
. = 0
for(var/V in D.vars)
if(V == "contents")
continue
if(istype(D.vars[V], /atom))
var/atom/A = D.vars[V]
if(A in targ)
testing("GC: [A] | [A.type] referenced by [D] | [D.type], var [V]")
. += 1
else if(islist(D.vars[V]))
. += LookForListRefs(D.vars[V], targ, D, V)
/datum/controller/process/garbage_collector/proc/LookForListRefs(var/list/L, var/list/targ, var/datum/D, var/V)
. = 0
for(var/F in L)
if(istype(F, /atom))
var/atom/A = F
if(A in targ)
testing("GC: [A] | [A.type] referenced by [D] | [D.type], list [V]")
. += 1
if(islist(F))
. += LookForListRefs(F, targ, D, "[F] in list [V]")
#endif
/datum/controller/process/garbage_collector/proc/AddTrash(datum/A)
if(!istype(A) || !isnull(A.gcDestroyed))
return
@@ -99,7 +129,7 @@ var/list/delayed_garbage = list()
// Tests if an atom has been deleted.
/proc/deleted(atom/A)
/proc/deleted(atom/A)
return !A || !isnull(A.gcDestroyed)
// Should be treated as a replacement for the 'del' keyword.
@@ -109,7 +139,6 @@ var/list/delayed_garbage = list()
return
if(!istype(A))
warning("qdel() passed object of type [A.type]. qdel() can only handle /datum types.")
crash_with("qdel() passed object of type [A.type]. qdel() can only handle /datum types.")
del(A)
if(garbage_collector)
garbage_collector.total_dels++
@@ -151,6 +180,7 @@ var/list/delayed_garbage = list()
// This should be overridden to remove all references pointing to the object being destroyed.
// Return true if the the GC controller should allow the object to continue existing. (Useful if pooling objects.)
/datum/proc/Destroy()
nanomanager.close_uis(src)
tag = null
return
@@ -222,3 +252,7 @@ var/list/delayed_garbage = list()
#ifdef GC_DEBUG
#undef GC_DEBUG
#endif
#ifdef GC_FINDREF
#undef GC_FINDREF
#endif
+2 -1
View File
@@ -4,7 +4,8 @@
/datum/controller/process/inactivity/doWork()
if(config.kick_inactive)
for(var/client/C in clients)
for(last_object in clients)
var/client/C = last_object
if(!C.holder && C.is_afk(config.kick_inactive MINUTES))
if(!istype(C.mob, /mob/dead))
log_access("AFK: [key_name(C)]")
+28
View File
@@ -0,0 +1,28 @@
/var/global/datum/controller/process/law/corp_regs
/datum/controller/process/law
var/list/laws = list() // All laws
var/list/low_severity = list()
var/list/med_severity = list()
var/list/high_severity = list()
/datum/controller/process/law/New()
corp_regs = src
..()
/datum/controller/process/law/setup()
name = "Law"
schedule_interval = 100
for( var/L in subtypesof( /datum/law/low_severity ))
low_severity += new L
for( var/L in subtypesof( /datum/law/med_severity ))
med_severity += new L
for( var/L in subtypesof( /datum/law/high_severity ))
high_severity += new L
laws = low_severity + med_severity + high_severity
-27
View File
@@ -1,27 +0,0 @@
/datum/controller/process/lighting/setup()
name = "lighting"
start_delay = 1
schedule_interval = 5 // every .5 second
lighting_controller.initializeLighting()
/datum/controller/process/lighting/doWork()
lighting_controller.lights_workload_max = \
max(lighting_controller.lights_workload_max, lighting_controller.lights.len)
for(var/datum/light_source/L in lighting_controller.lights)
if(L && L.check())
lighting_controller.lights.Remove(L)
scheck()
lighting_controller.changed_turfs_workload_max = \
max(lighting_controller.changed_turfs_workload_max, lighting_controller.changed_turfs.len)
for(var/turf/T in lighting_controller.changed_turfs)
if(T && T.lighting_changed)
T.shift_to_subarea()
scheck()
if(lighting_controller.changed_turfs && lighting_controller.changed_turfs.len)
lighting_controller.changed_turfs.len = 0 // reset the changed list
+8 -4
View File
@@ -18,7 +18,8 @@
machines = dd_sortedObjectList(machines)
/datum/controller/process/machinery/proc/internal_process_machinery()
for(var/obj/machinery/M in machines)
for(last_object in machines)
var/obj/machinery/M = last_object
if(M && !M.gcDestroyed)
if(M.process() == PROCESS_KILL)
//M.inMachineList = 0 We don't use this debugging function
@@ -31,7 +32,8 @@
SCHECK
/datum/controller/process/machinery/proc/internal_process_power()
for(var/datum/powernet/powerNetwork in powernets)
for(last_object in powernets)
var/datum/powernet/powerNetwork = last_object
if(istype(powerNetwork) && isnull(powerNetwork.gcDestroyed))
powerNetwork.reset()
SCHECK
@@ -41,13 +43,15 @@
/datum/controller/process/machinery/proc/internal_process_power_drain()
// Currently only used by powersinks. These items get priority processed before machinery
for(var/obj/item/I in processing_power_items)
for(last_object in processing_power_items)
var/obj/item/I = last_object
if(!I.pwr_drain()) // 0 = Process Kill, remove from processing list.
processing_power_items.Remove(I)
SCHECK
/datum/controller/process/machinery/proc/internal_process_pipenets()
for(var/datum/pipe_network/pipeNetwork in pipe_networks)
for(last_object in pipe_networks)
var/datum/pipe_network/pipeNetwork = last_object
if(istype(pipeNetwork) && isnull(pipeNetwork.gcDestroyed))
pipeNetwork.process()
SCHECK
+2 -2
View File
@@ -14,7 +14,7 @@
/datum/controller/process/mob/doWork()
for(last_object in mob_list)
var/mob/M = last_object
if(isnull(M.gcDestroyed))
if(M && isnull(M.gcDestroyed))
try
M.Life()
catch(var/exception/e)
@@ -26,4 +26,4 @@
/datum/controller/process/mob/statProcess()
..()
stat(null, "[mob_list.len] mobs")
stat(null, "[mob_list.len] mobs")
+22
View File
@@ -0,0 +1,22 @@
/datum/controller/process/modifier/setup()
name = "modifiers"
schedule_interval = 10
start_delay = 8
/datum/controller/process/modifier/started()
..()
if(!processing_modifiers)
processing_modifiers = list()
/datum/controller/process/modifier/doWork()
for(last_object in processing_modifiers)
var/datum/modifier/O = last_object
if(isnull(O.gcDestroyed))
O.process()
else
catchBadType(O)
processing_objects -= O
/datum/controller/process/modifier/statProcess()
..()
stat(null, "[processing_modifiers.len] modifiers")
@@ -0,0 +1,78 @@
var/datum/controller/process/night_lighting/nl_ctrl
/datum/controller/process/night_lighting/
var/isactive = 0
var/firstrun = 1
var/manual_override = 0
/datum/controller/process/night_lighting/proc/is_active()
return isactive
/datum/controller/process/night_lighting/setup()
name = "night lighting controller"
schedule_interval = 3600 // Every 5 minutes.
nl_ctrl = src
if (!config.night_lighting)
// Stop trying to delete processes. Not how it goes.
disabled = 1
/datum/controller/process/night_lighting/preStart()
switch (worldtime2ticks())
if (0 to config.nl_finish)
deactivate()
if (config.nl_start to TICKS_IN_DAY)
activate()
/datum/controller/process/night_lighting/doWork()
if (manual_override) // don't automatically change lighting if it was manually changed in-game
return
switch (worldtime2ticks())
if (0 to config.nl_finish)
if (isactive)
command_announcement.Announce("Good morning. The time is [worldtime2text()]. \n\nThe automated systems aboard the [station_name()] will now return the public hallway lighting levels to normal.", "Automated Lighting System", new_sound = 'sound/misc/bosuns_whistle.ogg')
deactivate()
if (config.nl_start to TICKS_IN_DAY)
if (!isactive)
command_announcement.Announce("Good evening. The time is [worldtime2text()]. \n\nThe automated systems aboard the [station_name()] will now dim lighting in the public hallways in order to accommodate the circadian rhythm of some species.", "Automated Lighting System", new_sound = 'sound/misc/bosuns_whistle.ogg')
activate()
else
if (isactive)
deactivate()
// 'whitelisted' areas are areas that have nightmode explicitly enabled
/datum/controller/process/night_lighting/proc/activate(var/whitelisted_only = 1)
isactive = 1
for (var/obj/machinery/power/apc/APC in get_apc_list(whitelisted_only))
APC.toggle_nightlight("on")
SCHECK
/datum/controller/process/night_lighting/proc/deactivate(var/whitelisted_only = 1)
isactive = 0
for (var/obj/machinery/power/apc/APC in get_apc_list(whitelisted_only))
APC.toggle_nightlight("off")
SCHECK
/datum/controller/process/night_lighting/proc/get_apc_list(var/whitelisted_only = 1)
var/list/obj/machinery/power/apc/lighting_apcs = list()
for (var/A in all_areas)
var/area/B = A
if (B.no_light_control || (!(B.allow_nightmode) && whitelisted_only))
continue
if (B.apc && !B.apc.aidisabled)
lighting_apcs += B.apc
SCHECK
return lighting_apcs
+133
View File
@@ -0,0 +1,133 @@
/var/datum/controller/process/scheduler/scheduler
/************
* Scheduler *
************/
/datum/controller/process/scheduler
var/list/scheduled_tasks
/datum/controller/process/scheduler/setup()
name = "scheduler"
schedule_interval = 3 SECONDS
scheduled_tasks = list()
scheduler = src
/datum/controller/process/scheduler/doWork()
for(last_object in scheduled_tasks)
var/datum/scheduled_task/scheduled_task = last_object
try
if(world.time > scheduled_task.trigger_time)
unschedule(scheduled_task)
scheduled_task.pre_process()
scheduled_task.process()
scheduled_task.post_process()
catch(var/exception/e)
catchException(e, last_object)
SCHECK
/datum/controller/process/scheduler/statProcess()
..()
stat(null, "[scheduled_tasks.len] task\s")
/datum/controller/process/scheduler/proc/schedule(var/datum/scheduled_task/st)
scheduled_tasks += st
destroyed_event.register(st, src, /datum/controller/process/scheduler/proc/unschedule)
/datum/controller/process/scheduler/proc/unschedule(var/datum/scheduled_task/st)
if(st in scheduled_tasks)
scheduled_tasks -= st
destroyed_event.unregister(st, src)
/**********
* Helpers *
**********/
/proc/schedule_task_in(var/in_time, var/procedure, var/list/arguments = list())
return schedule_task(world.time + in_time, procedure, arguments)
/proc/schedule_task_with_source_in(var/in_time, var/source, var/procedure, var/list/arguments = list())
return schedule_task_with_source(world.time + in_time, source, procedure, arguments)
/proc/schedule_task(var/trigger_time, var/procedure, var/list/arguments)
var/datum/scheduled_task/st = new/datum/scheduled_task(trigger_time, procedure, arguments, /proc/destroy_scheduled_task, list())
scheduler.schedule(st)
return st
/proc/schedule_task_with_source(var/trigger_time, var/source, var/procedure, var/list/arguments)
var/datum/scheduled_task/st = new/datum/scheduled_task/source(trigger_time, source, procedure, arguments, /proc/destroy_scheduled_task, list())
scheduler.schedule(st)
return st
/proc/schedule_repeating_task(var/trigger_time, var/repeat_interval, var/procedure, var/list/arguments)
var/datum/scheduled_task/st = new/datum/scheduled_task(trigger_time, procedure, arguments, /proc/repeat_scheduled_task, list(repeat_interval))
scheduler.schedule(st)
return st
/proc/schedule_repeating_task_with_source(var/trigger_time, var/repeat_interval, var/source, var/procedure, var/list/arguments)
var/datum/scheduled_task/st = new/datum/scheduled_task/source(trigger_time, source, procedure, arguments, /proc/repeat_scheduled_task, list(repeat_interval))
scheduler.schedule(st)
return st
/*************
* Task Datum *
*************/
/datum/scheduled_task
var/trigger_time
var/procedure
var/list/arguments
var/task_after_process
var/list/task_after_process_args
/datum/scheduled_task/New(var/trigger_time, var/procedure, var/list/arguments, var/proc/task_after_process, var/list/task_after_process_args)
..()
src.trigger_time = trigger_time
src.procedure = procedure
src.arguments = arguments ? arguments : list()
src.task_after_process = task_after_process ? task_after_process : /proc/destroy_scheduled_task
src.task_after_process_args = istype(task_after_process_args) ? task_after_process_args : list()
task_after_process_args += src
/datum/scheduled_task/Destroy()
procedure = null
arguments.Cut()
task_after_process = null
task_after_process_args.Cut()
return ..()
/datum/scheduled_task/proc/pre_process()
task_triggered_event.raise_event(list(src))
/datum/scheduled_task/proc/process()
if(procedure)
call(procedure)(arglist(arguments))
/datum/scheduled_task/proc/post_process()
call(task_after_process)(arglist(task_after_process_args))
// Resets the trigger time, has no effect if the task has already triggered
/datum/scheduled_task/proc/trigger_task_in(var/trigger_in)
src.trigger_time = world.time + trigger_in
/datum/scheduled_task/source
var/datum/source
/datum/scheduled_task/source/New(var/trigger_time, var/datum/source, var/procedure, var/list/arguments, var/proc/task_after_process, var/list/task_after_process_args)
src.source = source
destroyed_event.register(src.source, src, /datum/scheduled_task/source/proc/source_destroyed)
..(trigger_time, procedure, arguments, task_after_process, task_after_process_args)
/datum/scheduled_task/source/Destroy()
source = null
return ..()
/datum/scheduled_task/source/process()
call(source, procedure)(arglist(arguments))
/datum/scheduled_task/source/proc/source_destroyed()
qdel(src)
/proc/destroy_scheduled_task(var/datum/scheduled_task/st)
qdel(st)
/proc/repeat_scheduled_task(var/trigger_delay, var/datum/scheduled_task/st)
st.trigger_time = world.time + trigger_delay
scheduler.schedule(st)
+2 -1
View File
@@ -5,7 +5,8 @@ var/global/list/turf/processing_turfs = list()
schedule_interval = 20 // every 2 seconds
/datum/controller/process/turf/doWork()
for(var/turf/T in processing_turfs)
for(last_object in processing_turfs)
var/turf/T = last_object
if(T.process() == PROCESS_KILL)
processing_turfs.Remove(T)
SCHECK
+72
View File
@@ -0,0 +1,72 @@
//-------------------------------
/*
Wireless controller
Used for connecting devices to each other (i.e. machinery, doors, emitters, etc.)
Unlike the radio controller, the wireless controller does not pass communications between devices. Once the devices
have been connected they call each others procs directly, they do not use the wireless controller to communicate.
See code\modules\wireless\interfaces.dm for details of how to connect devices.
*/
//-------------------------------
var/datum/controller/process/wireless/wirelessProcess
/datum/controller/process/wireless
var/list/receiver_list
var/list/pending_connections
var/list/retry_connections
var/list/failed_connections
/datum/controller/process/wireless/setup()
name = "wireless"
schedule_interval = 50
pending_connections = new()
retry_connections = new()
failed_connections = new()
receiver_list = new()
wirelessProcess = src
/datum/controller/process/wireless/proc/add_device(var/datum/wifi/receiver/R)
if(receiver_list)
receiver_list |= R
else
receiver_list = new()
receiver_list |= R
/datum/controller/process/wireless/proc/remove_device(var/datum/wifi/receiver/R)
if(receiver_list)
receiver_list -= R
/datum/controller/process/wireless/proc/add_request(var/datum/connection_request/C)
if(pending_connections)
pending_connections += C
else
pending_connections = new()
pending_connections += C
/datum/controller/process/wireless/doWork()
//process any connection requests waiting to be retried
if(retry_connections.len > 0)
//any that fail are moved into the failed connections list
process_queue(retry_connections, failed_connections)
//process any pending connection requests
if(pending_connections.len > 0)
//any that fail are moved to the retry queue
process_queue(pending_connections, retry_connections)
/datum/controller/process/wireless/proc/process_queue(var/list/process_conections, var/list/unsuccesful_connections)
for(last_object in process_conections)
var/datum/connection_request/C = last_object
var/target_found = 0
for(var/datum/wifi/receiver/R in receiver_list)
if(R.id == C.id)
var/datum/wifi/sender/S = C.source
S.connect_device(R)
R.connect_device(S)
target_found = 1
process_conections -= C
if(!target_found)
unsuccesful_connections += C
SCHECK
+32 -18
View File
@@ -97,12 +97,18 @@ On the map:
1455 for AI access
*/
var/const/BOT_FREQ = 1447
var/const/RADIO_LOW_FREQ = 1200
var/const/PUBLIC_LOW_FREQ = 1441
var/const/PUBLIC_HIGH_FREQ = 1489
var/const/RADIO_HIGH_FREQ = 1600
var/const/BOT_FREQ = 1447
var/const/COMM_FREQ = 1353
var/const/ERT_FREQ = 1345
var/const/AI_FREQ = 1343
var/const/DTH_FREQ = 1341
var/const/ERT_FREQ = 1345
var/const/AI_FREQ = 1343
var/const/DTH_FREQ = 1341
var/const/SYND_FREQ = 1213
var/const/ENT_FREQ = 1461 //entertainment frequency. This is not a diona exclusive frequency.
// department channels
var/const/PUB_FREQ = 1459
@@ -113,6 +119,10 @@ var/const/SCI_FREQ = 1351
var/const/SRV_FREQ = 1349
var/const/SUP_FREQ = 1347
// internal department channels
var/const/MED_I_FREQ = 1485
var/const/SEC_I_FREQ = 1475
var/list/radiochannels = list(
"Common" = PUB_FREQ,
"Science" = SCI_FREQ,
@@ -125,7 +135,10 @@ var/list/radiochannels = list(
"Mercenary" = SYND_FREQ,
"Supply" = SUP_FREQ,
"Service" = SRV_FREQ,
"AI Private" = AI_FREQ
"AI Private" = AI_FREQ,
"Entertainment" = ENT_FREQ,
"Medical(I)" = MED_I_FREQ,
"Security(I)" = SEC_I_FREQ
)
// central command channels, i.e deathsquid & response teams
@@ -134,8 +147,8 @@ var/list/CENT_FREQS = list(ERT_FREQ, DTH_FREQ)
// Antag channels, i.e. Syndicate
var/list/ANTAG_FREQS = list(SYND_FREQ)
//depenging helpers
var/list/DEPT_FREQS = list(SCI_FREQ, MED_FREQ, ENG_FREQ, SEC_FREQ, SUP_FREQ, SRV_FREQ, ERT_FREQ, SYND_FREQ, DTH_FREQ)
//Department channels, arranged lexically
var/list/DEPT_FREQS = list(AI_FREQ, COMM_FREQ, ENG_FREQ, MED_FREQ, SEC_FREQ, SCI_FREQ, SRV_FREQ, SUP_FREQ, ENT_FREQ)
#define TRANSMISSION_WIRE 0
#define TRANSMISSION_RADIO 1
@@ -145,29 +158,30 @@ var/list/DEPT_FREQS = list(SCI_FREQ, MED_FREQ, ENG_FREQ, SEC_FREQ, SUP_FREQ, SRV
if (frequency in ANTAG_FREQS)
return "syndradio"
// centcomm channels (deathsquid and ert)
else if(frequency in CENT_FREQS)
if(frequency in CENT_FREQS)
return "centradio"
// command channel
else if(frequency == COMM_FREQ)
if(frequency == COMM_FREQ)
return "comradio"
// AI private channel
else if(frequency == AI_FREQ)
if(frequency == AI_FREQ)
return "airadio"
// department radio formatting (poorly optimized, ugh)
else if(frequency == SEC_FREQ)
if(frequency == SEC_FREQ)
return "secradio"
else if (frequency == ENG_FREQ)
if (frequency == ENG_FREQ)
return "engradio"
else if(frequency == SCI_FREQ)
if(frequency == SCI_FREQ)
return "sciradio"
else if(frequency == MED_FREQ)
if(frequency == MED_FREQ)
return "medradio"
else if(frequency == SUP_FREQ) // cargo
if(frequency == SUP_FREQ) // cargo
return "supradio"
else if(frequency == SRV_FREQ) // service
if(frequency == SRV_FREQ) // service
return "srvradio"
// If all else fails and it's a dept_freq, color me purple!
else if(frequency in DEPT_FREQS)
if(frequency == ENT_FREQ) //entertainment
return "entradio"
if(frequency in DEPT_FREQS)
return "deptradio"
return "radio"
+88 -8
View File
@@ -6,6 +6,8 @@ var/list/gamemode_cache = list()
var/nudge_script_path = "nudge.py" // where the nudge.py script is located
var/list/lobby_screens = list("title") // Which lobby screens are available
var/log_ooc = 0 // log OOC channel
var/log_access = 0 // log login/logout
var/log_say = 0 // log client say
@@ -61,7 +63,7 @@ var/list/gamemode_cache = list()
var/allow_random_events = 0 // enables random events mid-round when set to 1
var/allow_ai = 1 // allow ai job
var/hostedby = null
var/respawn = 1
var/respawn_delay = 30
var/guest_jobban = 1
var/usewhitelist = 0
var/kick_inactive = 0 //force disconnect for inactive players after this many minutes, if non-0
@@ -139,11 +141,14 @@ var/list/gamemode_cache = list()
var/welder_vision = 1
var/generate_asteroid = 0
var/no_click_cooldown = 0
//Used for modifying movement speed for mobs.
//Unversal modifiers
var/run_speed = 0
var/walk_speed = 0
var/walk_delay_multiplier = 1
var/run_delay_multiplier = 1
var/vehicle_delay_multiplier = 1
//Mob specific modifiers. NOTE: These will affect different mob types in different ways
var/human_delay = 0
@@ -153,21 +158,27 @@ var/list/gamemode_cache = list()
var/slime_delay = 0
var/animal_delay = 0
var/admin_legacy_system = 0 //Defines whether the server uses the legacy admin system with admins.txt or the SQL system. Config option in config.txt
var/ban_legacy_system = 0 //Defines whether the server uses the legacy banning system with the files in /data or the SQL system. Config option in config.txt
var/use_age_restriction_for_jobs = 0 //Do jobs use account age restrictions? --requires database
var/use_age_restriction_for_antags = 0 //Do antags use account age restrictions? --requires database
var/sql_stats = 0 //Do we record round statistics on the database (deaths, round reports, population, etcetera) or not?
var/sql_whitelists = 0 //Defined whether the server uses an SQL based whitelist system, or the legacy one with two .txts. Config option in config.txt
var/sql_saves = 0 //Defines whether the server uses an SQL based character and preference saving system. Config option in config.txt
var/simultaneous_pm_warning_timeout = 100
var/use_recursive_explosions //Defines whether the server uses recursive or circular explosions.
var/use_recursive_explosions = 0 //Defines whether the server uses recursive or circular explosions.
var/assistant_maint = 0 //Do assistants get maint access?
var/gateway_delay = 18000 //How long the gateway takes before it activates. Default is half an hour.
var/ghost_interaction = 0
var/night_lighting = 0
var/nl_start = 19 * TICKS_IN_HOUR
var/nl_finish = 8 * TICKS_IN_HOUR
var/comms_password = ""
var/enter_allowed = 1
@@ -183,6 +194,7 @@ var/list/gamemode_cache = list()
var/list/admin_levels= list(2) // Defines which Z-levels which are for admin functionality, for example including such areas as Central Command and the Syndicate Shuttle
var/list/contact_levels = list(1, 5) // Defines which Z-levels which, for example, a Code Red announcement may affect
var/list/player_levels = list(1, 3, 4, 5, 6) // Defines all Z-levels a character can typically reach
var/list/sealed_levels = list() // Defines levels that do not allow random transit at the edges.
// Event settings
var/expected_round_length = 3 * 60 * 60 * 10 // 3 hours
@@ -226,10 +238,20 @@ var/list/gamemode_cache = list()
//Mark-up enabling
var/allow_chat_markup = 0
var/list/language_prefixes = list(",","#","-")//Default language prefixes
var/ghosts_can_possess_animals = 0
var/delist_when_no_admins = 0
//Snowflake antag contest boolean
//AUG2016
var/antag_contest_enabled = 0
//API Rate limiting
var/api_rate_limit = 50
var/list/api_rate_limit_whitelist = list()
/datum/configuration/New()
var/list/L = typesof(/datum/game_mode) - /datum/game_mode
for (var/T in L)
@@ -286,6 +308,9 @@ var/list/gamemode_cache = list()
if ("use_age_restriction_for_jobs")
config.use_age_restriction_for_jobs = 1
if ("use_age_restriction_for_antags")
config.use_age_restriction_for_antags = 1
if ("jobs_have_minimal_access")
config.jobs_have_minimal_access = 1
@@ -344,11 +369,14 @@ var/list/gamemode_cache = list()
config.log_hrefs = 1
if ("log_runtime")
config.log_runtime = 1
config.log_runtime = text2num(value)
if ("generate_asteroid")
config.generate_asteroid = 1
if ("no_click_cooldown")
config.no_click_cooldown = 1
if("allow_admin_ooccolor")
config.allow_admin_ooccolor = 1
@@ -400,8 +428,8 @@ var/list/gamemode_cache = list()
// if ("authentication")
// config.enable_authentication = 1
if ("norespawn")
config.respawn = 0
if ("respawn_delay")
config.respawn_delay = text2num(value)
if ("servername")
config.server_name = value
@@ -433,6 +461,9 @@ var/list/gamemode_cache = list()
if ("githuburl")
config.githuburl = value
if ("ghosts_can_possess_animals")
config.ghosts_can_possess_animals = value
if ("guest_jobban")
config.guest_jobban = 1
@@ -590,6 +621,15 @@ var/list/gamemode_cache = list()
if("ghost_interaction")
config.ghost_interaction = 1
if("night_lighting")
config.night_lighting = 1
if("nl_start_hour")
config.nl_start = text2num(value) * TICKS_IN_HOUR
if("nl_finish_hour")
config.nl_finish = text2num(value) * TICKS_IN_HOUR
if("disable_player_mice")
config.disable_player_mice = 1
@@ -696,6 +736,7 @@ var/list/gamemode_cache = list()
if("aggressive_changelog")
config.aggressive_changelog = 1
if("sql_whitelists")
config.sql_whitelists = 1
@@ -726,9 +767,26 @@ var/list/gamemode_cache = list()
if("sql_stats")
config.sql_stats = 1
if("default_language_prefixes")
var/list/values = text2list(value, " ")
if(values.len > 0)
language_prefixes = values
if ("lobby_screens")
config.lobby_screens = text2list(value, ";")
if("delist_when_no_admins")
config.delist_when_no_admins = 1
if("antag_contest_enabled")
config.antag_contest_enabled = 1
if("api_rate_limit")
config.api_rate_limit = text2num(value)
if("api_rate_limit_whitelist")
config.api_rate_limit_whitelist = text2list(value, ";")
else
log_misc("Unknown setting in configuration: '[name]'")
@@ -767,11 +825,17 @@ var/list/gamemode_cache = list()
if("limbs_can_break")
config.limbs_can_break = value
if("run_speed")
config.run_speed = value
if("walk_speed")
config.walk_speed = value
// These should never go to 0 or below. So, we clamp them.
if("walk_delay_multiplier")
config.walk_delay_multiplier = max(0.1, value)
if("run_delay_multiplier")
config.run_delay_multiplier = max(0.1, value)
if("vehicle_delay_multiplier")
config.vehicle_delay_multiplier = max(0.1, value)
if("human_delay")
config.human_delay = value
if("robot_delay")
@@ -797,6 +861,22 @@ var/list/gamemode_cache = list()
age_restrictions += name
age_restrictions[name] = text2num(value)
else if (type == "discord")
// Ideally, this would never happen. But just in case.
if (!discord_bot)
log_debug("BOREALIS: Attempted to read config/discord.txt before initializing the bot.")
return
switch (name)
if ("token")
discord_bot.auth_token = value
if ("active")
discord_bot.active = 1
if ("robust_debug")
discord_bot.robust_debug = 1
else
log_misc("Unknown setting in discord configuration: '[name]'")
/datum/configuration/proc/pick_mode(mode_name)
// I wish I didn't have to instance the game modes in order to look up
// their information, but it is the only way (at least that I know of).
@@ -48,7 +48,7 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle
if (evac)
emergency_shuttle_docked.Announce("The Emergency Shuttle has docked with the station. You have approximately [round(estimate_launch_time()/60,1)] minutes to board the Emergency Shuttle.")
else
priority_announcement.Announce("The scheduled Crew Transfer Shuttle has docked with the station. It will depart in approximately [round(emergency_shuttle.estimate_launch_time()/60,1)] minutes.")
priority_announcement.Announce("The scheduled Crew Transfer Shuttle to [dock_name] has docked with the station. It will depart in approximately [round(emergency_shuttle.estimate_launch_time()/60,1)] minutes.")
//arm the escape pods
if (evac)
@@ -94,7 +94,7 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle
//reset the shuttle transit time if we need to
shuttle.move_time = SHUTTLE_TRANSIT_DURATION
priority_announcement.Announce("A crew transfer has been scheduled. The shuttle has been called. It will arrive in approximately [round(estimate_arrival_time()/60)] minutes.")
priority_announcement.Announce("A crew transfer to [dock_name] has been scheduled. The shuttle has been called. It will arrive in approximately [round(estimate_arrival_time()/60)] minutes.")
//recalls the shuttle
/datum/emergency_shuttle_controller/proc/recall()
+87 -87
View File
@@ -1,87 +1,87 @@
/**
* Startup hook.
* Called in world.dm when the server starts.
*/
/hook/startup
/**
* Roundstart hook.
* Called in gameticker.dm when a round starts.
*/
/hook/roundstart
/**
* Roundend hook.
* Called in gameticker.dm when a round ends.
*/
/hook/roundend
/**
* Death hook.
* Called in death.dm when someone dies.
* Parameters: var/mob/living/carbon/human, var/gibbed
*/
/hook/death
/**
* Cloning hook.
* Called in cloning.dm when someone is brought back by the wonders of modern science.
* Parameters: var/mob/living/carbon/human
*/
/hook/clone
/**
* Debrained hook.
* Called in brain_item.dm when someone gets debrained.
* Parameters: var/obj/item/organ/brain
*/
/hook/debrain
/**
* Borged hook.
* Called in robot_parts.dm when someone gets turned into a cyborg.
* Parameters: var/mob/living/silicon/robot
*/
/hook/borgify
/**
* Podman hook.
* Called in podmen.dm when someone is brought back as a Diona.
* Parameters: var/mob/living/carbon/alien/diona
*/
/hook/harvest_podman
/**
* Payroll revoked hook.
* Called in Accounts_DB.dm when someone's payroll is stolen at the Accounts terminal.
* Parameters: var/datum/money_account
*/
/hook/revoke_payroll
/**
* Account suspension hook.
* Called in Accounts_DB.dm when someone's account is suspended or unsuspended at the Accounts terminal.
* Parameters: var/datum/money_account
*/
/hook/change_account_status
/**
* Employee reassignment hook.
* Called in card.dm when someone's card is reassigned at the HoP's desk.
* Parameters: var/obj/item/weapon/card/id
*/
/hook/reassign_employee
/**
* Employee terminated hook.
* Called in card.dm when someone's card is terminated at the HoP's desk.
* Parameters: var/obj/item/weapon/card/id
*/
/hook/terminate_employee
/**
* Crate sold hook.
* Called in supplyshuttle.dm when a crate is sold on the shuttle.
* Parameters: var/obj/structure/closet/crate/sold, var/area/shuttle
*/
/hook/sell_crate
/**
* Startup hook.
* Called in world.dm when the server starts.
*/
/hook/startup
/**
* Roundstart hook.
* Called in gameticker.dm when a round starts.
*/
/hook/roundstart
/**
* Roundend hook.
* Called in gameticker.dm when a round ends.
*/
/hook/roundend
/**
* Death hook.
* Called in death.dm when someone dies.
* Parameters: var/mob/living/carbon/human, var/gibbed
*/
/hook/death
/**
* Cloning hook.
* Called in cloning.dm when someone is brought back by the wonders of modern science.
* Parameters: var/mob/living/carbon/human
*/
/hook/clone
/**
* Debrained hook.
* Called in brain_item.dm when someone gets debrained.
* Parameters: var/obj/item/organ/brain
*/
/hook/debrain
/**
* Borged hook.
* Called in robot_parts.dm when someone gets turned into a cyborg.
* Parameters: var/mob/living/silicon/robot
*/
/hook/borgify
/**
* Podman hook.
* Called in podmen.dm when someone is brought back as a Diona.
* Parameters: var/mob/living/carbon/alien/diona
*/
/hook/harvest_podman
/**
* Payroll revoked hook.
* Called in Accounts_DB.dm when someone's payroll is stolen at the Accounts terminal.
* Parameters: var/datum/money_account
*/
/hook/revoke_payroll
/**
* Account suspension hook.
* Called in Accounts_DB.dm when someone's account is suspended or unsuspended at the Accounts terminal.
* Parameters: var/datum/money_account
*/
/hook/change_account_status
/**
* Employee reassignment hook.
* Called in card.dm when someone's card is reassigned at the HoP's desk.
* Parameters: var/obj/item/weapon/card/id
*/
/hook/reassign_employee
/**
* Employee terminated hook.
* Called in card.dm when someone's card is terminated at the HoP's desk.
* Parameters: var/obj/item/weapon/card/id
*/
/hook/terminate_employee
/**
* Crate sold hook.
* Called in supplyshuttle.dm when a crate is sold on the shuttle.
* Parameters: var/obj/structure/closet/crate/sold, var/area/shuttle
*/
/hook/sell_crate
+1 -1
View File
@@ -9,7 +9,7 @@
*
* To add some code to be called by the hook, define a proc under the type, as so:
* @code
/hook/foo/proc/bar()
hook/foo/proc/bar()
if(1)
return 1 //Sucessful
else
+14 -9
View File
@@ -12,7 +12,6 @@ var/global/pipe_processing_killed = 0
datum/controller/game_controller
var/list/shuttle_list // For debugging and VV
var/datum/random_map/ore/asteroid_ore_map // For debugging and VV.
datum/controller/game_controller/New()
//There can be only one master_controller. Out with the old and in with the new.
@@ -47,12 +46,18 @@ datum/controller/game_controller/proc/setup()
datum/controller/game_controller/proc/setup_objects()
admin_notice("<span class='danger'>Initializing objects</span>", R_DEBUG)
sleep(-1)
for(var/atom/movable/object in world)
object.initialize()
objects_initialized = 1
for(var/A in objects_init_list)
var/atom/movable/object = A
if(isnull(object.gcDestroyed))
object.initialize()
admin_notice("<span class='danger>Initializing areas</span>", R_DEBUG)
objects_init_list.Cut()
admin_notice("<span class='danger'>Initializing areas</span>", R_DEBUG)
sleep(-1)
for(var/area/area in all_areas)
for(var/A in all_areas)
var/area/area = A
area.initialize()
admin_notice("<span class='danger'>Initializing pipe networks</span>", R_DEBUG)
@@ -70,10 +75,10 @@ datum/controller/game_controller/proc/setup_objects()
var/obj/machinery/atmospherics/unary/vent_scrubber/T = U
T.broadcast_status()
// Create the mining ore distribution map.
// These values determine the specific area that the map is applied to.
// If you do not use the official Baycode asteroid map, you will need to change them.
asteroid_ore_map = new /datum/random_map/ore(null,13,32,5,217,223)
//Spawn the contents of the cargo warehouse
sleep(-1)
spawn_cargo_stock()
// Set up antagonists.
populate_antag_type_list()
+11 -11
View File
@@ -19,7 +19,7 @@ var/global/datum/shuttle_controller/shuttle_controller
var/datum/shuttle/shuttle = shuttles[shuttle_tag]
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
@@ -111,7 +111,7 @@ var/global/datum/shuttle_controller/shuttle_controller
shuttles["Escape Pod 1"],
shuttles["Escape Pod 2"],
shuttles["Escape Pod 3"],
shuttles["Escape Pod 5"],
shuttles["Escape Pod 5"]
)
// Supply shuttle
@@ -319,12 +319,12 @@ var/global/datum/shuttle_controller/shuttle_controller
"Fore Port Solars" = locate(/area/skipjack_station/northwest_solars),
"Aft Starboard Solars" = locate(/area/skipjack_station/southeast_solars),
"Aft Port Solars" = locate(/area/skipjack_station/southwest_solars),
"Mining asteroid" = locate(/area/skipjack_station/mining)
"Mining Station" = locate(/area/skipjack_station/mining)
)
VS.announcer = "NDV Icarus"
VS.arrival_message = "Attention, Exodus, we just tracked a small target bypassing our defensive perimeter. Can't fire on it without hitting the station - you've got incoming visitors, like it or not."
VS.departure_message = "Your guests are pulling away, Exodus - moving too fast for us to draw a bead on them. Looks like they're heading out of the system at a rapid clip."
VS.arrival_message = "Attention, [station_short], we just tracked a small target bypassing our defensive perimeter. Can't fire on it without hitting the station - you've got incoming visitors, like it or not."
VS.departure_message = "Your guests are pulling away, [station_short] - moving too fast for us to draw a bead on them. Looks like they're heading out of the system at a rapid clip."
VS.interim = locate(/area/skipjack_station/transit)
VS.warmup_time = 0
@@ -343,19 +343,19 @@ var/global/datum/shuttle_controller/shuttle_controller
"South of the station" = locate(/area/syndicate_station/south),
"Southeast of the station" = locate(/area/syndicate_station/southeast),
"Telecomms Satellite" = locate(/area/syndicate_station/commssat),
"Mining Asteroid" = locate(/area/syndicate_station/mining),
"Arrivals dock" = locate(/area/syndicate_station/arrivals_dock),
"Mining Station" = locate(/area/syndicate_station/mining),
"Arrivals dock" = locate(/area/syndicate_station/arrivals_dock)
)
MS.docking_controller_tag = "merc_shuttle"
MS.destination_dock_targets = list(
"Mercenary Base" = "merc_base",
"Arrivals dock" = "nuke_shuttle_dock_airlock",
"Arrivals dock" = "nuke_shuttle_dock_airlock"
)
MS.announcer = "NDV Icarus"
MS.arrival_message = "Attention, Exodus, you have a large signature approaching the station - looks unarmed to surface scans. We're too far out to intercept - brace for visitors."
MS.departure_message = "Your visitors are on their way out of the system, Exodus, burning delta-v like it's nothing. Good riddance."
MS.arrival_message = "Attention, [station_short], you have a large signature approaching the station - looks unarmed to surface scans. We're too far out to intercept - brace for visitors."
MS.departure_message = "Your visitors are on their way out of the system, [station_short], burning delta-v like it's nothing. Good riddance."
MS.interim = locate(/area/syndicate_station/transit)
MS.warmup_time = 0
+10 -31
View File
@@ -1,35 +1,5 @@
//TODO: rewrite and standardise all controller datums to the datum/controller type
//TODO: allow all controllers to be deleted for clean restarts (see WIP master controller stuff) - MC done - lighting done
/client/proc/print_random_map()
set category = "Debug"
set name = "Display Random Map"
set desc = "Show the contents of a random map."
if(!holder) return
var/datum/random_map/choice = input("Choose a map to debug.") as null|anything in random_maps
if(!choice)
return
choice.display_map(usr)
/client/proc/create_random_map()
set category = "Debug"
set name = "Create Random Map"
set desc = "Create a random map."
if(!holder) return
var/map_datum = input("Choose a map to create.") as null|anything in typesof(/datum/random_map)-/datum/random_map
if(!map_datum)
return
var/seed = input("Seed? (default null)") as text|null
var/tx = input("X? (default 1)") as text|null
var/ty = input("Y? (default 1)") as text|null
var/tz = input("Z? (default 1)") as text|null
new map_datum(seed,tx,ty,tz)
/client/proc/restart_controller(controller in list("Supply"))
set category = "Debug"
set name = "Restart Controller"
@@ -55,7 +25,7 @@
usr.client.debug_variables(antag)
message_admins("Admin [key_name_admin(usr)] is debugging the [antag.role_text] template.")
/client/proc/debug_controller(controller in list("Master","Ticker","Ticker Process","Air","Jobs","Sun","Radio","Supply","Shuttles","Emergency Shuttle","Configuration","pAI", "Cameras", "Transfer Controller", "Gas Data","Event","Plants","Alarm","Nano"))
/client/proc/debug_controller(controller in list("Master","Ticker","Ticker Process","Air","Jobs","Sun","Radio","Supply","Shuttles","Emergency Shuttle","Configuration","pAI", "Cameras", "Transfer Controller", "Gas Data","Event","Plants","Alarm","Nano","Chemistry","Wireless","Observation"))
set category = "Debug"
set name = "Debug Controller"
set desc = "Debug the various periodic loop controllers for the game (be careful!)"
@@ -119,5 +89,14 @@
if("Nano")
debug_variables(nanomanager)
feedback_add_details("admin_verb", "DNano")
if("Chemistry")
debug_variables(chemistryProcess)
feedback_add_details("admin_verb", "DChem")
if("Wireless")
debug_variables(wirelessProcess)
feedback_add_details("admin_verb", "DWifi")
if("Observation")
debug_variables(all_observable_events)
feedback_add_details("admin_verb", "DObservation")
message_admins("Admin [key_name_admin(usr)] is debugging the [controller] controller.")
return
+11 -8
View File
@@ -178,8 +178,8 @@ datum/controller/vote
additional_antag_types |= antag_names_to_ids[.]
if(mode == "gamemode") //fire this even if the vote fails.
if(!going)
going = 1
if(!round_progressing)
round_progressing = 1
world << "<font color='red'><b>The round will start soon.</b></font>"
if(restart)
@@ -285,8 +285,8 @@ datum/controller/vote
world << sound('sound/ambience/alarm4.ogg', repeat = 0, wait = 0, volume = 50, channel = 3)
if("custom")
world << sound('sound/ambience/alarm4.ogg', repeat = 0, wait = 0, volume = 50, channel = 3)
if(mode == "gamemode" && going)
going = 0
if(mode == "gamemode" && round_progressing)
round_progressing = 0
world << "<font color='red'><b>Round start has been delayed.</b></font>"
time_remaining = round(config.vote_period/10)
@@ -307,7 +307,7 @@ datum/controller/vote
else . += "<h2>Vote: [capitalize(mode)]</h2>"
. += "Time Left: [time_remaining] s<hr>"
. += "<table width = '100%'><tr><td align = 'center'><b>Choices</b></td><td align = 'center'><b>Votes</b></td>"
if(capitalize(mode) == "Gamemode") .+= "<td align = 'center'><b>Minimum Players</b></td></b></tr>"
if(capitalize(mode) == "Gamemode") .+= "<td align = 'center'><b>Minimum Players</b></td></tr>"
for(var/i = 1, i <= choices.len, i++)
var/votes = choices[choices[i]]
@@ -317,12 +317,12 @@ datum/controller/vote
if(current_votes[C.ckey] == i)
. += "<td><b><a href='?src=\ref[src];vote=[i]'>[gamemode_names[choices[i]]]</a></b></td><td align = 'center'>[votes]</td>"
else
. += "<td><a href='?src=\ref[src];vote=[i]'>[gamemode_names[choices[i]]]</a></b></td><td align = 'center'>[votes]</td>"
. += "<td><a href='?src=\ref[src];vote=[i]'>[gamemode_names[choices[i]]]</a></td><td align = 'center'>[votes]</td>"
else
if(current_votes[C.ckey] == i)
. += "<td><b><a href='?src=\ref[src];vote=[i]'>[choices[i]]</a></b></td><td align = 'center'>[votes]</td>"
else
. += "<td><a href='?src=\ref[src];vote=[i]'>[choices[i]]</a></b></td><td align = 'center'>[votes]</td>"
. += "<td><a href='?src=\ref[src];vote=[i]'>[choices[i]]</a></td><td align = 'center'>[votes]</td>"
if (additional_text.len >= i)
. += additional_text[i]
. += "</tr>"
@@ -339,7 +339,10 @@ datum/controller/vote
. += "<font color='grey'>Restart (Disallowed)</font>"
. += "</li><li>"
if(is_staff || config.allow_vote_restart)
. += "<a href='?src=\ref[src];vote=crew_transfer'>Crew Transfer</a>"
if (get_security_level() == "red" || get_security_level() == "delta")
. += "<a href='?src=\ref[src];vote=crew_transfer'>Crew Transfer (Disallowed, Code Red or above)</a>"
else
. += "<a href='?src=\ref[src];vote=crew_transfer'>Crew Transfer</a>"
else
. += "<font color='grey'>Crew Transfer (Disallowed)</font>"
if(is_staff)