コード例 #1
0
    /// Main Armor Formula
    /// armor = (int) Range((startValue + (item_lvl * mod)) , ((startValue - 1) + (3 * (item_lvl / 2)) + (lvl * mod))

    /// Light Armor Modifier Formula   Min-Max                       Light Armor  :  Results
    // (int)    (1  +   (1  * 0.66)    <->    ((0) + (3*(1/2))   +   (1 * 0.66)  )  :  Level 01 = (1-2)
    // (int)    (1  +   (10 * 0.66)    <->    ((0) + (3*(10/2))  +   (10 * 0.66) )  :  Level 10 = [7-21]
    // (int)    (1  +   (60 * 0.66)    <->    ((0) + (3*(60/2))  +   (60 * 0.66) )  :  Level 60 = {40-129}

    /// Medium Armor Modifier Formula                                 Medium Armor  :  Results
    // (int)    (2  +   (1  * 1.00)    <->    ((1) + (3*(1/2))   +   (1 * 1.00)  )  :  Level 01 = (3-3)
    // (int)    (2  +   (10 * 1.00)    <->    ((1) + (3*(10/2))  +   (10 * 1.00) )  :  Level 10 = [11-25]
    // (int)    (2  +   (60 * 1.00)    <->    ((1) + (3*(60/2))  +   (60 * 1.00) )  :  Level 60 = {61-150}

    /// Heavy Armor Modifier Formula                                   Heavy Armor  :  Results
    // (int)    (3  +   (1  * 1.33)    <->    ((2) + (3*(1/2))   +   (1 *  1.33) )  :  Level 01 = (4-4)
    // (int)    (3  +   (10 * 1.33)    <->    ((2) + (3*(10/2))  +   (10 * 1.33) )  :  Level 10 = [16-30]
    // (int)    (3  +   (60 * 1.33)    <->    ((2) + (3*(60/2))  +   (60 * 1.33) )  :  Level 60 = {82-171}


    // Initialize Armor : Passing in the armor database from item database, and the item itself
    public void InitializeArmor(Item_Database.Armor_Database armor, Item i)
    {
        int            a_num = (int)armor;
        Armor_Database ab    = GameObject.Find("Database_Armor").GetComponent <Armor_Database>();
        var            abi   = ab.GetIcon(a_num, itemQuality);

        //Debug.Log(a_num);
        i.slotType = abi.Itemtype;
        SetArmorInfo(a_num, i);
    }
コード例 #2
0
ファイル: Item.cs プロジェクト: Xaletor/Galacia
 // Set Item icon
 public void SetItemIcon()
 {
     if (itemType == ItemTypes.Accessory)
     {
         Accessory_Database ac = GameObject.Find("Database_Accessory").GetComponent <Accessory_Database>();
         icon = ac.GetIcon(item_Id);
     }
     else if (itemType == ItemTypes.Armor)
     {
         Armor_Database ab  = GameObject.Find("Database_Armor").GetComponent <Armor_Database>();
         var            abi = ab.GetIcon(item_Id, itemQuality);
         Debug.Log(item_Id);
         icon = abi.image;
     }
     else if (itemType == ItemTypes.Monster)
     {
         Miscellaneous_Database mb = GameObject.Find("Database_Miscellaneous").GetComponent <Miscellaneous_Database>();
         icon = mb.GetIcon(item_Id);
     }
     else if (itemType == ItemTypes.Potion)
     {
         Potion_Database pb = GameObject.Find("Database_Potion").GetComponent <Potion_Database>();
         icon = pb.GetIcon(item_Id);
     }
     else if (itemType == ItemTypes.Quest)
     {
     }
     else if (itemType == ItemTypes.Weapon)
     {
         Weapon_Database wb = GameObject.Find("Database_Weapon").GetComponent <Weapon_Database>();
         icon = wb.GetIcon(item_Id, itemQuality);
     }
     else if (itemType == ItemTypes.Food)
     {
         Food_Database fb = GameObject.Find("Database_Food").GetComponent <Food_Database>();
         icon = fb.GetIcon(item_Id);
     }
 }