using System;
|
using LitJson;
|
using UnityEngine;
|
using System.Collections.Generic;
|
|
|
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)
|
{
|
|
}
|
|
public override void Init(int MapID, int FuncLineID, JsonData _extendData,
|
List<TeamBase> _redTeamList, List<TeamBase> _blueTeamList)
|
{
|
base.Init(MapID, FuncLineID, extendData, _redTeamList, _blueTeamList);
|
|
chapter = FuncLineID / 10000;
|
wave = MapID == 1 ? FuncLineID % 100 : 1;//第几波怪
|
level = (FuncLineID % 10000) / 100;
|
|
extendData = _extendData;
|
chapterConfig = MainChapterConfig.Get(chapter);
|
levelConfig = MainLevelConfig.Get(level);
|
|
SetBattleMode(BattleMode.Record);
|
}
|
|
public override void Release()
|
{
|
base.Release();
|
}
|
|
|
public override void AutoSetBattleMode()
|
{
|
SetBattleMode(BattleMode.Record);
|
}
|
|
public override void TurnFightState(int TurnNum, int State,
|
uint FuncLineID, JsonData extendData)
|
{
|
base.TurnFightState(TurnNum, State, FuncLineID, extendData);
|
|
switch (State)
|
{
|
// 起始状态标记
|
case 0:
|
break;
|
case 1://准备完毕
|
break;
|
case 2://战斗中
|
break;
|
case 3://战斗结束
|
break;
|
case 4://结算奖励
|
break;
|
case 5://结束状态标记
|
break;
|
default:
|
BattleDebug.LogError("recieve a unknown State");
|
break;
|
}
|
}
|
|
protected override void OnSettlement(JsonData turnFightStateData)
|
{
|
base.OnSettlement(turnFightStateData);
|
}
|
|
public override void WhaleFall()
|
{
|
UIManager.Instance.CloseWindow<FullScreenBattleWin>();
|
AutoFightModel.Instance.isPause = false;
|
Destroy();
|
}
|
|
|
|
public override void HaveRest()
|
{
|
// 主线BOSS战斗没有休息
|
}
|
|
|
// public override void OnBattleEnd(JsonData turnFightStateData)
|
// {
|
// base.OnBattleEnd(turnFightStateData);
|
// // HaveRest();
|
// }
|
|
public override void Run()
|
{
|
if (operationAgent == null)
|
{
|
//防范异常
|
return;
|
}
|
base.Run();
|
}
|
|
public override void DistributeNextPackage()
|
{
|
if (IsBattleFinish)
|
return;
|
|
// 不要调用base的函数
|
BattleManager.Instance.DistributeNextReportPackage(guid);
|
}
|
|
|
}
|