diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 9998d5c82b..3fcaf2691e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -3,3 +3,8 @@ # This list is alphabetized by User -> Filename KEEP IT THAT WAY # In the event that multiple org members are to be informed of changes # to the same file or dir, add them to the end under Multiple Owners + +# Username + +# /path/to/file.dm @Username +# /path/to/directory @Username diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000..36292805d5 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,5 @@ + + +## About The Pull Request + + diff --git a/.github/workflows/remove_guide_comments.yml b/.github/workflows/remove_guide_comments.yml new file mode 100644 index 0000000000..621d860c5c --- /dev/null +++ b/.github/workflows/remove_guide_comments.yml @@ -0,0 +1,18 @@ +# Removes guide comments from PRs when opened, so that when we merge them +# and reuse the pull request description, the clutter is not left behind +name: Remove guide comments +on: + pull_request_target: + types: [opened] +jobs: + remove_guide_comments: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Remove guide comments + uses: actions/github-script@v7 + with: + script: | + const { removeGuideComments } = await import('${{ github.workspace }}/tools/pull_request_hooks/removeGuideComments.js') + await removeGuideComments({ github, context }) diff --git a/.github/workflows/render_nanomaps.yml b/.github/workflows/render_nanomaps.yml index ec05c188cb..692e9b827b 100644 --- a/.github/workflows/render_nanomaps.yml +++ b/.github/workflows/render_nanomaps.yml @@ -10,6 +10,7 @@ on: - master paths: - 'maps/**' + workflow_dispatch: permissions: {} jobs: @@ -19,7 +20,7 @@ jobs: pull-requests: write # to create pull requests (repo-sync/pull-request) name: 'Generate NanoMaps' - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Clone uses: actions/checkout@v4 @@ -30,7 +31,17 @@ jobs: git branch -f nanomaps_generation git checkout nanomaps_generation git reset --hard origin/master - + - name: Restore SpacemanDMM cache + uses: actions/cache@v4 + with: + path: ~/SpacemanDMM + key: ${{ runner.os }}-spacemandmm-${{ hashFiles('dependencies.sh') }} + restore-keys: | + ${{ runner.os }}-spacemandmm- + - name: Install Tools + run: | + bash tools/ci/install_spaceman_dmm.sh dmm-tools + sudo apt install -y imagemagick - name: Ensure +x on github-actions directory run: chmod -R +x ./tools/github-actions diff --git a/code/ATMOSPHERICS/components/binary_devices/pipeturbine.dm b/code/ATMOSPHERICS/components/binary_devices/pipeturbine.dm index df55d47a9f..a79d3b65da 100644 --- a/code/ATMOSPHERICS/components/binary_devices/pipeturbine.dm +++ b/code/ATMOSPHERICS/components/binary_devices/pipeturbine.dm @@ -18,8 +18,8 @@ var/datum/pipe_network/network1 var/datum/pipe_network/network2 -/obj/machinery/atmospherics/pipeturbine/New() - ..() +/obj/machinery/atmospherics/pipeturbine/Initialize(mapload, newdir) + . = ..() air_in.volume = 200 air_out.volume = 800 volume_ratio = air_in.volume / (air_in.volume + air_out.volume) diff --git a/code/__defines/dcs/signals/signals_subsystem.dm b/code/__defines/dcs/signals/signals_subsystem.dm new file mode 100644 index 0000000000..26daf58e1a --- /dev/null +++ b/code/__defines/dcs/signals/signals_subsystem.dm @@ -0,0 +1,7 @@ +// Subsystem signals. Format: +// When the signal is called: (signal arguments) +// All signals send the source datum of the signal as the first argument + +///Subsystem signals +///From base of datum/controller/subsystem/Initialize +#define COMSIG_SUBSYSTEM_POST_INITIALIZE "subsystem_post_initialize" diff --git a/code/__defines/dna.dm b/code/__defines/dna.dm index b958466201..bcf5f15e3c 100644 --- a/code/__defines/dna.dm +++ b/code/__defines/dna.dm @@ -160,3 +160,4 @@ var/SMALLSIZEBLOCK = 0 // Gene flags #define GENE_ALWAYS_ACTIVATE 1 +#define MUTCHK_HIDEMSG 2 diff --git a/code/__defines/exosuit_fab.dm b/code/__defines/exosuit_fab.dm index 030c324cd3..e3da26b840 100644 --- a/code/__defines/exosuit_fab.dm +++ b/code/__defines/exosuit_fab.dm @@ -35,10 +35,16 @@ #define EXOSUIT_MODULE_DURAND (1<<3) /// Module is compatible with Phazon Exosuit models #define EXOSUIT_MODULE_PHAZON (1<<4) +/// Module is compatible with Pinnace Fighter models +#define EXOSUIT_MODULE_PINNACE (1<<5) +/// Module is compatible with Baron Fighter models +#define EXOSUIT_MODULE_BARON (1<<6) /// Module is compatible with "Working" Exosuit models - Ripley #define EXOSUIT_MODULE_WORKING EXOSUIT_MODULE_RIPLEY /// Module is compatible with "Combat" Exosuit models - Gygax, Durand and Phazon #define EXOSUIT_MODULE_COMBAT EXOSUIT_MODULE_GYGAX | EXOSUIT_MODULE_DURAND | EXOSUIT_MODULE_PHAZON -/// Module is compatible with "Medical" Exosuit modelsm - Odysseus +/// Module is compatible with "Medical" Exosuit models - Odysseus #define EXOSUIT_MODULE_MEDICAL EXOSUIT_MODULE_ODYSSEUS +/// Module is compatible with "Fighter" Exosuit models - Pinnace, Baron +#define EXOSUIT_MODULE_FIGHTER EXOSUIT_MODULE_PINNACE | EXOSUIT_MODULE_BARON diff --git a/code/__defines/is_helpers.dm b/code/__defines/is_helpers.dm index f56b590be9..71b7858571 100644 --- a/code/__defines/is_helpers.dm +++ b/code/__defines/is_helpers.dm @@ -42,6 +42,7 @@ #define iscorgi(A) istype(A, /mob/living/simple_mob/animal/passive/dog/corgi) #define isslime(A) istype(A, /mob/living/simple_mob/slime) #define isxeno(A) istype(A, /mob/living/simple_mob/animal/space/alien) +#define issimplekin(A) istype(A, /mob/living/simple_mob/shadekin) #define iscarbon(A) istype(A, /mob/living/carbon) #define isalien(A) istype(A, /mob/living/carbon/alien) diff --git a/code/__defines/misc.dm b/code/__defines/misc.dm index ab3d82c281..0a34f8e30a 100644 --- a/code/__defines/misc.dm +++ b/code/__defines/misc.dm @@ -29,6 +29,7 @@ // For the client FPS pref and anywhere else #define MAX_CLIENT_FPS 200 +#define RECOMMENDED_FPS 100 // Some arbitrary defines to be used by self-pruning global lists. (see master_controller) #define MAX_GEAR_COST 15 // Used in chargen for accessory loadout limit. diff --git a/code/__defines/mobs.dm b/code/__defines/mobs.dm index 790d8dcf4a..4e31ab3309 100644 --- a/code/__defines/mobs.dm +++ b/code/__defines/mobs.dm @@ -75,6 +75,9 @@ #define I_GRAB "grab" #define I_HURT "harm" +#define I_RUN "run" +#define I_WALK "walk" + //These are used Bump() code for living mobs, in the mob_bump_flag, mob_swap_flags, and mob_push_flags vars to determine whom can bump/swap with whom. #define HUMAN 1 #define MONKEY 2 @@ -262,6 +265,13 @@ #define MOB_PULL_SAME 2 #define MOB_PULL_LARGER 3 +//Protean organs +#define O_ORCH "orchestrator" +#define O_FACT "refactory" + +//Alraune organs +#define A_FRUIT "fruit gland" + //XENOBIO2 FLAGS #define NOMUT 0 #define COLORMUT 1 @@ -298,23 +308,42 @@ #define SPECIES_UNATHI "Unathi" #define SPECIES_SKRELL "Skrell" #define SPECIES_TESHARI "Teshari" -#define SPECIES_TAJ "Tajara" +#define SPECIES_TAJARAN "Tajara" #define SPECIES_PROMETHEAN "Promethean" #define SPECIES_DIONA "Diona" #define SPECIES_VOX "Vox" #define SPECIES_ZADDAT "Zaddat" +#define SPECIES_AKULA "Akula" +#define SPECIES_ALRAUNE "Alraune" +#define SPECIES_NEVREAN "Nevrean" +#define SPECIES_PROTEAN "Protean" +#define SPECIES_RAPALA "Rapala" +#define SPECIES_SERGAL "Sergal" +#define SPECIES_ALTEVIAN "Altevian" +#define SPECIES_SHADEKIN_CREW "Black-Eyed Shadekin" +#define SPECIES_VASILISSAN "Vasilissan" +#define SPECIES_VULPKANIN "Vulpkanin" +#define SPECIES_XENOCHIMERA "Xenochimera" +#define SPECIES_ZORREN_HIGH "Zorren" +#define SPECIES_CUSTOM "Custom Species" +#define SPECIES_LLEILL "Lleill" +#define SPECIES_HANNER "Hanner" // Monkey and alien monkeys. -#define SPECIES_MONKEY "Monkey" -#define SPECIES_MONKEY_TAJ "Farwa" -#define SPECIES_MONKEY_SKRELL "Neaera" -#define SPECIES_MONKEY_UNATHI "Stok" +#define SPECIES_MONKEY "Monkey" +#define SPECIES_MONKEY_TAJ "Farwa" +#define SPECIES_MONKEY_SKRELL "Neaera" +#define SPECIES_MONKEY_UNATHI "Stok" +#define SPECIES_MONKEY_AKULA "Sobaka" +#define SPECIES_MONKEY_NEVREAN "Sparra" +#define SPECIES_MONKEY_SERGAL "Saru" +#define SPECIES_MONKEY_VULPKANIN "Wolpin" // Virtual Reality IDs. #define SPECIES_VR "Virtual Reality Avatar" #define SPECIES_VR_HUMAN "Virtual Reality Human" #define SPECIES_VR_UNATHI "Virtual Reality Unathi" -#define SPECIES_VR_TAJ "Virtual Reality Tajara" // NO CHANGING. +#define SPECIES_VR_TAJARAN "Virtual Reality Tajara" // NO CHANGING. #define SPECIES_VR_SKRELL "Virtual Reality Skrell" #define SPECIES_VR_TESHARI "Virtual Reality Teshari" #define SPECIES_VR_DIONA "Virtual Reality Diona" @@ -343,6 +372,24 @@ #define SPECIES_REPLICANT_ALPHA "Alpha Replicant" #define SPECIES_REPLICANT_BETA "Beta Replicant" #define SPECIES_REPLICANT_CREW "Gamma Replicant" +#define SPECIES_WEREBEAST "Werebeast" +#define SPECIES_SHADEKIN "Shadekin" + +// Custom species base +#define SPECIES_FENNEC "Fennec" +#define SPECIES_XENOHYBRID "Xenohybrid" + +//for custom bodytypes +#define SELECTS_BODYTYPE_FALSE 0 +#define SELECTS_BODYTYPE_CUSTOM 1 +#define SELECTS_BODYTYPE_SHAPESHIFTER 2 + +#define MARKING_NONDIGI_ONLY (1 << 0) +#define MARKING_DIGITIGRADE_ONLY (1 << 1) +#define MARKING_ALL_LEGS MARKING_NONDIGI_ONLY|MARKING_DIGITIGRADE_ONLY + +//Grabs +#define UPGRADE_COOLDOWN 40 // Used to seperate simple animals by ""intelligence"". #define SA_PLANT 1 diff --git a/code/__defines/mobs_vr.dm b/code/__defines/mobs_vr.dm deleted file mode 100644 index af0eddf426..0000000000 --- a/code/__defines/mobs_vr.dm +++ /dev/null @@ -1,50 +0,0 @@ -//Protean organs -#define O_ORCH "orchestrator" -#define O_FACT "refactory" - -//Alraune organs -#define A_FRUIT "fruit gland" - -//species defines - -//station species -#define SPECIES_AKULA "Akula" -#define SPECIES_ALRAUNE "Alraune" -#define SPECIES_NEVREAN "Nevrean" -#define SPECIES_PROTEAN "Protean" -#define SPECIES_RAPALA "Rapala" -#define SPECIES_SERGAL "Sergal" -#define SPECIES_ALTEVIAN "Altevian" -#define SPECIES_SHADEKIN_CREW "Black-Eyed Shadekin" -#define SPECIES_VASILISSAN "Vasilissan" -#define SPECIES_VULPKANIN "Vulpkanin" -#define SPECIES_XENOCHIMERA "Xenochimera" -#define SPECIES_ZORREN_HIGH "Zorren" -#define SPECIES_CUSTOM "Custom Species" -#define SPECIES_TAJARAN "Tajara" -#define SPECIES_LLEILL "Lleill" -#define SPECIES_HANNER "Hanner" -//monkey species -#define SPECIES_MONKEY_AKULA "Sobaka" -#define SPECIES_MONKEY_NEVREAN "Sparra" -#define SPECIES_MONKEY_SERGAL "Saru" -#define SPECIES_MONKEY_VULPKANIN "Wolpin" -//event species -#define SPECIES_WEREBEAST "Werebeast" -#define SPECIES_SHADEKIN "Shadekin" -//custom species base sprites -#define SPECIES_FENNEC "Fennec" -#define SPECIES_XENOHYBRID "Xenohybrid" - -//for custom bodytypes - -#define SELECTS_BODYTYPE_FALSE 0 -#define SELECTS_BODYTYPE_CUSTOM 1 -#define SELECTS_BODYTYPE_SHAPESHIFTER 2 - -#define MARKING_NONDIGI_ONLY (1 << 0) -#define MARKING_DIGITIGRADE_ONLY (1 << 1) -#define MARKING_ALL_LEGS MARKING_NONDIGI_ONLY|MARKING_DIGITIGRADE_ONLY - -//Grabs -#define UPGRADE_COOLDOWN 40 diff --git a/code/__defines/preferences.dm b/code/__defines/preferences.dm index 14adeb62bb..5e03f3217c 100644 --- a/code/__defines/preferences.dm +++ b/code/__defines/preferences.dm @@ -16,6 +16,15 @@ #define SAVE_RESET -1 +//randomised elements +#define RANDOM_ANTAG_ONLY 1 +#define RANDOM_DISABLED 2 +#define RANDOM_ENABLED 3 + +// randomise_appearance_prefs() and randomize_human_appearance() proc flags +#define RANDOMIZE_SPECIES (1<<0) +#define RANDOMIZE_NAME (1<<1) + // Values for /datum/preference/savefile_identifier /// This preference is character specific. #define PREFERENCE_CHARACTER "character" diff --git a/code/__defines/sprite_sheets.dm b/code/__defines/sprite_sheets.dm index 06b119a8e3..b474b31301 100644 --- a/code/__defines/sprite_sheets.dm +++ b/code/__defines/sprite_sheets.dm @@ -1,7 +1,7 @@ // Default species get default sprites, VR species get VR sprites #define VR_SPECIES_SPRITE_SHEETS_SUIT_MOB list(\ SPECIES_HUMAN = 'icons/inventory/suit/mob.dmi',\ -SPECIES_TAJ = 'icons/inventory/suit/mob_tajaran.dmi',\ +SPECIES_TAJARAN = 'icons/inventory/suit/mob_tajaran.dmi',\ SPECIES_SKRELL = 'icons/inventory/suit/mob_skrell.dmi',\ SPECIES_UNATHI = 'icons/inventory/suit/mob_unathi.dmi',\ SPECIES_TESHARI = 'icons/inventory/suit/mob_teshari.dmi',\ @@ -15,7 +15,7 @@ SPECIES_FENNEC = 'icons/inventory/suit/mob_vr_vulpkanin.dmi',\ SPECIES_ALTEVIAN = 'icons/inventory/suit/mob_vr_altevian.dmi') #define VR_SPECIES_SPRITE_SHEETS_HEAD_MOB list(\ SPECIES_HUMAN = 'icons/inventory/head/mob.dmi',\ -SPECIES_TAJ = 'icons/inventory/head/mob_tajaran.dmi',\ +SPECIES_TAJARAN = 'icons/inventory/head/mob_tajaran.dmi',\ SPECIES_SKRELL = 'icons/inventory/head/mob_skrell.dmi',\ SPECIES_UNATHI = 'icons/inventory/head/mob_unathi.dmi',\ SPECIES_TESHARI = 'icons/inventory/head/mob_teshari.dmi',\ @@ -30,7 +30,7 @@ SPECIES_ALTEVIAN = 'icons/inventory/head/mob_vr_altevian.dmi',\ SPECIES_GREY_YW = 'icons/inventory/head/mob_grey.dmi' /* yw edit - shadekin */) #define VR_SPECIES_SPRITE_SHEETS_HANDS_MOB list(\ SPECIES_HUMAN = 'icons/inventory/hands/mob.dmi',\ -SPECIES_TAJ = 'icons/inventory/hands/mob_tajaran.dmi',\ +SPECIES_TAJARAN = 'icons/inventory/hands/mob_tajaran.dmi',\ SPECIES_SKRELL = 'icons/inventory/hands/mob_skrell.dmi',\ SPECIES_UNATHI = 'icons/inventory/hands/mob_unathi.dmi',\ SPECIES_TESHARI = 'icons/inventory/hands/mob_teshari.dmi',\ @@ -43,7 +43,7 @@ SPECIES_ZORREN_HIGH = 'icons/inventory/hands/mob_vr_vulpkanin.dmi',\ SPECIES_FENNEC = 'icons/inventory/hands/mob_vr_vulpkanin.dmi') #define VR_SPECIES_SPRITE_SHEETS_FEET_MOB list(\ SPECIES_HUMAN = 'icons/inventory/feet/mob.dmi',\ -SPECIES_TAJ = 'icons/inventory/feet/mob_tajaran.dmi',\ +SPECIES_TAJARAN = 'icons/inventory/feet/mob_tajaran.dmi',\ SPECIES_SKRELL = 'icons/inventory/feet/mob_skrell.dmi',\ SPECIES_UNATHI = 'icons/inventory/feet/mob_unathi.dmi',\ SPECIES_TESHARI = 'icons/inventory/feet/mob_teshari.dmi',\ @@ -57,7 +57,7 @@ SPECIES_FENNEC = 'icons/inventory/feet/mob_vr_vulpkanin.dmi') #define VR_SPECIES_SPRITE_SHEETS_SUIT_ITEM list(\ SPECIES_HUMAN = 'icons/inventory/suit/item.dmi',\ -SPECIES_TAJ = 'icons/inventory/suit/item_tajaran.dmi',\ +SPECIES_TAJARAN = 'icons/inventory/suit/item_tajaran.dmi',\ SPECIES_SKRELL = 'icons/inventory/suit/item_skrell.dmi',\ SPECIES_UNATHI = 'icons/inventory/suit/item_unathi.dmi',\ SPECIES_TESHARI = 'icons/inventory/suit/item_teshari.dmi',\ @@ -71,7 +71,7 @@ SPECIES_FENNEC = 'icons/inventory/suit/item_vr_vulpkanin.dmi',\ SPECIES_ALTEVIAN = 'icons/inventory/suit/item_vr_altevian.dmi') #define VR_SPECIES_SPRITE_SHEETS_HEAD_ITEM list(\ SPECIES_HUMAN = 'icons/inventory/head/item.dmi',\ -SPECIES_TAJ = 'icons/inventory/head/item_tajaran.dmi',\ +SPECIES_TAJARAN = 'icons/inventory/head/item_tajaran.dmi',\ SPECIES_SKRELL = 'icons/inventory/head/item_skrell.dmi',\ SPECIES_UNATHI = 'icons/inventory/head/item_unathi.dmi',\ SPECIES_TESHARI = 'icons/inventory/head/item_teshari.dmi',\ @@ -85,7 +85,7 @@ SPECIES_FENNEC = 'icons/inventory/head/item_vr_vulpkanin.dmi',\ SPECIES_ALTEVIAN = 'icons/inventory/head/item_vr_altevian.dmi') #define VR_SPECIES_SPRITE_SHEETS_HANDS_ITEM list(\ SPECIES_HUMAN = 'icons/inventory/hands/item.dmi',\ -SPECIES_TAJ = 'icons/inventory/hands/item_tajaran.dmi',\ +SPECIES_TAJARAN = 'icons/inventory/hands/item_tajaran.dmi',\ SPECIES_SKRELL = 'icons/inventory/hands/item_skrell.dmi',\ SPECIES_UNATHI = 'icons/inventory/hands/item_unathi.dmi',\ SPECIES_TESHARI = 'icons/inventory/hands/item_teshari.dmi',\ @@ -98,7 +98,7 @@ SPECIES_ZORREN_HIGH = 'icons/inventory/hands/item_vr_vulpkanin.dmi',\ SPECIES_FENNEC = 'icons/inventory/hands/item_vr_vulpkanin.dmi') #define VR_SPECIES_SPRITE_SHEETS_FEET_ITEM list(\ SPECIES_HUMAN = 'icons/inventory/feet/item.dmi',\ -SPECIES_TAJ = 'icons/inventory/feet/item_tajaran.dmi',\ +SPECIES_TAJARAN = 'icons/inventory/feet/item_tajaran.dmi',\ SPECIES_SKRELL = 'icons/inventory/feet/item_skrell.dmi',\ SPECIES_UNATHI = 'icons/inventory/feet/item_unathi.dmi',\ SPECIES_TESHARI = 'icons/inventory/feet/item_teshari.dmi',\ @@ -113,7 +113,7 @@ SPECIES_FENNEC = 'icons/inventory/feet/item_vr_vulpkanin.dmi') // All species get VR sprites #define ALL_VR_SPRITE_SHEETS_SUIT_MOB list(\ SPECIES_HUMAN = 'icons/inventory/suit/mob_vr.dmi',\ -SPECIES_TAJ = 'icons/inventory/suit/mob_vr_tajaran.dmi',\ +SPECIES_TAJARAN = 'icons/inventory/suit/mob_vr_tajaran.dmi',\ SPECIES_SKRELL = 'icons/inventory/suit/mob_vr_skrell.dmi',\ SPECIES_UNATHI = 'icons/inventory/suit/mob_vr_unathi.dmi',\ SPECIES_TESHARI = 'icons/inventory/suit/mob_vr_teshari.dmi',\ @@ -127,7 +127,7 @@ SPECIES_FENNEC = 'icons/inventory/suit/mob_vr_vulpkanin.dmi',\ SPECIES_ALTEVIAN = 'icons/inventory/suit/mob_vr_altevian.dmi') #define ALL_VR_SPRITE_SHEETS_HEAD_MOB list(\ SPECIES_HUMAN = 'icons/inventory/head/mob_vr.dmi',\ -SPECIES_TAJ = 'icons/inventory/head/mob_vr_tajaran.dmi',\ +SPECIES_TAJARAN = 'icons/inventory/head/mob_vr_tajaran.dmi',\ SPECIES_SKRELL = 'icons/inventory/head/mob_vr_skrell.dmi',\ SPECIES_UNATHI = 'icons/inventory/head/mob_vr_unathi.dmi',\ SPECIES_TESHARI = 'icons/inventory/head/mob_vr_teshari.dmi',\ @@ -142,7 +142,7 @@ SPECIES_ALTEVIAN = 'icons/inventory/head/mob_vr_altevian.dmi',\ SPECIES_GREY_YW = 'icons/inventory/head/mob_grey.dmi' /* yw edit - shadekin */) #define ALL_VR_SPRITE_SHEETS_HANDS_MOB list(\ SPECIES_HUMAN = 'icons/inventory/hands/mob_vr.dmi',\ -SPECIES_TAJ = 'icons/inventory/hands/mob_vr_tajaran.dmi',\ +SPECIES_TAJARAN = 'icons/inventory/hands/mob_vr_tajaran.dmi',\ SPECIES_SKRELL = 'icons/inventory/hands/mob_vr_skrell.dmi',\ SPECIES_UNATHI = 'icons/inventory/hands/mob_vr_unathi.dmi',\ SPECIES_TESHARI = 'icons/inventory/hands/mob_vr_teshari.dmi',\ @@ -155,7 +155,7 @@ SPECIES_ZORREN_HIGH = 'icons/inventory/hands/mob_vr_vulpkanin.dmi',\ SPECIES_FENNEC = 'icons/inventory/hands/mob_vr_vulpkanin.dmi') #define ALL_VR_SPRITE_SHEETS_FEET_MOB list(\ SPECIES_HUMAN = 'icons/inventory/feet/mob_vr.dmi',\ -SPECIES_TAJ = 'icons/inventory/feet/mob_vr_tajaran.dmi',\ +SPECIES_TAJARAN = 'icons/inventory/feet/mob_vr_tajaran.dmi',\ SPECIES_SKRELL = 'icons/inventory/feet/mob_vr_skrell.dmi',\ SPECIES_UNATHI = 'icons/inventory/feet/mob_vr_unathi.dmi',\ SPECIES_TESHARI = 'icons/inventory/feet/mob_vr_teshari.dmi',\ @@ -169,7 +169,7 @@ SPECIES_FENNEC = 'icons/inventory/feet/mob_vr_vulpkanin.dmi') #define ALL_VR_SPRITE_SHEETS_SUIT_ITEM list(\ SPECIES_HUMAN = 'icons/inventory/suit/item_vr.dmi',\ -SPECIES_TAJ = 'icons/inventory/suit/item_vr_tajaran.dmi',\ +SPECIES_TAJARAN = 'icons/inventory/suit/item_vr_tajaran.dmi',\ SPECIES_SKRELL = 'icons/inventory/suit/item_vr_skrell.dmi',\ SPECIES_UNATHI = 'icons/inventory/suit/item_vr_unathi.dmi',\ SPECIES_TESHARI = 'icons/inventory/suit/item_vr_teshari.dmi',\ @@ -183,7 +183,7 @@ SPECIES_FENNEC = 'icons/inventory/suit/item_vr_vulpkanin.dmi',\ SPECIES_ALTEVIAN = 'icons/inventory/suit/item_vr_altevian.dmi') #define ALL_VR_SPRITE_SHEETS_HEAD_ITEM list(\ SPECIES_HUMAN = 'icons/inventory/head/item_vr.dmi',\ -SPECIES_TAJ = 'icons/inventory/head/item_vr_tajaran.dmi',\ +SPECIES_TAJARAN = 'icons/inventory/head/item_vr_tajaran.dmi',\ SPECIES_SKRELL = 'icons/inventory/head/item_vr_skrell.dmi',\ SPECIES_UNATHI = 'icons/inventory/head/item_vr_unathi.dmi',\ SPECIES_TESHARI = 'icons/inventory/head/item_vr_teshari.dmi',\ @@ -197,7 +197,7 @@ SPECIES_FENNEC = 'icons/inventory/head/item_vr_vulpkanin.dmi',\ SPECIES_ALTEVIAN = 'icons/inventory/head/item_vr_altevian.dmi') #define ALL_VR_SPRITE_SHEETS_HANDS_ITEM list(\ SPECIES_HUMAN = 'icons/inventory/hands/item_vr.dmi',\ -SPECIES_TAJ = 'icons/inventory/hands/item_vr_tajaran.dmi',\ +SPECIES_TAJARAN = 'icons/inventory/hands/item_vr_tajaran.dmi',\ SPECIES_SKRELL = 'icons/inventory/hands/item_vr_skrell.dmi',\ SPECIES_UNATHI = 'icons/inventory/hands/item_vr_unathi.dmi',\ SPECIES_TESHARI = 'icons/inventory/hands/item_vr_teshari.dmi',\ @@ -210,7 +210,7 @@ SPECIES_ZORREN_HIGH = 'icons/inventory/hands/item_vr_vulpkanin.dmi',\ SPECIES_FENNEC = 'icons/inventory/hands/item_vr_vulpkanin.dmi') #define ALL_VR_SPRITE_SHEETS_FEET_ITEM list(\ SPECIES_HUMAN = 'icons/inventory/feet/item_vr.dmi',\ -SPECIES_TAJ = 'icons/inventory/feet/item_vr_tajaran.dmi',\ +SPECIES_TAJARAN = 'icons/inventory/feet/item_vr_tajaran.dmi',\ SPECIES_SKRELL = 'icons/inventory/feet/item_vr_skrell.dmi',\ SPECIES_UNATHI = 'icons/inventory/feet/item_vr_unathi.dmi',\ SPECIES_TESHARI = 'icons/inventory/feet/item_vr_teshari.dmi',\ diff --git a/code/__defines/subsystems.dm b/code/__defines/subsystems.dm index 4d80021c0f..eb813b0d1a 100644 --- a/code/__defines/subsystems.dm +++ b/code/__defines/subsystems.dm @@ -202,3 +202,6 @@ var/global/list/runlevel_flags = list(RUNLEVEL_LOBBY, RUNLEVEL_SETUP, RUNLEVEL_G * * timer_subsystem the subsystem to insert this timer into */ #define addtimer(args...) _addtimer(args, file = __FILE__, line = __LINE__) + +/// The timer key used to know how long subsystem initialization takes +#define SS_INIT_TIMER_KEY "ss_init" diff --git a/code/_global_vars/lists/misc.dm b/code/_global_vars/lists/misc.dm index 5fb7fadce2..7fbe4c74f1 100644 --- a/code/_global_vars/lists/misc.dm +++ b/code/_global_vars/lists/misc.dm @@ -11,3 +11,5 @@ GLOBAL_LIST_EMPTY(tagger_locations) GLOBAL_LIST_INIT(char_directory_tags, list("Pred", "Pred-Pref", "Prey", "Prey-Pref", "Switch", "Non-Vore", "Unset")) GLOBAL_LIST_INIT(char_directory_erptags, list("Dominant", "Dom-Pref", "Submissive", "Sub-Pref", "Switch", "No ERP", "Unset")) GLOBAL_LIST_EMPTY(crafting_recipes) //list of all table craft recipes + +GLOBAL_LIST_INIT(uplink_locations, list("PDA", "Headset", "None")) diff --git a/code/_helpers/_lists.dm b/code/_helpers/_lists.dm index babe0b58d2..9a0a7ec500 100644 --- a/code/_helpers/_lists.dm +++ b/code/_helpers/_lists.dm @@ -975,3 +975,10 @@ var/global/list/json_cache = list() if(islist(value)) new_value = deep_copy_list_alt(value) copied_list[key_or_value] = new_value + +/// Turns an associative list into a flat list of keys +/proc/assoc_to_keys(list/input) + var/list/keys = list() + for(var/key in input) + UNTYPED_LIST_ADD(keys, key) + return keys diff --git a/code/_helpers/mobs.dm b/code/_helpers/mobs.dm index 0efc265b49..5c29365452 100644 --- a/code/_helpers/mobs.dm +++ b/code/_helpers/mobs.dm @@ -11,7 +11,7 @@ return src /mob/living/bot/mulebot/get_mob() - if(load && istype(load, /mob/living)) + if(load && isliving(load)) return list(src, load) return src @@ -167,7 +167,7 @@ Proc for attack log creation, because really why not //checks whether this item is a module of the robot it is located in. /proc/is_robot_module(var/obj/item/thing) - if (!thing || !istype(thing.loc, /mob/living/silicon/robot)) + if (!thing || !isrobot(thing.loc)) return 0 var/mob/living/silicon/robot/R = thing.loc return (thing in R.module.modules) @@ -354,7 +354,7 @@ Proc for attack log creation, because really why not cached_character_icons[cachekey] = . /proc/not_has_ooc_text(mob/user) - if (CONFIG_GET(flag/allow_metadata) && (!user.client?.prefs?.metadata || length(user.client.prefs.metadata) < 15)) + if (CONFIG_GET(flag/allow_metadata) && (!user.client?.prefs?.read_preference(/datum/preference/text/living/ooc_notes) || length(user.client.prefs.read_preference(/datum/preference/text/living/ooc_notes)) < 15)) to_chat(user, span_warning("Please set informative OOC notes related to RP/ERP preferences. Set them using the 'OOC Notes' button on the 'General' tab in character setup.")) return TRUE return FALSE diff --git a/code/_helpers/text.dm b/code/_helpers/text.dm index 725335f267..910644d63f 100644 --- a/code/_helpers/text.dm +++ b/code/_helpers/text.dm @@ -349,7 +349,7 @@ GLOBAL_LIST_EMPTY(text_tag_cache) if(!(C && C.prefs?.read_preference(/datum/preference/toggle/chat_tags))) return tagdesc if(!GLOB.text_tag_cache[tagname]) - var/datum/asset/spritesheet/chatassets = get_asset_datum(/datum/asset/spritesheet/chat) + var/datum/asset/spritesheet_batched/chatassets = get_asset_datum(/datum/asset/spritesheet_batched/chat) GLOB.text_tag_cache[tagname] = chatassets.icon_tag(tagname) if(!C.tgui_panel.is_ready() || C.tgui_panel.oldchat) return "[tagdesc]" @@ -624,5 +624,5 @@ GLOBAL_LIST_EMPTY(text_tag_cache) /// Removes all non-alphanumerics from the text, keep in mind this can lead to id conflicts /proc/sanitize_css_class_name(name) - var/static/regex/regex = new(@"[^a-zA-Z0-9]","g") - return replacetext(name, regex, "") + var/static/regex/regex = new(@"[^a-zA-Z0-9]","g") + return replacetext(name, regex, "") diff --git a/code/_helpers/unsorted.dm b/code/_helpers/unsorted.dm index 05bfc9a444..9fd1e731d7 100644 --- a/code/_helpers/unsorted.dm +++ b/code/_helpers/unsorted.dm @@ -802,7 +802,7 @@ Turf and target are seperate in case you want to teleport some distance from a t //Move the mobs unless it's an AI eye or other eye type. for(var/mob/M in T) - if(istype(M, /mob/observer/eye)) continue // If we need to check for more mobs, I'll add a variable + if(isEye(M)) continue // If we need to check for more mobs, I'll add a variable M.loc = X if(z_level_change) // Same goes for mobs. @@ -945,7 +945,7 @@ Turf and target are seperate in case you want to teleport some distance from a t for(var/mob/M in T) - if(!istype(M,/mob) || istype(M, /mob/observer/eye)) continue // If we need to check for more mobs, I'll add a variable + if(!ismob(M) || isEye(M)) continue // If we need to check for more mobs, I'll add a variable mobs += M for(var/mob/M in mobs) @@ -1248,8 +1248,8 @@ var/mob/dview/dview_mob = new color = origin.color set_light(origin.light_range, origin.light_power, origin.light_color) -/mob/dview/New() - ..() +/mob/dview/Initialize() + . = ..() // We don't want to be in any mob lists; we're a dummy not a mob. mob_list -= src if(stat == DEAD) diff --git a/code/_onclick/hud/alien_larva.dm b/code/_onclick/hud/alien_larva.dm index 123a13819b..e53a1cbd32 100644 --- a/code/_onclick/hud/alien_larva.dm +++ b/code/_onclick/hud/alien_larva.dm @@ -12,7 +12,7 @@ using.name = "mov_intent" using.set_dir(SOUTHWEST) using.icon = HUD.ui_style - using.icon_state = (m_intent == "run" ? "running" : "walking") + using.icon_state = (m_intent == I_RUN ? "running" : "walking") using.screen_loc = ui_acti using.layer = HUD_LAYER HUD.adding += using diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index 518c3e03c5..2d70678ae0 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -361,15 +361,51 @@ var/list/global_huds = list( if(!client) return 0 - HUD.ui_style = ui_style2icon(client?.prefs?.UI_style) - HUD.ui_color = client?.prefs?.UI_style_color - HUD.ui_alpha = client?.prefs?.UI_style_alpha + HUD.ui_style = ui_style2icon(read_preference(/datum/preference/choiced/ui_style)) + HUD.ui_color = read_preference(/datum/preference/color/ui_style_color) + HUD.ui_alpha = read_preference(/datum/preference/numeric/ui_style_alpha) set_hud_used(HUD) /mob/proc/set_hud_used(datum/hud/new_hud) hud_used = new_hud new_hud.build_action_groups() +/mob/proc/update_ui_style(UI_style_new, UI_style_alpha_new, UI_style_color_new) + if(!hud_used) + return + + if(!UI_style_alpha_new) + UI_style_alpha_new = hud_used.ui_alpha + hud_used.ui_alpha = UI_style_alpha_new + if(!UI_style_color_new) + UI_style_color_new = hud_used.ui_color + hud_used.ui_color = UI_style_color_new + + var/list/icons = hud_used.adding + hud_used.other + hud_used.hotkeybuttons + icons.Add(zone_sel) + icons.Add(gun_setting_icon) + icons.Add(item_use_icon) + icons.Add(gun_move_icon) + icons.Add(radio_use_icon) + + var/icon/ic + + if(UI_style_new) + if(isrobot(src)) + ic = all_ui_styles_robot[UI_style_new] + else + ic = all_ui_styles[UI_style_new] + hud_used.ui_style = ic + else + ic = hud_used.ui_style + + for(var/obj/screen/I in icons) + if(I.name in list(I_HELP, I_HURT, I_DISARM, I_GRAB)) + continue + I.icon = ic + I.color = UI_style_color_new + I.alpha = UI_style_alpha_new + /datum/hud/proc/apply_minihud(var/datum/mini_hud/MH) if(MH in minihuds) return diff --git a/code/_onclick/hud/human.dm b/code/_onclick/hud/human.dm index dec8ee9178..88b16d6622 100644 --- a/code/_onclick/hud/human.dm +++ b/code/_onclick/hud/human.dm @@ -132,7 +132,7 @@ using = new /obj/screen() using.name = "mov_intent" using.icon = HUD.ui_style - using.icon_state = (m_intent == "run" ? "running" : "walking") + using.icon_state = (m_intent == I_RUN ? "running" : "walking") using.screen_loc = ui_movi using.color = HUD.ui_color using.alpha = HUD.ui_alpha diff --git a/code/_onclick/hud/popups_vr.dm b/code/_onclick/hud/popups_vr.dm index 20dc1963da..260ea2b87b 100644 --- a/code/_onclick/hud/popups_vr.dm +++ b/code/_onclick/hud/popups_vr.dm @@ -66,6 +66,6 @@ close_button_y_start = 86 close_button_y_end = 94 -/obj/screen/popup/default/New() - ..() - icon_state = "popup[rand(1,10)]" \ No newline at end of file +/obj/screen/popup/default/Initialize(mapload) + icon_state = "popup[rand(1,10)]" + . = ..() diff --git a/code/_onclick/hud/robot.dm b/code/_onclick/hud/robot.dm index 4b062a6b5f..2aa272bce5 100644 --- a/code/_onclick/hud/robot.dm +++ b/code/_onclick/hud/robot.dm @@ -85,7 +85,7 @@ var/obj/screen/robot_inventory using = new /obj/screen() using.name = "mov_intent" using.icon = HUD.ui_style - using.icon_state = (m_intent == "run" ? "running" : "walking") + using.icon_state = (m_intent == I_RUN ? "running" : "walking") using.screen_loc = ui_movi using.color = HUD.ui_color using.alpha = HUD.ui_alpha @@ -230,7 +230,7 @@ var/obj/screen/robot_inventory else if(speed == -1) using.icon_state = "speed_2" HUD.control_vtec = using - m_intent = "run" + m_intent = I_RUN HUD.move_intent.icon_state = "running" client.screen += HUD.control_vtec @@ -254,7 +254,7 @@ var/obj/screen/robot_inventory control_vtec.icon_state = "speed_1" else if(R.speed == -1) control_vtec.icon_state = "speed_2" - R.m_intent = "run" + R.m_intent = I_RUN R.hud_used.move_intent.icon_state = "running" R.client?.screen += control_vtec else diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index 4d221c9c4f..63b1d4c09d 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -291,36 +291,36 @@ var/mob/living/carbon/C = usr if(C.legcuffed) to_chat(C, span_notice("You are legcuffed! You cannot run until you get [C.legcuffed] removed!")) - C.m_intent = "walk" //Just incase + C.m_intent = I_WALK //Just incase C.hud_used.move_intent.icon_state = "walking" return 1 var/mob/living/L = usr switch(L.m_intent) - if("run") - L.m_intent = "walk" + if(I_RUN) + L.m_intent = I_WALK L.hud_used.move_intent.icon_state = "walking" - if("walk") - L.m_intent = "run" + if(I_WALK) + L.m_intent = I_RUN L.hud_used.move_intent.icon_state = "running" if("m_intent") if(!usr.m_int) switch(usr.m_intent) - if("run") + if(I_RUN) usr.m_int = "13,14" - if("walk") + if(I_WALK) usr.m_int = "14,14" if("face") usr.m_int = "15,14" else usr.m_int = null - if("walk") - usr.m_intent = "walk" + if(I_WALK) + usr.m_intent = I_WALK usr.m_int = "14,14" if("face") usr.m_intent = "face" usr.m_int = "15,14" - if("run") - usr.m_intent = "run" + if(I_RUN) + usr.m_intent = I_RUN usr.m_int = "13,14" if("Reset Machine") usr.unset_machine() @@ -390,7 +390,7 @@ contents.Add(0) // No races breath this, but never know about downstream servers. - if ("carbon dioxide") + if (GAS_CO2) if(t.air_contents.gas[GAS_CO2] && !t.air_contents.gas[GAS_PHORON]) contents.Add(t.air_contents.gas[GAS_CO2]) else @@ -532,15 +532,15 @@ to_chat(R, "You haven't selected a module yet.") if("module1") - if(istype(usr, /mob/living/silicon/robot)) + if(isrobot(usr)) usr:toggle_module(1) if("module2") - if(istype(usr, /mob/living/silicon/robot)) + if(isrobot(usr)) usr:toggle_module(2) if("module3") - if(istype(usr, /mob/living/silicon/robot)) + if(isrobot(usr)) usr:toggle_module(3) if("AI Core") @@ -776,6 +776,7 @@ var/obj/screen/mapper/extras_holder/extras_holder /obj/screen/movable/mapper_holder/Initialize(mapload, newowner) + . = ..() owner = newowner mask_full = new(src) // Full white square mask diff --git a/code/controllers/autotransfer.dm b/code/controllers/autotransfer.dm index 4a76dccf63..223ecfc582 100644 --- a/code/controllers/autotransfer.dm +++ b/code/controllers/autotransfer.dm @@ -13,6 +13,7 @@ var/datum/controller/transfer_controller/transfer_controller /datum/controller/transfer_controller/Destroy() STOP_PROCESSING(SSprocessing, src) + ..() /datum/controller/transfer_controller/process() currenttick = currenttick + 1 diff --git a/code/controllers/emergency_shuttle_controller.dm b/code/controllers/emergency_shuttle_controller.dm index 039e81e4a8..2e960a191d 100644 --- a/code/controllers/emergency_shuttle_controller.dm +++ b/code/controllers/emergency_shuttle_controller.dm @@ -251,8 +251,8 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle = new layer = TURF_LAYER plane = TURF_PLANE -/obj/effect/bgstar/New() - ..() +/obj/effect/bgstar/Initialize() + . = ..() pixel_x += rand(-2,30) pixel_y += rand(-2,30) var/starnum = pick("1", "1", "1", "2", "3", "4") diff --git a/code/controllers/master.dm b/code/controllers/master.dm index 2e5f80c3d5..ec7f0a61e4 100644 --- a/code/controllers/master.dm +++ b/code/controllers/master.dm @@ -19,44 +19,66 @@ GLOBAL_REAL(Master, /datum/controller/master) = new /// Stack end detector to detect stack overflows that kill the mc's main loop var/datum/stack_end_detector/stack_end_detector - // world.time of last fire, for tracking lag outside of the mc + /// world.time of last fire, for tracking lag outside of the mc var/last_run - // List of subsystems to process(). + /// List of subsystems to process(). var/list/subsystems // Vars for keeping track of tick drift. var/init_timeofday var/init_time var/tickdrift = 0 + /// Tickdrift as of last tick, w no averaging going on + var/olddrift = 0 + /// How long is the MC sleeping between runs, read only (set by Loop() based off of anti-tick-contention heuristics) var/sleep_delta = 1 - var/make_runtime = 0 + /// Only run ticker subsystems for the next n ticks. + var/skip_ticks = 0 + + /// makes the mc main loop runtime + var/make_runtime = FALSE var/initializations_finished_with_no_players_logged_in //I wonder what this could be? // The type of the last subsystem to be process()'d. var/last_type_processed - var/datum/controller/subsystem/queue_head //Start of queue linked list - var/datum/controller/subsystem/queue_tail //End of queue linked list (used for appending to the list) + var/datum/controller/subsystem/queue_head //!Start of queue linked list + var/datum/controller/subsystem/queue_tail //!End of queue linked list (used for appending to the list) var/queue_priority_count = 0 //Running total so that we don't have to loop thru the queue each run to split up the tick var/queue_priority_count_bg = 0 //Same, but for background subsystems - var/map_loading = FALSE //Are we loading in a new map? + var/map_loading = FALSE //!Are we loading in a new map? - var/current_runlevel //for scheduling different subsystems for different stages of the round + var/current_runlevel //!for scheduling different subsystems for different stages of the round + + /// During initialization, will be the instanced subsytem that is currently initializing. + /// Outside of initialization, returns null. + var/current_initializing_subsystem = null var/static/restart_clear = 0 var/static/restart_timeout = 0 var/static/restart_count = 0 - //current tick limit, assigned by the queue controller before running a subsystem. - //used by check_tick as well so that the procs subsystems call can obey that SS's tick limits + var/static/random_seed + + ///current tick limit, assigned before running a subsystem. + ///used by CHECK_TICK as well so that the procs subsystems call can obey that SS's tick limits var/static/current_ticklimit /datum/controller/master/New() // Highlander-style: there can only be one! Kill off the old and replace it with the new. + + if(!random_seed) + #ifdef UNIT_TESTS + random_seed = 29051994 // How about 22475? + #else + random_seed = rand(1, 1e9) + #endif + rand_seed(random_seed) + var/list/_subsystems = list() subsystems = _subsystems if (Master != src) @@ -84,6 +106,8 @@ GLOBAL_REAL(Master, /datum/controller/master) = new reverseRange(subsystems) for(var/datum/controller/subsystem/ss in subsystems) log_world("Shutting down [ss.name] subsystem...") + if (ss.slept_count > 0) + log_world("Warning: Subsystem `[ss.name]` slept [ss.slept_count] times.") ss.Shutdown() log_world("Shutdown complete") @@ -178,8 +202,9 @@ GLOBAL_REAL(Master, /datum/controller/master) = new for (var/datum/controller/subsystem/SS in subsystems) if (SS.flags & SS_NO_INIT) continue - SS.Initialize(REALTIMEOFDAY) + init_subsystem(SS) CHECK_TICK + current_initializing_subsystem = null current_ticklimit = TICK_LIMIT_RUNNING var/time = (REALTIMEOFDAY - start_timeofday) / 10 @@ -188,7 +213,8 @@ GLOBAL_REAL(Master, /datum/controller/master) = new log_world(msg) - send2chat("Server Initialization completed! - Took [time] second[time == 1 ? "" : "s"].", "bot announce") + // FIXME: TGS <-> Discord communication; sending message to a TGS chat channel + // send2chat("Server Initialization completed! - Took [time] second[time == 1 ? "" : "s"].", "bot announce") if (!current_runlevel) SetRunLevel(RUNLEVEL_LOBBY) @@ -210,6 +236,80 @@ GLOBAL_REAL(Master, /datum/controller/master) = new // Loop. Master.StartProcessing(0) +/** + * Initialize a given subsystem and handle the results. + * + * Arguments: + * * subsystem - the subsystem to initialize. + */ +/datum/controller/master/proc/init_subsystem(datum/controller/subsystem/subsystem) + var/static/list/valid_results = list( + SS_INIT_FAILURE, + SS_INIT_NONE, + SS_INIT_SUCCESS, + SS_INIT_NO_NEED, + ) + + if (subsystem.flags & SS_NO_INIT || subsystem.subsystem_initialized) //Don't init SSs with the corresponding flag or if they already are initialized + return + + current_initializing_subsystem = subsystem + rustg_time_reset(SS_INIT_TIMER_KEY) + + var/result = subsystem.Initialize() + + // Capture end time + var/time = rustg_time_milliseconds(SS_INIT_TIMER_KEY) + var/seconds = round(time / 1000, 0.01) + + // Always update the blackbox tally regardless. + // SSblackbox.record_feedback("tally", "subsystem_initialize", time, subsystem.name) + feedback_set_details("subsystem_initialize", "[time] [subsystem.name]") + + // Gave invalid return value. + if(result && !(result in valid_results)) + warning("[subsystem.name] subsystem initialized, returning invalid result [result]. This is a bug.") + + // just returned ..() or didn't implement Initialize() at all + if(result == SS_INIT_NONE) + warning("[subsystem.name] subsystem does not implement Initialize() or it returns ..(). If the former is true, the SS_NO_INIT flag should be set for this subsystem.") + + if(result != SS_INIT_FAILURE) + // Some form of success, implicit failure, or the SS in unused. + subsystem.subsystem_initialized = TRUE + + SEND_SIGNAL(subsystem, COMSIG_SUBSYSTEM_POST_INITIALIZE) + else + // The subsystem officially reports that it failed to init and wishes to be treated as such. + subsystem.subsystem_initialized = FALSE + subsystem.can_fire = FALSE + + // The rest of this proc is printing the world log and chat message. + var/message_prefix + + // If true, print the chat message with boldwarning text. + var/chat_warning = FALSE + + switch(result) + if(SS_INIT_FAILURE) + message_prefix = "Failed to initialize [subsystem.name] subsystem after" + chat_warning = TRUE + if(SS_INIT_SUCCESS) + message_prefix = "Initialized [subsystem.name] subsystem within" + if(SS_INIT_NO_NEED) + // This SS is disabled or is otherwise shy. + return + else + // SS_INIT_NONE or an invalid value. + message_prefix = "Initialized [subsystem.name] subsystem with errors within" + chat_warning = TRUE + + var/message = "[message_prefix] [seconds] second[seconds == 1 ? "" : "s"]!" + var/chat_message = chat_warning ? span_boldwarning(message) : span_boldannounce(message) + + to_chat(world, chat_message) + log_world(message) + /datum/controller/master/proc/SetRunLevel(new_runlevel) var/old_runlevel = isnull(current_runlevel) ? "NULL" : runlevel_flags[current_runlevel] testing("MC: Runlevel changed from [old_runlevel] to [new_runlevel]") diff --git a/code/controllers/subsystem.dm b/code/controllers/subsystem.dm index 3cd8af77fe..3e5e269057 100644 --- a/code/controllers/subsystem.dm +++ b/code/controllers/subsystem.dm @@ -1,36 +1,99 @@ +/** + * # Subsystem base class + * + * Defines a subsystem to be managed by the [Master Controller][/datum/controller/master] + * + * Simply define a child of this subsystem, using the [SUBSYSTEM_DEF] macro, and the MC will handle registration. + * Changing the name is required +**/ + /datum/controller/subsystem // Metadata; you should define these. - name = "fire coderbus" //name of the subsystem - var/init_order = INIT_ORDER_DEFAULT //order of initialization. Higher numbers are initialized first, lower numbers later. Can be decimal and negative values. - var/wait = 20 //time to wait (in deciseconds) between each call to fire(). Must be a positive integer. - var/priority = FIRE_PRIORITY_DEFAULT //When mutiple subsystems need to run in the same tick, higher priority subsystems will run first and be given a higher share of the tick before MC_TICK_CHECK triggers a sleep - var/flags = 0 //see MC.dm in __DEFINES Most flags must be set on world start to take full effect. (You can also restart the mc to force them to process again) - var/subsystem_initialized = FALSE //set to TRUE after it has been initialized, will obviously never be set if the subsystem doesn't initialize - var/runlevels = RUNLEVELS_DEFAULT //points of the game at which the SS can fire + /// Name of the subsystem - you must change this + name = "fire coderbus" - //set to 0 to prevent fire() calls, mostly for admin use or subsystems that may be resumed later - // use the SS_NO_FIRE flag instead for systems that never fire to keep it from even being added to the list + /// Order of initialization. Higher numbers are initialized first, lower numbers later. Use or create defines such as [INIT_ORDER_DEFAULT] so we can see the order in one file. + var/init_order = INIT_ORDER_DEFAULT + + /// Time to wait (in deciseconds) between each call to fire(). Must be a positive integer. + var/wait = 20 + + /// Priority Weight: When mutiple subsystems need to run in the same tick, higher priority subsystems will be given a higher share of the tick before MC_TICK_CHECK triggers a sleep, higher priority subsystems also run before lower priority subsystems. + var/priority = FIRE_PRIORITY_DEFAULT + + /// [Subsystem Flags][SS_NO_INIT] to control binary behavior. Flags must be set at compile time or before preinit finishes to take full effect. (You can also restart the mc to force them to process again) + var/flags = NONE + + /// This var is set to TRUE after the subsystem has been initialized. + var/subsystem_initialized = FALSE + + /// Set to 0 to prevent fire() calls, mostly for admin use or subsystems that may be resumed later + /// use the [SS_NO_FIRE] flag instead for systems that never fire to keep it from even being added to list that is checked every tick var/can_fire = TRUE - // Bookkeeping variables; probably shouldn't mess with these. - var/last_fire = 0 //last world.time we called fire() - var/next_fire = 0 //scheduled world.time for next fire() - var/cost = 0 //average time to execute - var/tick_usage = 0 //average tick usage - var/tick_overrun = 0 //average tick overrun - var/state = SS_IDLE //tracks the current state of the ss, running, paused, etc. - var/paused_ticks = 0 //ticks this ss is taking to run right now. - var/paused_tick_usage //total tick_usage of all of our runs while pausing this run - var/ticks = 1 //how many ticks does this ss take to run on avg. - var/times_fired = 0 //number of times we have called fire() - var/queued_time = 0 //time we entered the queue, (for timing and priority reasons) - var/queued_priority //we keep a running total to make the math easier, if priority changes mid-fire that would break our running total, so we store it here - //linked list stuff for the queue + ///Bitmap of what game states can this subsystem fire at. See [RUNLEVELS_DEFAULT] for more details. + var/runlevels = RUNLEVELS_DEFAULT + + /* + * The following variables are managed by the MC and should not be modified directly. + */ + + /// Last world.time the subsystem completed a run (as in wasn't paused by [MC_TICK_CHECK]) + var/last_fire = 0 + + /// Scheduled world.time for next fire() + var/next_fire = 0 + + /// Running average of the amount of milliseconds it takes the subsystem to complete a run (including all resumes but not the time spent paused) + var/cost = 0 + + /// Running average of the amount of tick usage in percents of a tick it takes the subsystem to complete a run + var/tick_usage = 0 + + /// Running average of the amount of tick usage (in percents of a game tick) the subsystem has spent past its allocated time without pausing + var/tick_overrun = 0 + + /// How much of a tick (in percents of a tick) were we allocated last fire. + var/tick_allocation_last = 0 + + /// How much of a tick (in percents of a tick) do we get allocated by the mc on avg. + var/tick_allocation_avg = 0 + + /// Tracks the current execution state of the subsystem. Used to handle subsystems that sleep in fire so the mc doesn't run them again while they are sleeping + var/state = SS_IDLE + + /// Tracks how many times a subsystem has ever slept in fire(). + var/slept_count = 0 + + /// Tracks how many fires the subsystem has consecutively paused on in the current run + var/paused_ticks = 0 + + /// Tracks how much of a tick the subsystem has consumed in the current run + var/paused_tick_usage + + /// Tracks how many fires the subsystem takes to complete a run on average. + var/ticks = 1 + + /// Tracks the amount of completed runs for the subsystem + var/times_fired = 0 + + /// Time the subsystem entered the queue, (for timing and priority reasons) + var/queued_time = 0 + + /// Priority at the time the subsystem entered the queue. Needed to avoid changes in priority (by admins and the like) from breaking things. + var/queued_priority + + /// How many times we suspect a subsystem type has crashed the MC, 3 strikes and you're out! + var/static/list/failure_strikes + + /// Next subsystem in the queue of subsystems to run this tick var/datum/controller/subsystem/queue_next + /// Previous subsystem in the queue of subsystems to run this tick var/datum/controller/subsystem/queue_prev - var/static/list/failure_strikes //How many times we suspect a subsystem type has crashed the MC, 3 strikes and you're out! + //Do not blindly add vars here to the bottom, put it where it goes above + //If your var only has two values, put it in as a flag. //Do not override ///datum/controller/subsystem/New() @@ -41,24 +104,32 @@ /datum/controller/subsystem/proc/PreInit() return -//This is used so the mc knows when the subsystem sleeps. do not override. -/datum/controller/subsystem/proc/ignite(resumed = 0) +///This is used so the mc knows when the subsystem sleeps. do not override. +/datum/controller/subsystem/proc/ignite(resumed = FALSE) + SHOULD_NOT_OVERRIDE(TRUE) set waitfor = 0 + . = SS_IDLE + + tick_allocation_last = Master.current_ticklimit-(TICK_USAGE) + tick_allocation_avg = MC_AVERAGE(tick_allocation_avg, tick_allocation_last) + . = SS_SLEEPING fire(resumed) . = state if (state == SS_SLEEPING) + slept_count++ state = SS_IDLE if (state == SS_PAUSING) + slept_count++ var/QT = queued_time enqueue() state = SS_PAUSED queued_time = QT -//previously, this would have been named 'process()' but that name is used everywhere for different things! -//fire() seems more suitable. This is the procedure that gets called every 'wait' deciseconds. -//Sleeping in here prevents future fires until returned. -/datum/controller/subsystem/proc/fire(resumed = 0) +///previously, this would have been named 'process()' but that name is used everywhere for different things! +///fire() seems more suitable. This is the procedure that gets called every 'wait' deciseconds. +///Sleeping in here prevents future fires until returned. +/datum/controller/subsystem/proc/fire(resumed = FALSE) flags |= SS_NO_FIRE throw EXCEPTION("Subsystem [src]([type]) does not fire() but did not set the SS_NO_FIRE flag. Please add the SS_NO_FIRE flag to any subsystem that doesn't fire so it doesn't get added to the processing list and waste cpu.") @@ -66,12 +137,13 @@ dequeue() can_fire = 0 flags |= SS_NO_FIRE - Master.subsystems -= src + if (Master) + Master.subsystems -= src return ..() -//Queue it to run. -// (we loop thru a linked list until we get to the end or find the right point) -// (this lets us sort our run order correctly without having to re-sort the entire already sorted list) +///Queue it to run. +/// (we loop thru a linked list until we get to the end or find the right point) +/// (this lets us sort our run order correctly without having to re-sort the entire already sorted list) /datum/controller/subsystem/proc/enqueue() var/SS_priority = priority var/SS_flags = flags @@ -155,14 +227,11 @@ /// Called after the config has been loaded or reloaded. /datum/controller/subsystem/proc/OnConfigLoad() -//used to initialize the subsystem AFTER the map has loaded -/datum/controller/subsystem/Initialize(start_timeofday) - subsystem_initialized = TRUE - var/time = (REALTIMEOFDAY - start_timeofday) / 10 - var/msg = "Initialized [name] subsystem within [time] second[time == 1 ? "" : "s"]!" - to_chat(world, span_boldannounce("[msg]")) - log_world(msg) - return time +/** + * Used to initialize the subsystem. This is expected to be overriden by subtypes. + */ +/datum/controller/subsystem/Initialize() + return SS_INIT_NONE //hook for printing stats to the "MC" statuspanel for admins to see performance and related stats etc. /datum/controller/subsystem/stat_entry(msg) @@ -221,3 +290,9 @@ var/msg = "[name] subsystem received final blame for MC failure" log_world(msg) log_game(msg) + +/datum/controller/subsystem/vv_edit_var(var_name, var_value) + switch (var_name) + if (NAMEOF(src, queued_priority)) //editing this breaks things. + return FALSE + . = ..() diff --git a/code/controllers/subsystems/air.dm b/code/controllers/subsystems/air.dm index c4b64ba450..880d829fe9 100644 --- a/code/controllers/subsystems/air.dm +++ b/code/controllers/subsystems/air.dm @@ -106,7 +106,8 @@ SUBSYSTEM_DEF(air) var/current_cycle = 0 var/next_id = 1 //Used to keep track of zone UIDs. -/datum/controller/subsystem/air/Initialize(timeofday) +/datum/controller/subsystem/air/Initialize() + var/start_timeofday = REALTIMEOFDAY report_progress("Processing Geometry...") current_cycle = 0 @@ -116,7 +117,7 @@ SUBSYSTEM_DEF(air) S.update_air_properties() CHECK_TICK - admin_notice(span_danger("Geometry initialized in [round(0.1*(REALTIMEOFDAY-timeofday),0.1)] seconds.") + \ + admin_notice(span_danger("Geometry initialized in [round(0.1*(REALTIMEOFDAY-start_timeofday),0.1)] seconds.") + \ span_info("
\ Total Simulated Turfs: [simulated_turf_count]
\ Total Zones: [zones.len]
\ @@ -171,7 +172,7 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun log_debug("Active Edges on ZAS Startup\n" + edge_log.Join("\n")) startup_active_edge_log = edge_log.Copy() - ..() + return SS_INIT_SUCCESS /datum/controller/subsystem/air/fire(resumed = 0) var/timer diff --git a/code/controllers/subsystems/alarm.dm b/code/controllers/subsystems/alarm.dm index e3507a34e4..25a28ca59e 100644 --- a/code/controllers/subsystems/alarm.dm +++ b/code/controllers/subsystems/alarm.dm @@ -18,7 +18,7 @@ SUBSYSTEM_DEF(alarm) /datum/controller/subsystem/alarm/Initialize() all_handlers = list(atmosphere_alarm, camera_alarm, fire_alarm, motion_alarm, power_alarm) - . = ..() + return SS_INIT_SUCCESS /datum/controller/subsystem/alarm/fire(resumed = FALSE) if(!resumed) diff --git a/code/controllers/subsystems/atoms.dm b/code/controllers/subsystems/atoms.dm index 5968fe1fe3..81e4d217a5 100644 --- a/code/controllers/subsystems/atoms.dm +++ b/code/controllers/subsystems/atoms.dm @@ -17,13 +17,13 @@ SUBSYSTEM_DEF(atoms) var/list/BadInitializeCalls = list() -/datum/controller/subsystem/atoms/Initialize(timeofday) +/datum/controller/subsystem/atoms/Initialize() setupgenetics() //to set the mutations' place in structural enzymes, so initializers know where to put mutations. initialized = INITIALIZATION_INNEW_MAPLOAD to_world_log("Initializing objects") admin_notice(span_danger("Initializing objects"), R_DEBUG) InitializeAtoms() - return ..() + return SS_INIT_SUCCESS /datum/controller/subsystem/atoms/proc/InitializeAtoms(list/atoms) if(initialized == INITIALIZATION_INSSATOMS) diff --git a/code/controllers/subsystems/character_setup.dm b/code/controllers/subsystems/character_setup.dm index fdad93fbbb..272cd0b8ab 100644 --- a/code/controllers/subsystems/character_setup.dm +++ b/code/controllers/subsystems/character_setup.dm @@ -2,7 +2,7 @@ SUBSYSTEM_DEF(character_setup) name = "Character Setup" init_order = INIT_ORDER_DEFAULT priority = FIRE_PRIORITY_CHARSETUP - flags = SS_BACKGROUND + flags = SS_BACKGROUND | SS_NO_INIT wait = 1 SECOND runlevels = RUNLEVEL_LOBBY | RUNLEVELS_DEFAULT diff --git a/code/controllers/subsystems/chemistry.dm b/code/controllers/subsystems/chemistry.dm index e31b71dc00..f31441e34c 100644 --- a/code/controllers/subsystems/chemistry.dm +++ b/code/controllers/subsystems/chemistry.dm @@ -18,7 +18,7 @@ SUBSYSTEM_DEF(chemistry) /datum/controller/subsystem/chemistry/Initialize() initialize_chemical_reagents() initialize_chemical_reactions() - ..() + return SS_INIT_SUCCESS /datum/controller/subsystem/chemistry/stat_entry(msg) msg = "C: [chemical_reagents.len] | R: [chemical_reactions.len]" diff --git a/code/controllers/subsystems/circuits.dm b/code/controllers/subsystems/circuits.dm index ca080a3d81..2e555b293d 100644 --- a/code/controllers/subsystems/circuits.dm +++ b/code/controllers/subsystems/circuits.dm @@ -17,9 +17,9 @@ SUBSYSTEM_DEF(circuit) /datum/controller/subsystem/circuit/Recover() flags |= SS_NO_INIT // Make extra sure we don't initialize twice. -/datum/controller/subsystem/circuit/Initialize(timeofday) +/datum/controller/subsystem/circuit/Initialize() circuits_init() - return ..() + return SS_INIT_SUCCESS /datum/controller/subsystem/circuit/proc/circuits_init() //Cached lists for free performance diff --git a/code/controllers/subsystems/events.dm b/code/controllers/subsystems/events.dm index 5bdf83fdec..2e91ad3b15 100644 --- a/code/controllers/subsystems/events.dm +++ b/code/controllers/subsystems/events.dm @@ -21,7 +21,7 @@ SUBSYSTEM_DEF(events) ) if(global.using_map.use_overmap) GLOB.overmap_event_handler.create_events(global.using_map.overmap_z, global.using_map.overmap_size, global.using_map.overmap_event_areas) - return ..() + return SS_INIT_SUCCESS /datum/controller/subsystem/events/fire(resumed) if (!resumed) diff --git a/code/controllers/subsystems/game_master.dm b/code/controllers/subsystems/game_master.dm index 11844b4f98..064c4307e6 100644 --- a/code/controllers/subsystems/game_master.dm +++ b/code/controllers/subsystems/game_master.dm @@ -36,7 +36,7 @@ SUBSYSTEM_DEF(game_master) if(config && !config.enable_game_master) can_fire = FALSE - return ..() + return SS_INIT_SUCCESS /datum/controller/subsystem/game_master/fire(resumed) adjust_staleness(1) diff --git a/code/controllers/subsystems/holomaps.dm b/code/controllers/subsystems/holomaps.dm index 5fcca27480..9275172973 100644 --- a/code/controllers/subsystems/holomaps.dm +++ b/code/controllers/subsystems/holomaps.dm @@ -14,9 +14,9 @@ SUBSYSTEM_DEF(holomaps) /datum/controller/subsystem/holomaps/Recover() flags |= SS_NO_INIT // Make extra sure we don't initialize twice. -/datum/controller/subsystem/holomaps/Initialize(timeofday) +/datum/controller/subsystem/holomaps/Initialize() generateHoloMinimaps() - . = ..() + return SS_INIT_SUCCESS /datum/controller/subsystem/holomaps/stat_entry(msg) if (!Debug2) diff --git a/code/controllers/subsystems/input.dm b/code/controllers/subsystems/input.dm index 62fe0184ff..70d1f9cda6 100644 --- a/code/controllers/subsystems/input.dm +++ b/code/controllers/subsystems/input.dm @@ -2,7 +2,7 @@ SUBSYSTEM_DEF(input) name = "Input" wait = 1 // SS_TICKER means this runs every tick init_order = INIT_ORDER_INPUT - flags = SS_TICKER + flags = SS_TICKER | SS_NO_INIT priority = FIRE_PRIORITY_INPUT runlevels = RUNLEVELS_DEFAULT | RUNLEVEL_LOBBY diff --git a/code/controllers/subsystems/job.dm b/code/controllers/subsystems/job.dm index d2f7e72bc9..c86d108415 100644 --- a/code/controllers/subsystems/job.dm +++ b/code/controllers/subsystems/job.dm @@ -11,12 +11,12 @@ SUBSYSTEM_DEF(job) var/debug_messages = FALSE -/datum/controller/subsystem/job/Initialize(timeofday) +/datum/controller/subsystem/job/Initialize() if(!department_datums.len) setup_departments() if(!occupations.len) setup_occupations() - return ..() + return SS_INIT_SUCCESS /datum/controller/subsystem/job/proc/setup_occupations(faction = FACTION_STATION) occupations = list() diff --git a/code/controllers/subsystems/lighting.dm b/code/controllers/subsystems/lighting.dm index d9643c15ba..9bc179c278 100644 --- a/code/controllers/subsystems/lighting.dm +++ b/code/controllers/subsystems/lighting.dm @@ -12,7 +12,7 @@ SUBSYSTEM_DEF(lighting) return ..() -/datum/controller/subsystem/lighting/Initialize(timeofday) +/datum/controller/subsystem/lighting/Initialize() if(!subsystem_initialized) if (CONFIG_GET(flag/starlight)) for(var/area/A in world) @@ -24,7 +24,7 @@ SUBSYSTEM_DEF(lighting) fire(FALSE, TRUE) - return ..() + return SS_INIT_SUCCESS /datum/controller/subsystem/lighting/fire(resumed, init_tick_checks) MC_SPLIT_TICK_INIT(3) diff --git a/code/controllers/subsystems/machines.dm b/code/controllers/subsystems/machines.dm index dea5b7ccc3..70f913be52 100644 --- a/code/controllers/subsystems/machines.dm +++ b/code/controllers/subsystems/machines.dm @@ -30,12 +30,12 @@ SUBSYSTEM_DEF(machines) var/list/powernets = list() var/list/powerobjs = list() -/datum/controller/subsystem/machines/Initialize(timeofday) +/datum/controller/subsystem/machines/Initialize() makepowernets() admin_notice(span_danger("Initializing atmos machinery."), R_DEBUG) setup_atmos_machinery(all_machines) fire() - ..() + return SS_INIT_SUCCESS /datum/controller/subsystem/machines/fire(resumed = 0) var/timer = TICK_USAGE diff --git a/code/controllers/subsystems/mapping.dm b/code/controllers/subsystems/mapping.dm index 42e1de651c..4b0beb2485 100644 --- a/code/controllers/subsystems/mapping.dm +++ b/code/controllers/subsystems/mapping.dm @@ -12,7 +12,7 @@ SUBSYSTEM_DEF(mapping) flags |= SS_NO_INIT // Make extra sure we don't initialize twice. shelter_templates = SSmapping.shelter_templates -/datum/controller/subsystem/mapping/Initialize(timeofday) +/datum/controller/subsystem/mapping/Initialize() if(subsystem_initialized) return world.max_z_changed() // This is to set up the player z-level list, maxz hasn't actually changed (probably) @@ -29,7 +29,7 @@ SUBSYSTEM_DEF(mapping) // Lateload Code related to Expedition areas. if(using_map) // VOREStation Edit: Re-enable this. loadLateMaps() - ..() + return SS_INIT_SUCCESS /datum/controller/subsystem/mapping/proc/load_map_templates() for(var/datum/map_template/template as anything in subtypesof(/datum/map_template)) diff --git a/code/controllers/subsystems/media_tracks.dm b/code/controllers/subsystems/media_tracks.dm index 9aa59f95fe..d9b27a3c76 100644 --- a/code/controllers/subsystems/media_tracks.dm +++ b/code/controllers/subsystems/media_tracks.dm @@ -10,10 +10,10 @@ SUBSYSTEM_DEF(media_tracks) /// Lobby music tracks var/list/lobby_tracks = list() -/datum/controller/subsystem/media_tracks/Initialize(timeofday) +/datum/controller/subsystem/media_tracks/Initialize() load_tracks() sort_tracks() - return ..() + return SS_INIT_SUCCESS /datum/controller/subsystem/media_tracks/proc/load_tracks() for(var/filename in CONFIG_GET(str_list/jukebox_track_files)) diff --git a/code/controllers/subsystems/nightshift.dm b/code/controllers/subsystems/nightshift.dm index 4cfddfec0f..882016e081 100644 --- a/code/controllers/subsystems/nightshift.dm +++ b/code/controllers/subsystems/nightshift.dm @@ -17,7 +17,7 @@ SUBSYSTEM_DEF(nightshift) if(config.randomize_shift_time) GLOB.gametime_offset = rand(0, 23) HOURS */ - return ..() + return SS_INIT_SUCCESS /datum/controller/subsystem/nightshift/fire(resumed = FALSE) if(round_duration_in_ds < nightshift_first_check) diff --git a/code/controllers/subsystems/overlays.dm b/code/controllers/subsystems/overlays.dm index 0a953e9782..012b6f10e7 100644 --- a/code/controllers/subsystems/overlays.dm +++ b/code/controllers/subsystems/overlays.dm @@ -28,9 +28,9 @@ SUBSYSTEM_DEF(overlays) CHECK_TICK -/datum/controller/subsystem/overlays/Initialize(timeofday) +/datum/controller/subsystem/overlays/Initialize() fire(FALSE, TRUE) - ..() + return SS_INIT_SUCCESS /datum/controller/subsystem/overlays/stat_entry(msg) msg = "Queued Atoms: [queue.len], Cache Size: [cache_size]" diff --git a/code/controllers/subsystems/overmap_renamer_vr.dm b/code/controllers/subsystems/overmap_renamer_vr.dm index 0180b89355..d82aadbfcb 100644 --- a/code/controllers/subsystems/overmap_renamer_vr.dm +++ b/code/controllers/subsystems/overmap_renamer_vr.dm @@ -10,10 +10,9 @@ SUBSYSTEM_DEF(overmap_renamer) -/datum/controller/subsystem/overmap_renamer/Initialize(timeofday) +/datum/controller/subsystem/overmap_renamer/Initialize() update_names() - - ..() + return SS_INIT_SUCCESS /*Shouldn't be a switch statement. We want ALL of the if(map_template.name in visitable_z_leves_name_list) to fire if we end up with multiple renamable lateload overmap objects.*/ diff --git a/code/controllers/subsystems/persistence.dm b/code/controllers/subsystems/persistence.dm index 1950e90e14..69a92f14e2 100644 --- a/code/controllers/subsystems/persistence.dm +++ b/code/controllers/subsystems/persistence.dm @@ -11,12 +11,12 @@ SUBSYSTEM_DEF(persistence) var/list/unpicked_paintings = list() /datum/controller/subsystem/persistence/Initialize() - . = ..() for(var/datum/persistent/P as anything in subtypesof(/datum/persistent)) if(initial(P.name)) P = new P persistence_datums[P.type] = P P.Initialize() + return SS_INIT_SUCCESS /datum/controller/subsystem/persistence/Shutdown() for(var/thing in persistence_datums) diff --git a/code/controllers/subsystems/planets.dm b/code/controllers/subsystems/planets.dm index 2054d6daa7..fa4cf68068 100644 --- a/code/controllers/subsystems/planets.dm +++ b/code/controllers/subsystems/planets.dm @@ -14,10 +14,10 @@ SUBSYSTEM_DEF(planets) var/static/list/needs_sun_update = list() var/static/list/needs_temp_update = list() -/datum/controller/subsystem/planets/Initialize(timeofday) +/datum/controller/subsystem/planets/Initialize() admin_notice(span_danger("Initializing planetary weather."), R_DEBUG) createPlanets() - ..() + return SS_INIT_SUCCESS /datum/controller/subsystem/planets/proc/createPlanets() var/list/planet_datums = using_map.planet_datums_to_make diff --git a/code/controllers/subsystems/plants.dm b/code/controllers/subsystems/plants.dm index b46cc00172..300f19da7c 100644 --- a/code/controllers/subsystems/plants.dm +++ b/code/controllers/subsystems/plants.dm @@ -26,9 +26,9 @@ SUBSYSTEM_DEF(plants) msg = "P:[processing.len]|S:[seeds.len]" return ..() -/datum/controller/subsystem/plants/Initialize(timeofday) +/datum/controller/subsystem/plants/Initialize() setup() - return ..() + return SS_INIT_SUCCESS // Predefined/roundstart varieties use a string key to make it // easier to grab the new variety when mutating. Post-roundstart diff --git a/code/controllers/subsystems/player_tips.dm b/code/controllers/subsystems/player_tips.dm index 7ac58b52bd..8afa6cc5b5 100644 --- a/code/controllers/subsystems/player_tips.dm +++ b/code/controllers/subsystems/player_tips.dm @@ -1,16 +1,12 @@ -/* -Player tips procs and lists are defined under /code/modules/player_tips_vr -*/ +/// Player tips procs and lists are defined under /code/modules/player_tips_vr SUBSYSTEM_DEF(player_tips) name = "Periodic Player Tips" priority = FIRE_PRIORITY_PLAYERTIPS runlevels = RUNLEVEL_GAME - wait = 3000 //We check if it's time to send a tip every 5 minutes (300 seconds) + flags = SS_NO_INIT + var/static/datum/player_tips/player_tips = new - - - /datum/controller/subsystem/player_tips/fire() player_tips.send_tips() diff --git a/code/controllers/subsystems/processing/fastprocess.dm b/code/controllers/subsystems/processing/fastprocess.dm index bda0bb6fb6..407477f9b0 100644 --- a/code/controllers/subsystems/processing/fastprocess.dm +++ b/code/controllers/subsystems/processing/fastprocess.dm @@ -4,6 +4,7 @@ PROCESSING_SUBSYSTEM_DEF(fastprocess) name = "Fast Processing" wait = 2 stat_tag = "FP" + flags = SS_NO_INIT /datum/controller/subsystem/processing/fastprocess/Recover() log_debug("[name] subsystem Recover().") @@ -12,4 +13,4 @@ PROCESSING_SUBSYSTEM_DEF(fastprocess) var/list/old_processing = SSfastprocess.processing.Copy() for(var/datum/D in old_processing) if(CHECK_BITFIELD(D.datum_flags, DF_ISPROCESSING)) - processing |= D \ No newline at end of file + processing |= D diff --git a/code/controllers/subsystems/processing/instruments.dm b/code/controllers/subsystems/processing/instruments.dm index 72770ea39b..e3a4802f11 100644 --- a/code/controllers/subsystems/processing/instruments.dm +++ b/code/controllers/subsystems/processing/instruments.dm @@ -24,7 +24,7 @@ PROCESSING_SUBSYSTEM_DEF(instruments) /datum/controller/subsystem/processing/instruments/Initialize() initialize_instrument_data() synthesizer_instrument_ids = get_allowed_instrument_ids() - return ..() + return SS_INIT_SUCCESS /datum/controller/subsystem/processing/instruments/proc/on_song_new(datum/song/S) songs += S diff --git a/code/controllers/subsystems/processing/turfs.dm b/code/controllers/subsystems/processing/turfs.dm index d28f4b4809..509ec4f17b 100644 --- a/code/controllers/subsystems/processing/turfs.dm +++ b/code/controllers/subsystems/processing/turfs.dm @@ -1,6 +1,7 @@ PROCESSING_SUBSYSTEM_DEF(turfs) name = "Turf Processing" wait = 20 + flags = SS_NO_INIT /datum/controller/subsystem/processing/turfs/Recover() log_debug("[name] subsystem Recover().") @@ -11,4 +12,4 @@ PROCESSING_SUBSYSTEM_DEF(turfs) if(!isturf(D)) log_debug("[name] subsystem Recover() found inappropriate item in list: [D.type]") if(CHECK_BITFIELD(D.datum_flags, DF_ISPROCESSING)) - processing |= D \ No newline at end of file + processing |= D diff --git a/code/controllers/subsystems/robot_sprites.dm b/code/controllers/subsystems/robot_sprites.dm index 88fa331451..d6d38ab50f 100644 --- a/code/controllers/subsystems/robot_sprites.dm +++ b/code/controllers/subsystems/robot_sprites.dm @@ -8,7 +8,7 @@ SUBSYSTEM_DEF(robot_sprites) /datum/controller/subsystem/robot_sprites/Initialize() initialize_borg_sprites() - ..() + return SS_INIT_SUCCESS /datum/controller/subsystem/robot_sprites/proc/initialize_borg_sprites() diff --git a/code/controllers/subsystems/server_maint.dm b/code/controllers/subsystems/server_maint.dm index e8d10d6748..20cd2760db 100644 --- a/code/controllers/subsystems/server_maint.dm +++ b/code/controllers/subsystems/server_maint.dm @@ -18,7 +18,7 @@ SUBSYSTEM_DEF(server_maint) /*/datum/controller/subsystem/server_maint/PreInit() world.hub_password = "" *///quickly! before the hubbies see us. -/datum/controller/subsystem/server_maint/New() +/datum/controller/subsystem/server_maint/Initialize() if (fexists("tmp/")) fdel("tmp/") //if (CONFIG_GET(flag/hub)) diff --git a/code/controllers/subsystems/shuttles.dm b/code/controllers/subsystems/shuttles.dm index 02f9cb91eb..ebd4cdcc5c 100644 --- a/code/controllers/subsystems/shuttles.dm +++ b/code/controllers/subsystems/shuttles.dm @@ -32,7 +32,7 @@ SUBSYSTEM_DEF(shuttles) var/tmp/list/current_run // Shuttles remaining to process this fire() tick -/datum/controller/subsystem/shuttles/Initialize(timeofday) +/datum/controller/subsystem/shuttles/Initialize() last_landmark_registration_time = world.time // Find all declared shuttle datums and initailize them. (Okay, queue them for initialization a few lines further down) for(var/shuttle_type in subtypesof(/datum/shuttle)) // This accounts for most shuttles, though away maps can queue up more. @@ -43,7 +43,7 @@ SUBSYSTEM_DEF(shuttles) LAZYDISTINCTADD(shuttles_to_initialize, shuttle_type) block_init_queue = FALSE process_init_queues() - return ..() + return SS_INIT_SUCCESS /datum/controller/subsystem/shuttles/fire(resumed = 0) if (!resumed) diff --git a/code/controllers/subsystems/skybox.dm b/code/controllers/subsystems/skybox.dm index 52065ad241..a1f6dcf11a 100644 --- a/code/controllers/subsystems/skybox.dm +++ b/code/controllers/subsystems/skybox.dm @@ -28,7 +28,7 @@ SUBSYSTEM_DEF(skybox) normal_space.layer = TURF_LAYER normal_space.icon = 'icons/turf/space.dmi' normal_space.icon_state = "white" - + //Static for (var/i in 0 to 25) var/mutable_appearance/MA = new(normal_space) @@ -36,12 +36,12 @@ SUBSYSTEM_DEF(skybox) im.plane = DUST_PLANE im.alpha = 128 //80 im.blend_mode = BLEND_ADD - + MA.cut_overlays() MA.add_overlay(im) dust_cache["[i]"] = MA - + //Moving for (var/i in 0 to 14) // NORTH/SOUTH @@ -57,12 +57,12 @@ SUBSYSTEM_DEF(skybox) im = image('icons/turf/space_dust_transit.dmi', "speedspace_ew_[i]") im.plane = DUST_PLANE im.blend_mode = BLEND_ADD - + MA.cut_overlays() MA.add_overlay(im) - + speedspace_cache["EW_[i]"] = MA - + //Over-the-edge images for (var/dir in alldirs) var/mutable_appearance/MA = new(normal_space) @@ -90,7 +90,7 @@ SUBSYSTEM_DEF(skybox) . = ..() /datum/controller/subsystem/skybox/Initialize() - . = ..() + return SS_INIT_SUCCESS /datum/controller/subsystem/skybox/proc/get_skybox(z) if(!subsystem_initialized) @@ -101,9 +101,9 @@ SUBSYSTEM_DEF(skybox) /datum/controller/subsystem/skybox/proc/generate_skybox(z) var/datum/skybox_settings/settings = global.using_map.get_skybox_datum(z) - + var/new_overlays = list() - + var/image/res = image(settings.icon) res.appearance_flags = KEEP_TOGETHER @@ -136,7 +136,7 @@ SUBSYSTEM_DEF(skybox) for(var/datum/event/E in SSevents.active_events) if(E.has_skybox_image && E.isRunning && (z in E.affecting_z)) new_overlays += E.get_skybox_image() - + for(var/image/I in new_overlays) I.appearance_flags |= RESET_COLOR @@ -161,7 +161,7 @@ SUBSYSTEM_DEF(skybox) var/icon_state = "dyable" var/color var/random_color = FALSE - + var/use_stars = TRUE var/star_icon = 'icons/skybox/skybox.dmi' var/star_state = "stars" diff --git a/code/controllers/subsystems/sounds.dm b/code/controllers/subsystems/sounds.dm index 7d94a3d21d..9067c077da 100644 --- a/code/controllers/subsystems/sounds.dm +++ b/code/controllers/subsystems/sounds.dm @@ -25,7 +25,7 @@ SUBSYSTEM_DEF(sounds) /datum/controller/subsystem/sounds/Initialize() setup_available_channels() - return ..() + return SS_INIT_SUCCESS /datum/controller/subsystem/sounds/proc/setup_available_channels() channel_list = list() diff --git a/code/controllers/subsystems/sqlite.dm b/code/controllers/subsystems/sqlite.dm index b4074b3355..a2e9b2864a 100644 --- a/code/controllers/subsystems/sqlite.dm +++ b/code/controllers/subsystems/sqlite.dm @@ -7,11 +7,11 @@ SUBSYSTEM_DEF(sqlite) flags = SS_NO_FIRE var/database/sqlite_db = null -/datum/controller/subsystem/sqlite/Initialize(timeofday) +/datum/controller/subsystem/sqlite/Initialize() connect() if(sqlite_db) init_schema(sqlite_db) - return ..() + return SS_INIT_SUCCESS /datum/controller/subsystem/sqlite/proc/connect() if(!CONFIG_GET(flag/sqlite_enabled)) diff --git a/code/controllers/subsystems/sun.dm b/code/controllers/subsystems/sun.dm index 551130a20b..bedb33ed13 100644 --- a/code/controllers/subsystems/sun.dm +++ b/code/controllers/subsystems/sun.dm @@ -1,6 +1,7 @@ SUBSYSTEM_DEF(sun) name = "Sun" wait = 600 + flags = SS_NO_INIT var/static/datum/sun/sun = new /datum/controller/subsystem/sun/fire() diff --git a/code/controllers/subsystems/supply.dm b/code/controllers/subsystems/supply.dm index e7ead3b770..9dbefd3684 100644 --- a/code/controllers/subsystems/supply.dm +++ b/code/controllers/subsystems/supply.dm @@ -33,7 +33,7 @@ SUBSYSTEM_DEF(supply) else qdel(P) - . = ..() + return SS_INIT_SUCCESS // Supply shuttle ticker - handles supply point regeneration. Just add points over time. /datum/controller/subsystem/supply/fire() diff --git a/code/controllers/subsystems/ticker.dm b/code/controllers/subsystems/ticker.dm index 2daf0413e2..c006df4b0c 100644 --- a/code/controllers/subsystems/ticker.dm +++ b/code/controllers/subsystems/ticker.dm @@ -61,7 +61,7 @@ var/global/datum/controller/subsystem/ticker/ticker ) ) GLOB.autospeaker = new (null, null, null, 1) //Set up Global Announcer - return ..() + return SS_INIT_SUCCESS /datum/controller/subsystem/ticker/fire(resumed = FALSE) switch(current_state) @@ -463,7 +463,7 @@ var/global/datum/controller/subsystem/ticker/ticker //VOREStation Addition End if(captainless) for(var/mob/M in player_list) - if(!istype(M,/mob/new_player)) + if(!isnewplayer(M)) to_chat(M, span_notice("Site Management is not forced on anyone.")) @@ -485,7 +485,7 @@ var/global/datum/controller/subsystem/ticker/ticker else to_chat(Player, span_filter_system(span_blue(span_bold("You missed the crew transfer after the events on [station_name()] as [Player.real_name].")))) else - if(istype(Player,/mob/observer/dead)) + if(isobserver(Player)) var/mob/observer/dead/O = Player if(!O.started_as_observer) to_chat(Player, span_filter_system(span_red(span_bold("You did not survive the events on [station_name()]...")))) diff --git a/code/controllers/subsystems/transcore_vr.dm b/code/controllers/subsystems/transcore_vr.dm index 7bb0d7d6cb..7c0a35257c 100644 --- a/code/controllers/subsystems/transcore_vr.dm +++ b/code/controllers/subsystems/transcore_vr.dm @@ -36,7 +36,7 @@ SUBSYSTEM_DEF(transcore) warning("Instantiated transcore DB without a key: [t]") continue databases[db.key] = db - return ..() + return SS_INIT_SUCCESS /datum/controller/subsystem/transcore/fire(resumed = 0) var/timer = TICK_USAGE diff --git a/code/controllers/subsystems/vis_overlays.dm b/code/controllers/subsystems/vis_overlays.dm index 82a652f00c..61cb58170a 100644 --- a/code/controllers/subsystems/vis_overlays.dm +++ b/code/controllers/subsystems/vis_overlays.dm @@ -9,7 +9,7 @@ SUBSYSTEM_DEF(vis_overlays) /datum/controller/subsystem/vis_overlays/Initialize() vis_overlay_cache = list() - return ..() + return SS_INIT_SUCCESS /datum/controller/subsystem/vis_overlays/fire(resumed = FALSE) if(!resumed) @@ -82,7 +82,7 @@ SUBSYSTEM_DEF(vis_overlays) if(istext(icon)) iconstate = icon icon = src.icon - + return SSvis_overlays.add_vis_overlay(src, icon, iconstate, layer, plane, dir, alpha, add_appearance_flags, add_vis_flags, unique) /atom/proc/remove_vis_overlay(list/overlays) diff --git a/code/controllers/subsystems/webhooks.dm b/code/controllers/subsystems/webhooks.dm index d9b75805af..a47e8933d9 100644 --- a/code/controllers/subsystems/webhooks.dm +++ b/code/controllers/subsystems/webhooks.dm @@ -6,7 +6,7 @@ SUBSYSTEM_DEF(webhooks) /datum/controller/subsystem/webhooks/Initialize() load_webhooks() - . = ..() + return SS_INIT_SUCCESS /datum/controller/subsystem/webhooks/proc/load_webhooks() diff --git a/code/controllers/subsystems/xenoarch.dm b/code/controllers/subsystems/xenoarch.dm index 45a437b966..a0e3991530 100644 --- a/code/controllers/subsystems/xenoarch.dm +++ b/code/controllers/subsystems/xenoarch.dm @@ -14,9 +14,9 @@ SUBSYSTEM_DEF(xenoarch) var/list/artifact_spawning_turfs = list() var/list/digsite_spawning_turfs = list() -/datum/controller/subsystem/xenoarch/Initialize(timeofday) +/datum/controller/subsystem/xenoarch/Initialize() SetupXenoarch() - ..() + return SS_INIT_SUCCESS /datum/controller/subsystem/xenoarch/Recover() if (istype(SSxenoarch.artifact_spawning_turfs)) diff --git a/code/datums/chat_message.dm b/code/datums/chat_message.dm index f216ae01cf..b5c41302ba 100644 --- a/code/datums/chat_message.dm +++ b/code/datums/chat_message.dm @@ -368,10 +368,10 @@ var/list/runechat_image_cache = list() return world.icon_size * 0.95 /atom/movable/runechat_x_offset(width, height) - return (width - bound_width) * -0.5 + return (width - bound_width) * -0.5 + get_oversized_icon_offsets()["x"] /atom/movable/runechat_y_offset(width, height) - return bound_height * 0.95 + return bound_height * 0.95 + get_oversized_icon_offsets()["y"] /* Nothing special /mob/runechat_x_offset(width, height) diff --git a/code/datums/colormate.dm b/code/datums/colormate.dm index 3bb625b7b1..c82f09a11c 100644 --- a/code/datums/colormate.dm +++ b/code/datums/colormate.dm @@ -90,10 +90,10 @@ if("paint") do_paint(inserted) temp = "Painted Successfully!" - if(istype(inserted, /mob/living/simple_mob)) + if(isanimal(inserted)) var/mob/living/simple_mob/M = inserted M.has_recoloured = TRUE - if(istype(inserted, /mob/living/silicon/robot)) + if(isrobot(inserted)) var/mob/living/silicon/robot/R = inserted R.has_recoloured = TRUE Destroy() diff --git a/code/datums/datum.dm b/code/datums/datum.dm index 2c37b78811..95e77fa9a3 100644 --- a/code/datums/datum.dm +++ b/code/datums/datum.dm @@ -86,7 +86,7 @@ * Returns [QDEL_HINT_QUEUE] */ /datum/proc/Destroy(force=FALSE) - //SHOULD_CALL_PARENT(TRUE) + SHOULD_CALL_PARENT(TRUE) //SHOULD_NOT_SLEEP(TRUE) tag = null weak_reference = null //ensure prompt GCing of weakref. diff --git a/code/datums/diseases/_disease.dm b/code/datums/diseases/_disease.dm index 492884b12a..48552997fb 100644 --- a/code/datums/diseases/_disease.dm +++ b/code/datums/diseases/_disease.dm @@ -135,7 +135,7 @@ GLOBAL_LIST_INIT(diseases, subtypesof(/datum/disease)) break var/direction = get_dir(current, target) var/turf/next = get_step(current, direction) - if(!current.CanZASPass() || !next.CanZASPass(get_turf(turn(direction, 100)))) + if(!current.CanZASPass(next)) break current = next diff --git a/code/datums/helper_datums/teleport.dm b/code/datums/helper_datums/teleport.dm index 07f4301ca2..994dd65b2f 100644 --- a/code/datums/helper_datums/teleport.dm +++ b/code/datums/helper_datums/teleport.dm @@ -167,7 +167,7 @@ var/bluespace_item_types = newlist(/obj/item/storage/backpack/holding, bluespace_things |= teleatom.search_contents_for(item) //VOREStation Addition Start: Prevent taurriding abuse - if(istype(teleatom, /mob/living)) + if(isliving(teleatom)) var/mob/living/L = teleatom if(LAZYLEN(L.buckled_mobs)) for(var/mob/rider in L.buckled_mobs) @@ -177,7 +177,7 @@ var/bluespace_item_types = newlist(/obj/item/storage/backpack/holding, if(bluespace_things.len) precision = max(rand(1,100)*bluespace_things.len,100) - if(istype(teleatom, /mob/living)) + if(isliving(teleatom)) var/mob/living/MM = teleatom to_chat(MM, span_danger("The Bluespace interface on your [teleatom] interferes with the teleport!")) return 1 @@ -188,7 +188,7 @@ var/bluespace_item_types = newlist(/obj/item/storage/backpack/holding, return 0 if(!isemptylist(teleatom.search_contents_for(/obj/item/disk/nuclear))) - if(istype(teleatom, /mob/living)) + if(isliving(teleatom)) var/mob/living/MM = teleatom MM.visible_message(span_danger("\The [MM] bounces off of the portal!"),span_warning("Something you are carrying seems to be unable to pass through the portal. Better drop it if you want to go through.")) else @@ -208,7 +208,7 @@ var/bluespace_item_types = newlist(/obj/item/storage/backpack/holding, var/obstructed = 0 var/turf/dest_turf = get_turf(destination) if(local && !(dest_turf.z in using_map.player_levels)) - if(istype(teleatom, /mob/living)) + if(isliving(teleatom)) to_chat(teleatom, span_warning("The portal refuses to carry you that far away!")) return 0 else if(istype(destination.loc, /obj/belly)) diff --git a/code/datums/managed_browsers/feedback_form.dm b/code/datums/managed_browsers/feedback_form.dm index 15bf63f535..cb859d8feb 100644 --- a/code/datums/managed_browsers/feedback_form.dm +++ b/code/datums/managed_browsers/feedback_form.dm @@ -142,7 +142,7 @@ GENERAL_PROTECT_DATUM(/datum/managed_browser/feedback_form) return my_client.mob << browse(null, "window=[browser_id]") // Closes the window. - if(istype(my_client.mob, /mob/new_player)) + if(isnewplayer(my_client.mob)) var/mob/new_player/NP = my_client.mob NP.new_player_panel_proc() // So the feedback button goes away, if the user gets put on cooldown. qdel(src) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 78a75a7114..cbb43a230f 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -241,7 +241,7 @@ var/list/possible_targets = list("Free objective") for(var/datum/mind/possible_target in ticker.minds) - if ((possible_target != src) && istype(possible_target.current, /mob/living/carbon/human)) + if ((possible_target != src) && ishuman(possible_target.current)) possible_targets += possible_target.current var/mob/def_target = null @@ -386,7 +386,7 @@ log_admin("[key_name_admin(usr)] has unemag'ed [R].") if("unemagcyborgs") - if (istype(current, /mob/living/silicon/ai)) + if (isAI(current)) var/mob/living/silicon/ai/ai = current for (var/mob/living/silicon/robot/R in ai.connected_robots) R.emagged = 0 diff --git a/code/datums/repositories/crew.dm b/code/datums/repositories/crew.dm index ae94e78726..4b59eeeb39 100644 --- a/code/datums/repositories/crew.dm +++ b/code/datums/repositories/crew.dm @@ -26,7 +26,7 @@ var/global/datum/repository/crew/crew_repository = new() var/turf/pos = get_turf(C) var/area/B = pos?.loc //VOREStation Add: No sensor in Dorm if((C.has_sensor) && (pos?.z == zLevel) && (C.sensor_mode != SUIT_SENSOR_OFF) && !(B.flag_check(AREA_BLOCK_SUIT_SENSORS)) && !(is_jammed(C)) && !(is_vore_jammed(C))) //VOREStation Edit - if(istype(C.loc, /mob/living/carbon/human)) + if(ishuman(C.loc)) var/mob/living/carbon/human/H = C.loc if(H.w_uniform != C) continue diff --git a/code/datums/uplink/announcements.dm b/code/datums/uplink/announcements.dm index 12330db3b8..e225247862 100644 --- a/code/datums/uplink/announcements.dm +++ b/code/datums/uplink/announcements.dm @@ -54,7 +54,7 @@ general.fields["sex"] = I.sex else var/mob/living/carbon/human/H - if(istype(user,/mob/living/carbon/human)) + if(ishuman(user)) H = user general.fields["age"] = H.age else @@ -106,4 +106,3 @@ var/datum/event_meta/EM = new(EVENT_LEVEL_MUNDANE, "Fake Radiation Storm", add_to_queue = 0) new/datum/event/radiation_storm/syndicate(EM) return 1 - diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm index 74ca803b19..56b00d2cae 100644 --- a/code/defines/obj/weapon.dm +++ b/code/defines/obj/weapon.dm @@ -45,6 +45,7 @@ /obj/item/soap/Initialize() if(randomize && prob(square_chance)) icon_state = "[icon_state]-alt" + . = ..() /obj/item/soap/nanotrasen desc = "A NanoTrasen-brand bar of soap. Smells of phoron, a years-old marketing gimmick." diff --git a/code/defines/procs/announce.dm b/code/defines/procs/announce.dm index 7840615ccc..72d79a0662 100644 --- a/code/defines/procs/announce.dm +++ b/code/defines/procs/announce.dm @@ -54,7 +54,7 @@ /datum/announcement/proc/Message(message as text, message_title as text, var/list/zlevels) for(var/mob/M in player_list) - if(!istype(M,/mob/new_player) && !isdeaf(M)) + if(!isnewplayer(M) && !isdeaf(M)) to_chat(M, "

[title]

") to_chat(M, span_alert("[message]")) if (announcer) @@ -82,7 +82,7 @@ for(var/mob/M in player_list) if(zlevels && !(get_z(M) in zlevels)) continue - if(!istype(M,/mob/new_player) && !isdeaf(M)) + if(!isnewplayer(M) && !isdeaf(M)) to_chat(M, command) /datum/announcement/priority/Message(var/message as text, var/message_title as text, var/list/zlevels) @@ -110,7 +110,7 @@ for(var/mob/M in player_list) if(zlevels && !(M.z in zlevels)) continue - if(!istype(M,/mob/new_player) && !isdeaf(M)) + if(!isnewplayer(M) && !isdeaf(M)) M << 'sound/AI/preamble.ogg' if(!message_sound) @@ -120,7 +120,7 @@ for(var/mob/M in player_list) if(zlevels && !(M.z in zlevels)) continue - if(!istype(M,/mob/new_player) && !isdeaf(M)) + if(!isnewplayer(M) && !isdeaf(M)) M << message_sound /datum/announcement/proc/Sound(var/message_sound, var/list/zlevels) diff --git a/code/game/antagonist/antagonist.dm b/code/game/antagonist/antagonist.dm index d9d11999f3..38ea7f9629 100644 --- a/code/game/antagonist/antagonist.dm +++ b/code/game/antagonist/antagonist.dm @@ -54,7 +54,7 @@ var/flags = 0 // Various runtime options. // Used for setting appearance. - var/list/valid_species = list(SPECIES_UNATHI,SPECIES_TAJ,SPECIES_SKRELL,SPECIES_HUMAN,SPECIES_DIONA,SPECIES_TESHARI) + var/list/valid_species = list(SPECIES_UNATHI,SPECIES_TAJARAN,SPECIES_SKRELL,SPECIES_HUMAN,SPECIES_DIONA,SPECIES_TESHARI) // Runtime vars. var/datum/mind/leader // Current leader, if any. @@ -109,7 +109,7 @@ // Note that this is done before jobs are handed out. candidates = ticker.mode.get_players_for_role(role_type, id, ghosts_only) for(var/datum/mind/player in candidates) - if(ghosts_only && !istype(player.current, /mob/observer/dead)) + if(ghosts_only && !isobserver(player.current)) candidates -= player log_debug("[key_name(player)] is not eligible to become a [role_text]: Only ghosts may join as this role! They have been removed from the draft.") else if(CONFIG_GET(flag/use_age_restriction_for_antags) && player.current.client.player_age < minimum_player_age) @@ -147,7 +147,7 @@ return 0 to_chat(player.current, span_danger(span_italics("You have been selected this round as an antagonist!"))) message_admins("[uppertext(ticker.mode.name)]: Selected [player] as a [role_text].") - if(istype(player.current, /mob/observer/dead)) + if(isobserver(player.current)) create_default(player.current) else add_antagonist(player,0,0,0,1,1) @@ -185,7 +185,7 @@ if(player.special_role) log_debug("[player.key] was selected for [role_text] by lottery, but they already have a special role.") return 0 - if(!(flags & ANTAG_OVERRIDE_JOB) && (!player.current || istype(player.current, /mob/new_player))) + if(!(flags & ANTAG_OVERRIDE_JOB) && (!player.current || isnewplayer(player.current))) log_debug("[player.key] was selected for [role_text] by lottery, but they have not joined the game.") return 0 diff --git a/code/game/antagonist/antagonist_add.dm b/code/game/antagonist/antagonist_add.dm index 76781e5def..b4c914498e 100644 --- a/code/game/antagonist/antagonist_add.dm +++ b/code/game/antagonist/antagonist_add.dm @@ -8,7 +8,7 @@ player.assigned_role = role_text player.special_role = role_text - if(istype(player.current, /mob/observer/dead)) + if(isobserver(player.current)) create_default(player.current) else create_antagonist(player, move_to_spawn, do_not_announce, preserve_appearance) diff --git a/code/game/antagonist/mutiny/mutineer.dm b/code/game/antagonist/mutiny/mutineer.dm index 28871a32e2..d7d4193031 100644 --- a/code/game/antagonist/mutiny/mutineer.dm +++ b/code/game/antagonist/mutiny/mutineer.dm @@ -18,7 +18,7 @@ var/datum/antagonist/mutineer/mutineers /datum/antagonist/mutineer/can_become_antag(var/datum/mind/player) if(!..()) return 0 - if(!istype(player.current, /mob/living/carbon/human)) + if(!ishuman(player.current)) return 0 if(M.special_role) return 0 diff --git a/code/game/antagonist/outsider/ninja.dm b/code/game/antagonist/outsider/ninja.dm index 7df32b76aa..4dd40c508e 100644 --- a/code/game/antagonist/outsider/ninja.dm +++ b/code/game/antagonist/outsider/ninja.dm @@ -158,7 +158,7 @@ var/datum/antagonist/ninja/ninjas if(13) directive += "Some disgruntled [using_map.company_name] employees have been supportive of our operations. Be wary of any mistreatment by command staff." if(14) - var/xenorace = pick(SPECIES_UNATHI, SPECIES_TAJ, SPECIES_SKRELL) + var/xenorace = pick(SPECIES_UNATHI, SPECIES_TAJARAN, SPECIES_SKRELL) directive += "A group of [xenorace] radicals have been loyal supporters of the Spider Clan. Favor [xenorace] crew whenever possible." if(15) directive += "The Spider Clan has recently been accused of religious insensitivity. Attempt to speak with the " + JOB_CHAPLAIN + " and prove these accusations false." diff --git a/code/game/antagonist/station/infiltrator.dm b/code/game/antagonist/station/infiltrator.dm index f3ffbc0024..472b0737bf 100644 --- a/code/game/antagonist/station/infiltrator.dm +++ b/code/game/antagonist/station/infiltrator.dm @@ -24,7 +24,7 @@ var/datum/antagonist/traitor/infiltrator/infiltrators // Now for the special headset. // Humans and the AI. - if(istype(traitor_mob) || istype(traitor_mob, /mob/living/silicon/ai)) + if(istype(traitor_mob) || isAI(traitor_mob)) var/obj/item/radio/headset/R R = locate(/obj/item/radio/headset) in traitor_mob.contents if(!R) @@ -50,7 +50,7 @@ var/datum/antagonist/traitor/infiltrator/infiltrators :t") // Borgs, because their radio is not a headset for some reason. - if(istype(traitor_mob, /mob/living/silicon/robot)) + if(isrobot(traitor_mob)) var/mob/living/silicon/robot/borg = traitor_mob var/obj/item/encryptionkey/syndicate/encrypt_key = new(null) if(borg.radio) diff --git a/code/game/antagonist/station/traitor.dm b/code/game/antagonist/station/traitor.dm index 898e71fd46..1d3a4b45cd 100644 --- a/code/game/antagonist/station/traitor.dm +++ b/code/game/antagonist/station/traitor.dm @@ -115,21 +115,23 @@ var/datum/antagonist/traitor/traitors var/loc = "" var/obj/item/R = locate() //Hide the uplink in a PDA if available, otherwise radio - if(traitor_mob.client.prefs.uplinklocation == "Headset") + var/uplinklocation = traitor_mob.read_preference(/datum/preference/choiced/uplinklocation) + + if(uplinklocation == "Headset") R = locate(/obj/item/radio) in traitor_mob.contents if(!R) R = locate(/obj/item/pda) in traitor_mob.contents to_chat(traitor_mob, "Could not locate a Radio, installing in PDA instead!") if (!R) to_chat(traitor_mob, "Unfortunately, neither a radio or a PDA relay could be installed.") - else if(traitor_mob.client.prefs.uplinklocation == "PDA") + else if(uplinklocation == "PDA") R = locate(/obj/item/pda) in traitor_mob.contents if(!R) R = locate(/obj/item/radio) in traitor_mob.contents to_chat(traitor_mob, "Could not locate a PDA, installing into a Radio instead!") if(!R) to_chat(traitor_mob, "Unfortunately, neither a radio or a PDA relay could be installed.") - else if(traitor_mob.client.prefs.uplinklocation == "None") + else if(uplinklocation == "None") to_chat(traitor_mob, "You have elected to not have an AntagCorp portable teleportation relay installed!") R = null else diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index 8d5616955b..f9dcbe3f0b 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -384,7 +384,7 @@ var/list/mob/living/forced_ambiance_list = new if(!L.lastarea) L.lastarea = src var/area/oldarea = L.lastarea - if((oldarea.get_gravity() == 0) && (get_gravity() == 1) && (L.m_intent == "run")) // Being ready when you change areas gives you a chance to avoid falling all together. + if((oldarea.get_gravity() == 0) && (get_gravity() == 1) && (L.m_intent == I_RUN)) // Being ready when you change areas gives you a chance to avoid falling all together. thunk(L) L.update_floating( L.Check_Dense_Object() ) @@ -420,7 +420,7 @@ var/list/mob/living/forced_ambiance_list = new else L << sound(null, channel = CHANNEL_AMBIENCE_FORCED) else if(src.ambience && src.ambience.len) - var/ambience_odds = L?.client.prefs.ambience_chance + var/ambience_odds = L.read_preference(/datum/preference/numeric/ambience_chance) if(prob(ambience_odds) && (world.time >= L.client.time_last_ambience_played + 1 MINUTE)) var/sound = pick(ambience) L << sound(sound, repeat = 0, wait = 0, volume = 50 * volume_mod, channel = CHANNEL_AMBIENCE) @@ -450,7 +450,7 @@ var/list/mob/living/forced_ambiance_list = new if(H.species.can_zero_g_move || H.species.can_space_freemove) return - if(H.m_intent == "run") + if(H.m_intent == I_RUN) H.AdjustStunned(6) H.AdjustWeakened(6) else diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 80580031d6..e822ae6a79 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -125,7 +125,7 @@ //return flags that should be added to the viewer's sight var. //Otherwise return a negative number to indicate that the view should be cancelled. /atom/proc/check_eye(user as mob) - if (istype(user, /mob/living/silicon/ai)) // WHYYYY + if (isAI(user)) // WHYYYY return 0 return -1 @@ -223,6 +223,7 @@ //All atoms /atom/proc/examine(mob/user, var/infix = "", var/suffix = "") + SHOULD_CALL_PARENT(TRUE) //This reformat names to get a/an properly working on item descriptions when they are bloody var/f_name = "\a [src][infix]." if(src.blood_DNA && !istype(src, /obj/effect/decal)) @@ -818,3 +819,29 @@ var/mouseparams = list2params(paramslist) usr_client.Click(src, loc, null, mouseparams) return TRUE + +GLOBAL_LIST_EMPTY(icon_dimensions) + +/atom/proc/get_oversized_icon_offsets() + if (pixel_x == 0 && pixel_y == 0) + return list("x" = 0, "y" = 0) + var/list/icon_dimensions = get_icon_dimensions(icon) + var/icon_width = icon_dimensions["width"] + var/icon_height = icon_dimensions["height"] + return list( + "x" = icon_width > world.icon_size && pixel_x != 0 ? (icon_width - world.icon_size) * 0.5 : 0, + "y" = icon_height > world.icon_size /*&& pixel_y != 0*/ ? (icon_height - world.icon_size) * 0.5 : 0, // we don't have pixel_y in use + ) + +/// Returns a list containing the width and height of an icon file +/proc/get_icon_dimensions(icon_path) + // Icons can be a real file(), a rsc backed file(), a dynamic rsc (dyn.rsc) reference (known as a cache reference in byond docs), or an /icon which is pointing to one of those. + // Runtime generated dynamic icons are an unbounded concept cache identity wise, the same icon can exist millions of ways and holding them in a list as a key can lead to unbounded memory usage if called often by consumers. + // Check distinctly that this is something that has this unspecified concept, and thus that we should not cache. + if (!isfile(icon_path) || !length("[icon_path]")) + var/icon/my_icon = icon(icon_path) + return list("width" = my_icon.Width(), "height" = my_icon.Height()) + if (isnull(GLOB.icon_dimensions[icon_path])) + var/icon/my_icon = icon(icon_path) + GLOB.icon_dimensions[icon_path] = list("width" = my_icon.Width(), "height" = my_icon.Height()) + return GLOB.icon_dimensions[icon_path] diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 9c63bcb7f7..2a3d12e4d1 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -391,7 +391,7 @@ //called when src is thrown into hit_atom /atom/movable/proc/throw_impact(atom/hit_atom, var/speed) - if(istype(hit_atom,/mob/living)) + if(isliving(hit_atom)) var/mob/living/M = hit_atom if(M.buckled == src) return // Don't hit the thing we're buckled to. @@ -413,7 +413,7 @@ if(src.throwing) for(var/atom/A in get_turf(src)) if(A == src) continue - if(istype(A,/mob/living)) + if(isliving(A)) if(A:lying) continue src.throw_impact(A,speed) if(isobj(A)) diff --git a/code/game/birthday.dm b/code/game/birthday.dm index add0a3f7f0..2af06c13ff 100644 --- a/code/game/birthday.dm +++ b/code/game/birthday.dm @@ -1,9 +1,12 @@ /mob/living/carbon/human/proc/consider_birthday() + var/bday_month = read_preference(/datum/preference/numeric/human/bday_month) + var/bday_day = read_preference(/datum/preference/numeric/human/bday_day) if(!bday_month || !bday_day) //If we don't have one of these set, don't worry about it return if(real_name != client.prefs.real_name) //let's not celebrate the birthday of that weird mob we got dropped into return - if(!(client.prefs.last_birthday_notification < world_time_year)) //you only get notified once a year + + if(!(read_preference(/datum/preference/numeric/human/last_bday_note) < world_time_year)) //you only get notified once a year return if((world_time_month == bday_month) && (world_time_day == bday_day)) //it is your birthday birthday(1) @@ -14,23 +17,23 @@ /mob/living/carbon/human/proc/birthday(var/birthday = 0) var/msg - var/lastyear = client.prefs.last_birthday_notification - client.prefs.last_birthday_notification = world_time_year //We only want to ask once a year per character, this persists, update early in case of shenanigans + var/lastyear = read_preference(/datum/preference/numeric/human/last_bday_note) + write_preference_directly(/datum/preference/numeric/human/last_bday_note, world_time_year) //We only want to ask once a year per character, this persists, update early in case of shenanigans if(birthday) //woo msg = "Today is your birthday! Do you want to increase your character's listed age?" - if(client.prefs.bday_announce) + if(read_preference(/datum/preference/toggle/human/bday_announce)) var/list/sounds = list('sound/voice/BIRTH.ogg') var/oursound = pickweight(sounds) command_announcement.Announce("Confirmed presence of BIRTHDAY aboard the station! It is [src.real_name]'s birthday or similar sort of celebration, name day, hatchday, WHATEVER! We encourage you to go find [src.real_name] and show them how we celebrate around here! Have a secure day!", "BIRTHDAY!", oursound) else msg = "Your birthday has passed! Do you want to increase your character's listed age?" //sad, but thus is the life of an adult - if(tgui_alert(src, msg,"BIRTHDAY! ([bday_month]/[bday_day])",list("Level me up, baby","No way, I'mma stay young forever")) == "Level me up, baby") + if(tgui_alert(src, msg,"BIRTHDAY! ([read_preference(/datum/preference/numeric/human/bday_month)]/[read_preference(/datum/preference/numeric/human/bday_day)])",list("Level me up, baby","No way, I'mma stay young forever")) == "Level me up, baby") if(lastyear == 0) //We've never been asked, so let's just assume you were keeping track before now and only add 1 age += 1 else var/howmuch = world_time_year - lastyear age += howmuch to_chat(src, span_notice("You are now [age]! Happy birthday!")) - client.prefs.age = age //Set the age on the character sheet + write_preference_directly(/datum/preference/numeric/human/age, age) //Set the age on the character sheet client.prefs.save_character() //Save the info diff --git a/code/game/dna/dna2.dm b/code/game/dna/dna2.dm index 099e5c4d18..63b8a4a4de 100644 --- a/code/game/dna/dna2.dm +++ b/code/game/dna/dna2.dm @@ -50,6 +50,19 @@ var/global/list/datum/dna/gene/dna_genes[0] var/base_species = "Human" var/list/species_traits = list() var/blood_color = "#A10808" + var/blood_reagents = "iron" + var/scale_appearance = 0 + var/offset_override = 0 + var/synth_markings = 0 + var/custom_speech_bubble = "default" + var/species_sounds = "None" + var/gender_specific_species_sounds = FALSE + var/species_sounds_male = "None" + var/species_sounds_female = "None" + var/grad_style = 0 + var/r_grad = 0 + var/g_grad = 0 + var/b_grad = 0 var/custom_say var/custom_ask var/custom_whisper @@ -79,6 +92,19 @@ var/global/list/datum/dna/gene/dna_genes[0] new_dna.custom_species=custom_species //VOREStaton Edit new_dna.species_traits=species_traits.Copy() //VOREStation Edit new_dna.blood_color=blood_color //VOREStation Edit + new_dna.blood_reagents=blood_reagents + new_dna.scale_appearance = scale_appearance + new_dna.offset_override = offset_override + new_dna.synth_markings = synth_markings + new_dna.custom_speech_bubble = custom_speech_bubble + new_dna.species_sounds = species_sounds + new_dna.gender_specific_species_sounds = gender_specific_species_sounds + new_dna.species_sounds_male = species_sounds_male + new_dna.species_sounds_female = species_sounds_female + new_dna.grad_style = grad_style + new_dna.r_grad = r_grad + new_dna.g_grad = g_grad + new_dna.b_grad = b_grad new_dna.custom_say=custom_say //VOREStaton Edit new_dna.custom_ask=custom_ask //VOREStaton Edit new_dna.custom_whisper=custom_whisper //VOREStaton Edit @@ -157,6 +183,21 @@ var/global/list/datum/dna/gene/dna_genes[0] src.custom_species = character.custom_species src.base_species = character.species.base_species src.blood_color = character.species.blood_color + src.blood_reagents = character.species.blood_reagents + src.scale_appearance = character.fuzzy + src.offset_override = character.offset_override + src.synth_markings = character.synth_markings + src.custom_speech_bubble = character.custom_speech_bubble + /* Currently not implemented on virgo + src.species_sounds = character.species.species_sounds + src.gender_specific_species_sounds = character.species.gender_specific_species_sounds + src.species_sounds_male = character.species.species_sounds_male + src.species_sounds_female = character.species.species_sounds_female + */ + src.grad_style = character.grad_style + src.r_grad = character.r_grad + src.g_grad = character.g_grad + src.b_grad = character.b_grad src.species_traits = character.species.traits.Copy() src.custom_say = character.custom_say src.custom_ask = character.custom_ask diff --git a/code/game/dna/dna2_helpers.dm b/code/game/dna/dna2_helpers.dm index e7b68fdfe5..15e9e73139 100644 --- a/code/game/dna/dna2_helpers.dm +++ b/code/game/dna/dna2_helpers.dm @@ -127,7 +127,7 @@ // Simpler. Don't specify UI in order for the mob to use its own. /mob/proc/UpdateAppearance(var/list/UI=null) - if(istype(src, /mob/living/carbon/human)) + if(ishuman(src)) if(UI!=null) src.dna.UI=UI src.dna.UpdateUI() @@ -258,12 +258,28 @@ H.custom_whisper = dna.custom_whisper H.custom_exclaim = dna.custom_exclaim H.species.blood_color = dna.blood_color + H.fuzzy = dna.scale_appearance + H.offset_override = dna.offset_override + H.synth_markings = dna.synth_markings + H.custom_speech_bubble = dna.custom_speech_bubble + H.grad_style = dna.grad_style + H.r_grad = dna.r_grad + H.g_grad = dna.g_grad + H.b_grad = dna.b_grad H.custom_heat = dna.custom_heat H.custom_cold = dna.custom_cold var/datum/species/S = H.species - S.produceCopy(dna.species_traits, H, dna.base_species) + S.produceCopy(dna.species_traits, H, dna.base_species/*, FALSE*/) // Traitgenes edit - reset_dna flag required, or genes get reset on resleeve // VOREStation Edit End + H.species.blood_reagents = dna.blood_reagents + /* Currently not implemented on virgo + H.species.species_sounds = dna.species_sounds + H.species.gender_specific_species_sounds = dna.gender_specific_species_sounds + H.species.species_sounds_male = dna.species_sounds_male + H.species.species_sounds_female = dna.species_sounds_female + */ + H.force_update_organs() //VOREStation Add - Gotta do this too H.force_update_limbs() //H.update_body(0) //VOREStation Edit - Done in force_update_limbs already diff --git a/code/game/dna/genes/monkey.dm b/code/game/dna/genes/monkey.dm index 9bf5ff965a..959c0cc2f2 100644 --- a/code/game/dna/genes/monkey.dm +++ b/code/game/dna/genes/monkey.dm @@ -5,10 +5,10 @@ block=MONKEYBLOCK /datum/dna/gene/monkey/can_activate(var/mob/M,var/flags) - return istype(M, /mob/living/carbon/human) || istype(M,/mob/living/carbon/monkey) + return ishuman(M) || istype(M,/mob/living/carbon/monkey) /datum/dna/gene/monkey/activate(var/mob/living/M, var/connected, var/flags) - if(!istype(M,/mob/living/carbon/human)) + if(!ishuman(M)) //testing("Cannot monkey-ify [M], type is [M.type].") return var/mob/living/carbon/human/H = M diff --git a/code/game/gamemodes/changeling/powers/armblade.dm b/code/game/gamemodes/changeling/powers/armblade.dm index 52a83f8e9b..650b134800 100644 --- a/code/game/gamemodes/changeling/powers/armblade.dm +++ b/code/game/gamemodes/changeling/powers/armblade.dm @@ -91,7 +91,7 @@ /obj/item/melee/changeling/process() //Stolen from ninja swords. if(!creator || loc != creator || !creator.item_is_in_hands(src)) // Tidy up a bit. - if(istype(loc,/mob/living)) + if(isliving(loc)) var/mob/living/carbon/human/host = loc if(istype(host)) for(var/obj/item/organ/external/organ in host.organs) diff --git a/code/game/gamemodes/changeling/powers/visible_camouflage.dm b/code/game/gamemodes/changeling/powers/visible_camouflage.dm index e83b61bb5c..3692044219 100644 --- a/code/game/gamemodes/changeling/powers/visible_camouflage.dm +++ b/code/game/gamemodes/changeling/powers/visible_camouflage.dm @@ -15,7 +15,7 @@ set desc = "Turns yourself almost invisible, as long as you move slowly." - if(istype(src,/mob/living/carbon/human)) + if(ishuman(src)) var/mob/living/carbon/human/H = src if(H.mind.changeling.cloaked) @@ -41,13 +41,13 @@ to_chat(src, span_notice("We may move at our normal speed while hidden.")) if(must_walk) - H.set_m_intent("walk") + H.set_m_intent(I_WALK) var/remain_cloaked = TRUE while(remain_cloaked) //This loop will keep going until the player uncloaks. sleep(1 SECOND) // Sleep at the start so that if something invalidates a cloak, it will drop immediately after the check and not in one second. - if(H.m_intent != "walk" && must_walk) // Moving too fast uncloaks you. + if(H.m_intent != I_WALK && must_walk) // Moving too fast uncloaks you. remain_cloaked = 0 if(!H.mind.changeling.cloaked) remain_cloaked = 0 @@ -65,7 +65,7 @@ H.invisibility = initial(invisibility) visible_message(span_warning("[src] suddenly fades in, seemingly from nowhere!"), span_notice("We revert our camouflage, revealing ourselves.")) - H.set_m_intent("run") + H.set_m_intent(I_RUN) H.mind.changeling.cloaked = 0 H.mind.changeling.chem_recharge_rate = old_regen_rate diff --git a/code/game/gamemodes/cult/construct_spells.dm b/code/game/gamemodes/cult/construct_spells.dm index 9baf8667f7..5a2168fa53 100644 --- a/code/game/gamemodes/cult/construct_spells.dm +++ b/code/game/gamemodes/cult/construct_spells.dm @@ -650,7 +650,7 @@ /obj/item/spell/construct/slam/on_melee_cast(atom/hit_atom, mob/living/user, def_zone) var/attack_message = "slams" - if(istype(user, /mob/living/simple_mob)) + if(isanimal(user)) var/mob/living/simple_mob/S = user attack_message = pick(S.attacktext) if(isliving(hit_atom)) diff --git a/code/game/gamemodes/cult/cult_structures.dm b/code/game/gamemodes/cult/cult_structures.dm index 73429d697b..a4942e3133 100644 --- a/code/game/gamemodes/cult/cult_structures.dm +++ b/code/game/gamemodes/cult/cult_structures.dm @@ -154,6 +154,7 @@ return /obj/effect/gateway/active/Initialize() + . = ..() addtimer(CALLBACK(src, PROC_REF(spawn_and_qdel)), rand(30, 60) SECONDS) /obj/effect/gateway/active/proc/spawn_and_qdel() @@ -165,7 +166,7 @@ /obj/effect/gateway/active/Crossed(var/atom/A) if(A.is_incorporeal()) return - if(!istype(A, /mob/living)) + if(!isliving(A)) return var/mob/living/M = A diff --git a/code/game/gamemodes/cult/ritual.dm b/code/game/gamemodes/cult/ritual.dm index 27c0941144..81b5bba11e 100644 --- a/code/game/gamemodes/cult/ritual.dm +++ b/code/game/gamemodes/cult/ritual.dm @@ -298,7 +298,7 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa"," /obj/item/book/tome/attack(mob/living/M as mob, mob/living/user as mob) add_attack_logs(user,M,"Hit with [name]") - if(istype(M,/mob/observer/dead)) + if(isobserver(M)) var/mob/observer/dead/D = M D.manifest(user) return @@ -449,7 +449,7 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa"," var/list/runes = list("teleport", "itemport", "tome", "armor", "convert", "tear in reality", "emp", "drain", "seer", "raise", "obscure", "reveal", "astral journey", "manifest", "imbue talisman", "sacrifice", "wall", "freedom", "cultsummon", "deafen", "blind", "bloodboil", "communicate", "stun") r = input(user, "Choose a rune to scribe", "Rune Scribing") in runes // Remains input() for extreme blocking var/obj/effect/rune/R = new /obj/effect/rune - if(istype(user, /mob/living/carbon/human)) + if(ishuman(user)) var/mob/living/carbon/human/H = user R.blood_DNA = list() R.blood_DNA[H.dna.unique_enzymes] = H.dna.b_type diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index 15900cdeca..670f5e26fb 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -26,7 +26,7 @@ var/list/sacrificed = list() allrunesloc[index] = R.loc if(index >= 5) to_chat(user, span_danger("You feel pain, as rune disappears in reality shift caused by too much wear of space-time fabric.")) - if (istype(user, /mob/living)) + if (isliving(user)) user.take_overall_damage(5, 0) qdel(src) if(allrunesloc && index != 0) @@ -59,7 +59,7 @@ var/list/sacrificed = list() runecount++ if(runecount >= 2) to_chat(user, span_danger("You feel pain, as rune disappears in reality shift caused by too much wear of space-time fabric.")) - if (istype(user, /mob/living)) + if (isliving(user)) user.take_overall_damage(5, 0) qdel(src) for(var/mob/living/carbon/C in orange(1,src)) @@ -661,7 +661,7 @@ var/list/sacrificed = list() for(var/mob/H in victims) var/worth = 0 - if(istype(H,/mob/living/carbon/human)) + if(ishuman(H)) var/mob/living/carbon/human/lamb = H if(lamb.species.rarity_value > 3) worth = 1 diff --git a/code/game/gamemodes/cult/soulstone.dm b/code/game/gamemodes/cult/soulstone.dm index 59c9c62e82..3a5e93689a 100644 --- a/code/game/gamemodes/cult/soulstone.dm +++ b/code/game/gamemodes/cult/soulstone.dm @@ -20,7 +20,7 @@ //////////////////////////////Capturing//////////////////////////////////////////////////////// /obj/item/soulstone/attack(mob/living/carbon/human/M as mob, mob/user as mob) - if(!istype(M, /mob/living/carbon/human))//If target is not a human. + if(!ishuman(M))//If target is not a human. return ..() if(istype(M, /mob/living/carbon/human/dummy)) return..() diff --git a/code/game/gamemodes/endgame/supermatter_cascade/blob.dm b/code/game/gamemodes/endgame/supermatter_cascade/blob.dm index e2bc9d7a4b..a08a6d3009 100644 --- a/code/game/gamemodes/endgame/supermatter_cascade/blob.dm +++ b/code/game/gamemodes/endgame/supermatter_cascade/blob.dm @@ -48,7 +48,7 @@ // Nom. for(var/atom/movable/A in T) if(A) - if(istype(A,/mob/living)) + if(isliving(A)) qdel(A) else if(istype(A,/mob)) // Observers, AI cameras. continue @@ -98,7 +98,7 @@ /turf/unsimulated/wall/supermatter/Bumped(atom/AM as mob|obj) - if(istype(AM, /mob/living)) + if(isliving(AM)) var/mob/living/M = AM var/datum/gender/T = gender_datums[M.get_visible_gender()] AM.visible_message(span_warning("\The [AM] slams into \the [src] inducing a resonance... [T.his] body starts to glow and catch flame before flashing into ash."),\ diff --git a/code/game/gamemodes/endgame/supermatter_cascade/universe.dm b/code/game/gamemodes/endgame/supermatter_cascade/universe.dm index 6df1dad864..5889e778bb 100644 --- a/code/game/gamemodes/endgame/supermatter_cascade/universe.dm +++ b/code/game/gamemodes/endgame/supermatter_cascade/universe.dm @@ -119,7 +119,7 @@ The access requirements on the Asteroid Shuttles' consoles have now been revoked /datum/universal_state/supermatter_cascade/proc/PlayerSet() for(var/datum/mind/M in player_list) - if(!istype(M.current,/mob/living)) + if(!isliving(M.current)) continue if(M.current.stat!=2) M.current.Weaken(10) diff --git a/code/game/gamemodes/events.dm b/code/game/gamemodes/events.dm index 75de7d0fd6..2bf8f17592 100644 --- a/code/game/gamemodes/events.dm +++ b/code/game/gamemodes/events.dm @@ -32,7 +32,7 @@ if(1) command_alert("Meteors have been detected on collision course with the station.", "Meteor Alert") for(var/mob/M in player_list) - if(!istype(M,/mob/new_player)) + if(!isnewplayer(M)) M << sound('sound/AI/meteors.ogg') spawn(100) meteor_wave() @@ -44,7 +44,7 @@ if(2) command_alert("Gravitational anomalies detected on the station. There is no additional data.", "Anomaly Alert") for(var/mob/M in player_list) - if(!istype(M,/mob/new_player)) + if(!isnewplayer(M)) M << sound('sound/AI/granomalies.ogg') var/turf/T = pick(blobstart) var/obj/effect/bhole/bh = new /obj/effect/bhole( T.loc, 30 ) @@ -148,7 +148,7 @@ var/hadevent = 0 continue if(isNotStationLevel(T.z)) continue - if(istype(H,/mob/living/carbon/human)) + if(ishuman(H)) H.apply_effect((rand(15,75)),IRRADIATE,0) if (prob(5)) H.apply_effect((rand(90,150)),IRRADIATE,0) diff --git a/code/game/gamemodes/events/black_hole.dm b/code/game/gamemodes/events/black_hole.dm index 44f6df7005..f378a197f8 100644 --- a/code/game/gamemodes/events/black_hole.dm +++ b/code/game/gamemodes/events/black_hole.dm @@ -8,55 +8,70 @@ density = FALSE anchored = TRUE -/obj/effect/bhole/New() - spawn(4) - controller() +/obj/effect/bhole/Initialize() + . = ..() + addtimer(CALLBACK(src, PROC_REF(controller)), 0.4 SECONDS, TIMER_DELETE_ME) /obj/effect/bhole/proc/controller() - while(src) + if(!isturf(loc)) + qdel(src) + return - if(!isturf(loc)) - qdel(src) - return + //DESTROYING STUFF AT THE EPICENTER + for(var/mob/living/M in orange(1,src)) + qdel(M) + for(var/obj/O in orange(1,src)) + qdel(O) + var/base_turf = get_base_turf_by_area(src) + for(var/turf/simulated/ST in orange(1,src)) + if(ST.type == base_turf) + continue + ST.ChangeTurf(base_turf) + addtimer(CALLBACK(src, PROC_REF(pull_1)), 0.6 SECONDS, TIMER_DELETE_ME) - //DESTROYING STUFF AT THE EPICENTER - for(var/mob/living/M in orange(1,src)) - qdel(M) - for(var/obj/O in orange(1,src)) - qdel(O) - var/base_turf = get_base_turf_by_area(src) - for(var/turf/simulated/ST in orange(1,src)) - if(ST.type == base_turf) - continue - ST.ChangeTurf(base_turf) +/obj/effect/bhole/proc/pull_1() + grav(10, 4, 10, 0) + addtimer(CALLBACK(src, PROC_REF(pull_2)), 0.6 SECONDS, TIMER_DELETE_ME) - sleep(6) - grav(10, 4, 10, 0 ) - sleep(6) - grav( 8, 4, 10, 0 ) - sleep(6) - grav( 9, 4, 10, 0 ) - sleep(6) - grav( 7, 3, 40, 1 ) - sleep(6) - grav( 5, 3, 40, 1 ) - sleep(6) - grav( 6, 3, 40, 1 ) - sleep(6) - grav( 4, 2, 50, 6 ) - sleep(6) - grav( 3, 2, 50, 6 ) - sleep(6) - grav( 2, 2, 75,25 ) - sleep(6) +/obj/effect/bhole/proc/pull_2() + grav(8, 4, 10, 0) + addtimer(CALLBACK(src, PROC_REF(pull_3)), 0.6 SECONDS, TIMER_DELETE_ME) +/obj/effect/bhole/proc/pull_3() + grav(9, 4, 10, 0) + addtimer(CALLBACK(src, PROC_REF(pull_4)), 0.6 SECONDS, TIMER_DELETE_ME) +/obj/effect/bhole/proc/pull_4() + grav(7, 3, 40, 1) + addtimer(CALLBACK(src, PROC_REF(pull_5)), 0.6 SECONDS, TIMER_DELETE_ME) - //MOVEMENT - if( prob(50) ) - src.anchored = FALSE - step(src,pick(alldirs)) - src.anchored = TRUE +/obj/effect/bhole/proc/pull_5() + grav(5, 3, 40, 1) + addtimer(CALLBACK(src, PROC_REF(pull_6)), 0.6 SECONDS, TIMER_DELETE_ME) + +/obj/effect/bhole/proc/pull_6() + grav(6, 3, 40, 1) + addtimer(CALLBACK(src, PROC_REF(pull_7)), 0.6 SECONDS, TIMER_DELETE_ME) + +/obj/effect/bhole/proc/pull_7() + grav(4, 2, 50, 6) + addtimer(CALLBACK(src, PROC_REF(pull_8)), 0.6 SECONDS, TIMER_DELETE_ME) + +/obj/effect/bhole/proc/pull_8() + grav(3, 2, 50, 6) + addtimer(CALLBACK(src, PROC_REF(pull_9)), 0.6 SECONDS, TIMER_DELETE_ME) + +/obj/effect/bhole/proc/pull_9() + grav(2, 2, 75,25) + addtimer(CALLBACK(src, PROC_REF(move)), 0.6 SECONDS, TIMER_DELETE_ME) + +/obj/effect/bhole/proc/move() + //MOVEMENT + if(prob(50)) + anchored = FALSE + step(src, pick(alldirs)) + anchored = TRUE + controller() /obj/effect/bhole/proc/grav(var/r, var/ex_act_force, var/pull_chance, var/turf_removal_chance) if(!isturf(loc)) //blackhole cannot be contained inside anything. Weird stuff might happen diff --git a/code/game/gamemodes/events/dust.dm b/code/game/gamemodes/events/dust.dm index b3728390d0..bcf038693f 100644 --- a/code/game/gamemodes/events/dust.dm +++ b/code/game/gamemodes/events/dust.dm @@ -94,7 +94,7 @@ The "dust" will damage the hull of the station causin minor hull breaches. spawn(0) if(prob(50)) for(var/mob/M in range(10, src)) - if(!M.stat && !istype(M, /mob/living/silicon/ai)) + if(!M.stat && !isAI(M)) shake_camera(M, 3, 1) if (A) playsound(src, 'sound/effects/meteorimpact.ogg', 40, 1) diff --git a/code/game/gamemodes/events/holidays/Christmas.dm b/code/game/gamemodes/events/holidays/Christmas.dm index 8e79379c7f..bb5e9f84e5 100644 --- a/code/game/gamemodes/events/holidays/Christmas.dm +++ b/code/game/gamemodes/events/holidays/Christmas.dm @@ -27,7 +27,7 @@ ..() /obj/item/toy/xmas_cracker/attack(mob/target, mob/user) - if( !cracked && (istype(target,/mob/living/silicon) || (istype(target,/mob/living/carbon/human) && !target.get_active_hand())) && target.stat == CONSCIOUS) + if( !cracked && (issilicon(target) || (ishuman(target) && !target.get_active_hand())) && target.stat == CONSCIOUS) target.visible_message(span_notice("[user] and [target] pop \an [src]! *pop*"), span_notice("You pull \an [src] with [target]! *pop*"), span_notice("You hear a *pop*.")) var/obj/item/paper/Joke = new /obj/item/paper(user.loc) Joke.name = "[pick("awful","terrible","unfunny")] joke" diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index 51e3a508ac..184672cf99 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -397,9 +397,9 @@ var/global/list/additional_antag_types = list() for(var/mob/player in player_list) if(!player.client) continue - if(istype(player, /mob/new_player)) + if(isnewplayer(player)) continue - if(istype(player, /mob/observer/dead) && !ghosts_only) + if(isobserver(player) && !ghosts_only) continue if(!role || (player.client.prefs.be_special & role)) log_debug("[player.key] had [antag_id] enabled, so we are drafting them.") diff --git a/code/game/gamemodes/meme/meme.dm b/code/game/gamemodes/meme/meme.dm index d79e63ad2a..6b03c69545 100644 --- a/code/game/gamemodes/meme/meme.dm +++ b/code/game/gamemodes/meme/meme.dm @@ -133,7 +133,7 @@ /datum/game_mode/meme/check_finished() var/memes_alive = 0 for(var/datum/mind/meme in memes) - if(!istype(meme.current,/mob/living)) + if(!isliving(meme.current)) continue if(meme.current.stat==2) continue diff --git a/code/game/gamemodes/newobjective.dm b/code/game/gamemodes/newobjective.dm index f12840fdf3..80a2b82a1e 100644 --- a/code/game/gamemodes/newobjective.dm +++ b/code/game/gamemodes/newobjective.dm @@ -23,7 +23,7 @@ var/list/datum/objective/assassinate/missions = list() for(var/datum/mind/target in ticker.minds) - if((target != traitor) && istype(target.current, /mob/living/carbon/human)) + if((target != traitor) && ishuman(target.current)) if(target && target.current) var/datum/objective/target_obj = new /datum/objective/assassinate(null,job,target) missions += target_obj @@ -34,7 +34,7 @@ var/list/datum/objective/frame/missions = list() for(var/datum/mind/target in ticker.minds) - if((target != traitor) && istype(target.current, /mob/living/carbon/human)) + if((target != traitor) && ishuman(target.current)) if(target && target.current) var/datum/objective/target_obj = new /datum/objective/frame(null,job,target) missions += target_obj @@ -45,7 +45,7 @@ var/list/datum/objective/frame/missions = list() for(var/datum/mind/target in ticker.minds) - if((target != traitor) && istype(target.current, /mob/living/carbon/human)) + if((target != traitor) && ishuman(target.current)) if(target && target.current) var/datum/objective/target_obj = new /datum/objective/protection(null,job,target) missions += target_obj @@ -388,7 +388,7 @@ datum find_target_by_role(var/role) for(var/datum/mind/possible_target in ticker.minds) - if((possible_target != owner) && istype(possible_target.current, /mob/living/carbon/human) && (possible_target.assigned_role == role)) + if((possible_target != owner) && ishuman(possible_target.current) && (possible_target.assigned_role == role)) target = possible_target break @@ -404,7 +404,7 @@ datum var/list/possible_targets = list() for(var/datum/mind/possible_target in ticker.minds) - if((possible_target != owner) && istype(possible_target.current, /mob/living/carbon/human)) + if((possible_target != owner) && ishuman(possible_target.current)) possible_targets += possible_target if(possible_targets.len > 0) @@ -439,7 +439,7 @@ datum find_target_by_role(var/role) for(var/datum/mind/possible_target in ticker.minds) - if((possible_target != owner) && istype(possible_target.current, /mob/living/carbon/human) && (possible_target.assigned_role == role)) + if((possible_target != owner) && ishuman(possible_target.current) && (possible_target.assigned_role == role)) target = possible_target break @@ -1068,7 +1068,7 @@ datum if(steal_target) for(var/obj/item/aicard/C in owner.current.get_contents()) for(var/mob/living/silicon/ai/M in C) - if(istype(M, /mob/living/silicon/ai) && M.stat != 2) + if(isAI(M) && M.stat != 2) return 1 for(var/mob/living/silicon/ai/M in world) if(istype(M.loc, /turf)) @@ -1336,7 +1336,7 @@ datum var/current_amount var/obj/item/rig/S - if(istype(owner.current,/mob/living/carbon/human)) + if(ishuman(owner.current)) var/mob/living/carbon/human/H = owner.current S = H.back if(!S || !istype(S) || !S.stored_research.len) diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index 1e589f6f13..86bb8176f8 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -142,7 +142,7 @@ var/global/list/all_objectives = list() return target /datum/objective/anti_revolution/demote/check_completion() - if(target && target.current && istype(target,/mob/living/carbon/human)) + if(target && target.current && ishuman(target)) var/obj/item/card/id/I = target.current:wear_id if(istype(I, /obj/item/pda)) var/obj/item/pda/P = I @@ -389,7 +389,7 @@ var/global/list/all_objectives = list() if(already_completed) return 1 - if(target && target.current && istype(target.current, /mob/living/carbon/human)) + if(target && target.current && ishuman(target.current)) if(target.current.stat == DEAD) return 0 @@ -518,7 +518,7 @@ var/global/list/all_objectives = list() for(var/obj/item/aicard/C in all_items) //Check for ai card for(var/mob/living/silicon/ai/M in C) - if(istype(M, /mob/living/silicon/ai) && M.stat != 2) //See if any AI's are alive inside that card. + if(isAI(M) && M.stat != 2) //See if any AI's are alive inside that card. return 1 for(var/mob/living/silicon/ai/ai in mob_list) @@ -558,7 +558,7 @@ var/global/list/all_objectives = list() var/current_amount var/obj/item/rig/S - if(istype(owner.current,/mob/living/carbon/human)) + if(ishuman(owner.current)) var/mob/living/carbon/human/H = owner.current S = H.back diff --git a/code/game/gamemodes/technomancer/catalog.dm b/code/game/gamemodes/technomancer/catalog.dm index 6148f50bbd..f911ee76c8 100644 --- a/code/game/gamemodes/technomancer/catalog.dm +++ b/code/game/gamemodes/technomancer/catalog.dm @@ -279,7 +279,7 @@ var/list/all_technomancer_assistance = subtypesof(/datum/technomancer/assistance if(H.stat || H.restrained()) return - if(!istype(H, /mob/living/carbon/human)) + if(!ishuman(H)) return 1 //why does this return 1? if(H != owner) diff --git a/code/game/gamemodes/technomancer/core_obj.dm b/code/game/gamemodes/technomancer/core_obj.dm index 333b445259..2a59ee8ada 100644 --- a/code/game/gamemodes/technomancer/core_obj.dm +++ b/code/game/gamemodes/technomancer/core_obj.dm @@ -116,7 +116,7 @@ summoned_mobs -= A continue // Now check for dead mobs who shouldn't be on the list. - if(istype(A, /mob/living)) + if(isliving(A)) var/mob/living/L = A if(L.stat == DEAD) summoned_mobs -= L diff --git a/code/game/gamemodes/technomancer/spell_objs_helpers.dm b/code/game/gamemodes/technomancer/spell_objs_helpers.dm index dbcf017dbd..59522593ab 100644 --- a/code/game/gamemodes/technomancer/spell_objs_helpers.dm +++ b/code/game/gamemodes/technomancer/spell_objs_helpers.dm @@ -19,7 +19,7 @@ return 1 if(L.mind && technomancers.is_antagonist(L.mind)) // This should be done better since we might want opposing technomancers later. return 1 - if(istype(L, /mob/living/simple_mob)) // Mind controlled simple mobs count as allies too. + if(isanimal(L)) // Mind controlled simple mobs count as allies too. var/mob/living/simple_mob/SM = L if(owner in SM.friends) return 1 @@ -58,4 +58,4 @@ if(!L.stat) // Don't want to target dead people or SSDs. chosen_target = L break - return chosen_target \ No newline at end of file + return chosen_target diff --git a/code/game/gamemodes/technomancer/spells/abjuration.dm b/code/game/gamemodes/technomancer/spells/abjuration.dm index 732047af58..ed7da4e86c 100644 --- a/code/game/gamemodes/technomancer/spells/abjuration.dm +++ b/code/game/gamemodes/technomancer/spells/abjuration.dm @@ -14,12 +14,12 @@ aspect = ASPECT_TELE /obj/item/spell/abjuration/on_ranged_cast(atom/hit_atom, mob/user) - if(istype(hit_atom, /mob/living) && pay_energy(500) && within_range(hit_atom)) + if(isliving(hit_atom) && pay_energy(500) && within_range(hit_atom)) var/mob/living/L = hit_atom var/mob/living/simple_mob/SM = null //Bit of a roundabout typecheck, in order to test for two variables from two different mob types in one line. - if(istype(L, /mob/living/simple_mob)) + if(isanimal(L)) SM = L if(L.summoned || (SM && SM.supernatural) ) if(L.client) // Player-controlled mobs are immune to being killed by this. diff --git a/code/game/gamemodes/technomancer/spells/apportation.dm b/code/game/gamemodes/technomancer/spells/apportation.dm index b47dc28288..fe9afedea3 100644 --- a/code/game/gamemodes/technomancer/spells/apportation.dm +++ b/code/game/gamemodes/technomancer/spells/apportation.dm @@ -47,7 +47,7 @@ add_attack_logs(user,I,"Stolen with [src]") qdel(src) //Now let's try to teleport a living mob. - else if(istype(hit_atom, /mob/living)) + else if(isliving(hit_atom)) var/mob/living/L = hit_atom to_chat(L, span_danger("You are teleported towards \the [user].")) var/datum/effect/effect/system/spark_spread/s1 = new /datum/effect/effect/system/spark_spread diff --git a/code/game/gamemodes/technomancer/spells/control.dm b/code/game/gamemodes/technomancer/spells/control.dm index 27e9fe5b47..4e8083ceb1 100644 --- a/code/game/gamemodes/technomancer/spells/control.dm +++ b/code/game/gamemodes/technomancer/spells/control.dm @@ -37,7 +37,7 @@ AI.wander = FALSE AI.forget_everything() - if(istype(L, /mob/living/simple_mob)) + if(isanimal(L)) var/mob/living/simple_mob/SM = L SM.friends |= src.owner @@ -55,7 +55,7 @@ AI.wander = initial(AI.wander) AI.forget_everything() - if(istype(L, /mob/living/simple_mob)) + if(isanimal(L)) var/mob/living/simple_mob/SM = L SM.friends -= owner diff --git a/code/game/gamemodes/technomancer/spells/gambit.dm b/code/game/gamemodes/technomancer/spells/gambit.dm index 62c7f9620f..dcd74ab476 100644 --- a/code/game/gamemodes/technomancer/spells/gambit.dm +++ b/code/game/gamemodes/technomancer/spells/gambit.dm @@ -75,7 +75,7 @@ for(var/mob/living/L in view(owner)) // Spiders, carp... bears. - if(istype(L, /mob/living/simple_mob)) + if(isanimal(L)) var/mob/living/simple_mob/SM = L if(!is_ally(SM) && SM.has_AI() && SM.ai_holder.hostile) hostile_mobs++ @@ -83,13 +83,13 @@ potential_spells |= /obj/item/spell/abjuration // Always assume borgs are hostile. - if(istype(L, /mob/living/silicon/robot)) + if(isrobot(L)) if(!istype(L, /mob/living/silicon/robot/drone)) // Drones are okay, however. hostile_mobs++ potential_spells |= /obj/item/spell/projectile/ionic_bolt // Finally we get to humanoids. - if(istype(L, /mob/living/carbon/human)) + if(ishuman(L)) var/mob/living/carbon/human/H = L if(is_ally(H)) // Don't get scared by our apprentice. continue diff --git a/code/game/gamemodes/technomancer/spells/insert/insert.dm b/code/game/gamemodes/technomancer/spells/insert/insert.dm index d882d624b2..ab18c16e3f 100644 --- a/code/game/gamemodes/technomancer/spells/insert/insert.dm +++ b/code/game/gamemodes/technomancer/spells/insert/insert.dm @@ -11,8 +11,8 @@ var/obj/item/inserted_spell/inserting = null var/allow_stacking = 0 -/obj/item/spell/insert/New() - ..() +/obj/item/spell/insert/Initialize() + . = ..() set_light(spell_light_range, spell_light_intensity, l_color = light_color) /obj/item/inserted_spell @@ -49,11 +49,11 @@ qdel(src) /obj/item/spell/insert/on_melee_cast(atom/hit_atom, mob/user) - if(istype(hit_atom, /mob/living)) + if(isliving(hit_atom)) var/mob/living/L = hit_atom insert(L,user) /obj/item/spell/insert/on_ranged_cast(atom/hit_atom, mob/user) - if(istype(hit_atom, /mob/living)) + if(isliving(hit_atom)) var/mob/living/L = hit_atom insert(L,user) diff --git a/code/game/gamemodes/technomancer/spells/modifier/modifier.dm b/code/game/gamemodes/technomancer/spells/modifier/modifier.dm index cca02c4ae3..b462a4a1c8 100644 --- a/code/game/gamemodes/technomancer/spells/modifier/modifier.dm +++ b/code/game/gamemodes/technomancer/spells/modifier/modifier.dm @@ -9,17 +9,17 @@ var/spell_light_intensity = 2 var/spell_light_range = 3 -/obj/item/spell/modifier/New() - ..() +/obj/item/spell/modifier/Initialize() + . = ..() set_light(spell_light_range, spell_light_intensity, l_color = light_color) /obj/item/spell/modifier/on_melee_cast(atom/hit_atom, mob/user) - if(istype(hit_atom, /mob/living)) + if(isliving(hit_atom)) return on_add_modifier(hit_atom) return FALSE /obj/item/spell/modifier/on_ranged_cast(atom/hit_atom, mob/user) - if(istype(hit_atom, /mob/living)) + if(isliving(hit_atom)) return on_add_modifier(hit_atom) return FALSE @@ -38,4 +38,4 @@ // Technomancer specific subtype which keeps track of spell power and gets targeted specificially by Dispel. /datum/modifier/technomancer - var/spell_power = null // Set by on_add_modifier. \ No newline at end of file + var/spell_power = null // Set by on_add_modifier. diff --git a/code/game/gamemodes/technomancer/spells/phase_shift.dm b/code/game/gamemodes/technomancer/spells/phase_shift.dm index e8a39c144b..7811569615 100644 --- a/code/game/gamemodes/technomancer/spells/phase_shift.dm +++ b/code/game/gamemodes/technomancer/spells/phase_shift.dm @@ -15,8 +15,8 @@ cast_methods = CAST_USE aspect = ASPECT_TELE -/obj/item/spell/phase_shift/New() - ..() +/obj/item/spell/phase_shift/Initialize() + . = ..() set_light(3, 2, l_color = "#FA58F4") /obj/effect/phase_shift @@ -28,8 +28,8 @@ /obj/effect/phase_shift/ex_act() return -/obj/effect/phase_shift/New() - ..() +/obj/effect/phase_shift/Initialize() + . = ..() set_light(3, 5, l_color = "#FA58F4") START_PROCESSING(SSobj, src) diff --git a/code/game/gamemodes/technomancer/spells/resurrect.dm b/code/game/gamemodes/technomancer/spells/resurrect.dm index 16a8f9b14f..26dd8644bc 100644 --- a/code/game/gamemodes/technomancer/spells/resurrect.dm +++ b/code/game/gamemodes/technomancer/spells/resurrect.dm @@ -29,7 +29,7 @@ to_chat(user, span_danger("\The [L]'s been dead for too long, even this function cannot replace cloning at this point.")) return 0 to_chat(user, span_notice("You stab \the [L] with a hidden integrated hypo, attempting to bring them back...")) - if(istype(L, /mob/living/simple_mob)) + if(isanimal(L)) var/mob/living/simple_mob/SM = L SM.health = SM.getMaxHealth() / 3 SM.set_stat(CONSCIOUS) diff --git a/code/game/gamemodes/technomancer/spells/spawner/darkness.dm b/code/game/gamemodes/technomancer/spells/spawner/darkness.dm index 0d7d820423..7748470f6f 100644 --- a/code/game/gamemodes/technomancer/spells/spawner/darkness.dm +++ b/code/game/gamemodes/technomancer/spells/spawner/darkness.dm @@ -18,8 +18,8 @@ adjust_instability(4) ..() -/obj/item/spell/spawner/darkness/New() - ..() +/obj/item/spell/spawner/darkness/Initialize() + . = ..() set_light(6, -20, l_color = "#FFFFFF") /obj/effect/temporary_effect/darkness @@ -28,4 +28,4 @@ invisibility = 101 light_range = 6 light_power = -20 - light_on = TRUE \ No newline at end of file + light_on = TRUE diff --git a/code/game/gamemodes/technomancer/spells/spawner/destablize.dm b/code/game/gamemodes/technomancer/spells/spawner/destablize.dm index d491ce60fa..aae1443614 100644 --- a/code/game/gamemodes/technomancer/spells/spawner/destablize.dm +++ b/code/game/gamemodes/technomancer/spells/spawner/destablize.dm @@ -14,8 +14,8 @@ aspect = ASPECT_UNSTABLE spawner_type = /obj/effect/temporary_effect/destablize -/obj/item/spell/spawner/destablize/New() - ..() +/obj/item/spell/spawner/destablize/Initialize() + . = ..() set_light(3, 2, l_color = "#C26DDE") /obj/item/spell/spawner/destablize/on_ranged_cast(atom/hit_atom, mob/user) @@ -51,4 +51,4 @@ var/outgoing_instability = instability_power * ( 1 / (radius**2) ) L.receive_radiated_instability(outgoing_instability) pulses_remaining-- - qdel(src) \ No newline at end of file + qdel(src) diff --git a/code/game/gamemodes/technomancer/spells/spawner/pulsar.dm b/code/game/gamemodes/technomancer/spells/spawner/pulsar.dm index aa30601bcf..e67687aa05 100644 --- a/code/game/gamemodes/technomancer/spells/spawner/pulsar.dm +++ b/code/game/gamemodes/technomancer/spells/spawner/pulsar.dm @@ -13,8 +13,8 @@ aspect = ASPECT_EMP spawner_type = /obj/effect/temporary_effect/pulse/pulsar -/obj/item/spell/spawner/pulsar/New() - ..() +/obj/item/spell/spawner/pulsar/Initialize() + . = ..() set_light(3, 2, l_color = "#2ECCFA") /obj/item/spell/spawner/pulsar/on_ranged_cast(atom/hit_atom, mob/user) @@ -29,6 +29,7 @@ /obj/effect/temporary_effect/pulse var/pulses_remaining = 3 var/pulse_delay = 2 SECONDS + var/pulsetimer /obj/effect/temporary_effect/pulse/Initialize() ..() @@ -37,14 +38,19 @@ /obj/effect/temporary_effect/pulse/LateInitialize() pulse_loop() +/obj/effect/temporary_effect/pulse/Destroy() + deltimer(pulsetimer) + pulsetimer = null + . = ..() + /obj/effect/temporary_effect/pulse/proc/pulse_loop() - set waitfor = FALSE - - while(pulses_remaining) - sleep(pulse_delay) - on_pulse() + + if(pulses_remaining > 0) + pulsetimer = addtimer(CALLBACK(src, PROC_REF(pulse_loop)), pulse_delay, TIMER_STOPPABLE) pulses_remaining-- - qdel(src) + on_pulse() + else + qdel(src) // Override for specific effects. /obj/effect/temporary_effect/pulse/proc/on_pulse() @@ -63,10 +69,3 @@ /obj/effect/temporary_effect/pulse/pulsar/on_pulse() empulse(src, 1, 1, 2, 2, log = 1) - - - - - - - diff --git a/code/game/jobs/job/captain.dm b/code/game/jobs/job/captain.dm index df2ab4c626..433e990800 100644 --- a/code/game/jobs/job/captain.dm +++ b/code/game/jobs/job/captain.dm @@ -26,7 +26,7 @@ var/datum/announcement/minor/captain_announcement = new(do_newscast = 1) min_age_by_species = list(SPECIES_HUMAN_VATBORN = 14) ideal_character_age = 70 // Old geezer captains ftw ideal_age_by_species = list(SPECIES_HUMAN_VATBORN = 55) /// Vatborn live shorter, no other race eligible for captain besides human/skrell - banned_job_species = list(SPECIES_UNATHI, SPECIES_TAJ, SPECIES_DIONA, SPECIES_PROMETHEAN, SPECIES_ZADDAT, "mechanical", "digital") + banned_job_species = list(SPECIES_UNATHI, SPECIES_TAJARAN, SPECIES_DIONA, SPECIES_PROMETHEAN, SPECIES_ZADDAT, "mechanical", "digital") disallow_jobhop = TRUE pto_type = PTO_CIVILIAN diff --git a/code/game/jobs/job_controller.dm b/code/game/jobs/job_controller.dm index 30738ecd45..acb568c6d8 100644 --- a/code/game/jobs/job_controller.dm +++ b/code/game/jobs/job_controller.dm @@ -50,7 +50,7 @@ var/global/datum/controller/occupations/job_master var/datum/job/job = GetJob(rank) if(!job) return 0 - if((job.minimum_character_age || job.min_age_by_species) && (player.client.prefs.age < job.get_min_age(player.client.prefs.species, player.client.prefs.organ_data["brain"]))) + if((job.minimum_character_age || job.min_age_by_species) && (player.read_preference(/datum/preference/numeric/human/age) < job.get_min_age(player.client.prefs.species, player.client.prefs.organ_data["brain"]))) return 0 if(jobban_isbanned(player, rank)) return 0 @@ -93,7 +93,7 @@ var/global/datum/controller/occupations/job_master if(!job.player_old_enough(player.client)) Debug("FOC player not old enough, Player: [player]") continue - if(job.minimum_character_age && (player.client.prefs.age < job.get_min_age(player.client.prefs.species, player.client.prefs.organ_data["brain"]))) + if(job.minimum_character_age && (player.read_preference(/datum/preference/numeric/human/age) < job.get_min_age(player.client.prefs.species, player.client.prefs.organ_data["brain"]))) Debug("FOC character not old enough, Player: [player]") continue //VOREStation Code Start @@ -121,7 +121,7 @@ var/global/datum/controller/occupations/job_master if(!job) continue - if((job.minimum_character_age || job.min_age_by_species) && (player.client.prefs.age < job.get_min_age(player.client.prefs.species, player.client.prefs.organ_data["brain"]))) + if((job.minimum_character_age || job.min_age_by_species) && (player.read_preference(/datum/preference/numeric/human/age) < job.get_min_age(player.client.prefs.species, player.client.prefs.organ_data["brain"]))) continue if(job.is_species_banned(player.client.prefs.species, player.client.prefs.organ_data["brain"]) == TRUE) @@ -180,7 +180,7 @@ var/global/datum/controller/occupations/job_master for(var/mob/V in candidates) // Log-out during round-start? What a bad boy, no head position for you! if(!V.client) continue - var/age = V.client.prefs.age + var/age = V.read_preference(/datum/preference/numeric/human/age) if(age < job.get_min_age(V.client.prefs.species, V.client.prefs.organ_data["brain"])) // Nope. continue @@ -660,16 +660,16 @@ var/global/datum/controller/occupations/job_master fail_deadly = J?.offmap_spawn //Spawn them at their preferred one - if(C && C.prefs.spawnpoint) - if(!(C.prefs.spawnpoint in using_map.allowed_spawns)) + if(C && C.prefs.read_preference(/datum/preference/choiced/living/spawnpoint)) + if(!(C.prefs.read_preference(/datum/preference/choiced/living/spawnpoint) in using_map.allowed_spawns)) if(fail_deadly) to_chat(C, span_warning("Your chosen spawnpoint is unavailable for this map and your job requires a specific spawnpoint. Please correct your spawn point choice.")) return else - to_chat(C, span_warning("Your chosen spawnpoint ([C.prefs.spawnpoint]) is unavailable for the current map. Spawning you at one of the enabled spawn points instead.")) + to_chat(C, span_warning("Your chosen spawnpoint ([C.prefs.read_preference(/datum/preference/choiced/living/spawnpoint)]) is unavailable for the current map. Spawning you at one of the enabled spawn points instead.")) spawnpos = null else - spawnpos = spawntypes[C.prefs.spawnpoint] + spawnpos = spawntypes[C.prefs.read_preference(/datum/preference/choiced/living/spawnpoint)] //We will return a list key'd by "turf" and "msg" . = list("turf","msg") diff --git a/code/game/machinery/Beacon.dm b/code/game/machinery/Beacon.dm index fbb71dc9f0..6f8ec101af 100644 --- a/code/game/machinery/Beacon.dm +++ b/code/game/machinery/Beacon.dm @@ -10,8 +10,8 @@ idle_power_usage = 0 var/obj/item/radio/beacon/Beacon -/obj/machinery/bluespace_beacon/New() - ..() +/obj/machinery/bluespace_beacon/Initialize(mapload) + . = ..() var/turf/T = src.loc Beacon = new /obj/item/radio/beacon Beacon.invisibility = INVISIBILITY_MAXIMUM @@ -48,4 +48,4 @@ if(Beacon.loc != src.loc) Beacon.loc = src.loc - update_icon() \ No newline at end of file + update_icon() diff --git a/code/game/machinery/CableLayer.dm b/code/game/machinery/CableLayer.dm index e13944eb9a..aedbb035f3 100644 --- a/code/game/machinery/CableLayer.dm +++ b/code/game/machinery/CableLayer.dm @@ -8,9 +8,9 @@ var/max_cable = 100 var/on = 0 -/obj/machinery/cablelayer/New() - cable = new(src, 100) - ..() +/obj/machinery/cablelayer/Initialize() + cable = new(src, max_cable) + . = ..() /obj/machinery/cablelayer/Moved(atom/old_loc, direction, forced = FALSE) . = ..() diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm index 9535ddac85..9f7fbe5441 100644 --- a/code/game/machinery/adv_med.dm +++ b/code/game/machinery/adv_med.dm @@ -565,8 +565,8 @@ circuit = /obj/item/circuitboard/scanner_console var/printing = null -/obj/machinery/body_scanconsole/New() - ..() +/obj/machinery/body_scanconsole/Initialize(mapload) + . = ..() findscanner() /obj/machinery/body_scanconsole/Destroy() diff --git a/code/game/machinery/ai_slipper.dm b/code/game/machinery/ai_slipper.dm index afbe5c334d..d307576da2 100644 --- a/code/game/machinery/ai_slipper.dm +++ b/code/game/machinery/ai_slipper.dm @@ -14,8 +14,8 @@ var/cooldown_on = 0 req_access = list(access_ai_upload) -/obj/machinery/ai_slipper/New() - ..() +/obj/machinery/ai_slipper/Initialize(mapload) + . = ..() update_icon() /obj/machinery/ai_slipper/power_change() diff --git a/code/game/machinery/airconditioner_vr.dm b/code/game/machinery/airconditioner_vr.dm index 9385e408b2..62926eb9e9 100644 --- a/code/game/machinery/airconditioner_vr.dm +++ b/code/game/machinery/airconditioner_vr.dm @@ -20,8 +20,8 @@ var/target_temp = T20C var/mode = MODE_IDLE -/obj/machinery/power/thermoregulator/New() - ..() +/obj/machinery/power/thermoregulator/Initialize(mapload) + . = ..() default_apply_parts() /obj/machinery/power/thermoregulator/examine(mob/user) diff --git a/code/game/machinery/atm_ret_field.dm b/code/game/machinery/atm_ret_field.dm index 96f1500a9f..b0d8fcd6c2 100644 --- a/code/game/machinery/atm_ret_field.dm +++ b/code/game/machinery/atm_ret_field.dm @@ -81,6 +81,7 @@ return /obj/machinery/atmospheric_field_generator/perma/Initialize() + . = ..() generate_field() /obj/machinery/atmospheric_field_generator/update_icon() diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm index 7271b01ff8..7847acc627 100644 --- a/code/game/machinery/atmoalter/canister.dm +++ b/code/game/machinery/atmoalter/canister.dm @@ -261,7 +261,7 @@ update_flag src.add_fingerprint(user) healthcheck() - if(istype(user, /mob/living/silicon/robot) && istype(W, /obj/item/tank/jetpack)) + if(isrobot(user) && istype(W, /obj/item/tank/jetpack)) var/datum/gas_mixture/thejetpack = W:air_contents var/env_pressure = thejetpack.return_pressure() var/pressure_delta = min(10*ONE_ATMOSPHERE - env_pressure, (air_contents.return_pressure() - env_pressure)/2) diff --git a/code/game/machinery/atmoalter/meter.dm b/code/game/machinery/atmoalter/meter.dm index 7dfea2a592..f325c5ba93 100644 --- a/code/game/machinery/atmoalter/meter.dm +++ b/code/game/machinery/atmoalter/meter.dm @@ -79,7 +79,7 @@ /obj/machinery/meter/examine(mob/user) . = ..() - if(get_dist(user, src) > 3 && !(istype(user, /mob/living/silicon/ai) || istype(user, /mob/observer/dead))) + if(get_dist(user, src) > 3 && !(isAI(user) || isobserver(user))) . += span_warning("You are too far away to read it.") else if(stat & (NOPOWER|BROKEN)) @@ -96,7 +96,7 @@ /obj/machinery/meter/Click() - if(istype(usr, /mob/living/carbon/human) || istype(usr, /mob/living/silicon/ai)) // ghosts can call ..() for examine + if(ishuman(usr) || isAI(usr)) // ghosts can call ..() for examine var/mob/living/L = usr if(!L.get_active_hand() || !L.Adjacent(src)) usr.examinate(src) diff --git a/code/game/machinery/bioprinter.dm b/code/game/machinery/bioprinter.dm index 6fda6f6ae7..a527114b32 100644 --- a/code/game/machinery/bioprinter.dm +++ b/code/game/machinery/bioprinter.dm @@ -338,7 +338,7 @@ var/matter_amount_per_sheet = 10 var/matter_type = MAT_STEEL -/obj/machinery/organ_printer/robot/full/New() +/obj/machinery/organ_printer/robot/full/Initialize() . = ..() stored_matter = max_stored_matter diff --git a/code/game/machinery/bomb_tester_vr.dm b/code/game/machinery/bomb_tester_vr.dm index 6e59c56844..baa6c6633a 100644 --- a/code/game/machinery/bomb_tester_vr.dm +++ b/code/game/machinery/bomb_tester_vr.dm @@ -32,8 +32,8 @@ var/datum/gas_mixture/faketank var/faketank_integrity -/obj/machinery/bomb_tester/New() - ..() +/obj/machinery/bomb_tester/Initialize(mapload) + . = ..() default_apply_parts() RefreshParts() faketank = new diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 1f89fdbe98..6aa664a089 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -185,7 +185,7 @@ else assembly.state = 1 to_chat(user, span_notice("You cut \the [src] free from the wall.")) - new /obj/item/stack/cable_coil(src.loc, length=2) + new /obj/item/stack/cable_coil(src.loc, 2) assembly = null //so qdel doesn't eat it. qdel(src) @@ -244,7 +244,7 @@ /obj/machinery/camera/proc/deactivate(user as mob, var/choice = 1) // The only way for AI to reactivate cameras are malf abilities, this gives them different messages. - if(istype(user, /mob/living/silicon/ai)) + if(isAI(user)) user = null if(choice != 1) @@ -393,7 +393,7 @@ return 0 /obj/machinery/camera/interact(mob/living/user as mob) - if(!panel_open || istype(user, /mob/living/silicon/ai)) + if(!panel_open || isAI(user)) return if(stat & BROKEN) diff --git a/code/game/machinery/camera/motion.dm b/code/game/machinery/camera/motion.dm index 00bfeb09cc..aebee15e3c 100644 --- a/code/game/machinery/camera/motion.dm +++ b/code/game/machinery/camera/motion.dm @@ -25,7 +25,7 @@ lostTarget(target) /obj/machinery/camera/proc/newTarget(var/mob/target) - if (istype(target, /mob/living/silicon/ai)) return 0 + if (isAI(target)) return 0 if (detectTime == 0) detectTime = world.time // start the clock if (!(target in motionTargets)) @@ -59,4 +59,3 @@ if (!area_motion) if(isliving(AM)) newTarget(AM) - diff --git a/code/game/machinery/camera/tracking.dm b/code/game/machinery/camera/tracking.dm index 80f65a3c22..efb35e92b5 100644 --- a/code/game/machinery/camera/tracking.dm +++ b/code/game/machinery/camera/tracking.dm @@ -119,7 +119,7 @@ else TB.names.Add(name) TB.namecounts[name] = 1 - if(istype(M, /mob/living/carbon/human)) + if(ishuman(M)) TB.humans[name] = M else TB.others[name] = M diff --git a/code/game/machinery/cell_charger.dm b/code/game/machinery/cell_charger.dm index 4ff9a5c540..b33f05c16b 100644 --- a/code/game/machinery/cell_charger.dm +++ b/code/game/machinery/cell_charger.dm @@ -100,7 +100,7 @@ update_icon() /obj/machinery/cell_charger/attack_ai(mob/user) - if(istype(user, /mob/living/silicon/robot) && Adjacent(user)) // Borgs can remove the cell if they are near enough + if(isrobot(user) && Adjacent(user)) // Borgs can remove the cell if they are near enough if(charging) user.visible_message("[user] removes [charging] from [src].", "You remove [charging] from [src].") charging.loc = src.loc diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index ac0d7bc590..d7576fdae4 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -14,7 +14,7 @@ if((M.stat != 2) || (!M.client)) continue //They need a brain! - if(istype(M, /mob/living/carbon/human)) + if(ishuman(M)) var/mob/living/carbon/human/H = M if(!H.has_brain()) continue @@ -456,8 +456,8 @@ icon_state = "pod_g" -/obj/machinery/clonepod/full/New() - ..() +/obj/machinery/clonepod/full/Initialize() + . = ..() for(var/i = 1 to container_limit) containers += new /obj/item/reagent_containers/glass/bottle/biomass(src) diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm index 50e439b75e..088444aa53 100644 --- a/code/game/machinery/computer/arcade.dm +++ b/code/game/machinery/computer/arcade.dm @@ -500,7 +500,7 @@ if(severity >= 3) //you didn't pray hard enough to_chat(M, span_warning("An overpowering wave of nausea consumes over you. You hunch over, your stomach's contents preparing for a spectacular exit.")) spawn(30) - if(istype(M,/mob/living/carbon/human)) + if(ishuman(M)) var/mob/living/carbon/human/H = M H.vomit() if(ORION_TRAIL_FLUX) diff --git a/code/game/machinery/computer/card.dm b/code/game/machinery/computer/card.dm index 77f9ce12c0..c4dd7558dc 100644 --- a/code/game/machinery/computer/card.dm +++ b/code/game/machinery/computer/card.dm @@ -42,13 +42,13 @@ if(scan) to_chat(usr, "You remove \the [scan] from \the [src].") scan.forceMove(get_turf(src)) - if(!usr.get_active_hand() && istype(usr,/mob/living/carbon/human)) + if(!usr.get_active_hand() && ishuman(usr)) usr.put_in_hands(scan) scan = null else if(modify) to_chat(usr, "You remove \the [modify] from \the [src].") modify.forceMove(get_turf(src)) - if(!usr.get_active_hand() && istype(usr,/mob/living/carbon/human)) + if(!usr.get_active_hand() && ishuman(usr)) usr.put_in_hands(modify) modify = null else diff --git a/code/game/machinery/computer/guestpass.dm b/code/game/machinery/computer/guestpass.dm index ddb74b6ad6..b8ad3ddba3 100644 --- a/code/game/machinery/computer/guestpass.dm +++ b/code/game/machinery/computer/guestpass.dm @@ -136,7 +136,7 @@ if(giver) to_chat(usr, span_notice("You remove \the [giver] from \the [src].")) giver.loc = get_turf(src) - if(!usr.get_active_hand() && istype(usr,/mob/living/carbon/human)) + if(!usr.get_active_hand() && ishuman(usr)) usr.put_in_hands(giver) else giver.loc = src.loc diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index afc2640e43..66601e8a08 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -78,7 +78,7 @@ if(scan) to_chat(usr, "You remove \the [scan] from \the [src].") scan.loc = get_turf(src) - if(!usr.get_active_hand() && istype(usr,/mob/living/carbon/human)) + if(!usr.get_active_hand() && ishuman(usr)) usr.put_in_hands(scan) scan = null else diff --git a/code/game/machinery/computer/message.dm b/code/game/machinery/computer/message.dm index fb49f1ca0f..ffe823cb71 100644 --- a/code/game/machinery/computer/message.dm +++ b/code/game/machinery/computer/message.dm @@ -146,7 +146,7 @@ sendPDAs["[P.name]"] = "\ref[P]" data["possibleRecipients"] = sendPDAs - data["isMalfAI"] = ((istype(user, /mob/living/silicon/ai) || istype(user, /mob/living/silicon/robot)) && (user.mind.special_role && user.mind.original == user)) + data["isMalfAI"] = ((isAI(user) || isrobot(user)) && (user.mind.special_role && user.mind.original == user)) return data @@ -211,7 +211,7 @@ temp = noserver //Hack the Console to get the password if("hack") - if((istype(ui.user, /mob/living/silicon/ai) || istype(ui.user, /mob/living/silicon/robot)) && (ui.user.mind.special_role && ui.user.mind.original == ui.user)) + if((isAI(ui.user) || isrobot(ui.user)) && (ui.user.mind.special_role && ui.user.mind.original == ui.user)) hacking = 1 update_icon() //Time it takes to bruteforce is dependant on the password length. diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index 86d6842df8..b695eb3617 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -66,7 +66,7 @@ if(scan) to_chat(usr, "You remove \the [scan] from \the [src].") scan.loc = get_turf(src) - if(!usr.get_active_hand() && istype(usr,/mob/living/carbon/human)) + if(!usr.get_active_hand() && ishuman(usr)) usr.put_in_hands(scan) scan = null else diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index 1619659f04..6d24d496ea 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -339,6 +339,9 @@ //Lifted from Unity stasis.dm and refactored. ~Zuhayr /obj/machinery/cryopod/process() if(occupant) + if(occupant.loc != src) + go_out(TRUE) + return //Allow a ten minute gap between entering the pod and actually despawning. if(world.time - time_entered < time_till_despawn) return @@ -654,12 +657,12 @@ for(var/obj/machinery/gateway/G in range(1,src)) G.icon_state = "on" -/obj/machinery/cryopod/robot/door/gateway/go_out() - ..() +/obj/machinery/cryopod/robot/door/gateway/go_out(var/skip_move = FALSE) + ..(skip_move) for(var/obj/machinery/gateway/G in range(1,src)) G.icon_state = "off" -/obj/machinery/cryopod/proc/go_out() +/obj/machinery/cryopod/proc/go_out(var/skip_move = FALSE) if(!occupant) return @@ -667,8 +670,8 @@ if(occupant.client) occupant.client.eye = occupant.client.mob occupant.client.perspective = MOB_PERSPECTIVE - - occupant.forceMove(get_turf(src)) + if(!skip_move) + occupant.forceMove(get_turf(src)) if(ishuman(occupant) && applies_stasis) var/mob/living/carbon/human/H = occupant H.Stasis(0) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 54eda82f72..3ff1d2d90c 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -88,7 +88,7 @@ ..() /obj/machinery/door/airlock/attack_alien(var/mob/user) //Familiar, right? Doors. -Mechoid - if(istype(user, /mob/living/carbon/human)) + if(ishuman(user)) var/mob/living/carbon/human/X = user if(istype(X.species, /datum/species/xenos)) if(src.locked || src.welded) @@ -997,7 +997,7 @@ About the new airlock wires panel: else to_chat(user, span_warning("[hold_open] is holding \the [src] open!")) - if(istype(user, /mob/living/carbon/human)) + if(ishuman(user)) var/mob/living/carbon/human/X = user if(istype(X.species, /datum/species/xenos)) src.attack_alien(user) @@ -1167,7 +1167,7 @@ About the new airlock wires panel: src.add_fingerprint(user) if (attempt_vr(src,"attackby_vr",list(C, user))) return - if(istype(C, /mob/living)) + if(isliving(C)) ..() return //VOREstation Edit: Removing material cost from repair requirements diff --git a/code/game/machinery/doors/blast_door.dm b/code/game/machinery/doors/blast_door.dm index 8caed89c56..7da07fa04c 100644 --- a/code/game/machinery/doors/blast_door.dm +++ b/code/game/machinery/doors/blast_door.dm @@ -139,7 +139,7 @@ //Proc: attack_hand //Description: Attacked with empty hand. Only to allow special attack_bys. /obj/machinery/door/blast/attack_hand(mob/user as mob) - if(istype(user, /mob/living/carbon/human)) + if(ishuman(user)) var/mob/living/carbon/human/X = user if(istype(X.species, /datum/species/xenos)) src.attack_alien(user) @@ -217,7 +217,7 @@ // Parameters: Attacking Xeno mob. // Description: Forces open the door after a delay. /obj/machinery/door/blast/attack_alien(var/mob/user) //Familiar, right? Doors. - if(istype(user, /mob/living/carbon/human)) + if(ishuman(user)) var/mob/living/carbon/human/X = user if(istype(X.species, /datum/species/xenos)) if(src.density) diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 8055af222c..334879e54c 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -126,7 +126,7 @@ else do_animate("deny") - if(istype(AM, /mob/living/bot)) + if(isbot(AM)) var/mob/living/bot/bot = AM if(src.check_access(bot.botcard)) if(density) diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index 4502ed9334..7f961c86c8 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -136,7 +136,7 @@ if(operating) return//Already doing something. - if(istype(user, /mob/living/carbon/human)) + if(ishuman(user)) var/mob/living/carbon/human/X = user if(istype(X.species, /datum/species/xenos)) src.attack_alien(user) @@ -193,7 +193,7 @@ close() /obj/machinery/door/firedoor/attack_alien(var/mob/user) //Familiar, right? Doors. - if(istype(user, /mob/living/carbon/human)) + if(ishuman(user)) var/mob/living/carbon/human/X = user if(istype(X.species, /datum/species/xenos)) if(src.blocked) diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index 5117401535..07fb154cbf 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -152,7 +152,7 @@ /obj/machinery/door/window/attack_hand(mob/user as mob) src.add_fingerprint(user) - if(istype(user,/mob/living/carbon/human)) + if(ishuman(user)) var/mob/living/carbon/human/H = user if(H.species.can_shred(H)) playsound(src, 'sound/effects/Glasshit.ogg', 75, 1) diff --git a/code/game/machinery/fire_alarm.dm b/code/game/machinery/fire_alarm.dm index 7a5d4ffc17..22da386180 100644 --- a/code/game/machinery/fire_alarm.dm +++ b/code/game/machinery/fire_alarm.dm @@ -233,7 +233,7 @@ Just a object used in constructing fire alarms ASSERT(isarea(A)) var/d1 var/d2 - if(istype(user, /mob/living/carbon/human) || istype(user, /mob/living/silicon/ai)) + if(ishuman(user) || isAI(user)) if(A.party) d1 = text("No Party :(", src) @@ -284,7 +284,7 @@ Just a object used in constructing fire alarms ..() if(usr.stat || stat & (BROKEN|NOPOWER)) return - if((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon/ai))) + if((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(loc, /turf))) || (isAI(usr))) usr.machine = src if(href_list["reset"]) reset() diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm index ed53a6e439..48f5929442 100644 --- a/code/game/machinery/flasher.dm +++ b/code/game/machinery/flasher.dm @@ -67,7 +67,7 @@ continue var/flash_time = strength - if(istype(O, /mob/living/carbon/human)) + if(ishuman(O)) var/mob/living/carbon/human/H = O //VOREStation Edit Start if(H.nif && H.nif.flag_check(NIF_V_FLASHPROT,NIF_FLAGS_VISION)) @@ -103,7 +103,7 @@ if(iscarbon(AM)) var/mob/living/carbon/M = AM - if(M.m_intent != "walk") + if(M.m_intent != I_WALK) flash() /obj/machinery/flasher/portable/attackby(obj/item/W as obj, mob/user as mob) diff --git a/code/game/machinery/floodlight.dm b/code/game/machinery/floodlight.dm index 54447f264a..00f4e192f9 100644 --- a/code/game/machinery/floodlight.dm +++ b/code/game/machinery/floodlight.dm @@ -65,7 +65,7 @@ visible_message("\The [src] shuts down.") /obj/machinery/floodlight/attack_ai(mob/user as mob) - if(istype(user, /mob/living/silicon/robot) && Adjacent(user)) + if(isrobot(user) && Adjacent(user)) return attack_hand(user) if(on) diff --git a/code/game/machinery/igniter.dm b/code/game/machinery/igniter.dm index 4f45449a16..2e7a4e7aa4 100755 --- a/code/game/machinery/igniter.dm +++ b/code/game/machinery/igniter.dm @@ -30,9 +30,9 @@ location.hotspot_expose(1000,500,1) return 1 -/obj/machinery/igniter/New() - ..() +/obj/machinery/igniter/Initialize(mapload) icon_state = "igniter[on]" + . = ..() /obj/machinery/igniter/power_change() ..() @@ -58,9 +58,6 @@ idle_power_usage = 2 active_power_usage = 4 -/obj/machinery/sparker/New() - ..() - /obj/machinery/sparker/power_change() ..() if(!(stat & NOPOWER) && disable == 0) diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm index f38e2e08cc..af1eb2270e 100644 --- a/code/game/machinery/iv_drip.dm +++ b/code/game/machinery/iv_drip.dm @@ -153,7 +153,7 @@ set name = "Toggle Mode" set src in view(1) - if(!istype(usr, /mob/living)) + if(!isliving(usr)) to_chat(usr, span_warning("You can't do that.")) return diff --git a/code/game/machinery/magnet.dm b/code/game/machinery/magnet.dm index 0061137038..a9296866bb 100644 --- a/code/game/machinery/magnet.dm +++ b/code/game/machinery/magnet.dm @@ -171,7 +171,7 @@ step_towards(M, center) for(var/mob/living/silicon/S in orange(magnetic_field, center)) - if(istype(S, /mob/living/silicon/ai)) continue + if(isAI(S)) continue step_towards(S, center) use_power(electricity_level * 5) diff --git a/code/game/machinery/mass_driver.dm b/code/game/machinery/mass_driver.dm index a344167c4a..2bdae67c85 100644 --- a/code/game/machinery/mass_driver.dm +++ b/code/game/machinery/mass_driver.dm @@ -16,7 +16,7 @@ var/id = 1.0 var/drive_range = 50 //this is mostly irrelevant since current mass drivers throw into space, but you could make a lower-range mass driver for interstation transport or something I guess. -/obj/machinery/mass_driver/New() +/obj/machinery/mass_driver/Initialize(mapload) . = ..() default_apply_parts() diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm index fa4b720467..0523b47f9f 100644 --- a/code/game/machinery/navbeacon.dm +++ b/code/game/machinery/navbeacon.dm @@ -18,8 +18,8 @@ var/global/list/navbeacons = list() // no I don't like putting this in, but it w var/list/codes = list() // assoc. list of transponder codes req_access = list(access_engine) -/obj/machinery/navbeacon/New() - ..() +/obj/machinery/navbeacon/Initialize(mapload) + . = ..() set_codes_from_txt(codes_txt) if(freq) warning("[src] at [x],[y],[z] has deprecated var freq=[freq]. Replace it with proper type.") @@ -237,6 +237,6 @@ Transponder Codes: