+++ /dev/null
-using Content.Shared.Clothing;
-
-namespace Content.Client.Clothing;
-
-public sealed class MagbootsSystem : SharedMagbootsSystem
-{
-
-}
+++ /dev/null
-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;
- }
-}
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;
+++ /dev/null
-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);
- }
-}
-using Content.Server.Atmos.Components;
+using Content.Shared.Atmos.Components;
using Content.Shared.Damage.Components;
using Content.Shared.Damage.Systems;
using Content.Shared.Gravity;
using JetBrains.Annotations;
using Robust.Shared.Map.Components;
-using Robust.Shared.Utility;
namespace Content.Server.Gravity
{
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;
--- /dev/null
+namespace Content.Shared.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]
+ public float Accumulator;
+
+ [DataField]
+ public bool Enabled { get; set; } = true;
+
+ [DataField]
+ public float PressureResistance { get; set; } = 1f;
+
+ [DataField]
+ public float MoveResist { get; set; } = 100f;
+
+ [ViewVariables(VVAccess.ReadWrite)]
+ public int LastHighPressureMovementAirCycle { get; set; } = 0;
+}
+
--- /dev/null
+using Robust.Shared.GameStates;
+
+namespace Content.Shared.Clothing.Components;
+
+/// <summary>
+/// This is used for clothing that makes an entity weightless when worn.
+/// </summary>
+[RegisterComponent, NetworkedComponent]
+public sealed partial class AntiGravityClothingComponent : Component;
--- /dev/null
+using Content.Shared.Clothing.Components;
+using Content.Shared.Gravity;
+using Content.Shared.Inventory;
+
+namespace Content.Shared.Clothing.EntitySystems;
+
+public sealed class AntiGravityClothingSystem : EntitySystem
+{
+ /// <inheritdoc/>
+ public override void Initialize()
+ {
+ SubscribeLocalEvent<AntiGravityClothingComponent, InventoryRelayedEvent<IsWeightlessEvent>>(OnIsWeightless);
+ }
+
+ private void OnIsWeightless(Entity<AntiGravityClothingComponent> ent, ref InventoryRelayedEvent<IsWeightlessEvent> args)
+ {
+ if (args.Args.Handled)
+ return;
+
+ args.Args.Handled = true;
+ args.Args.IsWeightless = true;
+ }
+}
using Content.Shared.Actions;
+using Content.Shared.Alert;
+using Content.Shared.Atmos.Components;
using Content.Shared.Clothing.EntitySystems;
+using Content.Shared.Gravity;
using Content.Shared.Inventory;
using Content.Shared.Item;
using Content.Shared.Slippery;
namespace Content.Shared.Clothing;
-public abstract class SharedMagbootsSystem : EntitySystem
+public sealed class SharedMagbootsSystem : EntitySystem
{
+ [Dependency] private readonly AlertsSystem _alerts = default!;
[Dependency] private readonly ClothingSpeedModifierSystem _clothingSpeedModifier = default!;
[Dependency] private readonly ClothingSystem _clothing = default!;
[Dependency] private readonly InventorySystem _inventory = default!;
SubscribeLocalEvent<MagbootsComponent, GetItemActionsEvent>(OnGetActions);
SubscribeLocalEvent<MagbootsComponent, ToggleMagbootsEvent>(OnToggleMagboots);
SubscribeLocalEvent<MagbootsComponent, MapInitEvent>(OnMapInit);
+
+ SubscribeLocalEvent<MagbootsComponent, ClothingGotEquippedEvent>(OnGotEquipped);
+ SubscribeLocalEvent<MagbootsComponent, ClothingGotUnequippedEvent>(OnGotUnequipped);
+
+ SubscribeLocalEvent<MagbootsComponent, InventoryRelayedEvent<IsWeightlessEvent>>(OnIsWeightless);
}
private void OnMapInit(EntityUid uid, MagbootsComponent component, MapInitEvent args)
Dirty(uid, component);
}
+ 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);
+ }
+
private void OnToggleMagboots(EntityUid uid, MagbootsComponent component, ToggleMagbootsEvent args)
{
if (args.Handled)
{
magboots.On = !magboots.On;
- if (_sharedContainer.TryGetContainingContainer(uid, out var container) &&
+ if (_sharedContainer.TryGetContainingContainer((uid, Transform(uid)), out var container) &&
_inventory.TryGetSlotEntity(container.Owner, "shoes", out var entityUid) && entityUid == uid)
+ {
UpdateMagbootEffects(container.Owner, uid, true, magboots);
+ }
if (TryComp<ItemComponent>(uid, out var item))
{
Dirty(uid, magboots);
}
- protected virtual void UpdateMagbootEffects(EntityUid parent, EntityUid uid, bool state, MagbootsComponent? component) { }
+ public 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;
+ }
- protected void OnChanged(EntityUid uid, MagbootsComponent component)
+ if (state)
+ {
+ _alerts.ShowAlert(parent, component.MagbootsAlert);
+ }
+ else
+ {
+ _alerts.ClearAlert(parent, component.MagbootsAlert);
+ }
+ }
+
+ private void OnChanged(EntityUid uid, MagbootsComponent component)
{
_sharedActions.SetToggled(component.ToggleActionEntity, component.On);
_clothingSpeedModifier.SetClothingSpeedModifierEnabled(uid, component.On);
if (!args.CanAccess || !args.CanInteract)
return;
- ActivationVerb verb = new();
- verb.Text = Loc.GetString("toggle-magboots-verb-get-data-text");
- verb.Act = () => ToggleMagboots(uid, component);
- // TODO VERB ICON add toggle icon? maybe a computer on/off symbol?
+ ActivationVerb verb = new()
+ {
+ Text = Loc.GetString("toggle-magboots-verb-get-data-text"),
+ Act = () => ToggleMagboots(uid, component),
+ // TODO VERB ICON add toggle icon? maybe a computer on/off symbol?
+ };
args.Verbs.Add(verb);
}
{
args.AddAction(ref component.ToggleActionEntity, component.ToggleAction);
}
+
+ private void OnIsWeightless(Entity<MagbootsComponent> ent, ref InventoryRelayedEvent<IsWeightlessEvent> args)
+ {
+ if (args.Args.Handled)
+ return;
+
+ if (!ent.Comp.On)
+ return;
+
+ args.Args.IsWeightless = false;
+ args.Args.Handled = true;
+ }
}
-public sealed partial class ToggleMagbootsEvent : InstantActionEvent {}
+public sealed partial class ToggleMagbootsEvent : InstantActionEvent;
using Content.Shared.Alert;
-using Content.Shared.Clothing;
using Content.Shared.Inventory;
using Content.Shared.Movement.Components;
using Robust.Shared.GameStates;
-using Robust.Shared.Map;
using Robust.Shared.Physics;
using Robust.Shared.Physics.Components;
using Robust.Shared.Serialization;
{
[Dependency] protected readonly IGameTiming Timing = default!;
[Dependency] private readonly AlertsSystem _alerts = default!;
- [Dependency] private readonly InventorySystem _inventory = default!;
[ValidatePrototypeId<AlertPrototype>]
public const string WeightlessAlert = "Weightless";
if (TryComp<MovementIgnoreGravityComponent>(uid, out var ignoreGravityComponent))
return ignoreGravityComponent.Weightless;
+ var ev = new IsWeightlessEvent(uid);
+ RaiseLocalEvent(uid, ref ev);
+ if (ev.Handled)
+ return ev.IsWeightless;
+
if (!Resolve(uid, ref xform))
return true;
return false;
}
- var hasGrav = gravity != null || mapGravity != null;
-
- // Check for something holding us down
- // If the planet has gravity component and no gravity it will still give gravity
- // If there's no gravity comp at all (i.e. space) then they don't work.
- if (hasGrav && _inventory.TryGetSlotEntity(uid, "shoes", out var ent))
- {
- // TODO this should just be a event that gets relayed instead of a specific slot & component check.
- if (TryComp<MagbootsComponent>(ent, out var boots) && boots.On)
- return false;
- }
-
return true;
}
private void OnHandleState(EntityUid uid, GravityComponent component, ref ComponentHandleState args)
{
- if (args.Current is not GravityComponentState state) return;
+ if (args.Current is not GravityComponentState state)
+ return;
- if (component.EnabledVV == state.Enabled) return;
+ if (component.EnabledVV == state.Enabled)
+ return;
component.EnabledVV = state.Enabled;
var ev = new GravityChangedEvent(uid, component.EnabledVV);
RaiseLocalEvent(uid, ref ev, true);
private void OnGravityChange(ref GravityChangedEvent ev)
{
var alerts = AllEntityQuery<AlertsComponent, TransformComponent>();
- while(alerts.MoveNext(out var uid, out var comp, out var xform))
+ while(alerts.MoveNext(out var uid, out _, out var xform))
{
- if (xform.GridUid != ev.ChangedGridIndex) continue;
+ if (xform.GridUid != ev.ChangedGridIndex)
+ continue;
if (!ev.HasGravity)
{
}
}
}
+
+ [ByRefEvent]
+ public record struct IsWeightlessEvent(EntityUid Entity, bool IsWeightless = false, bool Handled = false) : IInventoryRelayEvent
+ {
+ SlotFlags IInventoryRelayEvent.TargetSlots => ~SlotFlags.POCKET;
+ }
}
using Content.Shared.Electrocution;
using Content.Shared.Explosion;
using Content.Shared.Eye.Blinding.Systems;
+using Content.Shared.Gravity;
using Content.Shared.IdentityManagement.Components;
using Content.Shared.Inventory.Events;
using Content.Shared.Movement.Systems;
// by-ref events
SubscribeLocalEvent<InventoryComponent, GetExplosionResistanceEvent>(RefRelayInventoryEvent);
+ SubscribeLocalEvent<InventoryComponent, IsWeightlessEvent>(RefRelayInventoryEvent);
// Eye/vision events
SubscribeLocalEvent<InventoryComponent, CanSeeAttemptEvent>(RelayInventoryEvent);
event: !type:ToggleClothingSpeedEvent
icon: { sprite: Clothing/Shoes/Boots/speedboots.rsi, state: icon }
iconOn: { sprite: Clothing/Shoes/Boots/speedboots.rsi, state: icon-on }
+
+- type: entity
+ parent: ClothingShoesBase
+ id: ClothingShoesBootsMoon
+ name: moon boots
+ description: Special anti-gravity boots developed with a speciality blend of lunar rock gel. Shipped from the Netherlands.
+ components:
+ - type: Sprite
+ sprite: Clothing/Shoes/Boots/moonboots.rsi
+ layers:
+ - state: icon
+ - type: Clothing
+ sprite: Clothing/Shoes/Boots/moonboots.rsi
+ - type: AntiGravityClothing
+ - type: StaticPrice
+ price: 75
+ - type: Tag
+ tags: [ ]
- MagazineBoxRifle
- MagazineLightRifle
- MagazineLightRifleEmpty
- - MagazinePistol
+ - MagazinePistol
- MagazinePistolEmpty
- MagazinePistolSubMachineGun
- MagazinePistolSubMachineGunEmpty
- WeaponGauntletGorilla
- SynthesizerInstrument
- ClothingShoesBootsMagSci
+ - ClothingShoesBootsMoon
- ClothingShoesBootsSpeed
- NodeScanner
- HolofanProjector
staticRecipes:
- BoxLethalshot
- BoxShotgunFlare
- - BoxShotgunPractice
+ - BoxShotgunPractice
- BoxShotgunSlug
- ClothingEyesHudSecurity
- CombatKnife
- MagazineBoxRiflePractice
- MagazineLightRifle
- MagazineLightRifleEmpty
- - MagazinePistol
+ - MagazinePistol
- MagazinePistolEmpty
- MagazinePistolSubMachineGun
- MagazinePistolSubMachineGunEmpty
- MagazineBoxRifle
- MagazineLightRifle
- MagazineLightRifleEmpty
- - MagazinePistol
- - MagazinePistolEmpty
+ - MagazinePistol
+ - MagazinePistolEmpty
- MagazineRifle
- MagazineRifleEmpty
- MagazineShotgun
Steel: 1000
Plastic: 500
+- type: latheRecipe
+ id: ClothingShoesBootsMoon
+ result: ClothingShoesBootsMoon
+ completetime: 2
+ materials:
+ Steel: 600
+
- type: latheRecipe
id: ClothingShoesBootsSpeed
result: ClothingShoesBootsSpeed
cost: 7500
recipeUnlocks:
- ClothingShoesBootsMagSci
+ - ClothingShoesBootsMoon
- type: technology
id: AnomalyCoreHarnessing
--- /dev/null
+{
+ "version": 1,
+ "license": "CC-BY-SA-3.0",
+ "copyright": "Taken from Tau Ceti Station at commit https://github.com/TauCetiStation/TauCetiClassic/blob/HEAD/icons/obj/clothing/shoes.dmi",
+ "size": {
+ "x": 32,
+ "y": 32
+ },
+ "states": [
+ {
+ "name": "icon"
+ },
+ {
+ "name": "equipped-FEET",
+ "directions": 4
+ },
+ {
+ "name": "equipped-FEET-vox",
+ "directions": 4
+ },
+ {
+ "name": "inhand-left",
+ "directions": 4
+ },
+ {
+ "name": "inhand-right",
+ "directions": 4
+ }
+ ]
+}