+++ /dev/null
-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 EntProtoId GerasAction = "ActionMorphGeras";
-
- [DataField] public EntityUid? GerasActionEntity;
-}
+++ /dev/null
-using Content.Server.Polymorph.Systems;
-using Content.Shared.Zombies;
-using Content.Server.Actions;
-using Content.Server.Popups;
-using Content.Shared.Geras;
-using Robust.Shared.Player;
-
-namespace Content.Server.Geras;
-
-/// <inheritdoc/>
-public sealed class GerasSystem : SharedGerasSystem
-{
- [Dependency] private readonly PolymorphSystem _polymorphSystem = default!;
- [Dependency] private readonly ActionsSystem _actionsSystem = default!;
- [Dependency] private readonly PopupSystem _popupSystem = default!;
-
- /// <inheritdoc/>
- public override void Initialize()
- {
- 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)
- {
- // try to add geras action
- _actionsSystem.AddAction(uid, ref component.GerasActionEntity, component.GerasAction);
- }
-
- 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)
- 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);
-
- args.Handled = true;
- }
-}
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.
- components:
- - type: ConfirmableAction
- popup: gera-transformation-popup
- - type: InstantAction
- 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
rootTask:
task: SimpleHostileCompound
-- type: entity
- name: geras
- description: A geras of a slime - the name is ironic, isn't it?
- id: MobSlimesGeras
- parent: BaseMobAdultSlimes
- categories: [ HideSpawnMenu ]
- 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
- - 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
id: MobAdultSlimesBlue