Ejemplo n.º 1
0
    public IProcessState Update(BattleManager mgr)
    {
        AllEventManager eventMgr = AllEventManager.GetInstance();
        AllSceneManager sceneMgr = AllSceneManager.GetInstance();

        //交換されていたら
        if (PlayerBattleData.GetInstance().changeMonsterActive_)
        {
            //フェードイン
            eventMgr.EventSpriteRendererSet(
                sceneMgr.GetPublicFrontScreen().GetEventScreenSprite()
                , null
                , new Color(sceneMgr.GetPublicFrontScreen().GetEventScreenSprite().GetSpriteRenderer().color.r, sceneMgr.GetPublicFrontScreen().GetEventScreenSprite().GetSpriteRenderer().color.g, sceneMgr.GetPublicFrontScreen().GetEventScreenSprite().GetSpriteRenderer().color.b, 0)
                );
            eventMgr.EventSpriteRenderersUpdateExecuteSet(EventSpriteRendererEventManagerExecute.ChangeColor);
            eventMgr.AllUpdateEventExecute(0.4f);

            //交換イベント
            PlayerBattleData.GetInstance().MonsterChangeEventSet(mgr);

            //イベントの最後
            eventMgr.EventFinishSet();

            PlayerBattleData.GetInstance().changeMonsterActive_ = false;
        }

        if (AllEventManager.GetInstance().EventUpdate() &&
            PlayerBattleData.GetInstance().GetMonsterDatas(0).battleActive_)
        {
            //ウィンドウの非表示
            mgr.GetNovelWindowParts().gameObject.SetActive(false);

            mgr.GetPlayerStatusInfoParts().ProcessIdleStart();
            mgr.GetPlayerMonsterParts().ProcessIdleStart();
            mgr.ActiveUiStartCommand();
            sceneMgr.inputProvider_ = new KeyBoardNormalTriggerInputProvider();

            //攻撃技の反映
            mgr.GetAttackCommandParts().MonsterDataReflect(PlayerBattleData.GetInstance().GetMonsterDatas(0), EnemyBattleData.GetInstance().GetMonsterDatas(0));

            return(mgr.nowProcessState().NextProcess());
        }

        return(this);
    }
    public IProcessState Update(BattleManager mgr)
    {
        AllEventManager eventMgr = AllEventManager.GetInstance();
        AllSceneManager sceneMgr = AllSceneManager.GetInstance();

        //敵の思考時間の処理
        EnemyBattleData.GetInstance().ThinkingTimeCounter();

        //モンスターが交換されていたら
        if (PlayerBattleData.GetInstance().changeMonsterActive_)
        {
            executeProvider_.state_ = BattleSceneStartCommandExecuteState.Attack;

            mgr.ActiveUiStartCommand();
            mgr.InactiveUiStartCommand();

            //フェードイン
            eventMgr.EventSpriteRendererSet(
                sceneMgr.GetPublicFrontScreen().GetEventScreenSprite()
                , null
                , new Color(sceneMgr.GetPublicFrontScreen().GetEventScreenSprite().GetSpriteRenderer().color.r, sceneMgr.GetPublicFrontScreen().GetEventScreenSprite().GetSpriteRenderer().color.g, sceneMgr.GetPublicFrontScreen().GetEventScreenSprite().GetSpriteRenderer().color.b, 0)
                );
            eventMgr.EventSpriteRenderersUpdateExecuteSet(EventSpriteRendererEventManagerExecute.ChangeColor);
            eventMgr.AllUpdateEventExecute(0.4f);

            eventMgr.UpdateGameObjectSet(mgr.GetStartCommandParts().GetEventGameObject());
            eventMgr.UpdateGameObjectsActiveSetExecute(true);

            //dpが100以上だったら
            //if (PlayerBattleData.GetInstance().GetDreamPoint() >= 100) {
            //	eventMgr.EventTextSet(mgr.GetNovelWindowParts().GetNovelWindowEventText()
            //		, "ゆめたちが \n"
            //		+ "きょうめいしている・・・");
            //	eventMgr.EventTextsUpdateExecuteSet(EventTextEventManagerExecute.CharaUpdate);
            //	eventMgr.AllUpdateEventExecute();
            //}
            //else {
            //	eventMgr.EventTextSet(mgr.GetNovelWindowParts().GetNovelWindowEventText(), PlayerBattleData.GetInstance().GetMonsterDatas(0).uniqueName_ + "は どうする?");
            //	eventMgr.EventTextsUpdateExecuteSet(EventTextEventManagerExecute.CharaUpdate);
            //	eventMgr.AllUpdateEventExecute();
            //}

            eventMgr.EventStatusInfoPartsSet(mgr.GetPlayerStatusInfoParts(), new Color32(0, 0, 0, 0));
            eventMgr.StatusInfoPartsUpdateExecuteSet(StatusInfoPartsEventManagerExecute.IdleMoveStart);
            eventMgr.AllUpdateEventExecute();

            //イベントの最後
            eventMgr.EventFinishSet();

            PlayerBattleData.GetInstance().changeMonsterActive_ = false;
        }

        //やけどのダメージ処理
        if (mgr.BurnsDamageProcess(PlayerBattleData.GetInstance(), mgr.GetPlayerStatusInfoParts(), mgr.GetPlayerMonsterParts()))
        {
            return(new CommandEventExecuteProcess());
        }

        if (EnemyBattleData.GetInstance().GetThinkingEnd() == false)
        {
            //やけどのダメージ処理
            if (mgr.BurnsDamageProcess(EnemyBattleData.GetInstance(), mgr.GetEnemyStatusInfoParts(), mgr.GetEnemyMonsterParts()))
            {
                return(new CommandEventExecuteProcess());
            }

            if (EnemyBattleData.GetInstance().PoinsonCounter())
            {
                //どくのダメージ処理
                mgr.PoisonDamageProcess(EnemyBattleData.GetInstance(), mgr.GetEnemyStatusInfoParts(), mgr.GetEnemyMonsterParts());
                if (mgr.PoisonDamageDown())
                {
                    return(new CommandEventExecuteProcess());
                }
            }
        }

        if (AllEventManager.GetInstance().EventUpdate())
        {
            sceneMgr.inputProvider_ = new KeyBoardNormalTriggerInputProvider();
        }

        //カーソルが動いていたら
        int commandSelectNumber = mgr.GetStartCommandParts().CommandSelectForNumber(new Vector3(), new Vector3(0, 1.32f, 0));

        if (commandSelectNumber > -1)
        {
            //SE
            mgr.GetInputSoundProvider().UpSelect();

            executeProvider_.state_ = (BattleSceneStartCommandExecuteState)mgr.GetStartCommandParts().SelectNumber() + 1;

            //どくのダメージ処理
            mgr.PoisonDamageProcess(PlayerBattleData.GetInstance(), mgr.GetPlayerStatusInfoParts(), mgr.GetPlayerMonsterParts());
        }
        else if (sceneMgr.inputProvider_.UpSelect())
        {
            //選択肢が動かせたら
            if (mgr.GetStartCommandParts().CommandSelectUp(new Vector3(0, 1.33f, 0)))
            {
                //SE
                mgr.GetInputSoundProvider().UpSelect();

                executeProvider_.state_ = (BattleSceneStartCommandExecuteState)mgr.GetStartCommandParts().SelectNumber() + 1;

                //どくのダメージ処理
                mgr.PoisonDamageProcess(PlayerBattleData.GetInstance(), mgr.GetPlayerStatusInfoParts(), mgr.GetPlayerMonsterParts());
            }
        }
        else if (sceneMgr.inputProvider_.DownSelect())
        {
            //選択肢が動かせたら
            if (mgr.GetStartCommandParts().CommandSelectDown(new Vector3(0, -1.33f, 0)))
            {
                //SE
                mgr.GetInputSoundProvider().DownSelect();

                executeProvider_.state_ = (BattleSceneStartCommandExecuteState)mgr.GetStartCommandParts().SelectNumber() + 1;

                //どくのダメージ処理
                mgr.PoisonDamageProcess(PlayerBattleData.GetInstance(), mgr.GetPlayerStatusInfoParts(), mgr.GetPlayerMonsterParts());
            }
        }
        else if (sceneMgr.inputProvider_.RightSelect())
        {
        }
        else if (sceneMgr.inputProvider_.LeftSelect())
        {
        }
        else if (sceneMgr.inputProvider_.SelectEnter() ||
                 mgr.GetStartCommandParts().MouseLeftButtonTriggerActive())
        {
            return(executeProvider_.Execute(mgr));
        }

        //どくで倒れたら
        if (mgr.PoisonDamageDown())
        {
            return(new CommandEventExecuteProcess());
        }

        return(this);
    }
    public IProcessState Update(BattleManager mgr)
    {
        AllEventManager eventMgr = AllEventManager.GetInstance();
        AllSceneManager sceneMgr = AllSceneManager.GetInstance();

        //敵の思考時間の処理
        EnemyBattleData.GetInstance().ThinkingTimeCounter();

        //やけどのダメージ処理
        if (mgr.BurnsDamageProcess(PlayerBattleData.GetInstance(), mgr.GetPlayerStatusInfoParts(), mgr.GetPlayerMonsterParts()))
        {
            return(new CommandEventExecuteProcess());
        }

        if (EnemyBattleData.GetInstance().GetThinkingEnd() == false)
        {
            //やけどのダメージ処理
            if (mgr.BurnsDamageProcess(EnemyBattleData.GetInstance(), mgr.GetEnemyStatusInfoParts(), mgr.GetEnemyMonsterParts()))
            {
                return(new CommandEventExecuteProcess());
            }

            if (EnemyBattleData.GetInstance().PoinsonCounter())
            {
                //どくのダメージ処理
                mgr.PoisonDamageProcess(EnemyBattleData.GetInstance(), mgr.GetEnemyStatusInfoParts(), mgr.GetEnemyMonsterParts());
                if (mgr.PoisonDamageDown())
                {
                    return(new CommandEventExecuteProcess());
                }
            }
        }

        if (AllEventManager.GetInstance().EventUpdate())
        {
            sceneMgr.inputProvider_ = new KeyBoardNormalTriggerInputProvider();
        }

        //カーソルが動いていたら
        int commandSelectNumber = mgr.GetMonsterTradeSelectCommandParts().CommandSelectForNumber(new Vector3(4.16f, 0, 0), new Vector3());

        if (commandSelectNumber > -1)
        {
            //SE
            mgr.GetInputSoundProvider().UpSelect();

            executeProvider_.state_ = (BattleSceneMonsterTradeSelectCommandExecuteState)mgr.GetMonsterTradeSelectCommandParts().SelectNumber() + 1;

            //どくのダメージ処理
            mgr.PoisonDamageProcess(PlayerBattleData.GetInstance(), mgr.GetPlayerStatusInfoParts(), mgr.GetPlayerMonsterParts());
        }
        else if (sceneMgr.inputProvider_.UpSelect())
        {
        }
        else if (sceneMgr.inputProvider_.DownSelect())
        {
        }
        else if (sceneMgr.inputProvider_.RightSelect())
        {
            //選択肢が動かせたら
            if (mgr.GetMonsterTradeSelectCommandParts().CommandSelectRight(new Vector3(4.16f, 0, 0)))
            {
                //SE
                mgr.GetInputSoundProvider().RightSelect();

                executeProvider_.state_ = (BattleSceneMonsterTradeSelectCommandExecuteState)mgr.GetMonsterTradeSelectCommandParts().SelectNumber() + 1;

                //どくのダメージ処理
                mgr.PoisonDamageProcess(PlayerBattleData.GetInstance(), mgr.GetPlayerStatusInfoParts(), mgr.GetPlayerMonsterParts());
            }
        }
        else if (sceneMgr.inputProvider_.LeftSelect())
        {
            //選択肢が動かせたら
            if (mgr.GetMonsterTradeSelectCommandParts().CommandSelectLeft(new Vector3(-4.16f, 0, 0)))
            {
                //SE
                mgr.GetInputSoundProvider().LeftSelect();

                executeProvider_.state_ = (BattleSceneMonsterTradeSelectCommandExecuteState)mgr.GetMonsterTradeSelectCommandParts().SelectNumber() + 1;

                //どくのダメージ処理
                mgr.PoisonDamageProcess(PlayerBattleData.GetInstance(), mgr.GetPlayerStatusInfoParts(), mgr.GetPlayerMonsterParts());
            }
        }
        else if (sceneMgr.inputProvider_.SelectEnter() ||
                 mgr.GetMonsterTradeSelectCommandParts().MouseLeftButtonTriggerActive())
        {
            return(executeProvider_.Execute(mgr));
        }
        else if (sceneMgr.inputProvider_.SelectBack() ||
                 sceneMgr.inputProvider_.SelectMouseRightTrigger())
        {
            mgr.InactiveUiMonsterTradeSelectCommand();
            mgr.ActiveUiStartCommand();

            return(mgr.nowProcessState().BackProcess());
        }

        //どくで倒れたら
        if (mgr.PoisonDamageDown())
        {
            return(new CommandEventExecuteProcess());
        }

        return(this);
    }