diff --git a/Content.Server/SS220/Shout/ShoutSystem.cs b/Content.Server/SS220/Shout/ShoutSystem.cs new file mode 100644 index 00000000000000..19c5b251c42f73 --- /dev/null +++ b/Content.Server/SS220/Shout/ShoutSystem.cs @@ -0,0 +1,56 @@ +// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt + +using Content.Shared.ActionBlocker; +using Robust.Shared.Audio.Systems; +using Content.Server.Chat.Systems; +using Content.Shared.SS220.Shout; +using Content.Shared.Dataset; +using Robust.Shared.Random; +using Robust.Shared.Prototypes; + +namespace Content.Server.SS220.Shout; + +public sealed class ShoutSystem : EntitySystem +{ + [Dependency] private readonly SharedAudioSystem _audio = default!; + [Dependency] private readonly ActionBlockerSystem _actionBlocker = default!; + [Dependency] private readonly ChatSystem _chat = default!; + [Dependency] private readonly IPrototypeManager _proto = default!; + [Dependency] private readonly IRobustRandom _random = default!; + + /// + /// Just handler of a ShoutActionEvent. + /// If there is no sound or phrase it won't do anything. + /// + + public override void Initialize() + { + base.Initialize(); + SubscribeLocalEvent(OnShoutAction); + } + + private void OnShoutAction(ShoutActionEvent args) + { + if (args.Handled) + return; + + args.Handled = true; + + if (!_actionBlocker.CanEmote(args.Performer)) + return; + + if (args.ShoutSound != null) + { + _audio.PlayEntity(args.ShoutSound, args.Performer, args.Performer); + } + + if (args.ShoutPhrases != null) + { + if (!_proto.TryIndex(args.ShoutPhrases, out var placeholder))//i dont like nested ifs, but idk how to make it more pretty + return; + + var emoteType = _random.Pick(placeholder.Values); + _chat.TrySendInGameICMessage(args.Performer, emoteType, InGameICChatType.Emote, ChatTransmitRange.Normal, checkRadioPrefix: false, ignoreActionBlocker: true); + } + } +} diff --git a/Content.Shared/SS220/Shout/ShoutEvent.cs b/Content.Shared/SS220/Shout/ShoutEvent.cs new file mode 100644 index 00000000000000..2ed566c60c1c75 --- /dev/null +++ b/Content.Shared/SS220/Shout/ShoutEvent.cs @@ -0,0 +1,26 @@ +// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt + +using Content.Shared.Actions; +using Robust.Shared.Prototypes; +using Robust.Shared.Audio; +using Content.Shared.Dataset; + +namespace Content.Shared.SS220.Shout; +/// +/// Event for memes, or is u want to make some kind of alternative scream button +/// +/// ToDo maybe add some gender checks if it will be used be anybody except me? +public sealed partial class ShoutActionEvent : InstantActionEvent +{ + /// + /// Sound played when action button is pressed + /// + [DataField, ViewVariables(VVAccess.ReadWrite)] + public SoundSpecifier? ShoutSound; + + /// + /// Shouted phrase when action button is pressed + /// + [DataField] + public ProtoId? ShoutPhrases; +} diff --git a/Resources/Audio/SS220/Voice/Goal/attributions.yml b/Resources/Audio/SS220/Voice/Goal/attributions.yml new file mode 100644 index 00000000000000..a96cd3d1e5ca1e --- /dev/null +++ b/Resources/Audio/SS220/Voice/Goal/attributions.yml @@ -0,0 +1,5 @@ +- files: + - gooool.ogg + license: "CC0-1.0" + copyright: "Modified by SkaldetSkaeg (Github), shortened, cleaned from background sounds, converted to OGG." + source: "https://www.myinstants.com/ru/instant/goool-7073/" diff --git a/Resources/Audio/SS220/Voice/Goal/gooool.ogg b/Resources/Audio/SS220/Voice/Goal/gooool.ogg new file mode 100644 index 00000000000000..3a78ec009cfdcd Binary files /dev/null and b/Resources/Audio/SS220/Voice/Goal/gooool.ogg differ diff --git a/Resources/Locale/ru-RU/ss220/prototypes/actions/types.ftl b/Resources/Locale/ru-RU/ss220/prototypes/actions/types.ftl new file mode 100644 index 00000000000000..08c6978a82ff77 --- /dev/null +++ b/Resources/Locale/ru-RU/ss220/prototypes/actions/types.ftl @@ -0,0 +1,2 @@ +ent-ActionGoal = Гол + .desc = ГОООООООООООООООООООЛ! diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/space.yml b/Resources/Prototypes/Entities/Mobs/NPCs/space.yml index 482f7cd723d4d0..192ae04a4f6f18 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/space.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/space.yml @@ -110,6 +110,11 @@ interactFailureString: petting-failure-bear interactSuccessSound: path: /Audio/Animals/sloth_squeak.ogg + #SS220 Goal start + - type: ActionGrant + actions: + - ActionGoal + #SS220 Goal end - type: entity id: MobBearSpaceSalvage diff --git a/Resources/Prototypes/SS220/Actions/types.yml b/Resources/Prototypes/SS220/Actions/types.yml index df5a803fd0fc42..9813f13ea93fea 100644 --- a/Resources/Prototypes/SS220/Actions/types.yml +++ b/Resources/Prototypes/SS220/Actions/types.yml @@ -9,3 +9,16 @@ itemIconStyle: NoItem useDelay: 1 # emote spam event: !type:ToggleActionEvent + +- type: entity + id: ActionGoal + name: Goal! + description: Gooooooooal! + components: + - type: InstantAction + useDelay: 20 + icon: { sprite: SS220/Interface/Actions/actions_meme.rsi, state: goal } + event: !type:ShoutActionEvent + shoutSound: + path: /Audio/SS220/Voice/Goal/gooool.ogg + shoutPhrases: goalPhrases diff --git a/Resources/Prototypes/SS220/Datasets/goal.yml b/Resources/Prototypes/SS220/Datasets/goal.yml new file mode 100644 index 00000000000000..1510ee3095a7e2 --- /dev/null +++ b/Resources/Prototypes/SS220/Datasets/goal.yml @@ -0,0 +1,9 @@ +- type: dataset + id: goalPhrases + values: + - восклицает + - голосует + - бравирует + - возглашает + - выкрикивает + - вскрикивает diff --git a/Resources/Textures/SS220/Interface/Actions/actions_meme.rsi/goal.png b/Resources/Textures/SS220/Interface/Actions/actions_meme.rsi/goal.png new file mode 100644 index 00000000000000..03527da2d1e494 Binary files /dev/null and b/Resources/Textures/SS220/Interface/Actions/actions_meme.rsi/goal.png differ diff --git a/Resources/Textures/SS220/Interface/Actions/actions_meme.rsi/meta.json b/Resources/Textures/SS220/Interface/Actions/actions_meme.rsi/meta.json new file mode 100644 index 00000000000000..372d6eceb73f24 --- /dev/null +++ b/Resources/Textures/SS220/Interface/Actions/actions_meme.rsi/meta.json @@ -0,0 +1,14 @@ +{ + "version": 1, + "license": "EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt", + "copyright": "Sprited by DaGo7393 (Discord) for SS220", + "size": { + "x": 32, + "y": 32 + }, + "states": [ + { + "name": "goal" + } + ] +}