상속: Occupier
예제 #1
0
 internal static void Add(Mob mb)
 {
     MappedMob mm = new MappedMob(mb.Name, mb.Id, mb.Room.Id, mb.Level, mb.Rage);
     if (!mMobs.Contains(mm) && !mSubmitted.Contains(mm))
     {
         mMobs.Add(mm);
     }
 }
예제 #2
0
파일: Room.cs 프로젝트: yprovost/outwar-dca
 private static void AttackMob(Mob mb)
 {
     mb.Attack(false);
 }
예제 #3
0
 private static void AttackMob(Mob mb)
 {
     mb.Attack(false);
 }
예제 #4
0
파일: Room.cs 프로젝트: yprovost/outwar-dca
        internal void EnumMobs(string src)
        {
            // TODO this should really just throw an exception
            if (string.IsNullOrEmpty(src))
            {
                Load();
            }
            Mobs = new List <Mob>();


            foreach (string s in Parser.MultiParse(src, "images//", "spacer.gif"))
            {
                Parser p = new Parser(s);

                string url = "mob.php?" + p.Parse("mob.php?", "\"");
                string name;
                string attackurl = string.Empty;
                bool   trainer   = false;
                bool   quest     = false;
                bool   spawn     = false;

                if (s.Contains("Spawned by"))
                {
                    name = string.Format("*{0}*", p.Parse("\">*", " ["));
                    if (name.Contains("<"))
                    {
                        // TODO this is a bandaid fix re: a bug with the parser.  It will pick up html from killed spawn mobs
                        continue;
                    }
                    spawn = true;
                    // log spawn sighting, but don't attack it if we shouldn't
                    if (Globals.AttackOn)
                    {
                        CoreUI.Instance.SpawnsPanel.Log(string.Format("{0} sighted {1} in room {2}", Mover.Account.Name, name, Id));
                        CoreUI.Instance.SpawnsPanel.Sighted(Id);
                        if (!CoreUI.Instance.Settings.AttackSpawns)
                        {
                            continue;
                        }
                    }
                }
                else
                {
                    name = Parser.Parse(Parser.CutLeading(s, url + "\">"), "\">", " [");
                }

                if (s.Contains("newattack.php"))
                {
                    attackurl = "newattack.php" + p.Parse("newattack.php", "\"");
                }
                else
                {
                    continue;
                }

                if (s.Contains("talk_icon.jpg"))
                {
                    quest = true;
                }
                if (s.Contains("dc_trainer.gif"))
                {
                    trainer = true;
                }

                /*
                 * if (string.IsNullOrEmpty(attackurl) && !quest && !trainer)
                 * {
                 *  continue;
                 * }*/

                Mob mb = new Mob(name, url, attackurl, quest, trainer, spawn, this);
                Mobs.Add(mb);
            }
        }
예제 #5
0
        internal void EnumMobs(string src)
        {
            // TODO this should really just throw an exception
            if (string.IsNullOrEmpty(src))
            {
                Load();
            }
            Mobs = new List<Mob>();

            //foreach (string s in Parser.MultiParse(src, "<table ", "</table>"))
            foreach(string s in src.Split(new string[] { "<table "}, StringSplitOptions.RemoveEmptyEntries))
            {
                Parser p = new Parser(s);

                string url = "mob.php?" + p.Parse("mob.php?", "\"");
                string name;
                string attackurl = string.Empty;
                bool trainer = false;
                bool quest = false;
                bool spawn = false;

                if (s.Contains("Spawned by"))
                {
                    name = string.Format("*{0}*", p.Parse("\">*", " ["));
                    if (name.Contains("<"))
                    {
                        // TODO this is a bandaid fix re: a bug with the parser.  It will pick up html from killed spawn mobs
                        continue;
                    }
                    spawn = true;
                    // log spawn sighting, but don't attack it if we shouldn't
                    if (Globals.AttackOn)
                    {
                        CoreUI.Instance.SpawnsPanel.Log(string.Format("{0} sighted {1} in room {2}", Mover.Account.Name, name, Id));
                        CoreUI.Instance.SpawnsPanel.Sighted(Id);
                        if (!CoreUI.Instance.Settings.AttackSpawns)
                            continue;
                    }
                }
                else
                {
                    //name = Parser.Parse(Parser.CutLeading(s, url + "\">"), "\">", " [");
                    name = Parser.Parse(s, "><b>", "</b>"); // "'<b>Spawned By:</b>" occurs, use ><b> for starting
                }

                if (s.Contains("somethingelse.php"))
                {
                    attackurl = "somethingelse.php" + p.Parse("somethingelse.php", "\"");
                }
                else
                {
                    continue;
                }

                if (s.Contains("talk_icon.jpg"))
                {
                    quest = true;
                }
                if (s.Contains("dc_trainer.gif"))
                {
                    trainer = true;
                }

                /*
                if (string.IsNullOrEmpty(attackurl) && !quest && !trainer)
                {
                    continue;
                }*/

                Mob mb = new Mob(name, url, attackurl, quest, trainer, spawn, this);
                Mobs.Add(mb);
            }
        }