Revork optimization xeno - #3064
Conversation
WalkthroughДобавлены CVars для ограничения численности слизней и замедления размножения. Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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: 4
🧹 Nitpick comments (3)
Content.Server/ADT/Xenobiology/SlimeScannerSystem.cs (1)
5-13: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winОтсортируйте блок
usingпо алфавиту.Разместите
Content.Shared.ADT.CCVarпередContent.Shared.ADT.Xenobiology.Systems. РазместитеRobust.Shared.Audio.SystemsиRobust.Shared.ConfigurationпередRobust.Shared.Prototypes.As per path instructions: «смотри за тем чтобы using был в алфавитном порядке в наших /ADT/ системах и компонентах».
🤖 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/ADT/Xenobiology/SlimeScannerSystem.cs` around lines 5 - 13, Sort the using directives in SlimeScannerSystem alphabetically: place Content.Shared.ADT.CCVar before Content.Shared.ADT.Xenobiology.Systems, and place Robust.Shared.Audio.Systems and Robust.Shared.Configuration before Robust.Shared.Prototypes.Source: Path instructions
Content.Shared/ADT/Xenobiology/Systems/XenobiologySystem.Breeding.cs (1)
14-18: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winОтсортируйте новые
usingпо алфавиту.Разместите
Content.Shared.NPC.ComponentsпередContent.Shared.NPC.Systems. Проверьте порядок всего блокаusing.As per path instructions: «смотри за тем чтобы using был в алфавитном порядке в наших /ADT/ системах и компонентах».
🤖 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.Shared/ADT/Xenobiology/Systems/XenobiologySystem.Breeding.cs` around lines 14 - 18, Отсортируйте весь блок using в XenobiologySystem.Breeding.cs в алфавитном порядке, разместив Content.Shared.NPC.Components перед Content.Shared.NPC.Systems и сохранив остальные импорты без изменений.Source: Path instructions
Content.Shared/ADT/Xenobiology/Components/SlimeComponent.cs (1)
151-152: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winДобавьте XML-документацию для
FriendSightRange.Укажите, что значение задаёт радиус в тайлах для игроков, которые видят митоз. Укажите, что значение
<= 0отключает добавление исключений фракции.As per path instructions: «предлагай /// summary документацию к C# коду, к важным функциям или классам».
🤖 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.Shared/ADT/Xenobiology/Components/SlimeComponent.cs` around lines 151 - 152, Добавьте XML-документацию /// summary к свойству FriendSightRange, указав, что оно задаёт радиус в тайлах для игроков, видящих митоз, а значение меньше или равно нулю отключает добавление исключений фракции.Source: Path instructions
🤖 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.Shared/ADT/CCVar/CCVars.cs`:
- Around line 60-81: Исправьте модель замедления популяции: в
Content.Shared/ADT/CCVar/CCVars.cs, у XenobiologyBreedingSlowdownFactor
установите значение по умолчанию 0.015f и обновите документацию, указав, что это
коэффициент на каждого слизня сверх порога. В
Content.Shared/ADT/Xenobiology/Systems/XenobiologySystem.Breeding.cs, в расчёте
замедления вокруг DoMitosis возвращайте 1f при density >= max независимо от
коэффициента, а ниже лимита вычисляйте значение как (density - start) * factor.
In `@Content.Shared/ADT/Xenobiology/Systems/XenobiologySystem.Breeding.cs`:
- Around line 261-265: Remove the uid == ent.Owner skip in the
population-counting logic so the originating slime is included; keep counting
entities whose xform.GridUid matches gridId unchanged.
- Around line 255-265: Update the breeding count logic around
Transform(ent).GridUid and xform.GridUid so entities with a null grid are not
counted as belonging to the same population; return zero for an owner not on a
grid, or otherwise require a matching map identifier in addition to GridUid.
Preserve counting only for non-owner slimes on the same grid.
- Around line 207-215: Update the entity loop that builds witnessed in
Xenobiology breeding to skip dead players by checking
_mobState.IsDead(playerUid) before witnessed.Add. Preserve the existing
latched-target exclusion and only add living players.
---
Nitpick comments:
In `@Content.Server/ADT/Xenobiology/SlimeScannerSystem.cs`:
- Around line 5-13: Sort the using directives in SlimeScannerSystem
alphabetically: place Content.Shared.ADT.CCVar before
Content.Shared.ADT.Xenobiology.Systems, and place Robust.Shared.Audio.Systems
and Robust.Shared.Configuration before Robust.Shared.Prototypes.
In `@Content.Shared/ADT/Xenobiology/Components/SlimeComponent.cs`:
- Around line 151-152: Добавьте XML-документацию /// summary к свойству
FriendSightRange, указав, что оно задаёт радиус в тайлах для игроков, видящих
митоз, а значение меньше или равно нулю отключает добавление исключений фракции.
In `@Content.Shared/ADT/Xenobiology/Systems/XenobiologySystem.Breeding.cs`:
- Around line 14-18: Отсортируйте весь блок using в
XenobiologySystem.Breeding.cs в алфавитном порядке, разместив
Content.Shared.NPC.Components перед Content.Shared.NPC.Systems и сохранив
остальные импорты без изменений.
🪄 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: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 8bff23af-b07f-4870-bfd2-09392cb9d598
📒 Files selected for processing (9)
Content.Client/ADT/Xenobiology/UI/SlimeScannerWindow.xamlContent.Client/ADT/Xenobiology/UI/SlimeScannerWindow.xaml.csContent.Server/ADT/Xenobiology/SlimeScannerSystem.csContent.Shared/ADT/CCVar/CCVars.csContent.Shared/ADT/Xenobiology/Components/SlimeComponent.csContent.Shared/ADT/Xenobiology/SlimeScannerScannedMessage.csContent.Shared/ADT/Xenobiology/Systems/XenobiologySystem.Breeding.csResources/Locale/en-US/ADT/xenobio/slime-scanner.ftlResources/Locale/ru-RU/ADT/xenobio/slime-scanner.ftl
Техническая информация
Чейнджлог