Exemplo n.º 1
0
    //升级当前装备所需
    public Dictionary <string, int> GetUpOneEquipNum(out long money)
    {
        long Money   = 0;
        int  lv      = 0;
        bool stateOK = false;
        bool LvState = true;

        money = 0;
        // long  upMoney = playerData.GetInstance().baginfo.gold;
        Dictionary <string, int> equipUp = new Dictionary <string, int>();

        if (ed != null)
        {
            if (ed.level + 1 < playerData.GetInstance().selectHeroDetail.lvl)//装备等级不能超过英雄等级
            {
                EquipUpgradeNode itemupnode = FSDataNodeTable <EquipUpgradeNode> .GetSingleton().DataNodeList[ed.level];

                Money = itemupnode.consume;//装备升级到下一级所需消耗

                if (playerData.GetInstance().baginfo.gold > Money)
                {
                    stateOK = true;
                    lv      = itemupnode.id + 1;
                    money   = playerData.GetInstance().baginfo.gold - Money;
                }

                if (stateOK == true)
                {
                    equipUp.Add(ed.site.ToString(), lv - ed.level);
                }
            }
        }

        return(equipUp);
    }
Exemplo n.º 2
0
    public bool IsStrengeOneLv(byte types)
    {
        if (ed != null)
        {
            if (types == 0)                                                       //玩家等级是否满足升级要求
            {
                if (ed.level + 1 > playerData.GetInstance().selectHeroDetail.lvl) //装备等级不能超过英雄等级
                {
                    return(false);
                }
            }

            else if (types == 1)//判断升级所需花费是否满足
            {
                long count = 0;

                EquipUpgradeNode itemupnode = FSDataNodeTable <EquipUpgradeNode> .GetSingleton().DataNodeList[ed.level];

                count = itemupnode.consume;
                if (playerData.GetInstance().baginfo.gold < count)//背包里的钱不够升级所需
                {
                    return(false);
                }
            }
        }
        return(true);
    }
Exemplo n.º 3
0
    public void StrengeOneLv()
    {
        //  long currentGold = playerData.GetInstance().baginfo.gold;

        if (!IsStrengeOneLv(0))//英雄等级不满足
        {
            // PromptPanel.instance.ShowPrompt("请提升英雄等级");
            //UIPromptBox.Instance.ShowLabel("请提升英雄等级");
            //Control.ShowGUI(GameLibrary.UIPromptBox);
            Control.ShowGUI(UIPanleID.UIPromptBox, EnumOpenUIType.DefaultUIOrSecond, false, "请提升英雄等级");
            return;
        }


        if (IsStrengeOneLv(1))//  if (itemupnode.consume < currentGold)
        {
            // upGradelvl = 1;
            EquipUpgradeNode itemupnode = FSDataNodeTable <EquipUpgradeNode> .GetSingleton().DataNodeList[ed.level];

            Dictionary <string, int> equipUp = new Dictionary <string, int>();
            equipUp.Add(ed.site.ToString(), 1);
            equipsendLvUp = 1;
            ClientSendDataMgr.GetSingle().GetHeroSend().SendUpGradeHE(playerData.GetInstance().selectHeroDetail.id, equipUp, (int)itemupnode.consume, C2SMessageType.Active);
        }
        else
        {
            Control.ShowGUI(UIPanleID.UIGoldHand, EnumOpenUIType.DefaultUIOrSecond);
            //UIPromptBox.Instance.ShowLabel("金币不足");
            //Control.ShowGUI(GameLibrary.UIPromptBox);
            // PromptPanel.instance.ShowPrompt("金币不足");
        }
    }
Exemplo n.º 4
0
    public long GetStrenthOne(EquipData ed)
    {
        long count = 0;

        EquipUpgradeNode itemupnode = FSDataNodeTable <EquipUpgradeNode> .GetSingleton().DataNodeList[ed.level];

        count = itemupnode.consume;
        //装备升级到下一级所需消耗

        return(count);
    }
Exemplo n.º 5
0
    public bool isUpLv()
    {
        if (ed != null)
        {
            if (ed.level + 1 < playerData.GetInstance().selectHeroDetail.lvl)//装备等级不能超过英雄等级
            {
                return(false);
            }
            else
            {
                EquipUpgradeNode itemupnode = FSDataNodeTable <EquipUpgradeNode> .GetSingleton().DataNodeList[ed.level];

                long Money = itemupnode.consume;                   //装备升级到下一级所需消耗

                if (playerData.GetInstance().baginfo.gold < Money) //背包里的钱不够升级所需
                {
                    return(false);
                }
            }
        }

        return(true);
    }
Exemplo n.º 6
0
    /// <summary>
    /// 装备升级
    /// </summary>
    void EquipUpgrade()
    {
        //获取装备升级消耗  参数装备等级
        equipUpNodeL = FSDataNodeTable <EquipUpgradeNode> .GetSingleton().FindDataByType(ed.level);

        currentMoney = (UInt32)playerData.GetInstance().baginfo.gold;

        ed.level++;

        if (equipUp.ContainsKey(site.ToString()))
        {
            equipUp[site.ToString()]++;
        }
        else
        {
            equipUp.Add(site.ToString(), 1);
        }

        needGolds += (int)equipUpNodeL.consume;

        //currentMoney -= equipUpNodeL.consume;

        if (ed.level >= hd.lvl)
        {
            //Control.ShowGUI(GameLibrary.UIPromptPanel);
            //PromptPanel.instance.prm = "请提升英雄等级";
            return;
        }

        if (equipUpNodeL.consume > currentMoney)
        {
            print("金币不足,点金手面板");
            return;
        }

        EquipUpgrade();
    }
Exemplo n.º 7
0
    /// <summary>
    /// 装备升级
    /// </summary>
    void EquipUpgrade()
    {
        //判断装备等级是否到达英雄等级,大于从装备列表里清除
        for (int i = upED.Count - 1; i >= 0; i--)
        {
            if (upED[i].level >= hd.lvl)
            {
                upED.Remove(upED[i]);
            }
        }

        //所有装备升到满级时退出
        if (upED.Count <= 0)
        {
            return;
        }

        //计算6件装备升一级所需的金币
        for (int i = 0; i < upED.Count; i++)
        {
            //获取装备当前的等级所需消耗金币
            equipUpNode = FSDataNodeTable <EquipUpgradeNode> .GetSingleton().FindDataByType(upED[i].level);

            AllMoney += (int)equipUpNode.consume;
        }

        if (AllMoney > currentMoney)
        {
            print("金币不足,弹出点金手");
            Control.ShowGUI(UIPanleID.UIGoldHand, EnumOpenUIType.DefaultUIOrSecond);
            return;
        }

        //装备升1级
        for (int i = 0; i < upED.Count; i++)
        {
            //upED[i].level++;

            foreach (int key in hd.equipSite.Keys)
            {
                if (hd.equipSite[key] == upED[i])
                {
                    siteUp = key;
                    break;
                }
            }

            hd.equipSite[siteUp].level++;

            if (equipUp.ContainsKey(siteUp.ToString()))
            {
                equipUp[siteUp.ToString()]++;
            }
            else
            {
                equipUp.Add(siteUp.ToString(), 1);
            }
        }

        //countEQ++;

        //if (countEQ >= 100)
        //{
        //    return;
        //}

        EquipUpgrade();
    }
Exemplo n.º 8
0
    /// <summary>
    /// 更新装备信息
    /// </summary>
    /// <param name="vo"></param>
    public void OnUpdateEquipInfo()
    {
        itemNode = EquipPanel.instance.item;

        hd = playerData.GetInstance().GetHeroDataByID(Globe.selectHero.hero_id);

        hd.equipSite.TryGetValue(site, out ed);

        if (null == ed)
        {
            return;
        }

        icon.spriteName = itemNode.icon_name;
        levelL.text     = "Lv." + ed.level;

        //ItemVO item = VOManager.Instance().GetCSV<ItemCSV>("Item").GetVO(itemNode.props_id);
        //ItemNodeState item;
        //GameLibrary.Instance().ItemStateList.TryGetValue(itemNode.props_id - itemNode.grade, out item);

        long initID = itemNode.props_id - itemNode.grade;

        //初始装备值
        //ItemVO initItem = VOManager.Instance().GetCSV<ItemCSV>("Item").GetVO(initID);
        ItemNodeState initItem;

        GameLibrary.Instance().ItemStateList.TryGetValue(initID, out initItem);

        powerL.text = "力量:+" + itemNode.power;

        //初始值+单阶增加生命*装备等级
        addPowerL.text = "+" + (initItem.power + itemNode.power * ed.level);

        hitL.text = "命中:+" + itemNode.hit_ratio;

        //初始值+单阶增加生命*装备等级
        addHitL.text = "+" + (initItem.hit_ratio + itemNode.hit_ratio * ed.level);

        equipUpNode = FSDataNodeTable <EquipUpgradeNode> .GetSingleton().FindDataByType(ed.level + 1);

        needGold = 0;

        if (ed.level != hd.lvl)
        {
            for (int i = ed.level + 1; i <= hd.lvl; i++)
            {
                needGold += VOManager.Instance().GetCSV <EquipUpgradeCSV>("EquipUpgrade").GetVO(i).consume;
            }
        }

        allUpgradeL.text = "升级至英雄等级";
        allUpGoldL.text  = "" + needGold;

        UpgradeL.text = "升级至" + (ed.level + 1) + "级";
        UpGoldL.text  = "" + equipUpNode.consume;

        needGolds = (int)equipUpNode.consume;

        ShowMaxLvl(true);
        UpdateBorder(ed.grade);

        if (itemmatl.Count > 0)
        {
            for (int i = 0; i < itemmatl.Count; i++)
            {
                itemmatl[i].UpdateCount();
            }
        }
    }