diff --git a/Content.Client/Weapons/Ranged/Components/MagazineVisualsComponent.cs b/Content.Client/Weapons/Ranged/Components/MagazineVisualsComponent.cs index 373be94a38..c8b5cd080b 100644 --- a/Content.Client/Weapons/Ranged/Components/MagazineVisualsComponent.cs +++ b/Content.Client/Weapons/Ranged/Components/MagazineVisualsComponent.cs @@ -30,4 +30,6 @@ public enum GunVisualLayers : byte BaseUnshaded, Mag, MagUnshaded, + TwoModeFirst, + TwoModeSecond } diff --git a/Content.Client/Weapons/Ranged/Systems/GunSystem.AmmoCounter.cs b/Content.Client/Weapons/Ranged/Systems/GunSystem.AmmoCounter.cs index dfb5418f11..456f6d7807 100644 --- a/Content.Client/Weapons/Ranged/Systems/GunSystem.AmmoCounter.cs +++ b/Content.Client/Weapons/Ranged/Systems/GunSystem.AmmoCounter.cs @@ -251,14 +251,19 @@ public sealed partial class GunSystem _ammoCount.Visible = true; _ammoCount.Text = $"x{count:00}"; - max = Math.Min(max, 8); - FillBulletRow(_bulletsList, count, max); + float step = 1; + if (max > 8) + { + step = ((float)max / 8); + } + FillBulletRow(_bulletsList, count, max, step); } - private static void FillBulletRow(Control container, int count, int capacity) + private static void FillBulletRow(Control container, int count, int capacity, float step = 1) { var colorGone = Color.FromHex("#000000"); var color = Color.FromHex("#E00000"); + int emptyNumber = 0; // Draw the empty ones for (var i = count; i < capacity; i++) diff --git a/Content.Client/Weapons/Ranged/Systems/GunSystem.Battery.cs b/Content.Client/Weapons/Ranged/Systems/GunSystem.Battery.cs index 122244e7f2..0f1535e357 100644 --- a/Content.Client/Weapons/Ranged/Systems/GunSystem.Battery.cs +++ b/Content.Client/Weapons/Ranged/Systems/GunSystem.Battery.cs @@ -14,6 +14,10 @@ public sealed partial class GunSystem // Projectile SubscribeLocalEvent(OnControl); SubscribeLocalEvent(OnAmmoCountUpdate); + + // TwoModeEnergy + SubscribeLocalEvent(OnControl); + SubscribeLocalEvent(OnAmmoCountUpdate); } private void OnAmmoCountUpdate(EntityUid uid, BatteryAmmoProviderComponent component, UpdateAmmoCounterEvent args) diff --git a/Content.Client/Weapons/Ranged/Systems/GunSystem.MagazineVisuals.cs b/Content.Client/Weapons/Ranged/Systems/GunSystem.MagazineVisuals.cs index 2d670d1e77..6e358ae77d 100644 --- a/Content.Client/Weapons/Ranged/Systems/GunSystem.MagazineVisuals.cs +++ b/Content.Client/Weapons/Ranged/Systems/GunSystem.MagazineVisuals.cs @@ -28,6 +28,18 @@ public sealed partial class GunSystem sprite.LayerSetState(GunVisualLayers.MagUnshaded, $"{component.MagState}-unshaded-{component.MagSteps - 1}"); sprite.LayerSetVisible(GunVisualLayers.MagUnshaded, false); } + + if (sprite.LayerMapTryGet(GunVisualLayers.TwoModeFirst, out _)) + { + sprite.LayerSetState(GunVisualLayers.TwoModeFirst, $"{component.MagState}-twomode1-{component.MagSteps - 1}"); + sprite.LayerSetVisible(GunVisualLayers.TwoModeFirst, false); + } + + if (sprite.LayerMapTryGet(GunVisualLayers.TwoModeSecond, out _)) + { + sprite.LayerSetState(GunVisualLayers.TwoModeSecond, $"{component.MagState}-twomode2-{component.MagSteps - 1}"); + sprite.LayerSetVisible(GunVisualLayers.TwoModeSecond, false); + } } private void OnMagazineVisualsChange(EntityUid uid, MagazineVisualsComponent component, ref AppearanceChangeEvent args) @@ -67,6 +79,16 @@ public sealed partial class GunSystem sprite.LayerSetVisible(GunVisualLayers.MagUnshaded, false); } + if (sprite.LayerMapTryGet(GunVisualLayers.TwoModeFirst, out _)) + { + sprite.LayerSetVisible(GunVisualLayers.TwoModeFirst, false); + } + + if (sprite.LayerMapTryGet(GunVisualLayers.TwoModeSecond, out _)) + { + sprite.LayerSetVisible(GunVisualLayers.TwoModeSecond, false); + } + return; } @@ -81,6 +103,27 @@ public sealed partial class GunSystem sprite.LayerSetVisible(GunVisualLayers.MagUnshaded, true); sprite.LayerSetState(GunVisualLayers.MagUnshaded, $"{component.MagState}-unshaded-{step}"); } + + if (!args.AppearanceData.TryGetValue(AmmoVisuals.InStun, out var inStun) || inStun is true) + { + if (sprite.LayerMapTryGet(GunVisualLayers.TwoModeFirst, out var _)) + { + sprite.LayerSetVisible(GunVisualLayers.TwoModeSecond, false); + sprite.LayerSetVisible(GunVisualLayers.TwoModeFirst, true); + sprite.LayerSetState(GunVisualLayers.TwoModeFirst, $"{component.MagState}-twomode1-{step}"); + } + } + + else if (inStun is false) + { + if (sprite.LayerMapTryGet(GunVisualLayers.TwoModeSecond, out var _)) + { + sprite.LayerSetVisible(GunVisualLayers.TwoModeFirst, false); + sprite.LayerSetVisible(GunVisualLayers.TwoModeSecond, true); + sprite.LayerSetState(GunVisualLayers.TwoModeSecond, $"{component.MagState}-twomode2-{step}"); + + } + } } else { @@ -93,6 +136,16 @@ public sealed partial class GunSystem { sprite.LayerSetVisible(GunVisualLayers.MagUnshaded, false); } + + if (sprite.LayerMapTryGet(GunVisualLayers.TwoModeFirst, out _)) + { + sprite.LayerSetVisible(GunVisualLayers.TwoModeFirst, false); + } + + if (sprite.LayerMapTryGet(GunVisualLayers.TwoModeSecond, out _)) + { + sprite.LayerSetVisible(GunVisualLayers.TwoModeSecond, false); + } } } } diff --git a/Content.Server/Weapons/Ranged/Systems/GunSystem.Battery.cs b/Content.Server/Weapons/Ranged/Systems/GunSystem.Battery.cs index f4deffd113..0c1e85f24d 100644 --- a/Content.Server/Weapons/Ranged/Systems/GunSystem.Battery.cs +++ b/Content.Server/Weapons/Ranged/Systems/GunSystem.Battery.cs @@ -2,6 +2,7 @@ using Content.Server.Power.Components; using Content.Shared.Damage; using Content.Shared.Damage.Events; using Content.Shared.FixedPoint; +using Content.Shared.Interaction.Events; using Content.Shared.Projectiles; using Content.Shared.Weapons.Ranged; using Content.Shared.Weapons.Ranged.Components; @@ -11,6 +12,8 @@ namespace Content.Server.Weapons.Ranged.Systems; public sealed partial class GunSystem { + [Dependency] private readonly SharedAudioSystem _audio = default!; + protected override void InitializeBattery() { base.InitializeBattery(); @@ -24,6 +27,41 @@ public sealed partial class GunSystem SubscribeLocalEvent(OnBatteryStartup); SubscribeLocalEvent(OnBatteryChargeChange); SubscribeLocalEvent(OnBatteryDamageExamine); + + //TwoModeEnergy + SubscribeLocalEvent(OnBatteryStartup); + SubscribeLocalEvent(OnBatteryChargeChange); + SubscribeLocalEvent(OnBatteryDamageExamine); + SubscribeLocalEvent(OnBatteryModeChange); + } + + private void OnBatteryModeChange(EntityUid uid, TwoModeEnergyAmmoProviderComponent component, UseInHandEvent args) + { + if (!TryComp(uid, out var gun)) + return; + + if (component.CurrentMode == EnergyModes.Stun) + { + component.InStun = false; + gun.SoundGunshot = component.HitscanSound; + component.CurrentMode = EnergyModes.Laser; + component.FireCost = component.HitscanFireCost; + _audio.PlayPvs(component.ToggleSound, args.User); + } + else if (component.CurrentMode == EnergyModes.Laser) + { + component.InStun = true; + gun.SoundGunshot = component.ProjSound; + component.CurrentMode = EnergyModes.Stun; + component.FireCost = component.ProjFireCost; + _audio.PlayPvs(component.ToggleSound, args.User); + } + UpdateShots(uid, component); + UpdateTwoModeAppearance(uid, component); + UpdateBatteryAppearance(uid, component); + UpdateAmmoCount(uid); + Dirty(gun); + Dirty(component); } private void OnBatteryStartup(EntityUid uid, BatteryAmmoProviderComponent component, ComponentStartup args) @@ -66,12 +104,24 @@ public sealed partial class GunSystem if (damageSpec == null) return; - var damageType = component switch + string? damageType; + switch (component) { - HitscanBatteryAmmoProviderComponent => Loc.GetString("damage-hitscan"), - ProjectileBatteryAmmoProviderComponent => Loc.GetString("damage-projectile"), - _ => throw new ArgumentOutOfRangeException(), - }; + case HitscanBatteryAmmoProviderComponent: + damageType = Loc.GetString("damage-hitscan"); + break; + case ProjectileBatteryAmmoProviderComponent: + damageType = Loc.GetString("damage-projectile"); + break; + case TwoModeEnergyAmmoProviderComponent twoMode: + if (twoMode.CurrentMode == EnergyModes.Stun) + damageType = Loc.GetString("damage-projectile"); + else + damageType = Loc.GetString("damage-hitscan"); + break; + default: + throw new ArgumentOutOfRangeException(); + } _damageExamine.AddDamageExamine(args.Message, damageSpec, damageType); } @@ -99,6 +149,25 @@ public sealed partial class GunSystem return ProtoManager.Index(hitscan.Prototype).Damage; } + if (component is TwoModeEnergyAmmoProviderComponent twoMode) + { + if (twoMode.CurrentMode == EnergyModes.Stun) + { + if (ProtoManager.Index(twoMode.ProjectilePrototype).Components + .TryGetValue(_factory.GetComponentName(typeof(ProjectileComponent)), out var projectile)) + { + var p = (ProjectileComponent) projectile.Component; + + if (p.Damage.Total > FixedPoint2.Zero) + { + return p.Damage; + } + } + + return null; + } + return ProtoManager.Index(twoMode.HitscanPrototype).Damage; + } return null; } diff --git a/Content.Shared/Weapons/Ranged/Components/GunComponent.cs b/Content.Shared/Weapons/Ranged/Components/GunComponent.cs index 350dd85d69..dc5be423a9 100644 --- a/Content.Shared/Weapons/Ranged/Components/GunComponent.cs +++ b/Content.Shared/Weapons/Ranged/Components/GunComponent.cs @@ -16,7 +16,7 @@ public partial class GunComponent : Component #region Sound [ViewVariables(VVAccess.ReadWrite), DataField("soundGunshot")] - public SoundSpecifier? SoundGunshot = new SoundPathSpecifier("/Audio/Weapons/Guns/Gunshots/smg.ogg"); + public SoundSpecifier? SoundGunshot { get; set; } = new SoundPathSpecifier("/Audio/Weapons/Guns/Gunshots/smg.ogg"); [ViewVariables(VVAccess.ReadWrite), DataField("soundEmpty")] public SoundSpecifier? SoundEmpty = new SoundPathSpecifier("/Audio/Weapons/Guns/Empty/empty.ogg"); diff --git a/Content.Shared/Weapons/Ranged/Components/TwoModeEnergyAmmoProviderComponent.cs b/Content.Shared/Weapons/Ranged/Components/TwoModeEnergyAmmoProviderComponent.cs new file mode 100644 index 0000000000..5d089287b8 --- /dev/null +++ b/Content.Shared/Weapons/Ranged/Components/TwoModeEnergyAmmoProviderComponent.cs @@ -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))] + public string ProjectilePrototype = default!; + + [ViewVariables(VVAccess.ReadOnly), + DataField("hitscanProto", required: true, customTypeSerializer: typeof(PrototypeIdSerializer))] + 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 +} diff --git a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Battery.cs b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Battery.cs index ecbd19d517..e5902e6189 100644 --- a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Battery.cs +++ b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Battery.cs @@ -1,4 +1,5 @@ using Content.Shared.Examine; +using Content.Shared.Item; using Content.Shared.Weapons.Ranged.Components; using Content.Shared.Weapons.Ranged.Events; using Robust.Shared.GameStates; @@ -9,6 +10,8 @@ namespace Content.Shared.Weapons.Ranged.Systems; public abstract partial class SharedGunSystem { + [Dependency] private readonly SharedItemSystem _item = default!; + protected virtual void InitializeBattery() { // Trying to dump comp references hence the below @@ -25,6 +28,62 @@ public abstract partial class SharedGunSystem SubscribeLocalEvent(OnBatteryTakeAmmo); SubscribeLocalEvent(OnBatteryAmmoCount); SubscribeLocalEvent(OnBatteryExamine); + + // TwoModeEnergy + SubscribeLocalEvent(OnTwoModeInit); + SubscribeLocalEvent(OnBatteryTwoModeGetState); + SubscribeLocalEvent(OnBatteryTwoModeHandleState); + SubscribeLocalEvent(OnBatteryTakeAmmo); + SubscribeLocalEvent(OnBatteryAmmoCount); + SubscribeLocalEvent(OnBatteryExamine); + } + + + private void OnTwoModeInit(EntityUid uid, TwoModeEnergyAmmoProviderComponent component, ComponentInit args) + { + if (!Timing.IsFirstTimePredicted || !TryComp(component.Owner, out var appearance)) return; + + Appearance.SetData(appearance.Owner, AmmoVisuals.InStun, component.InStun, appearance); + } + + private void OnBatteryTwoModeHandleState(EntityUid uid, TwoModeEnergyAmmoProviderComponent component, ref ComponentHandleState args) + { + if (args.Current is not TwoModeComponentState state) + return; + + component.Shots = state.Shots; + component.Capacity = state.MaxShots; + component.FireCost = state.FireCost; + component.CurrentMode = state.CurrentMode; + component.InStun = state.InStun; + } + + private void OnBatteryTwoModeGetState(EntityUid uid, TwoModeEnergyAmmoProviderComponent component, ref ComponentGetState args) + { + args.State = new TwoModeComponentState() + { + Shots = component.Shots, + MaxShots = component.Capacity, + FireCost = component.FireCost, + CurrentMode = component.CurrentMode, + InStun = component.InStun + }; + } + + protected void UpdateTwoModeAppearance(EntityUid uid, TwoModeEnergyAmmoProviderComponent component) + { + if (!TryComp(uid, out var appearance)) + return; + if (!TryComp(uid, out var item)) + return; + + if (component.InStun) + _item.SetHeldPrefix(uid, null, item); + else + _item.SetHeldPrefix(uid, "laser", item); + + + Appearance.SetData(uid, AmmoVisuals.InStun, component.InStun, appearance); } private void OnBatteryHandleState(EntityUid uid, BatteryAmmoProviderComponent component, ref ComponentHandleState args) @@ -101,6 +160,13 @@ public abstract partial class SharedGunSystem return (ent, EnsureShootable(ent)); case HitscanBatteryAmmoProviderComponent hitscan: return (null, ProtoManager.Index(hitscan.Prototype)); + case TwoModeEnergyAmmoProviderComponent twoMode: + if (twoMode.CurrentMode == EnergyModes.Stun) + { + var projEnt = Spawn(twoMode.ProjectilePrototype, coordinates); + return (projEnt, EnsureComp(projEnt)); + } + return (null, ProtoManager.Index(twoMode.HitscanPrototype)); default: throw new ArgumentOutOfRangeException(); } @@ -113,4 +179,14 @@ public abstract partial class SharedGunSystem public int MaxShots; public float FireCost; } + + [Serializable, NetSerializable] + public sealed class TwoModeComponentState : ComponentState + { + public EnergyModes CurrentMode { get; init; } + public int Shots; + public int MaxShots; + public float FireCost; + public bool InStun; + } } diff --git a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Interactions.cs b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Interactions.cs index 852096a386..54d7de3540 100644 --- a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Interactions.cs +++ b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Interactions.cs @@ -20,9 +20,20 @@ public abstract partial class SharedGunSystem ("mode", GetLocSelector(component.SelectedMode)))); args.PushMarkup(Loc.GetString("gun-fire-rate-examine", ("color", FireRateExamineColor), ("fireRate", $"{component.FireRate:0.0}"))); + + if (!TryComp(uid, out var comp)) + return; + + args.PushMarkup(Loc.GetString("gun-twomode-mode-examine", ("color", TwoModeExamineColor), + ("mode", GetLocMode(comp.CurrentMode)))); } } + private object GetLocMode(EnergyModes mode) + { + return Loc.GetString($"gun-twomode-{mode.ToString()}"); + } + private string GetLocSelector(SelectiveFire mode) { return Loc.GetString($"gun-{mode.ToString()}"); diff --git a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs index 06667857b3..f302a8a9d6 100644 --- a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs +++ b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs @@ -67,6 +67,7 @@ public abstract partial class SharedGunSystem : EntitySystem protected const string AmmoExamineColor = "yellow"; protected const string FireRateExamineColor = "yellow"; protected const string ModeExamineColor = "cyan"; + protected const string TwoModeExamineColor = "red"; public override void Initialize() { @@ -501,4 +502,5 @@ public enum AmmoVisuals : byte HasAmmo, // used for generic visualizers. c# stuff can just check ammocount != 0 MagLoaded, BoltClosed, + InStun } diff --git a/Resources/Audio/Weapons/Guns/Misc/egun_toggle.ogg b/Resources/Audio/Weapons/Guns/Misc/egun_toggle.ogg new file mode 100644 index 0000000000..b993f8a286 Binary files /dev/null and b/Resources/Audio/Weapons/Guns/Misc/egun_toggle.ogg differ diff --git a/Resources/Prototypes/Catalog/Cargo/cargo_armory.yml b/Resources/Prototypes/Catalog/Cargo/cargo_armory.yml index 399181b4fa..9f2a02aba5 100644 --- a/Resources/Prototypes/Catalog/Cargo/cargo_armory.yml +++ b/Resources/Prototypes/Catalog/Cargo/cargo_armory.yml @@ -57,3 +57,13 @@ cost: 5200 category: Armory group: market + +- type: cargoProduct + id: ArmoryEgun + icon: + sprite: Objects/Weapons/Guns/Battery/egun.rsi + state: base + product: CrateArmoryEgun + cost: 2500 + category: Armory + group: market diff --git a/Resources/Prototypes/Catalog/Fills/Crates/armory.yml b/Resources/Prototypes/Catalog/Fills/Crates/armory.yml index 868de3c824..1c1a19ad53 100644 --- a/Resources/Prototypes/Catalog/Fills/Crates/armory.yml +++ b/Resources/Prototypes/Catalog/Fills/Crates/armory.yml @@ -57,3 +57,12 @@ amount: 2 - id: MagazinePistol amount: 4 + +- type: entity + id: CrateArmoryEgun + parent: CrateWeaponSecure + components: + - type: StorageFill + contents: + - id: WeaponEgun + amount: 3 diff --git a/Resources/Prototypes/Catalog/Fills/Lockers/heads.yml b/Resources/Prototypes/Catalog/Fills/Lockers/heads.yml index 2d15ca826c..a419cdfb45 100644 --- a/Resources/Prototypes/Catalog/Fills/Lockers/heads.yml +++ b/Resources/Prototypes/Catalog/Fills/Lockers/heads.yml @@ -31,7 +31,7 @@ - id: CaptainIDCard - id: ClothingOuterHardsuitCap - id: ClothingMaskGasCaptain - - id: WeaponDisabler + - id: WeaponEgun - id: CommsComputerCircuitboard - id: ClothingHeadsetAltCommand - id: SpaceCash1000 @@ -85,7 +85,7 @@ - id: BoxID - id: BoxHeadset - id: IDComputerCircuitboard - - id: WeaponDisabler + - id: WeaponEgun - id: CigarGoldCase prob: 0.25 # Fuck the HoP they don't deserve fucking cigars. @@ -258,7 +258,10 @@ - type: StorageFill contents: - id: ClothingEyesHudSecurity - - id: WeaponDisabler + - id: WeaponEgun + - id: ClothingHeadHatBeretHoS + - id: ClothingHeadHatHoshat + - id: ClothingNeckCloakHos - id: ClothingOuterCoatHoSTrench - id: ClothingBeltSecurityFilled - id: ClothingHeadsetAltSecurity diff --git a/Resources/Prototypes/Catalog/Fills/Lockers/security.yml b/Resources/Prototypes/Catalog/Fills/Lockers/security.yml index 3ca83114aa..86e3eb3f44 100644 --- a/Resources/Prototypes/Catalog/Fills/Lockers/security.yml +++ b/Resources/Prototypes/Catalog/Fills/Lockers/security.yml @@ -30,8 +30,9 @@ - type: StorageFill contents: - id: FlashlightSeclite - - id: WeaponDisabler - prob: 0.3 + - id: WeaponEgun + - id: ClothingHeadHatWarden + - id: ClothingHeadHatBeretWarden - id: ClothingBeltSecurityFilled - id: Flash - id: ClothingEyesGlassesSunglasses @@ -68,6 +69,7 @@ - id: WeaponMeleeNeedle prob: 0.1 - id: ClothingEyesHudSecurity + - id: WeaponEgun - type: entity id: LockerBrigmedicFilled @@ -103,6 +105,7 @@ prob: 0.7 - id: ClothingNeckCloakMoth #bzzz Moth-pocalypse prob: 0.15 + - id: WeaponEgun - type: entity id: LockerDetectiveFilled diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml index 49c79bb8fc..b36af49041 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml @@ -355,7 +355,7 @@ walkModifier: 0.6 sprintModifier: 0.6 - type: HeldSpeedModifier - - type: Sprite + - type: Sprite sprite: Objects/Weapons/Guns/Battery/particle_decelerator.rsi layers: - state: base @@ -695,3 +695,41 @@ - type: Appearance - type: StaticPrice price: 750 + +- type: entity + name: egun + parent: BaseWeaponBattery + id: WeaponEgun + description: Egun + components: + - type: Sprite + sprite: Objects/Weapons/Guns/Battery/egun.rsi + layers: + - state: base + map: ["enum.GunVisualLayers.Base"] + - state: mag-twomode1-4 + map: ["enum.GunVisualLayers.TwoModeFirst"] + shader: unshaded + - state: mag-twomode2-4 + map: ["enum.GunVisualLayers.TwoModeSecond"] + shader: unshaded + - type: Clothing + sprite: Objects/Weapons/Guns/Battery/egun.rsi + - type: Gun + soundGunshot: + path: /Audio/Weapons/Guns/Gunshots/taser2.ogg + - type: TwoModeEnergyAmmoProvider + projProto: BulletDisabler + fireCost: 50 + projFireCost: 50 + hitscanProto: RedLaser + hitscanFireCost: 100 + projSound: "/Audio/Weapons/Guns/Gunshots/taser2.ogg" + hitscanSound: "/Audio/Weapons/Guns/Gunshots/laser_cannon.ogg" + - type: MagazineVisuals + magState: mag + steps: 5 + zeroVisible: true + - type: Appearance + - type: StaticPrice + price: 800 diff --git a/Resources/Prototypes/Entities/Structures/Power/chargers.yml b/Resources/Prototypes/Entities/Structures/Power/chargers.yml index 7630610bd8..c6de584f23 100644 --- a/Resources/Prototypes/Entities/Structures/Power/chargers.yml +++ b/Resources/Prototypes/Entities/Structures/Power/chargers.yml @@ -108,6 +108,7 @@ - HitscanBatteryAmmoProvider - ProjectileBatteryAmmoProvider - Stunbaton + - TwoModeEnergyAmmoProvider - type: entity parent: BaseItemRecharger @@ -125,6 +126,7 @@ - type: WallMount - type: Charger chargeRate: 25 + slotId: charger_slot - type: ItemSlots slots: charger_slot: @@ -134,6 +136,7 @@ - HitscanBatteryAmmoProvider - ProjectileBatteryAmmoProvider - Stunbaton + - TwoModeEnergyAmmoProvider - type: entity parent: BaseRecharger diff --git a/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/base.png b/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/base.png new file mode 100644 index 0000000000..909a4987de Binary files /dev/null and b/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/base.png differ diff --git a/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/equipped-BACKPACK.png b/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/equipped-BACKPACK.png new file mode 100644 index 0000000000..aff8583f5e Binary files /dev/null and b/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/equipped-BACKPACK.png differ diff --git a/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/icon.png b/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/icon.png new file mode 100644 index 0000000000..909a4987de Binary files /dev/null and b/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/icon.png differ diff --git a/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/inhand-left.png b/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/inhand-left.png new file mode 100644 index 0000000000..3abfba8627 Binary files /dev/null and b/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/inhand-left.png differ diff --git a/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/inhand-right.png b/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/inhand-right.png new file mode 100644 index 0000000000..5623d9cbbb Binary files /dev/null and b/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/inhand-right.png differ diff --git a/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/laser-inhand-left.png b/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/laser-inhand-left.png new file mode 100644 index 0000000000..fec0020e76 Binary files /dev/null and b/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/laser-inhand-left.png differ diff --git a/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/laser-inhand-right.png b/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/laser-inhand-right.png new file mode 100644 index 0000000000..b41b86e698 Binary files /dev/null and b/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/laser-inhand-right.png differ diff --git a/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/mag-twomode1-0.png b/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/mag-twomode1-0.png new file mode 100644 index 0000000000..4db92c967d Binary files /dev/null and b/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/mag-twomode1-0.png differ diff --git a/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/mag-twomode1-1.png b/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/mag-twomode1-1.png new file mode 100644 index 0000000000..057e117738 Binary files /dev/null and b/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/mag-twomode1-1.png differ diff --git a/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/mag-twomode1-2.png b/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/mag-twomode1-2.png new file mode 100644 index 0000000000..93421c8792 Binary files /dev/null and b/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/mag-twomode1-2.png differ diff --git a/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/mag-twomode1-3.png b/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/mag-twomode1-3.png new file mode 100644 index 0000000000..e2b1342a6e Binary files /dev/null and b/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/mag-twomode1-3.png differ diff --git a/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/mag-twomode1-4.png b/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/mag-twomode1-4.png new file mode 100644 index 0000000000..f54b3652c9 Binary files /dev/null and b/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/mag-twomode1-4.png differ diff --git a/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/mag-twomode2-0.png b/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/mag-twomode2-0.png new file mode 100644 index 0000000000..4db92c967d Binary files /dev/null and b/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/mag-twomode2-0.png differ diff --git a/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/mag-twomode2-1.png b/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/mag-twomode2-1.png new file mode 100644 index 0000000000..f000d0bd6d Binary files /dev/null and b/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/mag-twomode2-1.png differ diff --git a/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/mag-twomode2-2.png b/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/mag-twomode2-2.png new file mode 100644 index 0000000000..f7dd0fc86d Binary files /dev/null and b/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/mag-twomode2-2.png differ diff --git a/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/mag-twomode2-3.png b/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/mag-twomode2-3.png new file mode 100644 index 0000000000..960d8f9c81 Binary files /dev/null and b/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/mag-twomode2-3.png differ diff --git a/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/mag-twomode2-4.png b/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/mag-twomode2-4.png new file mode 100644 index 0000000000..3db83e4dc9 Binary files /dev/null and b/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/mag-twomode2-4.png differ diff --git a/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/meta.json b/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/meta.json new file mode 100644 index 0000000000..e503b81db7 --- /dev/null +++ b/Resources/Textures/Objects/Weapons/Guns/Battery/egun.rsi/meta.json @@ -0,0 +1,79 @@ +{ + "version": 1, + "license": "CC-BY-SA-3.0", + "copyright": "Taken from White at https://github.com/frosty-dev/white", + "size": { + "x": 32, + "y": 32 + }, + "states": [ + { + "name": "icon" + }, + { + "name": "base" + }, + { + "name": "mag-twomode1-0", + "delays": [ + [ + 0.3, + 0.3 + ] + ] + }, + { + "name": "mag-twomode1-1" + }, + { + "name": "mag-twomode1-2" + }, + { + "name": "mag-twomode1-3" + }, + { + "name": "mag-twomode1-4" + }, + { + "name": "mag-twomode2-0", + "delays": [ + [ + 0.3, + 0.3 + ] + ] + }, + { + "name": "mag-twomode2-1" + }, + { + "name": "mag-twomode2-2" + }, + { + "name": "mag-twomode2-3" + }, + { + "name": "mag-twomode2-4" + }, + { + "name": "inhand-left", + "directions": 4 + }, + { + "name": "inhand-right", + "directions": 4 + }, + { + "name": "laser-inhand-left", + "directions": 4 + }, + { + "name": "laser-inhand-right", + "directions": 4 + }, + { + "name": "equipped-BACKPACK", + "directions": 4 + } + ] +}