Skip to content
This repository was archived by the owner on Apr 6, 2024. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
2020b0b
Update README.md
CharcoalGungan Feb 28, 2023
106d7b9
Update README.md
CharcoalGungan Feb 28, 2023
a6e0ece
Merging Parkstation Underwear
CharcoalGungan Feb 28, 2023
59a12a4
Merging Parkstation Scripts
CharcoalGungan Feb 28, 2023
0a34ad1
stupidity
CharcoalGungan Feb 28, 2023
9a9c39b
Gives Aghosts a small inventory for pockets and fun, and makes Ghosts…
CharcoalGungan Feb 28, 2023
744880e
AGhost Fix
CharcoalGungan Feb 28, 2023
3565f7a
Ghost
Pspritechologist Feb 28, 2023
91b393d
Port Brief command (#975)
DEATHB4DEFEAT Jan 11, 2023
5317ec1
Ghost
Pspritechologist Feb 28, 2023
f4b5c71
Ghost fix 2 Electric Boogaloo
CharcoalGungan Feb 28, 2023
cbe40e0
Update README.md
CharcoalGungan Feb 28, 2023
d8c5e4a
Update README.md
CharcoalGungan Feb 28, 2023
18f86ef
Revert "Gives Aghosts a small inventory for pockets and fun, and make…
CharcoalGungan Mar 1, 2023
0d7b92c
Almayer Tiles
CharcoalGungan Mar 2, 2023
b3350a7
ALMAYER WALL 1
CharcoalGungan Mar 2, 2023
44e794c
almayer window yay
CharcoalGungan Mar 3, 2023
6f82b54
Fixed run scripts
Pspritechologist Mar 3, 2023
f01cd93
Added variables in VendingMachineComponent to allow it to equip eject…
Pspritechologist Mar 3, 2023
27e78bc
Started on cm door sprites
CharcoalGungan Mar 4, 2023
f20eebb
DOORS + CATWALK + MAP PURGE
CharcoalGungan Mar 12, 2023
e6aa784
Made all vending machines equip on eject.
Pspritechologist Mar 3, 2023
56b7e4d
Adds white Almayer walls and windows, fixes Atlas to be essentially f…
Pspritechologist Mar 13, 2023
7825f22
Modified map pools, and fixed Mapping config.
Pspritechologist Mar 13, 2023
a31833e
Squashed commit of the following:
Pspritechologist Mar 24, 2023
5fc7357
Sound collections can now be specified per tile, to allow for dynamic…
Pspritechologist Apr 2, 2023
cfbab4e
Undid the fuckening
Pspritechologist Apr 2, 2023
6f72c5c
Added the basis of the Xeno component to be expanded on for Xeno feat…
Pspritechologist Mar 5, 2023
287d6f3
Working on Facehugger AI, struggling ;-;
Pspritechologist Mar 11, 2023
397671e
DOORS + CATWALK + MAP PURGE
CharcoalGungan Mar 12, 2023
4a06554
Shaders
Pspritechologist Feb 27, 2023
78783a8
Part of the TDM map done between myself and Pengu.
Pspritechologist Mar 13, 2023
b5d1ef1
Map Progress
CharcoalGungan Mar 14, 2023
59b57ee
Added fences, fixed admin testing map, and more progress on TDM map
Pspritechologist Mar 14, 2023
7ea524a
Changed temp map name, and edited some lights
Pspritechologist Mar 15, 2023
a87f47d
Fence added to map
CharcoalGungan Mar 16, 2023
37da972
Made Flatgrass functional, and continued work on it.
Pspritechologist Mar 16, 2023
88c5e1a
Updates to nightvision, Xeno nightvision draft whatever, and color ti…
Pspritechologist Mar 23, 2023
aa8f1e5
Further tweaking towards Nightvision component having custom actions …
Pspritechologist Mar 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -301,3 +301,5 @@ Resources/MapImages
/Content.Docfx/api/
/Content.Docfx/*site


Resources/Prototypes/CM-SS14/Entities/Structures/Doors/airlocks.yml
35 changes: 32 additions & 3 deletions Content.Client/Audio/BackgroundAudioSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Content.Client.GameTicking.Managers;
using Content.Client.Lobby;
using Content.Shared.CCVar;
using Content.Shared.Maps;
using JetBrains.Annotations;
using Robust.Client;
using Robust.Client.GameObjects;
Expand All @@ -11,6 +12,7 @@
using Robust.Client.State;
using Robust.Shared.Audio;
using Robust.Shared.Configuration;
using Robust.Shared.Map;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
Expand All @@ -31,6 +33,8 @@ public sealed class BackgroundAudioSystem : EntitySystem
[Dependency] private readonly IRobustRandom _robustRandom = default!;
[Dependency] private readonly IStateManager _stateManager = default!;
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly IMapManager _mappingManager = default!;
[Dependency] private readonly ITileDefinitionManager _tileDef = default!;

private readonly AudioParams _ambientParams = new(-10f, 1, "Master", 0, 0, 0, true, 0f);
private readonly AudioParams _lobbyParams = new(-5f, 1, "Master", 0, 0, 0, true, 0f);
Expand All @@ -51,14 +55,16 @@ public sealed class BackgroundAudioSystem : EntitySystem

private SoundCollectionPrototype _spaceAmbience = default!;
private SoundCollectionPrototype _stationAmbience = default!;
private SoundCollectionPrototype _defaultAmbience = default!;

public override void Initialize()
{
base.Initialize();

_stationAmbience = _prototypeManager.Index<SoundCollectionPrototype>("StationAmbienceBase");
_spaceAmbience = _prototypeManager.Index<SoundCollectionPrototype>("SpaceAmbienceBase");
_currentCollection = _stationAmbience;
_defaultAmbience = _prototypeManager.Index<SoundCollectionPrototype>("TileForestAmbience");
_currentCollection = _defaultAmbience;

// TODO: Ideally audio loading streamed better / we have more robust audio but this is quite annoying
var cache = IoCManager.Resolve<IResourceCache>();
Expand Down Expand Up @@ -118,10 +124,33 @@ public override void Shutdown()
EndLobbyMusic();
}

public override void FrameUpdate(float frameTime)
{
base.FrameUpdate(frameTime);

if (_playMan.LocalPlayer?.ControlledEntity is not { } entity)
return;

CheckAmbience(Transform(entity));
}

private void CheckAmbience(TransformComponent xform)
{
if (xform.GridUid != null)
ChangeAmbience(_stationAmbience);
if (_mappingManager.TryGetGrid(xform.GridUid.Value, out var grid))
{
var tile = grid.GetTileRef(xform.Coordinates);
var tileDef = (ContentTileDefinition)_tileDef[tile.Tile.TypeId];

if (tileDef.TileAmbientSound == "Stop")
ChangeAmbience(null);

if (tileDef.TileAmbientSound != null &&
_prototypeManager.TryIndex<SoundCollectionPrototype>(tileDef.TileAmbientSound, out var soundCollection))
ChangeAmbience(soundCollection);
else
return;
}
else
ChangeAmbience(_spaceAmbience);
}
Expand All @@ -137,7 +166,7 @@ private void EntParentChanged(ref EntParentChangedMessage message)
CheckAmbience(message.Transform);
}

private void ChangeAmbience(SoundCollectionPrototype newAmbience)
private void ChangeAmbience(SoundCollectionPrototype? newAmbience)
{
if (_currentCollection == newAmbience)
return;
Expand Down
3 changes: 3 additions & 0 deletions Content.Client/Clothing/ClientClothingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ public sealed class ClientClothingSystem : ClothingSystem
{"pocket1", "POCKET1"},
{"pocket2", "POCKET2"},
{"suitstorage", "SUITSTORAGE"},
{"underpants", "UNDERPANTS"},
{"undershirt", "UNDERSHIRT"},
{"socks", "SOCKS"},
};

[Dependency] private readonly IResourceCache _cache = default!;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
using Robust.Client.Graphics;
using Robust.Client.Player;
using Robust.Shared.Enums;
using Robust.Shared.Prototypes;

namespace Content.Client.SimpleStation14.Overlays
{
/// <summary>
/// A simple overlay that applies a color tint to the screen.
/// </summary>
public sealed class ColorTintOverlay : Overlay
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] IEntityManager _entityManager = default!;

public override bool RequestScreenTexture => true;
public override OverlaySpace Space => OverlaySpace.WorldSpace;
private readonly ShaderInstance _shader;

/// <summary>
/// The color to tint the screen to as RGB on a scale of 0-1.
/// </summary>
public Vector3? tintColor = null;
/// <summary>
/// The percent to tint the screen by on a scale of 0-1.
/// </summary>
public float? tintAmount = null;
public Component? comp = null;

public ColorTintOverlay()
{
IoCManager.InjectDependencies(this);

_shader = _prototypeManager.Index<ShaderPrototype>("ColorTint").InstanceUnique();
}

protected override void Draw(in OverlayDrawArgs args)
{
if (ScreenTexture == null) return;
if (_playerManager.LocalPlayer?.ControlledEntity is not { Valid: true } player) return;
if (comp != null && !_entityManager.TryGetComponent(player, comp.GetType(), out IComponent? _)) return;

_shader?.SetParameter("SCREEN_TEXTURE", ScreenTexture);
if (tintColor != null) _shader?.SetParameter("tint_color", (Vector3) tintColor);
if (tintAmount != null) _shader?.SetParameter("tint_amount", (float) tintAmount);

var worldHandle = args.WorldHandle;
var viewport = args.WorldBounds;
worldHandle.SetTransform(Matrix3.Identity);
worldHandle.UseShader(_shader);
worldHandle.DrawRect(viewport, Color.White);
worldHandle.UseShader(null);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using Robust.Client.Graphics;
using Robust.Client.Player;
using Robust.Shared.Enums;
using Robust.Shared.Prototypes;
using Content.Shared.SimpleStation14.Overlays;

namespace Content.Client.SimpleStation14.Overlays
{
public sealed class NightvisionOverlay : Overlay
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] IEntityManager _entityManager = default!;


public override bool RequestScreenTexture => true;
public override OverlaySpace Space => OverlaySpace.WorldSpace;
private readonly ShaderInstance _shader;

public NightvisionOverlay()
{
IoCManager.InjectDependencies(this);
_shader = _prototypeManager.Index<ShaderPrototype>("Nightvision").InstanceUnique();
}

protected override void Draw(in OverlayDrawArgs args)
{
if (ScreenTexture == null) return;
if (_playerManager.LocalPlayer?.ControlledEntity is not { Valid: true } player) return;
if (!_entityManager.TryGetComponent<NightvisionComponent>(player, out var component)) return;

_shader?.SetParameter("SCREEN_TEXTURE", ScreenTexture);

_shader?.SetParameter("tint", component.Tint);
_shader?.SetParameter("luminance_threshold", component.Strength);
_shader?.SetParameter("noise_amount", component.Noise);


var worldHandle = args.WorldHandle;
var viewport = args.WorldBounds;
worldHandle.SetTransform(Matrix3.Identity);
worldHandle.UseShader(_shader);
worldHandle.DrawRect(viewport, Color.White);
worldHandle.UseShader(null);
}
}
}
142 changes: 142 additions & 0 deletions Content.Client/SimpleStation14/Overlays/Systems/NightvisionSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.Player;
using Content.Shared.SimpleStation14.Overlays;
using Robust.Shared.Prototypes;
using Content.Shared.Actions.ActionTypes;
using Content.Shared.Actions;

namespace Content.Client.SimpleStation14.Overlays;
public sealed class NightvisionSystem : EntitySystem
{
[Dependency] private readonly IPlayerManager _player = default!;
[Dependency] private readonly IOverlayManager _overlayMan = default!;
[Dependency] private readonly IEntityManager _entityManager = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly SharedActionsSystem _action = default!;

private NightvisionOverlay _overlay = default!;

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<NightvisionComponent, ComponentStartup>(OnNightvisionStartup);
SubscribeLocalEvent<NightvisionComponent, ComponentShutdown>(OnNightvisionShutdown);

SubscribeLocalEvent<NightvisionComponent, PlayerAttachedEvent>(OnPlayerAttached);
SubscribeLocalEvent<NightvisionComponent, PlayerDetachedEvent>(OnPlayerDetached);

SubscribeLocalEvent<NightvisionComponent, NightvisionToggleActionEvent>(OnNightvisionToggle);

_overlay = new();
}


private void OnNightvisionToggle(EntityUid uid, NightvisionComponent component, NightvisionToggleActionEvent args)
{
if (_player.LocalPlayer?.ControlledEntity == null)
{
Logger.Warning("Tried to toggle nightvision without a player!");
return;
}

// var uid = _player.LocalPlayer.ControlledEntity.Value;
// var component = _entityManager.GetComponent<NightvisionComponent>(uid);

Logger.Warning("Toggled nightvision!");

if (!component.Enabled)
{
component.Enabled = true;
_overlayMan.AddOverlay(_overlay);
}
else
{
component.Enabled = false;
_overlayMan.RemoveOverlay(_overlay);
}
}

/// <summary>
/// Handles adding the toggle Nightvision action to a player, based on the <see cref="NightvisionComponent"/>.
/// </summary>
/// <param name="uid">The entity to add the action to.</param>
/// <param name="component">The component to use for the action.</param>
/// <param name="provider">The entity that provides the action. Defaults to the entity itself.</param>
/// <param name="enabled">Whether or not the action is enabled immediately.</param>
private void AddNightvisionAction(EntityUid uid, NightvisionComponent component, EntityUid? provider = null, bool enabled = false)
{
if (!_prototypeManager.TryIndex<InstantActionPrototype>("NightvisionToggleAction", out var toggleAction))
return;

var action = new InstantAction(toggleAction);

action.DisplayName = component.ActionName;
action.Description = component.ActionDescription;

if (component.Icon != null)
{
action.Icon = component.Icon;

if (component.IconOn != null)
action.IconOn = component.IconOn;
}
else

if (component.ToggleSound != null)
{
action.Sound = component.ToggleSound;
}

_action.AddAction(uid, action, provider ?? uid);

if (enabled)
{
_action.SetToggled(action, true);
}
}

private void AddNightvision(EntityUid uid, NightvisionComponent component, EntityUid? provider = null)
{
if (component.Enabled)
{
_overlayMan.AddOverlay(_overlay);
}

if (component.Toggle)
{
AddNightvisionAction(uid, component, uid, component.Enabled);
}
}

private void RemoveOverlay(EntityUid uid, NightvisionComponent component)
{
_overlayMan.RemoveOverlay(_overlay);
}


private void OnNightvisionStartup(EntityUid uid, NightvisionComponent component, ComponentStartup args)
{
if (component.Granted && _player.LocalPlayer?.ControlledEntity == uid)
AddNightvision(uid, component);
}

private void OnNightvisionShutdown(EntityUid uid, NightvisionComponent component, ComponentShutdown args)
{
if (component.Granted && _player.LocalPlayer?.ControlledEntity == uid)
RemoveOverlay(uid, component);
}

private void OnPlayerAttached(EntityUid uid, NightvisionComponent component, PlayerAttachedEvent args)
{
if (component.Granted)
AddNightvision(uid, component);
}

private void OnPlayerDetached(EntityUid uid, NightvisionComponent component, PlayerDetachedEvent args)
{
if (component.Granted)
RemoveOverlay(uid, component);
}
}
Loading