From 4f95ffc0b806eac96212c0d466e2bf17de989da3 Mon Sep 17 00:00:00 2001
From: FaDeOkno <143940725+FaDeOkno@users.noreply.github.com>
Date: Thu, 15 Aug 2024 14:43:06 +0400
Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=B8=D0=B7=D0=B4=D0=B5=D1=86=20=D0=BA?=
=?UTF-8?q?=D0=B0=D0=BA=D0=BE=D0=B9=20=D1=84=D0=B8=D0=BA=D1=81=20(#274)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Исправил незнание языков фантомом
-->
:cl:
- fix: Фикс языков фантома
---
.../Components/UniversalLanguageSpeakerComponent.cs | 12 ++++++++++++
.../ADT/Language/Systems/SharedLanguageSystem.cs | 8 +++++++-
.../Prototypes/ADT/Entities/Mobs/Player/phantom.yml | 1 +
.../ADT/Entities/Mobs/Player/poltergeist.yml | 3 ++-
4 files changed, 22 insertions(+), 2 deletions(-)
create mode 100644 Content.Shared/ADT/Language/Components/UniversalLanguageSpeakerComponent.cs
diff --git a/Content.Shared/ADT/Language/Components/UniversalLanguageSpeakerComponent.cs b/Content.Shared/ADT/Language/Components/UniversalLanguageSpeakerComponent.cs
new file mode 100644
index 00000000000..e66ccf293c5
--- /dev/null
+++ b/Content.Shared/ADT/Language/Components/UniversalLanguageSpeakerComponent.cs
@@ -0,0 +1,12 @@
+using Robust.Shared.Prototypes;
+using Robust.Shared.GameStates;
+
+namespace Content.Shared.ADT.Language;
+
+///
+/// This component allows entity to speak and understand languages.
+///
+[RegisterComponent, NetworkedComponent]
+public sealed partial class UniversalLanguageSpeakerComponent : Component
+{
+}
diff --git a/Content.Shared/ADT/Language/Systems/SharedLanguageSystem.cs b/Content.Shared/ADT/Language/Systems/SharedLanguageSystem.cs
index 7e5748008d2..617ec4c879f 100644
--- a/Content.Shared/ADT/Language/Systems/SharedLanguageSystem.cs
+++ b/Content.Shared/ADT/Language/Systems/SharedLanguageSystem.cs
@@ -21,7 +21,7 @@ public abstract class SharedLanguageSystem : EntitySystem
public override void Initialize()
{
-
+
}
public bool CanSpeak(EntityUid uid, LanguagePrototype proto, LanguageSpeakerComponent? component = null)
@@ -29,6 +29,9 @@ public bool CanSpeak(EntityUid uid, LanguagePrototype proto, LanguageSpeakerComp
if (HasComp(uid))
return false;
+ if (HasComp(uid))
+ return true;
+
if (!Resolve(uid, ref component))
return false;
@@ -50,6 +53,9 @@ public bool CanUnderstand(EntityUid uid, LanguagePrototype proto, LanguageSpeake
if (HasComp(uid))
return true;
+ if (HasComp(uid))
+ return true;
+
if (!Resolve(uid, ref component))
return false;
diff --git a/Resources/Prototypes/ADT/Entities/Mobs/Player/phantom.yml b/Resources/Prototypes/ADT/Entities/Mobs/Player/phantom.yml
index 29e3e046f7c..213bc3e5cb3 100644
--- a/Resources/Prototypes/ADT/Entities/Mobs/Player/phantom.yml
+++ b/Resources/Prototypes/ADT/Entities/Mobs/Player/phantom.yml
@@ -75,6 +75,7 @@
- Universal
- type: TypingIndicator
proto: alien
+ - type: UniversalLanguageSpeaker
- type: entity
id: ADTPhantomReincarnationAnim
diff --git a/Resources/Prototypes/ADT/Entities/Mobs/Player/poltergeist.yml b/Resources/Prototypes/ADT/Entities/Mobs/Player/poltergeist.yml
index 28bf1d29033..5a21812fdd3 100644
--- a/Resources/Prototypes/ADT/Entities/Mobs/Player/poltergeist.yml
+++ b/Resources/Prototypes/ADT/Entities/Mobs/Player/poltergeist.yml
@@ -31,7 +31,7 @@
mask:
- GhostImpassable
- type: MovementIgnoreGravity
- gravityState: true
+ gravityState: true
- type: Damageable
damageContainer: Biological
- type: Examiner
@@ -60,3 +60,4 @@
- GalacticCommon
- type: Jetpack # да, костыль.
- type: OuijaBoardUser
+ - type: UniversalLanguageSpeaker