mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 13:37:47 +03:00
# Description By extremely popular demand(Both internally, and from our downstreams), this PR reimplements Part Upgrading. Since some of the systems that this PR touches were substantially changed since the removal of Parts, I had to do a lot of very in depth by-hand edits of individual systems. Shockingly, the only one that really proved any trouble was Cloning System, so I'm genuinely surprised wizden didn't substantially touch any of these codes since removing parts.. # Changelog 🆑 - add: Part Upgrading has returned! --------- Signed-off-by: VMSolidus <evilexecutive@gmail.com> Co-authored-by: DEATHB4DEFEAT <77995199+DEATHB4DEFEAT@users.noreply.github.com>
79 lines
2.4 KiB
C#
79 lines
2.4 KiB
C#
using System.Numerics;
|
|
using Content.Server.Shuttles.Systems;
|
|
using Content.Shared.Construction.Prototypes;
|
|
using Content.Shared.Damage;
|
|
using Robust.Shared.GameStates;
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
|
|
|
namespace Content.Server.Shuttles.Components
|
|
{
|
|
[RegisterComponent, NetworkedComponent]
|
|
[Access(typeof(ThrusterSystem))]
|
|
public sealed partial class ThrusterComponent : Component
|
|
{
|
|
/// <summary>
|
|
/// Whether the thruster has been force to be enabled / disabled (e.g. VV, interaction, etc.)
|
|
/// </summary>
|
|
[DataField]
|
|
public bool Enabled { get; set; } = true;
|
|
|
|
/// <summary>
|
|
/// This determines whether the thruster is actually enabled for the purposes of thrust
|
|
/// </summary>
|
|
public bool IsOn;
|
|
|
|
// Need to serialize this because RefreshParts isn't called on Init and this will break post-mapinit maps!
|
|
[DataField]
|
|
public float Thrust = 100f;
|
|
|
|
[DataField]
|
|
public float BaseThrust = 100f;
|
|
|
|
[DataField("thrusterType")]
|
|
public ThrusterType Type = ThrusterType.Linear;
|
|
|
|
[DataField("burnShape")] public List<Vector2> BurnPoly = new()
|
|
{
|
|
new Vector2(-0.4f, 0.5f),
|
|
new Vector2(-0.1f, 1.2f),
|
|
new Vector2(0.1f, 1.2f),
|
|
new Vector2(0.4f, 0.5f)
|
|
};
|
|
|
|
/// <summary>
|
|
/// How much damage is done per second to anything colliding with our thrust.
|
|
/// </summary>
|
|
[DataField]
|
|
public DamageSpecifier? Damage = new();
|
|
|
|
[DataField]
|
|
public bool RequireSpace = true;
|
|
|
|
// Used for burns
|
|
|
|
public List<EntityUid> Colliding = new();
|
|
|
|
public bool Firing;
|
|
|
|
/// <summary>
|
|
/// Next time we tick damage for anyone colliding.
|
|
/// </summary>
|
|
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
|
|
public TimeSpan NextFire;
|
|
|
|
[DataField(customTypeSerializer: typeof(PrototypeIdSerializer<MachinePartPrototype>))]
|
|
public string MachinePartThrust = "Capacitor";
|
|
|
|
[DataField]
|
|
public float PartRatingThrustMultiplier = 1.5f;
|
|
}
|
|
|
|
public enum ThrusterType
|
|
{
|
|
Linear,
|
|
// Angular meaning rotational.
|
|
Angular,
|
|
}
|
|
}
|