-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'core' of https://github.com/fenndragon/floofstation1 in…
…to core
- Loading branch information
Showing
94 changed files
with
1,282,341 additions
and
937,918 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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# Floofstation CODEOWNERS | ||
|
||
* @Fansana @Memeji @FoxxoTrystan | ||
* @Fansana @Memeji @FoxxoTrystan @Mnemotechnician |
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,82 @@ | ||
using System.Numerics; | ||
using Content.Shared.Shuttles.Components; | ||
using Robust.Client.GameObjects; | ||
using Robust.Client.Graphics; | ||
using Robust.Shared.Enums; | ||
using Robust.Shared.Map.Components; | ||
using Robust.Shared.Prototypes; | ||
using Robust.Shared.Timing; | ||
|
||
namespace Content.Client.Shuttles; | ||
|
||
/// <summary> | ||
/// Plays a visualization whenever a shuttle is arriving from FTL. | ||
/// </summary> | ||
public sealed class FtlArrivalOverlay : Overlay | ||
{ | ||
public override OverlaySpace Space => OverlaySpace.WorldSpaceBelowEntities; | ||
|
||
private EntityLookupSystem _lookups; | ||
private SharedMapSystem _maps; | ||
private SharedTransformSystem _transforms; | ||
private SpriteSystem _sprites; | ||
[Dependency] private readonly IEntityManager _entManager = default!; | ||
[Dependency] private readonly IGameTiming _timing = default!; | ||
[Dependency] private readonly IPrototypeManager _protos = default!; | ||
|
||
private readonly HashSet<Entity<FtlVisualizerComponent>> _visualizers = new(); | ||
|
||
private ShaderInstance _shader; | ||
|
||
public FtlArrivalOverlay() | ||
{ | ||
IoCManager.InjectDependencies(this); | ||
_lookups = _entManager.System<EntityLookupSystem>(); | ||
_transforms = _entManager.System<SharedTransformSystem>(); | ||
_maps = _entManager.System<SharedMapSystem>(); | ||
_sprites = _entManager.System<SpriteSystem>(); | ||
|
||
_shader = _protos.Index<ShaderPrototype>("unshaded").Instance(); | ||
} | ||
|
||
protected override bool BeforeDraw(in OverlayDrawArgs args) | ||
{ | ||
_visualizers.Clear(); | ||
_lookups.GetEntitiesOnMap(args.MapId, _visualizers); | ||
|
||
return _visualizers.Count > 0; | ||
} | ||
|
||
protected override void Draw(in OverlayDrawArgs args) | ||
{ | ||
args.WorldHandle.UseShader(_shader); | ||
|
||
foreach (var (uid, comp) in _visualizers) | ||
{ | ||
var grid = comp.Grid; | ||
|
||
if (!_entManager.TryGetComponent(grid, out MapGridComponent? mapGrid)) | ||
continue; | ||
|
||
var texture = _sprites.GetFrame(comp.Sprite, TimeSpan.FromSeconds(comp.Elapsed), loop: false); | ||
comp.Elapsed += (float) _timing.FrameTime.TotalSeconds; | ||
|
||
// Need to manually transform the viewport in terms of the visualizer entity as the grid isn't in position. | ||
var (_, _, worldMatrix, invMatrix) = _transforms.GetWorldPositionRotationMatrixWithInv(uid); | ||
args.WorldHandle.SetTransform(worldMatrix); | ||
var localAABB = invMatrix.TransformBox(args.WorldBounds); | ||
|
||
var tilesEnumerator = _maps.GetLocalTilesEnumerator(grid, mapGrid, localAABB); | ||
|
||
while (tilesEnumerator.MoveNext(out var tile)) | ||
{ | ||
var bounds = _lookups.GetLocalBounds(tile, mapGrid.TileSize); | ||
|
||
args.WorldHandle.DrawTextureRect(texture, bounds); | ||
} | ||
} | ||
|
||
args.WorldHandle.UseShader(null); | ||
args.WorldHandle.SetTransform(Matrix3x2.Identity); | ||
} | ||
} |
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,21 @@ | ||
using Robust.Client.Graphics; | ||
|
||
namespace Content.Client.Shuttles.Systems; | ||
|
||
public sealed partial class ShuttleSystem | ||
{ | ||
[Dependency] private readonly IOverlayManager _overlays = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
InitializeEmergency(); | ||
_overlays.AddOverlay(new FtlArrivalOverlay()); | ||
} | ||
|
||
public override void Shutdown() | ||
{ | ||
base.Shutdown(); | ||
_overlays.RemoveOverlay<FtlArrivalOverlay>(); | ||
} | ||
} |
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,17 @@ | ||
using Robust.Shared.Map; | ||
|
||
|
||
namespace Content.Server.FloofStation; | ||
|
||
|
||
[RegisterComponent] | ||
public sealed partial class HideoutGeneratorComponent : Component | ||
{ | ||
|
||
/// <summary> | ||
/// Maps we've generated. | ||
/// </summary> | ||
[DataField] | ||
public List<MapId> Generated = new(); | ||
|
||
} |
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
46 changes: 46 additions & 0 deletions
46
Content.Server/Fluids/EntitySystems/AbsorbentSystem.Footprints.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,46 @@ | ||
using System.Linq; | ||
using Content.Shared.Chemistry.Components; | ||
using Content.Shared.Fluids; | ||
using Content.Shared.FootPrint; | ||
using Content.Shared.Timing; | ||
|
||
|
||
namespace Content.Server.Fluids.EntitySystems; | ||
|
||
|
||
// Floof-specific | ||
public sealed partial class AbsorbentSystem | ||
{ | ||
[Dependency] private readonly EntityLookupSystem _lookup = default!; | ||
|
||
/// <summary> | ||
/// Tries to clean a number of footprints in a range determined by the component. Returns the number of cleaned footprints. | ||
/// </summary> | ||
private int TryCleanNearbyFootprints(EntityUid user, EntityUid used, EntityUid target, AbsorbentComponent component, Entity<SolutionComponent> absorbentSoln) | ||
{ | ||
var footprintQuery = GetEntityQuery<FootPrintComponent>(); | ||
var targetCoords = Transform(target).Coordinates; | ||
var entities = _lookup.GetEntitiesInRange(targetCoords, component.FootprintCleaningRange, LookupFlags.Uncontained); | ||
|
||
// Take up to [MaxCleanedFootprints] footprints closest to the target | ||
var cleaned = entities.AsEnumerable() | ||
.Where(footprintQuery.HasComp) | ||
.Select(uid => (uid, dst: Transform(uid).Coordinates.TryDistance(EntityManager, _transform, targetCoords, out var dst) ? dst : 0f)) | ||
.Where(ent => ent.dst > 0f) | ||
.OrderBy(ent => ent.dst) | ||
.Select(ent => (ent.uid, comp: footprintQuery.GetComponent(ent.uid))); | ||
|
||
// And try to interact with each one of them, ignoring useDelay | ||
var processed = 0; | ||
foreach (var (uid, footprintComp) in cleaned) | ||
{ | ||
if (TryPuddleInteract(user, used, uid, component, useDelay: null, absorbentSoln)) | ||
processed++; | ||
|
||
if (processed >= component.MaxCleanedFootprints) | ||
break; | ||
} | ||
|
||
return processed; | ||
} | ||
} |
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
Oops, something went wrong.