| | |
| | | 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():
|
| | |
| | | useSkill = changeSkill
|
| | | #GameWorld.DebugLog("----随机技能 %s"%useSkill.GetSkillID())
|
| | |
|
| | | if PetControl.IsPet(curNPC):
|
| | | petOwner = PetControl.GetPetOwner(curNPC)
|
| | | |
| | | if petOwner == None:
|
| | | GameWorld.ErrLog("宠物(%s)找不到主人"%curNPC.GetRolePet().PetID)
|
| | | return False
|
| | | |
| | | #血量条件判定
|
| | | effect = SkillCommon.GetSkillEffectByEffectID(useSkill, ChConfig.Def_Skill_Effect_HPPerLimit)
|
| | | if effect:
|
| | | if GameObj.GetHP(petOwner)*ChConfig.Def_MaxRateValue/GameObj.GetMaxHP(petOwner) >= effect.GetEffectValue(0):
|
| | | return False
|
| | | #===========================================================================
|
| | | # 改成被动触发
|
| | | # if PetControl.IsPet(curNPC):
|
| | | # petOwner = PetControl.GetPetOwner(curNPC)
|
| | | # |
| | | # if petOwner == None:
|
| | | # GameWorld.ErrLog("宠物(%s)找不到主人"%curNPC.GetRolePet().PetID)
|
| | | # return False
|
| | | # |
| | | # #血量条件判定
|
| | | # effect = SkillCommon.GetSkillEffectByEffectID(useSkill, ChConfig.Def_Skill_Effect_HPPerLimit)
|
| | | # if effect:
|
| | | # if GameObj.GetHP(petOwner)*ChConfig.Def_MaxRateValue/GameObj.GetMaxHP(petOwner) >= effect.GetEffectValue(0):
|
| | | # return False
|
| | | #===========================================================================
|
| | |
|
| | | skillTag = SkillShell.GetSkillAffectTag(useSkill)
|
| | | skillAim = SkillShell.GetSkillFireAim(useSkill)
|
| | |
| | | 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()))
|
| | |
| | | if SkillShell.GetSkillFireAim(useSkill) == ChConfig.Def_UseSkillAim_Obj:
|
| | | # 主目标对象判定, 不能释放则不进入队列
|
| | | curSkillUseTag = SkillShell.GetSkillAffectTag(useSkill)
|
| | | hurtTypeList = ChConfig.Def_Dict_UseSkillTag_ObjType.get(curSkillUseTag)
|
| | | if not hurtTypeList:
|
| | | continue
|
| | | |
| | | if tagObjType not in hurtTypeList:
|
| | | continue
|
| | | if curSkillUseTag != ChConfig.Def_UseSkillTag_AppointNPC:
|
| | | hurtTypeList = ChConfig.Def_Dict_UseSkillTag_ObjType.get(curSkillUseTag)
|
| | | if not hurtTypeList:
|
| | | continue
|
| | | |
| | | if tagObjType not in hurtTypeList:
|
| | | continue
|
| | |
|
| | | if triggerDict != {}:
|
| | | if not CheckSkillTrigger(curNPC, triggerDict, index, 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
|
| | |
|