Example #1
0
 public BuffIndicator(Character ch)
     : base()
 {
     this.ch = ch;
     if (ch == Dungeon.Hero)
     {
         heroInstance = this;
     }
 }
Example #2
0
        public override void Destroy()
        {
            base.Destroy();

            if (this == heroInstance)
            {
                heroInstance = null;
            }
        }
Example #3
0
        protected override void CreateChildren()
        {
            _shield = new NinePatch(Assets.STATUS, 80, 0, 30 + 18, 0);
            Add(_shield);

            var touchArea = new TouchArea(0, 1, 30, 30);

            touchArea.ClickAction = touch =>
            {
                var sprite = Dungeon.Hero.Sprite;
                if (!sprite.Visible)
                {
                    Camera.Main.FocusOn(sprite);
                }
                GameScene.Show(new WndHero());
            };
            Add(touchArea);

            _btnMenu = new MenuButton();
            Add(_btnMenu);

            _avatar = HeroSprite.Avatar(Dungeon.Hero.heroClass, _lastTier);
            Add(_avatar);

            _blood = new Emitter();
            _blood.Pos(_avatar);
            _blood.Pour(BloodParticle.Factory, 0.3f);
            _blood.AutoKill = false;
            _blood.On       = false;
            Add(_blood);

            _compass = new Compass(Dungeon.Level.exit);
            Add(_compass);

            _hp = new Image(Assets.HP_BAR);
            Add(_hp);

            _exp = new Image(Assets.XP_BAR);
            Add(_exp);

            _level = new BitmapText(PixelScene.font1x);
            _level.Hardlight(0xFFEBA4);
            Add(_level);

            _depth = new BitmapText(Dungeon.Depth.ToString(CultureInfo.InvariantCulture), PixelScene.font1x);
            _depth.Hardlight(0xCACFC2);
            _depth.Measure();
            Add(_depth);

            Dungeon.Hero.Belongings.CountIronKeys();
            _keys = new BitmapText(PixelScene.font1x);
            _keys.Hardlight(0xCACFC2);
            Add(_keys);

            _danger = new DangerIndicator();
            Add(_danger);

            _loot = new LootIndicator();
            Add(_loot);

            _buffs = new BuffIndicator(Dungeon.Hero);
            Add(_buffs);
        }