From a388abb4b97782c1c694a8d28d8a1e73e03a35c0 Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期一, 10 六月 2019 16:33:25 +0800
Subject: [PATCH] 7155 【后端】【2.0】新增仙盟创建规则(通知修改)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillModule_30.py | 97 ++++++++++++++++++++++++++++++++++--------------
1 files changed, 69 insertions(+), 28 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillModule_30.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillModule_30.py
index 123a4a1..4a45d87 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillModule_30.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillModule_30.py
@@ -21,6 +21,7 @@
import PlayerControl
import IPY_GameWorld
import NPCCommon
+import GameWorld
#------------------------------------------------------------------------------
@@ -30,24 +31,33 @@
if not defender:
return
- buffType = ChConfig.Def_SkillBuffList.get(curSkill.GetEffect(0).GetEffectValue(0))
- buffTuple = SkillCommon.GetBuffManagerByBuffType(defender, buffType)
- if buffTuple == ():
- return
+ if not GameWorld.CanHappen(curSkill.GetHappenRate(), ChConfig.Def_MaxRateValue):
+ #清除失败也触发CD
+ return BaseAttack.DoSkillEx_AttackSucess(attacker, defender, curSkill, tick, isEnhanceSkill)
- buffManager = buffTuple[0]
- if buffManager.GetBuffCount() == 0:
- return
+ delSuccess = False
- curBuff = buffManager.GetBuff(0)
- ownerID, ownerType = curBuff.GetOwnerID(), curBuff.GetOwnerType()
-
- #删除Buff
- BuffSkill.DoBuffDisApper(defender, curBuff, tick)
- buffSkill = curBuff.GetSkill()
- skillID = buffSkill.GetSkillID()
- buffManager.DeleteBuffByTypeID(buffSkill.GetSkillTypeID())
- SkillShell.ClearBuffEffectBySkillID(defender, skillID, ownerID, ownerType)
+ # 优先清理指定技能
+ mark = curSkill.GetEffect(0).GetEffectValue(1)
+ theSkillID = mark if mark > 10 else 0
+ cleanCnt = mark if 0< mark <= 10 else 1
+ if theSkillID:
+ if curSkill.GetEffect(0).GetEffectValue(1):
+ findBuff = SkillCommon.FindBuffByID(defender, theSkillID)
+ else:
+ findBuff = SkillCommon.FindBuffByOwner(defender, theSkillID, attacker.GetID(), attacker.GetGameObjType())
+ if findBuff:
+ delSuccess = True
+ else:
+ # 某类技能中的一个
+ for _ in range(cleanCnt):
+ delResult = ClearBySkillType(curSkill, defender, tick)
+ if delResult:
+ delSuccess = True
+
+ if not delSuccess:
+ # 没有可清除BUFF也进入CD
+ return BaseAttack.DoSkillEx_AttackSucess(attacker, defender, curSkill, tick, isEnhanceSkill)
#刷新属性
curObjType = defender.GetGameObjType()
@@ -56,23 +66,54 @@
#刷新玩家属性
playerControl = PlayerControl.PlayerControl(defender)
- if buffType == IPY_GameWorld.bfActionBuff:
- playerControl.RefreshPlayerActionState()
- if BuffSkill.CheckBuffRefresh(buffSkill, False):
- playerControl.RefreshPlayerAttrByBuff()
- else:
- playerControl.RefreshPlayerAttrByBuff()
+ playerControl.RefreshPlayerActionState()
+ playerControl.RefreshPlayerAttrByBuff()
#NPC
elif curObjType == IPY_GameWorld.gotNPC:
npcControl = NPCCommon.NPCControl(defender)
- if buffType == IPY_GameWorld.bfActionBuff:
- npcControl.RefreshNPCActionState()
- if BuffSkill.CheckBuffRefresh(buffSkill, False):
- npcControl.RefreshNPCAttrState()
- else:
- npcControl.RefreshNPCAttrState()
+ npcControl.RefreshNPCActionState()
+ npcControl.RefreshNPCAttrState()
return BaseAttack.DoSkillEx_AttackSucess(attacker, defender, curSkill, tick, isEnhanceSkill)
+def ClearBySkillType(curSkill, defender, tick):
+ skillType = curSkill.GetEffect(0).GetEffectValue(0)
+ if skillType == 0:
+ # 无配置代表清除负面buff任意1个
+ skillTypeList = [
+ ChConfig.Def_SkillType_LstDepBuff , #持续减益BUFF 4
+ ChConfig.Def_SkillType_DepBuff , #减益BUFF 6
+ ChConfig.Def_SkillType_Action , #影响行为BUFF 14
+ ]
+ else:
+ skillTypeList = [skillType]
+
+ delSuccess = False
+
+ for skillType in skillTypeList:
+
+ buffType = ChConfig.Def_SkillBuffList.get(skillType)
+ buffTuple = SkillCommon.GetBuffManagerByBuffType(defender, buffType)
+ if buffTuple == ():
+ continue
+
+ buffManager = buffTuple[0]
+ if buffManager.GetBuffCount() == 0:
+ continue
+
+ curBuff = buffManager.GetBuff(0)
+ ownerID, ownerType = curBuff.GetOwnerID(), curBuff.GetOwnerType()
+
+ #删除Buff
+ BuffSkill.DoBuffDisApperEx(defender, curBuff, tick)
+ buffSkill = curBuff.GetSkill()
+ if not buffSkill:
+ continue
+ skillID = buffSkill.GetSkillID()
+ buffManager.DeleteBuffByTypeID(buffSkill.GetSkillTypeID())
+ SkillShell.ClearBuffEffectBySkillID(defender, skillID, ownerID, ownerType)
+ delSuccess = True
+ break
+ return delSuccess
\ No newline at end of file
--
Gitblit v1.8.0