-
Notifications
You must be signed in to change notification settings - Fork 381
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into garbagecannon
- Loading branch information
Showing
132 changed files
with
1,945 additions
and
332 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,6 @@ jobs: | |
- name: Check for Merge Conflicts | ||
uses: eps1lon/[email protected] | ||
with: | ||
dirtyLabel: "Status: Merge Conflict" | ||
dirtyLabel: "S: Merge Conflict" | ||
repoToken: "${{ secrets.GITHUB_TOKEN }}" | ||
commentOnDirty: "This pull request has conflicts, please resolve those before we can evaluate the pull request." |
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,52 @@ | ||
using System.Numerics; | ||
using Content.Shared.DeltaV.Pain; | ||
using Robust.Client.Graphics; | ||
using Robust.Client.Player; | ||
using Robust.Shared.Enums; | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Client.DeltaV.Overlays; | ||
|
||
public sealed partial class PainOverlay : Overlay | ||
{ | ||
[Dependency] private readonly IPrototypeManager _prototype = default!; | ||
[Dependency] private readonly IPlayerManager _player = default!; | ||
[Dependency] private readonly IEntityManager _entity = default!; | ||
|
||
public override bool RequestScreenTexture => true; | ||
public override OverlaySpace Space => OverlaySpace.WorldSpace; | ||
private readonly ShaderInstance _painShader; | ||
private readonly ProtoId<ShaderPrototype> _shaderProto = "ChromaticAberration"; | ||
|
||
public PainOverlay() | ||
{ | ||
IoCManager.InjectDependencies(this); | ||
_painShader = _prototype.Index(_shaderProto).Instance().Duplicate(); | ||
} | ||
|
||
protected override bool BeforeDraw(in OverlayDrawArgs args) | ||
{ | ||
if (_player.LocalEntity is not { Valid: true } player | ||
|| !_entity.HasComponent<PainComponent>(player)) | ||
{ | ||
return false; | ||
} | ||
|
||
return base.BeforeDraw(in args); | ||
} | ||
|
||
protected override void Draw(in OverlayDrawArgs args) | ||
{ | ||
if (ScreenTexture is null) | ||
return; | ||
|
||
_painShader.SetParameter("SCREEN_TEXTURE", ScreenTexture); | ||
|
||
var worldHandle = args.WorldHandle; | ||
var viewport = args.WorldBounds; | ||
worldHandle.SetTransform(Matrix3x2.Identity); | ||
worldHandle.UseShader(_painShader); | ||
worldHandle.DrawRect(viewport, Color.White); | ||
worldHandle.UseShader(null); | ||
} | ||
} |
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,65 @@ | ||
using Content.Shared.DeltaV.Pain; | ||
using Robust.Client.Graphics; | ||
using Robust.Shared.Player; | ||
|
||
namespace Content.Client.DeltaV.Overlays; | ||
|
||
public sealed partial class PainSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly IOverlayManager _overlayMan = default!; | ||
[Dependency] private readonly ISharedPlayerManager _playerMan = default!; | ||
|
||
private PainOverlay _overlay = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<PainComponent, ComponentInit>(OnPainInit); | ||
SubscribeLocalEvent<PainComponent, ComponentShutdown>(OnPainShutdown); | ||
SubscribeLocalEvent<PainComponent, LocalPlayerAttachedEvent>(OnPlayerAttached); | ||
SubscribeLocalEvent<PainComponent, LocalPlayerDetachedEvent>(OnPlayerDetached); | ||
|
||
_overlay = new(); | ||
} | ||
|
||
private void OnPainInit(Entity<PainComponent> ent, ref ComponentInit args) | ||
{ | ||
if (ent.Owner == _playerMan.LocalEntity && !ent.Comp.Suppressed) | ||
_overlayMan.AddOverlay(_overlay); | ||
} | ||
|
||
private void OnPainShutdown(Entity<PainComponent> ent, ref ComponentShutdown args) | ||
{ | ||
if (ent.Owner == _playerMan.LocalEntity) | ||
_overlayMan.RemoveOverlay(_overlay); | ||
} | ||
|
||
private void OnPlayerAttached(Entity<PainComponent> ent, ref LocalPlayerAttachedEvent args) | ||
{ | ||
if (!ent.Comp.Suppressed) | ||
_overlayMan.AddOverlay(_overlay); | ||
} | ||
|
||
private void OnPlayerDetached(Entity<PainComponent> ent, ref LocalPlayerDetachedEvent args) | ||
{ | ||
_overlayMan.RemoveOverlay(_overlay); | ||
} | ||
|
||
public override void Update(float frameTime) | ||
{ | ||
base.Update(frameTime); | ||
|
||
// Handle showing/hiding overlay based on suppression status | ||
if (_playerMan.LocalEntity is not { } player) | ||
return; | ||
|
||
if (!TryComp<PainComponent>(player, out var comp)) | ||
return; | ||
|
||
if (comp.Suppressed && _overlayMan.HasOverlay<PainOverlay>()) | ||
_overlayMan.RemoveOverlay(_overlay); | ||
else if (!comp.Suppressed && !_overlayMan.HasOverlay<PainOverlay>()) | ||
_overlayMan.AddOverlay(_overlay); | ||
} | ||
} |
65 changes: 65 additions & 0 deletions
65
Content.Client/_EE/FootPrint/FootPrintsVisualizerSystem.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,65 @@ | ||
using Content.Shared._EE.FootPrint; | ||
using Robust.Client.GameObjects; | ||
using Robust.Client.Graphics; | ||
using Robust.Shared.Random; | ||
|
||
namespace Content.Client._EE.FootPrint; | ||
|
||
public sealed class FootPrintsVisualizerSystem : VisualizerSystem<FootPrintComponent> | ||
{ | ||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!; | ||
[Dependency] private readonly IRobustRandom _random = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<FootPrintComponent, ComponentInit>(OnInitialized); | ||
SubscribeLocalEvent<FootPrintComponent, ComponentShutdown>(OnShutdown); | ||
} | ||
|
||
private void OnInitialized(EntityUid uid, FootPrintComponent comp, ComponentInit args) | ||
{ | ||
if (!TryComp<SpriteComponent>(uid, out var sprite)) | ||
return; | ||
|
||
sprite.LayerMapReserveBlank(FootPrintVisualLayers.Print); | ||
UpdateAppearance(uid, comp, sprite); | ||
} | ||
|
||
private void OnShutdown(EntityUid uid, FootPrintComponent comp, ComponentShutdown args) | ||
{ | ||
if (TryComp<SpriteComponent>(uid, out var sprite) | ||
&& sprite.LayerMapTryGet(FootPrintVisualLayers.Print, out var layer)) | ||
sprite.RemoveLayer(layer); | ||
} | ||
|
||
private void UpdateAppearance(EntityUid uid, FootPrintComponent component, SpriteComponent sprite) | ||
{ | ||
if (!sprite.LayerMapTryGet(FootPrintVisualLayers.Print, out var layer) | ||
|| !TryComp<FootPrintsComponent>(component.PrintOwner, out var printsComponent) | ||
|| !TryComp<AppearanceComponent>(uid, out var appearance) | ||
|| !_appearance.TryGetData<FootPrintVisuals>(uid, FootPrintVisualState.State, out var printVisuals, appearance)) | ||
return; | ||
|
||
sprite.LayerSetState(layer, new RSI.StateId(printVisuals switch | ||
{ | ||
FootPrintVisuals.BareFootPrint => printsComponent.RightStep ? printsComponent.RightBarePrint : printsComponent.LeftBarePrint, | ||
FootPrintVisuals.ShoesPrint => printsComponent.ShoesPrint, | ||
FootPrintVisuals.SuitPrint => printsComponent.SuitPrint, | ||
FootPrintVisuals.Dragging => _random.Pick(printsComponent.DraggingPrint), | ||
_ => throw new ArgumentOutOfRangeException($"Unknown {printVisuals} parameter.") | ||
}), printsComponent.RsiPath); | ||
|
||
if (_appearance.TryGetData<Color>(uid, FootPrintVisualState.Color, out var printColor, appearance)) | ||
sprite.LayerSetColor(layer, printColor); | ||
} | ||
|
||
protected override void OnAppearanceChange (EntityUid uid, FootPrintComponent component, ref AppearanceChangeEvent args) | ||
{ | ||
if (args.Sprite is not { } sprite) | ||
return; | ||
|
||
UpdateAppearance(uid, component, sprite); | ||
} | ||
} |
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,30 @@ | ||
using Content.Shared.DeltaV.Pain; | ||
using Content.Shared.EntityEffects; | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Server.EntityEffects.Effects; | ||
|
||
public sealed partial class InPain : EntityEffect | ||
{ | ||
/// <summary> | ||
/// How long should each metabolism cycle make the effect last for. | ||
/// </summary> | ||
[DataField] | ||
public float PainTime = 5f; | ||
|
||
protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) | ||
=> Loc.GetString("reagent-effect-guidebook-addicted", ("chance", Probability)); | ||
|
||
public override void Effect(EntityEffectBaseArgs args) | ||
{ | ||
var painTime = PainTime; | ||
|
||
if (args is EntityEffectReagentArgs reagentArgs) | ||
{ | ||
painTime *= reagentArgs.Scale.Float(); | ||
} | ||
|
||
var painSystem = args.EntityManager.System<SharedPainSystem>(); | ||
painSystem.TryApplyPain(args.TargetEntity, painTime); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
Content.Server/DeltaV/EntityEffects/Effects/SuppressAddiction.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,31 @@ | ||
using Content.Shared.DeltaV.Addictions; | ||
using Content.Shared.EntityEffects; | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Server.EntityEffects.Effects; | ||
|
||
public sealed partial class SuppressAddiction : EntityEffect | ||
{ | ||
/// <summary> | ||
/// How long should the addiction suppression last for each metabolism cycle | ||
/// </summary> | ||
[DataField] | ||
public float SuppressionTime = 30f; | ||
|
||
protected override string ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) | ||
=> Loc.GetString("reagent-effect-guidebook-addiction-suppression", | ||
("chance", Probability)); | ||
|
||
public override void Effect(EntityEffectBaseArgs args) | ||
{ | ||
var suppressionTime = SuppressionTime; | ||
|
||
if (args is EntityEffectReagentArgs reagentArgs) | ||
{ | ||
suppressionTime *= reagentArgs.Scale.Float(); | ||
} | ||
|
||
var addictionSystem = args.EntityManager.System<SharedAddictionSystem>(); | ||
addictionSystem.TrySuppressAddiction(args.TargetEntity, suppressionTime); | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
Content.Server/DeltaV/EntityEffects/Effects/SuppressPain.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,38 @@ | ||
using Content.Shared.DeltaV.Pain; | ||
using Content.Shared.EntityEffects; | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Server.EntityEffects.Effects; | ||
|
||
public sealed partial class SuppressPain : EntityEffect | ||
{ | ||
/// <summary> | ||
/// How long should the pain suppression last for each metabolism cycle | ||
/// </summary> | ||
[DataField] | ||
public float SuppressionTime = 30f; | ||
|
||
/// <summary> | ||
/// The strength level of the pain suppression | ||
/// </summary> | ||
[DataField] | ||
public PainSuppressionLevel SuppressionLevel = PainSuppressionLevel.Normal; | ||
|
||
protected override string ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) | ||
=> Loc.GetString("reagent-effect-guidebook-pain-suppression", | ||
("chance", Probability), | ||
("level", SuppressionLevel.ToString().ToLowerInvariant())); | ||
|
||
public override void Effect(EntityEffectBaseArgs args) | ||
{ | ||
var suppressionTime = SuppressionTime; | ||
|
||
if (args is EntityEffectReagentArgs reagentArgs) | ||
{ | ||
suppressionTime *= reagentArgs.Scale.Float(); | ||
} | ||
|
||
var painSystem = args.EntityManager.System<SharedPainSystem>(); | ||
painSystem.TrySuppressPain(args.TargetEntity, suppressionTime, SuppressionLevel); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
Content.Server/DeltaV/Objectives/Components/TeachLessonConditionComponent.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,10 @@ | ||
using Content.Server.Objectives.Systems; | ||
|
||
namespace Content.Server.Objectives.Components; | ||
|
||
/// <summary> | ||
/// Requires that a target dies once and only once. | ||
/// Depends on <see cref="TargetObjectiveComponent"/> to function. | ||
/// </summary> | ||
[RegisterComponent, Access(typeof(TeachLessonConditionSystem))] | ||
public sealed partial class TeachLessonConditionComponent : Component; |
Oops, something went wrong.