Skip to content

Commit

Permalink
Merge branch 'master' into 2024-11-28-sector-alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
dvir001 authored Dec 21, 2024
2 parents 214b41e + b92323b commit c68a562
Show file tree
Hide file tree
Showing 68 changed files with 1,023 additions and 354 deletions.
5 changes: 5 additions & 0 deletions Content.Server/Fluids/EntitySystems/AbsorbentSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,11 @@ private bool TryTwoWayAbsorbentRefillableTransfer(
{
_popups.PopupEntity(Loc.GetString("mopping-system-full", ("used", target)), user, user);
}
// Frontier: out-only refillable solutions
else if (TryComp<RefillableSolutionComponent>(refillableSoln.Owner, out var refillableSolnComp) && refillableSolnComp.PreventTransferOut)
{
}
// End Frontier
else
{
// transfer as much contaminants to refillable as will fit
Expand Down
5 changes: 5 additions & 0 deletions Content.Server/Fluids/EntitySystems/PuddleSystem.Transfers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ private void InitializeTransfers()

private void OnRefillableDragged(Entity<RefillableSolutionComponent> entity, ref DragDropDraggedEvent args)
{
// Frontier: silently prevent non-transferrable solution
if (entity.Comp.PreventTransferOut)
return;
// End Frontier

if (!_solutionContainerSystem.TryGetSolution(entity.Owner, entity.Comp.Solution, out var soln, out var solution) || solution.Volume == FixedPoint2.Zero)
{
_popups.PopupEntity(Loc.GetString("mopping-system-empty", ("used", entity.Owner)), entity, args.User);
Expand Down
19 changes: 15 additions & 4 deletions Content.Server/_NF/Smuggling/DeadDropSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -590,15 +590,26 @@ private void SendDeadDrop(EntityUid uid, DeadDropComponent component, EntityUid
output = Loc.GetString(messageLoc, ("location", MetaData(sender).EntityName));
break;
case SmugglingReportMessageType.DeadDropStationWithRandomAlt:
var actualStationName = MetaData(sender).EntityName;
if (sectorDeadDrop is not null)
{
string[] names = [MetaData(sender).EntityName, _random.Pick<string>(sectorDeadDrop.DeadDropStationNames.Values)];
_random.Shuffle(names);
output = Loc.GetString(messageLoc, ("location1", names[0]), ("location2", names[1]));
var otherStationList = sectorDeadDrop.DeadDropStationNames.Values.Where(x => x != actualStationName).ToList();
if (otherStationList.Count > 0)
{
string[] names = [actualStationName, _random.Pick<string>(otherStationList)];
_random.Shuffle(names);
output = Loc.GetString(messageLoc, ("location1", names[0]), ("location2", names[1]));
}
else
{
// No valid alternate, just output where the dead drop is
output = Loc.GetString(messageLoc, ("location1", actualStationName));
}
}
else
{
output = Loc.GetString(messageLoc, ("location1", MetaData(sender).EntityName)); // Looks strange, but still has a proper value.
// No valid alternate, just output where the dead drop is
output = Loc.GetString(messageLoc, ("location1", actualStationName));
}
break;
case SmugglingReportMessageType.PodLocation:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,10 @@ public sealed partial class RefillableSolutionComponent : Component
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public FixedPoint2? MaxRefill = null;

/// <summary>
/// Frontier: prevent transferring solution out into others
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public bool PreventTransferOut = false;
}
92 changes: 82 additions & 10 deletions Content.Shared/Clothing/EntitySystems/FactionClothingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
using Content.Shared.NPC.Components;
using Content.Shared.NPC.Systems;
using Robust.Shared.Player; // Frontier - Dont edit AI factions
using Content.Shared.Inventory; // Frontier
using Content.Shared.NPC.Prototypes; // Frontier
using Robust.Shared.Prototypes; // Frontier
using Content.Shared.Mind.Components; // Frontier

namespace Content.Shared.Clothing.EntitySystems;

Expand All @@ -12,38 +16,106 @@ namespace Content.Shared.Clothing.EntitySystems;
public sealed class FactionClothingSystem : EntitySystem
{
[Dependency] private readonly NpcFactionSystem _faction = default!;
[Dependency] private readonly InventorySystem _inventory = default!; // Frontier

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

SubscribeLocalEvent<FactionClothingComponent, GotEquippedEvent>(OnEquipped);
SubscribeLocalEvent<FactionClothingComponent, GotUnequippedEvent>(OnUnequipped);
SubscribeLocalEvent<NpcFactionMemberComponent, PlayerAttachedEvent>(OnPlayerAttached); // Frontier
SubscribeLocalEvent<NpcFactionMemberComponent, PlayerDetachedEvent>(OnPlayerDetached); // Frontier
}

// Frontier: rewritten from scratch
private void OnEquipped(Entity<FactionClothingComponent> ent, ref GotEquippedEvent args)
{
if (!HasComp<ActorComponent>(args.Equipee)) // Frontier - Dont edit AI factions
return; // Frontier - Dont edit AI factions
var alreadyMember = CheckEntityEquipmentForFaction(args.Equipee, ent.Comp.Faction, args.Equipment);
if (alreadyMember is null)
{
TryComp<NpcFactionMemberComponent>(args.Equipee, out var factionComp);
var faction = (args.Equipee, factionComp);
ent.Comp.AlreadyMember = _faction.IsMember(faction, ent.Comp.Faction);

TryComp<NpcFactionMemberComponent>(args.Equipee, out var factionComp);
var faction = (args.Equipee, factionComp);
ent.Comp.AlreadyMember = _faction.IsMember(faction, ent.Comp.Faction);
// Do not edit factions on AI controlled mobs
if (!HasComp<ActorComponent>(args.Equipee))
return;

_faction.AddFaction(faction, ent.Comp.Faction);
if (!ent.Comp.AlreadyMember)
_faction.AddFaction(faction, ent.Comp.Faction);
}
else
{
ent.Comp.AlreadyMember = alreadyMember.Value;
}
}

private void OnUnequipped(Entity<FactionClothingComponent> ent, ref GotUnequippedEvent args)
{
if (!HasComp<ActorComponent>(args.Equipee)) // Frontier - Dont edit AI factions
return; // Frontier - Dont edit AI factions

// Reset the component, should be false when unworn.
if (ent.Comp.AlreadyMember)
{
ent.Comp.AlreadyMember = false;
return;
}

_faction.RemoveFaction(args.Equipee, ent.Comp.Faction);
// Do not edit factions on AI controlled mobs
if (!HasComp<ActorComponent>(args.Equipee))
return;

var alreadyMember = CheckEntityEquipmentForFaction(args.Equipee, ent.Comp.Faction, args.Equipment);
if (alreadyMember is null)
{
_faction.RemoveFaction(args.Equipee, ent.Comp.Faction);
}
}

public bool? CheckEntityEquipmentForFaction(EntityUid ent, ProtoId<NpcFactionPrototype> prototype, EntityUid? skipEnt = null)
{
var enumerator = _inventory.GetSlotEnumerator(ent);
while (enumerator.NextItem(out var item))
{
if (!TryComp<FactionClothingComponent>(item, out var faction))
continue;
if (faction.Faction == prototype && item != skipEnt)
return faction.AlreadyMember;
}
return null;
}

private void OnPlayerAttached(Entity<NpcFactionMemberComponent> ent, ref PlayerAttachedEvent args)
{
// Iterate through all items, add factions for any items found where AlreadyMember is false
List<ProtoId<NpcFactionPrototype>> factions = new();
var enumerator = _inventory.GetSlotEnumerator(ent.Owner);
while (enumerator.NextItem(out var item))
{
if (!TryComp<FactionClothingComponent>(item, out var faction))
continue;
if (!faction.AlreadyMember && !factions.Contains(faction.Faction))
{
_faction.AddFaction((ent.Owner, ent.Comp), faction.Faction);
factions.Add(faction.Faction);
}
}
}

private void OnPlayerDetached(Entity<NpcFactionMemberComponent> ent, ref PlayerDetachedEvent args)
{
// Iterate through all items, remove factions for any items found where AlreadyMember is true
List<ProtoId<NpcFactionPrototype>> factions = new();
var enumerator = _inventory.GetSlotEnumerator(ent.Owner);
while (enumerator.NextItem(out var item))
{
if (!TryComp<FactionClothingComponent>(item, out var faction))
continue;
if (!faction.AlreadyMember && !factions.Contains(faction.Faction))
{
_faction.RemoveFaction((ent.Owner, ent.Comp), faction.Faction);
factions.Add(faction.Faction);
}
}
}
// End Frontier
}
4 changes: 3 additions & 1 deletion Content.Shared/Fluids/SharedPuddleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private void OnDumpCanDropTarget(Entity<DumpableSolutionComponent> entity, ref C

private void OnDrainCanDropTarget(Entity<DrainableSolutionComponent> entity, ref CanDropTargetEvent args)
{
if (HasComp<RefillableSolutionComponent>(args.Dragged))
if (TryComp<RefillableSolutionComponent>(args.Dragged, out var refillable) && !refillable.PreventTransferOut) // Frontier: HasComp<TryComp, add PreventTransferOut check
{
args.CanDrop = true;
args.Handled = true;
Expand All @@ -66,6 +66,8 @@ private void OnRefillableCanDropDragged(Entity<RefillableSolutionComponent> enti
{
if (!HasComp<DrainableSolutionComponent>(args.Target) && !HasComp<DumpableSolutionComponent>(args.Target))
return;
if (entity.Comp.PreventTransferOut) // Frontier
return; // Frontier

args.CanDrop = true;
args.Handled = true;
Expand Down
4 changes: 4 additions & 0 deletions Resources/Audio/_NF/Items/Gavel/attributions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- files: ["gavel1.ogg", "gavel2.ogg", "gavel3.ogg", "gavel4.ogg"]
license: "CC-BY-3.0"
copyright: "craigsmith (FreeSound), released under CC-0"
source: "https://freesound.org/people/craigsmith/sounds/675979/"
Binary file added Resources/Audio/_NF/Items/Gavel/gavel1.ogg
Binary file not shown.
Binary file added Resources/Audio/_NF/Items/Gavel/gavel2.ogg
Binary file not shown.
Binary file added Resources/Audio/_NF/Items/Gavel/gavel3.ogg
Binary file not shown.
Binary file added Resources/Audio/_NF/Items/Gavel/gavel4.ogg
Binary file not shown.
44 changes: 44 additions & 0 deletions Resources/Changelog/Frontier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5991,3 +5991,47 @@ Entries:
message: Hostile faction bosses can now be encountered on VGroids.
id: 5597
time: '2024-12-18T19:00:32.0000000+00:00'
- author: whatston3
changes:
- type: Fix
message: >-
Faction-associated items of clothing should be properly tracked, the
CDET should only attack players wearing contraband.
id: 5598
time: '2024-12-20T17:28:19.0000000+00:00'
- author: erhardsteinhauer
changes:
- type: Add
message: >-
Added the blood cult cat ghost role (for players to pledge their
allegiance to).
id: 5599
time: '2024-12-20T18:08:59.0000000+00:00'
- author: whatston3 and leonardo-dabepis
changes:
- type: Add
message: Added a gavel, gavel block, powdered wig to the courthouse.
- type: Tweak
message: Remodeled the Courthouse slightly.
id: 5600
time: '2024-12-20T18:11:32.0000000+00:00'
- author: whatston3
changes:
- type: Fix
message: Removed duplicate location hints from NFSD radio callouts.
id: 5601
time: '2024-12-20T18:16:13.0000000+00:00'
- author: whatston3
changes:
- type: Fix
message: >-
Reagents in food solutions cannot be transferred out, e.g. into a
ChemMaster.
id: 5602
time: '2024-12-20T22:55:17.0000000+00:00'
- author: dustylens
changes:
- type: Add
message: Adds a pair of plushies from Lvl 1 Eevee
id: 5603
time: '2024-12-21T00:50:56.0000000+00:00'
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ ghost-role-information-clarpy-name = Clarpy
ghost-role-information-clarpy-description = Avast ye mail! wanted by Nanotrasen for crimes against mice.
ghost-role-information-clarpy-rules = You are a [color=red][bold]Team Antagonist[/bold][/color] with all other pirates.
ghost-role-information-cult-cat-name = Blood Cult Cat
ghost-role-information-cult-cat-description = Founded the Blood Cult out of boredom.
ghost-role-information-cult-cat-rules = You are a [color=red][bold]Free Agent[/bold][/color] and free to choose your course of actions.
Please note that [color=yellow]all server rules still apply.[/color] Additionally:
- [color=red]DO NOT[/color] damage player shuttles or their contents.
- [color=red]DO NOT[/color] gib players. Once they're dead, leave them be.
ghost-role-information-cappy-name = Cappy
ghost-role-information-cappy-description = Stop resisting! Certified in lethal-force and defensive tactics.
Expand Down
2 changes: 1 addition & 1 deletion Resources/Locale/en-US/_NF/medical/medicine.ftl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
medicine-label-mannitol-clarpy = Clarpy's dementia pills
medicine-label-mannitol-clarpy = Clarpy's prescription
11 changes: 7 additions & 4 deletions Resources/Maps/_NF/Bluespace/bloodmoon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1089,17 +1089,13 @@ entities:
- type: Transform
pos: 11.5,-7.5
parent: 1
- type: Physics
bodyType: Static
- proto: BenchSofaRight
entities:
- uid: 1079
components:
- type: Transform
pos: 10.5,-7.5
parent: 1
- type: Physics
bodyType: Static
- proto: BloodCollector
entities:
- uid: 1137
Expand Down Expand Up @@ -6042,6 +6038,13 @@ entities:
rot: 1.5707963267948966 rad
pos: 18.5,-11.5
parent: 1
- proto: SpawnMobCatBloodCult
entities:
- uid: 351
components:
- type: Transform
pos: 17.5,13.5
parent: 1
- proto: StructureMeleeWeaponRackBloodCultFilled
entities:
- uid: 470
Expand Down
Loading

0 comments on commit c68a562

Please sign in to comment.