Skip to content

учим боргов сидеть - #556

Open
Fooksy2304 wants to merge 5 commits into
makura-games:masterfrom
Fooksy2304:borgee
Open

Fooksy2304 wants to merge 5 commits into
makura-games:masterfrom
Fooksy2304:borgee

Conversation

@Fooksy2304

@Fooksy2304 Fooksy2304 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

пытаюсь научить боргов сидеть опять
image
image
image

🆑 Fooksy2304

  • fix: борги снова научились сидеть

Summary by CodeRabbit

  • Новые возможности
    • Борги могут переключаться между состояниями «Сесть» и «Встать» с помощью нового действия.
    • Добавлена визуализация отдыха, включая отдельные состояния для сидящего и неисправного борга.
    • Состояние отдыха синхронизируется между клиентом и сервером.
  • Локализация
    • Добавлены русские и английские названия и описания действия отдыха.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@Fooksy2304, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 20 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 8c583ec2-cce5-45b5-a3f6-8ac55fa3d624

📥 Commits

Reviewing files that changed from the base of the PR and between db809a0 and 3c1253f.

📒 Files selected for processing (1)
  • Content.Shared/_Lust/Borgs/SharedBorgRestActionSystem.cs
📝 Walkthrough

Walkthrough

Добавлена механика добровольного отдыха боргов: action переключает состояние через knockdown, компоненты синхронизируют его с визуальными параметрами, а клиент отображает состояния отдыха и повреждения отдельными RSI-слоями.

Changes

Механика отдыха боргов

Layer / File(s) Summary
Контракты состояния и визуальных слоёв
Content.Shared/Silicons/Borgs/Components/BorgChassisComponent.cs, Content.Shared/_Lust/Borgs/Components/BorgRestActionComponent.cs
Добавлены слои Resting и Wrecked, компоненты действия и состояния отдыха, событие переключения и сетевой enum визуала.
Переключение состояния отдыха
Content.Shared/_Lust/Borgs/SharedBorgRestActionSystem.cs
Система регистрирует action, проверяет условия, выполняет knockdown, добавляет или удаляет BorgRestingComponent, синхронизирует toggle и визуальное состояние.
Прототипы action и корпуса
Resources/Prototypes/Actions/borgs.yml, Resources/Prototypes/Entities/Mobs/Cyborgs/borg_chassis.yml, Resources/Locale/*/_prototypes/actions/borgs.ftl
Добавлены action ActionBorgToggleRest, слои robot_rest и robot_wreck, компонент корпуса и локализация на английском и русском языках.
Клиентская визуализация состояний
Content.Client/Silicons/Borgs/BorgSystem.cs, Content.Client/_Lust/Borgs/BorgSystem.StandingVisuals.cs
Добавлен ранний partial-хук обновления визуала, переключающий производные состояния и видимость слоёв в зависимости от жизни и отдыха борга.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Игрок
  participant SharedBorgRestActionSystem
  participant SharedStunSystem
  participant BorgRestingComponent
  participant BorgSystem

  Игрок->>SharedBorgRestActionSystem: BorgToggleRestActionEvent
  SharedBorgRestActionSystem->>SharedStunSystem: TryKnockdown
  SharedBorgRestActionSystem->>BorgRestingComponent: AddComp или RemComp
  SharedBorgRestActionSystem->>BorgSystem: BorgRestVisuals и RotationVisuals
  BorgSystem->>BorgSystem: UpdateLustBorgStandingVisuals
  BorgSystem->>BorgSystem: Обновление слоёв Resting, Wrecked и Body
Loading

Suggested labels: 🛠️ Есть C# 🛠️, 📦 YAML | Прототип 📦, 📚 Изменения: Локализация 📚

Suggested reviewers: kanopus952


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Ss14 C# Rules ❌ Error SharedBorgRestActionSystem нарушает контракт: public Try/Can без Entity<T?>, quiet=false и summary, а TryToggleRest возвращает true даже при неудаче DoRest. Приведите сигнатуры к Entity<BorgRestActionComponent?>, добавьте quiet = false и /// <summary>, а DoRest/TryToggleRest должны возвращать false при неудаче.
✅ Passed checks (10 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Заголовок точно отражает основное изменение: боргам добавили возможность садиться и вставать.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Ss14 Bridge Sync ✅ Passed В PR нет изменений в .agents/.agent/.claude/.cursor/.github/rules или skills относительно merge-base с origin/master.
Ss14 Fork/Project Folder Selection ✅ Passed Активный форк — Lust: новое fork-логичное код/компоненты в _Lust, а правки в vanilla помечены Lust edit и сводятся к хукам/прототипам.
Ss14 Yaml/Ftl Rules ✅ Passed Добавленные FTL/YAML строки соответствуют правилам: ent-* ключи, CamelCase IDs, - type: без Component, английские fallback-поля в YAML. Явных нарушений в diff нет.
Ss14 Prototype ↔ Ftl Parity ✅ Passed ActionBorgToggleRest добавлен в прототип и имеет matching ent-ключи в en-US и ru-RU; паритет не нарушен.
Ss14 Prediction Safety ✅ Passed В shared-коде нет рандома, PVS-попапов, queue-del или иных одноразовых эффектов; рест/визуал борга основаны на синхронизируемом состоянии.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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: 6

🤖 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.Client/_Lust/Borgs/BorgSystem.StandingVisuals.cs`:
- Around line 24-28: In BorgSystem.StandingVisuals, the Resting and Wrecked
layer visibility is only updated when TrySetDerivedLayerState succeeds, so
missing RSI states can leave stale visible layers behind. Update the logic
around TrySetDerivedLayerState for BorgVisualLayers.Resting and
BorgVisualLayers.Wrecked to explicitly hide the corresponding layer in an else
branch when the derived state is absent, keeping the sprite state in sync.

In `@Content.Shared/_Lust/Borgs/Components/BorgRestActionComponent.cs`:
- Around line 24-25: Remove [DataField] from the runtime-generated
ToggleActionEntity field in BorgRestActionComponent and keep only
[AutoNetworkedField]. Update the component definition so this EntityUid? is
treated as a gameplay-created runtime value set by
ComponentStartup/_actions.AddAction, not as YAML-serializable state. Verify no
other runtime EntityUid fields in this component follow the same incorrect
pattern.

In `@Content.Shared/_Lust/Borgs/SharedBorgRestActionSystem.cs`:
- Around line 51-56: In SharedBorgRestActionSystem.OnToggleRest, the visual
rotation is being set redundantly and not cleared when TryKnockdown fails. Move
the rotation/state handling to the BorgRestingComponent lifecycle already
covered by OnRestingStartup and OnRestingRemove, and remove the extra
SetRestingVisualRotation and UpdateActionState calls from OnToggleRest so the
visual state is always reset correctly when BorgRestingComponent is removed.
- Around line 37-60: OnToggleRest currently mutates state directly and bypasses
the required OnEvent → TryDo → CanDo → Do flow. Refactor
SharedBorgRestActionSystem so OnToggleRest only marks args.Handled and calls a
public TryToggleRest-style method; move the component changes and
_stun.TryKnockdown into Do, and add a CanToggleRest-style pure check that blocks
resting when the borg cannot rest (for example dead, in crit, or no player).
Keep UpdateActionState in the successful Do path and remove side effects from
the event handler.

In `@Resources/Prototypes/Actions/borgs.yml`:
- Around line 30-43: The new ActionBorgToggleRest entry in borgs.yml is a
fork-specific addition inside an upstream file and must be marked accordingly.
Add the required Lust edit markers around this entity block so the
upstream-vs-fork change is explicit, and keep the existing ActionBorgToggleRest,
_Lust sprite reference, and BorgToggleRestActionEvent intact while wrapping the
added section with the project’s standard fork-addition markers.

In `@Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml`:
- Around line 262-266: The Crawler component in BaseBorgChassisNotIonStormable
is affecting every borg inherited from the chassis, not just the selectable
chassis variant. Move the Crawler setup into BorgChassisSelectable if the
zero-speed crawling behavior is meant only for that subtype, or adjust the
speedModifier in the shared base chassis to a nonzero value. Use the Crawler
component and BorgChassisSelectable as the key anchors when updating the YAML
inheritance.
🪄 Autofix (Beta)

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

Run ID: 4048020f-eac1-42eb-a4ce-212e6c51eab1

📥 Commits

Reviewing files that changed from the base of the PR and between 1e6486f and 0c1e952.

📒 Files selected for processing (10)
  • Content.Client/Silicons/Borgs/BorgSystem.cs
  • Content.Client/_Lust/Borgs/BorgSystem.StandingVisuals.cs
  • Content.Shared/Silicons/Borgs/Components/BorgChassisComponent.cs
  • Content.Shared/_Lust/Borgs/Components/BorgRestActionComponent.cs
  • Content.Shared/_Lust/Borgs/SharedBorgRestActionSystem.cs
  • Resources/Locale/en-US/_prototypes/actions/borgs.ftl
  • Resources/Locale/ru-RU/_prototypes/actions/borgs.ftl
  • Resources/Prototypes/Actions/borgs.yml
  • Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml
  • Resources/Prototypes/Entities/Mobs/Cyborgs/borg_chassis.yml

Comment thread Content.Client/_Lust/Borgs/BorgSystem.StandingVisuals.cs
Comment thread Content.Shared/_Lust/Borgs/Components/BorgRestActionComponent.cs Outdated
Comment thread Content.Shared/_Lust/Borgs/SharedBorgRestActionSystem.cs
Comment thread Content.Shared/_Lust/Borgs/SharedBorgRestActionSystem.cs Outdated
Comment thread Resources/Prototypes/Actions/borgs.yml
Comment thread Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml Outdated
@github-actions github-actions Bot added the size/M label Jul 9, 2026
@Fooksy2304
Fooksy2304 marked this pull request as ready for review July 9, 2026 11:44
@Fooksy2304 Fooksy2304 changed the title Borgee учим боргов сидеть Jul 9, 2026

@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: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
Content.Client/_Lust/Borgs/BorgSystem.StandingVisuals.cs (1)

38-46: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Восстанавливайте LightStatus после подъёма.

Line 44 скрывает слой, но при alive && !resting на Line 39 выполняется ранний выход. Базовый Content.Client/Silicons/Borgs/BorgSystem.cs восстанавливает только Light, поэтому LightStatus останется невидимым после первого отдыха. Перед ранним выходом верните видимость слоя.

🤖 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.Client/_Lust/Borgs/BorgSystem.StandingVisuals.cs` around lines 38 -
46, В обработчике визуального состояния Borg добавьте восстановление видимости
слоя BorgVisualLayers.LightStatus перед ранним выходом при alive && !resting,
проверяя существование слоя через LayerExists и включая его через
LayerSetVisible. Сохраните текущую логику скрытия LightStatus при отдыхе и
поведение для отсутствующего слоя.
🤖 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/_Lust/Borgs/SharedBorgRestActionSystem.cs`:
- Around line 79-103: Update the public TryToggleRest and CanToggleRest
signatures to accept Entity<BorgRestActionComponent?>, resolve the nullable
action component via Resolve, and add the CanToggleRest bool quiet = false
parameter while preserving existing behavior. Add XML <summary> documentation to
both public methods and use quiet consistently in CanToggleRest as required by
the API contract.
- Around line 79-89: Update TryToggleRest so the DoRest branch returns DoRest’s
success result instead of always returning true. Change DoRest to return false
when TryKnockdown does not perform the transition, and return true only after
resting succeeds; preserve the existing successful stand-up behavior.

---

Outside diff comments:
In `@Content.Client/_Lust/Borgs/BorgSystem.StandingVisuals.cs`:
- Around line 38-46: В обработчике визуального состояния Borg добавьте
восстановление видимости слоя BorgVisualLayers.LightStatus перед ранним выходом
при alive && !resting, проверяя существование слоя через LayerExists и включая
его через LayerSetVisible. Сохраните текущую логику скрытия LightStatus при
отдыхе и поведение для отсутствующего слоя.
🪄 Autofix (Beta)

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: 53c3655a-7e51-4636-a326-7d26c5043359

📥 Commits

Reviewing files that changed from the base of the PR and between 0c1e952 and db809a0.

📒 Files selected for processing (3)
  • Content.Client/_Lust/Borgs/BorgSystem.StandingVisuals.cs
  • Content.Shared/_Lust/Borgs/Components/BorgRestActionComponent.cs
  • Content.Shared/_Lust/Borgs/SharedBorgRestActionSystem.cs

Comment thread Content.Shared/_Lust/Borgs/SharedBorgRestActionSystem.cs Outdated
Comment thread Content.Shared/_Lust/Borgs/SharedBorgRestActionSystem.cs Outdated
@matizzze
matizzze self-requested a review August 24, 2026 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants