Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Вродеб должно стать получше с этими штуками #276

Merged
merged 1 commit into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions Content.Server/ADT/Hallucinations/Systems/HallucinationsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ public override void Initialize()

private void OnHallucinationsInit(EntityUid uid, HallucinationsComponent component, MapInitEvent args)
{
component.Layer = _random.Next(100, 150);
component.Layer = (ushort)(_random.Next(4, 32) << 1);
if (!_entityManager.TryGetComponent<EyeComponent>(uid, out var eye))
return;
UpdatePreset(component);
_eye.SetVisibilityMask(uid, eye.VisibilityMask | (ushort)VisibilityFlags.BaseHallucination, eye);
_eye.SetVisibilityMask(uid, eye.VisibilityMask | component.Layer, eye);

//_eye.SetVisibilityMask(uid, eye.VisibilityMask | component.Layer, eye);
_adminLogger.Add(LogType.Action, LogImpact.Medium,
Expand All @@ -57,10 +57,10 @@ private void OnHallucinationsInit(EntityUid uid, HallucinationsComponent compone

private void OnHallucinationsDiseaseInit(EntityUid uid, HallucinationsDiseaseComponent component, MapInitEvent args)
{
component.Layer = _random.Next(100, 150);
component.Layer = (ushort)(_random.Next(4, 32) << 1);
if (!_entityManager.TryGetComponent<EyeComponent>(uid, out var eye))
return;
_eye.SetVisibilityMask(uid, eye.VisibilityMask | (ushort)VisibilityFlags.BaseHallucination, eye);
_eye.SetVisibilityMask(uid, eye.VisibilityMask | component.Layer, eye);

//_eye.SetVisibilityMask(uid, eye.VisibilityMask | component.Layer, eye);
_adminLogger.Add(LogType.Action, LogImpact.Medium,
Expand All @@ -85,7 +85,7 @@ private void OnHallucinationsShutdown(EntityUid uid, HallucinationsComponent com
{
if (!_entityManager.TryGetComponent<EyeComponent>(uid, out var eye))
return;
_eye.SetVisibilityMask(uid, eye.VisibilityMask & ~(ushort)VisibilityFlags.BaseHallucination, eye);
_eye.SetVisibilityMask(uid, eye.VisibilityMask & ~(ushort)component.Layer, eye);

//_eye.SetVisibilityMask(uid, eye.VisibilityMask & ~component.Layer, eye);
_adminLogger.Add(LogType.Action, LogImpact.Medium,
Expand All @@ -96,7 +96,7 @@ private void OnHallucinationsDiseaseShutdown(EntityUid uid, HallucinationsDiseas
{
if (!_entityManager.TryGetComponent<EyeComponent>(uid, out var eye))
return;
_eye.SetVisibilityMask(uid, eye.VisibilityMask & ~(ushort)VisibilityFlags.BaseHallucination, eye);
_eye.SetVisibilityMask(uid, eye.VisibilityMask & ~(ushort)component.Layer, eye);

//_eye.SetVisibilityMask(uid, eye.VisibilityMask & ~component.Layer, eye);
_adminLogger.Add(LogType.Action, LogImpact.Medium,
Expand Down Expand Up @@ -199,7 +199,7 @@ public override void Update(float frameTime)

var hallucination = Spawn(stat.Spawns[_random.Next(0, stat.Spawns.Count - 1)], newCoords);
EnsureComp<VisibilityComponent>(hallucination, out var visibility);
_visibilitySystem.SetLayer((hallucination, visibility), (ushort)VisibilityFlags.BaseHallucination, false);
_visibilitySystem.SetLayer((hallucination, visibility), (ushort)stat.Layer, false);
_visibilitySystem.RefreshVisibility(hallucination, visibilityComponent: visibility);

//_visibilitySystem.SetLayer((hallucination, visibility), (ushort) stat.Layer, false);
Expand All @@ -213,7 +213,7 @@ public override void Update(float frameTime)

var uidhallucination = Spawn(stat.Spawns[_random.Next(0, stat.Spawns.Count - 1)], uidnewCoords);
EnsureComp<VisibilityComponent>(uidhallucination, out var uidvisibility);
_visibilitySystem.SetLayer((uidhallucination, uidvisibility), (ushort)VisibilityFlags.BaseHallucination, false);
_visibilitySystem.SetLayer((uidhallucination, uidvisibility), (ushort)stat.Layer, false);
_visibilitySystem.RefreshVisibility(uidhallucination, visibilityComponent: uidvisibility);

//_visibilitySystem.SetLayer((uidhallucination, uidvisibility), (ushort) stat.Layer, false);
Expand Down Expand Up @@ -249,7 +249,7 @@ public override void Update(float frameTime)

var hallucination = Spawn(stat.Spawns[_random.Next(0, stat.Spawns.Count - 1)], newCoords);
EnsureComp<VisibilityComponent>(hallucination, out var visibility);
_visibilitySystem.SetLayer((hallucination, visibility), (ushort)VisibilityFlags.BaseHallucination, false);
_visibilitySystem.SetLayer((hallucination, visibility), (ushort)stat.Layer, false);
_visibilitySystem.RefreshVisibility(hallucination, visibilityComponent: visibility);

//_visibilitySystem.SetLayer((hallucination, visibility), (ushort)stat.Layer, false);
Expand All @@ -263,7 +263,7 @@ public override void Update(float frameTime)

var uidhallucination = Spawn(stat.Spawns[_random.Next(0, stat.Spawns.Count - 1)], uidnewCoords);
EnsureComp<VisibilityComponent>(uidhallucination, out var uidvisibility);
_visibilitySystem.SetLayer((uidhallucination, uidvisibility), (ushort)VisibilityFlags.BaseHallucination, false);
_visibilitySystem.SetLayer((uidhallucination, uidvisibility), (ushort)stat.Layer, false);
_visibilitySystem.RefreshVisibility(uidhallucination, visibilityComponent: uidvisibility);

//_visibilitySystem.SetLayer((uidhallucination, uidvisibility), (ushort) stat.Layer, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public sealed partial class HallucinationsComponent : Component
};

[DataField]
public int Layer = 50;
public ushort Layer = 50;

public HallucinationsPrototype? Proto;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public sealed partial class HallucinationsDiseaseComponent : Component
};

[DataField]
public int Layer = 50;
public ushort Layer = 50;

public HallucinationsPrototype? Proto;

Expand Down
2 changes: 0 additions & 2 deletions Content.Shared/Eye/VisibilityFlags.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,5 @@ public enum VisibilityFlags : int
Normal = 1 << 0,
Ghost = 1 << 1, // ADT Phantom
PhantomVessel = 2 << 1, // ADT Phantom
BaseHallucination = 4 << 1, // ADT Phantom

}
}
14 changes: 12 additions & 2 deletions Resources/Prototypes/ADT/Objectives/phantom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

- type: entity
noSpawn: true
parent: [BasePhantomObjective, BaseSocialObjective]
parent: [BasePhantomObjective]
id: PhantomKeepAliveObjective
description: phantom-keep-alive-objective-desc
components:
Expand All @@ -47,10 +47,15 @@
title: objective-condition-phantom-alive-title
- type: PickRandomPerson
- type: KeepAliveCondition
- type: ObjectiveBlacklistRequirement
blacklist:
components:
- KillPhantomImmunePersonCondition
- type: SocialObjective

- type: entity
noSpawn: true
parent: [BasePhantomObjective, BaseSocialObjective]
parent: [BasePhantomObjective]
id: PhantomMakeVesselObjective
description: phantom-make-vessel-objective-desc
components:
Expand All @@ -64,6 +69,11 @@
title: objective-condition-phantom-vessel-title
- type: PickRandomPerson
- type: MakeTargetVesselCondition
- type: ObjectiveBlacklistRequirement
blacklist:
components:
- KillPhantomImmunePersonCondition
- type: SocialObjective

- type: entity
noSpawn: true
Expand Down
Loading