hxp
2019-12-17 4226d0d2ec4cf5541a17d9a6cdbf1a32a011d052
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuffEffMng.py
@@ -40,6 +40,7 @@
import NPCCommon
import PetControl
import QuestCommon
import ItemCommon
GameWorld.ImportAll("Script\\Skill\\", "PassiveBuff")
@@ -290,6 +291,8 @@
def GetTriggerTypeByEffectID(effectID):
    # 临时配置
    tdict = {
             1304:ChConfig.TriggerType_HitValue,    # 命中记录 89
             2102:ChConfig.TriggerType_BeAttackOver,   # 被攻击后触发 20
             2104:ChConfig.TriggerType_LockHP, # 锁血触发技能 63
             2105:ChConfig.TriggerType_BeLuckyHit, # 被会心一击触发技能 64
@@ -403,6 +406,7 @@
             4107:ChConfig.TriggerType_SkillValue,   # 增加技能伤害固定值 82
             4108:ChConfig.TriggerType_SkillSuccess,  # 使用技能成功后不触发技能 处理消耗等问题用 87
             4109:ChConfig.TriggerType_SkillValue,   # 增加技能伤害固定值 82
             4110:ChConfig.TriggerType_ChangeSkillEff, # 改变技能特效
             }
    return tdict.get(effectID, -1) 
    #===========================================================================
@@ -451,7 +455,7 @@
             4529:ChConfig.TriggerType_Buff_SuckBloodPer,   # BUFF类: 百分比吸血, 此处非属性类
             4530:ChConfig.TriggerType_Buff_AttackSubLayer,  # BUFF类:攻击减buff层,0消失
             4531:ChConfig.TriggerType_BounceHPPerByAttacker,  # 反弹伤害百分比值, 由攻击方决定 77
             4532:ChConfig.TriggerType_SuperHit,    # buff中对第一目标暴击触发技能
             4532:ChConfig.TriggerType_AttackOver,    # BUFF类:攻击触发新技能
             4533:ChConfig.TriggerType_BurnDisappear, # 灼烧消失触发 81
             4534:ChConfig.TriggerType_DebuffOff,   # BUFF类: 抵消debuff
             4535:ChConfig.TriggerType_BeAttackAddSkillPer, # buff中, 被攻击提高技能伤害
@@ -603,8 +607,8 @@
                    self.AffectSuperEquipSkillDict[key] = []
                    
                self.AffectSuperEquipSkillDict[key].append((skillTypeID, effectID))
                # 效果叠加根据技能个数会衰减 = 1-pow((1-初始值),相同技能个数)
                self.AffectSuperEquipEffectCntDict[effectID] = 1 - pow((1 - curEffect.GetEffectValue(0)),value)
                # 效果叠加根据技能个数会衰减 = 1-pow((1-初始值/10000.0),相同技能个数)*10000
                self.AffectSuperEquipEffectCntDict[effectID] = int((1 - pow((1 - curEffect.GetEffectValue(0)/10000.0),value))*10000)
        
        GameWorld.DebugLog("RefreshSuperEquipSkillDict %s-%s"%(self.AffectSuperEquipSkillDict, self.AffectSuperEquipEffectCntDict))
        
@@ -1413,11 +1417,8 @@
    if not AttackCommon.CheckBattleRelationType(skillBattleType, battleRelationType):
        return
    tagSkillID = tagSkill.GetSkillID() if tagSkill else 0
    
    for skillID, effectList in buffDict.items():
        if tagSkillID == skillID:
            continue
        
        curSkill = GameWorld.GetGameData().GetSkillBySkillID(skillID)
        if not curSkill:
@@ -1534,13 +1535,13 @@
# buff 影响的(攻击)行为值
# 返回数值
def GetValueByPassiveBuffTriggerType(attacker, defender, useSkill, triggerType):
def GetValueByPassiveBuffTriggerType(attacker, defender, useSkill, triggerType, isStopPassiveSkill=True):
    attacker = FindRealAttacker(attacker)
    if not attacker:
        return 0
    
    stopPassiveSkill = False   # 被动技能不能再触发被动技能,但可以触发天赋技能
    if useSkill and SkillCommon.isPassiveSkill(useSkill):
    if useSkill and SkillCommon.isPassiveSkill(useSkill) and isStopPassiveSkill:
        #GameWorld.DebugLog("被动技能不能再次触发被动技能")
        #return 0
        if not PassPassiveLimit(useSkill):
@@ -1683,12 +1684,9 @@
            #无技能
            continue
        
        for j in xrange(curEquip.GetAddSkillCount()):
            skillID = curEquip.GetAddSkill(j)
            if skillID == 0:
                break
            skillsDict[skillID] = skillsDict.get(skillID, 0) + 1
        itemSkillIDList = ItemCommon.GetItemSkillIDList(curEquip)
        for skillID in itemSkillIDList:
            skillsDict[skillID] = skillsDict.get(skillID, 0) + 1
            
    return skillsDict
@@ -1696,12 +1694,53 @@
# 但也有一些特殊情况 放在此处过滤
def PassPassiveLimit(useSkill):
    # 如灼烧是被动技能 但可以被不断的强化
    if useSkill.GetSkillType() != ChConfig.Def_SkillType_PassiveLstDepBuff:
        return False
    if useSkill.GetSkillType() == ChConfig.Def_SkillType_PassiveLstDepBuff:
        return True
    
    if useSkill.GetFuncType() == ChConfig.Def_SkillFuncType_PassiveSkillWithSP:
        # 有专精的被动技能,可以再次触发被动效果
        return False
    return True
        return True
    return False
# 被动技能改变值  无条件限制 纯取值
def GetPassiveSkillValueByTriggerTypeEx(attacker, defender, connSkill, triggerType):
    attacker = FindRealAttacker(attacker)
    if not attacker:
        return 0
    passiveEff = GetPassiveEffManager().GetPassiveEff(attacker)
    if not passiveEff:
        return 0
    connSkillID = connSkill.GetSkillTypeID() if connSkill else 0
    skills = passiveEff.GetPassiveSkillsByTriggerType(triggerType, connSkill)
    if not skills:
        return 0
    curValue = 0
    for skillTypeID, effectID in skills:
        if connSkillID == skillTypeID:
            continue
        curSkill = attacker.GetSkillManager().FindSkillBySkillTypeID(skillTypeID)
        if not curSkill:
            continue
        effect = SkillCommon.GetSkillEffectByEffectID(curSkill, effectID)
        if not effect:
            continue
        pyName = "PassiveSkill_%s" % effectID
        callFunc = GameWorld.GetExecFunc(PassiveBuff, "%s.%s" % (pyName, "CheckCanHappen"))
        # 条件不满足
        if callFunc and not callFunc(attacker, defender, effect, curSkill):
            continue
        callFunc = GameWorld.GetExecFunc(PassiveBuff, "%s.%s" % (pyName, "GetValue"))
        if callFunc is None:
            continue
        curValue += callFunc(attacker, defender, effect, skillTypeID)
    return curValue