From 2638c8b67d1dcac1c774f942ac144579c6f82ec1 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 11 九月 2018 21:41:11 +0800
Subject: [PATCH] 3479 【后端】【主干】【1.0.15】助战发送喊话时新增逻辑(自动加入匹配中的队伍);
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTreasure.py | 57 +++++++++++++++++++++++++++++++++++----------------------
1 files changed, 35 insertions(+), 22 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTreasure.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTreasure.py
index 375083d..8d224cc 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTreasure.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTreasure.py
@@ -70,7 +70,7 @@
treasureType = clientData.TreasureType
treasureIndex = clientData.TreasureIndex
costType = clientData.CostType
-
+ isFreeType = 1 if costType == 1 else 0
GameWorld.DebugLog("玩家寻宝: treasureType=%s,treasureIndex=%s,costType=%s,playerLV=%s"
% (treasureType, treasureIndex, costType, playerLV), playerID)
@@ -89,8 +89,8 @@
return
packType = ShareDefine.rptTreasure
- if treasureType == 2:
- packType = ShareDefine.rptRune
+ #if treasureType == 2:
+ # packType = ShareDefine.rptRune
if not ItemCommon.CheckPackHasSpace(curPlayer, packType, True):
GameWorld.DebugLog("对应寻宝背包没有空格子!packType=%s" % packType, playerID)
@@ -116,14 +116,24 @@
if not costItemList:
GameWorld.ErrLog("该寻宝类型索引不支持消耗道具寻宝!treasureType=%s,treasureIndex=%s" % (treasureType, treasureIndex), playerID)
return
- costItemID, costItemCount = costItemList[treasureIndex]
- if not costItemID or not costItemCount:
+ costItemID, costItemNeedCount = costItemList[treasureIndex]
+ if not costItemID or not costItemNeedCount:
return
costItemIndexList, bindCnt, unBindCnt = ItemCommon.GetPackItemBindStateIndexInfo(curPlayer, costItemID)
- if bindCnt + unBindCnt < costItemCount:
- GameWorld.DebugLog("寻宝消耗道具不足!costItemID=%s,costItemCount=%s,bindCnt=%s,unBindCnt=%s"
- % (costItemID, costItemCount, bindCnt, unBindCnt), playerID)
- return
+ lackCount = max(0, costItemNeedCount - bindCnt - unBindCnt)
+ delCostItemCount = costItemNeedCount - lackCount
+ lackCountCostMoney = 0
+ if lackCount > 0:
+ lackCountCostMoney = ItemCommon.GetAutoBuyItemNeedGold({costItemID:lackCount})
+ if lackCountCostMoney:
+ moneyType = IPY_GameWorld.TYPE_Price_Gold_Money
+ infoDict = {ChConfig.Def_Cost_Reason_SonKey:costItemID}
+ if not PlayerControl.HaveMoney(curPlayer, moneyType, lackCountCostMoney):
+ return
+ else:
+ GameWorld.DebugLog("寻宝消耗道具不足!costItemID=%s,costItemNeedCount=%s,bindCnt=%s,unBindCnt=%s"
+ % (costItemID, costItemNeedCount, bindCnt, unBindCnt), playerID)
+ return
# 仙玉寻宝
else:
@@ -149,19 +159,19 @@
commItemRateList = GetUpdLuckyItemRateList(ipyData, curLuck, luckFormula, costType) # 常规产出物品格子饼图,幸运物品概率已变更
- curTreasureCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TreasureCount % (treasureType)) # 当前已寻宝次数
+ curTreasureCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TreasureCount % (treasureType, isFreeType)) # 当前已寻宝次数
updTreasureCount = curTreasureCount + treasureCount
- beSureCountDict = ipyData.GetGridItemRateList3() # 第x次必出产出格子编号饼图
+ beSureCountDict = ipyData.GetFreeGridItemRateList3() if isFreeType else ipyData.GetGridItemRateList3() # 第x次必出产出格子编号饼图
GameWorld.DebugLog("已经寻宝次数=%s,当前幸运=%s,commItemRateList=%s" % (curTreasureCount, curLuck, commItemRateList), playerID)
addScore = IpyGameDataPY.GetFuncEvalCfg(TreasureSet1, 5)[treasureIndex] # 增加积分
- ensureCount = IpyGameDataPY.GetFuncCfg("TreasureSet", 1) # 每多少次触发保底产出库
-
+ ensureCount = IpyGameDataPY.GetFuncEvalCfg("TreasureSet", 1, {})[isFreeType] # 每多少次触发保底产出库
+ ensureRateList = ipyData.GetFreeGridItemRateList2() if isFreeType else ipyData.GetGridItemRateList2()
goodGridNumList = [ipyData.GetLuckyGridNum()] # 好物品格子编号 (幸运物品 + 必出 + 保底)
- for gridRateList in ipyData.GetGridItemRateList3().values():
+ for gridRateList in beSureCountDict.values():
for gridRateInfo in gridRateList:
goodGridNumList.append(gridRateInfo[1])
- for gridRateInfo in ipyData.GetGridItemRateList2():
+ for gridRateInfo in ensureRateList:
goodGridNumList.append(gridRateInfo[1])
GameWorld.DebugLog("goodGridNumList=%s" % goodGridNumList, playerID)
@@ -182,7 +192,7 @@
gridNum = GameWorld.GetResultByRandomList(gridNumRateList)
GameWorld.DebugLog("到达次数必出,updTreasureCount=%s,gridNumRateList=%s,gridNum=%s" % (updTreasureCount, gridNumRateList, gridNum), playerID)
elif updTreasureCount % ensureCount == 0:
- gridNumRateList = ipyData.GetGridItemRateList2()
+ gridNumRateList = ensureRateList
gridNum = GameWorld.GetResultByRandomList(gridNumRateList)
GameWorld.DebugLog("满次数保底出,updTreasureCount=%s,gridNumRateList=%s,gridNum=%s" % (updTreasureCount, gridNumRateList, gridNum), playerID)
else:
@@ -206,11 +216,11 @@
# 3. 次数保底
ensureGridNumList = []
if updTreasureCount / ensureCount > curTreasureCount / ensureCount:
- for gridInfo in ipyData.GetGridItemRateList2():
+ for gridInfo in ensureRateList:
ensureGridNumList.append(gridInfo[1])
- gridNum = GameWorld.GetResultByRandomList(ipyData.GetGridItemRateList2())
+ gridNum = GameWorld.GetResultByRandomList(ensureRateList)
getGridResult.append(gridNum)
- GameWorld.DebugLog("满次数保底出,updTreasureCount=%s,gridNumRateList=%s,gridNum=%s" % (updTreasureCount, ipyData.GetGridItemRateList2(), gridNum), playerID)
+ GameWorld.DebugLog("满次数保底出,updTreasureCount=%s,gridNumRateList=%s,gridNum=%s" % (updTreasureCount, ensureRateList, gridNum), playerID)
# 4. 常规产出
doCount = 200
@@ -298,15 +308,18 @@
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TreasureFreeTime % (treasureType, treasureIndex), curTime)
GameWorld.DebugLog("消耗免费次数,更新免费CD计算时间: %s" % curTime, playerID)
elif costType == 2:
- ItemCommon.DelCostItemByBind(curPlayer, costItemIndexList, bindCnt, unBindCnt, costItemCount, ChConfig.ItemDel_Treasure)
- GameWorld.DebugLog("扣除寻宝道具,costItemID=%s,costItemCount=%s" % (costItemID, costItemCount), playerID)
+ ItemCommon.DelCostItemByBind(curPlayer, costItemIndexList, bindCnt, unBindCnt, delCostItemCount, ChConfig.ItemDel_Treasure)
+ GameWorld.DebugLog("扣除寻宝道具,costItemID=%s,delCostItemCount=%s" % (costItemID, delCostItemCount), playerID)
+ if lackCountCostMoney:
+ infoDict = {"TreasureType":treasureType, "TreasureIndex":treasureIndex, "CostItemID":costItemID, "LackCount":lackCount}
+ PlayerControl.PayMoney(curPlayer, moneyType, lackCountCostMoney, ChConfig.Def_Cost_Treasure, infoDict, lackCount)
else:
infoDict = {"TreasureType":treasureType, "TreasureIndex":treasureIndex}
PlayerControl.PayMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Money, costGold, ChConfig.Def_Cost_Treasure, infoDict)
GameWorld.DebugLog("扣除仙玉,costGold=%s" % costGold, playerID)
# 加数据
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TreasureCount % (treasureType), updTreasureCount)
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TreasureCount % (treasureType, isFreeType), updTreasureCount)
if ipyData.GetLuckyGridNum() in getGridResult:
updLuck = 0
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TreasureLuck % (treasureType), updLuck)
--
Gitblit v1.8.0