From e147c02db3763596ba9673a1823a45a0356bf8db Mon Sep 17 00:00:00 2001 From: Spatison <137375981+Spatison@users.noreply.github.com> Date: Fri, 26 Jul 2024 16:53:25 +0300 Subject: [PATCH] =?UTF-8?q?add:=20=D0=A2=D0=B5=D0=BF=D0=B5=D1=80=D1=8C=20?= =?UTF-8?q?=D1=81=D0=BD=D1=8F=D1=80=D1=8F=D0=B4=D1=8B=20=D0=B4=D0=BB=D1=8F?= =?UTF-8?q?=20=D0=A1=D0=B8=D0=BD=D0=B0=D0=BD=D0=BE=20=D0=BC=D0=BE=D0=B6?= =?UTF-8?q?=D0=BD=D0=BE=20=D0=BF=D0=B5=D1=87=D0=B0=D1=82=D0=B0=D1=82=D1=8C?= =?UTF-8?q?=20(#499)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WeaponModules/WeaponModulesSystem.cs | 35 ++++++++++++++++++- .../WeaponModules/ShutterModuleComponent.cs | 8 +++++ .../WeaponModules/WeaponModulesComponent.cs | 3 +- .../Locale/ru-RU/_white/weapon-module.ftl | 2 ++ .../weapons/guns/ammunition/boxes/shinano.ftl | 8 ++--- .../ammunition/cartridges/shinanogrenade.ftl | 10 +++--- .../Entities/Structures/Machines/lathe.yml | 6 ++++ Resources/Prototypes/Research/arsenal.yml | 3 ++ .../Objects/Weapons/Guns/Modules/modules.yml | 28 +++++++++++++++ .../Entities/Objects/Weapons/Guns/shinano.yml | 15 ++++++++ .../_White/Recipes/lathe_recipes.yml | 34 ++++++++++++++++++ Resources/Prototypes/_White/tags.yml | 3 ++ 12 files changed, 144 insertions(+), 11 deletions(-) create mode 100644 Content.Shared/_White/WeaponModules/ShutterModuleComponent.cs create mode 100644 Resources/Locale/ru-RU/_white/weapon-module.ftl diff --git a/Content.Server/_White/WeaponModules/WeaponModulesSystem.cs b/Content.Server/_White/WeaponModules/WeaponModulesSystem.cs index 0540f54f80..db0fe124ad 100644 --- a/Content.Server/_White/WeaponModules/WeaponModulesSystem.cs +++ b/Content.Server/_White/WeaponModules/WeaponModulesSystem.cs @@ -12,7 +12,7 @@ public sealed class WeaponModulesSystem : EntitySystem { protected static readonly Dictionary Slots = new() { - { "handguard_module", ModuleVisualState.HandGuardModule }, { "barrel_module", ModuleVisualState.BarrelModule }, { "aim_module", ModuleVisualState.AimModule } + { "handguard_module", ModuleVisualState.HandGuardModule }, { "barrel_module", ModuleVisualState.BarrelModule }, { "aim_module", ModuleVisualState.AimModule }, { "shutter_module", ModuleVisualState.ShutterModule } }; [Dependency] private readonly PointLightSystem _lightSystem = default!; @@ -40,6 +40,9 @@ public sealed class WeaponModulesSystem : EntitySystem SubscribeLocalEvent(EightAimModuleOnInsert); SubscribeLocalEvent(EightAimModuleOnEject); + + SubscribeLocalEvent(ShutterModuleOnInsert); + SubscribeLocalEvent(ShutterModuleOnEject); } private bool TryInsertModule(EntityUid module, EntityUid weapon, BaseModuleComponent component, @@ -170,6 +173,22 @@ public sealed class WeaponModulesSystem : EntitySystem EnsureComp(weapon).Divisor = component.Divisor; } + + private void ShutterModuleOnInsert(EntityUid module, ShutterModuleComponent component, EntGotInsertedIntoContainerMessage args) + { + EntityUid weapon = args.Container.Owner; + + if (!TryComp(weapon, out var gunComp)) return; + + if(!TryInsertModule(module, weapon, component, args.Container.ID, out var weaponModulesComponent)) + return; + + if (!TryComp(weapon, out var ballisticAmmo)) + return; + + ballisticAmmo.Whitelist?.Tags?.Add(component.Tag); + Dirty(weapon, ballisticAmmo); + } #endregion #region EjectModules @@ -239,5 +258,19 @@ public sealed class WeaponModulesSystem : EntitySystem RemComp(weapon); } + + private void ShutterModuleOnEject(EntityUid module, ShutterModuleComponent component, EntGotRemovedFromContainerMessage args) + { + EntityUid weapon = args.Container.Owner; + + if(!TryEjectModule(module, weapon, args.Container.ID, out var weaponModulesComponent)) + return; + + if (!TryComp(weapon, out var ballisticAmmo)) + return; + + ballisticAmmo.Whitelist?.Tags?.Remove(component.Tag); + Dirty(weapon, ballisticAmmo); + } #endregion } diff --git a/Content.Shared/_White/WeaponModules/ShutterModuleComponent.cs b/Content.Shared/_White/WeaponModules/ShutterModuleComponent.cs new file mode 100644 index 0000000000..a01f63c958 --- /dev/null +++ b/Content.Shared/_White/WeaponModules/ShutterModuleComponent.cs @@ -0,0 +1,8 @@ +namespace Content.Shared._White.WeaponModules; + +[RegisterComponent] +public sealed partial class ShutterModuleComponent : BaseModuleComponent +{ + [ViewVariables(VVAccess.ReadWrite), DataField] + public string Tag; +} diff --git a/Content.Shared/_White/WeaponModules/WeaponModulesComponent.cs b/Content.Shared/_White/WeaponModules/WeaponModulesComponent.cs index 2db828cf4a..65d086e7a7 100644 --- a/Content.Shared/_White/WeaponModules/WeaponModulesComponent.cs +++ b/Content.Shared/_White/WeaponModules/WeaponModulesComponent.cs @@ -21,7 +21,8 @@ public enum ModuleVisualState : byte { BarrelModule, HandGuardModule, - AimModule + AimModule, + ShutterModule } [Serializable, NetSerializable] diff --git a/Resources/Locale/ru-RU/_white/weapon-module.ftl b/Resources/Locale/ru-RU/_white/weapon-module.ftl new file mode 100644 index 0000000000..f621874e56 --- /dev/null +++ b/Resources/Locale/ru-RU/_white/weapon-module.ftl @@ -0,0 +1,2 @@ +ent-ShinanoShutterModule = модифицированный затвор Синано + .desc = Нелегальная модификация для TS430 Shinano, произведенная одним из подрядчиков Синдиката. Позволяет использовать широкий спектр гранатных боеприпасов, что стоят на вооружении Синдиката. \ No newline at end of file diff --git a/Resources/Locale/ru-RU/ss14-ru/prototypes/white/entities/objects/weapons/guns/ammunition/boxes/shinano.ftl b/Resources/Locale/ru-RU/ss14-ru/prototypes/white/entities/objects/weapons/guns/ammunition/boxes/shinano.ftl index 7e3b79a1e8..d67294873a 100644 --- a/Resources/Locale/ru-RU/ss14-ru/prototypes/white/entities/objects/weapons/guns/ammunition/boxes/shinano.ftl +++ b/Resources/Locale/ru-RU/ss14-ru/prototypes/white/entities/objects/weapons/guns/ammunition/boxes/shinano.ftl @@ -1,10 +1,10 @@ ent-BaseShinanoGrenadeAmmoProvider = { ent-BaseAmmoProvider } .desc = { ent-BaseAmmoProvider.desc } -ent-BoxShinanoGrenadeFlash = коробка светошумовых гранат (40мм) +ent-BoxShinanoGrenadeFlash = коробка светошумовых гранат SHN .desc = Заставь их плакать. -ent-BoxShinanoGrenadeSmoke = коробка слезоточивых гранат (40мм) +ent-BoxShinanoGrenadeSmoke = коробка слезоточивых гранат SHN .desc = Заставь их плакать. -ent-BoxShinanoGrenadeStinger = коробка травматических гранат (40мм) +ent-BoxShinanoGrenadeStinger = коробка травматических гранат SHN .desc = Это точно никого не убьет? -ent-BoxShinanoGrenadeBeanbag = коробка травматических пуль (40мм) +ent-BoxShinanoGrenadeBeanbag = коробка травматических пуль SHN .desc = Это точно никого не убьет? \ No newline at end of file diff --git a/Resources/Locale/ru-RU/ss14-ru/prototypes/white/entities/objects/weapons/guns/ammunition/cartridges/shinanogrenade.ftl b/Resources/Locale/ru-RU/ss14-ru/prototypes/white/entities/objects/weapons/guns/ammunition/cartridges/shinanogrenade.ftl index e9d15796f4..382333b4f9 100644 --- a/Resources/Locale/ru-RU/ss14-ru/prototypes/white/entities/objects/weapons/guns/ammunition/cartridges/shinanogrenade.ftl +++ b/Resources/Locale/ru-RU/ss14-ru/prototypes/white/entities/objects/weapons/guns/ammunition/cartridges/shinanogrenade.ftl @@ -1,10 +1,10 @@ -ent-BaseShinanoGrenade = граната (40мм) +ent-BaseShinanoGrenade = граната SHN .desc = { ent-BaseCartridge.desc } -ent-ShinanoGrenadeFlash = светошумовая граната (40мм) +ent-ShinanoGrenadeFlash = светошумовая граната SHN .desc = { ent-BaseShinanoGrenade.desc } -ent-ShinanoGrenadeSmoke = слезоточивая граната (40мм) +ent-ShinanoGrenadeSmoke = слезоточивая граната SHN .desc = { ent-BaseShinanoGrenade.desc } -ent-ShinanoGrenadeStinger = травматическая граната (40мм) +ent-ShinanoGrenadeStinger = травматическая граната SHN .desc = { ent-BaseShinanoGrenade.desc } -ent-ShinanoGrenadeBeanbag = травматическая пуля (40мм) +ent-ShinanoGrenadeBeanbag = травматическая пуля SHN .desc = { ent-BaseShinanoGrenade.desc } \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml index f3c5fe87c5..884e351494 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml @@ -200,6 +200,7 @@ - FlameHiderModuleRecipe - SilencerModuleRecipe - AcceleratorModuleRecipe + - ShinanoGrenadeBeanbagRecipe emagDynamicRecipes: - CartridgePistolRubber - CartridgeMagnumRubber @@ -372,6 +373,7 @@ - MagazineGrenadeEmpty - GrenadeEMP - GrenadeFlash + - ShinanoGrenadeBeanbagRecipe - type: BluespaceStorage - type: entity @@ -734,6 +736,7 @@ - FlameHiderModuleRecipe - SilencerModuleRecipe - AcceleratorModuleRecipe + - ShinanoGrenadeBeanbagRecipe dynamicRecipes: - CartridgeLightRifleIncendiary - CartridgeMagnumIncendiary @@ -790,6 +793,9 @@ - ShuttleGunDusterCircuitboard - ClothingHandsGlovesMagnetic - ClothingHandsGlovesMagneticAdvanced + - ShinanoGrenadeFlashRecipe + - ShinanoGrenadeSmokeRecipe + - ShinanoGrenadeStingerRecipe - type: EmagLatheRecipes emagStaticRecipes: - MagazineLightRifleBox diff --git a/Resources/Prototypes/Research/arsenal.yml b/Resources/Prototypes/Research/arsenal.yml index 3e61d00c66..e16365c727 100644 --- a/Resources/Prototypes/Research/arsenal.yml +++ b/Resources/Prototypes/Research/arsenal.yml @@ -65,6 +65,9 @@ - MagazineBoxMagnumRubber - MagazineBoxLightRifleRubber - MagazineBoxRifleRubber + - ShinanoGrenadeFlashRecipe + - ShinanoGrenadeSmokeRecipe + - ShinanoGrenadeStingerRecipe - type: technology id: UraniumMunitions diff --git a/Resources/Prototypes/_White/Entities/Objects/Weapons/Guns/Modules/modules.yml b/Resources/Prototypes/_White/Entities/Objects/Weapons/Guns/Modules/modules.yml index 7dd9e0f941..97414b17cc 100644 --- a/Resources/Prototypes/_White/Entities/Objects/Weapons/Guns/Modules/modules.yml +++ b/Resources/Prototypes/_White/Entities/Objects/Weapons/Guns/Modules/modules.yml @@ -49,6 +49,23 @@ - 0,0,0,0 - type: Appearance +- type: entity + parent: BaseItem + id: BaseShutterModule + abstract: true + components: + - type: Sprite + sprite: White/Objects/Weapons/modules.rsi + - type: Tag + tags: + - BaseShutterModule + - type: Item + sprite: White/Objects/Weapons/modules.rsi + size: Small + shape: + - 0,0,0,0 + - type: Appearance + # modules - type: entity parent: BaseHandGuardModule @@ -127,3 +144,14 @@ - type: Sprite state: eightaim - type: Appearance + +- type: entity + parent: BaseShutterModule + id: ShinanoShutterModule + name: "modified Shinano shutter" + description: An illegal modification for the TS430 Shinano made by one of the Syndicate's contractors. It allows the use of a wide range of grenade ammunition that are in service with the Syndicate. + components: + - type: ShutterModule + value: "shinano" + module_type: "shutter_module" + tag: Grenade diff --git a/Resources/Prototypes/_White/Entities/Objects/Weapons/Guns/shinano.yml b/Resources/Prototypes/_White/Entities/Objects/Weapons/Guns/shinano.yml index 0b976dcb5b..0910c5352f 100644 --- a/Resources/Prototypes/_White/Entities/Objects/Weapons/Guns/shinano.yml +++ b/Resources/Prototypes/_White/Entities/Objects/Weapons/Guns/shinano.yml @@ -38,3 +38,18 @@ soundInsert: path: /Audio/Weapons/Guns/MagIn/batrifle_magin.ogg autoCycle: false + - type: WeaponModules + - type: ItemSlots + slots: + shutter_module: + name: Shutter Module + insertSound: /Audio/White/Gun/Modules/insertmodule.ogg + ejectSound: /Audio/White/Gun/Modules/ejectmodule.ogg + priority: 1 + whitelist: + tags: + - BaseShutterModule + - type: ContainerContainer + containers: + shutter_module: !type:ContainerSlot + - type: Appearance diff --git a/Resources/Prototypes/_White/Recipes/lathe_recipes.yml b/Resources/Prototypes/_White/Recipes/lathe_recipes.yml index f62c31ee4b..1d1620b717 100644 --- a/Resources/Prototypes/_White/Recipes/lathe_recipes.yml +++ b/Resources/Prototypes/_White/Recipes/lathe_recipes.yml @@ -133,3 +133,37 @@ completetime: 5 materials: Steel: 1500 + +- type: latheRecipe + id: ShinanoGrenadeFlashRecipe + result: ShinanoGrenadeFlash + completetime: 3 + materials: + Steel: 800 + Plastic: 200 + Glass: 100 + Plasma: 100 + +- type: latheRecipe + id: ShinanoGrenadeSmokeRecipe + result: ShinanoGrenadeSmoke + completetime: 3 + materials: + Steel: 800 + Plastic: 200 + Uranium: 200 + +- type: latheRecipe + id: ShinanoGrenadeStingerRecipe + result: ShinanoGrenadeStinger + completetime: 3 + materials: + Steel: 800 + Plastic: 800 + +- type: latheRecipe + id: ShinanoGrenadeBeanbagRecipe + result: ShinanoGrenadeBeanbag + completetime: 3 + materials: + Steel: 800 \ No newline at end of file diff --git a/Resources/Prototypes/_White/tags.yml b/Resources/Prototypes/_White/tags.yml index 479ac4738b..cec579ce37 100644 --- a/Resources/Prototypes/_White/tags.yml +++ b/Resources/Prototypes/_White/tags.yml @@ -79,6 +79,9 @@ - type: Tag id: BaseAimModule +- type: Tag + id: BaseShutterModule + - type: Tag id: DoorjackUsable