| | |
| | |
|
| | | GameWorld.ImportAll("Script\\Skill\\", "PassiveBuff")
|
| | |
|
| | | # 被动关联的技能模块
|
| | | # 获得关联技能,0 全部 1是主动型技能(法宝,普攻) 2 为人族法宝技能 3为普攻 其他技能ID
|
| | | Def_ConnSkill_Template = {
|
| | | ChConfig.Def_SkillFuncType_FbSkill:[1,2],
|
| | | ChConfig.Def_SkillFuncType_NormalAttack:[1,3],
|
| | | }
|
| | |
|
| | | Def_PassiveSkillValueNoCD = [52000, 57000] # 特殊处理部分技能增强触发不受CD影响 |
| | |
|
| | |
|
| | | # --------被动功法设置--------------------------------------------------------------------
|
| | |
| | | ChConfig.Def_PDictType_GFPassive)
|
| | | if findSkillID == 0:
|
| | | continue
|
| | | |
| | | passiveEff = GetPassiveEffManager().GetPassiveEff(curPlayer)
|
| | | if passiveEff:
|
| | | findSkillID = passiveEff.ChangeSkillTypeID(findSkillID)
|
| | | |
| | | skills.append(findSkillID)
|
| | |
|
| | | return skills
|
| | |
| | | def GetTriggerTypeByEffectID(effectID):
|
| | | # 临时配置
|
| | | tdict = {
|
| | | 1304:ChConfig.TriggerType_HitValue, # 命中记录 89
|
| | | |
| | | 2102:ChConfig.TriggerType_BeAttackOver, # 被攻击后触发 20
|
| | | 2104:ChConfig.TriggerType_LockHP, # 锁血触发技能 63
|
| | | 2105:ChConfig.TriggerType_BeLuckyHit, # 被会心一击触发技能 64
|
| | |
| | |
|
| | | 4000:ChConfig.TriggerType_BuffState, # 进入4012的某个状态触发技能 2
|
| | | 4001:ChConfig.TriggerType_TagBuffState, # 目标进入4012的某个状态触发技能 2
|
| | | 4002:ChConfig.TriggerType_AddDamagePer, # 提高增加伤害属性值,计算时 3
|
| | | 4003:ChConfig.TriggerType_AddDamagePer, # 提高增加伤害属性值,计算时 3
|
| | | 4002:ChConfig.TriggerType_SkillValue, # 增加技能伤害固定值 82
|
| | | 4003:ChConfig.TriggerType_AttackOver, # 攻击(对敌技能)后被动技能被触发 4
|
| | | 4004:ChConfig.TriggerType_AttackOver, # 攻击(对敌技能)后被动技能被触发 4
|
| | | 4005:ChConfig.TriggerType_AttackAddSkillPer, # 所有攻击伤害(SkillPer)增加,含普攻,计算时 5
|
| | | 4006:ChConfig.TriggerType_SuperHit, # 暴击时 触发技能6,
|
| | | 4007:ChConfig.TriggerType_SuperHitValue, # 暴击时 增加暴击值百分比7,
|
| | | 4007:ChConfig.TriggerType_SuperHitPer, # 暴击时 增加暴击值百分比,
|
| | | 4008:ChConfig.TriggerType_AttackAddSkillPer, # 所有攻击伤害(SkillPer)增加,含普攻,计算时 5
|
| | | 4009:ChConfig.TriggerType_HurtObjAddBuff, # 击中玩家(群攻多次触发)8,
|
| | | 4010:ChConfig.TriggerType_ReduceCD, # 减少CD9, #CD
|
| | |
| | | 4027:ChConfig.TriggerType_AttackKill, # նɱ 24
|
| | | 4028:ChConfig.TriggerType_WillDead, # 进入濒死状态时触发技能 25
|
| | | 4029:ChConfig.TriggerType_BuffBoom, # 中毒后爆炸 26
|
| | | 4030:ChConfig.TriggerType_Success_Buff_SkillPer, # 提高4501成功概率 27
|
| | | 4030:ChConfig.TriggerType_ThumpSkillValue, # 重击增加技能固定值伤害 88
|
| | | 4031:ChConfig.TriggerType_HurtObjAddBuff, # 在算伤害时群攻1对1加buff,可用于一个伤害多次触发 28
|
| | | 4032:ChConfig.TriggerType_BeBoomSeed, # 被动引爆视野内对象的buff种子 29
|
| | | 4033:ChConfig.TriggerType_AttackOver, # 攻击(对敌技能)后被动技能被触发 4
|
| | |
| | | 4063:ChConfig.TriggerType_SummonDie, #自身召唤兽死亡触发技能 60
|
| | | 4064:ChConfig.TriggerType_GiftReduceCD, # 天赋减少CD9, #CD
|
| | | 4065:ChConfig.TriggerType_DamageReducePVP, # PVP减少伤害
|
| | | 4066:ChConfig.TriggerType_AddDamagePer, # 提高增加伤害属性值,计算时 3
|
| | | 4066:ChConfig.TriggerType_AddPVPDamagePer, # 提高PVP增加伤害属性值,计算时 3
|
| | | 4067:ChConfig.TriggerType_ProDefValue, # 神兵护盾值下降时 62
|
| | | 4068:ChConfig.TriggerType_LockHP, # 锁血触发技能 63
|
| | | 4069:ChConfig.TriggerType_ZhongjiZhansha, # 终极斩杀 64
|
| | |
| | | 4071:ChConfig.TriggerType_Buff_SuckBloodPer, # 攻击 百分比吸血
|
| | | 4072:ChConfig.TriggerType_SuperHitSkipCD, # 暴击无冷却 68
|
| | | 4073:ChConfig.TriggerType_BuffHurtCnt, # 当持续buff伤害第X次时触发技能 69
|
| | | 4074:ChConfig.TriggerType_AttackAddSkillPer, # 所有攻击伤害(SkillPer)增加,含普攻,计算时 5
|
| | | 4075:ChConfig.TriggerType_AddThumpHitPer, # 增加重击伤害百分比
|
| | | 4076:ChConfig.TriggerType_dFinalHurtReducePer, # 防守方的最终伤害减少百分比 71
|
| | | 4077:ChConfig.TriggerType_AttackAddFinalPer, # 增加最终伤害百分比 59
|
| | | 4078:ChConfig.TriggerType_AttackOver, # 攻击(对敌技能)后被动技能被触发 4
|
| | |
| | | 4083:ChConfig.TriggerType_AddThumpHitPer, # 增加重击伤害百分比
|
| | | 4084:ChConfig.TriggerType_ThumpHit, # 对第一目标重击触发技能
|
| | | 4085:ChConfig.TriggerType_SkillSuccess, # 任何技能释放成功都可触发 76 加印记
|
| | | 4086:ChConfig.TriggerType_AttackAddSkillPer, # 所有攻击伤害(SkillPer)增加,含普攻,计算时 5
|
| | | 4087:ChConfig.TriggerType_AttackAddSkillPer, # 所有攻击伤害(SkillPer)增加,含普攻,计算时 5
|
| | | 4088:ChConfig.TriggerType_AttackAddSkillPer, # 所有攻击伤害(SkillPer)增加,含普攻,计算时 5
|
| | | 4089:ChConfig.TriggerType_AttackAddSkillPer, # 所有攻击伤害(SkillPer)增加,含普攻,计算时 5
|
| | | 4086:ChConfig.TriggerType_AttackAddSkillPerYinji, # 所有攻击伤害(SkillPer)增加,含普攻,计算时 为了飘字使用
|
| | | 4087:ChConfig.TriggerType_AttackAddSkillPerYinji, # 所有攻击伤害(SkillPer)增加,含普攻,计算时 为了飘字使用
|
| | | 4088:ChConfig.TriggerType_AttackAddSkillPerYinji, # 所有攻击伤害(SkillPer)增加,含普攻,计算时 为了飘字使用
|
| | | 4089:ChConfig.TriggerType_AttackAddSkillPerYinji, # 所有攻击伤害(SkillPer)增加,含普攻,计算时 为了飘字使用
|
| | | 4090:ChConfig.TriggerType_AttackOver, # 攻击(对敌技能)后被动技能被触发 4
|
| | | 4091:ChConfig.TriggerType_SkillOverNoAttack, # 技能释放后 与TriggerType_AttackOver相反19,
|
| | | 4092:ChConfig.TriggerType_SkillSuccess, # 任何技能释放成功都可触发 76 减印记
|
| | | 4092:ChConfig.TriggerType_SkillSuccessExpend, # 任何技能释放成功都可触发 76 减印记
|
| | | 4093:ChConfig.TriggerType_NoControl, # 使关联技能不受控制 78
|
| | | 4094:ChConfig.TriggerType_Buff_AddSuperHitRate, # BUFF类:增加暴击率
|
| | | 4095:ChConfig.TriggerType_SuperHitSuckBloodPer, # BUFF类: 暴击百分比吸血, 79
|
| | | 4096:ChConfig.TriggerType_AttackAddSkillPer, # 所有攻击伤害(SkillPer)增加,含普攻,计算时 5
|
| | | 4097:ChConfig.TriggerType_BurnPer, # 灼烧伤害百分比 80
|
| | | 4098:ChConfig.TriggerType_AttackAddSkillPer, # 所有攻击伤害(SkillPer)增加,含普攻,计算时 5
|
| | | 4099:ChConfig.TriggerType_WillDead, # 进入濒死状态时触发技能 25
|
| | | 4100:ChConfig.TriggerType_AttackOver, # 攻击(对敌技能)后被动技能被触发 4
|
| | | 4101:ChConfig.TriggerType_AttackAddSkillPer, # 所有攻击伤害(SkillPer)增加,含普攻,计算时 5
|
| | | 4102:ChConfig.TriggerType_SkillValue, # 增加技能伤害固定值 82
|
| | | 4103:ChConfig.TriggerType_ThumpHitSuckBloodPer, # 攻击 百分比吸血
|
| | | 4104:ChConfig.TriggerType_HitSuccess, # 命中成功率 83
|
| | | 4106:ChConfig.TriggerType_AddHP, # 技能回血 84
|
| | | 4107:ChConfig.TriggerType_SkillValue, # 增加技能伤害固定值 82
|
| | | 4108:ChConfig.TriggerType_SkillSuccess, # 使用技能成功后不触发技能 处理消耗等问题用 87
|
| | | 4109:ChConfig.TriggerType_SkillValue, # 增加技能伤害固定值 82
|
| | | 4110:ChConfig.TriggerType_ChangeSkillEff, # 改变技能特效
|
| | | }
|
| | | return tdict.get(effectID, -1)
|
| | | #===========================================================================
|
| | |
| | | 4500:ChConfig.TriggerType_AttackOver, # BUFF类:攻击触发新技能
|
| | | 4501:ChConfig.TriggerType_AttackAddSkillPer, # BUFF类:提高主动技能的技能伤害
|
| | | 4502:ChConfig.TriggerType_BeAttackOver, # BUFF类:被攻击触发技能
|
| | | 4503:ChConfig.TriggerType_AddDamagePer, # BUFF类: 攻击时提高增加伤害
|
| | | 4503:ChConfig.TriggerType_AttackOver, # BUFF类:攻击触发新技能
|
| | | 4504:ChConfig.TriggerType_BounceHP, # BUFF类: 反弹伤害固定值
|
| | | 4505:ChConfig.TriggerType_AttackAddSkillPer, # BUFF类:提高主动技能的技能伤害
|
| | | 4506:ChConfig.TriggerType_BeAttackOver, # BUFF类:被攻击触发技能 只刷新属性 不触发技能
|
| | | 4507:ChConfig.TriggerType_Buff_AddSuperHitRate, # BUFF类:增加暴击率
|
| | | 4508:ChConfig.TriggerType_Buff_AttackSubLayer, # BUFF类:攻击减buff层,0消失
|
| | |
| | | 4524:ChConfig.TriggerType_SuperHitSubLayer, # 暴击减层 67
|
| | | 4525:ChConfig.TriggerType_SuperHitSkipCD, # 暴击无冷却 68
|
| | | 4526:ChConfig.TriggerType_AddThumpHitRate, # 增加重击概率
|
| | | 4527:ChConfig.TriggerType_AddThumpHitRate, # 增加重击概率
|
| | | 4528:ChConfig.TriggerType_AddThumpHitPer, # 重击时 增加重击百分比 75
|
| | | 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中, 被攻击提高技能伤害
|
| | | 4536:ChConfig.TriggerType_AddBuffOver, |
| | | 4537:ChConfig.TriggerType_BurnPer, # 灼烧伤害百分比 80
|
| | | 4538:ChConfig.TriggerType_SkillValue, # 增加技能伤害固定值 82
|
| | | 4539:ChConfig.TriggerType_SkillValue, # 增加技能伤害固定值 82
|
| | | 4540:ChConfig.TriggerType_SuperHitPer, # 暴击伤害百分比
|
| | | 4541:ChConfig.TriggerType_AttackAddSkillPer, # BUFF类:提高主动技能的技能伤害
|
| | |
|
| | | 803:ChConfig.TriggerType_BloodShield, # 血盾
|
| | | 806:ChConfig.TriggerType_BloodShield, # 血盾
|
| | |
| | | self.AffectSuperEquipSkillDict = {} # 特殊装备持有技能,相同技能不重复,数值增长性衰减, 触发使用
|
| | | self.AffectSuperEquipEffectCntDict = {} # 特殊装备技能效果对应的已计算后的数值,直接调用
|
| | |
|
| | | self.ChangeSkill = {} # 改变释放的技能ID,方便处理特效动作表现等问题 {原SkillTypeID: 改变后的SkillTypeID}
|
| | | self.IsChangeSkill = False # 当前是否刷新技能替换
|
| | | |
| | | #记录会影响其他技能或者被动触发释放技能的BUFF
|
| | | def AddBuffInfoByEffect(self, effect, skillID):
|
| | | def AddBuffInfoByEffect(self, effect, skillID, onwerID, onwerType):
|
| | | effectID = effect.GetEffectID()
|
| | |
|
| | | #{(触发方式/点, 关联技能):{BUFFID:【效果】}}
|
| | |
| | |
|
| | | if skillID not in self.AffectBuffDict[keyTuple]:
|
| | | self.AffectBuffDict[keyTuple][skillID] = []
|
| | | self.AffectBuffDict[keyTuple][skillID].append(effect) # 存储受影响的信息
|
| | | self.AffectBuffDict[keyTuple][skillID].append([effect, onwerID, onwerType]) # 存储受影响的信息
|
| | | return
|
| | |
|
| | |
|
| | |
| | |
|
| | | return self.AffectPassiveSkillSetDict
|
| | |
|
| | | # 改变技能ID的处理, 先存储释放的时候替换, 并且不登记到被动触发
|
| | | def ChangeSkillTypeIDDict(self, curSkill):
|
| | | hasEffect = SkillCommon.GetSkillEffectByEffectID(curSkill, ChConfig.Def_Skill_Effect_ChangeSkillTypeID)
|
| | | if not hasEffect:
|
| | | return
|
| | | changeSkillID = 0
|
| | | |
| | | #找到对应法宝技能
|
| | | upIpyData = IpyGameDataPY.GetIpyGameData('TreasureUp', hasEffect.GetEffectValue(0), 1)
|
| | | if not upIpyData:
|
| | | return
|
| | | skillIDList = upIpyData.GetUnLockSkill()
|
| | | for skillID in skillIDList:
|
| | | skillData = GameWorld.GetGameData().FindSkillByType(skillID, 1)
|
| | | if not skillData:
|
| | | continue
|
| | | if not SkillCommon.CheckSkillJob(self.gameObj, skillData):
|
| | | continue
|
| | | changeSkillID = skillID
|
| | | break
|
| | | |
| | | if changeSkillID == 0:
|
| | | return
|
| | | |
| | | self.ChangeSkill[changeSkillID] = curSkill.GetSkillTypeID()
|
| | | |
| | | self.IsChangeSkill = True
|
| | | GameWorld.DebugLog("self.ChangeSkill --- %s"%self.ChangeSkill)
|
| | | return True
|
| | | |
| | | # 真实替换技能ID
|
| | | def ChangeSkillTypeID(self, skillID):
|
| | | return self.ChangeSkill.get(skillID, skillID)
|
| | | |
| | |
|
| | | # 重刷被动型技能(含sp,天赋,不含被动技能功能)存储
|
| | | def RefreshPassiveSkill(self):
|
| | | self.AffectSkillDict = {}
|
| | | self.ChangeSkill = {}
|
| | | skillManager = self.gameObj.GetSkillManager()
|
| | | for i in range(0 , skillManager.GetSkillCount()):
|
| | | curSkill = skillManager.GetSkillByIndex(i)
|
| | |
| | | if curSkill.GetFuncType() in [ChConfig.Def_SkillFuncType_FbPassiveSkill,
|
| | | ChConfig.Def_SkillFuncType_Dogz]:
|
| | | # 被动技能和神兽需设置才有效
|
| | | continue
|
| | | |
| | | # 改变技能ID的处理
|
| | | if self.ChangeSkillTypeIDDict(curSkill):
|
| | | continue
|
| | |
|
| | | skillTypeID = curSkill.GetSkillTypeID()
|
| | |
| | | skillList.extend(self.AffectSuperEquipSkillDict.get((triggerType, connSkillID), []))
|
| | |
|
| | | # 指定特殊类型可触发
|
| | | # 获得关联技能,0 全部 1是主动型技能(法宝,普攻) 2 为人族法宝技能 3为普攻 其他技能ID
|
| | | if connSkill and connSkill.GetFuncType() in [ChConfig.Def_SkillFuncType_FbSkill, ChConfig.Def_SkillFuncType_NormalAttack]:
|
| | | funcType = connSkill.GetFuncType()
|
| | | skillList.extend(self.AffectSkillDict.get((triggerType, funcType), []))
|
| | | skillList.extend(self.AffectPassiveSkillSetDict.get((triggerType, funcType), []))
|
| | | skillList.extend(self.AffectDogzSkillDict.get((triggerType, funcType), []))
|
| | | skillList.extend(self.AffectSuperEquipSkillDict.get((triggerType, funcType), []))
|
| | | funcTypeList = Def_ConnSkill_Template.get(connSkill.GetFuncType(), [])
|
| | | for funcType in funcTypeList:
|
| | | skillList.extend(self.AffectSkillDict.get((triggerType, funcType), []))
|
| | | skillList.extend(self.AffectPassiveSkillSetDict.get((triggerType, funcType), []))
|
| | | skillList.extend(self.AffectDogzSkillDict.get((triggerType, funcType), []))
|
| | | skillList.extend(self.AffectSuperEquipSkillDict.get((triggerType, funcType), []))
|
| | |
|
| | | # 被动再触发被动限制为指定
|
| | | if connSkill and SkillCommon.isPassiveSkill(connSkill):
|
| | | if connSkill and SkillCommon.isPassiveSkill(connSkill) and not PassPassiveLimit(connSkill):
|
| | | return skillList
|
| | |
|
| | | if connSkillID != 0 and connSkillID != ChConfig.Def_SkillID_Somersault:
|
| | |
| | | return
|
| | | self.AddPassiveEff(gameObj, passiveEff)
|
| | | elif skillID:
|
| | | curSkill = GameWorld.GetGameData().GetSkillBySkillID(skillID)
|
| | | if curSkill and passiveEff.ChangeSkillTypeIDDict(curSkill):
|
| | | # 替换技能不添加
|
| | | return
|
| | | |
| | | # 单个添加被动技能
|
| | | passiveEff.AddPassiveSkill(skillID)
|
| | |
|
| | | |
| | | if passiveEff.IsChangeSkill:
|
| | | GameWorld.DebugLog("刷被动----")
|
| | | # 存在替换技能 目前需要刷新镶嵌的被动技能,存在多刷现象
|
| | | self.RegistPassiveEffSet(gameObj)
|
| | | passiveEff.IsChangeSkill = False
|
| | | return True
|
| | | return
|
| | |
|
| | | # 人物需同步注册被动技能
|
| | |
| | | buffSkill = curBuff.GetSkill()
|
| | | if not buffSkill:
|
| | | continue
|
| | | |
| | | onwerID, onwerType = curBuff.GetOwnerID(), curBuff.GetOwnerType()
|
| | | for effectIndex in range(0, buffSkill.GetEffectCount()):
|
| | | curEffect = buffSkill.GetEffect(effectIndex)
|
| | | effectID = curEffect.GetEffectID()
|
| | |
| | | if triggerType == -1:
|
| | | continue
|
| | | passiveEff = self.InitObjPassiveEff(gameObj)
|
| | | passiveEff.AddBuffInfoByEffect(curEffect, buffSkill.GetSkillID())
|
| | | passiveEff.AddBuffInfoByEffect(curEffect, buffSkill.GetSkillID(), onwerID, onwerType)
|
| | |
|
| | | return
|
| | |
|
| | |
| | | if not connSkill.GetFuncType():
|
| | | # 非功能类技能,避免死循环
|
| | | return 0, 0
|
| | | if SkillCommon.isPassiveSkill(connSkill):
|
| | | if SkillCommon.isPassiveSkill(connSkill) and not PassPassiveLimit(connSkill):
|
| | | stopPassiveSkill = True
|
| | |
|
| | | if SkillCommon.GetUsingPassiveSkill(attacker) and triggerType != ChConfig.TriggerType_BuffState:
|
| | |
| | | if connSkill and SkillCommon.isPassiveSkill(connSkill):
|
| | | #GameWorld.DebugLog("被动技能不能再次触发被动技能")
|
| | | #return 0
|
| | | stopPassiveSkill = True
|
| | | if not PassPassiveLimit(connSkill):
|
| | | stopPassiveSkill = True
|
| | |
|
| | | passiveEff = GetPassiveEffManager().GetPassiveEff(attacker)
|
| | | if not passiveEff:
|
| | |
| | | # 只有天赋才可以再次被触发
|
| | | continue
|
| | |
|
| | | if curSkill.GetCoolDownTime() and SkillCommon.RefreshSkillRemainTime(curSkill, tick):
|
| | | #有配置CD的才判断
|
| | | continue
|
| | | if skillTypeID not in Def_PassiveSkillValueNoCD:
|
| | | # 特殊技能不走CD处理
|
| | | if curSkill.GetCoolDownTime() and SkillCommon.RefreshSkillRemainTime(curSkill, tick):
|
| | | #有配置CD的才判断
|
| | | continue
|
| | |
|
| | | effect = SkillCommon.GetSkillEffectByEffectID(curSkill, effectID)
|
| | | if not effect:
|
| | |
| | | continue
|
| | |
|
| | | curValue += callFunc(attacker, defender, effect)
|
| | | if curSkill.GetCoolDownTime():
|
| | | SkillCommon.SetSkillRemainTime(curSkill, 0, tick, attacker)
|
| | | if skillTypeID not in Def_PassiveSkillValueNoCD:
|
| | | if curSkill.GetCoolDownTime():
|
| | | SkillCommon.SetSkillRemainTime(curSkill, 0, tick, attacker)
|
| | |
|
| | | return curValue
|
| | |
|
| | |
| | | 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:
|
| | |
| | |
|
| | | if not IsValidPassiveSkill(curSkill):
|
| | | continue
|
| | | for passiveEffect in effectList:
|
| | | for effectInfo in effectList:
|
| | | passiveEffect = effectInfo[0]
|
| | | # 被动触发的技能
|
| | | pyName = "PassiveBuff_%s"%passiveEffect.GetEffectID()
|
| | |
|
| | |
| | | if not callFunc:
|
| | | continue
|
| | |
|
| | | if not callFunc(attacker, defender, passiveEffect, tagSkill):
|
| | | if not callFunc(attacker, defender, passiveEffect, tagSkill, ownerID=effectInfo[1], ownerType=effectInfo[2]):
|
| | | continue
|
| | |
|
| | | callFunc = GameWorld.GetExecFunc(PassiveBuff, "%s.%s" % (pyName, "DoLogic"))
|
| | |
| | | if not useSkill.GetFuncType():
|
| | | # 非功能类技能,避免死循环
|
| | | return
|
| | | if SkillCommon.isPassiveSkill(useSkill):
|
| | | if SkillCommon.isPassiveSkill(useSkill) and not PassPassiveLimit(useSkill):
|
| | | #GameWorld.DebugLog("被动技能不能再次触发被动技能")
|
| | | #return
|
| | | stopPassiveSkill = True
|
| | |
| | |
|
| | | if not IsValidPassiveSkill(curSkill):
|
| | | continue
|
| | | for passiveEffect in effectList:
|
| | | for effectInfo in effectList:
|
| | | passiveEffect = effectInfo[0]
|
| | | # 被动触发的技能
|
| | | pyName = "PassiveBuff_%s"%passiveEffect.GetEffectID()
|
| | | callFunc = GameWorld.GetExecFunc(PassiveBuff, "%s.%s" % (pyName, "CheckCanHappen"))
|
| | | if not callFunc:
|
| | | continue
|
| | |
|
| | | if not callFunc(attacker, defender, passiveEffect, skillID, useSkill=useSkill):
|
| | | if not callFunc(attacker, defender, passiveEffect, skillID, useSkill=useSkill, ownerID=effectInfo[1], ownerType=effectInfo[2]):
|
| | | continue
|
| | |
|
| | | callFunc = GameWorld.GetExecFunc(PassiveBuff, "%s.%s" % (pyName, "GetSkillData"))
|
| | |
| | |
|
| | | # 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
|
| | | stopPassiveSkill = True
|
| | | if not PassPassiveLimit(useSkill):
|
| | | stopPassiveSkill = True
|
| | |
|
| | |
|
| | | passiveEff = GetPassiveEffManager().GetPassiveEff(attacker)
|
| | |
| | | if not IsValidPassiveSkill(curSkill):
|
| | | continue
|
| | |
|
| | | for passiveEffect in effectList:
|
| | | for effectInfo in effectList:
|
| | | if stopPassiveSkill and curSkill.GetFuncType() != ChConfig.Def_SkillFuncType_GiftSkill:
|
| | | # 只有天赋才可以再次被触发
|
| | | continue
|
| | | |
| | | passiveEffect = effectInfo[0]
|
| | | # 被动触发的技能
|
| | | pyName = "PassiveBuff_%s"%passiveEffect.GetEffectID()
|
| | |
|
| | |
| | | continue
|
| | |
|
| | | # 条件不满足
|
| | | if not callFunc(attacker, defender, passiveEffect, skillID, useSkill=useSkill):
|
| | | if not callFunc(attacker, defender, passiveEffect, skillID, useSkill=useSkill, ownerID=effectInfo[1], ownerType=effectInfo[2]):
|
| | | continue
|
| | |
|
| | | callFunc = GameWorld.GetExecFunc(PassiveBuff, "%s.%s" % (pyName, "GetValue"))
|
| | |
| | | continue
|
| | |
|
| | | # 如被动技能:千幻冥炎真实伤害从2变4倍
|
| | | curValue += GetPassiveSkillValueByTriggerType(attacker, defender, curSkill, ChConfig.TriggerType_PassiveBuffValue)
|
| | | #curValue += GetPassiveSkillValueByTriggerType(attacker, defender, curSkill, ChConfig.TriggerType_PassiveBuffValue)
|
| | | curValue += callFunc(attacker, defender, passiveEffect)
|
| | |
|
| | | return curValue
|
| | |
| | | skillsDict[skillID] = skillsDict.get(skillID, 0) + 1
|
| | |
|
| | | return skillsDict
|
| | |
|
| | | # 默认情况下 被动不应该再触发(或加强)被动技能,会造成额外触发或者死循环
|
| | | # 但也有一些特殊情况 放在此处过滤
|
| | | def PassPassiveLimit(useSkill):
|
| | | # 如灼烧是被动技能 但可以被不断的强化
|
| | | if useSkill.GetSkillType() == ChConfig.Def_SkillType_PassiveLstDepBuff:
|
| | | return True
|
| | | |
| | | if useSkill.GetFuncType() == ChConfig.Def_SkillFuncType_PassiveSkillWithSP:
|
| | | # 有专精的被动技能,可以再次触发被动效果
|
| | | 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
|