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