| | |
| | | using LitJson; |
| | | using UnityEngine; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | |
| | | |
| | | public class StoryBossBattleField : BattleField |
| | | { |
| | | protected int chapter;// 章节 |
| | | protected int wave;// 波数 |
| | | protected int level;// 关卡 |
| | | protected JsonData extendData; |
| | | |
| | | protected MainChapterConfig chapterConfig; |
| | | |
| | | protected MainLevelConfig levelConfig; |
| | | |
| | | |
| | | public StoryBossBattleField(string _guid) : base(_guid) |
| | | { |
| | |
| | | { |
| | | base.Init(MapID, FuncLineID, extendData, _redTeamList, _blueTeamList, turnMax); |
| | | |
| | | chapter = FuncLineID / 10000; |
| | | wave = MapID == 1 ? FuncLineID % 100 : 1;//第几波怪 |
| | | level = (FuncLineID % 10000) / 100; |
| | | |
| | | int level = FuncLineID;// 关卡 |
| | | extendData = _extendData; |
| | | chapterConfig = MainChapterConfig.Get(chapter); |
| | | levelConfig = MainLevelConfig.Get(level); |
| | | |
| | | SetBattleMode(BattleMode.Record); |
| | |
| | | } |
| | | fsBattleWin.SetBattleField(this); |
| | | } |
| | | |
| | | public NPCLineupConfig GetBossLineupConfig() |
| | | { |
| | | if (null == levelConfig) |
| | | return null; |
| | | |
| | | int[] bossLineup = levelConfig.BossLineupIDList; |
| | | |
| | | if (bossLineup.IsNullOrEmpty()) |
| | | return null; |
| | | |
| | | var lineupID = bossLineup[0]; |
| | | |
| | | if (lineupID > 0) |
| | | { |
| | | NPCLineupConfig lineupConfig = NPCLineupConfig.Get(lineupID); |
| | | return lineupConfig; |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | public override BattleObject FindBoss() |
| | | { |
| | | NPCLineupConfig lineupConfig = GetBossLineupConfig(); |
| | | if (lineupConfig != null) |
| | | { |
| | | int bossId = lineupConfig.BossID; |
| | | |
| | | BattleObject bo = battleObjMgr.allBattleObjDict.Values.FirstOrDefault(bo => bo.teamHero.NPCID == bossId); |
| | | |
| | | return bo; |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | } |