using Content.Shared.Chemistry.Components;
using Content.Shared.DoAfter;
using Content.Shared.FixedPoint;
using Content.Shared.Tools;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
using Robust.Shared.Utility;
namespace Content.Shared.Animals.Components;
///
/// Lets an entity be sheared by a tool to consume a reagent to spawn an amount of an item.
/// For example, sheep can be sheared to consume wool Solution to spawn cotton.
///
[RegisterComponent, NetworkedComponent]
public sealed partial class ShearableComponent : Component
{
///
/// A pre-existing solution inside the target entity that will be subtracted from upon being sheared.
///
///
/// targetSolutionName: wool
///
[DataField (required: true)]
public string TargetSolutionName = string.Empty;
///
/// An ID of an entity that will be spawned upon the creature being sheared.
///
///
/// shearedProductId: MaterialCotton1
///
[DataField (required: true)]
public EntProtoId ShearedProductId = "MaterialCotton1";
///
/// How much solution to use to spawn 1 product. This is measured in reagents.
/// Keep in mind, only up to the maximum stack of the specified product will be spawned,
/// the remaining solution will be truncated and left unchanged. In these cases the player can shear more than once to get more.
///
///
/// solutionPerProduct: 5
///
[DataField]
public FixedPoint2 SolutionPerProduct = 5;
///
/// The maximum number of products that can be spawned at once.
/// e.g. if the animal has enough solution to spawn 50 items
/// but MaximumProductsSpawned is set to 25, then you will need to shear it twice.
/// Default/null is infinite.
///
///
/// maximumProductsSpawned: 25
///
[DataField]
public int? MaximumProductsSpawned;
///
/// Items dropped by shearing an entity can have their placement randomised so they don't all fall on the exact same pixel.
/// For each spawn, a random number is chosen between the negative and positive values of this setting.
/// If you set it to 0.2 then a random offset between -0.2 and 0.2 is picked for each spawn.
/// Setting a value higher than 1 has a chance to spawn items outside the tile the entity stands on, which may go through walls.
///
///
/// RandomSpawnOffsetVariation: 0.2f
///
[DataField]
public float RandomSpawnOffsetVariation = 0.2f;
///
/// The "Quality" of the target item that allows this entity to be sheared.
/// For example, Wirecutters have the "cutting" quality.
/// Leave null for no tool required.
///
///
/// toolQuality: Cutting
///
[DataField]
public ProtoId? ToolQuality;
///
/// A LocID that is added to the description box when the entity is shearable.
///
///
/// shearableMarkupText: sheep-shearable-examine-markup
///
[DataField]
public LocId? ShearableMarkupText;
///
/// A LocID that is added to the description box when the entity is not shearable.
///
///
/// unShearableMarkupText: sheep-not-shearable-examine-markup
///
[DataField]
public LocId? UnShearableMarkupText;
///
/// A LocID of the verb used for shearing, this is used in some popups in-game. For example "you can't SHEAR that sheep".
///
///
/// verb: shearable-system-verb-shear
///
[DataField]
public LocId Verb = "shearable-system-verb-shear";
///
/// Specifies the shearing icon that appears in the context menu when right-clicking a shearable animal.
/// Defaults to an icon of scissors.
/// You can specify a direct path, or an RSI and icon state.
///
///
/// shearingIcon: /Textures/Interface/VerbIcons/scissors.svg.236dpi.png
///
[DataField]
public SpriteSpecifier ShearingIcon = new SpriteSpecifier.Texture(new("/Textures/Interface/VerbIcons/scissors.svg.236dpi.png"));
///
/// Caches the resolved shearing solution entity.
///
public Entity? ShearingSolutionEnt = null;
}
///
/// A part of the Shearable Layer.
///
///
[Serializable, NetSerializable]
public enum ShearableVisuals
{
Shearable
}
///
/// Thrown whenever an animal is sheared.
///
[Serializable, NetSerializable]
public sealed partial class ShearingDoAfterEvent : SimpleDoAfterEvent;