hch
2018-08-23 08495407cded2639b5de41960b38e4edb0fe0ad0
fix:2818 子 【开发】新增境界压制技能 / 【后端】境界压制技能
3个文件已修改
58 ■■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCAI/AICommon.py 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py
@@ -1580,6 +1580,7 @@
    dMissSuccessRate += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(defObj, atkObj, None, ChConfig.TriggerType_MissSuccessPer)
    skillID = curSkill.GetSkillID() if curSkill else 0
    
    atkIsBoss = 0 # 攻击方是否boss
    suppressValueLV = 0 # 等级最终压制值, 由压制规则及相关参数计算得出,可作为伤害公式计算参数使用
    suppressValueFP = 0 # 战力最终压制值, 由压制规则及相关参数计算得出,可作为伤害公式计算参数使用
@@ -1588,6 +1589,13 @@
    suppressNPCFightPower = 0 # 压制NPC战力
    #当攻击方为NPC,防守方为玩家时,计算压制等级 及 压制战力
    if atkObjType == IPY_GameWorld.gotNPC and defObjType == IPY_GameWorld.gotPlayer:
        if curSkill.GetFuncType() == ChConfig.Def_SkillFuncType_RealmSuppress:
            # 境界压制技能不对高等级境界玩家产生攻击
            aRealmLV, dRealmLV = GetPVERealmLVs(atkObj, defObj, atkObjType, defObjType)
            if aRealmLV >= dRealmLV:
                return 0, ChConfig.Def_HurtType_Immune   # 免疫
        atkIsBoss = 1 if ChConfig.IsGameBoss(atkObj) else 0
        if NPCCommon.GetIsLVSuppress(atkObj):
            suppressLV = max(0, aLV - dLV)
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -744,7 +744,8 @@
Def_HurtType_SuperHit,       # 暴击 7
Def_HurtType_LuckyHit,       # 会心一击伤害 8
Def_HurtType_Miss,           # 闪避 9
) = range(1, 10)
Def_HurtType_Immune,           # 免疫 10
) = range(1, 11)
#Def_HurtType_SuckBlood,      # 吸血 
(
@@ -4857,7 +4858,10 @@
Def_SkillFuncType_PetSkill, #6为宠物技能
Def_SkillFuncType_GWSkill,  #7为神兵技能
Def_SkillFuncType_NormalAttack,  #8为普攻
) = range(9)
Def_SkillFuncType_SP15,  #9为SP15级 服务端未用到
Def_SkillFuncType_SkillRoll,  #10为翻滚    服务端未用到
Def_SkillFuncType_RealmSuppress,  #11为境界压制 目前是NPC在用
) = range(12)
# 受技能效果完全影响的怪, 对应 Def_BattleRelationType_CommNoBoss
Def_SkillAttack_NPCIsBoss = [ Def_NPCType_Ogre_Normal     ,  #平凡小怪 0    # c++ 定义为普通NPC视野刷新
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCAI/AICommon.py
@@ -395,6 +395,44 @@
    
#---------------------------------------------------------------------
def GetCanUseRealmSuppressSkll(curNPC, curSkill):
    if curSkill.GetFuncType() != ChConfig.Def_SkillFuncType_RealmSuppress:
        # 非境界压制技能返回可用
        return True
    # 境界压制技能需判断 周围是否有低境界玩家
    npcRealmLV = NPCCommon.GetRealmLV(curNPC)
    angryManager = curNPC.GetNPCAngry()
    for i in range(0, angryManager.GetAngryCount()) :
        curAngry = angryManager.GetAngryValueTag(i)
        if curAngry == None or curAngry.GetObjID() == 0:
            continue
        #仇恨值
        curAngryValue = curAngry.GetAngryValue()
        if curAngryValue == 0:
            continue
        if curAngry.GetIsDisable():
            continue
        angryID = curAngry.GetObjID()
        angryObjType = curAngry.GetObjType()
        if angryObjType != IPY_GameWorld.gotPlayer:
            continue
        curTag = GameWorld.GetObj(angryID, angryObjType)
        if not curTag:
            continue
        if curTag.GetOfficialRank() < npcRealmLV:
            return True
    return False
##NPC自动释放技能
# @param curNPC NPC实例
# @param curTag 攻击目标
@@ -453,6 +491,10 @@
            if not CheckSkillTrigger(curNPC, triggerDict, index, tick):
                continue
            
        # 境界压制需要根据仇恨列表中的玩家是否有压制
        if not GetCanUseRealmSuppressSkll(curNPC, useSkill):
            continue
        useCnt = curNPC.GetDictByKey(ChConfig.Def_NPC_Dict_SkillUseCnt % useSkill.GetSkillTypeID()) # 该技能已使用次数
        useSkillList.append([useCnt, index, useSkill])