Allow pacifists to use disabling modes of energy magnum and energy shotgun (#41029)
Pacifists can stun with emagnum and eshotgun
This commit is contained in:
@@ -6,6 +6,7 @@ using Content.Shared.IdentityManagement;
|
|||||||
using Content.Shared.Interaction.Events;
|
using Content.Shared.Interaction.Events;
|
||||||
using Content.Shared.Popups;
|
using Content.Shared.Popups;
|
||||||
using Content.Shared.Throwing;
|
using Content.Shared.Throwing;
|
||||||
|
using Content.Shared.Weapons.Ranged.Components;
|
||||||
using Content.Shared.Weapons.Ranged.Events;
|
using Content.Shared.Weapons.Ranged.Events;
|
||||||
using Robust.Shared.Timing;
|
using Robust.Shared.Timing;
|
||||||
|
|
||||||
@@ -65,6 +66,10 @@ public sealed class PacificationSystem : EntitySystem
|
|||||||
if (HasComp<PacifismAllowedGunComponent>(args.Used))
|
if (HasComp<PacifismAllowedGunComponent>(args.Used))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (TryComp<BatteryWeaponFireModesComponent>(args.Used, out var component))
|
||||||
|
if (component.FireModes[component.CurrentFireMode].PacifismAllowedMode)
|
||||||
|
return;
|
||||||
|
|
||||||
// Disallow firing guns in all cases.
|
// Disallow firing guns in all cases.
|
||||||
ShowPopup(ent, args.Used, "pacified-cannot-fire-gun");
|
ShowPopup(ent, args.Used, "pacified-cannot-fire-gun");
|
||||||
args.Cancel();
|
args.Cancel();
|
||||||
|
|||||||
@@ -42,6 +42,12 @@ public sealed partial class BatteryWeaponFireMode
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField]
|
[DataField]
|
||||||
public float FireCost = 100;
|
public float FireCost = 100;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Wether or not this fire mode can be used by pacifists
|
||||||
|
/// </summary>
|
||||||
|
[DataField]
|
||||||
|
public bool PacifismAllowedMode = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
[Serializable, NetSerializable]
|
[Serializable, NetSerializable]
|
||||||
|
|||||||
@@ -847,6 +847,7 @@
|
|||||||
fireCost: 80
|
fireCost: 80
|
||||||
- proto: BulletDisablerSmgSpread
|
- proto: BulletDisablerSmgSpread
|
||||||
fireCost: 48
|
fireCost: 48
|
||||||
|
pacifismAllowedMode: true
|
||||||
- type: Item
|
- type: Item
|
||||||
size: Large
|
size: Large
|
||||||
sprite: Objects/Weapons/Guns/Battery/inhands_64x.rsi
|
sprite: Objects/Weapons/Guns/Battery/inhands_64x.rsi
|
||||||
@@ -898,6 +899,7 @@
|
|||||||
fireCost: 150
|
fireCost: 150
|
||||||
- proto: BulletDisabler
|
- proto: BulletDisabler
|
||||||
fireCost: 62.5
|
fireCost: 62.5
|
||||||
|
pacifismAllowedMode: true
|
||||||
- type: BatterySelfRecharger
|
- type: BatterySelfRecharger
|
||||||
autoRecharge: true
|
autoRecharge: true
|
||||||
autoRechargeRate: 48
|
autoRechargeRate: 48
|
||||||
|
|||||||
Reference in New Issue
Block a user