using System;
|
using LitJson;
|
using UnityEngine;
|
using System.Collections.Generic;
|
|
public class StoryBattleField : BattleField
|
{
|
protected int chapter;// 章节
|
protected int wave;// 波数
|
protected int level;// 关卡
|
protected JsonData extendData;
|
|
protected MainChapterConfig chapterConfig;
|
|
protected MainLevelConfig levelConfig;
|
|
public StoryBattleField() : base(string.Empty)
|
{
|
|
}
|
|
public override void Init(int MapID, int FuncLineID, JsonData _extendData,
|
List<TeamBase> _redTeamList, List<TeamBase> _blueTeamList)
|
{
|
base.Init(MapID, FuncLineID, extendData, _redTeamList, _blueTeamList);
|
|
LoadBattleMode();
|
|
chapter = FuncLineID / 10000;
|
wave = MapID == 1 ? FuncLineID % 100 : 1;//第几波怪
|
level = (FuncLineID % 10000) / 100;
|
|
extendData = _extendData;
|
chapterConfig = MainChapterConfig.Get(chapter);
|
levelConfig = MainLevelConfig.Get(level);
|
|
}
|
|
protected void LoadBattleMode()
|
{
|
string savedStr = LocalSave.GetString("StoryBattleFieldBattleMode");
|
if (string.IsNullOrEmpty(savedStr))
|
{
|
savedStr = "Hand";
|
}
|
SetBattleMode((BattleMode)Enum.Parse(typeof(BattleMode), savedStr));
|
}
|
|
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:
|
Debug.LogError("recieve a unknown State");
|
break;
|
}
|
}
|
|
public override void OnTurnFightObjAction(int turnNum, int ObjID)
|
{
|
base.OnTurnFightObjAction(turnNum, ObjID);
|
}
|
|
public override void OnTurnFightState(int turnNum, int State, int FuncLineID, JsonData extendData)
|
{
|
base.OnTurnFightState(turnNum, State, FuncLineID, extendData);
|
|
}
|
|
// public override void Run()
|
// {
|
// // 一定要记住这个
|
// if (IsPause)
|
// return;
|
|
// base.Run();
|
// }
|
}
|