mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-24 17:11:22 +00:00
changes: Airlocks no longer tick (exceptions: firedoors, uranium airlocks) Airlock commands run before round-start are queued to run at round-start. Airlock commands that failed to run are scheduled to try again in 2 seconds with timers. Callbacks can now be registered with SSticker to run at round-start in a non-blocking way. Added a new subsystem (SSpower) for handling power-related functions. Currently doesn't do a whole lot, but this will likely eventually change. RCON functionality has been moved from SSmachinery to SSpower. The global cable list has been moved into SSpower. Powernet sensors no longer process purely to keep themselves in the global machines list, instead they are added to a list in SSpower. Power terminals no longer pointlessly tick. Removed some variables from SSticker that weren't used by anything. Holographic overlays such as those used by consoles are now cached. Xenoarcheology setup is now tick-checked. ZAS now uses post-fire timing. The req_access and req_one_access lists are no longer initialized by default on all /obj types. Openturfs will only emit starlight if they are bordering a non-openturf dynamically lit turf. Powernets are now stored in SSpower instead of being a global. The global mouse list is now stored in SSmob instead of being a global. Fixed some weirdness in APCs' Destroy() caused by a merge. SSwireless now pre-bakes to reduce round-start processing. SSwireless no longer uses processing queues.
97 lines
3.1 KiB
Plaintext
97 lines
3.1 KiB
Plaintext
var/datum/controller/subsystem/xenoarch/SSxenoarch
|
|
|
|
#define XENOARCH_SPAWN_CHANCE 0.5
|
|
#define DIGSITESIZE_LOWER 4
|
|
#define DIGSITESIZE_UPPER 12
|
|
#define ARTIFACTSPAWNNUM_LOWER 6
|
|
#define ARTIFACTSPAWNNUM_UPPER 12
|
|
|
|
/datum/controller/subsystem/xenoarch
|
|
name = "Xenoarcheology"
|
|
flags = SS_NO_FIRE
|
|
init_order = SS_INIT_MISC
|
|
|
|
var/list/artifact_spawning_turfs = list()
|
|
var/list/digsite_spawning_turfs = list()
|
|
|
|
/datum/controller/subsystem/xenoarch/New()
|
|
NEW_SS_GLOBAL(SSxenoarch)
|
|
|
|
/datum/controller/subsystem/xenoarch/Initialize(timeofday)
|
|
//create digsites
|
|
for(var/turf/simulated/mineral/M in turfs)
|
|
CHECK_TICK
|
|
if(!M.geologic_data)
|
|
M.geologic_data = new/datum/geosample(M)
|
|
|
|
if(!prob(XENOARCH_SPAWN_CHANCE))
|
|
continue
|
|
|
|
digsite_spawning_turfs.Add(M)
|
|
var/digsite = get_random_digsite_type()
|
|
var/target_digsite_size = rand(DIGSITESIZE_LOWER, DIGSITESIZE_UPPER)
|
|
var/list/processed_turfs = list()
|
|
var/list/turfs_to_process = list(M)
|
|
while(turfs_to_process.len)
|
|
var/turf/simulated/mineral/archeo_turf = pop(turfs_to_process)
|
|
|
|
if(target_digsite_size > 1)
|
|
var/list/viable_adjacent_turfs = orange(1, archeo_turf)
|
|
for(var/turf/simulated/mineral/T in orange(1, archeo_turf))
|
|
if(T.finds)
|
|
continue
|
|
if(T in processed_turfs)
|
|
continue
|
|
viable_adjacent_turfs.Add(T)
|
|
|
|
for(var/turf/simulated/mineral/T in viable_adjacent_turfs)
|
|
if(prob(target_digsite_size/viable_adjacent_turfs.len))
|
|
turfs_to_process.Add(T)
|
|
target_digsite_size -= 1
|
|
if(target_digsite_size <= 0)
|
|
break
|
|
|
|
processed_turfs.Add(archeo_turf)
|
|
if(isnull(archeo_turf.finds))
|
|
archeo_turf.finds = list()
|
|
if(prob(50))
|
|
archeo_turf.finds.Add(new /datum/find(digsite, rand(5,95)))
|
|
else if(prob(75))
|
|
archeo_turf.finds.Add(new /datum/find(digsite, rand(5,45)))
|
|
archeo_turf.finds.Add(new /datum/find(digsite, rand(55,95)))
|
|
else
|
|
archeo_turf.finds.Add(new /datum/find(digsite, rand(5,30)))
|
|
archeo_turf.finds.Add(new /datum/find(digsite, rand(35,75)))
|
|
archeo_turf.finds.Add(new /datum/find(digsite, rand(75,95)))
|
|
|
|
//sometimes a find will be close enough to the surface to show
|
|
var/datum/find/F = archeo_turf.finds[1]
|
|
if(F.excavation_required <= F.view_range)
|
|
archeo_turf.archaeo_overlay = "overlay_archaeo[rand(1,3)]"
|
|
archeo_turf.overlays += archeo_turf.archaeo_overlay
|
|
|
|
//have a chance for an artifact to spawn here, but not in animal or plant digsites
|
|
if(isnull(M.artifact_find) && digsite != 1 && digsite != 2)
|
|
artifact_spawning_turfs.Add(archeo_turf)
|
|
|
|
CHECK_TICK
|
|
|
|
//create artifact machinery
|
|
var/num_artifacts_spawn = rand(ARTIFACTSPAWNNUM_LOWER, ARTIFACTSPAWNNUM_UPPER)
|
|
while(artifact_spawning_turfs.len > num_artifacts_spawn)
|
|
pick_n_take(artifact_spawning_turfs)
|
|
|
|
var/list/artifacts_spawnturf_temp = artifact_spawning_turfs.Copy()
|
|
while(artifacts_spawnturf_temp.len > 0)
|
|
var/turf/simulated/mineral/artifact_turf = pop(artifacts_spawnturf_temp)
|
|
artifact_turf.artifact_find = new()
|
|
|
|
..()
|
|
|
|
|
|
#undef XENOARCH_SPAWN_CHANCE
|
|
#undef DIGSITESIZE_LOWER
|
|
#undef DIGSITESIZE_UPPER
|
|
#undef ARTIFACTSPAWNNUM_LOWER
|
|
#undef ARTIFACTSPAWNNUM_UPPER
|