| | |
| | | calcTypeList += [ChConfig.Def_HurtType_LuckyHit, ChConfig.Def_HurtType_SuperHit,
|
| | | ChConfig.Def_HurtType_Zhuxian, ChConfig.Def_HurtType_DeadlyHit,
|
| | | ChConfig.Def_HurtType_ThumpHit]
|
| | | elif atkObjType == IPY_GameWorld.gotNPC:
|
| | | calcTypeList += [ChConfig.Def_HurtType_SuperHit]
|
| | | |
| | | if defObjType == IPY_GameWorld.gotPlayer:
|
| | | calcTypeList += [ChConfig.Def_HurtType_Parry]
|
| | | # 暂时只计算玩家
|
| | | |
| | | if not calcTypeList:
|
| | | return hurtType, hurtTypeResultDict
|
| | |
|
| | |
| | | '''
|
| | |
|
| | | if IsHappenStateByType(happenState, ChConfig.Def_Skill_HappenState_SuperHit):
|
| | | return True, atkObj.GetSuperHit(), PlayerControl.GetSuperHitReduce(defObj)
|
| | | return True, atkObj.GetSuperHit(), GameObj.GetSuperHitReduce(defObj)
|
| | |
|
| | | aSuperHitRate = atkObj.GetSuperHitRate()
|
| | | dSuperHitRateReduce = GameObj.GetSuperHitRateReduce(defObj)
|
| | |
| | | if superHitRate <= 0:
|
| | | return
|
| | | if GameWorld.CanHappen(superHitRate):
|
| | | return True, atkObj.GetSuperHit(), PlayerControl.GetSuperHitReduce(defObj)
|
| | | return True, atkObj.GetSuperHit(), GameObj.GetSuperHitReduce(defObj)
|
| | | return
|
| | |
|
| | | def __HurtTypeHappen_Parry(atkObj, defObj, happenState, curSkill):
|
| | |
| | | def __HurtTypeHappen_ThumpHit(atkObj, defObj, happenState, curSkill):
|
| | |
|
| | | if IsHappenStateByType(happenState, ChConfig.Def_Skill_HappenState_ThumpHit):
|
| | | return True, int(atkObj.GetSuperHit()*1.5), PlayerControl.GetSuperHitReduce(defObj)
|
| | | return True, int(atkObj.GetSuperHit()*1.5), GameObj.GetSuperHitReduce(defObj)
|
| | |
|
| | | thumpHitRate = 0
|
| | | thumpHitRate += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(atkObj, defObj, curSkill,
|
| | |
| | | if thumpHitRate <= 0:
|
| | | return
|
| | | if GameWorld.CanHappen(thumpHitRate):
|
| | | return True, atkObj.GetSuperHit()*2, PlayerControl.GetSuperHitReduce(defObj)
|
| | | return True, atkObj.GetSuperHit()*2, GameObj.GetSuperHitReduce(defObj)
|
| | | return
|
| | |
|
| | |
|
| | |
| | | aLV = atkObj.GetLV() # 攻击方等级
|
| | | dLV = defObj.GetLV() # 防守方等级
|
| | |
|
| | | aHit = atkObj.GetHit()
|
| | | aHit = GameObj.GetMissDefRate(atkObj)#atkObj.GetHit()
|
| | | if curSkill and atkObjType == IPY_GameWorld.gotPlayer and curSkill.GetFuncType() != ChConfig.Def_SkillFuncType_NormalAttack:
|
| | | aHit = aHit*IpyGameDataPY.GetFuncCfg("FightHappenRate", 2)
|
| | |
|
| | | aHitSuccessRate = PlayerControl.GetHitSucessRate(atkObj) if atkObjType == IPY_GameWorld.gotPlayer else ChConfig.Def_MaxRateValue
|
| | | aHitSuccessRate += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_HitSuccess)
|
| | | dMiss = defObj.GetMiss()
|
| | | dMiss = GameObj.GetMissRate(defObj)#defObj.GetMiss()
|
| | | dMiss += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(defObj, atkObj, None, ChConfig.TriggerType_MissPer)
|
| | | dMissSuccessRate = PlayerControl.GetMissSucessRate(defObj) if defObjType == IPY_GameWorld.gotPlayer else 0
|
| | | dMissSuccessRate += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(defObj, atkObj, None, ChConfig.TriggerType_MissSuccessPer)
|
| | |
| | | # @param defObj 防守者
|
| | | # @return None
|
| | | def CalcSuckBlood(atkObj, defObj, curSkill, resultHurtType, tick):
|
| | |
|
| | | if atkObj.GetGameObjType() != IPY_GameWorld.gotPlayer:
|
| | | return
|
| | | |
| | | hurtValue, hurtType = resultHurtType.RealHurtHP, resultHurtType.HurtType,
|
| | | if not hurtValue:
|
| | | return
|
| | |
|
| | | tick = GameWorld.GetGameWorld().GetTick()
|
| | | if tick - atkObj.GetTickByType(ChConfig.TYPE_Player_Tick_SuckBlood) \
|
| | | < ChConfig.TYPE_Player_Tick_Time[ChConfig.TYPE_Player_Tick_SuckBlood]:
|
| | | return
|
| | | |
| | | atkObj.SetTickByType(ChConfig.TYPE_Player_Tick_SuckBlood, tick)
|
| | | |
| | | suckHP = 0
|
| | | |
| | | # 杀怪回血
|
| | | if defObj.GetGameObjType() == IPY_GameWorld.gotNPC and GameObj.GetHP(defObj) <= 0:
|
| | | suckHP += atkObj.GetKillBackHP()
|
| | | |
| | | # 攻击吸血
|
| | | atkBackHP = PlayerControl.GetAtkBackHPPer(atkObj)
|
| | | if defObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | #PVP 攻击回血
|
| | | atkBackHP += PlayerControl.GetPVPAtkBackHP(atkObj)
|
| | | # 百分比吸血
|
| | | atkBackHPPer = PassiveBuffEffMng.GetValueByPassiveBuffTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_Buff_SuckBloodPer)
|
| | | atkBackHPPer += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_Buff_SuckBloodPer)
|
| | | |
| | | |
| | | if hurtType == ChConfig.Def_HurtType_SuperHit:
|
| | | atkBackHPPer += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_SuperHitSuckBloodPer)
|
| | | elif hurtType == ChConfig.Def_HurtType_ThumpHit: |
| | | atkBackHPPer += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_ThumpHitSuckBloodPer)
|
| | |
|
| | | atkBackHP += int(hurtValue * atkBackHPPer*1.0 / ChConfig.Def_MaxRateValue)
|
| | | if atkObj.GetDictByKey(ChConfig.Def_Obj_Dict_TurnFightNum):
|
| | | pass
|
| | | else:
|
| | | tick = GameWorld.GetGameWorld().GetTick()
|
| | | if tick - atkObj.GetTickByType(ChConfig.TYPE_Player_Tick_SuckBlood) \
|
| | | < ChConfig.TYPE_Player_Tick_Time[ChConfig.TYPE_Player_Tick_SuckBlood]:
|
| | | return
|
| | | atkObj.SetTickByType(ChConfig.TYPE_Player_Tick_SuckBlood, tick)
|
| | |
|
| | | suckHP += atkBackHP
|
| | | atkObjType = atkObj.GetGameObjType()
|
| | | defObjType = defObj.GetGameObjType()
|
| | |
|
| | | if suckHP <= 0:
|
| | | suckHP = GameObj.GetAtkBackHP(atkObj) # 攻击回血固定值
|
| | | if atkObjType == IPY_GameWorld.gotPlayer:
|
| | | # 杀怪回血
|
| | | if defObjType == IPY_GameWorld.gotNPC and GameObj.GetHP(defObj) <= 0:
|
| | | suckHP += atkObj.GetKillBackHP()
|
| | | |
| | | #PVP攻击回血
|
| | | if defObjType == IPY_GameWorld.gotPlayer:
|
| | | suckHP += PlayerControl.GetPVPAtkBackHP(atkObj)
|
| | | else:
|
| | | pass
|
| | | |
| | | # 百分比吸血
|
| | | suckHPPer = PassiveBuffEffMng.GetValueByPassiveBuffTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_Buff_SuckBloodPer)
|
| | | suckHPPer += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_Buff_SuckBloodPer)
|
| | | if hurtType == ChConfig.Def_HurtType_SuperHit:
|
| | | suckHPPer += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_SuperHitSuckBloodPer)
|
| | | elif hurtType == ChConfig.Def_HurtType_ThumpHit: |
| | | suckHPPer += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_ThumpHitSuckBloodPer)
|
| | | |
| | | suckHPPer += GameObj.GetSuckHPPer(atkObj)
|
| | | suckHPDefPer = GameObj.GetSuckHPDefPer(defObj)
|
| | | |
| | | suckHPPerFinal = max(0, suckHPPer - suckHPDefPer)
|
| | | suckHPByPer = int(hurtValue * suckHPPerFinal*1.0 / ChConfig.Def_MaxRateValue)
|
| | | |
| | | suckHPTotal = suckHPByPer + suckHP
|
| | | #GameWorld.DebugLog(" 吸血: atkID=%s,suckHPPer=%s,defID=%s,suckHPDefPer=%s,suckHPPerFinal=%s,suckHPByPer=%s,hurtValue=%s,suckHP=%s" |
| | | # % (atkObj.GetID(), suckHPPer, defObj.GetID(), suckHPDefPer, suckHPPerFinal, suckHPByPer, hurtValue, suckHP))
|
| | | if suckHPTotal <= 0:
|
| | | return
|
| | |
|
| | | GameObj.SetHP(atkObj, min(GameObj.GetMaxHP(atkObj), GameObj.GetHP(atkObj) + suckHP), False)
|
| | | GameObj.SetHP(atkObj, min(GameObj.GetMaxHP(atkObj), GameObj.GetHP(atkObj) + suckHPTotal), False)
|
| | |
|
| | | ChangeHPView(atkObj, None, 0, suckHP, ChConfig.Def_HurtTYpe_Recovery)
|
| | | ChangeHPView(atkObj, None, 0, suckHPTotal, ChConfig.Def_HurtTYpe_Recovery)
|
| | | return
|
| | |
|
| | | ## 攻击者回蓝逻辑
|