Increase robust harvest effectiveness (#10369)
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
using Content.Server.Botany.Components;
|
using Content.Server.Botany.Components;
|
||||||
using Content.Server.Botany.Systems;
|
using Content.Server.Botany.Systems;
|
||||||
using Content.Shared.Atmos;
|
using Content.Shared.Atmos;
|
||||||
|
using Content.Shared.Chemistry.Reagent;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
|
||||||
@@ -63,7 +64,7 @@ public struct SeedChemQuantity
|
|||||||
|
|
||||||
// TODO reduce the number of friends to a reasonable level. Requires ECS-ing things like plant holder component.
|
// TODO reduce the number of friends to a reasonable level. Requires ECS-ing things like plant holder component.
|
||||||
[Virtual, DataDefinition]
|
[Virtual, DataDefinition]
|
||||||
[Access(typeof(BotanySystem), typeof(PlantHolderSystem), typeof(SeedExtractorSystem), typeof(PlantHolderComponent))]
|
[Access(typeof(BotanySystem), typeof(PlantHolderSystem), typeof(SeedExtractorSystem), typeof(PlantHolderComponent), typeof(ReagentEffect))]
|
||||||
public class SeedData
|
public class SeedData
|
||||||
{
|
{
|
||||||
#region Tracking
|
#region Tracking
|
||||||
|
|||||||
@@ -18,14 +18,14 @@ namespace Content.Server.Chemistry.ReagentEffects.PlantMetabolism
|
|||||||
|
|
||||||
var random = IoCManager.Resolve<IRobustRandom>();
|
var random = IoCManager.Resolve<IRobustRandom>();
|
||||||
|
|
||||||
if (plantHolderComp.Seed.Potency < 100 && random.Prob(0.1f))
|
if (plantHolderComp.Seed.Potency < 100)
|
||||||
{
|
{
|
||||||
plantHolderComp.EnsureUniqueSeed();
|
plantHolderComp.EnsureUniqueSeed();
|
||||||
plantHolderComp.Seed.Potency++;
|
plantHolderComp.Seed.Potency = Math.Min(plantHolderComp.Seed.Potency + 3, 100);
|
||||||
}
|
}
|
||||||
|
else if (plantHolderComp.Seed.Yield > 1 && random.Prob(0.1f))
|
||||||
if (plantHolderComp.Seed.Yield > 1 && random.Prob(0.1f))
|
|
||||||
{
|
{
|
||||||
|
// Too much of a good thing reduces yield
|
||||||
plantHolderComp.EnsureUniqueSeed();
|
plantHolderComp.EnsureUniqueSeed();
|
||||||
plantHolderComp.Seed.Yield--;
|
plantHolderComp.Seed.Yield--;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user