hxp
2018-08-30 103b3e459dccf87e3985911a36882d07b8f63efa
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyParty.py
@@ -26,7 +26,7 @@
import GameWorldProcess
import PlayerFairyCeremony
import EventReport
import PyGameData
#当前副本地图的状态
@@ -45,6 +45,9 @@
FBPlayerDict_TotalPoint = 'XMYH_TotalPoint%s'   # 获得的总仙盟贡献值
FBPlayerDict_HasCollect = 'XMYH_HasCollect%s'   # 是否已采集
def OnFBPlayerOnDay(curPlayer):
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyPartyAnswerCnt, 0)
    return
##开启副本
# @param tick 时间戳
@@ -191,6 +194,8 @@
    elif fbStep == FB_Step_Fighting:
        if not FBCommon.GetFBFuncOpenState(ChConfig.Def_FBMapID_FamilyParty):
            GiveJoinPrize()
            FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 0)
            PyGameData.g_familyPartyInfo = []
            FBCommon.SetFBStep(FB_Step_Over, tick)
            FBCommon.DoLogic_FBKickAllPlayer()
            GameWorldProcess.CloseFB(tick)
@@ -219,35 +224,22 @@
def FamilyPartyAnswerRight(curPlayer):
    #回答正确,给奖励
    mapID = GameWorld.GetMap().GetMapID()
    if mapID != ChConfig.Def_FBMapID_FamilyParty:
        return
    playerID = curPlayer.GetID()
    gameWorld = GameWorld.GetGameWorld()
#    mapID = GameWorld.GetMap().GetMapID()
#    if mapID != ChConfig.Def_FBMapID_FamilyParty:
#        return
#
    addPoint, addExp = IpyGameDataPY.GetFuncEvalCfg('PartyReward',2)
    #仙盟贡献度
    PlayerFamily.AddPlayerFamilyActiveValue(curPlayer, addPoint, True, ShareDefine.Def_AddFAVReason_FamilyParty)
    totalPoint = gameWorld.GetGameWorldDictByKey(FBPlayerDict_TotalPoint%playerID)
    updPoint = totalPoint + addPoint
    gameWorld.SetGameWorldDict(FBPlayerDict_TotalPoint % playerID, updPoint)
    PlayerFamily.AddPlayerFamilyActiveValue(curPlayer, addPoint, True, ShareDefine.Def_AddFAVReason_FamilyParty, True)
    #答题经验更新
    PlayerControl.PlayerControl(curPlayer).AddExp(addExp)
    
    exp = gameWorld.GetGameWorldDictByKey(FBPlayerDict_TotalExp%playerID)
    expPoint = gameWorld.GetGameWorldDictByKey(FBPlayerDict_TotalExpPoint%playerID)
    totalExp = expPoint * ChConfig.Def_PerPointValue + exp
    updTotalExp = totalExp + addExp
    updExp = updTotalExp % ChConfig.Def_PerPointValue
    updExpPoint = updTotalExp / ChConfig.Def_PerPointValue
    gameWorld.SetGameWorldDict(FBPlayerDict_TotalExp % playerID, updExp)
    gameWorld.SetGameWorldDict(FBPlayerDict_TotalExpPoint % playerID, updExpPoint)
    DoFBHelp(curPlayer, 0)
    curAnswerCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyPartyAnswerCnt)
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyPartyAnswerCnt, curAnswerCnt+1)
    if GameWorld.GetMap().GetMapID() == ChConfig.Def_FBMapID_FamilyParty:
        DoFBHelp(curPlayer, 0)
    return
@@ -319,22 +311,29 @@
    gameWorld = GameWorld.GetGameWorld()
    playerID = curPlayer.GetPlayerID()
    totalExp = FBCommon.GetFBAreaRewardExp(gameWorld, playerID)
    curAnswerCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyPartyAnswerCnt)
    addPoint, addExp = IpyGameDataPY.GetFuncEvalCfg('PartyReward',2)
    exp = gameWorld.GetGameWorldDictByKey(FBPlayerDict_TotalExp%playerID)
    expPoint = gameWorld.GetGameWorldDictByKey(FBPlayerDict_TotalExpPoint%playerID)
    totalExp = totalExp + expPoint * ChConfig.Def_PerPointValue + exp
    totalExp = totalExp + expPoint * ChConfig.Def_PerPointValue + exp + addExp * curAnswerCnt
    exp = totalExp % ChConfig.Def_PerPointValue
    expPoint = totalExp / ChConfig.Def_PerPointValue
    
    totalPoint = gameWorld.GetGameWorldDictByKey(FBPlayerDict_TotalPoint%playerID)
    totalPoint += IpyGameDataPY.GetFuncCfg('PartyReward') #加参与奖
    totalPoint += addPoint * curAnswerCnt
    hasCollect = gameWorld.GetGameWorldDictByKey(FBPlayerDict_HasCollect%playerID)
    getCnt = gameWorld.GetGameWorldDictByKey(ChConfig.Map_Player_AreaReward_GetCnt%playerID)
    isFull = 1 if getCnt >= IpyGameDataPY.GetFuncCfg('FamilyPartyAreaAward', 3) else 0
    helpDict = {FBCommon.Help_exp:exp, FBCommon.Help_expPoint:expPoint,FBCommon.Help_score:totalPoint, "hasCollect":hasCollect, "isFullExp":isFull}
    if PyGameData.g_familyPartyInfo:
        rankList = []
        for i, info in enumerate(PyGameData.g_familyPartyInfo[0], 1):
            rankList.append({"rank":i, "name":info[1], "cnt":info[2]})
        helpDict['familyPartyRank'] = rankList
        helpDict['familyPartyTop'] = {'name':PyGameData.g_familyPartyInfo[1], "cnt":PyGameData.g_familyPartyInfo[2]}
    GameWorld.DebugLog("DoFBHelp %s" % helpDict, playerID)
    FBCommon.Notify_FBHelp(curPlayer, helpDict)
    return