Esempio n. 1
0
        private void TxtFilter_TextChanged(object sender, EventArgs e)
        {
            var filteredMobs = Mobs.Where(x => x.InxName.ToLower().Contains(txtFilter.Text.ToLower())).ToList();

            lbMobs.DataSource    = filteredMobs;
            lbMobs.DisplayMember = "InxName";
        }
Esempio n. 2
0
        private void MenuAddGroupToAll_Click(object sender, EventArgs e)
        {
            var frm = new frmAddToAll();

            CheckDropGroup(frm);
            foreach (var mob in Mobs.Where(x => x.MobLevel >= frm.MinLevel && x.MobLevel <= frm.MaxLevel))
            {
                var entry = new MobDropGroupEntry(Groups.FirstOrDefault(x => x.Index == frm.GroupName), 100, 0, 0);
                entry.DropRate = frm.DropRate;
                mob.DropGroups.Add(entry);
            }

            LoadMobGroupView();
        }
Esempio n. 3
0
        /// <summary>
        /// Проверяет мобов за финишем. Живой моб отнимает одну жизнь.
        /// Если жизней не осталось, игра заканчивается поражением.
        /// </summary>
        private void CheckFinishedMobs()
        {
            Mobs.Where(mob => mob.transform.position.x < levelScript.finishX)
            .ForEach(mob =>
            {
                var hp = mob.GetComponent <MobHP>();
                if (hp.curHP > 0)
                {
                    FinishedMobs++;
                }

                GameObject.Destroy(mob);
            });

            if (Lives == 0)
            {
                State = Scripts.GameState.Lost;
            }
        }
Esempio n. 4
0
        public void SpawnMobs()
        {
            switch (PortalType)
            {
            case PortalType.Undead:
            {
                UndeadPortal();
                break;
            }

            case PortalType.Beetle:
            {
                BeetlePortal();
                break;
            }

            case PortalType.Demon:
            {
                DemonPortal();
                break;
            }

            case PortalType.Wyrm:
            {
                WyrmPortal();
                break;
            }

            case PortalType.Lummox:
            {
                LummoxPortal();
                break;
            }

            case PortalType.Minotaur:
            {
                MinotaurPortal();
                break;
            }
            }

            Region r = Region.Regions.Find(x => x.Name == RegionName);

            if (r == null)
            {
                Console.WriteLine("NO REGION FOUND");
                return;
            }

            if (ValidSpawnPoints == null || ValidSpawnPoints.Count == 0)
            {
                ValidSpawnPoints = GenerateSpawnLocations(r);
            }
            foreach (Mobile mob in Mobs.Where(mob => mob.Map == Map.Internal))
            {
                mob.MoveToWorld(ValidSpawnPoints.GetRandom(), DungeonMap);
            }
            if (PortalType == PortalType.Wyrm && Utility.RandomDouble() <= 0.05)
            {
                var mob = new ChromaticDragonPortal {
                    Portal = this
                };
                mob.MoveToWorld(ValidSpawnPoints.GetRandom(), DungeonMap);
            }
        }
Esempio n. 5
0
 public IEnumerable <Mob> MobsInTeam(TeamColor color)
 {
     return(Mobs.Where(mob => mob.Team == color));
 }
        public static string GetMobDesc(int id)
        {
            var data = Mobs.Where(x => x.ID == id).ToList();

            return(data.Count > 0 ? data.First().Desc : "No description");
        }
        public static string GetMobName(int id)
        {
            var data = Mobs.Where(x => x.ID == id).ToList();

            return(data.Count > 0 ? data.First().Name : "Unknown");
        }