Skip to content

Фиксы и дырочка в моем очке#277

Open
MirageExe wants to merge 3 commits into
ss14-art:masterfrom
MirageExe:BUGS
Open

Фиксы и дырочка в моем очке#277
MirageExe wants to merge 3 commits into
ss14-art:masterfrom
MirageExe:BUGS

Conversation

@MirageExe

@MirageExe MirageExe commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Пофикшен баг с балансом и пересадкой мозга. Добавлена система пулевых отверстий в хранилищах топлива и тд

Summary by CodeRabbit

  • Новые возможности

    • Добавлена система постепенной утечки баков: поврежденные резервуары теперь медленно протекают вместо взрывчатой реакции.
  • Изменения

    • Переносимые генераторы, резервуары для хранения, бочки и настенные диспенсеры переведены на новую систему утечки.
    • Баланс банка теперь синхронизируется с профилем персонажа при входе в игру.
  • Документация

    • Добавлены локализованные сообщения для предупреждений об утечке баков.

Пофикшен баг с балансом и пересадкой мозга. Добавлена система пулевых отверстий в хранилищах топлива и тд
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@MirageExe, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 57 minutes and 46 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

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 credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

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, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2bd306a1-43e6-4b2b-9982-794cd61f51c2

📥 Commits

Reviewing files that changed from the base of the PR and between 9590e3a and 0b2947b.

📒 Files selected for processing (2)
  • Resources/Locale/en-US/chemistry/components/tank-leak-component.ftl
  • Resources/Locale/ru-RU/chemistry/components/tank-leak-component.ftl
📝 Walkthrough

Walkthrough

Добавлены TankLeakComponent, TankLeakSystem и TankLeakBehavior, реализующие постепенную утечку жидкости из резервуаров при повреждении вместо мгновенного разрушения. Все связанные прототипы переведены на новое поведение. Независимо: BankSystem синхронизирует баланс персонажа при добавлении майнда.

Changes

Tank Leak System

Layer / File(s) Summary
TankLeakComponent — контракт данных
Content.Shared/Chemistry/Components/TankLeakComponent.cs
Объявлен сетевой компонент с полями LeakCount (автосетевое), LeakRatePerHole, MaxLeaks, LeakAccumulator, Solution.
TankLeakSystem — ядро системы
Content.Server/Chemistry/EntitySystems/TankLeakSystem.cs
Система инициализирует аккумулятор, обрабатывает AddLeak (popup + разлив при MaxLeaks, QueueDel) и периодически вытекает в Update через SplitSolution + PuddleSystem.TrySpillAt.
TankLeakBehavior — пороговый бихевиор
Content.Server/Destructible/Thresholds/Behaviors/TankLeakBehavior.cs
Реализует IThresholdBehavior: обеспечивает наличие компонента, устанавливает Solution и вызывает AddLeak LeaksToAdd раз.
Локализация
Resources/Locale/en-US/chemistry/components/tank-leak-component.ftl, Resources/Locale/ru-RU/chemistry/components/tank-leak-component.ftl
Добавлены строки tank-leak-popup и tank-leak-destroy-popup на EN и RU.
Обновление прототипов
Resources/Prototypes/Entities/Structures/Storage/Tanks/base_structuretanks.yml, Resources/Prototypes/Entities/Structures/Storage/tanks.yml, Resources/Prototypes/Entities/Structures/Storage/barrels.yml, Resources/Prototypes/Entities/Structures/Wallmounts/walldispenser.yml, Resources/Prototypes/Entities/Structures/Power/Generation/portable_generator.yml, Resources/Prototypes/_Crescent/Power/boriaticgenerators.yml
SolutionExplosionBehavior, SpillBehavior и DoActsBehavior(Destruction) заменены на TankLeakBehavior с leaksToAdd: 1; ряд порогов damage увеличен с 50 до 100.

Bank Balance Sync

Layer / File(s) Summary
Синхронизация баланса при MindAddedMessage
Content.Server/_NF/Shuttles/Bank/BankSystem.cs
Подписка на MindAddedMessage; обработчик сравнивает BankAccountComponent.Balance с profile.BankBalance и при расхождении сбрасывает баланс к значению из профиля с вызовом Dirty и логом.

Sequence Diagram(s)

sequenceDiagram
  participant DestructibleSystem
  participant TankLeakBehavior
  participant TankLeakSystem
  participant SharedSolutionContainerSystem
  participant PuddleSystem

  DestructibleSystem->>TankLeakBehavior: Execute(owner, system)
  TankLeakBehavior->>TankLeakSystem: EnsureComp TankLeakComponent
  loop LeaksToAdd раз
    TankLeakBehavior->>TankLeakSystem: AddLeak(owner, comp)
    TankLeakSystem->>TankLeakSystem: LeakCount++, Dirty
    alt LeakCount >= MaxLeaks
      TankLeakSystem->>SharedSolutionContainerSystem: TryGetSolution(uid, comp.Solution)
      TankLeakSystem->>PuddleSystem: TrySpillAt(uid, solution)
      TankLeakSystem->>TankLeakSystem: QueueDel(uid)
    end
  end
  loop каждые LeakInterval секунд (Update)
    TankLeakSystem->>SharedSolutionContainerSystem: SplitSolution(LeakRatePerHole * LeakCount)
    TankLeakSystem->>PuddleSystem: TrySpillAt(coords, split, sound=false)
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested labels

Changes: YML, Changes: C#, Changes: Localization

Suggested reviewers

  • Odleer
  • NEirotoXiN00

Poem

🐰 Капает, течёт, журчит —
Резервуар дырявый кричит!
Не взрыв, а тихая беда:
Из бака льётся вся вода.
Зайчик код поправил ловко —
Теперь утечка — не уловка! 💧

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Название PR частично относится к изменениям: упоминает новую функцию 'дырочка' (утечка из контейнеров с жидкостью), но не полностью отражает все аспекты изменений, включая исправления ошибок с балансом и трансплантацией мозга.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 and usage tips.

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

🤖 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/Chemistry/EntitySystems/TankLeakSystem.cs`:
- Around line 67-74: The leak interval processing in TankLeakSystem.cs currently
only handles one leak tick per frame update, causing the actual leak rate to be
lower than expected when frameTime is large. Replace the single if check for
comp.LeakAccumulator < LeakInterval with a while loop that continues to process
and subtract LeakInterval from comp.LeakAccumulator for each accumulated
interval, ensuring that all accumulated leak intervals within a single frame are
properly accounted for in the leakAmount calculation.

In `@Resources/Locale/en-US/chemistry/components/tank-leak-component.ftl`:
- Around line 1-2: The tank-leak-popup and tank-leak-destroy-popup strings in
the Fluent template are using CAPITALIZE() function without passing any
argument, which means the entity name is not being included in the popup
messages. Modify both strings to pass the $entity parameter to the CAPITALIZE()
function so that the entity name is properly displayed in the messages when
TankLeakSystem triggers these popups.

In `@Resources/Locale/ru-RU/chemistry/components/tank-leak-component.ftl`:
- Around line 1-2: The Russian localization strings tank-leak-popup and
tank-leak-destroy-popup have incomplete or missing entity parameter
placeholders. In tank-leak-popup, replace the empty placeholder expression with
a proper reference to the entity parameter. In tank-leak-destroy-popup, add the
entity parameter as an argument to the CAPITALIZE() function so it receives the
entity name to display. These strings receive an entity parameter from
TankLeakSystem.cs (at lines 36 and 43), so ensure both localization entries use
the correct placeholder syntax to display the entity name to players.
🪄 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: CHILL

Plan: Pro

Run ID: fd252d64-5a03-4b7b-a67e-8a742711a9c0

📥 Commits

Reviewing files that changed from the base of the PR and between bb6a6b3 and 9590e3a.

📒 Files selected for processing (12)
  • Content.Server/Chemistry/EntitySystems/TankLeakSystem.cs
  • Content.Server/Destructible/Thresholds/Behaviors/TankLeakBehavior.cs
  • Content.Server/_NF/Shuttles/Bank/BankSystem.cs
  • Content.Shared/Chemistry/Components/TankLeakComponent.cs
  • Resources/Locale/en-US/chemistry/components/tank-leak-component.ftl
  • Resources/Locale/ru-RU/chemistry/components/tank-leak-component.ftl
  • Resources/Prototypes/Entities/Structures/Power/Generation/portable_generator.yml
  • Resources/Prototypes/Entities/Structures/Storage/Tanks/base_structuretanks.yml
  • Resources/Prototypes/Entities/Structures/Storage/barrels.yml
  • Resources/Prototypes/Entities/Structures/Storage/tanks.yml
  • Resources/Prototypes/Entities/Structures/Wallmounts/walldispenser.yml
  • Resources/Prototypes/_Crescent/Power/boriaticgenerators.yml

Comment on lines +67 to +74
comp.LeakAccumulator += frameTime;
if (comp.LeakAccumulator < LeakInterval)
continue;

comp.LeakAccumulator -= LeakInterval;

var leakAmount = comp.LeakRatePerHole * comp.LeakCount;

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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Пропускаются интервалы утечки при просадке frameTime.

Сейчас за апдейт обрабатывается только один тик утечки, поэтому при frameTime > 1f фактическая скорость течи становится ниже ожидаемой. Нужно учитывать все накопленные интервалы за кадр.

💡 Предлагаемое исправление
-            comp.LeakAccumulator += frameTime;
-            if (comp.LeakAccumulator < LeakInterval)
-                continue;
-
-            comp.LeakAccumulator -= LeakInterval;
-
-            var leakAmount = comp.LeakRatePerHole * comp.LeakCount;
+            comp.LeakAccumulator += frameTime;
+            var intervals = (int)(comp.LeakAccumulator / LeakInterval);
+            if (intervals <= 0)
+                continue;
+
+            comp.LeakAccumulator -= intervals * LeakInterval;
+
+            var leakAmount = comp.LeakRatePerHole * comp.LeakCount * intervals;
🤖 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/Chemistry/EntitySystems/TankLeakSystem.cs` around lines 67 -
74, The leak interval processing in TankLeakSystem.cs currently only handles one
leak tick per frame update, causing the actual leak rate to be lower than
expected when frameTime is large. Replace the single if check for
comp.LeakAccumulator < LeakInterval with a while loop that continues to process
and subtract LeakInterval from comp.LeakAccumulator for each accumulated
interval, ensuring that all accumulated leak intervals within a single frame are
properly accounted for in the leakAmount calculation.

Comment thread Resources/Locale/en-US/chemistry/components/tank-leak-component.ftl Outdated
Comment thread Resources/Locale/ru-RU/chemistry/components/tank-leak-component.ftl Outdated
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.

1 participant