Exemplo n.º 1
0
        static bool Prefix(MakeSystem __instance, int itemId, int makeTyp, int partId, int placeId, int buildingIndex, bool getDownValue, ref int __result)
        {
            if (!Main.enabled || !Main.settings.buildingAdvanced)
            {
                return(true);
            }
            if (itemId <= 0)
            {
                __result = 0;
            }

            else
            {
                BuildingEffect.makeType = makeTyp;
                int num = BuildingEffect.getBuildingEffectValue(BuildingEffect.BuildingType.ReduceFamilyLevel,
                                                                partId, placeId, buildingIndex);
                if (getDownValue)
                {
                    __result = num;
                }
                else
                {
                    __result = Mathf.Max(int.Parse(DateFile.instance.GetItemDate(itemId, 43, true)) - num, 0);
                }
            }
            return(false);
        }
Exemplo n.º 2
0
        static void Postfix(HomeSystem __instance)
        {
            if (!Main.enabled)
            {
                return;
            }
            UIDate.instance.ChangeTime(false, levelUpTime);
            if (Main.settings.crossMonth && !Main.settings.buildingAdvanced)
            {
                __instance.levelUPActorLevelText.text = DateFile.instance.SetColoer(20005, DateFile.instance.dayTime + " / " + levelUpTime, false);
            }

            if (__instance.levelUPSkillId <= 0)
            {
                return;
            }
            if (Main.settings.buildingAdvanced)
            {
                BuildingEffect.isGongfa           = (__instance.studySkillTyp == 17);
                BuildingEffect.gongfaOrSkillId    = __instance.levelUPSkillId;
                BuildingEffect.levelUpReducedTime = BuildingEffect.getBuildingEffectValue(BuildingEffect.BuildingType.ReduceLevelUpTime,
                                                                                          __instance.homeMapPartId, __instance.homeMapPlaceId, __instance.homeMapbuildingIndex);
                int time = levelUpTime - BuildingEffect.levelUpReducedTime;
                if (time >= DateFile.instance.dayTime || Main.settings.crossMonth)
                {
                    __instance.levelUPActorLevelText.text = DateFile.instance.SetColoer(20005, DateFile.instance.dayTime + " / " + time, false);
                }
                else
                {
                    __instance.levelUPActorLevelText.text      = DateFile.instance.SetColoer(20010, DateFile.instance.dayTime + " / " + time, false);
                    __instance.StartLevelUPButton.interactable = false;
                }
            }
        }
Exemplo n.º 3
0
        static void Postfix(HomeSystem __instance, int ___studySkillId)
        {
            if (!Main.enabled)
            {
                return;
            }
            if (Main.settings.crossMonth)
            {
                __instance.levelUPActorLevelText.text = DateFile.instance.SetColoer(20005, DateFile.instance.dayTime + " / " + studyTime, false);
            }

            if (___studySkillId <= 0)
            {
                return;
            }
            int time = studyTime;

            if (Main.settings.buildingAdvanced)
            {
                BuildingEffect.isGongfa        = (__instance.studySkillTyp == 17);
                BuildingEffect.gongfaOrSkillId = ___studySkillId;
                int studyNoTimeProp = BuildingEffect.getBuildingEffectValue(BuildingEffect.BuildingType.ReduceStudyTime,
                                                                            __instance.homeMapPartId, __instance.homeMapPlaceId, __instance.homeMapbuildingIndex);
                if (UnityEngine.Random.Range(0, 100) < studyNoTimeProp)
                {
                    UIDate.instance.ChangeTime(false, -time);
                    time = 0;
                }
            }
            if (Main.settings.crossMonth && DateFile.instance.dayTime < time)
            {
                TrunChange.setAfterCrossTime(time);
                UIDate.instance.ChangeTime(false, -time);
            }
        }
Exemplo n.º 4
0
        static void Postfix(HomeSystem __instance)
        {
            if (!Main.enabled)
            {
                return;
            }
            UIDate.instance.ChangeTime(false, readTime);
            if (Main.settings.crossMonth && !Main.settings.buildingAdvanced)
            {
                __instance.actorIntText.text = DateFile.instance.SetColoer(20005, DateFile.instance.dayTime + " / " + readTime, false);
            }

            if (__instance.readBookId <= 0)
            {
                return;
            }
            if (Main.settings.buildingAdvanced)
            {
                BuildingEffect.isGongfa        = (__instance.studySkillTyp == 17);
                BuildingEffect.gongfaOrSkillId = int.Parse(DateFile.instance.GetItemDate(__instance.readBookId, 32, true));
                BuildingEffect.readReducedTime = BuildingEffect.getBuildingEffectValue(BuildingEffect.BuildingType.ReduceReadTime,
                                                                                       __instance.homeMapPartId, __instance.homeMapPlaceId, __instance.homeMapbuildingIndex);
                int time = readTime - BuildingEffect.readReducedTime;
                if (time >= DateFile.instance.dayTime || Main.settings.crossMonth)
                {
                    __instance.actorIntText.text = DateFile.instance.SetColoer(20005, DateFile.instance.dayTime + " / " + time, false);
                }
                else
                {
                    __instance.actorIntText.text = DateFile.instance.SetColoer(20010, DateFile.instance.dayTime + " / " + time, false);
                    __instance.startReadBookButton.interactable = false;
                }
            }
        }
Exemplo n.º 5
0
        static void Postfix(HomeSystem __instance, int actorValue, int readSkillId, ref int __result)
        {
            if (!Main.enabled || !Main.settings.buildingAdvanced)
            {
                return;
            }

            int reducedHard = BuildingEffect.getBuildingEffectValue(BuildingEffect.BuildingType.ReduceHard,
                                                                    __instance.homeMapPartId, __instance.homeMapPlaceId, __instance.homeMapbuildingIndex);

            __result -= reducedHard;
            if (DateFile.instance.readPower)
            {
                __result = 0;
            }
            else
            {
                __result = Mathf.Max(50, __result);
            }
        }