| | |
| | | import PetControl
|
| | | import ReadChConfig
|
| | | import GameObj
|
| | | import FBLogic
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
| | | # SetIsNeedProcess(False) 应该及时清理仇恨,回血可以不用即时
|
| | | curNPC.GetNPCAngry().Clear()
|
| | |
|
| | | # if curNPC.GetHP() != curNPC.GetMaxHP():
|
| | | # if GameObj.GetHP(curNPC) != GameObj.GetMaxHP(curNPC):
|
| | | # if curNPC.GetIsBoss() != ChConfig.Def_NPCType_Ogre_Normal:
|
| | | # return
|
| | | #
|
| | |
| | | curPlayer = GameWorld.GetObj(hurtObjID, IPY_GameWorld.gotPlayer)
|
| | |
|
| | | #无法查找玩家,或者已经死亡
|
| | | if curPlayer == None or curPlayer.GetHP() <= 0:
|
| | | if curPlayer == None or GameObj.GetHP(curPlayer) <= 0:
|
| | | continue
|
| | |
|
| | | if srcPlayer and curPlayer.GetID() == srcPlayer.GetID():
|
| | |
| | | continue
|
| | |
|
| | | #仇恨值
|
| | | curAngryValue = curAngry.GetAngryValue()
|
| | | curAngryValue = GameObj.GetAngryValue(curAngry)
|
| | | if curAngryValue == 0:
|
| | | continue
|
| | |
|
| | |
| | | if npcID in npcUseSkillOnDieDict:
|
| | | useSkillIDOnDie = npcUseSkillOnDieDict[npcID][0]
|
| | |
|
| | | useSkillAfterOtherDieDict = {}
|
| | | useSkillAfterOtherDieNPCDict = ReadChConfig.GetEvalChConfig("NPCLogic_AI_UseSkillAfterOtherDie")
|
| | | if npcID in useSkillAfterOtherDieNPCDict:
|
| | | useSkillAfterOtherDieDict = useSkillAfterOtherDieNPCDict[npcID]
|
| | | |
| | | skillManager = curNPC.GetSkillManager()
|
| | | tagObjType = curTag.GetGameObjType()
|
| | |
|
| | |
| | | #GameWorld.DebugLog("死亡释放的技能仅在死亡时才能释放!useSkillIDOnDie=%s" % useSkillIDOnDie)
|
| | | continue
|
| | |
|
| | | skillTypeID = useSkill.GetSkillTypeID()
|
| | | if skillTypeID in useSkillAfterOtherDieDict:
|
| | | checkIsDeadNPCID = useSkillAfterOtherDieDict[skillTypeID]
|
| | | if GameWorld.FindNPCByNPCID(checkIsDeadNPCID):
|
| | | #GameWorld.DebugLog("目标NPC还活着,该技能未解锁,无法释放!npcID=%s,skillTypeID=%s,checkIsDeadNPCID=%s" |
| | | # % (npcID, skillTypeID, checkIsDeadNPCID))
|
| | | continue
|
| | | |
| | | #被动技能不释放
|
| | | if SkillCommon.isPassiveSkill(useSkill):
|
| | | #GameWorld.Log('被动技能不释放不释放 = %s'%(useSkill.GetSkillName()))
|
| | |
| | | return False
|
| | |
|
| | | useSkillList.sort() # 按使用次数优先升序排,使用次数低的优先判断使用
|
| | | GameWorld.DebugLog('技能使用顺序 = useSkillList%s' % str(useSkillList), curNPC.GetID())
|
| | | #GameWorld.DebugLog('技能使用顺序 = useSkillList%s' % str(useSkillList), curNPC.GetID())
|
| | |
|
| | | for useCnt, index, useSkill in useSkillList:
|
| | | if DoNPCUseSkill(curNPC, curTag, useSkill, tagDist, tick):
|
| | |
| | | return
|
| | |
|
| | |
|
| | | def NPCMoveByPointList(curNPC, movePointList):
|
| | | def NPCMoveByPointList(curNPC, movePointList, tick):
|
| | | if not movePointList:
|
| | | return
|
| | | pointIndex = curNPC.GetDictByKey(ChConfig.Def_NPC_Dict_MovePointIndex)
|
| | |
| | |
|
| | | curNPC.Move(destPosX, destPosY)
|
| | | return
|
| | | |
| | | # 到达终点
|
| | | if pointIndex == (len(movePointList) - 1):
|
| | | FBLogic.OnTDNPCReachTheGoal(curNPC, tick)
|
| | | |
| | | return
|
| | |
|