Skip to content

Commit

Permalink
Merge branch 'new-frontiers-14:master' into Bodycam-Rework
Browse files Browse the repository at this point in the history
  • Loading branch information
dvir001 authored Sep 19, 2023
2 parents 3857940 + c589573 commit 5114de8
Show file tree
Hide file tree
Showing 116 changed files with 4,889 additions and 3,313 deletions.
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);
}
}
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.
90 changes: 90 additions & 0 deletions Resources/Changelog/Changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -691,3 +691,93 @@ Entries:
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.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ entities:
components:
- type: MetaData
- pos: -1.078125,-0.46875
parent: 411
parent: invalid
type: Transform
- chunks:
0,0:
Expand Down Expand Up @@ -469,16 +469,6 @@ entities:
type: GridAtmosphere
- type: GasTileOverlay
- type: RadiationGridResistance
- uid: 411
components:
- type: MetaData
- type: Transform
- type: Map
- type: PhysicsMap
- type: GridTree
- type: MovedGrids
- type: Broadphase
- type: OccluderTree
- proto: AirCanister
entities:
- uid: 294
Expand Down Expand Up @@ -2219,8 +2209,7 @@ entities:
- storage:
Plasma: 1500
type: MaterialStorage
- endTime: 0
type: InsertingMaterialStorage
- type: InsertingMaterialStorage
- uid: 189
components:
- pos: -0.5,-6.5
Expand All @@ -2229,8 +2218,7 @@ entities:
- storage:
Plasma: 1500
type: MaterialStorage
- endTime: 0
type: InsertingMaterialStorage
- type: InsertingMaterialStorage
- proto: PosterContrabandVoteWeh
entities:
- uid: 297
Expand Down
Loading

0 comments on commit 5114de8

Please sign in to comment.