Exemplo n.º 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);
    }
    private int[] GetGrowParamElemAtk(bool is_next_level = false)
    {
        GrowEquipItemTable.GrowEquipItemData growEquipItemData = (!is_next_level) ? growTableData : nextGrowTableData;
        int[] growParamElemAtk = growEquipItemData.GetGrowParamElemAtk(tableData.atkElement);
        int[] array            = new int[tableData.atkElement.Length];
        int   i = 0;

        for (int num = array.Length; i < num; i++)
        {
            array[i] = growParamElemAtk[i] + exceedParam.atkElement[i];
        }
        return(array);
    }
Exemplo n.º 3
0
        public void GetMaxAtk(out int _atk, out int _elem_atk, out ELEMENT_TYPE _element)
        {
            GrowEquipItemTable.GrowEquipItemData growEquipItemData = Singleton <GrowEquipItemTable> .I.GetGrowEquipItemData(growID, (uint)maxLv);

            _atk = growEquipItemData.GetGrowParamAtk(baseAtk);
            int[] growParamElemAtk = growEquipItemData.GetGrowParamElemAtk(atkElement);
            _elem_atk = 0;
            _element  = ELEMENT_TYPE.MAX;
            int i = 0;

            for (int num = growParamElemAtk.Length; i < num; i++)
            {
                if (_elem_atk < growParamElemAtk[i])
                {
                    _elem_atk = growParamElemAtk[i];
                    _element  = (ELEMENT_TYPE)i;
                }
            }
        }
Exemplo n.º 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);
                }
            }
        }
    }
Exemplo n.º 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);
			}
		}
	}
Exemplo n.º 6
0
    private EquipItemInfo GetWeaponMaxAtk(bool validElement, ELEMENT_CONDITION condition = ELEMENT_CONDITION.EQUAL)
    {
        EquipItemInfo equipItemInfo = null;
        int           num           = -1;

        for (int i = 0; i < weaponItemInfoList.Length; i++)
        {
            if (validElement && elementIndex != 0)
            {
                ELEMENT_TYPE eLEMENT_TYPE = ChangeElementToMasterDefineElement(elementIndex, condition);
                int          elemAtkType  = weaponItemInfoList[i].GetElemAtkType();
                if ((eLEMENT_TYPE != (ELEMENT_TYPE)elemAtkType && condition == ELEMENT_CONDITION.EQUAL) || ((eLEMENT_TYPE == (ELEMENT_TYPE)elemAtkType || elemAtkType == 6) && condition == ELEMENT_CONDITION.DISADVANTAGEOUS))
                {
                    continue;
                }
            }
            int num2 = 0;
            if (isCurrent)
            {
                num2 = weaponItemInfoList[i].atk + weaponItemInfoList[i].elemAtk;
            }
            else
            {
                EquipItemTable.EquipItemData         tableData         = weaponItemInfoList[i].tableData;
                GrowEquipItemTable.GrowEquipItemData growEquipItemData = Singleton <GrowEquipItemTable> .I.GetGrowEquipItemData(tableData.growID, (uint)tableData.maxLv);

                if (growEquipItemData != null)
                {
                    EquipItemExceedParamTable.EquipItemExceedParamAll equipItemExceedParamAll = tableData.GetExceedParam((uint)weaponItemInfoList[i].exceed);
                    if (equipItemExceedParamAll == null)
                    {
                        equipItemExceedParamAll = new EquipItemExceedParamTable.EquipItemExceedParamAll();
                    }
                    int   num3             = growEquipItemData.GetGrowParamAtk(tableData.baseAtk) + (int)equipItemExceedParamAll.atk;
                    int[] growParamElemAtk = growEquipItemData.GetGrowParamElemAtk(tableData.atkElement);
                    int   j = 0;
                    for (int num4 = growParamElemAtk.Length; j < num4; j++)
                    {
                        growParamElemAtk[j] += equipItemExceedParamAll.atkElement[j];
                    }
                    int num5 = Mathf.Max(growParamElemAtk);
                    num2 = num3 + num5;
                }
            }
            if (num2 != 0)
            {
                int num6 = (int)weaponItemInfoList[i].tableData.type;
                if (num6 >= 4)
                {
                    num6--;
                }
                if (num6 < MonoBehaviourSingleton <GlobalSettingsManager> .I.playerWeaponAttackRate.Length)
                {
                    num2 = (int)((float)num2 / MonoBehaviourSingleton <GlobalSettingsManager> .I.playerWeaponAttackRate[num6]);
                }
            }
            if (num2 > num && !selectedWeaponIds.Contains(weaponItemInfoList[i].uniqueID))
            {
                equipItemInfo = weaponItemInfoList[i];
                num           = num2;
            }
        }
        if (equipItemInfo != null)
        {
            selectedWeaponIds.Add(equipItemInfo.uniqueID);
        }
        if (equipItemInfo == null && validElement && condition == ELEMENT_CONDITION.EQUAL)
        {
            equipItemInfo = GetWeaponMaxAtk(true, ELEMENT_CONDITION.DISADVANTAGEOUS);
        }
        else if (equipItemInfo == null && validElement && condition == ELEMENT_CONDITION.DISADVANTAGEOUS)
        {
            equipItemInfo = GetWeaponMaxAtk(false, ELEMENT_CONDITION.EQUAL);
        }
        return(equipItemInfo);
    }