| | |
| | | ght = useSkill.GetHurtType() % 10
|
| | | if ght == IPY_GameWorld.ghtMag: # 做配置兼容用,优先验证法伤,否则默认物伤
|
| | | return IPY_GameWorld.ghtMag
|
| | | if ght == 3: # 由触发的技能决定
|
| | | bySkill = useSkill.GetBySkill()
|
| | | if bySkill:
|
| | | #GameWorld.DebugLogEx("物法类型取触发的技能: useSkillID=%s,bySkillID=%s", useSkill.GetSkillID(), bySkill.GetSkillID())
|
| | | return GetPMType(batObj, bySkill)
|
| | | return IPY_GameWorld.ghtPhy
|
| | |
|
| | | def IsIgnoreDef(useSkill):
|
| | |
| | | useSkill.SetBatType(batType)
|
| | | useSkill.SetBySkill(bySkill)
|
| | | useSkill.SetByBuff(byBuff)
|
| | | # 注:理论上原先的 byFriendObj 都可以直接用这个,但是旧的代码先不修改了,后续的累计敌军、友军之类的触发可以统一使用 byBatObj
|
| | | useSkill.SetByBatObj(kwargs.pop("byBatObj", None))
|
| | | useSkill.SetByTriggerWay(byTriggerWay)
|
| | |
|
| | | isTurnNormalSkill = SkillCommon.isTurnNormalSkill(useSkill)
|
| | |
| | | triggerOne = False
|
| | | batType = useSkill.GetBatType()
|
| | | isAttackDirect = (isUseSkill and SkillCommon.isAttackDirectSkill(useSkill)) # 是否直接攻击
|
| | | curBatLineup = None
|
| | | curBatLineup = curObj.GetBatLineup()
|
| | | curMGObj = curBatLineup.getMinggeObj()
|
| | | for tagObj in tagObjListAll:
|
| | | tagID = tagObj.GetID()
|
| | |
|
| | |
| | | # 追击
|
| | | elif batType == ChConfig.TurnBattleType_Pursue:
|
| | | TurnPassive.OnTriggerPassiveEffect(turnFight, curObj, ChConfig.TriggerWay_Pursue, tagObj, connSkill=useSkill)
|
| | | if isAttackDirect:
|
| | | if curMGObj:
|
| | | TurnPassive.OnTriggerPassiveEffect(turnFight, curMGObj, ChConfig.TriggerWay_PursueAtk, tagObj, connSkill=useSkill, byBatObj=curObj)
|
| | | TurnPassive.OnTriggerPassiveEffect(turnFight, tagObj, ChConfig.TriggerWay_BePursue, curObj, connSkill=useSkill)
|
| | | # 反击
|
| | | elif batType == ChConfig.TurnBattleType_AtkBack:
|
| | |
| | |
|
| | | # 敌友方
|
| | | if isAttackDirect or batType in [ChConfig.TurnBattleType_Combo, ChConfig.TurnBattleType_Pursue] or isDotHurt:
|
| | | if not curBatLineup:
|
| | | curBatLineup = curObj.GetBatLineup()
|
| | | for lineupObjID in curBatLineup.posObjIDDict.values():
|
| | | lineupObj = batObjMgr.getBatObj(lineupObjID)
|
| | | if not lineupObj.IsAlive():
|
| | |
| | | '''按公式计算伤害,默认按攻击计算
|
| | | '''
|
| | |
|
| | | #mapID = turnFight.mapID
|
| | | skillID = curSkill.GetSkillID()
|
| | | # 命格攻击类技能,取触发者为施法方,因为部分战斗属性需要取施法方的,如最终增伤等
|
| | | if curSkill.GetFuncType() == ChConfig.Def_SkillFuncType_MinggeSkill:
|
| | | byBatObj = curSkill.GetByBatObj()
|
| | | if byBatObj:
|
| | | GameWorld.DebugLogEx("命格攻击类技能计算伤害属性取触发者! mgObjID=%s,byObjID=%s,skillID=%s", atkObj.GetID(), byBatObj.GetID(), skillID)
|
| | | atkObj = byBatObj
|
| | | |
| | | #mapID = turnFight.mapID
|
| | | pmType = GetPMType(atkObj, curSkill)
|
| | | ignoreDef = IsIgnoreDef(curSkill)
|
| | | batType = curSkill.GetBatType()
|
| | |
| | | mustHit = True
|
| | |
|
| | | angerOverflow = atkObj.GetAngerOverflow() # 怒气溢出值
|
| | | if isAngerSkill:
|
| | | curXP = atkObj.GetXP()
|
| | | GameWorld.DebugLogEx("怒技攻击! curXP=%s,angerOverflow=%s", curXP, angerOverflow)
|
| | | |
| | | |
| | | #命中公式 攻击方类型不同,公式不同
|
| | | if not mustHit and not curSkill.GetEffectByID(ChConfig.SkillEff_MustHit) and not defObj.IsInControlledHard():
|
| | | aMissRateDef = atkObj.GetBatAttrValue(ChConfig.AttrID_MissRateDef) #atkObj.GetHit() # 抗闪避率 - 命中
|
| | |
| | | aSuperDamPer += TurnPassive.GetTriggerEffectValue(turnFight, atkObj, defObj, ChConfig.AttrID_SuperDamPer, curSkill)
|
| | |
|
| | | dSuperDamPerDef = defObj.GetBatAttrValue(ChConfig.AttrID_SuperDamPerDef)
|
| | | GameWorld.DebugLogEx("aSuperDamPer=%s,dSuperDamPerDef=%s", aSuperDamPer, dSuperDamPerDef)
|
| | |
|
| | | if isParry:
|
| | | hurtTypes |= pow(2, ChConfig.HurtAtkType_Parry)
|
| | |
| | | aFinalDamPer += TurnPassive.GetTriggerEffectValue(turnFight, atkObj, defObj, ChConfig.PassiveEff_AddFinalDamPer, curSkill)
|
| | | aFinalDamPer += TurnPassive.GetTriggerEffectValue(turnFight, atkObj, defObj, ChConfig.AttrID_FinalDamPer, curSkill)
|
| | |
|
| | | #招架 - 无视攻击方最终增伤百分比
|
| | | dZhaojia = defObj.GetBatAttrValue(ChConfig.AttrID_Zhaojia)
|
| | | aZhaojiaDef = atkObj.GetBatAttrValue(ChConfig.AttrID_ZhaojiaDef)
|
| | | if dZhaojia > aZhaojiaDef:
|
| | | perMoreValue, perReduce = IpyGameDataPY.GetFuncEvalCfg("ZhaojiaCfg", 1) # 每高与对方抗贯穿x值无视y%最终减伤
|
| | | reducePer = (dZhaojia - aZhaojiaDef) / float(perMoreValue) * perReduce
|
| | | reduceMin, reduceMax = IpyGameDataPY.GetFuncEvalCfg("ZhaojiaCfg", 2) # 最小无视百分比|最大无视百分比
|
| | | if reducePer >= reduceMin and GameWorld.CanHappen(IpyGameDataPY.GetFuncCfg("ZhaojiaCfg", 3)):
|
| | | reducePer = min(reducePer, reduceMax)
|
| | | hurtTypes |= pow(2, ChConfig.HurtAtkType_Zhaojia)
|
| | | aFinalDamPer = int(aFinalDamPer * (100 - reducePer) / 100.0) # 按百分比减少
|
| | | GameWorld.DebugLogEx("dZhaojia=%s,aZhaojiaDef=%s,reducePer=%s,aFinalDamPer=%s", dZhaojia, aZhaojiaDef, reducePer, aFinalDamPer)
|
| | | |
| | | #贯穿 - 无视防守方最终减伤百分比
|
| | | aGuanchuan = atkObj.GetBatAttrValue(ChConfig.AttrID_Guanchuan)
|
| | | dGuanchuanDef = defObj.GetBatAttrValue(ChConfig.AttrID_GuanchuanDef)
|
| | | if aGuanchuan > dGuanchuanDef:
|
| | | perMoreValue, perReduce = IpyGameDataPY.GetFuncEvalCfg("GuanchuanCfg", 1) # 每高与对方抗贯穿x值无视y%最终减伤
|
| | | reducePer = (aGuanchuan - dGuanchuanDef) / float(perMoreValue) * perReduce
|
| | | reduceMin, reduceMax = IpyGameDataPY.GetFuncEvalCfg("GuanchuanCfg", 2) # 最小无视百分比|最大无视百分比
|
| | | if reducePer >= reduceMin and GameWorld.CanHappen(IpyGameDataPY.GetFuncCfg("GuanchuanCfg", 3)):
|
| | | reducePer = min(reducePer, reduceMax)
|
| | | hurtTypes |= pow(2, ChConfig.HurtAtkType_Guanchuan)
|
| | | dFinalDamPerDef = int(dFinalDamPerDef * (100 - reducePer) / 100.0) # 按百分比减少
|
| | | GameWorld.DebugLogEx("aGuanchuan=%s,dGuanchuanDef=%s,reducePer=%s,dFinalDamPerDef=%s", aGuanchuan, dGuanchuanDef, reducePer, dFinalDamPerDef) |
| | | |
| | | aNormalSkillPer, dNormalSkillPerDef = 0, 0
|
| | | if isTurnNormalSkill:
|
| | | aNormalSkillPer = atkObj.GetBatAttrValue(ChConfig.AttrID_NormalSkillPer) # 普技增伤
|
| | |
| | | if turnFight.isPVP() > 0:
|
| | | aPVPDamPer = atkObj.GetBatAttrValue(ChConfig.AttrID_PVPDamPer)
|
| | | dPVPDamPerDef = defObj.GetBatAttrValue(ChConfig.AttrID_PVPDamPerDef)
|
| | | GameWorld.DebugLogEx("PVP aPVPDamPer=%s,dPVPDamPerDef=%s", aPVPDamPer, dPVPDamPerDef)
|
| | |
|
| | | # 所有万分率参数统一除10000.0
|
| | | atkSkillPer /= 10000.0
|
| | |
| | |
|
| | | if calcType != ChConfig.Def_Calc_Attack:
|
| | | aAtk = GetCalcBaseValue(calcType, atkObj, defObj, curSkill)
|
| | | GameWorld.DebugLogEx("伤血计算: atkID=%s,defID=%s,skillID=%s,atkSkillPer=%s,calcType=%s,aAtk=%s,dDef=%s,dHP=%s/%s,hurtTypes=%s,aBatDamPer=%s,aFinalDamPer=%s", |
| | | atkID, defID, skillID, atkSkillPer, calcType, aAtk, dDef, dHP, dMaxHP, hurtTypes, aBatDamPer, aFinalDamPer)
|
| | | #GameWorld.DebugLogEx("aCountry=%s,dCountry=%s,aCountryDamPer=%s,dCountryDamPerDef=%s", aCountry, dCountry, aCountryDamPer, dCountryDamPerDef)
|
| | | |
| | | GameWorld.DebugLogEx("伤血计算: atkID=%s,defID=%s,skillID=%s,atkSkillPer=%s,calcType=%s,aAtk=%s,dDef=%s,dHP=%s/%s,hurtTypes=%s,aBatDamPer=%s,dBatDamPerDef=%s,aFinalDamPer=%s,dFinalDamPerDef=%s", |
| | | atkID, defID, skillID, atkSkillPer, calcType, aAtk, dDef, dHP, dMaxHP, hurtTypes, aBatDamPer, dBatDamPerDef, aFinalDamPer, dFinalDamPerDef)
|
| | | if isSuperHit:
|
| | | GameWorld.DebugLogEx(" 暴击 aSuperDamPer=%s,dSuperDamPerDef=%s", aSuperDamPer, dSuperDamPerDef)
|
| | | if aPMDamPer or dPMDamPerDef:
|
| | | GameWorld.DebugLogEx(" 物法 aPMDamPer=%s,dPMDamPerDef=%s,pmType=%s", aPMDamPer, dPMDamPerDef, pmType)
|
| | | if aComboDamPer or dComboDamPerDef:
|
| | | GameWorld.DebugLogEx(" 连击 aComboDamPer=%s,dComboDamPerDef=%s", aComboDamPer, dComboDamPerDef)
|
| | | if aPursueDamPer or dPursueDamPerDef:
|
| | | GameWorld.DebugLogEx(" 追击 aPursueDamPer=%s,dPursueDamPerDef=%s", aPursueDamPer, dPursueDamPerDef)
|
| | | if aPVPDamPer or dPVPDamPerDef:
|
| | | GameWorld.DebugLogEx(" PVP aPVPDamPer=%s,dPVPDamPerDef=%s", aPVPDamPer, dPVPDamPerDef)
|
| | | if aCountryDamPer or dCountryDamPerDef:
|
| | | GameWorld.DebugLogEx(" 国家 aCountry=%s,dCountry=%s,aCountryDamPer=%s,dCountryDamPerDef=%s", aCountry, dCountry, aCountryDamPer, dCountryDamPerDef)
|
| | | |
| | | if isTurnNormalSkill:
|
| | | hurtValue = eval(IpyGameDataPY.GetFuncCompileCfg("HurtFormula", 1))
|
| | | GameWorld.DebugLogEx(" 普攻技能伤害=%s,aNormalSkillPer=%s,dNormalSkillPerDef=%s", hurtValue, aNormalSkillPer, dNormalSkillPerDef)
|
| | | elif isAngerSkill:
|
| | | hurtValue = eval(IpyGameDataPY.GetFuncCompileCfg("HurtFormula", 2))
|
| | | GameWorld.DebugLogEx(" 怒气技能伤害=%s,aAngerSkillPer=%s,dAngerSkillPerDef=%s", hurtValue, aAngerSkillPer, dAngerSkillPerDef)
|
| | | GameWorld.DebugLogEx(" 怒气技能伤害=%s,aAngerSkillPer=%s,dAngerSkillPerDef=%s,angerOverflow=%s,curXP=%s", hurtValue, aAngerSkillPer, dAngerSkillPerDef, angerOverflow, atkObj.GetXP())
|
| | | elif isDot:
|
| | | hurtValue = eval(IpyGameDataPY.GetFuncCompileCfg("DOTFormula", 1))
|
| | | GameWorld.DebugLogEx(" 持续技能伤害=%s" % (hurtValue))
|
| | | GameWorld.DebugLogEx(" 持续技能伤害=%s,aDOTPer=%s,dDOTPerDef=%s", hurtValue, aDOTPer, dDOTPerDef)
|
| | | elif calcType == ChConfig.Def_Calc_ByBuffValue:
|
| | | hurtValue = eval(IpyGameDataPY.GetFuncCompileCfg("CalcTypeFormula", 2))
|
| | | GameWorld.DebugLogEx(" 按最后一次buff值计算伤害=%s,calcType=%s,LastHurt=%s", hurtValue, calcType, aAtk)
|
| | |
| | | buffMgr = defObj.GetBuffManager()
|
| | | for buff in buffMgr.FindBuffListByState(ChConfig.BatObjState_DamBackShield):
|
| | | damBackPer += buff.GetValue1()
|
| | | connSkillTypeID = buff.GetSkillTypeID()
|
| | | damBackPer += TurnPassive.GetTriggerEffectValue(turnFight, defObj, atkObj, ChConfig.PassiveEff_AddDamBackPerByBuffLayer, connSkillTypeID=connSkillTypeID)
|
| | |
|
| | | if damBackPer <= 0:
|
| | | return
|