Files
wwdpublic/Content.Shared/Mech/Components/MechComponent.cs
sleepyyapril 6249942d3e Goob Mechs (#1611)
# Description

<!--
Explain this PR in as much detail as applicable

Some example prompts to consider:
How might this affect the game? The codebase?
What might be some alternatives to this?
How/Who does this benefit/hurt [the game/codebase]?
-->

We like mechs here, yeah?

---

# Changelog

<!--
You can add an author after the `🆑` to change the name that appears
in the changelog (ex: `🆑 Death`)
Leaving it blank will default to your GitHub display name
This includes all available types for the changelog
-->

🆑 Mocho, John Space
- tweak: The H.O.N.K. has received an airtight cabin for honk operations
in outer space.
- add: Added the Ripley MK-II, a heavy, slow all-purpose mech, featuring
a pressurized cabin for space operations.
- add: Added the Clarke, A fast moving mech for space travel, with built
in thrusters (not certain if they work properly though :trollface:)
- add: Added the Gygax, a lightly armored and highly mobile mech with
enough force to rip walls, or someone's head off.
- add: Added the Durand, a slow but beefy combat suit that you dont want
to fight in close quarters.
- add: Added the Marauder, a specialized mech issued to ERT operatives.
- add: Added the Seraph, a specialized combat suit issued to ???
operatives.
- add: The syndicate has started issuing units under the codenames "Dark
Gygax" and "Mauler" to syndicate agents at an introductory price.
- add: The exosuit fabricator can now be emagged to reveal new recipes.
- add: There are 4 new bounties cargo can fulfill for mechs. Feedback on
the cost/reward is welcome!

---------

Signed-off-by: sleepyyapril <123355664+sleepyyapril@users.noreply.github.com>
Co-authored-by: John Space <bigdumb421@gmail.com>
Co-authored-by: gluesniffler <159397573+gluesniffler@users.noreply.github.com>
Co-authored-by: ScyronX <166930367+ScyronX@users.noreply.github.com>

(cherry picked from commit e3003b67014565816e83556c826a8bba344aac94)
2025-01-23 08:06:20 +03:00

172 lines
5.2 KiB
C#

using Content.Shared.FixedPoint;
using Content.Shared.Whitelist;
using Robust.Shared.Containers;
using Robust.Shared.GameStates;
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>
/// Goobstation: 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>
/// 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 = 3;
/// <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 Action Prototypes
[DataField]
public EntProtoId MechCycleAction = "ActionMechCycleEquipment";
[DataField]
public EntProtoId ToggleAction = "ActionToggleLight"; //Goobstation Mech Lights toggle action
[DataField]
public EntProtoId MechUiAction = "ActionMechOpenUI";
[DataField]
public EntProtoId MechEjectAction = "ActionMechEject";
#endregion
#region Visualizer States
[DataField]
public string? BaseState;
[DataField]
public string? OpenState;
[DataField]
public string? BrokenState;
#endregion
[DataField] public EntityUid? MechCycleActionEntity;
[DataField] public EntityUid? MechUiActionEntity;
[DataField] public EntityUid? MechEjectActionEntity;
[DataField, AutoNetworkedField] public EntityUid? ToggleActionEntity; //Goobstation Mech Lights toggle action
}