| | |
| | | import ShareDefine
|
| | | import ReadChConfig
|
| | | import GameLogic_SealDemon
|
| | | import PlayerControl
|
| | | import IPY_GameWorld
|
| | | import IpyGameDataPY
|
| | | import GameWorld
|
| | |
| | | def NPCRefresh_100(npcRefresh, tick):__DoRefreshWorldBoss(npcRefresh, tick)
|
| | |
|
| | |
|
| | | def ResetActivityBossRefreshCount():
|
| | | ## 重置活动boss刷怪个数
|
| | | gameFB = GameWorld.GetGameFB()
|
| | | gameNPC = GameWorld.GetNPCManager()
|
| | | 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刷怪点刷怪个数: refreshMark=%s" % refreshMark)
|
| | | return
|
| | |
|
| | | ## 世界boss刷怪
|
| | | # @param npcRefresh 刷新实例
|
| | | # @param tick 当前时间
|
| | |
| | |
|
| | | gameFB = GameWorld.GetGameFB()
|
| | | gameWorldMgr = GameWorld.GetGameWorld()
|
| | | relatedType = ipyData.GetRelatedType()
|
| | | relatedID = ipyData.GetRelatedID()
|
| | | isActivityBoss = False
|
| | | # 关联日常活动
|
| | | if relatedType == 1:
|
| | | actionKey = ShareDefine.Def_Notify_WorldKey_DailyActionState % relatedID
|
| | | rebornBossState = 1 if gameWorldMgr.GetGameWorldDictByKey(actionKey) else 0
|
| | | isActivityBoss = True
|
| | | # 关联运营活动,待扩展
|
| | | elif relatedType == 2:
|
| | | pass
|
| | | else:
|
| | | bosskey = ShareDefine.Def_Notify_WorldKey_GameWorldBossReborn % bossID
|
| | | rebornBossState = gameWorldMgr.GetGameWorldDictByKey(bosskey)
|
| | | isNeedShunt = NPCCommon.IsMapNeedBossShunt(mapID)
|
| | | |
| | | rebornLineID = 0
|
| | | activityLineID = 0 # 活动线, 默认1线
|
| | | activityMapLineDict = IpyGameDataPY.GetFuncEvalCfg("MapLine", 2, {})
|
| | | if mapID in activityMapLineDict:
|
| | | activityLineID = max(0, activityMapLineDict[mapID] - 1)
|
| | | |
| | | # 活动boss只在活动线路刷
|
| | | if isActivityBoss:
|
| | | activityBossRebornCount = gameFB.GetGameFBDictByKey(ChConfig.Map_NPC_ActivityBossRebornCount % refreshMark)
|
| | | rebornLineID = activityLineID # 活动boss只刷在活动线
|
| | | # 不是活动线 |
| | | if rebornBossState and lineID != rebornLineID:
|
| | | rebornBossState = 0
|
| | | |
| | | # 非活动boss活动线不刷, 1线除外
|
| | | else:
|
| | | if activityLineID and lineID == activityLineID:
|
| | | rebornBossState = 0
|
| | | stoneNPCID = 0 # 活动线暂不刷墓碑
|
| | | |
| | | isNeedShunt = NPCCommon.IsMapNeedBossShunt(mapID) and ipyData.GetIsNeedShunt()
|
| | |
|
| | | curNPC = None
|
| | | if npcRefresh.GetCount() > 0:
|
| | |
| | | #去掉非bossNPC
|
| | | NPCCommon.SetDeadEx(curNPC)
|
| | |
|
| | | # 非一线 且 不需要分流的地图 且 不是封魔坛 不允许复活
|
| | | if lineID != 0 and not isNeedShunt and mapID != ChConfig.Def_FBMapID_SealDemon:
|
| | | # 非复活线 且 不需要分流的地图 且 不是封魔坛 不允许复活
|
| | | if lineID != rebornLineID and not isNeedShunt and mapID != ChConfig.Def_FBMapID_SealDemon:
|
| | | return
|
| | | |
| | | if isActivityBoss and activityBossRebornCount > 0:
|
| | | #GameWorld.DebugLog("活动线已经刷过不再刷活动boss: lineID=%s,rebornLineID=%s,refreshMark=%s,bossID=%s,activityBossRebornCount=%s" |
| | | # % (lineID, rebornLineID, refreshMark, bossID, activityBossRebornCount))
|
| | | return
|
| | |
|
| | | # 死亡状态
|
| | |
| | | return
|
| | | if curNPC.GetNPCID() == stoneNPCID:
|
| | | return
|
| | | # 活动的boss
|
| | | if curNPC.GetNPCID() == bossID and isActivityBoss:
|
| | | GameWorld.Log("活动boss,活动结束,系统设置boss死亡!bossID=%s" % bossID)
|
| | | PlayerControl.FBNotify("FairyGrabBossNoDead", [bossID])
|
| | | |
| | | #去掉非墓碑NPC
|
| | | NPCCommon.SetDeadEx(curNPC)
|
| | |
|
| | |
| | | #初始化NPC
|
| | | __InitNewBornNPC(npcRefresh, tick)
|
| | | gameFB.SetGameFBDict(key, tick)
|
| | | GameWorld.DebugLog("BossRefresh mapID=%s,refreshMark=%s,rebornNPCID=%s,isNeedShunt=%s,OK!" % (mapID, refreshMark, rebornNPCID, isNeedShunt), lineID)
|
| | | |
| | | if isActivityBoss and rebornBossState:
|
| | | gameFB.SetGameFBDict(ChConfig.Map_NPC_ActivityBossRebornCount % refreshMark, activityBossRebornCount + 1)
|
| | | |
| | | GameWorld.DebugLog("BossRefresh mapID=%s,rebornLineID=%s,refreshMark=%s,rebornNPCID=%s,isNeedShunt=%s,OK!" |
| | | % (mapID, rebornLineID, refreshMark, rebornNPCID, isNeedShunt), lineID)
|
| | | return
|
| | |
|
| | | def IsShuntBossNeedProcess(curNPC):
|