mirror of
https://github.com/wega-team/ss14-wega.git
synced 2026-06-09 10:06:49 +02:00
sirniki
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
using Content.Shared.Veil.Cult;
|
||||
|
||||
namespace Content.Client.Veil.Cult;
|
||||
|
||||
public sealed partial class TeleportionEnchantSystem : SharedTeleportationEnchantSystem
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,19 +1,13 @@
|
||||
using Content.Shared.Veil.Cult;
|
||||
using Content.Shared.Veil.Cult.Components;
|
||||
using Content.Shared.Veil.Cult.UI;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Client.Veil.Cult.UI;
|
||||
namespace Content.Client._Wega.VeilCult.UI;
|
||||
|
||||
[UsedImplicitly]
|
||||
public sealed class EnchantBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entMan = default!;
|
||||
[Dependency] private readonly ISharedPlayerManager _playerManager = default!;
|
||||
|
||||
[ViewVariables]
|
||||
private EnchantWindow? _window;
|
||||
|
||||
@@ -32,9 +26,7 @@ public sealed class EnchantBoundUserInterface : BoundUserInterface
|
||||
|
||||
private void OnEnchantSelected(EntProtoId entId)
|
||||
{
|
||||
if (_playerManager.LocalSession?.AttachedEntity is not { } user)
|
||||
return;
|
||||
SendMessage(new EnchantSelectedMessage(_entMan.GetNetEntity(user), entId));
|
||||
SendMessage(new EnchantSelectedMessage(entId));
|
||||
Close();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
<ui:RadialMenu xmlns="https://spacestation14.io"
|
||||
xmlns:ui="clr-namespace:Content.Client.UserInterface.Controls"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
x:Class="Content.Client.Veil.Cult.UI.EnchantWindow"
|
||||
MinWidth="450"
|
||||
MinHeight="450">
|
||||
MinWidth="450" MinHeight="450">
|
||||
|
||||
<ui:RadialContainer Name="MainContainer"
|
||||
VerticalExpand="True"
|
||||
HorizontalExpand="True"
|
||||
<ui:RadialContainer Name="MainContainer"
|
||||
VerticalExpand="True"
|
||||
HorizontalExpand="True"
|
||||
InitialRadius="80"
|
||||
ReserveSpaceForHiddenChildren="False">
|
||||
</ui:RadialContainer>
|
||||
|
||||
@@ -1,22 +1,17 @@
|
||||
using System.Numerics;
|
||||
using Content.Client.UserInterface.Controls;
|
||||
using Content.Shared.Veil.Cult;
|
||||
using Content.Shared.Veil.Cult.UI;
|
||||
using Content.Client.Veil.Cult.UI;
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Client.Veil.Cult.UI;
|
||||
namespace Content.Client._Wega.VeilCult.UI;
|
||||
|
||||
[GenerateTypedNameReferences]
|
||||
public sealed partial class EnchantWindow : RadialMenu
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entMan = default!;
|
||||
[Dependency] private readonly IPrototypeManager _prototype = default!;
|
||||
private readonly SpriteSystem _sprite;
|
||||
|
||||
public event Action<EntProtoId>? OnEnchantSelected;
|
||||
private List<EntProtoId> _enchants = new();
|
||||
@@ -25,8 +20,6 @@ public sealed partial class EnchantWindow : RadialMenu
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
IoCManager.InjectDependencies(this);
|
||||
|
||||
_sprite = _entMan.System<SpriteSystem>();
|
||||
}
|
||||
|
||||
public void Populate(EnchantSelectionState state)
|
||||
@@ -61,7 +54,7 @@ public sealed partial class EnchantWindow : RadialMenu
|
||||
HorizontalAlignment = HAlignment.Center,
|
||||
VerticalAlignment = VAlignment.Center
|
||||
};
|
||||
|
||||
|
||||
if (_prototype.TryIndex<EntityPrototype>(enchant.ID, out var item))
|
||||
{
|
||||
var entityView = new EntityPrototypeView
|
||||
|
||||
@@ -1,23 +1,18 @@
|
||||
using Content.Client.Veil.Cult.UI;
|
||||
using Content.Shared.Veil.Cult;
|
||||
using Content.Shared.Veil.Cult;
|
||||
using Content.Shared.Veil.Cult.Components;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.UserInterface;
|
||||
|
||||
namespace Content.Client.Veil.Cult.UI;
|
||||
namespace Content.Client._Wega.VeilCult.UI;
|
||||
|
||||
[UsedImplicitly]
|
||||
public sealed class TeleportEnchantBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
|
||||
// Copy of TeleportLocationsUI for Teleportation enchantment
|
||||
|
||||
[ViewVariables]
|
||||
private TeleportEnchantMenu? _menu;
|
||||
|
||||
public TeleportEnchantBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
public TeleportEnchantBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) { }
|
||||
|
||||
protected override void Open()
|
||||
{
|
||||
@@ -29,12 +24,11 @@ public sealed class TeleportEnchantBoundUserInterface : BoundUserInterface
|
||||
return;
|
||||
|
||||
_menu.Title = Loc.GetString(teleComp.Name);
|
||||
_menu.TeleportClicked += (netEnt, pointName) =>
|
||||
_menu.TeleportClicked += netEnt =>
|
||||
{
|
||||
SendMessage(new TeleportEnchantDestinationMessage(netEnt, pointName));
|
||||
SendMessage(new TeleportEnchantDestinationMessage(netEnt));
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
protected override void UpdateState(BoundUserInterfaceState state)
|
||||
{
|
||||
@@ -43,5 +37,4 @@ public sealed class TeleportEnchantBoundUserInterface : BoundUserInterface
|
||||
if (state is TeleportationEnchantBoundUserInterfaceState updateState && _menu != null)
|
||||
_menu.UpdateState(updateState);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
<DefaultWindow xmlns="https://spacestation14.io" xmlns:ui="clr-namespace:Content.Client.UserInterface.Controls" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="Content.Client.Veil.Cult.UI.TeleportEnchantMenu" Title = "{Loc 'teleportation-enchant-window-title'}" MinSize="450 450" SetSize="450 450">
|
||||
<DefaultWindow xmlns="https://spacestation14.io"
|
||||
xmlns:ui="clr-namespace:Content.Client.UserInterface.Controls"
|
||||
Title = "{Loc 'teleportation-enchant-window-title'}"
|
||||
MinSize="450 450">
|
||||
<BoxContainer Orientation="Vertical" HorizontalExpand="True" SizeFlagsStretchRatio="0.4">
|
||||
<LineEdit Name="SearchBar" PlaceHolder="Search" HorizontalExpand="True" Margin="0 4" />
|
||||
<ScrollContainer Name="TeleportScroll" VerticalExpand="True" HorizontalExpand="True" HScrollEnabled="False">
|
||||
|
||||
@@ -6,16 +6,15 @@ using Robust.Client.UserInterface.CustomControls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
|
||||
namespace Content.Client.Veil.Cult.UI;
|
||||
namespace Content.Client._Wega.VeilCult.UI;
|
||||
|
||||
[GenerateTypedNameReferences]
|
||||
public sealed partial class TeleportEnchantMenu : DefaultWindow
|
||||
{
|
||||
public string SearchText = "";
|
||||
|
||||
public HashSet<TeleportPoint> Warps = new();
|
||||
|
||||
public event Action<NetEntity, string>? TeleportClicked;
|
||||
public event Action<NetEntity>? TeleportClicked;
|
||||
|
||||
public TeleportEnchantMenu()
|
||||
{
|
||||
@@ -24,7 +23,7 @@ public sealed partial class TeleportEnchantMenu : DefaultWindow
|
||||
|
||||
SearchBar.OnTextChanged += OnSearchTextChanged;
|
||||
}
|
||||
|
||||
|
||||
public void UpdateState(TeleportationEnchantBoundUserInterfaceState state)
|
||||
{
|
||||
Warps = state.Warps;
|
||||
@@ -34,7 +33,7 @@ public sealed partial class TeleportEnchantMenu : DefaultWindow
|
||||
public void AddTeleportButtons()
|
||||
{
|
||||
TeleportButtonContainer.DisposeAllChildren();
|
||||
|
||||
|
||||
foreach (var points in Warps)
|
||||
{
|
||||
var name = points.Location;
|
||||
@@ -51,7 +50,7 @@ public sealed partial class TeleportEnchantMenu : DefaultWindow
|
||||
ClipText = true,
|
||||
};
|
||||
|
||||
currentButtonRef.OnPressed += _ => TeleportClicked?.Invoke(teleportPoint, name);
|
||||
currentButtonRef.OnPressed += _ => TeleportClicked?.Invoke(teleportPoint);
|
||||
currentButtonRef.Visible = ButtonIsVisible(currentButtonRef);
|
||||
|
||||
TeleportButtonContainer.AddChild(currentButtonRef);
|
||||
|
||||
@@ -1,45 +1,32 @@
|
||||
using Content.Shared.Veil.Cult.UI;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Client.Veil.Cult.Ui;
|
||||
namespace Content.Client._Wega.VeilCult.UI;
|
||||
|
||||
public sealed class VeilAltarBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entMan = default!;
|
||||
|
||||
[ViewVariables]
|
||||
private VeilAltarMenu? _menu;
|
||||
|
||||
public VeilAltarBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
public VeilAltarBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) { }
|
||||
|
||||
protected override void Open()
|
||||
{
|
||||
base.Open();
|
||||
|
||||
_menu = this.CreateWindow<VeilAltarMenu>();
|
||||
_menu.OnSelectEnergy += user =>
|
||||
{
|
||||
SendMessage(new VeilAltarSelectEnergyMessage(_entMan.GetNetEntity(user)));
|
||||
Close();
|
||||
};
|
||||
|
||||
_menu.OnSelectOffer += altar =>
|
||||
{
|
||||
SendMessage(new VeilAltarSelectOfferMessage(_entMan.GetNetEntity(altar)));
|
||||
Close();
|
||||
};
|
||||
|
||||
_menu.OpenCentered();
|
||||
}
|
||||
|
||||
protected override void UpdateState(BoundUserInterfaceState state)
|
||||
{
|
||||
base.UpdateState(state);
|
||||
|
||||
if (state is VeilAltarState cast)
|
||||
_menu?.UpdateState(cast);
|
||||
_menu.OnSelectEnergy += () =>
|
||||
{
|
||||
SendMessage(new VeilAltarSelectEnergyMessage());
|
||||
Close();
|
||||
};
|
||||
|
||||
_menu.OnSelectOffer += () =>
|
||||
{
|
||||
SendMessage(new VeilAltarSelectOfferMessage());
|
||||
Close();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<ui:RadialMenu xmlns="https://spacestation14.io"
|
||||
xmlns:ui="clr-namespace:Content.Client.UserInterface.Controls"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
x:Class="Content.Client.Veil.Cult.Ui.VeilAltarMenu"
|
||||
CloseButtonStyleClass="RadialMenuCloseButton"
|
||||
VerticalExpand="True" HorizontalExpand="True">
|
||||
|
||||
|
||||
@@ -1,49 +1,20 @@
|
||||
using Content.Client.UserInterface.Controls;
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Content.Shared.Veil.Cult.UI;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Client.Veil.Cult.Ui;
|
||||
namespace Content.Client._Wega.VeilCult.UI;
|
||||
|
||||
[GenerateTypedNameReferences]
|
||||
public sealed partial class VeilAltarMenu : RadialMenu
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entMan = default!;
|
||||
|
||||
public event Action<EntityUid>? OnSelectEnergy;
|
||||
public event Action<EntityUid>? OnSelectOffer;
|
||||
|
||||
private EntityUid _user;
|
||||
private EntityUid _altar;
|
||||
|
||||
public void UpdateState(VeilAltarState state)
|
||||
{
|
||||
_user = _entMan.GetEntity(state.User);
|
||||
_altar = _entMan.GetEntity(state.Altar);
|
||||
}
|
||||
public event Action? OnSelectEnergy;
|
||||
public event Action? OnSelectOffer;
|
||||
|
||||
public VeilAltarMenu()
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
InitializeButtons();
|
||||
}
|
||||
|
||||
private void InitializeButtons()
|
||||
{
|
||||
EnergyButton.OnButtonUp += _ => HandleEnergySelection();
|
||||
OfferButton.OnButtonUp += _ => HandleOfferSelection();
|
||||
}
|
||||
|
||||
private void HandleEnergySelection()
|
||||
{
|
||||
OnSelectEnergy?.Invoke(_user);
|
||||
Close();
|
||||
}
|
||||
private void HandleOfferSelection()
|
||||
{
|
||||
OnSelectOffer?.Invoke(_altar);
|
||||
Close();
|
||||
EnergyButton.OnButtonUp += _ => OnSelectEnergy?.Invoke();
|
||||
OfferButton.OnButtonUp += _ => OnSelectOffer?.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +1,14 @@
|
||||
using Content.Shared.Veil.Cult;
|
||||
using Content.Shared.Veil.Cult.Components;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.UserInterface;
|
||||
|
||||
namespace Content.Client.Veil.Cult.UI;
|
||||
namespace Content.Client._Wega.VeilCult.UI;
|
||||
|
||||
public sealed class VeilBeaconBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entManager = default!;
|
||||
|
||||
[ViewVariables]
|
||||
private VeilBeaconWindow? _window;
|
||||
|
||||
public VeilBeaconBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
IoCManager.InjectDependencies(this);
|
||||
}
|
||||
public VeilBeaconBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) { }
|
||||
|
||||
protected override void Open()
|
||||
{
|
||||
@@ -23,30 +16,25 @@ public sealed class VeilBeaconBoundUserInterface : BoundUserInterface
|
||||
|
||||
_window = this.CreateWindow<VeilBeaconWindow>();
|
||||
|
||||
if (_entManager.TryGetComponent(Owner, out VeilCultBeaconComponent? beacon))
|
||||
{
|
||||
_window.SetMaxLabelLength(beacon.MaxNameChars);
|
||||
}
|
||||
|
||||
_window.OnNameChanged += OnNameChanged;
|
||||
Reload();
|
||||
_window.SetInitialNameState();
|
||||
_window.SetInitialNameState();
|
||||
|
||||
_window.OpenCentered();
|
||||
}
|
||||
|
||||
private void OnNameChanged(string newName)
|
||||
{
|
||||
if (_entManager.TryGetComponent(Owner, out VeilCultBeaconComponent? beacon) &&
|
||||
beacon.AssignedName.Equals(newName))
|
||||
return;
|
||||
|
||||
SendPredictedMessage(new VeilBeaconNameChangedMessage(newName));
|
||||
SendMessage(new VeilBeaconNameChangedMessage(newName));
|
||||
}
|
||||
|
||||
public void Reload()
|
||||
protected override void UpdateState(BoundUserInterfaceState state)
|
||||
{
|
||||
if (_window == null || !_entManager.TryGetComponent(Owner, out VeilCultBeaconComponent? component))
|
||||
return;
|
||||
base.UpdateState(state);
|
||||
|
||||
_window.SetCurrentLabel(component.AssignedName);
|
||||
if (state is VeilBeaconNameBoundUserInterfaceState updateState && _window != null)
|
||||
{
|
||||
_window.SetCurrentLabel(updateState.Name);
|
||||
_window.SetMaxLabelLength(updateState.MaxChars);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
<DefaultWindow xmlns="https://spacestation14.io"
|
||||
xmlns:ui="clr-namespace:Content.Client.UserInterface.Controls"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
x:Class="Content.Client.Veil.Cult.UI.VeilBeaconWindow"
|
||||
Title="{Loc 'veil-beacon-ui-header'}"
|
||||
SetWidth="400"
|
||||
MinWidth="150">
|
||||
xmlns:ui="clr-namespace:Content.Client.UserInterface.Controls"
|
||||
Title="{Loc 'veil-beacon-ui-header'}"
|
||||
SetWidth="400" MinWidth="150">
|
||||
<BoxContainer Orientation="Vertical" SeparationOverride="4">
|
||||
<Label Name="CurrentTextLabel" Text="{Loc 'veil-beacon-current-name'}" />
|
||||
<LineEdit Name="LabelLineEdit" />
|
||||
|
||||
@@ -2,15 +2,15 @@ using Robust.Client.UserInterface.CustomControls;
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
|
||||
namespace Content.Client.Veil.Cult.UI
|
||||
namespace Content.Client._Wega.VeilCult.UI
|
||||
{
|
||||
[GenerateTypedNameReferences]
|
||||
public sealed partial class VeilBeaconWindow : DefaultWindow
|
||||
{
|
||||
public event Action<string>? OnNameChanged;
|
||||
|
||||
// Just a copy of HandLabeler UI to name beacons
|
||||
|
||||
|
||||
// Just a copy of HandLabeler UI to name beacons
|
||||
|
||||
/// <summary>
|
||||
/// Is the user currently entering text into the control?
|
||||
/// </summary>
|
||||
@@ -70,8 +70,8 @@ namespace Content.Client.Veil.Cult.UI
|
||||
|
||||
public void UpdateButtons()
|
||||
{
|
||||
ResetNameButton.Disabled = (LabelLineEdit.Text == _initialName);
|
||||
ClearNameButton.Disabled = (LabelLineEdit.Text == "");
|
||||
ResetNameButton.Disabled = LabelLineEdit.Text == _initialName;
|
||||
ClearNameButton.Disabled = LabelLineEdit.Text == "";
|
||||
}
|
||||
|
||||
public void SetMaxLabelLength(int maxLength)
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
using Content.Client.Veil.Cult.UI;
|
||||
using Content.Shared.Veil.Cult;
|
||||
using Content.Shared.Veil.Cult.Components;
|
||||
|
||||
namespace Content.Client.Veil.Cult;
|
||||
|
||||
public sealed class VeilBeaconSystem : SharedVeilBeaconSystem
|
||||
{
|
||||
protected override void UpdateUI(Entity<VeilCultBeaconComponent> ent)
|
||||
{
|
||||
if (UserInterfaceSystem.TryGetOpenUi(ent.Owner, VeilBeaconUiKey.Key, out var bui)
|
||||
&& bui is VeilBeaconBoundUserInterface cBui)
|
||||
{
|
||||
cBui.Reload();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,6 @@ using Content.Shared.Veil.Cult.Components;
|
||||
using Content.Shared.StatusIcon.Components;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Random;
|
||||
|
||||
namespace Content.Client.Veil.Cult
|
||||
{
|
||||
@@ -58,18 +57,18 @@ namespace Content.Client.Veil.Cult
|
||||
_sprite.RemoveLayer(uid, layer);
|
||||
}
|
||||
|
||||
private void OnEnchantRemove(EntityUid uid, EnchantedComponent comp, ComponentRemove args)
|
||||
{
|
||||
if (!HasComp<SpriteComponent>(uid))
|
||||
return;
|
||||
|
||||
if (_sprite.LayerExists(uid, 1))
|
||||
_sprite.RemoveLayer(uid, 1);
|
||||
}
|
||||
|
||||
private enum CogKey
|
||||
{
|
||||
Halo
|
||||
}
|
||||
|
||||
private void OnEnchantRemove(EntityUid uid, EnchantedComponent comp, ComponentRemove args)
|
||||
{
|
||||
if (!TryComp<SpriteComponent>(uid, out var sprite))
|
||||
return;
|
||||
|
||||
if (_sprite.LayerExists(uid, 1))
|
||||
_sprite.RemoveLayer(uid, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,17 +196,17 @@ public sealed partial class BloodCultSystem
|
||||
return;
|
||||
|
||||
args.PushMarkup(component.LocDesc);
|
||||
|
||||
|
||||
if (component.RuneType == BloodCultRune.Revive)
|
||||
{
|
||||
var o = cult.Offerings;
|
||||
var revives = o / 3;
|
||||
var need = 3 - o % 3;
|
||||
|
||||
|
||||
args.PushMarkup(revives > 0
|
||||
? Loc.GetString("revive-alive-count", ("alive", revives))
|
||||
: Loc.GetString("revive-need-more", ("needed", need)), -1);
|
||||
|
||||
|
||||
args.PushMarkup(Loc.GetString("revive-offering-count", ("offerings", o)), -2);
|
||||
}
|
||||
}
|
||||
@@ -842,7 +842,7 @@ public sealed partial class BloodCultSystem
|
||||
|
||||
Spawn(GetGodPrototype(), coords);
|
||||
|
||||
RaiseLocalEvent(new GodCalledEvent());
|
||||
RaiseLocalEvent(new BloodGodCalledEvent());
|
||||
TransformNearbyCultists(coords);
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ using Robust.Shared.Containers;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Random;
|
||||
using Robust.Shared.Timing;
|
||||
using Content.Shared.Clothing;
|
||||
using Content.Shared.Clothing;
|
||||
using Content.Shared.IdentityManagement.Components;
|
||||
using Content.Shared.Inventory;
|
||||
|
||||
@@ -170,7 +170,7 @@ public sealed partial class BloodCultSystem : SharedBloodCultSystem
|
||||
if (TryComp<IdentityBlockerComponent>(cloth, out var blocker) && blocker.Coverage.HasFlag(IdentityBlockerCoverage.EYES) && blocker.Enabled)
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var name = Identity.Name(uid, EntityManager, args.Examiner);
|
||||
args.PushMarkup(Loc.GetString("blood-cultist-eyes-glow-examined", ("name", name)));
|
||||
}
|
||||
@@ -191,10 +191,10 @@ public sealed partial class BloodCultSystem : SharedBloodCultSystem
|
||||
private void OnAttemptMelee(Entity<CultWeaponComponent> entity, ref AttemptMeleeEvent args)
|
||||
{
|
||||
var user = Transform(entity.Owner).ParentUid;
|
||||
if (HasComp<BloodCultistComponent>(args.User) && ent.Comp.Cult == CultType.Blood)
|
||||
if (HasComp<BloodCultistComponent>(args.User) && entity.Comp.Cult == CultType.Blood)
|
||||
return;
|
||||
|
||||
if (HasComp<VeilCultistComponent>(args.User) && ent.Comp.Cult == CultType.Veil)
|
||||
|
||||
if (HasComp<VeilCultistComponent>(args.User) && entity.Comp.Cult == CultType.Veil)
|
||||
return;
|
||||
|
||||
_popup.PopupEntity(Loc.GetString("blood-cult-failed-attack"), user, user, PopupType.SmallCaution);
|
||||
|
||||
@@ -75,8 +75,8 @@ namespace Content.Server.GameTicking.Rules
|
||||
SubscribeLocalEvent<BloodCultObjectComponent, ComponentShutdown>(OnBloodCultObjectShutdown);
|
||||
SubscribeLocalEvent<BloodCultObjectComponent, CryostorageEnterEvent>(OnCryostorageEnter);
|
||||
|
||||
SubscribeLocalEvent<GodCalledEvent>(OnGodCalled);
|
||||
SubscribeLocalEvent<RitualConductedEvent>(OnRitualConducted);
|
||||
SubscribeLocalEvent<BloodGodCalledEvent>(OnGodCalled);
|
||||
SubscribeLocalEvent<BloodRitualConductedEvent>(OnRitualConducted);
|
||||
|
||||
SubscribeLocalEvent<AutoCultistComponent, ComponentStartup>(OnAutoCultistAdded);
|
||||
SubscribeLocalEvent<BloodCultistComponent, ComponentRemove>(OnComponentRemove);
|
||||
@@ -361,7 +361,7 @@ namespace Content.Server.GameTicking.Rules
|
||||
{
|
||||
CheckStage();
|
||||
if (cult.SelectedTargets.Count == 0)
|
||||
RaiseLocalEvent(new RitualConductedEvent());
|
||||
RaiseLocalEvent(new BloodRitualConductedEvent());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -523,7 +523,7 @@ namespace Content.Server.GameTicking.Rules
|
||||
return null;
|
||||
}
|
||||
|
||||
private void OnGodCalled(GodCalledEvent ev)
|
||||
private void OnGodCalled(BloodGodCalledEvent ev)
|
||||
{
|
||||
var cult = GetActiveRule();
|
||||
if (cult == null)
|
||||
@@ -549,7 +549,7 @@ namespace Content.Server.GameTicking.Rules
|
||||
}
|
||||
}
|
||||
|
||||
private void OnRitualConducted(RitualConductedEvent ev)
|
||||
private void OnRitualConducted(BloodRitualConductedEvent ev)
|
||||
{
|
||||
var cult = GetActiveRule();
|
||||
if (cult == null)
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Content.Server.Veil.Cult;
|
||||
using Content.Shared.Veil.Cult;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Server.GameTicking.Rules.Components;
|
||||
@@ -10,11 +9,10 @@ namespace Content.Server.GameTicking.Rules.Components;
|
||||
[RegisterComponent, Access(typeof(VeilCultRuleSystem), typeof(VeilCultSystem))]
|
||||
public sealed partial class VeilCultRuleComponent : Component
|
||||
{
|
||||
|
||||
[DataField]
|
||||
[DataField]
|
||||
public float EnergyCount;
|
||||
|
||||
[DataField]
|
||||
|
||||
[DataField]
|
||||
public EntityUid? Station;
|
||||
|
||||
[DataField]
|
||||
@@ -43,4 +41,4 @@ public enum VeilCultWinType : byte
|
||||
RitualConducted,
|
||||
Neutral,
|
||||
CultLose
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,13 +2,9 @@ using System.Linq;
|
||||
using Content.Server.Actions;
|
||||
using Content.Server.Administration.Logs;
|
||||
using Content.Server.Antag;
|
||||
using Content.Server.Bed.Cryostorage;
|
||||
using Content.Server.Body.Components;
|
||||
using Content.Server.Body.Systems;
|
||||
using Content.Server.GameTicking.Rules.Components;
|
||||
using Content.Server.Mind;
|
||||
using Content.Server.Objectives;
|
||||
using Content.Server.Objectives.Components;
|
||||
using Content.Server.Objectives.Systems;
|
||||
using Content.Server.Roles;
|
||||
using Content.Server.RoundEnd;
|
||||
@@ -16,20 +12,13 @@ using Content.Server.Audio;
|
||||
using Content.Server.Chat.Systems;
|
||||
using Content.Server.Nuke;
|
||||
using Content.Shared.Achievements;
|
||||
using Content.Shared.Veil.Cult;
|
||||
using Content.Shared.Blood.Cult;
|
||||
using Content.Shared.Veil.Cult.Components;
|
||||
using Content.Shared.Body;
|
||||
using Content.Shared.Body.Components;
|
||||
using Content.Shared.Clumsy;
|
||||
using Content.Shared.CombatMode.Pacification;
|
||||
using Content.Shared.Database;
|
||||
using Content.Shared.GameTicking.Components;
|
||||
using Content.Shared.Hands.EntitySystems;
|
||||
using Content.Shared.Humanoid;
|
||||
using Content.Shared.Metabolism;
|
||||
using Content.Shared.Mind;
|
||||
using Content.Shared.Mindshield.Components;
|
||||
using Content.Shared.Mobs;
|
||||
using Content.Shared.NPC.Prototypes;
|
||||
using Content.Shared.NPC.Systems;
|
||||
@@ -43,8 +32,8 @@ using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Random;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Server.Player;
|
||||
using Content.Shared.Veil.Cult;
|
||||
|
||||
namespace Content.Server.GameTicking.Rules
|
||||
{
|
||||
@@ -56,7 +45,6 @@ namespace Content.Server.GameTicking.Rules
|
||||
[Dependency] private readonly ISharedPlayerManager _player = default!;
|
||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogManager = default!;
|
||||
[Dependency] private readonly MetabolizerSystem _metabolism = default!;
|
||||
[Dependency] private readonly MindSystem _mind = default!;
|
||||
[Dependency] private readonly NpcFactionSystem _npcFaction = default!;
|
||||
[Dependency] private readonly RoleSystem _role = default!;
|
||||
@@ -83,26 +71,26 @@ namespace Content.Server.GameTicking.Rules
|
||||
SubscribeLocalEvent<VeilCultistComponent, ComponentStartup>((_, _, _) => CheckStage());
|
||||
SubscribeLocalEvent<VeilCultConstructComponent, ComponentStartup>((_, _, _) => CheckStage());
|
||||
|
||||
SubscribeLocalEvent<GodCalledEvent>(OnGodCalled);
|
||||
SubscribeLocalEvent<RitualConductedEvent>(OnRitualConducted);
|
||||
SubscribeLocalEvent<VeilGodCalledEvent>(OnGodCalled);
|
||||
SubscribeLocalEvent<VeilRitualConductedEvent>(OnRitualConducted);
|
||||
|
||||
SubscribeLocalEvent<AutoVeilCultistComponent, ComponentStartup>(OnAutoCultistAdded);
|
||||
SubscribeLocalEvent<VeilCultistComponent, ComponentRemove>(OnComponentRemove);
|
||||
SubscribeLocalEvent<VeilCultistComponent, MobStateChangedEvent>(OnMobStateChanged);
|
||||
SubscribeLocalEvent<VeilCultistComponent, EntityZombifiedEvent>(OnCultistZombified);
|
||||
}
|
||||
|
||||
|
||||
private void OnCultistSelected(Entity<VeilCultRuleComponent> mindId, ref AfterAntagEntitySelectedEvent args)
|
||||
{
|
||||
var ent = args.EntityUid;
|
||||
|
||||
if (mindId.Comp.SelectedTargets.Count == 0)
|
||||
SelectRandomTargets(mindId.Comp);
|
||||
|
||||
|
||||
MakeCultist(ent);
|
||||
_antag.SendBriefing(ent, MakeBriefing(ent), Color.Orange, null);
|
||||
}
|
||||
|
||||
|
||||
private void MakeCultist(EntityUid ent)
|
||||
{
|
||||
var actionPrototypes = new[]
|
||||
@@ -122,26 +110,8 @@ namespace Content.Server.GameTicking.Rules
|
||||
foreach (var compType in componentsToRemove)
|
||||
RemComp(ent, compType);
|
||||
|
||||
HandleMetabolism(ent);
|
||||
CreateObjectivesForCultist(ent);
|
||||
}
|
||||
|
||||
private void HandleMetabolism(EntityUid cultist)
|
||||
{
|
||||
if (TryComp<BodyComponent>(cultist, out var bodyComponent) && bodyComponent.Organs != null)
|
||||
{
|
||||
foreach (var organ in bodyComponent.Organs.ContainedEntities)
|
||||
{
|
||||
if (TryComp<MetabolizerComponent>(organ, out var metabolizer))
|
||||
{
|
||||
if (TryComp<StomachComponent>(organ, out _))
|
||||
_metabolism.ClearMetabolizerTypes(metabolizer);
|
||||
|
||||
_metabolism.TryAddMetabolizerType(metabolizer, "BloodCultist");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private string MakeBriefing(EntityUid ent)
|
||||
{
|
||||
@@ -152,7 +122,7 @@ namespace Content.Server.GameTicking.Rules
|
||||
|
||||
return briefing;
|
||||
}
|
||||
|
||||
|
||||
private void SelectRandomTargets(VeilCultRuleComponent cult)
|
||||
{
|
||||
cult.SelectedTargets.Clear();
|
||||
@@ -167,15 +137,15 @@ namespace Content.Server.GameTicking.Rules
|
||||
var placeCandidates = new List<EntityUid>();
|
||||
var enumerator = EntityQueryEnumerator<WarpPointComponent, TransformComponent>();
|
||||
|
||||
while (enumerator.MoveNext(out var uid, out var warp, out var xform))
|
||||
while (enumerator.MoveNext(out var uid, out _, out var xform))
|
||||
{
|
||||
if (xform.GridUid != mainGrid)
|
||||
continue;
|
||||
|
||||
|
||||
if (HasComp<ItemComponent>(uid) || HasComp<NukeComponent>(uid)) // YOU CANT STEAL THE NUKE DUD
|
||||
continue;
|
||||
|
||||
placeCandidates.Add(uid);
|
||||
placeCandidates.Add(uid);
|
||||
}
|
||||
|
||||
if (placeCandidates.Count >= 6)
|
||||
@@ -192,15 +162,14 @@ namespace Content.Server.GameTicking.Rules
|
||||
var target = placeCandidates[index];
|
||||
cult.SelectedTargets.Add(target);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var target in placeCandidates)
|
||||
{
|
||||
cult.SelectedTargets.Add(target);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void CreateObjectivesForCultist(EntityUid cultist)
|
||||
{
|
||||
var cult = GetActiveRule();
|
||||
@@ -218,9 +187,9 @@ namespace Content.Server.GameTicking.Rules
|
||||
var objective = _objectives.TryCreateObjective(mindId, mind, cult.ObjectivePrototype);
|
||||
if (objective == null)
|
||||
continue;
|
||||
|
||||
|
||||
if (TryComp<WarpPointComponent>(target, out var warp) && warp.Location != null)
|
||||
{
|
||||
{
|
||||
_target.SetTarget(objective.Value, target);
|
||||
_meta.SetEntityName(objective.Value, Loc.GetString("objective-condition-veil-ritual-beacon-title",
|
||||
("targetName", warp.Location))); // <see cref="ObjectiveAssignedEvent"/> here doesn't worked, or i'm stupid
|
||||
@@ -228,7 +197,7 @@ namespace Content.Server.GameTicking.Rules
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void OnAutoCultistAdded(EntityUid uid, AutoVeilCultistComponent comp, ComponentStartup args)
|
||||
{
|
||||
if (!_mind.TryGetMind(uid, out var mindId, out var mind) || HasComp<VeilCultistComponent>(uid))
|
||||
@@ -250,11 +219,11 @@ namespace Content.Server.GameTicking.Rules
|
||||
mindLink.Channels.Add(culsistComp.CultMindChannel);
|
||||
|
||||
var ritualObjective = _objectives.TryCreateObjective(mindId, mind, "VeilCultRitualObjective");
|
||||
if (ritualObjective != null)
|
||||
_mind.AddObjective(mindId, mind, ritualObjective.Value);
|
||||
if (ritualObjective != null) _mind.AddObjective(mindId, mind, ritualObjective.Value);
|
||||
|
||||
MakeCultist(uid);
|
||||
}
|
||||
|
||||
|
||||
private void CheckStage()
|
||||
{
|
||||
var cult = GetActiveRule();
|
||||
@@ -307,16 +276,16 @@ namespace Content.Server.GameTicking.Rules
|
||||
actorFilter.AddPlayer(actor.PlayerSession);
|
||||
_popup.PopupEntity(Loc.GetString("veil-cult-second-warning"), actorUid, actorUid, PopupType.SmallCaution);
|
||||
}
|
||||
|
||||
|
||||
_sound.PlayAdminGlobal(Filter.Empty().AddAllPlayers(_playerManager), _audio.ResolveSound(new SoundPathSpecifier("/Audio/_Wega/Ambience/Antag/veilcult_start.ogg")));
|
||||
cult.SecondTriggered = true;
|
||||
_chat.DispatchGlobalAnnouncement(Loc.GetString("veil-cult-second-phase"), playSound: false, colorOverride: Color.Orange);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// sub-methods region
|
||||
|
||||
|
||||
private int GetCultEntities()
|
||||
{
|
||||
var totalCultists = GetAllCultists().Count;
|
||||
@@ -353,7 +322,7 @@ namespace Content.Server.GameTicking.Rules
|
||||
|
||||
return constructs;
|
||||
}
|
||||
|
||||
|
||||
public VeilCultRuleComponent? GetActiveRule()
|
||||
{
|
||||
var query = QueryActiveRules();
|
||||
@@ -363,28 +332,28 @@ namespace Content.Server.GameTicking.Rules
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public bool TryUseEnergy(float amount)
|
||||
{
|
||||
var comp = GetActiveRule();
|
||||
if (comp == null)
|
||||
return true;
|
||||
|
||||
|
||||
if (comp.EnergyCount < amount)
|
||||
return false;
|
||||
|
||||
|
||||
comp.EnergyCount -= amount;
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public bool CheckObjectives()
|
||||
{
|
||||
var cult = GetActiveRule();
|
||||
if (cult == null)
|
||||
return false;
|
||||
|
||||
|
||||
foreach (var target in cult.SelectedTargets)
|
||||
{
|
||||
{
|
||||
var beacons = _entityLookup.GetEntitiesInRange<VeilCultBeaconComponent>(Transform(target).Coordinates, 10f);
|
||||
if (beacons.Count < 1)
|
||||
return false;
|
||||
@@ -415,10 +384,10 @@ namespace Content.Server.GameTicking.Rules
|
||||
args.AddLine(Loc.GetString("veil-cultist-list-name-user", ("name", name), ("user", sessionData.UserName)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// round stages
|
||||
|
||||
private void OnGodCalled(GodCalledEvent ev)
|
||||
|
||||
private void OnGodCalled(VeilGodCalledEvent ev)
|
||||
{
|
||||
var cult = GetActiveRule();
|
||||
if (cult == null)
|
||||
@@ -444,7 +413,7 @@ namespace Content.Server.GameTicking.Rules
|
||||
}
|
||||
}
|
||||
|
||||
private void OnRitualConducted(RitualConductedEvent ev)
|
||||
private void OnRitualConducted(VeilRitualConductedEvent ev)
|
||||
{
|
||||
var cult = GetActiveRule();
|
||||
if (cult == null)
|
||||
@@ -488,7 +457,5 @@ namespace Content.Server.GameTicking.Rules
|
||||
cult.WinType = VeilCultWinType.CultLose;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
using Content.Shared.Veil.Cult;
|
||||
using Content.Shared.Veil.Cult.Components;
|
||||
using Content.Shared.UserInterface;
|
||||
using Content.Shared.Whitelist;
|
||||
using Content.Shared.Teleportation.Components;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Server.Veil.Cult;
|
||||
|
||||
@@ -11,11 +8,11 @@ namespace Content.Server.Veil.Cult;
|
||||
public sealed partial class TeleportionEnchantSystem : SharedTeleportationEnchantSystem
|
||||
{
|
||||
[Dependency] private readonly SharedUserInterfaceSystem _ui = default!;
|
||||
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
|
||||
SubscribeLocalEvent<TeleportationEnchantComponent, BoundUIOpenedEvent>(OnUiOpen);
|
||||
}
|
||||
|
||||
@@ -36,4 +33,4 @@ public sealed partial class TeleportionEnchantSystem : SharedTeleportationEnchan
|
||||
_ui.SetUiState(ent.Owner, TeleportEnchantUiKey.Key, new TeleportationEnchantBoundUserInterfaceState(ent.Comp.AvailableWarps));
|
||||
Dirty(ent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
using Content.Shared.Veil.Cult;
|
||||
using Content.Shared.Veil.Cult.Components;
|
||||
|
||||
namespace Content.Server.Veil.Cult;
|
||||
|
||||
public sealed class VeilBeaconSystem : SharedVeilBeaconSystem
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,45 +1,22 @@
|
||||
using System.Linq;
|
||||
using Content.Server.Administration;
|
||||
using Content.Server.Body.Systems;
|
||||
using Content.Server.Chat.Systems;
|
||||
using Content.Server.Emp;
|
||||
using Content.Server.Flash;
|
||||
using Content.Shared.Veil.Cult;
|
||||
using Content.Shared.Veil.Cult.Components;
|
||||
using Content.Shared.Body.Components;
|
||||
using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.Clothing;
|
||||
using Content.Shared.Cuffs;
|
||||
using Content.Shared.Cuffs.Components;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Damage.Components;
|
||||
using Content.Shared.Damage.Systems;
|
||||
using Content.Shared.DoAfter;
|
||||
using Content.Shared.EnergyShield;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Content.Shared.Humanoid;
|
||||
using Content.Shared.Hands.Components;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Interaction.Events;
|
||||
using Content.Shared.Inventory;
|
||||
using Content.Shared.NullRod.Components;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.Roles;
|
||||
using Content.Shared.Stacks;
|
||||
using Content.Shared.Standing;
|
||||
using Content.Shared.Stunnable;
|
||||
using Content.Shared.Timing;
|
||||
using Content.Shared.Silicons.StationAi;
|
||||
using Content.Shared.Silicons.Laws.Components;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Physics.Components;
|
||||
using Robust.Shared.Physics.Systems;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Random;
|
||||
|
||||
namespace Content.Server.Veil.Cult;
|
||||
|
||||
@@ -59,21 +36,16 @@ public sealed partial class VeilCultSystem
|
||||
[Dependency] private readonly SharedStationAiSystem _stationAi = default!;
|
||||
|
||||
private static readonly SoundPathSpecifier CultSpell = new SoundPathSpecifier("/Audio/_Wega/Effects/cult_spell.ogg");
|
||||
private static readonly int EnergyPerOne = 100; // TODO: МБ сделать значение в компоненте рула, а не хардкодом
|
||||
private static readonly int EnergyPerOne = 100; // TODO: МБ сделать значение в компоненте рула, а не хардкодом | Не, похуй, но я бы вывел в константу :P
|
||||
|
||||
private void InitializeVeilAbilities()
|
||||
{
|
||||
|
||||
SubscribeLocalEvent<VeilCultistComponent, VeilCultMidasTouchGetHandEvent>(OnMidasTouch);
|
||||
SubscribeLocalEvent<MidasHandComponent, AfterInteractEvent>(OnInteractHand);
|
||||
SubscribeLocalEvent<StrangeShardComponent, AfterInteractEvent>(OnInteractShard);
|
||||
SubscribeLocalEvent<MidasHandComponent, MidasTouchDoAfterEvent>(DoAfterInteractHand);
|
||||
// Abilities
|
||||
}
|
||||
|
||||
|
||||
#region Abilities
|
||||
|
||||
public void OnMidasTouch(EntityUid cultist, VeilCultistComponent component, VeilCultMidasTouchGetHandEvent args)
|
||||
{
|
||||
if (TryComp<HandsComponent>(cultist, out var hands))
|
||||
@@ -88,17 +60,13 @@ public sealed partial class VeilCultSystem
|
||||
QueueDel(spell);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
private void OnInteractHand(EntityUid uid, MidasHandComponent component, AfterInteractEvent args)
|
||||
{
|
||||
if (HasComp<StackComponent>(args.Target) || HasComp<StationAiCoreComponent>(args.Target) || HasComp<SiliconLawProviderComponent>(args.Target))
|
||||
{
|
||||
var doAfterEventArgs = new DoAfterArgs(EntityManager, args.User, TimeSpan.FromSeconds(2),
|
||||
new MidasTouchDoAfterEvent(),
|
||||
eventTarget: uid,
|
||||
target: args.Target)
|
||||
var doAfterEventArgs = new DoAfterArgs(EntityManager, args.User, TimeSpan.FromSeconds(2),
|
||||
new MidasTouchDoAfterEvent(), uid, args.Target)
|
||||
{
|
||||
BreakOnMove = true,
|
||||
BreakOnDamage = true,
|
||||
@@ -106,15 +74,15 @@ public sealed partial class VeilCultSystem
|
||||
NeedHand = false
|
||||
};
|
||||
|
||||
_doAfterSystem.TryStartDoAfter(doAfterEventArgs);
|
||||
_doAfterSystem.TryStartDoAfter(doAfterEventArgs);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void DoAfterInteractHand(EntityUid uid, MidasHandComponent component, MidasTouchDoAfterEvent args)
|
||||
{
|
||||
if (args.Cancelled)
|
||||
return;
|
||||
|
||||
|
||||
if (args.Target != null)
|
||||
{
|
||||
if (TryComp<StackComponent>(args.Target, out var stack))
|
||||
@@ -123,14 +91,14 @@ public sealed partial class VeilCultSystem
|
||||
QueueDel(uid);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (TryComp<SiliconLawProviderComponent>(args.Target, out var laws))
|
||||
{
|
||||
ChangeBorgLaws(args.Target.Value, laws);
|
||||
QueueDel(uid);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (TryComp<StationAiCoreComponent>(args.Target, out var core))
|
||||
{
|
||||
ChangeAiLaws(args.Target.Value, core);
|
||||
@@ -138,10 +106,8 @@ public sealed partial class VeilCultSystem
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void TransformMaterial(EntityUid user, EntityUid material, StackComponent stack)
|
||||
{
|
||||
if (!_prototypeManager.TryIndex(stack.StackTypeId, out var stackPrototype))
|
||||
@@ -167,25 +133,23 @@ public sealed partial class VeilCultSystem
|
||||
|
||||
_audio.PlayPvs(CultSpell, user);
|
||||
}
|
||||
|
||||
|
||||
private void TransformSteelToBrass(EntityUid metalStack, EntityCoordinates coords, int count)
|
||||
{
|
||||
var brass = Spawn("SheetBrass1", coords);
|
||||
QueueDel(metalStack);
|
||||
|
||||
|
||||
if (TryComp<StackComponent>(brass, out var newStack))
|
||||
_stack.SetCount((brass, newStack), count);
|
||||
}
|
||||
|
||||
private void TransformToChargedBrass(EntityUid metalStack, EntityCoordinates coords, int count)
|
||||
{
|
||||
|
||||
var cult = _veilCult.GetActiveRule();
|
||||
if (cult == null)
|
||||
return;
|
||||
|
||||
if (_veilCult.TryUseEnergy(count*EnergyPerOne))
|
||||
|
||||
if (_veilCult.TryUseEnergy(count * EnergyPerOne))
|
||||
{
|
||||
var chargedBrass = Spawn("SheetChargedBrass1", coords);
|
||||
QueueDel(metalStack);
|
||||
@@ -196,16 +160,15 @@ public sealed partial class VeilCultSystem
|
||||
else
|
||||
_popup.PopupEntity(Loc.GetString("veil-cult-not-enough-energy"), metalStack, PopupType.Medium);
|
||||
}
|
||||
|
||||
|
||||
private void ChangeBorgLaws(EntityUid uid, SiliconLawProviderComponent comp)
|
||||
{
|
||||
var ev = new SiliconVeilCultHackedEvent();
|
||||
RaiseLocalEvent(uid, ref ev);
|
||||
}
|
||||
|
||||
|
||||
private void ChangeAiLaws(EntityUid uid, StationAiCoreComponent core)
|
||||
{
|
||||
|
||||
if (_stationAi.TryGetHeld((uid, core), out var mind))
|
||||
{
|
||||
if (mind != null)
|
||||
@@ -218,15 +181,13 @@ public sealed partial class VeilCultSystem
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void OnInteractShard(EntityUid uid, StrangeShardComponent component, AfterInteractEvent args)
|
||||
{
|
||||
if (HasComp<VeilCultistComponent>(args.Target))
|
||||
{
|
||||
var doAfterEventArgs = new DoAfterArgs(EntityManager, args.User, TimeSpan.FromSeconds(3),
|
||||
new StrangeShardDoAfterEvent(),
|
||||
eventTarget: args.Target,
|
||||
target: uid)
|
||||
var doAfterEventArgs = new DoAfterArgs(EntityManager, args.User, TimeSpan.FromSeconds(3),
|
||||
new StrangeShardDoAfterEvent(), args.Target, uid)
|
||||
{
|
||||
BreakOnMove = true,
|
||||
BreakOnDamage = true,
|
||||
@@ -234,9 +195,9 @@ public sealed partial class VeilCultSystem
|
||||
NeedHand = false
|
||||
};
|
||||
|
||||
_doAfterSystem.TryStartDoAfter(doAfterEventArgs);
|
||||
_doAfterSystem.TryStartDoAfter(doAfterEventArgs);
|
||||
}
|
||||
|
||||
|
||||
if (HasComp<VeilCultAltarComponent>(args.Target))
|
||||
{
|
||||
if (!_veilCult.CheckObjectives())
|
||||
@@ -244,10 +205,9 @@ public sealed partial class VeilCultSystem
|
||||
_popup.PopupEntity(Loc.GetString("veil-cult-objectives-not-complete"), args.User, args.User, PopupType.LargeCaution);
|
||||
return;
|
||||
}
|
||||
var doAfterEventArgs = new DoAfterArgs(EntityManager, args.User, TimeSpan.FromSeconds(6),
|
||||
new StrangeShardDoAfterEvent(),
|
||||
eventTarget: args.Target,
|
||||
target: uid)
|
||||
|
||||
var doAfterEventArgs = new DoAfterArgs(EntityManager, args.User, TimeSpan.FromSeconds(6),
|
||||
new StrangeShardDoAfterEvent(), args.Target, uid)
|
||||
{
|
||||
BreakOnMove = true,
|
||||
BreakOnDamage = true,
|
||||
@@ -255,8 +215,7 @@ public sealed partial class VeilCultSystem
|
||||
NeedHand = false
|
||||
};
|
||||
|
||||
_doAfterSystem.TryStartDoAfter(doAfterEventArgs);
|
||||
_doAfterSystem.TryStartDoAfter(doAfterEventArgs);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
using System.Linq;
|
||||
using Vector2 = System.Numerics.Vector2;
|
||||
using Content.Server.Administration;
|
||||
using Content.Server.Body.Systems;
|
||||
using Content.Server.Chat.Systems;
|
||||
using Content.Server.Emp;
|
||||
using Content.Server.EUI;
|
||||
using Content.Server.Flash;
|
||||
using System.Numerics;
|
||||
using Content.Server.Surgery;
|
||||
using Content.Shared.Body.Components;
|
||||
using Content.Shared.Veil.Cult.Components;
|
||||
@@ -13,25 +7,12 @@ using Content.Shared.Veil.Cult;
|
||||
using Content.Shared.Clothing;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Damage.Components;
|
||||
using Content.Shared.Damage.Systems;
|
||||
using Content.Shared.DoAfter;
|
||||
using Content.Shared.Doors.Components;
|
||||
using Content.Shared.EnergyShield;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Content.Shared.Fluids.Components;
|
||||
using Content.Shared.Humanoid;
|
||||
using Content.Shared.Hands.EntitySystems;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Interaction.Events;
|
||||
using Content.Shared.Inventory;
|
||||
using Content.Shared.NullRod.Components;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.Roles;
|
||||
using Content.Shared.Stacks;
|
||||
using Content.Shared.Standing;
|
||||
using Content.Shared.Stunnable;
|
||||
using Content.Shared.Timing;
|
||||
using Content.Server.Audio;
|
||||
using Content.Shared.Weapons.Melee.Events;
|
||||
using Content.Shared.Projectiles;
|
||||
using Content.Shared.Weapons.Ranged.Events;
|
||||
@@ -48,7 +29,6 @@ using Content.Shared.Wieldable.Components;
|
||||
using Content.Shared.Speech.Muting;
|
||||
using Content.Shared.Silicons.Borgs.Components;
|
||||
using Content.Shared.Android;
|
||||
using Content.Shared.Access.Components;
|
||||
using Content.Shared.Movement.Systems;
|
||||
using Content.Shared.Movement.Components;
|
||||
using Content.Shared.CombatMode.Pacification;
|
||||
@@ -56,13 +36,7 @@ using Content.Shared.Tag;
|
||||
using Content.Shared.Emag.Systems;
|
||||
using Content.Shared.Maps;
|
||||
using Content.Shared.Doors.Systems;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Physics.Components;
|
||||
using Robust.Shared.Physics.Systems;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Random;
|
||||
using Robust.Shared.Timing;
|
||||
@@ -79,12 +53,11 @@ public sealed partial class VeilCultSystem
|
||||
[Dependency] private readonly TileSystem _tile = default!;
|
||||
[Dependency] private readonly SharedMapSystem _map = default!;
|
||||
[Dependency] private readonly ITileDefinitionManager _tileDefinitionManager = default!;
|
||||
|
||||
|
||||
private static readonly ProtoId<TagPrototype> WallTag = "Wall";
|
||||
|
||||
private void InitializeEnchantments()
|
||||
{
|
||||
|
||||
// Activate Action at enchanted item
|
||||
SubscribeLocalEvent<EnchantedComponent, CrusherEnchantActionEvent>(OnActivateCrusher);
|
||||
SubscribeLocalEvent<EnchantedComponent, ConfusionEnchantActionEvent>(OnActivateConfusion);
|
||||
@@ -99,7 +72,7 @@ public sealed partial class VeilCultSystem
|
||||
SubscribeLocalEvent<EnchantedComponent, HardenPlatesEnchantActionEvent>(OnActivateHardenPlates);
|
||||
SubscribeLocalEvent<EnchantedComponent, NorthStarEnchantActionEvent>(OnActivateNorthStar);
|
||||
SubscribeLocalEvent<EnchantedComponent, RedFlameEnchantActionEvent>(OnActivateRedFlame);
|
||||
|
||||
|
||||
// Enchants
|
||||
SubscribeLocalEvent<CrusherEnchantComponent, MeleeHitEvent>(CrusherOnMeleeHit);
|
||||
SubscribeLocalEvent<ConfusionEnchantComponent, MeleeHitEvent>(ConfusionOnMeleeHit);
|
||||
@@ -109,26 +82,25 @@ public sealed partial class VeilCultSystem
|
||||
SubscribeLocalEvent<TerraformEnchantComponent, MeleeHitEvent>(TerraformOnMeleeHit);
|
||||
SubscribeLocalEvent<ElectricalTouchEnchantComponent, MeleeHitEvent>(ElectricalTouchOnMeleeHit);
|
||||
SubscribeLocalEvent<BloodshedEnchantComponent, MeleeHitEvent>(BloodshedOnMeleeHit);
|
||||
|
||||
|
||||
Subs.SubscribeWithRelay<ReflectionEnchantComponent, ProjectileReflectAttemptEvent>(OnReflectionProjecile, baseEvent: false);
|
||||
Subs.SubscribeWithRelay<ReflectionEnchantComponent, HitScanReflectAttemptEvent>(OnReflectionHitscan, baseEvent: false);
|
||||
|
||||
|
||||
SubscribeLocalEvent<ReconstructionEnchantComponent, UseInHandEvent>(ReconstructionOnUseInHand);
|
||||
SubscribeLocalEvent<EmpEnchantComponent, UseInHandEvent>(EmpOnUseInHand);
|
||||
SubscribeLocalEvent<TimeStopEnchantComponent, UseInHandEvent>(TimeStopOnUseInHand);
|
||||
SubscribeLocalEvent<HidingsClockEnchantComponent, UseInHandEvent>(HidingCloacksOnUseInHand);
|
||||
|
||||
|
||||
SubscribeLocalEvent<SealWoundsEnchantComponent, AfterInteractEvent>(SealWoundOnUse);
|
||||
|
||||
|
||||
SubscribeLocalEvent<EnchantableComponent, EnchantingDoAfterEvent>(EnchantDoAfter);
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void EnchantDoAfter(EntityUid uid, EnchantableComponent component, ref EnchantingDoAfterEvent args)
|
||||
{
|
||||
if (args.Cancelled || args.Target == null)
|
||||
return;
|
||||
|
||||
|
||||
if (_veilCult.TryUseEnergy(component.Cost))
|
||||
{
|
||||
var ent = Spawn(args.Entity, Transform(args.Target.Value).Coordinates);
|
||||
@@ -137,28 +109,29 @@ public sealed partial class VeilCultSystem
|
||||
QueueDel(uid);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void OnActivateCrusher(EntityUid uid, EnchantedComponent comp, CrusherEnchantActionEvent args)
|
||||
{
|
||||
EnsureComp<CrusherEnchantComponent>(uid);
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
|
||||
private void OnActivateKnockback(EntityUid uid, EnchantedComponent comp, KnockbackEnchantActionEvent args)
|
||||
{
|
||||
EnsureComp<KnockbackEnchantComponent>(uid, out var kb);
|
||||
EnsureComp<MeleeThrowOnHitComponent>(uid, out var throwOnHit);
|
||||
throwOnHit.Speed = kb.Speed;
|
||||
throwOnHit.Distance = kb.Distance;
|
||||
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
|
||||
private void OnActivateConfusion(EntityUid uid, EnchantedComponent comp, ConfusionEnchantActionEvent args)
|
||||
{
|
||||
EnsureComp<ConfusionEnchantComponent>(uid);
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
|
||||
private void OnActivateSwordsmen(EntityUid uid, EnchantedComponent comp, SwordsmenEnchantActionEvent args)
|
||||
{
|
||||
EnsureComp<SwordsmenEnchantComponent>(uid, out var enchant);
|
||||
@@ -177,15 +150,16 @@ public sealed partial class VeilCultSystem
|
||||
weapon.Damage = oldDamage;
|
||||
});
|
||||
}
|
||||
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
|
||||
private void OnActivateBloodShed(EntityUid uid, EnchantedComponent comp, BloodshedEnchantActionEvent args)
|
||||
{
|
||||
EnsureComp<BloodshedEnchantComponent>(uid);
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
|
||||
private void OnActivateHaste(EntityUid uid, EnchantedComponent comp, HasteEnchantActionEvent args)
|
||||
{
|
||||
EnsureComp<HasteEnchantComponent>(uid, out var haste);
|
||||
@@ -195,6 +169,7 @@ public sealed partial class VeilCultSystem
|
||||
cloth.SprintModifier = haste.SprintModifier;
|
||||
cloth.WalkModifier = haste.WalkModifier;
|
||||
Dirty(uid, cloth);
|
||||
|
||||
_speed.RefreshMovementSpeedModifiers(args.Performer);
|
||||
Timer.Spawn(haste.Time, () =>
|
||||
{
|
||||
@@ -205,45 +180,47 @@ public sealed partial class VeilCultSystem
|
||||
Dirty(uid, cloth);
|
||||
_speed.RefreshMovementSpeedModifiers(args.Performer);
|
||||
});
|
||||
|
||||
args.Handled = true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void OnActivateReflection(EntityUid uid, EnchantedComponent comp, ReflectionEnchantActionEvent args)
|
||||
{
|
||||
EnsureComp<ReflectComponent>(uid, out var refl);
|
||||
refl.ReflectingInHands = false;
|
||||
refl.ReflectProb = 1f;
|
||||
refl.InRightPlace = true;
|
||||
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
|
||||
private void OnActivateAbsorb(EntityUid uid, EnchantedComponent comp, AbsorbEnchantActionEvent args)
|
||||
{
|
||||
var user = args.Performer;
|
||||
var shield = EnsureComp<EnergyShieldOwnerComponent>(user);
|
||||
shield.ShieldEntity = Spawn("EnergyShieldEffect", Transform(user).Coordinates);
|
||||
shield.SustainingCount = 6;
|
||||
shield.SustainingCount = 6;
|
||||
_transform.SetParent(shield.ShieldEntity.Value, user);
|
||||
RemComp<EnchantedComponent>(uid);
|
||||
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void OnActivateCamouflage(EntityUid uid, EnchantedComponent comp, CamouflageEnchantActionEvent args)
|
||||
{
|
||||
EnsureComp<StealthComponent>(args.Performer, out var stealth);
|
||||
stealth.LastVisibility = 0.2f;
|
||||
Dirty(args.Performer, stealth);
|
||||
Timer.Spawn(TimeSpan.FromSeconds(10), () =>
|
||||
Timer.Spawn(TimeSpan.FromSeconds(10), () =>
|
||||
{
|
||||
RemComp<StealthComponent>(args.Performer);
|
||||
RemComp<CamouflageEnchantComponent>(uid);
|
||||
RemComp<EnchantedComponent>(uid);
|
||||
});
|
||||
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
|
||||
private void OnActivateFlash(EntityUid uid, EnchantedComponent comp, FlashEnchantActionEvent args)
|
||||
{
|
||||
var nearbyCultists = _entityLookup.GetEntitiesInRange<VeilCultistComponent>(Transform(uid).Coordinates, 10f);
|
||||
@@ -252,18 +229,21 @@ public sealed partial class VeilCultSystem
|
||||
EnsureComp<FlashImmunityComponent>(cultist.Owner);
|
||||
Timer.Spawn(TimeSpan.FromSeconds(1), () => RemComp<FlashImmunityComponent>(cultist.Owner));
|
||||
}
|
||||
|
||||
var nearbyConstruct = _entityLookup.GetEntitiesInRange<VeilCultConstructComponent>(Transform(uid).Coordinates, 10f);
|
||||
foreach (var construct in nearbyConstruct)
|
||||
{
|
||||
EnsureComp<FlashImmunityComponent>(construct.Owner);
|
||||
Timer.Spawn(TimeSpan.FromSeconds(1), () => RemComp<FlashImmunityComponent>(construct.Owner));
|
||||
}
|
||||
|
||||
_flash.FlashArea(args.Performer, args.Performer, 10f, TimeSpan.FromSeconds(3));
|
||||
RemComp<FlashEnchantComponent>(uid);
|
||||
RemComp<EnchantedComponent>(uid);
|
||||
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
|
||||
private void OnActivateHardenPlates(EntityUid uid, EnchantedComponent comp, HardenPlatesEnchantActionEvent args)
|
||||
{
|
||||
EnsureComp<HardenPlatesEnchantComponent>(uid, out var plate);
|
||||
@@ -286,11 +266,11 @@ public sealed partial class VeilCultSystem
|
||||
RemComp<HardenPlatesEnchantComponent>(uid);
|
||||
RemComp<EnchantedComponent>(uid);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
|
||||
private void OnActivateNorthStar(EntityUid uid, EnchantedComponent comp, NorthStarEnchantActionEvent args)
|
||||
{
|
||||
EnsureComp<NorthStarEnchantComponent>(uid, out var enchant);
|
||||
@@ -305,9 +285,10 @@ public sealed partial class VeilCultSystem
|
||||
RemComp<NorthStarEnchantComponent>(uid);
|
||||
});
|
||||
}
|
||||
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
|
||||
private void OnActivateRedFlame(EntityUid uid, EnchantedComponent comp, RedFlameEnchantActionEvent args)
|
||||
{
|
||||
EnsureComp<RedFlameEnchantComponent>(uid, out var enchant);
|
||||
@@ -319,15 +300,15 @@ public sealed partial class VeilCultSystem
|
||||
RemComp<EnchantedComponent>(uid);
|
||||
RemComp<IgniteOnMeleeHitComponent>(uid);
|
||||
});
|
||||
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
|
||||
private void KnockbackOnMeleeHit(EntityUid uid, KnockbackEnchantComponent comp, MeleeHitEvent args)
|
||||
{
|
||||
if (args.IsHit && args.HitEntities.Count > 0)
|
||||
{
|
||||
comp.Uses -= 1;
|
||||
}
|
||||
comp.Uses--;
|
||||
|
||||
if (comp.Uses <= 0)
|
||||
{
|
||||
RemComp<KnockbackEnchantComponent>(uid);
|
||||
@@ -335,7 +316,7 @@ public sealed partial class VeilCultSystem
|
||||
RemComp<EnchantedComponent>(uid);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void CrusherOnMeleeHit(EntityUid uid, CrusherEnchantComponent comp, MeleeHitEvent args)
|
||||
{
|
||||
if (TryComp<WieldableComponent>(uid, out var wield))
|
||||
@@ -350,13 +331,13 @@ public sealed partial class VeilCultSystem
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RemComp<CrusherEnchantComponent>(uid);
|
||||
RemComp<EnchantedComponent>(uid);
|
||||
}
|
||||
|
||||
|
||||
private void ConfusionOnMeleeHit(EntityUid uid, ConfusionEnchantComponent comp, MeleeHitEvent args)
|
||||
{
|
||||
|
||||
foreach (var target in args.HitEntities)
|
||||
{
|
||||
if (HasComp<InputMoverComponent>(target))
|
||||
@@ -365,23 +346,24 @@ public sealed partial class VeilCultSystem
|
||||
Timer.Spawn(comp.Time, () => RemComp<ConfusionComponent>(target));
|
||||
}
|
||||
}
|
||||
|
||||
RemComp<EnchantedComponent>(uid);
|
||||
RemComp<ConfusionEnchantComponent>(uid);
|
||||
}
|
||||
|
||||
|
||||
private void ElectricalTouchOnMeleeHit(EntityUid uid, ElectricalTouchEnchantComponent comp, MeleeHitEvent args)
|
||||
{
|
||||
if (TryComp<WieldableComponent>(uid, out var wield) && wield.Wielded)
|
||||
{
|
||||
{
|
||||
foreach (var target in args.HitEntities)
|
||||
{
|
||||
if (!HasComp<HumanoidProfileComponent>(target))
|
||||
_emp.EmpPulse(Transform(target).Coordinates, 1f, 75000f, TimeSpan.FromSeconds(8));
|
||||
|
||||
else
|
||||
_emp.EmpPulse(Transform(target).Coordinates, 1f, 3000f, TimeSpan.FromSeconds(3));
|
||||
}
|
||||
comp.Uses -= 1;
|
||||
|
||||
comp.Uses--;
|
||||
if (comp.Uses <= 0)
|
||||
{
|
||||
RemComp<ElectricalTouchEnchantComponent>(uid);
|
||||
@@ -389,7 +371,7 @@ public sealed partial class VeilCultSystem
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void StunOnMeleeHit(EntityUid uid, StunEnchantComponent comp, MeleeHitEvent args)
|
||||
{
|
||||
if (args.HitEntities.Count > 0)
|
||||
@@ -398,6 +380,7 @@ public sealed partial class VeilCultSystem
|
||||
{
|
||||
if (HasComp<StaminaComponent>(target))
|
||||
_stun.TryUpdateParalyzeDuration(target, comp.StunTime);
|
||||
|
||||
if (comp.Mute)
|
||||
{
|
||||
if (HasComp<MutedComponent>(target))
|
||||
@@ -405,38 +388,40 @@ public sealed partial class VeilCultSystem
|
||||
EnsureComp<MutedComponent>(target);
|
||||
Timer.Spawn(comp.MuteTime, () => RemComp<MutedComponent>(target));
|
||||
}
|
||||
|
||||
if (comp.EmpBorgs && HasComp<BorgChassisComponent>(target) || HasComp<AndroidComponent>(target))
|
||||
_emp.EmpPulse(Transform(target).Coordinates, 1f, 75000f, TimeSpan.FromSeconds(8));
|
||||
}
|
||||
RemComp<StunEnchantComponent>(uid);
|
||||
RemComp<EnchantedComponent>(uid);
|
||||
|
||||
RemComp<StunEnchantComponent>(uid);
|
||||
RemComp<EnchantedComponent>(uid);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void TerraformOnMeleeHit(EntityUid uid, TerraformEnchantComponent comp, MeleeHitEvent args)
|
||||
{
|
||||
if (args.Direction != null || args.HitEntities == null)
|
||||
return;
|
||||
|
||||
|
||||
foreach (var target in args.HitEntities)
|
||||
{
|
||||
if (MetaData(target).EntityPrototype?.ID == "WallSolid")
|
||||
{
|
||||
Spawn("SolidSecretDoor", Transform(target).Coordinates);
|
||||
QueueDel(target);
|
||||
|
||||
RemComp<EnchantedComponent>(uid);
|
||||
RemComp<TerraformEnchantComponent>(uid);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void ForcePassageOnMeleeHit(EntityUid uid, ForcePassageEnchantComponent comp, MeleeHitEvent args)
|
||||
{
|
||||
if (args.Direction != null || args.HitEntities == null)
|
||||
return;
|
||||
|
||||
|
||||
foreach (var target in args.HitEntities)
|
||||
{
|
||||
if (HasComp<DoorComponent>(target))
|
||||
@@ -450,7 +435,7 @@ public sealed partial class VeilCultSystem
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void BloodshedOnMeleeHit(EntityUid uid, BloodshedEnchantComponent comp, MeleeHitEvent args)
|
||||
{
|
||||
if (args.HitEntities != null)
|
||||
@@ -460,15 +445,15 @@ public sealed partial class VeilCultSystem
|
||||
_blood.TryBleedOut(target, 100);
|
||||
_surgery.TryAddInternalDamage(target, "ArterialBleeding");
|
||||
}
|
||||
|
||||
RemComp<BloodshedEnchantComponent>(uid);
|
||||
RemComp<EnchantedComponent>(uid);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void OnReflectionHitscan(EntityUid uid, ReflectionEnchantComponent comp, HitScanReflectAttemptEvent args)
|
||||
{
|
||||
|
||||
comp.Uses -= 1;
|
||||
comp.Uses--;
|
||||
if (comp.Uses <= 0)
|
||||
{
|
||||
RemComp<EnchantedComponent>(uid);
|
||||
@@ -476,11 +461,10 @@ public sealed partial class VeilCultSystem
|
||||
RemComp<ReflectComponent>(uid);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void OnReflectionProjecile(EntityUid uid, ReflectionEnchantComponent comp, ProjectileReflectAttemptEvent args)
|
||||
{
|
||||
|
||||
comp.Uses -= 1;
|
||||
comp.Uses--;
|
||||
if (comp.Uses <= 0)
|
||||
{
|
||||
RemComp<EnchantedComponent>(uid);
|
||||
@@ -488,31 +472,35 @@ public sealed partial class VeilCultSystem
|
||||
RemComp<ReflectComponent>(uid);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void ReconstructionOnUseInHand(EntityUid uid, ReconstructionEnchantComponent comp, UseInHandEvent args)
|
||||
{
|
||||
var damage = new DamageSpecifier { DamageDict = { { "Blunt", -30 }, { "Slash", -30 }, { "Piercing", -40 }, { "Heat", -40 } } };
|
||||
var nearbyCultists = _entityLookup.GetEntitiesInRange<VeilCultistComponent>(Transform(uid).Coordinates, 3f);
|
||||
var nearbyCultists = _entityLookup.GetEntitiesInRange<VeilCultistComponent>(Transform(uid).Coordinates, comp.Radius);
|
||||
foreach (var cultist in nearbyCultists)
|
||||
{
|
||||
_damage.TryChangeDamage(cultist.Owner, damage, true);
|
||||
if (TryComp<BloodstreamComponent>(cultist.Owner, out var bloodstream))
|
||||
_blood.TryModifyBleedAmount((cultist.Owner, bloodstream), -5f);
|
||||
}
|
||||
var nearbyConstruct = _entityLookup.GetEntitiesInRange<VeilCultConstructComponent>(Transform(uid).Coordinates, 3f);
|
||||
|
||||
var nearbyConstruct = _entityLookup.GetEntitiesInRange<VeilCultConstructComponent>(Transform(uid).Coordinates, comp.Radius);
|
||||
foreach (var construct in nearbyConstruct)
|
||||
{
|
||||
_damage.TryChangeDamage(construct.Owner, damage, true);
|
||||
if (TryComp<BloodstreamComponent>(construct.Owner, out var bloodstream))
|
||||
_blood.TryModifyBleedAmount((construct.Owner, bloodstream), -5f);
|
||||
}
|
||||
var nearbyWalls = _entityLookup.GetEntitiesInRange<OccluderComponent>(Transform(uid).Coordinates, 4f)
|
||||
|
||||
var nearbyWalls = _entityLookup.GetEntitiesInRange<OccluderComponent>(Transform(uid).Coordinates, comp.Radius)
|
||||
.Where(target => _tag.HasTag(target.Owner, WallTag))
|
||||
.ToList();
|
||||
|
||||
foreach (var wall in nearbyWalls)
|
||||
{
|
||||
if (!_random.Prob(0.7f))
|
||||
{
|
||||
if (!_random.Prob(0.7f))
|
||||
continue;
|
||||
|
||||
var delay = TimeSpan.FromSeconds(_random.NextFloat(0.1f, 1f));
|
||||
Timer.Spawn(delay, () =>
|
||||
{
|
||||
@@ -524,7 +512,7 @@ public sealed partial class VeilCultSystem
|
||||
QueueDel(wall.Owner);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
var cultistPos = _transform.GetWorldPosition(args.User);
|
||||
var tileDef = (ContentTileDefinition)_tileDefinitionManager["FloorBrassFilled"];
|
||||
var gridUid = _transform.GetGrid(args.User);
|
||||
@@ -537,22 +525,23 @@ public sealed partial class VeilCultSystem
|
||||
{
|
||||
if (!_random.Prob(0.5f))
|
||||
continue;
|
||||
|
||||
|
||||
var delay = TimeSpan.FromSeconds(_random.NextFloat(0.1f, 1f));
|
||||
Timer.Spawn(delay, () => _tile.ReplaceTile(tile, tileDef));
|
||||
}
|
||||
}
|
||||
|
||||
_audio.PlayPvs(CultSpell, args.User);
|
||||
QueueDel(uid);
|
||||
}
|
||||
|
||||
|
||||
private void EmpOnUseInHand(EntityUid uid, EmpEnchantComponent comp, UseInHandEvent args)
|
||||
{
|
||||
_emp.EmpPulse(Transform(uid).Coordinates, comp.RadiusWeak, 2500f, TimeSpan.FromSeconds(3));
|
||||
_emp.EmpPulse(Transform(uid).Coordinates, comp.RadiusStrong, 75000f, TimeSpan.FromSeconds(8));
|
||||
QueueDel(uid);
|
||||
}
|
||||
|
||||
|
||||
private void TimeStopOnUseInHand(EntityUid uid, TimeStopEnchantComponent comp, UseInHandEvent args)
|
||||
{
|
||||
var nearbyCultists = _entityLookup.GetEntitiesInRange<VeilCultistComponent>(Transform(uid).Coordinates, 5f);
|
||||
@@ -561,20 +550,21 @@ public sealed partial class VeilCultSystem
|
||||
EnsureComp<PacifiedComponent>(cultist);
|
||||
Timer.Spawn(TimeSpan.FromSeconds(3), () => RemComp<PacifiedComponent>(cultist));
|
||||
}
|
||||
|
||||
|
||||
Spawn("Chronofield", Transform(args.User).Coordinates);
|
||||
var nearbyTargets = _entityLookup.GetEntitiesInRange<MobStateComponent>(Transform(uid).Coordinates, 2.5f)
|
||||
.Where(target => !HasComp<VeilCultistComponent>(target.Owner))
|
||||
.Where(target => !HasComp<VeilCultConstructComponent>(target.Owner))
|
||||
.Where(target => !HasComp<VeilCultistComponent>(target.Owner) && !HasComp<VeilCultConstructComponent>(target.Owner))
|
||||
.ToList();
|
||||
|
||||
foreach (var target in nearbyTargets)
|
||||
{
|
||||
EnsureComp<AdminFrozenComponent>(target);
|
||||
Timer.Spawn(TimeSpan.FromSeconds(5), () => RemComp<AdminFrozenComponent>(target));
|
||||
Timer.Spawn(comp.Time, () => RemComp<AdminFrozenComponent>(target));
|
||||
}
|
||||
|
||||
QueueDel(uid);
|
||||
}
|
||||
|
||||
|
||||
private void HidingCloacksOnUseInHand(EntityUid uid, HidingsClockEnchantComponent comp, UseInHandEvent args)
|
||||
{
|
||||
var structures = _entityLookup.GetEntitiesInRange<VeilCultStructureComponent>(Transform(uid).Coordinates, comp.Radius);
|
||||
@@ -586,41 +576,43 @@ public sealed partial class VeilCultSystem
|
||||
{
|
||||
var entity = new Entity<VisibilityComponent?>(structure.Owner, vis);
|
||||
if (cultStructure.IsActive)
|
||||
_visibility.SetLayer(entity, 6);
|
||||
_visibility.SetLayer(entity, 7);
|
||||
else
|
||||
_visibility.SetLayer(entity, 1);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
var newVisibilityComp = AddComp<VisibilityComponent>(structure.Owner);
|
||||
var entity = new Entity<VisibilityComponent?>(structure.Owner, newVisibilityComp);
|
||||
if (cultStructure.IsActive)
|
||||
_visibility.SetLayer(entity, 6);
|
||||
_visibility.SetLayer(entity, 7);
|
||||
else
|
||||
_visibility.SetLayer(entity, 1);
|
||||
}
|
||||
cultStructure.IsActive = !cultStructure.IsActive;
|
||||
}
|
||||
}
|
||||
comp.Uses -= 1;
|
||||
|
||||
comp.Uses--;
|
||||
if (comp.Uses <= 0)
|
||||
{
|
||||
RemComp<HidingsClockEnchantComponent>(uid);
|
||||
RemComp<EnchantedComponent>(uid);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void SealWoundOnUse(EntityUid uid, SealWoundsEnchantComponent comp, AfterInteractEvent args)
|
||||
{
|
||||
if (args.Target != null && HasComp<VeilCultistComponent>(args.Target.Value))
|
||||
{
|
||||
var damage = new DamageSpecifier { DamageDict = { { "Blunt", -15 }, { "Slash", -15 }, { "Piercing", -20 }, { "Heat", -30 } } };
|
||||
_damage.TryChangeDamage(args.Target.Value, damage, true);
|
||||
|
||||
if (TryComp<BloodstreamComponent>(args.Target.Value, out var bloodstream))
|
||||
_blood.TryModifyBleedAmount((args.Target.Value, bloodstream), -5f);
|
||||
|
||||
RemComp<EnchantedComponent>(args.Used);
|
||||
RemComp<SealWoundsEnchantComponent>(args.Used);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,63 +1,39 @@
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using Content.Server.Audio;
|
||||
using Content.Server.GameTicking.Rules;
|
||||
using Content.Server.RoundEnd;
|
||||
using Content.Server.Pinpointer;
|
||||
using Content.Server.Bible.Components;
|
||||
using Content.Server.Roles;
|
||||
using Content.Shared.Actions;
|
||||
using Content.Shared.Blood.Cult;
|
||||
using Content.Shared.Veil.Cult;
|
||||
using Content.Shared.Veil.Cult.UI;
|
||||
using Content.Shared.Veil.Cult.Components;
|
||||
using Content.Shared.Blood.Cult.Components;
|
||||
using Content.Shared.Body;
|
||||
using Content.Shared.Body.Components;
|
||||
using Content.Shared.Chemistry.EntitySystems;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using Content.Shared.Containers.ItemSlots;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.DoAfter;
|
||||
using Content.Shared.EnergyShield;
|
||||
using Content.Shared.Examine;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Content.Shared.Hands.EntitySystems;
|
||||
using Content.Shared.IdentityManagement;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Interaction.Components;
|
||||
using Content.Shared.Interaction.Events;
|
||||
using Content.Shared.Inventory.Events;
|
||||
using Content.Shared.Inventory;
|
||||
using Content.Shared.Mind;
|
||||
using Content.Shared.Mind.Components;
|
||||
using Content.Shared.Mobs.Systems;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.Standing;
|
||||
using Content.Shared.Weapons.Melee;
|
||||
using Content.Shared.Weapons.Melee.Events;
|
||||
using Content.Shared.Weapons.Ranged.Events;
|
||||
using Content.Shared.PowerCell;
|
||||
using Content.Shared.Power.EntitySystems;
|
||||
using Content.Shared.Power.Components;
|
||||
using Content.Shared.Humanoid;
|
||||
using Content.Shared.Administration.Systems;
|
||||
using Content.Shared.Construction.Components;
|
||||
using Content.Shared.Construction.EntitySystems;
|
||||
using Content.Shared.Gibbing;
|
||||
using Content.Shared.Mindshield.Components;
|
||||
using Content.Shared.NullRod.Components;
|
||||
using Content.Shared.Lathe;
|
||||
using Content.Shared.Roles;
|
||||
using Content.Shared.Mobs;
|
||||
using Content.Shared.Silicons.Borgs.Components;
|
||||
using Robust.Server.Audio;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Random;
|
||||
using Robust.Shared.Timing;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Spawners;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
@@ -81,25 +57,24 @@ public sealed partial class VeilCultSystem : SharedVeilCultSystem
|
||||
[Dependency] private readonly RejuvenateSystem _rejuvenate = default!;
|
||||
[Dependency] private readonly NavMapSystem _navMap = default!;
|
||||
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
InitializeVeilAbilities();
|
||||
InitializeEnchantments();
|
||||
|
||||
|
||||
SubscribeLocalEvent<VeilCultistComponent, ShotAttemptedEvent>(OnShotAttempted);
|
||||
SubscribeLocalEvent<VeilCultistHandsComponent, ExaminedEvent>(OnCultistHandsExamined);
|
||||
SubscribeLocalEvent<VeilCultBeaconComponent, ComponentInit>(OnInit);
|
||||
|
||||
|
||||
SubscribeLocalEvent<VeilCultAltarComponent, VeilAltarSelectEnergyMessage>(OnSelectEnergy);
|
||||
SubscribeLocalEvent<VeilCultAltarComponent, VeilAltarSelectOfferMessage>(OnSelectOffer);
|
||||
SubscribeLocalEvent<VeilCultAltarComponent, ActivateInWorldEvent>(UseVeilAltar);
|
||||
SubscribeLocalEvent<VeilCultLatheComponent, ActivateInWorldEvent>(UseVeilLathe);
|
||||
|
||||
|
||||
SubscribeLocalEvent<VeilCultBeaconComponent, AnchorAttemptEvent>(OnAnchor);
|
||||
|
||||
|
||||
SubscribeLocalEvent<VeilCultistComponent, StrangeShardDoAfterEvent>(DoAfterInteractShardCultist);
|
||||
SubscribeLocalEvent<VeilCultAltarComponent, StrangeShardDoAfterEvent>(DoAfterInteractShardAltar);
|
||||
SubscribeLocalEvent<VeilCultConstructComponent, MobStateChangedEvent>(OnConstructMobStateChange);
|
||||
@@ -110,17 +85,17 @@ public sealed partial class VeilCultSystem : SharedVeilCultSystem
|
||||
{
|
||||
base.Update(frameTime);
|
||||
|
||||
var beaconQuery = EntityQueryEnumerator<VeilCultBeaconComponent>();
|
||||
while (beaconQuery.MoveNext(out var beacon, out var beaconQueryComponent))
|
||||
var beaconQuery = EntityQueryEnumerator<VeilCultBeaconComponent, TransformComponent>();
|
||||
while (beaconQuery.MoveNext(out var beacon, out var beaconComponent, out var transform))
|
||||
{
|
||||
if (beaconQueryComponent.NextTimeTick <= 0 && Transform(beacon).Anchored)
|
||||
if (beaconComponent.NextTimeTick <= 0 && transform.Anchored)
|
||||
{
|
||||
beaconQueryComponent.NextTimeTick = 5;
|
||||
var nearbyCultists = _entityLookup.GetEntitiesInRange<VeilCultistComponent>(Transform(beacon).Coordinates, 11f)
|
||||
beaconComponent.NextTimeTick = 5;
|
||||
var nearbyCultists = _entityLookup.GetEntitiesInRange<VeilCultistComponent>(transform.Coordinates, 11f)
|
||||
.Where(cultist => !_mobState.IsDead(cultist))
|
||||
.ToList();
|
||||
|
||||
var nearbyConstruct = _entityLookup.GetEntitiesInRange<VeilCultConstructComponent>(Transform(beacon).Coordinates, 11f)
|
||||
var nearbyConstruct = _entityLookup.GetEntitiesInRange<VeilCultConstructComponent>(transform.Coordinates, 11f)
|
||||
.Where(cultist => !_mobState.IsDead(cultist))
|
||||
.ToList();
|
||||
|
||||
@@ -142,43 +117,43 @@ public sealed partial class VeilCultSystem : SharedVeilCultSystem
|
||||
_blood.TryModifyBloodLevel(target.Owner, +5);
|
||||
if (TryComp<BloodstreamComponent>(target.Owner, out var bloodstream))
|
||||
_blood.TryModifyBleedAmount((target.Owner, bloodstream), -3f);
|
||||
|
||||
|
||||
if (TryComp<TimedDespawnComponent>(target, out var despawn))
|
||||
despawn.Lifetime += 25;
|
||||
}
|
||||
|
||||
|
||||
var cult = _veilCult.GetActiveRule();
|
||||
if (cult != null && cult.Station != null && Transform(beacon).GridUid == cult.Station.Value)
|
||||
{
|
||||
cult.EnergyCount += 25;
|
||||
}
|
||||
}
|
||||
|
||||
beaconQueryComponent.NextTimeTick -= frameTime;
|
||||
}
|
||||
|
||||
|
||||
beaconComponent.NextTimeTick -= frameTime;
|
||||
}
|
||||
|
||||
var cogQuery = EntityQueryEnumerator<InteractionCogInfectedComponent>();
|
||||
while (cogQuery.MoveNext(out var cog, out var cogQueryComponent))
|
||||
while (cogQuery.MoveNext(out var cog, out var cogComponent))
|
||||
{
|
||||
if (cogQueryComponent.NextTimeTick <= 0)
|
||||
if (cogComponent.NextTimeTick <= 0)
|
||||
{
|
||||
cogQueryComponent.NextTimeTick = 5;
|
||||
cogComponent.NextTimeTick = 5;
|
||||
if (TryComp<BatteryComponent>(cog, out var battery))
|
||||
{
|
||||
if (_battery.TryUseCharge((cog, battery), cogQueryComponent.PowerRate))
|
||||
if (_battery.TryUseCharge((cog, battery), cogComponent.PowerRate))
|
||||
{
|
||||
var cult = _veilCult.GetActiveRule();
|
||||
if (cult != null)
|
||||
{
|
||||
cult.EnergyCount += 10;
|
||||
}
|
||||
_audio.PlayPvs(_audio.ResolveSound(cogQueryComponent.Sound), cog);
|
||||
_audio.PlayPvs(_audio.ResolveSound(cogComponent.Sound), cog);
|
||||
}
|
||||
}
|
||||
}
|
||||
cogQueryComponent.NextTimeTick -= frameTime;
|
||||
|
||||
cogComponent.NextTimeTick -= frameTime;
|
||||
}
|
||||
|
||||
|
||||
var ritualQuery = EntityQueryEnumerator<VeilCultPortalComponent>();
|
||||
while (ritualQuery.MoveNext(out var portal, out var comp))
|
||||
@@ -186,13 +161,13 @@ public sealed partial class VeilCultSystem : SharedVeilCultSystem
|
||||
if (!comp.SoundPlayed && comp.NextTimeTick > 90)
|
||||
{
|
||||
_sound.PlayGlobalOnStation(portal, _audio.ResolveSound(comp.RitualMusic));
|
||||
comp.SoundPlayed = true;
|
||||
comp.SoundPlayed = true;
|
||||
}
|
||||
|
||||
comp.NextTimeTick += frameTime;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void OnShotAttempted(Entity<VeilCultistComponent> ent, ref ShotAttemptedEvent args)
|
||||
{
|
||||
if (HasComp<CultAllowedGunComponent>(args.Used))
|
||||
@@ -227,10 +202,9 @@ public sealed partial class VeilCultSystem : SharedVeilCultSystem
|
||||
args.PushMarkup(Loc.GetString("veil-cultist-hands-glow-examined"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void OnInit(EntityUid uid, VeilCultBeaconComponent component, ComponentInit args)
|
||||
{
|
||||
|
||||
var beacons = _entityLookup.GetEntitiesInRange<VeilCultBeaconComponent>(
|
||||
Transform(uid).Coordinates, 20f);
|
||||
|
||||
@@ -240,39 +214,29 @@ public sealed partial class VeilCultSystem : SharedVeilCultSystem
|
||||
Spawn("SheetChargedBrass6", Transform(uid).Coordinates);
|
||||
QueueDel(uid);
|
||||
}
|
||||
|
||||
|
||||
component.AssignedName = Loc.GetString("veil-cult-unknown-beacon");
|
||||
}
|
||||
|
||||
|
||||
private void UseVeilAltar(EntityUid uid, VeilCultAltarComponent component, ActivateInWorldEvent args)
|
||||
{
|
||||
if (args.Handled)
|
||||
return;
|
||||
|
||||
|
||||
if (!HasComp<VeilCultistComponent>(args.User) && !HasComp<VeilCultConstructComponent>(args.User))
|
||||
return;
|
||||
|
||||
OpenAltarSelectionUI(uid, component, args.User);
|
||||
_ui.OpenUi(uid, VeilAltarUiKey.Key, args.User);
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
private void OpenAltarSelectionUI(EntityUid altar, VeilCultAltarComponent component, EntityUid user)
|
||||
{
|
||||
var state = new VeilAltarState(
|
||||
GetNetEntity(user),
|
||||
GetNetEntity(altar));
|
||||
|
||||
_ui.OpenUi(altar, VeilAltarUiKey.Key, user);
|
||||
|
||||
}
|
||||
|
||||
private void OnSelectOffer(EntityUid uid, VeilCultAltarComponent component, VeilAltarSelectOfferMessage args)
|
||||
{
|
||||
var cult = _veilCult.GetActiveRule();
|
||||
if (cult == null)
|
||||
return;
|
||||
|
||||
_audio.PlayPvs(_audio.ResolveSound(component.Sound), uid);
|
||||
return;
|
||||
|
||||
_audio.PlayPvs(component.Sound, uid);
|
||||
Timer.Spawn(TimeSpan.FromSeconds(2), () =>
|
||||
{
|
||||
var targets = _entityLookup.GetEntitiesInRange<HumanoidProfileComponent>(Transform(uid).Coordinates, 1f);
|
||||
@@ -281,7 +245,7 @@ public sealed partial class VeilCultSystem : SharedVeilCultSystem
|
||||
if (HasComp<VeilCultistComponent>(target) || HasComp<VeilCultConstructComponent>(target) ||
|
||||
HasComp<NullRodOwnerComponent>(target))
|
||||
continue;
|
||||
|
||||
|
||||
if (HasComp<MindShieldComponent>(target) || HasComp<BibleUserComponent>(target) || HasComp<BloodCultistComponent>(target))
|
||||
{
|
||||
if (_mobState.IsDead(target))
|
||||
@@ -292,86 +256,90 @@ public sealed partial class VeilCultSystem : SharedVeilCultSystem
|
||||
_mind.TransferTo(mindContainer.Mind.Value, soulStone);
|
||||
EnsureComp<AbsorbedByVeilComponent>(target);
|
||||
}
|
||||
else
|
||||
continue;
|
||||
else continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (HasComp<MindShieldComponent>(target) || HasComp<BibleUserComponent>(target))
|
||||
continue;
|
||||
|
||||
if (!TryComp<MindContainerComponent>(target, out var mindContainer) || mindContainer.Mind == null)
|
||||
continue;
|
||||
|
||||
|
||||
EnsureComp<AutoVeilCultistComponent>(target);
|
||||
_rejuvenate.PerformRejuvenate(target);
|
||||
EnsureComp<AbsorbedByVeilComponent>(target);
|
||||
}
|
||||
|
||||
|
||||
if (!HasComp<AbsorbedByVeilComponent>(target))
|
||||
cult.EnergyCount += 100;
|
||||
|
||||
break;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void OnSelectEnergy(EntityUid uid, VeilCultAltarComponent component, VeilAltarSelectEnergyMessage args)
|
||||
{
|
||||
var cult = _veilCult.GetActiveRule();
|
||||
if (cult != null)
|
||||
_popup.PopupEntity(Loc.GetString("veil-cult-energy-amount", ("energy", cult.EnergyCount)), uid, PopupType.Medium);
|
||||
}
|
||||
|
||||
|
||||
private void UseVeilLathe(EntityUid uid, VeilCultLatheComponent component, ActivateInWorldEvent args)
|
||||
{
|
||||
if (args.Handled)
|
||||
return;
|
||||
|
||||
|
||||
if (!HasComp<VeilCultistComponent>(args.User) && !HasComp<VeilCultConstructComponent>(args.User))
|
||||
return;
|
||||
|
||||
_ui.OpenUi(uid, LatheUiKey.Key, args.User);
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
|
||||
private void DoAfterInteractShardAltar(EntityUid uid, VeilCultAltarComponent component, StrangeShardDoAfterEvent args)
|
||||
{
|
||||
if (args.Cancelled)
|
||||
return;
|
||||
|
||||
|
||||
var cult = _veilCult.GetActiveRule();
|
||||
if (cult == null || args.Target == null)
|
||||
return;
|
||||
|
||||
|
||||
if (cult.RitualGoing)
|
||||
{
|
||||
_popup.PopupEntity(Loc.GetString("veil-cult-ritual-going"), uid, PopupType.Medium);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!cult.SecondTriggered)
|
||||
{
|
||||
_popup.PopupEntity(Loc.GetString("veil-cult-too-weak"), uid, PopupType.Medium);
|
||||
return;
|
||||
}
|
||||
|
||||
var walls = _entityLookup.GetEntitiesInRange(uid, 3f, LookupFlags.Static);
|
||||
if (walls.Count > 1)
|
||||
{
|
||||
_popup.PopupEntity(Loc.GetString("veil-cult-walls"), uid, PopupType.Medium);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_veilCult.TryUseEnergy(500))
|
||||
{
|
||||
_popup.PopupEntity(Loc.GetString("veil-cult-not-enough-energy"), uid, PopupType.Medium);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
AnnounceRitualActivation(uid);
|
||||
var portal = Spawn("VeilCultPortal", Transform(uid).Coordinates);
|
||||
Timer.Spawn(TimeSpan.FromSeconds(180), () => CompleteRitual(portal));
|
||||
QueueDel(args.Target.Value);
|
||||
cult.RitualGoing = true;
|
||||
}
|
||||
|
||||
|
||||
private void AnnounceRitualActivation(EntityUid uid)
|
||||
{
|
||||
var xform = Transform(uid);
|
||||
@@ -386,8 +354,7 @@ public sealed partial class VeilCultSystem : SharedVeilCultSystem
|
||||
{
|
||||
NotifyRitualFailed();
|
||||
var cult = _veilCult.GetActiveRule();
|
||||
if (cult != null)
|
||||
cult.RitualGoing = false;
|
||||
if (cult != null) cult.RitualGoing = false;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -406,42 +373,40 @@ public sealed partial class VeilCultSystem : SharedVeilCultSystem
|
||||
private void SpawnGod(EntityUid uid)
|
||||
{
|
||||
Spawn("MobRatvarSpawn", Transform(uid).Coordinates);
|
||||
RaiseLocalEvent(new GodCalledEvent());
|
||||
RaiseLocalEvent(new VeilGodCalledEvent());
|
||||
}
|
||||
|
||||
|
||||
private void DoAfterInteractShardCultist(EntityUid uid, VeilCultistComponent component, StrangeShardDoAfterEvent args)
|
||||
{
|
||||
if (args.Cancelled)
|
||||
return;
|
||||
|
||||
|
||||
if (!HasComp<VeilCultistComponent>(uid) || !HasComp<HumanoidProfileComponent>(uid) ||
|
||||
!_mobState.IsDead(uid))
|
||||
return;
|
||||
|
||||
|
||||
if (args.Target != null)
|
||||
{
|
||||
_rejuvenate.PerformRejuvenate(uid);
|
||||
QueueDel(args.Target.Value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void OnSoulVesselInserted(EntityUid uid, SoulVesselComponent comp, AfterInteractEvent args)
|
||||
{
|
||||
{
|
||||
if (_mind.TryGetMind(uid, out var mindId, out var mindComp))
|
||||
{
|
||||
if (args.Target is { } target && TryComp<MindContainerComponent>(target, out var mindContainer) && !mindContainer.HasMind)
|
||||
{
|
||||
if (HasComp<CogscarabComponent>(target) || HasComp<BorgChassisComponent>(target))
|
||||
return;
|
||||
|
||||
|
||||
_mind.TransferTo(mindId, target, ghostCheckOverride: true, createGhost: true, mind: mindComp);
|
||||
QueueDel(uid);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void OnConstructMobStateChange(EntityUid uid, VeilCultConstructComponent comp, MobStateChangedEvent args)
|
||||
{
|
||||
if (_mobState.IsDead(uid) && !HasComp<CogscarabComponent>(uid))
|
||||
|
||||
@@ -7,11 +7,11 @@ using Robust.Shared.Serialization;
|
||||
namespace Content.Shared.Blood.Cult;
|
||||
|
||||
// Events
|
||||
public sealed class GodCalledEvent : EntityEventArgs
|
||||
public sealed class BloodGodCalledEvent : EntityEventArgs
|
||||
{
|
||||
}
|
||||
|
||||
public sealed class RitualConductedEvent : EntityEventArgs
|
||||
public sealed class BloodRitualConductedEvent : EntityEventArgs
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -1,19 +1,15 @@
|
||||
using Content.Shared.Veil.Cult.Components;
|
||||
using Content.Shared.Timing;
|
||||
using Content.Shared.UserInterface;
|
||||
using Content.Shared.DoAfter;
|
||||
|
||||
namespace Content.Shared.Veil.Cult;
|
||||
|
||||
public abstract partial class SharedTeleportationEnchantSystem : EntitySystem
|
||||
{
|
||||
{
|
||||
[Dependency] private readonly SharedUserInterfaceSystem _ui = default!;
|
||||
[Dependency] private readonly SharedDoAfterSystem _doAfterSystem = default!;
|
||||
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
||||
|
||||
|
||||
protected const string TeleportDelay = "TeleportDelay";
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
@@ -22,46 +18,40 @@ public abstract partial class SharedTeleportationEnchantSystem : EntitySystem
|
||||
SubscribeLocalEvent<VeilCultistComponent, VeilCultTeleportDoAfterEvent>(OnTeleportSuccess);
|
||||
}
|
||||
|
||||
protected virtual void OnTeleportToLocationRequest(Entity<TeleportationEnchantComponent> ent, ref TeleportEnchantDestinationMessage args)
|
||||
private void OnTeleportToLocationRequest(Entity<TeleportationEnchantComponent> ent, ref TeleportEnchantDestinationMessage args)
|
||||
{
|
||||
if (!TryGetEntity(args.NetEnt, out var telePointEnt) || TerminatingOrDeleted(telePointEnt) || !HasComp<VeilCultBeaconComponent>(telePointEnt))
|
||||
return;
|
||||
|
||||
Teleport(args.Actor, args.NetEnt, ent.Owner);
|
||||
|
||||
if (TryComp<UserInterfaceComponent>(ent.Owner, out var ui))
|
||||
_ui.CloseUi((ent.Owner, ui), TeleportEnchantUiKey.Key);
|
||||
|
||||
_ui.CloseUis(ent.Owner);
|
||||
}
|
||||
|
||||
|
||||
private void Teleport(EntityUid user, NetEntity beacon, EntityUid used)
|
||||
{
|
||||
var doAfterEventArgs = new DoAfterArgs(EntityManager, user, TimeSpan.FromSeconds(4),
|
||||
new VeilCultTeleportDoAfterEvent() { Beacon = beacon },
|
||||
eventTarget: user,
|
||||
used: used
|
||||
)
|
||||
new VeilCultTeleportDoAfterEvent(beacon), user, used)
|
||||
{
|
||||
BreakOnMove = false,
|
||||
BreakOnDamage = true,
|
||||
NeedHand = false
|
||||
};
|
||||
|
||||
_doAfterSystem.TryStartDoAfter(doAfterEventArgs);
|
||||
_doAfterSystem.TryStartDoAfter(doAfterEventArgs);
|
||||
}
|
||||
|
||||
|
||||
private void OnTeleportSuccess(EntityUid uid, VeilCultistComponent comp, VeilCultTeleportDoAfterEvent args)
|
||||
{
|
||||
{
|
||||
if (args.Used == null || args.Cancelled || args.Handled)
|
||||
return;
|
||||
|
||||
|
||||
var beacon = GetEntity(args.Beacon);
|
||||
Spawn("BloodCultOutEffect", Transform(uid).Coordinates);
|
||||
_transform.SetCoordinates(uid, Transform(beacon).Coordinates);
|
||||
|
||||
|
||||
RemComp<EnchantedComponent>(args.Used.Value);
|
||||
RemComp<TeleportationEnchantComponent>(args.Used.Value);
|
||||
RemComp<ActivatableUIComponent>(args.Used.Value);
|
||||
args.Handled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,26 +1,17 @@
|
||||
using Content.Shared.Administration.Logs;
|
||||
using Content.Shared.Database;
|
||||
using Content.Shared.Examine;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Veil.Cult.Components;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.Verbs;
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Network;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Shared.Veil.Cult;
|
||||
|
||||
public abstract class SharedVeilBeaconSystem : EntitySystem
|
||||
public sealed class VeilBeaconSystem : EntitySystem
|
||||
{
|
||||
|
||||
[Dependency] protected readonly SharedUserInterfaceSystem UserInterfaceSystem = default!;
|
||||
[Dependency] private readonly SharedUserInterfaceSystem _ui = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
|
||||
// Bound UI subscriptions
|
||||
SubscribeLocalEvent<VeilCultBeaconComponent, VeilBeaconNameChangedMessage>(OnVeilBeaconNameChanged);
|
||||
SubscribeLocalEvent<VeilCultBeaconComponent, ComponentGetState>(OnGetState);
|
||||
@@ -29,22 +20,17 @@ public abstract class SharedVeilBeaconSystem : EntitySystem
|
||||
}
|
||||
|
||||
private void OnGetState(Entity<VeilCultBeaconComponent> ent, ref ComponentGetState args)
|
||||
{
|
||||
args.State = new VeilCultBeaconComponentState(ent.Comp.AssignedName)
|
||||
{
|
||||
MaxNameChars = ent.Comp.MaxNameChars,
|
||||
};
|
||||
}
|
||||
=> args.State = new VeilCultBeaconComponentState(ent.Comp.AssignedName, ent.Comp.MaxNameChars);
|
||||
|
||||
private void UseVeilBeacon(EntityUid uid, VeilCultBeaconComponent component, ActivateInWorldEvent args)
|
||||
{
|
||||
if (args.Handled)
|
||||
return;
|
||||
|
||||
|
||||
if (!HasComp<VeilCultistComponent>(args.User) && !HasComp<VeilCultConstructComponent>(args.User))
|
||||
return;
|
||||
|
||||
UserInterfaceSystem.OpenUi(uid, VeilBeaconUiKey.Key, args.User);
|
||||
_ui.OpenUi(uid, VeilBeaconUiKey.Key, args.User);
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
@@ -62,10 +48,6 @@ public abstract class SharedVeilBeaconSystem : EntitySystem
|
||||
UpdateUI(ent);
|
||||
}
|
||||
|
||||
protected virtual void UpdateUI(Entity<VeilCultBeaconComponent> ent)
|
||||
{
|
||||
}
|
||||
|
||||
private void OnVeilBeaconNameChanged(EntityUid uid, VeilCultBeaconComponent beacon, VeilBeaconNameChangedMessage args)
|
||||
{
|
||||
var name = args.Name.Trim();
|
||||
@@ -73,9 +55,19 @@ public abstract class SharedVeilBeaconSystem : EntitySystem
|
||||
beacon.AssignedName = name[..Math.Min(beacon.MaxNameChars, name.Length)];
|
||||
else
|
||||
beacon.AssignedName = Loc.GetString("veil-cult-unknown-beacon");
|
||||
UpdateUI((uid, beacon));
|
||||
Dirty(uid, beacon);
|
||||
|
||||
Dirty(uid, beacon);
|
||||
UpdateUI((uid, beacon));
|
||||
}
|
||||
|
||||
}
|
||||
private void UpdateUI(Entity<VeilCultBeaconComponent> ent)
|
||||
{
|
||||
if (_ui.HasUi(ent, VeilBeaconUiKey.Key))
|
||||
{
|
||||
var state = new VeilBeaconNameBoundUserInterfaceState(
|
||||
ent.Comp.AssignedName, ent.Comp.MaxNameChars);
|
||||
|
||||
_ui.SetUiState(ent.Owner, VeilBeaconUiKey.Key, state);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,15 +7,12 @@ using Content.Shared.IdentityManagement;
|
||||
using Content.Shared.Mind;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.Stunnable;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Interaction.Events;
|
||||
using Content.Shared.Hands.EntitySystems;
|
||||
using Content.Shared.DoAfter;
|
||||
using Content.Shared.Movement.Systems;
|
||||
using Content.Shared.Movement.Events;
|
||||
using Robust.Shared.Prototypes;
|
||||
using TimedDespawnComponent = Robust.Shared.Spawners.TimedDespawnComponent;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Spawners;
|
||||
|
||||
namespace Content.Shared.Veil.Cult;
|
||||
|
||||
@@ -25,7 +22,7 @@ public abstract class SharedVeilCultSystem : EntitySystem
|
||||
[Dependency] private readonly SharedPopupSystem _popup = default!;
|
||||
[Dependency] private readonly SharedStunSystem _stun = default!;
|
||||
[Dependency] private readonly SharedUserInterfaceSystem _ui = default!;
|
||||
[Dependency] private readonly SharedHandsSystem _hands = default!;
|
||||
[Dependency] private readonly SharedHandsSystem _hands = default!;
|
||||
[Dependency] private readonly IPrototypeManager _prototype = default!;
|
||||
[Dependency] private readonly SharedDoAfterSystem _doAfterSystem = default!;
|
||||
[Dependency] private readonly MovementSpeedModifierSystem _speed = default!;
|
||||
@@ -40,9 +37,7 @@ public abstract class SharedVeilCultSystem : EntitySystem
|
||||
SubscribeLocalEvent<ConfusionComponent, ComponentInit>(OnInit);
|
||||
SubscribeLocalEvent<ConfusionComponent, ComponentRemove>(OnShutdown);
|
||||
SubscribeLocalEvent<ConfusionComponent, RefreshMovementSpeedModifiersEvent>(Invert);
|
||||
|
||||
}
|
||||
|
||||
|
||||
#region Deconvertation
|
||||
public void CultistDeconvertation(EntityUid cultist)
|
||||
@@ -59,13 +54,10 @@ public abstract class SharedVeilCultSystem : EntitySystem
|
||||
|
||||
var protoId = meta.EntityPrototype?.ID;
|
||||
if (protoId == VeilCultistComponent.MidasTouch.Id)
|
||||
{
|
||||
_action.RemoveAction(cultist, actionId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (TryComp<MindLinkComponent>(cultist, out var mindLink))
|
||||
{
|
||||
mindLink.Channels.Remove(veilCultist.CultMindChannel);
|
||||
@@ -81,7 +73,7 @@ public abstract class SharedVeilCultSystem : EntitySystem
|
||||
RemComp<VeilCogDisplayComponent>(cultist);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
private void OnMidasTouch(EntityUid cultist, VeilCultistComponent component, VeilCultMidasTouchActionEvent args)
|
||||
{
|
||||
if (_hands.TryGetActiveItem(cultist, out var hand) && hand != null)
|
||||
@@ -97,15 +89,15 @@ public abstract class SharedVeilCultSystem : EntitySystem
|
||||
RaiseLocalEvent(cultist, ev);
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
var ev = new VeilCultMidasTouchGetHandEvent();
|
||||
RaiseLocalEvent(cultist, ev);
|
||||
}
|
||||
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
|
||||
private void TryEnchant(EntityUid uid, EnchantableComponent component, VeilCultMidasTouchActionEvent args)
|
||||
{
|
||||
if (args.Handled)
|
||||
@@ -117,12 +109,10 @@ public abstract class SharedVeilCultSystem : EntitySystem
|
||||
|
||||
private void OnEnchantSelected(EntityUid uid, EnchantableComponent component, EnchantSelectedMessage args)
|
||||
{
|
||||
var user = GetEntity(args.User);
|
||||
var user = args.Actor;
|
||||
var doAfterDelay = component.Delay;
|
||||
var doAfterEventArgs = new DoAfterArgs(EntityManager, user, doAfterDelay,
|
||||
new EnchantingDoAfterEvent() { Entity = args.EnchantId },
|
||||
eventTarget: uid,
|
||||
target: user)
|
||||
new EnchantingDoAfterEvent(args.EnchantId), uid, user)
|
||||
{
|
||||
BreakOnMove = true,
|
||||
BreakOnDamage = true,
|
||||
@@ -130,7 +120,7 @@ public abstract class SharedVeilCultSystem : EntitySystem
|
||||
NeedHand = false
|
||||
};
|
||||
|
||||
_doAfterSystem.TryStartDoAfter(doAfterEventArgs);
|
||||
_doAfterSystem.TryStartDoAfter(doAfterEventArgs);
|
||||
}
|
||||
|
||||
private void OpenEnchantSelectionUI(EntityUid card, EnchantableComponent component, EntityUid user)
|
||||
@@ -151,11 +141,10 @@ public abstract class SharedVeilCultSystem : EntitySystem
|
||||
_ui.SetUiState(card, EnchantUiKey.Key, state);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void OnPlayerAttached(EntityUid uid, CogscarabComponent component, PlayerAttachedEvent args)
|
||||
{
|
||||
EnsureComp<TimedDespawnComponent>(uid, out var despawn);
|
||||
despawn.Lifetime = 15f;
|
||||
EnsureComp<TimedDespawnComponent>(uid).Lifetime = 15f;
|
||||
RemComp<CogscarabComponent>(uid);
|
||||
}
|
||||
|
||||
@@ -173,5 +162,4 @@ public abstract class SharedVeilCultSystem : EntitySystem
|
||||
{
|
||||
args.ModifySpeed(-1f, -1f);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
using Content.Shared.Veil.Cult.Components;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
@@ -18,12 +17,10 @@ public sealed class EnchantSelectionState : BoundUserInterfaceState
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class EnchantSelectedMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public readonly NetEntity User;
|
||||
public readonly EntProtoId EnchantId;
|
||||
|
||||
public EnchantSelectedMessage(NetEntity user, EntProtoId enchantId)
|
||||
public EnchantSelectedMessage(EntProtoId enchantId)
|
||||
{
|
||||
User = user;
|
||||
EnchantId = enchantId;
|
||||
}
|
||||
}
|
||||
@@ -32,4 +29,4 @@ public sealed class EnchantSelectedMessage : BoundUserInterfaceMessage
|
||||
public enum EnchantUiKey : byte
|
||||
{
|
||||
Key
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
using Content.Shared.Actions;
|
||||
using Content.Shared.DoAfter;
|
||||
using Content.Shared.Eui;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Veil.Cult.UI;
|
||||
@@ -16,34 +12,9 @@ public enum VeilAltarUiKey : byte
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class VeilAltarSelectEnergyMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public NetEntity User;
|
||||
|
||||
public VeilAltarSelectEnergyMessage(NetEntity user)
|
||||
{
|
||||
User = user;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class VeilAltarSelectOfferMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public NetEntity Altar;
|
||||
|
||||
public VeilAltarSelectOfferMessage(NetEntity altar)
|
||||
{
|
||||
Altar = altar;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class VeilAltarState : BoundUserInterfaceState
|
||||
{
|
||||
public readonly NetEntity User;
|
||||
public readonly NetEntity Altar;
|
||||
|
||||
public VeilAltarState(NetEntity user, NetEntity altar)
|
||||
{
|
||||
User = user;
|
||||
Altar = altar;
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@ using Content.Shared.Mind;
|
||||
using Content.Shared.StatusIcon;
|
||||
using Content.Shared.Teleportation.Components;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
@@ -11,39 +10,22 @@ namespace Content.Shared.Veil.Cult.Components;
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class VeilCultistComponent : Component
|
||||
{
|
||||
|
||||
public static readonly EntProtoId MidasTouch = "ActionMidasTouch";
|
||||
|
||||
[DataField("cultistStatusIcon")]
|
||||
[DataField]
|
||||
public ProtoId<FactionIconPrototype> StatusIcon { get; set; } = "VeilCultistFaction";
|
||||
|
||||
[DataField]
|
||||
public ProtoId<MindChannelPrototype> CultMindChannel { get; set; } = "MindVeilCult";
|
||||
}
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed partial class VeilRitualDimensionalRendingComponent : Component
|
||||
{
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField]
|
||||
public TimeSpan ActivateTime = TimeSpan.Zero;
|
||||
|
||||
public bool Activate = false;
|
||||
|
||||
public float NextTimeTick { get; set; }
|
||||
|
||||
[DataField("ritualMusic")]
|
||||
public SoundSpecifier RitualMusic = new SoundCollectionSpecifier("VeilCultMusic");
|
||||
|
||||
public bool SoundPlayed;
|
||||
}
|
||||
|
||||
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class VeilCultConstructComponent : Component;
|
||||
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class VeilCultAltarComponent : Component
|
||||
{
|
||||
[DataField("sound")]
|
||||
[DataField]
|
||||
public SoundSpecifier Sound = new SoundPathSpecifier("/Audio/_Wega/Effects/altar.ogg");
|
||||
}
|
||||
|
||||
@@ -74,34 +56,32 @@ public sealed partial class AutoVeilCultistComponent : Component;
|
||||
public sealed partial class InteractionCogInfectedComponent : Component
|
||||
{
|
||||
public float PowerRate = 25000f;
|
||||
|
||||
|
||||
[DataField("drainSound")]
|
||||
public SoundSpecifier Sound = new SoundPathSpecifier("/Audio/_Wega/Effects/interaction_cog_drain.ogg");
|
||||
|
||||
|
||||
public float NextTimeTick { get; set; } = 5;
|
||||
}
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed partial class EnchantableComponent : Component
|
||||
{
|
||||
[DataField("enchants", required: true)]
|
||||
[DataField(required: true)]
|
||||
public List<EntProtoId> Enchants = new();
|
||||
|
||||
[DataField("delay")]
|
||||
|
||||
[DataField]
|
||||
public TimeSpan Delay = TimeSpan.FromSeconds(5);
|
||||
|
||||
[DataField("cost")]
|
||||
|
||||
[DataField]
|
||||
public float Cost = 100f;
|
||||
|
||||
}
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed partial class VeilCultPortalComponent : Component
|
||||
{
|
||||
|
||||
public float NextTimeTick { get; set; }
|
||||
|
||||
[DataField("ritualMusic")]
|
||||
[DataField]
|
||||
public SoundSpecifier RitualMusic = new SoundCollectionSpecifier("BloodCultMusic");
|
||||
|
||||
public bool SoundPlayed;
|
||||
@@ -143,23 +123,23 @@ public sealed partial class AbsorbedByVeilComponent : Component;
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class StunEnchantComponent : Component
|
||||
{
|
||||
[DataField("stunTime")]
|
||||
[DataField]
|
||||
public TimeSpan StunTime = TimeSpan.FromSeconds(5);
|
||||
|
||||
[DataField("muteTime")]
|
||||
|
||||
[DataField]
|
||||
public TimeSpan MuteTime = TimeSpan.FromSeconds(10);
|
||||
|
||||
[DataField("mute")]
|
||||
|
||||
[DataField]
|
||||
public bool Mute = true;
|
||||
|
||||
[DataField("empBorgs")]
|
||||
|
||||
[DataField]
|
||||
public bool EmpBorgs = true;
|
||||
}
|
||||
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class ForcePassageEnchantComponent : Component
|
||||
{
|
||||
[DataField("proto")]
|
||||
[DataField]
|
||||
public EntProtoId? Proto; // for future
|
||||
}
|
||||
|
||||
@@ -182,24 +162,24 @@ public sealed partial class SealWoundsEnchantComponent : Component;
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class HidingsClockEnchantComponent : Component
|
||||
{
|
||||
[DataField("uses")]
|
||||
[DataField]
|
||||
public int Uses = 2;
|
||||
|
||||
[DataField("radius")]
|
||||
|
||||
[DataField]
|
||||
public float Radius = 5f;
|
||||
}
|
||||
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class ElectricalTouchEnchantComponent : Component
|
||||
{
|
||||
[DataField("uses")]
|
||||
[DataField]
|
||||
public int Uses = 3;
|
||||
}
|
||||
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class ConfusionEnchantComponent : Component
|
||||
{
|
||||
[DataField("time")]
|
||||
[DataField]
|
||||
public TimeSpan Time = TimeSpan.FromSeconds(15);
|
||||
}
|
||||
|
||||
@@ -209,20 +189,20 @@ public sealed partial class CrusherEnchantComponent : Component;
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class KnockbackEnchantComponent : Component
|
||||
{
|
||||
[DataField("uses")]
|
||||
[DataField]
|
||||
public int Uses = 3;
|
||||
|
||||
[DataField("distance")]
|
||||
|
||||
[DataField]
|
||||
public float Distance = 3f;
|
||||
|
||||
[DataField("speed")]
|
||||
|
||||
[DataField]
|
||||
public float Speed = 3f;
|
||||
}
|
||||
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class SwordsmenEnchantComponent : Component
|
||||
{
|
||||
[DataField("attackRate")]
|
||||
[DataField]
|
||||
public float AttackRate = 4f;
|
||||
}
|
||||
|
||||
@@ -232,20 +212,20 @@ public sealed partial class BloodshedEnchantComponent : Component;
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class HasteEnchantComponent : Component
|
||||
{
|
||||
[DataField("time")]
|
||||
[DataField]
|
||||
public TimeSpan Time = TimeSpan.FromSeconds(8);
|
||||
|
||||
[DataField("sprintModifier")]
|
||||
|
||||
[DataField]
|
||||
public float SprintModifier = 1.5f;
|
||||
|
||||
[DataField("walkModifier")]
|
||||
|
||||
[DataField]
|
||||
public float WalkModifier = 1.5f;
|
||||
}
|
||||
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class ReflectionEnchantComponent : Component
|
||||
{
|
||||
[DataField("uses")]
|
||||
[DataField]
|
||||
public int Uses = 4;
|
||||
}
|
||||
|
||||
@@ -261,48 +241,47 @@ public sealed partial class FlashEnchantComponent : Component;
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class HardenPlatesEnchantComponent : Component
|
||||
{
|
||||
[DataField("time")]
|
||||
[DataField]
|
||||
public TimeSpan Time = TimeSpan.FromSeconds(8);
|
||||
}
|
||||
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class NorthStarEnchantComponent : Component
|
||||
{
|
||||
[DataField("attackRate")]
|
||||
[DataField]
|
||||
public float AttackRate = 4f;
|
||||
}
|
||||
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class RedFlameEnchantComponent : Component
|
||||
{
|
||||
[DataField("time")]
|
||||
[DataField]
|
||||
public TimeSpan Time = TimeSpan.FromSeconds(5);
|
||||
}
|
||||
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class TimeStopEnchantComponent : Component
|
||||
{
|
||||
[DataField("time")]
|
||||
public TimeSpan Time = TimeSpan.FromSeconds(6);
|
||||
[DataField]
|
||||
public TimeSpan Time = TimeSpan.FromSeconds(5);
|
||||
}
|
||||
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class ReconstructionEnchantComponent : Component
|
||||
{
|
||||
[DataField("radius")]
|
||||
[DataField]
|
||||
public float Radius = 4f;
|
||||
}
|
||||
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class EmpEnchantComponent : Component
|
||||
{
|
||||
[DataField("radiusStrong")]
|
||||
[DataField]
|
||||
public float RadiusStrong = 4f;
|
||||
|
||||
[DataField("radiusWeak")]
|
||||
|
||||
[DataField]
|
||||
public float RadiusWeak = 6f;
|
||||
}
|
||||
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class ConfusionComponent : Component;
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using Content.Shared.Actions;
|
||||
using Content.Shared.DoAfter;
|
||||
using Content.Shared.Eui;
|
||||
using Content.Shared.Teleportation.Components;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization;
|
||||
@@ -8,6 +7,14 @@ using Robust.Shared.Serialization;
|
||||
namespace Content.Shared.Veil.Cult;
|
||||
|
||||
// Events
|
||||
public sealed class VeilGodCalledEvent : EntityEventArgs
|
||||
{
|
||||
}
|
||||
|
||||
public sealed class VeilRitualConductedEvent : EntityEventArgs
|
||||
{
|
||||
}
|
||||
|
||||
public sealed partial class VeilCultMidasTouchActionEvent : InstantActionEvent
|
||||
{
|
||||
}
|
||||
@@ -20,8 +27,12 @@ public sealed partial class VeilCultMidasTouchGetHandEvent : InstantActionEvent
|
||||
public sealed partial class EnchantingDoAfterEvent : SimpleDoAfterEvent
|
||||
{
|
||||
public EntProtoId Entity;
|
||||
}
|
||||
|
||||
public EnchantingDoAfterEvent(EntProtoId entity)
|
||||
{
|
||||
Entity = entity;
|
||||
}
|
||||
}
|
||||
|
||||
public sealed partial class CrusherEnchantActionEvent : InstantActionEvent
|
||||
{
|
||||
@@ -79,6 +90,11 @@ public sealed partial class RedFlameEnchantActionEvent : InstantActionEvent
|
||||
public sealed partial class VeilCultTeleportDoAfterEvent : SimpleDoAfterEvent
|
||||
{
|
||||
public NetEntity Beacon;
|
||||
|
||||
public VeilCultTeleportDoAfterEvent(NetEntity beacon)
|
||||
{
|
||||
Beacon = beacon;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
@@ -92,10 +108,9 @@ public sealed partial class StrangeShardDoAfterEvent : SimpleDoAfterEvent
|
||||
}
|
||||
|
||||
[ByRefEvent]
|
||||
public record struct SiliconVeilCultHackedEvent(EntityUid user);
|
||||
public record struct SiliconVeilCultHackedEvent(EntityUid User);
|
||||
|
||||
// UI KEYS
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum TeleportEnchantUiKey : byte
|
||||
{
|
||||
@@ -108,8 +123,19 @@ public enum VeilBeaconUiKey : byte
|
||||
Key
|
||||
}
|
||||
|
||||
|
||||
// STATES AND MESSAGES
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class VeilBeaconNameBoundUserInterfaceState : BoundUserInterfaceState
|
||||
{
|
||||
public string Name;
|
||||
public int MaxChars;
|
||||
|
||||
public VeilBeaconNameBoundUserInterfaceState(string name, int maxChars)
|
||||
{
|
||||
Name = name;
|
||||
MaxChars = maxChars;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class VeilBeaconNameChangedMessage(string name) : BoundUserInterfaceMessage
|
||||
@@ -118,18 +144,16 @@ public sealed class VeilBeaconNameChangedMessage(string name) : BoundUserInterfa
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class TeleportEnchantDestinationMessage(NetEntity netEnt, string pointName) : BoundUserInterfaceMessage
|
||||
public sealed class TeleportEnchantDestinationMessage(NetEntity netEnt) : BoundUserInterfaceMessage
|
||||
{
|
||||
public NetEntity NetEnt = netEnt;
|
||||
public string PointName = pointName;
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class VeilCultBeaconComponentState(string assignedName) : IComponentState
|
||||
public sealed class VeilCultBeaconComponentState(string assignedName, int maxNameChars) : IComponentState // <-- Эт не ui тип, а к компонентам ближе
|
||||
{
|
||||
public string AssignedName = assignedName;
|
||||
|
||||
public int MaxNameChars;
|
||||
public int MaxNameChars = maxNameChars;
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
|
||||
@@ -2,5 +2,5 @@ admin-verb-make-vampire = Сделать цель вампиром.
|
||||
admin-verb-text-make-vampire = Сделать вампиром
|
||||
admin-verb-make-blood-culsist = Сделать цель культистом крови.
|
||||
admin-verb-text-make-blood-culsist = Сделать культистом крови
|
||||
admin-verb-make-blood-culsist = Сделать цель праведником Ратвара.
|
||||
admin-verb-make-veil-culsist = Сделать цель праведником Ратвара.
|
||||
admin-verb-text-make-veil-culsist = Сделать праведником Ратвара
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
weights:
|
||||
Traitor: 0.3
|
||||
Nukeops: 0.15
|
||||
BloodCult: 0.15
|
||||
VeilCult: 0.15 # Veil-Testing
|
||||
Revolutionary: 0.15
|
||||
Survival: 0.05
|
||||
Zombie: 0.05
|
||||
|
||||
Reference in New Issue
Block a user