Beispiel #1
0
    public void Fire(Vector3 position, Vector3 direction, Skill skill)
    {
        transform.position = originalPos = position;
        transform.localScale = skill.Scale;
        velocity = skill.Speed * direction;
        element = skill.Element;
        range = skill.Range;
        tag = skill.tag;

        damage = skill.Damage;
    }
Beispiel #2
0
 public void Init(float _speed, Vector3 _scale, int _damage, ELEMENT_TYPE _element, float _range, float _coolDown, bool _piercing)
 {
     speed = _speed;
     scale = _scale;
     damage = _damage;
     element = _element;
     range = _range;
     coolDown = _coolDown;
     piercing = _piercing;
 }
Beispiel #3
0
    private ItemIcon CreateItemIcon(SortCompareData dropItem, Transform o, string event_name, int i)
    {
        ITEM_ICON_TYPE iTEM_ICON_TYPE        = ITEM_ICON_TYPE.NONE;
        RARITY_TYPE?   rarity                = null;
        ELEMENT_TYPE   element               = ELEMENT_TYPE.MAX;
        EQUIPMENT_TYPE?magi_enable_icon_type = null;
        int            icon_id               = -1;
        int            num = -1;

        if (dropItem != null)
        {
            iTEM_ICON_TYPE        = dropItem.GetIconType();
            icon_id               = dropItem.GetIconID();
            rarity                = dropItem.GetRarity();
            element               = dropItem.GetIconElement();
            magi_enable_icon_type = dropItem.GetIconMagiEnableType();
            num = dropItem.GetNum();
            if (num == 1)
            {
                num = -1;
            }
        }
        bool is_new = false;

        switch (iTEM_ICON_TYPE)
        {
        case ITEM_ICON_TYPE.ITEM:
        case ITEM_ICON_TYPE.QUEST_ITEM:
        {
            ulong uniqID = dropItem.GetUniqID();
            if (uniqID != 0L)
            {
                is_new = MonoBehaviourSingleton <InventoryManager> .I.IsNewItem(iTEM_ICON_TYPE, dropItem.GetUniqID());
            }
            break;
        }

        default:
            is_new = true;
            break;

        case ITEM_ICON_TYPE.NONE:
            break;
        }
        int enemy_icon_id  = 0;
        int enemy_icon_id2 = 0;

        if (iTEM_ICON_TYPE == ITEM_ICON_TYPE.ITEM)
        {
            ItemTable.ItemData itemData = Singleton <ItemTable> .I.GetItemData(dropItem.GetTableID());

            enemy_icon_id  = itemData.enemyIconID;
            enemy_icon_id2 = itemData.enemyIconID2;
        }
        ItemIcon itemIcon = null;

        if (dropItem.GetIconType() == ITEM_ICON_TYPE.QUEST_ITEM)
        {
            ItemIcon.ItemIconCreateParam itemIconCreateParam = new ItemIcon.ItemIconCreateParam();
            itemIconCreateParam.icon_type = dropItem.GetIconType();
            itemIconCreateParam.icon_id   = dropItem.GetIconID();
            itemIconCreateParam.rarity    = dropItem.GetRarity();
            itemIconCreateParam.parent    = o;
            itemIconCreateParam.element   = dropItem.GetIconElement();
            itemIconCreateParam.magi_enable_equip_type = dropItem.GetIconMagiEnableType();
            itemIconCreateParam.num               = dropItem.GetNum();
            itemIconCreateParam.enemy_icon_id     = enemy_icon_id;
            itemIconCreateParam.enemy_icon_id2    = enemy_icon_id2;
            itemIconCreateParam.questIconSizeType = ItemIcon.QUEST_ICON_SIZE_TYPE.REWARD_DELIVERY_LIST;
            itemIcon = ItemIcon.Create(itemIconCreateParam);
        }
        else
        {
            GET_TYPE getType = dropItem.GetGetType();
            itemIcon = ItemIcon.Create(iTEM_ICON_TYPE, icon_id, rarity, o, element, magi_enable_icon_type, num, event_name, i, is_new, -1, false, null, false, enemy_icon_id, enemy_icon_id2, false, getType);
        }
        itemIcon.SetRewardBG(true);
        itemIcon.SetRewardCategoryInfo(dropItem.GetCategory());
        Transform ctrl = GetCtrl(UI.PNL_MATERIAL_INFO);

        MaterialInfoButton.Set(itemIcon.transform, material_info_t, dropItem.GetMaterialType(), dropItem.GetTableID(), base.sectionData.sectionName, ctrl);
        return(itemIcon);
    }
Beispiel #4
0
 /// <summary>
 /// Build a CustomModType node.
 /// </summary>
 /// <param name="mod">The type modifier (actually one of CMOD_OPT or CMOD_REQD)</param>
 /// <param name="t">The type to which the modifier applies</param>
 internal CustomModType(ELEMENT_TYPE mod, CLITypeNode t)
 {
     Debug.Assert(mod == ELEMENT_TYPE.ELEMENT_TYPE_CMOD_OPT || mod == ELEMENT_TYPE.ELEMENT_TYPE_CMOD_REQD, "Invalid Custom Modifier!");
     cmod = mod;
     type = t;
 }
Beispiel #5
0
        /// <summary>
        /// Read a type from a signature.
        /// </summary>
        /// <param name="p">Pointer to the signature to be read</param>
        /// <param name="f">CLIFileReader in use</param>
        /// <returns>
        /// A CLIType object representing a type. It is similar to a Reflection.Type
        /// object though it is less expensive and contains enough information to
        /// access type definitions in CLIFile table.
        /// </returns>
        private static CLITypeNode ReadTypeNode(ref MapPtr p, CLIFile f)
        {
            ELEMENT_TYPE t = (ELEMENT_TYPE)SignatureUtil.ReadCompressedInt(ref p);

            switch (t)
            {
            case ELEMENT_TYPE.ELEMENT_TYPE_BOOLEAN:
            case ELEMENT_TYPE.ELEMENT_TYPE_CHAR:
            case ELEMENT_TYPE.ELEMENT_TYPE_I1:
            case ELEMENT_TYPE.ELEMENT_TYPE_U1:
            case ELEMENT_TYPE.ELEMENT_TYPE_I2:
            case ELEMENT_TYPE.ELEMENT_TYPE_U2:
            case ELEMENT_TYPE.ELEMENT_TYPE_I4:
            case ELEMENT_TYPE.ELEMENT_TYPE_U4:
            case ELEMENT_TYPE.ELEMENT_TYPE_I8:
            case ELEMENT_TYPE.ELEMENT_TYPE_U8:
            case ELEMENT_TYPE.ELEMENT_TYPE_R4:
            case ELEMENT_TYPE.ELEMENT_TYPE_R8:
            case ELEMENT_TYPE.ELEMENT_TYPE_I:
            case ELEMENT_TYPE.ELEMENT_TYPE_U:
            case ELEMENT_TYPE.ELEMENT_TYPE_STRING:
            case ELEMENT_TYPE.ELEMENT_TYPE_OBJECT:
            case ELEMENT_TYPE.ELEMENT_TYPE_TYPEDBYREF:
            case ELEMENT_TYPE.ELEMENT_TYPE_VOID:
                return(BaseType.TypeOf(t).type);

            case ELEMENT_TYPE.ELEMENT_TYPE_VAR:
                return(new VariableType(f, SignatureUtil.ReadCompressedInt(ref p)));

            case ELEMENT_TYPE.ELEMENT_TYPE_MVAR:
                return(new MethodVariableType(f, SignatureUtil.ReadCompressedInt(ref p)));

            case ELEMENT_TYPE.ELEMENT_TYPE_VALUETYPE:
            case ELEMENT_TYPE.ELEMENT_TYPE_CLASS:
                return(new CompoundType(f, SignatureUtil.ReadCompressedInt(ref p)));

            case ELEMENT_TYPE.ELEMENT_TYPE_GENERICINST:
            {
                ELEMENT_TYPE isClass = (ELEMENT_TYPE)SignatureUtil.ReadCompressedInt(ref p);
                int          ttk     = SignatureUtil.ReadCompressedInt(ref p);
                int          count   = SignatureUtil.ReadCompressedInt(ref p);
                CLIType[]    args    = new CLIType[count];
                for (int i = 0; i < count; i++)
                {
                    args[i] = new CLIType(f, ReadTypeNode(ref p, f));
                }

                return(new CompoundType(f, ttk, args));
            }

            case ELEMENT_TYPE.ELEMENT_TYPE_PTR:
            {
                int          sz;
                ELEMENT_TYPE opt  = (ELEMENT_TYPE)SignatureUtil.ReadCompressedInt(p, out sz);
                ELEMENT_TYPE?cmod = null;
                if (opt == ELEMENT_TYPE.ELEMENT_TYPE_CMOD_OPT || opt == ELEMENT_TYPE.ELEMENT_TYPE_CMOD_REQD)
                {
                    cmod = opt;
                    p   += 1;
                }
                CLITypeNode ptrt = new PointerType(ReadTypeNode(ref p, f));
                if (cmod.HasValue)
                {
                    ptrt = new CustomModType(cmod.Value, ptrt);
                }
                return(ptrt);
            }

            case ELEMENT_TYPE.ELEMENT_TYPE_FNPTR:
                return(new FunPointerType(f, p));

            case ELEMENT_TYPE.ELEMENT_TYPE_ARRAY:
            {
                CLITypeNode at   = ReadTypeNode(ref p, f);
                int         rank = SignatureUtil.ReadCompressedInt(ref p);
                int         sz   = SignatureUtil.ReadCompressedInt(ref p);
                int[]       szs  = new int[sz];
                for (int i = 0; i < sz; i++)
                {
                    szs[i] = SignatureUtil.ReadCompressedInt(ref p);
                }
                sz = SignatureUtil.ReadCompressedInt(ref p);
                int[] lb = new int[sz];
                for (int i = 0; i < sz; i++)
                {
                    lb[i] = SignatureUtil.ReadCompressedInt(ref p);
                }
                return(new ArrayType(at, rank, szs, lb));
            }

            case ELEMENT_TYPE.ELEMENT_TYPE_SZARRAY:
            {
                int          sz;
                ELEMENT_TYPE opt  = (ELEMENT_TYPE)SignatureUtil.ReadCompressedInt(p, out sz);
                ELEMENT_TYPE?cmod = null;
                if (opt == ELEMENT_TYPE.ELEMENT_TYPE_CMOD_OPT || opt == ELEMENT_TYPE.ELEMENT_TYPE_CMOD_REQD)
                {
                    cmod = opt;
                    p   += 1;
                }
                CLITypeNode sat = new ArrayType(ReadTypeNode(ref p, f));
                if (cmod.HasValue)
                {
                    sat = new CustomModType(cmod.Value, sat);
                }
                return(sat);
            }

            default:
                throw new Exception("Internal error in CLI File Reader library!");
            }
        }
Beispiel #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);
    }
Beispiel #7
0
    public void Filtering(SortSettings settings)
    {
        bool flag = false;

        if (!flag)
        {
            int num = 1 << (int)GetRarity();
            if ((num & settings.rarity) == 0)
            {
                flag = true;
            }
        }
        if (!flag && settings.dialogType != SortBase.DIALOG_TYPE.USE_ITEM)
        {
            if (settings.dialogType == SortBase.DIALOG_TYPE.MATERIAL)
            {
                int num2;
                switch (GetItemType())
                {
                case 7:
                    num2 = 4;
                    break;

                case 14:
                    num2 = 1;
                    break;

                case 15:
                    num2 = 8;
                    break;

                case 6:
                    num2 = 16;
                    break;

                default:
                    num2 = 2;
                    break;
                }
                if ((settings.type & num2) == 0)
                {
                    flag = true;
                }
                ELEMENT_TYPE iconElement = GetIconElement();
                int          num3        = 1 << (int)GetIconElement();
                if ((num3 & settings.element) == 0)
                {
                    flag = true;
                }
            }
            else if (settings.dialogType == SortBase.DIALOG_TYPE.SMITH_CREATE_WEAPON || settings.dialogType == SortBase.DIALOG_TYPE.SMITH_CREATE_ARMOR)
            {
                if ((settings.type & GetItemType()) == 0)
                {
                    flag = true;
                }
                if (getEquipFilterPayAndCreatable(settings.equipFilter))
                {
                    flag = true;
                }
                ELEMENT_TYPE iconElement2 = GetIconElement();
                int          num4         = 1 << (int)GetIconElement();
                if ((num4 & settings.element) == 0)
                {
                    flag = true;
                }
            }
            else if (settings.dialogType == SortBase.DIALOG_TYPE.ABILITY_ITEM)
            {
                if ((settings.type & GetItemType()) == 0)
                {
                    flag = true;
                }
                int num5 = 1 << (int)GetIconElement();
                if ((num5 & settings.element) == 0)
                {
                    flag = true;
                }
            }
            else
            {
                if ((settings.type & GetItemType()) == 0)
                {
                    flag = true;
                }
                int num6 = 1 << (int)GetIconElement();
                if ((num6 & settings.element) == 0)
                {
                    flag = true;
                }
            }
        }
        sortingData <<= 31;
        if (settings.orderTypeAsc == flag)
        {
            sortingData |= 2305843009213693952L;
        }
        sortingData += GetMainorSortWeight();
        if (IsAbsFirst())
        {
            if (settings.orderTypeAsc)
            {
                sortingData = 0L;
            }
            else
            {
                sortingData |= 4611686018427387904L;
            }
        }
    }
Beispiel #8
0
    public override void UpdateUI()
    {
        SetActive((Enum)UI.BTN_NEXT, false);
        SetActive((Enum)UI.OBJ_BONUS_POINT_SHOP, false);
        SetGrid(UI.GRD_DROP_ITEM, null, dropItemIconData.Length, true, delegate(int i, Transform o, bool is_recycle)
        {
            //IL_0287: Unknown result type (might be due to invalid IL or missing references)
            //IL_028c: Unknown result type (might be due to invalid IL or missing references)
            ITEM_ICON_TYPE iTEM_ICON_TYPE        = ITEM_ICON_TYPE.NONE;
            RARITY_TYPE?rarity                   = null;
            ELEMENT_TYPE element                 = ELEMENT_TYPE.MAX;
            EQUIPMENT_TYPE?magi_enable_icon_type = null;
            int icon_id = -1;
            int num     = -1;
            if (i < dropItemIconData.Length && dropItemIconData[i] != null)
            {
                iTEM_ICON_TYPE        = dropItemIconData[i].GetIconType();
                icon_id               = dropItemIconData[i].GetIconID();
                rarity                = dropItemIconData[i].GetRarity();
                element               = dropItemIconData[i].GetIconElement();
                magi_enable_icon_type = dropItemIconData[i].GetIconMagiEnableType();
                num = dropItemIconData[i].GetNum();
                if (num == 1)
                {
                    num = -1;
                }
            }
            bool is_new = false;
            switch (iTEM_ICON_TYPE)
            {
            case ITEM_ICON_TYPE.ITEM:
            case ITEM_ICON_TYPE.QUEST_ITEM:
                {
                    ulong uniqID = dropItemIconData[i].GetUniqID();
                    if (uniqID != 0L)
                    {
                        is_new = MonoBehaviourSingleton <InventoryManager> .I.IsNewItem(iTEM_ICON_TYPE, dropItemIconData[i].GetUniqID());
                    }
                    break;
                }

            default:
                is_new = true;
                break;

            case ITEM_ICON_TYPE.NONE:
                break;
            }
            int enemy_icon_id = 0;
            if (iTEM_ICON_TYPE == ITEM_ICON_TYPE.ITEM)
            {
                ItemTable.ItemData itemData = Singleton <ItemTable> .I.GetItemData(dropItemIconData[i].GetTableID());
                enemy_icon_id = itemData.enemyIconID;
            }
            ItemIcon itemIcon = null;
            if (dropItemIconData[i].GetIconType() == ITEM_ICON_TYPE.QUEST_ITEM)
            {
                itemIcon = ItemIcon.Create(new ItemIcon.ItemIconCreateParam
                {
                    icon_type = dropItemIconData[i].GetIconType(),
                    icon_id   = dropItemIconData[i].GetIconID(),
                    rarity    = new RARITY_TYPE?(dropItemIconData[i].GetRarity()),
                    parent    = o,
                    element   = dropItemIconData[i].GetIconElement(),
                    magi_enable_equip_type = dropItemIconData[i].GetIconMagiEnableType(),
                    num               = dropItemIconData[i].GetNum(),
                    enemy_icon_id     = enemy_icon_id,
                    questIconSizeType = ItemIcon.QUEST_ICON_SIZE_TYPE.REWARD_DELIVERY_LIST
                });
            }
            else
            {
                GET_TYPE getType = dropItemIconData[i].GetGetType();
                itemIcon         = ItemIcon.Create(iTEM_ICON_TYPE, icon_id, rarity, o, element, magi_enable_icon_type, num, "DROP", i, is_new, -1, false, null, false, enemy_icon_id, 0, false, getType);
            }
            itemIcon.SetRewardBG(true);
            itemIcon.SetRewardCategoryInfo(dropItemIconData[i].GetCategory());
            SetMaterialInfo(itemIcon.transform, dropItemIconData[i].GetMaterialType(), dropItemIconData[i].GetTableID(), GetCtrl(UI.PNL_MATERIAL_INFO));
            itemIcon.transform.FindChild("MaterialInfo").get_gameObject().SetActive(false);
            Transform val = SetPrefab(o, "QuestResultDropIconOpener", true);
            QuestResultDropIconOpener.Info info2 = new QuestResultDropIconOpener.Info
            {
                IsRare   = ResultUtility.IsRare(dropItemIconData[i]),
                IsBroken = ResultUtility.IsBreakReward(dropItemIconData[i])
            };
            val.GetComponent <QuestResultDropIconOpener>().Initialized(itemIcon, info2, delegate(Transform t, QuestResultDropIconOpener.Info info, bool is_skip)
            {
                string ui_effect_name = "ef_ui_dropitem_silver_01";
                if (info.IsBroken)
                {
                    ui_effect_name = "ef_ui_dropitem_red_01";
                }
                else if (info.IsRare)
                {
                    ui_effect_name = "ef_ui_dropitem_gold_01";
                }
                SetVisibleWidgetOneShotEffect(GetCtrl(dropItemSCR), t, ui_effect_name);
            });
        });
        base.GetComponent <UITable>((Enum)UI.TBL_GUILD_REQUEST_RESULT).Reposition();
        TreasureStart();
    }
    public static AtkAttribute CalcPlayerATK(PlayerAtkCalcData calcData)
    {
        AtkAttribute  atkAttribute = new AtkAttribute();
        AttackHitInfo atkInfo      = calcData.atkInfo;

        if (atkInfo != null)
        {
            atkAttribute.Add(atkInfo.atk);
        }
        SkillInfo.SkillParam skillParam = calcData.skillParam;
        if (skillParam != null && atkInfo != null && atkInfo.isSkillReference)
        {
            atkAttribute.Add(skillParam.atk);
        }
        if (atkInfo == null)
        {
            atkAttribute.Add(calcData.weaponAtk);
        }
        else if (atkInfo.IsReferenceAtkValue)
        {
            atkAttribute.Add(calcData.weaponAtk);
        }
        atkAttribute.normal += calcData.statusAtk;
        atkAttribute.Add(calcData.guardEquipAtk);
        float        num           = atkAttribute.normal;
        ELEMENT_TYPE eLEMENT_TYPE  = atkAttribute.GetElementType();
        AtkAttribute atkAttribute2 = new AtkAttribute();

        atkAttribute2.Copy(atkAttribute);
        atkAttribute2.Mul(calcData.passiveAtkRate);
        atkAttribute.Add(atkAttribute2);
        atkAttribute.Add(calcData.passiveAtkConstant);
        if (calcData.passiveAtkAllElementConstant != 0f)
        {
            atkAttribute.AddElementValueWithCheck(calcData.passiveAtkAllElementConstant);
        }
        atkAttribute.CheckMinus();
        AtkAttribute atkAttribute3 = new AtkAttribute();

        atkAttribute3.Copy(atkAttribute);
        atkAttribute3.Mul(calcData.buffAtkRate);
        atkAttribute.Add(atkAttribute3);
        atkAttribute.Add(calcData.buffAtkConstant);
        if (calcData.buffAtkAllElementConstant > 0f)
        {
            atkAttribute.AddElementValueWithCheck(calcData.buffAtkAllElementConstant);
        }
        if (skillParam != null && atkInfo != null && atkInfo.isSkillReference)
        {
            if (skillParam.tableData.skillAtkType == ELEMENT_TYPE.MAX)
            {
                eLEMENT_TYPE = ELEMENT_TYPE.MAX;
            }
            else
            {
                num = 0f;
            }
            atkAttribute.ChangeElementType(skillParam.tableData.skillAtkType);
            atkAttribute.Mul(skillParam.atkRate);
        }
        else if (calcData.isAtkElementOnly && eLEMENT_TYPE != ELEMENT_TYPE.MAX)
        {
            num = 0f;
            atkAttribute.ChangeElementType(eLEMENT_TYPE);
        }
        atkAttribute.CheckMinus();
        if (num > 0f && atkAttribute.normal < 1f)
        {
            atkAttribute.normal = 1f;
        }
        if (eLEMENT_TYPE != ELEMENT_TYPE.MAX && atkAttribute.GetElementType() == ELEMENT_TYPE.MAX)
        {
            atkAttribute.SetTargetElement(eLEMENT_TYPE, 1f);
        }
        return(atkAttribute);
    }
Beispiel #10
0
    public static ItemIcon CreateSmallQuestItemIcon(ITEM_ICON_TYPE icon_type, int icon_id, RARITY_TYPE?rarity, Transform parent = null, ELEMENT_TYPE element_type = ELEMENT_TYPE.MAX, int num = -1, string name = null, string event_name = null, int event_data = 0, int toggle_group = -1, bool is_select = false, bool is_new = false)
    {
        string icon_under_text = "×" + num.ToString();
        ItemIconDetailSmall itemIconDetailSmall = ItemIcon.CreateIcon <ItemIconDetailSmall>(MonoBehaviourSingleton <GlobalSettingsManager> .I.linkResources.itemIconDetailSmallPrefab, icon_type, icon_id, rarity, parent, element_type, null, -1, event_name, event_data, is_new, toggle_group, is_select, icon_under_text, false, 0, 0, false, QUEST_ICON_SIZE_TYPE.DEFAULT, GET_TYPE.PAY);

        itemIconDetailSmall.EquipTypeIconInit(null);
        itemIconDetailSmall.SetEquipIndexSprite(-1);
        itemIconDetailSmall.SetIconStatusSprite(ItemIconDetail.ICON_STATUS.NONE);
        itemIconDetailSmall.SetupSelectNumberSprite(-1);
        itemIconDetailSmall.SetFavoriteIcon(false);
        return(itemIconDetailSmall);
    }
    public void ChangeElementType(ELEMENT_TYPE type)
    {
        float num = normal;

        switch (type)
        {
        case ELEMENT_TYPE.FIRE:
            num += fire;
            break;

        case ELEMENT_TYPE.WATER:
            num += water;
            break;

        case ELEMENT_TYPE.THUNDER:
            num += thunder;
            break;

        case ELEMENT_TYPE.SOIL:
            num += soil;
            break;

        case ELEMENT_TYPE.LIGHT:
            num += light;
            break;

        case ELEMENT_TYPE.DARK:
            num += dark;
            break;
        }
        Mul(0f);
        switch (type)
        {
        case ELEMENT_TYPE.FIRE:
            fire = num;
            break;

        case ELEMENT_TYPE.WATER:
            water = num;
            break;

        case ELEMENT_TYPE.THUNDER:
            thunder = num;
            break;

        case ELEMENT_TYPE.SOIL:
            soil = num;
            break;

        case ELEMENT_TYPE.LIGHT:
            light = num;
            break;

        case ELEMENT_TYPE.DARK:
            dark = num;
            break;

        default:
            normal = num;
            break;
        }
    }
Beispiel #12
0
    protected override void UpdateEquipIcon(List <CharaInfo.EquipItem> equip_set_info)
    {
        //IL_0300: Unknown result type (might be due to invalid IL or missing references)
        //IL_0398: Unknown result type (might be due to invalid IL or missing references)
        SetActive(transRoot, UI.LBL_CHANGE_MODE, isVisualMode);
        int i = 0;

        for (int num = 7; i < num; i++)
        {
            SetEvent(FindCtrl(transRoot, icons[i]), "EMPTY", 0);
            SetEvent(FindCtrl(transRoot, icons_btn[i]), "EMPTY", 0);
            SetLabelText(FindCtrl(transRoot, icons_level[i]), string.Empty);
        }
        bool flag  = isVisualMode;
        bool flag2 = isVisualMode;
        bool flag3 = isVisualMode;
        bool flag4 = isVisualMode;

        if (localEquipSet != null)
        {
            int j = 0;
            for (int num2 = localEquipSet.item.Length; j < num2; j++)
            {
                ITEM_ICON_TYPE iTEM_ICON_TYPE = ITEM_ICON_TYPE.NONE;
                RARITY_TYPE?   nullable       = null;
                ELEMENT_TYPE   eLEMENT_TYPE   = ELEMENT_TYPE.MAX;
                int            num3           = -1;
                EquipItemInfo  equipItemInfo  = localEquipSet.item[j];
                EquipItemTable.EquipItemData equipItemData = null;
                if (equipItemInfo != null)
                {
                    switch (equipItemInfo.tableData.type)
                    {
                    case EQUIPMENT_TYPE.ARMOR:
                        flag2 = false;
                        break;

                    case EQUIPMENT_TYPE.HELM:
                        flag = false;
                        break;

                    case EQUIPMENT_TYPE.ARM:
                        flag3 = false;
                        break;

                    case EQUIPMENT_TYPE.LEG:
                        flag4 = false;
                        break;
                    }
                    equipItemData = ((!isVisualMode) ? Singleton <EquipItemTable> .I.GetEquipItemData(equipItemInfo.tableID) : GetVisualModeTargetTable(equipItemInfo.tableData.id, equipItemInfo.tableData.type, record.charaInfo));
                }
                if (isVisualMode)
                {
                    if (equipItemData != null)
                    {
                        iTEM_ICON_TYPE = ItemIcon.GetItemIconType(equipItemData.type);
                        nullable       = equipItemData.rarity;
                        eLEMENT_TYPE   = equipItemData.GetTargetElementPriorityToTable();
                        num3           = equipItemData.GetIconID(MonoBehaviourSingleton <UserInfoManager> .I.userStatus.sex);
                        SetActive(FindCtrl(transRoot, icons_level[j]), false);
                    }
                }
                else if (equipItemInfo != null && equipItemInfo.tableID != 0)
                {
                    num3 = equipItemData.GetIconID(MonoBehaviourSingleton <UserInfoManager> .I.userStatus.sex);
                    SetActive(FindCtrl(transRoot, icons_level[j]), true);
                    string text = string.Format(StringTable.Get(STRING_CATEGORY.MAIN_STATUS, 1u), equipItemInfo.level.ToString());
                    SetLabelText(FindCtrl(transRoot, icons_level[j]), text);
                }
                Transform val = FindCtrl(transRoot, icons[j]);
                val.GetComponentsInChildren <ItemIcon>(true, Temporary.itemIconList);
                int k = 0;
                for (int count = Temporary.itemIconList.Count; k < count; k++)
                {
                    Temporary.itemIconList[k].get_gameObject().SetActive(true);
                }
                Temporary.itemIconList.Clear();
                ItemIcon itemIcon = ItemIcon.CreateEquipItemIconByEquipItemInfo(equipItemInfo, MonoBehaviourSingleton <UserInfoManager> .I.userStatus.sex, val, null, -1, "EQUIP", j, false, -1, false, null, false, false);
                SetLongTouch(itemIcon.transform, "DETAIL", j);
                SetEvent(FindCtrl(transRoot, icons_btn[j]), "DETAIL", j);
                itemIcon.get_gameObject().SetActive(num3 != -1);
                if (num3 != -1)
                {
                    itemIcon.SetEquipExtInvertedColor(equipItemInfo, base.GetComponent <UILabel>((Enum)icons_level[j]));
                }
                UpdateEquipSkillButton(equipItemInfo, j);
            }
            ResetTween(transRoot, UI.OBJ_EQUIP_ROOT, 0);
            PlayTween(transRoot, UI.OBJ_EQUIP_ROOT, true, null, false, 0);
        }
        if (flag && record.charaInfo.hId != 0)
        {
            int            index     = 4;
            int            hId       = record.charaInfo.hId;
            EQUIPMENT_TYPE e_type    = EQUIPMENT_TYPE.HELM;
            CharaInfo      charaInfo = record.charaInfo;
            SetVisualModeIcon(index, hId, e_type, charaInfo);
        }
        if (flag2 && record.charaInfo.aId != 0)
        {
            int            index2     = 3;
            int            aId        = record.charaInfo.aId;
            EQUIPMENT_TYPE e_type2    = EQUIPMENT_TYPE.ARMOR;
            CharaInfo      charaInfo2 = record.charaInfo;
            SetVisualModeIcon(index2, aId, e_type2, charaInfo2);
        }
        if (flag3 && record.charaInfo.rId != 0)
        {
            int            index3     = 5;
            int            rId        = record.charaInfo.rId;
            EQUIPMENT_TYPE e_type3    = EQUIPMENT_TYPE.ARM;
            CharaInfo      charaInfo3 = record.charaInfo;
            SetVisualModeIcon(index3, rId, e_type3, charaInfo3);
        }
        if (flag4 && record.charaInfo.lId != 0)
        {
            int            index4     = 6;
            int            lId        = record.charaInfo.lId;
            EQUIPMENT_TYPE e_type4    = EQUIPMENT_TYPE.LEG;
            CharaInfo      charaInfo4 = record.charaInfo;
            SetVisualModeIcon(index4, lId, e_type4, charaInfo4);
        }
    }
Beispiel #13
0
    private ELEMENT_TYPE ChangeElementToMasterDefineElement(int elementIndex, ELEMENT_CONDITION condition)
    {
        ELEMENT_TYPE result = ELEMENT_TYPE.MAX;

        switch (elementIndex)
        {
        case 1:
            switch (condition)
            {
            case ELEMENT_CONDITION.EQUAL:
                result = ELEMENT_TYPE.FIRE;
                break;

            case ELEMENT_CONDITION.EFFECTIVE_DEF:
                result = ELEMENT_TYPE.SOIL;
                break;

            default:
                result = ELEMENT_TYPE.THUNDER;
                break;
            }
            break;

        case 2:
            switch (condition)
            {
            case ELEMENT_CONDITION.EQUAL:
                result = ELEMENT_TYPE.WATER;
                break;

            case ELEMENT_CONDITION.EFFECTIVE_DEF:
                result = ELEMENT_TYPE.FIRE;
                break;

            default:
                result = ELEMENT_TYPE.SOIL;
                break;
            }
            break;

        case 3:
            switch (condition)
            {
            case ELEMENT_CONDITION.EQUAL:
                result = ELEMENT_TYPE.THUNDER;
                break;

            case ELEMENT_CONDITION.EFFECTIVE_DEF:
                result = ELEMENT_TYPE.WATER;
                break;

            default:
                result = ELEMENT_TYPE.FIRE;
                break;
            }
            break;

        case 4:
            switch (condition)
            {
            case ELEMENT_CONDITION.EQUAL:
                result = ELEMENT_TYPE.SOIL;
                break;

            case ELEMENT_CONDITION.EFFECTIVE_DEF:
                result = ELEMENT_TYPE.THUNDER;
                break;

            default:
                result = ELEMENT_TYPE.WATER;
                break;
            }
            break;

        case 5:
            switch (condition)
            {
            case ELEMENT_CONDITION.EQUAL:
                result = ELEMENT_TYPE.LIGHT;
                break;

            case ELEMENT_CONDITION.EFFECTIVE_DEF:
                result = ELEMENT_TYPE.DARK;
                break;

            default:
                result = ELEMENT_TYPE.MAX;
                break;
            }
            break;

        case 6:
            switch (condition)
            {
            case ELEMENT_CONDITION.EQUAL:
                result = ELEMENT_TYPE.DARK;
                break;

            case ELEMENT_CONDITION.EFFECTIVE_DEF:
                result = ELEMENT_TYPE.LIGHT;
                break;

            default:
                result = ELEMENT_TYPE.MAX;
                break;
            }
            break;
        }
        return(result);
    }
    private void SetItemIcon(Transform holder, ItemSortData data, int event_data = 0)
    {
        ITEM_ICON_TYPE iTEM_ICON_TYPE        = ITEM_ICON_TYPE.NONE;
        RARITY_TYPE?   rarity                = null;
        ELEMENT_TYPE   element               = ELEMENT_TYPE.MAX;
        EQUIPMENT_TYPE?magi_enable_icon_type = null;
        int            icon_id               = -1;
        int            num = -1;

        if (data != null)
        {
            iTEM_ICON_TYPE        = data.GetIconType();
            icon_id               = data.GetIconID();
            rarity                = data.GetRarity();
            element               = data.GetIconElement();
            magi_enable_icon_type = data.GetIconMagiEnableType();
            num = data.GetNum();
            if (num == 1)
            {
                num = -1;
            }
        }
        bool is_new = false;

        switch (iTEM_ICON_TYPE)
        {
        case ITEM_ICON_TYPE.ITEM:
        case ITEM_ICON_TYPE.QUEST_ITEM:
        {
            ulong uniqID = data.GetUniqID();
            if (uniqID != 0L)
            {
                is_new = MonoBehaviourSingleton <InventoryManager> .I.IsNewItem(iTEM_ICON_TYPE, data.GetUniqID());
            }
            break;
        }

        default:
            is_new = true;
            break;

        case ITEM_ICON_TYPE.NONE:
            break;
        }
        int enemy_icon_id = 0;

        if (iTEM_ICON_TYPE == ITEM_ICON_TYPE.ITEM)
        {
            ItemTable.ItemData itemData = Singleton <ItemTable> .I.GetItemData(data.GetTableID());

            enemy_icon_id = itemData.enemyIconID;
        }
        ItemIcon itemIcon = null;

        if (data.GetIconType() == ITEM_ICON_TYPE.QUEST_ITEM)
        {
            ItemIcon.ItemIconCreateParam itemIconCreateParam = new ItemIcon.ItemIconCreateParam();
            itemIconCreateParam.icon_type = data.GetIconType();
            itemIconCreateParam.icon_id   = data.GetIconID();
            itemIconCreateParam.rarity    = data.GetRarity();
            itemIconCreateParam.parent    = holder;
            itemIconCreateParam.element   = data.GetIconElement();
            itemIconCreateParam.magi_enable_equip_type = data.GetIconMagiEnableType();
            itemIconCreateParam.num               = data.GetNum();
            itemIconCreateParam.enemy_icon_id     = enemy_icon_id;
            itemIconCreateParam.questIconSizeType = ItemIcon.QUEST_ICON_SIZE_TYPE.REWARD_DELIVERY_LIST;
            itemIcon = ItemIcon.Create(itemIconCreateParam);
        }
        else
        {
            itemIcon = ItemIcon.Create(iTEM_ICON_TYPE, icon_id, rarity, holder, element, magi_enable_icon_type, num, "DROP", event_data, is_new, -1, false, null, false, enemy_icon_id, 0, false, GET_TYPE.PAY);
        }
        itemIcon.SetRewardBG(true);
        SetMaterialInfo(itemIcon.transform, data.GetMaterialType(), data.GetTableID(), GetCtrl(UI.PNL_MATERIAL_INFO));
    }
Beispiel #15
0
 public string GetName(ELEMENT_TYPE e)
 {
     return e.ToString().ToLower();
 }
Beispiel #16
0
 public static double GetElementRatio(ELEMENT_TYPE attacker, ELEMENT_TYPE defender)
 {
     return(ElementRatio[Convert.ToInt32(attacker), Convert.ToInt32(defender)]);
 }
Beispiel #17
0
 internal static CLIType TypeOf(ELEMENT_TYPE t)
 {
     Debug.Assert(BaseTypes.ContainsKey(t), "Invalid base type!");
     return(BaseTypes[t]);
 }
Beispiel #18
0
 protected uint ElementTypeToMinorSortValue(ELEMENT_TYPE type)
 {
     return((uint)(6 - type));
 }
Beispiel #19
0
 /// <summary>
 /// Build a base type given an ELEMENT_TYPE.
 /// </summary>
 /// <param name="t">Base type</param>
 private BaseType(ELEMENT_TYPE t)
 {
     type = t;
 }
Beispiel #20
0
 public string GetName(ELEMENT_TYPE e)
 {
     return(e.ToString().ToLower());
 }
Beispiel #21
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);
    }