* basic religion vision * block god interactions * skill tree mob specify * silvania setup?? * clustering shader optimization * gods department & job * random gods jobs * Luxian god * Update Nature.png * Update sphere_of_light.yml * god chat * Update ChatSystem.cs * OBSERVATION * public observation and basic follower api * shader tweaks * improve shaders * spawning and praying on altars * altars ppvs override * move pvs overridiation from altars to observers * shader coloration * spectral z mover * god magic radius restricted * guide how to believe in god * sends messages to god when smoeone wanna become follower * follower doAfter * goodbye luxian, welcome lumera * goodbye silvania, welcome merkas * som polish and renamings * gods fast travel * Update altar.ftl * some lumera sfx * renouncing patrons! * renounce followers * followewr percentage calculation * remove from player-facing * fix * Update sphere_of_light.yml * Update base.yml
84 lines
2.4 KiB
C#
84 lines
2.4 KiB
C#
using Content.Shared._CP14.Religion.Components;
|
|
using Content.Shared._CP14.Religion.Prototypes;
|
|
using Content.Shared._CP14.Religion.Systems;
|
|
using Robust.Client.Graphics;
|
|
using Robust.Client.Player;
|
|
using Robust.Shared.Player;
|
|
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.Client._CP14.Religion;
|
|
|
|
public sealed partial class CP14ClientReligionGodSystem : CP14SharedReligionGodSystem
|
|
{
|
|
[Dependency] private readonly IOverlayManager _overlayMgr = default!;
|
|
[Dependency] private readonly IPlayerManager _player = default!;
|
|
|
|
private CP14ReligionVisionOverlay? _overlay;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<CP14ReligionVisionComponent, LocalPlayerAttachedEvent>(OnPlayerAttached);
|
|
SubscribeLocalEvent<CP14ReligionVisionComponent, LocalPlayerDetachedEvent>(OnPlayerDetached);
|
|
SubscribeLocalEvent<CP14ReligionVisionComponent, ComponentInit>(OnOverlayInit);
|
|
SubscribeLocalEvent<CP14ReligionVisionComponent, ComponentRemove>(OnOverlayRemove);
|
|
}
|
|
|
|
protected override void SendMessageToGods(ProtoId<CP14ReligionPrototype> religion, string msg, EntityUid source) { }
|
|
|
|
public override void Shutdown()
|
|
{
|
|
base.Shutdown();
|
|
_overlayMgr.RemoveOverlay<CP14ReligionVisionOverlay>();
|
|
}
|
|
|
|
private void OnPlayerAttached(Entity<CP14ReligionVisionComponent> ent, ref LocalPlayerAttachedEvent args)
|
|
{
|
|
AddOverlay();
|
|
}
|
|
|
|
private void OnPlayerDetached(Entity<CP14ReligionVisionComponent> ent, ref LocalPlayerDetachedEvent args)
|
|
{
|
|
RemoveOverlay();
|
|
}
|
|
|
|
private void OnOverlayInit(Entity<CP14ReligionVisionComponent> ent, ref ComponentInit args)
|
|
{
|
|
var attachedEnt = _player.LocalEntity;
|
|
|
|
if (attachedEnt != ent.Owner)
|
|
return;
|
|
|
|
AddOverlay();
|
|
}
|
|
|
|
private void OnOverlayRemove(Entity<CP14ReligionVisionComponent> ent, ref ComponentRemove args)
|
|
{
|
|
var attachedEnt = _player.LocalEntity;
|
|
|
|
if (attachedEnt != ent.Owner)
|
|
return;
|
|
|
|
RemoveOverlay();
|
|
}
|
|
|
|
private void AddOverlay()
|
|
{
|
|
if (_overlay != null)
|
|
return;
|
|
|
|
_overlay = new CP14ReligionVisionOverlay();
|
|
_overlayMgr.AddOverlay(_overlay);
|
|
}
|
|
|
|
private void RemoveOverlay()
|
|
{
|
|
if (_overlay == null)
|
|
return;
|
|
|
|
_overlayMgr.RemoveOverlay(_overlay);
|
|
_overlay = null;
|
|
}
|
|
}
|