Exemplo n.º 1
0
        //#if DEBUG

        /// <summary>
        /// 분석용
        /// </summary>
        /// <param name="workId"></param>
        /// <param name="maid"></param>
        /// <param name="checkFinish"></param>
        /// <returns></returns>
        public static bool VisibleNightWork(int workId, Maid maid, bool checkFinish)
        {
            ScheduleCSVData.Yotogi yotogi = ScheduleCSVData.YotogiData[workId];
            switch (yotogi.yotogiType)
            {
            case ScheduleCSVData.YotogiType.Vip:
            case ScheduleCSVData.YotogiType.VipCall:
            {
                NightWorkState nightWorksState = GameMain.Instance.CharacterMgr.status.GetNightWorksState(workId);
                //if (nightWorksState == null)
                {
                    //return false;
                }
                //nightWorksState.finish = true;
                //if (checkFinish && nightWorksState.finish)
                {
                    //if (DailyMgr.IsLegacy)
                    {
                        //return false;
                    }
                    //if (GameMain.Instance.CharacterMgr.status.clubGrade < 5)
                    {
                        //return false;
                    }
                    //ScheduleCSVData.vipFullOpenDay = 0;
                    //if (GameMain.Instance.CharacterMgr.status.days < ScheduleCSVData.vipFullOpenDay)
                    {
                        //return false;
                    }
                }
                break;
            }

            case ScheduleCSVData.YotogiType.Travel:
                //return false;
                break;

            case ScheduleCSVData.YotogiType.EasyYotogi:
            {
                //if (yotogi.easyYotogi == null)
                {
                    //return false;
                }
                //int trophyId = yotogi.easyYotogi.trophyId;
                //if (!GameMain.Instance.CharacterMgr.status.IsHaveTrophy(trophyId))
                {
                    //return false;
                }
                break;
            }
            }
            if (yotogi.condPackage.Count > 0)
            {
                for (int i = 0; i < ScheduleCSVData.YotogiData[workId].condPackage.Count; i++)
                {
                    if (!PluginData.IsEnabled(ScheduleCSVData.YotogiData[workId].condPackage[i]))
                    {
                        return(false);
                    }
                }
            }
            if (yotogi.condManVisibleFlag1.Count > 0)
            {
                for (int j = 0; j < yotogi.condManVisibleFlag1.Count; j++)
                {
                    if (GameMain.Instance.CharacterMgr.status.GetFlag(yotogi.condManVisibleFlag1[j]) < 1)
                    {
                        return(false);
                    }
                }
            }
            if (maid != null)
            {
                if (ScheduleCSVData.YotogiData[workId].condMainChara && !maid.status.mainChara)
                {
                    return(false);
                }
                if (yotogi.condPersonal.Count > 0)
                {
                    bool flag = false;
                    for (int k = 0; k < yotogi.condPersonal.Count; k++)
                    {
                        if (maid.status.personal.id == yotogi.condPersonal[k])
                        {
                            flag = true;
                            break;
                        }
                    }
                    if (!flag)
                    {
                        return(false);
                    }
                }
                if (yotogi.subMaidUnipueName != string.Empty)
                {
                    if (maid.status.heroineType != HeroineType.Sub)
                    {
                        return(false);
                    }
                    if (yotogi.subMaidUnipueName != maid.status.subCharaData.uniqueName)
                    {
                        return(false);
                    }
                }
                else if (maid.status.heroineType == HeroineType.Sub)
                {
                    return(false);
                }
            }
            return(true);
        }
Exemplo n.º 2
0
        internal static void SetWorkAll()
        {
            if (isSetAllWorkRun)
            {
                return;
            }

            Task.Factory.StartNew(() =>
            {
                isSetAllWorkRun = true;
                MyLog.LogDarkBlue("ScheduleAPIPatch.SetAllWork. start");

                ReadOnlyDictionary <int, NightWorkState> night_works_state_dic = GameMain.Instance.CharacterMgr.status.night_works_state_dic;
                MyLog.LogMessage("ScheduleAPIPatch.SetAllWork.night_works_state_dic:" + night_works_state_dic.Count);

                foreach (var item in night_works_state_dic)
                {
                    NightWorkState nightWorkState = item.Value;
                    nightWorkState.finish         = true;
                }

                MyLog.LogMessage("ScheduleAPIPatch.SetAllWork.YotogiData:" + ScheduleCSVData.YotogiData.Values.Count);
                foreach (Maid maid in GameMain.Instance.CharacterMgr.GetStockMaidList())
                {
                    MyLog.LogMessage(".SetAllWork.Yotogi:" + MyUtill.GetMaidFullName(maid), ScheduleCSVData.YotogiData.Values.Count);
                    if (maid.status.heroineType == HeroineType.Sub)
                    {
                        continue;
                    }


                    foreach (ScheduleCSVData.Yotogi yotogi in ScheduleCSVData.YotogiData.Values)
                    {
#if DEBUG
                        if (Lilly.isLogOn)
                        {
                            MyLog.LogInfo(".SetAllWork:"
                                          + yotogi.id
                                          , yotogi.name
                                          , yotogi.type
                                          , yotogi.yotogiType
                                          );
                        }
#endif
                        if (DailyMgr.IsLegacy)
                        {
                            maid.status.OldStatus.SetFlag("_PlayedNightWorkId" + yotogi.id, 1);
                        }
                        else
                        {
                            maid.status.SetFlag("_PlayedNightWorkId" + yotogi.id, 1);
                        }
                        if (yotogi.condFlag1.Count > 0)
                        {
                            for (int n = 0; n < yotogi.condFlag1.Count; n++)
                            {
                                maid.status.SetFlag(yotogi.condFlag1[n], 1);
                            }
                        }
                        if (yotogi.condFlag0.Count > 0)
                        {
                            for (int num = 0; num < yotogi.condFlag0.Count; num++)
                            {
                                maid.status.SetFlag(yotogi.condFlag0[num], 0);
                            }
                        }
                    }
                    if (DailyMgr.IsLegacy)
                    {
                        maid.status.OldStatus.SetFlag("_PlayedNightWorkVip", 1);
                    }
                    else
                    {
                        maid.status.SetFlag("_PlayedNightWorkVip", 1);
                    }
                }

                MyLog.LogDarkBlue("ScheduleAPIPatch.SetAllWork. end");
                isSetAllWorkRun = false;
            });
        }