Ejemplo n.º 1
0
        static public void EquipAccessories(int aptitudeType)
        {
            RestoreEquip();
            var items = ItemHelper.GetAptitudeUpOrComprehensionUpAccessories(aptitudeType);

            // 暫時寫死, 資質高的優先, 其次是悟性
            EquipAccessories(from item in items
                             orderby item.AptitudeUp descending, item.ComprehensionUp descending
                             select item);
        }
Ejemplo n.º 2
0
        private static void Postfix(BuildingWindow __instance)
        {
            if (!Main.Enabled ||
                __instance.readBookId <= 0 ||
                !Main.settings.HomeSystemAutoAccessories)
            {
                return;
            }

            if (CallByPatch)
            {
                CallByPatch = false;
                return;
            }

            int aptitudeType;

            if (__instance.studySkillTyp < 17)
            {
                // 技藝
                aptitudeType = AptitudeTypeHelper.GetAptitudeTypeBySkillType(__instance.studySkillTyp);
            }
            else
            {
                // 功法
                aptitudeType = AptitudeTypeHelper.GetAptitudeTypeByBookId(__instance.readBookId);
            }

            var items = ItemHelper.GetAptitudeUpOrComprehensionUpAccessories(aptitudeType);

            if (Main.settings.AdvancedReadBookMode &&
                BuildingWindow_GetNeedInt_Patch.LastNeedInt <= 50)
            {
                // 如果開了進階閱讀模式, 閱讀難度小於等於50時, 悟性優先
                items = from item in items
                        orderby item.ComprehensionUp descending
                        select item;
            }
            else
            {
                // 否則資質優先
                items = from item in items
                        orderby item.AptitudeUp descending, item.ComprehensionUp descending
                select item;
            }

            StateManager.EquipAccessories(items);
            // 重新整理
            CallByPatch = true;
            __instance.UpdateReadBookWindow();
        }
Ejemplo n.º 3
0
        private static void Prefix(int charId)
        {
            var df = DateFile.instance;

            if (charId != df.mianActorId)
            {
                return;
            }
            //#if (DEBUG)
            //            Main.Logger.Log($"現在內息: {df.GetActorMianQi(charId)}");
            //#endif
            if (!Main.Enabled)
            {
                return;
            }

            if (Main.settings.RestAutoEquip)
            {
                var items = ItemHelper.GetEquipItems()
                            .Select(kvp => kvp.Value).Concat(ItemHelper.GetBagItems().Concat(ItemHelper.GetWarehouseItems()))
                            .AsQueryable();

                // 取得內息最高的3樣武器
                items = items.Where(ItemHelper.GetEquipTypeFilter(EquipType.Weapon));
                items = items.Where(ItemHelper.GetHasDataFilter(ItemDateKey.MianQi));
                items = items.OrderByDescending(ItemHelper.GetOrderByData(ItemDateKey.MianQi));
                if (Main.settings.EnabledLog)
                {
                    foreach (var item in items.Take(3))
                    {
                        Main.Logger.Log($"裝備: {item} ({df.GetItemDate(item, 0, false)}), 內息: { df.GetItemDateValue(item, ItemDateKey.MianQi)}");
                    }
                }
                StateManager.EquipWeapons(items.Take(3));
            }

            if (Main.settings.RestGongFaIndex >= 0)
            {
                StateManager.UseGongFa(Main.settings.RestGongFaIndex);
            }
        }