| | |
| | | import GameFuncComm
|
| | | import PlayerTJG
|
| | | import PlayerActivity
|
| | | import PlayerSuccess
|
| | | import PyGameData
|
| | |
|
| | | import copy
|
| | |
| | | ) = range(2)
|
| | |
|
| | | Def_TJGRecoverID = 1 #脱机挂找回索引ID
|
| | |
|
| | | Def_QueenRelics = 11 #娲皇遗迹找回索引ID
|
| | | ## OnDay处理
|
| | | # @param curPlayer
|
| | | # @return None
|
| | |
| | |
|
| | |
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_RecoverGainData % index, historyMaxLine)
|
| | | if dataMapID == ChConfig.Def_FBMapID_MunekadoTrial:
|
| | | historyStar = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, historyMaxLine-1, False, [dataMapID])
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_RecoverGainDataEx % index, historyStar)
|
| | |
|
| | | #更新可找回次数
|
| | | curCommonCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_RecoverFBCommonCnt % index, 0)
|
| | |
| | |
|
| | | infoDict = {ChConfig.Def_Cost_Reason_SonKey:recoverWay}
|
| | | for moneyType, moneyCnt in costMoneyDict.items():
|
| | | PlayerControl.PayMoney(curPlayer, moneyType, moneyCnt, ChConfig.Def_Cost_RecoverGain, infoDict)
|
| | | costMoneyList = PlayerControl.HaveMoneyEx(curPlayer, moneyType, moneyCnt)
|
| | | GameWorld.DebugLog(' moneyType=%s,moneyCnt=%s,costMoneyList=%s'%(moneyType, moneyCnt, costMoneyList))
|
| | | if not costMoneyList:
|
| | | return
|
| | | for mType, mCnt in costMoneyList:
|
| | | PlayerControl.PayMoney(curPlayer, mType, mCnt, ChConfig.Def_Cost_RecoverGain, infoDict)
|
| | |
|
| | |
|
| | | if totalExp > 0:
|
| | |
| | | if Def_TJGRecoverID in recoverCntDict:
|
| | | #脱机挂经验找回后重置
|
| | | PlayerTJG.ResetTJGDeadInfo(curPlayer)
|
| | | |
| | | if Def_QueenRelics in recoverCntDict:
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_QueenRelicsEx, recoverCntDict[Def_QueenRelics])
|
| | | DataRecordPack.DR_PlayerRecover(curPlayer, recoverWay, recoverCntDict, totalExp, totalMoney, totalSP, totalItemDict)
|
| | | __SetRecoverNum(curPlayer, recoverCntDict)
|
| | | __NotifyRecoverNum(curPlayer)
|
| | |
| | | costMoney = int(normalCostJade * recoverSecond / float(3600))
|
| | | else:
|
| | | costMoney = min(commonCnt, recoverCnt) * normalCostJade + vipCostJade * max(0, recoverCnt - commonCnt)
|
| | | costMoneyList = PlayerControl.HaveMoneyEx(curPlayer, ShareDefine.TYPE_Price_Gold_Paper_Money, costMoney)
|
| | | costMoneyList = [[ShareDefine.TYPE_Price_Gold_Paper_Money, costMoney]]
|
| | | else:
|
| | | costCopper = ipyData.GetCostCopper()
|
| | | if index == Def_TJGRecoverID:
|
| | | costMoney = int(costCopper * recoverSecond / float(3600))
|
| | | else:
|
| | | costMoney = recoverCnt * costCopper
|
| | | if PlayerControl.HaveMoney(curPlayer, IPY_GameWorld.TYPE_Price_Silver_Money, costMoney, False):
|
| | | costMoneyList = [[IPY_GameWorld.TYPE_Price_Silver_Money, costMoney]]
|
| | | else:
|
| | | costMoneyList = []
|
| | | |
| | | costMoneyList = [[IPY_GameWorld.TYPE_Price_Silver_Money, costMoney]]
|
| | | |
| | | return costMoneyList, recoverCnt
|
| | |
|
| | | def __GetCanRecoverCnt(curPlayer, index):
|
| | |
| | | reExp = PlayerControl.GetPlayerReExp(curPlayer)
|
| | | expRate = PlayerControl.GetLimitExpRate(curPlayer, ChConfig.ExpRateLimitType_Recover)
|
| | | extraData = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_RecoverGainData % index, 0)
|
| | | dataEx = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_RecoverGainDataEx % index, 0)
|
| | | |
| | | tjgExp = 0 #脱机挂找回经验
|
| | | exp = 0
|
| | | sp = 0
|
| | |
| | | numInfoPack.RecoverCnt = commonCnt
|
| | | numInfoPack.ExtraCnt = vipExtraCnt
|
| | | numInfoPack.ExtraData = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_RecoverGainData % index, 0)
|
| | | numInfoPack.ExtraData2 = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_RecoverGainDataEx % index, 0)
|
| | | sendPack.NumInfo.append(numInfoPack)
|
| | | sendPack.Num = len(sendPack.NumInfo)
|
| | | NetPackCommon.SendFakePack(curPlayer, sendPack)
|