Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Fansana/floofstation1
Browse files Browse the repository at this point in the history
  • Loading branch information
Fansana committed Oct 27, 2024
2 parents 7e218b1 + 01b18f6 commit ec3aa03
Show file tree
Hide file tree
Showing 38 changed files with 1,735,276 additions and 62,456 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ public sealed class AHelpUIController: UIController, IOnSystemChanged<BwoinkSyst
private bool _discordRelayActive;
private bool _hasUnreadAHelp;

public const string AHelpErrorSound = "/Audio/Admin/ahelp_error.ogg";
public const string AHelpReceiveSound = "/Audio/Admin/ahelp_receive.ogg";
public const string AHelpSendSound = "/Audio/Admin/ahelp_send.ogg";
public const string AHelpErrorSound = "/Audio/Admin/adminhelp_old.ogg"; // Floofstation
public const string AHelpReceiveSound = "/Audio/Admin/adminhelp_old.ogg"; // Floofstation
public const string AHelpSendSound = "/Audio/Admin/adminhelp_old.ogg"; // Floofstation


public override void Initialize()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ private void OnPersonAssigned(EntityUid uid, PickRandomPersonComponent comp, ref
return;
}

// Floofstation Edit Start
foreach (var mind in allHumans)
if (_job.MindTryGetJob(mind, out _, out var prototype) && !prototype.CanBeAntagTarget)
allHumans.Remove(mind);
// Floofstation Edit End

_target.SetTarget(uid, _random.Pick(allHumans), target);
}

Expand Down
29 changes: 23 additions & 6 deletions Content.Server/Shadowkin/ShadowkinSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
using Content.Shared.Mobs; // Floofstation Edit
using Content.Server.FloofStation; // Floofstation Edit
using Content.Shared.Inventory; // Floofstation Edit
using Content.Shared.Teleportation.Components; // Floofstation Edit
using Robust.Shared.Physics.Systems; // Floofstation Edit
using Robust.Shared.Random; // Floofstation Edit
using Robust.Shared.Utility; // Floofstation Edit
using System.Linq; // Floofstation Edit

namespace Content.Server.Shadowkin;

Expand All @@ -28,8 +31,13 @@ public sealed class ShadowkinSystem : EntitySystem
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!; // Floofstation Edit
[Dependency] private readonly InventorySystem _inventorySystem = default!; // Floofstation Edit
[Dependency] private readonly IRobustRandom _random = default!; // Floofstation Edit
[Dependency] private readonly EntityLookupSystem _lookup = default!; // Floofstation Edit
[Dependency] private readonly SharedJointSystem _joints = default!; // Floofstation

public const string ShadowkinSleepActionId = "ShadowkinActionSleep";

private const int MaxRandomTeleportAttempts = 20; // Floofstation Edit
public override void Initialize()
{
base.Initialize();
Expand Down Expand Up @@ -176,6 +184,7 @@ private void OnRejuvenate(EntityUid uid, ShadowkinComponent component, Rejuvenat
}

EnsureComp<PsionicComponent>(uid, out var magic);
magic.CanReroll = false;
magic.Mana = 250;
magic.MaxMana = 250;
magic.ManaGain = 0.25f;
Expand Down Expand Up @@ -207,11 +216,19 @@ private void OnMobStateChanged(EntityUid uid, ShadowkinComponent component, MobS
var query = EntityQueryEnumerator<DarkHubComponent>();
while (query.MoveNext(out var target, out var portal))
{
var timeout = EnsureComp<PortalTimeoutComponent>(uid);
timeout.EnteredPortal = target;
Dirty(uid, timeout);

_transform.SetCoordinates(uid, Transform(target).Coordinates);
var coords = Transform(target).Coordinates;
var newCoords = coords.Offset(_random.NextVector2(5));
for (var i = 0; i < MaxRandomTeleportAttempts; i++)
{
var randVector = _random.NextVector2(5);
newCoords = coords.Offset(randVector);
if (!_lookup.GetEntitiesIntersecting(newCoords.ToMap(EntityManager, _transform), LookupFlags.Static).Any())
break;
}

_joints.RecursiveClearJoints(uid);

_transform.SetCoordinates(uid, newCoords);
continue;
}

Expand Down
3 changes: 3 additions & 0 deletions Content.Shared/Roles/JobPrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ public sealed partial class JobPrototype : IPrototype

[DataField]
public bool Whitelisted;

[DataField]
public bool CanBeAntagTarget = true; // Floofstation Edit
}

/// <summary>
Expand Down
13 changes: 13 additions & 0 deletions Content.Shared/Shadowkin/SharedEtherealSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using Robust.Shared.Configuration;
using Content.Shared.Abilities.Psionics;
using Content.Shared.Tag;
using Content.Shared.Standing;

namespace Content.Shared.Shadowkin;

Expand All @@ -24,6 +25,7 @@ public abstract class SharedEtherealSystem : EntitySystem
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly IConfigurationManager _cfg = default!;
[Dependency] private readonly TagSystem _tag = default!;
[Dependency] private readonly StandingStateSystem _standingStateSystem = default!;

public override void Initialize()
{
Expand All @@ -38,13 +40,19 @@ public override void Initialize()
SubscribeLocalEvent<EtherealComponent, ShotAttemptedEvent>(OnShootAttempt);
SubscribeLocalEvent<EtherealComponent, OnMindbreakEvent>(OnMindbreak);
SubscribeLocalEvent<EtherealComponent, MobStateChangedEvent>(OnMobStateChanged);
SubscribeLocalEvent<EtherealComponent, DownAttemptEvent>(DownAttemptEvent);
}

public virtual void OnStartup(EntityUid uid, EtherealComponent component, MapInitEvent args)
{
if (!TryComp<FixturesComponent>(uid, out var fixtures))
return;

if (TryComp<StandingStateComponent>(uid, out var standingstate))
{
_standingStateSystem.Stand(uid, standingstate);
}

var fixture = fixtures.Fixtures.First();

component.OldMobMask = fixture.Value.CollisionMask;
Expand Down Expand Up @@ -138,4 +146,9 @@ private void OnAttemptPowerUse(EntityUid uid, EtherealComponent component, OnAtt

args.Cancel();
}

private void DownAttemptEvent(EntityUid uid, EtherealComponent component, DownAttemptEvent args)
{
args.Cancel();
}
}
13 changes: 12 additions & 1 deletion Content.Shared/Teleportation/Systems/SharedPortalSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public override void Initialize()
private void OnGetVerbs(EntityUid uid, PortalComponent component, GetVerbsEvent<AlternativeVerb> args)
{

if (!HasComp<EtherealComponent>(uid) && !HasComp<EtherealComponent>(args.User)) // FloofStation Edit
if (!args.CanAccess || !HasComp<EtherealComponent>(args.User)) // FloofStation Edit
// Traversal altverb for ghosts to use that bypasses normal functionality
if (!args.CanAccess || !HasComp<GhostComponent>(args.User))
return;
Expand All @@ -69,6 +69,10 @@ private void OnGetVerbs(EntityUid uid, PortalComponent component, GetVerbsEvent<
var ent = link.LinkedEntities.First();
TeleportEntity(uid, args.User, Transform(ent).Coordinates, ent, false);
if (TryComp<EtherealComponent>(args.User, out var ethereal)) // Floofstation Edit
RemComp(uid, ethereal);
if (TryComp<PortalTimeoutComponent>(args.User, out var timeout)) // Floofstation Edit
RemCompDeferred(args.User, timeout);
},
Disabled = disabled,
Text = Loc.GetString("portal-component-ghost-traverse"),
Expand All @@ -88,6 +92,9 @@ private bool ShouldCollide(string ourId, string otherId, Fixture our, Fixture ot

private void OnCollide(EntityUid uid, PortalComponent component, ref StartCollideEvent args)
{
if (HasComp<EtherealComponent>(uid) || HasComp<EtherealComponent>(args.OtherEntity)) // Floofstation Edit
return;

if (!ShouldCollide(args.OurFixtureId, args.OtherFixtureId, args.OurFixture, args.OtherFixture))
return;

Expand Down Expand Up @@ -142,6 +149,7 @@ private void OnCollide(EntityUid uid, PortalComponent component, ref StartCollid
}

TeleportEntity(uid, subject, Transform(target).Coordinates, target);

return;
}

Expand All @@ -155,6 +163,9 @@ private void OnCollide(EntityUid uid, PortalComponent component, ref StartCollid

private void OnEndCollide(EntityUid uid, PortalComponent component, ref EndCollideEvent args)
{
if (HasComp<EtherealComponent>(uid) || HasComp<EtherealComponent>(args.OtherEntity)) // Floofstation Edit
return;

if (!ShouldCollide(args.OurFixtureId, args.OtherFixtureId, args.OurFixture, args.OtherFixture))
return;

Expand Down
Loading

0 comments on commit ec3aa03

Please sign in to comment.