[ADD] Zombie tweak and Add#2579
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughДобавлены клиентская и серверная реализации системы прыжка зомби. Клиентская система переопределяет TryStunAndKnockdown в пустую реализацию. Серверная система реализует выполнение прыжка, применение физики, воспроизведение звука и логику оглушения/подавления при столкновении; подписывается на события и управляет ActiveZombieLeaperComponent. Введены компоненты ZombieJumpComponent и ActiveZombieLeaperComponent, HTN-оператор ZombieJumpAttackOperator и предусловия ZombieJumpCooldownPrecondition, ZombieJumpRangePrecondition. Обновлён PendingZombieComponent (поля для неизбежного заражения), добавлены прототипы действий и локализации для ActionZombieJump. Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 8
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
Content.Server/Zombies/ZombieSystem.Transform.cs (1)
22-22:⚠️ Potential issue | 🟡 MinorДублирующийся using.
Строка
using Content.Shared.CombatMode.Pacification;дублируется (уже присутствует на строке 18).Исправление
using Content.Shared.Hands.EntitySystems; -using Content.Shared.CombatMode.Pacification; using Content.Shared.Humanoid;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Server/Zombies/ZombieSystem.Transform.cs` at line 22, Удалите дублирующую директиву using для пространства имен Content.Shared.CombatMode.Pacification: найдите повторяющуюся строку "using Content.Shared.CombatMode.Pacification;" (она дублируется — уже есть другая такая строка) и удалите одну из них, оставив только одну декларацию.
🧹 Nitpick comments (11)
Content.Server/Zombies/ZombieSystem.Transform.cs (1)
283-286: Комментарий на русском языке в коде.Строка 285 содержит комментарий на русском языке. Комментарии в коде должны быть на английском языке для единообразия кодовой базы.
Предлагаемое исправление
htn.RootTask = new HTNCompoundTask() { Task = "ZombieHostileCompound" }; htn.Blackboard.SetValue(NPCBlackboard.Owner, target); - // Добавляем дальность прыжка для HTN + // ADT-Tweak: Set jump range for HTN preconditions htn.Blackboard.SetValue("JumpRange", zombiecomp.JumpDistance);🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Server/Zombies/ZombieSystem.Transform.cs` around lines 283 - 286, Translate or replace the Russian inline comment on the line above the JumpRange assignment with an English comment; specifically update the comment near htn.Blackboard.SetValue("JumpRange", zombiecomp.JumpDistance) (and any adjacent comment referencing jump distance for HTN) to an English phrase such as "Add jump range to HTN" so code comments remain consistent across the codebase.Content.Shared/ADT/ZombieJump/ActiveZombieLeaperComponent.cs (1)
5-9: Рекомендуется добавить XML-документацию.Для компонента и его поля рекомендуется добавить XML-комментарии, объясняющие назначение.
📝 Предлагаемое изменение
+/// <summary> +/// Компонент, маркирующий активного зомби-прыгуна в процессе прыжка. +/// </summary> [RegisterComponent, NetworkedComponent, AutoGenerateComponentState] public sealed partial class ActiveZombieLeaperComponent : Component { + /// <summary> + /// Длительность нокдауна, применяемого к цели при столкновении. + /// </summary> [DataField, AutoNetworkedField] public TimeSpan KnockdownDuration; }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Shared/ADT/ZombieJump/ActiveZombieLeaperComponent.cs` around lines 5 - 9, Добавьте XML-документацию для компонента ActiveZombieLeaperComponent и его поля KnockdownDuration: над объявлением класса ActiveZombieLeaperComponent добавьте краткое описание назначения компонента (что он представляет/управляет), и над поле KnockdownDuration укажите, что это время оглушения/падения (указать единицы — TimeSpan) и любое поведение/ограничения (напр., минимальное/максимальное значение или как используется). Используйте стандартные /// <summary>…</summary> и при необходимости <remarks> для дополнительных деталей.Content.Shared/ADT/ZombieJump/ZombieJumpComponent.cs (1)
9-36: Рекомендуется добавить XML-документацию.Для компонента и его полей рекомендуется добавить XML-комментарии, объясняющие назначение каждого параметра.
📝 Пример документации
+/// <summary> +/// Компонент, определяющий параметры прыжка зомби. +/// </summary> [RegisterComponent, NetworkedComponent, AutoGenerateComponentState] [Access(typeof(SharedZombieJumpSystem), Other = AccessPermissions.ReadWrite)] public sealed partial class ZombieJumpComponent : Component { + /// <summary> + /// Прототип экшена прыжка. + /// </summary> [DataField, AutoNetworkedField] public EntProtoId Action = "ActionZombieJump";🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Shared/ADT/ZombieJump/ZombieJumpComponent.cs` around lines 9 - 36, Добавьте XML-документацию для компонента ZombieJumpComponent и всех его публичных полей (Action, ActionEntity, JumpDistance, JumpThrowSpeed, CollideKnockdown, JumpSound, JumpFailedPopup, NextJumpTime): кратко опишите назначение компонента и роль каждого поля (например что хранит Action / ActionEntity, единицы измерения и влияние JumpDistance/JumpThrowSpeed, что делает CollideKnockdown, когда воспроизводится JumpSound, что означает JumpFailedPopup и как используется NextJumpTime), поместите комментарии непосредственно над объявлением класса и над каждым полем в том же файле.Resources/Prototypes/ADT/NPCs/Combat/zombie.yml (1)
23-29: Дублирование значения cooldown.Значение
cooldown: 10указано и вZombieJumpCooldownPrecondition(строка 24), и вZombieJumpAttackOperator(строка 29). Если одно значение изменится, а другое — нет, поведение станет непоследовательным. Рекомендуется вынести это значение в отдельную переменную или использовать единый источник правды.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Resources/Prototypes/ADT/NPCs/Combat/zombie.yml` around lines 23 - 29, В файле есть дублирование значения cooldown: оно задано в ZombieJumpCooldownPrecondition и повторно в ZombieJumpAttackOperator; исправьте это, вынеся значение в единый источник правды (например общую переменную/параметр JumpCooldown или глобальный параметр задачи) и замените оба прямых литерала на ссылку на этот параметр, либо удалите cooldown из оператора и сделайте так, чтобы ZombieJumpAttackOperator брало значение из ZombieJumpCooldownPrecondition (или общего контекста), чтобы оба места использовали одно и то же имя/переменную (сохраните ссылки на ZombieJumpCooldownPrecondition, ZombieJumpAttackOperator и поле cooldown при правке).Content.Server/ADT/ZombieJump/Preconditions/ZombieJumpCooldownPrecondition.cs (2)
33-36: Пустой catch скрывает возможные ошибки.Пустой блок
catchбез логирования может скрыть неожиданные исключения. Рекомендуется добавить логирование для отладки.🔍 Предлагаемое изменение
catch { + // TODO: Добавить логирование для отладки return true; }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Server/ADT/ZombieJump/Preconditions/ZombieJumpCooldownPrecondition.cs` around lines 33 - 36, The empty catch in ZombieJumpCooldownPrecondition (inside the method that checks cooldowns) swallows exceptions; change it to catch(Exception ex) and log the exception with the class/method logger (e.g., _logger or the ambient logger used in ZombieJumpCooldownPrecondition) including ex.Message/stack, then preserve the current return value (return true) so behavior doesn't change while ensuring errors are recorded for debugging.
16-19: Пустой метод Initialize можно удалить.Метод
Initializeтолько вызывает базовую реализацию и не добавляет никакой логики. Его можно безопасно удалить.♻️ Предлагаемое изменение
- public override void Initialize(IEntitySystemManager sysManager) - { - base.Initialize(sysManager); - } - public override bool IsMet(NPCBlackboard blackboard)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Server/ADT/ZombieJump/Preconditions/ZombieJumpCooldownPrecondition.cs` around lines 16 - 19, The override of Initialize in class ZombieJumpCooldownPrecondition is redundant because it only calls base.Initialize(sysManager); remove the empty override method (Initialize) from ZombieJumpCooldownPrecondition so the base class implementation is used directly; ensure no other code references this override and run a build to confirm no unused symbol warnings remain.Content.Client/ADT/ZombieJump/ZombieJumpSystem.cs (1)
4-9: Рекомендуется добавить XML-документацию для класса.Для улучшения читаемости и понимания назначения системы рекомендуется добавить XML-комментарий.
📝 Предлагаемое изменение
namespace Content.Client.ADT.ZombieJump; + +/// <summary> +/// Клиентская реализация системы прыжка зомби. +/// Переопределяет серверную логику оглушения, чтобы не выполнять её на клиенте. +/// </summary> public sealed partial class ZombieJumpSystem : SharedZombieJumpSystem { protected override void TryStunAndKnockdown(EntityUid uid, TimeSpan duration) { // На клиенте ничего не делаем } }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Client/ADT/ZombieJump/ZombieJumpSystem.cs` around lines 4 - 9, Добавить XML-документацию для класса ZombieJumpSystem, описав его назначение (клиентская часть системы прыжка зомби) и поведение переопределённого метода TryStunAndKnockdown (на клиенте не выполняет оглушение/сбивание). Поместите <summary> с кратким описанием над объявлением sealed partial class ZombieJumpSystem и, по желанию, <remarks> с указанием причины, почему TryStunAndKnockdown оставлен пустым на клиенте, чтобы улучшить читаемость и поддержку кода.Content.Server/ADT/ZombieJump/Preconditions/ZombieJumpRangePrecondition.cs (1)
40-43: Пустой catch скрывает возможные ошибки.Аналогично
ZombieJumpCooldownPrecondition, пустой блокcatchможет скрыть неожиданные исключения.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Server/ADT/ZombieJump/Preconditions/ZombieJumpRangePrecondition.cs` around lines 40 - 43, В блоке с пустым catch в классе ZombieJumpRangePrecondition замените молчаливое подавление исключений на явную обработку: поймайте конкретные ожидаемые исключения или поймайте Exception как ex и залогируйте (например через Logger.Warning/Error или соответствующий серверный логгер) с контекстом, затем верните false; аналогично приведите поведение в соответствие с ZombieJumpCooldownPrecondition — не используйте пустой catch, либо пробросьте ненадёжные исключения дальше, если они не являются ожидаемыми.Content.Server/ADT/ZombieJump/Operators/ZombieJumpAttackOperator.cs (2)
27-28: Неиспользуемое поле Cooldown.Поле
Cooldownобъявлено, но не используется в логике оператора. Кулдаун записывается и проверяется черезLastJumpTimeв blackboard. Если поле не планируется использовать, его следует удалить.♻️ Предлагаемое изменение
[DataField("targetKey", required: true)] public string TargetKey = default!; - [DataField("cooldown")] - public float Cooldown = 10f; - private ZombieJumpSystem _jumpSystem = default!;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Server/ADT/ZombieJump/Operators/ZombieJumpAttackOperator.cs` around lines 27 - 28, The public field Cooldown in ZombieJumpAttackOperator.cs is unused (cooldown is managed via LastJumpTime on the blackboard); either remove the Cooldown field declaration entirely or modify the operator logic to actually use it by referencing Cooldown when writing/reading the blackboard LastJumpTime check/set in ZombieJumpAttackOperator (so the jump permission check uses Cooldown instead of a hardcoded value).
1-17: Неиспользуемые директивы using.Следующие директивы
usingне используются в файле и могут быть удалены:
Content.Server.ADT.ZombieJump.Preconditions(строка 4)Content.Server.NPC.Components(строка 6)Content.Shared.Zombies(строка 12)Robust.Shared.Physics.Components(строка 15)♻️ Предлагаемое изменение
using System.Threading; using System.Threading.Tasks; using Content.Server.ADT.ZombieJump; -using Content.Server.ADT.ZombieJump.Preconditions; using Content.Server.NPC; -using Content.Server.NPC.Components; using Content.Server.NPC.HTN; using Content.Server.NPC.HTN.PrimitiveTasks; using Content.Shared.ADT.ZombieJump; using Content.Shared.Mobs; using Content.Shared.Mobs.Components; -using Content.Shared.Zombies; using Robust.Shared.GameObjects; using Robust.Shared.Map; -using Robust.Shared.Physics.Components; using Robust.Shared.Timing;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Server/ADT/ZombieJump/Operators/ZombieJumpAttackOperator.cs` around lines 1 - 17, В файле ZombieJumpAttackOperator.cs удалите ненужные директивы using: Content.Server.ADT.ZombieJump.Preconditions, Content.Server.NPC.Components, Content.Shared.Zombies и Robust.Shared.Physics.Components; откройте класс ZombieJumpAttackOperator и удалите только эти упомянутые строки using, убедившись, что никакие типы из них не используются в методах/полях (если используются — замените на корректные ссылки), затем пересоберите/запустите анализатор, чтобы подтвердить отсутствие ошибок.Content.Shared/ADT/ZombieJump/SharedZombieJumpSystem.cs (1)
14-15: Добавьте/// summaryдля класса и ключевых методов системы.Для базовой shared-системы с переопределяемым поведением это заметно улучшит читаемость и снизит риск неверного использования API.
As per coding guidelines "и предлагай /// summary документацию к C# коду, к важным функциям или классам".
Also applies to: 69-95
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Shared/ADT/ZombieJump/SharedZombieJumpSystem.cs` around lines 14 - 15, Добавьте XML-документацию /// <summary> для класса SharedZombieJumpSystem и всех ключевых публичных/защищённых методов в этом файле (особенно для переопределяемого поведения и методов, которые формируют API системы), кратко описав назначение класса и что делает каждый метод; для методов укажите также параметры (/// <param>) и возвращаемые значения (/// <returns>) и упомяните возможные исключения/предусловия, чтобы повысить читаемость и уменьшить риск неверного использования API.
🤖 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.Server/ADT/ZombieJump/Operators/ZombieJumpAttackOperator.cs`:
- Around line 74-76: The calls to _entManager.GetComponent in
ZombieJumpAttackOperator (variables ownerXform and targetXform) can throw if the
TransformComponent is missing; replace with _entManager.TryGetComponent for both
owner and target (use the same owner from
blackboard.GetValue<EntityUid>(NPCBlackboard.Owner) and the target variable),
check the boolean result and handle the missing-component case by aborting the
attack path (returning failure/false or logging and exiting the method) so you
never dereference a null TransformComponent.
In `@Content.Server/ADT/ZombieJump/Preconditions/ZombieJumpRangePrecondition.cs`:
- Around line 37-38: The code silently treats a missing/mismatched RangeKey as
zero and swallows exceptions; update the logic in ZombieJumpRangePrecondition
(the block using blackboard.GetValueOrDefault<float>(RangeKey, _entManager) and
calling _transformSystem.InRange) to validate the retrieved jumpRange is
positive before calling InRange (e.g., if jumpRange <= 0 then log a
warning/error referencing RangeKey and return false), and remove the empty catch
block to either log the caught exception (including exception message and stack)
or rethrow only unexpected exceptions so errors are not silently ignored.
In `@Content.Server/ADT/ZombieJump/ZombieJumpSystem.cs`:
- Around line 22-43: ExecuteJump currently omits the same weightlessness check
and sound playback that SharedZombieJumpSystem.OnZombieJump performs, causing
inconsistent jump behavior when invoked from ZombieJumpAttackOperator; update
ExecuteJump to perform the same "is weightless" check used in
SharedZombieJumpSystem.OnZombieJump and to invoke the same jump sound playback
(or delegate to SharedZombieJumpSystem.OnZombieJump) before proceeding with
unanchoring/throwing so HTN- and action-driven jumps behave identically.
In `@Content.Server/Zombies/ZombieSystem.cs`:
- Around line 131-150: The code shows infection warning popups twice because the
same popup logic using comp.RomerolInfection, comp.GracePeriod,
_random.Prob(comp.InfectionWarningChance) and _popup.PopupEntity(...) appears
both before and after the GracePeriod check; remove the duplicate by keeping a
single popup call: either keep the popup inside the ADT-Tweak block where
TimeUntilInevitable is decremented (and skip the later one), or remove the
ADT-Tweak popup and keep the original post-GracePeriod logic, ensuring only one
invocation of
_popup.PopupEntity(Loc.GetString(_random.Pick(comp.InfectionWarnings)), uid,
uid) per tick and that ZombifyEntity(uid) remains triggered when
comp.TimeUntilInevitable <= TimeSpan.Zero.
In `@Content.Shared/ADT/ZombieJump/SharedZombieJumpSystem.cs`:
- Around line 71-76: В ветке, где Gravity.IsWeightless(args.Performer) истинно,
событие показывается через Popup.PopupClient но не помечается обработанным;
установите args.Handled = true перед return, чтобы предотвратить дальнейшую
обработку (в методе SharedZombieJumpSystem, где проверяется
Gravity.IsWeightless(args.Performer) и показывается entity.Comp.JumpFailedPopup
для args.Performer).
In `@Content.Shared/ADT/ZombieJump/ZombieJumpComponent.cs`:
- Around line 1-5: Переупорядочить директивы using в файле
ZombieJumpComponent.cs в алфавитном порядке: переместить using
Robust.Shared.Prototypes так, чтобы он стоял перед using
Robust.Shared.Serialization.TypeSerializers.Implementations.Custom (и убедиться,
что все остальные using также следуют алфавитному порядку), затем сохранить
файл.
In `@Content.Shared/EntityEffects/Effects/ZombieEntityEffectsSystem.cs`:
- Around line 38-42: Fix the typo in the closing comment for the ADT-Tweak
block: change the comment text "// ADT-Tweak emd" to "// ADT-Tweak end"
surrounding the check that uses TryComp<PendingZombieComponent> and
pendingComp.TimeUntilInevitable in ZombieEntityEffectsSystem (the block that
returns when TimeUntilInevitable <= TimeSpan.Zero).
In `@Content.Shared/Zombies/PendingZombieComponent.cs`:
- Around line 51-69: Поле TimeUntilInevitable в PendingZombieComponent
используется как обратный счётчик (инициализируется из
InevitableZombificationTime и уменьшается по тикам), поэтому удалите указание
customTypeSerializer:typeof(TimeOffsetSerializer) из атрибута
[DataField("timeUntilInevitable", ...)] и оставьте просто
[DataField("timeUntilInevitable")] чтобы использовать стандартную сериализацию
для TimeSpan; не меняйте имя поля или семантику и убедитесь, что
загрузка/сохранение теперь оперирует обычным TimeSpan, а не
TimeOffsetSerializer.
---
Outside diff comments:
In `@Content.Server/Zombies/ZombieSystem.Transform.cs`:
- Line 22: Удалите дублирующую директиву using для пространства имен
Content.Shared.CombatMode.Pacification: найдите повторяющуюся строку "using
Content.Shared.CombatMode.Pacification;" (она дублируется — уже есть другая
такая строка) и удалите одну из них, оставив только одну декларацию.
---
Nitpick comments:
In `@Content.Client/ADT/ZombieJump/ZombieJumpSystem.cs`:
- Around line 4-9: Добавить XML-документацию для класса ZombieJumpSystem, описав
его назначение (клиентская часть системы прыжка зомби) и поведение
переопределённого метода TryStunAndKnockdown (на клиенте не выполняет
оглушение/сбивание). Поместите <summary> с кратким описанием над объявлением
sealed partial class ZombieJumpSystem и, по желанию, <remarks> с указанием
причины, почему TryStunAndKnockdown оставлен пустым на клиенте, чтобы улучшить
читаемость и поддержку кода.
In `@Content.Server/ADT/ZombieJump/Operators/ZombieJumpAttackOperator.cs`:
- Around line 27-28: The public field Cooldown in ZombieJumpAttackOperator.cs is
unused (cooldown is managed via LastJumpTime on the blackboard); either remove
the Cooldown field declaration entirely or modify the operator logic to actually
use it by referencing Cooldown when writing/reading the blackboard LastJumpTime
check/set in ZombieJumpAttackOperator (so the jump permission check uses
Cooldown instead of a hardcoded value).
- Around line 1-17: В файле ZombieJumpAttackOperator.cs удалите ненужные
директивы using: Content.Server.ADT.ZombieJump.Preconditions,
Content.Server.NPC.Components, Content.Shared.Zombies и
Robust.Shared.Physics.Components; откройте класс ZombieJumpAttackOperator и
удалите только эти упомянутые строки using, убедившись, что никакие типы из них
не используются в методах/полях (если используются — замените на корректные
ссылки), затем пересоберите/запустите анализатор, чтобы подтвердить отсутствие
ошибок.
In
`@Content.Server/ADT/ZombieJump/Preconditions/ZombieJumpCooldownPrecondition.cs`:
- Around line 33-36: The empty catch in ZombieJumpCooldownPrecondition (inside
the method that checks cooldowns) swallows exceptions; change it to
catch(Exception ex) and log the exception with the class/method logger (e.g.,
_logger or the ambient logger used in ZombieJumpCooldownPrecondition) including
ex.Message/stack, then preserve the current return value (return true) so
behavior doesn't change while ensuring errors are recorded for debugging.
- Around line 16-19: The override of Initialize in class
ZombieJumpCooldownPrecondition is redundant because it only calls
base.Initialize(sysManager); remove the empty override method (Initialize) from
ZombieJumpCooldownPrecondition so the base class implementation is used
directly; ensure no other code references this override and run a build to
confirm no unused symbol warnings remain.
In `@Content.Server/ADT/ZombieJump/Preconditions/ZombieJumpRangePrecondition.cs`:
- Around line 40-43: В блоке с пустым catch в классе ZombieJumpRangePrecondition
замените молчаливое подавление исключений на явную обработку: поймайте
конкретные ожидаемые исключения или поймайте Exception как ex и залогируйте
(например через Logger.Warning/Error или соответствующий серверный логгер) с
контекстом, затем верните false; аналогично приведите поведение в соответствие с
ZombieJumpCooldownPrecondition — не используйте пустой catch, либо пробросьте
ненадёжные исключения дальше, если они не являются ожидаемыми.
In `@Content.Server/Zombies/ZombieSystem.Transform.cs`:
- Around line 283-286: Translate or replace the Russian inline comment on the
line above the JumpRange assignment with an English comment; specifically update
the comment near htn.Blackboard.SetValue("JumpRange", zombiecomp.JumpDistance)
(and any adjacent comment referencing jump distance for HTN) to an English
phrase such as "Add jump range to HTN" so code comments remain consistent across
the codebase.
In `@Content.Shared/ADT/ZombieJump/ActiveZombieLeaperComponent.cs`:
- Around line 5-9: Добавьте XML-документацию для компонента
ActiveZombieLeaperComponent и его поля KnockdownDuration: над объявлением класса
ActiveZombieLeaperComponent добавьте краткое описание назначения компонента (что
он представляет/управляет), и над поле KnockdownDuration укажите, что это время
оглушения/падения (указать единицы — TimeSpan) и любое поведение/ограничения
(напр., минимальное/максимальное значение или как используется). Используйте
стандартные /// <summary>…</summary> и при необходимости <remarks> для
дополнительных деталей.
In `@Content.Shared/ADT/ZombieJump/SharedZombieJumpSystem.cs`:
- Around line 14-15: Добавьте XML-документацию /// <summary> для класса
SharedZombieJumpSystem и всех ключевых публичных/защищённых методов в этом файле
(особенно для переопределяемого поведения и методов, которые формируют API
системы), кратко описав назначение класса и что делает каждый метод; для методов
укажите также параметры (/// <param>) и возвращаемые значения (/// <returns>) и
упомяните возможные исключения/предусловия, чтобы повысить читаемость и
уменьшить риск неверного использования API.
In `@Content.Shared/ADT/ZombieJump/ZombieJumpComponent.cs`:
- Around line 9-36: Добавьте XML-документацию для компонента ZombieJumpComponent
и всех его публичных полей (Action, ActionEntity, JumpDistance, JumpThrowSpeed,
CollideKnockdown, JumpSound, JumpFailedPopup, NextJumpTime): кратко опишите
назначение компонента и роль каждого поля (например что хранит Action /
ActionEntity, единицы измерения и влияние JumpDistance/JumpThrowSpeed, что
делает CollideKnockdown, когда воспроизводится JumpSound, что означает
JumpFailedPopup и как используется NextJumpTime), поместите комментарии
непосредственно над объявлением класса и над каждым полем в том же файле.
In `@Resources/Prototypes/ADT/NPCs/Combat/zombie.yml`:
- Around line 23-29: В файле есть дублирование значения cooldown: оно задано в
ZombieJumpCooldownPrecondition и повторно в ZombieJumpAttackOperator; исправьте
это, вынеся значение в единый источник правды (например общую
переменную/параметр JumpCooldown или глобальный параметр задачи) и замените оба
прямых литерала на ссылку на этот параметр, либо удалите cooldown из оператора и
сделайте так, чтобы ZombieJumpAttackOperator брало значение из
ZombieJumpCooldownPrecondition (или общего контекста), чтобы оба места
использовали одно и то же имя/переменную (сохраните ссылки на
ZombieJumpCooldownPrecondition, ZombieJumpAttackOperator и поле cooldown при
правке).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 538e565a-0978-4673-8051-db22eeaf2d4f
📒 Files selected for processing (18)
Content.Client/ADT/ZombieJump/ZombieJumpSystem.csContent.Server/ADT/ZombieJump/Operators/ZombieJumpAttackOperator.csContent.Server/ADT/ZombieJump/Preconditions/ZombieJumpCooldownPrecondition.csContent.Server/ADT/ZombieJump/Preconditions/ZombieJumpRangePrecondition.csContent.Server/ADT/ZombieJump/ZombieJumpSystem.csContent.Server/Zombies/ZombieSystem.Transform.csContent.Server/Zombies/ZombieSystem.csContent.Shared/ADT/ZombieJump/ActiveZombieLeaperComponent.csContent.Shared/ADT/ZombieJump/SharedZombieJumpSystem.csContent.Shared/ADT/ZombieJump/ZombieJumpComponent.csContent.Shared/EntityEffects/Effects/ZombieEntityEffectsSystem.csContent.Shared/Movement/Systems/SharedJumpAbilitySystem.csContent.Shared/Zombies/PendingZombieComponent.csContent.Shared/Zombies/ZombieComponent.csResources/Locale/en-US/zombies/zombie.ftlResources/Locale/ru-RU/zombies/zombie.ftlResources/Prototypes/ADT/Actions/types.ymlResources/Prototypes/ADT/NPCs/Combat/zombie.yml
Content.Server/ADT/ZombieJump/Operators/ZombieJumpAttackOperator.cs
Outdated
Show resolved
Hide resolved
Content.Server/ADT/ZombieJump/Preconditions/ZombieJumpRangePrecondition.cs
Show resolved
Hide resolved
Content.Shared/EntityEffects/Effects/ZombieEntityEffectsSystem.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
Content.Server/Zombies/ZombieSystem.Transform.cs (1)
22-22:⚠️ Potential issue | 🟡 MinorДублирующийся импорт.
Content.Shared.CombatMode.Pacificationуже импортирован на строке 18. Удалите дубликат.🐛 Предлагаемое исправление
using Content.Shared.Hands.EntitySystems; -using Content.Shared.CombatMode.Pacification; using Content.Shared.Humanoid;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Server/Zombies/ZombieSystem.Transform.cs` at line 22, В файле есть дублирующийся импорт `Content.Shared.CombatMode.Pacification` (он уже присутствует ранее); удалите лишнюю строку с этим using, оставив только одну декларацию `using Content.Shared.CombatMode.Pacification;` чтобы избежать повторов и предупреждений компилятора.
🧹 Nitpick comments (2)
Content.Server/ADT/ZombieJump/Preconditions/ZombieJumpRangePrecondition.cs (1)
44-47: Пустой блокcatchскрывает ошибки.Пустой
catchмолчаливо подавляет все исключения. Хотя для HTN-прекондишенов возвратfalseпри ошибках — приемлемое поведение, полное подавление исключений может затруднить отладку. Рекомендуется как минимум залогировать ошибку.♻️ Опциональное улучшение
catch { + // Можно добавить логирование для отладки: + // Log.Warning("ZombieJumpRangePrecondition failed due to exception"); return false; }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Server/ADT/ZombieJump/Preconditions/ZombieJumpRangePrecondition.cs` around lines 44 - 47, В блоке catch в классе ZombieJumpRangePrecondition (тот, который сейчас просто делает “catch { return false; }”) неявно подавляются исключения; замените пустой catch на перехват Exception (например catch (Exception ex)) и залогируйте подробности ошибки перед возвратом false, используя существующий логгер/журналирование проекта (например _logger, Logger, IoC-логгер или processLogger в контексте), чтобы сохранить текущее поведение (возврат false) и одновременно оставить информацию для отладки.Content.Server/ADT/ZombieJump/Operators/ZombieJumpAttackOperator.cs (1)
4-4: Неиспользуемый импорт.
Content.Server.ADT.ZombieJump.Preconditionsимпортируется, но не используется в этом файле. Рекомендуется удалить.♻️ Предлагаемое изменение
using System.Threading; using System.Threading.Tasks; using Content.Server.ADT.ZombieJump; -using Content.Server.ADT.ZombieJump.Preconditions; using Content.Server.NPC;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Server/ADT/ZombieJump/Operators/ZombieJumpAttackOperator.cs` at line 4, Remove the unused using directive "using Content.Server.ADT.ZombieJump.Preconditions;" from the top of ZombieJumpAttackOperator.cs; locate the ZombieJumpAttackOperator class in that file and delete the unused import line to clean up unused 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.Server/Zombies/ZombieSystem.Transform.cs`:
- Around line 237-245: The non-humanoid branch that ensures the
ZombieJumpComponent (using EnsureComp<ZombieJumpComponent>(target)) sets
JumpDistance, JumpThrowSpeed and CollideKnockdown but does not call
Dirty(target, jumpComp), causing component state not to be synchronized; after
configuring jumpComp in the !HasComp<HumanoidAppearanceComponent>(target) block,
call Dirty(target, jumpComp) (same as the humanoid branch) so the component
changes are marked dirty for networking/replication.
- Line 284: Изменение RootTask у htn с SimpleHostileCompound на
ZombieHostileCompound должно быть помечено комментарием ADT-Tweak: добавьте
рядом с присвоением htn.RootTask = new HTNCompoundTask() { Task =
"ZombieHostileCompound" } короткий комментарий вида // ADT-Tweak: ...
объясняющий причину изменения (например отклонение от /ADT/ и зачем заменён
SimpleHostileCompound), чтобы соблюсти coding guidelines.
---
Outside diff comments:
In `@Content.Server/Zombies/ZombieSystem.Transform.cs`:
- Line 22: В файле есть дублирующийся импорт
`Content.Shared.CombatMode.Pacification` (он уже присутствует ранее); удалите
лишнюю строку с этим using, оставив только одну декларацию `using
Content.Shared.CombatMode.Pacification;` чтобы избежать повторов и
предупреждений компилятора.
---
Nitpick comments:
In `@Content.Server/ADT/ZombieJump/Operators/ZombieJumpAttackOperator.cs`:
- Line 4: Remove the unused using directive "using
Content.Server.ADT.ZombieJump.Preconditions;" from the top of
ZombieJumpAttackOperator.cs; locate the ZombieJumpAttackOperator class in that
file and delete the unused import line to clean up unused references.
In `@Content.Server/ADT/ZombieJump/Preconditions/ZombieJumpRangePrecondition.cs`:
- Around line 44-47: В блоке catch в классе ZombieJumpRangePrecondition (тот,
который сейчас просто делает “catch { return false; }”) неявно подавляются
исключения; замените пустой catch на перехват Exception (например catch
(Exception ex)) и залогируйте подробности ошибки перед возвратом false,
используя существующий логгер/журналирование проекта (например _logger, Logger,
IoC-логгер или processLogger в контексте), чтобы сохранить текущее поведение
(возврат false) и одновременно оставить информацию для отладки.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 08a533da-d20c-4aa2-a973-b4f8a0783bc7
📒 Files selected for processing (6)
Content.Server/ADT/ZombieJump/Operators/ZombieJumpAttackOperator.csContent.Server/ADT/ZombieJump/Preconditions/ZombieJumpRangePrecondition.csContent.Server/Zombies/ZombieSystem.Transform.csContent.Shared/ADT/ZombieJump/ZombieJumpComponent.csContent.Shared/EntityEffects/Effects/ZombieEntityEffectsSystem.csContent.Shared/Zombies/PendingZombieComponent.cs
🚧 Files skipped from review as they are similar to previous changes (1)
- Content.Shared/EntityEffects/Effects/ZombieEntityEffectsSystem.cs
|
Теперь у выживших вообще не будет шансов, круто |
Сейчас зомби очень слабые и крайне быстро выдыхаются + на реворк/баффы зомби были предложки |
|
Зомби как режима вообще нет - только ромерол у агента за Дохуя тк. |
не совсем. Ещё есть цель на "создание амбузола" и тогда присылают 3 таблетки ромы |
|
Я готов пересмотреть. Может КД прыжка больше - или урона меньше. Или не станить а ронять просто и из рук выбивать оружие. |
Я думаю что зомби должны брать количеством, а не теорией бесконечного стана... Да в целом не должны выигрывать по своей сути... |
Они и так будут брать количеством, там же прыжок всего на 5 клеток - а учитывая хитбоксы, им ещё и попасть надо. |
|
Есть ощущение, что лучше сделать между зомбями голосование на мутации для них. |
У нас даже режима такого нет :/ да и у меня нет возможности такое голосование делать. Как и нет спрайтов. |
В худшем случае разные компоненты на способность дать им. |
Описание PR
Добавлена система прыжков для зомби с автоматическим использованием через HTN (NTN) и кнопкой для игроков-зомби. Так же ромеров не имеет оповещение для игрока, если он стал заражён, и имеет повышенный урон - что ускоряет конвертацию.
Техническая информация
Чейнджлог
🆑 CrimeMoot