-
Notifications
You must be signed in to change notification settings - Fork 70
КД на бс кристаллы #190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
КД на бс кристаллы #190
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 | ||
| 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!; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Пометки прописывают с отступом в виде пробела от строчки, а не перед ней. |
||
| public override void Initialize() | ||
| { | ||
| base.Initialize(); | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
|---|---|---|
|
|
@@ -6,6 +6,10 @@ | |
| name: bluespace crystal | ||
| suffix: Full | ||
| components: | ||
| # Arcane-Start | ||
| - type: UseDelay | ||
| delay: 15 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Оставь задержку на 3-х секундах |
||
| # Arcane-Start-End | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. И здесь не забудь |
||
| - type: Stack | ||
| stackType: BSCrystal | ||
| baseLayer: base | ||
|
|
@@ -117,4 +121,4 @@ | |
| suffix: Single | ||
| components: | ||
| - type: Stack | ||
| count: 1 | ||
| count: 1 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Пометки у usings не требуются