diff --git a/.tgs4.yml b/.tgs4.yml index 932a3a6672ff..d137f1dbc8a8 100644 --- a/.tgs4.yml +++ b/.tgs4.yml @@ -2,6 +2,7 @@ static_files: - name: config populate: true - name: data + - name: tmp linux_scripts: PreCompile.sh: tools/tgs4_scripts/PreCompile.sh windows_scripts: diff --git a/README.md b/README.md index 8b1f8b6807bb..b0228569fead 100644 --- a/README.md +++ b/README.md @@ -56,8 +56,12 @@ These are also the folders you are likely going to encounter while managing the - /config: server configuration - /legacy: legacy configuration data go in here - /data: server persistent data + - /asset-cache - default location for caching of generated assets + - /asset-root - default location for generated assets to be served in webroot mode - /logs: logs are dumped in here - /players: player data, like saves and characters get dumped in here +- /tmp: server scratch space + - /assets - for asset generation You only need to make the top level folders (e.g. config, data) static folders in TGS4. diff --git a/SQL/database_schema.sql b/SQL/database_schema.sql index f7237e6ac2db..f1b50df6fd40 100644 --- a/SQL/database_schema.sql +++ b/SQL/database_schema.sql @@ -381,13 +381,6 @@ CREATE TABLE IF NOT EXISTS `%_PREFIX_%privacy` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -CREATE TABLE IF NOT EXISTS `%_PREFIX_%vr_player_hours` ( - `ckey` varchar(32) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL, - `department` varchar(64) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL, - `hours` double NOT NULL, - PRIMARY KEY (`ckey`,`department`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; - CREATE TABLE IF NOT EXISTS `%_PREFIX_%death` ( `id` INT(11) NOT NULL AUTO_INCREMENT , `pod` TEXT NOT NULL COMMENT 'Place of death' , diff --git a/citadel.dme b/citadel.dme index dc6f673517fc..decb8575d4d4 100644 --- a/citadel.dme +++ b/citadel.dme @@ -46,6 +46,7 @@ #include "code\__DEFINES\dna.dm" #include "code\__DEFINES\event_args.dm" #include "code\__DEFINES\fonts.dm" +#include "code\__DEFINES\frames.dm" #include "code\__DEFINES\gamemode.dm" #include "code\__DEFINES\holidays.dm" #include "code\__DEFINES\holomap.dm" @@ -149,6 +150,7 @@ #include "code\__DEFINES\combat\shieldcall.dm" #include "code\__DEFINES\controllers\_repositories.dm" #include "code\__DEFINES\controllers\_subsystems.dm" +#include "code\__DEFINES\controllers\assets.dm" #include "code\__DEFINES\controllers\dbcore.dm" #include "code\__DEFINES\controllers\persistence.dm" #include "code\__DEFINES\controllers\processing.dm" @@ -159,10 +161,10 @@ #include "code\__DEFINES\dcs\flags.dm" #include "code\__DEFINES\dcs\helpers.dm" #include "code\__DEFINES\dcs\components\riding.dm" +#include "code\__DEFINES\dcs\signals\global_signals.dm" #include "code\__DEFINES\dcs\signals\signals_area.dm" #include "code\__DEFINES\dcs\signals\signals_datum.dm" #include "code\__DEFINES\dcs\signals\signals_fish.dm" -#include "code\__DEFINES\dcs\signals\signals_global.dm" #include "code\__DEFINES\dcs\signals\signals_object.dm" #include "code\__DEFINES\dcs\signals\signals_turf.dm" #include "code\__DEFINES\dcs\signals\datums\signals_beam.dm" @@ -255,6 +257,7 @@ #include "code\__DEFINES\mobs\mobility.dm" #include "code\__DEFINES\mobs\mobs.dm" #include "code\__DEFINES\mobs\organs.dm" +#include "code\__DEFINES\mobs\rendering.dm" #include "code\__DEFINES\mobs\silicon_privileges.dm" #include "code\__DEFINES\mobs\sprite_accessories.dm" #include "code\__DEFINES\mobs\stat.dm" @@ -357,6 +360,7 @@ #include "code\__HELPERS\stoplag.dm" #include "code\__HELPERS\storage.dm" #include "code\__HELPERS\text.dm" +#include "code\__HELPERS\thermal.dm" #include "code\__HELPERS\time.dm" #include "code\__HELPERS\turfs.dm" #include "code\__HELPERS\type_processing.dm" @@ -381,6 +385,7 @@ #include "code\__HELPERS\icons\flatten.dm" #include "code\__HELPERS\icons\hologram.dm" #include "code\__HELPERS\icons\metadata.dm" +#include "code\__HELPERS\icons\render.dm" #include "code\__HELPERS\lists\_string_lists.dm" #include "code\__HELPERS\lists\asset_sorted.dm" #include "code\__HELPERS\lists\associations.dm" @@ -508,7 +513,6 @@ #include "code\controllers\subsystem\chat.dm" #include "code\controllers\subsystem\dcs.dm" #include "code\controllers\subsystem\DPC.dm" -#include "code\controllers\subsystem\early_assets.dm" #include "code\controllers\subsystem\early_init.dm" #include "code\controllers\subsystem\emergency_shuttle.dm" #include "code\controllers\subsystem\events.dm" @@ -535,7 +539,6 @@ #include "code\controllers\subsystem\overmap.dm" #include "code\controllers\subsystem\parallax.dm" #include "code\controllers\subsystem\pathfinder.dm" -#include "code\controllers\subsystem\persist_vr.dm" #include "code\controllers\subsystem\photography.dm" #include "code\controllers\subsystem\ping.dm" #include "code\controllers\subsystem\planets.dm" @@ -564,7 +567,7 @@ #include "code\controllers\subsystem\vis_overlays.dm" #include "code\controllers\subsystem\vote.dm" #include "code\controllers\subsystem\xenoarch.dm" -#include "code\controllers\subsystem\zmimic.dm" +#include "code\controllers\subsystem\zcopy.dm" #include "code\controllers\subsystem\characters\_characters.dm" #include "code\controllers\subsystem\characters\backgrounds.dm" #include "code\controllers\subsystem\characters\character_species.dm" @@ -770,7 +773,9 @@ #include "code\datums\design\designs\machines\parts.dm" #include "code\datums\design\designs\medical\_medical.dm" #include "code\datums\design\designs\medical\chemistry.dm" +#include "code\datums\design\designs\medical\consumables.dm" #include "code\datums\design\designs\medical\misc.dm" +#include "code\datums\design\designs\medical\sterile_wear.dm" #include "code\datums\design\designs\misc\_misc.dm" #include "code\datums\design\designs\misc\drinking_glass.dm" #include "code\datums\design\designs\tools\_tool.dm" @@ -856,6 +861,7 @@ #include "code\datums\recipe\material_recipes\furniture.dm" #include "code\datums\recipe\material_recipes\structures.dm" #include "code\datums\recipe\material_recipes\tools.dm" +#include "code\datums\recipe\stack_recipes\frame.dm" #include "code\datums\recipe\stack_recipes\misc.dm" #include "code\datums\recipe\stack_recipes\structures.dm" #include "code\datums\repositories\ammomaterial.dm" @@ -1334,6 +1340,7 @@ #include "code\game\machinery\embedded_controller\simple_docking_controller.dm" #include "code\game\machinery\lathes\autolathe.dm" #include "code\game\machinery\lathes\lathe.dm" +#include "code\game\machinery\lathes\medical_lathe.dm" #include "code\game\machinery\misc\bioscan_antenna.dm" #include "code\game\machinery\pipe\construction.dm" #include "code\game\machinery\pipe\pipe_dispenser.dm" @@ -1520,6 +1527,7 @@ #include "code\game\objects\effects\decals\remains.dm" #include "code\game\objects\effects\decals\warning_stripes.dm" #include "code\game\objects\effects\decals\posters\bs12.dm" +#include "code\game\objects\effects\decals\posters\citadel.dm" #include "code\game\objects\effects\decals\posters\polarisposters.dm" #include "code\game\objects\effects\map_effects\beam_point.dm" #include "code\game\objects\effects\map_effects\effect_emitter.dm" @@ -1542,7 +1550,6 @@ #include "code\game\objects\effects\temporary_visuals\projectiles\projectile_effects.dm" #include "code\game\objects\effects\temporary_visuals\projectiles\tracer.dm" #include "code\game\objects\items\antag_spawners.dm" -#include "code\game\objects\items\apc_frame.dm" #include "code\game\objects\items\balls.dm" #include "code\game\objects\items\bells.dm" #include "code\game\objects\items\blueprints.dm" @@ -1811,6 +1818,7 @@ #include "code\game\objects\items\weapons\tanks\tank_types.dm" #include "code\game\objects\items\weapons\tanks\tanks.dm" #include "code\game\objects\random\_random.dm" +#include "code\game\objects\random\books.dm" #include "code\game\objects\random\guns_and_ammo.dm" #include "code\game\objects\random\maintenance.dm" #include "code\game\objects\random\mapping.dm" @@ -1958,10 +1966,9 @@ #include "code\game\rendering\client.dm" #include "code\game\rendering\mob.dm" #include "code\game\rendering\screen.dm" -#include "code\game\rendering\atom_huds\alternate_appearance.dm" #include "code\game\rendering\atom_huds\atom_hud.dm" -#include "code\game\rendering\atom_huds\data_huds.dm" -#include "code\game\rendering\atom_huds\other_huds.dm" +#include "code\game\rendering\atom_huds\atom_hud_provider.dm" +#include "code\game\rendering\atom_huds\legacy.dm" #include "code\game\rendering\clickcatcher\clickcatcher.dm" #include "code\game\rendering\fullscreen\fullscreen.dm" #include "code\game\rendering\legacy\ability_screen_objects.dm" @@ -2003,8 +2010,6 @@ #include "code\game\turfs\turf_flick_animations.dm" #include "code\game\turfs\turf_movement.dm" #include "code\game\turfs\unsimulated.dm" -#include "code\game\turfs\initialization\init.dm" -#include "code\game\turfs\initialization\maintenance.dm" #include "code\game\turfs\simulated\sky.dm" #include "code\game\turfs\simulated\floor\floor.dm" #include "code\game\turfs\simulated\floor\floor_acts.dm" @@ -2277,14 +2282,15 @@ #include "code\modules\assembly\signaler.dm" #include "code\modules\assembly\timer.dm" #include "code\modules\assembly\voice.dm" -#include "code\modules\asset_cache\asset_cache_client.dm" -#include "code\modules\asset_cache\asset_cache_item.dm" -#include "code\modules\asset_cache\asset_list.dm" +#include "code\modules\asset_cache\asset_item.dm" +#include "code\modules\asset_cache\asset_pack.dm" +#include "code\modules\asset_cache\asset_transport.dm" +#include "code\modules\asset_cache\client.dm" #include "code\modules\asset_cache\assets\arcade.dm" #include "code\modules\asset_cache\assets\chat.dm" #include "code\modules\asset_cache\assets\common.dm" #include "code\modules\asset_cache\assets\condiments.dm" -#include "code\modules\asset_cache\assets\fish.dm" +#include "code\modules\asset_cache\assets\fishing.dm" #include "code\modules\asset_cache\assets\fontawesome.dm" #include "code\modules\asset_cache\assets\genetics.dm" #include "code\modules\asset_cache\assets\headers.dm" @@ -2292,7 +2298,6 @@ #include "code\modules\asset_cache\assets\jquery.dm" #include "code\modules\asset_cache\assets\legacy_nanomaps.dm" #include "code\modules\asset_cache\assets\legacy_nanoui.dm" -#include "code\modules\asset_cache\assets\legacy_vstation.dm" #include "code\modules\asset_cache\assets\loadout.dm" #include "code\modules\asset_cache\assets\materials.dm" #include "code\modules\asset_cache\assets\moods.dm" @@ -2312,8 +2317,13 @@ #include "code\modules\asset_cache\assets\chemistry\patches.dm" #include "code\modules\asset_cache\assets\chemistry\pills.dm" #include "code\modules\asset_cache\assets\debug\fucky_wucky.dm" -#include "code\modules\asset_cache\transports\asset_transport.dm" -#include "code\modules\asset_cache\transports\webroot_transport.dm" +#include "code\modules\asset_cache\packs\changelog_item.dm" +#include "code\modules\asset_cache\packs\json.dm" +#include "code\modules\asset_cache\packs\simple.dm" +#include "code\modules\asset_cache\packs\spritesheet.dm" +#include "code\modules\asset_cache\packs\spritesheet\simple.dm" +#include "code\modules\asset_cache\transports\browse_rsc.dm" +#include "code\modules\asset_cache\transports\webroot.dm" #include "code\modules\atmospherics\atmosphere\atmosphere.dm" #include "code\modules\atmospherics\atmosphere\planet.dm" #include "code\modules\atmospherics\environmental\atom.dm" @@ -2424,6 +2434,34 @@ #include "code\modules\blob2\overmind\overmind.dm" #include "code\modules\blob2\overmind\powers.dm" #include "code\modules\blob2\overmind\types.dm" +#include "code\modules\bodysets\sprite_accessories.dm" +#include "code\modules\bodysets\organic\akula.dm" +#include "code\modules\bodysets\organic\apidean.dm" +#include "code\modules\bodysets\organic\krisitik.dm" +#include "code\modules\bodysets\organic\monkey.dm" +#include "code\modules\bodysets\organic\moth.dm" +#include "code\modules\bodysets\organic\naramadi.dm" +#include "code\modules\bodysets\organic\nevrean.dm" +#include "code\modules\bodysets\organic\rapala.dm" +#include "code\modules\bodysets\organic\shadekin.dm" +#include "code\modules\bodysets\organic\tajaran.dm" +#include "code\modules\bodysets\organic\teshari.dm" +#include "code\modules\bodysets\organic\unathi.dm" +#include "code\modules\bodysets\organic\vasilissan.dm" +#include "code\modules\bodysets\organic\vulpkanin.dm" +#include "code\modules\bodysets\organic\xenohybrid.dm" +#include "code\modules\bodysets\organic\xenomorph.dm" +#include "code\modules\bodysets\organic\zorren_flatlander.dm" +#include "code\modules\bodysets\organic\zorren_highlander.dm" +#include "code\modules\bodysets\synthetic\eggnerd.dm" +#include "code\modules\bodysets\synthetic\eggnerd_red.dm" +#include "code\modules\bodysets\synthetic\oss_akula.dm" +#include "code\modules\bodysets\synthetic\oss_lizard.dm" +#include "code\modules\bodysets\synthetic\oss_naramadi.dm" +#include "code\modules\bodysets\synthetic\oss_nevrean.dm" +#include "code\modules\bodysets\synthetic\oss_spider.dm" +#include "code\modules\bodysets\synthetic\oss_tajaran.dm" +#include "code\modules\bodysets\synthetic\oss_vulpkanin.dm" #include "code\modules\busy_space\organizations.dm" #include "code\modules\cargo\supplypacks\_supplypacks.dm" #include "code\modules\cargo\supplypacks\atmospherics.dm" @@ -2452,7 +2490,6 @@ #include "code\modules\client\client_procs.dm" #include "code\modules\client\connection.dm" #include "code\modules\client\cutscene.dm" -#include "code\modules\client\legacy.dm" #include "code\modules\client\perspective.dm" #include "code\modules\client\security.dm" #include "code\modules\client\spam_prevention.dm" @@ -2518,6 +2555,7 @@ #include "code\modules\clothing\masks\_mask.dm" #include "code\modules\clothing\masks\boxing.dm" #include "code\modules\clothing\masks\breath.dm" +#include "code\modules\clothing\masks\breath_warmer.dm" #include "code\modules\clothing\masks\gasmask.dm" #include "code\modules\clothing\masks\miscellaneous.dm" #include "code\modules\clothing\masks\voice.dm" @@ -2793,6 +2831,14 @@ #include "code\modules\food\machinery\appliance\grill.dm" #include "code\modules\food\machinery\appliance\oven.dm" #include "code\modules\food\structures\icecream_cart.dm" +#include "code\modules\frames\frame.dm" +#include "code\modules\frames\frame_stage.dm" +#include "code\modules\frames\frame_step.dm" +#include "code\modules\frames\item.dm" +#include "code\modules\frames\structure.dm" +#include "code\modules\frames\types\apc.dm" +#include "code\modules\frames\types\fire_alarm.dm" +#include "code\modules\frames\types\solar_panel.dm" #include "code\modules\gamemaster\controller.dm" #include "code\modules\gamemaster\defines.dm" #include "code\modules\gamemaster\helpers.dm" @@ -3124,6 +3170,7 @@ #include "code\modules\library\lib_machines.dm" #include "code\modules\library\lib_readme.dm" #include "code\modules\library\hardcode_library\_library.dm" +#include "code\modules\library\hardcode_library\reference\xenomorph_facts.dm" #include "code\modules\lighting\__lighting_docs.dm" #include "code\modules\lighting\_lighting_defs.dm" #include "code\modules\lighting\emissive_blocker.dm" @@ -3235,6 +3282,8 @@ #include "code\modules\mapping\map_helpers\component_injector.dm" #include "code\modules\mapping\map_helpers\engine_loader.dm" #include "code\modules\mapping\map_helpers\paint.dm" +#include "code\modules\mapping\map_helpers\access_helper\access_helper.dm" +#include "code\modules\mapping\map_helpers\access_helper\airlock.dm" #include "code\modules\mapping\map_helpers\network_builder\_network_builder.dm" #include "code\modules\mapping\map_helpers\network_builder\power_cable.dm" #include "code\modules\mapping\spawner\_spawner.dm" @@ -3503,10 +3552,10 @@ #include "code\modules\mob\inventory\hands.dm" #include "code\modules\mob\inventory\helpers.dm" #include "code\modules\mob\inventory\inventory.dm" +#include "code\modules\mob\inventory\inventory_slot.dm" #include "code\modules\mob\inventory\items.dm" #include "code\modules\mob\inventory\mobs.dm" #include "code\modules\mob\inventory\rendering.dm" -#include "code\modules\mob\inventory\slot_meta.dm" #include "code\modules\mob\inventory\stripping.dm" #include "code\modules\mob\living\autohiss.dm" #include "code\modules\mob\living\butchering.dm" @@ -3559,6 +3608,7 @@ #include "code\modules\mob\living\carbon\organs.dm" #include "code\modules\mob\living\carbon\perspective.dm" #include "code\modules\mob\living\carbon\physiology.dm" +#include "code\modules\mob\living\carbon\rendering.dm" #include "code\modules\mob\living\carbon\resist.dm" #include "code\modules\mob\living\carbon\shock.dm" #include "code\modules\mob\living\carbon\taste.dm" @@ -3597,7 +3647,6 @@ #include "code\modules\mob\living\carbon\human\dummy.dm" #include "code\modules\mob\living\carbon\human\emote.dm" #include "code\modules\mob\living\carbon\human\examine.dm" -#include "code\modules\mob\living\carbon\human\gradient.dm" #include "code\modules\mob\living\carbon\human\health.dm" #include "code\modules\mob\living\carbon\human\human.dm" #include "code\modules\mob\living\carbon\human\human_attackhand.dm" @@ -3620,6 +3669,7 @@ #include "code\modules\mob\living\carbon\human\movement.dm" #include "code\modules\mob\living\carbon\human\npcs.dm" #include "code\modules\mob\living\carbon\human\pain.dm" +#include "code\modules\mob\living\carbon\human\rendering.dm" #include "code\modules\mob\living\carbon\human\riding.dm" #include "code\modules\mob\living\carbon\human\say.dm" #include "code\modules\mob\living\carbon\human\status_procs.dm" @@ -4214,9 +4264,7 @@ #include "code\modules\power\power.dm" #include "code\modules\power\powernet.dm" #include "code\modules\power\powersupply.dm" -#include "code\modules\power\solar.dm" #include "code\modules\power\terminal.dm" -#include "code\modules\power\tracker.dm" #include "code\modules\power\turbine.dm" #include "code\modules\power\antimatter\containment_jar.dm" #include "code\modules\power\antimatter\control.dm" @@ -4265,6 +4313,9 @@ #include "code\modules\power\smes\coil.dm" #include "code\modules\power\smes\smes.dm" #include "code\modules\power\smes\smes_construction.dm" +#include "code\modules\power\solar\solar.dm" +#include "code\modules\power\solar\solar_control.dm" +#include "code\modules\power\solar\tracker.dm" #include "code\modules\power\supermatter\setup_supermatter.dm" #include "code\modules\power\supermatter\supermatter.dm" #include "code\modules\power\tesla\coil.dm" @@ -4689,8 +4740,11 @@ #include "code\modules\spells\targeted\projectile\fireball.dm" #include "code\modules\spells\targeted\projectile\magic_missile.dm" #include "code\modules\spells\targeted\projectile\projectile.dm" -#include "code\modules\sprite_accessories\sprite_accessories.dm" -#include "code\modules\sprite_accessories\ears\_ears.dm" +#include "code\modules\sprite_accessories\ears.dm" +#include "code\modules\sprite_accessories\hair.dm" +#include "code\modules\sprite_accessories\sprite_accessory.dm" +#include "code\modules\sprite_accessories\tail.dm" +#include "code\modules\sprite_accessories\wings.dm" #include "code\modules\sprite_accessories\ears\antenna.dm" #include "code\modules\sprite_accessories\ears\horns.dm" #include "code\modules\sprite_accessories\ears\misc.dm" @@ -4727,17 +4781,18 @@ #include "code\modules\sprite_accessories\facial_hair\unathi.dm" #include "code\modules\sprite_accessories\facial_hair\vox.dm" #include "code\modules\sprite_accessories\facial_hair\vulpkanin.dm" -#include "code\modules\sprite_accessories\hair\_hair.dm" -#include "code\modules\sprite_accessories\hair\sergal.dm" -#include "code\modules\sprite_accessories\hair\shadekin.dm" -#include "code\modules\sprite_accessories\hair\skrell.dm" -#include "code\modules\sprite_accessories\hair\tajaran.dm" -#include "code\modules\sprite_accessories\hair\teshari.dm" -#include "code\modules\sprite_accessories\hair\unathi.dm" -#include "code\modules\sprite_accessories\hair\unathi_digitigrade.dm" -#include "code\modules\sprite_accessories\hair\vox.dm" -#include "code\modules\sprite_accessories\hair\vulpkanin.dm" -#include "code\modules\sprite_accessories\hair\xenomorph.dm" +#include "code\modules\sprite_accessories\hair\hair.dm" +#include "code\modules\sprite_accessories\hair\legacy.dm" +#include "code\modules\sprite_accessories\hair\species\sergal.dm" +#include "code\modules\sprite_accessories\hair\species\shadekin.dm" +#include "code\modules\sprite_accessories\hair\species\skrell.dm" +#include "code\modules\sprite_accessories\hair\species\tajaran.dm" +#include "code\modules\sprite_accessories\hair\species\teshari.dm" +#include "code\modules\sprite_accessories\hair\species\unathi.dm" +#include "code\modules\sprite_accessories\hair\species\unathi_digitigrade.dm" +#include "code\modules\sprite_accessories\hair\species\vox.dm" +#include "code\modules\sprite_accessories\hair\species\vulpkanin.dm" +#include "code\modules\sprite_accessories\hair\species\xenomorph.dm" #include "code\modules\sprite_accessories\markings\_markings.dm" #include "code\modules\sprite_accessories\markings\diona_stuff.dm" #include "code\modules\sprite_accessories\markings\eye_stuff.dm" @@ -4753,7 +4808,6 @@ #include "code\modules\sprite_accessories\markings\vulpkanin.dm" #include "code\modules\sprite_accessories\markings\werebeast.dm" #include "code\modules\sprite_accessories\markings\zorren.dm" -#include "code\modules\sprite_accessories\tail\_tail.dm" #include "code\modules\sprite_accessories\tail\bearlike.dm" #include "code\modules\sprite_accessories\tail\bird.dm" #include "code\modules\sprite_accessories\tail\bovine.dm" @@ -4782,9 +4836,10 @@ #include "code\modules\sprite_accessories\tail\species\vulpkanin.dm" #include "code\modules\sprite_accessories\tail\species\xenomorph.dm" #include "code\modules\sprite_accessories\tail\species\zorren.dm" -#include "code\modules\sprite_accessories\wings\_wings.dm" #include "code\modules\sprite_accessories\wings\bat.dm" #include "code\modules\sprite_accessories\wings\draconic_furries.dm" +#include "code\modules\sprite_accessories\wings\feathered-angel.dm" +#include "code\modules\sprite_accessories\wings\feathered-generic.dm" #include "code\modules\sprite_accessories\wings\feathered.dm" #include "code\modules\sprite_accessories\wings\insect_not_really_wings.dm" #include "code\modules\sprite_accessories\wings\misc.dm" @@ -4942,7 +4997,6 @@ #include "code\modules\vore\lick_wounds.dm" #include "code\modules\vore\trycatch_vr.dm" #include "code\modules\vore\appearance\spider_taur_powers_vr.dm" -#include "code\modules\vore\appearance\update_icons_vr.dm" #include "code\modules\vore\eating\belly_dat_vr.dm" #include "code\modules\vore\eating\belly_obj_vr.dm" #include "code\modules\vore\eating\bellymodes_tf_vr.dm" @@ -5039,10 +5093,11 @@ #include "code\modules\xenobio\items\slimepotions.dm" #include "code\modules\xenobio\items\weapons.dm" #include "code\modules\xenobio\machinery\processor.dm" -#include "donator\legacy.dm" -#include "donator\djkouta\donator_cloak.dm" -#include "donator\timothytea\donator_bedsheet.dm" -#include "donator\unclebourbon\pmc_mask.dm" +#include "fluff\donator\legacy.dm" +#include "fluff\donator\djkouta\donator_cloak.dm" +#include "fluff\donator\timothytea\donator_bedsheet.dm" +#include "fluff\donator\unclebourbon\pmc_mask.dm" +#include "fluff\plushies\plushies.dm" #include "interface\interface.dm" #include "interface\stylesheet.dm" #include "interface\skin.dmf" @@ -5065,6 +5120,7 @@ #include "maps\overmap\shuttles\pirateskiff.dm" #include "maps\overmap\shuttles\skipjack.dm" #include "maps\overmap\shuttles\specialops.dm" +#include "maps\rift\engines.dm" #include "maps\rift\misc.dm" #include "maps\rift\rift.dm" #include "maps\rift\shuttles.dm" diff --git a/code/__DEFINES/_flags/obj_flags.dm b/code/__DEFINES/_flags/obj_flags.dm index d002e89ea78e..d18c75ed8434 100644 --- a/code/__DEFINES/_flags/obj_flags.dm +++ b/code/__DEFINES/_flags/obj_flags.dm @@ -20,7 +20,9 @@ /// Materials have been initialized #define OBJ_MATERIAL_INITIALIZED (1<<9) /// no sculpting -#define OBJ_NO_SCULPTING (1<<10) +#define OBJ_NO_SCULPTING (1<<10) +/// wall-mounted; facing *towards* the wall we're mounted on (e.g. be NORTH if we're shifted north) +#define OBJ_WALL_MOUNTED (1<<11) DEFINE_BITFIELD(obj_flags, list( BITFIELD(OBJ_EMAGGED), @@ -34,4 +36,26 @@ DEFINE_BITFIELD(obj_flags, list( BITFIELD(OBJ_MATERIAL_PARTS_MODIFIED), BITFIELD(OBJ_MATERIAL_INITIALIZED), BITFIELD(OBJ_NO_SCULPTING), + BITFIELD_NAMED("Wall Mounted", OBJ_WALL_MOUNTED), +)) + +//* /obj/var/obj_rotation_flags + +/// obj rotation enabled; we'll go to context menu +#define OBJ_ROTATION_ENABLED (1<<0) +/// allow defaulting on context menu +#define OBJ_ROTATION_DEFAULTING (1<<1) +/// do not perform standard anchor check +#define OBJ_ROTATION_NO_ANCHOR_CHECK (1<<2) +/// rotate CCW +#define OBJ_ROTATION_CCW (1<<3) +/// give optiosn to rotate both directions +#define OBJ_ROTATION_BIDIRECTIONAL (1<<4) + +DEFINE_BITFIELD(obj_rotation_flags, list( + BITFIELD_NAMED("Enabled", OBJ_ROTATION_ENABLED), + BITFIELD_NAMED("Defaulting", OBJ_ROTATION_DEFAULTING), + BITFIELD_NAMED("Allow Anchored", OBJ_ROTATION_NO_ANCHOR_CHECK), + BITFIELD_NAMED("Counterclockwise", OBJ_ROTATION_CCW), + BITFIELD_NAMED("Show Both Directions", OBJ_ROTATION_BIDIRECTIONAL), )) diff --git a/code/__DEFINES/_protect.dm b/code/__DEFINES/_protect.dm index c865bd363ed6..00d66d60dc06 100644 --- a/code/__DEFINES/_protect.dm +++ b/code/__DEFINES/_protect.dm @@ -1,8 +1,11 @@ -#define GENERAL_PROTECT_DATUM(Path)\ +/** + * Completely occludes a path from view variable interactions. + */ +#define VV_PROTECT(Path)\ ##Path/can_vv_get(var_name){\ return FALSE;\ }\ -##Path/vv_edit_var(var_name, var_value){\ +##Path/vv_edit_var(var_name, var_value, mass_edit, raw_edit){\ return FALSE;\ }\ ##Path/CanProcCall(procname){\ @@ -11,3 +14,16 @@ ##Path/can_vv_mark(){\ return FALSE;\ } + +/** + * Makes a path read-only to view variables. + * + * * Does not prevent the path from being marked! + */ +#define VV_PROTECT_READONLY(Path)\ +##Path/vv_edit_var(var_name, var_value, mass_edit, raw_edit){\ + return FALSE;\ +}\ +##Path/CanProcCall(procname){\ + return FALSE;\ +} diff --git a/code/__DEFINES/access.dm b/code/__DEFINES/access.dm index 83a45bff88da..fa652ddb0ae6 100644 --- a/code/__DEFINES/access.dm +++ b/code/__DEFINES/access.dm @@ -162,6 +162,7 @@ STANDARD_ACCESS_DATUM(ACCESS_COMMAND_UPLOAD, station/command/upload, "AI Upload" #define ACCESS_COMMAND_TELEPORTER 17 STANDARD_ACCESS_DATUM(ACCESS_COMMAND_TELEPORTER, station/command/teleporter, "Teleporter") +// todo: rename / repath to general high-security storage for command #define ACCESS_COMMAND_EVA 18 STANDARD_ACCESS_DATUM(ACCESS_COMMAND_EVA, station/command/eva, "EVA") diff --git a/code/__DEFINES/controllers/_subsystems.dm b/code/__DEFINES/controllers/_subsystems.dm index f4a3c6f21640..48416ad5c622 100644 --- a/code/__DEFINES/controllers/_subsystems.dm +++ b/code/__DEFINES/controllers/_subsystems.dm @@ -77,12 +77,28 @@ DEFINE_BITFIELD(runlevels, list( // todo: tg init brackets +// core security system, used by client/New() #define INIT_ORDER_FAIL2TOPIC 200 +// core security system, used by client/New() #define INIT_ORDER_IPINTEL 197 + +// core timing system, used by almost everything #define INIT_ORDER_TIMER 195 +// just about every feature on the server requires the database backend +// for storage and durability of permeance. #define INIT_ORDER_DBCORE 190 +// repository is just struct storage. its things depend on database, +// but should depend on nothing else. +// +// for the rare occasion when a prototype requires asset registration, +// it should be able to recognize if SSassets is ready, +// and only queue an udpate if its asset is already loaded. +#define INIT_ORDER_REPOSITORY 187 +// early init initializes what is basically expensive global variables. it needs to go before assets. #define INIT_ORDER_EARLY_INIT 185 -#define INIT_ORDER_REPOSITORY 180 +// assets is loaded early because things hook into this to register *their* assets +#define INIT_ORDER_ASSETS 180 + #define INIT_ORDER_STATPANELS 170 #define INIT_ORDER_PREFERENCES 165 #define INIT_ORDER_INPUT 160 @@ -93,7 +109,6 @@ DEFINE_BITFIELD(runlevels, list( #define INIT_ORDER_VIS 80 #define INIT_ORDER_SERVER_MAINT 65 #define INIT_ORDER_INSTRUMENTS 50 -#define INIT_ORDER_EARLY_ASSETS 48 #define INIT_ORDER_MEDIA_TRACKS 38 #define INIT_ORDER_CHEMISTRY 35 #define INIT_ORDER_MATERIALS 34 @@ -112,7 +127,6 @@ DEFINE_BITFIELD(runlevels, list( #define INIT_ORDER_AIR -1 #define INIT_ORDER_PLANETS -2 #define INIT_ORDER_PERSISTENCE -3 -#define INIT_ORDER_ASSETS -4 #define INIT_ORDER_MISC_LATE -5 #define INIT_ORDER_HOLOMAPS -5 #define INIT_ORDER_NIGHTSHIFT -5 diff --git a/code/__DEFINES/controllers/assets.dm b/code/__DEFINES/controllers/assets.dm new file mode 100644 index 000000000000..617da4790492 --- /dev/null +++ b/code/__DEFINES/controllers/assets.dm @@ -0,0 +1,8 @@ +//* asset loaded status + +/// not loaded at all +#define ASSET_NOT_LOADED 1 +/// loading started, wait +#define ASSET_IS_LOADING 2 +/// loading finished, go +#define ASSET_FULLY_LOADED 3 diff --git a/code/__DEFINES/dcs/signals/global_signals.dm b/code/__DEFINES/dcs/signals/global_signals.dm new file mode 100644 index 000000000000..c9beb6fd03a1 --- /dev/null +++ b/code/__DEFINES/dcs/signals/global_signals.dm @@ -0,0 +1,12 @@ +//* This file is explicitly licensed under the MIT license. *// +//* Copyright (c) 2023 Citadel Station developers. *// + +/** + * Use SEND_GLOBAL_SIGNAL to send, and + * RegisterGlobalSignal to receive. + */ + +/// when a mob is in /Initialize(): (mob/creating) +#define COMSIG_GLOBAL_MOB_NEW "!global-mob-new" +/// when a mob is in /Destroy(): (mob/destroying) +#define COMSIG_GLOBAL_MOB_DEL "!global-mob-del" diff --git a/code/__DEFINES/dcs/signals/signals_NTNet.dm b/code/__DEFINES/dcs/signals/signals_NTNet.dm deleted file mode 100644 index 7b258d299b4c..000000000000 --- a/code/__DEFINES/dcs/signals/signals_NTNet.dm +++ /dev/null @@ -1,20 +0,0 @@ -/** - *! ## NTNet Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -/// Called on an object by its NTNET connection component on receive. (data(datum/netdata)) -////#define COMSIG_COMPONENT_NTNET_RECEIVE "ntnet_receive" -/// Called on an object by its NTNET connection component on a port update (hardware_id, port)) -////#define COMSIG_COMPONENT_NTNET_PORT_UPDATE "ntnet_port_update" -/// Called when packet was accepted by the target (datum/netdata, error_code) -////#define COMSIG_COMPONENT_NTNET_ACK "ntnet_ack" -/// Called when packet was not acknoledged by the target (datum/netdata, error_code) -////#define COMSIG_COMPONENT_NTNET_NAK "ntnet_nack" - -// !Some internal NTnet signals used on ports -/// Called on an object by its NTNET connection component on a port distruction (port, list/data)) -////#define COMSIG_COMPONENT_NTNET_PORT_DESTROYED "ntnet_port_destroyed" -/// Called on an object by its NTNET connection component on a port distruction (port, list/data)) -////#define COMSIG_COMPONENT_NTNET_PORT_UPDATED "ntnet_port_updated" diff --git a/code/__DEFINES/dcs/signals/signals_adventure.dm b/code/__DEFINES/dcs/signals/signals_adventure.dm deleted file mode 100644 index b2350bdbdf73..000000000000 --- a/code/__DEFINES/dcs/signals/signals_adventure.dm +++ /dev/null @@ -1,29 +0,0 @@ -/** - *! ## Adventure Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -/// Exoprobe adventure finished: (result) result is ADVENTURE_RESULT_??? values -////#define COMSIG_ADVENTURE_FINISHED "adventure_done" - -/// Sent on initial adventure qualities generation from /datum/adventure/proc/initialize_qualities(): (list/quality_list) -////#define COMSIG_ADVENTURE_QUALITY_INIT "adventure_quality_init" - -/// Sent on adventure node delay start: (delay_time, delay_message) -////#define COMSIG_ADVENTURE_DELAY_START "adventure_delay_start" -/// Sent on adventure delay finish: () -////#define COMSIG_ADVENTURE_DELAY_END "adventure_delay_end" - -/// Exoprobe status changed : () -////#define COMSIG_EXODRONE_STATUS_CHANGED "exodrone_status_changed" - -//! Scanner Controller Signals -/// Sent on begingging of new scan : (datum/exoscan/new_scan) -////#define COMSIG_EXOSCAN_STARTED "exoscan_started" -/// Sent on successful finish of exoscan: (datum/exoscan/finished_scan) -////#define COMSIG_EXOSCAN_FINISHED "exoscan_finished" - -//! Exosca Signals -/// Sent on exoscan failure/manual interruption: () -////#define COMSIG_EXOSCAN_INTERRUPTED "exoscan_interrupted" diff --git a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_main.dm b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_main.dm index 094fcc593499..2e96afb7e7c9 100644 --- a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_main.dm +++ b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_main.dm @@ -46,3 +46,6 @@ /// When the transform or an atom is varedited through vv topic. ////#define COMSIG_ATOM_VV_MODIFY_TRANSFORM "atom_vv_modify_transform" + +/// called when compile_overlays() is ran. args: () +#define COMSIG_ATOM_COMPILED_OVERLAYS "atom_compiled_overlays" diff --git a/code/__DEFINES/dcs/signals/signals_bot.dm b/code/__DEFINES/dcs/signals/signals_bot.dm deleted file mode 100644 index f3c56b5caa0d..000000000000 --- a/code/__DEFINES/dcs/signals/signals_bot.dm +++ /dev/null @@ -1,14 +0,0 @@ -/** - *! ## Bot Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -/// Called in /obj/structure/moneybot/add_money(). (to_add) -////#define COMSIG_MONEYBOT_ADD_MONEY "moneybot_add_money" - -/// Called in /obj/structure/dispenserbot/add_item(). (obj/item/to_add) -////#define COMSIG_DISPENSERBOT_ADD_ITEM "moneybot_add_item" - -/// Called in /obj/structure/dispenserbot/remove_item(). (obj/item/to_remove) -////#define COMSIG_DISPENSERBOT_REMOVE_ITEM "moneybot_remove_item" diff --git a/code/__DEFINES/dcs/signals/signals_changeling.dm b/code/__DEFINES/dcs/signals/signals_changeling.dm deleted file mode 100644 index 582e53e986df..000000000000 --- a/code/__DEFINES/dcs/signals/signals_changeling.dm +++ /dev/null @@ -1,8 +0,0 @@ -/** - *! ## Changeling Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -/// Called when a changeling uses its transform ability (source = carbon), from /datum/action/changeling/transform/sting_action(mob/living/carbon/human/user) -////#define COMSIG_CHANGELING_TRANSFORM "changeling_transform" diff --git a/code/__DEFINES/dcs/signals/signals_circuit.dm b/code/__DEFINES/dcs/signals/signals_circuit.dm deleted file mode 100644 index 0f3752d2904a..000000000000 --- a/code/__DEFINES/dcs/signals/signals_circuit.dm +++ /dev/null @@ -1,68 +0,0 @@ -/** - *! ## Circuit Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -//! Component signals -/// Sent when the value of a port is set. -////#define COMSIG_PORT_SET_VALUE "port_set_value" -/// Sent when the type of a port is set. -////#define COMSIG_PORT_SET_TYPE "port_set_type" -/// Sent when a port disconnects from everything. -////#define COMSIG_PORT_DISCONNECT "port_disconnect" - -/// Sent when a [/obj/item/circuit_component] is added to a circuit. -////#define COMSIG_CIRCUIT_ADD_COMPONENT "circuit_add_component" - /// Cancels adding the component to the circuit. - ////#define COMPONENT_CANCEL_ADD_COMPONENT (1<<0) - -/// Sent when a [/obj/item/circuit_component] is added to a circuit manually, by putting the item inside directly. -/// Accepts COMPONENT_CANCEL_ADD_COMPONENT. -////#define COMSIG_CIRCUIT_ADD_COMPONENT_MANUALLY "circuit_add_component_manually" - -/// Sent when a circuit is removed from its shell -////#define COMSIG_CIRCUIT_SHELL_REMOVED "circuit_shell_removed" - -/// Sent to [/obj/item/circuit_component] when it is removed from a circuit. (/obj/item/integrated_circuit) -////#define COMSIG_CIRCUIT_COMPONENT_REMOVED "circuit_component_removed" - -/// Called when the integrated circuit's cell is set. -////#define COMSIG_CIRCUIT_SET_CELL "circuit_set_cell" - -/// Called when the integrated circuit is turned on or off. -////#define COMSIG_CIRCUIT_SET_ON "circuit_set_on" - -/// Called when the integrated circuit's shell is set. -////#define COMSIG_CIRCUIT_SET_SHELL "circuit_set_shell" - -/// Called when the integrated circuit is locked. -////#define COMSIG_CIRCUIT_SET_LOCKED "circuit_set_locked" - -/// Called before power is used in an integrated circuit (power_to_use) -////#define COMSIG_CIRCUIT_PRE_POWER_USAGE "circuit_pre_power_usage" - ////#define COMPONENT_OVERRIDE_POWER_USAGE (1<<0) - -/// Called right before the integrated circuit data is converted to json. Allows modification to the data right before it is returned. -////#define COMSIG_CIRCUIT_PRE_SAVE_TO_JSON "circuit_pre_save_to_json" - -/// Called when the integrated circuit is loaded. -////#define COMSIG_CIRCUIT_POST_LOAD "circuit_post_load" - -/// Sent to an atom when a [/obj/item/usb_cable] attempts to connect to something. (/obj/item/usb_cable/usb_cable, /mob/user) -////#define COMSIG_ATOM_USB_CABLE_TRY_ATTACH "usb_cable_try_attach" - /// Attaches the USB cable to the atom. If the USB cables moves away, it will disconnect. - ////#define COMSIG_USB_CABLE_ATTACHED (1<<0) - - /// Attaches the USB cable to a circuit. Producers of this are expected to set the usb_cable's - /// `attached_circuit` variable. - ////#define COMSIG_USB_CABLE_CONNECTED_TO_CIRCUIT (1<<1) - - /// Cancels the attack chain, but without performing any other action. - ////#define COMSIG_CANCEL_USB_CABLE_ATTACK (1<<2) - -/// Called when the circuit component is saved. -////#define COMSIG_CIRCUIT_COMPONENT_SAVE "circuit_component_save" - -/// Called when an external object is loaded. -////#define COMSIG_MOVABLE_CIRCUIT_LOADED "movable_circuit_loaded" diff --git a/code/__DEFINES/dcs/signals/signals_clothing.dm b/code/__DEFINES/dcs/signals/signals_clothing.dm deleted file mode 100644 index 7452fb837f82..000000000000 --- a/code/__DEFINES/dcs/signals/signals_clothing.dm +++ /dev/null @@ -1,9 +0,0 @@ -/** - *! ## Clothing Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -//! /obj/item/clothing -/// (/obj/item/clothing, visor_state) - When a clothing gets it's visor toggled. -////#define COMSIG_CLOTHING_VISOR_TOGGLE "clothing_visor_toggle" diff --git a/code/__DEFINES/dcs/signals/signals_container.dm b/code/__DEFINES/dcs/signals/signals_container.dm deleted file mode 100644 index a3f42c4ddd26..000000000000 --- a/code/__DEFINES/dcs/signals/signals_container.dm +++ /dev/null @@ -1,9 +0,0 @@ -/** - *! ## Container Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -//! /datum/component/container_item -/// (atom/container, mob/user) - returns bool -////#define COMSIG_CONTAINER_TRY_ATTACH "container_try_attach" diff --git a/code/__DEFINES/dcs/signals/signals_customizable.dm b/code/__DEFINES/dcs/signals/signals_customizable.dm deleted file mode 100644 index 13f167104a04..000000000000 --- a/code/__DEFINES/dcs/signals/signals_customizable.dm +++ /dev/null @@ -1,8 +0,0 @@ -/** - *! ## Customizable Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -/// Called when an atom with /datum/component/customizable_reagent_holder is customized (obj/item/I) -////#define COMSIG_ATOM_CUSTOMIZED "atom_customized" diff --git a/code/__DEFINES/dcs/signals/signals_cytology.dm b/code/__DEFINES/dcs/signals/signals_cytology.dm deleted file mode 100644 index 05b632cc6d09..000000000000 --- a/code/__DEFINES/dcs/signals/signals_cytology.dm +++ /dev/null @@ -1,9 +0,0 @@ -/** - *! ## Cytology Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -/// Sent from /datum/biological_sample/proc/reset_sample -////#define COMSIG_SAMPLE_GROWTH_COMPLETED "sample_growth_completed" - ////#define SPARE_SAMPLE (1<<0) diff --git a/code/__DEFINES/dcs/signals/signals_food.dm b/code/__DEFINES/dcs/signals/signals_food.dm deleted file mode 100644 index 16fffde87779..000000000000 --- a/code/__DEFINES/dcs/signals/signals_food.dm +++ /dev/null @@ -1,28 +0,0 @@ -/** - *! ## Food Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -/// Called when an item is used as an ingredient: (atom/customized) -////#define COMSIG_ITEM_USED_AS_INGREDIENT "item_used_as_ingredient" -/// Called when an edible ingredient is added: (datum/component/edible/ingredient) -////#define COMSIG_EDIBLE_INGREDIENT_ADDED "edible_ingredient_added" - -//! Food Signals -/// From Edible component: (mob/living/eater, mob/feeder, bitecount, bitesize) -////#define COMSIG_FOOD_EATEN "food_eaten" -/// From base of datum/component/edible/on_entered: (mob/crosser, bitecount) -////#define COMSIG_FOOD_CROSSED "food_crossed" - -/// From base of Component/edible/On_Consume: (mob/living/eater, mob/living/feeder) -////#define COMSIG_FOOD_CONSUMED "food_consumed" - -////#define COMSIG_ITEM_FRIED "item_fried" - ////#define COMSIG_FRYING_HANDLED (1<<0) - -//! Drink Signals -/// From base of obj/item/reagent_containers/food/drinks/attack(): (mob/living/M, mob/user) -////#define COMSIG_DRINK_DRANK "drink_drank" -/// From base of obj/item/reagent_containers/glass/attack(): (mob/M, mob/user) -////#define COMSIG_GLASS_DRANK "glass_drank" diff --git a/code/__DEFINES/dcs/signals/signals_gib.dm b/code/__DEFINES/dcs/signals/signals_gib.dm deleted file mode 100644 index 8e36cc36ffbe..000000000000 --- a/code/__DEFINES/dcs/signals/signals_gib.dm +++ /dev/null @@ -1,10 +0,0 @@ -/** - *! ## Gibs Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -/// From base of /obj/effect/debris/cleanable/blood/gibs/streak(): (list/directions, list/diseases) -////#define COMSIG_GIBS_STREAK "gibs_streak" -/// Called on mobs when they step in blood. (blood_amount, blood_state, list/blood_DNA) -////#define COMSIG_STEP_ON_BLOOD "step_on_blood" diff --git a/code/__DEFINES/dcs/signals/signals_global.dm b/code/__DEFINES/dcs/signals/signals_global.dm deleted file mode 100644 index 2a58521989ea..000000000000 --- a/code/__DEFINES/dcs/signals/signals_global.dm +++ /dev/null @@ -1,71 +0,0 @@ -/** - *! ## Global Signals - * * These are signals which can be listened to by any component on any parent. - * * Start global signals with "!", this used to be necessary but now it's just a formatting choice. - * - *! ## Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument. - */ - -/// Called after a successful area creation by a mob: (area/created_area, area/old_area, mob/creator) -////#define COMSIG_AREA_CREATED "!mob_created_area" -/// Sent when a new z-level is created: (name, traits, z_type) -#define COMSIG_GLOB_NEW_Z "!new_z" -/// Sent after world.maxx and/or world.maxy are expanded: (has_exapnded_world_maxx, has_expanded_world_maxy) -////#define COMSIG_GLOB_EXPANDED_WORLD_BOUNDS "!expanded_world_bounds" -/// Called after a successful var edit somewhere in the world: (list/args) -////#define COMSIG_GLOB_VAR_EDIT "!var_edit" -/// Called after an explosion happened : (epicenter, devastation_range, heavy_impact_range, light_impact_range, took, orig_dev_range, orig_heavy_range, orig_light_range) -////#define COMSIG_GLOB_EXPLOSION "!explosion" -/// Called from base of /mob/Initialise : (mob) -////#define COMSIG_GLOB_MOB_CREATED "!mob_created" -/// Mob died somewhere : (mob/living, gibbed) -////#define COMSIG_GLOB_MOB_DEATH "!mob_death" -/// Global living say plug - use sparingly: (mob/speaker , message) -////#define COMSIG_GLOB_LIVING_SAY_SPECIAL "!say_special" -/// Called by datum/cinematic/play() : (datum/cinematic/new_cinematic) -////#define COMSIG_GLOB_PLAY_CINEMATIC "!play_cinematic" - ////#define COMPONENT_GLOB_BLOCK_CINEMATIC (1<<0) -/// Ingame button pressed (/obj/machinery/button/button) -////#define COMSIG_GLOB_BUTTON_PRESSED "!button_pressed" -/// Job subsystem has spawned and equipped a new mob -////#define COMSIG_GLOB_JOB_AFTER_SPAWN "!job_after_spawn" -/// Job datum has been called to deal with the aftermath of a latejoin spawn -////#define COMSIG_GLOB_JOB_AFTER_LATEJOIN_SPAWN "!job_after_latejoin_spawn" -/// Crewmember joined the game (mob/living, rank) -////#define COMSIG_GLOB_CREWMEMBER_JOINED "!crewmember_joined" -/// Random event is trying to roll. (/datum/round_event_control/random_event) -/// Called by (/datum/round_event_control/preRunEvent). -////#define COMSIG_GLOB_PRE_RANDOM_EVENT "!pre_random_event" - ///? Do not allow this random event to continue. - ////#define CANCEL_PRE_RANDOM_EVENT (1<<0) -/// A person somewhere has thrown something : (mob/living/carbon/carbon_thrower, target) -////#define COMSIG_GLOB_CARBON_THROW_THING "!throw_thing" -/// A trapdoor remote has sent out a signal to link with a trapdoor -////#define COMSIG_GLOB_TRAPDOOR_LINK "!trapdoor_link" - ///? Successfully linked to a trapdoor! - ////#define LINKED_UP (1<<0) -/// An obj/item is created! (obj/item/created_item) -////#define COMSIG_GLOB_NEW_ITEM "!new_item" -/// A client (re)connected, after all /client/New() checks have passed : (client/connected_client) -////#define COMSIG_GLOB_CLIENT_CONNECT "!client_connect" -/// A weather event of some kind occured -////#define COMSIG_WEATHER_TELEGRAPH(event_type) "!weather_telegraph [event_type]" -////#define COMSIG_WEATHER_START(event_type) "!weather_start [event_type]" -////#define COMSIG_WEATHER_WINDDOWN(event_type) "!weather_winddown [event_type]" -////#define COMSIG_WEATHER_END(event_type) "!weather_end [event_type]" -/// An alarm of some form was sent (datum/alarm_handler/source, alarm_type, area/source_area) -////#define COMSIG_ALARM_FIRE(alarm_type) "!alarm_fire [alarm_type]" -/// An alarm of some form was cleared (datum/alarm_handler/source, alarm_type, area/source_area) -////#define COMSIG_ALARM_CLEAR(alarm_type) "!alarm_clear [alarm_type]" -/// Global mob logged in signal! (/mob/added_player) -////#define COMSIG_GLOB_MOB_LOGGED_IN "!mob_logged_in" - -/// Global signal sent when a nuclear device is armed (/obj/machinery/nuclearbomb/nuke/exploding_nuke) -////#define COMSIG_GLOB_NUKE_DEVICE_ARMED "!nuclear_device_armed" -/// Global signal sent when a nuclear device is disarmed (/obj/machinery/nuclearbomb/nuke/disarmed_nuke) -////#define COMSIG_GLOB_NUKE_DEVICE_DISARMED "!nuclear_device_disarmed" - -/// Global signal sent when a light mechanism is completed (try_id) -////#define COMSIG_GLOB_LIGHT_MECHANISM_COMPLETED "!light_mechanism_completed" diff --git a/code/__DEFINES/dcs/signals/signals_global_object.dm b/code/__DEFINES/dcs/signals/signals_global_object.dm deleted file mode 100644 index f14cc7e76fe4..000000000000 --- a/code/__DEFINES/dcs/signals/signals_global_object.dm +++ /dev/null @@ -1,17 +0,0 @@ -/** - *! ## Globally Accessible Object Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -/// From SSJob when DivideOccupations is called -////#define COMSIG_OCCUPATIONS_DIVIDED "occupations_divided" - -/// From SSsun when the sun changes position : (azimuth) -////#define COMSIG_SUN_MOVED "sun_moved" - -/// From SSsecurity_level when the security level changes : (new_level) -////#define COMSIG_SECURITY_LEVEL_CHANGED "security_level_changed" - -/// From SSshuttle when the supply shuttle starts spawning orders : () -////#define COMSIG_SUPPLY_SHUTTLE_BUY "supply_shuttle_buy" diff --git a/code/__DEFINES/dcs/signals/signals_greyscale.dm b/code/__DEFINES/dcs/signals/signals_greyscale.dm deleted file mode 100644 index 5362dd026582..000000000000 --- a/code/__DEFINES/dcs/signals/signals_greyscale.dm +++ /dev/null @@ -1,7 +0,0 @@ -/** - *! ## Greyscale Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -////#define COMSIG_GREYSCALE_CONFIG_REFRESHED "greyscale_config_refreshed" diff --git a/code/__DEFINES/dcs/signals/signals_heretic.dm b/code/__DEFINES/dcs/signals/signals_heretic.dm deleted file mode 100644 index 5ca2d02e53db..000000000000 --- a/code/__DEFINES/dcs/signals/signals_heretic.dm +++ /dev/null @@ -1,22 +0,0 @@ -/** - *! ## Heretic Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -/// From /obj/item/clothing/mask/madness_mask/process : (amount) -////#define COMSIG_HERETIC_MASK_ACT "void_mask_act" - -/// From /obj/item/melee/touch_attack/mansus_fist/on_mob_hit : (mob/living/source, mob/living/target) -////#define COMSIG_HERETIC_MANSUS_GRASP_ATTACK "mansus_grasp_attack" - ///? Default behavior is to use a charge, so return this to blocks the mansus fist from being consumed after use. - ////#define COMPONENT_BLOCK_CHARGE_USE (1<<0) -/// From /obj/item/melee/touch_attack/mansus_fist/afterattack_secondary : (mob/living/source, atom/target) -////#define COMSIG_HERETIC_MANSUS_GRASP_ATTACK_SECONDARY "mansus_grasp_attack_secondary" - ///? Default behavior is to continue attack chain and do nothing else, so return this to use up a charge after use. - ////#define COMPONENT_USE_CHARGE (1<<0) - -/// From /obj/item/melee/sickly_blade/afterattack (with proximity) : (mob/living/source, mob/living/target) -////#define COMSIG_HERETIC_BLADE_ATTACK "blade_attack" -/// From /obj/item/melee/sickly_blade/afterattack (without proximity) : (mob/living/source, mob/living/target) -////#define COMSIG_HERETIC_RANGED_BLADE_ATTACK "ranged_blade_attack" diff --git a/code/__DEFINES/dcs/signals/signals_hydroponic.dm b/code/__DEFINES/dcs/signals/signals_hydroponic.dm deleted file mode 100644 index 65ed7cc39ae2..000000000000 --- a/code/__DEFINES/dcs/signals/signals_hydroponic.dm +++ /dev/null @@ -1,39 +0,0 @@ -/** - *! ## Hydroponics Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -//! Plants / Plant Traits Signals -/// Called when a plant with slippery skin is slipped on (mob/victim) -////#define COMSIG_PLANT_ON_SLIP "plant_on_slip" -/// Called when a plant with liquid contents is squashed on (atom/target) -////#define COMSIG_PLANT_ON_SQUASH "plant_on_squash" -/// Called when a plant backfires via the backfire element (mob/victim) -////#define COMSIG_PLANT_ON_BACKFIRE "plant_on_backfire" -/// Called when a seed grows in a tray (obj/machinery/hydroponics) -////#define COMSIG_SEED_ON_GROW "plant_on_grow" -/// Called when a seed is planted in a tray (obj/machinery/hydroponics) -////#define COMSIG_SEED_ON_PLANTED "plant_on_plant" - -//! Hydro Tray Signals -/// From base of /obj/machinery/hydroponics/set_seed() : (obj/item/new_seed) -////#define COMSIG_HYDROTRAY_SET_SEED "hydrotray_set_seed" -/// From base of /obj/machinery/hydroponics/set_self_sustaining() : (new_value) -////#define COMSIG_HYDROTRAY_SET_SELFSUSTAINING "hydrotray_set_selfsustaining" -/// From base of /obj/machinery/hydroponics/set_weedlevel() : (new_value) -////#define COMSIG_HYDROTRAY_SET_WEEDLEVEL "hydrotray_set_weedlevel" -/// From base of /obj/machinery/hydroponics/set_pestlevel() : (new_value) -////#define COMSIG_HYDROTRAY_SET_PESTLEVEL "hydrotray_set_pestlevel" -/// From base of /obj/machinery/hydroponics/set_waterlevel() : (new_value) -////#define COMSIG_HYDROTRAY_SET_WATERLEVEL "hydrotray_set_waterlevel" -/// From base of /obj/machinery/hydroponics/set_plant_health() : (new_value) -////#define COMSIG_HYDROTRAY_SET_PLANT_HEALTH "hydrotray_set_plant_health" -/// From base of /obj/machinery/hydroponics/set_toxic() : (new_value) -////#define COMSIG_HYDROTRAY_SET_TOXIC "hydrotray_set_toxic" -/// From base of /obj/machinery/hydroponics/set_plant_status() : (new_value) -////#define COMSIG_HYDROTRAY_SET_PLANT_STATUS "hydrotray_set_plant_status" -/// From base of /obj/machinery/hydroponics/update_tray() : (mob/user, product_count) -////#define COMSIG_HYDROTRAY_ON_HARVEST "hydrotray_on_harvest" -/// From base of /obj/machinery/hydroponics/plantdies() -////#define COMSIG_HYDROTRAY_PLANT_DEATH "hydrotray_plant_death" diff --git a/code/__DEFINES/dcs/signals/signals_janitor.dm b/code/__DEFINES/dcs/signals/signals_janitor.dm deleted file mode 100644 index e624d4abadf6..000000000000 --- a/code/__DEFINES/dcs/signals/signals_janitor.dm +++ /dev/null @@ -1,21 +0,0 @@ -/** - *! ## Janitor Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -/// Called on an object to "clean it", such as removing blood decals/overlays, etc. The clean types bitfield is sent with it. Return TRUE if any cleaning was necessary and thus performed. -////#define COMSIG_COMPONENT_CLEAN_ACT "clean_act" - ///? Returned by cleanable components when they are cleaned. - ////#define COMPONENT_CLEANED (1<<0) - -//! Vacuum signals -/// Called on a bag being attached to a vacuum parent -////#define COMSIG_VACUUM_BAG_ATTACH "comsig_vacuum_bag_attach" -/// Called on a bag being detached from a vacuum parent -////#define COMSIG_VACUUM_BAG_DETACH "comsig_vacuum_bag_detach" - -///(): Returns bitflags of wet values. -////#define COMSIG_TURF_IS_WET "check_turf_wet" -///(max_strength, immediate, duration_decrease = INFINITY): Returns bool. -////#define COMSIG_TURF_MAKE_DRY "make_turf_try" diff --git a/code/__DEFINES/dcs/signals/signals_ladder.dm b/code/__DEFINES/dcs/signals/signals_ladder.dm deleted file mode 100644 index 2ddf0439c7ed..000000000000 --- a/code/__DEFINES/dcs/signals/signals_ladder.dm +++ /dev/null @@ -1,9 +0,0 @@ -/** - *! ## Ladder Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -/// Called on a mob attempting to use a ladder to go in either direction. (entrance_ladder, exit_ladder, going_up) -////#define COMSIG_LADDER_TRAVEL "ladder-travel" - ////#define LADDER_TRAVEL_BLOCK (1<<0) diff --git a/code/__DEFINES/dcs/signals/signals_light_eater.dm b/code/__DEFINES/dcs/signals/signals_light_eater.dm deleted file mode 100644 index 7a2fdeae5ff9..000000000000 --- a/code/__DEFINES/dcs/signals/signals_light_eater.dm +++ /dev/null @@ -1,15 +0,0 @@ -/** - *! ## Light Eater Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -//! /datum/element/light_eater -/// From base of [/datum/element/light_eater/proc/table_buffet]: (list/light_queue, datum/light_eater) -////#define COMSIG_LIGHT_EATER_QUEUE "light_eater_queue" -/// From base of [/datum/element/light_eater/proc/devour]: (datum/light_eater) -////#define COMSIG_LIGHT_EATER_ACT "light_eater_act" - ///? Prevents the default light eater behavior from running in case of immunity or custom behavior - ////#define COMPONENT_BLOCK_LIGHT_EATER (1<<0) -/// From base of [/datum/element/light_eater/proc/devour]: (atom/eaten_light) -////#define COMSIG_LIGHT_EATER_DEVOUR "light_eater_devour" diff --git a/code/__DEFINES/dcs/signals/signals_medical.dm b/code/__DEFINES/dcs/signals/signals_medical.dm deleted file mode 100644 index 5c3dd0d2d5f9..000000000000 --- a/code/__DEFINES/dcs/signals/signals_medical.dm +++ /dev/null @@ -1,11 +0,0 @@ -/** - *! ## Medical Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -/// From /datum/surgery/New(): (datum/surgery/surgery, surgery_location (body zone), obj/item/bodypart/targeted_limb) -////#define COMSIG_MOB_SURGERY_STARTED "mob_surgery_started" - -/// From /datum/surgery_step/success(): (datum/surgery_step/step, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results) -////#define COMSIG_MOB_SURGERY_STEP_SUCCESS "mob_surgery_step_success" diff --git a/code/__DEFINES/dcs/signals/signals_mind.dm b/code/__DEFINES/dcs/signals/signals_mind.dm deleted file mode 100644 index 5f1bfae786fe..000000000000 --- a/code/__DEFINES/dcs/signals/signals_mind.dm +++ /dev/null @@ -1,14 +0,0 @@ -/** - *! ## Mind Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -/// From mind/transfer_to. Sent after the mind has been transferred: (mob/previous_body) -////#define COMSIG_MIND_TRANSFERRED "mind_transferred" - -/// Called on the mind when an antagonist is being gained, after the antagonist list has updated (datum/antagonist/antagonist) -////#define COMSIG_ANTAGONIST_GAINED "antagonist_gained" - -/// Called on the mind when an antagonist is being removed, after the antagonist list has updated (datum/antagonist/antagonist) -////#define COMSIG_ANTAGONIST_REMOVED "antagonist_removed" diff --git a/code/__DEFINES/dcs/signals/signals_modsuit.dm b/code/__DEFINES/dcs/signals/signals_modsuit.dm deleted file mode 100644 index c0bc5050148b..000000000000 --- a/code/__DEFINES/dcs/signals/signals_modsuit.dm +++ /dev/null @@ -1,30 +0,0 @@ -/** - *! ## MODsuit Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -/// Called when a module is selected to be the active one from on_select(obj/item/mod/module/module) -////#define COMSIG_MOD_MODULE_SELECTED "mod_module_selected" -/// Called when a MOD activation is called from toggle_activate(mob/user) -////#define COMSIG_MOD_ACTIVATE "mod_activate" - ///? Cancels the suit's activation - ////#define MOD_CANCEL_ACTIVATE (1 << 0) -/// Called when a MOD is having modules removed from crowbar_act(mob/user, obj/crowbar) -////#define COMSIG_MOD_MODULE_REMOVAL "mod_module_removal" - ///? Cancels the removal of modules - ////#define MOD_CANCEL_REMOVAL (1 << 0) -/// Called when a module attempts to activate, however it does. At the end of checks so you can add some yourself, or work on trigger behavior (mob/user) -////#define COMSIG_MODULE_TRIGGERED "mod_module_triggered" - ///? Cancels activation, with no message. include feedback on your cancel. - ////#define MOD_ABORT_USE (1<<0) -/// Called when a module activates, after all checks have passed and cooldown started. -////#define COMSIG_MODULE_ACTIVATED "mod_module_activated" -/// Called when a module deactivates, after all checks have passed. -////#define COMSIG_MODULE_DEACTIVATED "mod_module_deactivated" -/// Called when a module is used, after all checks have passed and cooldown started. -////#define COMSIG_MODULE_USED "mod_module_used" -/// Called when the MODsuit wearer is set. -////#define COMSIG_MOD_WEARER_SET "mod_wearer_set" -/// Called when the MODsuit wearer is unset. -////#define COMSIG_MOD_WEARER_UNSET "mod_wearer_unset" diff --git a/code/__DEFINES/dcs/signals/signals_mood.dm b/code/__DEFINES/dcs/signals/signals_mood.dm deleted file mode 100644 index c8eb6cb03b35..000000000000 --- a/code/__DEFINES/dcs/signals/signals_mood.dm +++ /dev/null @@ -1,12 +0,0 @@ -/** - *! ## Mood Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -/// Called when you send a mood event from anywhere in the code. -////#define COMSIG_ADD_MOOD_EVENT "add_mood" -/// Mood event that only RnD members listen for -////#define COMSIG_ADD_MOOD_EVENT_RND "RND_add_mood" -/// Called when you clear a mood event from anywhere in the code. -////#define COMSIG_CLEAR_MOOD_EVENT "clear_mood" diff --git a/code/__DEFINES/dcs/signals/signals_moveloop.dm b/code/__DEFINES/dcs/signals/signals_moveloop.dm deleted file mode 100644 index 13e4c99c7155..000000000000 --- a/code/__DEFINES/dcs/signals/signals_moveloop.dm +++ /dev/null @@ -1,17 +0,0 @@ -/** - *! ## Moveloop Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -/// From [/datum/move_loop/start_loop] (): -////#define COMSIG_MOVELOOP_START "moveloop_start" -/// From [/datum/move_loop/stop_loop] (): -////#define COMSIG_MOVELOOP_STOP "moveloop_stop" -/// From [/datum/move_loop/process] (): -////#define COMSIG_MOVELOOP_PREPROCESS_CHECK "moveloop_preprocess_check" - ////#define MOVELOOP_SKIP_STEP (1<<0) -/// From [/datum/move_loop/process] (succeeded, visual_delay): -////#define COMSIG_MOVELOOP_POSTPROCESS "moveloop_postprocess" -/// From [/datum/move_loop/has_target/jps/recalculate_path] (): -////#define COMSIG_MOVELOOP_JPS_REPATH "moveloop_jps_repath" diff --git a/code/__DEFINES/dcs/signals/signals_movetype.dm b/code/__DEFINES/dcs/signals/signals_movetype.dm deleted file mode 100644 index 4cce601d3486..000000000000 --- a/code/__DEFINES/dcs/signals/signals_movetype.dm +++ /dev/null @@ -1,13 +0,0 @@ -/** - *! ## Movetype Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -//! /datum/element/movetype_handler signals -/// Called when the floating anim has to be temporarily stopped and restarted later: (timer) -////#define COMSIG_PAUSE_FLOATING_ANIM "pause_floating_anim" -/// From base of datum/element/movetype_handler/on_movement_type_trait_gain: (flag, old_movement_type) -////#define COMSIG_MOVETYPE_FLAG_ENABLED "movetype_flag_enabled" -/// From base of datum/element/movetype_handler/on_movement_type_trait_loss: (flag, old_movement_type) -////#define COMSIG_MOVETYPE_FLAG_DISABLED "movetype_flag_disabled" diff --git a/code/__DEFINES/dcs/signals/signals_music.dm b/code/__DEFINES/dcs/signals/signals_music.dm deleted file mode 100644 index ddbfdb6de529..000000000000 --- a/code/__DEFINES/dcs/signals/signals_music.dm +++ /dev/null @@ -1,17 +0,0 @@ -/** - *! ## Music Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -//! /datum/song Signals -/// Sent to the instrument when a song starts playing -////#define COMSIG_INSTRUMENT_START "instrument_start" -/// Sent to the instrument when a song stops playing -////#define COMSIG_INSTRUMENT_END "instrument_end" -/// Sent to the instrument on /should_stop_playing(): (atom/player). Return values can be found in DEFINES/song.dm -////#define COMSIG_INSTRUMENT_SHOULD_STOP_PLAYING "instrument_should_stop_playing" -/// Sent to the instrument (and player if available) when a song repeats (datum/song) -////#define COMSIG_INSTRUMENT_REPEAT "instrument_repeat" -/// Sent to the instrument when tempo changes, skipped on new. (datum/song) -////#define COMSIG_INSTRUMENT_TEMPO_CHANGE "instrument_tempo_change" diff --git a/code/__DEFINES/dcs/signals/signals_operating_computer.dm b/code/__DEFINES/dcs/signals/signals_operating_computer.dm deleted file mode 100644 index 39d85d39b504..000000000000 --- a/code/__DEFINES/dcs/signals/signals_operating_computer.dm +++ /dev/null @@ -1,10 +0,0 @@ -/** - *! ## Operating Computer Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -//! /obj/machinery/computer/operating Signals -/// Fired when a dissection surgery completes. -/// (mob/living/target) -////#define COMSIG_OPERATING_COMPUTER_DISSECTION_COMPLETE "operating_computer_dissection_complete" diff --git a/code/__DEFINES/dcs/signals/signals_painting.dm b/code/__DEFINES/dcs/signals/signals_painting.dm deleted file mode 100644 index 6261670366f3..000000000000 --- a/code/__DEFINES/dcs/signals/signals_painting.dm +++ /dev/null @@ -1,12 +0,0 @@ -/** - *! ## Painting Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -//! Signals for painting canvases, tools and the /datum/component/palette component -/// From base of /item/proc/set_painting_tool_color(): (chosen_color) -////#define COMSIG_PAINTING_TOOL_SET_COLOR "painting_tool_set_color" - -/// From base of /item/canvas/ui_data(mob/user, datum/tgui/ui) -////#define COMSIG_PAINTING_TOOL_GET_ADDITIONAL_DATA "painting_tool_get_data" diff --git a/code/__DEFINES/dcs/signals/signals_reagent.dm b/code/__DEFINES/dcs/signals/signals_reagent.dm deleted file mode 100644 index 8283c2ca958a..000000000000 --- a/code/__DEFINES/dcs/signals/signals_reagent.dm +++ /dev/null @@ -1,57 +0,0 @@ -/** - *! ## Reagent Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -/// From base of atom/expose_reagents(): (/list, /datum/reagents, methods, volume_modifier, show_message) -////#define COMSIG_ATOM_EXPOSE_REAGENTS "atom_expose_reagents" - ///? Prevents the atom from being exposed to reagents if returned on [COMSIG_ATOM_EXPOSE_REAGENTS] - ////#define COMPONENT_NO_EXPOSE_REAGENTS (1<<0) -/// From base of [/datum/reagent/proc/expose_atom]: (/datum/reagent, reac_volume) -////#define COMSIG_ATOM_EXPOSE_REAGENT "atom_expose_reagent" -/// From base of [/datum/reagent/proc/expose_atom]: (/atom, reac_volume) -////#define COMSIG_REAGENT_EXPOSE_ATOM "reagent_expose_atom" -/// From base of [/datum/reagent/proc/expose_atom]: (/obj, reac_volume) -////#define COMSIG_REAGENT_EXPOSE_OBJ "reagent_expose_obj" -/// From base of [/datum/reagent/proc/expose_atom]: (/mob/living, reac_volume, methods, show_message, touch_protection, /mob/camera/blob) // ovemind arg is only used by blob reagents. -////#define COMSIG_REAGENT_EXPOSE_MOB "reagent_expose_mob" -/// From base of [/datum/reagent/proc/expose_atom]: (/turf, reac_volume) -////#define COMSIG_REAGENT_EXPOSE_TURF "reagent_expose_turf" - -/// From base of [/datum/controller/subsystem/materials/proc/InitializeMaterial]: (/datum/material) -////#define COMSIG_MATERIALS_INIT_MAT "SSmaterials_init_mat" - -/// From base of [/datum/component/multiple_lives/proc/respawn]: (mob/respawned_mob, gibbed, lives_left) -////#define COMSIG_ON_MULTIPLE_LIVES_RESPAWN "on_multiple_lives_respawn" - -/// From base of [/datum/reagents/proc/add_reagent] - Sent before the reagent is added: (reagenttype, amount, reagtemp, data, no_react) -////#define COMSIG_REAGENTS_PRE_ADD_REAGENT "reagents_pre_add_reagent" - ///? Prevents the reagent from being added. - ////#define COMPONENT_CANCEL_REAGENT_ADD (1<<0) -/// From base of [/datum/reagents/proc/add_reagent]: (/datum/reagent, amount, reagtemp, data, no_react) -////#define COMSIG_REAGENTS_NEW_REAGENT "reagents_new_reagent" -/// From base of [/datum/reagents/proc/add_reagent]: (/datum/reagent, amount, reagtemp, data, no_react) -////#define COMSIG_REAGENTS_ADD_REAGENT "reagents_add_reagent" -/// From base of [/datum/reagents/proc/del_reagent]: (/datum/reagent) -////#define COMSIG_REAGENTS_DEL_REAGENT "reagents_del_reagent" -/// From base of [/datum/reagents/proc/remove_reagent]: (/datum/reagent, amount) -////#define COMSIG_REAGENTS_REM_REAGENT "reagents_rem_reagent" -/// From base of [/datum/reagents/proc/clear_reagents]: () -////#define COMSIG_REAGENTS_CLEAR_REAGENTS "reagents_clear_reagents" -/// From base of [/datum/reagents/proc/set_temperature]: (new_temp, old_temp) -////#define COMSIG_REAGENTS_TEMP_CHANGE "reagents_temp_change" -/// From base of [/datum/reagents/proc/handle_reactions]: (num_reactions) -////#define COMSIG_REAGENTS_REACTED "reagents_reacted" -/// From base of [/datum/reagents/proc/process]: (num_reactions) -////#define COMSIG_REAGENTS_REACTION_STEP "reagents_time_step" -/// From base of [/atom/proc/expose_reagents]: (/atom, /list, methods, volume_modifier, show_message) -////#define COMSIG_REAGENTS_EXPOSE_ATOM "reagents_expose_atom" -/// From base of [/obj/proc/expose_reagents]: (/obj, /list, methods, volume_modifier, show_message) -////#define COMSIG_REAGENTS_EXPOSE_OBJ "reagents_expose_obj" -/// From base of [/mob/living/proc/expose_reagents]: (/mob/living, /list, methods, volume_modifier, show_message, touch_protection) -////#define COMSIG_REAGENTS_EXPOSE_MOB "reagents_expose_mob" -/// From base of [/turf/proc/expose_reagents]: (/turf, /list, methods, volume_modifier, show_message) -////#define COMSIG_REAGENTS_EXPOSE_TURF "reagents_expose_turf" -/// From base of [/datum/component/personal_crafting/proc/del_reqs]: () -////#define COMSIG_REAGENTS_CRAFTING_PING "reagents_crafting_ping" diff --git a/code/__DEFINES/dcs/signals/signals_restaurant.dm b/code/__DEFINES/dcs/signals/signals_restaurant.dm deleted file mode 100644 index 7b63146f03b5..000000000000 --- a/code/__DEFINES/dcs/signals/signals_restaurant.dm +++ /dev/null @@ -1,8 +0,0 @@ -/** - *! ## Restaurant Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -/// (customer, container) venue signal sent when a venue sells an item. source is the thing sold, which can be a datum, so we send container for location checks -////#define COMSIG_ITEM_SOLD_TO_CUSTOMER "item_sold_to_customer" diff --git a/code/__DEFINES/dcs/signals/signals_scangate.dm b/code/__DEFINES/dcs/signals/signals_scangate.dm deleted file mode 100644 index 4db863999594..000000000000 --- a/code/__DEFINES/dcs/signals/signals_scangate.dm +++ /dev/null @@ -1,14 +0,0 @@ -/** - *! ## Scangate Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -/// Called when somebody passes through a scanner gate and it triggers -////#define COMSIG_SCANGATE_PASS_TRIGGER "scangate_pass_trigger" - -/// Called when somebody passes through a scanner gate and it does not trigger -////#define COMSIG_SCANGATE_PASS_NO_TRIGGER "scangate_pass_no_trigger" - -/// Called when something passes through a scanner gate shell -////#define COMSIG_SCANGATE_SHELL_PASS "scangate_shell_pass" diff --git a/code/__DEFINES/dcs/signals/signals_screentips.dm b/code/__DEFINES/dcs/signals/signals_screentips.dm deleted file mode 100644 index f0a3ac01a391..000000000000 --- a/code/__DEFINES/dcs/signals/signals_screentips.dm +++ /dev/null @@ -1,29 +0,0 @@ -/** - *! ## Screentip Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -/// A "Type-A" contextual screentip interaction. -/// These are used for items that are defined by their behavior. They define their contextual text within *themselves*, -/// not in their targets. -/// Examples include syringes (LMB to inject, RMB to draw) and health analyzers (LMB to scan health/wounds, RMB for chems) -/// Items can override `add_item_context()`, and call `register_item_context()` in order to easily connect to this. -/// Called on /obj/item with a mutable screentip context list, the hovered target, and the mob hovering. -/// A screentip context list is a list that has context keys (SCREENTIP_CONTEXT_*, from __DEFINES/screentips.dm) -/// that map to the action as text. -/// If you mutate the list in this signal, you must return CONTEXTUAL_SCREENTIP_SET. -////#define COMSIG_ITEM_REQUESTING_CONTEXT_FOR_TARGET "item_requesting_context_for_target" - -/// A "Type-B" contextual screentip interaction. -/// These are atoms that are defined by what happens *to* them. These should define contextual text within themselves, and -/// not in their operating tools. -/// Examples include construction objects (LMB with glass to put in screen for computers). -/// Called on /atom with a mutable screentip context list, the item being used, and the mob hovering. -/// A screentip context list is a list that has context keys (SCREENTIP_CONTEXT_*, from __DEFINES/screentips.dm) -/// that map to the action as text. -/// If you mutate the list in this signal, you must return CONTEXTUAL_SCREENTIP_SET. -////#define COMSIG_ATOM_REQUESTING_CONTEXT_FROM_ITEM "atom_requesting_context_from_item" - -/// Tells the contextual screentips system that the list context was mutated. -////#define CONTEXTUAL_SCREENTIP_SET (1 << 0) diff --git a/code/__DEFINES/dcs/signals/signals_spatial_grid.dm b/code/__DEFINES/dcs/signals/signals_spatial_grid.dm deleted file mode 100644 index 6a1e8d05b2e6..000000000000 --- a/code/__DEFINES/dcs/signals/signals_spatial_grid.dm +++ /dev/null @@ -1,10 +0,0 @@ -/** - *! ## Spatial Grid Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -/// Called from base of /datum/controller/subsystem/spatial_grid/proc/enter_cell: (/atom/movable) -////#define SPATIAL_GRID_CELL_ENTERED(contents_type) "spatial_grid_cell_entered_[contents_type]" -/// Called from base of /datum/controller/subsystem/spatial_grid/proc/exit_cell: (/atom/movable) -////#define SPATIAL_GRID_CELL_EXITED(contents_type) "spatial_grid_cell_exited_[contents_type]" diff --git a/code/__DEFINES/dcs/signals/signals_species.dm b/code/__DEFINES/dcs/signals/signals_species.dm deleted file mode 100644 index 96e63bb7f2b7..000000000000 --- a/code/__DEFINES/dcs/signals/signals_species.dm +++ /dev/null @@ -1,10 +0,0 @@ -/** - *! ## /datum/species Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -/// From datum/species/on_species_gain(): (datum/species/new_species, datum/species/old_species) -////#define COMSIG_SPECIES_GAIN "species_gain" -/// From datum/species/on_species_loss(): (datum/species/lost_species) -////#define COMSIG_SPECIES_LOSS "species_loss" diff --git a/code/__DEFINES/dcs/signals/signals_subsystem.dm b/code/__DEFINES/dcs/signals/signals_subsystem.dm deleted file mode 100644 index 4f59bb7730e5..000000000000 --- a/code/__DEFINES/dcs/signals/signals_subsystem.dm +++ /dev/null @@ -1,23 +0,0 @@ -/** - *! ## 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: (start_timeofday) -////#define COMSIG_SUBSYSTEM_POST_INITIALIZE "subsystem_post_initialize" -/// Called when the ticker enters the pre-game phase -////#define COMSIG_TICKER_ENTER_PREGAME "comsig_ticker_enter_pregame" -/// Called when the ticker sets up the game for start -////#define COMSIG_TICKER_ENTER_SETTING_UP "comsig_ticker_enter_setting_up" -/// Called when the ticker fails to set up the game for start -////#define COMSIG_TICKER_ERROR_SETTING_UP "comsig_ticker_error_setting_up" -/// Called when the round has started, but before GAME_STATE_PLAYING -////#define COMSIG_TICKER_ROUND_STARTING "comsig_ticker_round_starting" - -//! Point of interest signals -/// Sent from base of /datum/controller/subsystem/points_of_interest/proc/on_poi_element_added : (atom/new_poi) -////#define COMSIG_ADDED_POINT_OF_INTEREST "added_point_of_interest" -/// Sent from base of /datum/controller/subsystem/points_of_interest/proc/on_poi_element_removed : (atom/old_poi) -////#define COMSIG_REMOVED_POINT_OF_INTEREST "removed_point_of_interest" diff --git a/code/__DEFINES/dcs/signals/signals_swab.dm b/code/__DEFINES/dcs/signals/signals_swab.dm deleted file mode 100644 index 1d9376b29440..000000000000 --- a/code/__DEFINES/dcs/signals/signals_swab.dm +++ /dev/null @@ -1,10 +0,0 @@ -/** - *! ## Swab Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -//! /datum/component/swabbing signals -/// Called when you try to swab something using the swabable component, includes a mutable list of what has been swabbed so far so it can be modified. -////#define COMSIG_SWAB_FOR_SAMPLES "swab_for_samples" - ////#define COMPONENT_SWAB_FOUND (1<<0) diff --git a/code/__DEFINES/dcs/signals/signals_techweb.dm b/code/__DEFINES/dcs/signals/signals_techweb.dm deleted file mode 100644 index be78012e1704..000000000000 --- a/code/__DEFINES/dcs/signals/signals_techweb.dm +++ /dev/null @@ -1,11 +0,0 @@ -/** - *! ## Techweb Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -/// Called when a techweb design is researched (datum/design/researched_design, custom) -////#define COMSIG_TECHWEB_ADD_DESIGN "techweb_add_design" - -/// Called when a techweb design is removed (datum/design/removed_design, custom) -////#define COMSIG_TECHWEB_REMOVE_DESIGN "techweb_remove_design" diff --git a/code/__DEFINES/dcs/signals/signals_traitor.dm b/code/__DEFINES/dcs/signals/signals_traitor.dm deleted file mode 100644 index 16a8f964859a..000000000000 --- a/code/__DEFINES/dcs/signals/signals_traitor.dm +++ /dev/null @@ -1,28 +0,0 @@ -/** - *! ## Traitor Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -/// Called when the hack_comm_console objective is completed. -////#define COMSIG_GLOB_TRAITOR_OBJECTIVE_COMPLETED "!traitor_objective_completed" - -/// Called whenever the uplink handler receives any sort of update. Used by uplinks to update their UI. No arguments passed -////#define COMSIG_UPLINK_HANDLER_ON_UPDATE "uplink_handler_on_update" - -/// Called before the traitor objective is generated -////#define COMSIG_TRAITOR_OBJECTIVE_PRE_GENERATE "traitor_objective_pre_generate" - ////#define COMPONENT_TRAITOR_OBJECTIVE_ABORT_GENERATION (1<<0) -/// Called whenever the traitor objective is completed -////#define COMSIG_TRAITOR_OBJECTIVE_COMPLETED "traitor_objective_completed" -/// Called whenever the traitor objective is failed -////#define COMSIG_TRAITOR_OBJECTIVE_FAILED "traitor_objective_failed" - -/// Called when a traitor bug is planted in an area -////#define COMSIG_TRAITOR_BUG_PLANTED_GROUND "traitor_bug_planted_area" -/// Called when a traitor bug is planted -////#define COMSIG_TRAITOR_BUG_PLANTED_OBJECT "traitor_bug_planted_object" -/// Called before a traitor bug is planted, where it can still be overrided -////#define COMSIG_TRAITOR_BUG_PRE_PLANTED_OBJECT "traitor_bug_planted_pre_object" - ////#define COMPONENT_FORCE_PLACEMENT (1<<0) - ////#define COMPONENT_FORCE_FAIL_PLACEMENT (1<<1) diff --git a/code/__DEFINES/dcs/signals/signals_tram.dm b/code/__DEFINES/dcs/signals/signals_tram.dm deleted file mode 100644 index 2448b97fbf87..000000000000 --- a/code/__DEFINES/dcs/signals/signals_tram.dm +++ /dev/null @@ -1,11 +0,0 @@ -/** - *! ## Tram Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -/// Sent from /obj/structure/industrial_lift/tram when its travelling status updates. (travelling) -////#define COMSIG_TRAM_SET_TRAVELLING "tram_set_travelling" - -/// Sent from /obj/structure/industrial_lift/tram when it begins to travel. (obj/landmark/tram/from_where, obj/landmark/tram/to_where) -////#define COMSIG_TRAM_TRAVEL "tram_travel" diff --git a/code/__DEFINES/dcs/signals/signals_transform.dm b/code/__DEFINES/dcs/signals/signals_transform.dm deleted file mode 100644 index 70e9a50b7f72..000000000000 --- a/code/__DEFINES/dcs/signals/signals_transform.dm +++ /dev/null @@ -1,14 +0,0 @@ -/** - *! ## Transform Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -/// From /datum/component/transforming/proc/on_attack_self(obj/item/source, mob/user): (obj/item/source, mob/user, active) -////#define COMSIG_TRANSFORMING_PRE_TRANSFORM "transforming_pre_transform" - ///? Return COMPONENT_BLOCK_TRANSFORM to prevent the item from transforming. - ////#define COMPONENT_BLOCK_TRANSFORM (1<<0) -/// From /datum/component/transforming/proc/do_transform(obj/item/source, mob/user): (obj/item/source, mob/user, active) -////#define COMSIG_TRANSFORMING_ON_TRANSFORM "transforming_on_transform" - ///? Return COMPONENT_NO_DEFAULT_MESSAGE to prevent the transforming component from displaying the default transform message / sound. - ////#define COMPONENT_NO_DEFAULT_MESSAGE (1<<0) diff --git a/code/__DEFINES/dcs/signals/signals_vehicle.dm b/code/__DEFINES/dcs/signals/signals_vehicle.dm deleted file mode 100644 index eec3f538ce1a..000000000000 --- a/code/__DEFINES/dcs/signals/signals_vehicle.dm +++ /dev/null @@ -1,10 +0,0 @@ -/** - *! ## Vehicle Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -/// Called on a mob when they start riding a vehicle (obj/vehicle) -////#define COMSIG_VEHICLE_RIDDEN "vehicle-ridden" - ///? Return this to signal that the mob should be removed from the vehicle - ////#define EJECT_FROM_VEHICLE (1<<0) diff --git a/code/__DEFINES/dcs/signals/signals_wash.dm b/code/__DEFINES/dcs/signals/signals_wash.dm deleted file mode 100644 index 68127bafba2c..000000000000 --- a/code/__DEFINES/dcs/signals/signals_wash.dm +++ /dev/null @@ -1,8 +0,0 @@ -/** - *! ## Washing Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -/// Called when you wash your face at a sink: (num/strength) -////#define COMSIG_COMPONENT_CLEAN_FACE_ACT "clean_face_act" diff --git a/code/__DEFINES/dcs/signals/signals_xeno_control.dm b/code/__DEFINES/dcs/signals/signals_xeno_control.dm deleted file mode 100644 index 6eaeba74a800..000000000000 --- a/code/__DEFINES/dcs/signals/signals_xeno_control.dm +++ /dev/null @@ -1,19 +0,0 @@ -/** - *! ## Xenobiology Signals. Format: - * * When the signal is called: (signal arguments) - * * All signals send the source datum of the signal as the first argument - */ - -//! Xenobio Hotkeys -/// From slime CtrlClickOn(): (/mob) -////#define COMSIG_XENO_SLIME_CLICK_CTRL "xeno_slime_click_ctrl" -/// From slime AltClickOn(): (/mob) -////#define COMSIG_XENO_SLIME_CLICK_ALT "xeno_slime_click_alt" -/// From slime ShiftClickOn(): (/mob) -////#define COMSIG_XENO_SLIME_CLICK_SHIFT "xeno_slime_click_shift" -/// From turf ShiftClickOn(): (/mob) -////#define COMSIG_XENO_TURF_CLICK_SHIFT "xeno_turf_click_shift" -/// From turf AltClickOn(): (/mob) -////#define COMSIG_XENO_TURF_CLICK_CTRL "xeno_turf_click_alt" -/// From monkey CtrlClickOn(): (/mob) -////#define COMSIG_XENO_MONKEY_CLICK_CTRL "xeno_monkey_click_ctrl" diff --git a/code/__DEFINES/frames.dm b/code/__DEFINES/frames.dm new file mode 100644 index 000000000000..cdf493afb4e9 --- /dev/null +++ b/code/__DEFINES/frames.dm @@ -0,0 +1,76 @@ +//* This file is explicitly licensed under the MIT license. *// +//* Copyright (c) 2023 Citadel Station developers. *// + +//* request types + +/// use x of a specific stack type +/// request is typepath of stack +/// amount is stack amount used +#define FRAME_REQUEST_TYPE_STACK "!STACK" +/// use x of a material +/// request is typepath of material +/// amount is stack amount used +#define FRAME_REQUEST_TYPE_MATERIAL "!MATERIAL" +/// use x of an item +/// request is typepath of item +/// amount is items used +#define FRAME_REQUEST_TYPE_ITEM "!ITEM" +/// rely on proc +#define FRAME_REQUEST_TYPE_PROC "!PROC" +/// interact with hand +/// amount is time needed +#define FRAME_REQUEST_TYPE_INTERACT "!INTERACT" +/// request is tool function +/// amount is time needed +#define FRAME_REQUEST_TYPE_TOOL "!TOOL" + +//* special stages + +/// deconstruct; usually default behavior on reverting past first stage +#define FRAME_STAGE_DECONSTRUCT "!DEL" +/// finish; usually default behavior on progressing past last stage +#define FRAME_STAGE_FINISH "!FIN" + +//* special contexts + +/// automatic context for storing items put into the frame +#define FRAME_CONTEXT_FOR_STAGE(N) "![N]-parts" + +//* special things + +#define AUTO_FRAME_DATUM(TYPEPATH, EXTENSION, ICON) \ +/obj/structure/frame2/##EXTENSION { \ + icon = ##ICON; \ + frame = ##TYPEPATH; \ +} \ +/obj/structure/frame2/##EXTENSION/unanchored { \ + anchored = FALSE; \ +} \ +/obj/item/frame2/##EXTENSION { \ + icon = ##ICON; \ + frame = ##TYPEPATH; \ +} \ +##TYPEPATH { \ + icon = ##ICON; \ +} + +#define AUTO_FRAME_DATUM_UNANCHORABLE(TYPEPATH, EXTENSION, ICON) \ +AUTO_FRAME_DATUM(TYPEPATH, EXTENSION, ICON); \ +/obj/structure/frame2/##EXTENSION/unanchored { \ + anchored = FALSE; \ +} + +//* text template fragments + +/// "firstname lastname" +#define FRAME_TEXT_TOKEN_PERFORMER "!performer" +/// "the fire alarm frame" +#define FRAME_TEXT_TOKEN_FRAME "!frame" +/// "the fire alarm electronics" or "the welding torch" +#define FRAME_TEXT_TOKEN_TOOL "!tool" +/// pronoun for 'their' +#define FRAME_TEXT_TOKEN_THEIR "!their" +/// pronoun for 'them' +#define FRAME_TEXT_TOKEN_THEM "!them" +/// pronoun for 'they're' (he's, she's, etc) +#define FRAME_TEXT_TOKEN_THEYRE "!theyre" diff --git a/code/__DEFINES/inventory/procs.dm b/code/__DEFINES/inventory/procs.dm index 2f6581457636..ee68a510c377 100644 --- a/code/__DEFINES/inventory/procs.dm +++ b/code/__DEFINES/inventory/procs.dm @@ -60,7 +60,7 @@ #define INVENTORY_SLOT_DOES_NOT_EXIST -1 //! return values for inv view/strip/access/panel procs: -//? /datum/inventory_slot_meta/proc/check_strip_conceal() +//? /datum/inventory_slot/proc/check_strip_conceal() /// do not show slot #define INV_VIEW_OBFUSCATE_HIDE_SLOT (1<<0) /// do not allow operations diff --git a/code/__DEFINES/inventory/slots.dm b/code/__DEFINES/inventory/slots.dm index d6a73c831463..682ea7ec1cf1 100644 --- a/code/__DEFINES/inventory/slots.dm +++ b/code/__DEFINES/inventory/slots.dm @@ -141,7 +141,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, meta_slot_equipment_priority()) SLOT_ID_GLASSES, SLOT_ID_BELT, SLOT_ID_SUIT_STORAGE, - /datum/inventory_slot_meta/abstract/attach_as_accessory, + /datum/inventory_slot/abstract/attach_as_accessory, SLOT_ID_LEFT_POCKET, SLOT_ID_RIGHT_POCKET ) diff --git a/code/__DEFINES/is_helpers.dm b/code/__DEFINES/is_helpers.dm index 469155b777ba..a815909c061b 100644 --- a/code/__DEFINES/is_helpers.dm +++ b/code/__DEFINES/is_helpers.dm @@ -27,7 +27,7 @@ //Datums -#define isTaurTail(A) istype(A, /datum/sprite_accessory/tail/taur) +#define isTaurTail(A) istype(A, /datum/sprite_accessory/tail/legacy_taur) //Turfs diff --git a/code/__DEFINES/mobs/mobs.dm b/code/__DEFINES/mobs/mobs.dm index 506bbc3637a8..978368266703 100644 --- a/code/__DEFINES/mobs/mobs.dm +++ b/code/__DEFINES/mobs/mobs.dm @@ -1,81 +1,6 @@ // todo: if i haven't bad touched something in here, i probably need to & will ~silicons -// These are used as the layers for the icons, as well as indexes in a list that holds onto them. -// Technically the layers used are all -100+layer to make them FLOAT_LAYER overlays. -//! Human Overlays Indexes///////// -/// Mutations like fat, and lasereyes -#define MUTATIONS_LAYER 1 -/// Skin things added by a call on species -#define SKIN_LAYER 2 -/// Bloodied hands/feet/anything else -#define BLOOD_LAYER 3 -/// Injury overlay sprites like open wounds -#define DAMAGE_LAYER 4 -/// Overlays for open surgical sites -#define SURGERY_LAYER 5 -/// Underwear/bras/etc -#define UNDERWEAR_LAYER 6 -/// Shoe-slot item (when set to be under uniform via verb) -#define SHOES_LAYER_ALT 7 -/// Uniform-slot item -#define UNIFORM_LAYER 8 -/// ID-slot item -#define ID_LAYER 9 -/// Shoe-slot item -#define SHOES_LAYER 10 -/// Glove-slot item -#define GLOVES_LAYER 11 -/// Belt-slot item -#define BELT_LAYER 12 -/// Suit-slot item -#define SUIT_LAYER 13 -/// Some species have tails to render -#define TAIL_LAYER 14 -/// Eye-slot item -#define GLASSES_LAYER 15 -/// Belt-slot item (when set to be above suit via verb) -#define BELT_LAYER_ALT 16 -/// Suit storage-slot item -#define SUIT_STORE_LAYER 17 -/// Back-slot item -#define BACK_LAYER 18 -/// The human's hair -#define HAIR_LAYER 19 -/// Both ear-slot items (combined image) -#define EARS_LAYER 20 -/// Mob's eyes (used for glowing eyes) -#define EYES_LAYER 21 -/// Mask-slot item -#define FACEMASK_LAYER 22 -/// Head-slot item -#define HEAD_LAYER 23 -/// Handcuffs, if the human is handcuffed, in a secret inv slot -#define HANDCUFF_LAYER 24 -/// Same as handcuffs, for legcuffs -#define LEGCUFF_LAYER 25 -/// Left-hand item -#define L_HAND_LAYER 26 -/// Right-hand item -#define R_HAND_LAYER 27 -/// Wing overlay layer. -#define WING_LAYER 28 -/// Tail alt. overlay layer for fixing overlay issues. -#define TAIL_LAYER_ALT 29 -/// Effects drawn by modifiers -#define MODIFIER_EFFECTS_LAYER 30 -/// 'Mob on fire' overlay layer -#define FIRE_LAYER 31 -/// 'Mob submerged' overlay layer -#define MOB_WATER_LAYER 32 -/// 'Aimed at' overlay layer -#define TARGETED_LAYER 33 -//! KEEP THIS UPDATED, should always equal the highest number here, used to initialize a list. -#define TOTAL_LAYERS 33 -//! the offset used -#define BODY_LAYER -100 -////////////////////////////////// - // Bitflags defining which status effects could be or are inflicted on a mob. // todo: this is all terrible tbh #define STATUS_CAN_STUN (1<<0) //! Can Stun() diff --git a/code/__DEFINES/mobs/rendering.dm b/code/__DEFINES/mobs/rendering.dm new file mode 100644 index 000000000000..0b854a1f52e7 --- /dev/null +++ b/code/__DEFINES/mobs/rendering.dm @@ -0,0 +1,94 @@ +//* This file is explicitly licensed under the MIT license. *// +//* Copyright (c) 2024 silicons *// + +//* human overlay enums for standing_overlays + +#define HUMAN_OVERLAY_SKIN "skin" +#define HUMAN_OVERLAY_MUTATIONS "mutations" +#define HUMAN_OVERLAY_MODIFIERS "mutations" +#define HUMAN_OVERLAY_BLOOD "blood" +#define HUMAN_OVERLAY_EYES "eyes" +#define HUMAN_OVERLAY_DAMAGE "damage" +#define HUMAN_OVERLAY_SURGERY "surgery" +#define HUMAN_OVERLAY_UNDERWEAR "underwear" +#define HUMAN_OVERLAY_FIRE "fire" +#define HUMAN_OVERLAY_LIQUID "liquid" +#define HUMAN_OVERLAY_RHAND "rhand" +#define HUMAN_OVERLAY_LHAND "lhand" + +// todo: sprite accessories list system + +#define HUMAN_OVERLAY_HAIR "hair" +#define HUMAN_OVERLAY_FACEHAIR "facehair" +#define HUMAN_OVERLAY_TAIL "tail" +#define HUMAN_OVERLAY_WINGS "wings" +#define HUMAN_OVERLAY_HORNS "horns" +#define HUMAN_OVERLAY_EARS "ears" + +//* human rendering layers +//* human layers are via FLOAT_LAYER so all of these are negative +//* higher (so smaller subtracted numbers after FLOAT_LAYER) is on-top + +/// layer used for on-fire visual +#define HUMAN_LAYER_FIRE (FLOAT_LAYER - 25) +/// layer used for water/acid/etc overlays when you're in a pool or liquid +#define HUMAN_LAYER_LIQUID (FLOAT_LAYER - 50) +//! legacy - modifier graphics +#define HUMAN_LAYER_MODIFIERS (FLOAT_LAYER - 75) + +#define HUMAN_LAYER_SLOT_RHAND (FLOAT_LAYER - 324) +#define HUMAN_LAYER_SLOT_LHAND (FLOAT_LAYER - 325) + +#define HUMAN_LAYER_SLOT_LEGCUFFED (FLOAT_LAYER - 370) +#define HUMAN_LAYER_SLOT_HANDCUFFED (FLOAT_LAYER - 371) + +#define HUMAN_LAYER_SLOT_HEAD (FLOAT_LAYER - 375) +#define HUMAN_LAYER_SLOT_MASK (FLOAT_LAYER - 400) +#define HUMAN_LAYER_SLOT_EYES (FLOAT_LAYER - 425) +#define HUMAN_LAYER_SLOT_EARS (FLOAT_LAYER - 450) + +#define HUMAN_LAYER_SPRITEACC_HORNS_FRONT (FLOAT_LAYER - 475) +#define HUMAN_LAYER_SPRITEACC_EARS_FRONT (FLOAT_LAYER - 476) +#define HUMAN_LAYER_SPRITEACC_HAIR_FRONT (FLOAT_LAYER - 477) +#define HUMAN_LAYER_SPRITEACC_FACEHAIR_FRONT (FLOAT_LAYER - 478) +#define HUMAN_LAYER_SPRITEACC_WINGS_FRONT (FLOAT_LAYER - 479) +#define HUMAN_LAYER_SPRITEACC_TAIL_FRONT (FLOAT_LAYER - 480) + +#define HUMAN_LAYER_SLOT_BACKPACK (FLOAT_LAYER - 500) +#define HUMAN_LAYER_SLOT_SUITSTORE (FLOAT_LAYER - 525) +#define HUMAN_LAYER_SLOT_BELT_ALT (FLOAT_LAYER - 550) +#define HUMAN_LAYER_SLOT_GLASSES (FLOAT_LAYER - 575) + +#define HUMAN_LAYER_SLOT_OVERSUIT (FLOAT_LAYER - 625) +#define HUMAN_LAYER_SLOT_BELT (FLOAT_LAYER - 650) +#define HUMAN_LAYER_SLOT_GLOVES (FLOAT_LAYER - 675) +#define HUMAN_LAYER_SLOT_SHOES (FLOAT_LAYER - 700) +#define HUMAN_LAYER_SLOT_IDSLOT (FLOAT_LAYER - 725) +#define HUMAN_LAYER_SLOT_UNIFORM (FLOAT_LAYER - 750) +#define HUMAN_LAYER_SLOT_SHOES_ALT (FLOAT_LAYER - 775) + +//! legacy - underwear clothing +#define HUMAN_LAYER_UNDERWEAR (FLOAT_LAYER - 800) +//! legacy - surgery overlays +#define HUMAN_LAYER_SURGERY (FLOAT_LAYER - 825) +//! legacy - damage on limbs +#define HUMAN_LAYER_DAMAGE (FLOAT_LAYER - 850) +//! legacy - blood on skin +#define HUMAN_LAYER_BLOOD (FLOAT_LAYER - 875) +//! legacy - species skin +#define HUMAN_LAYER_SKIN (FLOAT_LAYER - 900) + +#define HUMAN_LAYER_SPRITEACC_HORNS_BEHIND (FLOAT_LAYER - 950) +#define HUMAN_LAYER_SPRITEACC_EARS_BEHIND (FLOAT_LAYER - 951) +#define HUMAN_LAYER_SPRITEACC_HAIR_BEHIND (FLOAT_LAYER - 952) +#define HUMAN_LAYER_SPRITEACC_FACEHAIR_BEHIND (FLOAT_LAYER - 953) +#define HUMAN_LAYER_SPRITEACC_WINGS_BEHIND (FLOAT_LAYER - 954) +#define HUMAN_LAYER_SPRITEACC_TAIL_BEHIND (FLOAT_LAYER - 955) + +//! legacy - genetics +#define HUMAN_LAYER_MUTATIONS (FLOAT_LAYER - 1000) + +//* Helpers *// + +/// end proc immediately if we're being deleted or transformed into something +#define HUMAN_RENDER_ABORT_IF_DELETING if(QDELING(src) || transforming) return diff --git a/code/__DEFINES/mobs/sprite_accessories.dm b/code/__DEFINES/mobs/sprite_accessories.dm index f6ebc867f7eb..2920f14941f5 100644 --- a/code/__DEFINES/mobs/sprite_accessories.dm +++ b/code/__DEFINES/mobs/sprite_accessories.dm @@ -7,3 +7,43 @@ DEFINE_BITFIELD(hair_flags, list( BITFIELD(HAIR_TIEABLE), )) // Hair Defines + +//* /datum/sprite_accessory/var/icon_sidedness +//? These must be numbers! They also must be consequetive from 1 as they are list indices for rendering! + +/// no additional states +#define SPRITE_ACCESSORY_SIDEDNESS_NONE 1 +/// -front state, and -behind state, use different layers +#define SPRITE_ACCESSORY_SIDEDNESS_FRONT_BEHIND 2 + +// todo: DEFINE_ENUM + +//* /datum/sprite_accessory/var/icon_alignment + +/// for some asinine reason just ignore it +#define SPRITE_ACCESSORY_ALIGNMENT_IGNORE "ignore" +/// center it east/west but align it to bottom edge +#define SPRITE_ACCESSORY_ALIGNMENT_BOTTOM "bottom" +/// center it fully +#define SPRITE_ACCESSORY_ALIGNMENT_CENTER "center" + +// todo: DEFINE_ENUM + +//* Sprite Accessory Slots + +#define SPRITE_ACCESSORY_SLOT_TAIL "tail" +#define SPRITE_ACCESSORY_SLOT_WINGS "wings" +#define SPRITE_ACCESSORY_SLOT_HORNS "horns" +#define SPRITE_ACCESSORY_SLOT_EARS "ears" +#define SPRITE_ACCESSORY_SLOT_HAIR "hair" +#define SPRITE_ACCESSORY_SLOT_FACEHAIR "facehair" + +// todo: DEFINE_ENUM + +//* Sprite Accessory Variations (Standard) + +#define SPRITE_ACCESSORY_VARIATION_FLAPPING "Flapping" +#define SPRITE_ACCESSORY_VARIATION_WAGGING "Wagging" +#define SPRITE_ACCESSORY_VARIATION_SPREAD "Spread" + +// todo: DEFINE_ENUM diff --git a/code/__DEFINES/rendering/atom_huds.dm b/code/__DEFINES/rendering/atom_huds.dm index 87181812b025..ab051252598b 100644 --- a/code/__DEFINES/rendering/atom_huds.dm +++ b/code/__DEFINES/rendering/atom_huds.dm @@ -1,62 +1,10 @@ -// for secHUDs and medHUDs and variants. The number is the location of the image on the list hud_list -// note: if you add more HUDs, even for non-human atoms, make sure to use unique numbers for the defines! -// /datum/atom_hud expects these to be unique -// these need to be strings in order to make them associative lists -/// dead, alive, sick, health status -#define BIOLOGY_HUD "1" -/// a simple line rounding the mob's number health -#define LIFE_HUD "2" -/// the job asigned to your ID -#define ID_HUD "3" -/// wanted, released, parroled, security status -#define WANTED_HUD "4" -/// loyality implant -#define IMPLOYAL_HUD "5" -/// chemical implant -#define IMPCHEM_HUD "6" -/// tracking implant -#define IMPTRACK_HUD "7" -/// antag icon -#define ANTAG_HUD "8" -/// animal alt appearance -#define WORLD_BENDER_ANIMAL_HUD "9" -// todo: datum hud icons +//* This file is explicitly licensed under the MIT license. *// +//* Copyright (c) 2024 silicons *// -// constant list lookup of hud to icon -GLOBAL_LIST_INIT(hud_icon_files, list( - BIOLOGY_HUD = 'icons/screen/atom_hud/biology.dmi', - LIFE_HUD = 'icons/screen/atom_hud/health.dmi', - WANTED_HUD = 'icons/screen/atom_hud/security.dmi', - IMPLOYAL_HUD = 'icons/screen/atom_hud/implant.dmi', - IMPCHEM_HUD = 'icons/screen/atom_hud/implant.dmi', - IMPTRACK_HUD = 'icons/screen/atom_hud/implant.dmi', - ANTAG_HUD = 'icons/screen/atom_hud/antag.dmi', - ID_HUD = 'icons/screen/atom_hud/job.dmi' -)) +//* sources -// constant list lookup of hud to layer -GLOBAL_LIST_INIT(hud_icon_layers, list( - BIOLOGY_HUD = 1 // render above default -)) - -//by default everything in the hud_list of an atom is an image -//a value in hud_list with one of these will change that behavior -#define HUD_LIST_LIST 1 - -//data HUD (medhud, sechud) defines -//Don't forget to update human/New() if you change these! -#define DATA_HUD_SECURITY_BASIC 1 -#define DATA_HUD_SECURITY_ADVANCED 2 -#define DATA_HUD_MEDICAL 3 -#define DATA_HUD_ID_JOB 4 - -#define HUD_ANTAG 5 - -#define WORLD_BENDER_HUD_ANIMALS 6 - -///cooldown for being shown the images for any particular data hud -#define ADD_HUD_TO_COOLDOWN 20 - -//alternate appearance flags -#define AA_TARGET_SEE_APPEARANCE (1<<0) -#define AA_MATCH_TARGET_OVERLAYS (1<<1) +#define ATOM_HUD_SOURCE_SILICON_SENSOR_AUGMENT "silicon-sensor-augment" +#define ATOM_HUD_SOURCE_FOR_HUD_GRANTER_ON_EQUIPMENT_SLOT(SLOT) "equip-[SLOT]-granter" +#define ATOM_HUD_SOURCE_OBSERVER "observer" +#define ATOM_HUD_SOURCE_NIF "nif" +#define ATOM_HUD_SOURCE_AUTOGRANT "autogrant" diff --git a/code/__DEFINES/rendering/zmimic.dm b/code/__DEFINES/rendering/zmimic.dm index e2b44def296f..7ceaa96115e1 100644 --- a/code/__DEFINES/rendering/zmimic.dm +++ b/code/__DEFINES/rendering/zmimic.dm @@ -1,41 +1,61 @@ +#define ZM_DESTRUCTION_TIMER(TARGET) addtimer(CALLBACK(TARGET, TYPE_PROC_REF(/datum, qdel_self)), 10 SECONDS, TIMER_STOPPABLE) #define TURF_IS_MIMICKING(T) (isturf(T) && (T:mz_flags & MZ_MIMIC_BELOW)) -#define CHECK_OO_EXISTENCE(OO) if (OO && !MOVABLE_IS_ON_ZTURF(OO) && !OO.destruction_timer) { OO.destruction_timer = addtimer(CALLBACK(OO, TYPE_PROC_REF(/datum, qdel_self)), 10 SECONDS, TIMER_STOPPABLE); } +#define CHECK_OO_EXISTENCE(OO) if (OO && !MOVABLE_IS_ON_ZTURF(OO) && !OO.destruction_timer) { OO.destruction_timer = ZM_DESTRUCTION_TIMER(OO); } #define UPDATE_OO_IF_PRESENT CHECK_OO_EXISTENCE(bound_overlay); if (bound_overlay) { update_above(); } // I do not apologize. -#define MOVABLE_IS_BELOW_ZTURF(M) (isturf(loc) && ((M:zmm_flags & ZMM_LOOKAHEAD) ? ((get_step(M, M:dir)?:above?:mz_flags & MZ_MIMIC_BELOW) || (loc:above?:mz_flags & MZ_MIMIC_BELOW) || (get_step(M, global.reverse_dir[M:dir])?:above?:mz_flags & MZ_MIMIC_BELOW)) : TURF_IS_MIMICKING(loc:above))) -#define MOVABLE_IS_ON_ZTURF(M) (isturf(loc) && ((M:zmm_flags & ZMM_LOOKAHEAD) ? ((get_step(M, M:dir)?:mz_flags & MZ_MIMIC_BELOW) || (loc:mz_flags & MZ_MIMIC_BELOW) || (get_step(M, global.reverse_dir[M:dir])?:mz_flags & MZ_MIMIC_BELOW)) : TURF_IS_MIMICKING(loc:above))) -//# Turf Multi-Z flags. -#define MZ_MIMIC_BELOW (1<<0) //! If this turf should mimic the turf on the Z below. -#define MZ_MIMIC_OVERWRITE (1<<1) //! If this turf is Z-mimicing, overwrite the turf's appearance instead of using a movable. This is faster, but means the turf cannot have its own appearance (say, edges or a translucent sprite). -#define MZ_MIMIC_NO_AO (1<<2) //! If the turf shouldn't apply regular turf AO and only do Z-mimic AO. -#define MZ_MIMIC_BASETURF (1<<3) //! Mimic baseturf instead of the below atom. Sometimes useful for elevators. +// These aren't intended to be used anywhere else, they just can't be undef'd because DM is dum. +#define ZM_INTERNAL_SCAN_LOOKAHEAD(M,VTR,F) ((get_step(M, M:dir)?:VTR & F) || (get_step(M, turn(M:dir, 180))?:VTR & F)) +#define ZM_INTERNAL_SCAN_LOOKBESIDE(M,VTR,F) ((get_step(M, turn(M:dir, 90))?:VTR & F) || (get_step(M, turn(M:dir, -90))?:VTR & F)) -#define MZ_ALLOW_LIGHTING (1<<4) //! If this turf should permit passage of lighting. -#define MZ_NO_OCCLUDE (1<<5) //! Don't occlude below atoms if we're a non-mimic z-turf. +/// Is this movable visible from a turf that is mimicking below? Note: this does not necessarily mean *directly* below. +#define MOVABLE_IS_BELOW_ZTURF(M) (\ + isturf(M:loc) && (TURF_IS_MIMICKING(M:loc:above) \ + || ((M:zmm_flags & ZMM_LOOKAHEAD) && ZM_INTERNAL_SCAN_LOOKAHEAD(M, above?:mz_flags, MZ_MIMIC_BELOW)) \ + || ((M:zmm_flags & ZMM_LOOKBESIDE) && ZM_INTERNAL_SCAN_LOOKBESIDE(M, above?:mz_flags, MZ_MIMIC_BELOW))) \ +) +/// Is this movable located on a turf that is mimicking below? Note: this does not necessarily mean *directly* on. +#define MOVABLE_IS_ON_ZTURF(M) (\ + (TURF_IS_MIMICKING(M:loc) \ + || ((M:zmm_flags & ZMM_LOOKAHEAD) && ZM_INTERNAL_SCAN_LOOKAHEAD(M, mz_flags, MZ_MIMIC_BELOW)) \ + || ((M:zmm_flags & ZMM_LOOKBESIDE) && ZM_INTERNAL_SCAN_LOOKBESIDE(M, mz_flags, MZ_MIMIC_BELOW))) \ +) +#define MOVABLE_SHALL_MIMIC(AM) (!(AM.zmm_flags & ZMM_IGNORE) && MOVABLE_IS_BELOW_ZTURF(AM)) + +// Turf MZ flags. +#define MZ_MIMIC_BELOW (1 << 0) //! If this turf should mimic the turf on the Z below. +#define MZ_MIMIC_OVERWRITE (1 << 1) //! If this turf is Z-mimicking, overwrite the turf's appearance instead of using a movable. This is faster, but means the turf cannot have its own appearance (say, edges or a translucent sprite). +#define MZ_ALLOW_LIGHTING (1 << 2) //! If this turf should permit passage of lighting. +#define MZ_MIMIC_NO_AO (1 << 3) //! If the turf shouldn't apply regular turf AO and only do Z-mimic AO. +#define MZ_NO_OCCLUDE (1 << 4) //! Don't occlude below atoms if we're a non-mimic z-turf. +#define MZ_OVERRIDE (1 << 5) //! Copy only z_appearance or baseturf and bail, do not attempt to copy movables. This is significantly cheaper and allows you to override the mimic, but results in movables not being visible. +#define MZ_NO_SHADOW (1 << 6) //! If this turf is being copied, hide the shadower. +#define MZ_TERMINATOR (1 << 7) //! Consider this turf the terminus of a Z-group, like the bottom of a Z-group or a MZ_OVERRIDE turf. -#define MZ_OPEN_UP (1<<6) //! Allow atom movement through top. -#define MZ_OPEN_DOWN (1<<7) //! Allow atom movement through bottom. +#define MZ_OPEN_UP (1 << 8) //! Allow atom movement through top. +#define MZ_OPEN_DOWN (1 << 9) //! Allow atom movement through bottom. -#define MZ_ATMOS_UP (1<<8) //! Allow atmos passage through top. -#define MZ_ATMOS_DOWN (1<<9) //! Allow atmos passage through bottom. +#define MZ_ATMOS_UP (1 << 10) //! Allow atmos passage through top. +#define MZ_ATMOS_DOWN (1 << 11) //! Allow atmos passage through bottom. -//# Convenience flags. -#define MZ_MIMIC_DEFAULTS (MZ_MIMIC_BELOW|MZ_ALLOW_LIGHTING) + +// Convenience flags. +#define MZ_MIMIC_DEFAULTS (MZ_MIMIC_BELOW|MZ_ALLOW_LIGHTING) //! Common defaults for zturfs. #define MZ_ATMOS_BOTH (MZ_ATMOS_UP|MZ_ATMOS_DOWN) #define MZ_OPEN_BOTH (MZ_OPEN_UP|MZ_OPEN_DOWN) +#define ZMM_WIDE_LOAD (ZMM_LOOKAHEAD | ZMM_LOOKBESIDE) //! Atom is big and needs to scan one extra turf in both X and Y. This only extends the range by one turf. Cheap, but not free. -/// For debug purposes, should contain the above defines in ascending order. -// TODO: Make it just print mz_flags bitfield. @Zandario -var/list/mimic_defines = list( +// For debug purposes, should contain the above defines in ascending order. +var/global/list/mimic_defines = list( "MZ_MIMIC_BELOW", "MZ_MIMIC_OVERWRITE", - "MZ_MIMIC_NO_AO", - "MZ_MIMIC_BASETURF", - "MZ_ALLOW_LIGHTING", + "MZ_MIMIC_NO_AO", "MZ_NO_OCCLUDE", + "MZ_OVERRIDE", + "MZ_NO_SHADOW", + "MZ_TERMINATOR", "MZ_OPEN_UP", "MZ_OPEN_DOWN", @@ -47,11 +67,12 @@ var/list/mimic_defines = list( DEFINE_BITFIELD(mz_flags, list( BITFIELD(MZ_MIMIC_BELOW), BITFIELD(MZ_MIMIC_OVERWRITE), - BITFIELD(MZ_MIMIC_NO_AO), - BITFIELD(MZ_MIMIC_BASETURF), - BITFIELD(MZ_ALLOW_LIGHTING), + BITFIELD(MZ_MIMIC_NO_AO), BITFIELD(MZ_NO_OCCLUDE), + BITFIELD(MZ_OVERRIDE), + BITFIELD(MZ_NO_SHADOW), + BITFIELD(MZ_TERMINATOR), BITFIELD(MZ_OPEN_UP), BITFIELD(MZ_OPEN_DOWN), @@ -61,12 +82,13 @@ DEFINE_BITFIELD(mz_flags, list( )) -//# Movable mz_flags. -#define ZMM_IGNORE (1<<0) //! Do not copy this movable. Atoms with INVISIBILITY_ABSTRACT implicitly do not copy. -#define ZMM_MANGLE_PLANES (1<<1) //! Check this movable's overlays/underlays for explicit plane use and mangle for compatibility with Z-Mimic. If you're using emissive overlays, you probably should be using this flag. Expensive, only use if necessary. -#define ZMM_LOOKAHEAD (1<<2) //! Look one turf ahead and one turf back when considering z-turfs that might be seeing this atom. Cheap, but not free. -#define ZMM_AUTOMANGLE_NRML (1<<3) //! Behaves the same as ZMM_MANGLE_PLANES, but is automatically applied by SSoverlays. Do not manually use. -#define ZMM_AUTOMANGLE_PRI (1<<4) //! Behaves the same as ZMM_MANGLE_PLANES, but is automatically applied by SSoverlays. Do not manually use. +// Movable flags. +#define ZMM_IGNORE (1 << 0) //! Do not copy this movable. Atoms may be excluded from copy automatically regardless of this flag. +#define ZMM_MANGLE_PLANES (1 << 1) //! Check this movable's overlays/underlays for explicit plane use and mangle for compatibility with Z-Mimic. If you're using emissive overlays, you probably should be using this flag. Expensive, only use if necessary. +#define ZMM_LOOKAHEAD (1 << 2) //! Look one turf ahead and one turf back when considering z-turfs that might be seeing this atom. Cheap, but not free. +#define ZMM_LOOKBESIDE (1 << 3) //! Look one turf beside (left/right) when considering z-turfs that might be seeing this atom. Cheap, but not free. +#define ZMM_AUTOMANGLE_NRML (1 << 4) //! Behaves the same as ZMM_MANGLE_PLANES, but is automatically applied by SSoverlays. Do not manually use. +#define ZMM_AUTOMANGLE_PRI (1 << 5) //! Behaves the same as ZMM_MANGLE_PLANES, but is automatically applied by SSoverlays. Do not manually use. #define ZMM_AUTOMANGLE (ZMM_AUTOMANGLE_NRML|ZMM_AUTOMANGLE_PRI) // convenience @@ -74,6 +96,7 @@ DEFINE_BITFIELD(zmm_flags, list( BITFIELD(ZMM_IGNORE), BITFIELD(ZMM_MANGLE_PLANES), BITFIELD(ZMM_LOOKAHEAD), + BITFIELD(ZMM_LOOKBESIDE), BITFIELD(ZMM_AUTOMANGLE_NRML), BITFIELD(ZMM_AUTOMANGLE_PRI) )) diff --git a/code/__DEFINES/tgs.config.dm b/code/__DEFINES/tgs.config.dm index 8c0f5d3fa2c6..3a4d8caae101 100644 --- a/code/__DEFINES/tgs.config.dm +++ b/code/__DEFINES/tgs.config.dm @@ -9,4 +9,4 @@ #define TGS_ERROR_LOG(message) log_world("TGS Error: [##message]") #define TGS_NOTIFY_ADMINS(event) message_admins(##event) #define TGS_CLIENT_COUNT GLOB.clients.len -#define TGS_PROTECT_DATUM(Path) GENERAL_PROTECT_DATUM(##Path) +#define TGS_PROTECT_DATUM(Path) VV_PROTECT(##Path) diff --git a/code/__DEFINES/tools/functionality.dm b/code/__DEFINES/tools/functionality.dm index bdeeefc443d0..a3c33e90bc78 100644 --- a/code/__DEFINES/tools/functionality.dm +++ b/code/__DEFINES/tools/functionality.dm @@ -23,6 +23,31 @@ #define TOOL_GLASS_CUT "glasskit" #define TOOL_BONESET "bonesetter" +GLOBAL_REAL_VAR(all_tool_functions) = list( + // engineering + TOOL_CROWBAR, + TOOL_MULTITOOL, + TOOL_SCREWDRIVER, + TOOL_WIRECUTTER, + TOOL_WRENCH, + TOOL_WELDER, + TOOL_ANALYZER, + // mining + TOOL_MINING, + TOOL_SHOVEL, + // surgery + TOOL_RETRACTOR, + TOOL_HEMOSTAT, + TOOL_CAUTERY, + TOOL_DRILL, + TOOL_SCALPEL, + TOOL_SAW, + // glassworking + TOOL_BLOW, + TOOL_GLASS_CUT, + TOOL_BONESET, +) + /// Yes, this is a real global. No, you shouldn't touch this for no reason. /// Add tools to this when they get states in the default icon file for: /// - neutral (no append) @@ -31,7 +56,7 @@ GLOBAL_REAL_VAR(_dyntool_image_states) = list( null = "unknown", TOOL_CROWBAR = "crowbar", - TOOL_SCREWDRIVER = "screwdriver" + TOOL_SCREWDRIVER = "screwdriver", ) //? Tool usage flags @@ -57,3 +82,9 @@ GLOBAL_REAL_VAR(_dyntool_image_states) = list( #define TOOL_LOCKING_STATIC 2 /// automatically, if we only have one dynamic behavior, use that #define TOOL_LOCKING_AUTO 3 + +//? Tool directions - used as hints. + +#define TOOL_DIRECTION_FORWARDS "forwards" +#define TOOL_DIRECTION_BACKWARDS "backwards" +#define TOOL_DIRECTION_NEUTRAL "neutral" diff --git a/code/__DEFINES/traits/mob.dm b/code/__DEFINES/traits/mob.dm index f49ef16af28e..8e4d0986bbb9 100644 --- a/code/__DEFINES/traits/mob.dm +++ b/code/__DEFINES/traits/mob.dm @@ -46,6 +46,12 @@ DATUM_TRAIT(/mob, TRAIT_MOB_UNCONSCIOUS) #define TRAIT_MOB_SLEEPING "mob_sleeping" DATUM_TRAIT(/mob, TRAIT_MOB_SLEEPING) +//* Stance *// + +/// cannot be set to resting, even by death. +#define TRAIT_MOB_FORCED_STANDING "mob_forced_standing" +DATUM_TRAIT(/mob, TRAIT_MOB_FORCED_STANDING) + //? misc /// Tracks whether you're a mime or not. diff --git a/code/__DEFINES/traits/sources.dm b/code/__DEFINES/traits/sources.dm index f1d5c0a4fe9c..708300c3ca42 100644 --- a/code/__DEFINES/traits/sources.dm +++ b/code/__DEFINES/traits/sources.dm @@ -17,6 +17,11 @@ /// From a flashbulb #define FLASH_TRAIT "flash" +//* Machinery *// + +/// cryotube +#define CRYO_TUBE_TRAIT "cryotube" + //? Mob Sources /// From species diff --git a/code/__HELPERS/icons.dm b/code/__HELPERS/icons.dm index 7889e5416ba5..2110b7cd224d 100644 --- a/code/__HELPERS/icons.dm +++ b/code/__HELPERS/icons.dm @@ -803,12 +803,6 @@ GLOBAL_LIST_INIT(freon_color_matrix, list("#2E5E69", "#60A2A8", "#A1AFB1", rgb(0 obj_flags &= ~FROZEN */ -/// Generate a filename for this asset -/// The same asset will always lead to the same asset name -/// (Generated names do not include file extention.) -/proc/generate_asset_name(file) - return "asset.[md5(fcopy_rsc(file))]" - /** * Converts an icon to base64. Operates by putting the icon in the iconCache savefile, * exporting it as text, and then parsing the base64 from that. @@ -831,8 +825,6 @@ GLOBAL_LIST_INIT(freon_color_matrix, list("#2E5E69", "#60A2A8", "#A1AFB1", rgb(0 return // if(SSlag_switch.measures[DISABLE_USR_ICON2HTML] && usr && !HAS_TRAIT(usr, TRAIT_BYPASS_MEASURES)) // return - - var/key var/icon/I = thing if (!target) @@ -850,14 +842,10 @@ GLOBAL_LIST_INIT(freon_color_matrix, list("#2E5E69", "#60A2A8", "#A1AFB1", rgb(0 if (!isicon(I)) if (isfile(thing)) //special snowflake - var/name = SANITIZE_FILENAME("[generate_asset_name(thing)].png") - if (!SSassets.cache[name]) - SSassets.transport.register_asset(name, thing) - for (var/thing2 in targets) - SSassets.transport.send_assets(thing2, name) + var/url = SSassets.send_anonymous_file(targets, I, "png") if(sourceonly) - return SSassets.transport.get_asset_url(name) - return "" + return url + return "" var/atom/A = thing I = A.icon @@ -885,14 +873,10 @@ GLOBAL_LIST_INIT(freon_color_matrix, list("#2E5E69", "#60A2A8", "#A1AFB1", rgb(0 I = icon(I, icon_state, dir, frame, moving) - key = "[generate_asset_name(I)].png" - if(!SSassets.cache[key]) - SSassets.transport.register_asset(key, I) - for (var/thing2 in targets) - SSassets.transport.send_assets(thing2, key) + var/url = SSassets.send_anonymous_file(targets, I, "png") if(sourceonly) - return SSassets.transport.get_asset_url(key) - return "" + return url + return "" /proc/icon2base64html(thing) if (!thing) diff --git a/code/__HELPERS/icons/flatten.dm b/code/__HELPERS/icons/flatten.dm index 08859a18b4b9..395068be6ee7 100644 --- a/code/__HELPERS/icons/flatten.dm +++ b/code/__HELPERS/icons/flatten.dm @@ -250,9 +250,12 @@ // gather for(copying as anything in A.overlays) // todo: better handling - if(copying.plane != FLOAT_PLANE && copying.plane != A.plane) + if(copying.plane != FLOAT_PLANE) // we don't care probably HUD or something lol continue + if(copying.appearance_flags & KEEP_APART) + // we don't care about HUD / similar; this is a good litmus test + continue current_layer = copying.layer // if it's float layer, shove it right above atom. if(current_layer < 0) @@ -274,9 +277,12 @@ for(copying as anything in A.underlays) // todo: better handling - if(copying.plane != FLOAT_PLANE && copying.plane != A.plane) + if(copying.plane != FLOAT_PLANE) // we don't care probably HUD or something lol continue + if(copying.appearance_flags & KEEP_APART) + // we don't care about HUD / similar; this is a good litmus test + continue current_layer = copying.layer // if it's float layer, shove it right below atom. if(current_layer < 0) diff --git a/code/__HELPERS/icons/render.dm b/code/__HELPERS/icons/render.dm new file mode 100644 index 000000000000..4fe3457f17bc --- /dev/null +++ b/code/__HELPERS/icons/render.dm @@ -0,0 +1,20 @@ +//* This file is explicitly licensed under the MIT license. *// +//* Copyright (c) 2024 silicons *// + +/proc/render_compound_icon_with_client(target, client/C) + var/icon/generated + + // do one first + var/mutable_appearance/rendering = new /mutable_appearance(target) + rendering.dir = SOUTH + generated = icon(C.RenderIcon(rendering.appearance)) + + // do rest + rendering.dir = EAST + generated.Insert(C.RenderIcon(rendering.appearance), dir = EAST) + rendering.dir = NORTH + generated.Insert(C.RenderIcon(rendering.appearance), dir = NORTH) + rendering.dir = WEST + generated.Insert(C.RenderIcon(rendering.appearance), dir = WEST) + + return generated diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm index a11b5d22fa07..a44dcb3256b6 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -37,7 +37,7 @@ var/list/valid = list() for(var/id in GLOB.sprite_accessory_hair) var/datum/sprite_accessory/hair/S = GLOB.sprite_accessory_hair[id] - if(S.gender != NEUTER && gender != S.gender) + if(!isnull(S.random_generation_gender) && gender != S.random_generation_gender) continue if(S.apply_restrictions && !(species in S.species_allowed)) continue @@ -48,7 +48,7 @@ var/list/valid = list() for(var/id in GLOB.sprite_accessory_facial_hair) var/datum/sprite_accessory/facial_hair/S = GLOB.sprite_accessory_facial_hair[id] - if(S.gender != NEUTER && gender != S.gender) + if(!isnull(S.random_generation_gender) && gender != S.random_generation_gender) continue if(S.apply_restrictions && !(species in S.species_allowed)) continue diff --git a/code/__HELPERS/thermal.dm b/code/__HELPERS/thermal.dm new file mode 100644 index 000000000000..95b5f4eb5779 --- /dev/null +++ b/code/__HELPERS/thermal.dm @@ -0,0 +1,74 @@ +//* This file is explicitly licensed under the MIT license. *// +//* Copyrigth (c) 2024 LordME *// + +/** + * Calculates the new temperature and returns it. + * + * @params + * * initial_temperature - the temperature before the adding of the specified energy + * * heat_capacity - The thermal energy capacity of the object, may NEVER be 0 + * * amount_in_joules - the amount of energy to be injected into the object + * + * @return the new temperature + */ +/proc/add_thermal_energy(initial_temperature, heat_capacity, amount_in_joules) + . = initial_temperature + if(heat_capacity) + . += amount_in_joules / heat_capacity + else + STACK_TRACE("Called add_thermal_energy with heat_capacity = 0") + +/** + * Calculates the energy needed to change the temperature to target_temperature + * + * @params + * * current_temperature - the temperature before the adding of the specified energy + * * heat_capacity - The thermal energy capacity of the object, may NEVER be 0 + * * target_temperature - the temperature target + * + * @return the energy in joules + */ +/proc/get_thermal_energy_needed(current_temperature, heat_capacity, target_temperature) + return (target_temperature - current_temperature) * heat_capacity + +/** + * Calculates shared new temperature of the two objects, assuming infinite amount of time for energy to transfer + * + * @params + * * temperature_1 - temperature of thermal storage 1 + * * heat_capacity_1 - thermal energy capacity of thermal storage 1 + * * temperature_2 - temperature of thermal storage 2 + * * heat_capacity_2 - thermal energy capacity of thermal storage 2 + * + * @return the new temperature of both + */ +/proc/share_thermal_energy(temperature_1, heat_capacity_1, temperature_2, heat_capacity_2) + if(heat_capacity_1 || heat_capacity_2)//We are just catching math errors + return (temperature_1 * heat_capacity_1 + temperature_2 * heat_capacity_2) / heat_capacity_1 + heat_capacity_2 + CRASH("Called share_thermal_energy with invalid heat_capacity_1 and heat_capacity_2") + +/proc/share_thermal_energy_gas(temperature, heat_capacity, datum/gas_mixture/gas) + var/temp_2 = gas.temperature + var/heat_cap_2 = gas.heat_capacity() + return share_thermal_energy(temperature, heat_capacity, temp_2, heat_cap_2) +/** + * Calculates shared new temperature of the two objects, assuming one second for energy to transfer + * takes conductivity into account, stepsize is 1 second + * + * @params + * * temperature_1 - temperature of thermal storage 1 + * * heat_capacity_1 - thermal energy capacity of thermal storage 1 + * * temperature_2 - temperature of thermal storage 2 + * * heat_capacity_2 - thermal energy capacity of thermal storage 2 + * * thermal_conductivity - the conductivity to be used for the transfer + * + * @return the new temperature of thermal object 1 + */ +/proc/share_thermal_energy_conductivity(temperature_1, heat_capacity_1, temperature_2, heat_capacity_2, thermal_conductivity) + return (temperature_1 + thermal_conductivity * (temperature_1 - temperature_2) / heat_capacity_1) + +#define SHARE_THERMALS(t1, c1, t2, c2) share_thermal_energy(t1,c1,t2,c2) +#define ADD_THERMALS(t, c, e) add_thermal_energy(t, c, e) +#define GET_THERMALS(t, c, tt) get_thermal_energy_needed(t, c, tt) + + diff --git a/code/__HELPERS/type2type/type2type.dm b/code/__HELPERS/type2type/type2type.dm index cc4593683c1f..aaf3b72857b6 100644 --- a/code/__HELPERS/type2type/type2type.dm +++ b/code/__HELPERS/type2type/type2type.dm @@ -311,11 +311,6 @@ else //regex everything else (works for /proc too) return lowertext(replacetext("[the_type]", "[type2parent(the_type)]/", "")) -/// Return html to load a url. -/// for use inside of browse() calls to html assets that might be loaded on a cdn. -/proc/url2htmlloader(url) - return {""} - // Converts a string into ascii then converts it into hexadecimal. /proc/strtohex(str) if(!istext(str)||!str) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 1cda55518d3c..df7c75ef2559 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -1091,7 +1091,7 @@ var/list/WALLITEMS = list( /obj/machinery/power/apc, /obj/machinery/air_alarm, /obj/item/radio/intercom, /obj/structure/frame, /obj/structure/extinguisher_cabinet, /obj/structure/reagent_dispensers/peppertank, /obj/machinery/status_display, /obj/machinery/requests_console, /obj/machinery/light_switch, /obj/structure/sign, - /obj/machinery/newscaster, /obj/machinery/firealarm, /obj/structure/noticeboard, /obj/machinery/button/remote, + /obj/machinery/newscaster, /obj/machinery/fire_alarm, /obj/structure/noticeboard, /obj/machinery/button/remote, /obj/machinery/computer/security/telescreen, /obj/machinery/embedded_controller/radio, /obj/item/storage/secure/safe, /obj/machinery/door_timer, /obj/machinery/flasher, /obj/machinery/keycard_auth, /obj/structure/mirror, /obj/structure/fireaxecabinet, /obj/machinery/computer/security/telescreen/entertainment, diff --git a/code/___compile_options.dm b/code/___compile_options.dm index 1421a138ce94..96e0b8ef458f 100644 --- a/code/___compile_options.dm +++ b/code/___compile_options.dm @@ -71,13 +71,6 @@ */ // #define USE_BYOND_TRACY - -/** - * If defined, we will NOT defer asset generation till later in the game, and will instead do it all at once, during initiialize. - */ -//#define DO_NOT_DEFER_ASSETS - - /** * If this is uncommented, Autowiki will generate edits and shut down the server. * Prefer the autowiki build target instead. @@ -185,7 +178,12 @@ #define ZAS_BREAKPOINT_HOOKS #endif +// ## Assets +/** + * If defined, we will NOT defer asset generation till later in the game, and will instead do it all at once, during initiialize. + */ +//#define DO_NOT_DEFER_ASSETS // ## Overlays /** diff --git a/code/_globals/lists/mobs.dm b/code/_globals/lists/mobs.dm index 487fd5c1d14e..ed0d635f6420 100644 --- a/code/_globals/lists/mobs.dm +++ b/code/_globals/lists/mobs.dm @@ -2,164 +2,3 @@ GLOBAL_LIST_EMPTY(mob_list) /// all player mobs (not clients!) GLOBAL_LIST_EMPTY(player_list) - -/// by id -GLOBAL_LIST_INIT(sprite_accessory_hair, all_hair_styles()) -/// by id -GLOBAL_LIST_INIT(sprite_accessory_ears, all_ear_styles()) -/// by id -GLOBAL_LIST_INIT(sprite_accessory_tails, all_tail_styles()) -/// by id -GLOBAL_LIST_INIT(sprite_accessory_wings, all_wing_styles()) -/// by id -GLOBAL_LIST_INIT(sprite_accessory_facial_hair, all_facial_hair_styles()) -/// by id -GLOBAL_LIST_INIT(sprite_accessory_markings, all_marking_styles()) - -// todo: most uses of these should either be a direct ref under new marking system or -// todo: an id to ref. -// todo: however, there are some legitimate cases of needing fast name lookup, -// todo: like non-tgui interfaces that let you choose markings -// todo: do not blindly kill these lists, we'll deal with everything as we go. - -// by name -GLOBAL_LIST(legacy_hair_lookup) -// by id -GLOBAL_LIST(legacy_ears_lookup) -// by id -GLOBAL_LIST(legacy_wing_lookup) -// by id -GLOBAL_LIST(legacy_tail_lookup) -// by name -GLOBAL_LIST(legacy_facial_hair_lookup) -// by name -GLOBAL_LIST(legacy_marking_lookup) - -/proc/all_hair_styles() - . = list() - var/list/by_name = list() - for(var/path in subtypesof(/datum/sprite_accessory/hair)) - var/datum/sprite_accessory/S = path - if(initial(S.abstract_type) == path) - continue - S = new path - if(!S.id) - stack_trace("no id on [path]") - continue - if(.[S.id]) - stack_trace("duplicate id [S.id] on [path] and [.[S.id]]") - continue - if(by_name[S.name]) - stack_trace("duplicate name [S.name] on [path]") - continue - .[S.id] = S - by_name[S.name] = S - tim_sort(by_name, GLOBAL_PROC_REF(cmp_text_asc), associative = FALSE) - GLOB.legacy_hair_lookup = by_name - tim_sort(., GLOBAL_PROC_REF(cmp_name_asc), associative = TRUE) - -/proc/all_ear_styles() - . = list() - var/list/by_type = list() - for(var/path in subtypesof(/datum/sprite_accessory/ears)) - var/datum/sprite_accessory/S = path - if(initial(S.abstract_type) == path) - continue - S = new path - if(!S.id) - stack_trace("no id on [path]") - continue - if(.[S.id]) - stack_trace("duplicate id [S.id] on [path] and [.[S.id]]") - continue - .[S.id] = S - by_type[S.type] = S - tim_sort(by_type, GLOBAL_PROC_REF(cmp_name_asc), associative = TRUE) - GLOB.legacy_ears_lookup = by_type - tim_sort(., GLOBAL_PROC_REF(cmp_name_asc), associative = TRUE) - -/proc/all_wing_styles() - . = list() - var/list/by_type = list() - for(var/path in subtypesof(/datum/sprite_accessory/wing)) - var/datum/sprite_accessory/S = path - if(initial(S.abstract_type) == path) - continue - S = new path - if(!S.id) - stack_trace("no id on [path]") - continue - if(.[S.id]) - stack_trace("duplicate id [S.id] on [path] and [.[S.id]]") - continue - .[S.id] = S - by_type[S.type] = S - tim_sort(by_type, GLOBAL_PROC_REF(cmp_name_asc), associative = TRUE) - GLOB.legacy_wing_lookup = by_type - tim_sort(., GLOBAL_PROC_REF(cmp_name_asc), associative = TRUE) - -/proc/all_tail_styles() - . = list() - var/list/by_type = list() - for(var/path in subtypesof(/datum/sprite_accessory/tail)) - var/datum/sprite_accessory/S = path - if(initial(S.abstract_type) == path) - continue - S = new path - if(!S.id) - stack_trace("no id on [path]") - continue - if(.[S.id]) - stack_trace("duplicate id [S.id] on [path] and [.[S.id]]") - continue - .[S.id] = S - by_type[S.type] = S - tim_sort(by_type, GLOBAL_PROC_REF(cmp_name_asc), associative = TRUE) - GLOB.legacy_tail_lookup = by_type - tim_sort(., GLOBAL_PROC_REF(cmp_name_asc), associative = TRUE) - -/proc/all_facial_hair_styles() - . = list() - var/list/by_name = list() - for(var/path in subtypesof(/datum/sprite_accessory/facial_hair)) - var/datum/sprite_accessory/S = path - if(initial(S.abstract_type) == path) - continue - S = new path - if(!S.id) - stack_trace("no id on [path]") - continue - if(.[S.id]) - stack_trace("duplicate id [S.id] on [path] and [.[S.id]]") - continue - if(by_name[S.name]) - stack_trace("duplicate name [S.name] on [path]") - continue - .[S.id] = S - by_name[S.name] = S - tim_sort(by_name, GLOBAL_PROC_REF(cmp_text_asc), associative = FALSE) - GLOB.legacy_facial_hair_lookup = by_name - tim_sort(., GLOBAL_PROC_REF(cmp_name_asc), associative = TRUE) - -/proc/all_marking_styles() - . = list() - var/list/by_name = list() - for(var/path in subtypesof(/datum/sprite_accessory/marking)) - var/datum/sprite_accessory/S = path - if(initial(S.abstract_type) == path) - continue - S = new path - if(!S.id) - stack_trace("no id on [path]") - continue - if(.[S.id]) - stack_trace("duplicate id [S.id] on [path] and [.[S.id]]") - continue - if(by_name[S.name]) - stack_trace("duplicate name [S.name] on [path]") - continue - .[S.id] = S - by_name[S.name] = S - tim_sort(by_name, GLOBAL_PROC_REF(cmp_text_asc), associative = FALSE) - GLOB.legacy_marking_lookup = by_name - tim_sort(., GLOBAL_PROC_REF(cmp_name_asc), associative = TRUE) diff --git a/code/controllers/configuration/entries/resources.dm b/code/controllers/configuration/entries/resources.dm index c839ccc078d4..be1ae7c1d7ac 100644 --- a/code/controllers/configuration/entries/resources.dm +++ b/code/controllers/configuration/entries/resources.dm @@ -14,8 +14,8 @@ /datum/config_entry/string/asset_cdn_webroot/ValidateAndSet(str_var) if (!str_var || trim(str_var) == "") return FALSE - if (str_var && str_var[length(str_var)] != "/") - str_var += "/" + if (str_var && str_var[length_char(str_var)] == "/") + str_var = copytext_char(str_var, 1, length_char(str_var)) return ..(str_var) /datum/config_entry/string/asset_cdn_url @@ -25,6 +25,6 @@ /datum/config_entry/string/asset_cdn_url/ValidateAndSet(str_var) if (!str_var || trim(str_var) == "") return FALSE - if (str_var && str_var[length(str_var)] != "/") - str_var += "/" + if (str_var && str_var[length_char(str_var)] == "/") + str_var = copytext_char(str_var, 1, length_char(str_var)) return ..(str_var) diff --git a/code/controllers/configuration_old/configuration_vr.dm b/code/controllers/configuration_old/configuration_vr.dm index 8fae7b7d57d9..3b61d5dd19dd 100644 --- a/code/controllers/configuration_old/configuration_vr.dm +++ b/code/controllers/configuration_old/configuration_vr.dm @@ -4,8 +4,6 @@ /datum/configuration_legacy var/time_off = FALSE - var/pto_job_change = FALSE - var/pto_cap = 100 //Hours /hook/startup/proc/read_vs_config() var/list/Lines = world.file2list("config/legacy/config.txt") @@ -38,10 +36,6 @@ config_legacy.chat_webhook_key = value if ("items_survive_digestion") config_legacy.items_survive_digestion = 1 - if ("pto_cap") - config_legacy.pto_cap = text2num(value) if ("time_off") config_legacy.time_off = TRUE - if ("pto_job_change") - config_legacy.pto_job_change = TRUE return 1 diff --git a/code/controllers/subsystem/asset_loading.dm b/code/controllers/subsystem/asset_loading.dm index f51ac236352b..27400cf89f5d 100644 --- a/code/controllers/subsystem/asset_loading.dm +++ b/code/controllers/subsystem/asset_loading.dm @@ -6,25 +6,22 @@ SUBSYSTEM_DEF(asset_loading) name = "Asset Loading" priority = FIRE_PRIORITY_ASSET_LOADING + // todo: hibernation subsystem_flags = SS_NO_INIT runlevels = RUNLEVEL_LOBBY | RUNLEVELS_DEFAULT - var/list/datum/asset/generate_queue = list() -/datum/controller/subsystem/asset_loading/fire(resumed) - while(length(generate_queue)) - var/datum/asset/to_load = generate_queue[generate_queue.len] + /// things waiting to be loaded + var/list/datum/asset_pack/loading = list() - to_load.queued_generation() +/datum/controller/subsystem/asset_loading/proc/queue_asset_pack(datum/asset_pack/asset) + if(asset.loaded != ASSET_NOT_LOADED) + return + loading += asset +/datum/controller/subsystem/asset_loading/fire(resumed) + while(length(loading)) + var/datum/asset_pack/instance = loading[loading.len] + loading.len-- + instance.ensure_ready(TRUE) if(MC_TICK_CHECK) return - generate_queue.len-- - -/datum/controller/subsystem/asset_loading/proc/queue_asset(datum/asset/queue) -#ifdef DO_NOT_DEFER_ASSETS - stack_trace("We queued an instance of [queue.type] for lateloading despite not allowing it") -#endif - generate_queue += queue - -/datum/controller/subsystem/asset_loading/proc/dequeue_asset(datum/asset/queue) - generate_queue -= queue diff --git a/code/controllers/subsystem/assets.dm b/code/controllers/subsystem/assets.dm index f467a934cb51..91d10a49f228 100644 --- a/code/controllers/subsystem/assets.dm +++ b/code/controllers/subsystem/assets.dm @@ -2,37 +2,229 @@ SUBSYSTEM_DEF(assets) name = "Assets" init_order = INIT_ORDER_ASSETS subsystem_flags = SS_NO_FIRE - var/list/datum/asset_cache_item/cache = list() - var/list/preload = list() - var/datum/asset_transport/transport = new() + + /// asset packs by type; this is for hardcoded assets + /// + /// an asset is either registered by type, or id, never both. + var/static/list/asset_packs_by_type = list() + /// asset packs by id; this is for dynamic assets + /// + /// an asset is either registered by type, or id, never both. + var/static/list/asset_packs_by_id = list() + /// all asset packs + var/static/list/datum/asset_pack/asset_packs = list() + /// asset packs we're going to preload via native (browse_rsc) transport + var/list/datum/asset_pack/asset_packs_to_natively_preload = list() + + /// all dynamic or standalone asset items that were registered with name (which is also their uid) + var/static/list/datum/asset_item/dynamic/dynamic_asset_items_by_name = list() + + /// our active asset transport + var/datum/asset_transport/transport + + // todo: cache system. + + /// if non-null, this is our effective cache commit + // var/cache_commit + /// are we using cached data this round? + // var/cache_enabled = FALSE + +/datum/controller/subsystem/assets/Initialize(timeofday) + // detect_cache_worthiness() + + for(var/datum/asset_pack/path as anything in typesof(/datum/asset_pack)) + if(path == initial(path.abstract_type)) + continue + var/datum/asset_pack/instance = new path + register_asset_pack(instance, TRUE) + +#ifndef DO_NOT_DEFER_ASSETS + if(initial(instance.load_deferred)) + continue + else if(initial(instance.load_immediately)) + instance.load() + else + SSasset_loading.queue_asset_pack(instance) +#else + instance.load() +#endif + + return ..() + +/** + * register an asset pack to make it able to be resolved or loaded + * + * @params + * * pack - the pack + * * by_type - do not use this, only used for subsystem. + */ +/datum/controller/subsystem/assets/proc/register_asset_pack(datum/asset_pack/pack, by_type) + var/registered = FALSE + if(by_type) + ASSERT(!asset_packs_by_type[pack.type]) + asset_packs_by_type[pack.type] = pack + registered = TRUE + if(pack.id) + ASSERT(!asset_packs_by_id[pack.id]) + asset_packs_by_id[pack.id] = pack + registered = TRUE + if(!registered) + CRASH("couldn't register by type or id") + asset_packs += pack + if(should_preload_native_pack(pack)) + asset_packs_to_natively_preload += pack + +/datum/controller/subsystem/assets/proc/should_preload_native_pack(datum/asset_pack/pack) + if(pack.do_not_preload) + return FALSE + return CONFIG_GET(flag/asset_simple_preload) + +/datum/controller/subsystem/assets/proc/immediately_ready_all_packs() + for(var/datum/asset_pack/pack as anything in asset_packs) + pack.ensure_ready() + +/** + * fetches an asset datum, **without** ensuring it's ready / loaded + * + * @return asset pack resolved + */ +/datum/controller/subsystem/assets/proc/resolve_asset_pack(identifier) + if(istype(identifier, /datum/asset_pack)) + return identifier + if(ispath(identifier)) + return asset_packs_by_type[identifier] + else + return asset_packs_by_id[identifier] + +/** + * fetches an asset datum, and ensures it's ready / loaded + * + * * This proc can block if something needs to generate. + * + * @return asset pack resolved + */ +/datum/controller/subsystem/assets/proc/ready_asset_pack(identifier) + var/datum/asset_pack/resolved = resolve_asset_pack(identifier) + resolved.ensure_ready() + return resolved + +/** + * ensures an asset has been sent to a client + * + * @params + * * target - a client or a list of clients + * * identifier - asset type, id, or instance + * + * @return TRUE if an asset had to be sent, FALSE if the client (is supposed to) already have it. + */ +/datum/controller/subsystem/assets/proc/send_asset_pack(client/target, identifier) + if(isnull(target)) + return FALSE + + var/datum/asset_pack/resolved = ready_asset_pack(identifier) + + var/list/targets = islist(target)? target : list(target) + + for(var/client/C as anything in targets) + transport.send_asset_pack(C, resolved) + +/** + * loads a file that we declare to not be necessary to keep around / store information on after + * the necessary clients have loaded it. + * + * * blocking proc + * * warning - this can clog a client's browse queue. use send_anonymous_files() to send multiple in a short period of time! + * + * @params + * * targets - client or list of clients to send it to + * * file - the file in question + * * ext - mandatory extension for the file. do not include the '.' + * + * @return url to load it with; this will usually be heavily mangled. + */ +/datum/controller/subsystem/assets/proc/send_anonymous_file(list/client/targets, file, ext) + ASSERT(ext) + return transport.send_anonymous_file(targets, file, ext) + +/** + * loads a set of files that we declare to not be necessary to keep around / store information on after + * the necessary clients have loaded it. + * + * * blocking proc + * * you should probably not use this if you can; it's a little janky. + * + * @params + * * targets - client or list of clients to send it to + * * files - the files in question, associated to their extensions + * + * @return list(urls) in same order as files. + */ +/datum/controller/subsystem/assets/proc/send_anonymous_files(list/client/targets, list/files) + // todo: optimize this proc + . = new /list(length(files)) + for(var/i in 1 to length(files)) + var/file = files[i] + .[i] = send_anonymous_file(targets, file, files[file]) + stoplag(0) + +/** + * @params + * * file - a file + * * name - the name for the file. if files is a list, this is ignored + * * do_not_mangle - do not mangle / unique-ify the name of the file. + * + * @return /datum/asset_item/dynamic + */ +/datum/controller/subsystem/assets/proc/register_dynamic_item_by_name(file, name, do_not_mangle) + RETURN_TYPE(/datum/asset_item/dynamic) + if(dynamic_asset_items_by_name[name]) + . = FALSE + CRASH("collision on [name]; automatically-updating dynamic items are not yet supported.") + var/datum/asset_item/dynamic/created = new(name, file, do_not_mangle = do_not_mangle) + return created + +/datum/controller/subsystem/assets/proc/send_dynamic_item_by_name(list/client/clients, list/names) + if(!islist(clients)) + clients = list(clients) + for(var/name in names) + var/datum/asset_item/dynamic/item = dynamic_asset_items_by_name[name] + item?.send(clients) + +/datum/controller/subsystem/assets/proc/get_dynamic_item_url_by_name(name) + return dynamic_asset_items_by_name[name]?.get_url() /datum/controller/subsystem/assets/OnConfigLoad() - var/newtransporttype = /datum/asset_transport + var/newtransporttype = /datum/asset_transport/browse_rsc switch (CONFIG_GET(string/asset_transport)) if ("webroot") newtransporttype = /datum/asset_transport/webroot - if (newtransporttype == transport.type) + if (newtransporttype == transport?.type) return - var/datum/asset_transport/newtransport = new newtransporttype () - if (newtransport.validate_config()) - transport = newtransport - transport.Load() + var/datum/asset_transport/newtransport = new newtransporttype + if (!newtransport.validate_config()) + stack_trace("failed to validate config; going back to browse_rsc") + qdel(newtransport) + newtransport = new /datum/asset_transport/browse_rsc -/datum/controller/subsystem/assets/Initialize(timeofday) - for(var/type in typesof(/datum/asset)) - var/datum/asset/A = type - if(type == initial(A.abstract_type)) - continue - if(initial(A.lazy)) - continue - load_asset_datum(type) + set_transport_to(newtransport) - transport.Initialize(cache) +/datum/controller/subsystem/assets/proc/set_transport_to(datum/asset_transport/new_transport) + QDEL_NULL(transport) + transport = new_transport - return ..() + // unload all asset packs + for(var/datum/asset_pack/pack in asset_packs) + pack.loaded_urls = null + // unload all dynamic items + for(var/name in dynamic_asset_items_by_name) + var/datum/asset_item/dynamic/item = dynamic_asset_items_by_name[name] + if(!istype(item)) + continue + item.loaded_url = null + + transport.initialize() -/datum/controller/subsystem/assets/Recover() - cache = SSassets.cache - preload = SSassets.preload +/datum/controller/subsystem/assets/proc/preload_client_assets(client/target) + transport.perform_native_preload(target, asset_packs_to_natively_preload) diff --git a/code/controllers/subsystem/early_assets.dm b/code/controllers/subsystem/early_assets.dm deleted file mode 100644 index b33f96126572..000000000000 --- a/code/controllers/subsystem/early_assets.dm +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Initializes any assets that need to be loaded ASAP. - * This houses preference menu assets, since they can be loaded at any time, - * most dangerously before the atoms SS initializes. - * Thus, we want it to fail consistently in CI as if it would've if a player - * opened it up early. - */ -SUBSYSTEM_DEF(early_assets) - name = "Early Assets" - init_order = INIT_ORDER_EARLY_ASSETS - subsystem_flags = SS_NO_FIRE - -/datum/controller/subsystem/early_assets/Initialize(timeofday) - for (var/datum/asset/asset_type as anything in subtypesof(/datum/asset)) - if (initial(asset_type.abstract_type) == asset_type) - continue - - if (!initial(asset_type.early)) - continue - - if (!load_asset_datum(asset_type)) - stack_trace("Could not initialize early asset [asset_type]!") - - CHECK_TICK - - return ..() diff --git a/code/controllers/subsystem/mapping/_mapping.dm b/code/controllers/subsystem/mapping/_mapping.dm index 004da48cbb13..ed3ec7620909 100644 --- a/code/controllers/subsystem/mapping/_mapping.dm +++ b/code/controllers/subsystem/mapping/_mapping.dm @@ -19,6 +19,8 @@ SUBSYSTEM_DEF(mapping) var/list/areas_in_z = list() /datum/controller/subsystem/mapping/Initialize(timeofday) + TO_WORLD("Loading with Map: [src.loaded_station]")//This is just for IntTest logs + // load data // todo: refactor load_map_templates() diff --git a/code/controllers/subsystem/mapping/maps.dm b/code/controllers/subsystem/mapping/maps.dm index c96132739c73..d5a195c6a0d0 100644 --- a/code/controllers/subsystem/mapping/maps.dm +++ b/code/controllers/subsystem/mapping/maps.dm @@ -71,6 +71,7 @@ if(isnull(default)) stack_trace("no default map; world init is likely going to explode.") #ifdef FORCE_MAP + #warn FORCE_MAP is enabled! Don't forget to disable this before pushing. if(keyed_maps[FORCE_MAP]) next_map = keyed_maps[FORCE_MAP] subsystem_log("loaded forced map [FORCE_MAP]") diff --git a/code/controllers/subsystem/overlays.dm b/code/controllers/subsystem/overlays.dm index e8ff2c7f96fc..b85f92d07306 100644 --- a/code/controllers/subsystem/overlays.dm +++ b/code/controllers/subsystem/overlays.dm @@ -109,11 +109,7 @@ SUBSYSTEM_DEF(overlays) priority_overlays = null our_overlays = null - if (alternate_appearances) - for(var/I in alternate_appearances) - var/datum/atom_hud/alternate_appearance/AA = alternate_appearances[I] - if(AA.transfer_overlays) - AA.copy_overlays(src, TRUE) + SEND_SIGNAL(src, COMSIG_ATOM_COMPILED_OVERLAYS) atom_flags &= ~ATOM_OVERLAY_QUEUED diff --git a/code/controllers/subsystem/persist_vr.dm b/code/controllers/subsystem/persist_vr.dm deleted file mode 100644 index dcb1b738d0bf..000000000000 --- a/code/controllers/subsystem/persist_vr.dm +++ /dev/null @@ -1,110 +0,0 @@ -//////////////////////////////// -//// Paid Leave Subsystem -//// For tracking how much department PTO time players have accured -//////////////////////////////// - -SUBSYSTEM_DEF(persist) - name = "Persist" - priority = 20 - wait = 15 MINUTES - subsystem_flags = SS_BACKGROUND|SS_NO_INIT|SS_KEEP_TIMING - runlevels = RUNLEVEL_GAME|RUNLEVEL_POSTGAME - var/list/currentrun = list() - -/datum/controller/subsystem/persist/fire(var/resumed = FALSE) - update_department_hours(resumed) - -// Do PTO Accruals -/datum/controller/subsystem/persist/proc/update_department_hours(var/resumed = FALSE) - if(!config_legacy.time_off) - return - - if(!SSdbcore.Connect()) - src.currentrun.Cut() - return - if(!resumed) - src.currentrun = human_mob_list.Copy() - - //cache for sanic speed (lists are references anyways) - var/list/currentrun = src.currentrun - while (currentrun.len) - var/mob/M = currentrun[currentrun.len] - currentrun.len-- - if (QDELETED(M) || !istype(M) || !M.mind || !M.client || TICKS2DS(M.client.inactivity) > wait) - continue - - // Try and detect job and department of mob - var/datum/role/job/J = detect_job(M) - if(!istype(J) || !J.pto_type || !J.timeoff_factor) - if (MC_TICK_CHECK) - return - continue - - // Do not collect useless PTO - var/department_earning = J.pto_type - clear_unused_pto(M) - - // Determine special PTO types and convert properly - if(department_earning == PTO_CYBORG) - // CITADEL EDIT: Cyborg PTO disabled for now - // if(isrobot(M)) - // var/mob/living/silicon/robot/C = M - // if(C?.module?.pto_type) - // department_earning = C.module.pto_type - if(department_earning == PTO_CYBORG) - if (MC_TICK_CHECK) - return - continue - - // Update client whatever - var/client/C = M.client - var/wait_in_hours = wait / (1 HOUR) - var/pto_factored = wait_in_hours * J.timeoff_factor - LAZYINITLIST(C.department_hours) - var/dept_hours = C.department_hours - if(isnum(dept_hours[department_earning])) - dept_hours[department_earning] += pto_factored - else - dept_hours[department_earning] = pto_factored - - // Cap it - dept_hours[department_earning] = clamp(dept_hours[department_earning], 0, config_legacy.pto_cap) - - // Okay we figured it out, lets update database! - var/sql_ckey = sql_sanitize_text(C.ckey) - var/sql_dpt = sql_sanitize_text(department_earning) - var/sql_bal = text2num("[C.department_hours[department_earning]]") - SSdbcore.RunQuery( - "INSERT INTO [format_table_name("vr_player_hours")] (ckey, department, hours) VALUES (:ckey, :dept, :hours) ON DUPLICATE KEY UPDATE hours = VALUES(hours)", - list( - "ckey" = sql_ckey, - "dept" = sql_dpt, - "hours" = sql_bal - ) - ) - - if (MC_TICK_CHECK) - return - -// This proc tries to find the job datum of an arbitrary mob. -/datum/controller/subsystem/persist/proc/detect_job(var/mob/M) - // Records are usually the most reliable way to get what job someone is. - var/datum/data/record/R = find_general_record("name", M.real_name) - if(R) // We found someone with a record. - var/recorded_rank = R.fields["real_rank"] - if(recorded_rank) - . = SSjob.get_job(recorded_rank) - if(.) return - - // They have a custom title, aren't crew, or someone deleted their record, so we need a fallback method. - // Let's check the mind. - if(M.mind && M.mind.assigned_role) - . = SSjob.get_job(M.mind.assigned_role) - -// This proc tries makes sure old Command PTO doesn't linger -/datum/controller/subsystem/persist/proc/clear_unused_pto(var/mob/M) - var/client/C = M.client - LAZYINITLIST(C.department_hours) - if(C.department_hours[DEPARTMENT_COMMAND]) - C.department_hours[DEPARTMENT_COMMAND] = null - C.department_hours.Remove(DEPARTMENT_COMMAND) diff --git a/code/controllers/subsystem/preferences.dm b/code/controllers/subsystem/preferences.dm index 08bdf079e1cb..cf35c223cf47 100644 --- a/code/controllers/subsystem/preferences.dm +++ b/code/controllers/subsystem/preferences.dm @@ -10,6 +10,9 @@ SUBSYSTEM_DEF(preferences) /datum/controller/subsystem/preferences/Initialize() init_preference_entries() init_preference_toggles() + for(var/key in preferences_by_key) + var/datum/game_preferences/prefs = preferences_by_key[key] + prefs.initialize() return ..() /datum/controller/subsystem/preferences/proc/resolve_preference_entry(datum/game_preference_entry/entrylike) @@ -64,8 +67,12 @@ SUBSYSTEM_DEF(preferences) if(!istype(preferences_by_key[ckey], /datum/game_preferences)) var/datum/game_preferences/initializing = new(key, ckey) preferences_by_key[ckey] = initializing - initializing.initialize() - return preferences_by_key[ckey] + if(initialized) + initializing.initialize() + var/datum/game_preferences/found = preferences_by_key[ckey] + if(initialized && !found.initialized) + found.initialize() + return found /datum/controller/subsystem/preferences/on_sql_reconnect() for(var/ckey in SSpreferences.preferences_by_key) diff --git a/code/controllers/subsystem/research.dm b/code/controllers/subsystem/research.dm index f6b1b5de2d86..4dda3ba6e3cd 100644 --- a/code/controllers/subsystem/research.dm +++ b/code/controllers/subsystem/research.dm @@ -14,6 +14,10 @@ SUBSYSTEM_DEF(research) /// cached autolathe desgin ids var/list/autolathe_design_ids + //? designs - caches + /// cached medical mini autolathe desgin ids + var/list/medical_mini_design_ids + /datum/controller/subsystem/research/Initialize() build_designs() return ..() @@ -26,6 +30,7 @@ SUBSYSTEM_DEF(research) /datum/controller/subsystem/research/proc/build_designs() design_lookup = list() autolathe_design_ids = list() + medical_mini_design_ids = list() for(var/datum/design/path as anything in subtypesof(/datum/design)) if(initial(path.abstract_type) == path) continue @@ -49,7 +54,10 @@ SUBSYSTEM_DEF(research) . = TRUE design_lookup[registering.id] = registering if((registering.lathe_type & LATHE_TYPE_AUTOLATHE) && (registering.design_unlock & DESIGN_UNLOCK_INTRINSIC)) - autolathe_design_ids += registering.id + LAZYDISTINCTADD(autolathe_design_ids, registering.id) + if(istype(registering, /datum/design/medical)) + LAZYDISTINCTADD(medical_mini_design_ids, registering.id) + /** * gets a design datum diff --git a/code/controllers/subsystem/zmimic.dm b/code/controllers/subsystem/zcopy.dm similarity index 69% rename from code/controllers/subsystem/zmimic.dm rename to code/controllers/subsystem/zcopy.dm index 4eef5327f2d5..e508b36fad3b 100644 --- a/code/controllers/subsystem/zmimic.dm +++ b/code/controllers/subsystem/zcopy.dm @@ -1,6 +1,8 @@ -/** - *! Here be dragons. - */ +/* + + Here be dragons. + +*/ #define OPENTURF_MAX_PLANE -70 /// The maxiumum number of planes deep we'll go before we just dump everything on the same plane. @@ -11,8 +13,21 @@ #define SHADOWER_DARKENING_COLOR "#999999" #define READ_BASETURF(T) (islist(T.baseturfs) ? T.baseturfs[length(T.baseturfs)] : T.baseturfs) -SUBSYSTEM_DEF(zmimic) - name = "Z-Mimic" + +#define ZM_RECORD_STATS + +#ifdef ZM_RECORD_STATS +#define ZM_RECORD_START STAT_START_STOPWATCH +#define ZM_RECORD_STOP STAT_STOP_STOPWATCH +#define ZM_RECORD_WRITE(X...) STAT_LOG_ENTRY(##X) +#else +#define ZM_RECORD_START +#define ZM_RECORD_STOP +#define ZM_RECORD_WRITE(X...) +#endif + +SUBSYSTEM_DEF(zcopy) + name = "Z-Copy" wait = 1 init_order = INIT_ORDER_ZMIMIC priority = FIRE_PRIORITY_ZMIMIC @@ -27,8 +42,19 @@ SUBSYSTEM_DEF(zmimic) var/openspace_turfs = 0 var/multiqueue_skips_turf = 0 + var/multiqueue_skips_discovery = 0 var/multiqueue_skips_object = 0 + var/total_updates_turf = 0 + var/total_updates_discovery = 0 + var/total_updates_object = 0 + +#ifdef ZM_RECORD_STATS + var/list/turf_stats = list() + var/list/discovery_stats = list() + var/list/mimic_stats = list() +#endif + // Highest Z level in a given Z-group for absolute layering. // zstm[zlev] = group_max var/list/zlev_maximums = list() @@ -43,10 +69,10 @@ SUBSYSTEM_DEF(zmimic) var/fixup_hit = 0 // for admin proc-call -/datum/controller/subsystem/zmimic/proc/update_all() +/datum/controller/subsystem/zcopy/proc/update_all() // disable() can_fire = FALSE - log_debug("SSzmimic: update_all() invoked.") + log_debug("SSzcopy: update_all() invoked.") var/turf/T // putting the declaration up here totally speeds it up, right? var/num_upd = 0 @@ -71,7 +97,7 @@ SUBSYSTEM_DEF(zmimic) CHECK_TICK - log_debug("SSzmimic: [num_upd + num_amupd] turf updates queued ([num_upd] direct, [num_amupd] indirect), [num_del] orphans destroyed.") + log_debug("SSzcopy: [num_upd + num_amupd] turf updates queued ([num_upd] direct, [num_amupd] indirect), [num_del] orphans destroyed.") // enable() if (!can_fire) @@ -79,10 +105,10 @@ SUBSYSTEM_DEF(zmimic) can_fire = TRUE // for admin proc-call -/datum/controller/subsystem/zmimic/proc/hard_reset() +/datum/controller/subsystem/zcopy/proc/hard_reset() // disable() can_fire = FALSE - log_debug("SSzmimic: hard_reset() invoked.") + log_debug("SSzcopy: hard_reset() invoked.") var/num_deleted = 0 var/num_turfs = 0 @@ -109,28 +135,30 @@ SUBSYSTEM_DEF(zmimic) CHECK_TICK - log_debug("SSzmimic: deleted [num_deleted] overlays, and queued [num_turfs] turfs for update.") + log_debug("SSzcopy: deleted [num_deleted] overlays, and queued [num_turfs] turfs for update.") // enable() if (!can_fire) next_fire = world.time + wait can_fire = TRUE -/datum/controller/subsystem/zmimic/stat_entry() +/datum/controller/subsystem/zcopy/stat_entry() var/list/entries = list( "", // newline "ZSt: [build_zstack_display()]", // This is a human-readable list of the z-stacks known to ZM. "ZMx: [zlev_maximums.Join(", ")]", // And this is the raw internal state. // This one gets broken out from the below because it's more important. "Q: { T: [queued_turfs.len - (qt_idex - 1)] O: [queued_overlays.len - (qo_idex - 1)] }", - // In order: Total, Skipped - "T: { T: [openspace_turfs] O: [openspace_overlays] } Sk: { T: [multiqueue_skips_turf] O: [multiqueue_skips_object] }", - "F: { H: [fixup_hit] M: [fixup_miss] N: [fixup_noop] FC: [fixup_cache.len] FKG: [fixup_known_good.len] }", // Fixup stats. + // In order: Total, Queued, Skipped + "T(O): { T: [openspace_turfs] O: [openspace_overlays] }", + "T(U): { T: [total_updates_turf] D: [total_updates_discovery] O: [total_updates_object] }", + "Sk: { T: [multiqueue_skips_turf] D: [multiqueue_skips_discovery] O: [multiqueue_skips_object] }", + "F: { H: [fixup_hit] M: [fixup_miss] N: [fixup_noop] FC: [fixup_cache.len] FKG: [fixup_known_good.len] }" ) return ..() + entries.Join("
 ") // 1, 2, 3..=7, 8 -/datum/controller/subsystem/zmimic/proc/build_zstack_display() +/datum/controller/subsystem/zcopy/proc/build_zstack_display() if (!zlev_maximums.len) return "" var/list/zmx = list() @@ -148,14 +176,14 @@ SUBSYSTEM_DEF(zmimic) while (idx <= zlev_maximums.len) return jointext(zmx, ", ") -/datum/controller/subsystem/zmimic/Initialize(timeofday) +/datum/controller/subsystem/zcopy/Initialize(timeofday) calculate_zstack_limits() // Flush the queue. fire(FALSE, TRUE) return ..() // If you add a new Zlevel or change Z-connections, call this. -/datum/controller/subsystem/zmimic/proc/calculate_zstack_limits() +/datum/controller/subsystem/zcopy/proc/calculate_zstack_limits() zlev_maximums = new(world.maxz) var/start_zlev = 1 for (var/z in 1 to world.maxz) @@ -163,12 +191,12 @@ SUBSYSTEM_DEF(zmimic) for (var/member_zlev in start_zlev to z) zlev_maximums[member_zlev] = z if (z - start_zlev > OPENTURF_MAX_DEPTH) - log_subsystem("zmimic", "WARNING: Z-levels [start_zlev] through [z] exceed maximum depth of [OPENTURF_MAX_DEPTH]; layering may behave strangely in this Z-stack.") + log_subsystem("zcopy", "WARNING: Z-levels [start_zlev] through [z] exceed maximum depth of [OPENTURF_MAX_DEPTH]; layering may behave strangely in this Z-stack.") else if (z - start_zlev > 1) - log_subsystem("zmimic", "Found Z-Stack: [start_zlev] -> [z] = [z - start_zlev + 1] zl") + log_subsystem("zcopy", "Found Z-Stack: [start_zlev] -> [z] = [z - start_zlev + 1] zl") start_zlev = z + 1 - log_subsystem("zmimic", "Z-Level maximums: [json_encode(zlev_maximums)]") + log_subsystem("zcopy", "Z-Level maximums: [json_encode(zlev_maximums)]") // /datum/controller/subsystem/zmimic/StartLoadingMap() // suspend() @@ -177,7 +205,8 @@ SUBSYSTEM_DEF(zmimic) // wake() /// Fully reset Z-Mimic, rebuilding state from scratch. Use this if you change Z-stack mappings after Z-Mimic has initialized. Expensive. -/datum/controller/subsystem/zmimic/proc/RebuildZState() +/// WARNING: This is *completely unsupported*. It will probably irreversibly corrupt Z-lighting everywhere in the world. Use at own risk. +/datum/controller/subsystem/zcopy/proc/RebuildZState() // suspend() UNTIL(state == SS_IDLE) @@ -193,7 +222,7 @@ SUBSYSTEM_DEF(zmimic) CHECK_TICK // wake() -/datum/controller/subsystem/zmimic/fire(resumed = FALSE, no_mc_tick = FALSE) +/datum/controller/subsystem/zcopy/fire(resumed = FALSE, no_mc_tick = FALSE) if (!resumed) qt_idex = 1 qo_idex = 1 @@ -202,8 +231,16 @@ SUBSYSTEM_DEF(zmimic) if (!no_mc_tick) MC_SPLIT_TICK + tick_turfs(no_mc_tick) + + if (!no_mc_tick) + MC_SPLIT_TICK + + tick_mimic(no_mc_tick) + +// - Turf mimic - +/datum/controller/subsystem/zcopy/proc/tick_turfs(no_mc_tick) var/list/curr_turfs = queued_turfs - var/list/curr_ov = queued_overlays while (qt_idex <= curr_turfs.len) var/turf/T = curr_turfs[qt_idex] @@ -231,18 +268,23 @@ SUBSYSTEM_DEF(zmimic) // Z-Turf on the bottom-most level, just fake-copy space (or baseturf). // It's impossible for anything to be on the synthetic turf, so ignore the rest of the ZM machinery. if (!T.below) + ZM_RECORD_START flush_z_state(T) - if (T.mz_flags & MZ_MIMIC_BASETURF) + if (T.mz_flags & MZ_OVERRIDE) simple_appearance_copy(T, READ_BASETURF(T), OPENTURF_MAX_PLANE) else simple_appearance_copy(T, /turf/space) T.z_generation += 1 T.z_queued -= 1 + total_updates_turf += 1 if (T.above) T.above.update_mimic() + ZM_RECORD_STOP + ZM_RECORD_WRITE(turf_stats, "Fake: [T.type] on [T.z]") + if (no_mc_tick) CHECK_TICK else if (MC_TICK_CHECK) @@ -255,9 +297,12 @@ SUBSYSTEM_DEF(zmimic) T.z_generation += 1 + ZM_RECORD_START + // Get the bottom-most turf, the one we want to mimic. + // Baseturf mimics act as false bottoms of the stack. var/turf/Td = T - while (Td.below) + while (Td.below && !(Td.mz_flags & (MZ_OVERRIDE|MZ_TERMINATOR))) Td = Td.below // Depth must be the depth of the *visible* turf, not self. @@ -267,37 +312,39 @@ SUBSYSTEM_DEF(zmimic) var/t_target = OPENTURF_MAX_PLANE - turf_depth // This is where the turf (but not the copied atoms) gets put. // Turf is set to mimic baseturf, handle that and bail. - if (T.mz_flags & MZ_MIMIC_BASETURF) + if (T.mz_flags & MZ_OVERRIDE) flush_z_state(T) - simple_appearance_copy(T, READ_BASETURF(T), t_target) + simple_appearance_copy(T, Td.z_appearance || READ_BASETURF(T), t_target) if (T.above) T.above.update_mimic() + total_updates_turf += 1 T.z_queued -= 1 + ZM_RECORD_STOP + ZM_RECORD_WRITE(turf_stats, "Simple: [T.type] on [T.z]") + if (no_mc_tick) CHECK_TICK else if (MC_TICK_CHECK) break continue - // If we previously were MZ_MIMIC_BASETURF, there might be an orphaned proxy. + // If we previously were MZ_OVERRIDE, there might be an orphaned proxy. else if (T.mimic_underlay) QDEL_NULL(T.mimic_underlay) - // Handle space parallax & starlight. if (T.below.z_eventually_space) T.z_eventually_space = TRUE - if ((T.below.mz_flags & MZ_MIMIC_OVERWRITE) || T.below.type == /turf/space) - t_target = SPACE_PLANE + t_target = SPACE_PLANE if (T.mz_flags & MZ_MIMIC_OVERWRITE) // This openturf doesn't care about its icon, so we can just overwrite it. if (T.below.mimic_proxy) QDEL_NULL(T.below.mimic_proxy) - T.appearance = T.below + T.appearance = Td.z_appearance || Td T.name = initial(T.name) T.desc = initial(T.desc) T.gender = initial(T.gender) @@ -308,7 +355,7 @@ SUBSYSTEM_DEF(zmimic) if (!T.below.mimic_proxy) T.below.mimic_proxy = new(T) var/atom/movable/openspace/turf_proxy/TO = T.below.mimic_proxy - TO.appearance = Td + TO.appearance = Td.z_appearance || Td TO.name = T.name TO.gender = T.gender // Need to grab this too so PLURAL works properly in examine. TO.opacity = FALSE @@ -333,75 +380,45 @@ SUBSYSTEM_DEF(zmimic) // Handle below atoms. - // Add everything below us to the update queue. + var/shadower_set = FALSE + + // Add everything below us to the discovery queue. for (var/thing in T.below) var/atom/movable/object = thing if (QDELETED(object) || (object.zmm_flags & ZMM_IGNORE) || object.loc != T.below || object.invisibility == INVISIBILITY_ABSTRACT) - // Don't queue deleted stuff, stuff that's not visible, blacklisted stuff, or stuff that's centered on another tile but intersects ours. + /* Don't queue: + - (q)deleted objects + - Explicitly ignored objects + - Objects not rooted on this turf (multitiles) + - Always-invisible atoms + */ continue // Special case: these are merged into the shadower to reduce memory usage. if (object.type == /atom/movable/lighting_overlay) - T.shadower.copy_lighting(object) + T.shadower.copy_lighting(object, !(T.below.mz_flags & MZ_NO_SHADOW)) continue - if (!object.bound_overlay) // Generate a new overlay if the atom doesn't already have one. - object.bound_overlay = new(T) - object.bound_overlay.associated_atom = object - - var/override_depth - var/original_type = object.type - var/original_z = object.z - var/have_performed_fixup = FALSE - - switch (object.type) - // Layering for recursive mimic needs to be inherited. - if (/atom/movable/openspace/mimic) - var/atom/movable/openspace/mimic/OOO = object - original_type = OOO.mimiced_type - override_depth = OOO.override_depth - original_z = OOO.original_z - have_performed_fixup = OOO.have_performed_fixup - - // If this is a turf proxy (the mimic for a non-OVERWRITE turf), it needs to respect space parallax if relevant. - if (/atom/movable/openspace/turf_proxy) - if (T.z_eventually_space) - // Yes, this is an awful hack; I don't want to add yet another override_* var. - override_depth = OPENTURF_MAX_PLANE - SPACE_PLANE - - if (/atom/movable/openspace/turf_mimic) - original_z += 1 - - var/atom/movable/openspace/mimic/OO = object.bound_overlay - - // If the OO was queued for destruction but was claimed by another OT, stop the destruction timer. - if (OO.destruction_timer) - deltimer(OO.destruction_timer) - OO.destruction_timer = null - - OO.depth = override_depth || min(zlev_maximums[T.z] - original_z, OPENTURF_MAX_DEPTH) - - // These types need to be pushed a layer down for bigturfs to function correctly. - switch (original_type) - if (/atom/movable/openspace/multiplier, /atom/movable/openspace/turf_proxy) - if (OO.depth < OPENTURF_MAX_DEPTH) - OO.depth += 1 - - OO.mimiced_type = original_type - OO.override_depth = override_depth - OO.original_z = original_z - OO.have_performed_fixup ||= have_performed_fixup - - // Multi-queue to maintain ordering of updates to these - // queueing it multiple times will result in only the most recent - // actually processing. - OO.queued += 1 - queued_overlays += OO + // If an atom already has an overlay, we probably don't need to discover it again. + // ...but we need to force it if the object was salvaged from another zturf. + if (!object.bound_overlay || object.bound_overlay.destruction_timer) + discover_movable(object, T) + + if (!shadower_set) + if (T.below.mz_flags & MZ_NO_SHADOW) + T.shadower.color = null + else + T.shadower.color = SHADOWER_DARKENING_COLOR T.z_queued -= 1 if (T.above) T.above.update_mimic() + total_updates_turf += 1 + + ZM_RECORD_STOP + ZM_RECORD_WRITE(turf_stats, "Complex: [T.type] on [T.z]") + if (no_mc_tick) CHECK_TICK else if (MC_TICK_CHECK) @@ -411,9 +428,9 @@ SUBSYSTEM_DEF(zmimic) curr_turfs.Cut(1, qt_idex) qt_idex = 1 - if (!no_mc_tick) - MC_SPLIT_TICK - +// - Phase: Mimic update -- actually update the mimics' appearance, order sensitive - +/datum/controller/subsystem/zcopy/proc/tick_mimic(no_mc_tick) + var/list/curr_ov = queued_overlays while (qo_idex <= curr_ov.len) var/atom/movable/openspace/mimic/OO = curr_ov[qo_idex] curr_ov[qo_idex] = null @@ -426,8 +443,9 @@ SUBSYSTEM_DEF(zmimic) break continue - if (QDELETED(OO.associated_atom)) // This shouldn't happen, but just in-case. + if (QDELETED(OO.associated_atom)) // This shouldn't happen. qdel(OO) + log_debug("Z-Mimic: Received mimic with QDELETED parent ([OO.associated_atom || ""])") if (no_mc_tick) CHECK_TICK @@ -446,22 +464,24 @@ SUBSYSTEM_DEF(zmimic) break continue + ZM_RECORD_START + // Actually update the overlay. if (OO.dir != OO.associated_atom.dir) - OO.setDir(OO.associated_atom.dir) + OO.dir = OO.associated_atom.dir // updates are propagated up another way, don't use set_dir + OO.appearance = OO.associated_atom + OO.zmm_flags = OO.associated_atom.zmm_flags if (OO.particles != OO.associated_atom.particles) OO.particles = OO.associated_atom.particles - OO.appearance = OO.associated_atom - OO.zmm_flags = OO.associated_atom.zmm_flags OO.plane = OPENTURF_MAX_PLANE - OO.depth OO.opacity = FALSE OO.queued = 0 // If an atom has explicit plane sets on its overlays/underlays, we need to replace the appearance so they can be mangled to work with our planing. - if (OO.zmm_flags & (ZMM_MANGLE_PLANES | ZMM_AUTOMANGLE)) + if (OO.zmm_flags & ZMM_MANGLE_PLANES) var/new_appearance = fixup_appearance_planes(OO.appearance) if (new_appearance) OO.appearance = new_appearance @@ -470,6 +490,11 @@ SUBSYSTEM_DEF(zmimic) if (OO.bound_overlay) // If we have a bound overlay, queue it too. OO.update_above() + total_updates_object += 1 + + ZM_RECORD_STOP + ZM_RECORD_WRITE(mimic_stats, OO.mimiced_type) + if (no_mc_tick) CHECK_TICK else if (MC_TICK_CHECK) @@ -479,17 +504,88 @@ SUBSYSTEM_DEF(zmimic) curr_ov.Cut(1, qo_idex) qo_idex = 1 -/datum/controller/subsystem/zmimic/proc/flush_z_state(turf/T) +// return: is-invalid +/datum/controller/subsystem/zcopy/proc/discover_movable(atom/movable/object) + ASSERT(!QDELETED(object)) + + var/turf/Tloc = object.loc + if (!isturf(Tloc) || !Tloc.above) + return TRUE + + var/turf/T = Tloc.above + + ZM_RECORD_START + + if (!object.bound_overlay) + var/atom/movable/openspace/mimic/M = new(T) + object.bound_overlay = M + M.associated_atom = object + if (TURF_IS_MIMICKING(M.loc)) + .(M) + + var/override_depth + var/original_type = object.type + var/original_z = object.z + + switch (object.type) + // Layering for recursive mimic needs to be inherited. + if (/atom/movable/openspace/mimic) + var/atom/movable/openspace/mimic/OOO = object + original_type = OOO.mimiced_type + override_depth = OOO.override_depth + original_z = OOO.original_z + + // If this is a turf proxy (the mimic for a non-OVERWRITE turf), it needs to respect space parallax if relevant. + if (/atom/movable/openspace/turf_proxy) + if (T.z_eventually_space) + // Yes, this is an awful hack; I don't want to add yet another override_* var. + override_depth = OPENTURF_MAX_PLANE - SPACE_PLANE + + var/atom/movable/openspace/mimic/OO = object.bound_overlay + + // If the OO was queued for destruction but was claimed by another OT, stop the destruction timer. + if (OO.destruction_timer) + deltimer(OO.destruction_timer) + OO.destruction_timer = null + + OO.depth = override_depth || min(zlev_maximums[T.z] - original_z, OPENTURF_MAX_DEPTH) + + switch (original_type) + // These types need to be pushed a layer down for bigturfs to function correctly. + if (/atom/movable/openspace/turf_proxy, /atom/movable/openspace/turf_mimic) + OO.depth += 1 + if (/atom/movable/openspace/multiplier) + OO.depth += 1 + + OO.mimiced_type = original_type + OO.override_depth = override_depth + OO.original_z = original_z + + // Multi-queue to maintain ordering of updates to these + // queueing it multiple times will result in only the most recent + // actually processing. + OO.queued += 1 + queued_overlays += OO + + total_updates_discovery += 1 + + ZM_RECORD_STOP + ZM_RECORD_WRITE(discovery_stats, "Depth [OO.depth] on [OO.z]") + + return FALSE + +/datum/controller/subsystem/zcopy/proc/flush_z_state(turf/T) if (T.below) // Z-Mimic turfs aren't necessarily above another turf. if (T.below.mimic_above_copy) QDEL_NULL(T.below.mimic_above_copy) if (T.below.mimic_proxy) QDEL_NULL(T.below.mimic_proxy) + QDEL_NULL(T.mimic_underlay) for (var/atom/movable/openspace/mimic/OO in T) qdel(OO) -/datum/controller/subsystem/zmimic/proc/simple_appearance_copy(turf/T, new_appearance, target_plane) +/datum/controller/subsystem/zcopy/proc/simple_appearance_copy(turf/T, new_appearance, target_plane) if (T.mz_flags & MZ_MIMIC_OVERWRITE) T.appearance = new_appearance T.name = initial(T.name) @@ -504,7 +600,7 @@ SUBSYSTEM_DEF(zmimic) var/atom/movable/openspace/turf_proxy/TO = T.mimic_underlay TO.appearance = new_appearance TO.name = T.name - TO.gender = T.gender // Need to grab this too so PLURAL works properly in examine. + TO.gender = T.gender // Need to grab this too so PLURAL works properly in examine. TO.mouse_opacity = initial(TO.mouse_opacity) if (TO.plane == 0 && target_plane) TO.plane = target_plane @@ -513,7 +609,7 @@ SUBSYSTEM_DEF(zmimic) // For each of overlay,underlay, call fixup_appearance_planes; if it returns a new appearance, replace self /// Generate a new appearance from `appearance` with planes mangled to work with Z-Mimic. Do not pass a depth. -/datum/controller/subsystem/zmimic/proc/fixup_appearance_planes(appearance, depth = 0) +/datum/controller/subsystem/zcopy/proc/fixup_appearance_planes(appearance, depth = 0) // Adding this to guard against a reported runtime - supposed to be impossible, so cause is unclear. if(!appearance) @@ -601,7 +697,7 @@ SUBSYSTEM_DEF(zmimic) fixed_underlays[i] = fixed_appearance if (mutated) - for (var/i in 1 to fixed_overlays.len) + for (var/i in 1 to fixed_underlays.len) if (fixed_underlays[i] == null) fixed_underlays[i] = appearance:underlays[i] @@ -633,6 +729,7 @@ SUBSYSTEM_DEF(zmimic) return MA #define FMT_DEPTH(X) (X == null ? "(null)" : X) +#define FMT_OK(X) (X) ? "OK" : "MISMATCH" // This is a dummy object used so overlays can be shown in the analyzer. /atom/movable/openspace/debug @@ -641,6 +738,7 @@ SUBSYSTEM_DEF(zmimic) var/turf/parent var/computed_depth +// this is for debug display only -- fixed as in unchanging, not mangling var/list/zmimic_fixed_planes = list( "0" = "World plane (Non-Z)", "-15" = "Cloaked plane (Non-Z)", @@ -659,7 +757,7 @@ var/list/zmimic_fixed_planes = list( var/real_update_count = 0 var/claimed_update_count = T.z_queued - var/list/tq = SSzmimic.queued_turfs.Copy() + var/list/tq = SSzcopy.queued_turfs.Copy() for (var/turf/Tu in tq) if (Tu == T) real_update_count += 1 @@ -673,7 +771,7 @@ var/list/zmimic_fixed_planes = list( "", "

Analysis of [T] at [T.x],[T.y],[T.z]

", "Queue occurrences: [T.z_queued]", - "Above space: Apparent [T.z_eventually_space ? "Yes" : "No"], Actual [is_above_space ? "Yes" : "No"] - [T.z_eventually_space == is_above_space ? "OK" : "MISMATCH"]", + "Above space: Apparent [T.z_eventually_space ? "Yes" : "No"], Actual [is_above_space ? "Yes" : "No"] - [FMT_OK(T.z_eventually_space == is_above_space)]", "Z Flags: [english_list(bitfield2list(T.mz_flags, global.mimic_defines), "(none)")]", "Has Shadower: [T.shadower ? "Yes" : "No"]", "Has turf proxy: [T.mimic_proxy ? "Yes" : "No"]", @@ -682,20 +780,20 @@ var/list/zmimic_fixed_planes = list( "Below: [!T.below ? "(nothing)" : "[T.below] at [T.below.x],[T.below.y],[T.below.z]"]", "Depth: [FMT_DEPTH(T.z_depth)] [T.z_depth == OPENTURF_MAX_DEPTH ? "(max)" : ""]", "Generation: [T.z_generation]", - "Update count: Claimed [claimed_update_count], Actual [real_update_count] - [claimed_update_count == real_update_count ? "OK" : "MISMATCH"]", + "Update count: Claimed [claimed_update_count], Actual [real_update_count] - [FMT_OK(claimed_update_count == real_update_count)]", "