Exemple #1
0
    // Update is called once per frame
    void Update()
    {
        if (m_BattleCard != null)
        {
            if (m_BattleCard.getPhase() == BattleScene.BattleCard.Phase.UNUSED)
            {
                m_ElementType = MasterDataDefineLabel.ElementType.NONE;
                m_IsOn        = false;
            }

            if (m_BattleCard.getElementType() != m_ElementType ||
                m_BattleCard.m_IsOn != m_IsOn
                )
            {
                _updateSprite();
            }

#if BUILD_TYPE_DEBUG
            if (m_BattleCard.getPhase() != BattleScene.BattleCard.Phase.UNUSED)
            {
                // 開発中はエラーであることをわかりやすくするための表示
                if (m_ElementType <= MasterDataDefineLabel.ElementType.NONE || m_ElementType >= MasterDataDefineLabel.ElementType.MAX)
                {
                    m_SpriteRenderer.enabled = true;
                    m_SpriteRenderer.sprite  = m_SpritesOff[RandManager.GetRand(1, 7)];
                }
            }
#endif
        }

        // カード配りアニメーション
        if (m_AnimWait > 0.0f)
        {
            const float ANIM_TIME = 0.1f;
            m_AnimWait -= Time.deltaTime;
            if (m_AnimWait > ANIM_TIME)
            {
                m_SpriteRenderer.enabled = false;
                transform.localPosition  = Vector3.zero;
                transform.localRotation  = Quaternion.Euler(new Vector3(0.0f, 90.0f, 0.0f));
            }
            else
            if (m_AnimWait > 0.0f)
            {
                m_SpriteRenderer.enabled = true;
                transform.localPosition  = new Vector3(0.0f, 0.0f, -1.0f * (1.0f - m_AnimWait / ANIM_TIME));
                transform.localRotation  = Quaternion.Euler(new Vector3(0.0f, 90.0f * (m_AnimWait / ANIM_TIME), 0.0f));
            }
            else
            {
                m_AnimWait = 0.0f;
                m_SpriteRenderer.enabled = true;
                transform.localPosition  = Vector3.zero;
                transform.localRotation  = Quaternion.Euler(new Vector3(0.0f, 0.0f, 0.0f));
            }
        }

        m_MyTween.update(Time.deltaTime);
    }
Exemple #2
0
        /// <summary>
        /// 手札エリアのカードを手に持つ
        /// </summary>
        /// <param name=""></param>
        public void catchHandAreaCard(int hand_area_touch_index)
        {
            BattleCard battle_card = m_HandArea.getCard(hand_area_touch_index);

            if (battle_card != null)
            {
                if (m_InHandArea.getCardCount() > 0)
                {
                    BattleCard in_hand_card = m_InHandArea.getCard(0);
                    if (battle_card.getElementType() != in_hand_card.getElementType())
                    {
                        battle_card = null;
                    }
                    else
                    {
                        int step = (hand_area_touch_index > in_hand_card.m_HandCardIndex) ? 1 : -1;
                        for (int idx = in_hand_card.m_HandCardIndex; idx != hand_area_touch_index; idx += step)
                        {
                            BattleCard temp_battle_card = m_HandArea.getCard(idx + step);
                            if (temp_battle_card != null && temp_battle_card.getElementType() != in_hand_card.getElementType())
                            {
                                battle_card = null;
                                break;
                            }
                        }
                    }
                }

                if (battle_card != null)
                {
                    setCardToInHand(battle_card);
                }
            }
        }
Exemple #3
0
 // 属性別のカード枚数を取得
 public int[] getCostPerElenet()
 {
     for (int idx = 0; idx < m_CostPerElement.Length; idx++)
     {
         m_CostPerElement[idx] = 0;
     }
     for (int idx = 0; idx < m_CardCount; idx++)
     {
         BattleCard battle_card = m_BattleCards[idx];
         m_CostPerElement[(int)battle_card.getElementType()]++;
     }
     return(m_CostPerElement);
 }
Exemple #4
0
    //----------------------------------------------------------------------------

    /*!
     *  @brief		手札変換:属性指定
     *  @param[in]	BattleSkillActivity		(activity)		スキル発動情報
     */
    //----------------------------------------------------------------------------
    public void ChangeHandElement(BattleSkillActivity activity)
    {
        //------------------------------
        //	エラーチェック
        //------------------------------
        if (activity == null ||
            BattleParam.isActiveBattle() == false)
        {
            return;
        }

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


        // 汎用パラメータから設定(属性ラベル定義順)
        MasterDataDefineLabel.ElementType[] elemArray = activity.Get_BOOSTSKILL_HAND_CNG_ELEM();


        MasterDataDefineLabel.ElementType cardElement;          // 手札の属性用

        //----------------------------------------
        //	手札をすべてチェック
        //----------------------------------------
        for (int i = 0; i < battleMgr.PRIVATE_FIELD.m_BattleCardManager.m_HandArea.getCardMaxCount(); ++i)
        {
            BattleScene.BattleCard battle_card = battleMgr.PRIVATE_FIELD.m_BattleCardManager.m_HandArea.getCard(i);

            if (battle_card == null)
            {
                continue;
            }


            // 手札の属性を取得
            cardElement = battle_card.getElementType();
            if (elemArray[(int)cardElement] == MasterDataDefineLabel.ElementType.MAX)
            {
                continue;
            }

            // 変換先が設定されている場合
            if (elemArray[(int)cardElement] != MasterDataDefineLabel.ElementType.NONE)
            {
                // 属性変更
                battle_card.setElementType(elemArray[(int)cardElement], 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);
            }
        }
    }