yyl
2 天以前 c124d98bdf9659cf764bebb799bee42c30eb152f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
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<StoryBossBattleWin>();
        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);
    }
 
    public override void ShowWindow(HB424_tagSCTurnFightInit vNetData)
    {
        StoryBossBattleWin fsBattleWin = UIManager.Instance.GetUI<StoryBossBattleWin>();// as FullScreenBattleWin;
        if (null == fsBattleWin)
        {
            fsBattleWin = UIManager.Instance.OpenWindow<StoryBossBattleWin>();
        }
        fsBattleWin.SetBattleField(this);
    }
}