Ejemplo n.º 1
0
 public RageLevelXPopupText()
 {
     Background = new ImageGraphic
     {
         Texture = new TextureFromFile("Interface/IngameInterface/RageLevel1.png")
         {
             DontScale = true
         },
         Position = new Vector3(0, -57, 0)
     };
     Clickable  = false;
     Overflow   = global::Graphics.TextOverflow.Ignore;
     Anchor     = global::Graphics.Orientation.Bottom;
     Position   = new Vector2(0, 10);
     TextAnchor = global::Graphics.Orientation.Center;
     Size       = new Vector2(646, 415);
     Font       = new Graphics.Content.Font
     {
         Backdrop   = System.Drawing.Color.Transparent,
         Color      = System.Drawing.Color.FromArgb(255, 0xff, 0x5d, 0x0e),
         SystemFont = Fonts.HugeSystemFont
     };
     DisplayTime = 3;
     Updateable  = true;
 }
Ejemplo n.º 2
0
 public WarningPopupText()
 {
     Background = null;
     Clickable  = false;
     Overflow   = global::Graphics.TextOverflow.Ignore;
     Anchor     = global::Graphics.Orientation.Top;
     TextAnchor = global::Graphics.Orientation.Center;
     AutoSize   = AutoSizeMode.Full;
     Font       = new Graphics.Content.Font
     {
         Backdrop   = System.Drawing.Color.Black,
         Color      = System.Drawing.Color.Red,
         SystemFont = Fonts.HugeSystemFont
     };
     yInterpolator.Value = 200;
     Common.InterpolatorKey <float> k;
     yInterpolator.AddKey(k = new Common.InterpolatorKey <float>
     {
         Time     = 1,
         TimeType = Common.InterpolatorKeyTimeType.Relative,
         Value    = 100
     });
     k.Passing += new EventHandler(k_Passing);
     Position   = new Vector2(0, yInterpolator.Value);
     Updateable = true;
 }
Ejemplo n.º 3
0
 public ScrollingCombatText()
 {
     Background = null;
     Clickable = false;
     Timeout = 1;
     Overflow = global::Graphics.TextOverflow.Ignore;
     Size = new Vector2(100, 10);
     ScrollSpeed = 80;
     Font = new Graphics.Content.Font
     {
         Backdrop = System.Drawing.Color.Black,
         Color = System.Drawing.Color.Red,
         SystemFont = Fonts.DefaultSystemFont
     };
     Updateable = true;
 }
Ejemplo n.º 4
0
 public SubtitleText()
 {
     Background = null;
     Clickable  = false;
     Overflow   = global::Graphics.TextOverflow.Ignore;
     Anchor     = global::Graphics.Orientation.Bottom;
     TextAnchor = global::Graphics.Orientation.Center;
     AutoSize   = AutoSizeMode.Full;
     Font       = new Graphics.Content.Font
     {
         Backdrop   = System.Drawing.Color.FromArgb(100, 0, 0, 0),
         Color      = System.Drawing.Color.White,
         SystemFont = Fonts.HugeSystemFont
     };
     Position = new Vector2(0, 200);
 }
Ejemplo n.º 5
0
 public SpeachBubble()
 {
     Background = InterfaceScene.DefaultFormBorder;
     Clickable  = false;
     Overflow   = global::Graphics.TextOverflow.Ignore;
     Anchor     = global::Graphics.Orientation.Bottom;
     TextAnchor = global::Graphics.Orientation.TopLeft;
     Size       = new Vector2(900, 140); //old value y = 115
     Font       = new Graphics.Content.Font
     {
         Backdrop   = System.Drawing.Color.FromArgb(100, 0, 0, 0),
         Color      = System.Drawing.Color.White,
         SystemFont = Fonts.LargeSystemFont
     };
     Position = new Vector2(0, 200);
 }
Ejemplo n.º 6
0
 public ScrollingCombatText()
 {
     Background  = null;
     Clickable   = false;
     Timeout     = 1;
     Overflow    = global::Graphics.TextOverflow.Ignore;
     Size        = new Vector2(100, 10);
     ScrollSpeed = 80;
     Font        = new Graphics.Content.Font
     {
         Backdrop   = System.Drawing.Color.Black,
         Color      = System.Drawing.Color.Red,
         SystemFont = Fonts.DefaultSystemFont
     };
     Updateable = true;
 }
Ejemplo n.º 7
0
 public StageStartText()
 {
     Background = null;
     Clickable  = false;
     Overflow   = global::Graphics.TextOverflow.Ignore;
     Anchor     = global::Graphics.Orientation.Center;
     TextAnchor = global::Graphics.Orientation.Center;
     AutoSize   = AutoSizeMode.Full;
     Font       = new Graphics.Content.Font
     {
         Backdrop   = System.Drawing.Color.Transparent,
         Color      = System.Drawing.Color.White,
         SystemFont = Fonts.HugeSystemFont
     };
     DisplayTime = 1;
     Updateable  = true;
 }
Ejemplo n.º 8
0
        public BossIntroUnderText()
        {
            Background = null;
            Clickable  = false;
            Overflow   = global::Graphics.TextOverflow.Ignore;
            Anchor     = global::Graphics.Orientation.Center;
            TextAnchor = global::Graphics.Orientation.Center;
            Position   = new Vector2(0, 220);
            AutoSize   = AutoSizeMode.Full;
            Font       = new Graphics.Content.Font
            {
                Backdrop   = System.Drawing.Color.FromArgb(126, 0, 0, 0),
                Color      = System.Drawing.Color.FromArgb(255, 249, 246, 154),
                SystemFont = Fonts.HugeSystemFont
            };

            Updateable = true;
        }
Ejemplo n.º 9
0
        public BossIntroText()
        {
            Background = null;
            Clickable = false;
            Overflow = global::Graphics.TextOverflow.Ignore;
            Anchor = global::Graphics.Orientation.Center;
            TextAnchor = global::Graphics.Orientation.Center;
            Position = new Vector2(0, 135);
            AutoSize = AutoSizeMode.Full;
            Font = new Graphics.Content.Font
            {
                Backdrop = System.Drawing.Color.FromArgb(126, 0, 0, 0),
                Color = System.Drawing.Color.FromArgb(255, 249, 246, 154),
                SystemFont = Fonts.BossSystemFont
            };

            Updateable = true;
        }
Ejemplo n.º 10
0
        public WarningFlashText()
        {
            Background = null;
            Clickable  = false;
            Overflow   = global::Graphics.TextOverflow.Ignore;
            Anchor     = global::Graphics.Orientation.Bottom;
            TextAnchor = global::Graphics.Orientation.Center;
            AutoSize   = AutoSizeMode.Full;
            Font       = new Graphics.Content.Font
            {
                Backdrop   = System.Drawing.Color.Black,
                Color      = System.Drawing.Color.Red,
                SystemFont = Fonts.HugeSystemFont
            };
            aInterpolator.Value = 1;
            float period = 0.6f;

            aInterpolator.AddKey(new Common.InterpolatorKey <float>
            {
                Time     = period / 2f,
                Period   = period,
                Repeat   = true,
                TimeType = Common.InterpolatorKeyTimeType.Relative,
                Value    = 0
            });
            aInterpolator.AddKey(new Common.InterpolatorKey <float>
            {
                Time     = period,
                Period   = period,
                Repeat   = true,
                TimeType = Common.InterpolatorKeyTimeType.Relative,
                Value    = 1
            });
            Position   = new Vector2(0, 300);
            Updateable = true;
        }
Ejemplo n.º 11
0
 public TimeLeftPopupText()
 {
     Background = null;
     Clickable = false;
     Overflow = global::Graphics.TextOverflow.Ignore;
     Anchor = global::Graphics.Orientation.Center;
     TextAnchor = global::Graphics.Orientation.Center;
     AutoSize = AutoSizeMode.Full;
     Font = new Graphics.Content.Font
     {
         Backdrop = System.Drawing.Color.Transparent,
         Color = System.Drawing.Color.Yellow,
         SystemFont = Fonts.HugeSystemFont
     };
     DisplayTime = 1;
     Updateable = true;
 }
Ejemplo n.º 12
0
 public WarningFlashText()
 {
     Background = null;
     Clickable = false;
     Overflow = global::Graphics.TextOverflow.Ignore;
     Anchor = global::Graphics.Orientation.Bottom;
     TextAnchor = global::Graphics.Orientation.Center;
     AutoSize = AutoSizeMode.Full;
     Font = new Graphics.Content.Font
     {
         Backdrop = System.Drawing.Color.Black,
         Color = System.Drawing.Color.Red,
         SystemFont = Fonts.HugeSystemFont
     };
     aInterpolator.Value = 1;
     float period = 0.6f;
     aInterpolator.AddKey(new Common.InterpolatorKey<float>
     {
         Time = period / 2f,
         Period = period,
         Repeat = true,
         TimeType = Common.InterpolatorKeyTimeType.Relative,
         Value = 0
     });
     aInterpolator.AddKey(new Common.InterpolatorKey<float>
     {
         Time = period,
         Period = period,
         Repeat = true,
         TimeType = Common.InterpolatorKeyTimeType.Relative,
         Value = 1
     });
     Position = new Vector2(0, 300);
     Updateable = true;
 }
Ejemplo n.º 13
0
        /// <returns>Actual damage amount</returns>
        public int Hit(Unit striker, int damage, AttackType attackType, Script script)
        {
            if (!CanBeDestroyed)
            {
                return(0);
            }
            //Console.WriteLine(striker + " strikes " + this.GetType().Name + " for " + damage + " damage");

            PlayHitEffect();
            int adjustedDamage = CalculateHitDamage(striker, damage, attackType);
            int actualDamage   = Math.Min(HitPoints, adjustedDamage);

            DamageLastFrame += adjustedDamage;

#if DEBUG
            if (this is Units.MainCharacter && Program.Settings.GodMode)
            {
                actualDamage = 0;
            }
#endif
            HitPoints -= actualDamage;
            if (Program.Settings.DisplayScrollingCombatText &&
                (striker is Units.MainCharacter || this is Units.MainCharacter))
            {
                if (currentScrollingCombatText == null)
                {
                    currentScrollingCombatText = new Interface.ScrollingCombatText
                    {
                        WorldPosition = Translation + Vector3.UnitZ * 1
                    };
                    Game.Instance.Interface.AddChild(currentScrollingCombatText);
                }
                currentScrollingCombatText.Text = DamageLastFrame.ToString();
                var font           = new Graphics.Content.Font();
                int damageCategory = Common.Math.Clamp(DamageLastFrame / 70, 0, 4);
                //var fontSize = 8 + 6 * damageCategory;
                //currentScrollingCombatText.Font.SystemFont = new System.Drawing.Font(Fonts.DefaultFontFamily, fontSize);
                // 8, 14, 20, 26, 32
                if (damageCategory == 0)
                {
                    font.SystemFont = Fonts.DefaultSystemFont;
                }
                else if (damageCategory == 1)
                {
                    font.SystemFont = Fonts.DefaultSystemFont;
                }
                else if (damageCategory == 2)
                {
                    font.SystemFont = Fonts.MediumSystemFont;
                }
                else if (damageCategory == 3)
                {
                    font.SystemFont = Fonts.LargeSystemFont;
                }
                else if (damageCategory == 4)
                {
                    font.SystemFont = Fonts.HugeSystemFont;
                }


                var alpha = Common.Math.Clamp(50 + damageCategory * 70, 50, 255);
                if (striker is Units.MainCharacter)
                {
                    font.Color = System.Drawing.Color.White;
                }
                else
                {
                    font.Color = System.Drawing.Color.Red;
                }
                currentScrollingCombatText.TextGraphic.Alpha = alpha / 255f;
                font.Backdrop = System.Drawing.Color.Transparent;
                currentScrollingCombatText.Font = font;
            }
            var de = new DamageEventArgs
            {
                Performer      = striker,
                Target         = this,
                Damage         = damage,
                AdjustedDamage = adjustedDamage,
                ActualDamage   = actualDamage,
                AttackType     = attackType
            };
            OnTakesDamage(de);
            if (HitPoints <= 0)
            {
                HitPoints = 0;
                Kill(striker, script);
            }
            if (striker != null)
            {
                striker.OnGivesDamage(de);
            }
            return(actualDamage);
        }
Ejemplo n.º 14
0
 public SubtitleText()
 {
     Background = null;
     Clickable = false;
     Overflow = global::Graphics.TextOverflow.Ignore;
     Anchor = global::Graphics.Orientation.Bottom;
     TextAnchor = global::Graphics.Orientation.Center;
     AutoSize = AutoSizeMode.Full;
     Font = new Graphics.Content.Font
     {
         Backdrop = System.Drawing.Color.FromArgb(100, 0, 0, 0),
         Color = System.Drawing.Color.White,
         SystemFont = Fonts.HugeSystemFont
     };
     Position = new Vector2(0, 200);
 }
Ejemplo n.º 15
0
 public SpeachBubble()
 {
     Background = InterfaceScene.DefaultFormBorder;
     Clickable = false;
     Overflow = global::Graphics.TextOverflow.Ignore;
     Anchor = global::Graphics.Orientation.Bottom;
     TextAnchor = global::Graphics.Orientation.TopLeft;
     Size = new Vector2(900, 140); //old value y = 115
     Font = new Graphics.Content.Font
     {
         Backdrop = System.Drawing.Color.FromArgb(100, 0, 0, 0),
         Color = System.Drawing.Color.White,
         SystemFont = Fonts.LargeSystemFont
     };
     Position = new Vector2(0, 200);
 }
Ejemplo n.º 16
0
 public SilverYieldPopup()
 {
     Background = null;
     Clickable = false;
     Overflow = global::Graphics.TextOverflow.Ignore;
     Anchor = global::Graphics.Orientation.Top;
     Position = new Vector2(0, 300);
     TextAnchor = global::Graphics.Orientation.Center;
     AutoSize = AutoSizeMode.Full;
     Font = new Graphics.Content.Font
     {
         Backdrop = System.Drawing.Color.Transparent,
         Color = System.Drawing.Color.White,
         SystemFont = Fonts.HugeSystemFont
     };
     DisplayTime = 1;
     Updateable = true;
 }
Ejemplo n.º 17
0
 public RageLevelXPopupText()
 {
     Background = new ImageGraphic
     {
         Texture = new TextureFromFile("Interface/IngameInterface/RageLevel1.png") { DontScale = true },
         Position = new Vector3(0, -57, 0)
     };
     Clickable = false;
     Overflow = global::Graphics.TextOverflow.Ignore;
     Anchor = global::Graphics.Orientation.Bottom;
     Position = new Vector2(0, 10);
     TextAnchor = global::Graphics.Orientation.Center;
     Size = new Vector2(646, 415);
     Font = new Graphics.Content.Font
     {
         Backdrop = System.Drawing.Color.Transparent,
         Color = System.Drawing.Color.FromArgb(255, 0xff, 0x5d, 0x0e),
         SystemFont = Fonts.HugeSystemFont
     };
     DisplayTime = 3;
     Updateable = true;
 }
Ejemplo n.º 18
0
 public WarningPopupText()
 {
     Background = null;
     Clickable = false;
     Overflow = global::Graphics.TextOverflow.Ignore;
     Anchor = global::Graphics.Orientation.Top;
     TextAnchor = global::Graphics.Orientation.Center;
     AutoSize = AutoSizeMode.Full;
     Font = new Graphics.Content.Font
     {
         Backdrop = System.Drawing.Color.Black,
         Color = System.Drawing.Color.Red,
         SystemFont = Fonts.HugeSystemFont
     };
     yInterpolator.Value = 200;
     Common.InterpolatorKey<float> k;
     yInterpolator.AddKey(k = new Common.InterpolatorKey<float>
     {
         Time = 1,
         TimeType = Common.InterpolatorKeyTimeType.Relative,
         Value = 100
     });
     k.Passing += new EventHandler(k_Passing);
     Position = new Vector2(0, yInterpolator.Value);
     Updateable = true;
 }