Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions Content.Server/_White/Chemistry/Effects/ChemGivePsionics.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Content.Shared.Chemistry.Reagent;
using Content.Server.Psionics;
using Content.Shared.EntityEffects;
using JetBrains.Annotations;
using Robust.Shared.Prototypes;
using Content.Shared.Abilities.Psionics;

namespace Content.Server._White.Chemistry.ReagentEffects
{
[UsedImplicitly]
public sealed partial class ChemGivePsionic : EntityEffect
{
protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
=> Loc.GetString("reagent-effect-guidebook-chem-remove-psionic", ("chance", Probability));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

# First, find and examine the file
find . -name "ChemGivePsionics.cs" -type f

Repository: WWhiteDreamProject/wwdpublic

Length of output: 133


🏁 Script executed:

# Search for psionic-related localization keys in ftl files
rg -n "reagent-effect-guidebook-chem.*psionic" --type ftl -i

Repository: WWhiteDreamProject/wwdpublic

Length of output: 99


🏁 Script executed:

# Also search for the ChemRemovePsionic file to understand the pattern
find . -name "*RemovePsionic*" -type f

Repository: WWhiteDreamProject/wwdpublic

Length of output: 219


🏁 Script executed:

# Read the actual file to verify the code
cat -n ./Content.Server/_White/Chemistry/Effects/ChemGivePsionics.cs

Repository: WWhiteDreamProject/wwdpublic

Length of output: 1078


🏁 Script executed:

# Read ChemRemovePsionic for comparison
cat -n ./Content.Server/Nyanotrasen/Chemistry/Effects/ChemRemovePsionic.cs

Repository: WWhiteDreamProject/wwdpublic

Length of output: 1261


🏁 Script executed:

# Search for ftl files without type filter
rg -n "reagent-effect-guidebook.*psionic" --glob="*.ftl"

Repository: WWhiteDreamProject/wwdpublic

Length of output: 721


🏁 Script executed:

# Check the full context of the ftl files to see if "give-psionic" key might be under a different name
rg -n "give.*psionic" --glob="*.ftl" -i

Repository: WWhiteDreamProject/wwdpublic

Length of output: 54


🏁 Script executed:

# Also check what the remove-psionic key text is to understand the pattern
sed -n '372,377p' ./Resources/Locale/ru-RU/guidebook/chemistry/effects.ftl
sed -n '408,413p' ./Resources/Locale/en-US/guidebook/chemistry/effects.ftl

Repository: WWhiteDreamProject/wwdpublic

Length of output: 331


Неправильный ключ локализации в guidebook.

На строке 14 используется ключ "reagent-effect-guidebook-chem-remove-psionic" (удалить), но класс ChemGivePsionic выдаёт псионику, а не удаляет её. Это копирование из ChemRemovePsionic.

Необходимо:

  1. Заменить ключ на "reagent-effect-guidebook-chem-give-psionic"
  2. Добавить новый ключ локализации в Resources/Locale/en-US/guidebook/chemistry/effects.ftl и Resources/Locale/ru-RU/guidebook/chemistry/effects.ftl
Предложенное исправление
        protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
-            => Loc.GetString("reagent-effect-guidebook-chem-remove-psionic", ("chance", Probability));
+            => Loc.GetString("reagent-effect-guidebook-chem-give-psionic", ("chance", Probability));
🤖 Prompt for AI Agents
In `@Content.Server/_White/Chemistry/Effects/ChemGivePsionics.cs` around lines 13
- 14, In ChemGivePsionic.cs update the ReagentEffectGuidebookText override to
use the correct localization key "reagent-effect-guidebook-chem-give-psionic"
instead of the current "reagent-effect-guidebook-chem-remove-psionic"; then add
matching entries for that new key in both
Resources/Locale/en-US/guidebook/chemistry/effects.ftl and
Resources/Locale/ru-RU/guidebook/chemistry/effects.ftl with appropriate English
and Russian guidebook text (use the same placeholder ("chance", Probability) as
other entries) so the guidebook string resolves correctly at runtime.


public override void Effect(EntityEffectBaseArgs args)
{
if (args is not EntityEffectReagentArgs _)
return;

args.EntityManager.EnsureComponent<PsionicComponent>(args.TargetEntity);
}
}
}
5 changes: 5 additions & 0 deletions Resources/Prototypes/Reagents/psionic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@
- !type:ReagentThreshold
reagent: LotophagoiOil
min: 5
- !type:ChemGivePsionic #wwdp edit
conditions:
- !type:ReagentThreshold
reagent: LotophagoiOil
min: 40

- type: reagent
id: OusianaDust
Expand Down
Loading