* 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>
44 lines
1.2 KiB
C#
44 lines
1.2 KiB
C#
using Content.Shared.DoAfter;
|
|
using Content.Shared.Maps;
|
|
using Robust.Shared.Map;
|
|
using Robust.Shared.Prototypes;
|
|
using Robust.Shared.Serialization;
|
|
|
|
namespace Content.Shared._CP14.SpawnOnTileTool;
|
|
|
|
/// <summary>
|
|
/// Allows using an item on a certain type of tile to spawn entities on it.
|
|
/// </summary>
|
|
[RegisterComponent, Access(typeof(SharedCP14SpawnOnTileToolSystem))]
|
|
public sealed partial class CP14SpawnOnTileToolComponent : Component
|
|
{
|
|
[DataField]
|
|
public Dictionary<ProtoId<ContentTileDefinition>, EntProtoId> Spawns = new();
|
|
|
|
[DataField]
|
|
public bool NeedEmptySpace = true;
|
|
|
|
[DataField]
|
|
public TimeSpan DoAfter = TimeSpan.FromSeconds(1f);
|
|
}
|
|
|
|
[Serializable, NetSerializable]
|
|
public sealed partial class SpawnOnTileToolAfterEvent : DoAfterEvent
|
|
{
|
|
public override DoAfterEvent Clone() => this;
|
|
public readonly NetCoordinates Coordinates;
|
|
public readonly EntProtoId Spawn;
|
|
|
|
public SpawnOnTileToolAfterEvent(IEntityManager entManager, EntityCoordinates coord, EntProtoId spawn)
|
|
{
|
|
Spawn = spawn;
|
|
Coordinates = entManager.GetNetCoordinates(coord);
|
|
}
|
|
|
|
public SpawnOnTileToolAfterEvent(NetCoordinates coord, EntProtoId spawn)
|
|
{
|
|
Spawn = spawn;
|
|
Coordinates = coord;
|
|
}
|
|
}
|