示例#1
0
        static void OnGUI(UnityModManager.ModEntry modEntry)
        {
            GUILayout.Label("  修改了一些龙岛忠仆的特性,可称最强忠仆!");
            GUILayout.Label("<color=#8FBAE7FF>【志同道合】</color> 与太吾传人立场一致,不求...但求....");
            GUILayout.Label("<color=#F28234FF>【龙·神赐】</color> 被龙神赋予更长的阳寿,神赐·不朽.");
            GUILayout.Label("<color=#E4504DFF>【天资·艺】</color> 夺天造化,大幅增强八项技艺的资质.");
            GUILayout.Label("<color=#E4504DFF>【天资·武】</color> 夺天造化,大幅增强四项进攻武学的资质,大幅增强内功身法绝技的资质.");
            //10%的概率化身
            GUILayout.Label("  大幅优化龙仆造型、魅力,10%的概率化身,跟太吾拥有相同的外观");
            //GUILayout.Label("  <color=#FF0000FF>如果要删除本MOD,请在对应存档内按下清除新特性的按钮并存档,避免坏档,清除新特性只影响显示效果,忠仆不会消失</color>");
            //检测存档
            DateFile tbl = DateFile.instance;

            if (tbl == null || tbl.actorsDate == null || !tbl.actorsDate.ContainsKey(tbl.mianActorId))
            {
                GUILayout.Label("  存档未载入!");
            }
            else
            {
                if (GUILayout.Button("天地洪炉,重置太吾属性,!"))
                {
                    PlayerStrong();
                }

                if (GUILayout.Button("重置太吾道友"))
                {
                    TeamRemoveImpurity();
                }
                //if (GUILayout.Button("清除新特性"))
                //{
                //    deletNewFeature();
                //}
            }
        }
示例#2
0
        static void OnGUI(UnityModManager.ModEntry modEntry)
        {
            GUILayout.Label("  修改了一些龙岛忠仆的特性,让忠仆更适合太吾村的发展!");
            GUILayout.Label("  获取忠仆可以获取太吾各项属性的10%的资质!内功身法绝技为20%");
            GUILayout.Label("  忠仆默认与太吾处事立场相同!");
            GUILayout.Label("  忠仆会获得抓周特性和随机一个特殊特性!特殊特性为【梦境中人】【神锋敛彩】【璞玉韬光】");
            GUILayout.Label("  忠仆默认16岁,寿命至少为60岁!");
            GUILayout.BeginHorizontal();
            GUILayout.Label("  太吾教育中心:招募忠仆时花费银钱进行专业培训:");
            var guiPracticeMoney = GUILayout.TextField(Main.practiceMoney.ToString(), 3, GUILayout.Width(85));

            if (GUI.changed && !int.TryParse(guiPracticeMoney, out Main.practiceMoney))
            {
                Main.practiceMoney = 0;
            }
            GUILayout.Label("万;每1万银钱可额外提升忠仆各项资质1点");
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();
            GUILayout.Label("  <color=#FF0000FF>如果要删除原【龙岛忠仆】本MOD,请在对应存档内按下清除新特性的按钮并存档,避免坏档,清除新特性只影响显示效果,忠仆不会消失</color>");

            //检测存档
            DateFile tbl = DateFile.instance;

            if (tbl == null || Game.Instance.GetCurrentGameStateName().ToString() != eGameState.InGame.ToString())
            {
                GUILayout.Label("  存档未载入!");
            }
            else
            {
                if (GUILayout.Button("清除新特性"))
                {
                    DeletNewFeature();
                }
            }
        }
示例#3
0
        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";
                        }
                    }
                }
            }
        }
示例#4
0
        static void TestModValue()
        {
            DateFile df = DateFile.instance;

            if (Main.settings.ququList.Count > 0)
            {
                foreach (KeyValuePair <int, Dictionary <int, string> > ququ in DateFile.instance.cricketDate)
                {
                    if (Main.settings.ququList.Contains(ququ.Key))
                    {
                        ququ.Value[9] = "-20";
                        ququ.Value[6] = "100";
                    }
                    else
                    {
                        ququ.Value[9] = "50";
                        ququ.Value[6] = "1";
                    }
                }
            }
            else
            {
                Main.logger.Log("没有选择蛐蛐");
            }
        }
示例#5
0
        private void FetchFieldValue(DateFile dateFileInstance, ActorMenu actorMenuInstance, Dictionary <int, string> actorDate, int resid)
        {
            switch (resid)
            {
            case -1:
                fieldValues[resid] = dateFileInstance.gongFaExperienceP.ToString();
                break;

            case 12:
                if (actorMenuInstance != null)
                {
                    fieldValues[resid] = actorMenuInstance.Health(lastActorId).ToString();
                }
                else
                {
                    fieldValues.Remove(resid);
                }
                break;

            default:
                if (!actorDate.TryGetValue(resid, out string text))
                {
                    if (!dateFileInstance.presetActorDate.TryGetValue(lastActorId, out Dictionary <int, string> presetActorData) || !presetActorData.TryGetValue(resid, out text))
                    {
                        text = "0";
                    }
                }
                fieldValues[resid] = text;
                break;
            }
        }
示例#6
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";
                    }
                }
            }
        }
示例#7
0
文件: UI.cs 项目: sheoly/Taiwu_mods
        /// <summary>
        /// 修改相枢入邪值
        /// </summary>
        /// <param name="instance">DateFile类的实例</param>
        private void DisplayXXField(DateFile instance)
        {
            int evilValue = Helper.LifeDateHelper(instance, 501, actorId);

            GUILayout.BeginHorizontal();
            GUILayout.Box("当前入邪值: ", boxStyle, GUILayout.Width(evilButtonWidth));
            if (evilValue == -1)
            {
                GUILayout.Box("无", boxStyle, GUILayout.Width(evilButtonWidth));
                GUILayout.EndHorizontal();
            }
            else
            {
                GUILayout.Box($"{evilValue}", boxStyle, GUILayout.Width(evilButtonWidth));
                GUILayout.EndHorizontal();
                GUILayout.BeginHorizontal();
                if (GUILayout.Button("恢复正常", buttonStyle, GUILayout.Width(evilButtonWidth)))
                {
                    Helper.SetActorXXValue(instance, actorId, 0);
                }
                if (GUILayout.Button("相枢入邪", buttonStyle, GUILayout.Width(evilButtonWidth)))
                {
                    Helper.SetActorXXValue(instance, actorId, 100);
                }
                if (actorId != 0 && actorId != instance.mianActorId)
                {
                    if (GUILayout.Button("相枢化魔", buttonStyle, GUILayout.Width(evilButtonWidth)))
                    {
                        Helper.SetActorXXValue(instance, actorId, 200);
                    }
                }
                GUILayout.EndHorizontal();
            }
        }
示例#8
0
            public static void Postfix(DateFile __instance, Dictionary <int, string> itemData, int baseItemId, int powerId)
            {
                //    DateFile.instance.actorSkills[id][]修习度[]心法等级
                bool YixiangMaster = DateFile.instance.actorSkills.ContainsKey(107);//&&DateFile.instance.actorSkills[107][0]==100&& DateFile.instance.actorSkills[107][1] == 10;

                if (DateFile.instance.presetitemDate[baseItemId][1] == "3" && powerId == 407 && YixiangMaster)
                {
                    List <string> RuneLib = new List <string>
                    {
                        "2001",
                        "2002",
                        "2003",
                        "2004",
                        "2005",
                        "2006",
                        "2007",
                        "2008",
                        "2009",
                        "2010",
                        "2011",
                        "2012",
                        "2013",
                        "2014",
                        "2015",
                        "2016",
                        "2017",
                        "2018",
                        "2019",
                        "2020"
                    };
                    itemData[504] = RuneLib[UnityEngine.Random.Range(0, RuneLib.Count)];
                    //itemData[504] = "2001";
                }
            }
示例#9
0
 static void Postfix(DateFile __instance, int gangId, int partId, int fatherId, int motherId, int __result)
 {
     if (!Main.enabled || !Main.settings.lunhuiAdvanced)
     {
         return;
     }
     if (__instance.deadActors.Count > 0 && fatherId == 0 && motherId == 0)
     {
         int        num32 = __instance.deadActors[UnityEngine.Random.Range(0, __instance.deadActors.Count)];
         List <int> value = new List <int>(__instance.GetLifeDateList(num32, 801, false))
         {
             num32
         };
         __instance.actorLife[__result].Add(801, value);
         if (__instance.GetActorFavor(false, __instance.MianActorID(), num32, false, false) >= 30000)
         {
             UIDate.instance.changTrunEvents.Add(new int[]
             {
                 239,
                 num32,
                 partId
             });
         }
         __instance.deadActors.Remove(num32);
     }
 }
示例#10
0
            public static void Postfix(DateFile __instance, ref int __result, int characterId)
            {
                int  ID      = DateFile.instance.MianActorID();
                bool isActor = ID == characterId;

                if (isActor && IsEquipped(ID, "2004"))                 //内谐,2004
                {
                    __result = 50;
                    //BattleSystem.instance.ShowBattleState(50004, true, 0);
                }
                else if (isActor && IsEquipped(ID, "2006"))//阴韵,2006
                {
                    __result = 100;
                }
                else if (isActor && IsEquipped(ID, "2007"))//阳韵,2007
                {
                    __result = 0;
                }

                if (!isActor && IsEquipped(ID, "2005"))//外谐,2005
                {
                    __result = 50;
                    //BattleSystem.instance.ShowBattleState(50005, true, 0);
                }
            }
示例#11
0
        static void OnGUI(UnityModManager.ModEntry modEntry)
        {
            GUILayout.Label("  修改了一些龙岛忠仆的特性,让忠仆更适合太吾村的发展!");
            GUILayout.Label("<color=#8FBAE7FF>【志同道合】</color> 龙岛忠仆的处世立场与玩家获得忠仆时的立场相同.");
            GUILayout.Label("<color=#F28234FF>【龙神赐寿】</color> 每个龙岛忠仆都被龙神赋予更长的阳寿,终生侍奉主人.");
            GUILayout.Label("<color=#E4504DFF>【天资·艺】</color> 化全身资质于一道,大幅增强一项技艺的资质.");
            GUILayout.Label("<color=#E4504DFF>【天资·武】</color> 化全身资质于一道,大幅增强一项进攻武学的资质,中幅增强内功身法绝技的资质.");
            GUILayout.Label("  注: 天资特性只会是人物原本资质最好的一项");
            GUILayout.Label("  <color=#FF0000FF>如果要删除本MOD,请在对应存档内按下清除新特性的按钮并存档,避免坏档,清除新特性只影响显示效果,忠仆不会消失</color>");

            //检测存档
            DateFile tbl = DateFile.instance;

            //if (tbl == null || tbl.actorsDate == null || !tbl.actorsDate.ContainsKey(tbl.mianActorId))
            if (tbl == null || Game.Instance.GetCurrentGameStateName().ToString() != eGameState.InGame.ToString())
            {
                GUILayout.Label("  存档未载入!");
            }
            else
            {
                if (GUILayout.Button("清除新特性"))
                {
                    DeletNewFeature();
                }
            }
        }
示例#12
0
        static void Postfix(DateFile __instance, ref string __result, ref int id, ref int index, ref bool otherMassage)
        {
            if (index != 0 || !otherMassage)
            {
                return;
            }
            if (__result.Length < 2)
            {
                return;
            }
            if (!DateFile.instance.itemsDate.TryGetValue(id, out var dict))
            {
                return;
            }
            int presetId = int.Parse(dict[999]);

            if (!DateFile.instance.presetitemDate.TryGetValue(presetId, out var dict2))
            {
                return;
            }
            if (dict2[2001] != "1")
            {
                return;
            }
            //获取数据
            if (Main.GetModDate(out var modDate, ModDate.ququ) && modDate.ContainsKey(id.ToString()))
            {
                var actorInfo = modDate[id.ToString()].Split(Main.Separator);
                __result += "\n" + actorInfo[0];
            }
示例#13
0
        static void OnGUI(UnityModManager.ModEntry modEntry)
        {
            GUILayout.BeginHorizontal();
            GUILayout.Label("  <color=#FF0000FF>如果要删除本MOD,请在对应存档内按下清除并存档," +
                            "  清除会删除所有额外开辟的村庄和建筑和太吾村卷轴\n为防止坏档,请务必" +
                            "在大地图界面点击此按钮!\n这数据结构太tm操蛋了,我不确定有没有少删或" +
                            "多删,不建议点。</color>");
            //检测存档
            DateFile tbl = DateFile.instance;

            if (tbl == null || tbl.actorsDate == null || !tbl.actorsDate.ContainsKey(tbl.mianActorId))
            {
                GUILayout.Label("  存档未载入!");
            }
            else
            {
                if (Main.enabled)
                {
                    GUILayout.Label("  关闭Mod后才能清除!");
                }
                else if (GUILayout.Button("清除"))
                {
                    DeleteAll();
                }
            }
            GUILayout.EndHorizontal();
        }
示例#14
0
        static void Postfix(WindowManage __instance, bool on, GameObject tips)
        {
            if (!Main.enabled || !Main.settings.mergeIcon)
            {
                return;
            }
            bool flag = false;

            if (tips == null)
            {
                __instance.anTips = flag;
            }
            else
            {
                if (on)
                {
                    flag = true;
                    int      num   = DateFile.instance.MianActorID();
                    string[] array = tips.name.Split(new char[]
                    {
                        ','
                    });
                    Changer changer = new Changer();

                    int num2 = (array.Length <= 1) ? 0 : int.Parse(array[1]);
                    if ((num2 == 634 || num2 == 635) && StartBattle.instance.startBattleWindow.activeSelf && StartBattle.instance.enemyTeamId == 4)
                    {
                        flag = false;
                    }
                    DateFile df  = DateFile.instance;
                    string   tag = tips.tag;
                    switch (tag)
                    {
                    case "TrunEventIcon":
                    {
                        int num27 = int.Parse(DateFile.instance.trunEventDate[num2][1]);
                        __instance.informationName.text = DateFile.instance.trunEventDate[num2][0];
                        switch (num27)
                        {
                        case 10:
                            string[] placeArray = changer.getPlaceIds().Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
                            string   placeNames = "";
                            for (int i = 0; i < placeArray.Length; i++)
                            {
                                string pid   = placeArray[i];
                                string pName = DateFile.instance.partWorldMapDate[int.Parse(pid)][0];
                                placeNames = (placeNames == "") ? pName : placeNames + "、" + pName;
                            }
                            string pre  = df.trunEventDate[num2][99].Split(new char[] { '|' })[0];
                            string post = df.trunEventDate[num2][99].Split(new char[] { '|' })[1];
                            __instance.informationMassage.text = string.Format("{0}{1}{2}\n", pre, df.SetColoer(10002, placeNames), post);
                            break;
                        }
                    }
                    break;
                    }
                }
            }
        }
示例#15
0
        //301莫逆之交 302兄弟姐妹 303亲生父母 304义父义母 305授业恩师 306两情相悦
        //307恩深意重 308义结金兰 309配偶 310子嗣 312倾心爱慕 少311,推测为嫡系传人
        public string analyzeSocial(int actorId)
        {
            DateFile df = DateFile.instance;

            //DateFile.instance.GetActorSocial(id, 310, false).Count
            Main.Logger.Log("---------------------------------------------------");
            return(this.analyzeParent(actorId));
        }
示例#16
0
 public static int GetItemDateValue(this DateFile df, int itemId, int itemDateKey)
 {
     if (int.TryParse(DateFile.instance.GetItemDate(itemId, itemDateKey), out int value))
     {
         return(value);
     }
     return(0);
 }
示例#17
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);
 }
示例#18
0
        /// <summary>
        /// 执行合并道具
        /// </summary>
        public static void RunningMergeItems()
        {
            if (!Main.enabled || Main.settings.bookLevel.Count == 0 || Main.settings.bookMergeType.Count == 0)
            {
                return;
            }

            DateFile df = DateFile.instance;
            Dictionary <int, string[]> items   = new Dictionary <int, string[]>();
            Dictionary <int, int>      itemsId = new Dictionary <int, int>();

            if (df.actorItemsDate.TryGetValue(df.mianActorId, out itemsId))
            {
                Main.LevelSon = new List <int> {
                    DateFile.instance.enemyBorn, DateFile.instance.xxLevel, DateFile.instance.enemySize,
                    DateFile.instance.worldResource, DateFile.instance.randomHeir
                };

                //处理人物身上所有书籍
                List <int> buffer = itemsId.Keys.ToList();
                foreach (int itemId in buffer)
                {
                    string id = df.GetItemDate(itemId, 999), surpluses = df.GetItemDate(itemId, 901), limit = df.GetItemDate(itemId, 902),
                             level = df.GetItemDate(itemId, 8), type = df.GetItemDate(itemId, 5), group = df.GetItemDate(itemId, 98);
                    if (type != "21" || !Main.settings.bookMergeType.Contains(int.Parse(group)))
                    {
                        continue;
                    }
                    if (!Main.settings.bookLevel.Contains(int.Parse(level)) || id == "5005")
                    {
                        continue;
                    }

                    if (items.ContainsKey(int.Parse(id)))
                    {
                        items[int.Parse(id)][0] = (int.Parse(surpluses) + int.Parse(items[int.Parse(id)][0])).ToString();
                        items[int.Parse(id)][1] = (int.Parse(limit) + int.Parse(items[int.Parse(id)][1])).ToString();
                        items[int.Parse(id)][2] = ProcessingPages(df.itemsDate[itemId][33], items[int.Parse(id)][2], int.Parse(group), int.Parse(level));
                    }
                    else
                    {
                        items.Add(int.Parse(id), new string[] { surpluses, limit, df.itemsDate[itemId][33] });
                    }

                    df.LoseItem(df.mianActorId, itemId, itemsId[itemId], true);
                }

                //生成合并后的书籍
                foreach (KeyValuePair <int, string[]> item in items)
                {
                    int makeItemId = df.MakeNewItem(item.Key);
                    df.GetItem(df.mianActorId, makeItemId, 1, false, -1, 0);
                    df.itemsDate[makeItemId][901] = item.Value[0];
                    df.itemsDate[makeItemId][902] = item.Value[1];
                    df.itemsDate[makeItemId][33]  = item.Value[2];
                }
            }
        }
示例#19
0
文件: UI.cs 项目: sheoly/Taiwu_mods
        /// <summary>
        /// 修改属性和资源
        /// </summary>
        /// <param name="instance">DateFile类的实例</param>
        private void ModData(DateFile instance)
        {
            GUILayout.BeginVertical("box");
            for (int k = 0; k < dataTabNames.Length; k++)
            {
                if (GUILayout.Button(dataTabNames[k], propertiesUIButtonStyle, GUILayout.ExpandWidth(true)))
                {
                    helper.ResetAllFields();
                    showTabDetails = (showTabDetails == k) ? (-1) : k;
                }

                if (showTabDetails == k)
                {
                    switch (k)
                    {
                    case 0:
                        // 基本属性 resid 61-66
                        DisplayDataFields(61, 67);
                        break;

                    case 1:
                        // 资源 resid 401-407
                        DisplayDataFields(401, 408);
                        break;

                    case 2:
                        // 技艺资质 resid 501-516
                        DisplayDataFields(501, 517);
                        break;

                    case 3:
                        // 功法资质 resid 601-614
                        DisplayDataFields(601, 615);
                        break;

                    case 4:
                        if (actorId == instance.mianActorId)
                        {
                            // 历练 此处resid无实际意义,在update()换算成对应的字段
                            helper.FieldHelper(-1);
                            // 无属性内力 id 44
                            helper.FieldHelper(706);
                            GUILayout.Label("每10点无属性内力增加1点真气", labelStyle);
                        }
                        break;

                    case 5:
                        DisplayHealthAge();
                        break;

                    case 6:
                        DisplayXXField(instance);
                        break;
                    }
                }
            }
            GUILayout.EndVertical();
        }
示例#20
0
        /// <summary>
        /// 新建道具
        /// </summary>
        /// <param name="items">道具字典</param>
        public static void MakeMergeItem(Dictionary <int, int[]> items)
        {
            if (items.Count <= 0)
            {
                return;
            }

            DateFile df = DateFile.instance;

            foreach (KeyValuePair <int, int[]> item in items)
            {
                int id = int.Parse(df.GetItemDate(item.Key, 999)), surpluses = int.Parse(df.GetItemDate(item.Key, 901)), limit = int.Parse(df.GetItemDate(item.Key, 902)),
                                               level = int.Parse(df.GetItemDate(item.Key, 8)), type = int.Parse(df.GetItemDate(item.Key, 5));

                if (Main.settings.enabledSize && Main.settings.itemsSize > 1)
                {
                    int sizeCount = item.Value[1] / int.Parse(Main.settings.itemsSize.ToString());
                    int itemNaiJiu = item.Value[0], itemMaxNaiJiu = item.Value[1];
                    Main.logger.Log(sizeCount.ToString());
                    for (int i = 0; i <= sizeCount; i++)
                    {
                        int makeItemId = df.MakeNewItem(item.Key);
                        df.GetItem(df.mianActorId, makeItemId, 1, false, -1, 0);

                        //耐久小于或等于0就创建为0的道具吧,然后结束循环。
                        //耐久大于合并大小才会继续拆,继续循环。
                        //耐久小于或者等于最大耐久就走最后一个,结束循环。
                        if (itemNaiJiu <= 0)
                        {
                            df.itemsDate[makeItemId][901] = "0";
                            df.itemsDate[makeItemId][902] = itemMaxNaiJiu.ToString();
                            break;
                        }
                        else if (itemNaiJiu > Main.settings.itemsSize)
                        {
                            df.itemsDate[makeItemId][901] = Main.settings.itemsSize.ToString();
                            df.itemsDate[makeItemId][902] = Main.settings.itemsSize.ToString();
                            itemNaiJiu    -= int.Parse(Main.settings.itemsSize.ToString());
                            itemMaxNaiJiu -= int.Parse(Main.settings.itemsSize.ToString());
                        }
                        else
                        {
                            df.itemsDate[makeItemId][901] = itemNaiJiu.ToString();
                            df.itemsDate[makeItemId][902] = itemMaxNaiJiu.ToString();
                            break;
                        }
                    }
                }
                else
                {
                    //不拆直接创建。
                    int makeItemId = df.MakeNewItem(item.Key);
                    df.GetItem(df.mianActorId, makeItemId, 1, false, -1, 0);
                    df.itemsDate[makeItemId][901] = item.Value[0].ToString();
                    df.itemsDate[makeItemId][902] = item.Value[1].ToString();
                }
            }
        }
示例#21
0
        /// <summary>
        /// 框架来自 ActorMenu.ShowActorMassage(int key)
        /// </summary>
        /// <param name="id">npcId, 在 AC 中叫做 key</param>
        private static void GetAllMessage(int id)
        {
            actorMessages.Clear();
            int mianActorId = DateFile.instance.MianActorID();

            actorMessages.Add(string.Format(DateFile.instance.SetColoer(20002, "·") + " {0}{1}{2}{3}{4}\n", DateFile.instance.massageDate[8010][1].Split('|')[0], DateFile.instance.SetColoer(10002, DateFile.instance.solarTermsDate[int.Parse(DateFile.instance.GetActorDate(id, 25, applyBonus: false))][102]), DateFile.instance.massageDate[8010][1].Split('|')[1], DateFile.instance.GetActorName(id, realName: false, baseName: true), DateFile.instance.massageDate[8010][1].Split('|')[2]));

            LifeRecords.LifeRecord[] allRecords = LifeRecords.GetAllRecords(id);

            if (allRecords != null)
            {
                int num2 = Mathf.Max(DateFile.instance.GetActorFavor(false, mianActorId, id), 0);

                LifeRecords.LifeRecord[] array = allRecords;

                for (int i = 0; i < array.Length; i++)
                {
                    LifeRecords.LifeRecord record = array[i];
                    if (DateFile.instance.actorMassageDate.ContainsKey(record.messageId))
                    {
                        // 一个不知道作用的值,但是姑且这么用
                        // 原作者应该知道,但是可惜联系不上
                        int unknown_key = int.Parse(DateFile.instance.actorMassageDate[record.messageId][4]);
                        unknown_key = 30000 * unknown_key / 100;

                        // num2 也不知道,直接抄过来的嘛
                        if (id != mianActorId && num2 < unknown_key)
                        {
                            string   format   = DateFile.instance.SetColoer(20002, "·") + " {0}{1}:{2}\n";
                            string   str      = DateFile.instance.massageDate[16][1];
                            DateFile instance = DateFile.instance;
                            short    year     = record.year;
                            actorMessages.Add(string.Format(format, str + instance.SetColoer(10002, year.ToString()) + DateFile.instance.massageDate[16][3], DateFile.instance.SetColoer(20002, DateFile.instance.solarTermsDate[record.solarTerm][0]), DateFile.instance.SetColoer(10001, DateFile.instance.massageDate[12][2])));
                        }
                        else
                        {
                            string   format = DateFile.instance.SetColoer(20002, "·") + " {0}{1}:" + DateFile.instance.actorMassageDate[record.messageId][1] + "\n";
                            object[] args   = DateFile.instance.GetLifeRecordMassageElements(id, record).ToArray();
                            actorMessages.Add(string.Format(format, args));
                        }
                    }
                }
            }

            //死亡
            int num3 = int.Parse(DateFile.instance.GetActorDate(id, 26, false));

            if (num3 > 0)
            {
                actorMessages.Add(string.Format("■ {0}{1}{2}\n", DateFile.instance.massageDate[8010][2].Split(new char[]
                {
                    '|'
                })[0], DateFile.instance.SetColoer(10002, DateFile.instance.GetActorDate(id, 11, false), false), DateFile.instance.massageDate[8010][2].Split(new char[]
                {
                    '|'
                })[1]));
            }
        }
示例#22
0
            public static void Postfix(DateFile __instance, ref int __result, int weaponId)
            {
                int ID = DateFile.instance.MianActorID();

                if (IsActorWeapon(ID, weaponId) && IsEquipped(ID, "2008"))
                {
                    __result = 3000 + int.Parse(DateFile.instance.GetItemDate(weaponId, 501, true, -1));
                }
            }
示例#23
0
            public static void Postfix(DateFile __instance, ref int __result, bool isActor)//巧手,2009
            {
                int ID = DateFile.instance.MianActorID();

                if (isActor && IsEquipped(ID, "2009"))
                {
                    __result = (int)(__result * 0.7f);
                }
            }
示例#24
0
        public void Start()
        {
            Main.logger.Log("start");

            open = false;
            //collapse = false;

            windowRect     = new Rect(Screen.width * 0.833f, 50f, Screen.width * 0.164f, 0);
            scrollPosition = Vector2.zero;

            windowStyle = new GUIStyle
            {
                name    = "window",
                padding = new RectOffset(5, 5, 5, 5),
            };

            collapseStyle = new GUIStyle
            {
                name      = "collapse",
                fontSize  = 24,
                alignment = TextAnchor.MiddleCenter,
                margin    = new RectOffset(5, 5, 5, 5),
            };
            collapseStyle.normal.textColor = Color.blue;

            labelStyle = new GUIStyle
            {
                name      = "label",
                fontSize  = 12,
                alignment = TextAnchor.MiddleLeft,
                margin    = new RectOffset(0, 0, 5, 0),
            };
            labelStyle.normal.textColor = Color.yellow;

            buttonStyle = new GUIStyle
            {
                name       = "button",
                fontSize   = 12,
                alignment  = TextAnchor.MiddleLeft,
                fixedWidth = windowRect.width - 40,
                margin     = new RectOffset(0, 0, 5, 0),
            };
            buttonStyle.normal.textColor = Color.white;
            buttonStyle.richText         = true;

            seperatorStyle = new GUIStyle
            {
                name       = "seperator",
                fontSize   = 12,
                alignment  = TextAnchor.MiddleCenter,
                fixedWidth = windowRect.width - 40,
            };
            seperatorStyle.normal.textColor = Color.cyan;

            df  = DateFile.instance;
            wms = WorldMapSystem.instance;
        }
示例#25
0
 private static void Postfix(DateFile __instance, int __result)
 {
     if (!Main.enabled)
     {
         return;
     }
     lastNPCid = __result;
     DateFile.instance.ActorFeaturesCacheReset(__result); //刷新特性
     return;
 }
示例#26
0
 private static void Postfix(DateFile __instance, int __result)
 {
     if (!Main.enabled)
     {
         return;
     }
     lastNPCid = __result;
     DateFile.instance.actorsFeatureCache.Remove(__result); //刷新特性
     return;
 }
示例#27
0
            public static void Postfix(DateFile __instance, ref int __result, bool isActor)
            {
                int ID = isActor ? DateFile.instance.MianActorID() : BattleSystem.instance.ActorId(false, true);

                if (ID > 0 && IsEquipped(ID, "2003"))
                {
                    __result -= 10;
                    __result  = Mathf.Max(__result, 20);
                    //BattleSystem.instance.ShowBattleState(50002, isActor,0);
                }
            }
示例#28
0
        // 更改商店金钱生成逻辑,使金钱增加
        private static bool Prefix(ref DateFile __instance)
        {
            if (!Main.enabled)
            {
                return(true);
            }

            MerchantMoney.UpdateShopMoney(ref __instance);

            return(false);
        }
示例#29
0
        public void Init()
        {
            df  = DateFile.instance;
            wms = WorldMapSystem.instance;
            // 设置点击事件
            var btn = GameObject.Find("ManpowerIcon,7").AddComponent <Button>();

            btn.targetGraphic = UIDate.instance.manpowerText;
            btn.interactable  = true;
            btn.onClick.AddListener(ToggleWindow);
        }
示例#30
0
        /// <summary>
        /// 拆分药品
        /// </summary>
        public static void ResolveMergeDrugs()
        {
            if (!Main.enabled || Main.settings.drugsCount <= 0) return;

            DateFile df = DateFile.instance;
            Dictionary<int, int> items = new Dictionary<int, int>();
            Dictionary<int, int> itemsId = new Dictionary<int, int>();
            if (df.actorItemsDate.TryGetValue(df.mianActorId, out itemsId))
            {
                List<int> buffer = itemsId.Keys.ToList();
                foreach (int itemId in buffer)
                {
                    string id = df.GetItemDate(itemId, 999), surpluses = df.GetItemDate(itemId, 901), limit = df.GetItemDate(itemId, 902),
                        level = df.GetItemDate(itemId, 8), type = df.GetItemDate(itemId, 5);
                    
                    if (type != "31") continue;
                    if (!Main.settings.drugsLevel.Contains(int.Parse(level))) continue;
                    if (int.Parse(surpluses) < (Main.settings.drugsCount * Main.settings.drugsSize)) continue;

                    if (!items.ContainsKey(int.Parse(id))) items.Add(int.Parse(id), itemId);
                    
                }
                Main.logger.Log(items.Count.ToString());
                if (items.Count <= 0)
                {
                    Main.logger.Log("拆分失败:没有找到足够拆分的药品,合并后再试试。");
                }
                else
                {
                    foreach (KeyValuePair<int, int> item in items)
                    {
                        Dictionary<int, string> baseItem = df.itemsDate[item.Value];
                        int size = int.Parse(Main.settings.drugsSize.ToString()) + 1;
                        if (Main.settings.drugsSize <= 1) size = 2;
                        if (Main.settings.drugsSize > 5) size = 5;

                        for (int i = 0; i < Main.settings.drugsCount; i++)
                        {
                            if (int.Parse(df.itemsDate[item.Value][901]) == size) break;

                            int makeItemId = df.MakeNewItem(item.Key);
                            df.GetItem(df.mianActorId, makeItemId, 1, false, -1, 0);
                            df.itemsDate[makeItemId][901] = size.ToString();
                            df.itemsDate[makeItemId][902] = size.ToString();
                            df.itemsDate[item.Value][901] = (int.Parse(df.itemsDate[item.Value][901]) - size).ToString();
                            df.itemsDate[item.Value][902] = (int.Parse(df.itemsDate[item.Value][902]) - size).ToString();
                        }
                    }
                    Main.logger.Log("拆分成功。");
                }
            }

            Main.logger.Log("拆分失败:没有进入游戏存档,无法读取数据。");
        }