using Content.Server.Botany.Components;
using Content.Shared.EntityEffects;
+using Content.Shared.Examine;
using Content.Shared.FixedPoint;
namespace Content.Server.Botany.Systems;
solutionContainer.AddReagent(chem, amount);
}
}
+
+ public void OnProduceExamined(EntityUid uid, ProduceComponent comp, ExaminedEvent args)
+ {
+ if (comp.Seed == null)
+ return;
+
+ using (args.PushGroup(nameof(ProduceComponent)))
+ {
+ foreach (var m in comp.Seed.Mutations)
+ {
+ // Don't show mutations that have no effect on produce (sentience)
+ if (!m.AppliesToProduce)
+ continue;
+
+ if (m.Description != null)
+ args.PushMarkup(Loc.GetString(m.Description));
+ }
+ }
+ }
}
base.Initialize();
SubscribeLocalEvent<SeedComponent, ExaminedEvent>(OnExamined);
+ SubscribeLocalEvent<ProduceComponent, ExaminedEvent>(OnProduceExamined);
}
public bool TryGetSeed(SeedComponent comp, [NotNullWhen(true)] out SeedData? seed)
? "plant-holder-component-plant-old-adjective"
: "plant-holder-component-plant-unhealthy-adjective"))));
}
+
+ // For future reference, mutations should only appear on examine if they apply to a plant, not to produce.
+
+ if (component.Seed.Ligneous)
+ args.PushMarkup(Loc.GetString("mutation-plant-ligneous"));
+
+ if (component.Seed.TurnIntoKudzu)
+ args.PushMarkup(Loc.GetString("mutation-plant-kudzu"));
+
+ if (component.Seed.CanScream)
+ args.PushMarkup(Loc.GetString("mutation-plant-scream"));
+
+ if (component.Seed.Viable == false)
+ args.PushMarkup(Loc.GetString("mutation-plant-unviable"));
}
else
{
[DataField]
public string Name = "";
+ /// <summary>
+ /// The text to display to players when examining something with this mutation.
+ /// </summary>
+ [DataField]
+ public LocId? Description;
+
/// <summary>
/// The actual EntityEffect to apply to the target
/// </summary>
--- /dev/null
+mutation-plant-bioluminescent = It glows with a gentle light.
+mutation-plant-kudzu = It is growing unusually fast and thin.
+mutation-plant-ligneous = It is woody and will need a sharp tool to harvest.
+mutation-plant-scream = This plant seems nervous somehow.
+mutation-plant-sentient = It seems to be examining its surroundings.
+mutation-plant-slippery = It is slick to the touch.
+mutation-plant-unviable = It is wilting and sickly.
\ No newline at end of file
mutations:
# disabled until 50 morbillion point lights don't cause the renderer to die
#- name: Bioluminescent
+ # description: mutation-plant-bioluminescent
# baseOdds: 0.036
# appliesToPlant: false
# effect: !type:Glow
- name: Sentient
+ description: mutation-plant-sentient
baseOdds: 0.0072
appliesToProduce: false
persists: false
effect: !type:MakeSentient # existing effect.
- name: Slippery
+ description: mutation-plant-slippery
baseOdds: 0.036
appliesToPlant: false
effect: !type:Slipify
persists: false
effect: !type:PlantChangeStat
targetValue: Seedless
- - name: ChangeLigneous
+ - name: Lignification
baseOdds: 0.036
persists: false
effect: !type:PlantChangeStat
targetValue: Ligneous
- - name: ChangeTurnIntoKudzu
+ - name: Kudzufication
baseOdds: 0.036
persists: false
effect: !type:PlantChangeStat