Пример #1
0
    void OnSynthesisBtn()
    {
        print("一键合成");

        runesGlod = 0;

        List <ItemData> runesData = GoodsDataOperation.GetInstance().GetItemListByItmeType(ItemType.Rune);

        for (int i = 0; i < runesData.Count; i++)
        {
            if (!runesDic.ContainsKey(runesData[i].Id))
            {
                runesDic.Add(runesData[i].Id, runesData[i].Count);
            }
        }

        //runesDic = playerData.GetInstance().runesDic;

        indexK = 0;

        RunesRecursion();

        //playerData.GetInstance().runesDic = runesDic;

        foreach (long id in upGradeDic.Keys)
        {
            ClientSendDataMgr.GetSingle().GetHeroSend().SendRunesCompounes(id, upGradeDic[id]);
        }

        RefreshRunes();
    }
Пример #2
0
    public override void ReceiveData(uint messageID)
    {
        base.ReceiveData(messageID);
        switch (messageID)
        {
        case MessageID.common_offer_reward_mission_list_ret:
            SetTaskTrackerShow();
            break;

        case MessageID.common_notice_common_ex_req:    //任务通用协议
            Show();
            if (playerData.GetInstance().taskDataList.itList.Count <= 0)
            {
                Singleton <Notification> .Instance.Send(MessageID.common_ask_offer_reward_mission_req, C2SMessageType.ActiveWait);
            }
            break;

        case MessageID.common_notice_common_ret:
            SetTaskTrackerShow();
            break;

        case MessageID.common_mission_complete_list_ret:
            Singleton <Notification> .Instance.Send(MessageID.common_mission_list_req, C2SMessageType.ActiveWait);

            break;

        case MessageID.common_mission_list_ret:
            if (TaskManager.Single().GetStateTaskList().Count > 0)
            {
                TaskItem item = TaskManager.Single().GetStateTaskList()[0];
                ClientSendDataMgr.GetSingle().GetTaskSend().SendReqTaskInfo(C2SMessageType.Active, item.missionid, item.scripid);
            }
            break;
        }
    }
Пример #3
0
 void FlopAll()
 {
     if (currentFlopCount <= MAX_FLOP)
     {
         if (playerDiamond < GetAllCost())
         {
             //UIPromptBox.Instance.ShowLabel("您的钻石不足");
             Control.ShowGUI(UIPanleID.UIPromptBox, EnumOpenUIType.DefaultUIOrSecond, false, "您的钻石不足请充值");
         }
         else
         {
             if (!flopAnimPlaying)
             {
                 flopAnimPlaying = true;
             }
             else
             {
                 return;
             }
             int[] dn = new int[MAX_FLOP - currentFlopCount + 1];
             for (int i = currentFlopCount; i <= MAX_FLOP; i++)
             {
                 dn[i - currentFlopCount] = i;
             }
             ClientSendDataMgr.GetSingle().GetMobaSend().SendFlopResult(dn);
         }
     }
 }
Пример #4
0
    public void CleanoutDungeons(int count)
    {
        if (IsStrengthEnough(count, false))
        {
            cleanoutCount         = count;
            Globe.autoScenceCount = count;
            if (type == OpenSourceType.Dungeons)
            {
                ClientSendDataMgr.GetSingle().GetBattleSend().SendFlashDungeonFight(scene.bigmap_id, scene.SceneId, scene.Type, cleanoutCount);
                Globe.isSaoDang = true;
            }
            else
            {
                Dictionary <string, long> hero = new Dictionary <string, long>();

                for (int i = 0; i < SumFC().Length; i++)
                {
                    if (!hero.ContainsKey((i + 1).ToString()))
                    {
                        hero.Add((i + 1).ToString(), null == SumFC()[i] ? 0 : SumFC()[i].id);
                    }
                }

                if (SumFC().Length < 6)
                {
                    for (int i = SumFC().Length + 1; i <= 6; i++)
                    {
                        hero.Add((i).ToString(), 0);
                    }
                }
                ClientSendDataMgr.GetSingle().GetBattleSend().SendEventFlashDungeonFight(scene.bigmap_id, scene.SceneId, cleanoutCount, hero);
                Globe.isSaoDang = true;
            }
        }
    }
Пример #5
0
 void OnBuyBtnClick()
 {
     if (type == PromptType.Buy)
     {
         if (moneyCount >= buyCount * needCount)
         {
             ClientSendDataMgr.GetSingle().GetBattleSend().SendBuySomeone(110000100, buyCount);
         }
         else
         {
             RefreshBuyUI(PromptType.Diamond, sn);
         }
     }
     else if (type == PromptType.WarTimes)
     {
         if (moneyCount >= resetDiamond)
         {
             ClientSendDataMgr.GetSingle().GetBattleSend().SendResetEliteDungeon(sn.bigmap_id, sn.SceneId);
         }
         else
         {
             RefreshBuyUI(PromptType.Diamond, sn);
         }
     }
     else
     {
         //充值界面跳转
         //暂无充值界面
     }
     buyBtn.isEnabled = false;
     CDTimer.GetInstance().AddCD(0.5f, (int count, long id) => { buyBtn.isEnabled = true; });
 }
Пример #6
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("金币不足");
        }
    }
Пример #7
0
 private void OnGetLevelGiftBagClick()
 {
     Debug.Log("领取等级礼包奖励");
     UIWelfare._instance.TemporaryData(dtList);
     ClientSendDataMgr.GetSingle().GetEnergySend().SendGetLevelReward(C2SMessageType.ActiveWait, node.id);
     TaskManager.Single().itemlist = dataList;
 }
Пример #8
0
    public void MobaMatchedAndSwitch(OpenSourceType type)
    {
        switch (type)
        {
        case OpenSourceType.Dungeons:
            break;

        case OpenSourceType.ArenaDefen:
            break;

        case OpenSourceType.actGold:
            break;

        case OpenSourceType.actExpe:
            break;

        case OpenSourceType.actPower:
            break;

        case OpenSourceType.actAgile:
            break;

        case OpenSourceType.actIntel:
            break;

        case OpenSourceType.City:
            break;

        case OpenSourceType.Moba:
            Singleton <SceneManage> .Instance.Current   = EnumSceneID.Dungeons;
            Singleton <SceneManage> .Instance.mobaltype = 1;
            ClientSendDataMgr.GetSingle().GetBattleSend().Sendpve_init_moba_fight_req();

            //UI_Loading.LoadScene(GameLibrary.PVP_Moba, 3);
            break;

        case OpenSourceType.Arena:
            break;

        case OpenSourceType.Moba3V3:
            Singleton <SceneManage> .Instance.Current   = EnumSceneID.Dungeons;
            Singleton <SceneManage> .Instance.mobaltype = 3;
            ClientSendDataMgr.GetSingle().GetBattleSend().Sendpve_init_moba_fight_req();

            // UI_Loading.LoadScene(GameLibrary.PVP_Moba3v3, 3);
            break;

        case OpenSourceType.Moba5V5:
            Singleton <SceneManage> .Instance.Current = EnumSceneID.Dungeons;
            //UI_Loading.LoadScene(GameLibrary.PVP_Moba5v5, 3);
            GameLibrary.LastScene = SceneManager.GetActiveScene().name;    //记录前一个场景名
            StartLandingShuJu.GetInstance().GetLoadingData(GameLibrary.PVP_Moba5v5, 3);
            SceneManager.LoadScene("Loding");
            break;

        default:
            break;
        }
        Control.HideGUI(true);
    }
Пример #9
0
    void C2SHeroList(int tyoes, int[] hd)
    {
        if (null == hd)
        {
            Debug.Log("Save failed");
            return;
        }
        Dictionary <string, long> hero = new Dictionary <string, long>();
        int index = 1;

        for (int i = 0; i < hd.Length; i++)
        {
            if (!hero.ContainsKey((index).ToString()))
            {
                hero.Add((index).ToString(), hd[i]);
                index++;
            }
        }
        if (hero.Count < 6)
        {
            for (int i = hero.Count + 1; i <= 6; i++)
            {
                if (CheckStateIsArena() && i == 6)
                {
                    hero.Add((i).ToString(), ThreeState ? 1 : 2);
                    break;
                }
                hero.Add((i).ToString(), 0);
            }
        }
        ClientSendDataMgr.GetSingle().GetHeroSend().SendAssignFightHero(tyoes, hero);
    }
Пример #10
0
    public bool PingBackHandle(CReadPacket packet)
    {
        Dictionary <string, object> data = packet.data;

        uint ct_h = uint.Parse(data["ch"].ToString());
        uint ct_l = uint.Parse(data["cl"].ToString());
        uint st_h = uint.Parse(data["sh"].ToString());
        uint st_l = uint.Parse(data["sl"].ToString());

        {
            System.UInt64 tempNum = ((System.UInt64)(st_h) << 32 | (System.UInt64)(st_l));
            Debug.Log(tempNum);
            if (!ClientSendDataMgr.GetSingle().GetWalkSend().ping)
            {
                ClientSendDataMgr.GetSingle().GetWalkSend().ping = true;
                ClientSendDataMgr.GetSingle().GetWalkSend().Ping();
            }

            // DateTime tempT = new DateTime( 1970 , 1 , 1 , 0 , 0 , 0 );
            // long tempL = long.Parse( tempNum.ToString() );
            // DateTime tempDT1 = tempT.AddMilliseconds( tempL );
            //DateTime tempDT = tempDT1.ToLocalTime();
            //int a1 = tempDT.Year;
            //int a2 = tempDT.Month;
            //int a3 = tempDT.Day;
            //int a4 = tempDT.Hour;
            //int a5 = tempDT.Minute;
            //int a6 = tempDT.Second;
            //int a7 = tempDT.Millisecond;
        }
        return(true);
    }
Пример #11
0
    //进化按钮事件
    void EquipEvolve()
    {
        int needlv = (1 + playerData.GetInstance().selectHeroDetail.grade) * playerData.GetInstance().selectHeroDetail.grade / 2 + 1;

        if (ins.grade + 1 > needlv)
        {
            Control.ShowGUI(UIPanleID.UITooltips, EnumOpenUIType.DefaultUIOrSecond, false, "请提升英雄品质");
            return;
        }
        //if (IsItemMaterialcondition)
        //{
        //    UITooltips.Instance.SetBlackerBottom_Text("进化材料不足,请查看");
        //    Control.ShowGUI(GameLibrary.UITooltips);
        //    return;
        //}
        if (!Ismoney)
        {
            // UITooltips.Instance.SetBlackerBottom_Text("进化金币不足");
            //  Control.ShowGUI(GameLibrary.UITooltips);
            //金币不足时打开点金手面板
            Control.ShowGUI(UIPanleID.UIGoldHand, EnumOpenUIType.DefaultUIOrSecond);
            return;
        }
        //发送通信协议
        ClientSendDataMgr.GetSingle().GetHeroSend().SendHeroEMon(playerData.GetInstance().selectHeroDetail.id, EquipDevelop.GetSingolton().index + 1);
    }
Пример #12
0
    //合成
    public void OncompoundButton()
    {
        if (selectMaterial.syn_condition.Length > 0)
        {
            if (isCompoundcondition(1))
            {
                ClientSendDataMgr.GetSingle().GetHeroSend().SendHeroECom(selectMaterial.props_id, 1);
            }
            else
            {
                Control.ShowGUI(UIPanleID.UITooltips, EnumOpenUIType.DefaultUIOrSecond, false, "材料不足");
            }

            if (isCompoundcondition(0))
            {
                ClientSendDataMgr.GetSingle().GetHeroSend().SendHeroECom(selectMaterial.props_id, 1);
            }
            else
            {
                Control.ShowGUI(UIPanleID.UIGoldHand, EnumOpenUIType.DefaultUIOrSecond);
            }
        }
        else
        {
            if (isCompoundcondition(0))
            {
                ClientSendDataMgr.GetSingle().GetHeroSend().SendHeroECom(selectMaterial.props_id, 1);
            }
            else
            {
                Control.ShowGUI(UIPanleID.UIGoldHand, EnumOpenUIType.DefaultUIOrSecond);
            }
        }
    }
Пример #13
0
    /// <summary>
    /// 重新连接服务器
    /// </summary>
    private void ReLogin()
    {
        if (Globe.SelectedServer != null)
        {
            bool bConnect = ClientNetMgr.GetSingle().StartConnect(Globe.SelectedServer.ip, Globe.SelectedServer.port);

            if (bConnect)
            {
                Control.ShowGUI(UIPanleID.UIWaitForSever, EnumOpenUIType.DefaultUIOrSecond);
                ClientSendDataMgr.GetSingle().GetLoginSend().SendCheckAccount();
                //Hide();
                Control.HideGUI(this.GetUIKey());
            }
            else
            {
                //ShowLabel("重连失败,请检查网络重启游戏!");
                RefreshData("重连失败,请检查网络重启游戏!");
            }
        }
        else
        {
            //Hide();
            Control.HideGUI(this.GetUIKey());
        }
    }
Пример #14
0
    /// <summary>
    /// 退出战斗按钮事件
    /// </summary>
    private void OnQuitBattleBtnClick(bool isClick)
    {
        //Globe.isHeroPlay = false;
        //Globe.isUpdate = false;
        if (SceneManager.GetActiveScene().name == "LGhuangyuan" || SceneManager.GetActiveScene().name == GameLibrary.PVP_1V1)
        {
            ClientSendDataMgr.GetSingle().GetLoginSend().SendChengeScene(playerData.GetInstance().selfData.mapID, 20000, 2);
            Globe.isC       = false;
            Globe.isRefresh = false;
            Time.timeScale  = 1;

            if (GameLibrary.isMoba)
            {
                GameLibrary.isMoba = false;
            }
            if (GameLibrary.isPVP3)
            {
                GameLibrary.isPVP3 = false;
            }
            if (Globe.isFB)
            {
                Globe.isFB = false;
            }
            Globe.isLoadOutCity = true;
            Control.HideGUI(UIPanleID.UIPause);
        }
        else
        {
            Time.timeScale = 1;

            if (!Globe.isFB && GameLibrary.isMoba)
            {
                ClientSendDataMgr.GetSingle().GetMobaSend().SendMobaResult(2);
                GameLibrary.isMoba = false;
            }

            if (Globe.isFB)
            {
                SceneBaseManager.instance.WinCondition(false, true);
                SceneBaseManager.instance.StopBaseAllCoroutinesAndInvok();
                GameLibrary.dungeonId = 0;
                Globe.isFB            = false;
            }

            Globe.isC       = false;
            Globe.isRefresh = false;

            if (GameLibrary.isPVP3)
            {
                GameLibrary.isPVP3 = false;
            }

            Control.HideGUI(UIPanleID.UIPause);
            Singleton <SceneManage> .Instance.Current = EnumSceneID.UI_MajorCity01;
            //UI_Loading.LoadScene(GameLibrary.UI_Major, 3);
            GameLibrary.LastScene = SceneManager.GetActiveScene().name;//记录前一个场景名
            StartLandingShuJu.GetInstance().GetLoadingData(GameLibrary.UI_Major, 3);
            SceneManager.LoadScene("Loding");
        }
    }
Пример #15
0
 private void AddFriendEvent()
 {
     Debug.Log("发送添加好友");
     //Hide();
     Control.HideGUI(this.GetUIKey());
     ClientSendDataMgr.GetSingle().GetFriendSend().FriendsAdd(Globe.privateChatPlayerId, Globe.privateChatPlayerAId);
 }
Пример #16
0
 private void ShieldEvent()
 {
     Debug.Log("将该玩家加入黑名单");
     //Hide();
     Control.HideGUI(this.GetUIKey());
     ClientSendDataMgr.GetSingle().GetFriendSend().FriendsDelete(Globe.privateChatPlayerId, (int)Friends.Delete);
 }
Пример #17
0
 private void OnRefreshClick()
 {
     if (playerData.GetInstance().baginfo.diamond > refreshPrice)
     {
         ClientSendDataMgr.GetSingle().GetCShopSend().RefreshGoodsList(_index, count, refreshPrice);
     }
 }
Пример #18
0
    /// <summary>
    /// 升级按钮
    /// </summary>
    private void OnUpgradeBtnClick()
    {
        long currentGold = playerData.GetInstance().baginfo.gold;

        if (ed.level >= hd.lvl)
        {
            PromptPanel.instance.ShowPrompt("请提升英雄等级");
            return;
        }

        upGradelvl = 0;
        equipUp    = new Dictionary <string, int>();

        if (equipUpNode.consume < currentGold)
        {
            upGradelvl = 1;

            equipUp.Add(site.ToString(), 1);

            ClientSendDataMgr.GetSingle().GetHeroSend().SendUpGradeHE(hd.id, equipUp, (int)equipUpNode.consume, C2SMessageType.Active);
        }
        else
        {
            PromptPanel.instance.ShowPrompt("金币不足");
        }
    }
Пример #19
0
 /// <summary>
 /// 跳过当前任务对话(闲聊的跳过不发协议关闭按钮  非对话任务的跳过 发送跳过下一)
 /// </summary>
 public void SkipCurrentTaskTalk(bool isSmalltalk)
 {
     contonts.Clear();
     TaskManager.Single().contonts.Clear();
     ShowTaskHidePanel();
     Control.HideGUI(this.GetUIKey());
     //Hide();
     HeroPosEmb.transform.Find("NpcPos").gameObject.SetActive(false);
     if (heroObj != null)
     {
         Destroy(heroObj);
     }
     if (!isSmalltalk)
     {
         ClientSendDataMgr.GetSingle().GetTaskSend().OpenDialogUI(
             TaskManager.Single().CurrentShowDialogItem.msId,
             0,
             TaskManager.Single().CurrentShowDialogItem.user[0],
             1,
             TaskManager.Single().CurrentShowDialogItem.user[2],
             0
             );
     }
     isDialogueTask = false;
     isSmalltalk    = true;
     isNpc          = true;
     isPlayer       = false;
     TaskManager.Single().isSmalltalk    = true;
     TaskManager.Single().isDialogueTask = false;
 }
Пример #20
0
 //一键升级
 void OneBtnUpgradeClick()
 {
     Debug.Log(hd.id);
     if (hd.lvl < playerData.GetInstance().selfData.level)
     {
         Debug.Log(FSDataNodeTable <HeroUpGradeNode> .GetSingleton().DataNodeList[hd.lvl].exp);
         if (playerData.GetInstance().selfData.expPool > FSDataNodeTable <HeroUpGradeNode> .GetSingleton().DataNodeList[hd.lvl].exp)
         {
             //发送升级的请求
             ClientSendDataMgr.GetSingle().GetHeroSend().SendDrugUpgrade(hd.id, 2);
         }
         else
         {
             //弹出链接位置
             //Control.ShowGUI(GameLibrary.UIExptips);
             //经验不足
             //Control.ShowGUI(GameLibrary.UIExpPropPanel);
             Control.ShowGUI(UIPanleID.UIExpPropPanel, EnumOpenUIType.DefaultUIOrSecond);
         }
     }
     else
     {
         Control.ShowGUI(UIPanleID.UITooltips, EnumOpenUIType.DefaultUIOrSecond, false, "请提升战队等级");
     }
 }
Пример #21
0
    public void OnAutoClick()
    {
        CancelTp();
        if (SceneManager.GetActiveScene().name != GameLibrary.LGhuangyuan)
        {
            if (!Enabled || CharacterManager.playerCS == null)
            {
                return;
            }
            bool isAuto = CharacterManager.playerCS.pm.isAutoMode;
            CharacterManager.instance.SwitchAutoMode(!isAuto);
        }
        else
        {
            //龙骨荒原里自动战斗先用于玩家复活了,策划得加复活机制了
            int            hp = 0;
            CharacterState cs = null;

            if (CharacterManager.player != null)
            {
                cs = CharacterManager.player.GetComponent <CharacterState>();
            }
            if (cs != null)
            {
                hp = cs.maxHp;
            }
            ClientSendDataMgr.GetSingle().GetWalkSend().SendPlayerRevive(0, 0, 1, hp);
        }
    }
Пример #22
0
    public void Start()
    {
        //if (m_LoginScene)
        //{
        //    mProcess = transform.FindChild("up").GetComponent<UISlider>();
        //}
        //else
        //{
        Transform mytra = transform;

        mProcess  = mytra.FindChild("ProgressBar_liner/up").GetComponent <UISlider>();
        m_backImg = mytra.FindChild("BG").GetComponent <UISprite>();
        //m_roleRunImg = mytra.FindChild("UI_jiazaiObjAnchor/UI_jiazai/Control - Colored Slider/LoadRoleAnimations/LoadRoleAnimation").GetComponent<UISprite>();
        //m_roleRunImg.gameObject.SetActive(roleShow);
        //m_showText = mytra.FindChild("UI_jiazaiObjAnchor/UI_jiazai/Label").GetComponent<UILabel>();
        //m_SpriteList = new UISprite[4];
        //m_SpriteList[0] = m_backImg;
        //m_SpriteList[1] = m_roleRunImg;
        //m_SpriteList[2] = mytra.FindChild("UI_jiazaiObjAnchor/UI_jiazai/Control - Colored Slider").GetComponent<UISprite>();
        //m_SpriteList[3] = mytra.FindChild("UI_jiazaiObjAnchor/UI_jiazai/Control - Colored Slider/Foreground").GetComponent<UISprite>();
        //single = this;
        if (!m_isLoaded)
        {
            //selfOb = gameObject;
            //if (SwitchingScence.GetScence().dengBool)
            //{
            //    Application.LoadLevel("DengLu");
            //}
            //else
            {
                //DontDestroyOnLoad(selfOb.transform.parent);
                //Debug.Log(Time.time);

                //StartCoroutine(LoadScence());
                //mCurrentNum = 0f;
            }
            RandomBaseTexture();
            startGetServerTime = Time.time + 10f;
        }
        //backImg = FSDataNodeTable<LoadingUINode>.GetSingleton().DataNodeList[baseTexture].UI_type;
        //m_backImg.spriteName = backImg;

        // m_showText.text = showText;
        if (GameLibrary.LastScene == GameLibrary.UI_Major)
        {
            //Debug.Log("<color=#10DF11>scripId</color>" + playerData.GetInstance().guideData.scripId + "<color=#10DF11>typeId</color>" + playerData.GetInstance().guideData.typeId
            //    + "<color=#10DF11>stepId</color>" + playerData.GetInstance().guideData.stepId + "<color=#10DF11>uId</color>" + playerData.GetInstance().guideData.uId);
            playerData.GetInstance().guideData.scripId = 0;
            playerData.GetInstance().guideData.typeId = 0;
            playerData.GetInstance().guideData.stepId = 0;
            playerData.GetInstance().guideData.uId = 0;
            ClientSendDataMgr.GetSingle().GetGuideSend().SendGuidStep(99);
            //Debug.Log("<color=#10DF11>scripId</color>" + playerData.GetInstance().guideData.scripId + "<color=#10DF11>typeId</color>" + playerData.GetInstance().guideData.typeId
            //   + "<color=#10DF11>stepId</color>" + playerData.GetInstance().guideData.stepId + "<color=#10DF11>uId</color>" + playerData.GetInstance().guideData.uId);
        }

        UI_Loading.LoadScene(Globe.LoadScenceName, Globe.LoadTime, Globe.callBack, Globe.completed);

        //}
    }
Пример #23
0
    //合成
    void EquipCompoundOnClick()
    {
        int  needcount = GameLibrary.Instance().ItemStateList[propid].syn_condition.Length / 2;
        long itemid;
        int  itemcount;
        bool isenable = true;

        for (int i = 0; i < needcount; i++)
        {
            itemid    = GameLibrary.Instance().ItemStateList[propid].syn_condition[i, 0];
            itemcount = (int)GameLibrary.Instance().ItemStateList[propid].syn_condition[i, 1];
            if (GoodsDataOperation.GetInstance().GetItemCountById(itemid) < itemcount)
            {
                isenable = false;
                break;
            }
        }
        if (isenable)
        {
            ClientSendDataMgr.GetSingle().GetHeroSend().SendHeroECom(propid, 1);
        }
        else
        {
            Control.ShowGUI(UIPanleID.UITooltips, EnumOpenUIType.DefaultUIOrSecond, false, "材料不足.");
        }
    }
Пример #24
0
    /// <summary>
    /// 返回按钮
    /// </summary>
    private void OnBackBtnClick()
    {
        HeroID = 0;
        HeroAndEquipNodeData.TanNUm = 0;
        HeroPosEmbattle.instance.HideModel();
        //关闭界面时,发送数据
        if (isSendDrug)
        {
            heroIDD = 0;
            itemIDD = 0;
            countD  = 0;
            levelD  = 0;

            isSendDrug = false;
        }

        //Control.HideGUI(GameLibrary.UI_HeroDetail);
        //Control.ShowGUI(GameLibrary.UIHeroList);
        Control.HideGUI();
        //切换场景打断声音
        AudioController.Instance.StopUISound();

        //serverMgr.GetInstance().SetCurrentPoint(skillCount);
        //serverMgr.GetInstance().SetFullTime(Auxiliary.GetNowTime() + (20 - skillCount) * 600);
        //serverMgr.GetInstance().saveData();


        if (GameLibrary.skillLevelcount.Count > 0)
        {
            ClientSendDataMgr.GetSingle().GetHeroSkillSend().SendUpgradeMsg(Globe.selectHero.hero_id, GameLibrary.skillLevelcount);
            GameLibrary.skillLevelcount.Clear();
        }
    }
Пример #25
0
    /// <summary>
    /// 进阶按钮
    /// </summary>
    private void OnAdvancedBtnClick()
    {
        EquipData ed;
        int       index = 0;

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

        for (int i = 1; i <= hd.equipSite.Count; i++)
        {
            hd.equipSite.TryGetValue(i, out ed);

            if (ed.grade >= 2 && hd.grade == 1)
            {
                index += ed.grade;
            }
            else if (ed.grade >= 4 && hd.grade == 2)
            {
                index += ed.grade;
            }
            else if (ed.grade >= 7 && hd.grade == 3)
            {
                index += ed.grade;
            }
            else if (ed.grade >= 11 && hd.grade == 4)
            {
                index += ed.grade;
            }
            else if (ed.grade >= 16 && hd.grade == 5)
            {
                index += ed.grade;
            }
        }

        if (AdvancedRules(index))
        {
            HeroAndEquipNodeData.HD = hd;
            int level = 0;
            foreach (var item in FSDataNodeTable <HeroAttrNode> .GetSingleton().DataNodeList.Values)
            {
                if (item.grade == hd.grade && item.name == hd.node.name)
                {
                    level = item.break_lv;
                }
            }
            if (level <= playerData.GetInstance().selectHeroDetail.lvl)
            {
                ClientSendDataMgr.GetSingle().GetHeroSend().SendHeroAdvanced(Globe.selectHero.hero_id);
            }
            else
            {
                Control.ShowGUI(UIPanleID.UITooltips, EnumOpenUIType.DefaultUIOrSecond, false, "进阶下一级需要达到" + level);
            }
        }
        else
        {
            Control.ShowGUI(UIPanleID.UITooltips, EnumOpenUIType.DefaultUIOrSecond, false, "请提升装备品质");
            //PromptPanel.instance.ShowPrompt();
        }
    }
Пример #26
0
 private void AddFriendEvent()
 {
     grid.Reposition();
     Debug.Log("发送添加好友");
     //Hide();
     Control.HideGUI(this.GetUIKey());
     ClientSendDataMgr.GetSingle().GetFriendSend().FriendsAdd(memberData.playerId, memberData.accountId);
 }
Пример #27
0
 public bool ServerOnQuit(CReadPacket packet)
 {
     ClientSendDataMgr.GetSingle().GetHeroSend().SendQuitGame();
     //UIPromptBox.Instance.ShowLabel("服务器维护中!请重新登录");
     //Control.ShowGUI(GameLibrary.UIPromptBox);
     Control.ShowGUI(UIPanleID.UIPromptBox, EnumOpenUIType.DefaultUIOrSecond, false, "服务器维护中!请重新登录");
     return(true);
 }
Пример #28
0
    public void SendMeg()
    {
        string heroId = StringUtil.StrReplace((SelectCard.selectCardId).ToString(), "201", 0, 3);

        GameLibrary.player = long.Parse(heroId);
        ClientSendDataMgr.GetSingle().GetLoginSend().SendCreateRole(nicknameInput.text, heroId, Globe.SelectedServer.areaId.ToString());
        serverMgr.GetInstance().saveData();
    }
Пример #29
0
    private void OnSureBtnClick()
    {
        //发送使用经验药水协议

        //ClientSendDataMgr.GetSingle().GetItemSend().SendSellItem(equipItem.itmeid, equipItem.itemuuid, currentCount);
        //ClientSendDataMgr.GetSingle().GetItemSend().SendSellItem(GameLibrary.saleItemList);
        ClientSendDataMgr.GetSingle().GetItemSend().SendUseItem(equipItem.Id, equipItem.Uuid, currentCount);
        Control.HideGUI(this.GetUIKey());
        //Hide();
    }
Пример #30
0
    /// <summary>
    /// 召唤按钮
    /// </summary>
    void OnSummonBtnClick()
    {
        UIHeroList.instance.getHeroPanel.hero = heroNode;

        //记录召唤英雄
        UIHeroList.instance.summmonHero = heroNode.hero_id;
        UIHeroList.instance.SaveSoul(heroNode.soul_gem, starUpNode.call_stone_num);

        ClientSendDataMgr.GetSingle().GetHeroSend().SendSoulStoneChangeHero(heroNode.hero_id, heroNode.init_star, heroNode.soul_gem, starUpNode.call_stone_num);
    }