Allow self-cuffing and appropriate text changes (#7829)

This commit is contained in:
freeman2651
2022-04-28 18:04:41 -04:00
committed by GitHub
parent 2d34ded94d
commit 847cc620d6
2 changed files with 32 additions and 17 deletions

View File

@@ -154,12 +154,6 @@ namespace Content.Server.Cuffs.Components
return false;
}
if (eventArgs.Target == eventArgs.User)
{
eventArgs.User.PopupMessage(Loc.GetString("handcuff-component-target-self-error"));
return true;
}
if (Broken)
{
eventArgs.User.PopupMessage(Loc.GetString("handcuff-component-cuffs-broken-error"));
@@ -184,9 +178,15 @@ namespace Content.Server.Cuffs.Components
return true;
}
eventArgs.User.PopupMessage(Loc.GetString("handcuff-component-start-cuffing-target-message",("targetName", eventArgs.Target)));
eventArgs.User.PopupMessage(target, Loc.GetString("handcuff-component-start-cuffing-by-other-message",("otherName", eventArgs.User)));
if (eventArgs.Target == eventArgs.User)
{
eventArgs.User.PopupMessage(Loc.GetString("handcuff-component-target-self"));
}
else
{
eventArgs.User.PopupMessage(Loc.GetString("handcuff-component-start-cuffing-target-message",("targetName", eventArgs.Target)));
eventArgs.User.PopupMessage(target, Loc.GetString("handcuff-component-start-cuffing-by-other-message",("otherName", eventArgs.User)));
}
SoundSystem.Play(Filter.Pvs(Owner), StartCuffSound.GetSound(), Owner);
TryUpdateCuff(eventArgs.User, target, cuffed);
@@ -225,15 +225,28 @@ namespace Content.Server.Cuffs.Components
if (cuffs.TryAddNewCuffs(user, Owner))
{
SoundSystem.Play(Filter.Pvs(Owner), EndCuffSound.GetSound(), Owner);
user.PopupMessage(Loc.GetString("handcuff-component-cuff-other-success-message",("otherName", target)));
target.PopupMessage(Loc.GetString("handcuff-component-cuff-by-other-success-message", ("otherName", user)));
if (target == user)
{
user.PopupMessage(Loc.GetString("handcuff-component-cuff-self-success-message"));
}
else
{
user.PopupMessage(Loc.GetString("handcuff-component-cuff-other-success-message",("otherName", target)));
target.PopupMessage(Loc.GetString("handcuff-component-cuff-by-other-success-message", ("otherName", user)));
}
}
}
else
{
user.PopupMessage(Loc.GetString("handcuff-component-cuff-interrupt-message",("targetName", target)));
target.PopupMessage(Loc.GetString("handcuff-component-cuff-interrupt-other-message",("otherName", user)));
if (target == user)
{
user.PopupMessage(Loc.GetString("handcuff-component-cuff-interrupt-self-message"));
}
else
{
user.PopupMessage(Loc.GetString("handcuff-component-cuff-interrupt-message",("targetName", target)));
target.PopupMessage(Loc.GetString("handcuff-component-cuff-interrupt-other-message",("otherName", user)));
}
}
}
}

View File

@@ -1,11 +1,13 @@
handcuff-component-target-self-error = You can't cuff yourself!
handcuff-component-target-self = You start cuffing yourself.
handcuff-component-cuffs-broken-error = The cuffs are broken!
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 cuffs!
handcuff-component-start-cuffing-target-message = You start cuffing {$targetName}.
handcuff-component-start-cuffing-target-message = You start cuffing {$targetName}.
handcuff-component-start-cuffing-by-other-message = {$otherName} starts cuffing you!
handcuff-component-cuff-other-success-message = You successfully cuff {$otherName}.
handcuff-component-cuff-by-other-success-message = You have been cuffed by {$otherName}!
handcuff-component-cuff-self-success-message = You cuff yourself.
handcuff-component-cuff-interrupt-message = You were interrupted while cuffing {$targetName}!
handcuff-component-cuff-interrupt-other-message = You interrupt {$otherName} while they are cuffing you!
handcuff-component-cuff-interrupt-other-message = You interrupt {$otherName} while they are cuffing you!
handcuff-component-cuff-interrupt-self-message = You were interrupted while cuffing yourself.