Пример #1
0
    public GameIDData clone()
    {
        GameIDData gd = new GameIDData();

        gd.parse(serverId, type);
        return(gd);
    }
Пример #2
0
    public void onClickTabSlot(UIHeroInventoryTab t, GameIDData data)
    {
        if (UIReinforceBarPanel.isReinforceMode)
        {
            if (t.data == null)
            {
                return;
            }
            reinforcePanel.onClick(t);
        }
        else if (UIComposePanel.isComposeMode)
        {
            if (t.data == null)
            {
                return;
            }
            composePanel.onClick(t);
        }
        else
        {
            selectedSlot = null;
            _selectedTab = t;

            itemDetailPopup.show(data, RuneInfoPopup.Type.Normal, false);
        }
    }
Пример #3
0
    public void startFromSkill(GameIDData originalItemData, int slotIndex)
    {
        GameManager.me.uiManager.uiMenu.uiSkill.btnSort.gameObject.SetActive(false);

        _type = Type.Skill;

//
//		if(originalSlot.isInventorySlot)
//		{
//			isTabSlot = (originalSlot.isChecked);
//		}
//		else
//		{
//			isTabSlot = true;
//		}

//		isTabSlot = !originalSlot.isInventorySlot;

        lbDefaultMessage.text = Util.getUIText("REINFORCE_SKILL");

        GameManager.me.uiManager.uiMenu.uiSummon.btnSort.gameObject.SetActive(false);

        originalSlotIndex = slotIndex;
        originalData      = new GameIDData();
        originalData.parse(originalItemData.serverId, originalItemData.type);

        isTabSlot = (slotIndex < 0);

        slotOriginal.setData(UIChallengeItemSlot.Type.Skill, originalData);

        init();

        GameManager.me.uiManager.uiMenu.uiSkill.invenList.draw(false);
    }
Пример #4
0
    public void setData(GameIDData infoData)
    {
        rare = infoData.rare;

        lbLevel.text = "l" + infoData.level + "/";

        switch (infoData.type)
        {
        case GameIDData.Type.Equip:
            lbName.text = infoData.partsData.name;
            break;

        case GameIDData.Type.Unit:
            lbName.text = infoData.unitData.name;

            break;

        case GameIDData.Type.Skill:
            lbName.text = infoData.skillData.name;
            break;
        }

        lbMaxLevel.text = infoData.maxLevel.ToString();

        Vector3 v = lbLevel.transform.localPosition;

        v.x += lbLevel.printedSize.x;
        v.y  = lbMaxLevel.transform.localPosition.y;
        lbMaxLevel.transform.localPosition = v;
    }
Пример #5
0
    public void onClickSlot(UIHeroInventorySlot s, GameIDData data)
    {
        if (UIReinforceBarPanel.isReinforceMode)
        {
            if (s.data == null)
            {
                return;
            }

            reinforcePanel.onClick(s);
        }
        else if (UIComposePanel.isComposeMode)
        {
            if (s.data == null)
            {
                return;
            }
            composePanel.onClick(s);
        }
        else if (UIMultiSellPanel.isMultiSell)
        {
            if (s.data == null)
            {
                return;
            }
            sellPanel.onClick(s);
        }
        else
        {
            selectedSlot = s;
            _selectedTab = null;

            itemDetailPopup.show(data, RuneInfoPopup.Type.Normal, true);
        }
    }
Пример #6
0
    public void startSellMode(GameIDData sellingItemData)
    {
        resetSelectSlot(sellingItemData, true);

        int slotIndex = -1;

        if (selectSlot != null)
        {
            slotIndex = selectSlot.index;
            sellPanel.startFromSkill(sellingItemData, slotIndex);
        }
        else
        {
            int len = invenList.listGrid.dataList.Count;

            for (int i = 0; i < len; ++i)
            {
                GameIDData[] data = (GameIDData[])invenList.listGrid.dataList[i];

                for (int j = 0; j < invenList.maxPerLine; ++j)
                {
                    if (data[j] == null)
                    {
                        continue;
                    }

                    if (sellingItemData.serverId == data[j].serverId)
                    {
                        sellPanel.startFromSkill(sellingItemData, invenList.maxPerLine * i + j);
                        return;
                    }
                }
            }
        }
    }
Пример #7
0
    public void setData(string id, GameIDData.Type type, bool include512Bg = false)
    {
        if (data == null)
        {
            data = new GameIDData();
        }
        data.parse(id, type);

        switch (data.type)
        {
        case GameIDData.Type.Equip:
            lbName.text = data.partsData.name;
            break;

        case GameIDData.Type.Skill:
            lbName.text = data.skillData.name;
            break;

        case GameIDData.Type.Unit:
            lbName.text = data.unitData.name;
            break;
        }

        setLevel(data.level);

        lbMaxLevel.text = data.maxLevel.ToString();

        showFrame(data.rare, include512Bg);
    }
Пример #8
0
    int onClick(int slotIndex, GameIDData slotData)
    {
        if (sourceListIndex.Contains(slotIndex) == false)
        {
            if (sourceList.Count > 0 && _enoughSelection)
            {
                UISystemPopup.open(UISystemPopup.PopupType.Default, Util.getUIText("REINFORCE_UNNECESSARRY"));
                return(0);
            }

            if (sourceListIndex.Count < 5)
            {
                sourceListIndex.Add(slotIndex);
                sourceList.Add(slotData);
                return(1);
            }
            else
            {
                UISystemPopup.open(UISystemPopup.PopupType.Default, Util.getUIText("REINFORCE_SELECT_LIMIT"));
            }
        }
        else
        {
            int tempI = sourceListIndex.IndexOf(slotIndex);
            sourceListIndex.RemoveAt(tempI);
            sourceList.RemoveAt(tempI);
            return(-1);
        }
        return(0);
    }
    public void setStringData(string str, bool useCantUseCover = true, int slotIndex = -1)
    {
        GameIDData gd = new GameIDData();

        gd.parse(str, GameIDData.Type.Equip);
        setData(gd, useCantUseCover, slotIndex);
    }
    void parseUnitInven(string[] p, bool checkNewItem = false)
    {
        if (checkNewItem && p != null)
        {
            saveNewInvenItem(unitInventoryList);
        }

        unitInventory.Clear();
        unitInventoryList.Clear();
        if (p == null)
        {
            return;
        }
        foreach (string key in p)
        {
//			if(string.IsNullOrEmpty(key)) continue;
            GameIDData ei = new GameIDData();
            ei.parse(key, GameIDData.Type.Unit);

            if (unitInventory.ContainsKey(ei.serverId) == false)
            {
                unitInventory[ei.serverId] = ei;
            }

            unitInventoryList.Add(ei);
        }

        if (checkNewItem)
        {
            settingNewInvenItem(unitInventoryList, GameIDData.Type.Unit);
        }
    }
    void parsePartsInven(string[] equipments, bool checkNewItem = false)
    {
        if (checkNewItem && equipments != null)
        {
            saveNewInvenItem(partsInventoryList);
        }

        partsInventory.Clear();
        partsInventoryList.Clear();

        if (equipments == null)
        {
            return;
        }

        int len = equipments.Length;

        for (int i = 0; i < len; ++i)
        {
            GameIDData ei = new GameIDData();
            ei.parse(equipments[i], GameIDData.Type.Equip);

            if (partsInventory.ContainsKey(ei.serverId) == false)
            {
                partsInventory[ei.serverId] = ei;
            }
            partsInventoryList.Add(ei);
        }

        if (checkNewItem)
        {
            settingNewInvenItem(partsInventoryList, GameIDData.Type.Equip);
        }
    }
Пример #12
0
    public void startPutOff(GameIDData gd)
    {
        for (int i = 0; i < 5; ++i)
        {
            if (GameDataManager.instance.playerUnitSlots[tabPlayer.currentTab][i].isOpen && gd != null)
            {
                if (gd.serverId == GameDataManager.instance.playerUnitSlots[tabPlayer.currentTab][i].unitInfo.serverId)
                {
                    switch (i)
                    {
                    case 0: _slotId = UnitSlot.U1; break;

                    case 1: _slotId = UnitSlot.U2; break;

                    case 2: _slotId = UnitSlot.U3; break;

                    case 3: _slotId = UnitSlot.U4; break;

                    case 4: _slotId = UnitSlot.U5; break;
                    }
                }
            }
        }


        EpiServer.instance.sendUnloadUnitRune(tabPlayer.currentTab, _slotId);
    }
Пример #13
0
    public override void hide(bool isInit = false)
    {
        spSkipModeBackground.gameObject.SetActive(false);

        gameObject.SetActive(false);

        if (isInit == false)
        {
            if (popupType == RuneInfoPopup.Type.Reinforce || popupType == RuneInfoPopup.Type.Compose || popupType == RuneInfoPopup.Type.Evolve || popupType == RuneInfoPopup.Type.Transcend)
            {
                RuneStudioMain.instance.endProcess();
            }
        }

        movablePanel.parent = mainPanel.transform;

        RuneStudioMain.instance.cam512.gameObject.SetActive(false);

        if (sampleHero != null)
        {
            GameManager.me.characterManager.cleanMonster(sampleHero);
            sampleHero = null;
        }

        _compareData = null;

        --GameManager.me.uiManager.popupReforege.step;
    }
Пример #14
0
 public void show(GameIDData d, RuneInfoPopup.Type type, bool isInventorySlot, bool isFirstSequenceForReinforce = true, GameIDData compareData = null)
 {
     show(d, type, d.rare, d.level, isInventorySlot, isFirstSequenceForReinforce, compareData);
     if (isFirstSequenceForReinforce == false)
     {
         btnClose.gameObject.SetActive(true);
     }
 }
Пример #15
0
    void onClickCompose(GameObject go)
    {
        if (btnClose.gameObject.activeSelf == false)
        {
            return;
        }

        if (popupType == RuneInfoPopup.Type.Reinforce && RuneStudioMain.instance.step != RuneStudioMain.Step.Finish)
        {
            Debug.Log("wait...");
            return;
        }

        if (data.rare >= RareType.S)
        {
            UISystemPopup.open(UISystemPopup.PopupType.Default, Util.getUIText("COMPOSE_NOMORE"));
            return;
        }
        else if (data.reinforceLevel < GameIDData.MAX_LEVEL)
        {
            UISystemPopup.open(UISystemPopup.PopupType.Default, Util.getUIText("COMPOSE_LEVELLIMIT"));
            return;
        }
        else
        {
            int composeSourceNumber = 0;

            for (int i = 0; i < GameDataManager.instance.partsInventoryList.Count; ++i)
            {
                if (GameDataManager.instance.partsInventoryList[i].rare == data.rare &&
                    GameDataManager.instance.partsInventoryList[i].reinforceLevel == GameIDData.MAX_LEVEL)
                {
                    ++composeSourceNumber;
                    if (composeSourceNumber > 2)
                    {
                        break;
                    }
                }
            }

            if (isFromInventorySlot)
            {
                --composeSourceNumber;
            }

            if (composeSourceNumber <= 0)
            {
                UISystemPopup.open(UISystemPopup.PopupType.Default, Util.getUIText("NO_COMPOSE_EQUIP", RareType.CHARACTER[data.rare]));
                return;
            }
        }


        hide();

        GameManager.me.uiManager.uiMenu.uiHero.startComposeMode(GameIDData.getClone(data), isFromInventorySlot);
    }
Пример #16
0
    public static GameIDData getClone(GameIDData gd)
    {
        if (gd != null)
        {
            return(gd.clone());
        }

        return(null);
    }
Пример #17
0
    public int getSkillRuneSelectPoint(GameIDData selectSkill)
    {
        //N번 소환룬의 룬 선택포인트 = 장비 레어도 점수 - 레벨차 포인트 * 1 + 룬 강화레벨 * 1
        //int lvPoint = (;
        int equipPoint = getSkillRuneEquipRarePoint();
        int lvPoint    = MathUtil.abs(equipPoint, (selectSkill.rare + 1) * 10);

        return(equipPoint - lvPoint * skillRuneSelectCalcValue.attr[0] + selectSkill.reinforceLevel * skillRuneSelectCalcValue.attr[1]);
    }
    private void refreshSlots()
    {
        if (string.IsNullOrEmpty(nowHero) || GameDataManager.instance.serverHeroData.ContainsKey(nowHero) == false)
        {
            Debug.LogError("Error!");
            return;
        }

        P_Hero heroData = GameDataManager.instance.serverHeroData[nowHero];

        partsSlots[0].setStringData(heroData.selEqts[HeroParts.HEAD], false);
        partsSlots[1].setStringData(heroData.selEqts[HeroParts.BODY], false);
        partsSlots[2].setStringData(heroData.selEqts[HeroParts.WEAPON], false);
        partsSlots[3].setStringData(heroData.selEqts[HeroParts.VEHICLE], false);

        foreach (UIHeroInventorySlot ps in partsSlots)
        {
            ps.slotType = BaseSlot.InventorySlotType.HeroInfoSlot;
        }

        int i = 0;

        foreach (string u in GameDataManager.instance.getSelectUnitRunes(nowHero))
        {
            if (string.IsNullOrEmpty(u))
            {
                summonSlots[i].setData(null);
            }
            else
            {
                GameIDData gd = new GameIDData();
                gd.parse(u, GameIDData.Type.Unit);
                summonSlots[i].setData(gd);
                summonSlots[i].slotType = BaseSlot.InventorySlotType.HeroInfoSlot;
            }

            ++i;
        }

        i = 0;
        foreach (string s in GameDataManager.instance.getSelectSkillRunes(nowHero))
        {
            if (string.IsNullOrEmpty(s))
            {
                skillSlots[i].setData(null);
            }
            else
            {
                GameIDData gd = new GameIDData();
                gd.parse(s, GameIDData.Type.Skill);
                skillSlots[i].setData(gd);
                skillSlots[i].slotType = BaseSlot.InventorySlotType.HeroInfoSlot;
            }
            ++i;
        }
    }
    int onClick(int slotIndex, GameIDData slotData)
    {
        if (sourceIndex == -999)
        {
            sourceIndex = slotIndex;
            source      = slotData;

            slotSource.gameObject.SetActive(true);

            int price = 0;

            switch (_type)
            {
            case Type.Equip:
                slotSource.setData(UIChallengeItemSlot.Type.Equip, source);
                price = GameDataManager.instance.composePrices[source.partsData.character + source.partsData.type + RareType.SERVER_CHARACTER[originalData.rare]];
                break;

            case Type.Skill:
                slotSource.setData(UIChallengeItemSlot.Type.Skill, source);
                price = GameDataManager.instance.composePrices["SKILL" + RareType.SERVER_CHARACTER[originalData.rare]];
                break;

            case Type.Unit:
                slotSource.setData(UIChallengeItemSlot.Type.Unit, source);
                price = GameDataManager.instance.composePrices["UNIT" + RareType.SERVER_CHARACTER[originalData.rare]];
                break;
            }

            slotResult.gameObject.SetActive(true);
            slotResult.setRare(originalData.rare + 1);
            slotResult.setLevel(1);
            slotResult.spBackground.gameObject.SetActive(true);
            slotResult.spBackground.spriteName = UIHeroInventorySlot.SLOT_BG_QUESTION;


            btnCompose.isEnabled = true;
            lbPrice.text         = Util.GetCommaScore(price);
            _currentComposePrice = price;
            return(1);
        }
        else if (slotIndex == sourceIndex)
        {
            sourceIndex = -999;
            source      = null;

            slotSource.infoData = null;
            slotSource.gameObject.SetActive(false);
            slotResult.gameObject.SetActive(false);

            btnCompose.isEnabled = false;
            lbPrice.text         = "0";
            return(-1);
        }
        return(0);
    }
Пример #20
0
 public override void destroy()
 {
     base.destroy();
     skillData      = null;
     _unitSkillData = null;
     uiSlot         = null;
     skillInfo      = null;
     player         = null;
     mon            = null;
 }
    void setParts(GameIDData info)
    {
        clearCharacter();

        spSkillIcon.gameObject.SetActive(false);
        spSkillRare.gameObject.SetActive(false);

        rare = info.rare;

        getPlayer(info);
    }
    void setUnit(GameIDData info)
    {
        clearCharacter();

        spSkillIcon.gameObject.SetActive(false);
        spSkillRare.gameObject.SetActive(false);

        rare = info.rare;

        getMonster(sample, info.unitData, tfStage, info.rare, false);
    }
Пример #23
0
    public void addTest()
    {
        rankers.Clear();
        _tempList.Clear();
        int i, j, len;

        for (i = 0; i < debugIndex + defaultDebugNum; ++i)
        {
            _tempList.Add(GameDataManager.instance.partsInventoryList[0]);
        }

        len = _tempList.Count;

        int totalLine = (Mathf.CeilToInt((float)len / 5.0f) + 1);

        if (totalLine < 3)
        {
            totalLine = 3;
        }
        //		int totalLine = Mathf.CeilToInt( (float)capacity /5.0f );
        bool lockSlot = true;

        for (i = 0; i < totalLine; ++i)
        {
            GameIDData[] str = new GameIDData[maxPerLine];

            for (j = 0; j < maxPerLine; ++j)
            {
                if (i * maxPerLine + j < len)
                {
                    str[j] = _tempList[i * maxPerLine + j];
                }
                else                // if(i*maxPerLine+j >= len)
                {
                    str[j] = null;
                }
            }

            rankers.Add(str);
        }

        _tempList.Clear();

        rankerLen = rankers.Count;

        rankers_obj.Clear();

        setPassData();


        listGrid.setData(panel, rankers_obj, false, 0);
    }
Пример #24
0
    public HeroPartsItem(string character, string id)
    {
        if (string.IsNullOrEmpty(id))
        {
            return;
        }
        characterId = character;
        partsId     = id;

        itemInfo = new GameIDData();
        itemInfo.parse(id, GameIDData.Type.Equip);
        parts = itemInfo.partsData;
    }
    public void playMakeResult(string[] results, bool isShopMode = true)
    {
        if (results == null || results.Length == 0)
        {
            return;
        }

        bool canStartMake = false;

        for (int i = 0; i < results.Length; ++i)
        {
            if (UIRewardNoticePanel.checkReward(results[i], false))
            {
            }
            else if (canStartMake == false)
            {
                GameIDData.Type t = GameIDData.getItemTypeById(results[i]);
                switch (t)
                {
                case GameIDData.Type.Equip:
                case GameIDData.Type.Skill:
                case GameIDData.Type.Unit:
                    canStartMake = true;
                    break;
                }
            }
        }

        if (canStartMake)
        {
            _makingModeIsShop = isShopMode;

            isPlayingMaking = true;

            step = Step.Start;

            if (_makingModeIsShop)
            {
                GameManager.me.uiManager.popupShop.goShopBlocker.gameObject.SetActive(true);
            }

            StartCoroutine(playMakeCt(results));
        }
        else
        {
            if (GameManager.me.uiManager.rewardNotice.isPlaying == false)
            {
                GameManager.me.uiManager.rewardNotice.next();
            }
        }
    }
Пример #26
0
    //========================== 초월재료 정렬 ========================//
    //레어등급 낮은 순 > 제련레벨 낮은 순 > 강화레벨 낮은순
    public static int sortReforgeMaterial(GameIDData x, GameIDData y)
    {
        int i = x.rare.CompareTo(y.rare);

        if (i == 0)
        {
            i = x.totalPLevel.CompareTo(y.totalPLevel);
        }
        if (i == 0)
        {
            i = x.reinforceLevel.Get().CompareTo(y.reinforceLevel.Get());
        }
        return(i);
    }
Пример #27
0
    public static int sortEquipDataByTypeFromLow(GameIDData x, GameIDData y)
    {
        int i = HeroPartsData.sortValueByPartsType(x.partsData.type).CompareTo(HeroPartsData.sortValueByPartsType(y.partsData.type));

        if (i == 0)
        {
            i = HeroPartsData.sortValueByPartsCharacter(x.partsData.character).CompareTo(HeroPartsData.sortValueByPartsCharacter(y.partsData.character));
        }
        if (i == 0)
        {
            i = x.rare.CompareTo(y.rare);                 //		3> 레어도 (레전드>슈퍼레어>레어>노말)\
        }
        return(i);
    }
Пример #28
0
    //레벨	레어도	이름

    public static int sortUnitDataByLevelFromHigh(GameIDData x, GameIDData y)
    {
        int i = y.level.CompareTo(x.level);

        if (i == 0)
        {
            i = y.rare.CompareTo(x.rare);
        }
        if (i == 0)
        {
            i = y.unitData.name.CompareTo(x.unitData.name);
        }
        return(i);
    }
Пример #29
0
    public static int sortUnitDataByNameFromLow(GameIDData x, GameIDData y)
    {
        int i = x.unitData.name.CompareTo(y.unitData.name);

        if (i == 0)
        {
            i = x.rare.CompareTo(y.rare);
        }
        if (i == 0)
        {
            i = x.level.CompareTo(y.level);
        }
        return(i);
    }
Пример #30
0
 public void setData(string skillId)
 {
     if (string.IsNullOrEmpty(skillId))
     {
         isOpen.Set(false);
     }
     else
     {
         infoData = new GameIDData();
         infoData.parse(skillId, GameIDData.Type.Skill);
         id = infoData.id;
         isOpen.Set(true);
     }
 }