Exemplo n.º 1
0
        private static Equipment CreateRangedWeapon(Int32 p_modelLevel, ESubModel p_subModel, EEquipmentType[] p_specificationList, Int32 p_prefixLevel, Int32 p_suffixLevel)
        {
            IEnumerable <RangedWeaponStaticData> iterator = StaticDataHandler.GetIterator <RangedWeaponStaticData>(EDataType.RANGED_WEAPON_MODEL);
            EEquipmentType eequipmentType = DetermineType(RANGED_WEAPON_TYPES, p_specificationList);

            foreach (RangedWeaponStaticData rangedWeaponStaticData in iterator)
            {
                if (rangedWeaponStaticData.Type == eequipmentType && rangedWeaponStaticData.ModelLevel == p_modelLevel && rangedWeaponStaticData.SubModel == p_subModel)
                {
                    Int32 p_suffixId = -1;
                    Int32 p_prefixId = -1;
                    if (p_prefixLevel > 0)
                    {
                        m_prefixProbabilities[EEquipmentType.RANGED_WEAPON].Multiplicators = m_currentEnchantmentMultiplicators;
                        p_prefixId = m_prefixProbabilities[EEquipmentType.RANGED_WEAPON].GetRandomId();
                    }
                    if (p_suffixLevel > 0)
                    {
                        m_suffixProbabilities[EEquipmentType.RANGED_WEAPON].Multiplicators = m_currentEnchantmentMultiplicators;
                        p_suffixId = m_suffixProbabilities[EEquipmentType.RANGED_WEAPON].GetRandomId();
                    }
                    RangedWeapon rangedWeapon = new RangedWeapon();
                    rangedWeapon.InitFromModel(rangedWeaponStaticData, p_prefixId, p_suffixId);
                    rangedWeapon.PrefixLevel = p_prefixLevel;
                    rangedWeapon.SuffixLevel = p_suffixLevel;
                    return(rangedWeapon);
                }
            }
            return(null);
        }
Exemplo n.º 2
0
        private static Equipment CreateJewelry(Int32 p_modelLevel, ESubModel p_subModel, EEquipmentType[] p_specificationList, Int32 p_prefixLevel, Int32 p_suffixLevel)
        {
            IEnumerable <JewelryStaticData> iterator = StaticDataHandler.GetIterator <JewelryStaticData>(EDataType.JEWELRY_MODEL);
            EEquipmentType eequipmentType            = DetermineType(JEWELRY_TYPES, p_specificationList);

            foreach (JewelryStaticData jewelryStaticData in iterator)
            {
                if (jewelryStaticData.Type == eequipmentType && jewelryStaticData.ModelLevel == p_modelLevel && jewelryStaticData.SubModel == p_subModel)
                {
                    Int32 p_suffixId = -1;
                    Int32 p_prefixId = -1;
                    if (p_prefixLevel > 0)
                    {
                        m_prefixProbabilities[EEquipmentType.JEWELRY].Multiplicators = m_currentEnchantmentMultiplicators;
                        p_prefixId = m_prefixProbabilities[EEquipmentType.JEWELRY].GetRandomId();
                    }
                    if (p_suffixLevel > 0)
                    {
                        m_suffixProbabilities[EEquipmentType.JEWELRY].Multiplicators = m_currentEnchantmentMultiplicators;
                        p_suffixId = m_suffixProbabilities[EEquipmentType.JEWELRY].GetRandomId();
                    }
                    Jewelry jewelry = new Jewelry();
                    jewelry.InitFromModel(jewelryStaticData, p_prefixId, p_suffixId);
                    jewelry.PrefixLevel = p_prefixLevel;
                    jewelry.SuffixLevel = p_suffixLevel;
                    return(jewelry);
                }
            }
            return(null);
        }
Exemplo n.º 3
0
        private static Equipment CreateMagicFocus(Int32 p_modelLevel, ESubModel p_subModel, EEquipmentType[] p_specificationList, Int32 p_prefixLevel, Int32 p_suffixLevel)
        {
            IEnumerable <MagicFocusStaticData> iterator = StaticDataHandler.GetIterator <MagicFocusStaticData>(EDataType.MAGIC_FOCUS_MODEL);
            EEquipmentType eequipmentType = DetermineType(MAGIC_FOCUS_TYPES, p_specificationList);

            foreach (MagicFocusStaticData magicFocusStaticData in iterator)
            {
                if (magicFocusStaticData.Type == eequipmentType && magicFocusStaticData.ModelLevel == p_modelLevel && magicFocusStaticData.SubModel == p_subModel)
                {
                    Int32 p_suffixId = -1;
                    Int32 p_prefixId = -1;
                    if (p_prefixLevel > 0)
                    {
                        m_prefixProbabilities[EEquipmentType.MAGIC_FOCUS].Multiplicators = m_currentEnchantmentMultiplicators;
                        p_prefixId = m_prefixProbabilities[EEquipmentType.MAGIC_FOCUS].GetRandomId();
                    }
                    if (p_suffixLevel > 0)
                    {
                        m_suffixProbabilities[EEquipmentType.MAGIC_FOCUS].Multiplicators = m_currentEnchantmentMultiplicators;
                        p_suffixId = m_suffixProbabilities[EEquipmentType.MAGIC_FOCUS].GetRandomId();
                    }
                    MagicFocus magicFocus = new MagicFocus();
                    magicFocus.InitFromModel(magicFocusStaticData, p_prefixId, p_suffixId);
                    magicFocus.PrefixLevel = p_prefixLevel;
                    magicFocus.SuffixLevel = p_suffixLevel;
                    return(magicFocus);
                }
            }
            return(null);
        }
Exemplo n.º 4
0
        private static Equipment CreateShield(Int32 p_modelLevel, ESubModel p_subModel, EEquipmentType[] p_specificationList, Int32 p_prefixLevel, Int32 p_suffixLevel)
        {
            IEnumerable <ShieldStaticData> iterator = StaticDataHandler.GetIterator <ShieldStaticData>(EDataType.SHIELD_MODEL);
            EEquipmentType eequipmentType           = DetermineType(SHIELD_TYPES, p_specificationList);

            foreach (ShieldStaticData shieldStaticData in iterator)
            {
                if (shieldStaticData.Type == eequipmentType && shieldStaticData.ModelLevel == p_modelLevel && shieldStaticData.SubModel == p_subModel)
                {
                    Int32 p_suffixId = -1;
                    Int32 p_prefixId = -1;
                    if (p_prefixLevel > 0)
                    {
                        m_prefixProbabilities[EEquipmentType.SHIELD].Multiplicators = m_currentEnchantmentMultiplicators;
                        p_prefixId = m_prefixProbabilities[EEquipmentType.SHIELD].GetRandomId();
                    }
                    if (p_suffixLevel > 0)
                    {
                        m_suffixProbabilities[EEquipmentType.SHIELD].Multiplicators = m_currentEnchantmentMultiplicators;
                        p_suffixId = m_suffixProbabilities[EEquipmentType.SHIELD].GetRandomId();
                    }
                    Shield shield = new Shield();
                    shield.InitFromModel(shieldStaticData, p_prefixId, p_suffixId);
                    shield.PrefixLevel = p_prefixLevel;
                    shield.SuffixLevel = p_suffixLevel;
                    return(shield);
                }
            }
            return(null);
        }
Exemplo n.º 5
0
 public ArmorStaticData()
 {
     m_AC                = 0;
     m_subtype           = EEquipmentType.CLOTHING;
     m_breakChance       = 0f;
     m_requiredSkillID   = 0;
     m_requiredSkillTier = ETier.NONE;
 }
Exemplo n.º 6
0
        public PredefinedItem(int level, int seed, EEquipmentType equipmentType, EItemRarity rarity)
        {
            this.level         = level;
            this.seed          = seed;
            this.equipmentType = equipmentType;
            this.rarity        = rarity;

            overrideBaseStats = false;
        }
Exemplo n.º 7
0
 public EquipmentStaticData()
 {
     m_type            = EEquipmentType.HEADGEAR;
     m_modelLevel      = 1;
     m_subModel        = ESubModel.A;
     m_level           = 0;
     m_requiredXP      = 0;
     m_nextLevelItemID = 0;
     m_description     = String.Empty;
 }
Exemplo n.º 8
0
        public PredefinedItem(int level, int seed, EEquipmentType equipmentType, EItemRarity rarity, ItemStats stats)
        {
            this.level         = level;
            this.seed          = seed;
            this.equipmentType = equipmentType;
            this.rarity        = rarity;

            this.stats = stats;

            overrideBaseStats = true;
        }
Exemplo n.º 9
0
 public ItemTypes(ItemTypes types)
 {
     itemType           = types.ItemType;
     equipmentType      = types.EquipmentType;
     equipSlot          = types.EquipSlot;
     weightClass        = types.WeightClass;
     damageType         = types.DamageType;
     weaponRange        = types.WeaponRange;
     itemRarity         = types.Rarity;
     prefixItemModifyer = types.PrefixModifyer;
     suffixItemModifyer = types.SuffixModifyer;
 }
 public EnchantmentProbabilityList(IEnumerable <SuffixStaticData> p_suffixes, EEquipmentType p_type, EEquipmentType p_subtype)
 {
     m_probabilities = new List <Enchantment>();
     foreach (SuffixStaticData suffixStaticData in p_suffixes)
     {
         Single suffixProbability = GetSuffixProbability(suffixStaticData, p_type, p_subtype);
         if (suffixProbability > 0f)
         {
             Enchantment item = new Enchantment(suffixStaticData.StaticID, suffixProbability, suffixStaticData.MagicSchool);
             m_probabilities.Add(item);
         }
     }
 }
 public EnchantmentProbabilityList(IEnumerable <PrefixStaticData> p_prefixes, EEquipmentType p_type, EEquipmentType p_subtype)
 {
     m_probabilities = new List <Enchantment>();
     foreach (PrefixStaticData prefixStaticData in p_prefixes)
     {
         Single prefixProbability = GetPrefixProbability(prefixStaticData, p_type, p_subtype);
         if (prefixProbability > 0f)
         {
             Enchantment item = new Enchantment(prefixStaticData.StaticID, prefixProbability, prefixStaticData.School);
             m_probabilities.Add(item);
         }
     }
 }
Exemplo n.º 12
0
        public PredefinedItem(int level, int seed, EEquipmentType equipmentType, EItemRarity rarity, EItemModifyer prefixModifyer, EItemModifyer suffixModifyer, int prefixIndex, int suffixIndex)
        {
            this.level         = level;
            this.seed          = seed;
            this.equipmentType = equipmentType;
            this.rarity        = rarity;

            this.prefixModifyer = prefixModifyer;
            this.suffixModifyer = suffixModifyer;
            this.prefixIndex    = prefixIndex;
            this.suffixIndex    = suffixIndex;

            overrideBaseStats = false;
        }
Exemplo n.º 13
0
 public ItemTypes(EItemType itemType, EEquipmentType equipmentType, EItemEquipSlot equipSlot, EItemWeightClass weightClass,
                  EWeaponDamageType damageType, EWeaponRange weaponRange, EItemRarity itemRarity,
                  EItemModifyer prefixItemModifyer = EItemModifyer.NONE, EItemModifyer suffixItemModifyer = EItemModifyer.NONE)
 {
     this.itemType           = itemType;
     this.equipmentType      = equipmentType;
     this.equipSlot          = equipSlot;
     this.weightClass        = weightClass;
     this.damageType         = damageType;
     this.weaponRange        = weaponRange;
     this.itemRarity         = itemRarity;
     this.prefixItemModifyer = prefixItemModifyer;
     this.suffixItemModifyer = suffixItemModifyer;
 }
Exemplo n.º 14
0
    void Awake()
    {
        item = ItemGenerator.GenerateRandomItem();

        displayName = item.Name;
        desc        = item.FlavorText;
        strength    = (int)item.Stats.Strength;
        intellect   = (int)item.Stats.Intelect;
        dexterity   = (int)item.Stats.Dexterity;
        gold        = (int)item.Stats.GoldValue;
        scrap       = (int)item.Stats.ScrapValue;
        itemType    = item.Types.EquipmentType;
        health      = (int)item.Stats.Health;

        id = item.ID;
    }
Exemplo n.º 15
0
        private static Equipment CreateMeleeWeapon(Int32 p_modelLevel, ESubModel p_subModel, EEquipmentType[] p_specificationList, Int32 p_prefixLevel, Int32 p_suffixLevel)
        {
            IEnumerable <MeleeWeaponStaticData> iterator = StaticDataHandler.GetIterator <MeleeWeaponStaticData>(EDataType.MELEE_WEAPON_MODEL);
            EEquipmentType eequipmentType = DetermineType(MELEE_WEAPON_TYPES, p_specificationList);
            EEquipmentType eequipmentType2;

            if (eequipmentType == EEquipmentType.DAGGER)
            {
                eequipmentType2 = EEquipmentType.ONEHANDED;
            }
            else if (eequipmentType == EEquipmentType.SPEAR)
            {
                eequipmentType2 = EEquipmentType.TWOHANDED;
            }
            else
            {
                eequipmentType2 = DetermineType(MELEE_WEAPON_SUBTYPES, p_specificationList);
            }
            foreach (MeleeWeaponStaticData meleeWeaponStaticData in iterator)
            {
                if (meleeWeaponStaticData.Type == eequipmentType && meleeWeaponStaticData.Subtype == eequipmentType2 && meleeWeaponStaticData.ModelLevel == p_modelLevel && meleeWeaponStaticData.SubModel == p_subModel)
                {
                    Int32 p_suffixId = -1;
                    Int32 p_prefixId = -1;
                    if (p_prefixLevel > 0)
                    {
                        m_prefixProbabilities[EEquipmentType.MELEE_WEAPON].Multiplicators = m_currentEnchantmentMultiplicators;
                        p_prefixId = m_prefixProbabilities[EEquipmentType.MELEE_WEAPON].GetRandomId();
                    }
                    if (p_suffixLevel > 0)
                    {
                        m_suffixProbabilities[EEquipmentType.MELEE_WEAPON].Multiplicators = m_currentEnchantmentMultiplicators;
                        p_suffixId = m_suffixProbabilities[EEquipmentType.MELEE_WEAPON].GetRandomId();
                    }
                    MeleeWeapon meleeWeapon = new MeleeWeapon();
                    meleeWeapon.InitFromModel(meleeWeaponStaticData, p_prefixId, p_suffixId);
                    meleeWeapon.PrefixLevel = p_prefixLevel;
                    meleeWeapon.SuffixLevel = p_suffixLevel;
                    return(meleeWeapon);
                }
            }
            return(null);
        }
Exemplo n.º 16
0
        private static Equipment CreateRandomEquipmentInternal(ModelProbability[] p_modelLevels, Single p_prefixChance, Single p_suffixChance, EnchantmentProbability[] p_prefixProbabilities, EnchantmentProbability[] p_suffixProbabilities, EEquipmentType[] p_specificationList)
        {
            Boolean          flag             = Random.Value < p_prefixChance;
            Boolean          flag2            = Random.Value < p_suffixChance;
            Int32            p_suffixLevel    = -1;
            Int32            p_prefixLevel    = -1;
            ModelProbability modelProbability = DetermineModelLevel(p_modelLevels);

            if (flag)
            {
                p_prefixLevel = DetermineEnchantmentLevel(p_prefixProbabilities);
            }
            if (flag2)
            {
                p_suffixLevel = DetermineEnchantmentLevel(p_suffixProbabilities);
            }

            EEquipmentType eequipmentType = DetermineType(EQUIPMENT_CLASSES, p_specificationList);

            switch (eequipmentType)
            {
            case EEquipmentType.ARMOR:
                return(CreateArmor(modelProbability.ModelLevel, modelProbability.SubModel, p_specificationList, p_prefixLevel, p_suffixLevel));

            case EEquipmentType.JEWELRY:
                return(CreateJewelry(modelProbability.ModelLevel, modelProbability.SubModel, p_specificationList, p_prefixLevel, p_suffixLevel));

            case EEquipmentType.SHIELD:
                return(CreateShield(modelProbability.ModelLevel, modelProbability.SubModel, p_specificationList, p_prefixLevel, p_suffixLevel));

            case EEquipmentType.MELEE_WEAPON:
                return(CreateMeleeWeapon(modelProbability.ModelLevel, modelProbability.SubModel, p_specificationList, p_prefixLevel, p_suffixLevel));

            case EEquipmentType.MAGIC_FOCUS:
                return(CreateMagicFocus(modelProbability.ModelLevel, modelProbability.SubModel, p_specificationList, p_prefixLevel, p_suffixLevel));

            case EEquipmentType.RANGED_WEAPON:
                return(CreateRangedWeapon(modelProbability.ModelLevel, modelProbability.SubModel, p_specificationList, p_prefixLevel, p_suffixLevel));

            default:
                return(null);
            }
        }
Exemplo n.º 17
0
        private static Equipment CreateArmor(Int32 p_modelLevel, ESubModel p_subModel, EEquipmentType[] p_specificationList, Int32 p_prefixLevel, Int32 p_suffixLevel)
        {
            IEnumerable <ArmorStaticData> iterator = StaticDataHandler.GetIterator <ArmorStaticData>(EDataType.ARMOR_MODEL);
            EEquipmentType eequipmentType          = DetermineType(ARMOR_TYPES, p_specificationList);
            EEquipmentType eequipmentType2;

            if (eequipmentType == EEquipmentType.GARMENT)
            {
                eequipmentType2 = DetermineType(GARMENT_SUBTYPES, p_specificationList);
            }
            else
            {
                eequipmentType2 = DetermineType(ARMOR_SUBTYPES, p_specificationList);
            }
            foreach (ArmorStaticData armorStaticData in iterator)
            {
                if (armorStaticData.Type == eequipmentType && armorStaticData.Subtype == eequipmentType2 && armorStaticData.ModelLevel == p_modelLevel && armorStaticData.SubModel == p_subModel)
                {
                    Int32 p_suffixId = -1;
                    Int32 p_prefixId = -1;
                    if (p_prefixLevel > 0)
                    {
                        m_prefixProbabilities[eequipmentType2].Multiplicators = m_currentEnchantmentMultiplicators;
                        p_prefixId = m_prefixProbabilities[eequipmentType2].GetRandomId();
                    }
                    if (p_suffixLevel > 0)
                    {
                        m_suffixProbabilities[eequipmentType2].Multiplicators = m_currentEnchantmentMultiplicators;
                        p_suffixId = m_suffixProbabilities[eequipmentType2].GetRandomId();
                    }
                    Armor armor = new Armor();
                    armor.InitFromModel(armorStaticData, p_prefixId, p_suffixId);
                    armor.PrefixLevel = p_prefixLevel;
                    armor.SuffixLevel = p_suffixLevel;
                    return(armor);
                }
            }
            return(null);
        }
Exemplo n.º 18
0
 private static Item LookUpItem(EEquipmentType itemToLookUp)
 {
     return(new Item(itemLookUp.ItemLookUpTable[itemToLookUp]));
 }
Exemplo n.º 19
0
 public MEquipment(EEquipmentType t)
 {
     this.Type = t;
 }
 public void SetEquipmentType(EEquipmentType equipmentType)
 {
     this.equipmentType = equipmentType;
 }