General slime improvements (#23425)

* 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>
This commit is contained in:
Just-a-Unity-Dev
2024-04-22 10:03:03 +00:00
committed by GitHub
parent af516cff61
commit fd0ca42c58
11 changed files with 201 additions and 16 deletions

View File

@@ -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;
}

View File

@@ -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);
}
}

View 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"));
}

View File

@@ -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
{
}

View 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

View File

@@ -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!

View File

@@ -92,7 +92,6 @@
state: gib
event: !type:ActivateImplantEvent
- type: entity
id: ActionActivateFreedomImplant
name: Break Free
@@ -171,6 +170,22 @@
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

View 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
@@ -111,6 +105,19 @@
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
@@ -118,11 +125,37 @@
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

View File

@@ -12,6 +12,30 @@
- 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
@@ -27,6 +51,16 @@
- 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:

View File

@@ -75,6 +75,17 @@
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

View File

@@ -10,7 +10,21 @@
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.