ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py
@@ -487,7 +487,8 @@
#  @remarks 获取攻击类型
def GetBattleType(attack, attackUseSkill):
    # GetHurtType用法改成 pvp pve标识
    return IPY_GameWorld.ghtPhy
    return SkillCommon.GetBattleType(attackUseSkill)
    #return IPY_GameWorld.ghtPhy
#    #---技能攻击, 读表获取攻击类型---
#    if attackUseSkill != None:
#        return attackUseSkill.GetHurtType()
@@ -2121,10 +2122,11 @@
        mustHit = True
        GameWorld.DebugLog("        灵宠必命中")
        petNPCOwner = PetControl.GetPetNPCOwner(atkObj)
    if turnFightTimeline:
        if atkObj.GetDictByKey(ChConfig.Def_Obj_Dict_TurnBattleType) == ChConfig.TurnBattleType_AtkBack:
            mustHit = True
            GameWorld.DebugLog("        反击必命中: atkID=%s,defID=%s" % (atkObj.GetID(), defObj.GetID()))
    #去除反击必命中设定
    #if turnFightTimeline:
    #    if atkObj.GetDictByKey(ChConfig.Def_Obj_Dict_TurnBattleType) == ChConfig.TurnBattleType_AtkBack:
    #        mustHit = True
    #        GameWorld.DebugLog("        反击必命中: atkID=%s,defID=%s" % (atkObj.GetID(), defObj.GetID()))
    if IsHappenStateByType(happenState, ChConfig.Def_Skill_HappenState_HitOn):
        mustHit = True
        GameWorld.DebugLog("        技能必命中: skillID=%s" % skillID)
@@ -2204,7 +2206,9 @@
    # 印记增加的技能伤害,用于飘字
    atkSkillPerYinji = PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_AttackAddSkillPerYinji)
    atkSkillPer += atkSkillPerYinji
    if curSkill and curSkill.GetXP():
        atkSkillPer += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_XPAttackAddSkillPer)
    if hurtType == ChConfig.Def_HurtType_SuperHit:
        # 暴击增加技能伤害
        atkSkillPer += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_SuperHitSkillPer)
@@ -2232,7 +2236,16 @@
        aMinAtk = petNPCOwner.GetMinAtk() * summonAtkPer        # 攻击方最小攻击
        aMaxAtk = petNPCOwner.GetMaxAtk() * summonAtkPer       # 攻击方最大攻击
        #GameWorld.DebugLog("灵宠攻击,直接取主人攻击力: %s ~ %s,  自己: %s ~ %s" % (aMinAtk, aMaxAtk, atkObj.GetMinAtk(), atkObj.GetMaxAtk()))
    enemyObj = None
    aPetStrengthenPer, dPetWeakenPer = 0, 0 # 强化灵兽, 弱化灵兽
    if turnFightTimeline:
        if petNPCOwner:
            aPetStrengthenPer = GameObj.GetPetStrengthenPer(petNPCOwner)
            enemyObj = TurnAttack.GetEnemyObj(petNPCOwner)
            if enemyObj:
                dPetWeakenPer = GameObj.GetPetWeakenPer(enemyObj)
    aIceAtk = atkObj.GetIceAtk()        # 冰攻, 元素真伤, 玩家及NPC通用
    aIceAtk += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_AddIceAtk)
    #------- 防守方
@@ -2367,10 +2380,10 @@
        
    # 回合战斗
    if turnFightTimeline:
        hurtFormulaKey = "TurnFight"
        hurtFormulaKey = "TurnFight_%sV%s_%s" % (atkStateMark, defStateMark, atkType)
        
    if hurtFormulaKey not in hurtDist:
        GameWorld.ErrLog("CalcAttackValue.txt 伤害公式未配置, key=%s" % (hurtFormulaKey))
        GameWorld.ErrLog("CalcAttackValue.txt 伤害公式未配置, key=%s, skillID=%s" % (hurtFormulaKey, skillID))
        return 0, ChConfig.Def_HurtType_Miss
    
    if atkwargs.get('hurtFormulaKey', None):
@@ -2456,8 +2469,9 @@
    CalcBounceHP(atkObj, defObj, resultHurtType.LostHP, resultHurtType.HurtType, curSkill)
    #吸血
    CalcSuckBlood(atkObj, defObj, curSkill, resultHurtType, tick)
    if atkObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
    turnFightTimeline = atkObj.GetDictByKey(ChConfig.Def_Obj_Dict_TurnFightTimeline)
    if atkObj.GetGameObjType() == IPY_GameWorld.gotPlayer or turnFightTimeline:
        # 记录最后一次伤害值
        GameObj.SetLastHurtValue(atkObj, resultHurtType.RealHurtHP)
        if defObj.GetGameObjType() == IPY_GameWorld.gotNPC:
@@ -2531,37 +2545,35 @@
    if not atkObj.GetCanAttack():
        return
    
    if GameObj.GetHP(atkObj) <= 1:
        return
    #只有玩家会反弹
    defObjType = defObj.GetGameObjType()
    if defObjType != IPY_GameWorld.gotPlayer:
        return
    #boss境界压制不反弹
    atkObjType = atkObj.GetGameObjType()
    aRealmLV, dRealmLV = GetPVERealmLVs(atkObj, defObj, atkObjType, defObjType) # 获取境界
    if atkObjType == IPY_GameWorld.gotNPC and ChConfig.IsGameBoss(atkObj) and aRealmLV > dRealmLV:
        aRealmIpyData = IpyGameDataPY.GetIpyGameDataNotLog("Realm", aRealmLV)
        dRealmIpyData = IpyGameDataPY.GetIpyGameDataNotLog("Realm", dRealmLV)
        aRealmLVLarge = aRealmIpyData.GetLvLarge() if aRealmIpyData else 0
        dRealmLVLarge = dRealmIpyData.GetLvLarge() if dRealmIpyData else 0
        if aRealmLVLarge > dRealmLVLarge:
            #GameWorld.DebugLog("boss大境界压制玩家,不反弹: aRealmLV=%s,dRealmLV=%s,aRealmLVLarge=%s,dRealmLVLarge=%s" % (aRealmLV, dRealmLV, aRealmLVLarge, dRealmLVLarge))
            return
    if defObjType == IPY_GameWorld.gotPlayer:
        #boss境界压制不反弹
        atkObjType = atkObj.GetGameObjType()
        aRealmLV, dRealmLV = GetPVERealmLVs(atkObj, defObj, atkObjType, defObjType) # 获取境界
        if atkObjType == IPY_GameWorld.gotNPC and ChConfig.IsGameBoss(atkObj) and aRealmLV > dRealmLV:
            aRealmIpyData = IpyGameDataPY.GetIpyGameDataNotLog("Realm", aRealmLV)
            dRealmIpyData = IpyGameDataPY.GetIpyGameDataNotLog("Realm", dRealmLV)
            aRealmLVLarge = aRealmIpyData.GetLvLarge() if aRealmIpyData else 0
            dRealmLVLarge = dRealmIpyData.GetLvLarge() if dRealmIpyData else 0
            if aRealmLVLarge > dRealmLVLarge:
                #GameWorld.DebugLog("boss大境界压制玩家,不反弹: aRealmLV=%s,dRealmLV=%s,aRealmLVLarge=%s,dRealmLVLarge=%s" % (aRealmLV, dRealmLV, aRealmLVLarge, dRealmLVLarge))
                return
        
    if GameObj.GetHP(atkObj) == 1:
        return
    ##摸怪次数判断
    #if not CheckAttackNPCByCnt(defObj, atkObj, False):
    #    GameWorld.DebugLog("不能攻击,不反弹")
    #    return
    #杀怪次数判断
    if not CheckKillNPCByCnt(defObj, atkObj, False) and not NPCHurtManager.IsAssistPlayer(defObj.GetPlayerID(), atkObj):
        #GameWorld.DebugLog("不能攻击,不反弹")
        return
        ##摸怪次数判断
        #if not CheckAttackNPCByCnt(defObj, atkObj, False):
        #    GameWorld.DebugLog("不能攻击,不反弹")
        #    return
        #杀怪次数判断
        if not CheckKillNPCByCnt(defObj, atkObj, False) and not NPCHurtManager.IsAssistPlayer(defObj.GetPlayerID(), atkObj):
            #GameWorld.DebugLog("不能攻击,不反弹")
            return
    
    #没有反弹退出
    defObj_DamageBackRate = defObj.GetDamageBackRate()
    defObj_DamageBackRate = GameObj.GetDamageBackRate(defObj)
    defObj_DamageBackRate += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(defObj, None, None, ChConfig.TriggerType_BounceHPPer)
    defObj_DamageBackRate += PassiveBuffEffMng.GetValueByPassiveBuffTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_BounceHPPerByAttacker)
    
@@ -2570,6 +2582,9 @@
    bounceHP  = int(bounceHP + PassiveBuffEffMng.GetValueByPassiveBuffTriggerType(defObj, None, None, ChConfig.TriggerType_BounceHP))
    if bounceHP <= 0:
        return
    skillID = curSkill.GetSkillID() if curSkill else 0
    GameWorld.DebugLog("        反弹: defID=%s,atkID=%s,skillID=%s,hurtValue=%s,defObj_DamageBackRate=%s,bounceHP=%s"
                       % (defObj.GetID(), atkObj.GetID(), skillID, hurtValue, defObj_DamageBackRate, bounceHP))
    
    bounceHP = bounceHP if bounceHP < GameObj.GetHP(atkObj) else GameObj.GetHP(atkObj) - 1
    
@@ -2597,7 +2612,7 @@
        if defObjType == IPY_GameWorld.gotPlayer:
            OnPVPDamage(defObj, bounceHP, atkObj, "Player bounce Player") 
        
    ChangeHPView(atkObj, defObj, 0, bounceHP, ChConfig.Def_HurtType_BounceHurt)
    ChangeHPView(atkObj, defObj, skillID, bounceHP, ChConfig.Def_HurtType_BounceHurt)
    return
@@ -2656,12 +2671,12 @@
    suckHPTotal = suckHPByPer + suckHP
    if suckHPTotal <= 0:
        return
    skillID = curSkill.GetSkillID() if curSkill else 0
    GameObj.SetHP(atkObj, min(GameObj.GetMaxHP(atkObj), GameObj.GetHP(atkObj) + suckHPTotal), False)    
    
    ChangeHPView(atkObj, None, 0, suckHPTotal, ChConfig.Def_HurtTYpe_Recovery)
    GameWorld.DebugLog("        吸血: atkID=%s,defID=%s,最终比例=%s(%s-%s),伤血=%s,总吸血=%s(%s+%s),HP=%s"
                       % (atkObj.GetID(), defObj.GetID(), suckHPPerFinal, suckHPPer, suckHPDefPer, hurtValue, suckHPTotal, suckHPByPer, suckHP, GameObj.GetHP(atkObj)))
    ChangeHPView(atkObj, None, skillID, suckHPTotal, ChConfig.Def_HurtTYpe_Recovery)
    GameWorld.DebugLog("        吸血: atkID=%s,defID=%s,最终比例=%s(%s-%s),伤血=%s,总吸血=%s(%s+%s),HP=%s,skillID=%s"
                       % (atkObj.GetID(), defObj.GetID(), suckHPPerFinal, suckHPPer, suckHPDefPer, hurtValue, suckHPTotal, suckHPByPer, suckHP, GameObj.GetHP(atkObj), skillID))
    return
## 攻击者回蓝逻辑