Metamorphosis - FoodSequence 3 (#31012)
* setup some data * cheeseburger recipe * Update FoodSequenceSystem.cs * finalize cheseburger recipe * remove fun * return old taco sprites * full foodsequence data refactor * return tacos * well done * add cutlets to burger * chickenburger recipe * +2 burger recipes * more fun * Update brain.png * some slice produce added * documentation * watermelon * skewer work * flipping * tomato * skewer watermelon * Update skewer.yml * oopsie, ok, im go to sleep * fix checks * Update produce.yml * screwed * cheeeeeeeese * all cooked meat added * produce added * aaaaand suppermatter * key to Tag * More * proto string remove * raw snail * fix * Update FoodMetamorphableByAddingComponent.cs * fixes * fix3 * fififififx
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
using System.Numerics;
|
||||
using Content.Shared.Nutrition.EntitySystems;
|
||||
using Content.Shared.Nutrition.Prototypes;
|
||||
using Content.Shared.Tag;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Shared.Nutrition.Components;
|
||||
|
||||
@@ -14,7 +19,7 @@ public sealed partial class FoodSequenceStartPointComponent : Component
|
||||
/// A key that determines which types of food elements can be attached to a food.
|
||||
/// </summary>
|
||||
[DataField(required: true)]
|
||||
public string Key = string.Empty;
|
||||
public ProtoId<TagPrototype> Key = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// The maximum number of layers of food that can be placed on this item.
|
||||
@@ -22,62 +27,20 @@ public sealed partial class FoodSequenceStartPointComponent : Component
|
||||
[DataField]
|
||||
public int MaxLayers = 10;
|
||||
|
||||
/// <summary>
|
||||
/// Start shift from the center of the sprite where the first layer of food will be placed.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public Vector2 StartPosition = Vector2.Zero;
|
||||
|
||||
/// <summary>
|
||||
/// Shift from the start position applied to each subsequent layer.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public Vector2 Offset = Vector2.Zero;
|
||||
|
||||
/// <summary>
|
||||
/// Can we put more layers?
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public bool Finished;
|
||||
|
||||
/// <summary>
|
||||
/// list of sprite states to be displayed on this object.
|
||||
/// </summary>
|
||||
[DataField, AutoNetworkedField]
|
||||
public List<FoodSequenceElementEntry> FoodLayers = new();
|
||||
|
||||
public HashSet<string> RevealedLayers = new();
|
||||
|
||||
/// <summary>
|
||||
/// target layer, where new layers will be added. This allows you to control the order of generative layers and static layers.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public string TargetLayerMap = "foodSequenceLayers";
|
||||
|
||||
/// <summary>
|
||||
/// If true, the generative layers will be placed in reverse order.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public bool InverseLayers;
|
||||
|
||||
/// <summary>
|
||||
/// each layer will get a random offset in the specified range
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public Vector2 MaxLayerOffset = Vector2.Zero;
|
||||
|
||||
/// <summary>
|
||||
/// each layer will get a random offset in the specified range
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public Vector2 MinLayerOffset = Vector2.Zero;
|
||||
|
||||
/// <summary>
|
||||
/// solution where reagents will be added from newly added ingredients
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public string Solution = "food";
|
||||
|
||||
#region name generation
|
||||
|
||||
/// <summary>
|
||||
/// LocId with a name generation pattern.
|
||||
/// </summary>
|
||||
@@ -101,4 +64,96 @@ public sealed partial class FoodSequenceStartPointComponent : Component
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public LocId? NameSuffix;
|
||||
|
||||
#endregion
|
||||
|
||||
#region visual
|
||||
|
||||
/// <summary>
|
||||
/// list of sprite states to be displayed on this object.
|
||||
/// </summary>
|
||||
[DataField, AutoNetworkedField]
|
||||
public List<FoodSequenceVisualLayer> FoodLayers = new();
|
||||
|
||||
/// <summary>
|
||||
/// If true, the generative layers will be placed in reverse order.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public bool InverseLayers;
|
||||
|
||||
/// <summary>
|
||||
/// target layer, where new layers will be added. This allows you to control the order of generative layers and static layers.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public string TargetLayerMap = "foodSequenceLayers";
|
||||
|
||||
/// <summary>
|
||||
/// Start shift from the center of the sprite where the first layer of food will be placed.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public Vector2 StartPosition = Vector2.Zero;
|
||||
|
||||
/// <summary>
|
||||
/// Shift from the start position applied to each subsequent layer.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public Vector2 Offset = Vector2.Zero;
|
||||
|
||||
/// <summary>
|
||||
/// each layer will get a random offset in the specified range
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public Vector2 MaxLayerOffset = Vector2.Zero;
|
||||
|
||||
/// <summary>
|
||||
/// each layer will get a random offset in the specified range
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public Vector2 MinLayerOffset = Vector2.Zero;
|
||||
|
||||
[DataField]
|
||||
public bool AllowHorizontalFlip = true;
|
||||
|
||||
public HashSet<string> RevealedLayers = new();
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// class that synchronizes with the client
|
||||
/// Stores all the necessary information for rendering the FoodSequence element
|
||||
/// </summary>
|
||||
[DataRecord, Serializable, NetSerializable]
|
||||
public record struct FoodSequenceVisualLayer
|
||||
{
|
||||
/// <summary>
|
||||
/// reference to the original prototype of the layer. Used to edit visual layers.
|
||||
/// </summary>
|
||||
public ProtoId<FoodSequenceElementPrototype> Proto;
|
||||
|
||||
/// <summary>
|
||||
/// Sprite rendered in sequence
|
||||
/// </summary>
|
||||
public SpriteSpecifier? Sprite { get; set; } = SpriteSpecifier.Invalid;
|
||||
|
||||
/// <summary>
|
||||
/// Relative size of the sprite displayed in FoodSequence
|
||||
/// </summary>
|
||||
public Vector2 Scale { get; set; } = Vector2.One;
|
||||
|
||||
/// <summary>
|
||||
/// The offset of a particular layer. Allows a little position randomization of each layer.
|
||||
/// </summary>
|
||||
public Vector2 LocalOffset { get; set; } = Vector2.Zero;
|
||||
|
||||
public FoodSequenceVisualLayer(ProtoId<FoodSequenceElementPrototype> proto,
|
||||
SpriteSpecifier? sprite,
|
||||
Vector2 scale,
|
||||
Vector2 offset)
|
||||
{
|
||||
Proto = proto;
|
||||
Sprite = sprite;
|
||||
Scale = scale;
|
||||
LocalOffset = offset;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user