Ejemplo n.º 1
0
        public Minion(
            Game game,
            MinionSpawnType spawnType,
            MinionSpawnPosition position,
            List <Vector2> mainWaypoints,
            uint netId = 0
            ) : base(game, "", new Stats.Stats(), 40, 0, 0, 1100, netId)
        {
            MinionSpawnType  = spawnType;
            SpawnPosition    = position;
            _mainWaypoints   = mainWaypoints;
            _curMainWaypoint = 0;
            _aiPaused        = false;

            var spawnSpecifics = _game.Map.MapGameScript.GetMinionSpawnPosition(SpawnPosition);

            SetTeam(spawnSpecifics.Item1);
            SetPosition(spawnSpecifics.Item2.X, spawnSpecifics.Item2.Y);

            _game.Map.MapGameScript.SetMinionStats(this); // Let the map decide how strong this minion has to be.

            // Set model
            Model = _game.Map.MapGameScript.GetMinionModel(spawnSpecifics.Item1, spawnType);

            // Fix issues induced by having an empty model string
            CollisionRadius = _game.Config.ContentManager.GetCharData(Model).PathfindingCollisionRadius;

            // If we have lane path instructions from the map
            if (mainWaypoints.Count > 0)
            {
                // Follow these instructions
                SetWaypoints(new List <Vector2> {
                    mainWaypoints[0], mainWaypoints[1]
                });
            }
            else
            {
                // Otherwise path to own position. (Stand still)
                SetWaypoints(new List <Vector2> {
                    new Vector2(X, Y), new Vector2(X, Y)
                });
            }

            MoveOrder   = MoveOrder.MOVE_ORDER_ATTACKMOVE;
            Replication = new ReplicationMinion(this);
        }
Ejemplo n.º 2
0
        public Minion(
            Game game,
            IObjAiBase owner,
            float x,
            float y,
            string model,
            string name,
            int visionRadius = 0,
            uint netId       = 0
            ) : base(game, model, new Stats.Stats(), 40, x, y, visionRadius, netId)
        {
            Name = name;

            Owner = owner;

            if (!(Owner == null) && Owner is IChampion)
            {
                SetTeam(Owner.Team);
                IsPet = true;
                if (model == Owner.Model) // Placeholder, should be changed
                {
                    IsClone = true;
                }
            }
            else
            {
                SetTeam(Team);
                IsPet = false;
            }
            IsLaneMinion = false;

            // Fix issues induced by having an empty model string
            CollisionRadius = CharData.PathfindingCollisionRadius;

            SetVisibleByTeam(Team, true);

            MoveOrder = MoveOrder.MOVE_ORDER_MOVE;

            Replication = new ReplicationMinion(this);
        }