parent
38f8bb64c1
commit
fad73897a1
|
|
@ -341,8 +341,11 @@ namespace Content.Shared.Cuffs
|
|||
component.Used = true;
|
||||
_audio.PlayPredicted(component.EndCuffSound, uid, user);
|
||||
|
||||
_popup.PopupEntity(Loc.GetString("handcuff-component-cuff-observer-success-message",
|
||||
("user", Identity.Name(user, EntityManager)), ("target", Identity.Name(target, EntityManager))),
|
||||
var popupText = (user == target)
|
||||
? "handcuff-component-cuff-self-observer-success-message"
|
||||
: "handcuff-component-cuff-observer-success-message";
|
||||
_popup.PopupEntity(Loc.GetString(popupText,
|
||||
("user", Identity.Name(user, EntityManager)), ("target", Identity.Entity(target, EntityManager))),
|
||||
target, Filter.Pvs(target, entityManager: EntityManager)
|
||||
.RemoveWhere(e => e.AttachedEntity == target || e.AttachedEntity == user), true);
|
||||
|
||||
|
|
@ -521,8 +524,11 @@ namespace Content.Shared.Cuffs
|
|||
if (!_doAfter.TryStartDoAfter(doAfterEventArgs))
|
||||
return true;
|
||||
|
||||
_popup.PopupEntity(Loc.GetString("handcuff-component-start-cuffing-observer",
|
||||
("user", Identity.Name(user, EntityManager)), ("target", Identity.Name(target, EntityManager))),
|
||||
var popupText = (user == target)
|
||||
? "handcuff-component-start-cuffing-self-observer"
|
||||
: "handcuff-component-start-cuffing-observer";
|
||||
_popup.PopupEntity(Loc.GetString(popupText,
|
||||
("user", Identity.Name(user, EntityManager)), ("target", Identity.Entity(target, EntityManager))),
|
||||
target, Filter.Pvs(target, entityManager: EntityManager)
|
||||
.RemoveWhere(e => e.AttachedEntity == target || e.AttachedEntity == user), true);
|
||||
|
||||
|
|
@ -545,6 +551,7 @@ namespace Content.Shared.Cuffs
|
|||
/// <summary>
|
||||
/// Checks if the target is handcuffed.
|
||||
/// </summary>
|
||||
/// /// <param name="target">The entity to be checked</param>
|
||||
/// <param name="requireFullyCuffed">when true, return false if the target is only partially cuffed (for things with more than 2 hands)</param>
|
||||
/// <returns></returns>
|
||||
public bool IsCuffed(Entity<CuffableComponent> target, bool requireFullyCuffed = true)
|
||||
|
|
@ -642,10 +649,13 @@ namespace Content.Shared.Cuffs
|
|||
|
||||
_adminLog.Add(LogType.Action, LogImpact.Low, $"{ToPrettyString(user)} is trying to uncuff {ToPrettyString(target)}");
|
||||
|
||||
var popupText = user == target
|
||||
? "cuffable-component-start-uncuffing-self-observer"
|
||||
: "cuffable-component-start-uncuffing-observer";
|
||||
_popup.PopupEntity(
|
||||
Loc.GetString("cuffable-component-start-uncuffing-observer",
|
||||
Loc.GetString(popupText,
|
||||
("user", Identity.Name(user, EntityManager)),
|
||||
("target", Identity.Name(target, EntityManager))),
|
||||
("target", Identity.Entity(target, EntityManager))),
|
||||
target,
|
||||
Filter.Pvs(target, entityManager: EntityManager)
|
||||
.RemoveWhere(e => e.AttachedEntity == target || e.AttachedEntity == user),
|
||||
|
|
@ -710,11 +720,11 @@ namespace Content.Shared.Cuffs
|
|||
if (cuffable.CuffedHandCount == 0)
|
||||
{
|
||||
if (user != null)
|
||||
_popup.PopupPredicted(Loc.GetString("cuffable-component-remove-cuffs-success-message"), user.Value, user.Value);
|
||||
_popup.PopupClient(Loc.GetString("cuffable-component-remove-cuffs-success-message"), user.Value, user.Value);
|
||||
|
||||
if (target != user && user != null)
|
||||
{
|
||||
_popup.PopupPredicted(Loc.GetString("cuffable-component-remove-cuffs-by-other-success-message",
|
||||
_popup.PopupEntity(Loc.GetString("cuffable-component-remove-cuffs-by-other-success-message",
|
||||
("otherName", Identity.Name(user.Value, EntityManager, user))), target, target);
|
||||
_adminLog.Add(LogType.Action, LogImpact.Medium,
|
||||
$"{ToPrettyString(user):player} has successfully uncuffed {ToPrettyString(target):player}");
|
||||
|
|
@ -729,17 +739,17 @@ namespace Content.Shared.Cuffs
|
|||
{
|
||||
if (user != target)
|
||||
{
|
||||
_popup.PopupPredicted(Loc.GetString("cuffable-component-remove-cuffs-partial-success-message",
|
||||
_popup.PopupClient(Loc.GetString("cuffable-component-remove-cuffs-partial-success-message",
|
||||
("cuffedHandCount", cuffable.CuffedHandCount),
|
||||
("otherName", Identity.Name(user.Value, EntityManager, user.Value))), user.Value, user.Value);
|
||||
_popup.PopupPredicted(Loc.GetString(
|
||||
_popup.PopupEntity(Loc.GetString(
|
||||
"cuffable-component-remove-cuffs-by-other-partial-success-message",
|
||||
("otherName", Identity.Name(user.Value, EntityManager, user.Value)),
|
||||
("cuffedHandCount", cuffable.CuffedHandCount)), target, target);
|
||||
}
|
||||
else
|
||||
{
|
||||
_popup.PopupPredicted(Loc.GetString("cuffable-component-remove-cuffs-partial-success-message",
|
||||
_popup.PopupClient(Loc.GetString("cuffable-component-remove-cuffs-partial-success-message",
|
||||
("cuffedHandCount", cuffable.CuffedHandCount)), user.Value, user.Value);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ cuffable-component-cannot-remove-cuffs-too-far-message = You are too far away to
|
|||
|
||||
cuffable-component-start-uncuffing-self = You start to painfully wriggle out of your restraints.
|
||||
cuffable-component-start-uncuffing-observer = {$user} starts unrestraining {$target}!
|
||||
cuffable-component-start-uncuffing-self-observer = {$user} starts unrestraining {REFLEXIVE($target)}!
|
||||
cuffable-component-start-uncuffing-target-message = You start unrestraining {$targetName}.
|
||||
cuffable-component-start-uncuffing-by-other-message = {$otherName} starts unrestraining you!
|
||||
|
||||
|
|
|
|||
|
|
@ -4,9 +4,11 @@ handcuff-component-target-has-no-hands-error = {$targetName} has no hands!
|
|||
handcuff-component-target-has-no-free-hands-error = {$targetName} has no free hands!
|
||||
handcuff-component-too-far-away-error = You are too far away to use the restraints!
|
||||
handcuff-component-start-cuffing-observer = {$user} starts restraining {$target}!
|
||||
handcuff-component-start-cuffing-self-observer = {$user} starts restraining {REFLEXIVE($target)}.
|
||||
handcuff-component-start-cuffing-target-message = You start restraining {$targetName}.
|
||||
handcuff-component-start-cuffing-by-other-message = {$otherName} starts restraining you!
|
||||
handcuff-component-cuff-observer-success-message = {$user} restrains {$target}.
|
||||
handcuff-component-cuff-self-observer-success-message = {$user} restrains {REFLEXIVE($target)}.
|
||||
handcuff-component-cuff-other-success-message = You successfully restrain {$otherName}.
|
||||
handcuff-component-cuff-by-other-success-message = You have been restrained by {$otherName}!
|
||||
handcuff-component-cuff-self-success-message = You restrain yourself.
|
||||
|
|
|
|||
Loading…
Reference in New Issue