Cult update (#220)
* - tweak: Cult door not bump openable. * - tweak: Better summoning and Narsie * - tweak: Construct update. * - tweak: Eldrich blade fits in suit storage. * - tweak: More spell limit. * - fix: Fix pylon desc. * - tweak: Teleport works on cuffed targets. * - tweak: More popups if target is holy. * - fix: No rune drawing using fingers. * - tweak: Better pylon placement & less pylon healing range. * - tweak: More blood rites charge. * - fix: Fix max spell amount. * - tweak: Less cult door and wall health. * - fix: Constructs are dead IC. * - add: Revive rune now notifies player. * - add: Narsie summon rune eui. * - fix: Fix narsie summon sound not playing for reapers. * - tweak: Whatever. * - add: Conceal presence spell. * - tweak: Tweakz. * - add: Blood spear. * - add: Blood boil barrage. * - tweak: Artificer flies. * - tweak: Blood bolt color tweaks. * - tweak: Runic door is bump openable again. * - fix: Fix concealed door outline. * - add: Update concealable name and desc. * - tweak: Remove the unremoveable. * - tweak: Gift ignore. * - add: Organs regenerate on rejuvenate. * - tweak: Brainless cultist is fine. * - add: Added more fun. * - add: Add rune descriptions. * - fix: Fixes. * - tweak: Blood rites now uses verb. * - tweak: Bring it back.
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
using System.Linq;
|
||||
using Content.Client.IconSmoothing;
|
||||
using Content.Client.Interactable.Components;
|
||||
using Content.Shared._White.Cult.Components;
|
||||
using Robust.Client.GameObjects;
|
||||
|
||||
namespace Content.Client._White.Cult.Concealable;
|
||||
|
||||
public sealed class ConcealableVisualizer : VisualizerSystem<ConcealableComponent>
|
||||
{
|
||||
[Dependency] private readonly IconSmoothSystem _smooth = default!;
|
||||
|
||||
protected override void OnAppearanceChange(EntityUid uid, ConcealableComponent component, ref AppearanceChangeEvent args)
|
||||
{
|
||||
base.OnAppearanceChange(uid, component, ref args);
|
||||
|
||||
if (args.Sprite == null)
|
||||
return;
|
||||
|
||||
if (!AppearanceSystem.TryGetData<bool>(uid, ConcealableAppearance.Concealed, out var concealed, args.Component))
|
||||
return;
|
||||
|
||||
if (component.IconSmooth)
|
||||
_smooth.SetEnabled(uid, concealed);
|
||||
|
||||
if (component.InteractionOutline)
|
||||
{
|
||||
if (concealed)
|
||||
{
|
||||
if (TryComp(uid, out InteractionOutlineComponent? outline))
|
||||
{
|
||||
outline.OnMouseLeave(uid);
|
||||
RemComp<InteractionOutlineComponent>(uid);
|
||||
}
|
||||
}
|
||||
else
|
||||
EnsureComp<InteractionOutlineComponent>(uid);
|
||||
}
|
||||
|
||||
if (concealed)
|
||||
{
|
||||
if (component.ConcealedSprite != null)
|
||||
{
|
||||
for (var i = 0; i < args.Sprite.AllLayers.Count(); i++)
|
||||
{
|
||||
args.Sprite.LayerSetRSI(i, component.ConcealedSprite.Value);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
args.Sprite.Color = args.Sprite.Color.WithAlpha(0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (component.RevealedSprite != null)
|
||||
{
|
||||
for (var i = 0; i < args.Sprite.AllLayers.Count(); i++)
|
||||
{
|
||||
args.Sprite.LayerSetRSI(i, component.RevealedSprite.Value);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
args.Sprite.Color = args.Sprite.Color.WithAlpha(1f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using Content.Shared._White.Cult;
|
||||
using Content.Shared._White.Cult.Components;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.Player;
|
||||
using Robust.Shared.Player;
|
||||
@@ -20,10 +21,15 @@ public sealed class ShowCultHudSystem : EntitySystem
|
||||
SubscribeLocalEvent<CultistComponent, PlayerAttachedEvent>(OnPlayerAttached);
|
||||
SubscribeLocalEvent<CultistComponent, PlayerDetachedEvent>(OnPlayerDetached);
|
||||
|
||||
SubscribeLocalEvent<ShowCultHudComponent, ComponentInit>(OnComponentInit);
|
||||
SubscribeLocalEvent<ShowCultHudComponent, ComponentRemove>(OnComponentRemoved);
|
||||
SubscribeLocalEvent<ShowCultHudComponent, PlayerAttachedEvent>(OnPlayerAttached);
|
||||
SubscribeLocalEvent<ShowCultHudComponent, PlayerDetachedEvent>(OnPlayerDetached);
|
||||
|
||||
_overlay = new CultHudOverlay(EntityManager);
|
||||
}
|
||||
|
||||
private void OnComponentInit(EntityUid uid, CultistComponent component, ComponentInit args)
|
||||
private void OnComponentInit(EntityUid uid, ShowCultHudComponent component, ComponentInit args)
|
||||
{
|
||||
if (_player.LocalSession?.AttachedEntity != uid)
|
||||
return;
|
||||
@@ -32,7 +38,7 @@ public sealed class ShowCultHudSystem : EntitySystem
|
||||
|
||||
}
|
||||
|
||||
private void OnComponentRemoved(EntityUid uid, CultistComponent component, ComponentRemove args)
|
||||
private void OnComponentRemoved(EntityUid uid, ShowCultHudComponent component, ComponentRemove args)
|
||||
{
|
||||
if (_player.LocalSession?.AttachedEntity != uid)
|
||||
return;
|
||||
@@ -41,7 +47,7 @@ public sealed class ShowCultHudSystem : EntitySystem
|
||||
|
||||
}
|
||||
|
||||
private void OnPlayerAttached(EntityUid uid, CultistComponent component, PlayerAttachedEvent args)
|
||||
private void OnPlayerAttached(EntityUid uid, ShowCultHudComponent component, PlayerAttachedEvent args)
|
||||
{
|
||||
if (_player.LocalSession != args.Player)
|
||||
return;
|
||||
@@ -49,7 +55,7 @@ public sealed class ShowCultHudSystem : EntitySystem
|
||||
_overlayManager.AddOverlay(_overlay);
|
||||
}
|
||||
|
||||
private void OnPlayerDetached(EntityUid uid, CultistComponent component, PlayerDetachedEvent args)
|
||||
private void OnPlayerDetached(EntityUid uid, ShowCultHudComponent component, PlayerDetachedEvent args)
|
||||
{
|
||||
if (_player.LocalSession != args.Player)
|
||||
return;
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
using Content.Client.Eui;
|
||||
using Content.Client.Ghost.UI;
|
||||
using Content.Shared._White.Cult.UI;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.Graphics;
|
||||
|
||||
namespace Content.Client._White.Cult.UI.ApocalypseRuneEui;
|
||||
|
||||
[UsedImplicitly]
|
||||
public sealed class ApocalypseRuneEui : BaseEui
|
||||
{
|
||||
private readonly ApocalypseRuneMenu _menu;
|
||||
|
||||
public ApocalypseRuneEui()
|
||||
{
|
||||
_menu = new ApocalypseRuneMenu();
|
||||
|
||||
_menu.DenyButton.OnPressed += _ =>
|
||||
{
|
||||
SendMessage(new ApocalypseRuneDrawMessage(false));
|
||||
_menu.Close();
|
||||
};
|
||||
|
||||
_menu.AcceptButton.OnPressed += _ =>
|
||||
{
|
||||
SendMessage(new ApocalypseRuneDrawMessage(true));
|
||||
_menu.Close();
|
||||
};
|
||||
}
|
||||
|
||||
public override void Opened()
|
||||
{
|
||||
IoCManager.Resolve<IClyde>().RequestWindowAttention();
|
||||
_menu.OpenCentered();
|
||||
}
|
||||
|
||||
public override void Closed()
|
||||
{
|
||||
base.Closed();
|
||||
|
||||
SendMessage(new ApocalypseRuneDrawMessage(false));
|
||||
_menu.Close();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
using System.Numerics;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.CustomControls;
|
||||
using static Robust.Client.UserInterface.Controls.BoxContainer;
|
||||
|
||||
namespace Content.Client.Ghost.UI;
|
||||
|
||||
public sealed class ApocalypseRuneMenu : DefaultWindow
|
||||
{
|
||||
public readonly Button DenyButton;
|
||||
public readonly Button AcceptButton;
|
||||
|
||||
public ApocalypseRuneMenu()
|
||||
{
|
||||
Title = Loc.GetString("apocalypse-rune-title");
|
||||
|
||||
Contents.AddChild(new BoxContainer
|
||||
{
|
||||
Orientation = LayoutOrientation.Vertical,
|
||||
Children =
|
||||
{
|
||||
new BoxContainer
|
||||
{
|
||||
Orientation = LayoutOrientation.Vertical,
|
||||
Children =
|
||||
{
|
||||
(new Label()
|
||||
{
|
||||
Text = Loc.GetString("apocalypse-rune-text")
|
||||
}),
|
||||
new BoxContainer
|
||||
{
|
||||
Orientation = LayoutOrientation.Horizontal,
|
||||
Align = AlignMode.Center,
|
||||
Children =
|
||||
{
|
||||
(AcceptButton = new Button
|
||||
{
|
||||
Text = Loc.GetString("apocalypse-rune-accept-button"),
|
||||
}),
|
||||
|
||||
(new Control()
|
||||
{
|
||||
MinSize = new Vector2(20, 0)
|
||||
}),
|
||||
|
||||
(DenyButton = new Button
|
||||
{
|
||||
Text = Loc.GetString("apocalypse-rune-deny-button"),
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +32,8 @@ public sealed class CultistFactoryBUI : BoundUserInterface
|
||||
|
||||
_radialContainer = new RadialContainer();
|
||||
|
||||
_radialContainer.Closed += Close;
|
||||
|
||||
if (State != null)
|
||||
UpdateState(State);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Content.Client.Lathe.UI;
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.CustomControls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
@@ -7,19 +8,21 @@ using Robust.Shared.Prototypes;
|
||||
namespace Content.Client._White.Cult.UI.ListViewSelector;
|
||||
|
||||
[GenerateTypedNameReferences]
|
||||
public partial class ListViewSelectorWindow : DefaultWindow
|
||||
public sealed partial class ListViewSelectorWindow : DefaultWindow
|
||||
{
|
||||
public Action<string, int>? ItemSelected;
|
||||
|
||||
private readonly IPrototypeManager _prototypeManager;
|
||||
|
||||
public string TooltipText = string.Empty;
|
||||
|
||||
public ListViewSelectorWindow(IPrototypeManager prototypeManager)
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
_prototypeManager = prototypeManager;
|
||||
}
|
||||
|
||||
public void PopulateList(List<string> items, bool isPrototypes)
|
||||
public void PopulateList(List<EntProtoId> items, bool isPrototypes)
|
||||
{
|
||||
ItemsContainer.RemoveAllChildren();
|
||||
|
||||
@@ -27,16 +30,16 @@ public partial class ListViewSelectorWindow : DefaultWindow
|
||||
{
|
||||
var button = new Button();
|
||||
var itemName = Loc.GetString($"ent-{item}");
|
||||
var itemDesc = string.Empty;
|
||||
|
||||
if (isPrototypes)
|
||||
if (isPrototypes && _prototypeManager.TryIndex<EntityPrototype>(item, out var itemPrototype))
|
||||
{
|
||||
if (_prototypeManager.TryIndex<EntityPrototype>(item, out var itemPrototype))
|
||||
{
|
||||
itemName = itemPrototype.Name;
|
||||
}
|
||||
itemName = itemPrototype.Name;
|
||||
itemDesc = itemPrototype.Description;
|
||||
}
|
||||
|
||||
button.Text = itemName;
|
||||
button.TooltipSupplier = _ => new RecipeTooltip(itemDesc);
|
||||
|
||||
button.OnPressed += _ => ItemSelected?.Invoke(item, items.IndexOf(item));
|
||||
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
using System.Linq;
|
||||
using Content.Client.Construction;
|
||||
using Content.Shared.Construction.Prototypes;
|
||||
using Content.Shared.Popups;
|
||||
using Robust.Client.Placement;
|
||||
using Robust.Client.Utility;
|
||||
using Robust.Shared.Map;
|
||||
|
||||
namespace Content.Client._White.Cult.UI.StructureRadial;
|
||||
|
||||
public sealed class CultPylonPlacementHijack : PlacementHijack
|
||||
{
|
||||
private readonly ConstructionSystem _constructionSystem;
|
||||
private readonly IEntityManager _entMan;
|
||||
private readonly ConstructionPrototype? _prototype;
|
||||
private readonly EntityUid _player;
|
||||
|
||||
public override bool CanRotate { get; }
|
||||
|
||||
public CultPylonPlacementHijack(ConstructionPrototype? prototype, IEntityManager entMan, EntityUid player)
|
||||
{
|
||||
_prototype = prototype;
|
||||
_entMan = entMan;
|
||||
_player = player;
|
||||
_constructionSystem = entMan.System<ConstructionSystem>();
|
||||
CanRotate = prototype?.CanRotate ?? true;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool HijackPlacementRequest(EntityCoordinates coordinates)
|
||||
{
|
||||
if (_prototype == null)
|
||||
return true;
|
||||
|
||||
if (CheckForStructure(coordinates))
|
||||
{
|
||||
var popup = _entMan.System<SharedPopupSystem>();
|
||||
popup.PopupClient(Loc.GetString("cult-structure-craft-another-structure-nearby"), _player, _player);
|
||||
return true;
|
||||
}
|
||||
|
||||
_constructionSystem.ClearAllGhosts();
|
||||
var dir = Manager.Direction;
|
||||
_constructionSystem.SpawnGhost(_prototype, coordinates, dir);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool CheckForStructure(EntityCoordinates coordinates)
|
||||
{
|
||||
var lookupSystem = _entMan.System<EntityLookupSystem>();
|
||||
var entities = lookupSystem.GetEntitiesInRange(coordinates, 10f);
|
||||
foreach (var ent in entities)
|
||||
{
|
||||
if (!_entMan.TryGetComponent<MetaDataComponent>(ent, out var metadata))
|
||||
continue;
|
||||
|
||||
if (metadata.EntityPrototype?.ID is "CultPylon")
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool HijackDeletion(EntityUid entity)
|
||||
{
|
||||
if (IoCManager.Resolve<IEntityManager>().HasComponent<ConstructionGhostComponent>(entity))
|
||||
{
|
||||
_constructionSystem.ClearGhost(entity.GetHashCode());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void StartHijack(PlacementManager manager)
|
||||
{
|
||||
base.StartHijack(manager);
|
||||
manager.CurrentTextures = _prototype?.Layers.Select(sprite => sprite.DirFrame0()).ToList();
|
||||
}
|
||||
}
|
||||
@@ -86,43 +86,23 @@ public sealed class StructureCraftBoundUserInterface : BoundUserInterface
|
||||
if (construct == null)
|
||||
return;
|
||||
|
||||
var player = _player.LocalPlayer?.ControlledEntity;
|
||||
var player = _player.LocalEntity;
|
||||
|
||||
if (player == null)
|
||||
return;
|
||||
|
||||
if (construct.ID == "CultPylon" && CheckForStructure(player, id))
|
||||
{
|
||||
var popup = _entMan.System<SharedPopupSystem>();
|
||||
popup.PopupClient(Loc.GetString("cult-structure-craft-another-structure-nearby"), player.Value, player.Value);
|
||||
return;
|
||||
}
|
||||
PlacementHijack hijack;
|
||||
|
||||
var constructSystem = _systemManager.GetEntitySystem<ConstructionSystem>();
|
||||
var hijack = new ConstructionPlacementHijack(constructSystem, construct);
|
||||
if (construct.ID == "CultPylon")
|
||||
{
|
||||
hijack = new CultPylonPlacementHijack(construct, _entMan, player.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
var constructSystem = _systemManager.GetEntitySystem<ConstructionSystem>();
|
||||
hijack = new ConstructionPlacementHijack(constructSystem, construct);
|
||||
}
|
||||
|
||||
_placement.BeginPlacing(newObj, hijack);
|
||||
}
|
||||
|
||||
private bool CheckForStructure(EntityUid? uid, string id)
|
||||
{
|
||||
if (uid == null)
|
||||
return false;
|
||||
|
||||
if (!_entMan.TryGetComponent<TransformComponent>(uid, out var transform))
|
||||
return false;
|
||||
|
||||
var lookupSystem = _entMan.System<EntityLookupSystem>();
|
||||
var entities = lookupSystem.GetEntitiesInRange(transform.Coordinates, 15f);
|
||||
foreach (var ent in entities)
|
||||
{
|
||||
if (!_entMan.TryGetComponent<MetaDataComponent>(ent, out var metadata))
|
||||
continue;
|
||||
|
||||
if (metadata.EntityPrototype?.ID == id)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user