Skip to content

Commit

Permalink
Merge branch 'master' into january-vanilla-upstream-merge
Browse files Browse the repository at this point in the history
  • Loading branch information
dvir001 committed Feb 3, 2024
2 parents da83d1a + e338f65 commit 11b7784
Show file tree
Hide file tree
Showing 13 changed files with 237 additions and 184 deletions.
26 changes: 18 additions & 8 deletions Content.Server/Puppet/VentriloquistPuppetSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
using Content.Server.Speech.Muting;
using Content.Shared.CombatMode;
using Content.Shared.Hands;
using Robust.Shared.Random;

namespace Content.Server.Puppet
{
public sealed class VentriloquistPuppetSystem : SharedVentriloquistPuppetSystem
{
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly IRobustRandom _random = default!;

public override void Initialize()
{
Expand All @@ -36,22 +38,27 @@ private void OnUseInHand(EntityUid uid, VentriloquistPuppetComponent component,

if (!RemComp<MutedComponent>(uid))
{
_popupSystem.PopupEntity(Loc.GetString("ventriloquist-puppet-remove-hand"), uid, args.User);
_popupSystem.PopupEntity(Loc.GetString(_random.Pick(component.RemoveHand)), uid, args.User); // Frontier
//_popupSystem.PopupEntity(Loc.GetString("ventriloquist-puppet-remove-hand"), uid, args.User);
MuteDummy(uid, component);
return;
}

// TODO why does this need a combat component???
EnsureComp<CombatModeComponent>(uid);
_popupSystem.PopupEntity(Loc.GetString("ventriloquist-puppet-insert-hand"), uid, args.User);
_popupSystem.PopupEntity(Loc.GetString("ventriloquist-puppet-inserted-hand"), uid, uid);
_popupSystem.PopupEntity(Loc.GetString(_random.Pick(component.InsertHand)), uid, args.User); // Frontier
_popupSystem.PopupEntity(Loc.GetString(_random.Pick(component.InsertedHand)), uid, uid); // Frontier
// _popupSystem.PopupEntity(Loc.GetString("ventriloquist-puppet-insert-hand"), uid, args.User);
// _popupSystem.PopupEntity(Loc.GetString("ventriloquist-puppet-inserted-hand"), uid, uid);

if (!HasComp<GhostTakeoverAvailableComponent>(uid))
{
AddComp<GhostTakeoverAvailableComponent>(uid);
var ghostRole = EnsureComp<GhostRoleComponent>(uid);
ghostRole.RoleName = Loc.GetString("ventriloquist-puppet-role-name");
ghostRole.RoleDescription = Loc.GetString("ventriloquist-puppet-role-description");
ghostRole.RoleName = Loc.GetString(_random.Pick(component.PuppetRoleName)); // Frontier
ghostRole.RoleDescription = Loc.GetString(_random.Pick(component.PuppetRoleDescription)); // Frontier
//ghostRole.RoleName = Loc.GetString("ventriloquist-puppet-role-name");
//ghostRole.RoleDescription = Loc.GetString("ventriloquist-puppet-role-description");
}

args.Handled = true;
Expand All @@ -65,7 +72,8 @@ private void OnDropped(EntityUid uid, VentriloquistPuppetComponent component, Dr
if (HasComp<MutedComponent>(uid))
return;

_popupSystem.PopupEntity(Loc.GetString("ventriloquist-puppet-remove-hand"), uid, args.User);
_popupSystem.PopupEntity(Loc.GetString(_random.Pick(component.RemoveHand)), uid, args.User); // Frontier
//_popupSystem.PopupEntity(Loc.GetString("ventriloquist-puppet-remove-hand"), uid, args.User);
MuteDummy(uid, component);
}

Expand All @@ -77,7 +85,8 @@ private void OnUnequippedHand(EntityUid uid, VentriloquistPuppetComponent compon
if (HasComp<MutedComponent>(uid))
return;

_popupSystem.PopupEntity(Loc.GetString("ventriloquist-puppet-remove-hand"), uid, args.User);
_popupSystem.PopupEntity(Loc.GetString(_random.Pick(component.RemoveHand)), uid, args.User); // Frontier
//_popupSystem.PopupEntity(Loc.GetString("ventriloquist-puppet-remove-hand"), uid, args.User);
MuteDummy(uid, component);
}

Expand All @@ -86,7 +95,8 @@ private void OnUnequippedHand(EntityUid uid, VentriloquistPuppetComponent compon
/// </summary>
private void MuteDummy(EntityUid uid, VentriloquistPuppetComponent component)
{
_popupSystem.PopupEntity(Loc.GetString("ventriloquist-puppet-removed-hand"), uid, uid);
_popupSystem.PopupEntity(Loc.GetString(_random.Pick(component.RemovedHand)), uid, uid); // Frontier
//_popupSystem.PopupEntity(Loc.GetString("ventriloquist-puppet-removed-hand"), uid, uid);
EnsureComp<MutedComponent>(uid);
RemComp<CombatModeComponent>(uid);
RemComp<GhostTakeoverAvailableComponent>(uid);
Expand Down
19 changes: 18 additions & 1 deletion Content.Shared/Puppet/VentriloquistPuppetComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,21 @@ namespace Content.Shared.Puppet;
[RegisterComponent, NetworkedComponent]
public sealed partial class VentriloquistPuppetComponent : Component
{
}
[DataField, ViewVariables(VVAccess.ReadWrite)]
public List<LocId> RemoveHand = new ();

[DataField, ViewVariables(VVAccess.ReadWrite)]
public List<LocId> RemovedHand = new();

[DataField, ViewVariables(VVAccess.ReadWrite)]
public List<LocId> InsertHand = new ();

[DataField, ViewVariables(VVAccess.ReadWrite)]
public List<LocId> InsertedHand = new ();

[DataField, ViewVariables(VVAccess.ReadWrite)]
public List<LocId> PuppetRoleName = new ();

[DataField, ViewVariables(VVAccess.ReadWrite)]
public List<LocId> PuppetRoleDescription = new ();
}
7 changes: 7 additions & 0 deletions Resources/Locale/en-US/_NF/ventriloquist/ventriloquist.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ventriloquist-rock-grasp-hand = You firmly grasp the pet rock.
ventriloquist-rock-release-hand = You release your grip on the pet rock.
ventriloquist-rock-grasped-hand = You have been grasped.
ventriloquist-rock-released-hand = You been released.
ventriloquist-rock-role-name = A pet rock
ventriloquist-rock-role-description = You are a pet mineral.
14 changes: 13 additions & 1 deletion Resources/Prototypes/Entities/Objects/Fun/puppet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,19 @@
- type: Input
context: "human"
- type: DoAfter
- type: VentriloquistPuppet
- type: VentriloquistPuppet # Frontier
removeHand:
- ventriloquist-puppet-remove-hand
removedHand:
- ventriloquist-puppet-removed-hand
insertHand:
- ventriloquist-puppet-insert-hand
insertedHand:
- ventriloquist-puppet-inserted-hand
puppetRoleName:
- ventriloquist-puppet-role-name
puppetRoleDescription:
- ventriloquist-puppet-role-description
- type: Item
size: Normal
- type: Muted
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
WhoopieCushion: 3
MrChips: 1
MrDips: 1
PetRockCarrier: 1
RevolverCapGun: 2
VehicleUnicycleFolded: 2
ClothingHeadHatMagician: 2
Expand Down
Loading

0 comments on commit 11b7784

Please sign in to comment.