9341 【BT5】【主干】【后端】情缘系统(增加情缘副本;AB相互提亲优化聘礼ID取较高的)
# Conflicts:
# ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
# ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ItemControler.py
| | |
| | | Def_FBMapID_CrossGrasslandLing = 32040
|
| | | #è·¨æä»èå
|
| | | Def_FBMapID_CrossGrasslandXian = 32050
|
| | | #æ
ç¼å¯æ¬
|
| | | Def_FBMapID_Love = 31300
|
| | |
|
| | | #éè¦å·ä¸çBOSSç坿¬
|
| | | WorldBossFBMapIDList = [Def_FBMapID_SealDemon, Def_FBMapID_ZhuXianBoss, Def_FBMapID_DemonKing]
|
| | |
| | |
|
| | | # ç»é坿¬, æéä¼çæ
嵿éªè¯å
¶ä»éåå¯å¦è¿å
¥ï¼å¦å代表å人è¿å
¥
|
| | | if gameMap.GetMapFBType() == ChConfig.fbtTeam:
|
| | | if tagMapID == ChConfig.Def_FBMapID_Love:
|
| | | onlyDoubleTeam = IpyGameDataPY.GetFuncCfg("LoveFB", 1)
|
| | | if onlyDoubleTeam:
|
| | | if PlayerTeam.CheckTeamOnLineCount(curPlayer.GetTeam(), includeTJG=False) != 2:
|
| | | PlayerControl.NotifyCode(curPlayer, "OnlyTwoMemTeamCanEnter", [tagMapID])
|
| | | return
|
| | | PlayerTeam.OnEnterFBTeamAsk(curPlayer, PlayerTeam.TeamFBAskType_Enter, tagMapID, tagLineID, tick)
|
| | | return
|
| | |
|
| | |
| | | PyGameData.g_marryCandyInfo[(reqPlayerID, playerID)] = candyObj
|
| | | __SortCandy()
|
| | | Sync_CandyList(None, [candyObj])
|
| | | |
| | | PyGameData.g_marryReqInfo.pop(playerID, None) # å¯è½åå¨ç¸äºæäº²çæ
åµï¼å°è¯é¡ºä¾¿æèªèº«çæäº²è¯·æ±å é¤ï¼å ä¸ºå·²ç»æ ç¨äº
|
| | | return True
|
| | |
|
| | | def __SortCandy():
|
| | |
| | | GameWorld.Log("è礼æäº²æ¬¡æ°ä¸è¶³ï¼æ æ³æäº²! bridePriceID=%s,buyCount(%s) >= canBuyMax(%s)"
|
| | | % (bridePriceID, buyCount, canBuyMax), playerID)
|
| | | return
|
| | | |
| | | |
| | | curTime = int(time.time())
|
| | | if tagPlayerID in PyGameData.g_marryReqInfo:
|
| | | tagReqData = PyGameData.g_marryReqInfo[tagPlayerID]
|
| | | tagBridePriceID = tagReqData.bridePriceID
|
| | | if playerID == tagReqData.playerIDB and not __CheckMarryReqTimeout(tagReqData):
|
| | | GameWorld.Log("ç©å®¶æäº²æ¶ï¼ç®æ å好已ç»å
æè¿äº²ï¼ä¸å¨æææå
ï¼ç´æ¥æäº²ï¼tagPlayerID=%s" % tagPlayerID, playerID)
|
| | | if tagBridePriceID < bridePriceID:
|
| | | GameWorld.Log("ç©å®¶æäº²æ¶ï¼ç®æ å好已ç»å
æè¿äº²ï¼ä¸å¨æææå
ï¼ç´æ¥æäº²ï¼ä½¿ç¨å½åæäº²ç©å®¶è¾é«è礼ID为å! tagPlayerID=%s,tagBridePriceID=%s < bridePriceID=%s" |
| | | % (tagPlayerID, tagBridePriceID, bridePriceID), playerID)
|
| | | reqData = MarryReq()
|
| | | reqData.playerIDA = playerID
|
| | | reqData.playerIDB = tagPlayerID
|
| | | reqData.bridePriceID = bridePriceID
|
| | | reqData.reqTime = curTime
|
| | | PyGameData.g_marryReqInfo[playerID] = reqData
|
| | | if __DoMarryResponse(tagPlayer, curPlayer, playerID, 1):
|
| | | return
|
| | | GameWorld.Log("ç©å®¶æäº²æ¶ï¼ç®æ å好已ç»å
æè¿äº²ï¼ä¸å¨æææå
ï¼ç´æ¥æäº²ï¼tagPlayerID=%s,tagBridePriceID=%s,bridePriceID=%s" |
| | | % (tagPlayerID, tagBridePriceID, bridePriceID), playerID)
|
| | | if __DoMarryResponse(curPlayer, tagPlayer, tagPlayerID, 1):
|
| | | return
|
| | | else:
|
| | | GameWorld.DebugLog("å¯¹æ¹ææäº²ï¼ä½æ¯å¯¹è±¡ä¸ä¸æ ·æå·²è¶
æ¶ï¼ tagPlayerID=%s, timeout=%s" % (tagReqData.playerIDB, __CheckMarryReqTimeout(tagReqData)), playerID)
|
| | |
|
| | | curTime = int(time.time())
|
| | | if playerID not in PyGameData.g_marryReqInfo:
|
| | | reqData = MarryReq()
|
| | | PyGameData.g_marryReqInfo[playerID] = reqData
|
| | |
| | | return (teamLV == IPY_GameServer.tmlMemberCanCall or
|
| | | teamLV == IPY_GameServer.tmlLeader)
|
| | |
|
| | | def CheckTeamOnLineCount(curTeam):
|
| | | def CheckTeamOnLineCount(curTeam, includeTJG=True):
|
| | | ##è·å¾éä¼å©ä½å¨çº¿äººæ°
|
| | | |
| | | if not curTeam:
|
| | | return 0
|
| | | count = 0
|
| | | for i in xrange(curTeam.GetMemberCount()):
|
| | | curPlayer = curTeam.GetMemberPlayer(i)
|
| | | if curPlayer == None:
|
| | | continue
|
| | | if not includeTJG and PlayerControl.GetIsTJG(curPlayer):
|
| | | continue
|
| | | count += 1
|
| | | return count
|
| | |
|
| | |
| | |
|
| | | return
|
| | |
|
| | | def GetFBEveryoneDropInfo(curNPC):
|
| | | ## è·å坿¬æ¯äººæè½è®¾ç½®ä¿¡æ¯
|
| | | # @return: None or [ownerPlayerList, isOnlySelfSee]
|
| | | do_FBLogic_ID = __GetFBLogic_MapID(GameWorld.GetMap().GetMapID())
|
| | | |
| | | callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "GetFBEveryoneDropInfo"))
|
| | | |
| | | if callFunc:
|
| | | return callFunc(curNPC)
|
| | | |
| | | return
|
| | |
|
| | | ## Npcææ»NPC,
|
| | | # @param attackerï¼æ»å»æ¹:NPC
|
| | | # @param defenderï¼è¢«æçNPC
|
| | |
| | |
|
| | | return
|
| | |
|
| | |
|
| | | ## TDæªå°è¾¾ç»ç¹
|
| | | def OnTDNPCReachTheGoal(curNPC, tick):
|
| | | do_FBLogic_ID = __GetFBLogic_MapID(GameWorld.GetMap().GetMapID())
|
| | | |
| | | callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnTDNPCReachTheGoal"))
|
| | | |
| | | if callFunc:
|
| | | callFunc(curNPC, tick)
|
| | | |
| | | return
|
| | |
|
| | | ## å·æªéç¥
|
| | | # @param refreshMark
|
| | | # @return None
|
| | |
| | | itemDict['IsAuctionItem'] = int(itemInfo[2])
|
| | | elif isinstance(itemInfo, int):
|
| | | itemDict['ItemID'] = itemInfo
|
| | | elif isinstance(itemInfo, dict):
|
| | | itemDict = itemInfo
|
| | | else: #ç©åå®ä¾
|
| | | if not ItemCommon.CheckItemCanUse(itemInfo):
|
| | | continue
|
| | |
| | | for npcid, HPPer in npcDict.items():
|
| | | killList.append({"NPCID":npcid, "HPPer":HPPer})
|
| | | return killList
|
| | |
|
| | | def OnPickUpItem(curPlayer, curItem, tick, overFunc):
|
| | | mapItemType = curItem.GetType()
|
| | | if mapItemType != ChConfig.Def_ItemType_Money:
|
| | | playerID = curPlayer.GetID()
|
| | | isEquip = ItemCommon.CheckItemIsEquip(curItem)
|
| | | jsonItem = ItemCommon.GetJsonItem(curItem)
|
| | | if playerID in PyGameData.g_fbPickUpItemDict:
|
| | | if isEquip:
|
| | | PyGameData.g_fbPickUpItemDict[playerID].append(jsonItem)
|
| | | else:
|
| | | isIn = False
|
| | | for itemInfo in PyGameData.g_fbPickUpItemDict[playerID]:
|
| | | if itemInfo["ItemID"] == jsonItem["ItemID"] and itemInfo.get("IsBind") == jsonItem.get("IsBind"):
|
| | | itemInfo["Count"] = itemInfo.get("Count", 1)+ jsonItem.get("Count", 1)
|
| | | isIn = True
|
| | | break
|
| | | if not isIn:
|
| | | PyGameData.g_fbPickUpItemDict[playerID].append(jsonItem)
|
| | | else:
|
| | | PyGameData.g_fbPickUpItemDict[playerID] = [jsonItem]
|
| | | |
| | | if overFunc == None:
|
| | | return
|
| | | |
| | | playerItemCount = 0
|
| | | mapItemManager = GameWorld.GetMapItemManager()
|
| | | for index in xrange(mapItemManager.GetMapItemCount()):
|
| | | mapItem = mapItemManager.GetMapItemByIndex(index)
|
| | | if not mapItem or mapItem.IsEmpty():
|
| | | continue
|
| | | |
| | | # è¿æå±äºèªå·±çä¸è¥¿æ²¡æ¡ä¸éç¥ç»æ
|
| | | if mapItem.GetOwnerID() == curPlayer.GetPlayerID():
|
| | | playerItemCount += 1
|
| | | |
| | | isItemAllPickUp = (playerItemCount <= 1)
|
| | | if isItemAllPickUp:
|
| | | overFunc(curPlayer, tick)
|
| | | |
| | | return
|
| | | #---------------------------------------------------------------------
|
| | | def SyncDynamicBarrierState(barrierPointList, state, curPlayer=None):
|
| | | '''忥卿éç¢ç©æ¯å¦æææ§
|
| | |
| | | return GameWorld.GetDataByDigitPlace(enterCnt, lineBit)
|
| | | return enterCnt
|
| | |
|
| | | def AddFBCntByItem(curPlayer, itemID, mapID, addCnt):
|
| | | ## ç©åå¢å 坿¬æ¬¡æ°
|
| | | mapID = GetRecordMapID(mapID)
|
| | | itemAddCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ItemAddFbCnt % mapID)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_ItemAddFbCnt % mapID, itemAddCnt + addCnt)
|
| | | Sync_FBPlayerFBInfoData(curPlayer, mapID)
|
| | | PlayerControl.NotifyCode(curPlayer, 'AddActivityCount_1', [itemID, mapID, addCnt])
|
| | | OnFBCountChangeEffectRecoverCount(curPlayer, mapID)
|
| | | return
|
| | |
|
| | | ## å¢å ç©å®¶è¿å
¥å¯æ¬æ¬¡æ°
|
| | | # @param curPlayer ç©å®¶å®ä¾
|
| | | # @param fbID 坿¬id
|
| | |
| | | def BuyFBEnterCount(playerIndex, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(playerIndex)
|
| | | mapID = clientData.FBID
|
| | | if mapID == ChConfig.Def_FBMapID_Love:
|
| | | coupleID = PlayerControl.GetCoupleID(curPlayer)
|
| | | if not coupleID:
|
| | | GameWorld.DebugLog("没æä¼´ä¾£æ æ³è´ä¹°æ
ç¼å¯æ¬æ¬¡æ°!")
|
| | | return
|
| | | ipyData = GetFBIpyData(mapID)
|
| | | if not ipyData:
|
| | | return
|
| | |
| | | return
|
| | |
|
| | | if hasBuyCnt >= canBuyCnt:
|
| | | GameWorld.DebugLog("è´ä¹°æ¬¡æ°å·²ç»ç¨å®mapID=%s"%mapID)
|
| | | GameWorld.DebugLog("è´ä¹°æ¬¡æ°å·²ç»ç¨å®mapID=%s,buyTimesVIPPriID=%s,hasBuyCnt=%s >= canBuyCnt=%s" % (mapID, buyTimesVIPPriID, hasBuyCnt, canBuyCnt))
|
| | | return
|
| | | costGoldDict = IpyGameDataPY.GetFuncEvalCfg('BuyFBCntCost')
|
| | | costGold = costGoldDict.get(str(mapID), '0')
|
| | | costGold = eval(costGold)
|
| | | costMoneyList = PlayerControl.HaveMoneyEx(curPlayer, ShareDefine.TYPE_Price_Gold_Paper_Money, costGold)
|
| | | costMoneyTypeInfo = IpyGameDataPY.GetFuncEvalCfg('BuyFBCntCost', 2)
|
| | | costType = costMoneyTypeInfo.get(str(mapID), ShareDefine.TYPE_Price_Gold_Paper_Money)
|
| | | costMoneyList = PlayerControl.HaveMoneyEx(curPlayer, costType, costGold)
|
| | | #GameWorld.Log('costMoneyList=%s,costGold=%s'%(costMoneyList,costGold))
|
| | | if not costMoneyList:
|
| | | return
|
| | |
| | | Sync_FBPlayerFBBuyCount(curPlayer, [mapID])
|
| | | PlayerControl.NotifyCode(curPlayer, 'FBEnterTimeBuy', [mapID])
|
| | | OnFBCountChangeEffectRecoverCount(curPlayer, mapID)
|
| | | if mapID == ChConfig.Def_FBMapID_Love:
|
| | | coupleID = PlayerControl.GetCoupleID(curPlayer)
|
| | | if coupleID:
|
| | | addItemList = IpyGameDataPY.GetFuncEvalCfg("LoveFB", 3)
|
| | | paramList = [curPlayer.GetPlayerName()]
|
| | | PlayerControl.SendMailByKey("BuyLoveFBCntCoupleMail", [coupleID], addItemList, paramList)
|
| | | return
|
| | |
|
| | | def DoFuncOpen_RunDaily(curPlayer): return EventReport.WriteFuncCMEAcceptable(curPlayer, ShareDefine.GameFuncID_RunDaily)
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package GameWorldLogic.FBProcess.GameLogic_Love
|
| | | #
|
| | | # @todo:æ
ç¼å¯æ¬
|
| | | # @author hxp
|
| | | # @date 2021-11-24
|
| | | # @version 1.0
|
| | | #
|
| | | # è¯¦ç»æè¿°: æ
ç¼å¯æ¬
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2021-11-24 16:30"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import FBCommon
|
| | | import NPCCommon
|
| | | import ReadChConfig
|
| | | import IPY_GameWorld
|
| | | import PlayerControl
|
| | | import GameWorldProcess
|
| | | import ItemControler
|
| | | import IpyGameDataPY
|
| | | import PyGameData
|
| | | import GameWorld
|
| | | import ChConfig
|
| | |
|
| | | (
|
| | | Def_Time_MapPrepare, # å夿¶é´, ç§
|
| | | Def_Time_Fight, # æææ¶é´, ç§
|
| | | Def_Time_PickupItem, # æ¾åç©åæ¶é´, ç§
|
| | | Def_Time_Leave, # ç»ææ¶é´, ç§
|
| | | ) = range(4)
|
| | |
|
| | | #å½å坿¬å°å¾çç¶æ
|
| | | (
|
| | | FB_Step_Open, # å°å¾å¼å¯
|
| | | FB_Step_MapPrepare, # å°å¾åå¤
|
| | | FB_Step_Fighting, # ææä¸
|
| | | FB_Step_PickupItem, # æ¾åç©å
|
| | | FB_Step_LeaveTime, # èªç±éåºæ¶é´
|
| | | FB_Step_Over, # 坿¬å
³é
|
| | | ) = range(6)
|
| | |
|
| | | FB_CostTime = 'FB_CostTime' # è¿å
³èæ¶
|
| | | FBPlayerDict_EnterState = "FBPlayerDict_EnterState" # å·²è¿å
¥çç©å®¶ï¼åæ°
|
| | |
|
| | | TDRefreshNPCFileNum = ChConfig.Def_FBMapID_Love
|
| | |
|
| | | Def_Devil_TimeType = IPY_GameWorld.tttLeaveFamilyWar
|
| | |
|
| | | def OnOpenFB(tick):
|
| | | ##å¼å¯å¯æ¬
|
| | | return
|
| | |
|
| | | def OnCloseFB(tick):
|
| | | ##å
³é坿¬
|
| | | return
|
| | |
|
| | | def OnEnterFBEvent(curPlayer, mapID, lineID, tick):
|
| | | onlyDoubleTeam = IpyGameDataPY.GetFuncCfg("LoveFB", 1)
|
| | | if onlyDoubleTeam:
|
| | | if not curPlayer.GetTeamID():
|
| | | PlayerControl.NotifyCode(curPlayer, "OnlyTwoMemTeamCanEnter", [mapID])
|
| | | return False
|
| | | return True
|
| | |
|
| | | def GetPlayerResetWorldPosFBMsg(curPlayer, lineId):
|
| | | ## è·åå
¥åºæºå¸¦ä¿¡æ¯
|
| | | return ""
|
| | |
|
| | | def OnChangeMapAsk(ask, tick):
|
| | | ##æ¥è¯¢æ¯å¦å¯ä»¥è¿å
¥å°å¾
|
| | | return IPY_GameWorld.cmeAccept
|
| | |
|
| | | def OnGetFBEnterPos(curPlayer, mapID, lineId, ipyEnterPosInfo, tick):
|
| | | ##坿¬ç©å®¶è¿å
¥ç¹
|
| | | return ipyEnterPosInfo
|
| | |
|
| | | def DoEnterFB(curPlayer, tick):
|
| | | |
| | | gameFB = GameWorld.GetGameFB()
|
| | | fbStep = gameFB.GetFBStep()
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | |
| | | GameWorld.Log("DoEnterFB...", playerID)
|
| | | hadDelTicket = FBCommon.GetHadDelTicket(curPlayer)
|
| | | if not hadDelTicket:
|
| | | mapID = GameWorld.GetGameWorld().GetMapID()
|
| | | delResult = FBCommon.DelFBEnterTicket(curPlayer, mapID)
|
| | | isOK = delResult[0]
|
| | | #hasBind = delResult[1]
|
| | | if not isOK:
|
| | | PlayerControl.PlayerLeaveFB(curPlayer)
|
| | | return
|
| | | FBCommon.SetHadDelTicket(curPlayer)
|
| | | FBCommon.AddEnterFBCount(curPlayer, ChConfig.Def_FBMapID_Love)
|
| | | PyGameData.g_fbPickUpItemDict.pop(playerID, 0)
|
| | | gameFB.SetPlayerGameFBDict(playerID, FBPlayerDict_EnterState, 1)
|
| | | |
| | | if fbStep == FB_Step_Open:
|
| | | FBCommon.SetFBStep(FB_Step_MapPrepare, tick)
|
| | | |
| | | if fbStep <= FB_Step_MapPrepare:
|
| | | mapID = GameWorld.GetMap().GetMapID()
|
| | | notify_tick = FBCommon.GetFBLineStepTime(mapID)[Def_Time_MapPrepare] * 1000 - (tick - GameWorld.GetGameFB().GetFBStepTick())
|
| | | curPlayer.Sync_TimeTick(IPY_GameWorld.tttAddUpTime, 0, max(notify_tick, 0), True)
|
| | | curPlayer.Sync_TimeTick(IPY_GameWorld.tttWaitStart, 0, max(notify_tick, 0), True)
|
| | | |
| | | elif fbStep == FB_Step_Fighting:
|
| | | mapID = GameWorld.GetMap().GetMapID()
|
| | | notify_tick = FBCommon.GetFBLineStepTime(mapID)[Def_Time_Fight] * 1000 - (tick - GameWorld.GetGameFB().GetFBStepTick())
|
| | | curPlayer.Sync_TimeTick(IPY_GameWorld.tttTowerTake, 0, max(notify_tick, 0), True)
|
| | | FBCommon.UpdateFBGrade(tick, FBCommon.GetFBLineGrade(mapID), curPlayer)
|
| | | |
| | | DoFBHelp(curPlayer, tick)
|
| | | return
|
| | |
|
| | | def DoExitFB(curPlayer, tick):
|
| | | ##ç©å®¶éåºå¯æ¬
|
| | | return
|
| | |
|
| | | def DoPlayerLeaveFB(curPlayer, tick):
|
| | | ##ç©å®¶ä¸»å¨ç¦»å¼å¯æ¬.
|
| | | return
|
| | |
|
| | | def DoFBHelp(curPlayer, tick):
|
| | | wheelNum = None
|
| | | movePointDict = ReadChConfig.GetEvalChConfig('TD_%s_Move' % TDRefreshNPCFileNum)
|
| | | rMarkList = movePointDict.keys()
|
| | | gameFB = GameWorld.GetGameFB()
|
| | | for rMark in rMarkList:
|
| | | if wheelNum == None:
|
| | | wheelNum = gameFB.GetGameFBDictByKey(ChConfig.Map_TDNPC_RefreshBigWheelNum % rMark) + 1
|
| | | |
| | | #坿¬å¸®å©(éç¥å®¢æ·ç«¯æ¾ç¤º)
|
| | | fbHelpDict = {FBCommon.Help_wheel:wheelNum}
|
| | | GameWorld.DebugLog("DoFBHelp: %s" % fbHelpDict, curPlayer.GetPlayerID())
|
| | | FBCommon.Notify_FBHelp(curPlayer, fbHelpDict)
|
| | | return
|
| | |
|
| | | ##坿¬å®æ¶å¨
|
| | | # @param tick æ¶é´æ³
|
| | | # @return è¿å弿 æä¹
|
| | | # @remarks 坿¬å®æ¶å¨
|
| | | def OnProcess(tick):
|
| | | |
| | | fbStep = GameWorld.GetGameFB().GetFBStep()
|
| | | |
| | | if fbStep == FB_Step_MapPrepare:
|
| | | __DoLogic_MapPrepare(tick)
|
| | | elif fbStep == FB_Step_Fighting:
|
| | | __DoLogic_MapFighting(tick)
|
| | | elif fbStep == FB_Step_PickupItem:
|
| | | __DoLogic_PickupItem(tick)
|
| | | elif fbStep == FB_Step_LeaveTime:
|
| | | __DoLogic_MapLeave(tick)
|
| | | |
| | | return
|
| | |
|
| | | def __DoLogic_MapPrepare(tick):
|
| | | mapID = GameWorld.GetMap().GetMapID()
|
| | | timeInfo = FBCommon.GetFBLineStepTime(mapID)
|
| | | if tick - GameWorld.GetGameFB().GetFBStepTick() < timeInfo[Def_Time_MapPrepare] * 1000:
|
| | | return
|
| | | |
| | | FBCommon.SetFBStep(FB_Step_Fighting, tick)
|
| | | |
| | | movePointDict = ReadChConfig.GetEvalChConfig('TD_%s_Move' % TDRefreshNPCFileNum)
|
| | | rMarkList = movePointDict.keys()
|
| | | isNotify = True
|
| | | for rMark in rMarkList:
|
| | | FBCommon.OpenTDNPCRefresh(rMark, TDRefreshNPCFileNum, 0, tick, isNotify)
|
| | | if isNotify:
|
| | | isNotify = False
|
| | | |
| | | FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 0) # 强å¶åæ¥ä¸æ¬¡
|
| | | # éç¥å¼å§
|
| | | FBCommon.Sync_Player_TimeTick(IPY_GameWorld.tttTowerTake, timeInfo[Def_Time_Fight] * 1000)
|
| | | return
|
| | |
|
| | | def __DoLogic_MapFighting(tick):
|
| | | |
| | | mapID = GameWorld.GetMap().GetMapID()
|
| | | timeInfo = FBCommon.GetFBLineStepTime(mapID)
|
| | | # é´éæªå°
|
| | | if tick - GameWorld.GetGameFB().GetFBStepTick() < timeInfo[Def_Time_Fight] * 1000:
|
| | | #FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 5000)
|
| | | return
|
| | | |
| | | __DoOver(tick)
|
| | | return
|
| | |
|
| | | def __DoLogic_PickupItem(tick):
|
| | | mapItemCount = GameWorld.GetMapItemManager().GetMapItemCount()
|
| | | mapID = GameWorld.GetMap().GetMapID()
|
| | | timeInfo = FBCommon.GetFBLineStepTime(mapID)
|
| | | if mapItemCount and tick - GameWorld.GetGameFB().GetFBStepTick() < timeInfo[Def_Time_PickupItem] * 1000:
|
| | | return
|
| | | FBCommon.SetFBStep(FB_Step_LeaveTime, tick)
|
| | | |
| | | copyMapPlayerManager = GameWorld.GetMapCopyPlayerManager()
|
| | | for i in xrange(copyMapPlayerManager.GetPlayerCount()):
|
| | | curPlayer = copyMapPlayerManager.GetPlayerByIndex(i)
|
| | | if curPlayer == None or curPlayer.IsEmpty():
|
| | | continue
|
| | | DoOverToLeave(curPlayer, tick)
|
| | | |
| | | return
|
| | |
|
| | | def __DoLogic_MapLeave(tick):
|
| | | mapID = GameWorld.GetMap().GetMapID()
|
| | | timeInfo = FBCommon.GetFBLineStepTime(mapID)
|
| | | if tick - GameWorld.GetGameFB().GetFBStepTick() < timeInfo[Def_Time_Leave] * 1000:
|
| | | return
|
| | | FBCommon.SetFBStep(FB_Step_Over, tick)
|
| | | |
| | | # æ¶é´å°ï¼è¸¢åºè¿å¨å¯æ¬çç©å®¶ç...
|
| | | FBCommon.DoLogic_FBKickAllPlayer()
|
| | | #GameWorld.GetGameWorld().SetPropertyID(0)
|
| | | GameWorldProcess.CloseFB(tick)
|
| | | return
|
| | |
|
| | | def DoFBRebornNPC(curNPC, tick):
|
| | | ##坿¬æNPCå¬åº
|
| | | fromRefreshValue = curNPC.GetDictByKey(ChConfig.Def_NPC_Dict_FromRefreshValue)
|
| | | |
| | | if fromRefreshValue == TDRefreshNPCFileNum:
|
| | | curNPC.SetIsNeedProcess(True)
|
| | | FBCommon.UpdTDNPCCnt(curNPC, 1)
|
| | | |
| | | return
|
| | |
|
| | | def OnTDCurWheelOver(refreshMark, tick):
|
| | | movePointDict = ReadChConfig.GetEvalChConfig('TD_%s_Move' % TDRefreshNPCFileNum)
|
| | | rMarkList = movePointDict.keys()
|
| | | isWheelRefreshOver = FBCommon.IsTDWheelRefreshOver(rMarkList) # æ¬å¤§æ³¢ææç¹å·æªå®æ¯
|
| | | if isWheelRefreshOver:
|
| | | GameWorld.DebugLog("æ¬å¤§æ³¢ææç¹å·å®, 强å¶åæ¥ä¸æ¬¡æªç©æ°")
|
| | | FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 0) # 强å¶åæ¥ä¸æ¬¡
|
| | | |
| | | return
|
| | |
|
| | | def OnTDNPCReachTheGoal(curNPC, tick):
|
| | | #GameWorld.DebugLog("å°è¾¾ç»ç¹...")
|
| | | curNPC.SetVisible(False)
|
| | | NPCCommon.SetDeadEx(curNPC)
|
| | | return
|
| | |
|
| | | def GetFBEveryoneDropInfo(curNPC):
|
| | | ## è·å坿¬æ¯äººæè½è®¾ç½®ä¿¡æ¯
|
| | | # @return: None or [ownerPlayerList, isOnlySelfSee]
|
| | | |
| | | isOnlySelfSee = True
|
| | | ownerPlayerList = []
|
| | | playerManager = GameWorld.GetMapCopyPlayerManager()
|
| | | for index in xrange(playerManager.GetPlayerCount()):
|
| | | curPlayer = playerManager.GetPlayerByIndex(index)
|
| | | if not curPlayer:
|
| | | continue
|
| | | ownerPlayerList.append(curPlayer)
|
| | | |
| | | return ownerPlayerList, isOnlySelfSee
|
| | |
|
| | | #def DoFB_Npc_KillNPC(attacker, curNPC, tick):
|
| | | # __DoOnNPCKilled(attacker, curNPC, tick)
|
| | | # return
|
| | | #
|
| | | #def DoFB_Player_KillNPC(curPlayer, curNPC, tick):
|
| | | # __DoOnNPCKilled(curPlayer, curNPC, tick)
|
| | | # return
|
| | |
|
| | | def DoFB_NPCDead(curNPC):
|
| | | |
| | | fbStep = GameWorld.GetGameFB().GetFBStep()
|
| | | if fbStep != FB_Step_Fighting:
|
| | | return
|
| | | |
| | | fromRefreshValue = curNPC.GetDictByKey(ChConfig.Def_NPC_Dict_FromRefreshValue)
|
| | | # å
¥ä¾µæª
|
| | | if fromRefreshValue != TDRefreshNPCFileNum:
|
| | | return
|
| | | |
| | | FBCommon.UpdTDNPCCnt(curNPC, -1) # æªç©æ°-1
|
| | | |
| | | tick = GameWorld.GetGameWorld().GetTick()
|
| | | movePointDict = ReadChConfig.GetEvalChConfig('TD_%s_Move' % TDRefreshNPCFileNum)
|
| | | rMarkList = movePointDict.keys()
|
| | | isAllRefresh = FBCommon.IsTDNPCRefreshOver(rMarkList) # æææªæ¯å¦å
¨é¨å·å®
|
| | | isAllKilled = FBCommon.IsTDNPCCurWheelAllKilled(rMarkList) # æ¬æ³¢æªæ¯å¦å
¨é¨è¢«å»æ
|
| | | |
| | | if isAllRefresh and isAllKilled:
|
| | | GameWorld.DebugLog("å
¨é¨æªå·æ°å®æ¯ä¸å·²è¢«æå®, å¤çç»æé»è¾")
|
| | | __DoOver(tick)
|
| | | |
| | | elif isAllKilled:
|
| | | GameWorld.DebugLog("æ¬æ³¢æªå
¨é¨æå®ï¼è¿å
¥ä¸ä¸æ³¢ï¼")
|
| | | for index, rMark in enumerate(rMarkList):
|
| | | FBCommon.SetEnterTDNextWheel(rMark, tick, index == 0)
|
| | | #if index == 0:
|
| | | # FBCommon.Sync_TDNextWheelTick(None, rMark, Def_Devil_TimeType, tick)
|
| | | |
| | | FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 0) # æ³¢æ°åæ¢å¼ºå¶åæ¥ä¸æ¬¡
|
| | | |
| | | return
|
| | |
|
| | | def __DoOver(tick):
|
| | | # 坿¬ç»æé»è¾
|
| | | GameWorld.DebugLog("å¤ç坿¬ç»æé»è¾")
|
| | | costTime = tick - GameWorld.GetGameFB().GetFBStepTick()
|
| | | gameFB = GameWorld.GetGameFB()
|
| | | gameFB.SetGameFBDict(FB_CostTime, costTime)
|
| | | |
| | | FBCommon.SetFBStep(FB_Step_PickupItem, tick)
|
| | | |
| | | # æ¸
æª
|
| | | FBCommon.ClearFBNPC()
|
| | | FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 0) # 坿¬ç»æå¼ºå¶åæ¥ä¸æ¬¡
|
| | | |
| | | movePointDict = ReadChConfig.GetEvalChConfig('TD_%s_Move' % TDRefreshNPCFileNum)
|
| | | rMarkList = movePointDict.keys()
|
| | | # å
³éææå·æªç¹
|
| | | for rMark in rMarkList:
|
| | | FBCommon.CloseTDNPCRefresh(rMark, True)
|
| | | return
|
| | |
|
| | | def OnPickUpItem(curPlayer, curItem, tick):
|
| | | FBCommon.OnPickUpItem(curPlayer, curItem, tick, None)
|
| | | return
|
| | |
|
| | | def DoOverToLeave(curPlayer, tick):
|
| | | isPass = 1
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | mapID = GameWorld.GetMap().GetMapID()
|
| | | gameFB = GameWorld.GetGameFB()
|
| | | leaveTick = FBCommon.GetFBLineStepTime(mapID)[Def_Time_Leave] * 1000
|
| | | curPlayer.Sync_TimeTick(IPY_GameWorld.tttLeaveMap, 0, leaveTick, True)
|
| | | |
| | | costTime = gameFB.GetGameFBDictByKey(FB_CostTime)
|
| | | |
| | | pickupItemList = PyGameData.g_fbPickUpItemDict.get(playerID, [])
|
| | | coupleID = PlayerControl.GetCoupleID(curPlayer)
|
| | | coupleEnterState = gameFB.GetPlayerGameFBDictByKey(coupleID, FBPlayerDict_EnterState) if coupleID else 0
|
| | | if coupleEnterState:
|
| | | coupleAwardListEx = IpyGameDataPY.GetFuncEvalCfg("LoveFB", 2)
|
| | | ItemControler.GivePlayerItemOrMail(curPlayer, coupleAwardListEx)
|
| | | pickupItemList.extend(coupleAwardListEx)
|
| | | |
| | | overDict = {FBCommon.Over_dataMapID:mapID, FBCommon.Over_isPass:isPass, FBCommon.Over_costTime:costTime, |
| | | FBCommon.Over_itemInfo:FBCommon.GetJsonItemList(pickupItemList)}
|
| | | FBCommon.Notify_FB_Over(curPlayer, overDict)
|
| | | GameWorld.Log("ç»ç®: coupleID=%s,coupleEnterState=%s,overDict=%s" % (coupleID, coupleEnterState, overDict), playerID)
|
| | | return
|
| | |
|
| | |
|
| | |
| | |
|
| | | import ItemCommon
|
| | | import FBCommon
|
| | | import PlayerControl
|
| | | import ChConfig
|
| | |
|
| | | def BatchUseItem(curPlayer, curRoleItem, tick, useCnt, exData):
|
| | |
| | | itemTypeID = curRoleItem.GetItemTypeID()
|
| | | curEff = curRoleItem.GetEffectByIndex(0)
|
| | | mapID = curEff.GetEffectValue(0)
|
| | | mapID = FBCommon.GetRecordMapID(mapID)
|
| | | itemAddCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ItemAddFbCnt % mapID)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_ItemAddFbCnt % mapID, itemAddCnt+useCnt)
|
| | | |
| | | FBCommon.AddFBCntByItem(curPlayer, itemTypeID, mapID, useCnt)
|
| | | ItemCommon.DelItem(curPlayer, curRoleItem, useCnt, True, ChConfig.ItemDel_AddFBCnt)
|
| | | FBCommon.Sync_FBPlayerFBInfoData(curPlayer, mapID)
|
| | | PlayerControl.NotifyCode(curPlayer, 'AddActivityCount_1', [itemTypeID, mapID, useCnt])
|
| | | |
| | | FBCommon.OnFBCountChangeEffectRecoverCount(curPlayer, mapID)
|
| | | return True, useCnt
|
| | |
|
| | |
| | | import PetControl
|
| | | import ReadChConfig
|
| | | import GameObj
|
| | | import FBLogic
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
| | | return
|
| | |
|
| | |
|
| | | def NPCMoveByPointList(curNPC, movePointList):
|
| | | def NPCMoveByPointList(curNPC, movePointList, tick):
|
| | | if not movePointList:
|
| | | return
|
| | | pointIndex = curNPC.GetDictByKey(ChConfig.Def_NPC_Dict_MovePointIndex)
|
| | |
| | |
|
| | | curNPC.Move(destPosX, destPosY)
|
| | | return
|
| | | |
| | | # å°è¾¾ç»ç¹
|
| | | if pointIndex == (len(movePointList) - 1):
|
| | | FBLogic.OnTDNPCReachTheGoal(curNPC, tick)
|
| | | |
| | | return
|
| | |
|
| | |
| | | MovePointList = movePointDict[fromRefreshMark]
|
| | |
|
| | | #NpcMoveByMovePointList(curNPC, MovePointList, tick)
|
| | | AICommon.NPCMoveByPointList(curNPC, MovePointList)
|
| | | AICommon.NPCMoveByPointList(curNPC, MovePointList, tick)
|
| | | return
|
| | |
|
| | | ## 女ç¥å¯æ¬çæ®éæ£æ¥
|
| | |
| | | #GameWorld.DebugLog("ç§æç©åæè½: dropItemID=%s" % dropItemID, ownerPlayer.GetPlayerID())
|
| | |
|
| | | return specDropItemList
|
| | |
|
| | | def __NPCDropItemByPlayers(self, dropPlayerList, mapID, ipyDrop):
|
| | | '''NPCæè½ç©å, å¤ç©å®¶æ¯äººä¸ä»½, æ··åæè½'''
|
| | | curNPC = self.__Instance
|
| | | npcID = curNPC.GetNPCID()
|
| | | if not dropPlayerList:
|
| | | return
|
| | | |
| | | #GameWorld.DebugLog("NPCå¤ç©å®¶æ··åæè½: dropPlayerCount=%s" % len(dropPlayerList))
|
| | | auctionItemIDList = []
|
| | | dropItemList = []
|
| | | for dropPlayer in dropPlayerList:
|
| | | dropInfo = GetNPCDropInfo(dropPlayer, mapID, npcID, ipyDrop=ipyDrop)
|
| | | if not dropInfo:
|
| | | continue
|
| | | dropIDList, auctionIDList, dropMoneyCnt, moneyValue = dropInfo
|
| | | moneyID = self.__GetDropMoneyModelID(moneyValue)
|
| | | if dropMoneyCnt:
|
| | | dropIDList += [moneyID] * dropMoneyCnt
|
| | | |
| | | dropPlayerID = dropPlayer.GetPlayerID()
|
| | | #GameWorld.DebugLog(" dropPlayerID=%s,dropIDList=%s" % (dropPlayerID, dropIDList))
|
| | | for dropID in dropIDList:
|
| | | dropItemList.append([dropID, dropPlayerID])
|
| | | auctionItemIDList += auctionIDList
|
| | | |
| | | #æä¹±ç©å顺åº
|
| | | random.shuffle(dropItemList)
|
| | | |
| | | gameMap = GameWorld.GetMap()
|
| | | dropPosX, dropPosY = curNPC.GetPosX(), curNPC.GetPosY() # 以NPC为ä¸å¿ç¹å¼å§æè½
|
| | | index = 0
|
| | | for posX, posY in ChConfig.Def_DropItemAreaMatrix:
|
| | | resultX = dropPosX + posX
|
| | | resultY = dropPosY + posY
|
| | | |
| | | if not gameMap.CanMove(resultX, resultY):
|
| | | #ç©å®¶ä¸å¯ç§»å¨è¿ä¸ªç¹
|
| | | continue
|
| | | |
| | | if index > len(dropItemList) - 1:
|
| | | break |
| | | itemID, ownerID = dropItemList[index]
|
| | | index += 1
|
| | | itemCnt = moneyValue if itemID == moneyID else 1
|
| | | iaAuctionItem = itemID in auctionItemIDList
|
| | | curItem = self.__CreateDropItem(curNPC, itemID, itemCnt, iaAuctionItem, dropPlayer)
|
| | | if not curItem:
|
| | | continue
|
| | | self.__MapCreateItem(curItem, resultX, resultY, ChConfig.Def_NPCHurtTypePlayer, ownerID)
|
| | | |
| | | return
|
| | |
|
| | | ## ç©åæè½
|
| | | # @param self ç±»å®ä¾
|
| | |
| | | curWorldLV = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_WorldAverageLv)
|
| | | GameWorld.ErrLog("åä¸å°NPCæè½ä¿¡æ¯!npcID=%s,curWorldLV=%s" % (npcID, curWorldLV))
|
| | | return
|
| | | |
| | | #if mapID == ChConfig.Def_FBMapID_MunekadoTrial:
|
| | | # dropPlayerList = GameLogic_MunekadoTrial.GetCanDropPlayerList()
|
| | | # return self.__NPCDropItemByPlayers(dropPlayerList, mapID, ipyDrop)
|
| | |
|
| | | dropIDList, auctionIDList, dropMoneyCnt, moneyValue = [], [], 0, 0
|
| | | dropInfo = GetNPCDropInfo(dropPlayer, mapID, npcID, ownerPlayerList, ipyDrop, False)
|
| | |
| | | self.__KillNPCFuncEx(curPlayer, curNPC, maxHurtID, True)
|
| | | self.__ownerPlayerList = ownerPlayerList
|
| | |
|
| | | fbOwnerInfo = FBLogic.GetFBEveryoneDropInfo(curNPC)
|
| | | if fbOwnerInfo != None:
|
| | | ownerPlayerList, isOnlySelfSee = fbOwnerInfo |
| | | for curPlayer in ownerPlayerList:
|
| | | self.__NPCDropItem(curPlayer, ChConfig.Def_NPCHurtTypePlayer, curPlayer.GetPlayerID(), [curPlayer], isOnlySelfSee=isOnlySelfSee)
|
| | | #è°ç¨ç©åæè½ï¼bossä¸äººä¸ä»½
|
| | | if isGameBoss and hurtType in [ChConfig.Def_NPCHurtTypePlayer, ChConfig.Def_NPCHurtTypeTeam, ChConfig.Def_NPCHurtTypeSpecial]:
|
| | | elif isGameBoss and hurtType in [ChConfig.Def_NPCHurtTypePlayer, ChConfig.Def_NPCHurtTypeTeam, ChConfig.Def_NPCHurtTypeSpecial]:
|
| | | isOnlySelfSee = len(ownerPlayerList) > 1
|
| | | for curPlayer in ownerPlayerList:
|
| | | self.__NPCDropItem(curPlayer, ChConfig.Def_NPCHurtTypePlayer, curPlayer.GetPlayerID(), [curPlayer], isOnlySelfSee=isOnlySelfSee)
|
| | |
| | | å·¥å
·è·¯å¾\MiracleCode\TCode\TeamServer\Server4\Servers\IDDispatchServer |
| | | å·¥å
·è·¯å¾\MiracleCode\TCode\TeamServer\Server4\Servers\IDDispatchServer
|
| | | åæå·¥å
·\MiracleCode\TCode\TeamServer\Server4\Tools\ServerMergeTool_IDMix |