| | |
| | | #struct tagCMActivityPlaceQuickFinish
|
| | | #{
|
| | | # tagHead Head;
|
| | | # BYTE FinishCount; //完成次数
|
| | | #};
|
| | | def OnActivityPlaceQuickFinish(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | |
| | | finishCount = clientData.FinishCount
|
| | | remainCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceRemainCount)
|
| | | if not remainCount:
|
| | | GameWorld.DebugLog("没有剩余活跃放置次数,无法快速完成!")
|
| | | return
|
| | | finishCount = min(finishCount, remainCount)
|
| | | if not finishCount:
|
| | | return
|
| | |
|
| | | costItemID, costGoldParper = IpyGameDataPY.GetFuncEvalCfg("ActivityPlace", 5)
|
| | | costItemCount = 1 # 默认扣一个
|
| | | endCount = 1 # 只快速结算一次
|
| | | costItemCount = finishCount # 每次扣一个
|
| | |
|
| | | costItemIndexList, bindCnt, unBindCnt = ItemCommon.GetPackItemBindStateIndexInfo(curPlayer, costItemID, costItemCount)
|
| | | lackCnt = costItemCount - bindCnt - unBindCnt
|
| | | delItemCount = costItemCount
|
| | | if lackCnt > 0:
|
| | | if not PlayerControl.PayMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Paper, costGoldParper, ChConfig.Def_Cost_ActivityPlace):
|
| | | costGoldParperTotal = costGoldParper * lackCnt
|
| | | if not PlayerControl.PayMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Paper, costGoldParperTotal, ChConfig.Def_Cost_ActivityPlace):
|
| | | return
|
| | | else:
|
| | | ItemCommon.DelCostItemByBind(curPlayer, costItemIndexList, bindCnt, unBindCnt, costItemCount, ChConfig.ItemDel_ActivityPlace)
|
| | | delItemCount -= lackCnt
|
| | |
|
| | | __DoActivityPlaceRewardEnd(curPlayer, endCount)
|
| | | if delItemCount > 0:
|
| | | ItemCommon.DelCostItemByBind(curPlayer, costItemIndexList, bindCnt, unBindCnt, delItemCount, ChConfig.ItemDel_ActivityPlace)
|
| | | |
| | | __DoActivityPlaceRewardEnd(curPlayer, finishCount)
|
| | | return
|
| | |
|
| | | def ProcessActivityPlace(curPlayer):
|