[feat] Egun

This commit is contained in:
rhailrake
2023-04-28 02:10:32 +06:00
committed by Aviu00
parent 663cae3181
commit 72fa97798f
35 changed files with 425 additions and 15 deletions

View File

@@ -0,0 +1,43 @@
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Shared.Weapons.Ranged.Components;
[RegisterComponent, NetworkedComponent]
public sealed class TwoModeEnergyAmmoProviderComponent : BatteryAmmoProviderComponent
{
[ViewVariables(VVAccess.ReadOnly),
DataField("projProto", required: true, customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
public string ProjectilePrototype = default!;
[ViewVariables(VVAccess.ReadOnly),
DataField("hitscanProto", required: true, customTypeSerializer: typeof(PrototypeIdSerializer<HitscanPrototype>))]
public string HitscanPrototype = default!;
[ViewVariables(VVAccess.ReadOnly), DataField("projFireCost")]
public float ProjFireCost = 50;
[ViewVariables(VVAccess.ReadOnly), DataField("hitscanFireCost")]
public float HitscanFireCost = 100;
[ViewVariables(VVAccess.ReadOnly), DataField("currentMode")]
public EnergyModes CurrentMode { get; set; } = EnergyModes.Stun;
[ViewVariables(VVAccess.ReadOnly), DataField("projSound")]
public SoundSpecifier? ProjSound = new SoundPathSpecifier("/Audio/Weapons/Guns/Gunshots/taser2.ogg");
[ViewVariables(VVAccess.ReadOnly), DataField("hitscanSound")]
public SoundSpecifier? HitscanSound = new SoundPathSpecifier("/Audio/Weapons/Guns/Gunshots/laser_cannon.ogg");
public SoundSpecifier? ToggleSound = new SoundPathSpecifier("/Audio/Weapons/Guns/Misc/egun_toggle.ogg");
[ViewVariables(VVAccess.ReadOnly)] public bool InStun = true;
}
public enum EnergyModes
{
Stun,
Laser
}