Skip to content

Commit

Permalink
Merge branch 'new-frontiers-14:master' into 2024-04-03-Punk-Stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
ErhardSteinhauer authored Apr 29, 2024
2 parents 8b55ade + 2054cb9 commit 1c1f24e
Show file tree
Hide file tree
Showing 42 changed files with 601 additions and 1,297 deletions.
38 changes: 25 additions & 13 deletions Content.Client/_NF/Latejoin/VesselListControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,31 +54,43 @@ protected override void Dispose(bool disposing)

private int DefaultComparison(NetEntity x, NetEntity y)
{
var xContainsHop = _gameTicker.JobsAvailable[x].ContainsKey("HeadOfPersonnel");
var yContainsHop = _gameTicker.JobsAvailable[y].ContainsKey("HeadOfPersonnel");
var xContainsSR = _gameTicker.JobsAvailable[x].ContainsKey("StationRepresentative");
var yContainsSR = _gameTicker.JobsAvailable[y].ContainsKey("StationRepresentative");

var xContainsHos = _gameTicker.JobsAvailable[x].ContainsKey("HeadOfSecurity");
var yContainsHos = _gameTicker.JobsAvailable[y].ContainsKey("HeadOfSecurity");
var xContainsSheriff = _gameTicker.JobsAvailable[x].ContainsKey("Sheriff");
var yContainsSheriff = _gameTicker.JobsAvailable[y].ContainsKey("Sheriff");

// Prioritize "HeadOfPersonnel"
switch (xContainsHop)
var xContainsPirateCaptain = _gameTicker.JobsAvailable[x].ContainsKey("PirateCaptain");
var yContainsPirateCaptain = _gameTicker.JobsAvailable[y].ContainsKey("PirateCaptain");

// Prioritize "StationRepresentative"
switch (xContainsSR)
{
case true when !yContainsSR:
return -1;
case false when yContainsSR:
return 1;
}

// If both or neither contain "StationRepresentative", prioritize "Sheriff"
switch (xContainsSheriff)
{
case true when !yContainsHop:
case true when !yContainsSheriff:
return -1;
case false when yContainsHop:
case false when yContainsSheriff:
return 1;
}

// If both or neither contain "HeadOfPersonnel", prioritize "HeadOfSecurity"
switch (xContainsHos)
// If both or neither contain "StationRepresentative", "Sheriff" prioritize "PirateCaptain"
switch (xContainsPirateCaptain)
{
case true when !yContainsHos:
case true when !yContainsPirateCaptain:
return -1;
case false when yContainsHos:
case false when yContainsPirateCaptain:
return 1;
}

// If both or neither contain "HeadOfPersonnel" and "HeadOfSecurity", sort by jobCountComparison
// If both or neither contain "StationRepresentative" and "Sheriff", sort by jobCountComparison
var jobCountComparison = -(int) (_gameTicker.JobsAvailable[x].Values.Sum(a => a ?? 0) -
_gameTicker.JobsAvailable[y].Values.Sum(b => b ?? 0));
var nameComparison = string.Compare(_gameTicker.StationNames[x], _gameTicker.StationNames[y], StringComparison.Ordinal);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Content.Server.Mail.Components
{
[RegisterComponent]
public sealed partial class MailDisabledComponent : Component
{}
}
7 changes: 7 additions & 0 deletions Content.Server/Nyanotrasen/Mail/MailSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public sealed class MailSystem : EntitySystem
[Dependency] private readonly ItemSystem _itemSystem = default!;
[Dependency] private readonly MindSystem _mindSystem = default!;
[Dependency] private readonly MetaDataSystem _metaDataSystem = default!;
[Dependency] private readonly IEntityManager _entManager = default!; // Frontier

private ISawmill _sawmill = default!;

Expand Down Expand Up @@ -579,6 +580,12 @@ public bool TryGetMailRecipientForReceiver(MailReceiverComponent receiver, [NotN
return false;
}

if (_entManager.TryGetComponent<MailDisabledComponent>(receiver.Owner, out var antag))
{
recipient = null;
return false;
}

var accessTags = access.Tags;

var mayReceivePriorityMail = !(_mindSystem.GetMind(receiver.Owner) == null);
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Salvage/SalvageSystem.Expeditions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public sealed partial class SalvageSystem
* Handles setup / teardown of salvage expeditions.
*/

private const int MissionLimit = 4;
private const int MissionLimit = 5;
[Dependency] private readonly StationSystem _stationSystem = default!;

private readonly JobQueue _salvageQueue = new();
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Shuttles/Components/ThrusterComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public sealed partial class ThrusterComponent : Component
public string MachinePartThrust = "Capacitor";

[DataField("partRatingThrustMultiplier")]
public float PartRatingThrustMultiplier = 1.5f;
public float PartRatingThrustMultiplier = 1.15f; // Frontier - PR #1292 1.5f<1.15f

[DataField("thrusterIgnoreEmp")]
public bool ThrusterIgnoreEmp = false;
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/_NF/Contraband/Systems/ContrabandSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ private bool CanSell(EntityUid uid, TransformComponent xform)
{
if (_mobQuery.HasComponent(uid))
{
if (_mobQuery.GetComponent(uid).CurrentState == MobState.Alive)
if (_mobQuery.GetComponent(uid).CurrentState == MobState.Dead) // Allow selling alive prisoners
{
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Content.Shared.Salvage.Expeditions;

[Prototype("salvageFaction")]
public sealed partial class SalvageFactionPrototype : IPrototype
public sealed partial class SalvageFactionPrototype : IPrototype, ISalvageMod
{
[IdDataField] public string ID { get; } = default!;

Expand Down
14 changes: 6 additions & 8 deletions Content.Shared/Salvage/SharedSalvageSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ public int GetDifficulty(DifficultyRating rating)
switch (rating)
{
case DifficultyRating.Minimal:
return 1;
return 4;
case DifficultyRating.Minor:
return 2;
return 6;
case DifficultyRating.Moderate:
return 4;
case DifficultyRating.Hazardous:
return 8;
case DifficultyRating.Hazardous:
return 10;
case DifficultyRating.Extreme:
return 16;
return 12;
default:
throw new ArgumentOutOfRangeException(nameof(rating), rating, null);
}
Expand Down Expand Up @@ -100,12 +100,10 @@ public SalvageMission GetMission(SalvageMissionType config, DifficultyRating dif
// - Biome
// - Lighting
// - Atmos
var faction = GetMod<SalvageFactionPrototype>(rand, ref rating);
var biome = GetMod<SalvageBiomeMod>(rand, ref rating);
var air = GetBiomeMod<SalvageAirMod>(biome.ID, rand, ref rating);
var dungeon = GetBiomeMod<SalvageDungeonModPrototype>(biome.ID, rand, ref rating);
var factionProtos = _proto.EnumeratePrototypes<SalvageFactionPrototype>().ToList();
factionProtos.Sort((x, y) => string.Compare(x.ID, y.ID, StringComparison.Ordinal));
var faction = factionProtos[rand.Next(factionProtos.Count)];

var mods = new List<string>();

Expand Down
44 changes: 44 additions & 0 deletions Resources/Changelog/Changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4355,3 +4355,47 @@ Entries:
the mail office.
id: 4955
time: '2024-04-29T03:07:21.0000000+00:00'
- author: erhardsteinhauer
changes:
- type: Add
message: Added a short entry to guidebook concerning goblins.
id: 4956
time: '2024-04-29T16:24:52.0000000+00:00'
- author: dvir01
changes:
- type: Tweak
message: NT No longer send mail to pirates.
id: 4957
time: '2024-04-29T17:21:42.0000000+00:00'
- author: dvir01
changes:
- type: Tweak
message: >-
The cultist and syndicate migrated to the harder difficulty expeditions
only.
id: 4958
time: '2024-04-29T17:22:51.0000000+00:00'
- author: erhardsteinhauer
changes:
- type: Add
message: >-
Added Syndicate and Pirate themed hoverbikes, both are considered
contraband.
- type: Add
message: Added syndicate hoverbike flatpack to contravend.
id: 4959
time: '2024-04-29T17:26:42.0000000+00:00'
- author: Kesiath
changes:
- type: Tweak
message: Reduced top thruster speeds.
id: 4960
time: '2024-04-29T17:29:13.0000000+00:00'
- author: dvir01
changes:
- type: Tweak
message: >-
You can now sell antagonist human like AI like the Syndicate agents to
NFSD, as long as they are alive, for NFSD coins.
id: 4961
time: '2024-04-29T17:48:22.0000000+00:00'
2 changes: 2 additions & 0 deletions Resources/Maps/_NF/POI/cove.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ entities:
- type: OccluderTree
- type: SpreaderGrid
- type: Shuttle
angularDamping: 999999
linearDamping: 999999
- type: GridPathfinding
- type: DecalGrid
chunkCollection:
Expand Down
Loading

0 comments on commit 1c1f24e

Please sign in to comment.