CatStation/Content.Shared/Vehicle/Components/VehicleComponent.cs
AndrewFenriz f327d7992e
Add generic container vehicle entry and exit handling (#45354)
* remove PilotSlot

* cleanup mechcomp

* move enter/eject to VehicleSystem

* ContainerVehicleEntryComponent

* move DragDrop to VehicleSystem.Entry

* and again

* move enter verb

* move exit...

* move to shared

* docs

* [Access(typeof(VehicleSystem))]

* Update Resources/Locale/en-US/mech/mech.ftl

Co-authored-by: Whatstone <166147148+whatston3@users.noreply.github.com>

* move popups to component

* move all events to VehicleEvents

* no more UsedImplicitly

* fix proto :0

* fix EntryDeniedPopup

* update Entry and Operator

* entityquery

---------

Co-authored-by: Whatstone <166147148+whatston3@users.noreply.github.com>
2026-08-15 00:32:39 +00:00

61 lines
2 KiB
C#

using Content.Shared.Damage;
using Content.Shared.Vehicle.Systems;
using Content.Shared.Whitelist;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared.Vehicle.Components;
/// <summary>
/// Vehicles are objects that have the behavior of moving when a player "operates" them.
/// The details of when the vehicle can operate and who the operator is are not defined here.
/// This simply contains the baseline behavior of the vehicle itself.
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(fieldDeltas: true)]
[Access(typeof(VehicleSystem))]
public sealed partial class VehicleComponent : Component
{
/// <summary>
/// The driver of this vehicle.
/// </summary>
[DataField, AutoNetworkedField]
public EntityUid? Operator;
/// <summary>
/// Simple whitelist for determining who can operate this vehicle.
/// </summary>
[DataField, AutoNetworkedField]
public EntityWhitelist? OperatorWhitelist;
/// <summary>
/// If true, damage to the vehicle will be transferred to the operator.
/// This damage is modified by <see cref="TransferDamageModifier"/>
/// </summary>
[DataField, AutoNetworkedField]
public bool TransferDamage = true;
/// <summary>
/// A damage modifier set that adjusts the damage passed from the vehicle to the operator.
/// </summary>
[DataField, AutoNetworkedField]
public DamageModifierSet? TransferDamageModifier;
/// <summary>
/// Whether the operator requires hands to operate this vehicle.
/// </summary>
[DataField, AutoNetworkedField]
public bool RequiresHands = true;
/// <summary>
/// Whether the operator can attack while operating this vehicle.
/// </summary>
[DataField, AutoNetworkedField]
public bool CanAttack;
}
[Serializable, NetSerializable]
public enum VehicleVisuals : byte
{
HasOperator, // The vehicle has a valid operator
CanRun // The vehicle can be moved by the operator (turned on :flushed:)
}