Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more modifiers for firemodes #2308

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -45,10 +46,10 @@ public sealed partial class BatteryWeaponFireMode
public string? FireModeName;

/// <summary>
/// Sound of a gunshot that is used in the selected fire mode
/// Gun modifiers of this fire mode
/// </summary>
[DataField]
public string? SoundGunshot;
public FireModeGunModifiers? GunModifiers;

/// <summary>
/// Sprite of the remaining charge that is used in the selected fire mode
Expand All @@ -63,3 +64,39 @@ public sealed partial class BatteryWeaponFireMode
[DataField]
public float FireCost = 100;
}

//SS220 Add firemode modificators begin
/// <summary>
/// Gun modifiers that can be applied in each fire mode
/// </summary>
[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
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,18 @@ private void OnRefreshModifiers(Entity<BatteryWeaponFireModesComponent> 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<GunComponent>(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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -666,12 +666,14 @@
- proto: RedMediumLaser
name: firemode-name-laser
fireCost: 100
soundGunshot: /Audio/Weapons/Guns/Gunshots/laser_cannon.ogg
gunModifiers:
soundGunshot: /Audio/Weapons/Guns/Gunshots/laser_cannon.ogg
magState: laser-mag
- proto: BulletDisabler
name: firemode-name-disabler
fireCost: 100
soundGunshot: /Audio/Weapons/Guns/Gunshots/taser2.ogg
gunModifiers:
soundGunshot: /Audio/Weapons/Guns/Gunshots/taser2.ogg
magState: disabler-mag
#ss220 add stun mode end
- type: MagazineVisuals
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@
- proto: Pulsekill
name: firemode-name-kill
fireCost: 1
soundGunshot: /Audio/SS220/Weapons/Guns/Gunshots/rifle.ogg
gunModifiers:
soundGunshot: /Audio/SS220/Weapons/Guns/Gunshots/rifle.ogg
- proto: PulseDESTROY
name: firemode-name-destroy
fireCost: 5
soundGunshot: /Audio/SS220/Weapons/Guns/Gunshots/rifle.ogg
gunModifiers:
soundGunshot: /Audio/SS220/Weapons/Guns/Gunshots/rifle.ogg

- type: entity
name: pulse shotgun
Expand Down Expand Up @@ -64,10 +66,12 @@
- proto: BulletLaserDestroy
name: firemode-name-kill
fireCost: 10
soundGunshot: /Audio/SS220/Weapons/Guns/Gunshots/hidg_rifle.ogg
gunModifiers:
soundGunshot: /Audio/SS220/Weapons/Guns/Gunshots/hidg_rifle.ogg
magState: pulse-mag
- proto: BulletLaserHeal
name: firemode-name-heal
fireCost: 17.5
soundGunshot: /Audio/SS220/Weapons/Guns/Gunshots/hidg_rifle.ogg
gunModifiers:
soundGunshot: /Audio/SS220/Weapons/Guns/Gunshots/hidg_rifle.ogg
magState: heal-mag
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading