Example #1
0
    private void setInfoToInteface()
    {
        m_CallCount++;
        if (m_CurrentBattleEnemy != null)
        {
            MasterDataParamChara chara_master = m_CurrentBattleEnemy.getMasterDataParamChara();
            textEnemyName.Value = chara_master.name + "(FixID:" + chara_master.fix_id.ToString() + ")(DrawID:" + chara_master.draw_id.ToString() + ")";
        }

        if (m_CurrentEnemyDispInfo != null)
        {
            m_TogglePos.isOn      = m_CurrentEnemyDispInfo.m_IsUsePosition;
            m_InputFieldPosX.text = (m_CurrentEnemyDispInfo.m_PositionX / 1000.0f).ToString();
            m_InputFieldPosY.text = (m_CurrentEnemyDispInfo.m_PositionY / 1000.0f).ToString();

            m_DropdwonHpType.value = (int)m_CurrentEnemyDispInfo.m_HpGaugeType;
            m_InputFieldHpX.text   = (m_CurrentEnemyDispInfo.m_HpGaugeX / 1000.0f).ToString();
            m_InputFieldHpY.text   = (m_CurrentEnemyDispInfo.m_HpGaugeY / 1000.0f).ToString();

            m_ToggleTgt.isOn      = m_CurrentEnemyDispInfo.m_IsUseTargetPosition;
            m_InputFieldTgtX.text = (m_CurrentEnemyDispInfo.m_TargetX / 1000.0f).ToString();
            m_InputFieldTgtY.text = (m_CurrentEnemyDispInfo.m_TargetY / 1000.0f).ToString();
        }
        m_CallCount--;
    }
Example #2
0
    public static void outputEnemyParty(BattleEnemy[] enemy_party)
    {
        for (int idx_enemy = 0; idx_enemy < enemy_party.Length; idx_enemy++)
        {
            BattleEnemy battle_enemy = enemy_party[idx_enemy];
            DebugBattleLog.writeText(DebugBattleLog.StrOpe + "敵情報(" + idx_enemy.ToString() + ")"
                                     + " EnemyFixID:" + battle_enemy.getMasterDataParamEnemy().fix_id.ToString()
                                     + " CharaFixID:" + battle_enemy.getMasterDataParamChara().fix_id.ToString()
                                     + " 属性:" + battle_enemy.getMasterDataParamChara().element.ToString()
                                     + " 種族1:" + battle_enemy.getMasterDataParamChara().kind.ToString()
                                     + " 種族2:" + battle_enemy.getMasterDataParamChara().sub_kind.ToString()
                                     + " [" + battle_enemy.getMasterDataParamChara().name + "]"
                                     );

            uint[] enemy_abilitys = battle_enemy.getEnemyAbilitys();
            for (int idx_ability = 0; idx_ability < enemy_abilitys.Length; idx_ability++)
            {
                uint ability_fix_id = enemy_abilitys[idx_ability];
                if (ability_fix_id != 0)
                {
                    string ability_name = "";
                    MasterDataEnemyAbility ability_master = BattleParam.m_MasterDataCache.useEnemyAbility(ability_fix_id);
                    if (ability_master != null)
                    {
                        ability_name = ability_master.name;
                    }
                    DebugBattleLog.writeText(DebugBattleLog.StrOpe + "     特性" + (idx_ability + 1).ToString()
                                             + "(FixId:" + ability_fix_id.ToString() + "):"
                                             + ability_name
                                             );
                }
            }

            DebugBattleLog.writeText(DebugBattleLog.StrOpe + "  "
                                     + " HP:" + battle_enemy.m_EnemyHP.ToString() + "/" + battle_enemy.m_EnemyHPMax.ToString()
                                     + " SkillTurn:" + battle_enemy.m_EnemyTurn.ToString() + "/" + battle_enemy.m_EnemyTurnMax.ToString()
                                     );

            // 状態変化
            StatusAilmentChara ailment = battle_enemy.m_StatusAilmentChara;
            outputAilment(ailment);
        }
    }
    public static void cacheBattleUnitTexture()
    {
        if (BattleParam.m_PlayerParty != null)
        {
            CharaOnce[] player_party_members = BattleParam.m_PlayerParty.getPartyMembers(CharaParty.CharaCondition.EXIST);
            for (int idx = 0; idx < player_party_members.Length; idx++)
            {
                CharaOnce player_party_member = player_party_members[idx];
                BattleUnitTextureCache.Instance.loadTexture((int)player_party_member.m_CharaMasterDataParam.fix_id, false);
                if (player_party_member.m_LinkParam != null &&
                    player_party_member.m_LinkParam.m_cCharaMasterDataParam != null
                    )
                {
                    BattleUnitTextureCache.Instance.loadTexture((int)player_party_member.m_LinkParam.m_cCharaMasterDataParam.fix_id, false);
                }
            }
        }

        if (BattleParam.m_EnemyParam != null)
        {
            for (int idx = 0; idx < BattleParam.m_EnemyParam.Length; idx++)
            {
                BattleEnemy battle_enemy = BattleParam.m_EnemyParam[idx];
                if (battle_enemy != null)
                {
                    MasterDataParamChara enemy_chara = battle_enemy.getMasterDataParamChara();
                    if (enemy_chara != null)
                    {
                        BattleUnitTextureCache.Instance.loadTexture((int)enemy_chara.fix_id, false);
                    }
                }
            }
        }

        // 主人公の画像をキャッシュ
        int current_hero_id = (int)MasterDataUtil.GetCurrentHeroID();

        BattleUnitTextureCache.Instance.loadTexture(-current_hero_id, false);
    }
Example #4
0
    void Update()
    {
        //----------------------------------------
        // インスタンスのチェック
        //----------------------------------------
        if (SceneObjReferGameMain.Instance == null)
        {
            return;
        }

        if (m_Window == null ||
            m_WindowPos == null ||
            m_CharaIcon == null
            //		||   m_Collision   == null
            //		||   m_Caption     == null
            //		||   m_Race        == null
            //		||   m_Type        == null
            //		||   m_Week        == null
            //		||   m_Rare        == null
            //		||   m_LabelTarget == null
            )
        {
            return;
        }

        //----------------------------------------
        // ターゲットマークがついている敵なのかチェック
        //----------------------------------------
        bool isTarget = false;

        if (BattleParam.m_TargetEnemyWindow == BattleParam.m_TargetEnemyCurrent)
        {
            isTarget = true;
        }

        //----------------------------------------
        // ターゲットウィンドウに表示する対象が設定されているかチェック
        //----------------------------------------
        if (m_TargetID == InGameDefine.SELECT_NONE)
        {
            //----------------------------------------
            // ターゲットウィンドウを閉じている時の処理
            //----------------------------------------
            m_TargetID = BattleParam.m_TargetEnemyWindow;
            if (m_TargetID != InGameDefine.SELECT_NONE &&
                m_SetUpInfo == false)
            {
                BattleEnemy enemy = BattleParam.m_EnemyParam[m_TargetID];
                if (enemy != null)
                {
                    MasterDataParamChara charaParam = enemy.getMasterDataParamChara();
                    if (charaParam != null)
                    {
                        // 名前
                        Caption = charaParam.name;
                        // 種族
                        Item_race_title = GameTextUtil.GetText("WORD_UNIT_KIND");
                        Item_race       = GameTextUtil.GetKindToText(enemy.getKind(), enemy.getKindSub());
                        // 属性
                        Item_type_title = GameTextUtil.GetText("WORD_UNIT_ELEMENT");
                        Item_type       = GameTextUtil.GetText(GameTextUtil.GetElemToTextKey(charaParam.element));
                        // 弱点
                        Item_week_title = GameTextUtil.GetText("WORD_UNIT_WEEK");
                        MasterDataDefineLabel.ElementType week = InGameUtilBattle.GetElementAffinity(charaParam.element);
                        Item_week = GameTextUtil.GetText(GameTextUtil.GetElemToTextKey(week));
                        // レア
                        Item_rare_title = GameTextUtil.GetText("WORD_RARE_JP");
                        Item_rare       = GameTextUtil.GetText(GameTextUtil.GetRareToTextKey(charaParam.rare));

                        // 状態異常アイコンの設定
                        SetAilmentIcon(enemy);

                        // キャラアイコンの設定
                        UnitIconImageProvider.Instance.Get(
                            charaParam.fix_id,
                            sprite => { Chara_icon = sprite; });
                    }

                    // 特性情報の設定
                    SetAbilityInformation(enemy);

                    // ターゲットボタンの状態を設定
                    SetTargetButton(isTarget);

                    // ウィンドウの有効化
                    UnityUtil.SetObjectEnabledOnce(m_WindowPos, true);

                    m_SetUpInfo = true;

                    // 表示位置へ移動
                    gameObject.transform.localPosition = m_DispPos;

                    m_bTouchReleaseAfterWindowOpen = false;

                    //-----------------------------------------------------
                    // 初期状態:基本情報から開始。
                    //-----------------------------------------------------
                    ChangeState(ESTATE.eSTATE_PAGE_BASIC);
                    return;
                }
            }
        }
        else
        {
            //----------------------------------------
            // ターゲットウィンドウを開いている時の処理
            //----------------------------------------


            //-------------------------------------------------------------
            // 閉じるボタン押下によるウィンドウ閉じる処理。
            //-------------------------------------------------------------
            bool dispChange = false;

            // 閉じる。
            if (dispChange == true)
            {
                //---------------------------------------------------------
                // ページ情報クリアのため、状態解除。
                //---------------------------------------------------------
                ChangeState(ESTATE.eSTATE_NULL);

                UnityUtil.SetUILabelValue(m_AbilityDetailObj[ABILITY_LABEL], "");               // ここでクリアしておかないと、別の敵でスクロールバーの表示判定がうまく機能しない
                m_SetUpInfo = false;
                m_TargetID  = InGameDefine.SELECT_NONE;
                UnityUtil.SetObjectEnabledOnce(m_WindowPos, false);
                UnityUtil.SetObjectEnabledOnce(m_Collision, false);
                UnityUtil.SetObjectEnabledOnce(this.gameObject, false);
                return;
            }


            //-------------------------------------------------------------
            // 状態更新。
            //-------------------------------------------------------------
            switch (m_eState)
            {
            case ESTATE.eSTATE_PAGE_BASIC: State_PageBasicUpdate(); break;

            case ESTATE.eSTATE_PAGE_STATUS: State_PageStatusAilmentUpdate(); break;

            case ESTATE.eSTATE_PAGE_ABILITY: State_PageAbilityUpdate(); break;
            }
        }
    }
Example #5
0
    //----------------------------------------------------------------------------
    //	@brief		状態異常処理
    //----------------------------------------------------------------------------
    public void SkillUpdate_StatusAilment(BattleSkillActivity activity, int nAtk, BattleSceneUtil.MultiInt nHPMax, BattleEnemy[] enemy_param)
    {
        if (activity == null ||
            activity.m_SkillParamTarget == null ||
            activity.m_statusAilment == null)
        {
            return;
        }


        bool clearOnAttack         = true;
        int  statusAilment_data_id = 0;
        MasterDataStatusAilmentParam statusAilmentParam = null;
        BattleSkillTarget            cBattleTarget      = null;
        BattleSceneManager           battleMgr          = BattleSceneManager.Instance;

        if (battleMgr == null)
        {
            return;
        }


        //	発行された状態異常を全て処理する
        for (int j = 0; j < activity.m_statusAilment.Length; j++)
        {
            statusAilment_data_id = activity.m_statusAilment[j];
            if (statusAilment_data_id == 0)
            {
                continue;
            }


            statusAilmentParam = BattleParam.m_MasterDataCache.useAilmentParam((uint)statusAilment_data_id);
            if (statusAilmentParam == null)
            {
                Debug.LogError("statusAilment Param not found.");
                continue;
            }

            //	遅延のスキルは全員の効果がきれるまで再度この効果をかけることが出来ない
            if (statusAilmentParam.category == MasterDataDefineLabel.AilmentType.FEAR)
            {
                for (int k = 0; k < enemy_param.Length; k++)
                {
                    if (enemy_param[k] == null)
                    {
                        continue;
                    }

                    if (enemy_param[k].isDead() == true)
                    {
                        continue;
                    }

                    if (enemy_param[k].getAttackFlag() == true)
                    {
                        continue;
                    }

                    clearOnAttack = false;
                }
            }

            //	誰かがまだ攻撃をしていない
            if (clearOnAttack == false)
            {
                continue;
            }


            //	状態異常に設定されたターゲットをみて処理
            switch (activity.m_statusAilment_target)
            {
            case MasterDataDefineLabel.TargetType.NONE:
            default:
                break;

            case MasterDataDefineLabel.TargetType.FRIEND:
            case MasterDataDefineLabel.TargetType.SELF:
                //----------------------------------------
                //	プレイヤー側状態異常処理
                //----------------------------------------
            {
                GlobalDefine.PartyCharaIndex target_player = GlobalDefine.PartyCharaIndex.MAX;
                BattleParam.m_PlayerParty.m_Ailments.AddStatusAilmentToPlayerParty(target_player, statusAilment_data_id, nAtk, nHPMax);
            }
            break;

            case MasterDataDefineLabel.TargetType.OTHER:
                //----------------------------------------
                //	敵単体(スキル側で指定されたターゲット)
                //----------------------------------------
            {
                bool ailmentAddResult = false;

                for (int i = 0; i < activity.m_SkillParamTarget.Length; i++)
                {
                    cBattleTarget = activity.m_SkillParamTarget[i];
                    if (cBattleTarget == null)
                    {
                        continue;
                    }

                    BattleEnemy enemyParam = enemy_param[cBattleTarget.m_TargetNum];
                    if (enemyParam == null)
                    {
                        continue;
                    }

                    if (enemyParam.isDead() == true)
                    {
                        continue;
                    }


                    // 状態異常処理
                    // @change Developer 2016/02/23 v330 毒[最大HP割合]対応
                    ailmentAddResult = enemyParam.m_StatusAilmentChara.AddStatusAilment(statusAilment_data_id, nAtk, enemyParam.m_EnemyHPMax, enemyParam.getMasterDataParamChara());

                    // NEXTのターンを加算(特殊処理)
                    // 上限数以上の場合、遅延効果が発動しないように修正		@20150512 Developer
                    if (statusAilmentParam.category == MasterDataDefineLabel.AilmentType.FEAR &&
                        ailmentAddResult == true)
                    {
                        int nTurn = (int)RandManager.GetRand((uint)statusAilmentParam.Get_ABSTATE_LATE_TURN_MIN(),
                                                             (uint)statusAilmentParam.Get_ABSTATE_LATE_TURN_MAX());
                        enemyParam.AddTurn(nTurn);
                    }
                }
            }
            break;

            case MasterDataDefineLabel.TargetType.ENEMY:
            case MasterDataDefineLabel.TargetType.ENE_N_1:
            case MasterDataDefineLabel.TargetType.ENE_1N_1:
            case MasterDataDefineLabel.TargetType.ENE_R_N:
            case MasterDataDefineLabel.TargetType.ENE_1_N:
                //----------------------------------------
                //	敵全体
                //----------------------------------------
            {
                BattleEnemy enemyParam       = null;
                bool        ailmentAddResult = false;

                for (int k = 0; k < enemy_param.Length; k++)
                {
                    enemyParam = enemy_param[k];
                    if (enemyParam == null)
                    {
                        continue;
                    }

                    if (enemyParam.isDead() == true)
                    {
                        continue;
                    }


                    // 状態異常処理
                    // @change Developer 2016/02/23 v330 毒[最大HP割合]対応
                    ailmentAddResult = enemyParam.m_StatusAilmentChara.AddStatusAilment(statusAilment_data_id, nAtk, enemyParam.m_EnemyHPMax, enemyParam.getMasterDataParamChara());

                    // NEXTのターンを加算(特殊処理)
                    // 上限数以上の場合、遅延効果が発動しないように修正		@20150512 Developer
                    if (statusAilmentParam.category == MasterDataDefineLabel.AilmentType.FEAR &&
                        ailmentAddResult == true)
                    {
                        int nTurn = (int)RandManager.GetRand((uint)statusAilmentParam.Get_ABSTATE_LATE_TURN_MIN(),
                                                             (uint)statusAilmentParam.Get_ABSTATE_LATE_TURN_MAX());
                        enemyParam.AddTurn(nTurn);
                    }
                }
            }
            break;

            case MasterDataDefineLabel.TargetType.ALL:
                //----------------------------------------
                //	全員
                //----------------------------------------
            {
                //	プレイヤー側状態異常処理
                GlobalDefine.PartyCharaIndex target_player = GlobalDefine.PartyCharaIndex.MAX;
                BattleParam.m_PlayerParty.m_Ailments.AddStatusAilmentToPlayerParty(target_player, statusAilment_data_id, nAtk, nHPMax);

                BattleEnemy enemyParam       = null;
                bool        ailmentAddResult = false;

                //	敵全体
                for (int k = 0; k < enemy_param.Length; k++)
                {
                    enemyParam = enemy_param[k];
                    if (enemyParam == null)
                    {
                        continue;
                    }

                    if (enemyParam.isDead() == true)
                    {
                        continue;
                    }


                    // 状態異常処理
                    // @change Developer 2016/02/23 v330 毒[最大HP割合]対応
                    ailmentAddResult = enemyParam.m_StatusAilmentChara.AddStatusAilment(statusAilment_data_id, nAtk, enemyParam.m_EnemyHPMax, enemyParam.getMasterDataParamChara());

                    // NEXTのターンを加算(特殊処理)
                    // 上限数以上の場合、遅延効果が発動しないように修正		@20150512 Developer
                    if (statusAilmentParam.category == MasterDataDefineLabel.AilmentType.FEAR &&
                        ailmentAddResult == true)
                    {
                        int nTurn = (int)RandManager.GetRand((uint)statusAilmentParam.Get_ABSTATE_LATE_TURN_MIN(),
                                                             (uint)statusAilmentParam.Get_ABSTATE_LATE_TURN_MAX());
                        enemyParam.AddTurn(nTurn);
                    }
                }
            }
            break;
            }
        }
    }