protected void SetData(EquipItemInfo item, SkillSlotUIData[] slot_data, bool is_show_main_status, int equipping_sp_index)
    {
        SetEquipIndexSprite(equipping_sp_index);
        SetFavorite(item.isFavorite);
        SetIconStatusSprite(ItemIconDetail.ICON_STATUS.NONE);
        bool flag = item.tableData.IsWeapon();

        if (flag)
        {
            SetElement(item.GetTargetElement(), item.elemAtk, true);
        }
        else
        {
            int num = item.elemDef;
            if (item.tableData.isFormer)
            {
                num = Mathf.FloorToInt((float)num * 0.1f);
            }
            SetElement(item.GetTargetElement(), num, false);
        }
        if (is_show_main_status)
        {
            infoRootAry[1].SetActive(true);
            infoRootAry[2].SetActive(false);
            SetVisibleBG(true);
            SetName(item.tableData.name);
            SetLevel(item.level, item.tableData.maxLv, item.tableData.IsVisual());
            SetEquipValue(flag, (!flag) ? item.def : item.atk);
        }
        else
        {
            infoRootAry[1].SetActive(false);
            infoRootAry[2].SetActive(true);
            SetVisibleBG(true);
            SetName(item.tableData.name);
            bool enabled = true;
            EquipItemAbility[] ability = item.ability;
            objAbilityRoot.GetComponentsInChildren <UILabel>(Temporary.uiLabelList);
            int i = 0;
            for (int count = Temporary.uiLabelList.Count; i < count; i++)
            {
                UILabel uILabel = Temporary.uiLabelList[i];
                uILabel.set_enabled(i < ability.Length && ability[i].id != 0 && ability[i].ap > 0);
                if (uILabel.get_enabled())
                {
                    uILabel.text = ability[i].GetNameAndAP();
                    enabled      = false;
                }
            }
            Temporary.uiLabelList.Clear();
            lblNonAbility.set_enabled(enabled);
        }
    }
コード例 #2
0
    private void CalcEquipAttachSkillStatus(EquipItemInfo item, out int atk, out int def, out int hp)
    {
        int tmp_atk = 0;
        int tmp_def = 0;
        int tmp_hp  = 0;

        if (item != null)
        {
            SkillSlotUIData[] skillSlotData = GetSkillSlotData(item);
            if (skillSlotData != null)
            {
                int index;
                Array.ForEach(skillSlotData, delegate(SkillSlotUIData data)
                {
                    if (data != null && data.slotData.skill_id != 0)
                    {
                        ELEMENT_TYPE targetElement = item.GetTargetElement();
                        int elem_atk = 0;
                        if (item.tableData.IsWeapon())
                        {
                            switch (targetElement)
                            {
                            default:
                                elem_atk = data.itemData.atkList[(int)(targetElement + 1)];
                                break;

                            case ELEMENT_TYPE.MULTI:
                                index = 0;
                                data.itemData.atkList.ForEach(delegate(int _elem_atk)
                                {
                                    if (index > 0)
                                    {
                                        elem_atk += _elem_atk;
                                    }
                                    index++;
                                });
                                break;

                            case ELEMENT_TYPE.MAX:
                                break;
                            }
                        }
                        tmp_atk += data.itemData.atk + elem_atk;
                        tmp_def += data.itemData.def;
                        tmp_hp  += data.itemData.hp;
                    }
                });
            }
        }
        atk = tmp_atk;
        def = tmp_def;
        hp  = tmp_hp;
    }
コード例 #3
0
    protected void Set(EquipItemInfo item, SkillSlotUIData[] slot_data, bool is_show_main_status, int equipping_sp_index)
    {
        //IL_0142: Unknown result type (might be due to invalid IL or missing references)
        //IL_0153: Unknown result type (might be due to invalid IL or missing references)
        //IL_0164: Unknown result type (might be due to invalid IL or missing references)
        //IL_017e: Unknown result type (might be due to invalid IL or missing references)
        //IL_019b: Unknown result type (might be due to invalid IL or missing references)
        //IL_01a2: Unknown result type (might be due to invalid IL or missing references)
        //IL_022f: Unknown result type (might be due to invalid IL or missing references)
        //IL_025e: Unknown result type (might be due to invalid IL or missing references)
        SetEquipIndexSprite(equipping_sp_index);
        SetFavorite(item.isFavorite);
        bool flag = item.tableData.IsWeapon();

        if (flag)
        {
            SetElement(item.GetTargetElement(), item.elemAtk, true);
        }
        else
        {
            int num = item.elemDef;
            if (item.tableData.isFormer)
            {
                num = Mathf.FloorToInt((float)num * 0.1f);
            }
            SetElement(item.GetTargetElement(), num, false);
        }
        if (is_show_main_status)
        {
            infoRootAry[2].SetActive(true);
            infoRootAry[3].SetActive(false);
            SetVisibleBG(true);
            SetName(item.tableData.name);
            SetLevel(item.level, item.tableData.maxLv, item.tableData.IsVisual());
            SetEquipValue(flag, (!flag) ? item.def : item.atk);
        }
        else
        {
            infoRootAry[2].SetActive(false);
            infoRootAry[3].SetActive(true);
            SetVisibleBG(false);
            SetName(string.Empty);
            int  num2  = (slot_data != null && slot_data.Length > 0) ? slot_data.Length : 0;
            bool flag2 = num2 > 0;
            spSkillBG.get_gameObject().SetActive(flag2);
            grdSkillRoot.get_gameObject().SetActive(flag2);
            lblNonSkillSlot.get_gameObject().SetActive(!flag2);
            if (flag2)
            {
                int childCount = grdSkillRoot.get_transform().get_childCount();
                for (int i = 0; i < childCount; i++)
                {
                    bool     flag3     = false;
                    UISprite component = grdSkillRoot.get_transform().GetChild(i).GetComponent <UISprite>();
                    if (i < num2 && component != null && slot_data[i] != null && slot_data[i].slotData != null)
                    {
                        flag3 = true;
                    }
                    if (flag3)
                    {
                        bool is_attached = slot_data[i].itemData != null && slot_data[i].itemData.isAttached && slot_data[i].itemData.tableData.type == slot_data[i].slotData.slotType;
                        component.get_gameObject().SetActive(true);
                        component.spriteName = UIBehaviour.GetSkillIconSpriteName(slot_data[i].slotData.slotType, is_attached, false);
                    }
                    else
                    {
                        component.get_gameObject().SetActive(false);
                        component.spriteName = string.Empty;
                    }
                }
            }
            grdSkillRoot.Reposition();
            bool enabled = true;
            EquipItemAbility[] ability = item.ability;
            objAbilityRoot.GetComponentsInChildren <UILabel>(Temporary.uiLabelList);
            int j = 0;
            for (int count = Temporary.uiLabelList.Count; j < count; j++)
            {
                UILabel uILabel = Temporary.uiLabelList[j];
                uILabel.set_enabled(j < ability.Length && ability[j].id != 0 && ability[j].ap > 0);
                if (uILabel.get_enabled())
                {
                    uILabel.text = ability[j].GetNameAndAP();
                    enabled      = false;
                }
            }
            Temporary.uiLabelList.Clear();
            lblNonAbility.set_enabled(enabled);
        }
    }