Carp wave spawner and dragons as an actual event (#10254)

This commit is contained in:
metalgearsloth
2022-08-08 10:18:14 +10:00
committed by GitHub
parent 3d850c6592
commit a29d8b9fa2
60 changed files with 1264 additions and 569 deletions

View File

@@ -0,0 +1,9 @@
using Robust.Shared.Serialization;
namespace Content.Shared.Dragon;
[Serializable, NetSerializable]
public sealed class DragonRiftComponentState : ComponentState
{
public DragonRiftState State;
}

View File

@@ -0,0 +1,19 @@
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared.Dragon;
[NetworkedComponent]
public abstract class SharedDragonRiftComponent : Component
{
[ViewVariables, DataField("state")]
public DragonRiftState State = DragonRiftState.Charging;
}
[Serializable, NetSerializable]
public enum DragonRiftState : byte
{
Charging,
AlmostFinished,
Finished,
}

View File

@@ -0,0 +1,13 @@
using Robust.Shared.GameStates;
namespace Content.Shared.Movement.Components;
/// <summary>
/// Is this entity always considered to be touching a wall?
/// i.e. when weightless they're floaty but still have free movement.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed class MovementAlwaysTouchingComponent : Component
{
}

View File

@@ -8,6 +8,9 @@ using Robust.Shared.Serialization;
namespace Content.Shared.Movement.Components
{
/// <summary>
/// Ignores gravity entirely.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed class MovementIgnoreGravityComponent : Component
{
@@ -17,7 +20,6 @@ namespace Content.Shared.Movement.Components
[DataField("gravityState")] public bool Weightless = false;
}
[NetSerializable, Serializable]
public sealed class MovementIgnoreGravityComponentState : ComponentState
{

View File

@@ -56,55 +56,55 @@ namespace Content.Shared.Movement.Components
/// <summary>
/// Minimum speed a mob has to be moving before applying movement friction.
/// </summary>
[DataField("minimumFrictionSpeed")]
[ViewVariables(VVAccess.ReadWrite), DataField("minimumFrictionSpeed")]
public float MinimumFrictionSpeed = DefaultMinimumFrictionSpeed;
/// <summary>
/// The negative velocity applied for friction when weightless and providing inputs.
/// </summary>
[DataField("weightlessFriction")]
[ViewVariables(VVAccess.ReadWrite), DataField("weightlessFriction")]
public float WeightlessFriction = DefaultWeightlessFriction;
/// <summary>
/// The negative velocity applied for friction when weightless and not providing inputs.
/// This is essentially how much their speed decreases per second.
/// </summary>
[DataField("weightlessFrictionNoInput")]
[ViewVariables(VVAccess.ReadWrite), DataField("weightlessFrictionNoInput")]
public float WeightlessFrictionNoInput = DefaultWeightlessFrictionNoInput;
/// <summary>
/// The movement speed modifier applied to a mob's total input velocity when weightless.
/// </summary>
[DataField("weightlessModifier")]
[ViewVariables(VVAccess.ReadWrite), DataField("weightlessModifier")]
public float WeightlessModifier = DefaultWeightlessModifier;
/// <summary>
/// The acceleration applied to mobs when moving and weightless.
/// </summary>
[DataField("weightlessAcceleration")]
[ViewVariables(VVAccess.ReadWrite), DataField("weightlessAcceleration")]
public float WeightlessAcceleration = DefaultWeightlessAcceleration;
/// <summary>
/// The acceleration applied to mobs when moving.
/// </summary>
[DataField("acceleration")]
[ViewVariables(VVAccess.ReadWrite), DataField("acceleration")]
public float Acceleration = DefaultAcceleration;
/// <summary>
/// The negative velocity applied for friction.
/// </summary>
[DataField("friction")]
[ViewVariables(VVAccess.ReadWrite), DataField("friction")]
public float Friction = DefaultFriction;
/// <summary>
/// The negative velocity applied for friction.
/// </summary>
[DataField("frictionNoInput")] public float? FrictionNoInput = null;
[ViewVariables(VVAccess.ReadWrite), DataField("frictionNoInput")] public float? FrictionNoInput = null;
[DataField("baseWalkSpeed")]
[ViewVariables(VVAccess.ReadWrite), DataField("baseWalkSpeed")]
public float BaseWalkSpeed { get; set; } = DefaultBaseWalkSpeed;
[DataField("baseSprintSpeed")]
[ViewVariables(VVAccess.ReadWrite), DataField("baseSprintSpeed")]
public float BaseSprintSpeed { get; set; } = DefaultBaseSprintSpeed;
[ViewVariables]

View File

@@ -1,4 +1,5 @@
using Content.Shared.Movement.Components;
using Content.Shared.Movement.Events;
using Robust.Shared.GameStates;
namespace Content.Shared.Movement.Systems;
@@ -9,6 +10,12 @@ public sealed class MovementIgnoreGravitySystem : EntitySystem
{
SubscribeLocalEvent<MovementIgnoreGravityComponent, ComponentGetState>(GetState);
SubscribeLocalEvent<MovementIgnoreGravityComponent, ComponentHandleState>(HandleState);
SubscribeLocalEvent<MovementAlwaysTouchingComponent, CanWeightlessMoveEvent>(OnWeightless);
}
private void OnWeightless(EntityUid uid, MovementAlwaysTouchingComponent component, ref CanWeightlessMoveEvent args)
{
args.CanMove = true;
}
private void HandleState(EntityUid uid, MovementIgnoreGravityComponent component, ref ComponentHandleState args)

View File

@@ -0,0 +1,20 @@
using Robust.Shared.GameStates;
namespace Content.Shared.Sprite;
[RegisterComponent, NetworkedComponent]
public sealed class RandomSpriteComponent : Component
{
/// <summary>
/// Available colors based on group, parsed layer enum, state, and color.
/// Stored as a list so we can have groups of random sprites (e.g. tech_base + tech_flare for holoparasite)
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("available")]
public List<Dictionary<string, (string State, string? Color)>> Available = new();
/// <summary>
/// Selected colors
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("selected")]
public Dictionary<string, (string State, Color? Color)> Selected = new();
}

View File

@@ -0,0 +1,11 @@
using Robust.Shared.Serialization;
namespace Content.Shared.Sprite;
public abstract class SharedRandomSpriteSystem : EntitySystem {}
[Serializable, NetSerializable]
public sealed class RandomSpriteColorComponentState : ComponentState
{
public Dictionary<string, (string State, Color? Color)> Selected = default!;
}