Добавления для спящего агента и обычного. - #1123
Conversation
|
Warning Review limit reached
Next review available in: 19 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughДобавлена цель активации спящего агента для Chaos Spy. Система выбирает неназначенного агента, выдаёт цель активному шпиону и отслеживает прогресс. Администратор получает сообщение о назначении. ChangesАктивация спящего агента
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested labels: Suggested reviewers: Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (2 errors, 1 inconclusive)
✅ Passed checks (8 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 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: 8
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Content.Server/_Scp/GameTicking/Rules/ChaosSleepSpyRuleSystem.cs`:
- Around line 71-75: Добавьте зависимость MobStateSystem в
ChaosSleepSpyRuleSystem и в цикле перебора ChaosSpyMobComponent проверяйте
_mobState.IsAlive(uid) до сравнения количества целей; пропускайте кандидата,
если он мёртв, сохраняя остальную логику выбора цели без изменений.
In
`@Content.Server/_Scp/Objectives/Systems/ScpActivateSleepSpyConditionSystem.cs`:
- Line 48: After selecting the target in the objective activation system, also
set the chosen agent’s ChaosSleepSpyMobComponent.IsAssigned flag to true so it
cannot be selected again. When the objective target is cancelled or otherwise
becomes available, reset IsAssigned to false.
- Around line 69-70: In the EntitySystem containing the shown metadata updates,
add an injected [Dependency] readonly ILocalizationManager field named _loc,
then replace both Loc.GetString calls in the entity name and description setup
with _loc.GetString. Keep the localization keys and arguments unchanged.
In `@Content.Shared/_Scp/Chaos/ChaosSleepSpyMobComponent.cs`:
- Around line 21-22: Добавьте краткую XML-документацию на английском языке перед
публичным полем IsAssigned в
Content.Shared/_Scp/Chaos/ChaosSleepSpyMobComponent.cs (строки 21-22) и перед
публичным полем Target в
Content.Server/_Scp/Objectives/Components/ScpActivateSleepSpyConditionComponent.cs
(строки 8-9), не изменяя их поведение.
- Around line 21-22: Добавьте перед атрибутом ViewVariables краткую
XML-документацию для публичного поля IsAssigned, описывающую его назначение, не
изменяя существующую логику.
In `@Resources/Locale/en-US/_strings/_scp/administration/antag.ftl`:
- Line 9: Update the antag result text at
Resources/Locale/en-US/_strings/_scp/administration/antag.ftl:9-9 and
Resources/Locale/ru-RU/_strings/_scp/administration/antag.ftl:9-9 to state that
the activation objective is assigned to the active spy with the fewest targets,
replacing the random-selection wording while preserving the rest of each
translation.
In
`@Resources/Locale/ru-RU/_strings/_scp/objectives/conditions/activate-sleep-spy.ftl`:
- Line 1: В строке objective-condition-chaos-spy-activate-sleep-spy-title
замените латинскую букву «c» в слове «cпящего» на кириллическую «с», сохранив
остальной текст без изменений.
In `@Resources/Prototypes/_Scp/Objectives/chaosSpy.yml`:
- Line 153: Update only the fallback description value in the objective
prototype so it begins with an uppercase letter, preserving the existing name
and all other fields unchanged.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: c725fb7a-4ad8-4746-b6a1-748f751d880e
📒 Files selected for processing (14)
Content.Server/Administration/Systems/AdminVerbSystem.Antags.csContent.Server/_Scp/GameTicking/Rules/ChaosSleepSpyRuleSystem.csContent.Server/_Scp/GameTicking/Rules/ChaosSpyRuleSystem.csContent.Server/_Scp/Objectives/Components/ScpActivateSleepSpyConditionComponent.csContent.Server/_Scp/Objectives/Systems/ScpActivateSleepSpyConditionSystem.csContent.Shared/_Scp/Chaos/ChaosSleepSpyMobComponent.csContent.Shared/_Scp/Chaos/ChaosSpyMobComponent.csResources/Locale/en-US/_strings/_scp/administration/antag.ftlResources/Locale/en-US/_strings/_scp/objectives/conditions/activate-sleep-spy.ftlResources/Locale/ru-RU/_strings/_scp/administration/antag.ftlResources/Locale/ru-RU/_strings/_scp/objectives/conditions/activate-sleep-spy.ftlResources/Prototypes/_Scp/GameRules/roundstart.ymlResources/Prototypes/_Scp/Objectives/chaosSpy.ymlResources/Prototypes/_Scp/Objectives/objectiveGroups.yml
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai full review |
|
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
Content.Server/_Scp/Objectives/Systems/ScpActivateSleepSpyConditionSystem.cs (2)
80-88: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low valueИспользуйте
Comp<CodeConditionComponent>для обязательного компонента.
ChaosSpyActivateSleepSpyObjectiveнаследуетBaseCodeObjective, где объявлен компонентCodeCondition, поэтомуTryCompздесь не должен даватьnullи потом использоваться в_condition.SetCompleted.Предлагаемое исправление
- if (TryComp<CodeConditionComponent>(ent, out var code) && code.Completed) + var code = Comp<CodeConditionComponent>(ent); + if (code.Completed)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@Content.Server/_Scp/Objectives/Systems/ScpActivateSleepSpyConditionSystem.cs` around lines 80 - 88, В системе проверки условия замените TryComp<CodeConditionComponent> на обязательное получение через Comp<CodeConditionComponent> перед использованием _condition.SetCompleted. Сохраните проверку code.Completed и ранний выход с Progress = 1f, используя гарантированно существующий компонент CodeConditionComponent.Source: Learnings
27-29: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick winЗафиксируйте порядок обработки прогресса цели.
OnGetProgressпроверяетCodeConditionComponentи может установитьCompleted = trueчерезCodeConditionSystem. СобытиеCodeConditionSystemтоже пишет вargs.Progress, поэтому без фиксированного порядка итоговое значение прогресса зависит от порядка подписок.Предлагаемое исправление
- SubscribeLocalEvent<ScpActivateSleepSpyConditionComponent, ObjectiveGetProgressEvent>(OnGetProgress); + SubscribeLocalEvent<ScpActivateSleepSpyConditionComponent, ObjectiveGetProgressEvent>( + OnGetProgress, after: [typeof(CodeConditionSystem)]);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@Content.Server/_Scp/Objectives/Systems/ScpActivateSleepSpyConditionSystem.cs` around lines 27 - 29, Зафиксируйте порядок обработки ObjectiveGetProgressEvent для OnGetProgress относительно обработчика CodeConditionSystem: настройте подписку так, чтобы проверка ScpActivateSleepSpyConditionComponent выполнялась после записи прогресса CodeConditionSystem. Сохраните текущую логику OnGetProgress, чтобы итоговые Completed и Progress не зависели от порядка регистрации подписчиков.Source: Coding guidelines
♻️ Duplicate comments (1)
Content.Server/_Scp/Objectives/Systems/ScpActivateSleepSpyConditionSystem.cs (1)
48-53:⚠️ Potential issue | 🟠 MajorСбрасывайте
IsAssignedпри отмене или удалении цели.
OnAssignedустанавливаетIsAssigned = true, но обратного пути в этом коде нет. Если цель отменена или удалена доTryUnsleepSpy, спящий шпион останется недоступным для следующих назначений.Добавьте очистку в lifecycle цели для текущего
Target. После успешного пробуждения сбрасывать флаг отдельно не требуется, потому чтоChaosSleepSpyMobComponentудаляется.#!/usr/bin/env bash set -euo pipefail rg -n -C 8 'IsAssigned|ScpActivateSleepSpyCondition|Objective.*(Cancel|Delete|Remove)' \ Content.Server Content.Shared🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@Content.Server/_Scp/Objectives/Systems/ScpActivateSleepSpyConditionSystem.cs` around lines 48 - 53, Добавьте обработку отмены или удаления текущей цели в lifecycle системы ScpActivateSleepSpyConditionSystem: перед очисткой Target проверьте его наличие и сбросьте ChaosSleepSpyMobComponent.IsAssigned в false. Сохраните существующий сброс компонента после успешного пробуждения и не добавляйте отдельную очистку для уже удалённого ChaosSleepSpyMobComponent.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@Content.Server/_Scp/Objectives/Components/ScpActivateSleepSpyConditionComponent.cs`:
- Around line 8-10: Update the XML summary for the Target field in
ScpActivateSleepSpyConditionComponent to use grammatically correct wording and
clearly state that it identifies the entity the active spy will activate.
In `@Resources/Prototypes/_Scp/Objectives/chaosSpy.yml`:
- Around line 152-153: Remove the unnecessary quotation marks around sleeper in
the prototype’s name and description fallback text, and update any corresponding
FTL strings using the same wording to match the unquoted text.
---
Outside diff comments:
In
`@Content.Server/_Scp/Objectives/Systems/ScpActivateSleepSpyConditionSystem.cs`:
- Around line 80-88: В системе проверки условия замените
TryComp<CodeConditionComponent> на обязательное получение через
Comp<CodeConditionComponent> перед использованием _condition.SetCompleted.
Сохраните проверку code.Completed и ранний выход с Progress = 1f, используя
гарантированно существующий компонент CodeConditionComponent.
- Around line 27-29: Зафиксируйте порядок обработки ObjectiveGetProgressEvent
для OnGetProgress относительно обработчика CodeConditionSystem: настройте
подписку так, чтобы проверка ScpActivateSleepSpyConditionComponent выполнялась
после записи прогресса CodeConditionSystem. Сохраните текущую логику
OnGetProgress, чтобы итоговые Completed и Progress не зависели от порядка
регистрации подписчиков.
---
Duplicate comments:
In
`@Content.Server/_Scp/Objectives/Systems/ScpActivateSleepSpyConditionSystem.cs`:
- Around line 48-53: Добавьте обработку отмены или удаления текущей цели в
lifecycle системы ScpActivateSleepSpyConditionSystem: перед очисткой Target
проверьте его наличие и сбросьте ChaosSleepSpyMobComponent.IsAssigned в false.
Сохраните существующий сброс компонента после успешного пробуждения и не
добавляйте отдельную очистку для уже удалённого ChaosSleepSpyMobComponent.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 05346f5f-00b6-4ab0-a2e6-95042085188f
📒 Files selected for processing (5)
Content.Server/_Scp/GameTicking/Rules/ChaosSleepSpyRuleSystem.csContent.Server/_Scp/Objectives/Components/ScpActivateSleepSpyConditionComponent.csContent.Server/_Scp/Objectives/Systems/ScpActivateSleepSpyConditionSystem.csContent.Shared/_Scp/Chaos/ChaosSleepSpyMobComponent.csResources/Prototypes/_Scp/Objectives/chaosSpy.yml
Краткое описание
Теперь при появлении спящего агента Повстанцев Хаоса, один из шпионов (с наименьшим количеством задач) будет получать цель на активацию спящего агента. Из информации у него будет только отдел, в котором находится спящая ячейка.
Ссылка на багрепорт/Предложение
Медиа (Видео/Скриншоты)
Changelog
🆑 EngineerLND
Summary by CodeRabbit
Новые возможности
Изменения игрового процесса