Skip to content

Commit

Permalink
No idea how the hell potentialpsychics came back
Browse files Browse the repository at this point in the history
  • Loading branch information
VMSolidus authored and Mnemotechnician committed Jul 27, 2024
1 parent d061e2d commit 6926fd6
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 9 deletions.
15 changes: 14 additions & 1 deletion Content.Server/Cloning/CloningSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
using Content.Shared.Mind.Components;
using Content.Shared.Mobs.Systems;
using Content.Shared.Roles.Jobs;
using Content.Shared.Psionics.Abilities;
using Robust.Server.Containers;
using Robust.Server.GameObjects;
using Robust.Server.Player;
Expand Down Expand Up @@ -200,6 +201,18 @@ public bool TryCloning(EntityUid uid, EntityUid bodyToClone, Entity<MindComponen
if (_configManager.GetCVar(CCVars.BiomassEasyMode))
cloningCost = (int) Math.Round(cloningCost * EasyModeCloningCost);

if (TryComp<PsionicInsulationComponent>(bodyToClone, out var insul))
{
if (clonePod.ConnectedConsole != null)
{
_chatSystem.TrySendInGameICMessage(clonePod.ConnectedConsole.Value,
Loc.GetString("cloning-console-insulation-error"),
InGameICChatType.Speak, false);
}

return false;
}

// Check if they have the uncloneable trait
if (TryComp<UncloneableComponent>(bodyToClone, out _))
{
Expand Down Expand Up @@ -248,7 +261,7 @@ public bool TryCloning(EntityUid uid, EntityUid bodyToClone, Entity<MindComponen
}
// end of genetic damage checks

var mob = FetchAndSpawnMob(clonePod, pref, speciesPrototype, humanoid, bodyToClone, karmaBonus); //DeltaV Replaces CloneAppearance with Metem/Clone via FetchAndSpawnMob
var mob = FetchAndSpawnMob(clonePod, pref, speciesPrototype, humanoid, bodyToClone, karmaBonus); //DeltaV Replaces CloneAppearance with Metem/Clone via FetchAndSpawnMob

///Nyano - Summary: adds the potential psionic trait to the reanimated mob.
EnsureComp<PotentialPsionicComponent>(mob);
Expand Down
2 changes: 2 additions & 0 deletions Content.Server/Psionics/Abilities/PsionicAbilitiesSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ public void RemovePsionics(EntityUid uid)
if (RemComp<PotentialPsionicComponent>(uid))
{
_popups.PopupEntity(Loc.GetString("mindbreaking-feedback", ("entity", uid)), uid, PopupType.Medium);
EnsureComp<PsionicInsulationComponent>(uid, out var insul);
insul.MindBroken = true;
}

if (!TryComp<PsionicComponent>(uid, out var psionic))
Expand Down
3 changes: 3 additions & 0 deletions Content.Shared/Psionics/PsionicInsulationComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@ public sealed partial class PsionicInsulationComponent : Component
public bool Passthrough = false;

public List<String> SuppressedFactions = new();

[DataField]
public bool MindBroken = false;
}
}
12 changes: 12 additions & 0 deletions Content.Shared/Psionics/SharedPsionicAbilitiesSystem.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using System.Diagnostics.CodeAnalysis;
using Content.Shared.Actions;
using Content.Shared.Administration.Logs;
using Content.Shared.Examine;
using Content.Shared.Mobs;
using Content.Shared.Mobs.Components;
using Content.Shared.Popups;
using Content.Shared.Psionics.Glimmer;
using Robust.Shared.Network;
using Robust.Shared.Random;
using Robust.Shared.Serialization;

Expand All @@ -18,13 +20,15 @@ public sealed class SharedPsionicAbilitiesSystem : EntitySystem
[Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
[Dependency] private readonly GlimmerSystem _glimmerSystem = default!;
[Dependency] private readonly IRobustRandom _robustRandom = default!;
[Dependency] private readonly INetManager _net = default!;

public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<PsionicsDisabledComponent, ComponentInit>(OnInit);
SubscribeLocalEvent<PsionicsDisabledComponent, ComponentShutdown>(OnShutdown);
SubscribeLocalEvent<PsionicComponent, PsionicPowerUsedEvent>(OnPowerUsed);
SubscribeLocalEvent<PsionicInsulationComponent, ExaminedEvent>(OnExamined);

SubscribeLocalEvent<PsionicComponent, MobStateChangedEvent>(OnMobStateChanged);
}
Expand Down Expand Up @@ -77,6 +81,14 @@ public void SetPsionicsThroughEligibility(EntityUid uid)
_actions.SetEnabled(uid, IsEligibleForPsionics(uid));
}

private void OnExamined(EntityUid uid, PsionicInsulationComponent component, ExaminedEvent args)
{
if (!component.MindBroken || !args.IsInDetailsRange)
return;

args.PushMarkup($"[color=mediumpurple]{Loc.GetString("examine-mindbroken-message", ("entity", uid))}[/color]");
}

private bool IsEligibleForPsionics(EntityUid uid)
{
return !HasComp<PsionicInsulationComponent>(uid)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,6 @@ pyrokinesis-refund-cooldown = You reclaim some of the energy spent drawing forth
# Misc Psionic Messages
telepathic-mute-message = You strain, but are unable to send your thoughts to the Noosphere
examine-mindbroken-message = Eyes unblinking, staring listfully into the horizon. {CAPITALIZE($entity)} is a sack of meat pretending it has a soul.
There is nothing behind its gaze.
cloning-console-insulation-error = ERROR: NON-SOPHONT LOADED, NO SOUL FOUND.
8 changes: 4 additions & 4 deletions Resources/Locale/en-US/traits/traits.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ trait-description-LatentPsychic = Your mind and soul are open to the noosphere,
It is possible that you may be hunted by otherworldly forces, so consider keeping your powers a secret.
trait-name-PsionicInsulation = χ Waveform Misalignment
trait-description-PsionicInsulation = Through a quirk of fate, your brainwaves are permanently out of phase with the noösphere
You are immune to both positive and negative effects of nearly all psychic powers,
But you can never be a psionic yourself in this life. This trait is incompatible with
all other psychic traits.
trait-description-PsionicInsulation = You are a flesh automaton animated by neurotransmitters. Within your skull lies a
1.5kg sack of meat pretending at sentience. By modern epistemiological theory, you aren't even a sophont.
The good news is that you are immune to most positive and negative effects of psychic powers. There may be other
consequences to this malady.
trait-name-NaturalTelepath = Natural Telepath
trait-description-NaturalTelepath = As a naturally occuring Telepath, you are capable of fluent telepathic communication, regardless of
Expand Down
1 change: 0 additions & 1 deletion Resources/Prototypes/Entities/Mobs/NPCs/regalrat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@
- type: Grammar
attributes:
gender: male
- type: PotentialPsionic # Nyano
- type: LanguageKnowledge
speaks:
- GalacticCommon
Expand Down
1 change: 0 additions & 1 deletion Resources/Prototypes/Entities/Mobs/NPCs/xeno.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@
molsPerSecondPerUnitMass: 0.0005
- type: Speech
speechVerb: LargeMob
- type: PotentialPsionic #Nyano - Summary: makes potentially psionic.
chance: -2
- type: Psionic #Nyano - Summary: makes psionic by default.
removable: false
Expand Down
1 change: 0 additions & 1 deletion Resources/Prototypes/Entities/Mobs/Player/skeleton.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
interactSuccessString: hugging-success-generic
interactSuccessSound: /Audio/Effects/thudswoosh.ogg
messagePerceivedByOthers: hugging-success-generic-others
- type: PotentialPsionic #Nyano - Summary: makes potentially psionic.

- type: entity
name: skeleton pirate
Expand Down
1 change: 0 additions & 1 deletion Resources/Prototypes/Entities/Mobs/Species/human.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
spawned:
- id: FoodMeatHuman
amount: 5
- type: PotentialPsionic #Nyano - Summary: makes potentially psionic.
- type: LanguageKnowledge
speaks:
- GalacticCommon
Expand Down
1 change: 1 addition & 0 deletions Resources/Prototypes/Traits/psionics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
points: -5
components:
- type: PsionicInsulation
mindBroken: true
requirements:
- !type:CharacterTraitRequirement
inverted: true
Expand Down

0 comments on commit 6926fd6

Please sign in to comment.