Ejemplo n.º 1
0
        void LoadWeaponItem(ResourcesManager resManager, IconBase icon)
        {
            ItemInventoryInstance invInstance = session.GetWeaponItem(icon.id);
            string      weaponID    = invInstance.itemId;
            WeaponStats weaponStats = resManager.GetWeaponStats(weaponID);
            Item        item        = resManager.GetItem(weaponID, Itemtype.Weapon);

            equipment_Left.currentItem.text = item.name_item;

            //Update Center Overlay UI Panel
            UpdateCenterOverlay(item);
            center_Overlay.skillName.text = weaponStats.skillName;

            //Center Main UI
            weaponInfo.smallIcon.sprite = item.itemIcon;
            weaponInfo.itemName.text    = item.name_item;
            weaponInfo.weaponType.text  = weaponStats.weaponType;
            weaponInfo.damageType.text  = weaponStats.damageType;
            weaponInfo.skillName.text   = weaponStats.skillName;
            weaponInfo.weightCost.text  = weaponStats.weightCost.ToString();

            //Update the min durability!!!
            weaponInfo.durability_Min.text = weaponInfo.durability_Max.ToString();
            weaponInfo.durability_Max.text = weaponInfo.durability_Max.ToString();

            //Attack Power
            UpdateAttackDefenseUIElement(weaponInfo.attackPowerSlots, AttackDefenseType.Physical, weaponStats.attackPhysical.ToString());
            UpdateAttackDefenseUIElement(weaponInfo.attackPowerSlots, AttackDefenseType.Magic, weaponStats.attackMagic.ToString());
            UpdateAttackDefenseUIElement(weaponInfo.attackPowerSlots, AttackDefenseType.Fire, weaponStats.attackFire.ToString());
            UpdateAttackDefenseUIElement(weaponInfo.attackPowerSlots, AttackDefenseType.Lightning, weaponStats.attackLigthning.ToString());
            UpdateAttackDefenseUIElement(weaponInfo.attackPowerSlots, AttackDefenseType.Dark, weaponStats.attackDark.ToString());
            UpdateAttackDefenseUIElement(weaponInfo.attackPowerSlots, AttackDefenseType.Critical, weaponStats.attackCritical.ToString());

            UpdateAttackDefenseUIElement(weaponInfo.additionalEffects, AttackDefenseType.Frost, weaponStats.attackFrost.ToString(), true);
            UpdateAttackDefenseUIElement(weaponInfo.additionalEffects, AttackDefenseType.Curse, weaponStats.attackCurse.ToString(), true);
            //UpdateAttackDefenseUIElement(weaponInfo.additionalEffects, AttackDefenseType.Poison, weaponStats.poisonDamage.ToString());
            //UpdateAttackDefenseUIElement(weaponInfo.additionalEffects, AttackDefenseType.Bleed, weaponStats.frostDamage.ToString(), true);

            //Guard Absorptions
            UpdateAttackDefenseUIElement(weaponInfo.guardAbsorptions, AttackDefenseType.Physical, weaponStats.defensePhysical.ToString());
            UpdateAttackDefenseUIElement(weaponInfo.guardAbsorptions, AttackDefenseType.Magic, weaponStats.defenseMagic.ToString());
            UpdateAttackDefenseUIElement(weaponInfo.guardAbsorptions, AttackDefenseType.Fire, weaponStats.defenseFire.ToString());
            UpdateAttackDefenseUIElement(weaponInfo.guardAbsorptions, AttackDefenseType.Lightning, weaponStats.defenseLigthning.ToString());
            UpdateAttackDefenseUIElement(weaponInfo.guardAbsorptions, AttackDefenseType.Dark, weaponStats.defenseDark.ToString());
            UpdateAttackDefenseUIElement(weaponInfo.guardAbsorptions, AttackDefenseType.Dark, weaponStats.defenseDark.ToString());
            UpdateAttackDefenseUIElement(weaponInfo.guardAbsorptions, AttackDefenseType.Stability, weaponStats.defenseStability.ToString());
        }
Ejemplo n.º 2
0
        void UpdateItemSlotInfo(ResourcesManager resManager, IconBase iconBase, Itemtype itemtype)
        {
            ItemInventoryInstance invInstance = null;

            if (!centerOverlayIsOpen)
            {
                centerOverlay.SetActive(false);
            }

            centerOverlay.SetActive(false);

            switch (itemtype)
            {
            case Itemtype.Spell:
                break;

            case Itemtype.Consumable:
                invInstance = session.GetConsumableItem(iconBase.id);
                centerOverlay.SetActive(true);
                break;

            case Itemtype.Equipment:
                //invInstance = session.GetArmorItem(iconBase.id);
                centerOverlay.SetActive(true);
                break;

            default:
                break;
            }

            string itemID = invInstance.itemId;
            Item   item   = resManager.GetItem(itemID, itemtype);

            UpdateCenterOverlay(item);
            equipment_Left.currentItem.text = item.name_item;
        }