From ad79137ae3129e6f393eecb9fdac74120a52ba51 Mon Sep 17 00:00:00 2001
From: TryHardo7 <166473301+TryHardo7@users.noreply.github.com>
Date: Sun, 27 Oct 2024 15:47:28 +0300
Subject: [PATCH] ReaperUpgrade (#2144)
* ONO RABOTAET
* ReaperConfusionDone
* blood mist working
* bloodmist work
* fixes
* moved bloodmist params from reaperComp to action datafields
* changed pulling method
* i forgor
* requested changes
* fix
---
.../SS220/DarkReaper/DarkReaperSystem.cs | 4 +++
.../Pulling/Components/PullerComponent.cs | 3 +-
.../SS220/DarkReaper/DarkReaperActions.cs | 33 ++++++++++++++++++
.../SS220/DarkReaper/DarkReaperComponent.cs | 31 ++++++++++++++--
.../DarkReaper/DarkReaperSharedSystem.cs | 31 ++++++++++++++++
.../Prototypes/SS220/DemonRofler/actions.yml | 11 ++++++
.../SS220/DemonRofler/bloodmist.yml | 30 ++++++++++++++++
.../dark_reaper.rsi/icon_bloodmist.png | Bin 0 -> 480 bytes
.../DemonRofler/dark_reaper.rsi/meta.json | 7 ++--
9 files changed, 144 insertions(+), 6 deletions(-)
create mode 100644 Resources/Prototypes/SS220/DemonRofler/bloodmist.yml
create mode 100644 Resources/Textures/SS220/DemonRofler/dark_reaper.rsi/icon_bloodmist.png
diff --git a/Content.Server/SS220/DarkReaper/DarkReaperSystem.cs b/Content.Server/SS220/DarkReaper/DarkReaperSystem.cs
index c4fed10f4a239f..3a9032784d8ec7 100644
--- a/Content.Server/SS220/DarkReaper/DarkReaperSystem.cs
+++ b/Content.Server/SS220/DarkReaper/DarkReaperSystem.cs
@@ -210,6 +210,9 @@ protected override void OnCompInit(EntityUid uid, DarkReaperComponent comp, Comp
if (!comp.MaterializeActionEntity.HasValue)
_actions.AddAction(uid, ref comp.MaterializeActionEntity, comp.MaterializeAction);
+ if (!comp.BloodMistActionEntity.HasValue)
+ _actions.AddAction(uid, ref comp.BloodMistActionEntity, comp.BloodMistAction);
+
UpdateAlert(uid, comp);
}
@@ -221,6 +224,7 @@ protected override void OnCompShutdown(EntityUid uid, DarkReaperComponent comp,
_actions.RemoveAction(uid, comp.StunActionEntity);
_actions.RemoveAction(uid, comp.ConsumeActionEntity);
_actions.RemoveAction(uid, comp.MaterializeActionEntity);
+ _actions.RemoveAction(uid, comp.BloodMistActionEntity);
}
protected override void DoStunAbility(EntityUid uid, DarkReaperComponent comp)
diff --git a/Content.Shared/Movement/Pulling/Components/PullerComponent.cs b/Content.Shared/Movement/Pulling/Components/PullerComponent.cs
index 197d7cfd7c899e..075ee0d88d56b3 100644
--- a/Content.Shared/Movement/Pulling/Components/PullerComponent.cs
+++ b/Content.Shared/Movement/Pulling/Components/PullerComponent.cs
@@ -38,7 +38,8 @@ public sealed partial class PullerComponent : Component
///
/// Does this entity need hands to be able to pull something?
///
- [DataField]
+ [DataField]
+ [Access(Other = AccessPermissions.ReadWriteExecute)] //SS220 DarkReaper Access
public bool NeedsHands = true;
[DataField]
diff --git a/Content.Shared/SS220/DarkReaper/DarkReaperActions.cs b/Content.Shared/SS220/DarkReaper/DarkReaperActions.cs
index 0927f5a74255ee..b463ad8c6a8788 100644
--- a/Content.Shared/SS220/DarkReaper/DarkReaperActions.cs
+++ b/Content.Shared/SS220/DarkReaper/DarkReaperActions.cs
@@ -1,5 +1,7 @@
// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt
using Content.Shared.Actions;
+using Robust.Shared.Audio.Systems;
+using Robust.Shared.Audio;
namespace Content.Shared.SS220.DarkReaper;
@@ -22,3 +24,34 @@ public sealed partial class ReaperMaterializeEvent : InstantActionEvent
public sealed partial class ReaperSpawnEvent : InstantActionEvent
{
}
+
+public sealed partial class ReaperSmokeEvent : InstantActionEvent
+{
+}
+
+public sealed partial class ReaperBloodMistEvent : InstantActionEvent
+{
+ [Dependency] private readonly SharedAudioSystem _audio = default!;
+ /// BLOOD MIST
+
+ ///
+ /// How long the mist stays for, after it has spread
+ ///
+ [DataField]
+ public TimeSpan BloodMistLength = TimeSpan.FromSeconds(10);
+ ///
+ /// Proto of what is being spawned by ability
+ ///
+ [DataField]
+ public string BloodMistProto = "BloodMistSpread";
+
+ ///
+ /// BloodMist sound
+ ///
+ [DataField, AutoNetworkedField]
+ public SoundSpecifier BloodMistSound = new SoundPathSpecifier("/Audio/Items/smoke_grenade_smoke.ogg", new()
+ {
+ MaxDistance = 7
+ });
+
+}
\ No newline at end of file
diff --git a/Content.Shared/SS220/DarkReaper/DarkReaperComponent.cs b/Content.Shared/SS220/DarkReaper/DarkReaperComponent.cs
index 6342dc082ec2d2..5745136decf2f5 100644
--- a/Content.Shared/SS220/DarkReaper/DarkReaperComponent.cs
+++ b/Content.Shared/SS220/DarkReaper/DarkReaperComponent.cs
@@ -111,6 +111,22 @@ public sealed partial class DarkReaperComponent : Component
[ViewVariables, DataField]
public float StunAbilityLightBreakRadius = 4.5f;
+ ///
+ /// StunAbilityConfusion - radius in which entities are affected by confusion
+ ///
+ [DataField]
+ public float StunAbilityConfusion = 12f;
+ ///
+ /// ConfusionDuration - duration of the confusion effect
+ ///
+ [DataField]
+ public TimeSpan ConfusionDuration = TimeSpan.FromSeconds(7);
+ ///
+ /// ConfusionEffectName - name of effect that applied
+ ///
+ [DataField]
+ public string ConfusionEffectName = "Flashed";
+
///
/// Duration of the stun that is applied by the ability
///
@@ -219,21 +235,24 @@ public sealed partial class DarkReaperComponent : Component
new()
{
{ "Slash", 12 },
- { "Piercing", 4 }
+ { "Piercing", 4 },
+ { "Structural", 20 }
},
// Stage 2
new()
{
{ "Slash", 16 },
- { "Piercing", 8 }
+ { "Piercing", 8 },
+ { "Structural", 40 }
},
// Stage 3
new()
{
{ "Slash", 20 },
- { "Piercing", 16 }
+ { "Piercing", 16 },
+ { "Structural", 80 }
}
};
@@ -296,6 +315,8 @@ public sealed partial class DarkReaperComponent : Component
public EntProtoId ConsumeAction = "ActionDarkReaperConsume";
[DataField]
public EntProtoId MaterializeAction = "ActionDarkReaperMaterialize";
+ [DataField]
+ public EntProtoId BloodMistAction = "ActionDarkReaperBloodMist";
[DataField, AutoNetworkedField]
public EntityUid? RoflActionEntity;
@@ -305,6 +326,8 @@ public sealed partial class DarkReaperComponent : Component
public EntityUid? ConsumeActionEntity;
[DataField, AutoNetworkedField]
public EntityUid? MaterializeActionEntity;
+ [DataField, AutoNetworkedField]
+ public EntityUid? BloodMistActionEntity;
// ABILITY STATES ///
[ViewVariables, AutoNetworkedField]
@@ -321,6 +344,8 @@ public sealed partial class DarkReaperComponent : Component
[ViewVariables]
public TimeSpan? MaterializedStart;
+ [ViewVariables, AutoNetworkedField]
+ public TimeSpan? BloodMistStart;
}
[Serializable, NetSerializable]
diff --git a/Content.Shared/SS220/DarkReaper/DarkReaperSharedSystem.cs b/Content.Shared/SS220/DarkReaper/DarkReaperSharedSystem.cs
index dcd4cba3a087a8..5e6a8d52b8e201 100644
--- a/Content.Shared/SS220/DarkReaper/DarkReaperSharedSystem.cs
+++ b/Content.Shared/SS220/DarkReaper/DarkReaperSharedSystem.cs
@@ -5,10 +5,14 @@
using Content.Shared.Damage;
using Content.Shared.DoAfter;
using Content.Shared.Explosion.Components;
+using Content.Shared.Flash;
+using Content.Shared.Flash.Components;
using Content.Shared.Humanoid;
using Content.Shared.Mobs;
using Content.Shared.Mobs.Systems;
using Content.Shared.Movement.Components;
+using Content.Shared.Movement.Pulling.Systems;
+using Content.Shared.Movement.Pulling.Components;
using Content.Shared.Movement.Systems;
using Content.Shared.NPC.Components;
using Content.Shared.NPC.Systems;
@@ -16,6 +20,7 @@
using Content.Shared.Popups;
using Content.Shared.Stunnable;
using Content.Shared.Tag;
+using Content.Shared.StatusEffect;
using Content.Shared.Weapons.Melee;
using Content.Shared.Weapons.Melee.Events;
using Robust.Shared.Audio.Systems;
@@ -53,6 +58,9 @@ public abstract class SharedDarkReaperSystem : EntitySystem
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly SharedContainerSystem _container = default!;
[Dependency] private readonly NpcFactionSystem _npcFaction = default!;
+ [Dependency] private readonly PullingSystem _puller = default!;
+ [Dependency] private readonly SharedFlashSystem _flash = default!;
+ [Dependency] private readonly StatusEffectsSystem _statusEffectsSystem = default!;
public override void Initialize()
{
@@ -69,6 +77,7 @@ public override void Initialize()
SubscribeLocalEvent(OnMobStateChanged);
SubscribeLocalEvent(OnGetMeleeDamage);
SubscribeLocalEvent(OnDamageModify);
+ SubscribeLocalEvent(OnBloodMistAction);
SubscribeLocalEvent(OnAfterMaterialize);
SubscribeLocalEvent(OnAfterDeMaterialize);
@@ -83,6 +92,15 @@ private void OnRoflAction(EntityUid uid, DarkReaperComponent comp, ReaperRoflEve
DoRoflAbility(uid, comp);
}
+ private void OnBloodMistAction(EntityUid uid, DarkReaperComponent comp, ReaperBloodMistEvent args)
+ {
+ if (!comp.PhysicalForm)
+ return;
+ args.Handled = true;
+ _audio.PlayPredicted(args.BloodMistSound, uid, uid);
+ Spawn(args.BloodMistProto, Transform(uid).Coordinates);
+ }
+
private void OnConsumeAction(EntityUid uid, DarkReaperComponent comp, ReaperConsumeEvent args)
{
if (!comp.PhysicalForm)
@@ -164,6 +182,13 @@ protected virtual void DoStunAbility(EntityUid uid, DarkReaperComponent comp)
{
_stun.TryParalyze(entity, comp.StunDuration, true);
}
+
+ var confusedentities = _lookup.GetEntitiesInRange(uid, comp.StunAbilityConfusion);
+ foreach (var entity in confusedentities)
+ {
+ if (!_statusEffectsSystem.TryAddStatusEffect(entity, comp.ConfusionEffectName, comp.ConfusionDuration, true))
+ continue;
+ }
}
protected virtual void DoRoflAbility(EntityUid uid, DarkReaperComponent comp)
@@ -370,6 +395,7 @@ public virtual void ChangeForm(EntityUid uid, DarkReaperComponent comp, bool isM
if (isMaterial)
{
+ EnsureComp(uid).NeedsHands = false;
_tag.AddTag(uid, "DoorBumpOpener");
if (TryComp(uid, out var explosionResistanceComponent))
@@ -400,6 +426,11 @@ public virtual void ChangeForm(EntityUid uid, DarkReaperComponent comp, bool isM
_npcFaction.AddFaction(uid, "DarkReaperPassive");
}
_appearance.SetData(uid, DarkReaperVisual.StunEffect, false);
+
+ if (TryComp(uid, out PullerComponent? puller) && TryComp(puller.Pulling, out PullableComponent? pullable))
+ _puller.TryStopPull(puller.Pulling.Value, pullable);
+ RemComp(uid);
+ RemComp(uid);
}
_actions.SetEnabled(comp.StunActionEntity, isMaterial);
diff --git a/Resources/Prototypes/SS220/DemonRofler/actions.yml b/Resources/Prototypes/SS220/DemonRofler/actions.yml
index 029291586c0c60..9e97fd339cf3ab 100644
--- a/Resources/Prototypes/SS220/DemonRofler/actions.yml
+++ b/Resources/Prototypes/SS220/DemonRofler/actions.yml
@@ -52,3 +52,14 @@
itemIconStyle: NoItem
icon: { sprite: SS220/DemonRofler/dark_reaper.rsi, state: jnecexit }
useDelay: 1
+
+- type: entity
+ id: ActionDarkReaperBloodMist
+ name: Кровавый туман
+ description: Выпустить кровавый туман.
+ components:
+ - type: InstantAction
+ event: !type:ReaperBloodMistEvent
+ itemIconStyle: NoItem
+ icon: { sprite: SS220/DemonRofler/dark_reaper.rsi, state: icon_bloodmist }
+ useDelay: 60
diff --git a/Resources/Prototypes/SS220/DemonRofler/bloodmist.yml b/Resources/Prototypes/SS220/DemonRofler/bloodmist.yml
new file mode 100644
index 00000000000000..70baccc4ba946a
--- /dev/null
+++ b/Resources/Prototypes/SS220/DemonRofler/bloodmist.yml
@@ -0,0 +1,30 @@
+- type: entity
+ parent: Smoke
+ id: BloodMist
+ name: blood mist
+ categories: [ HideSpawnMenu ]
+ components:
+ - type: Sprite
+ color: "#FF0000"
+ sprite: Effects/chemsmoke.rsi
+ state: chemsmoke
+ - type: TimedDespawn
+ lifetime: 15
+
+- type: entity
+ parent: Smoke
+ id: BloodMistSpread
+ name: blood mist
+ categories:
+ components:
+ - type: Sprite
+ color: "#FF0000"
+ sprite: Effects/chemsmoke.rsi
+ state: chemsmoke
+ - type: TriggerOnSpawn
+ - type: TimedDespawn
+ lifetime: 15
+ - type: SmokeOnTrigger
+ duration: 15
+ spreadAmount: 30
+ smokePrototype: BloodMist
diff --git a/Resources/Textures/SS220/DemonRofler/dark_reaper.rsi/icon_bloodmist.png b/Resources/Textures/SS220/DemonRofler/dark_reaper.rsi/icon_bloodmist.png
new file mode 100644
index 0000000000000000000000000000000000000000..9e0f3c620b24a43e0e288c1de63fae6a50de14db
GIT binary patch
literal 480
zcmV<60U!Q}P)Px$nn^@KR9J=WmQ8ZQAPj{+JUJ2ZmE!hD9p_3mM+#jSr9#FSGF^10d7BW7^qzi@
z4R8E+xK|CYxOh$GE0G(HPafU=x(z0VSbIKqis(8lWa~osC9hsqWUtsLot*
ztZ6-L4(h|DMD7!b2WDciY#NI>^OZQ8=0GXJ9!Lhq^t+W{!yp?PBaV;^ZTep!mxh%3
zC(gVFG!|m9i;qytkOw|^WTYAw*qWjwq7|jVB?x`zOURgd-+Hxy6gW@+PJoCI<&eJ-
zC6b#mD~;s464fnWi)4s4ZQ|%GORbSt1)M<()E}nuzvq+e<*(vI7Il-gM*YSce+u8`
WLA=MfrxBz80000