Skip to content

Commit

Permalink
Merge branch 'master' into 2024-04-29-MailTruck
Browse files Browse the repository at this point in the history
  • Loading branch information
dvir001 authored Apr 29, 2024
2 parents cabbd6c + 286041c commit e7c3c6a
Show file tree
Hide file tree
Showing 124 changed files with 80,573 additions and 13,629 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 @@ -11,13 +11,14 @@ public sealed class SalvageTimeMod : IPrototype, ISalvageMod

/// <summary>
/// Cost for difficulty modifiers.
/// Frontier: expedition timer min set to 900 and max to 930
/// </summary>
[DataField("cost")]
public float Cost { get; private set; }

[DataField("minDuration")]
public int MinDuration = 630;
public int MinDuration = 900;

[DataField("maxDuration")]
public int MaxDuration = 570;
public int MaxDuration = 930;
}
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
27 changes: 14 additions & 13 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 Expand Up @@ -196,24 +194,27 @@ private List<string> GetRewards(DifficultyRating difficulty, System.Random rand)

/// <summary>
/// Get a list of WeightedRandomEntityPrototype IDs with the rewards for a certain difficulty.
/// Frontier: added uncommon and legendary reward tiers, limited amount of rewards to 1 per difficulty rating
/// </summary>
private string[] RewardsForDifficulty(DifficultyRating rating)
{
var common = "SalvageRewardCommon";
var uncommon = "SalvageRewardUncommon";
var rare = "SalvageRewardRare";
var epic = "SalvageRewardEpic";
var legendary = "SalvageRewardLegendary";
switch (rating)
{
case DifficultyRating.Minimal:
return new string[] { common, common, common };
return new string[] { common };
case DifficultyRating.Minor:
return new string[] { common, common, rare };
return new string[] { uncommon };
case DifficultyRating.Moderate:
return new string[] { common, rare, rare };
return new string[] { rare };
case DifficultyRating.Hazardous:
return new string[] { rare, rare, rare, epic };
return new string[] { epic };
case DifficultyRating.Extreme:
return new string[] { rare, rare, epic, epic, epic };
return new string[] { legendary };
default:
throw new NotImplementedException();
}
Expand Down
80 changes: 80 additions & 0 deletions Resources/Changelog/Changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4355,3 +4355,83 @@ 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'
- author: erhardsteinhauer
changes:
- type: Add
message: Added goblin speech bubble.
- type: Tweak
message: Added to goblins low tolerance for cleanliness.
- type: Tweak
message: Goblins are less affected by slowdown from wounds.
id: 4962
time: '2024-04-29T20:02:58.0000000+00:00'
- author: erhardsteinhauer
changes:
- type: Tweak
message: >-
Salvage expedition dungeons now feature a more varied loot/fluff items
pool.
- type: Tweak
message: Extended salvage expeditions time limit to 15 minutes.
- type: Tweak
message: >-
Limited rewards for completed expeditions to cash only, sum depends on
expedition difficulty.
- type: Tweak
message: Edible food can not be found in salvage expedition dungeons anymore.
- type: Add
message: Added new salvage expedition dungeon theme - Virology Lab.
- type: Add
message: >-
Added weapon cases. Guns and energy melee weapons on expeditions now
spawn in weapon cases with spare magazines.
- type: Tweak
message: >-
Duffel bags with shuttle guns were replaced with newly added weapon
cases.
id: 4963
time: '2024-04-29T21:36:47.0000000+00:00'
Loading

0 comments on commit e7c3c6a

Please sign in to comment.