[FIX] Vent Teleport, Hemophilia, PointLight IPC, Attachable Estoc, Revenant#2651
[FIX] Vent Teleport, Hemophilia, PointLight IPC, Attachable Estoc, Revenant#2651Darkiich merged 8 commits intoAdventureTimeSS14:masterfrom
Conversation
WalkthroughВнесён рефакторинг очистки при выходе из труб в системе vent crawling: логика перемещена в приватный метод Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (2)
Content.Shared/Anomaly/Components/InnerBodyAnomalyComponent.cs (1)
26-32: Несоответствие в документации: "UIDs" vs "NetIDs".В строке 28 документация говорит "component UIDs", но поле хранит network IDs (сетевые идентификаторы компонентов). Название поля
AddedComponentNetIdsкорректное, но комментарий вводит в заблуждение.📝 Предлагаемое исправление документации
/// <summary> /// ADT-Tweak -/// List of component UIDs that were added by the anomaly. +/// List of component net IDs that were added by the anomaly. /// Used to remove only the specific components added by the anomaly, not all components of the same type. /// </summary>🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Shared/Anomaly/Components/InnerBodyAnomalyComponent.cs` around lines 26 - 32, The XML summary for the AddedComponentNetIds field is misleading—change the text to say these are network IDs (NetIDs) rather than component UIDs; update the summary on the AddedComponentNetIds field in InnerBodyAnomalyComponent (the comment starting "List of component UIDs...") to clearly state "List of component network IDs (NetIDs) that were added by the anomaly" and keep the existing explanation about using them to remove only the specific components added by the anomaly.Content.Server/ADT/VentCrawling/VentCrawableSystem.cs (1)
70-91: Добавьте/// <summary>документацию для методаExitVentCrawler.Согласно рекомендациям, важные функции должны иметь XML-документацию. Метод
ExitVentCrawlerвыполняет критическую логику очистки при выходе сущности из вентиляции.📝 Предлагаемая документация
+ /// <summary> + /// Обрабатывает выход отдельной сущности из вентиляционного ползуна. + /// Удаляет компонент BeingVentCrawlerComponent, извлекает сущность из контейнера, + /// прикрепляет к сетке/карте и сбрасывает состояние InTube. + /// </summary> + /// <param name="entity">EntityUid сущности, выходящей из вентиляции.</param> + /// <param name="container">Контейнер холдера вентиляционного ползуна.</param> private void ExitVentCrawler(EntityUid entity, Container container) {🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Server/ADT/VentCrawling/VentCrawableSystem.cs` around lines 70 - 91, Add an XML documentation comment (/// <summary>...</summary>) to the ExitVentCrawler method describing its purpose: that it removes the BeingVentCrawlerComponent, detaches the entity from its vent container via _containerSystem.Remove, reattaches it to the grid or map with _xformSystem.AttachToGridOrMap if appropriate, clears VentCrawlerComponent.InTube and marks it dirty, and wakes the physics body with _physicsSystem.WakeBody; reference the method name ExitVentCrawler and the related components (BeingVentCrawlerComponent, VentCrawlerComponent) in the summary so callers and maintainers understand the cleanup steps performed.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@Content.Server/ADT/VentCrawling/VentCrawableSystem.cs`:
- Line 74: Удалите неиспользуемую локальную переменную meta, объявленную через
вызов MetaData(entity) в методе VentCrawableSystem (строка с "var meta =
MetaData(entity);"); либо если значение нужно — используйте его в последующем
коде, иначе просто убрать объявление (или заменить на discard `_ =
MetaData(entity);`), чтобы устранить мёртвый код.
In `@Resources/Prototypes/Traits/disabilities.yml`:
- Line 127: В строке с ключом "category: Quirks" комментарий не соответствует
coding guidelines; замените существующий комментарий "#ADT Quirks; fix by Prunt"
на формат с префиксом "# ADT-Tweak:" — например "# ADT-Tweak: Quirks; fix by
Prunt" (оставьте остальную подсказку автора), чтобы соответствовать требованию
одиночных строк помечать через "# ADT-Tweak:".
- Line 140: Строка комментария после "category: Quirks" использует неверный
формат "#ADT Quirks; fix by Prunt"; замените её на формат с префиксом "#
ADT-Tweak:" (например "# ADT-Tweak: Quirks; fix by Prunt") чтобы соответствовать
правилам для одиночных строк; найдите и обновите фрагмент "category: Quirks `#ADT`
Quirks; fix by Prunt" в файле и сохраните остальной текст комментария
неизменным.
---
Nitpick comments:
In `@Content.Server/ADT/VentCrawling/VentCrawableSystem.cs`:
- Around line 70-91: Add an XML documentation comment (///
<summary>...</summary>) to the ExitVentCrawler method describing its purpose:
that it removes the BeingVentCrawlerComponent, detaches the entity from its vent
container via _containerSystem.Remove, reattaches it to the grid or map with
_xformSystem.AttachToGridOrMap if appropriate, clears
VentCrawlerComponent.InTube and marks it dirty, and wakes the physics body with
_physicsSystem.WakeBody; reference the method name ExitVentCrawler and the
related components (BeingVentCrawlerComponent, VentCrawlerComponent) in the
summary so callers and maintainers understand the cleanup steps performed.
In `@Content.Shared/Anomaly/Components/InnerBodyAnomalyComponent.cs`:
- Around line 26-32: The XML summary for the AddedComponentNetIds field is
misleading—change the text to say these are network IDs (NetIDs) rather than
component UIDs; update the summary on the AddedComponentNetIds field in
InnerBodyAnomalyComponent (the comment starting "List of component UIDs...") to
clearly state "List of component network IDs (NetIDs) that were added by the
anomaly" and keep the existing explanation about using them to remove only the
specific components added by the anomaly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 16dde178-2ccf-4dc7-8f0e-f8b62d2ce28e
📒 Files selected for processing (6)
Content.Server/ADT/VentCrawling/VentCrawableSystem.csContent.Server/Anomaly/Effects/InnerBodyAnomalySystem.csContent.Shared/ADT/VentCrawling/SharedVentCrawableSystem.csContent.Shared/Anomaly/Components/InnerBodyAnomalyComponent.csResources/Prototypes/Entities/Objects/Weapons/Guns/Rifles/rifles.ymlResources/Prototypes/Traits/disabilities.yml
|
@CrimeMoot у новакидов проблема как у КПБ. Их тоже почини если не уже |
Это глобальное исправление. Оно не только к КПБ. Если ты про light |
Дай я тебя засосу |
|
Но добавь в CL тогда и про них |
А что конкретно у новакидов ломалось? |
У них собственный свет в зависимости от цвета кожи новакида |
|
перепроверю |
|
Да. Всё сохраняется и после убрать аномалию возвращает и цвет и прочее обратно как было. |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (3)
Content.Server/Revenant/EntitySystems/RevenantSystem.cs (3)
195-213: Дублирование логики щита.Логика активации щита (проверка
RevenantShieldComponent, установкаUsed, удаление статусов, восстановление эссенции) дублируется в двух местах:
OnMobStateChanged(строки 126-139)ChangeEssenceAmount(строки 198-207)Это необходимо для обработки двух разных сценариев смерти (смена MobState vs истощение эссенции), но дублирование увеличивает риск рассинхронизации при будущих изменениях.
♻️ Рекомендация: вынести общую логику в приватный метод
/// <summary> /// Пытается активировать щит Неколебимости для спасения ревенанта. /// </summary> /// <returns>true если щит был успешно активирован.</returns> private bool TryActivateShield(EntityUid uid, RevenantComponent component) { if (!TryComp<RevenantShieldComponent>(uid, out var shield) || shield.Used) return false; if (component.Essence + ShieldEssenceRestore <= 0) return false; shield.Used = true; _status.TryRemoveStatusEffect(uid, "Stun"); _status.TryRemoveStatusEffect(uid, "Corporeal"); ChangeEssenceAmount(uid, ShieldEssenceRestore, component, allowDeath: false); _popup.PopupEntity(Loc.GetString("revenant-shield-activated"), uid, uid); return true; }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Server/Revenant/EntitySystems/RevenantSystem.cs` around lines 195 - 213, Duplicate shield activation logic exists in OnMobStateChanged and ChangeEssenceAmount; extract it into a private helper (e.g., TryActivateShield) inside RevenantSystem and have both OnMobStateChanged and ChangeEssenceAmount call it. The helper should check TryComp<RevenantShieldComponent>(uid, out shield) and shield.Used, verify component.Essence + ShieldEssenceRestore > 0, set shield.Used = true, remove statuses via _status.TryRemoveStatusEffect(uid, "Stun") and "Corporeal", call ChangeEssenceAmount(uid, ShieldEssenceRestore, component, allowDeath: false) (or the appropriate overload), and show the popup; replace the duplicated blocks in OnMobStateChanged and ChangeEssenceAmount with a single call to TryActivateShield(uid, component).
142-143: Избыточная проверкаExists(uid).Проверка
Exists(uid)на строке 142 избыточна — идентичная проверка уже выполнена на строках 123-124, и между ними нет кода, который мог бы удалить сущность.♻️ Предложенное исправление
} - if (Exists(uid)) - Spawn(component.SpawnOnDeathPrototype, Transform(uid).Coordinates); + Spawn(component.SpawnOnDeathPrototype, Transform(uid).Coordinates); }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Server/Revenant/EntitySystems/RevenantSystem.cs` around lines 142 - 143, Remove the redundant Exists(uid) check before spawning: since Exists(uid) was already verified earlier in the same method (lines 123-124) and no code in-between can delete the entity, delete the extra conditional and call Spawn using component.SpawnOnDeathPrototype and Transform(uid).Coordinates directly; update the RevenantSystem logic to rely on the earlier existence check and keep the Spawn(component.SpawnOnDeathPrototype, Transform(uid).Coordinates) call as the sole spawn invocation.
117-145: Зависимость_statusуже объявлена в partial классеКод использует
_status.TryRemoveStatusEffectкорректно. ПосколькуRevenantSystem.csявляется partial классом, зависимостьStatusEffectsSystem _statusизRevenantSystem.Abilities.cs(строка 62) доступна во всех частях класса. Это стандартная практика в C# и дополнительная проверка не требуется.Рекомендуется рассмотреть вынесение магического числа 50 в именованную константу для улучшения читаемости:
♻️ Предложение: константа для значения эссенции
public sealed partial class RevenantSystem : EntitySystem { + /// <summary> + /// Количество эссенции, восстанавливаемое при активации щита Неколебимости. + /// </summary> + private const float ShieldEssenceRestore = 50f;Использовать
ShieldEssenceRestoreв строках 128, 135, 200, 205.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Server/Revenant/EntitySystems/RevenantSystem.cs` around lines 117 - 145, The _status field is fine as-is (it's declared in the partial class), but replace the magic literal 50 with a named constant to improve readability: add a private const int ShieldEssenceRestore = 50 to the RevenantSystem class and use it instead of the literal in OnMobStateChanged (the component.Essence + 50 check and the ChangeEssenceAmount call) and in the other places where 50 is used for shield/essence logic (e.g., other ChangeEssenceAmount or essence-check sites in RevenantSystem), preserving behavior and allowDeath parameter.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@Content.Server/Revenant/EntitySystems/RevenantSystem.cs`:
- Line 137: The code calls Loc.GetString("revenant-shield-activated") in
RevenantSystem (RevenantSystem.cs) but the English FTL file is missing the
corresponding entries; open Resources/Locale/en-US/ADT/Revenant/revenant.ftl and
add English translations for the keys revenant-shield-effect-name,
revenant-shield-effect-desc, and revenant-shield-activated (matching the Russian
keys already present) so Loc.GetString can resolve them at runtime; ensure the
message IDs exactly match those symbols and provide clear English text for the
effect name, description, and activation message.
---
Nitpick comments:
In `@Content.Server/Revenant/EntitySystems/RevenantSystem.cs`:
- Around line 195-213: Duplicate shield activation logic exists in
OnMobStateChanged and ChangeEssenceAmount; extract it into a private helper
(e.g., TryActivateShield) inside RevenantSystem and have both OnMobStateChanged
and ChangeEssenceAmount call it. The helper should check
TryComp<RevenantShieldComponent>(uid, out shield) and shield.Used, verify
component.Essence + ShieldEssenceRestore > 0, set shield.Used = true, remove
statuses via _status.TryRemoveStatusEffect(uid, "Stun") and "Corporeal", call
ChangeEssenceAmount(uid, ShieldEssenceRestore, component, allowDeath: false) (or
the appropriate overload), and show the popup; replace the duplicated blocks in
OnMobStateChanged and ChangeEssenceAmount with a single call to
TryActivateShield(uid, component).
- Around line 142-143: Remove the redundant Exists(uid) check before spawning:
since Exists(uid) was already verified earlier in the same method (lines
123-124) and no code in-between can delete the entity, delete the extra
conditional and call Spawn using component.SpawnOnDeathPrototype and
Transform(uid).Coordinates directly; update the RevenantSystem logic to rely on
the earlier existence check and keep the Spawn(component.SpawnOnDeathPrototype,
Transform(uid).Coordinates) call as the sole spawn invocation.
- Around line 117-145: The _status field is fine as-is (it's declared in the
partial class), but replace the magic literal 50 with a named constant to
improve readability: add a private const int ShieldEssenceRestore = 50 to the
RevenantSystem class and use it instead of the literal in OnMobStateChanged (the
component.Essence + 50 check and the ChangeEssenceAmount call) and in the other
places where 50 is used for shield/essence logic (e.g., other
ChangeEssenceAmount or essence-check sites in RevenantSystem), preserving
behavior and allowDeath parameter.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 1b065fdf-36b3-4118-af60-96d1f86cec35
📒 Files selected for processing (2)
Content.Server/Revenant/EntitySystems/RevenantSystem.csResources/Locale/ru-RU/ADT/Revenant/revenant.ftl
✅ Files skipped from review due to trivial changes (1)
- Resources/Locale/ru-RU/ADT/Revenant/revenant.ftl
| revenant-shield-effect-name = Неколебимость | ||
| revenant-shield-effect-desc = Получите возможность обмануть смерть ещё один раз. | ||
| revenant-shield-activated = Неколебимость активирована! Вы обманули смерть. | ||
|
|
There was a problem hiding this comment.
Мб ты имел в виду "непоколебимость"?
There was a problem hiding this comment.
Скилл называется Неколебимость. Буквально выше написан.
Техническая информация
Чейнджлог
🆑 CrimeMoot