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 00000000000..6f31eafd0f4 Binary files /dev/null and b/Resources/Textures/_CorvaxNext/Objects/Weapons/Melee/telescopic_baton.rsi/on-inhand-left.png differ diff --git a/Resources/Textures/_CorvaxNext/Objects/Weapons/Melee/telescopic_baton.rsi/on-inhand-right.png b/Resources/Textures/_CorvaxNext/Objects/Weapons/Melee/telescopic_baton.rsi/on-inhand-right.png new file mode 100644 index 00000000000..3ff76ef4daa Binary files /dev/null and b/Resources/Textures/_CorvaxNext/Objects/Weapons/Melee/telescopic_baton.rsi/on-inhand-right.png differ 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 00000000000..94fa196825e Binary files /dev/null and b/Resources/Textures/_CorvaxNext/Objects/Weapons/Melee/telescopic_baton.rsi/telescopic_baton_off.png differ 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 00000000000..979d70e28af Binary files /dev/null and b/Resources/Textures/_CorvaxNext/Objects/Weapons/Melee/telescopic_baton.rsi/telescopic_baton_on.png differ