Skip to content

Commit

Permalink
Allow metapsionic to detect mindswapped bodys.
Browse files Browse the repository at this point in the history
Reason:
Because there is no other way to find out unless you were at the place right before someone mindswapped.
To-do:
Find out why it crashes because at the least its better if it crashes compared to doin a workin build but the power doesnt work anymore.
  • Loading branch information
Adrian16199 committed Feb 6, 2024
1 parent 069bc99 commit abec229
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,13 @@ private void OnShutdown(EntityUid uid, MetapsionicPowerComponent component, Comp
}

private void OnPowerUsed(EntityUid uid, MetapsionicPowerComponent component, MetapsionicPowerActionEvent args)
{
{
if (HasComp<MindSwappedComponent>(entity))

Check failure on line 58 in Content.Server/Nyanotrasen/Abilities/Psionics/Abilities/MetapsionicPowerSystem.cs

View workflow job for this annotation

GitHub Actions / Test Packaging

The name 'entity' does not exist in the current context

Check failure on line 58 in Content.Server/Nyanotrasen/Abilities/Psionics/Abilities/MetapsionicPowerSystem.cs

View workflow job for this annotation

GitHub Actions / Test Packaging

The name 'entity' does not exist in the current context

Check failure on line 58 in Content.Server/Nyanotrasen/Abilities/Psionics/Abilities/MetapsionicPowerSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

The name 'entity' does not exist in the current context

Check failure on line 58 in Content.Server/Nyanotrasen/Abilities/Psionics/Abilities/MetapsionicPowerSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

The name 'entity' does not exist in the current context

Check failure on line 58 in Content.Server/Nyanotrasen/Abilities/Psionics/Abilities/MetapsionicPowerSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

The name 'entity' does not exist in the current context

Check failure on line 58 in Content.Server/Nyanotrasen/Abilities/Psionics/Abilities/MetapsionicPowerSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

The name 'entity' does not exist in the current context

Check failure on line 58 in Content.Server/Nyanotrasen/Abilities/Psionics/Abilities/MetapsionicPowerSystem.cs

View workflow job for this annotation

GitHub Actions / YAML Linter

The name 'entity' does not exist in the current context

Check failure on line 58 in Content.Server/Nyanotrasen/Abilities/Psionics/Abilities/MetapsionicPowerSystem.cs

View workflow job for this annotation

GitHub Actions / YAML Linter

The name 'entity' does not exist in the current context

_popups.PopupEntity(Loc.GetString("metapsionic-pulse-mindswapped"), uid, uid, PopupType.LargeCaution);
args.Handled = true;
return;

foreach (var entity in _lookup.GetEntitiesInRange(uid, component.Range))
{
if (HasComp<PsionicComponent>(entity) && entity != uid && !HasComp<PsionicInsulationComponent>(entity) &&
Expand All @@ -64,6 +70,13 @@ private void OnPowerUsed(EntityUid uid, MetapsionicPowerComponent component, Met
args.Handled = true;
return;
}

if (HasComp<MindSwappedComponent>(entity) && entity != uid)
{
_popups.PopupEntity(Loc.GetString("metapsionic-pulse-mindswapped"), uid, uid, PopupType.LargeCaution);
args.Handled = true;
return;
}
}
_popups.PopupEntity(Loc.GetString("metapsionic-pulse-failure"), uid, uid, PopupType.Large);
_psionics.LogPowerUsed(uid, "metapsionic pulse", 2, 4);
Expand Down
1 change: 1 addition & 0 deletions Resources/Locale/en-US/nyanotrasen/abilities/psionic.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ action-description-metapsionic = Send a mental pulse through the area to see if
metapsionic-pulse-success = You detect psychic presence nearby.
metapsionic-pulse-failure = You don't detect any psychic presence nearby.
metapsionic-pulse-power = You detect that {$power} was used nearby.
metapsionic-pulse-mindswapped = You detect that someone is mindswapped
action-name-dispel = Dispel
action-description-dispel = Dispel summoned entities such as familiars or forcewalls.
Expand Down

0 comments on commit abec229

Please sign in to comment.