Example #1
0
 private static bool Prefix(int ___studySkillId, int ___studySkillTyp, ref HomeSystem __instance)
 {
     if (!enabled || !settings.basicUISettings[2] || ___studySkillId <= 0 || ___studySkillTyp <= 0 || ___studySkillTyp > 17)
     {
         return(true);
     }
     else
     {
         int mainActorId = DateFile.instance.MianActorID();
         if (___studySkillTyp == 17)
         {
             if (DateFile.instance.GetGongFaLevel(mainActorId, ___studySkillId, 0) >= 100)
             {
                 return(false);
             }
             // 基础遗惠
             int scoreGain = int.Parse(DateFile.instance.gongFaDate[___studySkillId][2]);
             // 清零因为实战而获得的突破成功率加成
             DateFile.instance.addGongFaStudyValue = 0;
             //DateFile.instance.actorGongFas[mainActorId][___studySkillId][0] = 100;
             DateFile.instance.ChangeActorGongFa(mainActorId, ___studySkillId, 100, 0, 0, false);
             // 突破成功一次增加的遗惠
             DateFile.instance.AddActorScore(302, scoreGain * 100);
             if (DateFile.instance.GetGongFaLevel(mainActorId, ___studySkillId, 0) >= 100 && DateFile.instance.GetGongFaFLevel(mainActorId, ___studySkillId) >= 10)
             {
                 // 修习到100%时增加的遗惠
                 DateFile.instance.AddActorScore(304, scoreGain * 100);
             }
         }
         else
         {
             if (DateFile.instance.GetSkillLevel(___studySkillId) >= 100)
             {
                 return(false);
             }
             int scoreGain = int.Parse(DateFile.instance.skillDate[___studySkillId][2]);
             // 清零因为较艺而获得的突破成功率加成
             DateFile.instance.addSkillStudyValue = 0;
             DateFile.instance.ChangeMianSkill(___studySkillId, 100, 0, false);
             //DateFile.instance.actorSkills[___studySkillId][0] = 100;
             // 突破成功一次增加的遗惠
             DateFile.instance.AddActorScore(202, scoreGain * 100);
             if (DateFile.instance.GetSkillLevel(___studySkillId) >= 100 && DateFile.instance.GetSkillFLevel(___studySkillId) >= 10)
             {
                 // 修习到100%时增加的遗惠
                 DateFile.instance.AddActorScore(204, scoreGain * 100);
             }
         }
         __instance.UpdateStudySkillWindow();
         __instance.UpdateLevelUPSkillWindow();
         __instance.UpdateReadBookWindow();
         return(false);
     }
 }
Example #2
0
            private static bool Prefix(ref int ___studySkillId, ref int ___studySkillTyp, ref HomeSystem __instance)
            {
                if (!settings.lockMaxOutProficiency)
                {
                    return(true);
                }
                int num = DateFile.instance.MianActorID();

                if (___studySkillId > 0)
                {
                    if (___studySkillTyp == 17)
                    {
                        int num2 = DateFile.instance.ParseInt(DateFile.instance.gongFaDate[___studySkillId][2]);
                        DateFile.instance.addGongFaStudyValue = 0;
                        DateFile.instance.ChangeActorGongFa(num, ___studySkillId, 100, 0, 0, nomoUp: false);
                        DateFile.instance.AddActorScore(302, num2 * 100);
                        if (DateFile.instance.GetGongFaLevel(num, ___studySkillId) >= 100 && DateFile.instance.GetGongFaFLevel(num, ___studySkillId) >= 10)
                        {
                            DateFile.instance.AddActorScore(304, DateFile.instance.ParseInt(DateFile.instance.gongFaDate[___studySkillId][2]) * 100);
                        }
                    }
                    else
                    {
                        int num3 = DateFile.instance.ParseInt(DateFile.instance.skillDate[___studySkillId][2]);
                        DateFile.instance.addSkillStudyValue = 0;
                        DateFile.instance.ChangeMianSkill(___studySkillId, 100, 0, nomoUp: false);
                        DateFile.instance.AddActorScore(202, num3 * 100);
                        if (DateFile.instance.GetSkillLevel(___studySkillId) >= 100 && DateFile.instance.GetSkillFLevel(___studySkillId) >= 10)
                        {
                            DateFile.instance.AddActorScore(204, num3 * 100);
                        }
                    }
                    __instance.UpdateStudySkillWindow();
                    __instance.UpdateLevelUPSkillWindow();
                    __instance.UpdateReadBookWindow();
                }
                return(false);
            }