From cc1dc60daab5a6a9c2f1aa23c10736af2227d521 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 04 三月 2021 14:05:52 +0800
Subject: [PATCH] 8650 【主干】【BT2】活动规则优化(多活动支持的改为单表模式,增加活动分组编号字段区分不同的活动编号;常规活动改为不受合服影响,合服活动独立出来;累计充值活动、集字活动适配为新模式);
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/BaseAttack.py | 80 ++++++++++++++++++++++++++-------------
1 files changed, 53 insertions(+), 27 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/BaseAttack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/BaseAttack.py
index 3d5775a..7444d9f 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/BaseAttack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/BaseAttack.py
@@ -205,6 +205,11 @@
return callFunc(attacker, defender, skill, tick)
+def GetSkillHurtList():
+ global g_skillHurtList
+ return g_skillHurtList
+
+
def GetFirstHurtObj():
global g_skillHurtList
if g_skillHurtList.GetHurtCount():
@@ -357,7 +362,7 @@
if GameObj.GetHP(defender) <= 0:
defender.SetDict(ChConfig.Def_NPCDead_KillerType, attacker.GetGameObjType())
defender.SetDict(ChConfig.Def_NPCDead_KillerID, attacker.GetID())
- PlayerGeTui.TJGDead(defender, attacker.GetName())
+ #PlayerGeTui.TJGDead(defender, attacker.GetName())
if defender.GetGameObjType() == IPY_GameWorld.gotNPC:
skillID = 0 if not useSkill else useSkill.GetSkillID()
# 记录死亡原因
@@ -852,12 +857,13 @@
# 根据触发技能的特点决定是触发一次还是 触发多次
# 群体BUFF的请参考IsPlayerUseSkill 客户端决定对象,一样可以实现同样效果
- for enhanceSkillID in [curSkill.GetSkillEnhance1(), curSkill.GetSkillEnhance2()]:
- if GetIsEnhanceSkillGroup(curSkill, enhanceSkillID):
- for defObj in attackList:
- SkillShell.SkillTrigSkill(attacker, defObj, curSkill, enhanceSkillID, tick)
- else:
- SkillShell.SkillTrigSkill(attacker, defender, curSkill, enhanceSkillID, tick)
+ if curSkill:
+ for enhanceSkillID in [curSkill.GetSkillEnhance1(), curSkill.GetSkillEnhance2()]:
+ if GetIsEnhanceSkillGroup(curSkill, enhanceSkillID):
+ for defObj in attackList:
+ SkillShell.SkillTrigSkill(attacker, defObj, curSkill, enhanceSkillID, tick)
+ else:
+ SkillShell.SkillTrigSkill(attacker, defender, curSkill, enhanceSkillID, tick)
else:
OnHurtTypeTriggerPassiveSkill(attacker, defender, curSkill, tick)
@@ -974,20 +980,22 @@
if not curTag:
continue
- if curSkillUseTag == ChConfig.Def_UseSkillTag_CanAttackNPC:
- if NPCCommon.GetNpcObjOwnerIsPlayer(curTag):
- #npc主人是玩家不能攻击
+ #非自定义场景才需要判断
+ if not attacker.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomScene):
+ if curSkillUseTag == ChConfig.Def_UseSkillTag_CanAttackNPC:
+ if NPCCommon.GetNpcObjOwnerIsPlayer(curTag):
+ #npc主人是玩家不能攻击
+ continue
+
+ if GameWorld.GetDist(curTag.GetPosX(), curTag.GetPosY(), attacker.GetPosX(), attacker.GetPosY()) > attacker.GetSight():
+ # 最远距离防范
+ GameWorld.DebugLog("#--- 最远距离防范[%s-%s]"%(attacker.GetID(), curTag.GetID()))
continue
-
- if GameWorld.GetDist(curTag.GetPosX(), curTag.GetPosY(), attacker.GetPosX(), attacker.GetPosY()) > attacker.GetSight():
- # 最远距离防范
- GameWorld.DebugLog("#--- 最远距离防范[%s-%s]"%(attacker.GetID(), curTag.GetID()))
- continue
-
- if CheckFunc != None:
- #检查是否受影响
- if not CheckFunc(attacker, curTag, curSkill, tick):
- continue
+
+ if CheckFunc != None:
+ #检查是否受影响
+ if not CheckFunc(attacker, curTag, curSkill, tick):
+ continue
resultList.append(curTag)
@@ -1093,6 +1101,9 @@
#不在影响对象列表中
if curObjType not in hurtTypeList:
+ return None, None
+
+ if attacker.GetSightLevel() != curObj.GetSightLevel():
return None, None
#攻击对象
@@ -1369,6 +1380,9 @@
#技能攻击
skillID = curSkill.GetSkillID()
+ changeSkillID = PassiveBuffEffMng.GetPassiveSkillValueByTriggerTypeEx(attacker, None, curSkill, ChConfig.TriggerType_ChangeSkillEff)
+ if changeSkillID:
+ skillID = changeSkillID
battleType = AttackCommon.GetBattleType(attacker, curSkill)
#无目标类技能
if not defender:
@@ -1470,7 +1484,8 @@
if curPlayerSkill:
SkillCommon.SetSkillRemainTime(curPlayerSkill, PlayerControl.GetReduceSkillCDPer(curPlayer), tick, curPlayer)
- if curSkill.GetFuncType() in [ChConfig.Def_SkillFuncType_GiftSkill, ChConfig.Def_SkillFuncType_FbSPSkill]:
+ if curSkill.GetFuncType() in [ChConfig.Def_SkillFuncType_GiftSkill, ChConfig.Def_SkillFuncType_FbSPSkill,
+ ChConfig.Def_SkillFuncType_PassiveSkillWithSP]:
UseSkillOver(curPlayer, target, curSkill, tick)
else:
OnHurtTypeTriggerPassiveSkill(curPlayer, target, curSkill, tick)
@@ -1512,7 +1527,7 @@
if curPlayerSkill:
- if not IsSkipSkillCD:
+ if not IsSkipSkillCD(curPlayer, target, curSkill, tick):
#设置玩家所学技能冷却CD
SkillCommon.SetSkillRemainTime(curPlayerSkill, PlayerControl.GetReduceSkillCDPer(curPlayer), tick, curPlayer)
#调用任务触发器
@@ -1586,8 +1601,13 @@
skillHurtLists.append([hurtObj.GetObjID(), hurtObj.GetObjType(), hurtObj.GetAttackType()])
- #只对第一目标造成某伤害类型时触发技能, 需先存储 skillHurtLists
- OnHurtTypeTriggerSkillFirstObj(attacker, curSkill, tick)
+ #命中个数记录特殊处理
+ PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(attacker, target, curSkill, ChConfig.TriggerType_HitValue)
+
+ # #持续攻击类BUFF 类剑刃风暴是先给自身一个持续性buff,这一次不算伤害不可触发
+ if curSkill and ChConfig.Def_SkillType_LstPlsBuffAtk != curSkill.GetSkillType():
+ #只对第一目标造成某伤害类型时触发技能, 需先存储 skillHurtLists
+ OnHurtTypeTriggerSkillFirstObj(attacker, curSkill, tick)
skillIDSet = set()
for hurtList in skillHurtLists:
@@ -1653,8 +1673,8 @@
# 攻击减层级 优先处理,因为同个技能触发buff后,会再处理层级,导致立即减层级
PassiveBuffEffMng.OnPassiveBuffTrigger(attacker, defender, curSkill, ChConfig.TriggerType_Buff_AttackSubLayer, tick)
- # 普攻和对敌技能
- if not curSkill or curSkill.GetSkillType() in ChConfig.Def_CanAttackSkill_List:
+ # 普攻和对敌技能, 此处暂且特殊处理Def_SkillFuncType_PassiveSkillWithSP,待优化
+ if not curSkill or curSkill.GetSkillType() in ChConfig.Def_CanAttackSkill_List or curSkill.GetFuncType() == ChConfig.Def_SkillFuncType_PassiveSkillWithSP:
PassiveBuffEffMng.OnPassiveSkillTrigger(attacker, defender, curSkill, ChConfig.TriggerType_AttackOver, tick)
PassiveBuffEffMng.OnPassiveBuffTrigger(attacker, defender, curSkill, ChConfig.TriggerType_AttackOver, tick)
@@ -1667,6 +1687,8 @@
#释放技能即可处理的 不区分攻击和非攻击
PassiveBuffEffMng.OnPassiveSkillTrigger(attacker, defender, curSkill, ChConfig.TriggerType_SkillSuccess, tick)
+ PassiveBuffEffMng.OnPassiveSkillTrigger(attacker, defender, curSkill, ChConfig.TriggerType_SkillSuccessExpend, tick)
+
return
@@ -2728,8 +2750,9 @@
sendPack.HurtList.append(hurtList)
sendPack.HurtCount = len(sendPack.HurtList)
-
+ sendPack.SkillElementID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SkillElementID % skillID)
PlayerControl.PyNotifyAll(curPlayer, sendPack, notifySelf=True, notifyCnt=-1)
+ return
# py重现View_UseSkillPos效果,对地通知,只用于玩家
@@ -2740,6 +2763,7 @@
# ChangeAction(paAttack);
# m_LastBattleTick = GetGameWorldManager()->GetTick();
#===========================================================================
+
sendPack = ChNetSendPack.tagUseSkillPos()
sendPack.Clear()
sendPack.ObjID = attacker.GetID()
@@ -2763,6 +2787,7 @@
sendPack.HurtCount = len(sendPack.HurtList)
if attacker.GetGameObjType() == IPY_GameWorld.gotPlayer:
+ sendPack.SkillElementID = attacker.NomalDictGetProperty(ChConfig.Def_PDict_SkillElementID % skillID)
PlayerControl.PyNotifyAll(attacker, sendPack, notifySelf, -1)
else:
attacker.NotifyAll(sendPack.GetBuffer(), sendPack.GetLength())
@@ -2804,6 +2829,7 @@
sendPack.HurtList.append(hurtList)
sendPack.HurtCount = len(sendPack.HurtList)
+ sendPack.SkillElementID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SkillElementID % skillID)
NetPackCommon.SendFakePack(curPlayer, sendPack)
return
--
Gitblit v1.8.0