Заебали ваши флаффы

This commit is contained in:
Aviu00
2024-01-17 10:25:01 +03:00
parent 5954d821c5
commit 76685eaf1c
4 changed files with 46 additions and 30 deletions

View File

@@ -1,26 +1,19 @@
using Content.Shared.Actions.ActionTypes;
using Robust.Shared.Utility;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.White.Other.CustomFluffSystems.Pets;
[RegisterComponent]
public sealed class PetSummonComponent : Component
public sealed partial class PetSummonComponent : Component
{
public InstantAction PetSummonAction = new()
{
Icon = new SpriteSpecifier.Texture(new ResPath("Objects/Misc/books.rsi/summon_book.png")),
DisplayName = "Призыв",
Description = "Призыв питомца БЕЗ возможности вселения призрака",
Event = new PetSummonActionEvent()
};
[DataField("petSummonAction", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
public string PetSummonAction = "PetSummonAction";
public InstantAction PetGhostSummonAction = new()
{
Icon = new SpriteSpecifier.Texture(new ResPath("Mobs/Ghosts/ghost_human.rsi/icon.png")),
DisplayName = "Призрачный призыв",
Description = "Призыв питомца С возможностью вселения призрака",
Event = new PetGhostSummonActionEvent()
};
[DataField("petGhostSummonAction", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
public string PetGhostSummonAction = "PetGhostSummonAction";
[DataField("petSummonActionEntity")] public EntityUid? PetSummonActionEntity;
[DataField("petGhostSummonActionEntity")] public EntityUid? PetGhostSummonActionEntity;
public int UsesLeft = 10;

View File

@@ -2,12 +2,12 @@
using Content.Shared.ActionBlocker;
using Content.Shared.Actions;
using Content.Shared.Examine;
using Content.Shared.Item;
using Content.Shared.Mobs;
using Content.Shared.Mobs.Components;
using Content.Shared.Popups;
using Content.Shared.Verbs;
using Robust.Server.GameObjects;
using Content.Shared.White.Events;
using Robust.Shared.Player;
namespace Content.Server.White.Other.CustomFluffSystems.Pets;
@@ -16,7 +16,6 @@ public sealed class PetSummonSystem : EntitySystem
[Dependency] private readonly ActionBlockerSystem _blocker = default!;
[Dependency] private readonly SharedPopupSystem _popupSystem = default!;
[Dependency] private readonly IEntityManager _entityManager = default!;
[Dependency] private readonly SharedActionsSystem _actions = default!;
private IReadOnlyDictionary<string, string> MobMap = new Dictionary<string, string>()
{
@@ -158,15 +157,7 @@ public sealed class PetSummonSystem : EntitySystem
private void GetSummonAction(EntityUid uid, PetSummonComponent component, GetItemActionsEvent args)
{
args.Actions.Add(component.PetSummonAction);
args.Actions.Add(component.PetGhostSummonAction);
args.AddAction(ref component.PetSummonActionEntity, component.PetSummonAction);
args.AddAction(ref component.PetGhostSummonActionEntity, component.PetGhostSummonAction);
}
}
public sealed class PetSummonActionEvent : InstantActionEvent
{
}
public sealed class PetGhostSummonActionEvent : InstantActionEvent
{
}

View File

@@ -0,0 +1,11 @@
using Content.Shared.Actions;
namespace Content.Shared.White.Events;
public sealed partial class PetSummonActionEvent : InstantActionEvent
{
}
public sealed partial class PetGhostSummonActionEvent : InstantActionEvent
{
}

View File

@@ -0,0 +1,21 @@
- type: entity
id: PetSummonAction
name: Призыв
description: Призыв питомца БЕЗ возможности вселения призрака
noSpawn: true
components:
- type: InstantAction
icon: { sprite: Objects/Misc/books.rsi, state: summon_book }
event: !type:PetSummonActionEvent {}
useDelay: 1
- type: entity
id: PetGhostSummonAction
name: Призрачный призыв
description: Призыв питомца С возможностью вселения призрака
noSpawn: true
components:
- type: InstantAction
icon: { sprite: Mobs/Ghosts/ghost_human.rsi, state: icon }
event: !type:PetGhostSummonActionEvent {}
useDelay: 1