-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fixs: blood cult * fix * fix: tupo
- Loading branch information
Showing
34 changed files
with
474 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
Content.Server/WhiteDream/BloodCult/Items/BaseAura/BaseAuraComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using Content.Shared.Chat; | ||
|
||
namespace Content.Server.WhiteDream.BloodCult.Items.BaseAura; | ||
|
||
public abstract partial class BaseAuraComponent : Component | ||
{ | ||
[DataField] | ||
public string? Speech; | ||
|
||
[DataField] | ||
public InGameICChatType ChatType = InGameICChatType.Whisper; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
Content.Server/WhiteDream/BloodCult/Items/ShadowShacklesAura/ShadowShacklesAuraComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using Content.Server.WhiteDream.BloodCult.Items.BaseAura; | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Server.WhiteDream.BloodCult.Items.ShadowShacklesAura; | ||
|
||
[RegisterComponent] | ||
public sealed partial class ShadowShacklesAuraComponent : BaseAuraComponent | ||
{ | ||
[DataField] | ||
public EntProtoId ShacklesProto = "ShadowShackles"; | ||
|
||
[DataField] | ||
public TimeSpan MuteDuration = TimeSpan.FromSeconds(5); | ||
|
||
[DataField] | ||
public TimeSpan KnockdownDuration = TimeSpan.FromSeconds(1); | ||
} |
55 changes: 55 additions & 0 deletions
55
Content.Server/WhiteDream/BloodCult/Items/ShadowShacklesAura/ShadowShacklesAuraSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
using System.Linq; | ||
using Content.Server.Chat.Systems; | ||
using Content.Server.Cuffs; | ||
using Content.Server.Stunnable; | ||
using Content.Shared.Speech.Muting; | ||
using Content.Shared.StatusEffect; | ||
using Content.Shared.Stunnable; | ||
using Content.Shared.Weapons.Melee.Events; | ||
using Content.Shared.WhiteDream.BloodCult.BloodCultist; | ||
using Robust.Server.GameObjects; | ||
|
||
|
||
namespace Content.Server.WhiteDream.BloodCult.Items.ShadowShacklesAura; | ||
|
||
public sealed class ShadowShacklesAuraSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly StatusEffectsSystem _statusEffects = default!; | ||
[Dependency] private readonly StunSystem _stun = default!; | ||
[Dependency] private readonly ChatSystem _chat = default!; | ||
[Dependency] private readonly TransformSystem _transform = default!; | ||
[Dependency] private readonly CuffableSystem _cuffable = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<ShadowShacklesAuraComponent, MeleeHitEvent>(OnMeleeHit); | ||
} | ||
|
||
private void OnMeleeHit(EntityUid uid, ShadowShacklesAuraComponent component, MeleeHitEvent args) | ||
{ | ||
if (!args.HitEntities.Any()) | ||
return; | ||
|
||
var target = args.HitEntities.First(); | ||
if (uid == target | ||
|| !HasComp<StunnedComponent>(target) | ||
|| HasComp<BloodCultistComponent>(target)) | ||
return; | ||
|
||
if (component.Speech != null) | ||
_chat.TrySendInGameICMessage(args.User, component.Speech, component.ChatType, false); | ||
|
||
var shuckles = Spawn(component.ShacklesProto, _transform.GetMapCoordinates(args.User)); | ||
if (!_cuffable.TryAddNewCuffs(target, args.User, shuckles)) | ||
{ | ||
QueueDel(shuckles); | ||
return; | ||
} | ||
|
||
_stun.TryKnockdown(target, component.KnockdownDuration, true); | ||
_statusEffects.TryAddStatusEffect<MutedComponent>(target, "Muted", component.MuteDuration, true); | ||
QueueDel(uid); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
Content.Server/WhiteDream/BloodCult/Items/StunAura/StunAuraComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using Content.Server.WhiteDream.BloodCult.Items.BaseAura; | ||
using Content.Shared.Chat; | ||
|
||
namespace Content.Server.WhiteDream.BloodCult.Items.StunAura; | ||
|
||
[RegisterComponent] | ||
public sealed partial class StunAuraComponent : BaseAuraComponent | ||
{ | ||
[DataField] | ||
public TimeSpan ParalyzeDuration = TimeSpan.FromSeconds(16); | ||
|
||
[DataField] | ||
public TimeSpan MuteDuration = TimeSpan.FromSeconds(12); | ||
} |
43 changes: 43 additions & 0 deletions
43
Content.Server/WhiteDream/BloodCult/Items/StunAura/StunAuraSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using System.Linq; | ||
using Content.Server.Chat.Systems; | ||
using Content.Server.Stunnable; | ||
using Content.Shared.Speech.Muting; | ||
using Content.Shared.StatusEffect; | ||
using Content.Shared.Weapons.Melee.Events; | ||
using Content.Shared.WhiteDream.BloodCult.BloodCultist; | ||
using Content.Shared.WhiteDream.BloodCult.Constructs; | ||
|
||
namespace Content.Server.WhiteDream.BloodCult.Items.StunAura; | ||
|
||
public sealed class StunAuraSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly StatusEffectsSystem _statusEffects = default!; | ||
[Dependency] private readonly StunSystem _stun = default!; | ||
[Dependency] private readonly ChatSystem _chat = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<StunAuraComponent, MeleeHitEvent>(OnMeleeHit); | ||
} | ||
|
||
private void OnMeleeHit(EntityUid uid, StunAuraComponent component, MeleeHitEvent args) | ||
{ | ||
if (!args.HitEntities.Any()) | ||
return; | ||
|
||
var target = args.HitEntities.First(); | ||
if (uid == target | ||
|| HasComp<BloodCultistComponent>(target) | ||
|| HasComp<ConstructComponent>(target)) | ||
return; | ||
|
||
if (component.Speech != null) | ||
_chat.TrySendInGameICMessage(args.User, component.Speech, component.ChatType, false); | ||
|
||
_statusEffects.TryAddStatusEffect<MutedComponent>(target, "Muted", component.MuteDuration, true); | ||
_stun.TryParalyze(target, component.ParalyzeDuration, true); | ||
QueueDel(uid); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.