Exemplo n.º 1
0
        public static Npc CreateNpc(FigureInfo info, Level level, int x, int y)
        {
            Npc npc = null;

            //Level level = LevelManager.GetCurrentLevel();
            //if (info.IsEnemy)
            {
                Texture2D tex = null;
                TileHelper.GetTileTexture(0, ref tex);
                var pathFromAggressiveEnemy =
                    new PathToPlayer(Global.Player, level.Map, tex);
                pathFromAggressiveEnemy.CreateFrom(x, y);

                npc = new Npc(level.Map, level, pathFromAggressiveEnemy)
                {
                    X      = x,
                    Y      = y,
                    Sprite = UIState._selectedTexture,
                    Damage = Dice.Parse("d3"),
                };

                npc.Info = info;

                if (npc.Info.IsMerchant)
                {
                    npc.Info.Inventory = new List <int>();
                    npc.Info.Inventory.Add(2569);
                    npc.Info.Inventory.Add(2569);
                    npc.Info.Inventory.Add(2569);
                }
                //level.AddNpc(npc);
            }
            //else
            //{
            //}

            return(npc);
        }
Exemplo n.º 2
0
 public static void AddNpcType(FigureInfo info)
 {
     _templates.Add(info);
 }