Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the Scream Action #57

Merged
merged 2 commits into from
Mar 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions Content.Server/Speech/Components/VocalComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ public sealed partial class VocalComponent : Component
[DataField("wilhelmProbability")]
public float WilhelmProbability = 0.0002f;

[DataField("screamAction", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
public string ScreamAction = "ActionScream";

[DataField("screamActionEntity")]
public EntityUid? ScreamActionEntity;

/// <summary>
/// Currently loaded emote sounds prototype, based on entity sex.
/// Null if no valid prototype for entity sex was found.
Expand Down
22 changes: 0 additions & 22 deletions Content.Server/Speech/EntitySystems/VocalSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,15 @@ public override void Initialize()
base.Initialize();

SubscribeLocalEvent<VocalComponent, MapInitEvent>(OnMapInit);
SubscribeLocalEvent<VocalComponent, ComponentShutdown>(OnShutdown);
SubscribeLocalEvent<VocalComponent, SexChangedEvent>(OnSexChanged);
SubscribeLocalEvent<VocalComponent, EmoteEvent>(OnEmote);
SubscribeLocalEvent<VocalComponent, ScreamActionEvent>(OnScreamAction);
}

private void OnMapInit(EntityUid uid, VocalComponent component, MapInitEvent args)
{
// try to add scream action when vocal comp added
_actions.AddAction(uid, ref component.ScreamActionEntity, component.ScreamAction);
LoadSounds(uid, component);
}

private void OnShutdown(EntityUid uid, VocalComponent component, ComponentShutdown args)
{
// remove scream action when component removed
if (component.ScreamActionEntity != null)
{
_actions.RemoveAction(uid, component.ScreamActionEntity);
}
}

private void OnSexChanged(EntityUid uid, VocalComponent component, SexChangedEvent args)
{
LoadSounds(uid, component);
Expand All @@ -67,15 +54,6 @@ private void OnEmote(EntityUid uid, VocalComponent component, ref EmoteEvent arg
args.Handled = _chat.TryPlayEmoteSound(uid, component.EmoteSounds, args.Emote);
}

private void OnScreamAction(EntityUid uid, VocalComponent component, ScreamActionEvent args)
{
if (args.Handled)
return;

_chat.TryEmoteWithChat(uid, component.ScreamId);
args.Handled = true;
}

private bool TryPlayScreamSound(EntityUid uid, VocalComponent component)
{
if (_random.Prob(component.WilhelmProbability))
Expand Down
14 changes: 0 additions & 14 deletions Content.Server/Speech/Muting/MutingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public override void Initialize()
base.Initialize();
SubscribeLocalEvent<MutedComponent, SpeakAttemptEvent>(OnSpeakAttempt);
SubscribeLocalEvent<MutedComponent, EmoteEvent>(OnEmote, before: new[] { typeof(VocalSystem) });
SubscribeLocalEvent<MutedComponent, ScreamActionEvent>(OnScreamAction, before: new[] { typeof(VocalSystem) });
}

private void OnEmote(EntityUid uid, MutedComponent component, ref EmoteEvent args)
Expand All @@ -30,19 +29,6 @@ private void OnEmote(EntityUid uid, MutedComponent component, ref EmoteEvent arg
args.Handled = true;
}

private void OnScreamAction(EntityUid uid, MutedComponent component, ScreamActionEvent args)
{
if (args.Handled)
return;

if (HasComp<MimePowersComponent>(uid))
_popupSystem.PopupEntity(Loc.GetString("mime-cant-speak"), uid, uid);

else
_popupSystem.PopupEntity(Loc.GetString("speech-muted"), uid, uid);
args.Handled = true;
}


private void OnSpeakAttempt(EntityUid uid, MutedComponent component, SpeakAttemptEvent args)
{
Expand Down
7 changes: 0 additions & 7 deletions Content.Shared/Speech/ScreamActionEvent.cs

This file was deleted.

12 changes: 0 additions & 12 deletions Resources/Prototypes/Actions/types.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
- type: entity
id: ActionScream
name: Scream
description: AAAAAAAAAAAAAAAAAAAAAAAAA
noSpawn: true
components:
- type: InstantAction
useDelay: 10
icon: Interface/Actions/scream.png
event: !type:ScreamActionEvent
checkCanInteract: false

- type: entity
id: ActionTurnUndead
name: Turn Undead
Expand Down
2 changes: 1 addition & 1 deletion Resources/Prototypes/Catalog/catalog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
id: DebugListing4
name: debug name 4
description: debug desc 4
productAction: ActionScream
productAction: ActionSleep
categories:
- Debug
cost:
Expand Down
Loading