From d4d3e0745ae058c4da20e50a9b129018b96a2605 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期三, 19 六月 2019 21:21:17 +0800
Subject: [PATCH] 6603 【后端】【2.0】增加新版的sp和被动技能 - 优化对当前释放技能的逻辑判断
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py | 16 +++++++++++++++-
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_4100.py | 2 ++
2 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_4100.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_4100.py
index 91b0d17..2ce75d8 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_4100.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/PassiveBuff/PassiveSkill_4100.py
@@ -20,6 +20,8 @@
def CheckCanHappen(attacker, defender, effect, curSkill):
+ if not defender:
+ return False
buff = SkillCommon.FindBuffByOwner(defender, effect.GetEffectValue(0), attacker.GetID(), attacker.GetGameObjType())
if not buff:
return False
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py
index c645db3..0c5f72c 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py
@@ -55,6 +55,7 @@
# 记录客户端伤害 {(objID, objType):[HurtHP, AttackType]}
g_ClientHurtDict = collections.OrderedDict()
+g_UseSkillPlayerID = 0 # 全服攻击为单线程 记录的是当前使用技能的玩家 用于判断g_ClientHurtDict的归属
#---------------------------------------------------------------------
##C++调用函数, 重新读取所有技能
@@ -92,6 +93,10 @@
def GetSkillFireAim(curSkill):
return curSkill.GetTag()%10
+# 当前释放主动技能的玩家
+def GetUseSkillPlayerID():
+ global g_UseSkillPlayerID
+ return g_UseSkillPlayerID
# 客户端伤血列表,修改了遍历对象和计算血量
def GetClientHurtDict():
@@ -100,7 +105,9 @@
def ClearClientHurtDict(curPlayer):
global g_ClientHurtDict
+ global g_UseSkillPlayerID
g_ClientHurtDict = collections.OrderedDict()
+ g_UseSkillPlayerID = 0
def GetClientHurtByObj(objID, objType):
@@ -122,6 +129,7 @@
# 技能开始初始化客户端伤血列表
def InitClientHurtDict(curPlayer, curSkill, hurtList):
global g_ClientHurtDict
+ global g_UseSkillPlayerID
ClearClientHurtDict(curPlayer)
#技能攻击最大数量
@@ -157,7 +165,8 @@
return False
g_ClientHurtDict[(hurobj.ObjID, hurobj.ObjType)] = [hurobj.HurtHP, hurobj.AttackType]
-
+
+ g_UseSkillPlayerID = curPlayer.GetID()
return True
#---------------------------------------------------------------------
# 非客户端玩家释放的技能
@@ -169,12 +178,17 @@
# 玩家普通也是技能,正常是不会走到这边
return False
+ if GetUseSkillPlayerID() != attacker.GetID():
+ # 非释放者
+ return False
+
useSkillData = attacker.GetUseSkill()
if useSkillData and curSkill.GetSkillTypeID() != useSkillData.GetSkillTypeID():
# 默认群攻附加触发buff的对象与攻击对象一致
if not SkillCommon.IsBuff(curSkill):
return False
+
if not GetClientHurtDict():
return False
--
Gitblit v1.8.0