Skip to content

Asphyxiation#669

Open
JrInventor05 wants to merge 1 commit into
corvax-team:offbrand-devfrom
JrInventor05:oxigination
Open

Asphyxiation#669
JrInventor05 wants to merge 1 commit into
corvax-team:offbrand-devfrom
JrInventor05:oxigination

Conversation

@JrInventor05

@JrInventor05 JrInventor05 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Описание PR

Ограничен максимальный урон тушек согласно полям из maximumDamage компонента Woundable прототипа BaseMobWoundable

Для ИМов:
создавая гуманоидов, вы можете вполне им менять паренты, ну и создаёте свой аналог BaseMobWoundable, но с другими параметрами и используете как и где угодно.

Почему / Баланс

сказали - сделал

Технические детали

добавил if, если урон больше - заменяем макс числом

Медиа

Требования

Согласие с условиями

  • Я согласен с условиями LICENSE и CLA.

Критические изменения

Список изменений

  • wl-add: Добавлено ограничение по макс урону согласно базовому прототипу(данные числа могут изменять ИМы, конкретика в ПРе)!

Summary by CodeRabbit

  • Bug Fixes
    • Fixed damage calculation logic to properly cap damage values and accurately report the amount of damage applied, improving consistency in wound tracking and damage reporting.

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

In WoundableSystem.RefreshWounds, a curDamage variable is introduced that clamps newValue to MaximumDamage.Base when that cap is set. The damageDone delta is then computed as curDamage - oldValue instead of using the raw newValue, while the existing unwoundable-damage override that forces damageFinal back to oldValue remains unchanged.

Changes

Damage Clamping in RefreshWounds

Layer / File(s) Summary
Clamp per-type damage to MaximumDamage.Base
Content.Shared/_Offbrand/Wounds/WoundableSystem.cs
Adds curDamage clamped to MaximumDamage.Base and computes damageDone as curDamage - oldValue instead of the raw newValue, while the unwoundable-damage damageFinal override stays in place.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Poem

A bunny hops in, checks the cap,
"Too much damage? Close the gap!"
curDamage now knows its max,
No overflow slips through the cracks.
The wounds stay honest — and that's that! 🐇

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'Asphyxiation' is unrelated to the changeset, which implements damage capping for corpses based on maximumDamage configuration, not asphyxiation mechanics. Replace the title with a descriptive summary of the actual change, such as 'Cap corpse damage to maximumDamage limit' or 'Implement damage capping system for WoundableSystem'.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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.

✏️ 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.

@JrInventor05

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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

🤖 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/_Offbrand/Wounds/WoundableSystem.cs`:
- Around line 298-300: When clamping unwoundable damage in the WoundableSystem
at the location where oldValue is compared against MaximumDamage.Base, the code
reduces oldValue before storing it in damageFinal.DamageDict but fails to report
the corresponding negative delta. After the line that clamps oldValue to
data.Base within the TryGetValue condition, calculate the difference between the
original and clamped values, then update the damageDone dictionary for that
damage type to include this delta so that OnEntityDamageChanged receives an
accurate report of all damage changes applied.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 787ab663-485a-4e23-a5ec-fbf435dbdb8d

📥 Commits

Reviewing files that changed from the base of the PR and between 98aad6a and eac13fb.

📒 Files selected for processing (1)
  • Content.Shared/_Offbrand/Wounds/WoundableSystem.cs

Comment thread Content.Shared/_Offbrand/Wounds/WoundableSystem.cs
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