Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into pr/671
Browse files Browse the repository at this point in the history
  • Loading branch information
FoxxoTrystan committed Dec 30, 2023
2 parents a8b91ea + 0963ad0 commit 0094be3
Show file tree
Hide file tree
Showing 302 changed files with 25,368 additions and 3,891 deletions.
18 changes: 7 additions & 11 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
"Changes: Sprites":
- '**/*.rsi/*.png'
"Map":
- 'Resources/Maps/**/*.yml' # All .yml files in the Resources/Maps directory, recursive.
- 'Resources/Prototypes/Maps/frontier.yml'
- 'Resources/Prototypes/_NF/Shipyard/*.yml' # POI's are also here for some reason.

"Changes: Map":
- 'Resources/Maps/*.yml'
- 'Resources/Prototypes/Maps/*.yml'

"Changes: UI":
- '**/*.xaml*'

"No C#":
- all: ["!**/*.cs"]
"Shuttle":
- 'Resources/Maps/Shuttles/*.yml' # All .yml files directly in the Resources/Maps/Shuttles directory.
- 'Resources/Prototypes/_NF/Shipyard/*.yml' # Shuttles!
24 changes: 24 additions & 0 deletions .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This workflow will triage pull requests and apply a label based on the
# paths that are modified in the pull request.
#
# To use this workflow, you will need to set up a .github/labeler.yml
# file with configuration. For more information, see:
# https://github.com/actions/labeler

# This is entirely a github default file, except for this comment, but it should be fine. -Tsjip

name: Labeler
on: [pull_request_target]

jobs:
label:

runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write

steps:
- uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
3 changes: 2 additions & 1 deletion Content.Server/Body/Systems/BodySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ private void OnRelayMoveInput(EntityUid uid, BodyComponent component, ref MoveIn
{
if (_mobState.IsDead(uid) && _mindSystem.TryGetMind(uid, out var mindId, out var mind))
{
mind.TimeOfDeath ??= _gameTiming.RealTime;
// mind.TimeOfDeath ??= _gameTiming.RealTime;
mind.TimeOfDeath ??= _gameTiming.CurTime; // Frontier - fix returning to body messing with the your TOD
_ticker.OnGhostAttempt(mindId, true, mind: mind);
}
}
Expand Down
16 changes: 16 additions & 0 deletions Content.Server/Cloning/CloningSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@
using Content.Shared.Emag.Systems;
using Content.Server.Popups;
using Content.Server.Traits.Assorted;
using Content.Shared._NF.Cloning;
using Content.Shared.Bank.Components;
using Robust.Shared.Serialization.Manager;

namespace Content.Server.Cloning
{
Expand Down Expand Up @@ -65,6 +67,8 @@ public sealed class CloningSystem : EntitySystem
[Dependency] private readonly SharedMindSystem _mindSystem = default!;
[Dependency] private readonly MetaDataSystem _metaSystem = default!;
[Dependency] private readonly SharedJobSystem _jobs = default!;
// Frontier
[Dependency] private readonly ISerializationManager _serialization = default!;

public readonly Dictionary<MindComponent, EntityUid> ClonesWaitingForMind = new();
public const float EasyModeCloningCost = 0.7f;
Expand Down Expand Up @@ -255,6 +259,18 @@ public bool TryCloning(EntityUid uid, EntityUid bodyToClone, Entity<MindComponen
bankComp.Balance = bank.Balance;
}

// Frontier
// Transfer of special components, e.g. small/big traits
foreach (var comp in EntityManager.GetComponents(bodyToClone))
{
if (comp is ITransferredByCloning)
{
var copy = _serialization.CreateCopy(comp, notNullableOverride: true);
copy.Owner = mob;
EntityManager.AddComponent(mob, copy, overwrite: true);
}
}

var ev = new CloningEvent(bodyToClone, mob);
RaiseLocalEvent(bodyToClone, ref ev);

Expand Down
15 changes: 15 additions & 0 deletions Content.Server/Morgue/CrematoriumSystem.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Linq;
using Content.Server.GameTicking;
using Content.Server.Morgue.Components;
using Content.Server.Storage.Components;
Expand All @@ -7,13 +8,16 @@
using Content.Shared.IdentityManagement;
using Content.Shared.Interaction.Events;
using Content.Shared.Mind;
using Content.Shared.Mobs.Components;
using Content.Shared.Mobs.Systems;
using Content.Shared.Morgue;
using Content.Shared.Popups;
using Content.Shared.Standing;
using Content.Shared.Storage;
using Content.Shared.Storage.Components;
using Content.Shared.Verbs;
using Robust.Server.GameObjects;
using Robust.Shared.Enums;
using Robust.Shared.Player;

namespace Content.Server.Morgue;
Expand All @@ -27,6 +31,8 @@ public sealed class CrematoriumSystem : EntitySystem
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly StandingStateSystem _standing = default!;
[Dependency] private readonly SharedMindSystem _minds = default!;
[Dependency] private readonly MobStateSystem _mobState = default!; // Frontier
[Dependency] private readonly SharedMindSystem _mind = default!; // frontier

public override void Initialize()
{
Expand Down Expand Up @@ -108,6 +114,15 @@ public bool TryCremate(EntityUid uid, CrematoriumComponent? component = null, En
if (storage.Open || storage.Contents.ContainedEntities.Count < 1)
return false;

// Frontier - refuse to accept alive mobs and dead-but-connected players
var entity = storage.Contents.ContainedEntities.First();
if (entity is not { Valid: true })
return false;
if (TryComp<MobStateComponent>(entity, out var comp) && !_mobState.IsDead(entity, comp))
return false;
if (_mind.TryGetMind(entity, out var _, out var mind) && mind.Session?.State?.Status == SessionStatus.InGame)
return false;

return Cremate(uid, component, storage);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@

using Content.Shared._NF.Cloning;

namespace Content.Server.Item.PseudoItem
{
/// <summary>
/// For entities that behave like an item under certain conditions,
/// but not under most conditions.
/// </summary>
[RegisterComponent]
public sealed partial class PseudoItemComponent : Component
public sealed partial class PseudoItemComponent : Component, ITransferredByCloning
{
[DataField("size")]
public int Size = 120;
Expand Down
24 changes: 21 additions & 3 deletions Content.Server/Radio/EntitySystems/RadioSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
using Robust.Shared.Random;
using Robust.Shared.Replays;
using Robust.Shared.Utility;
using Content.Shared.IdentityManagement; // Frontier

namespace Content.Server.Radio.EntitySystems;

Expand Down Expand Up @@ -84,9 +85,26 @@ public void SendRadioMessage(EntityUid messageSource, string message, RadioChann
if (!_messages.Add(message))
return;

var name = TryComp(messageSource, out VoiceMaskComponent? mask) && mask.Enabled
? mask.VoiceName
: MetaData(messageSource).EntityName;
var name = MetaData(messageSource).EntityName; // Frontier - code block to allow multi masks.
var mode = "Unknown";

if (TryComp(messageSource, out VoiceMaskComponent? mask) && mask.Enabled)
{
switch (mask.Mode)
{
case Mode.Real:
mode = Identity.Name(messageSource, EntityManager);
break;
case Mode.Fake:
mode = mask.VoiceName;
break;
case Mode.Unknown:
break;
default:
throw new ArgumentOutOfRangeException($"No implemented mask radio behavior for {mask.Mode}!");
}
name = mode;
} // Frontier - code block to allow multi masks.

name = FormattedMessage.EscapeText(name);

Expand Down
11 changes: 11 additions & 0 deletions Content.Server/VoiceMask/VoiceMaskComponent.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
namespace Content.Server.VoiceMask;

public enum Mode : byte // Frontier
{
Real,
Fake,
Unknown
}

[RegisterComponent]
public sealed partial class VoiceMaskComponent : Component
{
[ViewVariables(VVAccess.ReadWrite)] public bool Enabled = true;

[ViewVariables(VVAccess.ReadWrite)] public string VoiceName = "Unknown";

[ViewVariables(VVAccess.ReadWrite), DataField("mode")] // Frontier
[AutoNetworkedField]
public Mode Mode = Mode.Unknown;
}
14 changes: 14 additions & 0 deletions Content.Server/VoiceMask/VoiceMaskSystem.Equip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@ private void OnEquip(EntityUid uid, VoiceMaskerComponent component, GotEquippedE
var comp = EnsureComp<VoiceMaskComponent>(user);
comp.VoiceName = component.LastSetName;

switch (component.RadioMode) // Frontier - code block to allow multi masks.
{
case RadioMode.Real:
comp.Mode = Mode.Real;
break;
case RadioMode.Fake:
comp.Mode = Mode.Fake;
break;
case RadioMode.Unknown:
break;
default:
throw new ArgumentOutOfRangeException($"No implemented mask radio behavior for {component.RadioMode}!");
} // Frontier - code block to allow multi masks.

_actions.AddAction(user, ref component.ActionEntity, component.Action, uid);
}

Expand Down
11 changes: 11 additions & 0 deletions Content.Server/VoiceMask/VoiceMaskerComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@

namespace Content.Server.VoiceMask;

public enum RadioMode : byte // Frontier
{
Real,
Fake,
Unknown
}

[RegisterComponent]
public sealed partial class VoiceMaskerComponent : Component
{
Expand All @@ -12,4 +19,8 @@ public sealed partial class VoiceMaskerComponent : Component
public string Action = "ActionChangeVoiceMask";

[DataField("actionEntity")] public EntityUid? ActionEntity;

[ViewVariables(VVAccess.ReadWrite), DataField("radioMode")] // Frontier
[AutoNetworkedField]
public RadioMode RadioMode = RadioMode.Unknown;
}
4 changes: 3 additions & 1 deletion Content.Server/_NF/SizeAttribute/SizeAttributeComponent.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@

using Content.Shared._NF.Cloning;

namespace Content.Server.SizeAttribute
{
[RegisterComponent]
public sealed partial class SizeAttributeComponent : Component
public sealed partial class SizeAttributeComponent : Component, ITransferredByCloning
{
[DataField("short")]
public bool Short = false;
Expand Down
4 changes: 2 additions & 2 deletions Content.Server/_NF/Smuggling/Components/DeadDropComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ public sealed partial class DeadDropComponent : Component
/// Minimum wait time in seconds to wait for the next dead drop.
/// </summary>
[DataField("minimumCoolDown")]
public int MinimumCoolDown = 600;
public int MinimumCoolDown = 900; // 900 / 60 = 15 minutes

/// <summary>
/// Max wait time in seconds to wait for the next dead drop.
/// </summary>
[DataField("maximumCoolDown")]
public int MaximumCoolDown = 2400;
public int MaximumCoolDown = 2700; // 2700 / 60 = 45 minutes

/// <summary>
/// Minimum distance to spawn the drop.
Expand Down
9 changes: 9 additions & 0 deletions Content.Shared/_NF/Cloning/ITransferredByCloning.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Content.Shared._NF.Cloning;

/// <summary>
/// Indicates that this Component should be transferred to the new entity when the entity is cloned (for example, using a cloner)
/// </summary>
public interface ITransferredByCloning
{
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Map;

namespace Content.Shared._NF.Clothing.Components;

/// <summary>
/// Indicates that the clothing entity emits sound when it moves.
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class EmitsSoundOnMoveComponent : Component
{
[ViewVariables(VVAccess.ReadWrite)]
[DataField(required: true), AutoNetworkedField]
public SoundSpecifier SoundCollection = default!;

[ViewVariables(VVAccess.ReadWrite)]
[DataField("requiresGravity"), AutoNetworkedField]
public bool RequiresGravity = true;

[ViewVariables(VVAccess.ReadOnly)]
public EntityCoordinates LastPosition = EntityCoordinates.Invalid;

/// <summary>
/// The distance moved since the played sound.
/// </summary>
[ViewVariables(VVAccess.ReadOnly)]
public float SoundDistance = 0f;

/// <summary>
/// Whether this item is equipped in a inventory item slot.
/// </summary>
[ViewVariables(VVAccess.ReadOnly)]
public bool IsSlotValid = true;
}
Loading

0 comments on commit 0094be3

Please sign in to comment.