Example #1
0
    /// <summary>
    /// 「もどる」ボタン押されたときの処理
    /// </summary>
    public void PressedBackButton()
    {
        switch (this.currentSituation)
        {
        case E_BattleSituation.PlayerSelectActiveSkill:
        case E_BattleSituation.PlayerSelectActiveItem:
            this.currentSituation = E_BattleSituation.PlayerSelectAction;
            ShowPlayerActionSelect();
            break;

        case E_BattleSituation.PlayerSelectSkillTarget:
            this.waitingEffect = null;
            if (inputTargetWaiting)     //味方1人対象選択中
            {
                this.uiManager.SetActiveAllyTargetButtons(false);
                this.inputTargetWaiting = false;
            }
            this.currentSituation = E_BattleSituation.PlayerSelectActiveSkill;
            ShowActiveSkillSelect(charaList[nextActionIndex]);
            break;

        case E_BattleSituation.PlayerSelectItemTarget:
            this.waitingEffect = null;
            if (inputTargetWaiting)     //味方1人対象選択中
            {
                this.uiManager.SetActiveAllyTargetButtons(false);
                this.inputTargetWaiting = false;
            }
            this.currentSituation = E_BattleSituation.PlayerSelectActiveItem;
            ShowActiveItemSelect();
            break;
        }
    }
Example #2
0
 /// <summary>
 /// プレイヤーの行動選択のテキスト出力
 /// </summary>
 private void ShowPlayerActionSelect()
 {
     ShowAnnounce(charaList[nextActionIndex].CharaClass.CharaName + "のばん");
     ShowAnnounce((int)E_PlayerAction.NormalAttack + ":通常攻撃 " + (int)E_PlayerAction.InvokeSkill + ":スキル " + (int)E_PlayerAction.UseItem + ":アイテム " + (int)E_PlayerAction.Defend + ":防御");
     this.currentSituation = E_BattleSituation.PlayerSelectAction;
     this.finishAction     = false;
 }
Example #3
0
 /// <summary>
 /// 4つの行動(通常攻撃、スキル、アイテム、防御)からプレイヤーの入力で分岐する
 /// </summary>
 private void InputPlayerAction()
 {
     if (Input.GetKeyDown(((int)E_PlayerAction.NormalAttack).ToString()))
     {
         if (charaList[nextActionIndex].NormalAttackToAllTurn > 0)
         {
             NormalAttack(charaList[nextActionIndex], GetAliveList(this.enemyList));
         }
         else if (GetAttractingCharacter(this.charaList[nextActionIndex].Element, this.enemyList) == null)
         {
             NormalAttack(charaList[nextActionIndex], target);
         }
         else
         {
             NormalAttack(charaList[nextActionIndex], GetAttractingCharacter(this.charaList[nextActionIndex].Element, this.enemyList));
         }
     }
     if (Input.GetKeyDown(((int)E_PlayerAction.InvokeSkill).ToString()))
     {
         this.currentSituation = E_BattleSituation.PlayerSelectActiveSkill;
         ShowActiveSkillSelect(charaList[nextActionIndex]);
     }
     if (Input.GetKeyDown(((int)E_PlayerAction.UseItem).ToString()))
     {
         this.currentSituation = E_BattleSituation.PlayerSelectActiveItem;
         ShowActiveItemSelect();
     }
     if (Input.GetKeyDown(((int)E_PlayerAction.Defend).ToString()))
     {
         Defend(charaList[nextActionIndex]);
     }
 }
Example #4
0
    private void Start()
    {
        this.uiManager.SetInit(this.allyList.Count, this.enemyList.Count);
        charaNum = charaList.Count;

        /*
         * foreach(BattleCharacter bc in charaList)
         * {
         *  if(!bc.StatusChange) bc.Start(); //BattleCharacterのStartが終了していないとき、呼ぶ
         *  if (bc.IsEnemy) this.enemyList.Add(bc);
         *  else this.allyList.Add(bc);
         * }*/

        this.target           = this.GetAliveList(this.enemyList)[0];
        this.currentSituation = E_BattleSituation.SetParameterBeforeStartBattle;
        SetPassiveEffect();

        foreach (BattleCharacter bc in this.allyList)
        {
            bc.Hp = bc.MaxHp;
        }
        this.currentSituation = E_BattleSituation.WaitFinishAction;
    }
Example #5
0
    /// <summary>
    /// ActiveEffect(skill or item)の発動、ターン経過
    /// </summary>
    /// <param name="invoker">Effect発動者</param>
    /// <param name="effect">発動するActiveEffect</param>
    private void InvokeEffect(BattleCharacter invoker, BattleActiveEffect effect)
    {
        switch (effect.TargetType)
        {
        case E_TargetType.All:
            this.activeEffectFuncs.EffectFunc(effect, invoker, charaList);
            break;

        case E_TargetType.OneEnemy:
            if (invoker.IsEnemy)
            {
                if (GetAttractingCharacter(effect.EffectElement, this.allyList) == null)
                {
                    this.activeEffectFuncs.EffectFunc(effect, invoker, new List <BattleCharacter>()
                    {
                        ListManager.GetRandomIndex <BattleCharacter>(GetAliveList(this.allyList))
                    });
                }
                else
                {
                    this.activeEffectFuncs.EffectFunc(effect, invoker, new List <BattleCharacter>()
                    {
                        GetAttractingCharacter(effect.EffectElement, this.allyList)
                    });
                }
            }
            else
            {
                if (GetAttractingCharacter(effect.EffectElement, this.enemyList) == null)
                {
                    this.activeEffectFuncs.EffectFunc(effect, invoker, new List <BattleCharacter>()
                    {
                        target
                    });
                }
                else
                {
                    this.activeEffectFuncs.EffectFunc(effect, invoker, new List <BattleCharacter>()
                    {
                        GetAttractingCharacter(effect.EffectElement, this.enemyList)
                    });
                }
            }
            break;

        case E_TargetType.AllAlly:
            if (invoker.IsEnemy)
            {
                this.activeEffectFuncs.EffectFunc(effect, invoker, this.enemyList);
            }
            else
            {
                this.activeEffectFuncs.EffectFunc(effect, invoker, allyList);
            }
            break;

        case E_TargetType.AllEnemy:
            if (invoker.IsEnemy)
            {
                this.activeEffectFuncs.EffectFunc(effect, invoker, this.allyList);
            }
            else
            {
                this.activeEffectFuncs.EffectFunc(effect, invoker, enemyList);
            }
            break;

        case E_TargetType.Self:
            this.activeEffectFuncs.EffectFunc(effect, invoker, new List <BattleCharacter>()
            {
                invoker
            });
            break;

        case E_TargetType.OneAlly:
            if (invoker.IsEnemy)
            {
                this.activeEffectFuncs.EffectFunc(effect, invoker, new List <BattleCharacter>()
                {
                    ListManager.GetRandomIndex <BattleCharacter>(GetAliveList(this.enemyList))
                });
            }
            else
            {
                //プレイヤー入力によるtargetの指定処理
                if (this.target.IsEnemy)
                {
                    this.inputTargetWaiting = true;
                    if (this.currentSituation == E_BattleSituation.PlayerSelectActiveSkill)
                    {
                        this.currentSituation = E_BattleSituation.PlayerSelectSkillTarget;
                    }
                    else if (this.currentSituation == E_BattleSituation.PlayerSelectActiveItem)
                    {
                        this.currentSituation = E_BattleSituation.PlayerSelectItemTarget;
                    }
                    this.uiManager.PromptSelectTargetOneAlly();
                    return;
                }
                this.activeEffectFuncs.EffectFunc(effect, invoker, new List <BattleCharacter>()
                {
                    this.target
                });
            }
            break;
        }
        AdvanceTurn();
    }