diff --git a/Content.Server/_White/_Engi/PacifiedOnChaplainAction/PacifiedOnChaplainActionComponent.cs b/Content.Server/_White/_Engi/PacifiedOnChaplainAction/PacifiedOnChaplainActionComponent.cs new file mode 100644 index 0000000000..7ac2616d17 --- /dev/null +++ b/Content.Server/_White/_Engi/PacifiedOnChaplainAction/PacifiedOnChaplainActionComponent.cs @@ -0,0 +1,15 @@ +using Robust.Shared.Audio; + +namespace Content.Server._White._Engi.PacifiedOnChaplainAction +{ + /// + /// Adds verb for chaplain to pacify entity. + /// WD Engi Exclusive. + /// + [RegisterComponent] + public sealed partial class PacifiedOnChaplainActionComponent : Component + { + [DataField] + public SoundSpecifier ActionSound = new SoundPathSpecifier("/Audio/Effects/holy.ogg"); + } +} diff --git a/Content.Server/_White/_Engi/PacifiedOnChaplainAction/PacifiedOnChaplainActionSystem.cs b/Content.Server/_White/_Engi/PacifiedOnChaplainAction/PacifiedOnChaplainActionSystem.cs new file mode 100644 index 0000000000..aa028745e0 --- /dev/null +++ b/Content.Server/_White/_Engi/PacifiedOnChaplainAction/PacifiedOnChaplainActionSystem.cs @@ -0,0 +1,106 @@ +using Content.Shared.ActionBlocker; +using Content.Server.Popups; +using Robust.Shared.Audio.Systems; +using Content.Shared.Interaction; +using Content.Shared.Verbs; +using Content.Server.Bible.Components; +using Content.Shared.Timing; +using Content.Shared.CombatMode.Pacification; + +namespace Content.Server._White._Engi.PacifiedOnChaplainAction +{ + /// + /// WD Engi Exclusive. + /// + public sealed class PacifiedOnChaplainAction : EntitySystem + { + [Dependency] private readonly ActionBlockerSystem _blocker = default!; + [Dependency] private readonly PopupSystem _popupSystem = default!; + [Dependency] private readonly SharedAudioSystem _audio = default!; + [Dependency] private readonly UseDelaySystem _delay = default!; + + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnAfterInteract); + SubscribeLocalEvent>(AddPacifiedOnChaplainVerb); + } + + private void Action(PacifiedOnChaplainActionComponent component, EntityUid target, EntityUid user) + { + var popup = ""; + + if (HasComp(target)) + { + popup = "unpacified-by-chaplain"; + RemComp(target); + } + else + { + popup = "pacified-by-chaplain"; + EnsureComp(target); + } + + _popupSystem.PopupEntity(Loc.GetString(popup, ("target", target)), user, user); + + _audio.PlayPvs(component.ActionSound, user); + + } + + private void OnAfterInteract(EntityUid uid, PacifiedOnChaplainActionComponent component, AfterInteractEvent args) + { + if (!args.CanReach) + return; + + if (!TryComp(uid, out UseDelayComponent? useDelay) || _delay.IsDelayed((uid, useDelay))) + return; + + if (args.Target == null) + return; + + if (!HasComp(args.User)) + return; + + Action(component, (EntityUid) args.Target, args.User); + + _delay.TryResetDelay((uid, useDelay)); + + return; + } + private void AddPacifiedOnChaplainVerb(EntityUid uid, PacifiedOnChaplainActionComponent component, GetVerbsEvent args) + { + if (!args.CanInteract || !args.CanAccess) + return; + + if (!HasComp(args.User)) + return; + + if (!_blocker.CanInteract(args.User, uid)) + return; + + var verbName = ""; + + if (HasComp(args.Target)) + verbName = Loc.GetString("unpacify-by-chaplain"); + else + verbName = Loc.GetString("pacify-by-chaplain"); + + AlternativeVerb verb = new() + { + Act = () => + { + if (!TryComp(uid, out UseDelayComponent? useDelay) || _delay.IsDelayed((uid, useDelay))) + return; + + Action(component, args.Target, args.User); + + _delay.TryResetDelay((uid, useDelay)); + }, + Text = verbName, + Priority = 2 + }; + args.Verbs.Add(verb); + } + } +} diff --git a/Resources/Locale/ru-RU/_Engi/pacified-on-chaplain-action.ftl b/Resources/Locale/ru-RU/_Engi/pacified-on-chaplain-action.ftl new file mode 100644 index 0000000000..d3dea6a291 --- /dev/null +++ b/Resources/Locale/ru-RU/_Engi/pacified-on-chaplain-action.ftl @@ -0,0 +1,5 @@ +pacified-by-chaplain = {$target} пасифицирован. +unpacified-by-chaplain = {$target} освобождён. + +pacify-by-chaplain = Пасифицировать +unpacify-by-chaplain = Освободить diff --git a/Resources/Locale/ru-RU/_Engi/possesed-blade.ftl b/Resources/Locale/ru-RU/_Engi/possesed-blade.ftl new file mode 100644 index 0000000000..ab2376b0e7 --- /dev/null +++ b/Resources/Locale/ru-RU/_Engi/possesed-blade.ftl @@ -0,0 +1,3 @@ +ghost-role-information-possessed-blade-name = Одержимый Клинок +ghost-role-information-possessed-blade-description = Вы - Одержимый Клинок. Подчиняйтесь своему владельцу. +ghost-role-information-possessed-blade-rules = Вы не имеете право атаковать своего владельца. Право собственности может быть передано только вашим владельцем. diff --git a/Resources/Prototypes/_White/Entities/Objects/Weapons/chaplain_weapons.yml b/Resources/Prototypes/_White/Entities/Objects/Weapons/chaplain_weapons.yml index 43d4460ec5..6862190195 100644 --- a/Resources/Prototypes/_White/Entities/Objects/Weapons/chaplain_weapons.yml +++ b/Resources/Prototypes/_White/Entities/Objects/Weapons/chaplain_weapons.yml @@ -264,10 +264,11 @@ - type: Sharp # Может пиздеть +# WD Engi Exclusive - и может давать пизды - type: entity parent: HolyKatana id: PossessedBlade - name: одержимый клинок + name: Одержимый Клинок description: Когда на станции царит хаос, приятно иметь рядом друга. components: - type: Sprite @@ -281,9 +282,11 @@ - suitStorage - type: GhostRole allowSpeech: true - name: Одержимый Клинок - description: Вы - одержимый клинок. Подчиняйтесь своему владельцу. - rules: ghost-role-component-default-rules + # WD Engi Exclusive edit start + name: ghost-role-information-possessed-blade-name + description: ghost-role-information-possessed-blade-description + rules: ghost-role-information-possessed-blade-rules + # WD Engi Exclusive edit end - type: GhostTakeoverAvailable - type: Examiner - type: Item @@ -292,6 +295,16 @@ shape: - 0, 0, 1, 3 sprite: White/Objects/Weapons/Chaplain/possessed.rsi + # WD Engi Exclusive start + - type: DamageOtherOnHit + damage: + types: + Slash: 13 + - type: CombatMode + - type: UseDelay + delay: 2.0 + - type: PacifiedOnChaplainAction + # WD Engi Exclusive end # Приклеен к руке, быстро и громко бьет - type: entity