учим боргов сидеть - #556
Fooksy2304 wants to merge 5 commits into
Conversation
|
Warning Review limit reached
Next review available in: 20 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. 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 (1)
📝 WalkthroughWalkthroughДобавлена механика добровольного отдыха боргов: action переключает состояние через knockdown, компоненты синхронизируют его с визуальными параметрами, а клиент отображает состояния отдыха и повреждения отдельными RSI-слоями. ChangesМеханика отдыха боргов
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
Suggested labels: Suggested reviewers: Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error)
✅ Passed checks (10 passed)
✨ 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: 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
📒 Files selected for processing (10)
Content.Client/Silicons/Borgs/BorgSystem.csContent.Client/_Lust/Borgs/BorgSystem.StandingVisuals.csContent.Shared/Silicons/Borgs/Components/BorgChassisComponent.csContent.Shared/_Lust/Borgs/Components/BorgRestActionComponent.csContent.Shared/_Lust/Borgs/SharedBorgRestActionSystem.csResources/Locale/en-US/_prototypes/actions/borgs.ftlResources/Locale/ru-RU/_prototypes/actions/borgs.ftlResources/Prototypes/Actions/borgs.ymlResources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.ymlResources/Prototypes/Entities/Mobs/Cyborgs/borg_chassis.yml
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 (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
📒 Files selected for processing (3)
Content.Client/_Lust/Borgs/BorgSystem.StandingVisuals.csContent.Shared/_Lust/Borgs/Components/BorgRestActionComponent.csContent.Shared/_Lust/Borgs/SharedBorgRestActionSystem.cs
пытаюсь научить боргов сидеть опять



🆑 Fooksy2304
Summary by CodeRabbit