예제 #1
0
        /// <summary>
        /// Keeps the combat bot around the engineer
        /// </summary>
        public Vector3 steerForFollowOwner(InfantryVehicle vehicle)
        {
            Vector3 wanderSteer  = vehicle.SteerForWander(1.3f);
            Vector3 pursuitSteer = vehicle.SteerForPursuit(_creator._baseVehicle.Abstract, 0.2f);

            return((wanderSteer * 0.75f) + pursuitSteer);
        }
예제 #2
0
        /// <summary>
        /// Keeps the combat bot around the engineer
        /// Change to keeping him around the HQ
        /// </summary>
        public Vector3 steerForFollowOwner(InfantryVehicle vehicle)
        {
            Vector3 wanderSteer  = vehicle.SteerForWander(0.5f);
            Vector3 pursuitSteer = vehicle.SteerForPursuit(_nextRet.Abstract, 0.2f);

            return((wanderSteer * 1.6f) + pursuitSteer);
        }
예제 #3
0
파일: Troop.cs 프로젝트: klyed/Zone-Assets
        /// <summary>
        /// Moves the AI on a persuit course towards the player, while keeping seperated from other AI
        /// </summary>
        public Vector3 steerForAttack(InfantryVehicle vehicle)
        {
            if (target == null)
            {
                return(Vector3.Zero);
            }

            List <Vehicle> soldiers = _arena.getVehiclesInRange(vehicle.state.positionX, vehicle.state.positionY, 500,
                                                                delegate(Vehicle v)
                                                                { return(v is Troop); });
            IEnumerable <IVehicle> soldierbots = soldiers.ConvertAll <IVehicle>(
                delegate(Vehicle v)
            {
                return((v as Troop).Abstract);
            }
                );

            Vector3 cohesionSteer   = vehicle.SteerForCohesion(_seperation, 0.07f, soldierbots.ToList());
            Vector3 seperationSteer = vehicle.SteerForSeparation(_seperation, -1.707f, soldierbots);
            Vector3 pursuitSteer    = vehicle.SteerForPursuit(target._baseVehicle.Abstract, 0.2f);

            _bStrafe = true;

            return((seperationSteer * 1.3f) + pursuitSteer);
        }
예제 #4
0
        /// <summary>
        /// Keeps the combat bot around the engineer
        /// </summary>
        public Vector3 steerForFollowLeader(InfantryVehicle vehicle)
        {
            if (target == null)
            {
                return(Vector3.Zero);
            }

            LvlInfo level = _arena._server._assets.Level;


            List <LvlInfo.Tile> tiles = Helpers.calcBresenhems(_arena, _state.positionX, _state.positionY, target._state.positionX, target._state.positionY);

            for (int i = 0; i <= tiles.Count - 1; i++)
            {
                int   phy  = tiles[i].Physics;
                short low  = level.PhysicsLow[phy];
                short high = level.PhysicsHigh[phy];

                _arena.sendArenaMessage(String.Format("Height: {0} Physic: {1}", high, tiles[i].Physics));
            }


            Vector3 pursuitSteer = vehicle.SteerForPursuit(target._baseVehicle.Abstract, 0.2f);

            return(pursuitSteer);
        }
예제 #5
0
        /// <summary>
        /// Keeps the combat bot around the engineer
        /// Change to keeping him around the HQ
        /// </summary>
        public Vector3 steerForFollowOwner(InfantryVehicle vehicle)
        {
            // Vector3 wanderSteer = vehicle.SteerForWander(0.5f);
            Vector3 pursuitSteer = vehicle.SteerForPursuit(_home.Abstract, 0.2f);

            //return (wanderSteer * 1.6f) + pursuitSteer;
            return(pursuitSteer);
        }
예제 #6
0
파일: Troop.cs 프로젝트: klyed/Zone-Assets
        /// <summary>
        /// Keeps the combat bot around the engineer
        /// </summary>
        public Vector3 steerForFollowOwner(InfantryVehicle vehicle)
        {
            if (_creator == null)
            {
                return(Vector3.Zero);
            }

            Vector3 wanderSteer  = vehicle.SteerForWander(0.5f);
            Vector3 pursuitSteer = vehicle.SteerForPursuit(_creator._baseVehicle.Abstract, 0.2f);

            return((wanderSteer * 1.6f) + pursuitSteer);
        }
예제 #7
0
        /// <summary>
        /// Keeps the combat bot around the engineer
        /// </summary>
        public Vector3 steerForFollowOwner(InfantryVehicle vehicle)
        {
            if (_target == null)
            {
                return(Vector3.Zero);
            }

            Vector3 wanderSteer  = vehicle.SteerForWander(1.3f);
            Vector3 pursuitSteer = vehicle.SteerForPursuit(_target._baseVehicle.Abstract, 0.2f);

            return((wanderSteer * 0.75f) + pursuitSteer);
        }
예제 #8
0
        /// <summary>
        /// Keeps the bot around a specific player
        /// </summary>
        public Vector3 strafeForCombat(InfantryVehicle vehicle)
        {
            if (_target == null)
            {
                return(Vector3.Zero);
            }

            Vector3 wanderSteer  = vehicle.SteerForWander(0.5f);
            Vector3 pursuitSteer = vehicle.SteerForPursuit(_leader._baseVehicle.Abstract, 0.2f);

            return((wanderSteer * 1.6f) + pursuitSteer);
        }
예제 #9
0
        /// <summary>
        /// Moves the bot on a persuit course towards the player, while keeping seperated from otherbots
        /// </summary>
        public Vector3 steerForPersuePlayer(InfantryVehicle vehicle)
        {
            List <Vehicle> bots = _arena.getVehiclesInRange(vehicle.state.positionX, vehicle.state.positionY, 400,
                                                            delegate(Vehicle v)
                                                            { return(v is Bot); });
            IEnumerable <IVehicle> gbots = bots.ConvertAll <IVehicle>(
                delegate(Vehicle v)
            {
                return((v as Bot).Abstract);
            }
                );

            Vector3 seperationSteer = vehicle.SteerForSeparation(_seperation, -0.707f, gbots);
            Vector3 pursuitSteer    = vehicle.SteerForPursuit(targetEnemy._baseVehicle.Abstract, 0.2f);

            return((seperationSteer * 0.6f) + pursuitSteer);
        }
예제 #10
0
        /// <summary>
        /// Keeps the combat bot around the engineer
        /// Change to keeping him around the HQ
        /// </summary>
        public Vector3 steerForFollowOwner(InfantryVehicle vehicle)
        {
            List <Vehicle> bots = _arena.getVehiclesInRange(vehicle.state.positionX, vehicle.state.positionY, 400,
                                                            delegate(Vehicle v)
                                                            { return(v is Bot); });
            IEnumerable <IVehicle> gbots = bots.ConvertAll <IVehicle>(
                delegate(Vehicle v)
            {
                return((v as Bot).Abstract);
            }
                );

            Vector3 seperationSteer = vehicle.SteerForSeparation(50f, -0.707f, gbots);
            //Vector3 seperationSteer = vehicle.SteerForAlignment(100f, -0.707f, gbots);
            // Vector3 wanderSteer = vehicle.SteerForWander(0.5f);
            Vector3 pursuitSteer = vehicle.SteerForPursuit(_targetVehicle.Abstract, 0.2f);

            return((seperationSteer * 0.6f) + pursuitSteer);
        }
예제 #11
0
        /// <summary>
        /// Moves the zombie on a persuit course towards the player, while keeping seperated from other zombies
        /// </summary>
        public Vector3 steerForPersuePlayer(InfantryVehicle vehicle)
        {
            if (victim == null)
            {
                return(Vector3.Zero);
            }

            List <Vehicle> zombies = _arena.getVehiclesInRange(vehicle.state.positionX, vehicle.state.positionY, 400,
                                                               delegate(Vehicle v)
                                                               { return(v is ZombieBot); });
            IEnumerable <IVehicle> zombiebots = zombies.ConvertAll <IVehicle>(
                delegate(Vehicle v)
            {
                return((v as ZombieBot).Abstract);
            }
                );

            Vector3 seperationSteer = vehicle.SteerForSeparation(_seperation, -0.707f, zombiebots);
            Vector3 pursuitSteer    = vehicle.SteerForPursuit(victim._baseVehicle.Abstract, 0.2f);

            return((seperationSteer * 0.6f) + pursuitSteer);
        }
예제 #12
0
        /// <summary>
        /// Moves the medic on a persuit course towards the player, while keeping seperated from other medics
        /// </summary>
        public Vector3 steerForPersuePlayer(InfantryVehicle vehicle)
        {
            if (_target == null)
            {
                return(Vector3.Zero);
            }

            List <Vehicle> medics = _arena.getVehiclesInRange(vehicle.state.positionX, vehicle.state.positionY, 150,
                                                              delegate(Vehicle v)
                                                              { return(v is Medic); });
            IEnumerable <IVehicle> medicbots = medics.ConvertAll <IVehicle>(
                delegate(Vehicle v)
            {
                return((v as Medic).Abstract);
            }
                );

            Vector3 seperationSteer = vehicle.SteerForSeparation(_seperation, -0.307f, medicbots);
            Vector3 pursuitSteer    = vehicle.SteerForPursuit(_target._baseVehicle.Abstract, 0.2f);

            return((seperationSteer * 0.3f) + pursuitSteer);
        }
예제 #13
0
        /// <summary>
        /// Moves the medic on a persuit course towards the player, while keeping seperated from other medics
        /// </summary>
        public Vector3 steerForPersuePlayer(InfantryVehicle vehicle)
        {
            if (targetEnemy == null)
            {
                return(Vector3.Zero);
            }

            List <Vehicle> dropships = _arena.getVehiclesInRange(vehicle.state.positionX, vehicle.state.positionY, 500,
                                                                 delegate(Vehicle v)
                                                                 { return(v is Dropship); });
            IEnumerable <IVehicle> dropshipbots = dropships.ConvertAll <IVehicle>(
                delegate(Vehicle v)
            {
                return((v as Dropship).Abstract);
            }
                );

            Vector3 seperationSteer = vehicle.SteerForSeparation(_seperation, -0.707f, dropshipbots);
            Vector3 pursuitSteer    = vehicle.SteerForPursuit(targetEnemy.Abstract, 0.2f);

            return((seperationSteer * 1.3f) + pursuitSteer);
        }
예제 #14
0
        public Vector3 steerForSeekBot(InfantryVehicle vehicle)
        {
            Vector3 pursuitSteer = vehicle.SteerForPursuit(_botTarget.Abstract, 0.2f);

            return(pursuitSteer);
        }
예제 #15
0
        /// <summary>
        /// Keeps the combat bot around the engineer
        /// Change to keeping him around the HQ
        /// </summary>
        public Vector3 steerForFollowOwner(InfantryVehicle vehicle)
        {
            Vector3 pursuitSteer = vehicle.SteerForPursuit(_targetLocation.Abstract, 0.2f);

            return(pursuitSteer);
        }