public int GetEquipTypeAtkBuf(EquipItemInfo item) { int equipmentTypeIndex = MonoBehaviourSingleton <StatusManager> .I.GetEquipmentTypeIndex(item.tableData.type); int elemAtkType = item.GetElemAtkType(); int num = 0; ItemStatus itemStatus = equipTypeBuff[equipmentTypeIndex]; num += itemStatus.atk; switch (elemAtkType) { case -1: { int i = 0; for (int num2 = itemStatus.elemAtk.Length; i < num2; i++) { num += itemStatus.elemAtk[i]; } break; } default: num += itemStatus.elemAtk[elemAtkType]; break; case 6: break; } return(num); }
private void SetLabelEquipItemParam(EquipItemInfo item, EquipItemInfo comp_item = null) { int atk = item.atk; int def = item.def; int elemAtk = item.elemAtk; int elemDef = item.elemDef; if (comp_item != null) { atk = comp_item.atk; def = comp_item.def; elemAtk = comp_item.elemAtk; elemDef = comp_item.elemDef; } bool flag = item.tableData.IsWeapon(); SetActive((Enum)UI.OBJ_ATK_ROOT, flag); SetActive((Enum)UI.OBJ_DEF_ROOT, !flag); SetLabelText((Enum)UI.LBL_LV_NOW, item.level.ToString()); SetLabelText((Enum)UI.LBL_LV_MAX, item.tableData.maxLv.ToString()); if (flag) { SetActive((Enum)UI.OBJ_ELEM_ROOT, item.elemAtk > 0); SetElementSprite((Enum)UI.SPR_ELEM, item.GetElemAtkType()); SetLabelCompareParam((Enum)UI.LBL_ATK, item.atk, atk, -1); SetLabelCompareParam((Enum)UI.LBL_ELEM, item.elemAtk, elemAtk, -1); } else { SetActive((Enum)UI.OBJ_ELEM_ROOT, item.elemDef > 0); SetDefElementSprite((Enum)UI.SPR_ELEM, item.GetElemDefType()); SetLabelCompareParam((Enum)UI.LBL_DEF, item.def, def, -1); SetLabelCompareParam((Enum)UI.LBL_ELEM, item.elemDef, elemDef, -1); } }
public int GetElemAtk(EquipItemInfo item) { if (item == null) { return(0); } int elemAtkType = item.GetElemAtkType(); if (elemAtkType == -1) { return(0); } return(_GetElem(elemAtkType, elemAtk)); }
private void EquipParam(EquipItemInfo item) { EquipItemTable.EquipItemData equipItemData = item?.tableData; if (item != null && equipItemData != null) { bool flag = item.tableData.IsVisual(); SetLabelText(detailBase, UI.LBL_NAME, equipItemData.name); SetActive(detailBase, UI.STR_LV, !flag); SetActive(detailBase, UI.STR_ONLY_VISUAL, flag); SetLabelText(detailBase, UI.LBL_LV_NOW, item.level.ToString()); SetLabelText(detailBase, UI.LBL_LV_MAX, equipItemData.maxLv.ToString()); SetLabelText(detailBase, UI.LBL_ATK, item.atk.ToString()); SetLabelText(detailBase, UI.LBL_ELEM, item.elemAtk.ToString()); SetElementSprite(detailBase, UI.SPR_ELEM, item.GetElemAtkType()); SetLabelText(detailBase, UI.LBL_DEF, item.def.ToString()); int num = item.elemDef; if (equipItemData.isFormer) { num = Mathf.FloorToInt((float)num * 0.1f); } SetLabelText(detailBase, UI.LBL_ELEM_DEF, num.ToString()); SetDefElementSprite(detailBase, UI.SPR_ELEM_DEF, item.GetElemDefType()); SetLabelText(detailBase, UI.LBL_HP, item.hp.ToString()); SetLabelText(detailBase, UI.LBL_SELL, item.sellPrice.ToString()); SetActive(detailBase, UI.OBJ_FAVORITE_ROOT, (callSection & (CURRENT_SECTION.QUEST_RESULT | CURRENT_SECTION.EQUIP_LIST)) == CURRENT_SECTION.NONE); SetActive(detailBase, UI.SPR_IS_EVOLVE, item.tableData.IsEvolve()); SetEquipmentTypeIcon(detailBase, UI.SPR_TYPE_ICON, UI.SPR_TYPE_ICON_BG, UI.SPR_TYPE_ICON_RARITY, item.tableData); SetRenderEquipModel((Enum)UI.TEX_MODEL, equipItemData.id, sex, faceID, 1f); ResetTween(detailBase, UI.TWN_FAVORITE, 0); ResetTween(detailBase, UI.TWN_UNFAVORITE, 0); SetActive(detailBase, UI.TWN_UNFAVORITE, !item.isFavorite); SetActive(detailBase, UI.TWN_FAVORITE, item.isFavorite); bool flag2 = !item.IsLevelMax() || !item.IsExceedMax() || item.tableData.IsEvolve() || item.tableData.IsShadow(); SetActive((Enum)UI.BTN_GROW, flag2 && CanSmithSection(callSection)); SetActive((Enum)UI.BTN_GROW_OFF, !flag2 && CanSmithSection(callSection)); } else { NotDataEquipParam(); } }
protected override void EquipParam() { int num = Mathf.Min(aimLv, GetEquipData().tableData.maxLv); EquipItemInfo equipData = GetEquipData(); EquipItemTable.EquipItemData tableData = equipData.tableData; GrowEquipItemTable.GrowEquipItemData growEquipItemData = Singleton<GrowEquipItemTable>.I.GetGrowEquipItemData(tableData.growID, (uint)num); if (equipData != null && tableData != null) { SetLabelText(detailBase, UI.LBL_NAME, tableData.name); SetLabelText(detailBase, UI.LBL_LV_MAX, tableData.maxLv.ToString()); SetLabelCompareParam(detailBase, UI.LBL_LV_NOW, num, equipData.level, -1); SetEquipmentTypeIcon(detailBase, UI.SPR_TYPE_ICON, UI.SPR_TYPE_ICON_BG, UI.SPR_TYPE_ICON_RARITY, equipData.tableData); if (growEquipItemData != null) { EquipItemExceedParamTable.EquipItemExceedParamAll equipItemExceedParamAll = equipData.tableData.GetExceedParam((uint)equipData.exceed); if (equipItemExceedParamAll == null) { equipItemExceedParamAll = new EquipItemExceedParamTable.EquipItemExceedParamAll(); } int num2 = growEquipItemData.GetGrowParamAtk(equipData.tableData.baseAtk) + (int)equipItemExceedParamAll.atk; int[] growParamElemAtk = growEquipItemData.GetGrowParamElemAtk(equipData.tableData.atkElement); int i = 0; for (int num3 = growParamElemAtk.Length; i < num3; i++) { growParamElemAtk[i] += equipItemExceedParamAll.atkElement[i]; } int num4 = Mathf.Max(growParamElemAtk); SetElementSprite(detailBase, UI.SPR_ELEM, equipData.GetElemAtkType()); SetLabelText(detailBase, UI.LBL_ATK, equipData.atk.ToString()); SetActive(detailBase, UI.LBL_AFTER_ATK, num2 > equipData.atk); SetStatusBuffText(detailBase, UI.LBL_AFTER_ATK, num2 - equipData.atk, false); SetLabelText(detailBase, UI.LBL_ELEM, equipData.elemAtk.ToString()); SetActive(detailBase, UI.LBL_AFTER_ELEM, num4 > equipData.elemAtk); SetStatusBuffText(detailBase, UI.LBL_AFTER_ELEM, num4 - equipData.elemAtk, false); int num5 = growEquipItemData.GetGrowParamDef(equipData.tableData.baseDef) + (int)equipItemExceedParamAll.def; int[] growParamElemDef = growEquipItemData.GetGrowParamElemDef(equipData.tableData.defElement); int j = 0; for (int num6 = growParamElemDef.Length; j < num6; j++) { growParamElemDef[j] += equipItemExceedParamAll.defElement[j]; } int num7 = Mathf.Max(growParamElemDef); SetDefElementSprite(detailBase, UI.SPR_ELEM_DEF, equipData.GetElemDefType()); SetLabelText(detailBase, UI.LBL_DEF, equipData.def.ToString()); SetActive(detailBase, UI.LBL_AFTER_DEF, num5 > equipData.def); SetStatusBuffText(detailBase, UI.LBL_AFTER_DEF, num5 - equipData.def, false); int num8 = equipData.elemDef; if (equipData.tableData.isFormer) { num8 = Mathf.FloorToInt((float)num8 * 0.1f); } SetLabelText(detailBase, UI.LBL_ELEM_DEF, num8.ToString()); SetActive(detailBase, UI.LBL_AFTER_ELEM_DEF, num7 > num8); SetStatusBuffText(detailBase, UI.LBL_AFTER_ELEM_DEF, num7 - num8, false); int num9 = growEquipItemData.GetGrowParamHp(equipData.tableData.baseHp) + (int)equipItemExceedParamAll.hp; SetLabelText(detailBase, UI.LBL_HP, equipData.hp.ToString()); SetActive(detailBase, UI.LBL_AFTER_HP, num9 > equipData.hp); SetStatusBuffText(detailBase, UI.LBL_AFTER_HP, num9 - equipData.hp, false); } else { int atk = equipData.atk; int elemAtk = equipData.elemAtk; SetElementSprite(detailBase, UI.SPR_ELEM, equipData.GetElemAtkType()); SetLabelText(detailBase, UI.LBL_ATK, atk.ToString()); SetLabelText(detailBase, UI.LBL_ELEM, elemAtk.ToString()); SetActive(detailBase, UI.LBL_AFTER_ATK, false); SetActive(detailBase, UI.LBL_AFTER_ELEM, false); int def = equipData.def; int elemDef = equipData.elemDef; SetDefElementSprite(detailBase, UI.SPR_ELEM_DEF, equipData.GetElemDefType()); SetLabelText(detailBase, UI.LBL_DEF, def.ToString()); SetLabelText(detailBase, UI.LBL_ELEM_DEF, elemDef.ToString()); SetActive(detailBase, UI.LBL_AFTER_DEF, false); SetActive(detailBase, UI.LBL_AFTER_ELEM_DEF, false); int hp = equipData.hp; SetLabelText(detailBase, UI.LBL_HP, hp.ToString()); SetActive(detailBase, UI.LBL_AFTER_HP, false); } } }
protected override void EquipParam() { EquipItemInfo compareItemData = GetCompareItemData(); EquipItemInfo select_item = EquipItem; EquipSetInfo equipSetInfo = new EquipSetInfo(selectEquipSetData.equipSetInfo.item, selectEquipSetData.equipSetInfo.name, selectEquipSetData.equipSetInfo.showHelm); bool flag = false; int num = Array.FindIndex(selectEquipSetData.equipSetInfo.item, (EquipItemInfo item) => item != null && select_item != null && item.uniqueID == select_item.uniqueID); if (num != -1) { flag = true; } if (!flag) { equipSetInfo.item[selectEquipSetData.index] = select_item; } else { equipSetInfo.item[num] = compareItemData; equipSetInfo.item[selectEquipSetData.index] = select_item; } MonoBehaviourSingleton <StatusManager> .I.CalcSelfStatusParam(equipSetInfo, out int _atk, out int _def, out int _hp, out int _, out int _); SetLabelText((Enum)UI.LBL_STATUS_ATK, _atk.ToString()); SetLabelText((Enum)UI.LBL_STATUS_DEF, _def.ToString()); SetLabelText((Enum)UI.LBL_STATUS_HP, _hp.ToString()); int atk = 0; int def = 0; int hp = 0; int atk2 = 0; int def2 = 0; int hp2 = 0; if (!flag) { CalcEquipAttachSkillStatus(compareItemData, out atk, out def, out hp); CalcEquipAttachSkillStatus(select_item, out atk2, out def2, out hp2); } else { atk += atk2; def += def2; hp += hp2; atk2 = atk; def2 = def; hp2 = hp; } if (selectEquipSetData.index != 1 && selectEquipSetData.index != 2) { int num2 = (compareItemData != null) ? (compareItemData.atk + compareItemData.elemAtk + atk) : 0; int num3 = (select_item != null) ? (select_item.atk + select_item.elemAtk + atk2) : 0; int num4 = num3 - num2; string format = (num4 <= 0) ? "{0}" : base.sectionData.GetText("DISP_PLUS"); SetLabelCompareParam((Enum)UI.LBL_STATUS_ADD_ATK, num3, num2, string.Format(format, num4)); SetActive((Enum)UI.LBL_STATUS_ADD_ATK, num4 != 0); int num5 = (compareItemData != null) ? (compareItemData.def + def) : 0; int num6 = (select_item != null) ? (select_item.def + def2) : 0; int num7 = num6 - num5; string format2 = (num7 <= 0) ? "{0}" : base.sectionData.GetText("DISP_PLUS"); SetLabelCompareParam((Enum)UI.LBL_STATUS_ADD_DEF, num6, num5, string.Format(format2, num7)); SetActive((Enum)UI.LBL_STATUS_ADD_DEF, num7 != 0); int num8 = (compareItemData != null) ? (compareItemData.hp + hp) : 0; int num9 = (select_item != null) ? (select_item.hp + hp2) : 0; int num10 = num9 - num8; string format3 = (num10 <= 0) ? "{0}" : base.sectionData.GetText("DISP_PLUS"); SetLabelCompareParam((Enum)UI.LBL_STATUS_ADD_HP, num9, num8, string.Format(format3, num10)); SetActive((Enum)UI.LBL_STATUS_ADD_HP, num10 != 0); } else { int num11 = atk; int num12 = atk2; int num13 = num12 - num11; string format4 = (num13 <= 0) ? "{0}" : base.sectionData.GetText("DISP_PLUS"); SetLabelCompareParam((Enum)UI.LBL_STATUS_ADD_ATK, num12, num11, string.Format(format4, num13)); SetActive((Enum)UI.LBL_STATUS_ADD_ATK, num13 != 0); int num14 = def; int num15 = def2; int num16 = num15 - num14; string format5 = (num16 <= 0) ? "{0}" : base.sectionData.GetText("DISP_PLUS"); SetLabelCompareParam((Enum)UI.LBL_STATUS_ADD_DEF, num15, num14, string.Format(format5, num16)); SetActive((Enum)UI.LBL_STATUS_ADD_DEF, num16 != 0); int num17 = hp; int num18 = hp2; int num19 = num18 - num17; string format6 = (num19 <= 0) ? "{0}" : base.sectionData.GetText("DISP_PLUS"); SetLabelCompareParam((Enum)UI.LBL_STATUS_ADD_HP, num18, num17, string.Format(format6, num19)); SetActive((Enum)UI.LBL_STATUS_ADD_HP, num19 != 0); } SetActive((Enum)UI.OBJ_SELL_ROOT, false); if (select_item == null) { string text = base.sectionData.GetText("NON_DATA"); if (compareItemData != null) { if (compareItemData.tableData.IsWeapon()) { SetActive((Enum)UI.OBJ_ELEM_ROOT, compareItemData.elemAtk > 0); SetElementSprite((Enum)UI.SPR_ELEM, compareItemData.GetElemAtkType()); SetLabelCompareParam((Enum)UI.LBL_ATK, -compareItemData.atk, 0, 0); SetLabelCompareParam((Enum)UI.LBL_ELEM, -compareItemData.elemAtk, 0, 0); } else { SetActive((Enum)UI.OBJ_ELEM_ROOT, compareItemData.elemDef > 0); SetDefElementSprite((Enum)UI.SPR_ELEM, compareItemData.GetElemDefType()); SetLabelCompareParam((Enum)UI.LBL_DEF, -compareItemData.def, 0, 0); SetLabelCompareParam((Enum)UI.LBL_ELEM, -compareItemData.elemDef, 0, 0); } } else { bool flag2 = selectEquipSetData.index < 3; SetLabelCompareParam((Enum)UI.LBL_ATK, 0, 0, -1); SetLabelCompareParam((Enum)UI.LBL_DEF, 0, 0, -1); SetActive((Enum)UI.OBJ_ATK_ROOT, flag2); SetActive((Enum)UI.OBJ_DEF_ROOT, !flag2); SetActive((Enum)UI.OBJ_ELEM_ROOT, false); } SetLabelText((Enum)UI.LBL_NAME, base.sectionData.GetText("EMPTY")); SetLabelCompareParam((Enum)UI.LBL_LV_NOW, 0, 0, text); SetLabelCompareParam((Enum)UI.LBL_LV_MAX, 0, 0, text); SetActive((Enum)UI.OBJ_SKILL_BUTTON_ROOT, false); SetActive((Enum)UI.TBL_ABILITY, false); SetActive((Enum)UI.STR_NON_ABILITY, false); SetActive((Enum)UI.SPR_IS_EVOLVE, false); SetEquipmentTypeIcon((Enum)UI.SPR_TYPE_ICON, (Enum)UI.SPR_TYPE_ICON_BG, (Enum)UI.SPR_TYPE_ICON_RARITY, (EquipItemTable.EquipItemData)null); } else { SetActive((Enum)UI.TBL_ABILITY, true); base.EquipParam(); } }
protected override void ResultEquipInfo() { if (resultData.itemData != null) { EquipItemInfo item = resultData.itemData as EquipItemInfo; EquipItemTable.EquipItemData tableData = item.tableData; bool flag = tableData.IsVisual(); SetActive(detailBase, UI.BTN_SELL, false); SetActive(detailBase, UI.BTN_GROW, false); SetActive(detailBase, UI.BTN_GRAY, false); SetActive(detailBase, UI.OBJ_FAVORITE_ROOT, false); SetActive(detailBase, UI.SPR_IS_EVOLVE, item.tableData.IsEvolve()); SetActive(detailBase, UI.STR_LV, !flag); SetActive(detailBase, UI.STR_ONLY_VISUAL, flag); SetupBottomButton(); SetLabelText(detailBase, UI.LBL_NAME, tableData.name); SetLabelText(detailBase, UI.LBL_LV_MAX, tableData.maxLv.ToString()); SetSprite(detailBase, UI.SPR_SP_ATTACK_TYPE, (!tableData.IsWeapon()) ? string.Empty : tableData.spAttackType.GetBigFrameSpriteName()); if (smithType == SmithType.GROW) { string text = base.sectionData.GetText("STATUS_DIFF_FORMAT"); SetLabelCompareParam(detailBase, UI.LBL_LV_NOW, item.level, resultData.beforeLevel, -1); SetLabelDiffParam(detailBase, UI.LBL_AFTER_ATK, item.atk, UI.LBL_DIFF_ATK, resultData.beforeAtk, UI.LBL_ATK, text); SetLabelDiffParam(detailBase, UI.LBL_AFTER_DEF, item.def, UI.LBL_DIFF_DEF, resultData.beforeDef, UI.LBL_DEF, text); SetLabelDiffParam(detailBase, UI.LBL_AFTER_HP, item.hp, UI.LBL_DIFF_HP, resultData.beforeHp, UI.LBL_HP, text); SetLabelDiffParam(detailBase, UI.LBL_AFTER_ELEM, item.elemAtk, UI.LBL_DIFF_ELEM, resultData.beforeElemAtk, UI.LBL_ELEM, text); SetDiffElementSprite(detailBase, item.GetElemAtkType(), resultData.beforeElemAtk, item.elemAtk, UI.SPR_ELEM, UI.SPR_DIFF_ELEM, true); int num = item.elemDef; int num2 = resultData.beforeElemDef; if (item.tableData.isFormer) { num = Mathf.FloorToInt((float)num * 0.1f); num2 = Mathf.FloorToInt((float)num2 * 0.1f); } SetLabelDiffParam(detailBase, UI.LBL_AFTER_ELEM_DEF, num, UI.LBL_DIFF_ELEM_DEF, num2, UI.LBL_ELEM_DEF, text); SetDiffElementSprite(detailBase, item.GetElemDefType(), resultData.beforeElemDef, item.elemDef, UI.SPR_ELEM_DEF, UI.SPR_DIFF_ELEM_DEF, false); } else { SetLabelText(detailBase, UI.LBL_LV_NOW, item.level.ToString()); SetLabelText(detailBase, UI.LBL_ATK, item.atk.ToString()); SetLabelText(detailBase, UI.LBL_DEF, item.def.ToString()); SetLabelText(detailBase, UI.LBL_HP, item.hp.ToString()); SetLabelText(detailBase, UI.LBL_ELEM, item.elemAtk.ToString()); SetElementSprite(detailBase, UI.SPR_ELEM, item.GetElemAtkType()); int num3 = item.elemDef; if (item.tableData.isFormer) { num3 = Mathf.FloorToInt((float)num3 * 0.1f); } SetLabelText(detailBase, UI.LBL_ELEM_DEF, num3.ToString()); SetDefElementSprite(detailBase, UI.SPR_ELEM_DEF, item.GetElemDefType()); } SetSkillIconButton(detailBase, UI.OBJ_SKILL_BUTTON_ROOT, "SkillIconButton", item.tableData, GetSkillSlotData(item), "SKILL_ICON_BUTTON", 0); SetLabelText(detailBase, UI.LBL_SELL, tableData.sale.ToString()); SetEquipmentTypeIcon(detailBase, UI.SPR_TYPE_ICON, UI.SPR_TYPE_ICON_BG, UI.SPR_TYPE_ICON_RARITY, item.tableData); AbilityItemInfo abilityItem = item.GetAbilityItem(); bool flag2 = abilityItem != null; if ((item.ability != null && item.ability.Length > 0) || flag2) { bool empty_ability = true; string allAbilityName = string.Empty; string allAp = string.Empty; string allAbilityDesc = string.Empty; SetTable(detailBase, UI.TBL_ABILITY, "ItemDetailEquipAbilityItem", item.ability.Length + (flag2 ? 1 : 0), false, delegate(int i, Transform t, bool is_recycle) { //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Expected O, but got Unknown if (i < item.ability.Length) { EquipItemAbility equipItemAbility = item.ability[i]; if (equipItemAbility.id == 0) { SetActive(t, false); } else { empty_ability = false; SetActive(t, true); if (equipItemAbility.IsNeedUpdate()) { SetActive(t, UI.OBJ_ABILITY, false); SetActive(t, UI.OBJ_FIXEDABILITY, false); SetActive(t, UI.OBJ_NEED_UPDATE_ABILITY, true); SetButtonEnabled(t, false); } else if (item.IsFixedAbility(i)) { SetActive(t, UI.OBJ_ABILITY, false); SetActive(t, UI.OBJ_FIXEDABILITY, true); SetLabelText(t, UI.LBL_FIXEDABILITY, equipItemAbility.GetName()); SetLabelText(t, UI.LBL_FIXEDABILITY_NUM, equipItemAbility.GetAP()); } else { SetLabelText(t, UI.LBL_ABILITY, equipItemAbility.GetName()); SetLabelText(t, UI.LBL_ABILITY_NUM, equipItemAbility.GetAP()); } SetAbilityItemEvent(t, i, touchAndReleaseButtons); allAbilityName += equipItemAbility.GetName(); allAp += equipItemAbility.GetAP(); allAbilityDesc += equipItemAbility.GetDescription(); } } else { SetActive(t, UI.OBJ_ABILITY, false); SetActive(t, UI.OBJ_ABILITY_ITEM, true); SetLabelText(t, UI.LBL_ABILITY_ITEM, abilityItem.GetName()); SetTouchAndRelease(t.GetComponentInChildren <UIButton>().get_transform(), "ABILITY_ITEM_DATA_POPUP", "RELEASE_ABILITY", t); allAbilityName += abilityItem.GetName(); allAbilityDesc += abilityItem.GetDescription(); } }); PreCacheAbilityDetail(allAbilityName, allAp, allAbilityDesc); if (empty_ability) { SetActive(detailBase, UI.STR_NON_ABILITY, true); } else { SetActive(detailBase, UI.STR_NON_ABILITY, false); } } else { SetActive(detailBase, UI.STR_NON_ABILITY, true); } } }