Example #1
0
        public static WeaponItem GenerateItem()
        {
            //TODO: Change probabilities!!

            //generate rarity
            int itemRarity = random.Next(Enum.GetValues(typeof(ItemRarity)).Length);

            //Generate Item Type
            int          itemType  = random.Next(Enum.GetValues(typeof(EqupmentType)).Length);
            EqupmentType itemTypeC = (EqupmentType)itemType;

            //generate base type
            //From basetype we get things such as ID, texture, name, possible roll values, etc
            int      i        = random.Next(ItemContainer.itemBaseNormal.Count);
            ItemBase baseitem = ItemContainer.itemBaseNormal.ElementAt(i);

            while (baseitem.GetEqupmentType() != itemTypeC)
            {
                i        = random.Next(ItemContainer.itemBaseNormal.Count);
                baseitem = ItemContainer.itemBaseNormal.ElementAt(i);
            }

            //Set values depending on rarity

            baseitem.SetRarity((ItemRarity)itemRarity);

            if (EqupmentType.Weapon == itemTypeC)
            {
                return((WeaponItem)baseitem);
            }
            else
            {
                return((WeaponItem)baseitem);
            }
        }
Example #2
0
 public ItemBase(int id, string name, EqupmentType Type, ItemRarity rarity, string TextureName, ItemTypes itemType)
 {
     ID               = id;
     Name             = name;
     EquipmentType    = Type;
     Rarity           = rarity;
     ItemType         = itemType;
     this.TextureName = TextureName;
 }
Example #3
0
 public EqupmentBase(int id, string name, EqupmentType Type, int Intelligence, int Strength, int Dexterity, ItemRarity itemRarity, string TextureName, int intreq, int strreq, int dexreq, int levelReq, ItemTypes itemType)
     : base(id, name, Type, itemRarity, TextureName, itemType)
 {
     this.Intelligence = Intelligence;
     this.Strength     = Strength;
     this.Dexterity    = Dexterity;
     IntelligenceReq   = intreq;
     StrengthReq       = strreq;
     DexterityReq      = dexreq;
     LevelReq          = levelReq;
 }
Example #4
0
 public WeaponItem(int id, string name, EqupmentType Type, WeaponTypes weaponType, int Intelligence, int Strength, int Dexterity, int Lower, int Upper, ItemRarity rarity, string TextureName, int intreq, int strreq, int dexreq, int LevelReq, ItemTypes itemType)
     : base(id, name, Type, Intelligence, Strength, Dexterity, rarity, TextureName, intreq, strreq, dexreq, LevelReq, itemType)
 {
     this.weaponType   = weaponType;
     WeaponDamageRange = new int[] { Lower, Upper };
 }