mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-18 05:59:03 +03:00
* Reapply "Hot reload 2: Electric Boogaloo" (#524)
This reverts commit d856b8e7a0.
(cherry picked from commit c02e513f4f26877f2fc69478a0701ab9e751d603)
* blya
(cherry picked from commit 777edbfbd9ef560c511505e4811d1d59ce4c81ee)
66 lines
2.2 KiB
C#
66 lines
2.2 KiB
C#
using Robust.Shared.Prototypes;
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
|
using Content.Server.DeltaV.Weapons.Ranged.Systems;
|
|
|
|
namespace Content.Server.DeltaV.Weapons.Ranged.Components;
|
|
|
|
/// <summary>
|
|
/// Allows for energy gun to switch between three modes. This also changes the sprite accordingly.
|
|
/// </summary>
|
|
/// <remarks>This is BatteryWeaponFireModesSystem with additional changes to allow for different sprites.</remarks>
|
|
[RegisterComponent]
|
|
[Access(typeof(EnergyGunSystem))]
|
|
[AutoGenerateComponentState]
|
|
public sealed partial class EnergyGunComponent : Component
|
|
{
|
|
/// <summary>
|
|
/// A list of the different firing modes the energy gun can switch between
|
|
/// </summary>
|
|
[DataField("fireModes", required: true)]
|
|
[AutoNetworkedField]
|
|
public List<EnergyWeaponFireMode> FireModes = new();
|
|
|
|
/// <summary>
|
|
/// The currently selected firing mode
|
|
/// </summary>
|
|
//[DataField("currentFireMode")] // WWDP EDIT - It just doesn't make much sense to make this a datafield. Just put the default firemode first in the FireModes list.
|
|
[AutoNetworkedField]
|
|
public EnergyWeaponFireMode? CurrentFireMode = default!;
|
|
}
|
|
|
|
[DataDefinition]
|
|
public sealed partial class EnergyWeaponFireMode
|
|
{
|
|
/// <summary>
|
|
/// The projectile prototype associated with this firing mode
|
|
/// </summary>
|
|
[DataField("proto", required: true, customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
|
|
public string Prototype = default!;
|
|
|
|
/// <summary>
|
|
/// The battery cost to fire the projectile associated with this firing mode
|
|
/// </summary>
|
|
[DataField("fireCost")]
|
|
public float FireCost = 100;
|
|
|
|
// WWDP EDIT START
|
|
/// <summary>
|
|
/// The battery cost to fire the projectile associated with this firing mode
|
|
/// </summary>
|
|
[DataField]
|
|
public float HeatCost = 50;
|
|
// WWDP EDIT END
|
|
|
|
/// <summary>
|
|
/// The name of the selected firemode
|
|
/// </summary>
|
|
[DataField("name")]
|
|
public string Name = string.Empty;
|
|
|
|
/// <summary>
|
|
/// What RsiState we use for that firemode if it needs to change.
|
|
/// </summary>
|
|
[DataField("state")]
|
|
public string State = string.Empty;
|
|
}
|