public static bool GetFamilyGongFaLevel_Prefix(DateFile __instance, ref int __result, int actorId, int typ, bool getSize = false)
        {
            if (!Main.enabled || Main.settings.UsedOriginal || actorId == 0)
            {
                return(true);
            }


            int gongFaCount = 0;

            float[] pages = new float[9];

            foreach (var gongFaId in __instance.actorGongFas[actorId].Keys)
            {
                if (int.Parse(__instance.gongFaDate[gongFaId][1]) == typ)
                {
                    int gongFaGrade = int.Parse(__instance.gongFaDate[gongFaId][2]) - 1;
                    pages[gongFaGrade] += __instance.GetGongFaFLevel(actorId, gongFaId) *
                                          (__instance.GetGongFaAchievement(actorId, gongFaId) / int.Parse(__instance.gongFaDate[gongFaId][5]));
                    gongFaCount++;
                }
            }

            int attainments = 0;

            for (int j = 0; j < pages.Length; j++)
            {
                float i = pages[j];

                if (pages[j] <= 10)
                {
                }
                else if (pages[j] <= 50)
                {
                    i = (float)(-18.9957 - 0.55331 * i + 0.00343 * i * i + 14.8466 * Mathf.Log(i));
                }
                else
                {
                    i = Mathf.Log(i, (float)1.25893) + (float)3.0103;
                }
                i           *= (j + 1);
                attainments += Mathf.RoundToInt(i);
            }

            if (actorId == __instance.MianActorID() && StorySystem.useFoodId > 0)
            {
                attainments += int.Parse(__instance.GetItemDate(StorySystem.useFoodId, 50601 + typ));
            }
            __result = getSize ? gongFaCount : attainments;

            return(false);
        }