|  |  |  | 
|---|
|  |  |  | import PlayerFairyCeremony | 
|---|
|  |  |  | import EventReport | 
|---|
|  |  |  | import PyGameData | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import ItemCommon | 
|---|
|  |  |  | import ItemControler | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #当前副本地图的状态 | 
|---|
|  |  |  | ( | 
|---|
|  |  |  | 
|---|
|  |  |  | FBCommon.SetFBStep(FB_Step_Fighting, tick) | 
|---|
|  |  |  | 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) | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | def OnFamilyPartyStateChange(state, tick): | 
|---|
|  |  |  | #活动状态变更 | 
|---|
|  |  |  | GameWorld.DebugLog('    仙盟宴会活动状态变更 state=%s'%state) | 
|---|
|  |  |  | #    if state == 0: | 
|---|
|  |  |  | #        playerManager = GameWorld.GetPlayerManager() | 
|---|
|  |  |  | #        for i in xrange(playerManager.GetPlayerCount()): | 
|---|
|  |  |  | #            curPlayer = playerManager.GetPlayerByIndex(i) | 
|---|
|  |  |  | #            if not curPlayer or curPlayer.IsEmpty(): | 
|---|
|  |  |  | #                continue | 
|---|
|  |  |  | #            #答对题或者进过图的给参与奖励 | 
|---|
|  |  |  | #            curAnswerCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyPartyAnswerCnt) | 
|---|
|  |  |  | #            if FBCommon.GetEnterFBCount(curPlayer, ChConfig.Def_FBMapID_FamilyParty) or curAnswerCnt: | 
|---|
|  |  |  | #                GiveJoinPrize(curPlayer) | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | mapID = GameWorld.GetMap().GetMapID() | 
|---|
|  |  |  | if mapID != ChConfig.Def_FBMapID_FamilyParty: | 
|---|
|  |  |  | return | 
|---|
|  |  |  | GameWorld.DebugLog('    仙盟宴会活动状态变更 state=%s'%state) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if state == 1: | 
|---|
|  |  |  | GameWorld.GetGameWorld().SetGameWorldDict(Map_FamilyPartyFB_StartTick, tick) | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | def GiveJoinPrize(): | 
|---|
|  |  |  | #参与奖 | 
|---|
|  |  |  | joinAward = IpyGameDataPY.GetFuncCfg('PartyReward') | 
|---|
|  |  |  | if not joinAward: | 
|---|
|  |  |  | return | 
|---|
|  |  |  | copyMapPlayerManager = GameWorld.GetMapCopyPlayerManager() | 
|---|
|  |  |  | for i in xrange(copyMapPlayerManager.GetPlayerCount()): | 
|---|
|  |  |  |  | 
|---|
|  |  |  | curPlayer = copyMapPlayerManager.GetPlayerByIndex(i) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if curPlayer == None or curPlayer.IsEmpty(): | 
|---|
|  |  |  | continue | 
|---|
|  |  |  | PlayerFamily.AddPlayerFamilyActiveValue(curPlayer, joinAward, True, ShareDefine.Def_AddFAVReason_FamilyParty) | 
|---|
|  |  |  | return | 
|---|
|  |  |  | # | 
|---|
|  |  |  | #def GiveJoinPrize(curPlayer): | 
|---|
|  |  |  | #    #参与奖 | 
|---|
|  |  |  | #    joinAward = IpyGameDataPY.GetFuncCfg('PartyReward') | 
|---|
|  |  |  | #    if not joinAward: | 
|---|
|  |  |  | #        return | 
|---|
|  |  |  | # | 
|---|
|  |  |  | #    PlayerFamily.AddPlayerFamilyActiveValue(curPlayer, joinAward, True, ShareDefine.Def_AddFAVReason_FamilyParty) | 
|---|
|  |  |  | #    return | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | expPoint = totalExp / ChConfig.Def_PerPointValue | 
|---|
|  |  |  |  | 
|---|
|  |  |  | totalPoint = gameWorld.GetGameWorldDictByKey(FBPlayerDict_TotalPoint%playerID) | 
|---|
|  |  |  | totalPoint += IpyGameDataPY.GetFuncCfg('PartyReward') #加参与奖 | 
|---|
|  |  |  | #totalPoint += IpyGameDataPY.GetFuncCfg('PartyReward') #加参与奖 | 
|---|
|  |  |  | totalPoint += addPoint * curAnswerCnt | 
|---|
|  |  |  | hasCollect = gameWorld.GetGameWorldDictByKey(FBPlayerDict_HasCollect%playerID) | 
|---|
|  |  |  | getCnt = gameWorld.GetGameWorldDictByKey(ChConfig.Map_Player_AreaReward_GetCnt%playerID) | 
|---|
|  |  |  | 
|---|
|  |  |  | if hasCollect: | 
|---|
|  |  |  | PlayerControl.NotifyCode(curPlayer, 'Party_HadCollected') | 
|---|
|  |  |  | return | 
|---|
|  |  |  | needSpace = len(IpyGameDataPY.GetFuncEvalCfg('FamilyPartyDesk', 3)) | 
|---|
|  |  |  | packSpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem, needSpace) | 
|---|
|  |  |  | if needSpace > packSpace: | 
|---|
|  |  |  | PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_998371") | 
|---|
|  |  |  | return | 
|---|
|  |  |  | return True | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ##副本中,采集物需要Loading时间. | 
|---|
|  |  |  | 
|---|
|  |  |  | # @param tick 时间戳 | 
|---|
|  |  |  | # @return 无意义 | 
|---|
|  |  |  | # @remarks | 
|---|
|  |  |  | def OnCollectOK(curPlayer, tick): | 
|---|
|  |  |  | def OnCollectOK(curPlayer, npcID, tick): | 
|---|
|  |  |  | playerID = curPlayer.GetID() | 
|---|
|  |  |  | gameWorld = GameWorld.GetGameWorld() | 
|---|
|  |  |  | gameWorld.SetGameWorldDict(FBPlayerDict_HasCollect % playerID, 1) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | GameWorld.DebugLog('    宴会采集成功!', playerID) | 
|---|
|  |  |  | #给奖励 | 
|---|
|  |  |  | itemAward = IpyGameDataPY.GetFuncEvalCfg('FamilyPartyDesk', 3) | 
|---|
|  |  |  | for itemID, itemCount, isBind in itemAward: | 
|---|
|  |  |  | ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, isBind, [IPY_GameWorld.rptItem]) | 
|---|
|  |  |  | addPoint = IpyGameDataPY.GetFuncCfg('FamilyPartyDesk') | 
|---|
|  |  |  | PlayerControl.NotifyCode(curPlayer, 'Party_CollectSuccess', [addPoint]) | 
|---|
|  |  |  | PlayerFamily.AddPlayerFamilyActiveValue(curPlayer, addPoint, True, ShareDefine.Def_AddFAVReason_FamilyParty) | 
|---|