diff --git a/Content.Server/Weapons/Ranged/Systems/GunSystem.cs b/Content.Server/Weapons/Ranged/Systems/GunSystem.cs index fbc46f5917..7c61aaa200 100644 --- a/Content.Server/Weapons/Ranged/Systems/GunSystem.cs +++ b/Content.Server/Weapons/Ranged/Systems/GunSystem.cs @@ -169,7 +169,8 @@ public sealed partial class GunSystem : SharedGunSystem } // Something like ballistic might want to leave it in the container still - if (!cartridge.DeleteOnSpawn && !Containers.IsEntityInContainer(ent!.Value)) + if (!cartridge.DeleteOnSpawn && !Containers.IsEntityInContainer(ent!.Value) && + (!TryComp(gunUid, out BallisticAmmoProviderComponent? ballistic) || ballistic.AutoCycle)) // WD EDIT EjectCartridge(ent.Value, angle); Dirty(ent!.Value, cartridge); diff --git a/Content.Shared/Weapons/Ranged/Components/BallisticAmmoProviderComponent.cs b/Content.Shared/Weapons/Ranged/Components/BallisticAmmoProviderComponent.cs index eb04d3227d..cc483ce533 100644 --- a/Content.Shared/Weapons/Ranged/Components/BallisticAmmoProviderComponent.cs +++ b/Content.Shared/Weapons/Ranged/Components/BallisticAmmoProviderComponent.cs @@ -44,6 +44,15 @@ public sealed partial class BallisticAmmoProviderComponent : Component [ViewVariables(VVAccess.ReadWrite), DataField, AutoNetworkedField] public bool Cycleable = true; + // WD EDIT START + /// + /// Automatically cycles the firearm after firing a round + /// + [ViewVariables(VVAccess.ReadWrite), DataField] + [AutoNetworkedField] + public bool AutoCycle = true; + // WD EDIT END + /// /// Is it okay for this entity to directly transfer its valid ammunition into another provider? /// diff --git a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Ballistic.cs b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Ballistic.cs index 91aad89582..061a84ee3b 100644 --- a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Ballistic.cs +++ b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Ballistic.cs @@ -240,14 +240,29 @@ public abstract partial class SharedGunSystem entity = component.Entities[^1]; args.Ammo.Add((entity, EnsureShootable(entity))); - component.Entities.RemoveAt(component.Entities.Count - 1); - Containers.Remove(entity, component.Container); + + if (component.AutoCycle) // WD EDIT + { + component.Entities.RemoveAt(component.Entities.Count - 1); + Containers.Remove(entity, component.Container); + } + else + break; } else if (component.UnspawnedCount > 0) { component.UnspawnedCount--; entity = Spawn(component.Proto, args.Coordinates); args.Ammo.Add((entity, EnsureShootable(entity))); + + // WD EDIT START + if (!component.AutoCycle && HasComp(entity)) + { + component.Entities.Add(entity); + Containers.Insert(entity, component.Container); + break; + } + // WD EDIT END } } diff --git a/Content.Shared/Wieldable/WieldableSystem.cs b/Content.Shared/Wieldable/WieldableSystem.cs index 6bd406c1ca..4cdb23a376 100644 --- a/Content.Shared/Wieldable/WieldableSystem.cs +++ b/Content.Shared/Wieldable/WieldableSystem.cs @@ -61,15 +61,10 @@ public sealed class WieldableSystem : EntitySystem private void OnShootAttempt(EntityUid uid, GunRequiresWieldComponent component, ref AttemptShootEvent args) { - if (TryComp(uid, out var wieldable) && - !wieldable.Wielded) + if (TryComp(uid, out var wieldable) && !wieldable.Wielded) { args.Cancelled = true; - - if (!HasComp(uid) && !HasComp(uid)) - { - args.Message = Loc.GetString("wieldable-component-requires", ("item", uid)); - } + args.Message = Loc.GetString("wieldable-component-requires", ("item", uid)); } } @@ -214,6 +209,17 @@ public sealed class WieldableSystem : EntitySystem /// True if the attempt wasn't blocked. public bool TryUnwield(EntityUid used, WieldableComponent component, EntityUid user) { + // WD EDIT START + if (!component.Wielded) + return false; + + if (TryComp(used, out var ballisticAmmoProvider) + && ballisticAmmoProvider.Entities.Count != 0 + && TryComp(ballisticAmmoProvider.Entities[^1], out var cartridgeAmmo) + && cartridgeAmmo.Spent) + return false; + // WD EDIT END + var ev = new BeforeUnwieldEvent(); RaiseLocalEvent(used, ev); diff --git a/Resources/Audio/_White/Guns/attributions.yml b/Resources/Audio/_White/Guns/attributions.yml new file mode 100644 index 0000000000..9f858cf67f --- /dev/null +++ b/Resources/Audio/_White/Guns/attributions.yml @@ -0,0 +1,4 @@ +- files: ["insert.ogg"] + license: "CC-BY-NC-SA-4.0" + copyright: "Taken from White Dream" + source: "https://github.com/frosty-dev/ss14-core/blob/master/Resources/Audio/White/Gun/insert.ogg" diff --git a/Resources/Audio/_White/Guns/insert.ogg b/Resources/Audio/_White/Guns/insert.ogg new file mode 100644 index 0000000000..cb82a03975 Binary files /dev/null and b/Resources/Audio/_White/Guns/insert.ogg differ diff --git a/Resources/Prototypes/Catalog/uplink_catalog.yml b/Resources/Prototypes/Catalog/uplink_catalog.yml index 0c85146546..fc040e9e95 100644 --- a/Resources/Prototypes/Catalog/uplink_catalog.yml +++ b/Resources/Prototypes/Catalog/uplink_catalog.yml @@ -387,7 +387,7 @@ description: uplink-sniper-ammo-desc productEntity: MagazineBoxAntiMateriel cost: - Telecrystal: 2 + Telecrystal: 6 # WD EDIT categories: - UplinkAmmo @@ -889,7 +889,7 @@ icon: { sprite: /Textures/Objects/Weapons/Guns/Snipers/heavy_sniper.rsi, state: base } productEntity: BriefcaseSyndieSniperBundleFilled cost: - Telecrystal: 12 + Telecrystal: 20 # WD EDIT categories: - UplinkBundles saleLimit: 1 # WD EDIT diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/antimateriel.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/antimateriel.yml index 31d7b65fe8..5d07187c15 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/antimateriel.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/antimateriel.yml @@ -7,7 +7,7 @@ - type: Projectile damage: types: - Piercing: 40 - Structural: 30 + Piercing: 120 #WD edit + Structural: 150 #WD edit - type: StaminaDamageOnCollide damage: 35 diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Launchers/launchers.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Launchers/launchers.yml index b2d372b7f9..4fa7831f5a 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Launchers/launchers.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Launchers/launchers.yml @@ -80,6 +80,7 @@ capacity: 1 soundInsert: path: /Audio/Weapons/Guns/MagIn/batrifle_magin.ogg + autoCycle: false # WD EDIT - type: MagazineVisuals magState: mag steps: 2 diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Shotguns/shotguns.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Shotguns/shotguns.yml index 63f554e448..71dd92de95 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Shotguns/shotguns.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Shotguns/shotguns.yml @@ -35,6 +35,7 @@ - ShellShotgun capacity: 7 proto: ShellShotgun + autoCycle: false # WD EDIT soundInsert: path: /Audio/Weapons/Guns/MagIn/shotgun_insert.ogg - type: ContainerContainer @@ -127,6 +128,7 @@ fireOnDropChance: 0.5 - type: BallisticAmmoProvider capacity: 2 + autoCycle: true # WD EDIT - type: Construction graph: ShotgunSawn node: start diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Snipers/snipers.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Snipers/snipers.yml index 488c4f8ce6..deedd7f8eb 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Snipers/snipers.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Snipers/snipers.yml @@ -31,6 +31,7 @@ whitelist: tags: - CartridgeLightRifle + autoCycle: false # WD EDIT - type: ContainerContainer containers: ballistic-ammo: !type:Container @@ -75,17 +76,36 @@ id: WeaponSniperHristov description: A portable anti-materiel rifle. Fires armor piercing 14.5mm shells. Uses .60 anti-materiel ammo. components: + # WD EDIT START - type: Sprite - sprite: Objects/Weapons/Guns/Snipers/heavy_sniper.rsi + sprite: _White/Objects/Weapons/Guns/Snipers/hristov-icons.rsi + layers: + - state: base + map: [ "enum.GunVisualLayers.Base" ] + - state: mag-0 + map: [ "enum.GunVisualLayers.Mag" ] - type: Clothing - sprite: Objects/Weapons/Guns/Snipers/heavy_sniper.rsi + sprite: _White/Objects/Weapons/Guns/Snipers/hristov-inhands.rsi + - type: Item + sprite: _White/Objects/Weapons/Guns/Snipers/hristov-inhands.rsi - type: BallisticAmmoProvider + soundInsert: /Audio/_White/Guns/insert.ogg whitelist: tags: - CartridgeAntiMateriel capacity: 5 proto: CartridgeAntiMateriel - - type: Telescope # WD EDIT + - type: Gun + fireRate: 0.6 + - type: Wieldable + - type: GunRequiresWield + - type: Telescope + - type: MagazineVisuals + magState: mag + steps: 1 + zeroVisible: true + - type: Appearance + # WD EDIT END - type: entity name: musket diff --git a/Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-icons.rsi/base.png b/Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-icons.rsi/base.png new file mode 100644 index 0000000000..06e1fc8bd7 Binary files /dev/null and b/Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-icons.rsi/base.png differ diff --git a/Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-icons.rsi/bolt-open.png b/Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-icons.rsi/bolt-open.png new file mode 100644 index 0000000000..540739166c Binary files /dev/null and b/Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-icons.rsi/bolt-open.png differ diff --git a/Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-icons.rsi/icon.png b/Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-icons.rsi/icon.png new file mode 100644 index 0000000000..e8d491861f Binary files /dev/null and b/Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-icons.rsi/icon.png differ diff --git a/Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-icons.rsi/mag-0.png b/Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-icons.rsi/mag-0.png new file mode 100644 index 0000000000..1f9d1bf509 Binary files /dev/null and b/Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-icons.rsi/mag-0.png differ diff --git a/Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-icons.rsi/meta.json b/Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-icons.rsi/meta.json new file mode 100644 index 0000000000..a2d92e0fe2 --- /dev/null +++ b/Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-icons.rsi/meta.json @@ -0,0 +1,23 @@ +{ + "version": 1, + "license": "CC-BY-NC-SA-4.0", + "copyright": "WD team", + "size": { + "x": 56, + "y": 32 + }, + "states": [ + { + "name": "base" + }, + { + "name": "bolt-open" + }, + { + "name": "icon" + }, + { + "name": "mag-0" + } + ] +} diff --git a/Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-inhands.rsi/equipped-BACKPACK.png b/Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-inhands.rsi/equipped-BACKPACK.png new file mode 100644 index 0000000000..6127c2b652 Binary files /dev/null and b/Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-inhands.rsi/equipped-BACKPACK.png differ diff --git a/Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-inhands.rsi/inhand-left.png b/Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-inhands.rsi/inhand-left.png new file mode 100644 index 0000000000..2c31a2f024 Binary files /dev/null and b/Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-inhands.rsi/inhand-left.png differ diff --git a/Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-inhands.rsi/inhand-right.png b/Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-inhands.rsi/inhand-right.png new file mode 100644 index 0000000000..b4a053e508 Binary files /dev/null and b/Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-inhands.rsi/inhand-right.png differ diff --git a/Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-inhands.rsi/meta.json b/Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-inhands.rsi/meta.json new file mode 100644 index 0000000000..77a13f2a47 --- /dev/null +++ b/Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-inhands.rsi/meta.json @@ -0,0 +1,31 @@ +{ + "version": 1, + "license": "CC-BY-NC-SA-4.0", + "copyright": "WD team", + "size": { + "x": 32, + "y": 32 + }, + "states": [ + { + "name": "inhand-left", + "directions": 4 + }, + { + "name": "inhand-right", + "directions": 4 + }, + { + "name": "wielded-inhand-left", + "directions": 4 + }, + { + "name": "wielded-inhand-right", + "directions": 4 + }, + { + "name": "equipped-BACKPACK", + "directions": 4 + } + ] +} diff --git a/Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-inhands.rsi/wielded-inhand-left.png b/Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-inhands.rsi/wielded-inhand-left.png new file mode 100644 index 0000000000..845ce03594 Binary files /dev/null and b/Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-inhands.rsi/wielded-inhand-left.png differ diff --git a/Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-inhands.rsi/wielded-inhand-right.png b/Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-inhands.rsi/wielded-inhand-right.png new file mode 100644 index 0000000000..b642cc9d8a Binary files /dev/null and b/Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-inhands.rsi/wielded-inhand-right.png differ