From 2f282f72a55d7d327b3da040823d39a0239ecfa6 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期二, 27 十一月 2018 22:19:26 +0800
Subject: [PATCH] 5107 子 【优化】【1.3】神兵系统修改 / 【后端】【1.3】神兵新增解锁条件——人物等级

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGodWeapon.py |   29 ++++++++++++++++++++++-------
 1 files changed, 22 insertions(+), 7 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGodWeapon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGodWeapon.py
index 6a8d7bb..ec9f240 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGodWeapon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGodWeapon.py
@@ -156,10 +156,29 @@
         GameWorld.DebugLog("已经解锁的神兵!weaponType=%s" % weaponType)
         return
     
+    # 满足玩家等级或者前置神兵等级可解锁
+    if __GWCheckPlayerLV(curPlayer, weaponType) or __GWCheckOtherGWLV(curPlayer, weaponType):
+            
+        SetGodWeaponLV(curPlayer, weaponType, 1)
+        RefreshGodWeaponAttr(curPlayer)
+        GameWorld.DebugLog("解锁神兵: weaponType=%s" % weaponType)
+        Sync_GodWeaponLVInfo(curPlayer, weaponType)
+    return
+
+# 神兵激活需2次判断等级 {2:100, 4:100}
+def __GWCheckPlayerLV(curPlayer, weaponType):
+    godWeaponUnlockDict = IpyGameDataPY.GetFuncEvalCfg("GodWeaponActive", 3, {})
+    if str(weaponType) not in godWeaponUnlockDict:
+        GameWorld.DebugLog("该神兵不能解锁!weaponType=%s" % weaponType)
+        return False
+    return curPlayer.GetLV() >= godWeaponUnlockDict[str(weaponType)]
+
+# 神兵激活需判断前置神兵等级
+def __GWCheckOtherGWLV(curPlayer, weaponType):
     godWeaponUnlockDict = IpyGameDataPY.GetFuncEvalCfg("GodWeaponActive", 2, {})
     if str(weaponType) not in godWeaponUnlockDict:
         GameWorld.DebugLog("该神兵不能解锁!weaponType=%s" % weaponType)
-        return
+        return False
     conditionList = godWeaponUnlockDict[str(weaponType)]
     
     for needType, needLV in conditionList:
@@ -167,13 +186,9 @@
         if needTypeLV < needLV:
             GameWorld.DebugLog("所需前置神兵等级不足,无法解锁!weaponType=%s,needType=%s,needLV=%s > needTypeLV(%s)" 
                                % (weaponType, needType, needLV, needTypeLV))
-            return
+            return False
         
-    SetGodWeaponLV(curPlayer, weaponType, 1)
-    RefreshGodWeaponAttr(curPlayer)
-    GameWorld.DebugLog("解锁神兵: weaponType=%s" % weaponType)
-    Sync_GodWeaponLVInfo(curPlayer, weaponType)
-    return
+    return True
 
 #===============================================================================
 #// A5 55 神兵升级 #tagCMGodWeaponPlus

--
Gitblit v1.8.0