Esempio n. 1
0
        public Player()
        {
            AttackMessages = new string[] { "You thrash at the", "You fiercly lunge at the", "You tighten your grip and swing at the" };
            GreetMessages  = new string[] { "You begin your quest to defeat the DragonLord", "You embark on your journey to slay the Dragonlord", "Good luck on your journey" };
            DeathMessages  = new string[] { "You are dead, not a big surprise", "You fall over dead", "You crumble down to the floor and breathe your last", "You died" };

            Attack          = 2;
            AttackChance    = 40;
            Awareness       = 13;
            Color           = Colors.Player;
            Defense         = 1;
            DefenseChance   = 15;
            Gold            = 50;
            Health          = 20;
            MaxHealth       = 20;
            Mana            = 10;
            MaxMana         = 10;
            Name            = "Novice";
            Speed           = 10;
            Level           = 1;
            MaxLevel        = 16;
            Experience      = 8;
            TotalExperience = 0;
            Hunger          = 1000;
            MaxHunger       = 1200;
            Symbol          = '@';
            Status          = "Healthy";
            Inventory       = new Inventory(this);
            Inventory.AddInventoryItem(new FoodRation(2));

            QAbility = new DoNothing();
            WAbility = new DoNothing();
            EAbility = new DoNothing();
            RAbility = new DoNothing();
            XAbility = new Look();

            HPRegen = new RegainHP(1, 10);
            MPRegen = new RegainMP(1, 20);
            State   = new DoNothing();

            Item1 = new HealingPotion();
            Item2 = new ManaPotion();
            Item3 = new ToughnessPotion();
            Item4 = new TeleportScroll();
        }
Esempio n. 2
0
        protected override bool UseItem()
        {
            Player player = Game.Player;

            if (player.Health == player.MaxHealth)
            {
                Game.MessageLog.Add("Your stumble around and waste an entire turn as your health is already at max-out");
                return(true);
            }
            else
            {
                int healAmount = Dice.Roll("4D3") + 4; // improved: Dice.Roll("5D4") + 5;
                Game.MessageLog.Add($"You consume a {Name} and recovers {healAmount} health", Colors.Healing);
                RegainHP regainHP = new RegainHP(healAmount, 0);
                RemainingUses--;

                return(regainHP.Perform());
            }
        }