Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

teleporter-WWDP #969

Merged
merged 12 commits into from
Dec 13, 2024
Merged

teleporter-WWDP #969

merged 12 commits into from
Dec 13, 2024

Conversation

PvrG
Copy link
Contributor

@PvrG PvrG commented Dec 2, 2024

WWhiteDreamProject/wwdpublic#63

Описание PR

Медиа

Тип PR

  • Feature
  • Fix
  • Tweak
  • Balance
  • Refactor
  • Port
  • Translate
  • Resprite

Изменения

Summary by CodeRabbit

  • Новые функции
    • Добавлен экспериментальный телепортер, позволяющий перемещаться на 3-8 метров с функцией экстренной телепортации и 4 зарядами.
    • Введены новые эффекты визуализации для телепортации.
    • Обновлен каталог с новым предметом "Экспериментальный телепортер синдиката".
  • Документация
    • Обновлены атрибуции для аудиоэффектов, связанных с телепортацией.
  • Локализация
    • Добавлены новые записи для английского и русского языков, описывающие экспериментальный телепортер.

@PvrG PvrG requested a review from Rxup as a code owner December 2, 2024 06:25
Copy link
Contributor

coderabbitai bot commented Dec 2, 2024

Процесс

В данном запросе на изменение добавлены новые компоненты и системы, связанные с механикой телепортации в игре. Введен класс ExperimentalTeleporterComponent, который определяет характеристики телепортов, такие как минимальная и максимальная дистанции, эффекты и звуки. Также создан класс ExperimentalTeleporterSystem, реализующий логику активации телепортации. Дополнительно обновлены файлы локализации для английского и русского языков, добавлены новые записи в атрибутах аудио и эффектах, а также создана новая сущность для телепорта в каталогах и метаданных.

Изменения

Файл Изменения
Content.Server/Backmen/Teleporter/ExperimentalTeleporterComponent.cs Добавлен класс ExperimentalTeleporterComponent с полями: MinTeleportRange, MaxTeleportRange, EmergencyLength, RandomRotations, TeleportInEffect, TeleportOutEffect, TeleportSound.
Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs Добавлен класс ExperimentalTeleporterSystem, реализующий механику телепортации.
Resources/Audio/Backmen/Object/Devices/attributions.yml Добавлена запись для файла experimentalsyndicateteleport.ogg с лицензией "CC-BY-NC-SA-4.0".
Resources/Locale/en-US/_backmen/store/uplink-catalog.ftl Добавлены новые элементы: uplink-experimental-syndicate-teleporter-name, uplink-experimental-syndicate-teleporter-desc.
Resources/Locale/ru-RU/_backmen/Entities/Objects/device/syndicate_gadgets/experimental-teleporter.ftl Добавлен перевод для ent-ExperimentalSyndicateTeleporter с описанием.
Resources/Locale/ru-RU/_backmen/store/uplink-catalog.ftl Добавлены новые элементы: uplink-experimental-syndicate-teleporter-name, uplink-experimental-syndicate-teleporter-desc.
Resources/Prototypes/_Backmen/Catalog/uplink_catalog.yml Добавлен новый элемент UplinkExperimentalSyndicateTeleporter с атрибутами.
Resources/Prototypes/_Backmen/Entities/Effects/effects.yml Добавлены сущности ExperimentalTeleporterInEffect и ExperimentalTeleporterOutEffect с компонентами.
Resources/Prototypes/_Backmen/Entities/Objects/Devices/Syndicate_Gadgets/experimental_teleporter.yml Добавлена конфигурация сущности ExperimentalSyndicateTeleporter с функционалом.
Resources/Textures/Backmen/Objects/Devices/experimentalsyndicateteleporter.rsi/meta.json Добавлен файл метаданных meta.json для телепорта с описанием состояний и лицензией.
Content.Shared/Backmen/Standing/SharedLayingDownSystem.cs Добавлен метод LieDownInRange и перечисление DropHeldItemsBehavior для управления поведением при переходе в лежачее положение.

Стихотворение

В мире телепортов, где чудеса,
Прыжки мгновенья, как в сказке, у нас.
Эффекты, звуки — всё в унисон,
Синдикат в пути, в каждом из нас!
Прыгай, мой друг, в волшебный свет,
Новый телепорт — это наш завет! 🌟✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 52416da and 862f596.

📒 Files selected for processing (1)
  • Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added S: Untriaged size/L Changes: Sprites Should be reviewed or fixed by people who are knowledgeable with spriting or visual design. Changes: Localization Can be reviewed or fixed by people who are knowledgeable with translation labels Dec 2, 2024
Copy link
Contributor

github-actions bot commented Dec 2, 2024

RSI Diff Bot; head commit 862f596 merging into d3149cc
This PR makes changes to 1 or more RSIs. Here is a summary of all changes:

Resources/Textures/Backmen/Objects/Devices/experimentalsyndicateteleporter.rsi

State Old New Status
icon Added
in Added
inhand-left Added
inhand-right Added
out Added

Edit: diff updated after 862f596

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Outside diff range and nitpick comments (4)
Resources/Prototypes/_Backmen/Entities/Objects/Devices/Syndicate_Gadgets/experimental_teleporter.yml (2)

5-5: Исправьте грамматическую ошибку в описании

В описании на строке 5 есть грамматическая ошибка: "Has 4 charge" следует заменить на "Has 4 charges".

Примените следующую правку:

-     description: Syndicate teleporter, when used, moves 3-8 meters forward. In case of teleportation into a wall, uses emergency teleportation. Has 4 charge.
+     description: Syndicate teleporter, when used, moves 3-8 meters forward. In case of teleportation into a wall, uses emergency teleportation. Has 4 charges.

16-16: Удалите лишние пробелы и добавьте пустую строку в конце файла

В конце файла на строке 16 присутствуют лишние пробелы, и отсутствует новая строка. Это может вызвать проблемы при обработке файла.

Примените следующий дифф для исправления:

-        rechargeDuration: 10 
+        rechargeDuration: 10
+
🧰 Tools
🪛 yamllint (1.35.1)

[error] 16-16: no new line character at the end of file

(new-line-at-end-of-file)


[error] 16-16: trailing spaces

(trailing-spaces)

Resources/Prototypes/_Backmen/Entities/Effects/effects.yml (1)

1-20: Структура эффектов реализована корректно!

Компоненты эффектов телепортации хорошо организованы и логически связаны. Однако рекомендуется рассмотреть вынесение общих параметров (например, длительность эффекта) в отдельную конфигурацию для упрощения будущих изменений.

+ # TODO: Consider moving common parameters to a shared configuration
  - type: TimedDespawn
    lifetime: 0.6  # Could be defined in shared config

Also applies to: 21-39

Resources/Prototypes/_Backmen/Catalog/uplink_catalog.yml (1)

167-175: Каталог аплинка дополнен корректно!

Структура записи соответствует существующим стандартам каталога. Необходимо исправить отступы в категориях для соответствия стилю файла.

  categories:
-    - UplinkUtility
+  - UplinkUtility
🧰 Tools
🪛 yamllint (1.35.1)

[warning] 175-175: wrong indentation: expected 2 but found 4

(indentation)


[error] 175-175: no new line character at the end of file

(new-line-at-end-of-file)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between d3149cc and 19fada8.

⛔ Files ignored due to path filters (6)
  • Resources/Audio/Backmen/Object/Devices/experimentalsyndicateteleport.ogg is excluded by !**/*.ogg
  • Resources/Textures/Backmen/Objects/Devices/experimentalsyndicateteleporter.rsi/icon.png is excluded by !**/*.png
  • Resources/Textures/Backmen/Objects/Devices/experimentalsyndicateteleporter.rsi/in.png is excluded by !**/*.png
  • Resources/Textures/Backmen/Objects/Devices/experimentalsyndicateteleporter.rsi/inhand-left.png is excluded by !**/*.png
  • Resources/Textures/Backmen/Objects/Devices/experimentalsyndicateteleporter.rsi/inhand-right.png is excluded by !**/*.png
  • Resources/Textures/Backmen/Objects/Devices/experimentalsyndicateteleporter.rsi/out.png is excluded by !**/*.png
📒 Files selected for processing (10)
  • Content.Server/Backmen/Teleporter/ExperimentalTeleporterComponent.cs (1 hunks)
  • Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs (1 hunks)
  • Resources/Audio/Backmen/Object/Devices/attributions.yml (1 hunks)
  • Resources/Locale/en-US/_backmen/store/uplink-catalog.ftl (1 hunks)
  • Resources/Locale/ru-RU/_backmen/Entities/Objects/device/syndicate_gadgets/experimental-teleporter.ftl (1 hunks)
  • Resources/Locale/ru-RU/_backmen/store/uplink-catalog.ftl (1 hunks)
  • Resources/Prototypes/_Backmen/Catalog/uplink_catalog.yml (1 hunks)
  • Resources/Prototypes/_Backmen/Entities/Effects/effects.yml (1 hunks)
  • Resources/Prototypes/_Backmen/Entities/Objects/Devices/Syndicate_Gadgets/experimental_teleporter.yml (1 hunks)
  • Resources/Textures/Backmen/Objects/Devices/experimentalsyndicateteleporter.rsi/meta.json (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • Resources/Textures/Backmen/Objects/Devices/experimentalsyndicateteleporter.rsi/meta.json
  • Resources/Locale/ru-RU/_backmen/Entities/Objects/device/syndicate_gadgets/experimental-teleporter.ftl
🧰 Additional context used
🪛 yamllint (1.35.1)
Resources/Prototypes/_Backmen/Entities/Objects/Devices/Syndicate_Gadgets/experimental_teleporter.yml

[error] 16-16: no new line character at the end of file

(new-line-at-end-of-file)


[error] 16-16: trailing spaces

(trailing-spaces)

Resources/Prototypes/_Backmen/Catalog/uplink_catalog.yml

[warning] 175-175: wrong indentation: expected 2 but found 4

(indentation)


[error] 175-175: no new line character at the end of file

(new-line-at-end-of-file)

Resources/Prototypes/_Backmen/Entities/Effects/effects.yml

[error] 39-39: no new line character at the end of file

(new-line-at-end-of-file)

Resources/Audio/Backmen/Object/Devices/attributions.yml

[error] 4-4: no new line character at the end of file

(new-line-at-end-of-file)

🪛 GitHub Check: build (ubuntu-latest)
Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs

[failure] 28-28:
The type or namespace name 'LayingDownSystem' could not be found (are you missing a using directive or an assembly reference?)


[failure] 28-28:
The type or namespace name 'LayingDownSystem' could not be found (are you missing a using directive or an assembly reference?)

🪛 GitHub Check: YAML Linter
Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs

[failure] 28-28:
The type or namespace name 'LayingDownSystem' could not be found (are you missing a using directive or an assembly reference?)


[failure] 28-28:
The type or namespace name 'LayingDownSystem' could not be found (are you missing a using directive or an assembly reference?)

🪛 GitHub Check: Test Packaging
Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs

[failure] 28-28:
The type or namespace name 'LayingDownSystem' could not be found (are you missing a using directive or an assembly reference?)


[failure] 28-28:
The type or namespace name 'LayingDownSystem' could not be found (are you missing a using directive or an assembly reference?)

🔇 Additional comments (2)
Content.Server/Backmen/Teleporter/ExperimentalTeleporterComponent.cs (1)

1-28: Код компонента корректен

Реализация ExperimentalTeleporterComponent выглядит правильно и соответствует требованиям.

Resources/Locale/ru-RU/_backmen/store/uplink-catalog.ftl (1)

1-11: Перевод локализации корректен

Все новые записи в файле локализации на русском языке правильны и соответствуют требованиям.

[Dependency] private readonly AudioSystem _audio = default!;
[Dependency] private readonly ContainerSystem _containerSystem = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly LayingDownSystem _layingDown = default!;
Copy link
Contributor

@coderabbitai coderabbitai bot Dec 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Ошибка: не найден тип или пространство имён 'LayingDownSystem'

На строке 28 используется тип LayingDownSystem, но компилятор не может его найти. Вероятно, отсутствует соответствующая директива using или ссылка на сборку.

Предлагаю добавить следующую директиву:

+ using Content.Server.Movement.Systems;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
[Dependency] private readonly LayingDownSystem _layingDown = default!;
using Content.Server.Movement.Systems;
[Dependency] private readonly LayingDownSystem _layingDown = default!;
🧰 Tools
🪛 GitHub Check: build (ubuntu-latest)

[failure] 28-28:
The type or namespace name 'LayingDownSystem' could not be found (are you missing a using directive or an assembly reference?)


[failure] 28-28:
The type or namespace name 'LayingDownSystem' could not be found (are you missing a using directive or an assembly reference?)

🪛 GitHub Check: YAML Linter

[failure] 28-28:
The type or namespace name 'LayingDownSystem' could not be found (are you missing a using directive or an assembly reference?)


[failure] 28-28:
The type or namespace name 'LayingDownSystem' could not be found (are you missing a using directive or an assembly reference?)

🪛 GitHub Check: Test Packaging

[failure] 28-28:
The type or namespace name 'LayingDownSystem' could not be found (are you missing a using directive or an assembly reference?)


[failure] 28-28:
The type or namespace name 'LayingDownSystem' could not be found (are you missing a using directive or an assembly reference?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Ошибка: не найден тип или пространство имён 'LayingDownSystem'

На строке 28 используется тип LayingDownSystem, но компилятор не может его найти. Вероятно, отсутствует соответствующая директива using или ссылка на сборку.

Предлагаю добавить следующую директиву:

+ using Content.Server.Movement.Systems;

📝 Committable suggestion

🧰 Tools

using Content.Server.Backmen.Standing; ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PvrG, да, вы правы. Если LayingDownSystem находится в пространстве имён Content.Server.Backmen.Standing, то добавление using Content.Server.Backmen.Standing; должно решить проблему. Спасибо за уточнение!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PvrG: Да, вы правы. Необходимо добавить директиву:

using Content.Server.Backmen.Standing;

Это подключит пространство имён, в котором определён LayingDownSystem, и устранит ошибку компиляции.

🔗 Analysis chain
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Поиск определения класса LayingDownSystem и его пространства имён
rg -A 5 -B 5 'class LayingDownSystem'

Length of output: 2072

Comment on lines 7 to 8
uplink-betrayal-knife-name = Experimental syndicate teleporter
uplink-betrayal-knife-desc = Syndicate teleporter, when used, moves 3-8 meters forward. In case of teleportation into a wall, uses emergency teleportation. Has 4 charge.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Исправьте дублирующиеся ключи для локализации

Ключи uplink-betrayal-knife-name и uplink-betrayal-knife-desc на строках 7-8 дублируются с предыдущими записями и относятся к другому предмету. Это может привести к конфликтам в локализации.

Предлагаю изменить ключи на уникальные для экспериментального телепортера:

- uplink-betrayal-knife-name = Experimental syndicate teleporter
- uplink-betrayal-knife-desc = Syndicate teleporter, when used, moves 3-8 meters forward. In case of teleportation into a wall, uses emergency teleportation. Has 4 charge.
+ uplink-experimental-syndicate-teleporter-name = Experimental syndicate teleporter
+ uplink-experimental-syndicate-teleporter-desc = Syndicate teleporter, when used, moves 3-8 meters forward. In case of teleportation into a wall, uses emergency teleportation. Has 4 charges.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
uplink-betrayal-knife-name = Experimental syndicate teleporter
uplink-betrayal-knife-desc = Syndicate teleporter, when used, moves 3-8 meters forward. In case of teleportation into a wall, uses emergency teleportation. Has 4 charge.
uplink-experimental-syndicate-teleporter-name = Experimental syndicate teleporter
uplink-experimental-syndicate-teleporter-desc = Syndicate teleporter, when used, moves 3-8 meters forward. In case of teleportation into a wall, uses emergency teleportation. Has 4 charges.

Comment on lines +1 to +4
- files: ["experimentalsyndicateteleport.ogg"]
license: "CC-BY-NC-SA-4.0"
copyright: "Taken from White Dream"
source: "https://github.com/frosty-dev/ss14-core/blob/master/Resources/Audio/White/Devices/expsyndicateteleport.ogg"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Источник звукового файла недоступен!

Ссылка на исходный файл возвращает ошибку 404, что указывает на его отсутствие в указанном репозитории. Необходимо:

  • Обновить ссылку на актуальный источник файла
  • Убедиться, что использование файла соответствует условиям лицензии CC-BY-NC-SA-4.0
  • Рассмотреть возможность поиска файла в архивных версиях репозитория или связаться с авторами White Dream для получения корректной ссылки
🔗 Analysis chain

Проверить доступность источника звукового файла!

Атрибуция корректно указана, но необходимо убедиться в актуальности ссылки на исходный файл и соответствии условиям лицензии CC-BY-NC-SA-4.0.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify source file availability and license compliance

# Check if source URL is accessible
curl -I "https://github.com/frosty-dev/ss14-core/blob/master/Resources/Audio/White/Devices/expsyndicateteleport.ogg"

# Verify local file exists
fd "experimentalsyndicateteleport.ogg" Resources/Audio/Backmen/Object/Devices/

Length of output: 5069

🧰 Tools
🪛 yamllint (1.35.1)

[error] 4-4: no new line character at the end of file

(new-line-at-end-of-file)

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 19fada8 and 6e8b8fc.

📒 Files selected for processing (2)
  • Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs (1 hunks)
  • Resources/Locale/ru-RU/_backmen/store/uplink-catalog.ftl (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • Resources/Locale/ru-RU/_backmen/store/uplink-catalog.ftl
🧰 Additional context used
🪛 GitHub Check: YAML Linter
Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs

[failure] 80-80:
'LayingDownSystem' does not contain a definition for 'LieDownInRange' and no accessible extension method 'LieDownInRange' accepting a first argument of type 'LayingDownSystem' could be found (are you missing a using directive or an assembly reference?)


[failure] 80-80:
'LayingDownSystem' does not contain a definition for 'LieDownInRange' and no accessible extension method 'LieDownInRange' accepting a first argument of type 'LayingDownSystem' could be found (are you missing a using directive or an assembly reference?)

🪛 GitHub Check: build (ubuntu-latest)
Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs

[failure] 80-80:
'LayingDownSystem' does not contain a definition for 'LieDownInRange' and no accessible extension method 'LieDownInRange' accepting a first argument of type 'LayingDownSystem' could be found (are you missing a using directive or an assembly reference?)


[failure] 80-80:
'LayingDownSystem' does not contain a definition for 'LieDownInRange' and no accessible extension method 'LieDownInRange' accepting a first argument of type 'LayingDownSystem' could be found (are you missing a using directive or an assembly reference?)

🪛 GitHub Check: Test Packaging
Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs

[failure] 80-80:
'LayingDownSystem' does not contain a definition for 'LieDownInRange' and no accessible extension method 'LieDownInRange' accepting a first argument of type 'LayingDownSystem' could be found (are you missing a using directive or an assembly reference?)


[failure] 80-80:
'LayingDownSystem' does not contain a definition for 'LieDownInRange' and no accessible extension method 'LieDownInRange' accepting a first argument of type 'LayingDownSystem' could be found (are you missing a using directive or an assembly reference?)

{
PlaySoundAndEffects(component, coords, oldCoords);

_layingDown.LieDownInRange(uid, coords);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Исправьте ошибку: метод 'LieDownInRange' отсутствует в 'LayingDownSystem'

Статический анализ выявил, что метод LieDownInRange не определён в LayingDownSystem. Проверьте правильность вызова метода или замените его на существующий метод для укладывания персонажа.

🧰 Tools
🪛 GitHub Check: YAML Linter

[failure] 80-80:
'LayingDownSystem' does not contain a definition for 'LieDownInRange' and no accessible extension method 'LieDownInRange' accepting a first argument of type 'LayingDownSystem' could be found (are you missing a using directive or an assembly reference?)


[failure] 80-80:
'LayingDownSystem' does not contain a definition for 'LieDownInRange' and no accessible extension method 'LieDownInRange' accepting a first argument of type 'LayingDownSystem' could be found (are you missing a using directive or an assembly reference?)

🪛 GitHub Check: build (ubuntu-latest)

[failure] 80-80:
'LayingDownSystem' does not contain a definition for 'LieDownInRange' and no accessible extension method 'LieDownInRange' accepting a first argument of type 'LayingDownSystem' could be found (are you missing a using directive or an assembly reference?)


[failure] 80-80:
'LayingDownSystem' does not contain a definition for 'LieDownInRange' and no accessible extension method 'LieDownInRange' accepting a first argument of type 'LayingDownSystem' could be found (are you missing a using directive or an assembly reference?)

🪛 GitHub Check: Test Packaging

[failure] 80-80:
'LayingDownSystem' does not contain a definition for 'LieDownInRange' and no accessible extension method 'LieDownInRange' accepting a first argument of type 'LayingDownSystem' could be found (are you missing a using directive or an assembly reference?)


[failure] 80-80:
'LayingDownSystem' does not contain a definition for 'LieDownInRange' and no accessible extension method 'LieDownInRange' accepting a first argument of type 'LayingDownSystem' could be found (are you missing a using directive or an assembly reference?)

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 6e8b8fc and 72fd83f.

📒 Files selected for processing (2)
  • Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs (1 hunks)
  • Content.Shared/Standing/SharedLayingDownSystem.cs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs
🧰 Additional context used
🪛 GitHub Check: build (ubuntu-latest)
Content.Shared/Standing/SharedLayingDownSystem.cs

[failure] 92-92:
The type or namespace name 'ChangeLayingDownEvent' could not be found (are you missing a using directive or an assembly reference?)


[failure] 126-126:
The type or namespace name 'LayingDownComponent' could not be found (are you missing a using directive or an assembly reference?)


[failure] 137-137:
The type or namespace name 'LayingDownComponent' could not be found (are you missing a using directive or an assembly reference?)


[failure] 149-149:
The type or namespace name 'LayingDownComponent' could not be found (are you missing a using directive or an assembly reference?)


[failure] 176-176:
The type or namespace name 'LayingDownComponent' could not be found (are you missing a using directive or an assembly reference?)


[failure] 92-92:
The type or namespace name 'ChangeLayingDownEvent' could not be found (are you missing a using directive or an assembly reference?)


[failure] 126-126:
The type or namespace name 'LayingDownComponent' could not be found (are you missing a using directive or an assembly reference?)


[failure] 137-137:
The type or namespace name 'LayingDownComponent' could not be found (are you missing a using directive or an assembly reference?)


[failure] 149-149:
The type or namespace name 'LayingDownComponent' could not be found (are you missing a using directive or an assembly reference?)

🪛 GitHub Check: YAML Linter
Content.Shared/Standing/SharedLayingDownSystem.cs

[failure] 92-92:
The type or namespace name 'ChangeLayingDownEvent' could not be found (are you missing a using directive or an assembly reference?)


[failure] 126-126:
The type or namespace name 'LayingDownComponent' could not be found (are you missing a using directive or an assembly reference?)


[failure] 137-137:
The type or namespace name 'LayingDownComponent' could not be found (are you missing a using directive or an assembly reference?)


[failure] 149-149:
The type or namespace name 'LayingDownComponent' could not be found (are you missing a using directive or an assembly reference?)


[failure] 176-176:
The type or namespace name 'LayingDownComponent' could not be found (are you missing a using directive or an assembly reference?)


[failure] 92-92:
The type or namespace name 'ChangeLayingDownEvent' could not be found (are you missing a using directive or an assembly reference?)


[failure] 126-126:
The type or namespace name 'LayingDownComponent' could not be found (are you missing a using directive or an assembly reference?)


[failure] 137-137:
The type or namespace name 'LayingDownComponent' could not be found (are you missing a using directive or an assembly reference?)


[failure] 149-149:
The type or namespace name 'LayingDownComponent' could not be found (are you missing a using directive or an assembly reference?)

🪛 GitHub Check: Test Packaging
Content.Shared/Standing/SharedLayingDownSystem.cs

[failure] 92-92:
The type or namespace name 'ChangeLayingDownEvent' could not be found (are you missing a using directive or an assembly reference?)


[failure] 126-126:
The type or namespace name 'LayingDownComponent' could not be found (are you missing a using directive or an assembly reference?)


[failure] 137-137:
The type or namespace name 'LayingDownComponent' could not be found (are you missing a using directive or an assembly reference?)


[failure] 149-149:
The type or namespace name 'LayingDownComponent' could not be found (are you missing a using directive or an assembly reference?)


[failure] 176-176:
The type or namespace name 'LayingDownComponent' could not be found (are you missing a using directive or an assembly reference?)


[failure] 92-92:
The type or namespace name 'ChangeLayingDownEvent' could not be found (are you missing a using directive or an assembly reference?)


[failure] 126-126:
The type or namespace name 'LayingDownComponent' could not be found (are you missing a using directive or an assembly reference?)


[failure] 137-137:
The type or namespace name 'LayingDownComponent' could not be found (are you missing a using directive or an assembly reference?)

Comment on lines 60 to 61
|| !HasComp<LayingDownComponent>(session.AttachedEntity)
|| _gravity.IsWeightless(session.AttachedEntity.Value))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Добавьте определение или using-директиву для 'LayingDownComponent'

Тип LayingDownComponent не найден во многих местах кода. Убедитесь, что этот тип определён в проекте и добавлена необходимая using-директива для соответствующего пространства имён.

Примените следующий дифф для добавления using-директивы:

+using Content.Shared.Standing.Components;

Also applies to: 72-74, 99-100, 126-127, 137-138, 149-150, 176-177


private void ToggleStanding(ICommonSession? session)
{
if (session is not { AttachedEntity: { Valid: true } uid } _
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Исправьте синтаксическую ошибку в условии 'if'

В строке 58 в условии if присутствует лишний символ _ в конце, что приводит к синтаксической ошибке. Удалите символ _ для корректной компиляции.

Примените следующий дифф для исправления:

-if (session is not { AttachedEntity: { Valid: true } uid } _
+if (session is not { AttachedEntity: { Valid: true } uid })
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (session is not { AttachedEntity: { Valid: true } uid } _
if (session is not { AttachedEntity: { Valid: true } uid })

Comment on lines 120 to 123
component.CurrentState = StandingState.Lying;

component.CurrentState = StandingState.Standing;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Проверьте логическую ошибку при установке 'CurrentState'

В строке 120 устанавливается component.CurrentState = StandingState.Lying;, а сразу после этого в строке 122 устанавливается component.CurrentState = StandingState.Standing;. Это приводит к тому, что предыдущее значение перезаписывается. Убедитесь, что состояние устанавливается корректно и отсутствуют лишние присвоения.

Примените следующий дифф для исправления:

component.CurrentState = StandingState.Lying;

- component.CurrentState = StandingState.Standing;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
component.CurrentState = StandingState.Lying;
component.CurrentState = StandingState.Standing;
}
component.CurrentState = StandingState.Lying;
}

Comment on lines 197 to 198
var ents = new HashSet<Entity<LayingDownComponent>>();
_lookup.GetEntitiesInRange(coords, range, ents);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Проверьте использование типа в коллекции 'ents'

Использование HashSet<Entity<LayingDownComponent>> может быть некорректным. Возможно, следует использовать HashSet<EntityUid> или другую подходящую коллекцию. Также убедитесь, что метод _lookup.GetEntitiesInRange правильно заполняет коллекцию и типы совпадают.

Примените следующий дифф для исправления:

-public void LieDownInRange(EntityUid uid, EntityCoordinates coords, float range = 0.4f)
-{
-    var ents = new HashSet<Entity<LayingDownComponent>>();
+public void LieDownInRange(EntityUid uid, EntityCoordinates coords, float range = 0.4f)
+{
+    var ents = new HashSet<EntityUid>();

Committable suggestion skipped: line range outside the PR's diff.

Comment on lines 92 to 93
private void OnChangeState(ChangeLayingDownEvent ev, EntitySessionEventArgs args)
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Добавьте определение или using-директиву для 'ChangeLayingDownEvent'

Тип ChangeLayingDownEvent не найден. Убедитесь, что этот тип определён в проекте и добавлена необходимая using-директива для соответствующего пространства имён.

Примените следующий дифф для добавления using-директивы:

+using Content.Shared.Standing;

Committable suggestion skipped: line range outside the PR's diff.

🧰 Tools
🪛 GitHub Check: build (ubuntu-latest)

[failure] 92-92:
The type or namespace name 'ChangeLayingDownEvent' could not be found (are you missing a using directive or an assembly reference?)


[failure] 92-92:
The type or namespace name 'ChangeLayingDownEvent' could not be found (are you missing a using directive or an assembly reference?)

🪛 GitHub Check: YAML Linter

[failure] 92-92:
The type or namespace name 'ChangeLayingDownEvent' could not be found (are you missing a using directive or an assembly reference?)


[failure] 92-92:
The type or namespace name 'ChangeLayingDownEvent' could not be found (are you missing a using directive or an assembly reference?)

🪛 GitHub Check: Test Packaging

[failure] 92-92:
The type or namespace name 'ChangeLayingDownEvent' could not be found (are you missing a using directive or an assembly reference?)


[failure] 92-92:
The type or namespace name 'ChangeLayingDownEvent' could not be found (are you missing a using directive or an assembly reference?)

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Outside diff range and nitpick comments (3)
Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs (3)

96-105: Оптимизируйте проверку стен

Метод TryCheckWall выполняет избыточные операции:

  1. Получает все закреплённые сущности
  2. Проверяет тег "Wall" для каждой сущности

Рекомендуется использовать более эффективный метод проверки:

 private bool TryCheckWall(EntityCoordinates coords)
 {
     if (!coords.TryGetTileRef(out var tile)
         || !TryComp<MapGridComponent>(tile.Value.GridUid, out var mapGridComponent))
         return false;

-    var anchoredEntities = _mapSystem.GetAnchoredEntities(tile.Value.GridUid, mapGridComponent, coords);
-    return anchoredEntities.Any(x => _tag.HasTag(x, "Wall"));
+    return _mapSystem.GetAnchoredEntities(tile.Value.GridUid, mapGridComponent, coords)
+        .Any(x => _tag.HasTag(x, "Wall"));
 }

87-94: Оптимизируйте воспроизведение звуков и эффектов

Метод PlaySoundAndEffects дублирует вызовы PlayPvs с одним и тем же звуком. Рекомендуется объединить логику воспроизведения звуков.

 private void PlaySoundAndEffects(ExperimentalTeleporterComponent component, EntityCoordinates coords, EntityCoordinates oldCoords)
 {
-    _audio.PlayPvs(component.TeleportSound, coords);
-    _audio.PlayPvs(component.TeleportSound, oldCoords);
+    var positions = new[] { coords, oldCoords };
+    foreach (var position in positions)
+    {
+        _audio.PlayPvs(component.TeleportSound, position);
+    }

     _entManager.SpawnEntity(component.TeleportInEffect, coords);
     _entManager.SpawnEntity(component.TeleportOutEffect, oldCoords);
 }

107-114: Добавьте проверку входных параметров

В методе VectorRandomDirection отсутствуют проверки входных параметров:

  1. Параметр length может быть отрицательным
  2. Компонент может быть null
 private Vector2 VectorRandomDirection(ExperimentalTeleporterComponent component, Vector2 offset, int length)
 {
+    if (component == null)
+        return Vector2.Zero;
+
+    if (length < 0)
+        length = 0;
+
     if (component.RandomRotations.Count == 0)
         return Vector2.Zero;

     var randomRotation = _random.Next(0, component.RandomRotations.Count);
     return Angle.FromDegrees(component.RandomRotations[randomRotation]).RotateVec(offset.Normalized() * length);
 }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 72fd83f and 7bbac7c.

📒 Files selected for processing (1)
  • Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs (1 hunks)
🧰 Additional context used
🪛 GitHub Check: build (ubuntu-latest)
Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs

[failure] 81-81:
'SharedLayingDownSystem' does not contain a definition for 'LieDownInRange' and no accessible extension method 'LieDownInRange' accepting a first argument of type 'SharedLayingDownSystem' could be found (are you missing a using directive or an assembly reference?)


[failure] 81-81:
'SharedLayingDownSystem' does not contain a definition for 'LieDownInRange' and no accessible extension method 'LieDownInRange' accepting a first argument of type 'SharedLayingDownSystem' could be found (are you missing a using directive or an assembly reference?)

🪛 GitHub Check: Test Packaging
Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs

[failure] 81-81:
'SharedLayingDownSystem' does not contain a definition for 'LieDownInRange' and no accessible extension method 'LieDownInRange' accepting a first argument of type 'SharedLayingDownSystem' could be found (are you missing a using directive or an assembly reference?)


[failure] 81-81:
'SharedLayingDownSystem' does not contain a definition for 'LieDownInRange' and no accessible extension method 'LieDownInRange' accepting a first argument of type 'SharedLayingDownSystem' could be found (are you missing a using directive or an assembly reference?)

🪛 GitHub Check: YAML Linter
Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs

[failure] 81-81:
'SharedLayingDownSystem' does not contain a definition for 'LieDownInRange' and no accessible extension method 'LieDownInRange' accepting a first argument of type 'SharedLayingDownSystem' could be found (are you missing a using directive or an assembly reference?)


[failure] 81-81:
'SharedLayingDownSystem' does not contain a definition for 'LieDownInRange' and no accessible extension method 'LieDownInRange' accepting a first argument of type 'SharedLayingDownSystem' could be found (are you missing a using directive or an assembly reference?)

🔇 Additional comments (1)
Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs (1)

5-5: Проверьте правильность пространства имён для системы LayingDown

Текущий импорт Content.Server.Standing и использование SharedLayingDownSystem может быть некорректным. Возможно, следует использовать Content.Server.Backmen.Standing.

#!/bin/bash
# Поиск определения SharedLayingDownSystem
rg -l "class (Shared)?LayingDownSystem"

Also applies to: 29-29

Comment on lines 39 to 62
private void OnUse(EntityUid uid, ExperimentalTeleporterComponent component, UseInHandEvent args)
{
if (_charges.IsEmpty(uid)
|| !TryComp<TransformComponent>(args.User, out var xform)
|| (_containerSystem.IsEntityInContainer(args.User)
&& !_containerSystem.TryRemoveFromContainer(args.User)))
return;

var oldCoords = xform.Coordinates;
var range = _random.Next(component.MinTeleportRange, component.MaxTeleportRange);
var offset = xform.LocalRotation.ToWorldVec().Normalized();
var direction = xform.LocalRotation.GetDir().ToVec();
var newOffset = offset + direction * range;

var coords = xform.Coordinates.Offset(newOffset).SnapToGrid(EntityManager);

Teleport(args.User, uid, component, coords, oldCoords);

if (!TryCheckWall(coords)
|| EmergencyTeleportation(args.User, uid, component, xform, oldCoords, newOffset))
return;

_bodySystem.GibBody(args.User, true, splatModifier: 3F);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Добавьте дополнительные проверки безопасности

  1. Отсутствуют проверки на null для компонентов и зависимостей
  2. Нет обработки ошибок при неудачном телепортировании
  3. Жёсткое значение множителя разброса (3F) лучше вынести в константу

Предлагаю следующие изменения:

 private void OnUse(EntityUid uid, ExperimentalTeleporterComponent component, UseInHandEvent args)
 {
+    if (!Resolve(args.User, ref xform))
+        return;
+
     if (_charges.IsEmpty(uid)
-        || !TryComp<TransformComponent>(args.User, out var xform)
         || (_containerSystem.IsEntityInContainer(args.User)
             && !_containerSystem.TryRemoveFromContainer(args.User)))
         return;

+    const float GibSplatModifier = 3f;
     // ... rest of the method ...
-    _bodySystem.GibBody(args.User, true, splatModifier: 3F);
+    _bodySystem.GibBody(args.User, true, splatModifier: GibSplatModifier);
 }

Committable suggestion skipped: line range outside the PR's diff.

Comment on lines +64 to +75
private bool EmergencyTeleportation(EntityUid uid, EntityUid teleporterUid, ExperimentalTeleporterComponent component, TransformComponent xform, EntityCoordinates oldCoords, Vector2 offset)
{
var newOffset = offset + VectorRandomDirection(component, offset, component.EmergencyLength);
var coords = xform.Coordinates.Offset(newOffset).SnapToGrid(EntityManager);

if (_charges.IsEmpty(teleporterUid))
return false;

Teleport(uid, teleporterUid, component, coords, oldCoords);

return !TryCheckWall(coords);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Предотвратите возможность бесконечной рекурсии

Метод EmergencyTeleportation может вызвать бесконечную рекурсию через Teleport, который может снова вызвать EmergencyTeleportation. Рекомендуется:

  1. Добавить максимальное количество попыток телепортации
  2. Передавать счётчик попыток через параметры
  3. Добавить проверку на максимальное количество попыток

Предлагаемые изменения:

+ private const int MaxEmergencyAttempts = 3;

- private bool EmergencyTeleportation(EntityUid uid, EntityUid teleporterUid, ExperimentalTeleporterComponent component, TransformComponent xform, EntityCoordinates oldCoords, Vector2 offset)
+ private bool EmergencyTeleportation(EntityUid uid, EntityUid teleporterUid, ExperimentalTeleporterComponent component, TransformComponent xform, EntityCoordinates oldCoords, Vector2 offset, int attempts = 0)
 {
+    if (attempts >= MaxEmergencyAttempts)
+        return false;
+
     var newOffset = offset + VectorRandomDirection(component, offset, component.EmergencyLength);
     // ... rest of the method
 }

Committable suggestion skipped: line range outside the PR's diff.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 7bbac7c and 568d764.

📒 Files selected for processing (1)
  • Content.Shared/Backmen/Standing/SharedLayingDownSystem.cs (1 hunks)
🧰 Additional context used
🪛 GitHub Check: build (ubuntu-latest)
Content.Shared/Backmen/Standing/SharedLayingDownSystem.cs

[failure] 361-361:
The type or namespace name 'EntityCoordinates' could not be found (are you missing a using directive or an assembly reference?)


[failure] 361-361:
The type or namespace name 'EntityCoordinates' could not be found (are you missing a using directive or an assembly reference?)

🪛 GitHub Check: YAML Linter
Content.Shared/Backmen/Standing/SharedLayingDownSystem.cs

[failure] 361-361:
The type or namespace name 'EntityCoordinates' could not be found (are you missing a using directive or an assembly reference?)


[failure] 361-361:
The type or namespace name 'EntityCoordinates' could not be found (are you missing a using directive or an assembly reference?)

🪛 GitHub Check: Test Packaging
Content.Shared/Backmen/Standing/SharedLayingDownSystem.cs

[failure] 361-361:
The type or namespace name 'EntityCoordinates' could not be found (are you missing a using directive or an assembly reference?)


[failure] 361-361:
The type or namespace name 'EntityCoordinates' could not be found (are you missing a using directive or an assembly reference?)

🔇 Additional comments (1)
Content.Shared/Backmen/Standing/SharedLayingDownSystem.cs (1)

Line range hint 372-377: Хорошо структурированное перечисление!

Перечисление DropHeldItemsBehavior имеет четкую семантику и правильно использует байтовый тип данных для оптимизации сериализации.

🧰 Tools
🪛 GitHub Check: build (ubuntu-latest)

[failure] 361-361:
The type or namespace name 'EntityCoordinates' could not be found (are you missing a using directive or an assembly reference?)


[failure] 361-361:
The type or namespace name 'EntityCoordinates' could not be found (are you missing a using directive or an assembly reference?)

🪛 GitHub Check: YAML Linter

[failure] 361-361:
The type or namespace name 'EntityCoordinates' could not be found (are you missing a using directive or an assembly reference?)


[failure] 361-361:
The type or namespace name 'EntityCoordinates' could not be found (are you missing a using directive or an assembly reference?)

🪛 GitHub Check: Test Packaging

[failure] 361-361:
The type or namespace name 'EntityCoordinates' could not be found (are you missing a using directive or an assembly reference?)


[failure] 361-361:
The type or namespace name 'EntityCoordinates' could not be found (are you missing a using directive or an assembly reference?)

Comment on lines +360 to +370
// WWDP
public void LieDownInRange(EntityUid uid, EntityCoordinates coords, float range = 0.4f)
{
var ents = new HashSet<Entity<LayingDownComponent>>();
_lookup.GetEntitiesInRange(coords, range, ents);

foreach (var ent in ents.Where(ent => ent.Owner != uid))
{
TryLieDown(ent, behavior: DropHeldItemsBehavior.DropIfStanding);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Требуются улучшения в методе LieDownInRange

Рекомендуемые изменения для повышения надежности и производительности:

  1. Добавить проверку на null для сервиса _lookup
  2. Добавить валидацию параметра range (должен быть положительным)
  3. Рассмотреть возможность использования пула объектов для HashSet
 public void LieDownInRange(EntityUid uid, EntityCoordinates coords, float range = 0.4f)
 {
+    if (range <= 0)
+        return;
+
+    if (!Resolve(uid, ref _lookup))
+        return;
+
     var ents = new HashSet<Entity<LayingDownComponent>>();
     _lookup.GetEntitiesInRange(coords, range, ents);

     foreach (var ent in ents.Where(ent => ent.Owner != uid))
     {
         TryLieDown(ent, behavior: DropHeldItemsBehavior.DropIfStanding);
     }
 }

Committable suggestion skipped: line range outside the PR's diff.

🧰 Tools
🪛 GitHub Check: build (ubuntu-latest)

[failure] 361-361:
The type or namespace name 'EntityCoordinates' could not be found (are you missing a using directive or an assembly reference?)


[failure] 361-361:
The type or namespace name 'EntityCoordinates' could not be found (are you missing a using directive or an assembly reference?)

🪛 GitHub Check: YAML Linter

[failure] 361-361:
The type or namespace name 'EntityCoordinates' could not be found (are you missing a using directive or an assembly reference?)


[failure] 361-361:
The type or namespace name 'EntityCoordinates' could not be found (are you missing a using directive or an assembly reference?)

🪛 GitHub Check: Test Packaging

[failure] 361-361:
The type or namespace name 'EntityCoordinates' could not be found (are you missing a using directive or an assembly reference?)


[failure] 361-361:
The type or namespace name 'EntityCoordinates' could not be found (are you missing a using directive or an assembly reference?)

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (1)
Resources/Prototypes/_Backmen/Catalog/uplink_catalog.yml (1)

175-175: Исправьте форматирование

Необходимо:

  1. Исправить отступ в строке категорий (должно быть 2 пробела вместо 4)
  2. Добавить пустую строку в конец файла
  categories:
-    - UplinkDeception
+  - UplinkDeception
+
🧰 Tools
🪛 yamllint (1.35.1)

[warning] 175-175: wrong indentation: expected 2 but found 4

(indentation)


[error] 175-175: no new line character at the end of file

(new-line-at-end-of-file)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 4741148 and aee31f5.

📒 Files selected for processing (4)
  • Content.Server/Backmen/Teleporter/ExperimentalTeleporterComponent.cs (1 hunks)
  • Resources/Locale/en-US/_backmen/store/uplink-catalog.ftl (1 hunks)
  • Resources/Locale/ru-RU/_backmen/store/uplink-catalog.ftl (1 hunks)
  • Resources/Prototypes/_Backmen/Catalog/uplink_catalog.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • Resources/Locale/ru-RU/_backmen/store/uplink-catalog.ftl
  • Resources/Locale/en-US/_backmen/store/uplink-catalog.ftl
  • Content.Server/Backmen/Teleporter/ExperimentalTeleporterComponent.cs
🧰 Additional context used
🪛 yamllint (1.35.1)
Resources/Prototypes/_Backmen/Catalog/uplink_catalog.yml

[warning] 175-175: wrong indentation: expected 2 but found 4

(indentation)


[error] 175-175: no new line character at the end of file

(new-line-at-end-of-file)

🔇 Additional comments (1)
Resources/Prototypes/_Backmen/Catalog/uplink_catalog.yml (1)

167-175: Проверьте баланс стоимости телепортера

Стоимость в 10 телекристаллов кажется низкой для экспериментального телепортера, учитывая его потенциальную полезность в обмане и скрытном перемещении. Для сравнения:

  • Chainsword стоит 8 TC
  • Nocturine Gland Injector стоит 8 TC
✅ Verification successful

Стоимость телепортера соответствует балансу игры

Анализ показывает, что стоимость в 10 TC является обоснованной:

  • Большинство предметов в категории UplinkDeception стоят от 1 до 5 TC
  • Самые дорогие предметы (Corpium) стоят 20 TC
  • Учитывая ограниченное количество зарядов (4) и короткую дистанцию телепортации (3-8 метров), цена в 10 TC сбалансирована
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if localization keys exist
rg "uplink-experimental-syndicate-teleporter-(name|desc)" "Resources/Locale/"

Length of output: 509


Script:

#!/bin/bash
# Search for similar teleporter items and their costs
rg "Telecrystal: \d+" "Resources/Prototypes/_Backmen/Catalog/uplink_catalog.yml" -B2

# Search for items in UplinkDeception category
ast-grep --pattern 'categories:
    - UplinkDeception'

Length of output: 3858

🧰 Tools
🪛 yamllint (1.35.1)

[warning] 175-175: wrong indentation: expected 2 but found 4

(indentation)


[error] 175-175: no new line character at the end of file

(new-line-at-end-of-file)

@PvrG
Copy link
Contributor Author

PvrG commented Dec 2, 2024

изображение

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (2)
Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs (2)

20-32: Добавьте документацию к классу

Рекомендуется добавить XML-документацию, описывающую назначение системы и её основные функции.

Пример:

+ /// <summary>
+ /// Система, управляющая экспериментальным телепортером.
+ /// Обрабатывает телепортацию, аварийные ситуации и эффекты.
+ /// </summary>
public sealed class ExperimentalTeleporterSystem : EntitySystem

88-115: Добавьте документацию к вспомогательным методам

Рекомендуется добавить XML-документацию к методам для улучшения поддержки кода.

Пример:

+ /// <summary>
+ /// Проверяет наличие стены в указанных координатах.
+ /// </summary>
+ /// <param name="coords">Координаты для проверки</param>
+ /// <returns>true если обнаружена стена, иначе false</returns>
private bool TryCheckWall(EntityCoordinates coords)
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between aee31f5 and 52416da.

📒 Files selected for processing (1)
  • Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs (1 hunks)
🧰 Additional context used
🪛 GitHub Check: build (ubuntu-latest)
Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs

[failure] 59-59:
The type or namespace name 'GhostComponent' could not be found (are you missing a using directive or an assembly reference?)


[failure] 59-59:
The type or namespace name 'GhostComponent' could not be found (are you missing a using directive or an assembly reference?)

🪛 GitHub Check: YAML Linter
Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs

[failure] 59-59:
The type or namespace name 'GhostComponent' could not be found (are you missing a using directive or an assembly reference?)


[failure] 59-59:
The type or namespace name 'GhostComponent' could not be found (are you missing a using directive or an assembly reference?)

🪛 GitHub Check: Test Packaging
Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs

[failure] 59-59:
The type or namespace name 'GhostComponent' could not be found (are you missing a using directive or an assembly reference?)


[failure] 59-59:
The type or namespace name 'GhostComponent' could not be found (are you missing a using directive or an assembly reference?)

🔇 Additional comments (4)
Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs (4)

33-37: Инициализация реализована корректно

Подписка на событие UseInHandEvent выполнена правильно.


78-86: Метод телепортации реализован корректно

Логика телепортации, включая эффекты и изменение позиции, реализована правильно.


65-76: ⚠️ Potential issue

Добавьте защиту от бесконечной рекурсии

Метод может вызвать бесконечную рекурсию через Teleport. Необходимо добавить ограничение на количество попыток телепортации.


39-63: 🛠️ Refactor suggestion

Улучшите обработку использования телепортера

  1. Вынесите магическое число 3F в константу
  2. Добавьте проверку на null для компонента
  3. Упростите условия для лучшей читаемости

Предлагаемые изменения:

+ private const float GibSplatModifier = 3.0f;

private void OnUse(EntityUid uid, ExperimentalTeleporterComponent component, UseInHandEvent args)
{
+    if (!Resolve(args.User, ref xform))
+        return;
+
    if (_charges.IsEmpty(uid)
-        || !TryComp<TransformComponent>(args.User, out var xform)
        || (_containerSystem.IsEntityInContainer(args.User)
            && !_containerSystem.TryRemoveFromContainer(args.User)))
        return;

    // ...

-    _bodySystem.GibBody(args.User, true, splatModifier: 3F);
+    _bodySystem.GibBody(args.User, true, splatModifier: GibSplatModifier);
}

Likely invalid or redundant comment.

🧰 Tools
🪛 GitHub Check: build (ubuntu-latest)

[failure] 59-59:
The type or namespace name 'GhostComponent' could not be found (are you missing a using directive or an assembly reference?)


[failure] 59-59:
The type or namespace name 'GhostComponent' could not be found (are you missing a using directive or an assembly reference?)

🪛 GitHub Check: YAML Linter

[failure] 59-59:
The type or namespace name 'GhostComponent' could not be found (are you missing a using directive or an assembly reference?)


[failure] 59-59:
The type or namespace name 'GhostComponent' could not be found (are you missing a using directive or an assembly reference?)

🪛 GitHub Check: Test Packaging

[failure] 59-59:
The type or namespace name 'GhostComponent' could not be found (are you missing a using directive or an assembly reference?)


[failure] 59-59:
The type or namespace name 'GhostComponent' could not be found (are you missing a using directive or an assembly reference?)

Comment on lines +1 to +18
using System.Linq;
using System.Numerics;
using Content.Server.Body.Systems;
using Content.Server.Standing;
using Content.Shared.Backmen.Standing;
using Content.Shared.Charges.Systems;
using Content.Shared.Coordinates.Helpers;
using Content.Shared.Interaction.Events;
using Content.Shared.Maps;
using Content.Shared.Tag;
using Robust.Server.Audio;
using Robust.Server.Containers;
using Robust.Server.GameObjects;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using Robust.Shared.Random;

namespace Content.Server._White.Teleporter;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Добавьте отсутствующий импорт и исправьте пространство имён

  1. Отсутствует импорт для GhostComponent
  2. Пространство имён Content.Server._White.Teleporter не соответствует структуре остальных файлов в Backmen

Предлагаемые изменения:

+ using Content.Shared.Ghost;
- namespace Content.Server._White.Teleporter;
+ namespace Content.Server.Backmen.Teleporter;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
using System.Linq;
using System.Numerics;
using Content.Server.Body.Systems;
using Content.Server.Standing;
using Content.Shared.Backmen.Standing;
using Content.Shared.Charges.Systems;
using Content.Shared.Coordinates.Helpers;
using Content.Shared.Interaction.Events;
using Content.Shared.Maps;
using Content.Shared.Tag;
using Robust.Server.Audio;
using Robust.Server.Containers;
using Robust.Server.GameObjects;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using Robust.Shared.Random;
namespace Content.Server._White.Teleporter;
using System.Linq;
using System.Numerics;
using Content.Server.Body.Systems;
using Content.Server.Standing;
using Content.Shared.Backmen.Standing;
using Content.Shared.Charges.Systems;
using Content.Shared.Coordinates.Helpers;
using Content.Shared.Ghost;
using Content.Shared.Interaction.Events;
using Content.Shared.Maps;
using Content.Shared.Tag;
using Robust.Server.Audio;
using Robust.Server.Containers;
using Robust.Server.GameObjects;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using Robust.Shared.Random;
namespace Content.Server.Backmen.Teleporter;

@KayzelW
Copy link
Collaborator

KayzelW commented Dec 13, 2024

оно всё ещё гибает призраков?

@PvrG
Copy link
Contributor Author

PvrG commented Dec 13, 2024

оно всё ещё гибает призраков?

Нет

@KayzelW KayzelW merged commit 927bb82 into Rxup:master Dec 13, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changes: Localization Can be reviewed or fixed by people who are knowledgeable with translation Changes: Sprites Should be reviewed or fixed by people who are knowledgeable with spriting or visual design. S: Untriaged size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants