| | |
| | | import PyGameData
|
| | | import ItemCommon
|
| | | import ItemControler
|
| | | import Item_AddLV
|
| | | import PlayerTalk
|
| | | import PlayerActivity
|
| | | import PlayerWeekParty
|
| | | import PlayerTongTianLing
|
| | |
|
| | | #---战盟副本---
|
| | |
| | | GameWorld.DebugLog("重置仙盟宴会相关数据,含传功!", curPlayer.GetPlayerID())
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyPartyJoinSign, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyPartyAnswerCnt, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyPartySitState, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyPartyHelpSitCount, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyPartyCollectState, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyPartyTotalExp, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyPartyTotalExpPoint, 0)
|
| | |
| | | # @remarks 用于通知阵营比分条
|
| | | def DoFBHelp(curPlayer, tick, isSyncPlayerID=False):
|
| | | gameWorld = GameWorld.GetGameWorld()
|
| | | chuangongActionState = gameWorld.GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_DailyActionState % ShareDefine.DailyActionID_FamilyChuanGong)
|
| | | partyActionState = gameWorld.GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_DailyActionState % ShareDefine.DailyActionID_FamilyParty)
|
| | |
|
| | | playerID = curPlayer.GetPlayerID()
|
| | |
| | | #totalPoint += IpyGameDataPY.GetFuncCfg('PartyReward') #加参与奖
|
| | | totalPoint += addPoint * curAnswerCnt
|
| | | hasCollect = int(curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyPartyCollectState) or not partyActionState) # 非活动期间也同步已采集,前端根据此状态控制按钮显隐
|
| | | hasSit = int(curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyPartySitState) or not chuangongActionState) # 非活动期间也同步已传功,前端根据此状态控制按钮显隐
|
| | |
|
| | | helpDict = {FBCommon.Help_exp:exp, FBCommon.Help_expPoint:expPoint, FBCommon.Help_score:totalPoint, "hasCollect":hasCollect, "hasSit":hasSit}
|
| | | helpDict = {FBCommon.Help_exp:exp, FBCommon.Help_expPoint:expPoint, FBCommon.Help_score:totalPoint, "hasCollect":hasCollect}
|
| | | if PyGameData.g_familyPartyInfo:
|
| | | rankList = []
|
| | | for i, info in enumerate(PyGameData.g_familyPartyInfo[0], 1):
|
| | |
| | | # @return 无意义
|
| | | def DoExitFB(curPlayer, tick):
|
| | | global g_familyMapPlayerIDDict
|
| | | __GiveSitAward(curPlayer)
|
| | | lineID = GameWorld.GetGameWorld().GetLineID()
|
| | | playerID = curPlayer.GetID()
|
| | | if playerID in g_familyMapPlayerIDDict.get(lineID, []):
|
| | |
| | | # @param tick 当前时间
|
| | | # @return None
|
| | | def DoFBAction(curPlayer, actionType, actionInfo, tick):
|
| | | gameWorld = GameWorld.GetGameWorld()
|
| | | playerID = curPlayer.GetID()
|
| | | if actionType == 0: #邀请打坐
|
| | | tagPlayerID = actionInfo
|
| | | if curPlayer.GetPlayerAction() in [IPY_GameWorld.paSit, IPY_GameWorld.paPreparing]:
|
| | | GameWorld.DebugLog('邀请打坐,玩家已处于打坐或采集状态', playerID)
|
| | | return
|
| | | hasSit = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyPartySitState)
|
| | | if hasSit:
|
| | | GameWorld.Log('邀请打坐,玩家已打坐过一次', playerID)
|
| | | return
|
| | |
|
| | | copyMapPlayerManager = GameWorld.GetMapCopyPlayerManager()
|
| | | tagPlayer = copyMapPlayerManager.FindPlayerByID(tagPlayerID)
|
| | | if not tagPlayer:
|
| | | GameWorld.DebugLog('邀请%s打坐,该玩家不在副本里' % tagPlayerID, playerID)
|
| | | PlayerControl.NotifyCode(curPlayer, 'PartySitFail')
|
| | | return
|
| | | gameWorld.SetGameWorldDict(FBPlayerDict_TagPlayerID % playerID, tagPlayerID)
|
| | | curPlayer.StopMove()
|
| | | curPlayer.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: #打坐结束给奖励
|
| | | if not __GiveSitAward(curPlayer):
|
| | | return
|
| | |
|
| | | DoFBHelp(curPlayer, 0)
|
| | | |
| | |
|
| | | return
|
| | |
|
| | | def __GiveSitAward(curPlayer):
|
| | | #给打坐奖励
|
| | | gameWorld = GameWorld.GetGameWorld()
|
| | | playerID = curPlayer.GetID()
|
| | | hasSit = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyPartySitState)
|
| | | if hasSit:
|
| | | GameWorld.Log('打坐结束给奖励,玩家已打坐过一次', playerID)
|
| | | return
|
| | | if curPlayer.GetPlayerAction() != IPY_GameWorld.paSit:
|
| | | GameWorld.Log('打坐结束给奖励,玩家不在打坐状态', playerID)
|
| | | return
|
| | | curPlayer.Stand()
|
| | | 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)
|
| | | giveExp = eval(IpyGameDataPY.GetFuncCompileCfg('FamilyPartySitAward'))
|
| | | if giveExp:
|
| | | PlayerControl.PlayerControl(curPlayer).AddExp(giveExp, ShareDefine.Def_ViewExpType_SysEx)
|
| | | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyPartySitState, 1)
|
| | | PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_FamilyChuanGong)
|
| | | PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_FamilyChuanGong, 1)
|
| | | PlayerTongTianLing.AddTongTianTaskValue(curPlayer, ChConfig.TTLTaskType_ChuanGong, 1)
|
| | | DoFBHelp(curPlayer, 0)
|
| | | |
| | | #帮助传功奖励
|
| | | helpSitActivityAward = IpyGameDataPY.GetFuncEvalCfg('FamilyPartySitAward', 3)
|
| | | if helpSitActivityAward and len(helpSitActivityAward) == 2:
|
| | | helpFamilyActivity, maxHelpAwardCount = helpSitActivityAward
|
| | | helpThanks = IpyGameDataPY.GetFuncCfg('FamilyPartySitAward', 4) % (helpFamilyActivity, maxHelpAwardCount)
|
| | | sitThanks = helpThanks.decode(ShareDefine.Def_Game_Character_Encoding).encode(GameWorld.GetCharacterEncoding())
|
| | | tagPlayerID = gameWorld.GetGameWorldDictByKey(FBPlayerDict_TagPlayerID % playerID)
|
| | | PlayerTalk.TalkPrivateByID(curPlayer, tagPlayerID, sitThanks)
|
| | | tagPlayer = GameWorld.GetMapCopyPlayerManager().FindPlayerByID(tagPlayerID)
|
| | | if tagPlayer:
|
| | | helpCount = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyPartyHelpSitCount) + 1
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyPartyHelpSitCount, helpCount)
|
| | | GameWorld.DebugLog("帮助传功奖励: sitPlayerID=%s,tagPlayerID=%s,helpCount=%s" % (playerID, tagPlayerID, helpCount))
|
| | | if helpCount <= maxHelpAwardCount:
|
| | | PlayerControl.GiveMoney(tagPlayer, ShareDefine.TYPE_Price_FamilyActivity, helpFamilyActivity)
|
| | | |
| | | GameWorld.DebugLog(' 传功结束,giveLV=%s, giveExp=%s, worldlv=%s' % (giveLV, giveExp, worldlv))
|
| | | return True
|
| | |
|
| | | def DoAddFamilyMemberFamilyActivity(familyID, addFamilyActivity):
|
| | | playerManager = GameWorld.GetPlayerManager()
|