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
@@ -1,48 +1,52 @@
// SPDX-License-Identifier: AGPL-3.0-or-later

using Content.Goobstation.Shared.Teleportation.Systems;
using Content.Server.Administration.Logs;
using Content.Server.Stack;
using Content.Shared.Database;
using Content.Shared.Interaction.Events;
using Content.Shared.Stacks;
using Content.Shared.Teleportation;

// Arcane

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.

Пометки у usings не требуются

using Content.Shared.Timing;
namespace Content.Goobstation.Server.Teleportation.Systems;

public sealed class RandomTeleportSystem : EntitySystem
{
[Dependency] private readonly IAdminLogManager _alog = default!;
[Dependency] private readonly StackSystem _stack = default!;
[Dependency] private readonly SharedRandomTeleportSystem _sharedRtp = default!;

// Arcane
[Dependency] private readonly UseDelaySystem _useDelay = default!;

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.

Пометки прописывают с отступом в виде пробела от строчки, а не перед ней.

public override void Initialize()
{
base.Initialize();

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.

Не рекомендую вносить изменения в чужой файл, если это не изменит что-либо в игре.
Глянь на гитхабе.

SubscribeLocalEvent<RandomTeleportOnUseComponent, UseInHandEvent>(OnUseInHand);
}

private void OnUseInHand(EntityUid uid, RandomTeleportOnUseComponent component, UseInHandEvent args)
{
if (args.Handled)
return;

// Arcane-Start
if (_useDelay.IsDelayed(uid))
return;
// Arcane-Start-End

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.

Никогда не пишут Arcane-Start-End. Просто оставь Arcane-End

if (!_sharedRtp.RandomTeleport(args.User, component, out var wp))
return;

// Arcane-Start
args.Handled = true;
_useDelay.TryResetDelay(uid);
// Arcane-Start-End

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 (component.ConsumeOnUse)
{
if (TryComp<StackComponent>(uid, out var stack))
{
_stack.SetCount(uid, stack.Count - 1, stack);
return;
}

// It's consumed on use and it's not a stack so delete it
QueueDel(uid);
}

_alog.Add(LogType.Action, LogImpact.Low, $"{ToPrettyString(args.User):actor} randomly teleported to {wp!} using {ToPrettyString(uid)}");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
name: bluespace crystal
suffix: Full
components:
# Arcane-Start
- type: UseDelay
delay: 15

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.

Оставь задержку на 3-х секундах

# Arcane-Start-End

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.

И здесь не забудь

- type: Stack
stackType: BSCrystal
baseLayer: base
Expand Down Expand Up @@ -117,4 +121,4 @@
suffix: Single
components:
- type: Stack
count: 1
count: 1
Loading