#!/usr/bin/python
|
# -*- coding: GBK -*-
|
#-------------------------------------------------------------------------------
|
#
|
##@package GameWorldLogic.FBProcess.GameLogic_PersonalBoss
|
#
|
# @todo:¸öÈËBoss¡¢VIPBoss
|
# @author hxp
|
# @date 2019-05-23
|
# @version 1.0
|
#
|
# ÏêϸÃèÊö: ¸öÈËBoss¡¢VIPBoss
|
# ±¾¸±±¾×öǰ¶Ë×Ô¶¨Ò峡¾°´¦Àí£¬ºó¶ËÎÞʵ¼ÊµØÍ¼
|
#
|
#-------------------------------------------------------------------------------
|
#"""Version = 2019-05-23 17:30"""
|
#-------------------------------------------------------------------------------
|
|
import FBCommon
|
import GameWorld
|
import EventReport
|
import PlayerBossReborn
|
import PlayerNewFairyCeremony
|
import PlayerFairyCeremony
|
import IpyGameDataPY
|
import NPCCommon
|
import ChConfig
|
|
## ÊÇ·ñÄܹ»Í¨¹ý»î¶¯²éѯ½øÈë
|
def OnEnterFBEvent(curPlayer, mapID, lineID, tick):
|
curfbStar = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID, False, [mapID])
|
if not curfbStar:
|
#GameWorld.DebugLog("OnEnterFBEvent Ê״νøÈë¸öÈËbossÃâ·Ñ!mapID=%s,lineID=%s" % (mapID, lineID))
|
return True
|
|
enterCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_EnterFbCntDay % mapID)
|
maxCnt = FBCommon.GetEnterFBMaxCnt(curPlayer, mapID)
|
if enterCnt >= maxCnt:
|
GameWorld.ErrLog("´ÎÊý²»×㣬ÎÞ·¨½øÈë¸öÈËboss! mapID=%s,lineID=%s" % (mapID, lineID), curPlayer.GetPlayerID())
|
return False
|
|
return True
|
|
## ÊÇ·ñÐèÒª×ö½øÈ븱±¾Í¨Óüì²éÌõ¼þÂß¼£¬Ä¬ÈÏÐèÒª¼ì²é
|
def OnNeedCheckCanEnterFBComm(curPlayer, mapID, lineID):
|
## ½øÐÐÖеIJ»ÐèÒªÖØ¸´¼ì²é£¬·ÀÖ¹¶ÏÏßÖØÁ¬±»½ûÖ¹½øÈë
|
if FBCommon.GetCustomMapStep(curPlayer, mapID, lineID) == ChConfig.CustomMapStep_Fight:
|
GameWorld.DebugLog("VIPBossÒѾÔÚ½øÐÐÖУ¬±¾´Î½øÈë²»ÐèÒªÖØÐ¼ì²é!")
|
return False
|
return True
|
|
## ¿Í»§¶Ë½øÈë×Ô¶¨Ò峡¾°
|
def OnEnterCustomScene(curPlayer, mapID, lineID):
|
|
if FBCommon.GetCustomMapStep(curPlayer, mapID, lineID) != ChConfig.CustomMapStep_Fight:
|
FBCommon.SetCustomMapStep(curPlayer, mapID, lineID, ChConfig.CustomMapStep_Fight)
|
EventReport.WriteEvent_FB(curPlayer, ChConfig.Def_FBMapID_PersonalBoss, 0, ChConfig.CME_Log_Start)
|
|
return
|
|
## ×Ô¶¨Ò峡¾°¸±±¾»÷ɱNPC
|
def DoCustomScene_Player_KillNPC(curPlayer, curNPC, mapID, lineID):
|
|
npcID = curNPC.GetNPCID()
|
bossID = __GetPersonalBossID(lineID)
|
GameWorld.DebugLog("¸öÈËboss³¡¾°»÷ɱNPC: npcID=%s,bossID=%s" % (npcID, bossID), curPlayer.GetPlayerID())
|
if npcID != bossID:
|
return
|
|
if FBCommon.GetCustomMapStep(curPlayer, mapID, lineID) != ChConfig.CustomMapStep_Fight:
|
return
|
|
curfbStar = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID, False, [mapID])
|
# Ê״ιý¹Ø²»¿Û´ÎÊý
|
if not curfbStar:
|
GameWorld.DebugLog(" Ê״ιý¹Ø£¡mapID=%s,lineID=%s" % (mapID, lineID), curPlayer.GetPlayerID())
|
GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID, 1, False, [mapID])
|
FBCommon.Sync_FBPlayerFBInfoData(curPlayer, mapID) # ͬ²½ÐÅÏ¢
|
else:
|
#Ôö¼Ó½øÈë´ÎÊý
|
FBCommon.AddEnterFBCount(curPlayer, ChConfig.Def_FBMapID_PersonalBoss)
|
|
FBCommon.DelFBEnterTicket(curPlayer, ChConfig.Def_FBMapID_PersonalBoss)
|
PlayerBossReborn.AddBossRebornActionCnt(curPlayer, ChConfig.Def_BRAct_VIPBOSS, 1)
|
PlayerFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_VIPBoss, 1)
|
PlayerNewFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_VIPBoss, 1)
|
|
npcCountDict = {bossID:1}
|
dropItemMapInfo = [0, 0]
|
jsonItemList = NPCCommon.GiveKillNPCDropPrize(curPlayer, mapID, npcCountDict, dropItemMapInfo=dropItemMapInfo, isVirtualDrop=True)[0]
|
FBCommon.SetCustomMapStep(curPlayer, mapID, lineID, ChConfig.CustomMapStep_Over)
|
isPass = 1
|
overDict = {FBCommon.Over_itemInfo:jsonItemList}
|
FBCommon.NotifyFBOver(curPlayer, mapID, lineID, isPass, overDict)
|
return
|
|
def __GetPersonalBossID(lineID):
|
## VIPbossID
|
ipyData = IpyGameDataPY.GetIpyGameData('PersonalBoss', lineID)
|
if not ipyData:
|
return 0
|
return ipyData.GetNPCID()
|
|