Skip to content

Commit

Permalink
Merge branch 'master' into space-wizards_space-station-14_26187_2024-…
Browse files Browse the repository at this point in the history
…04-22
  • Loading branch information
VMSolidus committed May 4, 2024
2 parents 3d863ff + 3fcc530 commit 098a564
Show file tree
Hide file tree
Showing 164 changed files with 1,983 additions and 169 deletions.
3 changes: 3 additions & 0 deletions Content.Client/Clothing/ClientClothingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,9 @@ private void RenderEquipment(EntityUid equipee, EntityUid equipment, string slot
// note that every insertion requires reshuffling & remapping all the existing layers.
sprite.AddBlankLayer(index);
sprite.LayerMapSet(key, index);

if (layerData.Color != null)
sprite.LayerSetColor(key, layerData.Color.Value);
}
else
index = sprite.LayerMapReserveBlank(key);
Expand Down
2 changes: 2 additions & 0 deletions Content.Client/Drugs/DrugOverlaySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ private void OnPlayerAttached(EntityUid uid, SeeingRainbowsComponent component,
private void OnPlayerDetached(EntityUid uid, SeeingRainbowsComponent component, LocalPlayerDetachedEvent args)
{
_overlay.Intoxication = 0;
_overlay.TimeTicker = 0;
_overlayMan.RemoveOverlay(_overlay);
}

Expand All @@ -52,6 +53,7 @@ private void OnShutdown(EntityUid uid, SeeingRainbowsComponent component, Compon
if (_player.LocalEntity == uid)
{
_overlay.Intoxication = 0;
_overlay.TimeTicker = 0;
_overlayMan.RemoveOverlay(_overlay);
}
}
Expand Down
13 changes: 12 additions & 1 deletion Content.Client/Drugs/RainbowOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public sealed class RainbowOverlay : Overlay
private readonly ShaderInstance _rainbowShader;

public float Intoxication = 0.0f;
public float TimeTicker = 0.0f;

private const float VisualThreshold = 10.0f;
private const float PowerDivisor = 250.0f;
Expand Down Expand Up @@ -48,7 +49,17 @@ protected override void FrameUpdate(FrameEventArgs args)
return;

var timeLeft = (float) (time.Value.Item2 - time.Value.Item1).TotalSeconds;
Intoxication += (timeLeft - Intoxication) * args.DeltaSeconds / 16f;

TimeTicker += args.DeltaSeconds;

if (timeLeft - TimeTicker > timeLeft / 16f)
{
Intoxication += (timeLeft - Intoxication) * args.DeltaSeconds / 16f;
}
else
{
Intoxication -= Intoxication/(timeLeft - TimeTicker) * args.DeltaSeconds;
}
}

protected override bool BeforeDraw(in OverlayDrawArgs args)
Expand Down
14 changes: 11 additions & 3 deletions Content.Client/Shuttles/UI/MapScreen.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -318,18 +318,22 @@ private void RebuildMapObjects()

foreach (var grid in _mapManager.GetAllMapGrids(mapComp.MapId))
{
_entManager.TryGetComponent(grid.Owner, out IFFComponent? iffComp);

var gridObj = new GridMapObject()
{
Name = _entManager.GetComponent<MetaDataComponent>(grid.Owner).EntityName,
Entity = grid.Owner
Entity = grid.Owner,
HideButton = iffComp != null && (iffComp.Flags & IFFFlags.HideLabel) != 0x0,
};

// Always show our shuttle immediately
if (grid.Owner == _shuttleEntity)
{
AddMapObject(mapComp.MapId, gridObj);
}
else
else if (iffComp == null ||
(iffComp.Flags & IFFFlags.Hide) == 0x0)
{
_pendingMapObjects.Add((mapComp.MapId, gridObj));
}
Expand Down Expand Up @@ -423,10 +427,14 @@ public void SetMap(MapId mapId, Vector2 position)
/// </summary>
private void AddMapObject(MapId mapId, IMapObject mapObj)
{
var gridContents = _mapHeadings[mapId];
var existing = _mapObjects.GetOrNew(mapId);
existing.Add(mapObj);

if (mapObj.HideButton)
return;

var gridContents = _mapHeadings[mapId];

var gridButton = new Button()
{
Text = mapObj.Name,
Expand Down
5 changes: 4 additions & 1 deletion Content.Client/Shuttles/UI/ShuttleMapControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ protected override void Draw(DrawingHandleScreen handle)
// Rudimentary IFF for now, if IFF hiding on then we don't show on the map at all
if (grid.Owner != _shuttleEntity &&
EntManager.TryGetComponent(grid, out iffComp) &&
(iffComp.Flags & (IFFFlags.Hide | IFFFlags.HideLabel)) != 0x0)
(iffComp.Flags & IFFFlags.Hide) != 0x0)
{
continue;
}
Expand All @@ -367,6 +367,9 @@ protected override void Draw(DrawingHandleScreen handle)
AddMapObject(existingEdges, existingVerts, mapObject);

// Text
if (iffComp != null && (iffComp.Flags & IFFFlags.HideLabel) != 0x0)
continue;

// Force drawing it at this point.
var iffText = _shuttles.GetIFFLabel(grid, self: true, component: iffComp);

Expand Down
27 changes: 24 additions & 3 deletions Content.Client/Sprite/RandomSpriteSystem.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using Content.Client.Clothing;
using Content.Shared.Clothing.Components;
using Content.Shared.Sprite;
using Robust.Client.GameObjects;
using Robust.Shared.GameStates;
Expand All @@ -8,6 +10,7 @@ namespace Content.Client.Sprite;
public sealed class RandomSpriteSystem : SharedRandomSpriteSystem
{
[Dependency] private readonly IReflectionManager _reflection = default!;
[Dependency] private readonly ClientClothingSystem _clothing = default!;

public override void Initialize()
{
Expand All @@ -31,10 +34,29 @@ private void OnHandleState(EntityUid uid, RandomSpriteComponent component, ref C
component.Selected.Add(layer.Key, layer.Value);
}

UpdateAppearance(uid, component);
UpdateSpriteComponentAppearance(uid, component);
UpdateClothingComponentAppearance(uid, component);
}

private void UpdateAppearance(EntityUid uid, RandomSpriteComponent component, SpriteComponent? sprite = null)
private void UpdateClothingComponentAppearance(EntityUid uid, RandomSpriteComponent component, ClothingComponent? clothing = null)
{
if (!Resolve(uid, ref clothing, false))
return;

if (clothing.ClothingVisuals == null)
return;

foreach (var slotPair in clothing.ClothingVisuals)
{
foreach (var keyColorPair in component.Selected)
{
_clothing.SetLayerColor(clothing, slotPair.Key, keyColorPair.Key, keyColorPair.Value.Color);
_clothing.SetLayerState(clothing, slotPair.Key, keyColorPair.Key, keyColorPair.Value.State);
}
}
}

private void UpdateSpriteComponentAppearance(EntityUid uid, RandomSpriteComponent component, SpriteComponent? sprite = null)
{
if (!Resolve(uid, ref sprite, false))
return;
Expand All @@ -55,7 +77,6 @@ private void UpdateAppearance(EntityUid uid, RandomSpriteComponent component, Sp
continue;
}
}

sprite.LayerSetState(index, layer.Value.State);
sprite.LayerSetColor(index, layer.Value.Color ?? Color.White);
}
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Shuttles/Systems/DockingSystem.Shuttle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ private bool CanDock(

foreach (var config in configs)
{
if (config.Coordinates.Equals(coordinates) && config.Angle.EqualsApprox(angle, 0.01))
if (config.Coordinates.Equals(coordinates) && config.Angle.EqualsApprox(angle, 0.15))
{
return config;
}
Expand Down
3 changes: 1 addition & 2 deletions Content.Server/Zombies/PendingZombieComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ public sealed partial class PendingZombieComponent : Component
{
DamageDict = new ()
{
{ "Blunt", 0.25 },
{ "Poison", 0.1 },
{ "Poison", 0.3 },
}
};

Expand Down
33 changes: 33 additions & 0 deletions Content.Shared/Clothing/EntitySystems/ClothingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,5 +217,38 @@ public void CopyVisuals(EntityUid uid, ClothingComponent otherClothing, Clothing
Dirty(uid, clothing);
}

public void SetLayerColor(ClothingComponent clothing, string slot, string mapKey, Color? color)
{
if (clothing.ClothingVisuals == null)
return;

foreach (var layer in clothing.ClothingVisuals[slot])
{
if (layer.MapKeys == null)
return;

if (!layer.MapKeys.Contains(mapKey))
continue;

layer.Color = color;
}
}
public void SetLayerState(ClothingComponent clothing, string slot, string mapKey, string state)
{
if (clothing.ClothingVisuals == null)
return;

foreach (var layer in clothing.ClothingVisuals[slot])
{
if (layer.MapKeys == null)
return;

if (!layer.MapKeys.Contains(mapKey))
continue;

layer.State = state;
}
}

#endregion
}
2 changes: 1 addition & 1 deletion Content.Shared/Doors/Components/AirlockComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public sealed partial class AirlockComponent : Component
public bool Safety = true;

[ViewVariables(VVAccess.ReadWrite)]
[DataField]
[DataField, AutoNetworkedField]
public bool EmergencyAccess = false;

/// <summary>
Expand Down
1 change: 1 addition & 0 deletions Content.Shared/Doors/Systems/SharedAirlockSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ public void UpdateEmergencyLightStatus(EntityUid uid, AirlockComponent component
public void ToggleEmergencyAccess(EntityUid uid, AirlockComponent component)
{
component.EmergencyAccess = !component.EmergencyAccess;
Dirty(uid, component); // This only runs on the server apparently so we need this.
UpdateEmergencyLightStatus(uid, component);
}

Expand Down
6 changes: 3 additions & 3 deletions Content.Shared/Shuttles/Systems/SharedShuttleSystem.IFF.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void SetIFFColor(EntityUid gridUid, Color color, IFFComponent? component
return;

component.Color = color;
Dirty(component);
Dirty(gridUid, component);
UpdateIFFInterfaces(gridUid, component);
}

Expand All @@ -73,7 +73,7 @@ public void AddIFFFlag(EntityUid gridUid, IFFFlags flags, IFFComponent? componen
return;

component.Flags |= flags;
Dirty(component);
Dirty(gridUid, component);
UpdateIFFInterfaces(gridUid, component);
}

Expand All @@ -87,7 +87,7 @@ public void RemoveIFFFlag(EntityUid gridUid, IFFFlags flags, IFFComponent? compo
return;

component.Flags &= ~flags;
Dirty(component);
Dirty(gridUid, component);
UpdateIFFInterfaces(gridUid, component);
}
}
1 change: 1 addition & 0 deletions Content.Shared/Shuttles/UI/MapObjects/GridMapObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ namespace Content.Shared.Shuttles.UI.MapObjects;
public record struct GridMapObject : IMapObject
{
public string Name { get; set; }
public bool HideButton { get; init; }
public EntityUid Entity;
}
5 changes: 5 additions & 0 deletions Content.Shared/Shuttles/UI/MapObjects/IMapObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@ namespace Content.Shared.Shuttles.UI.MapObjects;
public interface IMapObject
{
string Name { get; }

/// <summary>
/// Should we hide the button from being shown (AKA just draw it).
/// </summary>
bool HideButton { get; }
}
5 changes: 4 additions & 1 deletion Content.Shared/Shuttles/UI/MapObjects/ShuttleBeaconObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@
namespace Content.Shared.Shuttles.UI.MapObjects;

[Serializable, NetSerializable]
public readonly record struct ShuttleBeaconObject(NetEntity Entity, NetCoordinates Coordinates, string Name) : IMapObject;
public readonly record struct ShuttleBeaconObject(NetEntity Entity, NetCoordinates Coordinates, string Name) : IMapObject
{
public bool HideButton => false;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@
namespace Content.Shared.Shuttles.UI.MapObjects;

[Serializable, NetSerializable]
public record struct ShuttleExclusionObject(NetCoordinates Coordinates, float Range, string Name = "") : IMapObject;
public record struct ShuttleExclusionObject(NetCoordinates Coordinates, float Range, string Name = "") : IMapObject
{
public bool HideButton => false;
}
4 changes: 2 additions & 2 deletions Content.Shared/Zombies/ZombieComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ public sealed partial class ZombieComponent : Component, IAntagStatusIconCompone
/// The baseline infection chance you have if you are completely nude
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
public float MaxZombieInfectionChance = 0.50f;
public float MaxZombieInfectionChance = 0.80f;

/// <summary>
/// The minimum infection chance possible. This is simply to prevent
/// being invincible by bundling up.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
public float MinZombieInfectionChance = 0.20f;
public float MinZombieInfectionChance = 0.50f;

[ViewVariables(VVAccess.ReadWrite)]
public float ZombieMovementSpeedDebuff = 0.70f;
Expand Down
Binary file modified Resources/Audio/Voice/Misc/silly_snore.ogg
Binary file not shown.
10 changes: 10 additions & 0 deletions Resources/Locale/en-US/advertisements/vending/lawdrobe.ftl
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
advertisement-lawdrobe-1 = OBJECTION! Get the rule of law for yourself!
advertisement-lawdrobe-2 = Go pester security until they abide by your own rules!
advertisement-lawdrobe-3 = A new case just came in? Go get them out of jail!
advertisement-lawdrobe-4 = A dougnut a day keeps security away!
advertisement-lawdrobe-5 = No one is above the law!
advertisement-lawdrobe-6 = No officer, I do not consent to a search!
advertisement-lawdrobe-7 = Injecting space drugs leaves no evidence!
advertisement-lawdrobe-8 = You or a loved one hurt by Nanotrasen? Too bad!
thankyou-lawdrobe-1 = You can win any case in that outfit!
thankyou-lawdrobe-2 = Get one for your client as well!
thankyou-lawdrobe-3 = Win or lose, you get paid either way!
thankyou-lawdrobe-4 = Remember: Its only illegal if you get caught!
thankyou-lawdrobe-5 = OBJECTION! That outfit is too cool for court!
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ advertisement-courierdrobe-2 = A great investment for your survival!
advertisement-courierdrobe-3 = Wear your brown with pride!
advertisement-courierdrobe-4 = These shorts are comfy and easy to wear, get yours now!
advertisement-courierdrobe-5 = Outrun every danger with our stylish clothes!
thankyou-courierdrobe-1 = Now get out there and deliver that mail!
thankyou-courierdrobe-1 = Those parcels aren't going to deliver themselves!
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
advertisement-pride-1 = Be gay do crime!
advertisement-pride-2 = Full of colors!
advertisement-pride-3 = You are valid!
thankyou-pride-1 = Go, do some crime!
thankyou-pride-1 = Have a colorful day!
4 changes: 4 additions & 0 deletions Resources/Locale/en-US/deltav/markings/Oni.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
marking-OniHornShaved = Shaved
marking-OniHornShaved-shaved = Shaved
marking-OniHornBull = Bull
marking-OniHornBull-bull = Bull
16 changes: 8 additions & 8 deletions Resources/Locale/en-US/deltav/navmap-beacons/station-beacons.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,31 @@ station-beacon-epistemics = Epistemics
station-beacon-mystagogue = Mystagogue
station-beacon-logistics = Logistics
station-beacon-logistics-reception = Logistics Reception
station-beacon-logistics-reception = Logistics
station-beacon-lo = LO
station-beacon-conference-room = Conference Room
station-beacon-virology = Virology
station-beacon-metempsychosis = Metempsychosis
station-beacon-exam = Exam Room
station-beacon-exam = Exam
station-beacon-med-outpost = Med Outpost
station-beacon-psych = Psychologist
station-beacon-psych = Psych
station-beacon-glimmer-prober = Glimmer Prober
station-beacon-forensic-mantis = Forensic Mantis
station-beacon-glimmer-prober = Prober
station-beacon-forensic-mantis = Mantis
station-beacon-mailroom = Mail
station-beacon-engi-outpost = Engi Outpost
station-beacon-janitor-office = Jani Office
station-beacon-janitor-closet = Jani closet
station-beacon-janitor-closet = Jani Closet
station-beacon-reporter = Reporter
station-beacon-camera-servers = Camera Servers
station-beacon-camera-servers = Cameras
station-beacon-boxing-ring = Boxing Ring
station-beacon-boxing-ring = Boxing
station-beacon-park = Park
station-beacon-corpsman = Corpsman
Loading

0 comments on commit 098a564

Please sign in to comment.