Add moon boots (#29009)

This commit is contained in:
Nemanja
2024-06-14 23:43:23 -04:00
committed by GitHub
parent 06c8238164
commit 748e5831e8
23 changed files with 211 additions and 124 deletions

View File

@@ -1,31 +0,0 @@
namespace Content.Server.Atmos.Components
{
// Unfortunately can't be friends yet due to magboots.
[RegisterComponent]
public sealed partial class MovedByPressureComponent : Component
{
public const float MoveForcePushRatio = 1f;
public const float MoveForceForcePushRatio = 1f;
public const float ProbabilityOffset = 25f;
public const float ProbabilityBasePercent = 10f;
public const float ThrowForce = 100f;
/// <summary>
/// Accumulates time when yeeted by high pressure deltas.
/// </summary>
[DataField("accumulator")]
public float Accumulator = 0f;
[ViewVariables(VVAccess.ReadWrite)]
[DataField("enabled")]
public bool Enabled { get; set; } = true;
[ViewVariables(VVAccess.ReadWrite)]
[DataField("pressureResistance")]
public float PressureResistance { get; set; } = 1f;
[ViewVariables(VVAccess.ReadWrite)]
[DataField("moveResist")]
public float MoveResist { get; set; } = 100f;
[ViewVariables(VVAccess.ReadWrite)]
public int LastHighPressureMovementAirCycle { get; set; } = 0;
}
}

View File

@@ -1,5 +1,6 @@
using Content.Server.Atmos.Components;
using Content.Shared.Atmos;
using Content.Shared.Atmos.Components;
using Content.Shared.Mobs.Components;
using Content.Shared.Physics;
using Robust.Shared.Audio;

View File

@@ -1,49 +0,0 @@
using Content.Server.Atmos.Components;
using Content.Shared.Alert;
using Content.Shared.Clothing;
namespace Content.Server.Clothing;
public sealed class MagbootsSystem : SharedMagbootsSystem
{
[Dependency] private readonly AlertsSystem _alerts = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<MagbootsComponent, ClothingGotEquippedEvent>(OnGotEquipped);
SubscribeLocalEvent<MagbootsComponent, ClothingGotUnequippedEvent>(OnGotUnequipped);
}
protected override void UpdateMagbootEffects(EntityUid parent, EntityUid uid, bool state, MagbootsComponent? component)
{
if (!Resolve(uid, ref component))
return;
state = state && component.On;
if (TryComp(parent, out MovedByPressureComponent? movedByPressure))
{
movedByPressure.Enabled = !state;
}
if (state)
{
_alerts.ShowAlert(parent, component.MagbootsAlert);
}
else
{
_alerts.ClearAlert(parent, component.MagbootsAlert);
}
}
private void OnGotUnequipped(EntityUid uid, MagbootsComponent component, ref ClothingGotUnequippedEvent args)
{
UpdateMagbootEffects(args.Wearer, uid, false, component);
}
private void OnGotEquipped(EntityUid uid, MagbootsComponent component, ref ClothingGotEquippedEvent args)
{
UpdateMagbootEffects(args.Wearer, uid, true, component);
}
}

View File

@@ -1,4 +1,4 @@
using Content.Server.Atmos.Components;
using Content.Shared.Atmos.Components;
using Content.Shared.Damage.Components;
using Content.Shared.Damage.Systems;

View File

@@ -1,7 +1,6 @@
using Content.Shared.Gravity;
using JetBrains.Annotations;
using Robust.Shared.Map.Components;
using Robust.Shared.Utility;
namespace Content.Server.Gravity
{

View File

@@ -1,6 +1,6 @@
using System.Numerics;
using Content.Server.Atmos.Components;
using Content.Server.Singularity.Components;
using Content.Shared.Atmos.Components;
using Content.Shared.Ghost;
using Content.Shared.Singularity.EntitySystems;
using Robust.Shared.Map;