Ejemplo n.º 1
0
        public override void OnRender(RenderTarget Target)
        {
            base.OnRender(Target);

            Target.RenderRect(new Vector2(0, 0), new Vector2(16, Size.y - 40), new PixelColor(0, 0, 0));
            Target.RenderRect(new Vector2(Size.x - 16, 0), new Vector2(16, Size.y - 40), new PixelColor(0, 0, 0));
            Target.RenderRect(new Vector2(0, Size.y - 40), new Vector2(Size.x, 40), new PixelColor(0, 0, 0));

            Target.Layer++;
            ClassicGame game = app.GameState as ClassicGame;

            Vector2 health    = new Vector2(Size.x / 2 + 64, Size.y - 30);
            int     fullBar   = 75;
            int     healthBar = fullBar * game.World.ActivePlayerObj.Character.Health / 100;

            Target.RenderRect(health, new Vector2(healthBar, 5), new PixelColor(240, 64, 56));

            Vector2 timebar = new Vector2(Target.Width / 2 - 30, 2);
            int     dayTime = (int)(game.World.Time * 60);

            Target.RenderRect(timebar, new Vector2(dayTime, 3), new PixelColor(240, 64, 56));

            Vector2 name = new Vector2(Size.x / 2 - 97, Size.y - 30);

            playerColor.DrawText(Target, name, this.name, TextAlignment.Center, VerticalTextAlignment.Top);

            Vector2    day = new Vector2(Size.x / 2 + 100, Size.y - 15);
            TextHelper txt = new TextHelper(app, "burn");

            txt.AddArgument("|A", game.World.Day);
            font.DrawText(Target, day, txt[404], TextAlignment.Center, VerticalTextAlignment.Top);
        }
Ejemplo n.º 2
0
        public override void OnUpdate(float Elapsed)
        {
            ClassicGame game = app.GameState as ClassicGame;

            game.World.Update(Elapsed);

            if (game.World.Time <= 0)
            {
                app.ActiveClient.Finish();
                app.SceneManager.SetScene("WaitScene");
            }
        }
Ejemplo n.º 3
0
        protected override void OnActivateScene(object parameter)
        {
            app.RenderMouse    = false;
            app.MouseBoundings = view.Boundings;

            ClassicGame game = app.GameState as ClassicGame;

            if (BurntimeClassic.Instance.PreviousPlayerId != -1 &&
                BurntimeClassic.Instance.PreviousPlayerId != game.CurrentPlayerIndex)
            {
                // play player changed sound
                BurntimeClassic.Instance.Engine.Music.PlayOnce("06_MUS 06_HSC.ogg");
            }
            BurntimeClassic.Instance.PreviousPlayerId = game.CurrentPlayerIndex;

            view.Map      = (MapData)game.World.ActiveLocationObj.Map.MapData;
            view.Location = game.World.ActiveLocationObj;
            view.Player   = game.World.ActivePlayerObj;

            if (view.Player.RefreshScrollPosition)
            {
                view.CenterTo(view.Player.Character.Position);
            }
            else
            {
                view.ScrollPosition = view.Player.LocationScrollPosition;
            }
            gui.UpdatePlayer();

            view.Player.OnMainMap = false;

            game.MainMapView = false;

            app.GameState.Container.AddNotifycationHandler(this);

            // refresh speak/fight mode
            if (view.Location.IsCity && fightMode)
            {
                fightMode = false;
            }

            if (fightMode)
            {
                OnMenuFight();
            }
            else
            {
                OnMenuSpeak();
            }
        }
Ejemplo n.º 4
0
        public void UpdatePlayer()
        {
            ClassicGame game = app.GameState as ClassicGame;

            if (game.World.ActivePlayer == -1)
            {
                face.FaceID = -1;
                name        = "";
                return;
            }

            Player player = game.World.Players[game.World.ActivePlayer];

            face.FaceID = player.FaceID;
            name        = player.Name;
            playerColor = new GuiFont(BurntimeClassic.FontName, player.Color);
        }
Ejemplo n.º 5
0
        protected override void OnActivateScene(object parameter)
        {
            app.RenderMouse    = false;
            app.MouseBoundings = view.Boundings;

            ClassicGame game = app.GameState as ClassicGame;

            if (BurntimeClassic.Instance.PreviousPlayerId != -1 &&
                BurntimeClassic.Instance.PreviousPlayerId != game.CurrentPlayerIndex)
            {
                // play player changed sound
                BurntimeClassic.Instance.Engine.Music.PlayOnce("06_MUS 06_HSC.ogg");
            }
            BurntimeClassic.Instance.PreviousPlayerId = game.CurrentPlayerIndex;

            view.Ways   = (WayData)game.World.Ways.WayData;
            view.Map    = (MapData)game.World.Map.MapData;
            view.Player = game.World.ActivePlayerObj;
            if (game.World.ActivePlayerObj.RefreshMapScrollPosition)
            {
                view.CenterTo(view.Map.Entrances[game.World.ActivePlayerObj.Location].Area.Center);
            }
            else
            {
                view.ScrollPosition = game.World.ActivePlayerObj.MapScrollPosition;
            }
            gui.UpdatePlayer();

            game.World.ActivePlayerObj.OnMainMap = true;

            game.MainMapView = true;

            // refresh travel/info cursor
            if (infoMode)
            {
                OnMenuInfo();
            }
            else
            {
                OnMenuTravel();
            }
        }
Ejemplo n.º 6
0
        public override void OnUpdate(float Elapsed)
        {
            ClassicGame game = app.GameState as ClassicGame;

            game.World.Update(Elapsed);

            game.World.ActiveLocationObj.Update(Elapsed);
            game.World.ActivePlayerObj.Update(Elapsed);

            if (game.World.Time <= 0 || game.World.ActivePlayerObj.IsDead)
            {
                app.ActiveClient.Finish();
                app.SceneManager.SetScene("WaitScene");
            }

            if (charOverlay.SelectedCharacter.IsDead)
            {
                view.Player.SelectGroup(view.Player.Group);
            }
        }
Ejemplo n.º 7
0
        public void UpdatePlayer()
        {
            ClassicGame game = app.GameState as ClassicGame;

            if (game.World.ActivePlayer == -1)
            {
                nameField.Text      = "";
                nameField.Progress  = 0;
                foodField.Text      = "";
                foodField.Progress  = 0;
                waterField.Text     = "";
                waterField.Progress = 0;
                player = null;
                return;
            }

            player = game.World.Players[game.World.ActivePlayer];

            nameField.Text  = player.Name;
            nameField.Color = player.Color;
            playerColor     = new GuiFont(BurntimeClassic.FontName, player.Color);
        }
Ejemplo n.º 8
0
        public override void OnUpdate(float Elapsed)
        {
            base.OnUpdate(Elapsed);

            if (player != null)
            {
                nameField.Progress  = player.Character.Health / 100.0f;
                foodField.Progress  = player.Character.Food / (float)player.Character.MaxFood;
                foodField.Text      = player.Character.Food.ToString();
                waterField.Progress = player.Character.Water / (float)player.Character.MaxWater;
                waterField.Text     = player.Character.Water.ToString();
            }

            ClassicGame game = app.GameState as ClassicGame;

            timeField.Progress = game.World.Time;

            TextHelper txt = new TextHelper(app, "burn");

            txt.AddArgument("|A", game.World.Day);
            timeField.Text = txt[404];
        }
Ejemplo n.º 9
0
        void view_Scroll(object sender, MapScrollArgs e)
        {
            ClassicGame game = app.GameState as ClassicGame;

            game.World.ActivePlayerObj.MapScrollPosition = e.Offset;
        }