* mechs * interaction relay * atmos handling * fuck around with interaction events SPAGHETTI CODE OH MY GOD * more sprites and whatever the hell * more mech shit * more shit for equipment * starting equipment (for nukie mechs and such) * equipment cycling * starting with some of the ui * a fat chunk of ui prototyping * done tinkering with ui * a bunch of ui stuff and what have yous * cleaning up grabber and state handling * make the ui actually functional + watch me port a million icons I swear i'll prune the sprites later blease * start on construction * construction yo mamma * remove some unused files * fix a silly * make the graph sane * make it actually constructible. * print the boards as well, bozo * rebalance part prices * eject action also i appease the russians by remembering to localize * Punch Shit * make mech integrity and repairs work * Make the UI more based STOMP STOMP STOMP STOMP * make equipment even more based * batteries and other such delights * make the ui look pimpin af * make the construction mega based * UI but so epic * equipment * some sweat tweaks * damage rebalancing * restructure tech * fix some shit * mechs inherit access * make icons actually use sprite specifiers * TRAILING COMMAA!!!!! * fix a mild indentation sin * undo this change because it isn't needed * actually fix this * secret webeditting shhhh * place this tech here * comments * foo
119 lines
3.2 KiB
C#
119 lines
3.2 KiB
C#
using System.Threading;
|
|
using Content.Server.Atmos;
|
|
using Content.Shared.Mech.Components;
|
|
using Robust.Shared.GameStates;
|
|
using Robust.Shared.Prototypes;
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
|
|
|
|
namespace Content.Server.Mech.Components;
|
|
|
|
/// <inheritdoc/>
|
|
[RegisterComponent, NetworkedComponent]
|
|
[ComponentReference(typeof(SharedMechComponent))]
|
|
public sealed class MechComponent : SharedMechComponent
|
|
{
|
|
/// <summary>
|
|
/// How long it takes to enter the mech.
|
|
/// </summary>
|
|
[DataField("entryDelay")]
|
|
public float EntryDelay = 3;
|
|
|
|
/// <summary>
|
|
/// How long it takes to pull *another person*
|
|
/// outside of the mech. You can exit instantly yourself.
|
|
/// </summary>
|
|
[DataField("exitDelay")]
|
|
public float ExitDelay = 3;
|
|
|
|
/// <summary>
|
|
/// How long it takes to pull out the battery.
|
|
/// </summary>
|
|
[DataField("batteryRemovalDelay")]
|
|
public float BatteryRemovalDelay = 2;
|
|
|
|
public CancellationTokenSource? EntryTokenSource;
|
|
|
|
/// <summary>
|
|
/// Whether or not the mech is airtight.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// This needs to be redone
|
|
/// when mech internals are added
|
|
/// </remarks>
|
|
[DataField("airtight"), 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("startingEquipment", customTypeSerializer: typeof(PrototypeIdListSerializer<EntityPrototype>))]
|
|
public List<string> StartingEquipment = new();
|
|
|
|
/// <summary>
|
|
/// The battery the mech initially has when it spawns
|
|
/// Good for admemes and nukie mechs.
|
|
/// </summary>
|
|
[DataField("startingBattery", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
|
|
public string? StartingBattery;
|
|
|
|
//TODO: this doesn't support a tank implant for mechs or anything like that
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
public GasMixture Air = new (GasMixVolume);
|
|
public const float GasMixVolume = 70f;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Event raised when a person successfully enters a mech
|
|
/// </summary>
|
|
public sealed class MechEntryFinishedEvent : EntityEventArgs
|
|
{
|
|
public EntityUid User;
|
|
|
|
public MechEntryFinishedEvent(EntityUid user)
|
|
{
|
|
User = user;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Event raised when a person fails to enter a mech
|
|
/// </summary>
|
|
public sealed class MechEntryCanclledEvent : EntityEventArgs
|
|
{
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// Event raised when a person successfully removes someone from a mech
|
|
/// </summary>
|
|
public sealed class MechExitFinishedEvent : EntityEventArgs
|
|
{
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// Event raised when a person fails to remove someone from a mech
|
|
/// </summary>
|
|
public sealed class MechExitCanclledEvent : EntityEventArgs
|
|
{
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// Event raised when the battery is successfully removed from the mech
|
|
/// </summary>
|
|
public sealed class MechRemoveBatteryFinishedEvent : EntityEventArgs
|
|
{
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// Event raised when the battery fails to be removed from the mech
|
|
/// </summary>
|
|
public sealed class MechRemoveBatteryCancelledEvent : EntityEventArgs
|
|
{
|
|
|
|
}
|