Skip to content

Commit

Permalink
Merge pull request #19 from whateverusername0/cultists
Browse files Browse the repository at this point in the history
help
  • Loading branch information
Piras314 authored Jun 22, 2024
2 parents 1ba8b31 + 6869c23 commit fb4df9a
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,17 @@ public sealed partial class RuneCasterComponent : SharedRuneCasterComponent

[ViewVariables(VVAccess.ReadWrite)]
[DataField("selectableColor")]
public bool SelectableColor { get; set; }
public bool SelectableColor;

[ViewVariables(VVAccess.ReadWrite)]
public int Charges { get; set; }
public float Charges;

[ViewVariables(VVAccess.ReadWrite)]
[DataField("capacity")]
public int Capacity { get; set; } = 30;
public float Capacity = 30f;

[ViewVariables(VVAccess.ReadWrite)]
[DataField("runeCastDuration")]
public float RuneCasterDoAfterDuration = 1f;
}
}
13 changes: 11 additions & 2 deletions Content.Server/Goobstation/Cult/RuneCaster/RuneCasterSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,19 @@ private void OnRuneCasterAfterInteract(EntityUid uid, RuneCasterComponent compon

// Wait, then cast the rune
// TODO: RuneCasterDoAfterDuration needs to be added to component
_doAfter.TryStartDoAfter(new DoAfterArgs(EntityManager, args.User, component.RuneCasterDoAfterDuration, new RuneCasterDoAfterEvent(), uid, target: target, used: uid) {});

var dargs = new DoAfterArgs(EntityManager, args.User, component.RuneCasterDoAfterDuration, new RuneCasterDoAfterEvent(args.ClickLocation), uid, used: uid)
{
BreakOnDamage = true,
BreakOnMove = true,
BreakOnHandChange = false,
BreakOnWeightlessMove = false,
};

_doAfter.TryStartDoAfter(dargs);
}

private void OnDoAfter(EntityUid uid, RuneCasterComponent component, DoAfterEvent args)
private void OnDoAfter(EntityUid uid, RuneCasterComponent component, RuneCasterDoAfterEvent args)
{
// Make sure this do-after is still valid
if (args.Cancelled || args.Handled || args.Args.Target == null)
Expand Down
3 changes: 3 additions & 0 deletions Content.Shared.Database/LogType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,7 @@ public enum LogType
/// This is a default value used by <c>PlayerRateLimitManager</c>, though users can use different log types.
/// </remarks>
RateLimited = 91,

// GoobStation - cult
RuneCasterCast = 92,
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
using Content.Shared.DoAfter;
using Robust.Shared.Map;
using Robust.Shared.Serialization;

namespace Content.Shared.Goobstation.Cult.RuneCaster;

[Serializable, NetSerializable]
public sealed partial class RuneCasterDoAfterEvent : SimpleDoAfterEvent
{
/// <summary>
/// Location that the user clicked outside of their interaction range.
/// </summary>
public EntityCoordinates ClickLocation { get; }

public RuneCasterDoAfterEvent(EntityCoordinates clickLocation) : base()
{
ClickLocation = clickLocation;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ public sealed class RuneCasterComponentState : ComponentState
{
public readonly Color Color;
public readonly string State;
public readonly int Charges;
public readonly int Capacity;
public readonly float Charges;
public readonly float Capacity;

public RuneCasterComponentState(Color color, string state, int charges, int capacity)
public RuneCasterComponentState(Color color, string state, float charges, float capacity)
{
Color = color;
State = state;
Expand Down

0 comments on commit fb4df9a

Please sign in to comment.