the initial commit to the repo.

This commit is contained in:
NukedBart 2025-10-25 01:27:14 +08:00
parent 025c032b8c
commit 1b757591b9
264 changed files with 21882 additions and 0 deletions

View file

@ -0,0 +1,135 @@
using System.Collections.Generic;
namespace stupid.solutions.stupid.solutions.Data;
internal class AiNames
{
public static readonly HashSet<string> RogueNames = new HashSet<string>
{
"Afraid", "Aimbotkin", "Andresto", "Applejuice", "Arizona", "Auron", "Badboy", "Baddie", "Beard", "Beverly",
"Bison", "Blackbird", "Blade", "Blakemore", "Boatswain", "Boogerman", "Brockley", "Browski", "Bullet", "Bunny",
"Butcher", "Chester", "Churchill", "Cliffhanger", "Condor", "Cook", "Corsair", "Cougar", "Coyote", "Crooked",
"Cross", "Dakota", "Dawg", "Deceit", "Denver", "Diggi", "Donutop", "Duke", "Dustin", "Enzo",
"Esquilo", "Father", "Firion", "Floridaman", "Foxy", "Frenzy", "Garandthumb", "Goat", "Golden", "Grandpa",
"Greyzone", "Grim", "Grommet", "Gunporn", "Handsome", "Haunted", "Hellshrimp", "Honorable", "Hypno", "Instructor",
"Iowa", "Ironfists", "James", "Jeff", "Jersey", "John", "Juggernaut", "Justkilo", "Kanzas", "Kentucky",
"Kry", "Lancaster", "Lee", "Legia", "Litton", "Lost", "Lunar", "Madknight", "Mamba", "Marooner",
"Meldon", "Melo", "Michigan", "Mike", "Momma", "Mortal", "Nevada", "Nine-hole", "Noisy", "Nukem",
"Ocean", "Oklahoma", "OneEye", "Oskar", "Panther", "Philbo", "Quebec", "Raccoon", "Rage", "Rambo",
"Rassler", "Rib-eye", "Riot", "Rock", "Rocket", "Ronflex", "Ronny", "RoughDog", "Scar", "Scottsdale",
"Seafarer", "Shadow", "SharkBait", "Sharkkiller", "Sherifu", "Sherman", "Shifty", "Slayer", "Sly", "Snake",
"Sneaky", "Sniperlife", "Solem", "Solidus", "Spectator-6", "Spyke", "Stamper", "Striker", "Texas", "Three-Teeth",
"Trent", "Trickster", "Triggerhappy", "Two-Finger", "Vicious", "Victor", "Voodoo", "Voss", "Wadley", "Walker",
"Weasel", "Whale-Eye", "Whisky", "Whitemane", "Woodrow", "Wrath", "Zed", "Zero-zero"
};
private static readonly HashSet<string> RaiderNames = new HashSet<string>
{
"Акула", "Балу", "Барракуда", "Барс", "Беркут", "Дикобраз", "Гадюка", "Гепард", "Гриф", "Гризли",
"Гюрза", "Ирбис", "Ягуар", "Калан", "Каракурт", "Кайман", "Кобра", "Кондор", "Крачун", "Красный",
"Кречет", "Леопард", "Лев", "Лис", "Логгерхед", "Мангуст", "Мантис", "Манул", "Медведь", "Могильник",
"Носорог", "Орёл", "Орлан", "Падальщик", "Пантера", "Пчел", "Пиранья", "Питон", "Пума", "Росомаха",
"Рысь", "Сапсан", "Секач", "Шакал", "Скорпион", "Стервятник", "Тарантул", "Тайпан", "Тигр", "Варан",
"Вепрь", "Волк", "Ворон", "Ястреб", "Зубр"
};
private static readonly HashSet<string> CultistNames = new HashSet<string> { "Жрец", "Сектант", "Культист" };
private static readonly HashSet<string> GuardNames = new HashSet<string>
{
"Baklazhan", "Banovyy", "Barmaley", "Basmach", "Bazil", "Begezhan", "Belyash", "Bibop", "Borzyy", "Cheburek",
"Dihlofos", "Dunya", "Filya", "Flamberg", "Flint", "Giyom", "Gladius", "Gromila", "Hoptod", "Hvost",
"Kant", "Karabin", "Karas", "Karman", "Kartezhnik", "Katorzhnik", "Kleymor", "Kolt", "Kompot", "Kopchenyy",
"Kudeyar", "Kuzya", "Lupa", "Mauzer", "Mazevyy", "Medoed", "Miposhka", "Moshennik", "Moydodyr", "Myakish",
"Paromchik", "Pashtet", "Poker", "Pupa", "Rezanyy", "Shtempel", "Sifon", "Sohatyy", "Supermen", "Tulup",
"Valeryanovich", "Valter", "Varan", "Vegan", "Venik", "Arsenal", "Basyak", "Begemotik", "Chelovek", "Dezhurka",
"Furazhka", "Gibbon", "Glavdur", "Kozyrek", "Krot", "Kucha", "Mayor", "Nikolay", "Omon", "Peps",
"Serzhant", "Slonolyub", "Sluzhebka", "Starley", "Starshiy", "Strelok", "Tatyanka", "Uchik", "Vasya", "Visyak",
"Dimon Svetloozerskiy", "Enchik Svetloozerskiy", "Kachok Svetloozerskiy", "Krysa Svetloozerskiy", "Malchik Svetloozerskiy", "Marat Svetloozerskiy", "Mels Svetloozerskiy", "Motyl Svetloozerskiy", "PaShok Svetloozerskiy", "Pljazhnik Svetloozerskiy",
"Robinzon Svetloozerskiy", "Sanja Svetloozerskiy", "Shmyga Svetloozerskiy", "Toha Svetloozerskiy", "Ugrjum Svetloozerskiy", "Vovan Svetloozerskiy", "AkuSher", "Anesteziolog", "Dermatolog", "Farmacevt",
"FeldSher", "Fiziolog", "Glavvrach", "Gomeopat", "Hirurg", "Immunolog", "Kardiolog", "Laborant", "Lor", "Medbrat",
"Medsestra", "Nevrolog", "Okulist", "Paracetamol", "Pilyulya", "Proktolog", "Psihiatr", "Revmatolog", "Shpric", "Stomatolog",
"Terapevt", "Travmatolog", "Trupovoz", "Urolog", "Venerolog", "Zaveduyuschiy", "Zhgut", "Anton Zavodskoy", "Filja Zavodskoy", "Gena Zavodskoy",
"Grisha Zavodskoy", "Koljan Zavodskoy", "Kuling Zavodskoy", "Lesha Zavodskoy", "Sanja Zavodskoy", "Shtopor Zavodskoy", "Skif Zavodskoy", "Stas Zavodskoy", "Toha Zavodskoy", "Torpeda Zavodskoy",
"Vasja Zavodskoy", "Vitek Zavodskoy", "Zhora Zavodskoy", "Afganec", "Alfons", "Assa", "Baks", "Banschik", "Barguzin", "Basmach",
"Batya", "Belyy", "Bob", "Borec", "Byk", "BZT", "Chelovek", "Chempion", "Dnevalnyy", "Drossel",
"Dum", "Gepe", "Gorbatyy", "Grustnyy", "Irlandec", "Kadrovik", "Karabin", "Karaul", "Kastet", "Katok",
"Kocherga", "Kosoy", "Krot", "Kuling", "Kumulyativ", "Kuzya", "Letyoha", "Lis", "Lysyy", "Lyutyy",
"Maga", "Matros", "Mihalych", "Mysh", "Nakat", "Oficer", "Oreh", "Osechka", "Otbitiy", "Patron",
"Pluton", "Radar", "Rayan", "Rembo", "Ryaha", "Salobon", "Sapog", "Sekach", "Seryy", "Serzhant",
"Shapka", "Shustryy", "Sibiryak", "Signal", "Sobr", "Specnaz", "Strelok", "Stvol", "Svinec", "Sych",
"Tankist", "Tihohod", "Toropyga", "Trubochist", "Utyug", "Valet", "Vegan", "Veteran", "Vityok", "Voron",
"Zampolit", "Zarya", "Zh-12", "Zhirnyy", "Zimniy"
};
private static readonly HashSet<string> GuardNamesRussian = new HashSet<string>
{
"Баклажан", "Бановый", "Бармалей", "Басмач", "Базиль", "Бегежан", "Беляш", "Бибоп", "Борзый", "Чебурек",
"Дихлофос", "Дуня", "Филя", "Фламберг", "Флинт", "Гийом", "Гладиус", "Громила", "Хоптод", "Хвост",
"Кант", "Карабин", "Карась", "Карман", "Картежник", "Каторжник", "Клеймор", "Кольт", "Компот", "Копченый",
"Кудеяр", "Кузя", "Лупа", "Маузер", "Мазевый", "Медоед", "Мипошка", "Мошенник", "Мойдодыр", "Мякиш",
"Паромщик", "Паштет", "Покер", "Пупа", "Резаный", "Штемпель", "Сифон", "Сохатый", "Супермен", "Тулуп",
"Валерьянович", "Вальтер", "Варан", "Веган", "Веник", "Арсенал", "Басьяк", "Бегемотик", "Человек", "Дежурка",
"Фуражка", "Гиббон", "Главдур", "Козырек", "Крот", "Куча", "Майор", "Николай", "Омон", "Пепс",
"Сержант", "Слонолюб", "Служебка", "Старлей", "Старший", "Стрелок", "Татьянка", "Учич", "Вася", "Висяк",
"Димон Светлоозерский", "Энчик Светлоозерский", "Качок Светлоозерский", "Крыса Светлоозерский", "Мальчик Светлоозерский", "Марат Светлоозерский", "Мельс Светлоозерский", "Мотыль Светлоозерский", "Пашок Светлоозерский", "Пляжник Светлоозерский",
"Робинзон Светлоозерский", "Саня Светлоозерский", "Шмыга Светлоозерский", "Тоха Светлоозерский", "Угрюм Светлоозерский", "Вован Светлоозерский", "Акушер", "Анестезиолог", "Дерматолог", "Фармацевт",
"Фельдшер", "Физиолог", "Главврач", "Гомеопат", "Хирург", "Иммунолог", "Кардиолог", "Лаборант", "Лор", "Медбрат",
"Медсестра", "Невролог", "Окулист", "Парацетамол", "Пилюля", "Проктолог", "Психиатр", "Ревматолог", "Шприц", "Стоматолог",
"Терапевт", "Травматолог", "Труповоз", "Уролог", "Венеролог", "Заведующий", "Жгут", "Антон Заводской", "Филя Заводской", "Гена Заводской",
"Гриша Заводской", "Колян Заводской", "Кулинг Заводской", "Леша Заводской", "Саня Заводской", "Штопор Заводской", "Скиф Заводской", "Стас Заводской", "Тоха Заводской", "Торпеда Заводской",
"Вася Заводской", "Витек Заводской", "Жора Заводской", "Афганец", "Альфонс", "Асса", "Бакс", "Банщик", "Баргузин", "Басмач",
"Батя", "Белый", "Боб", "Борец", "Бык", "БЗТ", "Человек", "Чемпион", "Дневальный", "Дроссель",
"Дум", "Гэпе", "Горбатый", "Грустный", "Ирландец", "Кадровик", "Карабин", "Караул", "Кастет", "Каток",
"Кочерга", "Косой", "Крот", "Кулинг", "Кумулятив", "Кузя", "Летюха", "Лис", "Лысый", "Лютый",
"Мага", "Матрос", "Михалыч", "Мышь", "Накат", "Офицер", "Орех", "Осечка", "Отбитый", "Патрон",
"Плутон", "Радар", "Раян", "Рэмбо", "Ряха", "Салобон", "Сапог", "Секач", "Серый", "Сержант",
"Шапка", "Шустрый", "Сибиряк", "Сигнал", "Собр", "Спецназ", "Стрелок", "Ствол", "Свинец", "Сыч",
"Танкист", "Тихоход", "Торопыга", "Трубочист", "Утюг", "Валет", "Веган", "Ветеран", "Витек", "Ворон",
"Замполит", "Заря", "Ж-12", "Жирный", "Зимний"
};
public static bool IsRogue(string name)
{
if (string.IsNullOrWhiteSpace(name))
{
return false;
}
return RogueNames.Contains(name);
}
public static bool IsRaider(string name)
{
if (string.IsNullOrWhiteSpace(name))
{
return false;
}
return RaiderNames.Contains(name);
}
public static bool IsCultist(string name)
{
if (string.IsNullOrWhiteSpace(name))
{
return false;
}
return CultistNames.Contains(name);
}
public static bool IsGuard(string name)
{
if (string.IsNullOrWhiteSpace(name))
{
return false;
}
if (GuardNames.Contains(name))
{
return true;
}
if (GuardNamesRussian.Contains(name))
{
return true;
}
return false;
}
}

View file

@ -0,0 +1,125 @@
using System;
using EFT.InventoryLogic;
using stupid.solutions;
using stupid.solutions.Data;
using stupid.solutions.Utils;
namespace stupid.solutions.stupid.solutions.Data;
public class ContainerItem
{
public Item Item { get; }
public string ItemID { get; private set; }
public string LocalizedName { get; private set; }
public string ShortName { get; private set; }
public ItemCategories Itemcat { get; private set; }
public int? itemprice { get; private set; }
public int Count { get; set; } = 1;
public ContainerItem(Item lootItem)
{
if (lootItem == null)
{
throw new ArgumentNullException("lootItem");
}
Item = lootItem;
LocalizedName = string.Empty;
ItemID = string.Empty;
ShortName = string.Empty;
Itemcat = ItemCategories.Uninitialized;
itemprice = null;
Count = 1;
}
public void CalculateItemPrice()
{
if (Item == null)
return;
if (Item.Template == null)
return;
itemprice = GameUtils.GetItemPriceBYID(Item.TemplateId) * Count;
}
public void SetItemCat()
{
if (Item == null)
return;
if (Item.Template == null)
return;
string text = Item.LocalizedName();
string item = Item.TemplateId;
if (QuestESP.QuestItemIds.Contains(text))
{
Itemcat = ItemCategories.Quest;
return;
}
if (Main.IsSuperrare(text))
{
Itemcat = ItemCategories.Superrare;
return;
}
if (Main.IsKappa(text))
{
Itemcat = ItemCategories.Kappa;
return;
}
if (Main.IsStim(text))
{
Itemcat = ItemCategories.Stim;
return;
}
if (Main.SearchedItem(text))
{
Itemcat = ItemCategories.Searched;
return;
}
if (Main.wishlistitemids.Contains(item))
{
Itemcat = ItemCategories.Wishlist;
return;
}
if (Main.hideoutitemids.Contains(item))
{
Itemcat = ItemCategories.Hideout;
return;
}
Itemcat = ItemCategories.Common;
}
public bool IsSameItem(ContainerItem other)
{
if (other == null)
return false;
return ItemID == other.ItemID;
}
public void RecalculateDynamics()
{
if (Item == null)
return;
if (Item.Template == null)
return;
if (string.IsNullOrEmpty(LocalizedName))
LocalizedName = Item.LocalizedName();
if (string.IsNullOrEmpty(ItemID))
ItemID = Item.TemplateId.ToString();
if (string.IsNullOrEmpty(ShortName))
ShortName = Item.ShortName.Localized();
}
}

View file

@ -0,0 +1,240 @@
using System;
using EFT.Interactive;
using stupid.solutions.Utils;
using UnityEngine;
namespace stupid.solutions.Data;
internal class GameExfiltrationPoint
{
private Vector3 screenPosition;
public ExfiltrationPoint ExfiltrationPoint { get; }
public Vector3 ScreenPosition => screenPosition;
public bool IsOnScreen { get; private set; }
public float Distance { get; private set; }
public string Name { get; set; }
public string status { get; set; }
public string FormattedDistance => $"{Math.Round(Distance)}m";
public GameExfiltrationPoint(ExfiltrationPoint exfiltrationPoint)
{
if (exfiltrationPoint == null)
{
throw new ArgumentNullException("exfiltrationPoint");
}
ExfiltrationPoint = exfiltrationPoint;
screenPosition = default(Vector3);
Distance = 0f;
Name = ExtractionNameToSimpleName(exfiltrationPoint.Settings.Name.Localized()) ?? "";
}
public void RecalculateDynamics()
{
if (!(ExfiltrationPoint == null) && GameUtils.IsExfiltrationPointValid(ExfiltrationPoint))
{
screenPosition = GameUtils.WorldPointToScreenPoint(ExfiltrationPoint.transform.position);
IsOnScreen = GameUtils.IsScreenPointVisible(screenPosition);
Distance = Vector3.Distance(Main.MainCamera.transform.position, ExfiltrationPoint.transform.position);
if (ExfiltrationPoint.Status == EExfiltrationStatus.AwaitsManualActivation || ExfiltrationPoint.Status == EExfiltrationStatus.NotPresent)
{
status = "Closed";
}
else
{
status = "Open";
}
}
}
private string ExtractionNameToSimpleName(string extractionName)
{
if (extractionName.Contains("exit (3)"))
{
return "Cellars";
}
if (extractionName.Contains("exit (1)"))
{
return "Gate 3";
}
if (extractionName.Contains("exit (2)"))
{
return "Gate 0";
}
if (extractionName.Contains("exit_scav_gate3"))
{
return "Gate 3";
}
if (extractionName.Contains("exit_scav_camer"))
{
return "Blinking Light";
}
if (extractionName.Contains("exit_scav_office"))
{
return "Office";
}
if (extractionName.Contains("eastg"))
{
return "East Gate";
}
if (extractionName.Contains("scavh"))
{
return "House";
}
if (extractionName.Contains("deads"))
{
return "Dead Mans Place";
}
if (extractionName.Contains("var1_1_constant"))
{
return "Outskirts";
}
if (extractionName.Contains("scav_outskirts"))
{
return "Outskirts";
}
if (extractionName.Contains("water"))
{
return "Outskirts Water";
}
if (extractionName.Contains("boat"))
{
return "The Boat";
}
if (extractionName.Contains("mountain"))
{
return "Mountain Stash";
}
if (extractionName.Contains("oldstation"))
{
return "Old Station";
}
if (extractionName.Contains("UNroad"))
{
return "UN Road Block";
}
if (extractionName.Contains("var2_1_const"))
{
return "UN Road Block";
}
if (extractionName.Contains("gatetofactory"))
{
return "Gate to Factory";
}
if (extractionName.Contains("RUAF"))
{
return "RUAF Gate";
}
if (extractionName.Contains("roadtoc"))
{
return "Road to Customs";
}
if (extractionName.Contains("lighthouse"))
{
return "Lighthouse";
}
if (extractionName.Contains("tunnel"))
{
return "Tunnel";
}
if (extractionName.Contains("wreckedr"))
{
return "Wrecked Road";
}
if (extractionName.Contains("deadend"))
{
return "Dead End";
}
if (extractionName.Contains("housefence"))
{
return "Ruined House Fence";
}
if (extractionName.Contains("gyment"))
{
return "Gym Entrance";
}
if (extractionName.Contains("southfence"))
{
return "South Fence Passage";
}
if (extractionName.Contains("adm_base"))
{
return "Admin Basement";
}
if (extractionName.Contains("administrationg"))
{
return "Administration Gate";
}
if (extractionName.Contains("factoryfar"))
{
return "Factory Far Corner";
}
if (extractionName.Contains("oldazs"))
{
return "Old Gate";
}
if (extractionName.Contains("milkp_sh"))
{
return "Shack";
}
if (extractionName.Contains("beyondfuel"))
{
return "Beyond Fuel Tank";
}
if (extractionName.Contains("railroadtom"))
{
return "Railroad to Mil Base";
}
if (extractionName.Contains("_pay_car"))
{
return "V-Exit";
}
if (extractionName.Contains("oldroadgate"))
{
return "Old Road Gate";
}
if (extractionName.Contains("sniperroad"))
{
return "Sniper Road Block";
}
if (extractionName.Contains("warehouse17"))
{
return "Warehouse 17";
}
if (extractionName.Contains("factoryshacks"))
{
return "Factory Shacks";
}
if (extractionName.Contains("railroadtotarkov"))
{
return "Railroad to Tarkov";
}
if (extractionName.Contains("trailerpark"))
{
return "Trailer Park";
}
if (extractionName.Contains("crossroads"))
{
return "Crossroads";
}
if (extractionName.Contains("railroadtoport"))
{
return "Railroad to Port";
}
if (extractionName.Contains("NW_Exfil"))
{
return "North West Extract";
}
if (extractionName.Contains("SE_Exfil"))
{
return "Emmercom";
}
return extractionName;
}
}

View file

@ -0,0 +1,152 @@
using System;
using System.Collections.Generic;
using System.Linq;
using EFT.Interactive;
using EFT.InventoryLogic;
using stupid.solutions.stupid.solutions.Data;
using stupid.solutions.Utils;
using UnityEngine;
namespace stupid.solutions.Data;
public class GameLootContainer
{
private Vector3 screenPosition;
public LootableContainer LootableContainer { get; }
public List<ContainerItem> LootItems { get; private set; }
public bool ItemInit { get; private set; }
public Vector3 ScreenPosition => screenPosition;
public bool IsOnScreen { get; private set; }
public float Distance { get; private set; }
public string FormattedDistance => $"{Math.Round(Distance)}m";
public int? totalprice { get; private set; }
public int CachedItemCount { get; private set; }
public string ContainerName { get; set; }
public GameLootContainer(LootableContainer lootableContainer)
{
if (lootableContainer == null)
{
throw new ArgumentNullException("lootableContainer");
}
LootableContainer = lootableContainer;
screenPosition = default(Vector3);
Distance = 0f;
LootItems = new List<ContainerItem>();
ItemInit = false;
ContainerName = "Container";
totalprice = null;
CachedItemCount = 0;
}
public void RecalculateDynamics()
{
if (GameUtils.IsLootableContainerValid(LootableContainer))
{
screenPosition = GameUtils.WorldPointToScreenPoint(LootableContainer.transform.position);
IsOnScreen = GameUtils.IsScreenPointVisible(screenPosition);
Distance = Vector3.Distance(Main.MainCamera.transform.position, LootableContainer.transform.position);
}
}
public void RefreshItems()
{
LootItems.Clear();
int num = 0;
foreach (Item allItem in LootableContainer.ItemOwner.RootItem.GetAllItems())
{
if (allItem == null)
{
continue;
}
if (IsContainerName(allItem.LocalizedName()))
{
ContainerName = allItem.LocalizedName();
continue;
}
num++;
ContainerItem lootItem = new ContainerItem(allItem);
if (lootItem.Item.StackObjectsCount > lootItem.Item.StackMaxSize || lootItem.Item.StackObjectsCount > 100)
{
continue;
}
lootItem.RecalculateDynamics();
lootItem.SetItemCat();
ContainerItem containerItem = LootItems.FirstOrDefault((ContainerItem i) => i.ItemID == lootItem.ItemID);
if (containerItem != null)
{
containerItem.Count += lootItem.Count + (lootItem.Item.StackObjectsCount - 1);
if (containerItem.Count > 1500)
{
containerItem.Count -= 1500;
}
if (containerItem.Count > 500)
{
containerItem.Count -= 500;
}
}
else
{
if (lootItem.Item.StackObjectsCount > 1)
{
lootItem.Count += lootItem.Item.StackObjectsCount - 1;
}
LootItems.Add(lootItem);
}
}
foreach (ContainerItem lootItem2 in LootItems)
{
lootItem2.CalculateItemPrice();
}
CachedItemCount = num;
totalprice = LootItems.Sum((ContainerItem item) => item.itemprice);
ItemInit = true;
}
public bool IsContainerName(string name)
{
switch (name)
{
case "Toolbox":
case "Duffle bag":
case "Wooden ammo box":
case "Grenade box":
case "Weapon box":
case "Wooden crate":
case "Plastic suitcase":
case "Dead Scav":
case "Ground cache":
case "Buried barrel cache":
case "PC block":
case "Jacket":
case "Drawer":
case "Cash register":
case "Medbag SMU06":
case "Medcase":
case "Safe":
case "Technical supply crate":
case "Ration supply crate":
case "Medical supply crate":
case "Civilian body":
case "PMC body":
case "Scav body":
case "Lab technician body":
case "Bank safe":
case "Bank cash register":
case "Shturman's Stash":
return true;
default:
return false;
}
}
}

View file

@ -0,0 +1,161 @@
using System;
using EFT.Interactive;
using stupid.solutions.Utils;
using UnityEngine;
namespace stupid.solutions.Data;
public class GameLootItem
{
private Vector3 screenPosition;
private Vector2 screenPositionFinal;
public LootItem LootItem { get; }
public Vector3 ScreenPosition => screenPosition;
public Vector2 ScreenPositionFinal => screenPositionFinal;
public bool IsOnScreen { get; private set; }
public float Distance { get; private set; }
public string FormattedDistance => $"{Math.Round(Distance)}m";
public string ItemID { get; private set; }
public string LocalizedName { get; private set; }
public string ShortName { get; private set; }
public ItemCategories Itemcat { get; private set; }
public int? itemprice { get; private set; }
public int? stackcount { get; private set; }
public GameLootItem(LootItem lootItem)
{
if (lootItem == null)
{
throw new ArgumentNullException("lootItem");
}
LootItem = lootItem;
screenPosition = default(Vector3);
screenPositionFinal = default(Vector2);
Distance = 0f;
LocalizedName = string.Empty;
ItemID = string.Empty;
ShortName = string.Empty;
Itemcat = ItemCategories.Uninitialized;
stackcount = null;
}
public void CalculateItemPrice()
{
if (!(LootItem == null) && GameUtils.IsLootItemValid(LootItem))
{
int? itemPriceBYID = GameUtils.GetItemPriceBYID(LootItem.TemplateId);
if (LootItem.Item.StackObjectsCount > 0)
{
itemprice = itemPriceBYID * LootItem.Item.StackObjectsCount;
stackcount = LootItem.Item.StackObjectsCount;
}
else
{
itemprice = itemPriceBYID;
}
}
}
public void SetItemCat()
{
if (!(LootItem == null) && GameUtils.IsLootItemValid(LootItem))
{
string text = LootItem.Item.LocalizedName();
string item = LootItem.Item.TemplateId;
if (QuestESP.QuestItemIds.Contains(text) || QuestESP.QuestItemIds.Contains(text.ToLower()))
{
Itemcat = ItemCategories.Quest;
}
else if (Main.IsSuperrare(text))
{
Itemcat = ItemCategories.Superrare;
}
else if (Main.IsKappa(text))
{
Itemcat = ItemCategories.Kappa;
}
else if (Main.IsStim(text))
{
Itemcat = ItemCategories.Stim;
}
else if (Main.SearchedItem(text))
{
Itemcat = ItemCategories.Searched;
}
else if (Main.wishlistitemids.Contains(item))
{
Itemcat = ItemCategories.Wishlist;
}
else if (Main.hideoutitemids.Contains(item))
{
Itemcat = ItemCategories.Hideout;
}
else if (LootItem.Item.LocalizedName() != "Default Inventory")
{
Itemcat = ItemCategories.Common;
}
else
{
Itemcat = ItemCategories.Invalid;
}
}
}
public void RecalculateDynamics()
{
if (GameUtils.IsLootItemValid(LootItem) && !(LootItem.transform == null))
{
_ = LootItem.transform.position;
if (Main.MainCamera != null)
{
screenPosition = GameUtils.WorldPointToScreenPoint(LootItem.transform.position);
}
screenPositionFinal = new Vector2(screenPosition.x - 50f, screenPosition.y);
if (screenPosition != Vector3.zero)
{
IsOnScreen = GameUtils.IsScreenPointVisible(screenPosition);
}
if ((Itemcat != ItemCategories.Quest || Itemcat != ItemCategories.Uninitialized) && QuestESP.QuestItemIds.Contains(LocalizedName) && QuestESP.QuestItemIds.Contains(LocalizedName.ToLower()))
{
Itemcat = ItemCategories.Quest;
}
if (Main.MainCamera != null)
{
Distance = Vector3.Distance(Main.MainCamera.transform.position, LootItem.transform.position);
}
if (string.IsNullOrEmpty(LocalizedName))
{
LocalizedName = LootItem.Item.LocalizedName();
}
if (string.IsNullOrEmpty(ItemID))
{
ItemID = LootItem.TemplateId.ToString();
}
if (string.IsNullOrEmpty(ShortName))
{
ShortName = LootItem.Item.ShortName.Localized();
}
if (LootItem.Item.StackObjectsCount > 0 && !stackcount.HasValue)
{
stackcount = LootItem.Item.StackObjectsCount;
}
else if (!stackcount.HasValue)
{
stackcount = 1;
}
}
}
}

View file

@ -0,0 +1,148 @@
using System;
using System.Collections.Generic;
using System.Linq;
using EFT;
using EFT.InventoryLogic;
using EFT.UI;
using stupid.solutions.stupid.solutions.Data;
using stupid.solutions.Utils;
using UnityEngine;
namespace stupid.solutions.Data;
public class GamePlayer
{
private Vector3 screenPosition;
private Vector3 headScreenPosition;
public Player Player { get; }
public Vector3 ScreenPosition => screenPosition;
public Vector3 HeadScreenPosition => headScreenPosition;
public bool IsOnScreen { get; private set; }
public bool IsVisible { get; private set; }
public float Distance { get; private set; }
public bool ItemInit { get; private set; }
public float DistanceFromCenter { get; set; }
public string FormattedDistance => $"{(int)Math.Round(Distance)}m";
public List<ContainerItem> LootItems { get; private set; }
public int? totalinventoryprice { get; private set; }
public bool isselected { get; set; }
public GamePlayer(Player player)
{
if (player == null)
{
throw new ArgumentNullException("player");
}
Player = player;
screenPosition = default(Vector3);
headScreenPosition = default(Vector3);
IsOnScreen = false;
Distance = 0f;
LootItems = new List<ContainerItem>();
ItemInit = false;
totalinventoryprice = null;
}
private void DoRefreshItems()
{
LootItems.Clear();
foreach (Item allItem in Player.Profile.Inventory.Equipment.GetAllItems())
{
if (allItem == null)
continue;
ContainerItem lootItem = new ContainerItem(allItem);
lootItem.RecalculateDynamics();
lootItem.SetItemCat();
ContainerItem containerItem = LootItems.FirstOrDefault((ContainerItem i) => i.ItemID == lootItem.ItemID);
if (containerItem != null)
{
if (lootItem.Item.StackObjectsCount <= lootItem.Item.StackMaxSize && 100 >= lootItem.Item.StackObjectsCount)
{
containerItem.Count += lootItem.Count + (lootItem.Item.StackObjectsCount - 1);
if (containerItem.Count > 1500)
{
containerItem.Count -= 1500;
}
if (containerItem.Count > 500)
{
containerItem.Count -= 500;
}
}
}
else if (lootItem.Item.StackObjectsCount <= lootItem.Item.StackMaxSize && 100 >= lootItem.Item.StackObjectsCount)
{
if (lootItem.Item.StackObjectsCount > 1)
{
lootItem.Count += lootItem.Item.StackObjectsCount - 1;
}
LootItems.Add(lootItem);
}
}
foreach (ContainerItem lootItem2 in LootItems)
{
lootItem2.CalculateItemPrice();
}
totalinventoryprice = LootItems.Sum((ContainerItem item) => item.itemprice);
ItemInit = true;
}
public void RefreshItems()
{
try
{
DoRefreshItems();
}
catch (Exception arg)
{
ConsoleScreen.Log($"Error whilst refreshing GamePlayers Inventory Items : {arg} ");
}
}
public void RecalculateDynamics()
{
try
{
if (!GameUtils.IsPlayerValid(Player))
{
return;
}
screenPosition = GameUtils.WorldPointToScreenPoint(Player.Transform.position);
if (Menu2.selectedEntity != null)
{
if (Player == Menu2.selectedEntity)
{
isselected = true;
}
else
{
isselected = false;
}
}
if (Player.PlayerBones != null)
{
headScreenPosition = GameUtils.WorldPointToScreenPoint(Player.PlayerBones.Head.position);
}
IsOnScreen = GameUtils.IsScreenPointVisible(screenPosition);
Distance = Vector3.Distance(Main.MainCamera.transform.position, Player.Transform.position);
}
catch (Exception arg)
{
ConsoleScreen.Log($"Error whilst Recalculating Dynamics for GamePlayer Instance : {arg}");
}
}
}

View file

@ -0,0 +1,45 @@
using System;
using EFT.Interactive;
using stupid.solutions.Utils;
using UnityEngine;
namespace stupid.solutions.Data;
internal class GameTransitPoint
{
private Vector3 screenPosition;
public TransitPoint transitPoint { get; }
public Vector3 ScreenPosition => screenPosition;
public bool IsOnScreen { get; private set; }
public float Distance { get; private set; }
public string Name { get; set; }
public string FormattedDistance => $"{Math.Round(Distance)}m";
public GameTransitPoint(TransitPoint tPoint)
{
if (tPoint == null)
{
throw new ArgumentNullException("tPoint");
}
transitPoint = tPoint;
screenPosition = default(Vector3);
Distance = 0f;
Name = transitPoint.name ?? "";
}
public void RecalculateDynamics()
{
if (!(transitPoint == null) && GameUtils.IsTransitPointValid(transitPoint))
{
screenPosition = GameUtils.WorldPointToScreenPoint(transitPoint.transform.position);
IsOnScreen = GameUtils.IsScreenPointVisible(screenPosition);
Distance = Vector3.Distance(Main.MainCamera.transform.position, transitPoint.transform.position);
}
}
}

View file

@ -0,0 +1,15 @@
namespace stupid.solutions.Data;
public enum ItemCategories
{
Uninitialized,
Superrare,
Kappa,
Quest,
Stim,
Searched,
Wishlist,
Hideout,
Common,
Invalid
}

View file

@ -0,0 +1,257 @@
using System;
using System.Collections.Generic;
using System.Linq;
using EFT;
using EFT.InventoryLogic;
using EFT.NextObservedPlayer;
using stupid.solutions;
using stupid.solutions.Utils;
using UnityEngine;
namespace stupid.solutions.stupid.solutions.Data;
public class OnlineGamePlayer
{
public enum PlayerType
{
Scav,
USEC,
BEAR,
Boss,
Zombie,
Teammate,
PlayerScav,
Cultist,
Rogue,
Raider,
Guard,
BTR,
undefined
}
public delegate void WildSpawnTypeDelegate(WildSpawnType role);
private WildSpawnTypeDelegate _originalWildSpawnType;
private Vector3 screenPosition;
private Vector3 headScreenPosition;
public ObservedPlayerView Player { get; }
public Vector3 ScreenPosition => screenPosition;
public Vector3 HeadScreenPosition => headScreenPosition;
public bool IsOnScreen { get; private set; }
public bool IsVisible { get; private set; }
public bool teamassigned { get; private set; }
public float Distance { get; private set; }
public bool IsAI { get; private set; }
public bool ItemInit { get; private set; }
public float DistanceFromCenter { get; set; }
public string FormattedDistance => $"{(int)Math.Round(Distance)}m";
public string profileid { get; set; }
public bool IsTeammate { get; set; }
public string team { get; set; }
public PlayerType role { get; set; }
private int teamcount { get; set; }
public List<ContainerItem> LootItems { get; private set; }
public int? totalinventoryprice { get; private set; }
public bool gotprofileinfo { get; private set; }
public int timeplayed { get; private set; }
public double kd { get; private set; }
public int level { get; private set; }
public int membertype { get; private set; }
public string NickName { get; private set; }
public WildSpawnType? wst { get; set; }
public bool gotwst { get; set; }
public OnlineGamePlayer(ObservedPlayerView player)
{
if (player == null)
{
throw new ArgumentNullException("player");
}
Player = player;
screenPosition = default;
headScreenPosition = default;
IsOnScreen = false;
Distance = 0f;
LootItems = new List<ContainerItem>();
ItemInit = false;
totalinventoryprice = null;
IsAI = false;
role = PlayerType.undefined;
IsTeammate = false;
gotprofileinfo = false;
teamassigned = false;
team = "";
timeplayed = 0;
kd = 0.0;
level = 0;
membertype = 0;
NickName = "Unknown Name";
wst = WildSpawnType.marksman;
gotwst = false;
}
public void RefreshItems()
{
LootItems.Clear();
foreach (Item allItem in Player.ObservedPlayerController.EquipmentViewController.Equipment.GetAllItems())
{
if (allItem == null)
{
continue;
}
ContainerItem lootItem = new ContainerItem(allItem);
lootItem.RecalculateDynamics();
lootItem.SetItemCat();
ContainerItem containerItem = LootItems.FirstOrDefault((i) => i.ItemID == lootItem.ItemID);
if (containerItem != null)
{
if (lootItem.Item.StackObjectsCount <= lootItem.Item.StackMaxSize && 100 >= lootItem.Item.StackObjectsCount)
{
containerItem.Count += lootItem.Count + (lootItem.Item.StackObjectsCount - 1);
}
}
else if (lootItem.Item.StackObjectsCount <= lootItem.Item.StackMaxSize && 100 >= lootItem.Item.StackObjectsCount)
{
if (lootItem.Item.StackObjectsCount > 1)
{
lootItem.Count += lootItem.Item.StackObjectsCount - 1;
}
LootItems.Add(lootItem);
}
}
foreach (ContainerItem lootItem2 in LootItems)
{
lootItem2.CalculateItemPrice();
}
totalinventoryprice = LootItems.Sum((item) => item.itemprice);
ItemInit = true;
}
public void RecalculateDynamics()
{
if (!GameUtils.IsOPlayerValid(Player))
{
return;
}
if (Main.LocalPlayer.TeamId != null && Player.TeamId == Main.LocalPlayer.TeamId)
{
IsTeammate = true;
}
if (Player.TeamId != null && !IsTeammate && team == "")
{
if (!teamassigned)
{
teamassigned = true;
if (!Main.teams.ContainsKey(Player.TeamId))
{
int value = !Main.teams.Values.Any() ? 1 : Main.teams.Values.Max() + 1;
Main.teams[Player.TeamId] = value;
Main.teamPlayerCount[Player.TeamId] = 1;
}
else
{
Main.teamPlayerCount[Player.TeamId]++;
}
}
int num = Main.teams[Player.TeamId];
team = $" Team : {num} ";
}
if (!gotprofileinfo && !Player.IsAI)
{
GetPlayerInfo();
}
screenPosition = GameUtils.WorldPointToScreenPoint(Player.Transform.position);
if (role == PlayerType.undefined && gotwst)
{
role = GetPlayerType(this);
}
if (Player.PlayerBones != null)
{
headScreenPosition = GameUtils.WorldPointToScreenPoint(Player.PlayerBones.Head.position);
}
IsAI = Player.IsAI;
IsOnScreen = GameUtils.IsScreenPointVisible(screenPosition);
Distance = Vector3.Distance(Main.MainCamera.transform.position, Player.Transform.position);
}
private async void GetPlayerInfo()
{
gotprofileinfo = true;
}
private PlayerType GetPlayerType(OnlineGamePlayer gamePlayer)
{
EPlayerSide side = gamePlayer.Player.ObservedPlayerController.InfoContainer.Side;
if (gamePlayer.Player.IsAI)
{
bool flag = Main.IsBoss(wst);
if (flag)
{
return PlayerType.Boss;
}
if (wst == WildSpawnType.pmcBot)
{
return PlayerType.Raider;
}
if (!flag && wst.ToString().Contains("follower") || wst == WildSpawnType.bossBoarSniper)
{
return PlayerType.Guard;
}
if (wst == WildSpawnType.sectactPriestEvent || wst == WildSpawnType.sectantPriest || wst == WildSpawnType.sectantWarrior)
{
return PlayerType.Cultist;
}
if (wst == WildSpawnType.exUsec)
{
return PlayerType.Rogue;
}
if (gamePlayer.Player.UsedSimplifiedSkeleton)
{
return PlayerType.Zombie;
}
if (gamePlayer.Player.ObservedPlayerController.HandsController.ItemInHands.ShortName.Localized().Contains("PKTM"))
{
return PlayerType.BTR;
}
return PlayerType.Scav;
}
if (gamePlayer.IsTeammate)
{
return PlayerType.Teammate;
}
return side switch
{
EPlayerSide.Usec => PlayerType.USEC,
EPlayerSide.Savage => PlayerType.PlayerScav,
_ => PlayerType.BEAR,
};
}
}

View file

@ -0,0 +1,7 @@
using UnityEngine;
namespace stupid.solutions.Data;
public class OnlinePlayerInfo : MonoBehaviour
{
}

View file

@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using EFT;
using EFT.NextObservedPlayer;
using EFT.UI;
using stupid.solutions.stupid.solutions.Data;
using UnityEngine;
namespace stupid.solutions.Data;
public class WildSpawnTypeManager : MonoBehaviour
{
private static List<(ObservedPlayerView PlayerInstance, WildSpawnType Role)> unassignedRoles = new List<(ObservedPlayerView, WildSpawnType)>();
public void Start()
{
ConsoleScreen.Log("WST Manager initiated");
}
public static void WST_Postfix(ObservedPlayerView __instance, WildSpawnType role)
{
try
{
ConsoleScreen.Log("WST method_6 called for ObservedPlayerView.");
unassignedRoles.Add((__instance, role));
foreach (OnlineGamePlayer onlineGamePlayer in Main.OnlineGamePlayers)
{
if (__instance.ProfileId == onlineGamePlayer.profileid)
{
onlineGamePlayer.wst = role;
onlineGamePlayer.gotwst = true;
}
}
ConsoleScreen.Log($"Temporary role assignment queued: PlayerPID={__instance.ProfileId}, Role={role}");
}
catch (Exception)
{
}
}
}