Skip to content

Commit

Permalink
Brings it All Together.
Browse files Browse the repository at this point in the history
Dawn of the final Commit. Rebase completed.
  • Loading branch information
PHCodes committed Sep 28, 2023
1 parent a3d4013 commit 06d2a4a
Show file tree
Hide file tree
Showing 15 changed files with 33 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,14 @@ public override void Initialize()
SubscribeLocalEvent<RevenantComponent, DispelledEvent>(OnRevenantDispelled);
}

// 9/25/2023 by JJ. I have no idea what I'm doing. I've tried refactoring this the best I can. will test ASAP.
private void OnInit(EntityUid uid, DispelPowerComponent component, ComponentInit args)
{
/*_actions.AddAction(uid, ref component.DispelActionEntity, component.DispelActionId );
_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.PsionicAbility = component.DispelActionEntity;
}

private void OnShutdown(EntityUid uid, DispelPowerComponent component, ComponentShutdown args)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ public override void Initialize()

private void OnInit(EntityUid uid, MetapsionicPowerComponent component, ComponentInit args)
{
/*_actions.AddAction(uid, ref component.MetapsionicActionEntity, component.MetapsionicActionId );
_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;
*/

}

private void OnShutdown(EntityUid uid, MetapsionicPowerComponent component, ComponentShutdown args)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ public override void Initialize()

private void OnInit(EntityUid uid, MindSwapPowerComponent component, ComponentInit args)
{
/*_actions.AddAction(uid, ref component.MindSwapActionEntity, component.MindSwapActionId );
_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.PsionicAbility = component.MindSwapActionEntity;
}

private void OnShutdown(EntityUid uid, MindSwapPowerComponent component, ComponentShutdown args)
Expand Down Expand Up @@ -129,7 +129,7 @@ private void OnGhostAttempt(GhostAttemptHandleEvent args)
if (!HasComp<MindSwappedComponent>(args.Mind.CurrentEntity))
return;

//JJ Comment - No idea where the viaCommand went. It's on the internal OnGhostAttempt, but not this layer. Maybe unnecessary.
//No idea where the viaCommand went. It's on the internal OnGhostAttempt, but not this layer. Maybe unnecessary.
/*if (!args.viaCommand)
return;*/

Expand Down Expand Up @@ -174,10 +174,10 @@ public void Swap(EntityUid performer, EntityUid target, bool end = false)

if (end)
{
var performerMindPowerComp = EntityManager.GetComponent<MindSwapPowerComponent>(performer);
var targetMindPowerComp = EntityManager.GetComponent<MindSwapPowerComponent>(target);
_actions.RemoveAction(performer, performerMindPowerComp.MindSwapActionEntity);
_actions.RemoveAction(target, targetMindPowerComp.MindSwapActionEntity);
var performerMindPowerComp = EntityManager.GetComponent<MindSwappedComponent>(performer);
var targetMindPowerComp = EntityManager.GetComponent<MindSwappedComponent>(target);
_actions.RemoveAction(performer, performerMindPowerComp.MindSwapReturnActionEntity);
_actions.RemoveAction(target, targetMindPowerComp.MindSwapReturnActionEntity);

RemComp<MindSwappedComponent>(performer);
RemComp<MindSwappedComponent>(target);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ public override void Initialize()

private void OnInit(EntityUid uid, NoosphericZapPowerComponent component, ComponentInit args)
{
/*_actions.AddAction(uid, ref component.NoosphericZapActionEntity, component.NoosphericZapActionId );
_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.PsionicAbility = component.NoosphericZapActionEntity;
}

private void OnShutdown(EntityUid uid, NoosphericZapPowerComponent component, ComponentShutdown args)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ public override void Initialize()

private void OnInit(EntityUid uid, PsionicInvisibilityPowerComponent component, ComponentInit args)
{
/*_actions.AddAction(uid, ref component.PsionicInvisibilityActionEntity, component.PsionicInvisibilityActionId );
_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.PsionicAbility = component.PsionicInvisibilityActionEntity;
}

private void OnShutdown(EntityUid uid, PsionicInvisibilityPowerComponent component, ComponentShutdown args)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ public override void Initialize()

private void OnInit(EntityUid uid, PsionicRegenerationPowerComponent component, ComponentInit args)
{
/*_actions.AddAction(uid, ref component.PsionicRegenerationActionEntity, component.PsionicRegenerationActionId );
_actions.AddAction(uid, ref component.PsionicRegenerationActionEntity, component.PsionicRegenerationActionId );
_actions.TryGetActionData( component.PsionicRegenerationActionEntity, out var actionData );
if (actionData is { UseDelay: not null })
_actions.StartUseDelay(component.PsionicRegenerationActionEntity);
if (TryComp<PsionicComponent>(uid, out var psionic) && psionic.PsionicAbility == null)
psionic.PsionicAbility = component.PsionicRegenerationActionEntity; */
psionic.PsionicAbility = component.PsionicRegenerationActionEntity;
}

private void OnPowerUsed(EntityUid uid, PsionicRegenerationPowerComponent component, PsionicRegenerationPowerActionEvent args)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ public override void Initialize()

private void OnInit(EntityUid uid, PyrokinesisPowerComponent component, ComponentInit args)
{
/*_actions.AddAction(uid, ref component.PyrokinesisActionEntity, component.PyrokinesisActionId );
_actions.AddAction(uid, ref component.PyrokinesisActionEntity, component.PyrokinesisActionId );
_actions.TryGetActionData( component.PyrokinesisActionEntity, out var actionData );
if (actionData is { UseDelay: not null })
_actions.StartUseDelay(component.PyrokinesisActionEntity);
if (TryComp<PsionicComponent>(uid, out var psionic) && psionic.PsionicAbility == null)
psionic.PsionicAbility = component.PyrokinesisActionEntity;*/
psionic.PsionicAbility = component.PyrokinesisActionEntity;
}

private void OnShutdown(EntityUid uid, PyrokinesisPowerComponent component, ComponentShutdown args)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ public override void Initialize()

private void OnInit(EntityUid uid, TelegnosisPowerComponent component, ComponentInit args)
{
/*_actions.AddAction(uid, ref component.TelegnosisActionEntity, component.TelegnosisActionId );
_actions.AddAction(uid, ref component.TelegnosisActionEntity, component.TelegnosisActionId );
_actions.TryGetActionData( component.TelegnosisActionEntity, out var actionData );
if (actionData is { UseDelay: not null })
_actions.StartUseDelay(component.TelegnosisActionEntity);
if (TryComp<PsionicComponent>(uid, out var psionic) && psionic.PsionicAbility == null)
psionic.PsionicAbility = component.TelegnosisActionEntity;*/
psionic.PsionicAbility = component.TelegnosisActionEntity;
}

private void OnShutdown(EntityUid uid, TelegnosisPowerComponent component, ComponentShutdown args)
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Nyanotrasen/Chat/TSayCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void Execute(IConsoleShell shell, string argStr, string[] args)
var message = string.Join(" ", args).Trim();
if (string.IsNullOrEmpty(message))
return;
//JJ: Not sure if I should hide the logs from this. Default is false.
//Not sure if I should hide the logs from this. Default is false.
EntitySystem.Get<ChatSystem>().TrySendInGameICMessage(playerEntity, message, InGameICChatType.Telepathic, ChatTransmitRange.Normal, false, shell, player);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ private void SwitchReagent(EntityUid uid, SolutionRegenerationSwitcherComponent
//Only reagents with spritePath property can change appearance of transformable containers!
if (!string.IsNullOrWhiteSpace(primaryId?.Prototype))
{
//JJ Comment - Can't get this to realize I've checked if it's Null already.
if (!_prototypeManager.TryIndex(primaryId.Value.Prototype, out proto))
{
_sawmill.Error($"Can't get get reagent prototype {primaryId} for {ToPrettyString(uid)}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public void SetCanSeePsionicInvisiblity(EntityUid uid, bool set)
{
if (EntityManager.TryGetComponent(uid, out EyeComponent? eye))
{
_eye.SetVisibilityMask(uid, eye.VisibilityMask & (int) VisibilityFlags.PsionicInvisibility, eye);
//_eye.SetVisibilityMask(uid, eye.VisibilityMask & (int) VisibilityFlags.PsionicInvisibility, eye);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ protected override void Started(EntityUid uid, NoosphericFryRuleComponent compon
if (TryComp<FlammableComponent>(pair.wearer, out var flammableComponent))
{
flammableComponent.FireStacks += 1;
//JJ Comment - Need a target for the igniter. Not sure this is right.
_flammableSystem.Ignite(pair.wearer, pair.wearer, flammableComponent);
}
} else if (_glimmerSystem.Glimmer > 750)
Expand All @@ -91,7 +90,6 @@ protected override void Started(EntityUid uid, NoosphericFryRuleComponent compon
if (TryComp<FlammableComponent>(pair.wearer, out var flammableComponent))
{
flammableComponent.FireStacks += 2;
//JJ Comment - Need a target for the igniter. Not sure this is right.
_flammableSystem.Ignite(pair.wearer, pair.wearer, flammableComponent);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ public override void Initialize()

private void OnInit(EntityUid uid, MassSleepPowerComponent component, ComponentInit args)
{
/*_actions.AddAction(uid, ref component.MassSleepActionEntity, component.MassSleepActionId );
_actions.AddAction(uid, ref component.MassSleepActionEntity, component.MassSleepActionId );
_actions.TryGetActionData( component.MassSleepActionEntity, out var actionData );
if (actionData is { UseDelay: not null })
_actions.StartUseDelay(component.MassSleepActionEntity);
if (TryComp<PsionicComponent>(uid, out var psionic) && psionic.PsionicAbility == null)
psionic.PsionicAbility = component.MassSleepActionEntity;*/
psionic.PsionicAbility = component.MassSleepActionEntity;
}

private void OnShutdown(EntityUid uid, MassSleepPowerComponent component, ComponentShutdown args)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ public PsionicPowerUsedEvent(EntityUid user, string power)
[NetSerializable]
public sealed class PsionicsChangedEvent : EntityEventArgs
{
public readonly EntityUid Euid;
public PsionicsChangedEvent(EntityUid euid)
public readonly NetEntity Euid;
public PsionicsChangedEvent(NetEntity euid)
{
Euid = euid;
}
Expand Down
12 changes: 6 additions & 6 deletions Resources/Prototypes/Nyanotrasen/psionicPowers.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
- type: weightedRandom
id: RandomPsionicPowerPool
weights:
MetapsionicPower: 1
DispelPower: 1
TelegnosisPower: 1
PsionicRegenerationPower: 1
MassSleepPower: 0.3
#MetapsionicPower: 1
#DispelPower: 1
#TelegnosisPower: 1
#PsionicRegenerationPower: 1
#MassSleepPower: 0.3
PsionicInvisibilityPower: 0.15
MindSwapPower: 0.15
#MindSwapPower: 0.15

0 comments on commit 06d2a4a

Please sign in to comment.