From 5faab9df624b3bf4344d1e116bf80e163aa98b23 Mon Sep 17 00:00:00 2001 From: xdh <xiefantasy@qq.com> Date: 星期三, 13 三月 2019 18:00:53 +0800 Subject: [PATCH] 6307 【后端】【2.0】多套装备开发单(外观通知修改) --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyWar.py | 45 +++++++++++++++++++++++++++++++++------------ 1 files changed, 33 insertions(+), 12 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyWar.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyWar.py index d1dfe7f..219316f 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyWar.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyWar.py @@ -28,6 +28,7 @@ import ChPyNetSendPack import GameWorldProcess import PlayerDienstgrad +import PlayerWeekParty import IpyGameDataPY import PlayerFamily import NetPackCommon @@ -521,7 +522,7 @@ if not FBCommon.GetHadDelTicket(curPlayer): FBCommon.SetHadDelTicket(curPlayer) FBCommon.AddEnterFBCount(curPlayer, ChConfig.Def_FBMapID_FamilyWar) - + PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_FamilyWar, 1) isFinalMatch = gameFB.GetGameFBDictByKey(GameFBDict_IsFinalMatch) roundNum = gameFB.GetGameFBDictByKey(GameFBDict_RoundNum) groupID = gameFB.GetGameFBDictByKey(GameFBDict_GroupID) @@ -757,8 +758,12 @@ warPlayer = GetFamilyWarPlayer(playerID) warPlayer.calcFightTimeTick = tick + faction = curPlayer.GetFaction() + if not faction: + GameWorld.Log("还未设置阵营的玩家暂不处理!可能是DoEnter中!", playerID) + continue # 检查坐标,防止作弊 - factionIndex = GetFactionIndex(curPlayer.GetFaction()) + factionIndex = GetFactionIndex(faction) centrePosX, centrePosY, radius = factionAreaInfo[factionIndex] curPosX, curPosY = curPlayer.GetPosX(), curPlayer.GetPosY() dist = GameWorld.GetDist(curPosX, curPosY, centrePosX, centrePosY) @@ -767,8 +772,8 @@ if dist > maxDist: posPoint = GameMap.GetEmptyPlaceInArea(centrePosX, centrePosY, radius) curPlayer.ResetPos(posPoint.GetPosX(), posPoint.GetPosY()) - GameWorld.DebugLog("玩家不在营地范围内,强制拉回!curPos=(%s,%s),centerPos=(%s,%s), dist=%s > maxDist=%s" - % (curPosX, curPosY, centrePosX, centrePosY, dist, maxDist)) + GameWorld.Log("玩家不在营地范围内,强制拉回!faction=%s,curPos=(%s,%s),centerPos=(%s,%s), dist=%s > maxDist=%s" + % (faction, curPosX, curPosY, centrePosX, centrePosY, dist, maxDist), playerID) return def __DoLogic_FB_Fighting(tick): @@ -974,24 +979,36 @@ awardPer = awardPerList[-1] else: awardPer = awardPerList[groupID - 1] - rankAwardDictCopy = copy.deepcopy(rankAwardDict) - for itemList in rankAwardDictCopy.values(): - for itemInfo in itemList: - itemInfo[1] = max(1, int(itemInfo[1] * awardPer / 100.0)) + rankAwardDictCopy = {} + for rank, itemList in rankAwardDict.items(): + copyItemList = [] + for itemID, itemCount, isBind, isPer in itemList: + if isPer: # 奖励个数是否受百分比影响, 默认受影响 + copyItemList.append([itemID, max(1, int(itemCount * awardPer / 100.0)), isBind]) + else: + copyItemList.append([itemID, itemCount, isBind]) + rankAwardDictCopy[rank] = copyItemList # 最高级别联赛第一名额外奖励 winnerFirstAwardEx = [] # 获胜方第一名额外奖励 - firstAwardEx = [] + loserFirstAwardEx = [] # 失败方第一名额外奖励 + firstAwardEx, firstAwardEx2= [], [] if groupID == FamilyWar_MaxGroupID: worldLv = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_WorldAverageLv) if isFinalMatch: firstAwardExDict = IpyGameDataPY.GetFuncEvalCfg("FamilyMatchSRankOneReward", 1) + firstAwardExDict2 = IpyGameDataPY.GetFuncEvalCfg("FamilyMatchSRankOneReward", 2) else: firstAwardExDict = IpyGameDataPY.GetFuncEvalCfg("FamilyMatchRankOneReward", 1) + firstAwardExDict2 = IpyGameDataPY.GetFuncEvalCfg("FamilyMatchRankOneReward", 2) firstAwardEx = GameWorld.GetOrderValueByDict(firstAwardExDict, worldLv) firstAwardEx = [] if not firstAwardEx else firstAwardEx - GameWorld.Log("最高级别联赛第一名额外奖励: firstAwardEx=%s,firstAwardExDict=%s,worldLv=%s" + GameWorld.Log("最高级别联赛胜者第一名额外奖励: firstAwardEx=%s,firstAwardExDict=%s,worldLv=%s" % (firstAwardEx, firstAwardExDict, worldLv), lineID) + firstAwardEx2 = GameWorld.GetOrderValueByDict(firstAwardExDict2, worldLv) + firstAwardEx2 = [] if not firstAwardEx2 else firstAwardEx2 + GameWorld.Log("最高级别联赛败者第一名额外奖励: firstAwardEx2=%s,firstAwardExDict2=%s,worldLv=%s" + % (firstAwardEx2, firstAwardExDict2, worldLv), lineID) GameWorld.Log("名次奖励配置: rankAwardDict=%s,awardPer=%s,rankAwardDictCopy=%s,firstAwardEx=%s,joinAwardItemList=%s" % (rankAwardDict, awardPer, rankAwardDictCopy, firstAwardEx, joinAwardItemList), lineID) @@ -1012,6 +1029,10 @@ awardItemList = rankItemList + winnerFirstAwardEx # <color=#44e863FF>%s0</color>在仙盟联赛中表现优异,获得额外<color=#44e863FF><Word info=item id=%s1/></color>奖励 PlayerControl.WorldNotify(0, "FamilyMatchRankNoOne", [warPlayer.name, winnerFirstAwardEx[0][0]]) + elif firstAwardEx2 and not loserFirstAwardEx and warPlayer.familyID != winnerFamilyID: + loserFirstAwardEx = firstAwardEx2 + awardItemList = rankItemList + loserFirstAwardEx + PlayerControl.WorldNotify(0, "FamilyMatchRankNoOneLose", [warPlayer.name, loserFirstAwardEx[0][0]]) else: awardItemList = rankItemList playerID = warPlayer.playerID @@ -1259,7 +1280,7 @@ # @param tick 时间戳 # @return 无意义 # @remarks -def OnCollectOK(curPlayer, tick): +def OnCollectOK(curPlayer, npcID, tick): tagObj = curPlayer.GetActionObj() if not tagObj: return @@ -1466,7 +1487,7 @@ Sync_ChampionFamilyDailyRewardState(curPlayer) for itemID, itemCnt, isBind in itemList: - ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, isBind, [IPY_GameWorld.rptItem]) + ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, 0, [IPY_GameWorld.rptItem]) GameWorld.DebugLog("领取王者仙盟每日俸禄: itemList=%s" % itemList, playerID) return -- Gitblit v1.8.0