From 4087d18ce7cbd1578a6e287962bd902386984048 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 14 七月 2025 10:55:57 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_ServerCode

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py |   30 ++++++++++++++++++++++++++----
 1 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py
index 389e148..d4639ce 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py
@@ -448,6 +448,28 @@
     #NPC读表取
     return attack.GetHurtType()
 
+def GetAtkDistType(curObj):
+    ## 获取是近战还是远程,默认近战
+    if curObj.GetGameObjType() != IPY_GameWorld.gotNPC:
+        return ChConfig.AtkDistType_Short
+    
+    playerID = curObj.GetDictByKey(ChConfig.Def_Obj_Dict_LineupPlayerID)
+    if not playerID:
+        return ChConfig.AtkDistType_Short
+    
+    heroID = curObj.GetDictByKey(ChConfig.Def_Obj_Dict_HeroID)
+    if heroID:
+        heroIpyData = IpyGameDataPY.GetIpyGameData("Hero", heroID)
+        if heroIpyData:
+            return heroIpyData.GetAtkDistType()
+        
+    npcID = curObj.GetNPCID()
+    npcDataEx = NPCCommon.GetNPCDataEx(npcID)
+    if npcDataEx:
+        return npcDataEx.GetAtkDistType()
+    
+    return ChConfig.AtkDistType_Short
+
 ## 输入基础数值,返回增强后的值 - 技能加强
 #  @param value 基础值
 #  @param skill 技能
@@ -1624,7 +1646,7 @@
         return
     
     if curSkill and curSkill.GetFuncType() not in [ChConfig.Def_SkillFuncType_FbSkill,
-                                          ChConfig.Def_SkillFuncType_NormalAttack]:
+                                          ChConfig.Def_SkillFuncType_TurnNormaAttack]:
         return
     
     if attacker.GetDictByKey(ChConfig.Def_PlayerKey_FirstDefender):
@@ -2075,7 +2097,7 @@
     
     # --- 新增普通攻击的数值和技能攻击的数值,根据类型各自计算
     if atkObjType == IPY_GameWorld.gotPlayer:
-        if not curSkill or curSkill.GetFuncType() == ChConfig.Def_SkillFuncType_NormalAttack:
+        if not curSkill or curSkill.GetFuncType() == ChConfig.Def_SkillFuncType_TurnNormaAttack:
             atkSkillPer += PlayerControl.GetNormalHurtPer(atkObj)
             atkSkillValue += PlayerControl.GetNormalHurt(atkObj)
         elif curSkill.GetFuncType() in [ChConfig.Def_SkillFuncType_FbSkill, ChConfig.Def_SkillFuncType_FbPassiveSkill]:
@@ -2211,7 +2233,7 @@
     elif not curSkill:
         hurtValue = eval(IpyGameDataPY.GetFuncCompileCfg("HurtFormula", 3))
         GameWorld.DebugLog("    普攻伤害=%s" % (hurtValue))
-    elif SkillCommon.isNormalAtkSkill(curSkill):
+    elif SkillCommon.isTurnNormalAtkSkill(curSkill):
         hurtValue = eval(IpyGameDataPY.GetFuncCompileCfg("HurtFormula", 1))
         GameWorld.DebugLog("    普攻技能伤害=%s" % (hurtValue))
     elif SkillCommon.isXPSkill(curSkill):
@@ -2795,7 +2817,7 @@
     if GameObj.GetHP(curObjDetel) > 0:
         return
     
-    if TurnAttack.SetKilled(curObjDetel):
+    if TurnAttack.SetTurnObjKilled(curObjDetel, atkObj):
         return
         
     #---玩家处理---

--
Gitblit v1.8.0