Merge remote-tracking branch 'upstream/stable' into ed-311-03-2025-upstream-2
# Conflicts: # Content.Client/Administration/AdminNameOverlay.cs # Content.Client/Administration/UI/Bwoink/BwoinkControl.xaml # Content.Client/Guidebook/Controls/GuideReagentReaction.xaml # Content.Client/Options/UI/Tabs/KeyRebindTab.xaml.cs # Content.Client/SubFloor/SubFloorHideSystem.cs # Content.Server/Administration/Systems/AdminVerbSystem.Antags.cs # Content.Server/Antag/AntagSelectionSystem.cs # Content.Server/Cloning/CloningSystem.cs # Content.Server/GameTicking/Rules/Components/ParadoxCloneRuleComponent.cs # Content.Server/GameTicking/Rules/ParadoxCloneRuleSystem.cs # Content.Server/Roles/ParadoxCloneRoleComponent.cs # Content.Shared.Database/LogType.cs # Content.Shared/CCVar/CCVars.Interface.cs # Content.Shared/Cloning/CloningEvents.cs # Content.Shared/Cloning/CloningSettingsPrototype.cs # Content.Shared/Humanoid/NamingSystem.cs # Content.Shared/Humanoid/Prototypes/SpeciesPrototype.cs # Content.Shared/Light/Components/SunShadowCycleComponent.cs # Content.Shared/Storage/StorageComponent.cs # Resources/Changelog/Admin.yml # Resources/Changelog/Changelog.yml # Resources/Credits/GitHub.txt # Resources/Locale/en-US/paradox-clone/role.ftl # Resources/Maps/bagel.yml # Resources/Maps/loop.yml # Resources/Prototypes/Chemistry/mixing_types.yml # Resources/Prototypes/Datasets/Names/last.yml # Resources/Prototypes/Entities/Effects/puddle.yml # Resources/Prototypes/Entities/Mobs/Player/clone.yml # Resources/Prototypes/Entities/Mobs/Species/base.yml # Resources/Prototypes/Entities/Objects/Deliveries/deliveries_tables.yml # Resources/Prototypes/Entities/Objects/Devices/pda.yml # Resources/Prototypes/Entities/Objects/Tools/handheld_mass_scanner.yml # Resources/Prototypes/GameRules/events.yml # Resources/Prototypes/Maps/Pools/default.yml # Resources/Prototypes/Objectives/paradoxClone.yml # Resources/Prototypes/Reagents/Consumable/Drink/alcohol.yml # Resources/Textures/Clothing/Eyes/Glasses/jensen.rsi/equipped-EYES-arachnid.png
This commit is contained in:
@@ -24,6 +24,7 @@ using Content.Shared.Mobs.Components;
|
||||
using Content.Shared.Mobs.Systems;
|
||||
using Content.Shared.Movement.Events;
|
||||
using Content.Shared.Movement.Systems;
|
||||
using Content.Shared.NameModifier.EntitySystems;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.Storage.Components;
|
||||
using Content.Shared.Tag;
|
||||
@@ -66,6 +67,7 @@ namespace Content.Server.Ghost
|
||||
[Dependency] private readonly SharedPopupSystem _popup = default!;
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
[Dependency] private readonly TagSystem _tag = default!;
|
||||
[Dependency] private readonly NameModifierSystem _nameMod = default!;
|
||||
|
||||
private EntityQuery<GhostComponent> _ghostQuery;
|
||||
private EntityQuery<PhysicsComponent> _physicsQuery;
|
||||
@@ -100,6 +102,17 @@ namespace Content.Server.Ghost
|
||||
|
||||
SubscribeLocalEvent<RoundEndTextAppendEvent>(_ => MakeVisible(true));
|
||||
SubscribeLocalEvent<ToggleGhostVisibilityToAllEvent>(OnToggleGhostVisibilityToAll);
|
||||
|
||||
SubscribeLocalEvent<GhostComponent, GetVisMaskEvent>(OnGhostVis);
|
||||
}
|
||||
|
||||
private void OnGhostVis(Entity<GhostComponent> ent, ref GetVisMaskEvent args)
|
||||
{
|
||||
// If component not deleting they can see ghosts.
|
||||
if (ent.Comp.LifeStage <= ComponentLifeStage.Running)
|
||||
{
|
||||
args.VisibilityMask |= (int)VisibilityFlags.Ghost;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnGhostHearingAction(EntityUid uid, GhostComponent component, ToggleGhostHearingActionEvent args)
|
||||
@@ -186,8 +199,7 @@ namespace Content.Server.Ghost
|
||||
_visibilitySystem.RefreshVisibility(uid, visibilityComponent: visibility);
|
||||
}
|
||||
|
||||
SetCanSeeGhosts(uid, true);
|
||||
|
||||
_eye.RefreshVisibilityMask(uid);
|
||||
var time = _gameTiming.CurTime;
|
||||
component.TimeOfDeath = time;
|
||||
}
|
||||
@@ -207,21 +219,10 @@ namespace Content.Server.Ghost
|
||||
}
|
||||
|
||||
// Entity can't see ghosts anymore.
|
||||
SetCanSeeGhosts(uid, false);
|
||||
_eye.RefreshVisibilityMask(uid);
|
||||
_actions.RemoveAction(uid, component.BooActionEntity);
|
||||
}
|
||||
|
||||
private void SetCanSeeGhosts(EntityUid uid, bool canSee, EyeComponent? eyeComponent = null)
|
||||
{
|
||||
if (!Resolve(uid, ref eyeComponent, false))
|
||||
return;
|
||||
|
||||
if (canSee)
|
||||
_eye.SetVisibilityMask(uid, eyeComponent.VisibilityMask | (int) VisibilityFlags.Ghost, eyeComponent);
|
||||
else
|
||||
_eye.SetVisibilityMask(uid, eyeComponent.VisibilityMask & ~(int) VisibilityFlags.Ghost, eyeComponent);
|
||||
}
|
||||
|
||||
private void OnMapInit(EntityUid uid, GhostComponent component, MapInitEvent args)
|
||||
{
|
||||
_actions.AddAction(uid, ref component.BooActionEntity, component.BooAction);
|
||||
@@ -501,6 +502,10 @@ namespace Content.Server.Ghost
|
||||
else
|
||||
_minds.TransferTo(mind.Owner, ghost, mind: mind.Comp);
|
||||
Log.Debug($"Spawned ghost \"{ToPrettyString(ghost)}\" for {mind.Comp.CharacterName}.");
|
||||
|
||||
// we changed the entity name above
|
||||
// we have to call this after the mind has been transferred since some mind roles modify the ghost's name
|
||||
_nameMod.RefreshNameModifiers(ghost);
|
||||
return ghost;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user