diff --git a/Content.Shared/Weapons/Ranged/Components/BatteryWeaponFireModesComponent.cs b/Content.Shared/Weapons/Ranged/Components/BatteryWeaponFireModesComponent.cs index bbe093ab3f6c68..7fdd9b1a2b303b 100644 --- a/Content.Shared/Weapons/Ranged/Components/BatteryWeaponFireModesComponent.cs +++ b/Content.Shared/Weapons/Ranged/Components/BatteryWeaponFireModesComponent.cs @@ -1,4 +1,5 @@ using Content.Shared.Weapons.Ranged.Systems; +using Robust.Shared.Audio; using Robust.Shared.GameStates; using Robust.Shared.Prototypes; using Robust.Shared.Serialization; @@ -45,10 +46,10 @@ public sealed partial class BatteryWeaponFireMode public string? FireModeName; /// - /// Sound of a gunshot that is used in the selected fire mode + /// Gun modifiers of this fire mode /// [DataField] - public string? SoundGunshot; + public FireModeGunModifiers? GunModifiers; /// /// Sprite of the remaining charge that is used in the selected fire mode @@ -63,3 +64,39 @@ public sealed partial class BatteryWeaponFireMode [DataField] public float FireCost = 100; } + +//SS220 Add firemode modificators begin +/// +/// Gun modifiers that can be applied in each fire mode +/// +[DataDefinition, Serializable, NetSerializable] +public sealed partial class FireModeGunModifiers +{ + [DataField] + public SoundSpecifier? SoundGunshot; + + [DataField] + public float? CameraRecoilScala; + + [DataField] + public Angle? AngleIncrease; + + [DataField] + public Angle? AngleDecay; + + [DataField] + public Angle? MaxAngle; + + [DataField] + public Angle? MinAngle; + + [DataField] + public int? ShotsPerBurst; + + [DataField] + public float? FireRate; + + [DataField] + public float? ProjectileSpeed; +} +//SS220 Add firemode modificators end diff --git a/Content.Shared/Weapons/Ranged/Systems/BatteryWeaponFireModesSystem.cs b/Content.Shared/Weapons/Ranged/Systems/BatteryWeaponFireModesSystem.cs index 8f7b4d6eb51fca..c1ca3877f8150c 100644 --- a/Content.Shared/Weapons/Ranged/Systems/BatteryWeaponFireModesSystem.cs +++ b/Content.Shared/Weapons/Ranged/Systems/BatteryWeaponFireModesSystem.cs @@ -216,8 +216,18 @@ private void OnRefreshModifiers(Entity ent, ref { var firemode = GetMode(ent.Comp); - if (firemode.SoundGunshot is not null) - args.SoundGunshot = new SoundPathSpecifier(firemode.SoundGunshot); + if (firemode.GunModifiers is not { } modifiers || + !TryComp(ent.Owner, out var gunComponent)) + return; + + args.SoundGunshot = modifiers.SoundGunshot ?? gunComponent.SoundGunshot; + args.AngleIncrease = modifiers.AngleIncrease ?? gunComponent.AngleIncrease; + args.AngleDecay = modifiers.AngleDecay ?? gunComponent.AngleDecay; + args.MaxAngle = modifiers.MaxAngle ?? gunComponent.MaxAngle; + args.MinAngle = modifiers.MinAngle ?? gunComponent.MinAngle; + args.ShotsPerBurst = modifiers.ShotsPerBurst ?? gunComponent.ShotsPerBurst; + args.FireRate = modifiers.FireRate ?? gunComponent.FireRate; + args.ProjectileSpeed = modifiers.ProjectileSpeed ?? gunComponent.ProjectileSpeed; } //SS220 Add Multifaze gun end } diff --git a/Resources/Prototypes/SS220/Entities/Objects/Weapons/Guns/multiphase_energy_gun.yml b/Resources/Prototypes/SS220/Entities/Objects/Weapons/Guns/multiphase_energy_gun.yml index 0bc9880da65742..8ac0b562996a4b 100644 --- a/Resources/Prototypes/SS220/Entities/Objects/Weapons/Guns/multiphase_energy_gun.yml +++ b/Resources/Prototypes/SS220/Entities/Objects/Weapons/Guns/multiphase_energy_gun.yml @@ -20,17 +20,20 @@ - proto: BulletDisabler name: firemode-name-disabler fireCost: 40 - soundGunshot: /Audio/Weapons/Guns/Gunshots/taser2.ogg + gunModifiers: + soundGunshot: /Audio/Weapons/Guns/Gunshots/taser2.ogg magState: disabler-mag - proto: RedMediumLaser name: firemode-name-laser fireCost: 62.5 - soundGunshot: /Audio/Weapons/Guns/Gunshots/laser_cannon.ogg + gunModifiers: + soundGunshot: /Audio/Weapons/Guns/Gunshots/laser_cannon.ogg magState: laser-mag - proto: BulletEMP name: firemode-name-emp fireCost: 200 - soundGunshot: /Audio/Weapons/Guns/Gunshots/taser.ogg + gunModifiers: + soundGunshot: /Audio/Weapons/Guns/Gunshots/taser.ogg magState: emp-mag - type: ProjectileBatteryAmmoProvider proto: BulletDisabler