Skip to content

Расширение механики луков и добавление луков для сб#2474

Open
Firemixx wants to merge 41 commits intoAdventureTimeSS14:masterfrom
Firemixx:CompoundBow
Open

Расширение механики луков и добавление луков для сб#2474
Firemixx wants to merge 41 commits intoAdventureTimeSS14:masterfrom
Firemixx:CompoundBow

Conversation

@Firemixx
Copy link
Contributor

@Firemixx Firemixx commented Feb 8, 2026

Описание PR

  • Расширил механику луков. Теперь, чтобы выстрелить из лука, нужно ожидать пару секунд, а если подождать еще несколько секунд, то снаряд будет быстрее и будет бить острее при попадании
  • Добавил блочный лук за авторством discord: mateo_xilka(Tedden). Блочный лук, самодельный, натягивает тетеву быстрее обычного лука
  • Добавил СБ версию композитного (блочного) лука, натягивается тетева чуть быстрее блочного и имеет возможность добавить прицел и магнитную рельсу, крафтится на сбфабе и открывается с помощью технологии в СБ ветке
  • Добавил фабричные стрелы, которые не ломаются, крафтятся на сбфабе
  • Добавил стрелы, что очень ярко подсвечивают электроискрами цель и издают довольно громкий звук
  • (в этапе концепта) Добавил взрывные стрелы из фаркрая, рецепт - разрывная граната, нв провод, стрела
  • (Идея которая на этапе обдумываемой концепции) Добавил миниколчан для СБ и полноценный в свободном доступе для офицеров, различие в слоте, а именно пояс и спина, и количестве слотов для стрел

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

Возрождение луков, добавление луков для сб(ну бляха...существует же конская полиция! Может кому и понравится стрелять в преступников из лука в кк...)

В случае, если ваш pull request привязан к запросу из нашего discord сервера, используйте образец, представленный далее.

Ссылка на заказ, предложение или баг-репорт
Часть идей - мои, часть - discord: mateo_xilka(Tedden)

Техническая информация

Добавлен ExpendedBowsComponent и системы связанные с ним

  • Изменения были протестированы на локальном сервере, и всё работает отлично.
  • PR закончен и требует просмотра изменений.
  • Закончена расширенная механика луков
  • Сделана возможность настройки компонента для разных луков
  • Сделан самодельный блочный лук
  • Сделан СБ блочный лук
  • Сделаны разные стрелы

Медиа

Пока что нету

Чейнджлог

❗❗ УДАЛЯЙТЕ КОММЕНТЫ НИЖЕ И ПИШИТЕ no cl, no fun ЕСЛИ НИ ХОТИТЕ ЭТОГО В ЧЕЙНЖЛОГИ ❗❗

❗❗ НЕ МЕРДЖИТЬ ПОКА НЕ УДАЛИТЕ ❗❗

❗❗ ↓↓↓ ВОТ ЭТИ ↓↓↓ ❗❗

❗❗ ↑↑↑ УДАЛЯЙТЕ КОММЕНТЫ ↑↑↑ ❗❗

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 8, 2026

Walkthrough

Добавлены системы луков: Shared BowsSystem управляет прогрессией натяжения (подписки на GunShotEvent, UseInHandEvent, GunRefreshModifiersEvent), таймером в Update, показом попапов и изменением скорости снарядов. Серверный BowsSystem подписывается на ShotAttemptedEvent и отменяет выстрел при ExpendedBowsComponent.StepOfTension == 0. Добавлен сетевой компонент ExpendedBowsComponent с полями для звука, таймаута, уровней натяжения, модификаторов и строк локализации. Прототип лука обновлён для включения компонента. Добавлена русская локаль с четырьмя строками попапов.

Suggested labels

size/S

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed Заголовок четко отражает основное изменение PR — расширение механики луков и добавление вариантов для СБ.
Description check ✅ Passed The pull request description in Russian comprehensively describes the bow mechanics expansion, new bow types, arrow variants, and technical implementation details that align with the changeset.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 11

🤖 Fix all issues with AI agents
In `@Content.Server/ADT/BowsSystem/BowsSystem.cs`:
- Around line 14-27: Add XML summary comments for the BowsSystem class and its
event handler, rename the misspelled method OnShootAttemp to OnShootAttempt and
update the SubscribeLocalEvent call to reference OnShootAttempt so the handler
is wired correctly; inside the handler (method handling ShotAttemptedEvent for
ExpendedBowsComponent) after cancelling/processing the shot set
ExpendedBowsComponent.StepOfTension = 0 to reset tension so the player must
re-tension before next shot, and ensure the method signature matches the
SubscribeLocalEvent delegate (Entity<ExpendedBowsComponent> bow, ref
ShotAttemptedEvent args).
- Around line 1-10: Remove the unused and suspicious using directives at the top
of BowsSystem.cs (notably Microsoft.VisualBasic and the unused namespaces:
System.Diagnostics.CodeAnalysis, Content.Shared.Interaction.Events,
Content.Shared.Projectiles, Content.Shared.Weapons.Ranged.Components,
Content.Shared.Weapons.Ranged.Systems, Robust.Shared.Containers,
Robust.Shared.Utility), leaving only the namespaces actually referenced by the
BowsSystem class (e.g., Content.Shared.ADT.BowsSystem.Components,
Content.Shared.Weapons.Ranged.Events, Robust.Shared.* as required); then sort
the remaining using directives alphabetically to conform to the /ADT/ file
guideline.

In `@Content.Shared/ADT/BowsSystem/Components/ExpendedBowsComponent.cs`:
- Around line 9-19: The ExpendedBowsComponent has typo'd field names and an
unused field: rename public fields coldownStart -> CooldownStart and coldown ->
Cooldown (or consistently cooldownStart/cooldown if your style prefers
camelCase, but use the project naming convention), update any references to
these symbols (e.g., in BowsSystem / SharedBowsSystem) to the new names, and
remove the unused ItemSlot field entirely (ItemSlot) since ammo container is
taken from ContainerAmmoProviderComponent.Container; leave StepOfTension as-is.
- Around line 1-7: Уберите неиспользуемые директивы using (удалить
Robust.Shared.Prototypes и
Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype),
приведите оставшиеся импорты в алфавитный порядок и добавьте XML-документацию
/// <summary> над объявлением компонента ExpendedBowsComponent (класс
ExpendedBowsComponent) с кратким описанием его назначения; убедитесь, что
атрибуты [RegisterComponent, NetworkedComponent] остаются непосредственно над
объявлением класса.
- Around line 30-37: Rename the misspelled field TensionAnModieferSpeed to
TensionAndModifierSpeed in ExpendedBowsComponent (update the field declaration
and any DataField usage) and update every reference to this field in
SharedBowsSystem.cs (and any other callers) to the new name to keep code
compiling and consistent; ensure you update any serialized/reflective usage
(DataField names or string references) if present so serialization and lookups
continue to work.

In `@Content.Shared/ADT/BowsSystem/SharedBowsSystem.cs`:
- Line 16: The file declares the wrong namespace causing a type conflict: change
the namespace declaration in SharedBowsSystem.cs from
Content.Server.ADT.BowsSystem to Content.Shared.ADT.BowsSystem so the shared
sealed partial class BowsSystem has a distinct FQN; after that, verify the
server-side BowsSystem (in BowsSystem.cs) is not declared as a partial of the
shared class (remove or rename any partial modifier or matching definition) so
the two assemblies no longer declare the same fully-qualified type.
- Around line 58-80: In Update (in the loop over
EntityQueryEnumerator<ExpendedBowsComponent>) replace the early "return" after
the TryComp<WieldableComponent> check with "continue" so a non-wielded entity
skips only that iteration instead of aborting the whole loop; also remove the
magic "3" used in the comp.StepOfTension comparison and instead use a named
constant or derive the max tension from comp.TensionAndLoc (e.g. max index or
Count-1) when deciding whether to increment comp.StepOfTension and show the
_popup.PopupClient, and ensure comp.coldownStart is still set using
_timing.CurTime + comp.coldown.
- Around line 34-50: The early-return condition is inverted: change the
_containerSystem.TryGetContainer check in the block that follows
TryComp<ContainerAmmoProviderComponent>(bow, out var containerComp) to use
negation so the method returns when the container is NOT found (i.e. if
(!_containerSystem.TryGetContainer(..., out var container)) return;) so the
damage-modifying loop runs when a container is found; also extract the
hard-coded "Piercing" string used against proj.Damage.DamageDict into a named
constant (e.g., PiercingDamageType) and use that constant where you read and
write proj.Damage.DamageDict, keeping the multiplication logic that uses
bow.Comp.StepOfTension and ProjectileComponent/proj intact.
- Around line 1-14: Удалите неиспользуемые директивы using (System.Diagnostics,
System.Reflection.Metadata, System.Threading) и уберите инжектированную, но не
используемую зависимость _itemSlotsSystem
(поле/конструктор/[Dependency]-атрибут, связанный с ItemSlotsSystem) из
SharedBowsSystem; после удаления приведение списка using к алфавитному порядку.
Убедитесь, что ссылки на компоненты/методы не ломаются и удаляете только
упомянутые symbols: System.Reflection.Metadata, System.Diagnostics,
System.Threading и поле _itemSlotsSystem.

In `@Resources/Locale/ru-RU/ADT/bowsexpended/popups-bows-expended.flt`:
- Around line 1-4: В четырёх записях локали (ключи popup-bow-use-null,
popup-bow-use-light, popup-bow-use-medium, popup-bow-use-hard) допущена
орфографическая ошибка: слово «тетеву» нужно заменить на правильную форму
«тетиву» во всех строках; отредактируй значения соответствующих ключей, оставив
остальной текст без изменений.
- Around line 1-4: The file extension is wrong: rename popups-bows-expended.flt
to popups-bows-expended.ftl and ensure any references to this resource (e.g.,
resource include lists or localization registries that reference
"popups-bows-expended") are updated to the new filename so the engine will load
the Fluent entries like popup-bow-use-null, popup-bow-use-light,
popup-bow-use-medium, and popup-bow-use-hard.
🧹 Nitpick comments (1)
Content.Shared/ADT/BowsSystem/SharedBowsSystem.cs (1)

18-30: Отсутствует /// <summary> документация для класса и методов.

Класс BowsSystem и все его публичные методы (OnShoot, OnUseInHand, Update, EditSpeed) не имеют XML-документации. Также обработчики событий рекомендуется делать private.

♻️ Пример добавления документации
+/// <summary>
+/// Shared-система луков: управляет натяжением тетивы, модификацией урона и скорости снаряда.
+/// </summary>
 public sealed partial class BowsSystem : EntitySystem
 {
     ...
-    public void OnShoot(Entity<ExpendedBowsComponent> bow, ref GunShotEvent args)
+    /// <summary>
+    /// Модифицирует урон снаряда в зависимости от степени натяжения.
+    /// </summary>
+    private void OnShoot(Entity<ExpendedBowsComponent> bow, ref GunShotEvent args)

As per coding guidelines, предлагается /// <summary> документация к важным функциям и классам.

@github-actions github-actions bot added the Changes: Localization Изменение локализации label Feb 8, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In `@Content.Shared/ADT/BowsSystem/Components/ExpendedBowsComponent.cs`:
- Around line 37-39: The field name DamageToModidiering is a typo and the three
fields are not serializable; rename DamageToModidiering to a clear name like
DamageModifierType (or DamageToModifying if preferred) in the
ExpendedBowsComponent and add [DataField("...")] attributes to
DamageModifierType, MaxTension and MinTension so they are exposed to YAML
prototypes (use explicit keys like "damageModifierType", "maxTension",
"minTension"); update any usages of the old field name to the new identifier
throughout the codebase and ensure the default values remain the same.

In `@Content.Shared/ADT/BowsSystem/SharedBowsSystem.cs`:
- Around line 35-48: The loop currently uses "return" when a projectile's
DamageDict lacks the DamageToModidiering key, which prematurely exits the method
and prevents resetting bow.Comp.StepOfTension to bow.Comp.MinTension and stops
processing remaining container.ContainedEntities; change that "return" inside
the foreach (where TryComp<ProjectileComponent> yields proj and you check
proj.Damage.DamageDict.TryGetValue(...)) to "continue" so the loop skips only
the current projectile, allows other projectiles to be processed, and ensures
the final assignment bow.Comp.StepOfTension = bow.Comp.MinTension always runs.
- Around line 80-83: EditSpeed currently indexes TensionAndModieferSpeed
directly which can throw KeyNotFoundException; change it to use
dictionary.TryGetValue with a safe fallback (e.g. multiplier = 1.0f) and then
multiply args.ProjectileSpeed by that multiplier; also apply the same pattern
for the other dictionary access (TensionAndLoc at the other method/line 75) by
TryGetValue and using an appropriate fallback value so missing keys don’t crash
(refer to EditSpeed, TensionAndModieferSpeed, TensionAndLoc, and StepOfTension
to locate the spots).
🧹 Nitpick comments (1)
Content.Shared/ADT/BowsSystem/SharedBowsSystem.cs (1)

15-16: Отсутствует /// <summary> документация для класса BowsSystem.

♻️ Предлагаемое исправление
+/// <summary>
+/// Система управления механикой натяжения лука: прогрессия натяжения, модификация урона и скорости снаряда.
+/// </summary>
 public sealed partial class BowsSystem : EntitySystem

As per coding guidelines, предлагай /// summary документацию к важным классам.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In `@Content.Shared/ADT/BowsSystem/Components/ExpendedBowsComponent.cs`:
- Around line 16-21: The field coldownTime cannot be initialized from another
instance field (floatToColdown); change coldownTime into a computed property or
initialize it in the constructor instead. For example, replace the field
coldownTime with a read-only property (e.g., public TimeSpan coldownTime =>
TimeSpan.FromSeconds(floatToColdown)) or assign
TimeSpan.FromSeconds(floatToColdown) inside the class constructor so the value
is computed at runtime rather than in a field initializer; update any callers to
use the new property name if you rename it.

In `@Content.Shared/ADT/BowsSystem/SharedBowsSystem.cs`:
- Around line 51-54: The code references a non-existent/misspelled field
coldownTime on ExpendedBowsComponent; after fixing the component to expose a
valid member (e.g., property CooldownTime), update all usages in
SharedBowsSystem to use that corrected name. Specifically, in the OnUseInHand
method (and the other methods in the same class that read bow.Comp.coldownTime)
replace bow.Comp.coldownTime with bow.Comp.CooldownTime (and ensure casing
matches the new property), leaving bow.Comp.coldownStart assignment logic
intact.
- Around line 31-33: В блоке где используется
TryComp<ContainerAmmoProviderComponent> и затем обращаются к
containerComp.ProviderUid.Value перед вызовом _containerSystem.TryGetContainer —
добавьте проверку на null/HasValue для containerComp.ProviderUid и
выйдите/верните из метода если ProviderUid отсутствует; затем передавайте
гарантированное не-null значение (например через локальную переменную
providerUid) в _containerSystem.TryGetContainer вместо прямого обращения к
.Value, чтобы избежать возможного InvalidOperationException.
🧹 Nitpick comments (1)
Content.Shared/ADT/BowsSystem/SharedBowsSystem.cs (1)

15-15: Отсутствует /// <summary> документация на классе и методах.

Класс BowsSystem и его публичные методы (OnShoot, OnUseInHand, EditSpeed) не имеют XML-документации.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@Content.Shared/ADT/BowsSystem/SharedBowsSystem.cs`:
- Around line 74-76: In Update, the code references bow.Comp.floatToColdown but
no variable named bow exists; fix by fetching the bow component from the current
entity and using it (e.g., declare a local like var bowComp =
_entManager.GetComponent<BowComponent>(uid) or otherwise get the appropriate
component from wielded) and then replace bow.Comp.floatToColdown with
bowComp.floatToColdown (or the correct field on that retrieved component); keep
the rest of the logic using comp, uid, wielded and _timing unchanged.
🧹 Nitpick comments (1)
Content.Shared/ADT/BowsSystem/SharedBowsSystem.cs (1)

15-15: Отсутствует /// <summary> на классе BowsSystem.

Добавьте XML-документацию с описанием назначения системы.

♻️ Исправление
+/// <summary>
+/// Shared-система механики луков: управление натяжением тетивы, модификация скорости и урона снарядов.
+/// </summary>
 public sealed partial class BowsSystem : EntitySystem

As per coding guidelines, нужна /// <summary> документация к важным классам.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@Content.Shared/ADT/BowsSystem/Components/ExpendedBowsComponent.cs`:
- Around line 27-30: The XML doc comment for the field StepOfTension in
ExpendedBowsComponent is unprofessional; replace the current comment
"Aaa.....Step of tension in bow" with a concise, informative summary such as
"Step of tension in the bow" (or more detailed: "Current tension step for the
bow, used to determine draw strength and animation state"), ensure it uses
proper XML <summary> tags and clear English, and keep the field declaration
public int StepOfTension = 0 unchanged.

In `@Content.Shared/ADT/BowsSystem/SharedBowsSystem.cs`:
- Around line 60-62: Замените использование null-forgiving оператора на явную
проверку: возьмите локальную переменную user = wielded.User и, если она null,
безопасно выйдите/пропустите дальнейшую логику (или залогируйте и верните),
иначе используйте эту user в вызовах _popup.PopupClient(...) и
_audio.PlayPvs(...); измените места, где сейчас используется wielded.User!
(вызовы PopupClient и PlayPvs и/или связанные с comp.StepOfTension), чтобы
избежать возможного NullReferenceException.
🧹 Nitpick comments (2)
Content.Shared/ADT/BowsSystem/SharedBowsSystem.cs (2)

17-17: Отсутствует /// <summary> на классе BowsSystem.

♻️ Предлагаемое исправление
 namespace Content.Shared.ADT.BowsSystem;

+/// <summary>
+/// Shared-система управления механикой натяжения лука: прогрессия натяжения, кулдаун и модификация скорости снаряда.
+/// </summary>
 public sealed partial class BowsSystem : EntitySystem

As per coding guidelines, к важным классам нужна /// <summary> документация.


32-35: Методы-обработчики без /// <summary> и без private модификатора.

Обработчики событий (OnShoot, OnUseInHand, EditSpeed) объявлены как public, хотя используются только как callback-и внутри класса. Рекомендуется сделать их private и добавить краткую XML-документацию.

♻️ Пример
-    public void OnShoot(Entity<ExpendedBowsComponent> bow, ref GunShotEvent args)
+    /// <summary>
+    /// Сбрасывает натяжение лука после выстрела.
+    /// </summary>
+    private void OnShoot(Entity<ExpendedBowsComponent> bow, ref GunShotEvent args)
     {
-        bow.Comp.StepOfTension=bow.Comp.MinTension;
+        bow.Comp.StepOfTension = bow.Comp.MinTension;
     }

As per coding guidelines, к важным функциям нужна /// <summary> документация.

@github-actions github-actions bot added the Changes: Sprites Изменение спрайтов label Feb 10, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 10, 2026

RSI Diff Bot; head commit e6a8000 merging into 7352f69
This PR makes changes to 1 or more RSIs. Here is a summary of all changes:

Resources/Textures/ADT/Objects/Weapons/Guns/Bow/compound_bow_handmade.rsi

State Old New Status
equipped-BACKPACK Added
inhand-left Added
inhand-right Added
unwielded-arrow Added
unwielded Added
wielded-arrow Added
wielded-inhand-left Added
wielded-inhand-right Added
wielded Added

Resources/Textures/ADT/Objects/Weapons/Guns/Bow/compound_bow_security.rsi

State Old New Status
equipped-BACKPACK Added
inhand-left Added
inhand-right Added
unwielded-arrow Added
unwielded Added
wielded-arrow Added
wielded-inhand-left Added
wielded-inhand-right Added
wielded Added

Resources/Textures/ADT/Objects/Weapons/Guns/Projectiles/arrows_custom.rsi

State Old New Status
grenade Added

Resources/Textures/Objects/Weapons/Guns/Projectiles/arrows.rsi

State Old New Status
icon_craft Added

Edit: diff updated after e6a8000

@github-actions
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@Firemixx
Copy link
Contributor Author

Firemixx commented Mar 7, 2026

@coderabbitai resume

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 7, 2026

✅ Actions performed

Reviews resumed.

@Firemixx
Copy link
Contributor Author

Firemixx commented Mar 7, 2026

@coderabbitai глянь код пожалуйста

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 7, 2026

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

@Firemixx, сейчас посмотрю код!


🏁 Script executed:

#!/bin/bash
echo "=== Server BowsSystem ==="
fd "BowsSystem.cs" --full-path | grep -i server | xargs cat

echo "=== Shared BowsSystem ==="
fd "SharedBowsSystem.cs" | xargs cat

echo "=== ExpendedBowsComponent ==="
fd "ExpendedBowsComponent.cs" | xargs cat

echo "=== bow.yml ==="
fd "bow.yml" | xargs cat

echo "=== FTL locale ==="
fd "popups-bows-expended.ftl" | xargs cat

Length of output: 10834


@Firemixx, посмотрел код — нашёл несколько проблем разной степени серьёзности:


🔴 Критическая ошибка

SharedBowsSystem.csreturn вместо continue в цикле Update:

if (wieldedcomp.User is not {} owner)
    return; // ← ОШИБКА! Прерывает весь цикл Update

Если у любого лука в мире нет активного пользователя — цикл полностью прерывается, и все следующие луки в энумераторе не обновляются. Нужно:

if (wieldedcomp.User is not {} owner)
    continue; // ← правильно

🟠 Серьёзные проблемы

1. Ключевые поля без [DataField] — YAML-конфигурация невозможна

В ExpendedBowsComponent поля StepOfTension, MaxTension, MinTension, TensionAndLoc, TensionAndModieferSpeed, DamageToModifying, ItemSlot не имеют атрибута [DataField]. Это значит, что для блочного лука СБ (который должен натягиваться быстрее) нельзя задать другие значения через YAML — придётся дублировать С# код.

// Так должно быть:
[DataField]
public int MaxTension = 3;

[DataField]
public int MinTension = 0;

[DataField]
public float floatToColdown = 7f; // уже есть DataField, но остальные — нет

[DataField]
public Dictionary<int, float> TensionAndModieferSpeed = new() { ... };

2. [NetworkedComponent] без [AutoNetworkedField]

ExpendedBowsComponent помечен [NetworkedComponent], но ни одно поле не имеет [AutoNetworkedField]. Это значит что StepOfTension не реплицируется на клиент — анимации, визуальные эффекты и клиентская часть не узнают о текущем натяжении.

[AutoNetworkedField]
public int StepOfTension = 0;

3. Изменение урона не реализовано

В PR описании указано, что большее натяжение = больший урон. Поле DamageToModifying объявлено, но нигде не используется. EditSpeed модифицирует только ProjectileSpeed. Логика урона отсутствует.


🟡 Средние проблемы

4. coldownStart по умолчанию TimeSpan.Zero — немедленное натяжение при подъёме

public TimeSpan coldownStart = TimeSpan.Zero;

_timing.CurTime всегда больше нуля в запущенной игре, поэтому сразу после взятия и вилдинга лука натяжение начнёт накапливаться без нажатия UseInHand. Возможно, стоит использовать TimeSpan.MaxValue как значение по умолчанию («ещё не начато»), или добавить флаг bool IsDrawing.

5. GunRefreshModifiersEvent не вызывается после изменения StepOfTension

После изменения натяжения в Update модификатор скорости не пересчитывается до следующего события обновления пушки. Стоит явно вызывать RefreshModifiers:

comp.StepOfTension++;
// ...
// если есть Gun-компонент — вызвать рефреш
if (TryComp<GunComponent>(uid, out var gun))
    gun.RefreshModifiers(); // или через систему

🔵 Мелкие замечания

6. Опечатки в именах

Было Должно быть
coldownStart cooldownStart
floatToColdown cooldownDuration / tensionInterval
TensionAndModieferSpeed TensionAndModifierSpeed
OnShootAttemp OnShootAttempt

7. Обработчики событий должны быть private

// Было:
public void OnShoot(...) { }
public void OnUseInHand(...) { }
public void EditSpeed(...) { }

// Должно быть:
private void OnShoot(...) { }
private void OnUseInHand(...) { }
private void EditSpeed(...) { }

8. Неиспользуемые поля

  • ItemSlot — объявлен, но нигде не используется в системах
  • DamageToModifying — аналогично

9. Форматирование

// Были пропуски вокруг операторов:
if(bow.Comp.StepOfTension==0)
bow.Comp.StepOfTension=bow.Comp.MinTension;

// Должно быть:
if (bow.Comp.StepOfTension == 0)
bow.Comp.StepOfTension = bow.Comp.MinTension;

Итог: Критически важно исправить return → continue и добавить [DataField] на ключевые поля (иначе разные типы луков через YAML не настроить). Остальное — существенно для корректной работы, но менее срочно.


🧠 Learnings used
Learnt from: BitBoxxxer
Repo: AdventureTimeSS14/space_station_ADT PR: 0
File: :0-0
Timestamp: 2024-11-14T19:41:52.431Z
Learning: В этом репозитории автоматические обзоры отключены, и пользователь предпочитает также отключить статусные сообщения от CodeRabbit, установив `reviews.review_status` в `false` в файле `.coderabbit.yaml`.

Learnt from: Schrodinger71
Repo: AdventureTimeSS14/space_station_ADT PR: 0
File: :0-0
Timestamp: 2026-02-24T07:56:31.049Z
Learning: В проекте AdventureTimeSS14/space_station_ADT CodeRabbit не должен approve-ать pull request пока ВСЕ его review комментарии не решены и весь функционал полностью завершён, даже если пользователь явно просит об approve. Пользователь Schrodinger71 указал, что approval должен означать готовность к мёрджу без оговорок.

@github-actions
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Changes: Localization Изменение локализации Changes: Sprites Изменение спрайтов S: Untriaged size/M Status: Needs Review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant