コード例 #1
0
        void CunZhang7()
        {
            var text = new string[] {
                @"你们终于回来了,找到苍冥水了么?",
                @"至若:不知道这个是不是,我们遇到了一只苍狼,从它身上找到的",
                @"正是此物,苍冥水本是苍狼性命本源,拥有无限生机,正好可以用来治好东湖身上伤",
                @"不过这苍冥水有些浑浊,怕是那狼恐是暮年",
                @"至若:怪不得这么好对付呢",
                @"巨牙子:东湖那边现在危在旦夕,此物需速速给他服下,你们同我一起去吧。",
                @"是的爷爷",
            };

            NpcDialogInterface.ShowTextList(text, null);
            GameInterface_Package.SellQuestItem((int)ItemData.ItemID.CANG_MING_SHUI);
            GameInterface_Player.SetIntState(GameBool.cunZhangState, 6);
        }
コード例 #2
0
ファイル: LevelUpGem.cs プロジェクト: Xnovae/MobaClient
        void LevelUp()
        {
            if (gems.Count < 2)
            {
                WindowMng.windowMng.ShowNotifyLog("需要放入两个宝石才能升级!");
            }
            else
            {
                var lev = 0;
                foreach (var g in gems)
                {
                    if (g.itemData.Level != lev && lev != 0)
                    {
                        WindowMng.windowMng.ShowNotifyLog("宝石品阶不同不能合成");
                        return;
                    }
                    else
                    {
                        lev = g.itemData.Level;
                    }
                }

                var needLevel = lev * 5;
                var myLev     = ObjectManager.objectManager.GetMyAttr().Level;
                if (needLevel > myLev)
                {
                    WindowMng.windowMng.ShowNotifyLog(string.Format("只有自身达到{0}级,才能熔炼此种宝石", needLevel));
                    return;
                }



                var target = GameInterface_Package.GetAllLevGems(lev + 1);
                if (target.Count == 0)
                {
                    WindowMng.windowMng.ShowNotifyLog("此种宝石已经是最高级了");
                }
                else
                {
                    GameInterface_Package.playerPackage.LevelUpGem(gems);
                }
            }
        }
コード例 #3
0
        void UpdateFrame()
        {
            InitList();
            bool findGem = false;

            if (gems.Count > 0)
            {
                var lev    = gems[0].itemData.Level + 1;
                var target = GameInterface_Package.GetAllLevGemRate(lev);
                if (target > 0)
                {
                    Rate.text = string.Format("[ff9500]成功率:{0}%[-]", target);
                    findGem   = true;
                }
            }
            if (!findGem)
            {
                Rate.text = "";
            }

            StartCoroutine(WaitReset());
        }
コード例 #4
0
        public static void LevelUpGem(KBEngine.Packet packet)
        {
            var inpb = packet.protoBody as CGLevelUpGem;

            if (inpb.GemIdCount == 2)
            {
                var gemId    = inpb.GemIdList [0];
                var gem      = GetItemInPack(gemId);
                var itemData = Util.GetItemData(0, gem.PackEntry.BaseId);

                var targetGem = GameInterface_Package.GetRndGem(itemData.Level + 1);
                if (targetGem != null)
                {
                    AddItemInPackage(targetGem.id, 1);
                    SendNotify("合成成功,本次概率" + GameInterface_Package.lastPossibility);
                }
                else
                {
                    SendNotify("合成失败, 本次概率" + GameInterface_Package.lastPossibility);
                }
                foreach (var g in inpb.GemIdList)
                {
                    ReduceItem(g, 1);
                }
            }
            else if (inpb.GemIdCount == 1)
            {//一键快速合成
                var             gemId     = inpb.GemIdList [0];
                var             gem       = GetItemInPack(gemId);
                var             itemData  = Util.GetItemData(0, gem.PackEntry.BaseId);
                int             count     = gem.PackEntry.Count / 2;
                int             useNum    = count;
                int             allRate   = GameInterface_Package.GetAllGemRate(itemData.Level + 1);
                PropsConfigData targetGem = null;
                int             getNum    = 0;
                while (count > 0)
                {
                    if (targetGem == null)
                    {
                        targetGem = GameInterface_Package.GetRndGem(itemData.Level + 1);
                        if (targetGem != null)
                        {
                            getNum++;
                        }
                    }
                    else
                    {
                        var ret = GameInterface_Package.GetRndGemForId(itemData.Level + 1, targetGem.id, allRate);
                        if (ret > 0)
                        {
                            getNum++;
                        }
                    }
                    count--;
                }
                if (getNum > 0)
                {
                    AddItemInPackage(targetGem.id, getNum);
                }

                ReduceItem(gemId, useNum * 2);
            }
        }
コード例 #5
0
ファイル: DetailInfo.cs プロジェクト: Xnovae/MobaClient
 void OnSell()
 {
     GameInterface_Package.SellItem(backpackData);
     WindowMng.windowMng.PopView();
 }