| | |
| | | import IpyGameDataPY
|
| | | import PlayerControl
|
| | | import ItemControler
|
| | |
|
| | | import PlayerTask
|
| | | import FBCommon
|
| | | import ChConfig
|
| | |
|
| | | def OnTurnFightRequest(curPlayer, mapID, funcLineID, tagType, tagID, valueList):
|
| | | ## 回合战斗请求
|
| | |
| | | GameWorld.DebugLog("最后一波未通过,无法挑战本关boss! passWave=%s < %s" % (wave, waveMax))
|
| | | return
|
| | |
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ChallengeLVID, levelID)
|
| | | |
| | | PlayerTask.UpdTaskValue(curPlayer, ChConfig.TaskType_MainLevelChallenge)
|
| | | |
| | | return True, levelID
|
| | |
|
| | | def GetFBNPCLineupInfo(curPlayer, mapID, funcLineID):
|
| | |
| | |
|
| | | return npcLineupIDList, strongerLV, difficulty
|
| | |
|
| | | def OnTurnFightOver(curPlayer, turnFight, mapID, funcLineID, overMsg):
|
| | | ## 回合战斗结束
|
| | | def OnTurnFightAward(curPlayer, guid, mapID, funcLineID, winFaction, statMsg, dateStr, reqData, awardDict):
|
| | | ## 回合战斗结算奖励
|
| | | |
| | | if not curPlayer:
|
| | | return
|
| | |
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | #winFaction = turnFight.winFaction
|
| | | isWin = turnFight.isWin
|
| | | isWin = winFaction == ChConfig.Def_FactionA
|
| | |
|
| | | chapterID, levelNum, _ = PlayerControl.GetMainLevelPassInfo(curPlayer)
|
| | | if not isWin:
|
| | | nowValue = PlayerControl.GetMainLevelNowValue(curPlayer)
|
| | | GameWorld.DebugLog("主线boss战斗失败!保持当前刷怪波进度不变! nowValue=%s" % nowValue, playerID)
|
| | | return
|
| | | |
| | | if turnFight.haveNextLineup():
|
| | | GameWorld.DebugLog("主线boss小队战斗胜利,有下一小队! chapterID=%s,levelNum=%s,lineupIndex=%s,lineupIDList=%s" |
| | | % (chapterID, levelNum, turnFight.lineupIndex, turnFight.lineupIDList), playerID)
|
| | | return
|
| | |
|
| | | isAllPass = False # 是否通关
|
| | |
| | | % (chapterID, levelNum, nextChapterID, nextLevelNum), playerID)
|
| | | isAllPass = True
|
| | |
|
| | | # 发放过关奖励
|
| | | levelIpyData = IpyGameDataPY.GetIpyGameData("MainLevel", chapterID, levelNum)
|
| | | itemList = levelIpyData.GetAwardItemList() if levelIpyData else []
|
| | | GameWorld.DebugLog("过关奖励: chapterID=%s,levelNum=%s,itemList=%s" % (chapterID, levelNum, itemList), playerID)
|
| | | awardDict.update({FBCommon.Over_itemInfo:FBCommon.GetJsonItemList(itemList)})
|
| | | |
| | | updPassValue = PlayerControl.SetMainLevelPassInfo(curPlayer, nextChapterID, nextLevelNum, 0)
|
| | | if isAllPass:
|
| | | # 已通关的刷怪进度保持不变
|
| | |
| | | GameWorld.DebugLog("已通关的刷怪进度保持不变: updNowValue=%s" % updNowValue, playerID)
|
| | | else:
|
| | | updNowValue = PlayerControl.SetMainLevelNowInfo(curPlayer, nextChapterID, nextLevelNum, 1)
|
| | | GameWorld.DebugLog("为通关的刷怪进度设置为下一关的第1波: updNowValue=%s" % updNowValue, playerID)
|
| | | GameWorld.DebugLog("未通关的刷怪进度设置为下一关的第1波: updNowValue=%s" % updNowValue, playerID)
|
| | | GameWorld.DebugLog("updPassValue=%s,updNowValue=%s" % (updPassValue, updNowValue), playerID)
|
| | | |
| | | # 发放过关奖励
|
| | | levelIpyData = IpyGameDataPY.GetIpyGameData("MainLevel", chapterID, levelNum)
|
| | | if not levelIpyData:
|
| | | return
|
| | | itemList = levelIpyData.GetAwardItemList()
|
| | | GameWorld.DebugLog("过关奖励: chapterID=%s,levelNum=%s,itemList=%s" % (chapterID, levelNum, itemList), playerID)
|
| | | |
| | | ItemControler.GivePlayerItemOrMail(curPlayer, itemList, event=["MainLevelBoss", False, {}], isNotifyAward=False)
|
| | | |
| | | overMsg.update({FBCommon.Over_itemInfo:FBCommon.GetJsonItemList(itemList)})
|
| | | return
|