Skip to content

Revork optimization xeno - #3064

Open
CrimeMoot wants to merge 2 commits into
masterfrom
revork_optimization_xeno
Open

Revork optimization xeno#3064
CrimeMoot wants to merge 2 commits into
masterfrom
revork_optimization_xeno

Conversation

@CrimeMoot

Copy link
Copy Markdown
Collaborator

Техническая информация

  • Изменения были протестированы на локальном сервере, и всё работает отлично.
  • PR закончен и требует просмотра изменений.

Чейнджлог

  • add: Внедрена система популяционного контроля для слаймов. Начиная с 30-й особи, каждый новый слайм начинает оказывать угнетающее воздействие на популяцию, снижая скорость роста всех слаймов на 1,5% за каждую единицу свыше лимита. Данный эффект действует вплоть до достижения численности в 60 особей. При наступлении популяционного предела новые слаймы перестают появляться в результате митоза
  • tweak: Усовершенствовано поведение слаймов в фазе митоза. Теперь при обнаружении живых игроков в радиусе 10 клеток все слаймы (как родительская особь, так и вновь появившиеся в результате митоза) переходят в дружелюбный режим по отношению к ним

@github-actions github-actions Bot added Changes: UI Изменение интерфейса Changes: Localization Изменение локализации size/M Status: Needs Review labels Aug 5, 2026
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Добавлены CVars для ограничения численности слизней и замедления размножения. XenobiologySystem рассчитывает плотность на сетке и изменяет число потомков при митозе. После митоза игроки в радиусе наблюдения добавляются в исключения отношений, кроме закреплённой цели. SlimeScannerSystem передаёт показатели плотности в сообщение сканера. Клиентский интерфейс отображает численность и предупреждение о замедлении размножения.

Possibly related PRs

Suggested reviewers: filokini

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 15.38% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive Заголовок связан с изменениями ксенобиологии, но не описывает систему контроля популяции и обновление поведения слизней. Замените заголовок на конкретный, например: «Добавлен контроль популяции слизней и обновлено поведение при митозе».
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed Описание точно отражает изменения: контроль популяции слизней и переход к дружелюбному режиму при обнаружении игроков.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch revork_optimization_xeno

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between e6863b3 and 8652520.

📒 Files selected for processing (9)
  • Content.Client/ADT/Xenobiology/UI/SlimeScannerWindow.xaml
  • Content.Client/ADT/Xenobiology/UI/SlimeScannerWindow.xaml.cs
  • Content.Server/ADT/Xenobiology/SlimeScannerSystem.cs
  • Content.Shared/ADT/CCVar/CCVars.cs
  • Content.Shared/ADT/Xenobiology/Components/SlimeComponent.cs
  • Content.Shared/ADT/Xenobiology/SlimeScannerScannedMessage.cs
  • Content.Shared/ADT/Xenobiology/Systems/XenobiologySystem.Breeding.cs
  • Resources/Locale/en-US/ADT/xenobio/slime-scanner.ftl
  • Resources/Locale/ru-RU/ADT/xenobio/slime-scanner.ftl

Comment thread Content.Shared/ADT/CCVar/CCVars.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Changes: Localization Изменение локализации Changes: UI Изменение интерфейса size/M Status: Needs Review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant