* sdf

* fsda

* fuck

* fuck2

* toolz

* sdaf

* sdfa

* saf

* sdfa

* sdfa

* sdf

* sdfa

* temp rename

* temp rename

* temp rename

* sdaf

* the pain is immensurable in the land of byond

* the curse of rah

* safd

* sadf

* sadf

* gf

* asf

* fssdfa

* sfd

* sadf

* sfda

* brah

* brah

* it's easier for you to fix this

* ffs

* brah

* brah
This commit is contained in:
Fluffy
2024-01-06 17:03:57 +01:00
committed by GitHub
parent 8c76cfa9ea
commit e867030c2e
331 changed files with 2348 additions and 1643 deletions

View File

@@ -16,196 +16,201 @@
#include "code\names.dm"
#include "code\stylesheet.dm"
#include "code\__datastructures\stack.dm"
#include "code\__defines\_atoms.dm"
#include "code\__defines\_click.dm"
#include "code\__defines\_common.dm"
#include "code\__defines\_compile_helpers.dm"
#include "code\__defines\_flags.dm"
#include "code\__defines\_globals.dm"
#include "code\__defines\_layers.dm"
#include "code\__defines\_macros.dm"
#include "code\__defines\_protect.dm"
#include "code\__defines\_unit_tests.dm"
#include "code\__defines\_world.dm"
#include "code\__defines\access.dm"
#include "code\__defines\accessories.dm"
#include "code\__defines\admin.dm"
#include "code\__defines\antagonist.dm"
#include "code\__defines\armor.dm"
#include "code\__defines\assemblies.dm"
#include "code\__defines\atmos.dm"
#include "code\__defines\auxtools.dm"
#include "code\__defines\background.dm"
#include "code\__defines\battle_monsters.dm"
#include "code\__defines\byond_compat.dm"
#include "code\__defines\callback.dm"
#include "code\__defines\chemistry.dm"
#include "code\__defines\color.dm"
#include "code\__defines\components.dm"
#include "code\__defines\construction.dm"
#include "code\__defines\cooldowns.dm"
#include "code\__defines\damage_organs.dm"
#include "code\__defines\dna.dm"
#include "code\__defines\documents.dm"
#include "code\__defines\drinks.dm"
#include "code\__defines\dview.dm"
#include "code\__defines\economy.dm"
#include "code\__defines\emitter.dm"
#include "code\__defines\empulse.dm"
#include "code\__defines\evacuation.dm"
#include "code\__defines\feedback.dm"
#include "code\__defines\flags.dm"
#include "code\__defines\forensic_swabs.dm"
#include "code\__defines\gamemode.dm"
#include "code\__defines\ghostspawner.dm"
#include "code\__defines\global.dm"
#include "code\__defines\grab.dm"
#include "code\__defines\guns.dm"
#include "code\__defines\hallucinations.dm"
#include "code\__defines\hud.dm"
#include "code\__defines\hydroponics.dm"
#include "code\__defines\icon_layering.dm"
#include "code\__defines\important_recursive_contents.dm"
#include "code\__defines\items_clothing.dm"
#include "code\__defines\jobs.dm"
#include "code\__defines\lighting.dm"
#include "code\__defines\lists.dm"
#include "code\__defines\logging.dm"
#include "code\__defines\machinery.dm"
#include "code\__defines\manual_unit_testing.dm"
#include "code\__defines\master_controller.dm"
#include "code\__defines\materials.dm"
#include "code\__defines\math_physics.dm"
#include "code\__defines\minimap.dm"
#include "code\__defines\mining.dm"
#include "code\__defines\misc.dm"
#include "code\__defines\mobs.dm"
#include "code\__defines\modular_guns.dm"
#include "code\__defines\obj.dm"
#include "code\__defines\organs.dm"
#include "code\__defines\origin_traits.dm"
#include "code\__defines\outfit.dm"
#include "code\__defines\overmap.dm"
#include "code\__defines\pipes.dm"
#include "code\__defines\procpath.dm"
#include "code\__defines\profiler_tracy.dm"
#include "code\__defines\projectiles.dm"
#include "code\__defines\psi.dm"
#include "code\__defines\qdel.dm"
#include "code\__defines\radiation.dm"
#include "code\__defines\radio.dm"
#include "code\__defines\random_map.dm"
#include "code\__defines\regex.dm"
#include "code\__defines\research.dm"
#include "code\__defines\ruin_tags.dm"
#include "code\__defines\rust_g.dm"
#include "code\__defines\rust_g_debug.dm"
#include "code\__defines\ship_weapons.dm"
#include "code\__defines\shuttle.dm"
#include "code\__defines\singletons.dm"
#include "code\__defines\smart_token_bucket.dm"
#include "code\__defines\solar.dm"
#include "code\__defines\space_sectors.dm"
#include "code\__defines\spatial_gridmap.dm"
#include "code\__defines\species.dm"
#include "code\__defines\species_languages.dm"
#include "code\__defines\speech_channels.dm"
#include "code\__defines\stack_trace.dm"
#include "code\__defines\subsystem-defines.dm"
#include "code\__defines\subsystem-priority.dm"
#include "code\__defines\targeting.dm"
#include "code\__defines\technomancer.dm"
#include "code\__defines\text.dm"
#include "code\__defines\tgs.dm"
#include "code\__defines\tgui.dm"
#include "code\__defines\time.dm"
#include "code\__defines\tips.dm"
#include "code\__defines\traits.dm"
#include "code\__defines\turfs.dm"
#include "code\__defines\typeids.dm"
#include "code\__defines\verbs.dm"
#include "code\__defines\webhook.dm"
#include "code\__defines\wires.dm"
#include "code\__defines\xenoarch.dm"
#include "code\__defines\ZAS.dm"
#include "code\__defines\zcopy.dm"
#include "code\__defines\dcs\flags.dm"
#include "code\__defines\dcs\helpers.dm"
#include "code\__defines\dcs\signals.dm"
#include "code\__defines\dcs\signals\signals_global.dm"
#include "code\__defines\dcs\signals\signals_record.dm"
#include "code\__defines\dcs\signals\signals_atom\signals_atom_main.dm"
#include "code\__defines\dcs\signals\signals_atom\signals_atom_x_act.dm"
#include "code\__DEFINES\__globals.dm"
#include "code\__DEFINES\_atoms.dm"
#include "code\__DEFINES\_click.dm"
#include "code\__DEFINES\_common.dm"
#include "code\__DEFINES\_compile_helpers.dm"
#include "code\__DEFINES\_flags.dm"
#include "code\__DEFINES\_layers.dm"
#include "code\__DEFINES\_macros.dm"
#include "code\__DEFINES\_protect.dm"
#include "code\__DEFINES\_tick.dm"
#include "code\__DEFINES\_unit_tests.dm"
#include "code\__DEFINES\_world.dm"
#include "code\__DEFINES\access.dm"
#include "code\__DEFINES\accessories.dm"
#include "code\__DEFINES\admin.dm"
#include "code\__DEFINES\antagonist.dm"
#include "code\__DEFINES\armor.dm"
#include "code\__DEFINES\assemblies.dm"
#include "code\__DEFINES\atmos.dm"
#include "code\__DEFINES\auxtools.dm"
#include "code\__DEFINES\background.dm"
#include "code\__DEFINES\battle_monsters.dm"
#include "code\__DEFINES\byond_compat.dm"
#include "code\__DEFINES\callback.dm"
#include "code\__DEFINES\chemistry.dm"
#include "code\__DEFINES\color.dm"
#include "code\__DEFINES\components.dm"
#include "code\__DEFINES\construction.dm"
#include "code\__DEFINES\cooldowns.dm"
#include "code\__DEFINES\damage_organs.dm"
#include "code\__DEFINES\dna.dm"
#include "code\__DEFINES\documents.dm"
#include "code\__DEFINES\drinks.dm"
#include "code\__DEFINES\dview.dm"
#include "code\__DEFINES\economy.dm"
#include "code\__DEFINES\emitter.dm"
#include "code\__DEFINES\empulse.dm"
#include "code\__DEFINES\evacuation.dm"
#include "code\__DEFINES\feedback.dm"
#include "code\__DEFINES\flags.dm"
#include "code\__DEFINES\forensic_swabs.dm"
#include "code\__DEFINES\gamemode.dm"
#include "code\__DEFINES\ghostspawner.dm"
#include "code\__DEFINES\global.dm"
#include "code\__DEFINES\grab.dm"
#include "code\__DEFINES\guns.dm"
#include "code\__DEFINES\hallucinations.dm"
#include "code\__DEFINES\hud.dm"
#include "code\__DEFINES\hydroponics.dm"
#include "code\__DEFINES\icon_layering.dm"
#include "code\__DEFINES\important_recursive_contents.dm"
#include "code\__DEFINES\items_clothing.dm"
#include "code\__DEFINES\jobs.dm"
#include "code\__DEFINES\lighting.dm"
#include "code\__DEFINES\lists.dm"
#include "code\__DEFINES\logging.dm"
#include "code\__DEFINES\machinery.dm"
#include "code\__DEFINES\manual_unit_testing.dm"
#include "code\__DEFINES\materials.dm"
#include "code\__DEFINES\math_physics.dm"
#include "code\__DEFINES\MC.dm"
#include "code\__DEFINES\minimap.dm"
#include "code\__DEFINES\mining.dm"
#include "code\__DEFINES\misc.dm"
#include "code\__DEFINES\mobs.dm"
#include "code\__DEFINES\modular_guns.dm"
#include "code\__DEFINES\obj.dm"
#include "code\__DEFINES\organs.dm"
#include "code\__DEFINES\origin_traits.dm"
#include "code\__DEFINES\outfit.dm"
#include "code\__DEFINES\overmap.dm"
#include "code\__DEFINES\pipes.dm"
#include "code\__DEFINES\procpath.dm"
#include "code\__DEFINES\profiler_tracy.dm"
#include "code\__DEFINES\projectiles.dm"
#include "code\__DEFINES\psi.dm"
#include "code\__DEFINES\qdel.dm"
#include "code\__DEFINES\radiation.dm"
#include "code\__DEFINES\radio.dm"
#include "code\__DEFINES\random_map.dm"
#include "code\__DEFINES\regex.dm"
#include "code\__DEFINES\research.dm"
#include "code\__DEFINES\ruin_tags.dm"
#include "code\__DEFINES\rust_g.dm"
#include "code\__DEFINES\rust_g_debug.dm"
#include "code\__DEFINES\ship_weapons.dm"
#include "code\__DEFINES\shuttle.dm"
#include "code\__DEFINES\singletons.dm"
#include "code\__DEFINES\smart_token_bucket.dm"
#include "code\__DEFINES\solar.dm"
#include "code\__DEFINES\space_sectors.dm"
#include "code\__DEFINES\spatial_gridmap.dm"
#include "code\__DEFINES\species.dm"
#include "code\__DEFINES\species_languages.dm"
#include "code\__DEFINES\speech_channels.dm"
#include "code\__DEFINES\stack_trace.dm"
#include "code\__DEFINES\subsystem-priority.dm"
#include "code\__DEFINES\subsystems.dm"
#include "code\__DEFINES\targeting.dm"
#include "code\__DEFINES\technomancer.dm"
#include "code\__DEFINES\text.dm"
#include "code\__DEFINES\tgs.dm"
#include "code\__DEFINES\tgui.dm"
#include "code\__DEFINES\time.dm"
#include "code\__DEFINES\tips.dm"
#include "code\__DEFINES\traits.dm"
#include "code\__DEFINES\turfs.dm"
#include "code\__DEFINES\typeids.dm"
#include "code\__DEFINES\verbs.dm"
#include "code\__DEFINES\webhook.dm"
#include "code\__DEFINES\wires.dm"
#include "code\__DEFINES\xenoarch.dm"
#include "code\__DEFINES\ZAS.dm"
#include "code\__DEFINES\zcopy.dm"
#include "code\__DEFINES\dcs\flags.dm"
#include "code\__DEFINES\dcs\helpers.dm"
#include "code\__DEFINES\dcs\signals.dm"
#include "code\__DEFINES\dcs\signals\signals_global.dm"
#include "code\__DEFINES\dcs\signals\signals_record.dm"
#include "code\__DEFINES\dcs\signals\signals_subsystem.dm"
#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_main.dm"
#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_x_act.dm"
#include "code\__HELPERS\_global_objects.dm"
#include "code\__HELPERS\_lists.dm"
#include "code\__HELPERS\_string_lists.dm"
#include "code\__HELPERS\area_movement.dm"
#include "code\__HELPERS\areas.dm"
#include "code\__HELPERS\atmospherics.dm"
#include "code\__HELPERS\atoms.dm"
#include "code\__HELPERS\data_structures.dm"
#include "code\__HELPERS\dll_call.dm"
#include "code\__HELPERS\files.dm"
#include "code\__HELPERS\functional.dm"
#include "code\__HELPERS\game.dm"
#include "code\__HELPERS\global_lists.dm"
#include "code\__HELPERS\icon_smoothing.dm"
#include "code\__HELPERS\icons.dm"
#include "code\__HELPERS\images.dm"
#include "code\__HELPERS\lists.dm"
#include "code\__HELPERS\maths.dm"
#include "code\__HELPERS\matrices.dm"
#include "code\__HELPERS\mobs.dm"
#include "code\__HELPERS\mouse.dm"
#include "code\__HELPERS\nameof.dm"
#include "code\__HELPERS\names.dm"
#include "code\__HELPERS\overlay.dm"
#include "code\__HELPERS\overmap.dm"
#include "code\__HELPERS\sanitize_values.dm"
#include "code\__HELPERS\shell.dm"
#include "code\__HELPERS\smart_token_bucket.dm"
#include "code\__HELPERS\spatial_info.dm"
#include "code\__HELPERS\spawn_sync.dm"
#include "code\__HELPERS\stack_trace.dm"
#include "code\__HELPERS\stoplag.dm"
#include "code\__HELPERS\text.dm"
#include "code\__HELPERS\time.dm"
#include "code\__HELPERS\turfs.dm"
#include "code\__HELPERS\type2type.dm"
#include "code\__HELPERS\unsorted.dm"
#include "code\__HELPERS\view.dm"
#include "code\__HELPERS\visual_filters.dm"
#include "code\__HELPERS\logging\_logging.dm"
#include "code\__HELPERS\logging\admin.dm"
#include "code\__HELPERS\logging\antagonists.dm"
#include "code\__HELPERS\logging\attack.dm"
#include "code\__HELPERS\logging\debug.dm"
#include "code\__HELPERS\logging\game.dm"
#include "code\__HELPERS\logging\loadout.dm"
#include "code\__HELPERS\logging\manifest.dm"
#include "code\__HELPERS\logging\paper.dm"
#include "code\__HELPERS\logging\pda.dm"
#include "code\__HELPERS\logging\talk.dm"
#include "code\__HELPERS\logging\tool.dm"
#include "code\__HELPERS\logging\misc\mapping.dm"
#include "code\__HELPERS\logging\modules\customitems.dm"
#include "code\__HELPERS\logging\modules\exoplanets.dm"
#include "code\__HELPERS\logging\modules\ghostroles.dm"
#include "code\__HELPERS\logging\modules\ruins.dm"
#include "code\__HELPERS\logging\modules\sectors.dm"
#include "code\__HELPERS\logging\subsystems\_subsystems.dm"
#include "code\__HELPERS\logging\subsystems\atlas.dm"
#include "code\__HELPERS\logging\subsystems\cargo.dm"
#include "code\__HELPERS\logging\subsystems\chemistry.dm"
#include "code\__HELPERS\logging\subsystems\discord.dm"
#include "code\__HELPERS\logging\subsystems\documents.dm"
#include "code\__HELPERS\logging\subsystems\fail2topic.dm"
#include "code\__HELPERS\logging\subsystems\garbage.dm"
#include "code\__HELPERS\logging\subsystems\ghostroles.dm"
#include "code\__HELPERS\logging\subsystems\law.dm"
#include "code\__HELPERS\logging\subsystems\mapfinalization.dm"
#include "code\__HELPERS\logging\subsystems\ZAS.dm"
#include "code\__HELPERS\sorting\__main.dm"
#include "code\__HELPERS\sorting\cmp.dm"
#include "code\__HELPERS\sorting\TimSort.dm"
#include "code\_global_vars\edible.dm"
#include "code\_helpers\_global_objects.dm"
#include "code\_helpers\_string_lists.dm"
#include "code\_helpers\area_movement.dm"
#include "code\_helpers\areas.dm"
#include "code\_helpers\atmospherics.dm"
#include "code\_helpers\atoms.dm"
#include "code\_helpers\data_structures.dm"
#include "code\_helpers\dll_call.dm"
#include "code\_helpers\files.dm"
#include "code\_helpers\functional.dm"
#include "code\_helpers\game.dm"
#include "code\_helpers\global_lists.dm"
#include "code\_helpers\icon_smoothing.dm"
#include "code\_helpers\icons.dm"
#include "code\_helpers\images.dm"
#include "code\_helpers\lists.dm"
#include "code\_helpers\maths.dm"
#include "code\_helpers\matrices.dm"
#include "code\_helpers\mobs.dm"
#include "code\_helpers\mouse.dm"
#include "code\_helpers\nameof.dm"
#include "code\_helpers\names.dm"
#include "code\_helpers\overlay.dm"
#include "code\_helpers\overmap.dm"
#include "code\_helpers\sanitize_values.dm"
#include "code\_helpers\smart_token_bucket.dm"
#include "code\_helpers\spatial_info.dm"
#include "code\_helpers\spawn_sync.dm"
#include "code\_helpers\stack_trace.dm"
#include "code\_helpers\text.dm"
#include "code\_helpers\time.dm"
#include "code\_helpers\turfs.dm"
#include "code\_helpers\type2type.dm"
#include "code\_helpers\unsorted.dm"
#include "code\_helpers\view.dm"
#include "code\_helpers\visual_filters.dm"
#include "code\_helpers\logging\_logging.dm"
#include "code\_helpers\logging\admin.dm"
#include "code\_helpers\logging\antagonists.dm"
#include "code\_helpers\logging\attack.dm"
#include "code\_helpers\logging\debug.dm"
#include "code\_helpers\logging\game.dm"
#include "code\_helpers\logging\loadout.dm"
#include "code\_helpers\logging\manifest.dm"
#include "code\_helpers\logging\paper.dm"
#include "code\_helpers\logging\pda.dm"
#include "code\_helpers\logging\talk.dm"
#include "code\_helpers\logging\tool.dm"
#include "code\_helpers\logging\misc\mapping.dm"
#include "code\_helpers\logging\modules\customitems.dm"
#include "code\_helpers\logging\modules\exoplanets.dm"
#include "code\_helpers\logging\modules\ghostroles.dm"
#include "code\_helpers\logging\modules\ruins.dm"
#include "code\_helpers\logging\modules\sectors.dm"
#include "code\_helpers\logging\subsystems\_subsystems.dm"
#include "code\_helpers\logging\subsystems\atlas.dm"
#include "code\_helpers\logging\subsystems\cargo.dm"
#include "code\_helpers\logging\subsystems\chemistry.dm"
#include "code\_helpers\logging\subsystems\discord.dm"
#include "code\_helpers\logging\subsystems\documents.dm"
#include "code\_helpers\logging\subsystems\fail2topic.dm"
#include "code\_helpers\logging\subsystems\garbage.dm"
#include "code\_helpers\logging\subsystems\ghostroles.dm"
#include "code\_helpers\logging\subsystems\law.dm"
#include "code\_helpers\logging\subsystems\mapfinalization.dm"
#include "code\_helpers\logging\subsystems\ZAS.dm"
#include "code\_helpers\sorting\__main.dm"
#include "code\_helpers\sorting\cmp.dm"
#include "code\_helpers\sorting\TimSort.dm"
#include "code\_onclick\adjacent.dm"
#include "code\_onclick\ai.dm"
#include "code\_onclick\click.dm"
@@ -241,13 +246,13 @@
#include "code\_onclick\hud\screen_object_types\vampire.dm"
#include "code\controllers\configuration.dm"
#include "code\controllers\controller.dm"
#include "code\controllers\failsafe.dm"
#include "code\controllers\globals.dm"
#include "code\controllers\hooks-defs.dm"
#include "code\controllers\hooks.dm"
#include "code\controllers\master.dm"
#include "code\controllers\verbs.dm"
#include "code\controllers\master\admin.dm"
#include "code\controllers\master\failsafe.dm"
#include "code\controllers\master\master.dm"
#include "code\controllers\master\subsystem.dm"
#include "code\controllers\subsystems\ai_obfuscation.dm"
#include "code\controllers\subsystems\air.dm"
@@ -389,6 +394,7 @@
#include "code\datums\helper_datums\away_mission.dm"
#include "code\datums\helper_datums\construction_datum.dm"
#include "code\datums\helper_datums\getrev.dm"
#include "code\datums\helper_datums\stack_end_detector.dm"
#include "code\datums\helper_datums\synthsprites.dm"
#include "code\datums\helper_datums\teleport.dm"
#include "code\datums\looping_sounds\_looping_sound.dm"
@@ -3523,6 +3529,7 @@
#include "code\ZAS\Turf.dm"
#include "code\ZAS\Variable Settings.dm"
#include "code\ZAS\Zone.dm"
#include "code\ze_genesis_call\genesis_call.dm"
#include "interface\interface.dm"
#include "interface\skin.dmf"
#include "maps\_common\areas\ai.dm"

146
code/__DEFINES/MC.dm Normal file
View File

@@ -0,0 +1,146 @@
#define MC_TICK_CHECK ( ( TICK_USAGE > Master.current_ticklimit || src.state != SS_RUNNING ) ? pause() : 0 )
#define MC_SPLIT_TICK_INIT(phase_count) var/original_tick_limit = Master.current_ticklimit; var/split_tick_phases = ##phase_count
#define MC_SPLIT_TICK \
if(split_tick_phases > 1){\
Master.current_ticklimit = ((original_tick_limit - TICK_USAGE) / split_tick_phases) + TICK_USAGE;\
--split_tick_phases;\
} else {\
Master.current_ticklimit = original_tick_limit;\
}
// Used to smooth out costs to try and avoid oscillation.
#define MC_AVERAGE_FAST(average, current) (0.7 * (average) + 0.3 * (current))
#define MC_AVERAGE(average, current) (0.8 * (average) + 0.2 * (current))
#define MC_AVERAGE_SLOW(average, current) (0.9 * (average) + 0.1 * (current))
#define MC_AVG_FAST_UP_SLOW_DOWN(average, current) (average > current ? MC_AVERAGE_SLOW(average, current) : MC_AVERAGE_FAST(average, current))
#define MC_AVG_SLOW_UP_FAST_DOWN(average, current) (average < current ? MC_AVERAGE_SLOW(average, current) : MC_AVERAGE_FAST(average, current))
///creates a running average of "things elapsed" per time period when you need to count via a smaller time period.
///eg you want an average number of things happening per second but you measure the event every tick (50 milliseconds).
///make sure both time intervals are in the same units. doesnt work if current_duration > total_duration or if total_duration == 0
#define MC_AVG_OVER_TIME(average, current, total_duration, current_duration) ((((total_duration) - (current_duration)) / (total_duration)) * (average) + (current))
#define MC_AVG_MINUTES(average, current, current_duration) (MC_AVG_OVER_TIME(average, current, 1 MINUTES, current_duration))
#define MC_AVG_SECONDS(average, current, current_duration) (MC_AVG_OVER_TIME(average, current, 1 SECONDS, current_duration))
#define NEW_SS_GLOBAL(varname) if(varname != src){if(istype(varname)){Recover();qdel(varname);}varname = src;}
// #define START_PROCESSING(Processor, Datum) if (!(Datum.datum_flags & DF_ISPROCESSING)) {Datum.datum_flags |= DF_ISPROCESSING;Processor.processing += Datum}
// #define STOP_PROCESSING(Processor, Datum) Datum.datum_flags &= ~DF_ISPROCESSING;Processor.processing -= Datum;Processor.currentrun -= Datum
/// Returns true if the MC is initialized and running.
/// Optional argument init_stage controls what stage the mc must have initializted to count as initialized. Defaults to INITSTAGE_MAX if not specified.
#define MC_RUNNING(INIT_STAGE...) (Master && Master.processing > 0 && Master.current_runlevel && Master.init_stage_completed == (max(min(INITSTAGE_MAX, ##INIT_STAGE), 1)))
#define MC_LOOP_RTN_NEWSTAGES 1
#define MC_LOOP_RTN_GRACEFUL_EXIT 2
//! SubSystem flags (Please design any new flags so that the default is off, to make adding flags to subsystems easier)
/// subsystem does not initialize.
#define SS_NO_INIT (1 << 0)
/** subsystem does not fire. */
/// (like can_fire = 0, but keeps it from getting added to the processing subsystems list)
/// (Requires a MC restart to change)
#define SS_NO_FIRE (1 << 1)
/** Subsystem only runs on spare cpu (after all non-background subsystems have ran that tick) */
/// SS_BACKGROUND has its own priority bracket, this overrides SS_TICKER's priority bump
#define SS_BACKGROUND (1 << 2)
/** Treat wait as a tick count, not DS, run every wait ticks. */
/// (also forces it to run first in the tick (unless SS_BACKGROUND))
/// (We don't want to be choked out by other subsystems queuing into us)
/// (implies all runlevels because of how it works)
/// This is designed for basically anything that works as a mini-mc (like SStimer)
#define SS_TICKER (1 << 3)
/** keep the subsystem's timing on point by firing early if it fired late last fire because of lag */
/// ie: if a 20ds subsystem fires say 5 ds late due to lag or what not, its next fire would be in 15ds, not 20ds.
#define SS_KEEP_TIMING (1 << 4)
/** Calculate its next fire after its fired. */
/// (IE: if a 5ds wait SS takes 2ds to run, its next fire should be 5ds away, not 3ds like it normally would be)
/// This flag overrides SS_KEEP_TIMING
#define SS_POST_FIRE_TIMING (1 << 5)
/// If this subsystem doesn't initialize, it should not report as a hard error in CI.
/// This should be used for subsystems that are flaky for complicated reasons, such as
/// the Lua subsystem, which relies on auxtools, which is unstable.
/// It should not be used simply to silence CI.
#define SS_OK_TO_FAIL_INIT (1 << 6)
//! SUBSYSTEM STATES
#define SS_IDLE 0 /// ain't doing shit.
#define SS_QUEUED 1 /// queued to run
#define SS_RUNNING 2 /// actively running
#define SS_PAUSED 3 /// paused by mc_tick_check
#define SS_SLEEPING 4 /// fire() slept.
#define SS_PAUSING 5 /// in the middle of pausing
// Subsystem init stages
#define INITSTAGE_EARLY 1 //! Early init stuff that doesn't need to wait for mapload
#define INITSTAGE_MAIN 2 //! Main init stage
#define INITSTAGE_MAX 2 //! Highest initstage.
#define SUBSYSTEM_DEF(X) GLOBAL_REAL(SS##X, /datum/controller/subsystem/##X);\
/datum/controller/subsystem/##X/New(){\
NEW_SS_GLOBAL(SS##X);\
PreInit();\
}\
/datum/controller/subsystem/##X
#define TIMER_SUBSYSTEM_DEF(X) GLOBAL_REAL(SS##X, /datum/controller/subsystem/timer/##X);\
/datum/controller/subsystem/timer/##X/New(){\
NEW_SS_GLOBAL(SS##X);\
PreInit();\
}\
/datum/controller/subsystem/timer/##X/fire() {..() /*just so it shows up on the profiler*/} \
/datum/controller/subsystem/timer/##X
#define MOVEMENT_SUBSYSTEM_DEF(X) GLOBAL_REAL(SS##X, /datum/controller/subsystem/movement/##X);\
/datum/controller/subsystem/movement/##X/New(){\
NEW_SS_GLOBAL(SS##X);\
PreInit();\
}\
/datum/controller/subsystem/movement/##X/fire() {..() /*just so it shows up on the profiler*/} \
/datum/controller/subsystem/movement/##X
#define PROCESSING_SUBSYSTEM_DEF(X) GLOBAL_REAL(SS##X, /datum/controller/subsystem/processing/##X);\
/datum/controller/subsystem/processing/##X/New(){\
NEW_SS_GLOBAL(SS##X);\
PreInit();\
}\
/datum/controller/subsystem/processing/##X/fire() {..() /*just so it shows up on the profiler*/} \
/datum/controller/subsystem/processing/##X
#define FLUID_SUBSYSTEM_DEF(X) GLOBAL_REAL(SS##X, /datum/controller/subsystem/fluids/##X);\
/datum/controller/subsystem/fluids/##X/New(){\
NEW_SS_GLOBAL(SS##X);\
PreInit();\
}\
/datum/controller/subsystem/fluids/##X/fire() {..() /*just so it shows up on the profiler*/} \
/datum/controller/subsystem/fluids/##X
#define VERB_MANAGER_SUBSYSTEM_DEF(X) GLOBAL_REAL(SS##X, /datum/controller/subsystem/verb_manager/##X);\
/datum/controller/subsystem/verb_manager/##X/New(){\
NEW_SS_GLOBAL(SS##X);\
PreInit();\
}\
/datum/controller/subsystem/verb_manager/##X/fire() {..() /*just so it shows up on the profiler*/} \
/datum/controller/subsystem/verb_manager/##X
//Aurora shit
#define GAME_STATE 2 ** (Master.current_runlevel - 1)
#define MOB_AI_SUBSYSTEM_DEF(X) GLOBAL_REAL(SS##X, /datum/controller/subsystem/mob_ai/##X);\
/datum/controller/subsystem/mob_ai/##X/New(){\
NEW_SS_GLOBAL(SS##X);\
PreInit();\
}\
/datum/controller/subsystem/mob_ai/##X/fire() {..() /*just so it shows up on the profiler*/} \
/datum/controller/subsystem/mob_ai/##X

7
code/__DEFINES/_flags.dm Normal file
View File

@@ -0,0 +1,7 @@
#define ALL (~0) //For convenience.
#define NONE 0
GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768))
///Whether /atom/Initialize() has already run for the object
#define INITIALIZED_1 (1<<5)

31
code/__DEFINES/_tick.dm Normal file
View File

@@ -0,0 +1,31 @@
/// Percentage of tick to leave for master controller to run
#define MAPTICK_MC_MIN_RESERVE 70
#define MAPTICK_LAST_INTERNAL_TICK_USAGE (world.map_cpu)
/// Tick limit while running normally
#define TICK_BYOND_RESERVE 2
#define TICK_LIMIT_RUNNING (max(100 - TICK_BYOND_RESERVE - MAPTICK_LAST_INTERNAL_TICK_USAGE, MAPTICK_MC_MIN_RESERVE))
/// Tick limit used to resume things in stoplag
#define TICK_LIMIT_TO_RUN 70
/// Tick limit for MC while running
#define TICK_LIMIT_MC 70
/// for general usage of tick_usage
#define TICK_USAGE world.tick_usage
/// to be used where the result isn't checked
#define TICK_USAGE_REAL world.tick_usage
/// Returns true if tick_usage is above the limit
#define TICK_CHECK ( TICK_USAGE > Master.current_ticklimit )
/// runs stoplag if tick_usage is above the limit
#define CHECK_TICK ( TICK_CHECK ? stoplag() : 0 )
/// Checks if a sleeping proc is running before or after the master controller
#define RUNNING_BEFORE_MASTER ( Master.last_run != null && Master.last_run != world.time )
/// Returns true if a verb ought to yield to the MC (IE: queue up to be processed by a subsystem)
#define VERB_SHOULD_YIELD ( TICK_CHECK || RUNNING_BEFORE_MASTER )
/// Returns true if tick usage is above 95, for high priority usage
#define TICK_CHECK_HIGH_PRIORITY ( TICK_USAGE > 95 )
/// runs stoplag if tick_usage is above 95, for high priority usage
#define CHECK_TICK_HIGH_PRIORITY ( TICK_CHECK_HIGH_PRIORITY? stoplag() : 0 )

View File

@@ -7,16 +7,6 @@
/proc/enable_debugging(mode, port)
CRASH("auxtools not loaded")
// Remove byond version check when spacemanDMM / auxtools are updated to 515
// otherwise your world/New will conk out and die
/world/New()
if(byond_version < 515)
var/debug_server = world.GetConfig("env", "AUXTOOLS_DEBUG_DLL")
if (debug_server)
call(debug_server, "auxtools_init")()
enable_debugging()
. = ..()
/world/Del()
if(byond_version < 515)
var/debug_server = world.GetConfig("env", "AUXTOOLS_DEBUG_DLL")

View File

@@ -0,0 +1,7 @@
// Subsystem signals. Format:
// When the signal is called: (signal arguments)
// All signals send the source datum of the signal as the first argument
///Subsystem signals
///From base of datum/controller/subsystem/Initialize
#define COMSIG_SUBSYSTEM_POST_INITIALIZE "subsystem_post_initialize"

14
code/__DEFINES/dview.dm Normal file
View File

@@ -0,0 +1,14 @@
//DVIEW defines
#define FOR_DVIEW(type, range, center, invis_flags) \
GLOB.dview_mob.loc = center; \
GLOB.dview_mob.see_invisible = invis_flags; \
for(type in view(range, GLOB.dview_mob))
#define END_FOR_DVIEW GLOB.dview_mob.loc = null
#define DVIEW(output, range, center, invis_flags) \
GLOB.dview_mob.loc = center; \
GLOB.dview_mob.see_invisible = invis_flags; \
output = view(range, GLOB.dview_mob); \
GLOB.dview_mob.loc = null;

View File

@@ -14,6 +14,7 @@
//wrapper macros for easier grepping
#define DIRECT_OUTPUT(A, B) A << B
#define SEND_TEXT(target, text) DIRECT_OUTPUT(target, text)
#define WRITE_FILE(file, text) DIRECT_OUTPUT(file, text)
#define WARNING(MSG) warning("[MSG] in [__FILE__] at line [__LINE__] src: [src] usr: [usr].")

View File

@@ -1,9 +1,5 @@
#define DEBUG
// Flags
#define ALL (~0) //For convenience.
#define NONE 0
// Turf-only flags.
#define TURF_FLAG_NOJAUNT 1
#define TURF_FLAG_BACKGROUND 2 // Used by shuttle movement to determine if it should be ignored by turf translation.
@@ -270,22 +266,6 @@
// Law settings
#define PERMABRIG_SENTENCE 90 // Measured in minutes
/// for general usage of tick_usage
#define TICK_USAGE world.tick_usage
/// to be used where the result isn't checked
#define TICK_USAGE_REAL world.tick_usage
// Stoplag.
#define TICK_CHECK (TICK_USAGE > CURRENT_TICKLIMIT)
/// runs stoplag if tick_usage is above the limit
#define CHECK_TICK ( TICK_CHECK ? stoplag() : 0 )
/// Returns true if tick usage is above 95, for high priority usage
#define TICK_CHECK_HIGH_PRIORITY ( TICK_USAGE > 95 )
/// runs stoplag if tick_usage is above 95, for high priority usage
#define CHECK_TICK_HIGH_PRIORITY ( TICK_CHECK_HIGH_PRIORITY ? stoplag() : 0 )
// Performance bullshit.
//supposedly the fastest way to do this according to https://gist.github.com/Giacom/be635398926bb463b42a

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