* 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>
38 lines
1.0 KiB
C#
38 lines
1.0 KiB
C#
using Content.Shared.DoAfter;
|
|
using Robust.Shared.Serialization;
|
|
|
|
namespace Content.Shared._CP14.Farming;
|
|
|
|
public abstract partial class CP14SharedFarmingSystem : EntitySystem
|
|
{
|
|
public void AffectEnergy(Entity<CP14PlantComponent> ent, float energyDelta)
|
|
{
|
|
if (energyDelta == 0)
|
|
return;
|
|
|
|
ent.Comp.Energy = MathHelper.Clamp(ent.Comp.Energy + energyDelta, 0, ent.Comp.EnergyMax);
|
|
}
|
|
public void AffectResource(Entity<CP14PlantComponent> ent, float resourceDelta)
|
|
{
|
|
if (resourceDelta == 0)
|
|
return;
|
|
|
|
ent.Comp.Resource = MathHelper.Clamp(ent.Comp.Resource + resourceDelta, 0, ent.Comp.ResourceMax);
|
|
}
|
|
|
|
public void AffectGrowth(Entity<CP14PlantComponent> ent, float growthDelta)
|
|
{
|
|
if (growthDelta == 0)
|
|
return;
|
|
|
|
ent.Comp.GrowthLevel = MathHelper.Clamp01(ent.Comp.GrowthLevel + growthDelta);
|
|
Dirty(ent);
|
|
}
|
|
|
|
|
|
[Serializable, NetSerializable]
|
|
public sealed partial class PlantSeedDoAfterEvent : SimpleDoAfterEvent
|
|
{
|
|
}
|
|
}
|