Blood (#507)
* - tweak: Nerf spear. * - tweak: Blood bolt barrage. * - add: Cult stuff. * - fix: Cult fixes. * - remove: Garbage. * - fix: Multiple pylons. * - fix: Pylon placement fix. * - add: Lots of cult stuff.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Content.Client.Administration.Managers;
|
||||
using Content.Client.Ghost;
|
||||
using Content.Shared._White.Cult.Components;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.Changeling;
|
||||
using Content.Shared.Chat;
|
||||
@@ -54,7 +55,8 @@ namespace Content.Client.Chat.Managers
|
||||
|
||||
case ChatSelectChannel.Cult:
|
||||
var localEnt = _player.LocalPlayer != null ? _player.LocalPlayer.ControlledEntity : null;
|
||||
if (_entityManager.TryGetComponent(localEnt, out CultistComponent? comp))
|
||||
if (_entityManager.HasComponent<CultistComponent>(localEnt) ||
|
||||
_entityManager.HasComponent<ConstructComponent>(localEnt))
|
||||
_consoleHost.ExecuteCommand($"csay \"{CommandParsing.Escape(text)}\"");
|
||||
break;
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ using Content.Shared.Damage.ForceSay;
|
||||
using Content.Shared.Input;
|
||||
using Content.Shared.Radio;
|
||||
using Content.Shared._White;
|
||||
using Content.Shared._White.Cult.Components;
|
||||
using Content.Shared._White.Utils;
|
||||
using Content.Shared._White.Cult.Systems;
|
||||
using Robust.Client.Graphics;
|
||||
@@ -235,8 +236,8 @@ public sealed class ChatUIController : UIController
|
||||
_input.SetInputCommand(ContentKeyFunctions.CycleChatChannelBackward,
|
||||
InputCmdHandler.FromDelegate(_ => CycleChatChannel(false)));
|
||||
|
||||
SubscribeLocalEvent<ChangelingUserStart>(OnUpdateChangelingChat);
|
||||
// WD EDIT
|
||||
SubscribeLocalEvent<ChangelingUserStart>(OnUpdateChangelingChat);
|
||||
SubscribeLocalEvent<EventCultistComponentState>(OnUpdateCultState);
|
||||
// WD EDIT END
|
||||
|
||||
@@ -563,7 +564,7 @@ public sealed class ChatUIController : UIController
|
||||
|
||||
// WD EDIT
|
||||
var localEnt = _player.LocalEntity;
|
||||
if (_entities.HasComponent<CultistComponent>(localEnt))
|
||||
if (_entities.HasComponent<CultistComponent>(localEnt) || _entities.HasComponent<ConstructComponent>(localEnt))
|
||||
{
|
||||
FilterableChannels |= ChatChannel.Cult;
|
||||
CanSendChannels |= ChatSelectChannel.Cult;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Content.Shared._White.Cult;
|
||||
using Content.Shared._White.Cult.Components;
|
||||
using Content.Shared._White.Cult.Components;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.Player;
|
||||
using Robust.Shared.Player;
|
||||
@@ -29,7 +28,7 @@ public sealed class ShowCultHudSystem : EntitySystem
|
||||
_overlay = new CultHudOverlay(EntityManager);
|
||||
}
|
||||
|
||||
private void OnComponentInit(EntityUid uid, ShowCultHudComponent component, ComponentInit args)
|
||||
private void OnComponentInit<T>(EntityUid uid, T component, ComponentInit args)
|
||||
{
|
||||
if (_player.LocalSession?.AttachedEntity != uid)
|
||||
return;
|
||||
@@ -38,7 +37,7 @@ public sealed class ShowCultHudSystem : EntitySystem
|
||||
|
||||
}
|
||||
|
||||
private void OnComponentRemoved(EntityUid uid, ShowCultHudComponent component, ComponentRemove args)
|
||||
private void OnComponentRemoved<T>(EntityUid uid, T component, ComponentRemove args)
|
||||
{
|
||||
if (_player.LocalSession?.AttachedEntity != uid)
|
||||
return;
|
||||
@@ -47,7 +46,7 @@ public sealed class ShowCultHudSystem : EntitySystem
|
||||
|
||||
}
|
||||
|
||||
private void OnPlayerAttached(EntityUid uid, ShowCultHudComponent component, PlayerAttachedEvent args)
|
||||
private void OnPlayerAttached<T>(EntityUid uid, T component, PlayerAttachedEvent args)
|
||||
{
|
||||
if (_player.LocalSession != args.Player)
|
||||
return;
|
||||
@@ -55,7 +54,7 @@ public sealed class ShowCultHudSystem : EntitySystem
|
||||
_overlayManager.AddOverlay(_overlay);
|
||||
}
|
||||
|
||||
private void OnPlayerDetached(EntityUid uid, ShowCultHudComponent component, PlayerDetachedEvent args)
|
||||
private void OnPlayerDetached<T>(EntityUid uid, T component, PlayerDetachedEvent args)
|
||||
{
|
||||
if (_player.LocalSession != args.Player)
|
||||
return;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Linq;
|
||||
using Content.Client.Construction;
|
||||
using Content.Shared._White.Cult.Pylon;
|
||||
using Content.Shared.Construction.Prototypes;
|
||||
using Content.Shared.Popups;
|
||||
using Robust.Client.Placement;
|
||||
@@ -8,60 +9,33 @@ using Robust.Shared.Map;
|
||||
|
||||
namespace Content.Client._White.Cult.UI.StructureRadial;
|
||||
|
||||
public sealed class CultPylonPlacementHijack : PlacementHijack
|
||||
public sealed class CultPylonPlacementHijack(ConstructionPrototype? prototype, IEntityManager entMan, EntityUid player)
|
||||
: PlacementHijack
|
||||
{
|
||||
private readonly ConstructionSystem _constructionSystem;
|
||||
private readonly IEntityManager _entMan;
|
||||
private readonly ConstructionPrototype? _prototype;
|
||||
private readonly EntityUid _player;
|
||||
private readonly ConstructionSystem _constructionSystem = entMan.System<ConstructionSystem>();
|
||||
|
||||
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;
|
||||
}
|
||||
public override bool CanRotate { get; } = prototype?.CanRotate ?? true;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool HijackPlacementRequest(EntityCoordinates coordinates)
|
||||
{
|
||||
if (_prototype == null)
|
||||
if (prototype == null)
|
||||
return true;
|
||||
|
||||
if (CheckForStructure(coordinates))
|
||||
if (SharedPylonComponent.CheckForStructure(coordinates, entMan, 10f))
|
||||
{
|
||||
var popup = _entMan.System<SharedPopupSystem>();
|
||||
popup.PopupClient(Loc.GetString("cult-structure-craft-another-structure-nearby"), _player, _player);
|
||||
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);
|
||||
_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)
|
||||
{
|
||||
@@ -77,6 +51,6 @@ public sealed class CultPylonPlacementHijack : PlacementHijack
|
||||
public override void StartHijack(PlacementManager manager)
|
||||
{
|
||||
base.StartHijack(manager);
|
||||
manager.CurrentTextures = _prototype?.Layers.Select(sprite => sprite.DirFrame0()).ToList();
|
||||
manager.CurrentTextures = prototype?.Layers.Select(sprite => sprite.DirFrame0()).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user