Esempio n. 1
0
        public void Morph()
        {
            if (m_TrueForm)
            {
                return;
            }

            m_TrueForm = true;

            Name = "the true Peddrenth";
            BodyValue = 198;
            Hue = 2498;

            Hits = HitsMax;
            Stam = StamMax;
            Mana = ManaMax;

            ProcessDelta();

            Say(1049499); // Behold my ultimate form!

            Map map = Map;

            if (map != null)
            {
                for (int i = 0; i < m_Offsets.Length; i += 2)
                {
                    double rx = m_Offsets[i];
                    double ry = m_Offsets[i + 1];

                    int dist = 0;
                    bool ok = false;
                    int x = 0, y = 0, z = 0;

                    while (!ok && dist < 10)
                    {
                        int rdist = 10 + dist;

                        x = X + (int) (rx * rdist);
                        y = Y + (int) (ry * rdist);
                        z = map.GetAverageZ(x, y);

                        if (!(ok = map.CanFit(x, y, Z, 16, false, false)))
                        {
                            ok = map.CanFit(x, y, z, 16, false, false);
                        }

                        if (dist >= 0)
                        {
                            dist = -(dist + 1);
                        }
                        else
                        {
                            dist = -(dist - 1);
                        }
                    }

                    if (!ok)
                    {
                        continue;
                    }

                    var spawn = new DragonSpirit(this) {Team = Team};

                    spawn.MoveToWorld(new Point3D(x, y, z), map);

                    m_Spirits.Add(spawn);
                }
            }
        }
Esempio n. 2
0
 public DrainTimer(DragonSpirit owner)
     : base(TimeSpan.FromSeconds(5.0), TimeSpan.FromSeconds(5.0))
 {
     m_Owner = owner;
     Priority = TimerPriority.TwoFiftyMS;
 }
Esempio n. 3
0
        public void Morph()
        {
            if (m_TrueForm)
            {
                return;
            }

            m_TrueForm = true;

            Name      = "the true Peddrenth";
            BodyValue = 198;
            Hue       = 2498;

            Hits = HitsMax;
            Stam = StamMax;
            Mana = ManaMax;

            ProcessDelta();

            Say(1049499); // Behold my ultimate form!

            Map map = Map;

            if (map != null)
            {
                for (int i = 0; i < m_Offsets.Length; i += 2)
                {
                    double rx = m_Offsets[i];
                    double ry = m_Offsets[i + 1];

                    int  dist = 0;
                    bool ok = false;
                    int  x = 0, y = 0, z = 0;

                    while (!ok && dist < 10)
                    {
                        int rdist = 10 + dist;

                        x = X + (int)(rx * rdist);
                        y = Y + (int)(ry * rdist);
                        z = map.GetAverageZ(x, y);

                        if (!(ok = map.CanFit(x, y, Z, 16, false, false)))
                        {
                            ok = map.CanFit(x, y, z, 16, false, false);
                        }

                        if (dist >= 0)
                        {
                            dist = -(dist + 1);
                        }
                        else
                        {
                            dist = -(dist - 1);
                        }
                    }

                    if (!ok)
                    {
                        continue;
                    }

                    var spawn = new DragonSpirit(this)
                    {
                        Team = Team
                    };

                    spawn.MoveToWorld(new Point3D(x, y, z), map);

                    m_Spirits.Add(spawn);
                }
            }
        }
Esempio n. 4
0
 public DrainTimer(DragonSpirit owner)
     : base(TimeSpan.FromSeconds(5.0), TimeSpan.FromSeconds(5.0))
 {
     m_Owner  = owner;
     Priority = TimerPriority.TwoFiftyMS;
 }