-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
96 changed files
with
2,457 additions
and
158 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
Content.Client/ADT/_RMC14/Stealth/EntityInvisibilityVisualsSystem.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,48 @@ | ||
using Content.Shared._RMC14.Stealth; | ||
using Robust.Client.GameObjects; | ||
using Robust.Client.Graphics; | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Client._RMC14.Stealth; | ||
|
||
public sealed class EntityInvisibilityVisualsSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly IPrototypeManager _prototypes = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<EntityTurnInvisibleComponent, ComponentStartup>(OnStartup); | ||
SubscribeLocalEvent<EntityTurnInvisibleComponent, ComponentShutdown>(OnShutdown); | ||
} | ||
|
||
private void OnStartup(Entity<EntityTurnInvisibleComponent> ent, ref ComponentStartup args) | ||
{ | ||
if (!TryComp(ent, out SpriteComponent? sprite)) | ||
return; | ||
|
||
sprite.PostShader = _prototypes.Index<ShaderPrototype>("RMCInvisible").InstanceUnique(); | ||
} | ||
|
||
private void OnShutdown(Entity<EntityTurnInvisibleComponent> ent, ref ComponentShutdown args) | ||
{ | ||
if (TerminatingOrDeleted(ent)) | ||
return; | ||
|
||
if (!TryComp(ent, out SpriteComponent? sprite)) | ||
return; | ||
|
||
sprite.PostShader = null; | ||
} | ||
|
||
public override void Update(float frameTime) | ||
{ | ||
var invisible = EntityQueryEnumerator<EntityTurnInvisibleComponent, SpriteComponent>(); | ||
while (invisible.MoveNext(out var uid, out var comp, out var sprite)) | ||
{ | ||
var opacity = TryComp<EntityActiveInvisibleComponent>(uid, out var activeInvisible) ? activeInvisible.Opacity : 1; | ||
sprite.PostShader?.SetParameter("visibility", opacity); | ||
} | ||
} | ||
} |
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
29 changes: 29 additions & 0 deletions
29
Content.Server/ADT/Abilities/XenoQeen/XenoQeenComponent.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,29 @@ | ||
using Robust.Shared.Prototypes; | ||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; | ||
|
||
namespace Content.Server.Abilities.XenoQeen | ||
{ | ||
/// <summary> | ||
/// Lets its owner entity use mime powers, like placing invisible walls. | ||
/// </summary> | ||
[RegisterComponent] | ||
public sealed partial class XenoQeenComponent : Component | ||
{ | ||
/// <summary> | ||
/// Whether this component is active or not. | ||
/// </summarY> | ||
[DataField("enabled")] | ||
public bool Enabled = true; | ||
|
||
/// <summary> | ||
/// The wall prototype to use. | ||
/// </summary> | ||
[DataField("wallPrototype", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))] | ||
public string XenoTurret = "WeaponTurretXeno"; | ||
|
||
[DataField("xenoTurretAction", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))] | ||
public string? XenoTurretAction = "ActionXenoQeenTurret"; | ||
|
||
[DataField("xenoTurretActionEntity")] public EntityUid? XenoTurretActionEntity; | ||
} | ||
} |
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,66 @@ | ||
using Content.Server.Popups; | ||
using Content.Shared.Actions; | ||
using Content.Shared.Actions.Events; | ||
using Content.Shared.Coordinates.Helpers; | ||
using Content.Shared.Maps; | ||
using Content.Shared.Physics; | ||
using Robust.Shared.Containers; | ||
using Robust.Shared.Map; | ||
|
||
namespace Content.Server.Abilities.XenoQeen | ||
{ | ||
public sealed class XenoQeenSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly PopupSystem _popupSystem = default!; | ||
[Dependency] private readonly SharedActionsSystem _actionsSystem = default!; | ||
[Dependency] private readonly TurfSystem _turf = default!; | ||
[Dependency] private readonly IMapManager _mapMan = default!; | ||
[Dependency] private readonly SharedContainerSystem _container = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
SubscribeLocalEvent<XenoQeenComponent, ComponentInit>(OnComponentInit); | ||
SubscribeLocalEvent<XenoQeenComponent, InvisibleWallActionEvent>(OnCreateTurret); | ||
} | ||
|
||
public override void Update(float frameTime) | ||
{ | ||
base.Update(frameTime); | ||
} | ||
private void OnComponentInit(EntityUid uid, XenoQeenComponent component, ComponentInit args) | ||
{ | ||
_actionsSystem.AddAction(uid, ref component.XenoTurretActionEntity, component.XenoTurretAction, uid); | ||
} | ||
private void OnCreateTurret(EntityUid uid, XenoQeenComponent component, InvisibleWallActionEvent args) | ||
{ | ||
if (!component.Enabled) | ||
return; | ||
|
||
if (_container.IsEntityOrParentInContainer(uid)) | ||
return; | ||
|
||
var xform = Transform(uid); | ||
// Get the tile in front of the Qeen | ||
var offsetValue = xform.LocalRotation.ToWorldVec(); | ||
var coords = xform.Coordinates.Offset(offsetValue).SnapToGrid(EntityManager, _mapMan); | ||
var tile = coords.GetTileRef(EntityManager, _mapMan); | ||
if (tile == null) | ||
return; | ||
|
||
// Check if the tile is blocked by a wall or mob, and don't create the wall if so | ||
if (_turf.IsTileBlocked(tile.Value, CollisionGroup.Impassable | CollisionGroup.Opaque)) | ||
{ | ||
_popupSystem.PopupEntity(Loc.GetString("create-turret-failed"), uid, uid); | ||
return; | ||
} | ||
|
||
_popupSystem.PopupEntity(Loc.GetString("create-turret"), uid); | ||
// Make sure we set the invisible wall to despawn properly | ||
Spawn(component.XenoTurret, _turf.GetTileCenter(tile.Value)); | ||
// Handle args so cooldown works | ||
args.Handled = true; | ||
} | ||
|
||
} | ||
} |
6 changes: 0 additions & 6 deletions
6
Content.Server/ADT/Eye/Blinding/Components/NoDamageEyesOnFlashComponent.cs
This file was deleted.
Oops, something went wrong.
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
7 changes: 4 additions & 3 deletions
7
...omponents/DamageEyesOnFlashedComponent.cs → ...omponents/DamageEyesOnFlashedComponent.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
8 changes: 8 additions & 0 deletions
8
Content.Shared/ADT/Eye/Blinding/Components/NoDamageEyesOnFlashComponent.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,8 @@ | ||
using Robust.Shared.GameStates; | ||
|
||
namespace Content.Shared.ADT.Eye.Blinding; | ||
|
||
[RegisterComponent, NetworkedComponent] | ||
public sealed partial class NoEyeDamageOnFlashComponent : Component | ||
{ | ||
} |
2 changes: 1 addition & 1 deletion
2
...t.Server/ADT/Eye/Blinding/FlashedEvent.cs → ...t.Shared/ADT/Eye/Blinding/FlashedEvent.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
namespace Content.Server.ADT.Eye.Blinding; | ||
namespace Content.Shared.ADT.Eye.Blinding; | ||
|
||
[ByRefEvent] | ||
public record struct FlashedEvent(EntityUid? User, EntityUid? Used); |
2 changes: 1 addition & 1 deletion
2
...inding/Systems/DamageEyesOnFlashSystem.cs → ...inding/Systems/DamageEyesOnFlashSystem.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
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
61 changes: 61 additions & 0 deletions
61
Content.Shared/ADT/_RMC14/Armor/ThermalCloak/ThermalCloakComponent.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,61 @@ | ||
using Content.Shared.Humanoid; | ||
using Robust.Shared.Audio; | ||
using Robust.Shared.GameStates; | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Shared._RMC14.Armor.ThermalCloak; | ||
|
||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState] | ||
public sealed partial class ThermalCloakComponent : Component | ||
{ | ||
public bool Enabled; | ||
|
||
[DataField, AutoNetworkedField] | ||
public TimeSpan Cooldown = TimeSpan.FromSeconds(3); | ||
|
||
[DataField, AutoNetworkedField] | ||
public TimeSpan ForcedCooldown = TimeSpan.FromSeconds(10); | ||
|
||
[DataField, AutoNetworkedField] | ||
public float Opacity = 0.1f; | ||
|
||
[DataField, AutoNetworkedField] | ||
public SoundSpecifier? CloakSound; | ||
|
||
[DataField, AutoNetworkedField] | ||
public SoundSpecifier? UncloakSound; | ||
|
||
[DataField, AutoNetworkedField] | ||
public bool RestrictWeapons; | ||
|
||
/// <summary> | ||
/// Layers to hide while cloaked | ||
/// </summary> | ||
[DataField] | ||
public HashSet<HumanoidVisualLayers> CloakedHideLayers = new(); | ||
|
||
/// <summary> | ||
/// Amount of time after uncloaking weapons remain locked | ||
/// </summary> | ||
[DataField] | ||
[AutoNetworkedField] | ||
public TimeSpan UncloakWeaponLock = TimeSpan.FromSeconds(1); | ||
|
||
[DataField, AutoNetworkedField] | ||
public EntProtoId ActionId = "ADTActionToggleCloak"; | ||
|
||
[DataField, AutoNetworkedField] | ||
public EntityUid? Action; | ||
|
||
[DataField, AutoNetworkedField] | ||
public EntProtoId CloakEffect = "RMCEffectCloak"; | ||
|
||
[DataField, AutoNetworkedField] | ||
public EntProtoId UncloakEffect = "RMCEffectUncloak"; | ||
|
||
[DataField, AutoNetworkedField] | ||
public bool NinjaSuit = false; | ||
|
||
[DataField, AutoNetworkedField] | ||
public bool HandsBlock = true; | ||
} |
Oops, something went wrong.