예제 #1
0
 private int GetHealthGumpID(MobileFlags flags)
 {
     if (this.m_Mobile.IsPoisoned)
     {
         return(2056);
     }
     return(this.m_Mobile.IsInvulnerable ? 2057 : 2054);
 }
예제 #2
0
 public void OnFlagsChange(MobileFlags flags)
 {
     if (this.m_Mobile.Visible)
     {
         this.m_Name.Hue = Hues.GetNotoriety(this.m_Mobile.Notoriety);
     }
     else
     {
         this.m_Name.Hue = Hues.Grayscale;
     }
 }
예제 #3
0
 public void OnFlagsChange(MobileFlags Flags)
 {
     this.GumpID      = Flags[MobileFlag.Warmode] ? 2055 : 2051;
     this.m_HP.GumpID = this.GetHealthGumpID(Flags);
 }
예제 #4
0
 public void OnFlagsChange(MobileFlags flags)
 {
 }
예제 #5
0
        protected internal override void Draw(int x, int y)
        {
            Renderer.SetTexture((Texture)null);
            Renderer.PushAlpha(0.4f);
            Renderer.SolidRect(0, x + 1, y + 1, this.m_Width - 2, this.m_Height - 2);
            Renderer.PopAlpha();
            Renderer.TransparentRect(0, x, y, this.m_Width, this.m_Height);
            bool flag1 = this.m_Mobile.MaximumStamina > 0;
            bool flag2 = this.m_Mobile.MaximumMana > 0;
            int  num   = 6 + (flag1 ? 6 : 0) + (flag2 ? 6 : 0);

            y += this.m_Height;
            y -= num + 1;
            Renderer.SolidRect(0, x, y, this.m_Width, num + 1);
            ++x;
            ++y;
            int Width1 = this.m_Width - 2;

            if (this.m_Mobile.Ghost || this.m_Mobile.IsDeadPet)
            {
                Renderer.GradientRect(12632256, 6316128, x, y, Width1, 5);
                if (flag1)
                {
                    y += 6;
                    Renderer.GradientRect(12632256, 6316128, x, y, Width1, 5);
                }
                if (!flag2)
                {
                    return;
                }
                y += 6;
                Renderer.GradientRect(12632256, 6316128, x, y, Width1, 5);
            }
            else
            {
                MobileFlags flags = this.m_Mobile.Flags;
                int         Color;
                int         Color2;
                if (this.m_Mobile.IsPoisoned)
                {
                    Color  = 65280;
                    Color2 = 32768;
                }
                else if (flags[MobileFlag.YellowHits])
                {
                    Color  = 16760832;
                    Color2 = 8413184;
                }
                else
                {
                    Color  = 2146559;
                    Color2 = 1073280;
                }
                int Width2 = this.m_Mobile.CurrentHitPoints * Width1 / Math.Max(1, this.m_Mobile.MaximumHitPoints);
                if (Width2 > Width1)
                {
                    Width2 = Width1;
                }
                else if (Width2 < 0)
                {
                    Width2 = 0;
                }
                Renderer.GradientRect(Color, Color2, x, y, Width2, 5);
                Renderer.GradientRect(16711680, 8388608, x + Width2, y, Width1 - Width2, 5);
                if (flag1)
                {
                    y += 6;
                    int Width3 = this.m_Mobile.CurrentMana * Width1 / Math.Max(1, this.m_Mobile.MaximumMana);
                    if (Width3 > Width1)
                    {
                        Width3 = Width1;
                    }
                    else if (Width3 < 0)
                    {
                        Width3 = 0;
                    }
                    Renderer.GradientRect(2146559, 1073280, x, y, Width3, 5);
                    Renderer.GradientRect(16711680, 8388608, x + Width3, y, Width1 - Width3, 5);
                }
                if (!flag2)
                {
                    return;
                }
                y += 6;
                int Width4 = this.m_Mobile.CurrentStamina * Width1 / Math.Max(1, this.m_Mobile.MaximumStamina);
                if (Width4 > Width1)
                {
                    Width4 = Width1;
                }
                else if (Width4 < 0)
                {
                    Width4 = 0;
                }
                Renderer.GradientRect(2146559, 1073280, x, y, Width4, 5);
                Renderer.GradientRect(16711680, 8388608, x + Width4, y, Width1 - Width4, 5);
            }
        }