| | |
| | | import ChConfig
|
| | | import NPCCommon
|
| | | import NPCCustomRefresh
|
| | | import GameLogInfo
|
| | | import time
|
| | | import math
|
| | | import ReadChConfig
|
| | | import PlayerActivity
|
| | | import SkillCommon
|
| | | import BuffSkill
|
| | | import GameObj
|
| | | import SkillShell
|
| | | import FBLogic
|
| | |
| | |
|
| | | for curNPC in gameBoss_List:
|
| | | ProcessNPCAI(curNPC, tick)
|
| | |
|
| | | #---骠车AI---
|
| | | gameTruck_List = []
|
| | | for index in range(gameNPC.GetTruckCount()):
|
| | | curNPC = gameNPC.GetTruckAt(index)
|
| | | #镖车不可能死亡的
|
| | | if not curNPC.IsAlive():
|
| | | GameWorld.Log('###镖车死亡 , %s'%(curNPC.GetName()))
|
| | | continue
|
| | | |
| | | gameTruck_List.append(curNPC)
|
| | | |
| | | for curNPC in gameTruck_List:
|
| | | ProcessNPCAI(curNPC, tick)
|
| | |
|
| | | # 宠物AI
|
| | | ProcessPetAI(gameWorld, gameNPC, tick)
|
| | |
| | | # GameWorld.Log('功能或AI不存在: %s'%curNPC.GetAIType())
|
| | |
|
| | | return
|
| | | |
| | | #===============================================================================
|
| | | # def OnUndeathBossHurt(curNPC, hurtHP):
|
| | | # npcID = curNPC.GetNPCID()
|
| | | # UndeathBossDict = ReadChConfig.GetEvalChConfig("UndeathBoss")
|
| | | # if npcID not in UndeathBossDict:
|
| | | # return False
|
| | | # unitLostHP = UndeathBossDict[npcID] # 叠加一层buff所需掉血量
|
| | | # |
| | | # curLayerLostHP = curNPC.GetDictByKey(ChConfig.Def_NPC_Dict_Undeath_LayerLostHP)
|
| | | # updLostHP = curLayerLostHP + hurtHP
|
| | | # addLayer = updLostHP / unitLostHP # 增加buff层数, 攻击高的可能一次性加多层
|
| | | # #GameWorld.DebugLog("不死boss掉血: curLayerLostHP=%s,hurtHP=%s,updLostHP=%s,unitLostHP=%s,addLayer=%s" |
| | | # # % (curLayerLostHP, hurtHP, updLostHP, unitLostHP, addLayer), npcID)
|
| | | # if addLayer > 0:
|
| | | # curBuffLayer = curNPC.GetDictByKey(ChConfig.Def_NPC_Dict_Undeath_BuffLayer)
|
| | | # updBuffLyaer = curBuffLayer + addLayer
|
| | | # curNPC.SetDict(ChConfig.Def_NPC_Dict_Undeath_BuffLayer, updBuffLyaer)
|
| | | # updLostHP = updLostHP % unitLostHP # 更新层累加后剩余的伤害值
|
| | | # #GameWorld.DebugLog(" 增加NPC字典buff层: curBuffLayer=%s,updBuffLyaer=%s,updLostHP=%s" |
| | | # # % (curBuffLayer, updBuffLyaer, updLostHP), npcID)
|
| | | # __UpdBossLayerBuff(curNPC, updBuffLyaer)
|
| | | # |
| | | # curNPC.SetDict(ChConfig.Def_NPC_Dict_Undeath_LayerLostHP, updLostHP)
|
| | | # return True
|
| | | # |
| | | # def __UpdBossLayerBuff(curNPC, updBuffLyaer):
|
| | | # ''' 更新boss层buff层级 '''
|
| | | # buffType = IPY_GameWorld.bfBuff
|
| | | # buffTuple = SkillCommon.GetBuffManagerByBuffType(curNPC, buffType)
|
| | | # if buffTuple == ():
|
| | | # return
|
| | | # |
| | | # tick = GameWorld.GetGameWorld().GetTick()
|
| | | # buffState = buffTuple[0]
|
| | | # for i in range(0,buffState.GetBuffCount()):
|
| | | # curBuff = buffState.GetBuff(i)
|
| | | # curSkill = curBuff.GetSkill()
|
| | | # skillID = curSkill.GetSkillID()
|
| | | # if not skillID:
|
| | | # continue
|
| | | # |
| | | # for j in range(0, curSkill.GetEffectCount()):
|
| | | # curEffect = curSkill.GetEffect(j)
|
| | | # effectID = curEffect.GetEffectID()
|
| | | # # 层级buff效果
|
| | | # if effectID in ChConfig.Def_BuffLayerEffectList:
|
| | | # BuffSkill.AddBuffNoRefreshState(curNPC, buffType, curSkill, tick, updBuffLyaer, curNPC)
|
| | | # #GameWorld.DebugLog(" 更新层级buff效果层数: isOK=%s,skillID=%s,effID=%s,updBuffLyaer=%s" |
| | | # # % (isOK, skillID, effectID, updBuffLyaer), curNPC.GetNPCID())
|
| | | # break
|
| | | # |
| | | # NPCCommon.NPCControl(curNPC).RefreshNPCAttrState()
|
| | | # return
|
| | | #===============================================================================
|
| | |
|
| | | def OnUndeathBossAttacked(curNPC):
|
| | | npcID = curNPC.GetNPCID()
|