예제 #1
0
        /// <summary>
        /// Public static method that returns the 'Dice' that
        /// can be used based on the type of Armour specified.
        /// </summary>
        /// <param name="itemType">The Armour Type to inspect.</param>
        /// <returns>A List of Dice (Die) objects that can be rolled based on the Armour Type specified.</returns>
        public static List <Die> GetDiceBasedOnDefensiveItemType(HeroDefensiveItemType itemType)
        {
            List <Die> defensiveDice = new List <Die>();

            switch (itemType)
            {
            default:
            case HeroDefensiveItemType.ClothTunic:
            case HeroDefensiveItemType.LeatherHelm:
            case HeroDefensiveItemType.LeatherGloves:
            case HeroDefensiveItemType.LeatherBoots:
            case HeroDefensiveItemType.LeatherPants:
            case HeroDefensiveItemType.SilverNecklace:
            case HeroDefensiveItemType.SilverRing:
            {
                defensiveDice.Add(new GreenDie());
            }
            break;

            case HeroDefensiveItemType.LeatherChestPiece:
            case HeroDefensiveItemType.GoldNecklace:
            case HeroDefensiveItemType.GoldRing:
            {
                defensiveDice.AddRange(new Die[] { new GreenDie(), new GreenDie() });
            }
            break;
            }

            return(defensiveDice);
        }
예제 #2
0
        /// <summary>
        /// Private static method that returns a boolean determining in the
        /// Armour Type specified belongs to the current level value passed in.
        /// </summary>
        /// <param name="level">The level to check against (does the Armour specified belong to this level).</param>
        /// <param name="item">The Armour Type to check.</param>
        /// <returns>If the Armour Type belongs to the specified level then true, otherwise false. An Armour Type of HeroDefensiveItemType.None will always result in false.</returns>
        private static bool GetLevelConditionFilter(int level, HeroDefensiveItemType item)
        {
            //When using this filter an Armour Type of None should never be included, return false
            if (item == HeroDefensiveItemType.None)
            {
                return(false);
            }

            //Only return true if an Armour Types underlying byte type falls between the level min/max limits specified (by constants in this class)
            switch (level)
            {
            default:
            case 1:
            {
                return((byte)item > 0 && (byte)item <= levelOneMax);
            }

            case 2:
            {
                return((byte)item > levelOneMax && (byte)item <= levelTwoMax);
            }

            case 3:
            {
                return((byte)item > levelTwoMax && (byte)item <= levelThreeMax);
            }

            case 4:
            {
                return((byte)item > levelThreeMax && (byte)item <= levelFourMax);
            }

            case 5:
            {
                return((byte)item > levelFourMax && (byte)item <= levelFiveMax);
            }
            }
        }
예제 #3
0
        /// <summary>
        /// Public static method that returns a 'Slot Type'
        /// based on an Armour Type.
        /// </summary>
        /// <param name="itemType">The Armour Type to inspect.</param>
        /// <returns>The Slot Type this piece of Armour belongs to.</returns>
        public static HeroDefensiveItemSlotType GetSlotTypeBasedOnArmourType(HeroDefensiveItemType itemType)
        {
            switch (itemType)
            {
            case HeroDefensiveItemType.ClothTunic:
            case HeroDefensiveItemType.LeatherChestPiece:
            case HeroDefensiveItemType.NoviceMagicianRobe:
            case HeroDefensiveItemType.NoviceRobeOfSkulls:
            case HeroDefensiveItemType.AdeptMagicianDragonSkinRobe:
            case HeroDefensiveItemType.AdeptRobeOfDemonSkulls:
            case HeroDefensiveItemType.ChainMailChestPiece:
            case HeroDefensiveItemType.DragonSkinChestPiece:
            case HeroDefensiveItemType.MasterworkPlateChestPiece:
            case HeroDefensiveItemType.BloodStainedMithralArmour:
            case HeroDefensiveItemType.BloodStainedMithralRobe:
            {
                return(HeroDefensiveItemSlotType.Chest);
            }

            case HeroDefensiveItemType.LeatherHelm:
            case HeroDefensiveItemType.ChainMailHelm:
            case HeroDefensiveItemType.MasterworkPlateHelm:
            {
                return(HeroDefensiveItemSlotType.Head);
            }

            case HeroDefensiveItemType.LeatherGloves:
            case HeroDefensiveItemType.ChainMailGloves:
            case HeroDefensiveItemType.MasterworkPlateGloves:
            {
                return(HeroDefensiveItemSlotType.Hands);
            }

            case HeroDefensiveItemType.LeatherBoots:
            case HeroDefensiveItemType.ChainMailBoots:
            case HeroDefensiveItemType.MasterworkPlateBoots:
            {
                return(HeroDefensiveItemSlotType.Feet);
            }

            case HeroDefensiveItemType.LeatherPants:
            case HeroDefensiveItemType.ChainMailPants:
            case HeroDefensiveItemType.MasterworkPlatePants:
            {
                return(HeroDefensiveItemSlotType.Legs);
            }

            case HeroDefensiveItemType.SilverNecklace:
            case HeroDefensiveItemType.GoldNecklace:
            {
                return(HeroDefensiveItemSlotType.Necklace);
            }

            case HeroDefensiveItemType.SilverRing:
            case HeroDefensiveItemType.GoldRing:
            {
                return(HeroDefensiveItemSlotType.Ring);
            }

            case HeroDefensiveItemType.None:
            default:
            {
                return(HeroDefensiveItemSlotType.None);
            }
            }
        }
예제 #4
0
 public Armour(HeroDefensiveItemType itemType)
 {
     DefensiveItemType     = itemType;
     DefensiveItemTypeSlot = GetSlotTypeBasedOnArmourType(itemType);
 }