| | |
| | | import BuffSkill
|
| | | import PlayerState
|
| | | import ChPyNetSendPack
|
| | | import NPCHurtManager
|
| | | import NetPackCommon
|
| | | import FamilyRobBoss
|
| | | import FBCommon
|
| | |
| | |
|
| | | #打boss中不增加 2018/7/18改为只要在野外地图被其他玩家杀死都增加疲劳
|
| | | #if not PlayerState.IsInBossState(curPlayer):
|
| | | if GameWorld.GetMap().GetMapFBType() == IPY_GameWorld.fbtNull:
|
| | | if GameWorld.GetMap().GetMapFBType() == IPY_GameWorld.fbtNull or curPlayer.GetMapID() == ChConfig.Def_FBMapID_BossHome:
|
| | | PlayerControl.NomalDictSetProperty(defender, ChConfig.Def_PDict_IsAddReviveTired, 1)
|
| | | return
|
| | |
|
| | |
| | | # @param hurtHP 攻击伤血值
|
| | | # @return None or True
|
| | | # @remarks 函数详细说明.
|
| | | def NPCAddObjInHurtList(curObj, curTagObj, curTaglNPCHPBefore, hurtHP) :
|
| | | def NPCAddObjInHurtList(curObj, curTagObj, curTaglNPCHPBefore, hurtHP, isBounce=False):
|
| | | if curObj == None:
|
| | | GameWorld.ErrLog("NPCAddObjInHurtList NoFindObj")
|
| | | return
|
| | |
|
| | | if curTaglNPCHPBefore < hurtHP:
|
| | | hurtHP = curTaglNPCHPBefore
|
| | |
|
| | | defNPCHurtList = curTagObj.GetPlayerHurtList()
|
| | | |
| | | #if curTaglNPCHPBefore < hurtHP:
|
| | | # hurtHP = curTaglNPCHPBefore
|
| | | |
| | | curObjType = curObj.GetGameObjType()
|
| | | if curObjType == IPY_GameWorld.gotPlayer:
|
| | | #BossHurtMng.BossAddPlayerInHurtList(curObj, curTagObj, hurtHP)
|
| | |
| | | FBLogic.DoFB_Player_HurtNPC(curObj, curTagObj, hurtHP)
|
| | | if GameObj.GetHP(curTagObj) == 0:
|
| | | curTagObj.SetDict(ChConfig.Def_PlayerKey_LastHurt, curObj.GetPlayerID())
|
| | | |
| | | if NPCHurtManager.AddHurtValue(curObj, curTagObj, hurtHP, isBounce):
|
| | | return
|
| | |
|
| | | curTeam = curObj.GetTeam()
|
| | |
|
| | |
| | | # return False
|
| | |
|
| | | #击杀次数判断
|
| | | if not CheckKillNPCByCnt(attacker, defender):
|
| | | if not NPCHurtManager.IsAssistPlayer(attacker.GetPlayerID(), defender) and not CheckKillNPCByCnt(attacker, defender):
|
| | | return False
|
| | |
|
| | | #仙盟归属NPC判断
|
| | |
| | | # return False
|
| | |
|
| | | #击杀次数判断
|
| | | if not CheckKillNPCByCnt(defender, attacker, False):
|
| | | if not CheckKillNPCByCnt(defender, attacker, False) and not NPCHurtManager.IsAssistPlayer(defender.GetPlayerID(), attacker):
|
| | | return False
|
| | |
|
| | | #仙盟归属NPC判断
|
| | |
| | | if PetControl.IsPet(attacker) or attacker.GetGameNPCObjType()== IPY_GameWorld.gnotSummon:
|
| | | #击杀次数判断
|
| | | if not CheckKillNPCByCnt(attacker, defender, False):
|
| | | return False
|
| | | |
| | | ownerPlayer = GetAttackPlayer(attacker)[0]
|
| | | if ownerPlayer and not NPCHurtManager.IsAssistPlayer(ownerPlayer.GetPlayerID(), defender):
|
| | | return False
|
| | | |
| | | #仙盟归属NPC判断
|
| | | if not CheckCanAttackFamilyOwnerNPC(attacker, defender, False):
|
| | | return False
|
| | |
| | | if atkObj.GetGameObjType() != IPY_GameWorld.gotPlayer:
|
| | | return skillPer
|
| | |
|
| | | #skillTypeID = curSkill.GetSkillTypeID()
|
| | | skillTypeID = curSkill.GetSkillTypeID()
|
| | |
|
| | | addPer = 0
|
| | | reducePer = 0
|
| | | addPer += SkillCommon.GetSkillAddPerByID(atkObj, skillTypeID)
|
| | |
|
| | | if defObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | reducePer = SkillCommon.GetSkillReducePerByID(defObj, skillTypeID)
|
| | |
|
| | | #根据防守方职业 计算攻击方伤害加成
|
| | | if defObj.GetJob() in [ShareDefine.PlayerJob_Warrior, ShareDefine.PlayerJob_Knight]:
|
| | |
| | | # 计算攻击伤害
|
| | | # maxHurt参数用于模拟计算最大伤害,防范客户端攻击伤害过高
|
| | | def CalcHurtHP(atkObj, defObj, curSkill, atkSkillValue, atkSkillPer, tick, happenState=None, **atkwargs):
|
| | | #===========================================================================
|
| | | # # 翻滚闪避特殊处理
|
| | | # if tick - defObj.GetDictByKey(ChConfig.Def_PlayerKey_SomersaultTime) < 500:
|
| | | # return 0, ChConfig.Def_HurtType_Miss
|
| | | #===========================================================================
|
| | | # 翻滚闪避特殊处理
|
| | | if tick - defObj.GetDictByKey(ChConfig.Def_PlayerKey_SomersaultTime) < 500:
|
| | | return 0, ChConfig.Def_HurtType_Miss
|
| | |
|
| | | summonAtkPer = 1 # 召唤继承提高基础攻击力,取表
|
| | | summonAtkObj = atkwargs.get('orgAtkObj', None) if atkwargs.get('orgAtkObj', None) else atkObj
|
| | |
| | | # GameWorld.DebugLog("不能攻击,不反弹")
|
| | | # return
|
| | | #杀怪次数判断
|
| | | if not CheckKillNPCByCnt(defObj, atkObj, False):
|
| | | if not CheckKillNPCByCnt(defObj, atkObj, False) and not NPCHurtManager.IsAssistPlayer(defObj.GetPlayerID(), atkObj):
|
| | | #GameWorld.DebugLog("不能攻击,不反弹")
|
| | | return
|
| | |
|
| | |
| | | if IsSameServer(curPlayer, tagPlayer):
|
| | | return ChConfig.Type_Relation_Friend, ChConfig.Def_PASysMessage_NotAttackServer
|
| | |
|
| | | # 锁定模式(不可攻击队友)
|
| | | elif curPlayerAttackMode == IPY_GameWorld.amContest:
|
| | | if CanAlikeTeam(curPlayer, tagPlayer):
|
| | | return ChConfig.Type_Relation_Friend, ChConfig.Def_PASysMessage_NotAttackTeam
|
| | | |
| | | # 全体模式
|
| | | elif curPlayerAttackMode == IPY_GameWorld.amAll:
|
| | | pass
|