Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReaperUpgrade #2144

Merged
merged 10 commits into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Content.Server/SS220/DarkReaper/DarkReaperSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ public sealed partial class PullerComponent : Component
/// <summary>
/// Does this entity need hands to be able to pull something?
/// </summary>
[DataField]
[DataField]
[Access(Other = AccessPermissions.ReadWriteExecute)] //SS220 DarkReaper Access
public bool NeedsHands = true;

[DataField]
Expand Down
33 changes: 33 additions & 0 deletions Content.Shared/SS220/DarkReaper/DarkReaperActions.cs
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -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

/// <summary>
/// How long the mist stays for, after it has spread
/// </summary>
[DataField]
public TimeSpan BloodMistLength = TimeSpan.FromSeconds(10);
/// <summary>
/// Proto of what is being spawned by ability
/// </summary>
[DataField]
public string BloodMistProto = "BloodMistSpread";

/// <summary>
/// BloodMist sound
/// </summary>
[DataField, AutoNetworkedField]
public SoundSpecifier BloodMistSound = new SoundPathSpecifier("/Audio/Items/smoke_grenade_smoke.ogg", new()
{
MaxDistance = 7
});

}
31 changes: 28 additions & 3 deletions Content.Shared/SS220/DarkReaper/DarkReaperComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,22 @@ public sealed partial class DarkReaperComponent : Component
[ViewVariables, DataField]
public float StunAbilityLightBreakRadius = 4.5f;

/// <summary>
/// StunAbilityConfusion - radius in which entities are affected by confusion
/// </summary>
[DataField]
public float StunAbilityConfusion = 12f;
/// <summary>
/// ConfusionDuration - duration of the confusion effect
/// </summary>
[DataField]
public TimeSpan ConfusionDuration = TimeSpan.FromSeconds(7);
/// <summary>
/// ConfusionEffectName - name of effect that applied
/// </summary>
[DataField]
public string ConfusionEffectName = "Flashed";

/// <summary>
/// Duration of the stun that is applied by the ability
/// </summary>
Expand Down Expand Up @@ -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 }
}
};

Expand Down Expand Up @@ -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;
Expand All @@ -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]
Expand All @@ -321,6 +344,8 @@ public sealed partial class DarkReaperComponent : Component

[ViewVariables]
public TimeSpan? MaterializedStart;
[ViewVariables, AutoNetworkedField]
public TimeSpan? BloodMistStart;
}

[Serializable, NetSerializable]
Expand Down
31 changes: 31 additions & 0 deletions Content.Shared/SS220/DarkReaper/DarkReaperSharedSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,22 @@
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;
using Content.Shared.Physics;
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;
Expand Down Expand Up @@ -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()
{
Expand All @@ -69,6 +77,7 @@ public override void Initialize()
SubscribeLocalEvent<DarkReaperComponent, MobStateChangedEvent>(OnMobStateChanged);
SubscribeLocalEvent<DarkReaperComponent, GetMeleeDamageEvent>(OnGetMeleeDamage);
SubscribeLocalEvent<DarkReaperComponent, DamageModifyEvent>(OnDamageModify);
SubscribeLocalEvent<DarkReaperComponent, ReaperBloodMistEvent>(OnBloodMistAction);

SubscribeLocalEvent<DarkReaperComponent, AfterMaterialize>(OnAfterMaterialize);
SubscribeLocalEvent<DarkReaperComponent, AfterDeMaterialize>(OnAfterDeMaterialize);
Expand All @@ -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)
Expand Down Expand Up @@ -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<FlashedComponent>(entity, comp.ConfusionEffectName, comp.ConfusionDuration, true))
continue;
}
}

protected virtual void DoRoflAbility(EntityUid uid, DarkReaperComponent comp)
Expand Down Expand Up @@ -370,6 +395,7 @@ public virtual void ChangeForm(EntityUid uid, DarkReaperComponent comp, bool isM

if (isMaterial)
{
EnsureComp<PullerComponent>(uid).NeedsHands = false;
_tag.AddTag(uid, "DoorBumpOpener");

if (TryComp<ExplosionResistanceComponent>(uid, out var explosionResistanceComponent))
Expand Down Expand Up @@ -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<PullerComponent>(uid);
RemComp<ActivePullerComponent>(uid);
}

_actions.SetEnabled(comp.StunActionEntity, isMaterial);
Expand Down
11 changes: 11 additions & 0 deletions Resources/Prototypes/SS220/DemonRofler/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
30 changes: 30 additions & 0 deletions Resources/Prototypes/SS220/DemonRofler/bloodmist.yml
Original file line number Diff line number Diff line change
@@ -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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 2,
"license": "EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt",
"copyright": "Made by MIXnikita for SS220, randomgibs is taken from Paradise build of SS13",
"copyright": "Made by MIXnikita for SS220, randomgibs is taken from Paradise build of SS13, icon_bloodmist made by Lanc for SS220",
"size": {
"x": 32,
"y": 32
Expand Down Expand Up @@ -126,6 +126,9 @@
},
{
"name": "randomgibs"
}
},
{
"name": "icon_bloodmist"
}
]
}
Loading