Beispiel #1
0
    public void Setup()
    {
        //Create the spell
        ISpell someSpell = new Spell(5);

        //Decorate it with fire damage
        FireDecorator fireDecorator = new FireDecorator(20);

        someSpell = fireDecorator.Decorate(someSpell);

        //Decorate some more with ice damage
        IceDecorator iceDecorator = new IceDecorator(10);

        someSpell = iceDecorator.Decorate(someSpell);

        //Cast the decorated spell (dealing 35 damage with effects: Normal, Fire and Ice)
        someSpell.Cast();
    }
        public void PaintTopInGame(ClipState clipState)
        {
            if (Hud.Render.UiHidden)
            {
                return;
            }
            if (clipState != ClipState.BeforeClip)
            {
                return;
            }
            if ((Hud.Game.MapMode == MapMode.WaypointMap) || (Hud.Game.MapMode == MapMode.ActMap))
            {
                return;
            }

            if (!ShowInTown && Hud.Game.IsInTown)
            {
                return;
            }
            if (!ShowOutOfTown && !Hud.Game.IsInTown)
            {
                return;
            }

            var uiRect = Hud.Render.InGameBottomHudUiElement.Rectangle;

            var w = Hud.Window.Size.Height * 0.017f;
            var h = Hud.Window.Size.Height * 0.014f;

            var x = uiRect.Left + uiRect.Width * 0.09f;
            var y = uiRect.Bottom - h - (Hud.Window.Size.Height / 600);

            EliteDecorator.Paint(x + w * 0, y, w, h, HorizontalAlign.Center);
            PhysicalDecorator.Paint(x + w * 1, y, w, h, HorizontalAlign.Center);
            FireDecorator.Paint(x + w * 2, y, w, h, HorizontalAlign.Center);
            LightningDecorator.Paint(x + w * 3, y, w, h, HorizontalAlign.Center);
            ColdDecorator.Paint(x + w * 4, y, w, h, HorizontalAlign.Center);
            PoisonDecorator.Paint(x + w * 5, y, w, h, HorizontalAlign.Center);
            ArcaneDecorator.Paint(x + w * 6, y, w, h, HorizontalAlign.Center);
            HolyDecorator.Paint(x + w * 7, y, w, h, HorizontalAlign.Center);
        }
Beispiel #3
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (Hud.Render.UiHidden)
            {
                return;
            }
            if (clipState != ClipState.BeforeClip)
            {
                return;
            }

            if (!ShowInTown && Hud.Game.IsInTown)
            {
                return;
            }
            if (!ShowOutOfTown && !Hud.Game.IsInTown)
            {
                return;
            }

            var uiRect = Hud.Render.GetUiElement("Root.NormalLayer.game_dialog_backgroundScreenPC.game_window_hud_overlay").Rectangle;

            var w = Hud.Window.Size.Height * 0.017f;
            var h = Hud.Window.Size.Height * 0.014f;

            var x = uiRect.Left + uiRect.Width * 0.09f;
            var y = uiRect.Bottom - h - (Hud.Window.Size.Height / 600);

            EliteDecorator.Paint(x + w * 0, y, w, h, HorizontalAlign.Center);
            PhysicalDecorator.Paint(x + w * 1, y, w, h, HorizontalAlign.Center);
            FireDecorator.Paint(x + w * 2, y, w, h, HorizontalAlign.Center);
            LightningDecorator.Paint(x + w * 3, y, w, h, HorizontalAlign.Center);
            ColdDecorator.Paint(x + w * 4, y, w, h, HorizontalAlign.Center);
            PoisonDecorator.Paint(x + w * 5, y, w, h, HorizontalAlign.Center);
            ArcaneDecorator.Paint(x + w * 6, y, w, h, HorizontalAlign.Center);
            HolyDecorator.Paint(x + w * 7, y, w, h, HorizontalAlign.Center);
        }