From bc4969a0490bf9e032c32101f4e7a6a7793c66db Mon Sep 17 00:00:00 2001 From: NameLunar Date: Tue, 7 Jan 2025 22:08:55 +0700 Subject: [PATCH] [Upd] --- Content.Server/ADT/Abilities/XenoQueen/XenoQueenSystem.cs | 5 +++-- Content.Shared/ADT/Actions/SpawnWallActionEvent.cs | 2 ++ Resources/Prototypes/ADT/Actions/XenoQueen.yml | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Content.Server/ADT/Abilities/XenoQueen/XenoQueenSystem.cs b/Content.Server/ADT/Abilities/XenoQueen/XenoQueenSystem.cs index c43540cc07a..c4622eaab95 100644 --- a/Content.Server/ADT/Abilities/XenoQueen/XenoQueenSystem.cs +++ b/Content.Server/ADT/Abilities/XenoQueen/XenoQueenSystem.cs @@ -105,8 +105,9 @@ private void OnCreateTurret(EntityUid uid, XenoQueenComponent component, SpawnWa if (_container.IsEntityOrParentInContainer(uid)) return; - if (component.BloobCount >= 25) // В будущем заменю на переменную, а сейчас пусть катсыль + if (component.BloobCount >= args.Cost) { + component.BloobCount -= args.Cost.Value; var xform = Transform(uid); // Get the tile in front of the Queen var offsetValue = xform.LocalRotation.ToWorldVec(); @@ -130,7 +131,7 @@ private void OnCreateTurret(EntityUid uid, XenoQueenComponent component, SpawnWa } else { - _popupSystem.PopupEntity(Loc.GetString("queen-no-bloob-count", ("CountBloob", 20 - component.BloobCount)), uid); // Заменю в будущем + _popupSystem.PopupEntity(Loc.GetString("queen-no-bloob-count", ("CountBloob", args.Cost.GetValueOrDefault() - component.BloobCount)), uid); // Заменю в будущем } UpdateAlertShow(uid, component); } diff --git a/Content.Shared/ADT/Actions/SpawnWallActionEvent.cs b/Content.Shared/ADT/Actions/SpawnWallActionEvent.cs index e76ec675a0a..1e2406d610c 100644 --- a/Content.Shared/ADT/Actions/SpawnWallActionEvent.cs +++ b/Content.Shared/ADT/Actions/SpawnWallActionEvent.cs @@ -4,4 +4,6 @@ namespace Content.Shared.ADT.Events; public sealed partial class SpawnWallActionEvent : InstantActionEvent { + [DataField] + public int? Cost { get; private set; } } diff --git a/Resources/Prototypes/ADT/Actions/XenoQueen.yml b/Resources/Prototypes/ADT/Actions/XenoQueen.yml index e5a1ef9fb01..0d959ee1f36 100644 --- a/Resources/Prototypes/ADT/Actions/XenoQueen.yml +++ b/Resources/Prototypes/ADT/Actions/XenoQueen.yml @@ -11,6 +11,8 @@ sprite: Objects/Weapons/Guns/Turrets/xenoturret.rsi state: icon event: !type:SpawnWallActionEvent + prototypes: + cost: 25 # Я не смог сделать отдельный ивент для спавнта турели. Он не видел прототип ивента. - type: entity