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

Хотфиксы моих обнов #236

Merged
merged 5 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
6 changes: 4 additions & 2 deletions Content.Client/ADT/Bark/Systems/SpeechBarksSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,16 @@ private async void OnEntitySpoke(PlaySpeechBarksEvent ev)
break;
var entity = GetEntity(ev.Source.Value);
if (entity == EntityUid.Invalid || _player.LocalEntity == null)
continue;
break;
if (Deleted(entity) || Terminating(entity))
continue;
break;
if (!HasComp<TransformComponent>(entity) || !HasComp<TransformComponent>(_player.LocalEntity.Value))
continue;
if (Transform(entity).Coordinates.TryDistance(EntityManager, Transform(_player.LocalEntity.Value).Coordinates, out var distance) &&
distance > SharedChatSystem.VoiceRange)
continue;
if (Transform(entity).ParentUid == EntityUid.Invalid)
continue;

_audio.PlayEntity(audioResource.AudioStream, entity, audioParams.WithPitchScale(_random.NextFloat(ev.Pitch - 0.1f, ev.Pitch + 0.1f)));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ private void OnHallucinationsInit(EntityUid uid, HallucinationsComponent compone
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,
$"{ToPrettyString(uid):player} began to hallucinate.");
}
Expand All @@ -62,7 +62,7 @@ private void OnHallucinationsDiseaseInit(EntityUid uid, HallucinationsDiseaseCom
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,
$"{ToPrettyString(uid):player} began to hallucinate.");
}
Expand All @@ -87,7 +87,7 @@ private void OnHallucinationsShutdown(EntityUid uid, HallucinationsComponent com
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,
$"{ToPrettyString(uid):player} stopped hallucinating.");
}
Expand All @@ -98,7 +98,7 @@ private void OnHallucinationsDiseaseShutdown(EntityUid uid, HallucinationsDiseas
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,
$"{ToPrettyString(uid):player} stopped hallucinating.");
}
Expand Down
12 changes: 6 additions & 6 deletions Content.Server/ADT/Phantom/EntitySystems/PhantomSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ private void OnStatusEnded(EntityUid uid, PhantomComponent component, StatusEffe
/// <param name="args">Event</param>
private void OnRequestStyleMenu(EntityUid uid, PhantomComponent component, OpenPhantomStylesMenuActionEvent args)
{
if (_entityManager.TryGetComponent<ActorComponent?>(uid, out var actorComponent))
if (_mindSystem.TryGetMind(uid, out _, out var mind) && mind.Session != null)
{
var ev = new RequestPhantomStyleMenuEvent(GetNetEntity(uid));

Expand All @@ -304,7 +304,7 @@ private void OnRequestStyleMenu(EntityUid uid, PhantomComponent component, OpenP
ev.Prototypes.Add(prototype.ID);
}
ev.Prototypes.Sort();
RaiseNetworkEvent(ev, actorComponent.PlayerSession);
RaiseNetworkEvent(ev, mind.Session);
}
}

Expand Down Expand Up @@ -348,7 +348,7 @@ private void OnRequestFreedomMenu(EntityUid uid, PhantomComponent component, Fre
return;
}

if (_entityManager.TryGetComponent<ActorComponent?>(uid, out var actorComponent))
if (_mindSystem.TryGetMind(uid, out _, out var mind) && mind.Session != null)
{
var ev = new RequestPhantomFreedomMenuEvent(GetNetEntity(uid));

Expand All @@ -367,7 +367,7 @@ private void OnRequestFreedomMenu(EntityUid uid, PhantomComponent component, Fre
}
}
ev.Prototypes.Sort();
RaiseNetworkEvent(ev, actorComponent.PlayerSession);
RaiseNetworkEvent(ev, mind.Session);
}

args.Handled = true;
Expand Down Expand Up @@ -423,7 +423,7 @@ private void OnRequestVesselMenu(EntityUid uid, PhantomComponent component, Haun
return;

}
if (_entityManager.TryGetComponent<ActorComponent?>(uid, out var actorComponent))
if (_mindSystem.TryGetMind(uid, out _, out var mind) && mind.Session != null)
{
var ev = new RequestPhantomVesselMenuEvent(GetNetEntity(uid), new());

Expand Down Expand Up @@ -477,7 +477,7 @@ private void OnRequestVesselMenu(EntityUid uid, PhantomComponent component, Haun
ev.Vessels.Add((netEnt, profile, meta.EntityName));
}
ev.Vessels.Sort();
RaiseNetworkEvent(ev, actorComponent.PlayerSession);
RaiseNetworkEvent(ev, mind.Session);
}

args.Handled = true;
Expand Down
9 changes: 8 additions & 1 deletion Content.Server/Chat/Systems/ChatSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ public void DispatchStationAnnouncement(
#endregion

#region Private API

private void SendEntitySpeak(
EntityUid source,
string originalMessage,
Expand Down Expand Up @@ -460,6 +460,10 @@ private void SendEntitySpeak(
}
// ADT Languages end

if (string.IsNullOrEmpty(FormattedMessage.EscapeText(coloredMessage))) // ADT Chat fix
return;


name = FormattedMessage.EscapeText(name);
var wrappedMessage = Loc.GetString(speech.Bold ? "chat-manager-entity-say-bold-wrap-message" : "chat-manager-entity-say-wrap-message",
("entityName", name),
Expand Down Expand Up @@ -597,6 +601,9 @@ private void SendEntityWhisper(
language = _language.GetCurrentLanguage(source);
// ADT Languages end

if (string.IsNullOrEmpty(FormattedMessage.EscapeText(coloredMessage))) // ADT Chat fix
return;

foreach (var (session, data) in GetRecipients(source, WhisperMuffledRange))
{
EntityUid listener;
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Eye/VisibilityFlags.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public enum VisibilityFlags : int
Normal = 1 << 0,
Ghost = 1 << 1, // ADT Phantom
PhantomVessel = 2 << 1, // ADT Phantom
BaseHallucination = 3 << 1, // ADT Phantom
BaseHallucination = 4 << 1, // ADT Phantom

}
}
2 changes: 2 additions & 0 deletions Resources/Prototypes/ADT/StatusEffects/starvation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- type: statusEffect
id: ADTStarvation
1 change: 1 addition & 0 deletions Resources/Prototypes/Entities/Mobs/Species/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@
- StaminaModifier
- Flashed
- ADTHallucinations
- ADTStarvation
- type: Body
prototype: Human
requiredLegs: 2
Expand Down
Loading