</CollapsibleBody>
</Collapsible>
</BoxContainer>
+ <BoxContainer Name="PlantMetabolismsContainer" HorizontalExpand="True">
+ <Collapsible>
+ <CollapsibleHeading Title="{Loc 'guidebook-reagent-plant-metabolisms-header'}"/>
+ <CollapsibleBody>
+ <BoxContainer Name="PlantMetabolismsDescriptionContainer"
+ Orientation="Vertical"
+ Margin="10 0 10 0"
+ HorizontalExpand="True"/>
+ </CollapsibleBody>
+ </Collapsible>
+ </BoxContainer>
<BoxContainer Margin="10 5 10 10" HorizontalExpand="True">
<!-- The troublemaker !-->
<RichTextLabel Name="ReagentDescription" HorizontalAlignment="Left"/>
}
#endregion
+ #region PlantMetabolisms
+ if (_chemistryGuideData.ReagentGuideRegistry.TryGetValue(reagent.ID, out var guideEntryRegistryPlant) &&
+ guideEntryRegistryPlant.PlantMetabolisms != null &&
+ guideEntryRegistryPlant.PlantMetabolisms.Count > 0)
+ {
+ PlantMetabolismsDescriptionContainer.Children.Clear();
+ var metabolismLabel = new RichTextLabel();
+ metabolismLabel.SetMarkup(Loc.GetString("guidebook-reagent-plant-metabolisms-rate"));
+ var descriptionLabel = new RichTextLabel
+ {
+ Margin = new Thickness(25, 0, 10, 0)
+ };
+ var descMsg = new FormattedMessage();
+ var descriptionsCount = guideEntryRegistryPlant.PlantMetabolisms.Count;
+ var i = 0;
+ foreach (var effectString in guideEntryRegistryPlant.PlantMetabolisms)
+ {
+ descMsg.AddMarkup(effectString);
+ i++;
+ if (i < descriptionsCount)
+ descMsg.PushNewline();
+ }
+ descriptionLabel.SetMessage(descMsg);
+
+ PlantMetabolismsDescriptionContainer.AddChild(metabolismLabel);
+ PlantMetabolismsDescriptionContainer.AddChild(descriptionLabel);
+ }
+ else
+ {
+ PlantMetabolismsContainer.Visible = false;
+ }
+ #endregion
+
GenerateSources(reagent);
FormattedMessage description = new();
[DataField]
public float Prob { get; protected set; } = 1; // = (80);
+ /// <summary>
+ /// Localisation key for the name of the adjusted attribute. Used for guidebook descriptions.
+ /// </summary>
+ [DataField]
+ public abstract string GuidebookAttributeName { get; set; }
+
+ /// <summary>
+ /// Whether the attribute in question is a good thing. Used for guidebook descriptions to determine the color of the number.
+ /// </summary>
+ [DataField]
+ public virtual bool GuidebookIsAttributePositive { get; protected set; } = true;
+
/// <summary>
/// Checks if the plant holder can metabolize the reagent or not. Checks if it has an alive plant by default.
/// </summary>
return !(Prob <= 0f) && IoCManager.Resolve<IRobustRandom>().Prob(Prob);
}
- protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) => Loc.GetString("reagent-effect-guidebook-missing", ("chance", Probability));
+ protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
+ {
+ string color;
+ if (GuidebookIsAttributePositive ^ Amount < 0.0)
+ {
+ color = "green";
+ }
+ else
+ {
+ color = "red";
+ }
+ return Loc.GetString("reagent-effect-guidebook-plant-attribute", ("attribute", Loc.GetString(GuidebookAttributeName)), ("amount", Amount.ToString("0.00")), ("colorName", color), ("chance", Probability));
+ }
}
}
{
public sealed partial class PlantAdjustHealth : PlantAdjustAttribute
{
+ public override string GuidebookAttributeName { get; set; } = "plant-attribute-health";
+
+
public override void Effect(ReagentEffectArgs args)
{
if (!CanMetabolize(args.SolutionEntity, out var plantHolderComp, args.EntityManager))
{
public sealed partial class PlantAdjustMutationLevel : PlantAdjustAttribute
{
+ public override string GuidebookAttributeName { get; set; } = "plant-attribute-mutation-level";
+
+
public override void Effect(ReagentEffectArgs args)
{
if (!CanMetabolize(args.SolutionEntity, out var plantHolderComp, args.EntityManager))
[UsedImplicitly]
public sealed partial class PlantAdjustMutationMod : PlantAdjustAttribute
{
+ public override string GuidebookAttributeName { get; set; } = "plant-attribute-mutation-mod";
+
public override void Effect(ReagentEffectArgs args)
{
if (!CanMetabolize(args.SolutionEntity, out var plantHolderComp, args.EntityManager))
[UsedImplicitly]
public sealed partial class PlantAdjustNutrition : PlantAdjustAttribute
{
+ public override string GuidebookAttributeName { get; set; } = "plant-attribute-nutrition";
+
public override void Effect(ReagentEffectArgs args)
{
if (!CanMetabolize(args.SolutionEntity, out var plantHolderComp, args.EntityManager, mustHaveAlivePlant: false))
[UsedImplicitly]
public sealed partial class PlantAdjustPests : PlantAdjustAttribute
{
+ public override string GuidebookAttributeName { get; set; } = "plant-attribute-pests";
+ public override bool GuidebookIsAttributePositive { get; protected set; } = false;
+
public override void Effect(ReagentEffectArgs args)
{
if (!CanMetabolize(args.SolutionEntity, out var plantHolderComp, args.EntityManager))
[UsedImplicitly]
public sealed partial class PlantAdjustToxins : PlantAdjustAttribute
{
+ public override string GuidebookAttributeName { get; set; } = "plant-attribute-toxins";
+ public override bool GuidebookIsAttributePositive { get; protected set; } = false;
+
public override void Effect(ReagentEffectArgs args)
{
if (!CanMetabolize(args.SolutionEntity, out var plantHolderComp, args.EntityManager))
[UsedImplicitly]
public sealed partial class PlantAdjustWater : PlantAdjustAttribute
{
+ public override string GuidebookAttributeName { get; set; } = "plant-attribute-water";
+
public override void Effect(ReagentEffectArgs args)
{
if (!CanMetabolize(args.SolutionEntity, out var plantHolderComp, args.EntityManager, mustHaveAlivePlant: false))
[UsedImplicitly]
public sealed partial class PlantAdjustWeeds : PlantAdjustAttribute
{
+ public override string GuidebookAttributeName { get; set; } = "plant-attribute-weeds";
+ public override bool GuidebookIsAttributePositive { get; protected set; } = false;
+
public override void Effect(ReagentEffectArgs args)
{
if (!CanMetabolize(args.SolutionEntity, out var plantHolderComp, args.EntityManager))
[UsedImplicitly]
public sealed partial class PlantAffectGrowth : PlantAdjustAttribute
{
+ public override string GuidebookAttributeName { get; set; } = "plant-attribute-growth";
+
public override void Effect(ReagentEffectArgs args)
{
if (!CanMetabolize(args.SolutionEntity, out var plantHolderComp, args.EntityManager))
plantHolderComp.ForceUpdate = true;
}
- protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) => Loc.GetString("reagent-effect-guidebook-missing", ("chance", Probability));
+ protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) => Loc.GetString("reagent-effect-guidebook-plant-cryoxadone", ("chance", Probability));
}
}
}
}
- protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) => Loc.GetString("reagent-effect-guidebook-missing", ("chance", Probability));
+ protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) => Loc.GetString("reagent-effect-guidebook-plant-diethylamine", ("chance", Probability));
}
}
plantHolderComp.Seed.Viable = true;
}
- protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) => Loc.GetString("reagent-effect-guidebook-missing", ("chance", Probability));
+ protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) => Loc.GetString("reagent-effect-guidebook-plant-phalanximine", ("chance", Probability));
}
}
}
}
- protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) => Loc.GetString("reagent-effect-guidebook-missing", ("chance", Probability));
+ protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) => Loc.GetString("reagent-effect-guidebook-plant-robust-harvest", ("seedlesstreshold", PotencySeedlessThreshold), ("limit", PotencyLimit), ("increase", PotencyIncrease), ("chance", Probability));
}
}
public Dictionary<ProtoId<MetabolismGroupPrototype>, ReagentEffectsGuideEntry>? GuideEntries;
+ public List<string>? PlantMetabolisms = null;
+
public ReagentGuideEntry(ReagentPrototype proto, IPrototypeManager prototype, IEntitySystemManager entSys)
{
ReagentPrototype = proto.ID;
GuideEntries = proto.Metabolisms?
.Select(x => (x.Key, x.Value.MakeGuideEntry(prototype, entSys)))
.ToDictionary(x => x.Key, x => x.Item2);
+ if (proto.PlantMetabolisms.Count > 0)
+ {
+ PlantMetabolisms = new List<string> (proto.PlantMetabolisms
+ .Select(x => x.GuidebookEffectDescription(prototype, entSys))
+ .Where(x => x is not null)
+ .Select(x => x!)
+ .ToArray());
+ }
}
}
guidebook-reagent-sources-gas-wrapper = [bold]{$name} (gas)[/bold] \[1\]
guidebook-reagent-effects-header = Effects
guidebook-reagent-effects-metabolism-group-rate = [bold]{$group}[/bold] [color=gray]({$rate} units per second)[/color]
+guidebook-reagent-plant-metabolisms-header = Plant Metabolism
+guidebook-reagent-plant-metabolisms-rate = [bold]Plant Metabolism[/bold] [color=gray](1 unit every 3 seconds as base)[/color]
guidebook-reagent-physical-description = [italic]Seems to be {$description}.[/italic]
guidebook-reagent-recipes-mix-info = {$minTemp ->
[0] {$hasMax ->
*[other] cure
} an ongoing zombie infection, and provides immunity to future infections
-reagent-effect-guidebook-reduce-rotting =
+reagent-effect-guidebook-reduce-rotting =
{ $chance ->
[1] Regenerates
*[other] regenerate
[1] Causes
*[other] cause
} an unknown effect as nobody has written this effect yet
+
+reagent-effect-guidebook-plant-attribute =
+ { $chance ->
+ [1] Adjusts
+ *[other] adjust
+ } {$attribute} by [color={$colorName}]{$amount}[/color]
+
+reagent-effect-guidebook-plant-cryoxadone =
+ { $chance ->
+ [1] Ages back
+ *[other] age back
+ } the plant, depending on the plant's age and time to grow
+
+reagent-effect-guidebook-plant-phalanximine =
+ { $chance ->
+ [1] Makes
+ *[other] make
+ } a plant not viable due to mutation viable again
+
+reagent-effect-guidebook-plant-diethylamine =
+ { $chance ->
+ [1] Increases
+ *[other] increase
+ } the plant's lifespan and/or base health with 10% chance for each.
+
+reagent-effect-guidebook-plant-robust-harvest =
+ { $chance ->
+ [1] Increases
+ *[other] increase
+ } the plant's potency by {$increase} up to a maximum of {$limit}. Causes the plant to lose its seeds once the potency reaches {$seedlesstreshold}. Trying to add potency over {$limit} may cause decrease in yield at a 10% chance.
--- /dev/null
+plant-attribute-growth = age
+plant-attribute-water = water level
+plant-attribute-weeds = weeds level
+plant-attribute-toxins = toxins level
+plant-attribute-nutrition = nutrition level
+plant-attribute-mutation-level = mutation level
+plant-attribute-pests = pests level
+plant-attribute-mutation-mod = mutation modifier
+plant-attribute-health = health
metabolism-group-food = Food
metabolism-group-drink = Drink
metabolism-group-gas = Gas
+metabolism-group-plant-metabolisms = Plant Metabolism
- type: metabolismGroup
id: Gas
name: metabolism-group-gas
+
+# Dummy for the guide
+- type: metabolismGroup
+ id: PlantMetabolisms
+ name: metabolism-group-plant-metabolisms