Merge remote-tracking branch 'upstream/stable' into ed-12-05-2025-upstream

# Conflicts:
#	.github/CODEOWNERS
#	Content.Client/Construction/UI/ConstructionMenuPresenter.cs
#	Content.Shared/Construction/Prototypes/ConstructionPrototype.cs
#	Content.Shared/Damage/Systems/SharedStaminaSystem.cs
#	Content.Shared/Lock/LockSystem.cs
#	Resources/Prototypes/Entities/Mobs/Customization/Markings/human_hair.yml
#	Resources/Prototypes/Entities/Objects/Specific/chemistry.yml
#	Resources/Prototypes/Procedural/vgroid.yml
This commit is contained in:
Ed
2025-05-12 14:25:42 +03:00
1224 changed files with 155650 additions and 65383 deletions

View File

@@ -253,6 +253,24 @@ public abstract partial class SharedMindSystem : EntitySystem
return _mobState.IsDead(mind.OwnedEntity.Value, targetMobState);
}
/// <summary>
/// True if the OwnedEntity of this mind is physically unrevivable.
/// This is mainly to check whether a mind is able to inherit their "original" character again without the need for creating a new one.
/// In cases of being a brain, being borged or a zombie they are "unrevivable"
/// </summary>
public bool IsCharacterUnrevivablePhysically(MindComponent mind)
{
if (mind.OwnedEntity == null)
return true;
// This entity cannot be dead, alive or crit, so it makes sense it cannot be revived to begin with.
if (!HasComp<MobStateComponent>(mind.OwnedEntity))
return true;
// Could use checks for the amount of damage they have, but with chemistry you can never tell what damage means someone is truly "unrevivable".
return false;
}
public virtual void Visit(EntityUid mindId, EntityUid entity, MindComponent? mind = null)
{
}
@@ -570,6 +588,27 @@ public abstract partial class SharedMindSystem : EntitySystem
return IsCharacterDeadPhysically(mind);
}
/// <summary>
/// True if this Mind is 'sufficiently unrevivable' IC (Objectives, EndText).
/// Note that this is *IC logic*, it's not necessarily tied to any specific truth.
/// "If administrators decide that zombies are unrevivable, this returns true for zombies."
/// Alternative IsCharacterDeadIC that checks for whether they will be able to inherit their body again.
/// State in which they must be given a new body to "live" (borging, being a brain, etc) should count as "unrevivable".
/// </summary>
public bool IsCharacterUnrevivableIc(MindComponent mind)
{
if (mind.OwnedEntity is { } owned)
{
var ev = new GetCharacterUnrevivableIcEvent(null);
RaiseLocalEvent(owned, ref ev);
if (ev.Unrevivable != null)
return ev.Unrevivable.Value;
}
return IsCharacterUnrevivablePhysically(mind);
}
/// <summary>
/// A string to represent the mind for logging
/// </summary>
@@ -616,3 +655,11 @@ public abstract partial class SharedMindSystem : EntitySystem
/// <param name="Dead"></param>
[ByRefEvent]
public record struct GetCharactedDeadIcEvent(bool? Dead);
/// <summary>
/// Raised on an entity to determine whether or not they are "unrevivable" in IC-logic.
/// Used to check for things such as being borged or a zombie.
/// </summary>
/// <param name="Unrevivable"></param>
[ByRefEvent]
public record struct GetCharacterUnrevivableIcEvent(bool? Unrevivable);