| | |
| | | import GameWorld
|
| | | import ItemControler
|
| | | import PlayerControl
|
| | | import PlayerSuccess
|
| | | import PlayerBillboard
|
| | | import ChPyNetSendPack
|
| | | import DataRecordPack
|
| | | import NetPackCommon
|
| | | import IpyGameDataPY
|
| | | import ShareDefine
|
| | | import PlayerTask
|
| | | import PlayerMail
|
| | | import DBDataMgr
|
| | | import TurnSkill
|
| | | import ObjPool
|
| | |
|
| | | def OnDay():
|
| | | ## 结算昨日奖励
|
| | |
| | |
|
| | | return True, funcLineID
|
| | |
|
| | | def GetFBNPCInitAttr(curPlayer, turnFight, npcObj):
|
| | | def GetFBNPCInitAttr(turnFight, npcObj):
|
| | | ## 获取副本指定NPC初始化属性
|
| | | bossID = npcObj.GetNPCID()
|
| | | ipyDataList = IpyGameDataPY.GetIpyGameDataList("Tianzi", bossID)
|
| | |
| | | return {}
|
| | | return __getBossAttrDict(ipyDataList[0])
|
| | |
|
| | | def OnFBNPCKilledBefore(curPlayer, turnFight, gameObj, killer=None, useSkill=None):
|
| | | def OnFBNPCKilledBefore(turnFight, gameObj, killer=None, useSkill=None):
|
| | | ## 副本NPC被击杀前处理,一般用于处理一些不被击杀的副本NPC逻辑
|
| | | # @return: 可否被正常击杀
|
| | |
|
| | |
| | | attrDict.update(ipyData.GetOtherAttrDict())
|
| | | return attrDict
|
| | |
|
| | | def OnTurnFightOver(curPlayer, turnFight, mapID, funcLineID, overMsg):
|
| | | def OnTurnFightOver(turnFight, mapID, funcLineID, overMsg):
|
| | | ## 回合战斗结束
|
| | |
|
| | | hpNum = turnFight.GetDictByKey("hpNum")
|
| | | batFaction = turnFight.getBatFaction(ChConfig.Def_FactionA)
|
| | | totalHurt = batFaction.getTotalHurt()
|
| | | |
| | | overMsg.update({"hpNum":hpNum, "totalHurt":totalHurt})
|
| | | return
|
| | |
|
| | | def OnTurnFightAward(curPlayer, guid, mapID, funcLineID, winFaction, statMsg, dateStr, reqData, awardDict):
|
| | | ## 回合战斗结算奖励
|
| | | if not curPlayer:
|
| | | return
|
| | |
|
| | | #isWin = turnFight.isWin
|
| | | lineID, bossID = GetTianziTodayInfo(curPlayer)
|
| | | if lineID != funcLineID:
|
| | | GameWorld.ErrLog("结算时非今日天子考验! mapID=%s,funcLineID=%s != %s,bossID=%s" % (mapID, funcLineID, lineID, bossID))
|
| | | return
|
| | |
|
| | | hpNum = turnFight.GetDictByKey("hpNum")
|
| | | batFaction = turnFight.getBatFaction(ChConfig.Def_FactionA)
|
| | | totalHurt = batFaction.getTotalHurt()
|
| | | hpNum = statMsg.get("hpNum", 0)
|
| | | totalHurt = statMsg.get("totalHurt", 0)
|
| | |
|
| | | historyHurt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TianziHisHurt % bossID)
|
| | | historyHurtEx = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TianziHisHurtEx % bossID)
|
| | |
| | | PlayerBillboard.UpdatePlayerBillboard(curPlayer, ShareDefine.Def_BT_Tianzi, todayHurtEx, todayHurt)
|
| | |
|
| | | itemList = __getTianziAwardList(totalHurt, bossID)
|
| | | overMsg.update({FBCommon.Over_itemInfo:FBCommon.GetJsonItemList(itemList), "totalHurt":totalHurt, "todayHurtTotal":todayHurtTotal})
|
| | | |
| | | turnFight.awardData = [lineID, bossID, itemList]
|
| | | return
|
| | |
|
| | | def OnTurnFightAward(curPlayer, turnFight, mapID, funcLineID, awardData):
|
| | | ## 回合战斗结算奖励
|
| | | if not curPlayer:
|
| | | return
|
| | | |
| | | if not awardData:
|
| | | return
|
| | | |
| | | lineID, bossID, itemList = awardData
|
| | | awardDict.update({FBCommon.Over_itemInfo:FBCommon.GetJsonItemList(itemList), "totalHurt":totalHurt, "todayHurtTotal":todayHurtTotal})
|
| | |
|
| | | FBCommon.AddEnterFBCount(curPlayer, mapID)
|
| | | ItemControler.GivePlayerItemOrMail(curPlayer, itemList, event=["Tianzi", False, {}], isNotifyAward=False)
|
| | | SyncTianziInfo(curPlayer, lineID, bossID)
|
| | | __onFBTianzi(curPlayer)
|
| | | |
| | | DataRecordPack.DR_FBPass(curPlayer, mapID, funcLineID, {"hpNum":hpNum, "totalHurt":totalHurt})
|
| | | return
|
| | |
|
| | | def __getTianziAwardList(todayHurt, bossID, sweepCnt=1):
|
| | |
| | | overDict = {FBCommon.Over_itemInfo:FBCommon.GetJsonItemList(itemList), FBCommon.Over_isSweep:1,
|
| | | "totalHurt":todayHurtTotal, "todayHurtTotal":todayHurtTotal}
|
| | | FBCommon.NotifyFBOver(curPlayer, mapID, lineID, isPass, overDict)
|
| | | __onFBTianzi(curPlayer)
|
| | | return True
|
| | |
|
| | | def __onFBTianzi(curPlayer):
|
| | | PlayerTask.AddTaskValue(curPlayer, ChConfig.TaskType_FBTianzi)
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_OSAFBTianzi, 1)
|
| | | return
|
| | |
|
| | | def SyncTianziInfo(curPlayer, lineID=None, bossID=None):
|
| | | if lineID == None:
|
| | | lineID, bossID = GetTianziTodayInfo(curPlayer)
|
| | | clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCTianziKYInfo)
|
| | | clientPack = ChPyNetSendPack.tagSCTianziKYInfo()
|
| | | clientPack.LineID = lineID
|
| | | clientPack.HistoryHurt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TianziHisHurt % bossID)
|
| | | clientPack.HistoryHurtEx = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TianziHisHurtEx % bossID)
|