public static int GetItemBonus(Character chr, ItemBonusMode mode, ItemBonusType bonus)
    {
        switch (mode)
        {
        case ItemBonusMode.ITEM:
            return(GetItemBonus(chr, bonus));

        case ItemBonusMode.ABP:
            return(GetAPB(chr, bonus));

        default:
            return(0);
        }
    }
Exemple #2
0
        public int GetItemBonusFromEquippedItems(List <Item> equippedItems, ItemBonusType bonus)
        {
            float itemBonuses = 0;

            foreach (Item item in equippedItems)
            {
                switch (bonus)
                {
                case ItemBonusType.Accuracy:
                    itemBonuses += item.AccuracyBonus;
                    break;

                case ItemBonusType.Strength:
                    itemBonuses += item.StrengthBonus;
                    break;

                case ItemBonusType.Defence:
                    itemBonuses += item.DefenceBonus;
                    break;
                }
            }
            Debug.Log("Returning " + itemBonuses + " for BonusType: " + bonus);
            return((int)itemBonuses);
        }
 public void SetBonuses(ItemBonusType[] bonuses)
 {
     _itemBonuses = bonuses;
 }
 private void ApplyItemBonus(ItemBonusType bonusType, float bonusAmount)
 {
     switch(bonusType)
     {
     case ItemBonusType.PlusAgility:
         _agilityActive += (int) bonusAmount;
         break;
     case ItemBonusType.PlusMagic:
         _magicActive += (int) bonusAmount;
         break;
     case ItemBonusType.PlusMaxHP:
         _maxHPActive += (int) bonusAmount;
         break;
     case ItemBonusType.PlusSpeed:
         _movespeedActive += (bonusAmount);
         break;
     case ItemBonusType.PlusStrength:
         _strengthActive += (int) bonusAmount;
         break;
     }
 }
    private static int GetAPB(Character chr, ItemBonusType bonus)
    {
        switch (bonus)
        {
        case ItemBonusType.WEAPON:
            if (chr.level < 2)
            {
                return(0);
            }
            if (chr.level < 10)
            {
                return(1);
            }
            if (chr.level < 16)
            {
                return(2);
            }
            return(3);

        case ItemBonusType.ARMOR:
        case ItemBonusType.HEAVY_ARMOR:
            if (chr.level < 5)
            {
                return(0);
            }
            if (chr.level < 11)
            {
                return(1);
            }
            if (chr.level < 18)
            {
                return(2);
            }
            return(3);

        case ItemBonusType.SKILL_BEST:
            if (chr.level < 3)
            {
                return(0);
            }
            if (chr.level < 9)
            {
                return(1);
            }
            if (chr.level < 17)
            {
                return(2);
            }
            return(3);

        case ItemBonusType.SKILL_DECENT:
            if (chr.level < 6)
            {
                return(0);
            }
            if (chr.level < 13)
            {
                return(1);
            }
            if (chr.level < 20)
            {
                return(2);
            }
            return(3);

        case ItemBonusType.SKILL_LOWEST:
            if (chr.level < 17)
            {
                return(0);
            }
            return(1);

        case ItemBonusType.PERCEPTION:
            if (chr.level < 7)
            {
                return(0);
            }
            if (chr.level < 13)
            {
                return(1);
            }
            if (chr.level < 19)
            {
                return(2);
            }
            return(3);

        case ItemBonusType.ATTRIBUTE:
            if (chr.level < 17)
            {
                return(0);
            }
            return(1);

        case ItemBonusType.SPELLDC:
            return(0);

        case ItemBonusType.SAVING_THROWS:
            if (chr.level < 8)
            {
                return(0);
            }
            if (chr.level < 14)
            {
                return(1);
            }
            if (chr.level < 20)
            {
                return(2);
            }
            return(3);
        }
        return(0);
    }
 private static int GetItemBonus(Character chr, ItemBonusType bonus)
 {
     return(GetAPB(chr, bonus));       //TODO
 }