示例#1
0
    /// <summary>
    /// ベース選択で進化条件がそろっているユニットかどうか
    /// </summary>
    /// <param name="_unit"></param>
    /// <returns></returns>
    private bool CheckBaseUnitEvolve(PacketStructUnit _unit)
    {
        MasterDataParamChara _master = MasterFinder <MasterDataParamChara> .Instance.Find((int)_unit.id);

        if (_master == null)
        {
            return(false);
        }
        // レベルチェック
        if (_unit.level != _master.level_max)
        {
            return(false);
        }
        MasterDataParamCharaEvol _masterEvolve = MasterDataUtil.GetCharaEvolParamFromCharaID(_unit.id);

        if (_masterEvolve == null)
        {
            return(false);
        }
        uint blendMoney = _masterEvolve.money;

        if (MainMenuParam.m_BeginnerBoost != null &&
            MainMenuParam.m_BeginnerBoost.boost_build_money != 100
            )
        {
            blendMoney = MasterDataUtil.ConvertBeginnerBoostBuildMoney(ref MainMenuParam.m_BeginnerBoost, blendMoney);
        }
        // 所持金チェック
        if (blendMoney > UserDataAdmin.Instance.m_StructPlayer.have_money)
        {
            return(false);
        }
        PacketStructUnit           tempUnit = m_BaseUnit;
        List <MaterialDataContext> tempList = m_UnitMaterialPanel.MaterialList;

        m_UnitMaterialPanel.MaterialList.Clear();
        bool ret = true;

        m_BaseUnit = _unit;
        long unique_id;

        // 素材チェック
        if (_masterEvolve.unit_id_parts1 != 0)
        {
            unique_id = SearchMaterialUnit(_masterEvolve.unit_id_parts1, 0);
            if (unique_id == 0)
            {
                ret = false;
            }
            m_UnitMaterialPanel.addItem(0, _masterEvolve.unit_id_parts1);
            m_UnitMaterialPanel.MaterialList[0].setUnit(unique_id);
        }
        if (_masterEvolve.unit_id_parts2 != 0)
        {
            unique_id = SearchMaterialUnit(_masterEvolve.unit_id_parts2, 0);
            if (unique_id == 0)
            {
                ret = false;
            }
            m_UnitMaterialPanel.addItem(1, _masterEvolve.unit_id_parts2);
            m_UnitMaterialPanel.MaterialList[1].setUnit(unique_id);
        }
        if (_masterEvolve.unit_id_parts3 != 0)
        {
            if (SearchMaterialUnit(_masterEvolve.unit_id_parts3, 2) == 0)
            {
                ret = false;
            }
        }
        m_BaseUnit = tempUnit;
        m_UnitMaterialPanel.MaterialList.Clear();
        m_UnitMaterialPanel.MaterialList = tempList;

        return(ret);
    }
示例#2
0
    //----------------------------------------------------------------------------

    /*!
     *          @brief	ステータス更新
     *          @note
     */
    //----------------------------------------------------------------------------
    void SetupBlendAfterStatus()
    {
        //-----------------------
        // 必要資金の算出
        //-----------------------
        m_BlendMoney  = 0;
        m_BlendMoney += (m_CharaEvol != null) ? m_CharaEvol.money : 0;

        //-----------------------
        // 合成時のパラメータ数値表示部分を更新
        //-----------------------
        if (m_BaseUnit != null &&
            m_CharaEvol != null)
        {
            MasterDataParamChara cCharaMasterData      = MasterDataUtil.GetCharaParamFromID(m_BaseUnit.id);
            MasterDataParamChara cCharaMasterDataAfter = MasterDataUtil.GetCharaParamFromID(m_CharaEvol.unit_id_after);
            if (cCharaMasterData != null &&
                cCharaMasterDataAfter != null
                )
            {
                //----------------------------------------
                // 初心者ブースト適用
                // 表示用の値を計算、補正値を適用
                //
                // ※費用倍率が1倍の場合は表示反映しない
                //----------------------------------------
                if (MainMenuParam.m_BeginnerBoost != null &&
                    MainMenuParam.m_BeginnerBoost.boost_build_money != 100
                    )
                {
                    m_BlendMoney = MasterDataUtil.ConvertBeginnerBoostBuildMoney(ref MainMenuParam.m_BeginnerBoost, m_BlendMoney);
                }

                m_UnitBGPanel.Money = (int)m_BlendMoney;
            }

            uint plus_pow = m_BaseUnit.add_pow;
            uint plus_hp  = m_BaseUnit.add_hp;
            for (int i = 0; i < m_UnitMaterialPanel.MaterialList.Count; i++)
            {
                if (m_UnitMaterialPanel.MaterialList[i].m_UniqueId == 0)
                {
                    continue;
                }
                PacketStructUnit unit = UserDataAdmin.Instance.SearchChara(m_UnitMaterialPanel.MaterialList[i].m_UniqueId);
                if (unit == null)
                {
                    continue;
                }
                plus_pow += unit.add_pow;
                plus_hp  += unit.add_hp;
            }

            //プラス値最大チェック
            if (plus_pow > GlobalDefine.PLUS_MAX)
            {
                plus_pow = GlobalDefine.PLUS_MAX;
            }
            if (plus_hp > GlobalDefine.PLUS_MAX)
            {
                plus_hp = GlobalDefine.PLUS_MAX;
            }

            //進化後パラメータ
            m_UnitStatusPanel.setupChara(m_AfterCharaMaster.fix_id, UnitStatusPanel.StatusType.LV_1, m_BaseUnit.limitover_lv, plus_pow, plus_hp);

            // 進化後パラメータはLv1のステータスが設定されるため、ActiveSkillLvをベースユニットから引き継いで設定する.
            uint activeSkillLv    = 0;
            int  activeSkillLvMax = 0;
            if (cCharaMasterDataAfter.skill_limitbreak != 0)
            {
                if (cCharaMasterData.skill_limitbreak == cCharaMasterDataAfter.skill_limitbreak)
                {
                    //進化後も同じスキルの場合はLVを引き継ぐ
                    activeSkillLv = m_BaseUnit.limitbreak_lv + 1;
                }
                else
                {
                    //進化後のスキルが違う場合は1にする。
                    activeSkillLv = 1;
                }
                MasterDataSkillLimitBreak cMasterSkillLimitBreak = MasterDataUtil.GetLimitBreakSkillParamFromID(cCharaMasterDataAfter.skill_limitbreak);
                activeSkillLvMax = cMasterSkillLimitBreak.level_max + 1;
            }
            m_UnitStatusPanel.Aslv    = string.Format(GameTextUtil.GetText("unit_status15"), activeSkillLv);
            m_UnitStatusPanel.AslvMax = string.Format(GameTextUtil.GetText("unit_status15"), activeSkillLvMax);
        }
    }