Skip to content

Commit

Permalink
2 lines of sec
Browse files Browse the repository at this point in the history
  • Loading branch information
deltanedas committed Sep 22, 2024
1 parent 7b4ee80 commit 077996e
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 43 deletions.
2 changes: 1 addition & 1 deletion Content.Client/DeltaV/Chapel/SacraficialAltarSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

namespace Content.Client.DeltaV.Chapel;

public sealed class SacraficialAltarSystem : SharedSacraficialAltarSystem;
public sealed class SacrificialAltarSystem : SharedSacrificialAltarSystem;
24 changes: 12 additions & 12 deletions Content.Server/DeltaV/Chapel/SacraficialAltarSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

namespace Content.Server.DeltaV.Chapel;

public sealed class SacraficialAltarSystem : SharedSacraficialAltarSystem
public sealed class SacrificialAltarSystem : SharedSacrificialAltarSystem
{
[Dependency] private readonly EntityTableSystem _entityTable = default!;
[Dependency] private readonly GlimmerSystem _glimmer = default!;
Expand All @@ -35,12 +35,12 @@ public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<SacraficialAltarComponent, SacraficeDoAfterEvent>(OnDoAfter);
SubscribeLocalEvent<SacrificialAltarComponent, SacrificeDoAfterEvent>(OnDoAfter);
}

private void OnDoAfter(Entity<SacraficialAltarComponent> ent, ref SacraficeDoAfterEvent args)
private void OnDoAfter(Entity<SacrificialAltarComponent> ent, ref SacrificeDoAfterEvent args)
{
ent.Comp.SacraficeStream = _audio.Stop(ent.Comp.SacraficeStream);
ent.Comp.SacrificeStream = _audio.Stop(ent.Comp.SacrificeStream);
ent.Comp.DoAfter = null;

var user = args.Args.User;
Expand All @@ -55,7 +55,7 @@ private void OnDoAfter(Entity<SacraficialAltarComponent> ent, ref SacraficeDoAft
if (!HasComp<PsionicComponent>(target))
return;

_adminLogger.Add(LogType.Action, LogImpact.Extreme, $"{ToPrettyString(user):player} sacraficed {ToPrettyString(target):target} on {ToPrettyString(ent):altar}");
_adminLogger.Add(LogType.Action, LogImpact.Extreme, $"{ToPrettyString(user):player} sacrificed {ToPrettyString(target):target} on {ToPrettyString(ent):altar}");

// lower glimmer by a random amount
_glimmer.Glimmer -= ent.Comp.GlimmerReduction.Next(_random);
Expand All @@ -77,12 +77,12 @@ private void OnDoAfter(Entity<SacraficialAltarComponent> ent, ref SacraficeDoAft
QueueDel(target);
}

protected override void AttemptSacrafice(Entity<SacraficialAltarComponent> ent, EntityUid user, EntityUid target)
protected override void AttemptSacrifice(Entity<SacrificialAltarComponent> ent, EntityUid user, EntityUid target)
{
if (ent.Comp.DoAfter != null)
return;

// can't sacrafice yourself
// can't sacrifice yourself
if (user == target)
{
_popup.PopupEntity(Loc.GetString("altar-failure-reason-self"), ent, user, PopupType.SmallCaution);
Expand All @@ -104,7 +104,7 @@ protected override void AttemptSacrafice(Entity<SacraficialAltarComponent> ent,
}

// prevent psichecking SSD people...
// notably there is no check in OnDoAfter so you can't alt f4 to survive being sacraficed
// notably there is no check in OnDoAfter so you can't alt f4 to survive being sacrificed
if (!HasComp<ActorComponent>(target) || _mind.GetMind(target) == null)
{
_popup.PopupEntity(Loc.GetString("altar-failure-reason-target-catatonic", ("target", target)), ent, user, PopupType.SmallCaution);
Expand All @@ -124,12 +124,12 @@ protected override void AttemptSacrafice(Entity<SacraficialAltarComponent> ent,
return;
}

_popup.PopupEntity(Loc.GetString("altar-sacrafice-popup", ("user", user), ("target", target)), ent, PopupType.LargeCaution);
_popup.PopupEntity(Loc.GetString("altar-sacrifice-popup", ("user", user), ("target", target)), ent, PopupType.LargeCaution);

ent.Comp.SacraficeStream = _audio.PlayPvs(ent.Comp.SacraficeSound, ent)?.Entity;
ent.Comp.SacrificeStream = _audio.PlayPvs(ent.Comp.SacrificeSound, ent)?.Entity;

var ev = new SacraficeDoAfterEvent();
var args = new DoAfterArgs(EntityManager, user, ent.Comp.SacraficeTime, ev, target: target, eventTarget: ent)
var ev = new SacrificeDoAfterEvent();
var args = new DoAfterArgs(EntityManager, user, ent.Comp.SacrificeTime, ev, target: target, eventTarget: ent)
{
BreakOnDamage = true,
NeedHand = true
Expand Down
22 changes: 11 additions & 11 deletions Content.Shared/DeltaV/Chapel/SacraficialAltarComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,29 @@
namespace Content.Shared.DeltaV.Chapel;

/// <summary>
/// Altar that lets you sacrafice psionics to lower glimmer by a large amount.
/// Altar that lets you sacrifice psionics to lower glimmer by a large amount.
/// </summary>
[RegisterComponent, NetworkedComponent, Access(typeof(SharedSacraficialAltarSystem))]
public sealed partial class SacraficialAltarComponent : Component
[RegisterComponent, NetworkedComponent, Access(typeof(SharedSacrificialAltarSystem))]
public sealed partial class SacrificialAltarComponent : Component
{
/// <summary>
/// DoAfter for an active sacrafice.
/// DoAfter for an active sacrifice.
/// </summary>
[DataField]
public DoAfterId? DoAfter;

/// <summary>
/// How long it takes to sacrafice someone once they die.
/// This is the window to interrupt a sacrafice if you want glimmer to stay high, or need the psionic to be revived.
/// How long it takes to sacrifice someone once they die.
/// This is the window to interrupt a sacrifice if you want glimmer to stay high, or need the psionic to be revived.
/// </summary>
[DataField]
public TimeSpan SacraficeTime = TimeSpan.FromSeconds(8.35);
public TimeSpan SacrificeTime = TimeSpan.FromSeconds(8.35);

[DataField]
public SoundSpecifier SacraficeSound = new SoundPathSpecifier("/Audio/DeltaV/Effects/clang2.ogg");
public SoundSpecifier SacrificeSound = new SoundPathSpecifier("/Audio/DeltaV/Effects/clang2.ogg");

[DataField]
public EntityUid? SacraficeStream;
public EntityUid? SacrificeStream;

/// <summary>
/// Random amount to reduce glimmer by.
Expand All @@ -40,8 +40,8 @@ public sealed partial class SacraficialAltarComponent : Component
public MinMax GlimmerReduction = new(30, 60);

[DataField]
public ProtoId<EntityTablePrototype> RewardPool = "PsionicSacraficeRewards";
public ProtoId<EntityTablePrototype> RewardPool = "PsionicSacrificeRewards";
}

[Serializable, NetSerializable]
public sealed partial class SacraficeDoAfterEvent : SimpleDoAfterEvent;
public sealed partial class SacrificeDoAfterEvent : SimpleDoAfterEvent;
20 changes: 10 additions & 10 deletions Content.Shared/DeltaV/Chapel/SharedSacraficialAltarSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Content.Shared.DeltaV.Chapel;

public abstract class SharedSacraficialAltarSystem : EntitySystem
public abstract class SharedSacrificialAltarSystem : EntitySystem
{
[Dependency] private readonly SharedBuckleSystem _buckle = default!;
[Dependency] protected readonly SharedDoAfterSystem DoAfter = default!;
Expand All @@ -15,17 +15,17 @@ public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<SacraficialAltarComponent, ExaminedEvent>(OnExamined);
SubscribeLocalEvent<SacraficialAltarComponent, UnstrappedEvent>(OnUnstrapped);
SubscribeLocalEvent<SacraficialAltarComponent, GetVerbsEvent<AlternativeVerb>>(OnGetVerbs);
SubscribeLocalEvent<SacrificialAltarComponent, ExaminedEvent>(OnExamined);
SubscribeLocalEvent<SacrificialAltarComponent, UnstrappedEvent>(OnUnstrapped);
SubscribeLocalEvent<SacrificialAltarComponent, GetVerbsEvent<AlternativeVerb>>(OnGetVerbs);
}

private void OnExamined(Entity<SacraficialAltarComponent> ent, ref ExaminedEvent args)
private void OnExamined(Entity<SacrificialAltarComponent> ent, ref ExaminedEvent args)
{
args.PushMarkup(Loc.GetString("altar-examine"));
}

private void OnUnstrapped(Entity<SacraficialAltarComponent> ent, ref UnstrappedEvent args)
private void OnUnstrapped(Entity<SacrificialAltarComponent> ent, ref UnstrappedEvent args)
{
if (ent.Comp.DoAfter is {} id)
{
Expand All @@ -34,7 +34,7 @@ private void OnUnstrapped(Entity<SacraficialAltarComponent> ent, ref UnstrappedE
}
}

private void OnGetVerbs(Entity<SacraficialAltarComponent> ent, ref GetVerbsEvent<AlternativeVerb> args)
private void OnGetVerbs(Entity<SacrificialAltarComponent> ent, ref GetVerbsEvent<AlternativeVerb> args)
{
if (!args.CanAccess || !args.CanInteract || ent.Comp.DoAfter != null)
return;
Expand All @@ -48,8 +48,8 @@ private void OnGetVerbs(Entity<SacraficialAltarComponent> ent, ref GetVerbsEvent
var user = args.User;
args.Verbs.Add(new AlternativeVerb()
{
Act = () => AttemptSacrafice(ent, user, target),
Text = Loc.GetString("altar-sacrafice-verb"),
Act = () => AttemptSacrifice(ent, user, target),
Text = Loc.GetString("altar-sacrifice-verb"),
Priority = 2
});
}
Expand All @@ -64,7 +64,7 @@ private void OnGetVerbs(Entity<SacraficialAltarComponent> ent, ref GetVerbsEvent
return null;
}

protected virtual void AttemptSacrafice(Entity<SacraficialAltarComponent> ent, EntityUid user, EntityUid target)
protected virtual void AttemptSacrifice(Entity<SacrificialAltarComponent> ent, EntityUid user, EntityUid target)
{
}
}
6 changes: 3 additions & 3 deletions Resources/Locale/en-US/deltav/chapel/altar.ftl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
altar-examine = [color=purple]This altar can be used to sacrafice Psionics.[/color]
altar-sacrafice-verb = Sacrafice
altar-examine = [color=purple]This altar can be used to sacrifice Psionics.[/color]
altar-sacrifice-verb = Sacrifice
altar-failure-reason-self = You can't sacrifice yourself!
altar-failure-reason-user = You are not psionic or clerically trained!
Expand All @@ -8,4 +8,4 @@ altar-failure-reason-target = {CAPITALIZE(THE($target))} {CONJUGATE-BE($target)}
altar-failure-reason-target-humanoid = {CAPITALIZE(THE($target))} {CONJUGATE-BE($target)} not a humanoid!
altar-failure-reason-target-catatonic = {CAPITALIZE(THE($target))} {CONJUGATE-BE($target)} braindead!
altar-sacrafice-popup = {$user} starts to sacrafice {$target}!
altar-sacrifice-popup = {$user} starts to sacrifice {$target}!
4 changes: 2 additions & 2 deletions Resources/Prototypes/Entities/Structures/Furniture/altar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
snapCardinals: true
#- type: Climbable # DeltaV: remove climbable since it conflicts with strap
- type: Clickable
# Begin DeltaV additions: Sacraficing psionics
- type: SacraficialAltar
# Begin DeltaV additions: Sacrificing psionics
- type: SacrificialAltar
- type: Strap
position: Down
rotation: -90
Expand Down
4 changes: 2 additions & 2 deletions Resources/Prototypes/Nyanotrasen/psionicArtifacts.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Items to spawn when sacraficing a psionic
# Items to spawn when sacrificing a psionic
- type: entityTable
id: PsionicSacraficeRewards
id: PsionicSacrificeRewards
table: !type:AllSelector
children:
- id: MaterialBluespace1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ It appears in the context menu on the altar, which can be opened with the right

<GuideEntityEmbed Entity="MaterialBluespace1" />
<GuideEntityEmbed Entity="ClothingEyesTelegnosisSpectacles" />
As a reward for sacraficing a psionic, glimmer will be lowered substantially and you will be given some loot.
As a reward for sacrificing a psionic, glimmer will be lowered substantially and you will be given some loot.
Usually this is a few bluespace crystals, but you can also get a powerful psionic item.

## Golemancy
[color=red]Note: Golemancy is not implemented yet. Once you sacrafice a psionic you can borg them with an MMI.[/color]
[color=red]Note: Golemancy is not implemented yet. Once you sacrifice a psionic you can borg them with an MMI.[/color]
</Document>

0 comments on commit 077996e

Please sign in to comment.