Skip to content

Commit

Permalink
Outline fixes and address some upstream refactor conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
vaketola committed Nov 6, 2023
1 parent 20d8546 commit 279bda9
Show file tree
Hide file tree
Showing 10 changed files with 82 additions and 63 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace Content.Server.SimpleStation14.Species.Shadowkin.Components;

[RegisterComponent]
public sealed class ShadowkinBlackeyeTraitComponent : Component
public sealed partial class ShadowkinBlackeyeTraitComponent : Component
{

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace Content.Server.SimpleStation14.Species.Shadowkin.Components;

[RegisterComponent]
public sealed class ShadowkinDarkSwapPowerComponent : Component
public sealed partial class ShadowkinDarkSwapPowerComponent : Component
{

public EntityUid? ActionShadowkinDarkSwap { get; set; }
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace Content.Server.SimpleStation14.Species.Shadowkin.Components;

[RegisterComponent]
public sealed class ShadowkinLightComponent : Component
public sealed partial class ShadowkinLightComponent : Component
{
[ViewVariables(VVAccess.ReadOnly)]
public EntityUid AttachedEntity = EntityUid.Invalid;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
namespace Content.Server.SimpleStation14.Species.Shadowkin.Components;

[RegisterComponent]
public sealed class ShadowkinRestPowerComponent : Component
public sealed partial class ShadowkinRestPowerComponent : Component
{
[ViewVariables(VVAccess.ReadOnly)]
public bool IsResting = false;

public EntityUid? ActionShadowkinRest { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Content.Server.SimpleStation14.Species.Shadowkin.Components;

[RegisterComponent]
public sealed class ShadowkinTeleportPowerComponent : Component
public sealed partial class ShadowkinTeleportPowerComponent : Component
{

public EntityUid? ActionShadowkinTeleport { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
using Content.Server.SimpleStation14.Species.Shadowkin.Events;
using Content.Server.Visible;
using Content.Shared.Actions;
using Content.Shared.Actions.ActionTypes;
using Content.Shared.CombatMode.Pacification;
using Content.Shared.Cuffs.Components;
using Content.Shared.Damage.Systems;
using Content.Shared.Ghost;
using Content.Shared.SimpleStation14.Species.Shadowkin.Components;
using Content.Shared.SimpleStation14.Species.Shadowkin.Events;
using Content.Shared.Stealth;
Expand Down Expand Up @@ -47,12 +47,14 @@ public override void Initialize()

private void Startup(EntityUid uid, ShadowkinDarkSwapPowerComponent component, ComponentStartup args)
{
_actions.AddAction(uid, new InstantAction(_prototype.Index<InstantActionPrototype>("ShadowkinDarkSwap")), null);
var componentActionShadowkinDarkSwap = component.ActionShadowkinDarkSwap;
_actions.AddAction(uid, ref componentActionShadowkinDarkSwap, "ActionShadowkinDarkSwap");
// _actions.AddAction(uid, "ActionShadowkinDarkSwap");
}

private void Shutdown(EntityUid uid, ShadowkinDarkSwapPowerComponent component, ComponentShutdown args)
{
_actions.RemoveAction(uid, new InstantAction(_prototype.Index<InstantActionPrototype>("ShadowkinDarkSwap")));
_actions.RemoveAction(uid, component.ActionShadowkinDarkSwap);
}


Expand Down Expand Up @@ -87,6 +89,7 @@ private void DarkSwap(EntityUid uid, ShadowkinDarkSwapPowerComponent component,
);
_magic.Speak(args, false);
}

public void SetDarkened(
EntityUid performer,
bool addComp,
Expand Down Expand Up @@ -128,12 +131,14 @@ public void SetDarkened(
if (args != null)
args.Handled = true;
}

private void OnInvisStartup(EntityUid uid, ShadowkinDarkSwappedComponent component, ComponentStartup args)
{
EnsureComp<PacifiedComponent>(uid);
if (component.Invisible)
SetCanSeeInvisibility(uid, true);
}

private void OnInvisShutdown(EntityUid uid, ShadowkinDarkSwappedComponent component, ComponentShutdown args)
{
RemComp<PacifiedComponent>(uid);
Expand All @@ -149,15 +154,17 @@ private void OnInvisShutdown(EntityUid uid, ShadowkinDarkSwappedComponent compon
}
component.DarkenedLights.Clear();
}

// Commented out eye and ghost stuff until ported
public void SetCanSeeInvisibility(EntityUid uid, bool set)
{
var visibility = _entity.EnsureComponent<VisibilityComponent>(uid);
if (set)
{
if (_entity.TryGetComponent(uid, out EyeComponent? eye))
/*if (_entity.TryGetComponent(uid, out EyeComponent? eye))
{
eye.VisibilityMask |= (uint) VisibilityFlags.DarkSwapInvisibility;
}
}*/
_visibility.AddLayer(uid, visibility, (int) VisibilityFlags.DarkSwapInvisibility, false);
_visibility.RemoveLayer(uid, visibility, (int) VisibilityFlags.Normal, false);
_visibility.RefreshVisibility(uid);
Expand All @@ -166,10 +173,10 @@ public void SetCanSeeInvisibility(EntityUid uid, bool set)
}
else
{
if (_entity.TryGetComponent(uid, out EyeComponent? eye))
/*if (_entity.TryGetComponent(uid, out EyeComponent? eye))
{
eye.VisibilityMask &= ~(uint) VisibilityFlags.DarkSwapInvisibility;
}
// eye.VisibilityMask &= ~(uint) VisibilityFlags.DarkSwapInvisibility;
}*/
_visibility.RemoveLayer(uid, visibility, (int) VisibilityFlags.DarkSwapInvisibility, false);
_visibility.AddLayer(uid, visibility, (int) VisibilityFlags.Normal, false);
_visibility.RefreshVisibility(uid);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Content.Server.SimpleStation14.Species.Shadowkin.Components;
using Content.Server.SimpleStation14.Species.Shadowkin.Events;
using Content.Shared.Actions;
using Content.Shared.Actions.ActionTypes;
using Content.Shared.Bed.Sleep;
using Content.Shared.Cuffs.Components;
using Content.Shared.SimpleStation14.Species.Shadowkin.Components;
Expand Down Expand Up @@ -29,12 +28,13 @@ public override void Initialize()

private void OnStartup(EntityUid uid, ShadowkinRestPowerComponent component, ComponentStartup args)
{
_actions.AddAction(uid, new InstantAction(_prototype.Index<InstantActionPrototype>("ShadowkinRest")), null);
var componentActionShadowkinRest = component.ActionShadowkinRest;
_actions.AddAction(uid, ref componentActionShadowkinRest, "ActionShadowkinRest");
}

private void OnShutdown(EntityUid uid, ShadowkinRestPowerComponent component, ComponentShutdown args)
{
_actions.RemoveAction(uid, new InstantAction(_prototype.Index<InstantActionPrototype>("ShadowkinRest")));
_actions.RemoveAction(uid, component.ActionShadowkinRest);
}

private void Rest(EntityUid uid, ShadowkinRestPowerComponent component, ShadowkinRestEvent args)
Expand All @@ -57,7 +57,9 @@ private void Rest(EntityUid uid, ShadowkinRestPowerComponent component, Shadowki
// Sleepy time
_entity.EnsureComponent<ForcedSleepingComponent>(args.Performer);
// No waking up normally (it would do nothing)
_actions.RemoveAction(args.Performer, new InstantAction(_prototype.Index<InstantActionPrototype>("Wake")));
// Not sure what needs to be done here with the refactor
// _actions.RemoveAction(args.Performer, component.WakeAction); // ??
// _actions.RemoveAction(args.Performer, new InstantAction(_prototype.Index<InstantActionPrototype>("Wake")));

_power.TryAddMultiplier(args.Performer, 1.5f);
// No action cooldown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using Content.Server.SimpleStation14.Species.Shadowkin.Components;
using Content.Server.SimpleStation14.Species.Shadowkin.Events;
using Content.Shared.Actions;
using Content.Shared.Actions.ActionTypes;
using Content.Shared.Cuffs.Components;
using Content.Shared.Damage.Systems;
using Content.Shared.Pulling.Components;
Expand Down Expand Up @@ -38,12 +37,15 @@ public override void Initialize()

private void Startup(EntityUid uid, ShadowkinTeleportPowerComponent component, ComponentStartup args)
{
_actions.AddAction(uid, new WorldTargetAction(_prototype.Index<WorldTargetActionPrototype>("ShadowkinTeleport")), null);
var componentActionShadowkinTeleport = component.ActionShadowkinTeleport;
_actions.AddAction(uid, ref componentActionShadowkinTeleport, "ActionShadowkinTeleport");
// _actions.AddAction(uid, new WorldTargetAction(_prototype.Index<WorldTargetActionPrototype>("ShadowkinTeleport")), null);
}

private void Shutdown(EntityUid uid, ShadowkinTeleportPowerComponent component, ComponentShutdown args)
{
_actions.RemoveAction(uid, new WorldTargetAction(_prototype.Index<WorldTargetActionPrototype>("ShadowkinTeleport")));
_actions.RemoveAction(uid, component.ActionShadowkinTeleport);
// _actions.RemoveAction(uid, new WorldTargetAction(_prototype.Index<WorldTargetActionPrototype>("ShadowkinTeleport")));
}


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Numerics;
using Content.Server.Mind;
using Content.Server.Mind.Components;
using Content.Shared.Mind.Components;
using Content.Server.SimpleStation14.Species.Shadowkin.Events;
using Content.Shared.Bed.Sleep;
using Content.Shared.Cuffs.Components;
Expand Down Expand Up @@ -100,7 +100,7 @@ public override void Update(float frameTime)
}

// Don't update things for ssd shadowkin
if (!_entity.System<MindSystem>().TryGetMind(uid, out var mind) ||
if (!_entity.System<MindSystem>().TryGetMind(uid, out var mindId, out var mind) ||
mind.Session == null)
continue;

Expand Down
84 changes: 45 additions & 39 deletions Resources/Prototypes/SimpleStation14/Magic/shadowkin.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,53 @@
- type: worldTargetAction
id: ShadowkinTeleport
- type: entity
id: ActionShadowkinTeleport
name: action-name-shadowkin-teleport
description: action-description-shadowkin-teleport
useDelay: 5
range: 32
itemIconStyle: NoItem
checkCanAccess: true
repeat: true
priority: -20
icon:
sprite: SimpleStation14/Interface/Actions/shadowkin_icons.rsi
state: teleport
serverEvent: !type:ShadowkinTeleportEvent
powerCost: 40
staminaCost: 20
speech: action-description-shadowkin-teleport
components:
- type: WorldTargetAction
useDelay: 5
range: 32
itemIconStyle: NoItem
checkCanAccess: true
repeat: true
priority: -20
icon:
sprite: SimpleStation14/Interface/Actions/shadowkin_icons.rsi
state: teleport
serverEvent: !type:ShadowkinTeleportEvent
powerCost: 40
staminaCost: 20
speech: action-description-shadowkin-teleport

- type: instantAction
id: ShadowkinDarkSwap
- type: entity
id: ActionShadowkinDarkSwap
name: action-name-shadowkin-darkswap
description: action-description-shadowkin-darkswap
useDelay: 15
itemIconStyle: NoItem
priority: -21
icon:
sprite: SimpleStation14/Interface/Actions/shadowkin_icons.rsi
state: darkswap
serverEvent: !type:ShadowkinDarkSwapEvent
powerCostOn: 60
powerCostOff: 45
staminaCostOn: 25
staminaCostOff: 25
speech: action-description-shadowkin-darkswap
components:
- type: InstantAction
useDelay: 15
itemIconStyle: NoItem
priority: -21
icon:
sprite: SimpleStation14/Interface/Actions/shadowkin_icons.rsi
state: darkswap
serverEvent: !type:ShadowkinDarkSwapEvent
powerCostOn: 60
powerCostOff: 45
staminaCostOn: 25
staminaCostOff: 25
speech: action-description-shadowkin-darkswap

- type: instantAction
id: ShadowkinRest
- type: entity
id: ActionShadowkinRest
name: action-name-shadowkin-rest
description: action-description-shadowkin-rest
useDelay: 60
itemIconStyle: NoItem
priority: -22
icon:
sprite: SimpleStation14/Interface/Actions/shadowkin_icons.rsi
state: rest
checkCanInteract: false
serverEvent: !type:ShadowkinRestEvent
components:
- type: InstantAction
useDelay: 60
itemIconStyle: NoItem
priority: -22
icon:
sprite: SimpleStation14/Interface/Actions/shadowkin_icons.rsi
state: rest
checkCanInteract: false
serverEvent: !type:ShadowkinRestEvent

0 comments on commit 279bda9

Please sign in to comment.