| | |
| | | self.tagViewCache = tagViewCache
|
| | | return
|
| | |
|
| | | def getPVPPlayerID(self): return self.tagPlayerID # 获取PVP目标玩家ID,也可用于判断是否PVP
|
| | | |
| | | def isFBMap(self):
|
| | | ## 是否副本地图中,非主线的均视为副本
|
| | | return self.mapID not in [ChConfig.Def_FBMapID_Main, ChConfig.Def_FBMapID_MainBoss]
|
| | |
| | | olPlayer = PlayerOnline.GetOnlinePlayer(curPlayer)
|
| | | lineup = olPlayer.GetLineup(lineupID)
|
| | | if lineup.IsEmpty():
|
| | | GameWorld.DebugLog("玩家没有目标阵容默认取主阵容! lineupID=%s" % lineupID)
|
| | | GameWorld.DebugLog("玩家没有目标阵容默认取主阵容! lineupID=%s" % lineupID, curPlayer.GetPlayerID())
|
| | | lineup = olPlayer.GetLineup(ShareDefine.Lineup_Main)
|
| | | return lineup
|
| | |
|
| | |
| | | tagViewCache = PlayerViewCache.FindViewCache(tagPlayerID)
|
| | | if not tagViewCache:
|
| | | GameWorld.DebugLog("目标玩家没有缓存数据! tagPlayerID=%s" % tagPlayerID, playerID)
|
| | | return {}
|
| | | PlayerControl.NotifyCode(curPlayer, "TagNoViewCache")
|
| | | return
|
| | | defLineupInfo = GetCacheLineupInfo(tagViewCache, defLineupID)
|
| | | if not defLineupInfo:
|
| | | GameWorld.DebugLog("目标玩家没有该阵容数据! tagPlayerID=%s,defLineupID=%s" % (tagPlayerID, defLineupID), playerID)
|
| | | PlayerControl.NotifyCode(curPlayer, "TagNoLineup")
|
| | | return
|
| | |
|
| | | turnMax = GetTurnMax(mapID)
|
| | |
| | | def __doSetFightPoint(curPlayer, fightPoint):
|
| | | ## 设置消耗倍值
|
| | | GameWorld.DebugLog("设置战锤消耗倍值: %s" % fightPoint)
|
| | | if fightPoint == 1:
|
| | | pass
|
| | | elif fightPoint == 2:
|
| | | # 条件验证
|
| | | pass
|
| | | elif fightPoint == 3:
|
| | | # 条件验证
|
| | | pass
|
| | | else:
|
| | | needTreeLVList = IpyGameDataPY.GetFuncEvalCfg("AutoGuaji", 1)
|
| | | if fightPoint < 1 or fightPoint > len(needTreeLVList):
|
| | | return
|
| | | needTreeLV = needTreeLVList[fightPoint - 1]
|
| | | treeLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TreeLV)
|
| | | if treeLV < needTreeLV:
|
| | | GameWorld.DebugLog("祝福树等级不足: treeLV=%s < %s" % (treeLV, needTreeLV))
|
| | | return
|
| | | curPlayer.SetFightPoint(fightPoint)
|
| | | return
|
| | |
| | | batObj = batObjMgr.getBatObj(objID)
|
| | | turnFight.ResetOneActionUseSkillCnt()
|
| | | TurnPassive.OnTriggerPassiveEffect(turnFight, batObj, ChConfig.TriggerWay_FightStart)
|
| | | TurnPassive.OnTriggerPassiveEffect(turnFight, batObj, ChConfig.TriggerWay_InBattlefield)
|
| | |
|
| | | turnFight.enterLogic = True
|
| | | return True
|
| | |
| | | batObj = batObjMgr.getBatObj(objID)
|
| | | if not batObj:
|
| | | continue
|
| | | if not batObj.IsAlive():
|
| | | continue
|
| | |
|
| | | turnFight.ResetOneActionUseSkillCnt()
|
| | | batObj.SetTiming(ChConfig.TurnTiming_Before) # 重置时机到回合前
|
| | | if turnNum > 1: # 第1回合不用刷新技能
|
| | | RefreshObjSkillByBigTurn(batObj)
|
| | | RefreshObjByBigTurn(turnFight, batObj)
|
| | | |
| | | TurnPassive.OnTriggerPassiveEffect(turnFight, batObj, ChConfig.TriggerWay_BigTurnStart)
|
| | | batObj.ResetBigTurn() # 每大回合重置
|
| | |
|
| | | if not batObj.IsAlive():
|
| | | TurnPassive.OnTriggerPassiveEffect(turnFight, batObj, ChConfig.TriggerWay_BigTurnStartByDead)
|
| | | else:
|
| | | TurnPassive.OnTriggerPassiveEffect(turnFight, batObj, ChConfig.TriggerWay_BigTurnStart)
|
| | | |
| | | return
|
| | |
|
| | | def TurnFightPerTurnBigEnd(turnFight, turnNum):
|
| | |
| | | remainTime -= 1
|
| | | curSkill.SetRemainTime(remainTime)
|
| | | GameWorld.DebugLog(" 更新技能CD: curID=%s,skillID=%s,remainTime=%s" % (curID, skillID, remainTime))
|
| | | |
| | | batObj.ResetSkillTurnUseCnt() # 重置回合使用次数,放刷新CD后重置
|
| | | return
|
| | |
|
| | | def RefreshObjByBigTurn(turnFight, batObj):
|
| | |
| | | skillID = useSkill.GetSkillID() if useSkill else 0
|
| | | GameWorld.DebugLog(" %s 回合战斗主体被击杀: curID=%s,killerObjID=%s,skillID=%s" % (GetObjName(gameObj), objID, killerObjID, skillID))
|
| | | gameObj.SetDead()
|
| | | TurnBuff.DoBuffByDead(turnFight, gameObj)
|
| | |
|
| | | clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagMCTurnFightObjDead)
|
| | | clientPack.ObjID = objID
|
| | |
| | | # 暂时只算主线小怪
|
| | | if curPlayer and turnFight.mapID == ChConfig.Def_FBMapID_Main and gameObj.GetFaction() != ChConfig.Def_FactionA:
|
| | | GetMainFightMgr(curPlayer).killNPCCnt += 1
|
| | | |
| | | # 清除光源buff
|
| | | buffMgr = gameObj.GetBuffManager()
|
| | | for index in range(buffMgr.GetBuffCount())[::-1]:
|
| | | buff = buffMgr.GetBuffByIndex(index)
|
| | | skillID = buff.GetSkillID()
|
| | | skillData = buff.GetSkillData()
|
| | | if skillData.GetSkillType() != ChConfig.Def_SkillType_Halo:
|
| | | continue
|
| | | if buff.GetOwnerID() != objID:
|
| | | continue
|
| | | GameWorld.DebugLog("删除光环buff: objID=%s,skillID=%s" % (objID, skillID))
|
| | | TurnBuff.DoBuffDel(turnFight, gameObj, buff)
|
| | | return True
|
| | |
|
| | | def OnTurnAllOver(guid):
|
| | |
| | | turnFight.costTime = time.time() - turnFight.startTime
|
| | | winFaction = turnFight.winFaction
|
| | | turnFight.isWin = (winFaction == ChConfig.Def_FactionA)
|
| | | mapID = turnFight.mapID
|
| | | funcLineID = turnFight.funcLineID
|
| | | GameWorld.DebugLog("--- 战斗结束处理 ---, winFaction=%s, costTime=%ss, %s" % (winFaction, turnFight.costTime, guid))
|
| | | |
| | | if mapID != ChConfig.Def_FBMapID_Main:
|
| | | GameWorld.Log("战斗耗时: %ss, mapID=%s,funcLineID=%s" % (turnFight.costTime, mapID, funcLineID))
|
| | | |
| | | # 统计明细
|
| | | batObjMgr = BattleObj.GetBatObjMgr()
|
| | | statInfo = {}
|
| | |
| | |
|
| | | overMsg = {"winFaction":winFaction, "statInfo":statInfo}
|
| | | curPlayer = turnFight.curPlayer
|
| | | mapID = turnFight.mapID
|
| | | funcLineID = turnFight.funcLineID
|
| | |
|
| | | FBLogic.OnTurnFightOver(curPlayer, turnFight, mapID, funcLineID, overMsg)
|
| | |
|