Port starlight naval warfare#4051
Conversation
|
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ОбзорДанный PR вводит систему управления артиллерией для управления орудиями челнока с визуализацией радара. Добавляются компоненты пользовательского интерфейса на клиенте, серверные системы наведения управляемых снарядов, рендеринг радарных отметок с вариантами форм, визуализация лазерных следов и комплексные определения прототипов для новых орудий челнока, включая пушки 120 мм, ракеты 60 мм и рельсотрон 280 мм. Изменения
Диаграмма последовательностиsequenceDiagram
participant Player as Игрок
participant UI as Консоль артиллерии (Клиент)
participant Network as Сеть
participant Server as GunneryConsoleSystem
participant Physics as GuidedProjectileSystem
participant Radar as RadarConsoleSystem
Player->>UI: Клик по орудию на радаре
UI->>UI: UpdateState (обновить список орудий)
Player->>UI: ЛКМ - стрельба из орудия
UI->>Network: GunneryConsoleFireStartMessage
Network->>Server: Получить сообщение о начале огня
Server->>Server: Валидировать орудие и цель
Server->>Network: Спавнить управляемый снаряд
Network->>Physics: Создать GuidedProjectileComponent
Physics->>Physics: Установить Controller и SteeringTarget
Player->>UI: ПКМ удержать (наведение)
UI->>Network: GunneryConsoleGuidanceMessage (непрерывно)
Network->>Server: Обновить SteeringTarget снаряда
Server->>Physics: Новая цель наведения
Physics->>Physics: Каждый кадр: рулевое управление к цели (с учётом TurnRate)
Note over Physics: Рулевое управление ограничено TurnRate<br/>Проектиль поворачивается к цели
Radar->>Radar: Периодически (0.25с): UpdateState()
Radar->>Radar: Собрать RadarBlipData (снаряды в полёте)
Radar->>Radar: Собрать RadarLaserData (следы лазеров)
Radar->>UI: Отправить обновлённое состояние
UI->>UI: Draw() - рендеринг блипов и лазерных следов
Оценка сложности рецензирования🎯 4 (Сложно) | ⏱️ ~75 минут Предложенные метки
Стихотворение
✨ Finishing Touches🧪 Generate unit tests (beta)
|
There was a problem hiding this comment.
Actionable comments posted: 13
🧹 Nitpick comments (3)
Content.Shared/_Starlight/Shuttles/Components/RadarBlipComponent.cs (1)
1-51: Несоответствие пути файла и пространства имён.Файл находится в
Content.Shared/_Starlight/Shuttles/Components/, но использует пространство имёнContent.Shared.Shuttles.Components. Это может вызвать путаницу и потенциальные конфликты с существующими компонентами в основной директории Shuttles.Рекомендуется использовать
Content.Shared._Starlight.Shuttles.Componentsдля согласованности с расположением файла.♻️ Предлагаемое исправление пространства имён
-namespace Content.Shared.Shuttles.Components; +namespace Content.Shared._Starlight.Shuttles.Components;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Shared/_Starlight/Shuttles/Components/RadarBlipComponent.cs` around lines 1 - 51, The file's namespace (Content.Shared.Shuttles.Components) does not match its directory (Content.Shared/_Starlight/Shuttles/Components); update the namespace declaration to Content.Shared._Starlight.Shuttles.Components so types like RadarBlipComponent, BlipShape and any other public types in this file are colocated with the folder structure and won't conflict with the main Shuttles namespace; ensure the [RegisterComponent, NetworkedComponent] RadarBlipComponent and the BlipShape enum remain unchanged except for the namespace line.Content.Server/_Starlight/Shuttles/Components/RadarLaserTrackerComponent.cs (1)
4-4: Несоответствие namespace и пути файла.Аналогично
RadarLaserSystem, файл находится вContent.Server/_Starlight/Shuttles/Components/, но namespace указан какContent.Server.Shuttles.Components.♻️ Предлагаемое исправление
-namespace Content.Server.Shuttles.Components; +namespace Content.Server._Starlight.Shuttles.Components;Если выбрано изменение namespace, необходимо также обновить using-директивы в зависимых файлах (RadarLaserSystem, RadarConsoleSystem, cannons.yml).
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Server/_Starlight/Shuttles/Components/RadarLaserTrackerComponent.cs` at line 4, Namespace in RadarLaserTrackerComponent.cs doesn't match its folder; change the namespace from Content.Server.Shuttles.Components to Content.Server._Starlight.Shuttles.Components (or move the file to match namespace), then update all dependent references/usings to the new namespace — notably in RadarLaserSystem, RadarConsoleSystem and the cannons.yml entries — so types resolve correctly.Content.Server/Shuttles/Systems/RadarConsoleSystem.cs (1)
34-50: Рекомендация: учёт переполнения таймера.При высоком
frameTime(например, при лаге) таймер просто сбрасывается в 0, теряя накопленное время сверх интервала. Для более точного периодического обновления можно вычитать интервал.♻️ Опциональное улучшение
_blipUpdateTimer += frameTime; if (_blipUpdateTimer < BlipUpdateInterval) return; - _blipUpdateTimer = 0f; + _blipUpdateTimer -= BlipUpdateInterval;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Server/Shuttles/Systems/RadarConsoleSystem.cs` around lines 34 - 50, The Update method resets _blipUpdateTimer to 0f when it exceeds BlipUpdateInterval, losing any excess time during large frameTime spikes; change the reset logic in Update (the block that currently sets _blipUpdateTimer = 0f) to subtract BlipUpdateInterval from _blipUpdateTimer (or loop subtract while _blipUpdateTimer >= BlipUpdateInterval) so excess time is preserved and multiple intervals can be accounted for when calling UpdateState for each RadarConsoleComponent; refer to Update, _blipUpdateTimer and BlipUpdateInterval to locate and modify the logic.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@Content.Client/_Starlight/Weapons/Gunnery/GunneryRadarControl.xaml.cs`:
- Around line 119-145: KeyBindUp currently treats LMB release the same whether
you were in guidance mode or not, so releasing after guidance still falls
through to firing; add a guidance-state check and early-return to avoid firing:
introduce or use a boolean like _isGuiding that is set when MouseMove triggers
OnGuidanceUpdate, and in KeyBindUp (method KeyBindUp) check if (_isGuiding) {
_isGuiding = false; /* end/cleanup guidance if needed */ return; } before the
SelectedCannons/OnFireRequested logic so TrySelectCannonAt, _lmbHeld handling
and SelectedCannons loop are skipped when ending guidance. Ensure the
MouseMove/OnGuidanceUpdate handler sets and any guidance cleanup clears the same
flag.
- Around line 102-107: Selected cannon selections persist after updating
_cannons causing KeyBindUp to fire OnFireRequested for removed guns; after
assigning _cannons = state.Cannons update SelectedCannons to only contain
IDs/instances that still exist in the new _cannons set (or clear it) and ensure
the KeyBindUp handler verifies each selected cannon exists in _cannons before
calling OnFireRequested (use cannon ID or reference equality against _cannons).
This will remove stale selections and prevent firing requests for guns no longer
present.
In `@Content.Server/_Starlight/Shuttles/Systems/RadarLaserSystem.cs`:
- Line 7: The namespace declared as Content.Server.Shuttles.Systems must be
updated to include the _Starlight prefix to match the folder structure; change
the namespace to Content.Server._Starlight.Shuttles.Systems (and update any
file-local references that expect the old namespace) so the class(es) in
RadarLaserSystem.cs are declared under
Content.Server._Starlight.Shuttles.Systems to align with project conventions.
In `@Content.Server/_Starlight/Weapons/Gunnery/GunneryConsoleSystem.cs`:
- Around line 77-93: The current OnGuidedProjectileStartup uses a 200ms timing
heuristic to assign any new GuidedProjectileComponent to the first
GunneryConsoleComponent whose LastFireTime is recent, causing race conditions
when multiple consoles fire; instead establish a deterministic link: have the
firing code set a unique identifier on the console (e.g. add a
LastFiredProjectileUid or raise a specific FireSpawnedProjectileEvent carrying
the projectile uid) when it spawns the projectile, then change
OnGuidedProjectileStartup to iterate GunneryConsoleComponent and claim only if
consoleComp.LastFiredProjectileUid == uid (or handle the
FireSpawnedProjectileEvent to assign guided.Controller immediately), and finally
clear the console’s LastFiredProjectileUid / consume the event after successful
claim; update references: OnGuidedProjectileStartup, GunneryConsoleComponent,
LastFireTime/LastFireTargetPos, TrackedGuidedProjectile, and
GuidedProjectileComponent accordingly.
In `@Content.Server/Shuttles/Systems/RadarConsoleSystem.cs`:
- Around line 110-120: The laser trace is being anchored to
laserXform.Coordinates instead of the stored trace origin, causing misrendering
if the gun moved; in the loop over tracker.Traces (foreach (var (origin, dir, _)
in tracker.Traces)) replace the use of laserXform.Coordinates with the saved
trace origin when constructing RadarLaserData (i.e., call GetNetCoordinates on
the trace's origin) while keeping dir, tracker.MaxRange, and tracker.LaserColor
unchanged and preserving the prior range check against consoleMapCoords and
maxRangeSq.
In
`@Resources/Prototypes/_Starlight/Entities/Objects/Weapons/Guns/Ammunition/120mm_explosives.yml`:
- Around line 79-90: The empty magazine inherits the ammo prototype from its
parent because you override BallisticAmmoProvider without clearing the field
that pre-fills the magazine; update Magazine120mmGrenadeBlastEmpty to explicitly
clear the prefill field on the BallisticAmmoProvider (e.g., set the ammo
prototype field used by Magazine120mmGrenadeBlast — look for keys like proto,
prototype, initialAmmo or defaultAmmo — to null/empty) so it does not inherit
Grenade120mmBlast from Magazine120mmGrenadeBlast and will spawn empty.
In
`@Resources/Prototypes/_Starlight/Entities/Objects/Weapons/Guns/Ammunition/60mm_rocket.yml`:
- Around line 79-90: The child prototype Magazine60mmRocketEmpty still inherits
proto: Cartridge60mmRocket from its parent Magazine60mmRocket so the "empty"
magazine will inadvertently contain ammo; modify the BallisticAmmoProvider in
Magazine60mmRocketEmpty to explicitly unset the inherited proto by adding proto:
null under the BallisticAmmoProvider component so the provider has no ammunition
prototype and the magazine is truly empty.
In
`@Resources/Prototypes/_Starlight/Entities/Objects/Weapons/Guns/Ammunition/Boxes/battery.yml`:
- Around line 29-30: The description in the battery.yml entry conflicts by
mentioning both "laser rounds" and "kinetic ammunition"; update the description
field to consistently match the item name "ammunition box (laser)" — e.g.,
change the description to something like "A cardboard box of laser rounds.
Intended to hold general-purpose energy/laser ammunition." Ensure you modify the
description property (and not the name) so all references to "kinetic" are
removed or replaced with the correct "laser"/"energy" terminology.
In
`@Resources/Prototypes/_Starlight/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/bolt_rifle.yml`:
- Line 6: В поле description строки "A heavy intermediate cartridge of uncertain
origin. Sits somewhere between a magnum round and an anti-materiel shell.
Proprietary � don't expect to find it on any shelf." замените повреждённый
символ � на правильный знак (в данном контексте — эм‑тире "—" между
"Proprietary" и "don't"), затем сохраните bolt_rifle.yml в кодировке UTF-8 (без
BOM) чтобы избежать повторной порчи символов.
In
`@Resources/Prototypes/_Starlight/Entities/Structures/Shuttles/shuttle_cannons.yml`:
- Around line 340-344: Whitelist в BallisticAmmoProvider для TARNYX сейчас
содержит общий тег "Grenade", что позволяет заряжать обычные взрывчатые гранаты;
замените этот общий тег на специализированный тег для EMP-совместимых снарядов
(например "EMP" или "EMP-Grenade") в разделе whitelist -> tags для записи type:
BallisticAmmoProvider в shuttle_cannons.yml, чтобы ограничить совместимость
только EMP-патронами и сохранить поведение «не наносит структурный урон».
In
`@Resources/Prototypes/_Sunrise/Entities/Objects/Weapons/Guns/Ammunition/Catrtidges/heavy_rifle.yml`:
- Around line 57-58: Rename the misspelled directory "Catrtidges" to
"Cartridges" (e.g., perform a git mv to preserve history) and update all
references to that directory throughout the repo (including any YAML files like
heavy_rifle.yml, imports, asset manifests, and CI/config paths) so they point to
"Cartridges" instead of "Catrtidges"; run a quick search for the exact token
"Catrtidges" and replace with "Cartridges" to ensure consistency.
In
`@Resources/Prototypes/Entities/Structures/Machines/Computers/nav_map_blips.yml`:
- Line 1: Remove the leading BOM character U+FEFF (shown as the invisible
character ``) at the start of nav_map_blips.yml: open the file, delete the
first character so the file begins with "# All consoles", and re-save the file
encoded as UTF-8 without BOM to ensure YAML parsers don't encounter the hidden
byte-order-mark.
---
Nitpick comments:
In `@Content.Server/_Starlight/Shuttles/Components/RadarLaserTrackerComponent.cs`:
- Line 4: Namespace in RadarLaserTrackerComponent.cs doesn't match its folder;
change the namespace from Content.Server.Shuttles.Components to
Content.Server._Starlight.Shuttles.Components (or move the file to match
namespace), then update all dependent references/usings to the new namespace —
notably in RadarLaserSystem, RadarConsoleSystem and the cannons.yml entries — so
types resolve correctly.
In `@Content.Server/Shuttles/Systems/RadarConsoleSystem.cs`:
- Around line 34-50: The Update method resets _blipUpdateTimer to 0f when it
exceeds BlipUpdateInterval, losing any excess time during large frameTime
spikes; change the reset logic in Update (the block that currently sets
_blipUpdateTimer = 0f) to subtract BlipUpdateInterval from _blipUpdateTimer (or
loop subtract while _blipUpdateTimer >= BlipUpdateInterval) so excess time is
preserved and multiple intervals can be accounted for when calling UpdateState
for each RadarConsoleComponent; refer to Update, _blipUpdateTimer and
BlipUpdateInterval to locate and modify the logic.
In `@Content.Shared/_Starlight/Shuttles/Components/RadarBlipComponent.cs`:
- Around line 1-51: The file's namespace (Content.Shared.Shuttles.Components)
does not match its directory (Content.Shared/_Starlight/Shuttles/Components);
update the namespace declaration to
Content.Shared._Starlight.Shuttles.Components so types like RadarBlipComponent,
BlipShape and any other public types in this file are colocated with the folder
structure and won't conflict with the main Shuttles namespace; ensure the
[RegisterComponent, NetworkedComponent] RadarBlipComponent and the BlipShape
enum remain unchanged except for the namespace line.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 81abe49e-ca0a-4e54-b989-8ffd9bc751d3
⛔ Files ignored due to path filters (9)
Resources/Audio/_Starlight/Weapons/Shuttleguns/leviathan_fire.oggis excluded by!**/*.oggResources/Audio/_Starlight/Weapons/Shuttleguns/uaf_cyrexa_452.oggis excluded by!**/*.oggResources/Textures/_Starlight/Objects/Weapons/Guns/Artillery Ammo/charon_ammo.rsi/railgun_slug.pngis excluded by!**/*.pngResources/Textures/_Starlight/Objects/Weapons/Guns/Artillery Ammo/charon_ammo.rsi/subnuclear.pngis excluded by!**/*.pngResources/Textures/_Starlight/Objects/Weapons/Guns/Shuttleguns/Apollo.rsi/space_artillery.pngis excluded by!**/*.pngResources/Textures/_Starlight/Objects/Weapons/Guns/Shuttleguns/Charon.rsi/space_artillery.pngis excluded by!**/*.pngResources/Textures/_Starlight/Objects/Weapons/Guns/Shuttleguns/ntsf_cyerxa_120mm.rsi/space_artillery.pngis excluded by!**/*.pngResources/Textures/_Starlight/Objects/Weapons/Guns/Shuttleguns/tarnyx.rsi/space_artillery.pngis excluded by!**/*.pngResources/Textures/_Starlight/Objects/Weapons/Guns/Shuttleguns/vanyk-MK2.rsi/space_artillery.pngis excluded by!**/*.png
📒 Files selected for processing (49)
Content.Client/Shuttles/UI/ShuttleNavControl.xaml.csContent.Client/_Starlight/Weapons/Gunnery/GunneryConsoleBoundUserInterface.csContent.Client/_Starlight/Weapons/Gunnery/GunneryConsoleWindow.xamlContent.Client/_Starlight/Weapons/Gunnery/GunneryConsoleWindow.xaml.csContent.Client/_Starlight/Weapons/Gunnery/GunneryRadarControl.xamlContent.Client/_Starlight/Weapons/Gunnery/GunneryRadarControl.xaml.csContent.Server/Shuttles/Systems/RadarConsoleSystem.csContent.Server/_Starlight/Shuttles/Components/RadarLaserTrackerComponent.csContent.Server/_Starlight/Shuttles/Systems/RadarLaserSystem.csContent.Server/_Starlight/Weapons/Gunnery/GuidedProjectileSystem.csContent.Server/_Starlight/Weapons/Gunnery/GunneryConsoleSystem.csContent.Shared/Shuttles/BUIStates/NavInterfaceState.csContent.Shared/_Starlight/Shuttles/Components/RadarBlipComponent.csContent.Shared/_Starlight/Weapons/Gunnery/GuidedProjectileComponent.csContent.Shared/_Starlight/Weapons/Gunnery/GunneryConsoleBoundUserInterfaceState.csContent.Shared/_Starlight/Weapons/Gunnery/GunneryConsoleComponent.csContent.Shared/_Starlight/Weapons/Gunnery/GunneryConsoleMessages.csResources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/antimateriel.ymlResources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/explosives.ymlResources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/meteors.ymlResources/Prototypes/Entities/Structures/Machines/Computers/nav_map_blips.ymlResources/Prototypes/Entities/Structures/Shuttles/cannons.ymlResources/Prototypes/Entities/Structures/Shuttles/thrusters.ymlResources/Prototypes/_FarHorizons/Entities/Structures/Machines/Computers/nav_map_blips.ymlResources/Prototypes/_Starlight/Entities/Objects/Weapons/Guns/Ammunition/120mm_explosives.ymlResources/Prototypes/_Starlight/Entities/Objects/Weapons/Guns/Ammunition/60mm_rocket.ymlResources/Prototypes/_Starlight/Entities/Objects/Weapons/Guns/Ammunition/Boxes/battery.ymlResources/Prototypes/_Starlight/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/bolt_rifle.ymlResources/Prototypes/_Starlight/Entities/Objects/Weapons/Guns/Ammunition/Magazines/grenade.ymlResources/Prototypes/_Starlight/Entities/Objects/Weapons/Guns/Ammunition/charon_ammo.ymlResources/Prototypes/_Starlight/Entities/Objects/Weapons/Guns/Ammunition/explosives.ymlResources/Prototypes/_Starlight/Entities/Objects/Weapons/Guns/Projectiles/120mm_projectiles.ymlResources/Prototypes/_Starlight/Entities/Objects/Weapons/Guns/Projectiles/charon_projectiles.ymlResources/Prototypes/_Starlight/Entities/Objects/Weapons/Guns/Projectiles/hitscan.ymlResources/Prototypes/_Starlight/Entities/Objects/Weapons/Guns/Projectiles/projectiles.ymlResources/Prototypes/_Starlight/Entities/Structures/Shuttles/shuttle_cannons.ymlResources/Prototypes/_Starlight/Entities/Structures/Shuttles/thrusters.ymlResources/Prototypes/_Starlight/tags.ymlResources/Prototypes/_Sunrise/Entities/Objects/Weapons/Guns/Ammunition/Catrtidges/heavy_rifle.ymlResources/Prototypes/_Sunrise/Entities/Objects/Weapons/Guns/Ammunition/explosives.ymlResources/Prototypes/_Sunrise/Entities/Objects/Weapons/Guns/Projectiles/hitscan.ymlResources/Prototypes/_Sunrise/Entities/Objects/Weapons/Guns/Projectiles/projectiles.ymlResources/Prototypes/_Sunrise/Entities/Structures/Shuttles/cannons.ymlResources/Textures/_Starlight/Objects/Weapons/Guns/Artillery Ammo/charon_ammo.rsi/meta.jsonResources/Textures/_Starlight/Objects/Weapons/Guns/Shuttleguns/Apollo.rsi/meta.jsonResources/Textures/_Starlight/Objects/Weapons/Guns/Shuttleguns/Charon.rsi/meta.jsonResources/Textures/_Starlight/Objects/Weapons/Guns/Shuttleguns/ntsf_cyerxa_120mm.rsi/meta.jsonResources/Textures/_Starlight/Objects/Weapons/Guns/Shuttleguns/tarnyx.rsi/meta.jsonResources/Textures/_Starlight/Objects/Weapons/Guns/Shuttleguns/vanyk-MK2.rsi/meta.json
Content.Client/_Starlight/Weapons/Gunnery/GunneryRadarControl.xaml.cs
Outdated
Show resolved
Hide resolved
Content.Server/_Starlight/Weapons/Gunnery/GunneryConsoleSystem.cs
Outdated
Show resolved
Hide resolved
Content.Server/_Starlight/Weapons/Gunnery/GunneryConsoleSystem.cs
Outdated
Show resolved
Hide resolved
Resources/Prototypes/_Starlight/Entities/Objects/Weapons/Guns/Ammunition/Boxes/battery.yml
Show resolved
Hide resolved
...ces/Prototypes/_Starlight/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/bolt_rifle.yml
Outdated
Show resolved
Hide resolved
Resources/Prototypes/_Starlight/Entities/Structures/Shuttles/shuttle_cannons.yml
Outdated
Show resolved
Hide resolved
...rces/Prototypes/_Sunrise/Entities/Objects/Weapons/Guns/Ammunition/Catrtidges/heavy_rifle.yml
Show resolved
Hide resolved
Resources/Prototypes/Entities/Structures/Machines/Computers/nav_map_blips.yml
Show resolved
Hide resolved
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
Resources/Locale/ru-RU/_prototypes/_starlight/entities/structures/shuttles/shuttle_cannons.ftl (1)
10-11: Опущен фрагмент описания (мифологическая отсылка).В английской версии присутствует дополнительный текст: "Named for the devouring whirlpool of legend - because that is what awaits those who face one." В русской версии этот фрагмент отсутствует.
Если это намеренное упрощение — можно оставить как есть. Если требуется полное соответствие, предлагаю добавить:
📝 Предлагаемое изменение
ent-ShuttleGunCharon = рельсотрон M321-CHARYBDIS "Танатос" 280мм - .desc = Однозарядный электромагнитный рельсотрон с колоссальной разрушительной силой. Разгоняет 280мм снаряд до огромной скорости. Требует ручной досылки каждого боеприпаса перед выстрелом. + .desc = Однозарядный электромагнитный рельсотрон с колоссальной разрушительной силой. Разгоняет 280мм снаряд до огромной скорости. Требует ручной досылки каждого боеприпаса перед выстрелом. Назван в честь пожирающего водоворота из легенд — потому что именно это ждёт тех, кто встанет на его пути.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Resources/Locale/ru-RU/_prototypes/_starlight/entities/structures/shuttles/shuttle_cannons.ftl` around lines 10 - 11, В переводе для строки ent-ShuttleGunCharon отсутствует дополнительная фраза из англ. оригинала — «Named for the devouring whirlpool of legend - because that is what awaits those who face one.»; обновите запись ent-ShuttleGunCharon (в блоке .desc или рядом с именем как в оригинале) добавив эквивалентную русскую фразу, например: «Назван в честь поглощающего водоворота легенд — ибо именно это ждёт тех, кто встретится с ним.»; убедитесь, что оформление и кавычки соответствуют остальным элементам файла и что строка корректно проходит проверку локализации.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@Resources/Locale/en-US/_prototypes/_starlight/entities/objects/weapons/guns/ammunition/120mm_explosives.ftl`:
- Around line 7-8: The localization key ent-Magazine120mmGrenadeBlastEmpty has a
description that says the magazine is "loaded" despite the key indicating it's
empty; update the .desc for Magazine120mmGrenadeBlastEmpty to reflect that it is
empty (for example: "A large 20-round magazine that is currently empty; designed
for powerful blast grenades for the NTSF-CYERXA cannon system."), ensuring you
edit the ent-Magazine120mmGrenadeBlastEmpty / Magazine120mmGrenadeBlastEmpty
entry so name and description are consistent.
In
`@Resources/Locale/en-US/_prototypes/_starlight/entities/objects/weapons/guns/ammunition/60mm_rocket.ftl`:
- Around line 7-8: The description for ent-Magazine60mmRocketEmpty incorrectly
says "loaded with 60mm rockets" despite being the empty magazine entry; update
the .desc for ent-Magazine60mmRocketEmpty to reflect an empty state (e.g., "An
empty high-capacity 30-round magazine for the Vanyk-MK2 shuttle cannon system")
and make the equivalent change in the YAML prototype entry for the 60mm rocket
magazine (the corresponding key in 60mm_rocket.yml around the magazine
description, line ~83) so both FTL and YAML consistently describe the empty
magazine.
In
`@Resources/Locale/ru-RU/_prototypes/_starlight/entities/objects/weapons/guns/ammunition/120mm_explosives.ftl`:
- Around line 7-8: The .desc for ent-Magazine120mmGrenadeBlastEmpty currently
states it contains "на 20 мощных фугасных снарядов" which contradicts the
"пустой" state; update the .desc for ent-Magazine120mmGrenadeBlastEmpty to
reflect that the magazine is empty (e.g., mention that it is an empty 120mm
grenade magazine or that it has capacity for 20 rounds but is currently empty)
so the text matches the empty variant and mirrors the English version behavior.
---
Nitpick comments:
In
`@Resources/Locale/ru-RU/_prototypes/_starlight/entities/structures/shuttles/shuttle_cannons.ftl`:
- Around line 10-11: В переводе для строки ent-ShuttleGunCharon отсутствует
дополнительная фраза из англ. оригинала — «Named for the devouring whirlpool of
legend - because that is what awaits those who face one.»; обновите запись
ent-ShuttleGunCharon (в блоке .desc или рядом с именем как в оригинале) добавив
эквивалентную русскую фразу, например: «Назван в честь поглощающего водоворота
легенд — ибо именно это ждёт тех, кто встретится с ним.»; убедитесь, что
оформление и кавычки соответствуют остальным элементам файла и что строка
корректно проходит проверку локализации.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 0f05ad6e-505c-44c9-b679-1b063bcebb10
📒 Files selected for processing (14)
Resources/Locale/en-US/_prototypes/_starlight/entities/objects/weapons/guns/ammunition/120mm_explosives.ftlResources/Locale/en-US/_prototypes/_starlight/entities/objects/weapons/guns/ammunition/60mm_rocket.ftlResources/Locale/en-US/_prototypes/_starlight/entities/objects/weapons/guns/ammunition/charon_ammo.ftlResources/Locale/en-US/_prototypes/_starlight/entities/objects/weapons/guns/ammunition/explosives.ftlResources/Locale/en-US/_prototypes/_starlight/entities/objects/weapons/guns/ammunition/magazines/grenade.ftlResources/Locale/en-US/_prototypes/_starlight/entities/structures/shuttles/shuttle_cannons.ftlResources/Locale/ru-RU/_prototypes/_starlight/entities/objects/weapons/guns/ammunition/120mm_explosives.ftlResources/Locale/ru-RU/_prototypes/_starlight/entities/objects/weapons/guns/ammunition/60mm_rocket.ftlResources/Locale/ru-RU/_prototypes/_starlight/entities/objects/weapons/guns/ammunition/charon_ammo.ftlResources/Locale/ru-RU/_prototypes/_starlight/entities/objects/weapons/guns/ammunition/explosives.ftlResources/Locale/ru-RU/_prototypes/_starlight/entities/objects/weapons/guns/ammunition/magazines/grenade.ftlResources/Locale/ru-RU/_prototypes/_starlight/entities/structures/shuttles/shuttle_cannons.ftlResources/Prototypes/_Starlight/Entities/Objects/Weapons/Guns/Ammunition/120mm_explosives.ymlResources/Prototypes/_Starlight/Entities/Objects/Weapons/Guns/Ammunition/60mm_rocket.yml
🚧 Files skipped from review as they are similar to previous changes (1)
- Resources/Prototypes/_Starlight/Entities/Objects/Weapons/Guns/Ammunition/60mm_rocket.yml
...e/en-US/_prototypes/_starlight/entities/objects/weapons/guns/ammunition/120mm_explosives.ftl
Show resolved
Hide resolved
...Locale/en-US/_prototypes/_starlight/entities/objects/weapons/guns/ammunition/60mm_rocket.ftl
Show resolved
Hide resolved
...e/ru-RU/_prototypes/_starlight/entities/objects/weapons/guns/ammunition/120mm_explosives.ftl
Show resolved
Hide resolved
There was a problem hiding this comment.
Actionable comments posted: 7
♻️ Duplicate comments (3)
Content.Server/_Starlight/Weapons/Gunnery/GunneryConsoleSystem.cs (2)
84-100:⚠️ Potential issue | 🟠 MajorПривязка
GuidedProjectileчерез окно 200мс остаётся недетерминированной.На Line 86-99 снаряд назначается “первому подходящему” пульту по времени, поэтому при почти одновременном огне нескольких консолей наведение может уйти на чужую ракету. Нужна детерминированная связка
выстрел -> uid созданного снаряда -> конкретный пульт, без глобальной временной эвристики.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Server/_Starlight/Weapons/Gunnery/GunneryConsoleSystem.cs` around lines 84 - 100, The current OnGuidedProjectileStartup uses a 200ms global time window to pick the "first matching" console which is non-deterministic; instead make the spawn code explicitly link the projectile to the firing console or match via an explicit fire identifier: add a FireId (or use an existing spawn param) on GunneryConsoleComponent (e.g., LastFireId) and set that same id into GuidedProjectileComponent when the console spawns the projectile, then change OnGuidedProjectileStartup to find the console by comparing GuidedProjectileComponent.FireId == console.LastFireId (or simply have the console set guided.Controller/SteeringTarget/Active/TrackedGuidedProjectile at spawn time), and remove the TimeSpan threshold and time-based selection logic so linking is deterministic (refer to OnGuidedProjectileStartup, GuidedProjectileComponent, GunneryConsoleComponent, LastFireTime, LastFireTargetPos, TrackedGuidedProjectile).
103-113:⚠️ Potential issue | 🔴 CriticalСерверу нельзя доверять
msg.Cannonи координаты цели без серверной валидации.На Line 105-113 и Line 198-201 отсутствует строгая проверка принадлежности/доступности орудия и согласованности map/grid для цели. Это открывает возможность стрелять не тем орудием и посылать некорректные цели из другой карты.
Возможный минимальный фикс в текущем файле
private void OnFireStartMessage(EntityUid uid, GunneryConsoleComponent comp, GunneryConsoleFireStartMessage msg) { var cannon = GetEntity(msg.Cannon); - if (!TryComp<GunComponent>(cannon, out var gunComp)) + if (!TryComp<GunComponent>(cannon, out var gunComp) || !HasComp<GunneryTrackableComponent>(cannon)) return; var targetCoords = GetCoordinates(msg.Target); + var consoleMap = _transform.GetMapCoordinates(uid); + var cannonMap = _transform.GetMapCoordinates(cannon); + var targetMap = _transform.ToMapCoordinates(targetCoords); + + if (consoleMap.MapId != cannonMap.MapId || targetMap.MapId != cannonMap.MapId) + return; + comp.ReleaseRequested = false; comp.HeldCannons[cannon] = targetCoords; TryFireCannon(comp, cannon, gunComp, targetCoords); } @@ if (!TryComp<GuidedProjectileComponent>(comp.TrackedGuidedProjectile.Value, out var guided)) { comp.TrackedGuidedProjectile = null; return; } var targetMapCoords = _transform.ToMapCoordinates(GetCoordinates(msg.Target)); + var projectileMap = _transform.GetMapCoordinates(comp.TrackedGuidedProjectile.Value); + if (guided.Controller != uid || targetMapCoords.MapId != projectileMap.MapId) + return; + guided.SteeringTarget = targetMapCoords.Position; guided.Active = true; guided.Controller = uid; }Also applies to: 182-202
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Server/_Starlight/Weapons/Gunnery/GunneryConsoleSystem.cs` around lines 103 - 113, The server currently trusts msg.Cannon and msg.Target in OnFireStartMessage (and related handlers around lines ~182-202); fix by validating the cannon entity and target before storing/using them: after resolving GetEntity(msg.Cannon) and GetCoordinates(msg.Target) ensure the cannon exists and TryComp<GunComponent>(cannon, out ...) succeeds, then verify the console/component has permission or ownership over that cannon (e.g., same station/owner or an access check on GunneryConsoleComponent), and confirm the target coordinates share the same map/grid as the cannon (compare target.MapId/GridId to cannon’s transform/Grid/Map). Only set comp.HeldCannons[cannon] and call TryFireCannon when both ownership/access and map consistency checks pass; apply the same checks in the corresponding stop/release handlers referenced (TryFireCannon call sites and the handlers at ~182-202).Content.Client/_Starlight/Weapons/Gunnery/GunneryRadarControl.xaml.cs (1)
108-113:⚠️ Potential issue | 🟠 MajorУстаревшие выделения не очищаются после обновления списка орудий.
При присвоении
_cannons = state.CannonsнаборSelectedCannonsне фильтруется. Если орудие уничтожено или вышло из радиуса, оно исчезнет из UI, но останется вSelectedCannons. При нажатии огня будет отправлен запрос на несуществующее орудие.🐛 Предлагаемое исправление
_cannons = state.Cannons; _trackedGuidedProjectile = state.TrackedGuidedProjectile; + + // Удаляем выделения для орудий, которых больше нет в списке + var validCannons = new HashSet<NetEntity>(_cannons.Select(c => c.Entity)); + SelectedCannons.IntersectWith(validCannons);🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Client/_Starlight/Weapons/Gunnery/GunneryRadarControl.xaml.cs` around lines 108 - 113, При обновлении списка орудий в GunneryRadarControl (где выполняется присвоение _cannons = state.Cannons) обновить и набор выбранных орудий SelectedCannons: отфильтровать/очистить элементы SelectedCannons, оставив только те, чьи идентификаторы присутствуют в новом _cannons (удалить ссылки на уничтоженные или вышедшие из радиуса орудия), чтобы избежать отправки команд на несуществующие орудия; реализуйте это сразу после присвоения _cannons в том же методе/конструкторе, используя уникальные идентификаторы орудий для сравнения.
🧹 Nitpick comments (4)
Content.Server/Projectiles/ProjectileSystem.cs (1)
117-125: Защита работает корректно, но есть нюанс с переменнойdeleted.Переменная
deletedвычисляется на строке 58, до вызоваTryChangeDamage(строка 60). ЕслиTryChangeDamageуничтожит цель, значениеdeletedбудет устаревшим. Однако проверкаHasComp<TransformComponent>(target)компенсирует это — она вернётfalseдля уничтоженных сущностей.Текущий код функционально безопасен, но для большей ясности можно рассмотреть обновление проверки
Deleted()после применения урона, либо переименовать переменную вwasAlreadyDeleted.♻️ Опциональный рефакторинг для ясности
- var deleted = Deleted(target); + var wasDeletedBeforeDamage = Deleted(target);И соответственно обновить использования на строках 65 и 118.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Server/Projectiles/ProjectileSystem.cs` around lines 117 - 125, The issue is that the local variable `deleted` is computed before `TryChangeDamage` and may become stale if that call destroys the `target`; update the logic by re-evaluating the entity deletion state after applying damage (call `Deleted(target)` or re-check `HasComp<TransformComponent>(target)` immediately after `TryChangeDamage`) or rename the pre-damage flag to `wasAlreadyDeleted` and use the post-damage `Deleted()` check for subsequent logic in the block that calls `_guns.PlayImpactSound` and `_sharedCameraRecoil.KickCamera`; adjust usages around `deleted`, `TryChangeDamage`, and the `HasComp<TransformComponent>(target)` checks accordingly to ensure the decision uses the post-damage state.Resources/Locale/en-US/_prototypes/_starlight/entities/structures/shuttles/shuttle_cannons.ftl (1)
13-14: Локализация Tarnyx присутствует, но прототип закомментирован.
ent-ShuttleGunTarnyxопределён в локали, но соответствующий прототип в YAML закомментирован. Это не вызовет ошибок, но стоит либо удалить локализацию, либо раскомментировать прототип.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Resources/Locale/en-US/_prototypes/_starlight/entities/structures/shuttles/shuttle_cannons.ftl` around lines 13 - 14, The localization key ent-ShuttleGunTarnyx is present but the corresponding prototype is commented out in the YAML; either remove this localization entry or restore the prototype. Locate the commented prototype (the YAML block that would define the Tarnyx shuttle gun prototype) and uncomment it if the weapon should exist, or delete the ent-ShuttleGunTarnyx line from Resources/Locale/en-US/_prototypes/_starlight/entities/structures/shuttles/shuttle_cannons.ftl if the prototype is intentionally disabled, ensuring consistency between prototypes and locale entries.Resources/Prototypes/_Starlight/Entities/Structures/Shuttles/shuttle_cannons.yml (1)
212-217: Несоответствие названий: Charon vs Charybdis.В описании упоминается "водоворот из легенд" (Charybdis — Харибда), но ID и название сущности — "Charon" (Харон — перевозчик душ). Это разные мифологические персонажи. Если орудие должно ассоциироваться с водоворотом, ID должен быть
ShuttleGunCharybdis. Если с перевозчиком — убрать упоминание водоворота из описания.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Resources/Prototypes/_Starlight/Entities/Structures/Shuttles/shuttle_cannons.yml` around lines 212 - 217, В описании и идентификаторах обнаружен конфликт мифологических имен: сущность объявлена как ShuttleGunCharon с name RL-280 "Charon" но текст описания ссылается на водоворот (Charybdis). Исправьте либо ID и name на Charybdis (например переименовать ShuttleGunCharon → ShuttleGunCharybdis и name → RL-280 "Charybdis"/соответствующий перевод) если хотите сохранить ссылку на водоворот, либо уберите упоминание водоворота из поля description и оставьте ShuttleGunCharon / RL-280 "Charon" если хотите сохранить образ Харона; обновите все соответствующие ссылки/наименования в файле чтобы они были согласованы.Content.Client/_Starlight/Weapons/Gunnery/GunneryRadarControl.xaml.cs (1)
453-456: Неиспользуемый методInverseScalePosition.Метод определён, но нигде не вызывается. Если он не планируется к использованию, его следует удалить.
♻️ Предлагаемое исправление
- private Vector2 InverseScalePosition(Vector2 value) - { - return (value - MidPointVector) / MinimapScale; - }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Client/_Starlight/Weapons/Gunnery/GunneryRadarControl.xaml.cs` around lines 453 - 456, Метод InverseScalePosition объявлен (использует MidPointVector и MinimapScale) но нигде не вызывается; удалите его определение (private Vector2 InverseScalePosition(Vector2 value) { return (value - MidPointVector) / MinimapScale; }) из класса GunneryRadarControl.xaml.cs; если планируете использовать эту логику позже — вместо удаления разместите вызовы туда, где требуется обратное масштабирование, и убедитесь, что MidPointVector и MinimapScale доступны.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@Resources/Locale/ru-RU/_prototypes/_starlight/entities/objects/weapons/guns/ammunition/charon_ammo.ftl`:
- Around line 1-2: The Russian localization for ent-CartridgeCharon280mmSlug
(.desc) uses "пласталевый кинетический снаряд" which conflicts with the en-US
text ("depleted-tungsten penetrator"); update the Russian string to match the
material in en-US (e.g., "обеднённовольфрамовый бронебойный снаряд" or a chosen
consistent term like "вольфрамовый бронебойный снаряд") or alternatively change
the en-US term to "plasteel" to match RU—ensure ent-CartridgeCharon280mmSlug and
its .desc are made consistent across locales and remain grammatically correct
and contextually accurate for the M321-CHARYBDIS description.
In `@Resources/Locale/ru-RU/_prototypes/entities/structures/shuttles/cannons.ftl`:
- Around line 22-32: Update the outdated fire-button labels to match the renamed
cannon IDs: locate ent-SignalButtonLongbow, ent-SignalButtonVympel and
ent-SignalButtonQuadling in this file and replace any occurrences of "127",
"127-2", and "127-4" with the new identifiers "15", "15-2", and "15-4"
respectively so the UI texts match the ent-ShuttleGun* entries (e.g., BAL-15,
BAL-15-2, BAL-15-4).
In `@Resources/Locale/ru-RU/_strings/_sunrise/store/uplink-catalog.ftl`:
- Line 63: В строке с ключом uplink-magazine-15-desc исправьте опечатки в тексте
описания: замените «предназначеных» на «предназначенных» и «стркутур» на
«структур», сохранив остальную формулировку и пунктуацию.
In
`@Resources/Prototypes/_Starlight/Entities/Objects/Weapons/Guns/Projectiles/charon_projectiles.yml`:
- Around line 61-71: BulletCharon280mmSubnuclear is missing an explicit
Projectile component (unlike BulletCharon280mmSlug) so it currently only
inherits Blunt: 7 from BaseBulletTrigger; add a Projectile component to
BulletCharon280mmSubnuclear that defines appropriate damage values (e.g., Blunt:
80-150) and the non‑piercing behavior referenced in the comment so the 280mm
subnuclear slug scales to its expected impact (modify the entity block for
BulletCharon280mmSubnuclear to include a Projectile component with the damage
range and any relevant flags such as DoesNotPierce or Pierce: false).
- Around line 98-104: The YAML places requireInSpace inside the Explosive block
where ExplosiveComponent doesn't define it, so remove requireInSpace from the
Explosive component and add it to the RadarBlip component for this projectile
(mirror how BulletCharon280mmSubnuclear defines RadarBlip); update the
projectile's components so Explosive (ExplosiveComponent) contains only its
valid fields (explosionType, totalIntensity, intensitySlope, maxIntensity,
canCreateVacuum) and RadarBlip receives requireInSpace.
In
`@Resources/Prototypes/_Starlight/Entities/Structures/Machines/Computers/gunnery_console.yml`:
- Around line 2-3: ComputerGunnery inherits the RadarConsole component from
ComputerRadar but intentionally replaces its UI with GunneryConsoleUiKey,
leaving the RadarConsole without its expected RadarConsoleUiKey so
RadarConsoleSystem will skip updates; fix by either changing the parent of
ComputerGunnery from ComputerRadar to BaseComputer (or another parent that
doesn't include RadarConsole) if radar functionality is not needed, or
explicitly add RadarConsoleUiKey to the UserInterface section of ComputerGunnery
so RadarConsoleSystem will recognize and update the radar UI.
In
`@Resources/Textures/_Sunrise/Objects/Weapons/Guns/Shuttles/bal_127_2.rsi/meta.json`:
- Line 11: Переименование ресурса "name": "bal-15-2" сломает ссылку state:
bal-127-2 в прототипе ShuttleGunVympel
(Resources/Prototypes/_Sunrise/Entities/Structures/Shuttles/cannons.yml); чтобы
исправить, откройте прототип ShuttleGunVympel и либо обновите значение state с
bal-127-2 на bal-15-2, либо верните имя в meta.json обратно на bal-127-2, чтобы
сохранить совместимость ссылок; правка должна коснуться именно поля state в
ShuttleGunVympel или поля name в meta.json, чтобы значения снова совпадали.
---
Duplicate comments:
In `@Content.Client/_Starlight/Weapons/Gunnery/GunneryRadarControl.xaml.cs`:
- Around line 108-113: При обновлении списка орудий в GunneryRadarControl (где
выполняется присвоение _cannons = state.Cannons) обновить и набор выбранных
орудий SelectedCannons: отфильтровать/очистить элементы SelectedCannons, оставив
только те, чьи идентификаторы присутствуют в новом _cannons (удалить ссылки на
уничтоженные или вышедшие из радиуса орудия), чтобы избежать отправки команд на
несуществующие орудия; реализуйте это сразу после присвоения _cannons в том же
методе/конструкторе, используя уникальные идентификаторы орудий для сравнения.
In `@Content.Server/_Starlight/Weapons/Gunnery/GunneryConsoleSystem.cs`:
- Around line 84-100: The current OnGuidedProjectileStartup uses a 200ms global
time window to pick the "first matching" console which is non-deterministic;
instead make the spawn code explicitly link the projectile to the firing console
or match via an explicit fire identifier: add a FireId (or use an existing spawn
param) on GunneryConsoleComponent (e.g., LastFireId) and set that same id into
GuidedProjectileComponent when the console spawns the projectile, then change
OnGuidedProjectileStartup to find the console by comparing
GuidedProjectileComponent.FireId == console.LastFireId (or simply have the
console set guided.Controller/SteeringTarget/Active/TrackedGuidedProjectile at
spawn time), and remove the TimeSpan threshold and time-based selection logic so
linking is deterministic (refer to OnGuidedProjectileStartup,
GuidedProjectileComponent, GunneryConsoleComponent, LastFireTime,
LastFireTargetPos, TrackedGuidedProjectile).
- Around line 103-113: The server currently trusts msg.Cannon and msg.Target in
OnFireStartMessage (and related handlers around lines ~182-202); fix by
validating the cannon entity and target before storing/using them: after
resolving GetEntity(msg.Cannon) and GetCoordinates(msg.Target) ensure the cannon
exists and TryComp<GunComponent>(cannon, out ...) succeeds, then verify the
console/component has permission or ownership over that cannon (e.g., same
station/owner or an access check on GunneryConsoleComponent), and confirm the
target coordinates share the same map/grid as the cannon (compare
target.MapId/GridId to cannon’s transform/Grid/Map). Only set
comp.HeldCannons[cannon] and call TryFireCannon when both ownership/access and
map consistency checks pass; apply the same checks in the corresponding
stop/release handlers referenced (TryFireCannon call sites and the handlers at
~182-202).
---
Nitpick comments:
In `@Content.Client/_Starlight/Weapons/Gunnery/GunneryRadarControl.xaml.cs`:
- Around line 453-456: Метод InverseScalePosition объявлен (использует
MidPointVector и MinimapScale) но нигде не вызывается; удалите его определение
(private Vector2 InverseScalePosition(Vector2 value) { return (value -
MidPointVector) / MinimapScale; }) из класса GunneryRadarControl.xaml.cs; если
планируете использовать эту логику позже — вместо удаления разместите вызовы
туда, где требуется обратное масштабирование, и убедитесь, что MidPointVector и
MinimapScale доступны.
In `@Content.Server/Projectiles/ProjectileSystem.cs`:
- Around line 117-125: The issue is that the local variable `deleted` is
computed before `TryChangeDamage` and may become stale if that call destroys the
`target`; update the logic by re-evaluating the entity deletion state after
applying damage (call `Deleted(target)` or re-check
`HasComp<TransformComponent>(target)` immediately after `TryChangeDamage`) or
rename the pre-damage flag to `wasAlreadyDeleted` and use the post-damage
`Deleted()` check for subsequent logic in the block that calls
`_guns.PlayImpactSound` and `_sharedCameraRecoil.KickCamera`; adjust usages
around `deleted`, `TryChangeDamage`, and the
`HasComp<TransformComponent>(target)` checks accordingly to ensure the decision
uses the post-damage state.
In
`@Resources/Locale/en-US/_prototypes/_starlight/entities/structures/shuttles/shuttle_cannons.ftl`:
- Around line 13-14: The localization key ent-ShuttleGunTarnyx is present but
the corresponding prototype is commented out in the YAML; either remove this
localization entry or restore the prototype. Locate the commented prototype (the
YAML block that would define the Tarnyx shuttle gun prototype) and uncomment it
if the weapon should exist, or delete the ent-ShuttleGunTarnyx line from
Resources/Locale/en-US/_prototypes/_starlight/entities/structures/shuttles/shuttle_cannons.ftl
if the prototype is intentionally disabled, ensuring consistency between
prototypes and locale entries.
In
`@Resources/Prototypes/_Starlight/Entities/Structures/Shuttles/shuttle_cannons.yml`:
- Around line 212-217: В описании и идентификаторах обнаружен конфликт
мифологических имен: сущность объявлена как ShuttleGunCharon с name RL-280
"Charon" но текст описания ссылается на водоворот (Charybdis). Исправьте либо ID
и name на Charybdis (например переименовать ShuttleGunCharon →
ShuttleGunCharybdis и name → RL-280 "Charybdis"/соответствующий перевод) если
хотите сохранить ссылку на водоворот, либо уберите упоминание водоворота из поля
description и оставьте ShuttleGunCharon / RL-280 "Charon" если хотите сохранить
образ Харона; обновите все соответствующие ссылки/наименования в файле чтобы они
были согласованы.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: ec124afb-354e-4ed8-a71a-9f13c06cd454
⛔ Files ignored due to path filters (2)
Resources/Textures/_Starlight/Objects/Weapons/Guns/Artillery Ammo/charon_ammo.rsi/inhand-left.pngis excluded by!**/*.pngResources/Textures/_Starlight/Objects/Weapons/Guns/Artillery Ammo/charon_ammo.rsi/inhand-right.pngis excluded by!**/*.png
📒 Files selected for processing (36)
Content.Client/_Starlight/Weapons/Gunnery/GunneryConsoleBoundUserInterface.csContent.Client/_Starlight/Weapons/Gunnery/GunneryConsoleWindow.xaml.csContent.Client/_Starlight/Weapons/Gunnery/GunneryRadarControl.xaml.csContent.Server/Projectiles/ProjectileSystem.csContent.Server/_Starlight/Weapons/Gunnery/GunneryConsoleSystem.csContent.Shared/_Starlight/Weapons/Gunnery/GunneryConsoleComponent.csContent.Shared/_Starlight/Weapons/Gunnery/GunneryConsoleMessages.csResources/Locale/en-US/_prototypes/_starlight/entities/objects/weapons/guns/ammunition/charon_ammo.ftlResources/Locale/en-US/_prototypes/_starlight/entities/structures/machines/computers/gunnery_console.ftlResources/Locale/en-US/_prototypes/_starlight/entities/structures/shuttles/shuttle_cannons.ftlResources/Locale/en-US/_prototypes/entities/objects/devices/circuitboards/machine/cannons.ftlResources/Locale/en-US/_prototypes/entities/structures/shuttles/cannons.ftlResources/Locale/ru-RU/_prototypes/_starlight/entities/objects/weapons/guns/ammunition/charon_ammo.ftlResources/Locale/ru-RU/_prototypes/_starlight/entities/structures/machines/computers/gunnery_console.ftlResources/Locale/ru-RU/_prototypes/_starlight/entities/structures/shuttles/shuttle_cannons.ftlResources/Locale/ru-RU/_prototypes/entities/objects/devices/circuitboards/machine/cannons.ftlResources/Locale/ru-RU/_prototypes/entities/objects/weapons/guns/ammunition/explosives.ftlResources/Locale/ru-RU/_prototypes/entities/structures/shuttles/cannons.ftlResources/Locale/ru-RU/_strings/_sunrise/store/uplink-catalog.ftlResources/Maps/_Sunrise/planet_prison_old.ymlResources/Prototypes/Entities/Objects/Devices/Circuitboards/Machine/cannons.ymlResources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Boxes/antimateriel.ymlResources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/explosives.ymlResources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/meteors.ymlResources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.ymlResources/Prototypes/Entities/Structures/Shuttles/cannons.ymlResources/Prototypes/_Starlight/Entities/Objects/Weapons/Guns/Ammunition/charon_ammo.ymlResources/Prototypes/_Starlight/Entities/Objects/Weapons/Guns/Projectiles/charon_projectiles.ymlResources/Prototypes/_Starlight/Entities/Structures/Machines/Computers/gunnery_console.ymlResources/Prototypes/_Starlight/Entities/Structures/Shuttles/shuttle_cannons.ymlResources/Prototypes/_Sunrise/Catalog/uplink_catalog.ymlResources/Prototypes/_Sunrise/Entities/Objects/Weapons/Guns/Ammunition/explosives.ymlResources/Prototypes/_Sunrise/Entities/Objects/Weapons/Guns/Projectiles/projectiles.ymlResources/Prototypes/_Sunrise/Entities/Structures/Shuttles/cannons.ymlResources/Textures/_Starlight/Objects/Weapons/Guns/Artillery Ammo/charon_ammo.rsi/meta.jsonResources/Textures/_Sunrise/Objects/Weapons/Guns/Shuttles/bal_127_2.rsi/meta.json
✅ Files skipped from review due to trivial changes (1)
- Resources/Locale/ru-RU/_prototypes/_starlight/entities/structures/machines/computers/gunnery_console.ftl
🚧 Files skipped from review as they are similar to previous changes (5)
- Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/explosives.yml
- Resources/Prototypes/Entities/Structures/Shuttles/cannons.yml
- Content.Client/_Starlight/Weapons/Gunnery/GunneryConsoleWindow.xaml.cs
- Resources/Locale/ru-RU/_prototypes/_starlight/entities/structures/shuttles/shuttle_cannons.ftl
- Resources/Textures/_Starlight/Objects/Weapons/Guns/Artillery Ammo/charon_ammo.rsi/meta.json
...Locale/ru-RU/_prototypes/_starlight/entities/objects/weapons/guns/ammunition/charon_ammo.ftl
Show resolved
Hide resolved
Resources/Locale/ru-RU/_prototypes/entities/structures/shuttles/cannons.ftl
Show resolved
Hide resolved
Resources/Locale/ru-RU/_strings/_sunrise/store/uplink-catalog.ftl
Outdated
Show resolved
Hide resolved
...urces/Prototypes/_Starlight/Entities/Objects/Weapons/Guns/Projectiles/charon_projectiles.yml
Show resolved
Hide resolved
...urces/Prototypes/_Starlight/Entities/Objects/Weapons/Guns/Projectiles/charon_projectiles.yml
Outdated
Show resolved
Hide resolved
Resources/Prototypes/_Starlight/Entities/Structures/Machines/Computers/gunnery_console.yml
Outdated
Show resolved
Hide resolved
Resources/Textures/_Sunrise/Objects/Weapons/Guns/Shuttles/bal_127_2.rsi/meta.json
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
🧹 Nitpick comments (2)
Resources/Locale/ru-RU/_prototypes/_starlight/entities/objects/weapons/guns/projectiles/projectiles.ftl (1)
11-12: Отсутствует русская локализация для Bullet60mmRocket.Аналогично английской локализации, для сущности
Bullet60mmRocketизprojectiles.ymlнеобходимо добавить русский перевод.📝 Предлагаемое исправление
ent-BulletGrenadeCleanadeSyndicate = злой снаряд-клинада .desc = Синдикатовский снаряд-клинада с агрессивной очищающей пеной. +ent-Bullet60mmRocket = 60мм ракета + .desc = Осколочно-фугасная ракета.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Resources/Locale/ru-RU/_prototypes/_starlight/entities/objects/weapons/guns/projectiles/projectiles.ftl` around lines 11 - 12, Add a Russian localization entry for the Bullet60mmRocket entity by creating keys similar to the existing ent-BulletGrenadeCleanadeSyndicate pattern: add an "ent-Bullet60mmRocket" label and an accompanying ".desc" line with the Russian name and description that correspond to the English `Bullet60mmRocket` in projectiles.yml; ensure the keys exactly match the entity identifier "Bullet60mmRocket" so the game will pick up the translation.Resources/Locale/en-US/_prototypes/_starlight/entities/objects/weapons/guns/projectiles/projectiles.ftl (1)
11-12: Отсутствует локализация для Bullet60mmRocket.В файле
projectiles.ymlдобавлена новая сущностьBullet60mmRocket, но локализация для неё здесь отсутствует. Рекомендуется добавить соответствующую запись для полноты локализации.📝 Предлагаемое исправление
ent-BulletGrenadeCleanadeSyndicate = evil cleanade grenade round .desc = A syndicate-grade cleanade round filled with aggressive cleaning foam. +ent-Bullet60mmRocket = 60mm rocket + .desc = A high-explosive rocket projectile.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Resources/Locale/en-US/_prototypes/_starlight/entities/objects/weapons/guns/projectiles/projectiles.ftl` around lines 11 - 12, Add a localization entry for the new projectile entity Bullet60mmRocket in this .ftl by following the existing pattern (e.g. ent-BulletGrenadeCleanadeSyndicate and its .desc): create ent-Bullet60mmRocket = <short name> and a .desc = <full description> lines to provide the missing localization for Bullet60mmRocket so it matches other projectile entries.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In
`@Resources/Locale/en-US/_prototypes/_starlight/entities/objects/weapons/guns/projectiles/projectiles.ftl`:
- Around line 11-12: Add a localization entry for the new projectile entity
Bullet60mmRocket in this .ftl by following the existing pattern (e.g.
ent-BulletGrenadeCleanadeSyndicate and its .desc): create ent-Bullet60mmRocket =
<short name> and a .desc = <full description> lines to provide the missing
localization for Bullet60mmRocket so it matches other projectile entries.
In
`@Resources/Locale/ru-RU/_prototypes/_starlight/entities/objects/weapons/guns/projectiles/projectiles.ftl`:
- Around line 11-12: Add a Russian localization entry for the Bullet60mmRocket
entity by creating keys similar to the existing
ent-BulletGrenadeCleanadeSyndicate pattern: add an "ent-Bullet60mmRocket" label
and an accompanying ".desc" line with the Russian name and description that
correspond to the English `Bullet60mmRocket` in projectiles.yml; ensure the keys
exactly match the entity identifier "Bullet60mmRocket" so the game will pick up
the translation.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: fa165040-ad1e-4492-8969-e80c7dd205ef
📒 Files selected for processing (8)
Resources/Locale/en-US/_prototypes/_starlight/entities/objects/weapons/guns/ammunition/explosives.ftlResources/Locale/en-US/_prototypes/_starlight/entities/objects/weapons/guns/projectiles/projectiles.ftlResources/Locale/ru-RU/_prototypes/_starlight/entities/objects/weapons/guns/ammunition/explosives.ftlResources/Locale/ru-RU/_prototypes/_starlight/entities/objects/weapons/guns/projectiles/projectiles.ftlResources/Prototypes/_Starlight/Entities/Objects/Weapons/Guns/Ammunition/explosives.ymlResources/Prototypes/_Starlight/Entities/Objects/Weapons/Guns/Projectiles/charon_projectiles.ymlResources/Prototypes/_Starlight/Entities/Objects/Weapons/Guns/Projectiles/projectiles.ymlResources/Prototypes/_Starlight/Entities/Structures/Machines/Computers/gunnery_console.yml
🚧 Files skipped from review as they are similar to previous changes (5)
- Resources/Locale/ru-RU/_prototypes/_starlight/entities/objects/weapons/guns/ammunition/explosives.ftl
- Resources/Prototypes/_Starlight/Entities/Objects/Weapons/Guns/Ammunition/explosives.yml
- Resources/Prototypes/_Starlight/Entities/Structures/Machines/Computers/gunnery_console.yml
- Resources/Prototypes/_Starlight/Entities/Objects/Weapons/Guns/Projectiles/charon_projectiles.yml
- Resources/Locale/en-US/_prototypes/_starlight/entities/objects/weapons/guns/ammunition/explosives.ftl
|
RSI Diff Bot; head commit 95e588a merging into eacab3e Resources/Textures/_Starlight/Objects/Weapons/Guns/ArtilleryAmmo/charon_ammo.rsi
Resources/Textures/_Starlight/Objects/Weapons/Guns/Shuttleguns/Apollo.rsi
Resources/Textures/_Starlight/Objects/Weapons/Guns/Shuttleguns/Charon.rsi
Resources/Textures/_Starlight/Objects/Weapons/Guns/Shuttleguns/ntsf_cyerxa_120mm.rsi
Resources/Textures/_Starlight/Objects/Weapons/Guns/Shuttleguns/tarnyx.rsi
Resources/Textures/_Starlight/Objects/Weapons/Guns/Shuttleguns/vanyk-MK2.rsi
|
There was a problem hiding this comment.
Actionable comments posted: 6
🧹 Nitpick comments (6)
Resources/Locale/ru-RU/_strings/_sunrise/store/uplink-catalog.ftl (1)
63-63: Рекомендуется улучшить пунктуацию.Для лучшей читаемости добавьте запятые после «патронов» и перед «таких как».
✍️ Предлагаемая правка
-uplink-magazine-15-desc = Магазин Bauer SR-127 на 7 патронов предназначенных для уничтожения мехов, киборгов или структур таких как решетки и окна, пары попаданий достаточно для пролома стены. +uplink-magazine-15-desc = Магазин Bauer SR-127 на 7 патронов, предназначенных для уничтожения мехов, киборгов или структур, таких как решётки и окна; пары попаданий достаточно для пролома стены.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Resources/Locale/ru-RU/_strings/_sunrise/store/uplink-catalog.ftl` at line 63, The string value for key uplink-magazine-15-desc needs punctuation fixes: insert a comma after «патронов» and another comma before «таких как» to improve readability, i.e. update the localized text for uplink-magazine-15-desc accordingly.Resources/Prototypes/_Starlight/Entities/Objects/Weapons/Guns/Ammunition/charon_ammo.yml (1)
51-61: Стоит сократить дублирование компонентных блоков.Повторяются почти одинаковые секции
Sprite/Appearance/SpentAmmoVisuals/StaticPrice. Лучше вынести в 1-2 промежуточных abstract-прототипа (например, для slug/subnuclear), чтобы упростить поддержку и снизить риск рассинхронизации при будущих правках.Also applies to: 94-104, 137-147, 161-171
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Resources/Prototypes/_Starlight/Entities/Objects/Weapons/Guns/Ammunition/charon_ammo.yml` around lines 51 - 61, Several ammo prototypes repeat the same component block (Sprite/Appearance/SpentAmmoVisuals/StaticPrice with state: railgun_slug and sprite _Starlight/Objects/Weapons/Guns/ArtilleryAmmo/charon_ammo.rsi); create one or two intermediate abstract prototypes (e.g., CharOnSlugBase and CharOnSubnuclearBase) that contain the shared components (Sprite with the common sprite path, Appearance, SpentAmmoVisuals with state: railgun_slug and suffix:false, and StaticPrice:2000) and then have the specific ammo prototypes inherit from the appropriate abstract prototype instead of duplicating those four component blocks (apply the same refactor to the other duplicated ranges noted).Content.Client/_Starlight/Weapons/Gunnery/GunneryRadarControl.xaml.cs (1)
269-276: Уберите heap-аллокации изDrawhot path.Здесь на каждом кадре создаются новые
Vector2[]для центра радара и каждого blip/cannon. На насыщенном шаттле это будет стабильно кормить GC прямо в клиентском рендере. Лучше перейти наstackalloc/переиспользуемые буферы.Also applies to: 521-555
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Client/_Starlight/Weapons/Gunnery/GunneryRadarControl.xaml.cs` around lines 269 - 276, В Draw hot-path создаются новые Vector2[] каждый кадр (см. массив radarVerts перед вызовом handle.DrawPrimitives и аналогичные массивы для blip/cannon), что вызывает лишние heap-алокации; замените эти краткоживущие массивы на stackalloc Span<Vector2> или на заранее выделяемые переиспользуемые буферы и заполняйте их значениями через ScalePosition/вычисления, затем передавайте Span/указатель в DrawPrimitives (или перегрузку, принимающую буфер) чтобы исключить аллокации на GC; обновите все места, использующие inline new Vector2[] (включая блоки, упомянутые для 521-555), чтобы использовать один из этих подходов.Content.Server/_Starlight/Weapons/Gunnery/GunneryConsoleSystem.cs (3)
264-281: Рекомендация по производительности: AllEntityQuery для blips.Итерация всех
RadarBlipComponentкаждые 0.25с может быть дорогой при большом количестве снарядов/обломков на карте. Для оптимизации можно рассмотреть пространственное индексирование или кэширование.Это не блокер — текущая реализация работоспособна, но стоит учитывать при масштабировании.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Server/_Starlight/Weapons/Gunnery/GunneryConsoleSystem.cs` around lines 264 - 281, The current loop uses AllEntityQuery<RadarBlipComponent, TransformComponent>() (blipQuery) every 0.25s which can be expensive when many radar blips exist; change to a spatial or cached approach: replace the full scan with a spatial query over the console's map coordinates (or maintain a per-map/per-console cache of nearby blips) and only fetch RadarBlipComponent + TransformComponent for entities returned by that spatial query, preserving the same filtering (RequireInSpace, MapID, range check) and the creation of RadarBlipData via GetNetCoordinates and navState.Blips.Add; alternatively implement incremental updates to navState.Blips when blips spawn/move/destroy to avoid repeated full scans.
88-97: При залпе из нескольких управляемых снарядов консоль будет отслеживать только последний.Если орудие выпускает несколько
GuidedProjectileComponentза один выстрел (залп/очередь), цикл установитControllerвсем снарядам, ноTrackedGuidedProjectileперезапишется последним UID. Предыдущие снаряды будут управляемыми, но не отображаться в UI консоли.Если это ожидаемое поведение (отслеживание одного снаряда за раз) — рекомендую добавить
breakпосле первого найденного guided-снаряда для явности. Если нужно отслеживать несколько — потребуется список вместо одногоEntityUid?.♻️ Вариант: выход после первого управляемого снаряда
foreach (var projectileUid in args.FiredProjectiles) { if (!TryComp<GuidedProjectileComponent>(projectileUid, out var guided)) continue; guided.Controller = pending.Console; guided.SteeringTarget = pending.Target; guided.Active = true; consoleComp.TrackedGuidedProjectile = projectileUid; + break; // Track only one guided projectile per fire event }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Server/_Starlight/Weapons/Gunnery/GunneryConsoleSystem.cs` around lines 88 - 97, The loop over args.FiredProjectiles sets Controller/SteeringTarget/Active on every GuidedProjectileComponent but keeps overwriting consoleComp.TrackedGuidedProjectile, so only the last projectile is shown; to fix, decide desired behavior and implement it: for single-tracking behavior, after assigning guided.Controller = pending.Console and setting consoleComp.TrackedGuidedProjectile = projectileUid inside the loop, add a break to stop after the first GuidedProjectileComponent; for multi-tracking, change consoleComp.TrackedGuidedProjectile (referenced as TrackedGuidedProjectile) from a single EntityUid? to a collection (e.g., List<EntityUid>), initialize and Add(projectileUid) when found, and update any UI/usage sites to iterate that list instead of expecting a single UID. Ensure you update all references to TrackedGuidedProjectile accordingly.
170-173: Удалите неиспользуемые поляLastFireTimeиLastFireTargetPos.Эти поля больше не используются после миграции на механизм
_pendingFireContexts. Проверка кодовой базы не обнаружила ни одного обращения к ним за пределами присваивания на строках 172–173. Кроме того, комментарий на строках 170–171 ссылается на несуществующий обработчикOnGuidedProjectileStartup— текущая реализация полностью опирается на_pendingFireContextsдля привязки снарядов.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Server/_Starlight/Weapons/Gunnery/GunneryConsoleSystem.cs` around lines 170 - 173, Remove the unused LastFireTime and LastFireTargetPos fields from the component declaration and eliminate their assignments (comp.LastFireTime = _timing.CurTime; comp.LastFireTargetPos = targetMapPos.Position) in GunneryConsoleSystem; also delete or rewrite the preceding comment that refers to the nonexistent OnGuidedProjectileStartup and instead note that _pendingFireContexts is used for projectile binding. Ensure any fields, usings, or references to LastFireTime/LastFireTargetPos elsewhere are removed or replaced so there are no dangling references.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@Content.Client/_Starlight/Weapons/Gunnery/GunneryRadarControl.xaml.cs`:
- Around line 152-169: The fix is to keep the fired aim in sync while RMB is
held: add an OnFireUpdated event (same signature as OnFireStarted) and, in the
MouseMove handler, when _rmbHeld && _fireHeld && _trackedGuidedProjectile ==
null && SelectedCannons.Count > 0 compute worldPos =
ScreenToWorld(args.RelativePixelPosition) and invoke OnFireUpdated for each
selected cannon (instead of only updating _cursorRelativePos locally);
alternatively, if you prefer freezing the visual aim, stop updating
_cursorRelativePos while _fireHeld is true and only update it again on
OnFireStopped — reference symbols: _rmbHeld, _cursorRelativePos,
_trackedGuidedProjectile, SelectedCannons, OnFireStarted, _fireHeld, MouseMove,
Draw, OnFireStopped, and add OnFireUpdated if following the update approach.
- Around line 74-75: The XML summary and HUD message incorrectly reference LMB
and include a hard-coded English string while the guidance is sent only when
_rmbHeld (RMB) is true; update the summary for the OnGuidanceUpdate Action to
reference RMB (or better, the actual input action name), change any HUD/in-line
text (the hard-coded English string around the HUD update referenced in the
review) to use the localization system (e.g., call the project’s localization
helper like Loc.GetString with a new key), and ensure any user-facing text keys
are added to ru-RU localization resources; keep the guidance send logic tied to
_rmbHeld and only change text and summary to match the real input and localized
strings.
- Around line 497-513: The loop currently toggles the first cannon whose blip
falls within CannonSelectRadius, causing selection to depend on _cannons order;
instead, scan all entries to find the cannon with the minimum distance from
clickRelativePos (using cannonScreen computed via EntManager.GetCoordinates and
_transform.ToMapCoordinates and transformed by blipWorldToView) that is within
CannonSelectRadius, then perform the toggle (SelectedCannons.Remove /
SelectedCannons.Add) and invoke OnSelectionChanged only for that nearest cannon;
keep the existing map ID check (cannonMapCoords.MapId != mapPos.MapId) when
filtering candidates.
In `@Resources/Locale/ru-RU/_strings/_sunrise/store/uplink-catalog.ftl`:
- Around line 64-65: Fix typos and verb agreement in the two localization
entries: in uplink-magazine-127pen-desc replace "а так же" with "а также"; in
uplink-magazine-127emp-desc change "радио сигнала" to "радиосигнала" and make
the verbs agree by using a single form for both actions (e.g., change "наносят
повреждения мехам и отключает модули" to "наносят повреждения мехам и отключают
модули").
In
`@Resources/Prototypes/_Starlight/Entities/Objects/Weapons/Guns/Ammunition/charon_ammo.yml`:
- Line 1: В начале файла присутствует невидимый символ U+FEFF (BOM) перед первой
строкой "Starlight - M321-CHARYBDIS 'Thanatos' 280mm Railgun Ammunition", что
ломает YAML/grep-утилиты; откройте файл в редакторе/UTF‑8 утилитe и удалите BOM
(сохраните как UTF‑8 без BOM) так чтобы первый байт файла стал знак "#",
убедитесь, что больше нет U+FEFF в начале и пересохраните файл.
In `@Resources/Prototypes/_Sunrise/Entities/Structures/Shuttles/cannons.yml`:
- Line 45: В файле cannons.yml исправьте опечатку в полях description: замените
"autocanon" на правильное "autocannon" во всех вхождениях (в описании станции
тяжелого оружия и в других местах, где встречается та же строка — текущие
дубликаты наблюдаются в дополнительных description-записях), убедитесь, что ключ
description для соответствующих сущностей Shuttle/Cannons/Heavy использует
"autocannon".
---
Nitpick comments:
In `@Content.Client/_Starlight/Weapons/Gunnery/GunneryRadarControl.xaml.cs`:
- Around line 269-276: В Draw hot-path создаются новые Vector2[] каждый кадр
(см. массив radarVerts перед вызовом handle.DrawPrimitives и аналогичные массивы
для blip/cannon), что вызывает лишние heap-алокации; замените эти краткоживущие
массивы на stackalloc Span<Vector2> или на заранее выделяемые переиспользуемые
буферы и заполняйте их значениями через ScalePosition/вычисления, затем
передавайте Span/указатель в DrawPrimitives (или перегрузку, принимающую буфер)
чтобы исключить аллокации на GC; обновите все места, использующие inline new
Vector2[] (включая блоки, упомянутые для 521-555), чтобы использовать один из
этих подходов.
In `@Content.Server/_Starlight/Weapons/Gunnery/GunneryConsoleSystem.cs`:
- Around line 264-281: The current loop uses AllEntityQuery<RadarBlipComponent,
TransformComponent>() (blipQuery) every 0.25s which can be expensive when many
radar blips exist; change to a spatial or cached approach: replace the full scan
with a spatial query over the console's map coordinates (or maintain a
per-map/per-console cache of nearby blips) and only fetch RadarBlipComponent +
TransformComponent for entities returned by that spatial query, preserving the
same filtering (RequireInSpace, MapID, range check) and the creation of
RadarBlipData via GetNetCoordinates and navState.Blips.Add; alternatively
implement incremental updates to navState.Blips when blips spawn/move/destroy to
avoid repeated full scans.
- Around line 88-97: The loop over args.FiredProjectiles sets
Controller/SteeringTarget/Active on every GuidedProjectileComponent but keeps
overwriting consoleComp.TrackedGuidedProjectile, so only the last projectile is
shown; to fix, decide desired behavior and implement it: for single-tracking
behavior, after assigning guided.Controller = pending.Console and setting
consoleComp.TrackedGuidedProjectile = projectileUid inside the loop, add a break
to stop after the first GuidedProjectileComponent; for multi-tracking, change
consoleComp.TrackedGuidedProjectile (referenced as TrackedGuidedProjectile) from
a single EntityUid? to a collection (e.g., List<EntityUid>), initialize and
Add(projectileUid) when found, and update any UI/usage sites to iterate that
list instead of expecting a single UID. Ensure you update all references to
TrackedGuidedProjectile accordingly.
- Around line 170-173: Remove the unused LastFireTime and LastFireTargetPos
fields from the component declaration and eliminate their assignments
(comp.LastFireTime = _timing.CurTime; comp.LastFireTargetPos =
targetMapPos.Position) in GunneryConsoleSystem; also delete or rewrite the
preceding comment that refers to the nonexistent OnGuidedProjectileStartup and
instead note that _pendingFireContexts is used for projectile binding. Ensure
any fields, usings, or references to LastFireTime/LastFireTargetPos elsewhere
are removed or replaced so there are no dangling references.
In `@Resources/Locale/ru-RU/_strings/_sunrise/store/uplink-catalog.ftl`:
- Line 63: The string value for key uplink-magazine-15-desc needs punctuation
fixes: insert a comma after «патронов» and another comma before «таких как» to
improve readability, i.e. update the localized text for uplink-magazine-15-desc
accordingly.
In
`@Resources/Prototypes/_Starlight/Entities/Objects/Weapons/Guns/Ammunition/charon_ammo.yml`:
- Around line 51-61: Several ammo prototypes repeat the same component block
(Sprite/Appearance/SpentAmmoVisuals/StaticPrice with state: railgun_slug and
sprite _Starlight/Objects/Weapons/Guns/ArtilleryAmmo/charon_ammo.rsi); create
one or two intermediate abstract prototypes (e.g., CharOnSlugBase and
CharOnSubnuclearBase) that contain the shared components (Sprite with the common
sprite path, Appearance, SpentAmmoVisuals with state: railgun_slug and
suffix:false, and StaticPrice:2000) and then have the specific ammo prototypes
inherit from the appropriate abstract prototype instead of duplicating those
four component blocks (apply the same refactor to the other duplicated ranges
noted).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 5e2fef49-f0f5-4624-88d3-379f5d228a6d
⛔ Files ignored due to path filters (4)
Resources/Textures/_Starlight/Objects/Weapons/Guns/ArtilleryAmmo/charon_ammo.rsi/inhand-left.pngis excluded by!**/*.pngResources/Textures/_Starlight/Objects/Weapons/Guns/ArtilleryAmmo/charon_ammo.rsi/inhand-right.pngis excluded by!**/*.pngResources/Textures/_Starlight/Objects/Weapons/Guns/ArtilleryAmmo/charon_ammo.rsi/railgun_slug.pngis excluded by!**/*.pngResources/Textures/_Starlight/Objects/Weapons/Guns/ArtilleryAmmo/charon_ammo.rsi/subnuclear.pngis excluded by!**/*.png
📒 Files selected for processing (7)
Content.Client/_Starlight/Weapons/Gunnery/GunneryRadarControl.xaml.csContent.Server/_Starlight/Weapons/Gunnery/GunneryConsoleSystem.csResources/Locale/ru-RU/_strings/_sunrise/store/uplink-catalog.ftlResources/Prototypes/_Starlight/Entities/Objects/Weapons/Guns/Ammunition/charon_ammo.ymlResources/Prototypes/_Starlight/Entities/Objects/Weapons/Guns/Projectiles/charon_projectiles.ymlResources/Prototypes/_Sunrise/Entities/Structures/Shuttles/cannons.ymlResources/Textures/_Starlight/Objects/Weapons/Guns/ArtilleryAmmo/charon_ammo.rsi/meta.json
🚧 Files skipped from review as they are similar to previous changes (1)
- Resources/Prototypes/_Starlight/Entities/Objects/Weapons/Guns/Projectiles/charon_projectiles.yml
Content.Client/_Starlight/Weapons/Gunnery/GunneryRadarControl.xaml.cs
Outdated
Show resolved
Hide resolved
| _rmbHeld = true; | ||
| _cursorRelativePos = args.RelativePixelPosition; | ||
|
|
||
| if (_coordinates == null || _rotation == null) | ||
| return; | ||
|
|
||
| // RMB is used for guided-projectile steering when available. | ||
| if (_trackedGuidedProjectile != null) | ||
| return; | ||
|
|
||
| if (SelectedCannons.Count == 0) | ||
| return; | ||
|
|
||
| var worldPos = ScreenToWorld(args.RelativePixelPosition); | ||
| foreach (var selected in SelectedCannons) | ||
| OnFireStarted?.Invoke(selected, worldPos); | ||
|
|
||
| _fireHeld = true; |
There was a problem hiding this comment.
При удержании RMB прицел уезжает от фактической цели огня.
OnFireStarted получает цель только один раз на RMB-down, а дальше MouseMove двигает _cursorRelativePos лишь локально, и Draw уже рисует линии/крестик в новой точке. В результате оператор видит один азимут, а очередь уходит в другой. Либо шлите обновление цели во время _fireHeld, либо замораживайте локальный прицел до OnFireStopped.
Also applies to: 211-222, 383-401
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@Content.Client/_Starlight/Weapons/Gunnery/GunneryRadarControl.xaml.cs` around
lines 152 - 169, The fix is to keep the fired aim in sync while RMB is held: add
an OnFireUpdated event (same signature as OnFireStarted) and, in the MouseMove
handler, when _rmbHeld && _fireHeld && _trackedGuidedProjectile == null &&
SelectedCannons.Count > 0 compute worldPos =
ScreenToWorld(args.RelativePixelPosition) and invoke OnFireUpdated for each
selected cannon (instead of only updating _cursorRelativePos locally);
alternatively, if you prefer freezing the visual aim, stop updating
_cursorRelativePos while _fireHeld is true and only update it again on
OnFireStopped — reference symbols: _rmbHeld, _cursorRelativePos,
_trackedGuidedProjectile, SelectedCannons, OnFireStarted, _fireHeld, MouseMove,
Draw, OnFireStopped, and add OnFireUpdated if following the update approach.
| foreach (var cannon in _cannons) | ||
| { | ||
| var cannonCoords = EntManager.GetCoordinates(cannon.Coordinates); | ||
| var cannonMapCoords = _transform.ToMapCoordinates(cannonCoords); | ||
| if (cannonMapCoords.MapId != mapPos.MapId) | ||
| continue; | ||
|
|
||
| var cannonScreen = Vector2.Transform(cannonMapCoords.Position, blipWorldToView); | ||
| if ((clickRelativePos - cannonScreen).Length() <= CannonSelectRadius) | ||
| { | ||
| // Toggle: clicking a selected cannon deselects it; clicking | ||
| // an unselected cannon adds it to the selection. | ||
| if (!SelectedCannons.Remove(cannon.Entity)) | ||
| SelectedCannons.Add(cannon.Entity); | ||
| OnSelectionChanged?.Invoke(); | ||
| return true; | ||
| } |
There was a problem hiding this comment.
Клик выбирает первый blip в списке, а не ближайшее орудие.
При скученных или наложившихся ромбах попадание зависит от порядка _cannons, поэтому часть пушек на радаре станет практически невыбираемой. Здесь лучше сначала найти ближайший blip в радиусе CannonSelectRadius, а уже потом переключать selection.
💡 Вариант правки
- foreach (var cannon in _cannons)
+ CannonBlipData? closest = null;
+ var closestDistSq = CannonSelectRadius * CannonSelectRadius;
+
+ foreach (var cannon in _cannons)
{
var cannonCoords = EntManager.GetCoordinates(cannon.Coordinates);
var cannonMapCoords = _transform.ToMapCoordinates(cannonCoords);
if (cannonMapCoords.MapId != mapPos.MapId)
continue;
var cannonScreen = Vector2.Transform(cannonMapCoords.Position, blipWorldToView);
- if ((clickRelativePos - cannonScreen).Length() <= CannonSelectRadius)
- {
- // Toggle: clicking a selected cannon deselects it; clicking
- // an unselected cannon adds it to the selection.
- if (!SelectedCannons.Remove(cannon.Entity))
- SelectedCannons.Add(cannon.Entity);
- OnSelectionChanged?.Invoke();
- return true;
- }
+ var distSq = Vector2.DistanceSquared(clickRelativePos, cannonScreen);
+ if (distSq > closestDistSq)
+ continue;
+
+ closest = cannon;
+ closestDistSq = distSq;
}
- return false;
+ if (closest is not { } selected)
+ return false;
+
+ if (!SelectedCannons.Remove(selected.Entity))
+ SelectedCannons.Add(selected.Entity);
+
+ OnSelectionChanged?.Invoke();
+ return true;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@Content.Client/_Starlight/Weapons/Gunnery/GunneryRadarControl.xaml.cs` around
lines 497 - 513, The loop currently toggles the first cannon whose blip falls
within CannonSelectRadius, causing selection to depend on _cannons order;
instead, scan all entries to find the cannon with the minimum distance from
clickRelativePos (using cannonScreen computed via EntManager.GetCoordinates and
_transform.ToMapCoordinates and transformed by blipWorldToView) that is within
CannonSelectRadius, then perform the toggle (SelectedCannons.Remove /
SelectedCannons.Add) and invoke OnSelectionChanged only for that nearest cannon;
keep the existing map ID check (cannonMapCoords.MapId != mapPos.MapId) when
filtering candidates.
There was a problem hiding this comment.
Орудия можно выбирать из списка где указаны все орудия на гриде
There was a problem hiding this comment.
The PR description images show:
- Image 1 (Mass Scanner + event log): a dark radar UI titled “Консоль сканера массы” with green/orange outlines and labeled blips; right side shows admin/event log in red/yellow Russian text.
- Image 2 (Gunnery Console): ship outline with range rings; orange diamond targets; a right sidebar list with repeated “EXP‑…” items.
- Image 3 (Selecting a launcher): radar plus a right list of weapons (e.g., “BAL‑127‑4”, “CYERXA”, “Vanyk‑MK2”), a white target marker and an aim line.
- Image 4 (Cannons list): “CANNONS” sidebar showing multiple BAL entries; long yellow aim line to coordinates; small red debris dots.
- Image 5 (In‑world turrets + large radar): turrets on catwalks at left; expanded radar at right with orange diamond cannon blips and station/ship labels.
@coderabbit-user Принято. Да, выбор орудий через правый список покрывает кейс наложения ромбов на радаре, так что поиск “ближайшего blip’а” — это лишь необязательная доработка UX. Если оставляем текущее поведение, я снимаю замечание как опциональное улучшение. При желании, к нему можно вернуться позже — изменение локально в TrySelectCannonAt и не затрагивает логику списка/мультивыбора.
✏️ Learnings added
Learnt from: KaiserMaus
Repo: space-sunrise/sunrise-station PR: 4051
File: Content.Client/_Starlight/Weapons/Gunnery/GunneryRadarControl.xaml.cs:497-513
Timestamp: 2026-03-16T14:18:30.646Z
Learning: Repo: space-sunrise/sunrise-station, PR `#4051`. UX ганнерской консоли: основной способ выбора пушек — список в правой панели (CannonList в GunneryConsoleWindow). Клик по blip на радаре — вторичный путь; требование «выбирать ближайший blip» не обязательно. В будущих ревью по Content.Client/_Starlight/Weapons/Gunnery/GunneryRadarControl.xaml.cs относиться к этому как к опциональному улучшению.
Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
🧠 Learnings used
Learnt from: KaiserMaus
Repo: space-sunrise/sunrise-station PR: 3457
File: Resources/Prototypes/_Sunrise/Loadouts/loadout_groups.yml:149-156
Timestamp: 2025-12-16T13:19:00.147Z
Learning: В проекте space-sunrise/sunrise-station при будущих изменениях лоадаутов Офицера "Синий щит" (Blue Shield) нужно напомнить KaiserMaus о несогласованности в написании идентификаторов: используется как `Blueshield*` (например, BlueshieldGun, BlueshieldWT550, BlueshieldAsh12), так и `BlueShield*` (например, BlueShieldBackpack, BlueShieldJumpsuit) - желательно выровнять стиль для консистентности кодовой базы.
Learnt from: KaiserMaus
Repo: space-sunrise/sunrise-station PR: 2848
File: Resources/Prototypes/Entities/Objects/Weapons/Melee/cane.yml:104-104
Timestamp: 2025-08-19T00:15:41.765Z
Learning: В файле Resources/Prototypes/Entities/Objects/Weapons/Melee/cane.yml дробовик CaneShotgun функционирует корректно с родителем WeaponFlareGun, несмотря на кажущееся несоответствие типов боеприпасов - пользователь KaiserMaus подтвердил работоспособность.
Learnt from: KaiserMaus
Repo: space-sunrise/sunrise-station PR: 2505
File: Resources/Textures/_Sunrise/Structures/Machines/techfab.rsi/meta.json:1-38
Timestamp: 2025-07-01T06:20:11.598Z
Learning: User KaiserMaus prefers the current copyright format "made by EmoGarbage, centcomm state made by KaiserMaus" in sprite metadata files as it clearly indicates the division of work between contributors, rather than separating authors with semicolons or separate fields.
Learnt from: KaiserMaus
Repo: space-sunrise/sunrise-station PR: 2450
File: Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Magazines/shotgun.yml:165-178
Timestamp: 2025-06-25T23:53:22.255Z
Learning: User KaiserMaus prefers to use one sprite for uranium cartridge magazines in the Space Station 14 codebase, rather than having separate visual states for different uranium ammunition types (spread vs slug).
Learnt from: CR
Repo: space-sunrise/sunrise-station PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-28T19:01:35.992Z
Learning: Include changelog entries in PR descriptions for player-visible changes using the specified :cl: template, with messages written in Russian and author set to 'Copilot AI'
Learnt from: KaiserMaus
Repo: space-sunrise/sunrise-station PR: 3959
File: Resources/Prototypes/_Starlight/Entities/Objects/Deliveries/deliveries_items.yml:50-50
Timestamp: 2026-03-01T12:18:39.452Z
Learning: Repo: space-sunrise/sunrise-station, PR `#3959`. Ключ локализации "deliver-spam-dont-you-want-more" намеренно оставлен с опечаткой ("deliver-" вместо "delivery-") и используется согласованно:
- Resources/Locale/ru-RU/_Starlight/delivery/delivery-spam.ftl
- Resources/Locale/en-US/_Starlight/delivery/delivery-spam.ftl
- Resources/Prototypes/_Starlight/Entities/Objects/Deliveries/deliveries_items.yml (сущность MailSpamDontYouWantMore: поле Paper.content).
По решению пользователя KaiserMaus менять не требуется; в будущих ревью не предлагать переименование этого ключа, если он一致ен между YAML и FTL.
Learnt from: Alexnov33X
Repo: space-sunrise/sunrise-station PR: 2844
File: Resources/Prototypes/_Sunrise/Entities/Mobs/Cyborgs/borg_chassis.yml:416-475
Timestamp: 2025-09-01T17:04:27.713Z
Learning: В проекте space-sunrise/sunrise-station новые дереликт-борги имеют спрайты только в директории _Sunrise/Mobs/Silicon/chassis.rsi, а не в стандартной Mobs/Silicon/chassis.rsi. При review нужно следить за консистентностью путей спрайтов у новых боргов.
Learnt from: vinogradgarden
Repo: space-sunrise/sunrise-station PR: 2608
File: Resources/Locale/ru-RU/_prototypes/_sunrise/catalog/fills/books/general.ftl:1-4
Timestamp: 2025-07-20T23:44:35.442Z
Learning: В проекте sunrise-station пользователь vinogradgarden в рамках PR `#2608` проводил унификацию кавычек в файлах локализации, заменяя обычные кавычки " " на русские угловые кавычки « », не изменяя при этом содержание текста или логику именования сущностей.
Learnt from: kanopus952
Repo: space-sunrise/sunrise-station PR: 3973
File: Content.Server/_Sunrise/StationEvents/Components/ResearchPointVirusRuleComponent.cs:1-10
Timestamp: 2026-03-09T11:33:51.097Z
Learning: In C# projects using global using directives, attributes and types from Robust.Shared.Analyzers are accessible without per-file using statements when the corresponding global usings are configured (as in Content.Server/GlobalUsings.cs, Content.Shared/GlobalUsings.cs, Content.Client/GlobalUsings.cs). Do not add an explicit 'using Robust.Shared.Analyzers;' to individual files like Content.Server/_Sunrise/StationEvents/Components/ResearchPointVirusRuleComponent.cs unless a file outside the existing global usings context requires a separate import. Apply this guidance to all C# files; verify global usings cover the needed symbol in any new file.









Кратное описание
Порт три PRа в одном все части Starlight Naval Warfare 1-3
Адаптировал под метеориты, под наши снаряды а так же портировал пушки и снаряды со старлайт ( Только Админ абуз или маппинг )
По какой причине
Круто
Медиа(Видео/Скриншоты)
Changelog
🆑 ScarletLightweaverSS14, port: KaiserMaus
Summary by CodeRabbit
Новые функции
Балансировка