Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Psionic Refactor Version 2, Part 1 #731

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
1c4e941
Create PsionicPowerPrototype.cs
VMSolidus Aug 13, 2024
e2ba773
SERIALIZATION
VMSolidus Aug 13, 2024
7d7d4b1
AAAAAAAAAAAAAAAA
VMSolidus Aug 13, 2024
76a33ce
Finally finishing this.
VMSolidus Aug 14, 2024
522e900
Remove unused datafields from psionic power components
VMSolidus Aug 14, 2024
cecfa4e
Generic popup, the bigger popup will go to the text window.
VMSolidus Aug 14, 2024
d13b04c
Merge branch 'master' into Serialize-Psionic-Powers
DangerRevolution Aug 14, 2024
2a2150f
Should fix errors
VMSolidus Aug 14, 2024
4f2f830
Merge branch 'Serialize-Psionic-Powers' of https://github.com/VMSolid…
VMSolidus Aug 14, 2024
548411d
Update PsionicInvisibilitySystem.cs
VMSolidus Aug 14, 2024
b93174e
Update PsionicComponent.cs
VMSolidus Aug 14, 2024
7016422
Merge branch 'master' into Serialize-Psionic-Powers
VMSolidus Aug 14, 2024
0bc0dca
Update PsionicsSystem.cs
VMSolidus Aug 14, 2024
a2b781f
Merge branch 'Serialize-Psionic-Powers' of https://github.com/VMSolid…
VMSolidus Aug 14, 2024
aa0a268
Revert "Update PsionicsSystem.cs"
VMSolidus Aug 14, 2024
a789f96
Update PsionicsSystem.cs
VMSolidus Aug 14, 2024
51cdfe9
Make psionic monsters actually generate their Baseline too
VMSolidus Aug 14, 2024
0f9c15a
Merge branch 'master' into Serialize-Psionic-Powers
VMSolidus Aug 15, 2024
6fc3730
Don't let people
VMSolidus Aug 15, 2024
c3258ab
Merge branch 'master' into Serialize-Psionic-Powers
VMSolidus Aug 15, 2024
9d91786
Update code from feedback.
VMSolidus Aug 16, 2024
6997433
More stuff
VMSolidus Aug 16, 2024
1b32589
Update PsionicComponent.cs
VMSolidus Aug 16, 2024
9544922
Create PsionicsSystem.Events.cs
VMSolidus Aug 18, 2024
f858f95
Update PsionicsSystem.Events.cs
VMSolidus Aug 18, 2024
6341e17
Update CommandStaffSystem.cs
VMSolidus Aug 18, 2024
e70ba92
Finished with all the C# side of review.
VMSolidus Aug 19, 2024
0ee146b
Apply suggestions from code review
VMSolidus Aug 19, 2024
dd11e97
Update MetapsionicPowerComponent.cs
VMSolidus Aug 19, 2024
d46d001
Merge branch 'Serialize-Psionic-Powers' of https://github.com/VMSolid…
VMSolidus Aug 19, 2024
56375c6
Update AntiPsychicWeaponComponent.cs
VMSolidus Aug 19, 2024
7a5087d
Fixing crap
VMSolidus Aug 19, 2024
3cbdf75
Update PsionicAbilitiesSystem.cs
VMSolidus Aug 19, 2024
4f91222
aaaaaaaaaaaaaaaaa
VMSolidus Aug 19, 2024
845bc48
Yeet test fails
VMSolidus Aug 19, 2024
37a1e81
Finally.
VMSolidus Aug 19, 2024
71d2138
Update NoosphericStormRule.cs
VMSolidus Aug 19, 2024
28bbd07
Update PsionicAbilitiesSystem.cs
VMSolidus Aug 19, 2024
acd0021
Update PsionicAbilitiesSystem.cs
VMSolidus Aug 19, 2024
f528fe5
Revert "Update PsionicAbilitiesSystem.cs"
VMSolidus Aug 19, 2024
390d01e
Revert "Update PsionicAbilitiesSystem.cs"
VMSolidus Aug 19, 2024
e7ac451
Revert "Update NoosphericStormRule.cs"
VMSolidus Aug 19, 2024
f9f8b32
Revert "Finally."
VMSolidus Aug 19, 2024
28cf578
Revert "Yeet test fails"
VMSolidus Aug 19, 2024
ea0f046
Revert "aaaaaaaaaaaaaaaaa"
VMSolidus Aug 19, 2024
3ceaae1
Revert "Update PsionicAbilitiesSystem.cs"
VMSolidus Aug 19, 2024
09c05d3
Revert "Fixing crap"
VMSolidus Aug 19, 2024
3e720a1
Revert "Update AntiPsychicWeaponComponent.cs"
VMSolidus Aug 19, 2024
d5e35f5
Revert "Merge branch 'Serialize-Psionic-Powers' of https://github.com…
VMSolidus Aug 19, 2024
34426eb
Revert "Update MetapsionicPowerComponent.cs"
VMSolidus Aug 19, 2024
4dfc8e8
Revert "Finished with all the C# side of review."
VMSolidus Aug 19, 2024
664a58a
SMALL changes. Going to wait for the tests.
VMSolidus Aug 19, 2024
3240eae
Update PsionicAbilitiesSystem.cs
VMSolidus Aug 19, 2024
65c7798
Last ones for the night, and I'm reverting this if it doesn't work.
VMSolidus Aug 19, 2024
e089445
w
VMSolidus Aug 19, 2024
a7c4bfa
Merge branch 'master' into Serialize-Psionic-Powers
VMSolidus Aug 19, 2024
3ed88eb
Immutable psionics like Ifrit shouldn't roll for powers.
VMSolidus Aug 19, 2024
61eed38
Update PsionicsSystem.cs
VMSolidus Aug 19, 2024
dd063db
Update PsionicsSystem.cs
VMSolidus Aug 19, 2024
bbc2b93
Got adding the powers working again under new types...
VMSolidus Aug 20, 2024
5abcdfe
Got removing powers to work.
VMSolidus Aug 20, 2024
1829364
And now finally, we try Shutdown...
VMSolidus Aug 20, 2024
7839a48
Last cleanup
VMSolidus Aug 20, 2024
f14d026
Update PsionicAbilitiesSystem.cs
VMSolidus Aug 20, 2024
988bdd0
aaaaaaaaaaaaaaaa
VMSolidus Aug 20, 2024
239e231
Update PsionicAbilitiesSystem.cs
VMSolidus Aug 20, 2024
bd07fb7
Update PsionicAbilitiesSystem.cs
VMSolidus Aug 20, 2024
f3da3cd
Update PsionicComponent.cs
VMSolidus Aug 20, 2024
669fa3c
Update PsionicComponent.cs
VMSolidus Aug 20, 2024
57fc6e7
Update PsionicComponent.cs
VMSolidus Aug 20, 2024
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
3 changes: 0 additions & 3 deletions Content.Server/Abilities/Mime/MimePowersSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ private void OnComponentInit(EntityUid uid, MimePowersComponent component, Compo
EnsureComp<MutedComponent>(uid);
_alertsSystem.ShowAlert(uid, AlertType.VowOfSilence);
_actionsSystem.AddAction(uid, ref component.InvisibleWallActionEntity, component.InvisibleWallAction, uid);
//Nyano - Summary: Add Psionic Ability to Mime.
VMSolidus marked this conversation as resolved.
Show resolved Hide resolved
if (TryComp<PsionicComponent>(uid, out var psionic) && psionic.PsionicAbility == null)
psionic.PsionicAbility = component.InvisibleWallActionEntity;
}

/// <summary>
Expand Down
33 changes: 0 additions & 33 deletions Content.Server/Abilities/Psionics/Abilities/DispelPowerSystem.cs
Original file line number Diff line number Diff line change
@@ -1,41 +1,31 @@
using Content.Shared.Actions;
using Content.Shared.StatusEffect;
using Content.Shared.Abilities.Psionics;
using Content.Shared.Damage;
using Content.Shared.Revenant.Components;
using Content.Server.Guardian;
using Content.Server.Bible.Components;
using Content.Server.Popups;
using Robust.Shared.Prototypes;
using Robust.Shared.Player;
using Robust.Shared.Random;
using Robust.Shared.Timing;
using Content.Shared.Mind;
using Content.Shared.Actions.Events;
using Robust.Shared.Audio.Systems;

namespace Content.Server.Abilities.Psionics
{
public sealed class DispelPowerSystem : EntitySystem
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly StatusEffectsSystem _statusEffects = default!;
[Dependency] private readonly SharedActionsSystem _actions = default!;
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
[Dependency] private readonly GuardianSystem _guardianSystem = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly SharedPsionicAbilitiesSystem _psionics = default!;
[Dependency] private readonly SharedAudioSystem _audioSystem = default!;
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly SharedMindSystem _mindSystem = default!;


public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<DispelPowerComponent, ComponentInit>(OnInit);
SubscribeLocalEvent<DispelPowerComponent, ComponentShutdown>(OnShutdown);
SubscribeLocalEvent<DispelPowerActionEvent>(OnPowerUsed);

SubscribeLocalEvent<DispellableComponent, DispelledEvent>(OnDispelled);
Expand All @@ -46,29 +36,6 @@ public override void Initialize()
SubscribeLocalEvent<RevenantComponent, DispelledEvent>(OnRevenantDispelled);
}

private void OnInit(EntityUid uid, DispelPowerComponent component, ComponentInit args)
{
_actions.AddAction(uid, ref component.DispelActionEntity, component.DispelActionId );
_actions.TryGetActionData( component.DispelActionEntity, out var actionData );
if (actionData is { UseDelay: not null })
_actions.StartUseDelay(component.DispelActionEntity);
if (TryComp<PsionicComponent>(uid, out var psionic) && psionic.PsionicAbility == null)
{
psionic.PsionicAbility = component.DispelActionEntity;
psionic.ActivePowers.Add(component);
}
}

private void OnShutdown(EntityUid uid, DispelPowerComponent component, ComponentShutdown args)
{
_actions.RemoveAction(uid, component.DispelActionEntity);

if (TryComp<PsionicComponent>(uid, out var psionic))
{
psionic.ActivePowers.Remove(component);
}
}

private void OnPowerUsed(DispelPowerActionEvent args)
{
if (HasComp<PsionicInsulationComponent>(args.Target))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,58 +1,22 @@
using Content.Shared.Actions;
using Content.Shared.Abilities.Psionics;
using Content.Shared.StatusEffect;
using Content.Shared.Popups;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;
using Content.Shared.Mind;
using Content.Shared.Actions.Events;

namespace Content.Server.Abilities.Psionics
{
public sealed class MetapsionicPowerSystem : EntitySystem
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly StatusEffectsSystem _statusEffects = default!;
[Dependency] private readonly SharedActionsSystem _actions = default!;
[Dependency] private readonly EntityLookupSystem _lookup = default!;
[Dependency] private readonly SharedPopupSystem _popups = default!;
[Dependency] private readonly SharedPsionicAbilitiesSystem _psionics = default!;
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly SharedMindSystem _mindSystem = default!;


public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<MetapsionicPowerComponent, ComponentInit>(OnInit);
SubscribeLocalEvent<MetapsionicPowerComponent, ComponentShutdown>(OnShutdown);
SubscribeLocalEvent<MetapsionicPowerComponent, MetapsionicPowerActionEvent>(OnPowerUsed);
}

private void OnInit(EntityUid uid, MetapsionicPowerComponent component, ComponentInit args)
{
_actions.AddAction(uid, ref component.MetapsionicActionEntity, component.MetapsionicActionId );
_actions.TryGetActionData( component.MetapsionicActionEntity, out var actionData );
if (actionData is { UseDelay: not null })
_actions.StartUseDelay(component.MetapsionicActionEntity);
if (TryComp<PsionicComponent>(uid, out var psionic) && psionic.PsionicAbility == null)
{
psionic.PsionicAbility = component.MetapsionicActionEntity;
psionic.ActivePowers.Add(component);
}

}

private void OnShutdown(EntityUid uid, MetapsionicPowerComponent component, ComponentShutdown args)
{
_actions.RemoveAction(uid, component.MetapsionicActionEntity);

if (TryComp<PsionicComponent>(uid, out var psionic))
{
psionic.ActivePowers.Remove(component);
}
}

private void OnPowerUsed(EntityUid uid, MetapsionicPowerComponent component, MetapsionicPowerActionEvent args)
{
foreach (var entity in _lookup.GetEntitiesInRange(uid, component.Range))
Expand Down
30 changes: 0 additions & 30 deletions Content.Server/Abilities/Psionics/Abilities/MindSwapPowerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,15 @@
using Content.Server.Popups;
using Content.Server.Psionics;
using Content.Server.GameTicking;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;
using Content.Shared.Mind;
using Content.Shared.Actions.Events;

namespace Content.Server.Abilities.Psionics
{
public sealed class MindSwapPowerSystem : EntitySystem
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly SharedActionsSystem _actions = default!;
[Dependency] private readonly MobStateSystem _mobStateSystem = default!;
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly SharedPsionicAbilitiesSystem _psionics = default!;
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly MindSystem _mindSystem = default!;
Expand All @@ -31,8 +27,6 @@ public sealed class MindSwapPowerSystem : EntitySystem
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<MindSwapPowerComponent, ComponentInit>(OnInit);
SubscribeLocalEvent<MindSwapPowerComponent, ComponentShutdown>(OnShutdown);
SubscribeLocalEvent<MindSwapPowerActionEvent>(OnPowerUsed);
SubscribeLocalEvent<MindSwappedComponent, MindSwapPowerReturnActionEvent>(OnPowerReturned);
SubscribeLocalEvent<MindSwappedComponent, DispelledEvent>(OnDispelled);
Expand All @@ -42,28 +36,6 @@ public override void Initialize()
SubscribeLocalEvent<MindSwappedComponent, ComponentInit>(OnSwapInit);
}

private void OnInit(EntityUid uid, MindSwapPowerComponent component, ComponentInit args)
{
_actions.AddAction(uid, ref component.MindSwapActionEntity, component.MindSwapActionId );
_actions.TryGetActionData( component.MindSwapActionEntity, out var actionData );
if (actionData is { UseDelay: not null })
_actions.StartUseDelay(component.MindSwapActionEntity);
if (TryComp<PsionicComponent>(uid, out var psionic) && psionic.PsionicAbility == null)
{
psionic.PsionicAbility = component.MindSwapActionEntity;
psionic.ActivePowers.Add(component);
}
}

private void OnShutdown(EntityUid uid, MindSwapPowerComponent component, ComponentShutdown args)
{
_actions.RemoveAction(uid, component.MindSwapActionEntity);
if (TryComp<PsionicComponent>(uid, out var psionic))
{
psionic.ActivePowers.Remove(component);
}
}

private void OnPowerUsed(MindSwapPowerActionEvent args)
{
if (!(TryComp<DamageableComponent>(args.Target, out var damageable) && damageable.DamageContainerID == "Biological"))
Expand Down Expand Up @@ -151,8 +123,6 @@ private void OnSwapInit(EntityUid uid, MindSwappedComponent component, Component
_actions.TryGetActionData( component.MindSwapReturnActionEntity, out var actionData );
if (actionData is { UseDelay: not null })
_actions.StartUseDelay(component.MindSwapReturnActionEntity);
if (TryComp<PsionicComponent>(uid, out var psionic) && psionic.PsionicAbility == null)
psionic.PsionicAbility = component.MindSwapReturnActionEntity;
}

public void Swap(EntityUid performer, EntityUid target, bool end = false)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,63 +1,27 @@
using Content.Shared.Actions;
using Content.Shared.Abilities.Psionics;
using Content.Server.Psionics;
using Content.Shared.StatusEffect;
using Content.Server.Stunnable;
using Content.Server.Beam;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;
using Content.Server.Mind;
using Content.Shared.Actions.Events;

namespace Content.Server.Abilities.Psionics
{
public sealed class NoosphericZapPowerSystem : EntitySystem
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly SharedActionsSystem _actions = default!;
[Dependency] private readonly SharedPsionicAbilitiesSystem _psionics = default!;
[Dependency] private readonly StunSystem _stunSystem = default!;
[Dependency] private readonly StatusEffectsSystem _statusEffectsSystem = default!;
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly BeamSystem _beam = default!;
[Dependency] private readonly MindSystem _mindSystem = default!;


public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<NoosphericZapPowerComponent, ComponentInit>(OnInit);
SubscribeLocalEvent<NoosphericZapPowerComponent, ComponentShutdown>(OnShutdown);
SubscribeLocalEvent<NoosphericZapPowerActionEvent>(OnPowerUsed);
}

private void OnInit(EntityUid uid, NoosphericZapPowerComponent component, ComponentInit args)
{
_actions.AddAction(uid, ref component.NoosphericZapActionEntity, component.NoosphericZapActionId );
_actions.TryGetActionData( component.NoosphericZapActionEntity, out var actionData );
if (actionData is { UseDelay: not null })
_actions.StartUseDelay(component.NoosphericZapActionEntity);
if (TryComp<PsionicComponent>(uid, out var psionic) && psionic.PsionicAbility == null)
{
psionic.PsionicAbility = component.NoosphericZapActionEntity;
psionic.ActivePowers.Add(component);
}
}

private void OnShutdown(EntityUid uid, NoosphericZapPowerComponent component, ComponentShutdown args)
{
_actions.RemoveAction(uid, component.NoosphericZapActionEntity);
if (TryComp<PsionicComponent>(uid, out var psionic))
{
psionic.ActivePowers.Remove(component);
}
}

private void OnPowerUsed(NoosphericZapPowerActionEvent args)
{
if (!HasComp<PotentialPsionicComponent>(args.Target))
return;

if (HasComp<PsionicInsulationComponent>(args.Target))
return;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,61 +6,29 @@
using Content.Shared.Stealth;
using Content.Shared.Stealth.Components;
using Content.Server.Psionics;
using Robust.Shared.Prototypes;
using Robust.Shared.Player;
using Robust.Shared.Audio;
using Robust.Shared.Timing;
using Content.Server.Mind;
using Content.Shared.Actions.Events;
using Robust.Shared.Audio.Systems;

namespace Content.Server.Abilities.Psionics
{
public sealed class PsionicInvisibilityPowerSystem : EntitySystem
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly SharedActionsSystem _actions = default!;
[Dependency] private readonly SharedStunSystem _stunSystem = default!;
[Dependency] private readonly SharedPsionicAbilitiesSystem _psionics = default!;
[Dependency] private readonly SharedStealthSystem _stealth = default!;
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly MindSystem _mindSystem = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;

public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<PsionicInvisibilityPowerComponent, ComponentInit>(OnInit);
SubscribeLocalEvent<PsionicInvisibilityPowerComponent, ComponentShutdown>(OnShutdown);
SubscribeLocalEvent<PsionicInvisibilityPowerComponent, PsionicInvisibilityPowerActionEvent>(OnPowerUsed);
SubscribeLocalEvent<RemovePsionicInvisibilityOffPowerActionEvent>(OnPowerOff);
SubscribeLocalEvent<PsionicInvisibilityUsedComponent, ComponentInit>(OnStart);
SubscribeLocalEvent<PsionicInvisibilityUsedComponent, ComponentShutdown>(OnEnd);
SubscribeLocalEvent<PsionicInvisibilityUsedComponent, DamageChangedEvent>(OnDamageChanged);
}

private void OnInit(EntityUid uid, PsionicInvisibilityPowerComponent component, ComponentInit args)
{
_actions.AddAction(uid, ref component.PsionicInvisibilityActionEntity, component.PsionicInvisibilityActionId );
_actions.TryGetActionData( component.PsionicInvisibilityActionEntity, out var actionData );
if (actionData is { UseDelay: not null })
_actions.StartUseDelay(component.PsionicInvisibilityActionEntity);
if (TryComp<PsionicComponent>(uid, out var psionic) && psionic.PsionicAbility == null)
{
psionic.PsionicAbility = component.PsionicInvisibilityActionEntity;
psionic.ActivePowers.Add(component);
}
}

private void OnShutdown(EntityUid uid, PsionicInvisibilityPowerComponent component, ComponentShutdown args)
{
_actions.RemoveAction(uid, component.PsionicInvisibilityActionEntity);
if (TryComp<PsionicComponent>(uid, out var psionic))
{
psionic.ActivePowers.Remove(component);
}
}

private void OnPowerUsed(EntityUid uid, PsionicInvisibilityPowerComponent component, PsionicInvisibilityPowerActionEvent args)
{
if (HasComp<PsionicInvisibilityUsedComponent>(uid))
Expand Down
Loading
Loading