forked from Eagle-0/Syndicate-Station
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged files from space-wizards/space-station-14 PR #30111 commit #f3…
…0cb0f
- Loading branch information
1 parent
b9f4960
commit 405e2e6
Showing
33 changed files
with
1,170 additions
and
87 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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,89 @@ | ||
using Content.Shared.ActionBlocker; | ||
using Content.Shared.Emoting; | ||
using Content.Shared.Interaction.Events; | ||
using Content.Shared.Item; | ||
using Content.Shared.Movement.Events; | ||
using Content.Shared.Movement.Pulling.Components; | ||
using Content.Shared.Movement.Pulling.Events; | ||
using Content.Shared.Movement.Pulling.Systems; | ||
using Content.Shared.Speech; | ||
using Content.Shared.Throwing; | ||
|
||
namespace Content.Shared.Administration; | ||
|
||
// TODO deduplicate with BlockMovementComponent | ||
public abstract class SharedAdminFrozenSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly ActionBlockerSystem _blocker = default!; | ||
[Dependency] private readonly PullingSystem _pulling = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<AdminFrozenComponent, UseAttemptEvent>(OnAttempt); | ||
SubscribeLocalEvent<AdminFrozenComponent, PickupAttemptEvent>(OnAttempt); | ||
SubscribeLocalEvent<AdminFrozenComponent, ThrowAttemptEvent>(OnAttempt); | ||
SubscribeLocalEvent<AdminFrozenComponent, InteractionAttemptEvent>(OnInteractAttempt); | ||
SubscribeLocalEvent<AdminFrozenComponent, ComponentStartup>(OnStartup); | ||
SubscribeLocalEvent<AdminFrozenComponent, ComponentShutdown>(UpdateCanMove); | ||
SubscribeLocalEvent<AdminFrozenComponent, UpdateCanMoveEvent>(OnUpdateCanMove); | ||
SubscribeLocalEvent<AdminFrozenComponent, PullAttemptEvent>(OnPullAttempt); | ||
SubscribeLocalEvent<AdminFrozenComponent, AttackAttemptEvent>(OnAttempt); | ||
SubscribeLocalEvent<AdminFrozenComponent, ChangeDirectionAttemptEvent>(OnAttempt); | ||
SubscribeLocalEvent<AdminFrozenComponent, EmoteAttemptEvent>(OnEmoteAttempt); | ||
SubscribeLocalEvent<AdminFrozenComponent, SpeakAttemptEvent>(OnSpeakAttempt); | ||
} | ||
|
||
private void OnInteractAttempt(Entity<AdminFrozenComponent> ent, ref InteractionAttemptEvent args) | ||
{ | ||
args.Cancelled = true; | ||
} | ||
|
||
private void OnSpeakAttempt(EntityUid uid, AdminFrozenComponent component, SpeakAttemptEvent args) | ||
{ | ||
if (!component.Muted) | ||
return; | ||
|
||
args.Cancel(); | ||
} | ||
|
||
private void OnAttempt(EntityUid uid, AdminFrozenComponent component, CancellableEntityEventArgs args) | ||
{ | ||
args.Cancel(); | ||
} | ||
|
||
private void OnPullAttempt(EntityUid uid, AdminFrozenComponent component, PullAttemptEvent args) | ||
{ | ||
args.Cancelled = true; | ||
} | ||
|
||
private void OnStartup(EntityUid uid, AdminFrozenComponent component, ComponentStartup args) | ||
{ | ||
if (TryComp<PullableComponent>(uid, out var pullable)) | ||
{ | ||
_pulling.TryStopPull(uid, pullable, ignoreGrab: true); | ||
} | ||
|
||
UpdateCanMove(uid, component, args); | ||
} | ||
|
||
private void OnUpdateCanMove(EntityUid uid, AdminFrozenComponent component, UpdateCanMoveEvent args) | ||
{ | ||
if (component.LifeStage > ComponentLifeStage.Running) | ||
return; | ||
|
||
args.Cancel(); | ||
} | ||
|
||
private void UpdateCanMove(EntityUid uid, AdminFrozenComponent component, EntityEventArgs args) | ||
{ | ||
_blocker.UpdateCanMove(uid); | ||
} | ||
|
||
private void OnEmoteAttempt(EntityUid uid, AdminFrozenComponent component, EmoteAttemptEvent args) | ||
{ | ||
if (component.Muted) | ||
args.Cancel(); | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
24 changes: 24 additions & 0 deletions
24
Content.Shared/MartialArts/Components/GrabThrownComponent.cs
This file contains 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,24 @@ | ||
using Content.Shared.Alert; | ||
using Robust.Shared.GameStates; | ||
using Robust.Shared.Prototypes; | ||
using Content.Shared.Movement.Pulling.Systems; | ||
using Robust.Shared.Timing; | ||
using Content.Shared.Damage; | ||
using Content.Shared.Physics; | ||
using Robust.Shared.Physics; | ||
|
||
namespace Content.Shared.MartialArts.Components; // Added a new category because im planning to make martials combat soon. And throwing is kinda... Martial-artistic? | ||
|
||
[RegisterComponent, NetworkedComponent] | ||
public sealed partial class GrabThrownComponent : Component | ||
{ | ||
public DamageSpecifier? DamageOnCollide; | ||
|
||
public DamageSpecifier? WallDamageOnCollide; | ||
|
||
public float? StaminaDamageOnCollide; | ||
|
||
//public int? SavedCollisionMask; | ||
|
||
//public int? SavedCollisionLayer; | ||
} |
Oops, something went wrong.