Esempio n. 1
0
 protected override bool OnMove(gMoveEventArgs e)
 {
     if (base.OnMove(e))
     {
         return true;
     }
     else
     {
         this.Life = 0;
         return false;
     }
 }
Esempio n. 2
0
        protected override bool OnMove(gMoveEventArgs e)
        {
            try
            {
                for (int i = 0; i < this.m_canvas.MapItemsIce.Count; i++)
                {
                    MapItem item = this.m_canvas.MapItemsIce[i];
                    if ((item != null) && (item.Rectangle.Contains(this.m_x + (this.m_width / 2), this.m_y + (this.m_height / 2))))
                    {
                        e.Value += 2;
                    }
                }
            }
            catch
            {
            }

            return base.OnMove(e);
        }
Esempio n. 3
0
        protected override bool OnMove(gMoveEventArgs e)
        {
            try
            {
                for (int i = 0; i < this.m_canvas.MapItemsIce.Count; i++)
                {
                    MapItem item = this.m_canvas.MapItemsIce[i];
                    if ((item != null) && (item.Rectangle.Contains(this.m_x + (this.m_width / 2), this.m_y + (this.m_height / 2))))
                    {
                        e.Value += 2;
                    }
                }

                for (int i = 0; i < this.m_canvas.BonusItems.Count; i++)
                {
                    BonusItem item = this.m_canvas.BonusItems[i];
                    if ((item != null) && (item.Life > 0))
                    {
                        if ((item.Rectangle.Contains(this.m_x, this.m_y))
                            || (item.Rectangle.Contains(this.m_x, this.m_y + this.m_height))
                            || (item.Rectangle.Contains(this.m_x + this.m_width, this.m_y))
                            || (item.Rectangle.Contains(this.m_x + this.m_width, this.m_y + this.m_height))
                            )
                        {
                            this.m_canvas.HitBonus(this, item);
                            break;
                        }
                    }
                }
            }
            catch
            {
            }

            if (this.m_effect.Type == EffectTypes.armor)
            {
                this.m_effect.SetLocation(this);
            }

            return base.OnMove(e);
        }