Exemplo n.º 1
0
        public override AIState recycleState()
        {
            if (ai.CurrentState.CurrentState != state.Dying)
            {
                StateComplete = false;
                AI.AI_Overmind.inDying++;

                if (ai.aiShared.target != null)
                {
                    ai.aiShared.target.AttackerCount = -1;
                    ai.aiShared.target = null;
                }
                else { }
                ai.Ship.resetAttackerCount();
                ai.Ship.Active = false;
                ai.Ship.cleanParticleLists();

                if (explosion == null)
                {
                    explosion = SceneObjectFactory.createExplosion(ai.Ship.Position, ai.Ship.Rotation);
                }
                else { }
                ((GameScene)Space394Game.GameInstance.CurrentScene).removeFighterShip(ai.Ship);
            }
            else { }

            return this;
        }
        public DyingPlayerState(Player _player)
        {
            LogCat.updateValue("PlayerState", "Dying");
            player = _player;
            if (player.PlayerShip != null)
            {
                explosion = SceneObjectFactory.createExplosion(player.PlayerShip.Position, player.PlayerShip.Rotation);
                player.PlayerShip.Active = false;
                player.PlayerShip.MyPlayer = null;
                player.PlayerShip.PlayerControlled = false;
                player.PlayerShip.cleanParticleLists();
                ((GameScene)Space394Game.GameInstance.CurrentScene).removeFighterShip(player.PlayerShip);
            }
            else { }

            //cameraPositionOffset = new Vector3(0, 15, -50);
            //cameraLookAt = new Vector3(0, 0, 1000);
        }