-
-
Notifications
You must be signed in to change notification settings - Fork 81
Elevator fix 2.0 #1067
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
Open
arthu241243
wants to merge
9
commits into
space-sunrise:master
Choose a base branch
from
arthu241243:Elevator-fix-2.0
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Elevator fix 2.0 #1067
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d3f4d69
Elevator fix
arthu241243 6e78754
Elevator-2.1
arthu241243 3954044
Merge branch 'master' into Elevator-fix-2.0
arthu241243 d68cea9
Merge branch 'master' into Elevator-fix-2.0
arthu241243 4922cb2
Elevator 3.0
arthu241243 84706cd
Elevator 3.0
arthu241243 08a9f53
Merge branch 'Elevator-fix-2.0' of https://github.com/arthu241243/Pat…
arthu241243 5e63279
Merge branch 'master' into Elevator-fix-2.0
WardexOfficial 7c81600
Merge branch 'master' into Elevator-fix-2.0
arthu241243 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
78 changes: 78 additions & 0 deletions
78
Content.Server/_Scp/ComplexElevator/ComplexElevatorSystem.Debug.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| using Content.Server.Administration.Managers; | ||
| using Content.Shared._Scp.ComplexElevator; | ||
| using Content.Shared.Database; | ||
| using Content.Shared.Verbs; | ||
| using Robust.Server.GameObjects; | ||
| using Robust.Shared.Player; | ||
|
|
||
| namespace Content.Server._Scp.ComplexElevator; | ||
|
|
||
| public sealed partial class ComplexElevatorSystem | ||
| { | ||
| [Dependency] private readonly IAdminManager _adminManager = default!; | ||
|
|
||
| private void InitializeDebug() | ||
| { | ||
| SubscribeLocalEvent<ComplexElevatorComponent, GetVerbsEvent<Verb>>(AddAdminElevatorVerbs); | ||
| SubscribeLocalEvent<ElevatorPointComponent, GetVerbsEvent<Verb>>(AddAdminPointVerbs); | ||
| } | ||
|
|
||
| private void AddAdminElevatorVerbs(EntityUid uid, ComplexElevatorComponent comp, GetVerbsEvent<Verb> args) | ||
| { | ||
| if (!TryComp(args.User, out ActorComponent? actor) || !_adminManager.IsAdmin(actor.PlayerSession)) | ||
| return; | ||
|
|
||
| foreach (var floor in comp.Floors) | ||
| { | ||
| var targetFloor = floor; | ||
| args.Verbs.Add(new Verb | ||
| { | ||
| Text = $"Send to: {targetFloor}", | ||
| Category = VerbCategory.Debug, | ||
| Act = () => MoveToFloor((uid, comp), targetFloor), | ||
| Impact = LogImpact.Medium | ||
| }); | ||
| } | ||
| } | ||
|
|
||
| private void AddAdminPointVerbs(EntityUid uid, ElevatorPointComponent comp, GetVerbsEvent<Verb> args) | ||
| { | ||
| if (!TryComp(args.User, out ActorComponent? actor) || !_adminManager.IsAdmin(actor.PlayerSession)) | ||
| return; | ||
|
|
||
| foreach (var (elevatorUid, elevatorComp) in _elevatorIndex) | ||
| { | ||
| if (!TryComp<ComplexElevatorComponent>(elevatorComp, out var elevator)) | ||
| continue; | ||
|
|
||
| if (!elevator.Floors.Contains(comp.FloorId)) | ||
| continue; | ||
|
|
||
| var elUid = elevatorComp; | ||
| var floorId = comp.FloorId; | ||
|
|
||
| args.Verbs.Add(new Verb | ||
| { | ||
| Text = $"[Elevator: {elevator.ElevatorId}] Send here", | ||
| Category = VerbCategory.Debug, | ||
| Act = () => MoveToFloor((elUid, elevator), floorId), | ||
| Impact = LogImpact.Medium | ||
| }); | ||
|
|
||
| args.Verbs.Add(new Verb | ||
| { | ||
| Text = $"[Elevator: {elevator.ElevatorId}] Teleport here instantly", | ||
| Category = VerbCategory.Debug, | ||
| Act = () => | ||
| { | ||
| ClearGasInTargetArea(elUid, floorId); | ||
| KillEntitiesInTargetArea((elUid, elevator), floorId); | ||
| elevator.CurrentFloor = floorId; | ||
| Dirty(elUid, elevator); | ||
| TeleportToFloor(elUid, floorId, elevator); | ||
| }, | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| Impact = LogImpact.High | ||
| }); | ||
| } | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.