private void _GetAttachSkillBuffParam(out int[] atk, out int[] def, out int hp)
    {
        atk = new int[7];
        def = new int[7];
        for (int i = 0; i < 7; i++)
        {
            atk[i] = 0;
            def[i] = 0;
        }
        hp = 0;
        int j = 0;

        for (int maxSlot = GetMaxSlot(); j < maxSlot; j++)
        {
            SkillItemInfo skillItem = GetSkillItem(j);
            if (skillItem != null)
            {
                GrowSkillItemTable.GrowSkillItemData growSkillItemData = Singleton <GrowSkillItemTable> .I.GetGrowSkillItemData(skillItem.tableData.growID, skillItem.level);

                if (growSkillItemData != null)
                {
                    hp += skillItem.hp;
                    int k = 0;
                    for (int num = 7; k < num; k++)
                    {
                        atk[k] += skillItem.atkList[k];
                        def[k] += skillItem.defList[k];
                    }
                }
            }
        }
    }
예제 #2
0
        private int GetExceedMaxLevel(int exceed_cnt)
        {
            int result = 1;

            GrowSkillItemTable.GrowSkillItemData[] growSkillItemDataAry = Singleton <GrowSkillItemTable> .I.GetGrowSkillItemDataAry(growID);

            GrowSkillItemTable.GrowSkillItemData under = null;
            GrowSkillItemTable.GrowSkillItemData over  = null;
            Array.ForEach(growSkillItemDataAry, delegate(GrowSkillItemTable.GrowSkillItemData data)
            {
                if (data.exceedCnt > exceed_cnt && (over == null || data.lv < over.lv))
                {
                    over = data;
                }
                if (data.exceedCnt <= exceed_cnt && (under == null || data.lv > under.lv))
                {
                    under = data;
                }
            });
            if (over == null && under != null)
            {
                return(under.lv);
            }
            if (under == null)
            {
                return(result);
            }
            float num = (float)(exceed_cnt + 1 - under.exceedCnt) / (float)(over.exceedCnt - under.exceedCnt);

            return(Mathf.FloorToInt(Mathf.Lerp((float)under.lv, (float)over.lv, num)) - 1);
        }
예제 #3
0
    public static string GetExplanationText(SkillItemTable.SkillItemData table_data, int level)
    {
        GrowSkillItemTable.GrowSkillItemData grow_data = Singleton <GrowSkillItemTable> .I.GetGrowSkillItemData(table_data.growID, level);

        string text = GetExplanationText(table_data.text, (EXPLANATION_COMMAND cmd) => GetStatusText(cmd, table_data, grow_data, level));
        int    num  = grow_data.exceedCnt;

        if (level >= table_data.GetMaxLv(0) && (Singleton <ExceedSkillItemTable> .I.IsExistExceed(num + 1) || num > 0))
        {
            text = text + "\n" + GetExceedExplanationText(num);
        }
        return(text);
    }
예제 #4
0
        private void _GetDefaultSkillBuffParam(out int[] atk, out int[] def, out int hp)
        {
            atk = new int[7];
            def = new int[7];
            int i = 0;

            for (int num = 7; i < num; i++)
            {
                atk[i] = 0;
                def[i] = 0;
            }
            hp = 0;
            int j = 0;

            for (int num2 = maxSlot; j < num2; j++)
            {
                SkillItemTable.SkillSlotData skillSlotData = GetSkillSlot(0)[j];
                if (skillSlotData != null && skillSlotData.skill_id != 0)
                {
                    SkillItemTable.SkillItemData skillItemData = Singleton <SkillItemTable> .I.GetSkillItemData(skillSlotData.skill_id);

                    if (skillItemData != null)
                    {
                        GrowSkillItemTable.GrowSkillItemData growSkillItemData = Singleton <GrowSkillItemTable> .I.GetGrowSkillItemData(skillItemData.growID, 1);

                        if (growSkillItemData != null)
                        {
                            atk[0] += growSkillItemData.GetGrowParamAtk(skillItemData.baseAtk);
                            def[0] += growSkillItemData.GetGrowParamDef(skillItemData.baseDef);
                            hp     += growSkillItemData.GetGrowParamHp(skillItemData.baseHp);
                            int[] growParamElemAtk = growSkillItemData.GetGrowParamElemAtk(skillItemData.atkElement);
                            int[] growParamElemDef = growSkillItemData.GetGrowParamElemDef(skillItemData.defElement);
                            int   k = 1;
                            for (int num3 = 7; k < num3; k++)
                            {
                                atk[k] += growParamElemAtk[k - 1];
                                def[k] += growParamElemDef[k - 1];
                            }
                        }
                    }
                }
            }
        }
    protected void AddBuffAction(Player _player)
    {
        if (m_buffIdList != null && m_buffIdList.Count >= 1 && base.bulletSkillInfoParam != null && !(_player == null) && !_player.isDead)
        {
            int i = 0;
            for (int count = m_buffIdList.Count; i < count; i++)
            {
                int num = m_buffIdList[i];
                if (Singleton <BuffTable> .IsValid() && num > 0)
                {
                    BuffTable.BuffData data = Singleton <BuffTable> .I.GetData((uint)num);

                    if (data != null)
                    {
                        BuffParam.BuffData buffData = new BuffParam.BuffData();
                        buffData.type      = data.type;
                        buffData.interval  = data.interval;
                        buffData.valueType = data.valueType;
                        buffData.time      = data.duration;
                        float num2 = (float)data.value;
                        GrowSkillItemTable.GrowSkillItemData growSkillItemData = Singleton <GrowSkillItemTable> .I.GetGrowSkillItemData(data.growID, base.bulletSkillInfoParam.baseInfo.level);

                        if (growSkillItemData != null)
                        {
                            buffData.time = data.duration * (float)(int)growSkillItemData.supprtTime[0].rate * 0.01f + (float)growSkillItemData.supprtTime[0].add;
                            num2          = (float)(data.value * (int)growSkillItemData.supprtValue[0].rate) * 0.01f + (float)(int)growSkillItemData.supprtValue[0].add;
                        }
                        if (buffData.valueType == BuffParam.VALUE_TYPE.RATE && BuffParam.IsTypeValueBasedOnHP(buffData.type))
                        {
                            num2 = (float)_player.hpMax * num2 * 0.01f;
                        }
                        buffData.value = Mathf.FloorToInt(num2);
                        _player.OnBuffStart(buffData);
                    }
                }
            }
        }
    }
예제 #6
0
    public ItemStatus[] GetEquipTypeSkillParam()
    {
        ItemStatus[] array = new ItemStatus[MonoBehaviourSingleton <StatusManager> .I.ENABLE_EQUIP_TYPE_MAX + 1];
        int          i     = 0;

        for (int num = array.Length; i < num; i++)
        {
            array[i] = new ItemStatus();
        }
        if (!tableData.IsPassive())
        {
            return(array);
        }
        GrowSkillItemTable.GrowSkillItemData growSkillItemData = Singleton <GrowSkillItemTable> .I.GetGrowSkillItemData(tableData.growID, level);

        if (growSkillItemData == null)
        {
            return(array);
        }
        ENABLE_EQUIP_TYPE[] array2 = (ENABLE_EQUIP_TYPE[])Enum.GetValues(typeof(ENABLE_EQUIP_TYPE));
        int j = 0;

        for (int num2 = array2.Length; j < num2; j++)
        {
            ItemStatus itemStatus = array[j];
            for (int k = 0; k < 3; k++)
            {
                if (tableData.supportType[k] != BuffParam.BUFFTYPE.NONE && tableData.IsEnableSupportEquipType(array2[j], k))
                {
                    int growParamSupprtValue = growSkillItemData.GetGrowParamSupprtValue(tableData.supportValue, k);
                    switch (tableData.supportType[k])
                    {
                    case BuffParam.BUFFTYPE.DEFENCE_NORMAL:
                        itemStatus.def += growParamSupprtValue;
                        break;

                    case BuffParam.BUFFTYPE.ATTACK_NORMAL:
                        itemStatus.atk += growParamSupprtValue;
                        break;

                    case BuffParam.BUFFTYPE.ATTACK_FIRE:
                        itemStatus.elemAtk[0] += growParamSupprtValue;
                        break;

                    case BuffParam.BUFFTYPE.ATTACK_WATER:
                        itemStatus.elemAtk[1] += growParamSupprtValue;
                        break;

                    case BuffParam.BUFFTYPE.ATTACK_THUNDER:
                        itemStatus.elemAtk[2] += growParamSupprtValue;
                        break;

                    case BuffParam.BUFFTYPE.ATTACK_SOIL:
                        itemStatus.elemAtk[3] += growParamSupprtValue;
                        break;

                    case BuffParam.BUFFTYPE.ATTACK_LIGHT:
                        itemStatus.elemAtk[4] += growParamSupprtValue;
                        break;

                    case BuffParam.BUFFTYPE.ATTACK_DARK:
                        itemStatus.elemAtk[5] += growParamSupprtValue;
                        break;

                    case BuffParam.BUFFTYPE.ATTACK_ALLELEMENT:
                        itemStatus.elemAtk[0] += (itemStatus.elemAtk[1] = (itemStatus.elemAtk[2] = (itemStatus.elemAtk[3] = (itemStatus.elemAtk[4] = (itemStatus.elemAtk[5] = growParamSupprtValue)))));
                        break;
                    }
                }
            }
        }
        return(array);
    }
예제 #7
0
    private static string GetStatusText(EXPLANATION_COMMAND cmd, SkillItemTable.SkillItemData table_data, GrowSkillItemTable.GrowSkillItemData grow_data, int level)
    {
        switch (cmd)
        {
        case EXPLANATION_COMMAND.ATK:
            return((level <= 1) ? table_data.baseAtk.ToString() : grow_data.GetGrowParamAtk(table_data.baseAtk).ToString());

        case EXPLANATION_COMMAND.DEF:
            return((level <= 1) ? table_data.baseDef.ToString() : grow_data.GetGrowParamDef(table_data.baseDef).ToString());

        case EXPLANATION_COMMAND.HP:
            return((level <= 1) ? table_data.baseHp.ToString() : grow_data.GetGrowParamHp(table_data.baseHp).ToString());

        case EXPLANATION_COMMAND.FIRE_ATK:
            return((level <= 1) ? table_data.atkElement[0].ToString() : grow_data.GetGrowParamElemAtk(table_data.atkElement)[0].ToString());

        case EXPLANATION_COMMAND.WATER_ATK:
            return((level <= 1) ? table_data.atkElement[1].ToString() : grow_data.GetGrowParamElemAtk(table_data.atkElement)[1].ToString());

        case EXPLANATION_COMMAND.THUNDER_ATK:
            return((level <= 1) ? table_data.atkElement[2].ToString() : grow_data.GetGrowParamElemAtk(table_data.atkElement)[2].ToString());

        case EXPLANATION_COMMAND.SOIL_ATK:
            return((level <= 1) ? table_data.atkElement[3].ToString() : grow_data.GetGrowParamElemAtk(table_data.atkElement)[3].ToString());

        case EXPLANATION_COMMAND.LIGHR_ATK:
            return((level <= 1) ? table_data.atkElement[4].ToString() : grow_data.GetGrowParamElemAtk(table_data.atkElement)[4].ToString());

        case EXPLANATION_COMMAND.DARK_ATK:
            return((level <= 1) ? table_data.atkElement[5].ToString() : grow_data.GetGrowParamElemAtk(table_data.atkElement)[5].ToString());

        case EXPLANATION_COMMAND.FIRE_DEF:
            return((level <= 1) ? table_data.defElement[0].ToString() : grow_data.GetGrowParamElemDef(table_data.defElement)[0].ToString());

        case EXPLANATION_COMMAND.WATER_DEF:
            return((level <= 1) ? table_data.defElement[1].ToString() : grow_data.GetGrowParamElemDef(table_data.defElement)[1].ToString());

        case EXPLANATION_COMMAND.THUNDER_DEF:
            return((level <= 1) ? table_data.defElement[2].ToString() : grow_data.GetGrowParamElemDef(table_data.defElement)[2].ToString());

        case EXPLANATION_COMMAND.SOIL_DEF:
            return((level <= 1) ? table_data.defElement[3].ToString() : grow_data.GetGrowParamElemDef(table_data.defElement)[3].ToString());

        case EXPLANATION_COMMAND.LIGHR_DEF:
            return((level <= 1) ? table_data.defElement[4].ToString() : grow_data.GetGrowParamElemDef(table_data.defElement)[4].ToString());

        case EXPLANATION_COMMAND.DARK_DEF:
            return((level <= 1) ? table_data.defElement[5].ToString() : grow_data.GetGrowParamElemDef(table_data.defElement)[5].ToString());

        case EXPLANATION_COMMAND.SKILL_ATK:
        {
            int num2 = (level <= 1) ? ((int)table_data.skillAtk) : grow_data.GetGrowParamSkillAtk(table_data.skillAtk);
            num2 = Mathf.FloorToInt((float)num2 * MonoBehaviourSingleton <GlobalSettingsManager> .I.skillItem.explanationAtkDispRate);
            return(num2.ToString());
        }

        case EXPLANATION_COMMAND.SKILL_ATKRATE:
        {
            int num = (level <= 1) ? ((int)table_data.skillAtkRate) : grow_data.GetGrowParamSkillAtkRate(table_data.skillAtkRate);
            return(Mathf.FloorToInt((float)num * MonoBehaviourSingleton <GlobalSettingsManager> .I.skillItem.explanationAtkRateDispRate).ToString());
        }

        case EXPLANATION_COMMAND.HEAL_HP:
            return((level <= 1) ? table_data.healHp.ToString() : grow_data.GetGrowParamHealHp(table_data.healHp).ToString());

        case EXPLANATION_COMMAND.SUPPORT_VALUE_1:
            return((level <= 1) ? table_data.supportValue[0].ToString() : grow_data.GetGrowParamSupprtValue(table_data.supportValue, 0).ToString());

        case EXPLANATION_COMMAND.SUPPORT_VALUE_2:
            return((level <= 1) ? table_data.supportValue[1].ToString() : grow_data.GetGrowParamSupprtValue(table_data.supportValue, 1).ToString());

        case EXPLANATION_COMMAND.SUPPORT_VALUE_3:
            return((level <= 1) ? table_data.supportValue[2].ToString() : grow_data.GetGrowParamSupprtValue(table_data.supportValue, 2).ToString());

        case EXPLANATION_COMMAND.SUPPORT_TIME_1:
            return((level <= 1) ? table_data.supportTime[0].ToString() : grow_data.GetGrowParamSupprtTime(table_data.supportTime, 0).ToString());

        case EXPLANATION_COMMAND.SUPPORT_TIME_2:
            return((level <= 1) ? table_data.supportTime[1].ToString() : grow_data.GetGrowParamSupprtTime(table_data.supportTime, 1).ToString());

        case EXPLANATION_COMMAND.SUPPORT_TIME_3:
            return((level <= 1) ? table_data.supportTime[2].ToString() : grow_data.GetGrowParamSupprtTime(table_data.supportTime, 2).ToString());

        default:
            Log.Error("explanation command unsupported {0}", EXPLANATION_COMMAND_LIST[(int)cmd]);
            return(EXPLANATION_COMMAND_LIST[(int)cmd]);
        }
    }
예제 #8
0
    public static string GetExplanationStatusUpText(SkillItemTable.SkillItemData table_data, int level, string status_up_format)
    {
        GrowSkillItemTable.GrowSkillItemData grow_data = Singleton <GrowSkillItemTable> .I.GetGrowSkillItemData(table_data.growID, level);

        return(GetExplanationStatusUpText(table_data.text, status_up_format, (EXPLANATION_COMMAND cmd) => GetStatusText(cmd, table_data, grow_data, level)));
    }
예제 #9
0
 private int GetGrowParamGiveExp(bool is_next_level = false)
 {
     GrowSkillItemTable.GrowSkillItemData growSkillItemData = (!is_next_level) ? growData : nextGrowData;
     return(growSkillItemData.GetGrowParamGiveExp(tableData.baseGiveExp));
 }
예제 #10
0
 private int[] GetGrowParamElemDef(bool is_next_level = false)
 {
     GrowSkillItemTable.GrowSkillItemData growSkillItemData = (!is_next_level) ? growData : nextGrowData;
     return(growSkillItemData.GetGrowParamElemDef(tableData.defElement));
 }
예제 #11
0
 private float GetGrowParamSupprtTime(int index, bool is_next_level = false)
 {
     GrowSkillItemTable.GrowSkillItemData growSkillItemData = (!is_next_level) ? growData : nextGrowData;
     return(growSkillItemData.GetGrowParamSupprtTime(tableData.supportTime, index));
 }
예제 #12
0
 private int GetGrowParamSkillAtkRate(bool is_next_level = false)
 {
     GrowSkillItemTable.GrowSkillItemData growSkillItemData = (!is_next_level) ? growData : nextGrowData;
     return(growSkillItemData.GetGrowParamSkillAtkRate(tableData.skillAtkRate));
 }
예제 #13
0
    public override void SetValue(SkillItem recv_data)
    {
        if (recv_data.skillItemId >= 1001000 && recv_data.skillItemId <= 1001003)
        {
            recv_data.skillItemId = 401900000 + recv_data.skillItemId % 10 + 1;
        }
        base.uniqueID = ulong.Parse(recv_data.uniqId);
        base.tableID  = (uint)recv_data.skillItemId;
        level         = recv_data.level;
        exceedCnt     = recv_data.exceed;
        exceedExp     = recv_data.exceedExp;
        exp           = recv_data.exp;
        expPrev       = recv_data.expPrev;
        expNext       = recv_data.expNext;
        isFavorite    = (recv_data.is_locked != 0);
        growCost      = recv_data.growCost;
        sellPrice     = recv_data.price;
        equipSetSkill = new List <EquipSetSkillData>();
        foreach (SkillItem.EquipSetSlot equipSlot in recv_data.equipSlots)
        {
            if (ulong.TryParse(equipSlot.euid, out ulong result))
            {
                if (result != 0L)
                {
                    equipSetSkill.Add(new EquipSetSkillData(equipSlot));
                }
            }
            else
            {
                Log.Error("parse error euid:{0}", equipSlot.euid);
            }
        }
        UpdateTableData();
        growData = Singleton <GrowSkillItemTable> .I.GetGrowSkillItemData(tableData.growID, level);

        nextGrowData = Singleton <GrowSkillItemTable> .I.GetGrowSkillItemData(tableData.growID, level + 1);

        atkList = new List <int>();
        defList = new List <int>();
        if (level > 1)
        {
            atkList.Add(GetGrowParamAtk(false));
            defList.Add(GetGrowParamDef(false));
            hp = GetGrowParamHp(false);
            int[] growParamElemAtk = GetGrowParamElemAtk(false);
            int[] growParamElemDef = GetGrowParamElemDef(false);
            int   i = 0;
            for (int num = tableData.atkElement.Length; i < num; i++)
            {
                atkList.Add(growParamElemAtk[i]);
                defList.Add(growParamElemDef[i]);
            }
            elemAtk      = Mathf.Max(growParamElemAtk);
            elemDef      = Mathf.Max(growParamElemDef);
            skillAtk     = GetGrowParamSkillAtk(false);
            skillAtkRate = GetGrowParamSkillAtkRate(false);
            healHp       = GetGrowParamHealHp(false);
            supportValue = new int[3];
            for (int j = 0; j < 3; j++)
            {
                supportValue[j] = GetGrowParamSupprtValue(j, false);
            }
            supportTime = new float[3];
            for (int k = 0; k < 3; k++)
            {
                supportTime[k] = GetGrowParamSupprtTime(k, false);
            }
        }
        else
        {
            atkList.Add(tableData.baseAtk);
            defList.Add(tableData.baseDef);
            hp = tableData.baseHp;
            int l = 0;
            for (int num2 = tableData.atkElement.Length; l < num2; l++)
            {
                atkList.Add(tableData.atkElement[l]);
                defList.Add(tableData.defElement[l]);
            }
            elemAtk      = Mathf.Max(tableData.atkElement);
            elemDef      = Mathf.Max(tableData.defElement);
            skillAtk     = tableData.skillAtk;
            skillAtkRate = tableData.skillAtkRate;
            healHp       = tableData.healHp;
            supportValue = tableData.supportValue;
            supportTime  = tableData.supportTime;
        }
        needExp       = GetGrowParamNeedExp(false);
        giveExp       = GetGrowParamGiveExp(false);
        giveExceedExp = Singleton <ExceedSkillItemTable> .I.GetExceedExp(this);

        exceedExpPrev = Singleton <ExceedSkillItemTable> .I.GetNeedExceedExp(tableData.rarity, exceedCnt);

        exceedExpNext = Singleton <ExceedSkillItemTable> .I.GetNeedExceedExp(tableData.rarity, exceedCnt + 1);

        isUpdateExplanationText = false;
        this.num = -1;
    }
예제 #14
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);
                }
            }
        }
    }
    private void OnTriggerEnter(Collider collider)
    {
        //IL_0001: Unknown result type (might be due to invalid IL or missing references)
        //IL_002c: Unknown result type (might be due to invalid IL or missing references)
        //IL_0069: Unknown result type (might be due to invalid IL or missing references)
        int layer = collider.get_gameObject().get_layer();

        if (((1 << layer) & m_ignoreLayerMask) <= 0 && (layer != 8 || !(collider.get_gameObject().GetComponent <DangerRader>() != null)) && m_state != STATE.PICKED)
        {
            int heal_hp = 0;
            if (m_skillParam != null)
            {
                heal_hp = m_skillParam.healHp;
            }
            Self component = collider.get_gameObject().GetComponent <Self>();
            if (component != null)
            {
                OnPicked();
                component.OnHealReceive(heal_hp, HEAL_TYPE.NONE, HEAL_EFFECT_TYPE.BASIS, true);
                if (m_buffIds != null && m_buffIds.Count > 0)
                {
                    for (int i = 0; i < m_buffIds.Count; i++)
                    {
                        int num = m_buffIds[i];
                        if (Singleton <BuffTable> .IsValid() && num > 0)
                        {
                            BuffTable.BuffData data = Singleton <BuffTable> .I.GetData((uint)num);

                            if (data != null)
                            {
                                BuffParam.BuffData buffData = new BuffParam.BuffData();
                                buffData.type      = data.type;
                                buffData.interval  = data.interval;
                                buffData.valueType = data.valueType;
                                buffData.time      = data.duration;
                                float num2 = (float)data.value;
                                GrowSkillItemTable.GrowSkillItemData growSkillItemData = Singleton <GrowSkillItemTable> .I.GetGrowSkillItemData(data.growID, m_skillParam.baseInfo.level);

                                if (growSkillItemData != null)
                                {
                                    buffData.time = data.duration * (float)(int)growSkillItemData.supprtTime[0].rate * 0.01f + (float)growSkillItemData.supprtTime[0].add;
                                    num2          = (float)(data.value * (int)growSkillItemData.supprtValue[0].rate) * 0.01f + (float)(int)growSkillItemData.supprtValue[0].add;
                                }
                                if (buffData.valueType == BuffParam.VALUE_TYPE.RATE && BuffParam.IsTypeValueBasedOnHP(buffData.type))
                                {
                                    num2 = (float)component.hpMax * num2 * 0.01f;
                                }
                                buffData.value = Mathf.FloorToInt(num2);
                                component.OnBuffStart(buffData);
                            }
                        }
                    }
                }
                if (component.playerSender != null)
                {
                    component.playerSender.OnPickPresentBullet(m_presentBulletId);
                }
                if (MonoBehaviourSingleton <StageObjectManager> .IsValid())
                {
                    MonoBehaviourSingleton <StageObjectManager> .I.RemovePresentBulletObject(m_presentBulletId);
                }
            }
        }
    }
예제 #16
0
    public void SetSettingsInfo(SkillSettingsInfo skill_settings, List <CharaInfo.EquipItem> weapon_list)
    {
        List <SkillParam> list = new List <SkillParam>();

        if (skillParams != null)
        {
            list = skillParams;
        }
        skillParams = new List <SkillParam>();
        InGameManager         i  = MonoBehaviourSingleton <InGameManager> .I;
        InGameSettingsManager i2 = MonoBehaviourSingleton <InGameSettingsManager> .I;
        int j = 0;

        for (int num = 9; j < num; j++)
        {
            SkillParam skillParam = new SkillParam();
            skillParam.skillIndex = j;
            skillParams.Add(skillParam);
            if (skill_settings != null && Singleton <SkillItemTable> .IsValid())
            {
                SkillSettingsInfo.Element element = skill_settings.elementList[j];
                if (element != null)
                {
                    skillParam.baseInfo        = element.baseInfo;
                    skillParam.useGaugeCounter = element.useGaugeCounter;
                    if (skillParam.baseInfo != null && skillParam.baseInfo.id != 0)
                    {
                        skillParam.tableData = Singleton <SkillItemTable> .I.GetSkillItemData((uint)skillParam.baseInfo.id);

                        if (skillParam.tableData != null && skillParam.IsActiveType())
                        {
                            if (weapon_list[j / 3] != null)
                            {
                                EquipItemTable.EquipItemData equipItemData = Singleton <EquipItemTable> .I.GetEquipItemData((uint)weapon_list[j / 3].eId);

                                if (equipItemData != null && !skillParam.tableData.IsEnableEquipType(equipItemData.type))
                                {
                                    continue;
                                }
                            }
                            switch (skillParam.tableData.skillAtkType)
                            {
                            case ELEMENT_TYPE.FIRE:
                                skillParam.atk.fire = (float)(int)skillParam.tableData.skillAtk;
                                break;

                            case ELEMENT_TYPE.WATER:
                                skillParam.atk.water = (float)(int)skillParam.tableData.skillAtk;
                                break;

                            case ELEMENT_TYPE.THUNDER:
                                skillParam.atk.thunder = (float)(int)skillParam.tableData.skillAtk;
                                break;

                            case ELEMENT_TYPE.SOIL:
                                skillParam.atk.soil = (float)(int)skillParam.tableData.skillAtk;
                                break;

                            case ELEMENT_TYPE.LIGHT:
                                skillParam.atk.light = (float)(int)skillParam.tableData.skillAtk;
                                break;

                            case ELEMENT_TYPE.DARK:
                                skillParam.atk.dark = (float)(int)skillParam.tableData.skillAtk;
                                break;

                            default:
                                skillParam.atk.normal = (float)(int)skillParam.tableData.skillAtk;
                                break;
                            }
                            skillParam.atkRate = (float)(int)skillParam.tableData.skillAtkRate * 0.01f;
                            skillParam.healHp  = skillParam.tableData.healHp;
                            for (int k = 0; k < 3; k++)
                            {
                                skillParam.supportValue[k] = skillParam.tableData.supportValue[k];
                                skillParam.supportTime[k]  = skillParam.tableData.supportTime[k];
                            }
                            skillParam.castTimeRate = 0f;
                            skillParam.useGauge     = skillParam.tableData.useGauge;
                            if (Singleton <GrowSkillItemTable> .IsValid())
                            {
                                GrowSkillItemTable.GrowSkillItemData growSkillItemData = Singleton <GrowSkillItemTable> .I.GetGrowSkillItemData(skillParam.tableData.growID, skillParam.baseInfo.level);

                                if (growSkillItemData != null)
                                {
                                    float num2 = (float)growSkillItemData.GetGrowParamSkillAtk(skillParam.tableData.skillAtk);
                                    switch (skillParam.tableData.skillAtkType)
                                    {
                                    case ELEMENT_TYPE.FIRE:
                                        skillParam.atk.fire = num2;
                                        break;

                                    case ELEMENT_TYPE.WATER:
                                        skillParam.atk.water = num2;
                                        break;

                                    case ELEMENT_TYPE.THUNDER:
                                        skillParam.atk.thunder = num2;
                                        break;

                                    case ELEMENT_TYPE.SOIL:
                                        skillParam.atk.soil = num2;
                                        break;

                                    case ELEMENT_TYPE.LIGHT:
                                        skillParam.atk.light = num2;
                                        break;

                                    case ELEMENT_TYPE.DARK:
                                        skillParam.atk.dark = num2;
                                        break;

                                    default:
                                        skillParam.atk.normal = num2;
                                        break;
                                    }
                                    skillParam.atkRate = (float)growSkillItemData.GetGrowParamSkillAtkRate(skillParam.tableData.skillAtkRate) * 0.01f;
                                    skillParam.healHp  = growSkillItemData.GetGrowParamHealHp(skillParam.tableData.healHp);
                                    for (int l = 0; l < 3; l++)
                                    {
                                        skillParam.supportValue[l] = growSkillItemData.GetGrowParamSupprtValue(skillParam.tableData.supportValue, l);
                                        skillParam.supportTime[l]  = growSkillItemData.GetGrowParamSupprtTime(skillParam.tableData.supportTime, l);
                                    }
                                    skillParam.castTimeRate = growSkillItemData.GetGrowParamCastTimeRate();
                                    skillParam.useGauge     = growSkillItemData.GetGrowParamUseGauge(skillParam.tableData.useGauge);
                                }
                            }
                            if (Singleton <ExceedSkillItemTable> .IsValid())
                            {
                                ExceedSkillItemTable.ExceedSkillItemData exceedSkillItemData = Singleton <ExceedSkillItemTable> .I.GetExceedSkillItemData(skillParam.baseInfo.exceedCnt);

                                if (exceedSkillItemData != null)
                                {
                                    skillParam.useGauge = exceedSkillItemData.GetExceedUseGauge(skillParam.useGauge);
                                }
                            }
                            if (MonoBehaviourSingleton <InGameManager> .IsValid() && MonoBehaviourSingleton <InGameManager> .I.HasArenaInfo())
                            {
                                InGameSettingsManager.ArenaParam arenaParam = i2.arenaParam;
                                if ((float)skillParam.baseInfo.exceedCnt < arenaParam.magiSpeedDownRegistSkillExceedLv && i.ContainsArenaCondition(ARENA_CONDITION.RECOVER_MAGI_SPEED_DOWN))
                                {
                                    float num3 = arenaParam.magiSpeedDownRateBase - arenaParam.magiSpeedDownRate * (float)skillParam.baseInfo.exceedCnt;
                                    if (num3 < 0f)
                                    {
                                        num3 = 0f;
                                    }
                                    SkillParam skillParam2 = skillParam;
                                    skillParam2.useGauge = (int)skillParam2.useGauge + Mathf.FloorToInt((float)(int)skillParam.useGauge * num3);
                                }
                                if (i.ContainsArenaCondition(ARENA_CONDITION.RECOVER_MAGI_SPEED_UP))
                                {
                                    SkillParam skillParam3 = skillParam;
                                    skillParam3.useGauge = (int)skillParam3.useGauge - Mathf.FloorToInt((float)(int)skillParam.useGauge * arenaParam.magiSpeedUpBaseRate);
                                }
                            }
                            if (list != null && list.Count > 0)
                            {
                                for (int m = 0; m < list.Count; m++)
                                {
                                    if (list[m] != null && list[m].tableData != null && list[m].tableData.name == skillParam.tableData.name && list[m].bullet != null)
                                    {
                                        skillParam.bullet = list[j].bullet;
                                    }
                                }
                            }
                            skillParam.isValid = true;
                        }
                    }
                }
            }
        }
        arenaConditionList = i.GetArenaConditions();
        if (!arenaConditionList.IsNullOrEmpty())
        {
            for (int n = 0; n < arenaConditionList.Length; n++)
            {
                switch (arenaConditionList[n])
                {
                case ARENA_CONDITION.FORBID_MAGI_ATTACK:
                    isArenaForbidMagiAttack = true;
                    break;

                case ARENA_CONDITION.FORBID_MAGI_SUPPORT:
                    isArenaForbidMagiSupport = true;
                    break;

                case ARENA_CONDITION.FORBID_MAGI_HEAL:
                    isArenaForbidMagiHeal = true;
                    break;
                }
            }
        }
    }