Project Helios Chapter 1#1486
Conversation
|
RSI Diff Bot; head commit 2aa9b13 merging into 53b82ee Resources/Textures/Backmen/Objects/Devices/tablets.rsi
Resources/Textures/Backmen/Supermatter/computers.rsi
|
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughДобавлены направленный отражатель суперматтера, ECS-механика перенаправления снарядов, прототипы каркаса и устройства, граф строительства, материалы разрушения, локализация, текстурные метаданные и интеграционные тесты. ChangesНаправленный отражатель
Estimated code review effort: 3 (Moderate) | ~30 minutes Sequence Diagram(s)sequenceDiagram
participant ProjectileReflectAttemptEvent
participant DirectionalReflectSystem
participant Reflector
participant ProjectileComponent
ProjectileReflectAttemptEvent->>DirectionalReflectSystem: попытка отражения
DirectionalReflectSystem->>Reflector: проверить Reflects и FrontAbsorbAngle
Reflector-->>DirectionalReflectSystem: поглотить или разрешить отражение
DirectionalReflectSystem->>ProjectileComponent: изменить скорость, ориентацию, Shooter и Weapon
DirectionalReflectSystem-->>ProjectileReflectAttemptEvent: отмена, звук, popup и admin-лог
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 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: 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.Shared/Backmen/Supermatter/DirectionalReflectSystem.cs`:
- Around line 77-78: В обработке отражения снаряда замените вызов
SetLocalRotation на SetWorldRotation для outputAngle, сохранив существующее
обновление скорости через _physics.SetLinearVelocity. Это обеспечит применение
мирового угла независимо от вращения грида.
In `@Resources/Locale/ru-RU/backmen/supermatter/supermatter.ftl`:
- Around line 22-26: Remove the duplicate localization entries ent-Reflector and
ent-ReflectorFrame from supermatter.ftl, keeping their existing definitions only
in the specialized reflector.ftl file.
In `@Resources/Prototypes/_Backmen/Entities/Supermatter/reflector.yml`:
- Around line 9-11: The ReflectorFrame and completed Reflector currently share
the same reflector texture state. Update the ReflectorFrame sprite definition to
use a distinct frame state, such as reflector_frame, and add or reference the
corresponding RSI state so unfinished frames are visually distinguishable while
keeping Reflector on the existing reflector state.
🪄 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: cc1d64ca-cf4c-45fa-99ff-377be5ed6f10
⛔ Files ignored due to path filters (1)
Resources/Textures/Backmen/Supermatter/reflector.rsi/reflector.pngis excluded by!**/*.png
📒 Files selected for processing (9)
Content.Shared/Backmen/Supermatter/Components/DirectionalReflectComponent.csContent.Shared/Backmen/Supermatter/DirectionalReflectSystem.csResources/Locale/en-US/backmen/supermatter/supermatter.ftlResources/Locale/en-US/ss14-ru/prototypes/_backmen/entities/supermatter/reflector.ftlResources/Locale/ru-RU/backmen/supermatter/supermatter.ftlResources/Locale/ru-RU/ss14-ru/prototypes/_backmen/entities/supermatter/reflector.ftlResources/Prototypes/_Backmen/Entities/Supermatter/reflector.ymlResources/Prototypes/_Backmen/Recipes/Construction/reflector.ymlResources/Textures/Backmen/Supermatter/reflector.rsi/meta.json
| - type: Sprite | ||
| sprite: Backmen/Supermatter/reflector.rsi | ||
| state: reflector |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Каркас и готовый отражатель используют одинаковую текстуру.
ReflectorFrame (строки 9-11) и Reflector (строки 43-45) используют один и тот же спрайт state: reflector из одного RSI. В meta.json определён только один state. Игроки не смогут визуально отличить каркас от готового отражателя, что может привести к путанице — например, попытке использовать каркас как отражатель (он не содержит DirectionalReflect и не будет отражать снаряды).
Рассмотрите возможность добавления отдельного state для каркаса (например, reflector_frame) или использования визуального индикатора незавершённости.
Also applies to: 43-45
🤖 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/_Backmen/Entities/Supermatter/reflector.yml` around
lines 9 - 11, The ReflectorFrame and completed Reflector currently share the
same reflector texture state. Update the ReflectorFrame sprite definition to use
a distinct frame state, such as reflector_frame, and add or reference the
corresponding RSI state so unfinished frames are visually distinguishable while
keeping Reflector on the existing reflector state.
Добавление текстуры каркасу, небольшое изменение текстуры отражателя
There was a problem hiding this comment.
🧹 Nitpick comments (1)
Resources/Textures/Backmen/Supermatter/reflectorframe.rsi/meta.json (1)
1-1: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUTF-8 BOM в начале файла может вызвать проблемы парсинга.
Строка 1 начинается с символа UTF-8 BOM (
). Хотя многие JSON-парсеры обрабатывают BOM корректно, стандарт JSON (RFC 8259) не рекомендует его использование, и строгие парсеры могут выдать ошибку. Рекомендуется удалить BOM.♻️ Предлагаемое исправление
-{ +{ "version": 1,🤖 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/Textures/Backmen/Supermatter/reflectorframe.rsi/meta.json` at line 1, Remove the UTF-8 BOM character at the beginning of meta.json so the file starts directly with the opening JSON brace. Preserve the existing JSON content and formatting otherwise.
🤖 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.
Nitpick comments:
In `@Resources/Textures/Backmen/Supermatter/reflectorframe.rsi/meta.json`:
- Line 1: Remove the UTF-8 BOM character at the beginning of meta.json so the
file starts directly with the opening JSON brace. Preserve the existing JSON
content and formatting otherwise.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 0c49d61e-f9bf-425d-8e05-1c311170a0c4
⛔ Files ignored due to path filters (2)
Resources/Textures/Backmen/Supermatter/reflector.rsi/reflector.pngis excluded by!**/*.pngResources/Textures/Backmen/Supermatter/reflectorframe.rsi/reflector.pngis excluded by!**/*.png
📒 Files selected for processing (2)
Resources/Prototypes/_Backmen/Entities/Supermatter/reflector.ymlResources/Textures/Backmen/Supermatter/reflectorframe.rsi/meta.json
🚧 Files skipped from review as they are similar to previous changes (1)
- Resources/Prototypes/_Backmen/Entities/Supermatter/reflector.yml
There was a problem hiding this comment.
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.IntegrationTests/Tests/Backmen/Supermatter/ReflectorTest.cs`:
- Around line 83-111: Update SideHit_IsRedirectedAlongOutputFace to capture the
bolt’s original speed and assign a distinct shooter entity before raising
ProjectileReflectAttemptEvent, then assert redirected.Length() preserves that
speed and projectile.Shooter is reassigned as
BackHit_IsRedirectedAlongOutputFace does. Keep the existing cancellation and
output-direction assertions.
🪄 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: 46166d38-bc8a-40f2-b177-44961954d591
📒 Files selected for processing (2)
Content.IntegrationTests/Tests/Backmen/Supermatter/ReflectorTest.csContent.Shared/Backmen/Supermatter/DirectionalReflectSystem.cs
🚧 Files skipped from review as they are similar to previous changes (1)
- Content.Shared/Backmen/Supermatter/DirectionalReflectSystem.cs
| [Test] | ||
| public async Task SideHit_IsRedirectedAlongOutputFace() | ||
| { | ||
| var map = await Pair.CreateTestMap(); | ||
|
|
||
| await Server.WaitAssertion(() => | ||
| { | ||
| var entMan = Server.EntMan; | ||
| var physics = entMan.System<SharedPhysicsSystem>(); | ||
| var xformSys = entMan.System<SharedTransformSystem>(); | ||
|
|
||
| var reflector = entMan.SpawnEntity(Reflector, map.MapCoords); | ||
| xformSys.SetWorldRotation(reflector, Angle.Zero); | ||
|
|
||
| var bolt = entMan.SpawnEntity(EmitterBolt, map.MapCoords); | ||
| var boltPhysics = entMan.GetComponent<PhysicsComponent>(bolt); | ||
| physics.SetLinearVelocity(bolt, new Vector2(10f, 0f), body: boltPhysics); | ||
|
|
||
| var projectile = entMan.GetComponent<ProjectileComponent>(bolt); | ||
| var attempt = new ProjectileReflectAttemptEvent(bolt, projectile, false); | ||
| entMan.EventBus.RaiseLocalEvent(reflector, ref attempt); | ||
|
|
||
| Assert.That(attempt.Cancelled, Is.True, "Side hits should be redirected."); | ||
|
|
||
| var redirected = physics.GetMapLinearVelocity(bolt, component: boltPhysics); | ||
| var outputDir = Angle.Zero.ToWorldVec(); | ||
| Assert.That(Vector2.Dot(Vector2.Normalize(redirected), outputDir), Is.GreaterThan(0.99f)); | ||
| }); | ||
| } |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Добавьте проверки скорости и Shooter в SideHit-тест для консистентности с BackHit.
Тест BackHit_IsRedirectedAlongOutputFace проверяет сохранение скорости (redirected.Length()) и переназначение projectile.Shooter, но SideHit_IsRedirectedAlongOutputFace опускает обе проверки. Система DirectionalReflectSystem.TryReflectProjectile одинаково изменяет скорость и Shooter для всех перенаправленных снарядов, поэтому SideHit-тест должен покрывать те же инварианты.
🛡️ Предлагаемое исправление
Assert.That(attempt.Cancelled, Is.True, "Side hits should be redirected.");
var redirected = physics.GetMapLinearVelocity(bolt, component: boltPhysics);
var outputDir = Angle.Zero.ToWorldVec();
Assert.That(Vector2.Dot(Vector2.Normalize(redirected), outputDir), Is.GreaterThan(0.99f));
+ Assert.That(redirected.Length(), Is.EqualTo(10f).Within(0.01f));
+ Assert.That(projectile.Shooter, Is.EqualTo(reflector));
});📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| [Test] | |
| public async Task SideHit_IsRedirectedAlongOutputFace() | |
| { | |
| var map = await Pair.CreateTestMap(); | |
| await Server.WaitAssertion(() => | |
| { | |
| var entMan = Server.EntMan; | |
| var physics = entMan.System<SharedPhysicsSystem>(); | |
| var xformSys = entMan.System<SharedTransformSystem>(); | |
| var reflector = entMan.SpawnEntity(Reflector, map.MapCoords); | |
| xformSys.SetWorldRotation(reflector, Angle.Zero); | |
| var bolt = entMan.SpawnEntity(EmitterBolt, map.MapCoords); | |
| var boltPhysics = entMan.GetComponent<PhysicsComponent>(bolt); | |
| physics.SetLinearVelocity(bolt, new Vector2(10f, 0f), body: boltPhysics); | |
| var projectile = entMan.GetComponent<ProjectileComponent>(bolt); | |
| var attempt = new ProjectileReflectAttemptEvent(bolt, projectile, false); | |
| entMan.EventBus.RaiseLocalEvent(reflector, ref attempt); | |
| Assert.That(attempt.Cancelled, Is.True, "Side hits should be redirected."); | |
| var redirected = physics.GetMapLinearVelocity(bolt, component: boltPhysics); | |
| var outputDir = Angle.Zero.ToWorldVec(); | |
| Assert.That(Vector2.Dot(Vector2.Normalize(redirected), outputDir), Is.GreaterThan(0.99f)); | |
| }); | |
| } | |
| [Test] | |
| public async Task SideHit_IsRedirectedAlongOutputFace() | |
| { | |
| var map = await Pair.CreateTestMap(); | |
| await Server.WaitAssertion(() => | |
| { | |
| var entMan = Server.EntMan; | |
| var physics = entMan.System<SharedPhysicsSystem>(); | |
| var xformSys = entMan.System<SharedTransformSystem>(); | |
| var reflector = entMan.SpawnEntity(Reflector, map.MapCoords); | |
| xformSys.SetWorldRotation(reflector, Angle.Zero); | |
| var bolt = entMan.SpawnEntity(EmitterBolt, map.MapCoords); | |
| var boltPhysics = entMan.GetComponent<PhysicsComponent>(bolt); | |
| physics.SetLinearVelocity(bolt, new Vector2(10f, 0f), body: boltPhysics); | |
| var projectile = entMan.GetComponent<ProjectileComponent>(bolt); | |
| var attempt = new ProjectileReflectAttemptEvent(bolt, projectile, false); | |
| entMan.EventBus.RaiseLocalEvent(reflector, ref attempt); | |
| Assert.That(attempt.Cancelled, Is.True, "Side hits should be redirected."); | |
| var redirected = physics.GetMapLinearVelocity(bolt, component: boltPhysics); | |
| var outputDir = Angle.Zero.ToWorldVec(); | |
| Assert.That(Vector2.Dot(Vector2.Normalize(redirected), outputDir), Is.GreaterThan(0.99f)); | |
| Assert.That(redirected.Length(), Is.EqualTo(10f).Within(0.01f)); | |
| Assert.That(projectile.Shooter, Is.EqualTo(reflector)); | |
| }); | |
| } |
🤖 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.IntegrationTests/Tests/Backmen/Supermatter/ReflectorTest.cs` around
lines 83 - 111, Update SideHit_IsRedirectedAlongOutputFace to capture the bolt’s
original speed and assign a distinct shooter entity before raising
ProjectileReflectAttemptEvent, then assert redirected.Length() preserves that
speed and projectile.Shooter is reassigned as
BackHit_IsRedirectedAlongOutputFace does. Keep the existing cancellation and
output-direction assertions.
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Добавлена консоль мониторинга суперматреии. Оригинальный пр (Goob-Station/Goob-Station#5788 Goob-Station/Goob-Station#6808). Так же была работа по адаптированию к нашему билду с улучшением определённых частей кода.















Улучшение работы с суперматерией, добавление отражателей и консоль мониторинга состояния.
Summary by CodeRabbit