Exemplo n.º 1
0
 /// <summary>
 /// 往当前过月事件列表中添加太吾管家过月事件
 /// changTrunEvent format: [turnEventId, param1, param2, ...]
 /// current changTrunEvent: [TurnEvent.EVENT_ID]
 /// current GameObject.name: "TrunEventIcon,{TurnEvent.EVENT_ID}"
 /// </summary>
 /// <param name="__instance"></param>
 public static void AddEvent(UIDate __instance)
 {
     __instance.changTrunEvents.Add(new int[] { TurnEvent.eventId });
 }
Exemplo n.º 2
0
        static void Postfix(UIDate __instance, ref int __result)
        {
            if (!Main.enabled)
            {
                return;
            }
            if (Main.settings.increseMaxManPowerType == 0)
            {
                string text2 = "";
                text2 += string.Format("{0}{1}{2}{3}\n", new object[]
                {
                    "人力来自于太吾村村民的数量以及太吾村中「居所」的规模和数量。\n",
                    DateFile.instance.SetColoer(20008, "(你最多可以调配", false),
                    DateFile.instance.SetColoer(20003, 50.ToString(), false),
                    DateFile.instance.SetColoer(20008, "个人力。)", false)
                });
                DateFile.instance.resourceDate[7][99] = text2;
                return;
            }

            int num = UIDate.instance.GetBaseMaxManpower();

            foreach (int key in DateFile.instance.baseHomeDate.Keys)
            {
                Dictionary <int, int> dictionary = DateFile.instance.baseHomeDate[key];
                foreach (int key2 in dictionary.Keys)
                {
                    bool flag2 = dictionary[key2] != 0;
                    if (flag2)
                    {
                        Dictionary <int, int[]> dictionary2 = DateFile.instance.homeBuildingsDate[key][key2];
                        foreach (int key3 in dictionary2.Keys)
                        {
                            int[] array = dictionary2[key3];
                            float num2  = float.Parse(DateFile.instance.basehomePlaceDate[array[0]][61]);
                            bool  flag3 = num2 > 0f;
                            if (flag3)
                            {
                                num += 1 + Convert.ToInt32(num2 * (float)array[1]);
                            }
                        }
                    }
                }
            }

            if (Main.settings.increseMaxManPowerType == 1 && Main.settings.maxManPowerNum > 0)
            {
                string text2 = "";
                text2 += string.Format("{0}{1}{2}{3}\n", new object[]
                {
                    "人力来自于太吾村村民的数量以及太吾村中「居所」的规模和数量。\n",
                    DateFile.instance.SetColoer(20008, "(你最多可以调配", false),
                    DateFile.instance.SetColoer(20003, Main.settings.maxManPowerNum.ToString(), false),
                    DateFile.instance.SetColoer(20008, "个人力。)", false)
                });
                DateFile.instance.resourceDate[7][99] = text2;
                __result = Mathf.Clamp(num, 0, Main.settings.maxManPowerNum);
            }
            else if (Main.settings.increseMaxManPowerType == 2)
            {
                int        num3 = 0;
                List <int> list = new List <int>(DateFile.instance.baseHomeDate.Keys);
                for (int i = 0; i < list.Count; i++)
                {
                    int        num4  = list[i];
                    List <int> list2 = new List <int>(DateFile.instance.baseHomeDate[num4].Keys);
                    for (int j = 0; j < list2.Count; j++)
                    {
                        int  placeId = list2[j];
                        bool flag4   = int.Parse(DateFile.instance.GetNewMapDate(num4, placeId, 96)) != 0;
                        if (flag4)
                        {
                            int num5 = DateFile.instance.GetPlaceResource(num4, placeId)[8];
                            num3 = num5 / 2;
                        }
                    }
                }
                string text = "";
                text += string.Format("{0}{1}{2}{3}\n", new object[]
                {
                    "人力来自于太吾村村民的数量以及太吾村中「居所」的规模和数量。\n",
                    DateFile.instance.SetColoer(20008, "(你最多可以调配太吾村一半的「人口」作劳力,当前最多可调配", false),
                    DateFile.instance.SetColoer(20003, num3.ToString(), false),
                    DateFile.instance.SetColoer(20008, "个人力。)", false)
                });
                DateFile.instance.resourceDate[7][99] = text;
                __result = Mathf.Clamp(num, 0, num3);
            }
        }