Ejemplo n.º 1
0
    //----------------------------------------------------------------------------

    /*!
     *          @brief		リンクシステム:リンクスキル発動率:キャラマスター指定
     *          @param[in]	MasterDataParamChara	(cCharaMaster)	キャラマスター
     *          @param[in]	int						(nLinkPoint)	リンクポイント
     *          @return		uint					[リンクスキル発動率]
     *          @note		リンクスキル発動率を取得
     */
    //----------------------------------------------------------------------------
    static public uint GetLinkSkillOdds(MasterDataParamChara cCharaMaster, int nLinkPoint)
    {
        uint unResult = 0;

        //--------------------------------
        // エラーチェック
        //--------------------------------
        if (cCharaMaster == null)
        {
            Debug.LogError("MasterDataParamChara Is None!");
            return(unResult);
        }

        // ノーマルスキルマスターを取得
        MasterDataSkillActive cNormalMaster = BattleParam.m_MasterDataCache.useSkillActive(cCharaMaster.link_skill_active);

        if (cNormalMaster == null)
        {
            return(unResult);
        }

        // リンクスキル発動率
        unResult = GetLinkSkillOdds(cNormalMaster, nLinkPoint);


        return(unResult);
    }
Ejemplo n.º 2
0
    //----------------------------------------------------------------------------

    /*!
     *          @brief		リンクシステム:リンクスキル発動率:ノーマルマスター指定
     *          @param[in]	MasterDataSkillActive	(cNormalMaster)	ノーマルマスター
     *          @param[in]	int						(nLinkPoint)	リンクポイント
     *          @return		uint					[リンクスキル発動率]
     *          @note		リンクスキル発動率を取得
     */
    //----------------------------------------------------------------------------
    static public uint GetLinkSkillOdds(MasterDataSkillActive cNormalMaster, int nLinkPoint)
    {
        uint unResult = 0;

        //--------------------------------
        // エラーチェック
        //--------------------------------
        if (cNormalMaster == null)
        {
            return(unResult);
        }

        // ベース発動率を取得
        float fBaseOdds = (float)cNormalMaster.skill_link_odds;

        // リンクポイントによる発動率を算出
        float fLinkOdds = 1.0f + ((float)nLinkPoint * 0.0001f);

        // リンクスキル発動率を算出(リンクスキル発動率 = ベース発動率 × { 1 + (リンク度/10000) })
        unResult = (uint)(fBaseOdds * fLinkOdds);
        if (unResult > SKILL_LINK_ODDS_MAX)
        {
            unResult = SKILL_LINK_ODDS_MAX;
        }

        return(unResult);
    }
Ejemplo n.º 3
0
    public void SetLinkEffectSkill(MasterDataParamChara cCharaMasterData, uint nLinkPoint)
    {
        //------------------------------------------------------------
        // LINK SKILL
        //------------------------------------------------------------
        MasterDataSkillActive cSkillParamLinkActive = null;

        if (cCharaMasterData != null)
        {
            cSkillParamLinkActive = MasterDataUtil.GetActiveSkillParamFromID(cCharaMasterData.link_skill_active);
        }
        if (null != cSkillParamLinkActive)
        {
            // スキル名
            LinkSkillName = cSkillParamLinkActive.skill_link_name;

            // 説明文
            LinkSkillMessage = cSkillParamLinkActive.skill_link_detail;

            //発動率
            float fSkillOdds = CharaLinkUtil.GetLinkSkillOdds(cSkillParamLinkActive, (int)nLinkPoint) * 0.01f;
            LinkSkillRate = string.Format(GameTextUtil.GetText("unit_linkstatus2"), fSkillOdds.ToString("F1"));
        }
        else
        {
            // スキル名
            LinkSkillName = EmptyStr;
            // 説明文
            LinkSkillMessage = EmptyStr;
            // 発動率
            LinkSkillRate = "";
        }

        //------------------------------------------------------------
        // LINK PASSIVE
        //------------------------------------------------------------
        MasterDataSkillPassive cSkillParamLinkPassive = null;

        if (cCharaMasterData != null)
        {
            cSkillParamLinkPassive = MasterDataUtil.GetPassiveSkillParamFromID(cCharaMasterData.link_skill_passive);
        }
        if (null != cSkillParamLinkPassive)
        {
            // スキル名
            LinkPassiveName = cSkillParamLinkPassive.name;

            // 説明文
            LinkPassiveMessage = cSkillParamLinkPassive.detail;
        }
        else
        {
            // スキル名
            LinkPassiveName = EmptyStr;

            // 説明文
            LinkPassiveMessage = EmptyStr;
        }
    }
Ejemplo n.º 4
0
    /// <summary>
    /// 常駐スキルの成立を判定
    /// </summary>
    private void _checkAlwaysSkill()
    {
        //常駐スキル
        for (int skill_idx = 0; skill_idx < m_OrderedSkillList.Length; skill_idx++)
        {
            MasterDataSkillActive current_skill_active = m_OrderedSkillList[skill_idx];

            if (current_skill_active.always == MasterDataDefineLabel.BoolType.ENABLE)
            {
                //復活スキル以外を判定
                if (current_skill_active.getResurrectInfo() == null)
                {
                    uint  current_skill_id   = current_skill_active.fix_id;
                    int[] current_skill_cost = current_skill_active.GetCostPerElement();
                    _checkActiveSkillFormingConditionSub(m_WorkGeneralFieldCostInfo, current_skill_cost, m_WorkHandcardCostPerElement, GlobalDefine.PartyCharaIndex.GENERAL, current_skill_id);
                }
            }
        }
        // 常駐回復スキルと同条件で成立する常駐復活スキルを追加
        int always_recov_skill_count = m_WorkFormedSkillsCount;

        for (int idx = 0; idx < always_recov_skill_count; idx++)
        {
            BattleSkillReq recov_skill_req = m_WorkFormedSkills[idx];
            if (m_IsBoosts[recov_skill_req.m_SkillParamFieldNum] != false)
            {
                for (int skill_idx = 0; skill_idx < m_OrderedSkillList.Length; skill_idx++)
                {
                    MasterDataSkillActive current_skill_active = m_OrderedSkillList[skill_idx];

                    if (current_skill_active.isAlwaysResurrectSkill())
                    {
                        MasterDataSkillActive recov_skill = BattleParam.m_MasterDataCache.useSkillActive(recov_skill_req.m_SkillParamSkillID);
                        if (current_skill_active.cost1 == recov_skill.cost1 &&
                            current_skill_active.cost2 == recov_skill.cost2 &&
                            current_skill_active.cost3 == recov_skill.cost3 &&
                            current_skill_active.cost4 == recov_skill.cost4 &&
                            current_skill_active.cost5 == recov_skill.cost5
                            )
                        {
                            if (m_WorkFormedSkillsCount < m_WorkFormedSkills.Length)
                            {
                                BattleSkillReq resurr_skill_req = m_WorkFormedSkills[m_WorkFormedSkillsCount];
                                resurr_skill_req.m_SkillReqState      = BattleSkillReq.State.REQUESTED;
                                resurr_skill_req.m_SkillParamCharaNum = recov_skill_req.m_SkillParamCharaNum;
                                resurr_skill_req.m_SkillParamFieldNum = recov_skill_req.m_SkillParamFieldNum;
                                resurr_skill_req.m_SkillParamSkillID  = current_skill_active.fix_id;

                                m_WorkFormedSkillsCount++;
                            }
                            break;
                        }
                    }
                }
            }
        }
    }
Ejemplo n.º 5
0
    public string getSkillActiveName(uint id)
    {
        MasterDataSkillActive master_data = useSkillActive(id);

        if (master_data != null)
        {
            return(master_data.name);
        }

        return(null);
    }
Ejemplo n.º 6
0
    /// <summary>
    /// デバッグ用スキルカットイン再生
    /// </summary>
    /// <param name="chara_fix_id"></param>
    /// <param name="img_2_tiling"></param>
    /// <param name="img_2_offsetX"></param>
    /// <param name="img_2_offsetY"></param>
    public void debugSkillCutin(int chara_fix_id, int img_2_tiling, int img_2_offsetX, int img_2_offsetY, int size_width, int size_height, MasterDataDefineLabel.PivotType pivot, int side_offset)
    {
        MasterDataParamChara base_chara_master = MasterFinder <MasterDataParamChara> .Instance.Find(chara_fix_id);

        if (base_chara_master != null)
        {
            // ダミーのキャラマスターを生成(面倒なのでスキルカットインで使うところだけ設定)
            MasterDataParamChara dummy_chara_master = new MasterDataParamChara();
            dummy_chara_master.fix_id        = base_chara_master.fix_id;
            dummy_chara_master.element       = base_chara_master.element;
            dummy_chara_master.skill_active0 = base_chara_master.skill_active0;
            dummy_chara_master.img_2_tiling  = img_2_tiling;
            dummy_chara_master.img_2_offsetX = img_2_offsetX;
            dummy_chara_master.img_2_offsetY = img_2_offsetY;
            dummy_chara_master.size_width    = size_width;
            dummy_chara_master.size_height   = size_height;
            dummy_chara_master.pivot         = pivot;
            dummy_chara_master.side_offset   = side_offset;

            // ダミーのキャラマスターをバトルのキャッシュに登録
            BattleParam.m_MasterDataCache.clearCachePlayerAll();
            BattleParam.m_MasterDataCache.addCharaParam(dummy_chara_master);

            // ダミーのキャラデータを生成(バトルのキャッシュを使用して生成される)
            CharaOnce chara_once = new CharaOnce();
            bool      is_success = chara_once.CharaSetupFromID((uint)chara_fix_id, 1);
            if (is_success)
            {
                string skill_name = "スキル名";
                MasterDataDefineLabel.ElementType element_type = base_chara_master.element;

                MasterDataSkillActive skill_master = MasterFinder <MasterDataSkillActive> .Instance.Find((int)chara_once.m_CharaMasterDataParam.skill_active0);

                if (skill_master != null)
                {
                    skill_name   = skill_master.name;
                    element_type = skill_master.skill_element;
                }

                // ダミーのパーティを生成
                CharaOnce[] party_members = new CharaOnce[5];
                party_members[0]          = chara_once;
                BattleParam.m_PlayerParty = new CharaParty();
                BattleParam.m_PlayerParty.PartySetup(party_members, true);

                // カットインを開始
                clearSkill();
                addSkill(GlobalDefine.PartyCharaIndex.LEADER, skill_name, ESKILLTYPE.eACTIVE, element_type, 0);
                startCutin(false, false, false);
            }
        }
    }
Ejemplo n.º 7
0
    public void SetUnitData(ref PartyMemberStatusListItemContext unitStatus, PacketStructUnit unitData, PacketStructUnit[] partyUnits)
    {
        if (unitStatus == null)
        {
            return;
        }

        MasterDataParamChara charMaster = null;

        if (unitData == null || unitData.id == 0)
        {
            unitStatus.HpText  = "";
            unitStatus.AtkText = "";
            unitStatus.Cost    = 0;
            unitStatus.Charm   = 0;
        }
        else
        {
            charMaster = MasterFinder <MasterDataParamChara> .Instance.Find((int)unitData.id);

            SetUpCharaData(ref unitStatus, unitData, CharaLinkUtil.GetLinkUnit(unitData.link_unique_id), false, partyUnits);
        }

        MasterDataSkillActive skill1 = null;

        if (charMaster != null && charMaster.skill_active0 > 0)
        {
            skill1 = MasterFinder <MasterDataSkillActive> .Instance.Find((int)charMaster.skill_active0);
        }
        unitStatus.IsActiveSkill1Empty = (skill1 == null);
        unitStatus.Skill1Cost1         = (skill1 != null) ? MainMenuUtil.GetSkillElementIcon(skill1.cost1) : null;
        unitStatus.Skill1Cost2         = (skill1 != null) ? MainMenuUtil.GetSkillElementIcon(skill1.cost2) : null;
        unitStatus.Skill1Cost3         = (skill1 != null) ? MainMenuUtil.GetSkillElementIcon(skill1.cost3) : null;
        unitStatus.Skill1Cost4         = (skill1 != null) ? MainMenuUtil.GetSkillElementIcon(skill1.cost4) : null;
        unitStatus.Skill1Cost5         = (skill1 != null) ? MainMenuUtil.GetSkillElementIcon(skill1.cost5) : null;
        unitStatus.Skill1Color         = (skill1 != null) ? MainMenuUtil.GetSkillElementColor("S1", skill1.skill_element) : null;

        MasterDataSkillActive skill2 = null;

        if (charMaster != null && charMaster.skill_active1 > 0)
        {
            skill2 = MasterFinder <MasterDataSkillActive> .Instance.Find((int)charMaster.skill_active1);
        }
        unitStatus.IsActiveSkill2Empty = (skill2 == null);
        unitStatus.Skill2Cost1         = (skill2 != null) ? MainMenuUtil.GetSkillElementIcon(skill2.cost1) : null;
        unitStatus.Skill2Cost2         = (skill2 != null) ? MainMenuUtil.GetSkillElementIcon(skill2.cost2) : null;
        unitStatus.Skill2Cost3         = (skill2 != null) ? MainMenuUtil.GetSkillElementIcon(skill2.cost3) : null;
        unitStatus.Skill2Cost4         = (skill2 != null) ? MainMenuUtil.GetSkillElementIcon(skill2.cost4) : null;
        unitStatus.Skill2Cost5         = (skill2 != null) ? MainMenuUtil.GetSkillElementIcon(skill2.cost5) : null;
        unitStatus.Skill2Color         = (skill2 != null) ? MainMenuUtil.GetSkillElementColor("S2", skill2.skill_element) : null;
    }
Ejemplo n.º 8
0
        private CostInfo _getActiveSkillCost(GlobalDefine.PartyCharaIndex member_index, int active_skill_no)
        {
            CostInfo ret_val = null;

            CharaOnce chara_once = BattleParam.m_PlayerParty.getPartyMember(member_index, CharaParty.CharaCondition.EXIST);

            if (chara_once != null)
            {
                uint active_skill_fix_id = (active_skill_no == 0) ? chara_once.m_CharaMasterDataParam.skill_active0 : chara_once.m_CharaMasterDataParam.skill_active1;
                MasterDataSkillActive master_data_skill_active = BattleParam.m_MasterDataCache.useSkillActive(active_skill_fix_id);
                if (master_data_skill_active != null)
                {
                    ret_val = new CostInfo(master_data_skill_active.cost1, master_data_skill_active.cost2, master_data_skill_active.cost3, master_data_skill_active.cost4, master_data_skill_active.cost5);
                }
            }

            return(ret_val);
        }
Ejemplo n.º 9
0
    /// <summary>
    /// リンクスキル設定
    /// </summary>
    /// <param name="skill_id"></param>
    public void setupLinkSkill(MasterDataParamChara cCharaMasterData, uint nLinkPoint)
    {
        BaseHeight  = BASE_DEFAULT_HEIGHT;
        TitleHeight = TITLE_DEFAULT_HEIGHT;
        TitleWidth  = LINK_SKILL_TITLE_WIDTH;
        MessageBgH  = MESSAGE_BG_HEIGHT;
        setLinkTitleImage("skill_name_bg3", "LINK SKILL");
        IsSkillItem  = false;
        IsViewStatus = false;
        IsViewIcon   = false;
        //------------------------------------------------------------
        // LINK SKILL
        //------------------------------------------------------------
        MasterDataSkillActive cSkillParamLinkActive = null;

        if (cCharaMasterData != null)
        {
            cSkillParamLinkActive = MasterDataUtil.GetActiveSkillParamFromID(cCharaMasterData.link_skill_active);
        }
        if (null != cSkillParamLinkActive)
        {
            // スキル名
            LinkTitleText = cSkillParamLinkActive.skill_link_name;

            // 説明文
            SkillDetailText = cSkillParamLinkActive.skill_link_detail;

            //発動率
            float fSkillOdds = CharaLinkUtil.GetLinkSkillOdds(cSkillParamLinkActive, (int)nLinkPoint) * 0.01f;
            LinkSkillRate = string.Format(GameTextUtil.GetText("unit_linkstatus2"), fSkillOdds.ToString("F1"));
        }
        else
        {
            // スキル名
            LinkTitleText = EmptyStr;
            // 説明文
            SkillDetailText = EmptyStr;
            // 発動率
            LinkSkillRate = "";
        }
        MessageBgResize();
    }
Ejemplo n.º 10
0
    /// <summary>
    /// ノーマルスキルの成立を判定
    /// </summary>
    /// <param name="index"></param>
    private void _checkNormalSkill()
    {
        //通常のアクティブスキル
        int start_index = (m_OrderedSkillList.Length * m_Phase) / PHASE_MAX;
        int end_index   = (m_OrderedSkillList.Length * (m_Phase + 1)) / PHASE_MAX;

        for (int skill_idx = start_index; skill_idx < end_index; skill_idx++)
        {
            MasterDataSkillActive current_skill_active = m_OrderedSkillList[skill_idx];
            uint  current_skill_id   = current_skill_active.fix_id;
            int[] current_skill_cost = current_skill_active.GetCostPerElement();

            if (current_skill_active.always != MasterDataDefineLabel.BoolType.ENABLE)
            {
                for (int member_idx = 0; member_idx < m_WorkActiveSkillMembers.Length; member_idx++)
                {
                    CharaOnce chara_once = m_WorkActiveSkillMembers[member_idx];
                    if (chara_once != null &&
                        m_WorkIsAliveActiveSkillMembers[member_idx]
                        )
                    {
                        if (chara_once.m_CharaMasterDataParam.skill_active0 == current_skill_id ||
                            chara_once.m_CharaMasterDataParam.skill_active1 == current_skill_id
                            )
                        {
                            if (SkillRequestParam.filterSkill(current_skill_active, m_FilterTypes[member_idx]))
                            {
                                int[,] wrk_member_field_cost_info = m_WorkMemberFieldCostInfo[member_idx];
                                _checkActiveSkillFormingConditionSub(wrk_member_field_cost_info, current_skill_cost, m_WorkHandcardCostPerElement, chara_once.m_PartyCharaIndex, current_skill_id);
                            }
                        }
                    }
                }
            }
        }
    }
Ejemplo n.º 11
0
    //----------------------------------------------------------------------------

    /*!
     *  @brief		アクティブスキルの発動情報からリンクスキルの発動情報作成
     */
    //----------------------------------------------------------------------------
    public void ActivityLinkSkill(SkillRequestParam active_skill_request_param)
    {
        m_SkillRequestLink.clearRequest();

        //--------------------------------
        // スキル情報の選定完了
        //--------------------------------
        int link_skill_num = CheckLinkSkillNum(active_skill_request_param, m_SkillOwner);

        if (link_skill_num <= 0)
        {
            return;
        }

        //--------------------------------
        // リンクスキル発動情報設定
        //--------------------------------
        int  nSkillPower = 0;
        uint unRandMin   = 0;
        uint unRandMax   = 0;

        for (int num = 0; num < (int)GlobalDefine.PartyCharaIndex.MAX; ++num)
        {
            if (m_SkillOwner[num] == false)
            {
                continue;
            }

            // リンクキャラを取得
            CharaOnce            baseChara      = BattleParam.m_PlayerParty.getPartyMember((GlobalDefine.PartyCharaIndex)num, CharaParty.CharaCondition.SKILL_ACTIVE);
            MasterDataParamChara linkCharaParam = BattleParam.m_MasterDataCache.useCharaParam(baseChara.m_LinkParam.m_CharaID);
            if (linkCharaParam == null)
            {
                continue;
            }

            // リンクキャラのリンクスキルを取得
            MasterDataSkillActive skillActiveParam = BattleParam.m_MasterDataCache.useSkillActive(linkCharaParam.link_skill_active);
            if (skillActiveParam == null)
            {
                continue;
            }

            // リンクスキルを構築
            BattleSkillActivity skillActivity = new BattleSkillActivity();
            if (skillActivity != null)
            {
                // 共通情報を設定
                skillActivity.m_SkillParamOwnerNum = (GlobalDefine.PartyCharaIndex)num;      // 発動者(パーティキャラ)
                skillActivity.m_SkillParamFieldID  = InGameDefine.SELECT_NONE;               // フィールドID(ブーストパネルの影響は受けない)
                skillActivity.m_SkillParamSkillID  = skillActiveParam.fix_id;                // ノーマルスキルID
                skillActivity.m_SkillType          = ESKILLTYPE.eLINK;                       // 発動スキルの種類

                skillActivity.m_Element = skillActiveParam.skill_element;                    // 基本情報:属性
                skillActivity.m_Type    = skillActiveParam.skill_type;                       // 基本情報:スキルタイプ
                skillActivity.m_Effect  = skillActiveParam.effect;                           // 基本情報:エフェクト

                skillActivity.m_skill_chk_atk_combo = MasterDataDefineLabel.BoolType.ENABLE; // 攻撃情報:攻撃側:コンボレートの影響

                // @change Developer v320 リンクスキル振れ幅対応
                if (skillActiveParam.Is_skill_active())
                {
                    // 振れ幅が設定してある場合
                    if (skillActiveParam.skill_value_rand != 0)
                    {
                        nSkillPower = skillActiveParam.skill_value + skillActiveParam.skill_value_rand;
                        if (nSkillPower < 0)
                        {
                            nSkillPower = 0;
                        }

                        // 最小値と最大値を確定:基準値より高い場合
                        if (nSkillPower > skillActiveParam.skill_value)
                        {
                            unRandMin = (uint)skillActiveParam.skill_value;
                            unRandMax = (uint)nSkillPower;
                        }
                        else
                        {
                            unRandMin = (uint)nSkillPower;
                            unRandMax = (uint)skillActiveParam.skill_value;
                        }

                        // スキル威力確定:振れ幅算出
                        skillActivity.m_skill_power = (int)RandManager.GetRand(unRandMin, unRandMax + 1);

                        // 効果値によるエフェクトの切り替え
                        skillActivity.m_Effect = InGameUtilBattle.SetSkillEffectToValue(skillActivity.m_Effect, skillActivity.m_Type, skillActivity.m_skill_power);
                    }
                    else
                    {
                        skillActivity.m_skill_power = skillActiveParam.skill_value;
                    }
                }

                // クリティカル判定
                if (BattleSceneUtil.checkChancePercent(skillActiveParam.skill_critical_odds))
                {
                    skillActivity.m_bCritical = true;
                }
                else
                {
                    skillActivity.m_bCritical = false;
                }

                m_SkillRequestLink.addSkillRequest(skillActivity);
            }
        }
    }
Ejemplo n.º 12
0
    /// <summary>
    /// ノーマルスキル設定
    /// </summary>
    /// <param name="skill_id"></param>
    public void setupActiveSkill(uint skill_id)
    {
        BaseHeight            = BASE_DEFAULT_HEIGHT;
        TitleHeight           = TITLE_DEFAULT_HEIGHT;
        TitleWidth            = TITLE_DEFAULT_WIDTH;
        MessageBgH            = MESSAGE_BG_HEIGHT;
        TitleBGImage          = ResourceManager.Instance.Load("skill_name_bg4", ResourceType.Common);
        SkillTitleImage       = ResourceManager.Instance.Load("NORMAL", ResourceType.Common);
        IsTurnLabelBlackColor = false;
        IsSkillItem           = true;
        IsViewIcon            = false;
        IsViewStatus          = false;

        if (skill_id != 0)
        {
            IsViewElement    = true;
            IsViewTurn       = false;
            IsViewSkillLevel = false;

            MasterDataSkillActive _master = MasterFinder <MasterDataSkillActive> .Instance.Find((int)skill_id);

            if (_master == null)
            {
                return;
            }

            SkillTitleText  = _master.name;
            SkillDetailText = _master.detail;

            if (ElementList == null)
            {
                ElementList = new List <UnitSkillElemContext>();
            }
            if (_master.cost1 != MasterDataDefineLabel.ElementType.NONE)
            {
                ElementList.Add(new UnitSkillElemContext(_master.cost1));
            }
            if (_master.cost2 != MasterDataDefineLabel.ElementType.NONE)
            {
                ElementList.Add(new UnitSkillElemContext(_master.cost2));
            }
            if (_master.cost3 != MasterDataDefineLabel.ElementType.NONE)
            {
                ElementList.Add(new UnitSkillElemContext(_master.cost3));
            }
            if (_master.cost4 != MasterDataDefineLabel.ElementType.NONE)
            {
                ElementList.Add(new UnitSkillElemContext(_master.cost4));
            }
            if (_master.cost5 != MasterDataDefineLabel.ElementType.NONE)
            {
                ElementList.Add(new UnitSkillElemContext(_master.cost5));
            }
        }
        else
        {
            IsViewElement    = false;
            IsViewTurn       = false;
            IsViewSkillLevel = false;

            SkillTitleText  = "-";
            SkillDetailText = "-";
        }
        MessageBgResize();
    }
Ejemplo n.º 13
0
    /// <summary>
    /// アクティブスキルからブーストスキルの発動情報を抽出し追加
    /// </summary>
    /// <param name="active_skill_activity"></param>
    public void AddActivityBoostSkill(BattleSkillActivity active_skill_activity)
    {
        if (active_skill_activity == null ||
            active_skill_activity.m_SkillType != ESKILLTYPE.eACTIVE)
        {
            return;
        }

        // ブーストパネルを未使用の場合
        if (active_skill_activity.m_bBonusBoost == false)
        {
            return;
        }

        MasterDataSkillActive skillActiveParam = active_skill_activity.getMasterDataSkillActive();

        if (skillActiveParam == null ||
            skillActiveParam.skill_boost_id == 0)
        {
            return;
        }

        // ブーストスキル情報を取得
        MasterDataSkillBoost skillBoostParam = BattleParam.m_MasterDataCache.useSkillBoost(skillActiveParam.skill_boost_id);

        if (skillBoostParam == null)
        {
            return;
        }

        // ブーストスキルを構築
        BattleSkillActivity boost_skill_activity = new BattleSkillActivity();

        if (boost_skill_activity != null)
        {
            // 共通情報を設定
            boost_skill_activity.m_SkillParamOwnerNum = active_skill_activity.m_SkillParamOwnerNum;             // 発動者
            boost_skill_activity.m_SkillParamFieldID  = InGameDefine.SELECT_NONE;                               // フィールドID(ブーストパネルの判定にも使っている)
            boost_skill_activity.m_SkillParamSkillID  = skillActiveParam.skill_boost_id;                        // ブーストスキルID
            boost_skill_activity.m_SkillName          = skillActiveParam.Get_skill_boost_name();                // ブーストスキル名
            boost_skill_activity.m_SkillType          = ESKILLTYPE.eBOOST;                                      // 発動スキルの種類

            boost_skill_activity.m_Element = skillActiveParam.skill_boost_element;                              // 基本情報:属性
            boost_skill_activity.m_Type    = skillBoostParam.skill_type;                                        // 基本情報:スキルタイプ
            boost_skill_activity.m_Category_BoostSkillCategory_PROPERTY = skillBoostParam.skill_cate;           // 基本情報:効果カテゴリ
            boost_skill_activity.m_Effect = skillActiveParam.skill_boost_effect;                                // 基本情報:エフェクト

            boost_skill_activity.m_skill_power         = skillBoostParam.skill_power;                           // 攻撃情報:攻撃力(%)
            boost_skill_activity.m_skill_power_fix     = skillBoostParam.skill_power_fix;                       // 攻撃情報:攻撃力(固定)
            boost_skill_activity.m_skill_power_hp_rate = skillBoostParam.skill_power_hp_rate;                   // 攻撃情報:攻撃力(対象HPの割合)
            boost_skill_activity.m_skill_absorb        = skillBoostParam.skill_absorb;                          // 攻撃情報:吸収量(%)

            boost_skill_activity.m_skill_chk_atk_affinity = skillBoostParam.skill_chk_atk_affinity;             // 効果情報:攻撃側:属性相性チェック
            boost_skill_activity.m_skill_chk_atk_leader   = skillBoostParam.skill_chk_atk_leader;               // 効果情報:攻撃側:リーダースキルチェック
            boost_skill_activity.m_skill_chk_atk_passive  = skillBoostParam.skill_chk_atk_passive;              // 効果情報:攻撃側:パッシブスキルチェック
            boost_skill_activity.m_skill_chk_atk_ailment  = skillBoostParam.skill_chk_atk_ailment;              // 効果情報:攻撃側:状態変化チェック
            boost_skill_activity.m_skill_chk_atk_combo    = MasterDataDefineLabel.BoolType.DISABLE;             // 攻撃情報:攻撃側:コンボレートの影響

            boost_skill_activity.m_skill_chk_def_defence = skillBoostParam.skill_chk_def_defence;               // 効果情報:防御側:防御無視チェック
            boost_skill_activity.m_skill_chk_def_ailment = skillBoostParam.skill_chk_def_ailment;               // 効果情報:防御側:状態変化チェック
            boost_skill_activity.m_skill_chk_def_barrier = skillBoostParam.skill_chk_def_barrier;               // 効果情報:防御側:状態バリアチェック

            boost_skill_activity.m_statusAilment_target = skillBoostParam.status_ailment_target;                // 状態変化対象
            boost_skill_activity.m_statusAilment        = new int[] { skillBoostParam.status_ailment1,          // 状態変化1
                                                                      skillBoostParam.status_ailment2,          // 状態変化2
                                                                      skillBoostParam.status_ailment3,          // 状態変化3
                                                                      skillBoostParam.status_ailment4 };        // 状態変化4

            boost_skill_activity.m_nStatusAilmentDelay = skillBoostParam.status_ailment_delay;                  // 状態変化遅延。

            // 汎用情報を設定
            boost_skill_activity._setParam(skillBoostParam);


            // リストに登録
            m_SkillRequestBoost.addSkillRequest(boost_skill_activity);
        }
    }
Ejemplo n.º 14
0
    /**
     * プレイヤー側で使用しているマスターデータをキャッシュ.
     */
    public void CachePlayerMasterData(CharaParty player_party)
    {
        clearCachePlayerAll();

        // 常駐スキル.
        MasterDataSkillActive[] master_data_skill_active_array = null;
#if BUILD_TYPE_DEBUG && USE_DEBUG_JSON_MASTER_DATA
        if (BattleParam.m_IsUseDebugJsonMasterData)
        {
            master_data_skill_active_array = BattleMasterDataFromJson.Instance.getMasterDataAll <MasterDataSkillActive>();
            for (int idx = 0; idx < master_data_skill_active_array.Length; idx++)
            {
                MasterDataSkillActive master_data_skill_active = master_data_skill_active_array[idx];
                if (master_data_skill_active.always == MasterDataDefineLabel.BoolType.ENABLE)
                {
                    useSkillActive(master_data_skill_active.fix_id);
                }
            }
        }
        else
#endif    //USE_DEBUG_JSON_MASTER_DATA
        {
            MasterDataSkillActive[] resMasterDataSkillActiveArray = MasterFinder <MasterDataSkillActive> .Instance.SelectWhere("where always = ? ", MasterDataDefineLabel.BoolType.ENABLE).ToArray();

            if (resMasterDataSkillActiveArray != null)
            {
                foreach (MasterDataSkillActive resMasterDataSkillActive in resMasterDataSkillActiveArray)
                {
                    useSkillActive(resMasterDataSkillActive.fix_id);
                }
            }
        }

        for (int i = 0; i < player_party.getPartyMemberMaxCount(); i++)
        {
            CharaOnce chara = player_party.getPartyMember((GlobalDefine.PartyCharaIndex)i, CharaParty.CharaCondition.EXIST);
            if (chara == null)
            {
                continue;
            }

            if (!chara.m_bHasCharaMasterDataParam)
            {
                continue;
            }

            // キャラ情報を保存
            MasterDataParamChara master_data_param_chara = chara.m_CharaMasterDataParam;
            addCharaParam(master_data_param_chara);

            // リンクキャラを保存
            MasterDataParamChara master_data_param_link_chara = null;
            if (chara.m_LinkParam != null)
            {
                master_data_param_link_chara = useCharaParam(chara.m_LinkParam.m_CharaID);
            }

            //--------------------------------
            // スキル情報を保存		<アクティブ1>
            //--------------------------------
            {
                MasterDataSkillActive master_data_skill_active = useSkillActive(master_data_param_chara.skill_active0);
                if (master_data_skill_active != null)
                {
                    useSkillBoost(master_data_skill_active.skill_boost_id);
                }
            }

            //--------------------------------
            // スキル情報を保存		<アクティブ2>
            //--------------------------------
            {
                MasterDataSkillActive master_data_skill_active = useSkillActive(master_data_param_chara.skill_active1);
                if (master_data_skill_active != null)
                {
                    useSkillBoost(master_data_skill_active.skill_boost_id);
                }
            }

            //--------------------------------
            // スキル情報を保存		<リーダー>
            //--------------------------------
            {
                int loop_counter = 0;
                MasterDataSkillLeader master_data_skill_leader = useSkillLeader(master_data_param_chara.skill_leader);
                while (master_data_skill_leader != null)
                {
                    // 無限ループ検出
                    if (_checkinfiniteLoop(ref loop_counter))
                    {
                        master_data_skill_leader.add_fix_id = 0;
                        break;
                    }

                    master_data_skill_leader = useSkillLeader(master_data_skill_leader.add_fix_id);
                }
            }

            //--------------------------------
            // スキル情報を保存		<パッシブ>
            //--------------------------------
            {
                int loop_counter = 0;
                MasterDataSkillPassive master_data_skill_passive = useSkillPassive(master_data_param_chara.skill_passive);
                while (master_data_skill_passive != null)
                {
                    // 無限ループ検出
                    if (_checkinfiniteLoop(ref loop_counter))
                    {
                        master_data_skill_passive.add_fix_id = 0;
                        break;
                    }

                    master_data_skill_passive = useSkillPassive((uint)master_data_skill_passive.add_fix_id);
                }
            }

            //--------------------------------
            // スキル情報を保存		<リンクパッシブ>
            //--------------------------------
            // バトル中の判定には使わないが、ダイアログの表示に使われるので保存.
            useSkillPassive(master_data_param_chara.link_skill_passive);

            //--------------------------------
            // スキル情報を保存		<リミブレ>
            //--------------------------------
            {
                int loop_counter = 0;
                MasterDataSkillLimitBreak master_data_skill_limit_break = useSkillLimitBreak(master_data_param_chara.skill_limitbreak);
                while (master_data_skill_limit_break != null)
                {
                    // 無限ループ検出
                    if (_checkinfiniteLoop(ref loop_counter))
                    {
                        master_data_skill_limit_break.add_fix_id = 0;
                        break;
                    }

                    master_data_skill_limit_break = useSkillLimitBreak((uint)master_data_skill_limit_break.add_fix_id);
                }
            }

            //--------------------------------
            // スキル情報を保存		<リンク>
            //--------------------------------
            if (master_data_param_link_chara != null)
            {
                //--------------------------------
                // スキル情報を保存		<リンクスキル>
                //--------------------------------
                useSkillActive(master_data_param_link_chara.skill_active0);

                //--------------------------------
                // スキル情報を保存		<リンクパッシブ>
                //--------------------------------
                {
                    int loop_counter = 0;
                    MasterDataSkillPassive master_data_skill_passive = useSkillPassive(master_data_param_link_chara.link_skill_passive);
                    while (master_data_skill_passive != null)
                    {
                        // 無限ループ検出
                        if (_checkinfiniteLoop(ref loop_counter))
                        {
                            master_data_skill_passive.add_fix_id = 0;
                            break;
                        }

                        master_data_skill_passive = useSkillPassive((uint)master_data_skill_passive.add_fix_id);
                    }
                }
            }
        }
    }
Ejemplo n.º 15
0
    //----------------------------------------------------------------------------
    /*!
		@brief	キャラ情報セットアップ:マスターデータ指定
		@param	MasterDataParamChara	cMasterData		キャラマスター
		@param	int						nLevel			キャラレベル
		@param	int						lbsLv			リミットブレイクスキルレベル
		@param	int						nPlusPow		プラス値:攻撃
		@param	int						nPlusHP			プラス値:体力
		@param	int						nLOLevel		プラス値:限界突破値
		@note
	*/
    //----------------------------------------------------------------------------
    public bool CharaSetupFromParam(MasterDataParamChara cMasterData, int nLevel, int lbsLv, int nPlusPow, int nPlusHP, int nLOLevel)
    {
        m_CharaMasterDataParam = cMasterData;
        m_bHasCharaMasterDataParam = (null != m_CharaMasterDataParam);

        if (m_CharaMasterDataParam == null)
        {
            Debug.LogError("CharaSetup Error! - InstanceNone!! ");
            return false;
        }

        // @change Developer 2015/09/03 ver300
        #region ==== 通常処理 ====
        int nPlusValuePow = 0;
        int nPlusValueHP = 0;

        m_CharaLevel = nLevel;
        m_CharaLBSLv = lbsLv;

        float fLimitOverHP = 0;
        float fLimitOverATK = 0;

        #region ==== スキルレベルまるめ処理 ====
        MasterDataSkillLimitBreak cSkillLimitBreak = BattleParam.m_MasterDataCache.useSkillLimitBreak(cMasterData.skill_limitbreak);
        if (cSkillLimitBreak != null)
        {
            if (lbsLv > cSkillLimitBreak.level_max)
            {
                m_CharaLBSLv = cSkillLimitBreak.level_max;
            }
        }
        #endregion

        #region ==== リミットオーバーまるめ処理 ====
        MasterDataLimitOver _masterMainLO = MasterFinder<MasterDataLimitOver>.Instance.Find((int)cMasterData.limit_over_type);
        if (_masterMainLO != null)
        {
            if (nLOLevel > _masterMainLO.limit_over_max)
            {
                nLOLevel = _masterMainLO.limit_over_max;
            }
        }
        #endregion

        m_CharaPow = CharaUtil.GetStatusValue(m_CharaMasterDataParam, nLevel, CharaUtil.VALUE.POW);
        m_CharaDef = CharaUtil.GetStatusValue(m_CharaMasterDataParam, nLevel, CharaUtil.VALUE.DEF);
        m_CharaHP = CharaUtil.GetStatusValue(m_CharaMasterDataParam, nLevel, CharaUtil.VALUE.HP);
        m_CharaLimitBreak = 0;
        m_CharaPlusPow = nPlusPow;
        m_CharaPlusDef = 0;
        m_CharaPlusHP = nPlusHP;
        m_CharaLimitOver = nLOLevel;
        m_CharaCharm = CharaLimitOver.GetParamCharm((uint)nLOLevel, cMasterData.limit_over_type);
        // レベルMAXなら限界突破の値を追加

        float fLimitOverAddHp = CharaLimitOver.GetParam((uint)nLOLevel, cMasterData.limit_over_type, (int)CharaLimitOver.EGET.ePARAM_HP);
        float fLimitOverAddAtk = CharaLimitOver.GetParam((uint)nLOLevel, cMasterData.limit_over_type, (int)CharaLimitOver.EGET.ePARAM_ATK);


        fLimitOverHP = m_CharaHP * (fLimitOverAddHp / 100);
        fLimitOverATK = m_CharaPow * (fLimitOverAddAtk / 100);

        // プラス値を算出
        nPlusValuePow = m_CharaPlusPow * GlobalDefine.PLUS_RATE_POW;
        nPlusValueHP = m_CharaPlusHP * GlobalDefine.PLUS_RATE_HP;
        #endregion

        // @add Developer 2015/09/03 ver300
        #region ==== リンクシステム処理 ====
        int nElemValuePow = 0;
        int nElemValueHP = 0;
        int nRaceValuePow = 0;
        int nRaceValueHP = 0;
        int nLinkPlusValuePow = 0;
        int nLinkPlusValueHP = 0;
        double nLinkCharm = 0;
        // リンク中の場合
        //MasterDataParamChara cLinkCharaMaster = BattleParam.m_MasterDataCache.useCharaParam(m_LinkParam.m_CharaID);
        MasterDataParamChara cLinkCharaMaster = m_LinkParam.m_cCharaMasterDataParam;
        if (cLinkCharaMaster != null)
        {
            float fWork = 0.0f;

            // 属性ボーナスを加算
            nElemValuePow = CharaLinkUtil.GetLinkUnitBonusElement(cLinkCharaMaster, m_LinkParam.m_CharaLv, (uint)m_LinkParam.m_CharaLOLevel, CharaUtil.VALUE.POW);
            nElemValueHP = CharaLinkUtil.GetLinkUnitBonusElement(cLinkCharaMaster, m_LinkParam.m_CharaLv, (uint)m_LinkParam.m_CharaLOLevel, CharaUtil.VALUE.HP);

            // 種族ボーナス:攻撃力の+%値を算出
            fWork = CharaLinkUtil.GetLinkUnitBonusRace(cLinkCharaMaster, cLinkCharaMaster.kind, CharaUtil.VALUE.POW);           // %値取得(メイン)
            fWork += CharaLinkUtil.GetLinkUnitBonusRace(cLinkCharaMaster, cLinkCharaMaster.sub_kind, CharaUtil.VALUE.POW);          // %値取得(サブ)
            fWork = InGameUtilBattle.GetDBRevisionValue(fWork);                                                                 // 数値変換
            nRaceValuePow = (int)InGameUtilBattle.AvoidErrorMultiple((float)m_CharaPow, fWork);                                         // 増加量

            // 種族ボーナス:体力の実値を取得
            nRaceValueHP = (int)CharaLinkUtil.GetLinkUnitBonusRace(cLinkCharaMaster, cLinkCharaMaster.kind, CharaUtil.VALUE.HP);        // 実値取得(メイン)
            nRaceValueHP += (int)CharaLinkUtil.GetLinkUnitBonusRace(cLinkCharaMaster, cLinkCharaMaster.sub_kind, CharaUtil.VALUE.HP);       // 実値取得(サブ)

            // +値の算出
            nLinkPlusValuePow = CharaLinkUtil.GetLinkUnitBonusPlus(m_LinkParam.m_CharaPlusPow, CharaUtil.VALUE.POW);
            nLinkPlusValueHP = CharaLinkUtil.GetLinkUnitBonusPlus(m_LinkParam.m_CharaPlusHP, CharaUtil.VALUE.HP);
            nLinkCharm = CharaLimitOver.GetParamCharm((uint)m_LinkParam.m_CharaLOLevel, cLinkCharaMaster.limit_over_type);
        }
        else
        {
            // リンク用変数の初期化
            m_LinkParam.Setup();
        }
        #endregion

#if BUILD_TYPE_DEBUG
        DebugBattleLog.writeText(DebugBattleLog.StrOpe + "キャラ基本情報"
            + "[" + cMasterData.name + "]"
            + " FixID:" + cMasterData.fix_id
            + " DrawID:" + cMasterData.draw_id
            + " LV:" + m_CharaLevel.ToString()
            + " SkillLV:" + m_CharaLBSLv.ToString()
            + " LimOverLv:" + m_CharaLimitOver.ToString()
            + " PlusPow:" + m_CharaPlusPow.ToString()
            + " PlusHp:" + m_CharaPlusHP.ToString()
            + " 属性:" + cMasterData.element.ToString()
            + " 種族1:" + cMasterData.kind.ToString()
            + " 種族2:" + cMasterData.sub_kind.ToString()
        );

        DebugBattleLog.writeText(DebugBattleLog.StrOpe + "  HP(" + (m_CharaHP + nPlusValueHP + nElemValueHP + nRaceValueHP + nLinkPlusValueHP + (int)fLimitOverHP).ToString() + ")"
            + " = LV(" + m_CharaHP.ToString() + ")"
            + " + PlusHP(" + nPlusValueHP.ToString() + ")"
            + " + LinkElem(" + nElemValueHP.ToString() + ")"
            + " + LinkRace(" + nRaceValueHP.ToString() + ")"
            + " + LinkPlus(" + nLinkPlusValueHP.ToString() + ")"
            + " + LimitOver(" + ((int)fLimitOverHP).ToString() + ")"
            );
        DebugBattleLog.writeText(DebugBattleLog.StrOpe + "  POW(" + (m_CharaPow + nPlusValuePow + nElemValuePow + nRaceValuePow + nLinkPlusValuePow + (int)fLimitOverATK).ToString() + ")"
            + " = LV(" + m_CharaPow.ToString() + ")"
            + " + PlusPow(" + nPlusValuePow.ToString() + ")"
            + " + LinkElem(" + nElemValuePow.ToString() + ")"
            + " + LinkRace(" + nRaceValuePow.ToString() + ")"
            + " + LinkPlus(" + nLinkPlusValuePow.ToString() + ")"
            + " + LimitOver(" + ((int)fLimitOverATK).ToString() + ")"
            );

        const int ADD_SKILL_COUNT_LIMIT = 50;	// スキル連結数の上限

        if (cMasterData.skill_leader != 0)
        {
            DebugBattleLog.writeText(DebugBattleLog.StrOpe + "   リーダースキル(fixid:" + cMasterData.skill_leader.ToString(), false);
            MasterDataSkillLeader master_data = BattleParam.m_MasterDataCache.useSkillLeader(cMasterData.skill_leader);
            if (master_data == null)
            {
                DebugBattleLog.writeText(DebugBattleLog.StrOpe + "ERROR!(存在しないfix_id))");
            }
            else
            {
                DebugBattleLog.writeText(DebugBattleLog.StrOpe + ")[" + master_data.name + "]" + master_data.detail);
            }
        }

        if (cMasterData.skill_limitbreak != 0)
        {
            DebugBattleLog.writeText(DebugBattleLog.StrOpe + "   リミブレスキル(fixid:" + cMasterData.skill_limitbreak.ToString(), false);
            MasterDataSkillLimitBreak master_data = BattleParam.m_MasterDataCache.useSkillLimitBreak(cMasterData.skill_limitbreak);
            if (master_data == null)
            {
                DebugBattleLog.writeText(DebugBattleLog.StrOpe + "ERROR!(存在しないfix_id))");
            }
            else
            {
                int loop_limit = ADD_SKILL_COUNT_LIMIT;
                int add_fix_id = master_data.add_fix_id;
                while (add_fix_id != 0)
                {
                    DebugBattleLog.writeText(DebugBattleLog.StrOpe + "+" + add_fix_id.ToString(), false);
                    MasterDataSkillLimitBreak add_master_data = BattleParam.m_MasterDataCache.useSkillLimitBreak((uint)add_fix_id);
                    if (add_master_data == null)
                    {
                        DebugBattleLog.writeText(DebugBattleLog.StrOpe + "ERROR!(存在しないfix_id))");
                        break;
                    }

                    add_fix_id = add_master_data.add_fix_id;
                    loop_limit--;
                    if (loop_limit <= 0)
                    {
                        DebugBattleLog.writeText(DebugBattleLog.StrOpe + "ERROR!(無限ループ))");
                    }
                }

                DebugBattleLog.writeText(DebugBattleLog.StrOpe + ")[" + master_data.name + "]" + master_data.detail);
            }
        }

        if (cMasterData.skill_active0 != 0)
        {
            DebugBattleLog.writeText(DebugBattleLog.StrOpe + "   ノーマルスキル1(fixid:" + cMasterData.skill_active0.ToString(), false);
            MasterDataSkillActive master_data = BattleParam.m_MasterDataCache.useSkillActive(cMasterData.skill_active0);
            if (master_data == null)
            {
                DebugBattleLog.writeText(DebugBattleLog.StrOpe + "ERROR!(存在しないfix_id))");
            }
            else
            {
                DebugBattleLog.writeText(DebugBattleLog.StrOpe + ")[" + master_data.name + "]" + master_data.detail);
            }
        }

        if (cMasterData.skill_active1 != 0)
        {
            DebugBattleLog.writeText(DebugBattleLog.StrOpe + "   ノーマルスキル2(fixid:" + cMasterData.skill_active1.ToString(), false);
            MasterDataSkillActive master_data = BattleParam.m_MasterDataCache.useSkillActive(cMasterData.skill_active1);
            if (master_data == null)
            {
                DebugBattleLog.writeText(DebugBattleLog.StrOpe + "ERROR!(存在しないfix_id))");
            }
            else
            {
                DebugBattleLog.writeText(DebugBattleLog.StrOpe + ")[" + master_data.name + "]" + master_data.detail);
            }
        }

        if (cMasterData.skill_passive != 0)
        {
            DebugBattleLog.writeText(DebugBattleLog.StrOpe + "   パッシブスキル(fixid:" + cMasterData.skill_passive.ToString(), false);
            MasterDataSkillPassive master_data = BattleParam.m_MasterDataCache.useSkillPassive(cMasterData.skill_passive);
            if (master_data == null)
            {
                DebugBattleLog.writeText(DebugBattleLog.StrOpe + "ERROR!(存在しないfix_id))");
            }
            else
            {
                int loop_limit = ADD_SKILL_COUNT_LIMIT;
                int add_fix_id = master_data.add_fix_id;
                while (add_fix_id != 0)
                {
                    DebugBattleLog.writeText(DebugBattleLog.StrOpe + "+" + add_fix_id.ToString(), false);
                    MasterDataSkillPassive add_master_data = BattleParam.m_MasterDataCache.useSkillPassive((uint)add_fix_id);
                    if (add_master_data == null)
                    {
                        DebugBattleLog.writeText(DebugBattleLog.StrOpe + "ERROR!(存在しないfix_id))");
                        break;
                    }

                    add_fix_id = add_master_data.add_fix_id;
                    loop_limit--;
                    if (loop_limit <= 0)
                    {
                        DebugBattleLog.writeText(DebugBattleLog.StrOpe + "ERROR!(無限ループ))");
                    }
                }

                DebugBattleLog.writeText(DebugBattleLog.StrOpe + ")[" + master_data.name + "]" + master_data.detail);
            }
        }

        if (cLinkCharaMaster != null)
        {
            DebugBattleLog.writeText(DebugBattleLog.StrOpe + " リンクキャラ"
                + "[" + cLinkCharaMaster.name + "]"
                + " FixID:" + cLinkCharaMaster.fix_id
                + " DrawID:" + cLinkCharaMaster.draw_id
                + " LV:" + m_LinkParam.m_CharaLv.ToString()
                + " LimOverLv:" + m_LinkParam.m_CharaLOLevel.ToString()
                + " PlusPow:" + m_LinkParam.m_CharaPlusPow.ToString()
                + " PlusHp:" + m_LinkParam.m_CharaPlusHP.ToString()
                + " LinkPoint:" + m_LinkParam.m_CharaLinkPoint.ToString()
            );

            if (cLinkCharaMaster.link_skill_active != 0)
            {
                DebugBattleLog.writeText(DebugBattleLog.StrOpe + "    リンクスキル(fixid:" + cLinkCharaMaster.link_skill_active.ToString(), false);
                MasterDataSkillActive master_data = BattleParam.m_MasterDataCache.useSkillActive(cLinkCharaMaster.link_skill_active);
                if (master_data == null)
                {
                    DebugBattleLog.writeText(DebugBattleLog.StrOpe + "ERROR!(存在しないfix_id))");
                }
                else
                {
                    DebugBattleLog.writeText(DebugBattleLog.StrOpe + ")[" + master_data.name + "]" + master_data.detail);
                }
            }

            if (cLinkCharaMaster.link_skill_passive != 0)
            {
                DebugBattleLog.writeText(DebugBattleLog.StrOpe + "    リンクパッシブスキル(fixid:" + cLinkCharaMaster.link_skill_passive.ToString(), false);
                MasterDataSkillPassive master_data = BattleParam.m_MasterDataCache.useSkillPassive(cLinkCharaMaster.link_skill_passive);
                if (master_data == null)
                {
                    DebugBattleLog.writeText(DebugBattleLog.StrOpe + "ERROR!(存在しないfix_id))");
                }
                else
                {
                    int loop_limit = ADD_SKILL_COUNT_LIMIT;
                    int add_fix_id = master_data.add_fix_id;
                    while (add_fix_id != 0)
                    {
                        DebugBattleLog.writeText(DebugBattleLog.StrOpe + "+" + add_fix_id.ToString(), false);
                        MasterDataSkillPassive add_master_data = BattleParam.m_MasterDataCache.useSkillPassive((uint)add_fix_id);
                        if (add_master_data == null)
                        {
                            DebugBattleLog.writeText(DebugBattleLog.StrOpe + "ERROR!(存在しないfix_id))");
                            break;
                        }

                        add_fix_id = add_master_data.add_fix_id;
                        loop_limit--;
                        if (loop_limit <= 0)
                        {
                            DebugBattleLog.writeText(DebugBattleLog.StrOpe + "ERROR!(無限ループ))");
                        }
                    }

                    DebugBattleLog.writeText(DebugBattleLog.StrOpe + ")[" + master_data.name + "]" + master_data.detail);
                }
            }
        }
#endif //BUILD_TYPE_DEBUG


        // 攻撃力、体力の増加値を加算
        m_CharaPow += nPlusValuePow + nElemValuePow + nRaceValuePow + nLinkPlusValuePow + (int)fLimitOverATK;
        m_CharaHP += nPlusValueHP + nElemValueHP + nRaceValueHP + nLinkPlusValueHP + (int)fLimitOverHP;
        m_CharaCharm += nLinkCharm;

        if (m_CharaPow > GlobalDefine.VALUE_MAX_POW)
        {
            m_CharaPow = GlobalDefine.VALUE_MAX_POW;
        }

        if (m_CharaHP > GlobalDefine.VALUE_MAX_HP)
        {
            m_CharaHP = GlobalDefine.VALUE_MAX_HP;
        }

        return true;
    }
Ejemplo n.º 16
0
    // Update is called once per frame
    void Update()
    {
        if (BattleParam.m_PlayerParty != null && BattleParam.isActiveBattle())
        {
            BattleSceneUtil.MultiInt damage_value = BattleParam.m_PlayerParty.getDispDamageValue();
            BattleSceneUtil.MultiInt heal_value   = BattleParam.m_PlayerParty.getDispRecoveryValue();

            if (BattleParam.m_PlayerParty.m_HPCurrent.getValue(GlobalDefine.PartyCharaIndex.MAX) != m_PartyHp ||
                BattleParam.m_PlayerParty.m_HPMax.getValue(GlobalDefine.PartyCharaIndex.MAX) != m_PartyHpMax
                )
            {
                m_PartyHp    = BattleParam.m_PlayerParty.m_HPCurrent.getValue(GlobalDefine.PartyCharaIndex.MAX);
                m_PartyHpMax = BattleParam.m_PlayerParty.m_HPMax.getValue(GlobalDefine.PartyCharaIndex.MAX);
                if (m_PartyHpObject != null)
                {
                    TextMesh text_mesh = m_PartyHpObject.GetComponent <TextMesh>();
                    if (text_mesh != null)
                    {
                        text_mesh.text = "HP:" + m_PartyHp.ToString() + "/" + m_PartyHpMax.ToString();
                    }
                }
            }

            if (damage_value != null)
            {
                int hp_delta = damage_value.getValue(GlobalDefine.PartyCharaIndex.MAX);
                if (hp_delta > 0)
                {
                    DrawDamageManager.showDamage(m_PartyHpDamageLocale.transform, hp_delta, EDAMAGE_TYPE.eDAMAGE_TYPE_WEEK);
                }
            }

            if (heal_value != null)
            {
                int hp_delta = heal_value.getValue(GlobalDefine.PartyCharaIndex.MAX);
                if (hp_delta > 0)
                {
                    DrawDamageManager.showDamage(m_PartyHpDamageLocale.transform, hp_delta, EDAMAGE_TYPE.eDAMAGE_TYPE_HEAL);
                    EffectManager.Instance.playEffect(SceneObjReferGameMain.Instance.m_EffectPrefab.m_Heal_03, new Vector3(2.0f * 0.05f, -0.9609375f * 0.05f, 0.0f), Vector3.zero, m_PartyHpObject.transform, null, 0.15f);
                }
            }

            if (BattleParam.m_PlayerParty.m_PartyTotalSP != m_PartySp ||
                BattleParam.m_PlayerParty.m_PartyTotalSPMax != m_PartySpMax
                )
            {
                int old_sp = m_PartySp;
                m_PartySp    = BattleParam.m_PlayerParty.m_PartyTotalSP;
                m_PartySpMax = BattleParam.m_PlayerParty.m_PartyTotalSPMax;
                if (m_PartySpObject != null)
                {
                    TextMesh text_mesh = m_PartySpObject.GetComponent <TextMesh>();
                    if (text_mesh != null)
                    {
                        text_mesh.text = "SP:" + m_PartySp.ToString() + "/" + m_PartySpMax.ToString();
                    }
                    if (m_PartySp > old_sp)
                    {
                        EffectManager.Instance.playEffect(SceneObjReferGameMain.Instance.m_EffectPrefab.m_Heal_SP, new Vector3(2.0f * 0.05f, -0.4f * 0.05f, 0.0f), Vector3.zero, m_PartySpObject.transform, null, 0.125f);
                    }
                }
            }

            // パーティ状態異常
            {
                Transform ailment_object = transform.Find("PartyAilment");
                if (ailment_object != null)
                {
                    InGameAilmentIcon ailment_icon = ailment_object.GetComponent <InGameAilmentIcon>();
                    if (ailment_icon != null)
                    {
                        StatusAilmentChara ailment_info = BattleParam.m_PlayerParty.m_Ailments.getAilment(GlobalDefine.PartyCharaIndex.MAX);
                        ailment_icon.SetStatus(ailment_info);
                    }
                }
            }

            bool is_control = false;
            if (BattleParam.getBattlePhase() == BattleParam.BattlePhase.INPUT)
            {
                is_control = true;
            }

            // ヒーロースキル発動ボタン
            {
                Transform hero_skill_button_trans = transform.Find("Canvas/ButtonHeroSkill");
                if (hero_skill_button_trans != null)
                {
                    Button button = hero_skill_button_trans.GetComponent <Button>();
                    if (button != null)
                    {
                        bool is_button_enable = (is_control && BattleParam.m_PlayerParty.m_BattleHero.checkHeroSkillTurn());
                        button.interactable = is_button_enable;

                        Transform btn_txt = hero_skill_button_trans.Find("Text");
                        if (btn_txt != null)
                        {
                            Text txt = btn_txt.GetComponent <Text>();
                            if (txt != null)
                            {
                                txt.text = BattleParam.m_PlayerParty.m_BattleHero.getSkillTurn().ToString() + "/HERO";
                            }
                        }
                    }
                }
            }

            GlobalDefine.PartyCharaIndex provoke_target = BattleParam.m_PlayerParty._getProvokeTarget();
            for (int idx = 0; idx < (int)GlobalDefine.PartyCharaIndex.MAX; idx++)
            {
                string chara_name             = "";
                int    chara_id               = 0;
                int    link_chara_id          = 0;
                string hp_text                = "";
                string skill_name             = "";
                bool   is_active_skill_button = false;

                CharaOnce chara_once = BattleParam.m_PlayerParty.getPartyMember((GlobalDefine.PartyCharaIndex)idx, CharaParty.CharaCondition.EXIST);
                bool      is_alive   = false;
                if (chara_once != null)
                {
                    MasterDataParamChara chara_master = chara_once.m_CharaMasterDataParam;

                    int   hp      = BattleParam.m_PlayerParty.m_HPCurrent.getValue((GlobalDefine.PartyCharaIndex)idx);
                    float hp_rate = hp / (float)BattleParam.m_PlayerParty.m_HPMax.getValue((GlobalDefine.PartyCharaIndex)idx);

                    string hp_color = "white";
                    if (hp_rate >= 0.5f)
                    {
                        hp_color = "white";
                        is_alive = true;
                    }
                    else
                    if (hp_rate >= 0.2f)
                    {
                        hp_color = "yellow";
                        is_alive = true;
                    }
                    else
                    if (hp_rate > 0.0f)
                    {
                        hp_color = "red";
                        is_alive = true;
                    }
                    else
                    {
                        hp_color = "#808080";
                    }

                    // キャラ名
                    chara_name = "<color=" + hp_color + ">" + chara_master.name + "</color>";

                    // キャライメージ
                    chara_id = (int)chara_master.fix_id;

                    // リンクキャライメージ
                    if (chara_once.m_LinkParam != null)
                    {
                        link_chara_id = (int)chara_once.m_LinkParam.m_CharaID;
                    }

                    int atk_percent = (int)(InGameUtil.getCharaAttakPowScale(chara_once, BattleParam.m_PlayerParty.m_Ailments.getAilment((GlobalDefine.PartyCharaIndex)idx)) * 100.0f);
                    int hp_percent  = (int)(BattleParam.m_PlayerParty.m_HPMax.getValue((GlobalDefine.PartyCharaIndex)idx) / (float)BattleParam.m_PlayerParty.m_HPBase.getValue((GlobalDefine.PartyCharaIndex)idx) * 100.0f);

                    // キャラ個別HP
                    hp_text = "<color=" + hp_color + ">"
                              + BattleParam.m_PlayerParty.m_HPCurrent.getValue((GlobalDefine.PartyCharaIndex)idx)
                              + "/" + BattleParam.m_PlayerParty.m_HPMax.getValue((GlobalDefine.PartyCharaIndex)idx)
                              + "</color>";

                    if (BattleParam.IsKobetsuHP)
                    {
                        hp_text += " <color=#a0a0a0>HP" + hp_percent.ToString() + "%\n";
                        if (BattleParam.m_PlayerParty.m_Hate_ProvokeTurn.getValue((GlobalDefine.PartyCharaIndex)idx) > 0)
                        {
                            if (provoke_target == (GlobalDefine.PartyCharaIndex)idx)
                            {
                                hp_text += "[挑発]:";
                            }
                            else
                            {
                                hp_text += "挑発:";
                            }
                            hp_text += BattleParam.m_PlayerParty.m_Hate_ProvokeTurn.getValue((GlobalDefine.PartyCharaIndex)idx);
                        }
                        else
                        {
                            hp_text += "Hate:" + BattleParam.m_PlayerParty.m_Hate.getValue((GlobalDefine.PartyCharaIndex)idx);
                        }

                        hp_text += " ATK" + atk_percent.ToString() + "%</color>";
                    }

                    // スキルターン
                    int skill_turn = chara_once.GetTrunToLimitBreak();
                    MasterDataSkillLimitBreak skill_limit_break = BattleParam.m_MasterDataCache.useSkillLimitBreak(chara_master.skill_limitbreak);
                    if (skill_limit_break != null)
                    {
                        skill_name = skill_turn.ToString() + "/" + skill_limit_break.name;
                    }

                    // ボタンのアクティブ・非アクティブ
                    {
                        is_active_skill_button = is_control && BattleParam.IsEnableLBS((GlobalDefine.PartyCharaIndex)idx);
                    }
                }

                // 表示
                {
                    // キャラ名
                    {
                        Transform chara_name_trans = m_MemberObject[idx].transform.Find("CharaName");
                        if (chara_name_trans != null)
                        {
                            Text text_component = chara_name_trans.GetComponent <Text>();
                            if (text_component != null)
                            {
                                text_component.text = chara_name;
                            }
                        }
                    }
                }

                // スキル発動条件表示
                {
                    {
                        MasterDataDefineLabel.ElementType[,] skill_costs = new MasterDataDefineLabel.ElementType[2, 5];

                        if (is_alive)
                        {
                            MasterDataParamChara chara_master = chara_once.m_CharaMasterDataParam;
                            if (chara_master.skill_active0 != 0)
                            {
                                MasterDataSkillActive skill_active0 = BattleParam.m_MasterDataCache.useSkillActive(chara_master.skill_active0);
                                if (skill_active0 != null)
                                {
                                    skill_costs[0, 0] = skill_active0.cost1;
                                    skill_costs[0, 1] = skill_active0.cost2;
                                    skill_costs[0, 2] = skill_active0.cost3;
                                    skill_costs[0, 3] = skill_active0.cost4;
                                    skill_costs[0, 4] = skill_active0.cost5;
                                }
                            }
                            if (chara_master.skill_active1 != 0)
                            {
                                MasterDataSkillActive skill_active1 = BattleParam.m_MasterDataCache.useSkillActive(chara_master.skill_active1);
                                if (skill_active1 != null)
                                {
                                    skill_costs[1, 0] = skill_active1.cost1;
                                    skill_costs[1, 1] = skill_active1.cost2;
                                    skill_costs[1, 2] = skill_active1.cost3;
                                    skill_costs[1, 3] = skill_active1.cost4;
                                    skill_costs[1, 4] = skill_active1.cost5;
                                }
                            }
                        }

                        for (int skill_idx = 0; skill_idx < 2; skill_idx++)
                        {
                            for (int cost_idx = 0; cost_idx < 5; cost_idx++)
                            {
                                Transform cost_trans = m_MemberObject[idx].transform.Find("SkillInfo/Skill" + skill_idx.ToString() + cost_idx.ToString());
                                if (cost_trans != null)
                                {
                                    MasterDataDefineLabel.ElementType element_type = skill_costs[skill_idx, cost_idx];
                                    if (element_type != MasterDataDefineLabel.ElementType.NONE)
                                    {
                                        Image img = cost_trans.GetComponent <Image>();
                                        if (img != null)
                                        {
                                            img.sprite = m_SkillCostElements[(int)element_type];
                                            cost_trans.gameObject.SetActive(true);
                                        }
                                        else
                                        {
                                            cost_trans.gameObject.SetActive(false);
                                        }
                                    }
                                    else
                                    {
                                        cost_trans.gameObject.SetActive(false);
                                    }
                                }
                            }
                        }
                    }

                    // キャライメージ
                    {
                        Transform chara_image_trans = m_MemberObject[idx].transform.Find("Image");
                        if (chara_image_trans != null)
                        {
                            BattleCharaImageViewControl chara_view_control = chara_image_trans.GetComponent <BattleCharaImageViewControl>();
                            if (chara_view_control != null)
                            {
                                chara_view_control.setCharaID(chara_id, BattleCharaImageViewControl.ImageType.FACE);
                            }
                        }
                    }

                    // リンクキャライメージ
                    {
                        Transform chara_image_trans = m_MemberObject[idx].transform.Find("ImageLink");
                        if (chara_image_trans != null)
                        {
                            BattleCharaImageViewControl chara_view_control = chara_image_trans.GetComponent <BattleCharaImageViewControl>();
                            if (chara_view_control != null)
                            {
                                chara_view_control.setCharaID(link_chara_id, BattleCharaImageViewControl.ImageType.FACE);
                            }
                        }
                    }

                    // キャラ個別HP
                    {
                        Transform chara_hp_trans = m_MemberObject[idx].transform.Find("HP");
                        if (chara_hp_trans != null)
                        {
                            Text text_component = chara_hp_trans.GetComponent <Text>();
                            if (text_component != null)
                            {
                                text_component.text = hp_text;
                            }
                        }

                        if (damage_value != null)
                        {
                            int hp_delta = damage_value.getValue((GlobalDefine.PartyCharaIndex)idx);
                            if (hp_delta > 0)
                            {
                                DrawDamageManager.showDamage(chara_hp_trans, hp_delta, EDAMAGE_TYPE.eDAMAGE_TYPE_WEEK, 50.0f);
                            }
                        }

                        if (heal_value != null)
                        {
                            int hp_delta = heal_value.getValue((GlobalDefine.PartyCharaIndex)idx);
                            if (hp_delta > 0)
                            {
                                DrawDamageManager.showDamage(chara_hp_trans, hp_delta, EDAMAGE_TYPE.eDAMAGE_TYPE_HEAL, 50.0f);
                                EffectManager.Instance.playEffect(SceneObjReferGameMain.Instance.m_EffectPrefab.m_Heal_03, new Vector3(0.01975f, -0.0246875f, 0.0f), Vector3.zero, chara_hp_trans, null, 50.0f * 3.0f);
                            }
                        }
                    }

                    // スキルターン
                    Transform skill_turn_trans = m_MemberObject[idx].transform.Find("SkillButton");
                    if (skill_turn_trans != null)
                    {
                        Text text_component = skill_turn_trans.GetChild(0).GetComponent <Text>();
                        if (text_component != null)
                        {
                            text_component.text = skill_name;
                        }

                        // ボタンのアクティブ・非アクティブ
                        {
                            Button button = skill_turn_trans.GetComponent <Button>();
                            button.interactable = is_active_skill_button;
                        }
                    }
                }

                // 敵にターゲットされているかどうかの表示
                {
                    Transform lock_on_object = m_MemberObject[idx].transform.Find("ImageLockOn");
                    if (lock_on_object != null)
                    {
                        lock_on_object.gameObject.SetActive(BattleParam.m_EnemyToPlayerTarget == (GlobalDefine.PartyCharaIndex)idx);
                    }
                }

                // 状態異常
                if (chara_once != null)
                {
                    Transform ailment_object = m_MemberObject[idx].transform.Find("Ailment");
                    if (ailment_object != null)
                    {
                        InGameAilmentIcon ailment_icon = ailment_object.GetComponent <InGameAilmentIcon>();
                        if (ailment_icon != null)
                        {
                            StatusAilmentChara ailment_info = BattleParam.m_PlayerParty.m_Ailments.getAilment((GlobalDefine.PartyCharaIndex)idx);
                            ailment_icon.SetStatus(ailment_info);   //毎フレーム設定する必要はないがとりあえず設定しておく
                        }
                    }
                }
            }
        }
    }
Ejemplo n.º 17
0
    // Update is called once per frame
    void Update()
    {
        if (m_IconObjects != null)
        {
            for (int field_idx = 0; field_idx < m_FieldAreaCount; field_idx++)
            {
                for (int skill_idx = 0; skill_idx < m_SkillCounts[field_idx]; skill_idx++)
                {
                    Sprite sprite = null;
                    MasterDataSkillActive master_data_skill_active = BattleParam.m_MasterDataCache.useSkillActive((uint)m_SkillIDs[field_idx, skill_idx]);
                    if (master_data_skill_active != null)
                    {
                        Sprite[] element_sprite = null;
                        switch (master_data_skill_active.skill_element)
                        {
                        case MasterDataDefineLabel.ElementType.NAUGHT:
                            element_sprite = m_SpritesNaught;
                            break;

                        case MasterDataDefineLabel.ElementType.FIRE:
                            element_sprite = m_SpritesFire;
                            break;

                        case MasterDataDefineLabel.ElementType.WATER:
                            element_sprite = m_SpritesWater;
                            break;

                        case MasterDataDefineLabel.ElementType.LIGHT:
                            element_sprite = m_SpritesLight;
                            break;

                        case MasterDataDefineLabel.ElementType.DARK:
                            element_sprite = m_SpritesDark;
                            break;

                        case MasterDataDefineLabel.ElementType.WIND:
                            element_sprite = m_SpritesWind;
                            break;

                        case MasterDataDefineLabel.ElementType.HEAL:
                            element_sprite = m_SpritesHeal;
                            break;
                        }

                        if (element_sprite != null)
                        {
                            switch (master_data_skill_active.skill_type)
                            {
                            case MasterDataDefineLabel.SkillType.ATK_ONCE:
                                sprite = element_sprite[0];
                                break;

                            case MasterDataDefineLabel.SkillType.ATK_ALL:
                                sprite = element_sprite[1];
                                break;

                            case MasterDataDefineLabel.SkillType.HEAL:
                                sprite = m_SpritesHeal[1];      // 属性に関係なく回復アイコンを出す.
                                break;

                            case MasterDataDefineLabel.SkillType.SUPPORT:
                                sprite = element_sprite[1];
                                break;
                            }
                        }

                        ResurrectInfo resurrent_info = master_data_skill_active.getResurrectInfo();
                        if (resurrent_info != null)
                        {
                            int recov_count = resurrent_info.m_FixCount + resurrent_info.m_AddCount;
                            if (recov_count >= 2)
                            {
                                sprite = m_SpritesResurr[1];
                            }
                            else
                            {
                                sprite = m_SpritesResurr[0];
                            }
                        }
                    }

                    if (sprite != null)
                    {
                        mSpriteRenderers[field_idx, skill_idx].sprite = sprite;
                        if (m_IconObjects[field_idx, skill_idx].IsActive() == false)
                        {
                            m_IconObjects[field_idx, skill_idx].SetActive(true);
                        }
                    }
                    else
                    {
                        if (m_IconObjects[field_idx, skill_idx].IsActive())
                        {
                            m_IconObjects[field_idx, skill_idx].SetActive(false);
                        }
                    }
                }

                for (int skill_idx = m_SkillCounts[field_idx]; skill_idx < m_SkillCountMax; skill_idx++)
                {
                    if (m_IconObjects[field_idx, skill_idx].IsActive())
                    {
                        m_IconObjects[field_idx, skill_idx].SetActive(false);
                    }
                }
            }
        }
    }
Ejemplo n.º 18
0
    public void SetUnitData(ref PartyMemberUnitContext unit, PacketStructUnit unitData)
    {
        if (unit == null)
        {
            return;
        }
        if (unitData == null || unitData.id == 0)
        {
            return;
        }
        MasterDataParamChara charMaster = MasterFinder <MasterDataParamChara> .Instance.Find((int)unitData.id);

        if (charMaster == null)
        {
            return;
        }
        if (charMaster.skill_active0 > 0)
        {
            MasterDataSkillActive skill1 = MasterFinder <MasterDataSkillActive> .Instance.Find((int)charMaster.skill_active0);

            if (skill1 != null)
            {
                unit.IsActiveSkill1Empty = false;
                unit.Skill1Cost1         = MainMenuUtil.GetSkillElementIcon(skill1.cost1);
                unit.Skill1Cost2         = MainMenuUtil.GetSkillElementIcon(skill1.cost2);
                unit.Skill1Cost3         = MainMenuUtil.GetSkillElementIcon(skill1.cost3);
                unit.Skill1Cost4         = MainMenuUtil.GetSkillElementIcon(skill1.cost4);
                unit.Skill1Cost5         = MainMenuUtil.GetSkillElementIcon(skill1.cost5);
                unit.Skill1Color         = MainMenuUtil.GetSkillElementColor("S1", skill1.skill_element);
            }
        }

        if (charMaster.skill_active1 > 0)
        {
            MasterDataSkillActive skill2 = MasterFinder <MasterDataSkillActive> .Instance.Find((int)charMaster.skill_active1);

            if (skill2 != null)
            {
                unit.IsActiveSkill2Empty = false;
                unit.Skill2Cost1         = MainMenuUtil.GetSkillElementIcon(skill2.cost1);
                unit.Skill2Cost2         = MainMenuUtil.GetSkillElementIcon(skill2.cost2);
                unit.Skill2Cost3         = MainMenuUtil.GetSkillElementIcon(skill2.cost3);
                unit.Skill2Cost4         = MainMenuUtil.GetSkillElementIcon(skill2.cost4);
                unit.Skill2Cost5         = MainMenuUtil.GetSkillElementIcon(skill2.cost5);
                unit.Skill2Color         = MainMenuUtil.GetSkillElementColor("S2", skill2.skill_element);
            }
        }

        unit.ParamText = (unitData.level >= charMaster.level_max) ? GameTextUtil.GetText("uniticon_flag1")
                                    : string.Format(GameTextUtil.GetText("uniticon_flag2"), unitData.level); // レベル

        uint plusPoint = unitData.add_hp + unitData.add_pow;                                                 // プラス値の計算

        if (plusPoint != 0)
        {
            unit.ParamText += string.Format(GameTextUtil.GetText("uniticon_flag3"), plusPoint);
        }

        unit.LinkIcon           = MainMenuUtil.GetLinkMark(unitData, null); // リンクアイコン
        unit.OutSideCircleImage = MainMenuUtil.GetElementCircleSprite(charMaster.element);
        SetUpCharaData(ref unit, unitData, CharaLinkUtil.GetLinkUnit(unitData.link_unique_id), false);
    }
Ejemplo n.º 19
0
    public int setSkillInfos(BattleSkillReq[] skill_infos, int skill_info_count)
    {
        int ret_val = -1;

        if (skill_infos == null || skill_info_count == 0)
        {
            for (int field_idx = 0; field_idx < m_FieldAreaCount; field_idx++)
            {
                for (int skill_idx = 0; skill_idx < m_SkillCountMax; skill_idx++)
                {
                    m_SkillIDs[field_idx, skill_idx]     = 0;
                    m_SkillCasters[field_idx, skill_idx] = GlobalDefine.PartyCharaIndex.ERROR;
                }
                m_SkillCounts[field_idx] = 0;
            }

            m_ComboSoundIndex = 0;
        }
        else
        {
            // スキルの増減を調べる
            int appear_skill_count = 0;

            {
                bool[,] is_cheked = new bool[m_FieldAreaCount, m_SkillCountMax];

                for (int req_idx = 0; req_idx < skill_info_count; req_idx++)
                {
                    BattleSkillReq battle_skill_req = skill_infos[req_idx];
                    if (battle_skill_req != null && battle_skill_req.m_SkillReqState != BattleSkillReq.State.NONE && battle_skill_req.m_SkillParamSkillID != 0)
                    {
                        uint skill_id  = battle_skill_req.m_SkillParamSkillID;
                        int  field_idx = battle_skill_req.m_SkillParamFieldNum;
                        GlobalDefine.PartyCharaIndex caster_idx = battle_skill_req.m_SkillParamCharaNum;

                        bool is_exsit = false;
                        for (int idx = 0; idx < m_SkillCounts[field_idx]; idx++)
                        {
                            if (is_cheked[field_idx, idx] == false &&
                                m_SkillIDs[field_idx, idx] == skill_id &&
                                m_SkillCasters[field_idx, idx] == caster_idx
                                )
                            {
                                is_cheked[field_idx, idx] = true;
                                is_exsit = true;
                                break;
                            }
                        }

                        if (is_exsit == false)
                        {
                            m_WorkAppearSkillInfos[appear_skill_count].m_SkillID    = skill_id;
                            m_WorkAppearSkillInfos[appear_skill_count].m_FieldIndex = field_idx;
                            m_WorkAppearSkillInfos[appear_skill_count].m_Caster     = caster_idx;
                            appear_skill_count++;
                        }
                    }
                }
            }

            for (int field_idx = 0; field_idx < m_FieldAreaCount; field_idx++)
            {
                m_SkillCounts[field_idx] = 0;
            }

            skill_info_count = Mathf.Min(skill_info_count, skill_infos.Length);
            for (int idx = 0; idx < skill_info_count; idx++)
            {
                BattleSkillReq battle_skill_req = skill_infos[idx];
                if (battle_skill_req != null && battle_skill_req.m_SkillReqState != BattleSkillReq.State.NONE && battle_skill_req.m_SkillParamSkillID != 0)
                {
                    int field_idx = battle_skill_req.m_SkillParamFieldNum;

                    int skill_idx = m_SkillCounts[field_idx];
                    if (skill_idx < m_SkillCountMax)
                    {
                        m_SkillIDs[field_idx, skill_idx]     = battle_skill_req.m_SkillParamSkillID;
                        m_SkillCasters[field_idx, skill_idx] = battle_skill_req.m_SkillParamCharaNum;
                        m_SkillCounts[field_idx]++;
                    }
                }
            }

            if (appear_skill_count > 0)
            {
                SEID seID;

                switch (m_ComboSoundIndex)
                {
                case 0: seID = SEID.SE_SKILL_COMBO_00; break;

                case 1: seID = SEID.SE_SKILL_COMBO_01; break;

                case 2: seID = SEID.SE_SKILL_COMBO_02; break;

                case 3: seID = SEID.SE_SKILL_COMBO_03; break;

                case 4: seID = SEID.SE_SKILL_COMBO_04; break;

                case 5: seID = SEID.SE_SKILL_COMBO_05; break;

                case 6: seID = SEID.SE_SKILL_COMBO_06; break;

                case 7: seID = SEID.SE_SKILL_COMBO_07; break;

                case 8: seID = SEID.SE_SKILL_COMBO_08; break;

                default: seID = SEID.SE_SKILL_COMBO_MORE_THAN_08; break;
                }
                SoundUtil.PlaySE(seID);

                m_ComboSoundIndex++;
            }

            if (appear_skill_count > 0)
            {
                clearNewSkillElementInfo();

                for (int idx = 0; idx < appear_skill_count; idx++)
                {
                    int field_idx = m_WorkAppearSkillInfos[idx].m_FieldIndex;
                    GlobalDefine.PartyCharaIndex caster_idx = m_WorkAppearSkillInfos[idx].m_Caster;
                    if (caster_idx == GlobalDefine.PartyCharaIndex.GENERAL)
                    {
                        caster_idx = BattleParam.m_PlayerParty.getGeneralPartyMember();
                    }

                    if (m_NewSkillElements[field_idx, (int)caster_idx] == MasterDataDefineLabel.ElementType.NONE)
                    {
                        MasterDataSkillActive master_data_skill_active = BattleParam.m_MasterDataCache.useSkillActive(m_WorkAppearSkillInfos[idx].m_SkillID);
                        if (master_data_skill_active != null)
                        {
                            m_NewSkillElements[field_idx, (int)caster_idx] = master_data_skill_active.skill_element;
                        }
                    }
                }

                ret_val = m_WorkAppearSkillInfos[0].m_FieldIndex;
            }
        }

        return(ret_val);
    }