Skip to content

Brain Blip's back#16

Open
vsixst wants to merge 1 commit into
Lua-Frontier:masterfrom
vsixst:brainblip
Open

Brain Blip's back#16
vsixst wants to merge 1 commit into
Lua-Frontier:masterfrom
vsixst:brainblip

Conversation

@vsixst

@vsixst vsixst commented Jul 3, 2026

Copy link
Copy Markdown

О пулл-реквесте

Добавлена OutOfContainerSystem, добавляющая компоненты на сущность пока он вне контейнера (т.е. на полу, в космосе.. зачем я это уточняю в который раз?) и отбирающая их когда сущность в контейнере (в руках, в сумке, итд.).
С этой системой возвращён блип на мозге, но с двумя добавлениями:

  1. Блип виден только вне грида и не в сумке/руках/теле
  2. Блип виден только в радиусе 512 метров.

Из дополнительного:
Возвращение к логике визардов в ComponentTogglerSystem и исправление ошибки связанной с предиктом в ClothingGrantingSystem

Обоснование / Баланс

Хотели сделать блипы на мозге? В целом, ситуация с отображением в теле исправлена.

Технические детали

OutOfContainerSystem по сути просто перенос ClothingGrantingSystem (_Goobstation.Clothing.Systems) с использованием других ивентов (EntGotInsertedIntoContainerMessage и EntGotRemovedIntoContainerMessage) и проверки IsEntityInContainer. Комментарии к методам я думаю излишни, логика коротка и понятна.

Проблема с ComponentTogglerSystem достаточно тупая, но существует. Если компонент ComponentTogglerComponent висит на шлеме, который добавляется через скафандр - то при снятии скафандра с куклы другой куклы, компоненты не снимаются корректно. Т.к. я не знаю почему губы вынесли эту логику из OnToggled в ToggleComponent я, соотв., решил аналогично изменить логику в ToggleComponent, а не полностью вернуть систему к визденам. (У визденов нету метода ToggleComponent - вся логика находится в OnToggled методе).

Как протестировать

  1. Ожидается, что вы уже скопировали репо, обновили движок, сбилдили и запустили.
  2. Заспавнить (или достать из куклы) мозг
  3. Открыть радар
  4. Выкинуть мозг в космос

Медиа

Требования

Критические изменения

Вроде я не насрал

Журнал изменений

🆑 vsixst

  • add: Возвращена метка мозга на радаре, если мозг находится в космосе а наблюдатель в радиусе 512м.

Примечание

Я кстати жду похвалу за такую роспись, чёт я много расписал для такого мелкого реквеста.

Основные:
- Добавлена OutOfContainerSystem, добавляющая компоненты на ентити, если та находится вне контейнеров (т.е. на полу)
- Возвращены блипы на мозг, с условием что мозг: а) Вне грида; б) Смотрящий в радиусе 512м.

Чисто по приколу:
- Обновлена/Возвращена логика в ComponentTogglerSystem на логику визденов.
- Исправлена глупая ошибка с предиктом в ClothingGrantingSystem

@Pcolik505 Pcolik505 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

По комментам плюс-минус вот так.

Comment on lines +32 to +37

// <summary>
// It holds the entity that the component gave the component to, so it can remove from it even if it changes parent.
// </summary>
[DataField]
public EntityUid? Target;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// <summary>
// It holds the entity that the component gave the component to, so it can remove from it even if it changes parent.
// </summary>
[DataField]
public EntityUid? Target;
// LuaM-start:
// <summary>
// It holds the entity that the component gave the component to, so it can remove from it even if it changes parent.
// </summary>
[DataField]
public EntityUid? Target;
// LuaM-end.

@@ -1,12 +1,15 @@
using Content.Shared.Item.ItemToggle.Components;
using Robust.Shared.Timing;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
using Robust.Shared.Timing;
using Robust.Shared.Timing; // LuaM

/// Handles <see cref="ComponentTogglerComponent"/> component manipulation.
/// </summary>
public sealed class ComponentTogglerSystem : EntitySystem
public sealed partial class ComponentTogglerSystem : EntitySystem

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
public sealed partial class ComponentTogglerSystem : EntitySystem
public sealed partial class ComponentTogglerSystem : EntitySystem // LuaM: public sealed class > public sealed partial class

public void ToggleComponent(EntityUid uid, bool activate)
{
if (!TryComp<ComponentTogglerComponent>(uid, out var component))
if (!_timing.IsFirstTimePredicted) // LuaM: predict err fix

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if (!_timing.IsFirstTimePredicted) // LuaM: predict err fix
if (!_timing.IsFirstTimePredicted) // LuaM: !TryComp<ComponentTogglerComponent>(uid, out var component) > _timing.IsFirstTimePredicted

EntityManager.AddComponents(target, component.Components);
}
else
EntityManager.RemoveComponents(target, component.RemoveComponents ?? component.Components);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Закомментить, а не удалить.

if (!_timing.IsFirstTimePredicted) // LuaM: predict err fix
return;

var target = component.Parent ? Transform(uid).ParentUid : uid;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Закомментить, а не удалить.

return;

var target = component.Parent ? Transform(uid).ParentUid : uid;
if (!TryComp<ComponentTogglerComponent>(uid, out var component))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if (!TryComp<ComponentTogglerComponent>(uid, out var component))
if (!TryComp<ComponentTogglerComponent>(uid, out var component)) // LuaM

components:
- type: RadarBlip
radarColor: "#E0FFFF"
scale: 3

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
scale: 3
scale: 3 // LuaM: 6 > 3

Comment on lines +106 to +107
maxDistance: 512
requireNoGrid: true

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
maxDistance: 512
requireNoGrid: true
# LuaM-start:
maxDistance: 512
requireNoGrid: true
# LuaM-end.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants