| | |
| | | import ChPyNetSendPack
|
| | | import NetPackCommon
|
| | | import FamilyRobBoss
|
| | | #import EquipZhuXian
|
| | | import FBCommon
|
| | | import ChNPC
|
| | |
|
| | |
| | | #if FBLogic.DoFBOnKill_Player_ValuePrize(curPlayer, defender, tick):
|
| | | __GiveKill_Player_ValuePrize(curPlayer, defender, tick)
|
| | |
|
| | | NPCCommon.OnPlayerKillNPCPlayer(curPlayer, defender, tick)
|
| | | |
| | | #执行副本杀人逻辑
|
| | | if FBLogic.DoFBOnKill_Player(curPlayer, defender, tick):
|
| | | return
|
| | |
| | | if GameWorld.GetMap().GetMapFBType() != IPY_GameWorld.fbtNull:
|
| | | return
|
| | |
|
| | | crossNotifyList = []
|
| | | isCrossServer = GameWorld.IsCrossServer()
|
| | | atkServerGroupID = PlayerControl.GetPlayerServerGroupID(attacker)
|
| | | defServerGroupID = PlayerControl.GetPlayerServerGroupID(defender)
|
| | | lineID = GameWorld.GetGameWorld().GetLineID()
|
| | | # 杀人玩家有帮会
|
| | | if attacker.GetFamilyID() > 0:
|
| | |
| | | notifyCode = 'PK_pan_318691'
|
| | | paramList = [defFamilyMemberLv, defName, defMapID, atkName,defPosX, defPosY, lineID]
|
| | |
|
| | | PlayerControl.FamilyNotify(defFamilyID, notifyCode, paramList)
|
| | |
|
| | | if isCrossServer:
|
| | | crossNotifyList.append(PlayerControl.GetCrossFamilyNotifyInfo(defFamilyID, notifyCode, paramList))
|
| | | else:
|
| | | PlayerControl.FamilyNotify(defFamilyID, notifyCode, paramList)
|
| | | |
| | | # 有职位被杀,全服广播
|
| | | if defFamilyMemberLv <= 0:
|
| | | return
|
| | | if defFamilyMemberLv > 0:
|
| | | defFamilyName = defender.GetFamilyName()
|
| | |
|
| | | defFamilyName = defender.GetFamilyName()
|
| | |
|
| | | killCnt = attacker.GetDictByKey(ChConfig.Def_PlayerKey_KillPlayerCnt % defender.GetPlayerID()) + 1
|
| | | attacker.SetDict(ChConfig.Def_PlayerKey_KillPlayerCnt % defender.GetPlayerID(), killCnt)
|
| | | #被杀重置击杀数
|
| | | defender.SetDict(ChConfig.Def_PlayerKey_KillPlayerCnt % attacker.GetPlayerID(), 0)
|
| | | |
| | | killPlayerNotifyDict = IpyGameDataPY.GetFuncEvalCfg('FamilyKilledNotify')
|
| | | |
| | | killKeys = sorted(killPlayerNotifyDict.keys())
|
| | | notifyKey = 0 |
| | | for killCntKey in killKeys:
|
| | | if killCnt < killCntKey:
|
| | | break
|
| | | notifyKey = killCntKey
|
| | | if notifyKey in killPlayerNotifyDict:
|
| | | notifyMark = killPlayerNotifyDict[notifyKey]
|
| | | PlayerControl.WorldNotify(0, notifyMark, [atkName, defMapID, defFamilyName, defFamilyMemberLv, defName])
|
| | | killCnt = attacker.GetDictByKey(ChConfig.Def_PlayerKey_KillPlayerCnt % defender.GetPlayerID()) + 1
|
| | | attacker.SetDict(ChConfig.Def_PlayerKey_KillPlayerCnt % defender.GetPlayerID(), killCnt)
|
| | | #被杀重置击杀数
|
| | | defender.SetDict(ChConfig.Def_PlayerKey_KillPlayerCnt % attacker.GetPlayerID(), 0)
|
| | | |
| | | killPlayerNotifyDict = IpyGameDataPY.GetFuncEvalCfg('FamilyKilledNotify')
|
| | | |
| | | killKeys = sorted(killPlayerNotifyDict.keys())
|
| | | notifyKey = 0 |
| | | for killCntKey in killKeys:
|
| | | if killCnt < killCntKey:
|
| | | break
|
| | | notifyKey = killCntKey
|
| | | if notifyKey in killPlayerNotifyDict:
|
| | | notifyMark = killPlayerNotifyDict[notifyKey]
|
| | | msgParamList = [atkName, defMapID, defFamilyName, defFamilyMemberLv, defName]
|
| | | if isCrossServer:
|
| | | crossNotifyList.append(PlayerControl.GetCrossWorldNotifyInfo(0, notifyMark, msgParamList))
|
| | | if atkServerGroupID != defServerGroupID:
|
| | | PlayerControl.NotifyCode(attacker, notifyMark, msgParamList)
|
| | | else:
|
| | | PlayerControl.WorldNotify(0, notifyMark, msgParamList)
|
| | | |
| | | if crossNotifyList:
|
| | | PlayerControl.CrossNotify([defServerGroupID], crossNotifyList)
|
| | |
|
| | | return
|
| | |
|
| | |
| | | ChConfig.Def_HurtType_LuckyHit:[False, 0, 0],
|
| | | ChConfig.Def_HurtType_SuperHit:[False, 0, 0],
|
| | | ChConfig.Def_HurtType_Parry:[False, 0, 0],
|
| | | ChConfig.Def_HurtType_Zhuxian:[False, 0, 0],
|
| | | }
|
| | |
|
| | | calcTypeList = []
|
| | | if atkObjType == IPY_GameWorld.gotPlayer:
|
| | | calcTypeList += [ChConfig.Def_HurtType_LuckyHit, ChConfig.Def_HurtType_SuperHit]
|
| | | calcTypeList += [ChConfig.Def_HurtType_LuckyHit, ChConfig.Def_HurtType_SuperHit, ChConfig.Def_HurtType_Zhuxian]
|
| | | if defObjType == IPY_GameWorld.gotPlayer:
|
| | | calcTypeList += [ChConfig.Def_HurtType_Parry]
|
| | | # 暂时只计算玩家
|
| | |
| | | ChConfig.Def_HurtType_LuckyHit:lambda aObj, dObj, hState:__HurtTypeHappen_LuckyHit(aObj, dObj, hState),
|
| | | ChConfig.Def_HurtType_SuperHit:lambda aObj, dObj, hState:__HurtTypeHappen_SuperHit(aObj, dObj, hState),
|
| | | ChConfig.Def_HurtType_Parry:lambda aObj, dObj, hState:__HurtTypeHappen_Parry(aObj, dObj, hState),
|
| | | #ChConfig.Def_HurtType_Zhuxian:lambda aObj, dObj, hState:__HurtTypeHappen_Zhuxian(aObj, dObj, hState),
|
| | | }
|
| | |
|
| | | hadCheckList = [] # 已经处理过的伤害类型列表
|
| | |
| | | for mutexHurtTypeList in mutexList:
|
| | | curMHHappen = False # 当前互斥列表是否有触发的
|
| | | for hType in mutexHurtTypeList:
|
| | | if hType not in calcTypeList:
|
| | | if hType not in calcTypeList or hType not in happenFunc:
|
| | | continue
|
| | | if hType in hadCheckList:
|
| | | continue
|
| | |
| | |
|
| | | # 再算优先级列表里
|
| | | for hType in priorityList:
|
| | | if hType not in calcTypeList:
|
| | | if hType not in calcTypeList or hType not in happenFunc:
|
| | | continue
|
| | | if hType not in hadCheckList:
|
| | | hadCheckList.append(hType)
|
| | |
| | | return True, 0, chanceDefPer
|
| | | return
|
| | |
|
| | | #def __HurtTypeHappen_Zhuxian(atkObj, defObj, happenState):
|
| | | # """诛仙一击"""
|
| | | # rate = PlayerControl.GetZhuXianRate(atkObj)
|
| | | # if not rate:
|
| | | # return
|
| | | # |
| | | # if GameWorld.CanHappen(rate):
|
| | | # return True, PlayerControl.GetZhuXianHurtPer(atkObj), 0
|
| | | # return
|
| | |
|
| | |
|
| | | def ChangeSkillHurtPer(atkObj, defObj, curSkill, skillPer):
|
| | | ## 改变技能伤害百分比
|
| | | |
| | | if not curSkill:
|
| | | return skillPer
|
| | | |
| | | if atkObj.GetGameObjType() != IPY_GameWorld.gotPlayer:
|
| | | return skillPer
|
| | | |
| | | #skillTypeID = curSkill.GetSkillTypeID()
|
| | | |
| | | addPer = 0
|
| | | reducePer = 0
|
| | | #addPer += EquipZhuXian.GetZhuXianEquipSkillAddPer(atkObj.GetPlayerID(), skillTypeID)
|
| | | |
| | | if defObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | #reducePer = EquipZhuXian.GetZhuXianEquipSkillReducePer(defObj.GetPlayerID(), skillTypeID)
|
| | | |
| | | #根据防守方职业 计算攻击方伤害加成
|
| | | if defObj.GetJob() in [ShareDefine.PlayerJob_Warrior, ShareDefine.PlayerJob_Knight]:
|
| | | addPer += PlayerControl.GetJobAHurtAddPer(atkObj)
|
| | | elif defObj.GetJob() in [ShareDefine.PlayerJob_Wizard, ShareDefine.PlayerJob_ForceUser]:
|
| | | addPer += PlayerControl.GetJobBHurtAddPer(atkObj)
|
| | | elif defObj.GetJob() in [ShareDefine.PlayerJob_Assassin, ShareDefine.PlayerJob_BowMaster]:
|
| | | addPer += PlayerControl.GetJobCHurtAddPer(atkObj)
|
| | | |
| | | #根据攻击方职业 计算防守方伤害减免
|
| | | if atkObj.GetJob() in [ShareDefine.PlayerJob_Warrior, ShareDefine.PlayerJob_Knight]:
|
| | | reducePer += PlayerControl.GetJobAAtkReducePer(defObj)
|
| | | elif atkObj.GetJob() in [ShareDefine.PlayerJob_Wizard, ShareDefine.PlayerJob_ForceUser]:
|
| | | reducePer += PlayerControl.GetJobBAtkReducePer(defObj)
|
| | | elif atkObj.GetJob() in [ShareDefine.PlayerJob_Assassin, ShareDefine.PlayerJob_BowMaster]:
|
| | | reducePer += PlayerControl.GetJobCAtkReducePer(defObj)
|
| | | |
| | | if addPer or reducePer:
|
| | | addSkillPer = (addPer - reducePer) / 10000.0
|
| | | skillPer = max(0, skillPer + addSkillPer)
|
| | | |
| | | return skillPer
|
| | |
|
| | | # 改变技能伤害(效果ID1010), 野外小怪1009替换1010伤害(2018-03-07增加精英怪)
|
| | | def ChangeSkillHurt(curPlayer, defObj, curSkill, skillPer, skillValue):
|
| | |
| | | return True
|
| | |
|
| | | # 攻击时防守方神兵护盾的处理
|
| | | def CalcAtkProDef(atkObj, defObj, hurtValue):
|
| | | def CalcAtkProDef(atkObj, defObj, hurtValue, curSkill, tick):
|
| | | if defObj.GetGameObjType() != IPY_GameWorld.gotPlayer:
|
| | | return hurtValue
|
| | |
|
| | |
| | |
|
| | | PlayerControl.SetProDef(defObj, curProDef - absortValue)
|
| | |
|
| | | # 被动技能触发
|
| | | defObj.SetDict(ChConfig.Def_PlayerKey_GodWeaponBeforeProDef, curProDef)
|
| | | PassiveBuffEffMng.OnPassiveSkillTrigger(defObj, atkObj, None, ChConfig.TriggerType_ProDefValue, tick)
|
| | | return hurtValue - absortValue
|
| | |
|
| | | ## 计算伤血值
|
| | |
| | | atkObj = ElfChangeAttacker(attacker) # Elf灵为替身攻击,要取玩家的属性
|
| | |
|
| | | resultHurtType = HurtType()
|
| | | atkObjType = attacker.GetGameObjType()
|
| | | defObjType = defObj.GetGameObjType()
|
| | | dHP = GameObj.GetHP(defObj) # 防守方当前血量
|
| | | dMaxHP = GameObj.GetMaxHP(defObj) # 防守方最大血量
|
| | |
| | | # 理论伤害一致, 多加点预算伤害避免计算误差
|
| | | #hurtValue = min(ShareDefine.Def_UpperLimit_DWord, hurtValue+10)
|
| | | #atkObj.SetDict(ChConfig.Def_PlayerKey_ClientMaxHurtValue, int(hurtValue*1.2))
|
| | | hurtValue = atkObj.GetMaxAtk()*atkSkillPer*20 # 加入被动计算不准确改成估算
|
| | | hurtValue = atkObj.GetMaxAtk()*atkSkillPer*40 # 加入被动计算不准确改成估算
|
| | |
|
| | | clientValue, hurtType = SkillShell.GetClientHurtByObj(defObj.GetID(), defObjType)
|
| | | if clientValue <= hurtValue:
|
| | | hurtValue = clientValue
|
| | | else:
|
| | | # 外挂最高伤害基本防范
|
| | | GameWorld.DebugAnswer(atkObj, "%s----客户端伤害 %s 服务端最高伤害 %s"%(atkObj.GetID(), [clientValue, hurtType], hurtValue))
|
| | | GameWorld.DebugLog(atkObj, "%s----客户端伤害 %s 服务端最高伤害 %s"%(atkObj.GetID(), [clientValue, hurtType], hurtValue))
|
| | | hurtValue = int(hurtValue*0.8)
|
| | | #GameWorld.DebugAnswer(atkObj, "客户端伤害 %s 服务端伤害 %s"%([defObj.GetID(), clientValue, hurtType], hurtValue))
|
| | |
|
| | | else:
|
| | | hurtValue, hurtType = CalcHurtHP(atkObj, defObj, curSkill, atkSkillValue, atkSkillPer, tick, orgAtkObj=attacker)
|
| | |
|
| | | # 优先处理神兵护盾
|
| | | hurtValue = CalcAtkProDef(atkObj, defObj, hurtValue)
|
| | |
|
| | | if defObj.GetDictByKey(ChConfig.Def_PlayerKey_AbsorbShieldValue):
|
| | | # 麒麟护盾吸收伤害,将抵消的伤害存储
|
| | | absortValue = int(defObj.GetDictByKey(ChConfig.Def_PlayerKey_AbsorbShieldValue)/float(ShareDefine.Def_MaxRateValue)*hurtValue) |
| | | hurtValue -= absortValue
|
| | | |
| | | # 吸收至指定血量比例值
|
| | | absorbHurt = defObj.GetDictByKey(ChConfig.Def_PlayerKey_AbsorbShield)
|
| | | if absorbHurt <= defObj.GetDictByKey(ChConfig.Def_PlayerKey_AbsorbShieldMax):
|
| | | maxValue = min(absorbHurt + absortValue, defObj.GetDictByKey(ChConfig.Def_PlayerKey_AbsorbShieldMax))
|
| | | defObj.SetDict(ChConfig.Def_PlayerKey_AbsorbShield, maxValue) # 记录护盾吸收的伤害用于爆炸
|
| | | WriteHurtLog(attacker, defObj, curSkill, hurtValue, hurtType, "公式层")
|
| | | |
| | | hurtValue = CalcHurtHPWithBuff(atkObj, defObj, hurtValue, curSkill, tick)
|
| | |
|
| | | # buff减少伤害百分比
|
| | | reducePer = PassiveBuffEffMng.GetValueByPassiveBuffTriggerType(defObj, atkObj, None, ChConfig.TriggerType_ReduceHurtHPPer)
|
| | |
| | | reducePer += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(defObj, atkObj, None, ChConfig.TriggerType_ReduceHurtHPPer)
|
| | | hurtValue = int(hurtValue*(max(ChConfig.Def_MaxRateValue - reducePer, 0))*1.0/ChConfig.Def_MaxRateValue)
|
| | |
|
| | | |
| | | # 终极斩杀新效果,必须和斩杀严格区分,会涉及到CD概率,已经触发其他技能等问题
|
| | | if PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_ZhongjiZhansha):
|
| | | # նɱ
|
| | | hurtType = ChConfig.Def_HurtType_ZhognjiZhansha
|
| | | hurtValue = GameObj.GetHP(defObj)
|
| | | #伤害结构体
|
| | | resultHurtType.HurtHP = hurtValue
|
| | | resultHurtType.HurtType = hurtType
|
| | | resultHurtType.RealHurtHP = hurtValue
|
| | | |
| | | remainHP = 0 # 剩余血量
|
| | |
|
| | | # 斩杀,濒死等情况的处理
|
| | | if PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_AttackKill):
|
| | | elif PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_AttackKill):
|
| | | # նɱ
|
| | | hurtType = ChConfig.Def_HurtType_Zhansha
|
| | | hurtValue = GameObj.GetHP(defObj)
|
| | | #伤害结构体
|
| | | resultHurtType.HurtHP = hurtValue
|
| | |
| | |
|
| | | remainHP = int(remainHP) #防范
|
| | | if defObjType == IPY_GameWorld.gotPlayer:
|
| | | curHP = GameObj.GetHP(defObj)
|
| | | GameObj.SetHP(defObj, remainHP, False)
|
| | | |
| | | lockHPPer = PassiveBuffEffMng.OnObjsPassiveSkillLockHP(defObj, atkObj, curSkill, ChConfig.TriggerType_LockHP, tick)
|
| | | if lockHPPer:
|
| | | # 锁血情况
|
| | | lockHP = GameObj.GetMaxHP(defObj)*lockHPPer/ChConfig.Def_MaxRateValue
|
| | | if lockHP < curHP and remainHP < lockHP:
|
| | | remainHP = lockHP
|
| | | elif lockHP >= curHP:
|
| | | remainHP = curHP
|
| | | |
| | | #锁血纠正血量
|
| | | GameObj.SetHP(defObj, remainHP, False)
|
| | |
|
| | | elif defObjType == IPY_GameWorld.gotNPC:
|
| | | if defObj.GetGameNPCObjType() == IPY_GameWorld.gnotPet:
|
| | |
| | | resultHurtType.LostHP = lostValue
|
| | | if defObjType == IPY_GameWorld.gotPlayer:
|
| | | FBLogic.OnFBLostHP(defObj, lostValue)
|
| | | |
| | | |
| | | WriteHurtLog(attacker, defObj, curSkill, resultHurtType.LostHP, resultHurtType.HurtType, "最终扣血")
|
| | | |
| | | #攻击触发事件, 该代码应该放在DoAttack函数中处理逻辑比较清晰,也不会破坏GetHurtHP函数
|
| | | #因为DoAttack修改点比较多,暂不迁移,相关攻击事件逻辑,就往此函数中添加
|
| | | AttackEventTrigger(atkObj, defObj, curSkill, resultHurtType, tick)
|
| | |
| | |
|
| | | return resultHurtType
|
| | |
|
| | | # 计算伤害后,因各种buff和状态的影响处理
|
| | | def CalcHurtHPWithBuff(atkObj, defObj, hurtValue, curSkill, tick):
|
| | | # 优先处理神兵护盾
|
| | | hurtValue = CalcAtkProDef(atkObj, defObj, hurtValue, curSkill, tick)
|
| | |
|
| | | # 伤害吸收盾回血型
|
| | | buffManager = defObj.GetBuffState()
|
| | | curEffect, plusValue, skillID = BuffSkill.FindBuffEffectPlusByEffectID(buffManager, ChConfig.Def_Skill_Effect_AbsorbShieldXMZJ)
|
| | | if skillID:
|
| | | absortValue = hurtValue*curEffect.GetEffectValue(0)/ShareDefine.Def_MaxRateValue
|
| | | if absortValue:
|
| | | hurtValue -= absortValue
|
| | | findBuff = SkillCommon.FindBuffByID(defObj, skillID)[0]
|
| | | if findBuff:
|
| | | # 用于回血
|
| | | findBuff.SetValue(int(findBuff.GetValue() + absortValue))
|
| | |
|
| | | if defObj.GetDictByKey(ChConfig.Def_PlayerKey_AbsorbValue):
|
| | | defObj.SetDict(ChConfig.Def_PlayerKey_AbsorbValue, 0) #吸收的单次伤害,单次伤害必须清空
|
| | | if defObj.GetDictByKey(ChConfig.Def_PlayerKey_AbsorbShieldValue):
|
| | | # 麒麟护盾吸收伤害,将抵消的伤害存储
|
| | | absortValue = int(defObj.GetDictByKey(ChConfig.Def_PlayerKey_AbsorbShieldValue)/float(ShareDefine.Def_MaxRateValue)*hurtValue) |
| | | hurtValue -= absortValue
|
| | | defObj.SetDict(ChConfig.Def_PlayerKey_AbsorbValue, absortValue) #吸收的单次伤害
|
| | | |
| | | # 天罡护法,将期间受到的伤害总值用于回血,不改变伤害
|
| | | curEffect, plusValue, skillID2 = BuffSkill.FindBuffEffectPlusByEffectID(buffManager, ChConfig.Def_Skill_Effect_StoreBlood)
|
| | | if skillID2:
|
| | | absortValue = hurtValue*curEffect.GetEffectValue(0)/ShareDefine.Def_MaxRateValue
|
| | | if absortValue:
|
| | | findBuff = SkillCommon.FindBuffByID(defObj, skillID2)[0]
|
| | | if findBuff:
|
| | | # 用于回血
|
| | | findBuff.SetValue(int(findBuff.GetValue() + absortValue))
|
| | | return hurtValue
|
| | |
|
| | |
|
| | |
|
| | | # GM 命令 HurtLog 查看战斗伤害日志
|
| | | def WriteHurtLog(attacker, defObj, curSkill, hurtValue, hurtType, msg):
|
| | | logLevel = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_HurtLog)
|
| | | if not logLevel:
|
| | | return
|
| | | |
| | | if logLevel == 1:
|
| | | # 只看玩家伤害
|
| | | if not attacker:
|
| | | return
|
| | | |
| | | if attacker.GetGameObjType() != IPY_GameWorld.gotPlayer:
|
| | | return
|
| | | msg = "玩家" + msg
|
| | | |
| | | attackerID = attacker.GetID() if attacker else 0
|
| | | defenderID = defObj.GetID() if defObj else 0
|
| | | skillID = curSkill.GetSkillID() if curSkill else 0
|
| | | skillName = curSkill.GetSkillName() if curSkill else ""
|
| | | attackerName = attacker.GetName() if attacker else ""
|
| | | defenderName = defObj.GetName() if defObj else ""
|
| | | |
| | | if attacker and attacker.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | attackerName = attackerName.decode("utf8").encode('gbk')
|
| | | |
| | | if defObj and defObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | defenderName = defenderName.decode("utf8").encode('gbk')
|
| | | |
| | | GameWorld.DebugLog("攻击伤害-%s:(%s %s)攻击(%s %s), 技能ID:(%s %s), 伤害值:%s, 伤害类型:%s "%(
|
| | | msg, attackerID, attackerName, defenderID, defenderName,
|
| | | skillID, skillName, hurtValue, hurtType))
|
| | |
|
| | | # 血盾支持多个同时存在
|
| | | def CalcBloodShield(atkObj, defObj, hurtValue):
|
| | |
| | | isLuckyHit, aLuckyHit, dLuckyHitReduce = hurtTypeResultDict[ChConfig.Def_HurtType_LuckyHit] # 幸运一击
|
| | | isSuperHit, aSuperHit, dSuperHitReduce = hurtTypeResultDict[ChConfig.Def_HurtType_SuperHit] # 暴击
|
| | | dDamChanceDef = hurtTypeResultDict[ChConfig.Def_HurtType_Parry][2] # 抵御, 大于0代表触发抵御效果
|
| | |
|
| | | isZhuxianHit, aZhuxianHurtPer, dZhuxianReducePer = hurtTypeResultDict[ChConfig.Def_HurtType_Zhuxian] # 诛仙一击
|
| | | |
| | | if PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(defObj, atkObj, None, ChConfig.TriggerType_OneDamage):
|
| | | return 1, hurtType
|
| | |
|
| | | wReFightPower = 0
|
| | | worldLV = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_WorldAverageLv)
|
| | | wLVIpyData = PlayerControl.GetPlayerLVIpyData(worldLV)
|
| | | wReFightPower = 0 if not wLVIpyData else wLVIpyData.GetReFightPower() # 当前世界等级参考战力
|
| | | if worldLV:
|
| | | wLVIpyData = PlayerControl.GetPlayerLVIpyData(worldLV)
|
| | | wReFightPower = 0 if not wLVIpyData else wLVIpyData.GetReFightPower() # 当前世界等级参考战力
|
| | |
|
| | | # 改变技能伤害
|
| | | atkSkillPer, atkSkillValue = ChangeSkillHurt(atkObj, defObj, curSkill, atkSkillPer, atkSkillValue)
|
| | | |
| | | atkSkillPer = ChangeSkillHurtPer(atkObj, defObj, curSkill, atkSkillPer)
|
| | |
|
| | | # atkSkillPer 包含普攻,所以不是用技能增强处理
|
| | | atkSkillPer += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_AttackAddSkillPer)
|
| | |
| | |
|
| | | # 暴击增加技能伤害
|
| | | atkSkillPer += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_SuperHitSkillPer)
|
| | | atkSkillPer += PassiveBuffEffMng.GetValueByPassiveBuffTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_SuperHitSkillPer)
|
| | | |
| | | # buff中暴击减层,无触发技能
|
| | | PassiveBuffEffMng.OnPassiveBuffTrigger(atkObj, defObj, curSkill, ChConfig.TriggerType_SuperHitSubLayer, tick)
|
| | |
|
| | |
|
| | | if isLuckyHit:
|
| | | # 会心一击时增加会心伤害百分比
|
| | | aLuckyHit += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_LuckyHit)
|
| | |
|
| | | aLuckyHit -= PassiveBuffEffMng.GetValueByPassiveBuffTriggerType(defObj, atkObj, curSkill, ChConfig.TriggerType_BeLuckyHitSubPer)
|
| | | aLuckyHit = max(aLuckyHit, 0)
|
| | | |
| | | #参与运算的数值
|
| | | rand = random.random() #种子数 0~1
|
| | |
|
| | |
| | |
|
| | | else:
|
| | | aIgnoreDefRate = 0 # 无视防御比率
|
| | | aFinalHurtPer = GameObj.GetPetDamPer(atkObj) # 最外层伤害加成, 可能为负值
|
| | | aSkillAtkRate = NPCCommon.GetSkillAtkRate(atkObj) # 技能攻击力加成
|
| | | if atkObjType == IPY_GameWorld.gotNPC and atkObj.GetGameNPCObjType() == IPY_GameWorld.gnotPet:
|
| | | aSkillAtkRate += atkObj.GetSkillAtkRate()
|
| | | |
| | | aNPCHurtAddPer = 0 # PVE伤害加成
|
| | | aDamagePer = 0 # 外层伤害加成
|
| | | aDamagePerPVP = 0 # 外层PVP伤害加成
|
| | | aFinalHurtPer = 0 # 最外层伤害加成, 可能为负值
|
| | | aFinalHurt = NPCCommon.GetFinalHurt(atkObj) # 最终固定伤害
|
| | | aFightPower = NPCCommon.GetSuppressFightPower(atkObj)
|
| | |
|
| | |
| | | suppressFormulaKeyRealm = "PVESuppressValueRealm"
|
| | | if suppressFormulaKeyRealm in hurtDist:
|
| | | SuppressValueRealmRate = int(eval(FormulaControl.GetCompileFormula(suppressFormulaKeyRealm, hurtDist[suppressFormulaKeyRealm])))
|
| | | |
| | | |
| | | # 骑宠争夺最终伤害衰减 |
| | | if defObjType == IPY_GameWorld.gotNPC and FamilyRobBoss.IsHorsePetRobBoss(defObj.GetNPCID()):
|
| | | ownerPlayer = None
|
| | | # 召唤兽和宠物需要从人物获取状态
|
| | | if atkObj.GetGameObjType() == IPY_GameWorld.gotNPC:
|
| | | if atkObj.GetGameNPCObjType() == IPY_GameWorld.gnotPet:
|
| | | ownerPlayer = PetControl.GetPetOwner(atkObj)
|
| | | elif atkObj.GetGameNPCObjType() == IPY_GameWorld.gnotSummon:
|
| | | ownerPlayer = NPCCommon.GetSummonNPCOwner(IPY_GameWorld.gotPlayer, atkObj)
|
| | | else:
|
| | | ownerPlayer = atkObj
|
| | |
|
| | | # 骑宠争夺最终伤害衰减 |
| | | if FamilyRobBoss.IsHorsePetRobBoss(defObj.GetNPCID()):
|
| | | findBuff = SkillCommon.FindBuffByID(atkObj, ChConfig.Def_SkillID_HorsePetRobBossKillCntBuff)[0]
|
| | | if ownerPlayer:
|
| | | findBuff = SkillCommon.FindBuffByID(ownerPlayer, ChConfig.Def_SkillID_HorsePetRobBossKillCntBuff)[0]
|
| | | if findBuff:
|
| | | reduceFinalHurtPer = findBuff.GetSkill().GetEffect(0).GetEffectValue(0)
|
| | | aFinalHurtPer -= reduceFinalHurtPer
|
| | |
| | | atkObj.SetDict(ChConfig.Def_PlayerKey_LastHurtValue, resultHurtType.RealHurtHP)
|
| | | if defObj.GetGameObjType() == IPY_GameWorld.gotNPC:
|
| | | atkObj.SetDict(ChConfig.Def_PlayerKey_LastHurtNPCObjID, defObj.GetID())
|
| | | |
| | | else:
|
| | | defObj.SetDict(ChConfig.Def_PlayerKey_LastAttackerObjID, atkObj.GetID())
|
| | | return
|
| | |
|
| | |
|
| | |
| | | if objType == IPY_GameWorld.gotPlayer:
|
| | | return "P"
|
| | |
|
| | | if objType == IPY_GameWorld.gotNPC:
|
| | | if obj.GetType() == ChConfig.ntRobot:
|
| | | return "Robot"
|
| | | if obj.GetType() == ChConfig.ntHelpBattleRobot:
|
| | | return "HelpRobot"
|
| | | |
| | | objType = obj.GetGameNPCObjType()
|
| | | if objType == IPY_GameWorld.gnotPet:
|
| | | return "Pet"
|
| | |
| | | atkBackHPPer += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_Buff_SuckBloodPer)
|
| | |
|
| | | atkBackHP += int(hurtValue * atkBackHPPer*1.0 / ChConfig.Def_MaxRateValue)
|
| | |
|
| | | |
| | | suckHP += atkBackHP
|
| | |
|
| | | if suckHP <= 0:
|
| | |
| | |
|
| | | if GetIsNewGuy(tagPlayer):
|
| | | return ChConfig.Type_Relation_None, ChConfig.Def_PASysMessage_NotAttackNewGuy
|
| | | |
| | | #攻守双方同一队伍,不可PK,可加增益buff
|
| | | #if curPlayerAreaType not in [ShareDefine.gatManor] and CanAlikeTeam(curPlayer, tagPlayer):
|
| | | # #副本队友特殊判断
|
| | | # if not PlayerCanAttackTeamerInFB(curPlayer, tagPlayer): |
| | | # return ChConfig.Type_Relation_Friend , ChConfig.Def_PASysMessage_NotAttackTeam
|
| | |
|
| | | #恶意攻击的玩家默认都是敌人, 无论什么模式
|
| | | if IsMaliciousAttackPlayer(curPlayer, tagPlayer):
|