Beispiel #1
0
        public override void DoPickup(Unit unit)
        {
            if (unit.HitPoints >= unit.MaxHitPoints)
            {
                return;
            }

            //Sound and visual effect
            Program.Instance.SoundManager.GetSFX(Client.Sound.SFX.PotionPickup1).Play(new Client.Sound.PlayArgs {
            });
            unit.AddChild(new Client.Game.Map.Effects.RageSac {
                Translation = Vector3.UnitZ * 1.5f
            });

            unit.Heal(null, (int)(HealPerc * unit.MaxHitPoints));

            Interface.ScrollingCombatText s;
            Game.Instance.Interface.AddChild(s = new Interface.ScrollingCombatText
            {
                Text          = "+" + (int)(100 * HealPerc) + "% " + Locale.Resource.GenLCHP,
                WorldPosition = Translation + Vector3.UnitZ * 1
            });
            s.Font.Color = System.Drawing.Color.Green;

            base.DoPickup(unit);
        }
Beispiel #2
0
        protected override void OnUpdate(Graphics.UpdateEventArgs e)
        {
            base.OnUpdate(e);

            if (invalidatedAnimation)
            {
                OnUpdateAnimation();
                invalidatedAnimation = false;
            }

            DamageLastFrame            = 0;
            currentScrollingCombatText = null;
            UpdateHeadOverBar();
        }
Beispiel #3
0
        public override void DoPickup(Unit unit)
        {
            ((Units.MainCharacter)unit).TalismansCollected++;

            Interface.ScrollingCombatText s;
            Game.Instance.Interface.AddChild(s = new Interface.ScrollingCombatText
            {
                Text          = "+1 talisman",
                WorldPosition = Translation + Vector3.UnitZ * 1
            });
            s.Font.Color = System.Drawing.Color.Green;

            base.DoPickup(unit);
        }
        public override void DoPickup(Unit unit)
        {
            unit.PistolAmmo += Ammo;

            Interface.ScrollingCombatText s;
            Game.Instance.Interface.AddChild(s = new Interface.ScrollingCombatText
            {
                Text = "+" + Ammo + Locale.Resource.GenLCBullets,
                WorldPosition = Translation + Vector3.UnitZ * 1
            });
            s.Font.Color = System.Drawing.Color.Green;

            var sm = Program.Instance.SoundManager;
            sm.GetSFX(global::Client.Sound.SFX.AmmoPickup1).Play(new Sound.PlayArgs());

            base.DoPickup(unit);
        }
Beispiel #5
0
        public override void DoPickup(Unit unit)
        {
            unit.PistolAmmo += Ammo;

            Interface.ScrollingCombatText s;
            Game.Instance.Interface.AddChild(s = new Interface.ScrollingCombatText
            {
                Text          = "+" + Ammo + Locale.Resource.GenLCBullets,
                WorldPosition = Translation + Vector3.UnitZ * 1
            });
            s.Font.Color = System.Drawing.Color.Green;

            var sm = Program.Instance.SoundManager;

            sm.GetSFX(global::Client.Sound.SFX.AmmoPickup1).Play(new Sound.PlayArgs());

            base.DoPickup(unit);
        }
Beispiel #6
0
        public override void DoPickup(Unit unit)
        {
            ((Units.MainCharacter)unit).AddRageLevelProgress(Rage);

            //Sound and visual effect
            Program.Instance.SoundManager.GetSFX(Client.Sound.SFX.PotionPickup1).Play(new Client.Sound.PlayArgs {
            });
            unit.AddChild(new Client.Game.Map.Effects.HpSac {
                Translation = Vector3.UnitZ * 1.5f
            });

            Interface.ScrollingCombatText s;
            Game.Instance.Interface.AddChild(s = new Interface.ScrollingCombatText
            {
                Text          = "+" + Rage + " " + Locale.Resource.GenLCRage,
                WorldPosition = Translation + Vector3.UnitZ * 1
            });
            s.Font.Color = System.Drawing.Color.Orange;

            base.DoPickup(unit);
        }
Beispiel #7
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);
        }
        public override void DoPickup(Unit unit)
        {
            ((Units.MainCharacter)unit).TalismansCollected++;

            Interface.ScrollingCombatText s;
            Game.Instance.Interface.AddChild(s = new Interface.ScrollingCombatText
            {
                Text = "+1 talisman",
                WorldPosition = Translation + Vector3.UnitZ * 1
            });
            s.Font.Color = System.Drawing.Color.Green;

            base.DoPickup(unit);
        }
        public override void DoPickup(Unit unit)
        {
            ((Units.MainCharacter)unit).AddRageLevelProgress(Rage);

            //Sound and visual effect
            Program.Instance.SoundManager.GetSFX(Client.Sound.SFX.PotionPickup1).Play(new Client.Sound.PlayArgs { });
            unit.AddChild(new Client.Game.Map.Effects.HpSac { Translation = Vector3.UnitZ * 1.5f });

            Interface.ScrollingCombatText s;
            Game.Instance.Interface.AddChild(s = new Interface.ScrollingCombatText
            {
                Text = "+" + Rage + " " + Locale.Resource.GenLCRage,
                WorldPosition = Translation + Vector3.UnitZ * 1
            });
            s.Font.Color = System.Drawing.Color.Orange;

            base.DoPickup(unit);
        }
        public override void DoPickup(Unit unit)
        {
            if (unit.HitPoints >= unit.MaxHitPoints) return;

            //Sound and visual effect
            Program.Instance.SoundManager.GetSFX(Client.Sound.SFX.PotionPickup1).Play(new Client.Sound.PlayArgs { });
            unit.AddChild(new Client.Game.Map.Effects.RageSac { Translation = Vector3.UnitZ * 1.5f });

            unit.Heal(null, (int)(HealPerc * unit.MaxHitPoints));

            Interface.ScrollingCombatText s;
            Game.Instance.Interface.AddChild(s = new Interface.ScrollingCombatText
            {
                Text = "+" + (int)(100 * HealPerc) + "% " + Locale.Resource.GenLCHP,
                WorldPosition = Translation + Vector3.UnitZ * 1
            });
            s.Font.Color = System.Drawing.Color.Green;

            base.DoPickup(unit);
        }