Exemple #1
0
        public static RPGArmor CreateRandomShield()
        {
            int        c  = new RPGCalc().Roll(3) + 8;
            ArmorClass ac = (ArmorClass)Enum.Parse(typeof(ArmorClass), c.ToString());

            return(new RPGArmor(ac));
        }
Exemple #2
0
        public static RPGArmor CreateRandomArmorPiece()
        {
            int        c  = new RPGCalc().Roll(Enum.GetValues(typeof(ArmorClass)).Length);
            ArmorClass ac = (ArmorClass)Enum.Parse(typeof(ArmorClass), c.ToString());

            return(new RPGArmor(ac));
        }
Exemple #3
0
        public static RPGItem CreateRandomWeapon()
        {
            // roll for all types of weapons
            int c = new RPGCalc().Roll(Enum.GetValues(typeof(WeaponClass)).Length);
            // create a weapon of that type
            WeaponClass wc = (WeaponClass)Enum.Parse(typeof(WeaponClass), c.ToString());

            return(new RPGWeapon(wc));
        }
Exemple #4
0
        public static RPGItem CreateRandomThrownWeapon()
        {
            /*
             * ThrowingAxe = 5,
             * Dart = 6,
             */

            int         c  = new RPGCalc().Roll(2) + 4;
            WeaponClass wc = (WeaponClass)Enum.Parse(typeof(WeaponClass), c.ToString());

            return(new RPGWeapon(wc));
        }
Exemple #5
0
        public static RPGItem CreateRandomLauncherWeapon()
        {
            /*
             * Bow = 7,
             * Crossbow = 8,
             * Sling = 9,
             */

            int         c  = new RPGCalc().Roll(3) + 6;
            WeaponClass wc = (WeaponClass)Enum.Parse(typeof(WeaponClass), c.ToString());

            return(new RPGWeapon(wc));
        }
Exemple #6
0
        public static RPGWeapon CreateRandomMeleeWeapon()
        {
            /*
             * Sword = 1,
             * Axe = 2,
             * Mace = 3,
             * Staff = 4,
             */

            int         c  = new RPGCalc().Roll(4);
            WeaponClass wc = (WeaponClass)Enum.Parse(typeof(WeaponClass), c.ToString());

            return(new RPGWeapon(wc));
        }
        private void SetBonus(Label lbl, int att)
        {
            int b = new RPGCalc().GetBonusFromAttribute(att);

            lbl.Text = b.ToString();
            if (b > 0)
            {
                lbl.ForeColor = Color.Green;
            }
            else if (b < 0)
            {
                lbl.ForeColor = Color.Red;
            }
        }