remove: убран акшен Кричать

This commit is contained in:
Remuchi
2024-03-08 23:06:46 +07:00
parent ae812dde8f
commit 36c40bafd7
7 changed files with 2 additions and 86 deletions

View File

@@ -3,7 +3,6 @@ using Content.Server._White.AspectsSystem.Aspects;
using Content.Shared.Chat.Prototypes;
using Content.Shared.Humanoid;
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary;
@@ -32,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.

View File

@@ -1,10 +1,8 @@
using Content.Server.Actions;
using Content.Server.Chat.Systems;
using Content.Server.Speech.Components;
using Content.Shared.Chat.Prototypes;
using Content.Shared.Humanoid;
using Content.Shared.Speech;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
@@ -17,33 +15,13 @@ public sealed class VocalSystem : EntitySystem
[Dependency] private readonly IPrototypeManager _proto = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly ChatSystem _chat = default!;
[Dependency] private readonly ActionsSystem _actions = default!;
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)
@@ -67,15 +45,6 @@ public sealed class VocalSystem : EntitySystem
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))

View File

@@ -12,12 +12,12 @@ namespace Content.Server.Speech.Muting
public sealed class MutingSystem : EntitySystem
{
[Dependency] private readonly PopupSystem _popupSystem = default!;
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)
@@ -30,20 +30,6 @@ namespace Content.Server.Speech.Muting
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)
{
// TODO something better than this.
@@ -58,4 +44,4 @@ namespace Content.Server.Speech.Muting
args.Cancel();
}
}
}
}

View File

@@ -1,7 +0,0 @@
using Content.Shared.Actions;
namespace Content.Shared.Speech;
public sealed partial class ScreamActionEvent : InstantActionEvent
{
}

View File

@@ -1,5 +1,3 @@
ent-ActionScream = Крикнуть
.desc = ААААААААААААААААААААААААА
ent-ActionTurnUndead = Обратиться в зомби
.desc = Поддайтесь заражению и превратитесь в зомби.
ent-ActionToggleLight = Переключить фонарь

View File

@@ -1,16 +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: LesserFormRestricted
- type: entity
id: ActionTurnUndead
name: Turn Undead

View File

@@ -24,16 +24,6 @@
categories:
- Debug
- type: listing
id: DebugListing4
name: debug name 4
description: debug desc 4
productAction: ActionScream
categories:
- Debug
cost:
DebugDollar: 1
- type: listing
id: DebugListing2
name: debug name 2