From 7b112d5e0399064f63b6f9c5754ac9974956026c Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期三, 28 十一月 2018 20:08:41 +0800
Subject: [PATCH] 4923 【后端】【1.3】神兵技能 -- 优化神兵护盾恢复逻辑

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_IceLode.py |   29 ++++++++++++++++++++---------
 1 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_IceLode.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_IceLode.py
index 1527607..7726ee7 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_IceLode.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_IceLode.py
@@ -29,6 +29,7 @@
 import ItemCommon
 import ItemControler
 import EventReport
+import EventShell
 import ChPyNetSendPack
 import NetPackCommon
 import BuffSkill
@@ -111,19 +112,26 @@
             return
     starCnt, lineList = GetIceLodeAllStarCnt(curPlayer)
     if not lineList:
-        __RandomLine(curPlayer)
+        __RandomLine(curPlayer, lineList)
     SyncIceLoddInfo(curPlayer)
     return
 
-def __RandomLine(curPlayer):
+def __RandomLine(curPlayer, oldlineList):
     # 随机今日玩法
     maxCnt, randomCnt = IpyGameDataPY.GetFuncEvalCfg('IceLodeCfg', 2)
     lineList = range(maxCnt)
-    random.shuffle(lineList)
-    for i, lineID in enumerate(lineList):
-        GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_IceLoadLineID, lineID, 0 if i >= randomCnt else 1)
+    newlineList = list(set(lineList) - set(oldlineList))
+    if len(newlineList) < randomCnt:
+        random.shuffle(oldlineList)
+        newlineList += oldlineList[:randomCnt-len(newlineList)]
+    else:
+        random.shuffle(newlineList)
+        newlineList = newlineList[:randomCnt]
+    #random.shuffle(lineList)
+    for lineID in lineList:
+        GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_IceLoadLineID, lineID, 1 if lineID in newlineList else 0)
     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_IceLodeDayLV, curPlayer.GetLV())
-    GameWorld.DebugLog('    随机冰晶矿脉今日玩法 lineList =%s'%(lineList[:randomCnt]), curPlayer.GetID())
+    GameWorld.DebugLog('    随机冰晶矿脉今日玩法 oldlineList=%s, newlineList =%s'%(oldlineList, newlineList), curPlayer.GetID())
     return
 
 ## 是否能够通过活动查询进入
@@ -165,6 +173,7 @@
 #  @param tick
 #  @return None
 def DoEnterFB(curPlayer, tick):
+    PlayerControl.SetSight(curPlayer, ChConfig.Def_PlayerSight_Default * 2)
     playerID = curPlayer.GetPlayerID()
     mapID = GameWorld.GetGameWorld().GetMapID()
     gameFB = GameWorld.GetGameFB()
@@ -219,7 +228,7 @@
 # @param tick 时间戳
 # @return 无意义
 def DoExitFB(curPlayer, tick):
-    
+    PlayerControl.SetSight(curPlayer, ChConfig.Def_PlayerSight_Default)
     return
 
 ##玩家主动离开副本.
@@ -227,6 +236,7 @@
 # @param tick 时间戳
 # @return 返回值无意义
 def DoPlayerLeaveFB(curPlayer, tick):
+    PlayerControl.SetSight(curPlayer, ChConfig.Def_PlayerSight_Default)
     return
 
 ##玩家切换地图
@@ -577,6 +587,7 @@
         
         jsonItemList = FBCommon.GetJsonItemList(itemList)
         overDict[FBCommon.Over_itemInfo] = jsonItemList
+        EventShell.EventRespons_FBEvent(curPlayer, 'icelode')
     # 通知结果
     __SendIceLodeOverInfo(curPlayer, overDict)
     
@@ -732,7 +743,7 @@
         if GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_IceLoadLineID, i):
             starCnt += GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, i, False, [ChConfig.Def_FBMapID_IceLode])
             lineList.append(i)
-    if len(lineList) != randomCnt:
+    if lineList and len(lineList) != randomCnt:
         GameWorld.ErrLog('    冰晶矿脉获取当前总星数,当前线路数量异常!lineList=%s'%lineList)
     return starCnt, lineList[:randomCnt]
 
@@ -774,7 +785,7 @@
     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_IceLodeStarAwardRecord, 0)
     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_IceLodeHasSweep, 0)
     #随机今日玩法
-    __RandomLine(curPlayer)
+    __RandomLine(curPlayer, lineList)
     #通知
     SyncIceLoddInfo(curPlayer)
     return True

--
Gitblit v1.8.0