From 41306d3d2faeff9774d17abf820421b01c6f461e Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期一, 29 四月 2019 10:17:04 +0800
Subject: [PATCH] 6632 子 【开发】增加新的符印属性 / 【后端】增加新的符印属性
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuffEffMng.py | 187 ++++++++++++++++++++++++++++++++++++++--------
1 files changed, 153 insertions(+), 34 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuffEffMng.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuffEffMng.py
index 116989f..81787a1 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuffEffMng.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuffEffMng.py
@@ -21,7 +21,6 @@
#导入
import IPY_GameWorld
-import ReadChConfig
import PassiveBuff
import GameWorld
import ChConfig
@@ -122,7 +121,7 @@
# 刷被动效果和属性
page = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GFPassivePage, 0, ChConfig.Def_PDictType_GFPassive)
if clientData.Page == page:
- GetPassiveEffManager().RegistPassiveEffSet(curPlayer)
+ GetPassiveEffManager().RegistPassiveEffSet(curPlayer, True)
PlayerControl.PlayerControl(curPlayer).RefreshPlayerAttrState()
EventShell.EventRespons_PassiveSet(curPlayer)
@@ -158,7 +157,7 @@
NetPackCommon.SendFakePack(curPlayer, sendPack)
# 刷被动效果和属性
- GetPassiveEffManager().RegistPassiveEffSet(curPlayer)
+ GetPassiveEffManager().RegistPassiveEffSet(curPlayer, True)
PlayerControl.PlayerControl(curPlayer).RefreshPlayerAttrState()
return
@@ -260,6 +259,8 @@
# 助战神兽技能
GetPassiveEffManager().RegistPassiveEffDogz(curPlayer)
+
+ GetPassiveEffManager().RegistSuperEquipSkillDict(curPlayer)
#-被动逻辑处理--------------------------------------------------------------------------------------------------
##离开地图处理
@@ -296,7 +297,7 @@
4013:ChConfig.TriggerType_AttackAddFinalValue, #攻击增加输出伤害11
4014:ChConfig.TriggerType_HappenState, #必定触发
4015:ChConfig.TriggerType_AttackAddSkillPer, # 所有攻击伤害(SkillPer)增加,含普攻,计算时 5
- 4016:ChConfig.TriggerType_AbsorbShield, # 提高麒麟佑身的减少伤害效果提升20% 13
+ #4016:ChConfig.TriggerType_AbsorbShield, # 提高麒麟佑身的减少伤害效果提升20% 13
4017:ChConfig.TriggerType_BounceHP, # 反弹伤害固定值14,
4018:ChConfig.TriggerType_BuffDisappear, # buff消失后触发技能15,
4019:ChConfig.TriggerType_BuffTime, # 延长BUFF时间16,
@@ -304,7 +305,7 @@
4021:ChConfig.TriggerType_AddSingleSkillPer, # 持续性攻击的单次攻击逐次增加技能伤害18,
4022:ChConfig.TriggerType_SkillOverNoAttack, # 技能释放后 与TriggerType_AttackOver相反19,
4023:ChConfig.TriggerType_BeAttackOver, # 被攻击后触发 20
- 4024:ChConfig.TriggerType_AddIceAtkPer, # 攻击附加真实伤害百分比 21
+ #4024:ChConfig.TriggerType_AddIceAtkPer, # 攻击附加真实伤害百分比 21
4025:ChConfig.TriggerType_AddIceAtk, # 攻击附加真实伤害固定值 22
4026:ChConfig.TriggerType_DebuffOff, # 抵消一次debuff 23
4027:ChConfig.TriggerType_AttackKill, # 斩杀 24
@@ -331,7 +332,7 @@
4048:ChConfig.TriggerType_MissSkill, # 闪避后触发释放技能
4049:ChConfig.TriggerType_MissSuccessPer, # 闪避成功率提升
4050:ChConfig.TriggerType_OneDamage, # 伤害降低到1点
- 4051:ChConfig.TriggerType_LuckyHit, # 会心一击时增加会心伤害百分比 50
+ 4051:ChConfig.TriggerType_LuckyHit, # 会心一击时增加会心伤害固定值 50
4052:ChConfig.TriggerType_Buff_SuckBloodPer, # 攻击 百分比吸血
4053:ChConfig.TriggerType_AddLayer, # BUFF层级增加时 52
4054:ChConfig.TriggerType_AttackAddSkillPer, # 所有攻击伤害(SkillPer)增加,含普攻,计算时 5
@@ -354,8 +355,28 @@
4071:ChConfig.TriggerType_Buff_SuckBloodPer, # 攻击 百分比吸血
4072:ChConfig.TriggerType_SuperHitSkipCD, # 暴击无冷却 68
4073:ChConfig.TriggerType_BuffHurtCnt, # 当持续buff伤害第X次时触发技能 69
- 4074:ChConfig.TriggerType_BounceHP, # 反弹伤害固定值14, 记录值
- 4075:ChConfig.TriggerType_4074PerValue, # 增加4074的反弹比例
+ 4076:ChConfig.TriggerType_dFinalHurtReducePer, # 防守方的最终伤害减少百分比 71
+ 4077:ChConfig.TriggerType_AttackAddFinalPer, # 增加最终伤害百分比 59
+ 4078:ChConfig.TriggerType_AttackOver, # 攻击(对敌技能)后被动技能被触发 4
+ 4079:ChConfig.TriggerType_IsDealy, # 是否触发致命一击 72
+ 4080:ChConfig.TriggerType_BounceHPPer, # 反弹伤害百分比值17,
+ 4081:ChConfig.TriggerType_AddThumpHitRate, # 提高重击概率 73
+ 4082:ChConfig.TriggerType_ThumpHit, # 对第一目标重击触发技能
+ 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
+ 4090:ChConfig.TriggerType_AttackOver, # 攻击(对敌技能)后被动技能被触发 4
+ 4091:ChConfig.TriggerType_SkillOverNoAttack, # 技能释放后 与TriggerType_AttackOver相反19,
+ 4092:ChConfig.TriggerType_SkillSuccess, # 任何技能释放成功都可触发 76 减印记
+ 4093:ChConfig.TriggerType_NoControl, # 使关联技能不受控制 78
+ 4094:ChConfig.TriggerType_Buff_AddSuperHitRate, # BUFF类:增加暴击率
+ 4095:ChConfig.TriggerType_SuperHitSuckBloodPer, # BUFF类: 暴击百分比吸血, 79
+ 4096:ChConfig.TriggerType_SuperHitAddSkillPer, # 暴击增加技能伤害
+ 4097:ChConfig.TriggerType_BurnPer, # 灼烧伤害百分比 81
}
return tdict.get(effectID, -1)
#===========================================================================
@@ -386,7 +407,7 @@
4512:ChConfig.TriggerType_ReduceHurtHPPer, # 百分比减少攻击计算后伤害
4513:ChConfig.TriggerType_AttackAddFinalValue, #攻击增加输出伤害11
4514:ChConfig.TriggerType_Buff_BeAttackSubLayer, # BUFF类:被攻击减buff层,0消失
- 4515:ChConfig.TriggerType_AddIceAtkPer, # BUFF类:攻击附加真实伤害百分比
+ #4515:ChConfig.TriggerType_AddIceAtkPer, # BUFF类:攻击附加真实伤害百分比
4516:ChConfig.TriggerType_ChangeHurtToHP, # BUFF类:buff中把受到伤害的xx%转化为生命值
4517:ChConfig.TriggerType_DebuffOff, # BUFF类: 抵消debuff
4518:ChConfig.TriggerType_ForbidenCure, # BUFF类: 禁止治疗 53
@@ -397,6 +418,13 @@
4523:ChConfig.TriggerType_SuperHitSkillPer, # 暴击时,增加技能伤害 10
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中对第一目标暴击触发技能
803:ChConfig.TriggerType_BloodShield, # 血盾
806:ChConfig.TriggerType_BloodShield, # 血盾
@@ -418,6 +446,8 @@
self.AffectSkillDict = {} # 被动技能 {(触发模式, 被影响的技能ID):[被动技能ID,效果]
self.AffectPassiveSkillSetDict = {} # 被动技能装备 {(触发模式, 被影响的技能ID):[被动技能ID,效果]
self.AffectDogzSkillDict = {} # 神兽助战技能
+ self.AffectSuperEquipSkillDict = {} # 特殊装备持有技能,相同技能不重复,数值增长性衰减, 触发使用
+ self.AffectSuperEquipEffectCntDict = {} # 特殊装备技能效果对应的已计算后的数值,直接调用
#记录会影响其他技能或者被动触发释放技能的BUFF
def AddBuffInfoByEffect(self, effect, skillID):
@@ -503,16 +533,61 @@
return self.AffectDogzSkillDict
+ # 重刷特殊装备技能
+ def RefreshSuperEquipSkillDict(self):
+ self.AffectSuperEquipSkillDict = {}
+ self.AffectSuperEquipEffectCntDict = {}
+ skillsDict = FindSuperEquipSkills(self.gameObj)
+
+ for skillID, value in skillsDict.items():
+ curSkill = GameWorld.GetGameData().GetSkillBySkillID(skillID)
+ if not curSkill:
+ continue
+ if not SkillCommon.isPassiveTriggerSkill(curSkill):
+ continue
+
+ skillTypeID = curSkill.GetSkillTypeID()
+
+ connSkillID = SkillShell.GetConnectSkillID(curSkill) # 关联技能ID, 0代表不限技能
+ for i in xrange(curSkill.GetEffectCount()):
+ curEffect = curSkill.GetEffect(i)
+ effectID = curEffect.GetEffectID()
+ if effectID == 0:
+ continue
+
+ triggerType = GetTriggerTypeByEffectID(effectID)
+ if triggerType == -1:
+ continue
+
+ key = (triggerType,connSkillID)
+ if key not in self.AffectSuperEquipSkillDict:
+ self.AffectSuperEquipSkillDict[key] = []
+
+ self.AffectSuperEquipSkillDict[key].append((skillTypeID, effectID))
+ # 效果叠加根据技能个数会衰减 = 1-pow((1-初始值),相同技能个数)
+ self.AffectSuperEquipEffectCntDict[effectID] = 1 - pow((1 - curEffect.GetEffectValue(0)),value)
+
+ GameWorld.DebugLog("RefreshSuperEquipSkillDict %s-%s"%(self.AffectSuperEquipSkillDict, self.AffectSuperEquipEffectCntDict))
+
+ return self.AffectSuperEquipSkillDict
+
+
# 重刷可装备的被动技能
- def RefreshPassiveSkillSet(self):
+ def RefreshPassiveSkillSet(self, isCD=False):
self.AffectPassiveSkillSetDict = {}
skillManager = self.gameObj.GetSkillManager()
skills = FindUsePassiveSkills(self.gameObj)
+
+ tick = GameWorld.GetGameWorld().GetTick()
for skillID in skills:
curSkill = skillManager.FindSkillBySkillID(skillID)
if not curSkill:
continue
+
+ if isCD:
+ # 重切需进入CD
+ SkillCommon.SetSkillRemainTime(curSkill, PlayerControl.GetReduceSkillCDPer(self.gameObj), tick, self.gameObj)
skillTypeID = curSkill.GetSkillTypeID()
connSkillID = SkillShell.GetConnectSkillID(curSkill) # 关联技能ID, 0代表不限技能
@@ -603,17 +678,33 @@
return self.AffectSkillDict
- def GetPassiveSkillsByTriggerType(self, triggerType, connSkillID=0):
+ def GetPassiveSkillsByTriggerType(self, triggerType, connSkill=None):
+ connSkillID = connSkill.GetSkillTypeID() if connSkill else 0
skillList = []
## bug:2018-03-15
## skillList=self.AffectSkillDict.get((triggerType, connSkillID), [])再用extend会导致AffectSkillDict无限增长
skillList.extend(self.AffectSkillDict.get((triggerType, connSkillID), []))
skillList.extend(self.AffectPassiveSkillSetDict.get((triggerType, connSkillID), []))
skillList.extend(self.AffectDogzSkillDict.get((triggerType, connSkillID), []))
+ skillList.extend(self.AffectSuperEquipSkillDict.get((triggerType, connSkillID), []))
+
+ # 指定特殊类型可触发
+ 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), []))
+
+ # 被动再触发被动限制为指定
+ if connSkill and SkillCommon.isPassiveSkill(connSkill):
+ return skillList
+
if connSkillID != 0 and connSkillID != ChConfig.Def_SkillID_Somersault:
skillList.extend(self.AffectSkillDict.get((triggerType, 0), []))
skillList.extend(self.AffectPassiveSkillSetDict.get((triggerType, 0), []))
skillList.extend(self.AffectDogzSkillDict.get((triggerType, 0), []))
+ skillList.extend(self.AffectSuperEquipSkillDict.get((triggerType, 0), []))
return skillList
#所有obj的被动效果管理
@@ -663,16 +754,16 @@
return
# 人物需同步注册被动技能
- def RegistPassiveEffSet(self, gameObj):
+ def RegistPassiveEffSet(self, gameObj, isCD=False):
passiveEff = self.GetPassiveEff(gameObj)
if not passiveEff:
# 强制刷新所有被动技能
passiveEff = PassiveEff(gameObj)
- if not passiveEff.RefreshPassiveSkillSet():
+ if not passiveEff.RefreshPassiveSkillSet(isCD):
return
self.AddPassiveEff(gameObj, passiveEff)
else:
- passiveEff.RefreshPassiveSkillSet()
+ passiveEff.RefreshPassiveSkillSet(isCD)
return
@@ -687,6 +778,21 @@
self.AddPassiveEff(gameObj, passiveEff)
else:
passiveEff.RefreshDogzBattleSkill()
+ return
+
+
+
+ # 人物需同步注册装备技能,技能目前为可触发的被动类,若有定义冲突则可用功能类型划分
+ def RegistSuperEquipSkillDict(self, gameObj):
+ passiveEff = self.GetPassiveEff(gameObj)
+ if not passiveEff:
+ # 强制刷新所有被动技能
+ passiveEff = PassiveEff(gameObj)
+ if not passiveEff.RefreshSuperEquipSkillDict():
+ return
+ self.AddPassiveEff(gameObj, passiveEff)
+ else:
+ passiveEff.RefreshSuperEquipSkillDict()
return
@@ -794,7 +900,7 @@
return 0, 0
connSkillID = connSkill.GetSkillTypeID() if connSkill else 0
- skills = passiveEff.GetPassiveSkillsByTriggerType(triggerType, connSkillID)
+ skills = passiveEff.GetPassiveSkillsByTriggerType(triggerType, connSkill)
if not skills:
return 0, 0
@@ -928,28 +1034,17 @@
if not attacker:
return False
- stopPassiveSkill = False # 被动技能不能再触发被动技能,但可以触发天赋技能
if connSkill:
if not connSkill.GetFuncType():
# 非功能类技能,避免死循环
return False
- if SkillCommon.isPassiveSkill(connSkill):
- #GameWorld.DebugLog("被动技能不能再次触发被动技能")
- #return False
- stopPassiveSkill = True
- if SkillCommon.GetUsingPassiveSkill(attacker) and triggerType != ChConfig.TriggerType_BuffState:
- # 防范被动技能触发的 非被动技能
- #GameWorld.DebugLog("被动技能释放中不能再次触发被动技能---%s"%triggerType)
- #return
- stopPassiveSkill = True
-
passiveEff = GetPassiveEffManager().GetPassiveEff(attacker)
if not passiveEff:
return False
connSkillID = connSkill.GetSkillTypeID() if connSkill else 0
- skills = passiveEff.GetPassiveSkillsByTriggerType(triggerType, connSkillID)
+ skills = passiveEff.GetPassiveSkillsByTriggerType(triggerType, connSkill)
if not skills:
return False
@@ -968,10 +1063,6 @@
if not IsValidPassiveSkill(curSkill):
continue
-
- if stopPassiveSkill and curSkill.GetFuncType() != ChConfig.Def_SkillFuncType_GiftSkill:
- # 只有天赋才可以再次被触发
- continue
effect = SkillCommon.GetSkillEffectByEffectID(curSkill, effectID)
if not effect:
@@ -1049,7 +1140,7 @@
if not passiveEff:
return 0
connSkillID = connSkill.GetSkillTypeID() if connSkill else 0
- skills = passiveEff.GetPassiveSkillsByTriggerType(triggerType, connSkillID)
+ skills = passiveEff.GetPassiveSkillsByTriggerType(triggerType, connSkill)
if not skills:
return 0
@@ -1114,7 +1205,7 @@
if not passiveEff:
return []
connSkillID = connSkill.GetSkillTypeID() if connSkill else 0
- skills = passiveEff.GetPassiveSkillsByTriggerType(triggerType, connSkillID)
+ skills = passiveEff.GetPassiveSkillsByTriggerType(triggerType, connSkill)
if not skills:
return []
@@ -1163,7 +1254,7 @@
if not passiveEff:
return
connSkillID = connSkill.GetSkillTypeID() if connSkill else 0
- skills = passiveEff.GetPassiveSkillsByTriggerType(triggerType, connSkillID)
+ skills = passiveEff.GetPassiveSkillsByTriggerType(triggerType, connSkill)
if not skills:
return
@@ -1472,3 +1563,31 @@
skills.append(curSkill)
return skills
+
+
+# 遍历身上装备技能以及各自个数,装备技能不需要学习
+# 保证不同的装备技能不会有相同的效果, 效果数值的衰减是根据相同技能个数计算而不是效果个数 1-pow((1-初始值),相同技能个数)
+def FindSuperEquipSkills(gameObj):
+ skillsDict = {}
+ if gameObj.GetGameObjType() != IPY_GameWorld.gotPlayer:
+ return skillsDict
+
+ equipPack = gameObj.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
+ for i in xrange(equipPack.GetCount()):
+ curEquip = equipPack.GetAt(i)
+
+ if not curEquip or curEquip.IsEmpty():
+ continue
+
+ if curEquip.GetAddSkill(0) == 0:
+ #无技能
+ continue
+
+ for j in xrange(curEquip.GetAddSkillCount()):
+ skillID = curEquip.GetAddSkill(j)
+ if skillID == 0:
+ break
+
+ skillsDict[skillID] = skillsDict.get(skillID, 0) + 1
+
+ return skillsDict
--
Gitblit v1.8.0