From 2a440cc319409d205b698df5e83eb2b4f37fec18 Mon Sep 17 00:00:00 2001 From: PuroSlavKing Date: Sun, 24 Nov 2024 01:18:48 +0300 Subject: [PATCH 1/6] [Feature] Telescopic Baton --- .../Components/TelescopicBatonComponent.cs | 7 ++ .../Systems/TelescopicBatonSystem.cs | 58 ++++++++++++++ .../_corvaxnext/loadouts/loadoutGroups.ftl | 1 + .../conditions/steal-target-groups.ftl | 1 + .../weapons/melee/telescopic_baton.ftl | 5 ++ .../_corvaxnext/loadouts/loadoutGroups.ftl | 1 + .../conditions/steal-target-groups.ftl | 1 + .../weapons/melee/telescopic_baton.ftl | 5 ++ .../Prototypes/Loadouts/role_loadouts.yml | 7 ++ .../Objects/Weapons/telescopic_baton.yml | 72 ++++++++++++++++++ .../Miscellaneous/SelfDefenceDevices.yml | 11 +++ .../_CorvaxNext/Loadouts/loadout_groups.yml | 10 +++ .../Objectives/stealTargetGroups.yml | 6 ++ .../Melee/telescopic_baton.rsi/meta.json | 25 ++++++ .../telescopic_baton.rsi/on-inhand-left.png | Bin 0 -> 356 bytes .../telescopic_baton.rsi/on-inhand-right.png | Bin 0 -> 366 bytes .../telescopic_baton_off.png | Bin 0 -> 202 bytes .../telescopic_baton_on.png | Bin 0 -> 252 bytes 18 files changed, 210 insertions(+) create mode 100644 Content.Shared/_CorvaxNext/TelescopicBaton/Components/TelescopicBatonComponent.cs create mode 100644 Content.Shared/_CorvaxNext/TelescopicBaton/Systems/TelescopicBatonSystem.cs create mode 100644 Resources/Locale/en-US/_corvaxnext/loadouts/loadoutGroups.ftl create mode 100644 Resources/Locale/en-US/_corvaxnext/objectives/conditions/steal-target-groups.ftl create mode 100644 Resources/Locale/en-US/ss14-ru/prototypes/_corvaxnext/entities/objects/weapons/melee/telescopic_baton.ftl create mode 100644 Resources/Locale/ru-RU/_corvaxnext/loadouts/loadoutGroups.ftl create mode 100644 Resources/Locale/ru-RU/_corvaxnext/objectives/conditions/steal-target-groups.ftl create mode 100644 Resources/Locale/ru-RU/ss14-ru/prototypes/_corvaxnext/entities/objects/weapons/melee/telescopic_baton.ftl create mode 100644 Resources/Prototypes/_CorvaxNext/Entities/Objects/Weapons/telescopic_baton.yml create mode 100644 Resources/Prototypes/_CorvaxNext/Loadouts/Miscellaneous/SelfDefenceDevices.yml create mode 100644 Resources/Prototypes/_CorvaxNext/Objectives/stealTargetGroups.yml create mode 100644 Resources/Textures/_CorvaxNext/Objects/Weapons/Melee/telescopic_baton.rsi/meta.json create mode 100644 Resources/Textures/_CorvaxNext/Objects/Weapons/Melee/telescopic_baton.rsi/on-inhand-left.png create mode 100644 Resources/Textures/_CorvaxNext/Objects/Weapons/Melee/telescopic_baton.rsi/on-inhand-right.png create mode 100644 Resources/Textures/_CorvaxNext/Objects/Weapons/Melee/telescopic_baton.rsi/telescopic_baton_off.png create mode 100644 Resources/Textures/_CorvaxNext/Objects/Weapons/Melee/telescopic_baton.rsi/telescopic_baton_on.png diff --git a/Content.Shared/_CorvaxNext/TelescopicBaton/Components/TelescopicBatonComponent.cs b/Content.Shared/_CorvaxNext/TelescopicBaton/Components/TelescopicBatonComponent.cs new file mode 100644 index 00000000000..ebd672104a6 --- /dev/null +++ b/Content.Shared/_CorvaxNext/TelescopicBaton/Components/TelescopicBatonComponent.cs @@ -0,0 +1,7 @@ +namespace Content.Shared._CorvaxNext.TelescopicBaton; + +[RegisterComponent] +public sealed partial class TelescopicBatonComponent : Component +{ + +} diff --git a/Content.Shared/_CorvaxNext/TelescopicBaton/Systems/TelescopicBatonSystem.cs b/Content.Shared/_CorvaxNext/TelescopicBaton/Systems/TelescopicBatonSystem.cs new file mode 100644 index 00000000000..a124bce260b --- /dev/null +++ b/Content.Shared/_CorvaxNext/TelescopicBaton/Systems/TelescopicBatonSystem.cs @@ -0,0 +1,58 @@ +using Content.Shared.Damage.Events; +using Content.Shared.Examine; +using Content.Shared.Item; +using Content.Shared.Standing; +using Content.Shared.Item.ItemToggle; +using Content.Shared.Item.ItemToggle.Components; +using Content.Shared.Stunnable; + +namespace Content.Shared._CorvaxNext.TelescopicBaton; + +public sealed class TelescopicBatonSystem : EntitySystem +{ + [Dependency] private readonly SharedItemSystem _item = default!; + [Dependency] private readonly SharedStunSystem _stun = default!; + [Dependency] private readonly ItemToggleSystem _itemToggle = default!; + [Dependency] private readonly StandingStateSystem _standing = default!; +// [Dependency] private readonly SharedLayingDownSystem _layingDown = default!; + + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnExamined); + SubscribeLocalEvent(OnStaminaHitAttempt); + SubscribeLocalEvent(ToggleDone); + SubscribeLocalEvent(OnHit); + } + + private void OnHit(Entity ent, ref StaminaMeleeHitEvent args) + { +/* foreach (var (uid, _) in args.HitList) + { + if (TryComp(uid, out var layingDownComponent)) + { + _layingDown.TryLieDown(uid, layingDownComponent, null, DropHeldItemsBehavior.NoDrop); + } + }*/ + } + + private void OnStaminaHitAttempt(Entity entity, ref StaminaDamageOnHitAttemptEvent args) + { + if (!_itemToggle.IsActivated(entity.Owner)) + args.Cancelled = true; + } + + private void OnExamined(Entity entity, ref ExaminedEvent args) + { + var onMsg = _itemToggle.IsActivated(entity.Owner) + ? Loc.GetString("comp-telescopicbaton-examined-on") + : Loc.GetString("comp-telescopicbaton-examined-off"); + args.PushMarkup(onMsg); + } + + private void ToggleDone(Entity entity, ref ItemToggledEvent args) + { + _item.SetHeldPrefix(entity.Owner, args.Activated ? "on" : "off"); + } +} diff --git a/Resources/Locale/en-US/_corvaxnext/loadouts/loadoutGroups.ftl b/Resources/Locale/en-US/_corvaxnext/loadouts/loadoutGroups.ftl new file mode 100644 index 00000000000..116b00ca92d --- /dev/null +++ b/Resources/Locale/en-US/_corvaxnext/loadouts/loadoutGroups.ftl @@ -0,0 +1 @@ +loadout-group-self-defence-devices = Self defence devices diff --git a/Resources/Locale/en-US/_corvaxnext/objectives/conditions/steal-target-groups.ftl b/Resources/Locale/en-US/_corvaxnext/objectives/conditions/steal-target-groups.ftl new file mode 100644 index 00000000000..c94ed87464c --- /dev/null +++ b/Resources/Locale/en-US/_corvaxnext/objectives/conditions/steal-target-groups.ftl @@ -0,0 +1 @@ +steal-target-groups-telescopic-baton = telescopic baton diff --git a/Resources/Locale/en-US/ss14-ru/prototypes/_corvaxnext/entities/objects/weapons/melee/telescopic_baton.ftl b/Resources/Locale/en-US/ss14-ru/prototypes/_corvaxnext/entities/objects/weapons/melee/telescopic_baton.ftl new file mode 100644 index 00000000000..dea0ffc26a4 --- /dev/null +++ b/Resources/Locale/en-US/ss14-ru/prototypes/_corvaxnext/entities/objects/weapons/melee/telescopic_baton.ftl @@ -0,0 +1,5 @@ +ent-TelescopicBaton = telescopic baton + .desc = A compact yet reliable personal defense weapon. + +comp-telescopicbaton-examined-on = The baton is extended. +comp-telescopicbaton-examined-off = The baton is collapsed. diff --git a/Resources/Locale/ru-RU/_corvaxnext/loadouts/loadoutGroups.ftl b/Resources/Locale/ru-RU/_corvaxnext/loadouts/loadoutGroups.ftl new file mode 100644 index 00000000000..472ecb35ed2 --- /dev/null +++ b/Resources/Locale/ru-RU/_corvaxnext/loadouts/loadoutGroups.ftl @@ -0,0 +1 @@ +loadout-group-self-defence-devices = Средства самообороны diff --git a/Resources/Locale/ru-RU/_corvaxnext/objectives/conditions/steal-target-groups.ftl b/Resources/Locale/ru-RU/_corvaxnext/objectives/conditions/steal-target-groups.ftl new file mode 100644 index 00000000000..66a50be32de --- /dev/null +++ b/Resources/Locale/ru-RU/_corvaxnext/objectives/conditions/steal-target-groups.ftl @@ -0,0 +1 @@ +steal-target-groups-telescopic-baton = телескопическая дубинка diff --git a/Resources/Locale/ru-RU/ss14-ru/prototypes/_corvaxnext/entities/objects/weapons/melee/telescopic_baton.ftl b/Resources/Locale/ru-RU/ss14-ru/prototypes/_corvaxnext/entities/objects/weapons/melee/telescopic_baton.ftl new file mode 100644 index 00000000000..1bce1d59f35 --- /dev/null +++ b/Resources/Locale/ru-RU/ss14-ru/prototypes/_corvaxnext/entities/objects/weapons/melee/telescopic_baton.ftl @@ -0,0 +1,5 @@ +ent-TelescopicBaton = телескопическая дубинка + .desc = Компактное, но надежное оружие личной обороны. + +comp-telescopicbaton-examined-on = Дубинка разложена. +comp-telescopicbaton-examined-off = Дубинка сложена. diff --git a/Resources/Prototypes/Loadouts/role_loadouts.yml b/Resources/Prototypes/Loadouts/role_loadouts.yml index 941d42276a8..aef4e488be0 100644 --- a/Resources/Prototypes/Loadouts/role_loadouts.yml +++ b/Resources/Prototypes/Loadouts/role_loadouts.yml @@ -9,6 +9,7 @@ - CaptainBackpack - CaptainOuterClothing - Survival + - SelfDefenceDevices # Corvax-Next-TelescopicBaton - Trinkets - GroupSpeciesBreathTool @@ -24,6 +25,7 @@ - HoPOuterClothing - Glasses - Survival + - SelfDefenceDevices # Corvax-Next-TelescopicBaton - Trinkets - GroupSpeciesBreathTool @@ -219,6 +221,7 @@ - QuartermasterShoes - Glasses - Survival + - SelfDefenceDevices # Corvax-Next-TelescopicBaton - Trinkets - GroupSpeciesBreathTool @@ -263,6 +266,7 @@ - ChiefEngineerOuterClothing - ChiefEngineerShoes - SurvivalExtended + - SelfDefenceDevices # Corvax-Next-TelescopicBaton - Trinkets - GroupSpeciesBreathTool @@ -320,6 +324,7 @@ - ResearchDirectorShoes - Glasses - Survival + - SelfDefenceDevices # Corvax-Next-TelescopicBaton - Trinkets - GroupSpeciesBreathTool @@ -366,6 +371,7 @@ - HeadofSecurityOuterClothing - SecurityShoes - SurvivalSecurity + - SelfDefenceDevices # Corvax-Next-TelescopicBaton - Trinkets - SecurityStar - GroupSpeciesBreathToolSecurity @@ -443,6 +449,7 @@ - ChiefMedicalOfficerShoes - Glasses - SurvivalMedical + - SelfDefenceDevices # Corvax-Next-TelescopicBaton - Trinkets - GroupSpeciesBreathToolMedical diff --git a/Resources/Prototypes/_CorvaxNext/Entities/Objects/Weapons/telescopic_baton.yml b/Resources/Prototypes/_CorvaxNext/Entities/Objects/Weapons/telescopic_baton.yml new file mode 100644 index 00000000000..0baae3dab24 --- /dev/null +++ b/Resources/Prototypes/_CorvaxNext/Entities/Objects/Weapons/telescopic_baton.yml @@ -0,0 +1,72 @@ +- type: entity + parent: BaseItem + id: TelescopicBaton + name: telescopic baton + description: A compact yet robust personal defense weapon. + components: + - type: TelescopicBaton + - type: Sprite + sprite: _CorvaxNext/Objects/Weapons/Melee/telescopic_baton.rsi + layers: + - state: telescopic_baton_off + map: [ "enum.ToggleVisuals.Layer" ] + - type: ItemToggleSize + activatedSize: Large + activatedShape: + - 0, 0, 3, 0 + - type: ItemToggle + soundActivate: + path: /Audio/Weapons/telescopicon.ogg + params: + volume: -5 + soundDeactivate: + path: /Audio/Weapons/telescopicoff.ogg + params: + volume: -5 + - type: Appearance + - type: GenericVisualizer + visuals: + enum.ToggleVisuals.Toggled: + enum.ToggleVisuals.Layer: + True: {state: telescopic_baton_on} + False: {state: telescopic_baton_off} + - type: ToggleableLightVisuals + spriteLayer: blade + inhandVisuals: + left: + - state: on-inhand-left + right: + - state: on-inhand-right + - type: DisarmMalus + malus: 0.225 + - type: MeleeWeapon + angle: 0 + attackRate: 1.2 + wideAnimationRotation: -135 + damage: + types: + Blunt: 0 + bluntStaminaDamageFactor: 0.0 + - type: ItemToggleMeleeWeapon + activatedDamage: + types: + Blunt: 1.5 + deactivatedSecret: true + - type: StaminaDamageOnHit + damage: 16 + sound: /Audio/Weapons/boxingpunch1.ogg + - type: UseDelay + delay: 0.4 + - type: Item + heldPrefix: on- + sprite: _CorvaxNext/Objects/Weapons/Melee/telescopic_baton.rsi + size: Small + storedRotation: 44 + shape: + - 0, 0, 1, 0 + - type: Clothing + quickEquip: false + slots: + - Belt + - type: StaticPrice + price: 350 diff --git a/Resources/Prototypes/_CorvaxNext/Loadouts/Miscellaneous/SelfDefenceDevices.yml b/Resources/Prototypes/_CorvaxNext/Loadouts/Miscellaneous/SelfDefenceDevices.yml new file mode 100644 index 00000000000..d44ef5350aa --- /dev/null +++ b/Resources/Prototypes/_CorvaxNext/Loadouts/Miscellaneous/SelfDefenceDevices.yml @@ -0,0 +1,11 @@ +- type: loadout + id: TelescopicBaton + storage: + back: + - TelescopicBaton + +- type: loadout + id: Flash + storage: + back: + - Flash diff --git a/Resources/Prototypes/_CorvaxNext/Loadouts/loadout_groups.yml b/Resources/Prototypes/_CorvaxNext/Loadouts/loadout_groups.yml index 763b748ba16..0489b0a0bf9 100644 --- a/Resources/Prototypes/_CorvaxNext/Loadouts/loadout_groups.yml +++ b/Resources/Prototypes/_CorvaxNext/Loadouts/loadout_groups.yml @@ -1,3 +1,13 @@ +# Command +- type: loadoutGroup + id: SelfDefenceDevices + name: loadout-group-self-defence-devices + minLimit: 1 + maxLimit: 2 + loadouts: + - TelescopicBaton + - Flash + # Security - type: loadoutGroup id: BrigmedicHead diff --git a/Resources/Prototypes/_CorvaxNext/Objectives/stealTargetGroups.yml b/Resources/Prototypes/_CorvaxNext/Objectives/stealTargetGroups.yml new file mode 100644 index 00000000000..221c092a837 --- /dev/null +++ b/Resources/Prototypes/_CorvaxNext/Objectives/stealTargetGroups.yml @@ -0,0 +1,6 @@ +- type: stealTargetGroup + id: TelescopicBaton + name: steal-target-groups-telescopic-baton + sprite: + sprite: _CorvaxNext/Objects/Weapons/Melee/telescopic_baton.rsi + state: telescopic_baton_on diff --git a/Resources/Textures/_CorvaxNext/Objects/Weapons/Melee/telescopic_baton.rsi/meta.json b/Resources/Textures/_CorvaxNext/Objects/Weapons/Melee/telescopic_baton.rsi/meta.json new file mode 100644 index 00000000000..0161ab51450 --- /dev/null +++ b/Resources/Textures/_CorvaxNext/Objects/Weapons/Melee/telescopic_baton.rsi/meta.json @@ -0,0 +1,25 @@ +{ + "version": 1, + "license": "CC-BY-SA-3.0", + "copyright": "Taken from tgstation at commit https://github.com/tgstation/tgstation/commit/4397d63a55dac7d0536eb9bcc0a0f68634858c50 | Edited by PuroSlavKing (Github)", + "size": { + "x": 32, + "y": 32 + }, + "states": [ + { + "name": "telescopic_baton_off" + }, + { + "name": "telescopic_baton_on" + }, + { + "name": "on-inhand-left", + "directions": 4 + }, + { + "name": "on-inhand-right", + "directions": 4 + } + ] +} diff --git a/Resources/Textures/_CorvaxNext/Objects/Weapons/Melee/telescopic_baton.rsi/on-inhand-left.png b/Resources/Textures/_CorvaxNext/Objects/Weapons/Melee/telescopic_baton.rsi/on-inhand-left.png new file mode 100644 index 0000000000000000000000000000000000000000..6f31eafd0f405cabfbe5d79e8141dd4c9346f07c GIT binary patch literal 356 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=oCO|{#S9F5M?jcysy3fA0|TR& zr;B4q#hkad4)QiR2(&&-PvR|cWDju^4{;F>aWpmAxT}36;hSFk_;vX8-*Jm&tkg_}F;=!K4FQ2NogeheX v=Z>IbRx25%F5kWBQ!&F4V|yn9mV0pMxekfjjN96h5hL@x4`i?}*D{q4&u; zYF~Iiu`pnu4K)|Gt)0D$^RdOgfCS&mJ65eS;5l5rPqe}IV(Hx3?{{4i$oa8r-No;J zv)0X@->`RqNz2}cYtNc4P-$8GaP3{!4J<92AFe&Txnb``F*oagJdV19)>8MZYG-oeq*}Czp+)ZA^haD@lN%xq|4vf2 zVd}8mqpx;Inc=s=XI{;&t>KERFDLZu<%(oH;=!QckA&Vc3%-~j(LKpV9~giPp00i_ I>zopr00+yDK>z>% literal 0 HcmV?d00001 diff --git a/Resources/Textures/_CorvaxNext/Objects/Weapons/Melee/telescopic_baton.rsi/telescopic_baton_off.png b/Resources/Textures/_CorvaxNext/Objects/Weapons/Melee/telescopic_baton.rsi/telescopic_baton_off.png new file mode 100644 index 0000000000000000000000000000000000000000..94fa196825e6f970236d351ee257e8e9b149ba80 GIT binary patch literal 202 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}EuJopArY-_ zuWS@#R^(whuz7K|v!v>Ti(RLFeTZJjd`fY$aoH!{}1yks1;=X_$06J zv+}umgCX0qIsMvV5lWTOZ%?n@=bXPc=81S*BwL93gT1?70Numj>FVdQ&MBb@0E+2P AIsgCw literal 0 HcmV?d00001 diff --git a/Resources/Textures/_CorvaxNext/Objects/Weapons/Melee/telescopic_baton.rsi/telescopic_baton_on.png b/Resources/Textures/_CorvaxNext/Objects/Weapons/Melee/telescopic_baton.rsi/telescopic_baton_on.png new file mode 100644 index 0000000000000000000000000000000000000000..979d70e28af0081b8d8e155807d4b297d2fa8f60 GIT binary patch literal 252 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}+dN$yLn2z= zUNz)9tiZ#1;lAHK$4M8Z-9H=)wfQ#dj*@ip6zL5+g+q-)6(@yi{u6dOz}(0qurt`@ zNXXTFzvs=X@Zwx5qW`I5^(w>7f8}H=9yGGong1~~>YSN7OYO_8xNO-dc8MQ7zcPcp zBCdZGs;go?lVh3A;GoI+dtdy<^Q|-Ozw0WwxzzRReK>IUV`Rd5w)#08KB2i{H*^XP z@`v_x Date: Sun, 15 Dec 2024 15:39:51 +0300 Subject: [PATCH 2/6] laydown --- .../TelescopicBaton/Systems/TelescopicBatonSystem.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Content.Shared/_CorvaxNext/TelescopicBaton/Systems/TelescopicBatonSystem.cs b/Content.Shared/_CorvaxNext/TelescopicBaton/Systems/TelescopicBatonSystem.cs index a124bce260b..cdb807ecc32 100644 --- a/Content.Shared/_CorvaxNext/TelescopicBaton/Systems/TelescopicBatonSystem.cs +++ b/Content.Shared/_CorvaxNext/TelescopicBaton/Systems/TelescopicBatonSystem.cs @@ -14,7 +14,7 @@ public sealed class TelescopicBatonSystem : EntitySystem [Dependency] private readonly SharedStunSystem _stun = default!; [Dependency] private readonly ItemToggleSystem _itemToggle = default!; [Dependency] private readonly StandingStateSystem _standing = default!; -// [Dependency] private readonly SharedLayingDownSystem _layingDown = default!; + [Dependency] private readonly SharedLayingDownSystem _layingDown = default!; public override void Initialize() { @@ -28,13 +28,13 @@ public override void Initialize() private void OnHit(Entity ent, ref StaminaMeleeHitEvent args) { -/* foreach (var (uid, _) in args.HitList) + foreach (var (uid, _) in args.HitList) { if (TryComp(uid, out var layingDownComponent)) { _layingDown.TryLieDown(uid, layingDownComponent, null, DropHeldItemsBehavior.NoDrop); } - }*/ + } } private void OnStaminaHitAttempt(Entity entity, ref StaminaDamageOnHitAttemptEvent args) From eeb127affde6844241367d6e1b20175516295a0f Mon Sep 17 00:00:00 2001 From: PuroSlavKing <103608145+PuroSlavKing@users.noreply.github.com> Date: Sun, 15 Dec 2024 15:45:03 +0300 Subject: [PATCH 3/6] fix tgroups --- .../Prototypes/_CorvaxNext/Objectives/stealTargetGroups.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/Resources/Prototypes/_CorvaxNext/Objectives/stealTargetGroups.yml b/Resources/Prototypes/_CorvaxNext/Objectives/stealTargetGroups.yml index 4f0fbb4ef9b..80197338eda 100644 --- a/Resources/Prototypes/_CorvaxNext/Objectives/stealTargetGroups.yml +++ b/Resources/Prototypes/_CorvaxNext/Objectives/stealTargetGroups.yml @@ -5,6 +5,7 @@ sprite: _CorvaxNext/Objects/Weapons/Melee/telescopic_baton.rsi state: telescopic_baton_on +- type: stealTargetGroup id: ClothingNeckSecBadge name: steal-target-groups-security-badge sprite: From 33692ed5a41d515db0a09869b7f4b71656836c4b Mon Sep 17 00:00:00 2001 From: PuroSlavKing <103608145+PuroSlavKing@users.noreply.github.com> Date: Sun, 15 Dec 2024 15:57:14 +0300 Subject: [PATCH 4/6] add missing using --- .../_CorvaxNext/TelescopicBaton/Systems/TelescopicBatonSystem.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Content.Shared/_CorvaxNext/TelescopicBaton/Systems/TelescopicBatonSystem.cs b/Content.Shared/_CorvaxNext/TelescopicBaton/Systems/TelescopicBatonSystem.cs index cdb807ecc32..66110fae2d2 100644 --- a/Content.Shared/_CorvaxNext/TelescopicBaton/Systems/TelescopicBatonSystem.cs +++ b/Content.Shared/_CorvaxNext/TelescopicBaton/Systems/TelescopicBatonSystem.cs @@ -5,6 +5,7 @@ using Content.Shared.Item.ItemToggle; using Content.Shared.Item.ItemToggle.Components; using Content.Shared.Stunnable; +using Content.Shared._CorvaxNext.Standing; namespace Content.Shared._CorvaxNext.TelescopicBaton; From ac5fafe9ff5109614d20a4e33252eb2dda5a2fea Mon Sep 17 00:00:00 2001 From: PuroSlavKing <103608145+PuroSlavKing@users.noreply.github.com> Date: Thu, 26 Dec 2024 19:19:22 +0300 Subject: [PATCH 5/6] Rename2LayOnMeleeHit --- .../Components/LayOnMeleeHitComponent.cs | 7 ++++++ .../Systems/LayOnMeleeHitSystem.cs} | 24 +++++++++---------- .../Components/TelescopicBatonComponent.cs | 7 ------ .../Objects/Weapons/telescopic_baton.yml | 2 +- 4 files changed, 20 insertions(+), 20 deletions(-) create mode 100644 Content.Shared/_CorvaxNext/LayOnMeleeHit/Components/LayOnMeleeHitComponent.cs rename Content.Shared/_CorvaxNext/{TelescopicBaton/Systems/TelescopicBatonSystem.cs => LayOnMeleeHit/Systems/LayOnMeleeHitSystem.cs} (56%) delete mode 100644 Content.Shared/_CorvaxNext/TelescopicBaton/Components/TelescopicBatonComponent.cs diff --git a/Content.Shared/_CorvaxNext/LayOnMeleeHit/Components/LayOnMeleeHitComponent.cs b/Content.Shared/_CorvaxNext/LayOnMeleeHit/Components/LayOnMeleeHitComponent.cs new file mode 100644 index 00000000000..37d5ba6e71e --- /dev/null +++ b/Content.Shared/_CorvaxNext/LayOnMeleeHit/Components/LayOnMeleeHitComponent.cs @@ -0,0 +1,7 @@ +namespace Content.Shared._CorvaxNext.LayOnMeleeHit; + +[RegisterComponent] +public sealed partial class LayOnMeleeHitComponent : Component +{ + +} diff --git a/Content.Shared/_CorvaxNext/TelescopicBaton/Systems/TelescopicBatonSystem.cs b/Content.Shared/_CorvaxNext/LayOnMeleeHit/Systems/LayOnMeleeHitSystem.cs similarity index 56% rename from Content.Shared/_CorvaxNext/TelescopicBaton/Systems/TelescopicBatonSystem.cs rename to Content.Shared/_CorvaxNext/LayOnMeleeHit/Systems/LayOnMeleeHitSystem.cs index 66110fae2d2..308f430f57e 100644 --- a/Content.Shared/_CorvaxNext/TelescopicBaton/Systems/TelescopicBatonSystem.cs +++ b/Content.Shared/_CorvaxNext/LayOnMeleeHit/Systems/LayOnMeleeHitSystem.cs @@ -7,9 +7,9 @@ using Content.Shared.Stunnable; using Content.Shared._CorvaxNext.Standing; -namespace Content.Shared._CorvaxNext.TelescopicBaton; +namespace Content.Shared._CorvaxNext.LayOnMeleeHit; -public sealed class TelescopicBatonSystem : EntitySystem +public sealed class LayOnMeleeHitSystem : EntitySystem { [Dependency] private readonly SharedItemSystem _item = default!; [Dependency] private readonly SharedStunSystem _stun = default!; @@ -21,13 +21,13 @@ public override void Initialize() { base.Initialize(); - SubscribeLocalEvent(OnExamined); - SubscribeLocalEvent(OnStaminaHitAttempt); - SubscribeLocalEvent(ToggleDone); - SubscribeLocalEvent(OnHit); + SubscribeLocalEvent(OnExamined); + SubscribeLocalEvent(OnStaminaHitAttempt); + SubscribeLocalEvent(ToggleDone); + SubscribeLocalEvent(OnHit); } - private void OnHit(Entity ent, ref StaminaMeleeHitEvent args) + private void OnHit(Entity ent, ref StaminaMeleeHitEvent args) { foreach (var (uid, _) in args.HitList) { @@ -38,21 +38,21 @@ private void OnHit(Entity ent, ref StaminaMeleeHitEven } } - private void OnStaminaHitAttempt(Entity entity, ref StaminaDamageOnHitAttemptEvent args) + private void OnStaminaHitAttempt(Entity entity, ref StaminaDamageOnHitAttemptEvent args) { if (!_itemToggle.IsActivated(entity.Owner)) args.Cancelled = true; } - private void OnExamined(Entity entity, ref ExaminedEvent args) + private void OnExamined(Entity entity, ref ExaminedEvent args) { var onMsg = _itemToggle.IsActivated(entity.Owner) - ? Loc.GetString("comp-telescopicbaton-examined-on") - : Loc.GetString("comp-telescopicbaton-examined-off"); + ? Loc.GetString("comp-LayOnMeleeHit-examined-on") + : Loc.GetString("comp-LayOnMeleeHit-examined-off"); args.PushMarkup(onMsg); } - private void ToggleDone(Entity entity, ref ItemToggledEvent args) + private void ToggleDone(Entity entity, ref ItemToggledEvent args) { _item.SetHeldPrefix(entity.Owner, args.Activated ? "on" : "off"); } diff --git a/Content.Shared/_CorvaxNext/TelescopicBaton/Components/TelescopicBatonComponent.cs b/Content.Shared/_CorvaxNext/TelescopicBaton/Components/TelescopicBatonComponent.cs deleted file mode 100644 index ebd672104a6..00000000000 --- a/Content.Shared/_CorvaxNext/TelescopicBaton/Components/TelescopicBatonComponent.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Content.Shared._CorvaxNext.TelescopicBaton; - -[RegisterComponent] -public sealed partial class TelescopicBatonComponent : Component -{ - -} diff --git a/Resources/Prototypes/_CorvaxNext/Entities/Objects/Weapons/telescopic_baton.yml b/Resources/Prototypes/_CorvaxNext/Entities/Objects/Weapons/telescopic_baton.yml index 0baae3dab24..051245b92ea 100644 --- a/Resources/Prototypes/_CorvaxNext/Entities/Objects/Weapons/telescopic_baton.yml +++ b/Resources/Prototypes/_CorvaxNext/Entities/Objects/Weapons/telescopic_baton.yml @@ -4,7 +4,7 @@ name: telescopic baton description: A compact yet robust personal defense weapon. components: - - type: TelescopicBaton + - type: LayOnMeleeHit - type: Sprite sprite: _CorvaxNext/Objects/Weapons/Melee/telescopic_baton.rsi layers: From f7de95b38160dba73b13ed0757e3bb009d75dca8 Mon Sep 17 00:00:00 2001 From: PuroSlavKing <103608145+PuroSlavKing@users.noreply.github.com> Date: Thu, 26 Dec 2024 19:22:58 +0300 Subject: [PATCH 6/6] fix string --- .../_CorvaxNext/LayOnMeleeHit/Systems/LayOnMeleeHitSystem.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Content.Shared/_CorvaxNext/LayOnMeleeHit/Systems/LayOnMeleeHitSystem.cs b/Content.Shared/_CorvaxNext/LayOnMeleeHit/Systems/LayOnMeleeHitSystem.cs index 308f430f57e..13e219b7e8b 100644 --- a/Content.Shared/_CorvaxNext/LayOnMeleeHit/Systems/LayOnMeleeHitSystem.cs +++ b/Content.Shared/_CorvaxNext/LayOnMeleeHit/Systems/LayOnMeleeHitSystem.cs @@ -47,8 +47,8 @@ private void OnStaminaHitAttempt(Entity entity, ref Stam private void OnExamined(Entity entity, ref ExaminedEvent args) { var onMsg = _itemToggle.IsActivated(entity.Owner) - ? Loc.GetString("comp-LayOnMeleeHit-examined-on") - : Loc.GetString("comp-LayOnMeleeHit-examined-off"); + ? Loc.GetString("comp-telescopicbaton-examined-on") + : Loc.GetString("comp-telescopicbaton-examined-off"); args.PushMarkup(onMsg); }