* mech system, fix hands, fix fraction * fix * fix fake hypo * fix triple airlocks big sizing * fix * upd clown hulk * xd fix 2 * bigger exit delay * mechs reflect changes * guns changes * draike up * mechs in another category * add equipment * Revert "upd clown hulk" This reverts commit b8084967040be5d442b2d4770cf7fdece1daa2a8. * SPIN MY MECH ASS * mech no rot * some resprite * no injections in hardsuits * some species can not be injectable * medipans can ignore armor, admeme hypospray ignore armor * fix * fix admeme hypo * mob fraction fix * rover + nt gygax add * fix description * fix id * some better dome effects * если пустая гильза в стволе -> Кнопки "казнь" не будет * phazon added * fix server crashes * full rework mechs on mobstates, coils fix mechs, diagnostic hud show health bar for mechs, mechs fastest repair, add mech analyzer * some fixes * configure health of all mechs * upd * add rover to uplink * translate bundle * change price * phazon construction * fix * fix * Finish phazon construction * add phazon research and recipes * phazon construction translate * fix * Mech lights * fix * translate light action * Mech sounds, fix damage * fix * fix hello sound * upd * fix linter * change damagePercentage * fix * fix hello sound * temp disable damage sounds * fix battery needed on construct * some changes * add mech painting system as DEBUG(in dev) * Fix yaml, durand paintings * mech spray cans textures * change sprite * fix * ripley, clarke new textures * ripley,clarke paints * fix * sec pod texture --------- Co-authored-by: Vigers Ray <60344369+VigersRay@users.noreply.github.com>
194 lines
6.2 KiB
C#
194 lines
6.2 KiB
C#
using Content.Shared.FixedPoint;
|
|
using Content.Shared.Whitelist;
|
|
using Robust.Shared.Audio;
|
|
using Robust.Shared.Containers;
|
|
using Robust.Shared.GameStates;
|
|
using Robust.Shared.Serialization;
|
|
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.Shared.Mech.Components;
|
|
|
|
/// <summary>
|
|
/// A large, pilotable machine that has equipment that is
|
|
/// powered via an internal battery.
|
|
/// </summary>
|
|
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
|
public sealed partial class MechComponent : Component
|
|
{
|
|
/// <summary>
|
|
/// Whether or not an emag disables it.
|
|
/// </summary>
|
|
[DataField("breakOnEmag")]
|
|
[AutoNetworkedField]
|
|
public bool BreakOnEmag = true;
|
|
|
|
/// <summary>
|
|
/// How much "health" the mech has left.
|
|
/// </summary>
|
|
[ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
|
|
public FixedPoint2 Integrity;
|
|
|
|
/// <summary>
|
|
/// The maximum amount of damage the mech can take.
|
|
/// </summary>
|
|
[DataField, AutoNetworkedField, ViewVariables(VVAccess.ReadWrite)]
|
|
public FixedPoint2 MaxIntegrity = 250;
|
|
|
|
/// <summary>
|
|
/// How much energy the mech has.
|
|
/// Derived from the currently inserted battery.
|
|
/// </summary>
|
|
[ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
|
|
public FixedPoint2 Energy = 0;
|
|
|
|
/// <summary>
|
|
/// The maximum amount of energy the mech can have.
|
|
/// Derived from the currently inserted battery.
|
|
/// </summary>
|
|
[DataField, AutoNetworkedField, ViewVariables(VVAccess.ReadWrite)]
|
|
public FixedPoint2 MaxEnergy = 0;
|
|
|
|
/// <summary>
|
|
/// The slot the battery is stored in.
|
|
/// </summary>
|
|
[ViewVariables]
|
|
public ContainerSlot BatterySlot = default!;
|
|
|
|
[ViewVariables]
|
|
public readonly string BatterySlotId = "mech-battery-slot";
|
|
|
|
/// <summary>
|
|
/// A multiplier used to calculate how much of the damage done to a mech
|
|
/// is transfered to the pilot
|
|
/// </summary>
|
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
|
public float MechToPilotDamageMultiplier;
|
|
|
|
/// <summary>
|
|
/// Whether the mech has been destroyed and is no longer pilotable.
|
|
/// </summary>
|
|
[ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
|
|
public bool Broken = false;
|
|
|
|
/// <summary>
|
|
/// Whether the mech has toggled lights.
|
|
/// </summary>
|
|
[ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
|
|
public bool Lights = false;
|
|
|
|
/// <summary>
|
|
/// The slot the pilot is stored in.
|
|
/// </summary>
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
public ContainerSlot PilotSlot = default!;
|
|
|
|
[ViewVariables]
|
|
public readonly string PilotSlotId = "mech-pilot-slot";
|
|
|
|
/// <summary>
|
|
/// The current selected equipment of the mech.
|
|
/// If null, the mech is using just its fists.
|
|
/// </summary>
|
|
[ViewVariables, AutoNetworkedField]
|
|
public EntityUid? CurrentSelectedEquipment;
|
|
|
|
/// <summary>
|
|
/// The maximum amount of equipment items that can be installed in the mech
|
|
/// </summary>
|
|
[DataField("maxEquipmentAmount"), ViewVariables(VVAccess.ReadWrite)]
|
|
public int MaxEquipmentAmount = 3;
|
|
|
|
/// <summary>
|
|
/// A whitelist for inserting equipment items.
|
|
/// </summary>
|
|
[DataField]
|
|
public EntityWhitelist? EquipmentWhitelist;
|
|
|
|
[DataField]
|
|
public EntityWhitelist? PilotWhitelist;
|
|
|
|
/// <summary>
|
|
/// A container for storing the equipment entities.
|
|
/// </summary>
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
public Container EquipmentContainer = default!;
|
|
|
|
[ViewVariables]
|
|
public readonly string EquipmentContainerId = "mech-equipment-container";
|
|
|
|
/// <summary>
|
|
/// How long it takes to enter the mech.
|
|
/// </summary>
|
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
|
public float EntryDelay = 3;
|
|
|
|
/// <summary>
|
|
/// How long it takes to pull *another person*
|
|
/// outside of the mech. You can exit instantly yourself.
|
|
/// </summary>
|
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
|
public float ExitDelay = 6;
|
|
|
|
/// <summary>
|
|
/// How long it takes to pull out the battery.
|
|
/// </summary>
|
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
|
public float BatteryRemovalDelay = 2;
|
|
|
|
/// <summary>
|
|
/// Whether or not the mech is airtight.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// This needs to be redone
|
|
/// when mech internals are added
|
|
/// </remarks>
|
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
|
public bool Airtight;
|
|
|
|
/// <summary>
|
|
/// The equipment that the mech initially has when it spawns.
|
|
/// Good for things like nukie mechs that start with guns.
|
|
/// </summary>
|
|
[DataField]
|
|
public List<EntProtoId> StartingEquipment = new();
|
|
|
|
#region Sounds
|
|
[DataField]
|
|
public SoundSpecifier EnableLightSound = new SoundPathSpecifier("/Audio/_Sunrise/Mechs/mech_lights_enabled.ogg");
|
|
[DataField]
|
|
public SoundSpecifier DisableLightSound = new SoundPathSpecifier("/Audio/_Sunrise/Mechs/mech_lights_disabled.ogg");
|
|
[DataField]
|
|
public SoundSpecifier HelloSound = new SoundPathSpecifier("/Audio/_Sunrise/Mechs/mech_hello.ogg");
|
|
[DataField]
|
|
public SoundSpecifier Alert50 = new SoundPathSpecifier("/Audio/_Sunrise/Mechs/mech_alert_50.ogg");
|
|
[DataField]
|
|
public SoundSpecifier Alert25 = new SoundPathSpecifier("/Audio/_Sunrise/Mechs/mech_alert_25.ogg");
|
|
[DataField]
|
|
public SoundSpecifier Alert5 = new SoundPathSpecifier("/Audio/_Sunrise/Mechs/mech_alert_5.ogg");
|
|
#endregion
|
|
|
|
#region Action Prototypes
|
|
[DataField]
|
|
public EntProtoId MechCycleAction = "ActionMechCycleEquipment";
|
|
[DataField]
|
|
public EntProtoId MechUiAction = "ActionMechOpenUI";
|
|
[DataField]
|
|
public EntProtoId MechEjectAction = "ActionMechEject";
|
|
[DataField]
|
|
public EntProtoId MechLightsAction = "ActionMechLights";
|
|
#endregion
|
|
|
|
#region Visualizer States
|
|
[DataField, AutoNetworkedField]
|
|
public string? BaseState;
|
|
[DataField, AutoNetworkedField]
|
|
public string? OpenState;
|
|
[DataField, AutoNetworkedField]
|
|
public string? BrokenState;
|
|
#endregion
|
|
|
|
[DataField] public EntityUid? MechCycleActionEntity;
|
|
[DataField] public EntityUid? MechUiActionEntity;
|
|
[DataField] public EntityUid? MechEjectActionEntity;
|
|
[DataField] public EntityUid? MechLightsActionEntity;
|
|
}
|