public override void Update()
        {
            //プレイヤー専用AIなので事前に変換しておく
            Player playerActor = (Player)actor;

            base.Update();

            if (PlessMoveKey() && !(moveAi is MoveAi_PlayerMove))
            {
                moveAi = new MoveAi_PlayerMove(actor, inputState, playerActor.Projecter);
            }

            if (!PlessMoveKey() && !(moveAi is MoveAi_Wait))
            {
                moveAi = new MoveAi_Wait(actor);
            }

            if (attackAi is AttackAi_Wait)
            {
            }
            else
            {
                playerActor.Stop();
            }
            if (inputState.LeftButtonEnter(ButtonState.Pressed) && attackAi is AttackAi_Wait)
            {
                SetAttackAi(new AttackAi_Charge(actor, status.GetAttackSpeed() * 10, 1, 0));
            }
        }
Ejemplo n.º 2
0
        public void NearUpdate(Player player)
        {
            //敵専用AIなので事前に変換しておく
            EnemyBase enemyActor = (EnemyBase)actor;

            #region 索敵範囲
            if (!Confuse())
            {
                if (enemyActor.SearchCheck(player))
                {
                    if (!(moveAi is MoveAi_Chase) && attackAi is AttackAi_Wait)
                    {
                        moveAi = new MoveAi_Chase(actor, player);
                    }
                }
                else
                {
                    if (moveAi is MoveAi_Search)
                    {
                        return;
                    }
                    moveAi = new MoveAi_Search(actor);
                }
            }
            #endregion

            #region 攻撃範囲
            if (enemyActor.AttackCheck(player))
            {
                if (attackAi is AttackAi_Wait)
                {
                    attackAi = new AttackAi_Charge(actor, enemyActor.GetStatus().Attackspd, 1, enemyActor.GetStatus().Attackspd);
                }
                if (moveAi is MoveAi_Chase && !Confuse())
                {
                    moveAi = new MoveAi_Wait(actor);
                }
                if (moveAi is MoveAi_Wait && attackAi is AttackAi_CoolDown && !Confuse())
                {
                    moveAi = new MoveAi_Escape(actor, player);
                }
            }
            else
            {
                if (moveAi is MoveAi_Escape && enemyActor.WaitPointCheck(player) && !Confuse())
                {
                    moveAi = new MoveAi_Wait(actor);
                }
            }
            #endregion
            if (Confuse() && !(moveAi is MoveAi_Search))
            {
                moveAi = new MoveAi_Search(actor);
            }
        }
        public void NearUpdate(Player player)
        {
            //敵専用AIなので事前に変換しておく
            EnemyBase enemyActor = (EnemyBase)actor;

            #region 索敵範囲

            if (enemyActor.SearchCheck(player))
            {
                if ((moveAi is MoveAi_Wait || moveAi is MoveAi_Escape) && attackAi is AttackAi_Wait)
                {
                    moveAi = new MoveAi_Chase(actor, player);
                }
            }
            else
            {
                if (moveAi is MoveAi_Search)
                {
                    return;
                }
                moveAi = new MoveAi_Search(actor);
            }
            #endregion

            #region 索敵範囲内攻撃範囲外

            if (enemyActor.SearchCheck(player) && !enemyActor.AttackCheck(player))
            {
                if (moveAi is MoveAi_Escape)
                {
                    moveAi = new MoveAi_Chase(actor, player);
                }
            }

            #endregion

            #region 攻撃範囲内退避範囲外

            if (enemyActor.AttackCheck(player) && !enemyActor.WaitPointCheck(player))
            {
                if (moveAi is MoveAi_Chase)
                {
                    moveAi = new MoveAi_Wait(actor);
                }

                if (attackAi is AttackAi_Wait)
                {
                    //時間は仮実装
                    attackAi = new AttackAi_Charge(actor, enemyActor.GetStatus().Attackspd, 1, enemyActor.GetStatus().Attackspd);
                }
            }
            #endregion

            #region 逃げる範囲
            if (enemyActor.WaitPointCheck(player))
            {
                if (attackAi is AttackAi_Wait)
                {
                    moveAi   = new MoveAi_Escape(actor, player);
                    attackAi = new AttackAi_Charge(actor, enemyActor.GetStatus().Attackspd, 1, enemyActor.GetStatus().Attackspd);
                }
            }
            #endregion
        }
Ejemplo n.º 4
0
 public override void Initialize(CharacterBase actor)
 {
     base.Initialize(actor);
     moveAi = new MoveAi_Wait(actor);
 }