Skip to content

Commit

Permalink
Merge branch 'new-frontiers-14:master' into Vulpkanin-Specie
Browse files Browse the repository at this point in the history
  • Loading branch information
FoxxoTrystan authored Sep 21, 2023
2 parents 5f7fee6 + c589573 commit 74a1846
Show file tree
Hide file tree
Showing 120 changed files with 4,952 additions and 3,328 deletions.
2 changes: 1 addition & 1 deletion Content.Server/Ame/EntitySystems/AmeControllerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ private void UpdateController(EntityUid uid, TimeSpan curTime, AmeControllerComp
if (TryComp<PowerSupplierComponent>(uid, out var powerOutlet))
powerOutlet.MaxSupply = powerOutput;
fuelJar.FuelAmount -= availableInject;
_audioSystem.PlayPvs(controller.InjectSound, uid, AudioParams.Default.WithVolume(overloading ? 10f : 0f));
_audioSystem.PlayPvs(controller.InjectSound, uid, AudioParams.Default.WithVolume(overloading ? 5f : -5f));
UpdateUi(uid, controller);
}

Expand Down
50 changes: 48 additions & 2 deletions Content.Server/Paper/PaperSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
using Robust.Shared.Player;
using Robust.Shared.Utility;
using Robust.Shared.Audio;
using Content.Server.Access.Systems;
using Content.Shared.Hands;
using static Content.Shared.Paper.SharedPaperComponent;

namespace Content.Server.Paper
Expand All @@ -27,6 +29,7 @@ public sealed class PaperSystem : EntitySystem
[Dependency] private readonly UserInterfaceSystem _uiSystem = default!;
[Dependency] private readonly MetaDataSystem _metaSystem = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly IdCardSystem _idCardSystem = default!;

public override void Initialize()
{
Expand All @@ -41,6 +44,8 @@ public override void Initialize()
SubscribeLocalEvent<ActivateOnPaperOpenedComponent, PaperWriteEvent>(OnPaperWrite);

SubscribeLocalEvent<PaperComponent, MapInitEvent>(OnMapInit);

SubscribeLocalEvent<StampComponent, GotEquippedHandEvent>(OnHandPickUp);
}

private void OnMapInit(EntityUid uid, PaperComponent paperComp, MapInitEvent args)
Expand Down Expand Up @@ -117,6 +122,24 @@ private void OnInteractUsing(EntityUid uid, PaperComponent paperComp, InteractUs
// If a stamp, attempt to stamp paper
if (TryComp<StampComponent>(args.Used, out var stampComp) && TryStamp(uid, GetStampInfo(stampComp), stampComp.StampState, paperComp))
{
if (stampComp.StampedPersonal)
{
stampComp.StampedIdUser = args.User;

var userName = Loc.GetString("stamp-component-unknown-name");
var userJob = Loc.GetString("stamp-component-unknown-job");
if (_idCardSystem.TryFindIdCard(stampComp.StampedIdUser!.Value, out var card))
{
if (card.FullName != null)
userName = card.FullName;
if (card.JobTitle != null)
userJob = card.JobTitle;
}
//string stampedName = userJob + " - " + userName;
string stampedName = userName;
stampComp.StampedName = stampedName;
}

// successfully stamped, play popup
var stampPaperOtherMessage = Loc.GetString("paper-component-action-stamp-paper-other",
("user", args.User), ("target", args.Target), ("stamp", args.Used));
Expand All @@ -134,9 +157,11 @@ private void OnInteractUsing(EntityUid uid, PaperComponent paperComp, InteractUs

private StampDisplayInfo GetStampInfo(StampComponent stamp)
{
return new StampDisplayInfo {
return new StampDisplayInfo
{
StampedName = stamp.StampedName,
StampedColor = stamp.StampedColor
StampedColor = stamp.StampedColor,
StampedPersonal = stamp.StampedPersonal
};
}

Expand Down Expand Up @@ -215,6 +240,27 @@ public void UpdateUserInterface(EntityUid uid, PaperComponent? paperComp = null,
if (_uiSystem.TryGetUi(uid, PaperUiKey.Key, out var bui))
_uiSystem.SetUiState(bui, new PaperBoundUserInterfaceState(paperComp.Content, paperComp.StampedBy, paperComp.Mode), session);
}

private void OnHandPickUp(EntityUid uid, StampComponent stampComp, GotEquippedHandEvent args)
{
if (stampComp.StampedPersonal)
{
stampComp.StampedIdUser = args.User;

var userName = Loc.GetString("stamp-component-unknown-name");
var userJob = Loc.GetString("stamp-component-unknown-job");
if (_idCardSystem.TryFindIdCard(stampComp.StampedIdUser!.Value, out var card))
{
if (card.FullName != null)
userName = card.FullName;
if (card.JobTitle != null)
userJob = card.JobTitle;
}
//string stampedName = userJob + " - " + userName;
string stampedName = userName;
stampComp.StampedName = stampedName;
}
}
}

/// <summary>
Expand Down
57 changes: 54 additions & 3 deletions Content.Server/StationEvents/Events/AnomalySpawnRule.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
using Content.Server.Anomaly;
using Content.Server.Anomaly;
using Content.Server.GameTicking.Rules.Components;
using Content.Server.Station.Components;
using Content.Server.StationEvents.Components;
using Content.Shared.CCVar;
using Content.Shared.Physics;
using Robust.Shared.Map.Components;
using Robust.Shared.Physics.Components;
using Robust.Shared.Physics;
using Robust.Shared.Configuration;
using Robust.Shared.Random;

namespace Content.Server.StationEvents.Events;

public sealed class AnomalySpawnRule : StationEventSystem<AnomalySpawnRuleComponent>
{
[Dependency] private readonly AnomalySystem _anomaly = default!;
[Dependency] private readonly IConfigurationManager _configuration = default!;
[Dependency] protected readonly IRobustRandom _random = default!;

protected override void Added(EntityUid uid, AnomalySpawnRuleComponent component, GameRuleComponent gameRule, GameRuleAddedEvent args)
{
Expand All @@ -22,7 +31,7 @@ protected override void Started(EntityUid uid, AnomalySpawnRuleComponent compone
{
base.Started(uid, component, gameRule, args);

if (!TryGetRandomStation(out var chosenStation))
if (TryGetRandomStation(out var chosenStation, HasComp<StationJobsComponent>))
return;

if (!TryComp<StationDataComponent>(chosenStation, out var stationData))
Expand All @@ -36,7 +45,49 @@ protected override void Started(EntityUid uid, AnomalySpawnRuleComponent compone
var amountToSpawn = Math.Max(1, (int) MathF.Round(GetSeverityModifier() / 2));
for (var i = 0; i < amountToSpawn; i++)
{
_anomaly.SpawnOnRandomGridLocation(grid.Value, component.AnomalySpawnerPrototype);
SpawnOnRandomGridLocation(grid.Value, component.AnomalySpawnerPrototype);
}
}

private void SpawnOnRandomGridLocation(EntityUid grid, string toSpawn)
{
if (!TryComp<MapGridComponent>(grid, out var gridComp))
return;

var xform = Transform(grid);

var targetCoords = xform.Coordinates;
var gridBounds = gridComp.LocalAABB.Scale(_configuration.GetCVar(CCVars.AnomalyGenerationGridBoundsScale));

for (var i = 0; i < 25; i++)
{
var randomX = _random.Next((int) gridBounds.Left, (int) gridBounds.Right);
var randomY = _random.Next((int) gridBounds.Bottom, (int) gridBounds.Top);

var tile = new Vector2i(randomX, randomY);

// don't spawn inside of solid objects
var physQuery = GetEntityQuery<PhysicsComponent>();
var valid = true;
foreach (var ent in gridComp.GetAnchoredEntities(tile))
{
if (!physQuery.TryGetComponent(ent, out var body))
continue;
if (body.BodyType != BodyType.Static ||
!body.Hard ||
(body.CollisionLayer & (int) CollisionGroup.Impassable) == 0)
continue;

valid = false;
break;
}
if (!valid)
continue;

targetCoords = gridComp.GridTileToLocal(tile);
break;
}

Spawn(toSpawn, targetCoords);
}
}
4 changes: 2 additions & 2 deletions Content.Server/_NF/Commands/GhostRespawnCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ public void Execute(IConsoleShell shell, string argStr, string[] args)
}

var mindSystem = _entityManager.EntitySysManager.GetEntitySystem<MindSystem>();
if (!mindSystem.TryGetMind(shell.Player, out _, out var mind))
if (!mindSystem.TryGetMind(shell.Player, out _, out _))
{
shell.WriteLine("You have no mind.");
return;
}
var time = (_gameTiming.CurTime - mind.TimeOfDeath!.Value);
var time = (_gameTiming.CurTime - ghost.TimeOfDeath);
var respawnTime = _configurationManager.GetCVar(NF14CVars.RespawnTime);

if (respawnTime > time.TotalSeconds)
Expand Down
16 changes: 16 additions & 0 deletions Content.Shared/Paper/StampComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ public partial struct StampDisplayInfo

[DataField("stampedColor")]
public Color StampedColor;

[DataField("stampedPersonal")]
public bool StampedPersonal = false;
};

[RegisterComponent]
Expand Down Expand Up @@ -49,4 +52,17 @@ public sealed partial class StampComponent : Component
{
Params = AudioParams.Default.WithVolume(-2f).WithMaxDistance(5f)
};

/// <summary>
/// The stamp using the person name on it
/// </summary>
[DataField("stampedPersonal")]
public bool StampedPersonal = false;

[ViewVariables]
public EntityUid? StampedIdUser = null;

[ViewVariables(VVAccess.ReadWrite)]
[DataField("nameSetUser")]
public bool NameSetUser { get; set; }
}
Binary file not shown.
104 changes: 104 additions & 0 deletions Resources/Changelog/Changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -677,3 +677,107 @@ Entries:
might show up on your ships.
id: 67
time: '2023-09-14T05:33:20.0000000+00:00'
- author: Cheackraze
changes:
- type: Tweak
message: >-
AME controllers now have noise-cancelling shielding to help curb space
madness
id: 68
time: '2023-09-15T03:55:32.0000000+00:00'
- author: checkraze
changes:
- type: Tweak
message: Asteroids are now much larger and richer
id: 69
time: '2023-09-15T05:23:26.0000000+00:00'
- author: dvir01
changes:
- type: Tweak
message: Captain stamp will use your card name for the stamp.
id: 70
time: '2023-09-16T05:50:32.0000000+00:00'
- author: dvir001
changes:
- type: Add
message: SR Found their sunglasses under the pet bed.
id: 71
time: '2023-09-19T16:42:25.0000000+00:00'
- author: dvir01
changes:
- type: Fix
message: NT Added more lube for belts, they can move more stuff now
id: 72
time: '2023-09-19T16:49:00.0000000+00:00'
- author: dvir01
changes:
- type: Tweak
message: Anomaly locators range went up from 20 to 2000
id: 73
time: '2023-09-19T17:10:25.0000000+00:00'
- author: Leander
changes:
- type: Add
message: >-
Leander Co successfully reverse engineered the genetic code of
mothroaches after stealing a live specimen from the Nyano sector.
id: 74
time: '2023-09-19T17:13:41.0000000+00:00'
- author: Leander
changes:
- type: Add
message: >-
Added blue/red galaxy suits for when you need to do intergalactic
business.
id: 75
time: '2023-09-19T17:15:18.0000000+00:00'
- author: dvir01
changes:
- type: Tweak
message: >-
As per the SR and Security request, Frontier machines are made from a
stronger metal now.
- type: Tweak
message: The pirates Black Market shipyard computer has lost its immortality.
id: 76
time: '2023-09-19T17:22:02.0000000+00:00'
- author: dvir01
changes:
- type: Add
message: >-
Added the floor tiles crate for the price of 500, get some fun tiles for
your ship!
id: 77
time: '2023-09-19T17:45:24.0000000+00:00'
- author: dvir01
changes:
- type: Tweak
message: ChefVend Monkey cube price fixed
- type: Tweak
message: Dry monkey cube and dry carps has the same price as the dead mob.
id: 78
time: '2023-09-19T18:07:34.0000000+00:00'
- author: dvir01
changes:
- type: Tweak
message: Captains stamps now show up in Bureaucracy crates, and SR vend machines.
- type: Tweak
message: >-
SR Vend machine have a bit more items in it, NT hopes the SR will find
this useful.
id: 79
time: '2023-09-19T18:12:22.0000000+00:00'
- author: dvir01
changes:
- type: Tweak
message: >-
NT Has updated the locks on the cargo crates again, the crates should
open again as expected,
id: 80
time: '2023-09-19T18:48:18.0000000+00:00'
- author: potato1234x
changes:
- type: Tweak
message: Resprited the mailbox.
id: 81
time: '2023-09-19T21:07:40.0000000+00:00'
2 changes: 2 additions & 0 deletions Resources/Locale/en-US/_NF/paper/stamp-component.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
stamp-component-unknown-name = Unknown
stamp-component-unknown-job = No job
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ent-FloorsFun = { ent-CrateFloorsFun }
.desc = { ent-CrateFloorsFun.desc }
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ent-CrateFloorsFun = Fun floors tiles crate
.desc = A crate full of 30 random tiles, used for decoration.
8 changes: 8 additions & 0 deletions Resources/Locale/en-US/_Nyano/store/uplink-catalog.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
uplink-kanabou-name = Kanabou
uplink-kanabou-desc = A weapon for those who wish to forgo subtlety. Particularly suited to oni.
uplink-rickenbacker4001-name = Rickenbacker 4001
uplink-rickenbacker4001-desc = When it comes down to it, there are very few people who will swing the bat.
uplink-samurai-bundle-name = Syndicate samurai armor bundle
uplink-samurai-bundle-desc = A bundle containing a modern replica of a full Tousei-Gusoku set.
8 changes: 8 additions & 0 deletions Resources/Locale/en-US/accent/accents.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,11 @@ accent-words-slimes-2 = Blimpuf?
accent-words-slimes-3 = Blump!
accent-words-slimes-4 = Bluuump...
accent-words-slimes-5 = Blabl blump!
# Nyanotrasen Mothroach
accent-words-mothroach-1 = Squeak!
accent-words-mothroach-2 = Chirp!
accent-words-mothroach-3 = Peep!
accent-words-mothroach-4 = Eeee!
accent-words-mothroach-5 = Eep!
3 changes: 3 additions & 0 deletions Resources/Locale/en-US/ghost/roles/ghost-role-component.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,6 @@ ghost-role-information-loneop-rules = You are a syndicate operative tasked with
ghost-role-information-behonker-name = Behonker
ghost-role-information-behonker-description = You are an antagonist, bring death and honks to those who do not follow the honkmother.
ghost-role-information-mothroach-name = Mothroach
ghost-role-information-mothroach-description = A cute but mischievous mothroach.
Loading

0 comments on commit 74a1846

Please sign in to comment.