public static void AddSkill(bool listClear = true)
        {
            if (instance == null)
            {
                MyLog.LogMessage("YotogiSkillContainerViewer.AddSkill instance==null"
                                 );
                return;
            }

            if (listClear)
            {
                YotogiOld.Stage key = YotogiOld.Stage.プレイル\u30FCム;
                if (!string.IsNullOrEmpty(YotogiOldStageSelectManager.StageName))
                {
                    try
                    {
                        key = (YotogiOld.Stage)Enum.Parse(typeof(YotogiOld.Stage), YotogiOldStageSelectManager.StageName);
                    }
                    catch
                    {
                        MyLog.LogError("Yotogi.Stage enum convert error.\n" + YotogiOldStageSelectManager.StageName, false);
                        return;
                    }
                }

                YotogiOld.StageData setting_stage_data_ = YotogiOld.stage_data_list[key];

                ReadOnlySortedDictionary <int, YotogiSkillData> oldDatas = maid.status.yotogiSkill.oldDatas;
                foreach (YotogiSkillData yotogiSkillData in oldDatas.GetValueArray())
                {
                    Skill.Old.Data oldData = yotogiSkillData.oldData;
                    if (oldData.IsExecStage(setting_stage_data_.stage) && oldData.IsExecMaid(maid.status))
                    {
                        MyLog.LogMessage("AddSkillOld"
                                         , oldData.category
                                         , oldData.id
                                         , oldData.name
                                         );

                        skillList.Add(oldData);
                    }
                }
            }

            if (skillList.Count > 0)
            {
                for (int i = 0; i < 7; i++)
                {
                    try
                    {
                        instance.AddSkill(skillList.ElementAt(UnityEngine.Random.Range(0, skillList.Count)));
                    }
                    catch (Exception e)
                    {
                        MyLog.LogError(e.ToString());
                    }
                }
            }
        }
        public static void OnYotogiSkillOldAdd(YotogiSkillSystem skillSystem, Skill.Old.Data data)
        {
            if (skillSystem.status == null || skillSystem.status.maid == null)
            {
                return;
            }

            SkillInfoChanged?.Invoke(null, new YotogiSkillEventArgs {
                Maid = skillSystem.status.maid, Event = "add", SkillId = data.id
            });
        }
Пример #3
0
        public static bool PrefixCreateDatasOld(out Dictionary <int, YotogiSkillListManager.Data> result, Status status)
        {
            result = new Dictionary <int, YotogiSkillListManager.Data>();
            if (!EnableYotogiSkills)
            {
                return(false);
            }

            YotogiSkillSystem skillSystem = CreateDummySkillSystem(status);

            foreach (var skillDatas in Skill.Old.skill_data_list)
            {
                foreach (var idSkillPair in skillDatas)
                {
                    Skill.Old.Data skill = idSkillPair.Value;

                    YotogiSkillData skillData = skillSystem.Get(skill.id);
                    if (skillData == null)
                    {
                        skillData = new YotogiSkillData {
                            oldData = skill
                        };
                        skillData.expSystem.SetExreienceList(new List <int>(skill.skill_exp_table));
                    }

                    var data = new YotogiSkillListManager.Data
                    {
                        skillDataOld        = skill,
                        conditionDatas      = new KeyValuePair <string[], bool> [0],
                        maidStatusSkillData = skillData
                    };
                    result.Add(skill.id, data);
                }
            }

            return(true);
        }