From 76ecdee94604f3cc73aba8b09d7bb36125a069e4 Mon Sep 17 00:00:00 2001
From: Just-a-Unity-Dev <67359748+Just-a-Unity-Dev@users.noreply.github.com>
Date: Fri, 3 May 2024 17:26:09 +0000
Subject: [PATCH] Geras bug fixes (#27308)
* 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 | 17 ++++++++++++++---
Content.Shared/Geras/SharedGerasSystem.cs | 2 +-
.../Prototypes/Entities/Mobs/NPCs/slimes.yml | 10 ++++++++++
Resources/Prototypes/Polymorphs/polymorph.yml | 2 +-
4 files changed, 26 insertions(+), 5 deletions(-)
diff --git a/Content.Server/Geras/GerasSystem.cs b/Content.Server/Geras/GerasSystem.cs
index e25ea8f028..e7999d64d8 100644
--- a/Content.Server/Geras/GerasSystem.cs
+++ b/Content.Server/Geras/GerasSystem.cs
@@ -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;
///
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!;
///
@@ -19,6 +20,12 @@ public sealed class GerasSystem : SharedGerasSystem
{
SubscribeLocalEvent(OnMorphIntoGeras);
SubscribeLocalEvent(OnMapInit);
+ SubscribeLocalEvent(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(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;
}
}
diff --git a/Content.Shared/Geras/SharedGerasSystem.cs b/Content.Shared/Geras/SharedGerasSystem.cs
index f5dea466a2..8c998371b6 100644
--- a/Content.Shared/Geras/SharedGerasSystem.cs
+++ b/Content.Shared/Geras/SharedGerasSystem.cs
@@ -3,7 +3,7 @@ using Content.Shared.Actions;
namespace Content.Shared.Geras;
///
-/// 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.
///
public abstract class SharedGerasSystem : EntitySystem
{
diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/slimes.yml b/Resources/Prototypes/Entities/Mobs/NPCs/slimes.yml
index 00de018025..b3a80f90c7 100644
--- a/Resources/Prototypes/Entities/Mobs/NPCs/slimes.yml
+++ b/Resources/Prototypes/Entities/Mobs/NPCs/slimes.yml
@@ -147,6 +147,16 @@
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
diff --git a/Resources/Prototypes/Polymorphs/polymorph.yml b/Resources/Prototypes/Polymorphs/polymorph.yml
index ce89f41d37..582f69b744 100644
--- a/Resources/Prototypes/Polymorphs/polymorph.yml
+++ b/Resources/Prototypes/Polymorphs/polymorph.yml
@@ -79,7 +79,7 @@
id: SlimeMorphGeras
configuration:
entity: MobSlimesGeras
- transferName: false
+ transferName: true
transferHumanoidAppearance: false
inventory: Drop
transferDamage: true