Esempio n. 1
0
        public Spider(Vector2 POSITION, Vector2 FRAMES, int OWNER_ID)
            : base("2d/Units/Mobs/Spider", POSITION, new Vector2(45, 45), FRAMES, OWNER_ID)
        {
            speed = 1.5f;

            health    = 3;
            healthMax = health;

            spawnTimer = new McTimer(8000);
            // 4 seconds to spawn the first egg and 8 seconds to spawn the next
            spawnTimer.AddToTimer(4000);
        }
Esempio n. 2
0
        public virtual void LoadData(XElement DATA)
        {
            if (DATA != null)
            {
                spawnTimer.AddToTimer(Convert.ToInt32(DATA.Element("timerAdd").Value, Globals.culture));

                List <XElement> mobList = (from typeMatch in DATA.Descendants("mob") select typeMatch).ToList <XElement>();

                for (int i = 0; i < mobList.Count; i++)
                {
                    mobChoices.Add(new MobChoice(mobList[i].Value, Convert.ToInt32(mobList[i].Attribute("rate").Value, Globals.culture)));
                }
            }
        }