4926 【后端】【1.2】【1.3】BOSS归属特殊规则
| | |
| | | import NetPackCommon
|
| | | import FamilyRobBoss
|
| | | import FBCommon
|
| | | import ChNPC
|
| | |
|
| | | import datetime
|
| | | import math
|
| | |
| | | # @param curObjDetel 对象实例
|
| | | # @return 返回值无意义
|
| | | # @remarks 理对象死亡逻辑
|
| | | def DoLogic_ObjDead(curObjDetel):
|
| | | def DoLogic_ObjDead(atkObj, curObjDetel, curSkill, tick):
|
| | | if GameObj.GetHP(curObjDetel) > 0:
|
| | | return
|
| | |
|
| | |
| | | return
|
| | |
|
| | | #---NPC处理---
|
| | | if not ChNPC.OnCheckCanDie(atkObj, curObjDetel, curSkill, tick):
|
| | | GameObj.SetHP(curObjDetel, 1)
|
| | | return
|
| | | |
| | | npcControl = NPCCommon.NPCControl(curObjDetel)
|
| | | npcControl.SetKilled()
|
| | | return
|
| | |
| | | #执行击杀NPC逻辑
|
| | | curPlayer = PetControl.GetPetOwner(curPet) # 宠物主人
|
| | |
|
| | | if not ChNPC.OnCheckCanDie(curPlayer, curTagNPC, skill, tick):
|
| | | GameObj.SetHP(curTagNPC, 1)
|
| | | return
|
| | | |
| | | if curPlayer != None:
|
| | | FBLogic.DoFB_Player_KillNPC(curPlayer, curTagNPC, tick)
|
| | | NPCCommon.OnPlayerAttackNPCDie(curTagNPC, curPlayer, skill)
|
| | |
| | | return
|
| | |
|
| | | if GameObj.GetHP(curTagNormalNPC) <= 0:
|
| | | if not ChNPC.OnCheckCanDie(curPlayer, curTagNormalNPC, skill, tick):
|
| | | GameObj.SetHP(curTagNormalNPC, 1)
|
| | | return
|
| | | #执行击杀NPC逻辑
|
| | | FBLogic.DoFB_Player_KillNPC(curPlayer , curTagNormalNPC , tick)
|
| | | NPCCommon.OnPlayerAttackNPCDie(curTagNormalNPC, curPlayer, skill)
|
| | |
| | | #玩家击杀NPC副本触发器
|
| | | curPlayer = NPCCommon.GetSummonNPCOwner(IPY_GameWorld.gotPlayer, curSummonNPC)
|
| | |
|
| | | if not ChNPC.OnCheckCanDie(curPlayer, curTagNPC, skill, tick):
|
| | | GameObj.SetHP(curTagNPC, 1)
|
| | | return
|
| | | |
| | | #2011-05-12 chenxuewei 有没主人都只要通知一次即可,避免重复通知
|
| | | if curPlayer != None:
|
| | | FBLogic.DoFB_Player_KillNPC(curPlayer, curTagNPC, tick)
|
| | |
| | | callFunc(atkObj, curNPC, skill, tick)
|
| | |
|
| | | PlayerActivity.OnAttackNPCActivity(atkObj, curNPC)
|
| | | |
| | |
|
| | | def OnCheckCanDie(atkObj, curNPC, skill, tick):
|
| | | callFunc = GameWorld.GetExecFunc(NPCAI, "AIType_%d.%s"%(curNPC.GetAIType(), "OnCheckCanDie"))
|
| | | if callFunc == None:
|
| | | return True
|
| | | return callFunc(atkObj, curNPC, skill, tick)
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | ## 初始化NPC
|
| | | # @param tick 当前时间
|
| | |
| | | PlayerState.SetBossStateTick(atkObj, tick)
|
| | | return
|
| | |
|
| | | def OnCheckCanDie(atkObj, curNPC, skill, tick):
|
| | | ## 检查NPC是否可死亡
|
| | | tagObj = __RefreshDropOwner(curNPC, tick, 0)
|
| | | if not atkObj or not tagObj:
|
| | | GameWorld.ErrLog("Boss当前状态下不可以死亡!npcID=%s" % curNPC.GetNPCID())
|
| | | return False
|
| | | return True
|
| | |
|
| | | ## NPC被玩家杀死
|
| | | def OnAttackDieByPlayer(curNPC, curPlayer, skill):
|
| | | tick = GameWorld.GetGameWorld().GetTick()
|
| | |
| | |
|
| | | #无法找到Buff拥有者
|
| | | if not buffOwner:
|
| | | AttackCommon.DoLogic_ObjDead(curObj)
|
| | | AttackCommon.DoLogic_ObjDead(None, curObj, curSkill, tick)
|
| | | return
|
| | |
|
| | | #NPC需要手动添加伤血和仇恨, 因为无调用DoAttack
|