From a2a1800c3bc1ce2257a49801da3b6caa2942285c Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 16 三月 2023 16:42:53 +0800
Subject: [PATCH] 1111 【bt7】【bt8】【bt9】【主干】击晕增加CD及最大概率配置;

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/BaseAttack.py |   21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 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 094cfa9..7963bd4 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/BaseAttack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/BaseAttack.py
@@ -41,6 +41,7 @@
 import NetPackCommon
 import PassiveBuffEffMng
 import PlayerGeTui
+import IpyGameDataPY
 #---------------------------------------------------------------------
 g_skillHurtList = IPY_GameWorld.IPY_HurtList()
 
@@ -1697,6 +1698,11 @@
     if attacker.GetGameObjType() != IPY_GameWorld.gotPlayer:
         return
     
+    faintRate = PlayerControl.GetFaintRate(attacker)
+    if not faintRate:
+        #GameWorld.DebugLog("没有击晕概率!", attacker.GetID())
+        return
+    
     if curSkill:
         useSkillData = attacker.GetUseSkill()
         # 非主动性技能不触发
@@ -1721,10 +1727,21 @@
     tagFaintRate = PlayerControl.GetFaintDefRate(defender) if defender.GetGameObjType() == IPY_GameWorld.gotPlayer else 0
 
     # 添加最高60%击晕效果
-    rate = min(max(PlayerControl.GetFaintRate(attacker) - tagFaintRate, 0), 6000)
+    maxRate = IpyGameDataPY.GetFuncCfg("PassiveSkillFaint", 1)
+    rate = min(max(faintRate - tagFaintRate, 0), maxRate)
     if not GameWorld.CanHappen(rate):
         return
-
+    
+    faintCD = IpyGameDataPY.GetFuncCfg("PassiveSkillFaint", 2) * 1000
+    if faintCD:
+        lastTick = attacker.GetDictByKey(ChConfig.Def_PlayerKey_AttrFaintCD)
+        remainTick = faintCD - (tick - lastTick)
+        if remainTick > 0:
+            GameWorld.DebugLog("击晕CD中! rate=%s,剩余tick=%s" % (rate, remainTick), attacker.GetID())
+            return
+        attacker.SetDict(ChConfig.Def_PlayerKey_AttrFaintCD, tick)
+        GameWorld.DebugLog("触发击晕! rate=%s" % rate, attacker.GetID())
+        
     SkillCommon.AddBuffBySkillType(defender, ChConfig.Def_SkillID_AtkerFaint, tick)
     return
 

--
Gitblit v1.8.0