示例#1
0
        public override void Hit(Character other)
        {
            //ガード節
            if (state != State.Alive)
            {
                return;
            }
            //状態変更
            state = State.Dying;

            //得点の追加
            int score = 0;

            if (ai is BoudAI)
            {
                score = 100;
            }
            else if (ai is RandomAI)
            {
                score = 50;
            }
            else if (ai is AttackAI)
            {
                score = -50;
                mediator.AddScore(score);
                mediator.AddActor(new Enemy(mediator, ai));
                isDeadFlag = true;
                return;
            }

            isDeadFlag = true;
            mediator.AddScore(score);

            //次のAIを決定
            AI nextAI = new BoudAI();//仮想の実装

            switch (rnd.Next(2))
            {
            case 0:
                nextAI = new BoudAI();
                break;

            case 1:
                nextAI = new RandomAI();
                break;
            }
            mediator.AddActor(new Enemy(mediator, nextAI));

            //死亡処理
            // isDeadFlag= true;
            // mediator.AddActor(new BurstEffect(position, mediator));
        }
示例#2
0
        /// <summary>
        /// ヒット通知
        /// </summary>
        /// <param name="other">衝突した相手</param>
        public override void Hit(Character other)
        {
            if (state != State.Alive)
            {
                return;
            }
            state = State.Dying;

            int score = 0;

            if (ai is BoundAI)
            {
                score = 1000;
            }
            else if (ai is RandomAI)
            {
                score = 500;
            }
            else if (ai is TraceAI)
            {
                score = 500;
            }
            else if (ai is AttackAI)
            {
                score = 50;
                mediator.AddScore(score);
                mediator.AddActor(new Enemy(mediator, ai));
                isDeadFlag = true;
                return;
            }

            mediator.AddScore(score);

            AI nextAI = new BoundAI();

            switch (rnd.Next(2))
            {
            case 0:
                nextAI = new BoundAI();
                break;

            case 1:
                nextAI = new RandomAI();
                break;
            }
            mediator.AddActor(new Enemy(mediator, nextAI));

            //isDeadFlag = true;
            //mediator.AddActor(new BurstEffect(position, mediator));

            //sound.PlaySE("gameplayse");
        }