Example #1
0
    //----------------------------------------------------------------------------

    /*!
     *  @brief		手札変換:パネル指定
     */
    //----------------------------------------------------------------------------
    public void ChangeHandPanel(BattleSkillActivity activity)
    {
        //------------------------------
        //	エラーチェック
        //------------------------------
        if (activity == null ||
            BattleParam.isActiveBattle() == false)
        {
            return;
        }

        // バトルマネージャ取得
        BattleSceneManager battleMgr = BattleSceneManager.Instance;


        // 汎用パラメータから設定
        MasterDataDefineLabel.ElementType[] elemArray = activity.Get_BOOSTSKILL_HAND_CNG_PANEL();

        for (int i = 0; i < elemArray.Length; ++i)
        {
            BattleScene.BattleCard battle_card = battleMgr.PRIVATE_FIELD.m_BattleCardManager.m_HandArea.getCard(i);

            if (battle_card == null ||
                elemArray[i] == MasterDataDefineLabel.ElementType.MAX)
            {
                continue;
            }

            // 変換先が設定されている場合
            if (elemArray[i] != MasterDataDefineLabel.ElementType.NONE)
            {
                // 属性変更
                battle_card.setElementType(elemArray[i], BattleScene.BattleCard.ChangeCause.SKILL);

                //	手札変化エフェクト
                BattleSceneManager.Instance.PRIVATE_FIELD.m_BattleCardManager.addEffectInfo(BattleScene._BattleCardManager.EffectInfo.EffectPosition.HAND_CARD_AREA, i, BattleScene._BattleCardManager.EffectInfo.EffectType.CARD_CHANGE);
                // 設定されていない場合は、ランダム変換
            }
            else
            {
                // ランダム属性を取得
                MasterDataDefineLabel.ElementType randElement = (MasterDataDefineLabel.ElementType)RandManager.GetRand((int)MasterDataDefineLabel.ElementType.NAUGHT,
                                                                                                                       (int)MasterDataDefineLabel.ElementType.MAX);

                // 属性変更
                battle_card.setElementType(randElement, BattleScene.BattleCard.ChangeCause.SKILL);

                //	手札変化エフェクト
                BattleSceneManager.Instance.PRIVATE_FIELD.m_BattleCardManager.addEffectInfo(BattleScene._BattleCardManager.EffectInfo.EffectPosition.HAND_CARD_AREA, i, BattleScene._BattleCardManager.EffectInfo.EffectType.CARD_CHANGE);
            }
        }
    }
Example #2
0
        /// <summary>
        /// 手札エリアに新しいカードを配る
        /// </summary>
        /// <param name="hand_area_index"></param>
        /// <param name="element_type"></param>
        public void addNewCardInHandArea(int hand_area_index, MasterDataDefineLabel.ElementType element_type)
        {
            BattleCard battle_card = getUnusedCard();

            if (battle_card != null)
            {
                MasterDataDefineLabel.ElementType wrk_element_type = element_type;
#if BUILD_TYPE_DEBUG
                if (m_DebugNextCardFix[hand_area_index] != MasterDataDefineLabel.ElementType.NONE)
                {
                    wrk_element_type = m_DebugNextCardFix[hand_area_index];
                }
#endif //BUILD_TYPE_DEBUG

                battle_card.setElementType(wrk_element_type, BattleCard.ChangeCause.NEW_CARD);

                if (m_NextArea != null)
                {
                    BattleCard next_card = m_NextArea.getCard(hand_area_index);
                    if (next_card != null)
                    {
                        setCardToHandArea(hand_area_index, next_card);
                    }

                    setCardToNextArea(hand_area_index, battle_card);
                }
                else
                {
                    setCardToHandArea(hand_area_index, battle_card);
                }
            }
        }