Skip to content

Conversation

@Cethet
Copy link
Contributor

@Cethet Cethet commented May 30, 2025

О ПР`е

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

Изменения кода официальных разработчиков

@github-actions github-actions bot added size/Small Change Wiz Code Изменения вмешиваются в код визардов C# Изменения добавляют новый C# код Change WIz Prototypes Изменения вмешиваются в код прототипов визардов Prototypes Изменения добавляет новые прототипы Resprite Изменения заменяют оригинальные текстуры визардов Sprite Изменения добавляют спрайты and removed size/Small labels May 30, 2025
using Content.Shared.DoAfter;
using Content.Server.Temperature.Systems;

namespace Content.Server.Imperial.Medieval.Bonfire;
Copy link
Contributor

Choose a reason for hiding this comment

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

Система не понятно почему на сервере, это кринж


public sealed class BonfireSystem : EntitySystem
{
[Dependency] protected readonly SharedAudioSystem _audio = default!;
Copy link
Contributor

Choose a reason for hiding this comment

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

зачем здесь протектед хз, нигде не наследуется

Suggested change
[Dependency] protected readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;

[Dependency] private readonly TemperatureSystem _temperature = default!;
[Dependency] private readonly SharedDoAfterSystem _doAfterSystem = default!;

private const float FuelDecreasePerSecond = 0.11f;
Copy link
Contributor

Choose a reason for hiding this comment

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

Почему эти данные хардкодно зашиты в системе, а не находятся в компоненте - под вопросом.
Перенести в компонент по-хорошему

}

bonfire.CurrentFuel = MathF.Max(0, bonfire.CurrentFuel - FuelDecreasePerSecond * frameTime);
UpdateBonfireVisuals(uid, bonfire);
Copy link
Contributor

Choose a reason for hiding this comment

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

каждый тик обновляется визуализация костра т.е. вызываются
_lights.SetEnergy(uid, energy);
_lights.SetRadius(uid, radius, light);
что потенциально может привести к лагам.

{
if (component.IsLit == BonfireVisuals.Off)
{
args.PushText("Костёр не горит.");
Copy link
Contributor

Choose a reason for hiding this comment

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

Хардкод локализация.
Совет:

Loc.GetString("loc-key", ("var-name", component.IsLit == BonfireVisuals.Off));
loc-key =
    { $var-name ->
        [true] Тру 
       *[other] Фолс
    }


EnsureComp<AmbientSoundComponent>(uid);

_ambientSound.SetSound(uid, new SoundPathSpecifier("/Audio/Ambience/Objects/fireplace.ogg"));
Copy link
Contributor

Choose a reason for hiding this comment

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

хардкод звук, должно быть в компоненте

EnsureComp<PointLightComponent>(uid);

_lights.SetEnabled(uid, true);
_lights.SetColor(uid, Color.FromHex("#FFC90C"));
Copy link
Contributor

Choose a reason for hiding this comment

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

хардкод значения. Тож по хорошему должно быть в компоненте

_ambientSound.SetAmbience(uid, true);

_appearance.SetData(uid, BonfireVisualLayers.Fire, true);
_audio.PlayPvs(new SoundPathSpecifier(component.IgnitionSound), uid);
Copy link
Contributor

Choose a reason for hiding this comment

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

Почему SoundPathSpecifier здесь, а не в компоненте?

public sealed partial class BonfireComponent : Component
{
[DataField]
public string IgnitionSound = "/Audio/Items/Flare/flare_on.ogg";
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
public string IgnitionSound = "/Audio/Items/Flare/flare_on.ogg";
public SoundSpecifier IgnitionSound = new SoundPathSpecifier("/Audio/Items/Flare/flare_on.ogg");

public string IgnitionSound = "/Audio/Items/Flare/flare_on.ogg";

[DataField]
public string ExtinguishSound = "/Audio/Items/candle_blowing.ogg";
Copy link
Contributor

Choose a reason for hiding this comment

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

То же самое что и IgnitionSound

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

Labels

C# Изменения добавляют новый C# код Change Wiz Code Изменения вмешиваются в код визардов Change WIz Prototypes Изменения вмешиваются в код прототипов визардов Prototypes Изменения добавляет новые прототипы Resprite Изменения заменяют оригинальные текстуры визардов size/Small Sprite Изменения добавляют спрайты

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants