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

Новая способность ревенанту #261

Merged
merged 2 commits into from
Jul 31, 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
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Content.Server.Light.Components;
using Content.Server.Ghost;
using Robust.Shared.Physics;
using Content.Shared.Doors.Components; // Sunrise-Edit
using Content.Shared.Throwing;
using Content.Server.Storage.EntitySystems;
using Content.Shared.Interaction;
Expand All @@ -29,6 +30,7 @@
using Robust.Shared.Utility;
using Robust.Shared.Map.Components;
using Content.Shared.Whitelist;
using Content.Server.Doors.Systems; // Sunrise-Edit

namespace Content.Server.Revenant.EntitySystems;

Expand All @@ -42,6 +44,7 @@ public sealed partial class RevenantSystem
[Dependency] private readonly GhostSystem _ghost = default!;
[Dependency] private readonly TileSystem _tile = default!;
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
[Dependency] private readonly DoorSystem _doorSystem = default!; // Sunrise-Edit

private void InitializeAbilities()
{
Expand All @@ -53,6 +56,7 @@ private void InitializeAbilities()
SubscribeLocalEvent<RevenantComponent, RevenantOverloadLightsActionEvent>(OnOverloadLightsAction);
SubscribeLocalEvent<RevenantComponent, RevenantBlightActionEvent>(OnBlightAction);
SubscribeLocalEvent<RevenantComponent, RevenantMalfunctionActionEvent>(OnMalfunctionAction);
SubscribeLocalEvent<RevenantComponent, RevenantLockActionEvent>(OnLockAction); // Sunrise-Edit
}

private void OnInteract(EntityUid uid, RevenantComponent component, UserActivateInWorldEvent args)
Expand Down Expand Up @@ -321,6 +325,28 @@ private void OnBlightAction(EntityUid uid, RevenantComponent component, Revenant
// TODO: When disease refactor is in.
}

// Sunrise-Start
private void OnLockAction(EntityUid uid, RevenantComponent component, RevenantLockActionEvent args)
{
if (args.Handled)
return;

if (!TryUseAbility(uid, component, component.MalfunctionCost, component.LockDebuffs))

args.Handled = true;

foreach (var ent in _lookup.GetEntitiesInRange(uid, component.MalfunctionRadius))
{
if (TryComp<DoorComponent>(ent, out var doorComp) && TryComp<DoorBoltComponent>(ent, out var boltsComp))
{
if (!boltsComp.BoltWireCut)

_doorSystem.SetBoltsDown((ent, boltsComp), true, uid);
}
}
}
// Sunrise-End

private void OnMalfunctionAction(EntityUid uid, RevenantComponent component, RevenantMalfunctionActionEvent args)
{
if (args.Handled)
Expand Down
4 changes: 4 additions & 0 deletions Content.Shared/Revenant/Components/RevenantComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ public sealed partial class RevenantComponent : Component
public EntityWhitelist? MalfunctionBlacklist;
#endregion

// Sunrise-Start
[DataField("LockDebuffs")]
public Vector2 LockDebuffs = new(2, 8);
// Sunrise-End
[DataField]
public ProtoId<AlertPrototype> EssenceAlert = "Essence";

Expand Down
5 changes: 5 additions & 0 deletions Content.Shared/Revenant/SharedRevenant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ public sealed partial class RevenantMalfunctionActionEvent : InstantActionEvent
{
}

// Sunrise-Start
public sealed partial class RevenantLockActionEvent : InstantActionEvent
{
}
// Sunrise-End

[NetSerializable, Serializable]
public enum RevenantVisuals : byte
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ent-ActionRevenantLock = Перегрузка шлюзов
.desc = Цена 60 эссенций.
2 changes: 2 additions & 0 deletions Resources/Locale/ru-RU/_sunrise/store/revenant-catalog.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
revenant-lock-name = Перегрузка шлюзов
revenant-lock-desc = Перегружает находящиеся поблизости шлюзы, заставляя их переключиться в режим болтирования. При его использовании вы становитесь уязвимы к атакам на длительное время.
9 changes: 9 additions & 0 deletions Resources/Prototypes/_Sunrise/Actions/revenant.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- type: entity
id: ActionRevenantLock
name: Lock Airlock
description: Costs 60 Essence.
components:
- type: InstantAction
icon: _Sunrise/Interface/Actions/lock.png
event: !type:RevenantLockActionEvent
useDelay: 25
12 changes: 12 additions & 0 deletions Resources/Prototypes/_Sunrise/Catalog/revenant_catalog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
- type: listing
id: RevenantLock
name: revenant-lock-name
description: revenant-lock-desc
productAction: ActionRevenantLock
cost:
StolenEssence: 125
categories:
- RevenantAbilities
conditions:
- !type:ListingLimitedStockCondition
stock: 1
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions Resources/Textures/_Sunrise/Interface/Actions/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"version": 1,
"size": {
"x": 32,
"y": 32
},
"license": "CLA",
"copyright": "SUNRISE",
"states": [
{
"name": "lock"
}
]
}
Loading