Esempio n. 1
0
    public void SetSettingsInfo(SkillSettingsInfo skill_settings, List <CharaInfo.EquipItem> weapon_list)
    {
        List <SkillParam> list = new List <SkillParam>();

        if (skillParams != null)
        {
            list = skillParams;
        }
        skillParams = new List <SkillParam>();
        InGameManager         i  = MonoBehaviourSingleton <InGameManager> .I;
        InGameSettingsManager i2 = MonoBehaviourSingleton <InGameSettingsManager> .I;
        int j = 0;

        for (int num = 9; j < num; j++)
        {
            SkillParam skillParam = new SkillParam();
            skillParam.skillIndex = j;
            skillParams.Add(skillParam);
            if (skill_settings != null && Singleton <SkillItemTable> .IsValid())
            {
                SkillSettingsInfo.Element element = skill_settings.elementList[j];
                if (element != null)
                {
                    skillParam.baseInfo        = element.baseInfo;
                    skillParam.useGaugeCounter = element.useGaugeCounter;
                    if (skillParam.baseInfo != null && skillParam.baseInfo.id != 0)
                    {
                        skillParam.tableData = Singleton <SkillItemTable> .I.GetSkillItemData((uint)skillParam.baseInfo.id);

                        if (skillParam.tableData != null && skillParam.IsActiveType())
                        {
                            if (weapon_list[j / 3] != null)
                            {
                                EquipItemTable.EquipItemData equipItemData = Singleton <EquipItemTable> .I.GetEquipItemData((uint)weapon_list[j / 3].eId);

                                if (equipItemData != null && !skillParam.tableData.IsEnableEquipType(equipItemData.type))
                                {
                                    continue;
                                }
                            }
                            switch (skillParam.tableData.skillAtkType)
                            {
                            case ELEMENT_TYPE.FIRE:
                                skillParam.atk.fire = (float)(int)skillParam.tableData.skillAtk;
                                break;

                            case ELEMENT_TYPE.WATER:
                                skillParam.atk.water = (float)(int)skillParam.tableData.skillAtk;
                                break;

                            case ELEMENT_TYPE.THUNDER:
                                skillParam.atk.thunder = (float)(int)skillParam.tableData.skillAtk;
                                break;

                            case ELEMENT_TYPE.SOIL:
                                skillParam.atk.soil = (float)(int)skillParam.tableData.skillAtk;
                                break;

                            case ELEMENT_TYPE.LIGHT:
                                skillParam.atk.light = (float)(int)skillParam.tableData.skillAtk;
                                break;

                            case ELEMENT_TYPE.DARK:
                                skillParam.atk.dark = (float)(int)skillParam.tableData.skillAtk;
                                break;

                            default:
                                skillParam.atk.normal = (float)(int)skillParam.tableData.skillAtk;
                                break;
                            }
                            skillParam.atkRate = (float)(int)skillParam.tableData.skillAtkRate * 0.01f;
                            skillParam.healHp  = skillParam.tableData.healHp;
                            for (int k = 0; k < 3; k++)
                            {
                                skillParam.supportValue[k] = skillParam.tableData.supportValue[k];
                                skillParam.supportTime[k]  = skillParam.tableData.supportTime[k];
                            }
                            skillParam.castTimeRate = 0f;
                            skillParam.useGauge     = skillParam.tableData.useGauge;
                            if (Singleton <GrowSkillItemTable> .IsValid())
                            {
                                GrowSkillItemTable.GrowSkillItemData growSkillItemData = Singleton <GrowSkillItemTable> .I.GetGrowSkillItemData(skillParam.tableData.growID, skillParam.baseInfo.level);

                                if (growSkillItemData != null)
                                {
                                    float num2 = (float)growSkillItemData.GetGrowParamSkillAtk(skillParam.tableData.skillAtk);
                                    switch (skillParam.tableData.skillAtkType)
                                    {
                                    case ELEMENT_TYPE.FIRE:
                                        skillParam.atk.fire = num2;
                                        break;

                                    case ELEMENT_TYPE.WATER:
                                        skillParam.atk.water = num2;
                                        break;

                                    case ELEMENT_TYPE.THUNDER:
                                        skillParam.atk.thunder = num2;
                                        break;

                                    case ELEMENT_TYPE.SOIL:
                                        skillParam.atk.soil = num2;
                                        break;

                                    case ELEMENT_TYPE.LIGHT:
                                        skillParam.atk.light = num2;
                                        break;

                                    case ELEMENT_TYPE.DARK:
                                        skillParam.atk.dark = num2;
                                        break;

                                    default:
                                        skillParam.atk.normal = num2;
                                        break;
                                    }
                                    skillParam.atkRate = (float)growSkillItemData.GetGrowParamSkillAtkRate(skillParam.tableData.skillAtkRate) * 0.01f;
                                    skillParam.healHp  = growSkillItemData.GetGrowParamHealHp(skillParam.tableData.healHp);
                                    for (int l = 0; l < 3; l++)
                                    {
                                        skillParam.supportValue[l] = growSkillItemData.GetGrowParamSupprtValue(skillParam.tableData.supportValue, l);
                                        skillParam.supportTime[l]  = growSkillItemData.GetGrowParamSupprtTime(skillParam.tableData.supportTime, l);
                                    }
                                    skillParam.castTimeRate = growSkillItemData.GetGrowParamCastTimeRate();
                                    skillParam.useGauge     = growSkillItemData.GetGrowParamUseGauge(skillParam.tableData.useGauge);
                                }
                            }
                            if (Singleton <ExceedSkillItemTable> .IsValid())
                            {
                                ExceedSkillItemTable.ExceedSkillItemData exceedSkillItemData = Singleton <ExceedSkillItemTable> .I.GetExceedSkillItemData(skillParam.baseInfo.exceedCnt);

                                if (exceedSkillItemData != null)
                                {
                                    skillParam.useGauge = exceedSkillItemData.GetExceedUseGauge(skillParam.useGauge);
                                }
                            }
                            if (MonoBehaviourSingleton <InGameManager> .IsValid() && MonoBehaviourSingleton <InGameManager> .I.HasArenaInfo())
                            {
                                InGameSettingsManager.ArenaParam arenaParam = i2.arenaParam;
                                if ((float)skillParam.baseInfo.exceedCnt < arenaParam.magiSpeedDownRegistSkillExceedLv && i.ContainsArenaCondition(ARENA_CONDITION.RECOVER_MAGI_SPEED_DOWN))
                                {
                                    float num3 = arenaParam.magiSpeedDownRateBase - arenaParam.magiSpeedDownRate * (float)skillParam.baseInfo.exceedCnt;
                                    if (num3 < 0f)
                                    {
                                        num3 = 0f;
                                    }
                                    SkillParam skillParam2 = skillParam;
                                    skillParam2.useGauge = (int)skillParam2.useGauge + Mathf.FloorToInt((float)(int)skillParam.useGauge * num3);
                                }
                                if (i.ContainsArenaCondition(ARENA_CONDITION.RECOVER_MAGI_SPEED_UP))
                                {
                                    SkillParam skillParam3 = skillParam;
                                    skillParam3.useGauge = (int)skillParam3.useGauge - Mathf.FloorToInt((float)(int)skillParam.useGauge * arenaParam.magiSpeedUpBaseRate);
                                }
                            }
                            if (list != null && list.Count > 0)
                            {
                                for (int m = 0; m < list.Count; m++)
                                {
                                    if (list[m] != null && list[m].tableData != null && list[m].tableData.name == skillParam.tableData.name && list[m].bullet != null)
                                    {
                                        skillParam.bullet = list[j].bullet;
                                    }
                                }
                            }
                            skillParam.isValid = true;
                        }
                    }
                }
            }
        }
        arenaConditionList = i.GetArenaConditions();
        if (!arenaConditionList.IsNullOrEmpty())
        {
            for (int n = 0; n < arenaConditionList.Length; n++)
            {
                switch (arenaConditionList[n])
                {
                case ARENA_CONDITION.FORBID_MAGI_ATTACK:
                    isArenaForbidMagiAttack = true;
                    break;

                case ARENA_CONDITION.FORBID_MAGI_SUPPORT:
                    isArenaForbidMagiSupport = true;
                    break;

                case ARENA_CONDITION.FORBID_MAGI_HEAL:
                    isArenaForbidMagiHeal = true;
                    break;
                }
            }
        }
    }