Пример #1
0
    protected override void EquipTableParam(EquipItemTable.EquipItemData table_data)
    {
        base.EquipTableParam(table_data);
        GrowEquipItemTable.GrowEquipItemData growEquipItemData = Singleton <GrowEquipItemTable> .I.GetGrowEquipItemData(table_data.growID, (uint)table_data.maxLv);

        int growParamAtk = growEquipItemData.GetGrowParamAtk(table_data.baseAtk);
        int growParamDef = growEquipItemData.GetGrowParamDef(table_data.baseDef);

        int[] growParamElemAtk = growEquipItemData.GetGrowParamElemAtk(table_data.atkElement);
        int   num = Mathf.Max(growParamElemAtk);

        int[] growParamElemDef = growEquipItemData.GetGrowParamElemDef(table_data.defElement);
        int   num2             = Mathf.Max(growParamElemDef);
        int   growParamHp      = growEquipItemData.GetGrowParamHp(table_data.baseHp);

        SetActive(detailBase, UI.STR_LV, true);
        SetActive(detailBase, UI.STR_ONLY_VISUAL, false);
        SetLabelText(detailBase, UI.LBL_LV_NOW, table_data.maxLv.ToString());
        SetLabelText(detailBase, UI.LBL_ATK, growParamAtk.ToString());
        SetLabelText(detailBase, UI.LBL_ELEM, num.ToString());
        SetLabelText(detailBase, UI.LBL_DEF, growParamDef.ToString());
        SetLabelText(detailBase, UI.LBL_ELEM_DEF, num2.ToString());
        SetLabelText(detailBase, UI.LBL_HP, growParamHp.ToString());
        SetActive(detailBase, UI.OBJ_FAVORITE_ROOT, false);
    }
Пример #2
0
        public void GetMaxDef(out int _def, out int _elem_def, out ELEMENT_TYPE _element)
        {
            GrowEquipItemTable.GrowEquipItemData growEquipItemData = Singleton <GrowEquipItemTable> .I.GetGrowEquipItemData(growID, (uint)maxLv);

            _def = growEquipItemData.GetGrowParamDef(baseDef);
            int[] growParamElemDef = growEquipItemData.GetGrowParamElemDef(defElement);
            _elem_def = 0;
            _element  = ELEMENT_TYPE.MAX;
            int i = 0;

            for (int num = growParamElemDef.Length; i < num; i++)
            {
                if (_elem_def < growParamElemDef[i])
                {
                    _elem_def = growParamElemDef[i];
                    _element  = (ELEMENT_TYPE)i;
                }
            }
        }
 private int GetGrowParamDef(bool is_next_level = false)
 {
     GrowEquipItemTable.GrowEquipItemData growEquipItemData = (!is_next_level) ? growTableData : nextGrowTableData;
     return(growEquipItemData.GetGrowParamDef(tableData.baseDef) + (int)exceedParam.def);
 }
Пример #4
0
    public void Parse(CharaInfo.EquipItem item, EquipItemTable.EquipItemData data)
    {
        _Reset();
        type         = data.type;
        spAttackType = data.spAttackType;
        GrowEquipItemTable.GrowEquipItemData growEquipItemData = Singleton <GrowEquipItemTable> .I.GetGrowEquipItemData(data.growID, (uint)item.lv);

        if (object.ReferenceEquals(growEquipItemData, null))
        {
            baseStatus.hp          = data.baseHp;
            baseStatus.attacks[0]  = data.baseAtk;
            baseStatus.defences[0] = data.baseDef;
            for (int i = 0; i < 6; i++)
            {
                baseStatus.attacks[i + 1] = data.atkElement[i];
                baseStatus.tolerances[i]  = data.defElement[i];
            }
        }
        else
        {
            baseStatus.hp          = growEquipItemData.GetGrowParamHp(data.baseHp);
            baseStatus.attacks[0]  = growEquipItemData.GetGrowParamAtk(data.baseAtk);
            baseStatus.defences[0] = growEquipItemData.GetGrowParamDef(data.baseDef);
            int[] growParamElemAtk = growEquipItemData.GetGrowParamElemAtk(data.atkElement);
            int[] growParamElemDef = growEquipItemData.GetGrowParamElemDef(data.defElement);
            for (int j = 0; j < 6; j++)
            {
                baseStatus.attacks[j + 1] = growParamElemAtk[j];
                baseStatus.tolerances[j]  = growParamElemDef[j];
            }
        }
        EquipItemExceedParamTable.EquipItemExceedParamAll exceedParam = data.GetExceedParam((uint)item.exceed);
        if (!object.ReferenceEquals(exceedParam, null))
        {
            baseStatus.hp          += exceedParam.hp;
            baseStatus.attacks[0]  += exceedParam.atk;
            baseStatus.defences[0] += exceedParam.def;
            for (int k = 0; k < 6; k++)
            {
                baseStatus.attacks[k + 1] += exceedParam.atkElement[k];
                baseStatus.tolerances[k]  += exceedParam.defElement[k];
            }
        }
        int l = 0;

        for (int count = item.sIds.Count; l < count; l++)
        {
            SkillItemTable.SkillItemData skillItemData = Singleton <SkillItemTable> .I.GetSkillItemData((uint)item.sIds[l]);

            GrowSkillItemTable.GrowSkillItemData growSkillItemData = Singleton <GrowSkillItemTable> .I.GetGrowSkillItemData(skillItemData.growID, item.sLvs[l]);

            constHp      += growSkillItemData.GetGrowParamHp(skillItemData.baseHp);
            constAtks[0] += growSkillItemData.GetGrowParamAtk(skillItemData.baseAtk);
            constDefs[0] += growSkillItemData.GetGrowParamDef(skillItemData.baseDef);
            int[] growParamElemAtk2 = growSkillItemData.GetGrowParamElemAtk(skillItemData.atkElement);
            int[] growParamElemDef2 = growSkillItemData.GetGrowParamElemDef(skillItemData.defElement);
            for (int m = 0; m < 6; m++)
            {
                constAtks[m + 1] += growParamElemAtk2[m];
                constTols[m]     += growParamElemDef2[m];
            }
            if (skillItemData.IsPassive())
            {
                int n = 0;
                for (int num = skillItemData.supportType.Length; n < num; n++)
                {
                    if (skillItemData.supportType[n] != BuffParam.BUFFTYPE.NONE)
                    {
                        skillSupport.Add(new SkillSupport(skillItemData.supportPassiveEqType[n], skillItemData.supportType[n], growSkillItemData.GetGrowParamSupprtValue(skillItemData.supportValue, n), skillItemData.supportPassiveSpAttackType));
                    }
                }
            }
        }
        int num2 = 0;

        for (int count2 = item.aIds.Count; num2 < count2; num2++)
        {
            int num3 = item.aIds[num2];
            int num4 = item.aPts[num2];
            if (this.ability.ContainsKey(num3))
            {
                Dictionary <int, int> dictionary;
                Dictionary <int, int> dictionary2 = dictionary = this.ability;
                int key;
                int key2 = key = num3;
                key = dictionary[key];
                dictionary2[key2] = key + num4;
            }
            else
            {
                this.ability.Add(num3, num4);
            }
        }
        int num5 = 0;

        for (int num6 = data.fixedAbility.Length; num5 < num6; num5++)
        {
            EquipItem.Ability ability = data.fixedAbility[num5];
            if (this.ability.ContainsKey(ability.id))
            {
                Dictionary <int, int> dictionary3;
                Dictionary <int, int> dictionary4 = dictionary3 = this.ability;
                int key;
                int key3 = key = ability.id;
                key = dictionary3[key];
                dictionary4[key3] = key + ability.pt;
            }
            else
            {
                this.ability.Add(ability.id, ability.pt);
            }
        }
        if (!object.ReferenceEquals(exceedParam, null))
        {
            int num7 = 0;
            for (int num8 = exceedParam.ability.Length; num7 < num8; num7++)
            {
                EquipItem.Ability ability2 = exceedParam.ability[num7];
                if (this.ability.ContainsKey(ability2.id))
                {
                    Dictionary <int, int> dictionary5;
                    Dictionary <int, int> dictionary6 = dictionary5 = this.ability;
                    int key;
                    int key4 = key = ability2.id;
                    key = dictionary5[key];
                    dictionary6[key4] = key + ability2.pt;
                }
                else
                {
                    this.ability.Add(ability2.id, ability2.pt);
                }
            }
        }
    }
Пример #5
0
	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);
			}
		}
	}
Пример #6
0
    private EquipItemInfo GetEquipMaxDef(EquipItemInfo[] items, bool validElement, bool validAbilityWeaponType, bool checkOnlyFixAbility)
    {
        EquipItemInfo equipItemInfo = null;
        int           num           = -1;
        int           num2          = -1;

        for (int i = 0; i < items.Length; i++)
        {
            if (!validAbilityWeaponType || weaponIndex == 0 || HasFixAbilityWithWeaponType(items[i], weaponIndex, checkOnlyFixAbility))
            {
                if (validElement && elementIndex != 0)
                {
                    ELEMENT_TYPE eLEMENT_TYPE = ChangeElementToMasterDefineElement(elementIndex, ELEMENT_CONDITION.EFFECTIVE_DEF);
                    if (eLEMENT_TYPE != (ELEMENT_TYPE)items[i].GetElemDefType())
                    {
                        continue;
                    }
                }
                int num3 = 0;
                int num4 = 0;
                if (isCurrent)
                {
                    num3 = items[i].def + items[i].elemDef;
                    num4 = items[i].hp;
                }
                else
                {
                    EquipItemTable.EquipItemData         tableData         = items[i].tableData;
                    GrowEquipItemTable.GrowEquipItemData growEquipItemData = Singleton <GrowEquipItemTable> .I.GetGrowEquipItemData(tableData.growID, (uint)tableData.maxLv);

                    if (growEquipItemData != null)
                    {
                        EquipItemExceedParamTable.EquipItemExceedParamAll equipItemExceedParamAll = tableData.GetExceedParam(4u);
                        if (equipItemExceedParamAll == null)
                        {
                            equipItemExceedParamAll = new EquipItemExceedParamTable.EquipItemExceedParamAll();
                        }
                        int   num5             = growEquipItemData.GetGrowParamDef(tableData.baseDef) + (int)equipItemExceedParamAll.def;
                        int[] growParamElemDef = growEquipItemData.GetGrowParamElemDef(tableData.defElement);
                        int   j = 0;
                        for (int num6 = growParamElemDef.Length; j < num6; j++)
                        {
                            growParamElemDef[j] += equipItemExceedParamAll.defElement[j];
                        }
                        int num7 = Mathf.Max(growParamElemDef);
                        num3 = num5 + num7;
                        num4 = growEquipItemData.GetGrowParamHp(tableData.baseHp) + (int)equipItemExceedParamAll.hp;
                    }
                }
                if (num3 > num || (num3 == num && num4 > num2))
                {
                    equipItemInfo = items[i];
                    num           = num3;
                    num2          = num4;
                }
            }
        }
        if (equipItemInfo == null && validElement && validAbilityWeaponType && checkOnlyFixAbility)
        {
            equipItemInfo = GetEquipMaxDef(items, true, true, false);
        }
        else if (equipItemInfo == null && validElement && validAbilityWeaponType && !checkOnlyFixAbility)
        {
            equipItemInfo = GetEquipMaxDef(items, false, true, true);
        }
        else if (equipItemInfo == null && !validElement && validAbilityWeaponType && checkOnlyFixAbility)
        {
            equipItemInfo = GetEquipMaxDef(items, false, true, false);
        }
        else if (equipItemInfo == null && !validElement && validAbilityWeaponType && !checkOnlyFixAbility)
        {
            equipItemInfo = GetEquipMaxDef(items, true, false, false);
        }
        else if (equipItemInfo == null)
        {
            equipItemInfo = GetEquipMaxDef(items, false, false, false);
        }
        return(equipItemInfo);
    }