Skip to content

Commit

Permalink
com2
Browse files Browse the repository at this point in the history
  • Loading branch information
NameLunar committed Nov 26, 2024
1 parent 726ab3f commit 17c5971
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions Content.Server/Holiday/Christmas/RandomGiftSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ public sealed class RandomGiftSystem : EntitySystem

private readonly List<string> _possibleGiftsSafe = new();
private readonly List<string> _possibleGiftsUnsafe = new();
private readonly List<string> _possibleGiftsUnsafeADT = new(); // Лист подарочков ЧЕК
// ADT
private readonly List<string> _possibleGiftsUnsafeADT = new();
// END

/// <inheritdoc/>
public override void Initialize()
Expand Down Expand Up @@ -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);
}
Expand All @@ -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));
Expand All @@ -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)
Expand All @@ -116,8 +120,7 @@ private void BuildIndex()
else
continue;
}
//Его конец

// END
if (!proto.Components.ContainsKey(itemCompName))
continue;
_possibleGiftsSafe.Add(proto.ID);
Expand Down

0 comments on commit 17c5971

Please sign in to comment.