This commit is contained in:
Quanteey 2025-08-05 16:46:25 +02:00
parent 1fac605dfd
commit 3c9ce1fb8a
10 changed files with 60 additions and 40 deletions

View File

@ -1,5 +1,6 @@
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Content.Server.Abilities.Psionics;
using Content.Server.Atmos.Components;
using Content.Server.Atmos.EntitySystems;
using Content.Server.Body.Components;
@ -16,11 +17,13 @@ using Content.Server.Ghost.Roles.Components;
using Content.Server.Medical;
using Content.Server.Polymorph.Components;
using Content.Server.Polymorph.Systems;
using Content.Server.Psionics;
using Content.Server.Speech.Components;
using Content.Server.Spreader;
using Content.Server.Temperature.Components;
using Content.Server.Temperature.Systems;
using Content.Server.Traits.Assorted;
using Content.Server.Xenoarchaeology.XenoArtifacts;
using Content.Server.Zombies;
using Content.Shared.Atmos;
using Content.Shared.Audio;
@ -30,8 +33,10 @@ using Content.Shared.EntityEffects.Effects.PlantMetabolism;
using Content.Shared.EntityEffects.Effects.StatusEffects;
using Content.Shared.EntityEffects.Effects;
using Content.Shared.EntityEffects;
using Content.Shared.Humanoid;
using Content.Shared.Maps;
using Content.Shared.Mind.Components;
using Content.Shared.Nyanotrasen.Chemistry.Effects;
using Content.Shared.Popups;
using Content.Shared.Random;
using Content.Shared.Zombies;
@ -123,6 +128,13 @@ public sealed class EntityEffectSystem : EntitySystem
SubscribeLocalEvent<ExecuteEntityEffectEvent<PlantSpeciesChange>>(OnExecutePlantSpeciesChange);
SubscribeLocalEvent<ExecuteEntityEffectEvent<PolymorphEffect>>(OnExecutePolymorph);
SubscribeLocalEvent<ExecuteEntityEffectEvent<ResetNarcolepsy>>(OnExecuteResetNarcolepsy);
SubscribeLocalEvent<ExecuteEntityEffectEvent<ActivateArtifact>>(OnActivateArtifact);
// Nyanotrasen
SubscribeLocalEvent<ExecuteEntityEffectEvent<ChemRemovePsionic>>(OnChemRemovePsionic);
SubscribeLocalEvent<ExecuteEntityEffectEvent<ChemRerollPsionic>>(OnChemRerollPsionic);
// Nyanotrasen end
}
private void OnCheckTemperature(ref CheckEntityEffectConditionEvent<TemperatureCondition> args)
@ -761,8 +773,18 @@ public sealed class EntityEffectSystem : EntitySystem
return;
}
// Delta-V: Do not allow humanoids to become sentient. Intended to stop people from
// repeatedly cloning themselves and using cognizine on their bodies.
// HumanoidAppearanceComponent is common to all player species, and is also used for the
// Ripley pilot whitelist, so there's a precedent for using it for this kind of check.
if (HasComp<HumanoidAppearanceComponent>(uid))
{
return;
}
ghostRole = AddComp<GhostRoleComponent>(uid);
EnsureComp<GhostTakeoverAvailableComponent>(uid);
EnsureComp<PotentialPsionicComponent>(uid); //Nyano - Summary:. Makes the animated body able to get psionics.
var entityData = EntityManager.GetComponent<MetaDataComponent>(uid);
ghostRole.RoleName = entityData.EntityName;
@ -972,4 +994,31 @@ public sealed class EntityEffectSystem : EntitySystem
_narcolepsy.AdjustNarcolepsyTimer(args.Args.TargetEntity, args.Effect.TimerReset);
}
private void OnActivateArtifact(ref ExecuteEntityEffectEvent<ActivateArtifact> args)
{
var artifact = args.Args.EntityManager.EntitySysManager.GetEntitySystem<ArtifactSystem>();
artifact.TryActivateArtifact(args.Args.TargetEntity, logMissing: false);
}
// Nyanotrasen
private void OnChemRemovePsionic(ref ExecuteEntityEffectEvent<ChemRemovePsionic> args)
{
if (args.Args is EntityEffectReagentArgs reagentArgs)
{
if (reagentArgs.Scale != 1f)
return;
}
var psySys = args.Args.EntityManager.EntitySysManager.GetEntitySystem<PsionicAbilitiesSystem>();
psySys.RemovePsionics(args.Args.TargetEntity);
}
private void OnChemRerollPsionic(ref ExecuteEntityEffectEvent<ChemRerollPsionic> args)
{
var psySys = args.Args.EntityManager.EntitySysManager.GetEntitySystem<PsionicsSystem>();
psySys.RerollPsionics(args.Args.TargetEntity, bonusMuliplier: args.Effect.BonusMuliplier);
}
// Nyanotrasen end
}

View File

@ -19,6 +19,7 @@ using Content.Server.Storage.EntitySystems;
using Content.Server.Temperature.Components;
using Content.Server.Temperature.Systems;
using Content.Server.UserInterface;
using Content.Shared.Cargo;
using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.Components.SolutionManager;
using Content.Shared.Chemistry.EntitySystems;

View File

@ -6,6 +6,7 @@ using Content.Server.Power.EntitySystems;
using Content.Server.Xenoarchaeology.Equipment.Components;
using Content.Server.Xenoarchaeology.XenoArtifacts.Events;
using Content.Server.Xenoarchaeology.XenoArtifacts.Triggers.Components;
using Content.Shared.Cargo;
using Content.Shared.CCVar;
using Content.Shared.Xenoarchaeology.XenoArtifacts;
using JetBrains.Annotations;

View File

@ -1,18 +1,9 @@
using Content.Server.Xenoarchaeology.XenoArtifacts;
using Content.Shared.Chemistry.Reagent;
using Robust.Shared.Prototypes;
using Content.Shared.EntityEffects;
namespace Content.Server.EntityEffects.Effects;
namespace Content.Shared.EntityEffects.Effects;
public sealed partial class ActivateArtifact : EntityEffect
public sealed partial class ActivateArtifact : EventEntityEffect<ActivateArtifact>
{
public override void Effect(EntityEffectBaseArgs args)
{
var artifact = args.EntityManager.EntitySysManager.GetEntitySystem<ArtifactSystem>();
artifact.TryActivateArtifact(args.TargetEntity, logMissing: false);
}
protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) =>
Loc.GetString("reagent-effect-guidebook-activate-artifact", ("chance", Probability));
}

View File

@ -8,22 +8,9 @@ namespace Content.Shared.Nyanotrasen.Chemistry.Effects
/// Rerolls psionics once.
/// </summary>
[UsedImplicitly]
public sealed partial class ChemRemovePsionic : EntityEffect
public sealed partial class ChemRemovePsionic : EventEntityEffect<ChemRemovePsionic>
{
protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
=> Loc.GetString("reagent-effect-guidebook-chem-remove-psionic", ("chance", Probability));
public override void Effect(EntityEffectBaseArgs args)
{
if (args is EntityEffectReagentArgs reagentArgs)
{
if (reagentArgs.Scale != 1f)
return;
}
var psySys = args.EntityManager.EntitySysManager.GetEntitySystem<PsionicAbilitiesSystem>();
psySys.RemovePsionics(args.TargetEntity);
}
}
}

View File

@ -1,16 +1,14 @@
using Content.Shared.Chemistry.Reagent;
using Content.Server.Psionics;
using Content.Shared.EntityEffects;
using JetBrains.Annotations;
using Robust.Shared.Prototypes;
namespace Content.Server.Chemistry.ReagentEffects
namespace Content.Shared.Nyanotrasen.Chemistry.Effects
{
/// <summary>
/// Rerolls psionics once.
/// </summary>
[UsedImplicitly]
public sealed partial class ChemRerollPsionic : EntityEffect
public sealed partial class ChemRerollPsionic : EventEntityEffect<ChemRerollPsionic>
{
protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
=> Loc.GetString("reagent-effect-guidebook-chem-reroll-psionic", ("chance", Probability));
@ -20,12 +18,5 @@ namespace Content.Server.Chemistry.ReagentEffects
/// </summary>
[DataField("bonusMultiplier")]
public float BonusMuliplier = 1f;
public override void Effect(EntityEffectBaseArgs args)
{
var psySys = args.EntityManager.EntitySysManager.GetEntitySystem<PsionicsSystem>();
psySys.RerollPsionics(args.TargetEntity, bonusMuliplier: BonusMuliplier);
}
}
}

View File

@ -2,7 +2,7 @@ using Content.Shared._DV.Addictions;
using Content.Shared.EntityEffects;
using Robust.Shared.Prototypes;
namespace Content.Server.EntityEffects.Effects;
namespace Content.Shared._DV.EntityEffects.Effects;
public sealed partial class Addicted : EntityEffect
{

View File

@ -2,7 +2,7 @@ using Content.Shared._DV.Pain;
using Content.Shared.EntityEffects;
using Robust.Shared.Prototypes;
namespace Content.Server.EntityEffects.Effects;
namespace Content.Shared._DV.EntityEffects.Effects;
public sealed partial class InPain : EntityEffect
{

View File

@ -2,7 +2,7 @@ using Content.Shared._DV.Addictions;
using Content.Shared.EntityEffects;
using Robust.Shared.Prototypes;
namespace Content.Server.EntityEffects.Effects;
namespace Content.Shared._DV.EntityEffects.Effects;
public sealed partial class SuppressAddiction : EntityEffect
{

View File

@ -2,7 +2,7 @@ using Content.Shared._DV.Pain;
using Content.Shared.EntityEffects;
using Robust.Shared.Prototypes;
namespace Content.Server.EntityEffects.Effects;
namespace Content.Shared._DV.EntityEffects.Effects;
public sealed partial class SuppressPain : EntityEffect
{