diff --git a/Config/Localization.csv b/Config/Localization.csv index 4d09779..f99f592 100644 --- a/Config/Localization.csv +++ b/Config/Localization.csv @@ -260,7 +260,10 @@ necroWolfBagWindowTitle,items,Item,,,,Wolf bag,,Wolfstasche,Bolsa del lobo,Sac d necroWolfBagWaypoint,items,Item,,,,Wolf bag,,Wolfstasche,Bolsa del lobo,Sac du loup,Borsa del lupo,狼の袋,늑대 가방,Torba wilka,Bolsa do lobo,Сумка волка,Kurt çantası,狼的包,狼的包 necroZombieBagWindowTitle,items,Item,,,,Zombie bag,,Zombietasche,Bolsa del zombi,Sac du zombie,Borsa dello zombi,ゾンビの袋,좀비 가방,Torba zombie,Bolsa do zumbi,Сумка зомби,Zombi çantası,僵尸的包,殭屍的包 necroZombieBagWaypoint,items,Item,,,,Zombie bag,,Zombietasche,Bolsa del zombi,Sac du zombie,Borsa dello zombi,ゾンビの袋,좀비 가방,Torba zombie,Bolsa do zumbi,Сумка зомби,Zombi çantası,僵尸的包,殭屍的包 -necroPossessHintZombieBag,items,Item,,,,Tab - bag,,Tab - Tasche,Tab: bolsa,Tab : sac,Tab - borsa,Tab: 袋,Tab - 가방,Tab - torba,Tab - bolsa,Tab - сумка,Tab - çanta,Tab - 包,Tab - 包 +necroPossessHintZombieBag,items,Item,,,,"Tab - bag, E at a container, loot bag or item - into the bag",,"Tab - Tasche, E an Behälter, Beutel oder Gegenstand - in die Tasche","Tab: bolsa, E en un contenedor, saco o objeto: a la bolsa","Tab : sac, E sur un conteneur, un sac ou un objet : dans le sac","Tab - borsa, E su contenitore, sacca o oggetto - nella borsa","Tab: 袋、コンテナ・袋・アイテムにE: 袋へ","Tab - 가방, 상자·자루·물건에 E - 가방으로","Tab - torba, E na pojemniku, worku lub przedmiocie - do torby","Tab - bolsa, E em contêiner, saco ou item - para a bolsa","Tab - сумка, E на ящик, мешок или предмет - в сумку","Tab - çanta, kaba, torbaya veya eşyaya E - çantaya","Tab - 包,对容器、袋子或物品按E - 放入包","Tab - 包,對容器、袋子或物品按E - 放入包" +necroZombieBagTook,items,Item,,,,"Zombie bag ({1}/{2}): {0}",,"Zombietasche ({1}/{2}): {0}","Bolsa del zombi ({1}/{2}): {0}","Sac du zombie ({1}/{2}) : {0}","Borsa dello zombi ({1}/{2}): {0}","ゾンビの袋({1}/{2}):{0}","좀비 가방 ({1}/{2}): {0}","Torba zombie ({1}/{2}): {0}","Bolsa do zumbi ({1}/{2}): {0}","Сумка зомби ({1}/{2}): {0}","Zombi çantası ({1}/{2}): {0}","僵尸的背包({1}/{2}):{0}","殭屍的背包({1}/{2}):{0}" +necroZombieBagFull,items,Item,,,,"The zombie bag is full ({1}/{2}): {0}",,"Die Zombietasche ist voll ({1}/{2}): {0}","La bolsa del zombi está llena ({1}/{2}): {0}","Le sac du zombie est plein ({1}/{2}) : {0}","La borsa dello zombi è piena ({1}/{2}): {0}","ゾンビの袋がいっぱい({1}/{2}):{0}","좀비 가방이 가득 찼습니다 ({1}/{2}): {0}","Torba zombie jest pełna ({1}/{2}): {0}","A bolsa do zumbi está cheia ({1}/{2}): {0}","Сумка зомби полна ({1}/{2}): {0}","Zombi çantası dolu ({1}/{2}): {0}","僵尸的背包已满({1}/{2}):{0}","殭屍的背包已滿({1}/{2}):{0}" +necroZombieBagShow,items,Item,,,,"Zombie bag ({1}/{2}): {0}",,"Zombietasche ({1}/{2}): {0}","Bolsa del zombi ({1}/{2}): {0}","Sac du zombie ({1}/{2}) : {0}","Borsa dello zombi ({1}/{2}): {0}","ゾンビの袋({1}/{2}):{0}","좀비 가방 ({1}/{2}): {0}","Torba zombie ({1}/{2}): {0}","Bolsa do zumbi ({1}/{2}): {0}","Сумка зомби ({1}/{2}): {0}","Zombi çantası ({1}/{2}): {0}","僵尸的背包({1}/{2}):{0}","殭屍的背包({1}/{2}):{0}" necroPossessHintAfterFear,items,Item,,,,"after you leave, the zombie flees in chilling terror",,"nach dem Verlassen flieht der Zombie in eisigem Schrecken","al salir, el zombi huye presa de un terror helado","quand tu le quittes, le zombie fuit, glacé d'effroi","quando lo lasci, lo zombi fugge in preda al terrore","離れるとゾンビは凍てつく恐怖で逃げ出す","빠져나가면 좀비는 얼어붙는 공포에 질려 달아남","po wyjściu zombie ucieka w lodowatym przerażeniu","ao sair, o zumbi foge em terror gelado","после выхода зомби в леденящем ужасе убегает","çıktığında zombi dondurucu bir dehşetle kaçar","离开后,僵尸会在刺骨的恐惧中逃跑","離開後,殭屍會在刺骨的恐懼中逃跑" necroWolfBagEmpty,items,Item,,,,"empty",,"leer","vacía","vide","vuota","空","비어 있음","pusta","vazia","пусто","boş","空","空" necroWolfBagTook,items,Item,,,,"Wolf bag ({1}/{2}): {0}",,"Wolfstasche ({1}/{2}): {0}","Bolsa del lobo ({1}/{2}): {0}","Sac du loup ({1}/{2}) : {0}","Borsa del lupo ({1}/{2}): {0}","狼の袋({1}/{2}):{0}","늑대 가방 ({1}/{2}): {0}","Torba wilka ({1}/{2}): {0}","Bolsa do lobo ({1}/{2}): {0}","Сумка волка ({1}/{2}): {0}","Kurt çantası ({1}/{2}): {0}","狼的背包({1}/{2}):{0}","狼的背包({1}/{2}):{0}" diff --git a/HarmonySrc/Possession.cs b/HarmonySrc/Possession.cs index 72a8e76..b959e53 100644 --- a/HarmonySrc/Possession.cs +++ b/HarmonySrc/Possession.cs @@ -814,6 +814,12 @@ namespace NecromancerTome zwm.Close("windowpaging"); ZombieBag.OpenWindow(_player, z); } + // E: на ящик или мешок с зомби - обыск с переносом в сумку, на предмет на земле - подобрать (13.10, как у волка). + bool zlooted = RatLoot.Tick(world, _player, z, detonate, true); + if (detonate && !zlooted && !RatLoot.Viewing) + { + WolfBag.TryPickup(world, _player, z); + } } if (IsPet && WolfControl.Is(z)) { diff --git a/HarmonySrc/WolfBag.cs b/HarmonySrc/WolfBag.cs index b7f8ffe..f63085e 100644 --- a/HarmonySrc/WolfBag.cs +++ b/HarmonySrc/WolfBag.cs @@ -85,6 +85,22 @@ namespace NecromancerTome return _bag; } + /// Сумка, куда идёт лут сейчас (13.10): одержимого зомби (ZombieBag), если он с сумкой, иначе волка. + /// Обыск, подбор с земли, окно рюкзака при обыске и подсказки - общие, разница только здесь. + public static Bag Target => ZombieBag.Active ? ZombieBag.Current : Get(); + public static int TargetSlots => ZombieBag.Active ? ZombieBag.Current.SlotCount : Slots; + + static void SaveTarget() + { + if (ZombieBag.Active) + { + Version++; + ZombieBag.SaveNow(); + return; + } + Save(); + } + static void Save() { Version++; @@ -108,7 +124,7 @@ namespace NecromancerTome public static string Describe() { - Bag b = Get(); + Bag b = Target; List parts = new List(); foreach (ItemStack s in b.ItemGrid.items) { @@ -125,7 +141,7 @@ namespace NecromancerTome EntityPlayerLocal p = GameManager.Instance?.World?.GetPrimaryPlayer(); if (p != null) { - GameManager.ShowTooltip(p, string.Format(Localization.Get(_key), Describe(), Get().GetUsedSlotCount(), Slots)); + GameManager.ShowTooltip(p, string.Format(Localization.Get(ZombieBag.Active ? _key.Replace("necroWolfBag", "necroZombieBag") : _key), Describe(), Target.GetUsedSlotCount(), TargetSlots)); } } @@ -168,7 +184,7 @@ namespace NecromancerTome { return null; } - Bag b = Get(); + Bag b = Target; ItemStack moving = src.Clone(); int before = moving.count; b.TryStackItem(0, moving); @@ -185,7 +201,7 @@ namespace NecromancerTome } ItemStack rest = src.Clone(); rest.count = moving.count; - Save(); + SaveTarget(); Audio.Manager.PlayInsidePlayerHead("UseActions/takeall1"); Show("necroWolfBagTook"); Debug.Log("[NecromancerTome] WolfBag: в сумку " + src.itemValue.ItemClass.GetItemName() + " x" + moved + " - " + Describe()); @@ -234,7 +250,7 @@ namespace NecromancerTome public static void PutAll(TEFeatureStorage _te, EntityLootContainer _bag, bool _similarOnly) { bool any = false; - ItemStack[] slots = Get().ItemGrid.items; + ItemStack[] slots = Target.ItemGrid.items; for (int i = 0; i < slots.Length; i++) { if (slots[i] == null || slots[i].IsEmpty()) @@ -257,14 +273,14 @@ namespace NecromancerTome /// «Сортировать» - по самой сумке. public static void Sort() { - Get().ItemGrid.Sort(); - Save(); + Target.ItemGrid.Sort(); + SaveTarget(); } /// Переложить ячейку сумки в массив ячеек контейнера (сами ячейки меняются, номера - в _changed). static bool Give(int _idx, ItemStack[] _g, List _changed) { - Bag b = Get(); + Bag b = Target; ItemStack src = _idx < b.SlotCount ? b.ItemGrid.items[_idx] : null; if (src == null || src.IsEmpty()) { @@ -302,7 +318,7 @@ namespace NecromancerTome ItemStack rest = src.Clone(); rest.count = left; b.SetSlot(_idx, left > 0 ? rest : ItemStack.Empty.Clone()); - Save(); + SaveTarget(); Audio.Manager.PlayInsidePlayerHead("UseActions/takeall1"); Debug.Log("[NecromancerTome] WolfBag: из сумки в контейнер " + name + " x" + moved + " - " + Describe()); return true; @@ -360,7 +376,7 @@ namespace NecromancerTome bool any = false; for (int i = 0; i < _te.ItemGrid.items.Length; i++) { - if (!_te.ItemGrid.items[i].IsEmpty() && Get().CanTakeItem(_te.ItemGrid.items[i])) + if (!_te.ItemGrid.items[i].IsEmpty() && Target.CanTakeItem(_te.ItemGrid.items[i])) { any |= TakeFrom(_te, i); } @@ -379,7 +395,7 @@ namespace NecromancerTome ItemStack[] slots = _src.bag.ItemGrid.items; for (int i = 0; i < slots.Length; i++) { - if (!slots[i].IsEmpty() && Get().CanTakeItem(slots[i])) + if (!slots[i].IsEmpty() && Target.CanTakeItem(slots[i])) { any |= TakeFrom(_src, i); } @@ -665,7 +681,7 @@ namespace NecromancerTome public static ItemStack[] Slots(int _n) { ItemStack[] a = new ItemStack[_n]; - ItemStack[] b = WolfBag.Get().ItemGrid.items; + ItemStack[] b = WolfBag.Target.ItemGrid.items; for (int i = 0; i < _n; i++) { a[i] = i < b.Length && b[i] != null ? b[i].Clone() : ItemStack.Empty.Clone(); @@ -684,7 +700,7 @@ namespace NecromancerTome for (int i = 0; c != null && i < c.Length; i++) { c[i].IsLocked = true; - if (i >= WolfBag.Slots && c[i].ViewComponent.IsVisible) + if (i >= WolfBag.TargetSlots && c[i].ViewComponent.IsVisible) { c[i].ViewComponent.IsVisible = false; _hidden.Add(c[i]); @@ -729,7 +745,7 @@ namespace NecromancerTome { return true; } - __result = WolfBagBackpack.Slots(__instance.itemControllers?.Length ?? WolfBag.Slots); + __result = WolfBagBackpack.Slots(__instance.itemControllers?.Length ?? WolfBag.TargetSlots); return false; } } diff --git a/HarmonySrc/ZombieBag.cs b/HarmonySrc/ZombieBag.cs index 5a95f1a..5756caa 100644 --- a/HarmonySrc/ZombieBag.cs +++ b/HarmonySrc/ZombieBag.cs @@ -11,6 +11,8 @@ namespace NecromancerTome /// - при выходе из одержимости зомби сбрасывает рюкзаком всё, что было в сумке (и на поясе - когда в поясе /// появятся предметы); /// - гибель одержимого - мешок на месте и метка на карте, как у сумки волка. + /// Лут (указание 13.10: «раз у них E свободно, подключай лутание») - как у волка: E на ящик или мешок - обыск с + /// переносом в сумку, E на предмет на земле - подобрать (WolfBag.Target - сумка зомби, пока она есть). /// Только зомби из списка вида от первого лица (FpArms.Allows), не питомцы. Окно - то же, что у сумки волка /// (XUiC_BagStorageWindowGroup, без рюкзака персонажа), Tab в зомби открывает его вместо рюкзака. /// @@ -30,6 +32,10 @@ namespace NecromancerTome static string FilePath => Path.Combine(GameIO.GetSaveGameDir(), FileName); public static bool Active => _bag != null; + public static Bag Current => _bag; + + /// Записать после лута (WolfBag.SaveTarget). + public static void SaveNow() => Save(); /// У кого сумка: зомби с видом от первого лица, не питомцы. public static bool Has(EntityAlive _z, bool _pet) => !_pet && FpArms.Allows(_z); diff --git a/NecromancerHarmony.dll b/NecromancerHarmony.dll index a71bb2b..8adb1cc 100644 Binary files a/NecromancerHarmony.dll and b/NecromancerHarmony.dll differ diff --git a/NecromancerHarmony.pdb b/NecromancerHarmony.pdb index e9eb31d..4691dff 100644 Binary files a/NecromancerHarmony.pdb and b/NecromancerHarmony.pdb differ