From d6641e24bb33be9a0aad206dc12701f1ff5fcbb5 Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期三, 16 十月 2019 15:19:01 +0800 Subject: [PATCH] 8262 【主干】【后端】仙盟宴会及传功优化(答题改为立即给每题奖励,只要在宴会地图即可获得奖励) 去除boss首杀记录查询CD --- ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyParty.py | 55 ++++++++++++++++++--------- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_FamilyPartyAnswer.py | 4 +- ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerUniversalGameRec.py | 2 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyParty.py | 30 +++++++++++++-- 4 files changed, 65 insertions(+), 26 deletions(-) diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyParty.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyParty.py index 43317e3..f6b51be 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyParty.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyParty.py @@ -121,24 +121,31 @@ PlayerControl.WorldNotify(0, 'Party_TopPlayer', [topHeroName]) #给参与奖励 - joinReward = IpyGameDataPY.GetFuncEvalCfg('PartyReward') - answerRWItemReward = IpyGameDataPY.GetFuncEvalCfg('PartyReward2', 1) - for playerID, ansRightCount in PyGameData.g_partyheroAnswerDict.items(): - if answerRWItemReward and len(answerRWItemReward) == 2: - ansTotalCount = len(PyGameData.g_familyAnswerPlayerIDDict.get(playerID, [])) - ansWrongCount = max(0, ansTotalCount - ansRightCount) - isAuctionItem = False - rightRewardEx, wrongRewardEx = [], [] - rightItemID, wrongItemID = answerRWItemReward - if rightItemID and ansRightCount: - rightRewardEx = [(rightItemID, ansRightCount, isAuctionItem)] - if wrongItemID and ansWrongCount: - wrongRewardEx = [(wrongItemID, ansWrongCount, isAuctionItem)] - curJoinReward = joinReward + rightRewardEx + wrongRewardEx - else: - curJoinReward = joinReward + joinPlayerIDList = PyGameData.g_partyheroAnswerDict.keys() + if joinPlayerIDList: + joinReward = IpyGameDataPY.GetFuncEvalCfg('PartyReward') if joinReward: - PlayerCompensation.SendMailByKey('FamilyParty', [playerID], curJoinReward) + PlayerCompensation.SendMailByKey('FamilyParty', joinPlayerIDList, joinReward) + + #修改为答完题直接给每题奖励 +# joinReward = IpyGameDataPY.GetFuncEvalCfg('PartyReward') +# answerRWItemReward = IpyGameDataPY.GetFuncEvalCfg('PartyReward2', 1) +# for playerID, ansRightCount in PyGameData.g_partyheroAnswerDict.items(): +# if answerRWItemReward and len(answerRWItemReward) == 2: +# ansTotalCount = len(PyGameData.g_familyAnswerPlayerIDDict.get(playerID, [])) +# ansWrongCount = max(0, ansTotalCount - ansRightCount) +# isAuctionItem = False +# rightRewardEx, wrongRewardEx = [], [] +# rightItemID, wrongItemID = answerRWItemReward +# if rightItemID and ansRightCount: +# rightRewardEx = [(rightItemID, ansRightCount, isAuctionItem)] +# if wrongItemID and ansWrongCount: +# wrongRewardEx = [(wrongItemID, ansWrongCount, isAuctionItem)] +# curJoinReward = joinReward + rightRewardEx + wrongRewardEx +# else: +# curJoinReward = joinReward +# if joinReward: +# PlayerCompensation.SendMailByKey('FamilyParty', [playerID], curJoinReward) return @@ -196,6 +203,15 @@ answer = answer.replace('[', '') answer = answer.replace(']', '') PlayerControl.FamilyNotify(familyID, 'Party_Correct', [maxSecond, GameWorld.GbkToCode(answer)]) + + for index in xrange(family.GetCount()): + member = family.GetAt(index) + memPlayer = member.GetPlayer() + if memPlayer and memPlayer.GetMapID() == ChConfig.Def_FBMapID_FamilyParty: + rightPlayerID = 0 + answerInfo = str([rightPlayerID]) + memPlayer.MapServer_QueryPlayerResult(0, 0, "FamilyPartyAnswer", answerInfo, len(answerInfo)) + break else: continue answerTick = gameWorld.GetDictByKey(FamilyPartyFB_AnswerTick % familyID) @@ -294,7 +310,8 @@ PyGameData.g_familyPartyTopInfo = [playerID, playerName] msgList = [__GetFamilyAnswerRankList(), PyGameData.g_familyPartyTopInfo[1], PyGameData.g_partyheroAnswerDict[PyGameData.g_familyPartyTopInfo[0]]] GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_FamilyPartyInfo, msgList) - #通知玩家可获得贡献 - curPlayer.MapServer_QueryPlayerResult(0, 0, "FamilyPartyAnswer", '', 0) + #通知答题结果 + answerInfo = str([playerID]) + curPlayer.MapServer_QueryPlayerResult(0, 0, "FamilyPartyAnswer", answerInfo, len(answerInfo)) return diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerUniversalGameRec.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerUniversalGameRec.py index 5e77d91..2d3c890 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerUniversalGameRec.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerUniversalGameRec.py @@ -144,7 +144,7 @@ curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index) viewType = clientData.ViewType # 查看记录的类型 - if viewType not in [ShareDefine.Def_UniversalGameRecType_FamilyWarChampion]: + if viewType not in [ShareDefine.Def_UniversalGameRecType_FamilyWarChampion, ShareDefine.Def_UniversalGameRecType_BossFirstKill]: if not GameWorld.RefurbishPlayerTick(curPlayer, ChConfig.TYPE_Player_Tick_Def_ViewUniversalGameRec, tick): #间隔未到 return diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyParty.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyParty.py index 13e8a72..d602892 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyParty.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyParty.py @@ -187,18 +187,40 @@ return -def FamilyPartyAnswerRight(curPlayer): +def FamilyPartyAnswerRight(curPlayer, answerInfo): #回答正确,给奖励 + + rightPlayerID = answerInfo[0] + + #给本题答题奖励,本地图中的家族成员才给 + answerRWItemReward = IpyGameDataPY.GetFuncEvalCfg('PartyReward2', 1) + rightItemID, wrongItemID = answerRWItemReward + playerManager = GameWorld.GetMapCopyPlayerManager() + for index in xrange(playerManager.GetPlayerCount()): + player = playerManager.GetPlayerByIndex(index) + if not player: + continue + if player.GetFamilyID() != curPlayer.GetFamilyID(): + continue + if player.GetPlayerID() == rightPlayerID: + giveItemID = rightItemID + else: + giveItemID = wrongItemID + itemCount, isAuctionItem = 1, False + ItemControler.GivePlayerItem(player, giveItemID, itemCount, isAuctionItem, [IPY_GameWorld.rptItem]) + + if curPlayer.GetPlayerID() != rightPlayerID: + return addPoint, addExp = IpyGameDataPY.GetFuncEvalCfg('PartyReward', 2) #仙盟贡献度 PlayerFamily.AddPlayerFamilyActiveValue(curPlayer, addPoint, True, ShareDefine.Def_AddFAVReason_FamilyParty, True) #答题经验更新 PlayerControl.PlayerControl(curPlayer).AddExp(addExp, ShareDefine.Def_ViewExpType_SysEx) - PlayerControl.FamilyNotify(curPlayer.GetFamilyID(), 'Party_Answer', [curPlayer.GetName()]) + PlayerControl.FamilyNotify(curPlayer.GetFamilyID(), 'Party_Answer', [curPlayer.GetName(), rightItemID]) curAnswerCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyPartyAnswerCnt) - PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyPartyAnswerCnt, curAnswerCnt + 1) - + PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyPartyAnswerCnt, curAnswerCnt + 1) + if GameWorld.GetMap().GetMapID() == ChConfig.Def_FBMapID_FamilyParty: DoFBHelp(curPlayer, 0) return diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_FamilyPartyAnswer.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_FamilyPartyAnswer.py index 363120c..3190e7f 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_FamilyPartyAnswer.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_FamilyPartyAnswer.py @@ -15,7 +15,6 @@ #"""Version = 2016-08-12 21:00""" #--------------------------------------------------------------------- import GameWorld -import IPY_GameWorld import GameLogic_FamilyParty #--------------------------------------------------------------------- @@ -37,8 +36,9 @@ # @return None def DoResult(curPlayer, callFunName, funResult, tick): playerID = curPlayer.GetPlayerID() + answerInfo = eval(funResult) GameWorld.DebugLog("GY_Query_FamilyPartyAnswer funResult=%s" % funResult, playerID) - GameLogic_FamilyParty.FamilyPartyAnswerRight(curPlayer) + GameLogic_FamilyParty.FamilyPartyAnswerRight(curPlayer, answerInfo) return -- Gitblit v1.8.0