xdh
2018-12-03 2ee379b4bfc25630f1a2b2d182a6ca6a2edaec36
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyParty.py
@@ -29,6 +29,7 @@
import PyGameData
import ItemCommon
import ItemControler
import Item_AddLV
#当前副本地图的状态
(
@@ -38,7 +39,6 @@
) = range(3)
#---战盟副本---
Map_FamilyPartyFB_FamilyID = "FamilyPartyFB_FamilyID"  # 对应的家族id
Map_FamilyPartyFB_StartTick = "Map_FamilyPartyFB_StartTick"  # 副本开始时间
GameFBDict_LastEnterFbDay = 'LastEnterFbDay_%s'  #上次进入活动的开服天
FBPlayerDict_TotalExp = 'XMYH_TotalExp%s'  # 获得的总经验
@@ -59,7 +59,6 @@
# @remarks 开启副本
def OnOpenFB(tick):
    gameFB = GameWorld.GetGameFB()
    gameFB.SetGameFBDict(Map_FamilyPartyFB_FamilyID, 0)
    gameFB.ClearAllPlayerGameFBDict()  # 清除所有玩家对应的副本字典信息
    gameFB.SetGameFBDict(ChConfig.Map_FBDict_NotifyStart, 0)
    return
@@ -159,8 +158,6 @@
        return
    curPlayer.Sync_TimeTick(IPY_GameWorld.tttTowerTake, 0, closeFB_RemainTick, True) 
    GameWorld.DebugLog('closeFB_RemainTick=%s' % closeFB_RemainTick)
    if not gameFB.GetGameFBDictByKey(Map_FamilyPartyFB_FamilyID):
        gameFB.SetGameFBDict(Map_FamilyPartyFB_FamilyID, curPlayer.GetFamilyID())
       
    openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay)
    if gameWorld.GetGameWorldDictByKey(GameFBDict_LastEnterFbDay % playerID) != openServerDay + 1:
@@ -195,8 +192,12 @@
# @return 返回值无意义
# @remarks 副本定时器
def OnProcess(tick):
    familyID = GameWorld.GetGameWorld().GetPropertyID()
    if not familyID:
        return
    gameFB = GameWorld.GetGameFB()
    fbStep = gameFB.GetFBStep()
    #GameWorld.DebugLog("    OnProcess...")
    if fbStep == FB_Step_Open:
        if FBCommon.GetFBFuncOpenState(ChConfig.Def_FBMapID_FamilyParty):
@@ -210,7 +211,7 @@
            GameWorldProcess.CloseFB(tick)
        else:
            #FBCommon.DoLogicAreaReward("FamilyPartyAreaAward", tick)
            #FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 10000)
            FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 10000)
            
            mapID = GameWorld.GetMap().GetMapID()
            notifyIndex = gameFB.GetGameFBDictByKey(ChConfig.Map_FBDict_NotifyStart)
@@ -220,7 +221,7 @@
                remaindTick = max(0, __GetRemainTick(tick) - 1000)
                if remaindTick <= (notifySecond + 1) * 1000:   
                    #remaindSecond = remaindTick / 1000
                    familyID = gameFB.GetGameFBDictByKey(Map_FamilyPartyFB_FamilyID)
                    PlayerControl.FamilyNotify(familyID, "Party_OverTime", [notifySecond])
                     
                    GameWorld.GetGameFB().SetGameFBDict(ChConfig.Map_FBDict_NotifyStart, notifyIndex + 1)
@@ -430,19 +431,29 @@
            return
        curPlayer.StopMove()
        curPlayer.Sit()
        if tagPlayer.GetPlayerAction() not in [IPY_GameWorld.paSit, IPY_GameWorld.paPreparing]:
            tagPlayer.StopMove()
            tagPlayer.Sit()
        if not gameWorld.GetGameWorldDictByKey(FBPlayerDict_HasSit % tagPlayerID):
            if tagPlayer.GetPlayerAction() not in [IPY_GameWorld.paSit, IPY_GameWorld.paPreparing]:
                tagPlayer.StopMove()
                tagPlayer.Sit()
    elif actionType == 1:  #打坐结束给奖励
        hasSit = gameWorld.GetGameWorldDictByKey(FBPlayerDict_HasSit % playerID)
        if hasSit:
            GameWorld.Log('打坐结束给奖励,玩家已打坐过一次', playerID)
            return
        reLV = curPlayer.GetLV()
        worldlv = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_WorldAverageLv)
        giveLV = eval(IpyGameDataPY.GetFuncCompileCfg('FamilyPartySitAward', 2))
        addExp = 0
        if giveLV:
            addExp = Item_AddLV.DoAddLVEx(curPlayer, giveLV, True, True, 0)
        reLV = curPlayer.GetLV()
        reExp = PlayerControl.GetPlayerReExp(curPlayer)
        worldlv = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_WorldAverageLv)
        giveExp = eval(IpyGameDataPY.GetFuncCompileCfg('FamilyPartySitAward'))
        if giveExp:
            PlayerControl.PlayerControl(curPlayer).AddExp(giveExp)
            exp = gameWorld.GetGameWorldDictByKey(FBPlayerDict_TotalExp % playerID)
            expPoint = gameWorld.GetGameWorldDictByKey(FBPlayerDict_TotalExpPoint % playerID)
            newTotalExp = expPoint*ChConfig.Def_PerPointValue+exp+giveExp
            newTotalExp = expPoint*ChConfig.Def_PerPointValue+exp+giveExp+addExp
            gameWorld.SetGameWorldDict(FBPlayerDict_TotalExp % playerID, newTotalExp%ChConfig.Def_PerPointValue)
            gameWorld.SetGameWorldDict(FBPlayerDict_TotalExpPoint % playerID, newTotalExp/ChConfig.Def_PerPointValue)
            
@@ -450,5 +461,5 @@
        DoFBHelp(curPlayer, 0)
        if curPlayer.GetPlayerAction() == IPY_GameWorld.paSit:
            curPlayer.Stand()
        GameWorld.DebugLog('    传功结束,给经验%s, worldlv=%s' % (giveExp, worldlv))
        GameWorld.DebugLog('    传功结束,giveLV=%s, giveExp=%s, worldlv=%s' % (giveLV, giveExp, worldlv))
    return