Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Commit

Permalink
Resolved merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Vonsant committed Jun 1, 2024
2 parents 664c72c + 76aaeed commit 5ae3659
Show file tree
Hide file tree
Showing 345 changed files with 4,685 additions and 1,589 deletions.
2 changes: 1 addition & 1 deletion Content.IntegrationTests/Tests/Fluids/FluidSpillTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ await server.WaitPost(() =>
await server.WaitAssertion(() =>
{
var grid = entityManager.GetComponent<MapGridComponent>(gridId);
var solution = new Solution("Blood", FixedPoint2.New(100));
var solution = new Solution("Wine", FixedPoint2.New(100)); // Frontier - Blood to wine so test pass
var tileRef = grid.GetTileRef(puddleOrigin);
#pragma warning disable NUnit2045 // Interdependent tests
Assert.That(puddleSystem.TrySpillAt(tileRef, solution, out _), Is.True);
Expand Down
7 changes: 7 additions & 0 deletions Content.Server/Explosion/Components/ExplosiveComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ public sealed partial class ExplosiveComponent : Component
[DataField("deleteAfterExplosion")]
public bool? DeleteAfterExplosion;

/// <summary>
/// Whether to not set <see cref="Exploded"/> to true, allowing it to explode multiple times.
/// This should never be used if it is damageable.
/// </summary>
[DataField]
public bool Repeatable;

/// <summary>
/// Avoid somehow double-triggering this explosion (e.g. by damaging this entity from its own explosion.
/// </summary>
Expand Down
25 changes: 25 additions & 0 deletions Content.Server/Explosion/Components/RepeatingTriggerComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using Content.Server.Explosion.EntitySystems;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;

namespace Content.Server.Explosion.Components;

/// <summary>
/// Constantly triggers after being added to an entity.
/// </summary>
[RegisterComponent, Access(typeof(TriggerSystem))]
[AutoGenerateComponentPause]
public sealed partial class RepeatingTriggerComponent : Component
{
/// <summary>
/// How long to wait between triggers.
/// The first trigger starts this long after the component is added.
/// </summary>
[DataField]
public TimeSpan Delay = TimeSpan.FromSeconds(1);

/// <summary>
/// When the next trigger will be.
/// </summary>
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoPausedField]
public TimeSpan NextTrigger;
}
2 changes: 1 addition & 1 deletion Content.Server/Explosion/EntitySystems/ExplosionSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public void TriggerExplosive(EntityUid uid, ExplosiveComponent? explosive = null
if (explosive.Exploded)
return;

explosive.Exploded = true;
explosive.Exploded = !explosive.Repeatable;

// Override the explosion intensity if optional arguments were provided.
if (radius != null)
Expand Down
21 changes: 21 additions & 0 deletions Content.Server/Explosion/EntitySystems/TriggerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public override void Initialize()
SubscribeLocalEvent<TriggerOnStepTriggerComponent, StepTriggeredOffEvent>(OnStepTriggered);
SubscribeLocalEvent<TriggerOnSlipComponent, SlipEvent>(OnSlipTriggered);
SubscribeLocalEvent<TriggerWhenEmptyComponent, OnEmptyGunShotEvent>(OnEmptyTriggered);
SubscribeLocalEvent<RepeatingTriggerComponent, MapInitEvent>(OnRepeatInit);

SubscribeLocalEvent<SpawnOnTriggerComponent, TriggerEvent>(OnSpawnTrigger);
SubscribeLocalEvent<DeleteOnTriggerComponent, TriggerEvent>(HandleDeleteTrigger);
Expand Down Expand Up @@ -278,6 +279,11 @@ private void OnEmptyTriggered(EntityUid uid, TriggerWhenEmptyComponent component
Trigger(uid, args.EmptyGun);
}

private void OnRepeatInit(Entity<RepeatingTriggerComponent> ent, ref MapInitEvent args)
{
ent.Comp.NextTrigger = _timing.CurTime + ent.Comp.Delay;
}

public bool Trigger(EntityUid trigger, EntityUid? user = null)
{
var triggerEvent = new TriggerEvent(trigger, user);
Expand Down Expand Up @@ -360,6 +366,7 @@ public override void Update(float frameTime)
UpdateProximity();
UpdateTimer(frameTime);
UpdateTimedCollide(frameTime);
UpdateRepeat();
}

private void UpdateTimer(float frameTime)
Expand Down Expand Up @@ -394,5 +401,19 @@ private void UpdateTimer(float frameTime)
_appearance.SetData(uid, TriggerVisuals.VisualState, TriggerVisualState.Unprimed, appearance);
}
}

private void UpdateRepeat()
{
var now = _timing.CurTime;
var query = EntityQueryEnumerator<RepeatingTriggerComponent>();
while (query.MoveNext(out var uid, out var comp))
{
if (comp.NextTrigger > now)
continue;

comp.NextTrigger = now + comp.Delay;
Trigger(uid);
}
}
}
}
11 changes: 11 additions & 0 deletions Content.Server/MassMedia/Systems/NewsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using Content.Shared.Popups;
using Content.Shared.StationRecords;
using Robust.Shared.Audio.Systems;
using Content.Shared.GameTicking; // Frontier

namespace Content.Server.MassMedia.Systems;

Expand All @@ -43,6 +44,8 @@ public override void Initialize()
// News writer
// Frontier: News is shared across the sector. No need to create shuttle-local news caches.
// SubscribeLocalEvent<NewsWriterComponent, MapInitEvent>(OnMapInit);

SubscribeLocalEvent<RoundRestartCleanupEvent>(OnRoundRestart);
// End Frontier

// New writer bui messages
Expand All @@ -59,6 +62,14 @@ public override void Initialize()
SubscribeLocalEvent<NewsReaderCartridgeComponent, CartridgeMessageEvent>(OnReaderUiMessage);
SubscribeLocalEvent<NewsReaderCartridgeComponent, CartridgeUiReadyEvent>(OnReaderUiReady);
}

// Frontier: article lifecycle management
private void OnRoundRestart(RoundRestartCleanupEvent ev)
{
// A new round is starting, clear any articles from the previous round.
SectorNewsComponent.Articles.Clear();
}
// End Frontier

public override void Update(float frameTime)
{
Expand Down
1 change: 0 additions & 1 deletion Content.Shared/Access/Components/IdCardConsoleComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ public WriteToTargetIdMessage(string fullName, string jobTitle, List<ProtoId<Acc
"Maintenance",
"Medical",
"Mercenary", // Frontier
"Pilot", // Frontier
//"Quartermaster",
//"Research",
//"ResearchDirector",
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Access/Systems/AccessReaderSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public bool IsAllowed(
return IsAllowedInternal(access, stationKeys, reader);

if (!_containerSystem.TryGetContainer(target, reader.ContainerAccessProvider, out var container))
return false;
return Paused(target); // when mapping, containers with electronics arent spawned

foreach (var entity in container.ContainedEntities)
{
Expand Down
4 changes: 2 additions & 2 deletions Content.Shared/Blocking/BlockingSystem.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Linq;
using System.Linq;
using Content.Shared.Actions;
using Content.Shared.Damage;
using Content.Shared.Examine;
Expand Down Expand Up @@ -209,7 +209,7 @@ public bool StartBlocking(EntityUid item, BlockingComponent component, EntityUid
_fixtureSystem.TryCreateFixture(user,
component.Shape,
BlockingComponent.BlockFixtureID,
hard: true,
hard: false, // Frontier - True to false, mobs AI abuse.
collisionLayer: (int) CollisionGroup.WallLayer,
body: physicsComponent);
}
Expand Down
13 changes: 12 additions & 1 deletion Content.Shared/Fluids/SharedPuddleSystem.Evaporation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,18 @@ public abstract partial class SharedPuddleSystem
[ValidatePrototypeId<ReagentPrototype>]
private const string Water = "Water";

public static readonly string[] EvaporationReagents = [Water];
private const string FluorosulfuricAcid = "FluorosulfuricAcid"; // Frontier
private const string Vomit = "Vomit"; // Frontier
private const string InsectBlood = "InsectBlood"; // Frontier
private const string AmmoniaBlood = "AmmoniaBlood"; // Frontier
private const string ZombieBlood = "ZombieBlood"; // Frontier
private const string Blood = "Blood"; // Frontier
private const string Slime = "Slime"; // Frontier
private const string CopperBlood = "CopperBlood"; // Frontier
private const string Sap = "Sap"; // Frontier
private const string JuiceTomato = "JuiceTomato"; // Frontier

public static readonly string[] EvaporationReagents = [Water, Vomit, InsectBlood, AmmoniaBlood, ZombieBlood, Blood, Slime, CopperBlood, FluorosulfuricAcid, Sap, JuiceTomato]; // Frontier

public bool CanFullyEvaporate(Solution solution)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ private void OnBeforeRangedInteract(Entity<VirtualItemComponent> ent, ref Before
}

#region Hands

/// <summary>
/// Spawns a virtual item in a empty hand
/// </summary>
Expand Down Expand Up @@ -151,7 +150,7 @@ public void DeleteInHandsMatching(EntityUid user, EntityUid matching)
/// </summary>
/// <param name="blockingEnt">The entity we will make a virtual entity copy of</param>
/// <param name="user">The entity that we want to insert the virtual entity</param>
/// <param name="slot">The slot to which we will insert the virtual entity (could be the "shoes" slot, for example)</para
/// <param name="slot">The slot to which we will insert the virtual entity (could be the "shoes" slot, for example)</param>
/// <param name="force">Whether or not to force an equip</param>
public bool TrySpawnVirtualItemInInventory(EntityUid blockingEnt, EntityUid user, string slot, bool force = false)
{
Expand All @@ -173,6 +172,8 @@ public bool TrySpawnVirtualItemInInventory(EntityUid blockingEnt, EntityUid user
/// that's done check if the found virtual entity is a copy of our matching entity,
/// if it is, delete it
/// </summary>
/// <param name="user">The entity that we want to delete the virtual entity from</param>
/// <param name="matching">The entity that made the virtual entity</param>
/// <param name="slotName">Set this param if you have the name of the slot, it avoids unnecessary queries</param>
/// <param name="user">The entity that we want to delete the virtual entity from</param>
/// <param name="matching">The entity that made the virtual entity</param>
Expand Down
8 changes: 8 additions & 0 deletions Content.Shared/Preferences/Loadouts/RoleLoadout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,20 @@ public void EnsureValid(ICommonSession session, IDependencyCollection collection
{
var loadout = loadouts[i];

// Old prototype or otherwise invalid.
if (!protoManager.TryIndex(loadout.Prototype, out var loadoutProto))
{
loadouts.RemoveAt(i);
continue;
}

// Malicious client maybe, check the group even has it.
if (!groupProto.Loadouts.Contains(loadout.Prototype))
{
loadouts.RemoveAt(i);
continue;
}

// Validate the loadout can be applied (e.g. points).
if (!IsValid(session, loadout.Prototype, collection, out _))
{
Expand Down
37 changes: 37 additions & 0 deletions Content.Shared/Weapons/Ranged/Components/ActionGunComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using Content.Shared.Actions;
using Content.Shared.Weapons.Ranged.Systems;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;

namespace Content.Shared.Weapons.Ranged.Components;

/// <summary>
/// Lets you shoot a gun using an action.
/// </summary>
[RegisterComponent, NetworkedComponent, Access(typeof(ActionGunSystem))]
public sealed partial class ActionGunComponent : Component
{
/// <summary>
/// Action to create, must use <see cref="ActionGunShootEvent"/>.
/// </summary>
[DataField(required: true)]
public EntProtoId Action = string.Empty;

[DataField]
public EntityUid? ActionEntity;

/// <summary>
/// Prototype of gun entity to spawn.
/// Deleted when this component is removed.
/// </summary>
[DataField(required: true)]
public EntProtoId GunProto = string.Empty;

[DataField]
public EntityUid? Gun;
}

/// <summary>
/// Action event for <see cref="ActionGunComponent"/> to shoot at a position.
/// </summary>
public sealed partial class ActionGunShootEvent : WorldTargetActionEvent;
2 changes: 2 additions & 0 deletions Content.Shared/Weapons/Ranged/Events/ShotAttemptedEvent.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using Content.Shared.Weapons.Ranged.Components;


namespace Content.Shared.Weapons.Ranged.Events;

/// <summary>
Expand Down
41 changes: 41 additions & 0 deletions Content.Shared/Weapons/Ranged/Systems/ActionGunSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using Content.Shared.Actions;
using Content.Shared.Weapons.Ranged.Components;

namespace Content.Shared.Weapons.Ranged.Systems;

public sealed class ActionGunSystem : EntitySystem
{
[Dependency] private readonly SharedActionsSystem _actions = default!;
[Dependency] private readonly SharedGunSystem _gun = default!;

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

SubscribeLocalEvent<ActionGunComponent, MapInitEvent>(OnMapInit);
SubscribeLocalEvent<ActionGunComponent, ComponentShutdown>(OnShutdown);
SubscribeLocalEvent<ActionGunComponent, ActionGunShootEvent>(OnShoot);
}

private void OnMapInit(Entity<ActionGunComponent> ent, ref MapInitEvent args)
{
if (string.IsNullOrEmpty(ent.Comp.Action))
return;

_actions.AddAction(ent, ref ent.Comp.ActionEntity, ent.Comp.Action);
ent.Comp.Gun = Spawn(ent.Comp.GunProto);
}

private void OnShutdown(Entity<ActionGunComponent> ent, ref ComponentShutdown args)
{
if (ent.Comp.Gun is {} gun)
QueueDel(gun);
}

private void OnShoot(Entity<ActionGunComponent> ent, ref ActionGunShootEvent args)
{
if (TryComp<GunComponent>(ent.Comp.Gun, out var gun))
_gun.AttemptShoot(ent, ent.Comp.Gun.Value, gun, args.Target);
}
}

5 changes: 3 additions & 2 deletions Content.Shared/Wieldable/WieldableSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,9 @@ public bool TryWield(EntityUid used, WieldableComponent component, EntityUid use

if (component.WieldSound != null)
_audioSystem.PlayPredicted(component.WieldSound, used, user);

var virtuals = new List<EntityUid>();


var virtuals = new List<EntityUid>();
for (var i = 0; i < component.FreeHandsRequired; i++)
{
if (_virtualItemSystem.TrySpawnVirtualItemInHand(used, user, out var virtualItem, true))
Expand Down
4 changes: 4 additions & 0 deletions Resources/Audio/_NF/Jukebox/attributions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- files: ["lateraligator.ogg"]
license: "CC-BY-3.0"
copyright: "Later Alligator By Silverman Sound Studios. Converted to mono ogg"
source: "https://soundcloud.com/silvermansound/later-alligator"
Binary file added Resources/Audio/_NF/Jukebox/lateraligator.ogg
Binary file not shown.
Loading

0 comments on commit 5ae3659

Please sign in to comment.