| | |
| | |
|
| | | return
|
| | |
|
| | | ## 获取哥布林功能NPC类型掉血值
|
| | | def GetGoblinLostHP(defender, hurtValue):
|
| | | if not defender:
|
| | | return hurtValue
|
| | | |
| | | defObjType = defender.GetGameObjType()
|
| | | if defObjType == IPY_GameWorld.gotNPC:
|
| | | npcFuncType = defender.GetFunctionType()
|
| | | if npcFuncType == ChConfig.Def_NPCFuncType_Goblin:
|
| | | goblinHurtValue = int(ReadChConfig.GetEvalChConfig('GoblinHurtValue'))
|
| | | hurtValue = min(hurtValue, goblinHurtValue)
|
| | | |
| | | return hurtValue
|
| | |
|
| | | ## 技能伤血
|
| | | # @param curObj 当前对象
|
| | | # @param skillTypeID 技能类型ID
|
| | | # @param buffOwner buff拥有者
|
| | | # @param lostValue 丢失值
|
| | | # @param tick 当前时间
|
| | | # @param view 是否广播
|
| | | # @param reduce 是否扣血
|
| | | # @return None
|
| | | # @remarks 函数详细说明.
|
| | | def SkillLostHP(curObj, skillTypeID, buffOwner, lostValue, tick, view=True, reduceHP=True, |
| | | isDoAttackResult=True, hurtType=ChConfig.Def_HurtType_Normal):
|
| | | ## 直接扣血不走公式
|
| | | # view 是否广播客户端飘血
|
| | | # isDoAttackResult 是否立即处理结果,为False必须外层有处理
|
| | | # hurtType 飘血类型
|
| | | # skillAffect 默认True 会被各种技能BUFF盾等影响伤血数值
|
| | | # False代表一些特殊处理纯固定伤害飘字(如采集固定掉1点血)
|
| | | def SkillLostHP(curObj, skillTypeID, buffOwner, lostValue, tick, view=True, |
| | | isDoAttackResult=True, hurtType=ChConfig.Def_HurtType_Normal,
|
| | | skillAffect=True):
|
| | | if lostValue <= 0:
|
| | | GameWorld.Log('###技能伤害血量异常,数值错误 = %s,技能类型ID = %s' % (lostValue, skillTypeID))
|
| | | return
|
| | |
| | | ## 后续有其他情况也应考虑进来,如镖车是否某状态不掉血
|
| | | return
|
| | |
|
| | | #lostValue = GetGoblinLostHP(curObj, lostValue)
|
| | | curObjType = curObj.GetGameObjType()
|
| | | curSkill = GameWorld.GetGameData().FindSkillByType(skillTypeID, 1)
|
| | |
|
| | |
| | | # 没有血量不能再触发
|
| | | return
|
| | |
|
| | | if reduceHP :
|
| | | lostValue = AttackCommon.CalcAtkProDef(buffOwner, curObj, lostValue, curSkill, tick)
|
| | | # 血盾 |
| | | lostValue = AttackCommon.CalcBloodShield(buffOwner, curObj, lostValue)
|
| | | |
| | | #剩余血量
|
| | | remainHP = max(curObjHP_BeforeAttack - lostValue , 0)
|
| | | |
| | | #NPC处理
|
| | | if curObjType == IPY_GameWorld.gotNPC:
|
| | | #宠物特殊处理
|
| | | if curObj.GetGameNPCObjType() == IPY_GameWorld.gnotPet:
|
| | | PetControl.SetPetHP(curObj, remainHP)
|
| | | else:
|
| | | GameObj.SetHP(curObj, remainHP)
|
| | | if not view : # 已广播的不重复
|
| | | curObj.Notify_HPEx()
|
| | |
|
| | | #其他对象逻辑处理
|
| | | if skillAffect:
|
| | | lostValue = AttackCommon.CalcHurtHPWithBuff(buffOwner, curObj, lostValue, curSkill, tick)
|
| | | |
| | | #剩余血量
|
| | | remainHP = max(curObjHP_BeforeAttack - lostValue , 0)
|
| | | |
| | | #NPC处理
|
| | | if curObjType == IPY_GameWorld.gotNPC:
|
| | | #宠物特殊处理
|
| | | if curObj.GetGameNPCObjType() == IPY_GameWorld.gnotPet:
|
| | | PetControl.SetPetHP(curObj, remainHP)
|
| | | else:
|
| | | # 已广播的不重复
|
| | | GameObj.SetHP(curObj, remainHP, not view)
|
| | | GameObj.SetHP(curObj, remainHP)
|
| | | if not view : # 已广播的不重复
|
| | | curObj.Notify_HPEx()
|
| | |
|
| | | #其他对象逻辑处理
|
| | | else:
|
| | | # 已广播的不重复
|
| | | GameObj.SetHP(curObj, remainHP, not view)
|
| | |
|
| | | AttackCommon.WriteHurtLog(buffOwner, curObj, curSkill, lostValue, hurtType, "持续掉血")
|
| | |
|
| | |
| | | return True
|
| | |
|
| | | buffSkill = curObjBuff.GetSkill()
|
| | | buffSkillLV = buffSkill.GetSkillLV()
|
| | |
|
| | | #已存在更强大的效果
|
| | | if buffSkillLV > curSkillLV:
|
| | | return
|
| | | #buff根据情况可以叠加低级,或者低级覆盖高级
|
| | | # buffSkillLV = buffSkill.GetSkillLV()
|
| | | # |
| | | # #已存在更强大的效果
|
| | | # if buffSkillLV > curSkillLV:
|
| | | # return
|
| | |
|
| | | if not buffSkill.GetLastTime():
|
| | | #GameWorld.DebugLog("无时间限制buff,只要存在buff,则无需重复添加")
|
| | |
| | |
|
| | | return returnInfo
|
| | |
|
| | |
|
| | | def FindBuffByOwner(gameObj, skillTypeID, ownerID, ownerType):
|
| | | findSkill = GameWorld.GetGameData().GetSkillBySkillID(skillTypeID)
|
| | | buffType = GetBuffType(findSkill)
|
| | | buffTuple = GetBuffManagerByBuffType(gameObj, buffType)
|
| | | if buffTuple == ():
|
| | | return None
|
| | | |
| | | buffManager = buffTuple[0]
|
| | | for i in range(0, buffManager.GetBuffCount()):
|
| | | curBuff = buffManager.GetBuff(i)
|
| | | if not curBuff:
|
| | | continue
|
| | | |
| | | #判断是否拥有同一类型的技能
|
| | | if curBuff.GetSkill().GetSkillTypeID() != skillTypeID:
|
| | | continue
|
| | | |
| | | #判断是否拥有同一类型的技能
|
| | | if curBuff.GetOwnerID() != ownerID:
|
| | | continue
|
| | | |
| | | if curBuff.GetOwnerType() != ownerType:
|
| | | continue
|
| | | |
| | | return curBuff
|
| | | |
| | | return None
|
| | | |
| | | #---------------------------------------------------------------------
|
| | | ## 执行清空命令 参数:玩家, 保留技能类型列表
|
| | | # @param curPlayer 玩家
|
| | |
| | | # @return 返回值, 伤害数量
|
| | | # @remarks 获得区域技能伤害对象数量
|
| | | def GetSkillArea_Atk_Count(attacker, curSkill):
|
| | | if attacker.GetGameObjType() == IPY_GameWorld.gotPlayer and attacker.GetAttackMode() == IPY_GameWorld.amContest:
|
| | | # 单一目标锁定模式
|
| | | return 1 |
| | | |
| | | #默认攻击最大数
|
| | | hurtCount = 50
|
| | |
|