]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Change atmos plaques to yaml (#37318)
authorNemanja <98561806+EmoGarbage404@users.noreply.github.com>
Sat, 10 May 2025 00:24:07 +0000 (20:24 -0400)
committerGitHub <noreply@github.com>
Sat, 10 May 2025 00:24:07 +0000 (02:24 +0200)
* Change atmos plaques to yaml

* remove locale strings

Content.Server/Atmos/Components/AtmosPlaqueComponent.cs [deleted file]
Content.Server/Atmos/EntitySystems/AtmosPlaqueSystem.cs [deleted file]
Content.Shared/Atmos/Visuals/AtmosPlaqueVisuals.cs [deleted file]
Resources/Locale/en-US/atmos/plaque-component.ftl [deleted file]
Resources/Prototypes/Entities/Structures/Wallmounts/Signs/atmos_plaque.yml

diff --git a/Content.Server/Atmos/Components/AtmosPlaqueComponent.cs b/Content.Server/Atmos/Components/AtmosPlaqueComponent.cs
deleted file mode 100644 (file)
index 3332d22..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-using Content.Server.Atmos.EntitySystems;
-
-namespace Content.Server.Atmos.Components
-{
-    [RegisterComponent]
-    public sealed partial class AtmosPlaqueComponent : Component
-    {
-        [DataField("plaqueType")] public PlaqueType Type = PlaqueType.Unset;
-
-        [ViewVariables(VVAccess.ReadWrite)]
-        public PlaqueType TypeVV
-        {
-            get => Type;
-            set
-            {
-                Type = value;
-                IoCManager.Resolve<IEntityManager>().System<AtmosPlaqueSystem>().UpdateSign(Owner, this);
-            }
-        }
-    }
-}
diff --git a/Content.Server/Atmos/EntitySystems/AtmosPlaqueSystem.cs b/Content.Server/Atmos/EntitySystems/AtmosPlaqueSystem.cs
deleted file mode 100644 (file)
index 0d7cdec..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-using Content.Server.Atmos.Components;
-using Content.Shared.Atmos.Visuals;
-using Robust.Server.GameObjects;
-using Robust.Shared.Random;
-
-namespace Content.Server.Atmos.EntitySystems;
-
-public sealed class AtmosPlaqueSystem : EntitySystem
-{
-    [Dependency] private readonly IRobustRandom _random = default!;
-    [Dependency] private readonly SharedAppearanceSystem _appearance = default!;
-    [Dependency] private readonly MetaDataSystem _metaData = default!;
-
-    public override void Initialize()
-    {
-        base.Initialize();
-        SubscribeLocalEvent<AtmosPlaqueComponent, MapInitEvent>(OnPlaqueMapInit);
-    }
-
-    private void OnPlaqueMapInit(EntityUid uid, AtmosPlaqueComponent component, MapInitEvent args)
-    {
-        var rand = _random.Next(100);
-        // Let's not pat ourselves on the back too hard.
-        // 1% chance of zumos
-        if (rand == 0) component.Type = PlaqueType.Zumos;
-        // 9% FEA
-        else if (rand <= 10) component.Type = PlaqueType.Fea;
-        // 45% ZAS
-        else if (rand <= 55) component.Type = PlaqueType.Zas;
-        // 45% LINDA
-        else component.Type = PlaqueType.Linda;
-
-        UpdateSign(uid, component);
-    }
-
-    public void UpdateSign(EntityUid uid, AtmosPlaqueComponent component)
-    {
-        var metaData = MetaData(uid);
-
-        var val = component.Type switch
-        {
-            PlaqueType.Zumos =>
-                Loc.GetString("atmos-plaque-component-desc-zum"),
-            PlaqueType.Fea =>
-                Loc.GetString("atmos-plaque-component-desc-fea"),
-            PlaqueType.Linda =>
-                Loc.GetString("atmos-plaque-component-desc-linda"),
-            PlaqueType.Zas =>
-                Loc.GetString("atmos-plaque-component-desc-zas"),
-            PlaqueType.Unset => Loc.GetString("atmos-plaque-component-desc-unset"),
-            _ => Loc.GetString("atmos-plaque-component-desc-unset"),
-        };
-
-        _metaData.SetEntityDescription(uid, val, metaData);
-
-        var val1 = component.Type switch
-        {
-            PlaqueType.Zumos =>
-                Loc.GetString("atmos-plaque-component-name-zum"),
-            PlaqueType.Fea =>
-                Loc.GetString("atmos-plaque-component-name-fea"),
-            PlaqueType.Linda =>
-                Loc.GetString("atmos-plaque-component-name-linda"),
-            PlaqueType.Zas =>
-                Loc.GetString("atmos-plaque-component-name-zas"),
-            PlaqueType.Unset => Loc.GetString("atmos-plaque-component-name-unset"),
-            _ => Loc.GetString("atmos-plaque-component-name-unset"),
-        };
-
-        _metaData.SetEntityName(uid, val1, metaData);
-
-        if (TryComp<AppearanceComponent>(uid, out var appearance))
-        {
-            var state = component.Type == PlaqueType.Zumos ? "zumosplaque" : "atmosplaque";
-
-            _appearance.SetData(uid, AtmosPlaqueVisuals.State, state, appearance);
-        }
-    }
-}
-
-// If you get the ZUM plaque it means your round will be blessed with good engineering luck.
-public enum PlaqueType : byte
-{
-    Unset = 0,
-    Zumos,
-    Fea,
-    Linda,
-    Zas
-}
diff --git a/Content.Shared/Atmos/Visuals/AtmosPlaqueVisuals.cs b/Content.Shared/Atmos/Visuals/AtmosPlaqueVisuals.cs
deleted file mode 100644 (file)
index 66b3a5b..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-using Robust.Shared.Serialization;
-
-namespace Content.Shared.Atmos.Visuals
-{
-    [Serializable, NetSerializable]
-    public enum AtmosPlaqueVisuals
-    {
-        State
-    }
-}
diff --git a/Resources/Locale/en-US/atmos/plaque-component.ftl b/Resources/Locale/en-US/atmos/plaque-component.ftl
deleted file mode 100644 (file)
index 9b2b23d..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-atmos-plaque-component-desc-zum = This plaque commemorates the rise of the Atmos ZUM division. May they carry the torch that the Atmos ZAS, LINDA and FEA divisions left behind.
-atmos-plaque-component-desc-fea = This plaque commemorates the fall of the Atmos FEA division. For all the charred, dizzy, and brittle men who have died in its hands.
-atmos-plaque-component-desc-linda =This plaque commemorates the fall of the Atmos LINDA division. For all the charred, dizzy, and brittle men who have died in its hands.
-atmos-plaque-component-desc-zas = This plaque commemorates the fall of the Atmos ZAS division. For all the charred, dizzy, and brittle men who have died in its hands.
-atmos-plaque-component-desc-unset = Uhm
-
-atmos-plaque-component-name-zum = ZUM Atmospherics Division plaque
-atmos-plaque-component-name-fea = FEA Atmospherics Division plaque
-atmos-plaque-component-name-linda = LINDA Atmospherics Division plaque
-atmos-plaque-component-name-zas = ZAS Atmospherics Division plaque
-atmos-plaque-component-name-unset = Uhm
\ No newline at end of file
index 3f6dd3723d521414ae1b11188e5524dfc4f5a242..08e0d4fb75fb65f18c186150f329216e6e870ab5 100644 (file)
@@ -1,28 +1,60 @@
 - type: entity
-  parent: BaseSign
+  parent: MarkerBase
   id: PlaqueAtmos
-  name: atmos plaque
+  name: atmos plaque spawner
+  suffix: Spawner
   components:
-  - type: WallMount
-  - type: Physics
-  - type: Fixtures
-    fixtures:
-      fix1:
-        shape:
-          !type:PhysShapeAabb
-          bounds: "-0.3,-0.3,0.3,0.3"
-        layer:
-        - MidImpassable
   - type: Sprite
-    drawdepth: WallMountedItems
     layers:
-      - state: atmosplaque
-        map: ["plaque"]
-  - type: Appearance
-  - type: GenericVisualizer
-    visuals:
-      enum.AtmosPlaqueVisuals.State:
-        plaque:
-          zumosplaque: { state: zumosplaque }
-          atmosplaque: { state: atmosplaque }
-  - type: AtmosPlaque
+    - state: green
+    - sprite: Structures/Wallmounts/signs.rsi
+      state: atmosplaque
+  - type: EntityTableSpawner
+    table: !type:GroupSelector
+      children:
+      - id: PlaqueAtmosZUM
+        weight: 1
+      - id: PlaqueAtmosFEA
+        weight: 9
+      - id: PlaqueAtmosZAS
+        weight: 45
+      - id: PlaqueAtmosLINDA
+        weight: 45
+    offset: 0.0
+
+# individual plaques aren't placeable. you will not defy the randomness.
+
+- type: entity
+  parent: BaseSign
+  id: PlaqueAtmosFEA
+  name: FEA Atmospherics Division plaque
+  description: This plaque commemorates the fall of the Atmos FEA division. For all the charred, dizzy, and brittle men who have died in its hands.
+  categories: [ HideSpawnMenu ]
+  components:
+  - type: Sprite
+    state: atmosplaque
+
+- type: entity
+  parent: PlaqueAtmosFEA
+  id: PlaqueAtmosLINDA
+  name: LINDA Atmospherics Division plaque
+  description: This plaque commemorates the fall of the Atmos LINDA division. For all the charred, dizzy, and brittle men who have died in its hands.
+  categories: [ HideSpawnMenu ]
+
+- type: entity
+  parent: PlaqueAtmosFEA
+  id: PlaqueAtmosZAS
+  name: ZAS Atmospherics Division plaque
+  description: This plaque commemorates the fall of the Atmos ZAS division. For all the charred, dizzy, and brittle men who have died in its hands.
+  categories: [ HideSpawnMenu ]
+
+# If you get the ZUM plaque it means your round will be blessed with good engineering luck.
+- type: entity
+  parent: PlaqueAtmosFEA
+  id: PlaqueAtmosZUM
+  name: ZUM Atmospherics Division plaque
+  description: This plaque commemorates the rise of the Atmos ZUM division. May they carry the torch that the Atmos ZAS, LINDA and FEA divisions left behind.
+  categories: [ HideSpawnMenu ]
+  components:
+  - type: Sprite
+    state: zumosplaque