static void Prefix(SaveDateFile __instance)
        {
            if (Main.enabled && Main.settings.ququLife && __instance.saveSaveDate)
            {
                DateFile   df      = DateFile.instance;
                List <int> boxQuQu = new List <int>();
                foreach (int[] box in df.cricketBoxDate.Values)
                {
                    if (box[0] != -97)
                    {
                        boxQuQu.Add(box[0]);
                    }
                }

                foreach (int actorId in df.acotrTeamDate)
                {
                    if (int.Parse(df.GetActorDate(actorId, 312)) != 0)
                    {
                        boxQuQu.Add(int.Parse(df.GetActorDate(actorId, 312)));
                    }
                }

                foreach (KeyValuePair <int, Dictionary <int, string> > item in df.itemsDate)
                {
                    if ((df.actorItemsDate[10001].ContainsKey(item.Key) || df.actorItemsDate[-999].ContainsKey(item.Key) || boxQuQu.Contains(item.Key)) && item.Value[999] == "10000")
                    {
                        if (item.Value[901] != "0" && item.Value[2007] != "0")
                        {
                            item.Value[2007] = "0";
                        }
                    }
                }
            }
        }
Exemple #2
0
        /// <summary>
        /// 处理蛐蛐年龄始终是0
        /// </summary>
        public static void QuQuCheat()
        {
            DateFile   df      = DateFile.instance;
            List <int> boxQuQu = new List <int>();

            foreach (int[] box in df.cricketBoxDate.Values)
            {
                if (box[0] != -97)
                {
                    boxQuQu.Add(box[0]);
                }
            }

            foreach (int actorId in df.actorFamilyDate)
            {
                if (int.Parse(df.GetActorDate(actorId, 312)) != 0)
                {
                    boxQuQu.Add(int.Parse(df.GetActorDate(actorId, 312)));
                }
            }

            foreach (KeyValuePair <int, Dictionary <int, string> > item in df.itemsDate)
            {
                if ((df.actorItemsDate[10001].ContainsKey(item.Key) || df.actorItemsDate[-999].ContainsKey(item.Key) || boxQuQu.Contains(item.Key)) && item.Value[999] == "10000")
                {
                    if (item.Value[901] != "0" && item.Value[2007] != "0")
                    {
                        item.Value[2007] = "0";
                    }
                }
            }
        }
Exemple #3
0
        private static void Postfix(DateFile __instance, ref List <int> __result)
        {
            if (!Main.enabled)
            {
                return;
            }

            try
            {
                foreach (CharId childId in __result)
                {
                    // previousLives存了所有前世身份,最后一条是上一世
                    var previousLives = __instance.actorLife[childId][801];
                    if (previousLives == null || previousLives.Count == 0)
                    {
                        return;
                    }

                    // 尝试进行太吾抢占降生
                    bool isTaiwu = DeadTaiwuManager.instance.tryDeadTaiwuBirthPreemption(childId, ref previousLives);

                    if (Main.settings.lockGenderAll || (Main.settings.lockGenderTaiwu && isTaiwu))
                    {
                        int previousLifeId     = previousLives[previousLives.Count - 1];
                        int previousLifeGender = int.Parse(__instance.GetActorDate(previousLifeId, CharDataIndex.SEX, false));

                        // 性别:1- 男, 2 - 女, 1+2=3,性别翻转用 3-x
                        int gender = Main.settings.lockGenderAlter ? 3 - previousLifeGender : previousLifeGender;
                        __instance.actorsDate[childId][CharDataIndex.SEX] = gender.ToString();

                        // 恢复前世脸以及肤色
                        if (Main.settings.lockFaceAll || (Main.settings.lockFaceTaiwu && isTaiwu))
                        {
                            string face_components = __instance.GetActorDate(previousLifeId, CharDataIndex.FACE_COMPONENTS, false);
                            string face_colors     = __instance.GetActorDate(previousLifeId, CharDataIndex.FACE_COLORS, false);
                            string futa            = __instance.GetActorDate(previousLifeId, CharDataIndex.FUTA, false);

                            int charm = __instance.GetFaceCharm(gender, Array.ConvertAll(face_components.Split(new char[] { '|' }), int.Parse));

                            __instance.actorsDate[childId][CharDataIndex.FACE_COMPONENTS] = face_components;
                            __instance.actorsDate[childId][CharDataIndex.FACE_COLORS]     = face_colors;
                            __instance.actorsDate[childId][CharDataIndex.CHARM]           = charm.ToString();
                            __instance.actorsDate[childId][CharDataIndex.FUTA]            = futa;
                            __instance.MakeActorName(childId, int.Parse(__instance.GetActorDate(childId, 29, false)), __instance.GetActorDate(childId, 5, false), true);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }
Exemple #4
0
        private static void Postfix(DateFile __instance, ref List <int> __result)
        {
            if (!Main.enabled)
            {
                return;
            }

            try
            {
                int childId = __result[0];
                if (__instance.actorLife.ContainsKey(childId))
                {
                    var previousLives = __instance.actorLife[childId][801];
                    if (previousLives.Count > 0)
                    {
                        int previousLifeId = previousLives[previousLives.Count - 1];
                        if (Main.settings.lockGenderAll || (Main.settings.lockGenderTaiwu && isTaiwu(__instance, previousLifeId)))
                        {
                            int previousLifeGender = int.Parse(__instance.GetActorDate(previousLifeId, CharDataIndex.SEX, false));

                            // 性别:1- 男, 2 - 女, 1+2=3,性别翻转用 3-x
                            int gender = Main.settings.lockGenderAlter ? 3 - previousLifeGender : previousLifeGender;
                            __instance.actorsDate[childId][CharDataIndex.SEX] = gender.ToString();

                            // 恢复前世脸以及肤色
                            if (Main.settings.lockFaceAll || (Main.settings.lockFaceTaiwu && isTaiwu(__instance, previousLifeId)))
                            {
                                string face_components = __instance.GetActorDate(previousLifeId, CharDataIndex.FACE_COMPONENTS, false);
                                string face_colors     = __instance.GetActorDate(previousLifeId, CharDataIndex.FACE_COLORS, false);

                                int charm = __instance.GetFaceCharm(gender, Array.ConvertAll(face_components.Split(new char[] { '|' }), int.Parse));

                                __instance.actorsDate[childId][CharDataIndex.FACE_COMPONENTS] = face_components;
                                __instance.actorsDate[childId][CharDataIndex.FACE_COLORS]     = face_colors;
                                __instance.actorsDate[childId][CharDataIndex.CHARM]           = charm.ToString();
                                __instance.MakeActorName(childId, int.Parse(__instance.GetActorDate(childId, 29, false)), __instance.GetActorDate(childId, 5, false), true);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }
Exemple #5
0
 public static int GetActorRank(this DateFile instance, int actorId)
 {
     if (int.TryParse(instance.GetActorDate(actorId, 20, applyBonus: false), out int result))
     {
         return(Mathf.Abs(result));
     }
     return(0);
 }
Exemple #6
0
        public static int GetActorCharm(this DateFile instance, int actorId)
        {
            int CharmValue = int.Parse(instance.GetActorDate(actorId, 15));
            int key        = CharmValue / 100;

            if (key < 4)
            {
                return(key);
            }
            return(key - 1);
        }
        static void TestModValue()
        {
            DateFile   df      = DateFile.instance;
            int        i       = 0;
            List <int> boxQuQu = new List <int>();

            foreach (int[] box in df.cricketBoxDate.Values)
            {
                if (box[0] != -97)
                {
                    boxQuQu.Add(box[0]);
                }
            }

            foreach (int actorId in df.acotrTeamDate)
            {
                if (int.Parse(df.GetActorDate(actorId, 312)) != 0)
                {
                    boxQuQu.Add(int.Parse(df.GetActorDate(actorId, 312)));
                }
            }

            foreach (KeyValuePair <int, Dictionary <int, string> > item in DateFile.instance.itemsDate)
            {
                if ((DateFile.instance.actorItemsDate[10001].ContainsKey(item.Key) || DateFile.instance.actorItemsDate[-999].ContainsKey(item.Key) || boxQuQu.Contains(item.Key)) && item.Value[999] == "10000")
                {
                    i++;
                }
            }

            foreach (int aaa in df.acotrTeamDate)
            {
                Main.logger.Log(aaa.ToString());
            }
            Main.logger.Log(i.ToString() + "个");
        }
Exemple #8
0
 private static bool isTaiwu(DateFile __instance, int charId)
 {
     return(int.Parse(__instance.GetActorDate(charId, CharDataIndex.MOOD, false)) == MagicNum.DEAD_TAIWU_MOOD);
 }
Exemple #9
0
        private void WindowFunction(int windowId)
        {
            if (Input.GetKey(KeyCode.LeftControl))
            {
                GUI.DragWindow(mWindowRect);
            }

            GUILayout.BeginVertical("box");
            GUILayout.BeginHorizontal("box");
            GUILayout.Label("NPC查找器");
            if (GUILayout.Button("关闭", GUILayout.Width(150)))
            {
                ToggleWindow();
            }
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal("box");
            GUILayout.Label("年龄:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(minage.ToString(), 3, GUILayout.Width(30)), out minage);
            GUILayout.Label("--", GUILayout.Width(10));
            int.TryParse(GUILayout.TextField(maxage.ToString(), 3, GUILayout.Width(30)), out maxage);
            GUILayout.Space(10);
            GUILayout.Label("性别:", GUILayout.Width(30));
            GUILayout.Space(5);
            isall = GUILayout.Toggle(isall, "全部", GUILayout.Width(45));
            if (isall)
            {
                iswoman     = false;
                isman       = false;
                genderValue = 0;
            }

            isman = GUILayout.Toggle(isman, "男", GUILayout.Width(30));
            if (isman)
            {
                isall       = false;
                iswoman     = false;
                genderValue = 1;
            }
            iswoman = GUILayout.Toggle(iswoman, "女", GUILayout.Width(30));
            if (iswoman)
            {
                isall       = false;
                isman       = false;
                genderValue = 2;
            }
            GUILayout.Space(10);
            GUILayout.Label("膂力:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(strValue.ToString(), 10, GUILayout.Width(30)), out strValue);
            GUILayout.Space(5);
            GUILayout.Label("体质:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(conValue.ToString(), 10, GUILayout.Width(30)), out conValue);
            GUILayout.Space(5);
            GUILayout.Label("灵敏:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(agiValue.ToString(), 10, GUILayout.Width(30)), out agiValue);
            GUILayout.Space(5);
            GUILayout.Label("根骨:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(bonValue.ToString(), 10, GUILayout.Width(30)), out bonValue);
            GUILayout.Space(5);
            GUILayout.Label("悟性:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(intValue.ToString(), 10, GUILayout.Width(30)), out intValue);
            GUILayout.Space(5);
            GUILayout.Label("定力:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(patValue.ToString(), 10, GUILayout.Width(30)), out patValue);
            GUILayout.Space(5);
            GUILayout.Label("魅力:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(charmValue.ToString(), 10, GUILayout.Width(30)), out charmValue);
            GUILayout.Space(5);
            GUILayout.Label("健康:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(healthValue.ToString(), 10, GUILayout.Width(30)), out healthValue);
            GUILayout.Space(5);
            GUILayout.Label("轮回次数:", GUILayout.Width(60));
            int.TryParse(GUILayout.TextField(samsaraCount.ToString(), 10, GUILayout.Width(30)), out samsaraCount);
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal("box");
            GUILayout.Label("内功:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(gongfa[0].ToString(), 10, GUILayout.Width(30)), out gongfa[0]);
            GUILayout.Space(5);
            GUILayout.Label("身法:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(gongfa[1].ToString(), 10, GUILayout.Width(30)), out gongfa[1]);
            GUILayout.Space(5);
            GUILayout.Label("绝技:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(gongfa[2].ToString(), 10, GUILayout.Width(30)), out gongfa[2]);
            GUILayout.Space(5);
            GUILayout.Label("拳掌:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(gongfa[3].ToString(), 10, GUILayout.Width(30)), out gongfa[3]);
            GUILayout.Space(5);
            GUILayout.Label("指法:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(gongfa[4].ToString(), 10, GUILayout.Width(30)), out gongfa[4]);
            GUILayout.Space(5);
            GUILayout.Label("腿法:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(gongfa[5].ToString(), 10, GUILayout.Width(30)), out gongfa[5]);
            GUILayout.Space(5);
            GUILayout.Label("暗器:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(gongfa[6].ToString(), 10, GUILayout.Width(30)), out gongfa[6]);
            GUILayout.Space(5);
            GUILayout.Label("剑法:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(gongfa[7].ToString(), 10, GUILayout.Width(30)), out gongfa[7]);
            GUILayout.Space(5);
            GUILayout.Label("刀法:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(gongfa[8].ToString(), 10, GUILayout.Width(30)), out gongfa[8]);
            GUILayout.Space(5);
            GUILayout.Label("长兵:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(gongfa[9].ToString(), 10, GUILayout.Width(30)), out gongfa[9]);
            GUILayout.Space(5);
            GUILayout.Label("奇门:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(gongfa[10].ToString(), 10, GUILayout.Width(30)), out gongfa[10]);
            GUILayout.Space(5);
            GUILayout.Label("软兵:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(gongfa[11].ToString(), 10, GUILayout.Width(30)), out gongfa[11]);
            GUILayout.Space(5);
            GUILayout.Label("御射:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(gongfa[12].ToString(), 10, GUILayout.Width(30)), out gongfa[12]);
            GUILayout.Space(5);
            GUILayout.Label("乐器:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(gongfa[13].ToString(), 10, GUILayout.Width(30)), out gongfa[13]);
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal("box");
            GUILayout.Label("音律:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(life[0].ToString(), 10, GUILayout.Width(30)), out life[0]);
            GUILayout.Space(5);
            GUILayout.Label("弈棋:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(life[1].ToString(), 10, GUILayout.Width(30)), out life[1]);
            GUILayout.Space(5);
            GUILayout.Label("诗书:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(life[2].ToString(), 10, GUILayout.Width(30)), out life[2]);
            GUILayout.Space(5);
            GUILayout.Label("绘画:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(life[3].ToString(), 10, GUILayout.Width(30)), out life[3]);
            GUILayout.Space(5);
            GUILayout.Label("术数:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(life[4].ToString(), 10, GUILayout.Width(30)), out life[4]);
            GUILayout.Space(5);
            GUILayout.Label("品鉴:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(life[5].ToString(), 10, GUILayout.Width(30)), out life[5]);
            GUILayout.Space(5);
            GUILayout.Label("锻造:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(life[6].ToString(), 10, GUILayout.Width(30)), out life[6]);
            GUILayout.Space(5);
            GUILayout.Label("制木:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(life[7].ToString(), 10, GUILayout.Width(30)), out life[7]);
            GUILayout.Space(5);
            GUILayout.Label("医术:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(life[8].ToString(), 10, GUILayout.Width(30)), out life[8]);
            GUILayout.Space(5);
            GUILayout.Label("毒术:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(life[9].ToString(), 10, GUILayout.Width(30)), out life[9]);
            GUILayout.Space(5);
            GUILayout.Label("织锦:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(life[10].ToString(), 10, GUILayout.Width(30)), out life[10]);
            GUILayout.Space(5);
            GUILayout.Label("巧匠:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(life[11].ToString(), 10, GUILayout.Width(30)), out life[11]);
            GUILayout.Space(5);
            GUILayout.Label("道法:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(life[12].ToString(), 10, GUILayout.Width(30)), out life[12]);
            GUILayout.Space(5);
            GUILayout.Label("佛学:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(life[13].ToString(), 10, GUILayout.Width(30)), out life[13]);
            GUILayout.Space(5);
            GUILayout.Label("厨艺:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(life[14].ToString(), 10, GUILayout.Width(30)), out life[14]);
            GUILayout.Space(5);
            GUILayout.Label("杂学:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(life[15].ToString(), 10, GUILayout.Width(30)), out life[15]);
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal("box");
            GUILayout.Label("姓名(包括前世):", GUILayout.Width(120));
            name = GUILayout.TextField(name, 10, GUILayout.Width(80));
            //从属gangText
            GUILayout.Label("从属:", GUILayout.Width(50));
            gangValue = GUILayout.TextField(gangValue, 10, GUILayout.Width(60));
            //身份gangLevelText
            //GUILayout.Label("从属:", GUILayout.Width(50));
            //gangValue = GUILayout.TextField(gangValue, 10, GUILayout.Width(60));
            //立场goodnessText
            string goodnessText = "";

            GUILayout.Label("立场:", GUILayout.Width(30));
            for (int i = 0; i < goodness.Length; i++)
            {
                goodness[i] = GUILayout.Toggle(goodness[i], goodnessValue[i].ToString(), GUILayout.Width(45));
                if (goodness[i])
                {
                    for (int j = 0; j < goodness.Length; j++)
                    {
                        if (i != j)
                        {
                            goodness[j]  = false;
                            goodnessText = goodnessValue[i].ToString();
                        }
                    }
                }
            }

            GUILayout.Space(30);
            if (GUILayout.Button("查找", GUILayout.Width(150)))
            {
                actorList.Clear();
                DateFile dateFile = DateFile.instance;
                Dictionary <int, Dictionary <int, string> > actors = dateFile.actorsDate;
                foreach (int index in actors.Keys)
                {
                    Dictionary <int, string> actor = actors[index];
                    int str     = dateFile.BaseAttr(index, 0, 0);
                    int con     = dateFile.BaseAttr(index, 1, 0);
                    int agi     = dateFile.BaseAttr(index, 2, 0);
                    int bon     = dateFile.BaseAttr(index, 3, 0);
                    int inv     = dateFile.BaseAttr(index, 4, 0);
                    int pat     = dateFile.BaseAttr(index, 5, 0);
                    int age     = int.Parse(dateFile.GetActorDate(index, 11, false));
                    int gender  = int.Parse(dateFile.GetActorDate(index, 14, false));
                    int charm   = int.Parse(DateFile.instance.GetActorDate(index, 15, true));
                    int samsara = dateFile.GetLifeDateList(index, 801, false).Count;
                    int health  = ActorMenu.instance.Health(index);

                    if (inv >= intValue &&
                        str >= strValue &&
                        con >= conValue &&
                        agi >= agiValue &&
                        bon >= bonValue &&
                        pat >= patValue &&
                        charm >= charmValue &&
                        age >= minage &&
                        health >= healthValue &&
                        samsara >= samsaraCount &&
                        (maxage == 0 || age <= maxage) &&
                        (genderValue == 0 || gender == genderValue)
                        )
                    {
                        string genderText;
                        if (gender == 1)
                        {
                            genderText = "男";
                        }
                        else
                        {
                            genderText = "女";
                        }
                        string place;
                        if (int.Parse(dateFile.GetActorDate(index, 8, false)) != 1)
                        {
                            place = dateFile.massageDate[8010][3].Split(new char[] { '|' })[1];
                        }
                        else
                        {
                            List <int> list = new List <int>(dateFile.GetActorAtPlace(index));
                            place = string.Format("{0}{1}", new object[]
                            {
                                dateFile.GetNewMapDate(list[0], list[1], 98),
                                dateFile.GetNewMapDate(list[0], list[1], 0)
                            });
                        }

                        string actorName = dateFile.GetActorName(index);

                        string charmText = ((int.Parse(DateFile.instance.GetActorDate(index, 11, false)) > 14) ? ((int.Parse(DateFile.instance.GetActorDate(index, 8, false)) != 1 || int.Parse(DateFile.instance.GetActorDate(index, 305, false)) != 0) ? DateFile.instance.massageDate[25][int.Parse(DateFile.instance.GetActorDate(index, 14, false)) - 1].Split(new char[]
                        {
                            '|'
                        })[Mathf.Clamp(int.Parse(DateFile.instance.GetActorDate(index, 15, true)) / 100, 0, 9)] : DateFile.instance.massageDate[25][5].Split(new char[]
                        {
                            '|'
                        })[1]) : DateFile.instance.massageDate[25][5].Split(new char[]
                        {
                            '|'
                        })[0]);

                        List <int> samsaraList  = dateFile.GetLifeDateList(index, 801, false);
                        string     samsaraNames = "";
                        foreach (int samsaraId in samsaraList)
                        {
                            samsaraNames = samsaraNames + " " + dateFile.GetActorName(samsaraId);
                        }
                        if (GetLevelValue(index, 0, 1) >= gongfa[0] &&
                            GetLevelValue(index, 1, 1) >= gongfa[1] &&
                            GetLevelValue(index, 1, 1) >= gongfa[1] &&
                            GetLevelValue(index, 2, 1) >= gongfa[2] &&
                            GetLevelValue(index, 3, 1) >= gongfa[3] &&
                            GetLevelValue(index, 4, 1) >= gongfa[4] &&
                            GetLevelValue(index, 5, 1) >= gongfa[5] &&
                            GetLevelValue(index, 6, 1) >= gongfa[6] &&
                            GetLevelValue(index, 7, 1) >= gongfa[7] &&
                            GetLevelValue(index, 8, 1) >= gongfa[8] &&
                            GetLevelValue(index, 9, 1) >= gongfa[9] &&
                            GetLevelValue(index, 10, 1) >= gongfa[10] &&
                            GetLevelValue(index, 11, 1) >= gongfa[11] &&
                            GetLevelValue(index, 12, 1) >= gongfa[12] &&
                            GetLevelValue(index, 13, 1) >= gongfa[13] &&
                            GetLevelValue(index, 0, 0) >= life[0] &&
                            GetLevelValue(index, 1, 0) >= life[1] &&
                            GetLevelValue(index, 2, 0) >= life[2] &&
                            GetLevelValue(index, 3, 0) >= life[3] &&
                            GetLevelValue(index, 4, 0) >= life[4] &&
                            GetLevelValue(index, 5, 0) >= life[5] &&
                            GetLevelValue(index, 6, 0) >= life[6] &&
                            GetLevelValue(index, 7, 0) >= life[7] &&
                            GetLevelValue(index, 8, 0) >= life[8] &&
                            GetLevelValue(index, 9, 0) >= life[9] &&
                            GetLevelValue(index, 10, 0) >= life[10] &&
                            GetLevelValue(index, 11, 0) >= life[11] &&
                            GetLevelValue(index, 12, 0) >= life[12] &&
                            GetLevelValue(index, 13, 0) >= life[13] &&
                            GetLevelValue(index, 14, 0) >= life[14] &&
                            GetLevelValue(index, 15, 0) >= life[15]
                            )
                        {
                            string gn      = dateFile.massageDate[9][0].Split(new char[] { '|' })[DateFile.instance.GetActorGoodness(index)];
                            int    groupid = int.Parse(DateFile.instance.GetActorDate(index, 19, false));//身份组ID
                            if (goodnessText.Equals("全部") || gn.Contains(goodnessText))
                            {
                                if ((actorName.Contains(name) || samsaraNames.Contains(name)) && (dateFile.GetGangDate(groupid, 0).Contains(gangValue)))
                                {
                                    int gangLevel   = int.Parse(DateFile.instance.GetActorDate(index, 20, false));                                    //身份等级
                                    int gangValueId = DateFile.instance.GetGangValueId(groupid, gangLevel);
                                    int key2        = (gangLevel >= 0) ? 1001 : (1001 + int.Parse(DateFile.instance.GetActorDate(index, 14, false))); //性别标识

                                    actorList.Add(new string[] { actorName, age.ToString(), genderText, place,
                                                                 charm + "(" + charmText + ")",                                                                                                                         //魅力
                                                                 dateFile.GetGangDate(groupid, 0),                                                                                                                      //从属gangText
                                                                 dateFile.SetColoer((gangValueId != 0) ? (20011 - Mathf.Abs(gangLevel)) : 20002, DateFile.instance.presetGangGroupDateValue[gangValueId][key2], false), //身份gangLevelText
                                                                 gn,                                                                                                                                                    //立场goodnessText
                                                                 GetHealth(index),                                                                                                                                      //健康
                                                                 str.ToString(), con.ToString(), agi.ToString(), bon.ToString(), inv.ToString(), pat.ToString(),
                                                                 GetLevel(index, 0, 1),
                                                                 GetLevel(index, 1, 1),
                                                                 GetLevel(index, 2, 1),
                                                                 GetLevel(index, 3, 1),
                                                                 GetLevel(index, 4, 1),
                                                                 GetLevel(index, 5, 1),
                                                                 GetLevel(index, 6, 1),
                                                                 GetLevel(index, 7, 1),
                                                                 GetLevel(index, 8, 1),
                                                                 GetLevel(index, 9, 1),
                                                                 GetLevel(index, 10, 1),
                                                                 GetLevel(index, 11, 1),
                                                                 GetLevel(index, 12, 1),
                                                                 GetLevel(index, 13, 1),
                                                                 GetLevel(index, 0, 0),
                                                                 GetLevel(index, 1, 0),
                                                                 GetLevel(index, 2, 0),
                                                                 GetLevel(index, 3, 0),
                                                                 GetLevel(index, 4, 0),
                                                                 GetLevel(index, 5, 0),
                                                                 GetLevel(index, 6, 0),
                                                                 GetLevel(index, 7, 0),
                                                                 GetLevel(index, 8, 0),
                                                                 GetLevel(index, 9, 0),
                                                                 GetLevel(index, 10, 0),
                                                                 GetLevel(index, 11, 0),
                                                                 GetLevel(index, 12, 0),
                                                                 GetLevel(index, 13, 0),
                                                                 GetLevel(index, 14, 0),
                                                                 GetLevel(index, 15, 0),
                                                                 samsaraNames });
                                }
                            }
                        }
                    }
                }
            }
            GUILayout.EndHorizontal();

            if (actorList.Count > 0)
            {
                scrollPosition = GUILayout.BeginScrollView(scrollPosition, false, false, new GUIStyle(), new GUIStyle(), GUILayout.Height(80), GUILayout.Width(Screen.width * 0.8f - 40f));
                GUILayout.BeginVertical("Box");
                GUILayout.BeginHorizontal("box");
                var amountWidth = mColumns.Where(x => !x.skip).Sum(x => x.width);
                var expandWidth = mColumns.Where(x => x.expand && !x.skip).Sum(x => x.width);
                var mods        = actorList;
                var colWidth    = mColumns.Select(x =>
                                                  x.expand
                        ? GUILayout.Width(x.width / expandWidth * (960f - 60 + expandWidth - amountWidth))
                        : GUILayout.Width(x.width)).ToArray();
                for (int i = 0; i < mColumns.Count; i++)
                {
                    if (mColumns[i].skip)
                    {
                        continue;
                    }
                    GUILayout.Label(mColumns[i].name, colWidth[i]);
                }
                GUILayout.EndHorizontal();
                GUILayout.BeginHorizontal("box");
                for (int i = 0; i < mColumns.Count; i++)
                {
                    if (mColumns[i].skip)
                    {
                        continue;
                    }
                    if (GUILayout.Button("O", colWidth[i]))
                    {
                        Debug.Log("Clicked the " + mColumns[i].name);
                        sortIndex = i;
                        actorList.Sort(SortList);
                        desc = !desc;
                    }
                }
                GUILayout.EndHorizontal();
                GUILayout.EndVertical();
                GUILayout.EndScrollView();
                scrollPosition2 = GUILayout.BeginScrollView(scrollPosition2, GUILayout.ExpandHeight(false));
                scrollPosition  = new Vector2(scrollPosition2.x, 0);
                GUILayout.BeginVertical("box");
                int c = mods.Count;
                c = c > 50 ? 50 : c;
                for (int i = 0; i < c; i++)
                {
                    GUILayout.BeginVertical("box");
                    GUILayout.BeginHorizontal();
                    for (int j = 0; j < mods[i].Count(); j++)
                    {
                        GUILayout.BeginHorizontal(colWidth[j]);
                        GUILayout.Label(mods[i][j].ToString());
                        GUILayout.EndHorizontal();
                    }
                    GUILayout.EndHorizontal();
                    GUILayout.EndVertical();
                }

                GUILayout.EndVertical();
                GUILayout.EndScrollView();
            }
            GUILayout.EndVertical();
            GUILayout.Space(3);
        }
Exemple #10
0
        void ScanNpc()
        {
            actorList.Clear();
            DateFile dateFile = DateFile.instance;
            Dictionary <int, Dictionary <int, string> > actors = dateFile.actorsDate;

            foreach (int index in actors.Keys)
            {
                Dictionary <int, string> actor = actors[index];
                int str     = dateFile.BaseAttr(index, 0, 0);
                int con     = dateFile.BaseAttr(index, 1, 0);
                int agi     = dateFile.BaseAttr(index, 2, 0);
                int bon     = dateFile.BaseAttr(index, 3, 0);
                int inv     = dateFile.BaseAttr(index, 4, 0);
                int pat     = dateFile.BaseAttr(index, 5, 0);
                int age     = int.Parse(dateFile.GetActorDate(index, 11, false));
                int gender  = int.Parse(dateFile.GetActorDate(index, 14, false));
                int charm   = int.Parse(DateFile.instance.GetActorDate(index, 15, true));
                int samsara = dateFile.GetLifeDateList(index, 801, false).Count;
                int health  = ActorMenu.instance.Health(index);
                int cv      = charmValue;
                if (charmValue == 0)
                {
                    cv = -999;
                }

                if (inv >= intValue &&
                    str >= strValue &&
                    con >= conValue &&
                    agi >= agiValue &&
                    bon >= bonValue &&
                    pat >= patValue &&
                    charm >= cv &&
                    age >= minage &&
                    health >= healthValue &&
                    samsara >= samsaraCount &&
                    (maxage == 0 || age <= maxage) &&
                    (genderValue == 0 || gender == genderValue)
                    )
                {
                    string genderText;
                    if (gender == 1)
                    {
                        genderText = "男";
                    }
                    else
                    {
                        genderText = "女";
                    }
                    string place;
                    if (int.Parse(dateFile.GetActorDate(index, 8, false)) != 1)
                    {
                        place = dateFile.massageDate[8010][3].Split(new char[] { '|' })[1];
                    }
                    else
                    {
                        List <int> list = new List <int>(dateFile.GetActorAtPlace(index));
                        place = string.Format("{0}{1}", new object[]
                        {
                            dateFile.GetNewMapDate(list[0], list[1], 98),
                            dateFile.GetNewMapDate(list[0], list[1], 0)
                        });
                    }

                    string actorName = dateFile.GetActorName(index);

                    string charmText = ((int.Parse(DateFile.instance.GetActorDate(index, 11, false)) > 14) ? ((int.Parse(DateFile.instance.GetActorDate(index, 8, false)) != 1 || int.Parse(DateFile.instance.GetActorDate(index, 305, false)) != 0) ? DateFile.instance.massageDate[25][int.Parse(DateFile.instance.GetActorDate(index, 14, false)) - 1].Split(new char[]
                    {
                        '|'
                    })[Mathf.Clamp(int.Parse(DateFile.instance.GetActorDate(index, 15, true)) / 100, 0, 9)] : DateFile.instance.massageDate[25][5].Split(new char[]
                    {
                        '|'
                    })[1]) : DateFile.instance.massageDate[25][5].Split(new char[]
                    {
                        '|'
                    })[0]);

                    List <int> samsaraList  = dateFile.GetLifeDateList(index, 801, false);
                    string     samsaraNames = "";
                    foreach (int samsaraId in samsaraList)
                    {
                        samsaraNames = samsaraNames + " " + dateFile.GetActorName(samsaraId);
                    }

                    int[] actorResources = ActorMenu.instance.GetActorResources(index);

                    if (GetLevelValue(index, 0, 1) >= gongfa[0] &&
                        GetLevelValue(index, 1, 1) >= gongfa[1] &&
                        GetLevelValue(index, 1, 1) >= gongfa[1] &&
                        GetLevelValue(index, 2, 1) >= gongfa[2] &&
                        GetLevelValue(index, 3, 1) >= gongfa[3] &&
                        GetLevelValue(index, 4, 1) >= gongfa[4] &&
                        GetLevelValue(index, 5, 1) >= gongfa[5] &&
                        GetLevelValue(index, 6, 1) >= gongfa[6] &&
                        GetLevelValue(index, 7, 1) >= gongfa[7] &&
                        GetLevelValue(index, 8, 1) >= gongfa[8] &&
                        GetLevelValue(index, 9, 1) >= gongfa[9] &&
                        GetLevelValue(index, 10, 1) >= gongfa[10] &&
                        GetLevelValue(index, 11, 1) >= gongfa[11] &&
                        GetLevelValue(index, 12, 1) >= gongfa[12] &&
                        GetLevelValue(index, 13, 1) >= gongfa[13] &&
                        GetLevelValue(index, 0, 0) >= life[0] &&
                        GetLevelValue(index, 1, 0) >= life[1] &&
                        GetLevelValue(index, 2, 0) >= life[2] &&
                        GetLevelValue(index, 3, 0) >= life[3] &&
                        GetLevelValue(index, 4, 0) >= life[4] &&
                        GetLevelValue(index, 5, 0) >= life[5] &&
                        GetLevelValue(index, 6, 0) >= life[6] &&
                        GetLevelValue(index, 7, 0) >= life[7] &&
                        GetLevelValue(index, 8, 0) >= life[8] &&
                        GetLevelValue(index, 9, 0) >= life[9] &&
                        GetLevelValue(index, 10, 0) >= life[10] &&
                        GetLevelValue(index, 11, 0) >= life[11] &&
                        GetLevelValue(index, 12, 0) >= life[12] &&
                        GetLevelValue(index, 13, 0) >= life[13] &&
                        GetLevelValue(index, 14, 0) >= life[14] &&
                        GetLevelValue(index, 15, 0) >= life[15]
                        )
                    {
                        string gn            = dateFile.massageDate[9][0].Split(new char[] { '|' })[DateFile.instance.GetActorGoodness(index)];
                        int    groupid       = int.Parse(DateFile.instance.GetActorDate(index, 19, false));                                                                                           //身份组ID
                        int    gangLevel     = int.Parse(DateFile.instance.GetActorDate(index, 20, false));                                                                                           //身份等级
                        int    gangValueId   = DateFile.instance.GetGangValueId(groupid, gangLevel);
                        int    key2          = (gangLevel >= 0) ? 1001 : (1001 + int.Parse(DateFile.instance.GetActorDate(index, 14, false)));                                                        //性别标识
                        string gangLevelText = dateFile.SetColoer((gangValueId != 0) ? (20011 - Mathf.Abs(gangLevel)) : 20002, DateFile.instance.presetGangGroupDateValue[gangValueId][key2], false); //身份gangLevelText

                        if (ScanFeature(index, GetFeatureKey(actorFeatureText)) || actorFeatureText == "")
                        {
                            if (goodnessText.Equals("全部") || gn.Contains(goodnessText))
                            {
                                if ((actorName.Contains(name) || samsaraNames.Contains(name)) && (dateFile.GetGangDate(groupid, 0).Contains(gangValue)) && (gangLevelText.Contains(gangLevelValue)))
                                {
                                    actorList.Add(new string[] { actorName, age.ToString(), genderText, place,
                                                                 charm + "(" + charmText + ")",    //魅力
                                                                 dateFile.GetGangDate(groupid, 0), //从属gangText
                                                                 gangLevelText,                    //身份gangLevelText
                                                                 gn,                               //立场goodnessText
                                                                 GetSpouse(index),                 //
                                                                 GetSkillDevelopText(index),
                                                                 GetGongFaDevelopText(index),
                                                                 GetHealth(index),//健康
                                                                 str.ToString(), con.ToString(), agi.ToString(), bon.ToString(), inv.ToString(), pat.ToString(),
                                                                 GetLevel(index, 0, 1),
                                                                 GetLevel(index, 1, 1),
                                                                 GetLevel(index, 2, 1),
                                                                 GetLevel(index, 3, 1),
                                                                 GetLevel(index, 4, 1),
                                                                 GetLevel(index, 5, 1),
                                                                 GetLevel(index, 6, 1),
                                                                 GetLevel(index, 7, 1),
                                                                 GetLevel(index, 8, 1),
                                                                 GetLevel(index, 9, 1),
                                                                 GetLevel(index, 10, 1),
                                                                 GetLevel(index, 11, 1),
                                                                 GetLevel(index, 12, 1),
                                                                 GetLevel(index, 13, 1),
                                                                 GetLevel(index, 0, 0),
                                                                 GetLevel(index, 1, 0),
                                                                 GetLevel(index, 2, 0),
                                                                 GetLevel(index, 3, 0),
                                                                 GetLevel(index, 4, 0),
                                                                 GetLevel(index, 5, 0),
                                                                 GetLevel(index, 6, 0),
                                                                 GetLevel(index, 7, 0),
                                                                 GetLevel(index, 8, 0),
                                                                 GetLevel(index, 9, 0),
                                                                 GetLevel(index, 10, 0),
                                                                 GetLevel(index, 11, 0),
                                                                 GetLevel(index, 12, 0),
                                                                 GetLevel(index, 13, 0),
                                                                 GetLevel(index, 14, 0),
                                                                 GetLevel(index, 15, 0),
                                                                 actorResources[0].ToString(),
                                                                 actorResources[1].ToString(),
                                                                 actorResources[2].ToString(),
                                                                 actorResources[3].ToString(),
                                                                 actorResources[4].ToString(),
                                                                 actorResources[5].ToString(),
                                                                 actorResources[6].ToString(),
                                                                 samsaraNames,
                                                                 GetActorFeatureNameText(index) });
                                }
                            }
                        }
                    }
                }
            }
        }
Exemple #11
0
        private void WindowFunction(int windowId)
        {
            if (Input.GetKey(KeyCode.LeftControl))
            {
                GUI.DragWindow(mWindowRect);
            }

            GUILayout.BeginVertical("box");
            GUILayout.BeginHorizontal("box");
            GUILayout.Label("NPC查找器");
            if (GUILayout.Button("关闭", GUILayout.Width(150)))
            {
                ToggleWindow();
            }
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal("box");
            GUILayout.Label("年龄:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(minage.ToString(), 3, GUILayout.Width(30)), out minage);
            GUILayout.Label("--", GUILayout.Width(10));
            int.TryParse(GUILayout.TextField(maxage.ToString(), 3, GUILayout.Width(30)), out maxage);
            GUILayout.Space(5);
            GUILayout.Label("性别:", GUILayout.Width(30));
            GUILayout.Space(5);
            isall = GUILayout.Toggle(isall, "全部", GUILayout.Width(45));
            if (isall)
            {
                iswoman     = false;
                isman       = false;
                genderValue = 0;
            }

            isman = GUILayout.Toggle(isman, "男", GUILayout.Width(30));
            if (isman)
            {
                isall       = false;
                iswoman     = false;
                genderValue = 1;
            }
            iswoman = GUILayout.Toggle(iswoman, "女", GUILayout.Width(30));
            if (iswoman)
            {
                isall       = false;
                isman       = false;
                genderValue = 2;
            }
            GUILayout.Space(10);
            GUILayout.Label("膂力:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(strValue.ToString(), 10, GUILayout.Width(30)), out strValue);
            GUILayout.Space(5);
            GUILayout.Label("体质:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(conValue.ToString(), 10, GUILayout.Width(30)), out conValue);
            GUILayout.Space(5);
            GUILayout.Label("灵敏:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(agiValue.ToString(), 10, GUILayout.Width(30)), out agiValue);
            GUILayout.Space(5);
            GUILayout.Label("根骨:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(bonValue.ToString(), 10, GUILayout.Width(30)), out bonValue);
            GUILayout.Space(5);
            GUILayout.Label("悟性:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(intValue.ToString(), 10, GUILayout.Width(30)), out intValue);
            GUILayout.Space(5);
            GUILayout.Label("定力:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(patValue.ToString(), 10, GUILayout.Width(30)), out patValue);
            GUILayout.Space(5);
            GUILayout.Label("魅力:", GUILayout.Width(30));
            int.TryParse(GUILayout.TextField(charmValue.ToString(), 10, GUILayout.Width(30)), out charmValue);
            GUILayout.Space(50);
            if (GUILayout.Button("查找", GUILayout.Width(150)))
            {
                actorList.Clear();
                DateFile dateFile = DateFile.instance;
                Dictionary <int, Dictionary <int, string> > actors = dateFile.actorsDate;
                foreach (int index in actors.Keys)
                {
                    Dictionary <int, string> actor = actors[index];
                    int str    = dateFile.BaseAttr(index, 0, 0);
                    int con    = dateFile.BaseAttr(index, 1, 0);
                    int agi    = dateFile.BaseAttr(index, 2, 0);
                    int bon    = dateFile.BaseAttr(index, 3, 0);
                    int inv    = dateFile.BaseAttr(index, 4, 0);
                    int pat    = dateFile.BaseAttr(index, 5, 0);
                    int age    = int.Parse(dateFile.GetActorDate(index, 11, false));
                    int gender = int.Parse(dateFile.GetActorDate(index, 14, false));
                    int charm  = int.Parse(DateFile.instance.GetActorDate(index, 15, true));
                    if (inv >= intValue &&
                        str > strValue &&
                        con > conValue &&
                        agi > agiValue &&
                        bon > bonValue &&
                        pat > patValue &&
                        charm > charmValue &&
                        age > minage &&
                        (maxage == 0 || age < maxage) &&
                        (genderValue == 0 || gender == genderValue)
                        )
                    {
                        string genderText;
                        if (gender == 1)
                        {
                            genderText = "男";
                        }
                        else
                        {
                            genderText = "女";
                        }
                        string place;
                        if (int.Parse(dateFile.GetActorDate(index, 8, false)) != 1)
                        {
                            place = dateFile.massageDate[8010][3].Split(new char[] { '|' })[1];
                        }
                        else
                        {
                            List <int> list = new List <int>(dateFile.GetActorAtPlace(index));
                            place = string.Format("{0}{1}", new object[]
                            {
                                dateFile.GetNewMapDate(list[0], list[1], 98),
                                dateFile.GetNewMapDate(list[0], list[1], 0)
                            });
                        }

                        string charmText = ((int.Parse(DateFile.instance.GetActorDate(index, 11, false)) > 14) ? ((int.Parse(DateFile.instance.GetActorDate(index, 8, false)) != 1 || int.Parse(DateFile.instance.GetActorDate(index, 305, false)) != 0) ? DateFile.instance.massageDate[25][int.Parse(DateFile.instance.GetActorDate(index, 14, false)) - 1].Split(new char[]
                        {
                            '|'
                        })[Mathf.Clamp(int.Parse(DateFile.instance.GetActorDate(index, 15, true)) / 100, 0, 9)] : DateFile.instance.massageDate[25][5].Split(new char[]
                        {
                            '|'
                        })[1]) : DateFile.instance.massageDate[25][5].Split(new char[]
                        {
                            '|'
                        })[0]);

                        actorList.Add(string.Format("\n姓名:{1}  年龄:{8}  性别:{9}  位置:{10}  魅力:{11}  膂力:{2}  体质:{3}  灵敏:{4}  根骨:{5}  悟性:{6}  定力:{7} ", index, dateFile.GetActorName(index), str, con, agi, bon, inv, pat, age, genderText, place, charm + "(" + charmText + ")"));
                    }
                }
            }
            GUILayout.EndHorizontal();
            if (actorList.Count > 0)
            {
                scrollPosition = GUILayout.BeginScrollView(scrollPosition, GUILayout.ExpandHeight(false));
                foreach (string actor in actorList)
                {
                    GUILayout.Label(actor);
                }
                GUILayout.EndScrollView();
            }
            GUILayout.EndVertical();
            GUILayout.Space(3);
        }