From 688e59b6ce2aab1838a08924ddf5bbee33180f61 Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期三, 19 六月 2019 10:41:20 +0800
Subject: [PATCH] 7389 【后端】【2.0】骑宠争夺中副本需要显示倒计时

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_AllFamilyBoss.py |   23 +++++++++++++++++------
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_HorsePetBoss.py  |   23 ++++++++++++++++++-----
 2 files changed, 35 insertions(+), 11 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_AllFamilyBoss.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_AllFamilyBoss.py
index 771a76b..55ba478 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_AllFamilyBoss.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_AllFamilyBoss.py
@@ -37,13 +37,12 @@
 FBPlayerDict_EncourageLV = 'FBPlayerDict_EncourageLV'  # 鼓舞等级
 FBDict_IsOver = 'FBDict_IsOver'  #是否已结算, 结算时的tick
 FBDict_EncourageCnt = 'FBDict_EncourageCnt'  #鼓舞过次数
-
+Map_FB_StartTick = 'Map_FB_StartTick' #活动开始时间
 
 (
     Def_BossTime,  #BOSS时间
     Def_LeaveTime,  #离开时间
-    Def_HPSpeed,  #掉血速度公式
-    ) = range(3)
+    ) = range(2)
 
 #当前副本地图的状态
 (
@@ -122,13 +121,23 @@
     if mapID != ChConfig.Def_FBMapID_AllFamilyBoss:
         return
     GameWorld.DebugLog('    多仙盟BOSS活动状态变更 state=%s' % state)
-
-    if not state:
+    
+    if state:
+        if not GameWorld.GetGameWorld().GetGameWorldDictByKey(Map_FB_StartTick):
+            GameWorld.GetGameWorld().SetGameWorldDict(Map_FB_StartTick, tick)
+    else:
+        GameWorld.GetGameWorld().SetGameWorldDict(Map_FB_StartTick, 0)
         if not GameWorld.GetGameFB().GetGameFBDictByKey(FBDict_IsOver):
             GameWorld.GetGameFB().SetGameFBDict(FBDict_IsOver, tick)
             __DoLogicAllFamilyBossOver(0, tick, 0, 0)
     return
 
+def __GetRemainTick(tick):
+    ##活动剩余毫秒
+    mapID = GameWorld.GetMap().GetMapID()
+    startTick = GameWorld.GetGameWorld().GetGameWorldDictByKey(Map_FB_StartTick)
+    closeFB_RemainTick = max(0, FBCommon.GetFBLineStepTime(mapID)[Def_BossTime] * 1000 - (tick - startTick))
+    return closeFB_RemainTick
 
 ## 进副本
 #  @param curPlayer
@@ -171,7 +180,9 @@
         FBCommon.AddFbEncourageBuff(curPlayer, FBPlayerDict_EncourageLV, tick, familyID)
     else:
         FBCommon.SendFBEncourageInfo(curPlayer, encourageLV, familyID)
-        
+    
+    closeFB_RemainTick = __GetRemainTick(tick)
+    curPlayer.Sync_TimeTick(IPY_GameWorld.tttTowerTake, 0, closeFB_RemainTick, True) 
     DoFBHelp(curPlayer, tick)
     return
 
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_HorsePetBoss.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_HorsePetBoss.py
index 458f9fe..2bec0fe 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_HorsePetBoss.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_HorsePetBoss.py
@@ -34,12 +34,12 @@
 
 FBPlayerDict_EncourageLV = 'FBPlayerDict_EncourageLV'   # 鼓舞等级
 FBDict_IsOver = 'FBDict_IsOver' #是否已结算, 结算时的tick
+Map_FB_StartTick = 'Map_FB_StartTick' #活动开始时间
 
 (
 Def_BossTime,  #BOSS时间
 Def_LeaveTime,  #离开时间
-Def_HPSpeed,  #掉血速度公式
-) = range(3)
+) = range(2)
     
 #当前副本地图的状态
 (
@@ -101,12 +101,23 @@
     if mapID != ChConfig.Def_FBMapID_HorsePetBoss:
         return
     GameWorld.DebugLog('    骑宠BOSS活动状态变更 state=%s' % state)
-
-    if not state:
+            
+    if state:
+        if not GameWorld.GetGameWorld().GetGameWorldDictByKey(Map_FB_StartTick):
+            GameWorld.GetGameWorld().SetGameWorldDict(Map_FB_StartTick, tick)
+    else:
+        GameWorld.GetGameWorld().SetGameWorldDict(Map_FB_StartTick, 0)
         if GameWorld.GetGameFB().GetFBStep() == FB_Step_Fighting:
             GameWorld.GetGameFB().SetGameFBDict(FBDict_IsOver, tick)
             __DoLogicHorsePetBossOver(0, tick, 0, 0)
     return
+
+def __GetRemainTick(tick):
+    ##活动剩余毫秒
+    mapID = GameWorld.GetMap().GetMapID()
+    startTick = GameWorld.GetGameWorld().GetGameWorldDictByKey(Map_FB_StartTick)
+    closeFB_RemainTick = max(0, FBCommon.GetFBLineStepTime(mapID)[Def_BossTime] * 1000 - (tick - startTick))
+    return closeFB_RemainTick
 
 ## 进副本
 #  @param curPlayer
@@ -145,7 +156,9 @@
         FBCommon.AddFbEncourageBuff(curPlayer, FBPlayerDict_EncourageLV, tick)
     else:
         FBCommon.SendFBEncourageInfo(curPlayer, encourageLV)
-        
+    
+    closeFB_RemainTick = __GetRemainTick(tick)
+    curPlayer.Sync_TimeTick(IPY_GameWorld.tttTowerTake, 0, closeFB_RemainTick, True) 
     DoFBHelp(curPlayer, tick)
     return
 

--
Gitblit v1.8.0