mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-23 00:27:50 +03:00
# Description Adds the Ghost Bar from Goob LRP. Upon spawn, the character's loadouts and traits will also be applied as if their job was their Ghost Bar job. Adjusts the weights for kill objectives, re-enabling the kill objective and reducing the weight of Teach a Lesson now that there's more things to do after getting round removed. Goobstation cherry-picked PRs: - https://github.com/Goob-Station/Goob-Station/pull/454 - https://github.com/Goob-Station/Goob-Station/pull/464 - https://github.com/Goob-Station/Goob-Station/pull/689 (partially applied to Ghost bar files only) - https://github.com/Goob-Station/Goob-Station/pull/963 - https://github.com/Goob-Station/Goob-Station/pull/974 - https://github.com/Goob-Station/Goob-Station/pull/982 (partially applied to Ghost bar files only) - https://github.com/Goob-Station/Goob-Station/pull/1288 (partially applied to Ghost bar files only) Wizden cherry-picked PRs: - https://github.com/space-wizards/space-station-14/pull/29103 (for the foam force rifle that spawns in the Ghost bar) ## Media **Ghost Bar UI**  **Ghost Bar In-Game**  Notice how the Ghost Bar character has loadout items in the backpack and the Skeleton Accent trait. ## Changelog <!-- You can add an author after the `🆑` to change the name that appears in the changelog (ex: `🆑 Death`) Leaving it blank will default to your GitHub display name This includes all available types for the changelog --> 🆑 Skubman - add: Ghost Bar! When you die, you can now go to the Ghost Bar to chill and talk about the round with other ghosts. (by Aidenkrz) - add: Foam Force rifle to cargo lottery! (by IProduceWidgets) - add: Re-enabled the Kill objective for traitors. - tweak: Reduced the chances of traitors getting the "Teach a Lesson" objective. --------- Co-authored-by: Aiden <aiden@djkraz.com> Co-authored-by: Rank #1 Jonestown partygoer <mary@thughunt.ing> Co-authored-by: IProduceWidgets <107586145+IProduceWidgets@users.noreply.github.com> Co-authored-by: Aviu00 <93730715+Aviu00@users.noreply.github.com> (cherry picked from commit 0b4ceb21cc406cd39b894afe79decf40c2366369)
175 lines
5.5 KiB
C#
175 lines
5.5 KiB
C#
using Content.Shared.Emoting;
|
|
using Content.Shared.Hands;
|
|
using Content.Shared.Interaction.Events;
|
|
using Content.Shared.InteractionVerbs.Events;
|
|
using Content.Shared.Item;
|
|
using Content.Shared.Popups;
|
|
using Robust.Shared.Serialization;
|
|
|
|
namespace Content.Shared.Ghost
|
|
{
|
|
/// <summary>
|
|
/// System for the <see cref="GhostComponent"/>.
|
|
/// Prevents ghosts from interacting when <see cref="GhostComponent.CanGhostInteract"/> is false.
|
|
/// </summary>
|
|
public abstract class SharedGhostSystem : EntitySystem
|
|
{
|
|
[Dependency] protected readonly SharedPopupSystem Popup = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
SubscribeLocalEvent<GhostComponent, UseAttemptEvent>(OnAttempt);
|
|
SubscribeLocalEvent<GhostComponent, InteractionAttemptEvent>(OnAttemptInteract);
|
|
SubscribeLocalEvent<GhostComponent, EmoteAttemptEvent>(OnAttempt);
|
|
SubscribeLocalEvent<GhostComponent, DropAttemptEvent>(OnAttempt);
|
|
SubscribeLocalEvent<GhostComponent, PickupAttemptEvent>(OnAttempt);
|
|
SubscribeLocalEvent<GhostComponent, InteractionVerbAttemptEvent>(OnAttempt);
|
|
}
|
|
|
|
private void OnAttemptInteract(Entity<GhostComponent> ent, ref InteractionAttemptEvent args)
|
|
{
|
|
if (!ent.Comp.CanGhostInteract)
|
|
args.Cancelled = true;
|
|
}
|
|
|
|
private void OnAttempt(EntityUid uid, GhostComponent component, CancellableEntityEventArgs args)
|
|
{
|
|
if (!component.CanGhostInteract)
|
|
args.Cancel();
|
|
}
|
|
|
|
public void SetTimeOfDeath(EntityUid uid, TimeSpan value, GhostComponent? component)
|
|
{
|
|
if (!Resolve(uid, ref component))
|
|
return;
|
|
|
|
component.TimeOfDeath = value;
|
|
}
|
|
|
|
public void SetCanReturnToBody(EntityUid uid, bool value, GhostComponent? component = null)
|
|
{
|
|
if (!Resolve(uid, ref component))
|
|
return;
|
|
|
|
component.CanReturnToBody = value;
|
|
}
|
|
|
|
public void SetCanReturnToBody(GhostComponent component, bool value)
|
|
{
|
|
component.CanReturnToBody = value;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// A client to server request to get places a ghost can warp to.
|
|
/// Response is sent via <see cref="GhostWarpsResponseEvent"/>
|
|
/// </summary>
|
|
[Serializable, NetSerializable]
|
|
public sealed class GhostWarpsRequestEvent : EntityEventArgs
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Goobstation - A server to client request for them to spawn at the ghost bar
|
|
/// </summary>
|
|
[Serializable, NetSerializable]
|
|
public sealed class GhostBarSpawnEvent : EntityEventArgs
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// An individual place a ghost can warp to.
|
|
/// This is used as part of <see cref="GhostWarpsResponseEvent"/>
|
|
/// </summary>
|
|
[Serializable, NetSerializable]
|
|
public struct GhostWarp
|
|
{
|
|
public GhostWarp(NetEntity entity, string displayName, bool isWarpPoint)
|
|
{
|
|
Entity = entity;
|
|
DisplayName = displayName;
|
|
IsWarpPoint = isWarpPoint;
|
|
}
|
|
|
|
/// <summary>
|
|
/// The entity representing the warp point.
|
|
/// This is passed back to the server in <see cref="GhostWarpToTargetRequestEvent"/>
|
|
/// </summary>
|
|
public NetEntity Entity { get; }
|
|
|
|
/// <summary>
|
|
/// The display name to be surfaced in the ghost warps menu
|
|
/// </summary>
|
|
public string DisplayName { get; }
|
|
|
|
/// <summary>
|
|
/// Whether this warp represents a warp point or a player
|
|
/// </summary>
|
|
public bool IsWarpPoint { get; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// A server to client response for a <see cref="GhostWarpsRequestEvent"/>.
|
|
/// Contains players, and locations a ghost can warp to
|
|
/// </summary>
|
|
[Serializable, NetSerializable]
|
|
public sealed class GhostWarpsResponseEvent : EntityEventArgs
|
|
{
|
|
public GhostWarpsResponseEvent(List<GhostWarp> warps)
|
|
{
|
|
Warps = warps;
|
|
}
|
|
|
|
/// <summary>
|
|
/// A list of warp points.
|
|
/// </summary>
|
|
public List<GhostWarp> Warps { get; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// A client to server request for their ghost to be warped to an entity
|
|
/// </summary>
|
|
[Serializable, NetSerializable]
|
|
public sealed class GhostWarpToTargetRequestEvent : EntityEventArgs
|
|
{
|
|
public NetEntity Target { get; }
|
|
|
|
public GhostWarpToTargetRequestEvent(NetEntity target)
|
|
{
|
|
Target = target;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// A client to server request for their ghost to be warped to the most followed entity.
|
|
/// </summary>
|
|
[Serializable, NetSerializable]
|
|
public sealed class GhostnadoRequestEvent : EntityEventArgs;
|
|
|
|
/// <summary>
|
|
/// A client to server request for their ghost to return to body
|
|
/// </summary>
|
|
[Serializable, NetSerializable]
|
|
public sealed class GhostReturnToBodyRequest : EntityEventArgs
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// A server to client update with the available ghost role count
|
|
/// </summary>
|
|
[Serializable, NetSerializable]
|
|
public sealed class GhostUpdateGhostRoleCountEvent : EntityEventArgs
|
|
{
|
|
public int AvailableGhostRoles { get; }
|
|
|
|
public GhostUpdateGhostRoleCountEvent(int availableGhostRoleCount)
|
|
{
|
|
AvailableGhostRoles = availableGhostRoleCount;
|
|
}
|
|
}
|
|
|
|
[Serializable, NetSerializable]
|
|
public sealed class GhostReturnToRoundRequest : EntityEventArgs;
|
|
}
|