| | |
| | | import PlayerControl
|
| | | import IPY_GameWorld
|
| | | import IpyGameDataPY
|
| | | import PyGameData
|
| | | import GameWorld
|
| | | import FBCommon
|
| | | import FBLogic
|
| | |
| | | def NPCRefresh_219(npcRefresh, tick):__DoRefreshWorldBoss(npcRefresh, tick)
|
| | | def NPCRefresh_220(npcRefresh, tick):__DoRefreshWorldBoss(npcRefresh, tick)
|
| | |
|
| | |
|
| | | def ResetActivityBossRefreshCount():
|
| | | ## 重置活动boss刷怪个数
|
| | | |
| | | # gameFb 要取活动线
|
| | | activityLineIndex = 0 # 活动线, 默认1线
|
| | | mapID = GameWorld.GetMap().GetMapID()
|
| | | activityMapLineDict = IpyGameDataPY.GetFuncEvalCfg("MapLine", 2, {})
|
| | | if mapID in activityMapLineDict:
|
| | | activityLineIndex = max(0, activityMapLineDict[mapID] - 1)
|
| | | |
| | | gameWorld = IPY_GameWorld.IPY_GameWorld(activityLineIndex)
|
| | | gameFB = gameWorld.GetGameFBByFbIndex(activityLineIndex)
|
| | | if not gameFB:
|
| | | return
|
| | | |
| | | gameNPC = GameWorld.GetNPCManager() # NPC标识点的无所谓,哪条线都可以,因为都一样
|
| | | for i in xrange(gameNPC.GetCustomNPCRefreshCount()):
|
| | | npcRefresh = gameNPC.GetCustomNPCRefreshAt(i)
|
| | | refreshMark = npcRefresh.GetRefreshMark()
|
| | | if gameFB.GetGameFBDictByKey(ChConfig.Map_NPC_ActivityBossRebornCount % refreshMark):
|
| | | gameFB.SetGameFBDict(ChConfig.Map_NPC_ActivityBossRebornCount % refreshMark, 0)
|
| | | GameWorld.DebugLog("重置活动boss刷怪点刷怪个数: activityLineIndex=%s,refreshMark=%s" % (activityLineIndex, refreshMark))
|
| | | return
|
| | |
|
| | | ## 世界boss刷怪
|
| | | # @param npcRefresh 刷新实例
|
| | | # @param tick 当前时间
|
| | |
| | | mapID = GameWorld.GetMap().GetMapID()
|
| | | refreshMark = npcRefresh.GetRefreshMark()
|
| | | lineID = GameWorld.GetGameWorld().GetLineID()
|
| | | relatedType, relatedID = 0, 0
|
| | | relatedType, relatedID = 0, ""
|
| | | isNeedShunt = 0
|
| | | if mapID == ChConfig.Def_FBMapID_SealDemon:
|
| | | bossID = GameLogic_SealDemon.CurFBLineBOSSID()
|
| | |
| | | return
|
| | | gameFB = GameWorld.GetGameFB()
|
| | | gameWorldMgr = GameWorld.GetGameWorld()
|
| | | isActivityBoss = False # 是否活动boss
|
| | | forceReborn = False # 强制重生
|
| | | actBossRebornSign = 0
|
| | | mapActBossRebornSign = 0
|
| | | # 关联日常活动
|
| | | if relatedType == 1:
|
| | | relatedID = int(relatedID)
|
| | | actionKey = ShareDefine.Def_Notify_WorldKey_DailyActionState % relatedID
|
| | | rebornBossState = 1 if gameWorldMgr.GetGameWorldDictByKey(actionKey) else 0
|
| | | isActivityBoss = True
|
| | | |
| | | # 关联运营活动,待扩展
|
| | | elif relatedType == 2:
|
| | | pass
|
| | | operationActionInfo = PyGameData.g_operationActionDict.get(relatedID, {})
|
| | | operationActionState = operationActionInfo.get(ShareDefine.ActKey_State, 0)
|
| | | rebornBossState = 1 if operationActionState else 0
|
| | | |
| | | else:
|
| | | bosskey = ShareDefine.Def_Notify_WorldKey_GameWorldBossReborn % bossID
|
| | | rebornBossState = gameWorldMgr.GetGameWorldDictByKey(bosskey)
|
| | |
| | | if mapID in activityMapLineDict:
|
| | | activityLineID = max(0, activityMapLineDict[mapID] - 1)
|
| | |
|
| | | # 活动boss只在活动线路刷
|
| | | if isActivityBoss:
|
| | | activityBossRebornCount = gameFB.GetGameFBDictByKey(ChConfig.Map_NPC_ActivityBossRebornCount % refreshMark)
|
| | | # 关联活动boss
|
| | | if relatedType:
|
| | | rebornLineID = activityLineID # 活动boss只刷在活动线
|
| | | # 不是活动线
|
| | | if rebornBossState and lineID != rebornLineID:
|
| | | rebornBossState = 0
|
| | | |
| | | # 关联活动boss只要复活标记与上次不同,则强制重生
|
| | | actBossRebornSign = gameWorldMgr.GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ActionBossRebornSign % relatedID)
|
| | | mapActBossRebornSign = gameFB.GetGameFBDictByKey(ChConfig.Map_NPC_ActBossLastRebornSign % refreshMark)
|
| | | rebornBossState = rebornBossState and actBossRebornSign
|
| | | if rebornBossState and actBossRebornSign != mapActBossRebornSign:
|
| | | forceReborn = True
|
| | |
|
| | | # 非活动boss活动线不刷, 1线除外
|
| | | else:
|
| | |
| | | # 复活状态
|
| | | if rebornBossState:
|
| | | if curNPC:
|
| | | if curNPC.GetNPCID() == bossID:
|
| | | if not forceReborn and curNPC.GetNPCID() == bossID:
|
| | | return
|
| | | #去掉非bossNPC
|
| | | NPCCommon.SetDeadEx(curNPC)
|
| | |
| | | if lineID != rebornLineID and not isNeedShunt and mapID not in [ChConfig.Def_FBMapID_SealDemon, ChConfig.Def_FBMapID_ZhuXianBoss]:
|
| | | return
|
| | |
|
| | | if isActivityBoss and activityBossRebornCount > 0:
|
| | | #GameWorld.DebugLog("活动线已经刷过不再刷活动boss: lineID=%s,rebornLineID=%s,refreshMark=%s,bossID=%s,activityBossRebornCount=%s" |
| | | # % (lineID, rebornLineID, refreshMark, bossID, activityBossRebornCount))
|
| | | if mapActBossRebornSign and actBossRebornSign == mapActBossRebornSign:
|
| | | #GameWorld.DebugLog("活动线已经刷过不再刷活动boss: lineID=%s,rebornLineID=%s,refreshMark=%s,bossID=%s,actBossRebornSign=%s" |
| | | # % (lineID, rebornLineID, refreshMark, bossID, actBossRebornSign))
|
| | | return
|
| | |
|
| | | # 死亡状态
|
| | |
| | | if curNPC.GetNPCID() == stoneNPCID:
|
| | | return
|
| | | # 活动的boss
|
| | | if curNPC.GetNPCID() == bossID and isActivityBoss:
|
| | | if curNPC.GetNPCID() == bossID and relatedType:
|
| | | GameWorld.Log("活动boss,活动结束,系统设置boss死亡!bossID=%s" % bossID)
|
| | | if relatedID == ShareDefine.DailyActionID_FamilyRobBoss:
|
| | | PlayerControl.FBNotify("FairyGrabBossNoDead", [bossID])
|
| | | elif relatedID == ShareDefine.OperationActionName_BossReborn:
|
| | | pass
|
| | |
|
| | | #去掉非墓碑NPC
|
| | | NPCCommon.SetDeadEx(curNPC)
|
| | |
| | | __InitNewBornNPC(npcRefresh, tick)
|
| | | gameFB.SetGameFBDict(key, tick)
|
| | |
|
| | | if isActivityBoss and rebornBossState:
|
| | | gameFB.SetGameFBDict(ChConfig.Map_NPC_ActivityBossRebornCount % refreshMark, activityBossRebornCount + 1)
|
| | | if actBossRebornSign and rebornBossState:
|
| | | gameFB.SetGameFBDict(ChConfig.Map_NPC_ActBossLastRebornSign % refreshMark, actBossRebornSign)
|
| | |
|
| | | GameWorld.DebugLog("BossRefresh mapID=%s,rebornLineID=%s,refreshMark=%s,rebornNPCID=%s,isNeedShunt=%s,OK!"
|
| | | % (mapID, rebornLineID, refreshMark, rebornNPCID, isNeedShunt), lineID)
|