]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Geras bug fixes (#27308)
authorJust-a-Unity-Dev <67359748+Just-a-Unity-Dev@users.noreply.github.com>
Fri, 3 May 2024 17:26:09 +0000 (17:26 +0000)
committerGitHub <noreply@github.com>
Fri, 3 May 2024 17:26:09 +0000 (19:26 +0200)
* Geras bug fixes

* oops

* its as shrimple as that

toggled transferName in the polymorph yml instead of using the system to manually change it

* its as shrimple as that (2.0)

fixed reviews for zombies having a dummy action, instead - properly implemented removal of action

* its as shrimple as that (3.0)

fixed tests by removing nameidentifier from slime (its already inherited, anyway)

Content.Server/Geras/GerasSystem.cs
Content.Shared/Geras/SharedGerasSystem.cs
Resources/Prototypes/Entities/Mobs/NPCs/slimes.yml
Resources/Prototypes/Polymorphs/polymorph.yml

index e25ea8f0283b29b48485410741a3ead3236b460d..e7999d64d8720a9a344954a187e0ee0b9728e7c7 100644 (file)
@@ -1,7 +1,7 @@
-using Content.Server.Actions;
 using Content.Server.Polymorph.Systems;
+using Content.Shared.Zombies;
+using Content.Server.Actions;
 using Content.Server.Popups;
-using Content.Shared.Actions;
 using Content.Shared.Geras;
 using Robust.Shared.Player;
 
@@ -10,8 +10,9 @@ namespace Content.Server.Geras;
 /// <inheritdoc/>
 public sealed class GerasSystem : SharedGerasSystem
 {
-    [Dependency] private readonly ActionsSystem _actionsSystem = default!;
     [Dependency] private readonly PolymorphSystem _polymorphSystem = default!;
+    [Dependency] private readonly MetaDataSystem _metaDataSystem = default!;
+    [Dependency] private readonly ActionsSystem _actionsSystem = default!;
     [Dependency] private readonly PopupSystem _popupSystem = default!;
 
     /// <inheritdoc/>
@@ -19,6 +20,12 @@ public sealed class GerasSystem : SharedGerasSystem
     {
         SubscribeLocalEvent<GerasComponent, MorphIntoGeras>(OnMorphIntoGeras);
         SubscribeLocalEvent<GerasComponent, MapInitEvent>(OnMapInit);
+        SubscribeLocalEvent<GerasComponent, EntityZombifiedEvent>(OnZombification);
+    }
+
+    private void OnZombification(EntityUid uid, GerasComponent component, EntityZombifiedEvent args)
+    {
+        _actionsSystem.RemoveAction(uid, component.GerasActionEntity);
     }
 
     private void OnMapInit(EntityUid uid, GerasComponent component, MapInitEvent args)
@@ -29,6 +36,9 @@ public sealed class GerasSystem : SharedGerasSystem
 
     private void OnMorphIntoGeras(EntityUid uid, GerasComponent component, MorphIntoGeras args)
     {
+        if (HasComp<ZombieComponent>(uid))
+            return; // i hate zomber.
+
         var ent = _polymorphSystem.PolymorphEntity(uid, component.GerasPolymorphId);
 
         if (!ent.HasValue)
@@ -36,6 +46,7 @@ public sealed class GerasSystem : SharedGerasSystem
 
         _popupSystem.PopupEntity(Loc.GetString("geras-popup-morph-message-others", ("entity", ent.Value)), ent.Value, Filter.PvsExcept(ent.Value), true);
         _popupSystem.PopupEntity(Loc.GetString("geras-popup-morph-message-user"), ent.Value, ent.Value);
+
         args.Handled = true;
     }
 }
index f5dea466a2ede1ec50e48b30e2d0cc6e632a79f7..8c998371b64a63e9943effcfb4962c142cc84525 100644 (file)
@@ -3,7 +3,7 @@ using Content.Shared.Actions;
 namespace Content.Shared.Geras;
 
 /// <summary>
-/// A Geras is the small morph of a slime. This system handles exactly that.
+/// Geras is the god of old age, and A geras is the small morph of a slime. This system allows the slimes to have the morphing action.
 /// </summary>
 public abstract class SharedGerasSystem : EntitySystem
 {
index 00de0180256fbdb8a9e3720095fb340428fde231..b3a80f90c76292d7e032d5ac8cdb43f2ce131d7d 100644 (file)
   noSpawn: true
   components:
   # they portable...
+  - type: MovementSpeedModifier
+    baseWalkSpeed: 3
+    baseSprintSpeed: 5 # +.5 from normal movement speed
+  - type: MobThresholds
+    thresholds:
+      0: Alive
+      80: Dead # weak af tho
+  - type: NpcFactionMember
+    factions:
+    - NanoTrasen
   - type: MultiHandedItem
   - type: Item
     size: Huge
index ce89f41d374a1d9d53197fc7fc0e25ab9cd26458..582f69b744ed3541468a1965b6fc80a27b763a1a 100644 (file)
@@ -79,7 +79,7 @@
   id: SlimeMorphGeras
   configuration:
     entity: MobSlimesGeras
-    transferName: false
+    transferName: true
     transferHumanoidAppearance: false
     inventory: Drop
     transferDamage: true