mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-24 00:58:01 +03:00
<!-- This is a semi-strict format, you can add/remove sections as needed but the order/format should be kept the same Remove these comments before submitting --> # Description <!-- Explain this PR in as much detail as applicable Some example prompts to consider: How might this affect the game? The codebase? What might be some alternatives to this? How/Who does this benefit/hurt [the game/codebase]? --> Ports https://github.com/space-wizards/space-station-14/pull/27110 --- # Changelog <!-- You can add an author after the `🆑` to change the name that appears in the changelog (ex: `🆑 Death`) Leaving it blank will default to your GitHub display name This includes all available types for the changelog --> 🆑 Erisfiregamer1 - add: New chemical, Sedin. It restores seeds on plants 20% of the time with other adverse effects included. --------- Signed-off-by: sleepyyapril <123355664+sleepyyapril@users.noreply.github.com> Co-authored-by: Eris <eris@erisws.com> Co-authored-by: VMSolidus <evilexecutive@gmail.com> (cherry picked from commit ed593f070a579a47f2e8800d4a5191741971b3b9)
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using Content.Server.Botany.Systems;
|
||||
using Content.Shared.EntityEffects;
|
||||
|
||||
namespace Content.Server.EntityEffects.Effects.PlantMetabolism;
|
||||
|
||||
/// <summary>
|
||||
/// Handles increase or decrease of plant potency.
|
||||
/// </summary>
|
||||
|
||||
public sealed partial class PlantAdjustPotency : PlantAdjustAttribute
|
||||
{
|
||||
public override string GuidebookAttributeName { get; set; } = "plant-attribute-potency";
|
||||
|
||||
public override void Effect(EntityEffectBaseArgs args)
|
||||
{
|
||||
if (!CanMetabolize(args.TargetEntity, out var plantHolderComp, args.EntityManager))
|
||||
return;
|
||||
|
||||
if (plantHolderComp.Seed == null)
|
||||
return;
|
||||
|
||||
var plantHolder = args.EntityManager.System<PlantHolderSystem>();
|
||||
|
||||
plantHolder.EnsureUniqueSeed(args.TargetEntity, plantHolderComp);
|
||||
|
||||
plantHolderComp.Seed.Potency = Math.Max(plantHolderComp.Seed.Potency + Amount, 1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
using Content.Server.Botany.Components;
|
||||
using Content.Server.Botany.Systems;
|
||||
using Content.Shared.EntityEffects;
|
||||
using Content.Shared.Popups;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Server.EntityEffects.Effects.PlantMetabolism;
|
||||
|
||||
/// <summary>
|
||||
/// Handles removal of seeds on a plant.
|
||||
/// </summary>
|
||||
|
||||
public sealed partial class PlantDestroySeeds : EntityEffect
|
||||
{
|
||||
public override void Effect(EntityEffectBaseArgs args)
|
||||
{
|
||||
if (
|
||||
!args.EntityManager.TryGetComponent(args.TargetEntity, out PlantHolderComponent? plantHolderComp)
|
||||
|| plantHolderComp.Seed == null
|
||||
|| plantHolderComp.Dead
|
||||
|| plantHolderComp.Seed.Immutable
|
||||
)
|
||||
return;
|
||||
|
||||
var plantHolder = args.EntityManager.System<PlantHolderSystem>();
|
||||
var popupSystem = args.EntityManager.System<SharedPopupSystem>();
|
||||
|
||||
if (plantHolderComp.Seed.Seedless == false)
|
||||
{
|
||||
plantHolder.EnsureUniqueSeed(args.TargetEntity, plantHolderComp);
|
||||
popupSystem.PopupEntity(
|
||||
Loc.GetString("botany-plant-seedsdestroyed"),
|
||||
args.TargetEntity,
|
||||
PopupType.SmallCaution
|
||||
);
|
||||
plantHolderComp.Seed.Seedless = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) =>
|
||||
Loc.GetString("reagent-effect-guidebook-plant-seeds-remove", ("chance", Probability));
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using Content.Server.Botany.Components;
|
||||
using Content.Server.Botany.Systems;
|
||||
using Content.Shared.EntityEffects;
|
||||
using Content.Shared.Popups;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Server.EntityEffects.Effects.PlantMetabolism;
|
||||
|
||||
/// <summary>
|
||||
/// Handles restoral of seeds on a plant.
|
||||
/// </summary>
|
||||
|
||||
public sealed partial class PlantRestoreSeeds : EntityEffect
|
||||
{
|
||||
public override void Effect(EntityEffectBaseArgs args)
|
||||
{
|
||||
if (
|
||||
!args.EntityManager.TryGetComponent(args.TargetEntity, out PlantHolderComponent? plantHolderComp)
|
||||
|| plantHolderComp.Seed == null
|
||||
|| plantHolderComp.Dead
|
||||
|| plantHolderComp.Seed.Immutable
|
||||
)
|
||||
return;
|
||||
|
||||
var plantHolder = args.EntityManager.System<PlantHolderSystem>();
|
||||
var popupSystem = args.EntityManager.System<SharedPopupSystem>();
|
||||
|
||||
if (plantHolderComp.Seed.Seedless)
|
||||
{
|
||||
plantHolder.EnsureUniqueSeed(args.TargetEntity, plantHolderComp);
|
||||
popupSystem.PopupEntity(Loc.GetString("botany-plant-seedsrestored"), args.TargetEntity);
|
||||
plantHolderComp.Seed.Seedless = false;
|
||||
}
|
||||
}
|
||||
|
||||
protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) =>
|
||||
Loc.GetString("reagent-effect-guidebook-plant-seeds-add", ("chance", Probability));
|
||||
}
|
||||
Reference in New Issue
Block a user