* 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
73 lines
1.8 KiB
C#
73 lines
1.8 KiB
C#
using Content.Shared._CP14.ZLevel;
|
|
using Content.Shared.Ghost;
|
|
using Robust.Shared.Map;
|
|
|
|
namespace Content.Server._CP14.ZLevels.EntitySystems;
|
|
|
|
public sealed partial class CP14StationZLevelsSystem
|
|
{
|
|
private void InitActions()
|
|
{
|
|
SubscribeLocalEvent<GhostComponent, CP14ZLevelActionUp>(OnZLevelUpGhost);
|
|
SubscribeLocalEvent<GhostComponent, CP14ZLevelActionDown>(OnZLevelDownGhost);
|
|
SubscribeLocalEvent<SpectralComponent, CP14ZLevelActionUp>(OnZLevelUp);
|
|
SubscribeLocalEvent<SpectralComponent, CP14ZLevelActionDown>(OnZLevelDown);
|
|
}
|
|
|
|
private void OnZLevelDownGhost(Entity<GhostComponent> ent, ref CP14ZLevelActionDown args)
|
|
{
|
|
if (args.Handled)
|
|
return;
|
|
|
|
ZLevelMove(ent, -1);
|
|
|
|
args.Handled = true;
|
|
}
|
|
|
|
private void OnZLevelUpGhost(Entity<GhostComponent> ent, ref CP14ZLevelActionUp args)
|
|
{
|
|
if (args.Handled)
|
|
return;
|
|
|
|
ZLevelMove(ent, 1);
|
|
|
|
args.Handled = true;
|
|
}
|
|
|
|
private void OnZLevelDown(Entity<SpectralComponent> ent, ref CP14ZLevelActionDown args)
|
|
{
|
|
if (args.Handled)
|
|
return;
|
|
|
|
ZLevelMove(ent, -1);
|
|
|
|
args.Handled = true;
|
|
}
|
|
|
|
private void OnZLevelUp(Entity<SpectralComponent> ent, ref CP14ZLevelActionUp args)
|
|
{
|
|
if (args.Handled)
|
|
return;
|
|
|
|
ZLevelMove(ent, 1);
|
|
|
|
args.Handled = true;
|
|
}
|
|
|
|
private void ZLevelMove(EntityUid ent, int offset)
|
|
{
|
|
var xform = Transform(ent);
|
|
var map = xform.MapUid;
|
|
|
|
if (map is null)
|
|
return;
|
|
|
|
var targetMap = GetMapOffset(map.Value, offset);
|
|
|
|
if (targetMap is null)
|
|
return;
|
|
|
|
_transform.SetMapCoordinates(ent, new MapCoordinates(_transform.GetWorldPosition(ent), targetMap.Value));
|
|
}
|
|
}
|