Files
tbd-station-14/Content.Shared/Standing/StandingStateComponent.cs
Jacob Tong 8c853476fb Rework CollisionGroups (#7656)
* Replace Mob, Vault, and Small impassable with Mid, High, Low

* Remove CollisionGroup.Underplating

* Remove CollisionGroup.Passable

* Fix constructed APCs not being interactable

* Change firelocks to occlude

* Make pipe inherit from BaseItem

* Clean up pipes

* Remove duplicate physics and fixtures from bucket

* Rework CollisionGroups on all entities

* Add SlipLayer

* Remove fixture from delta

* Fix maps

* Address reviews

* Add SubfloorMask

* Fix glass collisions for flying mobs

* Fix maps

* Update new items

* Fix bagel again

* Fix slug

* Fix maps

* Touchups

* Fix tables blocking high pressure movement

* Update StandingState to allow going under flaps

* Cleanup

* More formatting
2022-05-10 17:57:20 -07:00

52 lines
1.6 KiB
C#

using System;
using Content.Shared.Sound;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared.Standing
{
[Friend(typeof(StandingStateSystem))]
[RegisterComponent, NetworkedComponent]
public sealed class StandingStateComponent : Component
{
[ViewVariables(VVAccess.ReadWrite)]
[DataField("downSoundCollection")]
public SoundSpecifier DownSoundCollection { get; } = new SoundCollectionSpecifier("BodyFall");
[DataField("standing")]
public bool Standing { get; set; } = true;
/// <summary>
/// List of fixtures that had their collision mask changed when the entity was downed.
/// Required for re-adding the collision mask.
/// </summary>
[DataField("changedFixtures")]
public List<string> ChangedFixtures = new();
public override ComponentState GetComponentState()
{
return new StandingComponentState(Standing);
}
public override void HandleComponentState(ComponentState? curState, ComponentState? nextState)
{
base.HandleComponentState(curState, nextState);
if (curState is not StandingComponentState state) return;
Standing = state.Standing;
}
// I'm not calling it StandingStateComponentState
[Serializable, NetSerializable]
private sealed class StandingComponentState : ComponentState
{
public bool Standing { get; }
public StandingComponentState(bool standing)
{
Standing = standing;
}
}
}
}