Files
crystall-punk-14/Content.Shared/_CP14/Farming/CP14PlantGatherableComponent.cs
Ed 8cbd26ae2f Farming WIP (#269)
* setup planting doafter

* spawn plants after use seed

* some work

* move comps to separate folder

* public check daylight

* daylight plant energy regeneration

* some fixes

* bruh, im thinking

* added ingame soil

* added hoe

* attaching plants

* hoe system

* block plant dublicating

* some planting refactor

* shovel as pant + soil remover

* plant growing visualizer

* soil resprite

* split farming system to second partial class

* update throught event refactor

* tring sync update plant with update visuals

* finish visual sync

* plants growing

* more partial splitting, naming work, clean up

* Update FARMINGTEST.yml

* Update FARMINGTEST.yml

* fix typo

* prototype value validating

* Оно бухает воду!

* solution visualizer in soil

* forgot some fix

* part of Tornado review fix

* destroy RemovePlantComponent

* more fixes

* simple harvesting

* refactor plant component values changing

* harvest redo

* gather on destroyByTool

* sickle resprite

* plant fading

* fading per minute!

* wheat sprites

* YML restruct

* fixes

* auto root plants

* add comments

* move sprites

* split structures from object textures

* wheat farming!

* Update CP14FarmingSystem.Interactions.cs

* seedbed (#297)

seedbed :^)

* a

* Update soil.yml

---------

Co-authored-by: Jaraten <116667537+Jaraten@users.noreply.github.com>
2024-07-15 23:58:03 +03:00

64 lines
1.7 KiB
C#

using Content.Shared.EntityList;
using Content.Shared.Whitelist;
using Robust.Shared.Prototypes;
namespace Content.Shared._CP14.Farming;
/// <summary>
/// Means that the plant can be harvested.
/// </summary>
[RegisterComponent]
public sealed partial class CP14PlantGatherableComponent : Component
{
/// <summary>
/// Whitelist for specifying the kind of tools can be used on a resource
/// Supports multiple tags.
/// </summary>
[DataField(required: true)]
public EntityWhitelist ToolWhitelist = new();
/// <summary>
/// YAML example below
/// (Tag1, Tag2, LootTableID1, LootTableID2 are placeholders for example)
/// --------------------
/// useMappedLoot: true
/// toolWhitelist:
/// tags:
/// - Tag1
/// - Tag2
/// loot:
/// Tag1: LootTableID1
/// Tag2: LootTableID2
/// </summary>
[DataField]
public Dictionary<string, ProtoId<EntityLootTablePrototype>>? Loot = new();
/// <summary>
/// Random shift of the appearing entity during gathering
/// </summary>
[DataField]
public float GatherOffset = 0.3f;
[DataField]
public TimeSpan Time = TimeSpan.FromSeconds(1f);
/// <summary>
/// after harvesting, should the plant be completely removed?
/// </summary>
[DataField]
public bool DeleteAfterHarvest = false;
/// <summary>
/// after harvest, the growth level of the plant will be reduced by the specified value
/// </summary>
[DataField]
public float GrowthCostHarvest = 0.4f;
/// <summary>
/// what level of growth does a plant need to have before it can be harvested?
/// </summary>
[DataField]
public float GrowthLevelToHarvest = 0.9f;
}