public OInt this[EnchantTypes type] { get { return(this.values[(int)type]); } set { this.values[(int)type] = value; } }
public OInt this[EnchantCategory category, EnchantTypes type] { get { return((OInt)(category != EnchantCategory.Assist ? this.enchant_resist[type] : this.enchant_assist[type])); } set { if (category == EnchantCategory.Assist) { this.enchant_assist[type] = (OShort)value; } else { this.enchant_resist[type] = (OShort)value; } } }
public OInt this[EnchantCategory category, EnchantTypes type] { get { if (category == EnchantCategory.Assist) { return(this.enchant_assist[type]); } return(this.enchant_resist[type]); } set { if (category == EnchantCategory.Assist) { this.enchant_assist[type] = value; } else { this.enchant_resist[type] = value; } } }
// Returns A New Enchant (default is 999 for random) public Enchant GetNewEnchant(Item i, int itemLevel, bool hasFirst = false) { // set the enchant level to the item level level = itemLevel; // set the type by choice or random (-1) type = PickEnchantType(i.GetEnchantTypeNum(), hasFirst); // set the enchants item type i_type = i.itemType; indexA = (int)type; if (i_type == Item.ItemTypes.Weapon) { w_damage = (int)((i.minDamage + i.maxDamage) / 2f); } // If the type is a primary enchant type if (type == EnchantTypes.Primary) { // while the primary enchant is none, keep getting another primary while (ePrimary == Enchant_Database.Primary_Stats_Enchants.None) { ePrimary = Enchant_Database.GetPrimaryEnchant(this, i.GetSpecificEnchantTypeNum(), i.itemQuality); indexB = (int)ePrimary; } } // If the type is a secondary enchant type else if (type == EnchantTypes.Secondary) { // while the secondary enchant is none, keep getting another secondary while (eSecondary == Enchant_Database.Secondary_Stats_Enchants.None) { eSecondary = Enchant_Database.GetSecondaryEnchant(this, i.GetSpecificEnchantTypeNum()); indexB = (int)eSecondary; } } // If the type is a tertiary enchant type else if (type == EnchantTypes.Tertiary) { // while the tertiary is none, keep getting a new tertiary enchant while (eTertiary == Enchant_Database.Tertiary_Stats_Enchants.None) { eTertiary = Enchant_Database.GetTertiaryEnchant(this, i.GetSpecificEnchantTypeNum()); indexB = (int)eTertiary; } } // If the type is of Teir 1 damage enchant else if (type == EnchantTypes.Damage_T1) { // keep getting another damage enchant of teir 1 while (eT1 == Enchant_Database.Tier1_Damage_Enchants.None) { eT1 = Enchant_Database.GetTierOneDamageEnchant(this, i.GetSpecificEnchantTypeNum()); indexB = (int)eT1; } } // If the type is of Teir 2 damage enchant else if (type == EnchantTypes.Damage_T2) { // keep getting another damage enchant of teir 2 while (eT2 == Enchant_Database.Tier2_Damage_Enchants.None) { eT2 = Enchant_Database.GetTierTwoDamageEnchant(this, i.GetSpecificEnchantTypeNum()); indexB = (int)eT2; } } // if the type is of Teir 3 damage enchant else if (type == EnchantTypes.Damage_T3) { // keep getting another damage enchant of teir 3 while (eT3 == Enchant_Database.Tier3_Damage_Enchants.None) { eT3 = Enchant_Database.GetTierThreeDamageEnchant(this, i.GetSpecificEnchantTypeNum()); indexB = (int)eT3; } } // If the type of enchant is resistance else if (type == EnchantTypes.Resistance) { // Keep getting a resistance enchant until it is not none while (eResistance == Enchant_Database.Resistance_Enchants.None) { eResistance = Enchant_Database.GetResistanceEnchant(this, i.GetSpecificEnchantTypeNum()); indexB = (int)eResistance; } } else { Debug.Log("ERROR :: No enchant type was found (::GetNewEnchant())"); } return(this); }
public void Start() { type = EnchantTypes.NONE; }
public Enchant(Item.ItemTypes t = Item.ItemTypes.NONE, EnchantTypes e = EnchantTypes.NONE) { i_type = t; type = e; }