Skip to content

boobs trap - #1145

Closed
kekoven1 wants to merge 8 commits into
WWhiteDreamProject:masterfrom
kekoven1:rastyazka
Closed

boobs trap#1145
kekoven1 wants to merge 8 commits into
WWhiteDreamProject:masterfrom
kekoven1:rastyazka

Conversation

@kekoven1

@kekoven1 kekoven1 commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Описание PR

растяжка с гранатой принимает любые штуки которые можно активировать, ну тоесть все гранаты


Медиа

Список

Example Media Embed


Изменения

🆑

  • tweak: добавлена возможность вешать любую гранату на растяжку

@coderabbitai

coderabbitai Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: bbeb700b-d865-4ad9-a698-020354128c71

📥 Commits

Reviewing files that changed from the base of the PR and between 20fe82a and ae00cad.

📒 Files selected for processing (2)
  • Content.Server/_White/Trigger/TriggerItemSlotSystem.cs
  • Resources/Prototypes/_White/Entities/Structures/Other/traps.yml

Walkthrough

Добавлены компонент и серверная система для триггера предметов из слотов, а также обновлены прототипы ловушки-гранаты и граф крафта под новый слот-ориентированный сценарий срабатывания.

Changes

Grenade trap trigger flow

Layer / File(s) Summary
Trigger item slot component and system
Content.Shared/_White/Trigger/TriggerItemSlotComponent.cs, Content.Server/_White/Trigger/TriggerItemSlotSystem.cs
TriggerItemSlotComponent задаёт обязательный список слотов, а TriggerItemSlotSystem обрабатывает TriggerEvent, находит предметы в указанных слотах, прикрепляет их к карте или сетке и передаёт им trigger-событие.
Trap entity prototype updates
Resources/Prototypes/_White/Entities/Structures/Other/traps.yml
GrenadeTrap получает ItemSlots, TriggerItemSlot и ContainerContainer; у GrenadeTrapGrenade блок с сущностью закомментирован; у GrenadeTrapPoles удалён ExplodeBehavior.
Grenade trap crafting recipe
Resources/Prototypes/_White/Recipes/Crafting/traps.yml
GrenadeTrapGraph упрощён: удалён trap_grenade, добавлен прямой путь trap_polestrap_full с Cloth и Cutting, а trap_full создаёт GrenadeTrap.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: Remuchi, Spatison

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning Заголовок не описывает изменения и не отражает ловушку для гранат; он нерелевантен содержимому PR. Переименуйте PR в краткий и конкретный заголовок, например: «Разрешить ловушке принимать любые гранаты».
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 (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
🧪 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: 1

Caution

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

⚠️ Outside diff range comments (1)
Resources/Prototypes/_White/Recipes/Crafting/traps.yml (1)

19-55: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

После удаления trap_grenade осталась ссылка на несуществующий node.

В этом графе больше нет узла trap_grenade, но в Resources/Prototypes/_White/Entities/Structures/Other/traps.yml у GrenadeTrapGrenade на Line [47] всё ещё node: trap_grenade. Это кросс-файловой контрактный разрыв: прототип может сломаться при спавне/инициализации.

Нужно либо удалить/перепривязать GrenadeTrapGrenade, либо вернуть совместимый узел в граф.

🤖 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 `@Resources/Prototypes/_White/Recipes/Crafting/traps.yml` around lines 19 - 55,
The construction graph GrenadeTrapGraph still references nodes trap_poles and
trap_full but the external prototype GrenadeTrapGrenade still targets a removed
node named trap_grenade; fix by either restoring a compatible node named
trap_grenade inside GrenadeTrapGraph (e.g., add a node with node: trap_grenade
that routes correctly to trap_poles/trap_full and sets any required entity), or
update the GrenadeTrapGrenade prototype to point to an existing node (trap_poles
or trap_full) or remove its node entry entirely so there is no reference to
trap_grenade; ensure the change maintains spawn/initialization semantics for
GrenadeTrapGrenade and keep references to GrenadeTrapGraph and
GrenadeTrapGrenade consistent.
🧹 Nitpick comments (1)
Resources/Prototypes/_White/Entities/Structures/Other/traps.yml (1)

26-32: ⚡ Quick win

Добавьте ограничение вставки для grenade_slot.

На Line [26]-[32] слот без фильтра, поэтому принимает любой предмет. Если цель изменений — “все гранаты/активируемые”, лучше ограничить вставку по общему тегу/компоненту, чтобы не получить универсальный storage с принудительным eject по шагу.

🤖 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 `@Resources/Prototypes/_White/Entities/Structures/Other/traps.yml` around lines
26 - 32, Слот grenade_slot в блоке ItemSlots не имеет фильтра вставки и потому
принимает любые предметы; добавьте ограничение вставки для grenade_slot (в
секции ItemSlots) чтобы пропускать только подходящие объекты — например по
общему тегу (tag: "grenade") или по наличии компонента/флага (например
"activatable"/"explosive"), сохранив привязку TriggerItemSlot к тому же имени
слота; обновите ключ фильтра (например
insert_filter/allowed_tags/required_components в вашей схеме) для функции
grenade_slot, чтобы не допустить универсального хранения с принудительным eject.
🤖 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/_White/Trigger/TriggerItemSlotSystem.cs`:
- Around line 37-43: The current flow bypasses ItemSlotsSystem when
_itemSlots.TryEjectToHands(uid, slot, null) returns false: do not call
_xform.AttachToGridOrMap(containedItem) or _trigger.Trigger(containedItem,
args.User) after a failed eject; instead return/abort so the slot system retains
control (or call the appropriate ItemSlotsSystem API for a world-eject if that’s
intended). Ensure the code checks the boolean result of TryEjectToHands and only
proceeds to AttachToGridOrMap and Trigger when eject succeeded, referencing
_itemSlots.TryEjectToHands, _xform.AttachToGridOrMap, _trigger.Trigger,
containedItem and args.User.

---

Outside diff comments:
In `@Resources/Prototypes/_White/Recipes/Crafting/traps.yml`:
- Around line 19-55: The construction graph GrenadeTrapGraph still references
nodes trap_poles and trap_full but the external prototype GrenadeTrapGrenade
still targets a removed node named trap_grenade; fix by either restoring a
compatible node named trap_grenade inside GrenadeTrapGraph (e.g., add a node
with node: trap_grenade that routes correctly to trap_poles/trap_full and sets
any required entity), or update the GrenadeTrapGrenade prototype to point to an
existing node (trap_poles or trap_full) or remove its node entry entirely so
there is no reference to trap_grenade; ensure the change maintains
spawn/initialization semantics for GrenadeTrapGrenade and keep references to
GrenadeTrapGraph and GrenadeTrapGrenade consistent.

---

Nitpick comments:
In `@Resources/Prototypes/_White/Entities/Structures/Other/traps.yml`:
- Around line 26-32: Слот grenade_slot в блоке ItemSlots не имеет фильтра
вставки и потому принимает любые предметы; добавьте ограничение вставки для
grenade_slot (в секции ItemSlots) чтобы пропускать только подходящие объекты —
например по общему тегу (tag: "grenade") или по наличии компонента/флага
(например "activatable"/"explosive"), сохранив привязку TriggerItemSlot к тому
же имени слота; обновите ключ фильтра (например
insert_filter/allowed_tags/required_components в вашей схеме) для функции
grenade_slot, чтобы не допустить универсального хранения с принудительным eject.
🪄 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: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 03d4c93a-044a-40f5-8f93-5fc2f6939dab

📥 Commits

Reviewing files that changed from the base of the PR and between f74be61 and bd4e470.

📒 Files selected for processing (4)
  • Content.Server/_White/Trigger/TriggerItemSlotSystem.cs
  • Content.Shared/_White/Trigger/TriggerItemSlotComponent.cs
  • Resources/Prototypes/_White/Entities/Structures/Other/traps.yml
  • Resources/Prototypes/_White/Recipes/Crafting/traps.yml

Comment on lines +37 to +43
if (!_itemSlots.TryEjectToHands(uid, slot, null))
{
_xform.AttachToGridOrMap(containedItem);
}

_trigger.Trigger(containedItem, args.User);
}

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

Не обходите ItemSlotsSystem при неудачном eject.

На Line [37] TryEjectToHands может вернуть false (например, locked slot), но на Line [39] выполняется прямой AttachToGridOrMap, а на Line [42] предмет всё равно триггерится. Это ломает контракт slot API и может оставить контейнер/слот в неконсистентном состоянии.

💡 Предлагаемое исправление
-            if (slot.Item is EntityUid containedItem)
-            {
-                if (!_itemSlots.TryEjectToHands(uid, slot, null))
-                {
-                    _xform.AttachToGridOrMap(containedItem);
-                }
-
-                _trigger.Trigger(containedItem, args.User);
-            }
+            if (slot.Item is not EntityUid containedItem)
+                continue;
+
+            if (!_itemSlots.TryEject(uid, slot, null, out var ejected))
+                continue;
+
+            _trigger.Trigger(ejected.Value, args.User);
🤖 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/_White/Trigger/TriggerItemSlotSystem.cs` around lines 37 - 43,
The current flow bypasses ItemSlotsSystem when _itemSlots.TryEjectToHands(uid,
slot, null) returns false: do not call _xform.AttachToGridOrMap(containedItem)
or _trigger.Trigger(containedItem, args.User) after a failed eject; instead
return/abort so the slot system retains control (or call the appropriate
ItemSlotsSystem API for a world-eject if that’s intended). Ensure the code
checks the boolean result of TryEjectToHands and only proceeds to
AttachToGridOrMap and Trigger when eject succeeded, referencing
_itemSlots.TryEjectToHands, _xform.AttachToGridOrMap, _trigger.Trigger,
containedItem and args.User.

kekoven1 added 2 commits June 7, 2026 19:45
This reverts commit 1674f9d.
Comment on lines +37 to +40
if (!_itemSlots.TryEjectToHands(uid, slot, null))
{
_xform.AttachToGridOrMap(containedItem);
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

почему предмет сначала выбрасывается перед активацией?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

гранаты типа сингулярности ломаются когда не выбрасываются

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

как будто отличный повод починить эти самые гранаты

@RedFoxIV

RedFoxIV commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

тест проёбан

  Failed UninitializedSaveTest [11 s]
  Error Message:
   Prototype GrenadeTrap gains a component on spawn: ContainerContainer

навесь недостающий компонент на контейнер и убедись, что нужные контейнеры в нём заранее указаны

@kekoven1 kekoven1 closed this Aug 5, 2026
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