]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
General slime improvements (#23425)
authorJust-a-Unity-Dev <67359748+Just-a-Unity-Dev@users.noreply.github.com>
Mon, 22 Apr 2024 10:03:03 +0000 (10:03 +0000)
committerGitHub <noreply@github.com>
Mon, 22 Apr 2024 10:03:03 +0000 (03:03 -0700)
* General slime improvements

* Finish morphing

* oops 2x2 not 3x3

* actually lets ball - 2x3 inventory

* Last two things on the todo list

* .\RobustToolbox\

* JUST COMPILE

* fix tests 2.0

* fix tests 3.0

* Do reviews

* minor change

* guideboob

* more

---------

Co-authored-by: Kara <lunarautomaton6@gmail.com>
Content.Server/Geras/GerasComponent.cs [new file with mode: 0644]
Content.Server/Geras/GerasSystem.cs [new file with mode: 0644]
Content.Server/Storage/EntitySystems/StorageSystem.cs
Content.Shared/Geras/SharedGerasSystem.cs [new file with mode: 0644]
Resources/Locale/en-US/components/storage-component.ftl
Resources/Locale/en-US/geras/geras.ftl [new file with mode: 0644]
Resources/Prototypes/Actions/types.yml
Resources/Prototypes/Entities/Mobs/NPCs/slimes.yml
Resources/Prototypes/Entities/Mobs/Species/slime.yml
Resources/Prototypes/Polymorphs/polymorph.yml
Resources/ServerInfo/Guidebook/Mobs/SlimePerson.xml

diff --git a/Content.Server/Geras/GerasComponent.cs b/Content.Server/Geras/GerasComponent.cs
new file mode 100644 (file)
index 0000000..eaf7925
--- /dev/null
@@ -0,0 +1,18 @@
+using Content.Shared.Actions;
+using Content.Shared.Polymorph;
+using Robust.Shared.Prototypes;
+
+namespace Content.Server.Geras;
+
+/// <summary>
+/// This component assigns the entity with a polymorph action.
+/// </summary>
+[RegisterComponent]
+public sealed partial class GerasComponent : Component
+{
+    [DataField] public ProtoId<PolymorphPrototype> GerasPolymorphId = "SlimeMorphGeras";
+
+    [DataField] public ProtoId<EntityPrototype> GerasAction = "ActionMorphGeras";
+
+    [DataField] public EntityUid? GerasActionEntity;
+}
diff --git a/Content.Server/Geras/GerasSystem.cs b/Content.Server/Geras/GerasSystem.cs
new file mode 100644 (file)
index 0000000..a5377a0
--- /dev/null
@@ -0,0 +1,40 @@
+using Content.Server.Actions;
+using Content.Server.Polymorph.Systems;
+using Content.Server.Popups;
+using Content.Shared.Actions;
+using Content.Shared.Geras;
+using Robust.Shared.Player;
+
+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 PopupSystem _popupSystem = default!;
+
+    /// <inheritdoc/>
+    public override void Initialize()
+    {
+        SubscribeLocalEvent<GerasComponent, MorphIntoGeras>(OnMorphIntoGeras);
+        SubscribeLocalEvent<GerasComponent, MapInitEvent>(OnMapInit);
+    }
+
+    private void OnMapInit(EntityUid uid, GerasComponent component, MapInitEvent args)
+    {
+        // try to add geras action
+        _actionsSystem.AddAction(uid, ref component.GerasActionEntity, component.GerasAction);
+    }
+
+    private void OnMorphIntoGeras(EntityUid uid, GerasComponent component, MorphIntoGeras args)
+    {
+        var ent = _polymorphSystem.PolymorphEntity(uid, component.GerasPolymorphId);
+
+        if (!ent.HasValue)
+            return;
+
+        _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);
+    }
+}
index 27694ee61c481564940cddea6818c0e6dcde0185..5d41e0a52140f2ef05c4fc2145aa69a4bb0e5359 100644 (file)
@@ -76,13 +76,13 @@ public sealed partial class StorageSystem : SharedStorageSystem
         };
         if (uiOpen)
         {
-            verb.Text = Loc.GetString("verb-common-close-ui");
+            verb.Text = Loc.GetString("comp-storage-verb-close-storage");
             verb.Icon = new SpriteSpecifier.Texture(
                 new("/Textures/Interface/VerbIcons/close.svg.192dpi.png"));
         }
         else
         {
-            verb.Text = Loc.GetString("verb-common-open-ui");
+            verb.Text = Loc.GetString("comp-storage-verb-open-storage");
             verb.Icon = new SpriteSpecifier.Texture(
                 new("/Textures/Interface/VerbIcons/open.svg.192dpi.png"));
         }
diff --git a/Content.Shared/Geras/SharedGerasSystem.cs b/Content.Shared/Geras/SharedGerasSystem.cs
new file mode 100644 (file)
index 0000000..f5dea46
--- /dev/null
@@ -0,0 +1,16 @@
+using Content.Shared.Actions;
+
+namespace Content.Shared.Geras;
+
+/// <summary>
+/// A Geras is the small morph of a slime. This system handles exactly that.
+/// </summary>
+public abstract class SharedGerasSystem : EntitySystem
+{
+
+}
+
+public sealed partial class MorphIntoGeras : InstantActionEvent
+{
+
+}
index 29c858891af12150c415e39a9ffe7102697b6389..e742c83f6a6d3f08d9f8cd1109cb1d18278bfa47 100644 (file)
@@ -8,3 +8,5 @@ comp-storage-cant-drop = You can't let go of { THE($entity) }!
 comp-storage-window-title = Storage Item
 comp-storage-window-weight = { $weight }/{ $maxWeight }, Max Size: {$size}
 comp-storage-window-slots = Slots: { $itemCount }/{ $maxCount }, Max Size: {$size}
+comp-storage-verb-open-storage = Open Storage
+comp-storage-verb-close-storage = Close Storage
diff --git a/Resources/Locale/en-US/geras/geras.ftl b/Resources/Locale/en-US/geras/geras.ftl
new file mode 100644 (file)
index 0000000..3cd3f10
--- /dev/null
@@ -0,0 +1,2 @@
+geras-popup-morph-message-user = You shift and morph into a small version of you!
+geras-popup-morph-message-others = {CAPITALIZE(THE($entity))} shifts and morphs into a blob of slime!
index b91b26e35700810c9c53673e53f62160a5189d95..aeffd5b8c50414cbf50bb7cc0cca86e557b38656 100644 (file)
@@ -92,7 +92,6 @@
       state: gib
     event: !type:ActivateImplantEvent
 
-
 - type: entity
   id: ActionActivateFreedomImplant
   name: Break Free
       state: icon
     event: !type:UseDnaScramblerImplantEvent
 
+- type: entity
+  id: ActionMorphGeras
+  name: Morph into Geras
+  description:  Morphs you into a Geras - a miniature version of you which allows you to move fast, at the cost of your inventory.
+  noSpawn: true
+  components:
+  - type: InstantAction
+    charges: 1
+    itemIconStyle: BigAction
+    useDelay: 10 # prevent spam
+    priority: -20
+    icon:
+      sprite: Mobs/Aliens/slimes.rsi
+      state: blue_adult_slime
+    event: !type:MorphIntoGeras
+
 - type: entity
   id: ActionToggleSuitPiece
   name: Toggle Suit Piece
index 10e9218d6e46d04724c30cb30c227d84725a652b..95c30a174f2dd0d9d447edf5872f99b837dd525f 100644 (file)
@@ -1,16 +1,10 @@
 - type: entity
   name: basic slime
-  id: MobAdultSlimes
+  id: BaseMobAdultSlimes
   parent: [ SimpleMobBase, MobCombat ]
   abstract: true
   description: It looks so much like jelly. I wonder what it tastes like?
   components:
-  - type: NpcFactionMember
-    factions:
-    - SimpleNeutral
-  - type: HTN
-    rootTask:
-      task: SimpleHostileCompound
   - type: Sprite
     drawdepth: Mobs
     sprite: Mobs/Aliens/slimes.rsi
     successChance: 0.5
     interactSuccessString: petting-success-slimes
     interactFailureString: petting-failure-generic
+  - type: Speech
+    speechVerb: Slime
+    speechSounds: Slime
+  - type: TypingIndicator
+    proto: slime
+
+- type: entity
+  name: basic slime
+  id: MobAdultSlimes
+  parent: BaseMobAdultSlimes
+  abstract: true
+  description: It looks so much like jelly. I wonder what it tastes like?
+  components:
   - type: ReplacementAccent
     accent: slimes
   - type: GhostTakeoverAvailable
     makeSentient: true
     name: ghost-role-information-slimes-name
     description: ghost-role-information-slimes-description
-  - type: Speech
-    speechVerb: Slime
-    speechSounds: Slime
-  - type: TypingIndicator
-    proto: slime
+  - type: NpcFactionMember
+    factions:
+    - SimpleNeutral
+  - type: HTN
+    rootTask:
+      task: SimpleHostileCompound
+
+- type: entity
+  name: geras
+  description: A geras of a slime - the name is ironic, isn't it?
+  id: MobSlimesGeras
+  parent: BaseMobAdultSlimes
+  noSpawn: true
+  components:
+  # they portable...
+  - type: MultiHandedItem
+  - type: Item
+    size: Huge
+  - type: Sprite
+    color: "#FFFFFF55"
+  - type: MeleeWeapon
+    attackRate: 2
+    damage:
+      types:
+        Blunt: 4
+  - type: DamageStateVisuals
+    states:
+      Alive:
+        Base: blue_adult_slime
+      Dead:
+        Base: blue_adult_slime_dead
 
 - type: entity
   name: blue slime
index 3eabb7dc07119784923d5a3af7c022a04a740ca8..5599825a0c0026c2ebaf2427ad49f2dd0af23a3a 100644 (file)
   - type: Body
     prototype: Slime
     requiredLegs: 2
+  # they like eat it idk lol
+  - type: Storage
+    grid:
+    - 0,0,1,2
+    maxItemSize: Large
+    storageInsertSound:
+      path: /Audio/Voice/Slime/slime_squish.ogg
+  - type: ContainerContainer
+    containers:
+      storagebase: !type:Container
+        ents: []
+  - type: UserInterface
+    interfaces:
+    - key: enum.StorageUiKey.Key
+      type: StorageBoundUserInterface
+    - key: enum.VoiceMaskUIKey.Key
+      type: VoiceMaskBoundUserInterface
+    - key: enum.HumanoidMarkingModifierKey.Key
+      type: HumanoidMarkingModifierBoundUserInterface
+    - key: enum.StrippingUiKey.Key
+      type: StrippableBoundUserInterface
+  # to prevent bag open/honk spam
+  - type: UseDelay
+    delay: 0.5
   - type: HumanoidAppearance
     species: SlimePerson
   - type: Speech
   - type: Damageable
     damageContainer: Biological
     damageModifierSet: Slime
+  - type: Geras
+  - type: PassiveDamage # Around 8 damage a minute healed
+    allowedStates:
+    - Alive
+    damageCap: 65
+    damage:
+      types:
+        Heat: -0.14
+      groups:
+        Brute: -0.14
   - type: DamageVisuals
     damageOverlayGroups:
       Brute:
index b4249f8a3eaf108308b2c2661f3b8348bf468109..ce89f41d374a1d9d53197fc7fc0e25ab9cd26458 100644 (file)
     inventory: Transfer
     revertOnDeath: true
 
+- type: polymorph
+  id: SlimeMorphGeras
+  configuration:
+    entity: MobSlimesGeras
+    transferName: false
+    transferHumanoidAppearance: false
+    inventory: Drop
+    transferDamage: true
+    revertOnDeath: true
+    revertOnCrit: true
+
 # this is a test for transferring some visual appearance stuff
 - type: polymorph
   id: TestHumanMorph
index fc72c60dbf418747f2efbe2e9edce250d4c0a313..0374d4cb958c7772bfe290ba9b6903e8fd382b47 100644 (file)
   They exhale nitrous oxide and are unaffected by it.
   Their body can process 6 reagents at the same time instead of just 2.
 
-  Their Slime "blood" can not be regenerated from Iron. Slime Blood is technically a source of
+  Slimepeople can morph into a [bold]"geras"[/bold] (an archaic slimefolk term), which is a smaller slime form that can [bold]pass through grilles[/bold],
+  but forces them to drop their inventory and held items. It's handy for a quick getaway. A geras is small enough to pick up (with two hands)
+  and fits in a duffelbag.
+
+  <Box>
+    <GuideEntityEmbed Entity="MobSlimesGeras" Caption="A typical geras."/>
+  </Box>
+
+  Slimepeople have an [bold]internal 2x2 storage inventory[/bold] inside of their slime membrane. Anyone can see what's inside and take it out of you without asking,
+  so be careful. They [bold]don't drop their internal storage when they morph into a geras, however![/bold]
+
+  Slimepeople have slight accelerated regeneration compared to other humanoids. They're also capable of hardening their fists, and as such have stronger punches,
+  although they punch a little slower.
+
+  Their slime "blood" can not be regenerated from Iron. Slime Blood is technically a source of
   moderately filling food for other species, although drinking the blood of your coworkers is usually frowned upon.
   They suffocate 80% slower, but take pressure damage 9% faster. This makes them by far the species most capable to survive in hard vacuum. For a while.