10340 【越南】【英文】【BT】【砍树】寻宝多抽优化
| | |
| | | HappyXBModel XBModel { get { return ModelCenter.Instance.GetModel<HappyXBModel>(); } } |
| | | RoleParticularModel model { get { return ModelCenter.Instance.GetModelEx<RoleParticularModel>(); } }
|
| | | PackModel playerPack { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
|
| | | StoreModel storeModel { get { return ModelCenter.Instance.GetModel<StoreModel>(); } }
|
| | | public void Display(int type)
|
| | | {
|
| | | this.type = type;
|
| | |
| | | int costToolCount = funcSet.costToolNums[0];
|
| | | int xbOneMoney = TreasureSetConfig.Get(type).CostMoneyList[0];
|
| | |
|
| | | if (TreasurePavilionModel.Instance.isSkipOneTip)
|
| | | {
|
| | | if (UIHelper.GetMoneyCnt(moneyType) >= (ulong)xbOneMoney)
|
| | | {
|
| | | storeModel.UseMoneyCheck(xbOneMoney, () =>
|
| | | {
|
| | | TreasurePavilionModel.Instance.isEffectPlaying = true;
|
| | | XBModel.SendXBQuest(type, 0, 0);
|
| | | }, 4, fullTip: Language.Get("TreasurePavilion08", xbOneMoney, moneyType, funcSet.costToolIds[0], costToolCount));
|
| | | }
|
| | | else
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("LackMoney", moneyType);
|
| | |
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | ConfirmCancel.MoneyIconToggleConfirm(
|
| | | Language.Get("L1003"),
|
| | | Language.Get("TreasurePavilion08", xbOneMoney, moneyType, funcSet.costToolIds[0], costToolCount),
|
| | | Language.Get("DefaultDialogueBoxWin_TextEnter"),
|
| | | moneyType,
|
| | | xbOneMoney,
|
| | | UIHelper.GetMoneyCnt(moneyType),
|
| | | (bool isOk, bool isToggle) =>
|
| | | {
|
| | | TreasurePavilionModel.Instance.isSkipOneTip = isToggle;
|
| | | if (isOk)
|
| | | {
|
| | |
|
| | | if (UIHelper.GetMoneyCnt(moneyType) >= (ulong)xbOneMoney)
|
| | | {
|
| | | TreasurePavilionModel.Instance.isEffectPlaying = true;
|
| | | XBModel.SendXBQuest(type, 0, 0);
|
| | | }
|
| | | else
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("LackMoney", moneyType);
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | | },
|
| | | true,
|
| | | Language.Get("FlyShoseConfirmwin_Text2"));
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | var funcSet = XBModel.GetXBFuncSet(type);
|
| | | int toolCnt = 0;
|
| | | int needToolCnt = 0;
|
| | | if (XBModel.IsHaveManyXBTool(type, out toolCnt, out needToolCnt))
|
| | | int needMoney = 0;
|
| | | if (XBModel.IsHaveManyXBToolEx(type, out toolCnt, out needToolCnt, out needMoney))
|
| | | {
|
| | | if (toolCnt >= needToolCnt)
|
| | | {
|
| | | XBModel.CheckXBManyLimit(0, type, 2);
|
| | | return;
|
| | | }
|
| | | else
|
| | | {
|
| | | XBModel.CheckXBManyLimit(funcSet.xbPrices[1], type, 0);
|
| | | }
|
| | |
|
| | | }
|
| | | else
|
| | | {
|
| | | TreasurePavilionModel.Instance.isEffectPlaying = false;
|
| | | int moneyType = XBModel.XBCostTypeDict[type];
|
| | | int costToolCount = funcSet.costToolNums[1];
|
| | | int xbManyMoney = TreasureSetConfig.Get(type).CostMoneyList[1];
|
| | | if (TreasurePavilionModel.Instance.isSkipManyTip)
|
| | | {
|
| | | int xbManyMoney = needMoney == 0 ? funcSet.xbPrices[1] : needMoney;
|
| | |
|
| | | if (UIHelper.GetMoneyCnt(moneyType) >= (ulong)xbManyMoney)
|
| | | {
|
| | | storeModel.UseMoneyCheck(xbManyMoney, () =>
|
| | | {
|
| | | TreasurePavilionModel.Instance.isEffectPlaying = true;
|
| | | XBModel.SendXBQuest(type, 1, 0);
|
| | | XBModel.SendXBQuest(type, 1, toolCnt > 0 ? 2 : 0);
|
| | | }, 4, fullTip: Language.Get("TreasurePavilion08", xbManyMoney, moneyType, funcSet.costToolIds[1], needToolCnt - toolCnt));
|
| | | }
|
| | | else
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("LackMoney", moneyType);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | ConfirmCancel.MoneyIconToggleConfirm(
|
| | | Language.Get("L1003"),
|
| | | Language.Get("TreasurePavilion08", xbManyMoney, moneyType, funcSet.costToolIds[1], costToolCount),
|
| | | Language.Get("DefaultDialogueBoxWin_TextEnter"),
|
| | | moneyType,
|
| | | xbManyMoney,
|
| | | UIHelper.GetMoneyCnt(moneyType),
|
| | | (bool isOk, bool isToggle) =>
|
| | | {
|
| | | TreasurePavilionModel.Instance.isSkipManyTip = isToggle;
|
| | | if (isOk)
|
| | | {
|
| | | if (UIHelper.GetMoneyCnt(moneyType) >= (ulong)xbManyMoney)
|
| | | {
|
| | | TreasurePavilionModel.Instance.isEffectPlaying = true;
|
| | | XBModel.SendXBQuest(type, 1, 0);
|
| | | }
|
| | | else
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("LackMoney", moneyType);
|
| | | }
|
| | | }
|
| | | },
|
| | | true,
|
| | | Language.Get("FlyShoseConfirmwin_Text2"));
|
| | | }
|
| | | }
|
| | |
|
| | | });
|
| | | }
|
| | |
|
| | |
| | | public Dictionary<int, int> gubaoItemCountDict = new Dictionary<int, int>(); //古宝碎片背包物品改为数值记录 |
| | | public event Action UpdateGubaoItemCountEvent; |
| | | |
| | | public bool isSkipOneTip = false; //本次登录是否跳过一次购买二次确认窗口 |
| | | public bool isSkipManyTip = false; //本次登录是否跳过多次购买二次确认窗口 |
| | | public bool isWinOpen = false; |
| | | int getA3CBCount; //古宝收到了几次包 |
| | | int m_SelectIndex; //古宝总类型 |
| | |
| | |
|
| | | int toolCnt = 0;
|
| | | int needToolCnt = 0;
|
| | | if (XBModel.IsHaveManyXBTool(type, out toolCnt, out needToolCnt))
|
| | | int needMoney = 0;
|
| | | if (XBModel.IsHaveManyXBToolEx(type, out toolCnt, out needToolCnt, out needMoney))
|
| | | {
|
| | | if (toolCnt >= needToolCnt)
|
| | | {
|
| | |
| | | }
|
| | |
|
| | | int moneyType = XBModel.XBCostTypeDict[type];
|
| | | int xbManyMoney = TreasureSetConfig.Get(type).CostMoneyList[1];
|
| | | XBFuncSet funcSet = XBModel.GetXBFuncSet(type);
|
| | | int xbManyMoney = needMoney == 0 ? funcSet.xbPrices[1] : needMoney;
|
| | |
|
| | | if (UIHelper.GetMoneyCnt(moneyType) >= (ulong)xbManyMoney)
|
| | | {
|
| | | storeModel.UseMoneyCheck(xbManyMoney, () =>
|
| | | {
|
| | | TreasurePavilionModel.Instance.isEffectPlaying = true;
|
| | | XBModel.SendXBQuest(type, 1, 0);
|
| | | }, 3);
|
| | | XBModel.SendXBQuest(type, 1, toolCnt > 0 ? 2 : 0);
|
| | | }, 3, fullTip: Language.Get("TreasurePavilion08", xbManyMoney, moneyType, funcSet.costToolIds[1], needToolCnt - toolCnt));
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | |
|
| | | public void SendXBQuest(int xbNum)
|
| | | {
|
| | | if (!XBModel.CheckIsEmptyGrid(PackType.Treasure)) return;
|
| | | //if (!XBModel.CheckIsEmptyGrid(PackType.Treasure)) return;
|
| | |
|
| | | int moneyType = XBModel.XBCostTypeDict[(int)XBModel.title];
|
| | | int costType = GetCostType(xbNum);
|
| | | bool isMoneyEnough = true;
|
| | | if (xbNum == 0)
|
| | | {
|
| | | isMoneyEnough = UIHelper.GetMoneyCnt(moneyType) >= (ulong)oneMoney;
|
| | | }
|
| | | else
|
| | | {
|
| | | isMoneyEnough = UIHelper.GetMoneyCnt(moneyType) >= (ulong)manyMoney;
|
| | | }
|
| | | //int moneyType = XBModel.XBCostTypeDict[(int)XBModel.title];
|
| | | //int costType = GetCostType(xbNum);
|
| | | //bool isMoneyEnough = true;
|
| | | //if (xbNum == 0)
|
| | | //{
|
| | | // isMoneyEnough = UIHelper.GetMoneyCnt(moneyType) >= (ulong)oneMoney;
|
| | | //}
|
| | | //else
|
| | | //{
|
| | | // isMoneyEnough = UIHelper.GetMoneyCnt(moneyType) >= (ulong)manyMoney;
|
| | | //}
|
| | |
|
| | | switch(costType)
|
| | | {
|
| | | case 0:
|
| | | if (!isMoneyEnough)
|
| | | {
|
| | | //WindowCenter.Instance.Open<RechargeTipWin>();
|
| | | SysNotifyMgr.Instance.ShowTip("LackMoney", moneyType);
|
| | | return;
|
| | | }
|
| | | break;
|
| | | case 1:
|
| | | case 2:
|
| | | //switch(costType)
|
| | | //{
|
| | | // case 0:
|
| | | // if (!isMoneyEnough)
|
| | | // {
|
| | | // //WindowCenter.Instance.Open<RechargeTipWin>();
|
| | | // SysNotifyMgr.Instance.ShowTip("LackMoney", moneyType);
|
| | | // return;
|
| | | // }
|
| | | // break;
|
| | | // case 1:
|
| | | // case 2:
|
| | |
|
| | | break;
|
| | | }
|
| | | // break;
|
| | | //}
|
| | |
|
| | | switch (XBModel.title)
|
| | | {
|
| | | case HappXBTitle.Best:
|
| | | XBModel.SendXBQuest(1, xbNum, costType);
|
| | | break;
|
| | | case HappXBTitle.Rune:
|
| | | XBModel.SendXBQuest(2, xbNum, costType);
|
| | | break;
|
| | | case HappXBTitle.Gubao1:
|
| | | case HappXBTitle.Gubao2:
|
| | | case HappXBTitle.Gubao3:
|
| | | case HappXBTitle.Gubao4:
|
| | | int treasureID = TreasurePavilionModel.Instance.xbIDArr[TreasurePavilionModel.Instance.xbIndex];
|
| | | int treasureType = XBGetItemConfig.Get(treasureID).TreasureType;
|
| | | XBModel.SendXBQuest(treasureType, xbNum, costType);
|
| | | break;
|
| | | case HappXBTitle.GatherSoul:
|
| | | XBModel.SendXBQuest(GatheringSoulModel.xbType, xbNum, costType);
|
| | | break;
|
| | | }
|
| | | //switch (XBModel.title)
|
| | | //{
|
| | | // case HappXBTitle.Best:
|
| | | // XBModel.SendXBQuest(1, xbNum, costType);
|
| | | // break;
|
| | | // case HappXBTitle.Rune:
|
| | | // XBModel.SendXBQuest(2, xbNum, costType);
|
| | | // break;
|
| | | // case HappXBTitle.Gubao1:
|
| | | // case HappXBTitle.Gubao2:
|
| | | // case HappXBTitle.Gubao3:
|
| | | // case HappXBTitle.Gubao4:
|
| | | // int treasureID = TreasurePavilionModel.Instance.xbIDArr[TreasurePavilionModel.Instance.xbIndex];
|
| | | // int treasureType = XBGetItemConfig.Get(treasureID).TreasureType;
|
| | | // XBModel.SendXBQuest(treasureType, xbNum, costType);
|
| | | // break;
|
| | | // case HappXBTitle.GatherSoul:
|
| | | // XBModel.SendXBQuest(GatheringSoulModel.xbType, xbNum, costType);
|
| | | // break;
|
| | | //}
|
| | | }
|
| | |
|
| | | private void OnStartXB(int oneOrMany)
|
| | |
| | | if (IsHaveOneXBTool(xbType))
|
| | | {
|
| | | SendXBQuest(xbType, 0, 2);
|
| | | return;
|
| | | }
|
| | | else
|
| | | {
|
| | | int xbOneMoney = funcSet.xbPrices[0];
|
| | |
|
| | |
|
| | |
|
| | | int moneyType = XBCostTypeDict[xbType];
|
| | | int xbOneMoney = funcSet.xbPrices[0];
|
| | |
|
| | | if (UIHelper.GetMoneyCnt(moneyType) >= (ulong)xbOneMoney)
|
| | | {
|
| | | m_storeModel.UseMoneyCheck(xbOneMoney, () =>
|
| | | {
|
| | | SendXBQuest(xbType, 0, 0);
|
| | | }, xbType == 1 ? 5 : 6, fullTip: Language.Get("TreasurePavilion08", xbOneMoney, moneyType, funcSet.costToolIds[0], 1));
|
| | | }
|
| | | else
|
| | | {
|
| | | //WindowCenter.Instance.Open<RechargeTipWin>();
|
| | | SysNotifyMgr.Instance.ShowTip("LackMoney", moneyType);
|
| | |
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | public void SendXBManyQuest(PackType type, int xbType)
|
| | | {
|
| | |
| | | {
|
| | | int toolCnt = 0;
|
| | | int needToolCnt = 0;
|
| | | if (IsHaveManyXBTool(xbType, out toolCnt, out needToolCnt))
|
| | | int needMoney = 0;
|
| | | if (IsHaveManyXBToolEx(xbType, out toolCnt, out needToolCnt, out needMoney))
|
| | | {
|
| | | if (toolCnt >= needToolCnt)
|
| | | {
|
| | | CheckXBManyLimit(0, xbType, 2);
|
| | |
|
| | | return;
|
| | | }
|
| | | else
|
| | | {
|
| | | CheckXBManyLimit(funcSet.xbPrices[1], xbType, 0);
|
| | | }
|
| | | //needToolCnt = needToolCnt - toolCnt;
|
| | | //int needMoney = needToolCnt * funcSet.xbPrices[0];
|
| | | //if (needMoney > 0)
|
| | | //{
|
| | | // ItemConfig itemConfig = ItemConfig.Get(funcSet.costToolIds[1]);
|
| | | // ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("HappyXBCostTools", funcSet.costToolNums[1], itemConfig.ItemName, needMoney, needToolCnt), (bool isOk) =>
|
| | | // {
|
| | | // if (isOk)
|
| | | // {
|
| | | // CheckXBManyLimit(needMoney, xbType,0);
|
| | | // }
|
| | | // return;
|
| | | // });
|
| | | //}
|
| | | //else
|
| | | //{
|
| | | // CheckXBManyLimit(0, xbType,2);
|
| | | //}
|
| | |
|
| | | }
|
| | |
|
| | | int moneyType = XBCostTypeDict[xbType];
|
| | | int xbManyMoney = needMoney == 0 ? funcSet.xbPrices[1] : needMoney;
|
| | |
|
| | | if (UIHelper.GetMoneyCnt(moneyType) >= (ulong)xbManyMoney)
|
| | | {
|
| | | m_storeModel.UseMoneyCheck(xbManyMoney, () =>
|
| | | {
|
| | | SendXBQuest(xbType, 1, toolCnt > 0 ? 2 : 0);
|
| | | }, xbType == 1 ? 5:6, fullTip: Language.Get("TreasurePavilion08", xbManyMoney, moneyType, funcSet.costToolIds[1], needToolCnt - toolCnt));
|
| | | }
|
| | | else
|
| | | {
|
| | | CheckXBManyLimit(funcSet.xbPrices[1], xbType, 0);
|
| | | SysNotifyMgr.Instance.ShowTip("LackMoney", moneyType);
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | return false;
|
| | | }
|
| | |
|
| | | //needToolCnt 为配表中需要的道具数量
|
| | | public bool IsHaveManyXBTool(int type, out int toolCnt, out int needToolCnt)
|
| | | {
|
| | | toolCnt = 0;
|
| | |
| | | return false;
|
| | | }
|
| | |
|
| | | //needToolCnt 为配表中需要的道具数量
|
| | | // 可获得真正需要补足购买道具的金额
|
| | | public bool IsHaveManyXBToolEx(int type, out int toolCnt, out int needToolCnt, out int needMoney)
|
| | | {
|
| | | toolCnt = 0;
|
| | | needToolCnt = 0; //配置中需要的道具数量
|
| | | needMoney = 0; //真正需要补足购买道具的金额
|
| | | XBFuncSet funcSet = GetXBFuncSet(type);
|
| | | if (funcSet == null) return false;
|
| | |
|
| | | toolCnt = playerPack.GetItemCountByID(PackType.Item, funcSet.costToolIds[1]);
|
| | | needToolCnt = funcSet.costToolNums[1];
|
| | |
|
| | | if (toolCnt > 0)
|
| | | {
|
| | | if (toolCnt < needToolCnt)
|
| | | {
|
| | | needMoney = funcSet.xbPrices[1] / needToolCnt * (needToolCnt - toolCnt);
|
| | | }
|
| | |
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
| | |
|
| | | //花仙玉购买的二次确认框(本次登录) 默认提示 MysticalQG104 是否花费<color=#109d06>{0}</color>仙玉进行购买?
|
| | | //type 对应枚举 BuyStoreItemCheckType 方便记忆
|
| | | public void UseMoneyCheck(int money, Action func, int type = 0, string tip = "MysticalQG104")
|
| | | public void UseMoneyCheck(int money, Action func, int type = 0, string tip = "MysticalQG104", string fullTip = "")
|
| | | {
|
| | | if (money == 0)
|
| | | {
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | ConfirmCancel.ToggleConfirmCancel(Language.Get("Mail101"), Language.Get(tip, money),
|
| | | Language.Get("ConfirmCancel102"), (Action<bool, bool>)((bool isOk, bool isToggle) =>
|
| | | ConfirmCancel.ToggleConfirmCancel(Language.Get("Mail101"), fullTip == "" ? Language.Get(tip, money) : fullTip,
|
| | | Language.Get("ConfirmCancel102"), (bool isOk, bool isToggle) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | |
| | | buyItemCheckDict[type] = isToggle;
|
| | | }
|
| | |
|
| | | }));
|
| | | });
|
| | | }
|
| | |
|
| | |
|
| | |
| | | ActGift = 1, //活动礼包
|
| | | MJXB = 2, //秘境寻宝
|
| | | GatherSoulXB = 3, //聚魂寻宝
|
| | | TreasurePavilion = 4, //古宝寻宝
|
| | | BestXB = 5, //极品寻宝
|
| | | RuneXB = 6, //符文寻宝
|
| | | }
|
| | |
|
| | | //查询其他玩家数据 用途类型
|