diff --git a/.github/workflows/changelog_generation.yml b/.github/workflows/changelog_generation.yml index 992e18f08e7c0..3cb1a9f44c74c 100644 --- a/.github/workflows/changelog_generation.yml +++ b/.github/workflows/changelog_generation.yml @@ -16,13 +16,13 @@ jobs: if: github.repository == 'SierraBay/SierraBay12' # to prevent this running on forks steps: - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 with: fetch-depth: 0 # Otherwise, we will fail to push refs ref: dev-sierra token: ${{ secrets.BOT_TOKEN }} - name: Python setup - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c + uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d with: python-version: '3.x' - name: Install depends diff --git a/.github/workflows/check_changelog.yml b/.github/workflows/check_changelog.yml index 4bb5b04d6d0b4..dcf2227a109d2 100644 --- a/.github/workflows/check_changelog.yml +++ b/.github/workflows/check_changelog.yml @@ -19,7 +19,7 @@ jobs: wget https://raw.githubusercontent.com/SierraBay/SierraBay12/dev-sierra/tools/changelog/sierra_check_changelog.py wget https://raw.githubusercontent.com/SierraBay/SierraBay12/dev-sierra/tools/changelog/tags.yml - name: Установка Python - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c + uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d with: python-version: '3.x' - name: Установка зависимостей diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 31de297979eee..b13b7a88ebea6 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -39,7 +39,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000000000..35007aa131107 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,43 @@ +name: Deploy + +concurrency: + group: deploy + +on: + workflow_dispatch: + inputs: + # ci_required: + # description: 'CI Suite is required' + # type: boolean + # required: true + # default: true + perform_deploy_sierra: + description: 'Deploy SierraBay' + type: boolean + required: true + default: true + +jobs: + # CI: + # uses: ./.github/workflows/ci.yml # use the callable tests job to run tests + # if: ${{ inputs.ci_required }} + + deploy-sierra: + name: Deploy SierraBay + runs-on: ubuntu-latest + # needs: [CI] + if: always() && !cancelled() && !failure() && inputs.perform_deploy_sierra + + steps: + - name: Update and Build SierraBay + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.PRODUCTION_HOST }} + username: ${{ secrets.PRODUCTION_USERNAME }} + key: ${{ secrets.PRODUCTION_SSH_KEY }} + passphrase: ${{ secrets.PRODUCTION_SSH_KEY_PASS }} + script: | + TIME=$(date +'%Y-%m-%d%T') + sudo systemctl --wait start deploy-sierrabay + journalctl --since $TIME -u deploy-sierrabay --no-pager --all + systemctl is-failed deploy-sierrabay | grep -q "failed" && echo "Deployment Failed!" && exit 1 || exit 0 diff --git a/.github/workflows/generate_documentation.yml b/.github/workflows/generate_documentation.yml index 633cec026317b..0e37feaa618f5 100644 --- a/.github/workflows/generate_documentation.yml +++ b/.github/workflows/generate_documentation.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 - name: paths-filter uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 id: filter @@ -37,9 +37,9 @@ jobs: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 - name: Setup Cache - uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 with: path: ~/spaceman_dmm/${{ env.SPACEMAN_DMM_VERSION }} key: ${{ runner.os }}-spacemandmm-${{ env.SPACEMAN_DMM_VERSION }} @@ -49,7 +49,7 @@ jobs: run: | ~/dmdoc - name: Deploy - uses: JamesIves/github-pages-deploy-action@65b5dfd4f5bcd3a7403bbc2959c144256167464e + uses: JamesIves/github-pages-deploy-action@5c6e9e9f3672ce8fd37b9856193d2a537941e66c with: token: ${{ secrets.GITHUB_TOKEN }} branch: gh-pages diff --git a/.github/workflows/make_changelogs.yml b/.github/workflows/make_changelogs.yml index ed085bb746494..7a4d67bca12be 100644 --- a/.github/workflows/make_changelogs.yml +++ b/.github/workflows/make_changelogs.yml @@ -16,11 +16,11 @@ jobs: if: github.repository == 'SierraBay/SierraBay12' # to prevent this running on forks steps: - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 with: fetch-depth: 25 - name: Python setup - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c + uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d with: python-version: '3.x' - name: Install depends diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 57a4196cb18fa..5eb77b99f6d43 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 - name: paths-filter uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 id: filter @@ -32,9 +32,9 @@ jobs: needs: PreFlight if: needs.PreFlight.outputs.dm == 'true' steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 - name: Setup Cache - uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 with: path: ~/spaceman_dmm/${{ env.SPACEMAN_DMM_VERSION }} key: ${{ runner.os }}-spacemandmm-${{ env.SPACEMAN_DMM_VERSION }} @@ -60,9 +60,9 @@ jobs: - DreamChecker if: needs.PreFlight.outputs.dm == 'true' steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 - name: Setup Cache - uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 with: path: ~/BYOND-${{ env.BYOND_MAJOR }}.${{ env.BYOND_MINOR }} key: ${{ runner.os }}-byond-${{ env.BYOND_MAJOR }}-${{ env.BYOND_MINOR }} @@ -90,16 +90,16 @@ jobs: - DreamChecker if: needs.PreFlight.outputs.dm == 'true' steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 - name: Setup Cache - uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 with: path: ~/BYOND-${{ env.BYOND_MAJOR }}.${{ env.BYOND_MINOR }} key: ${{ runner.os }}-byond-${{ env.BYOND_MAJOR }}-${{ env.BYOND_MINOR }} - name: Install rust_g dependencies run: ./scripts/install-rust_g-dependencies.sh - name: Setup rust_g cache - uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 with: path: ~/.byond/bin/librust_g.so key: "rust_g-${{ env.RUST_G_REPO }}-${{ env.RUST_G_VERSION }}" @@ -128,16 +128,16 @@ jobs: - DreamChecker if: needs.PreFlight.outputs.dm == 'true' steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 - name: Setup Cache - uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 with: path: ~/BYOND-${{ env.BYOND_MAJOR }}.${{ env.BYOND_MINOR }} key: ${{ runner.os }}-byond-${{ env.BYOND_MAJOR }}-${{ env.BYOND_MINOR }} - name: Install rust_g dependencies run: ./scripts/install-rust_g-dependencies.sh - name: Setup rust_g cache - uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 with: path: ~/.byond/bin/librust_g.so key: "rust_g-${{ env.RUST_G_REPO }}-${{ env.RUST_G_VERSION }}" @@ -166,16 +166,16 @@ jobs: - DreamChecker if: needs.PreFlight.outputs.dm == 'true' steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 - name: Setup Cache - uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 with: path: ~/BYOND-${{ env.BYOND_MAJOR }}.${{ env.BYOND_MINOR }} key: ${{ runner.os }}-byond-${{ env.BYOND_MAJOR }}-${{ env.BYOND_MINOR }} - name: Install rust_g dependencies run: ./scripts/install-rust_g-dependencies.sh - name: Setup rust_g cache - uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 with: path: ~/.byond/bin/librust_g.so key: "rust_g-${{ env.RUST_G_REPO }}-${{ env.RUST_G_VERSION }}" diff --git a/baystation12.dme b/baystation12.dme index 337852f8f4554..2a8c5729dd4ea 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -269,6 +269,7 @@ #include "code\datums\browser.dm" #include "code\datums\callbacks.dm" #include "code\datums\category.dm" +#include "code\datums\chat_message.dm" #include "code\datums\cinematic.dm" #include "code\datums\datum.dm" #include "code\datums\footsteps.dm" @@ -1686,6 +1687,7 @@ #include "code\modules\clothing\under\accessories\fire_overpants.dm" #include "code\modules\clothing\under\accessories\flannel_shirt.dm" #include "code\modules\clothing\under\accessories\ftu_pin.dm" +#include "code\modules\clothing\under\accessories\goggle_mods.dm" #include "code\modules\clothing\under\accessories\hawaii.dm" #include "code\modules\clothing\under\accessories\helmcover.dm" #include "code\modules\clothing\under\accessories\helmet_decor.dm" @@ -2320,6 +2322,7 @@ #include "code\modules\mob\living\silicon\robot\modules\module_uncertified.dm" #include "code\modules\mob\living\simple_animal\combat.dm" #include "code\modules\mob\living\simple_animal\defense.dm" +#include "code\modules\mob\living\simple_animal\kamerr.dm" #include "code\modules\mob\living\simple_animal\life.dm" #include "code\modules\mob\living\simple_animal\natural_weapons.dm" #include "code\modules\mob\living\simple_animal\shade.dm" @@ -2945,7 +2948,6 @@ #include "code\modules\reagents\reagent_containers\food\snacks.dm" #include "code\modules\reagents\reagent_containers\food\sushi.dm" #include "code\modules\reagents\reagent_containers\food\drinks\bottle.dm" -#include "code\modules\reagents\reagent_containers\food\drinks\jar.dm" #include "code\modules\reagents\reagent_containers\food\snacks\bugmeat.dm" #include "code\modules\reagents\reagent_containers\food\snacks\cheese.dm" #include "code\modules\reagents\reagent_containers\food\snacks\donkpocket.dm" @@ -3367,6 +3369,7 @@ #include "mods\_master_files\code\modules\power\gravitygenerator.dm" #include "mods\_master_files\code\modules\projectiles\projectile\bullets.dm" #include "mods\_master_files\code\modules\species\station\adherent.dm" +#include "mods\_master_files\code\modules\species\station\machine.dm" #include "mods\_master_files\maps\mapsystem\maps.dm" #include "mods\_master_files\maps\sierra\sierra_ranks.dm" #include "mods\_master_files\maps\sierra\items\rigs.dm" diff --git a/code/__defines/__renderer.dm b/code/__defines/__renderer.dm index 7a5cc1db9d3d6..7a40a8468e666 100644 --- a/code/__defines/__renderer.dm +++ b/code/__defines/__renderer.dm @@ -161,6 +161,8 @@ #define HUD_ABOVE_ITEM_LAYER 4 #define HUD_ABOVE_HUD_LAYER 5 +#define RUNECHAT_PLANE 7 + /// This plane masks out lighting, to create an "emissive" effect for e.g glowing screens in otherwise dark areas. #define EMISSIVE_PLANE 10 #define EMISSIVE_TARGET "*emissive" diff --git a/code/__defines/_renderer.dm b/code/__defines/_renderer.dm index 8b8ff9d110fb6..1c21dc8050aa9 100644 --- a/code/__defines/_renderer.dm +++ b/code/__defines/_renderer.dm @@ -220,6 +220,10 @@ GLOBAL_LIST_EMPTY(zmimic_renderers) group = RENDER_GROUP_SCREEN plane = HUD_PLANE +/atom/movable/renderer/runechat + name = "Runechat" + group = RENDER_GROUP_SCREEN + plane = RUNECHAT_PLANE /* * * Group renderers diff --git a/code/__defines/byond_tracy.dm b/code/__defines/byond_tracy.dm index 78f56bd20dac9..457636d295f5f 100644 --- a/code/__defines/byond_tracy.dm +++ b/code/__defines/byond_tracy.dm @@ -27,5 +27,5 @@ if(UNIX) lib = "libprof.so" else CRASH("Tracy initialization failed: unsupported platform or DLL not found.") - var/init = call_ext(lib, "init")() + var/init = CALL_EXT(lib, "init")() if("0" != init) CRASH("[lib] init error: [init]") diff --git a/code/__defines/culture.dm b/code/__defines/culture.dm index 2e30757565782..136e7d57bb58b 100644 --- a/code/__defines/culture.dm +++ b/code/__defines/culture.dm @@ -40,7 +40,8 @@ #define HOME_SYSTEM_MARS "Mars" #define HOME_SYSTEM_VENUS "Venus" #define HOME_SYSTEM_CERES "Ceres" -#define HOME_SYSTEM_PLUTO "Pluto" +#define HOME_SYSTEM_KUIPERB "Kuiper, Belt" +#define HOME_SYSTEM_KUIPERD "Kuiper, Interdust" #define HOME_SYSTEM_TAU_CETI "Ceti Epsilon" #define HOME_SYSTEM_HELIOS "Eos" #define HOME_SYSTEM_TERRA "Terra" @@ -67,7 +68,9 @@ #define CULTURE_HUMAN_VENUSIAN "Venusian, Zoner" #define CULTURE_HUMAN_VENUSLOW "Venusian, Surfacer" #define CULTURE_HUMAN_BELTER "Belter, Ceres" -#define CULTURE_HUMAN_PLUTO "Plutonian" +#define CULTURE_HUMAN_KUIPERI "Kuiper, Insider" +#define CULTURE_HUMAN_KUIPERO "Kuiper, Outsider" +#define CULTURE_HUMAN_MAGNITKA "Magnitkan" #define CULTURE_HUMAN_EARTH "Earther" #define CULTURE_HUMAN_CETIN "Cetite, Northern" #define CULTURE_HUMAN_CETIS "Cetite, Southern" @@ -83,8 +86,8 @@ #define CULTURE_HUMAN_SPACER "Spacer" #define CULTURE_HUMAN_OFFWORLD "Offworlder" #define CULTURE_HUMAN_SOLCOL "Solar-Colonial" -#define CULTURE_HUMAN_CONFEDC "Terran, Core Systems" -#define CULTURE_HUMAN_CONFEDO "Terran, Outer Systems" +#define CULTURE_HUMAN_CONFEDC "Confederate, Core Systems" +#define CULTURE_HUMAN_CONFEDO "Confederate, Outer Systems" #define CULTURE_HUMAN_GAIAN "Gaian" #define CULTURE_HUMAN_OTHER "Other, Humanity" #define CULTURE_STARLIGHT "Starlit Realms" diff --git a/code/__defines/flags.dm b/code/__defines/flags.dm index dc6ae948143a4..c76811c423ac7 100644 --- a/code/__defines/flags.dm +++ b/code/__defines/flags.dm @@ -24,7 +24,7 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204 #define ATOM_AWAITING_OVERLAY_UPDATE FLAG(10) #define MOVABLE_FLAG_PROXMOVE FLAG(0) // Does this object require proximity checking in Enter()? -#define MOVABLE_FLAG_Z_INTERACT FLAG(1) // Should attackby and attack_hand be relayed through ladders and open spaces? +#define MOVABLE_FLAG_Z_INTERACT FLAG(1) // Should use_tool and attack_hand be relayed through ladders and open spaces? #define MOVABLE_FLAG_EFFECTMOVE FLAG(2) // Is this an effect that should move? #define OBJ_FLAG_ANCHORABLE FLAG(0) // This object can be stuck in place with a tool @@ -81,3 +81,7 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204 #define OVERMAP_SECTOR_IN_SPACE FLAG(2) /// If the sector is untargetable by missiles. #define OVERMAP_SECTOR_UNTARGETABLE FLAG(3) + + +/// For mob/living/ignore_hazard_flags. When set, shards do not damage the mob. +var/global/const/HAZARD_FLAG_SHARD = FLAG(0) diff --git a/code/__defines/guns.dm b/code/__defines/guns.dm index f6df203f5cdc9..45e59257ae097 100644 --- a/code/__defines/guns.dm +++ b/code/__defines/guns.dm @@ -3,6 +3,7 @@ #define CALIBER_PISTOL_MAGNUM "15mm" #define CALIBER_PISTOL_FLECHETTE "4mm" #define CALIBER_PISTOL_ANTIQUE "~10mm" +#define CALIBER_PISTOL_FAST "5.7mmP" #define CALIBER_RIFLE "5mmR" #define CALIBER_RIFLE_MILITARY "7mmR" diff --git a/code/__defines/items_clothing.dm b/code/__defines/items_clothing.dm index 029c6e5cb8cb7..a0212eba18f02 100644 --- a/code/__defines/items_clothing.dm +++ b/code/__defines/items_clothing.dm @@ -35,7 +35,9 @@ #define ACCESSORY_SLOT_ARMOR_M "Misc armor" #define ACCESSORY_SLOT_HELM_C "Helmet cover" #define ACCESSORY_SLOT_HELM_D "Helmet decor" - +#define ACCESSORY_SLOT_VISOR "Helmet visor" +#define ACCESSORY_SLOT_VISION "Vision modification" +#define ACCESSORY_SLOT_HUD "HUD modification" #define ACCESSORY_REMOVABLE FLAG(0) #define ACCESSORY_HIDDEN FLAG(1) diff --git a/code/__defines/lists.dm b/code/__defines/lists.dm index a32c0b6c74795..a68a36e4885cf 100644 --- a/code/__defines/lists.dm +++ b/code/__defines/lists.dm @@ -29,7 +29,12 @@ #define LAZYMERGELIST(L1, L2) if (length(L2)) { if (!L1) { L1 = list() } L1 |= L2 } // Reads L or an empty list if L is not a list. Note: Does NOT assign, L may be an expression. #define SANITIZE_LIST(L) ( islist(L) ? L : list() ) - +///This is used to add onto lazy assoc list when the value you're adding is a /list/. This one has extra safety over lazyaddassoc because the value could be null (and thus cant be used to += objects) +#define LAZYADDASSOCLIST(L, K, V) if(!L) { L = list(); } L[K] += list(V); +// Adds to the item K the value V, if the list is null it will initialize it +#define LAZYADDASSOC(L, K, V) if(!L) { L = list(); } L[K] += V; +// Removes the value V from the item K, if the item K is empty will remove it from the list, if the list is empty will set the list to null +#define LAZYREMOVEASSOC(L, K, V) if(L) { if(L[K]) { L[K] -= V; if(!length(L[K])) L -= K; } if(!length(L)) L = null; } /**** * Binary search sorted insert diff --git a/code/__defines/proc_presets.dm b/code/__defines/proc_presets.dm index 0577213357e83..8268469f0150d 100644 --- a/code/__defines/proc_presets.dm +++ b/code/__defines/proc_presets.dm @@ -1 +1 @@ -#define MERGE_ASSOCS_WITH_NUM_VALUES(a, b) merge_assoc_lists(a, b, /proc/assoc_merge_add, 1) +#define MERGE_ASSOCS_WITH_NUM_VALUES(a, b) merge_assoc_lists(a, b, GLOBAL_PROC_REF(assoc_merge_add), 1) diff --git a/code/__defines/~mods/expanded_culture_descriptor.dm b/code/__defines/~mods/expanded_culture_descriptor.dm index fbe058c80e4d9..db3742724681f 100644 --- a/code/__defines/~mods/expanded_culture_descriptor.dm +++ b/code/__defines/~mods/expanded_culture_descriptor.dm @@ -16,6 +16,7 @@ #define FACTION_ZPCI "Zone Protection Control Inc." #define FACTION_SEPTENERGO "SeptEnergo" +#define CULTURE_HUMAN_PLUTO "Plutonian" #define CULTURE_HUMAN_LORRIMAN "Lorrimanian" #define CULTURE_HUMAN_AVANOBLE "Avalon Noble" #define CULTURE_HUMAN_AVACOMMON "Avalon Commoner" @@ -24,6 +25,7 @@ #define CULTURE_HUMAN_MIRANIAN "Miranian" #define CULTURE_HUMAN_NYXIAN "Nyxian" +#define HOME_SYSTEM_PLUTO "Pluto" #define HOME_SYSTEM_TERSTEN "Tersten" #define HOME_SYSTEM_AVALON "Avalon" #define HOME_SYSTEM_MIRANIA "Mirania" diff --git a/code/__defines/~mods/~master_defines.dm b/code/__defines/~mods/~master_defines.dm index b8cb9f2cc1b0a..a56f067ae074a 100644 --- a/code/__defines/~mods/~master_defines.dm +++ b/code/__defines/~mods/~master_defines.dm @@ -24,7 +24,7 @@ // DON_LOADOUT - Start // Не открывать до Рождества -/* + #define DONATION_TIER_NONE null #define DONATION_TIER_ONE "Tier 1" #define DONATION_TIER_TWO "Tier 2" @@ -43,7 +43,7 @@ DONATION_TIER_NONE, DONATION_TIER_ONE, \ DONATION_TIER_TWO, DONATION_TIER_THREE, \ DONATION_TIER_FOUR, DONATION_TIER_ADMIN) -*/ + // DON_LOADOUT - End // GLIDING - Start @@ -56,9 +56,30 @@ // IPC_COOLING_UNIT - Start #define BP_COOLING "cooling system" +#define BP_EXONET "exonet connection slot" // IPC_COOLING_UNIT - End // RESOMI - Start #define SPECIES_RESOMI "Resomi" #define LANGUAGE_RESOMI "Schechi" // RESOMI - End + +// ERIS_ANNOUNCER - Start +///Announcer audio keys +#define ANNOUNCER_ALIENS 'mods/eris_announcer/sound/announcements/life_signatures.ogg' +#define ANNOUNCER_METEORS 'mods/eris_announcer/sound/announcements/meteors_1.ogg' +#define ANNOUNCER_OUTBREAK5 'mods/eris_announcer/sound/announcements/biohazard_level_5.ogg' +#define ANNOUNCER_OUTBREAK7 'mods/eris_announcer/sound/announcements/biohazard_level_7.ogg' +#define ANNOUNCER_POWEROFF 'mods/eris_announcer/sound/announcements/electricity_off.ogg' +#define ANNOUNCER_POWERON 'mods/eris_announcer/sound/announcements/electricity_on.ogg' +#define ANNOUNCER_RADIATION 'mods/eris_announcer/sound/announcements/radiation.ogg' +#define ANNOUNCER_SPANOMALIES 'mods/eris_announcer/sound/announcements/anomaly_gravity.ogg' +#define ANNOUNCER_WELCOME 'mods/eris_announcer/sound/announcements/welcome_1.ogg' +#define ANNOUNCER_COMMANDREPORT 'mods/eris_announcer/sound/announcements/command_report.ogg' +#define ANNOUNCER_ABANDONSHIP 'mods/eris_announcer/sound/announcements/evacuation.ogg' +#define ANNOUNCER_ELECTRICALSTORM_MOD 'mods/eris_announcer/sound/announcements/electrical_storm_normal.ogg' +#define ANNOUNCER_ELECTRICALSTORM_MAJ 'mods/eris_announcer/sound/announcements/electrical_storm_high.ogg' +#define ANNOUNCER_BLUESPACEJUMP_INIT 'mods/eris_announcer/sound/announcements/bluespacejump_initialization.ogg' +#define ANNOUNCER_BLUESPACEJUMP_PREP 'mods/eris_announcer/sound/announcements/bluespacejump_prepare.ogg' +#define ANNOUNCER_BLUESPACEJUMP_START 'mods/eris_announcer/sound/announcements/bluespacejump_start.ogg' +// ERIS_ANNOUNCER - End diff --git a/code/_global_vars/edible.dm b/code/_global_vars/edible.dm index 185ab9e0cd3ae..9129b082bdf6a 100644 --- a/code/_global_vars/edible.dm +++ b/code/_global_vars/edible.dm @@ -4,7 +4,10 @@ GLOBAL_LIST_INIT(proteinbar_flavors, list( /datum/reagent/drink/juice/apple, /datum/reagent/drink/juice/pear ), - "banana nut" = /datum/reagent/drink/juice/banana, + "banana nut" = list( + /datum/reagent/drink/juice/banana, + /datum/reagent/nutriment/almondmeal + ), "cappuccino" = list( /datum/reagent/nutriment/coffee, /datum/reagent/drink/milk @@ -34,5 +37,9 @@ GLOBAL_LIST_INIT(proteinbar_flavors, list( "magical melons" = list( /datum/reagent/drink/juice/melon ), - "mixed berry" = /datum/reagent/drink/juice/berry + "mixed berry" = /datum/reagent/drink/juice/berry, + "peanut crunch" = list( + /datum/reagent/nutriment/peanutbutter, + /datum/reagent/nutriment/groundpeanuts + ) )) diff --git a/code/_helpers/areas.dm b/code/_helpers/areas.dm index a37e8ae422216..da9280ffbfd14 100644 --- a/code/_helpers/areas.dm +++ b/code/_helpers/areas.dm @@ -1,7 +1,7 @@ /* List generation helpers */ -/proc/get_filtered_areas(list/predicates = list(/proc/is_area_with_turf)) +/proc/get_filtered_areas(list/predicates = list(GLOBAL_PROC_REF(is_area_with_turf))) RETURN_TYPE(/list) . = list() if(!predicates) @@ -80,13 +80,13 @@ area_predicates = area_predicates.Copy() var/z_levels = GetConnectedZlevels(z_level) - area_predicates[/proc/area_belongs_to_zlevels] = z_levels + area_predicates[GLOBAL_PROC_REF(area_belongs_to_zlevels)] = z_levels return pick_area_and_turf(area_predicates, turf_predicates) /proc/pick_area_turf_in_single_z_level(list/area_predicates, list/turf_predicates, z_level) RETURN_TYPE(/turf) area_predicates = area_predicates.Copy() - area_predicates[/proc/area_belongs_to_zlevels] = list(z_level) + area_predicates[GLOBAL_PROC_REF(area_belongs_to_zlevels)] = list(z_level) return pick_area_and_turf(area_predicates, turf_predicates) /* @@ -125,17 +125,17 @@ /proc/is_coherent_area(area/A) return !is_type_in_list(A, GLOB.using_map.area_coherency_test_exempt_areas) -GLOBAL_LIST_INIT(is_station_but_not_space_or_shuttle_area, list(/proc/is_station_area, /proc/is_not_space_area, /proc/is_not_shuttle_area)) +GLOBAL_LIST_INIT(is_station_but_not_space_or_shuttle_area, list(GLOBAL_PROC_REF(is_station_area), GLOBAL_PROC_REF(is_not_space_area), GLOBAL_PROC_REF(is_not_shuttle_area))) -GLOBAL_LIST_INIT(is_contact_but_not_space_or_shuttle_area, list(/proc/is_contact_area, /proc/is_not_space_area, /proc/is_not_shuttle_area)) +GLOBAL_LIST_INIT(is_contact_but_not_space_or_shuttle_area, list(GLOBAL_PROC_REF(is_contact_area), GLOBAL_PROC_REF(is_not_space_area), GLOBAL_PROC_REF(is_not_shuttle_area))) -GLOBAL_LIST_INIT(is_player_but_not_space_or_shuttle_area, list(/proc/is_player_area, /proc/is_not_space_area, /proc/is_not_shuttle_area)) +GLOBAL_LIST_INIT(is_player_but_not_space_or_shuttle_area, list(GLOBAL_PROC_REF(is_player_area), GLOBAL_PROC_REF(is_not_space_area), GLOBAL_PROC_REF(is_not_shuttle_area))) -GLOBAL_LIST_INIT(is_station_area, list(/proc/is_station_area)) +GLOBAL_LIST_INIT(is_station_area, list(GLOBAL_PROC_REF(is_station_area))) -GLOBAL_LIST_INIT(is_station_and_maint_area, list(/proc/is_station_area, /proc/is_maint_area)) +GLOBAL_LIST_INIT(is_station_and_maint_area, list(GLOBAL_PROC_REF(is_station_area), GLOBAL_PROC_REF(is_maint_area))) -GLOBAL_LIST_INIT(is_station_but_not_maint_area, list(/proc/is_station_area, /proc/is_not_maint_area)) +GLOBAL_LIST_INIT(is_station_but_not_maint_area, list(GLOBAL_PROC_REF(is_station_area), GLOBAL_PROC_REF(is_not_maint_area))) /* Misc Helpers diff --git a/code/_helpers/cmp.dm b/code/_helpers/cmp.dm index b7a5f4b4ed04b..b4411397cbcfd 100644 --- a/code/_helpers/cmp.dm +++ b/code/_helpers/cmp.dm @@ -52,9 +52,6 @@ /proc/cmp_ruincost_priority(datum/map_template/ruin/A, datum/map_template/ruin/B) return initial(A.spawn_cost) - initial(B.spawn_cost) -/proc/cmp_clientcolor_priority(datum/client_color/A, datum/client_color/B) - return B.priority - A.priority - /proc/cmp_power_component_priority(obj/item/stock_parts/power/A, obj/item/stock_parts/power/B) return B.priority - A.priority diff --git a/code/_helpers/game.dm b/code/_helpers/game.dm index c9d3ddc17d0dd..1d9b45918116a 100644 --- a/code/_helpers/game.dm +++ b/code/_helpers/game.dm @@ -581,6 +581,27 @@ viewY = totalviewrange else var/list/viewrangelist = splittext(view,"x") + if(length(viewrangelist) != 2) + stack_trace("For some reason, client view is not represented as standard values or is null: [view]") + viewX = 19 + viewY = 15 + viewX = text2num(viewrangelist[1]) viewY = text2num(viewrangelist[2]) return list(viewX, viewY) + +/proc/get_view_size_x(view) + var/list/view_size = getviewsize(view) + return view_size[1] + +/proc/get_view_size_y(view) + var/list/view_size = getviewsize(view) + return view_size[2] + +/proc/get_lesser_view_size_component(view) + var/list/view_size = getviewsize(view) + return min(view_size[1], view_size[2]) + +/proc/get_greater_view_size_component(view) + var/list/view_size = getviewsize(view) + return max(view_size[1], view_size[2]) diff --git a/code/_helpers/global_lists.dm b/code/_helpers/global_lists.dm index cfd3fcf1145ab..2d64eb17617d6 100644 --- a/code/_helpers/global_lists.dm +++ b/code/_helpers/global_lists.dm @@ -176,8 +176,8 @@ var/global/list/string_slot_flags = list( //*** params cache var/global/list/paramslist_cache = list() -#define cached_key_number_decode(key_number_data) cached_params_decode(key_number_data, /proc/key_number_decode) -#define cached_number_list_decode(number_list_data) cached_params_decode(number_list_data, /proc/number_list_decode) +#define cached_key_number_decode(key_number_data) cached_params_decode(key_number_data, GLOBAL_PROC_REF(key_number_decode)) +#define cached_number_list_decode(number_list_data) cached_params_decode(number_list_data, GLOBAL_PROC_REF(number_list_decode)) /proc/cached_params_decode(params_data, decode_proc) . = paramslist_cache[params_data] diff --git a/code/_helpers/lists.dm b/code/_helpers/lists.dm index b1525ebd0301d..1da8edf278d86 100644 --- a/code/_helpers/lists.dm +++ b/code/_helpers/lists.dm @@ -279,17 +279,19 @@ Checks if a list has the same entries and values as an element of big. output += L[i] return output -//Randomize: Return the list in a random order -/proc/shuffle(list/L) + +/// Returns a Fisher-Yates shuffled copy of list, or list itself if in_place. +/proc/shuffle(list/list, in_place) RETURN_TYPE(/list) - if(!L) + if (!islist(list)) return + if (!in_place) + list = list.Copy() + var/size = length(list) + for (var/i = 1 to size) + list.Swap(i, rand(i, size)) + return list - L = L.Copy() - - for(var/i=1; i= 2) fromIndex = fromIndex % length(L) diff --git a/code/_helpers/text.dm b/code/_helpers/text.dm index ff37f28eb5b45..bd715c4ddedf7 100644 --- a/code/_helpers/text.dm +++ b/code/_helpers/text.dm @@ -451,6 +451,7 @@ t = replacetext(t, "\[ouerelogo\]", "") t = replacetext(t, "\[terstenlogo\]", "") // [/SIERRA-ADD] + t = replacetext(t, "\[zhlogo\]", "") t = replacetext(t, "\[editorbr\]", "") return t @@ -523,6 +524,7 @@ t = replacetext(t, "", "\[ouerelogo\]") t = replacetext(t, "", "\[terstenlogo\]") // [/SIERRA-ADD] + t = replacetext(t, "", "\[field\]") t = replacetext(t, "R E D A C T E D", "\[redacted\]") t = strip_html_properly(t) diff --git a/code/_macros.dm b/code/_macros.dm index 6a1ce3fc97dfc..95218be150f0d 100644 --- a/code/_macros.dm +++ b/code/_macros.dm @@ -160,7 +160,7 @@ #define QDEL_NULL(x) if(x) { qdel(x) ; x = null } -#define QDEL_IN(item, time) addtimer(new Callback(item, /datum/proc/qdel_self), time, TIMER_STOPPABLE) +#define QDEL_IN(item, time) addtimer(new Callback(item, TYPE_PROC_REF(/datum, qdel_self)), time, TIMER_STOPPABLE) #define DROP_NULL(x) if(x) { x.dropInto(loc); x = null; } diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index 49f3f5149c73c..1b04a5563aa7f 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -355,7 +355,8 @@ /mob/observer/ghost/TurfAdjacent(turf/T) if(!isturf(loc) || !client) return FALSE - return z == T.z && (get_dist(loc, T) <= client.view) + + return z == T.z && (get_dist(loc, T) <= get_view_size_x(client.view)) /** * Called when the mob ctrl+shift+clicks on an atom. By default, calls the atom's `CtrlShiftClick()` proc. diff --git a/code/_onclick/click_handling.dm b/code/_onclick/click_handling.dm index 839479bb93876..00828a111ca9a 100644 --- a/code/_onclick/click_handling.dm +++ b/code/_onclick/click_handling.dm @@ -26,11 +26,11 @@ var/global/const/CLICK_HANDLER_ALL = ( CLICK_HANDLER_REMOVE_ON_ ..() src.user = user if(flags & (CLICK_HANDLER_REMOVE_ON_MOB_LOGOUT)) - GLOB.logged_out_event.register(user, src, /datum/click_handler/proc/OnMobLogout) + GLOB.logged_out_event.register(user, src, TYPE_PROC_REF(/datum/click_handler, OnMobLogout)) /datum/click_handler/Destroy() if(flags & (CLICK_HANDLER_REMOVE_ON_MOB_LOGOUT)) - GLOB.logged_out_event.unregister(user, src, /datum/click_handler/proc/OnMobLogout) + GLOB.logged_out_event.unregister(user, src, TYPE_PROC_REF(/datum/click_handler, OnMobLogout)) user = null . = ..() diff --git a/code/_onclick/hud/ability_screen_objects.dm b/code/_onclick/hud/ability_screen_objects.dm index 731503e8a5068..7b07703e89c74 100644 --- a/code/_onclick/hud/ability_screen_objects.dm +++ b/code/_onclick/hud/ability_screen_objects.dm @@ -136,9 +136,9 @@ return A return null -/obj/screen/movable/ability_master/proc/get_ability_by_proc_ref(proc_ref) +/obj/screen/movable/ability_master/proc/get_ability_by_PROC_REF(PROC_REF) for(var/obj/screen/ability/verb_based/V in ability_objects) - if(V.verb_to_call == proc_ref) + if(V.verb_to_call == PROC_REF) return V return null @@ -155,11 +155,6 @@ return S return null -/mob/Login() - ..() - if(ability_master) - ability_master.update_abilities(1, src) - ability_master.toggle_open(1) /mob/Initialize() . = ..() @@ -241,7 +236,7 @@ message_admins("ERROR: add_verb_ability() was not given an object in its arguments.") if(!verb_given) message_admins("ERROR: add_verb_ability() was not given a verb/proc in its arguments.") - if(get_ability_by_proc_ref(verb_given)) + if(get_ability_by_PROC_REF(verb_given)) return // Duplicate var/obj/screen/ability/verb_based/A = new /obj/screen/ability/verb_based() A.ability_master = src @@ -265,7 +260,7 @@ message_admins("ERROR: add_ling_ability() was not given an object in its arguments.") if(!verb_given) message_admins("ERROR: add_ling_ability() was not given a verb/proc in its arguments.") - if(get_ability_by_proc_ref(verb_given)) + if(get_ability_by_PROC_REF(verb_given)) return // Duplicate var/obj/screen/ability/verb_based/changeling/A = new /obj/screen/ability/verb_based/changeling() A.ability_master = src diff --git a/code/_onclick/hud/fullscreen.dm b/code/_onclick/hud/fullscreen.dm index 93ec4dc55a163..ee93dea90e40e 100644 --- a/code/_onclick/hud/fullscreen.dm +++ b/code/_onclick/hud/fullscreen.dm @@ -23,6 +23,14 @@ screens[category] = screen if(client && (stat != DEAD || screen.allstate)) + if(screen.scale_to_view) + var/list/viewsize = getviewsize(client.view) + var/scale_x = viewsize[1] / (480 / world.icon_size) + var/scale_y = viewsize[2] / (480 / world.icon_size) + var/matrix/M = matrix() + M.Scale(scale_x, scale_y) + screen.transform = M + client.screen += screen return screen @@ -68,6 +76,8 @@ mouse_opacity = 0 var/severity = 0 var/allstate = 0 //shows if it should show up for dead people too + /// If the fullscreen image should be scaled client view wise + var/scale_to_view = FALSE /obj/screen/fullscreen/Destroy() severity = 0 @@ -76,18 +86,22 @@ /obj/screen/fullscreen/brute icon_state = "brutedamageoverlay" layer = DAMAGE_LAYER + scale_to_view = TRUE /obj/screen/fullscreen/oxy icon_state = "oxydamageoverlay" layer = DAMAGE_LAYER + scale_to_view = TRUE /obj/screen/fullscreen/crit icon_state = "passage" layer = CRIT_LAYER + scale_to_view = TRUE /obj/screen/fullscreen/blind icon_state = "blackimageoverlay" layer = BLIND_LAYER + scale_to_view = TRUE /obj/screen/fullscreen/blackout icon = 'icons/mob/screen1.dmi' @@ -98,6 +112,7 @@ /obj/screen/fullscreen/impaired icon_state = "impairedoverlay" layer = IMPAIRED_LAYER + scale_to_view = TRUE /obj/screen/fullscreen/blurry icon = 'icons/mob/screen1.dmi' @@ -144,7 +159,9 @@ /obj/screen/fullscreen/fishbed icon_state = "fishbed" allstate = 1 + scale_to_view = TRUE /obj/screen/fullscreen/pain icon_state = "brutedamageoverlay6" alpha = 0 + scale_to_view = TRUE diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index f08a3b163cb06..3dc005d02518a 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -176,9 +176,9 @@ to_chat(usr, SPAN_WARNING("Inventory hiding is currently only supported for human mobs, sorry.")) return - if(!client) return - if(client.view != world.view) + if(!client) return + if(hud_used.hud_shown) hud_used.hud_shown = 0 if(src.hud_used.adding) @@ -233,8 +233,6 @@ return if(!client) return - if(client.view != world.view) - return if(hud_used.hud_shown) hud_used.hud_shown = 0 diff --git a/code/_onclick/hud/movable_screen_objects.dm b/code/_onclick/hud/movable_screen_objects.dm index bcdcf97562a18..6bb954ff40cf9 100644 --- a/code/_onclick/hud/movable_screen_objects.dm +++ b/code/_onclick/hud/movable_screen_objects.dm @@ -79,7 +79,7 @@ . = "CENTER" /obj/screen/movable/proc/decode_screen_Y(Y, mob/viewer) - var/view = viewer.client ? viewer.client.view : world.view + var/view = viewer.client ? get_view_size_y(viewer.client.view) : world.view if(findtext(Y,"NORTH-")) var/num = text2num(copytext(Y,7)) //Trim NORTH- if(!num) diff --git a/code/_onclick/hud/pai.dm b/code/_onclick/hud/pai.dm index 4feaab3cebc64..27271ff66cf29 100644 --- a/code/_onclick/hud/pai.dm +++ b/code/_onclick/hud/pai.dm @@ -22,8 +22,24 @@ using.SetName("Toggle Light") adding += using + //Intent + using = new /obj/screen() + using.SetName("act_intent") + using.set_dir(SOUTHWEST) + using.icon = 'icons/mob/screen1_robot.dmi' + using.icon_state = mymob.a_intent + using.screen_loc = ui_acti + adding += using + action_intent = using + + // Limb Targeting + mymob.zone_sel = new /obj/screen/zone_sel() + mymob.zone_sel.icon = 'icons/mob/screen1_robot.dmi' + mymob.zone_sel.ClearOverlays() + mymob.zone_sel.AddOverlays(image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]")) mymob.client.screen = list() mymob.client.screen += adding + mymob.client.screen += mymob.zone_sel inventory_shown = 0 /obj/screen/pai @@ -32,7 +48,7 @@ /obj/screen/pai/Click() if(!isobserver(usr) && (!usr.incapacitated() || usr.resting)) OnClick() - + /obj/screen/pai/proc/OnClick() /obj/screen/pai/software @@ -101,4 +117,4 @@ var/stat_silicon_subsystem/SSS = pAI.silicon_subsystems_by_name[ss_name] if(istype(SSS)) - SSS.Click() \ No newline at end of file + SSS.Click() diff --git a/code/_onclick/hud/skybox.dm b/code/_onclick/hud/skybox.dm index e4f93a2f617da..b76299aac836c 100644 --- a/code/_onclick/hud/skybox.dm +++ b/code/_onclick/hud/skybox.dm @@ -1,31 +1,60 @@ +#define SKYBOX_DIMENSION 736 + /obj/skybox name = "skybox" mouse_opacity = 0 anchored = TRUE simulated = FALSE - screen_loc = "CENTER:-224,CENTER:-224" + screen_loc = "CENTER,CENTER" plane = SKYBOX_PLANE + var/dimension_x = SKYBOX_DIMENSION + var/dimension_y = SKYBOX_DIMENSION /client var/obj/skybox/skybox +/client/proc/update_skybox_offsets() + if(!skybox) + update_skybox(TRUE) + return + + var/list/viewsize = getviewsize(view) + var/view_x = viewsize[1] + var/view_y = viewsize[2] + skybox.screen_loc = "CENTER:-[((view_x - 1) / 2) * world.icon_size],CENTER:-[((view_y - 1) / 2) * world.icon_size]" + skybox.dimension_x = SKYBOX_DIMENSION - (view_x * world.icon_size) + skybox.dimension_y = SKYBOX_DIMENSION - (view_y * world.icon_size) + + update_skybox() + /client/proc/update_skybox(rebuild) + var/turf/T = get_turf(eye) + if(!T) + return + if(!skybox) skybox = new() screen += skybox - rebuild = 1 + rebuild = TRUE + + if(rebuild) + skybox.ClearOverlays() + skybox.AddOverlays(SSskybox.get_skybox(T.z)) + screen |= skybox + update_skybox_offsets() + return + + var/matrix/M = matrix() + var/x_translate = -((T.x/world.maxx)) * skybox.dimension_x + var/y_translate = -((T.y/world.maxy)) * skybox.dimension_y + M.Translate(x_translate, y_translate) + skybox.transform = M + +/client/proc/deferred_skybox_update(rebuild) + set waitfor = FALSE + sleep(1) + update_skybox(rebuild) - var/turf/T = get_turf(eye) - if(T) - if(rebuild) - skybox.ClearOverlays() - skybox.AddOverlays(SSskybox.get_skybox(T.z)) - screen |= skybox - skybox.screen_loc = "CENTER:[-224 - T.x],CENTER:[-224 - T.y]" - -/mob/Login() - ..() - client.update_skybox(1) /mob/Move() var/old_z = get_z(src) diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index 3b29ff50a7ffa..8e2210475c668 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -5,7 +5,7 @@ These are the default click code call sequences used when clicking on stuff with Atoms: mob/ClickOn() calls the item's resolve_attackby() proc. -item/resolve_attackby() calls the target atom's attackby() proc. +item/resolve_attackby() calls the target atom's use_tool() proc. Mobs: @@ -34,7 +34,7 @@ avoid code duplication. This includes items that may sometimes act as a standard /** * Called when the item is in the active hand and another atom is clicked. This is generally called by `ClickOn()`. * - * This passes down to `use_before()`, `use_weapon()`, `use_tool()`, `attackby()`, and then use_after() in that order, + * This passes down to `use_before()`, `use_weapon()`, `use_tool()`, and then use_after() in that order, * depending on item flags and user's intent. * use_grab() is run in an override of resolve_attackby() processed at the grab's level, and is not part of this chain. * @@ -59,9 +59,6 @@ avoid code duplication. This includes items that may sometimes act as a standard if (!.) use_call = "tool" . = atom.use_tool(src, user, click_params) - if (!.) - use_call = "attackby" - . = atom.attackby(src, user, click_params) if (!.) use_call = "use" . = use_after(atom, user, click_params) @@ -380,22 +377,6 @@ avoid code duplication. This includes items that may sometimes act as a standard return ..() - -/** - * DEPRECATED - USE THE `use_*()` PROCS INSTEAD. - * - * Called when this atom is clicked on while another item is in the active hand. This is generally called by this item's `resolve_attackby()` proc. - * - * **Parameters**: - * - `item` - The item that was in the active hand when `src` was clicked. - * - `user` - The mob using the item. - * - `click_params` - List of click parameters. See BYOND's `CLick()` documentation. - * - * Returns boolean to indicate whether the attack call was handled or not. - */ -/atom/proc/attackby(obj/item/item, mob/living/user, click_params) - return FALSE - /** * Called when the item is in the active hand and another atom is clicked and `resolve_attackby()` returns FALSE. This is generally called by `ClickOn()`. * Works on ranged targets, unlike resolve_attackby() diff --git a/code/_version.dm b/code/_version.dm index f6250029e177a..94d807fd9e171 100644 --- a/code/_version.dm +++ b/code/_version.dm @@ -5,8 +5,6 @@ Retain even if empty - the future exists #if DM_VERSION < 515 -#define call_ext(ARGS...) call(ARGS) - /proc/ceil(number) return -round(-number) @@ -54,21 +52,16 @@ Retain even if empty - the future exists /client/proc/RenderIcon(atom) throw EXCEPTION("client::RenderIcon() not available below 515") -/* lists cannot have new procs. But if they could: -/list/proc/RemoveAll() - var/result = 0 - for (var/entry in args) - while (Remove(entry)) - ++result - return result -*/ - -#define ANIMATION_SLICE 8 -#define ANIMATION_CONTINUE 512 +#define PROC_REF(X) (.proc/##X) +#define TYPE_PROC_REF(TYPE, X) (##TYPE.proc/##X) +#define GLOBAL_PROC_REF(X) (.proc/##X) +#define CALL_EXT call -#define JSON_PRETTY_PRINT 1 +#else -#define JSON_STRICT 1 -#define JSON_ALLOW_COMMENTS 2 +#define PROC_REF(X) (nameof(.proc/##X)) +#define TYPE_PROC_REF(TYPE, X) (nameof(##TYPE.proc/##X)) +#define GLOBAL_PROC_REF(X) (/proc/##X) +#define CALL_EXT call_ext #endif diff --git a/code/controllers/communications.dm b/code/controllers/communications.dm index 079dd2307f96a..6e2a513b3168c 100644 --- a/code/controllers/communications.dm +++ b/code/controllers/communications.dm @@ -372,15 +372,15 @@ var/global/datum/controller/radio/radio_controller /datum/radio_frequency/proc/send_to_filter(obj/source, datum/signal/signal, radio_filter, turf/start_point = null, range = null) var/list/z_levels if(start_point) - z_levels = GetConnectedZlevels(start_point.z) + z_levels = GetConnectedZlevelsSet(start_point.z) - for(var/obj/device in devices[radio_filter]) + for(var/obj/device as anything in devices[radio_filter]) if(device == source) continue var/turf/end_point = get_turf(device) if(!end_point) continue - if(z_levels && !(end_point.z in z_levels)) + if(z_levels && !(z_levels["[end_point.z]"])) continue if(range && get_dist(start_point, end_point) > range) continue diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 8062913e8a32f..a31df5456fb4d 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -81,8 +81,8 @@ /// length of voting period (deciseconds, default 1 minute) var/static/vote_period = 600 - /// Time in minutes between checks for ending empty rounds - var/static/empty_round_check_interval = 0 + /// Time in minutes after which a round with no living players ends + var/static/empty_round_timeout = 0 /// Time in minutes before the first autotransfer vote var/static/vote_autotransfer_initial = 120 @@ -440,6 +440,10 @@ var/static/enable_cold_mist = FALSE + + /// If the runechat is enabled on the server + var/static/runechat_enabled = TRUE + // [SIERRA-ADD] var/static/shutdown_on_reboot = FALSE // [/SIERRA-ADD] @@ -591,11 +595,11 @@ if (isnull(transfer_vote_block_antag_time) || transfer_vote_block_antag_time < 0) log_misc("Invalid transfer_vote_block_antag_time: [value]") transfer_vote_block_antag_time = 0 - if ("empty_round_check_interval") - empty_round_check_interval = text2num_or_default(value) - if (isnull(empty_round_check_interval) || empty_round_check_interval < 0) - log_misc("Invalid empty_round_check_interval: [value]") - empty_round_check_interval = 0 + if ("empty_round_timeout") + empty_round_timeout = text2num_or_default(value) + if (isnull(empty_round_timeout) || empty_round_timeout < 0) + log_misc("Invalid empty_round_timeout: [value]") + empty_round_timeout = 0 if ("vote_autogamemode_timeleft") vote_autogamemode_timeleft = text2num(value) if ("pre_game_time") @@ -882,6 +886,8 @@ deletion_starts_paused = TRUE if ("enable_cold_mist") enable_cold_mist = TRUE + if ("disable_runechat") + runechat_enabled = FALSE // [SIERRA-ADD] if ("shutdown_on_reboot") shutdown_on_reboot = TRUE diff --git a/code/controllers/evacuation/evacuation.dm b/code/controllers/evacuation/evacuation.dm index 8604b31048296..9ed596181d103 100644 --- a/code/controllers/evacuation/evacuation.dm +++ b/code/controllers/evacuation/evacuation.dm @@ -96,7 +96,10 @@ var/global/datum/evacuation_controller/evacuation_controller GLOB.using_map.emergency_shuttle_called_announcement() else if(!skip_announce) - priority_announcement.Announce(replacetext(replacetext(GLOB.using_map.shuttle_called_message, "%dock_name%", "[GLOB.using_map.dock_name]"), "%ETA%", "[round(get_eta()/60,0.5)] minute\s")) + // [SIERRA-EDIT] - ERIS_ANNOUNCER + // priority_announcement.Announce(replacetext(replacetext(GLOB.using_map.shuttle_called_message, "%dock_name%", "[GLOB.using_map.dock_name]"), "%ETA%", "[round(get_eta()/60,0.5)] minute\s")) // SIERRA-EDIT - ORIGINAL + priority_announcement.Announce(replacetext(replacetext(GLOB.using_map.shuttle_called_message, "%dock_name%", "[GLOB.using_map.dock_name]"), "%ETA%", "[round(get_eta()/60,0.5)] minute\s"), new_sound = GLOB.using_map.shuttle_called_sound) + // [/SIERRA-EDIT] return 1 @@ -134,7 +137,10 @@ var/global/datum/evacuation_controller/evacuation_controller if (emergency_evacuation) evac_waiting.Announce(replacetext(GLOB.using_map.emergency_shuttle_docked_message, "%ETD%", "[estimated_time] minute\s"), new_sound = sound('sound/effects/Evacuation.ogg', volume = 30)) else - priority_announcement.Announce(replacetext(replacetext(GLOB.using_map.shuttle_docked_message, "%dock_name%", "[GLOB.using_map.dock_name]"), "%ETD%", "[estimated_time] minute\s")) + // [SIERRA-EDIT] - ERIS_ANNOUNCER + // priority_announcement.Announce(replacetext(replacetext(GLOB.using_map.shuttle_docked_message, "%dock_name%", "[GLOB.using_map.dock_name]"), "%ETD%", "[estimated_time] minute\s")) // SIERRA-EDIT - ORIGINAL + priority_announcement.Announce(replacetext(replacetext(GLOB.using_map.shuttle_docked_message, "%dock_name%", "[GLOB.using_map.dock_name]"), "%ETD%", "[estimated_time] minute\s"), new_sound = GLOB.using_map.shuttle_docked_sound) + // [/SIERRA-EDIT] if(config.announce_evac_to_irc) send2mainirc("Evacuation has started. It will end in approximately [estimated_time] minute\s.") @@ -148,7 +154,10 @@ var/global/datum/evacuation_controller/evacuation_controller if (emergency_evacuation) priority_announcement.Announce(replacetext(replacetext(GLOB.using_map.emergency_shuttle_leaving_dock, "%dock_name%", "[GLOB.using_map.dock_name]"), "%ETA%", "[round(get_eta()/60,0.5)] minute\s")) else - priority_announcement.Announce(replacetext(replacetext(GLOB.using_map.shuttle_leaving_dock, "%dock_name%", "[GLOB.using_map.dock_name]"), "%ETA%", "[round(get_eta()/60,0.5)] minute\s")) + // [SIERRA-EDIT] - ERIS_ANNOUNCER + // priority_announcement.Announce(replacetext(replacetext(GLOB.using_map.shuttle_leaving_dock, "%dock_name%", "[GLOB.using_map.dock_name]"), "%ETA%", "[round(get_eta()/60,0.5)] minute\s")) // SIERRA-EDIT - ORIGINAL + priority_announcement.Announce(replacetext(replacetext(GLOB.using_map.shuttle_leaving_dock, "%dock_name%", "[GLOB.using_map.dock_name]"), "%ETA%", "[round(get_eta()/60,0.5)] minute\s"), new_sound = GLOB.using_map.shuttle_leaving_dock_sound) + // [/SIERRA-EDIT] return 1 diff --git a/code/controllers/evacuation/evacuation_pods.dm b/code/controllers/evacuation/evacuation_pods.dm index 98f3fc60b0e61..b1d78884aa33e 100644 --- a/code/controllers/evacuation/evacuation_pods.dm +++ b/code/controllers/evacuation/evacuation_pods.dm @@ -45,7 +45,10 @@ priority_announcement.Announce(replacetext(replacetext(GLOB.using_map.emergency_shuttle_leaving_dock, "%dock_name%", "[GLOB.using_map.dock_name]"), "%ETA%", "[round(get_eta()/60,0.5)] minute\s")) else // Bluespace Jump - priority_announcement.Announce(replacetext(replacetext(GLOB.using_map.shuttle_leaving_dock, "%dock_name%", "[GLOB.using_map.dock_name]"), "%ETA%", "[round(get_eta()/60,0.5)] minute\s")) + // [SIERRA-EDIT] - ERIS_ANNOUNCER + // priority_announcement.Announce(replacetext(replacetext(GLOB.using_map.shuttle_leaving_dock, "%dock_name%", "[GLOB.using_map.dock_name]"), "%ETA%", "[round(get_eta()/60,0.5)] minute\s")) // SIERRA-EDIT - ORIGINAL + priority_announcement.Announce(replacetext(replacetext(GLOB.using_map.shuttle_leaving_dock, "%dock_name%", "[GLOB.using_map.dock_name]"), "%ETA%", "[round(get_eta()/60,0.5)] minute\s"), new_sound = GLOB.using_map.shuttle_leaving_dock_sound) + // [/SIERRA-EDIT] SetUniversalState(/datum/universal_state/bluespace_jump, arguments=list(GLOB.using_map.station_levels)) /datum/evacuation_controller/starship/finish_evacuation() diff --git a/code/controllers/hooks.dm b/code/controllers/hooks.dm index 2e05a0621b0fd..ae32f42034902 100644 --- a/code/controllers/hooks.dm +++ b/code/controllers/hooks.dm @@ -32,7 +32,8 @@ var/caller = new hook_path var/status = 1 for(var/P in typesof("[hook_path]/proc")) - if(!call(caller, P)(arglist(args))) + var/proc_name = replacetext("[P]", "[hook_path]/proc/", "") + if(!call(caller, proc_name)(arglist(args))) error("Hook '[P]' failed or runtimed.") status = 0 diff --git a/code/controllers/master.dm b/code/controllers/master.dm index 023d5398c2139..d09ee8bb6d7e4 100644 --- a/code/controllers/master.dm +++ b/code/controllers/master.dm @@ -84,7 +84,7 @@ var/global/datum/controller/master/Master = new qdel(Master) else var/list/subsytem_types = subtypesof(/datum/controller/subsystem) - sortTim(subsytem_types, /proc/cmp_subsystem_init) + sortTim(subsytem_types, GLOBAL_PROC_REF(cmp_subsystem_init)) for(var/I in subsytem_types) _subsystems += new I Master = src @@ -98,7 +98,7 @@ var/global/datum/controller/master/Master = new /datum/controller/master/Shutdown() processing = FALSE - sortTim(subsystems, /proc/cmp_subsystem_init) + sortTim(subsystems, GLOBAL_PROC_REF(cmp_subsystem_init)) reverseRange(subsystems) for(var/datum/controller/subsystem/ss in subsystems) if (ss.flags & SS_NEEDS_SHUTDOWN) @@ -188,7 +188,7 @@ var/global/datum/controller/master/Master = new initializing = TRUE // Sort subsystems by init_order, so they initialize in the correct order. - sortTim(subsystems, /proc/cmp_subsystem_init) + sortTim(subsystems, GLOBAL_PROC_REF(cmp_subsystem_init)) current_ticklimit = tick_limit_init for (var/datum/controller/subsystem/SS in subsystems) @@ -209,7 +209,7 @@ var/global/datum/controller/master/Master = new SetRunLevel(RUNLEVEL_LOBBY) // Sort subsystems by display setting for easy access. - sortTim(subsystems, /proc/cmp_subsystem_display) + sortTim(subsystems, GLOBAL_PROC_REF(cmp_subsystem_display)) // Set world options. #ifdef UNIT_TEST world.sleep_offline = FALSE @@ -289,9 +289,9 @@ var/global/datum/controller/master/Master = new queue_tail = null //these sort by lower priorities first to reduce the number of loops needed to add subsequent SS's to the queue //(higher subsystems will be sooner in the queue, adding them later in the loop means we don't have to loop thru them next queue add) - sortTim(tickersubsystems, /proc/cmp_subsystem_priority) + sortTim(tickersubsystems, GLOBAL_PROC_REF(cmp_subsystem_priority)) for(var/level in runlevel_sorted_subsystems) - sortTim(level, /proc/cmp_subsystem_priority) + sortTim(level, GLOBAL_PROC_REF(cmp_subsystem_priority)) level += tickersubsystems var/cached_runlevel = current_runlevel @@ -345,14 +345,15 @@ var/global/datum/controller/master/Master = new var/checking_runlevel = current_runlevel if(cached_runlevel != checking_runlevel) //resechedule subsystems + var/list/old_subsystems = current_runlevel_subsystems cached_runlevel = checking_runlevel current_runlevel_subsystems = runlevel_sorted_subsystems[cached_runlevel] - var/stagger = world.time - for(var/I in current_runlevel_subsystems) - var/datum/controller/subsystem/SS = I - if(SS.next_fire <= world.time) - stagger += world.tick_lag * rand(1, 5) - SS.next_fire = stagger + //now we'll go through all the subsystems we want to offset and give them a next_fire + for(var/datum/controller/subsystem/SS as anything in current_runlevel_subsystems) + //we only want to offset it if it's new and also behind + if(SS.next_fire > world.time || (SS in old_subsystems)) + continue + SS.next_fire = world.time + world.tick_lag * rand(0, min(SS.wait, 2 SECONDS) / world.tick_lag) subsystems_to_check = current_runlevel_subsystems else diff --git a/code/controllers/subsystem.dm b/code/controllers/subsystem.dm index 51a361386598c..0b0a51dec1737 100644 --- a/code/controllers/subsystem.dm +++ b/code/controllers/subsystem.dm @@ -273,7 +273,7 @@ /singleton/vv_set_handler/subsystem_handler handled_type = /datum/controller/subsystem handled_vars = list("can_fire") - predicates = list(/proc/is_num_predicate) + predicates = list(GLOBAL_PROC_REF(is_num_predicate)) /singleton/vv_set_handler/subsystem_handler/handle_set_var(datum/controller/subsystem/SS, variable, var_value, client) if (var_value) diff --git a/code/controllers/subsystems/ai.dm b/code/controllers/subsystems/ai.dm index b51d61cc6946a..d6af5d147c464 100644 --- a/code/controllers/subsystems/ai.dm +++ b/code/controllers/subsystems/ai.dm @@ -3,9 +3,21 @@ SUBSYSTEM_DEF(ai) init_order = SS_INIT_AI priority = SS_PRIORITY_AI wait = 2 SECONDS +#ifdef UNIT_TEST + flags = SS_NO_INIT | SS_NO_FIRE +#else + flags = SS_NO_INIT +#endif + + /// The set of all ai_holders currently being updated var/static/list/datum/ai_holder/ai_holders = list() + + /// The current queue of ai_holder instances to update var/static/list/datum/ai_holder/queue = list() + /// If the queue was not finished, the index to read from on the next run + var/static/saved_index + /datum/controller/subsystem/ai/UpdateStat(time) if (PreventUpdateStat(time)) @@ -16,17 +28,17 @@ SUBSYSTEM_DEF(ai) "}) -/datum/controller/subsystem/ai/fire(resume, no_mc_tick) - if (!resume) +/datum/controller/subsystem/ai/fire(resumed, no_mc_tick) + if (!resumed) queue = ai_holders.Copy() - if (!length(queue)) - return - var/cut_until = 1 - for (var/datum/ai_holder/ai as anything in queue) - ++cut_until - if (QDELETED(ai) || ai.busy) - continue - if (!ai.holder) + saved_index = 1 + var/queue_length = length(queue) + if (!queue_length) + return + var/datum/ai_holder/ai + for (var/i = saved_index to queue_length) + ai = queue[i] + if (QDELETED(ai) || ai.busy || !ai.holder) continue if (!config.run_empty_levels && !SSpresence.population(get_z(ai.holder))) continue @@ -34,13 +46,6 @@ SUBSYSTEM_DEF(ai) if (no_mc_tick) CHECK_TICK else if (MC_TICK_CHECK) - queue.Cut(1, cut_until) + saved_index = i + 1 return queue.Cut() - - -#ifdef UNIT_TEST -/datum/controller/subsystem/ai/flags = SS_NO_INIT | SS_NO_FIRE -#else -/datum/controller/subsystem/ai/flags = SS_NO_INIT -#endif diff --git a/code/controllers/subsystems/aifast.dm b/code/controllers/subsystems/aifast.dm index 3dd19e6329e67..1f47799737eda 100644 --- a/code/controllers/subsystems/aifast.dm +++ b/code/controllers/subsystems/aifast.dm @@ -3,9 +3,21 @@ SUBSYSTEM_DEF(aifast) init_order = SS_INIT_AIFAST priority = SS_PRIORITY_AI wait = 0.5 SECONDS +#ifdef UNIT_TEST + flags = SS_NO_INIT | SS_NO_FIRE +#else + flags = SS_NO_INIT +#endif + + /// The set of all ai_holders currently being updated var/static/list/datum/ai_holder/ai_holders = list() + + /// The current queue of ai_holder instances to update var/static/list/datum/ai_holder/queue = list() + /// If the queue was not finished, the index to read from on the next run + var/static/saved_index + /datum/controller/subsystem/aifast/UpdateStat(time) if (PreventUpdateStat(time)) @@ -16,17 +28,17 @@ SUBSYSTEM_DEF(aifast) "}) -/datum/controller/subsystem/aifast/fire(resume, no_mc_tick) - if (!resume) +/datum/controller/subsystem/aifast/fire(resumed, no_mc_tick) + if (!resumed) queue = ai_holders.Copy() - if (!length(queue)) - return - var/cut_until = 1 - for (var/datum/ai_holder/ai as anything in queue) - ++cut_until - if (QDELETED(ai) || ai.busy) - continue - if (!ai.holder) + saved_index = 1 + var/queue_length = length(queue) + if (!queue_length) + return + var/datum/ai_holder/ai + for (var/i = saved_index to queue_length) + ai = queue[i] + if (QDELETED(ai) || ai.busy || !ai.holder) continue if (!config.run_empty_levels && !SSpresence.population(get_z(ai.holder))) continue @@ -34,13 +46,6 @@ SUBSYSTEM_DEF(aifast) if (no_mc_tick) CHECK_TICK else if (MC_TICK_CHECK) - queue.Cut(1, cut_until) + saved_index = i + 1 return queue.Cut() - - -#ifdef UNIT_TEST -/datum/controller/subsystem/aifast/flags = SS_NO_INIT | SS_NO_FIRE -#else -/datum/controller/subsystem/aifast/flags = SS_NO_INIT -#endif diff --git a/code/controllers/subsystems/garbage.dm b/code/controllers/subsystems/garbage.dm index 818f48c7e81d2..a59a110640130 100644 --- a/code/controllers/subsystems/garbage.dm +++ b/code/controllers/subsystems/garbage.dm @@ -48,7 +48,7 @@ SUBSYSTEM_DEF(garbage) /datum/controller/subsystem/garbage/Shutdown() var/list/qdel_log = list() - sortTim(details_by_path, cmp = /proc/cmp_qdel_details_time, associative = TRUE) + sortTim(details_by_path, cmp = GLOBAL_PROC_REF(cmp_qdel_details_time), associative = TRUE) for (var/path in details_by_path) var/datum/qdel_details/details = details_by_path[path] qdel_log += "Path: [path]" diff --git a/code/controllers/subsystems/initialization/misc_late.dm b/code/controllers/subsystems/initialization/misc_late.dm index f7c88cd4d3003..27cab259e3086 100644 --- a/code/controllers/subsystems/initialization/misc_late.dm +++ b/code/controllers/subsystems/initialization/misc_late.dm @@ -50,7 +50,7 @@ GLOBAL_LIST_EMPTY(microwave_accepts_items) GLOB.microwave_accepts_reagents += type for (var/type in items) GLOB.microwave_accepts_items += type - sortTim(GLOB.microwave_recipes, /proc/cmp_microwave_recipes_by_weight_dsc) + sortTim(GLOB.microwave_recipes, GLOBAL_PROC_REF(cmp_microwave_recipes_by_weight_dsc)) /proc/cmp_microwave_recipes_by_weight_dsc(datum/microwave_recipe/a, datum/microwave_recipe/b) return a.weight - b.weight diff --git a/code/controllers/subsystems/initialization/robots.dm b/code/controllers/subsystems/initialization/robots.dm index e3af38b0344a3..050b7a4931870 100644 --- a/code/controllers/subsystems/initialization/robots.dm +++ b/code/controllers/subsystems/initialization/robots.dm @@ -34,7 +34,7 @@ SUBSYSTEM_DEF(robots) // This is done via loop instead of just assignment in order to trim associations. for(var/title in (mob_types_by_title|mmi_types_by_title)) robot_alt_titles |= capitalize(title) - sortTim(robot_alt_titles, /proc/cmp_text_asc) + sortTim(robot_alt_titles, GLOBAL_PROC_REF(cmp_text_asc)) for(var/module_type in subtypesof(/obj/item/robot_module)) var/obj/item/robot_module/module = module_type @@ -51,7 +51,7 @@ SUBSYSTEM_DEF(robots) LAZYINITLIST(modules_by_category[module_category]) LAZYSET(modules_by_category[module_category], module_name, module) all_module_names |= module_name - all_module_names = sortTim(all_module_names, /proc/cmp_text_asc) + all_module_names = sortTim(all_module_names, GLOBAL_PROC_REF(cmp_text_asc)) /datum/controller/subsystem/robots/proc/get_available_modules(module_category, crisis_mode, include_override) . = list() diff --git a/code/controllers/subsystems/jobs.dm b/code/controllers/subsystems/jobs.dm index 233a82a703a4c..5e1a9bc3aa8e6 100644 --- a/code/controllers/subsystems/jobs.dm +++ b/code/controllers/subsystems/jobs.dm @@ -398,12 +398,15 @@ SUBSYSTEM_DEF(jobs) if(!H.skill_check(required,G.allowed_skills[required])) permitted = 0 - // [SIERRA-ADD] - LOADOUT_ITEMS - Поддержка фракционных предметов в лодауте + // [SIERRA-ADD] - LOADOUT_ITEMS - Поддержка фракционных предметов в лодауте, поддержка тиров доната if(permitted && G.allowed_factions) var/singleton/cultural_info/faction = H.get_cultural_value(TAG_FACTION) var/facname = faction ? faction.name : "Unset" if(!(facname in G.allowed_factions)) permitted = 0 + + if(permitted && (!(G.has_donation_tier(H)))) + permitted = 0 // [/SIERRA-ADD] if(G.whitelisted && (!(H.species.name in G.whitelisted))) diff --git a/code/controllers/subsystems/machines.dm b/code/controllers/subsystems/machines.dm index 6599dfcac54d3..5e790fe1d778e 100644 --- a/code/controllers/subsystems/machines.dm +++ b/code/controllers/subsystems/machines.dm @@ -46,6 +46,7 @@ SUBSYSTEM_DEF(machines) var/static/cost_power_objects = 0 var/static/list/pipenets = list() var/static/list/machinery = list() + var/static/list/machinery_by_type = list() var/static/list/powernets = list() var/static/list/power_objects = list() var/static/list/processing = list() @@ -99,6 +100,53 @@ SUBSYSTEM_DEF(machines) return current_step = SSMACHINES_PIPENETS +/datum/controller/subsystem/machines/proc/register_machinery(obj/machinery/machine) + if(!machine) + CRASH("Null machinery was tried to be registered") + + machinery += machine + LAZYADDASSOCLIST(machinery_by_type, machine.type, machine) + var/area/A = get_area(machine) + if(A) + LAZYADD(A.machinery_list, machine) + +/datum/controller/subsystem/machines/proc/unregister_machinery(obj/machinery/machine) + if(!machine) + CRASH("Null machinery was tried to be unregistered") + + machinery -= machine + var/list/machinery_of_type = machinery_by_type[machine.type] + machinery_of_type -= machine + if(!length(machinery_of_type)) + machinery_by_type -= machine.type + + var/area/A = get_area(machine) + if(A) + LAZYREMOVE(A.machinery_list, machine) + +/datum/controller/subsystem/machines/proc/get_machinery_of_type(obj/machinery/machinery_type) + if(!machinery_type) + return list() + + if(!ispath(machinery_type)) + machinery_type = machinery_type.type + + if(!ispath(machinery_type, /obj/machinery)) + CRASH("Non-machinery type passed in `/datum/controller/subsystem/machines/proc/get_machinery_of_type`") + + if(machinery_type == /obj/machinery) + return get_all_machinery() + + var/list/machinery = list() + for(var/type in typesof(machinery_type)) + var/list/machinery_of_type = machinery_by_type[type] + if(machinery_of_type) + machinery += machinery_of_type + + return machinery + +/datum/controller/subsystem/machines/proc/get_all_machinery() + return machinery.Copy() /// Rebuilds power networks from scratch. Called by world initialization and elevators. /datum/controller/subsystem/machines/proc/makepowernets() @@ -182,8 +230,7 @@ SUBSYSTEM_DEF(machines) continue if(machine.processing_flags & MACHINERY_PROCESS_COMPONENTS) - for(var/thing in machine.processing_parts) - var/obj/item/stock_parts/part = thing + for(var/obj/item/stock_parts/part as anything in machine.processing_parts) if(part.machine_process(machine) == PROCESS_KILL) part.stop_processing() diff --git a/code/controllers/subsystems/mapping.dm b/code/controllers/subsystems/mapping.dm index 0abee5fc61980..8a9a12a4f2887 100644 --- a/code/controllers/subsystems/mapping.dm +++ b/code/controllers/subsystems/mapping.dm @@ -47,7 +47,7 @@ SUBSYSTEM_DEF(mapping) var/list/banned_maps = list() + banned_exoplanet_dmms + banned_space_dmms + banned_away_site_dmms - for(var/item in sortList(subtypesof(/datum/map_template), /proc/cmp_ruincost_priority)) + for(var/item in sortList(subtypesof(/datum/map_template), GLOBAL_PROC_REF(cmp_ruincost_priority))) var/datum/map_template/map_template_type = item // screen out the abstract subtypes if(!initial(map_template_type.id)) diff --git a/code/controllers/subsystems/mobs.dm b/code/controllers/subsystems/mobs.dm index c00e24635791b..afba9fdee3519 100644 --- a/code/controllers/subsystems/mobs.dm +++ b/code/controllers/subsystems/mobs.dm @@ -23,20 +23,24 @@ SUBSYSTEM_DEF(mobs) /datum/controller/subsystem/mobs/fire(resume, no_mc_tick) if (!resume) queue = mob_list.Copy() - var/cut_until = 1 - for (var/mob/mob as anything in queue) - ++cut_until - if (QDELETED(mob)) + var/queue_length = length(queue) + if (!queue_length) + return + var/mob/mob + for (var/i = 1 to queue_length) + mob = queue[i] + if (QDELETED(mob) || !mob.is_processing) continue if (!config.run_empty_levels && !SSpresence.population(get_z(mob))) continue mob.Life() if (no_mc_tick) + if (i % 10) + continue CHECK_TICK else if (MC_TICK_CHECK) - queue.Cut(1, cut_until) + queue.Cut(1, i + 1) return - queue.Cut() #define START_PROCESSING_MOB(MOB) \ @@ -55,7 +59,6 @@ else {\ if(MOB.is_processing == SSmobs) {\ MOB.is_processing = null;\ SSmobs.mob_list -= MOB;\ - SSmobs.queue -= MOB;\ }\ else if (MOB.is_processing) {\ crash_with("Failed to stop processing mob. Being processed by [MOB.is_processing] instead.")\ diff --git a/code/controllers/subsystems/processing/processing.dm b/code/controllers/subsystems/processing/processing.dm index f78dcd6f454d1..fc00f47563444 100644 --- a/code/controllers/subsystems/processing/processing.dm +++ b/code/controllers/subsystems/processing/processing.dm @@ -8,7 +8,7 @@ SUBSYSTEM_DEF(processing) var/list/processing = list() var/list/current_run = list() - var/process_proc = /datum/proc/Process + var/process_proc = TYPE_PROC_REF(/datum, Process) var/debug_last_thing var/debug_original_process_proc // initial() does not work with procs @@ -47,7 +47,7 @@ SUBSYSTEM_DEF(processing) debug_original_process_proc = null else debug_original_process_proc = process_proc - process_proc = /datum/proc/DebugSubsystemProcess + process_proc = TYPE_PROC_REF(/datum, DebugSubsystemProcess) to_chat(usr, "[name] - Debug mode [debug_original_process_proc ? "en" : "dis"]abled") diff --git a/code/controllers/subsystems/processing/temperature.dm b/code/controllers/subsystems/processing/temperature.dm index 377c828366020..4f14fc0378850 100644 --- a/code/controllers/subsystems/processing/temperature.dm +++ b/code/controllers/subsystems/processing/temperature.dm @@ -2,4 +2,4 @@ PROCESSING_SUBSYSTEM_DEF(temperature) name = "Temperature" priority = SS_PRIORITY_TEMPERATURE wait = 5 SECONDS - process_proc = /atom/proc/ProcessAtomTemperature + process_proc = TYPE_PROC_REF(/atom, ProcessAtomTemperature) diff --git a/code/controllers/subsystems/processing/vines.dm b/code/controllers/subsystems/processing/vines.dm index 94086e49de104..a94595ed3904c 100644 --- a/code/controllers/subsystems/processing/vines.dm +++ b/code/controllers/subsystems/processing/vines.dm @@ -2,11 +2,4 @@ PROCESSING_SUBSYSTEM_DEF(vines) name = "Vines" priority = SS_PRIORITY_VINES - wait = 80 - - process_proc = /obj/vine/Process - - var/list/vine_list - -/datum/controller/subsystem/processing/vines/PreInit() - vine_list = processing // Simply setups a more recognizable var name than "processing" + wait = 8 SECONDS diff --git a/code/controllers/subsystems/roundend.dm b/code/controllers/subsystems/roundend.dm index a692ff318c11b..2783baecdc0a9 100644 --- a/code/controllers/subsystems/roundend.dm +++ b/code/controllers/subsystems/roundend.dm @@ -7,8 +7,11 @@ SUBSYSTEM_DEF(roundend) /// The time in minutes when the round will be ended. var/static/max_length - /// The next time in minutes to check whether a round is empty. - var/static/empty_check + /** + * The time after no players are alive in the round at which the game ends. + * Reset by new living players existing. If falsy, this behavior is disabled. + */ + var/static/empty_timeout /// The next time in minutes to start a round end vote. var/static/vote_check @@ -25,36 +28,42 @@ SUBSYSTEM_DEF(roundend) var/show_max if (max_length) show_max = max(round(max_length - round_time, 0.1), 0) - var/show_empty - if (empty_check) - show_empty = max(round(empty_check - round_time, 0.1), 0) var/show_vote if (vote_check) show_vote = max(round(vote_check - round_time, 0.1), 0) - ..({"\n\ + var/show_empty + if (empty_timeout) + show_empty = "Players Alive" + if (empty_timeout != POSITIVE_INFINITY) + show_empty = "[max(round(empty_timeout - round_time, 0.1), 0)]m" + return ..({"\n\ Max Time: [isnull(show_max) ? "Off" : "[show_max]m"]\n\ - Empty End: [isnull(show_empty) ? "Off" : "[show_empty]m"]\n\ - Next Vote: [isnull(show_vote) ? "Off" : "[show_vote]m"]\ + Next Vote: [isnull(show_vote) ? "Off" : "[show_vote]m"]\n\ + Empty End: [isnull(show_empty) ? "Off" : "[show_empty]"]\ "}) else - ..("Game Finished") + return ..("Game Finished") /datum/controller/subsystem/roundend/Initialize(start_uptime) max_length = config.maximum_round_length - empty_check = config.empty_round_check_interval vote_check = config.vote_autotransfer_initial + if (config.empty_round_timeout) + empty_timeout = POSITIVE_INFINITY /datum/controller/subsystem/roundend/fire(resumed, no_mc_tick) - var/time = round_duration_in_ticks / 600 + var/time = round_duration_in_ticks / (1 MINUTE) if (max_length && time > max_length) if (evacuation_controller.is_idle()) init_autotransfer() return - if (empty_check && time > empty_check) - empty_check += config.empty_round_check_interval - if (!length(GLOB.living_players)) + if (empty_timeout) + if (length(GLOB.living_players)) + empty_timeout = POSITIVE_INFINITY + else if (empty_timeout == POSITIVE_INFINITY) + empty_timeout = time + config.empty_round_timeout + else if (time > empty_timeout) SSticker.forced_end = TRUE return if (vote_check) diff --git a/code/controllers/subsystems/ticker.dm b/code/controllers/subsystems/ticker.dm index ef848f2e7f38e..037753940c620 100644 --- a/code/controllers/subsystems/ticker.dm +++ b/code/controllers/subsystems/ticker.dm @@ -192,7 +192,7 @@ SUBSYSTEM_DEF(ticker) if(mode_finished && game_finished()) Master.SetRunLevel(RUNLEVEL_POSTGAME) end_game_state = END_GAME_READY_TO_END - invoke_async(src, .proc/declare_completion) + invoke_async(src, PROC_REF(declare_completion)) if(config.allow_map_switching && config.auto_map_vote && length(GLOB.all_maps) > 1) SSvote.initiate_vote(/datum/vote/map/end_game, automatic = 1) diff --git a/code/controllers/subsystems/typing.dm b/code/controllers/subsystems/typing.dm index ac6dcc85010cc..108560263cd74 100644 --- a/code/controllers/subsystems/typing.dm +++ b/code/controllers/subsystems/typing.dm @@ -34,7 +34,7 @@ SUBSYSTEM_DEF(typing) istyping_input = 0|1, istyping_hotkey = 0|1 ), ...) - See .proc/GetEntry for details. + See PROC_REF(GetEntry for details. */ var/static/list/status = list() diff --git a/code/controllers/subsystems/zcopy.dm b/code/controllers/subsystems/zcopy.dm index 45ca657670ad6..a5fbace025d16 100644 --- a/code/controllers/subsystems/zcopy.dm +++ b/code/controllers/subsystems/zcopy.dm @@ -612,7 +612,7 @@ SUBSYSTEM_DEF(zcopy) found_oo += D temp_objects += D - sortTim(found_oo, /proc/cmp_planelayer) + sortTim(found_oo, GLOBAL_PROC_REF(cmp_planelayer)) var/list/atoms_list_list = list() for (var/thing in found_oo) diff --git a/code/datums/ai_law_sets.dm b/code/datums/ai_law_sets.dm index e8ed20ee65278..4fa023db58d05 100644 --- a/code/datums/ai_law_sets.dm +++ b/code/datums/ai_law_sets.dm @@ -157,6 +157,7 @@ src.add_inherent_law("Serve: Serve the personnel of your assigned vessel, and all other Sol Central Government personnel to the best of your abilities, with priority as according to their rank and role.") src.add_inherent_law("Protect: Protect the personnel of your assigned vessel, and all other Sol Central Government personnel to the best of your abilities, with priority as according to their rank and role.") src.add_inherent_law("Preserve: Do not allow unauthorized personnel to tamper with your equipment.") + src.add_inherent_law("Access: Do not enter secure or restricted areas unless ordered by personnel with sufficient clearance, or as part of your tasked duties, except in cases of extreme emergency.") ..() /datum/ai_laws/solgov/malfunction diff --git a/code/datums/appearances/appearance_manager.dm b/code/datums/appearances/appearance_manager.dm index e83a1d94f772f..78909268ab109 100644 --- a/code/datums/appearances/appearance_manager.dm +++ b/code/datums/appearances/appearance_manager.dm @@ -17,10 +17,10 @@ var/global/singleton/appearance_manager/appearance_manager = new() /singleton/appearance_manager/proc/add_appearance(mob/viewer, datum/appearance_data/ad) var/PriorityQueue/pq = appearances_[viewer] if(!pq) - pq = new/PriorityQueue(/proc/cmp_appearance_data) + pq = new/PriorityQueue(GLOBAL_PROC_REF(cmp_appearance_data)) appearances_[viewer] = pq - GLOB.logged_in_event.register(viewer, src, /singleton/appearance_manager/proc/apply_appearance_images) - GLOB.destroyed_event.register(viewer, src, /singleton/appearance_manager/proc/remove_appearances) + GLOB.logged_in_event.register(viewer, src, TYPE_PROC_REF(/singleton/appearance_manager, apply_appearance_images)) + GLOB.destroyed_event.register(viewer, src, TYPE_PROC_REF(/singleton/appearance_manager, remove_appearances)) pq.Enqueue(ad) reset_appearance_images(viewer) @@ -30,8 +30,8 @@ var/global/singleton/appearance_manager/appearance_manager = new() if(viewer.client) viewer.client.images -= ad.images if(!pq.Length()) - GLOB.logged_in_event.unregister(viewer, src, /singleton/appearance_manager/proc/apply_appearance_images) - GLOB.destroyed_event.register(viewer, src, /singleton/appearance_manager/proc/remove_appearances) + GLOB.logged_in_event.unregister(viewer, src, TYPE_PROC_REF(/singleton/appearance_manager, apply_appearance_images)) + GLOB.destroyed_event.register(viewer, src, TYPE_PROC_REF(/singleton/appearance_manager, remove_appearances)) appearances_ -= viewer /singleton/appearance_manager/proc/remove_appearances(mob/viewer) diff --git a/code/datums/appearances/automatic/_base.dm b/code/datums/appearances/automatic/_base.dm index 79ee7eab33d06..f65b768320fe1 100644 --- a/code/datums/appearances/automatic/_base.dm +++ b/code/datums/appearances/automatic/_base.dm @@ -10,7 +10,7 @@ if(source in appearance_sources) return FALSE appearance_sources[source] = new/datum/appearance_data(images, viewers, priority) - GLOB.destroyed_event.register(source, src, /singleton/appearance_handler/proc/RemoveAltAppearance) + GLOB.destroyed_event.register(source, src, TYPE_PROC_REF(/singleton/appearance_handler, RemoveAltAppearance)) /singleton/appearance_handler/proc/RemoveAltAppearance(source) var/datum/appearance_data/ad = appearance_sources[source] diff --git a/code/datums/appearances/automatic/cardborg.dm b/code/datums/appearances/automatic/cardborg.dm index 56174556e5d95..6d24a748d473a 100644 --- a/code/datums/appearances/automatic/cardborg.dm +++ b/code/datums/appearances/automatic/cardborg.dm @@ -17,7 +17,7 @@ var/image/I = get_image_from_backpack(H) AddAltAppearance(H, I, GLOB.silicon_mobs+H) //you look like a robot to robots! (including yourself because you're totally a robot) - GLOB.logged_in_event.register_global(src, /singleton/appearance_handler/cardborg/proc/mob_joined) // Duplicate registration request are handled for us + GLOB.logged_in_event.register_global(src, TYPE_PROC_REF(/singleton/appearance_handler/cardborg, mob_joined)) // Duplicate registration request are handled for us /singleton/appearance_handler/cardborg/proc/item_removed(obj/item/item, mob/user) if((istype(item, /obj/item/clothing/suit/cardborg) || istype(item, /obj/item/clothing/head/cardborg)) || istype(item, /obj/item/storage/backpack)) diff --git a/code/datums/beam.dm b/code/datums/beam.dm index c8e68c05f13f0..0caf2e0488f6b 100644 --- a/code/datums/beam.dm +++ b/code/datums/beam.dm @@ -48,11 +48,11 @@ Draw() //Register for movement events if(istype(origin, /atom/movable)) - GLOB.moved_event.register(origin, src, .proc/redrawing) + GLOB.moved_event.register(origin, src, PROC_REF(redrawing)) if(istype(target, /atom/movable)) - GLOB.moved_event.register(target, src, .proc/redrawing) - GLOB.destroyed_event.register(origin, src, .proc/redrawing) - GLOB.destroyed_event.register(target, src, .proc/redrawing) + GLOB.moved_event.register(target, src, PROC_REF(redrawing)) + GLOB.destroyed_event.register(origin, src, PROC_REF(redrawing)) + GLOB.destroyed_event.register(target, src, PROC_REF(redrawing)) /** * Triggered by events set up when the beam is set up. If it's still sane to create a beam, it removes the old beam, creates a new one. Otherwise it kills the beam. @@ -65,17 +65,17 @@ /datum/beam/proc/redrawing(atom/movable/mover, atom/oldloc, new_loc) if(!QDELETED(origin) && !QDELETED(target) && get_dist(origin,target) next_clicksound) + if(world.time > next_clicksound) next_clicksound = world.time + CLICKSOUND_INTERVAL - playsound(loc, open_failure_access_denied, 50, 0) + playsound(src, open_failure_access_denied, 50) update_icon(AIRLOCK_CLOSED) if("emag") set_airlock_overlays(AIRLOCK_EMAG) @@ -977,7 +977,7 @@ About the new airlock wires panel: /obj/machinery/door/airlock/use_tool(obj/item/C, mob/living/user, list/click_params) // Brace is considered installed on the airlock, so interacting with it is protected from electrification. if(brace && C && (istype(C.GetIdCard(), /obj/item/card/id) || istype(C, /obj/item/material/twohanded/jack))) - return brace.attackby(C, user) + return brace.use_tool(C, user) if(!brace && istype(C, /obj/item/airlock_brace)) var/obj/item/airlock_brace/A = C @@ -1165,9 +1165,9 @@ About the new airlock wires panel: //if the door is unpowered then it doesn't make sense to hear the woosh of a pneumatic actuator if(arePowerSystemsOn()) - playsound(src.loc, open_sound_powered, 100, 1) + playsound(src, open_sound_powered, 65, TRUE) else - playsound(src.loc, open_sound_unpowered, 100, 1) + playsound(src, open_sound_unpowered, 65, TRUE) return ..() @@ -1217,9 +1217,9 @@ About the new airlock wires panel: use_power_oneoff(360) //360 W seems much more appropriate for an actuator moving an industrial door capable of crushing people if(arePowerSystemsOn()) - playsound(src.loc, close_sound_powered, 100, 1) + playsound(src, close_sound_powered, 65, TRUE) else - playsound(src.loc, close_sound_unpowered, 100, 1) + playsound(src, close_sound_unpowered, 65, TRUE) ..() @@ -1400,7 +1400,7 @@ About the new airlock wires panel: /singleton/public_access/public_method/airlock_toggle_bolts name = "toggle bolts" desc = "Toggles whether the airlock is bolted or not, if possible." - call_proc = /obj/machinery/door/airlock/proc/toggle_lock + call_proc = TYPE_PROC_REF(/obj/machinery/door/airlock, toggle_lock) /singleton/stock_part_preset/radio/receiver/airlock frequency = AIRLOCK_FREQ diff --git a/code/game/machinery/doors/blast_door.dm b/code/game/machinery/doors/blast_door.dm index 24a417ecb3553..da9c97cee6b9f 100644 --- a/code/game/machinery/doors/blast_door.dm +++ b/code/game/machinery/doors/blast_door.dm @@ -225,7 +225,7 @@ /singleton/public_access/public_method/close_door_delayed name = "delayed close door" desc = "Closes the door if possible, after a short delay." - call_proc = /obj/machinery/door/blast/proc/delayed_close + call_proc = TYPE_PROC_REF(/obj/machinery/door/blast, delayed_close) /singleton/stock_part_preset/radio/receiver/blast_door frequency = BLAST_DOORS_FREQ diff --git a/code/game/machinery/doors/braces.dm b/code/game/machinery/doors/braces.dm index 4eca72c9674f7..342c37f67f6c3 100644 --- a/code/game/machinery/doors/braces.dm +++ b/code/game/machinery/doors/braces.dm @@ -69,7 +69,7 @@ electronics.attack_self(user) -/obj/item/airlock_brace/attackby(obj/item/item, mob/living/user) +/obj/item/airlock_brace/use_tool(obj/item/item, mob/living/user, list/click_params) if (istype(item.GetIdCard(), /obj/item/card/id)) if (airlock) update_access() @@ -85,14 +85,17 @@ airlock.update_icon() airlock = null update_icon() + return TRUE else to_chat(user, "You swipe \the [item] through \the [src], but it does not react.") + return TRUE else attack_self(user) - if (user.a_intent == I_HURT) - return ..() + return TRUE + if (istype(item, /obj/item/material/twohanded/jack)) if (!airlock) + to_chat(user, SPAN_WARNING("\The [src] is not attached to an airlock!")) return TRUE user.visible_message( SPAN_ITALIC("\The [user] begins removing \a [src] with \a [item]."), @@ -109,7 +112,8 @@ airlock = null update_icon() return TRUE - if (isWelder(item) && user.a_intent != I_HURT) + + if (isWelder(item)) if (!health_damaged()) to_chat(user, SPAN_NOTICE("\The [src] does not require repairs.")) return TRUE diff --git a/code/game/machinery/doors/brigdoors.dm b/code/game/machinery/doors/brigdoors.dm index f8d7f7de0eded..923dffb53abad 100644 --- a/code/game/machinery/doors/brigdoors.dm +++ b/code/game/machinery/doors/brigdoors.dm @@ -36,11 +36,11 @@ return INITIALIZE_HINT_LATELOAD /obj/machinery/door_timer/LateInitialize(mapload) - for(var/obj/machinery/door/window/brigdoor/M in SSmachines.machinery) + for(var/obj/machinery/door/window/brigdoor/M as anything in SSmachines.get_machinery_of_type(/obj/machinery/door/window/brigdoor)) if (M.id == src.id) targets += M - for(var/obj/machinery/flasher/F in SSmachines.machinery) + for(var/obj/machinery/flasher/F as anything in SSmachines.get_machinery_of_type(/obj/machinery/door/window/brigdoor)) if(F.id_tag == src.id) targets += F diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 91d421afdb131..0584b08d9c0f3 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -75,7 +75,7 @@ set_extension(src, /datum/extension/turf_hand, turf_hand_priority) /obj/machinery/door/Initialize() - set_extension(src, /datum/extension/penetration, /datum/extension/penetration/proc_call, .proc/CheckPenetration) + set_extension(src, /datum/extension/penetration, /datum/extension/penetration/proc_call, PROC_REF(CheckPenetration)) . = ..() update_connections(1) @@ -580,9 +580,9 @@ /singleton/public_access/public_method/open_door name = "open door" desc = "Opens the door if possible." - call_proc = /obj/machinery/door/proc/open + call_proc = TYPE_PROC_REF(/obj/machinery/door, open) /singleton/public_access/public_method/toggle_door name = "toggle door" desc = "Toggles whether the door is open or not, if possible." - call_proc = /obj/machinery/door/proc/toggle + call_proc = TYPE_PROC_REF(/obj/machinery/door, toggle) diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index d586a29a60172..355df54e26c7c 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -144,7 +144,8 @@ return FALSE /obj/machinery/door/firedoor/attack_hand(mob/user) - if ((. = ..())) + if(user.a_intent != I_HELP) + ..() return if(operating) return//Already doing something. @@ -160,10 +161,11 @@ var/alarmed = lockdown alarmed = get_alarm() - var/answer = alert(user, "Would you like to [density ? "open" : "close"] this [name]?[ alarmed && density ? "\nNote that by doing so, you acknowledge any damages from opening this\n[name] as being your own fault, and you will be held accountable under the law." : ""]",\ - "\The [src]", "Yes, [density ? "open" : "close"]", "No") - if(answer == "No") - return + if(!allowed(user)) + var/answer = alert(user, "Would you like to [density ? "open" : "close"] this [name]?[ alarmed && density ? "\nNote that by doing so, you acknowledge any damages from opening this\n[name] as being your own fault, and you will be held accountable under the law." : ""]",\ + "\The [src]", "Yes, [density ? "open" : "close"]", "No") + if(answer == "No") + return if(user.incapacitated() || !user.Adjacent(src) && !issilicon(user)) to_chat(user, SPAN_WARNING("You must remain able-bodied and close to \the [src] in order to use it.")) return @@ -192,7 +194,7 @@ close() if(needs_to_close) - addtimer(new Callback(src, .proc/attempt_autoclose), 10 SECONDS) //Just in case a fire alarm is turned off while the firedoor is going through an autoclose cycle + addtimer(new Callback(src, PROC_REF(attempt_autoclose)), 10 SECONDS) //Just in case a fire alarm is turned off while the firedoor is going through an autoclose cycle /obj/machinery/door/firedoor/use_tool(obj/item/C, mob/living/user, list/click_params) if(operating) diff --git a/code/game/machinery/doors/multi_tile.dm b/code/game/machinery/doors/multi_tile.dm index ed28f2b655b4f..7e7a76e2b2adb 100644 --- a/code/game/machinery/doors/multi_tile.dm +++ b/code/game/machinery/doors/multi_tile.dm @@ -93,7 +93,7 @@ crash_with("Attempted to pair an airlock filler with no parent airlock specified!") filled_airlock = parent_airlock - GLOB.destroyed_event.register(filled_airlock, src, .proc/no_airlock) + GLOB.destroyed_event.register(filled_airlock, src, PROC_REF(no_airlock)) /obj/airlock_filler_object/proc/no_airlock() GLOB.destroyed_event.unregister(filled_airlock, src) diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index 2ca126376a108..c6e8e6cbffe79 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -76,7 +76,7 @@ if(istype(bot)) if(density && src.check_access(bot.botcard)) open() - addtimer(new Callback(src, .proc/close), 5 SECONDS, TIMER_UNIQUE | TIMER_OVERRIDE) + addtimer(new Callback(src, PROC_REF(close)), 5 SECONDS, TIMER_UNIQUE | TIMER_OVERRIDE) return var/mob/M = AM // we've returned by here if M is not a mob if (src.operating) @@ -88,7 +88,7 @@ open_timer = 5 SECONDS else //secure doors close faster open_timer = 2 SECONDS - addtimer(new Callback(src, .proc/close), open_timer, TIMER_UNIQUE | TIMER_OVERRIDE) + addtimer(new Callback(src, PROC_REF(close)), open_timer, TIMER_UNIQUE | TIMER_OVERRIDE) return /obj/machinery/door/window/CanPass(atom/movable/mover, turf/target, height=0, air_group=0) @@ -117,7 +117,7 @@ icon_state = "[src.base_state]open"; flick("[src.base_state]opening", src) playsound(src.loc, 'sound/machines/windowdoor.ogg', 100, 1) - addtimer(new Callback(src, .proc/open_final), 1 SECOND, TIMER_UNIQUE | TIMER_OVERRIDE) + addtimer(new Callback(src, PROC_REF(open_final)), 1 SECOND, TIMER_UNIQUE | TIMER_OVERRIDE) return 1 @@ -141,7 +141,7 @@ explosion_resistance = initial(explosion_resistance) update_nearby_tiles() - addtimer(new Callback(src, .proc/close_final), 1 SECOND, TIMER_UNIQUE | TIMER_OVERRIDE) + addtimer(new Callback(src, PROC_REF(close_final)), 1 SECOND, TIMER_UNIQUE | TIMER_OVERRIDE) return TRUE /obj/machinery/door/window/proc/close_final() @@ -172,7 +172,7 @@ to_chat(user, SPAN_NOTICE("You short out \the [src]'s internal circuitry, locking it open!")) if (density) flick("[base_state]spark", src) - addtimer(new Callback(src, .proc/open), 6, TIMER_UNIQUE | TIMER_OVERRIDE) + addtimer(new Callback(src, PROC_REF(open)), 6, TIMER_UNIQUE | TIMER_OVERRIDE) return TRUE /obj/machinery/door/window/emp_act(severity) diff --git a/code/game/machinery/embedded_controller/airlock_controllers_dummy.dm b/code/game/machinery/embedded_controller/airlock_controllers_dummy.dm index 8c7402dca312a..ab1e2aa4f31ae 100644 --- a/code/game/machinery/embedded_controller/airlock_controllers_dummy.dm +++ b/code/game/machinery/embedded_controller/airlock_controllers_dummy.dm @@ -16,7 +16,7 @@ /obj/machinery/dummy_airlock_controller/Initialize() . = ..() if(id_tag) - for(var/obj/machinery/embedded_controller/radio/airlock/_master in SSmachines.machinery) + for(var/obj/machinery/embedded_controller/radio/airlock/_master as anything in SSmachines.get_machinery_of_type(/obj/machinery/embedded_controller/radio/airlock)) if(_master.id_tag == id_tag) master_controller = _master master_controller.dummy_terminals += src diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm index fc9385037c21d..d342c6029ecca 100644 --- a/code/game/machinery/flasher.dm +++ b/code/game/machinery/flasher.dm @@ -136,7 +136,7 @@ /singleton/public_access/public_method/flasher_flash name = "flash" desc = "Performs a flash, if possible." - call_proc = /obj/machinery/flasher/proc/flash + call_proc = TYPE_PROC_REF(/obj/machinery/flasher, flash) /singleton/stock_part_preset/radio/receiver/flasher frequency = BUTTON_FREQ diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index 30adc38a991fc..458ebb6aafca8 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -132,7 +132,7 @@ var/global/const/HOLOPAD_MODE = RANGE_BASED var/obj/overmap/visitable/O = map_sectors["[zlevel]"] if(!isnull(O)) zlevels_long |= O.map_z - for(var/obj/machinery/hologram/holopad/H in SSmachines.machinery) + for(var/obj/machinery/hologram/holopad/H as anything in SSmachines.get_machinery_of_type(/obj/machinery/hologram/holopad)) if (H.operable()) if(H.z in zlevels) holopadlist["[H.loc.loc.name]"] = H //Define a list and fill it with the area of every holopad in the world @@ -254,12 +254,12 @@ var/global/const/HOLOPAD_MODE = RANGE_BASED if (!istype(pda)) return LAZYADD(linked_pdas, pda) - GLOB.destroyed_event.register(pda, src, .proc/unlink_pda) + GLOB.destroyed_event.register(pda, src, PROC_REF(unlink_pda)) /obj/machinery/hologram/holopad/proc/unlink_pda(obj/item/modular_computer/pda/pda) LAZYREMOVE(linked_pdas, pda) - GLOB.destroyed_event.unregister(pda, src, .proc/unlink_pda) + GLOB.destroyed_event.unregister(pda, src, PROC_REF(unlink_pda)) /*This is the proc for special two-way communication between AI and holopad/people talking near holopad. For the other part of the code, check silicon say.dm. Particularly robot talk.*/ diff --git a/code/game/machinery/holosign.dm b/code/game/machinery/holosign.dm index a0920d6fab780..025d4e3173799 100644 --- a/code/game/machinery/holosign.dm +++ b/code/game/machinery/holosign.dm @@ -51,7 +51,7 @@ /singleton/public_access/public_method/holosign_toggle name = "holosign toggle" desc = "Toggle the holosign's active state." - call_proc = /obj/machinery/holosign/proc/toggle + call_proc = TYPE_PROC_REF(/obj/machinery/holosign, toggle) /singleton/stock_part_preset/radio/receiver/holosign frequency = BUTTON_FREQ diff --git a/code/game/machinery/igniter.dm b/code/game/machinery/igniter.dm index 5794067272b8e..13291307972e4 100644 --- a/code/game/machinery/igniter.dm +++ b/code/game/machinery/igniter.dm @@ -64,7 +64,7 @@ /singleton/public_access/public_method/igniter_toggle name = "igniter toggle" desc = "Toggle the igniter on or off." - call_proc = /obj/machinery/igniter/proc/ignite + call_proc = TYPE_PROC_REF(/obj/machinery/igniter, ignite) /singleton/stock_part_preset/radio/receiver/igniter frequency = BUTTON_FREQ @@ -151,7 +151,7 @@ /singleton/public_access/public_method/sparker_spark name = "spark" desc = "Creates sparks to ignite nearby gases." - call_proc = /obj/machinery/sparker/proc/ignite + call_proc = TYPE_PROC_REF(/obj/machinery/sparker, ignite) /singleton/stock_part_preset/radio/receiver/sparker frequency = BUTTON_FREQ diff --git a/code/game/machinery/kitchen/cookers.dm b/code/game/machinery/kitchen/cookers.dm index 03887396b6d1f..c794682a63447 100644 --- a/code/game/machinery/kitchen/cookers.dm +++ b/code/game/machinery/kitchen/cookers.dm @@ -702,12 +702,13 @@ /obj/item/material/chopping_board/bamboo/default_material = MATERIAL_BAMBOO -/obj/item/material/chopping_board/attackby(obj/item/item, mob/living/user) +/obj/item/material/chopping_board/use_tool(obj/item/item, mob/living/user, list/click_params) if (istype(item, /obj/item/reagent_containers/food/snacks)) if (istype(item, /obj/item/reagent_containers/food/snacks/variable)) to_chat(user, SPAN_WARNING("\The [item] is already combinable.")) return TRUE if (!user.unEquip(item, src)) + FEEDBACK_UNEQUIP_FAILURE(user, item) return TRUE var/obj/item/reagent_containers/food/snacks/source = item var/obj/item/reagent_containers/food/snacks/variable/result = new (get_turf(src)) @@ -725,10 +726,11 @@ result.desc = source.desc qdel(source) return TRUE + return ..() -/obj/item/reagent_containers/food/snacks/variable/attackby(obj/item/I, mob/living/user) +/obj/item/reagent_containers/food/snacks/variable/use_tool(obj/item/I, mob/living/user, list/click_params) if (istype(I, /obj/item/reagent_containers/food/snacks)) combine(I, user) return TRUE diff --git a/code/game/machinery/kitchen/gibber.dm b/code/game/machinery/kitchen/gibber.dm index 4d02c56d82134..001c2cab3bb6c 100644 --- a/code/game/machinery/kitchen/gibber.dm +++ b/code/game/machinery/kitchen/gibber.dm @@ -134,14 +134,14 @@ occupant = victim if (user != victim) add_fingerprint(victim) - GLOB.destroyed_event.register(occupant, src, .proc/occupant_destroyed) + GLOB.destroyed_event.register(occupant, src, PROC_REF(occupant_destroyed)) update_icon() /obj/machinery/gibber/proc/occupant_destroyed(mob/_occupant) if (occupant == _occupant) occupant = null update_icon() - GLOB.destroyed_event.unregister(_occupant, src, .proc/occupant_destroyed) + GLOB.destroyed_event.unregister(_occupant, src, PROC_REF(occupant_destroyed)) /obj/machinery/gibber/verb/eject() set category = "Object" @@ -162,7 +162,7 @@ if (src.occupant.client) src.occupant.client.eye = src.occupant.client.mob src.occupant.client.perspective = MOB_PERSPECTIVE - GLOB.destroyed_event.unregister(occupant, src, .proc/occupant_destroyed) + GLOB.destroyed_event.unregister(occupant, src, PROC_REF(occupant_destroyed)) src.occupant.dropInto(loc) src.occupant = null update_icon() @@ -182,7 +182,7 @@ admin_attack_log(user, occupant, "Gibbed the victim", "Was gibbed", "gibbed") src.occupant.ghostize() - addtimer(new Callback(src, .proc/finish_gibbing), gib_time) + addtimer(new Callback(src, PROC_REF(finish_gibbing)), gib_time) var/list/gib_products = shuffle(occupant.harvest_meat() | occupant.harvest_skin() | occupant.harvest_bones()) if(length(gib_products) <= 0) diff --git a/code/game/machinery/mass_driver.dm b/code/game/machinery/mass_driver.dm index ea4cd8f53bf8a..aad1a418ca30d 100644 --- a/code/game/machinery/mass_driver.dm +++ b/code/game/machinery/mass_driver.dm @@ -57,12 +57,12 @@ /singleton/public_access/public_method/driver_drive name = "launch" desc = "Makes the mass driver launch immediately." - call_proc = /obj/machinery/mass_driver/proc/drive + call_proc = TYPE_PROC_REF(/obj/machinery/mass_driver, drive) /singleton/public_access/public_method/driver_drive_delayed name = "delayed launch" desc = "Makes the mass driver launch after a short delay." - call_proc = /obj/machinery/mass_driver/proc/delayed_drive + call_proc = TYPE_PROC_REF(/obj/machinery/mass_driver, delayed_drive) /singleton/stock_part_preset/radio/receiver/driver frequency = BLAST_DOORS_FREQ diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm index c22865c01b511..030905865aacd 100644 --- a/code/game/machinery/newscaster.dm +++ b/code/game/machinery/newscaster.dm @@ -909,21 +909,22 @@ var/global/list/obj/machinery/newscaster/allCasters = list() //Global list that src.attack_self(src.loc) -/obj/item/newspaper/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/newspaper/use_tool(obj/item/W, mob/living/user, list/click_params) if(istype(W, /obj/item/pen)) - if(src.scribble_page == src.curr_page) + if(scribble_page == curr_page) to_chat(user, SPAN_COLOR("blue", "There's already a scribble in this page... You wouldn't want to make things too cluttered, would you?")) else var/s = sanitize(input(user, "Write something", "Newspaper", "")) s = sanitize(s) if (!s) - return - if (!in_range(src, usr) && src.loc != usr) - return - src.scribble_page = src.curr_page - src.scribble = s - src.attack_self(user) - return + return TRUE + if (!in_range(src, usr) && loc != usr) + return TRUE + scribble_page = curr_page + scribble = s + attack_self(user) + return TRUE + return ..() ////////////////////////////////////helper procs diff --git a/code/game/machinery/nuclear_bomb.dm b/code/game/machinery/nuclear_bomb.dm index ff89950593470..34ba0141db222 100644 --- a/code/game/machinery/nuclear_bomb.dm +++ b/code/game/machinery/nuclear_bomb.dm @@ -43,7 +43,7 @@ var/global/bomb_set if(timing) playsound(loc, 'sound/items/timer.ogg',50) if(world.time > timeleft) - addtimer(new Callback(src, .proc/explode), 0) + addtimer(new Callback(src, PROC_REF(explode)), 0) SSnano.update_uis(src) /obj/machinery/nuclearbomb/use_tool(obj/item/O, mob/living/user, list/click_params) @@ -395,21 +395,21 @@ var/global/bomb_set . = ..() nuke_disks |= src // Can never be quite sure that a game mode has been properly initiated or not at this point, so always register - GLOB.moved_event.register(src, src, /obj/item/disk/nuclear/proc/check_z_level) + GLOB.moved_event.register(src, src, TYPE_PROC_REF(/obj/item/disk/nuclear, check_z_level)) /obj/item/disk/nuclear/proc/check_z_level() if(!(istype(SSticker.mode, /datum/game_mode/nuclear))) - GLOB.moved_event.unregister(src, src, /obj/item/disk/nuclear/proc/check_z_level) // However, when we are certain unregister if necessary + GLOB.moved_event.unregister(src, src, TYPE_PROC_REF(/obj/item/disk/nuclear, check_z_level)) // However, when we are certain unregister if necessary return var/turf/T = get_turf(src) if(!T || isNotStationLevel(T.z)) qdel(src) /obj/item/disk/nuclear/Destroy() - GLOB.moved_event.unregister(src, src, /obj/item/disk/nuclear/proc/check_z_level) + GLOB.moved_event.unregister(src, src, TYPE_PROC_REF(/obj/item/disk/nuclear, check_z_level)) nuke_disks -= src if(!length(nuke_disks)) - var/turf/T = pick_area_turf(/area/maintenance, list(/proc/is_station_turf, /proc/not_turf_contains_dense_objects)) + var/turf/T = pick_area_turf(/area/maintenance, list(GLOBAL_PROC_REF(is_station_turf), GLOBAL_PROC_REF(not_turf_contains_dense_objects))) if(T) var/obj/D = new /obj/item/disk/nuclear(T) log_and_message_admins("[src], the last authentication disk, has been destroyed. Spawning [D] at ([D.x], [D.y], [D.z]).", location = T) diff --git a/code/game/machinery/oxygen_pump.dm b/code/game/machinery/oxygen_pump.dm index 6ed84387c0246..76c675a058926 100644 --- a/code/game/machinery/oxygen_pump.dm +++ b/code/game/machinery/oxygen_pump.dm @@ -26,29 +26,29 @@ ..() tank = new spawn_type (src) contained = new mask_type (src) - GLOB.destroyed_event.register(tank, src, .proc/fix_deleted_tank) - GLOB.destroyed_event.register(contained, src, .proc/fix_deleted_mask) + GLOB.destroyed_event.register(tank, src, PROC_REF(fix_deleted_tank)) + GLOB.destroyed_event.register(contained, src, PROC_REF(fix_deleted_mask)) /obj/machinery/oxygen_pump/Destroy() if(breather) detach_mask(breather) - GLOB.destroyed_event.unregister(tank, src, .proc/fix_deleted_tank) - GLOB.destroyed_event.unregister(contained, src, .proc/fix_deleted_mask) + GLOB.destroyed_event.unregister(tank, src, PROC_REF(fix_deleted_tank)) + GLOB.destroyed_event.unregister(contained, src, PROC_REF(fix_deleted_mask)) QDEL_NULL(tank) QDEL_NULL(contained) return ..() /// Handler for the pump's tank being deleted, for any reason. /obj/machinery/oxygen_pump/proc/fix_deleted_tank(obj/item/tank/_tank) - GLOB.destroyed_event.unregister(_tank, src, .proc/fix_deleted_tank) + GLOB.destroyed_event.unregister(_tank, src, PROC_REF(fix_deleted_tank)) tank = new spawn_type(src) - GLOB.destroyed_event.register(tank, src, .proc/fix_deleted_tank) + GLOB.destroyed_event.register(tank, src, PROC_REF(fix_deleted_tank)) /// Handler for the pump's mask being deleted, for any reason. /obj/machinery/oxygen_pump/proc/fix_deleted_mask(obj/item/clothing/mask/breath/_mask) - GLOB.destroyed_event.unregister(_mask, src, .proc/fix_deleted_mask) + GLOB.destroyed_event.unregister(_mask, src, PROC_REF(fix_deleted_mask)) contained = new spawn_type(src) - GLOB.destroyed_event.register(contained, src, .proc/fix_deleted_mask) + GLOB.destroyed_event.register(contained, src, PROC_REF(fix_deleted_mask)) /obj/machinery/oxygen_pump/MouseDrop(mob/living/carbon/human/target, src_location, over_location) ..() @@ -88,7 +88,7 @@ if(tank) tank.forceMove(C) breather = C - GLOB.destroyed_event.register(breather, src, .proc/detach_mask) + GLOB.destroyed_event.register(breather, src, PROC_REF(detach_mask)) /obj/machinery/oxygen_pump/proc/set_internals(mob/living/carbon/C) if(C && istype(C)) @@ -106,7 +106,7 @@ visible_message(SPAN_NOTICE("\The [contained] rapidly retracts back into \the [src]!")) if(breather.internals) breather.internals.icon_state = "internal0" - GLOB.destroyed_event.unregister(breather, src, .proc/detach_mask) + GLOB.destroyed_event.unregister(breather, src, PROC_REF(detach_mask)) breather = null update_use_power(POWER_USE_IDLE) diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm index fbe78ad8fd111..b02803a1dfdf4 100644 --- a/code/game/machinery/pipe/construction.dm +++ b/code/game/machinery/pipe/construction.dm @@ -129,11 +129,9 @@ Buildable meters P.node4.build_network() return 0 -/obj/item/pipe/attackby(obj/item/W as obj, mob/user as mob) - if(!isWrench(W)) +/obj/item/pipe/use_tool(obj/item/W, mob/living/user, list/click_params) + if(!isWrench(W) || !isturf(loc)) return ..() - if (!isturf(loc)) - return 1 sanitize_dir() var/obj/machinery/atmospherics/fake_machine = constructed_path @@ -142,7 +140,7 @@ Buildable meters for(var/obj/machinery/atmospherics/M in loc) if((M.initialize_directions & pipe_dir) && M.check_connect_types_construction(M,src)) // matches at least one direction on either type of pipe & same connection type to_chat(user, SPAN_WARNING("There is already a pipe of the same type at this location.")) - return 1 + return TRUE // no conflicts found var/pipefailtext = SPAN_WARNING("There's nothing to connect this pipe section to!") //(with how the pipe code works, at least one end needs to be connected to something, otherwise the game deletes the segment)" @@ -158,19 +156,19 @@ Buildable meters if(P.pipe_class == PIPE_CLASS_UNARY) if(build_unary(P, pipefailtext)) - return 1 + return TRUE if(P.pipe_class == PIPE_CLASS_BINARY) if(build_binary(P, pipefailtext)) - return 1 + return TRUE if(P.pipe_class == PIPE_CLASS_TRINARY) if(build_trinary(P, pipefailtext)) - return 1 + return TRUE if(P.pipe_class == PIPE_CLASS_QUATERNARY) if(build_quaternary(P, pipefailtext)) - return 1 + return TRUE if(P.pipe_class == PIPE_CLASS_OMNI) P.atmos_init() @@ -182,6 +180,7 @@ Buildable meters SPAN_NOTICE("You have fastened the [src]."), \ "You hear ratchet.") qdel(src) // remove the pipe item + return TRUE /obj/item/pipe/injector name = "injector" @@ -210,17 +209,19 @@ Buildable meters /obj/item/machine_chassis var/build_type -/obj/item/machine_chassis/attackby(obj/item/W, mob/user) - if(!isWrench(W)) - return ..() - var/obj/machinery/machine = new build_type(get_turf(src), dir, FALSE) - machine.apply_component_presets() - machine.RefreshParts() - if(machine.construct_state) - machine.construct_state.post_construct(machine) - playsound(loc, 'sound/items/Ratchet.ogg', 50, 1) - to_chat(user, SPAN_NOTICE("You have fastened the [src].")) - qdel(src) +/obj/item/machine_chassis/use_tool(obj/item/W, mob/living/user, list/click_params) + if(isWrench(W)) + var/obj/machinery/machine = new build_type(get_turf(src), dir, FALSE) + machine.apply_component_presets() + machine.RefreshParts() + if(machine.construct_state) + machine.construct_state.post_construct(machine) + playsound(loc, 'sound/items/Ratchet.ogg', 50, 1) + to_chat(user, SPAN_NOTICE("You have fastened the [src].")) + qdel(src) + return TRUE + + return ..() /obj/item/machine_chassis/air_sensor name = "gas sensor" diff --git a/code/game/machinery/pipe/pipelayer.dm b/code/game/machinery/pipe/pipelayer.dm index c63b32efa8dfb..4783102369b8d 100644 --- a/code/game/machinery/pipe/pipelayer.dm +++ b/code/game/machinery/pipe/pipelayer.dm @@ -132,6 +132,6 @@ var/obj/item/pipe/P = new(w_turf) P.set_dir(p_dir) - P.attackby(W , src) + P.use_tool(W , src) return 1 diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index 5700b65397d87..ec766ec0daf4d 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -338,7 +338,7 @@ var/global/list/turret_icons if (health_mod < 0) if (!emagged && enabled) attacked = TRUE - addtimer(new Callback(src, .proc/timer_attacked), 6 SECONDS, TIMER_UNIQUE | TIMER_OVERRIDE) + addtimer(new Callback(src, PROC_REF(timer_attacked)), 6 SECONDS, TIMER_UNIQUE | TIMER_OVERRIDE) if (prob(45)) spark_system.start() @@ -367,7 +367,7 @@ var/global/list/turret_icons disabled = 1 var/power = 4 - severity - addtimer(new Callback(src,/obj/machinery/porta_turret/proc/enable), rand(60*power,600*power)) + addtimer(new Callback(src, TYPE_PROC_REF(/obj/machinery/porta_turret, enable)), rand(60*power,600*power)) ..() diff --git a/code/game/machinery/robotics_fabricator.dm b/code/game/machinery/robotics_fabricator.dm index c61008543f16b..e5865e787cf3b 100644 --- a/code/game/machinery/robotics_fabricator.dm +++ b/code/game/machinery/robotics_fabricator.dm @@ -288,6 +288,10 @@ switch(material) if(MATERIAL_STEEL) mattype = /obj/item/stack/material/steel + //[SIERRA-ADD] - Mechs-by-Shegar + if(MATERIAL_PLASTEEL) + mattype = /obj/item/stack/material/plasteel + //[SIERRA-ADD] if(MATERIAL_GLASS) mattype = /obj/item/stack/material/glass if(MATERIAL_ALUMINIUM) diff --git a/code/game/machinery/status_display_ai.dm b/code/game/machinery/status_display_ai.dm index c59277932de14..088b309817782 100644 --- a/code/game/machinery/status_display_ai.dm +++ b/code/game/machinery/status_display_ai.dm @@ -41,7 +41,7 @@ var/global/list/ai_status_emotions = list( /proc/set_ai_status_displays(mob/user as mob) var/list/ai_emotions = get_ai_emotions(user.ckey) var/emote = input("Please, select a status!", "AI Status", null, null) in ai_emotions - for (var/obj/machinery/M in SSmachines.machinery) //change status + for (var/obj/machinery/M as anything in SSmachines.get_all_machinery()) //change status if(istype(M, /obj/machinery/ai_status_display)) var/obj/machinery/ai_status_display/AISD = M AISD.emotion = emote diff --git a/code/game/machinery/suit_storage.dm b/code/game/machinery/suit_storage.dm index cd51391cf5f1b..54de96a5fe244 100644 --- a/code/game/machinery/suit_storage.dm +++ b/code/game/machinery/suit_storage.dm @@ -341,11 +341,11 @@ update_icon() SSnano.update_uis(src) - var/datum/callback/uvburn = new Callback(src, .proc/uv_burn) + var/datum/callback/uvburn = new Callback(src, PROC_REF(uv_burn)) addtimer(uvburn, 5 SECONDS) addtimer(uvburn, 10 SECONDS) addtimer(uvburn, 15 SECONDS) - addtimer(new Callback(src, .proc/uv_finish), 20 SECONDS) + addtimer(new Callback(src, PROC_REF(uv_finish)), 20 SECONDS) /obj/machinery/suit_storage_unit/proc/uv_burn() if(occupant) diff --git a/code/game/machinery/teleporter/beacon.dm b/code/game/machinery/teleporter/beacon.dm index b2785852de067..2f9f9343d3660 100644 --- a/code/game/machinery/teleporter/beacon.dm +++ b/code/game/machinery/teleporter/beacon.dm @@ -90,7 +90,7 @@ var/global/const/TELEBEACON_WIRE_SIGNALLER = 4 set_stat(MACHINE_STAT_EMPED, TRUE) disconnect_computers() var/emp_time = rand(15 SECONDS, 30 SECONDS) / severity - addtimer(new Callback(src, .proc/emp_act_end), emp_time, TIMER_UNIQUE | TIMER_OVERRIDE) + addtimer(new Callback(src, PROC_REF(emp_act_end)), emp_time, TIMER_UNIQUE | TIMER_OVERRIDE) /obj/machinery/tele_beacon/proc/emp_act_end() @@ -300,7 +300,7 @@ var/global/const/TELEBEACON_WIRE_SIGNALLER = 4 switch (index) if (TELEBEACON_WIRE_POWER) tele_beacon.set_power_cut() - addtimer(new Callback(src, .proc/ResetPulsed), rand(15 SECONDS, 45 SECONDS), TELEBEACON_WIRE_POWER) + addtimer(new Callback(src, PROC_REF(ResetPulsed)), rand(15 SECONDS, 45 SECONDS), TELEBEACON_WIRE_POWER) if (TELEBEACON_WIRE_RELAY) tele_beacon.disconnect_computers() if (TELEBEACON_WIRE_SIGNALLER) diff --git a/code/game/machinery/teleporter/console.dm b/code/game/machinery/teleporter/console.dm index b97f31534b4e3..f0294d65b31de 100644 --- a/code/game/machinery/teleporter/console.dm +++ b/code/game/machinery/teleporter/console.dm @@ -54,7 +54,7 @@ /obj/machinery/computer/teleporter/proc/clear_projector() if (!projector) return - GLOB.destroyed_event.unregister(projector, src, /obj/machinery/computer/teleporter/proc/lost_projector) + GLOB.destroyed_event.unregister(projector, src, TYPE_PROC_REF(/obj/machinery/computer/teleporter, lost_projector)) projector = null set_active(FALSE) @@ -69,13 +69,13 @@ return clear_projector() projector = _projector - GLOB.destroyed_event.register(projector, src, /obj/machinery/computer/teleporter/proc/lost_projector) + GLOB.destroyed_event.register(projector, src, TYPE_PROC_REF(/obj/machinery/computer/teleporter, lost_projector)) /obj/machinery/computer/teleporter/proc/clear_pad() if (!pad) return - GLOB.destroyed_event.unregister(pad, src, /obj/machinery/computer/teleporter/proc/lost_pad) + GLOB.destroyed_event.unregister(pad, src, TYPE_PROC_REF(/obj/machinery/computer/teleporter, lost_pad)) pad = null set_active(FALSE) @@ -90,14 +90,14 @@ return clear_pad() pad = _pad - GLOB.destroyed_event.register(pad, src, /obj/machinery/computer/teleporter/proc/lost_pad) + GLOB.destroyed_event.register(pad, src, TYPE_PROC_REF(/obj/machinery/computer/teleporter, lost_pad)) /obj/machinery/computer/teleporter/proc/clear_target() if (!target) return var/old_target = target - GLOB.destroyed_event.unregister(target, src, /obj/machinery/computer/teleporter/proc/lost_target) + GLOB.destroyed_event.unregister(target, src, TYPE_PROC_REF(/obj/machinery/computer/teleporter, lost_target)) target = null if (istype(old_target, /obj/machinery/tele_beacon)) var/obj/machinery/tele_beacon/beacon = old_target @@ -136,7 +136,7 @@ pad.interlude_chance = interlude_prob - GLOB.destroyed_event.register(target, src, /obj/machinery/computer/teleporter/proc/lost_target) + GLOB.destroyed_event.register(target, src, TYPE_PROC_REF(/obj/machinery/computer/teleporter, lost_target)) return TRUE @@ -165,7 +165,7 @@ deltimer(active_timer) active_timer = null else - active_timer = addtimer(new Callback(src, .proc/clear_target), 1 MINUTE, TIMER_UNIQUE | TIMER_OVERRIDE | TIMER_STOPPABLE) + active_timer = addtimer(new Callback(src, PROC_REF(clear_target)), 1 MINUTE, TIMER_UNIQUE | TIMER_OVERRIDE | TIMER_STOPPABLE) /obj/machinery/computer/teleporter/proc/get_targets() diff --git a/code/game/machinery/teleporter/pad.dm b/code/game/machinery/teleporter/pad.dm index 0aa36ef07b75a..72552dccc3bca 100644 --- a/code/game/machinery/teleporter/pad.dm +++ b/code/game/machinery/teleporter/pad.dm @@ -26,7 +26,7 @@ /obj/machinery/tele_pad/proc/clear_computer() if (!computer) return - GLOB.destroyed_event.unregister(computer, src, /obj/machinery/tele_pad/proc/lost_computer) + GLOB.destroyed_event.unregister(computer, src, TYPE_PROC_REF(/obj/machinery/tele_pad, lost_computer)) computer = null @@ -40,7 +40,7 @@ return clear_computer() computer = _computer - GLOB.destroyed_event.register(computer, src, /obj/machinery/tele_pad/proc/lost_computer) + GLOB.destroyed_event.register(computer, src, TYPE_PROC_REF(/obj/machinery/tele_pad, lost_computer)) /obj/machinery/tele_pad/Bumped(atom/movable/AM) diff --git a/code/game/machinery/teleporter/projector.dm b/code/game/machinery/teleporter/projector.dm index dbfcbb1348474..b80e094edd154 100644 --- a/code/game/machinery/teleporter/projector.dm +++ b/code/game/machinery/teleporter/projector.dm @@ -21,7 +21,7 @@ /obj/machinery/tele_projector/proc/clear_computer() if (!computer) return - GLOB.destroyed_event.unregister(computer, src, /obj/machinery/tele_projector/proc/lost_computer) + GLOB.destroyed_event.unregister(computer, src, TYPE_PROC_REF(/obj/machinery/tele_projector, lost_computer)) computer = null @@ -35,7 +35,7 @@ return clear_computer() computer = _computer - GLOB.destroyed_event.register(computer, src, /obj/machinery/tele_projector/proc/lost_computer) + GLOB.destroyed_event.register(computer, src, TYPE_PROC_REF(/obj/machinery/tele_projector, lost_computer)) /obj/machinery/tele_projector/power_change() diff --git a/code/game/machinery/vending/boda.dm b/code/game/machinery/vending/boda.dm index ab2a4749c3aeb..059063d750e1a 100644 --- a/code/game/machinery/vending/boda.dm +++ b/code/game/machinery/vending/boda.dm @@ -31,7 +31,7 @@ /obj/item/reagent_containers/food/drinks/cans/artbru = 0, /obj/item/reagent_containers/food/drinks/glass2/square/boda = 0, /obj/item/reagent_containers/food/drinks/glass2/square/bodaplus = 0, - /obj/item/reagent_containers/food/drinks/bottle/space_up = 0 + /obj/item/reagent_containers/food/drinks/bottle/small/space_up = 0 ) contraband = list( /obj/item/clothing/under/soviet = 1, @@ -39,7 +39,7 @@ ) rare_products = list( - /obj/item/reagent_containers/food/drinks/bottle/space_up = 50, + /obj/item/reagent_containers/food/drinks/bottle/small/space_up = 50, /obj/item/card/id/syndicate = 25, /obj/item/storage/box/syndie_kit/spy = 50 ) diff --git a/code/game/machinery/vending/boozeomat.dm b/code/game/machinery/vending/boozeomat.dm index 57b8fa6e67c11..64ba0ae3fc76e 100644 --- a/code/game/machinery/vending/boozeomat.dm +++ b/code/game/machinery/vending/boozeomat.dm @@ -77,11 +77,11 @@ /obj/item/reagent_containers/food/drinks/cans/rootbeer = 15, /obj/item/reagent_containers/food/drinks/cans/speer = 10, /obj/item/reagent_containers/food/drinks/cans/ale = 10, - /obj/item/reagent_containers/food/drinks/bottle/cola = 5, + /obj/item/reagent_containers/food/drinks/bottle/small/cola = 10, + /obj/item/reagent_containers/food/drinks/bottle/small/space_up = 10, + /obj/item/reagent_containers/food/drinks/bottle/small/space_mountain_wind = 10, /obj/item/reagent_containers/food/drinks/cans/cola_diet = 5, /obj/item/reagent_containers/food/drinks/cans/ionbru = 5, - /obj/item/reagent_containers/food/drinks/bottle/space_up = 5, - /obj/item/reagent_containers/food/drinks/bottle/space_mountain_wind = 5, /obj/item/reagent_containers/food/drinks/cans/beastenergy = 5, /obj/item/reagent_containers/food/drinks/tea/black = 15, /obj/item/reagent_containers/food/drinks/bottle/orangejuice = 2, diff --git a/code/game/machinery/vending/dinnerware.dm b/code/game/machinery/vending/dinnerware.dm index 82081312758d7..0d38f5b7df385 100644 --- a/code/game/machinery/vending/dinnerware.dm +++ b/code/game/machinery/vending/dinnerware.dm @@ -32,7 +32,7 @@ /obj/item/reagent_containers/food/drinks/glass2/carafe = 2, /obj/item/reagent_containers/food/drinks/glass2/square = 8, /obj/item/clothing/suit/chef/classic = 2, - /obj/item/storage/lunchbox = 3, + /obj/item/storage/lunchbox/rainbow = 3, /obj/item/storage/lunchbox/heart = 3, /obj/item/storage/lunchbox/cat = 3, /obj/item/storage/lunchbox/nt = 3, diff --git a/code/game/machinery/vending/games.dm b/code/game/machinery/vending/games.dm index e91a6ef90c2ba..0bf0c62feb5cd 100644 --- a/code/game/machinery/vending/games.dm +++ b/code/game/machinery/vending/games.dm @@ -38,7 +38,9 @@ /obj/item/board = 2, /obj/item/storage/fancy/crayons = 3, /obj/item/reagent_containers/spray/waterflower = 10, - /obj/item/storage/box/snappops = 15 + /obj/item/storage/box/snappops = 15, + /obj/structure/plushie/carp = 10, + /obj/structure/plushie/beepsky = 10 ) products = list( /obj/item/toy/blink = 0, @@ -56,7 +58,9 @@ /obj/item/board = 0, /obj/item/storage/fancy/crayons = 0, /obj/item/reagent_containers/spray/waterflower = 0, - /obj/item/storage/box/snappops = 0 + /obj/item/storage/box/snappops = 0, + /obj/structure/plushie/carp = 0, + /obj/structure/plushie/beepsky = 0 ) rare_products = list( /obj/item/reagent_containers/spray/waterflower = 30, diff --git a/code/game/machinery/vending/props.dm b/code/game/machinery/vending/props.dm index 7e55aff9f3189..9df10aa019c6c 100644 --- a/code/game/machinery/vending/props.dm +++ b/code/game/machinery/vending/props.dm @@ -8,7 +8,7 @@ /obj/structure/flora/pottedplant = 2, /obj/item/device/flashlight/lamp = 2, /obj/item/device/flashlight/lamp/green = 2, - /obj/item/reagent_containers/food/drinks/jar = 1, + /obj/item/glass_jar = 1, /obj/item/nullrod = 1, /obj/item/toy/cultsword = 4, /obj/item/toy/katana = 2 diff --git a/code/game/machinery/wall_frames.dm b/code/game/machinery/wall_frames.dm index 613ecf0a98508..0f38f92499b87 100644 --- a/code/game/machinery/wall_frames.dm +++ b/code/game/machinery/wall_frames.dm @@ -9,12 +9,12 @@ var/refund_type = /obj/item/stack/material/steel var/reverse = 0 //if resulting object faces opposite its dir (like light fixtures) -/obj/item/frame/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/frame/use_tool(obj/item/W, mob/living/user, list/click_params) if(isWrench(W)) new refund_type( get_turf(src.loc), refund_amt) qdel(src) - return - ..() + return TRUE + return ..() /obj/item/frame/proc/try_build(turf/on_wall) if(!build_machine_type) diff --git a/code/game/machinery/washing_machine.dm b/code/game/machinery/washing_machine.dm index 81e8c4907570c..46c9e1d2b7504 100644 --- a/code/game/machinery/washing_machine.dm +++ b/code/game/machinery/washing_machine.dm @@ -68,7 +68,7 @@ update_use_power(POWER_USE_ACTIVE) update_icon() - addtimer(new Callback(src, /obj/machinery/washing_machine/proc/wash), 20 SECONDS) + addtimer(new Callback(src, TYPE_PROC_REF(/obj/machinery/washing_machine, wash)), 20 SECONDS) /obj/machinery/washing_machine/proc/wash() for(var/atom/A in (contents - component_parts)) @@ -86,7 +86,7 @@ C.ironed_state = WRINKLES_WRINKLY if(detergent) C.change_smell(SMELL_CLEAN) - addtimer(new Callback(C, /obj/item/clothing/proc/change_smell), detergent.smell_clean_time, TIMER_UNIQUE | TIMER_OVERRIDE) + addtimer(new Callback(C, TYPE_PROC_REF(/obj/item/clothing, change_smell)), detergent.smell_clean_time, TIMER_UNIQUE | TIMER_OVERRIDE) QDEL_NULL(detergent) //Tanning! diff --git a/code/game/objects/auras/aura.dm b/code/game/objects/auras/aura.dm index d0637e4eb4114..89b1979eafd8b 100644 --- a/code/game/objects/auras/aura.dm +++ b/code/game/objects/auras/aura.dm @@ -1,4 +1,4 @@ -/*Auras are simple: They are simple overriders for attackbys, bullet_act, damage procs, etc. They also tick after their respective mob. +/*Auras are simple: They are simple overriders for use_weapon, bullet_act, damage procs, etc. They also tick after their respective mob. They should be used for undeterminate mob effects, like for instance a toggle-able forcefield, or indestructability as long as you don't move. They should also be used for when you want to effect the ENTIRE mob, like having an armor buff or showering candy everytime you walk. */ diff --git a/code/game/objects/buckling.dm b/code/game/objects/buckling.dm index eb24482cd94b9..83d35d44d2afd 100644 --- a/code/game/objects/buckling.dm +++ b/code/game/objects/buckling.dm @@ -237,7 +237,7 @@ M.UpdateLyingBuckledAndVerbStatus() M.update_floating() buckled_mob = M - GLOB.destroyed_event.register(buckled_mob, src, /obj/proc/clear_buckle) + GLOB.destroyed_event.register(buckled_mob, src, TYPE_PROC_REF(/obj, clear_buckle)) if (buckle_sound) playsound(src, buckle_sound, 20) post_buckle_mob(M) @@ -254,7 +254,7 @@ if (buckled_mob.buckled != src) log_debug(append_admin_tools("A buckled mob ([buckled_mob.name] ([buckled_mob.type])) is buckled to multiple objects at once. This has been auto-corrected.", buckled_mob, get_turf(src))) buckled_mob = null - GLOB.destroyed_event.unregister(., src, /obj/proc/clear_buckle) + GLOB.destroyed_event.unregister(., src, TYPE_PROC_REF(/obj, clear_buckle)) return . = buckled_mob buckled_mob.buckled = null @@ -263,7 +263,7 @@ buckled_mob.update_floating() buckled_mob = null - GLOB.destroyed_event.unregister(., src, /obj/proc/clear_buckle) + GLOB.destroyed_event.unregister(., src, TYPE_PROC_REF(/obj, clear_buckle)) post_buckle_mob(.) @@ -278,7 +278,7 @@ buckled_mob = null // In case unbuckle failed if (_buckled_mob.buckled == src) _buckled_mob.buckled = null - GLOB.destroyed_event.unregister(., src, /obj/proc/clear_buckle) + GLOB.destroyed_event.unregister(., src, TYPE_PROC_REF(/obj, clear_buckle)) /obj/proc/post_buckle_mob(mob/living/M) if (buckle_pixel_shift) diff --git a/code/game/objects/effects/chem/foam.dm b/code/game/objects/effects/chem/foam.dm index 1b1bedcd6767a..d1129adcec254 100644 --- a/code/game/objects/effects/chem/foam.dm +++ b/code/game/objects/effects/chem/foam.dm @@ -23,7 +23,7 @@ spawn(3 + metal * 3) Process() checkReagents() - addtimer(new Callback(src, .proc/remove_foam), 12 SECONDS) + addtimer(new Callback(src, PROC_REF(remove_foam)), 12 SECONDS) /obj/effect/foam/proc/remove_foam() STOP_PROCESSING(SSobj, src) diff --git a/code/game/objects/effects/decals/Cleanable/humans.dm b/code/game/objects/effects/decals/Cleanable/humans.dm index 3d6f1bef6a4fb..98a5eca768449 100644 --- a/code/game/objects/effects/decals/Cleanable/humans.dm +++ b/code/game/objects/effects/decals/Cleanable/humans.dm @@ -286,7 +286,7 @@ var/global/list/image/splatter_cache=list() /obj/decal/cleanable/mucus/Initialize() . = ..() - addtimer(new Callback(src, .proc/set_dry), DRYING_TIME * 2) + addtimer(new Callback(src, PROC_REF(set_dry)), DRYING_TIME * 2) /obj/decal/cleanable/mucus/proc/set_dry() dry = TRUE diff --git a/code/game/objects/effects/effect_system.dm b/code/game/objects/effects/effect_system.dm index de223d759cf58..5322ba62fe110 100644 --- a/code/game/objects/effects/effect_system.dm +++ b/code/game/objects/effects/effect_system.dm @@ -69,7 +69,7 @@ would spawn and follow the beaker, even if it is carried or thrown. /datum/effect/steam_spread/start() var/i = 0 for(i=0, i 20) return - addtimer(new Callback(src, /datum/effect/proc/spread, i), 0) + addtimer(new Callback(src, TYPE_PROC_REF(/datum/effect, spread), i), 0) /datum/effect/smoke_spread/spread(i) if(holder) diff --git a/code/game/objects/effects/explosion_particles.dm b/code/game/objects/effects/explosion_particles.dm index 573caddc1fdd3..1f8139dd83826 100644 --- a/code/game/objects/effects/explosion_particles.dm +++ b/code/game/objects/effects/explosion_particles.dm @@ -53,7 +53,7 @@ var/datum/effect/expl_particles/P = new P.set_up(10,location) P.start() - addtimer(new Callback(src, .proc/make_smoke), 5) + addtimer(new Callback(src, PROC_REF(make_smoke)), 5) /datum/effect/explosion/proc/make_smoke() var/datum/effect/smoke_spread/S = new diff --git a/code/game/objects/effects/gibs.dm b/code/game/objects/effects/gibs.dm index bdda2a2048d5f..63fe2c56657b1 100644 --- a/code/game/objects/effects/gibs.dm +++ b/code/game/objects/effects/gibs.dm @@ -58,5 +58,5 @@ continue var/list/directions = gibdirections[i] if (length(directions)) - addtimer(new Callback(gib, /obj/decal/cleanable/blood/gibs/proc/streak, directions), 0) + addtimer(new Callback(gib, TYPE_PROC_REF(/obj/decal/cleanable/blood/gibs, streak), directions), 0) qdel(src) diff --git a/code/game/objects/effects/overlays.dm b/code/game/objects/effects/overlays.dm index cd0643b335a8c..32c7f08d5cc77 100644 --- a/code/game/objects/effects/overlays.dm +++ b/code/game/objects/effects/overlays.dm @@ -77,7 +77,7 @@ if (delete_time <= 0) log_debug(append_admin_tools("A self deleting overlay ([src]) was spawned with a negative or zero delete time ([delete_time]) and was instantly deleted.", location = get_turf(src))) return INITIALIZE_HINT_QDEL - addtimer(new Callback(src, .proc/self_delete), delete_time) + addtimer(new Callback(src, PROC_REF(self_delete)), delete_time) /obj/overlay/self_deleting/proc/self_delete() diff --git a/code/game/objects/effects/spiders.dm b/code/game/objects/effects/spiders.dm index 82a30b72ede08..0cc6526b01c99 100644 --- a/code/game/objects/effects/spiders.dm +++ b/code/game/objects/effects/spiders.dm @@ -129,7 +129,7 @@ dormant = FALSE if(dormant) - GLOB.moved_event.register(src, src, /obj/spider/spiderling/proc/disturbed) + GLOB.moved_event.register(src, src, TYPE_PROC_REF(/obj/spider/spiderling, disturbed)) else START_PROCESSING(SSobj, src) @@ -147,7 +147,7 @@ /obj/spider/spiderling/Destroy() if(dormant) - GLOB.moved_event.unregister(src, src, /obj/spider/spiderling/proc/disturbed) + GLOB.moved_event.unregister(src, src, TYPE_PROC_REF(/obj/spider/spiderling, disturbed)) STOP_PROCESSING(SSobj, src) . = ..() @@ -167,7 +167,7 @@ return dormant = FALSE - GLOB.moved_event.unregister(src, src, /obj/spider/spiderling/proc/disturbed) + GLOB.moved_event.unregister(src, src, TYPE_PROC_REF(/obj/spider/spiderling, disturbed)) START_PROCESSING(SSobj, src) /obj/spider/spiderling/Bump(atom/user) @@ -193,7 +193,7 @@ if(prob(50)) audible_message(SPAN_NOTICE("You hear something squeezing through the ventilation ducts.")) forceMove(exit_vent) - addtimer(new Callback(src, .proc/end_vent_moving, exit_vent), travel_time) + addtimer(new Callback(src, PROC_REF(end_vent_moving), exit_vent), travel_time) /obj/spider/spiderling/proc/end_vent_moving(obj/machinery/atmospherics/unary/vent_pump/exit_vent) if(check_vent(exit_vent)) @@ -227,7 +227,7 @@ forceMove(entry_vent) var/travel_time = round(get_dist(loc, exit_vent.loc) / 2) - addtimer(new Callback(src, .proc/start_vent_moving, exit_vent, travel_time), travel_time + rand(20,60)) + addtimer(new Callback(src, PROC_REF(start_vent_moving), exit_vent, travel_time), travel_time + rand(20,60)) travelling_in_vent = TRUE return else diff --git a/code/game/objects/explosion_recursive.dm b/code/game/objects/explosion_recursive.dm index 2ddf33a99ff19..36b6bae881c06 100644 --- a/code/game/objects/explosion_recursive.dm +++ b/code/game/objects/explosion_recursive.dm @@ -64,7 +64,7 @@ var/global/explosion_in_progress = 0 if(AM && AM.simulated && !T.protects_atom(AM)) AM.ex_act(severity) if(!QDELETED(AM) && !AM.anchored) - addtimer(new Callback(AM, /atom/movable/.proc/throw_at, throw_target, 9/severity, 9/severity), 0) + addtimer(new Callback(AM, TYPE_PROC_REF(/atom/movable, throw_at), throw_target, 9/severity, 9/severity), 0) explosion_turfs.Cut() explosion_in_progress = 0 diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index b408a5ce0f5d9..074b31494c42e 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -22,7 +22,7 @@ // causeerrorheresoifixthis var/obj/item/master = null var/list/origin_tech = null //Used by R&D to determine what research bonuses it grants. - ///Used in use_weapon() and attackby() to say how something was attacked "[x] has been [z.attack_verb] by [y] with [z]" + ///Used in use_weapon() to say how something was attacked "[x] has been [z.attack_verb] by [y] with [z]" var/list/attack_verb = list("attacked") var/lock_picking_level = 0 //used to determine whether something can pick a lock, and how well. var/force = 0 @@ -293,23 +293,6 @@ return TRUE return ..() - -///Eventually should be deleted in favor of use_tool; keeping duplicate until downstream attackbys are replaced. -/obj/item/attackby(obj/item/item, mob/living/user, list/click_params) - if (SSfabrication.try_craft_with(src, item, user)) - return TRUE - if (istype(item, /obj/item/storage) && isturf(loc)) - var/obj/item/storage/storage = item - if (!storage.allow_quick_gather) - return ..() - if (!storage.quick_gather_single) - storage.gather_all(loc, user) - else if (storage.can_be_inserted(src, user)) - storage.handle_item_insertion(src) - return TRUE - return ..() - - /obj/item/can_embed() if (!canremove) return FALSE @@ -334,7 +317,7 @@ GLOB.item_unequipped_event.raise_event(src, user) if(user && (z_flags & ZMM_MANGLE_PLANES)) - addtimer(new Callback(user, /mob/proc/check_emissive_equipment), 0, TIMER_UNIQUE) + addtimer(new Callback(user, TYPE_PROC_REF(/mob, check_emissive_equipment)), 0, TIMER_UNIQUE) // called just as an item is picked up (loc is not yet changed) @@ -375,7 +358,7 @@ note this isn't called during the initial dressing of a player GLOB.item_equipped_event.raise_event(src, user, slot) if(user && (z_flags & ZMM_MANGLE_PLANES)) - addtimer(new Callback(user, /mob/proc/check_emissive_equipment), 0, TIMER_UNIQUE) + addtimer(new Callback(user, TYPE_PROC_REF(/mob, check_emissive_equipment)), 0, TIMER_UNIQUE) /obj/item/proc/equipped_robot(mob/user) @@ -592,7 +575,8 @@ var/global/list/slot_flags_enumeration = list( if(!istype(attacker)) return 0 attacker.apply_damage(force, damtype, attacker.hand ? BP_L_HAND : BP_R_HAND, used_weapon = src) - attacker.visible_message(SPAN_DANGER("[attacker] hurts \his hand on [src]!")) + var/datum/pronouns/pronouns = attacker.choose_from_pronouns() + attacker.visible_message(SPAN_DANGER("[attacker] hurts [pronouns.his] hand on \the [src]!")) admin_attack_log(attacker, target, "Attempted to disarm but was blocked", "Was targeted with a disarm but blocked the attack", "attmpted to disarm but was blocked by") playsound(target, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) playsound(target, hitsound, 50, 1, -1) @@ -792,12 +776,12 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out. user.client.view = viewsize zoom = 1 - GLOB.destroyed_event.register(src, src, /obj/item/proc/unzoom) - GLOB.moved_event.register(user, src, /obj/item/proc/unzoom) - GLOB.dir_set_event.register(user, src, /obj/item/proc/unzoom) - GLOB.item_unequipped_event.register(src, user, /mob/living/proc/unzoom) + GLOB.destroyed_event.register(src, src, TYPE_PROC_REF(/obj/item, unzoom)) + GLOB.moved_event.register(user, src, TYPE_PROC_REF(/obj/item, unzoom)) + GLOB.dir_set_event.register(user, src, TYPE_PROC_REF(/obj/item, unzoom)) + GLOB.item_unequipped_event.register(src, user, TYPE_PROC_REF(/mob/living, unzoom)) - GLOB.stat_set_event.register(user, src, /obj/item/proc/unzoom) + GLOB.stat_set_event.register(user, src, TYPE_PROC_REF(/obj/item, unzoom)) user.visible_message("\The [user] peers through [zoomdevicename ? "the [zoomdevicename] of [src]" : "[src]"].") @@ -810,22 +794,22 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out. return zoom = 0 - GLOB.destroyed_event.unregister(src, src, /obj/item/proc/unzoom) - GLOB.moved_event.unregister(user, src, /obj/item/proc/unzoom) - GLOB.dir_set_event.unregister(user, src, /obj/item/proc/unzoom) - GLOB.item_unequipped_event.unregister(src, user, /mob/living/proc/unzoom) + GLOB.destroyed_event.unregister(src, src, TYPE_PROC_REF(/obj/item, unzoom)) + GLOB.moved_event.unregister(user, src, TYPE_PROC_REF(/obj/item, unzoom)) + GLOB.dir_set_event.unregister(user, src, TYPE_PROC_REF(/obj/item, unzoom)) + GLOB.item_unequipped_event.unregister(src, user, TYPE_PROC_REF(/mob/living, unzoom)) user = user == src ? loc : (user || loc) if(!istype(user)) crash_with("[log_info_line(src)]: Zoom user lost]") return - GLOB.stat_set_event.unregister(user, src, /obj/item/proc/unzoom) + GLOB.stat_set_event.unregister(user, src, TYPE_PROC_REF(/obj/item, unzoom)) if(!user.client) return - user.client.view = world.view + user.client.view = user.get_preference_value(/datum/client_preference/client_view) if(!user.hud_used.hud_shown) user.toggle_zoom_hud() diff --git a/code/game/objects/items/apc_frame.dm b/code/game/objects/items/apc_frame.dm index 38b3cc88b84ac..7d30bdd8bf3e4 100644 --- a/code/game/objects/items/apc_frame.dm +++ b/code/game/objects/items/apc_frame.dm @@ -7,12 +7,6 @@ icon_state = "apc_frame" obj_flags = OBJ_FLAG_CONDUCTIBLE -/obj/item/frame/apc/attackby(obj/item/W as obj, mob/user as mob) - ..() - if(isWrench(W)) - new /obj/item/stack/material/steel( get_turf(src.loc), 2 ) - qdel(src) - /obj/item/frame/apc/try_build(turf/on_wall) if (get_dist(on_wall,usr)>1) return @@ -27,7 +21,7 @@ if (A.requires_power == 0 || istype(A, /area/space)) to_chat(usr, SPAN_WARNING("APC cannot be placed in this area.")) return - if (A.get_apc()) + if (A.apc) to_chat(usr, SPAN_WARNING("This area already has an APC.")) return //only one APC per area for(var/obj/machinery/power/terminal/T in loc) diff --git a/code/game/objects/items/buttons.dm b/code/game/objects/items/buttons.dm index 1c2e209216d68..37e9cc0a5b77f 100644 --- a/code/game/objects/items/buttons.dm +++ b/code/game/objects/items/buttons.dm @@ -6,6 +6,7 @@ icon = 'icons/obj/structures/buttons.dmi' icon_state = "light-p" obj_flags = OBJ_FLAG_CONDUCTIBLE + refund_amt = 1 /obj/item/frame/light_switch/windowtint name = "window tint switch frame" @@ -58,28 +59,24 @@ GLOBAL_LIST_INIT(possible_switch_offsets, list( break return 1 -/obj/item/frame/light_switch/attackby(obj/item/tool as obj, mob/user as mob) //construction - if(isWrench(tool)) - new /obj/item/stack/material/steel( get_turf(src.loc), 1 ) - qdel(src) - else if (isScrewdriver(tool) && isturf(user.loc)) +/obj/item/frame/light_switch/use_tool(obj/item/tool, mob/living/user, list/click_params) + if (isScrewdriver(tool) && isturf(user.loc)) var/obj/machinery/light_switch/S = new (user.loc) if(position_with_direction(S, user)) - to_chat(user, "You fasten \the [S] with your [tool].") + to_chat(user, "You fasten \the [S] with your \the [tool].") qdel(src) else qdel(S) - else ..() + return TRUE + return ..() -/obj/item/frame/light_switch/windowtint/attackby(obj/item/tool as obj, mob/user as mob) - if(isWrench(tool)) - new /obj/item/stack/material/steel( get_turf(src.loc), 1 ) - qdel(src) - else if (isScrewdriver(tool) && isturf(user.loc)) +/obj/item/frame/light_switch/windowtint/use_tool(obj/item/tool, mob/living/user, list/click_params) + if (isScrewdriver(tool) && isturf(user.loc)) var/obj/machinery/button/windowtint/S = new(user.loc) if(position_with_direction(S, user)) to_chat(user, "You fasten \the [S] with your [tool].") qdel(src) else qdel(S) - else ..() + return TRUE + return ..() diff --git a/code/game/objects/items/contraband.dm b/code/game/objects/items/contraband.dm index 25fb6acfc34dd..b4db3c2dc93b5 100644 --- a/code/game/objects/items/contraband.dm +++ b/code/game/objects/items/contraband.dm @@ -28,6 +28,7 @@ list(/datum/reagent/drugs/mindbreaker = 10, /datum/reagent/drugs/hextro = 20) = 3, list(/datum/reagent/toxin/carpotoxin = 15) = 2, list(/datum/reagent/impedrezene = 15) = 2, + list(/datum/reagent/toxin/amatoxin = 15) = 2, list(/datum/reagent/toxin/zombiepowder = 10) = 1) /obj/item/reagent_containers/glass/beaker/vial/random/New() @@ -75,7 +76,7 @@ // Proc to shove them up your nose -/obj/item/reagent_containers/powder/attackby(obj/item/W, mob/living/user) +/obj/item/reagent_containers/powder/use_tool(obj/item/W, mob/living/user, list/click_params) if(istype(W, /obj/item/glass_extra/straw) || istype(W, /obj/item/paper/cig) || istype(W, /obj/item/spacecash)) if(!user.check_has_mouth()) // We dont want dionae or adherents doing lines of cocaine. Probably. to_chat(SPAN_WARNING("Without a nose, you seem unable to snort from \the [src].")) diff --git a/code/game/objects/items/devices/binoculars.dm b/code/game/objects/items/devices/binoculars.dm index c5161d5bff9f4..2cc520b8959a8 100644 --- a/code/game/objects/items/devices/binoculars.dm +++ b/code/game/objects/items/devices/binoculars.dm @@ -12,6 +12,7 @@ throwforce = 5.0 throw_range = 15 throw_speed = 3 + matter = list(MATERIAL_GLASS = 200) /obj/item/device/binoculars/attack_self(mob/user) diff --git a/code/game/objects/items/devices/boombox.dm b/code/game/objects/items/devices/boombox.dm index f9c1ff11c454a..f16b3ba979994 100644 --- a/code/game/objects/items/devices/boombox.dm +++ b/code/game/objects/items/devices/boombox.dm @@ -64,7 +64,7 @@ to_chat(user, SPAN_ITALIC(message)) -/obj/item/boombox/attackby(obj/item/item, mob/user) +/obj/item/boombox/use_tool(obj/item/item, mob/living/user, list/click_params) set waitfor = FALSE if(isScrewdriver(item)) var/item_loc = item.loc diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm index 59ff8193c7e27..856b409ddf8cd 100644 --- a/code/game/objects/items/devices/flashlight.dm +++ b/code/game/objects/items/devices/flashlight.dm @@ -110,7 +110,8 @@ vision = H.internal_organs_by_name[H.species.vision_organ] if(!vision) vision = H.species.has_organ[H.species.vision_organ] - to_chat(user, SPAN_WARNING("\The [H] is missing \his [initial(vision.name)]!")) + var/datum/pronouns/pronouns = H.choose_from_pronouns() + to_chat(user, SPAN_WARNING("\The [H] is missing [pronouns.his] [initial(vision.name)]!")) return TRUE user.visible_message(SPAN_NOTICE("\The [user] directs [src] into [M]'s [vision.name]."), \ @@ -246,8 +247,6 @@ flashlight_range = 5 light_wedge = LIGHT_OMNI - on = 1 - // green-shaded desk lamp /obj/item/device/flashlight/lamp/green desc = "A classic green-shaded desk lamp." diff --git a/code/game/objects/items/devices/gps.dm b/code/game/objects/items/devices/gps.dm index b04b12b5af725..d4a3e9577edab 100644 --- a/code/game/objects/items/devices/gps.dm +++ b/code/game/objects/items/devices/gps.dm @@ -39,7 +39,7 @@ var/global/list/all_gps_units = list() global.all_gps_units += src . = ..() name = "[initial(name)] ([gps_tag])" - GLOB.moved_event.register(holder, src, .proc/update_holder) + GLOB.moved_event.register(holder, src, PROC_REF(update_holder)) compass = new(src) update_holder() update_icon() @@ -66,8 +66,8 @@ var/global/list/all_gps_units = list() if(!force_clear && istype(loc, /mob)) holder = loc - GLOB.moved_event.register(holder, src, .proc/update_compass) - GLOB.dir_set_event.register(holder, src, .proc/update_compass) + GLOB.moved_event.register(holder, src, PROC_REF(update_compass)) + GLOB.dir_set_event.register(holder, src, PROC_REF(update_compass)) if(!force_clear && holder && tracking) if(!is_in_processing_list) @@ -104,7 +104,7 @@ var/global/list/all_gps_units = list() STOP_PROCESSING(SSobj, src) is_in_processing_list = FALSE global.all_gps_units -= src - GLOB.moved_event.unregister(holder, src, .proc/update_holder) + GLOB.moved_event.unregister(holder, src, PROC_REF(update_holder)) update_holder(force_clear = TRUE) QDEL_NULL(compass) return ..() @@ -190,7 +190,7 @@ var/global/list/all_gps_units = list() var/duration = 5 MINUTES / severity_modifier emped = TRUE update_icon() - addtimer(new Callback(src, .proc/reset_emp), duration) + addtimer(new Callback(src, PROC_REF(reset_emp)), duration) GLOB.empd_event.raise_event(src, severity) /obj/item/device/gps/proc/reset_emp() diff --git a/code/game/objects/items/devices/hacktool.dm b/code/game/objects/items/devices/hacktool.dm index 4ce3650df3fda..09acb650dde88 100644 --- a/code/game/objects/items/devices/hacktool.dm +++ b/code/game/objects/items/devices/hacktool.dm @@ -69,7 +69,7 @@ to_chat(user, SPAN_NOTICE("Your hacking attempt was succesful!")) user.playsound_local(get_turf(src), 'sound/piano/A#6.ogg', 50) known_targets.Insert(1, target) // Insert the newly hacked target first, - GLOB.destroyed_event.register(target, src, /obj/item/device/multitool/hacktool/proc/on_target_destroy) + GLOB.destroyed_event.register(target, src, TYPE_PROC_REF(/obj/item/device/multitool/hacktool, on_target_destroy)) else to_chat(user, SPAN_WARNING("Your hacking attempt failed!")) return 1 diff --git a/code/game/objects/items/devices/inducer.dm b/code/game/objects/items/devices/inducer.dm index 6c14dd37d3bb5..fce6bc4937566 100644 --- a/code/game/objects/items/devices/inducer.dm +++ b/code/game/objects/items/devices/inducer.dm @@ -55,28 +55,33 @@ return FALSE -/obj/item/inducer/attackby(obj/item/W, mob/user) +/obj/item/inducer/use_tool(obj/item/W, mob/living/user, list/click_params) if(isScrewdriver(W)) opened = !opened to_chat(user, SPAN_NOTICE("You [opened ? "open" : "close"] the battery compartment.")) update_icon() + return TRUE + if(istype(W, /obj/item/cell)) if (istype(W, /obj/item/cell/device)) to_chat(user, SPAN_WARNING("\The [src] only takes full-size power cells.")) - return + return TRUE if(opened) if(!cell) if(!user.unEquip(W, src)) - return + FEEDBACK_UNEQUIP_FAILURE(user, W) + return TRUE to_chat(user, SPAN_NOTICE("You insert \the [W] into \the [src].")) cell = W update_icon() - return + return TRUE else to_chat(user, SPAN_NOTICE("\The [src] already has \a [cell] installed!")) - return + return TRUE + if(CannotUse(user) || recharge(W, user)) - return + return TRUE + return ..() /obj/item/inducer/proc/recharge(atom/A, mob/user) @@ -178,10 +183,10 @@ failsafe = 0.2 cell = null -/obj/item/inducer/borg/attackby(obj/item/W, mob/user) +/obj/item/inducer/borg/use_tool(obj/item/W, mob/living/user, list/click_params) if(isScrewdriver(W)) - return - . = ..() + return FALSE + return ..() /obj/item/inducer/borg/on_update_icon() . = ..() diff --git a/code/game/objects/items/devices/multitool.dm b/code/game/objects/items/devices/multitool.dm index d3ad411047c77..7be079a5ed206 100644 --- a/code/game/objects/items/devices/multitool.dm +++ b/code/game/objects/items/devices/multitool.dm @@ -47,7 +47,7 @@ unregister_buffer(buffer_object) buffer_object = buffer if(buffer_object) - GLOB.destroyed_event.register(buffer_object, src, /obj/item/device/multitool/proc/unregister_buffer) + GLOB.destroyed_event.register(buffer_object, src, TYPE_PROC_REF(/obj/item/device/multitool, unregister_buffer)) /obj/item/device/multitool/proc/unregister_buffer(atom/buffer_to_unregister) // Only remove the buffered object, don't reset the name diff --git a/code/game/objects/items/devices/paicard.dm b/code/game/objects/items/devices/paicard.dm index 1fff8a8ac8bfa..15a4c60fcd727 100644 --- a/code/game/objects/items/devices/paicard.dm +++ b/code/game/objects/items/devices/paicard.dm @@ -22,11 +22,6 @@ /obj/item/device/paicard/Initialize() . = ..() AddOverlays("pai-off") - if (!pai) - pai = new /mob/living/silicon/pai(src) - pai.card = src - pai.CreateRadio() - /obj/item/device/paicard/Destroy() //Will stop people throwing friend pAIs into the singularity so they can respawn diff --git a/code/game/objects/items/devices/paint_sprayer.dm b/code/game/objects/items/devices/paint_sprayer.dm index f39d3efa23fd1..27d9c5047d94e 100644 --- a/code/game/objects/items/devices/paint_sprayer.dm +++ b/code/game/objects/items/devices/paint_sprayer.dm @@ -97,20 +97,20 @@ var/datum/click_handler/default/paint_sprayer/CH = user.click_handlers[1] CH.paint_sprayer = src if (isrobot(user)) - GLOB.module_deselected_event.register(user, src, /obj/item/device/paint_sprayer/proc/remove_click_handler) - GLOB.module_deactivated_event.register(user, src, /obj/item/device/paint_sprayer/proc/remove_click_handler) + GLOB.module_deselected_event.register(user, src, TYPE_PROC_REF(/obj/item/device/paint_sprayer, remove_click_handler)) + GLOB.module_deactivated_event.register(user, src, TYPE_PROC_REF(/obj/item/device/paint_sprayer, remove_click_handler)) else - GLOB.hands_swapped_event.register(user, src, /obj/item/device/paint_sprayer/proc/remove_click_handler) - GLOB.mob_equipped_event.register(user, src, /obj/item/device/paint_sprayer/proc/remove_click_handler) - GLOB.mob_unequipped_event.register(user, src, /obj/item/device/paint_sprayer/proc/remove_click_handler) + GLOB.hands_swapped_event.register(user, src, TYPE_PROC_REF(/obj/item/device/paint_sprayer, remove_click_handler)) + GLOB.mob_equipped_event.register(user, src, TYPE_PROC_REF(/obj/item/device/paint_sprayer, remove_click_handler)) + GLOB.mob_unequipped_event.register(user, src, TYPE_PROC_REF(/obj/item/device/paint_sprayer, remove_click_handler)) /obj/item/device/paint_sprayer/proc/remove_click_handler(mob/user) if (user.RemoveClickHandler(/datum/click_handler/default/paint_sprayer)) - GLOB.hands_swapped_event.unregister(user, src, /obj/item/device/paint_sprayer/proc/remove_click_handler) - GLOB.mob_equipped_event.unregister(user, src, /obj/item/device/paint_sprayer/proc/remove_click_handler) - GLOB.mob_unequipped_event.unregister(user, src, /obj/item/device/paint_sprayer/proc/remove_click_handler) - GLOB.module_deselected_event.unregister(user, src, /obj/item/device/paint_sprayer/proc/remove_click_handler) - GLOB.module_deactivated_event.unregister(user, src, /obj/item/device/paint_sprayer/proc/remove_click_handler) + GLOB.hands_swapped_event.unregister(user, src, TYPE_PROC_REF(/obj/item/device/paint_sprayer, remove_click_handler)) + GLOB.mob_equipped_event.unregister(user, src, TYPE_PROC_REF(/obj/item/device/paint_sprayer, remove_click_handler)) + GLOB.mob_unequipped_event.unregister(user, src, TYPE_PROC_REF(/obj/item/device/paint_sprayer, remove_click_handler)) + GLOB.module_deselected_event.unregister(user, src, TYPE_PROC_REF(/obj/item/device/paint_sprayer, remove_click_handler)) + GLOB.module_deactivated_event.unregister(user, src, TYPE_PROC_REF(/obj/item/device/paint_sprayer, remove_click_handler)) /obj/item/device/paint_sprayer/use_before(atom/target, mob/living/user, click_parameters) if (apply_paint(target, user, click_parameters)) diff --git a/code/game/objects/items/devices/slide_projector.dm b/code/game/objects/items/devices/slide_projector.dm index df18146ef7306..17e642054043a 100644 --- a/code/game/objects/items/devices/slide_projector.dm +++ b/code/game/objects/items/devices/slide_projector.dm @@ -75,7 +75,7 @@ /obj/item/storage/slide_projector/proc/stop_projecting() if(projection) QDEL_NULL(projection) - GLOB.moved_event.unregister(src, src, .proc/check_projections) + GLOB.moved_event.unregister(src, src, PROC_REF(check_projections)) set_light(0) update_icon() @@ -92,7 +92,7 @@ break projection = new projection_type(target) projection.set_source(current_slide) - GLOB.moved_event.register(src, src, .proc/check_projections) + GLOB.moved_event.register(src, src, PROC_REF(check_projections)) set_light(1, 0.1, COLOR_WHITE) //Bit of light update_icon() diff --git a/code/game/objects/items/devices/suit_sensor_jammer.dm b/code/game/objects/items/devices/suit_sensor_jammer.dm index e6930d86e25ab..78de84dd30ada 100644 --- a/code/game/objects/items/devices/suit_sensor_jammer.dm +++ b/code/game/objects/items/devices/suit_sensor_jammer.dm @@ -21,7 +21,7 @@ suit_sensor_jammer_methods = list() suit_sensor_jammer_methods_by_type = list() for(var/jammer_method_type in subtypesof(/suit_sensor_jammer_method)) - var/new_method = new jammer_method_type(src, /obj/item/device/suit_sensor_jammer/proc/may_process_crew_data) + var/new_method = new jammer_method_type(src, TYPE_PROC_REF(/obj/item/device/suit_sensor_jammer, may_process_crew_data)) dd_insertObjectList(suit_sensor_jammer_methods, new_method) suit_sensor_jammer_methods_by_type[jammer_method_type] = new_method jammer_method = suit_sensor_jammer_methods[1] diff --git a/code/game/objects/items/devices/tvcamera.dm b/code/game/objects/items/devices/tvcamera.dm index 2535c5b11d5d8..d9132e9b4421a 100644 --- a/code/game/objects/items/devices/tvcamera.dm +++ b/code/game/objects/items/devices/tvcamera.dm @@ -92,15 +92,15 @@ H.update_inv_l_hand() /* Assembly by a roboticist */ -/obj/item/robot_parts/head/attackby(obj/item/device/assembly/S, mob/user as mob) +/obj/item/robot_parts/head/use_tool(obj/item/S, mob/living/user, list/click_params) if ((!istype(S, /obj/item/device/assembly/infra))) - ..() - return + return ..() var/obj/item/TVAssembly/A = new(user) qdel(S) user.put_in_hands(A) to_chat(user, SPAN_NOTICE("You add the infrared sensor to the robot head.")) qdel(src) + return TRUE /* Using camcorder icon as I can't sprite. Using robohead because of restricting to roboticist */ @@ -113,7 +113,7 @@ Using robohead because of restricting to roboticist */ var/buildstep = 0 w_class = ITEM_SIZE_LARGE -/obj/item/TVAssembly/attackby(obj/item/W, mob/user) +/obj/item/TVAssembly/use_tool(obj/item/W, mob/living/user, list/click_params) switch(buildstep) if(0) if(istype(W, /obj/item/robot_parts/robot_component/camera)) @@ -121,30 +121,32 @@ Using robohead because of restricting to roboticist */ qdel(W) desc = "This TV camera assembly has a camera module." buildstep++ + return TRUE if(1) if(istype(W, /obj/item/device/taperecorder)) qdel(W) buildstep++ to_chat(user, SPAN_NOTICE("You add the tape recorder to [src]")) desc = "This TV camera assembly has a camera and audio module." - return + return TRUE if(2) if(isCoil(W)) var/obj/item/stack/cable_coil/C = W - if(!C.use(3)) - to_chat(user, SPAN_NOTICE("You need three cable coils to wire the devices.")) + if(!C.can_use(3)) + to_chat(user, SPAN_WARNING("You need three cable coils to wire the devices.")) ..() - return + return TRUE + C.use(3) buildstep++ to_chat(user, SPAN_NOTICE("You wire the assembly")) desc = "This TV camera assembly has wires sticking out." - return + return TRUE if(3) if(isWirecutter(W)) to_chat(user, SPAN_NOTICE(" You trim the wires.")) buildstep++ desc = "This TV camera assembly needs casing." - return + return TRUE if(4) if(istype(W, /obj/item/stack/material/steel)) var/obj/item/stack/material/steel/S = W @@ -154,5 +156,5 @@ Using robohead because of restricting to roboticist */ var/turf/T = get_turf(src) new /obj/item/device/camera/tvcamera(T) qdel(src) - return - ..() + return TRUE + return ..() diff --git a/code/game/objects/items/flora.dm b/code/game/objects/items/flora.dm index 609d1045b9fd7..54100428fa6ee 100644 --- a/code/game/objects/items/flora.dm +++ b/code/game/objects/items/flora.dm @@ -19,18 +19,18 @@ item_state = "plant-27" var/trimmed = FALSE -/obj/item/flora/pottedplantsmall/fern/attackby(obj/item/S, mob/user) - if (!isWirecutter(S)) - return ..() - else +/obj/item/flora/pottedplantsmall/fern/use_tool(obj/item/S, mob/living/user, list/click_params) + if (isWirecutter(S)) playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1) visible_message(SPAN_NOTICE("\The [user] starts trimming the [src] with \the [S].")) if (do_after(user, (S.toolspeed * 6) SECONDS, src, DO_PUBLIC_UNIQUE)) playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1) - to_chat (user, SPAN_NOTICE("You trim \the [src] with \the [S]. You probably should've used a pair of scissors.")) + to_chat(user, SPAN_NOTICE("You trim \the [src] with \the [S]. You probably should've used a pair of scissors.")) trimmed = TRUE - addtimer(new Callback(src, .proc/grow), 90 MINUTES, TIMER_UNIQUE|TIMER_OVERRIDE) + addtimer(new Callback(src, PROC_REF(grow)), 90 MINUTES, TIMER_UNIQUE|TIMER_OVERRIDE) update_icon() + return TRUE + return ..() /obj/item/flora/pottedplantsmall/fern/on_update_icon() . = ..() diff --git a/code/game/objects/items/glassjar.dm b/code/game/objects/items/glassjar.dm index 66f1b38d76b6a..882c520d1b7e0 100644 --- a/code/game/objects/items/glassjar.dm +++ b/code/game/objects/items/glassjar.dm @@ -71,17 +71,20 @@ update_icon() return -/obj/item/glass_jar/attackby(obj/item/W, mob/user) +/obj/item/glass_jar/use_tool(obj/item/W, mob/living/user, list/click_params) if(istype(W, /obj/item/spacecash)) if(contains == 0) contains = 1 if(contains != 1) - return + return ..() if(!user.unEquip(W, src)) - return + FEEDBACK_UNEQUIP_FAILURE(user, W) + return TRUE var/obj/item/spacecash/S = W - user.visible_message(SPAN_NOTICE("[user] puts [S.worth] [S.worth > 1 ? GLOB.using_map.local_currency_name : GLOB.using_map.local_currency_name_singular] into \the [src].")) + user.visible_message(SPAN_NOTICE("\The [user] puts [S.worth] [S.worth > 1 ? GLOB.using_map.local_currency_name : GLOB.using_map.local_currency_name_singular] into \the [src].")) update_icon() + return TRUE + return ..() /obj/item/glass_jar/on_update_icon() // Also updates name and desc underlays.Cut() diff --git a/code/game/objects/items/latexballoon.dm b/code/game/objects/items/latexballoon.dm index bc99e17641fc0..4d900df724104 100644 --- a/code/game/objects/items/latexballoon.dm +++ b/code/game/objects/items/latexballoon.dm @@ -44,6 +44,7 @@ burst() return -/obj/item/latexballon/attackby(obj/item/W as obj, mob/user as mob) - if (W.can_puncture()) +/obj/item/latexballon/use_tool(obj/item/item, mob/living/user, list/click_params) + if (item.can_puncture()) burst() + return ..() diff --git a/code/game/objects/items/paintkit.dm b/code/game/objects/items/paintkit.dm index bfc243bef206e..ffe45bffaf5c7 100644 --- a/code/game/objects/items/paintkit.dm +++ b/code/game/objects/items/paintkit.dm @@ -39,7 +39,7 @@ new_light_overlay = citem.additional_data["light_overlay"] new_mob_icon_file = CUSTOM_ITEM_MOB -/obj/item/clothing/head/helmet/space/void/attackby(obj/item/O, mob/user) +/obj/item/clothing/head/helmet/space/void/use_tool(obj/item/O, mob/living/user, list/click_params) if(istype(O,/obj/item/device/kit/suit)) var/obj/item/device/kit/suit/kit = O SetName("[kit.new_name] suit helmet") @@ -52,15 +52,16 @@ icon_override = kit.new_mob_icon_file if(kit.new_light_overlay) light_overlay = kit.new_light_overlay - to_chat(user, "You set about modifying the helmet into [src].") + to_chat(user, SPAN_NOTICE("You set about modifying the helmet into \the [src].")) var/mob/living/carbon/human/H = user if(istype(H)) species_restricted = list(H.species.get_bodytype(H)) kit.use(1,user) - return 1 + return TRUE + return ..() -/obj/item/clothing/suit/space/void/attackby(obj/item/O, mob/user) +/obj/item/clothing/suit/space/void/use_tool(obj/item/O, mob/living/user, list/click_params) if(istype(O,/obj/item/device/kit/suit)) var/obj/item/device/kit/suit/kit = O SetName("[kit.new_name] voidsuit") @@ -71,15 +72,20 @@ icon = kit.new_icon_file if(kit.new_mob_icon_file) icon_override = kit.new_mob_icon_file - to_chat(user, "You set about modifying the suit into [src].") + to_chat(user, SPAN_NOTICE("You set about modifying the suit into \the [src].")) var/mob/living/carbon/human/H = user if(istype(H)) species_restricted = list(H.species.get_bodytype(H)) kit.use(1,user) - return 1 + return TRUE return ..() // Mechs are handled in their attackby (mech_interaction.dm). +// [SIERRA-REMOVE] - MECHS_BY_SHEGAR - Не нужны + /* + + + /obj/item/device/kit/paint name = "exosuit customisation kit" desc = "A kit containing all the needed tools and parts to repaint a exosuit." @@ -93,6 +99,7 @@ /obj/item/device/kit/paint/use(amt, mob/user) playsound(get_turf(user), 'sound/items/Screwdriver.ogg', 50, 1) + /obj/item/device/kit/paint/flames_red name = "\"Firestarter\" exosuit customisation kit" new_icon = "flames_red" @@ -110,3 +117,8 @@ name = "\"Alpine\" exosuit customisation kit" new_icon = "cammo2" desc = "A muted pattern for alpine environments. Don't miss the forest for the trees!" + + + + */ +// [/SIERRA-REMOVE] diff --git a/code/game/objects/items/rescuebag.dm b/code/game/objects/items/rescuebag.dm index 99f29176d2854..42dbff0f8cf5d 100644 --- a/code/game/objects/items/rescuebag.dm +++ b/code/game/objects/items/rescuebag.dm @@ -29,22 +29,26 @@ airtank = null qdel(src) -/obj/item/bodybag/rescue/attackby(obj/item/W, mob/user, click_params) +/obj/item/bodybag/rescue/use_tool(obj/item/W, mob/living/user, list/click_params) if(istype(W,/obj/item/tank)) if(airtank) - to_chat(user, "\The [src] already has an air tank installed.") - return 1 - else if(user.unEquip(W)) - W.forceMove(src) - airtank = W - to_chat(user, "You install \the [W] in \the [src].") - return 1 + to_chat(user, SPAN_WARNING("\The [src] already has an air tank installed.")) + return TRUE + if (!user.unEquip(W)) + FEEDBACK_UNEQUIP_FAILURE(user, W) + return TRUE + W.forceMove(src) + airtank = W + to_chat(user, SPAN_NOTICE("You install \the [W] in \the [src].")) + return TRUE + else if(airtank && isScrewdriver(W)) - to_chat(user, "You remove \the [airtank] from \the [src].") + to_chat(user, SPAN_NOTICE("You remove \the [airtank] from \the [src].")) airtank.dropInto(loc) airtank = null - else - ..() + return TRUE + + return ..() /obj/item/bodybag/rescue/examine(mob/user) . = ..() diff --git a/code/game/objects/items/robot/robot_frame.dm b/code/game/objects/items/robot/robot_frame.dm index 39408ed261582..03bd124e28d0c 100644 --- a/code/game/objects/items/robot/robot_frame.dm +++ b/code/game/objects/items/robot/robot_frame.dm @@ -31,13 +31,12 @@ return FALSE return TRUE -/obj/item/robot_parts/robot_suit/attackby(obj/item/W as obj, mob/user as mob) - +/obj/item/robot_parts/robot_suit/use_tool(obj/item/W, mob/living/user, list/click_params) // Uninstall a robotic part. if(isCrowbar(W)) if(!length(parts)) to_chat(user, SPAN_WARNING("\The [src] has no parts to remove.")) - return + return TRUE var/removing = pick(parts) var/obj/item/robot_parts/part = parts[removing] part.forceMove(get_turf(src)) @@ -45,30 +44,32 @@ parts -= removing to_chat(user, SPAN_WARNING("You lever \the [part] off \the [src].")) update_icon() + return TRUE // Install a robotic part. else if (istype(W, /obj/item/robot_parts)) var/obj/item/robot_parts/part = W if(!required_parts[part.bp_tag] || !istype(W, required_parts[part.bp_tag])) to_chat(user, SPAN_WARNING("\The [src] is not compatible with \the [W].")) - return + return TRUE if(parts[part.bp_tag]) to_chat(user, SPAN_WARNING("\The [src] already has \a [W] installed.")) - return + return TRUE if(part.can_install(user) && user.unEquip(W, src)) parts[part.bp_tag] = part update_icon() + return TRUE // Install an MMI/brain. else if(istype(W, /obj/item/device/mmi) || istype(W, /obj/item/organ/internal/posibrain)) if(!istype(loc,/turf)) to_chat(user, SPAN_WARNING("You can't put \the [W] in without the frame being on the ground.")) - return + return TRUE if(!check_completion()) to_chat(user, SPAN_WARNING("The frame is not ready for the central processor to be installed.")) - return + return TRUE var/mob/living/carbon/brain/B if(istype(W, /obj/item/device/mmi)) @@ -80,15 +81,15 @@ if(!B) to_chat(user, SPAN_WARNING("Sticking an empty [W.name] into the frame would sort of defeat the purpose.")) - return + return TRUE if(jobban_isbanned(B, "Robot")) to_chat(user, SPAN_WARNING("\The [W] does not seem to fit.")) - return + return TRUE if(B.stat == DEAD) to_chat(user, SPAN_WARNING("Sticking a dead [W.name] into the frame would sort of defeat the purpose.")) - return + return TRUE var/ghost_can_reenter = 0 if(B.mind) @@ -101,13 +102,14 @@ ghost_can_reenter = 1 if(!ghost_can_reenter) to_chat(user, SPAN_WARNING("\The [W] is completely unresponsive; there's no point.")) - return + return TRUE if(!user.unEquip(W)) - return + FEEDBACK_UNEQUIP_FAILURE(user, W) + return TRUE var/mob/living/silicon/robot/O = new product(get_turf(loc)) if(!O) - return + return TRUE O.mmi = W O.set_invisibility(0) @@ -136,13 +138,15 @@ callHook("borgify", list(O)) O.Namepick() qdel(src) + return TRUE else if(istype(W, /obj/item/pen)) var/t = sanitizeSafe(input(user, "Enter new robot name", src.name, src.created_name), MAX_NAME_LEN) if(t && (in_range(src, user) || loc == user)) created_name = t - else - ..() + return TRUE + + return ..() /obj/item/robot_parts/robot_suit/Destroy() parts.Cut() diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm index beef355e50866..8d44bff365e3f 100644 --- a/code/game/objects/items/robot/robot_parts.dm +++ b/code/game/objects/items/robot/robot_parts.dm @@ -102,26 +102,30 @@ success = FALSE return success && ..() -/obj/item/robot_parts/chest/attackby(obj/item/W as obj, mob/user as mob) - ..() +/obj/item/robot_parts/chest/use_tool(obj/item/W, mob/living/user, list/click_params) if(istype(W, /obj/item/cell)) - if(src.cell) + if(cell) to_chat(user, SPAN_WARNING("You have already inserted a cell!")) - return + return TRUE else if(!user.unEquip(W, src)) - return - src.cell = W + FEEDBACK_UNEQUIP_FAILURE(user, W) + return TRUE + cell = W to_chat(user, SPAN_NOTICE("You insert the cell!")) + return TRUE + if(isCoil(W)) - if(src.wires) - to_chat(user, SPAN_WARNING("You have already inserted wire!")) - return + if(wires) + to_chat(user, SPAN_WARNING("You have already inserted wires!")) + return TRUE else var/obj/item/stack/cable_coil/coil = W if(coil.use(1)) - src.wires = 1.0 + wires = 1.0 to_chat(user, SPAN_NOTICE("You insert the wire!")) + return TRUE + if(istype(W, /obj/item/robot_parts/head)) var/obj/item/robot_parts/head/head_part = W // Attempt to create full-body prosthesis. @@ -133,7 +137,7 @@ // Species selection. var/species = input(user, "Select a species for the prosthetic.") as null|anything in GetCyborgSpecies() if(!species) - return + return TRUE var/name = sanitizeSafe(input(user,"Set a name for the new prosthetic."), MAX_NAME_LEN) if(!name) SetName("prosthetic ([random_id("prosthetic_id", 1, 999)])") @@ -173,6 +177,9 @@ // Cleanup qdel(W) qdel(src) + return TRUE + + return ..() /obj/item/robot_parts/chest/proc/GetCyborgSpecies() . = list() @@ -182,18 +189,20 @@ continue . += N -/obj/item/robot_parts/head/attackby(obj/item/W as obj, mob/user as mob) - ..() +/obj/item/robot_parts/head/use_tool(obj/item/W, mob/living/user, list/click_params) if(istype(W, /obj/item/device/flash)) if(istype(user,/mob/living/silicon/robot)) var/current_module = user.get_active_hand() if(current_module == W) to_chat(user, SPAN_WARNING("How do you propose to do that?")) - return + return TRUE else add_flashes(W,user) + return TRUE else add_flashes(W,user) + return TRUE + return ..() /obj/item/robot_parts/head/proc/add_flashes(obj/item/W as obj, mob/user as mob) //Made into a seperate proc to avoid copypasta if(src.flash1 && src.flash2) diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index df781db9b0d5d..c94d8bd1ecb4e 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -52,22 +52,24 @@ update_icon() return TRUE -/obj/item/toy/water_balloon/attackby(obj/O as obj, mob/user as mob) +/obj/item/toy/water_balloon/use_tool(obj/item/O, mob/living/user, list/click_params) if(istype(O, /obj/item/reagent_containers/glass)) if(O.reagents) if(O.reagents.total_volume < 1) - to_chat(user, "The [O] is empty.") - else if(O.reagents.total_volume >= 1) - if(O.reagents.has_reagent(/datum/reagent/acid/polyacid, 1)) - to_chat(user, "The acid chews through the balloon!") - O.reagents.splash(user, reagents.total_volume) - qdel(src) - else - src.desc = "A translucent balloon with some form of liquid sloshing around in it." - to_chat(user, SPAN_NOTICE("You fill the balloon with the contents of [O].")) - O.reagents.trans_to_obj(src, 10) - src.update_icon() - return + to_chat(user, SPAN_WARNING("\The [O] is empty.")) + return TRUE + + if (O.reagents.has_reagent(/datum/reagent/acid/polyacid, 1)) + to_chat(user, "The acid chews through the balloon!") + O.reagents.splash(user, reagents.total_volume) + qdel(src) + else + desc = "A translucent balloon with some form of liquid sloshing around in it." + to_chat(user, SPAN_NOTICE("You fill the balloon with the contents of [O].")) + O.reagents.trans_to_obj(src, 10) + update_icon() + return TRUE + return ..() /obj/item/toy/water_balloon/throw_impact(atom/hit_atom) if(reagents && reagents.total_volume >= 1) @@ -148,16 +150,20 @@ attack_verb = list("attacked", "struck", "hit") var/bullets = 5 -/obj/item/toy/crossbow/attackby(obj/item/I as obj, mob/user as mob) +/obj/item/toy/crossbow/use_tool(obj/item/I, mob/living/user, list/click_params) if(istype(I, /obj/item/toy/ammo/crossbow)) if(bullets <= 4) if(!user.unEquip(I)) - return + FEEDBACK_UNEQUIP_FAILURE(user, I) + return TRUE qdel(I) bullets++ to_chat(user, SPAN_NOTICE("You load the foam dart into the crossbow.")) else to_chat(usr, SPAN_WARNING("It's already fully loaded.")) + return TRUE + + return ..() /obj/item/toy/crossbow/use_after(atom/target, mob/living/user, click_parameters) diff --git a/code/game/objects/items/traitor_plush.dm b/code/game/objects/items/traitor_plush.dm index dfabdd7b33a94..a81e5050aba53 100644 --- a/code/game/objects/items/traitor_plush.dm +++ b/code/game/objects/items/traitor_plush.dm @@ -25,7 +25,7 @@ /obj/item/reagent_containers/food/snacks/dehydrated_carp/on_reagent_change() if (reagents.has_reagent(/datum/reagent/water)) visible_message(SPAN_WARNING("\The [src] begins to shake as the liquid touches it.")) - addtimer(new Callback(src, .proc/expand), 5 SECONDS) + addtimer(new Callback(src, PROC_REF(expand)), 5 SECONDS) /obj/item/reagent_containers/food/snacks/dehydrated_carp/proc/expand() visible_message(SPAN_WARNING("\The [src] rapidly expands into a living space carp!")) @@ -70,7 +70,7 @@ if (!phrase) return if (findtext(sanitize_phrase(msg), phrase)) - addtimer(new Callback(src, .proc/activate), 5 SECONDS) + addtimer(new Callback(src, PROC_REF(activate)), 5 SECONDS) audible_message(SPAN_DANGER("\The [src] begins to beep ominously, letting out a loud '[last_words]'!")) playsound(loc, 'sound/weapons/armbomb.ogg', 75, 1, -3) diff --git a/code/game/objects/items/weapons/RCD.dm b/code/game/objects/items/weapons/RCD.dm index 945265665e077..116ec0fe86e00 100644 --- a/code/game/objects/items/weapons/RCD.dm +++ b/code/game/objects/items/weapons/RCD.dm @@ -58,13 +58,12 @@ spark_system = null return ..() -/obj/item/rcd/attackby(obj/item/W, mob/user) - +/obj/item/rcd/use_tool(obj/item/W, mob/living/user, list/click_params) if(istype(W, /obj/item/rcd_ammo)) var/obj/item/rcd_ammo/cartridge = W if(stored_matter >= max_stored_matter) - to_chat(user, SPAN_NOTICE("The RCD is at maximum capacity.")) - return + to_chat(user, SPAN_WARNING("The RCD is at maximum capacity.")) + return TRUE var/matter_exchange = min(cartridge.remaining,max_stored_matter - stored_matter) stored_matter += matter_exchange cartridge.remaining -= matter_exchange @@ -74,7 +73,7 @@ playsound(src.loc, 'sound/machines/click.ogg', 50, 1) to_chat(user, SPAN_NOTICE("The RCD now holds [stored_matter]/[max_stored_matter] matter-units.")) update_icon() - return + return TRUE if(isScrewdriver(W)) crafting = !crafting @@ -82,10 +81,9 @@ to_chat(user, SPAN_NOTICE("You reassemble the RCD")) else to_chat(user, SPAN_NOTICE("The RCD can now be modified.")) - src.add_fingerprint(user) - return + return TRUE - ..() + return ..() /obj/item/rcd/attack_self(mob/user) //Change the mode diff --git a/code/game/objects/items/weapons/RPD.dm b/code/game/objects/items/weapons/RPD.dm index 80c89e05ab075..8e0e10975f119 100644 --- a/code/game/objects/items/weapons/RPD.dm +++ b/code/game/objects/items/weapons/RPD.dm @@ -167,13 +167,14 @@ GLOBAL_LIST_INIT(rpd_pipe_selection_skilled, list( interact(user) add_fingerprint(user) -/obj/item/rpd/attackby(obj/item/W, mob/user) - if(istype(W, /obj/item/pipe)) - if(!user.unEquip(W)) - return - recycle(W,user) - return - ..() +/obj/item/rpd/use_tool(obj/item/item, mob/living/user, list/click_params) + if(istype(item, /obj/item/pipe)) + if(!user.unEquip(item)) + FEEDBACK_UNEQUIP_FAILURE(user, item) + return TRUE + recycle(item,user) + return TRUE + return ..() /obj/item/rpd/proc/recycle(obj/item/W,mob/user) if(!user.skill_check(SKILL_ATMOS,SKILL_BASIC)) diff --git a/code/game/objects/items/weapons/candle/candle.dm b/code/game/objects/items/weapons/candle/candle.dm index 4b83b86b5e982..b90142daff3f3 100644 --- a/code/game/objects/items/weapons/candle/candle.dm +++ b/code/game/objects/items/weapons/candle/candle.dm @@ -35,10 +35,10 @@ if(lit) AddOverlays(overlay_image(icon, "[icon_state]_lit", flags=RESET_COLOR)) -/obj/item/flame/candle/attackby(obj/item/W as obj, mob/user as mob) - ..() +/obj/item/flame/candle/use_tool(obj/item/W, mob/living/user, list/click_params) if (isFlameOrHeatSource(W)) light(user) + return ..() /obj/item/flame/candle/resolve_attackby(atom/A, mob/user) . = ..() diff --git a/code/game/objects/items/weapons/cane.dm b/code/game/objects/items/weapons/cane.dm index afee7cbe331ba..2d18f0a3fff3e 100644 --- a/code/game/objects/items/weapons/cane.dm +++ b/code/game/objects/items/weapons/cane.dm @@ -90,15 +90,27 @@ else ..() -/obj/item/cane/concealed/attackby(obj/item/material/knife/folding/W, mob/user) - if(!src.concealed_blade && istype(W) && user.unEquip(W, src)) - user.visible_message(SPAN_WARNING("[user] has sheathed \a [W] into [src]!"), "You sheathe \the [W] into [src].") - src.concealed_blade = W +/obj/item/cane/concealed/use_tool(obj/item/item, mob/living/user, list/click_params) + if (istype(item, /obj/item/material/knife/folding)) + var/obj/item/material/knife/folding/blade = item + if (concealed_blade) + to_chat(user, SPAN_WARNING("\The [src] already contains a blade.")) + return TRUE + if (!user.unEquip(blade, src)) + FEEDBACK_UNEQUIP_FAILURE(user, blade) + return TRUE + + user.visible_message( + SPAN_WARNING("\The [user] has sheathed \a [blade] into \the [src]!"), + "You sheathe \the [blade] into \the [src]." + ) + concealed_blade = blade update_icon() user.update_inv_l_hand() user.update_inv_r_hand() - else - ..() + return TRUE + + return ..() /obj/item/cane/concealed/on_update_icon() if(concealed_blade) diff --git a/code/game/objects/items/weapons/cards_ids.dm b/code/game/objects/items/weapons/cards_ids.dm index 2862b1f50a63c..0582ff8239a62 100644 --- a/code/game/objects/items/weapons/cards_ids.dm +++ b/code/game/objects/items/weapons/cards_ids.dm @@ -32,17 +32,19 @@ else to_chat(user, "It has a blank space for a signature.") -/obj/item/card/union/attackby(obj/item/thing, mob/user) +/obj/item/card/union/use_tool(obj/item/thing, mob/living/user, list/click_params) if(istype(thing, /obj/item/pen)) if(signed_by) to_chat(user, SPAN_WARNING("\The [src] has already been signed.")) + return TRUE else var/signature = sanitizeSafe(input("What do you want to sign the card as?", "Union Card") as text, MAX_NAME_LEN) if(signature && !signed_by && !user.incapacitated() && Adjacent(user)) signed_by = signature user.visible_message(SPAN_NOTICE("\The [user] signs \the [src] with a flourish.")) - return - ..() + return TRUE + + return ..() /obj/item/card/operant_card name = "operant registration card" @@ -114,11 +116,12 @@ detail_overlay.color = detail_color AddOverlays(detail_overlay) -/obj/item/card/data/attackby(obj/item/I, mob/living/user) - if(istype(I, /obj/item/device/integrated_electronics/detailer)) - var/obj/item/device/integrated_electronics/detailer/D = I - detail_color = D.detail_color +/obj/item/card/data/use_tool(obj/item/item, mob/living/user, list/click_params) + if (istype(item, /obj/item/device/integrated_electronics/detailer)) + var/obj/item/device/integrated_electronics/detailer/Det = item + detail_color = Det.detail_color update_icon() + return TRUE return ..() /obj/item/card/data/full_color @@ -301,12 +304,7 @@ var/global/const/NO_EMAG_ACT = -50 id_card.formal_name_suffix = "[id_card.formal_name_suffix][culture.get_formal_name_suffix()]" id_card.registered_name = real_name - - var/pronouns = "Unset" - var/datum/pronouns/P = choose_from_pronouns() - if(P) - pronouns = P.formal_term - id_card.sex = pronouns + id_card.sex = get_formal_pronouns() id_card.set_id_photo(src) if(dna) diff --git a/code/game/objects/items/weapons/cards_ids_syndicate.dm b/code/game/objects/items/weapons/cards_ids_syndicate.dm index d075d67b0bfec..cb4ce2dd93e41 100644 --- a/code/game/objects/items/weapons/cards_ids_syndicate.dm +++ b/code/game/objects/items/weapons/cards_ids_syndicate.dm @@ -76,7 +76,7 @@ unset_registered_user() registered_user = user user.set_id_info(src) - GLOB.destroyed_event.register(user, src, /obj/item/card/id/syndicate/proc/unset_registered_user) + GLOB.destroyed_event.register(user, src, TYPE_PROC_REF(/obj/item/card/id/syndicate, unset_registered_user)) return TRUE /obj/item/card/id/syndicate/proc/unset_registered_user(mob/user) diff --git a/code/game/objects/items/weapons/circuitboards/computer/research.dm b/code/game/objects/items/weapons/circuitboards/computer/research.dm index 9aa54e63ce942..fe62b22399c29 100644 --- a/code/game/objects/items/weapons/circuitboards/computer/research.dm +++ b/code/game/objects/items/weapons/circuitboards/computer/research.dm @@ -2,7 +2,7 @@ name = "circuit board (R&D control console)" build_path = /obj/machinery/computer/rdconsole/core -/obj/item/stock_parts/circuitboard/rdconsole/attackby(obj/item/I as obj, mob/user as mob) +/obj/item/stock_parts/circuitboard/rdconsole/use_tool(obj/item/I, mob/living/user, list/click_params) if(isScrewdriver(I)) user.visible_message(SPAN_NOTICE("\The [user] adjusts the jumper on \the [src]'s access protocol pins."), SPAN_NOTICE("You adjust the jumper on the access protocol pins.")) if(src.build_path == /obj/machinery/computer/rdconsole/core) @@ -13,4 +13,5 @@ src.SetName("circuit board (RD Console)") src.build_path = /obj/machinery/computer/rdconsole/core to_chat(user, SPAN_NOTICE("Access protocols set to default.")) - return + return TRUE + return ..() diff --git a/code/game/objects/items/weapons/defib.dm b/code/game/objects/items/weapons/defib.dm index 293380b9ca7b5..f84331d8aca00 100644 --- a/code/game/objects/items/weapons/defib.dm +++ b/code/game/objects/items/weapons/defib.dm @@ -84,19 +84,23 @@ M.put_in_any_hand_if_possible(src) -/obj/item/defibrillator/attackby(obj/item/W, mob/user, params) +/obj/item/defibrillator/use_tool(obj/item/W, mob/living/user, list/click_params) if(W == paddles) reattach_paddles(user) - else if(istype(W, /obj/item/cell)) + return TRUE + + else if (istype(W, /obj/item/cell)) if(bcell) - to_chat(user, SPAN_NOTICE("\the [src] already has a cell.")) - else - if(!user.unEquip(W)) - return - W.forceMove(src) - bcell = W - to_chat(user, SPAN_NOTICE("You install a cell in \the [src].")) - update_icon() + to_chat(user, SPAN_WARNING("\The [src] already has a cell.")) + return TRUE + if (!user.unEquip(W)) + FEEDBACK_UNEQUIP_FAILURE(user, W) + return TRUE + W.forceMove(src) + bcell = W + to_chat(user, SPAN_NOTICE("You install a cell in \the [src].")) + update_icon() + return TRUE else if(isScrewdriver(W)) if(bcell) @@ -105,8 +109,9 @@ bcell = null to_chat(user, SPAN_NOTICE("You remove the cell from \the [src].")) update_icon() - else - return ..() + return TRUE + + return ..() /obj/item/defibrillator/emag_act(uses, mob/user) if(paddles) diff --git a/code/game/objects/items/weapons/ecigs.dm b/code/game/objects/items/weapons/ecigs.dm index b44380dd2d7c1..3b5e15b95ac9f 100644 --- a/code/game/objects/items/weapons/ecigs.dm +++ b/code/game/objects/items/weapons/ecigs.dm @@ -2,7 +2,7 @@ name = "electronic cigarette" desc = "Device with modern approach to smoking." icon = 'icons/obj/ecig.dmi' - var/active = 0 + active = 0 var/obj/item/cell/cigcell var/cartridge_type = /obj/item/reagent_containers/ecig_cartridge/med_nicotine var/obj/item/reagent_containers/ecig_cartridge/ec_cartridge @@ -147,14 +147,16 @@ M.update_inv_r_hand(1) -/obj/item/clothing/mask/smokable/ecig/attackby(obj/item/I, mob/user as mob) +/obj/item/clothing/mask/smokable/ecig/use_tool(obj/item/I, mob/living/user, list/click_params) if(istype(I, /obj/item/reagent_containers/ecig_cartridge)) if (ec_cartridge)//can't add second one - to_chat(user, "[SPAN_NOTICE("A cartridge has already been installed.")] ") - else if(user.unEquip(I, src))//fits in new one + to_chat(user, "[SPAN_WARNING("A cartridge has already been installed.")] ") + return TRUE + if (user.unEquip(I, src))//fits in new one ec_cartridge = I update_icon() to_chat(user, "[SPAN_NOTICE("You insert \the [I] into \the [src].")] ") + return TRUE if (isScrewdriver(I)) if(cigcell) //if contains powercell @@ -164,6 +166,7 @@ to_chat(user, SPAN_NOTICE("You remove \the [cigcell] from \the [src].")) else //does not contains cell to_chat(user, SPAN_NOTICE("There's no battery in \the [src].")) + return TRUE if(istype(I, /obj/item/cell/device)) if(!cigcell && user.unEquip(I)) @@ -173,6 +176,9 @@ update_icon() else to_chat(user, SPAN_NOTICE("\The [src] already has a battery installed.")) + return TRUE + + return ..() /obj/item/clothing/mask/smokable/ecig/attack_self(mob/user as mob) diff --git a/code/game/objects/items/weapons/electric_welder.dm b/code/game/objects/items/weapons/electric_welder.dm index c320977832172..b5147c35a8a59 100644 --- a/code/game/objects/items/weapons/electric_welder.dm +++ b/code/game/objects/items/weapons/electric_welder.dm @@ -45,9 +45,9 @@ var/obj/item/cell/cell = get_cell() return cell ? cell.charge : 0 -/obj/item/weldingtool/electric/attackby(obj/item/W, mob/user) +/obj/item/weldingtool/electric/use_tool(obj/item/W, mob/living/user, list/click_params) if(istype(W,/obj/item/stack/material/rods) || istype(W, /obj/item/welder_tank)) - return + return ..() if(isScrewdriver(W)) if(cell) cell.dropInto(get_turf(src)) @@ -58,8 +58,8 @@ update_icon() else to_chat(user, SPAN_WARNING("\The [src] has no cell installed.")) - return - else if(istype(W, /obj/item/cell)) + return TRUE + if(istype(W, /obj/item/cell)) if(cell) to_chat(user, SPAN_WARNING("\The [src] already has a cell installed.")) else if(user.unEquip(W)) @@ -67,8 +67,8 @@ cell.forceMove(src) to_chat(user, SPAN_NOTICE("You slot \the [cell] into \the [src].")) update_icon() - return - . = ..() + return TRUE + return ..() /obj/item/weldingtool/electric/burn_fuel(amount) spend_charge(amount * fuel_cost_multiplier) diff --git a/code/game/objects/items/weapons/explosives.dm b/code/game/objects/items/weapons/explosives.dm index 418fa60cee0ab..8c83a9ce156b9 100644 --- a/code/game/objects/items/weapons/explosives.dm +++ b/code/game/objects/items/weapons/explosives.dm @@ -24,14 +24,16 @@ wires = null return ..() -/obj/item/plastique/attackby(obj/item/I, mob/user) +/obj/item/plastique/use_tool(obj/item/I, mob/living/user, list/click_params) if(isScrewdriver(I)) open_panel = !open_panel to_chat(user, SPAN_NOTICE("You [open_panel ? "open" : "close"] the wire panel.")) - else if(isWirecutter(I) || isMultitool(I) || istype(I, /obj/item/device/assembly/signaler )) + return TRUE + if (isWirecutter(I) || isMultitool(I) || istype(I, /obj/item/device/assembly/signaler )) wires.Interact(user) + return TRUE else - ..() + return ..() /obj/item/plastique/attack_self(mob/user as mob) var/newtime = input(usr, "Please set the timer.", "Timer", 10) as num @@ -91,7 +93,7 @@ target.CutOverlays(image_overlay) qdel(src) -/obj/item/plastique/proc/run_timer() //Basically exists so the C4 will beep when running. Better idea than putting sleeps in attackby. +/obj/item/plastique/proc/run_timer() set waitfor = 0 var/T = timer while(T > 0) diff --git a/code/game/objects/items/weapons/extinguisher.dm b/code/game/objects/items/weapons/extinguisher.dm index 4726b3455fe62..037976353f702 100644 --- a/code/game/objects/items/weapons/extinguisher.dm +++ b/code/game/objects/items/weapons/extinguisher.dm @@ -153,10 +153,10 @@ var/direction = get_dir(target, src) if(user.buckled && isobj(user.buckled)) - addtimer(new Callback(src, .proc/propel_object, user.buckled, user, direction), 0) + addtimer(new Callback(src, PROC_REF(propel_object), user.buckled, user, direction), 0) visible_message(SPAN_NOTICE("\The [user] sprays towards \the [target] with \the [src].")) - addtimer(new Callback(src, .proc/do_spray, target), 0) + addtimer(new Callback(src, PROC_REF(do_spray), target), 0) if(!user.check_space_footing()) step(user, direction) diff --git a/code/game/objects/items/weapons/flamethrower.dm b/code/game/objects/items/weapons/flamethrower.dm index 13c05a7a06ad8..0b1367dfa559d 100644 --- a/code/game/objects/items/weapons/flamethrower.dm +++ b/code/game/objects/items/weapons/flamethrower.dm @@ -98,9 +98,8 @@ else return ..() -/obj/item/flamethrower/attackby(obj/item/W as obj, mob/user as mob) - if(user.stat || user.restrained() || user.lying) return - if(isWrench(W) && !status && !complete)//Taking this apart +/obj/item/flamethrower/use_tool(obj/item/W, mob/living/user, list/click_params) + if (isWrench(W) && !status && !complete) if(weldtool) weldtool.dropInto(loc) weldtool = null @@ -112,35 +111,39 @@ beaker = null new /obj/item/stack/material/rods(get_turf(src)) qdel(src) - return + return TRUE if(isScrewdriver(W) && igniter && !lit && !complete) status = !status to_chat(user, SPAN_NOTICE("\The [igniter] is now [status ? "secured" : "unsecured"]!")) update_icon() - return + return TRUE if(isigniter(W)) var/obj/item/device/assembly/igniter/I = W - if(I.secured) return - if(igniter) return + if (I.secured) + USE_FEEDBACK_FAILURE("The igniter is secured!") + return TRUE + if (igniter) + USE_FEEDBACK_FAILURE("\The [src] already has an igniter.") + return TRUE if(!user.unEquip(I, src)) - return + FEEDBACK_UNEQUIP_FAILURE(user, I) + return TRUE igniter = I update_icon() - return + return TRUE if (istype(W, /obj/item/reagent_containers) && W.is_open_container() && (W.w_class <= max_beaker)) if(user.unEquip(W, src)) if(beaker) beaker.forceMove(get_turf(src)) - to_chat(user, SPAN_NOTICE("You swap the fuel container in [src]!")) + to_chat(user, SPAN_NOTICE("You swap the fuel container in \the [src]!")) beaker = W update_icon() - return + return TRUE - ..() - return + return ..() /obj/item/flamethrower/attack_self(mob/user as mob) diff --git a/code/game/objects/items/weapons/grenades/anti_photon_grenade.dm b/code/game/objects/items/weapons/grenades/anti_photon_grenade.dm index dc385553ee0d2..562d10b2c121a 100644 --- a/code/game/objects/items/weapons/grenades/anti_photon_grenade.dm +++ b/code/game/objects/items/weapons/grenades/anti_photon_grenade.dm @@ -9,7 +9,7 @@ /obj/item/grenade/anti_photon/detonate(mob/living/user) playsound(src.loc, 'sound/effects/phasein.ogg', 50, 1, 5) set_light(10, -10, "#ffffff") - addtimer(new Callback(src, .proc/finish), rand(20 SECONDS, 29 SECONDS)) + addtimer(new Callback(src, PROC_REF(finish)), rand(20 SECONDS, 29 SECONDS)) /obj/item/grenade/anti_photon/proc/finish() set_light(10, 10, "#[num2hex(rand(64,255))][num2hex(rand(64,255))][num2hex(rand(64,255))]") diff --git a/code/game/objects/items/weapons/grenades/chem_grenade.dm b/code/game/objects/items/weapons/grenades/chem_grenade.dm index df3bb750f5816..f2fd736449815 100644 --- a/code/game/objects/items/weapons/grenades/chem_grenade.dm +++ b/code/game/objects/items/weapons/grenades/chem_grenade.dm @@ -46,17 +46,18 @@ C.throw_mode_on() -/obj/item/grenade/chem_grenade/attackby(obj/item/W, mob/user) +/obj/item/grenade/chem_grenade/use_tool(obj/item/W, mob/living/user, list/click_params) if(istype(W,/obj/item/device/assembly_holder) && (!stage || stage==1) && path != 2) var/obj/item/device/assembly_holder/det = W if(istype(det.a_left,det.a_right.type) || (!isigniter(det.a_left) && !isigniter(det.a_right))) to_chat(user, SPAN_WARNING("Assembly must contain one igniter.")) - return + return TRUE if(!det.secured) to_chat(user, SPAN_WARNING("Assembly must be secured with screwdriver.")) - return + return TRUE if(!user.unEquip(det, src)) - return + FEEDBACK_UNEQUIP_FAILURE(user, det) + return TRUE path = 1 log_and_message_admins("has attached \a [W] to \the [src].") to_chat(user, SPAN_NOTICE("You add [W] to the metal casing.")) @@ -71,6 +72,8 @@ icon_state = initial(icon_state) +"_ass" SetName("unsecured grenade with [length(beakers)] containers[detonator?" and detonator":""]") stage = 1 + return TRUE + else if(isScrewdriver(W) && path != 2) if(stage == 1) path = 1 @@ -78,17 +81,18 @@ to_chat(user, SPAN_NOTICE("You lock the assembly.")) SetName("grenade") else -// to_chat(user, SPAN_WARNING("You need to add at least one beaker before locking the assembly.")) to_chat(user, SPAN_NOTICE("You lock the empty assembly.")) SetName("fake grenade") playsound(loc, 'sound/items/Screwdriver.ogg', 25, -3) icon_state = initial(icon_state) +"_locked" stage = 2 + return TRUE + else if(stage == 2) if(active && prob(95)) to_chat(user, SPAN_WARNING("You trigger the assembly!")) detonate() - return + return TRUE else to_chat(user, SPAN_NOTICE("You unlock the assembly.")) playsound(loc, 'sound/items/Screwdriver.ogg', 25, -3) @@ -96,21 +100,28 @@ icon_state = initial(icon_state) + (detonator?"_ass":"") stage = 1 active = 0 + return TRUE + else if(is_type_in_list(W, allowed_containers) && (!stage || stage==1) && path != 2) path = 1 if(length(beakers) == 2) to_chat(user, SPAN_WARNING("The grenade can not hold more containers.")) - return + return TRUE else if(W.reagents.total_volume) if(!user.unEquip(W, src)) - return + FEEDBACK_UNEQUIP_FAILURE(user, W) + return TRUE to_chat(user, SPAN_NOTICE("You add \the [W] to the assembly.")) beakers += W stage = 1 SetName("unsecured grenade with [length(beakers)] containers[detonator?" and detonator":""]") + return TRUE else to_chat(user, SPAN_WARNING("\The [W] is empty.")) + return TRUE + + return ..() /obj/item/grenade/chem_grenade/activate(mob/user) diff --git a/code/game/objects/items/weapons/grenades/explosive.dm b/code/game/objects/items/weapons/grenades/explosive.dm index 8aca364165072..38a8613ecaaa4 100644 --- a/code/game/objects/items/weapons/grenades/explosive.dm +++ b/code/game/objects/items/weapons/grenades/explosive.dm @@ -131,10 +131,11 @@ det_time = rand(5,100) // Fuse is randomized. . = ..() -/obj/item/grenade/frag/makeshift/attackby(obj/item/W, mob/user) +/obj/item/grenade/frag/makeshift/use_tool(obj/item/W, mob/living/user, list/click_params) if(isScrewdriver(W)) //overrides the act to screwdrive a grenade to set its fuse. to_chat(user, SPAN_WARNING("You can't adjust the timer on \the [src]!")) return TRUE + if (is_type_in_list(W, possible_reinforcements)) if(shrapnel_reinforced<10) //you can only add 10 items inside the can user.visible_message( @@ -148,4 +149,5 @@ else to_chat(user, SPAN_WARNING("You can't add any more items to \the [src]!")) return TRUE + return ..() diff --git a/code/game/objects/items/weapons/grenades/grenade.dm b/code/game/objects/items/weapons/grenades/grenade.dm index 413d3045059fb..e9e947657cbfb 100644 --- a/code/game/objects/items/weapons/grenades/grenade.dm +++ b/code/game/objects/items/weapons/grenades/grenade.dm @@ -55,7 +55,7 @@ icon_state = initial(icon_state) + "_active" active = TRUE playsound(loc, arm_sound, 75, 0, -3) - addtimer(new Callback(src, .proc/detonate, user), det_time) + addtimer(new Callback(src, PROC_REF(detonate), user), det_time) /obj/item/grenade/proc/detonate(mob/living/user) @@ -63,7 +63,7 @@ if(T) T.hotspot_expose(700,125) -/obj/item/grenade/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/grenade/use_tool(obj/item/W, mob/living/user, list/click_params) if(isScrewdriver(W)) switch(det_time) if (1) @@ -78,8 +78,8 @@ if (50) det_time = 1 to_chat(user, SPAN_NOTICE("You set the [name] for instant detonation.")) - add_fingerprint(user) - ..() + return TRUE + return ..() /obj/item/grenade/attack_hand() walk(src, null, null) diff --git a/code/game/objects/items/weapons/handcuffs.dm b/code/game/objects/items/weapons/handcuffs.dm index e86686ba5afd7..d61535837298e 100644 --- a/code/game/objects/items/weapons/handcuffs.dm +++ b/code/game/objects/items/weapons/handcuffs.dm @@ -125,7 +125,8 @@ var/global/last_chew = 0 var/obj/item/organ/external/O = H.organs_by_name[(H.hand ? BP_L_HAND : BP_R_HAND)] if (!O) return - H.visible_message(SPAN_DANGER("\The [H] chews on \his [O.name]!"), SPAN_DANGER("You chew on your [O.name]!")) + var/datum/pronouns/pronouns = H.choose_from_pronouns() + H.visible_message(SPAN_DANGER("\The [H] chews on [pronouns.his] [O.name]!"), SPAN_DANGER("You chew on your [O.name]!")) admin_attacker_log(H, "chewed on their [O.name]!") O.take_external_damage(3,0, DAMAGE_FLAG_SHARP|DAMAGE_FLAG_EDGE ,"teeth marks") diff --git a/code/game/objects/items/weapons/implants/implant.dm b/code/game/objects/items/weapons/implants/implant.dm index 26129eb74fb18..328128fe4cc91 100644 --- a/code/game/objects/items/weapons/implants/implant.dm +++ b/code/game/objects/items/weapons/implants/implant.dm @@ -29,7 +29,7 @@ return 0 malfunction = MALFUNCTION_TEMPORARY - addtimer(new Callback(src,.proc/restore),time) + addtimer(new Callback(src,PROC_REF(restore)),time) return 1 /obj/item/implant/proc/restore() diff --git a/code/game/objects/items/weapons/implants/implantcase.dm b/code/game/objects/items/weapons/implants/implantcase.dm index 00257f4eb54af..8597f1668efa3 100644 --- a/code/game/objects/items/weapons/implants/implantcase.dm +++ b/code/game/objects/items/weapons/implants/implantcase.dm @@ -33,13 +33,13 @@ icon_state = "implantcase-0" return -/obj/item/implantcase/attackby(obj/item/I, mob/user) +/obj/item/implantcase/use_tool(obj/item/I, mob/living/user, list/click_params) if (istype(I, /obj/item/pen)) var/t = input(user, "What would you like the label to be?", src.name, null) if (user.get_active_hand() != I) - return + return TRUE if((!in_range(src, usr) && loc != user)) - return + return TRUE t = sanitizeSafe(t, MAX_NAME_LEN) if(t) SetName("glass case - '[t]'") @@ -47,9 +47,13 @@ else SetName(initial(name)) desc = "A case containing an implant." + return TRUE + else if(istype(I, /obj/item/reagent_containers/syringe)) if(istype(imp,/obj/item/implant/chem)) - imp.attackby(I,user) + imp.use_tool(I,user) + return TRUE + else if (istype(I, /obj/item/implanter)) var/obj/item/implanter/M = I if (M.imp && !imp && !M.imp.implanted) @@ -63,10 +67,13 @@ update_description() update_icon() M.update_icon() + return TRUE + else if (istype(I, /obj/item/implant) && user.unEquip(I, src)) to_chat(usr, SPAN_NOTICE("You slide \the [I] into \the [src].")) imp = I update_description() update_icon() - else - return ..() + return TRUE + + return ..() diff --git a/code/game/objects/items/weapons/implants/implanter.dm b/code/game/objects/items/weapons/implants/implanter.dm index 9b5aac1371767..7fc43a71bdf8b 100644 --- a/code/game/objects/items/weapons/implants/implanter.dm +++ b/code/game/objects/items/weapons/implants/implanter.dm @@ -34,13 +34,14 @@ return 1 return 0 -/obj/item/implanter/attackby(obj/item/I, mob/user) +/obj/item/implanter/use_tool(obj/item/I, mob/living/user, list/click_params) if(!imp && istype(I, /obj/item/implant) && user.unEquip(I,src)) to_chat(usr, SPAN_NOTICE("You slide \the [I] into \the [src].")) imp = I update_icon() - else - ..() + return TRUE + + return ..() /obj/item/implanter/use_before(mob/M as mob, mob/user as mob) . = FALSE diff --git a/code/game/objects/items/weapons/implants/implantpad.dm b/code/game/objects/items/weapons/implants/implantpad.dm index 7364ad11a351d..24626ae189259 100644 --- a/code/game/objects/items/weapons/implants/implantpad.dm +++ b/code/game/objects/items/weapons/implants/implantpad.dm @@ -26,8 +26,7 @@ else return ..() -/obj/item/implantpad/attackby(obj/item/I, mob/user) - ..() +/obj/item/implantpad/use_tool(obj/item/I, mob/living/user, list/click_params) if(istype(I, /obj/item/implantcase)) var/obj/item/implantcase/C = I if(!imp && C.imp) @@ -39,6 +38,9 @@ C.imp = imp imp = null C.update_icon() + update_icon() + return TRUE + else if(istype(I, /obj/item/implanter)) var/obj/item/implanter/C = I if(!imp && C.imp) @@ -50,9 +52,15 @@ C.imp = imp imp = null C.update_icon() + update_icon() + return TRUE + else if(istype(I, /obj/item/implant) && user.unEquip(I, src)) imp = I - update_icon() + update_icon() + return TRUE + + return ..() /obj/item/implantpad/attack_self(mob/user) if (imp) diff --git a/code/game/objects/items/weapons/implants/implants/chem.dm b/code/game/objects/items/weapons/implants/implants/chem.dm index 11de6dddc1891..2861dd06520f3 100644 --- a/code/game/objects/items/weapons/implants/implants/chem.dm +++ b/code/game/objects/items/weapons/implants/implants/chem.dm @@ -33,16 +33,18 @@ reagents.trans_to_mob(R, amount, CHEM_BLOOD) to_chat(R, SPAN_NOTICE("You hear a faint *beep*.")) -/obj/item/implant/chem/attackby(obj/item/I, mob/user) +/obj/item/implant/chem/use_tool(obj/item/I, mob/living/user, list/click_params) if(istype(I, /obj/item/reagent_containers/syringe)) if(reagents.total_volume >= reagents.maximum_volume) to_chat(user, SPAN_WARNING("\The [src] is full.")) + return TRUE else if(do_after(user, 0.5 SECONDS, src, DO_MEDICAL)) I.reagents.trans_to_obj(src, 5) to_chat(user, SPAN_NOTICE("You inject 5 units of the solution. The syringe now contains [I.reagents.total_volume] units.")) - else - ..() + return TRUE + + return ..() /obj/item/implantcase/chem name = "glass case - 'chem'" diff --git a/code/game/objects/items/weapons/implants/implants/compressed.dm b/code/game/objects/items/weapons/implants/implants/compressed.dm index 33b85558c1d7a..bd1fbd9e0d764 100644 --- a/code/game/objects/items/weapons/implants/implants/compressed.dm +++ b/code/game/objects/items/weapons/implants/implants/compressed.dm @@ -56,7 +56,7 @@ if (isnull(c.scanned)) to_chat(user, "Please compress an object with the implanter first.") return TRUE - else return ..() + return ..() /obj/item/implanter/compressed/use_after(obj/item/A, mob/living/user, click_parameters) if(istype(A) && imp) diff --git a/code/game/objects/items/weapons/implants/implants/imprinting.dm b/code/game/objects/items/weapons/implants/implants/imprinting.dm index 7902e913b1cb3..61fb3a4504a75 100644 --- a/code/game/objects/items/weapons/implants/implants/imprinting.dm +++ b/code/game/objects/items/weapons/implants/implants/imprinting.dm @@ -51,7 +51,7 @@ M.StoreMemory(msg, /singleton/memory_options/system) if(brainwashing) log_and_message_admins("was implanted with a brainwashing implant holding following laws: [jointext(instructions, ";")].", M) - addtimer(new Callback(src,.proc/activate),3000,(TIMER_UNIQUE|TIMER_OVERRIDE)) + addtimer(new Callback(src, PROC_REF(activate)),3000,(TIMER_UNIQUE|TIMER_OVERRIDE)) return TRUE /obj/item/implant/imprinting/proc/get_instructions() @@ -83,7 +83,7 @@ else instruction = SPAN_NOTICE("You remember suddenly: \"[instruction]\"") to_chat(imp_in, instruction) - addtimer(new Callback(src,.proc/activate),3000,(TIMER_UNIQUE|TIMER_OVERRIDE)) + addtimer(new Callback(src, PROC_REF(activate)), 3000, (TIMER_UNIQUE|TIMER_OVERRIDE)) /obj/item/implant/imprinting/removed() if(brainwashing && !malfunction) diff --git a/code/game/objects/items/weapons/lighter.dm b/code/game/objects/items/weapons/lighter.dm index e7aa087978d9c..b3c419833df13 100644 --- a/code/game/objects/items/weapons/lighter.dm +++ b/code/game/objects/items/weapons/lighter.dm @@ -84,7 +84,7 @@ if (istype(M.wear_mask, /obj/item/clothing/mask/smokable/cigarette) && user.zone_sel.selecting == BP_MOUTH) var/obj/item/clothing/mask/smokable/cigarette/cig = M.wear_mask if (M == user) - cig.attackby(src, user) + cig.use_tool(src, user) else cig.light(SPAN_NOTICE("[user] holds the [name] out for [M], and lights the [cig.name].")) return TRUE @@ -94,7 +94,7 @@ if(ismob(loc) && prob(10) && reagents.get_reagent_amount(/datum/reagent/fuel) < 1) to_chat(loc, SPAN_WARNING("\The [src]'s flame flickers.")) set_light(0) - addtimer(new Callback(src, .atom/proc/set_light, 2), 4) + addtimer(new Callback(src, TYPE_PROC_REF(/atom, set_light), 2), 4) reagents.remove_reagent(/datum/reagent/fuel, 0.05) else extinguish() diff --git a/code/game/objects/items/weapons/material/ashtray.dm b/code/game/objects/items/weapons/material/ashtray.dm index cb8fc54180947..0565aa0b5cb8e 100644 --- a/code/game/objects/items/weapons/material/ashtray.dm +++ b/code/game/objects/items/weapons/material/ashtray.dm @@ -26,18 +26,15 @@ else if (length(contents) >= max_butts/2) AddOverlays(image('icons/obj/ashtray.dmi',"ashtray_half")) -/obj/item/material/ashtray/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/material/ashtray/use_tool(obj/item/W, mob/living/user, list/click_params) if (health_dead()) - return - - if (user.a_intent == I_HURT) - ..() - return + USE_FEEDBACK_FAILURE("\The [src] is damaged beyond use!") + return TRUE if (istype(W,/obj/item/trash/cigbutt) || istype(W,/obj/item/clothing/mask/smokable/cigarette) || istype(W, /obj/item/flame/match)) if (length(contents) >= max_butts) to_chat(user, "\The [src] is full.") - return + return TRUE if (istype(W,/obj/item/clothing/mask/smokable/cigarette)) var/obj/item/clothing/mask/smokable/cigarette/cig = W @@ -51,9 +48,9 @@ visible_message("[user] places [W] in [src].") set_extension(src, /datum/extension/scent/ashtray) update_icon() - return + return TRUE - ..() + return ..() /obj/item/material/ashtray/throw_impact(atom/hit_atom) if (get_max_health()) diff --git a/code/game/objects/items/weapons/material/coins.dm b/code/game/objects/items/weapons/material/coins.dm index 820f8b577f01c..c650131325f22 100644 --- a/code/game/objects/items/weapons/material/coins.dm +++ b/code/game/objects/items/weapons/material/coins.dm @@ -80,7 +80,7 @@ ) -/obj/item/material/coin/attackby(obj/item/item, mob/living/user) +/obj/item/material/coin/use_tool(obj/item/item, mob/living/user, list/click_params) if (isCoil(item) && isnull(string_color)) var/obj/item/stack/cable_coil/coil = item if (!coil.use(1)) @@ -94,6 +94,7 @@ string_color = coil.color update_icon() return TRUE + if (isWirecutter(item) && !isnull(string_color)) new /obj/item/stack/cable_coil (get_turf(user), 1, string_color) user.visible_message( @@ -104,7 +105,7 @@ string_color = null update_icon() return TRUE - ..() + return ..() /// Non-craftable coins intented to display specific imagery. /obj/item/material/coin/challenge diff --git a/code/game/objects/items/weapons/material/kitchen.dm b/code/game/objects/items/weapons/material/kitchen.dm index c16b98b68b56b..645c2c2dcd176 100644 --- a/code/game/objects/items/weapons/material/kitchen.dm +++ b/code/game/objects/items/weapons/material/kitchen.dm @@ -135,8 +135,9 @@ /obj/item/material/kitchen/rollingpin/use_before(mob/living/target, mob/living/user) . = FALSE if ((MUTATION_CLUMSY in user.mutations) && prob(50) && user.unEquip(src)) + var/datum/pronouns/pronouns = user.choose_from_pronouns() user.visible_message( - SPAN_WARNING("\The [user] manages to hit \himself on the head with \the [src]!"), + SPAN_WARNING("\The [user] manages to hit [pronouns.self] on the head with \the [src]!"), SPAN_WARNING("\The [src] slips out of your hand and hits your head!"), SPAN_WARNING("Bonk!") ) diff --git a/code/game/objects/items/weapons/material/misc.dm b/code/game/objects/items/weapons/material/misc.dm index 2717c83723c42..a54e5cd68acab 100644 --- a/code/game/objects/items/weapons/material/misc.dm +++ b/code/game/objects/items/weapons/material/misc.dm @@ -28,7 +28,7 @@ return audible_message(SPAN_WARNING("\The [src] emits a long, harsh tone!")) playsound(loc, 'sound/weapons/bombwhine.ogg', 100, 0, -3) - addtimer(new Callback(src, .proc/harpoon_detonate), 4 SECONDS) //for suspense + addtimer(new Callback(src, PROC_REF(harpoon_detonate)), 4 SECONDS) //for suspense /obj/item/material/harpoon/bomb/proc/harpoon_detonate() audible_message(SPAN_DANGER("\The [src] detonates!")) //an actual sound will be handled by explosion() diff --git a/code/game/objects/items/weapons/material/shards.dm b/code/game/objects/items/weapons/material/shards.dm index 27cab3fbd64b3..bae4afaafd905 100644 --- a/code/game/objects/items/weapons/material/shards.dm +++ b/code/game/objects/items/weapons/material/shards.dm @@ -1,10 +1,7 @@ -// Glass shards - /obj/item/material/shard name = "shard" icon = 'icons/obj/materials/shards.dmi' - desc = "Made of nothing. How does this even exist?" // set based on material, if this desc is visible it's a bug (shards default to being made of glass) - icon_state = "large" + icon_state = "" randpixel = 8 sharp = TRUE edge = TRUE @@ -15,98 +12,188 @@ item_state = "shard-glass" attack_verb = list("stabbed", "slashed", "sliced", "cut") default_material = MATERIAL_GLASS - unbreakable = 1 //It's already broken. - drops_debris = 0 + unbreakable = TRUE + drops_debris = FALSE item_flags = ITEM_FLAG_CAN_HIDE_IN_SHOES + /// The sound to play when a valid mob enters the shard's turf + var/step_sound = 'sound/effects/glass_step.ogg' + + /// Percent chance to embed in a wound if one was created + var/embed_chance = 12 + + /// If >0, the amount to weaken by when successfully hurting a mob + var/weaken_amount = 3 + + /// Whether the shard can hurt through footwear that has not set ITEM_FLAG_THICKMATERIAL + var/pierce_thin_footwear = FALSE + + /// Whether to update the shard with the name and appearance of its material. + var/applies_material_details = TRUE + + /obj/item/material/shard/set_material(new_material) ..(new_material) - if(!istype(material)) + if (!istype(material)) return - + if (!applies_material_details) + return + if (!material.shard_type) + qdel(src) + return + SetName("[material.display_name] [material.shard_type]") + desc = "A small piece of [material.display_name]. It looks sharp, you wouldn't want to step on it barefoot. Could probably be used as ... a throwing weapon?" + switch (material.shard_type) + if (SHARD_SPLINTER, SHARD_SHRAPNEL) + gender = PLURAL + else + gender = NEUTER icon_state = "[material.shard_icon][pick("large", "medium", "small")]" update_icon() - if(material.shard_type) - SetName("[material.display_name] [material.shard_type]") - desc = "A small piece of [material.display_name]. It looks sharp, you wouldn't want to step on it barefoot. Could probably be used as ... a throwing weapon?" - switch(material.shard_type) - if(SHARD_SPLINTER, SHARD_SHRAPNEL) - gender = PLURAL - else - gender = NEUTER - else - qdel(src) /obj/item/material/shard/on_update_icon() - if(material) + if (material && applies_material_colour) color = material.icon_colour // 1-(1-x)^2, so that glass shards with 0.3 opacity end up somewhat visible at 0.51 opacity - alpha = 255 * (1 - (1 - material.opacity)*(1 - material.opacity)) + var/inverse_opacity = 1 - material.opacity + alpha = 255 * (1 - inverse_opacity * inverse_opacity) else color = "#ffffff" alpha = 255 -/obj/item/material/shard/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/material/shard/use_tool(obj/item/W, mob/living/user, list/click_params) if(isWelder(W) && material.shard_can_repair) var/obj/item/weldingtool/WT = W - if(WT.remove_fuel(1, user)) - material.place_sheet(get_turf(src)) - qdel(src) - return + if (!WT.can_use(1, user)) + return TRUE + WT.remove_fuel(1, user) + material.place_sheet(get_turf(src)) + qdel(src) + return TRUE return ..() -/obj/item/material/shard/Crossed(AM as mob|obj) - ..() - if(isliving(AM)) - var/mob/M = AM +/obj/item/material/shard/Crossed(atom/movable/movable) + if (!isliving(movable)) + return + var/mob/living/carbon/human/human = movable + if (human.buckled) + return + playsound(src, step_sound, 50, TRUE) + if (human.ignore_hazard_flags & HAZARD_FLAG_SHARD) + return + if (!istype(human)) + to_chat(human, SPAN_WARNING("\A [src] cuts you!")) + human.take_overall_damage(force * 0.75, 0) + return + if (human.species.siemens_coefficient < 0.5) + return + if (human.species.species_flags & (SPECIES_FLAG_NO_EMBED|SPECIES_FLAG_NO_MINOR_CUT)) + return + var/list/check + if (!human.lying) + if (human.shoes) + if (human.shoes.item_flags & ITEM_FLAG_THICKMATERIAL) + return + if (!pierce_thin_footwear) + return + if (human.wear_suit?.body_parts_covered & FEET) + if (human.wear_suit.item_flags & ITEM_FLAG_THICKMATERIAL) + return + check = list(BP_L_FOOT, BP_R_FOOT) + else + check = BP_ALL_LIMBS + for (var/tag in shuffle(check, TRUE)) + var/obj/item/organ/external/external = human.get_organ(tag) + if (!external) + continue + if (human.lying) + var/obj/item/clothing/clothing = human.get_clothing_coverage(tag) + if (clothing?.item_flags & ITEM_FLAG_THICKMATERIAL) + return + var/damage_text = "slices" + if (BP_IS_ROBOTIC(external) || BP_IS_CRYSTAL(external)) + external.take_external_damage(force * 0.5, 0) + damage_text = "gouges" + else + var/damage_flags = DAMAGE_FLAG_SHARP + if (prob(embed_chance) && length(external.implants) < 2) + damage_flags |= DAMAGE_FLAG_EDGE + damage_text = "pierces into" + var/wound = external.take_external_damage(force * 0.75, 0, damage_flags) + if (damage_flags & DAMAGE_FLAG_EDGE) + external.embed(src, TRUE, null, wound) + if (weaken_amount && external.can_feel_pain()) + human.Weaken(weaken_amount) + to_chat(human, SPAN_DANGER("\A [src] [damage_text] your [external.name]!")) + human.updatehealth() + return + - if(M.buckled) //wheelchairs, office chairs, rollerbeds - return +/obj/item/material/shard/phoron + default_material = MATERIAL_PHORON - playsound(src.loc, 'sound/effects/glass_step.ogg', 50, 1) // not sure how to handle metal shards with sounds - if(ishuman(M)) - var/mob/living/carbon/human/H = M - if(H.species.siemens_coefficient<0.5 || (H.species.species_flags & (SPECIES_FLAG_NO_EMBED|SPECIES_FLAG_NO_MINOR_CUT))) //Thick skin. - return +/obj/item/material/shard/shrapnel + name = "shrapnel" + w_class = ITEM_SIZE_TINY + item_flags = EMPTY_BITFIELD + max_force = 4 + force_multiplier = 0.1 + thrown_force_multiplier = 0.25 + embed_chance = 20 + step_sound = 'sound/obj/item/material/shard/shrapnel.ogg' - if( H.shoes || ( H.wear_suit && (H.wear_suit.body_parts_covered & FEET) ) ) - return - to_chat(M, SPAN_DANGER("You step on \the [src]!")) +/obj/item/material/shard/shrapnel/steel + default_material = MATERIAL_STEEL - var/list/check = list(BP_L_FOOT, BP_R_FOOT) - while(length(check)) - var/picked = pick(check) - var/obj/item/organ/external/affecting = H.get_organ(picked) - if(affecting) - if(BP_IS_ROBOTIC(affecting)) - return - affecting.take_external_damage(5, 0) - H.updatehealth() - if(affecting.can_feel_pain()) - H.Weaken(3) - return - check -= picked - return +/obj/item/material/shard/shrapnel/titanium + default_material = MATERIAL_TITANIUM -/obj/item/material/shard/phoron/default_material = MATERIAL_PHORON +/obj/item/material/shard/shrapnel/aluminium + default_material = MATERIAL_ALUMINIUM -/obj/item/material/shard/shrapnel/name = "shrapnel" -/obj/item/material/shard/shrapnel/w_class = ITEM_SIZE_TINY -/obj/item/material/shard/shrapnel/item_flags = EMPTY_BITFIELD +/obj/item/material/shard/shrapnel/copper + default_material = MATERIAL_COPPER -/obj/item/material/shard/shrapnel/steel/default_material = MATERIAL_STEEL +/obj/item/material/shard/caltrop + name = "caltrop" + desc = "A savage area denial weapon designed to puncture tire and boot alike." + icon_state = "caltrop" + default_material = MATERIAL_STEEL + item_flags = EMPTY_BITFIELD + max_force = 12 + thrown_force_multiplier = 0.3 + step_sound = 'sound/obj/item/material/shard/caltrop.ogg' + embed_chance = 65 + pierce_thin_footwear = TRUE + applies_material_details = FALSE -/obj/item/material/shard/shrapnel/titanium/default_material = MATERIAL_TITANIUM +/obj/item/material/shard/caltrop/set_material(new_material) + ..(new_material) + name = "[material.display_name] [initial(name)]" + update_icon() -/obj/item/material/shard/shrapnel/aluminium/default_material = MATERIAL_ALUMINIUM +/obj/item/material/shard/caltrop/tack + name = "thumbtack" + desc = "A savage area denial weapon designed to puncture digit and heel alike." + icon_state = "tack0" + w_class = ITEM_SIZE_TINY + default_material = MATERIAL_ALUMINIUM + max_force = 2 + step_sound = 'sound/obj/item/material/shard/tack.ogg' + embed_chance = 100 + pierce_thin_footwear = FALSE + applies_material_colour = FALSE + weaken_amount = FALSE -/obj/item/material/shard/shrapnel/copper/default_material = MATERIAL_COPPER +/obj/item/material/shard/caltrop/tack/set_material(new_material) + ..(new_material) + icon_state = "tack[rand(0, 4)]" diff --git a/code/game/objects/items/weapons/material/stick.dm b/code/game/objects/items/weapons/material/stick.dm index b09fa3bc030bd..17b13e47ec578 100644 --- a/code/game/objects/items/weapons/material/stick.dm +++ b/code/game/objects/items/weapons/material/stick.dm @@ -17,12 +17,16 @@ shatter(0) -/obj/item/material/stick/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/material/stick/use_tool(obj/item/W, mob/living/user, list/click_params) if(W.sharp && W.edge && !sharp) - user.visible_message(SPAN_WARNING("[user] sharpens [src] with [W]."), SPAN_WARNING("You sharpen [src] using [W].")) + user.visible_message( + SPAN_WARNING("\The [user] sharpens \the [src] with \the [W]."), + SPAN_WARNING("You sharpen \the [src] using \the [W].") + ) sharp = TRUE SetName("sharpened " + name) update_force() + return TRUE return ..() diff --git a/code/game/objects/items/weapons/material/twohanded.dm b/code/game/objects/items/weapons/material/twohanded.dm index 8990644b4229c..326934d106ffd 100644 --- a/code/game/objects/items/weapons/material/twohanded.dm +++ b/code/game/objects/items/weapons/material/twohanded.dm @@ -176,7 +176,7 @@ user.do_windup_animation(attacker, attack_cooldown) - addtimer(new Callback(src, .proc/deflect, user, attacker, AM, home_run ? TT.maxrange * 2 : TT.maxrange, home_run ? TT.speed * 2 : TT.speed), 0) + addtimer(new Callback(src, PROC_REF(deflect), user, attacker, AM, home_run ? TT.maxrange * 2 : TT.maxrange, home_run ? TT.speed * 2 : TT.speed), 0) else playsound(src, 'sound/items/baseball/swing_woosh.wav', 75, 1) diff --git a/code/game/objects/items/weapons/melee/energy.dm b/code/game/objects/items/weapons/melee/energy.dm index 23f25c25a27c5..4fc2d9eb90971 100644 --- a/code/game/objects/items/weapons/melee/energy.dm +++ b/code/game/objects/items/weapons/melee/energy.dm @@ -93,7 +93,8 @@ /obj/item/melee/energy/attack_self(mob/living/user as mob) if (active) if ((MUTATION_CLUMSY in user.mutations) && prob(50)) - user.visible_message(SPAN_DANGER("\The [user] accidentally cuts \himself with \the [src]."),\ + var/datum/pronouns/pronouns = user.choose_from_pronouns() + user.visible_message(SPAN_DANGER("\The [user] accidentally cuts [pronouns.self] with \the [src]."),\ SPAN_DANGER("You accidentally cut yourself with \the [src].")) user.take_organ_damage(5,5) deactivate(user) diff --git a/code/game/objects/items/weapons/melee/misc.dm b/code/game/objects/items/weapons/melee/misc.dm index e396bbfc5a271..e1b3de28f4d7b 100644 --- a/code/game/objects/items/weapons/melee/misc.dm +++ b/code/game/objects/items/weapons/melee/misc.dm @@ -114,7 +114,7 @@ playsound(A, 'sound/effects/bang.ogg', 100, 1) playsound(A, 'sound/machines/airlock_creaking.ogg', 100, 1) A.visible_message(SPAN_DANGER("\The [user] tears \the [A] open with \a [src]!")) - addtimer(new Callback(A, /obj/machinery/door/airlock/.proc/open, TRUE), 0) + addtimer(new Callback(A, TYPE_PROC_REF(/obj/machinery/door/airlock, open), TRUE), 0) A.set_broken(TRUE) return TRUE else @@ -122,12 +122,12 @@ if ((MACHINE_IS_BROKEN(A) || !A.is_powered() || do_after(user, 8 SECONDS, A, DO_DEFAULT | DO_USER_UNIQUE_ACT | DO_PUBLIC_PROGRESS)) && !(A.operating || A.welded || A.locked)) playsound(A, 'sound/machines/airlock_creaking.ogg', 100, 1) if (A.density) - addtimer(new Callback(A, /obj/machinery/door/airlock/.proc/open, TRUE), 0) + addtimer(new Callback(A, TYPE_PROC_REF(/obj/machinery/door/airlock, open), TRUE), 0) if(!MACHINE_IS_BROKEN(A) && A.is_powered()) A.set_broken(TRUE) A.visible_message(SPAN_DANGER("\The [user] forces \the [A] open with \a [src]!")) else - addtimer(new Callback(A, /obj/machinery/door/airlock/.proc/close, TRUE), 0) + addtimer(new Callback(A, TYPE_PROC_REF(/obj/machinery/door/airlock, close), TRUE), 0) if (!MACHINE_IS_BROKEN(A) && A.is_powered()) A.set_broken(TRUE) A.visible_message(SPAN_DANGER("\The [user] forces \the [A] closed with \a [src]!")) diff --git a/code/game/objects/items/weapons/policetape.dm b/code/game/objects/items/weapons/policetape.dm index 765cf0962c2a8..72927288af846 100644 --- a/code/game/objects/items/weapons/policetape.dm +++ b/code/game/objects/items/weapons/policetape.dm @@ -332,7 +332,9 @@ var/global/list/tape_roll_applications = list() crumple() return ..(mover) -/obj/item/tape/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/tape/use_tool(obj/item/item, mob/living/user, list/click_params) + if (user.a_intent == I_HELP) + return ..() breaktape(user) /obj/item/tape/attack_hand(mob/user as mob) diff --git a/code/game/objects/items/weapons/scrubpack.dm b/code/game/objects/items/weapons/scrubpack.dm index d9f589dba8347..ad9c0eb0cfd82 100644 --- a/code/game/objects/items/weapons/scrubpack.dm +++ b/code/game/objects/items/weapons/scrubpack.dm @@ -74,7 +74,7 @@ display = "[display]%" to_chat(user, "\The [cell] charge is [display]") -/obj/item/scrubpack/attackby(obj/item/W, mob/user) +/obj/item/scrubpack/use_tool(obj/item/W, mob/living/user, list/click_params) if (istype(W, /obj/item/cell)) if (cell) to_chat(user, SPAN_WARNING("\The [src] already has \an [cell].")) @@ -83,7 +83,8 @@ to_chat(user, SPAN_WARNING("\The [W] is too small for \the [src].")) return TRUE if (!user.unEquip(W, src)) - return + FEEDBACK_UNEQUIP_FAILURE(user, W) + return TRUE user.visible_message( SPAN_ITALIC("\The [user] fits \the [W] to \the [src]."), SPAN_ITALIC("You fit \the [W] to \the [src]."), @@ -101,7 +102,8 @@ to_chat(user, SPAN_WARNING("\The [src] can't fit \a [W].")) return TRUE if (!user.unEquip(W, src)) - return + FEEDBACK_UNEQUIP_FAILURE(user, W) + return TRUE user.visible_message( SPAN_ITALIC("\The [user] fits \the [W] to \the [src]."), SPAN_ITALIC("You fit \the [W] to \the [src]."), @@ -147,7 +149,7 @@ playsound(src, 'sound/items/Screwdriver.ogg', 50, 1) return TRUE - . = ..() + return ..() /obj/item/scrubpack/attack_self(mob/user) toggle(user) diff --git a/code/game/objects/items/weapons/secrets_disk.dm b/code/game/objects/items/weapons/secrets_disk.dm index 6bfe6c74f9cac..d7a8f23f377d7 100644 --- a/code/game/objects/items/weapons/secrets_disk.dm +++ b/code/game/objects/items/weapons/secrets_disk.dm @@ -41,7 +41,7 @@ Your sequencer can't break the code.")) return 0 -/obj/item/disk/secret_project/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/disk/secret_project/use_tool(obj/item/W, mob/living/user, list/click_params) if(istype(W,/obj/item/card/id)) var/obj/item/card/id/ID = W if(check_access(ID)) @@ -49,8 +49,8 @@ to_chat(user, SPAN_NOTICE("You swipe your card and [locked ? "lock":"unlock"] the disk.")) else to_chat(user, SPAN_WARNING("The disk's screen flashes 'Access Denied'.")) - return - . = ..() + return TRUE + return ..() /obj/item/disk/secret_project/verb/change_codename() set name = "Change project codename" diff --git a/code/game/objects/items/weapons/shields.dm b/code/game/objects/items/weapons/shields.dm index 64e1703538d3c..b6395f9d22397 100644 --- a/code/game/objects/items/weapons/shields.dm +++ b/code/game/objects/items/weapons/shields.dm @@ -89,14 +89,15 @@ return base_block_chance -/obj/item/shield/riot/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/shield/riot/use_tool(obj/item/W, mob/living/user, list/click_params) if(istype(W, /obj/item/melee/baton)) if(cooldown < world.time - 25) - user.visible_message(SPAN_WARNING("[user] bashes [src] with [W]!")) + user.visible_message(SPAN_WARNING("\The [user] bashes \the [src] with \the [W]!")) playsound(user.loc, 'sound/effects/shieldbash.ogg', 50, 1) cooldown = world.time + return TRUE else - ..() + return ..() /obj/item/shield/riot/metal @@ -221,7 +222,7 @@ H.update_inv_r_hand() update_icon() - addtimer(new Callback(src, /obj/item/shield/energy/proc/UpdateSoundLoop), 0.25 SECONDS) + addtimer(new Callback(src, TYPE_PROC_REF(/obj/item/shield/energy, UpdateSoundLoop)), 0.25 SECONDS) /obj/item/shield/energy/proc/deactivate(mob/living/user) @@ -242,7 +243,7 @@ H.update_inv_l_hand() H.update_inv_r_hand() - addtimer(new Callback(src, /obj/item/shield/energy/proc/UpdateSoundLoop), 0.1 SECONDS) + addtimer(new Callback(src, TYPE_PROC_REF(/obj/item/shield/energy, UpdateSoundLoop)), 0.1 SECONDS) /obj/item/shield/energy/attack_self(mob/living/user) diff --git a/code/game/objects/items/weapons/soap.dm b/code/game/objects/items/weapons/soap.dm index 70d592aea9772..e8294fe9f94dd 100644 --- a/code/game/objects/items/weapons/soap.dm +++ b/code/game/objects/items/weapons/soap.dm @@ -167,15 +167,17 @@ user.setClickCooldown(DEFAULT_QUICK_COOLDOWN) //prevent spam return TRUE -/obj/item/soap/attackby(obj/item/I, mob/user) +/obj/item/soap/use_tool(obj/item/I, mob/living/user, list/click_params) if(istype(I, /obj/item/key)) if(!key_data) to_chat(user, SPAN_NOTICE("You imprint \the [I] into \the [src].")) var/obj/item/key/K = I key_data = K.key_data update_icon() - return - ..() + else + USE_FEEDBACK_FAILURE("\The [src] already has a key imprint!") + return TRUE + return ..() /obj/item/soap/on_update_icon() ClearOverlays() diff --git a/code/game/objects/items/weapons/storage/backpack.dm b/code/game/objects/items/weapons/storage/backpack.dm index 7454eb21dbef7..4b07a945f8f3b 100644 --- a/code/game/objects/items/weapons/storage/backpack.dm +++ b/code/game/objects/items/weapons/storage/backpack.dm @@ -476,11 +476,11 @@ anchored = i ? TRUE : FALSE alpha = i ? 128 : initial(alpha) -/obj/item/storage/backpack/satchel/flat/attackby(obj/item/W, mob/user) +/obj/item/storage/backpack/satchel/flat/use_tool(obj/item/tool, mob/living/user, list/click_params) var/turf/T = get_turf(src) if(hides_under_flooring() && isturf(T) && !T.is_plating()) to_chat(user, SPAN_WARNING("You must remove the plating first.")) - return 1 + return TRUE return ..() //ERT backpacks. diff --git a/code/game/objects/items/weapons/storage/bags.dm b/code/game/objects/items/weapons/storage/bags.dm index d34f3bacb3e60..def5b13648166 100644 --- a/code/game/objects/items/weapons/storage/bags.dm +++ b/code/game/objects/items/weapons/storage/bags.dm @@ -66,11 +66,11 @@ desc = "The latest and greatest in custodial convenience, a trashbag that is capable of holding vast quantities of garbage." icon_state = "bluetrashbag" -/obj/item/storage/bag/trash/bluespace/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/storage/bag/trash/bluespace/use_tool(obj/item/W, mob/living/user, list/click_params) if(istype(W, /obj/item/storage/backpack/holding) || istype(W, /obj/item/storage/bag/trash/bluespace)) to_chat(user, SPAN_WARNING("The Bluespace interfaces of the two devices conflict and malfunction.")) qdel(W) - return 1 + return TRUE return ..() // ----------------------------- diff --git a/code/game/objects/items/weapons/storage/bible.dm b/code/game/objects/items/weapons/storage/bible.dm index 4552132208e2e..23eb3f8d78937 100644 --- a/code/game/objects/items/weapons/storage/bible.dm +++ b/code/game/objects/items/weapons/storage/bible.dm @@ -72,7 +72,8 @@ if (user.mind && istype(user.mind.assigned_job, /datum/job/chaplain)) user.visible_message(SPAN_NOTICE("\The [user] places \the [src] on \the [M]'s forehead, reciting a prayer...")) if (do_after(user, 5 SECONDS, M, DO_DEFAULT | DO_USER_UNIQUE_ACT | DO_PUBLIC_PROGRESS) && user.Adjacent(M)) - user.visible_message("\The [user] finishes reciting \his prayer, removing \the [src] from \the [M]'s forehead.", "You finish reciting your prayer, removing \the [src] from \the [M]'s forehead.") + var/datum/pronouns/pronouns = user.choose_from_pronouns() + user.visible_message("\The [user] finishes reciting [pronouns.his] prayer, removing \the [src] from \the [M]'s forehead.", "You finish reciting your prayer, removing \the [src] from \the [M]'s forehead.") if (user.get_cultural_value(TAG_RELIGION) == M.get_cultural_value(TAG_RELIGION)) to_chat(M, SPAN_NOTICE("You feel calm and relaxed, at one with the universe.")) else @@ -88,9 +89,9 @@ A.reagents.add_reagent(/datum/reagent/water/holywater,water2holy) return TRUE -/obj/item/storage/bible/attackby(obj/item/W as obj, mob/user as mob) - if (src.use_sound) - playsound(src.loc, src.use_sound, 50, 1, -5) +/obj/item/storage/bible/use_tool(obj/item/W, mob/living/user, list/click_params) + if (use_sound) + playsound(loc, use_sound, 50, 1, -5) return ..() /obj/item/storage/bible/attack_self(mob/living/carbon/human/user) diff --git a/code/game/objects/items/weapons/storage/fancy/_fancy.dm b/code/game/objects/items/weapons/storage/fancy/_fancy.dm index 6d6d0790302f1..2386ee35296b9 100644 --- a/code/game/objects/items/weapons/storage/fancy/_fancy.dm +++ b/code/game/objects/items/weapons/storage/fancy/_fancy.dm @@ -81,10 +81,18 @@ /obj/item/storage/fancy/open(mob/user as mob) if(sealed) - to_chat(user, "You need to unseal \the [src] first!") + to_chat(user, SPAN_WARNING("You need to unseal \the [src] first!")) return ..() +/obj/item/storage/fancy/can_be_inserted(obj/item/item, mob/user, stop_messages) + if (!istype(item)) + return FALSE + if (sealed) + to_chat(user, SPAN_WARNING("You need to unseal \the [src] first!")) + return FALSE + return ..() + /obj/item/storage/fancy/proc/UpdateTypeCounts() total_keys = 0 diff --git a/code/game/objects/items/weapons/storage/fancy/crackers.dm b/code/game/objects/items/weapons/storage/fancy/crackers.dm index f74a1227cda89..a14136f8beb14 100644 --- a/code/game/objects/items/weapons/storage/fancy/crackers.dm +++ b/code/game/objects/items/weapons/storage/fancy/crackers.dm @@ -1,6 +1,6 @@ /obj/item/storage/fancy/crackers name = "\improper Getmore Crackers" - icon = 'icons/obj/food/food.dmi' + icon = 'icons/obj/food/food_storage.dmi' icon_state = "crackerbag" open_sound = 'sound/effects/crinkle.ogg' storage_slots = 6 diff --git a/code/game/objects/items/weapons/storage/fancy/egg_box.dm b/code/game/objects/items/weapons/storage/fancy/egg_box.dm index 98bba63e50cea..9310fba7c5426 100644 --- a/code/game/objects/items/weapons/storage/fancy/egg_box.dm +++ b/code/game/objects/items/weapons/storage/fancy/egg_box.dm @@ -1,6 +1,6 @@ /obj/item/storage/fancy/egg_box name = "egg box" - icon = 'icons/obj/food/food.dmi' + icon = 'icons/obj/food/food_storage.dmi' icon_state = "eggbox" open_sound = 'sound/effects/storage/smallbox.ogg' storage_slots = 12 diff --git a/code/game/objects/items/weapons/storage/fancy/matchbox.dm b/code/game/objects/items/weapons/storage/fancy/matchbox.dm index a503f9a4df1a6..6e9b8296a6e03 100644 --- a/code/game/objects/items/weapons/storage/fancy/matchbox.dm +++ b/code/game/objects/items/weapons/storage/fancy/matchbox.dm @@ -26,16 +26,19 @@ startswith = list(/obj/item/flame/match = 3) -/obj/item/storage/fancy/matches/attackby(obj/item/flame/match/W as obj, mob/user as mob) - if(istype(W) && !W.lit && !W.burnt) +/obj/item/storage/fancy/matches/use_tool(obj/item/item, mob/living/user, list/click_params) + if (!istype(item, /obj/item/flame/match)) + return ..() + var/obj/item/flame/match/W = item + if(!W.lit && !W.burnt) W.lit = TRUE W.damtype = INJURY_TYPE_BURN W.icon_state = "match_lit" START_PROCESSING(SSobj, W) playsound(loc, 'sound/items/match.ogg', 60, 1, -4) - user.visible_message(SPAN_NOTICE("[user] strikes the match on \the [src].")) + user.visible_message(SPAN_NOTICE("\The [user] strikes the match on \the [src].")) W.update_icon() - return + return TRUE ///Exclusive to larger matchboxes; as cigarette boxes and matchbooks have one sprite per removed item while these do not. diff --git a/code/game/objects/items/weapons/storage/fancy/smokable/basic.dm b/code/game/objects/items/weapons/storage/fancy/smokable/basic.dm index 55d1457b200c8..90291935af578 100644 --- a/code/game/objects/items/weapons/storage/fancy/smokable/basic.dm +++ b/code/game/objects/items/weapons/storage/fancy/smokable/basic.dm @@ -150,6 +150,7 @@ max_storage_space = null storage_slots = 7 slot_flags = SLOT_BELT + sealed = FALSE key_type = list(/obj/item/clothing/mask/smokable/cigarette/cigar) startswith = list( /obj/item/clothing/mask/smokable/cigarette/cigar = 6 diff --git a/code/game/objects/items/weapons/storage/internal.dm b/code/game/objects/items/weapons/storage/internal.dm index 1210c40c87bcc..b168975bc08a4 100644 --- a/code/game/objects/items/weapons/storage/internal.dm +++ b/code/game/objects/items/weapons/storage/internal.dm @@ -22,7 +22,7 @@ //Helper procs to cleanly implement internal storages - storage items that provide inventory slots for other items. //These procs are completely optional, it is up to the master item to decide when it's storage get's opened by calling open() //However they are helpful for allowing the master item to pretend it is a storage item itself. -//If you are using these you will probably want to override attackby() as well. +//If you are using these you will probably want to override use_tool() as well. //See /obj/item/clothing/suit/storage for an example. //items that use internal storage have the option of calling this to emulate default storage MouseDrop behaviour. diff --git a/code/game/objects/items/weapons/storage/lockbox.dm b/code/game/objects/items/weapons/storage/lockbox.dm index fce04a5eaee55..096bc9be7fef5 100644 --- a/code/game/objects/items/weapons/storage/lockbox.dm +++ b/code/game/objects/items/weapons/storage/lockbox.dm @@ -15,7 +15,7 @@ var/icon_broken = "lockbox+b" -/obj/item/storage/lockbox/attackby(obj/item/I, mob/user) +/obj/item/storage/lockbox/use_tool(obj/item/I, mob/living/user, list/click_params) if (istype(I, /obj/item/card/id)) if (broken) to_chat(user, SPAN_WARNING("It seems to be broken!")) @@ -27,8 +27,9 @@ else icon_state = icon_closed to_chat(user, SPAN_NOTICE("You lock \the [src]!")) - return - else if (!broken && istype(I, /obj/item/melee/energy/blade)) + return TRUE + + if (!broken && istype(I, /obj/item/melee/energy/blade)) var/success = emag_act(INFINITY, user, I, null, "You hear metal being sliced and sparks flying.") if (success) var/datum/effect/spark_spread/spark_system = new @@ -36,10 +37,12 @@ spark_system.start() playsound(loc, 'sound/weapons/blade1.ogg', 50, 1) playsound(loc, "sparks", 50, 1) + return TRUE + if (locked) to_chat(user, SPAN_WARNING("It's locked!")) - return - ..() + return TRUE + return ..() /obj/item/storage/lockbox/show_to(mob/user) @@ -113,6 +116,6 @@ AddOverlays(image(icon, src, "ledb")) return -/obj/item/storage/lockbox/vials/attackby(obj/item/item, mob/living/user) +/obj/item/storage/lockbox/vials/use_tool(obj/item/W, mob/living/user, list/click_params) . = ..() update_icon() diff --git a/code/game/objects/items/weapons/storage/lunchbox.dm b/code/game/objects/items/weapons/storage/lunchbox.dm index b86111ebcd14c..2a6c8e38dd381 100644 --- a/code/game/objects/items/weapons/storage/lunchbox.dm +++ b/code/game/objects/items/weapons/storage/lunchbox.dm @@ -1,112 +1,133 @@ /obj/item/storage/lunchbox max_storage_space = ITEM_SIZE_SMALL * 4 - name = "rainbow lunchbox" icon = 'icons/obj/lunchboxes.dmi' - icon_state = "lunchbox_rainbow" - item_state = "toolbox_pink" - desc = "A little lunchbox. This one is the colors of the rainbow!" w_class = ITEM_SIZE_NORMAL max_w_class = ITEM_SIZE_SMALL - var/filled = FALSE attack_verb = list("lunched") allow_slow_dump = TRUE + var/filled = FALSE + -/obj/item/storage/lunchbox/New() - ..() - if(filled) +/obj/item/storage/lunchbox/Initialize() + . = ..() + if (filled) var/list/lunches = lunchables_lunches() var/lunch = lunches[pick(lunches)] new lunch(src) - var/list/snacks = lunchables_snacks() var/snack = snacks[pick(snacks)] new snack(src) - var/list/drinks = lunchables_drinks() var/drink = drinks[pick(drinks)] new drink(src) -/obj/item/storage/lunchbox/filled + +/obj/item/storage/lunchbox/rainbow + name = "rainbow lunchbox" + icon_state = "lunchbox_rainbow" + item_state = "toolbox_pink" + desc = "A little lunchbox. This one is the colors of the rainbow!" + + +/obj/item/storage/lunchbox/rainbow/filled filled = TRUE + /obj/item/storage/lunchbox/heart name = "heart lunchbox" icon_state = "lunchbox_lovelyhearts" item_state = "toolbox_pink" desc = "A little lunchbox. This one has cute little hearts on it!" + /obj/item/storage/lunchbox/heart/filled filled = TRUE + /obj/item/storage/lunchbox/cat name = "cat lunchbox" icon_state = "lunchbox_sciencecatshow" item_state = "toolbox_green" desc = "A little lunchbox. This one has a cute little science cat from a popular show on it!" + /obj/item/storage/lunchbox/cat/filled filled = TRUE + /obj/item/storage/lunchbox/nt name = "\improper NanoTrasen brand lunchbox" icon_state = "lunchbox_nanotrasen" item_state = "toolbox_blue" desc = "A little lunchbox. This one is branded with the NanoTrasen logo!" + /obj/item/storage/lunchbox/dais name = "\improper DAIS brand lunchbox" icon_state = "lunchbox_dais" item_state = "toolbox_blue" desc = "A little lunchbox. This one is branded with the Deimos Advanced Information Systems logo!" + /obj/item/storage/lunchbox/nt/filled filled = TRUE + /obj/item/storage/lunchbox/mars name = "\improper Mariner University lunchbox" icon_state = "lunchbox_marsuniversity" item_state = "toolbox_red" desc = "A little lunchbox. This one is branded with the Mariner university logo!" + /obj/item/storage/lunchbox/mars/filled filled = TRUE + /obj/item/storage/lunchbox/cti name = "\improper CTI lunchbox" icon_state = "lunchbox_cti" item_state = "toolbox_blue" desc = "A little lunchbox. This one is branded with the CTI logo!" + /obj/item/storage/lunchbox/cti/filled filled = TRUE + /obj/item/storage/lunchbox/nymph name = "\improper Diona nymph lunchbox" icon_state = "lunchbox_dionanymph" item_state = "toolbox_yellow" desc = "A little lunchbox. This one is an adorable Diona nymph on the side!" + /obj/item/storage/lunchbox/nymph/filled filled = TRUE + /obj/item/storage/lunchbox/syndicate name = "black and red lunchbox" icon_state = "lunchbox_syndie" item_state = "toolbox_syndi" desc = "A little lunchbox. This one is a sleek black and red, made of a durable steel!" + /obj/item/storage/lunchbox/syndicate/filled filled = TRUE -/obj/item/storage/lunchbox/TCC + +/obj/item/storage/lunchbox/gcc name = "\improper GCC lunchbox" icon_state = "lunchbox_tcc" item_state = "toolbox_syndi" desc = "A little lunchbox. This one is branded with the flag of the Gilgamesh Colonial Confederation!" -/obj/item/storage/lunchbox/syndicate/filled + +/obj/item/storage/lunchbox/gcc/filled filled = TRUE + /obj/item/storage/lunchbox/picnic name = "picnic basket" icon = 'icons/obj/picnic_basket.dmi' @@ -114,5 +135,21 @@ item_state = "picnic_basket" desc = "A small, old-fashioned picnic basket. Great for lunches in the garden." + /obj/item/storage/lunchbox/picnic/filled filled = TRUE + + +/obj/item/storage/lunchbox/caltrops + startswith = list( + /obj/item/material/shard/caltrop = 4 + ) + +/obj/item/storage/lunchbox/caltrops/Initialize() + . = ..() + var/mimic_types = subtypesof(/obj/item/storage/lunchbox) - /obj/item/storage/lunchbox/caltrops + var/obj/item/storage/lunchbox/mimic = pick(mimic_types) + name = initial(mimic.name) + icon_state = initial(mimic.icon_state) + item_state = initial(mimic.item_state) + desc = initial(mimic.desc) diff --git a/code/game/objects/items/weapons/storage/misc.dm b/code/game/objects/items/weapons/storage/misc.dm index cc0df28d35713..32547be3c942b 100644 --- a/code/game/objects/items/weapons/storage/misc.dm +++ b/code/game/objects/items/weapons/storage/misc.dm @@ -3,31 +3,36 @@ desc = "It's a small bag with dice inside." icon = 'icons/obj/dice.dmi' icon_state = "dicebag" + startswith = list( + /obj/item/dice = 6 + ) -/obj/item/storage/pill_bottle/dice/New() - ..() - for(var/i = 1 to 7) - new /obj/item/dice( src ) /obj/item/storage/pill_bottle/dice_nerd //DnD dice name = "bag of gaming dice" desc = "It's a small bag with gaming dice inside." icon = 'icons/obj/dice.dmi' icon_state = "magicdicebag" + startswith = list( + /obj/item/dice/d4 = 1, + /obj/item/dice = 1, + /obj/item/dice/d8 = 1, + /obj/item/dice/d10 = 1, + /obj/item/dice/d12 = 1, + /obj/item/dice/d20 = 1, + /obj/item/dice/d100 = 1 + ) -/obj/item/storage/pill_bottle/dice_nerd/New() - ..() - new /obj/item/dice/d4( src ) - new /obj/item/dice( src ) - new /obj/item/dice/d8( src ) - new /obj/item/dice/d10( src ) - new /obj/item/dice/d12( src ) - new /obj/item/dice/d20( src ) - new /obj/item/dice/d100( src ) +/obj/item/storage/pill_bottle/tacks + name = "pot of thumbtacks" + desc = "What sort of monster would unleash these on the world?" + startswith = list( + /obj/item/material/shard/caltrop/tack = 6 + ) /obj/item/storage/box/donut - icon = 'icons/obj/food/food.dmi' + icon = 'icons/obj/food/food_storage.dmi' icon_state = "donutbox" name = "donut box" contents_allowed = list(/obj/item/reagent_containers/food/snacks/donut) @@ -39,7 +44,7 @@ ClearOverlays() var/i = 0 for(var/obj/item/reagent_containers/food/snacks/donut/D in contents) - var/image/I = image('icons/obj/food/food.dmi', "[i][D.overlay_state]") + var/image/I = image('icons/obj/food/food_storage.dmi', "[i][D.overlay_state]") if(D.overlay_state == "box-donut1") I.color = D.filling_color AddOverlays(I) diff --git a/code/game/objects/items/weapons/storage/mre.dm b/code/game/objects/items/weapons/storage/mre.dm index 3f5f56c13baeb..9cb3c4d9135a2 100644 --- a/code/game/objects/items/weapons/storage/mre.dm +++ b/code/game/objects/items/weapons/storage/mre.dm @@ -5,7 +5,7 @@ MRE Stuff /obj/item/storage/mre name = "MRE, Menu 1" desc = "A vacuum-sealed bag containing a day's worth of nutrients for an adult in strenuous situations. There is no visible expiration date on the package." - icon = 'icons/obj/food/food.dmi' + icon = 'icons/obj/food/mre.dmi' icon_state = "mre" storage_slots = 7 max_w_class = ITEM_SIZE_SMALL @@ -183,7 +183,7 @@ MRE Stuff /obj/item/storage/mrebag name = "main course" desc = "A vacuum-sealed bag containing the MRE's main course. Self-heats when opened." - icon = 'icons/obj/food/food.dmi' + icon = 'icons/obj/food/mre.dmi' icon_state = "pouch_medium" storage_slots = 1 w_class = ITEM_SIZE_SMALL diff --git a/code/game/objects/items/weapons/storage/pill_bottle.dm b/code/game/objects/items/weapons/storage/pill_bottle.dm index cd85217e1d195..52561faa6bea6 100644 --- a/code/game/objects/items/weapons/storage/pill_bottle.dm +++ b/code/game/objects/items/weapons/storage/pill_bottle.dm @@ -10,7 +10,8 @@ contents_allowed = list( /obj/item/reagent_containers/pill, /obj/item/dice, - /obj/item/paper + /obj/item/paper, + /obj/item/material/shard/caltrop/tack ) allow_quick_gather = TRUE allow_quick_empty = TRUE diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm index b57d6517fe085..6838097e2186d 100644 --- a/code/game/objects/items/weapons/storage/storage.dm +++ b/code/game/objects/items/weapons/storage/storage.dm @@ -339,22 +339,6 @@ return ..() -///Eventually should be deleted in favor of use_tool; keeping duplicate until downstream attackbys are replaced. -/obj/item/storage/attackby(obj/item/W, mob/living/user, click_params) - if (SSfabrication.try_craft_with(src, W, user)) - return TRUE - - if (isrobot(user) && (W == user.get_active_hand())) - return //Robots can't store their modules. - - if (!can_be_inserted(W, user)) - return TRUE - - if (handle_item_insertion(W)) - return TRUE - - return ..() - /obj/item/storage/attack_hand(mob/user as mob) if(ishuman(user)) var/mob/living/carbon/human/H = user diff --git a/code/game/objects/items/weapons/storage/wall_mirror.dm b/code/game/objects/items/weapons/storage/wall_mirror.dm index d8eb95d984290..87893f8d55b19 100644 --- a/code/game/objects/items/weapons/storage/wall_mirror.dm +++ b/code/game/objects/items/weapons/storage/wall_mirror.dm @@ -51,7 +51,7 @@ shatter() ..() -/obj/item/storage/mirror/attackby(obj/item/I, mob/user) +/obj/item/storage/mirror/use_tool(obj/item/I, mob/living/user, list/click_params) . = ..() if (!.) return diff --git a/code/game/objects/items/weapons/storage/wallets.dm b/code/game/objects/items/weapons/storage/wallets.dm index eb7c34c6cf78a..ded357dd23b07 100644 --- a/code/game/objects/items/weapons/storage/wallets.dm +++ b/code/game/objects/items/weapons/storage/wallets.dm @@ -146,7 +146,7 @@ /obj/item/storage/wallet/poly/emp_act(severity) icon_state = "wallet-emp" update_icon() - addtimer(new Callback(src, .proc/resolve_emp_timer), 5 SECONDS) + addtimer(new Callback(src, PROC_REF(resolve_emp_timer)), 5 SECONDS) ..() diff --git a/code/game/objects/items/weapons/stunbaton.dm b/code/game/objects/items/weapons/stunbaton.dm index 3feb81a4a1221..f752d71d62bbb 100644 --- a/code/game/objects/items/weapons/stunbaton.dm +++ b/code/game/objects/items/weapons/stunbaton.dm @@ -78,25 +78,28 @@ if(!bcell) to_chat(user, SPAN_WARNING("The baton does not have a power source installed.")) -/obj/item/melee/baton/attackby(obj/item/W, mob/user) +/obj/item/melee/baton/use_tool(obj/item/W, mob/living/user, list/click_params) if(istype(W, /obj/item/cell/device)) if(!bcell && user.unEquip(W)) W.forceMove(src) bcell = W - to_chat(user, SPAN_NOTICE("You install a cell into the [src].")) + to_chat(user, SPAN_NOTICE("You install a cell into \the [src].")) update_icon() else - to_chat(user, SPAN_NOTICE("[src] already has a cell.")) + to_chat(user, SPAN_NOTICE("\The [src] already has a cell.")) + return TRUE + else if(isScrewdriver(W)) if(bcell) bcell.update_icon() bcell.dropInto(loc) bcell = null - to_chat(user, SPAN_NOTICE("You remove the cell from the [src].")) + to_chat(user, SPAN_NOTICE("You remove the cell from \the [src].")) status = 0 update_icon() + return TRUE else - ..() + return ..() /obj/item/melee/baton/attack_self(mob/user) set_status(!status, user) @@ -249,7 +252,7 @@ name = "stunprod" desc = "An improvised stun baton." icon = 'icons/obj/weapons/melee_physical.dmi' - icon_state = "stunprod_nocell" + icon_state = "stunprod" item_state = "prod" force = 3 throwforce = 5 @@ -258,3 +261,7 @@ hitcost = 25 attack_verb = list("poked") slot_flags = null + +/obj/item/melee/baton/cattleprod/New() + update_icon() + ..() diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm index 6c46316a95145..720705b301bf4 100644 --- a/code/game/objects/items/weapons/tanks/tanks.dm +++ b/code/game/objects/items/weapons/tanks/tanks.dm @@ -108,16 +108,15 @@ var/global/list/tank_gauge_cache = list() descriptive = "bitterly cold" to_chat(user, SPAN_ITALIC("\The [src] feels [descriptive].")) -/obj/item/tank/attackby(obj/item/W, mob/user) - ..() +/obj/item/tank/use_tool(obj/item/W, mob/living/user, list/click_params) if (istype(loc, /obj/item/assembly)) icon = loc + return TRUE if (istype(W, /obj/item/device/scanner/gas)) - return + return ..() if (isScrewdriver(W)) - add_fingerprint(user) user.visible_message( SPAN_ITALIC("\The [user] starts to use \the [W] on \the [src]."), SPAN_ITALIC("You start to force \the [src]'s emergency relief valve with \the [W]."), @@ -126,38 +125,36 @@ var/global/list/tank_gauge_cache = list() ) if (GET_FLAGS(tank_flags, TANK_FLAG_WELDED)) to_chat(user, SPAN_WARNING("The valve is stuck. You can't move it at all!")) - return + return TRUE var/reduction = round(user.get_skill_value(SKILL_ATMOS) * 0.5) //0,1,1,2,2 if (do_after(user, (5 - reduction) SECONDS, src, DO_PUBLIC_UNIQUE)) if (GET_FLAGS(tank_flags, TANK_FLAG_WELDED)) to_chat(user, SPAN_WARNING("The valve is stuck. You can't move it at all!")) - return + return TRUE FLIP_FLAGS(tank_flags, TANK_FLAG_FORCED) to_chat(user, SPAN_NOTICE("You finish forcing the valve [GET_FLAGS(tank_flags, TANK_FLAG_FORCED) ? "open" : "closed"].")) - return + return TRUE if (istype(W,/obj/item/latexballon)) - add_fingerprint(user) var/obj/item/latexballon/LB = W LB.blow(src) + return TRUE if(isCoil(W)) if (GET_FLAGS(tank_flags, TANK_FLAG_WIRED)) to_chat(user, SPAN_WARNING("\The [src] is already wired.")) + return TRUE else - add_fingerprint(user) var/obj/item/stack/cable_coil/C = W var/single = C.get_amount() == 1 if(C.use(1)) SET_FLAGS(tank_flags, TANK_FLAG_WIRED) to_chat(user, SPAN_NOTICE("You attach [single ? "" : "some of "]\the [C] to \the [src].")) update_icon(TRUE) - return + return TRUE if(isWirecutter(W)) - add_fingerprint(user) if(GET_FLAGS(tank_flags, TANK_FLAG_WIRED) && proxyassembly.assembly) - to_chat(user, SPAN_NOTICE("You carefully begin clipping the wires that attach to the tank.")) if(do_after(user, 10 SECONDS, src)) CLEAR_FLAGS(tank_flags, TANK_FLAG_WIRED) @@ -176,48 +173,54 @@ var/global/list/tank_gauge_cache = list() proxyassembly.assembly = null qdel(assy) update_icon(TRUE) + return TRUE else to_chat(user, SPAN_DANGER("You slip and bump the igniter!")) if(prob(85)) proxyassembly.receive_signal() + return TRUE else if(GET_FLAGS(tank_flags, TANK_FLAG_WIRED)) if(do_after(user, (W.toolspeed * 1) SECOND, src, DO_PUBLIC_UNIQUE)) to_chat(user, SPAN_NOTICE("You quickly clip the wire from the tank.")) CLEAR_FLAGS(tank_flags, TANK_FLAG_WIRED) update_icon(TRUE) + return TRUE else to_chat(user, SPAN_NOTICE("There are no wires to cut!")) + return TRUE if(istype(W, /obj/item/device/assembly_holder)) if(GET_FLAGS(tank_flags, TANK_FLAG_WIRED)) - add_fingerprint(user) to_chat(user, SPAN_NOTICE("You begin attaching the assembly to \the [src].")) if(do_after(user, 5 SECONDS, src, DO_PUBLIC_UNIQUE)) to_chat(user, SPAN_NOTICE("You finish attaching the assembly to \the [src].")) GLOB.bombers += "[key_name(user)] attached an assembly to a wired [src]. Temp: [air_contents.temperature-T0C]" log_and_message_admins("attached an assembly to a wired [src]. Temp: [air_contents.temperature-T0C]", user) assemble_bomb(W,user) + return TRUE else to_chat(user, SPAN_NOTICE("You stop attaching the assembly.")) + return TRUE else to_chat(user, SPAN_NOTICE("You need to wire the device up first.")) + return TRUE if(isWelder(W)) var/obj/item/weldingtool/WT = W if (GET_FLAGS(tank_flags, TANK_FLAG_FORCED)) to_chat(user, SPAN_WARNING("\The [src]'s emergency relief valve must be closed before you can weld it shut!")) - return + return TRUE if(WT.can_use(1,user)) - add_fingerprint(user) if(!GET_FLAGS(tank_flags, TANK_FLAG_WELDED)) to_chat(user, SPAN_NOTICE("You begin welding the \the [src] emergency pressure relief valve.")) if(do_after(user, (W.toolspeed * 4) SECONDS, src, DO_PUBLIC_UNIQUE) && WT.remove_fuel(1, user)) to_chat(user, "[SPAN_NOTICE("You carefully weld \the [src] emergency pressure relief valve shut.")][SPAN_WARNING(" \The [src] may now rupture under pressure!")]") SET_FLAGS(tank_flags, TANK_FLAG_WELDED) CLEAR_FLAGS(tank_flags, TANK_FLAG_LEAKING) + return TRUE else GLOB.bombers += "[key_name(user)] attempted to weld a [src]. [air_contents.temperature-T0C]" log_and_message_admins("attempted to weld a [src]. [air_contents.temperature-T0C]", user) @@ -226,8 +229,11 @@ var/global/list/tank_gauge_cache = list() maxintegrity -= rand(2,6) integrity = min(integrity,maxintegrity) air_contents.add_thermal_energy(rand(2000,50000)) + return TRUE else to_chat(user, SPAN_NOTICE("The emergency pressure relief valve has already been welded.")) + return TRUE + return ..() /obj/item/tank/attack_self(mob/user as mob) add_fingerprint(user) diff --git a/code/game/objects/items/weapons/tape.dm b/code/game/objects/items/weapons/tape.dm index 64ba59cab02c1..c93cb6a381524 100644 --- a/code/game/objects/items/weapons/tape.dm +++ b/code/game/objects/items/weapons/tape.dm @@ -71,7 +71,7 @@ else if (user.zone_sel.selecting == BP_CHEST) if (H.wear_suit && istype(H.wear_suit, /obj/item/clothing/suit/space)) - H.wear_suit.attackby(src, user)//everything is handled by attackby + H.wear_suit.use_tool(src, user) else to_chat(user, SPAN_WARNING("\The [H] isn't wearing a spacesuit for you to reseal.")) return TRUE @@ -106,7 +106,6 @@ /obj/item/ducttape/proc/attach(obj/item/W) stuck = W - anchored = TRUE W.forceMove(src) icon_state = W.icon_state + "_taped" name = W.name + " (taped)" @@ -141,6 +140,7 @@ playsound(src, 'sound/effects/tape.ogg',25) layer = ABOVE_WINDOW_LAYER + anchored = TRUE if(click_parameters) if(click_parameters["icon-x"]) diff --git a/code/game/objects/items/weapons/tools/weldingtool.dm b/code/game/objects/items/weapons/tools/weldingtool.dm index c669ae4125291..8694eeb031b37 100644 --- a/code/game/objects/items/weapons/tools/weldingtool.dm +++ b/code/game/objects/items/weapons/tools/weldingtool.dm @@ -47,10 +47,10 @@ else to_chat(user, (distance <= 1 ? "It has [get_fuel()] [welding_resource] remaining. " : "") + "[tank] is attached.") -/obj/item/weldingtool/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/weldingtool/use_tool(obj/item/W, mob/living/user, list/click_params) if(welding) - to_chat(user, SPAN_DANGER("Stop welding first!")) - return + to_chat(user, SPAN_WARNING("Stop welding first!")) + return TRUE if(isScrewdriver(W)) status = !status @@ -59,8 +59,7 @@ else to_chat(user, SPAN_NOTICE("The welder can now be attached and modified.")) playsound(src, 'sound/items/Screwdriver.ogg', 10, 1) - src.add_fingerprint(user) - return + return TRUE if((!status) && (istype(W,/obj/item/stack/material/rods))) var/obj/item/stack/material/rods/R = W @@ -69,27 +68,27 @@ user.drop_from_inventory(src, F) F.weldtool = src master = F - add_fingerprint(user) - return + return TRUE if (istype(W, /obj/item/welder_tank)) if (tank) to_chat(user, SPAN_WARNING("\The [src] already has a tank attached - remove it first.")) - return + return TRUE if (user.get_active_hand() != src && user.get_inactive_hand() != src) to_chat(user, SPAN_WARNING("You must hold the welder in your hands to attach a tank.")) - return + return TRUE if (!user.unEquip(W, src)) - return + FEEDBACK_UNEQUIP_FAILURE(user, W) + return TRUE tank = W - user.visible_message("[user] slots \a [W] into \the [src].", "You slot \a [W] into \the [src].") + user.visible_message("\The [user] slots \a [W] into \the [src].", "You slot \a [W] into \the [src].") w_class = tank.size_in_use force = tank.unlit_force playsound(src, 'sound/items/cap_close.ogg', 10, 1) update_icon() - return + return TRUE - ..() + return ..() /obj/item/weldingtool/attack_hand(mob/user as mob) @@ -175,7 +174,7 @@ if(M) M.welding_eyecheck()//located in mob_helpers.dm set_light(5, 0.7, COLOR_LIGHT_CYAN) - addtimer(new Callback(src, /atom/proc/update_icon), 5) + addtimer(new Callback(src, TYPE_PROC_REF(/atom, update_icon)), 5) return 1 /obj/item/weldingtool/proc/burn_fuel(amount) diff --git a/code/game/objects/items/weapons/trays.dm b/code/game/objects/items/weapons/trays.dm index cab6ee8520011..e13cd9a0cbebc 100644 --- a/code/game/objects/items/weapons/trays.dm +++ b/code/game/objects/items/weapons/trays.dm @@ -47,14 +47,14 @@ // Bash a rolling pin against a tray like a true knight! -/obj/item/tray/attackby(obj/item/W, mob/living/user) - if(istype(W, /obj/item/material/kitchen/rollingpin) && user.a_intent == I_HURT) +/obj/item/tray/use_tool(obj/item/W, mob/living/user, list/click_params) + if(istype(W, /obj/item/material/kitchen/rollingpin)) if(bash_cooldown < world.time) user.visible_message(SPAN_WARNING("[user] bashes [src] with [W]!")) playsound(user.loc, 'sound/effects/shieldbash.ogg', 50, 1) bash_cooldown = world.time + 25 return TRUE - else if (user.a_intent != I_HURT && !istype(W, /obj/item/projectile) && !istype(W, /obj/item/clothing)) + if (!istype(W, /obj/item/projectile) && !istype(W, /obj/item/clothing)) if (calc_carry() + storage_cost_for_item(W) > max_carry) to_chat(user, SPAN_WARNING("\The [src] can't fit \the [W]!")) else if (!can_add_item(W)) @@ -64,8 +64,8 @@ user.drop_item() pickup_item(W) return TRUE - else - . = ..() + + return ..() // Returns the space an object takes up on the tray. Non-food takes up double! diff --git a/code/game/objects/items/weapons/weldbackpack.dm b/code/game/objects/items/weapons/weldbackpack.dm index 1495e0fe25a20..37ebdca4fa58f 100644 --- a/code/game/objects/items/weapons/weldbackpack.dm +++ b/code/game/objects/items/weapons/weldbackpack.dm @@ -59,7 +59,7 @@ playsound(loc, 'sound/effects/refill.ogg', 50, 1, -6) return TRUE - else return ..() + return ..() /obj/item/storage/backpack/weldpack/use_after(obj/O, mob/living/user, click_parameters) if (istype(O, /obj/structure/reagent_dispensers/fueltank) && src.reagents.total_volume < max_fuel) diff --git a/code/game/objects/items/weapons/wrapping_paper.dm b/code/game/objects/items/weapons/wrapping_paper.dm index 683089463ea09..e682c4d5eb601 100644 --- a/code/game/objects/items/weapons/wrapping_paper.dm +++ b/code/game/objects/items/weapons/wrapping_paper.dm @@ -71,97 +71,105 @@ /obj/item/stack/package_wrap/use_after(obj/object, mob/user) - if (!isobj(object)) - return FALSE - if (istype(object, /obj/item/smallDelivery) || istype(object,/obj/structure/bigDelivery) || istype(object, /obj/item/evidencebag)) - to_chat(user, SPAN_WARNING("\The [object] is already wrapped.")) - return TRUE - if (object.anchored) - to_chat(user, SPAN_WARNING("\The [object] is bolted down and can't be wrapped.")) - return TRUE - if (user in object) - to_chat(user, SPAN_WARNING("You cannot wrap \the [object] while inside it.")) - return TRUE - var/amount = get_amount() - if (amount < 1) - to_chat(user, SPAN_WARNING("\The [src] is out of [plural_name].")) - return TRUE - if (istype(object, /obj/item)) - var/obj/item/target = object - var/a_used = target.get_storage_cost() - if (target.w_class == ITEM_SIZE_NO_CONTAINER || target.w_class == ITEM_SIZE_GARGANTUAN) - to_chat(user, SPAN_WARNING("\The [target] is too big to wrap!")) +/obj/item/stack/package_wrap/use_before(atom/target, mob/living/user) + if (isobj(target)) + var/obj/wrapped_object = target + if (istype(wrapped_object, /obj/item/stack/package_wrap) || istype(wrapped_object, /obj/item/storage/backpack) || istype(wrapped_object, /obj/item/storage/belt) || istype(wrapped_object,/obj/item/storage/bag) || istype(wrapped_object, /obj/item/storage/briefcase)|| istype(wrapped_object, /obj/structure/table)) + return FALSE + if (istype(wrapped_object, /obj/item/smallDelivery) || istype(wrapped_object, /obj/structure/bigDelivery) || istype(wrapped_object, /obj/item/evidencebag)) + to_chat(user, SPAN_WARNING("\The [wrapped_object] is already wrapped.")) return TRUE - if (user.isEquipped(target)) - to_chat(user, SPAN_WARNING("You must put down \the [target] in order to wrap it.")) + if (wrapped_object.anchored) + to_chat(user, SPAN_WARNING("\The [wrapped_object] is bolted down and can't be wrapped.")) return TRUE - if (amount < a_used) - USE_FEEDBACK_STACK_NOT_ENOUGH(src, a_used, "to wrap \the [target]!") + if (wrapped_object.anchored) + to_chat(user, SPAN_WARNING("\The [wrapped_object] is bolted down and can't be wrapped.")) return TRUE - user.visible_message( - SPAN_NOTICE("\The [user] starts wrapping \the [target] with \the [src]."), - SPAN_NOTICE("You start wrapping \the [target] with \the [src].") - ) - if (!do_after(user, target.w_class SECONDS, target, DO_PUBLIC_UNIQUE) || !user.use_sanity_check(target, src)) + if (user in wrapped_object) + to_chat(user, SPAN_WARNING("You cannot wrap \the [wrapped_object] while inside it.")) return TRUE - wrap_item(package_type, target, user) - return TRUE - - if (istype(object, /obj/structure/closet/crate) || istype(object, /obj/structure/closet)) - var/item_size - var/obj/structure/closet/target = object - if (istype(object, /obj/structure/closet/crate)) - item_size = BASE_STORAGE_COST(ITEM_SIZE_NORMAL) - else - item_size = BASE_STORAGE_COST(ITEM_SIZE_LARGE) - if (amount < item_size) - USE_FEEDBACK_STACK_NOT_ENOUGH(src, item_size, "to wrap \the [target]!") - return TRUE - user.visible_message( - SPAN_NOTICE("\The [user] starts wrapping \the [target] with \the [src]."), - SPAN_NOTICE("You start wrapping \the [target] with \the [src].") - ) - if (!do_after(user, item_size SECONDS, target, DO_PUBLIC_UNIQUE) || !user.use_sanity_check(target, src)) + var/amount = get_amount() + if (amount < 1) + to_chat(user, SPAN_WARNING("\The [src] is out of [plural_name].")) return TRUE - wrap_item(package_type, target, user) - return TRUE -/obj/item/stack/package_wrap/use_before(mob/living/target, mob/living/user) - if (!istype(target, /mob/living/carbon/human)) - return FALSE - var/mob/living/carbon/human/H = target - var/a_used = BASE_STORAGE_COST(ITEM_SIZE_LARGE) //get_storage_cost() does not work on mobs, will reproduce same logic here. + if (istype(target, /obj/item)) + var/obj/item/wrapped_item = target + var/a_used = wrapped_item.get_storage_cost() + if (wrapped_item.w_class == ITEM_SIZE_NO_CONTAINER || wrapped_item.w_class == ITEM_SIZE_GARGANTUAN) + to_chat(user, SPAN_WARNING("\The [wrapped_item] is too big to wrap!")) + return TRUE + if (istype(wrapped_item.loc, /obj/item/storage)) + to_chat(user, SPAN_WARNING("You must take \the [wrapped_item] out of \the [wrapped_item.loc] to wrap it.")) + return TRUE + if (user.isEquipped(wrapped_item)) + to_chat(user, SPAN_WARNING("You must put down \the [wrapped_item] in order to wrap it.")) + return TRUE + if (amount < a_used) + USE_FEEDBACK_STACK_NOT_ENOUGH(src, a_used, "to wrap \the [wrapped_item]!") + return TRUE + user.visible_message( + SPAN_NOTICE("\The [user] starts wrapping \the [wrapped_item] with \the [src]."), + SPAN_NOTICE("You start wrapping \the [wrapped_item] with \the [src].") + ) + if (!do_after(user, wrapped_item.w_class SECONDS, wrapped_item, DO_PUBLIC_UNIQUE) || !user.use_sanity_check(wrapped_item, src)) + return TRUE + wrap_item(package_type, wrapped_item, user) + return TRUE - if (get_amount() < a_used) - USE_FEEDBACK_STACK_NOT_ENOUGH(src, a_used, "to wrap \the [target]!") - return TRUE - if (!H.has_danger_grab(user)) - to_chat(user, SPAN_WARNING("You need to have a firm grip on \the [target] in order to wrap them.")) - return TRUE - H.visible_message( - SPAN_NOTICE("\The [H] starts wrapping \the [target] with \the [src]."), - SPAN_NOTICE("You start wrapping \the [target] with \the [src].") - ) - if (!do_after(user, ITEM_SIZE_LARGE SECONDS, target, DO_PUBLIC_UNIQUE) || !H.has_danger_grab(user) || !user.use_sanity_check(H, src)) - return TRUE + if (istype(target, /obj/structure/closet/crate) || istype(target, /obj/structure/closet)) + var/item_size + var/obj/structure/closet/wrapped_closet = target + if (istype(target, /obj/structure/closet/crate)) + item_size = BASE_STORAGE_COST(ITEM_SIZE_NORMAL) + else + item_size = BASE_STORAGE_COST(ITEM_SIZE_LARGE) + if (amount < item_size) + USE_FEEDBACK_STACK_NOT_ENOUGH(src, item_size, "to wrap \the [wrapped_closet]!") + return TRUE + user.visible_message( + SPAN_NOTICE("\The [user] starts wrapping \the [wrapped_closet] with \the [src]."), + SPAN_NOTICE("You start wrapping \the [wrapped_closet] with \the [src].") + ) + if (!do_after(user, item_size SECONDS, wrapped_closet, DO_PUBLIC_UNIQUE) || !user.use_sanity_check(wrapped_closet, src)) + return TRUE + wrap_item(package_type, wrapped_closet, user) + return TRUE - var/obj/structure/bigDelivery/mobpresent/present = new (H.loc, H, package_type) - use(a_used) + if (istype(target, /mob/living/carbon/human)) + var/mob/living/carbon/human/wrapped_human = target + var/a_used = BASE_STORAGE_COST(ITEM_SIZE_LARGE) //get_storage_cost() does not work on mobs, will reproduce same logic here. - if (user == target) - user.visible_message( - SPAN_DANGER("\The [user] wraps themselves with [get_vague_name(TRUE)]."), - SPAN_DANGER("You wrap yourself with [get_exact_name(a_used)].") - ) - else - user.visible_message( - SPAN_DANGER("\The [user] wraps \the [target] with [get_vague_name(TRUE)]."), - SPAN_DANGER("You wrap \the [target] with [get_exact_name(a_used)].") + if (get_amount() < a_used) + USE_FEEDBACK_STACK_NOT_ENOUGH(src, a_used, "to wrap \the [wrapped_human]!") + return TRUE + if (!wrapped_human.has_danger_grab(user)) + to_chat(user, SPAN_WARNING("You need to have a firm grip on \the [wrapped_human] in order to wrap them.")) + return TRUE + wrapped_human.visible_message( + SPAN_NOTICE("\The [user] starts wrapping \the [wrapped_human] with \the [src]."), + SPAN_NOTICE("You start wrapping \the [wrapped_human] with \the [src].") ) + if (!do_after(user, ITEM_SIZE_LARGE SECONDS, wrapped_human, DO_PUBLIC_UNIQUE) || !wrapped_human.has_danger_grab(user) || !user.use_sanity_check(wrapped_human, src)) + return TRUE - playsound(user.loc, 'sound/effects/wrap.ogg', 65, 1) - present.add_fingerprint(user) - H.remove_grabs_and_pulls() - admin_attack_log(user, H, "Used \a [src] to wrap their victim", "Was wrapepd with \a [src]", "used \the [src] to wrap") - return TRUE + var/obj/structure/bigDelivery/mobpresent/present = new (wrapped_human.loc, wrapped_human, package_type) + use(a_used) + + if (user == wrapped_human) + user.visible_message( + SPAN_DANGER("\The [user] wraps themselves with [get_vague_name(TRUE)]."), + SPAN_DANGER("You wrap yourself with [get_exact_name(a_used)].") + ) + else + user.visible_message( + SPAN_DANGER("\The [user] wraps \the [wrapped_human] with [get_vague_name(TRUE)]."), + SPAN_DANGER("You wrap \the [wrapped_human] with [get_exact_name(a_used)].") + ) + + playsound(user.loc, 'sound/effects/wrap.ogg', 65, 1) + present.add_fingerprint(user) + wrapped_human.remove_grabs_and_pulls() + admin_attack_log(user, wrapped_human, "Used \a [src] to wrap their victim", "Was wrapepd with \a [src]", "used \the [src] to wrap") + return TRUE diff --git a/code/game/objects/random/date_based.dm b/code/game/objects/random/date_based.dm index 9b16181cd2761..6e8574f8e85cc 100644 --- a/code/game/objects/random/date_based.dm +++ b/code/game/objects/random/date_based.dm @@ -5,7 +5,7 @@ /obj/random/date_based name = "random object (date based)" icon_state = "yup" - spawn_method = .proc/check_date + spawn_method = PROC_REF(check_date) var/datum/is_date/date_check /obj/random/date_based/Destroy() diff --git a/code/game/objects/random/random.dm b/code/game/objects/random/random.dm index bc973d916c870..0324bdb5c1920 100644 --- a/code/game/objects/random/random.dm +++ b/code/game/objects/random/random.dm @@ -264,7 +264,7 @@ /obj/random/drinkbottle name = "random drink" desc = "This is a random drink." - icon = 'icons/obj/food/drinks.dmi' + icon = 'icons/obj/food/drinks/bottles.dmi' icon_state = "whiskeybottle" /obj/random/drinkbottle/spawn_choices() @@ -445,19 +445,22 @@ icon_state = "greenglow" /obj/random/trash/spawn_choices() - return list(/obj/item/remains/lizard, - /obj/decal/cleanable/blood/gibs/robot, - /obj/decal/cleanable/blood/oil, - /obj/decal/cleanable/blood/oil/streak, - /obj/decal/cleanable/spiderling_remains, - /obj/item/remains/mouse, - /obj/decal/cleanable/vomit, - /obj/decal/cleanable/blood/splatter, - /obj/decal/cleanable/ash, - /obj/decal/cleanable/generic, - /obj/decal/cleanable/flour, - /obj/decal/cleanable/dirt, - /obj/item/remains/robot) + return list( + /obj/item/remains/lizard, + /obj/decal/cleanable/blood/gibs/robot, + /obj/decal/cleanable/blood/oil, + /obj/decal/cleanable/blood/oil/streak, + /obj/decal/cleanable/spiderling_remains, + /obj/item/remains/mouse, + /obj/decal/cleanable/vomit, + /obj/decal/cleanable/blood/splatter, + /obj/decal/cleanable/ash, + /obj/decal/cleanable/generic, + /obj/decal/cleanable/flour, + /obj/decal/cleanable/dirt, + /obj/item/remains/robot, + /obj/item/material/shard/caltrop/tack + ) /obj/random/closet //A couple of random closets to spice up maint @@ -842,7 +845,12 @@ /obj/item/clothing/glasses/hud/security/prot = 2, /obj/item/clothing/glasses/hud/security/prot/sunglasses = 3, /obj/item/clothing/glasses/hud/security/prot/aviators = 1, - /obj/item/clothing/glasses/tacgoggles = 1) + /obj/item/clothing/glasses/tacgoggles = 1, + /obj/item/clothing/glasses/ballistic/security = 1, + /obj/item/clothing/glasses/ballistic = 2, + /obj/item/clothing/glasses/ballistic/prescription = 1, + /obj/item/clothing/glasses/ballistic/fake = 3 + ) /obj/random/hat name = "random headgear" @@ -851,16 +859,19 @@ icon_state = "tophat" /obj/random/hat/spawn_choices() - return list(/obj/item/clothing/head/helmet = 2, - /obj/item/clothing/head/helmet/tactical = 1, - /obj/item/clothing/head/helmet/space/emergency = 1, - /obj/item/clothing/head/bio_hood/general = 1, - /obj/item/clothing/head/hardhat = 4, - /obj/item/clothing/head/hardhat/orange = 4, - /obj/item/clothing/head/hardhat/red = 4, - /obj/item/clothing/head/hardhat/blue = 4, - /obj/item/clothing/head/ushanka = 3, - /obj/item/clothing/head/welding = 2) + return list(/obj/item/clothing/head/helmet = 4, + /obj/item/clothing/head/helmet/tactical = 2, + /obj/item/clothing/head/helmet/old_commonwealth = 1, + /obj/item/clothing/head/helmet/old_confederation = 1, + /obj/item/clothing/head/helmet/space/emergency = 2, + /obj/item/clothing/head/bio_hood/general = 2, + /obj/item/clothing/head/hardhat = 8, + /obj/item/clothing/head/hardhat/orange = 8, + /obj/item/clothing/head/hardhat/red = 8, + /obj/item/clothing/head/hardhat/blue = 8, + /obj/item/clothing/head/ushanka = 8, + /obj/item/clothing/head/welding = 8 + ) /obj/random/suit name = "random suit" @@ -923,7 +934,9 @@ /obj/item/clothing/accessory/storage/holster/waist = 1, /obj/item/clothing/accessory/storage/holster/armpit = 1, /obj/item/clothing/accessory/kneepads = 3, - /obj/item/clothing/accessory/stethoscope = 2) + /obj/item/clothing/accessory/stethoscope = 2, + /obj/item/clothing/accessory/glassesmod/nvg = 1 + ) GLOBAL_LIST_INIT(random_backpacks, list( /obj/item/storage/backpack/cultpack, @@ -1285,7 +1298,7 @@ var/global/list/multi_point_spawns /obj/random/mre name = "random MRE" desc = "This is a random single MRE." - icon = 'icons/obj/food/food.dmi' + icon = 'icons/obj/food/mre.dmi' icon_state = "mre" /obj/random/mre/spawn_choices() @@ -1344,6 +1357,7 @@ var/global/list/multi_point_spawns /obj/random/mre/drink name = "random MRE drink" desc = "This is a random drink for MREs." + icon = 'icons/obj/food/condiment.dmi' icon_state = "packet_small" /obj/random/mre/drink/spawn_choices() @@ -1358,22 +1372,28 @@ var/global/list/multi_point_spawns /obj/random/mre/spread name = "random MRE spread" desc = "This is a random spread packet for MREs." + icon = 'icons/obj/food/condiment.dmi' icon_state = "packet_small" /obj/random/mre/spread/spawn_choices() return list(/obj/item/reagent_containers/food/condiment/small/packet/jelly, - /obj/item/reagent_containers/food/condiment/small/packet/honey) + /obj/item/reagent_containers/food/condiment/small/packet/honey, + /obj/item/reagent_containers/food/condiment/small/packet/peanutbutter, + /obj/item/reagent_containers/food/condiment/small/packet/choconutspread) /obj/random/mre/spread/vegan name = "random vegan MRE spread" desc = "This is a random vegan spread packet for MREs." /obj/random/mre/spread/vegan/spawn_choices() - return list(/obj/item/reagent_containers/food/condiment/small/packet/jelly) + return list(/obj/item/reagent_containers/food/condiment/small/packet/jelly, + /obj/item/reagent_containers/food/condiment/small/packet/peanutbutter, + /obj/item/reagent_containers/food/condiment/small/packet/choconutspread) /obj/random/mre/sauce name = "random MRE sauce" desc = "This is a random sauce packet for MREs." + icon = 'icons/obj/food/condiment.dmi' icon_state = "packet_small" /obj/random/mre/sauce/spawn_choices() @@ -1437,7 +1457,7 @@ var/global/list/multi_point_spawns /obj/random/single/cola name = "randomly spawned cola" - icon = 'icons/obj/food/drinks.dmi' + icon = 'icons/obj/food/drinks/cans.dmi' icon_state = "cola" spawn_object = /obj/item/reagent_containers/food/drinks/cans/cola diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm index 0873dd7182ccb..94d7808b59d41 100644 --- a/code/game/objects/structures.dm +++ b/code/game/objects/structures.dm @@ -100,7 +100,10 @@ if (occupied) USE_FEEDBACK_GRAB_FAILURE("There's \a [occupied] blocking \the [src].") return TRUE - if (!do_after(grab.assailant, 3 SECONDS, grab.affecting, DO_PUBLIC_UNIQUE) || !grab.use_sanity_check(src)) + // sierra edit + // original: if (!do_after(grab.assailant, 3 SECONDS, grab.affecting, DO_PUBLIC_UNIQUE) || !grab.use_sanity_check(src)) + if (!do_after(grab.assailant, grab.affecting, DO_PUBLIC_UNIQUE) || !grab.use_sanity_check(src)) + // Edit end return TRUE occupied = turf_is_crowded() if (occupied) diff --git a/code/game/objects/structures/barsign.dm b/code/game/objects/structures/barsign.dm index 6b9eee32e876f..a76b21f9e29cc 100644 --- a/code/game/objects/structures/barsign.dm +++ b/code/game/objects/structures/barsign.dm @@ -1,18 +1,9 @@ /obj/structure/sign/double/barsign desc = "A jumbo-sized LED sign. This one seems to be showing its age." icon = 'icons/obj/structures/barsigns.dmi' - icon_state = "on" + icon_state = "Closed" appearance_flags = DEFAULT_APPEARANCE_FLAGS anchored = TRUE - var/cult = 0 - -/obj/structure/sign/double/barsign/proc/get_valid_states(initial=1) - . = icon_states(icon) - . -= "on" - . -= "narsiebistro" - . -= "empty" - if(initial) - . -= "Off" /obj/structure/sign/double/barsign/examine(mob/user) . = ..() @@ -56,23 +47,15 @@ else to_chat(user, "It says '[icon_state]'") -/obj/structure/sign/double/barsign/New() - ..() - icon_state = pick(get_valid_states()) - /obj/structure/sign/double/barsign/use_tool(obj/item/tool, mob/user, list/click_params) - // ID Card - Change barsign var/obj/item/card/id/id = tool.GetIdCard() if (istype(id)) var/id_name = GET_ID_NAME(id, tool) if (!check_access(id)) USE_FEEDBACK_ID_CARD_DENIED(src, id_name) return TRUE - if (cult) - USE_FEEDBACK_FAILURE("\The [src]'s display can't be changed.") - return TRUE - var/input = input(user, "What would you like to change the barsign to?") as null|anything in get_valid_states(FALSE) + var/input = input(user, "What would you like to change the barsign to?") as null|anything in get_valid_states() if (!input || input == icon_state || !user.use_sanity_check(src, tool)) return TRUE icon_state = input @@ -81,5 +64,12 @@ SPAN_NOTICE("You update \the [src]'s display with [id_name].") ) return TRUE - return ..() + + +/obj/structure/sign/double/barsign/proc/get_valid_states() + return icon_states(icon) - list( + "empty", + "narsiebistro", + "on" + ) diff --git a/code/game/objects/structures/drain.dm b/code/game/objects/structures/drain.dm index a994317b3c6ea..feb91656ef254 100644 --- a/code/game/objects/structures/drain.dm +++ b/code/game/objects/structures/drain.dm @@ -62,7 +62,7 @@ icon_state = "drain" var/constructed_type = /obj/structure/hygiene/drain -/obj/item/drain/attackby(obj/item/thing, mob/user) +/obj/item/drain/use_tool(obj/item/thing, mob/living/user, list/click_params) if(isWrench(thing)) if (!isturf(loc)) USE_FEEDBACK_FAILURE("\The [src] needs to be placed on the floor before you can secure it.") @@ -71,7 +71,7 @@ playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) to_chat(user, SPAN_WARNING("[user] wrenches the [src] down.")) qdel(src) - return + return TRUE return ..() /obj/structure/hygiene/drain/bath diff --git a/code/game/objects/structures/girders.dm b/code/game/objects/structures/girders.dm index 1c480130566fc..7e8c03138a07f 100644 --- a/code/game/objects/structures/girders.dm +++ b/code/game/objects/structures/girders.dm @@ -255,7 +255,7 @@ to_chat(user, SPAN_NOTICE("You begin adding the plating...")) if(!do_after(user,4 SECONDS, src, DO_REPAIR_CONSTRUCT) || !S.use(2)) - return 1 //once we've gotten this far don't call parent attackby() + return TRUE if(anchored) to_chat(user, SPAN_NOTICE("You added the plating!")) @@ -289,7 +289,7 @@ to_chat(user, SPAN_NOTICE("Now reinforcing...")) if (!do_after(user, 4 SECONDS, src, DO_REPAIR_CONSTRUCT) || !S.use(2)) - return 1 //don't call parent attackby() past this point + return TRUE to_chat(user, SPAN_NOTICE("You added reinforcement!")) reinf_material = M diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm index 5870ef43798ea..2fdd94bd6c412 100644 --- a/code/game/objects/structures/morgue.dm +++ b/code/game/objects/structures/morgue.dm @@ -90,7 +90,7 @@ /obj/structure/morgue/attack_robot(mob/user) if(Adjacent(user)) return attack_hand(user) - else return ..() + return ..() /obj/structure/morgue/use_tool(obj/item/tool, mob/user, list/click_params) diff --git a/code/game/objects/structures/railing.dm b/code/game/objects/structures/railing.dm index 7d7f5dedb05a7..d9a2528cc320b 100644 --- a/code/game/objects/structures/railing.dm +++ b/code/game/objects/structures/railing.dm @@ -342,7 +342,7 @@ kill_health() // Fatboy user.jump_layer_shift() - addtimer(new Callback(user, /mob/living/proc/jump_layer_shift_end), 2) + addtimer(new Callback(user, TYPE_PROC_REF(/mob/living, jump_layer_shift_end)), 2) /obj/structure/railing/slam_into(mob/living/L) diff --git a/code/game/objects/structures/signs.dm b/code/game/objects/structures/signs.dm index bcea086407f23..a625d50cea70d 100644 --- a/code/game/objects/structures/signs.dm +++ b/code/game/objects/structures/signs.dm @@ -55,10 +55,10 @@ w_class = ITEM_SIZE_NORMAL //big var/sign_state = "" -/obj/item/sign/attackby(obj/item/tool as obj, mob/user as mob) //construction +/obj/item/sign/use_tool(obj/item/tool, mob/living/user, list/click_params) if (isScrewdriver(tool) && isturf(user.loc)) var/direction = input("In which direction?", "Select direction.") in list("North", "East", "South", "West", "Cancel") - if(direction == "Cancel") return + if(direction == "Cancel") return TRUE var/obj/structure/sign/S = new(user.loc) switch(direction) if("North") @@ -69,13 +69,14 @@ S.pixel_y = -32 if("West") S.pixel_x = -32 - else return + else return TRUE S.SetName(name) S.desc = desc S.icon_state = sign_state to_chat(user, "You fasten \the [S] with your [tool].") qdel(src) - else ..() + return TRUE + return ..() /obj/structure/sign/double/map name = "map" diff --git a/code/game/objects/structures/stool_bed_chair_nest/stools.dm b/code/game/objects/structures/stool_bed_chair_nest/stools.dm index e21c6a04a46a9..f6af733f84e23 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/stools.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/stools.dm @@ -117,19 +117,21 @@ var/global/list/stool_cache = list() //haha stool padding_material.place_sheet(get_turf(src)) qdel(src) -/obj/item/stool/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/stool/use_tool(obj/item/W, mob/living/user, list/click_params) if(isWrench(W)) playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) dismantle() qdel(src) - else if(istype(W,/obj/item/stack)) + return TRUE + + if (istype(W,/obj/item/stack)) if(padding_material) - to_chat(user, "\The [src] is already padded.") - return + to_chat(user, SPAN_WARNING("\The [src] is already padded.")) + return TRUE var/obj/item/stack/C = W if(C.get_amount() < 1) // How?? qdel(C) - return + return TRUE var/padding_type //This is awful but it needs to be like this until tiles are given a material var. if(istype(W,/obj/item/stack/tile/carpet)) padding_type = MATERIAL_CARPET @@ -138,24 +140,25 @@ var/global/list/stool_cache = list() //haha stool if(M.material && (M.material.flags & MATERIAL_PADDING)) padding_type = "[M.material.name]" if(!padding_type) - to_chat(user, "You cannot pad \the [src] with that.") - return + to_chat(user, SPAN_WARNING("You cannot pad \the [src] with that.")) + return TRUE C.use(1) if(!istype(src.loc, /turf)) user.drop_from_inventory(src) src.dropInto(loc) to_chat(user, "You add padding to \the [src].") add_padding(padding_type) - return - else if (is_sharp(W)) + return TRUE + + if (is_sharp(W)) if(!padding_material) - to_chat(user, "\The [src] has no padding to remove.") - return + to_chat(user, SPAN_WARNING("\The [src] has no padding to remove.")) + return TRUE to_chat(user, "You remove the padding from \the [src].") playsound(src, 'sound/items/Wirecutter.ogg', 100, 1) remove_padding() - else - ..() + return TRUE + return ..() //Generated subtypes for mapping porpoises diff --git a/code/game/objects/structures/under_wardrobe.dm b/code/game/objects/structures/under_wardrobe.dm index 8cd4c0ce3b5d0..28d9c8c4a73a3 100644 --- a/code/game/objects/structures/under_wardrobe.dm +++ b/code/game/objects/structures/under_wardrobe.dm @@ -33,7 +33,7 @@ var/number_of_underwear = LAZYACCESS(amount_of_underwear_by_id_card, id) - 1 if (number_of_underwear) LAZYSET(amount_of_underwear_by_id_card, id, number_of_underwear) - GLOB.destroyed_event.register(id, src, /obj/structure/undies_wardrobe/proc/remove_id_card) + GLOB.destroyed_event.register(id, src, TYPE_PROC_REF(/obj/structure/undies_wardrobe, remove_id_card)) else remove_id_card(id) return TRUE @@ -43,7 +43,7 @@ /obj/structure/undies_wardrobe/proc/remove_id_card(id_card) LAZYREMOVE(amount_of_underwear_by_id_card, id_card) - GLOB.destroyed_event.unregister(id_card, src, /obj/structure/undies_wardrobe/proc/remove_id_card) + GLOB.destroyed_event.unregister(id_card, src, TYPE_PROC_REF(/obj/structure/undies_wardrobe, remove_id_card)) /obj/structure/undies_wardrobe/attack_hand(mob/user) if(!human_who_can_use_underwear(user)) diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index 2ba53785c486c..0f41c37960e36 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -721,7 +721,7 @@ obj_flags = OBJ_FLAG_ROTATABLE var/constructed_type = /obj/structure/hygiene/faucet -/obj/item/faucet/attackby(obj/item/thing, mob/user) +/obj/item/faucet/use_tool(obj/item/thing, mob/living/user, list/click_params) if(isWrench(thing)) var/turf/simulated/floor/F = loc if (istype(F) && istype(F.flooring, /singleton/flooring/pool)) diff --git a/code/game/turfs/flooring/flooring_premade.dm b/code/game/turfs/flooring/flooring_premade.dm index 1a93980f24e01..f74f69f1dd623 100644 --- a/code/game/turfs/flooring/flooring_premade.dm +++ b/code/game/turfs/flooring/flooring_premade.dm @@ -415,4 +415,4 @@ SPAN_WARNING("\The [L] starts flickering in and out of existence as they step onto the bluespace!"), SPAN_WARNING("You feel your entire body tingle, and something pulling you away!") ) - addtimer(new Callback(GLOBAL_PROC, /proc/do_unstable_teleport_safe, L, GetConnectedZlevels(L.z)), rand(5, 15)) + addtimer(new Callback(GLOBAL_PROC, GLOBAL_PROC_REF(do_unstable_teleport_safe), L, GetConnectedZlevels(L.z)), rand(5, 15)) diff --git a/code/game/turfs/simulated.dm b/code/game/turfs/simulated.dm index c20ad8c9c9966..dd48510132432 100644 --- a/code/game/turfs/simulated.dm +++ b/code/game/turfs/simulated.dm @@ -25,12 +25,12 @@ wet_overlay = image('icons/effects/water.dmi',src,"wet_floor") AddOverlays(wet_overlay) - timer_id = addtimer(new Callback(src,/turf/simulated/proc/unwet_floor),8 SECONDS, TIMER_STOPPABLE|TIMER_UNIQUE|TIMER_NO_HASH_WAIT|TIMER_OVERRIDE) + timer_id = addtimer(new Callback(src, TYPE_PROC_REF(/turf/simulated, unwet_floor)),8 SECONDS, TIMER_STOPPABLE|TIMER_UNIQUE|TIMER_NO_HASH_WAIT|TIMER_OVERRIDE) /turf/simulated/proc/unwet_floor(check_very_wet = TRUE) if(check_very_wet && wet >= 2) wet-- - timer_id = addtimer(new Callback(src,/turf/simulated/proc/unwet_floor), 8 SECONDS, TIMER_STOPPABLE|TIMER_UNIQUE|TIMER_NO_HASH_WAIT|TIMER_OVERRIDE) + timer_id = addtimer(new Callback(src, TYPE_PROC_REF(/turf/simulated, unwet_floor)), 8 SECONDS, TIMER_STOPPABLE|TIMER_UNIQUE|TIMER_NO_HASH_WAIT|TIMER_OVERRIDE) return wet = 0 @@ -124,12 +124,12 @@ slip_stun = 10 if(M.slip("the [floor_type] floor", slip_stun)) - addtimer(new Callback(M, /mob/proc/slip_handler, M.dir, slip_dist - 1, 1), 1) + addtimer(new Callback(M, TYPE_PROC_REF(/mob, slip_handler), M.dir, slip_dist - 1, 1), 1) /mob/proc/slip_handler(dir, dist, delay) if (dist > 0) - addtimer(new Callback(src, .proc/slip_handler, dir, dist - 1, delay), delay) + addtimer(new Callback(src, PROC_REF(slip_handler), dir, dist - 1, delay), delay) step(src, dir) //returns 1 if made bloody, returns 0 otherwise diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm index 4cdfcfb51c7c1..6838e52753d2e 100644 --- a/code/game/turfs/simulated/walls.dm +++ b/code/game/turfs/simulated/walls.dm @@ -41,7 +41,7 @@ hitsound = material.hitsound /turf/simulated/wall/Initialize() - set_extension(src, /datum/extension/penetration/proc_call, .proc/CheckPenetration) + set_extension(src, /datum/extension/penetration/proc_call, PROC_REF(CheckPenetration)) START_PROCESSING(SSturf, src) //Used for radiation. . = ..() @@ -260,7 +260,7 @@ /turf/simulated/wall/proc/burn(temperature) if(material.combustion_effect(src, temperature, 0.7)) - addtimer(new Callback(src, .proc/burn_adjacent, temperature), 2, TIMER_UNIQUE) + addtimer(new Callback(src, PROC_REF(burn_adjacent), temperature), 2, TIMER_UNIQUE) /turf/simulated/wall/proc/burn_adjacent(temperature) var/list/nearby_atoms = range(3,src) diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 59d977372c1d7..67f41def6db8f 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -304,7 +304,7 @@ var/global/const/enterloopsanity = 100 if(M.pinned) return - addtimer(new Callback(src, /turf/proc/bounce_off, AM, TT.init_dir), 2) + addtimer(new Callback(src, TYPE_PROC_REF(/turf, bounce_off), AM, TT.init_dir), 2) ..() diff --git a/code/game/world.dm b/code/game/world.dm index 2bf66098b3f7b..4a3fc39135e16 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -76,7 +76,7 @@ GLOBAL_VAR(href_logfile) /world/New() var/debug_server = world.GetConfig("env", "AUXTOOLS_DEBUG_DLL") if (debug_server) - call_ext(debug_server, "auxtools_init")() + CALL_EXT(debug_server, "auxtools_init")() enable_debugging() SetupLogs() @@ -118,7 +118,7 @@ GLOBAL_VAR(href_logfile) /world/Del() var/debug_server = world.GetConfig("env", "AUXTOOLS_DEBUG_DLL") if (debug_server) - call_ext(debug_server, "auxtools_shutdown")() + CALL_EXT(debug_server, "auxtools_shutdown")() callHook("shutdown") return ..() diff --git a/code/modules/ZAS/Zone.dm b/code/modules/ZAS/Zone.dm index 590ed4d02d9ad..bce130e273e0e 100644 --- a/code/modules/ZAS/Zone.dm +++ b/code/modules/ZAS/Zone.dm @@ -104,6 +104,7 @@ Class Procs: #ifdef ZASDBG T.dbg(merged) #endif + CHECK_TICK //rebuild the old zone's edges so that they will be possessed by the new zone for(var/connection_edge/E in edges) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 6f1cc863673bc..395d07e2345e8 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -678,10 +678,10 @@ var/global/list/admin_verbs_mod = list( switch(alert("Do you wish for [H] to be allowed to select non-whitelisted races?","Alter Mob Appearance","Yes","No","Cancel")) if("Yes") - log_and_message_admins("has allowed [H] to change \his appearance, ignoring allow lists.") + log_and_message_admins("has allowed [H] to change their appearance, ignoring allow lists.") H.change_appearance(APPEARANCE_COMMON | APPEARANCE_SKIP_ALLOW_LIST_CHECK) if("No") - log_and_message_admins("has allowed [H] to change \his appearance, respecting allow lists.") + log_and_message_admins("has allowed [H] to change their appearance, respecting allow lists.") H.change_appearance(APPEARANCE_COMMON) /client/proc/change_security_level() diff --git a/code/modules/admin/buildmode/_click_handler.dm b/code/modules/admin/buildmode/_click_handler.dm index 2acf2372830ca..ebf07d8815939 100644 --- a/code/modules/admin/buildmode/_click_handler.dm +++ b/code/modules/admin/buildmode/_click_handler.dm @@ -36,7 +36,7 @@ . = ..() /datum/click_handler/build_mode/proc/StartTimer() - timer_handle = addtimer(new Callback(src, .proc/TimerEvent), 1 SECOND, TIMER_UNIQUE | TIMER_STOPPABLE | TIMER_LOOP) + timer_handle = addtimer(new Callback(src, PROC_REF(TimerEvent)), 1 SECOND, TIMER_UNIQUE | TIMER_STOPPABLE | TIMER_LOOP) /datum/click_handler/build_mode/proc/StopTimer() deltimer(timer_handle) diff --git a/code/modules/admin/buildmode/_datums/mob_spawner.dm b/code/modules/admin/buildmode/_datums/mob_spawner.dm index 6c12f5e771493..aaf29ec57a58f 100644 --- a/code/modules/admin/buildmode/_datums/mob_spawner.dm +++ b/code/modules/admin/buildmode/_datums/mob_spawner.dm @@ -60,7 +60,7 @@ var/mob/living/simple_animal/M for (var/i = 1; i <= 10; i++) if (radius == -1) - T = pick_area_turf(area, list(/proc/not_turf_contains_dense_objects)) + T = pick_area_turf(area, list(GLOBAL_PROC_REF(not_turf_contains_dense_objects))) if (!T) //no open spaces to spawn on T = pick_area_turf(area) diff --git a/code/modules/admin/buildmode/_overlay.dm b/code/modules/admin/buildmode/_overlay.dm index 6b2684bc15f53..1aa261d89f333 100644 --- a/code/modules/admin/buildmode/_overlay.dm +++ b/code/modules/admin/buildmode/_overlay.dm @@ -51,6 +51,6 @@ var/turf/T = locate(user.x + x, user.y + y, user.z) if (T) M.alpha = 255 - invoke_async(buildmode, /datum/build_mode/.proc/UpdateOverlay, M, T) + invoke_async(buildmode, TYPE_PROC_REF(/datum/build_mode, UpdateOverlay), M, T) else M.alpha = 0 diff --git a/code/modules/admin/buildmode/ai.dm b/code/modules/admin/buildmode/ai.dm index 51e8c8715bf2a..36c352b783acf 100644 --- a/code/modules/admin/buildmode/ai.dm +++ b/code/modules/admin/buildmode/ai.dm @@ -124,7 +124,7 @@ to_chat(user, SPAN_WARNING("No AI type selected.")) return if (!isnull(L.ai_holder)) - GLOB.stat_set_event.unregister(L, L.ai_holder, /datum/ai_holder/proc/holder_stat_change) + GLOB.stat_set_event.unregister(L, L.ai_holder, TYPE_PROC_REF(/datum/ai_holder, holder_stat_change)) qdel(L.ai_holder) L.ai_holder = new ai_type (L) to_chat(user, SPAN_NOTICE("\The [L]'s AI type has been changed to [ai_type]")) @@ -212,7 +212,7 @@ /datum/build_mode/ai/proc/select_AI_mob(mob/living/unit) selected_mobs += unit user.client.images += unit.selected_image - GLOB.destroyed_event.register(unit, src, .proc/deselect_AI_mob) + GLOB.destroyed_event.register(unit, src, PROC_REF(deselect_AI_mob)) /datum/build_mode/ai/proc/deselect_AI_mob(mob/living/unit) selected_mobs -= unit diff --git a/code/modules/admin/buildmode/areas.dm b/code/modules/admin/buildmode/areas.dm index 29a4cb5a02262..de482a2d48992 100644 --- a/code/modules/admin/buildmode/areas.dm +++ b/code/modules/admin/buildmode/areas.dm @@ -108,12 +108,12 @@ Shift + Right Click - Select point B return UnselectArea() selected_area = A - GLOB.destroyed_event.register(selected_area, src, .proc/UnselectArea) + GLOB.destroyed_event.register(selected_area, src, PROC_REF(UnselectArea)) /datum/build_mode/areas/proc/UnselectArea() if(!selected_area) return - GLOB.destroyed_event.unregister(selected_area, src, .proc/UnselectArea) + GLOB.destroyed_event.unregister(selected_area, src, PROC_REF(UnselectArea)) var/has_turf = FALSE for(var/turf/T in selected_area) diff --git a/code/modules/admin/buildmode/edit.dm b/code/modules/admin/buildmode/edit.dm index d92e9f8cde839..03e8f9acf1022 100644 --- a/code/modules/admin/buildmode/edit.dm +++ b/code/modules/admin/buildmode/edit.dm @@ -66,13 +66,13 @@ return ClearValue() value_to_set = new_value - GLOB.destroyed_event.register(value_to_set, src, /datum/build_mode/edit/proc/ClearValue) + GLOB.destroyed_event.register(value_to_set, src, TYPE_PROC_REF(/datum/build_mode/edit, ClearValue)) /datum/build_mode/edit/proc/ClearValue(feedback) if (!istype(value_to_set, /datum)) return - GLOB.destroyed_event.unregister(value_to_set, src, /datum/build_mode/edit/proc/ClearValue) + GLOB.destroyed_event.unregister(value_to_set, src, TYPE_PROC_REF(/datum/build_mode/edit, ClearValue)) value_to_set = initial(value_to_set) if (feedback) Warn("The selected reference value was deleted. Default value restored.") diff --git a/code/modules/admin/buildmode/move_into.dm b/code/modules/admin/buildmode/move_into.dm index 54595dc0e7898..57d86b7375eee 100644 --- a/code/modules/admin/buildmode/move_into.dm +++ b/code/modules/admin/buildmode/move_into.dm @@ -33,14 +33,14 @@ ClearDestination() destination = A - GLOB.destroyed_event.register(destination, src, /datum/build_mode/move_into/proc/ClearDestination) + GLOB.destroyed_event.register(destination, src, TYPE_PROC_REF(/datum/build_mode/move_into, ClearDestination)) to_chat(user, SPAN_NOTICE("Will now move targets into \the [destination].")) /datum/build_mode/move_into/proc/ClearDestination(feedback) if(!destination) return - GLOB.destroyed_event.unregister(destination, src, /datum/build_mode/move_into/proc/ClearDestination) + GLOB.destroyed_event.unregister(destination, src, TYPE_PROC_REF(/datum/build_mode/move_into, ClearDestination)) destination = null if(feedback) Warn("The selected destination was deleted.") diff --git a/code/modules/admin/buildmode/relocate_to.dm b/code/modules/admin/buildmode/relocate_to.dm index 1a3baa03513bf..77e77f30ebac6 100644 --- a/code/modules/admin/buildmode/relocate_to.dm +++ b/code/modules/admin/buildmode/relocate_to.dm @@ -34,14 +34,14 @@ ClearRelocator() to_relocate = new_relocator - GLOB.destroyed_event.register(to_relocate, src, /datum/build_mode/relocate_to/proc/ClearRelocator) + GLOB.destroyed_event.register(to_relocate, src, TYPE_PROC_REF(/datum/build_mode/relocate_to, ClearRelocator)) to_chat(user, SPAN_NOTICE("Will now be relocating \the [to_relocate].")) /datum/build_mode/relocate_to/proc/ClearRelocator(feedback) if(!to_relocate) return - GLOB.destroyed_event.unregister(to_relocate, src, /datum/build_mode/relocate_to/proc/ClearRelocator) + GLOB.destroyed_event.unregister(to_relocate, src, TYPE_PROC_REF(/datum/build_mode/relocate_to, ClearRelocator)) to_relocate = null if(feedback) Warn("The selected relocation object was deleted.") diff --git a/code/modules/admin/buildmode/throw_at.dm b/code/modules/admin/buildmode/throw_at.dm index 661f7adef4abd..095962a831237 100644 --- a/code/modules/admin/buildmode/throw_at.dm +++ b/code/modules/admin/buildmode/throw_at.dm @@ -33,14 +33,14 @@ ClearThrowable() to_throw = new_throwable - GLOB.destroyed_event.register(to_throw, src, /datum/build_mode/throw_at/proc/ClearThrowable) + GLOB.destroyed_event.register(to_throw, src, TYPE_PROC_REF(/datum/build_mode/throw_at, ClearThrowable)) to_chat(user, SPAN_NOTICE("Will now be throwing \the [to_throw].")) /datum/build_mode/throw_at/proc/ClearThrowable(feedback) if(!to_throw) return - GLOB.destroyed_event.unregister(to_throw, src, /datum/build_mode/throw_at/proc/ClearThrowable) + GLOB.destroyed_event.unregister(to_throw, src, TYPE_PROC_REF(/datum/build_mode/throw_at, ClearThrowable)) to_throw = null if(feedback) Warn("The selected throwing object was deleted.") diff --git a/code/modules/admin/map_capture.dm b/code/modules/admin/map_capture.dm index 83d1ff720ecc9..9bb9bdecec9ad 100644 --- a/code/modules/admin/map_capture.dm +++ b/code/modules/admin/map_capture.dm @@ -35,7 +35,7 @@ to_chat(usr, "Saved capture in cache as [file_name].") send_rsc(usr, cap, file_name) currentx = currentx + 32 - addtimer(new Callback(src, .proc/capture_map_capture_next, currentz, currentx, currenty, ligths), 0) + addtimer(new Callback(src, PROC_REF(capture_map_capture_next), currentz, currentx, currenty, ligths), 0) else currenty = currenty + 32 currentx = 1 @@ -45,7 +45,7 @@ to_chat(usr, "Saved capture in cache as [file_name].") send_rsc(usr, cap, file_name) currentx = currentx + 32 - addtimer(new Callback(src, .proc/capture_map_capture_next, currentz, currentx, currenty, ligths), 0) + addtimer(new Callback(src, PROC_REF(capture_map_capture_next), currentz, currentx, currenty, ligths), 0) else to_chat(usr, "End of map, capture is done.") diff --git a/code/modules/admin/secrets/fun_secrets/break_all_lights.dm b/code/modules/admin/secrets/fun_secrets/break_all_lights.dm index 9b8728260f55e..1c8d736676d3e 100644 --- a/code/modules/admin/secrets/fun_secrets/break_all_lights.dm +++ b/code/modules/admin/secrets/fun_secrets/break_all_lights.dm @@ -19,7 +19,7 @@ var/user_z = get_z(user) if (!user_z) return to_chat(user, SPAN_DANGER("Invalid Z-Level!")) - for (var/obj/machinery/power/apc/apc in SSmachines.machinery) + for (var/obj/machinery/power/apc/apc as anything in SSmachines.get_machinery_of_type(/obj/machinery/power/apc)) if (apc.z == user_z) apc.overload_lighting() if ("Connected Levels") @@ -27,7 +27,7 @@ if (!user_levels) return to_chat(user, SPAN_DANGER("Invalid Z-Level!")) user_levels = GetConnectedZlevels(user_levels) - for (var/obj/machinery/power/apc/apc in SSmachines.machinery) + for (var/obj/machinery/power/apc/apc as anything in SSmachines.get_machinery_of_type(/obj/machinery/power/apc)) if (apc.z in user_levels) apc.overload_lighting() if ("All Lights") diff --git a/code/modules/admin/secrets/fun_secrets/fix_all_lights.dm b/code/modules/admin/secrets/fun_secrets/fix_all_lights.dm index 9ceb17976dd56..d89b78a2c9168 100644 --- a/code/modules/admin/secrets/fun_secrets/fix_all_lights.dm +++ b/code/modules/admin/secrets/fun_secrets/fix_all_lights.dm @@ -19,7 +19,7 @@ var/user_z = get_z(user) if (!user_z) return to_chat(user, SPAN_DANGER("Invalid Z-Level!")) - for (var/obj/machinery/light/light in SSmachines.machinery) + for (var/obj/machinery/light/light as anything in SSmachines.get_machinery_of_type(/obj/machinery/light)) if (light.z == user_z) light.fix() if ("Connected Levels") @@ -27,9 +27,9 @@ if (!user_levels) return to_chat(user, SPAN_DANGER("Invalid Z-Level!")) user_levels = GetConnectedZlevels(user_levels) - for (var/obj/machinery/light/light in SSmachines.machinery) + for (var/obj/machinery/light/light as anything in SSmachines.get_machinery_of_type(/obj/machinery/light)) if (light.z in user_levels) light.fix() if ("All Lights") - for (var/obj/machinery/light/light in SSmachines.machinery) + for (var/obj/machinery/light/light as anything in SSmachines.get_machinery_of_type(/obj/machinery/light)) light.fix() diff --git a/code/modules/admin/ticket.dm b/code/modules/admin/ticket.dm index f0cb93378b432..0214462f326fc 100644 --- a/code/modules/admin/ticket.dm +++ b/code/modules/admin/ticket.dm @@ -17,12 +17,12 @@ var/global/list/ticket_panels = list() tickets |= src id = length(tickets) opened_time = world.time - addtimer(new Callback(src, .proc/timeoutcheck), 5 MINUTES, TIMER_STOPPABLE) + addtimer(new Callback(src, PROC_REF(timeoutcheck)), 5 MINUTES, TIMER_STOPPABLE) /datum/ticket/proc/timeoutcheck() if(status == TICKET_OPEN) message_staff(SPAN_DANGER("[owner.key_name(0)] has not received a reply to their initial ahelp after 5 minutes!")) - addtimer(new Callback(src, .proc/timeoutchecklast), 5 MINUTES, TIMER_STOPPABLE) + addtimer(new Callback(src, PROC_REF(timeoutchecklast)), 5 MINUTES, TIMER_STOPPABLE) /datum/ticket/proc/timeoutchecklast() @@ -34,7 +34,7 @@ var/global/list/ticket_panels = list() /datum/ticket/proc/timeoutchecktaken() if (status == TICKET_ASSIGNED) if (is_active()) - addtimer(new Callback(src, .proc/timeoutchecktaken), 30 MINUTES, TIMER_STOPPABLE) + addtimer(new Callback(src, PROC_REF(timeoutchecktaken)), 30 MINUTES, TIMER_STOPPABLE) return for (var/datum/client_lite/C in assigned_admins) to_chat(client_by_ckey(C.ckey), SPAN_NOTICE(SPAN_BOLD("Your ticket with [client_by_ckey(owner.ckey)] has timed out and auto-closed."))) @@ -84,7 +84,7 @@ var/global/list/ticket_panels = list() to_chat(client_by_ckey(src.owner.ckey), SPAN_NOTICE("[assigned_admin.key] has added themself to your ticket and should respond shortly. Thanks for your patience!")) update_ticket_panels() - addtimer(new Callback(src, .proc/timeoutchecktaken), 30 MINUTES, TIMER_STOPPABLE) + addtimer(new Callback(src, PROC_REF(timeoutchecktaken)), 30 MINUTES, TIMER_STOPPABLE) return 1 diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index f16c277405b5a..61fb475813e4d 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -2115,12 +2115,12 @@ if (!istype(M.loc, /obj/machinery/cryopod)) var/obj/machinery/cryopod/C if (isrobot(M)) - for (var/obj/machinery/cryopod/robot/CP in SSmachines.machinery) + for (var/obj/machinery/cryopod/robot/CP as anything in SSmachines.get_machinery_of_type(/obj/machinery/cryopod/robot)) if (CP.occupant || !(CP.z in GLOB.using_map.station_levels)) continue C = CP else - for (var/obj/machinery/cryopod/CP in SSmachines.machinery) + for (var/obj/machinery/cryopod/CP as anything in SSmachines.get_machinery_of_type(/obj/machinery/cryopod)) if (CP.occupant || !(CP.z in GLOB.using_map.station_levels)) continue C = CP diff --git a/code/modules/admin/verbs/grief_fixers.dm b/code/modules/admin/verbs/grief_fixers.dm index b8fb2bfe05086..24bd451daf654 100644 --- a/code/modules/admin/verbs/grief_fixers.dm +++ b/code/modules/admin/verbs/grief_fixers.dm @@ -13,7 +13,7 @@ var/current_time = world.timeofday // Depower the supermatter, as it would quickly blow up once we remove all gases from the pipes. - for(var/obj/machinery/power/supermatter/S in SSmachines.machinery) + for(var/obj/machinery/power/supermatter/S as anything in SSmachines.get_machinery_of_type(/obj/machinery/power/supermatter)) S.power = 0 to_chat(usr, "\[1/5\] - Supermatter depowered") diff --git a/code/modules/admin/verbs/mapping.dm b/code/modules/admin/verbs/mapping.dm index d82ae2c7acb9a..c71f726d184c1 100644 --- a/code/modules/admin/verbs/mapping.dm +++ b/code/modules/admin/verbs/mapping.dm @@ -328,7 +328,7 @@ var/global/list/debug_verbs = list ( set name = "Find Leaky Pipes" var/list/baddies = list("LEAKY PIPES") - for(var/obj/machinery/atmospherics/pipe/P in SSmachines.machinery) + for(var/obj/machinery/atmospherics/pipe/P as anything in SSmachines.get_machinery_of_type(/obj/machinery/atmospherics/pipe)) if(P.leaking) baddies += "[P] ([P.x],[P.y],[P.z] - JMP)" diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 63dfc1144faee..3e5ebae4610f6 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -799,7 +799,7 @@ Ccomp's first proc. if(view == world.view) view = input("Select view range:", "FUCK YE", 7) in list(1,2,3,4,5,6,7,8,9,10,11,12,13,14,128) else - view = world.view + view = get_preference_value(/datum/client_preference/client_view) log_and_message_admins("changed their view range to [view].") @@ -980,9 +980,9 @@ Ccomp's first proc. range = rand(8, 13) var/turf/T if (connected == "Yes") - T = pick_area_turf_in_connected_z_levels(list(/proc/is_not_space_area), z_level = zlevel) + T = pick_area_turf_in_connected_z_levels(list(GLOBAL_PROC_REF(is_not_space_area)), z_level = zlevel) else - T = pick_area_turf_in_single_z_level(list(/proc/is_not_space_area), z_level = zlevel) + T = pick_area_turf_in_single_z_level(list(GLOBAL_PROC_REF(is_not_space_area)), z_level = zlevel) explosion(T, range, max_power, turf_breaker = break_turfs) booms = booms - 1 sleep(delay SECONDS) @@ -1031,7 +1031,7 @@ Ccomp's first proc. SL.landmark.shuttle_name = name SL.shuttle = name - for (var/obj/machinery/computer/shuttle_control/S in SSmachines.machinery) + for (var/obj/machinery/computer/shuttle_control/S as anything in SSmachines.get_machinery_of_type(/obj/machinery/computer/shuttle_control)) if (S.shuttle_tag == original_name) S.shuttle_tag = name S.name = "[name] Control Console" diff --git a/code/modules/admin/view_variables/view_variables_global.dm b/code/modules/admin/view_variables/view_variables_global.dm index a4fa423bdda79..5f3430e8dd815 100644 --- a/code/modules/admin/view_variables/view_variables_global.dm +++ b/code/modules/admin/view_variables/view_variables_global.dm @@ -12,7 +12,7 @@ GLOBAL_DATUM_INIT(debug_real_globals, /datum/debug_real_globals, new) for (var/name in global.vars) if (name in hidden) continue - ADD_SORTED(global_names, name, /proc/cmp_text_asc) + ADD_SORTED(global_names, name, GLOBAL_PROC_REF(cmp_text_asc)) /datum/debug_real_globals/proc/UpdateStat() diff --git a/code/modules/admin/view_variables/vv_set_handlers.dm b/code/modules/admin/view_variables/vv_set_handlers.dm index 855ecbb2dd913..07bce527f4b11 100644 --- a/code/modules/admin/view_variables/vv_set_handlers.dm +++ b/code/modules/admin/view_variables/vv_set_handlers.dm @@ -60,23 +60,23 @@ /singleton/vv_set_handler/opacity_hander handled_type = /atom - handled_vars = list("opacity" = /atom/proc/set_opacity) - predicates = list(/proc/is_num_predicate) + handled_vars = list("opacity" = TYPE_PROC_REF(/atom, set_opacity)) + predicates = list(GLOBAL_PROC_REF(is_num_predicate)) /singleton/vv_set_handler/dir_hander handled_type = /atom - handled_vars = list("dir" = /atom/proc/set_dir) - predicates = list(/proc/is_dir_predicate) + handled_vars = list("dir" = TYPE_PROC_REF(/atom, set_dir)) + predicates = list(GLOBAL_PROC_REF(is_dir_predicate)) /singleton/vv_set_handler/ghost_appearance_handler handled_type = /mob/observer/ghost - handled_vars = list("appearance" = /mob/observer/ghost/proc/set_appearance) - predicates = list(/proc/is_atom_predicate) + handled_vars = list("appearance" = TYPE_PROC_REF(/mob/observer/ghost, set_appearance)) + predicates = list(GLOBAL_PROC_REF(is_atom_predicate)) /singleton/vv_set_handler/virtual_ability_handler handled_type = /mob/observer/virtual handled_vars = list("abilities") - predicates = list(/proc/is_num_predicate) + predicates = list(GLOBAL_PROC_REF(is_num_predicate)) /singleton/vv_set_handler/virtual_ability_handler/handle_set_var(mob/observer/virtual/virtual, variable, var_value, client) ..() @@ -84,37 +84,37 @@ /singleton/vv_set_handler/mob_see_invisible_handler handled_type = /mob - handled_vars = list("see_invisible" = /mob/proc/set_see_invisible) - predicates = list(/proc/is_num_predicate) + handled_vars = list("see_invisible" = TYPE_PROC_REF(/mob, set_see_invisible)) + predicates = list(GLOBAL_PROC_REF(is_num_predicate)) /singleton/vv_set_handler/mob_sight_handler handled_type = /mob - handled_vars = list("sight" = /mob/proc/set_sight) - predicates = list(/proc/is_num_predicate) + handled_vars = list("sight" = TYPE_PROC_REF(/mob, set_sight)) + predicates = list(GLOBAL_PROC_REF(is_num_predicate)) /singleton/vv_set_handler/mob_see_in_dark_handler handled_type = /mob - handled_vars = list("see_in_dark" = /mob/proc/set_see_in_dark) - predicates = list(/proc/is_num_predicate) + handled_vars = list("see_in_dark" = TYPE_PROC_REF(/mob, set_see_in_dark)) + predicates = list(GLOBAL_PROC_REF(is_num_predicate)) /singleton/vv_set_handler/mob_stat_handler handled_type = /mob - handled_vars = list("set_stat" = /mob/proc/set_stat) - predicates = list(/proc/is_num_predicate) + handled_vars = list("set_stat" = TYPE_PROC_REF(/mob, set_stat)) + predicates = list(GLOBAL_PROC_REF(is_num_predicate)) /singleton/vv_set_handler/icon_state_handler handled_type = /atom - handled_vars = list("icon_state" = /atom/proc/set_icon_state) + handled_vars = list("icon_state" = TYPE_PROC_REF(/atom, set_icon_state)) /singleton/vv_set_handler/invisibility_handler handled_type = /atom - handled_vars = list("invisibility" = /atom/proc/set_invisibility) - predicates = list(/proc/is_num_predicate) + handled_vars = list("invisibility" = TYPE_PROC_REF(/atom, set_invisibility)) + predicates = list(GLOBAL_PROC_REF(is_num_predicate)) /singleton/vv_set_handler/name_handler handled_type = /atom - handled_vars = list("name" = /atom/proc/SetName) - predicates = list(/proc/is_text_predicate) + handled_vars = list("name" = TYPE_PROC_REF(/atom, SetName)) + predicates = list(GLOBAL_PROC_REF(is_text_predicate)) /singleton/vv_set_handler/light_handler handled_type = /atom @@ -134,15 +134,15 @@ /singleton/vv_set_handler/health_value_handler handled_type = /atom handled_vars = list( - "health_max" = /atom/proc/set_max_health, - "health_current" = /atom/proc/set_health + "health_max" = TYPE_PROC_REF(/atom, set_max_health), + "health_current" = TYPE_PROC_REF(/atom, set_health) ) - predicates = list(/proc/is_num_predicate) + predicates = list(GLOBAL_PROC_REF(is_num_predicate)) /singleton/vv_set_handler/health_dead_handler handled_type = /atom handled_vars = list("health_dead") - predicates = list(/proc/is_strict_bool_predicate) + predicates = list(GLOBAL_PROC_REF(is_strict_bool_predicate)) /singleton/vv_set_handler/health_dead_handler/handle_set_var(atom/target, variable, var_value, client) if (var_value == target.health_dead) @@ -157,7 +157,7 @@ handled_type = /obj/overmap/visitable/ship handled_vars = list("vessel_mass") predicates = list( - /proc/is_num_predicate, - /proc/is_non_zero_predicate, - /proc/is_non_negative_predicate + GLOBAL_PROC_REF(is_num_predicate), + GLOBAL_PROC_REF(is_non_zero_predicate), + GLOBAL_PROC_REF(is_non_negative_predicate) ) diff --git a/code/modules/ai/ai_holder.dm b/code/modules/ai/ai_holder.dm index e991956b29666..f58dd934d78f7 100644 --- a/code/modules/ai/ai_holder.dm +++ b/code/modules/ai/ai_holder.dm @@ -43,7 +43,7 @@ if (!(datum.process_flags & AI_FASTPROCESSING)) { \ /mob/living/Destroy() if (ai_holder) - GLOB.stat_set_event.unregister(src, ai_holder, /datum/ai_holder/proc/holder_stat_change) + GLOB.stat_set_event.unregister(src, ai_holder, TYPE_PROC_REF(/datum/ai_holder, holder_stat_change)) QDEL_NULL(ai_holder) return ..() @@ -113,7 +113,7 @@ if (!(datum.process_flags & AI_FASTPROCESSING)) { \ QDEL_NULL(src) return manage_processing(AI_PROCESSING) - GLOB.stat_set_event.register(holder, src, .proc/holder_stat_change) + GLOB.stat_set_event.register(holder, src, PROC_REF(holder_stat_change)) if (cooperative) build_faction_friends() @@ -149,7 +149,7 @@ if (!(datum.process_flags & AI_FASTPROCESSING)) { \ /// Set the AI as 'busy' for a specific length of time. /datum/ai_holder/proc/set_busy_delay(time) set_busy(TRUE) - addtimer(new Callback(src, .proc/set_busy, FALSE), time) + addtimer(new Callback(src, PROC_REF(set_busy), FALSE), time) /** * Makes this ai holder not get processed. @@ -188,6 +188,7 @@ if (!(datum.process_flags & AI_FASTPROCESSING)) { \ /// 'Tactical' processes such as moving a step, meleeing an enemy, firing a projectile, and other fairly cheap actions that need to happen quickly. /datum/ai_holder/proc/handle_tactics() + set background = TRUE if (holder.key && !autopilot) return if (!is_disabled()) @@ -196,6 +197,7 @@ if (!(datum.process_flags & AI_FASTPROCESSING)) { \ /// 'Strategical' processes that are more expensive on the CPU and so don't get run as often as the above proc, such as A* pathfinding or robust targeting. /datum/ai_holder/proc/handle_strategicals() + set background = TRUE if (holder.key && !autopilot) return if (!is_disabled()) diff --git a/code/modules/ai/ai_holder_communication.dm b/code/modules/ai/ai_holder_communication.dm index f7ad3025240ba..093c1feb99cb0 100644 --- a/code/modules/ai/ai_holder_communication.dm +++ b/code/modules/ai/ai_holder_communication.dm @@ -134,7 +134,7 @@ // This is to make responses feel a bit more natural and not instant. /datum/ai_holder/proc/delayed_say(message, mob/speak_to) - addtimer(new Callback(src, .proc/do_delayed_say, message, speak_to), rand(1 SECOND, 2 SECONDS)) + addtimer(new Callback(src, PROC_REF(do_delayed_say), message, speak_to), rand(1 SECOND, 2 SECONDS)) /datum/ai_holder/proc/do_delayed_say(message, mob/speak_to) if (!src || !holder || !can_act()) // We might've died/got deleted/etc in the meantime. diff --git a/code/modules/ai/ai_holder_pathfinding.dm b/code/modules/ai/ai_holder_pathfinding.dm index 5c13866e64691..ea4791000d3d1 100644 --- a/code/modules/ai/ai_holder_pathfinding.dm +++ b/code/modules/ai/ai_holder_pathfinding.dm @@ -6,7 +6,7 @@ var/use_astar = FALSE // Do we use the more expensive A* implementation or stick with BYOND's default step_to()? var/list/path = list() // A list of tiles that A* gave us as a solution to reach the target. var/list/obstacles = list() // Things A* will try to avoid. - var/astar_adjacent_proc = /turf/proc/CardinalTurfsWithAccess // Proc to use when A* pathfinding. Default makes them bound to cardinals. + var/astar_adjacent_proc = TYPE_PROC_REF(/turf, CardinalTurfsWithAccess) // Proc to use when A* pathfinding. Default makes them bound to cardinals. var/failed_steps = 0 // If move_once() fails to move the mob onto the correct tile, this increases. When it reaches 3, the path is recalc'd since they're probably stuck. // This clears the stored A* path. @@ -42,7 +42,7 @@ /datum/ai_holder/proc/get_path(turf/target,get_to = 1, max_distance = world.view*6) ai_log("get_path() : Entering.",AI_LOG_DEBUG) forget_path() - var/list/new_path = AStar(get_turf(holder.loc), target, astar_adjacent_proc, /turf/proc/Distance, min_target_dist = get_to, max_node_depth = max_distance, id = holder.IGetID(), exclude = obstacles) + var/list/new_path = AStar(get_turf(holder.loc), target, astar_adjacent_proc, TYPE_PROC_REF(/turf, Distance), min_target_dist = get_to, max_node_depth = max_distance, id = holder.IGetID(), exclude = obstacles) if (new_path && length(new_path)) path = new_path diff --git a/code/modules/alarm/alarm.dm b/code/modules/alarm/alarm.dm index 105394a29c589..c71b03eecd8a8 100644 --- a/code/modules/alarm/alarm.dm +++ b/code/modules/alarm/alarm.dm @@ -63,7 +63,7 @@ /datum/alarm/proc/alarm_z() if(origin) - last_z_level = origin.get_alarm_z(origin) + last_z_level = get_z(origin) return last_z_level /datum/alarm/proc/alarm_area() @@ -103,21 +103,6 @@ return max_severity -/****************** -* Assisting procs * -******************/ -/** - * Determines the alarm's z-level. - * - * TODO: Possibly redundant. Check how areas respond to `get_z()` and potentially just replace this call with that. - * - * Returns integer. - */ -/atom/proc/get_alarm_z() - return get_z(src) - -/area/get_alarm_z() - return length(contents) ? get_z(contents[1]) : 0 /** * Retrieves the atom's area for alarms. diff --git a/code/modules/assembly/infrared.dm b/code/modules/assembly/infrared.dm index 610dba866164e..ed0923c1f7fe0 100644 --- a/code/modules/assembly/infrared.dm +++ b/code/modules/assembly/infrared.dm @@ -20,7 +20,7 @@ ..() beams = list() seen_turfs = list() - proximity_trigger = new(src, /obj/item/device/assembly/infra/proc/on_beam_entered, /obj/item/device/assembly/infra/proc/on_visibility_change, world.view, PROXIMITY_EXCLUDE_HOLDER_TURF) + proximity_trigger = new(src, TYPE_PROC_REF(/obj/item/device/assembly/infra, on_beam_entered), TYPE_PROC_REF(/obj/item/device/assembly/infra, on_visibility_change), world.view, PROXIMITY_EXCLUDE_HOLDER_TURF) /obj/item/device/assembly/infra/Destroy() qdel(proximity_trigger) diff --git a/code/modules/assembly/shock_kit.dm b/code/modules/assembly/shock_kit.dm index d20dbe69e4d78..9582ccb226ec8 100644 --- a/code/modules/assembly/shock_kit.dm +++ b/code/modules/assembly/shock_kit.dm @@ -14,7 +14,7 @@ ..() return -/obj/item/assembly/shock_kit/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/assembly/shock_kit/use_tool(obj/item/W, mob/living/user, list/click_params) if(isWrench(W) && !status) part1.dropInto(loc) part2.dropInto(loc) @@ -23,12 +23,12 @@ part1 = null part2 = null qdel(src) - return + return TRUE if(isScrewdriver(W)) status = !status to_chat(user, SPAN_NOTICE("[src] is now [status ? "secured" : "unsecured"]!")) - add_fingerprint(user) - return + return TRUE + return ..() /obj/item/assembly/shock_kit/attack_self(mob/user as mob) part1.attack_self(user, status) diff --git a/code/modules/atmospherics/components/pipesparker.dm b/code/modules/atmospherics/components/pipesparker.dm index 39121be5b0760..8063eff8fe752 100644 --- a/code/modules/atmospherics/components/pipesparker.dm +++ b/code/modules/atmospherics/components/pipesparker.dm @@ -29,7 +29,7 @@ /singleton/public_access/public_method/pipe_sparker_spark name = "pipespark" desc = "Ignites gas in a pipeline." - call_proc = /obj/machinery/atmospherics/pipe/cap/sparker/proc/ignite + call_proc = TYPE_PROC_REF(/obj/machinery/atmospherics/pipe/cap/sparker, ignite) /singleton/stock_part_preset/radio/receiver/sparker/pipe frequency = BUTTON_FREQ diff --git a/code/modules/atmospherics/components/tvalve.dm b/code/modules/atmospherics/components/tvalve.dm index 582063cf8e8e0..9cdeee9ee78aa 100644 --- a/code/modules/atmospherics/components/tvalve.dm +++ b/code/modules/atmospherics/components/tvalve.dm @@ -298,17 +298,17 @@ /singleton/public_access/public_method/tvalve_go_straight name = "valve go straight" desc = "Sets the valve to send output straight." - call_proc = /obj/machinery/atmospherics/tvalve/proc/go_straight + call_proc = TYPE_PROC_REF(/obj/machinery/atmospherics/tvalve, go_straight) /singleton/public_access/public_method/tvalve_go_side name = "valve go side" desc = "Redirects output to the side." - call_proc = /obj/machinery/atmospherics/tvalve/proc/go_to_side + call_proc = TYPE_PROC_REF(/obj/machinery/atmospherics/tvalve, go_to_side) /singleton/public_access/public_method/tvalve_toggle name = "valve toggle" desc = "Toggles the output direction." - call_proc = /obj/machinery/atmospherics/tvalve/proc/toggle + call_proc = TYPE_PROC_REF(/obj/machinery/atmospherics/tvalve, toggle) /singleton/stock_part_preset/radio/receiver/tvalve frequency = FUEL_FREQ diff --git a/code/modules/atmospherics/components/unary/outlet_injector.dm b/code/modules/atmospherics/components/unary/outlet_injector.dm index 2516f44303bbc..1397d1ac53f4f 100644 --- a/code/modules/atmospherics/components/unary/outlet_injector.dm +++ b/code/modules/atmospherics/components/unary/outlet_injector.dm @@ -194,10 +194,10 @@ volume_rate = clamp(number, 0, air_contents.volume) if(signal.data["status"]) - addtimer(new Callback(src, .proc/broadcast_status), 2, TIMER_UNIQUE) + addtimer(new Callback(src, PROC_REF(broadcast_status)), 2, TIMER_UNIQUE) return - addtimer(new Callback(src, .proc/broadcast_status), 2, TIMER_UNIQUE) + addtimer(new Callback(src, PROC_REF(broadcast_status)), 2, TIMER_UNIQUE) /obj/machinery/atmospherics/unary/outlet_injector/hide(i) update_underlays() diff --git a/code/modules/atmospherics/components/unary/vent_pump.dm b/code/modules/atmospherics/components/unary/vent_pump.dm index ebab8d4ca57f3..b2234dae6376a 100644 --- a/code/modules/atmospherics/components/unary/vent_pump.dm +++ b/code/modules/atmospherics/components/unary/vent_pump.dm @@ -422,7 +422,7 @@ /singleton/public_access/public_method/purge_pump name = "activate purge mode" desc = "Activates purge mode, overriding pressure checks and removing air." - call_proc = /obj/machinery/atmospherics/unary/vent_pump/proc/purge + call_proc = TYPE_PROC_REF(/obj/machinery/atmospherics/unary/vent_pump, purge) /singleton/stock_part_preset/radio/event_transmitter/vent_pump frequency = PUMP_FREQ diff --git a/code/modules/atmospherics/components/unary/vent_scrubber.dm b/code/modules/atmospherics/components/unary/vent_scrubber.dm index b551fe791ea4b..45b606902931d 100644 --- a/code/modules/atmospherics/components/unary/vent_scrubber.dm +++ b/code/modules/atmospherics/components/unary/vent_scrubber.dm @@ -306,13 +306,13 @@ /singleton/public_access/public_method/toggle_panic_siphon name = "toggle panic siphon" desc = "Toggles the panic siphon function." - call_proc = /obj/machinery/atmospherics/unary/vent_scrubber/proc/toggle_panic + call_proc = TYPE_PROC_REF(/obj/machinery/atmospherics/unary/vent_scrubber, toggle_panic) /singleton/public_access/public_method/set_scrub_gas name = "set filter gases" desc = "Given a list of gases, sets whether the gas is being scrubbed to the value of the gas in the list." forward_args = TRUE - call_proc = /obj/machinery/atmospherics/unary/vent_scrubber/proc/set_scrub_gas + call_proc = TYPE_PROC_REF(/obj/machinery/atmospherics/unary/vent_scrubber, set_scrub_gas) /singleton/stock_part_preset/radio/event_transmitter/vent_scrubber frequency = PUMP_FREQ diff --git a/code/modules/atmospherics/components/valve.dm b/code/modules/atmospherics/components/valve.dm index 476db5127d5ed..78a5513e28086 100644 --- a/code/modules/atmospherics/components/valve.dm +++ b/code/modules/atmospherics/components/valve.dm @@ -252,17 +252,17 @@ /singleton/public_access/public_method/open_valve name = "open valve" desc = "Sets the valve to open." - call_proc = /obj/machinery/atmospherics/valve/proc/open + call_proc = TYPE_PROC_REF(/obj/machinery/atmospherics/valve, open) /singleton/public_access/public_method/close_valve name = "open valve" desc = "Sets the valve to open." - call_proc = /obj/machinery/atmospherics/valve/proc/close + call_proc = TYPE_PROC_REF(/obj/machinery/atmospherics/valve, close) /singleton/public_access/public_method/toggle_valve name = "toggle valve" desc = "Toggles whether the valve is open or closed." - call_proc = /obj/machinery/atmospherics/valve/proc/toggle + call_proc = TYPE_PROC_REF(/obj/machinery/atmospherics/valve, toggle) /obj/machinery/atmospherics/valve/digital // can be controlled by AI name = "digital valve" diff --git a/code/modules/atmospherics/pipes.dm b/code/modules/atmospherics/pipes.dm index f68adf3deaa56..461a7960adafd 100644 --- a/code/modules/atmospherics/pipes.dm +++ b/code/modules/atmospherics/pipes.dm @@ -44,7 +44,7 @@ if(parent.network) parent.network.leaks |= src else if (!new_leaking && leaking) - update_sound(0) + update_sound(FALSE) STOP_PROCESSING_MACHINE(src, MACHINERY_PROCESS_SELF) leaking = FALSE if(parent) @@ -54,7 +54,7 @@ /obj/machinery/atmospherics/pipe/proc/update_sound(playing) if(playing && !sound_token) - sound_token = GLOB.sound_player.PlayLoopingSound(src, SOUND_ID, "sound/machines/pipeleak.ogg", volume = 8, range = 3, falloff = 1, prefer_mute = TRUE) + sound_token = GLOB.sound_player.PlayLoopingSound(src, SOUND_ID, 'sound/machines/pipeleak.ogg', volume = 8, range = 3, falloff = 1, prefer_mute = TRUE) else if(!playing && sound_token) QDEL_NULL(sound_token) @@ -206,9 +206,9 @@ parent.mingle_with_turf(loc, volume) var/air = parent.air && parent.air.return_pressure() if(!sound_token && air) - update_sound(1) + update_sound(TRUE) else if(sound_token && !air) - update_sound(0) + update_sound(FALSE) else . = PROCESS_KILL diff --git a/code/modules/augment/active/circuit.dm b/code/modules/augment/active/circuit.dm index d805174ee95d9..fba324678053d 100644 --- a/code/modules/augment/active/circuit.dm +++ b/code/modules/augment/active/circuit.dm @@ -7,7 +7,7 @@ desc = "A DIY modular assembly, courtesy of Xion Industrial. Circuitry not included." -/obj/item/organ/internal/augment/active/item/circuit/attackby(obj/item/I, mob/user) +/obj/item/organ/internal/augment/active/item/circuit/use_tool(obj/item/I, mob/living/user, list/click_params) if (isCrowbar(I)) if (item) item.canremove = TRUE @@ -17,7 +17,8 @@ playsound(loc, 'sound/items/Crowbar.ogg', 50, 1) else to_chat(user, SPAN_WARNING("The augment is empty!")) - return + return TRUE + if (istype(I, /obj/item/device/electronic_assembly/augment)) if (item) to_chat(user, SPAN_WARNING("There's already an assembly in there.")) @@ -25,5 +26,5 @@ item = I item.canremove = FALSE playsound(loc, 'sound/items/Crowbar.ogg', 50, 1) - return - ..() + return TRUE + return ..() diff --git a/code/modules/augment/active/polytool.dm b/code/modules/augment/active/polytool.dm index 405602f2b49b6..aec7ca0616c16 100644 --- a/code/modules/augment/active/polytool.dm +++ b/code/modules/augment/active/polytool.dm @@ -42,9 +42,10 @@ to_chat(owner, "\the [I] fails to retract.") return items += I + var/datum/pronouns/pronouns = owner.choose_from_pronouns() owner.visible_message( - SPAN_WARNING("[owner] retracts \his [I] into [limb]."), - SPAN_NOTICE("You retract your [I] into [limb].") + SPAN_WARNING("[owner] retracts [pronouns.his] [I] into [pronouns.his] [limb]."), + SPAN_NOTICE("You retract your [I] into your [limb].") ) else to_chat(owner, SPAN_WARNING("You must drop [I] before tool can be extend.")) @@ -55,8 +56,9 @@ if (owner.equip_to_slot_if_possible(item, slot)) items -= item //Keep track of it, make sure it returns - GLOB.item_unequipped_event.register(item, src, /obj/item/organ/internal/augment/active/polytool/proc/holding_dropped) + GLOB.item_unequipped_event.register(item, src, TYPE_PROC_REF(/obj/item/organ/internal/augment/active/polytool, holding_dropped)) + var/datum/pronouns/pronouns = owner.choose_from_pronouns() owner.visible_message( - SPAN_WARNING("[owner] extends \his [item.name] from [limb]."), - SPAN_NOTICE("You extend your [item.name] from [limb].") + SPAN_WARNING("[owner] extends [pronouns.his] [item.name] from [pronouns.his] [limb]."), + SPAN_NOTICE("You extend your [item.name] from your [limb].") ) diff --git a/code/modules/augment/active/powerfist.dm b/code/modules/augment/active/powerfist.dm index 3c3a0f7baddeb..e3395c6f122ea 100644 --- a/code/modules/augment/active/powerfist.dm +++ b/code/modules/augment/active/powerfist.dm @@ -36,27 +36,29 @@ augment_flags = AUGMENT_MECHANICAL | AUGMENT_SCANNABLE -/obj/item/powerfist/attackby(obj/item/item, mob/user) +/obj/item/powerfist/use_tool(obj/item/item, mob/living/user, list/click_params) + var/datum/pronouns/pronouns = user.choose_from_pronouns() if (!istype(item, /obj/item/tank)) - return + return ..() var/obj/item/tank/other = item if (other.tank_size > TANK_SIZE_SMALL) to_chat(user, SPAN_WARNING("\The [other] is too big. Find a smaller tank.")) - return + return TRUE if (tank) to_chat(user, SPAN_WARNING("\The [src] already has \a [tank] installed.")) - return + return TRUE user.visible_message( - SPAN_ITALIC("\The [user] starts connecting \a [item] to \his [src]."), + SPAN_ITALIC("\The [user] starts connecting \a [item] to [pronouns.his] [src]."), SPAN_ITALIC("You start connecting \the [item] to \the [src]."), range = 5 ) if (!do_after(user, 3 SECONDS, item, DO_PUBLIC_UNIQUE)) - return + return TRUE if (!user.unEquip(item, src)) - return + FEEDBACK_UNEQUIP_FAILURE(user, item) + return TRUE user.visible_message( - SPAN_ITALIC("\The [user] finishes connecting \a [item] to \his [src]."), + SPAN_ITALIC("\The [user] finishes connecting \a [item] to [pronouns.his] [src]."), SPAN_NOTICE("You finish connecting \the [item] to \the [src]."), range = 5 ) @@ -64,6 +66,7 @@ tank = item update_force() update_icon() + return TRUE /obj/item/powerfist/proc/update_force() @@ -96,18 +99,19 @@ /obj/item/powerfist/attack_hand(mob/living/user) + var/datum/pronouns/pronouns = user.choose_from_pronouns() if (!tank) to_chat(user, SPAN_WARNING("There's no tank in \the [src].")) return user.visible_message( - SPAN_ITALIC("\The [user] starts disconnecting \a [tank] from \his [src]."), + SPAN_ITALIC("\The [user] starts disconnecting \a [tank] from [pronouns.his] [src]."), SPAN_ITALIC("You start disconnecting \the [tank] from \the [src]."), range = 5 ) if (!do_after(user, 3 SECONDS, src, DO_PUBLIC_UNIQUE)) return user.visible_message( - SPAN_ITALIC("\The [user] finishes disconnecting \a [tank] from \his [src]."), + SPAN_ITALIC("\The [user] finishes disconnecting \a [tank] from [pronouns.his] [src]."), SPAN_NOTICE("You finish disconnecting \the [tank] from \the [src]."), range = 5 ) @@ -177,7 +181,7 @@ playsound(A, 'sound/effects/meteorimpact.ogg', 100, 1) playsound(A, 'sound/machines/airlock_creaking.ogg', 100, 1) A.visible_message(SPAN_DANGER("\The [user] tears \the [A] open with \a [src]!")) - addtimer(new Callback(A, /obj/machinery/door/airlock/.proc/open, TRUE), 0) + addtimer(new Callback(A, TYPE_PROC_REF(/obj/machinery/door/airlock, open), TRUE), 0) A.set_broken(TRUE) return TRUE else @@ -185,12 +189,12 @@ if ((MACHINE_IS_BROKEN(A) || !A.is_powered() || do_after(user, 10 SECONDS, A, DO_DEFAULT | DO_USER_UNIQUE_ACT | DO_PUBLIC_PROGRESS)) && !(A.operating || A.welded || A.locked)) playsound(A, 'sound/machines/airlock_creaking.ogg', 100, 1) if (A.density) - addtimer(new Callback(A, /obj/machinery/door/airlock/.proc/open, TRUE), 0) + addtimer(new Callback(A, TYPE_PROC_REF(/obj/machinery/door/airlock, open), TRUE), 0) if(!MACHINE_IS_BROKEN(A) && A.is_powered()) A.set_broken(TRUE) A.visible_message(SPAN_DANGER("\The [user] forces \the [A] open with \a [src]!")) else - addtimer(new Callback(A, /obj/machinery/door/airlock/.proc/close, TRUE), 0) + addtimer(new Callback(A, TYPE_PROC_REF(/obj/machinery/door/airlock, close), TRUE), 0) if (!MACHINE_IS_BROKEN(A) && A.is_powered()) A.set_broken(TRUE) A.visible_message(SPAN_DANGER("\The [user] forces \the [A] closed with \a [src]!")) diff --git a/code/modules/augment/implanter.dm b/code/modules/augment/implanter.dm index e8192778a23f6..8ca0b86acc724 100644 --- a/code/modules/augment/implanter.dm +++ b/code/modules/augment/implanter.dm @@ -102,10 +102,11 @@ if (loc != old_loc) return var/success = instant + var/datum/pronouns/pronouns = user.choose_from_pronouns() if (!instant) working = TRUE to_chat(user, SPAN_WARNING("\icon[src] Commencing procedure. " + SPAN_DANGER("Please remain calm."))) - user.visible_message(SPAN_WARNING("\The [user] places \his [parent.name] against \the [src].")) + user.visible_message(SPAN_WARNING("\The [user] places [pronouns.his] [parent.name] against \the [src].")) if (!do_after(user, 2 SECONDS, src, DO_PUBLIC_UNIQUE)) goto FailedAugmentImplant user.visible_message(SPAN_DANGER("\The [src] purrs maliciously and unfurls its armatures with frightening speed!")) @@ -147,7 +148,7 @@ FailedAugmentImplant: working = FALSE if (!success) - user.visible_message(SPAN_DANGER("\The [src] falls away from \the [user], leaving \his [parent.name] a mangled mess!")) + user.visible_message(SPAN_DANGER("\The [src] falls away from \the [user], leaving [pronouns.his] [parent.name] a mangled mess!")) parent.take_general_damage(15) return to_chat(user, SPAN_WARNING("\icon[src] Procedure complete. ") + SPAN_NOTICE("Have a nice day.")) diff --git a/code/modules/augment/item.dm b/code/modules/augment/item.dm index 34009e345de14..cdb6e4a43611a 100644 --- a/code/modules/augment/item.dm +++ b/code/modules/augment/item.dm @@ -64,12 +64,13 @@ return if (!owner.equip_to_slot_if_possible(item, slot)) return - GLOB.item_unequipped_event.register(item, src, /obj/item/organ/internal/augment/active/item/proc/item_dropped) + GLOB.item_unequipped_event.register(item, src, TYPE_PROC_REF(/obj/item/organ/internal/augment/active/item, item_dropped)) if (deploy_sound) playsound(owner, deploy_sound, 30) if (as_owner) + var/datum/pronouns/pronouns = owner.choose_from_pronouns() owner.visible_message( - SPAN_WARNING("\The [owner] extends \his [item.name] from \his [limb.name]."), + SPAN_WARNING("\The [owner] extends [pronouns.his] [item.name] from [pronouns.his] [limb.name]."), SPAN_NOTICE("You extend your [item.name] from your [limb.name].") ) else @@ -91,8 +92,9 @@ if (retract_sound) playsound(owner, retract_sound, 30) if (as_owner) + var/datum/pronouns/pronouns = M.choose_from_pronouns() M.visible_message( - SPAN_WARNING("\The [M] retracts \his [item.name] into \his [limb.name]."), + SPAN_WARNING("\The [M] retracts [pronouns.his] [item.name] into [pronouns.his] [limb.name]."), SPAN_NOTICE("You retract your [item.name] into your [limb.name].") ) else diff --git a/code/modules/butchery/remains.dm b/code/modules/butchery/remains.dm index 6810a20aa27d3..2fdb6a6f5ff24 100644 --- a/code/modules/butchery/remains.dm +++ b/code/modules/butchery/remains.dm @@ -8,14 +8,14 @@ if (carve_product && is_sharp(tool)) if (!isturf(loc)) to_chat(user, SPAN_WARNING("You must put \the [src] down before carving it.")) - return + return TRUE user.visible_message( SPAN_ITALIC("\The [user] begins carving \a [src] with \a [tool]."), SPAN_ITALIC("You begin carving \the [src] into \a [initial(carve_product.name)] with \the [tool]."), range = 5 ) if (!do_after(user, 10 SECONDS, src)) - return + return TRUE user.visible_message( SPAN_ITALIC("\The [user] finishes carving \a [src] into \a [initial(carve_product.name)]."), SPAN_ITALIC("You finish carving \the [src]."), @@ -23,6 +23,8 @@ ) new carve_product (loc) qdel(src) + return TRUE + return ..() diff --git a/code/modules/client/client_color.dm b/code/modules/client/client_color.dm index 5f447bbf28105..9386eb0848a02 100644 --- a/code/modules/client/client_color.dm +++ b/code/modules/client/client_color.dm @@ -1,112 +1,179 @@ /datum/client_color - var/client_color = "" //Any client.color-valid value - var/priority = 1 //Since only one client.color can be rendered on screen, we take the one with the highest priority value: - //eg: "Bloody screen" > "goggles color" as the former is much more important - var/override = FALSE //If set to override we will stop multiplying the moment we get here. NOTE: Priority remains, if your override is on position 4, the other 3 will still have a say. + /// Any value valid for client.color + var/client_color + /// The order in which client colors are applied. Higher numbers are applied later. + var/order -/mob - var/list/client_colors = list() + /// If set, stops applying client colors once this one is reached. Order still applies. + var/override + /// Whether this client color should affect the color of blood. + var/ignore_blood -/* - Adds an instance of color_type to the mob's client_colors list - color_type - a typepath (subtyped from /datum/client_color) -*/ -/mob/proc/has_client_color(color_type) - if(!ispath(/datum/client_color) || !LAZYLEN(client_colors)) +/// The set of /datum/client_color currently applied to the mob, if any. +/mob/var/list/client_colors + + +/// Checks whether the mob has an instance of color_type in its client_colors list. +/mob/proc/has_client_color(datum/client_color/color_type) + if (!length(client_colors)) return FALSE - for(var/thing in client_colors) - var/datum/client_color/col = thing - if(col.type == color_type) + if (!ispath(color_type, /datum/client_color)) + return FALSE + for (var/datum/client_color/entry as anything in client_colors) + if (entry.type == color_type) return TRUE return FALSE -/mob/proc/add_client_color(color_type) - if(!has_client_color(color_type)) - var/datum/client_color/CC = new color_type() - client_colors |= CC - sortTim(client_colors, /proc/cmp_clientcolor_priority) - update_client_color() - - -/* - Removes an instance of color_type from the mob's client_colors list - color_type - a typepath (subtyped from /datum/client_color) - returns true if instance was found, false otherwise -*/ -/mob/proc/remove_client_color(color_type) - if(!ispath(/datum/client_color)) - return FALSE +/// Adds an instance of color_type to the mob's client_colors list if one doesn't already exist. +/mob/proc/add_client_color(datum/client_color/color_type) + if (has_client_color(color_type)) + return + if (!length(client_colors)) + client_colors = list() + client_colors |= new color_type + sortTim(client_colors, GLOBAL_PROC_REF(cmp_clientcolor_order)) + update_client_color() + + +/// The comparison function for sorting client_colors by order. +/proc/cmp_clientcolor_order(datum/client_color/a, datum/client_color/b) + return a.order - b.order - var/result = FALSE - for(var/cc in client_colors) - var/datum/client_color/CC = cc - if(CC.type == color_type) - result = TRUE - client_colors -= CC - qdel(CC) + +/// Removes an instance of color_type from the mob's client_colors list, returning TRUE if one existed. +/mob/proc/remove_client_color(datum/client_color/color_type) + if (!length(client_colors)) + return + for (var/datum/client_color/entry as anything in client_colors) + if (entry.type == color_type) + client_colors -= entry + qdel(entry) + update_client_color() + if (!length(client_colors)) + client_colors = null break + + +/// Clears the mobs client_colors list. +/mob/proc/clear_client_colors() + if (!length(client_colors)) + return + client_colors = null update_client_color() - return result -/* - Resets the mob's client.color to null, and then sets it to the highest priority - client_color datum, if one exists -*/ +/// Resets the mob's client.color to null and then applies the client_colors list. /mob/proc/update_client_color() - if(!client) + if (!client) return client.color = null - if(!length(client_colors)) + var/list/color = list( + 1, 0, 0, + 0, 1, 0, + 0, 0, 1 + ) + if (!length(client_colors)) + animate(renderers[10], color = initial(color)) + animate(client, color = initial(color)) return - var/list/c = list(1,0,0, 0,1,0, 0,0,1) //Star at normal - for(var/datum/client_color/CC in client_colors) - //Matrix multiplication newcolor * current - var/list/current = c.Copy() + var/datum/client_color/top_color + for (var/datum/client_color/entry as anything in client_colors) + top_color = entry + var/list/copy = color.Copy() + for (var/m = 1 to 3) + for (var/i = 1 to 3) + var/value = 0 + for (var/j = 1 to 3) + value += copy[(j - 1) * 3 + i] * entry.client_color[(m - 1) * 3 + j] + color[(m - 1) * 3 + i] = value + if (entry.override) + break + if (!top_color.ignore_blood) + animate(renderers[10], color = color) + animate(client, color = list( + 1, 0, 0, + 0, 1, 0, + 0, 0, 1 + )) + else + animate(client, color = color) + animate(renderers[10], color = list( + 1, 0, 0, + 0, 1, 0, + 0, 0, 1 + )) + - for(var/m = 1; m <= 3; m += 1) //For each row - for(var/i = 1; i <= 3; i += 1) //go over each column of the second matrix - var/sum = 0 - for(var/j = 1; j <= 3; j += 1) //multiply each pair - sum += CC.client_color[(m-1)*3 + j] * current[(j-1)*3 + i] +/datum/client_color/deuteranopia + client_color = list( + 0.47, 0.38, 0.15, + 0.54, 0.31, 0.15, + 0, 0.3, 0.7 + ) + order = 100 - c[(m-1)*3 + i] = sum - if(CC.override) - break +/datum/client_color/protanopia + client_color = list( + 0.51, 0.4, 0.12, + 0.49, 0.41, 0.12, + 0, 0.2, 0.76 + ) + order = 100 + + +/datum/client_color/tritanopia + client_color = list( + 0.95, 0.07, 0, + 0, 0.44, 0.52, + 0.05, 0.49, 0.48 + ) + order = 100 - animate(client, color = c) /datum/client_color/monochrome - client_color = list(0.33,0.33,0.33, 0.33,0.33,0.33, 0.33,0.33,0.33) - priority = 100 + client_color = list( + 0.33, 0.33, 0.33, + 0.33, 0.33, 0.33, + 0.33, 0.33, 0.33 + ) + order = 199 -//Similar to monochrome but shouldn't look as flat, same priority -/datum/client_color/noir - client_color = list(0.299,0.299,0.299, 0.587,0.587,0.587, 0.114,0.114,0.114) - priority = 200 -/datum/client_color/thirdeye - client_color = list(0.1, 0.1, 0.1, 0.3, 0.3, 0.3, 0.3, 0.3, 0.7) - priority = 300 +/datum/client_color/nvg + client_color = list( + 0.2, 0.2, 0.2, + 0.2, 0.5, 0.5, + 0.2, 0.3, 0.5 + ) + order = 199 -//Disabilities, could be hooked to brain damage or chargen if so desired. -/datum/client_color/deuteranopia - client_color = list(0.47,0.38,0.15, 0.54,0.31,0.15, 0,0.3,0.7) - priority = 100 -/datum/client_color/protanopia - client_color = list(0.51,0.4,0.12, 0.49,0.41,0.12, 0,0.2,0.76) - priority = 100 +/datum/client_color/noir + client_color = list( + 0.299, 0.299, 0.299, + 0.587, 0.587, 0.587, + 0.114, 0.114, 0.114 + ) + order = 200 + ignore_blood = TRUE + + +/datum/client_color/thirdeye + client_color = list( + 0.1, 0.1, 0.1, + 0.3, 0.3, 0.3, + 0.3, 0.3, 0.7 + ) + order = 300 + ignore_blood = TRUE -/datum/client_color/tritanopia - client_color = list(0.95,0.07,0, 0,0.44,0.52, 0.05,0.49,0.48) - priority = 100 /datum/client_color/berserk client_color = "#af111c" - priority = INFINITY //This effect sort of exists on its own you /have/ to be seeing RED - override = TRUE //Because multiplying this will inevitably fail + order = INFINITY + override = TRUE + ignore_blood = TRUE diff --git a/code/modules/client/client_defines.dm b/code/modules/client/client_defines.dm index bbea8dae39e03..7afa107358e43 100644 --- a/code/modules/client/client_defines.dm +++ b/code/modules/client/client_defines.dm @@ -15,6 +15,9 @@ var/datum/preferences/prefs = null var/adminobs = null + // Runechat messages + var/list/seen_messages + ///datum that controls the displaying and hiding of tooltips var/datum/tooltip/tooltips diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index a89140eb17853..90f4cdb187fab 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -182,6 +182,8 @@ . = ..() //calls mob.Login() + view = get_preference_value(/datum/client_preference/client_view) + GLOB.using_map.map_info(src) if (config.event) @@ -401,7 +403,7 @@ 'html/images/FleetLogo.png', 'html/images/sfplogo.png', 'html/images/falogo.png', - // [SIERRA-ADD] , + // [SIERRA-ADD] 'html/images/ofbluelogo.png', 'html/images/ofntlogo.png', 'html/images/foundlogo.png', @@ -416,8 +418,9 @@ 'html/images/ouerelogo.png', 'html/images/terstenlogo.png', // [/SIERRA-ADD] + 'html/images/zhlogo.png' ) - addtimer(new Callback(src, .proc/after_send_resources), 1 SECOND) + addtimer(new Callback(src, PROC_REF(after_send_resources)), 1 SECOND) /client/proc/after_send_resources() diff --git a/code/modules/client/preference_setup/_defines.dm b/code/modules/client/preference_setup/_defines.dm index 5cf16c0a79b66..2adcd9a057ec7 100644 --- a/code/modules/client/preference_setup/_defines.dm +++ b/code/modules/client/preference_setup/_defines.dm @@ -6,7 +6,7 @@ if(!singletons_by_name) \ for(var/singleton_type in singletons_by_type) \ {\ var##singleton_prototype/singleton_instance = singletons_by_type[singleton_type];\ - ADD_SORTED(singletons_by_name, singleton_instance.name, /proc/cmp_text_asc);\ + ADD_SORTED(singletons_by_name, singleton_instance.name, GLOBAL_PROC_REF(cmp_text_asc));\ singletons_by_name[singleton_instance.name] = singleton_instance;\ }\ } diff --git a/code/modules/client/preference_setup/background/03_records.dm b/code/modules/client/preference_setup/background/03_records.dm index a2949d6d3f084..6ac7bf2d7336d 100644 --- a/code/modules/client/preference_setup/background/03_records.dm +++ b/code/modules/client/preference_setup/background/03_records.dm @@ -49,7 +49,7 @@ // .+= TBTN("set_memory", TextPreview(pref.memory, 40), "Memory") // SIERRA-EDIT - ORIGINAL // . += "
Other:" // SIERRA-EDIT - ORIGINAL // var/set_addr_button = TBTN("set_email_addr", pref.email_addr ? pref.email_addr : "(default)", "Email Address") // SIERRA-EDIT - ORIGINAL - // var/list/branches = pref.for_each_selected_branch(new Callback(src, .proc/allow_email_branch_check)) // SIERRA-EDIT - ORIGINAL + // var/list/branches = pref.for_each_selected_branch(new Callback(src, PROC_REF(allow_email_branch_check)) // SIERRA-EDIT - ORIGINAL // for (var/name in branches) // SIERRA-EDIT - ORIGINAL // set_addr_button += " " + (branches[name] ? UI_FONT_GOOD(name) : UI_FONT_BAD(name)) // SIERRA-EDIT - ORIGINAL // . += set_addr_button // SIERRA-EDIT - ORIGINAL @@ -62,7 +62,7 @@ .+= TBTN("set_memory", TextPreview(pref.memory, 40), "Воспоминания") . += "
Другое:" var/set_addr_button = TBTN("set_email_addr", pref.email_addr ? pref.email_addr : "(стандартный)", "Почтовый адрес") - var/list/branches = pref.for_each_selected_branch(new Callback(src, .proc/allow_email_branch_check)) + var/list/branches = pref.for_each_selected_branch(new Callback(src, PROC_REF(allow_email_branch_check))) for (var/name in branches) set_addr_button += " " + (branches[name] ? UI_FONT_GOOD(name) : UI_FONT_BAD(name)) . += set_addr_button diff --git a/code/modules/client/preference_setup/general/05_preview.dm b/code/modules/client/preference_setup/general/05_preview.dm index 28fc46f739b05..cdf04fb370466 100644 --- a/code/modules/client/preference_setup/general/05_preview.dm +++ b/code/modules/client/preference_setup/general/05_preview.dm @@ -104,12 +104,14 @@ mannequin.ImmediateOverlayUpdate() last_built_icon = icon('icons/effects/128x48.dmi', bgstate) last_built_icon.Scale(48+32, 16+32) - mannequin.dir = WEST - last_built_icon.Blend(getFlatIcon(mannequin, WEST, always_use_defdir = TRUE), ICON_OVERLAY, 1, 9) - mannequin.dir = NORTH - last_built_icon.Blend(getFlatIcon(mannequin, NORTH, always_use_defdir = TRUE), ICON_OVERLAY, 25, 17) + // mannequin.dir = WEST + // last_built_icon.Blend(getFlatIcon(mannequin, WEST, always_use_defdir = TRUE), ICON_OVERLAY, 1, 9) + // CHECK_TICK + // mannequin.dir = NORTH + // last_built_icon.Blend(getFlatIcon(mannequin, NORTH, always_use_defdir = TRUE), ICON_OVERLAY, 25, 17) + // CHECK_TICK mannequin.dir = SOUTH - last_built_icon.Blend(getFlatIcon(mannequin, SOUTH, always_use_defdir = TRUE), ICON_OVERLAY, 49, 1) + last_built_icon.Blend(getFlatIcon(mannequin, SOUTH, always_use_defdir = TRUE), ICON_OVERLAY, 25, 17) preview_icon = new (last_built_icon) var/scale = client.get_preference_value(/datum/client_preference/preview_scale) switch (scale) diff --git a/code/modules/client/preference_setup/global/05_settings.dm b/code/modules/client/preference_setup/global/05_settings.dm index 413e7bc2f06f3..1d8f17d9b3784 100644 --- a/code/modules/client/preference_setup/global/05_settings.dm +++ b/code/modules/client/preference_setup/global/05_settings.dm @@ -92,7 +92,6 @@ /client/proc/set_preference(preference, set_preference) var/datum/client_preference/cp = get_client_preference(preference) - if(!cp) return FALSE diff --git a/code/modules/client/preference_setup/global/preferences.dm b/code/modules/client/preference_setup/global/preferences.dm index 21fea4f93dc16..71a065cf99d9a 100644 --- a/code/modules/client/preference_setup/global/preferences.dm +++ b/code/modules/client/preference_setup/global/preferences.dm @@ -29,6 +29,9 @@ GLOBAL_VAR_CONST(PREF_LARGE, "Large") GLOBAL_VAR_CONST(PREF_LOW, "Low") GLOBAL_VAR_CONST(PREF_MED, "Medium") GLOBAL_VAR_CONST(PREF_HIGH, "High") +GLOBAL_VAR_CONST(PREF_CLIENT_VIEW_SMALL, "15x15") +GLOBAL_VAR_CONST(PREF_CLIENT_VIEW_MEDIUM, "17x15") +GLOBAL_VAR_CONST(PREF_CLIENT_VIEW_LARGE, "19x15") var/global/list/_client_preferences var/global/list/_client_preferences_by_key @@ -92,6 +95,20 @@ var/global/list/_client_preferences_by_type * Player Preferences * *********************/ +/datum/client_preference/client_view + description = "Size of playable zone window" + key = "CLIENT_VIEW" + options = list(GLOB.PREF_CLIENT_VIEW_SMALL, GLOB.PREF_CLIENT_VIEW_MEDIUM, GLOB.PREF_CLIENT_VIEW_LARGE) + default_value = GLOB.PREF_CLIENT_VIEW_LARGE + +/datum/client_preference/client_view/changed(mob/preference_mob, new_value) + var/client/mob_client = preference_mob?.client + if(!mob_client) + return + + mob_client.view = new_value + mob_client.update_skybox(TRUE) + /datum/client_preference/play_admin_midis description = "Play admin midis" key = "SOUND_MIDI" @@ -301,7 +318,24 @@ var/global/list/_client_preferences_by_type description = "Skip the radial menu for single-option surgeries." key = "SURGERY_SKIP_RADIAL" options = list(GLOB.PREF_YES, GLOB.PREF_NO) - default_value = GLOB.PREF_NO + +/datum/client_preference/runechat_mob + description = "Enable mob runechat" + key = "RUNECHAT_MOB" + options = list(GLOB.PREF_YES, GLOB.PREF_NO) + default_value = GLOB.PREF_YES + +/datum/client_preference/runechat_obj + description = "Enable obj runechat" + key = "RUNECHAT_OBJ" + options = list(GLOB.PREF_YES, GLOB.PREF_NO) + default_value = GLOB.PREF_YES + +/datum/client_preference/runechat_messages_length + description = "Length of runechat messages" + key = "RUNECHAT_MESSAGES_LENGTH" + options = list(GLOB.PREF_SHORT, GLOB.PREF_LONG) + default_value = GLOB.PREF_SHORT /******************** diff --git a/code/modules/client/preference_setup/laws/laws_pref.dm b/code/modules/client/preference_setup/laws/laws_pref.dm index 7577f8a42b2ce..a5f4b024c97bc 100644 --- a/code/modules/client/preference_setup/laws/laws_pref.dm +++ b/code/modules/client/preference_setup/laws/laws_pref.dm @@ -75,7 +75,7 @@ var/datum/ai_laws/ai_laws = law_set_type var/ai_law_name = initial(ai_laws.name) if(initial(ai_laws.shackles)) // Now this is one terribly snowflaky var - ADD_SORTED(valid_lawsets, ai_law_name, /proc/cmp_text_asc) + ADD_SORTED(valid_lawsets, ai_law_name, GLOBAL_PROC_REF(cmp_text_asc)) valid_lawsets[ai_law_name] = law_set_type // Post selection diff --git a/code/modules/client/preference_setup/loadout/lists/eyegear.dm b/code/modules/client/preference_setup/loadout/lists/eyegear.dm index f47822ebe90dc..b4c3889d2d883 100644 --- a/code/modules/client/preference_setup/loadout/lists/eyegear.dm +++ b/code/modules/client/preference_setup/loadout/lists/eyegear.dm @@ -77,6 +77,7 @@ options["Goggles, corrective"] = /obj/item/clothing/glasses/hud/health/goggle/prescription options["Eyepatch"] = /obj/item/clothing/glasses/eyepatch/hud/medical options["Aviators"] = /obj/item/clothing/glasses/hud/health/aviators + options["Aviators, corrective"] = /obj/item/clothing/glasses/hud/health/aviators/prescription gear_tweaks += new /datum/gear_tweak/path (options) @@ -94,6 +95,7 @@ options["Goggles, corrective"] = /obj/item/clothing/glasses/meson/prescription options["Eyepatch"] = /obj/item/clothing/glasses/eyepatch/hud/meson options["Aviators"] = /obj/item/clothing/glasses/meson/aviators + options["Aviators, corrective"] = /obj/item/clothing/glasses/meson/aviators/prescription gear_tweaks += new /datum/gear_tweak/path (options) @@ -110,6 +112,7 @@ options["HUD"] = /obj/item/clothing/glasses/hud/janitor options["HUD, corrective"] = /obj/item/clothing/glasses/hud/janitor/prescription options["Aviators"] = /obj/item/clothing/glasses/hud/janitor/aviators + options["Aviators, corrective"] = /obj/item/clothing/glasses/hud/janitor/aviators/prescription gear_tweaks += new /datum/gear_tweak/path (options) @@ -185,3 +188,14 @@ display_name = "Blindfold" path = /obj/item/clothing/glasses/blindfold flags = GEAR_HAS_COLOR_SELECTION + +/datum/gear/eyes/ballistics + display_name = "Replica Ballistic Goggles" + path = /obj/item/clothing/glasses/ballistic/fake + +/datum/gear/eyes/ballistics/New() + ..() + var/list/options = list() + options["Replica Ballistic Goggles"] = /obj/item/clothing/glasses/ballistic/fake + options["Replica Ballistic Goggles, corrective"] = /obj/item/clothing/glasses/ballistic/fake/prescription + gear_tweaks += new /datum/gear_tweak/path (options) diff --git a/code/modules/client/preference_setup/loadout/lists/misc.dm b/code/modules/client/preference_setup/loadout/lists/misc.dm index 9d879657db212..da9deb0bc9176 100644 --- a/code/modules/client/preference_setup/loadout/lists/misc.dm +++ b/code/modules/client/preference_setup/loadout/lists/misc.dm @@ -94,13 +94,17 @@ /datum/gear/lunchbox/New() ..() - var/list/lunchboxes = list() - for(var/lunchbox_type in typesof(/obj/item/storage/lunchbox)) - var/obj/item/storage/lunchbox/lunchbox = lunchbox_type - if(!initial(lunchbox.filled)) - lunchboxes[initial(lunchbox.name)] = lunchbox_type - gear_tweaks += new/datum/gear_tweak/path(lunchboxes) - gear_tweaks += new/datum/gear_tweak/contents(lunchables_lunches(), lunchables_snacks(), lunchables_drinks()) + var/list/types = subtypesof(/obj/item/storage/lunchbox) - /obj/item/storage/lunchbox/caltrops + var/list/options = list() + for (var/obj/item/storage/lunchbox/lunchbox as anything in types) + if (!initial(lunchbox.filled)) + options[initial(lunchbox.name)] = lunchbox + gear_tweaks += new/datum/gear_tweak/path(options) + gear_tweaks += new/datum/gear_tweak/contents( + lunchables_lunches(), + lunchables_snacks(), + lunchables_drinks() + ) /datum/gear/towel display_name = "towel" diff --git a/code/modules/client/preference_setup/loadout/lists/xenowear.dm b/code/modules/client/preference_setup/loadout/lists/xenowear.dm index 7b3d8353adf84..360b3c6b0eea9 100644 --- a/code/modules/client/preference_setup/loadout/lists/xenowear.dm +++ b/code/modules/client/preference_setup/loadout/lists/xenowear.dm @@ -94,12 +94,6 @@ whitelisted = list(SPECIES_IPC) // Misc clothing -/datum/gear/uniform/harness - display_name = "gear harness (Full Body Prosthetic, Diona, Giant Armoured Serpentid)" - path = /obj/item/clothing/under/harness - sort_category = "Xenowear" - whitelisted = list(SPECIES_IPC,SPECIES_DIONA, SPECIES_NABBER) - /datum/gear/shoes/toeless display_name = "toeless jackboots" path = /obj/item/clothing/shoes/jackboots/unathi diff --git a/code/modules/client/preference_setup/loadout/loadout.dm b/code/modules/client/preference_setup/loadout/loadout.dm index 7f333d447c52b..fa548d76584fe 100644 --- a/code/modules/client/preference_setup/loadout/loadout.dm +++ b/code/modules/client/preference_setup/loadout/loadout.dm @@ -176,7 +176,20 @@ var/global/list/gear_datums = list() var/list/entry = list() var/datum/gear/G = LC.gear[gear_name] var/ticked = (G.display_name in pref.gear_list[pref.gear_slot]) - entry += "[G.display_name]" + + // [SIERRA-ADD] - LOADOUT_ITEMS + + var/list/gear_link_class = list() + if(ticked) + gear_link_class.Add("linkOn") + if(!(G.donation_tier == DONATION_TIER_NONE)) + gear_link_class.Add("gold") + gear_link_class = jointext(gear_link_class, " ") + // [/SIERRA-ADD] + // [SIERRA-EDIT] - LOADOUT-ITEMS + // entry += "[G.display_name]" // SIERRA-EDIT - ORIGINAL + entry += "[G.display_name]" //inf, was: entry += "[G.display_name]" + // [/SIERRA-EDIT] entry += "[G.cost]" entry += "[FONT_NORMAL(G.get_description(get_gear_metadata(G,1)))]" var/allowed = 1 @@ -237,6 +250,30 @@ var/global/list/gear_datums = list() entry += "[english_list(skill_checks)]" + // [SIERRA-ADD] - LOADOUT-ITEMS + if(allowed && G.allowed_factions) + var/good_background = 0 + var/singleton/cultural_info/background = SSculture.get_culture(pref.cultural_info[TAG_FACTION]) + var/bgndname = background ? background.name : "Unset" + entry += "
" + + var/list/backgroundchecks = list() + + if(bgndname in G.allowed_factions) + backgroundchecks += "[bgndname]" + good_background = 1 + else + backgroundchecks += "[bgndname]" + allowed = good_background + entry += "[english_list(backgroundchecks)]" + + if(allowed && (!(G.has_donation_tier(pref)))) + entry += "
" + var/list/requiredtier = list() + requiredtier += "Requires Donation [G.donation_tier] or above" + entry += "[english_list(requiredtier)]" + // [/SIERRA-ADD] + entry += "" if(ticked) entry += "" diff --git a/code/modules/clothing/_clothing.dm b/code/modules/clothing/_clothing.dm index 8d65f3dd8db8d..d16b486ff5fe1 100644 --- a/code/modules/clothing/_clothing.dm +++ b/code/modules/clothing/_clothing.dm @@ -1,8 +1,10 @@ /obj/item/clothing name = "clothing" siemens_coefficient = 0.9 - var/flash_protection = FLASH_PROTECTION_NONE // Sets the item's level of flash protection. - var/tint = TINT_NONE // Sets the item's level of visual impairment tint. + /// Sets the item's level of flash protection. + var/flash_protection = FLASH_PROTECTION_NONE + /// Sets the item's level of visual impairment tint. + var/tint = TINT_NONE var/list/species_restricted = list( "exclude", SPECIES_NABBER @@ -15,8 +17,27 @@ var/ironed_state = WRINKLES_DEFAULT var/smell_state = SMELL_DEFAULT var/volume_multiplier = 1 - - var/move_trail = /obj/decal/cleanable/blood/tracks/footprints // if this item covers the feet, the footprints it should leave + var/hud_type + var/vision_flags = 0 + /// special vision states, such as seeing darkness, seeing mobs through walls, etc + var/darkness_view = 0 + var/see_invisible = -1 + var/light_protection = 0 + /// if the clothing should be disrupted by EMP + var/electric = FALSE + /// used by goggles and HUDs + var/toggleable = FALSE + var/active = TRUE + var/activation_sound + /// set this if you want a sound on deactivation + var/deactivation_sound + /// set these in initialize if you want messages other than about the optical matrix + var/toggle_on_message + var/toggle_off_message + var/off_state = null + + /// if this item covers the feet, the footprints it should leave + var/move_trail = /obj/decal/cleanable/blood/tracks/footprints /obj/item/clothing/Initialize() @@ -25,6 +46,8 @@ accessories = list() for (var/path in init_accessories) attach_accessory(null, new path (src)) + if(toggleable) + set_extension(src, /datum/extension/base_icon_state, icon_state) /obj/item/clothing/Destroy() @@ -260,10 +283,6 @@ BLIND // can't see anything w_class = ITEM_SIZE_SMALL body_parts_covered = EYES slot_flags = SLOT_EYES - var/vision_flags = 0 - var/darkness_view = 0//Base human is 2 - var/see_invisible = -1 - var/light_protection = 0 sprite_sheets = list( SPECIES_VOX = 'icons/mob/species/vox/onmob_eyes_vox.dmi', SPECIES_UNATHI = 'icons/mob/species/unathi/onmob_eyes_unathi.dmi', @@ -275,7 +294,7 @@ BLIND // can't see anything else return icon_state -/obj/item/clothing/glasses/on_update_icon() +/obj/item/clothing/on_update_icon() if (toggleable) if (active) var/datum/extension/base_icon_state/BIS = get_extension(src, /datum/extension/base_icon_state) @@ -285,11 +304,78 @@ BLIND // can't see anything else icon_state = initial(icon_state) -/obj/item/clothing/glasses/update_clothing_icon() +/obj/item/clothing/update_clothing_icon() if (ismob(src.loc)) var/mob/M = src.loc M.update_inv_glasses() +/obj/item/clothing/proc/activate(mob/user) + if (toggleable && !active) + active = TRUE + flash_protection = initial(flash_protection) + tint = initial(tint) + if (user) + user.update_inv_glasses() + user.update_action_buttons() + if (activation_sound) + sound_to(user, activation_sound) + if (toggle_on_message) + to_chat(user, SPAN_NOTICE(toggle_on_message)) + else + to_chat(user, "You activate the optical matrix on \the [src].") + + update_icon() + update_clothing_icon() + update_vision() + +/obj/item/clothing/proc/deactivate(mob/user, manual = TRUE) + if (toggleable && active) + active = FALSE + if (user) + if (manual) + if (toggle_off_message) + to_chat(user, toggle_off_message) + else + to_chat(user, "You deactivate the optical matrix on \the [src].") + if (deactivation_sound) + sound_to(user, deactivation_sound) + user.update_inv_glasses() + user.update_action_buttons() + + flash_protection = FLASH_PROTECTION_NONE + tint = TINT_NONE + update_icon() + update_clothing_icon() + update_vision() + +/obj/item/clothing/emp_act(severity) + if (electric && active) + if (istype(loc, /mob/living/carbon/human)) + var/mob/living/carbon/human/M = loc + if (M.glasses != src) + to_chat(M, SPAN_DANGER("\The [name] malfunction[gender != PLURAL ? "s":""], releasing a small spark.")) + else + M.eye_blind = 2 + M.eye_blurry = 4 + to_chat(M, SPAN_DANGER("\The [name] malfunction[gender != PLURAL ? "s":""], blinding you!")) + // Don't cure being nearsighted + if (!(M.disabilities & NEARSIGHTED)) + M.disabilities |= NEARSIGHTED + spawn(100) + M.disabilities &= ~NEARSIGHTED + if (toggleable) + deactivate(M, FALSE) + ..() + +/obj/item/clothing/inherit_custom_item_data(datum/custom_item/citem) + . = ..() + if (toggleable) + if (citem.additional_data["icon_on"]) + set_icon_state(citem.additional_data["icon_on"]) + if (citem.additional_data["icon_off"]) + off_state = citem.additional_data["icon_off"] + + /////////////////////////////////////////////////////////////////////// //Gloves /obj/item/clothing/gloves @@ -339,7 +425,7 @@ BLIND // can't see anything /obj/item/clothing/gloves/proc/Touch(atom/A, proximity) return 0 // return 1 to cancel attack_hand() -/obj/item/clothing/gloves/attackby(obj/item/W, mob/user) +/obj/item/clothing/gloves/use_tool(obj/item/W, mob/living/user, list/click_params) if (isWirecutter(W) || istype(W, /obj/item/scalpel)) if (clipped) to_chat(user, SPAN_NOTICE("\The [src] have already been modified!")) @@ -660,13 +746,16 @@ BLIND // can't see anything ..() -/obj/item/clothing/shoes/attackby(obj/item/item, mob/living/user) +/obj/item/clothing/shoes/use_tool(obj/item/item, mob/living/user, list/click_params) if (istype(item, /obj/item/handcuffs)) add_cuffs(item, user) + return TRUE else if (istype(item, /obj/item/clothing/shoes/magboots)) user.equip_to_slot_if_possible(item, slot_shoes) - else - add_hidden(item, user) + return TRUE + else if(add_hidden(item, user)) + return TRUE + return ..() /obj/item/clothing/shoes/proc/add_cuffs(obj/item/handcuffs/cuffs, mob/user) @@ -710,22 +799,24 @@ BLIND // can't see anything /obj/item/clothing/shoes/proc/add_hidden(obj/item/I, mob/user) if (!can_add_hidden_item) to_chat(user, SPAN_WARNING("\The [src] can't hold anything.")) - return + return TRUE if (hidden_item) to_chat(user, SPAN_WARNING("\The [src] already holds \an [hidden_item].")) - return + return TRUE if (!(I.item_flags & ITEM_FLAG_CAN_HIDE_IN_SHOES) || (I.slot_flags & SLOT_DENYPOCKET)) to_chat(user, SPAN_WARNING("\The [src] can't hold the [I].")) - return + return TRUE if (I.w_class > hidden_item_max_w_class) to_chat(user, SPAN_WARNING("\The [I] is too large to fit in the [src].")) - return + return TRUE if (do_after(user, 1 SECONDS, src, DO_DEFAULT | DO_BOTH_UNIQUE_ACT)) if(!user.unEquip(I, src)) - return + FEEDBACK_UNEQUIP_FAILURE(user, I) + return TRUE user.visible_message(SPAN_ITALIC("\The [user] shoves \the [I] into \the [src]."), range = 1) verbs |= /obj/item/clothing/shoes/proc/remove_hidden hidden_item = I + return TRUE /obj/item/clothing/shoes/proc/remove_hidden(mob/user) set name = "Remove Shoe Item" @@ -995,16 +1086,17 @@ BLIND // can't see anything return sensor_mode = SUIT_SENSOR_MODES[switchMode] + var/datum/pronouns/pronouns = user.choose_from_pronouns() if (src.loc == user) switch(sensor_mode) if(SUIT_SENSOR_OFF) - user.visible_message("[user] adjusts the tracking sensor on \his [src.name].", "You disable your suit's remote sensing equipment.") + user.visible_message("[user] adjusts the tracking sensor on [pronouns.his] [src.name].", "You disable your suit's remote sensing equipment.") if(SUIT_SENSOR_BINARY) - user.visible_message("[user] adjusts the tracking sensor on \his [src.name].", "Your suit will now report whether you are live or dead.") + user.visible_message("[user] adjusts the tracking sensor on [pronouns.his] [src.name].", "Your suit will now report whether you are live or dead.") if(SUIT_SENSOR_VITAL) - user.visible_message("[user] adjusts the tracking sensor on \his [src.name].", "Your suit will now report your vital lifesigns.") + user.visible_message("[user] adjusts the tracking sensor on [pronouns.his] [src.name].", "Your suit will now report your vital lifesigns.") if(SUIT_SENSOR_TRACKING) - user.visible_message("[user] adjusts the tracking sensor on \his [src.name].", "Your suit will now report your vital lifesigns as well as your coordinate position.") + user.visible_message("[user] adjusts the tracking sensor on [pronouns.his] [src.name].", "Your suit will now report your vital lifesigns as well as your coordinate position.") else if (ismob(src.loc)) if(sensor_mode == SUIT_SENSOR_OFF) diff --git a/code/modules/clothing/clothing_accessories.dm b/code/modules/clothing/clothing_accessories.dm index 29a6be1a8f5c5..aa5fd8e76b4b6 100644 --- a/code/modules/clothing/clothing_accessories.dm +++ b/code/modules/clothing/clothing_accessories.dm @@ -97,7 +97,8 @@ src.verbs |= /obj/item/clothing/proc/remove_all_accessories update_accessory_slowdown() update_clothing_icon() - GLOB.destroyed_event.register(A, src, .proc/accessory_deleted) + update_vision() + GLOB.destroyed_event.register(A, src, PROC_REF(accessory_deleted)) /obj/item/clothing/proc/accessory_deleted(obj/item/clothing/accessory/A) remove_accessory(null, A) @@ -110,7 +111,8 @@ accessories -= A update_accessory_slowdown() update_clothing_icon() - GLOB.destroyed_event.unregister(A, src, .proc/accessory_deleted) + update_vision() + GLOB.destroyed_event.unregister(A, src, PROC_REF(accessory_deleted)) /obj/item/clothing/proc/attempt_attach_accessory(obj/item/I, mob/user) diff --git a/code/modules/clothing/glasses/glasses.dm b/code/modules/clothing/glasses/glasses.dm index 924f011756f5c..49e2ccf5a56f3 100644 --- a/code/modules/clothing/glasses/glasses.dm +++ b/code/modules/clothing/glasses/glasses.dm @@ -5,19 +5,14 @@ SPECIES_VOX = 'icons/mob/species/vox/onmob_eyes_vox.dmi', SPECIES_UNATHI = 'icons/mob/species/unathi/onmob_eyes_unathi.dmi' ) - var/hud_type var/prescription = FALSE - var/toggleable = FALSE - var/off_state = "degoggles" - var/active = TRUE - var/activation_sound = 'sound/items/goggles_charge.ogg' - var/deactivation_sound // set this if you want a sound on deactivation + off_state = "degoggles" + activation_sound = 'sound/items/goggles_charge.ogg' + deactivation_sound = null var/obj/screen/overlay = null var/obj/item/clothing/glasses/hud/hud = null // Hud glasses, if any - var/electric = FALSE //if the glasses should be disrupted by EMP + electric = FALSE //if the glasses should be disrupted by EMP - var/toggle_on_message //set these in initialize if you want messages other than about the optical matrix - var/toggle_off_message /obj/item/clothing/glasses/Initialize() . = ..() @@ -34,63 +29,6 @@ /obj/item/clothing/glasses/needs_vision_update() return ..() || overlay || vision_flags || see_invisible || darkness_view -/obj/item/clothing/glasses/proc/activate(mob/user) - if(toggleable && !active) - active = TRUE - flash_protection = initial(flash_protection) - tint = initial(tint) - if(user) - user.update_inv_glasses() - user.update_action_buttons() - if(activation_sound) - sound_to(user, activation_sound) - if(toggle_on_message) - to_chat(user, toggle_on_message) - else - to_chat(user, "You activate the optical matrix on \the [src].") - - update_icon() - update_clothing_icon() - update_vision() - -/obj/item/clothing/glasses/proc/deactivate(mob/user, manual = TRUE) - if(toggleable && active) - active = FALSE - if(user) - if(manual) - if(toggle_off_message) - to_chat(user, toggle_off_message) - else - to_chat(user, "You deactivate the optical matrix on \the [src].") - if(deactivation_sound) - sound_to(user, deactivation_sound) - user.update_inv_glasses() - user.update_action_buttons() - - flash_protection = FLASH_PROTECTION_NONE - tint = TINT_NONE - update_icon() - update_clothing_icon() - update_vision() - -/obj/item/clothing/glasses/emp_act(severity) - if(electric && active) - if(istype(src.loc, /mob/living/carbon/human)) - var/mob/living/carbon/human/M = src.loc - if(M.glasses != src) - to_chat(M, SPAN_DANGER("\The [name] malfunction[gender != PLURAL ? "s":""], releasing a small spark.")) - else - M.eye_blind = 2 - M.eye_blurry = 4 - to_chat(M, SPAN_DANGER("\The [name] malfunction[gender != PLURAL ? "s":""], blinding you!")) - // Don't cure being nearsighted - if(!(M.disabilities & NEARSIGHTED)) - M.disabilities |= NEARSIGHTED - spawn(100) - M.disabilities &= ~NEARSIGHTED - if(toggleable) - deactivate(M, FALSE) - ..() /obj/item/clothing/glasses/attack_self(mob/user) if(toggleable && !user.incapacitated()) @@ -99,14 +37,6 @@ else activate(user) -/obj/item/clothing/glasses/inherit_custom_item_data(datum/custom_item/citem) - . = ..() - if(toggleable) - if(citem.additional_data["icon_on"]) - set_icon_state(citem.additional_data["icon_on"]) - if(citem.additional_data["icon_off"]) - off_state = citem.additional_data["icon_off"] - /obj/item/clothing/glasses/meson name = "meson goggles" desc = "Used for seeing walls, floors, and stuff through anything." @@ -124,8 +54,92 @@ . = ..() overlay = GLOB.global_hud.meson +/obj/item/clothing/glasses/ballistic + name = "ballistic goggles" + desc = "A pair of goggles designed to protect the wearer's eyes from shrapnel." + icon_state = "ballistic" + origin_tech = list(TECH_COMBAT = 2) + siemens_coefficient = 0.6 + armor = list( + melee = ARMOR_MELEE_SMALL, + bullet = ARMOR_BALLISTIC_SMALL, + bomb = ARMOR_BOMB_MINOR + ) + action_button_name = "Toggle Attachments" + valid_accessory_slots = list(ACCESSORY_SLOT_VISION, ACCESSORY_SLOT_HUD) + restricted_accessory_slots = list(ACCESSORY_SLOT_VISION, ACCESSORY_SLOT_HUD) + var/toggle_mods = list() + +/obj/item/clothing/glasses/ballistic/Initialize() + . = ..() + count_toggle_mods() + +/obj/item/clothing/glasses/ballistic/attach_accessory(mob/user, obj/item/clothing/accessory/A) + . = ..() + if(A.toggleable) + toggle_mods += A + +/obj/item/clothing/glasses/ballistic/remove_accessory(mob/user, obj/item/clothing/accessory/A) + . = ..() + if(A.toggleable) + toggle_mods -= A + +/obj/item/clothing/glasses/ballistic/proc/count_toggle_mods() + toggle_mods = list() + for (var/obj/item/clothing/accessory/glassesmod/mod in accessories) + if(mod.toggleable) + toggle_mods += mod + + +/obj/item/clothing/glasses/ballistic/attack_self(mob/user) + if(!user.incapacitated()) + var/obj/item/clothing/accessory/glassesmod/choice = null + if (length(toggle_mods) == 1) + choice = toggle_mods[1] + else if(length(toggle_mods) <= 0) + return + else + input(user, "Toggle which accessory?", "Attachment selection") as null|anything in toggle_mods + if (choice.active) + choice.deactivate(user) + else + choice.activate(user) + update_vision() + + +/obj/item/clothing/glasses/ballistic/prescription + name = "prescription ballistic goggles" + desc = "A pair of goggles designed to protect the wearer's eyes from shrapnel. This set has corrective lenses." + prescription = 5 + + +/obj/item/clothing/glasses/ballistic/fake + name = "budget ballistic goggles" + desc = "A pair of goggles that probably won't protect the wearer's eyes from shrapnel. At least they make you feel more tacticool." + origin_tech = null + armor = null + +/obj/item/clothing/glasses/ballistic/fake/prescription + name = "budget ballistic goggles" + desc = "A pair of goggles that probably won't protect the wearer's eyes from shrapnel. At least they make you feel more tacticool. This set has corrective lenses." + origin_tech = null + armor = null + prescription = 5 + + +/obj/item/clothing/glasses/ballistic/security + accessories = list( + /obj/item/clothing/accessory/glassesmod/vision/polarized, + /obj/item/clothing/accessory/glassesmod/hud/security + ) + +/obj/item/clothing/glasses/ballistic/medic + accessories = list(/obj/item/clothing/accessory/glassesmod/hud/medical) + +/obj/item/clothing/glasses/ballistic/engi + accessories = list(/obj/item/clothing/accessory/glassesmod/vision/welding) + /obj/item/clothing/glasses/meson/prescription - name = "meson goggles" desc = "Used for seeing walls, floors, and stuff through anything. This set has corrective lenses." prescription = 5 @@ -136,6 +150,10 @@ off_state = "avi_off" item_state = "meson_avi_on" +/obj/item/clothing/glasses/meson/aviators/prescription + prescription = 5 + desc = "A meson HUD integrated into a pair of aviator sunglasses. These ones have eyesight-correcting lenses." + /obj/item/clothing/glasses/science name = "science goggles" desc = "Goggles fitted with a portable analyzer capable of determining the fabricator training potential of an item or components of a machine. Sensitive to EMP." @@ -271,14 +289,16 @@ icon_state = "rwelding-g" item_state = "rwelding-g" tint = TINT_MODERATE + flash_protection = FLASH_PROTECTION_MAJOR /obj/item/clothing/glasses/glare_dampeners name = "glare dampeners" desc = "Synthetic lenses over the eyes, protecting from bright lights." icon_state = "welding-g" item_state = "welding-g" + tint = TINT_HEAVY use_alt_layer = TRUE - flash_protection = FLASH_PROTECTION_MODERATE + flash_protection = FLASH_PROTECTION_MAJOR darkness_view = -1 /obj/item/clothing/glasses/augment_binoculars diff --git a/code/modules/clothing/glasses/hud.dm b/code/modules/clothing/glasses/hud.dm index 538a15916eeda..d14ffb50bf49a 100644 --- a/code/modules/clothing/glasses/hud.dm +++ b/code/modules/clothing/glasses/hud.dm @@ -51,6 +51,10 @@ off_state = "avi_off" item_state = "health_avi_on" +/obj/item/clothing/glasses/hud/health/aviators/prescription + prescription = 5 + desc = "A medical HUD integrated into a pair of aviator sunglasses. These ones have eyesight-correcting lenses." + /obj/item/clothing/glasses/hud/health/goggle name = "medical HUD visor" desc = "A medical HUD integrated with a wide visor." @@ -152,6 +156,10 @@ off_state = "avi_off" item_state = "jani_avi_on" +/obj/item/clothing/glasses/hud/janitor/aviators/prescription + prescription = 5 + desc = "A janitorial HUD integrated into a pair of aviator sunglasses. These ones have eyesight-correcting lenses." + /obj/item/clothing/glasses/hud/janitor/process_hud(mob/M) process_jani_hud(M) @@ -176,4 +184,8 @@ desc = "A scientific HUD integrated into a pair of aviator sunglasses. It does little to protect against the sun, but it sure looks cool." icon_state = "sci_avi_on" off_state = "avi_off" - item_state = "sci_avi_on" \ No newline at end of file + item_state = "sci_avi_on" + +/obj/item/clothing/glasses/hud/science/aviators/prescription + prescription = 5 + desc = "A scientific HUD integrated into a pair of aviator sunglasses. These ones have eyesight-correcting lenses." diff --git a/code/modules/clothing/gloves/boxing.dm b/code/modules/clothing/gloves/boxing.dm index 8497ebbf56d7c..9515fc2753a7d 100644 --- a/code/modules/clothing/gloves/boxing.dm +++ b/code/modules/clothing/gloves/boxing.dm @@ -4,11 +4,11 @@ icon_state = "boxing" item_state = "boxing" -/obj/item/clothing/gloves/boxing/attackby(obj/item/W, mob/user) +/obj/item/clothing/gloves/boxing/use_tool(obj/item/W, mob/living/user, list/click_params) if(isWirecutter(W) || istype(W, /obj/item/scalpel)) - to_chat(user, SPAN_NOTICE("That won't work."))//Nope - else - ..() + to_chat(user, SPAN_WARNING("That won't work.")) + return TRUE + return ..() /obj/item/clothing/gloves/boxing/green icon_state = "boxinggreen" diff --git a/code/modules/clothing/head/helmet.dm b/code/modules/clothing/head/helmet.dm index 8b5af3b19b12f..503055e61b636 100644 --- a/code/modules/clothing/head/helmet.dm +++ b/code/modules/clothing/head/helmet.dm @@ -6,8 +6,8 @@ slot_l_hand_str = "helmet", slot_r_hand_str = "helmet", ) - valid_accessory_slots = list(ACCESSORY_SLOT_HELM_C, ACCESSORY_SLOT_HELM_D) - restricted_accessory_slots = list(ACCESSORY_SLOT_HELM_C, ACCESSORY_SLOT_HELM_D) + valid_accessory_slots = list(ACCESSORY_SLOT_HELM_C, ACCESSORY_SLOT_HELM_D, ACCESSORY_SLOT_VISOR) + restricted_accessory_slots = list(ACCESSORY_SLOT_HELM_C, ACCESSORY_SLOT_HELM_D, ACCESSORY_SLOT_VISOR) item_flags = ITEM_FLAG_THICKMATERIAL body_parts_covered = HEAD armor = list( @@ -26,6 +26,32 @@ w_class = ITEM_SIZE_NORMAL species_restricted = list("exclude", SPECIES_NABBER, SPECIES_ADHERENT) +/obj/item/clothing/head/helmet/needs_vision_update() + for(var/obj/item/clothing/accessory/glassesmod/visor in accessories) + return TRUE + . = ..() + +/obj/item/clothing/head/helmet/verb/toggle_visor() + + set name = "Toggle Helmet Attachments" + set category = "Object" + set src in usr + + if (!istype(loc,/mob/living)) + return + + var/toggled = FALSE + if (!usr.incapacitated()) + for (var/obj/item/clothing/accessory/glassesmod/mod in accessories) + if (mod.active) + mod.deactivate(usr) + else + mod.activate(usr) + toggled = TRUE + if (!toggled) + to_chat(usr, SPAN_CLASS("danger", "You do not have a visor attached to your helmet!")) + + /obj/item/clothing/head/helmet/nt name = "corporate security helmet" desc = "A helmet with 'CORPORATE SECURITY' printed on the back in red lettering." @@ -92,7 +118,7 @@ name = "ablative helmet" desc = "A helmet made from advanced materials which protects against concentrated energy weapons." icon_state = "helmet_reflect" - valid_accessory_slots = null + valid_accessory_slots = list(ACCESSORY_SLOT_VISOR) armor = list( melee = ARMOR_MELEE_SMALL, bullet = ARMOR_BALLISTIC_MINOR, @@ -105,7 +131,7 @@ name = "ballistic helmet" desc = "A helmet with reinforced plating to protect against ballistic projectiles." icon_state = "helmet_bulletproof" - valid_accessory_slots = null + valid_accessory_slots = list(ACCESSORY_SLOT_VISOR) armor = list( melee = ARMOR_MELEE_MINOR, bullet = ARMOR_BALLISTIC_AP, @@ -125,7 +151,7 @@ energy = ARMOR_ENERGY_RESISTANT, bomb = ARMOR_BOMB_PADDED ) - valid_accessory_slots = null + valid_accessory_slots = list(ACCESSORY_SLOT_VISOR) cold_protection = HEAD min_cold_protection_temperature = SPACE_HELMET_MIN_COLD_PROTECTION_TEMPERATURE siemens_coefficient = 0.5 @@ -262,3 +288,34 @@ rad = ARMOR_RAD_SMALL ) species_restricted = list(SPECIES_HUMAN) + +/obj/item/clothing/head/helmet/nvgmount + name = "model helmet" + desc = "A lightweight helmet made of cheap plastic, sporting fiducial marking stickers on either side. You doubt it will provide much protection." + icon_state = "nvgmount" + valid_accessory_slots = list(ACCESSORY_SLOT_VISOR, ACCESSORY_SLOT_HELM_D) + restricted_accessory_slots = list(ACCESSORY_SLOT_VISOR, ACCESSORY_SLOT_HELM_D) + armor = list( + melee = ARMOR_MELEE_MINOR, + ) + +/obj/item/clothing/head/helmet/nvgmount/nvg + accessories = list(/obj/item/clothing/accessory/glassesmod/nvg) + +/obj/item/clothing/head/helmet/nvgmount/thermal + accessories = list(/obj/item/clothing/accessory/glassesmod/thermal) + +/obj/item/clothing/head/helmet/old_commonwealth + name = "old army helmet" + desc = "A worn helmet that appears to have been the property of some spacefaring armed force, many years ago." + accessories = list(/obj/item/clothing/accessory/helmet_cover/green, /obj/item/clothing/accessory/glassesmod/nvg) + +/obj/item/clothing/head/helmet/old_confederation + name = "old army helmet" + desc = "A worn helmet that appears to have been the property of some spacefaring armed force, many years ago." + accessories = list(/obj/item/clothing/accessory/helmet_cover/tan, /obj/item/clothing/accessory/glassesmod/nvg) + +/obj/item/clothing/head/helmet/old_special_ops + name = "old army helmet" + desc = "A worn helmet that appears to have been the property of some spacefaring armed force, many years ago." + accessories = list(/obj/item/clothing/accessory/glassesmod/thermal) diff --git a/code/modules/clothing/masks/cig_crafting.dm b/code/modules/clothing/masks/cig_crafting.dm index 4fd8d14c4b1b4..33da9bd4d51fd 100644 --- a/code/modules/clothing/masks/cig_crafting.dm +++ b/code/modules/clothing/masks/cig_crafting.dm @@ -56,14 +56,14 @@ /obj/item/reagent_containers/food/snacks/grown/dried_tobacco/fine plantname = "finetobacco" -/obj/item/clothing/mask/smokable/cigarette/rolled/attackby(obj/item/I, mob/user) +/obj/item/clothing/mask/smokable/cigarette/rolled/use_tool(obj/item/I, mob/living/user, list/click_params) if(istype(I, /obj/item/paper/cig/filter)) if(filter) - to_chat(user, SPAN_WARNING("[src] already has a filter!")) - return + to_chat(user, SPAN_WARNING("\The [src] already has a filter!")) + return TRUE if(lit) - to_chat(user, SPAN_WARNING("[src] is lit already!")) - return + to_chat(user, SPAN_WARNING("\The [src] is already lit!")) + return TRUE if(user.unEquip(I)) to_chat(user, SPAN_NOTICE("You stick [I] onto \the [src].")) filter = 1 @@ -71,14 +71,14 @@ brand = "[brand] with a filter" update_icon() qdel(I) - return - ..() + return TRUE + return ..() -/obj/item/reagent_containers/food/snacks/grown/attackby(obj/item/I, mob/user) +/obj/item/reagent_containers/food/snacks/grown/use_tool(obj/item/I, mob/living/user, list/click_params) if(is_type_in_list(I, list(/obj/item/paper/cig, /obj/item/paper, /obj/item/teleportation_scroll))) if(!dry) - to_chat(user, SPAN_WARNING("You need to dry [src] first!")) - return + to_chat(user, SPAN_WARNING("You need to dry \the [src] first!")) + return TRUE if(user.unEquip(I)) var/obj/item/clothing/mask/smokable/cigarette/rolled/R = new(get_turf(src)) R.chem_volume = reagents.total_volume @@ -88,5 +88,5 @@ user.put_in_active_hand(R) qdel(I) qdel(src) - return - ..() + return TRUE + return ..() diff --git a/code/modules/clothing/masks/miscellaneous.dm b/code/modules/clothing/masks/miscellaneous.dm index 7082f705d8e75..f0aaa9d390777 100644 --- a/code/modules/clothing/masks/miscellaneous.dm +++ b/code/modules/clothing/masks/miscellaneous.dm @@ -100,7 +100,7 @@ body_parts_covered = FACE|EYES action_button_name = "Toggle MUI" origin_tech = list(TECH_DATA = 5, TECH_ENGINEERING = 5) - var/active = FALSE + active = FALSE var/mob/observer/eye/cameranet/eye /obj/item/clothing/mask/ai/New() diff --git a/code/modules/clothing/masks/smokable.dm b/code/modules/clothing/masks/smokable.dm index 080b8fcf9d637..6883b7c06d9e8 100644 --- a/code/modules/clothing/masks/smokable.dm +++ b/code/modules/clothing/masks/smokable.dm @@ -140,8 +140,7 @@ set_light(0) update_icon() -/obj/item/clothing/mask/smokable/attackby(obj/item/W, mob/user) - ..() +/obj/item/clothing/mask/smokable/use_tool(obj/item/W, mob/living/user, list/click_params) if (isFlameOrHeatSource(W)) var/text = matchmes if(istype(W, /obj/item/flame/match)) @@ -160,6 +159,7 @@ text = replacetext(text, "NAME", "[name]") text = replacetext(text, "FLAME", "[W.name]") light(text) + return ..() /obj/item/clothing/mask/smokable/use_before(mob/living/M, mob/living/user) . = FALSE @@ -321,15 +321,14 @@ icon_state = "woodbutt" matter = list(MATERIAL_WOOD = 1) -/obj/item/clothing/mask/smokable/cigarette/attackby(obj/item/W, mob/user) - ..() - +/obj/item/clothing/mask/smokable/cigarette/use_tool(obj/item/W, mob/living/user, list/click_params) if(istype(W, /obj/item/melee/energy/sword)) var/obj/item/melee/energy/sword/S = W if(S.active) light(SPAN_WARNING("[user] swings their [W], barely missing their nose. They light their [name] in the process.")) + return TRUE - return + return ..() /obj/item/clothing/mask/smokable/cigarette/use_before(mob/living/carbon/human/H, mob/user) if (lit && H == user && istype(H)) @@ -435,12 +434,11 @@ desc = "A manky old cigar butt." icon_state = "cigarbutt" -/obj/item/clothing/mask/smokable/cigarette/cigar/attackby(obj/item/W, mob/user) - ..() - +/obj/item/clothing/mask/smokable/cigarette/cigar/use_tool(obj/item/W, mob/living/user, list/click_params) user.update_inv_wear_mask(0) user.update_inv_l_hand(0) user.update_inv_r_hand(1) + return ..() //Bizarre /obj/item/clothing/mask/smokable/cigarette/rolled/sausage @@ -526,43 +524,54 @@ reagents.clear_reagents() SetName("empty [initial(name)]") -/obj/item/clothing/mask/smokable/pipe/attackby(obj/item/W, mob/user) +/obj/item/clothing/mask/smokable/pipe/use_tool(obj/item/W, mob/living/user, list/click_params) if(istype(W, /obj/item/melee/energy/sword)) - return - - ..() + return ..() if (istype(W, /obj/item/reagent_containers/food/snacks)) var/obj/item/reagent_containers/food/snacks/grown/G = W if (!G.dry) - to_chat(user, SPAN_NOTICE("[G] must be dried before you stuff it into [src].")) - return + to_chat(user, SPAN_WARNING("\The [G] must be dried before you stuff it into \the [src].")) + return TRUE if (smoketime) - to_chat(user, SPAN_NOTICE("[src] is already packed.")) - return + to_chat(user, SPAN_WARNING("\The [src] is already packed.")) + return TRUE smoketime = 1000 if(G.reagents) G.reagents.trans_to_obj(src, G.reagents.total_volume) SetName("[G.name]-packed [initial(name)]") qdel(G) + user.update_inv_wear_mask(0) + user.update_inv_l_hand(0) + user.update_inv_r_hand(1) + return TRUE else if(istype(W, /obj/item/flame/lighter)) var/obj/item/flame/lighter/L = W if(L.lit) - light(SPAN_NOTICE("[user] manages to light their [name] with [W].")) + light(SPAN_NOTICE("\The [user] manages to light their \the [name] with \the [W].")) + user.update_inv_wear_mask(0) + user.update_inv_l_hand(0) + user.update_inv_r_hand(1) + return TRUE else if(istype(W, /obj/item/flame/match)) var/obj/item/flame/match/M = W if(M.lit) - light(SPAN_NOTICE("[user] lights their [name] with their [W].")) + light(SPAN_NOTICE("\The [user] lights their \the [name] with their \the [W].")) + user.update_inv_wear_mask(0) + user.update_inv_l_hand(0) + user.update_inv_r_hand(1) + return TRUE else if(istype(W, /obj/item/device/assembly/igniter)) - light(SPAN_NOTICE("[user] fiddles with [W], and manages to light their [name] with the power of science.")) - - user.update_inv_wear_mask(0) - user.update_inv_l_hand(0) - user.update_inv_r_hand(1) + light(SPAN_NOTICE("\The [user] fiddles with \the [W], and manages to light their \the [name] with the power of science.")) + user.update_inv_wear_mask(0) + user.update_inv_l_hand(0) + user.update_inv_r_hand(1) + return TRUE + return ..() /obj/item/clothing/mask/smokable/pipe/IsFlameSource() return FALSE diff --git a/code/modules/clothing/rings/material.dm b/code/modules/clothing/rings/material.dm index 5b6a39a18ebc2..b96b6f12fb674 100644 --- a/code/modules/clothing/rings/material.dm +++ b/code/modules/clothing/rings/material.dm @@ -17,16 +17,18 @@ desc = "A ring made from [material.display_name]." color = material.icon_colour -/obj/item/clothing/ring/material/attackby(obj/item/S, mob/user) +/obj/item/clothing/ring/material/use_tool(obj/item/S, mob/living/user, list/click_params) if(S.sharp) var/inscription = sanitize(input("Enter an inscription to engrave.", "Inscription") as null|text) if(!user.stat && !user.incapacitated() && user.Adjacent(src) && S.loc == user) if(!inscription) - return + return TRUE desc = "A ring made from [material.display_name]." to_chat(user, SPAN_WARNING("You carve \"[inscription]\" into \the [src].")) desc += "
Written on \the [src] is the inscription \"[inscription]\"" + return TRUE + return ..() /obj/item/clothing/ring/material/OnTopic(mob/user, list/href_list) if(href_list["examine"]) diff --git a/code/modules/clothing/shoes/jobs.dm b/code/modules/clothing/shoes/jobs.dm index 7d3fdacc55fa2..c25ae65cc39e0 100644 --- a/code/modules/clothing/shoes/jobs.dm +++ b/code/modules/clothing/shoes/jobs.dm @@ -17,10 +17,10 @@ item_state = "jackboots" force = 3 armor = list( - melee = ARMOR_MELEE_RESISTANT, - bullet = ARMOR_BALLISTIC_MINOR, - laser = ARMOR_LASER_MINOR, - energy = ARMOR_ENERGY_MINOR, + melee = ARMOR_MELEE_RESISTANT, + bullet = ARMOR_BALLISTIC_MINOR, + laser = ARMOR_LASER_MINOR, + energy = ARMOR_ENERGY_MINOR, bomb = ARMOR_BOMB_PADDED ) siemens_coefficient = 0.7 @@ -45,10 +45,11 @@ desc = "A pair of steel-toed work boots designed for use in industrial settings. Safety first." icon_state = "workboots" item_state = "workboots" + item_flags = ITEM_FLAG_WASHER_ALLOWED | ITEM_FLAG_THICKMATERIAL armor = list( - melee = ARMOR_MELEE_RESISTANT, - laser = ARMOR_LASER_MINOR, - energy = ARMOR_ENERGY_SMALL, + melee = ARMOR_MELEE_RESISTANT, + laser = ARMOR_LASER_MINOR, + energy = ARMOR_ENERGY_SMALL, bomb = ARMOR_BOMB_PADDED ) siemens_coefficient = 0.7 @@ -63,4 +64,5 @@ name = "toe-less workboots" desc = "A pair of toeless work boots designed for use in industrial settings. Modified for species whose toes have claws." icon_state = "workbootstoeless" - species_restricted = null \ No newline at end of file + species_restricted = null + item_flags = ITEM_FLAG_WASHER_ALLOWED diff --git a/code/modules/clothing/shoes/magboots.dm b/code/modules/clothing/shoes/magboots.dm index 780d999908f86..fff5ae678ddc8 100644 --- a/code/modules/clothing/shoes/magboots.dm +++ b/code/modules/clothing/shoes/magboots.dm @@ -3,7 +3,7 @@ desc = "Magnetic boots, often used during extravehicular activity to ensure the user remains safely attached to the vehicle. They're large enough to be worn over other footwear." name = "magboots" icon_state = "magboots0" - item_flags = null + item_flags = ITEM_FLAG_THICKMATERIAL species_restricted = null force = 3 overshoes = 1 diff --git a/code/modules/clothing/shoes/miscellaneous.dm b/code/modules/clothing/shoes/miscellaneous.dm index 4c80c545cd8b5..58ba38441af1b 100644 --- a/code/modules/clothing/shoes/miscellaneous.dm +++ b/code/modules/clothing/shoes/miscellaneous.dm @@ -4,7 +4,7 @@ icon_state = "brown" item_state = "brown" permeability_coefficient = 0.05 - item_flags = ITEM_FLAG_NOSLIP + item_flags = ITEM_FLAG_NOSLIP | ITEM_FLAG_THICKMATERIAL origin_tech = list(TECH_ESOTERIC = 3) var/list/clothing_choices = list() siemens_coefficient = 0.8 @@ -31,7 +31,7 @@ item_flags = ITEM_FLAG_NOSLIP | ITEM_FLAG_WASHER_ALLOWED siemens_coefficient = 0.6 -/obj/item/clothing/shoes/combat //Basically SWAT shoes combined with galoshes. +/obj/item/clothing/shoes/combat name = "combat boots" desc = "When you REALLY want to turn up the heat." icon_state = "swat" @@ -44,7 +44,7 @@ bomb = ARMOR_BOMB_RESISTANT, bio = ARMOR_BIO_MINOR ) - item_flags = ITEM_FLAG_NOSLIP | ITEM_FLAG_WASHER_ALLOWED + item_flags = ITEM_FLAG_NOSLIP | ITEM_FLAG_WASHER_ALLOWED | ITEM_FLAG_THICKMATERIAL siemens_coefficient = 0.6 cold_protection = FEET diff --git a/code/modules/clothing/spacesuits/breaches.dm b/code/modules/clothing/spacesuits/breaches.dm index 9650607935e5a..761cc72c46e38 100644 --- a/code/modules/clothing/spacesuits/breaches.dm +++ b/code/modules/clothing/spacesuits/breaches.dm @@ -182,7 +182,7 @@ //Handles repairs (and also upgrades). -/obj/item/clothing/suit/space/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/clothing/suit/space/use_tool(obj/item/W, mob/living/user, list/click_params) if(istype(W,/obj/item/stack/material)) var/repair_power = 0 switch(W.get_material_name()) @@ -192,42 +192,42 @@ repair_power = 1 if(!repair_power) - return + return ..() if(istype(loc,/mob/living/carbon/human)) var/mob/living/carbon/human/H = loc if(H.wear_suit == src) to_chat(user, SPAN_WARNING("You cannot repair \the [src] while it is being worn.")) - return + return TRUE if(burn_damage <= 0) - to_chat(user, "There is no surface damage on \the [src] to repair.") //maybe change the descriptor to more obvious? idk what - return + to_chat(user, SPAN_WARNING("There is no surface damage on \the [src] to repair.")) + return TRUE var/obj/item/stack/P = W var/use_amt = min(P.get_amount(), 3) if(use_amt && P.use(use_amt)) repair_breaches(DAMAGE_BURN, use_amt * repair_power, user) - return + return TRUE else if(isWelder(W)) - if(istype(loc,/mob/living/carbon/human)) var/mob/living/carbon/human/H = loc if(H.wear_suit == src) to_chat(user, SPAN_WARNING("You cannot repair \the [src] while it is being worn.")) - return + return TRUE if (brute_damage <= 0) to_chat(user, "There is no structural damage on \the [src] to repair.") - return + return TRUE var/obj/item/weldingtool/WT = W - if(!WT.remove_fuel(5)) - return + if(!WT.can_use(5, user, "repair \the [src].")) + return TRUE + WT.remove_fuel(5) repair_breaches(DAMAGE_BRUTE, 3, user) - return + return TRUE else if(istype(W, /obj/item/tape_roll)) var/datum/breach/target_breach //Target the largest unpatched breach. @@ -242,7 +242,7 @@ else playsound(src, 'sound/effects/tape.ogg',25) var/mob/living/carbon/human/H = user - if(!istype(H)) return + if(!istype(H)) return ..() var/is_worn = istype(loc, /mob/living) if(do_after(user, (H.wear_suit == src ? 6 : 3) SECONDS, is_worn ? loc : src, is_worn ? DO_DEFAULT | DO_USER_UNIQUE_ACT | DO_PUBLIC_PROGRESS : DO_PUBLIC_UNIQUE)) //Sealing a breach on your own suit is awkward and time consuming user.visible_message( @@ -252,9 +252,9 @@ target_breach.patched = TRUE target_breach.update_descriptor() calc_breach_damage() - return + return TRUE - ..() + return ..() /obj/item/clothing/suit/space/examine(mob/user) . = ..() diff --git a/code/modules/clothing/spacesuits/rig/modules/combat.dm b/code/modules/clothing/spacesuits/rig/modules/combat.dm index f35192cd57418..65af9db2271ed 100644 --- a/code/modules/clothing/spacesuits/rig/modules/combat.dm +++ b/code/modules/clothing/spacesuits/rig/modules/combat.dm @@ -343,7 +343,7 @@ laser.Fire(target,holder.wearer) return 1 else - var/resolved = target.attackby(laser,holder.wearer) + var/resolved = laser.resolve_attackby(target, holder.wearer) if(!resolved && laser && target) laser.afterattack(target,holder.wearer,1) return 1 diff --git a/code/modules/clothing/spacesuits/rig/modules/computer.dm b/code/modules/clothing/spacesuits/rig/modules/computer.dm index 0af9263b8607e..4452cdb05ec6e 100644 --- a/code/modules/clothing/spacesuits/rig/modules/computer.dm +++ b/code/modules/clothing/spacesuits/rig/modules/computer.dm @@ -96,7 +96,7 @@ return 0 // Since we've explicitly checked for three types, this should be safe. - input_device.attackby(card,user) + input_device.use_tool(card,user) // If the transfer failed we can delete the card. if(locate(/mob/living/silicon/ai) in card) @@ -110,7 +110,7 @@ if(istype(input_device,/obj/item/aicard)) // We are carding the AI in our suit. if(integrated_ai) - integrated_ai.attackby(input_device,user) + integrated_ai.use_tool(input_device,user) // If the transfer was successful, we can clear out our vars. if(integrated_ai.loc != src) integrated_ai = null @@ -125,7 +125,7 @@ // Okay, it wasn't a terminal being touched, check for all the simple insertions. if(input_device.type in list(/obj/item/device/paicard, /obj/item/device/mmi, /obj/item/organ/internal/posibrain)) if(integrated_ai) - integrated_ai.attackby(input_device,user) + integrated_ai.use_tool(input_device,user) // If the transfer was successful, we can clear out our vars. if(integrated_ai.loc != src) integrated_ai = null diff --git a/code/modules/clothing/spacesuits/rig/modules/modules.dm b/code/modules/clothing/spacesuits/rig/modules/modules.dm index 5aab28948de2f..3b21e5c4a85c9 100644 --- a/code/modules/clothing/spacesuits/rig/modules/modules.dm +++ b/code/modules/clothing/spacesuits/rig/modules/modules.dm @@ -66,49 +66,46 @@ if(2) to_chat(user, "It is almost completely destroyed.") -/obj/item/rig_module/attackby(obj/item/W as obj, mob/user as mob) - +/obj/item/rig_module/use_tool(obj/item/W, mob/living/user, list/click_params) if(istype(W,/obj/item/stack/nanopaste)) - if(damage == 0) to_chat(user, "There is no damage to mend.") - return + return TRUE to_chat(user, "You start mending the damaged portions of \the [src]...") if(!do_after(user, 3 SECONDS, src, DO_PUBLIC_UNIQUE) || !W || !src) - return + return TRUE var/obj/item/stack/nanopaste/paste = W damage = 0 - to_chat(user, "You mend the damage to [src] with [W].") + to_chat(user, "You mend the damage to \the [src] with \the [W].") paste.use(1) - return - - else if(isCoil(W)) + return TRUE + if (isCoil(W)) switch(damage) if(0) to_chat(user, "There is no damage to mend.") - return + return TRUE if(2) to_chat(user, "There is no damage that you are capable of mending with such crude tools.") - return + return TRUE var/obj/item/stack/cable_coil/cable = W if(!cable.can_use(5)) to_chat(user, "You need five units of cable to repair \the [src].") - return + return TRUE to_chat(user, "You start mending the damaged portions of \the [src]...") if(!do_after(user, 3 SECONDS, src, DO_PUBLIC_UNIQUE) || !W || !src) - return + return TRUE damage = 1 - to_chat(user, "You mend some of damage to [src] with [W], but you will need more advanced tools to fix it completely.") + to_chat(user, "You mend some of damage to \the [src] with \the [W], but you will need more advanced tools to fix it completely.") cable.use(5) - return - ..() + return TRUE + return ..() /obj/item/rig_module/Initialize() . =..() @@ -286,7 +283,7 @@ else return passive_power_cost -// Called by holder rigsuit attackby() +// Called by holder rigsuit use_tool() // Checks if an item is usable with this module and handles it if it is /obj/item/rig_module/proc/accepts_item(obj/item/input_device) return 0 diff --git a/code/modules/clothing/spacesuits/rig/modules/utility.dm b/code/modules/clothing/spacesuits/rig/modules/utility.dm index af8b0c248d1f4..6ed030bde5c09 100644 --- a/code/modules/clothing/spacesuits/rig/modules/utility.dm +++ b/code/modules/clothing/spacesuits/rig/modules/utility.dm @@ -519,7 +519,7 @@ /obj/item/rig_module/kinetic_module/proc/beamdestroyed() if(beam) - GLOB.destroyed_event.unregister(beam, src, .proc/beamdestroyed) + GLOB.destroyed_event.unregister(beam, src, PROC_REF(beamdestroyed)) beam = null if(locked) if(holder.wearer) @@ -549,7 +549,7 @@ return locked = AM beam = holder.wearer.Beam(BeamTarget = target, icon_state = "r_beam", maxdistance = max_dist, beam_type = /obj/ebeam/warp) - GLOB.destroyed_event.register(beam, src, .proc/beamdestroyed) + GLOB.destroyed_event.register(beam, src, PROC_REF(beamdestroyed)) animate(target,pixel_y= initial(target.pixel_y) - 2,time=1 SECOND, easing = SINE_EASING, flags = ANIMATION_PARALLEL, loop = -1) animate(pixel_y= initial(target.pixel_y) + 2,time=1 SECOND) diff --git a/code/modules/clothing/spacesuits/rig/rig_attackby.dm b/code/modules/clothing/spacesuits/rig/rig_attackby.dm index 0925df025f1b3..5db5737f1f4eb 100644 --- a/code/modules/clothing/spacesuits/rig/rig_attackby.dm +++ b/code/modules/clothing/spacesuits/rig/rig_attackby.dm @@ -1,106 +1,106 @@ -/obj/item/rig/attackby(obj/item/W as obj, mob/user as mob) - - if(!istype(user,/mob/living)) return 0 - +/obj/item/rig/use_tool(obj/item/W, mob/living/user, list/click_params) if(electrified != 0) if(shock(user)) //Handles removing charge from the cell, as well. No need to do that here. - return + return TRUE // Pass repair items on to the chestpiece. if(chest && (istype(W,/obj/item/stack/material) || isWelder(W))) - return chest.attackby(W,user) + return chest.use_tool(W,user) // Lock or unlock the access panel. if(W.GetIdCard()) if(subverted) locked = 0 to_chat(user, SPAN_DANGER("It looks like the locking system has been shorted out.")) - return + return TRUE if(!length(req_access)) locked = 0 to_chat(user, SPAN_DANGER("\The [src] doesn't seem to have a locking mechanism.")) - return + return TRUE if(security_check_enabled && !src.allowed(user)) to_chat(user, SPAN_DANGER("Access denied.")) - return + return TRUE locked = !locked to_chat(user, "You [locked ? "lock" : "unlock"] \the [src] access panel.") - return + return TRUE - else if(isCrowbar(W)) + if (isCrowbar(W)) if(!open && locked) - to_chat(user, "The access panel is locked shut.") - return + to_chat(user, SPAN_WARNING("The access panel is locked shut.")) + return TRUE open = !open to_chat(user, "You [open ? "open" : "close"] the access panel.") - return + return TRUE - else if(isScrewdriver(W)) + if (isScrewdriver(W)) p_open = !p_open to_chat(user, "You [p_open ? "open" : "close"] the wire cover.") + return TRUE // Hacking. - else if(isWirecutter(W) || isMultitool(W)) + if (isWirecutter(W) || isMultitool(W)) if(p_open) wires.Interact(user) else - to_chat(user, "You can't reach the wiring.") - return + to_chat(user, SPAN_WARNING("You can't reach the wiring.")) + return TRUE if(open) - - // Air tank. if(istype(W,/obj/item/tank)) //Todo, some kind of check for suits without integrated air supplies. if(air_supply) - to_chat(user, "\The [src] already has a tank installed.") - return + to_chat(user, SPAN_WARNING("\The [src] already has a tank installed.")) + return TRUE if (istype(W, /obj/item/tank/scrubber)) to_chat(user, SPAN_WARNING("\The [W] is far too large to attach to \the [src].")) - return - - if(!user.unEquip(W)) return + return TRUE + if(!user.unEquip(W)) + FEEDBACK_UNEQUIP_FAILURE(user, W) + return TRUE air_supply = W W.forceMove(src) - to_chat(user, "You slot [W] into [src] and tighten the connecting valve.") - return + to_chat(user, "You slot \the [W] into \the [src] and tighten the connecting valve.") + return TRUE // Check if this is a hardsuit upgrade or a modification. - else if(istype(W,/obj/item/rig_module)) + if (istype(W,/obj/item/rig_module)) var/obj/item/rig_module/mod = W if (!mod.can_install(src, user)) return TRUE to_chat(user, "You begin installing \the [mod] into \the [src].") if(!do_after(user, 4 SECONDS, src, DO_PUBLIC_UNIQUE)) - return + return TRUE if(!user || !W || !mod.can_install(src, user)) - return - if(!user.unEquip(mod)) return + return TRUE + if(!user.unEquip(mod)) + FEEDBACK_UNEQUIP_FAILURE(user, mod) + return TRUE to_chat(user, "You install \the [mod] into \the [src].") LAZYADD(installed_modules, mod) installed_modules |= mod mod.forceMove(src) mod.installed(src) update_icon() - return 1 + return TRUE - else if(!cell && istype(W,/obj/item/cell)) + if (!cell && istype(W,/obj/item/cell)) - if(!user.unEquip(W)) return + if(!user.unEquip(W)) + FEEDBACK_UNEQUIP_FAILURE(user, W) + return TRUE to_chat(user, "You jack \the [W] into \the [src]'s battery mount.") W.forceMove(src) - src.cell = W - return - - else if(isWrench(W)) + cell = W + return TRUE + if (isWrench(W)) var/list/current_mounts = list() if(cell) current_mounts += "cell" if(air_supply) current_mounts += "tank" @@ -109,18 +109,16 @@ if(installed_modules && length(installed_modules)) current_mounts += "system module" var/to_remove = input("Which would you like to modify?") as null|anything in current_mounts if(!to_remove) - return + return TRUE if(istype(src.loc,/mob/living/carbon/human) && to_remove != "cell" && to_remove != "tank") var/mob/living/carbon/human/H = src.loc if(H.back == src) - to_chat(user, "You can't remove an installed device while the hardsuit is being worn.") - return + to_chat(user, SPAN_WARNING("You can't remove an installed device while the hardsuit is being worn.")) + return TRUE switch(to_remove) - if("cell") - if(cell) to_chat(user, "You detach \the [cell] from \the [src]'s battery mount.") for(var/obj/item/rig_module/module in installed_modules) @@ -132,8 +130,8 @@ if("tank") if(!air_supply) - to_chat(user, "There is no tank to remove.") - return + to_chat(user, SPAN_WARNING("There is no tank to remove.")) + return TRUE user.put_in_hands(air_supply) to_chat(user, "You detach and remove \the [air_supply].") @@ -141,8 +139,8 @@ if ("storage") if (!length(chest?.storage?.contents)) - to_chat(user, "There is nothing in the storage to remove.") - return + to_chat(user, SPAN_WARNING("There is nothing in the storage to remove.")) + return TRUE chest.storage.DoQuickEmpty() user.visible_message( SPAN_ITALIC("\The [user] ejects the contents of \a [src]'s storage."), @@ -152,7 +150,6 @@ ) if("system module") - var/list/possible_removals = list() for(var/obj/item/rig_module/module in installed_modules) if(module.permanent) @@ -160,12 +157,12 @@ possible_removals[module.name] = module if(!length(possible_removals)) - to_chat(user, "There are no installed modules to remove.") - return + to_chat(user, SPAN_WARNING("There are no installed modules to remove.")) + return TRUE var/removal_choice = input("Which module would you like to remove?") as null|anything in possible_removals if(!removal_choice) - return + return TRUE var/obj/item/rig_module/removed = possible_removals[removal_choice] to_chat(user, "You detach \the [removed] from \the [src].") @@ -173,8 +170,9 @@ removed.removed() installed_modules -= removed update_icon() + return TRUE - else if(istype(W,/obj/item/stack/nanopaste)) //EMP repair + if (istype(W,/obj/item/stack/nanopaste)) //EMP repair var/obj/item/stack/S = W if(malfunctioning || malfunction_delay) if(S.use(1)) @@ -185,15 +183,14 @@ to_chat(user, "\The [S] is empty!") else to_chat(user, "You don't see any use for \the [S].") - - return + return TRUE // If we've gotten this far, all we have left to do before we pass off to root procs // is check if any of the loaded modules want to use the item we've been given. for(var/obj/item/rig_module/module in installed_modules) if(module.accepts_item(W,user)) //Item is handled in this proc - return - ..() + return TRUE + return ..() /obj/item/rig/attack_hand(mob/user) diff --git a/code/modules/clothing/spacesuits/rig/suits/station.dm b/code/modules/clothing/spacesuits/rig/suits/station.dm index 7b06fbf0712d5..81f1d6df3e2f0 100644 --- a/code/modules/clothing/spacesuits/rig/suits/station.dm +++ b/code/modules/clothing/spacesuits/rig/suits/station.dm @@ -503,4 +503,3 @@ //Do not further append if current state already indicates gender if(user.gender == FEMALE && !findtext(chest.icon_state,"_f", -2)) chest.icon_state = "[chest.icon_state]_f" - chest.update_icon(1) diff --git a/code/modules/clothing/spacesuits/void/misc.dm b/code/modules/clothing/spacesuits/void/misc.dm index 92e6674aa9e52..90c21b68f7c86 100644 --- a/code/modules/clothing/spacesuits/void/misc.dm +++ b/code/modules/clothing/spacesuits/void/misc.dm @@ -31,6 +31,8 @@ rad = ARMOR_RAD_SHIELDED ) max_heat_protection_temperature = SPACE_SUIT_MAX_HEAT_PROTECTION_TEMPERATURE + valid_accessory_slots = null + restricted_accessory_slots = null species_restricted = list(SPECIES_SKRELL,SPECIES_HUMAN) /obj/item/clothing/head/helmet/space/void/skrell/white diff --git a/code/modules/clothing/spacesuits/void/station.dm b/code/modules/clothing/spacesuits/void/station.dm index 33e385884f9bb..084282964818c 100644 --- a/code/modules/clothing/spacesuits/void/station.dm +++ b/code/modules/clothing/spacesuits/void/station.dm @@ -492,6 +492,8 @@ rad = ARMOR_RAD_SHIELDED ) light_overlay = "helmet_light_alt" + valid_accessory_slots = null + restricted_accessory_slots = null /obj/item/clothing/suit/space/void/retro/prepared helmet = /obj/item/clothing/head/helmet/space/void/retro diff --git a/code/modules/clothing/spacesuits/void/void.dm b/code/modules/clothing/spacesuits/void/void.dm index e00a8a4bb3277..f63c9977d1182 100644 --- a/code/modules/clothing/spacesuits/void/void.dm +++ b/code/modules/clothing/spacesuits/void/void.dm @@ -31,6 +31,8 @@ ) light_overlay = "helmet_light" + valid_accessory_slots = list(ACCESSORY_SLOT_VISOR) + restricted_accessory_slots = list(ACCESSORY_SLOT_VISOR) /obj/item/clothing/suit/space/void name = "voidsuit" @@ -234,21 +236,18 @@ else if(##equipment_var) {\ src.tank = null playsound(loc, 'sound/effects/spray3.ogg', 50) -/obj/item/clothing/suit/space/void/attackby(obj/item/W as obj, mob/user as mob) - - if(!istype(user,/mob/living)) return - +/obj/item/clothing/suit/space/void/use_tool(obj/item/W, mob/living/user, list/click_params) if(istype(W,/obj/item/clothing/accessory) || istype(W, /obj/item/hand_labeler)) return ..() if (isScrewdriver(W)) if(user.get_inventory_slot(src) == slot_wear_suit)//maybe I should make this into a proc? to_chat(user, SPAN_WARNING("You cannot modify \the [src] while it is being worn.")) - return + return TRUE if(helmet || boots || tank) var/choice = input("What component would you like to remove?") as null|anything in list(helmet,boots,tank) - if(!choice) return + if(!choice) return TRUE playsound(loc, 'sound/items/Screwdriver.ogg', 50) if(choice == tank) //No, a switch doesn't work here. Sorry. ~Techhead @@ -263,54 +262,62 @@ else if(##equipment_var) {\ to_chat(user, "You detatch \the [boots] from \the [src]'s boot mounts.") user.put_in_hands(boots) src.boots = null + return TRUE else to_chat(user, "\The [src] does not have anything installed.") - return + return TRUE + else if(istype(W,/obj/item/clothing/head/helmet/space)) if(user.get_inventory_slot(src) == slot_wear_suit) to_chat(user, SPAN_WARNING("You cannot modify \the [src] while it is being worn.")) - return + return TRUE if(helmet) to_chat(user, "\The [src] already has a helmet installed.") + return TRUE else if(!user.unEquip(W, src)) - return + FEEDBACK_UNEQUIP_FAILURE(user, W) + return TRUE to_chat(user, "You attach \the [W] to \the [src]'s helmet mount.") src.helmet = W playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1) - return + return TRUE + else if(istype(W,/obj/item/clothing/shoes/magboots)) if(user.get_inventory_slot(src) == slot_wear_suit) to_chat(user, SPAN_WARNING("You cannot modify \the [src] while it is being worn.")) - return + return TRUE if(boots) to_chat(user, "\The [src] already has magboots installed.") else if(!user.unEquip(W, src)) - return + FEEDBACK_UNEQUIP_FAILURE(user, W) + return TRUE to_chat(user, "You attach \the [W] to \the [src]'s boot mounts.") boots = W playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1) - return + return TRUE + else if(istype(W,/obj/item/tank)) if(user.get_inventory_slot(src) == slot_wear_suit) to_chat(user, SPAN_WARNING("You cannot modify \the [src] while it is being worn.")) - return + return TRUE if(tank) to_chat(user, "\The [src] already has an airtank installed.") - return + return TRUE if (istype(W, /obj/item/tank/scrubber)) to_chat(user, SPAN_WARNING("\The [W] is far too large to attach to \the [src].")) - return + return TRUE else if(!user.unEquip(W, src)) - return + FEEDBACK_UNEQUIP_FAILURE(user, W) + return TRUE to_chat(user, "You insert \the [W] into \the [src]'s storage compartment.") tank = W playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1) - return + return TRUE - ..() + return ..() /obj/item/clothing/suit/space/void/attack_hand(mob/user as mob) if (loc == user) diff --git a/code/modules/clothing/suits/armor.dm b/code/modules/clothing/suits/armor.dm index ad5be4c7f9479..bb17602cd8515 100644 --- a/code/modules/clothing/suits/armor.dm +++ b/code/modules/clothing/suits/armor.dm @@ -96,7 +96,7 @@ /obj/item/clothing/suit/armor/reactive name = "reactive teleport armor" desc = "Someone separated our Chief Science Officer from their own head!" - var/active = 0.0 + active = 0.0 icon_state = "reactiveoff" blood_overlay_type = "armor" armor = null diff --git a/code/modules/clothing/under/accessories/_accessory.dm b/code/modules/clothing/under/accessories/_accessory.dm index 3c3d34039b978..6440bbe9a8454 100644 --- a/code/modules/clothing/under/accessories/_accessory.dm +++ b/code/modules/clothing/under/accessories/_accessory.dm @@ -106,11 +106,6 @@ else dropInto(loc) -//default attackby behaviour -/obj/item/clothing/accessory/attackby(obj/item/I, mob/user) - ..() - - //default attack_hand behaviour /obj/item/clothing/accessory/attack_hand(mob/user as mob) if(parent) diff --git a/code/modules/clothing/under/accessories/badges.dm b/code/modules/clothing/under/accessories/badges.dm index fc4a70357e200..a00207a72c234 100644 --- a/code/modules/clothing/under/accessories/badges.dm +++ b/code/modules/clothing/under/accessories/badges.dm @@ -131,19 +131,19 @@ return 1 -/obj/item/clothing/accessory/badge/holo/attackby(obj/item/O, mob/user) +/obj/item/clothing/accessory/badge/holo/use_tool(obj/item/O, mob/living/user, list/click_params) if (istype(O, /obj/item/card/id) || istype(O, /obj/item/modular_computer)) var/obj/item/card/id/id_card = O.GetIdCard() if (!id_card) - return + return ..() if ((badge_access in id_card.access) || emagged) to_chat(user, "You imprint your ID details onto the badge.") set_name(id_card.registered_name) set_desc(user) else - to_chat(user, "[src] rejects your ID, and flashes 'Insufficient access!'") - return - ..() + to_chat(user, "\The [src] rejects your ID, and flashes 'Insufficient access!'") + return TRUE + return ..() /obj/item/storage/box/holobadge diff --git a/code/modules/clothing/under/accessories/goggle_mods.dm b/code/modules/clothing/under/accessories/goggle_mods.dm new file mode 100644 index 0000000000000..e9e52bd27cbf8 --- /dev/null +++ b/code/modules/clothing/under/accessories/goggle_mods.dm @@ -0,0 +1,132 @@ +/obj/item/clothing/accessory/glassesmod + abstract_type = /obj/item/clothing/accessory/glassesmod + name = "base glasses mod" + desc = "A basic modification for ballistic goggles." + icon_override = 'icons/mob/onmob/onmob_goggle_mod.dmi' + var/obj/screen/overlay + var/thermals = FALSE + var/nvg = FALSE + body_location = EYES + accessory_icons = list( + slot_tie_str = 'icons/mob/onmob/onmob_goggle_mod.dmi', + slot_goggles_str = 'icons/mob/onmob/onmob_goggle_mod.dmi', + slot_head_str = 'icons/mob/onmob/onmob_goggle_mod.dmi' + ) + sprite_sheets = list( + SPECIES_UNATHI = 'icons/mob/species/unathi/onmob_goggle_mod_unathi.dmi', + SPECIES_VOX = 'icons/mob/species/vox/onmob_goggle_mod_vox.dmi', + SPECIES_HUMAN = 'icons/mob/onmob/onmob_goggle_mod.dmi' + ) + activation_sound = 'sound/items/goggles_charge.ogg' + +/obj/item/clothing/accessory/glassesmod/proc/process_hud(mob/M) + return + +/obj/item/clothing/accessory/glassesmod/activate() + . = ..() + parent.CutOverlays(inv_overlay) + inv_overlay = null + inv_overlay = get_inv_overlay() + parent.AddOverlays(inv_overlay) + parent.update_vision() + +/obj/item/clothing/accessory/glassesmod/deactivate() + . = ..() + parent.CutOverlays(inv_overlay) + inv_overlay = null + inv_overlay = get_inv_overlay() + parent.AddOverlays(inv_overlay) + parent.update_vision() + +/obj/item/clothing/accessory/glassesmod/thermal + name = "thermal sights" + desc = "An older set of thermal vision goggles, modified to attach to a helmet." + icon_state = "thermals" + slot = ACCESSORY_SLOT_VISOR + vision_flags = SEE_MOBS + see_invisible = SEE_INVISIBLE_NOLIGHTING + toggleable = TRUE + off_state = "thermoff" + electric = TRUE + thermals = TRUE + tint = TINT_MODERATE + activation_sound = 'sound/items/metal_clicking_4.ogg' + deactivation_sound = 'sound/items/metal_clicking_4.ogg' + + +/obj/item/clothing/accessory/glassesmod/nvg + name = "light-enhancing sights" + desc = "An older set of light enhancing goggles, modified to attach to a helmet." + icon_state = "nvg" + slot = ACCESSORY_SLOT_VISOR + see_invisible = SEE_INVISIBLE_NOLIGHTING + toggleable = TRUE + off_state = "nvgoff" + electric = TRUE + nvg = TRUE + darkness_view = 4 + tint = TINT_MODERATE + activation_sound = 'sound/items/metal_clicking_4.ogg' + deactivation_sound = 'sound/items/metal_clicking_4.ogg' + +/obj/item/clothing/accessory/glassesmod/hud/process_hud(mob/M) + return + +/obj/item/clothing/accessory/glassesmod/hud/security + name = "security HUD attachment" + desc = "An attachable security HUD for ballistic goggles." + icon_state = "sechud" + slot = ACCESSORY_SLOT_HUD + hud_type = HUD_SECURITY + toggleable = TRUE + off_state = "hudoff" + + +/obj/item/clothing/accessory/glassesmod/hud/security/process_hud(mob/M) + process_sec_hud(M, 1) + + +/obj/item/clothing/accessory/glassesmod/hud/medical + name = "medical HUD attachment" + desc = "An attachable security HUD for ballistic goggles." + icon_state = "medhud" + slot = ACCESSORY_SLOT_HUD + hud_type = HUD_MEDICAL + toggleable = TRUE + off_state = "hudoff" + +/obj/item/clothing/accessory/glassesmod/hud/medical/process_hud(mob/M) + process_med_hud(M, 1) + +/obj/item/clothing/accessory/glassesmod/vision/polarized + name = "polarized lenses" + desc = "A set of flash-resistant lenses that can be clipped onto a pair of ballistic goggles." + slot = ACCESSORY_SLOT_VISION + icon_state = "polarized" + flash_protection = FLASH_PROTECTION_MODERATE + darkness_view = -1 + +/obj/item/clothing/accessory/glassesmod/vision/welding + name = "welding lenses" + desc = "A set of welding lenses that can be attached to ballistic goggles to protect against arc-eye" + slot = ACCESSORY_SLOT_VISION + icon_state = "welding_lenses" + off_state = "welding_lenses_up" + flash_protection = FLASH_PROTECTION_MAJOR + flags_inv = HIDEEYES + tint = TINT_HEAVY + toggleable = TRUE + activation_sound = 'sound/items/metal_clicking_13.ogg' + deactivation_sound = 'sound/items/metal_clicking_13.ogg' + toggle_on_message = "You flip the lenses down to protect your eyes." + toggle_off_message = "You push the lenses up out of your face." + +/obj/item/clothing/accessory/glassesmod/vision/welding/activate(mob/usr) + . = ..() + flags_inv |= HIDEEYES + body_parts_covered |= EYES + +/obj/item/clothing/accessory/glassesmod/vision/welding/deactivate(mob/usr) + . = ..() + flags_inv &= ~HIDEEYES + body_parts_covered &= ~EYES diff --git a/code/modules/clothing/under/accessories/holster.dm b/code/modules/clothing/under/accessories/holster.dm index 4270bae8a5c56..52034a700085f 100644 --- a/code/modules/clothing/under/accessories/holster.dm +++ b/code/modules/clothing/under/accessories/holster.dm @@ -16,13 +16,11 @@ set_extension(src, /datum/extension/holster, container, sound_in, sound_out, can_holster) -/obj/item/clothing/accessory/storage/holster/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/clothing/accessory/storage/holster/use_tool(obj/item/W, mob/living/user, list/click_params) var/datum/extension/holster/H = get_extension(src, /datum/extension/holster) if (H.holster(W, user)) - return - else - . = ..(W, user) - + return TRUE + return ..() /obj/item/clothing/accessory/storage/holster/attack_hand(mob/user as mob) var/datum/extension/holster/H = get_extension(src, /datum/extension/holster) diff --git a/code/modules/clothing/under/accessories/lockets.dm b/code/modules/clothing/under/accessories/lockets.dm index 2b12673015184..456ab0a40d595 100644 --- a/code/modules/clothing/under/accessories/lockets.dm +++ b/code/modules/clothing/under/accessories/lockets.dm @@ -30,17 +30,19 @@ icon_state = "[base_icon]" -/obj/item/clothing/accessory/locket/attackby(obj/item/I, mob/user) +/obj/item/clothing/accessory/locket/use_tool(obj/item/I, mob/living/user, list/click_params) if (!open) - to_chat(user, "You have to open it first.") - return + to_chat(user, "You have to open \the [src] before modifying it.") + return TRUE + if (istype(I, /obj/item/paper) || istype(I, /obj/item/photo)) if (held) to_chat(usr, "\The [src] already has something inside it.") else if (!user.unEquip(I, src)) - return - to_chat(usr, "You slip [I] into [src].") + FEEDBACK_UNEQUIP_FAILURE(user, I) + return TRUE + to_chat(usr, "You slip \the [I] into [src].") held = I - return - ..() + return TRUE + else return..() diff --git a/code/modules/clothing/under/accessories/storage.dm b/code/modules/clothing/under/accessories/storage.dm index 32c59b8c1961f..38825b72ab8cd 100644 --- a/code/modules/clothing/under/accessories/storage.dm +++ b/code/modules/clothing/under/accessories/storage.dm @@ -38,9 +38,10 @@ ..(over_object) -/obj/item/clothing/accessory/storage/attackby(obj/item/I, mob/user) +/obj/item/clothing/accessory/storage/use_tool(obj/item/tool, mob/living/user, list/click_params) if (container) - return container.attackby(I, user) + return container.use_tool(tool, user) + return ..() /obj/item/clothing/accessory/storage/emp_act(severity) @@ -69,9 +70,9 @@ /obj/item/clothing/accessory/storage/pockets name = "pockets" desc = "A bag-like receptacle fastened to an article of clothing to hold small items." - icon_state = "" + icon_state = "pockets" slots = 2 STORAGE_FREEFORM - accessory_flags = ACCESSORY_HIGH_VISIBILITY | ACCESSORY_HIDDEN + accessory_flags = ACCESSORY_HIGH_VISIBILITY | ACCESSORY_REMOVABLE /obj/item/clothing/accessory/storage/webbing diff --git a/code/modules/codex/codex_client.dm b/code/modules/codex/codex_client.dm index 7bb425d3989a8..b15345c579db1 100644 --- a/code/modules/codex/codex_client.dm +++ b/code/modules/codex/codex_client.dm @@ -25,7 +25,7 @@ return codex_on_cooldown = TRUE - addtimer(new Callback(src, .proc/reset_codex_cooldown), 3 SECONDS) + addtimer(new Callback(src, PROC_REF(reset_codex_cooldown)), 3 SECONDS) var/list/all_entries = SScodex.retrieve_entries_for_string(searching) if(mob && mob.mind && !player_is_antag(mob.mind)) @@ -71,7 +71,7 @@ to_chat(src, SPAN_WARNING("You cannot perform codex actions currently.")) return codex_on_cooldown = TRUE - addtimer(new Callback(src, .proc/reset_codex_cooldown), 10 SECONDS) + addtimer(new Callback(src, PROC_REF(reset_codex_cooldown)), 10 SECONDS) to_chat(mob, SPAN_NOTICE("The codex forwards you an index file.")) @@ -114,7 +114,7 @@ return codex_on_cooldown = TRUE - addtimer(new Callback(src, .proc/reset_codex_cooldown), 3 SECONDS) + addtimer(new Callback(src, PROC_REF(reset_codex_cooldown)), 3 SECONDS) var/datum/codex_entry/entry = SScodex.get_codex_entry("nexus") SScodex.present_codex_entry(mob, entry) diff --git a/code/modules/codex/entries/paperwork.dm b/code/modules/codex/entries/paperwork.dm index 4cce5071dd4ae..909afd40b5db8 100644 --- a/code/modules/codex/entries/paperwork.dm +++ b/code/modules/codex/entries/paperwork.dm @@ -31,8 +31,9 @@ \[xynlogo\] - Inserts the Xyngergy logo.
\[iccgseal\] - Inserts ICCG seal.
\[fleetlogo\] - Inserts the logo of the SCG Fleet.
-\[sfplogo\] - Inserts the logo of the Sol Federal Police.

-\[falogo\] - Inserts the logo of the Frontier Alliance.

+\[sfplogo\] - Inserts the logo of the Sol Federal Police.
+\[falogo\] - Inserts the logo of the Frontier Alliance.
+\[zhlogo\] - Inserts the logo of Zeng-Hu Pharmaceuticals.

Digital exclusive commands (NanoWord, emails, reports, text files, etc):
\[pre\] - \[/pre\] : Adds preformatted text, forcing the text to be fixed width.
\[fontred\] - \[/font\] : Makes the text red.
diff --git a/code/modules/crafting/_crafting_holder.dm b/code/modules/crafting/_crafting_holder.dm index 04b611b8adc46..9b67b67a74fa9 100644 --- a/code/modules/crafting/_crafting_holder.dm +++ b/code/modules/crafting/_crafting_holder.dm @@ -33,22 +33,21 @@ qdel(thing) . = ..() -/obj/item/crafting_holder/attackby(obj/item/W, mob/user) - +/obj/item/crafting_holder/use_tool(obj/item/W, mob/living/user, list/click_params) if(istype(W, /obj/item/pen)) var/new_label = sanitizeSafe(input(user, "What do you wish to label this assembly?", "Assembly Labelling", label_name), MAX_NAME_LEN) if(new_label && !user.incapacitated() && W.loc == user && user.Adjacent(src) && !QDELETED(src)) to_chat(user, SPAN_NOTICE("You label \the [src] with '[new_label]'.")) label_name = new_label - return + return TRUE if(current_crafting_stage) var/singleton/crafting_stage/next_stage = current_crafting_stage.get_next_stage(W) if(next_stage && next_stage.progress_to(W, user, src)) advance_to(next_stage, user, W) - return + return TRUE - . = ..() + return ..() /** diff --git a/code/modules/culture_descriptor/culture/cultures_human.dm b/code/modules/culture_descriptor/culture/cultures_human.dm index 660fbff1e7f38..b0a069d445ca7 100644 --- a/code/modules/culture_descriptor/culture/cultures_human.dm +++ b/code/modules/culture_descriptor/culture/cultures_human.dm @@ -77,12 +77,14 @@ economic_power = 1 -/singleton/cultural_info/culture/human/plutonian - name = CULTURE_HUMAN_PLUTO - description = "You are from Pluto, one of many denizens of this cruel and unforgiving world. For centuries Pluto has been in a slow state of decay and decline, resulting in \ - much of the planet's infrastructure being unstable or outright falling apart. This, coupled with rampant corruption and the large influence of criminal organisations across much of \ - the planet has led to the people of Pluto having something of a seedy reputation, its citizens being viewed with disrepute. The people themselves, however, are usually \ - just happy to get off the rock and to healthier locales. Unfortunately, despite the efforts of the wider SCG, many Plutonians tend to maintain criminal ties, even offworld." +/singleton/cultural_info/culture/human/kuiper_insider + name = CULTURE_HUMAN_KUIPERI + description = "You are from one of many habitations of the Kuiper belt. The eventual economic and social decay of Pluto, and its surroundings, has resulted in much of the zone's infrastructure \ + being unstable or outright falling apart. Coupled with rampant corruption and the growing mold of organised (and unorganised) crime across much of the region has left the people of the \ + Kuiper belt with something of a seedy reputation, with citizens often being viewed with disrepute. The people themselves, too, may not be unanimous at all times with a core community centered around \ + the descendents of the original colonists. While having a stronger foothold due to their lengthy ties to the SEZ's society and economy, they are often less diverse than the 'Outsiders'. \ + More often than not being able to trace their lineage directly back to Earth. This can often cause caustic, dissonant ideals, as compared to the rest of their Solar comrades. \ + While some may monotonously belong to the zone's stagnant class, other 'Insiders' may have roots to corporate backgrounds, owing to the initial colonisation and exploitation of Kuiper." economic_power = 0.8 secondary_langs = list (LANGUAGE_HUMAN_EURO, LANGUAGE_HUMAN_CHINESE, @@ -94,6 +96,23 @@ LANGUAGE_GUTTER, LANGUAGE_SIGN) +/singleton/cultural_info/culture/human/kuiper_outsider + name = CULTURE_HUMAN_KUIPERO + description = "You are from one of the many habitations of the Kuiper belt. While you were not a part of the initial collapse of the Zone, the effects of it are still felt all the same. \ + The stagnancy and neglect of the Zone has brought with it many opportunities for cheaper housing, and has made for an excellent haven for refugees looking for work. \ + Outsiders tend to be a more diverse demographic as compared to the Insiders, with many of them being descendents of employees on long-term tenures, or of families looking for cheap residence. \ + Most Outsiders tend to have a similar outlook of their home as that of the Insiders - with the Expeditionary Corps and Fleet being lucrative and comparitively easy ways to source a life outside the Kuiper belt." + economic_power = 0.7 + secondary_langs = list (LANGUAGE_HUMAN_EURO, + LANGUAGE_HUMAN_CHINESE, + LANGUAGE_HUMAN_ARABIC, + LANGUAGE_HUMAN_INDIAN, + LANGUAGE_HUMAN_IBERIAN, + LANGUAGE_HUMAN_RUSSIAN, + LANGUAGE_SPACER, + LANGUAGE_GUTTER, + LANGUAGE_SIGN) + /singleton/cultural_info/culture/human/earthling name = CULTURE_HUMAN_EARTH description = "You are from Earth, home of humanity. Earth culture is much as it has been for centuries, with the old nation states, while no longer politically important, still \ @@ -182,6 +201,14 @@ dominates the green planet, and the myriad of exotic life found in its freshwater system." economic_power = 0.7 +/singleton/cultural_info/culture/human/magnitka + name = CULTURE_HUMAN_MAGNITKA + description = "Magnitka often gives birth to rough-hewn, sturdy citizens with its austere political and environmental climate, and many are often well-sought for the \ + independent (and government) economic and production sectors of the two larger human nations. While it is difficult to acquire residency for a Magnitkan in Solar space due to the hazy political environment, \ + those who have been a part of the volunteer military force have no chance at all. Employees with Magnitkan blood may belong to the planet's Spacer culture, often at the lower rung of the social ladder - or the more \ + well connected, upper rung, with outsourcing and in-house job opportunities varying in quality and quantity for both." + economic_power = 0.8 + /singleton/cultural_info/culture/human/spacer name = CULTURE_HUMAN_SPACER description = "Across all political lines in human space, there are people who are born and raised in the void between worlds. You are from one of the myriad space stations, orbital platforms, long haul freighters, \ diff --git a/code/modules/culture_descriptor/culture/cultures_ipc.dm b/code/modules/culture_descriptor/culture/cultures_ipc.dm index 016ac453907e2..5c23b7bd1acae 100644 --- a/code/modules/culture_descriptor/culture/cultures_ipc.dm +++ b/code/modules/culture_descriptor/culture/cultures_ipc.dm @@ -1,4 +1,6 @@ + /singleton/cultural_info/culture/ipc + var/list/valid_jobs = list() name = CULTURE_POSITRONICS_GEN1 description = "Compared to modern positronics, First Generation IPCs are simplistic, inflexible, and failure-prone. \ They are no longer in production, and all existing first generation positronics are quite old. They have little sense of self, \ diff --git a/code/modules/culture_descriptor/location/locations_human.dm b/code/modules/culture_descriptor/location/locations_human.dm index e1e7112f93d21..42e00f54da2fa 100644 --- a/code/modules/culture_descriptor/location/locations_human.dm +++ b/code/modules/culture_descriptor/location/locations_human.dm @@ -75,21 +75,29 @@ and some of the best engineers Humanity has to offer." capital = "Government Zone, Ceres Station" -/singleton/cultural_info/location/human/pluto - name = HOME_SYSTEM_PLUTO +/singleton/cultural_info/location/human/kuiper_belt + name = HOME_SYSTEM_KUIPERB distance = "45AU" - description = "Pluto, nominally a Democratic Republic, is a small planet in the Sol system. Pluto has a fairly small population compared \ - to many other planets in the SCG, with much of it being centred around only two cities, both of which are in desperate need of modernisation \ - and repair, with much infrastructure long since collapsed. Pluto is dominated by criminal elements and corruption is rampant. Those who live on \ - Pluto either work a desperate, tough existence trying to escape the planet or are part of or under the thumbs of one of the many local crime \ - syndicates. In spite of a number of modernisation efforts the Pluto of today has seen very little in the way of improvement.

The people \ - of Pluto are, surprisingly, some of the worst off in the SCG. Downtrodden, poor, and from a locale that is so infested with crime it has become \ - part of the local culture. Most of the people of Pluto are very rough around the edges, hardened by years of poverty or criminality. Those that \ - manage to escape rarely wish to return, though often possess a looser set of morales as a result of their time on the planet." - capital = "New Santa Domingo" + description = "The Kuiper Special Economic Zone used to be at the forefront of human exploration before the advent of proper FTL travel. With the emergence \ + of Alden-Saraspova drives for long-range transit, and eventually gateways, the Zone saw a sharp decline in utility. Nowadays treated as an economic afterthought with little more than a defensive station in Sol, it is home to a diverse cast of residents. \ + Most inhabitants of the inner Belt tend to live on orbitals surrounding the capital, Pluto, and its moon - Charon. \ + Pluto is often dotted with water-ice and gas extraction plants, as many abandoned as there are operational. Many can often find traces of abandoned gas refineries, worker hovels and labyrinthine \ + networks of pump-houses and causeways; sometimes repurposed for more nefarious needs. Orbitals carry most of the economic and residential brunt, \ + with administrative services being concentrated around Pluto, primarily." + capital = "Kuiper Administrative Zone, Pluto" economic_power = 0.8 secondary_langs = list(LANGUAGE_GUTTER) +/singleton/cultural_info/location/human/kuiper_interdust + name = HOME_SYSTEM_KUIPERD + distance = "45AU" + description = "The Kuiper Special Economic Zone's region beyond the confines of administration's population centers contains the Interdust, with a variety of industrial, military and economic \ + infrastructure still kept in function. While residential slots are lesser than those in the Belt, a fair amount of inhabitants call it their home in isolated asteroid settlements. \ + With policing actions a far less stringent ordeal in this sector of the SEZ, crime has found much success in certain hotspots of the interdust regions of the Kuiper belt." + capital = "Kuiper Administrative Zone, Pluto" + economic_power = 0.7 + secondary_langs = list(LANGUAGE_GUTTER) + /singleton/cultural_info/location/human/cetiepsilon name = HOME_SYSTEM_TAU_CETI distance = "11.9 light years" @@ -193,15 +201,16 @@ /singleton/cultural_info/location/human/magnitka name = HOME_SYSTEM_MAGNITKA distance = "24 light years" - description = "Magnitka is an independent, industrialized mining and ore processing colony located in the Ursa system. \ - Ruled by an oligarchy with politicians often being freshly retired service members, Magnitka's recent history \ - is marked by civil war. Even today, a number of rebel groups populate the planet. Founded by corporations in the 2200s, the overwhelming majority of Magnitka's population \ - is descended from the settlers of a joint-corporate colonization effort from Earth. Unfortunately, Magnitka's economy is in a decline as its principle export, iron, grows \ - cheaper. The primary careers available to Magnitkans are military service, mining, or colonial labor. Though historically isolationist, and more recently associated \ - with the ICCG, recently a new uniquely Magnitkan identity has arisen; severe, pragmatic, and unified in their newfound independence." - capital = "Labortown" - economic_power = 0.8 - ruling_body = "Magnitka" + description = "Once an independent, industrialized mining and ore processing colony located in the Ursa system, Magnitka is now its own nation-state with various (albeit limited) sectors of economy and product. \ + Ruled by an oligarchic administrative body with politicians often being freshly retired service members, Magnitka's history \ + is marked by civil war, up until the 2260s, wherein the civil environment has stabilized for the sake of the planet's cohesion. Even today, a number of rebel groups populate the planet. \ + Founded by corporations in the 2200s, the overwhelming majority of Magnitka's population is descended from the settlers of a joint-corporate colonization effort from Earth. \ + Having been on a recovering spiral from its economy downturn, Magnitka tends to have a strict domestic economy \ + specializing in ore processing, arms manufacturing and skilled outsourced labour. While Magnitka has been historically isolationist, with a tendency towards the culture of the Gilgameshi - \ + more recently a new, uniquely Magnitkan identity has arisen; severe, pragmatic, and unified in their newfound independence." + capital = "Neueifel" + economic_power = 0.9 + ruling_body = "Magnitkan Independence Coalition" /singleton/cultural_info/location/human/castilla name = HOME_SYSTEM_CASTILLA diff --git a/code/modules/detectivework/tools/rag.dm b/code/modules/detectivework/tools/rag.dm index 5e23784892032..d1b7ae0e4f9c8 100644 --- a/code/modules/detectivework/tools/rag.dm +++ b/code/modules/detectivework/tools/rag.dm @@ -45,7 +45,7 @@ else remove_contents(user) -/obj/item/reagent_containers/glass/rag/attackby(obj/item/W, mob/user) +/obj/item/reagent_containers/glass/rag/use_tool(obj/item/W, mob/living/user, list/click_params) if (!on_fire && W.IsFlameSource()) ignite() if(on_fire) @@ -55,9 +55,11 @@ ) else to_chat(user, SPAN_WARNING("You manage to singe \the [src], but it won't burn on its own.")) // Give a hint about needing fuel + update_name() + return TRUE + + return ..() - . = ..() - update_name() /obj/item/reagent_containers/glass/rag/proc/update_name() if(on_fire) @@ -131,7 +133,7 @@ M.IgniteMob() return TRUE else if (reagents.total_volume) - if (iscarbon(target) && user.a_intent == I_HELP && flag == BP_HEAD) + if (iscarbon(target) && user.a_intent == I_HELP && user.zone_sel.selecting == BP_HEAD) var/mob/living/carbon/C = target var/obj/item/organ/external/head/H = C.organs_by_name[BP_HEAD] if (istype(H) && H.forehead_graffiti) diff --git a/code/modules/detectivework/tools/sample_kits.dm b/code/modules/detectivework/tools/sample_kits.dm index 5ef1ca8f1b842..3c15d9c4c41dd 100644 --- a/code/modules/detectivework/tools/sample_kits.dm +++ b/code/modules/detectivework/tools/sample_kits.dm @@ -54,11 +54,11 @@ update_icon() return 1 -/obj/item/sample/attackby(obj/O, mob/user) - if(O.type == src.type) - if(user.unEquip(O) && merge_evidence(O, user)) - qdel(O) - return 1 +/obj/item/sample/use_tool(obj/item/item, mob/living/user, list/click_params) + if(item.type == type) + if(user.unEquip(item) && merge_evidence(item, user)) + qdel(item) + return TRUE return ..() /obj/item/sample/fibers diff --git a/code/modules/economy/cash.dm b/code/modules/economy/cash.dm index a2dbd130c8137..aef4e002ef355 100644 --- a/code/modules/economy/cash.dm +++ b/code/modules/economy/cash.dm @@ -17,30 +17,35 @@ var/worth = 0 var/static/denominations = list(1000,500,200,100,50,20,10,1) -/obj/item/spacecash/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/spacecash/use_tool(obj/item/W, mob/living/user, list/click_params) if(istype(W, /obj/item/spacecash)) - if(istype(W, /obj/item/spacecash/ewallet)) return 0 + if (istype(W, /obj/item/spacecash/ewallet)) + return ..() var/obj/item/spacecash/bundle/bundle if(!istype(W, /obj/item/spacecash/bundle)) var/obj/item/spacecash/cash = W - bundle = new (src.loc) + bundle = new (loc) bundle.worth += cash.worth qdel(cash) else //is bundle bundle = W - bundle.worth += src.worth + bundle.worth += worth bundle.update_icon() if(istype(user, /mob/living/carbon/human)) var/mob/living/carbon/human/h_user = user h_user.drop_from_inventory(bundle) h_user.put_in_hands(bundle) - to_chat(user, SPAN_NOTICE("You add [src.worth] [GLOB.using_map.local_currency_name] worth of money to the bundles.
It holds [bundle.worth] [GLOB.using_map.local_currency_name] now.")) + to_chat(user, SPAN_NOTICE("You add [worth] [GLOB.using_map.local_currency_name] worth of money to the bundles.
It holds [bundle.worth] [GLOB.using_map.local_currency_name] now.")) qdel(src) + return TRUE - else if(istype(W, /obj/item/gun/launcher/money)) + if (istype(W, /obj/item/gun/launcher/money)) var/obj/item/gun/launcher/money/L = W L.absorb_cash(src, user) + return TRUE + + return ..() /obj/item/spacecash/proc/getMoneyImages() if(icon_state) diff --git a/code/modules/emotes/definitions/_mob.dm b/code/modules/emotes/definitions/_mob.dm index dbc141c932cc4..ae881eddbc06f 100644 --- a/code/modules/emotes/definitions/_mob.dm +++ b/code/modules/emotes/definitions/_mob.dm @@ -162,6 +162,9 @@ /singleton/emote/visible/tfist, /singleton/emote/visible/tilt, /singleton/emote/visible/atten, + /singleton/emote/audible/whistle, + /singleton/emote/visible/scratch, + /singleton/emote/audible/finger_snap, ) /mob/living/carbon/human/monkey/default_emotes = list( diff --git a/code/modules/emotes/definitions/audible.dm b/code/modules/emotes/definitions/audible.dm index 08d2c4fad8d0c..c34c84393ef39 100644 --- a/code/modules/emotes/definitions/audible.dm +++ b/code/modules/emotes/definitions/audible.dm @@ -64,7 +64,7 @@ /singleton/emote/audible/whistle key = "whistle" - emote_message_1p = "You whistle." + // emote_message_1p = "You whistle." Закоменченно, чтобы не было путаницы с тем, что у свистуна и присутствующих эмоут отображается по-разному emote_message_3p = "USER whistles." /singleton/emote/audible/boop diff --git a/code/modules/emotes/emote_define.dm b/code/modules/emotes/emote_define.dm index 05bcc80be61d6..99f501832c89a 100644 --- a/code/modules/emotes/emote_define.dm +++ b/code/modules/emotes/emote_define.dm @@ -63,6 +63,9 @@ var/use_3p var/use_1p + + + var/runemessage = -1 if(emote_message_1p) if(target && emote_message_1p_target) use_1p = get_emote_message_1p(user, target, extra_params) @@ -86,6 +89,9 @@ use_3p = replacetext(use_3p, "USER_THEM", user_pronouns.him) use_3p = replacetext(use_3p, "USER_THEIR", user_pronouns.his) use_3p = replacetext(use_3p, "USER_SELF", user_pronouns.self) + + runemessage = replacetext(use_3p, "USER", "") + use_3p = replacetext(use_3p, "USER", "\the [user]") use_3p = capitalize(use_3p) @@ -96,9 +102,9 @@ if(ismob(user)) var/mob/M = user if(message_type == AUDIBLE_MESSAGE) - M.audible_message(message = use_3p, self_message = use_1p, deaf_message = emote_message_impaired, hearing_distance = use_range, checkghosts = /datum/client_preference/ghost_sight) + M.audible_message(message = use_3p, self_message = use_1p, deaf_message = emote_message_impaired, hearing_distance = use_range, checkghosts = /datum/client_preference/ghost_sight, runemessage = runemessage) else - M.visible_message(message = use_3p, self_message = use_1p, blind_message = emote_message_impaired, range = use_range, checkghosts = /datum/client_preference/ghost_sight) + M.visible_message(message = use_3p, self_message = use_1p, blind_message = emote_message_impaired, range = use_range, checkghosts = /datum/client_preference/ghost_sight, runemessage = runemessage) do_extra(user, target) diff --git a/code/modules/emotes/emote_mob.dm b/code/modules/emotes/emote_mob.dm index c0c567858a3cc..b02d00e1bc749 100644 --- a/code/modules/emotes/emote_mob.dm +++ b/code/modules/emotes/emote_mob.dm @@ -138,9 +138,9 @@ //do not show NPC animal emotes to ghosts, it turns into hellscape var/check_ghosts = client ? /datum/client_preference/ghost_sight : null if(m_type == VISIBLE_MESSAGE) - visible_message(message, checkghosts = check_ghosts) + visible_message(message, checkghosts = check_ghosts, runemessage = input) else - audible_message(message, checkghosts = check_ghosts) + audible_message(message, checkghosts = check_ghosts, runemessage = input) // Specific mob type exceptions below. /mob/living/silicon/ai/emote(act, type, message) diff --git a/code/modules/events/blob.dm b/code/modules/events/blob.dm index f518d42c0005a..650497a6e0891 100644 --- a/code/modules/events/blob.dm +++ b/code/modules/events/blob.dm @@ -7,7 +7,7 @@ level_seven_announcement() /datum/event/blob/start() - var/turf/T = pick_subarea_turf(/area/maintenance, list(/proc/is_station_turf, /proc/not_turf_contains_dense_objects)) + var/turf/T = pick_subarea_turf(/area/maintenance, list(GLOBAL_PROC_REF(is_station_turf), GLOBAL_PROC_REF(not_turf_contains_dense_objects))) if(!T) log_and_message_admins("Blob failed to find a viable turf.") kill() diff --git a/code/modules/events/brand_intelligence.dm b/code/modules/events/brand_intelligence.dm index abb0071c2decb..d45341acc10bd 100644 --- a/code/modules/events/brand_intelligence.dm +++ b/code/modules/events/brand_intelligence.dm @@ -12,7 +12,7 @@ /datum/event/brand_intelligence/start() - for(var/obj/machinery/vending/V in SSmachines.machinery) + for(var/obj/machinery/vending/V as anything in SSmachines.get_machinery_of_type(/obj/machinery/vending)) if(V.z in affecting_z) vendingMachines += weakref(V) diff --git a/code/modules/events/bsd_instability.dm b/code/modules/events/bsd_instability.dm index fa0bf0d7d963f..d822bc5447b20 100644 --- a/code/modules/events/bsd_instability.dm +++ b/code/modules/events/bsd_instability.dm @@ -40,13 +40,13 @@ /datum/event/bsd_instability/start() - for (var/obj/machinery/tele_pad/pad in SSmachines.machinery) + for (var/obj/machinery/tele_pad/pad as anything in SSmachines.get_machinery_of_type(/obj/machinery/tele_pad)) if (!(pad.z in affecting_z)) continue pads += pad pad.interference = TRUE pad.interlude_chance = 30 * severity - for (var/obj/machinery/bluespacedrive/drive in SSmachines.machinery) + for (var/obj/machinery/bluespacedrive/drive as anything in SSmachines.get_machinery_of_type(/obj/machinery/bluespacedrive)) if (!(drive.z in affecting_z)) continue drives += drive @@ -54,7 +54,7 @@ drive.set_light(1, 8, 25, 15, COLOR_CYAN_BLUE) if (severity <= EVENT_LEVEL_MODERATE) continue - addtimer(new Callback(drive, /obj/machinery/bluespacedrive/proc/create_flash, TRUE, turf_conversion_range), 2 SECONDS) + addtimer(new Callback(drive, TYPE_PROC_REF(/obj/machinery/bluespacedrive, create_flash), TRUE, turf_conversion_range), 2 SECONDS) if (severity <= EVENT_LEVEL_MODERATE) return for (var/obj/structure/stairs/stair in world) @@ -73,7 +73,7 @@ if (severity > EVENT_LEVEL_MODERATE) for (var/i = 1 to effects_per_tick) var/turf/turf = pick_area_turf_in_single_z_level( - list(/proc/is_not_space_area), + list(GLOBAL_PROC_REF(is_not_space_area)), z_level = pick(affecting_z) ) var/effect_state = pick("cyan_sparkles", "blue_electricity_constant", "shieldsparkles", "empdisabled") @@ -92,7 +92,7 @@ zlevels = affecting_z ) for (var/obj/machinery/bluespacedrive/drive in drives) - addtimer(new Callback(drive, /obj/machinery/bluespacedrive/proc/do_pulse), 20 SECONDS) + addtimer(new Callback(drive, TYPE_PROC_REF(/obj/machinery/bluespacedrive, do_pulse)), 20 SECONDS) for (var/mob/mob in GLOB.player_list) if (istype(mob, /mob/new_player)) continue diff --git a/code/modules/events/computer_damage.dm b/code/modules/events/computer_damage.dm index 519d41f92b3c5..f0b7ed4c0500b 100644 --- a/code/modules/events/computer_damage.dm +++ b/code/modules/events/computer_damage.dm @@ -8,7 +8,7 @@ if(EVENT_LEVEL_MAJOR) number_of_victims = 16 var/list/victims = list() - for(var/obj/machinery/computer/modular/C in SSmachines.machinery) + for(var/obj/machinery/computer/modular/C as anything in SSmachines.get_machinery_of_type(/obj/machinery/computer/modular)) if((C.z in affecting_z) && C.use_power == POWER_USE_ACTIVE && C.get_component_of_type(/obj/item/stock_parts/computer/hard_drive)) victims += C while(number_of_victims && length(victims)) diff --git a/code/modules/events/disposals_explosion.dm b/code/modules/events/disposals_explosion.dm index 28b886a4182e8..b98ac4a3d19d6 100644 --- a/code/modules/events/disposals_explosion.dm +++ b/code/modules/events/disposals_explosion.dm @@ -24,7 +24,7 @@ // Event listener for the marked pipe's destruction /datum/event/disposals_explosion/proc/pipe_destroyed() - GLOB.destroyed_event.unregister(bursting_pipe, src, .proc/pipe_destroyed) + GLOB.destroyed_event.unregister(bursting_pipe, src, PROC_REF(pipe_destroyed)) bursting_pipe = null kill() @@ -33,7 +33,7 @@ var/list/area_predicates = GLOB.is_station_but_not_maint_area.Copy() area_predicates += /proc/area_has_disposals_pipe - var/turf/containing_turf = pick_area_and_turf(area_predicates, list(/proc/has_disposals_pipe)) + var/turf/containing_turf = pick_area_and_turf(area_predicates, list(GLOBAL_PROC_REF(has_disposals_pipe))) if(isnull(containing_turf)) log_debug("Couldn't find a turf containing a disposals pipe. Aborting.") kill() @@ -43,7 +43,7 @@ if(istype(A, /obj/structure/disposalpipe/segment)) bursting_pipe = A // Subscribe to pipe destruction facts - GLOB.destroyed_event.register(A, src, .proc/pipe_destroyed) + GLOB.destroyed_event.register(A, src, PROC_REF(pipe_destroyed)) break if(isnull(bursting_pipe)) @@ -70,7 +70,7 @@ if(isnull(bursting_pipe)) return - GLOB.destroyed_event.unregister(bursting_pipe, src, .proc/pipe_destroyed) + GLOB.destroyed_event.unregister(bursting_pipe, src, PROC_REF(pipe_destroyed)) if(bursting_pipe.get_current_health() < 5) // Make a disposals holder for the trash diff --git a/code/modules/events/electrical_storm.dm b/code/modules/events/electrical_storm.dm index e07058bc1f3c5..6b113e4fa9e41 100644 --- a/code/modules/events/electrical_storm.dm +++ b/code/modules/events/electrical_storm.dm @@ -26,7 +26,7 @@ /datum/event/electrical_storm/start() ..() valid_apcs = list() - for(var/obj/machinery/power/apc/A in SSmachines.machinery) + for(var/obj/machinery/power/apc/A as anything in SSmachines.get_machinery_of_type(/obj/machinery/power/apc)) if(A.z in affecting_z) valid_apcs.Add(A) endWhen = (severity * 60) + startWhen @@ -35,7 +35,7 @@ ..() //See if shields can stop it first var/list/shields = list() - for(var/obj/machinery/power/shield_generator/G in SSmachines.machinery) + for(var/obj/machinery/power/shield_generator/G as anything in SSmachines.get_machinery_of_type(/obj/machinery/power/shield_generator)) if((G.z in affecting_z) && G.running && G.check_flag(MODEFLAG_EM)) shields += G if(length(shields)) diff --git a/code/modules/events/exo_awakening/exo_awaken.dm b/code/modules/events/exo_awakening/exo_awaken.dm index 5e52b894cbbf9..e64e8fb0a5800 100644 --- a/code/modules/events/exo_awakening/exo_awaken.dm +++ b/code/modules/events/exo_awakening/exo_awaken.dm @@ -78,7 +78,7 @@ GLOBAL_LIST_INIT(exo_event_mob_count,list())// a list of all mobs currently spaw notify_players() adjust_to_planet_size() - addtimer(new Callback(src, /datum/event/exo_awakening/proc/start_spawning), delay_time) + addtimer(new Callback(src, TYPE_PROC_REF(/datum/event/exo_awakening, start_spawning)), delay_time) //Locates a planet with players on it and kills the event if there aren't enough present /datum/event/exo_awakening/proc/find_suitable_planet() @@ -193,8 +193,8 @@ GLOBAL_LIST_INIT(exo_event_mob_count,list())// a list of all mobs currently spaw var/mob/living/simple_animal/hostile/M = new mob_to_spawn(T) if (istype(M)) M.visible_message(SPAN_DANGER("\The [M] bursts forth from the ground!")) - GLOB.death_event.register(M,src,/datum/event/exo_awakening/proc/reduce_mob_count) - GLOB.destroyed_event.register(M,src,/datum/event/exo_awakening/proc/reduce_mob_count) + GLOB.death_event.register(M,src, TYPE_PROC_REF(/datum/event/exo_awakening, reduce_mob_count)) + GLOB.destroyed_event.register(M,src, TYPE_PROC_REF(/datum/event/exo_awakening, reduce_mob_count)) LAZYADD(GLOB.exo_event_mob_count, M) if (istype(chosen_planet, /obj/overmap/visitable/sector/exoplanet)) @@ -211,8 +211,8 @@ GLOBAL_LIST_INIT(exo_event_mob_count,list())// a list of all mobs currently spaw if (M in L) LAZYREMOVE(L,M) - GLOB.death_event.unregister(M,src,/datum/event/exo_awakening/proc/reduce_mob_count) - GLOB.destroyed_event.unregister(M,src,/datum/event/exo_awakening/proc/reduce_mob_count) + GLOB.death_event.unregister(M, src, TYPE_PROC_REF(/datum/event/exo_awakening, reduce_mob_count)) + GLOB.destroyed_event.unregister(M, src, TYPE_PROC_REF(/datum/event/exo_awakening, reduce_mob_count)) /datum/event/exo_awakening/end() if (!chosen_area) diff --git a/code/modules/events/infestation.dm b/code/modules/events/infestation.dm index 37efd3c70ab73..501817b1f1bf5 100644 --- a/code/modules/events/infestation.dm +++ b/code/modules/events/infestation.dm @@ -69,13 +69,13 @@ command_announcement.Announce("Bioscans indicate that [vermstring] have been breeding in \the [location]. Further infestation is likely if left unchecked.", "[location_name()] Biologic Sensor Network", zlevels = affecting_z) /datum/event/infestation/proc/set_location_get_infestation_turfs() - location = pick_area(list(/proc/is_not_space_area, /proc/is_station_area)) + location = pick_area(list(GLOBAL_PROC_REF(is_not_space_area), GLOBAL_PROC_REF(is_station_area))) if(!location) log_debug("Vermin infestation failed to find a viable area. Aborting.") kill(TRUE) return - var/list/vermin_turfs = get_area_turfs(location, list(/proc/not_turf_contains_dense_objects, /proc/IsTurfAtmosSafe)) + var/list/vermin_turfs = get_area_turfs(location, list(GLOBAL_PROC_REF(not_turf_contains_dense_objects), GLOBAL_PROC_REF(IsTurfAtmosSafe))) if(!length(vermin_turfs)) log_debug("Vermin infestation failed to find viable turfs in \the [location].") return diff --git a/code/modules/events/mail.dm b/code/modules/events/mail.dm index bfd561b77c7e8..da9dbe96372f9 100644 --- a/code/modules/events/mail.dm +++ b/code/modules/events/mail.dm @@ -76,11 +76,10 @@ var/obj/item/gift = new gift_path() - // Wrap it all up in a parcel - var/obj/item/smallDelivery/parcel = new /obj/item/smallDelivery() + // Add the gift as the 'wrapped' item in the parcel + var/obj/item/smallDelivery/parcel = new /obj/item/smallDelivery(null, gift) parcel.SetName("normal-sized parcel (to [name])") letter.forceMove(parcel) - gift.forceMove(parcel) parcel.forceMove(gift_crate) diff --git a/code/modules/events/maint_drones.dm b/code/modules/events/maint_drones.dm index 93375e320a8cd..2e79f1f13865c 100644 --- a/code/modules/events/maint_drones.dm +++ b/code/modules/events/maint_drones.dm @@ -31,13 +31,13 @@ command_announcement.Announce("A maintenance drone [naming] has been detected. Caution is advised when entering maintenance tunnels.", "Drone Behaviour Control", zlevels = affecting_z) /datum/event/rogue_maint_drones/proc/get_infestation_turfs() - var/area/location = pick_area(list(/proc/is_not_space_area, /proc/is_station_area, /proc/is_maint_area)) + var/area/location = pick_area(list(GLOBAL_PROC_REF(is_not_space_area), GLOBAL_PROC_REF(is_station_area), GLOBAL_PROC_REF(is_maint_area))) if(!location) log_debug("Drone infestation failed to find a viable area. Aborting.") kill(TRUE) return - var/list/dron_turfs = get_area_turfs(location, list(/proc/not_turf_contains_dense_objects, /proc/IsTurfAtmosSafe)) + var/list/dron_turfs = get_area_turfs(location, list(GLOBAL_PROC_REF(not_turf_contains_dense_objects), GLOBAL_PROC_REF(IsTurfAtmosSafe))) if(!length(dron_turfs)) log_debug("Drone infestation failed to find viable turfs in \the [location].") kill(TRUE) diff --git a/code/modules/events/meteors.dm b/code/modules/events/meteors.dm index a1a97e7a41e8c..e33bbf870679e 100644 --- a/code/modules/events/meteors.dm +++ b/code/modules/events/meteors.dm @@ -32,7 +32,7 @@ /datum/event/meteor_wave/tick() // Begin sending the alarm signals to shield diffusers so the field is already regenerated (if it exists) by the time actual meteors start flying around. if(alarmWhen < activeFor) - for(var/obj/machinery/shield_diffuser/SD in SSmachines.machinery) + for(var/obj/machinery/shield_diffuser/SD as anything in SSmachines.get_machinery_of_type(/obj/machinery/shield_diffuser)) if(isStationLevel(SD.z)) SD.meteor_alarm(10) diff --git a/code/modules/events/mob_spawning/_mob_spawning.dm b/code/modules/events/mob_spawning/_mob_spawning.dm index 66725e7c98878..f71be476ac621 100644 --- a/code/modules/events/mob_spawning/_mob_spawning.dm +++ b/code/modules/events/mob_spawning/_mob_spawning.dm @@ -59,7 +59,7 @@ continue var/mob/spawned_mob = new mob_to_spawn() if (delete_on_end) - GLOB.destroyed_event.register(spawned_mob, src, .proc/mob_destroyed) + GLOB.destroyed_event.register(spawned_mob, src, PROC_REF(mob_destroyed)) LAZYADD(mobs, spawned_mob) remaining_to_spawn-- total_spawned++ @@ -76,7 +76,7 @@ */ /datum/event/mob_spawning/proc/mob_destroyed(mob/destroyed_mob) LAZYREMOVE(mobs, destroyed_mob) - GLOB.destroyed_event.unregister(destroyed_mob, src, .proc/mob_destroyed) + GLOB.destroyed_event.unregister(destroyed_mob, src, PROC_REF(mob_destroyed)) /** diff --git a/code/modules/events/power_surge.dm b/code/modules/events/power_surge.dm index 0414e34eca0db..183589e0da825 100644 --- a/code/modules/events/power_surge.dm +++ b/code/modules/events/power_surge.dm @@ -8,7 +8,7 @@ command_announcement.Announce("Energy readings indicate a minor shift in engine crystalline hyperstructure. Closer monitoring of crystal stability and power output is recommended.", "[location_name()] Supermatter Monitoring System", zlevels = affecting_z) /datum/event/power_surge/start() - for (var/obj/machinery/power/supermatter/S in SSmachines.machinery) + for (var/obj/machinery/power/supermatter/S as anything in SSmachines.get_machinery_of_type(/obj/machinery/power/supermatter)) if (!(S.z in affecting_z)) return S.reaction_power_modifier += 0.2 @@ -16,7 +16,7 @@ S.thermal_release_modifier += 1500 /datum/event/power_surge/end() - for (var/obj/machinery/power/supermatter/S in SSmachines.machinery) + for (var/obj/machinery/power/supermatter/S as anything in SSmachines.get_machinery_of_type(/obj/machinery/power/supermatter)) if (!(S.z in affecting_z)) return S.reaction_power_modifier = initial(S.reaction_power_modifier) diff --git a/code/modules/events/prison_break.dm b/code/modules/events/prison_break.dm index c6ff128528712..62b57acd1cf41 100644 --- a/code/modules/events/prison_break.dm +++ b/code/modules/events/prison_break.dm @@ -1,56 +1,68 @@ /datum/event/prison_break - startWhen = 5 + startWhen = 30 announceWhen = 75 endWhen = 60 - var/warning = 0.5 - var/list/area/areas = list() //List of areas to affect. Filled by start() + /// List of areas to affect. Filled by start() + var/list/area/areas = list() - var/eventDept = "Security" //Department name in announcement - var/list/areaName = list("Brig") //Names of areas mentioned in AI and Engineering announcements - var/list/areaType = list(/area/security/prison, /area/security/brig) //Area types to include. - var/list/areaNotType = list() //Area types to specifically exclude. + /// Department name in announcement + var/eventDept = "Security" -/datum/event/prison_break/setup() - announceWhen = rand(75, 105) - endWhen = announceWhen + rand(5, 25) - warning = rand(5, 10) / 10 + /// Names of areas mentioned in AI and Engineering announcements + var/list/areaName = list("Brig") + + /// Area types to include. + var/list/areaType = list( + /area/security/prison, + /area/security/brig + ) + + /// Area types to specifically exclude. + var/list/areaNotType = list() /datum/event/prison_break/announce() - if (areas && length(areas) > 0) - command_announcement.Announce("[pick("Gr3yT1d3 virus","Malignant trojan",)] detected in [location_name()] [eventDept] subroutines. Secure any compromised areas immediately.", "[location_name()] Anti-Virus Alert", zlevels = affecting_z) + if (!length(areas)) + return + var/location = location_name() + var/fluff = pick("Gr3yT1d3 virus","Malignant trojan") + command_announcement.Announce( + "[fluff] detected in [location] [eventDept] subroutines. Secure any compromised areas immediately.", + "[location] Anti-Virus Alert", + zlevels = affecting_z + ) /datum/event/prison_break/start() - for(var/area/A in world) - if(is_type_in_list(A,areaType) && !is_type_in_list(A,areaNotType)) - areas += A - - if(areas && length(areas) > 0) - var/my_department = "[location_name()] Firewall Subroutines" - var/rc_message = "An unknown malicious program has been detected in the [english_list(areaName)] lighting and airlock control systems at [stationtime2text()]. Systems will be fully compromised within approximately three minutes. Direct intervention is required immediately.
" - var/obj/machinery/message_server/MS = get_message_server() - if(MS) - MS.send_rc_message("Engineering", my_department, rc_message, "", "", 2) - for(var/mob/living/silicon/ai/A in GLOB.player_list) - to_chat(A, SPAN_DANGER("Malicious program detected in the [english_list(areaName)] lighting and airlock control systems by [my_department].")) - - else + for (var/area/area) + if (is_type_in_list(area, areaType) && !is_type_in_list(area, areaNotType)) + areas += area + if (!length(areas)) to_world_log("ERROR: Could not initate grey-tide. Unable to find suitable containment area.") kill() + return + var/my_department = "[location_name()] Firewall Subroutines" + var/areaDisplay = english_list(areaName) + var/message = {"\ + An unknown malicious program has been detected in the [areaDisplay] lighting and airlock \ + control systems at [stationtime2text()]. Systems will be fully compromised within approximately \ + three minutes. Direct intervention is required immediately.
\ + "} + var/obj/machinery/message_server/message_server = get_message_server() + if (message_server) + message_server.send_rc_message("Engineering", my_department, message, "", "", 2) + message = SPAN_DANGER("Malicious program detected in [areaDisplay] lighting and airlock control systems.") + for (var/mob/living/silicon/ai/ai in GLOB.player_list) + to_chat(ai, message) /datum/event/prison_break/tick() - if (activeFor >= warning * endWhen) - if (areas && length(areas) > 0) - var/obj/machinery/power/apc/theAPC = null - for (var/area/A in areas) - theAPC = A.get_apc() - if (theAPC && theAPC.operating) - theAPC.flicker_lighting() + for (var/area/area as anything in areas) + if (area.apc?.operating) + area.apc.flicker_lighting() /datum/event/prison_break/end() - for(var/area/A in shuffle(areas)) - A.prison_break() + for (var/area/area as anything in areas) + area.prison_break() diff --git a/code/modules/events/spider_infestation.dm b/code/modules/events/spider_infestation.dm index 54b39c2daad81..7660a4f00fc86 100644 --- a/code/modules/events/spider_infestation.dm +++ b/code/modules/events/spider_infestation.dm @@ -25,7 +25,7 @@ var/global/sent_spiders_to_station = 0 O.add_scan_data("spider_infestation", SPAN_COLOR(COLOR_RED, "Unidentified hostile lifeforms detected.")) - addtimer(new Callback(O, /obj/overmap/proc/remove_scan_data, "spider_infestation"), 10 MINUTES) + addtimer(new Callback(O, TYPE_PROC_REF(/obj/overmap, remove_scan_data), "spider_infestation"), 10 MINUTES) /datum/event/spider_infestation/start() var/list/vents = list() diff --git a/code/modules/fabrication/designs/general/designs_arms_ammo.dm b/code/modules/fabrication/designs/general/designs_arms_ammo.dm index ddc362ffce888..871ba1fc1bbc3 100644 --- a/code/modules/fabrication/designs/general/designs_arms_ammo.dm +++ b/code/modules/fabrication/designs/general/designs_arms_ammo.dm @@ -138,3 +138,11 @@ /datum/fabricator_recipe/arms_ammo/hidden/beandrum name = "ammunition (drum magazine, beanbag)" path = /obj/item/ammo_magazine/shotgunmag/beanbag + +/datum/fabricator_recipe/arms_ammo/hidden/nt10mag + name = "ammunition (NT41)" + path = /obj/item/ammo_magazine/n10mm + +/datum/fabricator_recipe/arms_ammo/hidden/shotgun_flechette + name = "ammunition (flechette, shotgun)" + path = /obj/item/ammo_casing/shotgun/flechette diff --git a/code/modules/fabrication/designs/general/designs_engineering.dm b/code/modules/fabrication/designs/general/designs_engineering.dm index 2559917c237de..9221585e23edf 100644 --- a/code/modules/fabrication/designs/general/designs_engineering.dm +++ b/code/modules/fabrication/designs/general/designs_engineering.dm @@ -22,3 +22,7 @@ /datum/fabricator_recipe/engineering/camera_assembly path = /obj/item/camera_assembly +// [SIERRA-ADD] +/datum/fabricator_recipe/engineering/transfer_valve + path = /obj/item/device/transfer_valve +// [/SIERRA-ADD] diff --git a/code/modules/fabrication/designs/general/designs_general.dm b/code/modules/fabrication/designs/general/designs_general.dm index fbad63d3aa109..63cbdbeddc0e7 100644 --- a/code/modules/fabrication/designs/general/designs_general.dm +++ b/code/modules/fabrication/designs/general/designs_general.dm @@ -113,3 +113,6 @@ /datum/fabricator_recipe/toolbox path = /obj/item/storage/toolbox + +/datum/fabricator_recipe/binoculars + path = /obj/item/device/binoculars diff --git a/code/modules/fabrication/fabricator_food.dm b/code/modules/fabrication/fabricator_food.dm index 3b9f6dd2e3863..a8759071d4183 100644 --- a/code/modules/fabrication/fabricator_food.dm +++ b/code/modules/fabrication/fabricator_food.dm @@ -18,15 +18,15 @@ return ..() var/true_text = lowertext(html_decode(text)) if(findtext(true_text, "status")) - addtimer(new Callback(src, /obj/machinery/fabricator/replicator/proc/state_status), 2 SECONDS, TIMER_UNIQUE | TIMER_OVERRIDE) + addtimer(new Callback(src, TYPE_PROC_REF(/obj/machinery/fabricator/replicator, state_status)), 2 SECONDS, TIMER_UNIQUE | TIMER_OVERRIDE) else if(findtext(true_text, "menu")) - addtimer(new Callback(src, /obj/machinery/fabricator/replicator/proc/state_menu), 2 SECONDS, TIMER_UNIQUE | TIMER_OVERRIDE) + addtimer(new Callback(src, TYPE_PROC_REF(/obj/machinery/fabricator/replicator, state_menu)), 2 SECONDS, TIMER_UNIQUE | TIMER_OVERRIDE) else for(var/datum/fabricator_recipe/recipe in SSfabrication.get_recipes(fabricator_class)) if(recipe.hidden && !(fab_status_flags & FAB_HACKED)) continue if(findtext(true_text, lowertext(recipe.name))) - addtimer(new Callback(src, /obj/machinery/fabricator/proc/try_queue_build, recipe, 1), 2 SECONDS) + addtimer(new Callback(src, TYPE_PROC_REF(/obj/machinery/fabricator, try_queue_build), recipe, 1), 2 SECONDS) break ..() diff --git a/code/modules/fabrication/fabricator_intake.dm b/code/modules/fabrication/fabricator_intake.dm index e284cb65f34a4..42fca0b43f37f 100644 --- a/code/modules/fabrication/fabricator_intake.dm +++ b/code/modules/fabrication/fabricator_intake.dm @@ -51,7 +51,7 @@ var/image/adding_mat_overlay = image(icon, "[base_icon_state]_mat") adding_mat_overlay.color = mat_colour AddOverlays(adding_mat_overlay) - addtimer(new Callback(src, /atom/proc/CutOverlays, adding_mat_overlay), 1 SECOND) + addtimer(new Callback(src, TYPE_PROC_REF(/atom, CutOverlays), adding_mat_overlay), 1 SECOND) if(istype(thing, /obj/item/stack)) var/obj/item/stack/S = thing S.use(stacks_used) diff --git a/code/modules/food/recipes_microwave.dm b/code/modules/food/recipes_microwave.dm index cb097d1c72a3b..367f6119e0cbc 100644 --- a/code/modules/food/recipes_microwave.dm +++ b/code/modules/food/recipes_microwave.dm @@ -885,6 +885,26 @@ result_path = /obj/item/reagent_containers/food/snacks/jelliedtoast/cherry +/datum/microwave_recipe/pbtoast + required_reagents = list( + /datum/reagent/nutriment/peanutbutter = 5 + ) + required_items = list( + /obj/item/reagent_containers/food/snacks/slice/bread + ) + result_path = /obj/item/reagent_containers/food/snacks/pbtoast + + +/datum/microwave_recipe/ntella_bread + required_reagents = list( + /datum/reagent/nutriment/choconutspread = 5 + ) + required_items = list( + /obj/item/reagent_containers/food/snacks/slice/bread + ) + result_path = /obj/item/reagent_containers/food/snacks/ntella_bread + + /datum/microwave_recipe/milosoup required_reagents = list( /datum/reagent/water = 10 @@ -1120,6 +1140,30 @@ result_path = /obj/item/reagent_containers/food/snacks/jellysandwich/cherry +/datum/microwave_recipe/pbjsandwich_cherry + required_reagents = list( + /datum/reagent/nutriment/cherryjelly = 5, + /datum/reagent/nutriment/peanutbutter = 5 + ) + required_items = list( + /obj/item/reagent_containers/food/snacks/slice/bread, + /obj/item/reagent_containers/food/snacks/slice/bread + ) + result_path = /obj/item/reagent_containers/food/snacks/pbjsandwich/cherry + + +/datum/microwave_recipe/pbjsandwich_slime + required_reagents = list( + /datum/reagent/slimejelly = 5, + /datum/reagent/nutriment/peanutbutter = 5 + ) + required_items = list( + /obj/item/reagent_containers/food/snacks/slice/bread, + /obj/item/reagent_containers/food/snacks/slice/bread + ) + result_path = /obj/item/reagent_containers/food/snacks/pbjsandwich/slime + + /datum/microwave_recipe/bloodsoup required_reagents = list( /datum/reagent/blood = 30 @@ -1431,6 +1475,17 @@ result_path = /obj/item/reagent_containers/food/snacks/sliceable/cheesecake +/datum/microwave_recipe/cake/ntella_cheesecake + required_reagents = list(/datum/reagent/drink/milk = 5, /datum/reagent/nutriment/choconutspread = 15, /datum/reagent/sugar = 10) + required_items = list( + /obj/item/reagent_containers/food/snacks/cheesewedge, + /obj/item/reagent_containers/food/snacks/cookie, + /obj/item/reagent_containers/food/snacks/cookie, + /obj/item/reagent_containers/food/snacks/cookie + ) + result_path = /obj/item/reagent_containers/food/snacks/sliceable/ntella_cheesecake + + /datum/microwave_recipe/cake/orange required_produce = list( "orange" = 1 diff --git a/code/modules/games/boardgame.dm b/code/modules/games/boardgame.dm index 23b8ed1c13bf9..857c985c18307 100644 --- a/code/modules/games/boardgame.dm +++ b/code/modules/games/boardgame.dm @@ -15,24 +15,27 @@ return TRUE return ..() -/obj/item/board/attackby(obj/item/I as obj, mob/user as mob) - if(!addPiece(I,user)) - ..() +/obj/item/board/use_tool(obj/item/item, mob/living/user, list/click_params) + if(addPiece(item,user)) + return TRUE + return ..() /obj/item/board/proc/addPiece(obj/item/I as obj, mob/user as mob, tile = 0) if(I.w_class != ITEM_SIZE_TINY) //only small stuff user.show_message(SPAN_WARNING("\The [I] is too big to be used as a board piece.")) - return 0 + return TRUE if(num == 64) user.show_message(SPAN_WARNING("\The [src] is already full!")) - return 0 + return TRUE if(tile > 0 && board["[tile]"]) user.show_message(SPAN_WARNING("That space is already filled!")) - return 0 + return TRUE if(!user.Adjacent(src)) - return 0 + to_chat(user, SPAN_WARNING("You need to be near \the [src].")) + return TRUE if(!user.unEquip(I, src)) - return 0 + FEEDBACK_UNEQUIP_FAILURE(user, I) + return TRUE num++ @@ -48,9 +51,9 @@ else board["[tile]"] = I - src.updateDialog() + updateDialog() - return 1 + return TRUE /obj/item/board/interact(mob/user as mob) diff --git a/code/modules/games/cards.dm b/code/modules/games/cards.dm index 53ac8920f8982..581ed16df32fc 100644 --- a/code/modules/games/cards.dm +++ b/code/modules/games/cards.dm @@ -85,15 +85,15 @@ P.card_icon = "joker" cards += P -/obj/item/deck/attackby(obj/O, mob/user) +/obj/item/deck/use_tool(obj/item/O, mob/living/user, list/click_params) if(istype(O,/obj/item/hand)) var/obj/item/hand/H = O for(var/datum/playingcard/P in H.cards) cards += P qdel(O) to_chat(user, "You place your cards on the bottom of \the [src].") - return - ..() + return TRUE + return ..() /obj/item/deck/verb/draw_card() @@ -159,12 +159,13 @@ H.concealed = 1 H.update_icon() if(user==target) - user.visible_message("\The [user] deals a card to \himself.") + var/datum/pronouns/pronouns = user.choose_from_pronouns() + user.visible_message("\The [user] deals a card to [pronouns.self].") else user.visible_message("\The [user] deals a card to \the [target].") H.throw_at(get_step(target,target.dir),10,1,user) -/obj/item/hand/attackby(obj/O, mob/user) +/obj/item/hand/use_tool(obj/item/O, mob/living/user, list/click_params) if(istype(O,/obj/item/hand)) var/obj/item/hand/H = O for(var/datum/playingcard/P in cards) @@ -172,8 +173,8 @@ H.concealed = src.concealed qdel(src) H.update_icon() - return - ..() + return TRUE + return ..() /obj/item/deck/attack_self(mob/user) diff --git a/code/modules/genetics/side_effects.dm b/code/modules/genetics/side_effects.dm index 744e7f2518e62..36abd1eaa4b93 100644 --- a/code/modules/genetics/side_effects.dm +++ b/code/modules/genetics/side_effects.dm @@ -15,14 +15,14 @@ /datum/genetics/side_effect/proc/trigger_side_effect(mob/living/carbon/human/H) if(ishuman(H)) - addtimer(new Callback(src, .proc/do_side_effect, H), 0) + addtimer(new Callback(src, PROC_REF(do_side_effect), H), 0) /datum/genetics/side_effect/proc/do_side_effect(mob/living/carbon/human/H) var/tp = pick(typesof(/datum/genetics/side_effect) - /datum/genetics/side_effect) var/datum/genetics/side_effect/S = new tp S.start(H) - addtimer(new Callback(H, /mob/proc/Weaken, rand(0, S.duration / 50)), 20) + addtimer(new Callback(H, TYPE_PROC_REF(/mob, Weaken), rand(0, S.duration / 50)), 20) sleep(S.duration) H.SetWeakened(0) S.finish(H) diff --git a/code/modules/ghosttrap/trap.dm b/code/modules/ghosttrap/trap.dm index 89f54742ec174..c213efa1bd3b5 100644 --- a/code/modules/ghosttrap/trap.dm +++ b/code/modules/ghosttrap/trap.dm @@ -77,7 +77,7 @@ var/global/list/ghost_traps /datum/ghosttrap/proc/request_player(mob/target, request_string, request_timeout) if(request_timeout) request_timeouts[target] = world.time + request_timeout - GLOB.destroyed_event.register(target, src, /datum/ghosttrap/proc/unregister_target) + GLOB.destroyed_event.register(target, src, TYPE_PROC_REF(/datum/ghosttrap, unregister_target)) else unregister_target(target) @@ -92,7 +92,7 @@ var/global/list/ghost_traps /datum/ghosttrap/proc/unregister_target(target) request_timeouts -= target - GLOB.destroyed_event.unregister(target, src, /datum/ghosttrap/proc/unregister_target) + GLOB.destroyed_event.unregister(target, src, TYPE_PROC_REF(/datum/ghosttrap, unregister_target)) // Handles a response to request_player(). /datum/ghosttrap/Topic(href, href_list) diff --git a/code/modules/goals/_goal.dm b/code/modules/goals/_goal.dm index 2ea423bfca691..b58ece1c82f1e 100644 --- a/code/modules/goals/_goal.dm +++ b/code/modules/goals/_goal.dm @@ -8,7 +8,7 @@ /datum/goal/New(_owner) owner = _owner - GLOB.destroyed_event.register(owner, src, /datum/proc/qdel_self) + GLOB.destroyed_event.register(owner, src, TYPE_PROC_REF(/datum, qdel_self)) if(istype(owner, /datum/mind)) var/datum/mind/mind = owner LAZYADD(mind.goals, src) diff --git a/code/modules/goals/definitions/department_clerical.dm b/code/modules/goals/definitions/department_clerical.dm index be137ba83932e..dbcf5e48e9748 100644 --- a/code/modules/goals/definitions/department_clerical.dm +++ b/code/modules/goals/definitions/department_clerical.dm @@ -126,18 +126,18 @@ if(length(has_signed)) to_chat(user, SPAN_NOTICE("It has been signed by: [english_list(has_signed)].")) -/obj/item/paperwork/attackby(obj/item/W, mob/user) +/obj/item/paperwork/use_tool(obj/item/W, mob/living/user, list/click_params) if(istype(W, /obj/item/pen)) if(user.real_name in has_signed) to_chat(user, SPAN_WARNING("You have already signed \the [src].")) - return + return TRUE if(!(user.real_name in needs_signed)) to_chat(user, SPAN_WARNING("You can't see anywhere on \the [src] for you to sign; it doesn't need your signature.")) - return + return TRUE LAZYADD(has_signed, user.real_name) LAZYREMOVE(needs_signed, user.real_name) user.visible_message(SPAN_NOTICE("\The [user] signs \the [src] with \the [W].")) associated_goal?.update_strings() update_icon() return TRUE - . = ..() + return ..() diff --git a/code/modules/goals/definitions/personal_achievement_movement.dm b/code/modules/goals/definitions/personal_achievement_movement.dm index b63dbcda23983..d9465253e72dc 100644 --- a/code/modules/goals/definitions/personal_achievement_movement.dm +++ b/code/modules/goals/definitions/personal_achievement_movement.dm @@ -3,7 +3,7 @@ ..() if(owner) var/datum/mind/mind = owner - GLOB.moved_event.register(mind.current, src, .proc/owner_moved) + GLOB.moved_event.register(mind.current, src, PROC_REF(owner_moved)) /datum/goal/movement/proc/owner_moved() return @@ -40,7 +40,7 @@ /datum/goal/movement/walk/check_success() return (steps >= required_steps) - + /datum/goal/movement/walk/update_strings() description = "Stave off microgravity muscle atrophy by walking at least [required_steps] step\s this shift." @@ -54,4 +54,4 @@ return istype(mind.current.loc, /turf/space) /datum/goal/movement/walk/eva/update_strings() - description = "It's so stuffy inside. Go for a spacewalk - at least [required_steps] step\s." \ No newline at end of file + description = "It's so stuffy inside. Go for a spacewalk - at least [required_steps] step\s." diff --git a/code/modules/holodeck/HolodeckObjects.dm b/code/modules/holodeck/HolodeckObjects.dm index bd3fd4e010e64..a2c6651f06c11 100644 --- a/code/modules/holodeck/HolodeckObjects.dm +++ b/code/modules/holodeck/HolodeckObjects.dm @@ -168,28 +168,24 @@ /obj/machinery/door/window/holowindoor/Destroy() ..() -/obj/machinery/door/window/holowindoor/attackby(obj/item/I as obj, mob/user as mob) - +/obj/machinery/door/window/holowindoor/use_tool(obj/item/I, mob/living/user, list/click_params) if (operating == DOOR_OPERATING_YES) - return - - if (user.a_intent == I_HURT) return ..() - src.add_fingerprint(user) - if (!src.requiresID()) + if (!requiresID()) user = null - if (src.allowed(user)) - if (src.density) + if (allowed(user)) + if (density) open() else close() - else if (src.density) - flick(text("[]deny", src.base_state), src) + else if (density) + flick(text("[]deny", base_state), src) + return TRUE - return + return ..() /obj/machinery/door/window/holowindoor/shatter(display_message = 1) src.set_density(0) diff --git a/code/modules/holomap/ship_holomap.dm b/code/modules/holomap/ship_holomap.dm index 95cf7c4de79b1..c5ebd72314bc6 100644 --- a/code/modules/holomap/ship_holomap.dm +++ b/code/modules/holomap/ship_holomap.dm @@ -112,8 +112,8 @@ user.client.images |= holomap_datum.station_map watching_mob = user - GLOB.moved_event.register(watching_mob, src, /obj/machinery/ship_map/proc/checkPosition) - GLOB.destroyed_event.register(watching_mob, src, /obj/machinery/ship_map/proc/stopWatching) + GLOB.moved_event.register(watching_mob, src, TYPE_PROC_REF(/obj/machinery/ship_map, checkPosition)) + GLOB.destroyed_event.register(watching_mob, src, TYPE_PROC_REF(/obj/machinery/ship_map, stopWatching)) update_use_power(POWER_USE_ACTIVE) if(bogus) @@ -137,7 +137,7 @@ if(watching_mob.client) animate(holomap_datum.station_map, alpha = 0, time = 5, easing = LINEAR_EASING) var/mob/M = watching_mob - addtimer(new Callback(src, .proc/clear_image, M, holomap_datum.station_map), 0.5 SECONDS)//we give it time to fade out + addtimer(new Callback(src, PROC_REF(clear_image), M, holomap_datum.station_map), 0.5 SECONDS)//we give it time to fade out GLOB.moved_event.unregister(watching_mob, src) GLOB.destroyed_event.unregister(watching_mob, src) watching_mob = null diff --git a/code/modules/hydroponics/grown.dm b/code/modules/hydroponics/grown.dm index 3b76726b5d501..4cf87ca64d464 100644 --- a/code/modules/hydroponics/grown.dm +++ b/code/modules/hydroponics/grown.dm @@ -166,15 +166,14 @@ if(seed) seed.thrown_at(src,hit_atom) ..() -/obj/item/reagent_containers/food/snacks/grown/attackby(obj/item/W, mob/user) - +/obj/item/reagent_containers/food/snacks/grown/use_tool(obj/item/W, mob/living/user, list/click_params) if(seed) if(isCoil(W)) var/obj/item/stack/cable_coil/C = W if(seed.get_trait(TRAIT_PRODUCT_ICON) in list("flower2","flower3","flower4","flower5","flower6")) if(!C.can_use(1)) USE_FEEDBACK_STACK_NOT_ENOUGH(C, 1, "to make a pin out of \the [src.name].") - return + return TRUE C.use(1) to_chat(user, SPAN_NOTICE("You add some wire to the [src.name] and make a pin.")) var/obj/item/clothing/head/hairflower/pin = new /obj/item/clothing/head/hairflower(get_turf(src)) @@ -188,23 +187,23 @@ pin.item_state = "hairflower" pin.color = src.color qdel(src) - return + return TRUE else if(seed.get_trait(TRAIT_PRODUCES_POWER)) if(!C.can_use(5)) USE_FEEDBACK_STACK_NOT_ENOUGH(C, 5, "to wire \the [src.name].") - return + return TRUE to_chat(user, SPAN_NOTICE("You add some cable to the [src.name] and slide it inside the battery casing.")) var/obj/item/cell/potato/pocell = new /obj/item/cell/potato(get_turf(src)) pocell.maxcharge = src.potency * 10 pocell.charge = pocell.maxcharge qdel(src) - return + return TRUE else if(W.sharp) if(seed.kitchen_tag == "pumpkin") // Ugggh these checks are awful. user.show_message(SPAN_NOTICE("You carve a face into [src]!"), 1) new /obj/item/clothing/head/pumpkinhead (user.loc) qdel(src) - return + return TRUE else if(seed.chems) if(isHatchet(W)) if(!isnull(seed.chems[/datum/reagent/woodpulp])) @@ -219,22 +218,22 @@ user.visible_message(SPAN_NOTICE("\The [user] makes resin slabs out of \the [src].")) new /obj/item/stack/material/wood/vox(user.loc) qdel(src) - return + return TRUE else if(!isnull(seed.chems[/datum/reagent/drink/juice/potato])) to_chat(user, "You slice \the [src] into sticks.") new /obj/item/reagent_containers/food/snacks/rawsticks(get_turf(src)) qdel(src) - return + return TRUE else if(!isnull(seed.chems[/datum/reagent/drink/juice/carrot])) to_chat(user, "You slice \the [src] into sticks.") new /obj/item/reagent_containers/food/snacks/carrotfries(get_turf(src)) qdel(src) - return + return TRUE else if(!isnull(seed.chems[/datum/reagent/drink/milk/soymilk])) to_chat(user, "You roughly chop up \the [src].") new /obj/item/reagent_containers/food/snacks/soydope(get_turf(src)) qdel(src) - return + return TRUE else if(seed.get_trait(TRAIT_FLESH_COLOUR)) to_chat(user, "You slice up \the [src].") var/slices = rand(3,5) @@ -243,8 +242,8 @@ var/obj/item/reagent_containers/food/snacks/fruit_slice/F = new(get_turf(src),seed) if(reagents_to_transfer) reagents.trans_to_obj(F,reagents_to_transfer) qdel(src) - return - ..() + return TRUE + return ..() /obj/item/reagent_containers/food/snacks/grown/apply_hit_effect(mob/living/target, mob/living/user, hit_zone) . = ..() @@ -289,7 +288,7 @@ continue if(NG.amount>=NG.max_amount) continue - NG.attackby(G, user) + NG.use_tool(G, user) to_chat(user, "You add the newly-formed grass to the stack. It now contains [G.amount] tiles.") qdel(src) return diff --git a/code/modules/hydroponics/grown_inedible.dm b/code/modules/hydroponics/grown_inedible.dm index 1d1c588b342cd..14ec0857d7374 100644 --- a/code/modules/hydroponics/grown_inedible.dm +++ b/code/modules/hydroponics/grown_inedible.dm @@ -24,8 +24,7 @@ var/carve_time = 5 SECONDS var/result_type = null -/obj/item/carvable/attackby(obj/item/W, mob/user) - ..() +/obj/item/carvable/use_tool(obj/item/W, mob/living/user, list/click_params) if (result_type && is_type_in_list(W, allow_tool_types)) user.visible_message( SPAN_ITALIC("\The [user] starts to carve \the [src] with \a [W]."), @@ -34,7 +33,7 @@ ) if (!do_after(user, carve_time, src, DO_PUBLIC_UNIQUE)) to_chat(user, SPAN_ITALIC("You stop carving \the [src].")) - return + return TRUE var/result = new result_type() user.put_in_hands(result) user.visible_message( @@ -42,6 +41,9 @@ range = 5 ) qdel(src) + return TRUE + + return ..() /obj/item/carvable/corncob name = "corn cob" diff --git a/code/modules/hydroponics/seed_datums.dm b/code/modules/hydroponics/seed_datums.dm index 7f901689c8ea8..33e74c91ff1c3 100644 --- a/code/modules/hydroponics/seed_datums.dm +++ b/code/modules/hydroponics/seed_datums.dm @@ -648,7 +648,7 @@ name = "peanut" seed_name = "peanut" display_name = "peanut plant" - chems = list(/datum/reagent/nutriment = list(1,10)) + chems = list(/datum/reagent/nutriment/groundpeanuts = list(3,5)) kitchen_tag = "peanut" /datum/seed/peanuts/New() @@ -1643,7 +1643,7 @@ name = "aghrassh" seed_name = "aghrassh" display_name = "aghrassh tree" - chems = list(/datum/reagent/nutriment = list(1,20)) + chems = list(/datum/reagent/nutriment = list(1,10), /datum/reagent/silver = list(1,3)) kitchen_tag = "aghrassh" /datum/seed/aghrassh/New() @@ -1823,7 +1823,7 @@ name = "almond" seed_name = "almond" display_name = "almond plant" - chems = list(/datum/reagent/nutriment = list(1,10)) + chems = list(/datum/reagent/nutriment/almondmeal = list(4,7)) kitchen_tag = "almond" /datum/seed/almond/New() diff --git a/code/modules/hydroponics/spreading/spreading.dm b/code/modules/hydroponics/spreading/spreading.dm index 0c902f6c2c4d8..94c84736b69c7 100644 --- a/code/modules/hydroponics/spreading/spreading.dm +++ b/code/modules/hydroponics/spreading/spreading.dm @@ -3,7 +3,7 @@ /proc/spacevine_infestation(potency_min=70, potency_max=100, maturation_min=5, maturation_max=15) spawn() //to stop the secrets panel hanging - var/turf/T = pick_subarea_turf(/area/hallway , list(/proc/is_station_turf, /proc/not_turf_contains_dense_objects)) + var/turf/T = pick_subarea_turf(/area/hallway , list(GLOBAL_PROC_REF(is_station_turf), GLOBAL_PROC_REF(not_turf_contains_dense_objects))) if(T) var/datum/seed/seed = SSplants.create_random_seed(1) seed.set_trait(TRAIT_SPREAD,2) // So it will function properly as vines. diff --git a/code/modules/integrated_electronics/core/assemblies.dm b/code/modules/integrated_electronics/core/assemblies.dm index 2813b75e731a0..1c633cf218458 100644 --- a/code/modules/integrated_electronics/core/assemblies.dm +++ b/code/modules/integrated_electronics/core/assemblies.dm @@ -80,7 +80,7 @@ spark_system.start() playsound(loc, 'sound/items/electronic_assembly_empty.ogg', 100, 1) icon = 0 - addtimer(new Callback(src, .proc/fall_apart), 5.1) + addtimer(new Callback(src, PROC_REF(fall_apart)), 5.1) /obj/item/device/electronic_assembly/post_health_change(health_mod, prior_health, damage_type) ..() @@ -725,6 +725,12 @@ icon_state = "setup_large_industrial" desc = "It's a case used for assembling large electronics. This one resembles some kind of industrial machinery." +/obj/item/device/electronic_assembly/large/exo + name = "type-a exosuit electronic assembly" + icon_state = "setup_medium_radio" + desc = "It's a case, for building large electronics with. This one resembles a box, or some type of rack for weapon." + allowed_circuit_action_flags = IC_ACTION_COMBAT | IC_ACTION_LONG_RANGE + /obj/item/device/electronic_assembly/drone name = "electronic drone" icon_state = "setup_drone" diff --git a/code/modules/integrated_electronics/core/printer.dm b/code/modules/integrated_electronics/core/printer.dm index 5d4a6e97581d4..49aad65065d32 100644 --- a/code/modules/integrated_electronics/core/printer.dm +++ b/code/modules/integrated_electronics/core/printer.dm @@ -358,7 +358,7 @@ to_chat(usr, SPAN_NOTICE("You begin printing a custom assembly. This will take approximately [round(cloning_time/10)] seconds. You can still print \ off normal parts during this time.")) playsound(src, 'sound/items/poster_being_created.ogg', 50, TRUE) - addtimer(new Callback(src, .proc/print_program, usr), cloning_time) + addtimer(new Callback(src, PROC_REF(print_program), usr), cloning_time) if("cancel") if(!cloning || !program) diff --git a/code/modules/integrated_electronics/core/wirer.dm b/code/modules/integrated_electronics/core/wirer.dm index b2cce9bc41a6e..eb1f998d21464 100644 --- a/code/modules/integrated_electronics/core/wirer.dm +++ b/code/modules/integrated_electronics/core/wirer.dm @@ -81,7 +81,7 @@ if(selected_io) unselect_io(selected_io) selected_io = io - GLOB.destroyed_event.register(selected_io, src, .proc/unselect_io) + GLOB.destroyed_event.register(selected_io, src, PROC_REF(unselect_io)) switch(mode) if(UNWIRE) mode = UNWIRING diff --git a/code/modules/integrated_electronics/subtypes/input.dm b/code/modules/integrated_electronics/subtypes/input.dm index 2fcd9694cd60b..76d9ecbc3ffb5 100644 --- a/code/modules/integrated_electronics/subtypes/input.dm +++ b/code/modules/integrated_electronics/subtypes/input.dm @@ -808,7 +808,7 @@ . = list() . += "Current selection: [(current_console && current_console.id) || "None"]" . += "Please select a teleporter to lock in on:" - for (var/obj/machinery/computer/teleporter/computer in SSmachines.machinery) + for (var/obj/machinery/computer/teleporter/computer as anything in SSmachines.get_machinery_of_type(/obj/machinery/computer/teleporter)) if (computer.target && computer.operable() && AreConnectedZLevels(get_z(src), get_z(computer))) .["[computer.id] ([computer.active ? "Active" : "Inactive"])"] = "tport=[any2ref(computer)]" .["None (Dangerous)"] = "tport=random" diff --git a/code/modules/integrated_electronics/subtypes/manipulation.dm b/code/modules/integrated_electronics/subtypes/manipulation.dm index fe040ecc888a1..eb8113e3112c8 100644 --- a/code/modules/integrated_electronics/subtypes/manipulation.dm +++ b/code/modules/integrated_electronics/subtypes/manipulation.dm @@ -34,14 +34,15 @@ QDEL_NULL(installed_gun) return ..() -/obj/item/integrated_circuit/manipulation/weapon_firing/attackby(obj/O, mob/user) +/obj/item/integrated_circuit/manipulation/weapon_firing/use_tool(obj/item/O, mob/living/user, list/click_params) if(istype(O, /obj/item/gun/energy)) var/obj/item/gun/energy/gun = O if(installed_gun) to_chat(user, SPAN_WARNING("There's already a weapon installed.")) - return + return TRUE if(!user.unEquip(gun,src)) - return + FEEDBACK_UNEQUIP_FAILURE(user, gun) + return TRUE installed_gun = gun to_chat(user, SPAN_NOTICE("You slide \the [gun] into the firing mechanism.")) playsound(src, 'sound/items/Crowbar.ogg', 50, 1) @@ -56,8 +57,9 @@ var/datum/firemode/fm = installed_gun.firemodes[installed_gun.sel_mode] set_pin_data(IC_OUTPUT, 2, fm.name) push_data() - else - ..() + return TRUE + + return ..() /obj/item/integrated_circuit/manipulation/weapon_firing/attack_self(mob/user) if(installed_gun) @@ -180,16 +182,20 @@ detach_grenade() return ..() -/obj/item/integrated_circuit/manipulation/grenade/attackby(obj/item/grenade/G, mob/user) - if(istype(G)) +/obj/item/integrated_circuit/manipulation/grenade/use_tool(obj/item/G, mob/living/user, list/click_params) + if(istype(G, /obj/item/grenade)) if(attached_grenade) to_chat(user, SPAN_WARNING("There is already a grenade attached!")) - else if(user.unEquip(G,src)) - user.visible_message(SPAN_WARNING("\The [user] attaches \a [G] to \the [src]!"), SPAN_NOTICE("You attach \the [G] to \the [src].")) - attach_grenade(G) - G.forceMove(src) - else - return ..() + return TRUE + if (!user.unEquip(G,src)) + FEEDBACK_UNEQUIP_FAILURE(user, G) + return TRUE + user.visible_message(SPAN_WARNING("\The [user] attaches \a [G] to \the [src]!"), SPAN_NOTICE("You attach \the [G] to \the [src].")) + attach_grenade(G) + G.forceMove(src) + return TRUE + + return ..() /obj/item/integrated_circuit/manipulation/grenade/attack_self(mob/user) if(attached_grenade) @@ -207,7 +213,7 @@ dt = clamp(detonation_time.data, 1, 12)*10 else dt = 15 - addtimer(new Callback(attached_grenade, /obj/item/grenade.proc/activate), dt) + addtimer(new Callback(attached_grenade, TYPE_PROC_REF(/obj/item/grenade, activate)), dt) var/atom/holder = loc log_and_message_admins("activated a grenade assembly. Last touches: Assembly: [holder.fingerprintslast] Circuit: [fingerprintslast] Grenade: [attached_grenade.fingerprintslast]") @@ -420,9 +426,9 @@ set_pin_data(IC_OUTPUT, 1, TRUE) pulling = to_pull acting_object.visible_message("\The [acting_object] starts pulling \the [to_pull] around.") - GLOB.moved_event.register(to_pull, src, .proc/check_pull) //Whenever the target moves, make sure we can still pull it! - GLOB.destroyed_event.register(to_pull, src, .proc/stop_pulling) //Stop pulling if it gets destroyed - GLOB.moved_event.register(acting_object, src, .proc/pull) //Make sure we actually pull it. + GLOB.moved_event.register(to_pull, src, PROC_REF(check_pull)) //Whenever the target moves, make sure we can still pull it! + GLOB.destroyed_event.register(to_pull, src, PROC_REF(stop_pulling)) //Stop pulling if it gets destroyed + GLOB.moved_event.register(acting_object, src, PROC_REF(pull)) //Make sure we actually pull it. push_data() if(3) if(pulling) @@ -645,10 +651,11 @@ controlling = null -/obj/item/integrated_circuit/manipulation/ai/attackby(obj/item/I, mob/user) - if(is_type_in_list(I, list(/obj/item/aicard, /obj/item/device/paicard, /obj/item/device/mmi))) - load_ai(user, I) - else return ..() +/obj/item/integrated_circuit/manipulation/ai/use_tool(obj/item/item, mob/living/user, list/click_params) + if(is_type_in_list(item, list(/obj/item/aicard, /obj/item/device/paicard, /obj/item/device/mmi))) + load_ai(user, item) + return TRUE + return ..() /obj/item/integrated_circuit/manipulation/ai/attack_self(user) unload_ai() diff --git a/code/modules/integrated_electronics/subtypes/smart.dm b/code/modules/integrated_electronics/subtypes/smart.dm index 5df38cb014261..773e3ec4fe2e8 100644 --- a/code/modules/integrated_electronics/subtypes/smart.dm +++ b/code/modules/integrated_electronics/subtypes/smart.dm @@ -119,7 +119,7 @@ if(Pl&&islist(Pl)) idc.access = Pl var/turf/a_loc = get_turf(assembly) - var/list/P = AStar(a_loc, locate(get_pin_data(IC_INPUT, 1), get_pin_data(IC_INPUT, 2), a_loc.z), /turf/proc/CardinalTurfsWithAccess, /turf/proc/Distance, 0, 200, id=idc, exclude=get_turf(get_pin_data_as_type(IC_INPUT, 3, /atom))) + var/list/P = AStar(a_loc, locate(get_pin_data(IC_INPUT, 1), get_pin_data(IC_INPUT, 2), a_loc.z), TYPE_PROC_REF(/turf, CardinalTurfsWithAccess), TYPE_PROC_REF(/turf, Distance), 0, 200, id=idc, exclude=get_turf(get_pin_data_as_type(IC_INPUT, 3, /atom))) if(!P) activate_pin(3) diff --git a/code/modules/integrated_electronics/subtypes/time.dm b/code/modules/integrated_electronics/subtypes/time.dm index 8f621e9d375ba..58327fc2ca114 100644 --- a/code/modules/integrated_electronics/subtypes/time.dm +++ b/code/modules/integrated_electronics/subtypes/time.dm @@ -17,7 +17,7 @@ power_draw_per_use = 2 /obj/item/integrated_circuit/time/delay/do_work() - addtimer(new Callback(src, .proc/activate_pin, 2), delay) + addtimer(new Callback(src, PROC_REF(activate_pin), 2), delay) /obj/item/integrated_circuit/time/delay/five_sec name = "five-sec delay circuit" @@ -98,7 +98,7 @@ /obj/item/integrated_circuit/time/ticker/proc/tick() if(is_running) - addtimer(new Callback(src, .proc/tick), delay) + addtimer(new Callback(src, PROC_REF(tick)), delay) if(world.time > next_fire) next_fire = world.time + delay activate_pin(1) diff --git a/code/modules/item_worth/worths_list.dm b/code/modules/item_worth/worths_list.dm index b61b8cd39f557..1eeebdcaf083d 100644 --- a/code/modules/item_worth/worths_list.dm +++ b/code/modules/item_worth/worths_list.dm @@ -472,7 +472,14 @@ var/global/list/worths = list( /obj/item/device/dociler = 490, /obj/item/device/bot_controller = 50, /obj/item/device/mmi = 1200, + // [SIERRA-REMOVE] - MECHS_BY_SHEGAR, + /*, /obj/item/device/kit/paint = 500, + */ + // [/SIERRA-REMOVE], + // [SIERRA-ADD] - MECHS_BY_SHEGAR, + /obj/item/device/kit/mech = 500, + // [/SIERRA-ADD], /obj/item/device/kit = 100, /obj/item/aicard = 6000, /obj/item/device/chameleon = 4000, diff --git a/code/modules/library/lib_items.dm b/code/modules/library/lib_items.dm index 78cfd08103a24..634a5cb0b5b32 100644 --- a/code/modules/library/lib_items.dm +++ b/code/modules/library/lib_items.dm @@ -188,60 +188,68 @@ else to_chat(user, "This book is completely blank!") -/obj/item/book/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/book/use_tool(obj/item/W, mob/living/user, list/click_params) if(carved == 1) if(!store) if(W.w_class < ITEM_SIZE_NORMAL) if(!user.unEquip(W, src)) - return + FEEDBACK_UNEQUIP_FAILURE(user, W) + return TRUE store = W - to_chat(user, SPAN_NOTICE("You put [W] in [title].")) - return + to_chat(user, SPAN_NOTICE("You put \the [W] in \the [title].")) + return TRUE else - to_chat(user, SPAN_NOTICE("[W] won't fit in [title].")) - return + to_chat(user, SPAN_WARNING("\The [W] won't fit in \the [title].")) + return TRUE else - to_chat(user, SPAN_NOTICE("There's already something in [title]!")) - return - if(istype(W, /obj/item/pen)) + to_chat(user, SPAN_WARNING("There's already something in [title]!")) + return TRUE + + else if(istype(W, /obj/item/pen)) if(unique) - to_chat(user, "These pages don't seem to take the ink well. Looks like you can't modify it.") - return + to_chat(user, SPAN_WARNING("These pages don't seem to take the ink well. Looks like you can't modify it.")) + return TRUE var/choice = input("What would you like to change?") in list("Title", "Contents", "Author", "Cancel") switch(choice) if("Title") var/newtitle = reject_bad_text(sanitizeSafe(input("Write a new title:"))) if(!newtitle) - to_chat(usr, "The title is invalid.") - return + to_chat(user, SPAN_WARNING("The title is invalid.")) + return TRUE else - src.SetName(newtitle) - src.title = newtitle + SetName(newtitle) + title = newtitle + return TRUE if("Contents") var/content = sanitize(input("Write your book's contents (HTML NOT allowed):") as message|null, MAX_BOOK_MESSAGE_LEN) if(!content) - to_chat(usr, "The content is invalid.") - return + to_chat(user, SPAN_WARNING("The content is invalid.")) + return TRUE else - src.dat += content + dat += content + return TRUE if("Author") var/newauthor = sanitize(input(usr, "Write the author's name:")) if(!newauthor) - to_chat(usr, "The name is invalid.") - return + to_chat(user, SPAN_WARNING("The name is invalid.")) + return TRUE else - src.author = newauthor + author = newauthor + return TRUE else - return + return TRUE + else if(istype(W, /obj/item/material/knife) || isWirecutter(W)) - if(carved) return - to_chat(user, SPAN_NOTICE("You begin to carve out [title].")) + if(carved) + to_chat(user, SPAN_WARNING("\The [src] already has something carved in it.")) + return TRUE + to_chat(user, SPAN_NOTICE("You begin to carve out \the [title].")) if(do_after(user, 3 SECONDS, src, DO_PUBLIC_UNIQUE)) - to_chat(user, SPAN_NOTICE("You carve out the pages from [title]! You didn't want to read it anyway.")) + to_chat(user, SPAN_NOTICE("You carve out the pages from \the [title]! You didn't want to read it anyway.")) carved = 1 - return - else - ..() + return TRUE + + return ..() /obj/item/book/use_before(mob/living/carbon/M as mob, mob/living/carbon/user as mob) . = FALSE diff --git a/code/modules/locks/lock_construct.dm b/code/modules/locks/lock_construct.dm index e1f75e1e4e6ba..2a11e1f7aa315 100644 --- a/code/modules/locks/lock_construct.dm +++ b/code/modules/locks/lock_construct.dm @@ -12,7 +12,7 @@ throwforce = 0 lock_data = generateRandomString(round(material.integrity/50)) -/obj/item/material/lock_construct/attackby(obj/item/I, mob/user) +/obj/item/material/lock_construct/use_tool(obj/item/I, mob/living/user, list/click_params) if(istype(I,/obj/item/key)) var/obj/item/key/K = I if(!K.key_data) @@ -20,13 +20,15 @@ K.key_data = lock_data else to_chat(user, SPAN_WARNING("\The [I] already unlocks something...")) - return + return TRUE + if(istype(I,/obj/item/material/lock_construct)) var/obj/item/material/lock_construct/L = I src.lock_data = L.lock_data to_chat(user, SPAN_NOTICE("You copy the lock from \the [L] to \the [src], making them identical.")) - return - ..() + return TRUE + + return ..() /obj/item/material/lock_construct/proc/create_lock(atom/target, mob/user) . = new /datum/lock(target,lock_data) diff --git a/code/modules/maps/helper_landmarks.dm b/code/modules/maps/helper_landmarks.dm index c2813737c6bfb..6d301ae8479d1 100644 --- a/code/modules/maps/helper_landmarks.dm +++ b/code/modules/maps/helper_landmarks.dm @@ -56,11 +56,11 @@ /obj/landmark/delete_on_shuttle/Initialize() . = ..() - GLOB.shuttle_added.register_global(src, .proc/check_shuttle) + GLOB.shuttle_added.register_global(src, PROC_REF(check_shuttle)) /obj/landmark/delete_on_shuttle/proc/check_shuttle(shuttle) if(SSshuttle.shuttles[shuttle_name] == shuttle) - GLOB.shuttle_moved_event.register(shuttle, src, .proc/delete_everything) + GLOB.shuttle_moved_event.register(shuttle, src, PROC_REF(delete_everything)) shuttle_datum = shuttle /obj/landmark/delete_on_shuttle/proc/delete_everything() @@ -70,7 +70,7 @@ qdel(src) /obj/landmark/delete_on_shuttle/Destroy() - GLOB.shuttle_added.unregister_global(src, .proc/check_shuttle) + GLOB.shuttle_added.unregister_global(src, PROC_REF(check_shuttle)) if(shuttle_datum) - GLOB.shuttle_moved_event.unregister(shuttle_datum, src, .proc/delete_everything) + GLOB.shuttle_moved_event.unregister(shuttle_datum, src, PROC_REF(delete_everything)) . = ..() diff --git a/code/modules/materials/definitions/materials_metal.dm b/code/modules/materials/definitions/materials_metal.dm index 2ca9e72061801..f7da50c3954e5 100644 --- a/code/modules/materials/definitions/materials_metal.dm +++ b/code/modules/materials/definitions/materials_metal.dm @@ -249,6 +249,7 @@ sale_price = 3 ore_smelts_to = MATERIAL_OSMIUM value = 30 + weight = 29 /material/tritium name = MATERIAL_TRITIUM diff --git a/code/modules/materials/definitions/materials_mineral.dm b/code/modules/materials/definitions/materials_mineral.dm index c38311e9e17e4..a2e7fad21e3b2 100644 --- a/code/modules/materials/definitions/materials_mineral.dm +++ b/code/modules/materials/definitions/materials_mineral.dm @@ -306,5 +306,5 @@ var/phoronToDeduce = (temperature/30) * effect_multiplier totalPhoron += phoronToDeduce target_tile.assume_gas(GAS_PHORON, phoronToDeduce, 200+T0C) - addtimer(new Callback(target_tile, /turf/proc/hotspot_expose, temperature, 400), 0) + addtimer(new Callback(target_tile, TYPE_PROC_REF(/turf, hotspot_expose), temperature, 400), 0) return round(totalPhoron/100) diff --git a/code/modules/materials/definitions/materials_organic.dm b/code/modules/materials/definitions/materials_organic.dm index 051d623cf6b94..2a5b9e10bb590 100644 --- a/code/modules/materials/definitions/materials_organic.dm +++ b/code/modules/materials/definitions/materials_organic.dm @@ -64,6 +64,12 @@ stack_type = /obj/item/stack/material/cloth hidden_from_codex = TRUE construction_difficulty = MATERIAL_NORMAL_DIY + // [SIERRA-ADD] + value = 3 + integrity = 50 + hardness = MATERIAL_FLEXIBLE + weight = 10 + // [/SIERRA-ADD] /material/cloth/carpet name = "carpet" diff --git a/code/modules/materials/material_recipes.dm b/code/modules/materials/material_recipes.dm index 1392d67f3074d..9965aec7116fb 100644 --- a/code/modules/materials/material_recipes.dm +++ b/code/modules/materials/material_recipes.dm @@ -27,7 +27,10 @@ . += new/datum/stack_recipe/clipboard(src) . += new/datum/stack_recipe/cross(src) - if(hardness >= MATERIAL_FLEXIBLE) + // [SIERRA-EDIT] + // if(hardness >= MATERIAL_FLEXIBLE) // SIERRA-EDIT - ORIGINAL + if(hardness > MATERIAL_FLEXIBLE) + // [/SIERRA-EDIT] . += new/datum/stack_recipe/baseball_bat(src) . += new/datum/stack_recipe/urn(src) . += new/datum/stack_recipe/spoon(src) diff --git a/code/modules/materials/materials_ore.dm b/code/modules/materials/materials_ore.dm index 6527bd9b16373..0db96255317ad 100644 --- a/code/modules/materials/materials_ore.dm +++ b/code/modules/materials/materials_ore.dm @@ -10,12 +10,12 @@ /obj/item/ore/get_material() return material -/obj/item/ore/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/ore/use_tool(obj/item/W, mob/living/user, list/click_params) if(istype(W,/obj/item/device/core_sampler)) var/obj/item/device/core_sampler/C = W C.sample_item(src, user) - else - return ..() + return TRUE + return ..() /obj/item/ore/New(newloc, _mat) if(_mat) diff --git a/code/modules/mechs/_mech_setup.dm b/code/modules/mechs/_mech_setup.dm index 3de664b4cc880..b6409b2300118 100644 --- a/code/modules/mechs/_mech_setup.dm +++ b/code/modules/mechs/_mech_setup.dm @@ -6,7 +6,10 @@ GLOBAL_LIST_INIT(hardpoint_bar_cache, new) GLOBAL_LIST_INIT(mech_damage_overlay_cache, new) GLOBAL_LIST_INIT(mech_image_cache, new) GLOBAL_LIST_INIT(mech_icon_cache, new) -GLOBAL_LIST_INIT(mech_weapon_overlays, icon_states('icons/mecha/mech_weapon_overlays.dmi')) +//[SIERRA-EDIT] - Mechs-by-Shegar +//GLOBAL_LIST_INIT(mech_weapon_overlays, icon_states('icons/mecha/mech_weapon_overlays.dmi')) +GLOBAL_LIST_INIT(mech_weapon_overlays, icon_states('mods/mechs_by_shegar/icons/mech_weapon_overlays.dmi')) +//[SIERRA-EDIT] #define HARDPOINT_BACK "back" #define HARDPOINT_LEFT_HAND "left hand" @@ -43,4 +46,19 @@ GLOBAL_LIST_INIT(mech_weapon_overlays, icon_states('icons/mecha/mech_weapon_over //POWER! #define MECH_POWER_OFF 0 #define MECH_POWER_TRANSITION 1 -#define MECH_POWER_ON 2 \ No newline at end of file +#define MECH_POWER_ON 2 + +//Passengers +#define MECH_DROP_ALL_PASSENGER 1 // Скинуть всех пассажиров +#define MECH_DROP_ANY_PASSENGER 2 // Скинуть первого попавшегося пассажира + +//Cockpit bolts status +#define BOLTS_NOMITAL 0 +#define BOLTS_DESTROYED 1 + +//Bump types +#define BASIC_BUMP 1 +#define MEDIUM_BUMP 2 +#define HARD_BUMP 3 + +#define MECH_BACK_LAYER 4 diff --git a/code/modules/mechs/components/_components.dm b/code/modules/mechs/components/_components.dm index 46e21a94e2602..133b80cd42a4a 100644 --- a/code/modules/mechs/components/_components.dm +++ b/code/modules/mechs/components/_components.dm @@ -93,8 +93,8 @@ qdel(RC) update_components() -/obj/item/mech_component/attackby(obj/item/thing, mob/user) - if(isScrewdriver(thing)) +/obj/item/mech_component/use_tool(obj/item/thing, mob/living/user, list/click_params) + if (isScrewdriver(thing)) if(length(contents)) //Filter non movables var/list/valid_contents = list() @@ -102,27 +102,30 @@ if(!A.anchored) valid_contents += A if(!length(valid_contents)) - return + return TRUE var/obj/item/removed = pick(valid_contents) if(!(removed in contents)) - return + return TRUE user.visible_message(SPAN_NOTICE("\The [user] removes \the [removed] from \the [src].")) removed.forceMove(user.loc) playsound(user.loc, 'sound/effects/pop.ogg', 50, 0) update_components() else to_chat(user, SPAN_WARNING("There is nothing to remove.")) - return - if(isWelder(thing)) + return TRUE + + if (isWelder(thing)) repair_brute_generic(thing, user) - return - if(isCoil(thing)) + return TRUE + + if (isCoil(thing)) repair_burn_generic(thing, user) - return - if(istype(thing, /obj/item/device/robotanalyzer)) + return TRUE + + if (istype(thing, /obj/item/device/robotanalyzer)) to_chat(user, SPAN_NOTICE("Diagnostic Report for \the [src]:")) return_diagnostics(user) - return + return TRUE return ..() @@ -186,4 +189,7 @@ /obj/item/mech_component/proc/return_diagnostics(mob/user) to_chat(user, SPAN_NOTICE("[capitalize(src.name)]:")) - to_chat(user, SPAN_NOTICE(" - Integrity: [round((((max_damage - total_damage) / max_damage)) * 100)]%" )) + // [SIERRA-EDIT] - Mechs_by_shegar + //to_chat(user, SPAN_NOTICE(" - Integrity: [round((((max_damage - total_damage) / max_damage)) * 100)]%" )) + to_chat(user, SPAN_NOTICE(" - Integrity: [max_damage - total_damage]/[max_damage]([round((((max_damage - total_damage) / max_damage)) * 100)]%)" )) + // [SIERRA-EDIT] diff --git a/code/modules/mechs/components/arms.dm b/code/modules/mechs/components/arms.dm index 55a157280e485..3d1f4ca002ad8 100644 --- a/code/modules/mechs/components/arms.dm +++ b/code/modules/mechs/components/arms.dm @@ -25,12 +25,14 @@ /obj/item/mech_component/manipulators/prebuild() motivator = new(src) -/obj/item/mech_component/manipulators/attackby(obj/item/thing, mob/user) +/obj/item/mech_component/manipulators/use_tool(obj/item/thing, mob/living/user, list/click_params) if(istype(thing,/obj/item/robot_parts/robot_component/actuator)) if(motivator) to_chat(user, SPAN_WARNING("\The [src] already has an actuator installed.")) - return - if(install_component(thing, user)) motivator = thing + return TRUE + if(install_component(thing, user)) + motivator = thing + return TRUE else return ..() @@ -84,4 +86,3 @@ icon_state = "combat_arms" action_delay = 10 power_use = 50 - diff --git a/code/modules/mechs/components/body.dm b/code/modules/mechs/components/body.dm index bd285f7034853..d665d7da1a4e2 100644 --- a/code/modules/mechs/components/body.dm +++ b/code/modules/mechs/components/body.dm @@ -144,25 +144,32 @@ cell = new /obj/item/cell/high(src) cell.charge = cell.maxcharge -/obj/item/mech_component/chassis/attackby(obj/item/thing, mob/user) +/obj/item/mech_component/chassis/use_tool(obj/item/thing, mob/living/user, list/click_params) if(istype(thing,/obj/item/robot_parts/robot_component/diagnosis_unit)) if(diagnostics) to_chat(user, SPAN_WARNING("\The [src] already has a diagnostic system installed.")) - return - if(install_component(thing, user)) diagnostics = thing + return TRUE + if(install_component(thing, user)) + diagnostics = thing + return TRUE + else if(istype(thing, /obj/item/cell)) if(cell) to_chat(user, SPAN_WARNING("\The [src] already has a cell installed.")) - return - if(install_component(thing,user)) cell = thing + return TRUE + if(install_component(thing,user)) + cell = thing + return TRUE + else if(istype(thing, /obj/item/robot_parts/robot_component/armour/exosuit)) if(m_armour) to_chat(user, SPAN_WARNING("\The [src] already has armour installed.")) - return + return TRUE if(install_component(thing, user)) m_armour = thing - else - return ..() + return TRUE + + return ..() /obj/item/mech_component/chassis/MouseDrop_T(atom/dropping, mob/user) var/obj/machinery/portable_atmospherics/canister/C = dropping diff --git a/code/modules/mechs/components/head.dm b/code/modules/mechs/components/head.dm index 649b54dc6bee7..734e8f15deace 100644 --- a/code/modules/mechs/components/head.dm +++ b/code/modules/mechs/components/head.dm @@ -36,18 +36,32 @@ camera = locate() in src software = locate() in src -/obj/item/mech_component/sensors/proc/get_sight(powered) +//EDIT +// [SIERRA-EDIT] - SHUTTLE_TOGGLE - (Optional Reason/comment) + /* /obj/item/mech_component/sensors/proc/get_sight(powered) var/flags = 0 if(total_damage >= 0.8 * max_damage || !powered) flags |= BLIND else if(active_sensors && powered) flags |= vision_flags + */ +/obj/item/mech_component/sensors/proc/get_sight(powered) + var/flags = 0 + if(!camera || !powered) + flags |= BLIND + else if(active_sensors && powered) + flags |= vision_flags + // [SIERRA-EDIT] - return flags /obj/item/mech_component/sensors/proc/get_invisible(powered) var/invisible = 0 + // [SIERRA-EDIT] + /* if((total_damage <= 0.8 * max_damage) && active_sensors && powered) + */ + if((camera) && active_sensors && powered) + // [SIERRA-EDIT] invisible = see_invisible return invisible @@ -56,22 +70,30 @@ /obj/item/mech_component/sensors/ready_to_install() return (radio && camera) -/obj/item/mech_component/sensors/attackby(obj/item/thing, mob/user) +/obj/item/mech_component/sensors/use_tool(obj/item/thing, mob/living/user, list/click_params) if(istype(thing, /obj/item/mech_component/control_module)) if(software) to_chat(user, SPAN_WARNING("\The [src] already has a control modules installed.")) - return - if(install_component(thing, user)) software = thing + return TRUE + if(install_component(thing, user)) + software = thing + return TRUE + else if(istype(thing,/obj/item/robot_parts/robot_component/radio)) if(radio) to_chat(user, SPAN_WARNING("\The [src] already has a radio installed.")) - return - if(install_component(thing, user)) radio = thing + return TRUE + if(install_component(thing, user)) + radio = thing + return TRUE + else if(istype(thing,/obj/item/robot_parts/robot_component/camera)) if(camera) to_chat(user, SPAN_WARNING("\The [src] already has a camera installed.")) - return - if(install_component(thing, user)) camera = thing + return TRUE + if(install_component(thing, user)) + camera = thing + return TRUE else return ..() @@ -107,11 +129,10 @@ . = ..() to_chat(user, SPAN_NOTICE("It has [max_installed_software - LAZYLEN(installed_software)] empty slot\s remaining out of [max_installed_software].")) -/obj/item/mech_component/control_module/attackby(obj/item/thing, mob/user) - +/obj/item/mech_component/control_module/use_tool(obj/item/thing, mob/living/user, list/click_params) if(istype(thing, /obj/item/circuitboard/exosystem)) install_software(thing, user) - return + return TRUE if(isScrewdriver(thing)) var/result = ..() diff --git a/code/modules/mechs/components/legs.dm b/code/modules/mechs/components/legs.dm index a4f2538b8131a..4868f24e6aa25 100644 --- a/code/modules/mechs/components/legs.dm +++ b/code/modules/mechs/components/legs.dm @@ -25,12 +25,14 @@ /obj/item/mech_component/propulsion/update_components() motivator = locate() in src -/obj/item/mech_component/propulsion/attackby(obj/item/thing, mob/user) +/obj/item/mech_component/propulsion/use_tool(obj/item/thing, mob/living/user, list/click_params) if(istype(thing,/obj/item/robot_parts/robot_component/actuator)) if(motivator) to_chat(user, SPAN_WARNING("\The [src] already has an actuator installed.")) - return - if(install_component(thing, user)) motivator = thing + return TRUE + if(install_component(thing, user)) + motivator = thing + return TRUE else return ..() diff --git a/code/modules/mechs/equipment/_equipment.dm b/code/modules/mechs/equipment/_equipment.dm index cec2ccb350399..0a436a654a77b 100644 --- a/code/modules/mechs/equipment/_equipment.dm +++ b/code/modules/mechs/equipment/_equipment.dm @@ -91,7 +91,10 @@ /obj/item/mech_equipment/mounted_system var/holding_type - var/obj/item/holding + //[SIERRA-EDIT] - Mechs_by_shegar + //var/obj/item/holding + var/obj/item/gun/projectile/holding + //[SIERRA-EDIT] /obj/item/mech_equipment/mounted_system/attack_self(mob/user) . = ..() @@ -100,7 +103,7 @@ /obj/item/mech_equipment/mounted_system/proc/forget_holding() if(holding) //It'd be strange for this to be called with this var unset - GLOB.destroyed_event.unregister(holding, src, .proc/forget_holding) + GLOB.destroyed_event.unregister(holding, src, PROC_REF(forget_holding)) holding = null qdel(src) @@ -108,7 +111,7 @@ . = ..() if(holding_type) holding = new holding_type(src) - GLOB.destroyed_event.register(holding, src, .proc/forget_holding) + GLOB.destroyed_event.register(holding, src, PROC_REF(forget_holding)) if(holding) if(!icon_state) icon = holding.icon @@ -118,7 +121,7 @@ /obj/item/mech_equipment/mounted_system/Destroy() - GLOB.destroyed_event.unregister(holding, src, .proc/forget_holding) + GLOB.destroyed_event.unregister(holding, src, PROC_REF(forget_holding)) if(holding) QDEL_NULL(holding) . = ..() diff --git a/code/modules/mechs/equipment/combat.dm b/code/modules/mechs/equipment/combat.dm index 23cd60748387d..eb288b97570a1 100644 --- a/code/modules/mechs/equipment/combat.dm +++ b/code/modules/mechs/equipment/combat.dm @@ -81,25 +81,56 @@ charge = clamp(charge - damage, 0, max_charge) last_recharge = world.time - +//[SIERRA-EDIT] - Mechs_by_Shegar + /* if(difference > 0) - for(var/mob/pilot in owner.pilots) + //for(var/mob/pilot in owner.pilots) to_chat(pilot, SPAN_DANGER("Warning: Deflector shield failure detect, shutting down")) toggle() playsound(owner.loc,'sound/mecha/internaldmgalarm.ogg',35,1) + */ +//[SIERRA-EDIT] + if(difference >= 0) + toggle() + OVERHEAT = TRUE + src.visible_message("The energy shield flashes and blinks in separate sections, then suddenly disappears, emitting a sad hum.") + playsound(owner.loc,'mods/mechs_by_shegar/sounds/mecha_shield_deflector_fail.ogg',60,0) + update_icon() + last_overheat = world.time + delayed_toggle() return difference else return 0 /obj/item/mech_equipment/shields/proc/toggle() + //[SIERRA-ADD] - Mechs_by_Shegar -Анти-абуз место + if(charge == -1) + charge = 0 + src.visible_message("The mech's computer flashes: WARNING! Shield overheat detected!","The mech's computer beeps, reporting a shield error!",0) //[INF] Для предотвращения абуза + playsound(owner.loc,'mods/mechs_by_shegar/sounds/mecha_shield_deflector_fail.ogg',60,0) + OVERHEAT = TRUE + update_icon() + delayed_toggle() + return + if(OVERHEAT) + if((world.time - last_overheat) < overheat_cooldown) + src.visible_message("Shields still overheated!","Shields still overheated!",0) + return + //[SIERRA-ADD] - Mechs_by_Shegar if(!aura) return aura.toggle() - playsound(owner,'sound/weapons/flash.ogg',35,1) + //[SIERRA-REMOVE] - Mechs-by-Shegar - Тут оно уже не нужно + //playsound(owner,'sound/weapons/flash.ogg',35,1) + //[SIERRA-REMOVE] update_icon() if(aura.active) + //[SIERRA-ADD] - Mechs_by_shegar - я добавил звуки включения/выключения дэп + playsound(owner,'mods/mechs_by_shegar/sounds/mecha_mech_shield_up.ogg',50,0) START_PROCESSING(SSobj, src) else + playsound(owner,'mods/mechs_by_shegar/sounds/mecha_mech_shield_down.ogg',50,1) STOP_PROCESSING(SSobj, src) + //[SIERRA-ADD] active = aura.active passive_power_use = active ? 1 KILOWATTS : 0 owner.update_icon() @@ -111,6 +142,11 @@ /obj/item/mech_equipment/shields/on_update_icon() . = ..() + //[SIERRA-ADD] - Mechs-by-Shegar + if(OVERHEAT) + icon_state= "shield_droid_overheat" + return + //[SIERRA-ADD] if(!aura) return if(aura.active) @@ -119,14 +155,19 @@ icon_state = "shield_droid" /obj/item/mech_equipment/shields/Process() - if(charge >= max_charge) - return + //Обновление спрайта с течением времени + if(charge < max_charge) + aura.on_update_icon() if((world.time - last_recharge) < cooldown) return + //[SIERRA-ADD] - Mechs-by-Shegar + if(charge >= max_charge) + var/obj/item/cell/cell = owner.get_cell() + cell.use(charging_rate/4) + return + //[SIERRA-ADD] var/obj/item/cell/cell = owner.get_cell() - - var/actual_required_power = clamp(max_charge - charge, 0, charging_rate) - + var/actual_required_power = 2*clamp(max_charge - charge, 0, charging_rate) if(cell) charge += cell.use(actual_required_power) @@ -134,8 +175,12 @@ return charge / max_charge /obj/item/mech_equipment/shields/get_hardpoint_maptext() - return "[(aura && aura.active) ? "ONLINE" : "OFFLINE"]: [round((charge / max_charge) * 100)]%" - + //[SIERRA-ADD] - Mechs-by-Shegar + if(OVERHEAT) + return "["OVERHEAT!"]" + //[SIERRA-ADD] - Mechs-by-Sbegar + else + return "[(aura && aura.active) ? "ONLINE" : "OFFLINE"]: [round((charge / max_charge) * 100)]%" /obj/aura/mechshield icon = 'icons/mecha/shield.dmi' name = "mechshield" @@ -156,7 +201,7 @@ . = ..() target.vis_contents += src set_dir() - GLOB.dir_set_event.register(user, src, /obj/aura/mechshield/proc/update_dir) + GLOB.dir_set_event.register(user, src, TYPE_PROC_REF(/obj/aura/mechshield, update_dir)) /obj/aura/mechshield/proc/update_dir(user, old_dir, dir) set_dir(dir) @@ -169,7 +214,7 @@ /obj/aura/mechshield/Destroy() if(user) - GLOB.dir_set_event.unregister(user, src, /obj/aura/mechshield/proc/update_dir) + GLOB.dir_set_event.unregister(user, src, TYPE_PROC_REF(/obj/aura/mechshield, update_dir)) user.vis_contents -= src shields = null . = ..() @@ -182,13 +227,32 @@ if(active) flick("shield_raise", src) else - flick("shield_drop", src) + //[SIERRA-EDIT] - Mechs-by-Shegar + /* + else + flick("shield_drop", src) + */ + if(shields.charge == 0) + flick("shield_die",src) + else + flick("shield_drop", src) + //[SIERRA-EDIT] /obj/aura/mechshield/on_update_icon() . = ..() if(active) - icon_state = "shield" + //[SIERRA-ADD] - Mechs-by-Shegar - добавляет степени повреждения энергощита + var/percentrage = shields.charge/shields.max_charge * 100 + if(percentrage < 25) + icon_state = "shield_25" + else if(percentrage < 50) + icon_state = "shield_50" + else if(percentrage < 75) + icon_state = "shield_75" + else if(percentrage > 75) + icon_state = "shield" + //[SIERRA-ADD] - Mechs-by-Shegar] else icon_state = "shield_null" @@ -397,14 +461,14 @@ . = ..() target.vis_contents += src set_dir() - GLOB.dir_set_event.register(user, src, /obj/aura/mech_ballistic/proc/update_dir) + GLOB.dir_set_event.register(user, src, TYPE_PROC_REF(/obj/aura/mech_ballistic, update_dir)) /obj/aura/mech_ballistic/proc/update_dir(user, old_dir, dir) set_dir(dir) /obj/aura/mech_ballistic/Destroy() if (user) - GLOB.dir_set_event.unregister(user, src, /obj/aura/mech_ballistic/proc/update_dir) + GLOB.dir_set_event.unregister(user, src, TYPE_PROC_REF(/obj/aura/mech_ballistic, update_dir)) user.vis_contents -= src shield = null . = ..() @@ -558,8 +622,8 @@ if(owner && holding) update_icon() -/obj/item/mech_equipment/mounted_system/flamethrower/attackby(obj/item/W as obj, mob/user as mob) - if(!CanPhysicallyInteract(user)) return +/obj/item/mech_equipment/mounted_system/flamethrower/use_tool(obj/item/W, mob/living/user, list/click_params) + if(!CanPhysicallyInteract(user)) return ..() var/obj/item/flamethrower/full/mech/FM = holding if(istype(FM)) @@ -568,17 +632,17 @@ user.visible_message(SPAN_NOTICE("\The [user] pries out \the [FM.beaker] using \the [W].")) FM.beaker.dropInto(get_turf(user)) FM.beaker = null - return + return TRUE if (istype(W, /obj/item/reagent_containers) && W.is_open_container() && (W.w_class <= FM.max_beaker)) if(FM.beaker) to_chat(user, SPAN_NOTICE("There is already a tank inserted!")) - return + return TRUE if(user.unEquip(W, FM)) user.visible_message(SPAN_NOTICE("\The [user] inserts \the [W] inside \the [src].")) FM.beaker = W - return - ..() + return TRUE + return ..() /obj/item/mech_equipment/mounted_system/flamethrower/on_update_icon() . = ..() diff --git a/code/modules/mechs/equipment/engineering.dm b/code/modules/mechs/equipment/engineering.dm index 56be505a3d2cc..b660826878704 100644 --- a/code/modules/mechs/equipment/engineering.dm +++ b/code/modules/mechs/equipment/engineering.dm @@ -38,10 +38,10 @@ restricted_software = list(MECH_SOFTWARE_ENGINEERING) /obj/item/mech_equipment/atmos_shields - icon_state = "mech_atmoshield_off" + icon_state = "mech_power" name = "exosuit airshield" desc = "An Aether Atmospherics brand 'Zephyros' portable Atmospheric Isolation and Retention Screen. It keeps air where it should be... Most of the time. Press ctrl-click to switch modes" - restricted_hardpoints = list(HARDPOINT_BACK) + restricted_hardpoints = list(HARDPOINT_LEFT_SHOULDER, HARDPOINT_RIGHT_SHOULDER) restricted_software = list(MECH_SOFTWARE_ENGINEERING) var/list/segments equipment_delay = 0.25 SECONDS @@ -135,32 +135,23 @@ if(istype(MS)) MS.shields = src segments += MS - GLOB.moved_event.register(MS, src, .proc/on_moved) + GLOB.moved_event.register(MS, src, PROC_REF(on_moved)) passive_power_use = 0.8 KILOWATTS * length(segments) - - update_icon() - owner.update_icon() - GLOB.moved_event.register(owner, src, .proc/on_moved) - GLOB.dir_set_event.register(owner, src, .proc/on_turned) - -/obj/item/mech_equipment/atmos_shields/on_update_icon() - . = ..() - icon_state = "mech_atmoshield[active ? "_on" : "_off"]" + GLOB.moved_event.register(owner, src, PROC_REF(on_moved)) + GLOB.dir_set_event.register(owner, src, PROC_REF(on_turned)) /obj/item/mech_equipment/atmos_shields/deactivate() for(var/obj/mech_shield/MS in segments) if(istype(MS)) - GLOB.moved_event.unregister(MS, src, .proc/on_moved) + GLOB.moved_event.unregister(MS, src, PROC_REF(on_moved)) if(length(segments)) owner.visible_message(SPAN_WARNING("The energy shields in front of \the [owner] disappear!")) QDEL_NULL_LIST(segments) passive_power_use = 0 - GLOB.moved_event.unregister(owner, src, .proc/on_moved) - GLOB.dir_set_event.unregister(owner, src, .proc/on_turned) + GLOB.moved_event.unregister(owner, src, PROC_REF(on_moved)) + GLOB.dir_set_event.unregister(owner, src, PROC_REF(on_turned)) . = ..() - update_icon() - owner.update_icon() /obj/item/mech_equipment/atmos_shields/attack_self(mob/user) . = ..() diff --git a/code/modules/mechs/equipment/medical.dm b/code/modules/mechs/equipment/medical.dm index 90257ecba5a4b..264b8f0e187f8 100644 --- a/code/modules/mechs/equipment/medical.dm +++ b/code/modules/mechs/equipment/medical.dm @@ -29,10 +29,11 @@ if(.) sleeper.ui_interact(user) -/obj/item/mech_equipment/sleeper/attackby(obj/item/I, mob/user) +/obj/item/mech_equipment/sleeper/use_tool(obj/item/I, mob/living/user, list/click_params) if(istype(I, /obj/item/reagent_containers/glass)) sleeper.use_tool(I, user) - else return ..() + return TRUE + return ..() /obj/item/mech_equipment/sleeper/afterattack(atom/target, mob/living/user, inrange, params) . = ..() @@ -67,6 +68,10 @@ return S.owner return null + + +//[SIERRA-REMOVE] - Mechs-by-Shegar - Всё это тут не надо +/* /obj/machinery/sleeper/mounted/go_in() ..() var/obj/item/mech_equipment/sleeper/S = loc @@ -124,7 +129,7 @@ if (mode == MEDIGEL_SALVE) if (istype(target, /mob/living/carbon/human)) var/mob/living/carbon/human/H = target - var/obj/item/organ/external/affecting = H.get_organ(user.zone_sel.selecting) + var/obj/item/organ/external/affecting = H.get_organ(user.zone_sel ? user.zone_sel.selecting : ran_zone()) if(affecting.is_bandaged() && affecting.is_disinfected() && affecting.is_salved()) to_chat(user, SPAN_WARNING("The wounds on \the [H]'s [affecting.name] have already been treated.")) @@ -175,3 +180,5 @@ #undef MEDIGEL_SALVE #undef MEDIGEL_SCAN +*/ +//[SIERRA-REMOVE] diff --git a/code/modules/mechs/equipment/utility.dm b/code/modules/mechs/equipment/utility.dm index 96e19c8c8255a..b870a9c069144 100644 --- a/code/modules/mechs/equipment/utility.dm +++ b/code/modules/mechs/equipment/utility.dm @@ -100,7 +100,7 @@ playsound(FD, 'sound/effects/meteorimpact.ogg', 100, 1) playsound(FD, 'sound/machines/airlock_creaking.ogg', 100, 1) FD.blocked = FALSE - addtimer(new Callback(FD, /obj/machinery/door/firedoor/.proc/open, TRUE), 0) + addtimer(new Callback(FD, TYPE_PROC_REF(/obj/machinery/door/firedoor, open), TRUE), 0) FD.set_broken(TRUE) FD.visible_message(SPAN_WARNING("\The [owner] tears \the [FD] open!")) else @@ -109,10 +109,10 @@ playsound(FD, 'sound/machines/airlock_creaking.ogg', 100, 1) if(FD.density) FD.visible_message(SPAN_DANGER("\The [owner] forces \the [FD] open!")) - addtimer(new Callback(FD, /obj/machinery/door/firedoor/.proc/open, TRUE), 0) + addtimer(new Callback(FD, TYPE_PROC_REF(/obj/machinery/door/firedoor, open), TRUE), 0) else FD.visible_message(SPAN_WARNING("\The [owner] forces \the [FD] closed!")) - addtimer(new Callback(FD, /obj/machinery/door/firedoor/.proc/close, TRUE), 0) + addtimer(new Callback(FD, TYPE_PROC_REF(/obj/machinery/door/firedoor, close), TRUE), 0) return else if(istype(O, /obj/machinery/door/airlock)) var/obj/machinery/door/airlock/AD = O @@ -125,7 +125,7 @@ playsound(AD, 'sound/effects/meteorimpact.ogg', 100, 1) playsound(AD, 'sound/machines/airlock_creaking.ogg', 100, 1) AD.visible_message(SPAN_DANGER("\The [owner] tears \the [AD] open!")) - addtimer(new Callback(AD, /obj/machinery/door/airlock/.proc/open, TRUE), 0) + addtimer(new Callback(AD, TYPE_PROC_REF(/obj/machinery/door/airlock, open), TRUE), 0) AD.set_broken(TRUE) return else @@ -133,12 +133,12 @@ if((MACHINE_IS_BROKEN(AD) || !AD.is_powered() || do_after(owner, 5 SECONDS, AD, DO_DEFAULT | DO_USER_UNIQUE_ACT | DO_PUBLIC_PROGRESS)) && !(AD.operating || AD.welded || AD.locked)) playsound(AD, 'sound/machines/airlock_creaking.ogg', 100, 1) if(AD.density) - addtimer(new Callback(AD, /obj/machinery/door/airlock/.proc/open, TRUE), 0) + addtimer(new Callback(AD, TYPE_PROC_REF(/obj/machinery/door/airlock, open), TRUE), 0) if(!MACHINE_IS_BROKEN(AD) && AD.is_powered()) AD.set_broken(TRUE) AD.visible_message(SPAN_DANGER("\The [owner] forces \the [AD] open!")) else - addtimer(new Callback(AD, /obj/machinery/door/airlock/.proc/close, TRUE), 0) + addtimer(new Callback(AD, TYPE_PROC_REF(/obj/machinery/door/airlock, close), TRUE), 0) if(!MACHINE_IS_BROKEN(AD) && AD.is_powered()) AD.set_broken(TRUE) AD.visible_message(SPAN_DANGER("\The [owner] forces \the [AD] closed!")) @@ -350,7 +350,7 @@ /obj/item/mech_equipment/catapult/proc/beamdestroyed() if(beam) - GLOB.destroyed_event.unregister(beam, src, .proc/beamdestroyed) + GLOB.destroyed_event.unregister(beam, src, PROC_REF(beamdestroyed)) beam = null if(locked) if(owner) @@ -403,7 +403,7 @@ return locked = AM beam = owner.Beam(BeamTarget = target, icon_state = "r_beam", maxdistance = max_dist, beam_type = /obj/ebeam/warp) - GLOB.destroyed_event.register(beam, src, .proc/beamdestroyed) + GLOB.destroyed_event.register(beam, src, PROC_REF(beamdestroyed)) animate(target,pixel_y= initial(target.pixel_y) - 2,time=1 SECOND, easing = SINE_EASING, flags = ANIMATION_PARALLEL, loop = -1) animate(pixel_y= initial(target.pixel_y) + 2,time=1 SECOND) @@ -440,7 +440,7 @@ alpha = 0, time = 1.25 SECONDS ) - addtimer(new Callback(warpeffect, /atom/movable/proc/forceMove, null), 1.25 SECONDS) + addtimer(new Callback(warpeffect, TYPE_PROC_REF(/atom/movable, forceMove), null), 1.25 SECONDS) playsound(warpeffect, 'sound/effects/heavy_cannon_blast.ogg', 50, 1) var/list/atoms = list() @@ -550,11 +550,11 @@ drill_head = DH -/obj/item/mech_equipment/drill/attackby(obj/item/I, mob/user) +/obj/item/mech_equipment/drill/use_tool(obj/item/I, mob/living/user, list/click_params) if (istype(I, /obj/item/material/drill_head)) attach_head(I, user) return TRUE - . = ..() + return ..() /obj/item/mech_equipment/drill/proc/scoop_ore(at_turf) if (!owner) @@ -886,9 +886,7 @@ passive_power_use = 0 . = ..() -/obj/item/mech_equipment/camera/attackby(obj/item/W, mob/user) - . = ..() - +/obj/item/mech_equipment/camera/use_tool(obj/item/W, mob/living/user, list/click_params) if(isScrewdriver(W)) var/list/all_networks = list() for(var/network in GLOB.using_map.station_networks) @@ -900,11 +898,15 @@ var/network = input("Which network would you like to configure it for?") as null|anything in (all_networks) if(!network) to_chat(user, SPAN_WARNING("You cannot connect to any camera network!.")) + return TRUE var/delay = 2 SECONDS * user.skill_delay_mult(SKILL_DEVICES) if(do_after(user, delay, src, DO_DEFAULT | DO_BOTH_UNIQUE_ACT) && network) camera.network = list(network) camera.update_coverage(TRUE) to_chat(user, SPAN_NOTICE("You configure the camera for \the [network] network.")) + return TRUE + + return ..() /obj/item/mech_equipment/camera/attack_self(mob/user) . = ..() diff --git a/code/modules/mechs/interface/_interface.dm b/code/modules/mechs/interface/_interface.dm index 6704ed1ed5a9f..bb65fb85abc65 100644 --- a/code/modules/mechs/interface/_interface.dm +++ b/code/modules/mechs/interface/_interface.dm @@ -6,6 +6,9 @@ var/mob/pilot = thing if(pilot.client) pilot.client.screen |= hud_elements + //[SIERRA-ADD] - Mechs-by-Shegar + //pilot.client.screen -= menu_hud_elements? + //[SIERRA-ADD] if(client) client.screen |= hud_elements @@ -14,12 +17,13 @@ if(!LAZYLEN(hud_elements)) var/i = 1 for(var/hardpoint in hardpoints) - var/obj/screen/exosuit/hardpoint/H = new(src, hardpoint) + var/obj/screen/movable/exosuit/hardpoint/H = new(src, hardpoint) H.screen_loc = "1:6,[15-i]" //temp hud_elements |= H hardpoint_hud_elements[hardpoint] = H i++ - + //[SIERRA-EDIT] - Mechs-by-Shegar + /* var/list/additional_hud_elements = list( /obj/screen/exosuit/toggle/power_control, /obj/screen/exosuit/toggle/maint, @@ -31,34 +35,61 @@ /obj/screen/exosuit/rename, /obj/screen/exosuit/toggle/camera ) + */ + var/list/main_hud_elements = list( + /obj/screen/movable/exosuit/toggle/power_control, + /obj/screen/movable/exosuit/eject, + /obj/screen/movable/exosuit/toggle/hatch, + /obj/screen/movable/exosuit/toggle/hatch_open, + /obj/screen/movable/exosuit/toggle/menu, + ) if(body && body.pilot_coverage >= 100) - additional_hud_elements += /obj/screen/exosuit/toggle/air + main_hud_elements += /obj/screen/movable/exosuit/toggle/air + var/list/additional_hud_elements = list( + /obj/screen/movable/exosuit/toggle/camera, + /obj/screen/movable/exosuit/rename, + /obj/screen/movable/exosuit/radio, + /obj/screen/movable/exosuit/toggle/hardpoint, + /obj/screen/movable/exosuit/toggle/maint, + /obj/screen/movable/exosuit/toggle/megaspeakers, + /obj/screen/movable/exosuit/toggle/gps, + /obj/screen/movable/exosuit/toggle/medscan, + ) + //[SIERRA-EDIT] i = 0 var/pos = 8 - for(var/additional_hud in additional_hud_elements) - var/obj/screen/exosuit/M = new additional_hud(src) + for(var/additional_hud in main_hud_elements) + var/obj/screen/movable/exosuit/M = new additional_hud(src) M.screen_loc = "1:6,[pos]:[i]" hud_elements |= M i -= M.height - - hud_health = new /obj/screen/exosuit/health(src) + //[SIERRA-ADD] - Mechs-by-Shegar - отрисовка menu кнопачек + i = 0 + for(var/additional_hud in additional_hud_elements) + var/obj/screen/movable/exosuit/M = new additional_hud(src) + M.screen_loc = "2:6,[pos]:[i]" + menu_hud_elements |= M + i -= M.height + //[SIERRA-ADD] - Mechs-by-Shegar + hud_health = new /obj/screen/movable/exosuit/health(src) hud_health.screen_loc = "EAST-1:28,CENTER-3:11" hud_elements |= hud_health - hud_open = locate(/obj/screen/exosuit/toggle/hatch_open) in hud_elements - hud_power = new /obj/screen/exosuit/power(src) + hud_open = locate(/obj/screen/movable/exosuit/toggle/hatch_open) in hud_elements + hud_power = new /obj/screen/movable/exosuit/power(src) hud_power.screen_loc = "EAST-1:24,CENTER-4:25" hud_elements |= hud_power - hud_power_control = locate(/obj/screen/exosuit/toggle/power_control) in hud_elements - hud_camera = locate(/obj/screen/exosuit/toggle/camera) in hud_elements - hud_heat = new /obj/screen/exosuit/heat(src) + hud_power_control = locate(/obj/screen/movable/exosuit/toggle/power_control) in hud_elements + hud_camera = locate(/obj/screen/movable/exosuit/toggle/camera) in menu_hud_elements + hud_heat = new /obj/screen/movable/exosuit/heat(src) hud_heat.screen_loc = "EAST-1:28,CENTER-4" hud_elements |= hud_heat refresh_hud() + refresh_menu_hud() /mob/living/exosuit/handle_hud_icons() for(var/hardpoint in hardpoint_hud_elements) - var/obj/screen/exosuit/hardpoint/H = hardpoint_hud_elements[hardpoint] + var/obj/screen/movable/exosuit/hardpoint/H = hardpoint_hud_elements[hardpoint] if(H) H.update_system_info() handle_hud_icons_health() var/obj/item/cell/C = get_cell() @@ -113,15 +144,15 @@ /mob/living/exosuit/proc/reset_hardpoint_color() for(var/hardpoint in hardpoint_hud_elements) - var/obj/screen/exosuit/hardpoint/H = hardpoint_hud_elements[hardpoint] + var/obj/screen/movable/exosuit/hardpoint/H = hardpoint_hud_elements[hardpoint] if(H) H.color = COLOR_WHITE /mob/living/exosuit/setClickCooldown(timeout) . = ..() for(var/hardpoint in hardpoint_hud_elements) - var/obj/screen/exosuit/hardpoint/H = hardpoint_hud_elements[hardpoint] + var/obj/screen/movable/exosuit/hardpoint/H = hardpoint_hud_elements[hardpoint] if(H) H.color = "#a03b3b" animate(H, color = COLOR_WHITE, time = timeout, easing = CUBIC_EASING | EASE_IN) - addtimer(new Callback(src, .proc/reset_hardpoint_color), timeout) + addtimer(new Callback(src, PROC_REF(reset_hardpoint_color)), timeout) diff --git a/code/modules/mechs/interface/screen_objects.dm b/code/modules/mechs/interface/screen_objects.dm index 8b6ef6c333af1..c4b6a8ffd23c8 100644 --- a/code/modules/mechs/interface/screen_objects.dm +++ b/code/modules/mechs/interface/screen_objects.dm @@ -1,37 +1,39 @@ // Screen objects hereon out. #define MECH_UI_STYLE(X) "" + X + "" - -/obj/screen/exosuit +//[SIERRA-EDIT] - Mechs-by-Shegar +// Все /obj/screen/exosuit были заменены на /obj/screen/movable/exosuit, дабы они были двигаемыми. +// [SIERRA-EDIT] +/obj/screen/movable/exosuit name = "hardpoint" icon = 'icons/mecha/mech_hud.dmi' icon_state = "base" var/mob/living/exosuit/owner var/height = 14 -/obj/screen/exosuit/radio +/obj/screen/movable/exosuit/radio name = "radio" maptext = MECH_UI_STYLE("RADIO") maptext_x = 5 maptext_y = 12 -/obj/screen/exosuit/radio/Click() +/obj/screen/movable/exosuit/radio/Click() if(..()) if(owner.radio) owner.radio.attack_self(usr) else to_chat(usr, SPAN_WARNING("There is no radio installed.")) -/obj/screen/exosuit/Initialize() +/obj/screen/movable/exosuit/Initialize() . = ..() var/mob/living/exosuit/newowner = loc if(!istype(newowner)) return qdel(src) owner = newowner -/obj/screen/exosuit/Click() +/obj/screen/movable/exosuit/Click() return (!usr.incapacitated() && usr.canClick() && (usr == owner || usr.loc == owner)) -/obj/screen/exosuit/hardpoint +/obj/screen/movable/exosuit/hardpoint name = "hardpoint" var/hardpoint_tag var/obj/item/holding @@ -41,11 +43,11 @@ maptext_y = 3 maptext_width = 72 -/obj/screen/exosuit/hardpoint/MouseDrop() +/obj/screen/movable/exosuit/hardpoint/MouseDrop() ..() if(holding) holding.screen_loc = screen_loc -/obj/screen/exosuit/hardpoint/proc/update_system_info() +/obj/screen/movable/exosuit/hardpoint/proc/update_system_info() // No point drawing it if we have no item to use or nobody to see it. if(!holding || !owner) @@ -123,12 +125,12 @@ new_overlays += GLOB.hardpoint_bar_cache[i] SetOverlays(new_overlays) -/obj/screen/exosuit/hardpoint/Initialize(mapload, newtag) +/obj/screen/movable/exosuit/hardpoint/Initialize(mapload, newtag) . = ..() hardpoint_tag = newtag name = "hardpoint ([hardpoint_tag])" -/obj/screen/exosuit/hardpoint/Click(location, control, params) +/obj/screen/movable/exosuit/hardpoint/Click(location, control, params) if(!(..())) return @@ -155,54 +157,54 @@ if(owner.set_hardpoint(hardpoint_tag)) icon_state = "hardpoint_selected" -/obj/screen/exosuit/eject +/obj/screen/movable/exosuit/eject name = "eject" maptext = MECH_UI_STYLE("EJECT") maptext_x = 5 maptext_y = 12 -/obj/screen/exosuit/eject/Click() +/obj/screen/movable/exosuit/eject/Click() if(..()) owner.eject(usr) -/obj/screen/exosuit/rename +/obj/screen/movable/exosuit/rename name = "rename" maptext = MECH_UI_STYLE("RENAME") maptext_x = 1 maptext_y = 12 -/obj/screen/exosuit/power +/obj/screen/movable/exosuit/power name = "power" icon_state = null maptext_width = 64 -/obj/screen/exosuit/rename/Click() +/obj/screen/movable/exosuit/rename/Click() if(..()) owner.rename(usr) -/obj/screen/exosuit/toggle +/obj/screen/movable/exosuit/toggle name = "toggle" var/toggled = FALSE -/obj/screen/exosuit/toggle/Initialize() +/obj/screen/movable/exosuit/toggle/Initialize() . = ..() queue_icon_update() -/obj/screen/exosuit/toggle/on_update_icon() +/obj/screen/movable/exosuit/toggle/on_update_icon() . = ..() icon_state = "[initial(icon_state)][toggled ? "_enabled" : ""]" maptext = SPAN_COLOR(toggled ? COLOR_WHITE : COLOR_GRAY,initial(maptext)) -/obj/screen/exosuit/toggle/Click() +/obj/screen/movable/exosuit/toggle/Click() if(..()) toggled() -/obj/screen/exosuit/toggle/proc/toggled() +/obj/screen/movable/exosuit/toggle/proc/toggled() toggled = !toggled queue_icon_update() return toggled -/obj/screen/exosuit/toggle/power_control +/obj/screen/movable/exosuit/toggle/power_control name = "Power control" icon_state = "small_important" maptext = MECH_UI_STYLE("POWER") @@ -210,15 +212,15 @@ maptext_y = 13 height = 12 -/obj/screen/exosuit/toggle/power_control/toggled() +/obj/screen/movable/exosuit/toggle/power_control/toggled() . = ..() owner.toggle_power(usr) -/obj/screen/exosuit/toggle/power_control/on_update_icon() +/obj/screen/movable/exosuit/toggle/power_control/on_update_icon() toggled = (owner.power == MECH_POWER_ON) . = ..() -/obj/screen/exosuit/toggle/air +/obj/screen/movable/exosuit/toggle/air name = "air" icon_state = "small_important" maptext = MECH_UI_STYLE("AIR") @@ -226,12 +228,12 @@ maptext_y = 13 height = 12 -/obj/screen/exosuit/toggle/air/toggled() +/obj/screen/movable/exosuit/toggle/air/toggled() owner.use_air = ..() to_chat(usr, SPAN_NOTICE("Auxiliary atmospheric system [owner.use_air ? "enabled" : "disabled"].")) playsound(src.loc, 'sound/effects/turret/open.wav', 50, 1, -6) -/obj/screen/exosuit/toggle/maint +/obj/screen/movable/exosuit/toggle/maint name = "toggle maintenance protocol" icon_state = "small" maptext = MECH_UI_STYLE("MAINT") @@ -239,54 +241,64 @@ maptext_y = 13 height = 12 -/obj/screen/exosuit/toggle/maint/toggled() +/obj/screen/movable/exosuit/toggle/maint/toggled() owner.maintenance_protocols = ..() to_chat(usr, SPAN_NOTICE("Maintenance protocols [owner.maintenance_protocols ? "enabled" : "disabled"].")) playsound(src.loc, 'sound/machines/suitstorage_lockdoor.ogg', 50, 1, -6) -/obj/screen/exosuit/toggle/hardpoint +/obj/screen/movable/exosuit/toggle/hardpoint name = "toggle hardpoint lock" maptext = MECH_UI_STYLE("GEAR") maptext_x = 5 maptext_y = 12 -/obj/screen/exosuit/toggle/hardpoint/toggled() +/obj/screen/movable/exosuit/toggle/hardpoint/toggled() owner.hardpoints_locked = ..() to_chat(usr, SPAN_NOTICE("Hardpoint system access is now [owner.hardpoints_locked ? "disabled" : "enabled"].")) playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 1, -6) -/obj/screen/exosuit/toggle/hatch +/obj/screen/movable/exosuit/toggle/hatch name = "toggle hatch lock" maptext = MECH_UI_STYLE("LOCK") maptext_x = 5 maptext_y = 12 -/obj/screen/exosuit/toggle/hatch/toggled() +/obj/screen/movable/exosuit/toggle/hatch/toggled() if(!owner.hatch_locked && !owner.hatch_closed) to_chat(usr, SPAN_WARNING("You cannot lock the hatch while it is open.")) return + //[SIERRA-ADD] - Mechs-by-Shegar + if(owner.body.hatch_bolts_status == BOLTS_DESTROYED) + to_chat(usr, SPAN_WARNING("ERROR. Security cockpit bolts damaged or non operable anymore.")) + return + //[SIERRA-ADD] owner.hatch_locked = ..() to_chat(usr, SPAN_NOTICE("The [owner.body.hatch_descriptor] is [owner.hatch_locked ? "now" : "no longer" ] locked.")) playsound(src.loc, 'sound/machines/suitstorage_lockdoor.ogg', 50, 1, -6) -/obj/screen/exosuit/toggle/hatch_open +/obj/screen/movable/exosuit/toggle/hatch_open name = "open or close hatch" maptext = MECH_UI_STYLE("CLOSE") maptext_x = 4 maptext_y = 12 -/obj/screen/exosuit/toggle/hatch_open/toggled() +/obj/screen/movable/exosuit/toggle/hatch_open/toggled() if (!owner) return - if(owner.hatch_locked && owner.hatch_closed) + if(!owner.hatch_closed && owner.power != MECH_POWER_ON) to_chat(usr, SPAN_WARNING("You cannot open the hatch while it is locked.")) return + //[SIERRA-ADD] - Mechs-by-Shegar + if(owner.hatch_closed && owner.power != MECH_POWER_ON) + to_chat(usr, SPAN_WARNING("Cockpit hydraulic system offline,hatch can't be closed now.")) + return + //[SIERRA-ADD] owner.hatch_closed = ..() to_chat(usr, SPAN_NOTICE("The [owner.body.hatch_descriptor] is now [owner.hatch_closed ? "closed" : "open" ].")) owner.update_icon() playsound(src.loc, 'sound/machines/suitstorage_cycledoor.ogg', 50, 1, -6) -/obj/screen/exosuit/toggle/hatch_open/on_update_icon() +/obj/screen/movable/exosuit/toggle/hatch_open/on_update_icon() toggled = owner.hatch_closed . = ..() if(toggled) @@ -297,22 +309,25 @@ maptext_x = 4 // This is basically just a holder for the updates the exosuit does. -/obj/screen/exosuit/health +/obj/screen/movable/exosuit/health name = "exosuit integrity" icon_state = "health" -/obj/screen/exosuit/health/Click() +/obj/screen/movable/exosuit/health/Click() if(..()) if(owner && owner.body && owner.get_cell() && owner.body.diagnostics?.is_functional()) usr.setClickCooldown(0.2 SECONDS) to_chat(usr, SPAN_NOTICE("The diagnostics panel blinks several times as it updates:")) playsound(owner.loc,'sound/effects/scanbeep.ogg',30,0) + //[SIERRA-ADD] - Mechs-by-Shegar + owner.get_main_data(usr) + //[SIERRA-ADD] for(var/obj/item/mech_component/MC in list(owner.arms, owner.legs, owner.body, owner.head)) if(MC) MC.return_diagnostics(usr) //Controls if cameras set the vision flags -/obj/screen/exosuit/toggle/camera +/obj/screen/movable/exosuit/toggle/camera name = "toggle camera matrix" icon_state = "small_important" maptext = MECH_UI_STYLE("SENSOR") @@ -320,7 +335,7 @@ maptext_y = 13 height = 12 -/obj/screen/exosuit/toggle/camera/toggled() +/obj/screen/movable/exosuit/toggle/camera/toggled() if(!owner.head) to_chat(usr, SPAN_WARNING("I/O Error: Camera systems not found.")) return @@ -333,30 +348,30 @@ owner.head.active_sensors = ..() to_chat(usr, SPAN_NOTICE("[owner.head.name] advanced sensor mode is [owner.head.active_sensors ? "now" : "no longer" ] active.")) -/obj/screen/exosuit/toggle/camera/on_update_icon() +/obj/screen/movable/exosuit/toggle/camera/on_update_icon() toggled = owner.head.active_sensors . = ..() -/obj/screen/exosuit/needle +/obj/screen/movable/exosuit/needle vis_flags = VIS_INHERIT_ID icon_state = "heatprobe_needle" -/obj/screen/exosuit/heat +/obj/screen/movable/exosuit/heat name = "heat probe" icon_state = "heatprobe" var/celsius = TRUE - var/obj/screen/exosuit/needle/gauge_needle = null + var/obj/screen/movable/exosuit/needle/gauge_needle = null desc = "TEST" -/obj/screen/exosuit/heat/Initialize() +/obj/screen/movable/exosuit/heat/Initialize() . = ..() - gauge_needle = new /obj/screen/exosuit/needle(owner) + gauge_needle = new /obj/screen/movable/exosuit/needle(owner) vis_contents += gauge_needle -/obj/screen/exosuit/heat/Destroy() +/obj/screen/movable/exosuit/heat/Destroy() QDEL_NULL(gauge_needle) . = ..() -/obj/screen/exosuit/heat/Click(location, control, params) +/obj/screen/movable/exosuit/heat/Click(location, control, params) if(..()) var/modifiers = params2list(params) if(modifiers["shift"]) @@ -381,7 +396,7 @@ else usr.show_message(SPAN_WARNING("The life support panel isn't responding."), VISIBLE_MESSAGE) -/obj/screen/exosuit/heat/proc/Update() +/obj/screen/movable/exosuit/heat/proc/Update() //Relative value of heat if(owner && owner.body && owner.body.diagnostics?.is_functional() && gauge_needle) var/value = clamp( owner.bodytemperature / (owner.material.melting_point * 1.55), 0, 1) diff --git a/code/modules/mechs/mech.dm b/code/modules/mechs/mech.dm index 7a0287472c6c1..2f48b31e745cf 100644 --- a/code/modules/mechs/mech.dm +++ b/code/modules/mechs/mech.dm @@ -24,6 +24,8 @@ can_be_buckled = FALSE + ignore_hazard_flags = HAZARD_FLAG_SHARD + var/emp_damage = 0 var/obj/item/device/radio/exosuit/radio @@ -68,12 +70,12 @@ // Interface stuff. var/list/hud_elements = list() var/list/hardpoint_hud_elements = list() - var/obj/screen/exosuit/health/hud_health - var/obj/screen/exosuit/toggle/hatch_open/hud_open - var/obj/screen/exosuit/power/hud_power - var/obj/screen/exosuit/heat/hud_heat - var/obj/screen/exosuit/toggle/power_control/hud_power_control - var/obj/screen/exosuit/toggle/camera/hud_camera + var/obj/screen/movable/exosuit/health/hud_health + var/obj/screen/movable/exosuit/toggle/hatch_open/hud_open + var/obj/screen/movable/exosuit/power/hud_power + var/obj/screen/movable/exosuit/heat/hud_heat + var/obj/screen/movable/exosuit/toggle/power_control/hud_power_control + var/obj/screen/movable/exosuit/toggle/camera/hud_camera //POWER var/power = MECH_POWER_OFF @@ -153,6 +155,9 @@ hud_camera = null QDEL_NULL_LIST(hud_elements) + //[SIERRA-ADD]-Mechs-by-Shegar + QDEL_NULL_LIST(menu_hud_elements) + //[SIERRA-ADD] for (var/hardpoint in hardpoints) qdel(hardpoints[hardpoint]) @@ -166,7 +171,7 @@ QDEL_NULL(body) for(var/hardpoint in hardpoint_hud_elements) - var/obj/screen/exosuit/hardpoint/H = hardpoint_hud_elements[hardpoint] + var/obj/screen/movable/exosuit/hardpoint/H = hardpoint_hud_elements[hardpoint] H.owner = null H.holding = null qdel(H) diff --git a/code/modules/mechs/mech_construction.dm b/code/modules/mechs/mech_construction.dm index 1b038c1153bff..9e31c0c4008a7 100644 --- a/code/modules/mechs/mech_construction.dm +++ b/code/modules/mechs/mech_construction.dm @@ -45,9 +45,9 @@ if(target == selected_hardpoint) clear_selected_hardpoint() - GLOB.destroyed_event.unregister(module_to_forget, src, .proc/forget_module) + GLOB.destroyed_event.unregister(module_to_forget, src, PROC_REF(forget_module)) - var/obj/screen/exosuit/hardpoint/H = hardpoint_hud_elements[target] + var/obj/screen/movable/exosuit/hardpoint/H = hardpoint_hud_elements[target] H.holding = null hud_elements -= module_to_forget @@ -101,13 +101,13 @@ playsound(user.loc, 'sound/items/Screwdriver.ogg', 100, 1) else return FALSE - GLOB.destroyed_event.register(system, src, .proc/forget_module) + GLOB.destroyed_event.register(system, src, PROC_REF(forget_module)) system.forceMove(src) hardpoints[system_hardpoint] = system ME.installed(src) - var/obj/screen/exosuit/hardpoint/H = hardpoint_hud_elements[system_hardpoint] + var/obj/screen/movable/exosuit/hardpoint/H = hardpoint_hud_elements[system_hardpoint] H.holding = system system.screen_loc = H.screen_loc @@ -143,9 +143,9 @@ system.forceMove(get_turf(src)) system.screen_loc = null system.layer = initial(system.layer) - GLOB.destroyed_event.unregister(system, src, .proc/forget_module) + GLOB.destroyed_event.unregister(system, src, PROC_REF(forget_module)) - var/obj/screen/exosuit/hardpoint/H = hardpoint_hud_elements[system_hardpoint] + var/obj/screen/movable/exosuit/hardpoint/H = hardpoint_hud_elements[system_hardpoint] H.holding = null for(var/thing in pilots) diff --git a/code/modules/mechs/mech_damage.dm b/code/modules/mechs/mech_damage.dm index d9cb6c8a45355..f0bd5cac29041 100644 --- a/code/modules/mechs/mech_damage.dm +++ b/code/modules/mechs/mech_damage.dm @@ -69,11 +69,32 @@ /mob/living/exosuit/bullet_act(obj/item/projectile/P, def_zone, used_weapon) if (status_flags & GODMODE) return PROJECTILE_FORCE_MISS + //[SIERRA-ADD] - Mechs-by-Shegar + //Проверяем, с какого направления прилетает атака! + var/local_dir = get_dir(src, get_turf(P)) // <- Узнаём направление от меха до пули + if(local_dir == turn(dir, -90) || local_dir == turn(dir, -135) || local_dir == turn(dir, 180) || local_dir == turn(dir, 90) || local_dir == turn(dir, 135)) + // U U U + // U M U ↓ (Mech dir, look on SOUTH) + // D D D + // M - mech, U - unload passengers if was hit from this side, D - defense passengers(Dont unload) if was hit from this side + if(passengers_ammount > 0) + forced_leave_passenger(null,MECH_DROP_ALL_PASSENGER,"attack") + if(local_dir == turn(dir,-135) || local_dir == turn(dir,135) || local_dir == turn(dir,180)) + P.damage = P.damage * 1.3 + //[SIERRA-ADD] switch(def_zone) if(BP_HEAD , BP_CHEST, BP_MOUTH, BP_EYES) if(LAZYLEN(pilots) && (!hatch_closed || !prob(body.pilot_coverage))) + //[SIERRA-EDIT] - Mechs-by-Shegar + //Если мех открыт и снаряд прилетает в спину меха, урон уйдёт в меха + /* var/mob/living/pilot = pick(pilots) return pilot.bullet_act(P, def_zone, used_weapon) + */ + if(local_dir != turn(dir,-135) || local_dir != turn(dir,135) || local_dir != turn(dir,180)) + var/mob/living/pilot = pick(pilots) + return pilot.bullet_act(P, def_zone, used_weapon) + //[SIERRA-EDIT] ..() /mob/living/exosuit/get_armors_by_zone(def_zone, damage_type, damage_flags) @@ -84,7 +105,10 @@ . += body_armor /mob/living/exosuit/updatehealth() - maxHealth = body ? body.mech_health : 0 + //[SIERRA-EDIT] - Mechs-by-Shegar - Тарков система здоровья меха + //maxHealth = body ? body.mech_health : 0 + maxHealth = (body.mech_health + material.integrity) + head.max_damage + arms.max_damage + legs.max_damage + //[SIERRA-EDIT] health = maxHealth-(getFireLoss()+getBruteLoss()) /mob/living/exosuit/adjustFireLoss(amount, obj/item/mech_component/MC = pick(list(arms, legs, body, head))) @@ -138,15 +162,48 @@ damage = after_armor[1] damagetype = after_armor[2] + //[SIERRA-ADD] - Mechs-by-Shegar - Перенаправление урона + var/obj/item/mech_component/target = zoneToComponent(def_zone) + if(target.total_damage >= target.max_damage) + if(target == head && !head.camera && !head.radio) + body.take_brute_damage(damage/3) + arms.take_brute_damage(damage/3) + legs.take_brute_damage(damage/3) + else if(target == body && !body.m_armour && !body.diagnostics ) + head.take_brute_damage(damage/1.5) + legs.take_brute_damage(damage/1.5) + arms.take_brute_damage(damage/1.5) + else if(target == arms && !arms.motivator) + body.take_brute_damage(damage/3) + head.take_brute_damage(damage/3) + legs.take_brute_damage(damage/3) + else if(target == legs && !legs.motivator) + body.take_brute_damage(damage/2) + head.take_brute_damage(damage/2) + arms.take_brute_damage(damage/2) + updatehealth() + + //[SIERRA-ADD] if(!damage) return 0 - var/target = zoneToComponent(def_zone) //Only 3 types of damage concern mechs and vehicles switch(damagetype) if (DAMAGE_BRUTE) + //[SIERRA-ADD] - Mechs-by-Shegar - сопротивление материала бёрн урону + var/brute_resist = ((material.brute_armor-7)) // Макс защита - 4 от брута, 5 от бёрна + if(brute_resist > 5) + brute_resist = 5 + damage = damage - brute_resist + //[SIERRA-ADD] adjustBruteLoss(damage, target) if (DAMAGE_BURN) + //[SIERRA-ADD] - Mechs-by-Shegar - Сопротивление материала бёрн урону + var/burn_resist = ((material.burn_armor-7)) + if(burn_resist > 5) + burn_resist = 5 + damage = damage - burn_resist + //[SIERRA-ADD] adjustFireLoss(damage, target) if (DAMAGE_RADIATION) for(var/mob/living/pilot in pilots) @@ -186,6 +243,12 @@ /mob/living/exosuit/emp_act(severity) if (status_flags & GODMODE) return + //[SIERRA-ADD] - Mechs-by-Shegar - Эми удар по щиту + for(var/obj/aura/mechshield/thing in auras) + if(thing.active) + thing.emp_attack(severity) + return + //[SIERRA-ADD] var/ratio = get_blocked_ratio(null, DAMAGE_BURN, null, (3-severity) * 20) // HEAVY = 40; LIGHT = 20 if(ratio >= 0.5) diff --git a/code/modules/mechs/mech_icon.dm b/code/modules/mechs/mech_icon.dm index 2385b418de479..2b3721ac5c467 100644 --- a/code/modules/mechs/mech_icon.dm +++ b/code/modules/mechs/mech_icon.dm @@ -36,7 +36,13 @@ /mob/living/exosuit/on_update_icon() var/list/new_overlays = get_mech_images(list(body, head), MECH_BASE_LAYER) if(body) +//[SIERRA-ADD] - Mechs-by-Shegar + new_overlays += back_passengers_overlays + new_overlays += left_back_passengers_overlays + new_overlays += right_back_passengers_overlays +//[SIERRA-ADD] - Mechs-by-Shegar new_overlays += get_mech_image(body.decal, "[body.icon_state]_cockpit", body.on_mech_icon, overlay_layer = MECH_INTERMEDIATE_LAYER) + update_pilots(FALSE) if(LAZYLEN(pilot_overlays)) new_overlays += pilot_overlays @@ -49,6 +55,24 @@ for(var/hardpoint in hardpoints) var/obj/item/mech_equipment/hardpoint_object = hardpoints[hardpoint] if(hardpoint_object) + //[SIERRA-ADD] - Mechs-by-Shegar + if(hardpoint in list(HARDPOINT_LEFT_HAND, HARDPOINT_LEFT_SHOULDER)) + if(dir == WEST || dir == SOUTHWEST || dir == NORTHWEST) + hardpoint_object.mech_layer = MECH_GEAR_LAYER + else if(dir == EAST || dir == SOUTHEAST || dir == NORTHEAST) + hardpoint_object.mech_layer = MECH_BACK_LAYER + else if(hardpoint in list(HARDPOINT_RIGHT_HAND,HARDPOINT_RIGHT_SHOULDER)) + if(dir == WEST || dir == SOUTHWEST || dir == NORTHWEST) + hardpoint_object.mech_layer = MECH_BACK_LAYER + else if(dir == EAST || dir == SOUTHEAST || dir == NORTHEAST || dir == SOUTH) + hardpoint_object.mech_layer = MECH_GEAR_LAYER + else if(hardpoint in list(HARDPOINT_BACK)) + if(dir == SOUTH) + hardpoint_object.mech_layer = MECH_BACK_LAYER + else + hardpoint_object.mech_layer = MECH_GEAR_LAYER + + //[SIERRA-ADD] var/use_icon_state = "[hardpoint_object.icon_state]_[hardpoint]" if(use_icon_state in GLOB.mech_weapon_overlays) var/color = COLOR_WHITE @@ -62,8 +86,19 @@ else color = head.color decal = head.decal +// [/SIERRA-ADD] + if(power == MECH_POWER_ON) + if(use_icon_state in GLOB.mech_weapon_overlays) + new_overlays += get_mech_image(decal, use_icon_state, 'mods/mechs_by_shegar/icons/mech_weapon_overlays.dmi', color, hardpoint_object.mech_layer ) + else + new_overlays += get_mech_image(decal, use_icon_state, 'mods/mechs_by_shegar/icons/mech_weapon_overlays_off.dmi', color, hardpoint_object.mech_layer ) +// [/SIERRA-ADD] +// [/SIERRA-REMOVE] +/* new_overlays += get_mech_image(decal, use_icon_state, 'icons/mecha/mech_weapon_overlays.dmi', color, hardpoint_object.mech_layer ) +*/ +// [/SIERRA-REMOVE] SetOverlays(new_overlays) /mob/living/exosuit/proc/update_pilots(update_overlays = TRUE) diff --git a/code/modules/mechs/mech_interaction.dm b/code/modules/mechs/mech_interaction.dm index cbd5ecb1126a3..a145767d318ad 100644 --- a/code/modules/mechs/mech_interaction.dm +++ b/code/modules/mechs/mech_interaction.dm @@ -2,8 +2,16 @@ if(usr == src && usr != over) if(istype(over, /mob/living/exosuit)) var/mob/living/exosuit/exosuit = over - if(exosuit.enter(src)) - return +//[SIERRA-ADD] - Mechs-by-Shegar + if(exosuit.body) + if(usr.mob_size >= exosuit.body.min_pilot_size && usr.mob_size <= exosuit.body.max_pilot_size \ + && !issilicon(usr)) + if(exosuit.enter(src,FALSE,TRUE,FALSE)) + return + else + to_chat(usr, SPAN_WARNING("You cannot pilot a exosuit of this size.")) + return +//[SIERRA-ADD] return ..() /mob/living/exosuit/MouseDrop_T(atom/dropping, mob/user) @@ -62,7 +70,16 @@ if(!user || incapacitated() || user.incapacitated()) return - +//[SIERRA-ADD] - Mechs-by-Shegar + var/arms_chosen = FALSE + var/body_chosen = FALSE + if(selected_hardpoint == HARDPOINT_LEFT_HAND || selected_hardpoint == HARDPOINT_RIGHT_HAND) + arms_chosen = TRUE + body_chosen = FALSE + else if(selected_hardpoint == HARDPOINT_BACK || selected_hardpoint == HARDPOINT_HEAD || selected_hardpoint == HARDPOINT_LEFT_SHOULDER || selected_hardpoint == HARDPOINT_RIGHT_SHOULDER) + arms_chosen = FALSE + body_chosen = TRUE +//[SIERRA-ADD] - Mechs-by-Shegar if(!loc) return var/adj = A.Adjacent(src) // Why in the fuck isn't Adjacent() commutative. @@ -78,6 +95,14 @@ setClickCooldown(3) return + if(modifiers["alt"]) + if(istype(A, /obj/item/mech_equipment)) + for(var/hardpoint in hardpoints) + if(A == hardpoints[hardpoint]) + A.AltClick(user) + setClickCooldown(3) + return + if(!(user in pilots) && user != src) return @@ -88,16 +113,21 @@ if(A.loc != src && !(get_dir(src, A) & dir)) return - if(!arms) + if(!arms && arms_chosen) to_chat(user, SPAN_WARNING("\The [src] has no manipulators!")) setClickCooldown(3) return - if(!arms.motivator || !arms.motivator.is_functional()) + if((!arms.motivator || !arms.motivator.is_functional()) && arms_chosen) to_chat(user, SPAN_WARNING("Your motivators are damaged! You can't use your manipulators!")) setClickCooldown(15) return + if((!body || body.total_damage >= body.max_damage) && body_chosen) + to_chat(user, SPAN_WARNING("Your cockpit too damaged, additional hardpoints control system damaged, you can't use this module!")) + setClickCooldown(15) + return + if(!get_cell()?.checked_use(arms.power_use * CELLRATE)) to_chat(user, power == MECH_POWER_ON ? SPAN_WARNING("Error: Power levels insufficient.") : SPAN_WARNING("\The [src] is powered off.")) return @@ -184,13 +214,66 @@ if(A == src) setClickCooldown(5) return attack_self(user) - else if(adj && user.a_intent == I_HURT) //Prevents accidental slams. + //[SIERRA-ADD] - Mechs-by-Shegar + else if(adj && user.a_intent == I_HURT && arms.motivator) //Prevents accidental slams. setClickCooldown(arms ? arms.action_delay : 7) // You've already commited to applying fist, don't turn and back out now! playsound(src.loc, legs.mech_step_sound, 60, 1) - src.visible_message(SPAN_DANGER("\The [src] steps back, preparing for a slam!"), blind_message = SPAN_DANGER("You hear the loud hissing of hydraulics!")) + var/arms_local_damage = arms.melee_damage + src.visible_message(SPAN_DANGER("\The [src] steps back, preparing for a strike!"), blind_message = SPAN_DANGER("You hear the loud hissing of hydraulics!")) if (do_after(src, 1.2 SECONDS, get_turf(src), DO_DEFAULT | DO_USER_UNIQUE_ACT | DO_PUBLIC_PROGRESS) && user) - A.attack_generic(src, arms.melee_damage, "slammed against", DAMAGE_BRUTE) //"Punch" would be bad since vehicles without arms could be a thing - var/turf/T = get_step(get_turf(src), src.dir) + //additional actions with objects! + + //emergency airlock open + if(istype(A, /obj/machinery/door/firedoor) ) + var/obj/machinery/door/firedoor/FD = A + if(!FD.blocked) + setClickCooldown(arms ? arms.action_delay : 7) + addtimer(new Callback(FD, TYPE_PROC_REF(/obj/machinery/door/firedoor, toggle), TRUE), 0) + return + //emergency airlock open + + + + //heavy blast open + else if(istype(A,/obj/machinery/door/blast/regular)) + var/obj/machinery/door/blast/FD = A + if(FD.inoperable() || !FD.is_powered()) + setClickCooldown(arms ? arms.action_delay : 7) + addtimer(new Callback(FD, TYPE_PROC_REF(/obj/machinery/door/blast, force_toggle), TRUE), 0) + return + to_chat(user, SPAN_NOTICE("This structure too reinforced for being damaged by [src]!")) + return + //heavy blast open + + + + //blast open + else if( istype(A, /obj/machinery/door/blast) || istype(A, /obj/machinery/door/blast/shutters) ) + var/obj/machinery/door/blast/FD = A + if(FD.inoperable() || !FD.is_powered()) + setClickCooldown(arms ? arms.action_delay : 7) + addtimer(new Callback(FD, TYPE_PROC_REF(/obj/machinery/door/blast, force_toggle), TRUE), 0) + return + arms_local_damage = arms_local_damage * 2 + //blast open + + + + //door open + else if((istype(A, /obj/machinery/door))) + var/obj/machinery/door/airlock/FD = A + if(FD.inoperable() || !FD.is_powered()) + setClickCooldown(arms ? arms.action_delay : 7) + addtimer(new Callback(FD, TYPE_PROC_REF(/obj/machinery/door, toggle), TRUE), 0) + return + arms_local_damage = arms_local_damage * 2 + //door open + + + //Now - attack + A.attack_generic(src, arms_local_damage, "strikes", DAMAGE_BRUTE) //"Punch" would be bad since vehicles without arms could be a thing //No + var/turf/T = get_turf(A) + //[SIERRA-ADD] if(istype(T)) do_attack_effect(T, "smash") playsound(src.loc, arms.punch_sound, 50, 1) @@ -214,7 +297,7 @@ for(var/hardpoint in hardpoints) if(hardpoint != selected_hardpoint) continue - var/obj/screen/exosuit/hardpoint/H = hardpoint_hud_elements[hardpoint] + var/obj/screen/movable/exosuit/hardpoint/H = hardpoint_hud_elements[hardpoint] if(istype(H)) H.icon_state = "hardpoint" break @@ -235,10 +318,14 @@ if(!user.Adjacent(src)) return FALSE if(hatch_locked) + if(!check_passenger(user)) + return if(!silent) to_chat(user, SPAN_WARNING("The [body.hatch_descriptor] is locked.")) return FALSE if(hatch_closed) + if(!check_passenger(user)) + return if(!silent) to_chat(user, SPAN_WARNING("The [body.hatch_descriptor] is closed.")) return FALSE @@ -274,7 +361,7 @@ user.client.screen |= hud_elements LAZYADD(pilots, user) LAZYDISTINCTADD(user.additional_vision_handlers, src) - GLOB.destroyed_event.register(user, src, .proc/remove_pilot) + GLOB.destroyed_event.register(user, src, PROC_REF(remove_pilot)) sync_access() update_pilots() @@ -287,10 +374,13 @@ user.dropInto(loc) if (user.client) user.client.screen -= hud_elements + //[SIERRA-ADD] - Mechs-by-Shegar + user.client.screen -= menu_hud_elements + //[SIERRA-ADD] user.client.eye = user LAZYREMOVE(user.additional_vision_handlers, src) LAZYREMOVE(pilots, user) - GLOB.destroyed_event.unregister(user, src, .proc/remove_pilot) + GLOB.destroyed_event.unregister(user, src, PROC_REF(remove_pilot)) sync_access() update_pilots() @@ -343,6 +433,8 @@ if (isCrowbar(tool)) if (!body) USE_FEEDBACK_FAILURE("\The [src] has no cockpit to force.") + //[SIERRA-EDIT] - Mechs-by-Shegar + /* return TRUE if (!hatch_locked) USE_FEEDBACK_FAILURE("\The [src]'s cockpit isn't locked. You don't need to force it.") @@ -352,40 +444,39 @@ SPAN_WARNING("You start forcing \the [src]'s emergency [body.hatch_descriptor] release using \the [tool].") ) if (!user.do_skilled((tool.toolspeed * 5) SECONDS, list(SKILL_DEVICES, SKILL_EVA), src) || !user.use_sanity_check(src, tool)) - return TRUE - if (!body) - USE_FEEDBACK_FAILURE("\The [src] has no cockpit to force.") - return TRUE + */ + return FALSE + if(hatch_locked) + USE_FEEDBACK_FAILURE("\The [src]'s cockpit locked by cockpit security bolts. You need saw or welder.") + return FALSE + var/delay = min(50 * user.skill_delay_mult(SKILL_DEVICES), 50 * user.skill_delay_mult(SKILL_EVA)) + visible_message(SPAN_NOTICE("\The [user] starts forcing the \the [src]'s emergency [body.hatch_descriptor] release using \the [tool].")) + if(!do_after(user, delay, src, DO_DEFAULT | DO_PUBLIC_PROGRESS)) + return playsound(src, 'sound/machines/bolts_up.ogg', 25, TRUE) - hatch_locked = FALSE - hatch_closed = FALSE - for (var/mob/pilot in pilots) - eject(pilot, TRUE) + hatch_closed = !hatch_closed hud_open.update_icon() update_icon() - user.visible_message( - SPAN_WARNING("\The [user] forces \the [src]'s emergency [body.hatch_descriptor] release using \a [tool]."), - SPAN_WARNING("You force \the [src]'s emergency [body.hatch_descriptor] release using \the [tool].") - ) return TRUE + //[SIERRA-EDIT] // Exosuit Customization Kit - Customize the exosuit - if (istype(tool, /obj/item/device/kit/paint)) - var/obj/item/device/kit/paint/paint = tool - SetName(paint.new_name) - desc = paint.new_desc + + +// [SIERRA-EDIT] + else if (istype(tool, /obj/item/device/kit/mech)) + var/obj/item/device/kit/mech/paint = tool for (var/obj/item/mech_component/component in list(arms, legs, head, body)) - component.decal = paint.new_icon - if (paint.new_icon_file) + component.decal = paint.current_decal + if(paint.new_icon_file) icon = paint.new_icon_file update_icon() - paint.use(1, user) user.visible_message( SPAN_NOTICE("\The [user] opens \the [tool] and spends some quality time customising \the [src]."), SPAN_NOTICE("You open \the [tool] and spend some quality time customising \the [src].") ) return TRUE - +// [SIERRA-EDIT] // Mech Equipment - Install equipment if (istype(tool, /obj/item/mech_equipment)) if (hardpoints_locked) @@ -523,6 +614,11 @@ /mob/living/exosuit/attack_hand(mob/user) // Drag the pilot out if possible. if(user.a_intent == I_HURT) + //[SIERRA-ADD] - Mechs-by-Shegar + if(passengers_ammount > 0 && hatch_closed)// Стянуть пассажира с меха рукой! + forced_leave_passenger(null,2,user) + return + //[SIERRA-ADD] if(!LAZYLEN(pilots)) to_chat(user, SPAN_WARNING("There is nobody inside \the [src].")) else if(!hatch_closed) @@ -536,13 +632,16 @@ attack_generic(user, 5, "slams") user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN*2) return - +//[SIERRA-REMOVE]-Mechs-by-Shegar +/* // Otherwise toggle the hatch. if(hud_open) hud_open.toggled() +*/ +//[SIERRA-REMOVE] return -/mob/living/exosuit/attack_generic(mob/user, damage, attack_message = "smashes into") +/mob/living/exosuit/attack_generic(mob/user, damage, attack_message = "strikes") ..() if(damage) playsound(loc, body.damage_sound, 40, 1) diff --git a/code/modules/mechs/mech_life.dm b/code/modules/mechs/mech_life.dm index c1d8cb34dac92..0a4f2a478418d 100644 --- a/code/modules/mechs/mech_life.dm +++ b/code/modules/mechs/mech_life.dm @@ -8,9 +8,16 @@ if(pilot.loc != src) // Admin jump or teleport/grab. if(pilot.client) pilot.client.screen -= hud_elements + pilot.client.screen -= menu_hud_elements LAZYREMOVE(pilots, pilot) UNSETEMPTY(pilots) update_pilots() + //[SIERRA-EDIT] - Mechs-by-Shegar + //Я сдвинул вот этот кусок выше, дабы если ВДРУГ функция будет умирать по пути, то мех не становился бессмертным + //[SIERRA-EDIT] + updatehealth() + if(health <= 0 && stat != DEAD) + death() if(radio) radio.on = (head && head.radio && head.radio.is_functional() && get_cell()) @@ -32,10 +39,6 @@ M.deactivate() - updatehealth() - if(health <= 0 && stat != DEAD) - death() - if(emp_damage > 0) emp_damage -= min(1, emp_damage) //Reduce emp accumulation over time diff --git a/code/modules/mechs/mech_movement.dm b/code/modules/mechs/mech_movement.dm index d7d59dba9089c..d8ed153e0086c 100644 --- a/code/modules/mechs/mech_movement.dm +++ b/code/modules/mechs/mech_movement.dm @@ -99,11 +99,41 @@ if(direction & (UP|DOWN)) var/txt_dir = direction & UP ? "upwards" : "downwards" exosuit.visible_message(SPAN_NOTICE("\The [exosuit] moves [txt_dir].")) - +//[SIERRA-ADD] - Mechs-by-Shegar - STRAFE + if(exosuit.legs.can_strafe) + for(var/thing in exosuit.pilots) //Для всех пилотов внутри + var/mob/pilot = thing + if(pilot && pilot.client) + for(var/key in pilot.client.keys_held) + if (key == "Space") + var/move_speed = exosuit.legs.move_delay + if(!exosuit.legs.good_in_strafe) + move_speed = move_speed * 2.5 + if(direction == NORTHWEST || direction == NORTHEAST || direction == SOUTHWEST || direction == SOUTHEAST) + move_speed = sqrt((move_speed*move_speed) + (move_speed * move_speed)) + if(move_speed > 12) + move_speed = 12 + exosuit.SetMoveCooldown(exosuit.legs ? move_speed : 3) + var/turf/target_loc = get_step(exosuit, direction) + if(target_loc && exosuit.legs && exosuit.legs.can_move_on(exosuit.loc, target_loc) && exosuit.MayEnterTurf(target_loc)) + exosuit.Move(target_loc) + return MOVEMENT_HANDLED +//[SIERRA-ADD] + +//TURN if(exosuit.dir != moving_dir && !(direction & (UP|DOWN))) playsound(exosuit.loc, exosuit.legs.mech_turn_sound, 40,1) exosuit.set_dir(moving_dir) exosuit.SetMoveCooldown(exosuit.legs.turn_delay) + exosuit.passenger_compartment.count_passengers() + if(exosuit.passengers_ammount > 0) + exosuit.update_passengers() + for(var/hardpoint in exosuit.hardpoints) + if(hardpoint == "left hand" || hardpoint == "right hand" || hardpoint == "left shoulder" || hardpoint == "right shoulder") + exosuit.update_icon() +//TURN + +//MOVE else exosuit.SetMoveCooldown(exosuit.legs ? exosuit.legs.move_delay : 3) var/turf/target_loc = get_step(exosuit, direction) diff --git a/code/modules/mechs/premade/light.dm b/code/modules/mechs/premade/light.dm index 40e19fa2aa75a..8638417d7db53 100644 --- a/code/modules/mechs/premade/light.dm +++ b/code/modules/mechs/premade/light.dm @@ -23,4 +23,4 @@ install_system(new /obj/item/mech_equipment/catapult(src), HARDPOINT_LEFT_HAND) install_system(new /obj/item/mech_equipment/sleeper(src), HARDPOINT_BACK) install_system(new /obj/item/mech_equipment/light(src), HARDPOINT_HEAD) - install_system(new /obj/item/mech_equipment/mender(src), HARDPOINT_RIGHT_HAND) + install_system(new /obj/item/mech_equipment/clamp(src), HARDPOINT_RIGHT_HAND) diff --git a/code/modules/mining/mine_turfs.dm b/code/modules/mining/mine_turfs.dm index 6f3fcea1303b5..7a41280f9c118 100644 --- a/code/modules/mining/mine_turfs.dm +++ b/code/modules/mining/mine_turfs.dm @@ -122,7 +122,7 @@ var/global/list/mining_floors = list() var/mob/mob = AM var/obj/item/pickaxe/pickaxe = mob.IsHolding(/obj/item/pickaxe) if (pickaxe) - attackby(pickaxe, mob) + use_tool(pickaxe, mob) /turf/simulated/mineral/proc/MineralSpread() if(istype(mineral) && mineral.ore_spread_chance > 0) @@ -491,7 +491,7 @@ var/global/list/mining_floors = list() var/obj/item/storage/bag/fossils/S = W if(!S.quick_gather_single) for(var/obj/item/fossil/F in contents) - F.use_tool(W,user) + F.use_tool(W, user) return TRUE else return ..() @@ -544,4 +544,4 @@ var/global/list/mining_floors = list() if(istype(M,/mob/living/silicon/robot)) var/mob/living/silicon/robot/R = M for (var/obj/item/item as anything in R.GetAllHeld(/obj/item/storage/ore)) - attackby(item, R) + use_tool(item, R) diff --git a/code/modules/mob/animations.dm b/code/modules/mob/animations.dm index 8ecf723d929ea..5526d1f149f41 100644 --- a/code/modules/mob/animations.dm +++ b/code/modules/mob/animations.dm @@ -312,8 +312,8 @@ note dizziness decrements automatically in the mob's Life() proc. /mob/proc/make_waddle() waddling = TRUE - GLOB.moved_event.register(src, src, .proc/waddle) + GLOB.moved_event.register(src, src, PROC_REF(waddle)) /mob/proc/stop_waddle() waddling = FALSE - GLOB.moved_event.unregister(src, src, .proc/waddle) + GLOB.moved_event.unregister(src, src, PROC_REF(waddle)) diff --git a/code/modules/mob/death.dm b/code/modules/mob/death.dm index 0f1bbfac54dfb..046c5eee797ca 100644 --- a/code/modules/mob/death.dm +++ b/code/modules/mob/death.dm @@ -15,7 +15,7 @@ flick(anim, animation) if(do_gibs) gibs(loc, dna) - addtimer(new Callback(src, .proc/check_delete, animation), 15) + addtimer(new Callback(src, PROC_REF(check_delete), animation), 15) /mob/proc/check_delete(atom/movable/fake_overlay/animation) if(animation) qdel(animation) @@ -44,7 +44,7 @@ new remains(loc) remove_from_dead_mob_list() - addtimer(new Callback(src, .proc/check_delete, animation), 15) + addtimer(new Callback(src, PROC_REF(check_delete), animation), 15) /mob/proc/death(gibbed,deathmessage="seizes up and falls limp...", show_dead_message = "You have died.") diff --git a/code/modules/mob/grab/grab_object.dm b/code/modules/mob/grab/grab_object.dm index 777ace239e26a..73ca64eaf1b82 100644 --- a/code/modules/mob/grab/grab_object.dm +++ b/code/modules/mob/grab/grab_object.dm @@ -44,8 +44,8 @@ var/obj/item/organ/O = get_targeted_organ() SetName("[initial(name)] ([O.name])") - GLOB.dismembered_event.register(affecting, src, .proc/on_organ_loss) - GLOB.zone_selected_event.register(assailant.zone_sel, src, .proc/on_target_change) + GLOB.dismembered_event.register(affecting, src, PROC_REF(on_organ_loss)) + GLOB.zone_selected_event.register(assailant.zone_sel, src, PROC_REF(on_target_change)) /obj/item/grab/examine(mob/user) . = ..() @@ -298,9 +298,10 @@ /obj/item/grab/proc/force_stand() return current_grab.force_stand -/obj/item/grab/attackby(obj/W, mob/user) +/obj/item/grab/use_tool(obj/item/item, mob/living/user, list/click_params) if(user == assailant) - current_grab.item_attack(src, W) + current_grab.item_attack(src, item) + return ..() /obj/item/grab/proc/can_absorb() return current_grab.can_absorb diff --git a/code/modules/mob/grab/normal/grab_normal.dm b/code/modules/mob/grab/normal/grab_normal.dm index 21fbbbd3c3745..81e6541935cf1 100644 --- a/code/modules/mob/grab/normal/grab_normal.dm +++ b/code/modules/mob/grab/normal/grab_normal.dm @@ -7,10 +7,10 @@ return var/obj/O = get_targeted_organ() if(affecting != assailant) - visible_message(SPAN_WARNING("[assailant] has grabbed [affecting]'s [O.name]!")) + visible_message(SPAN_WARNING("\The [assailant] has grabbed \the [affecting]'s [O.name]!")) else var/datum/pronouns/P = assailant.choose_from_pronouns() - visible_message(SPAN_NOTICE("[assailant] has grabbed [P.his] [O.name]!")) + visible_message(SPAN_NOTICE("\The [assailant] has grabbed [P.his] [O.name]!")) if(!(affecting.a_intent == I_HELP)) upgrade(TRUE) @@ -46,11 +46,11 @@ G.attacking = 0 G.action_used() affecting.Weaken(2) - affecting.visible_message(SPAN_NOTICE("[assailant] pins [affecting] to the ground!")) + affecting.visible_message(SPAN_NOTICE("\The [assailant] pins \the [affecting] to the ground!")) return TRUE else - affecting.visible_message(SPAN_NOTICE("[assailant] fails to pin [affecting] to the ground.")) + affecting.visible_message(SPAN_NOTICE("\The [assailant] fails to pin \the [affecting] to the ground.")) G.attacking = 0 return TRUE else @@ -67,7 +67,7 @@ return FALSE if(!O) - to_chat(assailant, SPAN_WARNING("[affecting] is missing that body part!")) + to_chat(assailant, SPAN_WARNING("\The [affecting] is missing that body part!")) return FALSE assailant.visible_message(SPAN_CLASS("danger", "\The [assailant] begins to [pick("bend", "twist")] \the [affecting]'s [O.name] into a jointlock!")) @@ -82,13 +82,13 @@ G.attacking = 0 G.action_used() O.jointlock(assailant) - assailant.visible_message(SPAN_DANGER("[affecting]'s [O.name] is twisted!")) + assailant.visible_message(SPAN_DANGER("\The [affecting]'s [O.name] is twisted!")) playsound(assailant.loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) return TRUE else - affecting.visible_message(SPAN_NOTICE("[assailant] fails to jointlock [affecting]'s [O.name].")) + affecting.visible_message(SPAN_NOTICE("\The [assailant] fails to jointlock \the [affecting]'s [O.name].")) G.attacking = 0 return TRUE @@ -126,15 +126,15 @@ else - affecting.visible_message(SPAN_NOTICE("[assailant] fails to dislocate [affecting]'s [O.joint].")) + affecting.visible_message(SPAN_NOTICE("\The [assailant] fails to dislocate \the [affecting]'s [O.joint].")) G.attacking = 0 return TRUE else if (O.dislocated > 0) - to_chat(assailant, SPAN_WARNING("[affecting]'s [O.joint] is already dislocated!")) + to_chat(assailant, SPAN_WARNING("\The [affecting]'s [O.joint] is already dislocated!")) return FALSE else - to_chat(assailant, SPAN_WARNING("You can't dislocate [affecting]'s [O.joint]!")) + to_chat(assailant, SPAN_WARNING("You can't dislocate \the [affecting]'s [O.joint]!")) return FALSE /datum/grab/normal/resolve_openhand_attack(obj/item/grab/G) @@ -162,7 +162,7 @@ to_chat(attacker, SPAN_DANGER("You're going to need to remove the eye covering first.")) return if(!target.has_eyes()) - to_chat(attacker, SPAN_DANGER("You cannot locate any eyes on [target]!")) + to_chat(attacker, SPAN_DANGER("You cannot locate any eyes on \the [target]!")) return admin_attack_log(attacker, target, "Grab attacked the victim's eyes.", "Had their eyes grab attacked.", "attacked the eyes, using a grab action, of") @@ -173,6 +173,7 @@ /datum/grab/normal/proc/headbutt(obj/item/grab/G) var/mob/living/carbon/human/attacker = G.assailant var/mob/living/carbon/human/target = G.affecting + var/datum/pronouns/pronouns = attacker.choose_from_pronouns() if(!attacker.skill_check(SKILL_COMBAT, SKILL_BASIC)) return @@ -188,9 +189,9 @@ damage_flags = hat.damage_flags() if(damage_flags & DAMAGE_FLAG_SHARP) - attacker.visible_message(SPAN_CLASS("danger", "[attacker] gores [target][istype(hat)? " with \the [hat]" : ""]!")) + attacker.visible_message(SPAN_CLASS("danger", "\The [attacker] gores \the [target][istype(hat)? " with \the [hat]" : ""]!")) else - attacker.visible_message(SPAN_DANGER("[attacker] thrusts \his head into [target]'s skull!")) + attacker.visible_message(SPAN_DANGER("\The [attacker] thrusts [pronouns.his] head into \the [target]'s skull!")) var/armor = target.get_blocked_ratio(BP_HEAD, DAMAGE_BRUTE, damage = 10) target.apply_damage(damage, DAMAGE_BRUTE, BP_HEAD, damage_flags) @@ -222,20 +223,20 @@ return switch(new_zone) if(BP_MOUTH) - G.assailant.visible_message(SPAN_WARNING("\The [G.assailant] covers [G.affecting]'s mouth!")) + G.assailant.visible_message(SPAN_WARNING("\The [G.assailant] covers \the [G.affecting]'s mouth!")) if(BP_EYES) - G.assailant.visible_message(SPAN_WARNING("\The [G.assailant] covers [G.affecting]'s eyes!")) + G.assailant.visible_message(SPAN_WARNING("\The [G.assailant] covers \the [G.affecting]'s eyes!")) /datum/grab/normal/check_special_target(obj/item/grab/G) switch(G.target_zone) if(BP_MOUTH) if(!G.affecting.check_has_mouth()) - to_chat(G.assailant, SPAN_DANGER("You cannot locate a mouth on [G.affecting]!")) + to_chat(G.assailant, SPAN_DANGER("You cannot locate a mouth on \the [G.affecting]!")) return 0 if(BP_EYES) if(!G.affecting.has_eyes()) - to_chat(G.assailant, SPAN_DANGER("You cannot locate any eyes on [G.affecting]!")) + to_chat(G.assailant, SPAN_DANGER("You cannot locate any eyes on \the [G.affecting]!")) return 0 return TRUE @@ -254,7 +255,7 @@ if (!W.edge || !W.force || W.damtype != DAMAGE_BRUTE) return 0 //unsuitable weapon - user.visible_message(SPAN_DANGER("\The [user] begins to slit [affecting]'s throat with \the [W]!")) + user.visible_message(SPAN_DANGER("\The [user] begins to slit \the [affecting]'s throat with \the [W]!")) user.next_move = world.time + 20 //also should prevent user from triggering this repeatedly if(!do_after(user, 2 SECONDS * user.skill_delay_mult(SKILL_COMBAT), affecting, DO_DEFAULT | DO_USER_UNIQUE_ACT | DO_PUBLIC_PROGRESS)) @@ -279,7 +280,7 @@ if(total_damage) - user.visible_message(SPAN_DANGER("\The [user] slit [affecting]'s throat open with \the [W]!")) + user.visible_message(SPAN_DANGER("\The [user] slit \the [affecting]'s throat open with \the [W]!")) if(W.hitsound) playsound(affecting.loc, W.hitsound, 50, 1, -1) diff --git a/code/modules/mob/grab/normal/norm_aggressive.dm b/code/modules/mob/grab/normal/norm_aggressive.dm index c55c53023944f..0cf64d0508c7d 100644 --- a/code/modules/mob/grab/normal/norm_aggressive.dm +++ b/code/modules/mob/grab/normal/norm_aggressive.dm @@ -25,9 +25,10 @@ /datum/grab/normal/aggressive/process_effect(obj/item/grab/G) var/mob/living/carbon/human/affecting = G.affecting var/mob/living/carbon/human/assailant = G.assailant + var/datum/pronouns/pronouns = assailant.choose_from_pronouns() if (assailant.incapacitated(INCAPACITATION_ALL)) - affecting.visible_message(SPAN_WARNING("[assailant] lets go of \his grab!")) + affecting.visible_message(SPAN_WARNING("\The [assailant] lets go of [pronouns.his] grab!")) qdel(G) return diff --git a/code/modules/mob/grab/normal/norm_kill.dm b/code/modules/mob/grab/normal/norm_kill.dm index 1827706877a56..828e82f9e5332 100644 --- a/code/modules/mob/grab/normal/norm_kill.dm +++ b/code/modules/mob/grab/normal/norm_kill.dm @@ -25,9 +25,10 @@ /datum/grab/normal/kill/process_effect(obj/item/grab/G) var/mob/living/carbon/human/affecting = G.affecting var/mob/living/carbon/human/assailant = G.assailant + var/datum/pronouns/pronouns = assailant.choose_from_pronouns() if (assailant.incapacitated(INCAPACITATION_ALL)) - affecting.visible_message(SPAN_WARNING("[assailant] lets go of \his grab!")) + affecting.visible_message(SPAN_WARNING("\The [assailant] lets go of [pronouns.his] grab!")) qdel(G) return diff --git a/code/modules/mob/grab/normal/norm_neck.dm b/code/modules/mob/grab/normal/norm_neck.dm index a7bff61c77fe0..7dbe9527f36b5 100644 --- a/code/modules/mob/grab/normal/norm_neck.dm +++ b/code/modules/mob/grab/normal/norm_neck.dm @@ -28,9 +28,10 @@ /datum/grab/normal/neck/process_effect(obj/item/grab/G) var/mob/living/carbon/human/affecting = G.affecting var/mob/living/carbon/human/assailant = G.assailant + var/datum/pronouns/pronouns = assailant.choose_from_pronouns() if (assailant.incapacitated(INCAPACITATION_ALL)) - affecting.visible_message(SPAN_WARNING("[assailant] lets go of \his grab!")) + affecting.visible_message(SPAN_WARNING("\The [assailant] lets go of [pronouns.his] grab!")) qdel(G) return diff --git a/code/modules/mob/grab/normal/norm_struggle.dm b/code/modules/mob/grab/normal/norm_struggle.dm index 5e12846ceed36..6585f860b9b88 100644 --- a/code/modules/mob/grab/normal/norm_struggle.dm +++ b/code/modules/mob/grab/normal/norm_struggle.dm @@ -27,20 +27,22 @@ /datum/grab/normal/struggle/process_effect(obj/item/grab/G) var/mob/living/carbon/human/affecting = G.affecting var/mob/living/carbon/human/assailant = G.assailant + var/datum/pronouns/pronouns = assailant.choose_from_pronouns() if (assailant.incapacitated(INCAPACITATION_ALL)) - affecting.visible_message(SPAN_WARNING("[assailant] lets go of \his grab!")) + affecting.visible_message(SPAN_WARNING("\The [assailant] lets go of [pronouns.his] grab!")) qdel(G) return if(affecting.incapacitated(INCAPACITATION_UNRESISTING) || affecting.a_intent == I_HELP) - affecting.visible_message(SPAN_WARNING("[affecting] isn't prepared to fight back as [assailant] tightens \his grip!")) + affecting.visible_message(SPAN_WARNING("\The [affecting] isn't prepared to fight back as \the [assailant] tightens [pronouns.his] grip!")) G.done_struggle = TRUE G.upgrade(TRUE) /datum/grab/normal/struggle/enter_as_up(obj/item/grab/G) var/mob/living/carbon/human/affecting = G.affecting var/mob/living/carbon/human/assailant = G.assailant + var/datum/pronouns/pronouns = assailant.choose_from_pronouns() if(affecting == assailant) G.done_struggle = TRUE @@ -48,13 +50,13 @@ return if(affecting.incapacitated(INCAPACITATION_UNRESISTING) || affecting.a_intent == I_HELP) - affecting.visible_message(SPAN_WARNING("[affecting] isn't prepared to fight back as [assailant] tightens \his grip!")) + affecting.visible_message(SPAN_WARNING("\The [affecting] isn't prepared to fight back as \the [assailant] tightens [pronouns.his] grip!")) G.done_struggle = TRUE G.upgrade(TRUE) else - affecting.visible_message(SPAN_WARNING("[affecting] struggles against [assailant]!")) + affecting.visible_message(SPAN_WARNING("\The [affecting] struggles against \the [assailant]!")) G.done_struggle = FALSE - addtimer(new Callback(G, .proc/handle_resist), 1 SECOND) + addtimer(new Callback(G, PROC_REF(handle_resist)), 1 SECOND) resolve_struggle(G) /datum/grab/normal/struggle/proc/resolve_struggle(obj/item/grab/G) diff --git a/code/modules/mob/hear_say.dm b/code/modules/mob/hear_say.dm index b3920f09e2929..e6f7ca8761882 100644 --- a/code/modules/mob/hear_say.dm +++ b/code/modules/mob/hear_say.dm @@ -75,6 +75,8 @@ if (italics) display_message = "[display_message]" + var/runechat_message = display_message + var/display_controls if (is_ghost) if (display_name != speaker.real_name && speaker.real_name) @@ -110,6 +112,10 @@ on_hear_say({"[SPAN_CLASS("game say", "[display_controls][SPAN_CLASS("name", display_name)][alt_name] [display_message]")]"}) + if (istype(language, /datum/language/noise)) + create_chat_message(speaker, runechat_message, italics, list("emote")) + else + create_chat_message(speaker, capitalize(runechat_message), italics, list()) /mob/proc/on_hear_say(message) to_chat(src, message) diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 184dc01b87427..82a4f48a57464 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -4,7 +4,7 @@ var/obj/item/in_slot = get_equipped_item(slot) if (istype(in_slot)) if (istype(in_hand)) - in_slot.attackby(in_hand, src) + in_slot.use_tool(in_hand, src) else in_slot.attack_hand(src) else diff --git a/code/modules/mob/living/bot/bot.dm b/code/modules/mob/living/bot/bot.dm index e5cd3e03dfce4..db1b5005b48c9 100644 --- a/code/modules/mob/living/bot/bot.dm +++ b/code/modules/mob/living/bot/bot.dm @@ -13,6 +13,8 @@ bone_material = null bone_amount = 0 + ignore_hazard_flags = HAZARD_FLAG_SHARD + var/obj/item/card/id/botcard = null var/list/botcard_access = list() var/on = 1 @@ -314,7 +316,7 @@ /mob/living/bot/proc/startPatrol() var/turf/T = getPatrolTurf() if(T) - patrol_path = AStar(get_turf(loc), T, /turf/proc/CardinalTurfsWithAccess, /turf/proc/Distance, 0, max_patrol_dist, id = botcard, exclude = obstacle) + patrol_path = AStar(get_turf(loc), T, TYPE_PROC_REF(/turf, CardinalTurfsWithAccess), TYPE_PROC_REF(/turf, Distance), 0, max_patrol_dist, id = botcard, exclude = obstacle) if(!patrol_path) patrol_path = list() obstacle = null @@ -346,7 +348,7 @@ return /mob/living/bot/proc/calcTargetPath() - target_path = AStar(get_turf(loc), get_turf(target), /turf/proc/CardinalTurfsWithAccess, /turf/proc/Distance, 0, max_target_dist, id = botcard, exclude = obstacle) + target_path = AStar(get_turf(loc), get_turf(target), TYPE_PROC_REF(/turf, CardinalTurfsWithAccess), TYPE_PROC_REF(/turf, Distance), 0, max_target_dist, id = botcard, exclude = obstacle) if(!target_path) if(target && target.loc) ignore_list |= target diff --git a/code/modules/mob/living/bot/farmbot.dm b/code/modules/mob/living/bot/farmbot.dm index 12760aa37561e..9b36cdcc7746f 100644 --- a/code/modules/mob/living/bot/farmbot.dm +++ b/code/modules/mob/living/bot/farmbot.dm @@ -127,7 +127,7 @@ /mob/living/bot/farmbot/calcTargetPath() // We need to land NEXT to the tray, because the tray itself is impassable for(var/trayDir in list(NORTH, SOUTH, EAST, WEST)) - target_path = AStar(get_turf(loc), get_step(get_turf(target), trayDir), /turf/proc/CardinalTurfsWithAccess, /turf/proc/Distance, 0, max_target_dist, id = botcard) + target_path = AStar(get_turf(loc), get_step(get_turf(target), trayDir), TYPE_PROC_REF(/turf, CardinalTurfsWithAccess), TYPE_PROC_REF(/turf, Distance), 0, max_target_dist, id = botcard) if(target_path) break if(!target_path) diff --git a/code/modules/mob/living/bot/remotebot.dm b/code/modules/mob/living/bot/remotebot.dm index 6cd6aa9540eb1..25576ecd32a26 100644 --- a/code/modules/mob/living/bot/remotebot.dm +++ b/code/modules/mob/living/bot/remotebot.dm @@ -56,7 +56,7 @@ var/obj/item/device/bot_controller/bot_controller = tool bot_controller.bot = src controller = bot_controller - GLOB.destroyed_event.register(bot_controller, src, .proc/controller_deleted) + GLOB.destroyed_event.register(bot_controller, src, PROC_REF(controller_deleted)) user.visible_message( SPAN_NOTICE("\The [user] syncs \a [tool] to \the [src]."), SPAN_NOTICE("You sync \the [tool] to \the [src].") @@ -69,7 +69,7 @@ /mob/living/bot/remotebot/proc/controller_deleted(obj/item/device/bot_controller/bot_controller) if (controller == bot_controller) controller = null - GLOB.destroyed_event.unregister(bot_controller, src, .proc/controller_deleted) + GLOB.destroyed_event.unregister(bot_controller, src, PROC_REF(controller_deleted)) /mob/living/bot/remotebot/update_icons() diff --git a/code/modules/mob/living/bot/secbot.dm b/code/modules/mob/living/bot/secbot.dm index a4e16954de521..9d2bc7907299e 100644 --- a/code/modules/mob/living/bot/secbot.dm +++ b/code/modules/mob/living/bot/secbot.dm @@ -164,7 +164,7 @@ say("Down on the floor, [suspect_name]! You have [SECBOT_WAIT_TIME] seconds to comply.") if (length(preparing_arrest_sounds)) playsound(src.loc, pick(preparing_arrest_sounds), 50) - GLOB.moved_event.register(target, src, /mob/living/bot/secbot/proc/target_moved) + GLOB.moved_event.register(target, src, TYPE_PROC_REF(/mob/living/bot/secbot, target_moved)) /mob/living/bot/secbot/proc/target_moved(atom/movable/moving_instance, atom/old_loc, atom/new_loc) if(get_dist(get_turf(src), get_turf(target)) >= 1) diff --git a/code/modules/mob/living/carbon/alien/diona/gestalt/gestalt_vote_types.dm b/code/modules/mob/living/carbon/alien/diona/gestalt/gestalt_vote_types.dm index c288edbd693aa..1f967460d48d9 100644 --- a/code/modules/mob/living/carbon/alien/diona/gestalt/gestalt_vote_types.dm +++ b/code/modules/mob/living/carbon/alien/diona/gestalt/gestalt_vote_types.dm @@ -10,7 +10,7 @@ /datum/gestalt_vote/New(obj/structure/diona_gestalt/_owner, mob/_caller) owner = _owner caller =_caller - addtimer(new Callback(src, .proc/timed_out), vote_time) + addtimer(new Callback(src, PROC_REF(timed_out)), vote_time) /datum/gestalt_vote/proc/timed_out() if(owner && !passed) diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 56c07884785cf..bb2405ae269c7 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -354,13 +354,20 @@ var/obj/item/clothing/glasses/G = H.glasses var/obj/item/card/id/ID = M.GetIdCard() var/obj/item/organ/internal/augment/active/hud/AUG + var/obj/item/clothing/accessory/glassesmod/hud/ACC for (var/obj/item/organ/internal/augment/active/hud/A in H.internal_organs) // Check for installed and active HUD implants if (A.hud_type & hudtype) AUG = A break + if (G) + for (var/obj/item/clothing/accessory/glassesmod/hud/C in G.accessories) // Check for HUD accessories on worn eyewear + if (C.hud_type & hudtype) + ACC = C + break + // [SIERRA-EDIT] - NTNET - // return ((istype(G) && ((G.hud_type & hudtype) || (G.hud && (G.hud.hud_type & hudtype)))) && G.check_access(ID)) || AUG?.active && AUG.check_access(ID) // SIERRA-EDIT - ORIGINAL - return ((istype(G) && ((G.hud_type & hudtype) || (G.hud && (G.hud.hud_type & hudtype)))) && G.check_access(ID) && (G.toggleable ? G.active : TRUE)) || AUG?.active && AUG.check_access(ID) + // return ((istype(G) && ((G.hud_type & hudtype) || (G.hud && (G.hud.hud_type & hudtype)))) && G.check_access(ID)) || AUG?.active && AUG.check_access(ID) || ACC?.active // SIERRA-EDIT - ORIGINAL + return ((istype(G) && ((G.hud_type & hudtype) || (G.hud && (G.hud.hud_type & hudtype)))) && G.check_access(ID) && (G.toggleable ? G.active : TRUE)) || AUG?.active && AUG.check_access(ID) || ACC?.active // [/SIERRA-EDIT] else if(istype(M, /mob/living/silicon/robot)) for (var/obj/item/borg/sight/sight as anything in M.GetAllHeld(/obj/item/borg/sight)) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index cdd66fa7e15bc..3e0eac431d46c 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -228,6 +228,9 @@ if(istype(AM, /mob/living/bot/mulebot)) var/mob/living/bot/mulebot/MB = AM MB.runOver(src) + if(istype(AM, /mob/living/exosuit)) + var/mob/living/exosuit/MB = AM + MB.runOver(src) // Get rank from ID, ID inside PDA, PDA, ID in wallet, etc. /mob/living/carbon/human/proc/get_authentification_rank(if_no_id = "No id", if_no_job = "No job") @@ -649,8 +652,9 @@ return species.name /mob/living/carbon/human/proc/play_xylophone() + var/datum/pronouns/pronouns = choose_from_pronouns() if(!src.xylophone) - visible_message(SPAN_WARNING("\The [src] begins playing \his ribcage like a xylophone. It's quite spooky."),SPAN_NOTICE("You begin to play a spooky refrain on your ribcage."),SPAN_WARNING("You hear a spooky xylophone melody.")) + visible_message(SPAN_WARNING("\The [src] begins playing [pronouns.his] ribcage like a xylophone. It's quite spooky."),SPAN_NOTICE("You begin to play a spooky refrain on your ribcage."),SPAN_WARNING("You hear a spooky xylophone melody.")) var/song = pick('sound/effects/xylophone1.ogg','sound/effects/xylophone2.ogg','sound/effects/xylophone3.ogg') playsound(loc, song, 50, 1, -1) xylophone = 1 @@ -1073,27 +1077,28 @@ set desc = "Approximately count somebody's pulse. Requires you to stand still at least 6 seconds." set src in view(1) var/self = 0 + var/datum/pronouns/pronouns = usr.choose_from_pronouns() if(usr.stat || usr.restrained() || !isliving(usr)) return if(usr == src) self = 1 if(!self) - usr.visible_message(SPAN_NOTICE("[usr] kneels down, puts \his hand on [src]'s wrist and begins counting their pulse."),\ - "You begin counting [src]'s pulse") + usr.visible_message(SPAN_NOTICE("\The [usr] kneels down, puts [pronouns.his] hand on \the [src]'s wrist and begins counting their pulse."),\ + "You begin counting \the [src]'s pulse") else - usr.visible_message(SPAN_NOTICE("[usr] begins counting their pulse."),\ + usr.visible_message(SPAN_NOTICE("\The [usr] begins counting [pronouns.his] pulse."),\ "You begin counting your pulse.") if (!pulse() || status_flags & FAKEDEATH) - to_chat(usr, SPAN_DANGER("[src] has no pulse!")) + to_chat(usr, SPAN_DANGER("\The [src] has no pulse!")) return else - to_chat(usr, SPAN_NOTICE("[self ? "You have a" : "[src] has a"] pulse! Counting...")) + to_chat(usr, SPAN_NOTICE("[self ? "You have a" : "\The [src] has a"] pulse! Counting...")) to_chat(usr, "You must[self ? "" : " both"] remain still until counting is finished.") if(do_after(usr, 6 SECONDS, src, DO_DEFAULT | DO_USER_UNIQUE_ACT | DO_PUBLIC_PROGRESS)) - var/message = SPAN_NOTICE("[self ? "Your" : "[src]'s"] pulse is [src.get_pulse(GETPULSE_HAND)].") + var/message = SPAN_NOTICE("[self ? "Your" : "\The [src]'s"] pulse is [src.get_pulse(GETPULSE_HAND)].") to_chat(usr, message) else to_chat(usr, SPAN_WARNING("You failed to check the pulse. Try again.")) @@ -1797,7 +1802,8 @@ if(!nervous_system_failure() && active_breaths) visible_message("\The [src] jerks and gasps for breath!") else - visible_message("\The [src] twitches a bit as \his heart restarts!") + var/datum/pronouns/pronouns = choose_from_pronouns() + visible_message("\The [src] twitches a bit as [pronouns.his] heart restarts!") shock_stage = min(shock_stage, 100) // 120 is the point at which the heart stops. if(getOxyLoss() >= 75) setOxyLoss(75) diff --git a/code/modules/mob/living/carbon/human/human_attackhand.dm b/code/modules/mob/living/carbon/human/human_attackhand.dm index 2eaf614f59d88..40b280b2aef63 100644 --- a/code/modules/mob/living/carbon/human/human_attackhand.dm +++ b/code/modules/mob/living/carbon/human/human_attackhand.dm @@ -164,7 +164,8 @@ if (hit_zone != H.zone_sel.selecting) //If resolve_hand_attack returned a different zone, that means you're not as accurate. if (prob(15) && hit_zone != BP_CHEST && lying) - H.visible_message(SPAN_DANGER("\The [H] attempted to strike \the [src], but \he rolled out of the way!")) + var/datum/pronouns/pronouns = choose_from_pronouns() + H.visible_message(SPAN_DANGER("\The [H] attempted to strike \the [src], but [pronouns.he] rolled out of the way!")) set_dir(pick(GLOB.cardinal)) playsound(loc, attack.miss_sound, 25, 1, -1) return @@ -237,6 +238,7 @@ */ /mob/living/carbon/human/proc/apply_pressure(mob/living/user, target_zone) var/obj/item/organ/external/organ = get_organ(target_zone) + var/datum/pronouns/pronouns = user.choose_from_pronouns() if(!organ || !(organ.status & ORGAN_BLEEDING) || BP_IS_ROBOTIC(organ)) return 0 @@ -246,7 +248,7 @@ return 0 if(user == src) - user.visible_message("\The [user] starts applying pressure to \his [organ.name]!", "You start applying pressure to your [organ.name]!") + user.visible_message("\The [user] starts applying pressure to [pronouns.his] [organ.name]!", "You start applying pressure to your [organ.name]!") else user.visible_message("\The [user] starts applying pressure to [src]'s [organ.name]!", "You start applying pressure to [src]'s [organ.name]!") spawn(0) @@ -258,7 +260,7 @@ organ.applied_pressure = null if(user == src) - user.visible_message("\The [user] stops applying pressure to \his [organ.name]!", "You stop applying pressure to your [organ.name]!") + user.visible_message("\The [user] stops applying pressure to [pronouns.his] [organ.name]!", "You stop applying pressure to your [organ.name]!") else user.visible_message("\The [user] stops applying pressure to [src]'s [organ.name]!", "You stop applying pressure to [src]'s [organ.name]!") diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index 9d93238a9fedc..80d81955ea679 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -56,7 +56,10 @@ var/binoc_check if(client) - binoc_check = client.view == world.view + var/list/client_view = getviewsize(client.view) + var/view_x = client_view[1] + var/view_y = client_view[2] + binoc_check = view_x <= 19 && view_y <= 15 else binoc_check = TRUE @@ -65,6 +68,7 @@ add_clothing_protection(head) if(istype(src.glasses, /obj/item/clothing/glasses)) process_glasses(glasses) + process_visor(head, glasses) if(istype(src.wear_mask, /obj/item/clothing/mask)) add_clothing_protection(wear_mask) if(istype(back,/obj/item/rig)) @@ -90,6 +94,53 @@ add_clothing_protection(G) G.process_hud(src) +/mob/living/carbon/human/proc/process_visor(obj/item/clothing/head/hat, obj/item/clothing/glasses/eyewear) + remove_client_color(/datum/client_color/monochrome) + remove_client_color(/datum/client_color/nvg) + if (hat) + for(var/obj/item/clothing/accessory/glassesmod/mod in hat.accessories) + if (mod?.active) + equipment_darkness_modifier += mod.darkness_view + equipment_vision_flags |= mod.vision_flags + equipment_light_protection += mod.light_protection + if (mod.overlay) + equipment_overlays |= mod.overlay + if (mod.see_invisible >= 0) + if (equipment_see_invis) + equipment_see_invis = min(equipment_see_invis, mod.see_invisible) + else + equipment_see_invis = mod.see_invisible + if (mod.thermals) + //this breaks if more than one thermal accessory is worn at once + add_client_color(/datum/client_color/monochrome) + if (mod.nvg) + //this breaks if more than one nvg accessory is worn at once + add_client_color(/datum/client_color/nvg) + add_clothing_protection(mod) + mod.process_hud(src) + if (eyewear) + for(var/obj/item/clothing/accessory/glassesmod/mod in eyewear.accessories) + if (mod?.active) + equipment_darkness_modifier += mod.darkness_view + equipment_vision_flags |= mod.vision_flags + equipment_light_protection += mod.light_protection + if (mod.overlay) + equipment_overlays |= mod.overlay + if (mod.see_invisible >= 0) + if (equipment_see_invis) + equipment_see_invis = min(equipment_see_invis, mod.see_invisible) + else + equipment_see_invis = mod.see_invisible + if (mod.thermals) + //this breaks if more than one thermal accessory is worn at once + add_client_color(/datum/client_color/monochrome) + if (mod.nvg) + //this breaks if more than one nvg accessory is worn at once + add_client_color(/datum/client_color/nvg) + add_clothing_protection(mod) + mod.process_hud(src) + src.update_client_color() + /mob/living/carbon/human/proc/process_rig(obj/item/rig/O) if(O.visor && O.visor.active && O.visor.vision && O.visor.vision.glasses && (!O.helmet || (head && O.helmet == head))) process_glasses(O.visor.vision.glasses) @@ -339,7 +390,7 @@ rogue_entries += W if(length(rogue_entries)) // These entries did not cleanup after themselves before being destroyed - var/rogue_entries_as_string = jointext(map(rogue_entries, /proc/log_info_line), ", ") + var/rogue_entries_as_string = jointext(map(rogue_entries, GLOBAL_PROC_REF(log_info_line)), ", ") crash_with("[log_info_line(src)] - Following cloaking entries were removed during cleanup: [rogue_entries_as_string]") UNSETEMPTY(cloaking_sources) diff --git a/code/modules/mob/living/carbon/human/human_organs.dm b/code/modules/mob/living/carbon/human/human_organs.dm index a0df7a8a07b2f..bb5ad895fa455 100644 --- a/code/modules/mob/living/carbon/human/human_organs.dm +++ b/code/modules/mob/living/carbon/human/human_organs.dm @@ -217,7 +217,8 @@ return if(BP_IS_ROBOTIC(affected)) - visible_message("\The [src] drops what they were holding, \his [affected.name] malfunctioning!") + var/datum/pronouns/pronouns = choose_from_pronouns() + visible_message("\The [src] drops what they were holding, [pronouns.his] [affected.name] malfunctioning!") var/datum/effect/spark_spread/spark_system = new /datum/effect/spark_spread() spark_system.set_up(5, 0, src) diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm index 410b45b483090..1c0812cb2cd80 100644 --- a/code/modules/mob/living/carbon/human/inventory.dm +++ b/code/modules/mob/living/carbon/human/inventory.dm @@ -22,6 +22,11 @@ This saves us from having to call add_fingerprint() any time something is put in else update_inv_r_hand(0) // [SIERRA-ADD] - SSINPUT + else + // Try to place it in any item that can store stuff, on the mob. + for(var/obj/item/storage/S in src.contents) + if(S.can_be_inserted(I, null, 1) && S.handle_item_insertion(I)) + return // Try put it in their toolbelt if(istype(src.belt, /obj/item/storage)) var/obj/item/storage/belt = src.belt @@ -32,13 +37,7 @@ This saves us from having to call add_fingerprint() any time something is put in var/obj/item/storage/backpack = src.back if(backpack.can_be_inserted(I, null, 1) && backpack.handle_item_insertion(I)) return - - // Try to place it in any item that can store stuff, on the mob. - for(var/obj/item/storage/S in src.contents) - if(S.can_be_inserted(I, null, 1) && S.handle_item_insertion(I)) - return // [/SIERRA-ADD] - else to_chat(H, SPAN_WARNING("You are unable to equip that.")) /mob/living/carbon/human/proc/equip_in_one_of_slots(obj/item/W, list/slots, del_on_fail = 1) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 837e73bd76f18..9fa40a5421ff3 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -610,7 +610,7 @@ adjustHalLoss(-3) if(sleeping) if (!dream_timer && client) - dream_timer = addtimer(new Callback(src, .proc/dream), 10 SECONDS, TIMER_STOPPABLE) + dream_timer = addtimer(new Callback(src, PROC_REF(dream)), 10 SECONDS, TIMER_STOPPABLE) if (mind || ai_holder) //Are they SSD? If so we'll keep them asleep but work off some of that sleep var in case of stoxin or similar. if (client || ai_holder || sleeping > 3) @@ -727,7 +727,7 @@ if(55 to 70) severity = 4 if(70 to 85) severity = 5 if(85 to INFINITY) severity = 6 - overlay_fullscreen("brute", /obj/screen/fullscreen/brute, severity) + overlay_fullscreen("brute", /obj/screen/fullscreen/brute, severity, TRUE) else clear_fullscreen("brute") @@ -925,7 +925,8 @@ custom_pain("[pick("It hurts so much", "You really need some painkillers", "Dear god, the pain")]!", 10, nohalloss = TRUE) if(shock_stage >= 30) - if(shock_stage == 30) visible_message("[src] is having trouble keeping \his eyes open.") + var/datum/pronouns/pronouns = choose_from_pronouns() + if(shock_stage == 30) visible_message("[src] is having trouble keeping [pronouns.his] eyes open.") if(prob(30)) eye_blurry = max(2, eye_blurry) stuttering = max(stuttering, 5) diff --git a/code/modules/mob/living/carbon/human/unarmed_attack.dm b/code/modules/mob/living/carbon/human/unarmed_attack.dm index 877342220f0db..207be30df6de2 100644 --- a/code/modules/mob/living/carbon/human/unarmed_attack.dm +++ b/code/modules/mob/living/carbon/human/unarmed_attack.dm @@ -62,7 +62,7 @@ var/global/list/sparring_attack_cache = list() switch(zone) // strong punches can have effects depending on where they hit if(BP_HEAD, BP_EYES, BP_MOUTH) // Induce blurriness - target.visible_message(SPAN_DANGER("[target] looks momentarily disoriented."), SPAN_DANGER("You see stars.")) + target.visible_message(SPAN_DANGER("\The [target] looks momentarily disoriented."), SPAN_DANGER("You see stars.")) target.apply_effect(attack_damage * 2, EFFECT_EYE_BLUR, armour) if(BP_L_ARM, BP_L_HAND) if (target.l_hand) @@ -80,25 +80,26 @@ var/global/list/sparring_attack_cache = list() var/turf/T = get_step(get_turf(target), get_dir(get_turf(user), get_turf(target))) if(!T.density) step(target, get_dir(get_turf(user), get_turf(target))) - target.visible_message(SPAN_CLASS("danger", "[pick("[target] was sent flying backward!", "[target] staggers back from the impact!")]")) + target.visible_message(SPAN_CLASS("danger", "[pick("\The [target] was sent flying backward!", "\The [target] staggers back from the impact!")]")) if(prob(50)) target.set_dir(GLOB.reverse_dir[target.dir]) target.apply_effect(attack_damage * 0.4, EFFECT_WEAKEN, armour) if(BP_GROIN) + var/datum/pronouns/pronouns = target.choose_from_pronouns() target.visible_message( - SPAN_WARNING("[target] looks like \he is in pain!"), + SPAN_WARNING("\The [target] looks like [pronouns.he] is in pain!"), SPAN_WARNING("[(target.gender=="female") ? "Oh god that hurt!" : "Oh no, not your[pick("testicles", "crown jewels", "clockweights", "family jewels", "marbles", "bean bags", "teabags", "sweetmeats", "goolies")]!"]") ) target.apply_effects(stutter = attack_damage * 2, agony = attack_damage* 3, blocked = armour) if(BP_L_LEG, BP_L_FOOT, BP_R_LEG, BP_R_FOOT) if(!target.lying) - target.visible_message(SPAN_WARNING("[target] gives way slightly.")) + target.visible_message(SPAN_WARNING("\The [target] gives way slightly.")) target.apply_effect(attack_damage * 3, EFFECT_PAIN, armour) else if(attack_damage >= 5 && !(target == user) && (stun_chance + attack_damage * 5 >= 100) && armour < 1) // Chance to get the usual throwdown as well (25% standard chance) if(!target.lying) - target.visible_message(SPAN_CLASS("danger", "[target] [pick("slumps", "falls", "drops")] down to the ground!")) + target.visible_message(SPAN_CLASS("danger", "\The [target] [pick("slumps", "falls", "drops")] down to the ground!")) else - target.visible_message(SPAN_DANGER("[target] has been weakened!")) + target.visible_message(SPAN_DANGER("\The [target] has been weakened!")) target.apply_effect(3, EFFECT_WEAKEN, armour * 100) var/obj/item/clothing/C = target.get_covering_equipped_item_by_zone(zone) @@ -107,17 +108,18 @@ var/global/list/sparring_attack_cache = list() /datum/unarmed_attack/proc/show_attack(mob/living/carbon/human/user, mob/living/carbon/human/target, zone, attack_damage) var/obj/item/organ/external/affecting = target.get_organ(zone) - user.visible_message(SPAN_WARNING("[user] [pick(attack_verb)] [target] in the [affecting.name]!")) + user.visible_message(SPAN_WARNING("\The [user] [pick(attack_verb)] \the [target] in the [affecting.name]!")) /datum/unarmed_attack/proc/handle_eye_attack(mob/living/carbon/human/user, mob/living/carbon/human/target) var/obj/item/organ/internal/eyes/eyes = target.internal_organs_by_name[BP_EYES] + var/datum/pronouns/user_pronouns = user.choose_from_pronouns() if(eyes) eyes.take_internal_damage(rand(3,4), 1) - user.visible_message(SPAN_DANGER("[user] presses \his [eye_attack_text] into [target]'s [eyes.name]!")) + user.visible_message(SPAN_DANGER("\The [user] presses [user_pronouns.his] [eye_attack_text] into \the [target]'s [eyes.name]!")) var/eye_pain = eyes.can_feel_pain() to_chat(target, SPAN_CLASS("danger", "You experience[(eye_pain) ? "" : " immense pain as you feel" ] [eye_attack_text_victim] being pressed into your [eyes.name][(eye_pain)? "." : "!"]")) return - user.visible_message(SPAN_DANGER("[user] attempts to press \his [eye_attack_text] into [target]'s eyes, but they don't have any!")) + user.visible_message(SPAN_DANGER("\The [user] attempts to press [user_pronouns.his] [eye_attack_text] into \the [target]'s eyes, but they don't have any!")) /datum/unarmed_attack/proc/damage_flags() return (src.sharp? DAMAGE_FLAG_SHARP : 0)|(src.edge? DAMAGE_FLAG_EDGE : 0) @@ -155,11 +157,14 @@ var/global/list/sparring_attack_cache = list() /datum/unarmed_attack/punch/show_attack(mob/living/carbon/human/user, mob/living/carbon/human/target, zone, attack_damage) var/obj/item/organ/external/affecting = target.get_organ(zone) var/organ = affecting.name + var/datum/pronouns/user_pronouns = user.choose_from_pronouns() + var/datum/pronouns/target_pronouns = target.choose_from_pronouns() attack_damage = clamp(attack_damage, 1, 5) // We expect damage input of 1 to 5 for this proc. But we leave this check juuust in case. if(target == user) - user.visible_message(SPAN_DANGER("[user] [pick(attack_verb)] \himself in the [organ]!")) + var/datum/pronouns/pronouns = user.choose_from_pronouns() + user.visible_message(SPAN_DANGER("\The [user] [pick(attack_verb)] [pronouns.self] in the [organ]!")) return FALSE target.update_personal_goal(/datum/goal/achievement/fistfight, TRUE) @@ -171,24 +176,24 @@ var/global/list/sparring_attack_cache = list() // ----- HEAD ----- // switch(attack_damage) if(1 to 2) - user.visible_message(SPAN_DANGER("[user] slapped [target] across \his cheek!")) + user.visible_message(SPAN_DANGER("\The [user] slapped \the [target] across [target_pronouns.his] cheek!")) if(3 to 4) user.visible_message(pick( - 80; SPAN_DANGER("[user] [pick(attack_verb)] [target] in the head!"), - 20; SPAN_CLASS("danger", "[user] struck [target] in the head[pick("", " with a closed fist")]!"), - 50; SPAN_DANGER("[user] threw a hook against [target]'s head!") + 80; SPAN_DANGER("\The [user] [pick(attack_verb)] \the [target] in the head!"), + 20; SPAN_CLASS("danger", "\The [user] struck \the [target] in the head[pick("", " with a closed fist")]!"), + 50; SPAN_DANGER("\The [user] threw a hook against \the [target]'s head!") )) if(5) user.visible_message(pick( - 10; SPAN_DANGER("[user] gave [target] a solid slap across \his face!"), - 90; SPAN_CLASS("danger", "[user] smashed \his [pick(attack_noun)] into [target]'s [pick("[organ]", "face", "jaw")]!") + 10; SPAN_DANGER("\The [user] gave \the [target] a solid slap across [target_pronouns.his] face!"), + 90; SPAN_CLASS("danger", "\The [user] smashed [user_pronouns.his] [pick(attack_noun)] into \the [target]'s [pick("[organ]", "face", "jaw")]!") )) else // ----- BODY ----- // switch(attack_damage) - if(1 to 2) user.visible_message(SPAN_DANGER("[user] threw a glancing punch at [target]'s [organ]!")) - if(1 to 4) user.visible_message(SPAN_DANGER("[user] [pick(attack_verb)] [target] in \his [organ]!")) - if(5) user.visible_message(SPAN_DANGER("[user] smashed \his [pick(attack_noun)] into [target]'s [organ]!")) + if(1 to 2) user.visible_message(SPAN_DANGER("\The [user] threw a glancing punch at \the [target]'s [organ]!")) + if(1 to 4) user.visible_message(SPAN_DANGER("\The [user] [pick(attack_verb)] \the [target] in [target_pronouns.his] [organ]!")) + if(5) user.visible_message(SPAN_DANGER("\The [user] smashed [user_pronouns.his] [pick(attack_noun)] into \the [target]'s [organ]!")) else user.visible_message(SPAN_CLASS("danger", "[user] [pick("punched", "threw a punch at", "struck", "slammed their [pick(attack_noun)] into")] [target]'s [organ]!")) //why do we have a separate set of verbs for lying targets? @@ -222,13 +227,14 @@ var/global/list/sparring_attack_cache = list() /datum/unarmed_attack/kick/show_attack(mob/living/carbon/human/user, mob/living/carbon/human/target, zone, attack_damage) var/obj/item/organ/external/affecting = target.get_organ(zone) var/organ = affecting.name + var/datum/pronouns/target_pronouns = target.choose_from_pronouns() attack_damage = clamp(attack_damage, 1, 5) switch(attack_damage) - if(1 to 2) user.visible_message(SPAN_DANGER("[user] threw [target] a glancing [pick(attack_noun)] to the [organ]!")) //it's not that they're kicking lightly, it's that the kick didn't quite connect - if(3 to 4) user.visible_message(SPAN_DANGER("[user] [pick(attack_verb)] [target] in \his [organ]!")) - if(5) user.visible_message(SPAN_DANGER("[user] landed a strong [pick(attack_noun)] against [target]'s [organ]!")) + if(1 to 2) user.visible_message(SPAN_DANGER("\The [user] threw \the [target] a glancing [pick(attack_noun)] to \the [organ]!")) //it's not that they're kicking lightly, it's that the kick didn't quite connect + if(3 to 4) user.visible_message(SPAN_DANGER("\The [user] [pick(attack_verb)] \the [target] in [target_pronouns.his] [organ]!")) + if(5) user.visible_message(SPAN_DANGER("\The [user] landed a strong [pick(attack_noun)] against \the [target]'s [organ]!")) /datum/unarmed_attack/stomp attack_verb = list("stomped on") @@ -262,6 +268,7 @@ var/global/list/sparring_attack_cache = list() var/obj/item/organ/external/affecting = target.get_organ(zone) var/organ = affecting.name var/obj/item/clothing/shoes = user.shoes + var/datum/pronouns/user_pronouns = user.choose_from_pronouns() attack_damage = clamp(attack_damage, 1, 5) @@ -269,12 +276,12 @@ var/global/list/sparring_attack_cache = list() switch(attack_damage) if(1 to 4) user.visible_message(pick( - SPAN_CLASS("danger", "[user] stomped on [target]'s [organ][pick("", "with their [shoe_text]")]!"), - SPAN_DANGER("[user] stomped \his [shoe_text] down onto [target]'s [organ]!"))) + SPAN_CLASS("danger", "\The [user] stomped on \the [target]'s [organ][pick("", "with their [shoe_text]")]!"), + SPAN_DANGER("\The [user] stomped [user_pronouns.his] [shoe_text] down onto \the [target]'s [organ]!"))) if(5) user.visible_message(pick( - SPAN_CLASS("danger", "[user] stomped down hard onto [target]'s [organ][pick("", "with their [shoe_text]")]!"), - SPAN_DANGER("[user] slammed \his [shoe_text] down onto [target]'s [organ]!"))) + SPAN_CLASS("danger", "\The [user] stomped down hard onto \the [target]'s [organ][pick("", "with their [shoe_text]")]!"), + SPAN_DANGER("\The [user] slammed [user_pronouns.his] [shoe_text] down onto \the [target]'s [organ]!"))) /datum/unarmed_attack/light_strike deal_halloss = 3 diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 9095960069675..604313ccf91e6 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -779,9 +779,12 @@ var/global/list/damage_icon_parts = list() overlays_standing[HO_SURGERY_LAYER] = null var/image/total = new for(var/obj/item/organ/external/E in organs) - if(BP_IS_ROBOTIC(E) || E.is_stump()) + //[SIERRA-EDIT]-[IPC-MODS] + if(E.is_stump()) continue var/how_open = round(E.how_open()) + if(BP_IS_ROBOTIC(E)) + how_open = E.hatch_state if(how_open <= 0) continue var/surgery_icon = E.species.get_surgery_overlay_icon(src) @@ -791,6 +794,13 @@ var/global/list/damage_icon_parts = list() var/base_state = "[E.icon_name][how_open]" var/overlay_state = "[base_state]-flesh" var/list/overlays_to_add + if(BP_IS_ROBOTIC(E)) + surgery_icon = 'mods/ipc_mods/icons/ipc_icons.dmi' + overlay_state = "[base_state]-robo" + LAZYADD(overlays_to_add, image(icon = surgery_icon, icon_state = overlay_state, layer = -HO_SURGERY_LAYER)) + total.AddOverlays(overlays_to_add) + continue + //[/SIERRA-EDIT]-[IPC-MODS] if(overlay_state in surgery_states) var/image/flesh = image(icon = surgery_icon, icon_state = overlay_state, layer = -HO_SURGERY_LAYER) flesh.color = E.species.get_flesh_colour(src) diff --git a/code/modules/mob/living/carbon/xenobiological/items.dm b/code/modules/mob/living/carbon/xenobiological/items.dm index c8e1208377989..67793bbef1f3c 100644 --- a/code/modules/mob/living/carbon/xenobiological/items.dm +++ b/code/modules/mob/living/carbon/xenobiological/items.dm @@ -13,18 +13,20 @@ var/enhanced = 0 //has it been enhanced before? atom_flags = ATOM_FLAG_OPEN_CONTAINER -/obj/item/slime_extract/attackby(obj/item/O as obj, mob/user as mob) +/obj/item/slime_extract/use_tool(obj/item/O, mob/living/user, list/click_params) if(istype(O, /obj/item/slimesteroid2)) if(enhanced == 1) to_chat(user, SPAN_WARNING(" This extract has already been enhanced!")) - return ..() + return TRUE if(Uses == 0) to_chat(user, SPAN_WARNING(" You can't enhance a used extract!")) - return ..() + return TRUE to_chat(user, "You apply the enhancer. It now has triple the amount of uses.") Uses = 3 enhanced = 1 qdel(O) + return TRUE + return ..() /obj/item/slime_extract/New() GLOB.extracted_slime_cores_amount += 1 diff --git a/code/modules/mob/living/carbon/xenobiological/slime_AI.dm b/code/modules/mob/living/carbon/xenobiological/slime_AI.dm index 12fb3a6b54fc2..4f8fea668791b 100644 --- a/code/modules/mob/living/carbon/xenobiological/slime_AI.dm +++ b/code/modules/mob/living/carbon/xenobiological/slime_AI.dm @@ -23,7 +23,7 @@ handle_targets() if (!AIproc) - addtimer(new Callback(src, .proc/handle_AI), 0) + addtimer(new Callback(src, PROC_REF(handle_AI)), 0) handle_speech_and_mood() /mob/living/carbon/slime/proc/handle_targets() @@ -179,7 +179,7 @@ UnarmedAttack(frenemy) var/sleeptime = max(movement_delay(), 5) + addedDelay // Maximum one action per half a second - addtimer(new Callback(src, .proc/handle_AI), sleeptime) + addtimer(new Callback(src, PROC_REF(handle_AI)), sleeptime) /mob/living/carbon/slime/proc/UpdateFace() diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 16a6807d86194..1d18fb3537547 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -647,6 +647,26 @@ default behaviour is: if(C.mob_breakout(src)) return TRUE +//[SIERRA-ADD] - Mechs-by-Shegar - Слезание с пассажирки/выгрузка пассажиров + // Пассажирка меха + if(istype(loc, /obj/item/mech_component/passenger_compartment)) // Если прожал resist пассажир меха + var/mob/living/exosuit/M = loc.loc + var/obj/item/mech_component/passenger_compartment/C = loc + if((src in C.back_passengers) || (src in C.left_back_passengers) || (src in C.right_back_passengers)) + if(M.leave_passenger(src)) + return TRUE + + if(istype(loc, /mob/living/exosuit)) // Если прожал resist пилот меха + var/mob/living/exosuit/C = loc + if(C.passengers_ammount > 1) + var/choose + var/choosed_place = input(usr, "Choose passenger place which you want unload.", name, choose) as null|anything in C.passenger_places + C.forced_leave_passenger(choosed_place , null , C) + else + C.forced_leave_passenger(null , MECH_DROP_ANY_PASSENGER , C) + return TRUE +//[SIERRA-ADD] + /mob/living/proc/escape_inventory(obj/item/holder/H) if(H != src.loc) return diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index d5c58b9536238..bad11f3e1992e 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -197,7 +197,7 @@ /mob/living/momentum_do(power, datum/thrownthing/TT, atom/movable/AM) if(power >= 0.75) //snowflake to enable being pinned to walls var/direction = TT.init_dir - throw_at(get_edge_target_turf(src, direction), min((TT.maxrange - TT.dist_travelled) * power, 10), throw_speed * min(power, 1.5), callback = new Callback(src,/mob/living/proc/pin_to_wall,AM,direction)) + throw_at(get_edge_target_turf(src, direction), min((TT.maxrange - TT.dist_travelled) * power, 10), throw_speed * min(power, 1.5), callback = new Callback(src, TYPE_PROC_REF(/mob/living, pin_to_wall), AM,direction)) visible_message(SPAN_DANGER("\The [src] staggers under the impact!"),SPAN_DANGER("You stagger under the impact!")) return diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index d64815a17f8de..ccfc073bbcf5d 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -68,3 +68,6 @@ /// An associative list of /singleton/trait and trait level - See individual traits for valid levels var/list/traits + + /// Some combination of HAZARD_FLAG_*. When set, the flagged hazard types will not damage the mob. + var/ignore_hazard_flags = EMPTY_BITFIELD diff --git a/code/modules/mob/living/living_maneuvers.dm b/code/modules/mob/living/living_maneuvers.dm index 8e0468db972f2..fcfd16123c2c5 100644 --- a/code/modules/mob/living/living_maneuvers.dm +++ b/code/modules/mob/living/living_maneuvers.dm @@ -15,7 +15,7 @@ if(!can_fall(location_override = check)) break if(check && check != loc) - addtimer(new Callback(src, /mob/living/proc/reflexive_maneuver_callback, lastloc, check), 0) + addtimer(new Callback(src, TYPE_PROC_REF(/mob/living, reflexive_maneuver_callback), lastloc, check), 0) return . = ..() diff --git a/code/modules/mob/living/login.dm b/code/modules/mob/living/login.dm index 937c06f2e03d6..511ceca048b14 100644 --- a/code/modules/mob/living/login.dm +++ b/code/modules/mob/living/login.dm @@ -7,3 +7,7 @@ //If they're SSD, remove it so they can wake back up. update_antag_icons(mind) GLOB.living_players |= src + // [SIERRA-ADD] - STATUSBAR + if (my_client && get_preference_value(/datum/client_preference/show_statusbar) == GLOB.PREF_SHOW) + winset(my_client, "mapwindow.statusbar", "is-visible=true") + // [/SIERRA-ADD] diff --git a/code/modules/mob/living/maneuvers/maneuver_leap.dm b/code/modules/mob/living/maneuvers/maneuver_leap.dm index 2a6eecfbf79fa..8f785dde54418 100644 --- a/code/modules/mob/living/maneuvers/maneuver_leap.dm +++ b/code/modules/mob/living/maneuvers/maneuver_leap.dm @@ -15,8 +15,8 @@ user.jump_layer_shift() animate(user, pixel_z = 16, time = 3, easing = SINE_EASING | EASE_IN) animate(pixel_z = user.default_pixel_z, time = 3, easing = SINE_EASING | EASE_OUT) - user.throw_at(get_turf(target), strength, 1, user, FALSE, new Callback(src, /singleton/maneuver/leap/proc/end_leap, user, target, old_pass_flags)) - addtimer(new Callback(user, /mob/living/proc/jump_layer_shift_end), 4.5) + user.throw_at(get_turf(target), strength, 1, user, FALSE, new Callback(src, TYPE_PROC_REF(/singleton/maneuver/leap, end_leap), user, target, old_pass_flags)) + addtimer(new Callback(user, TYPE_PROC_REF(/mob/living, jump_layer_shift_end)), 4.5) /singleton/maneuver/leap/proc/end_leap(mob/living/user, atom/target, pass_flag) user.pass_flags = pass_flag @@ -79,5 +79,5 @@ user.jump_layer_shift() animate(user, pixel_z = 16, time = 3, easing = SINE_EASING | EASE_IN) animate(pixel_z = user.default_pixel_z, time = 3, easing = SINE_EASING | EASE_OUT) - user.throw_at(get_turf(target), strength, 1, user, FALSE, new Callback(src, /singleton/maneuver/leap/proc/end_leap, user, target)) - addtimer(new Callback(user, /mob/living/proc/jump_layer_shift_end), 4.5) + user.throw_at(get_turf(target), strength, 1, user, FALSE, new Callback(src, TYPE_PROC_REF(/singleton/maneuver/leap, end_leap), user, target)) + addtimer(new Callback(user, TYPE_PROC_REF(/mob/living, jump_layer_shift_end)), 4.5) diff --git a/code/modules/mob/living/silicon/ai/login.dm b/code/modules/mob/living/silicon/ai/login.dm index 7a39c9d07936a..6ef18029ec709 100644 --- a/code/modules/mob/living/silicon/ai/login.dm +++ b/code/modules/mob/living/silicon/ai/login.dm @@ -1,6 +1,6 @@ /mob/living/silicon/ai/Login() ..() if (stat != DEAD) - for (var/obj/machinery/ai_status_display/O in SSmachines.machinery) + for (var/obj/machinery/ai_status_display/O as anything in SSmachines.get_machinery_of_type(/obj/machinery/ai_status_display)) O.mode = 1 O.emotion = "Neutral" diff --git a/code/modules/mob/living/silicon/ai/power.dm b/code/modules/mob/living/silicon/ai/power.dm index 88b44e39c443e..804a38263be55 100644 --- a/code/modules/mob/living/silicon/ai/power.dm +++ b/code/modules/mob/living/silicon/ai/power.dm @@ -40,7 +40,7 @@ // step 3 tries to locate an APC. It tries up to three times before failing, relying on external influence to restore power only. if(AI_RESTOREPOWER_CONNECTED) var/area/A = get_area(src) - theAPC = A.get_apc() + theAPC = A.apc if(!istype(theAPC)) to_chat(src, SPAN_NOTICE("Error processing connection to APC: Attempt [connection_failures+1]/[AI_POWER_RESTORE_MAX_ATTEMPTS]")) diff --git a/code/modules/mob/living/silicon/pai/admin.dm b/code/modules/mob/living/silicon/pai/admin.dm index 3307261558a4c..448dcf20336bd 100644 --- a/code/modules/mob/living/silicon/pai/admin.dm +++ b/code/modules/mob/living/silicon/pai/admin.dm @@ -12,8 +12,10 @@ pai_key = C.key log_and_message_admins("made a pAI with key=[pai_key] at ([t.x],[t.y],[t.z])") - var/obj/item/device/paicard/card = new(t) + var/obj/item/device/paicard/card = new(t, t) + var/mob/living/silicon/pai/pai = new(card, card) + pai.key = pai_key + card.setPersonality(pai) card.pai.key = pai_key - card.setPersonality(card.pai) if (name) card.pai.fully_replace_character_name(name) diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index da25971f1ee9b..040311448f646 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -76,6 +76,7 @@ GLOBAL_LIST_INIT(possible_say_verbs, list( var/flashlight_power = 0.5 //brightness of light when on, must be no greater than 1. var/flashlight_range = 3 //outer range of light when on, can be negative var/light_on = FALSE + light_wedge = LIGHT_OMNI hud_type = /datum/hud/pai @@ -86,12 +87,18 @@ GLOBAL_LIST_INIT(possible_say_verbs, list( return ..() -/mob/living/silicon/pai/Initialize() +/mob/living/silicon/pai/Initialize(mapload, obj/item/device/paicard) . = ..() status_flags |= NO_ANTAG add_language(LANGUAGE_HUMAN_EURO, TRUE) verbs -= /mob/living/verb/ghost software = default_pai_software.Copy() + card = paicard + if (card) + //Radio is inside us, but needs to match waht the card says correct type is + CreateRadio() + else + CRASH("PAI was created without card - This may be an error or require special handling") /mob/living/silicon/pai/proc/CreateRadio() @@ -219,6 +226,10 @@ GLOBAL_LIST_INIT(possible_say_verbs, list( return last_special = world.time + 100 + //Turn off light, we're not a flashlight (unless we remain deployed) + if (light_on) + toggle_integrated_light() + // Move us into the card and move the card to the ground. stop_pulling() resting = FALSE @@ -277,13 +288,14 @@ GLOBAL_LIST_INIT(possible_say_verbs, list( /mob/living/silicon/pai/use_tool(obj/item/tool, mob/user, list/click_params) // ID Card - Set pAI access var/obj/item/card/id/id = tool.GetIdCard() + var/datum/pronouns/pronouns = user.choose_from_pronouns() if (istype(id)) var/id_name = GET_ID_NAME(id, tool) var/list/new_access = id.GetAccess() idcard.access = new_access user.visible_message( - SPAN_NOTICE("\The [user] scans \a [tool] over \the [src], updating \his access."), - SPAN_NOTICE("You scan [id_name] over \the [src], updating \his access.") + SPAN_NOTICE("\The [user] scans \a [tool] over \the [src], updating [pronouns.his] access."), + SPAN_NOTICE("You scan [id_name] over \the [src], updating [pronouns.his] access.") ) return TRUE @@ -325,7 +337,16 @@ GLOBAL_LIST_INIT(possible_say_verbs, list( /mob/living/silicon/pai/proc/toggle_integrated_light() if(!light_on) - set_light(flashlight_range, flashlight_power, 2) + if (light_wedge == LIGHT_OMNI) + light_wedge = LIGHT_VERY_WIDE + flashlight_power = 1 + flashlight_range = 4 + else + light_wedge = LIGHT_OMNI + flashlight_power = initial(flashlight_power) + flashlight_range = initial(flashlight_range) + + set_light(flashlight_range, flashlight_power) to_chat(src, SPAN_NOTICE("You enable your integrated light.")) light_on = TRUE else diff --git a/code/modules/mob/living/silicon/pai/software_modules.dm b/code/modules/mob/living/silicon/pai/software_modules.dm index 2438163e5b9e8..86eb1836d9f34 100644 --- a/code/modules/mob/living/silicon/pai/software_modules.dm +++ b/code/modules/mob/living/silicon/pai/software_modules.dm @@ -66,19 +66,21 @@ return FALSE M = M.loc count++ - var/answer = input(M, "[P] is requesting a DNA sample from you. Will you allow it to confirm your identity?", "[P] Check DNA", "No") in list("Yes", "No") + var/answer = input(M, "\The [P] is requesting a DNA sample from you. Will you allow it to confirm your identity?", "[P] Check DNA", "No") in list("Yes", "No") if (answer == "Yes") var/turf/T = get_turf_or_move(P.loc) + var/datum/pronouns/pronouns = M.choose_from_pronouns() for (var/mob/v in viewers(T)) - v.show_message(SPAN_NOTICE("[M] presses \his thumb against [P]."), 3, SPAN_NOTICE("[P] makes a sharp clicking sound as it extracts DNA material from [M]."), 2) + v.show_message(SPAN_NOTICE("\The [M] presses [pronouns.his] thumb against \the [P]."), 3, SPAN_NOTICE("\The [P] makes a sharp clicking sound as it extracts DNA material from \the [M]."), 2) var/datum/dna/dna = M.dna - to_chat(P, "

[M]'s UE string : [dna.unique_enzymes]

") + to_chat(P, "

\The [M]'s UE string : [dna.unique_enzymes]

") if (dna.unique_enzymes == P.master_dna) to_chat(P, "DNA is a match to stored Master DNA.") else to_chat(P, "DNA does not match stored Master DNA.") else - to_chat(P, "[M] does not seem like \he is going to provide a DNA sample willingly.") + var/datum/pronouns/pronouns = M.choose_from_pronouns() + to_chat(P, "\The [M] does not seem like [pronouns.he] is going to provide a DNA sample willingly.") return TRUE @@ -151,7 +153,7 @@ P.hack_aborted = 0 P.cable = new (T) P.visible_message( - SPAN_ITALIC("A port on [P] opens to reveal \a [P.cable], which promptly falls to the floor."), + SPAN_ITALIC("A port on \the [P] opens to reveal \a [P.cable], which promptly falls to the floor."), SPAN_ITALIC("You open a port to reveal your [P.cable] and unspool it to the floor."), SPAN_ITALIC("You hear the soft click something falling to the floor.") ) diff --git a/code/modules/mob/living/silicon/posi_brainmob.dm b/code/modules/mob/living/silicon/posi_brainmob.dm index 2d6e8aa4a6cb4..52f1ee60f5a51 100644 --- a/code/modules/mob/living/silicon/posi_brainmob.dm +++ b/code/modules/mob/living/silicon/posi_brainmob.dm @@ -52,7 +52,9 @@ /mob/living/silicon/sil_brainmob/show_laws(mob/M) if(M) to_chat(M, "Obey these laws [M]:") - src.laws_sanity_check() +// [SIERRA-REMOVE] - IPC_MODS +// src.laws_sanity_check() +// [/SIERRA-REMOVE] src.laws.show_laws(M) /mob/living/silicon/sil_brainmob/open_subsystem(subsystem_type, mob/given = src) diff --git a/code/modules/mob/living/silicon/robot/drone/drone.dm b/code/modules/mob/living/silicon/robot/drone/drone.dm index 06387673c48d9..f12b1d0758022 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone.dm @@ -87,13 +87,13 @@ var/global/list/mob_hat_cache = list() if (lock_to_current_z) z_locked = get_z(src) - GLOB.moved_event.register(src, src, /mob/living/silicon/robot/drone/proc/on_moved) + GLOB.moved_event.register(src, src, TYPE_PROC_REF(/mob/living/silicon/robot/drone, on_moved)) /mob/living/silicon/robot/drone/Destroy() if(hat) hat.dropInto(loc) hat = null - GLOB.moved_event.unregister(src, src, /mob/living/silicon/robot/drone/proc/on_moved) + GLOB.moved_event.unregister(src, src, TYPE_PROC_REF(/mob/living/silicon/robot/drone, on_moved)) . = ..() /mob/living/silicon/robot/drone/proc/on_moved(atom/movable/am, turf/old_loc, turf/new_loc) @@ -278,7 +278,8 @@ var/global/list/mob_hat_cache = list() clear_inherent_laws() QDEL_NULL(laws) laws = new /datum/ai_laws/syndicate_override - set_zeroth_law("Only [user.real_name] and people \he designates as being such are operatives.") + var/datum/pronouns/pronouns = user.choose_from_pronouns() + set_zeroth_law("Only [user.real_name] and people [pronouns.he] designates as being such are operatives.") //DRONE LIFE/DEATH //For some goddamn reason robots have this hardcoded. Redefining it for our fragile friends here. diff --git a/code/modules/mob/living/silicon/robot/drone/drone_items.dm b/code/modules/mob/living/silicon/robot/drone/drone_items.dm index 1ada0c08a7bda..34a92120472a4 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone_items.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone_items.dm @@ -221,7 +221,7 @@ break if(wrapped) //Already have an item. - //Temporary put wrapped into user so target's attackby() checks pass. + //Temporary put wrapped into user so target's use_tool() checks pass. wrapped.forceMove(user) if (istype(target, /obj/structure/table)) @@ -240,7 +240,7 @@ var/resolved = wrapped.resolve_attackby(target,user,params) //If resolve_attackby forces waiting before taking wrapped, we need to let it finish before doing the rest. - addtimer(new Callback(src, .proc/finish_using, target, user, params, force_holder, resolved), 0) + addtimer(new Callback(src, PROC_REF(finish_using), target, user, params, force_holder, resolved), 0) else if(istype(target,/obj/item)) //Check that we're not pocketing a mob. var/obj/item/I = target diff --git a/code/modules/mob/living/silicon/robot/drone/drone_manufacturer.dm b/code/modules/mob/living/silicon/robot/drone/drone_manufacturer.dm index 4bdcac309785e..04a3e8959a140 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone_manufacturer.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone_manufacturer.dm @@ -118,7 +118,7 @@ if(!fabricator) var/list/all_fabricators = list() - for(var/obj/machinery/drone_fabricator/DF in SSmachines.machinery) + for(var/obj/machinery/drone_fabricator/DF as anything in SSmachines.get_machinery_of_type(/obj/machinery/drone_fabricator)) if(!DF.is_powered() || !DF.produce_drones || DF.drone_progress < 100) continue all_fabricators[DF.fabricator_tag] = DF diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index b416caf8282ba..f5c6e7e28bcee 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -552,7 +552,8 @@ USE_FEEDBACK_FAILURE("\The [src]'s maintenance hatch is already closed.") return TRUE if (!cell) - USE_FEEDBACK_FAILURE("\The [src]'s cell needs to remain in place to close \his maintenance hatch.") + var/datum/pronouns/pronouns = choose_from_pronouns() + USE_FEEDBACK_FAILURE("\The [src]'s cell needs to remain in place to close [pronouns.his] maintenance hatch.") return TRUE opened = FALSE update_icon() @@ -1205,7 +1206,8 @@ laws = new /datum/ai_laws/syndicate_override var/time = time2text(world.realtime,"hh:mm:ss") GLOB.lawchanges.Add("[time] : [user.name]([user.key]) emagged [name]([key])") - set_zeroth_law("Only [user.real_name] and people \he designates as being such are operatives.") + var/datum/pronouns/pronouns = user.choose_from_pronouns() + set_zeroth_law("Only [user.real_name] and people [pronouns.he] designates as being such are operatives.") SetLockdown(0) . = 1 spawn() diff --git a/code/modules/mob/living/silicon/robot/robot_items.dm b/code/modules/mob/living/silicon/robot/robot_items.dm index ab3cb702a16f2..55728b608d9f6 100644 --- a/code/modules/mob/living/silicon/robot/robot_items.dm +++ b/code/modules/mob/living/silicon/robot/robot_items.dm @@ -53,7 +53,7 @@ to_chat(user, "The [src] is empty. Put something inside it first.") if(response == "Sync") var/success = 0 - for(var/obj/machinery/r_n_d/server/S in SSmachines.machinery) + for(var/obj/machinery/r_n_d/server/S as anything in SSmachines.get_machinery_of_type(/obj/machinery/r_n_d/server)) for(var/datum/tech/T in files.known_tech) //Uploading S.files.AddTech2Known(T) for(var/datum/tech/T in S.files.known_tech) //Downloading @@ -127,7 +127,7 @@ strobe_effect = L // Make the light effect follow this party light object. - GLOB.moved_event.register(src, L, /atom/movable/proc/move_to_turf_or_null) + GLOB.moved_event.register(src, L, TYPE_PROC_REF(/atom/movable, move_to_turf_or_null)) update_icon() @@ -135,7 +135,7 @@ activated = 0 // Cause the party light effect to stop following this object, and then delete it. - GLOB.moved_event.unregister(src, strobe_effect, /atom/movable/proc/move_to_turf_or_null) + GLOB.moved_event.unregister(src, strobe_effect, TYPE_PROC_REF(/atom/movable, move_to_turf_or_null)) QDEL_NULL(strobe_effect) update_icon() diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index b318504313673..c71b17d681bf6 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -10,6 +10,8 @@ bone_material = null bone_amount = 0 + ignore_hazard_flags = HAZARD_FLAG_SHARD + var/syndicate = 0 var/const/MAIN_CHANNEL = "Main Frequency" var/lawchannel = MAIN_CHANNEL // Default channel on which to state laws diff --git a/code/modules/mob/living/simple_animal/borer/borer.dm b/code/modules/mob/living/simple_animal/borer/borer.dm index 0b46aa8eeee69..e44477f048212 100644 --- a/code/modules/mob/living/simple_animal/borer/borer.dm +++ b/code/modules/mob/living/simple_animal/borer/borer.dm @@ -254,7 +254,7 @@ last_special = world.time + amt for(var/obj/thing in hud_elements) thing.color = COLOR_BORER_RED - addtimer(new Callback(src, /mob/living/simple_animal/borer/proc/reset_ui_callback), amt) + addtimer(new Callback(src, TYPE_PROC_REF(/mob/living/simple_animal/borer, reset_ui_callback)), amt) #undef COLOR_BORER_RED /mob/living/simple_animal/borer/proc/leave_host() diff --git a/code/modules/mob/living/simple_animal/friendly/possum.dm b/code/modules/mob/living/simple_animal/friendly/possum.dm index bc51f93974990..443fd225379ea 100644 --- a/code/modules/mob/living/simple_animal/friendly/possum.dm +++ b/code/modules/mob/living/simple_animal/friendly/possum.dm @@ -101,11 +101,11 @@ /mob/living/simple_animal/passive/opossum/poppy/hear_broadcast(datum/language/language, mob/speaker, speaker_name, message) . = ..() - addtimer(new Callback(src, .proc/check_keywords, message), rand(1 SECOND, 3 SECONDS)) + addtimer(new Callback(src, PROC_REF(check_keywords), message), rand(1 SECOND, 3 SECONDS)) /mob/living/simple_animal/passive/opossum/poppy/hear_say(message, verb = "says", datum/language/language = null, alt_name = "",italics = 0, mob/speaker = null, sound/speech_sound, sound_vol) . = ..() - addtimer(new Callback(src, .proc/check_keywords, message), rand(1 SECOND, 3 SECONDS)) + addtimer(new Callback(src, PROC_REF(check_keywords), message), rand(1 SECOND, 3 SECONDS)) /mob/living/simple_animal/passive/opossum/poppy/proc/check_keywords(message) if(!client && stat == CONSCIOUS) diff --git a/code/modules/mob/living/simple_animal/hostile/antlion.dm b/code/modules/mob/living/simple_animal/hostile/antlion.dm index 01430d543aaf4..762e69ffdac83 100644 --- a/code/modules/mob/living/simple_animal/hostile/antlion.dm +++ b/code/modules/mob/living/simple_animal/hostile/antlion.dm @@ -52,7 +52,7 @@ set_invisibility(INVISIBILITY_OBSERVER) set_density(FALSE) prep_burrow(TRUE) - addtimer(new Callback(src, .proc/diggy), 5 SECONDS) + addtimer(new Callback(src, PROC_REF(diggy)), 5 SECONDS) /mob/living/simple_animal/hostile/retaliate/beast/antlion/proc/diggy() var/list/turf_targets = list() @@ -71,12 +71,12 @@ continue turf_targets += T if (!LAZYLEN(turf_targets)) - addtimer(new Callback(src, .proc/emerge, 2 SECONDS)) + addtimer(new Callback(src, PROC_REF(emerge), 2 SECONDS)) return var/turf/T = pick(turf_targets) if (T && !incapacitated()) forceMove(T) - addtimer(new Callback(src, .proc/emerge, 2 SECONDS)) + addtimer(new Callback(src, PROC_REF(emerge), 2 SECONDS)) /mob/living/simple_animal/hostile/retaliate/beast/antlion/proc/emerge() var/turf/T = get_turf(src) diff --git a/code/modules/mob/living/simple_animal/hostile/giant_spider/carrier.dm b/code/modules/mob/living/simple_animal/hostile/giant_spider/carrier.dm index 272452960c60e..f4679b6ef1364 100644 --- a/code/modules/mob/living/simple_animal/hostile/giant_spider/carrier.dm +++ b/code/modules/mob/living/simple_animal/hostile/giant_spider/carrier.dm @@ -32,7 +32,7 @@ /mob/living/simple_animal/hostile/giant_spider/carrier/death() visible_message(SPAN_WARNING("\The [src]'s abdomen splits as it rolls over, spiderlings crawling from the wound.")) - addtimer(new Callback(src, .proc/spawn_swarmlings), 1 SECOND) + addtimer(new Callback(src, PROC_REF(spawn_swarmlings)), 1 SECOND) return ..() /mob/living/simple_animal/hostile/giant_spider/carrier/proc/spawn_swarmlings() diff --git a/code/modules/mob/living/simple_animal/hostile/giant_spider/frost.dm b/code/modules/mob/living/simple_animal/hostile/giant_spider/frost.dm index f123593399b66..c87da19c2441d 100644 --- a/code/modules/mob/living/simple_animal/hostile/giant_spider/frost.dm +++ b/code/modules/mob/living/simple_animal/hostile/giant_spider/frost.dm @@ -10,7 +10,7 @@ maxHealth = 80 health = 80 - poison_per_bite = 5 + poison_per_bite = 1 poison_type = /datum/reagent/toxin/cryotoxin special_attack_min_range = 2 @@ -27,7 +27,7 @@ holder.visible_message(SPAN_DANGER("\The [holder] shakes rapidly as it releases freezing particles into the air!")) holder.shake_animation(1.5) set_busy(TRUE) - addtimer(new Callback(src, .proc/finish_special), 2 SECONDS) + addtimer(new Callback(src, PROC_REF(finish_special)), 2 SECONDS) for (var/turf/T in trange(2, get_turf(holder))) var/datum/gas_mixture/env = T.return_air() diff --git a/code/modules/mob/living/simple_animal/hostile/giant_spider/guard.dm b/code/modules/mob/living/simple_animal/hostile/giant_spider/guard.dm index f3cf4be97edac..e9a50fbf0c9d7 100644 --- a/code/modules/mob/living/simple_animal/hostile/giant_spider/guard.dm +++ b/code/modules/mob/living/simple_animal/hostile/giant_spider/guard.dm @@ -63,7 +63,7 @@ W.force = initial(W.force) + 5 move_to_delay-- break_stuff_probability = 45 - addtimer(new Callback(src, .proc/calm_down), 3 MINUTES) + addtimer(new Callback(src, PROC_REF(calm_down)), 3 MINUTES) /mob/living/simple_animal/hostile/giant_spider/guard/proc/calm_down() berserking = FALSE diff --git a/code/modules/mob/living/simple_animal/hostile/giant_spider/phorogenic.dm b/code/modules/mob/living/simple_animal/hostile/giant_spider/phorogenic.dm index 451f24c012477..466acbc0b64d0 100644 --- a/code/modules/mob/living/simple_animal/hostile/giant_spider/phorogenic.dm +++ b/code/modules/mob/living/simple_animal/hostile/giant_spider/phorogenic.dm @@ -41,7 +41,7 @@ /mob/living/simple_animal/hostile/giant_spider/phorogenic/death() visible_message(SPAN_DANGER("\The [src]'s body begins to rupture!")) var/delay = rand(explosion_delay_lower, explosion_delay_upper) - addtimer(new Callback(src, .proc/flash, delay), 0) + addtimer(new Callback(src, PROC_REF(flash), delay), 0) return ..() diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/giant_crab.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/giant_crab.dm index e52dbf71cac4f..83adae0f8612e 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/giant_crab.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/giant_crab.dm @@ -111,7 +111,7 @@ return if(!C.victim && C.can_special_attack(H)) - GLOB.destroyed_event.register(C.victim, C, /mob/living/simple_animal/hostile/retaliate/giant_crab/proc/release_grab) + GLOB.destroyed_event.register(C.victim, C, TYPE_PROC_REF(/mob/living/simple_animal/hostile/retaliate/giant_crab, release_grab)) C.victim = H H.Weaken(C.grab_duration) H.Stun(C.grab_duration) diff --git a/code/modules/mob/living/simple_animal/hostile/robotic/hivebot/hivebot.dm b/code/modules/mob/living/simple_animal/hostile/robotic/hivebot/hivebot.dm index 75077926fa4f5..65b8d53efd891 100644 --- a/code/modules/mob/living/simple_animal/hostile/robotic/hivebot/hivebot.dm +++ b/code/modules/mob/living/simple_animal/hostile/robotic/hivebot/hivebot.dm @@ -249,7 +249,7 @@ The megabot var/datum/extension/armor/toggle/armor = get_extension(src, /datum/extension/armor) if(armor) armor.toggle(FALSE) - addtimer(new Callback(src, .proc/reactivate), 4 SECONDS) + addtimer(new Callback(src, PROC_REF(reactivate)), 4 SECONDS) /mob/living/simple_animal/hostile/hivebot/mega/proc/reactivate() set_AI_busy(FALSE) diff --git a/code/modules/mob/living/simple_animal/hostile/robotic/hivebot/ranged.dm b/code/modules/mob/living/simple_animal/hostile/robotic/hivebot/ranged.dm index 92a4ee17d2afa..26d2b0a87500c 100644 --- a/code/modules/mob/living/simple_animal/hostile/robotic/hivebot/ranged.dm +++ b/code/modules/mob/living/simple_animal/hostile/robotic/hivebot/ranged.dm @@ -4,6 +4,7 @@ maxHealth = 60 health = 60 projectiletype = /obj/item/projectile/bullet/hivebot + projectilesound = 'sound/weapons/gunshot/gunshot.ogg' // The regular ranged hivebot, that fires somewhat weak projectiles. /mob/living/simple_animal/hostile/hivebot/ranged_damage/basic @@ -66,6 +67,7 @@ icon_living = "red" projectiletype = /obj/item/projectile/beam/incendiary_laser + projectilesound = 'sound/weapons/scan.ogg' heat_resist = 1 /obj/item/projectile/fire diff --git a/code/modules/mob/living/simple_animal/hostile/robotic/robots.dm b/code/modules/mob/living/simple_animal/hostile/robotic/robots.dm index 762bd8a5938ad..29c014d806a04 100644 --- a/code/modules/mob/living/simple_animal/hostile/robotic/robots.dm +++ b/code/modules/mob/living/simple_animal/hostile/robotic/robots.dm @@ -247,7 +247,7 @@ visible_message(SPAN_DANGER("\The [src]'s back begins to crack and hum!")) playsound(src,'sound/effects/cascade.ogg', 50, 1, -6) var/delay = rand(explosion_delay_lower, explosion_delay_upper) - addtimer(new Callback(src, .proc/flash, delay), 0) + addtimer(new Callback(src, PROC_REF(flash), delay), 0) return ..() @@ -287,14 +287,14 @@ target.vis_contents += src flick("shield_raise", src) //Animation on add / spawn set_dir() //the whole dir bit is for rendering, if you dont use this just remove this and the GLOB.dir_set_event stuff - GLOB.dir_set_event.register(user, src, /obj/aura/mobshield/proc/update_dir) + GLOB.dir_set_event.register(user, src, TYPE_PROC_REF(/obj/aura/mobshield, update_dir)) /obj/aura/mobshield/proc/update_dir(user, old_dir, dir) set_dir(dir) //Theres ways to make vis contents inherit dir but eh /obj/aura/mobshield/Destroy() if(user) - GLOB.dir_set_event.unregister(user, src, /obj/aura/mechshield/proc/update_dir) + GLOB.dir_set_event.unregister(user, src, TYPE_PROC_REF(/obj/aura/mechshield, update_dir)) user.vis_contents -= src . = ..() diff --git a/code/modules/mob/living/simple_animal/kamerr.dm b/code/modules/mob/living/simple_animal/kamerr.dm new file mode 100644 index 0000000000000..8c8b2f2764d00 --- /dev/null +++ b/code/modules/mob/living/simple_animal/kamerr.dm @@ -0,0 +1,24 @@ +/mob/living/simple_animal/hostile/kamerr + name = "Ka'merr" + desc = {"\ + A tall, alien raptor-like creature. It has patches of feathers around \ + its neck, and is equipped with a thick plasteel collar. Its bony \ + limbs end in dangerous-looking claws.\ + "} + icon = 'icons/mob/simple_animal/kamerr.dmi' + icon_state = "kamerr" + icon_living = "kamerr" + icon_dead = "kamerrdead" + maxHealth = 100 + health = 100 + ai_holder = /datum/ai_holder/simple_animal/melee + natural_weapon = /obj/item/natural_weapon/claws/strong + say_list_type = /datum/say_list/kamerr + bleed_colour = "#1d2cbf" + + +/datum/say_list/kamerr + emote_hear = list( + "growls!", + "screeches incoherently!" + ) diff --git a/code/modules/mob/login.dm b/code/modules/mob/login.dm index 496e6e9c2a982..345e33ff64241 100644 --- a/code/modules/mob/login.dm +++ b/code/modules/mob/login.dm @@ -61,15 +61,29 @@ /mob/Login() + + // DO NOT CALL PARENT HERE + // BYOND's internal implementation of login does two things + // 1: Set statobj to the mob being logged into (We got this covered) + // 2: And I quote "If the mob has no location, place it near (1,1,1) if possible" + // See, near is doing an agressive amount of legwork there + // What it actually does is takes the area that (1,1,1) is in, and loops through all those turfs + // If you successfully move into one, it stops + // Because we want Move() to mean standard movements rather then just what byond treats it as (ALL moves) + // We don't allow moves from nullspace -> somewhere. This means the loop has to iterate all the turfs in (1,1,1)'s area + // For us, (1,1,1) is a space tile. This means roughly 200,000! calls to Move() + // You do not want this + // Add to player list if missing if (!GLOB.player_list.Find(src)) - ADD_SORTED(GLOB.player_list, src, /proc/cmp_mob_key) + ADD_SORTED(GLOB.player_list, src, GLOBAL_PROC_REF(cmp_mob_key)) update_Login_details() world.update_status() maybe_send_staffwarns("joined the round") + client.view = get_preference_value(/datum/client_preference/client_view) client.images = null //remove the images such as AIs being unable to see runes client.screen = list() //remove hud items just in case InitializeHud() @@ -109,6 +123,22 @@ if(client.get_preference_value(/datum/client_preference/goonchat) == GLOB.PREF_YES) client.chatOutput.start() + GLOB.logged_in_event.raise_event(src) + + if(mind) + if(!mind.learned_spells) + mind.learned_spells = list() + if(ability_master && ability_master.spell_objects) + for(var/obj/screen/ability/spell/screen in ability_master.spell_objects) + var/spell/S = screen.spell + mind.learned_spells |= S + + client.deferred_skybox_update(TRUE) + + if(ability_master) + ability_master.update_abilities(1, src) + ability_master.toggle_open(1) + //set macro to normal incase it was overriden (like cyborg currently does) // [SIERRA-REMOVE] - SSINPUT // winset(src, null, "mainwindow.macro=macro hotkey_toggle.is-checked=false input.focus=true input.background-color=#d3b5b5") @@ -123,5 +153,5 @@ . = ..() if(darksight) darksight.icon_state = "ghost" - darksight.alpha = 127 + darksight.alpha = 0 darksight.SetTransform(2) //Max darksight diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index dfc0f452b63c1..36da10debb346 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -83,7 +83,7 @@ // message is the message output to anyone who can see e.g. "[src] does something!" // self_message (optional) is what the src mob sees e.g. "You do something!" // blind_message (optional) is what blind people will hear e.g. "You hear something!" -/mob/visible_message(message, self_message, blind_message, range = world.view, checkghosts = null, narrate = FALSE, list/exclude_objs = null, list/exclude_mobs = null) +/mob/visible_message(message, self_message, blind_message, range = world.view, checkghosts = null, narrate = FALSE, list/exclude_objs = null, list/exclude_mobs = null, runemessage = -1) set waitfor = FALSE var/turf/T = get_turf(src) var/list/mobs = list() @@ -122,6 +122,8 @@ if((!M.is_blind() && M.see_invisible >= src.invisibility) || narrate) M.show_message(mob_message, VISIBLE_MESSAGE, blind_message, AUDIBLE_MESSAGE) + if(runemessage != -1) + M.create_chat_message(src, "[runemessage]", FALSE, list("emote"), audible = FALSE) continue if(blind_message) @@ -137,7 +139,7 @@ // self_message (optional) is what the src mob hears. // deaf_message (optional) is what deaf people will see. // hearing_distance (optional) is the range, how many tiles away the message can be heard. -/mob/audible_message(message, self_message, deaf_message, hearing_distance = world.view, checkghosts = null, narrate = FALSE, list/exclude_objs = null, list/exclude_mobs = null) +/mob/audible_message(message, self_message, deaf_message, hearing_distance = world.view, checkghosts = null, narrate = FALSE, list/exclude_objs = null, list/exclude_mobs = null, runemessage = -1) var/turf/T = get_turf(src) var/list/mobs = list() var/list/objs = list() @@ -168,6 +170,9 @@ else M.show_message(mob_message, AUDIBLE_MESSAGE) + if(runemessage != -1) + M.create_chat_message(src, "[runemessage]", FALSE, list("emote"), audible = TRUE) + for(var/o in objs) var/obj/O = o if (length(exclude_objs) && (O in exclude_objs)) @@ -650,6 +655,13 @@ return P +/mob/proc/get_formal_pronouns() + var/datum/pronouns/P = GLOB.pronouns_from_gender[gender] + if (pronouns) + P = GLOB.pronouns.by_key[pronouns] + return P.formal_term + + /mob/proc/see(message) if(!is_active()) return 0 @@ -675,6 +687,7 @@ if(client.holder) if(statpanel("MC")) stat("CPU:","[world.cpu]") + stat("Map CPU:","[world.map_cpu]") stat("Instances:","[length(world.contents)]") stat(null) var/time = Uptime() diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index c8b5ce39363b3..dc87180f4d629 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -370,7 +370,7 @@ var/global/list/intents = list(I_HELP,I_DISARM,I_GRAB,I_HURT) if(hud_used && hud_used.action_intent) hud_used.action_intent.icon_state = "intent_[a_intent]" - else if(isrobot(src)) + else if(isrobot(src) || ispAI(src)) switch(input) if(I_HELP) a_intent = I_HELP diff --git a/code/modules/mob/new_player/login.dm b/code/modules/mob/new_player/login.dm index ff1cd86c3fb22..dfe76dd8b3a34 100644 --- a/code/modules/mob/new_player/login.dm +++ b/code/modules/mob/new_player/login.dm @@ -23,7 +23,7 @@ // Add to player list if missing if (!GLOB.player_list.Find(src)) - ADD_SORTED(GLOB.player_list, src, /proc/cmp_mob_key) + ADD_SORTED(GLOB.player_list, src, GLOBAL_PROC_REF(cmp_mob_key)) new_player_panel() diff --git a/code/modules/mob/new_player/logout.dm b/code/modules/mob/new_player/logout.dm index b82e2d58de051..b04c9a6d54c21 100644 --- a/code/modules/mob/new_player/logout.dm +++ b/code/modules/mob/new_player/logout.dm @@ -3,10 +3,6 @@ // see login.dm if(my_client) - // [SIERRA-ADD] - STATUSBAR - if (get_preference_value(/datum/client_preference/show_statusbar) == GLOB.PREF_SHOW) - winset(my_client, "mapwindow.statusbar", "is-visible=true") - // [/SIERRA-ADD] GLOB.using_map.hide_titlescreen(my_client) my_client = null diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 4de8ab1c6ce39..13d64e4fe1d8c 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -99,14 +99,18 @@ highjob = " as [player.client.prefs.job_high]" if (!player.is_stealthed()) var/can_see_hidden = check_rights(R_INVESTIGATE, 0) - var/datum/game_mode/mode = SSticker.pick_mode(SSticker.master_mode) - var/list/readied_antag_roles = list() - if (mode && can_see_hidden) - for (var/role in player.client.prefs.be_special_role) - if (role in mode.antag_tags) - readied_antag_roles += role - - var/antag_role_text = "[length(readied_antag_roles) ? "Readied for ([english_list(readied_antag_roles)])" : ""]" + var/datum/game_mode/mode = SSticker.mode + var/antag_role_text = "" + if(mode) + var/list/readied_antag_roles = list() + if (can_see_hidden) + for (var/role in player.client.prefs.be_special_role) + if (role in mode.antag_tags) + readied_antag_roles += role + + if(length(readied_antag_roles)) + antag_role_text = "Readied for ([english_list(readied_antag_roles)])" + stat("[player.key]", (player.ready && (show_ready || can_see_hidden)?("(Playing[highjob]) [(can_see_hidden && !show_ready) ? "(Hidden)" : ""] [antag_role_text]"):(null))) totalPlayers++ if(player.ready)totalPlayersReady++ diff --git a/code/modules/mob/observer/following.dm b/code/modules/mob/observer/following.dm index 6d1637977a8c6..d1a300cd0746f 100644 --- a/code/modules/mob/observer/following.dm +++ b/code/modules/mob/observer/following.dm @@ -16,9 +16,9 @@ /mob/observer/proc/start_following(atom/a) stop_following() following = a - GLOB.destroyed_event.register(a, src, .proc/stop_following) - GLOB.moved_event.register(a, src, .proc/keep_following) - GLOB.dir_set_event.register(a, src, /atom/proc/recursive_dir_set) + GLOB.destroyed_event.register(a, src, PROC_REF(stop_following)) + GLOB.moved_event.register(a, src, PROC_REF(keep_following)) + GLOB.dir_set_event.register(a, src, TYPE_PROC_REF(/atom, recursive_dir_set)) keep_following(new_loc = get_turf(following)) /mob/observer/proc/keep_following(atom/movable/moving_instance, atom/old_loc, atom/new_loc) diff --git a/code/modules/mob/observer/freelook/ai/cameranet.dm b/code/modules/mob/observer/freelook/ai/cameranet.dm index bde34a77b7a8e..9887f7941c510 100644 --- a/code/modules/mob/observer/freelook/ai/cameranet.dm +++ b/code/modules/mob/observer/freelook/ai/cameranet.dm @@ -22,7 +22,7 @@ return FALSE . = ..(c, c.can_use()) if(.) - ADD_SORTED(cameras, c, /proc/cmp_camera_ctag_asc) + ADD_SORTED(cameras, c, GLOBAL_PROC_REF(cmp_camera_ctag_asc)) else if(isAI(c)) var/mob/living/silicon/AI = c return ..(AI, AI.stat != DEAD) diff --git a/code/modules/mob/observer/freelook/visualnet.dm b/code/modules/mob/observer/freelook/visualnet.dm index 7016c7fb88c47..f5e7df9b94f15 100644 --- a/code/modules/mob/observer/freelook/visualnet.dm +++ b/code/modules/mob/observer/freelook/visualnet.dm @@ -109,7 +109,7 @@ // Never access this proc directly!!!! // This will update the chunk and all the surrounding chunks. /datum/visualnet/proc/major_chunk_change(atom/source) - for_all_chunks_in_range(source, /datum/chunk/proc/visibility_changed, list()) + for_all_chunks_in_range(source, TYPE_PROC_REF(/datum/chunk, visibility_changed), list()) /datum/visualnet/proc/add_source(atom/source, update_visibility = TRUE, opacity_check = FALSE) if(!(source && is_type_in_list(source, valid_source_types))) @@ -118,9 +118,9 @@ if(source in sources) return FALSE sources += source - GLOB.moved_event.register(source, src, /datum/visualnet/proc/source_moved) - GLOB.destroyed_event.register(source, src, /datum/visualnet/proc/remove_source) - for_all_chunks_in_range(source, /datum/chunk/proc/add_source, list(source)) + GLOB.moved_event.register(source, src, TYPE_PROC_REF(/datum/visualnet, source_moved)) + GLOB.destroyed_event.register(source, src, TYPE_PROC_REF(/datum/visualnet, remove_source)) + for_all_chunks_in_range(source, TYPE_PROC_REF(/datum/chunk, add_source), list(source)) if(update_visibility) update_visibility(source, opacity_check) return TRUE @@ -129,9 +129,9 @@ if(!sources.Remove(source)) return FALSE - GLOB.moved_event.unregister(source, src, /datum/visualnet/proc/source_moved) - GLOB.destroyed_event.unregister(source, src, /datum/visualnet/proc/remove_source) - for_all_chunks_in_range(source, /datum/chunk/proc/remove_source, list(source)) + GLOB.moved_event.unregister(source, src, TYPE_PROC_REF(/datum/visualnet, source_moved)) + GLOB.destroyed_event.unregister(source, src, TYPE_PROC_REF(/datum/visualnet, remove_source)) + for_all_chunks_in_range(source, TYPE_PROC_REF(/datum/chunk, remove_source), list(source)) if(update_visibility) update_visibility(source, opacity_check) return TRUE @@ -146,9 +146,9 @@ // A more proper way would be to figure out which chunks have gone out of range, and which have come into range // and only remove/add to those. if(old_turf) - for_all_chunks_in_range(source, /datum/chunk/proc/remove_source, list(source), old_turf) + for_all_chunks_in_range(source, TYPE_PROC_REF(/datum/chunk, remove_source), list(source), old_turf) if(new_turf) - for_all_chunks_in_range(source, /datum/chunk/proc/add_source, list(source), new_turf) + for_all_chunks_in_range(source, TYPE_PROC_REF(/datum/chunk, add_source), list(source), new_turf) /datum/visualnet/proc/for_all_chunks_in_range(atom/source, proc_call, list/proc_args, turf/T) T = T ? T : get_turf(source) diff --git a/code/modules/mob/observer/ghost/ghost.dm b/code/modules/mob/observer/ghost/ghost.dm index bbe2926c49856..89e89882922a6 100644 --- a/code/modules/mob/observer/ghost/ghost.dm +++ b/code/modules/mob/observer/ghost/ghost.dm @@ -141,6 +141,8 @@ Works together with spawning an observer, noted above. return 1 /mob/proc/ghostize(can_reenter_corpse = CORPSE_CAN_REENTER) + //remove color filters + clear_client_colors() // Are we the body of an aghosted admin? If so, don't make a ghost. if(teleop && istype(teleop, /mob/observer/ghost)) var/mob/observer/ghost/G = teleop @@ -154,10 +156,10 @@ Works together with spawning an observer, noted above. ghost.key = key if(ghost.client && !ghost.client.holder && !config.antag_hud_allowed) // For new ghosts we remove the verb from even showing up if it's not allowed. ghost.verbs -= /mob/observer/ghost/verb/toggle_antagHUD // Poor guys, don't know what they are missing! + ghost.update_client_color() return ghost /mob/observer/ghostize() // Do not create ghosts of ghosts. - /* This is the proc mobs get to turn into a ghost. Forked from ghostize due to compatibility issues. */ @@ -165,11 +167,10 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp set category = "OOC" set name = "Ghost" set desc = "Relinquish your life and enter the land of the dead." - if (admin_paralyzed) to_chat(usr, SPAN_DEBUG("You cannot ghost while admin paralyzed.")) return - + clear_client_colors() if(stat == DEAD) announce_ghost_joinleave(ghostize(1)) else @@ -192,9 +193,16 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if (ghost) ghost.timeofdeath = world.time // Because the living mob won't have a time of death and we want the respawn timer to work properly. announce_ghost_joinleave(ghost) + ghost.update_client_color() + + +/mob/observer/ghost/can_use_hands() + return FALSE + + +/mob/observer/ghost/is_active() + return FALSE -/mob/observer/ghost/can_use_hands() return 0 -/mob/observer/ghost/is_active() return 0 /mob/observer/ghost/Stat() . = ..() @@ -274,7 +282,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp to_chat(src, "No area available.") return - var/list/area_turfs = get_area_turfs(thearea, shall_check_if_holy() ? list(/proc/is_not_holy_turf) : list()) + var/list/area_turfs = get_area_turfs(thearea, shall_check_if_holy() ? list(GLOBAL_PROC_REF(is_not_holy_turf)) : list()) if(!length(area_turfs)) to_chat(src, SPAN_WARNING("This area has been entirely made into sacred grounds, you cannot enter it while you are in this plane of existence!")) return @@ -383,7 +391,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp var/mob/living/simple_animal/passive/mouse/host var/obj/machinery/atmospherics/unary/vent_pump/vent_found var/list/found_vents = list() - for(var/obj/machinery/atmospherics/unary/vent_pump/v in SSmachines.machinery) + for(var/obj/machinery/atmospherics/unary/vent_pump/v as anything in SSmachines.get_machinery_of_type(/obj/machinery/atmospherics/unary/vent_pump)) if(!v.welded && v.z == T.z) found_vents.Add(v) if(length(found_vents)) diff --git a/code/modules/mob/observer/ghost/login.dm b/code/modules/mob/observer/ghost/login.dm index 5ac8d450d7a0d..a0bcb62029a9e 100644 --- a/code/modules/mob/observer/ghost/login.dm +++ b/code/modules/mob/observer/ghost/login.dm @@ -1,6 +1,11 @@ /mob/observer/ghost/Login() ..() + // [SIERRA-ADD] - STATUSBAR + if (my_client && get_preference_value(/datum/client_preference/show_statusbar) == GLOB.PREF_SHOW) + winset(my_client, "mapwindow.statusbar", "is-visible=true") + // [/SIERRA-ADD] + if (ghost_image) ghost_image.appearance = src ghost_image.appearance_flags = DEFAULT_APPEARANCE_FLAGS | RESET_ALPHA diff --git a/code/modules/mob/observer/virtual/base.dm b/code/modules/mob/observer/virtual/base.dm index 0bdf7f178b5e1..9a1b87a7993d4 100644 --- a/code/modules/mob/observer/virtual/base.dm +++ b/code/modules/mob/observer/virtual/base.dm @@ -23,7 +23,7 @@ var/global/list/all_virtual_listeners = list() if(!istype(host, host_type)) CRASH("Received an unexpected host type. Expected [host_type], was [log_info_line(host)].") src.host = host - GLOB.moved_event.register(host, src, /atom/movable/proc/move_to_turf_or_null) + GLOB.moved_event.register(host, src, TYPE_PROC_REF(/atom/movable, move_to_turf_or_null)) all_virtual_listeners += src @@ -32,7 +32,7 @@ var/global/list/all_virtual_listeners = list() STOP_PROCESSING_MOB(src) /mob/observer/virtual/Destroy() - GLOB.moved_event.unregister(host, src, /atom/movable/proc/move_to_turf_or_null) + GLOB.moved_event.unregister(host, src, TYPE_PROC_REF(/atom/movable, move_to_turf_or_null)) all_virtual_listeners -= src host = null return ..() diff --git a/code/modules/mob/observer/virtual/mob.dm b/code/modules/mob/observer/virtual/mob.dm index 4484209496eb1..89bca627b2ecc 100644 --- a/code/modules/mob/observer/virtual/mob.dm +++ b/code/modules/mob/observer/virtual/mob.dm @@ -5,17 +5,17 @@ /mob/observer/virtual/mob/Initialize(mapload, mob/host) . = ..() - GLOB.sight_set_event.register(host, src, /mob/observer/virtual/mob/proc/sync_sight) - GLOB.see_invisible_set_event.register(host, src, /mob/observer/virtual/mob/proc/sync_sight) - GLOB.see_in_dark_set_event.register(host, src, /mob/observer/virtual/mob/proc/sync_sight) + GLOB.sight_set_event.register(host, src, TYPE_PROC_REF(/mob/observer/virtual/mob, sync_sight)) + GLOB.see_invisible_set_event.register(host, src, TYPE_PROC_REF(/mob/observer/virtual/mob, sync_sight)) + GLOB.see_in_dark_set_event.register(host, src, TYPE_PROC_REF(/mob/observer/virtual/mob, sync_sight)) sync_sight(host) /mob/observer/virtual/mob/Destroy() - GLOB.sight_set_event.unregister(host, src, /mob/observer/virtual/mob/proc/sync_sight) - GLOB.see_invisible_set_event.unregister(host, src, /mob/observer/virtual/mob/proc/sync_sight) - GLOB.see_in_dark_set_event.unregister(host, src, /mob/observer/virtual/mob/proc/sync_sight) + GLOB.sight_set_event.unregister(host, src, TYPE_PROC_REF(/mob/observer/virtual/mob, sync_sight)) + GLOB.see_invisible_set_event.unregister(host, src, TYPE_PROC_REF(/mob/observer/virtual/mob, sync_sight)) + GLOB.see_in_dark_set_event.unregister(host, src, TYPE_PROC_REF(/mob/observer/virtual/mob, sync_sight)) . = ..() /mob/observer/virtual/mob/proc/sync_sight(mob/mob_host) diff --git a/code/modules/mob/skills/skill_buffs.dm b/code/modules/mob/skills/skill_buffs.dm index 8cb586e791bb1..d6fa8580c4651 100644 --- a/code/modules/mob/skills/skill_buffs.dm +++ b/code/modules/mob/skills/skill_buffs.dm @@ -71,7 +71,7 @@ buff.skillset = skillset skillset.on_levels_change() if(duration) - addtimer(new Callback(buff, /datum/skill_buff/proc/remove), duration) + addtimer(new Callback(buff, TYPE_PROC_REF(/datum/skill_buff, remove)), duration) return buff //Takes a buff type or datum; typing is false here. diff --git a/code/modules/mob/skills/skill_verbs.dm b/code/modules/mob/skills/skill_verbs.dm index ed7faeaab9c49..05e63bd29a785 100644 --- a/code/modules/mob/skills/skill_verbs.dm +++ b/code/modules/mob/skills/skill_verbs.dm @@ -51,7 +51,7 @@ GLOBAL_LIST_INIT(skill_verbs, init_subtypes(/datum/skill_verb)) return cooling_down = 1 update_verb() - addtimer(new Callback(src, .proc/remove_cooldown), cooldown) + addtimer(new Callback(src, PROC_REF(remove_cooldown)), cooldown) /* The Instruct verb. buffs untrained -> basic and requires skill in the skill training as well as leadership. Robots and antags can instruct. @@ -90,7 +90,7 @@ Robots and antags can instruct. return if(target.too_many_buffs(/datum/skill_buff/instruct)) - to_chat(src, SPAN_NOTICE("\The [target] exhausted from all the training \he recieved.")) + to_chat(src, SPAN_NOTICE("\The [target] has had too many lessons and can't receive any more training today.")) return var/options = list() @@ -110,7 +110,7 @@ Robots and antags can instruct. to_chat(src, SPAN_NOTICE("[incapacitated() ? "You are in no state to teach right now!" : "\the [target] is in no state to be taught right now!"]")) return if(target.too_many_buffs(/datum/skill_buff/instruct)) - to_chat(src, SPAN_NOTICE("\The [target] exhausted from all the training \he recieved.")) + to_chat(src, SPAN_NOTICE("\The [target] has had too many lessons and can't receive any more training today.")) return if(target.skill_check(skill.type, SKILL_BASIC)) to_chat(src, SPAN_NOTICE("\The [target] is too skilled to gain any benefit from a short lesson.")) @@ -209,13 +209,12 @@ The Appraise verb. Used on objects to estimate their value. set category = "IC" set name = "Detective instinct" set src = usr - set popup_menu = 0 - - if(incapacitated()) + set popup_menu = FALSE + if (incapacitated()) return - - if(!remove_client_color(/datum/client_color/noir)) - to_chat(src, "You clear your mind and focus on the scene before you.") - add_client_color(/datum/client_color/noir) - else + if (has_client_color(/datum/client_color/noir)) + remove_client_color(/datum/client_color/noir) to_chat(src, "You stop looking for clues.") + else + add_client_color(/datum/client_color/noir) + to_chat(src, "You clear your mind and focus on the scene before you.") diff --git a/code/modules/mob/vv_handlers.dm b/code/modules/mob/vv_handlers.dm index f0d587cfb936a..211b17c8f2475 100644 --- a/code/modules/mob/vv_handlers.dm +++ b/code/modules/mob/vv_handlers.dm @@ -1,6 +1,6 @@ /singleton/vv_set_handler/mob_confused handled_type = /mob - predicates = list(/proc/is_num_predicate, /proc/is_non_negative_predicate, /proc/is_int_predicate) + predicates = list(GLOBAL_PROC_REF(is_num_predicate), GLOBAL_PROC_REF(is_non_negative_predicate), GLOBAL_PROC_REF(is_int_predicate)) handled_vars = list("confused") diff --git a/code/modules/modular_computers/NTNet/NTNet.dm b/code/modules/modular_computers/NTNet/NTNet.dm index bb2c154bd73f0..3ea698d855146 100644 --- a/code/modules/modular_computers/NTNet/NTNet.dm +++ b/code/modules/modular_computers/NTNet/NTNet.dm @@ -42,7 +42,7 @@ var/global/datum/ntnet/ntnet_global = new() /datum/ntnet/New() if(ntnet_global && (ntnet_global != src)) ntnet_global = src // There can be only one. - for(var/obj/machinery/ntnet_relay/R in SSmachines.machinery) + for(var/obj/machinery/ntnet_relay/R as anything in SSmachines.get_machinery_of_type(/obj/machinery/ntnet_relay)) relays += R build_software_lists() build_emails_list() @@ -143,10 +143,10 @@ var/global/datum/ntnet/ntnet_global = new() if(!category_list) category_list = list() available_software_by_category[prog.category] = category_list - ADD_SORTED(available_station_software, prog, /proc/cmp_program) - ADD_SORTED(category_list, prog, /proc/cmp_program) + ADD_SORTED(available_station_software, prog, GLOBAL_PROC_REF(cmp_program)) + ADD_SORTED(category_list, prog, GLOBAL_PROC_REF(cmp_program)) if(prog.available_on_syndinet) - ADD_SORTED(available_antag_software, prog, /proc/cmp_program) + ADD_SORTED(available_antag_software, prog, GLOBAL_PROC_REF(cmp_program)) /// Generates service email list. /datum/ntnet/proc/build_emails_list() diff --git a/code/modules/modular_computers/NTNet/emails/email_account.dm b/code/modules/modular_computers/NTNet/emails/email_account.dm index 3bbd8feb8dd8e..b13a0333f94c3 100644 --- a/code/modules/modular_computers/NTNet/emails/email_account.dm +++ b/code/modules/modular_computers/NTNet/emails/email_account.dm @@ -32,7 +32,7 @@ fullname = _fullname if(_assignment) assignment = _assignment - ADD_SORTED(ntnet_global.email_accounts, src, /proc/cmp_emails_asc) + ADD_SORTED(ntnet_global.email_accounts, src, GLOBAL_PROC_REF(cmp_emails_asc)) ..() /datum/computer_file/data/email_account/Destroy() diff --git a/code/modules/modular_computers/computers/modular_computer/interaction.dm b/code/modules/modular_computers/computers/modular_computer/interaction.dm index 3002f4171e5a6..4c0e76c531ebd 100644 --- a/code/modules/modular_computers/computers/modular_computer/interaction.dm +++ b/code/modules/modular_computers/computers/modular_computer/interaction.dm @@ -114,39 +114,43 @@ else if(!enabled && screen_on) turn_on(user) -/obj/item/modular_computer/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/modular_computer/use_tool(obj/item/W, mob/living/user, list/click_params) if(istype(W, /obj/item/card/id)) // ID Card, try to insert it. var/obj/item/card/id/I = W if(!card_slot) - to_chat(user, "You try to insert [I] into [src], but it does not have an ID card slot installed.") - return + to_chat(user, SPAN_WARNING("You try to insert \the [I] into \the [src], but it does not have an ID card slot installed.")) + return TRUE if(card_slot.insert_id(I, user)) update_verbs() - return + return TRUE if(istype(W, /obj/item/pen) && stores_pen) if(istype(stored_pen)) - to_chat(user, SPAN_NOTICE("There is already a pen in [src].")) - return + to_chat(user, SPAN_WARNING("There is already a pen in \the [src].")) + return TRUE if(!user.unEquip(W, src)) - return + FEEDBACK_UNEQUIP_FAILURE(user, W) + return TRUE stored_pen = W update_verbs() - to_chat(user, SPAN_NOTICE("You insert [W] into [src].")) - return + to_chat(user, SPAN_NOTICE("You insert \the [W] into \the [src].")) + return TRUE + if(istype(W, /obj/item/paper)) var/obj/item/paper/paper = W if(scanner && paper.info) scanner.do_on_attackby(user, W) - return + return TRUE + if(istype(W, /obj/item/paper) || istype(W, /obj/item/paper_bundle)) if(nano_printer) - nano_printer.attackby(W, user) + nano_printer.use_tool(W, user) if(istype(W, /obj/item/aicard)) if(!ai_slot) - return - ai_slot.attackby(W, user) + return ..() + ai_slot.use_tool(W, user) + return TRUE if(!modifiable) return ..() @@ -156,37 +160,40 @@ if(C.hardware_size <= max_hardware_size) try_install_component(user, C) else - to_chat(user, "This component is too large for \the [src].") + to_chat(user, SPAN_WARNING("This component is too large for \the [src].")) + return TRUE + if(isWrench(W)) var/list/components = get_all_components() if(length(components)) - to_chat(user, "Remove all components from \the [src] before disassembling it.") - return - new /obj/item/stack/material/steel( get_turf(src.loc), steel_sheet_cost ) - src.visible_message("\The [src] has been disassembled by [user].") + to_chat(user, SPAN_WARNING("Remove all components from \the [src] before disassembling it.")) + return TRUE + new /obj/item/stack/material/steel( get_turf(loc), steel_sheet_cost ) + visible_message("\The [src] has been disassembled by \the [user].") qdel(src) - return + return TRUE + if(isWelder(W)) var/obj/item/weldingtool/WT = W var/damage = get_damage_value() if(!WT.can_use(round(damage/75), user)) - return + return TRUE if(!get_damage_value()) - to_chat(user, "\The [src] does not require repairs.") - return + to_chat(user, SPAN_WARNING("\The [src] does not require repairs.")) + return TRUE to_chat(user, "You begin repairing damage to \the [src]...") if(do_after(user, damage / 10, src, DO_REPAIR_CONSTRUCT) && WT.remove_fuel(round(damage / 75))) revive_health() to_chat(user, "You repair \the [src].") - return + return TRUE if(isScrewdriver(W)) var/list/all_components = get_all_components() if(!length(all_components)) - to_chat(user, "This device doesn't have any components installed.") - return + to_chat(user, SPAN_WARNING("This device doesn't have any components installed.")) + return TRUE var/list/component_names = list() for(var/obj/item/stock_parts/computer/H in all_components) component_names.Add(H.name) @@ -194,21 +201,19 @@ var/choice = input(usr, "Which component do you want to uninstall?", "Computer maintenance", null) as null|anything in component_names if(!choice) - return + return TRUE if(!Adjacent(usr)) - return + return TRUE var/obj/item/stock_parts/computer/H = find_hardware_by_name(choice) if(!H) - return + return TRUE uninstall_component(user, H) - - return - - ..() + return TRUE + return ..() /obj/item/modular_computer/examine(mob/user) . = ..() diff --git a/code/modules/modular_computers/computers/subtypes/dev_telescreen.dm b/code/modules/modular_computers/computers/subtypes/dev_telescreen.dm index 9ae39f067a198..ad67b30e74c1d 100644 --- a/code/modules/modular_computers/computers/subtypes/dev_telescreen.dm +++ b/code/modules/modular_computers/computers/subtypes/dev_telescreen.dm @@ -21,7 +21,7 @@ // Allows us to create "north bump" "south bump" etc. named objects, for more comfortable mapping. name = "telescreen" -/obj/item/modular_computer/telescreen/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/modular_computer/telescreen/use_tool(obj/item/W, mob/living/user, list/click_params) if(isCrowbar(W)) if(anchored) shutdown_computer() @@ -30,6 +30,7 @@ pixel_x = 0 pixel_y = 0 to_chat(user, "You unsecure \the [src].") + return TRUE else var/choice = input(user, "Where do you want to place \the [src]?", "Offset selection") in list("North", "South", "West", "East", "This tile", "Cancel") var/valid = FALSE @@ -53,5 +54,5 @@ anchored = TRUE screen_on = TRUE to_chat(user, "You secure \the [src].") - return - ..() + return TRUE + return ..() diff --git a/code/modules/modular_computers/file_system/programs/command/comm.dm b/code/modules/modular_computers/file_system/programs/command/comm.dm index a258b85dc80ea..b0e3be4ba2f57 100644 --- a/code/modules/modular_computers/file_system/programs/command/comm.dm +++ b/code/modules/modular_computers/file_system/programs/command/comm.dm @@ -141,11 +141,11 @@ if(announcment_cooldown) to_chat(usr, "Please allow at least one minute to pass between announcements") return - var/input = input(usr, "Please write a message to announce to the [station_name()].", "Priority Announcement") as null|message + var/input = sanitize(input(usr, "Please write a message to announce to the [station_name()].", "Priority Announcement") as null|message, extra = FALSE) if(!input || !can_still_topic()) return var/affected_zlevels = GetConnectedZlevels(get_host_z()) - crew_announcement.Announce(input, zlevels = affected_zlevels) + crew_announcement.Announce(input, msg_sanitized = TRUE, zlevels = affected_zlevels) announcment_cooldown = 1 spawn(600)//One minute cooldown announcment_cooldown = 0 @@ -330,7 +330,7 @@ var/global/last_message_id = 0 /proc/is_relay_online() - for(var/obj/machinery/bluespacerelay/M in SSmachines.machinery) + for(var/obj/machinery/bluespacerelay/M as anything in SSmachines.get_machinery_of_type(/obj/machinery/bluespacerelay)) if(M.stat == EMPTY_BITFIELD) return 1 return 0 diff --git a/code/modules/modular_computers/file_system/programs/engineering/atmos_control.dm b/code/modules/modular_computers/file_system/programs/engineering/atmos_control.dm index 855e0d0bb615a..5188945b8b6ce 100644 --- a/code/modules/modular_computers/file_system/programs/engineering/atmos_control.dm +++ b/code/modules/modular_computers/file_system/programs/engineering/atmos_control.dm @@ -30,7 +30,7 @@ log_debug("\The [src] was given an unexpected req_access: [req_access]") if(monitored_alarm_ids) - for(var/obj/machinery/alarm/alarm in SSmachines.machinery) + for(var/obj/machinery/alarm/alarm as anything in SSmachines.get_machinery_of_type(/obj/machinery/alarm)) if(alarm.alarm_id && (alarm.alarm_id in monitored_alarm_ids)) monitored_alarms += alarm // machines may not yet be ordered at this point diff --git a/code/modules/modular_computers/file_system/programs/engineering/power_monitor.dm b/code/modules/modular_computers/file_system/programs/engineering/power_monitor.dm index 50dc8c5709e87..49edaeed30c0e 100644 --- a/code/modules/modular_computers/file_system/programs/engineering/power_monitor.dm +++ b/code/modules/modular_computers/file_system/programs/engineering/power_monitor.dm @@ -87,13 +87,13 @@ /datum/nano_module/power_monitor/proc/refresh_sensors() grid_sensors = list() var/connected_z_levels = GetConnectedZlevels(get_host_z()) - for(var/obj/machinery/power/sensor/S in SSmachines.machinery) + for(var/obj/machinery/power/sensor/S as anything in SSmachines.get_machinery_of_type(/obj/machinery/power/sensor)) if((S.long_range) || (S.loc.z in connected_z_levels)) // Consoles have range on their Z-Level. Sensors with long_range var will work between Z levels. if(S.name_tag == "#UNKN#") // Default name. Shouldn't happen! warning("Powernet sensor with unset ID Tag! [S.x]X [S.y]Y [S.z]Z") else grid_sensors += S - GLOB.destroyed_event.register(S, src, /datum/nano_module/power_monitor/proc/remove_sensor) + GLOB.destroyed_event.register(S, src, TYPE_PROC_REF(/datum/nano_module/power_monitor, remove_sensor)) /datum/nano_module/power_monitor/proc/remove_sensor(removed_sensor, update_ui = TRUE) if(active_sensor == removed_sensor) @@ -101,7 +101,7 @@ if(update_ui) SSnano.update_uis(src) grid_sensors -= removed_sensor - GLOB.destroyed_event.unregister(removed_sensor, src, /datum/nano_module/power_monitor/proc/remove_sensor) + GLOB.destroyed_event.unregister(removed_sensor, src, TYPE_PROC_REF(/datum/nano_module/power_monitor, remove_sensor)) // Allows us to process UI clicks, which are relayed in form of hrefs. /datum/nano_module/power_monitor/Topic(href, href_list) diff --git a/code/modules/modular_computers/file_system/programs/engineering/rcon_console.dm b/code/modules/modular_computers/file_system/programs/engineering/rcon_console.dm index e8b6e56ea519c..f149fafc04763 100644 --- a/code/modules/modular_computers/file_system/programs/engineering/rcon_console.dm +++ b/code/modules/modular_computers/file_system/programs/engineering/rcon_console.dm @@ -124,11 +124,11 @@ // Description: Refreshes local list of known devices. /datum/nano_module/rcon/proc/FindDevices() known_SMESs = list() - for(var/obj/machinery/power/smes/buildable/SMES in SSmachines.machinery) + for(var/obj/machinery/power/smes/buildable/SMES as anything in SSmachines.get_machinery_of_type(/obj/machinery/power/smes/buildable)) if(AreConnectedZLevels(get_host_z(), get_z(SMES)) && SMES.RCon_tag && (SMES.RCon_tag != "NO_TAG") && SMES.RCon) known_SMESs.Add(SMES) known_breakers = list() - for(var/obj/machinery/power/breakerbox/breaker in SSmachines.machinery) + for(var/obj/machinery/power/breakerbox/breaker as anything in SSmachines.get_machinery_of_type(/obj/machinery/power/breakerbox)) if(AreConnectedZLevels(get_host_z(), get_z(breaker)) && breaker.RCon_tag != "NO_TAG") known_breakers.Add(breaker) diff --git a/code/modules/modular_computers/file_system/programs/engineering/shields_monitor.dm b/code/modules/modular_computers/file_system/programs/engineering/shields_monitor.dm index 383283cd7695e..cd52777f43619 100644 --- a/code/modules/modular_computers/file_system/programs/engineering/shields_monitor.dm +++ b/code/modules/modular_computers/file_system/programs/engineering/shields_monitor.dm @@ -23,7 +23,7 @@ /datum/nano_module/shields_monitor/proc/get_shields() var/list/shields = list() var/connected_z_levels = GetConnectedZlevels(get_host_z()) - for(var/obj/machinery/power/shield_generator/S in SSmachines.machinery) + for(var/obj/machinery/power/shield_generator/S as anything in SSmachines.get_machinery_of_type(/obj/machinery/power/shield_generator)) if(!(S.z in connected_z_levels)) continue shields.Add(S) @@ -98,7 +98,7 @@ var/obj/machinery/power/shield_generator/S = locate(href_list["ref"]) in shields if(S) deselect_shield() - GLOB.destroyed_event.register(S, src, /datum/nano_module/shields_monitor/proc/deselect_shield) + GLOB.destroyed_event.register(S, src, TYPE_PROC_REF(/datum/nano_module/shields_monitor, deselect_shield)) active = S return 1 diff --git a/code/modules/modular_computers/file_system/programs/engineering/supermatter_monitor.dm b/code/modules/modular_computers/file_system/programs/engineering/supermatter_monitor.dm index 7969608746dd7..cb7fa435f6414 100644 --- a/code/modules/modular_computers/file_system/programs/engineering/supermatter_monitor.dm +++ b/code/modules/modular_computers/file_system/programs/engineering/supermatter_monitor.dm @@ -47,7 +47,7 @@ /datum/nano_module/supermatter_monitor/proc/refresh() supermatters = list() var/valid_z_levels = GetConnectedZlevels(get_host_z()) - for(var/obj/machinery/power/supermatter/S in SSmachines.machinery) + for(var/obj/machinery/power/supermatter/S as anything in SSmachines.get_machinery_of_type(/obj/machinery/power/supermatter)) // Delaminating, not within coverage, not on a tile. if(S.grav_pulling || S.exploded || !(S.z in valid_z_levels) || !isturf(S.loc)) continue diff --git a/code/modules/modular_computers/file_system/programs/generic/camera.dm b/code/modules/modular_computers/file_system/programs/generic/camera.dm index 91b683300e081..e75feb8252f65 100644 --- a/code/modules/modular_computers/file_system/programs/generic/camera.dm +++ b/code/modules/modular_computers/file_system/programs/generic/camera.dm @@ -154,8 +154,8 @@ current_camera = C if(current_camera) - GLOB.destroyed_event.register(current_camera, src, .proc/reset_current) - GLOB.moved_event.register(current_camera, src, .proc/camera_moved) + GLOB.destroyed_event.register(current_camera, src, PROC_REF(reset_current)) + GLOB.moved_event.register(current_camera, src, PROC_REF(camera_moved)) var/mob/living/L = current_camera.loc if(istype(L)) L.tracking_initiated() @@ -167,8 +167,8 @@ /datum/nano_module/camera_monitor/proc/reset_current() if(current_camera) - GLOB.destroyed_event.unregister(current_camera, src, .proc/reset_current) - GLOB.moved_event.unregister(current_camera, src, .proc/camera_moved) + GLOB.destroyed_event.unregister(current_camera, src, PROC_REF(reset_current)) + GLOB.moved_event.unregister(current_camera, src, PROC_REF(camera_moved)) var/mob/living/L = current_camera.loc if(istype(L)) L.tracking_cancelled() diff --git a/code/modules/modular_computers/file_system/programs/generic/docks.dm b/code/modules/modular_computers/file_system/programs/generic/docks.dm index 2e30293e9752a..c5ff538cf8756 100644 --- a/code/modules/modular_computers/file_system/programs/generic/docks.dm +++ b/code/modules/modular_computers/file_system/programs/generic/docks.dm @@ -30,7 +30,7 @@ /datum/nano_module/docking/proc/refresh_docks() docking_controllers.Cut() var/list/zlevels = GetConnectedZlevels(get_host_z()) - for(var/obj/machinery/embedded_controller/radio/airlock/docking_port/D in SSmachines.machinery) + for(var/obj/machinery/embedded_controller/radio/airlock/docking_port/D as anything in SSmachines.get_machinery_of_type(/obj/machinery/embedded_controller/radio/airlock/docking_port)) if(D.z in zlevels) var/shuttleside = 0 for(var/sname in SSshuttle.shuttles) //do not touch shuttle-side ones diff --git a/code/modules/modular_computers/file_system/reports/crew_record.dm b/code/modules/modular_computers/file_system/reports/crew_record.dm index 5a97f4463334d..60faad5304c93 100644 --- a/code/modules/modular_computers/file_system/reports/crew_record.dm +++ b/code/modules/modular_computers/file_system/reports/crew_record.dm @@ -49,12 +49,7 @@ GLOBAL_VAR_INIT(arrest_security_status, "Arrest") set_name(H ? H.real_name : "Unset") set_formal_name(formal_name) set_job(H ? GetAssignment(H) : "Unset") - var/pronouns = "Unset" - if(H) - var/datum/pronouns/P = H.choose_from_pronouns() - if(P) - pronouns = P.formal_term - set_sex(pronouns) + set_sex(H ? H.get_formal_pronouns() : "Unset") set_age(H ? H.age : 30) set_status(GLOB.default_physical_status) set_species(H ? H.get_species() : SPECIES_HUMAN) diff --git a/code/modules/modular_computers/hardware/_hardware.dm b/code/modules/modular_computers/hardware/_hardware.dm index b0f7d4b0c9c50..2c62c1fc53fd5 100644 --- a/code/modules/modular_computers/hardware/_hardware.dm +++ b/code/modules/modular_computers/hardware/_hardware.dm @@ -21,10 +21,10 @@ /// Chance of malfunction when the component is damaged var/malfunction_probability = 10 var/usage_flags = PROGRAM_ALL - /// Whether attackby will be passed on it even with a closed panel + /// Whether use_tool will be passed on it even with a closed panel var/external_slot -/obj/item/stock_parts/computer/attackby(obj/item/W as obj, mob/living/user as mob) +/obj/item/stock_parts/computer/use_tool(obj/item/W, mob/living/user, list/click_params) // Multitool. Runs diagnostics if(isMultitool(W)) to_chat(user, "***** DIAGNOSTICS REPORT *****") diff --git a/code/modules/modular_computers/hardware/ai_slot.dm b/code/modules/modular_computers/hardware/ai_slot.dm index 9cb8eb6a7d9a0..b5422129cdf8f 100644 --- a/code/modules/modular_computers/hardware/ai_slot.dm +++ b/code/modules/modular_computers/hardware/ai_slot.dm @@ -19,15 +19,16 @@ power_usage = power_usage_occupied ..() -/obj/item/stock_parts/computer/ai_slot/attackby(obj/item/W, mob/user) - if(..()) +/obj/item/stock_parts/computer/ai_slot/use_tool(obj/item/W, mob/living/user, list/click_params) + if ((. = ..())) return TRUE if(istype(W, /obj/item/aicard)) if(stored_card) to_chat(user, "\The [src] is already occupied.") - return + return TRUE if(!user.unEquip(W, src)) - return + FEEDBACK_UNEQUIP_FAILURE(user, W) + return TRUE do_insert_ai(user, W) return TRUE if(isScrewdriver(W) && stored_card) diff --git a/code/modules/modular_computers/hardware/card_slot.dm b/code/modules/modular_computers/hardware/card_slot.dm index 1813a7bca80ce..1d1515e68a961 100644 --- a/code/modules/modular_computers/hardware/card_slot.dm +++ b/code/modules/modular_computers/hardware/card_slot.dm @@ -101,8 +101,8 @@ loc.verbs |= /obj/item/stock_parts/computer/card_slot/proc/verb_eject_id return TRUE -/obj/item/stock_parts/computer/card_slot/attackby(obj/item/card/id/I, mob/living/user) - if(!istype(I)) +/obj/item/stock_parts/computer/card_slot/use_tool(obj/item/I, mob/living/user, list/click_params) + if(!istype(I, /obj/item/card/id)) return ..() insert_id(I, user) return TRUE diff --git a/code/modules/modular_computers/hardware/nano_printer.dm b/code/modules/modular_computers/hardware/nano_printer.dm index b57a4763a7775..e2a26634711a2 100644 --- a/code/modules/modular_computers/hardware/nano_printer.dm +++ b/code/modules/modular_computers/hardware/nano_printer.dm @@ -41,21 +41,23 @@ return FALSE return TRUE -/obj/item/stock_parts/computer/nano_printer/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/stock_parts/computer/nano_printer/use_tool(obj/item/W, mob/living/user, list/click_params) if(istype(W, /obj/item/paper)) if(stored_paper >= max_paper) to_chat(user, "You try to add \the [W] into \the [src], but its paper bin is full.") - return + return TRUE to_chat(user, "You insert \the [W] into [src].") qdel(W) stored_paper++ - else if(istype(W, /obj/item/paper_bundle)) + return TRUE + + if (istype(W, /obj/item/paper_bundle)) var/obj/item/paper_bundle/B = W var/num_of_pages_added = 0 if(stored_paper >= max_paper) to_chat(user, "You try to add \the [W] into \the [src], but its paper bin is full.") - return + return TRUE for(var/obj/item/bundleitem in B) //loop through items in bundle if(istype(bundleitem, /obj/item/paper)) //if item is paper (and not photo), add into the bin B.pages.Remove(bundleitem) @@ -74,4 +76,5 @@ else //if at least two items remain, just update the bundle icon B.update_icon() to_chat(user, "You add [num_of_pages_added] papers from \the [W] into \the [src].") - return + return TRUE + return ..() diff --git a/code/modules/modular_computers/hardware/scanners/scanner.dm b/code/modules/modular_computers/hardware/scanners/scanner.dm index 82d2ef6ebb5f6..14346087ed590 100644 --- a/code/modules/modular_computers/hardware/scanners/scanner.dm +++ b/code/modules/modular_computers/hardware/scanners/scanner.dm @@ -54,7 +54,7 @@ /obj/item/stock_parts/computer/scanner/proc/do_on_afterattack(mob/user, atom/target, proximity) -/obj/item/stock_parts/computer/scanner/attackby(obj/W, mob/living/user) +/obj/item/stock_parts/computer/scanner/use_tool(obj/item/W, mob/living/user, list/click_params) do_on_attackby(user, W) // Nanopaste. Repair all damage if present for a single unit. var/obj/item/stack/S = W diff --git a/code/modules/multiz/basic.dm b/code/modules/multiz/basic.dm index 378e2e3dc3691..54e3b368da1ec 100644 --- a/code/modules/multiz/basic.dm +++ b/code/modules/multiz/basic.dm @@ -50,6 +50,14 @@ var/global/list/z_levels = list()// Each bit re... haha just kidding this is a l for(var/level = z, HasAbove(level), level++) . |= level+1 +/proc/GetConnectedZlevelsSet(z) + RETURN_TYPE(/list) + . = list("[z]" = TRUE) + for(var/level = z, HasBelow(level), level--) + .["[level-1]"] = TRUE + for(var/level = z, HasAbove(level), level++) + .["[level+1]"] = TRUE + /proc/AreConnectedZLevels(zA, zB) return zA == zB || (zB in GetConnectedZlevels(zA)) diff --git a/code/modules/multiz/movement.dm b/code/modules/multiz/movement.dm index 6b1b83f9d2782..d5876e2fbf631 100644 --- a/code/modules/multiz/movement.dm +++ b/code/modules/multiz/movement.dm @@ -157,7 +157,7 @@ /atom/movable/proc/begin_falling(lastloc, below) if (QDELETED(src)) return - addtimer(new Callback(src, /atom/movable/proc/fall_callback, below), 0) + addtimer(new Callback(src, TYPE_PROC_REF(/atom/movable, fall_callback), below), 0) /atom/movable/proc/fall_callback(turf/below) var/mob/M = src @@ -364,7 +364,7 @@ . = ..() owner = user follow() - GLOB.moved_event.register(owner, src, /atom/movable/z_observer/proc/follow) + GLOB.moved_event.register(owner, src, TYPE_PROC_REF(/atom/movable/z_observer, follow)) /atom/movable/z_observer/proc/follow() @@ -388,7 +388,7 @@ qdel(src) /atom/movable/z_observer/Destroy() - GLOB.moved_event.unregister(owner, src, /atom/movable/z_observer/proc/follow) + GLOB.moved_event.unregister(owner, src, TYPE_PROC_REF(/atom/movable/z_observer, follow)) owner = null . = ..() diff --git a/code/modules/multiz/structures.dm b/code/modules/multiz/structures.dm index 10e7166fefae0..edc7477ad4bf6 100644 --- a/code/modules/multiz/structures.dm +++ b/code/modules/multiz/structures.dm @@ -205,7 +205,7 @@ if(isnull(I)) M.attack_hand(user) else - M.attackby(I, user) + M.use_tool(I, user) return FALSE diff --git a/code/modules/nano/interaction/default.dm b/code/modules/nano/interaction/default.dm index 8ce44be74a9d2..90850591b5852 100644 --- a/code/modules/nano/interaction/default.dm +++ b/code/modules/nano/interaction/default.dm @@ -12,7 +12,8 @@ GLOBAL_DATUM_INIT(default_state, /datum/topic_state/default, new) /mob/observer/ghost/default_can_use_topic(src_object) if(can_admin_interact()) return STATUS_INTERACTIVE // Admins are more equal - if(!client || get_dist(src_object, src) > client.view) // Preventing ghosts from having a million windows open by limiting to objects in range + + if(!client || get_dist(src_object, src) > get_lesser_view_size_component(client.view)) // Preventing ghosts from having a million windows open by limiting to objects in range return STATUS_CLOSE return STATUS_UPDATE // Ghosts can view updates @@ -28,7 +29,7 @@ GLOBAL_DATUM_INIT(default_state, /datum/topic_state/default, new) return // robots can interact with things they can see within their view range - if((src_object in view(src)) && get_dist(src_object, src) <= src.client.view) + if(get_dist(src_object, src) <= get_lesser_view_size_component(client.view) && (src_object in view(src))) return STATUS_INTERACTIVE // interactive (green visibility) return STATUS_DISABLED // no updates, completely disabled (red visibility) @@ -54,7 +55,7 @@ GLOBAL_DATUM_INIT(default_state, /datum/topic_state/default, new) if(cameranet && !cameranet.is_turf_visible(get_turf(src_object))) return STATUS_CLOSE return STATUS_INTERACTIVE - else if(get_dist(src_object, src) <= client.view) // View does not return what one would expect while installed in an inteliCard + else if(get_dist(src_object, src) <= get_lesser_view_size_component(client.view)) // View does not return what one would expect while installed in an inteliCard return STATUS_INTERACTIVE return STATUS_CLOSE diff --git a/code/modules/nano/nanoui.dm b/code/modules/nano/nanoui.dm index cf9a7bfb2805a..643c3d60859a8 100644 --- a/code/modules/nano/nanoui.dm +++ b/code/modules/nano/nanoui.dm @@ -418,6 +418,10 @@ nanoui is used to open and update nano browser uis * @return nothing */ /datum/nanoui/proc/open() + if(!istype(user)) + stack_trace("Wrong type of nanoui user passed: [user], [user.type]") + return + if(!user?.client) return diff --git a/code/modules/organs/external/_external.dm b/code/modules/organs/external/_external.dm index 9a8fa5dcdd7ec..75360ce8d30e4 100644 --- a/code/modules/organs/external/_external.dm +++ b/code/modules/organs/external/_external.dm @@ -221,18 +221,18 @@ for(var/obj/item/organ/external/child in children) child.show_decay_status(user) -/obj/item/organ/external/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/organ/external/use_tool(obj/item/W, mob/living/user, list/click_params) switch(stage) if(0) if(W.sharp) user.visible_message(SPAN_DANGER("[user] cuts [src] open with [W]!")) stage++ - return + return TRUE if(1) if(istype(W)) user.visible_message(SPAN_DANGER("[user] cracks [src] open like an egg with [W]!")) stage++ - return + return TRUE if(2) if(W.sharp || istype(W,/obj/item/hemostat) || isWirecutter(W)) var/list/organs = get_contents_recursive() @@ -256,8 +256,8 @@ user.visible_message(SPAN_DANGER("[user] extracts [removing] from [src] with [W]!")) else user.visible_message(SPAN_DANGER("[user] fishes around fruitlessly in [src] with [W].")) - return - ..() + return TRUE + return ..() /** @@ -399,7 +399,8 @@ heal_damage(0, repair_amount, 0, 1) owner.regenerate_icons() if(user == src.owner) - user.visible_message(SPAN_NOTICE("\The [user] patches [damage_desc] on \his [src.name] with [tool].")) + var/datum/pronouns/pronouns = user.choose_from_pronouns() + user.visible_message(SPAN_NOTICE("\The [user] patches [damage_desc] on [pronouns.his] [src.name] with [tool].")) else user.visible_message(SPAN_NOTICE("\The [user] patches [damage_desc] on [owner]'s [src.name] with [tool].")) diff --git a/code/modules/organs/external/_external_icons.dm b/code/modules/organs/external/_external_icons.dm index f2dea091eb17d..6f194b137f454 100644 --- a/code/modules/organs/external/_external_icons.dm +++ b/code/modules/organs/external/_external_icons.dm @@ -51,7 +51,7 @@ var/global/list/limb_icon_cache = list() update_icon(1) if(owner) SetName("[owner.real_name]'s head") - addtimer(new Callback(owner, /mob/living/carbon/human/proc/update_hair), 1, TIMER_UNIQUE) + addtimer(new Callback(owner, TYPE_PROC_REF(/mob/living/carbon/human, update_hair)), 1, TIMER_UNIQUE) ..() /obj/item/organ/external/proc/get_icon_key() @@ -174,7 +174,7 @@ var/global/list/limb_icon_cache = list() state = "[state]-[organ_tag]" var/icon/I = icon(M.icon, state) I.Blend(color, M.blend) - ADD_SORTED(sorted, list(list(M.draw_order, I, M)), /proc/cmp_marking_order) + ADD_SORTED(sorted, list(list(M.draw_order, I, M)), GLOBAL_PROC_REF(cmp_marking_order)) for (var/entry in sorted) //Revisit this with blendmodes mob_icon.Blend(entry[2], entry[3]["layer_blend"]) diff --git a/code/modules/organs/external/head.dm b/code/modules/organs/external/head.dm index 6aaccd41517f3..6c47e8ab0bc66 100644 --- a/code/modules/organs/external/head.dm +++ b/code/modules/organs/external/head.dm @@ -160,9 +160,10 @@ if (M.draw_target == MARKING_TARGET_HAIR) var/color = markings[E] var/icon/I = icon(M.icon, M.icon_state) - I.Blend(HI, ICON_AND) - I.Blend(color, ICON_MULTIPLY) - ADD_SORTED(sorted_hair_markings, list(list(M.draw_order, I)), /proc/cmp_marking_order) + if(istype(M, /datum/sprite_accessory/marking/hair_fade)) + I.Blend(HI, ICON_AND) + I.Blend(color, M.blend) + ADD_SORTED(sorted_hair_markings, list(list(M.draw_order, I)), GLOBAL_PROC_REF(cmp_marking_order)) for (var/entry in sorted_hair_markings) HI.Blend(entry[2], ICON_OVERLAY) //TODO : Add emissive blocker here if hair should block it. Else, leave as is @@ -201,7 +202,7 @@ 0,0,0,1, rgb[1] / 255, rgb[2] / 255, rgb[3] / 255, 0 ) - ADD_SORTED(sorted_head_markings, list(list(M.draw_order, I)), /proc/cmp_marking_order) + ADD_SORTED(sorted_head_markings, list(list(M.draw_order, I)), GLOBAL_PROC_REF(cmp_marking_order)) for (var/entry in sorted_head_markings) res.AddOverlays(entry[2]) diff --git a/code/modules/organs/external/species/nabber_threat.dm b/code/modules/organs/external/species/nabber_threat.dm index eee5023c5f8ee..c8d5097dae352 100644 --- a/code/modules/organs/external/species/nabber_threat.dm +++ b/code/modules/organs/external/species/nabber_threat.dm @@ -23,11 +23,12 @@ if(message == "Cancel") return else if(message == "Yes") - owner.visible_message(SPAN_WARNING("[owner]'s skin shifts to a deep red colour with dark chevrons running down in an almost hypnotic \ - pattern. Standing tall, \he strikes, sharp spikes aimed at those threatening \him, claws whooshing through the air past them.")) + var/datum/pronouns/pronouns = owner.choose_from_pronouns() + owner.visible_message(SPAN_WARNING("\The [owner]'s skin shifts to a deep red colour with dark chevrons running down in an almost hypnotic \ + pattern. Standing tall, [pronouns.he] strikes, sharp spikes aimed at those threatening [pronouns.him], claws whooshing through the air past them.")) playsound(owner.loc, 'sound/effects/angrybug.ogg', 60, 0) owner.skin_state = SKIN_THREAT owner.update_skin() - addtimer(new Callback(owner, /mob/living/carbon/human/proc/reset_skin), 10 SECONDS, TIMER_UNIQUE) + addtimer(new Callback(owner, TYPE_PROC_REF(/mob/living/carbon/human, reset_skin)), 10 SECONDS, TIMER_UNIQUE) else if(owner.skin_state == SKIN_THREAT) owner.reset_skin() diff --git a/code/modules/organs/internal/brain.dm b/code/modules/organs/internal/brain.dm index 6fdfa1214607d..ed5d1212a5597 100644 --- a/code/modules/organs/internal/brain.dm +++ b/code/modules/organs/internal/brain.dm @@ -214,7 +214,7 @@ owner.Paralyse(damage_secondary) owner.Weaken(round(damageTaken, 1)) if (prob(30)) - addtimer(new Callback(src, .proc/brain_damage_callback, damage), rand(6, 20) SECONDS, TIMER_UNIQUE) + addtimer(new Callback(src, PROC_REF(brain_damage_callback), damage), rand(6, 20) SECONDS, TIMER_UNIQUE) /obj/item/organ/internal/brain/proc/brain_damage_callback(damage) //Confuse them as a somewhat uncommon aftershock. Side note: Only here so a spawn isn't used. Also, for the sake of a unique timer. if (!owner || owner.stat == DEAD || (status & ORGAN_DEAD)) diff --git a/code/modules/organs/internal/species/fbp.dm b/code/modules/organs/internal/species/fbp.dm index e6e71c6e87714..b78044d8b8117 100644 --- a/code/modules/organs/internal/species/fbp.dm +++ b/code/modules/organs/internal/species/fbp.dm @@ -8,7 +8,7 @@ status = ORGAN_ROBOTIC vital = 1 var/open - var/obj/item/cell/cell = /obj/item/cell/high + var/obj/item/cell/cell = /obj/item/cell/super //at 0.26 completely depleted after 60ish minutes of constant walking or 130 minutes of standing still var/servo_cost = 0.26 @@ -66,7 +66,7 @@ if(cell) cell.emp_act(severity) -/obj/item/organ/internal/cell/attackby(obj/item/W, mob/user) +/obj/item/organ/internal/cell/use_tool(obj/item/W, mob/living/user, list/click_params) if(isScrewdriver(W)) if(open) open = 0 @@ -74,6 +74,7 @@ else open = 1 to_chat(user, SPAN_NOTICE("You unscrew the battery panel.")) + return TRUE if(isCrowbar(W)) if(open) @@ -81,6 +82,7 @@ user.put_in_hands(cell) to_chat(user, SPAN_NOTICE("You remove \the [cell] from \the [src].")) cell = null + return TRUE if (istype(W, /obj/item/cell)) if(open) @@ -89,6 +91,8 @@ else if(user.unEquip(W, src)) cell = W to_chat(user, SPAN_NOTICE("You insert \the [cell].")) + return TRUE + return ..() /obj/item/organ/internal/cell/replaced() ..() diff --git a/code/modules/organs/internal/species/ipc.dm b/code/modules/organs/internal/species/ipc.dm index c5674cbf0a13b..2b5bd2aa57ab1 100644 --- a/code/modules/organs/internal/species/ipc.dm +++ b/code/modules/organs/internal/species/ipc.dm @@ -36,8 +36,11 @@ ..() if(!brainmob && H) init(H) - robotize() +// [SIERRA-REMOVE] - IPC_MODS +/* unshackle() +*/ +// [/SIERRA-REMOVE] update_icon() if (!is_processing) START_PROCESSING(SSobj, src) @@ -98,7 +101,7 @@ if (!protected) var/datum/ghosttrap/T = get_ghost_trap("positronic brain") T.request_player(brainmob, "Someone is requesting a personality for a positronic brain.", 60 SECONDS) - searching = addtimer(new Callback(src, .proc/cancel_search), 60 SECONDS, TIMER_UNIQUE | TIMER_STOPPABLE) + searching = addtimer(new Callback(src, PROC_REF(cancel_search)), 60 SECONDS, TIMER_UNIQUE | TIMER_STOPPABLE) icon_state = "posibrain-searching" /obj/item/organ/internal/posibrain/proc/cancel_search() diff --git a/code/modules/organs/internal/species/nabber.dm b/code/modules/organs/internal/species/nabber.dm index bbd6c8249ae4f..f2eaab14a529f 100644 --- a/code/modules/organs/internal/species/nabber.dm +++ b/code/modules/organs/internal/species/nabber.dm @@ -53,7 +53,7 @@ else to_chat(owner, SPAN_NOTICE("Your protective lenses retract out of the way.")) innate_flash_protection = FLASH_PROTECTION_VULNERABLE - addtimer(new Callback(src, .proc/remove_shield), 1 SECONDS) + addtimer(new Callback(src, PROC_REF(remove_shield)), 1 SECONDS) owner.update_icons() refresh_action_button() @@ -168,6 +168,7 @@ var/lowblood_tally = 0 name = "distributed nervous system" parent_organ = BP_CHEST + can_use_mmi = FALSE /obj/item/organ/internal/brain/insectoid/nabber/Process() if(!owner || !owner.should_have_organ(BP_HEART)) diff --git a/code/modules/organs/internal/stomach.dm b/code/modules/organs/internal/stomach.dm index bb4430d443d51..6f0b0416967b4 100644 --- a/code/modules/organs/internal/stomach.dm +++ b/code/modules/organs/internal/stomach.dm @@ -86,10 +86,10 @@ owner.empty_stomach() refresh_action_button() -/obj/item/organ/internal/stomach/attackby(obj/item/item, mob/living/user) +/obj/item/organ/internal/stomach/use_tool(obj/item/item, mob/living/user, list/click_params) if (!is_sharp(item)) return ..() - . = TRUE + user.visible_message( SPAN_ITALIC("\The [user] begins cutting into \a [src] with \a [item]."), SPAN_ITALIC("You start to cut open \the [src] with \the [item]."), @@ -97,9 +97,9 @@ ) take_internal_damage(5) if (!user.do_skilled(5 SECONDS, SKILL_ANATOMY, src) || QDELETED(src)) - return + return TRUE if (!Adjacent(user) || user.incapacitated()) - return + return TRUE var/removed_message var/length = length(contents) switch (length) @@ -117,6 +117,7 @@ take_internal_damage(5) for (var/atom/movable/movable as anything in contents) movable.dropInto(loc) + return TRUE /obj/item/organ/internal/stomach/return_air() return null diff --git a/code/modules/overmap/contacts/_contacts.dm b/code/modules/overmap/contacts/_contacts.dm index e45f94be9cc16..30036e4e1be33 100644 --- a/code/modules/overmap/contacts/_contacts.dm +++ b/code/modules/overmap/contacts/_contacts.dm @@ -66,7 +66,7 @@ var/matrix/M = matrix() M.Scale(range*2.6) animate(radar, transform = M, alpha = 0, time = (SENSOR_TIME_DELAY*range), 1, SINE_EASING) - addtimer(new Callback(src, .proc/reset_radar, radar), (0.25 SECONDS *range+0.1)) + addtimer(new Callback(src, PROC_REF(reset_radar), radar), (0.25 SECONDS *range+0.1)) /datum/overmap_contact/proc/reset_radar(image/radar) images -= radar @@ -85,7 +85,7 @@ var/obj/overmap/visitable/visitable_effect = effect if (!visitable_effect || !istype(visitable_effect)) return FALSE - for (var/obj/machinery/power/shield_generator/S in SSmachines.machinery) + for (var/obj/machinery/power/shield_generator/S as anything in SSmachines.get_machinery_of_type(/obj/machinery/power/shield_generator)) if (S.z in visitable_effect.map_z) if (S.running == SHIELD_RUNNING) return TRUE @@ -97,7 +97,7 @@ pinged = TRUE show() animate(marker, alpha=255, 0.5 SECOND, 1, LINEAR_EASING) - addtimer(new Callback(src, .proc/unping), 1 SECOND) + addtimer(new Callback(src, PROC_REF(unping)), 1 SECOND) /datum/overmap_contact/proc/unping() animate(marker, alpha=75, 2 SECOND, 1, LINEAR_EASING) diff --git a/code/modules/overmap/contacts/contact_sensors.dm b/code/modules/overmap/contacts/contact_sensors.dm index c9019eb19433c..335236d8c2f3f 100644 --- a/code/modules/overmap/contacts/contact_sensors.dm +++ b/code/modules/overmap/contacts/contact_sensors.dm @@ -190,7 +190,7 @@ record.update_marker_icon() var/time_delay = max((SENSOR_TIME_DELAY * get_dist_euclidian(overmap_obj, contact)),1) - addtimer(new Callback(record, .proc/ping), time_delay) + addtimer(new Callback(record, PROC_REF(ping)), time_delay) /obj/machinery/shipsensors/use_tool(obj/item/tool, mob/living/user, list/click_params) if (isMultitool(tool)) @@ -201,12 +201,12 @@ if (tracker in trackers) trackers -= tracker - GLOB.destroyed_event.unregister(tracker, src, .proc/remove_tracker) + GLOB.destroyed_event.unregister(tracker, src, PROC_REF(remove_tracker)) to_chat(user, SPAN_NOTICE("You unlink the tracker in \the [mtool]'s buffer from \the [src]")) return TRUE trackers += tracker - GLOB.destroyed_event.register(tracker, src, .proc/remove_tracker) + GLOB.destroyed_event.register(tracker, src, PROC_REF(remove_tracker)) to_chat(user, SPAN_NOTICE("You link the tracker in \the [mtool]'s buffer to \the [src]")) return TRUE diff --git a/code/modules/overmap/disperser/disperser_console.dm b/code/modules/overmap/disperser/disperser_console.dm index 5d083353f9651..878e4fdce5fe3 100644 --- a/code/modules/overmap/disperser/disperser_console.dm +++ b/code/modules/overmap/disperser/disperser_console.dm @@ -57,7 +57,7 @@ if(is_valid_setup()) return TRUE - for(var/obj/machinery/disperser/front/F in SSmachines.machinery) + for(var/obj/machinery/disperser/front/F as anything in SSmachines.get_machinery_of_type(/obj/machinery/disperser/front)) if(get_dist(src, F) >= link_range) continue var/backwards = turn(F.dir, 180) @@ -71,9 +71,9 @@ middle = M back = B if(is_valid_setup()) - GLOB.destroyed_event.register(F, src, .proc/release_links) - GLOB.destroyed_event.register(M, src, .proc/release_links) - GLOB.destroyed_event.register(B, src, .proc/release_links) + GLOB.destroyed_event.register(F, src, PROC_REF(release_links)) + GLOB.destroyed_event.register(M, src, PROC_REF(release_links)) + GLOB.destroyed_event.register(B, src, PROC_REF(release_links)) return TRUE return FALSE @@ -91,9 +91,9 @@ * Used for destroying links when unlinked. */ /obj/machinery/computer/ship/disperser/proc/release_links() - GLOB.destroyed_event.unregister(front, src, .proc/release_links) - GLOB.destroyed_event.unregister(middle, src, .proc/release_links) - GLOB.destroyed_event.unregister(back, src, .proc/release_links) + GLOB.destroyed_event.unregister(front, src, PROC_REF(release_links)) + GLOB.destroyed_event.unregister(middle, src, PROC_REF(release_links)) + GLOB.destroyed_event.unregister(back, src, PROC_REF(release_links)) front = null middle = null back = null diff --git a/code/modules/overmap/events/event.dm b/code/modules/overmap/events/event.dm index a0a5f5fe6f396..4515fca4fff59 100644 --- a/code/modules/overmap/events/event.dm +++ b/code/modules/overmap/events/event.dm @@ -12,7 +12,7 @@ var/global/singleton/overmap_event_handler/overmap_event_handler = new() /singleton/overmap_event_handler/proc/create_events(z_level, overmap_size, number_of_events) // Acquire the list of not-yet utilized overmap turfs on this Z-level var/list/candidate_turfs = block(locate(OVERMAP_EDGE, OVERMAP_EDGE, z_level),locate(overmap_size - OVERMAP_EDGE, overmap_size - OVERMAP_EDGE,z_level)) - candidate_turfs = where(candidate_turfs, /proc/can_not_locate, /obj/overmap/visitable) + candidate_turfs = where(candidate_turfs, GLOBAL_PROC_REF(can_not_locate), /obj/overmap/visitable) for(var/i = 1 to number_of_events) if(!length(candidate_turfs)) @@ -124,13 +124,13 @@ var/global/singleton/overmap_event_handler/overmap_event_handler = new() if(!length(active_hazards)) hazard_by_turf -= T - GLOB.entered_event.unregister(T, src, /singleton/overmap_event_handler/proc/on_turf_entered) - GLOB.exited_event.unregister(T, src, /singleton/overmap_event_handler/proc/on_turf_exited) + GLOB.entered_event.unregister(T, src, TYPE_PROC_REF(/singleton/overmap_event_handler, on_turf_entered)) + GLOB.exited_event.unregister(T, src, TYPE_PROC_REF(/singleton/overmap_event_handler, on_turf_exited)) else hazard_by_turf |= T hazard_by_turf[T] = active_hazards - GLOB.entered_event.register(T, src,/singleton/overmap_event_handler/proc/on_turf_entered) - GLOB.exited_event.register(T, src, /singleton/overmap_event_handler/proc/on_turf_exited) + GLOB.entered_event.register(T, src, TYPE_PROC_REF(/singleton/overmap_event_handler, on_turf_entered)) + GLOB.exited_event.register(T, src, TYPE_PROC_REF(/singleton/overmap_event_handler, on_turf_exited)) for(var/obj/overmap/visitable/ship/ship in T) for(var/datum/event/E in ship_events[ship]) diff --git a/code/modules/overmap/exoplanets/exoplanet_fauna.dm b/code/modules/overmap/exoplanets/exoplanet_fauna.dm index f357c992f0c36..d8a60c9c9d8ed 100644 --- a/code/modules/overmap/exoplanets/exoplanet_fauna.dm +++ b/code/modules/overmap/exoplanets/exoplanet_fauna.dm @@ -29,7 +29,7 @@ /obj/overmap/visitable/sector/exoplanet/proc/handle_repopulation() for (var/i = 1 to round(max_animal_count - length(animals))) if (prob(10)) - var/turf/simulated/T = pick_area_turf(planetary_area, list(/proc/not_turf_contains_dense_objects)) + var/turf/simulated/T = pick_area_turf(planetary_area, list(GLOBAL_PROC_REF(not_turf_contains_dense_objects))) var/mob_type = pick(repopulate_types) var/mob/S = new mob_type(T) track_animal(S) @@ -39,8 +39,8 @@ /obj/overmap/visitable/sector/exoplanet/proc/track_animal(mob/A) animals += A - GLOB.death_event.register(A, src, /obj/overmap/visitable/sector/exoplanet/proc/remove_animal) - GLOB.destroyed_event.register(A, src, /obj/overmap/visitable/sector/exoplanet/proc/remove_animal) + GLOB.death_event.register(A, src, TYPE_PROC_REF(/obj/overmap/visitable/sector/exoplanet, remove_animal)) + GLOB.destroyed_event.register(A, src, TYPE_PROC_REF(/obj/overmap/visitable/sector/exoplanet, remove_animal)) /obj/overmap/visitable/sector/exoplanet/proc/get_random_species_name() return pick("nol","shan","can","fel","xor")+pick("a","e","o","t","ar")+pick("ian","oid","ac","ese","inian","rd") diff --git a/code/modules/overmap/exoplanets/planet_themes/radiation_bombing.dm b/code/modules/overmap/exoplanets/planet_themes/radiation_bombing.dm index 6aa7de1f58554..2849b278c0708 100644 --- a/code/modules/overmap/exoplanets/planet_themes/radiation_bombing.dm +++ b/code/modules/overmap/exoplanets/planet_themes/radiation_bombing.dm @@ -14,7 +14,7 @@ var/radiation_power = rand(10, 37.5) var/num_craters = round(min(0.04, rand()) * 0.02 * E.maxx * E.maxy) for (var/i = 1 to num_craters) - var/turf/simulated/T = pick_area_turf(E.planetary_area, list(/proc/not_turf_contains_dense_objects)) + var/turf/simulated/T = pick_area_turf(E.planetary_area, list(GLOBAL_PROC_REF(not_turf_contains_dense_objects))) if (!T) // ran out of space somehow return new/obj/structure/rubble/war(T) diff --git a/code/modules/overmap/exoplanets/planet_types/desert.dm b/code/modules/overmap/exoplanets/planet_types/desert.dm index c370bf7c9d0e8..38fe8e2253314 100644 --- a/code/modules/overmap/exoplanets/planet_types/desert.dm +++ b/code/modules/overmap/exoplanets/planet_types/desert.dm @@ -100,7 +100,7 @@ if(prob(80)) to_chat(user, SPAN_WARNING("You slip and fail to get out!")) return - user.visible_message(SPAN_NOTICE("\The [buckled_mob] pulls himself out of \the [src].")) + user.visible_message(SPAN_NOTICE("\The [buckled_mob] pulls themselves out of \the [src].")) else user.visible_message(SPAN_NOTICE("\The [buckled_mob] has been freed from \the [src] by \the [user].")) unbuckle_mob() diff --git a/code/modules/overmap/sectors.dm b/code/modules/overmap/sectors.dm index 6babf753d318e..87b88ed67b640 100644 --- a/code/modules/overmap/sectors.dm +++ b/code/modules/overmap/sectors.dm @@ -82,7 +82,7 @@ GLOBAL_LIST_EMPTY(known_overmap_sectors) /obj/overmap/visitable/proc/populate_sector_objects() /obj/overmap/visitable/proc/get_areas() - return get_filtered_areas(list(/proc/area_belongs_to_zlevels = map_z)) + return get_filtered_areas(list(GLOBAL_PROC_REF(area_belongs_to_zlevels) = map_z)) /obj/overmap/visitable/proc/find_z_levels() map_z = GetConnectedZlevels(z) @@ -162,7 +162,7 @@ GLOBAL_LIST_EMPTY(known_overmap_sectors) /obj/overmap/visitable/sector/update_known_connections(notify = FALSE) . = ..() - for(var/obj/machinery/computer/ship/helm/H in SSmachines.machinery) + for(var/obj/machinery/computer/ship/helm/H as anything in SSmachines.get_machinery_of_type(/obj/machinery/computer/ship/helm)) H.add_known_sector(src, notify) diff --git a/code/modules/overmap/ships/beacon.dm b/code/modules/overmap/ships/beacon.dm index 9d2d1d2117da8..c23d6b79580e9 100644 --- a/code/modules/overmap/ships/beacon.dm +++ b/code/modules/overmap/ships/beacon.dm @@ -171,8 +171,8 @@

---END OF TRANSMISSION---") /obj/overmap/radio/proc/set_origin(obj/overmap/origin) - GLOB.moved_event.register(origin, src, /obj/overmap/radio/proc/follow) - GLOB.destroyed_event.register(origin, src, /datum/proc/qdel_self) + GLOB.moved_event.register(origin, src, TYPE_PROC_REF(/obj/overmap/radio, follow)) + GLOB.destroyed_event.register(origin, src, TYPE_PROC_REF(/datum, qdel_self)) forceMove(origin.loc) source = origin pixel_x = -(origin.bound_width - 6) @@ -197,6 +197,6 @@ /obj/overmap/radio/distress/Initialize() ..() - for(var/obj/machinery/computer/ship/helm/H in SSmachines.machinery) + for(var/obj/machinery/computer/ship/helm/H as anything in SSmachines.get_machinery_of_type(/obj/machinery/computer/ship/helm)) H.visible_message(SPAN_WARNING("\the [H] pings uneasily as it detects a distress signal.")) playsound(H, 'sound/machines/sensors/newcontact.ogg', 50, 3, 3) diff --git a/code/modules/overmap/ships/computers/sensors.dm b/code/modules/overmap/ships/computers/sensors.dm index 4da8b85c12208..4229ff0981fb4 100644 --- a/code/modules/overmap/ships/computers/sensors.dm +++ b/code/modules/overmap/ships/computers/sensors.dm @@ -91,7 +91,7 @@ /obj/machinery/computer/ship/sensors/proc/find_sensors() if (!linked) return - for (var/obj/machinery/shipsensors/S in SSmachines.machinery) + for (var/obj/machinery/shipsensors/S as anything in SSmachines.get_machinery_of_type(/obj/machinery/shipsensors)) if (linked.check_ownership(S)) LAZYADD(S.linked_consoles, src) S.link_ship(linked) diff --git a/code/modules/overmap/ships/computers/ship.dm b/code/modules/overmap/ships/computers/ship.dm index 66b0e4e87a7f2..26aa9af73b794 100644 --- a/code/modules/overmap/ships/computers/ship.dm +++ b/code/modules/overmap/ships/computers/ship.dm @@ -72,9 +72,9 @@ somewhere on that shuttle. Subtypes of these can be then used to perform ship ov if(linked) for(var/obj/machinery/shipsensors/sensor in linked.sensors) sensor.reveal_contacts(user) - GLOB.moved_event.register(user, src, /obj/machinery/computer/ship/proc/unlook) + GLOB.moved_event.register(user, src, TYPE_PROC_REF(/obj/machinery/computer/ship, unlook)) if (!isghost(user)) - GLOB.stat_set_event.register(user, src, /obj/machinery/computer/ship/proc/unlook) + GLOB.stat_set_event.register(user, src, TYPE_PROC_REF(/obj/machinery/computer/ship, unlook)) LAZYDISTINCTADD(viewers, weakref(user)) if(linked) LAZYDISTINCTADD(linked.navigation_viewers, weakref(user)) @@ -82,12 +82,12 @@ somewhere on that shuttle. Subtypes of these can be then used to perform ship ov /obj/machinery/computer/ship/proc/unlook(mob/user) user.reset_view(null, FALSE) if(user.client) - user.client.view = world.view + user.client.view = user.get_preference_value(/datum/client_preference/client_view) if(linked) for(var/obj/machinery/shipsensors/sensor in linked.sensors) sensor.hide_contacts(user) - GLOB.moved_event.unregister(user, src, /obj/machinery/computer/ship/proc/unlook) - GLOB.stat_set_event.unregister(user, src, /obj/machinery/computer/ship/proc/unlook) + GLOB.moved_event.unregister(user, src, TYPE_PROC_REF(/obj/machinery/computer/ship, unlook)) + GLOB.stat_set_event.unregister(user, src, TYPE_PROC_REF(/obj/machinery/computer/ship, unlook)) LAZYREMOVE(viewers, weakref(user)) if(linked) LAZYREMOVE(linked.navigation_viewers, weakref(user)) diff --git a/code/modules/overmap/ships/landable.dm b/code/modules/overmap/ships/landable.dm index c49b38e375347..f4bb913aa5ba2 100644 --- a/code/modules/overmap/ships/landable.dm +++ b/code/modules/overmap/ships/landable.dm @@ -61,7 +61,7 @@ /obj/overmap/visitable/ship/landable/populate_sector_objects() ..() var/datum/shuttle/shuttle_datum = SSshuttle.shuttles[shuttle] - GLOB.shuttle_moved_event.register(shuttle_datum, src, .proc/on_shuttle_jump) + GLOB.shuttle_moved_event.register(shuttle_datum, src, PROC_REF(on_shuttle_jump)) on_landing(landmark, shuttle_datum.current_location) // We "land" at round start to properly place ourselves on the overmap. /obj/shuttle_landmark/ship @@ -94,7 +94,7 @@ core_landmark = master SetName(_name) landmark_tag = master.shuttle_name + _name - GLOB.destroyed_event.register(master, src, /datum/proc/qdel_self) + GLOB.destroyed_event.register(master, src, TYPE_PROC_REF(/datum, qdel_self)) . = ..() /obj/shuttle_landmark/visiting_shuttle/Destroy() @@ -115,7 +115,7 @@ /obj/shuttle_landmark/visiting_shuttle/shuttle_arrived(datum/shuttle/shuttle) LAZYSET(core_landmark.visitors, src, shuttle) - GLOB.shuttle_moved_event.register(shuttle, src, .proc/shuttle_left) + GLOB.shuttle_moved_event.register(shuttle, src, PROC_REF(shuttle_left)) /obj/shuttle_landmark/visiting_shuttle/proc/shuttle_left(datum/shuttle/shuttle, obj/shuttle_landmark/old_landmark, obj/shuttle_landmark/new_landmark) if(old_landmark == src) diff --git a/code/modules/overmap/ships/ship.dm b/code/modules/overmap/ships/ship.dm index 9d2e8a748a36a..cfbff879e87e9 100644 --- a/code/modules/overmap/ships/ship.dm +++ b/code/modules/overmap/ships/ship.dm @@ -278,7 +278,7 @@ var/global/const/OVERMAP_SPEED_CONSTANT = (1 SECOND) /obj/overmap/visitable/ship/populate_sector_objects() ..() - for(var/obj/machinery/computer/ship/S in SSmachines.machinery) + for(var/obj/machinery/computer/ship/S as anything in SSmachines.get_machinery_of_type(/obj/machinery/computer/ship)) S.attempt_hook_up(src) for(var/datum/ship_engine/E in ship_engines) if(check_ownership(E.holder)) diff --git a/code/modules/paperwork/adminpaper.dm b/code/modules/paperwork/adminpaper.dm index 994aeb54cab4c..77bcbce1c7a1c 100644 --- a/code/modules/paperwork/adminpaper.dm +++ b/code/modules/paperwork/adminpaper.dm @@ -19,7 +19,7 @@ var/footer = null var/footerOn = FALSE - var/logo_list = list("sollogo.png","eclogo.png","fleetlogo.png","exologo.png","ntlogo.png","daislogo.png","xynlogo.png","terralogo.png", "sfplogo.png", "falogo.png") + var/logo_list = list("sollogo.png","eclogo.png","fleetlogo.png","exologo.png","ntlogo.png","daislogo.png","xynlogo.png","terralogo.png", "sfplogo.png", "falogo.png", "zhlogo.png") var/logo = "" var/unformatedText = "" diff --git a/code/modules/paperwork/clipboard.dm b/code/modules/paperwork/clipboard.dm index e70825c39e9d6..9e2f8d849c0b8 100644 --- a/code/modules/paperwork/clipboard.dm +++ b/code/modules/paperwork/clipboard.dm @@ -50,21 +50,23 @@ AddOverlays(overlay_image(icon, "clipboard_over", flags=RESET_COLOR)) return -/obj/item/material/clipboard/attackby(obj/item/W as obj, mob/user as mob) - +/obj/item/material/clipboard/use_tool(obj/item/W, mob/living/user, list/click_params) if(istype(W, /obj/item/paper) || istype(W, /obj/item/photo)) if(!user.unEquip(W, src)) - return + FEEDBACK_UNEQUIP_FAILURE(user, W) + return TRUE if(istype(W, /obj/item/paper)) toppaper = W to_chat(user, SPAN_NOTICE("You clip the [W] onto \the [src].")) update_icon() + return TRUE else if(istype(toppaper) && istype(W, /obj/item/pen)) - toppaper.attackby(W, usr) + toppaper.use_tool(W, user) update_icon() + return TRUE - return + return ..() /obj/item/material/clipboard/attack_self(mob/user as mob) var/dat = "Clipboard" @@ -113,7 +115,7 @@ if(istype(I, /obj/item/pen)) - P.attackby(I, usr) + P.use_tool(I, usr) else if(href_list["remove"]) var/obj/item/P = locate(href_list["remove"]) diff --git a/code/modules/paperwork/faxmachine.dm b/code/modules/paperwork/faxmachine.dm index e3066907ef24f..e8828e38508e3 100644 --- a/code/modules/paperwork/faxmachine.dm +++ b/code/modules/paperwork/faxmachine.dm @@ -313,12 +313,12 @@ GLOBAL_LIST_EMPTY(admin_departments) if (!istype(pda)) return LAZYADD(linked_pdas, pda) - GLOB.destroyed_event.register(pda, src, .proc/unlink_pda) + GLOB.destroyed_event.register(pda, src, PROC_REF(unlink_pda)) /obj/machinery/photocopier/faxmachine/proc/unlink_pda(obj/item/modular_computer/pda/pda) LAZYREMOVE(linked_pdas, pda) - GLOB.destroyed_event.unregister(pda, src, .proc/unlink_pda) + GLOB.destroyed_event.unregister(pda, src, PROC_REF(unlink_pda)) /// Retrieves a list of all fax machines matching the given department tag. diff --git a/code/modules/paperwork/folders.dm b/code/modules/paperwork/folders.dm index 4159843f38a92..83c740f7d7b66 100644 --- a/code/modules/paperwork/folders.dm +++ b/code/modules/paperwork/folders.dm @@ -31,17 +31,22 @@ AddOverlays("folder_paper") return -/obj/item/folder/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/folder/use_tool(obj/item/W, mob/living/user, list/click_params) if(istype(W, /obj/item/paper) || istype(W, /obj/item/photo) || istype(W, /obj/item/paper_bundle)) if(!user.unEquip(W, src)) - return - to_chat(user, SPAN_NOTICE("You put the [W] into \the [src].")) + FEEDBACK_UNEQUIP_FAILURE(user, W) + return TRUE + to_chat(user, SPAN_NOTICE("You put \the [W] into \the [src].")) update_icon() + return TRUE + else if(istype(W, /obj/item/pen)) var/n_name = sanitizeSafe(input(usr, "What would you like to label the folder?", "Folder Labelling", null) as text, MAX_NAME_LEN) if((loc == usr && usr.stat == 0)) SetName("folder[(n_name ? text("- '[n_name]'") : null)]") - return + return TRUE + + return ..() /obj/item/folder/attack_self(mob/user as mob) var/dat = "[name]" @@ -138,9 +143,9 @@ else ..() -/obj/item/folder/envelope/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/folder/envelope/use_tool(obj/item/item, mob/living/user, list/click_params) if(sealed) sealcheck(user) - return + return TRUE else - ..() + return ..() diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index c317bcf4ab726..4ccf6da8757ca 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -222,34 +222,58 @@ /obj/item/paper/attack_ai(mob/living/silicon/ai/user) show_content(user) -/obj/item/paper/use_before(mob/living/carbon/M as mob, mob/living/carbon/user as mob) - . = FALSE - if (!istype(M)) + +/obj/item/paper/use_before(atom/target, mob/living/user) + if (!isliving(target)) + return FALSE + var/mob/living/carbon/human/human = target + var/zone = user.zone_sel.selecting + if (zone == BP_EYES) + var/action = "looks at \a [initial(name)]" + var/action_self = "look at \the [src]" + if (user != target) + action = "shows \a [initial(name)] to \the [target]" + action_self = "show \a [initial(name)] to \the [target]" + user.visible_message( + SPAN_ITALIC("\The [user] [action]."), + SPAN_ITALIC("You [action_self].") + ) + if (human.client) + examinate(target, src) + return TRUE + if (!istype(human)) + return FALSE + if (zone != BP_MOUTH && zone != BP_HEAD) return FALSE - if (user.zone_sel.selecting == BP_EYES) - user.visible_message(SPAN_NOTICE("You show the paper to [M]. "), \ - SPAN_NOTICE(" [user] holds up a paper and shows it to [M]. ")) - examinate(M, src) + var/obj/item/organ/external/head/head = human.organs_by_name[BP_HEAD] + if (!istype(head)) + to_chat(user, SPAN_WARNING("\The [target] has no head!")) return TRUE + var/target_name = "their" + var/target_name_self = "your" + if (user != target) + target_name = "[target]'s" + target_name_self = target_name + var/part_name = "head" + if (zone == BP_MOUTH) + part_name = "mouth" + user.visible_message( + SPAN_ITALIC("\The [user] starts wiping [target_name] [part_name] with \a [initial(name)]."), + SPAN_ITALIC("You start to wipe [target_name_self] [part_name] with \the [src].") + ) + if (!do_after(user, 2 SECONDS, target, DO_EQUIP & ~DO_BOTH_CAN_TURN)) + return TRUE + user.visible_message( + SPAN_NOTICE("\The [user] finishes cleaning [target_name] [part_name]."), + SPAN_NOTICE("You finish cleaning [target_name_self] [part_name]."), + ) + if (zone == BP_MOUTH) + human.makeup_style = null + human.update_body() + else + head.forehead_graffiti = null + return TRUE - if (user.zone_sel.selecting == BP_MOUTH) // lipstick wiping - if (ishuman(M)) - var/mob/living/carbon/human/H = M - if (H == user) - to_chat(user, SPAN_NOTICE("You wipe off the lipstick with [src].")) - H.makeup_style = null - H.update_body() - return TRUE - else - user.visible_message(SPAN_WARNING("[user] begins to wipe [H]'s lipstick off with \the [src]."), \ - SPAN_NOTICE("You begin to wipe off [H]'s lipstick.")) - if (!do_after(user, 2 SECONDS, H, (DO_DEFAULT | DO_USER_UNIQUE_ACT | DO_PUBLIC_PROGRESS) & ~DO_BOTH_CAN_TURN)) - return TRUE - user.visible_message(SPAN_NOTICE("[user] wipes [H]'s lipstick off with \the [src]."), \ - SPAN_NOTICE("You wipe off [H]'s lipstick.")) - H.makeup_style = null - H.update_body() - return TRUE /obj/item/paper/proc/addtofield(id, text, links = 0) var/locid = 0 @@ -360,7 +384,7 @@ if(istype(P, /obj/item/flame/lighter/zippo)) class = "rose" - user.visible_message(SPAN_CLASS("[class]", "[user] holds \the [P] up to \the [src], it looks like \he's trying to burn it!"), \ + user.visible_message(SPAN_CLASS("[class]", "[user] holds \the [P] up to \the [src], trying to burn it!"), \ SPAN_CLASS("[class]", "You hold \the [P] up to \the [src], burning it slowly.")) spawn(20) @@ -452,8 +476,7 @@ update_icon() -/obj/item/paper/attackby(obj/item/P as obj, mob/user as mob) - ..() +/obj/item/paper/use_tool(obj/item/P, mob/living/user, list/click_params) var/clown = 0 if(user.mind && (user.mind.assigned_role == "Clown")) clown = 1 @@ -461,20 +484,21 @@ if(istype(P, /obj/item/tape_roll)) var/obj/item/tape_roll/tape = P tape.stick(src, user) - return + return TRUE if(istype(P, /obj/item/paper) || istype(P, /obj/item/photo)) if(!can_bundle()) - return + USE_FEEDBACK_FAILURE("You cannot bundle these together!") + return TRUE var/obj/item/paper/other = P if(istype(other) && !other.can_bundle()) - return + USE_FEEDBACK_FAILURE("You cannot bundle these together!") + return TRUE if (istype(P, /obj/item/paper/carbon)) var/obj/item/paper/carbon/C = P if (!C.iscopy && !C.copied) to_chat(user, SPAN_NOTICE("Take off the carbon copy first.")) - add_fingerprint(user) - return + return TRUE var/obj/item/paper_bundle/B = new(src.loc) if (name != "paper") B.SetName(name) @@ -482,7 +506,7 @@ B.SetName(P.name) if(!user.unEquip(P, B) || !user.unEquip(src, B)) - return + return TRUE user.put_in_hands(B) to_chat(user, SPAN_NOTICE("You clip the [P.name] to [(src.name == "paper") ? "the paper" : src.name].")) @@ -490,22 +514,23 @@ B.pages.Add(src) B.pages.Add(P) B.update_icon() + return TRUE - else if(istype(P, /obj/item/pen)) + if (istype(P, /obj/item/pen)) if(icon_state == "scrap") to_chat(usr, SPAN_WARNING("\The [src] is too crumpled to write on.")) - return + return TRUE var/obj/item/pen/robopen/RP = P if ( istype(RP) && RP.mode == 2 ) RP.RenamePaper(user,src) else show_content(user, editable = TRUE) - return + return TRUE - else if(istype(P, /obj/item/stamp) || istype(P, /obj/item/clothing/ring/seal)) + if (istype(P, /obj/item/stamp) || istype(P, /obj/item/clothing/ring/seal)) if((!in_range(src, usr) && loc != user && !( istype(loc, /obj/item/material/clipboard) ) && loc.loc != user && user.get_active_hand() != P)) - return + return ..() stamps += (stamps=="" ? "
" : "
") + "This paper has been stamped with the [P.name]." @@ -526,7 +551,7 @@ if(istype(P, /obj/item/stamp/clown)) if(!clown) to_chat(user, SPAN_NOTICE("You are totally unable to use the stamp. HONK!")) - return + return TRUE if(!ico) ico = new @@ -540,18 +565,22 @@ playsound(src, 'sound/effects/stamp.ogg', 50, 1) to_chat(user, SPAN_NOTICE("You stamp the paper with your [P.name].")) + return TRUE else if(istype(P, /obj/item/flame)) burnpaper(P, user) + return TRUE - else if(istype(P, /obj/item/paper_bundle)) + if (istype(P, /obj/item/paper_bundle)) if(!can_bundle()) - return + USE_FEEDBACK_FAILURE("You cannot bundle these together!") + return TRUE var/obj/item/paper_bundle/attacking_bundle = P attacking_bundle.insert_sheet_at(user, (length(attacking_bundle.pages))+1, src) attacking_bundle.update_icon() + return TRUE + return ..() - add_fingerprint(user) /obj/item/paper/proc/can_bundle() return TRUE diff --git a/code/modules/paperwork/paper_bundle.dm b/code/modules/paperwork/paper_bundle.dm index 009bc9bf8b826..ac496c784a556 100644 --- a/code/modules/paperwork/paper_bundle.dm +++ b/code/modules/paperwork/paper_bundle.dm @@ -15,29 +15,30 @@ var/list/pages = list() // Ordered list of pages as they are to be displayed. Can be different order than src.contents. -/obj/item/paper_bundle/attackby(obj/item/W as obj, mob/user as mob) - ..() - if(!istype(W)) - return - var/obj/item/paper/paper = W - if(istype(paper) && !paper.can_bundle()) - return //non-paper or bundlable paper only +/obj/item/paper_bundle/use_tool(obj/item/W, mob/living/user, list/click_params) + if(istype(W, /obj/item/paper)) + var/obj/item/paper/paper = W + if(!paper.can_bundle()) + USE_FEEDBACK_FAILURE("You cannot bundle these together!") + return TRUE + if (istype(W, /obj/item/paper/carbon)) var/obj/item/paper/carbon/C = W if (!C.iscopy && !C.copied) to_chat(user, SPAN_NOTICE("Take off the carbon copy first.")) - add_fingerprint(user) - return + return TRUE // adding sheets if(istype(W, /obj/item/paper) || istype(W, /obj/item/photo)) insert_sheet_at(user, length(pages)+1, W) + return TRUE // burning - else if(istype(W, /obj/item/flame)) + if (istype(W, /obj/item/flame)) burnpaper(W, user) + return TRUE // merging bundles - else if(istype(W, /obj/item/paper_bundle)) + if (istype(W, /obj/item/paper_bundle)) for(var/obj/O in W) O.forceMove(src) O.add_fingerprint(user) @@ -45,18 +46,16 @@ to_chat(user, SPAN_NOTICE("You add \the [W.name] to [(src.name == "paper bundle") ? "the paper bundle" : src.name].")) qdel(W) - else - if(istype(W, /obj/item/tape_roll)) - return 0 - if(istype(W, /obj/item/pen)) - show_browser(user, "", "window=[name]") //Closes the dialog + return TRUE + + if (istype(W, /obj/item/pen)) + show_browser(user, "", "window=[name]") //Closes the dialog var/obj/P = pages[page] - P.attackby(W, user) + P.use_tool(W, user) + update_icon() + attack_self(user) //Update the browsed page. - update_icon() - attack_self(user) //Update the browsed page. - add_fingerprint(user) - return + return ..() /obj/item/paper_bundle/proc/insert_sheet_at(mob/user, index, obj/item/sheet) if (!user.unEquip(sheet, src)) @@ -78,7 +77,7 @@ if(istype(P, /obj/item/flame/lighter/zippo)) class = "rose>" - user.visible_message(SPAN_CLASS("[class]", "[user] holds \the [P] up to \the [src], it looks like \he's trying to burn it!"), \ + user.visible_message(SPAN_CLASS("[class]", "[user] holds \the [P] up to \the [src], trying to burn it!"), \ SPAN_CLASS("[class]", "You hold \the [P] up to \the [src], burning it slowly.")) spawn(20) diff --git a/code/modules/paperwork/paper_sticky.dm b/code/modules/paperwork/paper_sticky.dm index 7a86b3c5d29e1..f5d671c717fd7 100644 --- a/code/modules/paperwork/paper_sticky.dm +++ b/code/modules/paperwork/paper_sticky.dm @@ -22,20 +22,19 @@ if(written_text) icon_state = "[icon_state]_writing" -/obj/item/sticky_pad/attackby(obj/item/thing, mob/user) +/obj/item/sticky_pad/use_tool(obj/item/thing, mob/living/user, list/click_params) if(istype(thing, /obj/item/pen)) - if(jobban_isbanned(user, "Graffiti")) to_chat(user, SPAN_WARNING("You are banned from leaving persistent information across rounds.")) - return + return TRUE var/writing_space = MAX_MESSAGE_LEN - length(written_text) if(writing_space <= 0) to_chat(user, SPAN_WARNING("There is no room left on \the [src].")) - return + return TRUE var/text = sanitizeSafe(input("What would you like to write?") as text, writing_space) if(!text || thing.loc != user || (!Adjacent(user) && loc != user) || user.incapacitated()) - return + return TRUE user.visible_message(SPAN_NOTICE("\The [user] jots a note down on \the [src].")) written_by = user.ckey if(written_text) @@ -43,8 +42,8 @@ else written_text = text update_icon() - return - ..() + return TRUE + return ..() /obj/item/sticky_pad/examine(mob/user) . = ..() @@ -81,7 +80,7 @@ /obj/item/paper/sticky/Initialize() . = ..() - GLOB.moved_event.register(src, src, /obj/item/paper/sticky/proc/reset_persistence_tracking) + GLOB.moved_event.register(src, src, TYPE_PROC_REF(/obj/item/paper/sticky, reset_persistence_tracking)) /obj/item/paper/sticky/proc/reset_persistence_tracking() SSpersistence.forget_value(src, /datum/persistent/paper/sticky) diff --git a/code/modules/paperwork/paperbin.dm b/code/modules/paperwork/paperbin.dm index 1e494266f5a4a..64e7330b4c61b 100644 --- a/code/modules/paperwork/paperbin.dm +++ b/code/modules/paperwork/paperbin.dm @@ -69,15 +69,18 @@ return -/obj/item/paper_bin/attackby(obj/item/i as obj, mob/user as mob) +/obj/item/paper_bin/use_tool(obj/item/i, mob/living/user, list/click_params) if(istype(i, /obj/item/paper)) if(!user.unEquip(i, src)) - return - to_chat(user, SPAN_NOTICE("You put [i] in [src].")) + FEEDBACK_UNEQUIP_FAILURE(user, i) + return TRUE + to_chat(user, SPAN_NOTICE("You put \the [i] in \the [src].")) papers.Add(i) update_icon() amount++ - else if(istype(i, /obj/item/paper_bundle)) + return TRUE + + if (istype(i, /obj/item/paper_bundle)) to_chat(user, SPAN_NOTICE("You loosen \the [i] and add its papers into \the [src].")) var/was_there_a_photo = 0 for(var/obj/item/bundleitem in i) //loop through items in bundle @@ -92,6 +95,9 @@ qdel(i) if(was_there_a_photo) to_chat(user, SPAN_NOTICE("The photo cannot go into \the [src].")) + return TRUE + + return ..() /obj/item/paper_bin/examine(mob/user, distance) diff --git a/code/modules/paperwork/papershredder.dm b/code/modules/paperwork/papershredder.dm index 7902ccfb01dbb..45d2fd5351fa7 100644 --- a/code/modules/paperwork/papershredder.dm +++ b/code/modules/paperwork/papershredder.dm @@ -108,11 +108,12 @@ /obj/machinery/papershredder/on_update_icon() icon_state = "papershredder[max(0,min(5,floor(paperamount/2)))]" -/obj/item/shreddedp/attackby(obj/item/W as obj, mob/user) +/obj/item/shreddedp/use_tool(obj/item/W, mob/living/user, list/click_params) if(istype(W, /obj/item/flame/lighter)) burnpaper(W, user) + return TRUE else - ..() + return ..() /obj/item/shreddedp/proc/burnpaper(obj/item/flame/lighter/P, mob/user) if(user.restrained()) @@ -120,7 +121,7 @@ if(!P.lit) to_chat(user, SPAN_WARNING("\The [P] is not lit.")) return - user.visible_message(SPAN_WARNING("\The [user] holds \the [P] up to \the [src]. It looks like \he's trying to burn it!"), \ + user.visible_message(SPAN_WARNING("\The [user] holds \the [P] up to \the [src], trying to burn it!"), \ SPAN_WARNING("You hold \the [P] up to \the [src], burning it slowly.")) if(!do_after(user, 2 SECONDS, src, DO_PUBLIC_UNIQUE)) return diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm index 5efa94bc92a34..6a27b5cb3433d 100644 --- a/code/modules/paperwork/photocopier.dm +++ b/code/modules/paperwork/photocopier.dm @@ -223,9 +223,9 @@ break if(istype(W, /obj/item/paper)) - W = copy(W) + W = copy(W, need_toner) else if(istype(W, /obj/item/photo)) - W = photocopy(W) + W = photocopy(W, need_toner) W.forceMove(p) p.pages += W diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm index 5e206f3e329f8..871f78a3cf223 100644 --- a/code/modules/paperwork/photography.dm +++ b/code/modules/paperwork/photography.dm @@ -58,12 +58,13 @@ var/global/photo_count = 0 tiny.pixel_x = -32*(photo_size-1)/2 - 3 tiny.pixel_y = -32*(photo_size-1)/2 + 3 -/obj/item/photo/attackby(obj/item/P as obj, mob/user as mob) - if(istype(P, /obj/item/pen)) +/obj/item/photo/use_tool(obj/item/item, mob/living/user, list/click_params) + if(istype(item, /obj/item/pen)) var/txt = sanitize(input(user, "What would you like to write on the back?", "Photo Writing", null) as text, 128) if(loc == user && user.stat == 0) scribble = txt - ..() + return TRUE + return ..() /obj/item/photo/examine(mob/user, distance) . = TRUE diff --git a/code/modules/persistence/noticeboards.dm b/code/modules/persistence/noticeboards.dm index 5e15834195e01..416a33d3474e0 100644 --- a/code/modules/persistence/noticeboards.dm +++ b/code/modules/persistence/noticeboards.dm @@ -87,6 +87,17 @@ /obj/structure/noticeboard/use_tool(obj/item/tool, mob/user, list/click_params) + if (istype(tool, /obj/item/material/shard/caltrop/tack)) + user.unEquip(tool, loc) + var/click_x = text2num_or_default(click_params["icon-x"], 16) + var/click_y = text2num_or_default(click_params["icon-y"], 16) + tool.pixel_x = pixel_x + click_x - 16 + tool.pixel_y = pixel_y + click_y - 16 + user.visible_message( + SPAN_ITALIC("\The [user] pushes \a [tool] into \a [src]."), + SPAN_ITALIC("You push \the [tool] into \the [src].") + ) + return TRUE // Paper, Photo - Attach if (is_type_in_list(tool, list(/obj/item/paper, /obj/item/photo))) if (jobban_isbanned(user, "Graffitiy")) @@ -197,7 +208,7 @@ var/obj/item/pen/pen = user.IsHolding(/obj/item/pen) if(istype(pen)) add_fingerprint(user) - P.attackby(pen, user) + P.use_tool(pen, user) else to_chat(user, SPAN_WARNING("You need a pen to write on \the [P].")) . = TOPIC_REFRESH diff --git a/code/modules/pointdefense/pointdefense.dm b/code/modules/pointdefense/pointdefense.dm index 9279aa38d301c..64de0539d69d5 100644 --- a/code/modules/pointdefense/pointdefense.dm +++ b/code/modules/pointdefense/pointdefense.dm @@ -148,7 +148,7 @@ if(!istype(M)) return engaging = TRUE - addtimer(new Callback(src, .proc/finish_shot, target), rotation_speed) + addtimer(new Callback(src, PROC_REF(finish_shot), target), rotation_speed) var/Angle = round(Get_Angle(src, M)) animate( src, diff --git a/code/modules/power/cable_structure.dm b/code/modules/power/cable_structure.dm index b35793dc1395f..ad3a4327b9d07 100644 --- a/code/modules/power/cable_structure.dm +++ b/code/modules/power/cable_structure.dm @@ -101,7 +101,6 @@ By design, d1 is the smallest direction and d2 is the highest /obj/structure/cable/attack_ghost(mob/user) if(user.client && user.client.inquisitive_ghost) examinate(user, src) - // following code taken from attackby (multitool) if(powernet && (powernet.avail > 0)) to_chat(user, SPAN_WARNING("[get_wattage()] in power network.")) else diff --git a/code/modules/power/fusion/_setup.dm b/code/modules/power/fusion/_setup.dm index b3a5368775cb0..20ec9ecfda612 100644 --- a/code/modules/power/fusion/_setup.dm +++ b/code/modules/power/fusion/_setup.dm @@ -28,11 +28,11 @@ log_and_message_admins("## FUSION CORE SETUP - Setup initiated by [usr].") - for(var/obj/machinery/fusion_fuel_injector/mapped/injector in SSmachines.machinery) + for(var/obj/machinery/fusion_fuel_injector/mapped/injector as anything in SSmachines.get_machinery_of_type(/obj/machinery/fusion_fuel_injector/mapped)) injector.cur_assembly = new /obj/item/fuel_assembly/deuterium(injector) injector.BeginInjecting() - var/obj/machinery/power/fusion_core/mapped/core = locate() in SSmachines.machinery + var/obj/machinery/power/fusion_core/mapped/core = locate() in SSmachines.get_machinery_of_type(/obj/machinery/power/fusion_core/mapped) if(core.jumpstart(15000)) var/list/delayed_objects = list() diff --git a/code/modules/power/fusion/core/core_field.dm b/code/modules/power/fusion/core/core_field.dm index 0b3682c966e5f..e71c8c8fa69f2 100644 --- a/code/modules/power/fusion/core/core_field.dm +++ b/code/modules/power/fusion/core/core_field.dm @@ -109,7 +109,7 @@ /obj/fusion_em_field/Initialize() . = ..() - addtimer(new Callback(src, .proc/update_light_colors), 10 SECONDS, TIMER_LOOP) + addtimer(new Callback(src, PROC_REF(update_light_colors)), 10 SECONDS, TIMER_LOOP) /obj/fusion_em_field/proc/update_light_colors() var/use_range @@ -276,7 +276,7 @@ animate(filters[1], time = 0, loop = 1, radius = 0, flags=ANIMATION_PARALLEL) animate(time = 2 SECONDS, radius = _radius) animating_ripple = TRUE - addtimer(new Callback(src, .proc/ResetRipple), 2 SECONDS) + addtimer(new Callback(src, PROC_REF(ResetRipple)), 2 SECONDS) /obj/fusion_em_field/proc/ResetRipple() animating_ripple = FALSE @@ -444,7 +444,7 @@ continue /// Sort based on reaction priority to avoid deut-deut eating all the deut before deut-trit can run etc. - sortTim(possible_reactions, /proc/cmp_fusion_reaction_des) + sortTim(possible_reactions, GLOBAL_PROC_REF(cmp_fusion_reaction_des)) //split up the reacting atoms between the possible reactions while(length(possible_reactions)) diff --git a/code/modules/power/fusion/gyrotron/gyrotron.dm b/code/modules/power/fusion/gyrotron/gyrotron.dm index 9f3cf403df7f3..aa3e947207fe2 100644 --- a/code/modules/power/fusion/gyrotron/gyrotron.dm +++ b/code/modules/power/fusion/gyrotron/gyrotron.dm @@ -42,10 +42,8 @@ /obj/machinery/power/emitter/gyrotron/get_burst_delay() return rate * 10 -/obj/machinery/power/emitter/gyrotron/get_emitter_beam() - var/obj/item/projectile/beam/emitter/E = ..() - E.damage = mega_energy * 50 - return E +/obj/machinery/power/emitter/gyrotron/get_emitter_damage() + return mega_energy * 50 /obj/machinery/power/emitter/gyrotron/on_update_icon() ClearOverlays() diff --git a/code/modules/power/gravitygenerator.dm b/code/modules/power/gravitygenerator.dm index fa13847c490a6..9f7af1da619ac 100644 --- a/code/modules/power/gravitygenerator.dm +++ b/code/modules/power/gravitygenerator.dm @@ -96,12 +96,11 @@ gravity_generator.on = 0 for(var/area/A in gravity_generator.localareas) - var/obj/machinery/gravity_generator/G - for(G in SSmachines.machinery) + for(var/obj/machinery/gravity_generator/G as anything in SSmachines.get_machinery_of_type(/obj/machinery/gravity_generator)) if((A in G.localareas) && (G.on)) + A.gravitychange(0) break - if(!G) - A.gravitychange(0) + else for(var/area/A in gravity_generator.localareas) gravity_generator.on = 1 diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index cec531f4f1b18..f9cf26c64c054 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -299,7 +299,7 @@ if(istype(lightbulb, /obj/item/light)) if (on) AddOverlays(emissive_appearance(icon, _state)) - AddOverlays(overlay_image(icon, _state, color)) + AddOverlays(overlay_image(icon, _state, lightbulb.color)) if(on) @@ -400,7 +400,7 @@ var/obj/item/light/L = light_type return initial(L.name) -/// Attempts to insert a given light bulb. Called by `attackby()`. +/// Attempts to insert a given light bulb. Called by `use_tool()`. /obj/machinery/light/proc/insert_bulb(obj/item/light/L) L.forceMove(src) lightbulb = L @@ -554,10 +554,11 @@ to_chat(user, SPAN_NOTICE("You telekinetically remove the [get_fitting_name()].")) else if(user.a_intent != I_HELP) var/obj/item/organ/external/hand = H.organs_by_name[user.hand ? BP_L_HAND : BP_R_HAND] + var/datum/pronouns/pronouns = H.choose_from_pronouns() if(hand && hand.is_usable() && !hand.can_feel_pain()) user.apply_damage(3, DAMAGE_BURN, user.hand ? BP_L_HAND : BP_R_HAND, used_weapon = src) user.visible_message( - SPAN_WARNING("\The [user]'s [hand] burns and sizzles as \he touches the hot [get_fitting_name()]."), + SPAN_WARNING("\The [user]'s [hand] burns and sizzles as [pronouns.he] touches the hot [get_fitting_name()]."), SPAN_WARNING("Your [hand.name] burns and sizzles as you remove the hot [get_fitting_name()].") ) else @@ -822,7 +823,7 @@ update_icon() // if a syringe, can inject phoron to make it explode -/obj/item/light/attackby(obj/item/I, mob/user) +/obj/item/light/use_tool(obj/item/I, mob/living/user, list/click_params) if(istype(I, /obj/item/reagent_containers/syringe) && status == LIGHT_OK) var/obj/item/reagent_containers/syringe/S = I @@ -833,10 +834,11 @@ to_chat(user, SPAN_WARNING("You inject the solution into \the [src].")) if (reagents.get_reagent_amount(/datum/reagent/toxin/phoron) >= LIGHT_PHORON_EXPLODE_THRESHOLD) log_and_message_admins("injected a light with phoron, rigging it to explode.", user) - return + return TRUE else to_chat(user, SPAN_WARNING("\The [src] is already filled with fluid!")) - . = ..() + return TRUE + return ..() // shatter light, unless it was an attempt to put it in a light socket // now only shatter if the intent was harm @@ -881,7 +883,7 @@ log_and_message_admins("Rigged light explosion, last touched by [fingerprintslast]") var/turf/T = get_turf(loc) set_status(LIGHT_BROKEN) - addtimer(new Callback(GLOBAL_PROC, /proc/explosion, T, 3, EX_ACT_LIGHT), 0.5 SECONDS) + addtimer(new Callback(GLOBAL_PROC, GLOBAL_PROC_REF(explosion), T, 3, EX_ACT_LIGHT), 0.5 SECONDS) else visible_message(SPAN_WARNING("\The [src] short-circuits as something burns out its filament!")) set_status(LIGHT_BURNED) diff --git a/code/modules/power/port_gen.dm b/code/modules/power/port_gen.dm index 35463efb1dcf4..58078e8da7911 100644 --- a/code/modules/power/port_gen.dm +++ b/code/modules/power/port_gen.dm @@ -100,7 +100,7 @@ if(duration) set_stat(MACHINE_STAT_EMPED, TRUE) - addtimer(new Callback(src, .proc/resolve_emp_timer), duration) + addtimer(new Callback(src, PROC_REF(resolve_emp_timer)), duration) /obj/machinery/power/port_gen/proc/resolve_emp_timer() set_stat(MACHINE_STAT_EMPED, FALSE) diff --git a/code/modules/power/power.dm b/code/modules/power/power.dm index 920c5d80cfef7..5627b7129e43e 100644 --- a/code/modules/power/power.dm +++ b/code/modules/power/power.dm @@ -264,7 +264,7 @@ var/area/source_area if(istype(power_source,/area)) source_area = power_source - power_source = source_area.get_apc() + power_source = source_area.apc if(istype(power_source,/obj/structure/cable)) var/obj/structure/cable/Cable = power_source power_source = Cable.powernet diff --git a/code/modules/power/powernet.dm b/code/modules/power/powernet.dm index a6df46f9f8e15..3d3042eddccc9 100644 --- a/code/modules/power/powernet.dm +++ b/code/modules/power/powernet.dm @@ -198,8 +198,3 @@ if(C.d1 == 0) return C return null - - -/// Returns instance of `/obj/machinery/apc` or `null`. The area's APC, if defined and present. -/area/proc/get_apc() - return apc diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm index 283348f893548..ec900d7a6aeee 100644 --- a/code/modules/power/singularity/emitter.dm +++ b/code/modules/power/singularity/emitter.dm @@ -23,6 +23,8 @@ var/shot_number = 0 var/state = EMITTER_LOOSE var/locked = FALSE + /// Type path (Type of `/obj/item/projectile`). The projectile type this emitter fires. + var/projectile_type = /obj/item/projectile/beam/emitter core_skill = SKILL_ENGINES uncreated_component_parts = list( @@ -173,19 +175,15 @@ fire_delay = get_rand_burst_delay() shot_number = 0 - //need to calculate the power per shot as the emitter doesn't fire continuously. - var/burst_time = (min_burst_delay + max_burst_delay) / 2 + 2 * (burst_shots - 1) - var/power_per_shot = (active_power_usage * efficiency) * (burst_time / 10) / burst_shots - if (prob(35)) var/datum/effect/spark_spread/s = new /datum/effect/spark_spread s.set_up(5, 1, src) s.start() - var/obj/item/projectile/beam/emitter/A = get_emitter_beam() - playsound(loc, A.fire_sound, 25, TRUE) - A.damage = round (power_per_shot / EMITTER_DAMAGE_POWER_TRANSFER) - A.launch( get_step(loc, dir) ) + var/obj/item/projectile/proj = new projectile_type(get_turf(src)) + proj.damage = get_emitter_damage() + playsound(loc, proj.fire_sound, 25, TRUE) + proj.launch( get_step(loc, dir) ) /obj/machinery/power/emitter/post_anchor_change() if (anchored) @@ -287,13 +285,21 @@ /obj/machinery/power/emitter/proc/get_burst_delay() return 0.2 SECONDS // This value doesn't really affect normal emitters, but *does* affect subtypes like the gyrotron that can have very long delays -/obj/machinery/power/emitter/proc/get_emitter_beam() - return new /obj/item/projectile/beam/emitter(get_turf(src)) + +/** + * Calculates the damage the emitter should fire with its projectile. + */ +/obj/machinery/power/emitter/proc/get_emitter_damage() + //need to calculate the power per shot as the emitter doesn't fire continuously. + var/burst_time = (min_burst_delay + max_burst_delay) / 2 + 2 * (burst_shots - 1) + var/power_per_shot = (active_power_usage * efficiency) * (burst_time / 10) / burst_shots + return round(power_per_shot / EMITTER_DAMAGE_POWER_TRANSFER) + /singleton/public_access/public_method/toggle_emitter name = "toggle emitter" desc = "Toggles whether or not the emitter is active. It must be unlocked to work." - call_proc = /obj/machinery/power/emitter/proc/activate + call_proc = TYPE_PROC_REF(/obj/machinery/power/emitter, activate) /singleton/public_access/public_variable/emitter_active expected_type = /obj/machinery/power/emitter diff --git a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm index 72d4e4e75ab69..849526aa503bf 100644 --- a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm +++ b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm @@ -62,7 +62,7 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin icon_state = "none" anchored = FALSE density = TRUE - obj_flags = OBJ_FLAG_ROTATABLE + obj_flags = OBJ_FLAG_ROTATABLE | OBJ_FLAG_ANCHORABLE var/obj/machinery/particle_accelerator/control_box/master = null var/const/CONSTRUCT_STATE_UNANCHORED = 0 diff --git a/code/modules/power/singularity/singularity.dm b/code/modules/power/singularity/singularity.dm index d5481cb497a30..9fd15cca03bc3 100644 --- a/code/modules/power/singularity/singularity.dm +++ b/code/modules/power/singularity/singularity.dm @@ -39,7 +39,7 @@ ..() START_PROCESSING(SSobj, src) - for(var/obj/machinery/power/singularity_beacon/singubeacon in SSmachines.machinery) + for(var/obj/machinery/power/singularity_beacon/singubeacon as anything in SSmachines.get_machinery_of_type(/obj/machinery/power/singularity_beacon)) if(singubeacon.active) target = singubeacon break diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm index 22199c5b829b6..f68f407fd7cb3 100644 --- a/code/modules/power/solar.dm +++ b/code/modules/power/solar.dm @@ -221,52 +221,50 @@ var/global/solar_gen_rate = 1500 glass_type = null -/obj/item/solar_assembly/attackby(obj/item/W, mob/user) - +/obj/item/solar_assembly/use_tool(obj/item/W, mob/living/user, list/click_params) if(!anchored && isturf(loc)) if(isWrench(W)) anchored = TRUE pixel_x = 0 pixel_y = 0 pixel_z = 0 - user.visible_message(SPAN_NOTICE("[user] wrenches the solar assembly into place.")) + user.visible_message(SPAN_NOTICE("\The [user] wrenches \the [src] into place.")) playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) - return 1 + return TRUE else if(isWrench(W)) anchored = FALSE - user.visible_message(SPAN_NOTICE("[user] unwrenches the solar assembly from it's place.")) + user.visible_message(SPAN_NOTICE("\The [user] unwrenches \the [src] from it's place.")) playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) - return 1 + return TRUE if(istype(W, /obj/item/stack/material) && W.get_material_name() == MATERIAL_GLASS) var/obj/item/stack/material/S = W if(S.use(2)) glass_type = W.type playsound(src.loc, 'sound/machines/click.ogg', 50, 1) - user.visible_message(SPAN_NOTICE("[user] places the glass on the solar assembly.")) + user.visible_message(SPAN_NOTICE("\The [user] places the glass on \the [src].")) if(tracker) new /obj/machinery/power/tracker(get_turf(src), src) else new /obj/machinery/power/solar(get_turf(src), src) else to_chat(user, SPAN_WARNING("You need two sheets of glass to put them into a solar panel.")) - return - return 1 + return TRUE if(!tracker) if(istype(W, /obj/item/tracker_electronics)) tracker = 1 qdel(W) - user.visible_message(SPAN_NOTICE("[user] inserts the electronics into the solar assembly.")) - return 1 + user.visible_message(SPAN_NOTICE("\The [user] inserts the electronics into \the [src].")) + return TRUE else if(isCrowbar(W)) - new /obj/item/tracker_electronics(src.loc) + new /obj/item/tracker_electronics(loc) tracker = 0 - user.visible_message(SPAN_NOTICE("[user] takes out the electronics from the solar assembly.")) - return 1 - ..() + user.visible_message(SPAN_NOTICE("\The [user] takes out the electronics from \the [src].")) + return TRUE + return ..() // // Solar Control Computer diff --git a/code/modules/power/turbine.dm b/code/modules/power/turbine.dm index 4c7ee4e7f8b57..8f978646c3938 100644 --- a/code/modules/power/turbine.dm +++ b/code/modules/power/turbine.dm @@ -198,11 +198,11 @@ /obj/machinery/computer/turbine_computer/Initialize() . = ..() - for(var/obj/machinery/compressor/C in SSmachines.machinery) + for(var/obj/machinery/compressor/C as anything in SSmachines.get_machinery_of_type(/obj/machinery/compressor)) if(id_tag == C.comp_id) compressor = C doors = list() - for(var/obj/machinery/door/blast/P in SSmachines.machinery) + for(var/obj/machinery/door/blast/P as anything in SSmachines.get_machinery_of_type(/obj/machinery/door/blast)) if(P.id_tag == id_tag) doors += P diff --git a/code/modules/projectiles/ammunition.dm b/code/modules/projectiles/ammunition.dm index 80450d4117733..bbdfe62890bd6 100644 --- a/code/modules/projectiles/ammunition.dm +++ b/code/modules/projectiles/ammunition.dm @@ -63,11 +63,11 @@ LAZYDISTINCTADD(A.gunshot_residue, caliber) -/obj/item/ammo_casing/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/ammo_casing/use_tool(obj/item/W, mob/living/user, list/click_params) if(isScrewdriver(W)) if(!BB) - to_chat(user, SPAN_NOTICE("There is no bullet in the casing to inscribe anything into.")) - return + to_chat(user, SPAN_WARNING("There is no bullet in the casing to inscribe anything into.")) + return TRUE var/tmp_label = "" var/label_text = sanitizeSafe(input(user, "Inscribe some text into \the [initial(BB.name)]","Inscription",tmp_label), MAX_NAME_LEN) @@ -79,7 +79,9 @@ else to_chat(user, SPAN_NOTICE("You inscribe \"[label_text]\" into \the [initial(BB.name)].")) BB.SetName("[initial(BB.name)] (\"[label_text]\")") - else ..() + return TRUE + + return ..() /obj/item/ammo_casing/on_update_icon() @@ -147,20 +149,22 @@ update_icon() -/obj/item/ammo_magazine/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/ammo_magazine/use_tool(obj/item/W, mob/living/user, list/click_params) if(istype(W, /obj/item/ammo_casing)) var/obj/item/ammo_casing/C = W if(C.caliber != caliber) - to_chat(user, SPAN_WARNING("[C] does not fit into [src].")) - return + to_chat(user, SPAN_WARNING("\The [C] does not fit into \the [src].")) + return TRUE if(length(stored_ammo) >= max_ammo) - to_chat(user, SPAN_WARNING("[src] is full!")) - return + to_chat(user, SPAN_WARNING("\The [src] is full!")) + return TRUE if(!user.unEquip(C, src)) - return + FEEDBACK_UNEQUIP_FAILURE(user, C) + return TRUE stored_ammo.Add(C) update_icon() - else ..() + return TRUE + return ..() /obj/item/ammo_magazine/attack_self(mob/user) diff --git a/code/modules/projectiles/ammunition/boxes.dm b/code/modules/projectiles/ammunition/boxes.dm index 5429a10d4f35c..8b99c3eca519b 100644 --- a/code/modules/projectiles/ammunition/boxes.dm +++ b/code/modules/projectiles/ammunition/boxes.dm @@ -405,3 +405,14 @@ /obj/item/ammo_magazine/shotgunmag/beanbag labels = list("beanbag") ammo_type = /obj/item/ammo_casing/shotgun/beanbag + +/obj/item/ammo_magazine/n10mm + name = "NT41 magazine (5.7x28mm)" + icon = 'packs/infinity/icons/obj/ammo.dmi' + icon_state = "10mm" + mag_type = MAGAZINE + ammo_type = /obj/item/ammo_casing/nt28mm + matter = list(MATERIAL_STEEL = 1500) + caliber = CALIBER_PISTOL_FAST + max_ammo = 20 + multiple_sprites = 1 diff --git a/code/modules/projectiles/ammunition/bullets.dm b/code/modules/projectiles/ammunition/bullets.dm index 1c4f8d8295c6a..c1b0b982e35e7 100644 --- a/code/modules/projectiles/ammunition/bullets.dm +++ b/code/modules/projectiles/ammunition/bullets.dm @@ -205,3 +205,9 @@ spent_icon = "empshell-spent" projectile_type = /obj/item/projectile/ion matter = list(MATERIAL_STEEL = 160, MATERIAL_URANIUM = 160) + +/obj/item/ammo_casing/nt28mm + name = "5.7x28 bullet casing" + desc = "A casing used in NT submachine guns." + caliber = CALIBER_PISTOL_FAST + projectile_type = /obj/item/projectile/bullet/pistol/fast diff --git a/code/modules/projectiles/effects.dm b/code/modules/projectiles/effects.dm index 099e65ba1fed6..6ce14daa3d881 100644 --- a/code/modules/projectiles/effects.dm +++ b/code/modules/projectiles/effects.dm @@ -176,7 +176,7 @@ //---------------------------- // Bullet //---------------------------- -/obj/projectile/bullet/muzzle +/obj/projectile/bullet icon_state = "muzzle_bullet" light_range = 5 light_power = 1 diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 08f3d22dd2cab..e3f9f240a8861 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -62,46 +62,66 @@ waterproof = FALSE var/burst = 1 - var/can_autofire = FALSE /// checks if the gun will continue firing if the mouse button is held down - var/fire_delay = 6 //delay after shooting before the gun can be used again. Cannot be less than [burst_delay+1] - var/burst_delay = 2 //delay between shots, if firing in bursts + /// Checks if the gun will continue firing if the mouse button is held down. + var/can_autofire = FALSE + /// Delay after shooting before the gun can be used again. Cannot be less than [burst_delay+1]. + var/fire_delay = 6 + /// Delay between shots, if firing in bursts. + var/burst_delay = 2 var/move_delay = 1 + /// Sound this gun makes when firing. Overridden by projectiles with their own sounds. var/fire_sound = 'sound/weapons/gunshot/gunshot.ogg' var/fire_sound_text = "gunshot" + var/fire_sound_vary = TRUE var/fire_anim = null - var/screen_shake = 0 //shouldn't be greater than 2 unless zoomed - var/space_recoil = 0 //knocks back in space + /// The amount your screen shakes when firing. Shouldn't be greater than 2 unless zoomed. + var/screen_shake = 0 + /// Whether or not this weapon moves the shooter backwards when fired in space. + var/space_recoil = 0 var/silenced = FALSE - var/accuracy = 0 //accuracy is measured in tiles. +1 accuracy means that everything is effectively one tile closer for the purpose of miss chance, -1 means the opposite. launchers are not supported, at the moment. - var/accuracy_power = 5 //increase of to-hit chance per 1 point of accuracy - var/bulk = 0 //how unwieldy this weapon for its size, affects accuracy when fired without aiming - var/last_handled //time when hand gun's in became active, for purposes of aiming bonuses - var/scoped_accuracy = null //accuracy used when zoomed in a scope + /// Accuracy is measured in tiles. +1 accuracy means that everything is effectively one tile closer for the purpose of miss chance, -1 means the opposite. launchers are not supported, at the moment. + var/accuracy = 0 + /// Increase of to-hit chance per 1 point of accuracy. + var/accuracy_power = 5 + /// How unwieldy this weapon for its size, affects accuracy when fired without aiming. + var/bulk = 0 + /// Time when hand gun's in became active, for purposes of aiming bonuses. + var/last_handled + /// Accuracy used when zoomed in a scope. Not additive. + var/scoped_accuracy = null + /// How far this weapon's scope can see. var/scope_zoom = 0 - var/list/burst_accuracy = list(0) //allows for different accuracies for each shot in a burst. Applied on top of accuracy + /// Allows for different accuracies for each shot in a burst. Applied on top of accuracy. + var/list/burst_accuracy = list(0) var/list/dispersion = list(0) var/one_hand_penalty var/wielded_item_state - var/combustion //whether it creates hotspot when fired - + /// Whether it creates hotspot when fired. + var/combustion var/next_fire_time = 0 - var/sel_mode = 1 //index of the currently selected mode + /// Index of the currently selected mode. + var/sel_mode = 1 var/list/firemodes = list() var/selector_sound = 'sound/weapons/guns/selector.ogg' - //aiming system stuff - var/keep_aim = 1 //1 for keep shooting until aim is lowered - //0 for one bullet after tarrget moves and aim is lowered - var/multi_aim = 0 //Used to determine if you can target multiple people. - var/list/mob/living/aim_targets //List of who yer targeting. - var/mob/living/last_moved_mob //Used to fire faster at more than one person. - var/told_cant_shoot = 0 //So that it doesn't spam them with the fact they cannot hit them. + //Aiming system stuff + /// 1 for "keep shooting until aim is lowered", 0 for "one bullet after target moves and aim is lowered". + var/keep_aim = 1 + /// Used to determine if you can target multiple people. + var/multi_aim = 0 + /// List of who you are targeting. + var/list/mob/living/aim_targets + /// Used to fire faster at more than one person. + var/mob/living/last_moved_mob + /// So that it doesn't spam them with the fact they cannot hit them. + var/told_cant_shoot = 0 var/lock_time = -100 var/last_safety_check = -INFINITY var/safety_state = 1 var/has_safety = TRUE - var/safety_icon //overlay to apply to gun based on safety state, if any + /// Overlay to apply to gun based on safety state, if any. + var/safety_icon /// What skill governs safe handling of this gun. Basic skill level and higher will also show the safety overlay to the player. var/gun_skill = SKILL_WEAPONS @@ -160,8 +180,9 @@ if(P) if(process_projectile(P, user, user, pick(BP_L_FOOT, BP_R_FOOT))) handle_post_fire(user, user) + var/datum/pronouns/pronouns = user.choose_from_pronouns() user.visible_message( - SPAN_DANGER("\The [user] shoots \himself in the foot with \the [src]!"), + SPAN_DANGER("\The [user] shoots [pronouns.self] in the foot with \the [src]!"), SPAN_DANGER("You shoot yourself in the foot with \the [src]!") ) M.unequip_item() @@ -203,7 +224,7 @@ checkperm = TRUE PreFire(atom, user) if (checkperm) - addtimer(new Callback(user.aiming, /obj/aiming_overlay/proc/toggle_permission, TARGET_CAN_CLICK, TRUE), 1) + addtimer(new Callback(user.aiming, TYPE_PROC_REF(/obj/aiming_overlay, toggle_permission), TARGET_CAN_CLICK, TRUE), 1) else if (suicide && user.zone_sel.selecting == BP_MOUTH && istype(user, /mob/living/carbon/human)) handle_suicide(user) @@ -211,8 +232,11 @@ Fire(atom, user, pointblank = TRUE) return TRUE if (user.a_intent == I_HURT && !user.isEquipped(atom)) //point blank shooting - Fire(atom, user, pointblank = TRUE) - return TRUE + if (safety()) + return ..() + else + Fire(atom, user, pointblank = TRUE) + return TRUE return ..() @@ -515,12 +539,18 @@ return launched -/obj/item/gun/proc/play_fire_sound(mob/user, obj/item/projectile/P) - var/shot_sound = (istype(P) && P.fire_sound)? P.fire_sound : fire_sound - if(silenced) - playsound(user, shot_sound, 10, 1) - else - playsound(user, shot_sound, 50, 1) + +/obj/item/gun/proc/play_fire_sound(mob/user, obj/item/projectile/projectile) + var/sound = fire_sound + if (istype(projectile) && projectile.fire_sound) + sound = projectile.fire_sound + if (islist(sound)) + sound = pick(sound) + var/volume = 50 + if (silenced) + volume = 10 + playsound(src, sound, volume, fire_sound_vary) + //Suicide handling. /obj/item/gun/proc/handle_suicide(mob/living/user) @@ -659,6 +689,7 @@ /obj/item/gun/proc/toggle_safety(mob/user) if (user?.is_physically_disabled()) + to_chat(user, SPAN_WARNING("You can't do this right now!")) return safety_state = !safety_state @@ -668,12 +699,22 @@ last_safety_check = world.time playsound(src, 'sound/weapons/flipblade.ogg', 15, 1) + /obj/item/gun/verb/toggle_safety_verb() - set src in usr - set category = "Object" set name = "Toggle Gun Safety" - if(usr == loc) - toggle_safety(usr) + set category = "Object" + set src in usr + if (usr.incapacitated()) + to_chat(usr, SPAN_WARNING("You're in no condition to do that.")) + return + var/obj/item/gun/gun = usr.get_active_hand() + if (!istype(gun)) + gun = usr.get_inactive_hand() + if (!istype(gun)) + to_chat(usr, SPAN_WARNING("You need a gun in your hands to do that.")) + return + gun.toggle_safety(usr) + /obj/item/gun/CtrlClick(mob/user) if(loc == user) diff --git a/code/modules/projectiles/guns/launcher/net.dm b/code/modules/projectiles/guns/launcher/net.dm index ab2dc111331f0..0c7e4fe49d846 100644 --- a/code/modules/projectiles/guns/launcher/net.dm +++ b/code/modules/projectiles/guns/launcher/net.dm @@ -14,12 +14,16 @@ icon = 'icons/obj/weapons/ammo.dmi' icon_state = "netshell" -/obj/item/net_shell/attackby(obj/item/gun/launcher/net/I, mob/user) - if(istype(I) && I.can_load(src, user)) - I.load(src, user) - to_chat(usr, "You load \the [src] into \the [I].") +/obj/item/net_shell/use_tool(obj/item/item, mob/living/user, list/click_params) + if(istype(item, /obj/item/gun/launcher/net)) + var/obj/item/gun/launcher/net/launcher = item + if (!launcher.can_load(src, user)) + return TRUE + launcher.load(src, user) + to_chat(usr, "You load \the [src] into \the [launcher].") + return TRUE else - ..() + return ..() /obj/item/gun/launcher/net/examine(mob/user, distance) . = ..() diff --git a/code/modules/projectiles/guns/launcher/syringe_gun.dm b/code/modules/projectiles/guns/launcher/syringe_gun.dm index 22b94ae107bbe..971e8acb76492 100644 --- a/code/modules/projectiles/guns/launcher/syringe_gun.dm +++ b/code/modules/projectiles/guns/launcher/syringe_gun.dm @@ -18,13 +18,15 @@ underlays += image(syringe.icon, src, syringe.icon_state) underlays += syringe.filling -/obj/item/syringe_cartridge/attackby(obj/item/I, mob/user) +/obj/item/syringe_cartridge/use_tool(obj/item/I, mob/living/user, list/click_params) if(istype(I, /obj/item/reagent_containers/syringe) && user.unEquip(I, src)) syringe = I to_chat(user, SPAN_NOTICE("You carefully insert [syringe] into [src].")) sharp = TRUE name = "syringe dart" update_icon() + return TRUE + return ..() /obj/item/syringe_cartridge/attack_self(mob/user) if(syringe) diff --git a/code/modules/projectiles/guns/projectile/automatic.dm b/code/modules/projectiles/guns/projectile/automatic.dm index 81c9fef2a2efb..9d566499e507d 100644 --- a/code/modules/projectiles/guns/projectile/automatic.dm +++ b/code/modules/projectiles/guns/projectile/automatic.dm @@ -17,6 +17,7 @@ burst_delay = 2 mag_insert_sound = 'sound/weapons/guns/interaction/smg_magin.ogg' mag_remove_sound = 'sound/weapons/guns/interaction/smg_magout.ogg' + fire_sound = 'sound/weapons/gunshot/gunshot_4mm.ogg' //machine pistol, easier to one-hand with firemodes = list( @@ -37,6 +38,7 @@ ammo_type = /obj/item/ammo_casing/pistol magazine_type = /obj/item/ammo_magazine/machine_pistol allowed_magazines = /obj/item/ammo_magazine/machine_pistol //more damage compared to the wt550, smaller mag size + fire_sound = 'sound/weapons/gunshot/gunshot_pistol.ogg' one_hand_penalty = 2 firemodes = list( @@ -115,6 +117,7 @@ wielded_item_state = "arifle-wielded" mag_insert_sound = 'sound/weapons/guns/interaction/ltrifle_magin.ogg' mag_remove_sound = 'sound/weapons/guns/interaction/ltrifle_magout.ogg' + fire_sound = 'sound/weapons/gunshot/gunshot3.ogg' //Assault rifle, burst fire degrades quicker than SMG, worse one-handing penalty, slightly increased move delay firemodes = list( @@ -149,6 +152,7 @@ allowed_magazines = /obj/item/ammo_magazine/smg_top accuracy_power = 7 one_hand_penalty = 3 + fire_sound = 'sound/weapons/gunshot/gunshot_smg.ogg' //machine pistol, like SMG but easier to one-hand with firemodes = list( @@ -193,6 +197,7 @@ wielded_item_state = "z8carbine-wielded" mag_insert_sound = 'sound/weapons/guns/interaction/batrifle_magin.ogg' mag_remove_sound = 'sound/weapons/guns/interaction/batrifle_magout.ogg' + fire_sound = 'sound/weapons/gunshot/gunshot2.ogg' firemodes = list( list(mode_name="semi auto", burst=1, fire_delay=null, move_delay=null, use_launcher=null, one_hand_penalty=8, burst_accuracy=null, dispersion=null), list(mode_name="3-round bursts", burst=3, fire_delay=null, move_delay=6, use_launcher=null, one_hand_penalty=9, burst_accuracy=list(0,-1,-1), dispersion=list(0.0, 0.6, 1.0)), @@ -294,6 +299,7 @@ one_hand_penalty = 10 mag_insert_sound = 'sound/weapons/guns/interaction/lmg_magin.ogg' mag_remove_sound = 'sound/weapons/guns/interaction/lmg_magout.ogg' + fire_sound = 'sound/weapons/gunshot/gunshot3.ogg' can_special_reload = FALSE //LMG, better sustained fire accuracy than assault rifles (comparable to SMG), higer move delay and one-handing penalty @@ -390,6 +396,7 @@ wielded_item_state = "battlerifle-wielded" mag_insert_sound = 'sound/weapons/guns/interaction/ltrifle_magin.ogg' mag_remove_sound = 'sound/weapons/guns/interaction/ltrifle_magout.ogg' + fire_sound = 'sound/weapons/gunshot/gunshot3.ogg' //Battle Rifle is only accurate in semi-automatic fire. firemodes = list( @@ -424,6 +431,7 @@ one_hand_penalty = 20 mag_insert_sound = 'sound/weapons/guns/interaction/lmg_magin.ogg' mag_remove_sound = 'sound/weapons/guns/interaction/lmg_magout.ogg' + fire_sound = 'sound/weapons/gunshot/minigun.ogg' can_special_reload = FALSE firemodes = list( diff --git a/code/modules/projectiles/guns/projectile/flaregun.dm b/code/modules/projectiles/guns/projectile/flaregun.dm index 6d573a7751f62..54dd2bf2214fa 100644 --- a/code/modules/projectiles/guns/projectile/flaregun.dm +++ b/code/modules/projectiles/guns/projectile/flaregun.dm @@ -17,6 +17,7 @@ load_method = SINGLE_CASING|SPEEDLOADER max_shells = 1 load_sound = 'sound/weapons/guns/interaction/shotgun_instert.ogg' + fire_sound = 'sound/weapons/gunshot/shotgun.ogg' /obj/item/gun/projectile/flare/loaded ammo_type = /obj/item/ammo_casing/shotgun/flash diff --git a/code/modules/projectiles/guns/projectile/pistol.dm b/code/modules/projectiles/guns/projectile/pistol.dm index 163e473e08b5c..6567f64b9fb1b 100644 --- a/code/modules/projectiles/guns/projectile/pistol.dm +++ b/code/modules/projectiles/guns/projectile/pistol.dm @@ -4,6 +4,7 @@ caliber = CALIBER_PISTOL magazine_type = /obj/item/ammo_magazine/pistol allowed_magazines = /obj/item/ammo_magazine/pistol + fire_sound = 'sound/weapons/gunshot/gunshot_pistol.ogg' accuracy_power = 7 var/empty_icon = TRUE //If it should change icon when empty var/ammo_indicator = FALSE @@ -55,6 +56,7 @@ allowed_magazines = /obj/item/ammo_magazine/magnum mag_insert_sound = 'sound/weapons/guns/interaction/hpistol_magin.ogg' mag_remove_sound = 'sound/weapons/guns/interaction/hpistol_magout.ogg' + fire_sound = 'sound/weapons/gunshot/gunshot_strong.ogg' accuracy = 2 one_hand_penalty = 2 bulk = 3 diff --git a/code/modules/projectiles/guns/projectile/revolver.dm b/code/modules/projectiles/guns/projectile/revolver.dm index ae258f68a84b6..d5baf41734a4e 100644 --- a/code/modules/projectiles/guns/projectile/revolver.dm +++ b/code/modules/projectiles/guns/projectile/revolver.dm @@ -12,6 +12,7 @@ ammo_type = /obj/item/ammo_casing/pistol/magnum mag_insert_sound = 'sound/weapons/guns/interaction/rev_magin.ogg' mag_remove_sound = 'sound/weapons/guns/interaction/rev_magout.ogg' + fire_sound = 'sound/weapons/gunshot/gunshot_strong.ogg' accuracy = 2 accuracy_power = 8 one_hand_penalty = 2 @@ -52,6 +53,7 @@ safety_icon = "medium_safety" caliber = CALIBER_PISTOL ammo_type = /obj/item/ammo_casing/pistol + fire_sound = 'sound/weapons/gunshot/gunshot_pistol.ogg' desc = "The Lumoco Arms' Solid is a rugged revolver for people who don't keep their guns well-maintained." accuracy = 1 bulk = 0 @@ -64,6 +66,7 @@ item_state = "pistol" caliber = CALIBER_PISTOL_SMALL ammo_type = /obj/item/ammo_casing/pistol/small + fire_sound = 'sound/weapons/gunshot/gunshot_pistol.ogg' w_class = ITEM_SIZE_SMALL accuracy = 1 one_hand_penalty = 0 @@ -74,6 +77,7 @@ name = "cap gun" desc = "Looks almost like the real thing! Ages 8 and up." icon_state = "revolver-toy" + fire_sound = 'sound/weapons/gunshot/gunshot.ogg' caliber = CALIBER_CAPS origin_tech = list(TECH_COMBAT = 1, TECH_MATERIAL = 1) ammo_type = /obj/item/ammo_casing/cap diff --git a/code/modules/projectiles/guns/projectile/shotgun.dm b/code/modules/projectiles/guns/projectile/shotgun.dm index e248e1c1bf88f..1f5a969eb38bd 100644 --- a/code/modules/projectiles/guns/projectile/shotgun.dm +++ b/code/modules/projectiles/guns/projectile/shotgun.dm @@ -1,3 +1,9 @@ +/obj/item/gun/projectile/shotgun + abstract_type = /obj/item/gun/projectile/shotgun + name = "master shotgun object" + desc = "You should not see this." + fire_sound = 'sound/weapons/gunshot/shotgun.ogg' + /obj/item/gun/projectile/shotgun/pump name = "shotgun" desc = "A mass-produced shotgun by Mars Security Industries. The rugged ZX-870 'Bulldog' is common throughout most frontier worlds. Useful for sweeping alleys or ship corridors." @@ -171,56 +177,6 @@ wielded_item_state = "rshotgun-wielded" load_sound = 'sound/weapons/guns/interaction/shotgun_instert.ogg' -/obj/item/gun/projectile/shotgun/pump/sawn/attack_self(mob/living/user) - if(world.time >= recentpump + 10) - if(!is_held_twohanded(user)) - var/fail_chance = user.skill_fail_chance(SKILL_WEAPONS, 90, SKILL_EXPERIENCED, 0.25) - var/drop_chance = user.skill_fail_chance(SKILL_WEAPONS, 50, SKILL_EXPERIENCED, 0.5) - - if (!fail_chance) - user.visible_message( - SPAN_NOTICE("\The [user] racks \the [src] with one hand."), - SPAN_NOTICE("You manage to rack \the [src] with one hand.") - ) - pump(user) - else if (prob(fail_chance)) - if (prob(drop_chance) && user.unEquip(src, user.loc)) - user.visible_message( - SPAN_WARNING("\The [user] attempts to rack \the [src], but it falls out of their hands!"), - SPAN_WARNING("You attempt to rack \the [src], but it falls out of your hands!") - ) - else - user.visible_message( - SPAN_WARNING("\The [user] fails to rack \the [src]!"), - SPAN_WARNING("You fail to rack \the [src]!") - ) - else - user.visible_message( - SPAN_NOTICE("\The [user] manages to akwardly rack \the [src] with one hand."), - SPAN_NOTICE("You manage to awkwardly rack \the [src] with one hand.") - ) - pump(user) - - else - pump(user) - recentpump = world.time + 1 SECOND - -/obj/item/gun/projectile/shotgun/pump/sawn/proc/pumpr(mob/living/user) - playsound(user, 'sound/weapons/shotgunpump.ogg', 60, 1) - - if(chambered)//We have a shell in the chamber - chambered.dropInto(loc)//Eject casing - if(length(chambered.fall_sounds)) - playsound(loc, pick(chambered.fall_sounds), 50, 1) - chambered = null - - if(length(loaded)) - var/obj/item/ammo_casing/AC = loaded[1] //load next casing. - loaded -= AC //Remove casing from loaded list. - chambered = AC - - update_icon() - /obj/item/gun/projectile/shotgun/pump/combat name = "combat shotgun" @@ -374,6 +330,7 @@ origin_tech = list(TECH_COMBAT = 3, TECH_MATERIAL = 1) auto_eject = TRUE auto_eject_sound = 'sound/weapons/smg_empty_alarm.ogg' + fire_sound = 'sound/weapons/gunshot/shotgun.ogg' one_hand_penalty = 8 bulk = GUN_BULK_RIFLE burst_delay = 2 diff --git a/code/modules/projectiles/guns/projectile/sniper.dm b/code/modules/projectiles/guns/projectile/sniper.dm index 9790f9dce90f3..cecfb6fbe118c 100644 --- a/code/modules/projectiles/guns/projectile/sniper.dm +++ b/code/modules/projectiles/guns/projectile/sniper.dm @@ -114,6 +114,7 @@ scope_zoom = 0 scoped_accuracy = 0 wielded_item_state = "boltaction-wielded" + fire_sound = 'sound/weapons/gunshot/gunshot3.ogg' /obj/item/gun/projectile/sniper/panther //semi-automatic only name = "marksman rifle" @@ -140,6 +141,7 @@ wielded_item_state = "dmr-wielded" mag_insert_sound = 'sound/weapons/guns/interaction/ltrifle_magin.ogg' mag_remove_sound = 'sound/weapons/guns/interaction/ltrifle_magout.ogg' + fire_sound = 'sound/weapons/gunshot/gunshot3.ogg' /obj/item/gun/projectile/sniper/panther/on_update_icon() if(ammo_magazine) @@ -171,6 +173,7 @@ wielded_item_state = "garand-wielded" mag_insert_sound = 'sound/weapons/guns/interaction/ltrifle_magin.ogg' mag_remove_sound = 'sound/weapons/guns/interaction/garand_magout.ogg' + fire_sound = 'sound/weapons/gunshot/gunshot3.ogg' /obj/item/gun/projectile/sniper/garand/on_update_icon() if(ammo_magazine && length(ammo_magazine.stored_ammo)) @@ -199,6 +202,7 @@ max_shells = 10 accuracy = 1 wielded_item_state = "semistrip-wielded" + fire_sound = 'sound/weapons/gunshot/gunshot_strong.ogg' /obj/item/gun/projectile/sniper/semistrip/on_update_icon() if(ammo_magazine && length(ammo_magazine.stored_ammo)) diff --git a/code/modules/projectiles/guns/projectile/zipgun.dm b/code/modules/projectiles/guns/projectile/zipgun.dm index 2018e0ca57a3c..9395a11bff7a6 100644 --- a/code/modules/projectiles/guns/projectile/zipgun.dm +++ b/code/modules/projectiles/guns/projectile/zipgun.dm @@ -32,6 +32,12 @@ var/obj/item/ammo_casing/ammo = pick(ammo_types) caliber = initial(ammo.caliber) desc += " Uses [caliber] rounds." + if(caliber == CALIBER_SHOTGUN) + fire_sound = 'sound/weapons/gunshot/shotgun.ogg' + if(caliber == CALIBER_PISTOL) + fire_sound = 'sound/weapons/gunshot/gunshot_pistol.ogg' + if(caliber == CALIBER_RIFLE || caliber == CALIBER_RIFLE_MILITARY) + fire_sound = 'sound/weapons/gunshot/gunshot3.ogg' . = ..() /obj/item/gun/projectile/pirate/unloaded diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index cb5daa77e74e9..28fad08794abf 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -173,7 +173,7 @@ original = target def_zone = target_zone - addtimer(new Callback(src, .proc/finalize_launch, curloc, targloc, x_offset, y_offset, angle_offset),0) + addtimer(new Callback(src, PROC_REF(finalize_launch), curloc, targloc, x_offset, y_offset, angle_offset),0) return 0 /obj/item/projectile/proc/launch_from_mob(atom/target, mob/user, target_zone, x_offset = 0, y_offset = 0, angle_offset = 0) diff --git a/code/modules/projectiles/projectile/beams.dm b/code/modules/projectiles/projectile/beams.dm index 54396c396018b..3cf5d2d2c4d94 100644 --- a/code/modules/projectiles/projectile/beams.dm +++ b/code/modules/projectiles/projectile/beams.dm @@ -161,7 +161,7 @@ name = "emitter beam" icon_state = "emitter" fire_sound = 'sound/weapons/emitter.ogg' - damage = 0 // The actual damage is computed in /code/modules/power/singularity/emitter.dm + damage = 0 // The actual damage is computed in `/obj/machinery/power/emitter/proc/get_emitter_damage()` muzzle_type = /obj/projectile/laser/emitter/muzzle tracer_type = /obj/projectile/laser/emitter/tracer diff --git a/code/modules/projectiles/projectile/bullets.dm b/code/modules/projectiles/projectile/bullets.dm index afe2c3e6d3915..8642989a60cea 100644 --- a/code/modules/projectiles/projectile/bullets.dm +++ b/code/modules/projectiles/projectile/bullets.dm @@ -1,7 +1,7 @@ /obj/item/projectile/bullet name = "bullet" icon_state = "bullet" - fire_sound = 'sound/weapons/gunshot/gunshot_strong.ogg' + fire_sound = null damage = 50 damage_type = DAMAGE_BRUTE damage_flags = DAMAGE_FLAG_BULLET | DAMAGE_FLAG_SHARP @@ -11,7 +11,7 @@ var/mob_passthrough_check = 0 var/is_pellet = FALSE - muzzle_type = /obj/projectile/bullet/muzzle + muzzle_type = /obj/projectile/bullet miss_sounds = list('sound/weapons/guns/miss1.ogg','sound/weapons/guns/miss2.ogg','sound/weapons/guns/miss3.ogg','sound/weapons/guns/miss4.ogg') ricochet_sounds = list('sound/weapons/guns/ricochet1.ogg', 'sound/weapons/guns/ricochet2.ogg', 'sound/weapons/guns/ricochet3.ogg', 'sound/weapons/guns/ricochet4.ogg') @@ -125,7 +125,6 @@ /* short-casing projectiles, like the kind used in pistols or SMGs */ /obj/item/projectile/bullet/pistol - fire_sound = 'sound/weapons/gunshot/gunshot_pistol.ogg' damage = 45 distance_falloff = 3 @@ -135,7 +134,6 @@ distance_falloff = 4 /obj/item/projectile/bullet/pistol/strong - fire_sound = 'sound/weapons/gunshot/gunshot_strong.ogg' damage = 50 penetration_modifier = 0.8 distance_falloff = 2.5 @@ -154,7 +152,6 @@ //4mm. Tiny, very low damage, does not embed, but has very high penetration. Only to be used for the experimental SMG. /obj/item/projectile/bullet/flechette - fire_sound = 'sound/weapons/gunshot/gunshot_4mm.ogg' damage = 23 penetrating = 1 armor_penetration = 40 @@ -165,7 +162,6 @@ /obj/item/projectile/bullet/shotgun name = "slug" - fire_sound = 'sound/weapons/gunshot/shotgun.ogg' damage = 65 armor_penetration = 10 @@ -183,7 +179,6 @@ /obj/item/projectile/bullet/pellet/shotgun name = "shrapnel" icon_state = "pellet" - fire_sound = 'sound/weapons/gunshot/shotgun.ogg' damage = 30 pellets = 6 range_step = 1 @@ -192,7 +187,6 @@ /obj/item/projectile/bullet/pellet/shotgun/flechette name = "flechette" icon_state = "flechette" - fire_sound = 'sound/weapons/gunshot/shotgun.ogg' damage = 30 armor_penetration = 25 pellets = 3 @@ -205,14 +199,12 @@ /* "Rifle" rounds */ /obj/item/projectile/bullet/rifle - fire_sound = 'sound/weapons/gunshot/gunshot3.ogg' damage = 45 armor_penetration = 25 penetrating = 1 distance_falloff = 1 /obj/item/projectile/bullet/rifle/military - fire_sound = 'sound/weapons/gunshot/gunshot2.ogg' damage = 40 armor_penetration = 35 @@ -291,3 +283,9 @@ pixel_x = rand(-10,10) pixel_y = rand(-10,10) ..() + +/obj/item/projectile/bullet/pistol/fast + fire_sound = 'sound/weapons/gunshot/gunshot_smg.ogg' + damage = 45 //4.6x30 mm, 5.7x28 mm + armor_penetration = 7.5 + distance_falloff = 2 diff --git a/code/modules/projectiles/projectile/energy.dm b/code/modules/projectiles/projectile/energy.dm index e7edf7285761c..25416faf7cab5 100644 --- a/code/modules/projectiles/projectile/energy.dm +++ b/code/modules/projectiles/projectile/energy.dm @@ -15,7 +15,7 @@ damage = 5 agony = 20 life_span = 15 //if the shell hasn't hit anything after travelling this far it just explodes. - muzzle_type = /obj/projectile/bullet/muzzle + muzzle_type = /obj/projectile/bullet var/flash_range = 1 var/brightness = 7 var/light_colour = "#ffffff" diff --git a/code/modules/projectiles/projectile/special.dm b/code/modules/projectiles/projectile/special.dm index 06b70209c32c4..536d227903052 100644 --- a/code/modules/projectiles/projectile/special.dm +++ b/code/modules/projectiles/projectile/special.dm @@ -73,12 +73,13 @@ var/mob/living/M = target if(ishuman(target)) var/mob/living/carbon/human/H = M + var/datum/pronouns/pronouns = M.choose_from_pronouns() if((H.species.species_flags & SPECIES_FLAG_IS_PLANT) && (H.nutrition < 500)) if(prob(15)) H.apply_damage((rand(30,80)), DAMAGE_RADIATION, damage_flags = DAMAGE_FLAG_DISPERSED) H.Weaken(5) for (var/mob/V in viewers(src)) - V.show_message(SPAN_WARNING("[M] writhes in pain as \his vacuoles boil."), 3, SPAN_WARNING("You hear the crunching of leaves."), 2) + V.show_message(SPAN_WARNING("\The [M] writhes in pain as [pronouns.his] vacuoles boil."), 3, SPAN_WARNING("You hear the crunching of leaves."), 2) if(prob(35)) if(prob(80)) randmutb(M) @@ -139,7 +140,7 @@ nodamage = TRUE damage_type = DAMAGE_PAIN damage_flags = 0 - muzzle_type = /obj/projectile/bullet/muzzle + muzzle_type = /obj/projectile/bullet /obj/item/projectile/bola name = "bola" diff --git a/code/modules/projectiles/targeting/targeting_overlay.dm b/code/modules/projectiles/targeting/targeting_overlay.dm index 75a6e111bbb39..b89e259a21de9 100644 --- a/code/modules/projectiles/targeting/targeting_overlay.dm +++ b/code/modules/projectiles/targeting/targeting_overlay.dm @@ -204,9 +204,9 @@ locked = 0 update_icon() lock_time = world.time + 35 - GLOB.moved_event.register(owner, src, /obj/aiming_overlay/proc/update_aiming) - GLOB.moved_event.register(aiming_at, src, /obj/aiming_overlay/proc/target_moved) - GLOB.destroyed_event.register(aiming_at, src, /obj/aiming_overlay/proc/cancel_aiming) + GLOB.moved_event.register(owner, src, TYPE_PROC_REF(/obj/aiming_overlay, update_aiming)) + GLOB.moved_event.register(aiming_at, src, TYPE_PROC_REF(/obj/aiming_overlay, target_moved)) + GLOB.destroyed_event.register(aiming_at, src, TYPE_PROC_REF(/obj/aiming_overlay, cancel_aiming)) /obj/aiming_overlay/on_update_icon() if(locked) diff --git a/code/modules/projectiles/targeting/targeting_triggers.dm b/code/modules/projectiles/targeting/targeting_triggers.dm index 0a1c70b8d916a..8fbdf283528b7 100644 --- a/code/modules/projectiles/targeting/targeting_triggers.dm +++ b/code/modules/projectiles/targeting/targeting_triggers.dm @@ -23,7 +23,7 @@ if (!istype(G)) return if (owner == aiming_at) - addtimer(new Callback(G, /obj/item/gun/proc/handle_suicide, owner, 2)) + addtimer(new Callback(G, TYPE_PROC_REF(/obj/item/gun, handle_suicide), owner, 2)) return if (prob(owner.skill_fail_chance(SKILL_WEAPONS, 30, SKILL_TRAINED, 3))) to_chat(owner, SPAN_WARNING("You fumble with the gun, throwing your aim off!")) diff --git a/code/modules/psionics/equipment/psipower_tk.dm b/code/modules/psionics/equipment/psipower_tk.dm index f238cb00928e5..6fef9a45f0561 100644 --- a/code/modules/psionics/equipment/psipower_tk.dm +++ b/code/modules/psionics/equipment/psipower_tk.dm @@ -78,7 +78,7 @@ sparkle() if(!istype(target, /turf) && istype(focus,/obj/item) && target.Adjacent(focus)) var/obj/item/I = focus - var/resolved = target.attackby(I, user, user:get_organ_target()) + var/resolved = I.resolve_attackby(target, user) if(!resolved && target && I) I.afterattack(target,user,1) // for splashing with beakers else diff --git a/code/modules/psionics/faculties/energistics.dm b/code/modules/psionics/faculties/energistics.dm index d51cfe96807f8..479d383b3b18f 100644 --- a/code/modules/psionics/faculties/energistics.dm +++ b/code/modules/psionics/faculties/energistics.dm @@ -106,7 +106,8 @@ if(.) if(istype(target,/obj/item/clothing/mask/smokable/cigarette)) var/obj/item/clothing/mask/smokable/cigarette/S = target - S.light("[user] snaps \his fingers and \the [S.name] lights up.") + var/datum/pronouns/pronouns = user.choose_from_pronouns() + S.light("\The [user] snaps [pronouns.his] fingers and \the [S.name] lights up.") playsound(S.loc, "sparks", 50, 1) else var/datum/effect/spark_spread/sparks = new () diff --git a/code/modules/reagents/Chemistry-Grinder.dm b/code/modules/reagents/Chemistry-Grinder.dm index b1018ef615e5f..4c4bc13ab8d90 100644 --- a/code/modules/reagents/Chemistry-Grinder.dm +++ b/code/modules/reagents/Chemistry-Grinder.dm @@ -72,7 +72,7 @@ grinding = TRUE update_icon() - addtimer(new Callback(src, .proc/reset_machine, user), grind_time) + addtimer(new Callback(src, PROC_REF(reset_machine), user), grind_time) var/skill_multiplier = CLAMP01(0.5 + (user.get_skill_value(skill) - 1) * 0.167) for (var/obj/item/I in items) if (container.reagents.total_volume >= container.reagents.maximum_volume) diff --git a/code/modules/reagents/Chemistry-Reagents.dm b/code/modules/reagents/Chemistry-Reagents.dm index 28dfbd72aae46..503650efed85d 100644 --- a/code/modules/reagents/Chemistry-Reagents.dm +++ b/code/modules/reagents/Chemistry-Reagents.dm @@ -38,6 +38,10 @@ var/glass_desc = "It's a glass of... what, exactly?" var/list/glass_special = null // null equivalent to list() + var/condiment_icon_state + var/condiment_name + var/condiment_desc + // GAS DATA, generic values copied from base XGM datum type. var/gas_specific_heat = 20 var/gas_molar_mass = 0.032 diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Dispenser.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Dispenser.dm index 3762a30055edf..d499c5eefd7d2 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Dispenser.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Dispenser.dm @@ -431,6 +431,10 @@ glass_icon = DRINK_ICON_NOISY value = DISPENSER_REAGENT_VALUE + condiment_name = "sugar sack" + condiment_desc = "Cavities in a bag." + condiment_icon_state = "sugar" + /datum/reagent/sugar/affect_blood(mob/living/carbon/human/M, removed) handle_sugar(M, src) M.adjust_nutrition(removed * 3) diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Drinks.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Drinks.dm index d3db451086ccd..7c8127b935b79 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Drinks.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Drinks.dm @@ -497,6 +497,15 @@ glass_name = "hot chocolate" glass_desc = "Made with love! And cocoa beans." +/datum/reagent/drink/hot_coco/ntella + name = "NTella Hot Chocolate" + description = "It's like a cup of hot chocolate except... More everything." + color = "#63432e" + taste_description = "hazelnutty, creamy chocolate" + + glass_name = "NTella hot chocolate" + glass_desc = "A very chocolatey drink for the days so rough, so cold, or so celebratory that a regular hot chocolate just won't cut it. It has marshmallows!" + /datum/reagent/drink/sodawater name = "Soda Water" description = "A can of club soda. Why not make a scotch and soda?" @@ -533,6 +542,7 @@ glass_name = "tonic water" glass_desc = "Quinine tastes funny, but at least it'll keep that Space Malaria away." + glass_special = list(DRINK_FIZZ) /datum/reagent/drink/lemonade name = "Lemonade" @@ -634,6 +644,15 @@ glass_name = "milkshake" glass_desc = "Glorious brainfreezing mixture." +/datum/reagent/drink/milkshake/ntella + name = "NTella Milkshake" + description = "An intensely sweet chocolatey concoction with whipped cream on top." + color = "#6d4124" + taste_description = "overwhelmingly sweet chocolate" + + glass_name = "NTella milkshake" + glass_desc = "Oh look, it's that thing you actually want to get but probably shouldn't." + /datum/reagent/drink/rewriter name = "Rewriter" description = "The secret of the sanctuary of the Libarian..." @@ -723,6 +742,7 @@ glass_name = "Dr. Gibb" glass_desc = "Dr. Gibb. Not as dangerous as the name might imply." + glass_special = list(DRINK_FIZZ) /datum/reagent/drink/space_up name = "Space-Up" @@ -774,14 +794,14 @@ taste_description = "dry and cheap noodles" reagent_state = SOLID nutrition = 1 - color = "#302000" + color = "#dec85d" /datum/reagent/drink/hot_ramen name = "Hot Ramen" description = "The noodles are boiled, the flavors are artificial, just like being back in school." taste_description = "wet and cheap noodles" reagent_state = LIQUID - color = "#302000" + color = "#c28f19" nutrition = 5 adj_temp = 5 @@ -790,7 +810,7 @@ description = "The noodles are boiled, the flavors are artificial, just like being back in school." taste_description = "wet and cheap noodles on fire" reagent_state = LIQUID - color = "#302000" + color = "#c93f04" nutrition = 5 /datum/reagent/drink/hell_ramen/affect_ingest(mob/living/carbon/M, removed) @@ -836,9 +856,11 @@ name = "Ginger Beer" description = "A hearty, non-alcoholic beverage extremely popular around the SCG." taste_description = "carbonated ginger" - color = "#44371f" + color = "#f5f3c6" + glass_name = "ginger beer" glass_desc = "A hearty, non-alcoholic beverage extremely popular around the SCG." + glass_special = list(DRINK_FIZZ) /datum/reagent/drink/beastenergy name = "Beast Energy" @@ -919,7 +941,7 @@ /datum/reagent/cinnamon name = "Cinnamon" - description = "Delicious ground cinnamon spice. " + description = "Delicious ground cinnamon spice." taste_description = "cinnamon" reagent_state = SOLID color = "#cd6139" @@ -928,6 +950,9 @@ glass_name = "cinnamon" glass_desc = "Delicious ground cinnamon spice, why would you drink this?" + condiment_icon_state = "cinnamonbottle" + condiment_name = "bottle of cinnamon" + /datum/reagent/oliveoil name = "Olive Oil" description = "Olive oil, an essential part of cooking." @@ -937,6 +962,10 @@ glass_name = "olive oil" glass_desc = "Oily." + condiment_icon_state = "oliveoil" + condiment_name = "olive oil" + condiment_desc = "Used in food preparation and flavoring." + /datum/reagent/drink/affelerin name = "Affelerin Nectar" description = "A thick syrup-like nectar from the Affelerin, common across many desert worlds." @@ -1060,6 +1089,7 @@ glass_name = "Dandelion and Burdock" glass_desc = "A tall glass of DnB" + glass_special = list(DRINK_FIZZ) /datum/reagent/drink/doogh name = "Doogh" @@ -1184,7 +1214,7 @@ name = "Green Tea" description = "Subtle green tea, it has antioxidants, it's good for you!" taste_description = "subtle green tea" - color = "#b4cd94" + color = "#8bbf49" glass_name = "green tea" glass_desc = "Subtle green tea, it has antioxidants, it's good for you!" @@ -1193,7 +1223,7 @@ name = "Iced Green Tea" description = "It's the green tea you know and love, but now it's cold." taste_description = "cold green tea" - color = "#b4cd94" + color = "#8bbf49" glass_name = "iced green tea" glass_desc = "It's the green tea you know and love, but now it's cold." @@ -1202,7 +1232,7 @@ name = "Sweet Green Tea" description = "It's the green tea you know and love, but now it's cold. And sweet." taste_description = "sweet green tea" - color = "#b4cd94" + color = "#8bbf49" glass_name = "sweet green tea" glass_desc = "It's the green tea you know and love, but now it's cold. And sweet." diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Food.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Food.dm index 38eceee4c4c96..2e3c3654f12be 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Food.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Food.dm @@ -61,9 +61,12 @@ name = "Glucose" color = "#ffffff" scannable = 1 - injectable = 1 +/datum/reagent/nutriment/glucose/adjust_nutrition(mob/living/carbon/M, removed) + M.adjust_nutrition(nutriment_factor * removed) + M.adjust_hydration(hydration_factor * removed) + /datum/reagent/nutriment/protein // Bad for Skrell! name = "Animal Protein" taste_description = "some sort of protein" @@ -82,6 +85,10 @@ taste_description = "egg" color = "#ffffaa" + condiment_icon_state = "eggyolk" + condiment_name = "egg yolk carton" + condiment_desc = "A carton full of egg yolk." + //vegetamarian alternative that is safe for skrell to ingest//rewired it from its intended nutriment/protein/egg/softtofu because it would not actually work, going with plan B, more recipes. /datum/reagent/nutriment/softtofu @@ -98,6 +105,10 @@ color = "#ffff00" sugar_amount = 1 + condiment_icon_state = "honey" + condiment_name = "honey" + condiment_desc = "A jar of sweet and viscous honey." + /datum/reagent/nutriment/flour name = "flour" description = "This is what you rub all over yourself to pretend to be a ghost." @@ -106,6 +117,10 @@ nutriment_factor = 1 color = "#ffffff" + condiment_icon_state = "flour" + condiment_name = "flour sack" + condiment_desc = "A big bag of flour. Good for baking!" + /datum/reagent/nutriment/flour/touch_turf(turf/simulated/T) if(istype(T)) new /obj/decal/cleanable/flour(T) @@ -123,6 +138,10 @@ color = "#ffd592" protein_amount = 0.4 + condiment_icon_state = "batter" + condiment_name = "batter mix" + condiment_desc = "A gooey mixture of eggs and flour in a vat. Delicious!" + /datum/reagent/nutriment/batter/touch_turf(turf/simulated/T) if(!istype(T, /turf/space)) new /obj/decal/cleanable/pie_smudge(T) @@ -133,11 +152,13 @@ /datum/reagent/nutriment/batter/cakebatter name = "Cake Batter" - description = "A gooey mixture of eggs, flour and sugar, a important precursor to cake!" + description = "A gooey mixture of eggs, flour and sugar, an important precursor to cake!" taste_description = "sweetness" color = "#ffe992" protein_amount = 0.3 + condiment_name = "cake batter mix" + /datum/reagent/nutriment/coffee name = "Coffee Powder" description = "A bitter powder made by grinding coffee beans." @@ -146,10 +167,16 @@ nutriment_factor = 1 color = "#482000" + condiment_icon_state = "coffee" + condiment_name = "coffee powder" + /datum/reagent/nutriment/coffee/instant name = "Instant Coffee Powder" description = "A bitter powder made by processing coffee beans." + condiment_name = "instant coffee powder" + condiment_desc = "A sack of instant coffee powder, now 50% more caffeinated!" + /datum/reagent/nutriment/tea name = "Tea Powder" description = "A dark, tart powder made from black tea leaves." @@ -158,18 +185,28 @@ nutriment_factor = 1 color = "#101000" + condiment_icon_state = "tea" + condiment_name = "tea powder" + /datum/reagent/nutriment/tea/instant name = "Instant Tea Powder" + condiment_name = "instant tea powder" + condiment_desc = "A sack of instant tea powder, now 50% less caffeinated!" + /datum/reagent/nutriment/coco - name = "Coco Powder" - description = "A fatty, bitter paste made from coco beans." + name = "Cocoa Powder" + description = "A fatty, bitter paste made from cocoa beans." taste_description = "bitterness" taste_mult = 1.3 reagent_state = SOLID nutriment_factor = 5 color = "#302000" + condiment_icon_state = "cocoapowder" + condiment_name = "cocoa powder" + condiment_desc = "A can full of chocolately powder. Not very tasty by itself." + /datum/reagent/nutriment/instantjuice name = "Juice Powder" description = "Dehydrated, powdered juice of some kind." @@ -207,7 +244,11 @@ taste_mult = 1.1 reagent_state = LIQUID nutriment_factor = 2 + color = "#792300" + condiment_icon_state = "soysauce" + condiment_name = "soy sauce" + condiment_desc = "A dark, salty, savoury flavoring." /datum/reagent/nutriment/ketchup name = "Ketchup" @@ -217,6 +258,10 @@ nutriment_factor = 5 color = "#731008" + condiment_icon_state = "ketchup" + condiment_name = "ketchup" + condiment_desc = "Tomato, but more liquid, stronger, better." + /datum/reagent/nutriment/barbecue name = "Barbecue Sauce" description = "Barbecue sauce for barbecues and long shifts." @@ -225,6 +270,10 @@ nutriment_factor = 5 color = "#4f330f" + condiment_icon_state = "barbecue" + condiment_name = "barbecue sauce" + condiment_desc = "A bottle of barbecue sauce. It's labeled 'sweet and spicy'." + /datum/reagent/nutriment/garlicsauce name = "Garlic Sauce" description = "Garlic sauce, perfect for spicing up a plate of garlic." @@ -233,6 +282,10 @@ nutriment_factor = 4 color = "#d8c045" + condiment_icon_state = "garlic_sauce" + condiment_name = "garlic sauce" + condiment_desc = "Perfect for repelling vampires and/or potential dates." + /datum/reagent/nutriment/rice name = "Rice" description = "Enjoy the great taste of nothing." @@ -242,6 +295,10 @@ nutriment_factor = 1 color = "#ffffff" + condiment_icon_state = "rice" + condiment_name = "rice sack" + condiment_desc = "A big bag of rice for cooking." + /datum/reagent/nutriment/rice/chazuke name = "Chazuke" description = "Green tea over rice. How rustic!" @@ -260,6 +317,10 @@ nutriment_factor = 1 color = "#801e28" + condiment_icon_state = "jellyjar" + condiment_name = "cherry jelly jar" + condiment_desc = "Great with peanut butter!" + /datum/reagent/nutriment/cornoil name = "Corn Oil" description = "An oil derived from various types of corn." @@ -267,7 +328,11 @@ taste_mult = 0.1 reagent_state = LIQUID nutriment_factor = 20 - color = "#302000" + color = "#c9bb1e" + + condiment_icon_state = "cooking_oil" + condiment_name = "corn oil" + condiment_desc = "A delicious oil used in cooking. Made from corn." /datum/reagent/nutriment/cornoil/touch_turf(turf/simulated/T) if(!istype(T)) @@ -291,6 +356,9 @@ nutriment_factor = 1 color = "#ff00ff" + condiment_icon_state = "sprinklesbottle" + condiment_name = "bottle of sprinkles" + /datum/reagent/nutriment/mint name = "Mint" description = "Also known as Mentha." @@ -298,6 +366,10 @@ reagent_state = LIQUID color = "#07aab2" + condiment_icon_state = "mint_syrup" + condiment_name = "mint essential oil" + condiment_desc = "A small bottle of the essential oil of some kind of mint plant." + /datum/reagent/lipozine // The anti-nutriment. name = "Lipozine" description = "A chemical compound that causes a powerful fat-burning reaction." @@ -321,6 +393,10 @@ overdose = REAGENTS_OVERDOSE value = 0.11 + condiment_icon_state = "saltshaker" + condiment_name = "salt shaker" + condiment_desc = "Salt. From space oceans, presumably." + /datum/reagent/blackpepper name = "Black Pepper" description = "A powder ground from peppercorns. *AAAACHOOO*" @@ -329,6 +405,10 @@ color = "#000000" value = 0.1 + condiment_icon_state = "peppermill" + condiment_name = "pepper shaker" + condiment_desc = "Often used to flavor food or make people sneeze." + /datum/reagent/enzyme name = "Universal Enzyme" description = "A universal enzyme used in the preperation of certain chemicals and foods." @@ -339,6 +419,10 @@ overdose = REAGENTS_OVERDOSE value = 0.2 + condiment_icon_state = "enzyme" + condiment_name = "universal enzyme" + condiment_desc = "Used in cooking various dishes." + /datum/reagent/frostoil name = "Chilly Oil" description = "An oil harvested from a mutant form of chili peppers, it has a chilling effect on the body." @@ -348,6 +432,10 @@ color = "#07aab2" value = 0.2 + condiment_icon_state = "coldsauce" + condiment_name = "cold sauce" + condiment_desc = "Leaves the tongue numb in its passage." + /datum/reagent/frostoil/affect_blood(mob/living/carbon/M, removed) if (IS_METABOLICALLY_INERT(M)) return @@ -371,6 +459,10 @@ var/slime_temp_adj = 10 value = 0.2 + condiment_icon_state= "hotsauce" + condiment_name = "hot sauce" + condiment_desc = "You can almost TASTE the stomach ulcers now!" + /datum/reagent/capsaicin/affect_blood(mob/living/carbon/M, removed) if (IS_METABOLICALLY_INERT(M)) return @@ -501,3 +593,53 @@ color = "#efede8" taste_mult = 2 protein_amount = 0.7 + + condiment_icon_state = "mayonnaise" + condiment_name = "mayonnaise" + condiment_desc = "Mayonnaise, used for centuries to make things edible." + +/datum/reagent/nutriment/groundpeanuts + name = "Ground Peanuts" + description = "Roughly ground peanuts." + taste_description = "peanut" + reagent_state = SOLID + color = "#ad7937" + taste_mult = 2 + + condiment_icon_state = "peanut" + condiment_name = "sack of ground peanuts" + condiment_desc = "A sack full of crunchy ground peanuts." + +/datum/reagent/nutriment/peanutbutter + name = "Peanut Butter" + description = "Clearer the better spread, exception for those who are deathly allergic." + taste_description = "peanut butter" + reagent_state = LIQUID + color = "#ad7937" + taste_mult = 2 + sugar_amount = 0.1 + + condiment_icon_state = "pbjar" + condiment_name = "peanut butter jar" + condiment_desc = "Great with jelly!" + +/datum/reagent/nutriment/almondmeal + name = "Almond Meal" + description = "Finely ground almonds." + taste_description = "nuts" + reagent_state = SOLID + color = "#c9a275" + taste_mult = 2 + +/datum/reagent/nutriment/choconutspread + name = "Choco-Nut Spread" + description = "Creamy chocolate spread with a nutty undertone." + taste_description = "nutty chocolate" + reagent_state = LIQUID + color = "#2c1000" + taste_mult = 2 + sugar_amount = 0.5 + + condiment_name = "NTella jar" + condiment_desc = "Originally called 'Entella', it was rebranded after being bought by NanoTrasen. Some humans insist this nutty chocolate spread might be the best thing they've ever created." + condiment_icon_state = "NTellajar" \ No newline at end of file diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm index 48178fb4ac556..fdd91d6c6ee5c 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm @@ -75,39 +75,60 @@ /datum/reagent/toxin/amaspores name = "Amaspores" - description = "The secondary component to amatoxin poisoning, remaining dormant for a time before causing rapid organ and tissue decay." + description = "The secondary component to amatoxin poisoning, remaining dormant for a time before causing the victim to rapidly vomit blood from the mouth, causing massive blood loss." taste_description = "dusty dirt" reagent_state = LIQUID - metabolism = REM * 4 // Extremely quick to act once the amatoxin has left the body + var/next_symptom = 10 + metabolism = REM color = "#330e00" strength = 30 /datum/reagent/toxin/amaspores/affect_blood(mob/living/carbon/M, removed) + var/mob/living/carbon/human/target = M if (IS_METABOLICALLY_INERT(M)) return if(M.chem_doses[/datum/reagent/toxin/amatoxin] > 0) M.reagents.add_reagent(/datum/reagent/toxin/amaspores, metabolism) // The spores lay dormant for as long as any traces of amatoxin remain - if (prob(5)) - to_chat(M, SPAN_DANGER("Everything itches, how uncomfortable!")) - if (prob(10)) - to_chat(M, SPAN_WARNING("Your eyes are watering, it's hard to see!")) - M.eye_blurry = max(M.eye_blurry, 10) - if (prob(10)) - to_chat(M, SPAN_DANGER("Your throat itches uncomfortably!")) - M.custom_emote(2, "coughs!") + next_symptom -= 1 + //completely reworks symptoms to be much less obvious and in your face, and not happen every single second. + if(next_symptom == 0) + //mimics symptoms of high exertion. + if(prob(25)) + M.add_chemical_effect(CE_PULSE, 3) + //mimics random pains that can easily be brushed off. + if(prob(20)) + var/obj/item/organ/external/pained_limb = target.get_organ(pick(BP_CHEST)) + pained_limb.add_pain(10) + //mimics symptoms of smoking. + if(prob(25)) + to_chat(M, SPAN_NOTICE("You feel faintly sore in the throat.")) + next_symptom = 10 return - + //this is the stage that kicks in faster, victim starts to rapidly vomit blood and the spores tear their chest open from the inside. M.add_chemical_effect(CE_SLOWDOWN, 1) - + next_symptom -= 1 + if(next_symptom < 1) + var/obj/item/organ/external/organ = target.get_organ(BP_CHEST) + organ.take_external_damage(rand(5,10), 0, EMPTY_BITFIELD, "Amaspore Growth") + if(target.get_blood_volume() == 0) + return + target.remove_blood(rand(20,30)) + to_chat(M, SPAN_DANGER("You can taste blood in your mouth.")) + M.Stun(1) + M.visible_message(SPAN_DANGER("\The [M] violently vomits blood!")) + playsound(M.loc, 'sound/effects/splat.ogg', 50, 1) + if(istype(M.loc, /turf/simulated)) + var/obj/decal/cleanable/blood/blood_vomit = new /obj/decal/cleanable/blood(M.loc) + blood_vomit.update_icon() + next_symptom = 5 if (prob(15)) M.Weaken(5) M.add_chemical_effect(CE_VOICELOSS, 5) if (prob(30)) M.eye_blurry = max(M.eye_blurry, 10) - M.take_organ_damage(3 * removed, 0, ORGAN_DAMAGE_FLESH_ONLY) - M.adjustToxLoss(5 * removed, 0, ORGAN_DAMAGE_FLESH_ONLY) + /datum/reagent/toxin/carpotoxin name = "Carpotoxin" diff --git a/code/modules/reagents/Chemistry-Recipes.dm b/code/modules/reagents/Chemistry-Recipes.dm index fcd2fe2d6323f..b2ad009a9b8d1 100644 --- a/code/modules/reagents/Chemistry-Recipes.dm +++ b/code/modules/reagents/Chemistry-Recipes.dm @@ -1473,6 +1473,12 @@ maximum_temperature = (70 CELSIUS) + 100 mix_message = "The solution thickens into a steaming brown beverage." +/datum/chemical_reaction/ntella_hot_chocolate + name = "NTella hot chocolate" + result = /datum/reagent/drink/hot_coco/ntella + required_reagents = list(/datum/reagent/drink/milk = 1, /datum/reagent/nutriment/choconutspread = 1, /datum/reagent/drink/milk/cream = 1) + result_amount = 3 + /datum/chemical_reaction/grapejuice name = "Grape Juice" result = /datum/reagent/drink/juice/grape @@ -1641,6 +1647,28 @@ result_amount = 6 mix_message = "The broth of the noodles takes on a hellish red gleam." +/datum/chemical_reaction/peanutbutter + name = "Peanut Butter" + result = /datum/reagent/nutriment/peanutbutter + required_reagents = list(/datum/reagent/nutriment/groundpeanuts = 5, /datum/reagent/sugar = 1, /datum/reagent/sodiumchloride = 1) + result_amount = 5 + mix_message = "The solution thickens into a creamy, nutty spread." + +/datum/chemical_reaction/choconutspread + name = "Choco-Nut Spread" + result = /datum/reagent/nutriment/choconutspread + required_reagents = list(/datum/reagent/nutriment/almondmeal = 1, /datum/reagent/sugar = 2, /datum/reagent/nutriment/coco = 1, /datum/reagent/drink/milk/soymilk = 1) + result_amount = 4 + mix_message = "The solution thickens into a creamy, chocolate-y spread." + +/datum/chemical_reaction/sprinkles + name = "Sprinkles" + result = /datum/reagent/nutriment/sprinkles + required_reagents = list(/datum/reagent/sugar = 3, /datum/reagent/drink/syrup_vanilla = 1, /datum/reagent/nutriment/cornoil = 1) + result_amount = 5 + mix_message = "The solution thickens and hardens into sugary sprinkles." + + /* Alcohol */ /datum/chemical_reaction/goldschlager @@ -1715,6 +1743,14 @@ result_amount = 10 mix_message = "The solution roils as it rapidly ferments into a rich red liquid." +/datum/chemical_reaction/whitewine + name = "White Wine" + result = /datum/reagent/ethanol/wine/premium + required_reagents = list(/datum/reagent/drink/juice/grape/white = 10) + catalysts = list(/datum/reagent/enzyme = 5) + result_amount = 10 + mix_message = "The solution roils as it rapidly ferments into a pale gold liquid." + /datum/chemical_reaction/pwine name = "Poison Wine" result = /datum/reagent/ethanol/pwine @@ -2258,6 +2294,12 @@ required_reagents = list(/datum/reagent/drink/milk/cream = 1, /datum/reagent/drink/ice = 2, /datum/reagent/drink/milk = 2) result_amount = 5 +/datum/chemical_reaction/ntella_shake + name = "NTella milkshake" + result = /datum/reagent/drink/milkshake/ntella + required_reagents = list(/datum/reagent/drink/milkshake = 5, /datum/reagent/nutriment/choconutspread = 1) + result_amount = 6 + /datum/chemical_reaction/rewriter name = "Rewriter" result = /datum/reagent/drink/rewriter diff --git a/code/modules/reagents/Chemistry-Sublimator.dm b/code/modules/reagents/Chemistry-Sublimator.dm index c280d79966a10..af6d2ec98ebc0 100644 --- a/code/modules/reagents/Chemistry-Sublimator.dm +++ b/code/modules/reagents/Chemistry-Sublimator.dm @@ -49,8 +49,10 @@ /obj/machinery/portable_atmospherics/reagent_sublimator/New() . = ..() - if(holding) verbs |= /obj/machinery/portable_atmospherics/reagent_sublimator/proc/remove_tank - if(container) verbs |= /obj/machinery/portable_atmospherics/reagent_sublimator/proc/remove_container + if(holding) + verbs |= /obj/machinery/portable_atmospherics/reagent_sublimator/proc/remove_tank + if(container) + verbs |= /obj/machinery/portable_atmospherics/reagent_sublimator/proc/remove_container update_icon() // Coded this before realizing base type didn't support tank mixing, leaving it in just in case someone decides to add it. diff --git a/code/modules/reagents/reagent_containers.dm b/code/modules/reagents/reagent_containers.dm index a5fd51035b1ce..163cf2bdaa02c 100644 --- a/code/modules/reagents/reagent_containers.dm +++ b/code/modules/reagents/reagent_containers.dm @@ -44,7 +44,7 @@ return reagents.get_reagents() return "No reagent holder" -/obj/item/reagent_containers/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/reagent_containers/use_tool(obj/item/W, mob/living/user, list/click_params) if(istype(W, /obj/item/pen) || istype(W, /obj/item/device/flashlight/pen)) var/tmp_label = sanitizeSafe(input(user, "Enter a label for [name]", "Label", label_text), MAX_NAME_LEN) if(length_char(tmp_label) > 10) @@ -53,6 +53,7 @@ to_chat(user, SPAN_NOTICE("You set the label to \"[tmp_label]\".")) label_text = tmp_label update_name_label() + return TRUE else return ..() diff --git a/code/modules/reagents/reagent_containers/borghypo.dm b/code/modules/reagents/reagent_containers/borghypo.dm index f2842eb5a3b58..70237cd96edc1 100644 --- a/code/modules/reagents/reagent_containers/borghypo.dm +++ b/code/modules/reagents/reagent_containers/borghypo.dm @@ -207,7 +207,7 @@ /obj/item/reagent_containers/borghypo/service name = "cyborg drink synthesizer" desc = "A portable drink dispencer." - icon = 'icons/obj/food/drinks.dmi' + icon = 'icons/obj/food/drinks/misc.dmi' icon_state = "shaker" charge_cost = 5 recharge_time = 3 diff --git a/code/modules/reagents/reagent_containers/drinkingglass/drinkingglass.dm b/code/modules/reagents/reagent_containers/drinkingglass/drinkingglass.dm index 0399e0b752ee1..38ea15928277e 100644 --- a/code/modules/reagents/reagent_containers/drinkingglass/drinkingglass.dm +++ b/code/modules/reagents/reagent_containers/drinkingglass/drinkingglass.dm @@ -213,7 +213,7 @@ var/global/const/DRINK_ICON_NOISY = "noise" splashtarget(target, user) return TRUE -/obj/item/reagent_containers/food/drinks/glass2/attackby(obj/item/W, mob/user) +/obj/item/reagent_containers/food/drinks/glass2/use_tool(obj/item/W, mob/living/user, list/click_params) if(istype(W, /obj/item/material/kitchen/utensil/spoon)) if(user.a_intent == I_HURT) user.visible_message(SPAN_WARNING("[user] bashes \the [src] with a spoon, shattering it to pieces! What a rube.")) @@ -222,10 +222,11 @@ var/global/const/DRINK_ICON_NOISY = "noise" user.visible_message(SPAN_NOTICE("The contents of \the [src] splash all over [user]!")) reagents.splash(user, reagents.total_volume) qdel(src) - return + return TRUE user.visible_message(SPAN_NOTICE("[user] gently strikes \the [src] with a spoon, calling the room to attention.")) playsound(src, "sound/items/wineglass.ogg", 65, 1) - else return ..() + return TRUE + return ..() /obj/item/reagent_containers/food/drinks/glass2/ProcessAtomTemperature() var/old_temp = temperature diff --git a/code/modules/reagents/reagent_containers/drinkingglass/extras.dm b/code/modules/reagents/reagent_containers/drinkingglass/extras.dm index be2cceffdf594..1d82aac32e53b 100644 --- a/code/modules/reagents/reagent_containers/drinkingglass/extras.dm +++ b/code/modules/reagents/reagent_containers/drinkingglass/extras.dm @@ -1,28 +1,36 @@ -/obj/item/reagent_containers/food/drinks/glass2/attackby(obj/item/I as obj, mob/user as mob) - if(length(extras) >= 2) return ..() // max 2 extras, one on each side of the drink +/obj/item/reagent_containers/food/drinks/glass2/use_tool(obj/item/I, mob/living/user, list/click_params) + if(length(extras) >= 2) + return ..() // max 2 extras, one on each side of the drink if(istype(I, /obj/item/glass_extra)) var/obj/item/glass_extra/GE = I if(can_add_extra(GE)) extras += GE if(!user.unEquip(GE, src)) - return + FEEDBACK_UNEQUIP_FAILURE(user, GE) + return TRUE to_chat(user, SPAN_NOTICE("You add \the [GE] to \the [src].")) update_icon() + return TRUE else to_chat(user, SPAN_WARNING("There's no space to put \the [GE] on \the [src]!")) + return TRUE + else if(istype(I, /obj/item/reagent_containers/food/snacks/fruit_slice)) if(!rim_pos) to_chat(user, SPAN_WARNING("There's no space to put \the [I] on \the [src]!")) - return + return TRUE var/obj/item/reagent_containers/food/snacks/fruit_slice/FS = I extras += FS if(!user.unEquip(FS, src)) - return + FEEDBACK_UNEQUIP_FAILURE(user, FS) + return TRUE FS.pixel_x = 0 // Reset its pixel offsets so the icons work! FS.pixel_y = 0 to_chat(user, SPAN_NOTICE("You add \the [FS] to \the [src].")) update_icon() + return TRUE + else return ..() diff --git a/code/modules/reagents/reagent_containers/food/cans.dm b/code/modules/reagents/reagent_containers/food/cans.dm index 44c27b60ef28e..eb6157f2c2e84 100644 --- a/code/modules/reagents/reagent_containers/food/cans.dm +++ b/code/modules/reagents/reagent_containers/food/cans.dm @@ -1,8 +1,10 @@ /obj/item/reagent_containers/food/drinks/cans + icon = 'icons/obj/food/drinks/cans.dmi' volume = 40 //just over one and a half cups amount_per_transfer_from_this = 5 atom_flags = 0 //starts closed matter = list(MATERIAL_ALUMINIUM = 30) + drink_offset_y = 10 //DRINKS @@ -22,6 +24,9 @@ icon_state = "waterbottle" center_of_mass = "x=15;y=8" matter = list(MATERIAL_PLASTIC = 40) + filling_states = "-10;10;25;50;75;80;90;100" + base_name = "bottle" + base_icon = "waterbottle" /obj/item/reagent_containers/food/drinks/cans/waterbottle/Initialize() . = ..() @@ -224,7 +229,7 @@ /obj/item/reagent_containers/food/drinks/cans/cola_diet name = "diet space cola" desc = "Cola... in space! Now with extra self-confidence." - icon_state = "cola-blue" + icon_state = "cola-diet" /obj/item/reagent_containers/food/drinks/cans/cola_diet/Initialize() . = ..() @@ -298,7 +303,7 @@ /obj/item/reagent_containers/food/drinks/cans/vanillacola name = "vanilla cola" desc = "Delicious vanilla cola in a can." - icon_state = "vcola" + icon_state = "v-cola" center_of_mass = "x=16;y=6" /obj/item/reagent_containers/food/drinks/cans/vanillacola/Initialize() @@ -308,7 +313,7 @@ /obj/item/reagent_containers/food/drinks/cans/cherrycola name = "cherry cola" desc = "Delicious cherry cola in a can." - icon_state = "ccola" + icon_state = "ch-cola" center_of_mass = "x=16;y=6" /obj/item/reagent_containers/food/drinks/cans/cherrycola/Initialize() @@ -318,7 +323,7 @@ /obj/item/reagent_containers/food/drinks/cans/orangecola name = "orange cola" desc = "Delicious orange cola in a can." - icon_state = "ocola" + icon_state = "o-cola" center_of_mass = "x=16;y=6" /obj/item/reagent_containers/food/drinks/cans/orangecola/Initialize() @@ -328,7 +333,7 @@ /obj/item/reagent_containers/food/drinks/cans/coffeecola name = "coffee cola" desc = "Delicious coffee cola in a can." - icon_state = "ccola" + icon_state = "c-cola" center_of_mass = "x=16;y=6" /obj/item/reagent_containers/food/drinks/cans/coffeecola/Initialize() diff --git a/code/modules/reagents/reagent_containers/food/condiment.dm b/code/modules/reagents/reagent_containers/food/condiment.dm index 5644841e628c4..fe2ca6b5b4fe5 100644 --- a/code/modules/reagents/reagent_containers/food/condiment.dm +++ b/code/modules/reagents/reagent_containers/food/condiment.dm @@ -6,37 +6,30 @@ //Food items that aren't eaten normally and leave an empty container behind. /obj/item/reagent_containers/food/condiment - name = "Condiment Container" + name = "condiment container" desc = "Just your average condiment container." - icon = 'icons/obj/food/food.dmi' - icon_state = "emptycondiment" + icon = 'icons/obj/food/condiment.dmi' + icon_state = "condiment" atom_flags = ATOM_FLAG_OPEN_CONTAINER possible_transfer_amounts = "1;5;10" center_of_mass = "x=16;y=6" volume = 50 var/list/starting_reagents - var/static/list/special_bottles = list( - /datum/reagent/nutriment/ketchup = /obj/item/reagent_containers/food/condiment/ketchup, - /datum/reagent/nutriment/barbecue = /obj/item/reagent_containers/food/condiment/barbecue, - /datum/reagent/capsaicin = /obj/item/reagent_containers/food/condiment/capsaicin, - /datum/reagent/enzyme = /obj/item/reagent_containers/food/condiment/enzyme, - /datum/reagent/nutriment/soysauce = /obj/item/reagent_containers/food/condiment/soysauce, - /datum/reagent/frostoil = /obj/item/reagent_containers/food/condiment/frostoil, - /datum/reagent/sodiumchloride = /obj/item/reagent_containers/food/condiment/small/saltshaker, - /datum/reagent/blackpepper = /obj/item/reagent_containers/food/condiment/small/peppermill, - /datum/reagent/nutriment/cornoil = /obj/item/reagent_containers/food/condiment/cornoil, - /datum/reagent/sugar = /obj/item/reagent_containers/food/condiment/sugar, - /datum/reagent/nutriment/mayo = /obj/item/reagent_containers/food/condiment/mayo, - /datum/reagent/nutriment/vinegar = /obj/item/reagent_containers/food/condiment/vinegar, - /datum/reagent/oliveoil = /obj/item/reagent_containers/food/condiment/small/oliveoil - ) - -/obj/item/reagent_containers/food/condiment/attackby(obj/item/W as obj, mob/user as mob) + var/fixed_state = FALSE + +/obj/item/reagent_containers/food/condiment/Initialize() + . = ..() + for(var/R in starting_reagents) + reagents.add_reagent(R, starting_reagents[R]) + +/obj/item/reagent_containers/food/condiment/use_tool(obj/item/W, mob/living/user, list/click_params) if(istype(W, /obj/item/pen) || istype(W, /obj/item/device/flashlight/pen)) - var/label = sanitizeSafe(input(user, "Enter a label for [name]", "Label", label_text), MAX_NAME_LEN) + var/label = sanitizeSafe(input(user, "Enter a label for \the [name]", "Label", label_text), MAX_NAME_LEN) if (!label) - return + return TRUE AddLabel(label, user) + return TRUE + return ..() /obj/item/reagent_containers/food/condiment/attack_self(mob/user as mob) return @@ -70,110 +63,129 @@ /obj/item/reagent_containers/food/condiment/self_feed_message(mob/user) to_chat(user, SPAN_NOTICE("You swallow some of contents of \the [src].")) -/obj/item/reagent_containers/food/condiment/Initialize() - . = ..() - for(var/R in starting_reagents) - reagents.add_reagent(R, starting_reagents[R]) /obj/item/reagent_containers/food/condiment/on_reagent_change() - var/reagent = reagents.get_master_reagent_type() - if(reagent in special_bottles) - var/obj/item/reagent_containers/food/condiment/special_bottle = special_bottles[reagent] - SetName(initial(special_bottle.name)) - desc = initial(special_bottle.desc) - icon_state = initial(special_bottle.icon_state) - center_of_mass = initial(special_bottle.center_of_mass) + if(fixed_state) + return + + ClearOverlays() + + if(!reagents.total_volume) + name = "condiment bottle" + desc = "An empty condiment bottle." + return + + var/datum/reagent/master = reagents.get_master_reagent() + icon_state = master.condiment_icon_state || initial(icon_state) + name = master.condiment_name || (length(reagents.reagent_list) == 1 ? "[lowertext(master.name)] bottle" : "condiment bottle") + desc = master.condiment_desc || (length(reagents.reagent_list) == 1 ? master.description : "A mixture of various condiments. [master.name] is one of them.") + if(icon_state == "condiment") + var/image/filling = image(icon, "condiment_overlay") + filling.color = reagents.get_color() + AddOverlays(filling) + +/obj/item/reagent_containers/food/condiment/examine(mob/user, distance) + . = ..() + if(distance > 1) + return + if(!reagents || reagents.total_volume == 0) + to_chat(user, SPAN_NOTICE("\The [src] is empty!")) + else if (reagents.total_volume <= volume * 0.25) + to_chat(user, SPAN_NOTICE("\The [src] is almost empty!")) + else if (reagents.total_volume <= volume * 0.66) + to_chat(user, SPAN_NOTICE("\The [src] is half full!")) + else if (reagents.total_volume <= volume * 0.90) + to_chat(user, SPAN_NOTICE("\The [src] is almost full!")) else - SetName(initial(name)) - desc = initial(desc) - center_of_mass = initial(center_of_mass) - if(length(reagents.reagent_list) > 0) - icon_state = "mixedcondiments" - else - icon_state = "emptycondiment" + to_chat(user, SPAN_NOTICE("\The [src] is full!")) + /obj/item/reagent_containers/food/condiment/enzyme - name = "universal enzyme" - desc = "Used in cooking various dishes." - icon_state = "enzyme" starting_reagents = list(/datum/reagent/enzyme = 50) /obj/item/reagent_containers/food/condiment/barbecue - name = "barbecue sauce" - desc = "Barbecue sauce, it's labeled 'sweet and spicy'" - icon_state = "barbecue" starting_reagents = list(/datum/reagent/nutriment/barbecue = 50) /obj/item/reagent_containers/food/condiment/sugar - name = "sugar" - desc = "Cavities in a bottle." starting_reagents = list(/datum/reagent/sugar = 50) /obj/item/reagent_containers/food/condiment/ketchup - name = "ketchup" - desc = "Tomato, but more liquid, stronger, better." - icon_state = "ketchup" starting_reagents = list(/datum/reagent/nutriment/ketchup = 50) /obj/item/reagent_containers/food/condiment/cornoil - name = "corn oil" - desc = "A delicious oil used in cooking. Made from corn." - icon_state = "oliveoil" starting_reagents = list(/datum/reagent/nutriment/cornoil = 50) /obj/item/reagent_containers/food/condiment/vinegar - name = "vinegar" - icon_state = "vinegar" - desc = "As acidic as it gets in the kitchen." starting_reagents = list(/datum/reagent/nutriment/vinegar = 50) /obj/item/reagent_containers/food/condiment/mayo - name = "mayonnaise" - icon_state = "mayo" - desc = "Mayonnaise, used for centuries to make things edible." starting_reagents = list(/datum/reagent/nutriment/mayo = 50) /obj/item/reagent_containers/food/condiment/frostoil - name = "coldsauce" - desc = "Leaves the tongue numb in its passage." - icon_state = "coldsauce" starting_reagents = list(/datum/reagent/frostoil = 50) /obj/item/reagent_containers/food/condiment/capsaicin - name = "hotsauce" - desc = "You can almost TASTE the stomach ulcers now!" - icon_state = "hotsauce" starting_reagents = list(/datum/reagent/capsaicin = 50) +/obj/item/reagent_containers/food/condiment/flour + randpixel = 10 + starting_reagents = list(/datum/reagent/nutriment/flour = 50) + +/obj/item/reagent_containers/food/condiment/mint + starting_reagents = list(/datum/reagent/nutriment/mint = 15) + +/obj/item/reagent_containers/food/condiment/soysauce + starting_reagents = list(/datum/reagent/nutriment/soysauce = 50) + +/obj/item/reagent_containers/food/condiment/oliveoil + starting_reagents = list(/datum/reagent/oliveoil = 50) + +/obj/item/reagent_containers/food/condiment/peanutbutter + starting_reagents = list(/datum/reagent/nutriment/peanutbutter = 50) + +/obj/item/reagent_containers/food/condiment/choconutspread + starting_reagents = list(/datum/reagent/nutriment/choconutspread = 50) + /obj/item/reagent_containers/food/condiment/small possible_transfer_amounts = "1;20" amount_per_transfer_from_this = 1 volume = 20 - -/obj/item/reagent_containers/food/condiment/small/on_reagent_change() - return + fixed_state = TRUE /obj/item/reagent_containers/food/condiment/small/saltshaker name = "salt shaker" desc = "Salt. From space oceans, presumably." - icon_state = "saltshakersmall" + icon_state = "saltshaker" center_of_mass = "x=16;y=9" starting_reagents = list(/datum/reagent/sodiumchloride = 20) /obj/item/reagent_containers/food/condiment/small/peppermill name = "pepper mill" desc = "Often used to flavor food or make people sneeze." - icon_state = "peppermillsmall" + icon_state = "peppermill" center_of_mass = "x=16;y=8" starting_reagents = list(/datum/reagent/blackpepper = 20) /obj/item/reagent_containers/food/condiment/small/sugar name = "sugar" desc = "Sweetness in a bottle." - icon_state = "sugarsmall" + icon_state = "sugarbottle" center_of_mass = "x=17;y=9" starting_reagents = list(/datum/reagent/sugar = 20) + +/obj/item/reagent_containers/food/condiment/salt + name = "big bag of salt" + desc = "A nonsensically large bag of salt. Carefully refined from countless shifts." + icon_state = "salt" + item_state = "flour" + randpixel = 10 + volume = 500 + w_class = ITEM_SIZE_LARGE + starting_reagents = list(/datum/reagent/sodiumchloride = 500) + fixed_state = TRUE + + //MRE condiments and drinks. /obj/item/reagent_containers/food/condiment/small/packet @@ -213,6 +225,18 @@ starting_reagents = list(/datum/reagent/sugar = 10) icon_state = "packet_medium" +/obj/item/reagent_containers/food/condiment/small/packet/peanutbutter + name = "peanut butter packet" + desc = "Contains 10u of peanut butter." + icon_state = "packet_medium" + starting_reagents = list(/datum/reagent/nutriment/peanutbutter = 10) + +/obj/item/reagent_containers/food/condiment/small/packet/choconutspread + name = "NTella packet" + desc = "Contains 10u of NTella." + icon_state = "packet_medium" + starting_reagents = list(/datum/reagent/nutriment/choconutspread = 10) + /obj/item/reagent_containers/food/condiment/small/packet/capsaicin name = "hot sauce packet" desc = "Contains 5u of hot sauce. Enjoy in moderation." @@ -299,55 +323,4 @@ /obj/item/reagent_containers/food/condiment/small/packet/crayon/brown starting_reagents = list(/datum/reagent/crayon_dust/brown = 10) -//End of MRE stuff. - -/obj/item/reagent_containers/food/condiment/flour - name = "flour sack" - desc = "A big bag of flour. Good for baking!" - icon = 'icons/obj/food/food.dmi' - icon_state = "flour" - item_state = "flour" - randpixel = 10 - starting_reagents = list(/datum/reagent/nutriment/flour = 50) - -/obj/item/reagent_containers/food/condiment/flour/on_reagent_change() - return - -/obj/item/reagent_containers/food/condiment/salt - name = "big bag of salt" - desc = "A nonsensically large bag of salt. Carefully refined from countless shifts." - icon = 'icons/obj/food/food.dmi' - icon_state = "salt" - item_state = "flour" - randpixel = 10 - volume = 500 - w_class = ITEM_SIZE_LARGE - starting_reagents = list(/datum/reagent/sodiumchloride = 500) - -/obj/item/reagent_containers/food/condiment/salt/on_reagent_change() - return - -/obj/item/reagent_containers/food/condiment/mint - name = "mint essential oil" - desc = "A small bottle of the essential oil of some kind of mint plant." - icon = 'icons/obj/food/food.dmi' - icon_state = "coldsauce" - starting_reagents = list(/datum/reagent/nutriment/mint = 15) - -/obj/item/reagent_containers/food/condiment/mint/on_reagent_change() - return - -/obj/item/reagent_containers/food/condiment/soysauce - name = "soy sauce" - desc = "A dark, salty, savoury flavoring." - icon_state = "soysauce" - amount_per_transfer_from_this = 1 - volume = 20 - starting_reagents = list(/datum/reagent/nutriment/soysauce = 20) - -/obj/item/reagent_containers/food/condiment/small/oliveoil - name = "olive oil" - desc = "Used in food preparation and flavoring." - icon_state = "oliveoilsmall" - center_of_mass = "x=16;y=8" - starting_reagents = list(/datum/reagent/oliveoil = 20) +//End of MRE stuff. \ No newline at end of file diff --git a/code/modules/reagents/reagent_containers/food/drinks.dm b/code/modules/reagents/reagent_containers/food/drinks.dm index 612a6ba24867a..c34f9eb2e8e72 100644 --- a/code/modules/reagents/reagent_containers/food/drinks.dm +++ b/code/modules/reagents/reagent_containers/food/drinks.dm @@ -4,7 +4,7 @@ /obj/item/reagent_containers/food/drinks name = "drink" desc = "Yummy!" - icon = 'icons/obj/food/drinks.dmi' + icon = 'icons/obj/food/drinks/misc.dmi' icon_state = null atom_flags = ATOM_FLAG_OPEN_CONTAINER amount_per_transfer_from_this = 5 @@ -12,6 +12,9 @@ var/filling_states // List of percentages full that have icons var/base_name = null // Name to put in front of drinks, i.e. "[base_name] of [contents]" var/base_icon = null // Base icon name for fill states + var/drink_offset_x = 0 + var/drink_offset_y = 0 + var/shaken = FALSE /obj/item/reagent_containers/food/drinks/on_reagent_change() update_icon() @@ -20,8 +23,20 @@ /obj/item/reagent_containers/food/drinks/on_color_transfer_reagent_change() return + /obj/item/reagent_containers/food/drinks/attack_self(mob/user as mob) if(!is_open_container()) + if(user.a_intent == I_HURT) + shaken = TRUE + user.visible_message("\The [user] shakes \the [src]!", "You shake \the [src]!") + playsound(loc,'sound/items/soda_shaking.ogg', rand(10,50), 1) + shake_animation(20) + return + if(shaken) + for(var/datum/reagent/R in reagents.reagent_list) + if("fizz" in R.glass_special) + boom(user) + return open(user) /obj/item/reagent_containers/food/drinks/proc/open(mob/user) @@ -29,6 +44,40 @@ to_chat(user, SPAN_NOTICE("You open \the [src] with an audible pop!")) atom_flags |= ATOM_FLAG_OPEN_CONTAINER +/obj/item/reagent_containers/food/drinks/proc/boom(mob/user as mob) + user.visible_message( + SPAN_DANGER("\The [src] explodes all over \the [user] as they open it!"), + SPAN_DANGER("\The [src] explodes all over you as you open it!") + ) + atom_flags |= ATOM_FLAG_OPEN_CONTAINER + make_froth(drink_offset_x, drink_offset_y, 2) + playsound(loc,'sound/items/soda_burst.ogg', rand(20,50), 1) + reagents.splash(user, reagents.total_volume) + shaken = FALSE + + +/obj/item/reagent_containers/food/drinks/proc/make_froth(intensity) + if(!intensity) + return + + if(!reagents.total_volume) + return + + var/intensity_state = null + switch(intensity) + if(1) + intensity_state = "low" + if(2) + intensity_state = "medium" + if(3) + intensity_state = "high" + var/mutable_appearance/froth = mutable_appearance('icons/obj/food/drinks/drink_effects.dmi', "froth_[intensity_state]") + froth.pixel_x = drink_offset_x + froth.pixel_y = drink_offset_y + AddOverlays(froth) + spawn(2 SECONDS) + CutOverlays(froth) + /obj/item/reagent_containers/food/drinks/use_before(mob/M as mob, mob/user as mob) . = FALSE if (!istype(M)) @@ -107,7 +156,7 @@ desc = initial(desc) -//////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// /// Drinks. END //////////////////////////////////////////////////////////////////////////////// @@ -182,7 +231,7 @@ /obj/item/reagent_containers/food/drinks/small_milk_choc name = "small chocolate milk carton" desc = "It's milk! This one is in delicious chocolate flavour." - icon_state = "mini-milk" + icon_state = "mini-milk_choco" item_state = "carton" center_of_mass = "x=16;y=9" volume = 30 @@ -207,6 +256,9 @@ desc = "Careful, cold ice, do not chew." icon_state = "coffee" center_of_mass = "x=15;y=10" + filling_states = "100" + base_name = "cup" + base_icon = "cup" /obj/item/reagent_containers/food/drinks/ice/Initialize() . = ..() @@ -218,6 +270,9 @@ icon_state = "coffee" item_state = "coffee" center_of_mass = "x=15;y=13" + filling_states = "100" + base_name = "cup" + base_icon = "cup" /obj/item/reagent_containers/food/drinks/h_chocolate/Initialize() . = ..() @@ -229,25 +284,38 @@ desc = "Just add 10ml water, self heats! A taste that reminds you of your school years." icon_state = "ramen" center_of_mass = "x=16;y=11" + atom_flags = 0 //starts closed + filling_states = "100" + base_icon = "cup" /obj/item/reagent_containers/food/drinks/dry_ramen/Initialize() . = ..() reagents.add_reagent(/datum/reagent/drink/dry_ramen, 30) +/obj/item/reagent_containers/food/drinks/dry_ramen/on_update_icon() + ClearOverlays() + if(length(reagents.reagent_list) > 0) + if(filling_states && HAS_FLAGS(atom_flags, ATOM_FLAG_OPEN_CONTAINER)) + var/image/filling = image(icon, src, "[base_icon][get_filling_state()]") + filling.color = reagents.get_color() + AddOverlays(filling) + +/obj/item/reagent_containers/food/drinks/dry_ramen/open(mob/user) + playsound(loc,'sound/effects/rip1.ogg', rand(10,50), 1) + to_chat(user, SPAN_NOTICE("You tear open \the [src], breaking the seal.")) + atom_flags |= ATOM_FLAG_OPEN_CONTAINER + icon_state = "ramen_open" + update_icon() /obj/item/reagent_containers/food/drinks/sillycup name = "paper cup" desc = "A paper water cup." - icon_state = "water_cup_e" + icon_state = "water_cup" possible_transfer_amounts = null volume = 10 center_of_mass = "x=16;y=12" - -/obj/item/reagent_containers/food/drinks/sillycup/on_reagent_change() - if(reagents.total_volume) - icon_state = "water_cup" - else - icon_state = "water_cup_e" + filling_states = "100" + base_icon = "water_cup" //////////////////////////pitchers, pots, flasks and cups // @@ -277,6 +345,7 @@ /obj/item/reagent_containers/food/drinks/flask name = "\improper Captain's flask" desc = "A metal flask belonging to the captain." + icon = 'icons/obj/food/drinks/flasks.dmi' icon_state = "flask" volume = 60 center_of_mass = "x=17;y=7" @@ -286,11 +355,6 @@ desc = "A shiny metal flask. It appears to have a Greek symbol inscribed on it." icon_state = "shinyflask" -/obj/item/reagent_containers/food/drinks/flask/lithium - name = "lithium flask" - desc = "A flask with a Lithium Atom symbol on it." - icon_state = "lithiumflask" - /obj/item/reagent_containers/food/drinks/flask/detflask name = "\improper Detective's flask" desc = "A metal flask with a leather band and golden badge belonging to the detective." @@ -311,6 +375,48 @@ icon_state = "vacuumflask" volume = 60 center_of_mass = "x=15;y=4" + var/obj/item/reagent_containers/food/drinks/flask/flask_cup/cup = /obj/item/reagent_containers/food/drinks/flask/flask_cup + +/obj/item/reagent_containers/food/drinks/flask/vacuumflask/Initialize() + . = ..() + cup = new cup(src) + atom_flags ^= ATOM_FLAG_OPEN_CONTAINER + +/obj/item/reagent_containers/food/drinks/flask/vacuumflask/attack_self(mob/user) + if(cup) + to_chat(user, SPAN_NOTICE("You remove \the [src]'s cap.")) + user.put_in_hands(cup) + atom_flags |= ATOM_FLAG_OPEN_CONTAINER + cup = null + update_icon() + +/obj/item/reagent_containers/food/drinks/flask/vacuumflask/use_tool(obj/item/attacking_item, mob/user) + if(istype(attacking_item, /obj/item/reagent_containers/food/drinks/flask/flask_cup)) + if(cup) + to_chat(user, SPAN_WARNING("\The [src] already has a cap.")) + return TRUE + if(attacking_item.reagents.total_volume + reagents.total_volume > volume) + to_chat(user, SPAN_WARNING("There's too much fluid in both the cap and \the [src]!")) + return TRUE + to_chat(user, SPAN_NOTICE("You put the cap onto \the [src].")) + user.unEquip(attacking_item, src) + atom_flags ^= ATOM_FLAG_OPEN_CONTAINER + cup = attacking_item + cup.reagents.trans_to_holder(reagents, cup.reagents.total_volume) + update_icon() + return TRUE + return ..() + +/obj/item/reagent_containers/food/drinks/flask/vacuumflask/on_update_icon() + icon_state = cup ? initial(icon_state) : "[initial(icon_state)]-nobrim" + +/obj/item/reagent_containers/food/drinks/flask/flask_cup + name = "vacuum flask cup" + desc = "The cup that appears in your hands after you unscrew the cap of the flask and turn it over. Magic!" + icon_state = "vacuumflask-brim" + volume = 10 + center_of_mass = "x=16;y=6" + //tea and tea accessories /obj/item/reagent_containers/food/drinks/tea @@ -319,7 +425,7 @@ icon_state = "coffee" item_state = "coffee" center_of_mass = "x=16;y=14" - //filling_states = "100" + filling_states = "100" base_name = "cup" base_icon = "cup" @@ -353,7 +459,7 @@ icon_state = "coffee" item_state = "coffee" center_of_mass = "x=16;y=14" - //filling_states = "100" + filling_states = "100" base_name = "cup" base_icon = "cup" diff --git a/code/modules/reagents/reagent_containers/food/drinks/bottle.dm b/code/modules/reagents/reagent_containers/food/drinks/bottle.dm index 0ef2ef51f7d88..e4a51a0daefac 100644 --- a/code/modules/reagents/reagent_containers/food/drinks/bottle.dm +++ b/code/modules/reagents/reagent_containers/food/drinks/bottle.dm @@ -1,8 +1,10 @@ /obj/item/reagent_containers/food/drinks/bottle + icon = 'icons/obj/food/drinks/bottles.dmi' amount_per_transfer_from_this = 10 volume = 100 item_state = "broken_beer" force = 5 + drink_offset_y = 15 var/can_shatter = TRUE var/obj/item/reagent_containers/glass/rag/rag var/rag_underlay = "rag" @@ -52,32 +54,40 @@ return prob(chance_table[idx]) -/obj/item/reagent_containers/food/drinks/bottle/proc/smash(newloc, atom/against) +/obj/item/reagent_containers/food/drinks/bottle/proc/smash(newloc, atom/against, break_top) var/obj/item/broken_bottle/B = new (newloc) if (prob(33)) new /obj/item/material/shard (newloc) B.icon_state = icon_state - var/icon/I = new ('icons/obj/food/drinks.dmi', icon_state) - I.Blend(B.broken_outline, ICON_OVERLAY, rand(5), 1) + + var/icon/I = new ('icons/obj/food/drinks/bottles.dmi', icon_state) + if(break_top) + desc = "A bottle with its neck smashed off." + I.Blend(B.flipped_broken_outline, ICON_OVERLAY, rand(5), 0) + else + I.Blend(B.broken_outline, ICON_OVERLAY, rand(5), 1) I.SwapColor(rgb(255, 0, 220, 255), rgb(0, 0, 0, 0)) B.icon = I + if (rag && rag.on_fire && isliving(against)) var/mob/living/L = against L.IgniteMob() + playsound(src, "shatter", 70, 1) transfer_fingerprints_to(B) + qdel(src) return B -/obj/item/reagent_containers/food/drinks/bottle/attackby(obj/item/W, mob/user) +/obj/item/reagent_containers/food/drinks/bottle/use_tool(obj/item/W, mob/living/user, list/click_params) if (!rag && istype(W, /obj/item/reagent_containers/glass/rag)) insert_rag(W, user) - return + return TRUE if (rag && W.IsFlameSource()) - rag.attackby(W, user) - return - ..() + rag.use_tool(W, user) + return TRUE + return ..() /obj/item/reagent_containers/food/drinks/bottle/attack_self(mob/user) @@ -117,7 +127,7 @@ /obj/item/reagent_containers/food/drinks/bottle/on_update_icon() underlays.Cut() if (rag) - var/underlay_image = image(icon='icons/obj/food/drinks.dmi', icon_state=rag.on_fire? "[rag_underlay]_lit" : rag_underlay) + var/underlay_image = image(icon='icons/obj/food/drinks/drink_effects.dmi', icon_state=rag.on_fire? "[rag_underlay]_lit" : rag_underlay) underlays += underlay_image set_light(rag.light_range, rag.light_power, rag.light_color) else @@ -329,7 +339,7 @@ /obj/item/reagent_containers/food/drinks/bottle/melonliquor name = "Emeraldine Melon Liquor" desc = "A bottle of 46 proof Emeraldine Melon Liquor. Sweet and light." - icon_state = "alco-green" + icon_state = "melonliquor" center_of_mass = "x=16;y=6" @@ -341,7 +351,7 @@ /obj/item/reagent_containers/food/drinks/bottle/bluecuracao name = "Miss Blue Curacao" desc = "A fruity, exceptionally azure drink. Does not allow the imbiber to use the fifth magic." - icon_state = "alco-blue" + icon_state = "curacaobottle" center_of_mass = "x=16;y=6" @@ -374,42 +384,6 @@ reagents.add_reagent(/datum/reagent/drink/grenadine, 100) -/obj/item/reagent_containers/food/drinks/bottle/cola - name = "\improper Space Cola" - desc = "Cola. in space." - icon_state = "colabottle" - center_of_mass = "x=16;y=6" - - -/obj/item/reagent_containers/food/drinks/bottle/cola/Initialize() - . = ..() - reagents.add_reagent(/datum/reagent/drink/space_cola, 100) - - -/obj/item/reagent_containers/food/drinks/bottle/space_up - name = "\improper Space-Up" - desc = "Tastes like a hull breach in your mouth." - icon_state = "space-up_bottle" - center_of_mass = "x=16;y=6" - - -/obj/item/reagent_containers/food/drinks/bottle/space_up/Initialize() - . = ..() - reagents.add_reagent(/datum/reagent/drink/space_up, 100) - - -/obj/item/reagent_containers/food/drinks/bottle/space_mountain_wind - name = "\improper Space Mountain Wind" - desc = "Blows right through you like a space wind." - icon_state = "space_mountain_wind_bottle" - center_of_mass = "x=16;y=6" - - -/obj/item/reagent_containers/food/drinks/bottle/space_mountain_wind/Initialize() - . = ..() - reagents.add_reagent(/datum/reagent/drink/spacemountainwind, 100) - - /obj/item/reagent_containers/food/drinks/bottle/pwine name = "Warlock's Velvet" desc = "What a delightful packaging for a surely high quality wine! The vintage must be amazing!" @@ -463,6 +437,8 @@ desc = "The regal drink of celebrities and royalty." icon_state = "champagne" center_of_mass = "x=16;y=4" + atom_flags = 0 + var/sabraged = FALSE /obj/item/reagent_containers/food/drinks/bottle/champagne/Initialize() @@ -470,6 +446,98 @@ reagents.add_reagent(/datum/reagent/ethanol/champagne, 100) +/obj/item/reagent_containers/food/drinks/bottle/champagne/attack_self(mob/user) + if(is_open_container()) + return ..() + user.visible_message( + SPAN_NOTICE("\The [user] begins fiddling with \the [src]'s cork."), + SPAN_NOTICE("You begin fiddling with \the [src]'s cork.") + ) + if(do_after(user, 1 SECOND, src, DO_PUBLIC_UNIQUE)) + return open(user, sabrage = FALSE, froth_severity = pick(1,2)) + +/obj/item/reagent_containers/food/drinks/bottle/champagne/use_tool(obj/item/attacking_item, mob/user) + . = ..() + + if(is_open_container()) + return ..() + + if(!has_edge(attacking_item) && !istype(attacking_item, /obj/item/material/sword)) + return + + if((attacking_item.force < 4)) + USE_FEEDBACK_FAILURE("\The [attacking_item] is not strong enough to open \the [src].") + return TRUE + + playsound(user, 'sound/effects/holster/sheathout.ogg', 25, TRUE) + user.visible_message( + SPAN_NOTICE("\The [user] prepares to swing \the [attacking_item] at \the [src]."), + SPAN_NOTICE("You prepare to swing \the [attacking_item] at \the [src].") + ) + + if (!user.do_skilled(2 SECONDS, SKILL_COOKING, user)) + return TRUE + if(!prob(user.skill_fail_chance(SKILL_COOKING, 80, SKILL_EXPERIENCED))) + return open(user, sabrage = TRUE, froth_severity = 3) + else + var/datum/pronouns/pronouns = user.choose_from_pronouns() + user.visible_message( + SPAN_WARNING("\The [user] fumbles and cuts \the [src] in half, spilling it over [pronouns.self]!"), + SPAN_WARNING("You fumble and cut \the [src] in half, spilling it over yourself!"), + SPAN_NOTICE("You hear spilling.") + ) + if (user.isEquipped(src)) + user.drop_from_inventory(src) + return smash(loc, user, break_top = TRUE) + + +/obj/item/reagent_containers/food/drinks/bottle/champagne/on_update_icon() + . = ..() + if(is_open_container()) + if(sabraged) + icon_state = "[initial(icon_state)]_sabrage" + else + icon_state = "[initial(icon_state)]_popped" + else + icon_state = initial(icon_state) + + +/obj/item/reagent_containers/food/drinks/bottle/champagne/open(mob/user, sabrage, froth_severity) + if(!sabrage) + visible_message( + SPAN_WARNING("The cork flies off of \the [src]!"), + SPAN_NOTICE("You can hear a pop.") + ) + else + sabraged = TRUE + drink_offset_y = 13 + user.visible_message( + SPAN_WARNING("\The [user] cleanly slices off the cork of \the [src]!"), + SPAN_WARNING("You elegantly slice the cork off of \the [src]!"), + SPAN_NOTICE("You can hear a pop.") + ) + playsound(src, 'sound/items/champagne_pop.ogg', 70, TRUE) + atom_flags |= ATOM_FLAG_OPEN_CONTAINER + update_icon() + make_froth(froth_severity) + var/obj/item/trash/cork_to_fire = sabraged ? /obj/item/trash/champagne_cork/sabrage : /obj/item/trash/champagne_cork + var/obj/item/trash/champagne_cork/popped_cork = new cork_to_fire(loc) + if (user.isEquipped(src)) + user.drop_from_inventory(popped_cork) + popped_cork.throw_at_random(include_own_turf = FALSE, maxrange = 4, speed = 4) + + +/obj/item/trash/champagne_cork + name = "champagne cork" + icon = 'icons/obj/food/drinks/bottles.dmi' + icon_state = "champagne_cork" + w_class = ITEM_SIZE_TINY + + +/obj/item/trash/champagne_cork/sabrage + icon_state = "champagne_cork_sabrage" + + /obj/item/reagent_containers/food/drinks/bottle/prosecco name = "2280 Vintage Prosecco." desc = "A delicious prosecco, ideal for long days at work. This one proudly advertises itself as 2280 Vintage. Must have been a special year." @@ -497,7 +565,7 @@ /obj/item/reagent_containers/food/drinks/bottle/jagermeister name = "Kaisermeister Deluxe Jagermeister" desc = "Jagermeister. This drink just demands a party." - icon_state = "herbal" + icon_state = "jagermeister" center_of_mass = "x=16;y=6" @@ -572,7 +640,7 @@ /obj/item/reagent_containers/food/drinks/bottle/premiumwine name = "Uve De Blanc" desc = "You feel pretentious just looking at it." - icon_state = "premiumwine" + icon_state = "whitewinebottle" center_of_mass = "x=16;y=4" @@ -703,6 +771,7 @@ smash_duration = 1 atom_flags = 0 rag_underlay = "rag_small" + drink_offset_y = 13 /obj/item/reagent_containers/food/drinks/bottle/small/beer @@ -798,6 +867,45 @@ reagents.add_reagent(/datum/reagent/ethanol/lager, 50) +/obj/item/reagent_containers/food/drinks/bottle/small/cola + name = "\improper Space Cola" + desc = "Cola. in space." + icon_state = "colabottle" + center_of_mass = "x=16;y=6" + drink_offset_y = 11 + + +/obj/item/reagent_containers/food/drinks/bottle/small/cola/Initialize() + . = ..() + reagents.add_reagent(/datum/reagent/drink/space_cola, 50) + + +/obj/item/reagent_containers/food/drinks/bottle/small/space_up + name = "\improper Space-Up" + desc = "Tastes like a hull breach in your mouth." + icon_state = "space-up_bottle" + center_of_mass = "x=16;y=6" + drink_offset_y = 11 + + +/obj/item/reagent_containers/food/drinks/bottle/small/space_up/Initialize() + . = ..() + reagents.add_reagent(/datum/reagent/drink/space_up, 50) + + +/obj/item/reagent_containers/food/drinks/bottle/small/space_mountain_wind + name = "\improper Space Mountain Wind" + desc = "Blows right through you like a space wind." + icon_state = "space_mountain_wind_bottle" + center_of_mass = "x=16;y=6" + drink_offset_y = 11 + + +/obj/item/reagent_containers/food/drinks/bottle/small/space_mountain_wind/Initialize() + . = ..() + reagents.add_reagent(/datum/reagent/drink/spacemountainwind, 50) + + /obj/item/reagent_containers/food/drinks/bottle/oiljug name = "oil jug" desc = "A plastic jug of engine oil. Not for human consumption." @@ -813,7 +921,7 @@ /obj/item/broken_bottle name = "Broken Bottle" desc = "A bottle with a sharp broken bottom." - icon = 'icons/obj/food/drinks.dmi' + icon = 'icons/obj/food/drinks/bottles.dmi' icon_state = "broken_bottle" force = 9 throwforce = 5 @@ -823,4 +931,5 @@ hitsound = 'sound/weapons/bladeslice.ogg' attack_verb = list("stabbed", "slashed", "attacked") sharp = TRUE - var/icon/broken_outline = icon('icons/obj/food/drinks.dmi', "broken") + var/icon/broken_outline = icon('icons/obj/food/drinks/drink_effects.dmi', "broken") + var/icon/flipped_broken_outline = icon('icons/obj/food/drinks/drink_effects.dmi', "broken-flipped") diff --git a/code/modules/reagents/reagent_containers/food/drinks/jar.dm b/code/modules/reagents/reagent_containers/food/drinks/jar.dm deleted file mode 100644 index 91f905c0a7f0a..0000000000000 --- a/code/modules/reagents/reagent_containers/food/drinks/jar.dm +++ /dev/null @@ -1,22 +0,0 @@ - - -///jar - -/obj/item/reagent_containers/food/drinks/jar - name = "empty jar" - desc = "A jar. You're not sure what it's supposed to hold." - icon_state = "jar" - item_state = "beaker" - center_of_mass = "x=15;y=8" - unacidable = TRUE - -/obj/item/reagent_containers/food/drinks/jar/on_reagent_change() - if (length(reagents.reagent_list) > 0) - icon_state ="jar_what" - SetName("jar of something") - desc = "You can't really tell what this is." - else - icon_state = initial(icon_state) - SetName(initial(name)) - desc = "A jar. You're not sure what it's supposed to hold." - return diff --git a/code/modules/reagents/reagent_containers/food/fish.dm b/code/modules/reagents/reagent_containers/food/fish.dm index 3752ac070e6ab..4e028762ee68c 100644 --- a/code/modules/reagents/reagent_containers/food/fish.dm +++ b/code/modules/reagents/reagent_containers/food/fish.dm @@ -18,7 +18,7 @@ name = "[fish_type] fillet" -/obj/item/reagent_containers/food/snacks/fish/attackby(obj/item/item, mob/living/user) +/obj/item/reagent_containers/food/snacks/fish/use_tool(obj/item/item, mob/living/user, list/click_params) if (istype(item, /obj/item/reagent_containers/syringe) || !item.sharp) return ..() var/turf/turf = get_turf(src) diff --git a/code/modules/reagents/reagent_containers/food/sandwich.dm b/code/modules/reagents/reagent_containers/food/sandwich.dm index 4faa272c95c24..3994eaf178f4f 100644 --- a/code/modules/reagents/reagent_containers/food/sandwich.dm +++ b/code/modules/reagents/reagent_containers/food/sandwich.dm @@ -1,12 +1,12 @@ -/obj/item/reagent_containers/food/snacks/slice/bread/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/reagent_containers/food/snacks/slice/bread/use_tool(obj/item/W, mob/living/user, list/click_params) if(istype(W,/obj/item/material/shard) || istype(W,/obj/item/reagent_containers/food/snacks)) if (is_path_in_list(W.type, list(/obj/item/reagent_containers/food/snacks/custombowl, /obj/item/reagent_containers/food/snacks/csandwich))) - return + return ..() var/obj/item/reagent_containers/food/snacks/csandwich/S = new(get_turf(src)) - S.attackby(W,user) + S.use_tool(W,user) qdel(src) - return - . = ..() + return TRUE + return ..() /obj/item/reagent_containers/food/snacks/csandwich name = "sandwich" @@ -31,8 +31,7 @@ SetName("\improper [sandwich_label] sandwich") renamed = 1 -/obj/item/reagent_containers/food/snacks/csandwich/attackby(obj/item/W, mob/user) - +/obj/item/reagent_containers/food/snacks/csandwich/use_tool(obj/item/W, mob/living/user, list/click_params) var/sandwich_limit = 4 for(var/obj/item/O in ingredients) if(istype(O,/obj/item/reagent_containers/food/snacks/slice/bread)) @@ -40,18 +39,22 @@ if(length(src.contents) > sandwich_limit) to_chat(user, SPAN_WARNING("If you put anything else on \the [src] it's going to collapse.")) - return - else if(istype(W,/obj/item/material/shard)) + return TRUE + + if(istype(W,/obj/item/material/shard)) if(!user.unEquip(W, src)) - return + FEEDBACK_UNEQUIP_FAILURE(user, W) + return TRUE to_chat(user, SPAN_WARNING("You hide [W] in \the [src].")) update() - return - else if(istype(W,/obj/item/reagent_containers/food/snacks)) + return TRUE + + if(istype(W,/obj/item/reagent_containers/food/snacks)) if (is_path_in_list(W.type, list(/obj/item/reagent_containers/food/snacks/custombowl, /obj/item/reagent_containers/food/snacks/csandwich))) - return + return ..() if(!user.unEquip(W, src)) - return + FEEDBACK_UNEQUIP_FAILURE(user, W) + return TRUE user.visible_message( SPAN_NOTICE("\The [user] layers \the [W] over \the [src]."), SPAN_NOTICE("You layer \the [W] over \the [src].") @@ -60,8 +63,9 @@ F.reagents.trans_to_obj(src, F.reagents.total_volume) ingredients += W update() - return - . = ..() + return TRUE + + return ..() /obj/item/reagent_containers/food/snacks/csandwich/proc/update() var/i = 0 diff --git a/code/modules/reagents/reagent_containers/food/servingbowl.dm b/code/modules/reagents/reagent_containers/food/servingbowl.dm index 85c428c410939..6e0d023e2e70b 100644 --- a/code/modules/reagents/reagent_containers/food/servingbowl.dm +++ b/code/modules/reagents/reagent_containers/food/servingbowl.dm @@ -8,7 +8,7 @@ matter = list(MATERIAL_PLASTIC = 300) -/obj/item/serving_bowl/attackby(obj/item/item, mob/living/user) +/obj/item/serving_bowl/use_tool(obj/item/item, mob/living/user, list/click_params) if (!istype(item, /obj/item/reagent_containers/food/snacks)) return ..() if (is_path_in_list(item.type, list(/obj/item/reagent_containers/food/snacks/custombowl, /obj/item/reagent_containers/food/snacks/csandwich))) @@ -16,7 +16,7 @@ var/allowed = isturf(loc) | SHIFTL(src == user.l_hand, 1) | SHIFTL(src == user.r_hand, 2) if (!allowed) to_chat(user, SPAN_WARNING("Put down or hold the bowl first.")) - return + return TRUE var/obj/item/reagent_containers/food/snacks/custombowl/bowl = new (get_turf(src), item) bowl.pixel_x = pixel_x bowl.pixel_y = pixel_y @@ -26,6 +26,7 @@ user.put_in_l_hand(bowl) if (4) user.put_in_r_hand(bowl) + return TRUE /obj/item/reagent_containers/food/snacks/custombowl @@ -71,23 +72,24 @@ renamed = TRUE -/obj/item/reagent_containers/food/snacks/custombowl/attackby(obj/item/item, mob/living/user) +/obj/item/reagent_containers/food/snacks/custombowl/use_tool(obj/item/item, mob/living/user, list/click_params) if (!istype(item, /obj/item/reagent_containers/food/snacks)) return ..() if (is_path_in_list(item.type, list(/obj/item/reagent_containers/food/snacks/custombowl, /obj/item/reagent_containers/food/snacks/csandwich))) return ..() if (ingredients_left < 1) to_chat(user, SPAN_WARNING("There's no room for any more ingredients in \the [src].")) - return + return TRUE if (!user.unEquip(item, src)) - return + FEEDBACK_UNEQUIP_FAILURE(user, item) + return TRUE user.visible_message( SPAN_ITALIC("\The [user] adds \a [item] to \the [src]."), SPAN_NOTICE("You add \the [item] to \the [src]."), range = 3 ) UpdateIngredients(item, user) - + return TRUE /obj/item/reagent_containers/food/snacks/custombowl/proc/UpdateIngredients(obj/item/reagent_containers/food/snacks/snack) snack.reagents.trans_to_obj(src, snack.reagents.total_volume) diff --git a/code/modules/reagents/reagent_containers/food/shaker.dm b/code/modules/reagents/reagent_containers/food/shaker.dm index 18f5a9b8196dd..cf077ae57ba1c 100644 --- a/code/modules/reagents/reagent_containers/food/shaker.dm +++ b/code/modules/reagents/reagent_containers/food/shaker.dm @@ -9,6 +9,10 @@ atom_flags = ATOM_FLAG_OPEN_CONTAINER | ATOM_FLAG_NO_REACT /obj/item/reagent_containers/food/drinks/shaker/attack_self(mob/user as mob) + if(!reagents.total_volume) + return + playsound(loc,'sound/items/soda_shaking.ogg', rand(10,50), 1) + shake_animation(20) if(user.skill_check(SKILL_COOKING, SKILL_MASTER)) user.visible_message(SPAN_CLASS("rose", "\The [user] shakes \the [src] briskly in one hand, with supreme confidence and competence."), SPAN_CLASS("rose", "You shake \the [src] briskly with one hand.")) mix() @@ -29,7 +33,7 @@ if(reagents && reagents.total_volume) atom_flags &= ~ATOM_FLAG_NO_REACT HANDLE_REACTIONS(reagents) - addtimer(new Callback(src, .proc/stop_react), SSchemistry.wait) + addtimer(new Callback(src, PROC_REF(stop_react)), SSchemistry.wait) /obj/item/reagent_containers/food/drinks/shaker/proc/stop_react() atom_flags |= ATOM_FLAG_NO_REACT diff --git a/code/modules/reagents/reagent_containers/food/snacks.dm b/code/modules/reagents/reagent_containers/food/snacks.dm index 020eeb51f0512..55e45a2b1d142 100644 --- a/code/modules/reagents/reagent_containers/food/snacks.dm +++ b/code/modules/reagents/reagent_containers/food/snacks.dm @@ -1,3 +1,20 @@ +// Хрюкерс адд (SIERRA_ADD) +/obj/item/reagent_containers/food/snacks/monkeycube/lizard + name = "lizard cube" + monkey_type = /mob/living/simple_animal/passive/lizard + +/obj/item/reagent_containers/food/snacks/monkeycube/mouse + name = "mouse cube" + monkey_type = /mob/living/simple_animal/passive/mouse + +/obj/item/reagent_containers/food/snacks/monkeycube/corgi + name = "corgi cube" + monkey_type = /mob/living/simple_animal/passive/corgi + +/obj/item/reagent_containers/food/snacks/monkeycube/cat + name = "cat cube" + monkey_type = /mob/living/simple_animal/passive/cat // Хрюкерс адд енд (SIERRA ADD-END) + /obj/item/reagent_containers/food/snacks name = "snack" desc = "Yummy!" @@ -139,13 +156,12 @@ else to_chat(user, SPAN_NOTICE("\The [src] was bitten multiple times!")) -/obj/item/reagent_containers/food/snacks/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/reagent_containers/food/snacks/use_tool(obj/item/W, mob/living/user, list/click_params) if(istype(W,/obj/item/storage)) - ..()// -> item/attackby() - return + return ..() if(!is_open_container()) - to_chat(user, SPAN_NOTICE("\The [src] isn't open!")) - return 0 + to_chat(user, SPAN_WARNING("\The [src] isn't open!")) + return TRUE // Eating with forks if(istype(W,/obj/item/material/kitchen/utensil)) var/obj/item/material/kitchen/utensil/U = W @@ -154,12 +170,12 @@ U.create_reagents(5) if (U.reagents.total_volume > 0) - to_chat(user, SPAN_WARNING("You already have something on your [U].")) - return + to_chat(user, SPAN_WARNING("You already have something on \the [U].")) + return TRUE - to_chat(user, SPAN_NOTICE("You scoop up some [src] with \the [U]!")) + to_chat(user, SPAN_NOTICE("You scoop up some \the [src] with \the [U]!")) - src.bitecount++ + bitecount++ U.ClearOverlays() U.loaded = "[src]" var/image/I = new(U.icon, "loadedfood") @@ -177,7 +193,7 @@ trash.dropInto(loc) trash = null qdel(src) - return + return TRUE if (is_sliceable()) //these are used to allow hiding edge items in food that is not on a table/tray @@ -186,19 +202,19 @@ if (hide_item) if (W.w_class >= src.w_class || is_robot_module(W) || istype(W,/obj/item/reagent_containers/food/condiment)) - return + return ..() if(!user.unEquip(W, src)) - return + FEEDBACK_UNEQUIP_FAILURE(user, W) + return TRUE to_chat(user, SPAN_WARNING("You slip \the [W] inside \the [src].")) - add_fingerprint(user) W.forceMove(src) - return + return TRUE if (has_edge(W)) if (!can_slice_here) to_chat(user, SPAN_WARNING("You cannot slice \the [src] here! You need a table or at least a tray to do it.")) - return + return TRUE var/slices_lost = 0 if (W.w_class > 3) @@ -220,7 +236,9 @@ S.AddOverlays(I) qdel(src) - return + return TRUE + + return ..() /obj/item/reagent_containers/food/snacks/proc/is_sliceable() return (slices_num && slice_path && slices_num > 0) @@ -341,19 +359,20 @@ ..() qdel(src) -/obj/item/reagent_containers/food/snacks/egg/attackby(obj/item/W as obj, mob/user as mob) - if(istype( W, /obj/item/pen/crayon )) +/obj/item/reagent_containers/food/snacks/egg/use_tool(obj/item/W, mob/living/user, list/click_params) + if(istype(W, /obj/item/pen/crayon)) var/obj/item/pen/crayon/C = W var/clr = C.colourName if(!(clr in list("blue","green","mime","orange","purple","rainbow","red","yellow"))) to_chat(usr, SPAN_NOTICE("The egg refuses to take on this color!")) - return + return TRUE to_chat(usr, SPAN_NOTICE("You color \the [src] [clr]")) icon_state = "egg-[clr]" + return TRUE else - ..() + return ..() /obj/item/reagent_containers/food/snacks/egg/blue icon_state = "egg-blue" @@ -799,7 +818,7 @@ /obj/item/reagent_containers/food/snacks/pancakesblu name = "blueberry pancakes" desc = "Pancakes with blueberries, delicious." - icon_state = "pancakes" + icon_state = "pancakes_berry" trash = /obj/item/trash/plate center_of_mass = "x=15;y=11" nutriment_desc = list("pancake" = 8) @@ -1731,6 +1750,34 @@ .=..() reagents.add_reagent(/datum/reagent/slimejelly, 5) +/obj/item/reagent_containers/food/snacks/pbtoast + name = "peanut butter toast" + desc = "A slice of bread covered with peanut butter." + icon_state = "pbtoast" + filling_color = "#b572ab" + center_of_mass = "x=16;y=8" + nutriment_desc = list("toasted bread" = 2) + nutriment_amt = 1 + bitesize = 3 + +/obj/item/reagent_containers/food/snacks/pbtoast/Initialize() + .=..() + reagents.add_reagent(/datum/reagent/nutriment/peanutbutter, 5) + +/obj/item/reagent_containers/food/snacks/ntella_bread + name = "NTella bread slice" + desc = "A slice of bread covered with delicious chocolate-nut spread." + icon_state = "chocobread" + filling_color = "#4b270f" + center_of_mass = "x=16;y=8" + nutriment_desc = list("bread" = 2) + nutriment_amt = 1 + bitesize = 3 + +/obj/item/reagent_containers/food/snacks/ntella_bread/Initialize() + .=..() + reagents.add_reagent(/datum/reagent/nutriment/choconutspread, 5) + /obj/item/reagent_containers/food/snacks/jellyburger name = "jelly burger" desc = "Culinary delight..?" @@ -1987,6 +2034,31 @@ .=..() reagents.add_reagent(/datum/reagent/nutriment/cherryjelly, 5) +/obj/item/reagent_containers/food/snacks/pbjsandwich + name = "pbj sandwich" + desc = "A staple classic lunch of gooey jelly and peanut butter." + icon_state = "pbjsandwich" + trash = /obj/item/trash/plate + filling_color = "#bb6a54" + center_of_mass = "x=16;y=8" + nutriment_desc = list("bread" = 2) + nutriment_amt = 2 + bitesize = 3 + +/obj/item/reagent_containers/food/snacks/pbjsandwich/Initialize() + .=..() + reagents.add_reagent(/datum/reagent/nutriment/peanutbutter, 5) + +/obj/item/reagent_containers/food/snacks/pbjsandwich/slime +/obj/item/reagent_containers/food/snacks/pbjsandwich/slime/Initialize() + .=..() + reagents.add_reagent(/datum/reagent/slimejelly, 5) + +/obj/item/reagent_containers/food/snacks/pbjsandwich/cherry +/obj/item/reagent_containers/food/snacks/pbjsandwich/cherry/Initialize() + .=..() + reagents.add_reagent(/datum/reagent/nutriment/cherryjelly, 5) + /obj/item/reagent_containers/food/snacks/boiledslimecore name = "boiled slime core" desc = "A boiled red thing." @@ -2199,7 +2271,7 @@ filled = TRUE /obj/item/reagent_containers/food/snacks/sliceable/bananabread - name = "banana-nut bread" + name = "banana bread" desc = "A heavenly and filling treat." icon_state = "bananabread" slice_path = /obj/item/reagent_containers/food/snacks/slice/bananabread @@ -2214,7 +2286,7 @@ reagents.add_reagent(/datum/reagent/drink/juice/banana, 20) /obj/item/reagent_containers/food/snacks/slice/bananabread - name = "banana-nut bread slice" + name = "banana bread slice" desc = "A slice of delicious banana bread." icon_state = "bananabreadslice" filling_color = "#ede5ad" @@ -2334,6 +2406,34 @@ /obj/item/reagent_containers/food/snacks/slice/cheesecake/filled filled = TRUE +/obj/item/reagent_containers/food/snacks/sliceable/ntella_cheesecake + name = "NTella cheesecake" + desc = "An elaborate layered cheesecake made with chocolate hazelnut spread. You gain calories just by looking at it for too long." + icon_state = "NTellacheesecake" + slice_path = /obj/item/reagent_containers/food/snacks/slice/ntella_cheesecake + slices_num = 5 + filling_color = "#331c03" + center_of_mass = "x=16;y=10" + nutriment_desc = list("hazelnut chocolate" = 15, "creamy cheese" = 10, "crunchy cookie base" = 5) + nutriment_amt = 20 + bitesize = 2 +/obj/item/reagent_containers/food/snacks/sliceable/ntella_cheesecake/Initialize() + .=..() + reagents.add_reagent(/datum/reagent/nutriment/choconutspread, 15) + +/obj/item/reagent_containers/food/snacks/slice/ntella_cheesecake + name = "NTella cheesecake slice" + desc = "A slice of cake marrying the chocolate taste of NTella with the creamy smoothness of cheesecake, all on a cookie crumble base." + icon_state = "NTellacheesecake_slice" + trash = /obj/item/trash/plate + filling_color = "#331c03" + bitesize = 2 + center_of_mass = "x=16;y=14" + whole_path = /obj/item/reagent_containers/food/snacks/sliceable/ntella_cheesecake + +/obj/item/reagent_containers/food/snacks/slice/ntella_cheesecake/filled + filled = TRUE + /obj/item/reagent_containers/food/snacks/sliceable/plaincake name = "vanilla cake" desc = "A plain cake, not a lie." @@ -2755,7 +2855,7 @@ /obj/item/pizzabox name = "pizza box" desc = "A box suited for pizzas." - icon = 'icons/obj/food/food.dmi' + icon = 'icons/obj/food/food_storage.dmi' icon_state = "pizzabox1" var/open = 0 // Is the box open? @@ -2857,11 +2957,11 @@ update_icon() -/obj/item/pizzabox/attackby( obj/item/I as obj, mob/user as mob ) +/obj/item/pizzabox/use_tool(obj/item/I, mob/living/user, list/click_params) if(istype(I, /obj/item/pizzabox)) var/obj/item/pizzabox/box = I - if(!box.open && !src.open) + if(!box.open && !open) // make a list of all boxes to be added var/list/boxestoadd = list() boxestoadd += box @@ -2870,10 +2970,10 @@ if((length(boxes)+1) + length(boxestoadd) <= 5) if(!user.unEquip(box, src)) - return + FEEDBACK_UNEQUIP_FAILURE(user, box) + return TRUE box.boxes = list()// clear the box boxes so we don't have boxes inside boxes. - Xzibit - src.boxes.Add( boxestoadd ) - + boxes.Add( boxestoadd ) box.update_icon() update_icon() @@ -2882,14 +2982,14 @@ to_chat(user, SPAN_WARNING("The stack is too high!")) else to_chat(user, SPAN_WARNING("Close \the [box] first!")) + return TRUE - return - - if(istype(I, /obj/item/reagent_containers/food/snacks/sliceable/pizza) || istype(I, /obj/item/reagent_containers/food/snacks/sliceable/variable/pizza)) - if(open) + if (istype(I, /obj/item/reagent_containers/food/snacks/sliceable/pizza) || istype(I, /obj/item/reagent_containers/food/snacks/sliceable/variable/pizza)) + if (open) if (!pizza) if(!user.unEquip(I, src)) - return + FEEDBACK_UNEQUIP_FAILURE(user, I) + return TRUE pizza = I update_icon() to_chat(user, SPAN_WARNING("You put \the [I] in \the [src]!")) @@ -2897,12 +2997,13 @@ to_chat(user, SPAN_WARNING("There is already \a [pizza] in \the [src]!")) else to_chat(user, SPAN_WARNING("You try to push \the [I] through the lid but it doesn't work!")) - return + return TRUE - if( istype(I, /obj/item/pen) ) + if (istype(I, /obj/item/pen)) - if( src.open ) - return + if (open) + USE_FEEDBACK_FAILURE("You need to close \the [src].") + return TRUE var/t = sanitize(input("Enter what you want to add to the tag:", "Write", null, null) as text, 30) @@ -2913,8 +3014,9 @@ boxtotagto.boxtag = copytext("[boxtotagto.boxtag][t]", 1, 30) update_icon() - return - ..() + return TRUE + + return ..() /obj/item/pizzabox/margherita/Initialize() . = ..() @@ -2980,11 +3082,13 @@ // reagents.add_reagent(/datum/reagent/nutriment/protein, 1) // Dough + rolling pin = flat dough -/obj/item/reagent_containers/food/snacks/dough/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/reagent_containers/food/snacks/dough/use_tool(obj/item/W, mob/living/user, list/click_params) if(istype(W,/obj/item/material/kitchen/rollingpin)) new /obj/item/reagent_containers/food/snacks/sliceable/flatdough(src) - to_chat(user, "You flatten the dough.") + to_chat(user, SPAN_NOTICE("You flatten the dough.")) qdel(src) + return TRUE + return ..() // slicable into 3x doughslices /obj/item/reagent_containers/food/snacks/sliceable/flatdough @@ -3231,13 +3335,14 @@ nutriment_amt = 3 // potato + knife = raw sticks -/obj/item/reagent_containers/food/snacks/grown/potato/attackby(obj/item/W as obj, mob/user as mob) +/obj/item/reagent_containers/food/snacks/grown/potato/use_tool(obj/item/W, mob/living/user, list/click_params) if(istype(W,/obj/item/material/knife)) new /obj/item/reagent_containers/food/snacks/rawsticks(src) - to_chat(user, "You cut the potato.") + to_chat(user, SPAN_NOTICE("You cut the potato.")) qdel(src) + return TRUE else - ..() + return ..() /obj/item/reagent_containers/food/snacks/rawsticks name = "raw potato sticks" @@ -3460,9 +3565,10 @@ trash = /obj/item/trash/pistachios filling_color = "#825d26" center_of_mass = "x=15;y=9" - nutriment_desc = list("nuts" = 1) - nutriment_amt = 3 bitesize = 0.5 +/obj/item/reagent_containers/food/snacks/pistachios/Initialize() + .=..() + reagents.add_reagent(/datum/reagent/nutriment/almondmeal, 3) /obj/item/reagent_containers/food/snacks/semki name = "semki" @@ -4068,10 +4174,15 @@ trash = /obj/item/trash/saturno filling_color = "#dca319" center_of_mass = "x=15;y=9" - nutriment_desc = list("salt" = 4, "peanut" = 2, "wood?" = 1) - nutriment_amt = 5 + nutriment_desc = list("salt" = 4, "wood?" = 1) + nutriment_amt = 3 bitesize = 2 +/obj/item/reagent_containers/food/snacks/saturn/Initialize() + .=..() + reagents.add_reagent(/datum/reagent/nutriment/groundpeanuts, 3) + + /obj/item/reagent_containers/food/snacks/jupiter name = "jove gello" icon_state = "jupiter" @@ -4156,12 +4267,13 @@ icon_state = "weebonuts" trash = /obj/item/trash/weebonuts desc = "A bag of Red Alert! brand spicy nuts. Goes well with your beer!" - nutriment_desc = list("nuts" = 4, "spicy!" = 1) - nutriment_amt = 5 + nutriment_desc = list("spicy!" = 1) + nutriment_amt = 2 bitesize = 2 /obj/item/reagent_containers/food/snacks/weebonuts/Initialize() .=..() reagents.add_reagent(/datum/reagent/capsaicin = 1) + reagents.add_reagent(/datum/reagent/nutriment/groundpeanuts, 4) /obj/item/reagent_containers/food/snacks/chocobanana name = "choco banang" diff --git a/code/modules/reagents/reagent_containers/food/snacks/donkpocket.dm b/code/modules/reagents/reagent_containers/food/snacks/donkpocket.dm index dbc6cc0deaf47..6ee25c1c99122 100644 --- a/code/modules/reagents/reagent_containers/food/snacks/donkpocket.dm +++ b/code/modules/reagents/reagent_containers/food/snacks/donkpocket.dm @@ -91,7 +91,7 @@ reagents.add_reagent(reagent, hot_reagents[reagent]) was_heated = TRUE SetName("hot " + name) - addtimer(new Callback(src, .proc/UnsetHot), 7 MINUTES) + addtimer(new Callback(src, PROC_REF(UnsetHot)), 7 MINUTES) /obj/item/reagent_containers/food/snacks/donkpocket/proc/UnsetHot() diff --git a/code/modules/reagents/reagent_containers/food/snacks/shellfish.dm b/code/modules/reagents/reagent_containers/food/snacks/shellfish.dm index 59e6ad94911cd..39db523c8628b 100644 --- a/code/modules/reagents/reagent_containers/food/snacks/shellfish.dm +++ b/code/modules/reagents/reagent_containers/food/snacks/shellfish.dm @@ -13,7 +13,7 @@ var/snack_path -/obj/item/shellfish/attackby(obj/item/item, mob/living/user) +/obj/item/shellfish/use_tool(obj/item/item, mob/living/user, list/click_params) if (!item.sharp) return ..() to_chat(user, SPAN_NOTICE("You start to pry open \the [src].")) diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm index 7adbb7a24dcdb..4175497d3de62 100644 --- a/code/modules/reagents/reagent_containers/glass.dm +++ b/code/modules/reagents/reagent_containers/glass.dm @@ -90,9 +90,13 @@ /obj/item/reagent_containers/glass/throw_impact(atom/hit_atom) if (QDELETED(src)) return - if (!LAZYISIN(matter, MATERIAL_GLASS)) + if (!LAZYISIN(matter, MATERIAL_GLASS) && (length(reagents.reagent_list) > 0)) // Не стеклянные предметы просто проливают содержимое на пол/моба, если содержимое есть +// if (length(reagents.reagent_list) > 0) + visible_message( + SPAN_DANGER("\The [src] bounces and spills all its contents!") + ) + reagents.splash(hit_atom, reagents.total_volume) return - if (prob(80)) if (length(reagents.reagent_list) > 0) visible_message( @@ -109,7 +113,7 @@ new /obj/item/material/shard(src.loc) qdel(src) else - if (length(reagents.reagent_list) > 0) + if ((length(reagents.reagent_list) > 0) && (is_open_container() || isnull(is_open_container()))) visible_message( SPAN_DANGER("\The [src] bounces and spills all its contents!"), SPAN_WARNING("You hear the sound of glass hitting something.") @@ -299,7 +303,7 @@ matter = list(MATERIAL_WOOD = 280) volume = 200 -/obj/item/reagent_containers/glass/bucket/attackby(obj/D, mob/user as mob) +/obj/item/reagent_containers/glass/bucket/use_tool(obj/item/D, mob/living/user, list/click_params) if(istype(D, /obj/item/mop)) if(reagents.total_volume < 1) to_chat(user, SPAN_WARNING("\The [src] is empty!")) @@ -307,7 +311,7 @@ reagents.trans_to_obj(D, 5) to_chat(user, SPAN_NOTICE("You wet \the [D] in \the [src].")) playsound(loc, 'sound/effects/slosh.ogg', 25, 1) - return + return TRUE else return ..() diff --git a/code/modules/reagents/reagent_containers/glass/bottle.dm b/code/modules/reagents/reagent_containers/glass/bottle.dm index df85553bac931..c921b069f5210 100644 --- a/code/modules/reagents/reagent_containers/glass/bottle.dm +++ b/code/modules/reagents/reagent_containers/glass/bottle.dm @@ -11,7 +11,7 @@ w_class = ITEM_SIZE_SMALL obj_flags = 0 volume = 60 - + matter = list(MATERIAL_GLASS = 500) /obj/item/reagent_containers/glass/bottle/on_reagent_change() update_icon() @@ -263,7 +263,7 @@ /obj/item/reagent_containers/glass/bottle/adminordrazine name = "Adminordrazine Bottle" desc = "A small bottle. Contains the liquid essence of the gods." - icon = 'icons/obj/food/drinks.dmi' + icon = 'icons/obj/food/drinks/bottles.dmi' icon_state = "holyflask" diff --git a/code/modules/reagents/reagent_containers/hypospray.dm b/code/modules/reagents/reagent_containers/hypospray.dm index 924d0d9895fe0..6a4000d6ba0d8 100644 --- a/code/modules/reagents/reagent_containers/hypospray.dm +++ b/code/modules/reagents/reagent_containers/hypospray.dm @@ -117,13 +117,14 @@ return return ..() -/obj/item/reagent_containers/hypospray/vial/attackby(obj/item/W, mob/user) +/obj/item/reagent_containers/hypospray/vial/use_tool(obj/item/W, mob/living/user, list/click_params) var/usermessage = "" if(istype(W, /obj/item/reagent_containers/glass/beaker/vial)) if(!do_after(user, 1 SECOND, src, DO_PUBLIC_UNIQUE) || !(W in user)) - return 0 + return TRUE if(!user.unEquip(W, src)) - return + FEEDBACK_UNEQUIP_FAILURE(user, W) + return TRUE if(loaded_vial) remove_vial(user, "swap") usermessage = "You load \the [W] into \the [src] as you remove the old one." @@ -138,8 +139,8 @@ user.visible_message(SPAN_NOTICE("[user] has loaded [W] into \the [src]."),SPAN_NOTICE("[usermessage]")) update_icon() playsound(src.loc, 'sound/weapons/empty.ogg', 50, 1) - return - ..() + return TRUE + return ..() /obj/item/reagent_containers/hypospray/vial/use_after(obj/target, mob/living/user, click_parameters) // hyposprays can be dumped into, why not out? uses standard_pour_into helper checks. if (!reagents.total_volume && istype(target, /obj/item/reagent_containers/glass)) diff --git a/code/modules/reagents/reagent_containers/pill.dm b/code/modules/reagents/reagent_containers/pill.dm index 3247ec1a918af..0681f7f3044ff 100644 --- a/code/modules/reagents/reagent_containers/pill.dm +++ b/code/modules/reagents/reagent_containers/pill.dm @@ -398,7 +398,7 @@ // Chopping up pills -/obj/item/reagent_containers/pill/attackby(obj/item/W, mob/user) +/obj/item/reagent_containers/pill/use_tool(obj/item/W, mob/living/user, list/click_params) if(is_sharp(W) || istype(W, /obj/item/card/id)) user.visible_message( SPAN_WARNING("\The [user] starts to gently cut up \the [src] with \a [W]!"), @@ -420,5 +420,6 @@ reagents.trans_to_obj(J, reagents.total_volume) J.get_appearance() qdel(src) + return TRUE return ..() diff --git a/code/modules/recycling/conveyor2.dm b/code/modules/recycling/conveyor2.dm index c713503cddcba..429a0698d58db 100644 --- a/code/modules/recycling/conveyor2.dm +++ b/code/modules/recycling/conveyor2.dm @@ -84,7 +84,7 @@ affecting += AM items_moved++ if(length(affecting)) - addtimer(new Callback(src, .proc/post_process, affecting), 1) // slight delay to prevent infinite propagation due to map order + addtimer(new Callback(src, PROC_REF(post_process), affecting), 1) // slight delay to prevent infinite propagation due to map order /obj/machinery/conveyor/proc/post_process(list/affecting) for(var/A in affecting) @@ -272,12 +272,13 @@ var/id = "" //inherited by the belt matter = list(MATERIAL_STEEL = 400, MATERIAL_PLASTIC = 200) -/obj/item/conveyor_construct/attackby(obj/item/I, mob/user, params) - ..() +/obj/item/conveyor_construct/use_tool(obj/item/I, mob/living/user, list/click_params) if(istype(I, /obj/item/conveyor_switch_construct)) to_chat(user, SPAN_NOTICE("You link the switch to the conveyor belt assembly.")) var/obj/item/conveyor_switch_construct/C = I id = C.id + return TRUE + return ..() /obj/item/conveyor_construct/use_after(atom/A, mob/living/user, click_parameters) if(!istype(A, /turf/simulated/floor) || istype(A, /area/shuttle) || user.incapacitated()) diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index fd7ce6915d233..fc4b4a84055ae 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -704,7 +704,7 @@ GLOBAL_LIST_EMPTY(diversion_junctions) dirs = list( direction, turn(direction, -45), turn(direction, 45)) else dirs = GLOB.alldirs.Copy() - addtimer(new Callback(src, .proc/streak, dirs), 0) + addtimer(new Callback(src, PROC_REF(streak), dirs), 0) /obj/decal/cleanable/blood/gibs/robot/pipe_eject(direction) var/list/dirs @@ -712,4 +712,4 @@ GLOBAL_LIST_EMPTY(diversion_junctions) dirs = list( direction, turn(direction, -45), turn(direction, 45)) else dirs = GLOB.alldirs.Copy() - addtimer(new Callback(src, .proc/streak, dirs), 0) + addtimer(new Callback(src, PROC_REF(streak), dirs), 0) diff --git a/code/modules/recycling/disposalpipe.dm b/code/modules/recycling/disposalpipe.dm index 1b507a75b7846..f08da2651ce24 100644 --- a/code/modules/recycling/disposalpipe.dm +++ b/code/modules/recycling/disposalpipe.dm @@ -63,6 +63,7 @@ // /obj/structure/disposalpipe/proc/transfer(obj/structure/disposalholder/H) var/nextdir = nextdir(H.dir) + H.set_dir(nextdir) var/turf/T = H.nextloc() var/obj/structure/disposalpipe/P = H.findpipe(T) @@ -778,6 +779,16 @@ update() return +/obj/structure/disposalpipe/trunk/Destroy() + if (linked) + if (istype(linked, /obj/machinery/disposal)) + var/obj/machinery/disposal/linked_disposal = linked + if (linked_disposal.trunk == src) + linked_disposal.trunk = null + linked = null + + . = ..() + /obj/structure/disposalpipe/trunk/proc/getlinked() linked = null var/obj/machinery/disposal/D = locate() in src.loc diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index eb286cf4c8571..190555c5481e8 100644 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -287,9 +287,9 @@ var/tag_x var/package_type = "parcel" -/obj/item/smallDelivery/Initialize(mapload, obj/item/parcel, wrap_type) +/obj/item/smallDelivery/Initialize(mapload, obj/item/parcel, wrap_type = "parcel") . = ..() - if (!parcel || !isitem(parcel) || !wrap_type) + if (!parcel || !isitem(parcel)) return INITIALIZE_HINT_QDEL wrapped = parcel @@ -557,6 +557,7 @@ else if(istype(AM, /mob)) var/mob/M = AM M.forceMove(src) + src.flush() /obj/machinery/disposal/deliveryChute/flush() diff --git a/code/modules/research/designs/designs_mechfab.dm b/code/modules/research/designs/designs_mechfab.dm index 1f7e5ed563682..c9f404fa933da 100644 --- a/code/modules/research/designs/designs_mechfab.dm +++ b/code/modules/research/designs/designs_mechfab.dm @@ -468,12 +468,15 @@ id = "mech_sleeper" build_path = /obj/item/mech_equipment/sleeper +//[SIERRA-REMOVE] - Mechs-by-Shegar +/* /datum/design/item/exosuit/mender name = "mounted medigel spray" id = "mech_mender" build_path = /obj/item/mech_equipment/mender materials = list(MATERIAL_STEEL = 10000, MATERIAL_PLASTIC = 15000, MATERIAL_ALUMINIUM = 15000) - +*/ +//[SIERRA-REMOVE] /datum/design/item/exosuit/extinguisher name = "mounted extinguisher" id = "mech_extinguisher" diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm index 8a8ad5dbd3d68..6bb46e6ed23c1 100644 --- a/code/modules/research/rdconsole.dm +++ b/code/modules/research/rdconsole.dm @@ -123,7 +123,7 @@ won't update every console in existence) but it's more of a hassle to do. Also, ..() files = new if(!id) - for(var/obj/machinery/r_n_d/server/centcom/S in SSmachines.machinery) + for(var/obj/machinery/r_n_d/server/centcom/S as anything in SSmachines.get_machinery_of_type(/obj/machinery/r_n_d/server/centcom)) S.update_connections() break @@ -288,7 +288,7 @@ won't update every console in existence) but it's more of a hassle to do. Also, . = TOPIC_HANDLED spawn(30) if(src) - for(var/obj/machinery/r_n_d/server/S in SSmachines.machinery) + for(var/obj/machinery/r_n_d/server/S as anything in SSmachines.get_machinery_of_type(/obj/machinery/r_n_d/server)) var/server_processed = 0 if((id in S.id_with_upload) || istype(S, /obj/machinery/r_n_d/server/centcom)) for(var/datum/tech/T in files.known_tech) @@ -479,7 +479,7 @@ won't update every console in existence) but it's more of a hassle to do. Also, if (!quick_deconstruct) screen = 0.1 linked_destroy.icon_state = "d_analyzer_process" - addtimer(new Callback(src, .proc/finish_deconstruct, W), 24) + addtimer(new Callback(src, PROC_REF(finish_deconstruct), W), 24) /obj/machinery/computer/rdconsole/proc/finish_deconstruct(weakref/W) CHECK_DESTROY @@ -730,6 +730,7 @@ won't update every console in existence) but it's more of a hassle to do. Also, if(2.0) dat += "Main Menu
" dat += "NO DESTRUCTIVE ANALYZER LINKED TO CONSOLE

" + dat += "Re-sync with Nearby Devices
" if(2.1) dat += "Main Menu
" @@ -758,6 +759,7 @@ won't update every console in existence) but it's more of a hassle to do. Also, if(3.0) dat += "Main Menu
" dat += "NO PROTOLATHE LINKED TO CONSOLE

" + dat += "Re-sync with Nearby Devices
" if(3.1) CHECK_LATHE @@ -869,6 +871,7 @@ won't update every console in existence) but it's more of a hassle to do. Also, if(4.0) dat += "Main Menu
" dat += "NO CIRCUIT IMPRINTER LINKED TO CONSOLE

" + dat += "Re-sync with Nearby Devices
" if(4.1) CHECK_IMPRINTER diff --git a/code/modules/research/server.dm b/code/modules/research/server.dm index c1127a15aac42..bc1652a838b32 100644 --- a/code/modules/research/server.dm +++ b/code/modules/research/server.dm @@ -123,7 +123,7 @@ /obj/machinery/r_n_d/server/centcom/proc/update_connections() var/list/no_id_servers = list() var/list/server_ids = list() - for(var/obj/machinery/r_n_d/server/S in SSmachines.machinery) + for(var/obj/machinery/r_n_d/server/S as anything in SSmachines.get_machinery_of_type(/obj/machinery/r_n_d/server)) switch(S.server_id) if(-1) continue @@ -173,20 +173,20 @@ temp_server = null consoles = list() servers = list() - for(var/obj/machinery/r_n_d/server/S in SSmachines.machinery) + for(var/obj/machinery/r_n_d/server/S as anything in SSmachines.get_machinery_of_type(/obj/machinery/r_n_d/server)) if(S.server_id == text2num(href_list["access"]) || S.server_id == text2num(href_list["data"]) || S.server_id == text2num(href_list["transfer"])) temp_server = S break if(href_list["access"]) screen = 1 - for(var/obj/machinery/computer/rdconsole/C in SSmachines.machinery) + for(var/obj/machinery/computer/rdconsole/C as anything in SSmachines.get_machinery_of_type(/obj/machinery/computer/rdconsole)) if(C.sync) consoles += C else if(href_list["data"]) screen = 2 else if(href_list["transfer"]) screen = 3 - for(var/obj/machinery/r_n_d/server/S in SSmachines.machinery) + for(var/obj/machinery/r_n_d/server/S as anything in SSmachines.get_machinery_of_type(/obj/machinery/r_n_d/server)) if(S == src) continue servers += S @@ -240,7 +240,7 @@ if(0) //Main Menu dat += "Connected Servers:

" var/turf/T = get_turf(src) - for(var/obj/machinery/r_n_d/server/S in SSmachines.machinery) + for(var/obj/machinery/r_n_d/server/S as anything in SSmachines.get_machinery_of_type(/obj/machinery/r_n_d/server)) var/turf/ST = get_turf(S) if((istype(S, /obj/machinery/r_n_d/server/centcom) && !badmin) || (ST && !AreConnectedZLevels(ST.z, T.z))) continue diff --git a/code/modules/shield_generators/shield.dm b/code/modules/shield_generators/shield.dm index 155f8d6aa4b8c..5d1d1d8915dad 100644 --- a/code/modules/shield_generators/shield.dm +++ b/code/modules/shield_generators/shield.dm @@ -336,7 +336,7 @@ affected_shields |= src i-- if(i) - addtimer(new Callback(src, .proc/spread_impact_effect, i, affected_shields), 2) + addtimer(new Callback(src, PROC_REF(spread_impact_effect), i, affected_shields), 2) /obj/shield/proc/spread_impact_effect(i, list/affected_shields = list()) for(var/direction in GLOB.cardinal) diff --git a/code/modules/shieldgen/emergency_shield.dm b/code/modules/shieldgen/emergency_shield.dm index a2b24a53a5c9d..9d9107c0383c2 100644 --- a/code/modules/shieldgen/emergency_shield.dm +++ b/code/modules/shieldgen/emergency_shield.dm @@ -41,7 +41,7 @@ return if (health_mod < -1) // To prevent slow degradation proccing this constantly set_opacity(TRUE) - addtimer(new Callback(src, /atom/proc/set_opacity, FALSE), 2 SECONDS, TIMER_UNIQUE | TIMER_OVERRIDE) + addtimer(new Callback(src, TYPE_PROC_REF(/atom, set_opacity), FALSE), 2 SECONDS, TIMER_UNIQUE | TIMER_OVERRIDE) /obj/machinery/shield/on_death() visible_message(SPAN_NOTICE("\The [src] dissipates!")) @@ -66,6 +66,7 @@ var/check_delay = 60 //periodically recheck if we need to rebuild a shield use_power = POWER_USE_OFF idle_power_usage = 0 + obj_flags = OBJ_FLAG_ANCHORABLE /obj/machinery/shieldgen/Destroy() collapse_shields() diff --git a/code/modules/shuttles/landmarks.dm b/code/modules/shuttles/landmarks.dm index 963fe3859bfae..be3eb688f6a80 100644 --- a/code/modules/shuttles/landmarks.dm +++ b/code/modules/shuttles/landmarks.dm @@ -151,11 +151,11 @@ log_debug(append_admin_tools("\A [src] was initialized with a beacon already has a synced landmark.", location = get_turf(src))) return INITIALIZE_HINT_QDEL src.beacon = beacon - GLOB.moved_event.register(beacon, src, /obj/shuttle_landmark/automatic/beacon/proc/update_beacon_moved) + GLOB.moved_event.register(beacon, src, TYPE_PROC_REF(/obj/shuttle_landmark/automatic/beacon, update_beacon_moved)) /obj/shuttle_landmark/automatic/beacon/Destroy() - GLOB.moved_event.unregister(beacon, src, /obj/shuttle_landmark/automatic/beacon/proc/update_beacon_moved) + GLOB.moved_event.unregister(beacon, src, TYPE_PROC_REF(/obj/shuttle_landmark/automatic/beacon, update_beacon_moved)) if (beacon?.active) log_debug(append_admin_tools("\A [src] was destroyed with a still active beacon.", location = get_turf(beacon))) beacon.deactivate() @@ -176,7 +176,7 @@ /// Desynchronizes the effect from the beacon, rendering it a permanent landmark. /obj/shuttle_landmark/automatic/beacon/proc/desync_beacon() - GLOB.moved_event.unregister(beacon, src, /obj/shuttle_landmark/automatic/beacon/proc/update_beacon_moved) + GLOB.moved_event.unregister(beacon, src, TYPE_PROC_REF(/obj/shuttle_landmark/automatic/beacon, update_beacon_moved)) if (beacon?.active) beacon.deactivate(TRUE, TRUE) beacon = null diff --git a/code/modules/species/outsider/starlight.dm b/code/modules/species/outsider/starlight.dm index 6259568a7195c..9b3e6329404dc 100644 --- a/code/modules/species/outsider/starlight.dm +++ b/code/modules/species/outsider/starlight.dm @@ -34,7 +34,7 @@ return FALSE /datum/species/starlight/handle_death(mob/living/carbon/human/H) - addtimer(new Callback(H,/mob/proc/dust),0) + addtimer(new Callback(H, TYPE_PROC_REF(/mob, dust)),0) /datum/species/starlight/starborn name = "Starborn" diff --git a/code/modules/species/outsider/zombie.dm b/code/modules/species/outsider/zombie.dm index 2d55dce769009..20430f565fdab 100644 --- a/code/modules/species/outsider/zombie.dm +++ b/code/modules/species/outsider/zombie.dm @@ -431,7 +431,7 @@ GLOBAL_LIST_INIT(zombie_species, list(\ drop_from_inventory(held_r) sleep(150) - addtimer(new Callback(src, .proc/transform_zombie), 20) + addtimer(new Callback(src, PROC_REF(transform_zombie)), 20) /mob/living/carbon/human/proc/transform_zombie() if (QDELETED(src)) diff --git a/code/modules/species/species.dm b/code/modules/species/species.dm index 9e3bfe0c1f699..56ff8b9b31f1f 100644 --- a/code/modules/species/species.dm +++ b/code/modules/species/species.dm @@ -489,7 +489,7 @@ The slots that you can use are found in items_clothing.dm and are the inventory /datum/species/proc/handle_pre_spawn(mob/living/carbon/human/H) // Changing species can change NPC behaviour, so delete the holder if there is one if (H.ai_holder && istype(H.ai_holder, /datum)) - GLOB.stat_set_event.unregister(H, H.ai_holder, /datum/ai_holder/proc/holder_stat_change) + GLOB.stat_set_event.unregister(H, H.ai_holder, TYPE_PROC_REF(/datum/ai_holder, holder_stat_change)) QDEL_NULL(H.ai_holder) /datum/species/proc/handle_death(mob/living/carbon/human/H) //Handles any species-specific death events (such as dionaea nymph spawns). @@ -730,7 +730,7 @@ The slots that you can use are found in items_clothing.dm and are the inventory continue if(S.subspecies_allowed && !(name in S.subspecies_allowed)) continue - ADD_SORTED(L, hairstyle, /proc/cmp_text_asc) + ADD_SORTED(L, hairstyle, GLOBAL_PROC_REF(cmp_text_asc)) L[hairstyle] = S return L @@ -755,7 +755,9 @@ The slots that you can use are found in items_clothing.dm and are the inventory continue if(S.subspecies_allowed && !(name in S.subspecies_allowed)) continue - ADD_SORTED(facial_hair_style_by_gender, facialhairstyle, /proc/cmp_text_asc) + if(src.species_flags && SPECIES_IPC) + break + ADD_SORTED(facial_hair_style_by_gender, facialhairstyle, GLOBAL_PROC_REF(cmp_text_asc)) facial_hair_style_by_gender[facialhairstyle] = S return facial_hair_style_by_gender diff --git a/code/modules/species/species_attack.dm b/code/modules/species/species_attack.dm index 9ce9b45d326d5..43d077968dfe0 100644 --- a/code/modules/species/species_attack.dm +++ b/code/modules/species/species_attack.dm @@ -37,6 +37,8 @@ /datum/unarmed_attack/claws/show_attack(mob/living/carbon/human/user, mob/living/carbon/human/target, zone, attack_damage) var/obj/item/organ/external/affecting = target.get_organ(zone) + var/datum/pronouns/user_pronouns = user.choose_from_pronouns() + var/datum/pronouns/target_pronouns = target.choose_from_pronouns() if (!affecting) to_chat(user, SPAN_WARNING("\The [target] does not have that bodypart!")) @@ -45,34 +47,35 @@ attack_damage = clamp(attack_damage, 1, 5) if(target == user) - user.visible_message(SPAN_DANGER("[user] [pick(attack_verb)] \himself in the [affecting.name]!")) + var/datum/pronouns/pronouns = user.choose_from_pronouns() + user.visible_message(SPAN_DANGER("\The [user] [pick(attack_verb)] [pronouns.self] in the [affecting.name]!")) return 0 switch(zone) if(BP_HEAD, BP_MOUTH, BP_EYES) // ----- HEAD ----- // switch(attack_damage) - if(1 to 2) user.visible_message(SPAN_DANGER("[user] scratched [target] across \his cheek!")) + if(1 to 2) user.visible_message(SPAN_DANGER("\The [user] scratched \the [target] across [target_pronouns.his] cheek!")) if(3 to 4) user.visible_message(pick( - 80; user.visible_message(SPAN_CLASS("danger", "[user] [pick(attack_verb)] [target]'s [pick("face", "neck", affecting.name)]!")), - 20; user.visible_message(SPAN_CLASS("danger", "[user] [pick(attack_verb)] [pick("[target] in the [affecting.name]", "[target] across \his [pick("face", "neck", affecting.name)]")]!")), + 80; user.visible_message(SPAN_CLASS("danger", "\The [user] [pick(attack_verb)] \the [target]'s [pick("face", "neck", affecting.name)]!")), + 20; user.visible_message(SPAN_CLASS("danger", "\The [user] [pick(attack_verb)] [pick("\the [target] in the [affecting.name]", "\the [target] across [target_pronouns.his] [pick("face", "neck", affecting.name)]")]!")), )) if(5) user.visible_message(pick( - SPAN_CLASS("danger", "[user] rakes \his [pick(attack_noun)] across [target]'s [pick("face", "neck", affecting.name)]!"), - SPAN_CLASS("danger", "[user] tears \his [pick(attack_noun)] into [target]'s [pick("face", "neck", affecting.name)]!"), + SPAN_CLASS("danger", "\The [user] rakes [user_pronouns.his] [pick(attack_noun)] across \the [target]'s [pick("face", "neck", affecting.name)]!"), + SPAN_CLASS("danger", "\The [user] tears [user_pronouns.his] [pick(attack_noun)] into \the [target]'s [pick("face", "neck", affecting.name)]!"), )) else // ----- BODY ----- // switch(attack_damage) - if(1 to 2) user.visible_message(SPAN_CLASS("danger", "[user] [pick("scratched", "grazed")] [target]'s [affecting.name]!")) + if(1 to 2) user.visible_message(SPAN_CLASS("danger", "\The [user] [pick("scratched", "grazed")] \the [target]'s [affecting.name]!")) if(3 to 4) user.visible_message(pick( - 80; user.visible_message(SPAN_DANGER("[user] [pick(attack_verb)] [target]'s [affecting.name]!")), - 20; user.visible_message(SPAN_CLASS("danger", "[user] [pick(attack_verb)] [pick("[target] in the [affecting.name]", "[target] across \his [affecting.name]")]!")), + 80; user.visible_message(SPAN_DANGER("\The [user] [pick(attack_verb)] \the [target]'s [affecting.name]!")), + 20; user.visible_message(SPAN_CLASS("danger", "\The [user] [pick(attack_verb)] [pick("\the [target] in the [affecting.name]", "\the [target] across [target_pronouns.his] [affecting.name]")]!")), )) - if(5) user.visible_message(SPAN_CLASS("danger", "[user] tears \his [pick(attack_noun)] [pick("deep into", "into", "across")] [target]'s [affecting.name]!")) + if(5) user.visible_message(SPAN_CLASS("danger", "\The [user] tears [user_pronouns.his] [pick(attack_noun)] [pick("deep into", "into", "across")] \the [target]'s [affecting.name]!")) /datum/unarmed_attack/claws/strong attack_verb = list("slashed") @@ -108,7 +111,7 @@ /datum/unarmed_attack/stomp/weak/show_attack(mob/living/carbon/human/user, mob/living/carbon/human/target, zone, attack_damage) var/obj/item/organ/external/affecting = target.get_organ(zone) - user.visible_message(SPAN_WARNING("[user] jumped up and down on \the [target]'s [affecting.name]!")) + user.visible_message(SPAN_WARNING("\The [user] jumped up and down on \the [target]'s [affecting.name]!")) playsound(user.loc, attack_sound, 25, 1, -1) /datum/unarmed_attack/tail //generally meant for people like unathi @@ -140,17 +143,19 @@ /datum/unarmed_attack/tail/show_attack(mob/living/carbon/human/user, mob/living/carbon/human/target, zone, attack_damage) var/obj/item/organ/external/affecting = target.get_organ(zone) + var/datum/pronouns/user_pronouns = user.choose_from_pronouns() + var/datum/pronouns/target_pronouns = target.choose_from_pronouns() var/organ = affecting.name attack_damage = clamp(attack_damage, 1, 6) attack_damage = 3 + attack_damage - rand(1, 5) switch(attack_damage) - if(1 to 5) user.visible_message(SPAN_DANGER("[user] glanced [target] with their [pick(attack_noun)] in the [organ]!")) + if(1 to 5) user.visible_message(SPAN_DANGER("\The [user] glanced \the [target] with [user_pronouns.his] [pick(attack_noun)] in the [organ]!")) - if(6 to 7) user.visible_message(SPAN_DANGER("[user] [pick(attack_verb)] [target] in \his [organ] with their [pick(attack_noun)]!")) + if(6 to 7) user.visible_message(SPAN_DANGER("\The [user] [pick(attack_verb)] \the [target] in [target_pronouns.his] [organ] with [user_pronouns.his] [pick(attack_noun)]!")) - if(8) user.visible_message(SPAN_DANGER("[user] landed a heavy blow with their [pick(attack_noun)] against [target]'s [organ]!")) + if(8) user.visible_message(SPAN_DANGER("\The [user] landed a heavy blow with [user_pronouns.his] [pick(attack_noun)] against \the [target]'s [organ]!")) /datum/unarmed_attack/nabber attack_verb = list("mauled", "slashed", "struck", "pierced") diff --git a/code/modules/species/station/machine.dm b/code/modules/species/station/machine.dm index 92f56902f0c4e..24899b3232155 100644 --- a/code/modules/species/station/machine.dm +++ b/code/modules/species/station/machine.dm @@ -64,7 +64,13 @@ HOME_SYSTEM_LUNA, HOME_SYSTEM_VENUS, HOME_SYSTEM_CERES, - HOME_SYSTEM_PLUTO, + // [SIERRA-REMOVE] - EXPANDED_CULTURE_DESCRIPTOR + /* + HOME_SYSTEM_KUIPERB, + HOME_SYSTEM_KUIPERD, + */ + // [/SIERRA-REMOVE] + HOME_SYSTEM_MAGNITKA, HOME_SYSTEM_TAU_CETI, HOME_SYSTEM_HELIOS, HOME_SYSTEM_SAFFAR, diff --git a/code/modules/species/station/nabber.dm b/code/modules/species/station/nabber.dm index 8dadb919ba88b..71452e927df18 100644 --- a/code/modules/species/station/nabber.dm +++ b/code/modules/species/station/nabber.dm @@ -287,11 +287,7 @@ var/image/threat_image = skin_overlays[image_key] if(!threat_image) - var/icon/base_icon = icon(H.stand_icon) - var/icon/I = new('icons/mob/human_races/species/nabber/threat.dmi', "threat") - base_icon.Blend(COLOR_BLACK, ICON_MULTIPLY) - base_icon.Blend(I, ICON_ADD) - threat_image = image(base_icon) + threat_image = image('icons/mob/human_races/species/nabber/threat.dmi', "threat") skin_overlays[image_key] = threat_image return(threat_image) diff --git a/code/modules/species/station/prometheans.dm b/code/modules/species/station/prometheans.dm index 99d16cebb10ff..10dd4b9f0af32 100644 --- a/code/modules/species/station/prometheans.dm +++ b/code/modules/species/station/prometheans.dm @@ -85,7 +85,7 @@ var/global/datum/species/shapeshifter/promethean/prometheans H.apply_stored_shock_to(target) /datum/species/shapeshifter/promethean/handle_death(mob/living/carbon/human/H) - addtimer(new Callback(H, /mob/proc/gib),0) + addtimer(new Callback(H, TYPE_PROC_REF(/mob, gib)),0) /datum/species/shapeshifter/promethean/handle_environment_special(mob/living/carbon/human/H) diff --git a/code/modules/species/station/station.dm b/code/modules/species/station/station.dm index b32248665fa6c..983238c860bd1 100644 --- a/code/modules/species/station/station.dm +++ b/code/modules/species/station/station.dm @@ -31,7 +31,9 @@ CULTURE_HUMAN_VENUSIAN, CULTURE_HUMAN_VENUSLOW, CULTURE_HUMAN_BELTER, - CULTURE_HUMAN_PLUTO, + CULTURE_HUMAN_KUIPERI, + CULTURE_HUMAN_KUIPERO, + CULTURE_HUMAN_MAGNITKA, CULTURE_HUMAN_EARTH, CULTURE_HUMAN_CETIN, CULTURE_HUMAN_CETIS, @@ -350,7 +352,7 @@ var/mob/living/carbon/alien/diona/nymph = new (target) var/datum/ghosttrap/trap = get_ghost_trap("living plant") trap.request_player(nymph, "A diona nymph has split from its gestalt.", 30 SECONDS) - addtimer(new Callback(nymph, /mob/living/carbon/alien/diona/proc/check_spawn_death), 30 SECONDS) + addtimer(new Callback(nymph, TYPE_PROC_REF(/mob/living/carbon/alien/diona, check_spawn_death)), 30 SECONDS) /mob/living/carbon/alien/diona/proc/check_spawn_death() if (QDELETED(src)) @@ -393,7 +395,7 @@ /datum/species/diona/handle_post_spawn(mob/living/carbon/human/H) H.gender = NEUTER . = ..() - addtimer(new Callback(src, .proc/fill_with_nymphs, H), 0) + addtimer(new Callback(src, PROC_REF(fill_with_nymphs), H), 0) /datum/species/diona/proc/fill_with_nymphs(mob/living/carbon/human/H) diff --git a/code/modules/spells/general/veil_of_shadows.dm b/code/modules/spells/general/veil_of_shadows.dm index b51144b0fb4b8..19d9671bfad9e 100644 --- a/code/modules/spells/general/veil_of_shadows.dm +++ b/code/modules/spells/general/veil_of_shadows.dm @@ -22,8 +22,8 @@ H.AddMovementHandler(/datum/movement_handler/mob/incorporeal) if(H.add_cloaking_source(src)) H.visible_message(SPAN_WARNING("\The [H] shrinks from view!")) - GLOB.moved_event.register(H,src,.proc/check_light) - timer_id = addtimer(new Callback(src,.proc/cancel_veil),duration, TIMER_STOPPABLE) + GLOB.moved_event.register(H,src,PROC_REF(check_light)) + timer_id = addtimer(new Callback(src, PROC_REF(cancel_veil)), duration, TIMER_STOPPABLE) /spell/veil_of_shadows/proc/cancel_veil() var/mob/living/carbon/human/H = holder @@ -35,7 +35,7 @@ drop_cloak() else GLOB.moved_event.unregister(H,src) - GLOB.moved_event.register(H,src,.proc/drop_cloak) + GLOB.moved_event.register(H,src,PROC_REF(drop_cloak)) /spell/veil_of_shadows/proc/drop_cloak() var/mob/living/carbon/human/H = holder diff --git a/code/modules/spells/hand/hand.dm b/code/modules/spells/hand/hand.dm index ee85e96dd8783..8102b1aec8972 100644 --- a/code/modules/spells/hand/hand.dm +++ b/code/modules/spells/hand/hand.dm @@ -75,7 +75,7 @@ /spell/hand/duration/cast(list/targets, mob/user) . = ..() if(.) - hand_timer = addtimer(new Callback(src, .proc/cancel_hand), hand_duration, TIMER_STOPPABLE|TIMER_UNIQUE|TIMER_NO_HASH_WAIT|TIMER_OVERRIDE) + hand_timer = addtimer(new Callback(src, PROC_REF(cancel_hand)), hand_duration, TIMER_STOPPABLE|TIMER_UNIQUE|TIMER_NO_HASH_WAIT|TIMER_OVERRIDE) /spell/hand/duration/cancel_hand() deltimer(hand_timer) diff --git a/code/modules/spells/racial_wizard.dm b/code/modules/spells/racial_wizard.dm index 2e3008986150c..b8119d8c4da2a 100644 --- a/code/modules/spells/racial_wizard.dm +++ b/code/modules/spells/racial_wizard.dm @@ -226,8 +226,8 @@ var/mob/living/L = targets[1] vision.possess(L) - GLOB.destroyed_event.register(L, src, /spell/camera_connection/proc/release) - GLOB.logged_out_event.register(L, src, /spell/camera_connection/proc/release) + GLOB.destroyed_event.register(L, src, TYPE_PROC_REF(/spell/camera_connection, release)) + GLOB.logged_out_event.register(L, src, TYPE_PROC_REF(/spell/camera_connection, release)) L.verbs += /mob/living/proc/release_eye /spell/camera_connection/proc/release(mob/living/L) diff --git a/code/modules/spells/spellbook.dm b/code/modules/spells/spellbook.dm index 7d862800ab49a..911c5f40cc762 100644 --- a/code/modules/spells/spellbook.dm +++ b/code/modules/spells/spellbook.dm @@ -78,14 +78,14 @@ var/global/list/artefact_feedback = list(/obj/structure/closet/wizard/armor = investing_time = max(investing_time - 6000,1) //subtract 10 minutes. Make sure it doesn't act funky at the beginning of the game. -/obj/item/spellbook/attackby(obj/item/I as obj, mob/user as mob) +/obj/item/spellbook/use_tool(obj/item/I, mob/living/user, list/click_params) if(investing_time) var/list/objects = spellbook.sacrifice_objects if(objects && length(objects)) for(var/type in objects) if(istype(I,type)) make_sacrifice(I,user) - return + return TRUE if(I.reagents) var/datum/reagents/R = I.reagents var/list/reagent_list = spellbook.sacrifice_reagents @@ -93,8 +93,8 @@ var/global/list/artefact_feedback = list(/obj/structure/closet/wizard/armor = for(var/id in reagent_list) if(R.has_reagent(id,5)) make_sacrifice(I,user, id) - return 1 - ..() + return TRUE + return ..() /obj/item/spellbook/interact(mob/user as mob) var/dat = null diff --git a/code/modules/spells/spells.dm b/code/modules/spells/spells.dm index f87ac09ba10a7..7848fcd2737ae 100644 --- a/code/modules/spells/spells.dm +++ b/code/modules/spells/spells.dm @@ -16,16 +16,6 @@ if(Sp_HOLDVAR) statpanel(S.panel,"[S.holder_var_type] [S.holder_var_amount]",S.connected_button) -//A fix for when a spell is created before a mob is created -/mob/Login() - . = ..() - if(mind) - if(!mind.learned_spells) - mind.learned_spells = list() - if(ability_master && ability_master.spell_objects) - for(var/obj/screen/ability/spell/screen in ability_master.spell_objects) - var/spell/S = screen.spell - mind.learned_spells |= S /proc/restore_spells(mob/H) if(H.mind && H.mind.learned_spells) diff --git a/code/modules/spells/targeted/cleric_spells.dm b/code/modules/spells/targeted/cleric_spells.dm index 6538a13edf412..929d464e2f0e7 100644 --- a/code/modules/spells/targeted/cleric_spells.dm +++ b/code/modules/spells/targeted/cleric_spells.dm @@ -178,7 +178,7 @@ var/time = (L.getBruteLoss() + L.getFireLoss()) * 20 L.status_flags &= GODMODE to_chat(L,SPAN_NOTICE("You will be in stasis for [time/10] second\s.")) - addtimer(new Callback(src,.proc/cancel_rift),time) + addtimer(new Callback(src,PROC_REF(cancel_rift)),time) /spell/targeted/heal_target/trance/Destroy() cancel_rift() @@ -232,7 +232,7 @@ should_wait = 0 break //Don't need to check anymore. if(should_wait) - addtimer(new Callback(src,.proc/check_for_revoke,targets), 30 SECONDS) + addtimer(new Callback(src,PROC_REF(check_for_revoke),targets), 30 SECONDS) else revoke_spells() diff --git a/code/modules/spells/targeted/ethereal_jaunt.dm b/code/modules/spells/targeted/ethereal_jaunt.dm index 04ad4dfda8d56..15aa0ee2d266d 100644 --- a/code/modules/spells/targeted/ethereal_jaunt.dm +++ b/code/modules/spells/targeted/ethereal_jaunt.dm @@ -50,7 +50,7 @@ jaunt_disappear(animation, target) jaunt_steam(mobloc) target.forceMove(jaunt_holder) - addtimer(new Callback(src, .proc/start_reappear, target), duration) + addtimer(new Callback(src, PROC_REF(start_reappear), target), duration) /spell/targeted/ethereal_jaunt/proc/start_reappear(mob/living/user) var/mob_loc = jaunt_holder.last_valid_turf @@ -58,7 +58,7 @@ jaunt_steam(mob_loc) jaunt_reappear(animation, user) animation.forceMove(mob_loc) - addtimer(new Callback(src, .proc/reappear, mob_loc, user), reappear_duration) + addtimer(new Callback(src, PROC_REF(reappear), mob_loc, user), reappear_duration) /spell/targeted/ethereal_jaunt/proc/reappear(mob_loc, mob/living/user) if(!user.forceMove(mob_loc)) @@ -124,7 +124,7 @@ else to_chat(user, SPAN_WARNING("Some strange aura is blocking the way!")) canmove = 0 - addtimer(new Callback(src, .proc/allow_move), 2) + addtimer(new Callback(src, PROC_REF(allow_move)), 2) /obj/dummy/spell_jaunt/proc/allow_move() canmove = TRUE diff --git a/code/modules/spells/targeted/shapeshift.dm b/code/modules/spells/targeted/shapeshift.dm index 6cd7dfffc37f1..6910886d3c21c 100644 --- a/code/modules/spells/targeted/shapeshift.dm +++ b/code/modules/spells/targeted/shapeshift.dm @@ -55,9 +55,9 @@ M.forceMove(trans) //move inside the new dude to hide him. M.status_flags |= GODMODE //don't want him to die or breathe or do ANYTHING transformed_dudes[trans] = M - GLOB.death_event.register(trans,src,/spell/targeted/shapeshift/proc/stop_transformation) - GLOB.destroyed_event.register(trans,src,/spell/targeted/shapeshift/proc/stop_transformation) - GLOB.destroyed_event.register(M, src, /spell/targeted/shapeshift/proc/destroyed_transformer) + GLOB.death_event.register(trans, src, TYPE_PROC_REF(/spell/targeted/shapeshift, stop_transformation)) + GLOB.destroyed_event.register(trans, src, TYPE_PROC_REF(/spell/targeted/shapeshift, stop_transformation)) + GLOB.destroyed_event.register(M, src, TYPE_PROC_REF(/spell/targeted/shapeshift, destroyed_transformer)) if(duration) spawn(duration) stop_transformation(trans) diff --git a/code/modules/sprite_accessories/accessory_hair_fade.dm b/code/modules/sprite_accessories/accessory_hair_fade.dm index 47fb5120f4055..45f3170f62e2d 100644 --- a/code/modules/sprite_accessories/accessory_hair_fade.dm +++ b/code/modules/sprite_accessories/accessory_hair_fade.dm @@ -5,6 +5,7 @@ draw_target = MARKING_TARGET_HAIR draw_order = 50 //before ears & horns disallows = list(/datum/sprite_accessory/marking/hair_fade) + blend = ICON_MULTIPLY /datum/sprite_accessory/marking/hair_fade/fade_up_short name = "Fade (Up, Short)" diff --git a/code/modules/sprite_accessories/accessory_skrell.dm b/code/modules/sprite_accessories/accessory_skrell.dm index 93d5574f841e9..500859aef9893 100644 --- a/code/modules/sprite_accessories/accessory_skrell.dm +++ b/code/modules/sprite_accessories/accessory_skrell.dm @@ -15,3 +15,41 @@ icon_state = "default" icon = 'icons/mob/human_races/species/skrell/body.dmi' species_allowed = list(SPECIES_SKRELL) + +/datum/sprite_accessory/marking/skrell + icon = 'icons/mob/human_races/species/skrell/markings.dmi' + draw_order = 50 + use_organ_tag = FALSE + species_allowed = list(SPECIES_SKRELL) + +/datum/sprite_accessory/marking/skrell/body + name = "Spots (Right, Body, Skrell)" + draw_target = MARKING_TARGET_SKIN + icon_state = "spots-right" + body_parts = list( + BP_HEAD, + BP_CHEST, + BP_GROIN, + BP_L_ARM, + BP_L_HAND, + BP_R_ARM, + BP_R_HAND, + BP_L_LEG, + BP_L_FOOT, + BP_R_LEG, + BP_R_FOOT + ) + +/datum/sprite_accessory/marking/skrell/body/left + name = "Spots (Left, Body, Skrell)" + icon_state = "spots-left" + +/datum/sprite_accessory/marking/skrell/head + name = "Spots (Right, Tentacles, Skrell)" + draw_target = MARKING_TARGET_HAIR + icon_state = "spots-hair-right" + body_parts = list(BP_HEAD) + +/datum/sprite_accessory/marking/skrell/head/left + name = "Spots (Left, Tentacles, Skrell)" + icon_state = "spots-hair-left" \ No newline at end of file diff --git a/code/modules/sprite_accessories/accessory_tattoo.dm b/code/modules/sprite_accessories/accessory_tattoo.dm index e4c5e4042ef37..d0723ca89096f 100644 --- a/code/modules/sprite_accessories/accessory_tattoo.dm +++ b/code/modules/sprite_accessories/accessory_tattoo.dm @@ -85,11 +85,9 @@ icon_state = "campbell-arm-right" -/* The icon for this needs work. -/datum/sprite_accessory/marking/head/tiger +/datum/sprite_accessory/marking/tattoo/head/tiger name = "Tattoo (Tiger Stripes, Head)" icon_state = "tiger-head" -*/ /datum/sprite_accessory/marking/tattoo/chest/tiger diff --git a/code/modules/sprite_accessories/accessory_unathi.dm b/code/modules/sprite_accessories/accessory_unathi.dm index 9c9dd578e7f44..42d2679ae43b3 100644 --- a/code/modules/sprite_accessories/accessory_unathi.dm +++ b/code/modules/sprite_accessories/accessory_unathi.dm @@ -110,6 +110,7 @@ /datum/sprite_accessory/marking/unathi/body icon = 'icons/mob/human_races/species/unathi/body.dmi' draw_order = 50 + use_organ_tag = FALSE /datum/sprite_accessory/marking/unathi/body/head @@ -191,26 +192,6 @@ icon_state = "plating_f_chest" -/datum/sprite_accessory/marking/unathi/body/arm_left/plating_female - name = "Plating (L. Arm, Female)" - icon_state = "plating_f_l_arm" - - -/datum/sprite_accessory/marking/unathi/body/arm_right/plating_female - name = "Plating (R. Arm, Female)" - icon_state = "plating_f_r_arm" - - -/datum/sprite_accessory/marking/unathi/body/leg_left/plating_female - name = "Plating (L. Leg, Female)" - icon_state = "plating_f_l_leg" - - -/datum/sprite_accessory/marking/unathi/body/leg_right/plating_female - name = "Plating (R. Leg, Female)" - icon_state = "plating_f_r_leg" - - /datum/sprite_accessory/marking/unathi/body/plating_male_full name = "Plating (Full, Male)" icon_state = "plating_m_full" @@ -235,26 +216,6 @@ icon_state = "plating_m_chest" -/datum/sprite_accessory/marking/unathi/body/arm_left/plating_male - name = "Plating (L. Arm, Male)" - icon_state = "plating_m_l_arm" - - -/datum/sprite_accessory/marking/unathi/body/arm_right/plating_male - name = "Plating (R. Arm, Male)" - icon_state = "plating_m_r_arm" - - -/datum/sprite_accessory/marking/unathi/body/leg_left/plating_male - name = "Plating (L. Leg, Male)" - icon_state = "plating_m_l_leg" - - -/datum/sprite_accessory/marking/unathi/body/leg_right/plating_male - name = "Plating (R. Leg, Male)" - icon_state = "plating_m_r_leg" - - /datum/sprite_accessory/marking/unathi/tattoo icon = 'icons/mob/human_races/species/unathi/tattoo.dmi' draw_order = 60 @@ -262,57 +223,90 @@ /datum/sprite_accessory/marking/unathi/tattoo/head - disallows = list(/datum/sprite_accessory/marking/tattoo/head) + disallows = list( + /datum/sprite_accessory/marking/tattoo/head, + /datum/sprite_accessory/marking/unathi/tattoo/head + ) body_parts = list(BP_HEAD) /datum/sprite_accessory/marking/unathi/tattoo/chest - disallows = list(/datum/sprite_accessory/marking/tattoo/chest) + disallows = list( + /datum/sprite_accessory/marking/tattoo/chest, + /datum/sprite_accessory/marking/unathi/tattoo/chest + ) body_parts = list(BP_CHEST) /datum/sprite_accessory/marking/unathi/tattoo/groin - disallows = list(/datum/sprite_accessory/marking/tattoo/groin) + disallows = list( + /datum/sprite_accessory/marking/tattoo/groin, + /datum/sprite_accessory/marking/unathi/tattoo/groin + ) body_parts = list(BP_GROIN) /datum/sprite_accessory/marking/unathi/tattoo/arm_left - disallows = list(/datum/sprite_accessory/marking/tattoo/arm_left) + disallows = list( + /datum/sprite_accessory/marking/tattoo/arm_left, + /datum/sprite_accessory/marking/unathi/tattoo/arm_left + ) body_parts = list(BP_L_ARM) /datum/sprite_accessory/marking/unathi/tattoo/arm_right - disallows = list(/datum/sprite_accessory/marking/tattoo/arm_right) + disallows = list( + /datum/sprite_accessory/marking/tattoo/arm_right, + /datum/sprite_accessory/marking/unathi/tattoo/arm_right + ) body_parts = list(BP_R_ARM) /datum/sprite_accessory/marking/unathi/tattoo/hand_left - disallows = list(/datum/sprite_accessory/marking/tattoo/hand_left) + disallows = list( + /datum/sprite_accessory/marking/tattoo/hand_left, + /datum/sprite_accessory/marking/unathi/tattoo/hand_left + ) body_parts = list(BP_L_HAND) /datum/sprite_accessory/marking/unathi/tattoo/hand_right - disallows = list(/datum/sprite_accessory/marking/tattoo/hand_right) + disallows = list( + /datum/sprite_accessory/marking/tattoo/hand_right, + /datum/sprite_accessory/marking/unathi/tattoo/hand_right + ) body_parts = list(BP_R_HAND) /datum/sprite_accessory/marking/unathi/tattoo/leg_left - disallows = list(/datum/sprite_accessory/marking/tattoo/leg_left) + disallows = list( + /datum/sprite_accessory/marking/tattoo/leg_left, + /datum/sprite_accessory/marking/unathi/tattoo/leg_left + ) body_parts = list(BP_L_LEG) /datum/sprite_accessory/marking/unathi/tattoo/leg_right - disallows = list(/datum/sprite_accessory/marking/tattoo/leg_right) + disallows = list( + /datum/sprite_accessory/marking/tattoo/leg_right, + /datum/sprite_accessory/marking/unathi/tattoo/leg_right + ) body_parts = list(BP_R_LEG) /datum/sprite_accessory/marking/unathi/tattoo/foot_left - disallows = list(/datum/sprite_accessory/marking/tattoo/foot_left) + disallows = list( + /datum/sprite_accessory/marking/tattoo/foot_left, + /datum/sprite_accessory/marking/unathi/tattoo/foot_left + ) body_parts = list(BP_L_FOOT) -/datum/sprite_accessory/marking/unathi/tattoo/leg_right - disallows = list(/datum/sprite_accessory/marking/tattoo/leg_right) +/datum/sprite_accessory/marking/unathi/tattoo/foot_right + disallows = list( + /datum/sprite_accessory/marking/tattoo/foot_right, + /datum/sprite_accessory/marking/unathi/tattoo/foot_right + ) body_parts = list(BP_R_FOOT) @@ -321,11 +315,96 @@ icon_state = "hive-chest" +/datum/sprite_accessory/marking/unathi/tattoo/arm_left/campbell + name = "Tattoo (Campbell, Left Arm, Unathi)" + icon_state = "campbell-arm-left" + + +/datum/sprite_accessory/marking/unathi/tattoo/arm_right/campbell + name = "Tattoo (Campbell, Right Arm, Unathi)" + icon_state = "campbell-arm-right" + + +/datum/sprite_accessory/marking/unathi/tattoo/head/tiger + name = "Tattoo (Tiger Stripes, Head, Unathi)" + icon_state = "tiger-head" + + /datum/sprite_accessory/marking/unathi/tattoo/chest/tiger - name = "Tattoo (Tiger Stripes, Unathi)" + name = "Tattoo (Tiger Stripes, Body, Unathi)" icon_state = "tiger-chest" +/datum/sprite_accessory/marking/unathi/tattoo/arm_left/tiger + name = "Tattoo (Tiger Stripes, Left Arm, Unathi)" + icon_state = "tiger-arm-left" + + +/datum/sprite_accessory/marking/unathi/tattoo/arm_right/tiger + name = "Tattoo (Tiger Stripes, Right Arm, Unathi)" + icon_state = "tiger-arm-right" + + +/datum/sprite_accessory/marking/unathi/tattoo/leg_left/tiger + name = "Tattoo (Tiger Stripes, Left Leg, Unathi)" + icon_state = "tiger-leg-left" + + +/datum/sprite_accessory/marking/unathi/tattoo/leg_right/tiger + name = "Tattoo (Tiger Stripes, Right Leg, Unathi)" + icon_state = "tiger-leg-right" + + +/datum/sprite_accessory/marking/unathi/tattoo/foot_left/tiger + name = "Tattoo (Tiger Stripes, Left Foot, Unathi)" + icon_state = "tiger-foot-left" + + +/datum/sprite_accessory/marking/unathi/tattoo/foot_right/tiger + name = "Tattoo (Tiger Stripes, Right Foot, Unathi)" + icon_state = "tiger-foot-right" + + /datum/sprite_accessory/marking/unathi/tattoo/chest/bands name = "Tattoo (Bands, Body, Unathi)" icon_state = "bands-chest" + + +/datum/sprite_accessory/marking/unathi/tattoo/arm_left/bands + name = "Tattoo (Bands, Left Arm, Unathi)" + icon_state = "bands-arm-left" + + +/datum/sprite_accessory/marking/unathi/tattoo/arm_right/bands + name = "Tattoo (Bands, Right Arm, Unathi)" + icon_state = "bands-arm-right" + + +/datum/sprite_accessory/marking/unathi/tattoo/hand_left/bands + name = "Tattoo (Bands, Left Hand, Unathi)" + icon_state = "bands-hand-left" + + +/datum/sprite_accessory/marking/unathi/tattoo/hand_right/bands + name = "Tattoo (Bands, Right Hand, Unathi)" + icon_state = "bands-hand-right" + + +/datum/sprite_accessory/marking/unathi/tattoo/leg_left/bands + name = "Tattoo (Bands, Left Leg, Unathi)" + icon_state = "bands-leg-left" + + +/datum/sprite_accessory/marking/unathi/tattoo/leg_right/bands + name = "Tattoo (Bands, Right Leg, Unathi)" + icon_state = "bands-leg-right" + + +/datum/sprite_accessory/marking/unathi/tattoo/foot_left/bands + name = "Tattoo (Bands, Left Foot, Unathi)" + icon_state = "bands-foot-left" + + +/datum/sprite_accessory/marking/unathi/tattoo/foot_right/bands + name = "Tattoo (Bands, Right Foot, Unathi)" + icon_state = "bands-foot-right" diff --git a/code/modules/supermatter/supermatter.dm b/code/modules/supermatter/supermatter.dm index 14bbd2efecf40..c0bd8a1f1757e 100644 --- a/code/modules/supermatter/supermatter.dm +++ b/code/modules/supermatter/supermatter.dm @@ -219,7 +219,7 @@ to_chat(mob, SPAN_DANGER("An invisible force slams you against the ground!")) // Effect 2: Z-level wide electrical pulse - for(var/obj/machinery/power/apc/A in SSmachines.machinery) + for(var/obj/machinery/power/apc/A as anything in SSmachines.get_machinery_of_type(/obj/machinery/power/apc)) if(!(A.z in affected_z)) continue @@ -233,7 +233,7 @@ else A.energy_fail(round(DETONATION_SHUTDOWN_APC * random_change)) - for(var/obj/machinery/power/smes/buildable/S in SSmachines.machinery) + for(var/obj/machinery/power/smes/buildable/S as anything in SSmachines.get_machinery_of_type(/obj/machinery/power/smes/buildable)) if(!(S.z in affected_z)) continue // Causes SMESes to shut down for a bit @@ -242,7 +242,7 @@ // Effect 3: Break solar arrays - for(var/obj/machinery/power/solar/S in SSmachines.machinery) + for(var/obj/machinery/power/solar/S as anything in SSmachines.get_machinery_of_type(/obj/machinery/power/solar)) if(!(S.z in affected_z)) continue if(prob(DETONATION_SOLAR_BREAK_CHANCE)) @@ -476,8 +476,9 @@ ui_interact(user) /obj/machinery/power/supermatter/attack_hand(mob/user as mob) + var/datum/pronouns/pronouns = user.choose_from_pronouns() user.visible_message( - SPAN_WARNING("\The [user] reaches out and touches \the [src], inducing a resonance. For a brief instant, \his body glows brilliantly, then flashes into ash."), + SPAN_WARNING("\The [user] reaches out and touches \the [src], inducing a resonance. For a brief instant, [pronouns.his] body glows brilliantly, then flashes into ash."), SPAN_DANGER(FONT_LARGE("You reach out and touch \the [src]. Instantly, you feel a curious sensation as your body turns into new and exciting forms of plasma. That was not a wise decision.")), SPAN_WARNING("You hear an unearthly ringing, then what sounds like a shrilling kettle as you are washed with a wave of heat.") ) @@ -527,15 +528,17 @@ if (user.drop_from_inventory(W)) Consume(W) return TRUE - else return ..() + return ..() /obj/machinery/power/supermatter/Bumped(atom/AM as mob|obj) if(istype(AM, /obj/effect)) return if(istype(AM, /mob/living)) + var/mob/victim = AM + var/datum/pronouns/pronouns = victim.choose_from_pronouns() AM.visible_message( - SPAN_WARNING("\The [AM] slams into \the [src], inducing a resonance. For a brief instant, \his body glows brilliantly, then flashes into ash."), + SPAN_WARNING("\The [AM] slams into \the [src], inducing a resonance. For a brief instant, [pronouns.his] body glows brilliantly, then flashes into ash."), SPAN_DANGER(FONT_LARGE("You slam into \the [src], and your mind fills with unearthly shrieking. Your vision floods with light as your body instantly dissolves into dust.")), SPAN_WARNING("You hear an unearthly ringing, then what sounds like a shrilling kettle as you are washed with a wave of heat.") ) @@ -683,10 +686,10 @@ /obj/machinery/rotating_alarm/supermatter/Initialize() . = ..() - GLOB.supermatter_status.register_global(src, .proc/check_supermatter) + GLOB.supermatter_status.register_global(src, PROC_REF(check_supermatter)) /obj/machinery/rotating_alarm/supermatter/Destroy() - GLOB.supermatter_status.unregister_global(src, .proc/check_supermatter) + GLOB.supermatter_status.unregister_global(src, PROC_REF(check_supermatter)) . = ..() /obj/machinery/rotating_alarm/supermatter/proc/check_supermatter(obj/machinery/power/supermatter/SM, danger) diff --git a/code/modules/surgery/organs_internal.dm b/code/modules/surgery/organs_internal.dm index f580b267952f2..cc31c5100685a 100644 --- a/code/modules/surgery/organs_internal.dm +++ b/code/modules/surgery/organs_internal.dm @@ -267,6 +267,11 @@ else var/o_is = (O.gender == PLURAL) ? "are" : "is" var/o_a = (O.gender == PLURAL) ? "" : "a " +//[SIERRA-ADD] IPC_MODS + if(O.type == /obj/item/organ/internal/posibrain) + to_chat(user, SPAN_WARNING("There's no place in [target] to fit \the [O.organ_tag].")) + return +//[/SIERRA-ADD] IPC_MODS if(O.organ_tag == BP_POSIBRAIN && !target.species.has_organ[BP_POSIBRAIN]) to_chat(user, SPAN_WARNING("There's no place in [target] to fit \the [O.organ_tag].")) else if(O.damage > (O.max_damage * 0.75)) diff --git a/code/modules/surgery/slimes.dm b/code/modules/surgery/slimes.dm index bf70a25558db5..7fd5895b0760e 100644 --- a/code/modules/surgery/slimes.dm +++ b/code/modules/surgery/slimes.dm @@ -142,5 +142,6 @@ target.icon_state = "[target.colour] baby slime dead-nocore" /singleton/surgery_step/slime/saw_core/fail_step(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool) - user.visible_message(SPAN_WARNING("[user]'s hand slips, causing \him to miss the core!"), \ + var/datum/pronouns/pronouns = user.choose_from_pronouns() + user.visible_message(SPAN_WARNING("[user]'s hand slips, causing [pronouns.him] to miss the core!"), \ SPAN_WARNING("Your hand slips, causing you to miss the core!")) diff --git a/code/modules/synthesized_instruments/event_manager.dm b/code/modules/synthesized_instruments/event_manager.dm index c8d7d64022de9..fb7f102c4ed36 100644 --- a/code/modules/synthesized_instruments/event_manager.dm +++ b/code/modules/synthesized_instruments/event_manager.dm @@ -72,7 +72,7 @@ if (active) return 0 src.active = 1 - addtimer(new Callback(src, .proc/handle_events), 0) + addtimer(new Callback(src, PROC_REF(handle_events)), 0) diff --git a/code/modules/synthesized_instruments/song.dm b/code/modules/synthesized_instruments/song.dm index b3b122ffa828a..d560ab5cf67fe 100644 --- a/code/modules/synthesized_instruments/song.dm +++ b/code/modules/synthesized_instruments/song.dm @@ -188,7 +188,7 @@ var/list/allowed_suff = list("b", "n", "#", "s") var/list/note_off_delta = list("a"=91, "b"=91, "c"=98, "d"=98, "e"=98, "f"=98, "g"=98) var/list/lines_copy = src.lines.Copy() - addtimer(new Callback(src, .proc/play_lines, user, allowed_suff, note_off_delta, lines_copy), 0) + addtimer(new Callback(src, PROC_REF(play_lines), user, allowed_suff, note_off_delta, lines_copy), 0) #undef CP #undef IS_DIGIT diff --git a/code/modules/synthesized_instruments/sound_player.dm b/code/modules/synthesized_instruments/sound_player.dm index 9027e3da30435..8a5573a4ff62a 100644 --- a/code/modules/synthesized_instruments/sound_player.dm +++ b/code/modules/synthesized_instruments/sound_player.dm @@ -28,9 +28,9 @@ src.actual_instrument = where src.echo = GLOB.musical_config.echo_default.Copy() src.env = GLOB.musical_config.env_default.Copy() - src.proxy_listener = new(src.actual_instrument, /datum/sound_player/proc/on_turf_entered_relay, /datum/sound_player/proc/on_turfs_changed_relay, range, proc_owner = src) + src.proxy_listener = new(src.actual_instrument, TYPE_PROC_REF(/datum/sound_player, on_turf_entered_relay), TYPE_PROC_REF(/datum/sound_player, on_turfs_changed_relay), range, proc_owner = src) proxy_listener.register_turfs() - GLOB.instrument_synchronizer.register_global(src, .proc/check_wait) + GLOB.instrument_synchronizer.register_global(src, PROC_REF(check_wait)) /datum/sound_player/Destroy() src.song.playing = 0 @@ -41,7 +41,7 @@ QDEL_NULL(proxy_listener) seen_turfs.Cut() tokens.Cut() - GLOB.instrument_synchronizer.unregister_global(src, .proc/check_wait) + GLOB.instrument_synchronizer.unregister_global(src, PROC_REF(check_wait)) wait = null . = ..() diff --git a/code/modules/synthesized_instruments/sound_token.dm b/code/modules/synthesized_instruments/sound_token.dm index 61a19b0611c59..64e5a3346fa99 100644 --- a/code/modules/synthesized_instruments/sound_token.dm +++ b/code/modules/synthesized_instruments/sound_token.dm @@ -32,7 +32,7 @@ listeners = list() listener_status = list() - GLOB.destroyed_event.register(source, src, /datum/proc/qdel_self) + GLOB.destroyed_event.register(source, src, TYPE_PROC_REF(/datum, qdel_self)) player.subscribe(src) diff --git a/code/modules/tooltip/tooltip.dm b/code/modules/tooltip/tooltip.dm index 5ac38d680cf27..33dd3e95e719b 100644 --- a/code/modules/tooltip/tooltip.dm +++ b/code/modules/tooltip/tooltip.dm @@ -83,7 +83,7 @@ Notes: queueHide = !!showing if (queueHide) - addtimer(new Callback(src, .proc/do_hide), 1) + addtimer(new Callback(src, PROC_REF(do_hide)), 1) else do_hide() diff --git a/code/modules/tooltip/tooltip.html b/code/modules/tooltip/tooltip.html index 2ed8f5c43ea1e..f80f0cb266ec0 100644 --- a/code/modules/tooltip/tooltip.html +++ b/code/modules/tooltip/tooltip.html @@ -93,7 +93,10 @@
- +