From 17c5971bdefb8ea30826a3615b125dfafe480826 Mon Sep 17 00:00:00 2001 From: NameLunar Date: Tue, 26 Nov 2024 22:33:47 +0700 Subject: [PATCH] com2 --- .../Holiday/Christmas/RandomGiftSystem.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Content.Server/Holiday/Christmas/RandomGiftSystem.cs b/Content.Server/Holiday/Christmas/RandomGiftSystem.cs index 42821655dd..ea88438dd7 100644 --- a/Content.Server/Holiday/Christmas/RandomGiftSystem.cs +++ b/Content.Server/Holiday/Christmas/RandomGiftSystem.cs @@ -29,7 +29,9 @@ public sealed class RandomGiftSystem : EntitySystem private readonly List _possibleGiftsSafe = new(); private readonly List _possibleGiftsUnsafe = new(); - private readonly List _possibleGiftsUnsafeADT = new(); // Лист подарочков ЧЕК + // ADT + private readonly List _possibleGiftsUnsafeADT = new(); + // END /// public override void Initialize() @@ -74,13 +76,14 @@ private void OnUseInHand(EntityUid uid, RandomGiftComponent component, UseInHand private void OnGiftMapInit(EntityUid uid, RandomGiftComponent component, MapInitEvent args) { - // Думаю всё понятно. Если компонент объекта имеет "InsaneMode" с знчением, то вот. Иначе... Else if (component.InsaneMode == "Unsafe") component.SelectedEntity = _random.Pick(_possibleGiftsUnsafe); else if (component.InsaneMode == "Safe") component.SelectedEntity = _random.Pick(_possibleGiftsSafe); + // ADT else if (component.InsaneMode == "ADTUnsafe") component.SelectedEntity = _random.Pick(_possibleGiftsUnsafeADT); + // END else component.SelectedEntity = _random.Pick(_possibleGiftsSafe); } @@ -93,10 +96,11 @@ private void OnPrototypesReloaded(PrototypesReloadedEventArgs obj) private void BuildIndex() { - // Ну тут тоже все понятно. Очищается лист, что создан сверху _possibleGiftsSafe.Clear(); _possibleGiftsUnsafe.Clear(); + // ADT _possibleGiftsUnsafeADT.Clear(); + // END var itemCompName = _componentFactory.GetComponentName(typeof(ItemComponent)); var mapGridCompName = _componentFactory.GetComponentName(typeof(MapGridComponent)); var physicsCompName = _componentFactory.GetComponentName(typeof(PhysicsComponent)); @@ -107,7 +111,7 @@ private void BuildIndex() continue; _possibleGiftsUnsafe.Add(proto.ID); - // Начало говнокода + // ADT if (proto.Components.TryGetValue("Physics", out var value)) { if (value.Mapping.Count > 0) @@ -116,8 +120,7 @@ private void BuildIndex() else continue; } - //Его конец - + // END if (!proto.Components.ContainsKey(itemCompName)) continue; _possibleGiftsSafe.Add(proto.ID);