9673 【后端】【越南】【BT7】【主干】古神战场增加玩家掉落BUFF功能
3个文件已修改
94 ■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBLogic.py 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_CrossBattlefield.py 80 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py
@@ -5163,6 +5163,10 @@
    
    if curNPC.GetType() != ChConfig.ntTouchKill:
        return
    if not FBLogic.OnCanMoveTouchNPC(curPlayer, curNPC, tick):
        return
    #副本
    FBLogic.OnMoveTouchNPC(curPlayer, curNPC, tick)
    
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBLogic.py
@@ -2287,6 +2287,16 @@
    
    return
def OnCanMoveTouchNPC(curPlayer, curNPC, tick):
    ## 检查可否触碰NPC逻辑
    do_FBLogic_ID = __GetFBLogic_MapID(GameWorld.GetMap().GetMapID())
    callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnCanMoveTouchNPC"))
    if callFunc:
        return callFunc(curPlayer, curNPC, tick)
    return True
def OnMoveTouchNPC(curPlayer, curNPC, tick):
    ## 触碰NPC处理逻辑
    do_FBLogic_ID = __GetFBLogic_MapID(GameWorld.GetMap().GetMapID())
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_CrossBattlefield.py
@@ -121,12 +121,12 @@
    def getWorldAllHelpInfo(self, tick):
        worldInfo = {"superItemInfo":self.superItemInfo, "crystalFactionInfo":self.crystalFactionInfo,
                     "factionBuffNPCInfo":self.factionBuffNPCInfo, "crystalAtkedList":self.crystalAtkedDict.keys()}
        worldInfo.update({"eventNPCID":self.eventNPCID, "eventNPCPos":self.eventNPCPos,
        worldInfo.update({"eventNPCID":self.eventNPCID, "eventNPCPos":self.eventNPCPos,
                          "eventEndTick":max(0, self.eventEndTick - tick), "eventNPCHP":self.eventNPCHP})
        return worldInfo
    
    def updEventNPCHelp(self, tick):
        self.worldHelpDict.update({"eventNPCID":self.eventNPCID, "eventNPCPos":self.eventNPCPos,
        self.worldHelpDict.update({"eventNPCID":self.eventNPCID, "eventNPCPos":self.eventNPCPos,
                                   "eventEndTick":max(0, self.eventEndTick - tick), "eventNPCHP":self.eventNPCHP})
        return
    
@@ -1464,6 +1464,11 @@
    
    if atkObjType == IPY_GameWorld.gotPlayer:
        NotifyBattlefieldHelp(False, atkObj) # 击杀的暂只实时通知自己
        # 玩家被玩家击杀,掉落个人buff
        if defObjType == IPY_GameWorld.gotPlayer:
            DoDropPersonBuffOnKilled(atkObj, defObj, tick)
    return
def DoFB_NPCDead(curNPC):
@@ -1671,17 +1676,17 @@
    GameWorld.Log("zoneID=%s,hmNum=%s,allCallPlayerIDList=%s" % (zoneID, hmNum, allCallPlayerIDList), fbPropertyID)
    
    gameWorld = GameWorld.GetGameWorld()
    drDict = {"mapID":GameWorld.GetMap().GetMapID(), "realMapID":gameWorld.GetRealMapID(), "copyMapID":gameWorld.GetCopyMapID(),
              "zoneID":zoneID, "funcLineID":funcLineID, "fbPropertyID":fbPropertyID, "hmNum":hmNum,
              "superItemInfo":worldObj.superItemInfo, "finalSuperItemPlayerID":finalSuperItemPlayerID,
              "crystalFactionInfo":worldObj.crystalFactionInfo, "callTeamInfo":callTeamInfo,
    drDict = {"mapID":GameWorld.GetMap().GetMapID(), "realMapID":gameWorld.GetRealMapID(), "copyMapID":gameWorld.GetCopyMapID(),
              "zoneID":zoneID, "funcLineID":funcLineID, "fbPropertyID":fbPropertyID, "hmNum":hmNum,
              "superItemInfo":worldObj.superItemInfo, "finalSuperItemPlayerID":finalSuperItemPlayerID,
              "crystalFactionInfo":worldObj.crystalFactionInfo, "callTeamInfo":callTeamInfo,
              "winnerFaction":winnerFaction, "fightTimeTotal":(int(time.time()) - worldObj.startTime)}
    factionInfoList = []
    for faction in [ShareDefine.CampType_Justice, ShareDefine.CampType_Evil]:
        factionObj = GetBattleFactionObj(faction)
        rankPlayerList = []
        for battleObj in factionObj.battlePlayerSortList[:syncRankCount]:
            rankPlayerList.append({"name":battleObj.name, "job":battleObj.job, "score":battleObj.score,
            rankPlayerList.append({"name":battleObj.name, "job":battleObj.job, "score":battleObj.score,
                                   "killCount":battleObj.killCount, "crystalCollCnt":battleObj.crystalCollCnt})
            
        callPlayerName = ""
@@ -1691,11 +1696,11 @@
                callPlayerName = callBattleObj.name
                break
            
        factionInfoList.append({"faction":faction, "rankPlayerList":rankPlayerList, "callPlayerName":callPlayerName,
        factionInfoList.append({"faction":faction, "rankPlayerList":rankPlayerList, "callPlayerName":callPlayerName,
                                "superItemPlayerName":factionObj.superItemPlayerName})
        
    costTime = int((tick - GameWorld.GetGameFB().GetFBStepTick()) / 1000.0)
    overDict = {"winnerFaction":winnerFaction, "factionInfoList":factionInfoList, FBCommon.Over_costTime:costTime,
    overDict = {"winnerFaction":winnerFaction, "factionInfoList":factionInfoList, FBCommon.Over_costTime:costTime,
                "finalSuperItemPlayerName":finalSuperItemPlayerName}
    
    scoreKingID, scoreKingName = 0, "" # 本场积分王: 获胜方在线第一名积分
@@ -1749,8 +1754,8 @@
                          factionBuffCollCnt, personBuffCollCnt, crystalCollCnt, wallCollCnt]
            battlePlayerList.append(playerInfo)
            
            drPlayerList.append({"playerID":playerID, "accID":battleObj.accID, "fightPower":battleObj.fightPower,
                                 "score":score, "auraScore":auraScore, "wallCollCnt":wallCollCnt,
            drPlayerList.append({"playerID":playerID, "accID":battleObj.accID, "fightPower":battleObj.fightPower,
                                 "score":score, "auraScore":auraScore, "wallCollCnt":wallCollCnt,
                                 "superItemAwardCnt":superItemAwardCnt, "superItemContribution":battleObj.superItemContribution})
            
            player = copyMapMgr.FindPlayerByID(playerID)
@@ -1762,8 +1767,8 @@
            overDict.update({FBCommon.Over_rank:rank, "score":score, "highScoreToday":highScoreToday, "onlineTimes":onlineTimes, "faction":faction})
            FBCommon.NotifyFBOver(player, ChConfig.Def_FBMapID_CrossBattlefield, lineID, isWinner, overDict)
            
        drFactionInfo = {"faction":faction, "score":factionObj.score, "hurtBossPlayerDict":factionObj.hurtBossPlayerDict,
                         "superItemProgress":factionObj.superItemProgress, "superItemPlayerID":factionObj.superItemPlayerID,
        drFactionInfo = {"faction":faction, "score":factionObj.score, "hurtBossPlayerDict":factionObj.hurtBossPlayerDict,
                         "superItemProgress":factionObj.superItemProgress, "superItemPlayerID":factionObj.superItemPlayerID,
                         "drPlayerList":drPlayerList}
        drDict["faction_%s" % faction] = drFactionInfo
        
@@ -1834,6 +1839,55 @@
            NotifyBattlefieldHelp()
    return
def DoDropPersonBuffOnKilled(atkPlayer, defPlayer, tick):
    dropPersonBuffNPCList = IpyGameDataPY.GetFuncEvalCfg("CrossBattlefieldDropPersonBuff", 1)
    if not dropPersonBuffNPCList:
        return
    dropNPCIDList = []
    for npcID in dropPersonBuffNPCList:
        npcData = GameWorld.GetGameData().FindNPCDataByID(npcID)
        if not npcData:
            continue
        buffID = npcData.GetSkill1()
        if not buffID:
            continue
        findBuff = SkillCommon.FindBuffByID(defPlayer, buffID)[0]
        if not findBuff:
            continue
        if findBuff.GetLayer():
            dropNPCIDList.extend([npcID] * findBuff.GetLayer())
        else:
            dropNPCIDList.append(npcID)
    count = 0
    defPosX, defPosY = defPlayer.GetPosX(), defPlayer.GetPosY()
    while dropNPCIDList and count < 100:
        count += 1
        dropX, dropY = GameMap.GetNearbyPosByDis(defPosX, defPosY, 5)
        if not dropX:
            continue
        npcID = dropNPCIDList.pop(0)
        NPCCommon.SummonMapNpc(npcID, dropX, dropY, playerID=atkPlayer.GetPlayerID())
    return
def OnCanMoveTouchNPC(curPlayer, curNPC, tick):
    ## 检查可否触碰NPC逻辑
    summonPlayerID = curNPC.GetDictByKey(ChConfig.Def_NPC_Dict_SummonMapNPCPlayerID)
    if not summonPlayerID:
        return True
    if summonPlayerID == curPlayer.GetPlayerID():
        #GameWorld.DebugLog("OnCanMoveTouchNPC summonPlayerID=%s,owner=True" % summonPlayerID, curNPC.GetID())
        return True
    protectTick = IpyGameDataPY.GetFuncCfg("CrossBattlefieldDropPersonBuff", 2) * 1000
    passTick = tick - curNPC.GetActionTick()
    if passTick < protectTick:
        #GameWorld.DebugLog("OnCanMoveTouchNPC in protect! passTick=%s < protectTick=%s" % (passTick, protectTick), curNPC.GetID())
        return False
    return True
def OnMoveTouchNPC(curPlayer, curNPC, tick):
    ## 触碰NPC处理逻辑
    npcID = curNPC.GetNPCID()