Skip to content

Commit

Permalink
Fix shadowkin actions!
Browse files Browse the repository at this point in the history
  • Loading branch information
vaketola committed Feb 21, 2024
1 parent d5b22e8 commit 2902886
Show file tree
Hide file tree
Showing 8 changed files with 101 additions and 105 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using Content.Server.NPC.Components;
using Content.Server.NPC.Systems;
using Content.Server.SimpleStation14.Species.Shadowkin.Components;
using Content.Server.SimpleStation14.Species.Shadowkin.Events;
using Content.Shared.Actions;
using Content.Shared.CombatMode.Pacification;
using Content.Shared.Cuffs.Components;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using Content.Server.SimpleStation14.Species.Shadowkin.Components;
using Content.Server.SimpleStation14.Species.Shadowkin.Events;
using Content.Shared.Actions;
using Content.Shared.Bed.Sleep;
using Content.Shared.Cuffs.Components;
using Content.Shared.SimpleStation14.Species.Shadowkin.Components;
using Content.Shared.SimpleStation14.Species.Shadowkin.Events;
using Robust.Shared.Prototypes;

namespace Content.Server.SimpleStation14.Species.Shadowkin.Systems;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using Content.Server.Magic;
using Content.Server.Pulling;
using Content.Server.SimpleStation14.Species.Shadowkin.Components;
using Content.Server.SimpleStation14.Species.Shadowkin.Events;
using Content.Shared.Actions;
using Content.Shared.Cuffs.Components;
using Content.Shared.Damage.Systems;
using Content.Shared.Pulling.Components;
using Content.Shared.SimpleStation14.Species.Shadowkin.Components;
using Content.Shared.SimpleStation14.Species.Shadowkin.Events;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Prototypes;
Expand Down Expand Up @@ -66,7 +66,7 @@ private void Teleport(EntityUid uid, ShadowkinTeleportPowerComponent component,
var transform = Transform(args.Performer);
if (transform.MapID != args.Target.GetMapId(EntityManager))
return;

SharedPullableComponent? pullable = null; // To avoid "might not be initialized when accessed" warning
if (_entity.TryGetComponent<SharedPullerComponent>(args.Performer, out var puller) &&
puller.Pulling != null &&
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System.Numerics;
using Content.Server.Mind;
using Content.Shared.Mind.Components;
using Content.Server.SimpleStation14.Species.Shadowkin.Events;
using Content.Shared.Bed.Sleep;
using Content.Shared.Cuffs.Components;
using Content.Shared.Examine;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,98 @@
using Robust.Shared.Serialization;
using Content.Shared.Actions;
using Content.Shared.Magic;
using Robust.Shared.Audio;
using Robust.Shared.Serialization;

namespace Content.Shared.SimpleStation14.Species.Shadowkin.Events;


/// <summary>
/// Raised when the shadowkin teleport action is used.
/// </summary>
public sealed partial class ShadowkinTeleportEvent : WorldTargetActionEvent, ISpeakSpell
{
[DataField("sound")]
public SoundSpecifier Sound = new SoundPathSpecifier("/Audio/SimpleStation14/Effects/Shadowkin/Powers/teleport.ogg");

[DataField("volume")]
public float Volume = 5f;


[DataField("powerCost")]
public float PowerCost = 40f;

[DataField("staminaCost")]
public float StaminaCost = 20f;


[DataField("speech")]
public string? Speech { get; set; }
}

/// <summary>
/// Raised when the shadowkin darkSwap action is used.
/// </summary>
public sealed partial class ShadowkinDarkSwapEvent : InstantActionEvent, ISpeakSpell
{
[DataField("soundOn")]
public SoundSpecifier SoundOn = new SoundPathSpecifier("/Audio/SimpleStation14/Effects/Shadowkin/Powers/darkswapon.ogg");

[DataField("volumeOn")]
public float VolumeOn = 5f;

[DataField("soundOff")]
public SoundSpecifier SoundOff = new SoundPathSpecifier("/Audio/SimpleStation14/Effects/Shadowkin/Powers/darkswapoff.ogg");

[DataField("volumeOff")]
public float VolumeOff = 5f;


/// <summary>
/// How much stamina to drain when darkening.
/// </summary>
[DataField("powerCostOn")]
public float PowerCostOn = 60f;

/// <summary>
/// How much stamina to drain when lightening.
/// </summary>
[DataField("powerCostOff")]
public float PowerCostOff = 45f;

/// <summary>
/// How much stamina to drain when darkening.
/// </summary>
[DataField("staminaCostOn")]
public float StaminaCostOn;

/// <summary>
/// How much stamina to drain when lightening.
/// </summary>
[DataField("staminaCostOff")]
public float StaminaCostOff;


[DataField("speech")]
public string? Speech { get; set; }
}

public sealed class ShadowkinDarkSwapAttemptEvent : CancellableEntityEventArgs
{
EntityUid Performer;

public ShadowkinDarkSwapAttemptEvent(EntityUid performer)
{
Performer = performer;
}
}


public sealed partial class ShadowkinRestEvent: InstantActionEvent
{

}


/// <summary>
/// Raised over network to notify the client that they're going in/out of The Dark.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@
- type: NpcFactionMember
factions:
- NanoTrasen
- type: MailReceiver
- type: InteractionPopup
successChance: 0.75
interactFailureString: petting-failure-generic
Expand Down
12 changes: 6 additions & 6 deletions Resources/Prototypes/SimpleStation14/Magic/shadowkin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
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
checkCanAccess: true
repeat: true
priority: -20
event: !type:ShadowkinTeleportEvent
powerCost: 40
staminaCost: 20
speech: action-description-shadowkin-teleport
Expand All @@ -30,7 +30,7 @@
icon:
sprite: SimpleStation14/Interface/Actions/shadowkin_icons.rsi
state: darkswap
serverEvent: !type:ShadowkinDarkSwapEvent
event: !type:ShadowkinDarkSwapEvent
powerCostOn: 60
powerCostOff: 45
staminaCostOn: 25
Expand All @@ -50,4 +50,4 @@
sprite: SimpleStation14/Interface/Actions/shadowkin_icons.rsi
state: rest
checkCanInteract: false
serverEvent: !type:ShadowkinRestEvent
event: !type:ShadowkinRestEvent

0 comments on commit 2902886

Please sign in to comment.