Beispiel #1
0
        protected internal override void DoRead()
        {
            const int length       = Level.Length;
            var       map          = Dungeon.Level.map;
            var       mapped       = Dungeon.Level.mapped;
            var       discoverable = Level.discoverable;

            var noticed = false;

            for (var i = 0; i < length; i++)
            {
                var terr = map[i];

                if (!discoverable[i])
                {
                    continue;
                }

                mapped[i] = true;
                if ((Terrain.Flags[terr] & Terrain.SECRET) == 0)
                {
                    continue;
                }

                Level.Set(i, Terrain.discover(terr));
                GameScene.UpdateMap(i);

                if (!Dungeon.Visible[i])
                {
                    continue;
                }

                GameScene.DiscoverTile(i, terr);
                Discover(i);

                noticed = true;
            }

            Dungeon.Observe();

            GLog.Information(TxtLayout);
            if (noticed)
            {
                Sample.Instance.Play(Assets.SND_SECRET);
            }

            SpellSprite.Show(CurUser, SpellSprite.Map);
            Sample.Instance.Play(Assets.SND_READ);
            Invisibility.Dispel();

            SetKnown();

            CurUser.SpendAndNext(TimeToRead);
        }
Beispiel #2
0
        public override void Execute(Hero hero, string action)
        {
            if (action.Equals(AcEat))
            {
                Detach(hero.Belongings.Backpack);

                hero.Buff <Hunger>().Satisfy(Energy);
                GLog.Information(Message);

                switch (hero.heroClass.Ordinal())
                {
                case HeroClassType.Warrior:
                    if (hero.HP < hero.HT)
                    {
                        hero.HP = Math.Min(hero.HP + 5, hero.HT);
                        hero.Sprite.Emitter().Burst(Speck.Factory(Speck.HEALING), 1);
                    }
                    break;

                case HeroClassType.Mage:
                    hero.Belongings.Charge(false);
                    ScrollOfRecharging.Charge(hero);
                    break;

                case HeroClassType.Rogue:
                    break;

                case HeroClassType.Huntress:
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }

                hero.Sprite.DoOperate(hero.pos);
                hero.Busy();
                SpellSprite.Show(hero, SpellSprite.Food);
                Sample.Instance.Play(Assets.SND_EAT);

                hero.Spend(TimeToEat);

                Statistics.FoodEaten++;
                Badge.ValidateFoodEaten();
            }
            else
            {
                base.Execute(hero, action);
            }
        }
Beispiel #3
0
        public virtual void Choose(HeroSubClass way)
        {
            Detach(CurUser.Belongings.Backpack);

            CurUser.Spend(TimeToRead);
            CurUser.Busy();

            CurUser.subClass = way;

            CurUser.Sprite.DoOperate(CurUser.pos);
            Sample.Instance.Play(Assets.SND_MASTERY);

            SpellSprite.Show(CurUser, SpellSprite.Mastery);
            CurUser.Sprite.Emitter().Burst(Speck.Factory(Speck.MASTERY), 12);
            GLog.Warning("You have chosen the way of the {0}!", Utils.Capitalize(way.Title));

            if (way == HeroSubClass.BERSERKER && CurUser.HP <= CurUser.HT * Fury.Level)
            {
                Buff.Affect <Fury>(CurUser);
            }
        }
        protected internal override void DoRead()
        {
            var count = CurUser.Belongings.Charge(true);

            Charge(CurUser);

            Sample.Instance.Play(Assets.SND_READ);
            Invisibility.Dispel();

            if (count > 0)
            {
                GLog.Information("a surge of energy courses through your pack, recharging your wand" + (count > 1 ? "s" : ""));
                SpellSprite.Show(CurUser, SpellSprite.Charge);
            }
            else
            {
                GLog.Information("a surge of energy courses through your pack, but nothing happens");
            }

            SetKnown();

            CurUser.SpendAndNext(TimeToRead);
        }