Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using Content.Shared.Storage;
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Content.Shared.Inventory;
namespace Content.Server.Imperial.HamMaggotson.PullableHelmet.Components;
Comment on lines +1 to +8
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Дублированный using и потенциально неиспользуемый импорт.

Строка 3 и строка 5 — дублирование using Robust.Shared.Prototypes;. Также using Content.Shared.Storage; (строка 1) не используется в файле — нет ссылок на типы из этого пространства имён.

Исправление
-using Content.Shared.Storage;
 using Robust.Shared.Audio;
 using Robust.Shared.Prototypes;
 using Robust.Shared.GameStates;
-using Robust.Shared.Prototypes;
 using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
 using Content.Shared.Inventory;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
using Content.Shared.Storage;
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Content.Shared.Inventory;
namespace Content.Server.Imperial.HamMaggotson.PullableHelmet.Components;
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Content.Shared.Inventory;
namespace Content.Server.Imperial.HamMaggotson.PullableHelmet.Components;
🤖 Prompt for AI Agents
In
`@Content.Server/Imperial/HamMaggotson/PullableHelmet/Components/PullableHelmetComponent.cs`
around lines 1 - 8, Remove the duplicate and unused using directives in
PullableHelmetComponent: delete the repeated "using Robust.Shared.Prototypes;"
and remove the unused "using Content.Shared.Storage;". Keep any other necessary
usings (e.g., Robust.Shared.Audio, Robust.Shared.GameStates,
Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype,
Content.Shared.Inventory) and then rebuild to ensure no missing references; if
the compiler complains, re-add only the specific using required for the missing
symbol.



[RegisterComponent]
public sealed partial class PullableHelmetComponent : Component
{
[DataField("toggledPrototype", required: true, customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
public string ToggledPrototype = string.Empty;

[DataField("untoggledPrototype", required: true, customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
[AutoNetworkedField]
public string UntoggledPrototype = string.Empty;

[DataField("toggled"), AutoNetworkedField]
public bool Toggled = false;
[DataField]
public SlotFlags? Slot;
[DataField("requiredSlot")]
public SlotFlags RequiredFlags = SlotFlags.HEAD;
[DataField]
public LocId PullDownText = "pulldownhelmet-verb";

[DataField]
public LocId PullUpText = "pulluphelmet-verb";
[DataField]
public TimeSpan Delay = TimeSpan.FromSeconds(2);
[DataField]
public SoundSpecifier PullUpSound { get; set; } = new SoundPathSpecifier("/Audio/Imperial/HamMaggotson/helmet_pullup.ogg");
[DataField]
public SoundSpecifier PullDownSound { get; set; } = new SoundPathSpecifier("/Audio/Imperial/HamMaggotson/helmet_pulldown.ogg");
Comment on lines +34 to +37
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Несогласованность: свойства с { get; set; } вместо полей.

PullUpSound и PullDownSound объявлены как auto-properties ({ get; set; }), тогда как все остальные поля компонента — обычные поля. В SS14 компонентах обычно используются поля. Рекомендуется привести к единому стилю.

Исправление
     [DataField]
-    public SoundSpecifier PullUpSound { get; set; } = new SoundPathSpecifier("/Audio/Imperial/HamMaggotson/helmet_pullup.ogg");
+    public SoundSpecifier PullUpSound = new SoundPathSpecifier("/Audio/Imperial/HamMaggotson/helmet_pullup.ogg");
     [DataField]
-    public SoundSpecifier PullDownSound { get; set; } = new SoundPathSpecifier("/Audio/Imperial/HamMaggotson/helmet_pulldown.ogg");
+    public SoundSpecifier PullDownSound = new SoundPathSpecifier("/Audio/Imperial/HamMaggotson/helmet_pulldown.ogg");
🤖 Prompt for AI Agents
In
`@Content.Server/Imperial/HamMaggotson/PullableHelmet/Components/PullableHelmetComponent.cs`
around lines 34 - 37, PullUpSound and PullDownSound are declared as
auto-properties but should be plain fields like other component data; change the
declarations in PullableHelmetComponent so that PullUpSound and PullDownSound
are public fields (retain the [DataField] attribute and the default
SoundPathSpecifier initializers) instead of properties with { get; set; }, e.g.,
update the members on the PullableHelmetComponent class to be public
SoundSpecifier PullUpSound = ... and public SoundSpecifier PullDownSound = ....

[DataField]
public EntProtoId PullAction = "ToggleK63Helmet";

[DataField]
public EntityUid? Action;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
using Content.Shared.Clothing.Components;
using Content.Shared.Foldable;
using Content.Shared.Inventory;
using Content.Shared.Item;
using Content.Shared.Clothing.EntitySystems;
using Content.Shared.Verbs;
using Content.Server.Imperial.HamMaggotson.PullableHelmet.Components;
using Content.Shared.Popups;
using Content.Shared.DoAfter;
using Robust.Shared.Containers;
using Content.Shared.Imperial.HamMaggotson.PullableHelmet;
using Robust.Shared.Audio.Systems;
using Content.Shared.Actions;
namespace Content.Server.Imperial.HamMaggotson.PullableHelmet.Systems;

public sealed class PullableHelmetSystem : EntitySystem
{
[Dependency] private readonly ClothingSystem _clothingSystem = default!;
[Dependency] private readonly SharedContainerSystem _container = default!;
[Dependency] private readonly InventorySystem _inventory = default!;
[Dependency] private readonly SharedItemSystem _itemSystem = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedDoAfterSystem _doAfter = default!;
[Dependency] private readonly SharedActionsSystem _actionsSystem = default!;
[Dependency] private readonly ActionContainerSystem _actionContainer = default!;
public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<PullableHelmetComponent, GetVerbsEvent<AlternativeVerb>>(AddPullVerb);
SubscribeLocalEvent<PullableHelmetComponent, PullHelmetDoAfterEvent>(TryToggleHelmet);
SubscribeLocalEvent<PullableHelmetComponent, PullHelmetActionEvent>(TryStartDoAfter);
SubscribeLocalEvent<PullableHelmetComponent, MapInitEvent>(OnMapInit);
SubscribeLocalEvent<PullableHelmetComponent, GetItemActionsEvent>(OnGetActions);
}

private void AddPullVerb(EntityUid uid, PullableHelmetComponent component, GetVerbsEvent<AlternativeVerb> args)
{
if (!args.CanAccess || !args.CanInteract || args.Hands == null)
return;

AlternativeVerb verb = new()
{
Act = () => TryStartDoAfter(args.User, (uid, component)),
Text = component.Toggled ? Loc.GetString(component.PullUpText) : Loc.GetString(component.PullDownText),
Priority = component.Toggled ? 0 : 2,
};

args.Verbs.Add(verb);
}

private void TryStartDoAfter(EntityUid user, Entity<PullableHelmetComponent> ent)
{
_doAfter.TryStartDoAfter(new DoAfterArgs(EntityManager,
user,
ent.Comp.Delay,
new PullHelmetDoAfterEvent(),
ent,
ent)
{
NeedHand = true,
});
}

private void TryStartDoAfter(Entity<PullableHelmetComponent> ent, ref PullHelmetActionEvent args)
{
_doAfter.TryStartDoAfter(new DoAfterArgs(EntityManager,
args.Performer,
ent.Comp.Delay,
new PullHelmetDoAfterEvent(),
ent,
ent)
{
NeedHand = true,
});
}
Comment on lines +66 to +77
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Дублирование логики DoAfter между двумя перегрузками TryStartDoAfter.

Строки 53-64 и 66-77 содержат практически идентичную логику создания DoAfterArgs. Можно устранить дублирование, вызвав общую перегрузку из обработчика действия.

Рефакторинг
     private void TryStartDoAfter(Entity<PullableHelmetComponent> ent, ref PullHelmetActionEvent args)
     {
-        _doAfter.TryStartDoAfter(new DoAfterArgs(EntityManager,
-            args.Performer,
-            ent.Comp.Delay,
-            new PullHelmetDoAfterEvent(),
-            ent,
-            ent)
-        {
-            NeedHand = true,
-        });
+        TryStartDoAfter(args.Performer, ent);
     }
🤖 Prompt for AI Agents
In
`@Content.Server/Imperial/HamMaggotson/PullableHelmet/Systems/PullableHelmetSystem.cs`
around lines 66 - 77, Two TryStartDoAfter overloads duplicate building the same
DoAfterArgs; refactor by consolidating the shared DoAfterArgs construction into
a single helper or have one overload call the other. Specifically, centralize
creation of the DoAfterArgs (using EntityManager, args.Performer,
ent.Comp.Delay, new PullHelmetDoAfterEvent(), ent as both target and used, and
NeedHand = true) and then call _doAfter.TryStartDoAfter(...) from that helper so
both TryStartDoAfter(Entity<PullableHelmetComponent>, ref PullHelmetActionEvent)
and the other overload reuse the same logic.


public void TryToggleHelmet(EntityUid uid, PullableHelmetComponent component, ref PullHelmetDoAfterEvent args)
{
var user = args.User;
if (!_inventory.InSlotWithFlags(uid, component.RequiredFlags))
return;
component.Toggled = !component.Toggled;
var newPrototype = component.Toggled ? component.ToggledPrototype : component.UntoggledPrototype;
var sound = component.Toggled ? component.PullDownSound : component.PullUpSound;
var newEntity = Spawn(newPrototype, Transform(uid).Coordinates);
if (!TryComp<PullableHelmetComponent>(newEntity, out var hlm))
{
QueueDel(newEntity);
return;
}
hlm.Toggled = component.Toggled;
if (_inventory.TryGetContainingSlot(uid, out var slot))
{
_inventory.TryUnequip(user, slot.Name);
_inventory.TryEquip(user, newEntity, slot.Name);
QueueDel(uid);
_audio.PlayPvs(sound, user);
}
}
Comment on lines +79 to +101
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Критично: отсутствует проверка args.Cancelled / args.Handled в обработчике DoAfter.

TryToggleHelmet не проверяет, был ли DoAfter отменён (например, игрок пошевелился). Стандартный паттерн SS14 для обработки DoAfter-событий требует проверки в начале метода. Без этого шлем будет переключаться даже при отмене действия.

Кроме того, если TryGetContainingSlot вернёт false (строка 94), уже заспавненная сущность newEntity не удаляется — утечка сущности. Аналогично, результаты TryUnequip / TryEquip не проверяются — при неудаче возможна потеря или дублирование предмета.

Также метод public — должен быть private для единообразия с остальными обработчиками.

Предлагаемое исправление
-    public void TryToggleHelmet(EntityUid uid, PullableHelmetComponent component, ref PullHelmetDoAfterEvent args)
+    private void TryToggleHelmet(EntityUid uid, PullableHelmetComponent component, ref PullHelmetDoAfterEvent args)
     {
+        if (args.Cancelled || args.Handled)
+            return;
+
+        args.Handled = true;
+
         var user = args.User;
         if (!_inventory.InSlotWithFlags(uid, component.RequiredFlags))
             return;
         component.Toggled = !component.Toggled;
         var newPrototype = component.Toggled ? component.ToggledPrototype : component.UntoggledPrototype;
         var sound = component.Toggled ? component.PullDownSound : component.PullUpSound;
         var newEntity = Spawn(newPrototype, Transform(uid).Coordinates);
         if (!TryComp<PullableHelmetComponent>(newEntity, out var hlm))
         {
             QueueDel(newEntity);
             return;
         }
         hlm.Toggled = component.Toggled;
         if (_inventory.TryGetContainingSlot(uid, out var slot))
         {
-            _inventory.TryUnequip(user, slot.Name);
-            _inventory.TryEquip(user, newEntity, slot.Name);
-            QueueDel(uid);
-            _audio.PlayPvs(sound, user);
+            if (_inventory.TryUnequip(user, slot.Name) &&
+                _inventory.TryEquip(user, newEntity, slot.Name))
+            {
+                QueueDel(uid);
+                _audio.PlayPvs(sound, user);
+            }
+            else
+            {
+                QueueDel(newEntity);
+            }
+        }
+        else
+        {
+            QueueDel(newEntity);
         }
     }
🤖 Prompt for AI Agents
In
`@Content.Server/Imperial/HamMaggotson/PullableHelmet/Systems/PullableHelmetSystem.cs`
around lines 79 - 101, TryToggleHelmet should first check DoAfter results
(args.Cancelled or args.Handled) and return immediately if cancelled/handled,
and then be made private to match other handlers; move the cancelled check to
the top of TryToggleHelmet(PullableHelmetComponent component, ref
PullHelmetDoAfterEvent args). Avoid leaking the spawned entity: only
Spawn(newPrototype, ...) after confirming the DoAfter succeeded or, if you must
spawn earlier, ensure you QueueDel(newEntity) when TryGetContainingSlot returns
false. Also check the boolean results of _inventory.TryUnequip and
_inventory.TryEquip and only call QueueDel(uid) and _audio.PlayPvs(sound, user)
when both succeed; on failure rollback by QueueDel(newEntity) (and do not delete
the original uid). Use the existing symbols: TryToggleHelmet,
PullableHelmetComponent, args.Cancelled/args.Handled, TryGetContainingSlot,
TryUnequip, TryEquip, Spawn, QueueDel, and _audio.PlayPvs.

private void OnGetActions(EntityUid uid, PullableHelmetComponent component, GetItemActionsEvent args)
{
if (component.Action != null
&& (args.SlotFlags & component.RequiredFlags) == component.RequiredFlags)
{
args.AddAction(component.Action.Value);
}
}

private void OnMapInit(EntityUid uid, PullableHelmetComponent component, MapInitEvent args)
{
if (_actionContainer.EnsureAction(uid, ref component.Action, out var action, component.PullAction))
_actionsSystem.SetEntityIcon((component.Action.Value, action), uid);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
using Content.Shared.Actions;
namespace Content.Shared.Imperial.HamMaggotson.PullableHelmet;
public sealed partial class PullHelmetActionEvent : InstantActionEvent
{}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
using Content.Shared.DoAfter;
using Robust.Shared.Serialization;

namespace Content.Shared.Imperial.HamMaggotson.PullableHelmet;

[Serializable, NetSerializable]
public sealed partial class PullHelmetDoAfterEvent : SimpleDoAfterEvent;
Binary file not shown.
Binary file not shown.
13 changes: 13 additions & 0 deletions Resources/Locale/ru-RU/Imperial/DeadSector/helmets.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,16 @@ ent-ClothingHeadHelmetWoodGrouseGreen = исследовательский "Гл

ent-ClothingHeadHelmetPSY = ПСИ-Шлем
.desc = Шлем модели ПСИ, среднеразмерный шлем, имеет металлическую окраску и встроенную гарнитуру.

ent-ClothingHeadHelmetK63Alternate = { ent-ClothingHeadHelmetK63 }
.desc = { ent-ClothingHeadHelmetK63.desc }

ent-ClothingHeadHelmetK63AlternateLowered = { ent-ClothingHeadHelmetK63Alternate }
.desc = { ent-ClothingHeadHelmetK63Alternate.desc }


ent-ClothingHeadHelmetK63Lowered = { ent-ClothingHeadHelmetK63 }
.desc = { ent-ClothingHeadHelmetK63.desc }

ent-ToggleK63Helmet = Сдвинуть забрало
.desc = Сдвинуть забрало шлема.
2 changes: 2 additions & 0 deletions Resources/Locale/ru-RU/Imperial/HamMaggotson/verb.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pulldownhelmet-verb = Опустить забрало
pulluphelmet-verb = Поднять забрало
122 changes: 115 additions & 7 deletions Resources/Prototypes/Imperial/Clothing/Helmets/k6_3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
suffix: DeadSector
components:
- type: Sprite
sprite: Imperial/Clothing/Head/Helmets/k6_3.rsi
sprite: Imperial/Clothing/Head/Helmets/k6_3_new.rsi
- type: Clothing
sprite: Imperial/Clothing/Head/Helmets/k6_3.rsi
sprite: Imperial/Clothing/Head/Helmets/k6_3_new.rsi
quickEquip: true
clothingVisuals:
head:
Expand All @@ -21,20 +21,128 @@
Blunt: 0.7
Slash: 0.7
Piercing: 0.93
Heat: 0.93
Shock: 0.8
- type: ExplosionResistance
damageCoefficient: 0.7
damageCoefficient: 0.75
- type: HideLayerClothing
slots:
- Hair
- HeadTop
- type: PullableHelmet
untoggledPrototype: ClothingHeadHelmetK63
toggledPrototype: ClothingHeadHelmetK63Lowered
pullAction: ToggleK63Helmet

- type: entity
id: ClothingHeadHelmetK63Lowered
parent: ClothingHeadHelmetK63
name: fire helmet
categories: [ HideSpawnMenu ]
description: An atmos tech's best friend. Provides some heat resistance and looks cool.
suffix: DeadSector
components:
- type: Sprite
sprite: Imperial/Clothing/Head/Helmets/k6_3_new.rsi
state: icon-off
- type: Clothing
sprite: Imperial/Clothing/Head/Helmets/k6_3_new.rsi
quickEquip: true
clothingVisuals:
head:
- state: on-equipped-HELMET
- type: Item
size: Normal
- type: Armor
modifiers:
coefficients:
Blunt: 0.7
Slash: 0.7
Piercing: 0.75
Heat: 0.75
Shock: 0.75
- type: ExplosionResistance
damageCoefficient: 0.5
- type: HideLayerClothing
slots:
- Hair
- HeadTop
- type: IngestionBlocker

# gloves
- type: entity
id: ToggleK63Helmet
name: Toggle ninja gloves
description: Toggles all glove actions on left click. Includes your doorjack, draining power, stunning enemies and hacking certain computers.
components:
- type: InstantAction
event: !type:ToggleActionEvent {}
event: !type:PullHelmetActionEvent
- type: Action
itemIconStyle: BigItem
useDelay: 1
Comment on lines 70 to +79
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Копипаста из ниндзя-перчаток — некорректные name и description.

name: Toggle ninja gloves и description описывают перчатки ниндзя, а не забрало шлема. Хотя русская локализация (ent-ToggleK63Helmet) перекроет эти значения, англоязычный фоллбэк остаётся абсолютно неправильным. Это будет видно в логах, дебаге и у игроков без RU-локали.

Предлагаемое исправление
 - type: entity
   id: ToggleK63Helmet
-  name: Toggle ninja gloves
-  description: Toggles all glove actions on left click. Includes your doorjack, draining power, stunning enemies and hacking certain computers.
+  name: Toggle helmet visor
+  description: Pull the helmet visor up or down.
   components:
🤖 Prompt for AI Agents
In `@Resources/Prototypes/Imperial/Clothing/Helmets/k6_3.yml` around lines 69 -
78, The YAML entity ToggleK63Helmet has wrong English fallback strings copied
from ninja gloves; update the name and description fields (the "name" and
"description" entries under the ToggleK63Helmet entity) to helmet-appropriate
text (e.g., "Toggle K6-3 Helmet" and a description like "Toggles helmet
functions on left click: doorjack, power drain, stun and certain hacks") so the
English fallback matches the entity behavior triggered by the InstantAction
!type:PullHelmetActionEvent and Action entries; keep the rest of the component
definitions unchanged.


- type: entity
id: ClothingHeadHelmetK63Alternate
parent: ClothingHeadHelmetBase
name: fire helmet
description: An atmos tech's best friend. Provides some heat resistance and looks cool.
suffix: DeadSector
components:
- type: Sprite
sprite: Imperial/Clothing/Head/Helmets/k6_3_new_alt.rsi
- type: Clothing
sprite: Imperial/Clothing/Head/Helmets/k6_3_new_alt.rsi
quickEquip: true
clothingVisuals:
head:
- state: off-equipped-HELMET
- type: Item
size: Normal
- type: Armor
modifiers:
coefficients:
Blunt: 0.7
Slash: 0.7
Piercing: 0.93
- type: ExplosionResistance
damageCoefficient: 0.7
- type: HideLayerClothing
slots:
- Hair
- HeadTop
- type: PullableHelmet
untoggledPrototype: ClothingHeadHelmetK63Alternate
toggledPrototype: ClothingHeadHelmetK63AlternateLowered
pullAction: ToggleK63Helmet
Comment on lines +81 to +113
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Альтернативный шлем — структура корректна, но проверьте коэффициент взрывоустойчивости.

У ClothingHeadHelmetK63Alternate damageCoefficient: 0.7 (строка 105), тогда как у базового ClothingHeadHelmetK630.75 (строка 25). Если оба варианта должны быть одинаковыми по защите в поднятом состоянии, значение стоит унифицировать.

🤖 Prompt for AI Agents
In `@Resources/Prototypes/Imperial/Clothing/Helmets/k6_3.yml` around lines 81 -
113, ClothingHeadHelmetK63Alternate has a different ExplosionResistance
damageCoefficient (0.7) than the base ClothingHeadHelmetK63 (0.75); if both
variants should provide the same raised-state protection, update the
ExplosionResistance.damageCoefficient on ClothingHeadHelmetK63Alternate to match
the base (0.75) so the pulled/toggled prototypes are consistent, or adjust
ClothingHeadHelmetK63 instead if the base is wrong—verify and unify the value
for the prototypes referenced by PullableHelmet (ClothingHeadHelmetK63Alternate
and ClothingHeadHelmetK63).


- type: entity
id: ClothingHeadHelmetK63AlternateLowered
parent: ClothingHeadHelmetK63Alternate
name: fire helmet
categories: [ HideSpawnMenu ]
description: An atmos tech's best friend. Provides some heat resistance and looks cool.
suffix: DeadSector
components:
- type: Sprite
sprite: Imperial/Clothing/Head/Helmets/k6_3_new_alt.rsi
state: icon-off
- type: Clothing
sprite: Imperial/Clothing/Head/Helmets/k6_3_new_alt.rsi
quickEquip: true
clothingVisuals:
head:
- state: on-equipped-HELMET
- type: Item
size: Normal
- type: Armor
modifiers:
coefficients:
Blunt: 0.7
Slash: 0.7
Piercing: 0.75
Heat: 0.75
Shock: 0.75
- type: ExplosionResistance
damageCoefficient: 0.5
- type: HideLayerClothing
slots:
- Hair
- HeadTop
- type: IngestionBlocker
Comment on lines +115 to +148
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Та же избыточная дупликация компонентов, что и в ClothingHeadHelmetK63Lowered.

ClothingHeadHelmetK63AlternateLowered наследует от ClothingHeadHelmetK63Alternate, но повторяет Sprite, Item, HideLayerClothing с идентичными значениями родителя. Оставьте только отличающиеся компоненты: Clothingon-equipped-HELMET), Armor, ExplosionResistance и IngestionBlocker.

Минимальное определение
 - type: entity
   id: ClothingHeadHelmetK63AlternateLowered
   parent: ClothingHeadHelmetK63Alternate
   name: fire helmet
   categories: [ HideSpawnMenu ]
   description: An atmos tech's best friend. Provides some heat resistance and looks cool.
   suffix: DeadSector
   components:
-  - type: Sprite
-    sprite: Imperial/Clothing/Head/Helmets/k6_3_new_alt.rsi
-    state: icon-off
   - type: Clothing
     sprite: Imperial/Clothing/Head/Helmets/k6_3_new_alt.rsi
     quickEquip: true
     clothingVisuals:
       head:
       - state: on-equipped-HELMET
-  - type: Item
-    size: Normal
   - type: Armor
     modifiers:
       coefficients:
         Blunt: 0.7
         Slash: 0.7
         Piercing: 0.75
         Heat: 0.75
         Shock: 0.75
   - type: ExplosionResistance
     damageCoefficient: 0.5
-  - type: HideLayerClothing
-    slots:
-    - Hair
-    - HeadTop
   - type: IngestionBlocker

Примечание: Sprite с state: icon-off может отличаться от родителя (у родителя нет явного state). Если это так, оставьте только Sprite с state: icon-off, убрав остальные дублирующиеся компоненты.

🤖 Prompt for AI Agents
In `@Resources/Prototypes/Imperial/Clothing/Helmets/k6_3.yml` around lines 115 -
148, Удалите из определения ClothingHeadHelmetK63AlternateLowered все
компоненты, которые дублируют значения родителя ClothingHeadHelmetK63Alternate
(включая Sprite/Item/HideLayerClothing если они идентичны родителю), оставив
только отличающиеся компоненты: Clothing (с состоянием on-equipped-HELMET),
Armor, ExplosionResistance и IngestionBlocker; если Sprite действительно
отличается только по state (state: icon-off) — вместо полного удаления оставьте
только этот Sprite с state: icon-off и уберите остальные дубликаты.

Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@
- type: StaminaResistance
damageCoefficient: 0.85
# Imperial Space Stamina Resistance End


Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Create by @lune_felix",
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Исправьте грамматическую ошибку в поле copyright.

В строке copyright указано "Create by", но должно быть "Created by" для правильной грамматики английского языка.

📝 Предлагаемое исправление
-    "copyright": "Create by `@lune_felix`",
+    "copyright": "Created by `@lune_felix`",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"copyright": "Create by @lune_felix",
"copyright": "Created by `@lune_felix`",
🤖 Prompt for AI Agents
In `@Resources/Textures/Imperial/Clothing/Head/Helmets/k6_3_new.rsi/meta.json` at
line 4, Update the value of the "copyright" field in the meta.json entry that
currently reads "Create by `@lune_felix`" to the grammatically correct "Created by
`@lune_felix`"; locate the "copyright" key in the meta.json for k6_3_new.rsi and
replace the string accordingly.

"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "icon"
},
{
"name": "icon-off"
},
{
"name": "off-equipped-HELMET",
"directions": 4
},
{
"name": "inhand-right",
"directions": 4
},
{
"name": "on-equipped-HELMET",
"directions": 4
},
{
"name": "inhand-left",
"directions": 4
}
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading